aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-13 01:43:25 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-13 01:43:25 -0500
commitd9bc125caf592b7d081021f32ce5b717efdf70c8 (patch)
tree263b7066ba22ddce21db610c0300f6eaac6f2064 /include
parent43d78ef2ba5bec26d0315859e8324bfc0be23766 (diff)
parentec2f9d1331f658433411c58077871e1eef4ee1b4 (diff)
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Conflicts: net/sunrpc/auth_gss/gss_krb5_crypto.c net/sunrpc/auth_gss/gss_spkm3_token.c net/sunrpc/clnt.c Merge with mainline and fix conflicts.
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h13
-rw-r--r--include/acpi/acdebug.h8
-rw-r--r--include/acpi/acdisasm.h22
-rw-r--r--include/acpi/acdispat.h4
-rw-r--r--include/acpi/acevents.h2
-rw-r--r--include/acpi/acexcep.h10
-rw-r--r--include/acpi/acglobal.h117
-rw-r--r--include/acpi/achware.h6
-rw-r--r--include/acpi/acinterp.h14
-rw-r--r--include/acpi/aclocal.h77
-rw-r--r--include/acpi/acmacros.h71
-rw-r--r--include/acpi/acnames.h2
-rw-r--r--include/acpi/acnamesp.h21
-rw-r--r--include/acpi/acobject.h19
-rw-r--r--include/acpi/acopcode.h4
-rw-r--r--include/acpi/acoutput.h2
-rw-r--r--include/acpi/acparser.h2
-rw-r--r--include/acpi/acpi.h2
-rw-r--r--include/acpi/acpi_bus.h23
-rw-r--r--include/acpi/acpi_drivers.h15
-rw-r--r--include/acpi/acpiosxf.h8
-rw-r--r--include/acpi/acpixf.h34
-rw-r--r--include/acpi/acresrc.h2
-rw-r--r--include/acpi/acstruct.h5
-rw-r--r--include/acpi/actables.h106
-rw-r--r--include/acpi/actbl.h333
-rw-r--r--include/acpi/actbl1.h568
-rw-r--r--include/acpi/actbl2.h49
-rw-r--r--include/acpi/actbl71.h134
-rw-r--r--include/acpi/actypes.h106
-rw-r--r--include/acpi/acutils.h8
-rw-r--r--include/acpi/amlcode.h4
-rw-r--r--include/acpi/amlresrc.h2
-rw-r--r--include/acpi/platform/acenv.h2
-rw-r--r--include/acpi/platform/acgcc.h2
-rw-r--r--include/acpi/platform/aclinux.h2
-rw-r--r--include/asm-alpha/io.h9
-rw-r--r--include/asm-alpha/mman.h1
-rw-r--r--include/asm-alpha/pci.h2
-rw-r--r--include/asm-alpha/percpu.h14
-rw-r--r--include/asm-alpha/termios.h18
-rw-r--r--include/asm-arm/arch-at91rm9200/gpio.h48
-rw-r--r--include/asm-arm/arch-imx/spi_imx.h72
-rw-r--r--include/asm-arm/arch-ixp4xx/io.h3
-rw-r--r--include/asm-arm/arch-omap/gpio.h66
-rw-r--r--include/asm-arm/arch-pxa/gpio.h72
-rw-r--r--include/asm-arm/arch-s3c2410/gpio.h65
-rw-r--r--include/asm-arm/arch-sa1100/gpio.h81
-rw-r--r--include/asm-arm/gpio.h7
-rw-r--r--include/asm-arm/hardware/gpio_keys.h17
-rw-r--r--include/asm-arm/io.h5
-rw-r--r--include/asm-arm/spinlock.h1
-rw-r--r--include/asm-arm/termios.h18
-rw-r--r--include/asm-arm/uaccess.h4
-rw-r--r--include/asm-arm26/termios.h18
-rw-r--r--include/asm-arm26/uaccess-asm.h4
-rw-r--r--include/asm-avr32/arch-at32ap/at32ap7000.h2
-rw-r--r--include/asm-avr32/arch-at32ap/gpio.h27
-rw-r--r--include/asm-avr32/arch-at32ap/irq.h14
-rw-r--r--include/asm-avr32/arch-at32ap/portmux.h8
-rw-r--r--include/asm-avr32/checksum.h2
-rw-r--r--include/asm-avr32/dma-mapping.h8
-rw-r--r--include/asm-avr32/gpio.h6
-rw-r--r--include/asm-avr32/irq.h8
-rw-r--r--include/asm-avr32/posix_types.h2
-rw-r--r--include/asm-avr32/termios.h18
-rw-r--r--include/asm-avr32/uaccess.h6
-rw-r--r--include/asm-cris/io.h5
-rw-r--r--include/asm-cris/semaphore-helper.h9
-rw-r--r--include/asm-cris/system.h3
-rw-r--r--include/asm-cris/termios.h18
-rw-r--r--include/asm-frv/termios.h18
-rw-r--r--include/asm-generic/dma-mapping-broken.h4
-rw-r--r--include/asm-generic/gpio.h25
-rw-r--r--include/asm-generic/memory_model.h2
-rw-r--r--include/asm-generic/mman.h1
-rw-r--r--include/asm-h8300/termios.h18
-rw-r--r--include/asm-i386/acpi.h24
-rw-r--r--include/asm-i386/atomic.h4
-rw-r--r--include/asm-i386/bitops.h4
-rw-r--r--include/asm-i386/io.h6
-rw-r--r--include/asm-i386/mach-es7000/mach_mpparse.h17
-rw-r--r--include/asm-i386/setup.h2
-rw-r--r--include/asm-i386/termios.h18
-rw-r--r--include/asm-i386/uaccess.h4
-rw-r--r--include/asm-ia64/acpi.h10
-rw-r--r--include/asm-ia64/dma.h2
-rw-r--r--include/asm-ia64/esi.h1
-rw-r--r--include/asm-ia64/machvec.h3
-rw-r--r--include/asm-ia64/meminit.h3
-rw-r--r--include/asm-ia64/pgalloc.h3
-rw-r--r--include/asm-ia64/setup.h2
-rw-r--r--include/asm-ia64/sn/acpi.h3
-rw-r--r--include/asm-ia64/sn/pcibr_provider.h2
-rw-r--r--include/asm-ia64/sn/pcidev.h8
-rw-r--r--include/asm-ia64/swiotlb.h9
-rw-r--r--include/asm-ia64/termios.h18
-rw-r--r--include/asm-ia64/thread_info.h4
-rw-r--r--include/asm-ia64/unistd.h4
-rw-r--r--include/asm-m32r/a.out.h2
-rw-r--r--include/asm-m32r/addrspace.h1
-rw-r--r--include/asm-m32r/bugs.h2
-rw-r--r--include/asm-m32r/byteorder.h2
-rw-r--r--include/asm-m32r/cache.h2
-rw-r--r--include/asm-m32r/cacheflush.h1
-rw-r--r--include/asm-m32r/current.h3
-rw-r--r--include/asm-m32r/delay.h2
-rw-r--r--include/asm-m32r/dma.h2
-rw-r--r--include/asm-m32r/errno.h3
-rw-r--r--include/asm-m32r/ide.h6
-rw-r--r--include/asm-m32r/ioctls.h5
-rw-r--r--include/asm-m32r/ipcbuf.h4
-rw-r--r--include/asm-m32r/kmap_types.h4
-rw-r--r--include/asm-m32r/m32104ut/m32104ut_pld.h11
-rw-r--r--include/asm-m32r/m32700ut/m32700ut_lan.h13
-rw-r--r--include/asm-m32r/m32700ut/m32700ut_lcd.h13
-rw-r--r--include/asm-m32r/m32700ut/m32700ut_pld.h13
-rw-r--r--include/asm-m32r/mappi2/mappi2_pld.h13
-rw-r--r--include/asm-m32r/mappi3/mappi3_pld.h11
-rw-r--r--include/asm-m32r/mc146818rtc.h3
-rw-r--r--include/asm-m32r/mman.h2
-rw-r--r--include/asm-m32r/mmu.h10
-rw-r--r--include/asm-m32r/mmu_context.h9
-rw-r--r--include/asm-m32r/module.h3
-rw-r--r--include/asm-m32r/msgbuf.h4
-rw-r--r--include/asm-m32r/namei.h4
-rw-r--r--include/asm-m32r/opsput/opsput_lan.h13
-rw-r--r--include/asm-m32r/opsput/opsput_lcd.h13
-rw-r--r--include/asm-m32r/opsput/opsput_pld.h13
-rw-r--r--include/asm-m32r/page.h5
-rw-r--r--include/asm-m32r/param.h4
-rw-r--r--include/asm-m32r/pci.h2
-rw-r--r--include/asm-m32r/pgalloc.h3
-rw-r--r--include/asm-m32r/pgtable-2level.h3
-rw-r--r--include/asm-m32r/posix_types.h4
-rw-r--r--include/asm-m32r/rtc.h4
-rw-r--r--include/asm-m32r/scatterlist.h2
-rw-r--r--include/asm-m32r/sections.h1
-rw-r--r--include/asm-m32r/segment.h4
-rw-r--r--include/asm-m32r/sembuf.h4
-rw-r--r--include/asm-m32r/setup.h4
-rw-r--r--include/asm-m32r/shmbuf.h4
-rw-r--r--include/asm-m32r/shmparam.h2
-rw-r--r--include/asm-m32r/sigcontext.h3
-rw-r--r--include/asm-m32r/siginfo.h2
-rw-r--r--include/asm-m32r/signal.h4
-rw-r--r--include/asm-m32r/smp.h3
-rw-r--r--include/asm-m32r/sockios.h2
-rw-r--r--include/asm-m32r/spinlock_types.h2
-rw-r--r--include/asm-m32r/stat.h4
-rw-r--r--include/asm-m32r/string.h2
-rw-r--r--include/asm-m32r/syscall.h3
-rw-r--r--include/asm-m32r/system.h2
-rw-r--r--include/asm-m32r/termbits.h4
-rw-r--r--include/asm-m32r/termios.h20
-rw-r--r--include/asm-m32r/timex.h3
-rw-r--r--include/asm-m32r/tlbflush.h1
-rw-r--r--include/asm-m32r/types.h6
-rw-r--r--include/asm-m32r/uaccess.h4
-rw-r--r--include/asm-m32r/ucontext.h2
-rw-r--r--include/asm-m32r/unaligned.h8
-rw-r--r--include/asm-m32r/unistd.h2
-rw-r--r--include/asm-m32r/user.h6
-rw-r--r--include/asm-m32r/vga.h4
-rw-r--r--include/asm-m32r/xor.h2
-rw-r--r--include/asm-m68k/math-emu.h15
-rw-r--r--include/asm-m68k/termios.h18
-rw-r--r--include/asm-m68k/user.h2
-rw-r--r--include/asm-m68knommu/bitops.h1
-rw-r--r--include/asm-mips/apm.h64
-rw-r--r--include/asm-mips/bootinfo.h4
-rw-r--r--include/asm-mips/ddb5xxx/ddb5477.h41
-rw-r--r--include/asm-mips/dec/interrupts.h3
-rw-r--r--include/asm-mips/dec/system.h3
-rw-r--r--include/asm-mips/dec/tc.h41
-rw-r--r--include/asm-mips/dec/tcinfo.h47
-rw-r--r--include/asm-mips/dec/tcmodule.h39
-rw-r--r--include/asm-mips/dma.h1
-rw-r--r--include/asm-mips/emma2rh/emma2rh.h5
-rw-r--r--include/asm-mips/emma2rh/markeins.h1
-rw-r--r--include/asm-mips/i8259.h3
-rw-r--r--include/asm-mips/io.h10
-rw-r--r--include/asm-mips/irq.h2
-rw-r--r--include/asm-mips/irq_cpu.h6
-rw-r--r--include/asm-mips/mach-au1x00/au1000.h1
-rw-r--r--include/asm-mips/mach-cobalt/cobalt.h4
-rw-r--r--include/asm-mips/mach-emma2rh/irq.h2
-rw-r--r--include/asm-mips/mach-generic/irq.h32
-rw-r--r--include/asm-mips/mach-mips/irq.h2
-rw-r--r--include/asm-mips/mach-vr41xx/irq.h11
-rw-r--r--include/asm-mips/mips-boards/atlasint.h4
-rw-r--r--include/asm-mips/mips-boards/maltaint.h4
-rw-r--r--include/asm-mips/mips-boards/prom.h1
-rw-r--r--include/asm-mips/mips-boards/seadint.h4
-rw-r--r--include/asm-mips/mips-boards/simint.h3
-rw-r--r--include/asm-mips/mips_mt.h3
-rw-r--r--include/asm-mips/mipsmtregs.h2
-rw-r--r--include/asm-mips/mman.h1
-rw-r--r--include/asm-mips/page.h25
-rw-r--r--include/asm-mips/rtlx.h3
-rw-r--r--include/asm-mips/sections.h2
-rw-r--r--include/asm-mips/sgi/ip22.h13
-rw-r--r--include/asm-mips/sigcontext.h4
-rw-r--r--include/asm-mips/smtc_ipi.h3
-rw-r--r--include/asm-mips/termios.h18
-rw-r--r--include/asm-mips/uaccess.h8
-rw-r--r--include/asm-mips/vr41xx/cmbvr4133.h5
-rw-r--r--include/asm-parisc/io.h9
-rw-r--r--include/asm-parisc/mman.h1
-rw-r--r--include/asm-parisc/termios.h18
-rw-r--r--include/asm-powerpc/Kbuild1
-rw-r--r--include/asm-powerpc/cputable.h13
-rw-r--r--include/asm-powerpc/dcr.h1
-rw-r--r--include/asm-powerpc/elf.h2
-rw-r--r--include/asm-powerpc/firmware.h10
-rw-r--r--include/asm-powerpc/fs_pd.h49
-rw-r--r--include/asm-powerpc/hvcall.h1
-rw-r--r--include/asm-powerpc/io.h6
-rw-r--r--include/asm-powerpc/iommu.h1
-rw-r--r--include/asm-powerpc/ipic.h2
-rw-r--r--include/asm-powerpc/irq.h3
-rw-r--r--include/asm-powerpc/kprobes.h7
-rw-r--r--include/asm-powerpc/mmu.h1
-rw-r--r--include/asm-powerpc/mpc52xx.h2
-rw-r--r--include/asm-powerpc/mpc8260.h24
-rw-r--r--include/asm-powerpc/mpc8xx.h28
-rw-r--r--include/asm-powerpc/mpic.h24
-rw-r--r--include/asm-powerpc/oprofile_impl.h89
-rw-r--r--include/asm-powerpc/pci-bridge.h2
-rw-r--r--include/asm-powerpc/ps3.h234
-rw-r--r--include/asm-powerpc/ps3av.h738
-rw-r--r--include/asm-powerpc/ps3fb.h56
-rw-r--r--include/asm-powerpc/reg.h14
-rw-r--r--include/asm-powerpc/smp.h1
-rw-r--r--include/asm-powerpc/spu.h13
-rw-r--r--include/asm-powerpc/spu_priv1.h2
-rw-r--r--include/asm-powerpc/sstep.h1
-rw-r--r--include/asm-powerpc/termios.h18
-rw-r--r--include/asm-powerpc/time.h2
-rw-r--r--include/asm-powerpc/udbg.h2
-rw-r--r--include/asm-ppc/commproc.h1
-rw-r--r--include/asm-ppc/ibm4xx.h1
-rw-r--r--include/asm-ppc/io.h2
-rw-r--r--include/asm-ppc/m48t35.h77
-rw-r--r--include/asm-ppc/reg_booke.h2
-rw-r--r--include/asm-ppc/serial.h2
-rw-r--r--include/asm-s390/ccwdev.h2
-rw-r--r--include/asm-s390/compat.h28
-rw-r--r--include/asm-s390/etr.h219
-rw-r--r--include/asm-s390/hardirq.h2
-rw-r--r--include/asm-s390/io.h75
-rw-r--r--include/asm-s390/kdebug.h3
-rw-r--r--include/asm-s390/lowcore.h6
-rw-r--r--include/asm-s390/mmu_context.h50
-rw-r--r--include/asm-s390/pgalloc.h85
-rw-r--r--include/asm-s390/pgtable.h147
-rw-r--r--include/asm-s390/processor.h27
-rw-r--r--include/asm-s390/ptrace.h11
-rw-r--r--include/asm-s390/reset.h3
-rw-r--r--include/asm-s390/sclp.h39
-rw-r--r--include/asm-s390/sections.h2
-rw-r--r--include/asm-s390/setup.h23
-rw-r--r--include/asm-s390/sfp-util.h66
-rw-r--r--include/asm-s390/smp.h6
-rw-r--r--include/asm-s390/system.h4
-rw-r--r--include/asm-s390/tape390.h72
-rw-r--r--include/asm-s390/termios.h18
-rw-r--r--include/asm-s390/timer.h3
-rw-r--r--include/asm-s390/timex.h50
-rw-r--r--include/asm-s390/tlbflush.h9
-rw-r--r--include/asm-s390/uaccess.h2
-rw-r--r--include/asm-sh/apm.h46
-rw-r--r--include/asm-sh/termios.h18
-rw-r--r--include/asm-sh64/termios.h18
-rw-r--r--include/asm-sparc/io.h29
-rw-r--r--include/asm-sparc/termios.h18
-rw-r--r--include/asm-sparc64/irq.h4
-rw-r--r--include/asm-sparc64/pbm.h28
-rw-r--r--include/asm-sparc64/setup.h2
-rw-r--r--include/asm-sparc64/termios.h18
-rw-r--r--include/asm-um/elf-ppc.h2
-rw-r--r--include/asm-um/processor-x86_64.h6
-rw-r--r--include/asm-um/ptrace-x86_64.h9
-rw-r--r--include/asm-v850/termios.h18
-rw-r--r--include/asm-x86_64/acpi.h24
-rw-r--r--include/asm-x86_64/bootsetup.h2
-rw-r--r--include/asm-x86_64/io.h6
-rw-r--r--include/asm-x86_64/proto.h1
-rw-r--r--include/asm-x86_64/setup.h2
-rw-r--r--include/asm-x86_64/swiotlb.h8
-rw-r--r--include/asm-x86_64/termios.h18
-rw-r--r--include/asm-x86_64/uaccess.h4
-rw-r--r--include/asm-xtensa/mman.h1
-rw-r--r--include/asm-xtensa/termios.h19
-rw-r--r--include/crypto/algapi.h24
-rw-r--r--include/linux/Kbuild5
-rw-r--r--include/linux/acpi.h339
-rw-r--r--include/linux/apm-emulation.h (renamed from include/asm-arm/apm.h)8
-rw-r--r--include/linux/ata.h13
-rw-r--r--include/linux/atalk.h2
-rw-r--r--include/linux/atmarp.h2
-rw-r--r--include/linux/blkdev.h1
-rw-r--r--include/linux/buffer_head.h12
-rw-r--r--include/linux/byteorder/Kbuild2
-rw-r--r--include/linux/byteorder/pdp_endian.h88
-rw-r--r--include/linux/byteorder/swabb.h13
-rw-r--r--include/linux/cfag12864b.h77
-rw-r--r--include/linux/coda_linux.h6
-rw-r--r--include/linux/compiler-gcc.h7
-rw-r--r--include/linux/console.h4
-rw-r--r--include/linux/console_struct.h3
-rw-r--r--include/linux/cpu.h12
-rw-r--r--include/linux/cpuset.h2
-rw-r--r--include/linux/crypto.h148
-rw-r--r--include/linux/device.h50
-rw-r--r--include/linux/dma-mapping.h29
-rw-r--r--include/linux/dmapool.h7
-rw-r--r--include/linux/dn.h2
-rw-r--r--include/linux/efs_fs.h2
-rw-r--r--include/linux/eisa.h10
-rw-r--r--include/linux/ext3_fs.h10
-rw-r--r--include/linux/ext4_fs.h10
-rw-r--r--include/linux/fb.h38
-rw-r--r--include/linux/fs.h22
-rw-r--r--include/linux/genhd.h10
-rw-r--r--include/linux/gfp.h4
-rw-r--r--include/linux/gigaset_dev.h2
-rw-r--r--include/linux/hid-debug.h749
-rw-r--r--include/linux/hid.h18
-rw-r--r--include/linux/i2c-id.h2
-rw-r--r--include/linux/ide.h31
-rw-r--r--include/linux/if_packet.h10
-rw-r--r--include/linux/init.h7
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/interrupt.h6
-rw-r--r--include/linux/io.h15
-rw-r--r--include/linux/ioport.h20
-rw-r--r--include/linux/irq.h4
-rw-r--r--include/linux/kernel.h13
-rw-r--r--include/linux/kfifo.h6
-rw-r--r--include/linux/kobject.h4
-rw-r--r--include/linux/ks0108.h46
-rw-r--r--include/linux/ktime.h6
-rw-r--r--include/linux/kvm.h5
-rw-r--r--include/linux/libata.h131
-rw-r--r--include/linux/list.h67
-rw-r--r--include/linux/lockdep.h3
-rw-r--r--include/linux/log2.h11
-rw-r--r--include/linux/magic.h1
-rw-r--r--include/linux/mc146818rtc.h10
-rw-r--r--include/linux/minix_fs.h25
-rw-r--r--include/linux/mm.h18
-rw-r--r--include/linux/mm_inline.h13
-rw-r--r--include/linux/mmc/card.h3
-rw-r--r--include/linux/mmc/host.h10
-rw-r--r--include/linux/mmc/mmc.h1
-rw-r--r--include/linux/mmc/protocol.h13
-rw-r--r--include/linux/mmzone.h42
-rw-r--r--include/linux/module.h3
-rw-r--r--include/linux/mount.h10
-rw-r--r--include/linux/msdos_fs.h6
-rw-r--r--include/linux/msi.h5
-rw-r--r--include/linux/ncp_fs.h4
-rw-r--r--include/linux/net.h2
-rw-r--r--include/linux/netdevice.h7
-rw-r--r--include/linux/netfilter.h4
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/linux/netfilter/nf_conntrack_sane.h21
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h4
-rw-r--r--include/linux/netfilter/xt_TCPMSS.h10
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h6
-rw-r--r--include/linux/netfilter_ipv4/ip_nat.h1
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h22
-rw-r--r--include/linux/netfilter_ipv4/ipt_TCPMSS.h7
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h35
-rw-r--r--include/linux/netfilter_ipv6/ip6t_mh.h15
-rw-r--r--include/linux/netlink.h1
-rw-r--r--include/linux/nfs_fs.h14
-rw-r--r--include/linux/nfs_xdr.h4
-rw-r--r--include/linux/nfsd/const.h4
-rw-r--r--include/linux/pagemap.h2
-rw-r--r--include/linux/pci.h41
-rw-r--r--include/linux/pci_ids.h23
-rw-r--r--include/linux/pfkeyv2.h4
-rw-r--r--include/linux/phonedev.h2
-rw-r--r--include/linux/pid.h14
-rw-r--r--include/linux/pnp.h2
-rw-r--r--include/linux/proc_fs.h4
-rw-r--r--include/linux/qnx4_fs.h4
-rw-r--r--include/linux/quota.h1
-rw-r--r--include/linux/raid/bitmap.h1
-rw-r--r--include/linux/random.h2
-rw-r--r--include/linux/reiserfs_fs.h8
-rw-r--r--include/linux/reiserfs_xattr.h24
-rw-r--r--include/linux/relay.h9
-rw-r--r--include/linux/rio.h1
-rw-r--r--include/linux/sched.h45
-rw-r--r--include/linux/security.h4
-rw-r--r--include/linux/serio.h5
-rw-r--r--include/linux/slab_def.h30
-rw-r--r--include/linux/socket.h6
-rw-r--r--include/linux/spi/ads7846.h12
-rw-r--r--include/linux/spi/eeprom.h22
-rw-r--r--include/linux/spi/spi.h37
-rw-r--r--include/linux/spi/spi_bitbang.h2
-rw-r--r--include/linux/spinlock.h33
-rw-r--r--include/linux/stat.h2
-rw-r--r--include/linux/sunrpc/svc.h45
-rw-r--r--include/linux/sunrpc/svcsock.h14
-rw-r--r--include/linux/svga.h124
-rw-r--r--include/linux/swap.h6
-rw-r--r--include/linux/sysctl.h3
-rw-r--r--include/linux/sysdev.h12
-rw-r--r--include/linux/sysfs.h24
-rw-r--r--include/linux/tc.h141
-rw-r--r--include/linux/tcp.h2
-rw-r--r--include/linux/tifm.h35
-rw-r--r--include/linux/time.h4
-rw-r--r--include/linux/timex.h4
-rw-r--r--include/linux/toshiba.h2
-rw-r--r--include/linux/tty.h30
-rw-r--r--include/linux/ufs_fs.h48
-rw-r--r--include/linux/ufs_fs_i.h3
-rw-r--r--include/linux/ufs_fs_sb.h1
-rw-r--r--include/linux/usb.h39
-rw-r--r--include/linux/usb/Kbuild5
-rw-r--r--include/linux/usb/ch9.h (renamed from include/linux/usb_ch9.h)1
-rw-r--r--include/linux/usb/serial.h5
-rw-r--r--include/linux/usb_gadgetfs.h2
-rw-r--r--include/linux/video_output.h42
-rw-r--r--include/linux/vmstat.h72
-rw-r--r--include/linux/wanrouter.h8
-rw-r--r--include/linux/xattr.h8
-rw-r--r--include/linux/xfrm.h19
-rw-r--r--include/net/ax25.h4
-rw-r--r--include/net/dn_route.h5
-rw-r--r--include/net/dst.h15
-rw-r--r--include/net/inet_hashtables.h10
-rw-r--r--include/net/ip6_fib.h1
-rw-r--r--include/net/iucv/af_iucv.h106
-rw-r--r--include/net/iucv/iucv.h415
-rw-r--r--include/net/netfilter/nf_conntrack.h8
-rw-r--r--include/net/netfilter/nf_conntrack_expect.h2
-rw-r--r--include/net/netfilter/nf_conntrack_l3proto.h4
-rw-r--r--include/net/netfilter/nf_conntrack_l4proto.h2
-rw-r--r--include/net/netfilter/nf_nat.h1
-rw-r--r--include/net/netrom.h4
-rw-r--r--include/net/rose.h6
-rw-r--r--include/net/route.h12
-rw-r--r--include/net/tcp.h5
-rw-r--r--include/net/x25.h18
-rw-r--r--include/net/xfrm.h47
-rw-r--r--include/pcmcia/ss.h2
-rw-r--r--include/rdma/ib_user_mad.h2
-rw-r--r--include/rdma/ib_verbs.h3
-rw-r--r--include/scsi/iscsi_proto.h46
-rw-r--r--include/scsi/libsas.h22
-rw-r--r--include/scsi/scsi_transport_sas.h3
-rw-r--r--include/scsi/scsi_transport_spi.h1
-rw-r--r--include/sound/ac97_codec.h4
-rw-r--r--include/sound/ad1848.h2
-rw-r--r--include/sound/ak4114.h3
-rw-r--r--include/sound/ak4117.h2
-rw-r--r--include/sound/ak4xxx-adda.h6
-rw-r--r--include/sound/control.h5
-rw-r--r--include/sound/core.h62
-rw-r--r--include/sound/emu10k1.h418
-rw-r--r--include/sound/pcm.h6
-rw-r--r--include/sound/pt2258.h37
-rw-r--r--include/sound/sb16_csp.h14
-rw-r--r--include/sound/snd_wavefront.h2
-rw-r--r--include/sound/soc-dapm.h286
-rw-r--r--include/sound/soc.h461
-rw-r--r--include/sound/typedefs.h173
-rw-r--r--include/sound/version.h4
-rw-r--r--include/sound/vx_core.h2
-rw-r--r--include/sound/ymfpci.h6
-rw-r--r--include/video/neomagic.h3
-rw-r--r--include/video/s3blit.h79
479 files changed, 7217 insertions, 4758 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index ebc1f697615a..422f29c06c77 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -63,7 +63,7 @@
63 63
64/* Current ACPICA subsystem version in YYYYMMDD format */ 64/* Current ACPICA subsystem version in YYYYMMDD format */
65 65
66#define ACPI_CA_VERSION 0x20060707 66#define ACPI_CA_VERSION 0x20070126
67 67
68/* 68/*
69 * OS name, used for the _OS object. The _OS object is essentially obsolete, 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -115,6 +115,10 @@
115 115
116#define ACPI_NUM_OWNERID_MASKS 8 116#define ACPI_NUM_OWNERID_MASKS 8
117 117
118/* Size of the root table array is increased by this increment */
119
120#define ACPI_ROOT_TABLE_SIZE_INCREMENT 4
121
118/****************************************************************************** 122/******************************************************************************
119 * 123 *
120 * ACPI Specification constants (Do not change unless the specification changes) 124 * ACPI Specification constants (Do not change unless the specification changes)
@@ -152,6 +156,11 @@
152#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ 156#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */
153#define ACPI_PATH_SEPARATOR '.' 157#define ACPI_PATH_SEPARATOR '.'
154 158
159/* Sizes for ACPI table headers */
160
161#define ACPI_OEM_ID_SIZE 6
162#define ACPI_OEM_TABLE_ID_SIZE 8
163
155/* Constants used in searching for the RSDP in low memory */ 164/* Constants used in searching for the RSDP in low memory */
156 165
157#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ 166#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */
diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h
index d8167095caf3..d626bb1d2973 100644
--- a/include/acpi/acdebug.h
+++ b/include/acpi/acdebug.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -159,6 +159,10 @@ void
159acpi_db_create_execution_threads(char *num_threads_arg, 159acpi_db_create_execution_threads(char *num_threads_arg,
160 char *num_loops_arg, char *method_name_arg); 160 char *num_loops_arg, char *method_name_arg);
161 161
162#ifdef ACPI_DBG_TRACK_ALLOCATIONS
163u32 acpi_db_get_cache_info(struct acpi_memory_list *cache);
164#endif
165
162/* 166/*
163 * dbfileio - Debugger file I/O commands 167 * dbfileio - Debugger file I/O commands
164 */ 168 */
@@ -214,4 +218,6 @@ void acpi_db_prep_namestring(char *name);
214 218
215struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name); 219struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name);
216 220
221void acpi_db_uint32_to_hex_string(u32 value, char *buffer);
222
217#endif /* __ACDEBUG_H__ */ 223#endif /* __ACDEBUG_H__ */
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 9a7d6921f534..389d772c7d5b 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -97,9 +97,11 @@ typedef const struct acpi_dmtable_info {
97#define ACPI_DMT_CHKSUM 20 97#define ACPI_DMT_CHKSUM 20
98#define ACPI_DMT_SPACEID 21 98#define ACPI_DMT_SPACEID 21
99#define ACPI_DMT_GAS 22 99#define ACPI_DMT_GAS 22
100#define ACPI_DMT_MADT 23 100#define ACPI_DMT_DMAR 23
101#define ACPI_DMT_SRAT 24 101#define ACPI_DMT_MADT 24
102#define ACPI_DMT_EXIT 25 102#define ACPI_DMT_SRAT 25
103#define ACPI_DMT_EXIT 26
104#define ACPI_DMT_SIG 27
103 105
104typedef 106typedef
105void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table); 107void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table);
@@ -108,6 +110,7 @@ struct acpi_dmtable_data {
108 char *signature; 110 char *signature;
109 struct acpi_dmtable_info *table_info; 111 struct acpi_dmtable_info *table_info;
110 ACPI_TABLE_HANDLER table_handler; 112 ACPI_TABLE_HANDLER table_handler;
113 char *name;
111}; 114};
112 115
113struct acpi_op_walk_info { 116struct acpi_op_walk_info {
@@ -139,7 +142,9 @@ extern const char *acpi_gbl_match_ops[];
139 142
140extern struct acpi_dmtable_info acpi_dm_table_info_asf0[]; 143extern struct acpi_dmtable_info acpi_dm_table_info_asf0[];
141extern struct acpi_dmtable_info acpi_dm_table_info_asf1[]; 144extern struct acpi_dmtable_info acpi_dm_table_info_asf1[];
145extern struct acpi_dmtable_info acpi_dm_table_info_asf1a[];
142extern struct acpi_dmtable_info acpi_dm_table_info_asf2[]; 146extern struct acpi_dmtable_info acpi_dm_table_info_asf2[];
147extern struct acpi_dmtable_info acpi_dm_table_info_asf2a[];
143extern struct acpi_dmtable_info acpi_dm_table_info_asf3[]; 148extern struct acpi_dmtable_info acpi_dm_table_info_asf3[];
144extern struct acpi_dmtable_info acpi_dm_table_info_asf4[]; 149extern struct acpi_dmtable_info acpi_dm_table_info_asf4[];
145extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[]; 150extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[];
@@ -147,6 +152,11 @@ extern struct acpi_dmtable_info acpi_dm_table_info_boot[];
147extern struct acpi_dmtable_info acpi_dm_table_info_cpep[]; 152extern struct acpi_dmtable_info acpi_dm_table_info_cpep[];
148extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[]; 153extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[];
149extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[]; 154extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[];
155extern struct acpi_dmtable_info acpi_dm_table_info_dmar[];
156extern struct acpi_dmtable_info acpi_dm_table_info_dmar_hdr[];
157extern struct acpi_dmtable_info acpi_dm_table_info_dmar_scope[];
158extern struct acpi_dmtable_info acpi_dm_table_info_dmar0[];
159extern struct acpi_dmtable_info acpi_dm_table_info_dmar1[];
150extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[]; 160extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
151extern struct acpi_dmtable_info acpi_dm_table_info_facs[]; 161extern struct acpi_dmtable_info acpi_dm_table_info_facs[];
152extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[]; 162extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[];
@@ -201,6 +211,8 @@ void acpi_dm_dump_asf(struct acpi_table_header *table);
201 211
202void acpi_dm_dump_cpep(struct acpi_table_header *table); 212void acpi_dm_dump_cpep(struct acpi_table_header *table);
203 213
214void acpi_dm_dump_dmar(struct acpi_table_header *table);
215
204void acpi_dm_dump_fadt(struct acpi_table_header *table); 216void acpi_dm_dump_fadt(struct acpi_table_header *table);
205 217
206void acpi_dm_dump_srat(struct acpi_table_header *table); 218void acpi_dm_dump_srat(struct acpi_table_header *table);
@@ -314,7 +326,7 @@ acpi_dm_resource_template(struct acpi_op_walk_info *info,
314 union acpi_parse_object *op, 326 union acpi_parse_object *op,
315 u8 * byte_data, u32 byte_count); 327 u8 * byte_data, u32 byte_count);
316 328
317u8 acpi_dm_is_resource_template(union acpi_parse_object *op); 329acpi_status acpi_dm_is_resource_template(union acpi_parse_object *op);
318 330
319void acpi_dm_indent(u32 level); 331void acpi_dm_indent(u32 level);
320 332
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index a22fe9cf8493..cb8d2868c8ac 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -210,7 +210,7 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state);
210 * dsinit 210 * dsinit
211 */ 211 */
212acpi_status 212acpi_status
213acpi_ds_initialize_objects(struct acpi_table_desc *table_desc, 213acpi_ds_initialize_objects(acpi_native_uint table_index,
214 struct acpi_namespace_node *start_node); 214 struct acpi_namespace_node *start_node);
215 215
216/* 216/*
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h
index 234142828e1a..d23cdf326808 100644
--- a/include/acpi/acevents.h
+++ b/include/acpi/acevents.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 797ca1ea5214..b73f18a48785 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -178,8 +178,10 @@
178#define AE_CTRL_BREAK (acpi_status) (0x0009 | AE_CODE_CONTROL) 178#define AE_CTRL_BREAK (acpi_status) (0x0009 | AE_CODE_CONTROL)
179#define AE_CTRL_CONTINUE (acpi_status) (0x000A | AE_CODE_CONTROL) 179#define AE_CTRL_CONTINUE (acpi_status) (0x000A | AE_CODE_CONTROL)
180#define AE_CTRL_SKIP (acpi_status) (0x000B | AE_CODE_CONTROL) 180#define AE_CTRL_SKIP (acpi_status) (0x000B | AE_CODE_CONTROL)
181#define AE_CTRL_PARSE_CONTINUE (acpi_status) (0x000C | AE_CODE_CONTROL)
182#define AE_CTRL_PARSE_PENDING (acpi_status) (0x000D | AE_CODE_CONTROL)
181 183
182#define AE_CODE_CTRL_MAX 0x000B 184#define AE_CODE_CTRL_MAX 0x000D
183 185
184#ifdef DEFINE_ACPI_GLOBALS 186#ifdef DEFINE_ACPI_GLOBALS
185 187
@@ -291,7 +293,9 @@ char const *acpi_gbl_exception_names_ctrl[] = {
291 "AE_CTRL_TRANSFER", 293 "AE_CTRL_TRANSFER",
292 "AE_CTRL_BREAK", 294 "AE_CTRL_BREAK",
293 "AE_CTRL_CONTINUE", 295 "AE_CTRL_CONTINUE",
294 "AE_CTRL_SKIP" 296 "AE_CTRL_SKIP",
297 "AE_CTRL_PARSE_CONTINUE",
298 "AE_CTRL_PARSE_PENDING"
295}; 299};
296 300
297#endif /* ACPI GLOBALS */ 301#endif /* ACPI GLOBALS */
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 06972e6637de..24c3f05ab367 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -58,37 +58,6 @@
58#define ACPI_INIT_GLOBAL(a,b) a 58#define ACPI_INIT_GLOBAL(a,b) a
59#endif 59#endif
60 60
61/*
62 * Keep local copies of these FADT-based registers. NOTE: These globals
63 * are first in this file for alignment reasons on 64-bit systems.
64 */
65ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
66ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
67
68/*****************************************************************************
69 *
70 * Debug support
71 *
72 ****************************************************************************/
73
74/* Runtime configuration of debug print levels */
75
76extern u32 acpi_dbg_level;
77extern u32 acpi_dbg_layer;
78
79/* Procedure nesting level for debug output */
80
81extern u32 acpi_gbl_nesting_level;
82
83/* Support for dynamic control method tracing mechanism */
84
85ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
86ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
87ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
88ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
89ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
90ACPI_EXTERN u32 acpi_gbl_trace_flags;
91
92/***************************************************************************** 61/*****************************************************************************
93 * 62 *
94 * Runtime configuration (static defaults that can be overriden at runtime) 63 * Runtime configuration (static defaults that can be overriden at runtime)
@@ -135,52 +104,62 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);
135 104
136/***************************************************************************** 105/*****************************************************************************
137 * 106 *
107 * Debug support
108 *
109 ****************************************************************************/
110
111/* Runtime configuration of debug print levels */
112
113extern u32 acpi_dbg_level;
114extern u32 acpi_dbg_layer;
115
116/* Procedure nesting level for debug output */
117
118extern u32 acpi_gbl_nesting_level;
119
120/* Event counters */
121
122ACPI_EXTERN u32 acpi_gpe_count;
123
124/* Support for dynamic control method tracing mechanism */
125
126ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
127ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
128ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
129ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
130ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
131ACPI_EXTERN u32 acpi_gbl_trace_flags;
132
133/*****************************************************************************
134 *
138 * ACPI Table globals 135 * ACPI Table globals
139 * 136 *
140 ****************************************************************************/ 137 ****************************************************************************/
141 138
142/* 139/*
143 * Table pointers. 140 * acpi_gbl_root_table_list is the master list of ACPI tables found in the
144 * Although these pointers are somewhat redundant with the global acpi_table, 141 * RSDT/XSDT.
145 * they are convenient because they are typed pointers.
146 * 142 *
147 * These tables are single-table only; meaning that there can be at most one 143 * acpi_gbl_FADT is a local copy of the FADT, converted to a common format.
148 * of each in the system. Each global points to the actual table.
149 */
150ACPI_EXTERN u32 acpi_gbl_table_flags;
151ACPI_EXTERN u32 acpi_gbl_rsdt_table_count;
152ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP;
153ACPI_EXTERN struct xsdt_descriptor *acpi_gbl_XSDT;
154ACPI_EXTERN struct fadt_descriptor *acpi_gbl_FADT;
155ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT;
156ACPI_EXTERN struct facs_descriptor *acpi_gbl_FACS;
157ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS;
158/*
159 * Since there may be multiple SSDTs and PSDTs, a single pointer is not
160 * sufficient; Therefore, there isn't one!
161 */ 144 */
145ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list;
146ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT;
147extern acpi_native_uint acpi_gbl_permanent_mmap;
162 148
163/* The root table can be either an RSDT or an XSDT */ 149/* These addresses are calculated from FADT address values */
164 150
165ACPI_EXTERN u8 acpi_gbl_root_table_type; 151ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
166#define ACPI_TABLE_TYPE_RSDT 'R' 152ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
167#define ACPI_TABLE_TYPE_XSDT 'X'
168 153
169/* 154/*
170 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths: 155 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is
171 * If we are executing a method that exists in a 32-bit ACPI table, 156 * determined by the revision of the DSDT: If the DSDT revision is less than
172 * use only the lower 32 bits of the (internal) 64-bit Integer. 157 * 2, use only the lower 32 bits of the internal 64-bit Integer.
173 */ 158 */
174ACPI_EXTERN u8 acpi_gbl_integer_bit_width; 159ACPI_EXTERN u8 acpi_gbl_integer_bit_width;
175ACPI_EXTERN u8 acpi_gbl_integer_byte_width; 160ACPI_EXTERN u8 acpi_gbl_integer_byte_width;
176ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; 161ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
177 162
178/*
179 * ACPI Table info arrays
180 */
181extern struct acpi_table_list acpi_gbl_table_lists[ACPI_TABLE_ID_MAX + 1];
182extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1];
183
184/***************************************************************************** 163/*****************************************************************************
185 * 164 *
186 * Mutual exlusion within ACPICA subsystem 165 * Mutual exlusion within ACPICA subsystem
@@ -188,7 +167,7 @@ extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1];
188 ****************************************************************************/ 167 ****************************************************************************/
189 168
190/* 169/*
191 * Predefined mutex objects. This array contains the 170 * Predefined mutex objects. This array contains the
192 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. 171 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
193 * (The table maps local handles to the real OS handles) 172 * (The table maps local handles to the real OS handles)
194 */ 173 */
@@ -197,6 +176,7 @@ ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX];
197/* 176/*
198 * Global lock semaphore works in conjunction with the actual HW global lock 177 * Global lock semaphore works in conjunction with the actual HW global lock
199 */ 178 */
179ACPI_EXTERN acpi_mutex acpi_gbl_global_lock_mutex;
200ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore; 180ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore;
201 181
202/* 182/*
@@ -220,6 +200,7 @@ ACPI_EXTERN spinlock_t _acpi_gbl_hardware_lock; /* For ACPI H/W except GPE regis
220 200
221ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list; 201ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
222ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; 202ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
203ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats;
223#endif 204#endif
224 205
225/* Object caches */ 206/* Object caches */
@@ -240,7 +221,6 @@ ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
240 221
241/* Misc */ 222/* Misc */
242 223
243ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count;
244ACPI_EXTERN u32 acpi_gbl_original_mode; 224ACPI_EXTERN u32 acpi_gbl_original_mode;
245ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; 225ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
246ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; 226ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
@@ -260,12 +240,19 @@ ACPI_EXTERN u8 acpi_gbl_system_awake_and_running;
260 240
261extern u8 acpi_gbl_shutdown; 241extern u8 acpi_gbl_shutdown;
262extern u32 acpi_gbl_startup_flags; 242extern u32 acpi_gbl_startup_flags;
263extern const u8 acpi_gbl_decode_to8bit[8];
264extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT]; 243extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
265extern const char *acpi_gbl_highest_dstate_names[4]; 244extern const char *acpi_gbl_highest_dstate_names[4];
266extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; 245extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
267extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; 246extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
268 247
248/* Exception codes */
249
250extern char const *acpi_gbl_exception_names_env[];
251extern char const *acpi_gbl_exception_names_pgm[];
252extern char const *acpi_gbl_exception_names_tbl[];
253extern char const *acpi_gbl_exception_names_aml[];
254extern char const *acpi_gbl_exception_names_ctrl[];
255
269/***************************************************************************** 256/*****************************************************************************
270 * 257 *
271 * Namespace globals 258 * Namespace globals
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index 29b60a8c0593..9df275cf7bc1 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -61,8 +61,6 @@
61/* 61/*
62 * hwacpi - high level functions 62 * hwacpi - high level functions
63 */ 63 */
64acpi_status acpi_hw_initialize(void);
65
66acpi_status acpi_hw_set_mode(u32 mode); 64acpi_status acpi_hw_set_mode(u32 mode);
67 65
68u32 acpi_hw_get_mode(void); 66u32 acpi_hw_get_mode(void);
@@ -84,7 +82,7 @@ acpi_hw_low_level_read(u32 width,
84acpi_status 82acpi_status
85acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg); 83acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg);
86 84
87acpi_status acpi_hw_clear_acpi_status(u32 flags); 85acpi_status acpi_hw_clear_acpi_status(void);
88 86
89/* 87/*
90 * hwgpe - GPE support 88 * hwgpe - GPE support
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index 91586d0d5bb5..ce7c9d653910 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -277,12 +277,6 @@ acpi_status acpi_ex_system_do_suspend(acpi_integer time);
277 277
278acpi_status acpi_ex_system_do_stall(u32 time); 278acpi_status acpi_ex_system_do_stall(u32 time);
279 279
280acpi_status
281acpi_ex_system_acquire_mutex(union acpi_operand_object *time,
282 union acpi_operand_object *obj_desc);
283
284acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc);
285
286acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc); 280acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc);
287 281
288acpi_status 282acpi_status
@@ -451,10 +445,14 @@ acpi_ex_copy_integer_to_buffer_field(union acpi_operand_object *source_desc,
451/* 445/*
452 * exutils - interpreter/scanner utilities 446 * exutils - interpreter/scanner utilities
453 */ 447 */
454acpi_status acpi_ex_enter_interpreter(void); 448void acpi_ex_enter_interpreter(void);
455 449
456void acpi_ex_exit_interpreter(void); 450void acpi_ex_exit_interpreter(void);
457 451
452void acpi_ex_reacquire_interpreter(void);
453
454void acpi_ex_relinquish_interpreter(void);
455
458void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc); 456void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);
459 457
460u8 acpi_ex_acquire_global_lock(u32 rule); 458u8 acpi_ex_acquire_global_lock(u32 rule);
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 063c4b54290f..6f83ddbed3af 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -80,8 +80,8 @@ union acpi_parse_object;
80 * table below also! 80 * table below also!
81 */ 81 */
82#define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */ 82#define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */
83#define ACPI_MTX_TABLES 1 /* Data for ACPI tables */ 83#define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */
84#define ACPI_MTX_NAMESPACE 2 /* ACPI Namespace */ 84#define ACPI_MTX_TABLES 2 /* Data for ACPI tables */
85#define ACPI_MTX_EVENTS 3 /* Data for ACPI events */ 85#define ACPI_MTX_EVENTS 3 /* Data for ACPI events */
86#define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */ 86#define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */
87#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */ 87#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */
@@ -162,7 +162,7 @@ struct acpi_mutex_info {
162typedef enum { 162typedef enum {
163 ACPI_IMODE_LOAD_PASS1 = 0x01, 163 ACPI_IMODE_LOAD_PASS1 = 0x01,
164 ACPI_IMODE_LOAD_PASS2 = 0x02, 164 ACPI_IMODE_LOAD_PASS2 = 0x02,
165 ACPI_IMODE_EXECUTE = 0x0E 165 ACPI_IMODE_EXECUTE = 0x03
166} acpi_interpreter_mode; 166} acpi_interpreter_mode;
167 167
168union acpi_name_union { 168union acpi_name_union {
@@ -204,7 +204,7 @@ struct acpi_namespace_node {
204/* Namespace Node flags */ 204/* Namespace Node flags */
205 205
206#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */ 206#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */
207#define ANOBJ_RESERVED 0x02 /* Available for future use */ 207#define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */
208#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ 208#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
209#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ 209#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
210#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ 210#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
@@ -219,25 +219,42 @@ struct acpi_namespace_node {
219 * ACPI Table Descriptor. One per ACPI table 219 * ACPI Table Descriptor. One per ACPI table
220 */ 220 */
221struct acpi_table_desc { 221struct acpi_table_desc {
222 struct acpi_table_desc *prev; 222 acpi_physical_address address;
223 struct acpi_table_desc *next;
224 struct acpi_table_desc *installed_desc;
225 struct acpi_table_header *pointer; 223 struct acpi_table_header *pointer;
226 u8 *aml_start; 224 u32 length; /* Length fixed at 32 bits */
227 u64 physical_address; 225 union acpi_name_union signature;
228 acpi_size length;
229 u32 aml_length;
230 acpi_owner_id owner_id; 226 acpi_owner_id owner_id;
231 u8 type; 227 u8 flags;
232 u8 allocation;
233 u8 loaded_into_namespace;
234}; 228};
235 229
236struct acpi_table_list { 230/* Flags for above */
237 struct acpi_table_desc *next; 231
232#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
233#define ACPI_TABLE_ORIGIN_MAPPED (1)
234#define ACPI_TABLE_ORIGIN_ALLOCATED (2)
235#define ACPI_TABLE_ORIGIN_MASK (3)
236#define ACPI_TABLE_IS_LOADED (4)
237
238/* One internal RSDT for table management */
239
240struct acpi_internal_rsdt {
241 struct acpi_table_desc *tables;
238 u32 count; 242 u32 count;
243 u32 size;
244 u8 flags;
239}; 245};
240 246
247/* Flags for above */
248
249#define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */
250#define ACPI_ROOT_ORIGIN_ALLOCATED (1)
251#define ACPI_ROOT_ALLOW_RESIZE (2)
252
253/* Predefined (fixed) table indexes */
254
255#define ACPI_TABLE_INDEX_DSDT (0)
256#define ACPI_TABLE_INDEX_FACS (1)
257
241struct acpi_find_context { 258struct acpi_find_context {
242 char *search_for; 259 char *search_for;
243 acpi_handle *list; 260 acpi_handle *list;
@@ -350,7 +367,7 @@ struct acpi_gpe_event_info {
350 union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */ 367 union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */
351 struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ 368 struct acpi_gpe_register_info *register_info; /* Backpointer to register info */
352 u8 flags; /* Misc info about this GPE */ 369 u8 flags; /* Misc info about this GPE */
353 u8 register_bit; /* This GPE bit within the register */ 370 u8 gpe_number; /* This GPE */
354}; 371};
355 372
356/* Information about a GPE register pair, one per each status/enable pair in an array */ 373/* Information about a GPE register pair, one per each status/enable pair in an array */
@@ -855,12 +872,30 @@ struct acpi_bit_register_info {
855 ****************************************************************************/ 872 ****************************************************************************/
856 873
857struct acpi_db_method_info { 874struct acpi_db_method_info {
858 acpi_handle thread_gate; 875 acpi_handle main_thread_gate;
876 acpi_handle thread_complete_gate;
877 u32 *threads;
878 u32 num_threads;
879 u32 num_created;
880 u32 num_completed;
881
859 char *name; 882 char *name;
860 char **args;
861 u32 flags; 883 u32 flags;
862 u32 num_loops; 884 u32 num_loops;
863 char pathname[128]; 885 char pathname[128];
886 char **args;
887
888 /*
889 * Arguments to be passed to method for the command
890 * Threads -
891 * the Number of threads, ID of current thread and
892 * Index of current thread inside all them created.
893 */
894 char init_args;
895 char *arguments[4];
896 char num_threads_str[11];
897 char id_of_thread_str[11];
898 char index_of_thread_str[11];
864}; 899};
865 900
866struct acpi_integrity_info { 901struct acpi_integrity_info {
@@ -919,6 +954,8 @@ struct acpi_memory_list {
919 954
920 u32 total_allocated; 955 u32 total_allocated;
921 u32 total_freed; 956 u32 total_freed;
957 u32 max_occupied;
958 u32 total_size;
922 u32 current_total_size; 959 u32 current_total_size;
923 u32 requests; 960 u32 requests;
924 u32 hits; 961 u32 hits;
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 192fa095a515..8948a6461834 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -55,25 +55,12 @@
55#define ACPI_SET_BIT(target,bit) ((target) |= (bit)) 55#define ACPI_SET_BIT(target,bit) ((target) |= (bit))
56#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) 56#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit))
57#define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) 57#define ACPI_MIN(a,b) (((a)<(b))?(a):(b))
58#define ACPI_MAX(a,b) (((a)>(b))?(a):(b))
58 59
59/* Size calculation */ 60/* Size calculation */
60 61
61#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) 62#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
62 63
63#if ACPI_MACHINE_WIDTH == 16
64
65/*
66 * For 16-bit addresses, we have to assume that the upper 32 bits
67 * (out of 64) are zero.
68 */
69#define ACPI_LODWORD(l) ((u32)(l))
70#define ACPI_HIDWORD(l) ((u32)(0))
71
72#define ACPI_GET_ADDRESS(a) ((a).lo)
73#define ACPI_STORE_ADDRESS(a,b) {(a).hi=0;(a).lo=(u32)(b);}
74#define ACPI_VALID_ADDRESS(a) ((a).hi | (a).lo)
75
76#else
77#ifdef ACPI_NO_INTEGER64_SUPPORT 64#ifdef ACPI_NO_INTEGER64_SUPPORT
78/* 65/*
79 * acpi_integer is 32-bits, no 64-bit support on this platform 66 * acpi_integer is 32-bits, no 64-bit support on this platform
@@ -81,10 +68,6 @@
81#define ACPI_LODWORD(l) ((u32)(l)) 68#define ACPI_LODWORD(l) ((u32)(l))
82#define ACPI_HIDWORD(l) ((u32)(0)) 69#define ACPI_HIDWORD(l) ((u32)(0))
83 70
84#define ACPI_GET_ADDRESS(a) (a)
85#define ACPI_STORE_ADDRESS(a,b) ((a)=(b))
86#define ACPI_VALID_ADDRESS(a) (a)
87
88#else 71#else
89 72
90/* 73/*
@@ -92,11 +75,6 @@
92 */ 75 */
93#define ACPI_LODWORD(l) ((u32)(u64)(l)) 76#define ACPI_LODWORD(l) ((u32)(u64)(l))
94#define ACPI_HIDWORD(l) ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi)) 77#define ACPI_HIDWORD(l) ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi))
95
96#define ACPI_GET_ADDRESS(a) (a)
97#define ACPI_STORE_ADDRESS(a,b) ((a)=(acpi_physical_address)(b))
98#define ACPI_VALID_ADDRESS(a) (a)
99#endif
100#endif 78#endif
101 79
102/* 80/*
@@ -134,15 +112,8 @@
134#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) 112#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i)
135#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) 113#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL)
136#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) 114#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
137
138#if ACPI_MACHINE_WIDTH == 16
139#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s)
140#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i)
141#define ACPI_PTR_TO_PHYSADDR(i) (u32) ACPI_CAST_PTR (u8,(i))
142#else
143#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) 115#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
144#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) 116#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
145#endif
146 117
147#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED 118#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
148#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b))) 119#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b)))
@@ -223,28 +194,6 @@
223 194
224/* The hardware supports unaligned transfers, just do the little-endian move */ 195/* The hardware supports unaligned transfers, just do the little-endian move */
225 196
226#if ACPI_MACHINE_WIDTH == 16
227
228/* No 64-bit integers */
229/* 16-bit source, 16/32/64 destination */
230
231#define ACPI_MOVE_16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s)
232#define ACPI_MOVE_16_TO_32(d,s) *(u32 *)(void *)(d) = *(u16 *)(void *)(s)
233#define ACPI_MOVE_16_TO_64(d,s) ACPI_MOVE_16_TO_32(d,s)
234
235/* 32-bit source, 16/32/64 destination */
236
237#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
238#define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s)
239#define ACPI_MOVE_32_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s)
240
241/* 64-bit source, 16/32/64 destination */
242
243#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
244#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */
245#define ACPI_MOVE_64_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s)
246
247#else
248/* 16-bit source, 16/32/64 destination */ 197/* 16-bit source, 16/32/64 destination */
249 198
250#define ACPI_MOVE_16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s) 199#define ACPI_MOVE_16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s)
@@ -262,7 +211,6 @@
262#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ 211#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
263#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ 212#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */
264#define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) 213#define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s)
265#endif
266 214
267#else 215#else
268/* 216/*
@@ -307,10 +255,7 @@
307 255
308/* Macros based on machine integer width */ 256/* Macros based on machine integer width */
309 257
310#if ACPI_MACHINE_WIDTH == 16 258#if ACPI_MACHINE_WIDTH == 32
311#define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s)
312
313#elif ACPI_MACHINE_WIDTH == 32
314#define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_32_TO_16(d,s) 259#define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_32_TO_16(d,s)
315 260
316#elif ACPI_MACHINE_WIDTH == 64 261#elif ACPI_MACHINE_WIDTH == 64
@@ -695,16 +640,6 @@
695#define ACPI_DEBUGGER_EXEC(a) 640#define ACPI_DEBUGGER_EXEC(a)
696#endif 641#endif
697 642
698/*
699 * For 16-bit code, we want to shrink some things even though
700 * we are using ACPI_DEBUG_OUTPUT to get the debug output
701 */
702#if ACPI_MACHINE_WIDTH == 16
703#undef ACPI_DEBUG_ONLY_MEMBERS
704#undef _VERBOSE_STRUCTURES
705#define ACPI_DEBUG_ONLY_MEMBERS(a)
706#endif
707
708#ifdef ACPI_DEBUG_OUTPUT 643#ifdef ACPI_DEBUG_OUTPUT
709/* 644/*
710 * 1) Set name to blanks 645 * 1) Set name to blanks
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index b67da3636899..34bfae8a05f3 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index 83b52f9f899a..535b7e1c41bc 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -65,9 +65,13 @@
65#define ACPI_NS_ERROR_IF_FOUND 0x08 65#define ACPI_NS_ERROR_IF_FOUND 0x08
66#define ACPI_NS_PREFIX_IS_SCOPE 0x10 66#define ACPI_NS_PREFIX_IS_SCOPE 0x10
67#define ACPI_NS_EXTERNAL 0x20 67#define ACPI_NS_EXTERNAL 0x20
68#define ACPI_NS_TEMPORARY 0x40
68 69
69#define ACPI_NS_WALK_UNLOCK TRUE 70/* Flags for acpi_ns_walk_namespace */
70#define ACPI_NS_WALK_NO_UNLOCK FALSE 71
72#define ACPI_NS_WALK_NO_UNLOCK 0
73#define ACPI_NS_WALK_UNLOCK 0x01
74#define ACPI_NS_WALK_TEMP_NODES 0x02
71 75
72/* 76/*
73 * nsinit - Namespace initialization 77 * nsinit - Namespace initialization
@@ -82,7 +86,7 @@ acpi_status acpi_ns_initialize_devices(void);
82acpi_status acpi_ns_load_namespace(void); 86acpi_status acpi_ns_load_namespace(void);
83 87
84acpi_status 88acpi_status
85acpi_ns_load_table(struct acpi_table_desc *table_desc, 89acpi_ns_load_table(acpi_native_uint table_index,
86 struct acpi_namespace_node *node); 90 struct acpi_namespace_node *node);
87 91
88/* 92/*
@@ -92,7 +96,7 @@ acpi_status
92acpi_ns_walk_namespace(acpi_object_type type, 96acpi_ns_walk_namespace(acpi_object_type type,
93 acpi_handle start_object, 97 acpi_handle start_object,
94 u32 max_depth, 98 u32 max_depth,
95 u8 unlock_before_callback, 99 u32 flags,
96 acpi_walk_callback user_function, 100 acpi_walk_callback user_function,
97 void *context, void **return_value); 101 void *context, void **return_value);
98 102
@@ -106,11 +110,12 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type,
106 * nsparse - table parsing 110 * nsparse - table parsing
107 */ 111 */
108acpi_status 112acpi_status
109acpi_ns_parse_table(struct acpi_table_desc *table_desc, 113acpi_ns_parse_table(acpi_native_uint table_index,
110 struct acpi_namespace_node *scope); 114 struct acpi_namespace_node *start_node);
111 115
112acpi_status 116acpi_status
113acpi_ns_one_complete_parse(u8 pass_number, struct acpi_table_desc *table_desc); 117acpi_ns_one_complete_parse(acpi_native_uint pass_number,
118 acpi_native_uint table_index);
114 119
115/* 120/*
116 * nsaccess - Top-level namespace access 121 * nsaccess - Top-level namespace access
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 8fdee31119f3..04e9735a6742 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2006, R. Byron Moore 9 * Copyright (C) 2000 - 2007, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -52,7 +52,15 @@
52 * to the interpreter, and to keep track of the various handlers such as 52 * to the interpreter, and to keep track of the various handlers such as
53 * address space handlers and notify handlers. The object is a constant 53 * address space handlers and notify handlers. The object is a constant
54 * size in order to allow it to be cached and reused. 54 * size in order to allow it to be cached and reused.
55 *
56 * Note: The object is optimized to be aligned and will not work if it is
57 * byte-packed.
55 */ 58 */
59#if ACPI_MACHINE_WIDTH == 64
60#pragma pack(8)
61#else
62#pragma pack(4)
63#endif
56 64
57/******************************************************************************* 65/*******************************************************************************
58 * 66 *
@@ -101,7 +109,8 @@ struct acpi_object_common {
101ACPI_OBJECT_COMMON_HEADER}; 109ACPI_OBJECT_COMMON_HEADER};
102 110
103struct acpi_object_integer { 111struct acpi_object_integer {
104 ACPI_OBJECT_COMMON_HEADER acpi_integer value; 112 ACPI_OBJECT_COMMON_HEADER u8 fill[3]; /* Prevent warning on some compilers */
113 acpi_integer value;
105}; 114};
106 115
107/* 116/*
@@ -203,7 +212,9 @@ struct acpi_object_power_resource {
203}; 212};
204 213
205struct acpi_object_processor { 214struct acpi_object_processor {
206 ACPI_OBJECT_COMMON_HEADER u8 proc_id; 215 ACPI_OBJECT_COMMON_HEADER
216 /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */
217 u8 proc_id;
207 u8 length; 218 u8 length;
208 ACPI_COMMON_NOTIFY_INFO acpi_io_address address; 219 ACPI_COMMON_NOTIFY_INFO acpi_io_address address;
209}; 220};
@@ -406,4 +417,6 @@ union acpi_descriptor {
406 union acpi_parse_object op; 417 union acpi_parse_object op;
407}; 418};
408 419
420#pragma pack()
421
409#endif /* _ACOBJECT_H */ 422#endif /* _ACOBJECT_H */
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h
index 7659a46bc432..e6f76a280a94 100644
--- a/include/acpi/acopcode.h
+++ b/include/acpi/acopcode.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -257,7 +257,7 @@
257#define ARGI_LLESSEQUAL_OP ARGI_INVALID_OPCODE 257#define ARGI_LLESSEQUAL_OP ARGI_INVALID_OPCODE
258#define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER) 258#define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER)
259#define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE 259#define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE
260#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION_OR_FIELD,ARGI_TARGETREF) 260#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION_OR_BUFFER,ARGI_TARGETREF)
261#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_ANYTYPE) 261#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_ANYTYPE)
262#define ARGI_LOCAL0 ARG_NONE 262#define ARGI_LOCAL0 ARG_NONE
263#define ARGI_LOCAL1 ARG_NONE 263#define ARGI_LOCAL1 ARG_NONE
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 8d5039d0b430..7812267b577f 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index 9d49d3c41cd9..85c358e21014 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h
index b9a39d1009bd..2e5f00d3ea0d 100644
--- a/include/acpi/acpi.h
+++ b/include/acpi/acpi.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index fdd10953b2b6..0d9f984a60a1 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -59,7 +59,6 @@ acpi_evaluate_reference(acpi_handle handle,
59 59
60#define ACPI_BUS_FILE_ROOT "acpi" 60#define ACPI_BUS_FILE_ROOT "acpi"
61extern struct proc_dir_entry *acpi_root_dir; 61extern struct proc_dir_entry *acpi_root_dir;
62extern struct fadt_descriptor acpi_fadt;
63 62
64enum acpi_bus_removal_type { 63enum acpi_bus_removal_type {
65 ACPI_BUS_REMOVAL_NORMAL = 0, 64 ACPI_BUS_REMOVAL_NORMAL = 0,
@@ -92,13 +91,12 @@ typedef int (*acpi_op_remove) (struct acpi_device * device, int type);
92typedef int (*acpi_op_lock) (struct acpi_device * device, int type); 91typedef int (*acpi_op_lock) (struct acpi_device * device, int type);
93typedef int (*acpi_op_start) (struct acpi_device * device); 92typedef int (*acpi_op_start) (struct acpi_device * device);
94typedef int (*acpi_op_stop) (struct acpi_device * device, int type); 93typedef int (*acpi_op_stop) (struct acpi_device * device, int type);
95typedef int (*acpi_op_suspend) (struct acpi_device * device, int state); 94typedef int (*acpi_op_suspend) (struct acpi_device * device, pm_message_t state);
96typedef int (*acpi_op_resume) (struct acpi_device * device, int state); 95typedef int (*acpi_op_resume) (struct acpi_device * device);
97typedef int (*acpi_op_scan) (struct acpi_device * device); 96typedef int (*acpi_op_scan) (struct acpi_device * device);
98typedef int (*acpi_op_bind) (struct acpi_device * device); 97typedef int (*acpi_op_bind) (struct acpi_device * device);
99typedef int (*acpi_op_unbind) (struct acpi_device * device); 98typedef int (*acpi_op_unbind) (struct acpi_device * device);
100typedef int (*acpi_op_match) (struct acpi_device * device, 99typedef int (*acpi_op_shutdown) (struct acpi_device * device);
101 struct acpi_driver * driver);
102 100
103struct acpi_bus_ops { 101struct acpi_bus_ops {
104 u32 acpi_op_add:1; 102 u32 acpi_op_add:1;
@@ -111,7 +109,7 @@ struct acpi_bus_ops {
111 u32 acpi_op_scan:1; 109 u32 acpi_op_scan:1;
112 u32 acpi_op_bind:1; 110 u32 acpi_op_bind:1;
113 u32 acpi_op_unbind:1; 111 u32 acpi_op_unbind:1;
114 u32 acpi_op_match:1; 112 u32 acpi_op_shutdown:1;
115 u32 reserved:21; 113 u32 reserved:21;
116}; 114};
117 115
@@ -126,16 +124,16 @@ struct acpi_device_ops {
126 acpi_op_scan scan; 124 acpi_op_scan scan;
127 acpi_op_bind bind; 125 acpi_op_bind bind;
128 acpi_op_unbind unbind; 126 acpi_op_unbind unbind;
129 acpi_op_match match; 127 acpi_op_shutdown shutdown;
130}; 128};
131 129
132struct acpi_driver { 130struct acpi_driver {
133 struct list_head node;
134 char name[80]; 131 char name[80];
135 char class[80]; 132 char class[80];
136 atomic_t references;
137 char *ids; /* Supported Hardware IDs */ 133 char *ids; /* Supported Hardware IDs */
138 struct acpi_device_ops ops; 134 struct acpi_device_ops ops;
135 struct device_driver drv;
136 struct module *owner;
139}; 137};
140 138
141/* 139/*
@@ -185,7 +183,7 @@ struct acpi_device_dir {
185 183
186typedef char acpi_bus_id[5]; 184typedef char acpi_bus_id[5];
187typedef unsigned long acpi_bus_address; 185typedef unsigned long acpi_bus_address;
188typedef char acpi_hardware_id[9]; 186typedef char acpi_hardware_id[15];
189typedef char acpi_unique_id[9]; 187typedef char acpi_unique_id[9];
190typedef char acpi_device_name[40]; 188typedef char acpi_device_name[40];
191typedef char acpi_device_class[20]; 189typedef char acpi_device_class[20];
@@ -296,11 +294,14 @@ struct acpi_device {
296 struct acpi_device_ops ops; 294 struct acpi_device_ops ops;
297 struct acpi_driver *driver; 295 struct acpi_driver *driver;
298 void *driver_data; 296 void *driver_data;
299 struct kobject kobj;
300 struct device dev; 297 struct device dev;
298 struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */
299 enum acpi_bus_removal_type removal_type; /* indicate for different removal type */
301}; 300};
302 301
303#define acpi_driver_data(d) ((d)->driver_data) 302#define acpi_driver_data(d) ((d)->driver_data)
303#define to_acpi_device(d) container_of(d, struct acpi_device, dev)
304#define to_acpi_driver(d) container_of(d, struct acpi_driver, drv)
304 305
305/* 306/*
306 * Events 307 * Events
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 6a5bdcefec64..4dc8a5043ef0 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -36,13 +36,14 @@
36 36
37/* _HID definitions */ 37/* _HID definitions */
38 38
39#define ACPI_POWER_HID "ACPI_PWR" 39#define ACPI_POWER_HID "power_resource"
40#define ACPI_PROCESSOR_HID "ACPI_CPU" 40#define ACPI_PROCESSOR_HID "ACPI0007"
41#define ACPI_SYSTEM_HID "ACPI_SYS" 41#define ACPI_SYSTEM_HID "acpi_system"
42#define ACPI_THERMAL_HID "ACPI_THM" 42#define ACPI_THERMAL_HID "thermal"
43#define ACPI_BUTTON_HID_POWERF "ACPI_FPB" 43#define ACPI_BUTTON_HID_POWERF "button_power"
44#define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB" 44#define ACPI_BUTTON_HID_SLEEPF "button_sleep"
45 45#define ACPI_VIDEO_HID "video"
46#define ACPI_BAY_HID "bay"
46/* -------------------------------------------------------------------------- 47/* --------------------------------------------------------------------------
47 PCI 48 PCI
48 -------------------------------------------------------------------------- */ 49 -------------------------------------------------------------------------- */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 0cd63bce0ae4..781394b9efe0 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -8,7 +8,7 @@
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
10/* 10/*
11 * Copyright (C) 2000 - 2006, R. Byron Moore 11 * Copyright (C) 2000 - 2007, R. Byron Moore
12 * All rights reserved. 12 * All rights reserved.
13 * 13 *
14 * Redistribution and use in source and binary forms, with or without 14 * Redistribution and use in source and binary forms, with or without
@@ -85,7 +85,7 @@ acpi_status acpi_os_terminate(void);
85/* 85/*
86 * ACPI Table interfaces 86 * ACPI Table interfaces
87 */ 87 */
88acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *address); 88acpi_physical_address acpi_os_get_root_pointer(void);
89 89
90acpi_status 90acpi_status
91acpi_os_predefined_override(const struct acpi_predefined_names *init_val, 91acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
@@ -143,9 +143,7 @@ void acpi_os_release_mutex(acpi_mutex handle);
143 */ 143 */
144void *acpi_os_allocate(acpi_size size); 144void *acpi_os_allocate(acpi_size size);
145 145
146acpi_status 146void __iomem *acpi_os_map_memory(acpi_physical_address where, acpi_native_uint length);
147acpi_os_map_memory(acpi_physical_address physical_address,
148 acpi_size size, void __iomem ** logical_address);
149 147
150void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); 148void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);
151 149
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 81458767a90e..e08f7df85a4f 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2006, R. Byron Moore 9 * Copyright (C) 2000 - 2007, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,10 @@
51/* 51/*
52 * Global interfaces 52 * Global interfaces
53 */ 53 */
54acpi_status
55acpi_initialize_tables(struct acpi_table_desc *initial_storage,
56 u32 initial_table_count, u8 allow_resize);
57
54acpi_status acpi_initialize_subsystem(void); 58acpi_status acpi_initialize_subsystem(void);
55 59
56acpi_status acpi_enable_subsystem(u32 flags); 60acpi_status acpi_enable_subsystem(u32 flags);
@@ -92,30 +96,28 @@ void acpi_free(void *address);
92/* 96/*
93 * ACPI table manipulation interfaces 97 * ACPI table manipulation interfaces
94 */ 98 */
95acpi_status 99acpi_status acpi_reallocate_root_table(void);
96acpi_find_root_pointer(u32 flags, struct acpi_pointer *rsdp_address); 100
101acpi_status acpi_find_root_pointer(acpi_native_uint * rsdp_address);
97 102
98acpi_status acpi_load_tables(void); 103acpi_status acpi_load_tables(void);
99 104
100acpi_status acpi_load_table(struct acpi_table_header *table_ptr); 105acpi_status acpi_load_table(struct acpi_table_header *table_ptr);
101 106
102acpi_status acpi_unload_table_id(acpi_table_type table_type, acpi_owner_id id); 107acpi_status acpi_unload_table_id(acpi_owner_id id);
103 108
104#ifdef ACPI_FUTURE_USAGE
105acpi_status acpi_unload_table(acpi_table_type table_type);
106acpi_status 109acpi_status
107acpi_get_table_header(acpi_table_type table_type, 110acpi_get_table_header(acpi_string signature,
108 u32 instance, struct acpi_table_header *out_table_header); 111 acpi_native_uint instance,
109#endif /* ACPI_FUTURE_USAGE */ 112 struct acpi_table_header *out_table_header);
110 113
111acpi_status 114acpi_status
112acpi_get_table(acpi_table_type table_type, 115acpi_get_table(acpi_string signature,
113 u32 instance, struct acpi_buffer *ret_buffer); 116 acpi_native_uint instance, struct acpi_table_header **out_table);
114 117
115acpi_status 118acpi_status
116acpi_get_firmware_table(acpi_string signature, 119acpi_get_table_by_index(acpi_native_uint table_index,
117 u32 instance, 120 struct acpi_table_header **out_table);
118 u32 flags, struct acpi_table_header **table_pointer);
119 121
120/* 122/*
121 * Namespace and name interfaces 123 * Namespace and name interfaces
@@ -310,9 +312,9 @@ acpi_resource_to_address64(struct acpi_resource *resource,
310/* 312/*
311 * Hardware (ACPI device) interfaces 313 * Hardware (ACPI device) interfaces
312 */ 314 */
313acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags); 315acpi_status acpi_get_register(u32 register_id, u32 * return_value);
314 316
315acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags); 317acpi_status acpi_set_register(u32 register_id, u32 value);
316 318
317acpi_status 319acpi_status
318acpi_set_firmware_waking_vector(acpi_physical_address physical_address); 320acpi_set_firmware_waking_vector(acpi_physical_address physical_address);
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index 80a3b33571b4..9486ab266a5e 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index 5e8095f0f78f..aeb4498e5e06 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -139,7 +139,8 @@ struct acpi_init_walk_info {
139 u16 buffer_init; 139 u16 buffer_init;
140 u16 package_init; 140 u16 package_init;
141 u16 object_count; 141 u16 object_count;
142 struct acpi_table_desc *table_desc; 142 acpi_owner_id owner_id;
143 acpi_native_uint table_index;
143}; 144};
144 145
145struct acpi_get_devices_info { 146struct acpi_get_devices_info {
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 4dbaf02fe526..2b9f46f9da4d 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -44,105 +44,75 @@
44#ifndef __ACTABLES_H__ 44#ifndef __ACTABLES_H__
45#define __ACTABLES_H__ 45#define __ACTABLES_H__
46 46
47/* Used in acpi_tb_map_acpi_table for size parameter if table header is to be used */ 47acpi_status acpi_allocate_root_table(u32 initial_table_count);
48
49#define SIZE_IN_HEADER 0
50 48
51/* 49/*
52 * tbconvrt - Table conversion routines 50 * tbfadt - FADT parse/convert/validate
53 */ 51 */
54acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info); 52void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags);
55
56acpi_status acpi_tb_convert_table_fadt(void);
57 53
58acpi_status acpi_tb_build_common_facs(struct acpi_table_desc *table_info); 54void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length);
59
60u32
61acpi_tb_get_table_count(struct rsdp_descriptor *RSDP,
62 struct acpi_table_header *RSDT);
63 55
64/* 56/*
65 * tbget - Table "get" routines 57 * tbfind - find ACPI table
66 */ 58 */
67acpi_status 59acpi_status
68acpi_tb_get_table(struct acpi_pointer *address, 60acpi_tb_find_table(char *signature,
69 struct acpi_table_desc *table_info); 61 char *oem_id,
70 62 char *oem_table_id, acpi_native_uint * table_index);
71acpi_status
72acpi_tb_get_table_header(struct acpi_pointer *address,
73 struct acpi_table_header *return_header);
74
75acpi_status
76acpi_tb_get_table_body(struct acpi_pointer *address,
77 struct acpi_table_header *header,
78 struct acpi_table_desc *table_info);
79
80acpi_status
81acpi_tb_get_table_ptr(acpi_table_type table_type,
82 u32 instance, struct acpi_table_header **table_ptr_loc);
83
84acpi_status acpi_tb_verify_rsdp(struct acpi_pointer *address);
85
86void acpi_tb_get_rsdt_address(struct acpi_pointer *out_address);
87
88acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr);
89 63
90/* 64/*
91 * tbgetall - get multiple required tables 65 * tbinstal - Table removal and deletion
92 */ 66 */
93acpi_status acpi_tb_get_required_tables(void); 67acpi_status acpi_tb_resize_root_table_list(void);
94 68
95/* 69acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc);
96 * tbinstall - Table installation
97 */
98acpi_status acpi_tb_install_table(struct acpi_table_desc *table_info);
99 70
100acpi_status 71acpi_status
101acpi_tb_recognize_table(struct acpi_table_desc *table_info, u8 search_type); 72acpi_tb_add_table(struct acpi_table_desc *table_desc,
73 acpi_native_uint * table_index);
102 74
103acpi_status 75acpi_status
104acpi_tb_init_table_descriptor(acpi_table_type table_type, 76acpi_tb_store_table(acpi_physical_address address,
105 struct acpi_table_desc *table_info); 77 struct acpi_table_header *table,
78 u32 length, u8 flags, acpi_native_uint * table_index);
106 79
107/* 80void acpi_tb_delete_table(struct acpi_table_desc *table_desc);
108 * tbremove - Table removal and deletion
109 */
110void acpi_tb_delete_all_tables(void);
111 81
112void acpi_tb_delete_tables_by_type(acpi_table_type type); 82void acpi_tb_terminate(void);
113 83
114void acpi_tb_delete_single_table(struct acpi_table_desc *table_desc); 84void acpi_tb_delete_namespace_by_owner(acpi_native_uint table_index);
115 85
116struct acpi_table_desc *acpi_tb_uninstall_table(struct acpi_table_desc 86acpi_status acpi_tb_allocate_owner_id(acpi_native_uint table_index);
117 *table_desc); 87
88acpi_status acpi_tb_release_owner_id(acpi_native_uint table_index);
118 89
119/*
120 * tbxfroot - RSDP, RSDT utilities
121 */
122acpi_status 90acpi_status
123acpi_tb_find_table(char *signature, 91acpi_tb_get_owner_id(acpi_native_uint table_index, acpi_owner_id * owner_id);
124 char *oem_id,
125 char *oem_table_id, struct acpi_table_header **table_ptr);
126 92
127acpi_status acpi_tb_get_table_rsdt(void); 93u8 acpi_tb_is_table_loaded(acpi_native_uint table_index);
128 94
129acpi_status acpi_tb_validate_rsdp(struct rsdp_descriptor *rsdp); 95void acpi_tb_set_table_loaded_flag(acpi_native_uint table_index, u8 is_loaded);
130 96
131/* 97/*
132 * tbutils - common table utilities 98 * tbutils - table manager utilities
133 */ 99 */
134acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc); 100u8 acpi_tb_tables_loaded(void);
135 101
136acpi_status 102void
137acpi_tb_verify_table_checksum(struct acpi_table_header *table_header); 103acpi_tb_print_table_header(acpi_physical_address address,
104 struct acpi_table_header *header);
138 105
139u8 acpi_tb_sum_table(void *buffer, u32 length); 106u8 acpi_tb_checksum(u8 * buffer, acpi_native_uint length);
140 107
141u8 acpi_tb_generate_checksum(struct acpi_table_header *table); 108acpi_status
109acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length);
142 110
143void acpi_tb_set_checksum(struct acpi_table_header *table); 111void
112acpi_tb_install_table(acpi_physical_address address,
113 u8 flags, char *signature, acpi_native_uint table_index);
144 114
145acpi_status 115acpi_status
146acpi_tb_validate_table_header(struct acpi_table_header *table_header); 116acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags);
147 117
148#endif /* __ACTABLES_H__ */ 118#endif /* __ACTABLES_H__ */
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index b125ceed9cb7..09469e7db6a5 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -48,15 +48,15 @@
48 * Values for description table header signatures. Useful because they make 48 * Values for description table header signatures. Useful because they make
49 * it more difficult to inadvertently type in the wrong signature. 49 * it more difficult to inadvertently type in the wrong signature.
50 */ 50 */
51#define DSDT_SIG "DSDT" /* Differentiated System Description Table */ 51#define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */
52#define FADT_SIG "FACP" /* Fixed ACPI Description Table */ 52#define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */
53#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ 53#define ACPI_SIG_FACS "FACS" /* Firmware ACPI Control Structure */
54#define PSDT_SIG "PSDT" /* Persistent System Description Table */ 54#define ACPI_SIG_PSDT "PSDT" /* Persistent System Description Table */
55#define RSDP_SIG "RSD PTR " /* Root System Description Pointer */ 55#define ACPI_SIG_RSDP "RSD PTR " /* Root System Description Pointer */
56#define RSDT_SIG "RSDT" /* Root System Description Table */ 56#define ACPI_SIG_RSDT "RSDT" /* Root System Description Table */
57#define XSDT_SIG "XSDT" /* Extended System Description Table */ 57#define ACPI_SIG_XSDT "XSDT" /* Extended System Description Table */
58#define SSDT_SIG "SSDT" /* Secondary System Description Table */ 58#define ACPI_SIG_SSDT "SSDT" /* Secondary System Description Table */
59#define RSDP_NAME "RSDP" 59#define ACPI_RSDP_NAME "RSDP" /* Short name for RSDP, not signature */
60 60
61/* 61/*
62 * All tables and structures must be byte-packed to match the ACPI 62 * All tables and structures must be byte-packed to match the ACPI
@@ -83,27 +83,29 @@
83 * 83 *
84 ******************************************************************************/ 84 ******************************************************************************/
85 85
86#define ACPI_TABLE_HEADER_DEF \
87 char signature[4]; /* ASCII table signature */\
88 u32 length; /* Length of table in bytes, including this header */\
89 u8 revision; /* ACPI Specification minor version # */\
90 u8 checksum; /* To make sum of entire table == 0 */\
91 char oem_id[6]; /* ASCII OEM identification */\
92 char oem_table_id[8]; /* ASCII OEM table identification */\
93 u32 oem_revision; /* OEM revision number */\
94 char asl_compiler_id[4]; /* ASCII ASL compiler vendor ID */\
95 u32 asl_compiler_revision; /* ASL compiler version */
96
97struct acpi_table_header { 86struct acpi_table_header {
98ACPI_TABLE_HEADER_DEF}; 87 char signature[ACPI_NAME_SIZE]; /* ASCII table signature */
88 u32 length; /* Length of table in bytes, including this header */
89 u8 revision; /* ACPI Specification minor version # */
90 u8 checksum; /* To make sum of entire table == 0 */
91 char oem_id[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
92 char oem_table_id[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
93 u32 oem_revision; /* OEM revision number */
94 char asl_compiler_id[ACPI_NAME_SIZE]; /* ASCII ASL compiler vendor ID */
95 u32 asl_compiler_revision; /* ASL compiler version */
96};
99 97
100/* 98/*
101 * GAS - Generic Address Structure (ACPI 2.0+) 99 * GAS - Generic Address Structure (ACPI 2.0+)
100 *
101 * Note: Since this structure is used in the ACPI tables, it is byte aligned.
102 * If misalignment is not supported, access to the Address field must be
103 * performed with care.
102 */ 104 */
103struct acpi_generic_address { 105struct acpi_generic_address {
104 u8 address_space_id; /* Address space where struct or register exists */ 106 u8 space_id; /* Address space where struct or register exists */
105 u8 register_bit_width; /* Size in bits of given register */ 107 u8 bit_width; /* Size in bits of given register */
106 u8 register_bit_offset; /* Bit offset within the register */ 108 u8 bit_offset; /* Bit offset within the register */
107 u8 access_width; /* Minimum Access size (ACPI 3.0) */ 109 u8 access_width; /* Minimum Access size (ACPI 3.0) */
108 u64 address; /* 64-bit address of struct or register */ 110 u64 address; /* 64-bit address of struct or register */
109}; 111};
@@ -114,10 +116,10 @@ struct acpi_generic_address {
114 * 116 *
115 ******************************************************************************/ 117 ******************************************************************************/
116 118
117struct rsdp_descriptor { 119struct acpi_table_rsdp {
118 char signature[8]; /* ACPI signature, contains "RSD PTR " */ 120 char signature[8]; /* ACPI signature, contains "RSD PTR " */
119 u8 checksum; /* ACPI 1.0 checksum */ 121 u8 checksum; /* ACPI 1.0 checksum */
120 char oem_id[6]; /* OEM identification */ 122 char oem_id[ACPI_OEM_ID_SIZE]; /* OEM identification */
121 u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ 123 u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */
122 u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ 124 u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */
123 u32 length; /* Table length in bytes, including header (ACPI 2.0+) */ 125 u32 length; /* Table length in bytes, including header (ACPI 2.0+) */
@@ -134,12 +136,14 @@ struct rsdp_descriptor {
134 * 136 *
135 ******************************************************************************/ 137 ******************************************************************************/
136 138
137struct rsdt_descriptor { 139struct acpi_table_rsdt {
138 ACPI_TABLE_HEADER_DEF u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ 140 struct acpi_table_header header; /* Common ACPI table header */
141 u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
139}; 142};
140 143
141struct xsdt_descriptor { 144struct acpi_table_xsdt {
142 ACPI_TABLE_HEADER_DEF u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ 145 struct acpi_table_header header; /* Common ACPI table header */
146 u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
143}; 147};
144 148
145/******************************************************************************* 149/*******************************************************************************
@@ -148,36 +152,27 @@ struct xsdt_descriptor {
148 * 152 *
149 ******************************************************************************/ 153 ******************************************************************************/
150 154
151struct facs_descriptor { 155struct acpi_table_facs {
152 char signature[4]; /* ASCII table signature */ 156 char signature[4]; /* ASCII table signature */
153 u32 length; /* Length of structure, in bytes */ 157 u32 length; /* Length of structure, in bytes */
154 u32 hardware_signature; /* Hardware configuration signature */ 158 u32 hardware_signature; /* Hardware configuration signature */
155 u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector */ 159 u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector */
156 u32 global_lock; /* Global Lock for shared hardware resources */ 160 u32 global_lock; /* Global Lock for shared hardware resources */
157 161 u32 flags;
158 /* Flags (32 bits) */
159
160 u8 S4bios_f:1; /* 00: S4BIOS support is present */
161 u8:7; /* 01-07: Reserved, must be zero */
162 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
163
164 u64 xfirmware_waking_vector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */ 162 u64 xfirmware_waking_vector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */
165 u8 version; /* Version of this table (ACPI 2.0+) */ 163 u8 version; /* Version of this table (ACPI 2.0+) */
166 u8 reserved[31]; /* Reserved, must be zero */ 164 u8 reserved[31]; /* Reserved, must be zero */
167}; 165};
168 166
167/* Flag macros */
168
169#define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */
170
171/* Global lock flags */
172
169#define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */ 173#define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */
170#define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */ 174#define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */
171 175
172/*
173 * Common FACS - This is a version-independent FACS structure used for internal use only
174 */
175struct acpi_common_facs {
176 u32 *global_lock;
177 u64 *firmware_waking_vector;
178 u8 vector_width;
179};
180
181/******************************************************************************* 176/*******************************************************************************
182 * 177 *
183 * FADT - Fixed ACPI Description Table (Signature "FACP") 178 * FADT - Fixed ACPI Description Table (Signature "FACP")
@@ -186,121 +181,98 @@ struct acpi_common_facs {
186 181
187/* Fields common to all versions of the FADT */ 182/* Fields common to all versions of the FADT */
188 183
189#define ACPI_FADT_COMMON \ 184struct acpi_table_fadt {
190 ACPI_TABLE_HEADER_DEF \ 185 struct acpi_table_header header; /* Common ACPI table header */
191 u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \ 186 u32 facs; /* 32-bit physical address of FACS */
192 u32 V1_dsdt; /* 32-bit physical address of DSDT */ \ 187 u32 dsdt; /* 32-bit physical address of DSDT */
193 u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ \ 188 u8 model; /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */
194 u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ \ 189 u8 preferred_profile; /* Conveys preferred power management profile to OSPM. */
195 u16 sci_int; /* System vector of SCI interrupt */ \ 190 u16 sci_interrupt; /* System vector of SCI interrupt */
196 u32 smi_cmd; /* Port address of SMI command port */ \ 191 u32 smi_command; /* 32-bit Port address of SMI command port */
197 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ \ 192 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */
198 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ \ 193 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */
199 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ \ 194 u8 S4bios_request; /* Value to write to SMI CMD to enter S4BIOS state */
200 u8 pstate_cnt; /* Processor performance state control*/ \ 195 u8 pstate_control; /* Processor performance state control */
201 u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a Event Reg Blk */ \ 196 u32 pm1a_event_block; /* 32-bit Port address of Power Mgt 1a Event Reg Blk */
202 u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b Event Reg Blk */ \ 197 u32 pm1b_event_block; /* 32-bit Port address of Power Mgt 1b Event Reg Blk */
203 u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ \ 198 u32 pm1a_control_block; /* 32-bit Port address of Power Mgt 1a Control Reg Blk */
204 u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ \ 199 u32 pm1b_control_block; /* 32-bit Port address of Power Mgt 1b Control Reg Blk */
205 u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ \ 200 u32 pm2_control_block; /* 32-bit Port address of Power Mgt 2 Control Reg Blk */
206 u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ \ 201 u32 pm_timer_block; /* 32-bit Port address of Power Mgt Timer Ctrl Reg Blk */
207 u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ \ 202 u32 gpe0_block; /* 32-bit Port address of General Purpose Event 0 Reg Blk */
208 u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ \ 203 u32 gpe1_block; /* 32-bit Port address of General Purpose Event 1 Reg Blk */
209 u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */ \ 204 u8 pm1_event_length; /* Byte Length of ports at pm1x_event_block */
210 u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */ \ 205 u8 pm1_control_length; /* Byte Length of ports at pm1x_control_block */
211 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ \ 206 u8 pm2_control_length; /* Byte Length of ports at pm2_control_block */
212 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ \ 207 u8 pm_timer_length; /* Byte Length of ports at pm_timer_block */
213 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ \ 208 u8 gpe0_block_length; /* Byte Length of ports at gpe0_block */
214 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ \ 209 u8 gpe1_block_length; /* Byte Length of ports at gpe1_block */
215 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ \ 210 u8 gpe1_base; /* Offset in GPE number space where GPE1 events start */
216 u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ \ 211 u8 cst_control; /* Support for the _CST object and C States change notification */
217 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ \ 212 u16 C2latency; /* Worst case HW latency to enter/exit C2 state */
218 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ \ 213 u16 C3latency; /* Worst case HW latency to enter/exit C3 state */
219 u16 flush_size; /* Processor's memory cache line width, in bytes */ \ 214 u16 flush_size; /* Processor's memory cache line width, in bytes */
220 u16 flush_stride; /* Number of flush strides that need to be read */ \ 215 u16 flush_stride; /* Number of flush strides that need to be read */
221 u8 duty_offset; /* Processor's duty cycle index in processor's P_CNT reg*/ \ 216 u8 duty_offset; /* Processor duty cycle index in processor's P_CNT reg */
222 u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/ \ 217 u8 duty_width; /* Processor duty cycle value bit width in P_CNT register. */
223 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ \ 218 u8 day_alarm; /* Index to day-of-month alarm in RTC CMOS RAM */
224 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ \ 219 u8 month_alarm; /* Index to month-of-year alarm in RTC CMOS RAM */
225 u8 century; /* Index to century in RTC CMOS RAM */ \ 220 u8 century; /* Index to century in RTC CMOS RAM */
226 u16 iapc_boot_arch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/ \ 221 u16 boot_flags; /* IA-PC Boot Architecture Flags. See Table 5-10 for description */
227 u8 reserved2; /* Reserved, must be zero */ 222 u8 reserved; /* Reserved, must be zero */
228 223 u32 flags; /* Miscellaneous flag bits (see below for individual flags) */
229/* 224 struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */
230 * ACPI 2.0+ FADT
231 */
232struct fadt_descriptor {
233 ACPI_FADT_COMMON
234 /* Flags (32 bits) */
235 u8 wb_invd:1; /* 00: The wbinvd instruction works properly */
236 u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */
237 u8 proc_c1:1; /* 02: All processors support C1 state */
238 u8 plvl2_up:1; /* 03: C2 state works on MP system */
239 u8 pwr_button:1; /* 04: Power button is handled as a generic feature */
240 u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */
241 u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */
242 u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */
243 u8 tmr_val_ext:1; /* 08: tmr_val is 32 bits 0=24-bits */
244 u8 dock_cap:1; /* 09: Docking supported */
245 u8 reset_reg_sup:1; /* 10: System reset via the FADT RESET_REG supported */
246 u8 sealed_case:1; /* 11: No internal expansion capabilities and case is sealed */
247 u8 headless:1; /* 12: No local video capabilities or local input devices */
248 u8 cpu_sw_sleep:1; /* 13: Must execute native instruction after writing SLP_TYPx register */
249
250 u8 pci_exp_wak:1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
251 u8 use_platform_clock:1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */
252 u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
253 u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */
254 u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */
255 u8 force_apic_physical_destination_mode:1; /* 19: All local x_aPICs must use physical dest mode (ACPI 3.0) */
256 u8:4; /* 20-23: Reserved, must be zero */
257 u8 reserved3; /* 24-31: Reserved, must be zero */
258
259 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
260 u8 reset_value; /* Value to write to the reset_register port to reset the system */ 225 u8 reset_value; /* Value to write to the reset_register port to reset the system */
261 u8 reserved4[3]; /* These three bytes must be zero */ 226 u8 reserved4[3]; /* Reserved, must be zero */
262 u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ 227 u64 Xfacs; /* 64-bit physical address of FACS */
263 u64 Xdsdt; /* 64-bit physical address of DSDT */ 228 u64 Xdsdt; /* 64-bit physical address of DSDT */
264 struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ 229 struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
265 struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */ 230 struct acpi_generic_address xpm1b_event_block; /* 64-bit Extended Power Mgt 1b Event Reg Blk address */
266 struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */ 231 struct acpi_generic_address xpm1a_control_block; /* 64-bit Extended Power Mgt 1a Control Reg Blk address */
267 struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ 232 struct acpi_generic_address xpm1b_control_block; /* 64-bit Extended Power Mgt 1b Control Reg Blk address */
268 struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ 233 struct acpi_generic_address xpm2_control_block; /* 64-bit Extended Power Mgt 2 Control Reg Blk address */
269 struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ 234 struct acpi_generic_address xpm_timer_block; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
270 struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */ 235 struct acpi_generic_address xgpe0_block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */
271 struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */ 236 struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */
272}; 237};
273 238
274/* 239/* FADT flags */
275 * "Down-revved" ACPI 2.0 FADT descriptor 240
276 * Defined here to allow compiler to generate the length of the struct 241#define ACPI_FADT_WBINVD (1) /* 00: The wbinvd instruction works properly */
277 */ 242#define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: The wbinvd flushes but does not invalidate */
278struct fadt_descriptor_rev2_minus { 243#define ACPI_FADT_C1_SUPPORTED (1<<2) /* 02: All processors support C1 state */
279 ACPI_FADT_COMMON u32 flags; 244#define ACPI_FADT_C2_MP_SUPPORTED (1<<3) /* 03: C2 state works on MP system */
280 struct acpi_generic_address reset_register; /* Reset register address in GAS format */ 245#define ACPI_FADT_POWER_BUTTON (1<<4) /* 04: Power button is handled as a generic feature */
281 u8 reset_value; /* Value to write to the reset_register port to reset the system. */ 246#define ACPI_FADT_SLEEP_BUTTON (1<<5) /* 05: Sleep button is handled as a generic feature, or not present */
282 u8 reserved7[3]; /* Reserved, must be zero */ 247#define ACPI_FADT_FIXED_RTC (1<<6) /* 06: RTC wakeup stat not in fixed register space */
283}; 248#define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: RTC wakeup stat not possible from S4 */
249#define ACPI_FADT_32BIT_TIMER (1<<8) /* 08: tmr_val is 32 bits 0=24-bits */
250#define ACPI_FADT_DOCKING_SUPPORTED (1<<9) /* 09: Docking supported */
251#define ACPI_FADT_RESET_REGISTER (1<<10) /* 10: System reset via the FADT RESET_REG supported */
252#define ACPI_FADT_SEALED_CASE (1<<11) /* 11: No internal expansion capabilities and case is sealed */
253#define ACPI_FADT_HEADLESS (1<<12) /* 12: No local video capabilities or local input devices */
254#define ACPI_FADT_SLEEP_TYPE (1<<13) /* 13: Must execute native instruction after writing SLP_TYPx register */
255#define ACPI_FADT_PCI_EXPRESS_WAKE (1<<14) /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
256#define ACPI_FADT_PLATFORM_CLOCK (1<<15) /* 15: OSPM should use platform-provided timer (ACPI 3.0) */
257#define ACPI_FADT_S4_RTC_VALID (1<<16) /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
258#define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: System is compatible with remote power on (ACPI 3.0) */
259#define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: All local APICs must use cluster model (ACPI 3.0) */
260#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: All local x_aPICs must use physical dest mode (ACPI 3.0) */
284 261
285/* 262/*
286 * ACPI 1.0 FADT 263 * FADT Prefered Power Management Profiles
287 * Defined here to allow compiler to generate the length of the struct
288 */ 264 */
289struct fadt_descriptor_rev1 { 265enum acpi_prefered_pm_profiles {
290 ACPI_FADT_COMMON u32 flags; 266 PM_UNSPECIFIED = 0,
267 PM_DESKTOP = 1,
268 PM_MOBILE = 2,
269 PM_WORKSTATION = 3,
270 PM_ENTERPRISE_SERVER = 4,
271 PM_SOHO_SERVER = 5,
272 PM_APPLIANCE_PC = 6
291}; 273};
292 274
293/* FADT: Prefered Power Management Profiles */ 275/* FADT Boot Arch Flags */
294
295#define PM_UNSPECIFIED 0
296#define PM_DESKTOP 1
297#define PM_MOBILE 2
298#define PM_WORKSTATION 3
299#define PM_ENTERPRISE_SERVER 4
300#define PM_SOHO_SERVER 5
301#define PM_APPLIANCE_PC 6
302
303/* FADT: Boot Arch Flags */
304 276
305#define BAF_LEGACY_DEVICES 0x0001 277#define BAF_LEGACY_DEVICES 0x0001
306#define BAF_8042_KEYBOARD_CONTROLLER 0x0002 278#define BAF_8042_KEYBOARD_CONTROLLER 0x0002
@@ -312,59 +284,12 @@ struct fadt_descriptor_rev1 {
312 284
313#pragma pack() 285#pragma pack()
314 286
315/* 287#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f)
316 * This macro is temporary until the table bitfield flag definitions
317 * are removed and replaced by a Flags field.
318 */
319#define ACPI_FLAG_OFFSET(d,f,o) (u8) (ACPI_OFFSET (d,f) + \
320 sizeof(((d *)0)->f) + o)
321/*
322 * Get the remaining ACPI tables
323 */
324#include "actbl1.h"
325 288
326/* 289/*
327 * ACPI Table information. We save the table address, length, 290 * Get the remaining ACPI tables
328 * and type of memory allocation (mapped or allocated) for each
329 * table for 1) when we exit, and 2) if a new table is installed
330 */ 291 */
331#define ACPI_MEM_NOT_ALLOCATED 0
332#define ACPI_MEM_ALLOCATED 1
333#define ACPI_MEM_MAPPED 2
334
335/* Definitions for the Flags bitfield member of struct acpi_table_support */
336
337#define ACPI_TABLE_SINGLE 0x00
338#define ACPI_TABLE_MULTIPLE 0x01
339#define ACPI_TABLE_EXECUTABLE 0x02
340
341#define ACPI_TABLE_ROOT 0x00
342#define ACPI_TABLE_PRIMARY 0x10
343#define ACPI_TABLE_SECONDARY 0x20
344#define ACPI_TABLE_ALL 0x30
345#define ACPI_TABLE_TYPE_MASK 0x30
346
347/* Data about each known table type */
348
349struct acpi_table_support {
350 char *name;
351 char *signature;
352 void **global_ptr;
353 u8 sig_length;
354 u8 flags;
355};
356
357extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1,
358 * needed for certain workarounds */
359/* Macros used to generate offsets to specific table fields */
360
361#define ACPI_FACS_OFFSET(f) (u8) ACPI_OFFSET (struct facs_descriptor,f)
362#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct fadt_descriptor, f)
363#define ACPI_GAS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_generic_address,f)
364#define ACPI_HDR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_header,f)
365#define ACPI_RSDP_OFFSET(f) (u8) ACPI_OFFSET (struct rsdp_descriptor,f)
366 292
367#define ACPI_FADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct fadt_descriptor,f,o) 293#include <acpi/actbl1.h>
368#define ACPI_FACS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct facs_descriptor,f,o)
369 294
370#endif /* __ACTBL_H__ */ 295#endif /* __ACTBL_H__ */
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 745a6445a4f9..4e5d3ca53a8e 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -61,6 +61,7 @@
61#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ 61#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
62#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ 62#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
63#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */ 63#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
64#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
64#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ 65#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
65#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ 66#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
66#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ 67#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
@@ -73,12 +74,6 @@
73#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ 74#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
74#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ 75#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
75 76
76/* Legacy names */
77
78#define APIC_SIG "APIC" /* Multiple APIC Description Table */
79#define BOOT_SIG "BOOT" /* Simple Boot Flag Table */
80#define SBST_SIG "SBST" /* Smart Battery Specification Table */
81
82/* 77/*
83 * All tables must be byte-packed to match the ACPI specification, since 78 * All tables must be byte-packed to match the ACPI specification, since
84 * the tables are provided by the system BIOS. 79 * the tables are provided by the system BIOS.
@@ -91,31 +86,43 @@
91 * portable, so do not use any other bitfield types. 86 * portable, so do not use any other bitfield types.
92 */ 87 */
93 88
89/* Common Sub-table header (used in MADT, SRAT, etc.) */
90
91struct acpi_subtable_header {
92 u8 type;
93 u8 length;
94};
95
94/******************************************************************************* 96/*******************************************************************************
95 * 97 *
96 * ASF - Alert Standard Format table (Signature "ASF!") 98 * ASF - Alert Standard Format table (Signature "ASF!")
97 * 99 *
100 * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
101 *
98 ******************************************************************************/ 102 ******************************************************************************/
99 103
100struct acpi_table_asf { 104struct acpi_table_asf {
101ACPI_TABLE_HEADER_DEF}; 105 struct acpi_table_header header; /* Common ACPI table header */
106};
102 107
103#define ACPI_ASF_HEADER_DEF \ 108/* ASF subtable header */
104 u8 type; \
105 u8 reserved; \
106 u16 length;
107 109
108struct acpi_asf_header { 110struct acpi_asf_header {
109ACPI_ASF_HEADER_DEF}; 111 u8 type;
112 u8 reserved;
113 u16 length;
114};
110 115
111/* Values for Type field */ 116/* Values for Type field above */
112 117
113#define ASF_INFO 0 118enum acpi_asf_type {
114#define ASF_ALERT 1 119 ACPI_ASF_TYPE_INFO = 0,
115#define ASF_CONTROL 2 120 ACPI_ASF_TYPE_ALERT = 1,
116#define ASF_BOOT 3 121 ACPI_ASF_TYPE_CONTROL = 2,
117#define ASF_ADDRESS 4 122 ACPI_ASF_TYPE_BOOT = 3,
118#define ASF_RESERVED 5 123 ACPI_ASF_TYPE_ADDRESS = 4,
124 ACPI_ASF_TYPE_RESERVED = 5
125};
119 126
120/* 127/*
121 * ASF subtables 128 * ASF subtables
@@ -124,7 +131,8 @@ ACPI_ASF_HEADER_DEF};
124/* 0: ASF Information */ 131/* 0: ASF Information */
125 132
126struct acpi_asf_info { 133struct acpi_asf_info {
127 ACPI_ASF_HEADER_DEF u8 min_reset_value; 134 struct acpi_asf_header header;
135 u8 min_reset_value;
128 u8 min_poll_interval; 136 u8 min_poll_interval;
129 u16 system_id; 137 u16 system_id;
130 u32 mfg_id; 138 u32 mfg_id;
@@ -135,26 +143,49 @@ struct acpi_asf_info {
135/* 1: ASF Alerts */ 143/* 1: ASF Alerts */
136 144
137struct acpi_asf_alert { 145struct acpi_asf_alert {
138 ACPI_ASF_HEADER_DEF u8 assert_mask; 146 struct acpi_asf_header header;
147 u8 assert_mask;
139 u8 deassert_mask; 148 u8 deassert_mask;
140 u8 alerts; 149 u8 alerts;
141 u8 data_length; 150 u8 data_length;
142 u8 array[1]; 151};
152
153struct acpi_asf_alert_data {
154 u8 address;
155 u8 command;
156 u8 mask;
157 u8 value;
158 u8 sensor_type;
159 u8 type;
160 u8 offset;
161 u8 source_type;
162 u8 severity;
163 u8 sensor_number;
164 u8 entity;
165 u8 instance;
143}; 166};
144 167
145/* 2: ASF Remote Control */ 168/* 2: ASF Remote Control */
146 169
147struct acpi_asf_remote { 170struct acpi_asf_remote {
148 ACPI_ASF_HEADER_DEF u8 controls; 171 struct acpi_asf_header header;
172 u8 controls;
149 u8 data_length; 173 u8 data_length;
150 u16 reserved2; 174 u16 reserved2;
151 u8 array[1]; 175};
176
177struct acpi_asf_control_data {
178 u8 function;
179 u8 address;
180 u8 command;
181 u8 value;
152}; 182};
153 183
154/* 3: ASF RMCP Boot Options */ 184/* 3: ASF RMCP Boot Options */
155 185
156struct acpi_asf_rmcp { 186struct acpi_asf_rmcp {
157 ACPI_ASF_HEADER_DEF u8 capabilities[7]; 187 struct acpi_asf_header header;
188 u8 capabilities[7];
158 u8 completion_code; 189 u8 completion_code;
159 u32 enterprise_id; 190 u32 enterprise_id;
160 u8 command; 191 u8 command;
@@ -166,9 +197,9 @@ struct acpi_asf_rmcp {
166/* 4: ASF Address */ 197/* 4: ASF Address */
167 198
168struct acpi_asf_address { 199struct acpi_asf_address {
169 ACPI_ASF_HEADER_DEF u8 eprom_address; 200 struct acpi_asf_header header;
201 u8 eprom_address;
170 u8 devices; 202 u8 devices;
171 u8 smbus_addresses[1];
172}; 203};
173 204
174/******************************************************************************* 205/*******************************************************************************
@@ -178,7 +209,8 @@ struct acpi_asf_address {
178 ******************************************************************************/ 209 ******************************************************************************/
179 210
180struct acpi_table_boot { 211struct acpi_table_boot {
181 ACPI_TABLE_HEADER_DEF u8 cmos_index; /* Index in CMOS RAM for the boot register */ 212 struct acpi_table_header header; /* Common ACPI table header */
213 u8 cmos_index; /* Index in CMOS RAM for the boot register */
182 u8 reserved[3]; 214 u8 reserved[3];
183}; 215};
184 216
@@ -189,7 +221,8 @@ struct acpi_table_boot {
189 ******************************************************************************/ 221 ******************************************************************************/
190 222
191struct acpi_table_cpep { 223struct acpi_table_cpep {
192 ACPI_TABLE_HEADER_DEF u64 reserved; 224 struct acpi_table_header header; /* Common ACPI table header */
225 u64 reserved;
193}; 226};
194 227
195/* Subtable */ 228/* Subtable */
@@ -197,9 +230,9 @@ struct acpi_table_cpep {
197struct acpi_cpep_polling { 230struct acpi_cpep_polling {
198 u8 type; 231 u8 type;
199 u8 length; 232 u8 length;
200 u8 processor_id; /* Processor ID */ 233 u8 id; /* Processor ID */
201 u8 processor_eid; /* Processor EID */ 234 u8 eid; /* Processor EID */
202 u32 polling_interval; /* Polling interval (msec) */ 235 u32 interval; /* Polling interval (msec) */
203}; 236};
204 237
205/******************************************************************************* 238/*******************************************************************************
@@ -209,196 +242,281 @@ struct acpi_cpep_polling {
209 ******************************************************************************/ 242 ******************************************************************************/
210 243
211struct acpi_table_dbgp { 244struct acpi_table_dbgp {
212 ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */ 245 struct acpi_table_header header; /* Common ACPI table header */
246 u8 type; /* 0=full 16550, 1=subset of 16550 */
213 u8 reserved[3]; 247 u8 reserved[3];
214 struct acpi_generic_address debug_port; 248 struct acpi_generic_address debug_port;
215}; 249};
216 250
217/******************************************************************************* 251/*******************************************************************************
218 * 252 *
219 * ECDT - Embedded Controller Boot Resources Table 253 * DMAR - DMA Remapping table
220 * 254 *
221 ******************************************************************************/ 255 ******************************************************************************/
222 256
223struct ec_boot_resources { 257struct acpi_table_dmar {
224 ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */ 258 struct acpi_table_header header; /* Common ACPI table header */
225 struct acpi_generic_address ec_data; /* Address of EC data register */ 259 u8 width; /* Host Address Width */
226 u32 uid; /* Unique ID - must be same as the EC _UID method */ 260 u8 reserved[11];
227 u8 gpe_bit; /* The GPE for the EC */ 261};
228 u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */ 262
263/* DMAR subtable header */
264
265struct acpi_dmar_header {
266 u16 type;
267 u16 length;
268 u8 flags;
269 u8 reserved[3];
270};
271
272/* Values for subtable type in struct acpi_dmar_header */
273
274enum acpi_dmar_type {
275 ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
276 ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
277 ACPI_DMAR_TYPE_RESERVED = 2 /* 2 and greater are reserved */
278};
279
280struct acpi_dmar_device_scope {
281 u8 entry_type;
282 u8 length;
283 u8 segment;
284 u8 bus;
285};
286
287/* Values for entry_type in struct acpi_dmar_device_scope */
288
289enum acpi_dmar_scope_type {
290 ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
291 ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
292 ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
293 ACPI_DMAR_SCOPE_TYPE_RESERVED = 3 /* 3 and greater are reserved */
294};
295
296/*
297 * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
298 */
299
300/* 0: Hardware Unit Definition */
301
302struct acpi_dmar_hardware_unit {
303 struct acpi_dmar_header header;
304 u64 address; /* Register Base Address */
305};
306
307/* Flags */
308
309#define ACPI_DMAR_INCLUDE_ALL (1)
310
311/* 1: Reserved Memory Defininition */
312
313struct acpi_dmar_reserved_memory {
314 struct acpi_dmar_header header;
315 u64 address; /* 4_k aligned base address */
316 u64 end_address; /* 4_k aligned limit address */
229}; 317};
230 318
319/* Flags */
320
321#define ACPI_DMAR_ALLOW_ALL (1)
322
231/******************************************************************************* 323/*******************************************************************************
232 * 324 *
233 * HPET - High Precision Event Timer table 325 * ECDT - Embedded Controller Boot Resources Table
234 * 326 *
235 ******************************************************************************/ 327 ******************************************************************************/
236 328
237struct acpi_hpet_table { 329struct acpi_table_ecdt {
238 ACPI_TABLE_HEADER_DEF u32 hardware_id; /* Hardware ID of event timer block */ 330 struct acpi_table_header header; /* Common ACPI table header */
239 struct acpi_generic_address base_address; /* Address of event timer block */ 331 struct acpi_generic_address control; /* Address of EC command/status register */
240 u8 hpet_number; /* HPET sequence number */ 332 struct acpi_generic_address data; /* Address of EC data register */
241 u16 clock_tick; /* Main counter min tick, periodic mode */ 333 u32 uid; /* Unique ID - must be same as the EC _UID method */
242 u8 attributes; 334 u8 gpe; /* The GPE for the EC */
335 u8 id[1]; /* Full namepath of the EC in the ACPI namespace */
243}; 336};
244 337
245#if 0 /* HPET flags to be converted to macros */
246struct { /* Flags (8 bits) */
247 u8 page_protect:1; /* 00: No page protection */
248 u8 page_protect4:1; /* 01: 4_kB page protected */
249 u8 page_protect64:1; /* 02: 64_kB page protected */
250 u8:5; /* 03-07: Reserved, must be zero */
251} flags;
252#endif
253
254/******************************************************************************* 338/*******************************************************************************
255 * 339 *
256 * MADT - Multiple APIC Description Table 340 * HPET - High Precision Event Timer table
257 * 341 *
258 ******************************************************************************/ 342 ******************************************************************************/
259 343
260struct multiple_apic_table { 344struct acpi_table_hpet {
261 ACPI_TABLE_HEADER_DEF u32 local_apic_address; /* Physical address of local APIC */ 345 struct acpi_table_header header; /* Common ACPI table header */
262 346 u32 id; /* Hardware ID of event timer block */
263 /* Flags (32 bits) */ 347 struct acpi_generic_address address; /* Address of event timer block */
264 348 u8 sequence; /* HPET sequence number */
265 u8 PCATcompat:1; /* 00: System also has dual 8259s */ 349 u16 minimum_tick; /* Main counter min tick, periodic mode */
266 u8:7; /* 01-07: Reserved, must be zero */ 350 u8 flags;
267 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
268}; 351};
269 352
270/* Values for MADT PCATCompat */ 353/*! Flags */
271 354
272#define DUAL_PIC 0 355#define ACPI_HPET_PAGE_PROTECT (1) /* 00: No page protection */
273#define MULTIPLE_APIC 1 356#define ACPI_HPET_PAGE_PROTECT_4 (1<<1) /* 01: 4KB page protected */
357#define ACPI_HPET_PAGE_PROTECT_64 (1<<2) /* 02: 64KB page protected */
274 358
275/* Common MADT Sub-table header */ 359/*! [End] no source code translation !*/
276 360
277#define APIC_HEADER_DEF \ 361/*******************************************************************************
278 u8 type; \ 362 *
279 u8 length; 363 * MADT - Multiple APIC Description Table
280 364 *
281struct apic_header { 365 ******************************************************************************/
282APIC_HEADER_DEF};
283
284/* Values for Type in struct apic_header */
285 366
286#define APIC_PROCESSOR 0 367struct acpi_table_madt {
287#define APIC_IO 1 368 struct acpi_table_header header; /* Common ACPI table header */
288#define APIC_XRUPT_OVERRIDE 2 369 u32 address; /* Physical address of local APIC */
289#define APIC_NMI 3 370 u32 flags;
290#define APIC_LOCAL_NMI 4 371};
291#define APIC_ADDRESS_OVERRIDE 5
292#define APIC_IO_SAPIC 6
293#define APIC_LOCAL_SAPIC 7
294#define APIC_XRUPT_SOURCE 8
295#define APIC_RESERVED 9 /* 9 and greater are reserved */
296 372
297/* Flag definitions for MADT sub-tables */ 373/* Flags */
298 374
299#define ACPI_MADT_IFLAGS /* INTI flags (16 bits) */ \ 375#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
300 u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\
301 u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\
302 u8 : 4; /* 04-07: Reserved, must be zero */\
303 u8 reserved1; /* 08-15: Reserved, must be zero */
304 376
305#define ACPI_MADT_LFLAGS /* Local Sapic flags (32 bits) */ \ 377/* Values for PCATCompat flag */
306 u8 processor_enabled: 1; /* 00: Processor is usable if set */\
307 u8 : 7; /* 01-07: Reserved, must be zero */\
308 u8 reserved2[3]; /* 08-31: Reserved, must be zero */
309 378
310/* Values for MPS INTI flags */ 379#define ACPI_MADT_DUAL_PIC 0
380#define ACPI_MADT_MULTIPLE_APIC 1
311 381
312#define POLARITY_CONFORMS 0 382/* Values for subtable type in struct acpi_subtable_header */
313#define POLARITY_ACTIVE_HIGH 1
314#define POLARITY_RESERVED 2
315#define POLARITY_ACTIVE_LOW 3
316 383
317#define TRIGGER_CONFORMS 0 384enum acpi_madt_type {
318#define TRIGGER_EDGE 1 385 ACPI_MADT_TYPE_LOCAL_APIC = 0,
319#define TRIGGER_RESERVED 2 386 ACPI_MADT_TYPE_IO_APIC = 1,
320#define TRIGGER_LEVEL 3 387 ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
388 ACPI_MADT_TYPE_NMI_SOURCE = 3,
389 ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
390 ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
391 ACPI_MADT_TYPE_IO_SAPIC = 6,
392 ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
393 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
394 ACPI_MADT_TYPE_RESERVED = 9 /* 9 and greater are reserved */
395};
321 396
322/* 397/*
323 * MADT Sub-tables, correspond to Type in struct apic_header 398 * MADT Sub-tables, correspond to Type in struct acpi_subtable_header
324 */ 399 */
325 400
326/* 0: processor APIC */ 401/* 0: Processor Local APIC */
327 402
328struct madt_processor_apic { 403struct acpi_madt_local_apic {
329 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 404 struct acpi_subtable_header header;
330 u8 local_apic_id; /* Processor's local APIC id */ 405 u8 processor_id; /* ACPI processor id */
331 ACPI_MADT_LFLAGS}; 406 u8 id; /* Processor's local APIC id */
407 u32 lapic_flags;
408};
332 409
333/* 1: IO APIC */ 410/* 1: IO APIC */
334 411
335struct madt_io_apic { 412struct acpi_madt_io_apic {
336 APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */ 413 struct acpi_subtable_header header;
414 u8 id; /* I/O APIC ID */
337 u8 reserved; /* Reserved - must be zero */ 415 u8 reserved; /* Reserved - must be zero */
338 u32 address; /* APIC physical address */ 416 u32 address; /* APIC physical address */
339 u32 interrupt; /* Global system interrupt where INTI lines start */ 417 u32 global_irq_base; /* Global system interrupt where INTI lines start */
340}; 418};
341 419
342/* 2: Interrupt Override */ 420/* 2: Interrupt Override */
343 421
344struct madt_interrupt_override { 422struct acpi_madt_interrupt_override {
345 APIC_HEADER_DEF u8 bus; /* 0 - ISA */ 423 struct acpi_subtable_header header;
346 u8 source; /* Interrupt source (IRQ) */ 424 u8 bus; /* 0 - ISA */
347 u32 interrupt; /* Global system interrupt */ 425 u8 source_irq; /* Interrupt source (IRQ) */
348 ACPI_MADT_IFLAGS}; 426 u32 global_irq; /* Global system interrupt */
427 u16 inti_flags;
428};
349 429
350/* 3: NMI Sources */ 430/* 3: NMI Source */
351 431
352struct madt_nmi_source { 432struct acpi_madt_nmi_source {
353 APIC_HEADER_DEF ACPI_MADT_IFLAGS u32 interrupt; /* Global system interrupt */ 433 struct acpi_subtable_header header;
434 u16 inti_flags;
435 u32 global_irq; /* Global system interrupt */
354}; 436};
355 437
356/* 4: Local APIC NMI */ 438/* 4: Local APIC NMI */
357 439
358struct madt_local_apic_nmi { 440struct acpi_madt_local_apic_nmi {
359 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 441 struct acpi_subtable_header header;
360 ACPI_MADT_IFLAGS u8 lint; /* LINTn to which NMI is connected */ 442 u8 processor_id; /* ACPI processor id */
443 u16 inti_flags;
444 u8 lint; /* LINTn to which NMI is connected */
361}; 445};
362 446
363/* 5: Address Override */ 447/* 5: Address Override */
364 448
365struct madt_address_override { 449struct acpi_madt_local_apic_override {
366 APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */ 450 struct acpi_subtable_header header;
451 u16 reserved; /* Reserved, must be zero */
367 u64 address; /* APIC physical address */ 452 u64 address; /* APIC physical address */
368}; 453};
369 454
370/* 6: I/O Sapic */ 455/* 6: I/O Sapic */
371 456
372struct madt_io_sapic { 457struct acpi_madt_io_sapic {
373 APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */ 458 struct acpi_subtable_header header;
459 u8 id; /* I/O SAPIC ID */
374 u8 reserved; /* Reserved, must be zero */ 460 u8 reserved; /* Reserved, must be zero */
375 u32 interrupt_base; /* Glocal interrupt for SAPIC start */ 461 u32 global_irq_base; /* Global interrupt for SAPIC start */
376 u64 address; /* SAPIC physical address */ 462 u64 address; /* SAPIC physical address */
377}; 463};
378 464
379/* 7: Local Sapic */ 465/* 7: Local Sapic */
380 466
381struct madt_local_sapic { 467struct acpi_madt_local_sapic {
382 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 468 struct acpi_subtable_header header;
383 u8 local_sapic_id; /* SAPIC ID */ 469 u8 processor_id; /* ACPI processor id */
384 u8 local_sapic_eid; /* SAPIC EID */ 470 u8 id; /* SAPIC ID */
471 u8 eid; /* SAPIC EID */
385 u8 reserved[3]; /* Reserved, must be zero */ 472 u8 reserved[3]; /* Reserved, must be zero */
386 ACPI_MADT_LFLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ 473 u32 lapic_flags;
387 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ 474 u32 uid; /* Numeric UID - ACPI 3.0 */
475 char uid_string[1]; /* String UID - ACPI 3.0 */
388}; 476};
389 477
390/* 8: Platform Interrupt Source */ 478/* 8: Platform Interrupt Source */
391 479
392struct madt_interrupt_source { 480struct acpi_madt_interrupt_source {
393 APIC_HEADER_DEF ACPI_MADT_IFLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ 481 struct acpi_subtable_header header;
394 u8 processor_id; /* Processor ID */ 482 u16 inti_flags;
395 u8 processor_eid; /* Processor EID */ 483 u8 type; /* 1=PMI, 2=INIT, 3=corrected */
484 u8 id; /* Processor ID */
485 u8 eid; /* Processor EID */
396 u8 io_sapic_vector; /* Vector value for PMI interrupts */ 486 u8 io_sapic_vector; /* Vector value for PMI interrupts */
397 u32 interrupt; /* Global system interrupt */ 487 u32 global_irq; /* Global system interrupt */
398 u32 flags; /* Interrupt Source Flags */ 488 u32 flags; /* Interrupt Source Flags */
399}; 489};
400 490
401#ifdef DUPLICATE_DEFINITION_WITH_LINUX_ACPI_H 491/* Flags field above */
492
493#define ACPI_MADT_CPEI_OVERRIDE (1)
494
495/*
496 * Common flags fields for MADT subtables
497 */
498
499/* MADT Local APIC flags (lapic_flags) */
500
501#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
502
503/* MADT MPS INTI flags (inti_flags) */
504
505#define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
506#define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
507
508/* Values for MPS INTI flags */
509
510#define ACPI_MADT_POLARITY_CONFORMS 0
511#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
512#define ACPI_MADT_POLARITY_RESERVED 2
513#define ACPI_MADT_POLARITY_ACTIVE_LOW 3
514
515#define ACPI_MADT_TRIGGER_CONFORMS (0)
516#define ACPI_MADT_TRIGGER_EDGE (1<<2)
517#define ACPI_MADT_TRIGGER_RESERVED (2<<2)
518#define ACPI_MADT_TRIGGER_LEVEL (3<<2)
519
402/******************************************************************************* 520/*******************************************************************************
403 * 521 *
404 * MCFG - PCI Memory Mapped Configuration table and sub-table 522 * MCFG - PCI Memory Mapped Configuration table and sub-table
@@ -406,17 +524,19 @@ struct madt_interrupt_source {
406 ******************************************************************************/ 524 ******************************************************************************/
407 525
408struct acpi_table_mcfg { 526struct acpi_table_mcfg {
409 ACPI_TABLE_HEADER_DEF u8 reserved[8]; 527 struct acpi_table_header header; /* Common ACPI table header */
528 u8 reserved[8];
410}; 529};
411 530
531/* Subtable */
532
412struct acpi_mcfg_allocation { 533struct acpi_mcfg_allocation {
413 u64 base_address; /* Base address, processor-relative */ 534 u64 address; /* Base address, processor-relative */
414 u16 pci_segment; /* PCI segment group number */ 535 u16 pci_segment; /* PCI segment group number */
415 u8 start_bus_number; /* Starting PCI Bus number */ 536 u8 start_bus_number; /* Starting PCI Bus number */
416 u8 end_bus_number; /* Final PCI Bus number */ 537 u8 end_bus_number; /* Final PCI Bus number */
417 u32 reserved; 538 u32 reserved;
418}; 539};
419#endif
420 540
421/******************************************************************************* 541/*******************************************************************************
422 * 542 *
@@ -424,8 +544,9 @@ struct acpi_mcfg_allocation {
424 * 544 *
425 ******************************************************************************/ 545 ******************************************************************************/
426 546
427struct smart_battery_table { 547struct acpi_table_sbst {
428 ACPI_TABLE_HEADER_DEF u32 warning_level; 548 struct acpi_table_header header; /* Common ACPI table header */
549 u32 warning_level;
429 u32 low_level; 550 u32 low_level;
430 u32 critical_level; 551 u32 critical_level;
431}; 552};
@@ -436,9 +557,10 @@ struct smart_battery_table {
436 * 557 *
437 ******************************************************************************/ 558 ******************************************************************************/
438 559
439struct system_locality_info { 560struct acpi_table_slit {
440 ACPI_TABLE_HEADER_DEF u64 locality_count; 561 struct acpi_table_header header; /* Common ACPI table header */
441 u8 entry[1][1]; 562 u64 locality_count;
563 u8 entry[1]; /* Real size = localities^2 */
442}; 564};
443 565
444/******************************************************************************* 566/*******************************************************************************
@@ -448,7 +570,8 @@ struct system_locality_info {
448 ******************************************************************************/ 570 ******************************************************************************/
449 571
450struct acpi_table_spcr { 572struct acpi_table_spcr {
451 ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */ 573 struct acpi_table_header header; /* Common ACPI table header */
574 u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
452 u8 reserved[3]; 575 u8 reserved[3];
453 struct acpi_generic_address serial_port; 576 struct acpi_generic_address serial_port;
454 u8 interrupt_type; 577 u8 interrupt_type;
@@ -459,7 +582,7 @@ struct acpi_table_spcr {
459 u8 stop_bits; 582 u8 stop_bits;
460 u8 flow_control; 583 u8 flow_control;
461 u8 terminal_type; 584 u8 terminal_type;
462 u8 reserved2; 585 u8 reserved1;
463 u16 pci_device_id; 586 u16 pci_device_id;
464 u16 pci_vendor_id; 587 u16 pci_vendor_id;
465 u8 pci_bus; 588 u8 pci_bus;
@@ -467,7 +590,7 @@ struct acpi_table_spcr {
467 u8 pci_function; 590 u8 pci_function;
468 u32 pci_flags; 591 u32 pci_flags;
469 u8 pci_segment; 592 u8 pci_segment;
470 u32 reserved3; 593 u32 reserved2;
471}; 594};
472 595
473/******************************************************************************* 596/*******************************************************************************
@@ -477,12 +600,13 @@ struct acpi_table_spcr {
477 ******************************************************************************/ 600 ******************************************************************************/
478 601
479struct acpi_table_spmi { 602struct acpi_table_spmi {
480 ACPI_TABLE_HEADER_DEF u8 reserved; 603 struct acpi_table_header header; /* Common ACPI table header */
604 u8 reserved;
481 u8 interface_type; 605 u8 interface_type;
482 u16 spec_revision; /* Version of IPMI */ 606 u16 spec_revision; /* Version of IPMI */
483 u8 interrupt_type; 607 u8 interrupt_type;
484 u8 gpe_number; /* GPE assigned */ 608 u8 gpe_number; /* GPE assigned */
485 u8 reserved2; 609 u8 reserved1;
486 u8 pci_device_flag; 610 u8 pci_device_flag;
487 u32 interrupt; 611 u32 interrupt;
488 struct acpi_generic_address ipmi_register; 612 struct acpi_generic_address ipmi_register;
@@ -498,58 +622,53 @@ struct acpi_table_spmi {
498 * 622 *
499 ******************************************************************************/ 623 ******************************************************************************/
500 624
501struct system_resource_affinity { 625struct acpi_table_srat {
502 ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */ 626 struct acpi_table_header header; /* Common ACPI table header */
503 u64 reserved2; /* Reserved, must be zero */ 627 u32 table_revision; /* Must be value '1' */
628 u64 reserved; /* Reserved, must be zero */
504}; 629};
505 630
506/* SRAT common sub-table header */ 631/* Values for subtable type in struct acpi_subtable_header */
507 632
508#define SRAT_SUBTABLE_HEADER \ 633enum acpi_srat_type {
509 u8 type; \ 634 ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
510 u8 length; 635 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
511 636 ACPI_SRAT_TYPE_RESERVED = 2
512/* Values for Type above */ 637};
513
514#define SRAT_CPU_AFFINITY 0
515#define SRAT_MEMORY_AFFINITY 1
516#define SRAT_RESERVED 2
517 638
518/* SRAT sub-tables */ 639/* SRAT sub-tables */
519 640
520struct static_resource_alloc { 641struct acpi_srat_cpu_affinity {
521 SRAT_SUBTABLE_HEADER u8 proximity_domain_lo; 642 struct acpi_subtable_header header;
643 u8 proximity_domain_lo;
522 u8 apic_id; 644 u8 apic_id;
523 645 u32 flags;
524 /* Flags (32 bits) */
525
526 u8 enabled:1; /* 00: Use affinity structure */
527 u8:7; /* 01-07: Reserved, must be zero */
528 u8 reserved3[3]; /* 08-31: Reserved, must be zero */
529
530 u8 local_sapic_eid; 646 u8 local_sapic_eid;
531 u8 proximity_domain_hi[3]; 647 u8 proximity_domain_hi[3];
532 u32 reserved4; /* Reserved, must be zero */ 648 u32 reserved; /* Reserved, must be zero */
533}; 649};
534 650
535struct memory_affinity { 651/* Flags */
536 SRAT_SUBTABLE_HEADER u32 proximity_domain;
537 u16 reserved3;
538 u64 base_address;
539 u64 address_length;
540 u32 reserved4;
541
542 /* Flags (32 bits) */
543 652
544 u8 enabled:1; /* 00: Use affinity structure */ 653#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
545 u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */
546 u8 non_volatile:1; /* 02: Memory is non-volatile */
547 u8:5; /* 03-07: Reserved, must be zero */
548 u8 reserved5[3]; /* 08-31: Reserved, must be zero */
549 654
550 u64 reserved6; /* Reserved, must be zero */ 655struct acpi_srat_mem_affinity {
656 struct acpi_subtable_header header;
657 u32 proximity_domain;
658 u16 reserved; /* Reserved, must be zero */
659 u64 base_address;
660 u64 length;
661 u32 memory_type; /* See acpi_address_range_id */
662 u32 flags;
663 u64 reserved1; /* Reserved, must be zero */
551}; 664};
552 665
666/* Flags */
667
668#define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
669#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
670#define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
671
553/******************************************************************************* 672/*******************************************************************************
554 * 673 *
555 * TCPA - Trusted Computing Platform Alliance table 674 * TCPA - Trusted Computing Platform Alliance table
@@ -557,7 +676,8 @@ struct memory_affinity {
557 ******************************************************************************/ 676 ******************************************************************************/
558 677
559struct acpi_table_tcpa { 678struct acpi_table_tcpa {
560 ACPI_TABLE_HEADER_DEF u16 reserved; 679 struct acpi_table_header header; /* Common ACPI table header */
680 u16 reserved;
561 u32 max_log_length; /* Maximum length for the event log area */ 681 u32 max_log_length; /* Maximum length for the event log area */
562 u64 log_address; /* Address of the event log area */ 682 u64 log_address; /* Address of the event log area */
563}; 683};
@@ -569,7 +689,8 @@ struct acpi_table_tcpa {
569 ******************************************************************************/ 689 ******************************************************************************/
570 690
571struct acpi_table_wdrt { 691struct acpi_table_wdrt {
572 ACPI_TABLE_HEADER_DEF u32 header_length; /* Watchdog Header Length */ 692 struct acpi_table_header header; /* Common ACPI table header */
693 u32 header_length; /* Watchdog Header Length */
573 u8 pci_segment; /* PCI Segment number */ 694 u8 pci_segment; /* PCI Segment number */
574 u8 pci_bus; /* PCI Bus number */ 695 u8 pci_bus; /* PCI Bus number */
575 u8 pci_device; /* PCI Device number */ 696 u8 pci_device; /* PCI Device number */
@@ -582,58 +703,9 @@ struct acpi_table_wdrt {
582 u32 entries; /* Number of watchdog entries that follow */ 703 u32 entries; /* Number of watchdog entries that follow */
583}; 704};
584 705
585#if 0 /* Flags, will be converted to macros */ 706/* Flags */
586u8 enabled:1; /* 00: Timer enabled */ 707
587u8:6; /* 01-06: Reserved */ 708#define ACPI_WDRT_TIMER_ENABLED (1) /* 00: Timer enabled */
588u8 sleep_stop:1; /* 07: Timer stopped in sleep state */
589#endif
590
591/* Macros used to generate offsets to specific table fields */
592
593#define ACPI_ASF0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_info,f)
594#define ACPI_ASF1_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_alert,f)
595#define ACPI_ASF2_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_remote,f)
596#define ACPI_ASF3_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_rmcp,f)
597#define ACPI_ASF4_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_address,f)
598#define ACPI_BOOT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_boot,f)
599#define ACPI_CPEP_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_cpep,f)
600#define ACPI_CPEP0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_cpep_polling,f)
601#define ACPI_DBGP_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_dbgp,f)
602#define ACPI_ECDT_OFFSET(f) (u8) ACPI_OFFSET (struct ec_boot_resources,f)
603#define ACPI_HPET_OFFSET(f) (u8) ACPI_OFFSET (struct hpet_table,f)
604#define ACPI_MADT_OFFSET(f) (u8) ACPI_OFFSET (struct multiple_apic_table,f)
605#define ACPI_MADT0_OFFSET(f) (u8) ACPI_OFFSET (struct madt_processor_apic,f)
606#define ACPI_MADT1_OFFSET(f) (u8) ACPI_OFFSET (struct madt_io_apic,f)
607#define ACPI_MADT2_OFFSET(f) (u8) ACPI_OFFSET (struct madt_interrupt_override,f)
608#define ACPI_MADT3_OFFSET(f) (u8) ACPI_OFFSET (struct madt_nmi_source,f)
609#define ACPI_MADT4_OFFSET(f) (u8) ACPI_OFFSET (struct madt_local_apic_nmi,f)
610#define ACPI_MADT5_OFFSET(f) (u8) ACPI_OFFSET (struct madt_address_override,f)
611#define ACPI_MADT6_OFFSET(f) (u8) ACPI_OFFSET (struct madt_io_sapic,f)
612#define ACPI_MADT7_OFFSET(f) (u8) ACPI_OFFSET (struct madt_local_sapic,f)
613#define ACPI_MADT8_OFFSET(f) (u8) ACPI_OFFSET (struct madt_interrupt_source,f)
614#define ACPI_MADTH_OFFSET(f) (u8) ACPI_OFFSET (struct apic_header,f)
615#define ACPI_MCFG_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_mcfg,f)
616#define ACPI_MCFG0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_mcfg_allocation,f)
617#define ACPI_SBST_OFFSET(f) (u8) ACPI_OFFSET (struct smart_battery_table,f)
618#define ACPI_SLIT_OFFSET(f) (u8) ACPI_OFFSET (struct system_locality_info,f)
619#define ACPI_SPCR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_spcr,f)
620#define ACPI_SPMI_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_spmi,f)
621#define ACPI_SRAT_OFFSET(f) (u8) ACPI_OFFSET (struct system_resource_affinity,f)
622#define ACPI_SRAT0_OFFSET(f) (u8) ACPI_OFFSET (struct static_resource_alloc,f)
623#define ACPI_SRAT1_OFFSET(f) (u8) ACPI_OFFSET (struct memory_affinity,f)
624#define ACPI_TCPA_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_tcpa,f)
625#define ACPI_WDRT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_wdrt,f)
626
627#define ACPI_HPET_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct hpet_table,f,o)
628#define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct static_resource_alloc,f,o)
629#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct memory_affinity,f,o)
630#define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct multiple_apic_table,f,o)
631#define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_processor_apic,f,o)
632#define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_interrupt_override,f,o)
633#define ACPI_MADT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_nmi_source,f,o)
634#define ACPI_MADT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_local_apic_nmi,f,o)
635#define ACPI_MADT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_local_sapic,f,o)
636#define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_interrupt_source,f,o)
637 709
638/* Reset to default packing */ 710/* Reset to default packing */
639 711
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
deleted file mode 100644
index 67efe6cad27b..000000000000
--- a/include/acpi/actbl2.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/******************************************************************************
2 *
3 * Name: actbl2.h - ACPI Specification Revision 2.0 Tables
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#ifndef __ACTBL2_H__
45#define __ACTBL2_H__
46
47/* Code moved to both actbl.h and actbl1.h */
48
49#endif /* __ACTBL2_H__ */
diff --git a/include/acpi/actbl71.h b/include/acpi/actbl71.h
deleted file mode 100644
index 10ac05bb36bc..000000000000
--- a/include/acpi/actbl71.h
+++ /dev/null
@@ -1,134 +0,0 @@
1/******************************************************************************
2 *
3 * Name: actbl71.h - IA-64 Extensions to the ACPI Spec Rev. 0.71
4 * This file includes tables specific to this
5 * specification revision.
6 *
7 *****************************************************************************/
8
9/*
10 * Copyright (C) 2000 - 2003, R. Byron Moore
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27#ifndef __ACTBL71_H__
28#define __ACTBL71_H__
29
30/* 0.71 FADT address_space data item bitmasks defines */
31/* If the associated bit is zero then it is in memory space else in io space */
32
33#define SMI_CMD_ADDRESS_SPACE 0x01
34#define PM1_BLK_ADDRESS_SPACE 0x02
35#define PM2_CNT_BLK_ADDRESS_SPACE 0x04
36#define PM_TMR_BLK_ADDRESS_SPACE 0x08
37#define GPE0_BLK_ADDRESS_SPACE 0x10
38#define GPE1_BLK_ADDRESS_SPACE 0x20
39
40/* Only for clarity in declarations */
41
42typedef u64 IO_ADDRESS;
43
44#pragma pack(1)
45struct { /* Root System Descriptor Pointer */
46 NATIVE_CHAR signature[8]; /* contains "RSD PTR " */
47 u8 checksum; /* to make sum of struct == 0 */
48 NATIVE_CHAR oem_id[6]; /* OEM identification */
49 u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */
50 u64 rsdt_physical_address; /* 64-bit physical address of RSDT */
51};
52
53/*****************************************/
54/* IA64 Extensions to ACPI Spec Rev 0.71 */
55/* for the Root System Description Table */
56/*****************************************/
57struct {
58 struct acpi_table_header header; /* Table header */
59 u32 reserved_pad; /* IA64 alignment, must be 0 */
60 u64 table_offset_entry[1]; /* Array of pointers to other */
61 /* tables' headers */
62};
63
64/*******************************************/
65/* IA64 Extensions to ACPI Spec Rev 0.71 */
66/* for the Firmware ACPI Control Structure */
67/*******************************************/
68struct {
69 NATIVE_CHAR signature[4]; /* signature "FACS" */
70 u32 length; /* length of structure, in bytes */
71 u32 hardware_signature; /* hardware configuration signature */
72 u32 reserved4; /* must be 0 */
73 u64 firmware_waking_vector; /* ACPI OS waking vector */
74 u64 global_lock; /* Global Lock */
75 u32 S4bios_f:1; /* Indicates if S4BIOS support is present */
76 u32 reserved1:31; /* must be 0 */
77 u8 reserved3[28]; /* reserved - must be zero */
78};
79
80/******************************************/
81/* IA64 Extensions to ACPI Spec Rev 0.71 */
82/* for the Fixed ACPI Description Table */
83/******************************************/
84struct {
85 struct acpi_table_header header; /* table header */
86 u32 reserved_pad; /* IA64 alignment, must be 0 */
87 u64 firmware_ctrl; /* 64-bit Physical address of FACS */
88 u64 dsdt; /* 64-bit Physical address of DSDT */
89 u8 model; /* System Interrupt Model */
90 u8 address_space; /* Address Space Bitmask */
91 u16 sci_int; /* System vector of SCI interrupt */
92 u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */
93 u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */
94 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
95 u8 reserved2; /* reserved - must be zero */
96 u64 smi_cmd; /* Port address of SMI command port */
97 u64 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
98 u64 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
99 u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
100 u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */
101 u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */
102 u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */
103 u64 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */
104 u64 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */
105 u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */
106 u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */
107 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */
108 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */
109 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
110 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */
111 u8 gpe1_base; /* offset in gpe model where gpe1 events start */
112 u8 reserved3; /* reserved */
113 u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */
114 u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */
115 u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */
116 u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */
117 u8 century; /* index to century in RTC CMOS RAM */
118 u8 reserved4; /* reserved */
119 u32 flush_cash:1; /* PAL_FLUSH_CACHE is correctly supported */
120 u32 reserved5:1; /* reserved - must be zero */
121 u32 proc_c1:1; /* all processors support C1 state */
122 u32 plvl2_up:1; /* C2 state works on MP system */
123 u32 pwr_button:1; /* Power button is handled as a generic feature */
124 u32 sleep_button:1; /* Sleep button is handled as a generic feature, or not present */
125 u32 fixed_rTC:1; /* RTC wakeup stat not in fixed register space */
126 u32 rtcs4:1; /* RTC wakeup stat not possible from S4 */
127 u32 tmr_val_ext:1; /* tmr_val is 32 bits */
128 u32 dock_cap:1; /* Supports Docking */
129 u32 reserved6:22; /* reserved - must be zero */
130};
131
132#pragma pack()
133
134#endif /* __ACTBL71_H__ */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 64b603cfe92e..72a6e2c3a536 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,8 @@
48 48
49/* 49/*
50 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header 50 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
51 * and must be either 16, 32, or 64 51 * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of
52 * 12/2006.
52 */ 53 */
53#ifndef ACPI_MACHINE_WIDTH 54#ifndef ACPI_MACHINE_WIDTH
54#error ACPI_MACHINE_WIDTH not defined 55#error ACPI_MACHINE_WIDTH not defined
@@ -149,7 +150,6 @@ typedef int INT32;
149typedef u64 acpi_native_uint; 150typedef u64 acpi_native_uint;
150typedef s64 acpi_native_int; 151typedef s64 acpi_native_int;
151 152
152typedef u64 acpi_table_ptr;
153typedef u64 acpi_io_address; 153typedef u64 acpi_io_address;
154typedef u64 acpi_physical_address; 154typedef u64 acpi_physical_address;
155 155
@@ -189,48 +189,15 @@ typedef int INT32;
189typedef u32 acpi_native_uint; 189typedef u32 acpi_native_uint;
190typedef s32 acpi_native_int; 190typedef s32 acpi_native_int;
191 191
192typedef u64 acpi_table_ptr;
193typedef u32 acpi_io_address; 192typedef u32 acpi_io_address;
194typedef u64 acpi_physical_address; 193typedef u32 acpi_physical_address;
195 194
196#define ACPI_MAX_PTR ACPI_UINT32_MAX 195#define ACPI_MAX_PTR ACPI_UINT32_MAX
197#define ACPI_SIZE_MAX ACPI_UINT32_MAX 196#define ACPI_SIZE_MAX ACPI_UINT32_MAX
198 197
199/*******************************************************************************
200 *
201 * Types specific to 16-bit targets
202 *
203 ******************************************************************************/
204
205#elif ACPI_MACHINE_WIDTH == 16
206
207/*! [Begin] no source code translation (keep the typedefs as-is) */
208
209typedef unsigned long UINT32;
210typedef short INT16;
211typedef long INT32;
212
213/*! [End] no source code translation !*/
214
215typedef u16 acpi_native_uint;
216typedef s16 acpi_native_int;
217
218typedef u32 acpi_table_ptr;
219typedef u32 acpi_io_address;
220typedef char *acpi_physical_address;
221
222#define ACPI_MAX_PTR ACPI_UINT16_MAX
223#define ACPI_SIZE_MAX ACPI_UINT16_MAX
224
225#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
226
227/* 64-bit integers cannot be supported */
228
229#define ACPI_NO_INTEGER64_SUPPORT
230
231#else 198#else
232 199
233/* ACPI_MACHINE_WIDTH must be either 64, 32, or 16 */ 200/* ACPI_MACHINE_WIDTH must be either 64 or 32 */
234 201
235#error unknown ACPI_MACHINE_WIDTH 202#error unknown ACPI_MACHINE_WIDTH
236#endif 203#endif
@@ -311,36 +278,6 @@ typedef acpi_native_uint acpi_size;
311 * 278 *
312 ******************************************************************************/ 279 ******************************************************************************/
313 280
314/*
315 * Pointer overlays to avoid lots of typecasting for
316 * code that accepts both physical and logical pointers.
317 */
318union acpi_pointers {
319 acpi_physical_address physical;
320 void *logical;
321 acpi_table_ptr value;
322};
323
324struct acpi_pointer {
325 u32 pointer_type;
326 union acpi_pointers pointer;
327};
328
329/* pointer_types for above */
330
331#define ACPI_PHYSICAL_POINTER 0x01
332#define ACPI_LOGICAL_POINTER 0x02
333
334/* Processor mode */
335
336#define ACPI_PHYSICAL_ADDRESSING 0x04
337#define ACPI_LOGICAL_ADDRESSING 0x08
338#define ACPI_MEMORY_MODE 0x0C
339
340#define ACPI_PHYSMODE_PHYSPTR ACPI_PHYSICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
341#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
342#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER
343
344/* Logical defines and NULL */ 281/* Logical defines and NULL */
345 282
346#ifdef FALSE 283#ifdef FALSE
@@ -442,7 +379,8 @@ typedef u64 acpi_integer;
442/* 379/*
443 * Initialization state 380 * Initialization state
444 */ 381 */
445#define ACPI_INITIALIZED_OK 0x01 382#define ACPI_SUBSYSTEM_INITIALIZE 0x01
383#define ACPI_INITIALIZED_OK 0x02
446 384
447/* 385/*
448 * Power state values 386 * Power state values
@@ -491,21 +429,6 @@ typedef u64 acpi_integer;
491#define ACPI_NOTIFY_POWER_FAULT (u8) 7 429#define ACPI_NOTIFY_POWER_FAULT (u8) 7
492 430
493/* 431/*
494 * Table types. These values are passed to the table related APIs
495 */
496typedef u32 acpi_table_type;
497
498#define ACPI_TABLE_ID_RSDP (acpi_table_type) 0
499#define ACPI_TABLE_ID_DSDT (acpi_table_type) 1
500#define ACPI_TABLE_ID_FADT (acpi_table_type) 2
501#define ACPI_TABLE_ID_FACS (acpi_table_type) 3
502#define ACPI_TABLE_ID_PSDT (acpi_table_type) 4
503#define ACPI_TABLE_ID_SSDT (acpi_table_type) 5
504#define ACPI_TABLE_ID_XSDT (acpi_table_type) 6
505#define ACPI_TABLE_ID_MAX 6
506#define ACPI_NUM_TABLE_TYPES (ACPI_TABLE_ID_MAX+1)
507
508/*
509 * Types associated with ACPI names and objects. The first group of 432 * Types associated with ACPI names and objects. The first group of
510 * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition 433 * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
511 * of the ACPI object_type() operator (See the ACPI Spec). Therefore, 434 * of the ACPI object_type() operator (See the ACPI Spec). Therefore,
@@ -637,7 +560,7 @@ typedef u32 acpi_event_status;
637 * | | | +--- Type of dispatch -- to method, handler, or none 560 * | | | +--- Type of dispatch -- to method, handler, or none
638 * | | +--- Enabled for runtime? 561 * | | +--- Enabled for runtime?
639 * | +--- Enabled for wake? 562 * | +--- Enabled for wake?
640 * +--- System state when GPE ocurred (running/waking) 563 * +--- Unused
641 */ 564 */
642#define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01 565#define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01
643#define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01 566#define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01
@@ -663,10 +586,6 @@ typedef u32 acpi_event_status;
663 586
664#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */ 587#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */
665 588
666#define ACPI_GPE_SYSTEM_MASK (u8) 0x80
667#define ACPI_GPE_SYSTEM_RUNNING (u8) 0x80
668#define ACPI_GPE_SYSTEM_WAKING (u8) 0x00
669
670/* 589/*
671 * Flags for GPE and Lock interfaces 590 * Flags for GPE and Lock interfaces
672 */ 591 */
@@ -816,13 +735,6 @@ struct acpi_buffer {
816#define ACPI_SYS_MODES_MASK 0x0003 735#define ACPI_SYS_MODES_MASK 0x0003
817 736
818/* 737/*
819 * ACPI Table Info. One per ACPI table _type_
820 */
821struct acpi_table_info {
822 u32 count;
823};
824
825/*
826 * System info returned by acpi_get_system_info() 738 * System info returned by acpi_get_system_info()
827 */ 739 */
828struct acpi_system_info { 740struct acpi_system_info {
@@ -833,8 +745,6 @@ struct acpi_system_info {
833 u32 reserved2; 745 u32 reserved2;
834 u32 debug_level; 746 u32 debug_level;
835 u32 debug_layer; 747 u32 debug_layer;
836 u32 num_table_types;
837 struct acpi_table_info table_info[ACPI_TABLE_ID_MAX + 1];
838}; 748};
839 749
840/* 750/*
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index ba039ea1a057..883ffe92148f 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -141,8 +141,6 @@ acpi_status acpi_ut_hardware_initialize(void);
141 141
142void acpi_ut_subsystem_shutdown(void); 142void acpi_ut_subsystem_shutdown(void);
143 143
144acpi_status acpi_ut_validate_fadt(void);
145
146/* 144/*
147 * utclib - Local implementations of C library functions 145 * utclib - Local implementations of C library functions
148 */ 146 */
@@ -453,6 +451,8 @@ acpi_ut_short_divide(acpi_integer in_dividend,
453/* 451/*
454 * utmisc 452 * utmisc
455 */ 453 */
454const char *acpi_ut_validate_exception(acpi_status status);
455
456u8 acpi_ut_is_aml_table(struct acpi_table_header *table); 456u8 acpi_ut_is_aml_table(struct acpi_table_header *table);
457 457
458acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); 458acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id);
@@ -470,7 +470,7 @@ void acpi_ut_print_string(char *string, u8 max_length);
470 470
471u8 acpi_ut_valid_acpi_name(u32 name); 471u8 acpi_ut_valid_acpi_name(u32 name);
472 472
473acpi_name acpi_ut_repair_name(acpi_name name); 473acpi_name acpi_ut_repair_name(char *name);
474 474
475u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position); 475u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position);
476 476
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h
index cf18426a87b1..da53a4ef287a 100644
--- a/include/acpi/amlcode.h
+++ b/include/acpi/amlcode.h
@@ -7,7 +7,7 @@
7 *****************************************************************************/ 7 *****************************************************************************/
8 8
9/* 9/*
10 * Copyright (C) 2000 - 2006, R. Byron Moore 10 * Copyright (C) 2000 - 2007, R. Byron Moore
11 * All rights reserved. 11 * All rights reserved.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
@@ -273,7 +273,7 @@
273#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator */ 273#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator */
274#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ 274#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */
275#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ 275#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */
276#define ARGI_REGION_OR_FIELD 0x15 /* Used by LOAD op only */ 276#define ARGI_REGION_OR_BUFFER 0x15 /* Used by LOAD op only */
277#define ARGI_DATAREFOBJ 0x16 277#define ARGI_DATAREFOBJ 0x16
278 278
279/* Note: types above can expand to 0x1F maximum */ 279/* Note: types above can expand to 0x1F maximum */
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h
index be03818af9d1..f7d541239da4 100644
--- a/include/acpi/amlresrc.h
+++ b/include/acpi/amlresrc.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2006, R. Byron Moore 9 * Copyright (C) 2000 - 2007, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 453a469fd397..dab2ec59a3b0 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index da80933963db..3bb50494a38a 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 7f1e92930b62..5f532d2ac180 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h
index 5d15af24573b..24bdcc8b63aa 100644
--- a/include/asm-alpha/io.h
+++ b/include/asm-alpha/io.h
@@ -525,15 +525,6 @@ extern void outsw (unsigned long port, const void *src, unsigned long count);
525extern void outsl (unsigned long port, const void *src, unsigned long count); 525extern void outsl (unsigned long port, const void *src, unsigned long count);
526 526
527/* 527/*
528 * XXX - We don't have csum_partial_copy_fromio() yet, so we cheat here and
529 * just copy it. The net code will then do the checksum later. Presently
530 * only used by some shared memory 8390 Ethernet cards anyway.
531 */
532
533#define eth_io_copy_and_sum(skb,src,len,unused) \
534 memcpy_fromio((skb)->data,src,len)
535
536/*
537 * The Alpha Jensen hardware for some rather strange reason puts 528 * The Alpha Jensen hardware for some rather strange reason puts
538 * the RTC clock at 0x170 instead of 0x70. Probably due to some 529 * the RTC clock at 0x170 instead of 0x70. Probably due to some
539 * misguided idea about using 0x70 for NMI stuff. 530 * misguided idea about using 0x70 for NMI stuff.
diff --git a/include/asm-alpha/mman.h b/include/asm-alpha/mman.h
index 5f24c755f577..90d7c35d2867 100644
--- a/include/asm-alpha/mman.h
+++ b/include/asm-alpha/mman.h
@@ -49,7 +49,6 @@
49#define MADV_DOFORK 11 /* do inherit across fork */ 49#define MADV_DOFORK 11 /* do inherit across fork */
50 50
51/* compatibility flags */ 51/* compatibility flags */
52#define MAP_ANON MAP_ANONYMOUS
53#define MAP_FILE 0 52#define MAP_FILE 0
54 53
55#endif /* __ALPHA_MMAN_H__ */ 54#endif /* __ALPHA_MMAN_H__ */
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h
index 4e115f368d5f..85aa1127c903 100644
--- a/include/asm-alpha/pci.h
+++ b/include/asm-alpha/pci.h
@@ -293,4 +293,6 @@ struct pci_dev *alpha_gendev_to_pci(struct device *dev);
293#define IOBASE_ROOT_BUS 5 293#define IOBASE_ROOT_BUS 5
294#define IOBASE_FROM_HOSE 0x10000 294#define IOBASE_FROM_HOSE 0x10000
295 295
296extern struct pci_dev *isa_bridge;
297
296#endif /* __ALPHA_PCI_H */ 298#endif /* __ALPHA_PCI_H */
diff --git a/include/asm-alpha/percpu.h b/include/asm-alpha/percpu.h
index 48348fe34c19..651ebb141b24 100644
--- a/include/asm-alpha/percpu.h
+++ b/include/asm-alpha/percpu.h
@@ -1,6 +1,20 @@
1#ifndef __ALPHA_PERCPU_H 1#ifndef __ALPHA_PERCPU_H
2#define __ALPHA_PERCPU_H 2#define __ALPHA_PERCPU_H
3 3
4/*
5 * Increase the per cpu area for Alpha so that
6 * modules using percpu area can load.
7 */
8#ifdef CONFIG_MODULES
9# define PERCPU_MODULE_RESERVE 8192
10#else
11# define PERCPU_MODULE_RESERVE 0
12#endif
13
14#define PERCPU_ENOUGH_ROOM \
15 (ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES) + \
16 PERCPU_MODULE_RESERVE)
17
4#include <asm-generic/percpu.h> 18#include <asm-generic/percpu.h>
5 19
6#endif /* __ALPHA_PERCPU_H */ 20#endif /* __ALPHA_PERCPU_H */
diff --git a/include/asm-alpha/termios.h b/include/asm-alpha/termios.h
index 1cfd27f0ad73..39e492c3bfa3 100644
--- a/include/asm-alpha/termios.h
+++ b/include/asm-alpha/termios.h
@@ -66,24 +66,6 @@ struct termio {
66#define _VEOL2 6 66#define _VEOL2 6
67#define _VSWTC 7 67#define _VSWTC 7
68 68
69/* line disciplines */
70#define N_TTY 0
71#define N_SLIP 1
72#define N_MOUSE 2
73#define N_PPP 3
74#define N_STRIP 4
75#define N_AX25 5
76#define N_X25 6 /* X.25 async */
77#define N_6PACK 7
78#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
79#define N_R3964 9 /* Reserved for Simatic R3964 module */
80#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
81#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
82#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
83#define N_HDLC 13 /* synchronous HDLC */
84#define N_SYNC_PPP 14
85#define N_HCI 15 /* Bluetooth HCI UART */
86
87#ifdef __KERNEL__ 69#ifdef __KERNEL__
88/* eof=^D eol=\0 eol2=\0 erase=del 70/* eof=^D eol=\0 eol2=\0 erase=del
89 werase=^W kill=^U reprint=^R sxtc=\0 71 werase=^W kill=^U reprint=^R sxtc=\0
diff --git a/include/asm-arm/arch-at91rm9200/gpio.h b/include/asm-arm/arch-at91rm9200/gpio.h
index a011d27876a2..e09d6528fadf 100644
--- a/include/asm-arm/arch-at91rm9200/gpio.h
+++ b/include/asm-arm/arch-at91rm9200/gpio.h
@@ -179,6 +179,7 @@
179 179
180#ifndef __ASSEMBLY__ 180#ifndef __ASSEMBLY__
181/* setup setup routines, called from board init or driver probe() */ 181/* setup setup routines, called from board init or driver probe() */
182extern int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup);
182extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup); 183extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup);
183extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup); 184extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup);
184extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup); 185extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup);
@@ -193,7 +194,50 @@ extern int at91_get_gpio_value(unsigned pin);
193/* callable only from core power-management code */ 194/* callable only from core power-management code */
194extern void at91_gpio_suspend(void); 195extern void at91_gpio_suspend(void);
195extern void at91_gpio_resume(void); 196extern void at91_gpio_resume(void);
196#endif
197 197
198#endif 198/*-------------------------------------------------------------------------*/
199
200/* wrappers for "new style" GPIO calls. the old AT91-specfic ones should
201 * eventually be removed (along with this errno.h inclusion), and the
202 * gpio request/free calls should probably be implemented.
203 */
204
205#include <asm/errno.h>
206
207static inline int gpio_request(unsigned gpio, const char *label)
208{
209 return 0;
210}
211
212static inline void gpio_free(unsigned gpio)
213{
214}
215
216extern int gpio_direction_input(unsigned gpio);
217extern int gpio_direction_output(unsigned gpio);
199 218
219static inline int gpio_get_value(unsigned gpio)
220{
221 return at91_get_gpio_value(gpio);
222}
223
224static inline void gpio_set_value(unsigned gpio, int value)
225{
226 at91_set_gpio_value(gpio, value);
227}
228
229#include <asm-generic/gpio.h> /* cansleep wrappers */
230
231static inline int gpio_to_irq(unsigned gpio)
232{
233 return gpio;
234}
235
236static inline int irq_to_gpio(unsigned irq)
237{
238 return irq;
239}
240
241#endif /* __ASSEMBLY__ */
242
243#endif
diff --git a/include/asm-arm/arch-imx/spi_imx.h b/include/asm-arm/arch-imx/spi_imx.h
new file mode 100644
index 000000000000..2165449e976e
--- /dev/null
+++ b/include/asm-arm/arch-imx/spi_imx.h
@@ -0,0 +1,72 @@
1/*
2 * include/asm-arm/arch-imx/spi_imx.h
3 *
4 * Copyright (C) 2006 SWAPP
5 * Andrea Paterniani <a.paterniani@swapp-eng.it>
6 *
7 * Initial version inspired by:
8 * linux-2.6.17-rc3-mm1/include/asm-arm/arch-pxa/pxa2xx_spi.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25#ifndef SPI_IMX_H_
26#define SPI_IMX_H_
27
28
29/*-------------------------------------------------------------------------*/
30/**
31 * struct spi_imx_master - device.platform_data for SPI controller devices.
32 * @num_chipselect: chipselects are used to distinguish individual
33 * SPI slaves, and are numbered from zero to num_chipselects - 1.
34 * each slave has a chipselect signal, but it's common that not
35 * every chipselect is connected to a slave.
36 * @enable_dma: if true enables DMA driven transfers.
37*/
38struct spi_imx_master {
39 u8 num_chipselect;
40 u8 enable_dma:1;
41};
42/*-------------------------------------------------------------------------*/
43
44
45/*-------------------------------------------------------------------------*/
46/**
47 * struct spi_imx_chip - spi_board_info.controller_data for SPI
48 * slave devices, copied to spi_device.controller_data.
49 * @enable_loopback : used for test purpouse to internally connect RX and TX
50 * sections.
51 * @enable_dma : enables dma transfer (provided that controller driver has
52 * dma enabled too).
53 * @ins_ss_pulse : enable /SS pulse insertion between SPI burst.
54 * @bclk_wait : number of bclk waits between each bits_per_word SPI burst.
55 * @cs_control : function pointer to board-specific function to assert/deassert
56 * I/O port to control HW generation of devices chip-select.
57*/
58struct spi_imx_chip {
59 u8 enable_loopback:1;
60 u8 enable_dma:1;
61 u8 ins_ss_pulse:1;
62 u16 bclk_wait:15;
63 void (*cs_control)(u32 control);
64};
65
66/* Chip-select state */
67#define SPI_CS_ASSERT (1 << 0)
68#define SPI_CS_DEASSERT (1 << 1)
69/*-------------------------------------------------------------------------*/
70
71
72#endif /* SPI_IMX_H_*/
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h
index 0d517267fb63..b7b5414d9320 100644
--- a/include/asm-arm/arch-ixp4xx/io.h
+++ b/include/asm-arm/arch-ixp4xx/io.h
@@ -238,9 +238,6 @@ __ixp4xx_readsl(const volatile void __iomem *bus_addr, u32 *vaddr, u32 count)
238#define memcpy_fromio(a,c,l) _memcpy_fromio((a),(c),(l)) 238#define memcpy_fromio(a,c,l) _memcpy_fromio((a),(c),(l))
239#define memcpy_toio(c,a,l) _memcpy_toio((c),(a),(l)) 239#define memcpy_toio(c,a,l) _memcpy_toio((c),(a),(l))
240 240
241#define eth_io_copy_and_sum(s,c,l,b) \
242 eth_copy_and_sum((s),__mem_pci(c),(l),(b))
243
244static inline int 241static inline int
245check_signature(const unsigned char __iomem *bus_addr, const unsigned char *signature, 242check_signature(const unsigned char __iomem *bus_addr, const unsigned char *signature,
246 int length) 243 int length)
diff --git a/include/asm-arm/arch-omap/gpio.h b/include/asm-arm/arch-omap/gpio.h
index f486b72070ea..3762a6ae6a7f 100644
--- a/include/asm-arm/arch-omap/gpio.h
+++ b/include/asm-arm/arch-omap/gpio.h
@@ -76,4 +76,70 @@ extern void omap_set_gpio_direction(int gpio, int is_input);
76extern void omap_set_gpio_dataout(int gpio, int enable); 76extern void omap_set_gpio_dataout(int gpio, int enable);
77extern int omap_get_gpio_datain(int gpio); 77extern int omap_get_gpio_datain(int gpio);
78 78
79/*-------------------------------------------------------------------------*/
80
81/* wrappers for "new style" GPIO calls. the old OMAP-specfic ones should
82 * eventually be removed (along with this errno.h inclusion), and maybe
83 * gpios should put MPUIOs last too.
84 */
85
86#include <asm/errno.h>
87
88static inline int gpio_request(unsigned gpio, const char *label)
89{
90 return omap_request_gpio(gpio);
91}
92
93static inline void gpio_free(unsigned gpio)
94{
95 omap_free_gpio(gpio);
96}
97
98static inline int __gpio_set_direction(unsigned gpio, int is_input)
99{
100 if (cpu_class_is_omap2()) {
101 if (gpio > OMAP_MAX_GPIO_LINES)
102 return -EINVAL;
103 } else {
104 if (gpio > (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */))
105 return -EINVAL;
106 }
107 omap_set_gpio_direction(gpio, is_input);
108 return 0;
109}
110
111static inline int gpio_direction_input(unsigned gpio)
112{
113 return __gpio_set_direction(gpio, 1);
114}
115
116static inline int gpio_direction_output(unsigned gpio)
117{
118 return __gpio_set_direction(gpio, 0);
119}
120
121static inline int gpio_get_value(unsigned gpio)
122{
123 return omap_get_gpio_datain(gpio);
124}
125
126static inline void gpio_set_value(unsigned gpio, int value)
127{
128 omap_set_gpio_dataout(gpio, value);
129}
130
131#include <asm-generic/gpio.h> /* cansleep wrappers */
132
133static inline int gpio_to_irq(unsigned gpio)
134{
135 return OMAP_GPIO_IRQ(gpio);
136}
137
138static inline int irq_to_gpio(unsigned irq)
139{
140 if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16)))
141 return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES;
142 return irq - IH_GPIO_BASE;
143}
144
79#endif 145#endif
diff --git a/include/asm-arm/arch-pxa/gpio.h b/include/asm-arm/arch-pxa/gpio.h
new file mode 100644
index 000000000000..e67c23821017
--- /dev/null
+++ b/include/asm-arm/arch-pxa/gpio.h
@@ -0,0 +1,72 @@
1/*
2 * linux/include/asm-arm/arch-pxa/gpio.h
3 *
4 * PXA GPIO wrappers for arch-neutral GPIO calls
5 *
6 * Written by Philipp Zabel <philipp.zabel@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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __ASM_ARCH_PXA_GPIO_H
25#define __ASM_ARCH_PXA_GPIO_H
26
27#include <asm/arch/pxa-regs.h>
28#include <asm/arch/irqs.h>
29#include <asm/arch/hardware.h>
30
31#include <asm/errno.h>
32
33static inline int gpio_request(unsigned gpio, const char *label)
34{
35 return 0;
36}
37
38static inline void gpio_free(unsigned gpio)
39{
40 return;
41}
42
43static inline int gpio_direction_input(unsigned gpio)
44{
45 if (gpio > PXA_LAST_GPIO)
46 return -EINVAL;
47 pxa_gpio_mode(gpio | GPIO_IN);
48}
49
50static inline int gpio_direction_output(unsigned gpio)
51{
52 if (gpio > PXA_LAST_GPIO)
53 return -EINVAL;
54 pxa_gpio_mode(gpio | GPIO_OUT);
55}
56
57/* REVISIT these macros are correct, but suffer code explosion
58 * for non-constant parameters. Provide out-line versions too.
59 */
60#define gpio_get_value(gpio) \
61 (GPLR(gpio) & GPIO_bit(gpio))
62
63#define gpio_set_value(gpio,value) \
64 ((value) ? (GPSR(gpio) = GPIO_bit(gpio)):(GPCR(gpio) = GPIO_bit(gpio)))
65
66#include <asm-generic/gpio.h> /* cansleep wrappers */
67
68#define gpio_to_irq(gpio) IRQ_GPIO(gpio)
69#define irq_to_gpio(irq) IRQ_TO_GPIO(irq)
70
71
72#endif
diff --git a/include/asm-arm/arch-s3c2410/gpio.h b/include/asm-arm/arch-s3c2410/gpio.h
new file mode 100644
index 000000000000..67b8b9ab22e9
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/gpio.h
@@ -0,0 +1,65 @@
1/*
2 * linux/include/asm-arm/arch-pxa/gpio.h
3 *
4 * S3C2400 GPIO wrappers for arch-neutral GPIO calls
5 *
6 * Written by Philipp Zabel <philipp.zabel@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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __ASM_ARCH_PXA_GPIO_H
25#define __ASM_ARCH_PXA_GPIO_H
26
27#include <asm/arch/pxa-regs.h>
28#include <asm/arch/irqs.h>
29#include <asm/arch/hardware.h>
30
31#include <asm/errno.h>
32
33static inline int gpio_request(unsigned gpio, const char *label)
34{
35 return 0;
36}
37
38static inline void gpio_free(unsigned gpio)
39{
40 return;
41}
42
43static inline int gpio_direction_input(unsigned gpio)
44{
45 s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_INPUT);
46 return 0;
47}
48
49static inline int gpio_direction_output(unsigned gpio)
50{
51 s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_OUTPUT);
52 return 0;
53}
54
55#define gpio_get_value(gpio) s3c2410_gpio_getpin(gpio)
56#define gpio_set_value(gpio,value) s3c2410_gpio_setpin(gpio, value)
57
58#include <asm-generic/gpio.h> /* cansleep wrappers */
59
60/* FIXME or maybe s3c2400_gpio_getirq() ... */
61#define gpio_to_irq(gpio) s3c2410_gpio_getirq(gpio)
62
63/* FIXME implement irq_to_gpio() */
64
65#endif
diff --git a/include/asm-arm/arch-sa1100/gpio.h b/include/asm-arm/arch-sa1100/gpio.h
new file mode 100644
index 000000000000..a331fe3f6e48
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/gpio.h
@@ -0,0 +1,81 @@
1/*
2 * linux/include/asm-arm/arch-pxa/gpio.h
3 *
4 * SA1100 GPIO wrappers for arch-neutral GPIO calls
5 *
6 * Written by Philipp Zabel <philipp.zabel@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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __ASM_ARCH_SA1100_GPIO_H
25#define __ASM_ARCH_SA1100_GPIO_H
26
27#include <asm/arch/SA-1100.h>
28#include <asm/arch/irqs.h>
29#include <asm/arch/hardware.h>
30
31#include <asm/errno.h>
32
33static inline int gpio_request(unsigned gpio, const char *label)
34{
35 return 0;
36}
37
38static inline void gpio_free(unsigned gpio)
39{
40 return;
41}
42
43static inline int gpio_direction_input(unsigned gpio)
44{
45 if (gpio > GPIO_MAX)
46 return -EINVAL;
47 GPDR = (GPDR_In << gpio) 0
48}
49
50static inline int gpio_direction_output(unsigned gpio)
51{
52 if (gpio > GPIO_MAX)
53 return -EINVAL;
54 GPDR = (GPDR_Out << gpio) 0
55}
56
57#define gpio_get_value(gpio) \
58 (GPLR & GPIO_GPIO(gpio))
59
60#define gpio_set_value(gpio,value) \
61 ((value) ? (GPSR = GPIO_GPIO(gpio)) : (GPCR(gpio) = GPIO_GPIO(gpio)))
62
63#include <asm-generic/gpio.h> /* cansleep wrappers */
64
65static inline unsigned gpio_to_irq(unsigned gpio)
66{
67 if (gpio < 11)
68 return IRQ_GPIO0 + gpio;
69 else
70 return IRQ_GPIO11 - 11 + gpio;
71}
72
73static inline unsigned irq_to_gpio(unsigned irq)
74{
75 if (irq < IRQ_GPIO11_27)
76 return irq - IRQ_GPIO0;
77 else
78 return irq - IRQ_GPIO11 + 11;
79}
80
81#endif
diff --git a/include/asm-arm/gpio.h b/include/asm-arm/gpio.h
new file mode 100644
index 000000000000..fff4f800ee42
--- /dev/null
+++ b/include/asm-arm/gpio.h
@@ -0,0 +1,7 @@
1#ifndef _ARCH_ARM_GPIO_H
2#define _ARCH_ARM_GPIO_H
3
4/* not all ARM platforms necessarily support this API ... */
5#include <asm/arch/gpio.h>
6
7#endif /* _ARCH_ARM_GPIO_H */
diff --git a/include/asm-arm/hardware/gpio_keys.h b/include/asm-arm/hardware/gpio_keys.h
new file mode 100644
index 000000000000..2b217c7b9312
--- /dev/null
+++ b/include/asm-arm/hardware/gpio_keys.h
@@ -0,0 +1,17 @@
1#ifndef _GPIO_KEYS_H
2#define _GPIO_KEYS_H
3
4struct gpio_keys_button {
5 /* Configuration parameters */
6 int keycode;
7 int gpio;
8 int active_low;
9 char *desc;
10};
11
12struct gpio_keys_platform_data {
13 struct gpio_keys_button *buttons;
14 int nbuttons;
15};
16
17#endif
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index 288f76b166d0..5f60b4220906 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -182,9 +182,6 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
182#define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l)) 182#define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l))
183#define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l)) 183#define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l))
184 184
185#define eth_io_copy_and_sum(s,c,l,b) \
186 eth_copy_and_sum((s),__mem_pci(c),(l),(b))
187
188#elif !defined(readb) 185#elif !defined(readb)
189 186
190#define readb(c) (__readwrite_bug("readb"),0) 187#define readb(c) (__readwrite_bug("readb"),0)
@@ -194,8 +191,6 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
194#define writew(v,c) __readwrite_bug("writew") 191#define writew(v,c) __readwrite_bug("writew")
195#define writel(v,c) __readwrite_bug("writel") 192#define writel(v,c) __readwrite_bug("writel")
196 193
197#define eth_io_copy_and_sum(s,c,l,b) __readwrite_bug("eth_io_copy_and_sum")
198
199#define check_signature(io,sig,len) (0) 194#define check_signature(io,sig,len) (0)
200 195
201#endif /* __mem_pci */ 196#endif /* __mem_pci */
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h
index 861092fbaa53..800ba5254daf 100644
--- a/include/asm-arm/spinlock.h
+++ b/include/asm-arm/spinlock.h
@@ -85,7 +85,6 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock)
85 * Write locks are easy - we just set bit 31. When unlocking, we can 85 * Write locks are easy - we just set bit 31. When unlocking, we can
86 * just write zero since the lock is exclusively held. 86 * just write zero since the lock is exclusively held.
87 */ 87 */
88#define rwlock_is_locked(x) (*((volatile unsigned int *)(x)) != 0)
89 88
90static inline void __raw_write_lock(raw_rwlock_t *rw) 89static inline void __raw_write_lock(raw_rwlock_t *rw)
91{ 90{
diff --git a/include/asm-arm/termios.h b/include/asm-arm/termios.h
index 7b8f5e8ae063..329c324c4040 100644
--- a/include/asm-arm/termios.h
+++ b/include/asm-arm/termios.h
@@ -49,24 +49,6 @@ struct termio {
49 49
50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
51 51
52/* line disciplines */
53#define N_TTY 0
54#define N_SLIP 1
55#define N_MOUSE 2
56#define N_PPP 3
57#define N_STRIP 4
58#define N_AX25 5
59#define N_X25 6 /* X.25 async */
60#define N_6PACK 7
61#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
62#define N_R3964 9 /* Reserved for Simatic R3964 module */
63#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
64#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
65#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
66#define N_HDLC 13 /* synchronous HDLC */
67#define N_SYNC_PPP 14
68#define N_HCI 15 /* Bluetooth HCI UART */
69
70#ifdef __KERNEL__ 52#ifdef __KERNEL__
71 53
72/* 54/*
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h
index 5f420a0149f1..c92df958802e 100644
--- a/include/asm-arm/uaccess.h
+++ b/include/asm-arm/uaccess.h
@@ -76,10 +76,10 @@ static inline void set_fs(mm_segment_t fs)
76 76
77/* We use 33-bit arithmetic here... */ 77/* We use 33-bit arithmetic here... */
78#define __range_ok(addr,size) ({ \ 78#define __range_ok(addr,size) ({ \
79 unsigned long flag, sum; \ 79 unsigned long flag, roksum; \
80 __chk_user_ptr(addr); \ 80 __chk_user_ptr(addr); \
81 __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \ 81 __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \
82 : "=&r" (flag), "=&r" (sum) \ 82 : "=&r" (flag), "=&r" (roksum) \
83 : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \ 83 : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \
84 : "cc"); \ 84 : "cc"); \
85 flag; }) 85 flag; })
diff --git a/include/asm-arm26/termios.h b/include/asm-arm26/termios.h
index 7b8f5e8ae063..329c324c4040 100644
--- a/include/asm-arm26/termios.h
+++ b/include/asm-arm26/termios.h
@@ -49,24 +49,6 @@ struct termio {
49 49
50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
51 51
52/* line disciplines */
53#define N_TTY 0
54#define N_SLIP 1
55#define N_MOUSE 2
56#define N_PPP 3
57#define N_STRIP 4
58#define N_AX25 5
59#define N_X25 6 /* X.25 async */
60#define N_6PACK 7
61#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
62#define N_R3964 9 /* Reserved for Simatic R3964 module */
63#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
64#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
65#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
66#define N_HDLC 13 /* synchronous HDLC */
67#define N_SYNC_PPP 14
68#define N_HCI 15 /* Bluetooth HCI UART */
69
70#ifdef __KERNEL__ 52#ifdef __KERNEL__
71 53
72/* 54/*
diff --git a/include/asm-arm26/uaccess-asm.h b/include/asm-arm26/uaccess-asm.h
index 19f798e338c9..ade76ec02995 100644
--- a/include/asm-arm26/uaccess-asm.h
+++ b/include/asm-arm26/uaccess-asm.h
@@ -34,9 +34,9 @@ static inline void set_fs (mm_segment_t fs)
34} 34}
35 35
36#define __range_ok(addr,size) ({ \ 36#define __range_ok(addr,size) ({ \
37 unsigned long flag, sum; \ 37 unsigned long flag, roksum; \
38 __asm__ __volatile__("subs %1, %0, %3; cmpcs %1, %2; movcs %0, #0" \ 38 __asm__ __volatile__("subs %1, %0, %3; cmpcs %1, %2; movcs %0, #0" \
39 : "=&r" (flag), "=&r" (sum) \ 39 : "=&r" (flag), "=&r" (roksum) \
40 : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \ 40 : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \
41 : "cc"); \ 41 : "cc"); \
42 flag; }) 42 flag; })
diff --git a/include/asm-avr32/arch-at32ap/at32ap7000.h b/include/asm-avr32/arch-at32ap/at32ap7000.h
index ba85e04553d4..3914d7b94ff4 100644
--- a/include/asm-avr32/arch-at32ap/at32ap7000.h
+++ b/include/asm-avr32/arch-at32ap/at32ap7000.h
@@ -24,10 +24,12 @@
24#define GPIO_PIOB_BASE (GPIO_PIOA_BASE + 32) 24#define GPIO_PIOB_BASE (GPIO_PIOA_BASE + 32)
25#define GPIO_PIOC_BASE (GPIO_PIOB_BASE + 32) 25#define GPIO_PIOC_BASE (GPIO_PIOB_BASE + 32)
26#define GPIO_PIOD_BASE (GPIO_PIOC_BASE + 32) 26#define GPIO_PIOD_BASE (GPIO_PIOC_BASE + 32)
27#define GPIO_PIOE_BASE (GPIO_PIOD_BASE + 32)
27 28
28#define GPIO_PIN_PA(N) (GPIO_PIOA_BASE + (N)) 29#define GPIO_PIN_PA(N) (GPIO_PIOA_BASE + (N))
29#define GPIO_PIN_PB(N) (GPIO_PIOB_BASE + (N)) 30#define GPIO_PIN_PB(N) (GPIO_PIOB_BASE + (N))
30#define GPIO_PIN_PC(N) (GPIO_PIOC_BASE + (N)) 31#define GPIO_PIN_PC(N) (GPIO_PIOC_BASE + (N))
31#define GPIO_PIN_PD(N) (GPIO_PIOD_BASE + (N)) 32#define GPIO_PIN_PD(N) (GPIO_PIOD_BASE + (N))
33#define GPIO_PIN_PE(N) (GPIO_PIOE_BASE + (N))
32 34
33#endif /* __ASM_ARCH_AT32AP7000_H__ */ 35#endif /* __ASM_ARCH_AT32AP7000_H__ */
diff --git a/include/asm-avr32/arch-at32ap/gpio.h b/include/asm-avr32/arch-at32ap/gpio.h
new file mode 100644
index 000000000000..fcb756bdaa8e
--- /dev/null
+++ b/include/asm-avr32/arch-at32ap/gpio.h
@@ -0,0 +1,27 @@
1#ifndef __ASM_AVR32_ARCH_GPIO_H
2#define __ASM_AVR32_ARCH_GPIO_H
3
4#include <linux/compiler.h>
5#include <asm/irq.h>
6
7
8/* Arch-neutral GPIO API */
9int __must_check gpio_request(unsigned int gpio, const char *label);
10void gpio_free(unsigned int gpio);
11
12int gpio_direction_input(unsigned int gpio);
13int gpio_direction_output(unsigned int gpio);
14int gpio_get_value(unsigned int gpio);
15void gpio_set_value(unsigned int gpio, int value);
16
17static inline int gpio_to_irq(unsigned int gpio)
18{
19 return gpio + GPIO_IRQ_BASE;
20}
21
22static inline int irq_to_gpio(unsigned int irq)
23{
24 return irq - GPIO_IRQ_BASE;
25}
26
27#endif /* __ASM_AVR32_ARCH_GPIO_H */
diff --git a/include/asm-avr32/arch-at32ap/irq.h b/include/asm-avr32/arch-at32ap/irq.h
new file mode 100644
index 000000000000..5adffab9a577
--- /dev/null
+++ b/include/asm-avr32/arch-at32ap/irq.h
@@ -0,0 +1,14 @@
1#ifndef __ASM_AVR32_ARCH_IRQ_H
2#define __ASM_AVR32_ARCH_IRQ_H
3
4#define EIM_IRQ_BASE NR_INTERNAL_IRQS
5#define NR_EIM_IRQS 32
6
7#define AT32_EXTINT(n) (EIM_IRQ_BASE + (n))
8
9#define GPIO_IRQ_BASE (EIM_IRQ_BASE + NR_EIM_IRQS)
10#define NR_GPIO_IRQS (5 * 32)
11
12#define NR_IRQS (GPIO_IRQ_BASE + NR_GPIO_IRQS)
13
14#endif /* __ASM_AVR32_ARCH_IRQ_H */
diff --git a/include/asm-avr32/arch-at32ap/portmux.h b/include/asm-avr32/arch-at32ap/portmux.h
index 83c690571322..9930871decde 100644
--- a/include/asm-avr32/arch-at32ap/portmux.h
+++ b/include/asm-avr32/arch-at32ap/portmux.h
@@ -15,12 +15,14 @@
15 * 15 *
16 * The following flags determine the initial state of the pin. 16 * The following flags determine the initial state of the pin.
17 */ 17 */
18#define AT32_GPIOF_PULLUP 0x00000001 /* Enable pull-up */ 18#define AT32_GPIOF_PULLUP 0x00000001 /* (not-OUT) Enable pull-up */
19#define AT32_GPIOF_OUTPUT 0x00000002 /* Enable output driver */ 19#define AT32_GPIOF_OUTPUT 0x00000002 /* (OUT) Enable output driver */
20#define AT32_GPIOF_HIGH 0x00000004 /* Set output high */ 20#define AT32_GPIOF_HIGH 0x00000004 /* (OUT) Set output high */
21#define AT32_GPIOF_DEGLITCH 0x00000008 /* (IN) Filter glitches */
21 22
22void at32_select_periph(unsigned int pin, unsigned int periph, 23void at32_select_periph(unsigned int pin, unsigned int periph,
23 unsigned long flags); 24 unsigned long flags);
24void at32_select_gpio(unsigned int pin, unsigned long flags); 25void at32_select_gpio(unsigned int pin, unsigned long flags);
26void at32_reserve_pin(unsigned int pin);
25 27
26#endif /* __ASM_ARCH_PORTMUX_H__ */ 28#endif /* __ASM_ARCH_PORTMUX_H__ */
diff --git a/include/asm-avr32/checksum.h b/include/asm-avr32/checksum.h
index af9d53f0f5d2..4ddbfd2486af 100644
--- a/include/asm-avr32/checksum.h
+++ b/include/asm-avr32/checksum.h
@@ -38,7 +38,7 @@ __wsum csum_partial_copy_generic(const void *src, void *dst, int len,
38 * passed in an incorrect kernel address to one of these functions. 38 * passed in an incorrect kernel address to one of these functions.
39 * 39 *
40 * If you use these functions directly please don't forget the 40 * If you use these functions directly please don't forget the
41 * verify_area(). 41 * access_ok().
42 */ 42 */
43static inline 43static inline
44__wsum csum_partial_copy_nocheck(const void *src, void *dst, 44__wsum csum_partial_copy_nocheck(const void *src, void *dst,
diff --git a/include/asm-avr32/dma-mapping.h b/include/asm-avr32/dma-mapping.h
index 5c01e27f0b41..115813e48fe0 100644
--- a/include/asm-avr32/dma-mapping.h
+++ b/include/asm-avr32/dma-mapping.h
@@ -32,6 +32,14 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
32 return 0; 32 return 0;
33} 33}
34 34
35/*
36 * dma_map_single can't fail as it is implemented now.
37 */
38static inline int dma_mapping_error(dma_addr_t addr)
39{
40 return 0;
41}
42
35/** 43/**
36 * dma_alloc_coherent - allocate consistent memory for DMA 44 * dma_alloc_coherent - allocate consistent memory for DMA
37 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices 45 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
diff --git a/include/asm-avr32/gpio.h b/include/asm-avr32/gpio.h
new file mode 100644
index 000000000000..19e8ccc77db3
--- /dev/null
+++ b/include/asm-avr32/gpio.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_AVR32_GPIO_H
2#define __ASM_AVR32_GPIO_H
3
4#include <asm/arch/gpio.h>
5
6#endif /* __ASM_AVR32_GPIO_H */
diff --git a/include/asm-avr32/irq.h b/include/asm-avr32/irq.h
index f7e725707dd7..83e6549d7783 100644
--- a/include/asm-avr32/irq.h
+++ b/include/asm-avr32/irq.h
@@ -2,8 +2,12 @@
2#define __ASM_AVR32_IRQ_H 2#define __ASM_AVR32_IRQ_H
3 3
4#define NR_INTERNAL_IRQS 64 4#define NR_INTERNAL_IRQS 64
5#define NR_EXTERNAL_IRQS 64 5
6#define NR_IRQS (NR_INTERNAL_IRQS + NR_EXTERNAL_IRQS) 6#include <asm/arch/irq.h>
7
8#ifndef NR_IRQS
9#define NR_IRQS (NR_INTERNAL_IRQS)
10#endif
7 11
8#define irq_canonicalize(i) (i) 12#define irq_canonicalize(i) (i)
9 13
diff --git a/include/asm-avr32/posix_types.h b/include/asm-avr32/posix_types.h
index 2831b039b349..9e255b999639 100644
--- a/include/asm-avr32/posix_types.h
+++ b/include/asm-avr32/posix_types.h
@@ -23,7 +23,7 @@ typedef unsigned short __kernel_ipc_pid_t;
23typedef unsigned int __kernel_uid_t; 23typedef unsigned int __kernel_uid_t;
24typedef unsigned int __kernel_gid_t; 24typedef unsigned int __kernel_gid_t;
25typedef unsigned long __kernel_size_t; 25typedef unsigned long __kernel_size_t;
26typedef int __kernel_ssize_t; 26typedef long __kernel_ssize_t;
27typedef int __kernel_ptrdiff_t; 27typedef int __kernel_ptrdiff_t;
28typedef long __kernel_time_t; 28typedef long __kernel_time_t;
29typedef long __kernel_suseconds_t; 29typedef long __kernel_suseconds_t;
diff --git a/include/asm-avr32/termios.h b/include/asm-avr32/termios.h
index 615bc0639e5c..0152aba35154 100644
--- a/include/asm-avr32/termios.h
+++ b/include/asm-avr32/termios.h
@@ -46,24 +46,6 @@ struct termio {
46 46
47/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 47/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
48 48
49/* line disciplines */
50#define N_TTY 0
51#define N_SLIP 1
52#define N_MOUSE 2
53#define N_PPP 3
54#define N_STRIP 4
55#define N_AX25 5
56#define N_X25 6 /* X.25 async */
57#define N_6PACK 7
58#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
59#define N_R3964 9 /* Reserved for Simatic R3964 module */
60#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
61#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
62#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
63#define N_HDLC 13 /* synchronous HDLC */
64#define N_SYNC_PPP 14 /* synchronous PPP */
65#define N_HCI 15 /* Bluetooth HCI UART */
66
67#ifdef __KERNEL__ 49#ifdef __KERNEL__
68/* intr=^C quit=^\ erase=del kill=^U 50/* intr=^C quit=^\ erase=del kill=^U
69 eof=^D vtime=\0 vmin=\1 sxtc=\0 51 eof=^D vtime=\0 vmin=\1 sxtc=\0
diff --git a/include/asm-avr32/uaccess.h b/include/asm-avr32/uaccess.h
index 821deb5a9d28..74a679e9098c 100644
--- a/include/asm-avr32/uaccess.h
+++ b/include/asm-avr32/uaccess.h
@@ -68,12 +68,6 @@ static inline void set_fs(mm_segment_t s)
68 68
69#define access_ok(type, addr, size) (likely(__range_ok(addr, size) == 0)) 69#define access_ok(type, addr, size) (likely(__range_ok(addr, size) == 0))
70 70
71static inline int
72verify_area(int type, const void __user *addr, unsigned long size)
73{
74 return access_ok(type, addr, size) ? 0 : -EFAULT;
75}
76
77/* Generic arbitrary sized copy. Return the number of bytes NOT copied */ 71/* Generic arbitrary sized copy. Return the number of bytes NOT copied */
78extern __kernel_size_t __copy_user(void *to, const void *from, 72extern __kernel_size_t __copy_user(void *to, const void *from,
79 __kernel_size_t n); 73 __kernel_size_t n);
diff --git a/include/asm-cris/io.h b/include/asm-cris/io.h
index 716c69bc58f8..d196dd6b2df3 100644
--- a/include/asm-cris/io.h
+++ b/include/asm-cris/io.h
@@ -121,11 +121,6 @@ static inline void writel(unsigned int b, volatile void __iomem *addr)
121#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) 121#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
122#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) 122#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
123 123
124/*
125 * Again, CRIS does not require mem IO specific function.
126 */
127
128#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void __force *)(b),(c),(d))
129 124
130/* The following is junk needed for the arch-independent code but which 125/* The following is junk needed for the arch-independent code but which
131 * we never use in the CRIS port 126 * we never use in the CRIS port
diff --git a/include/asm-cris/semaphore-helper.h b/include/asm-cris/semaphore-helper.h
index a8e1e6cb7cd0..27bfeca1b981 100644
--- a/include/asm-cris/semaphore-helper.h
+++ b/include/asm-cris/semaphore-helper.h
@@ -30,8 +30,7 @@ static inline int waking_non_zero(struct semaphore *sem)
30 unsigned long flags; 30 unsigned long flags;
31 int ret = 0; 31 int ret = 0;
32 32
33 local_save_flags(flags); 33 local_irq_save(flags);
34 local_irq_disable();
35 if (read(&sem->waking) > 0) { 34 if (read(&sem->waking) > 0) {
36 dec(&sem->waking); 35 dec(&sem->waking);
37 ret = 1; 36 ret = 1;
@@ -46,8 +45,7 @@ static inline int waking_non_zero_interruptible(struct semaphore *sem,
46 int ret = 0; 45 int ret = 0;
47 unsigned long flags; 46 unsigned long flags;
48 47
49 local_save_flags(flags); 48 local_irq_save(flags);
50 local_irq_disable();
51 if (read(&sem->waking) > 0) { 49 if (read(&sem->waking) > 0) {
52 dec(&sem->waking); 50 dec(&sem->waking);
53 ret = 1; 51 ret = 1;
@@ -64,8 +62,7 @@ static inline int waking_non_zero_trylock(struct semaphore *sem)
64 int ret = 1; 62 int ret = 1;
65 unsigned long flags; 63 unsigned long flags;
66 64
67 local_save_flags(flags); 65 local_irq_save(flags);
68 local_irq_disable();
69 if (read(&sem->waking) <= 0) 66 if (read(&sem->waking) <= 0)
70 inc(&sem->count); 67 inc(&sem->count);
71 else { 68 else {
diff --git a/include/asm-cris/system.h b/include/asm-cris/system.h
index b869f6161aaa..fea0e8d57cb5 100644
--- a/include/asm-cris/system.h
+++ b/include/asm-cris/system.h
@@ -44,8 +44,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
44 /* since Etrax doesn't have any atomic xchg instructions, we need to disable 44 /* since Etrax doesn't have any atomic xchg instructions, we need to disable
45 irq's (if enabled) and do it with move.d's */ 45 irq's (if enabled) and do it with move.d's */
46 unsigned long flags,temp; 46 unsigned long flags,temp;
47 local_save_flags(flags); /* save flags, including irq enable bit */ 47 local_irq_save(flags); /* save flags, including irq enable bit and shut off irqs */
48 local_irq_disable(); /* shut off irq's */
49 switch (size) { 48 switch (size) {
50 case 1: 49 case 1:
51 *((unsigned char *)&temp) = x; 50 *((unsigned char *)&temp) = x;
diff --git a/include/asm-cris/termios.h b/include/asm-cris/termios.h
index 5ce1023c5d7b..c9dbd4d43368 100644
--- a/include/asm-cris/termios.h
+++ b/include/asm-cris/termios.h
@@ -40,24 +40,6 @@ struct termio {
40 40
41/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 41/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
42 42
43/* line disciplines */
44#define N_TTY 0
45#define N_SLIP 1
46#define N_MOUSE 2
47#define N_PPP 3
48#define N_STRIP 4
49#define N_AX25 5
50#define N_X25 6 /* X.25 async */
51#define N_6PACK 7
52#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
53#define N_R3964 9 /* Reserved for Simatic R3964 module */
54#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
55#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
56#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
57#define N_HDLC 13 /* synchronous HDLC */
58#define N_SYNC_PPP 14 /* synchronous PPP */
59#define N_BT 15 /* bluetooth */
60
61#ifdef __KERNEL__ 43#ifdef __KERNEL__
62 44
63/* intr=^C quit=^\ erase=del kill=^U 45/* intr=^C quit=^\ erase=del kill=^U
diff --git a/include/asm-frv/termios.h b/include/asm-frv/termios.h
index 8840cf95e8dd..a62fb5872375 100644
--- a/include/asm-frv/termios.h
+++ b/include/asm-frv/termios.h
@@ -51,24 +51,6 @@ struct termio {
51 51
52/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 52/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
53 53
54/* line disciplines */
55#define N_TTY 0
56#define N_SLIP 1
57#define N_MOUSE 2
58#define N_PPP 3
59#define N_STRIP 4
60#define N_AX25 5
61#define N_X25 6 /* X.25 async */
62#define N_6PACK 7
63#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
64#define N_R3964 9 /* Reserved for Simatic R3964 module */
65#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
66#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
67#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
68#define N_HDLC 13 /* synchronous HDLC */
69#define N_SYNC_PPP 14
70#define N_HCI 15 /* Bluetooth HCI UART */
71
72#ifdef __KERNEL__ 54#ifdef __KERNEL__
73#include <asm-generic/termios.h> 55#include <asm-generic/termios.h>
74#endif 56#endif
diff --git a/include/asm-generic/dma-mapping-broken.h b/include/asm-generic/dma-mapping-broken.h
index a7f1a55ce6b0..29413d3d4605 100644
--- a/include/asm-generic/dma-mapping-broken.h
+++ b/include/asm-generic/dma-mapping-broken.h
@@ -3,7 +3,6 @@
3 3
4/* This is used for archs that do not support DMA */ 4/* This is used for archs that do not support DMA */
5 5
6
7static inline void * 6static inline void *
8dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 7dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
9 gfp_t flag) 8 gfp_t flag)
@@ -19,4 +18,7 @@ dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
19 BUG(); 18 BUG();
20} 19}
21 20
21#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
22#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
23
22#endif /* _ASM_GENERIC_DMA_MAPPING_H */ 24#endif /* _ASM_GENERIC_DMA_MAPPING_H */
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
new file mode 100644
index 000000000000..2d0aab1d8611
--- /dev/null
+++ b/include/asm-generic/gpio.h
@@ -0,0 +1,25 @@
1#ifndef _ASM_GENERIC_GPIO_H
2#define _ASM_GENERIC_GPIO_H
3
4/* platforms that don't directly support access to GPIOs through I2C, SPI,
5 * or other blocking infrastructure can use these wrappers.
6 */
7
8static inline int gpio_cansleep(unsigned gpio)
9{
10 return 0;
11}
12
13static inline int gpio_get_value_cansleep(unsigned gpio)
14{
15 might_sleep();
16 return gpio_get_value(gpio);
17}
18
19static inline void gpio_set_value_cansleep(unsigned gpio, int value)
20{
21 might_sleep();
22 gpio_set_value(gpio, value);
23}
24
25#endif /* _ASM_GENERIC_GPIO_H */
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h
index 8078cbd2c016..30d8d33491dd 100644
--- a/include/asm-generic/memory_model.h
+++ b/include/asm-generic/memory_model.h
@@ -54,7 +54,7 @@
54#define __page_to_pfn(pg) \ 54#define __page_to_pfn(pg) \
55({ struct page *__pg = (pg); \ 55({ struct page *__pg = (pg); \
56 int __sec = page_to_section(__pg); \ 56 int __sec = page_to_section(__pg); \
57 __pg - __section_mem_map_addr(__nr_to_section(__sec)); \ 57 (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \
58}) 58})
59 59
60#define __pfn_to_page(pfn) \ 60#define __pfn_to_page(pfn) \
diff --git a/include/asm-generic/mman.h b/include/asm-generic/mman.h
index 3b41d2bb70da..5e3dde2ee5ad 100644
--- a/include/asm-generic/mman.h
+++ b/include/asm-generic/mman.h
@@ -36,7 +36,6 @@
36#define MADV_DOFORK 11 /* do inherit across fork */ 36#define MADV_DOFORK 11 /* do inherit across fork */
37 37
38/* compatibility flags */ 38/* compatibility flags */
39#define MAP_ANON MAP_ANONYMOUS
40#define MAP_FILE 0 39#define MAP_FILE 0
41 40
42#endif 41#endif
diff --git a/include/asm-h8300/termios.h b/include/asm-h8300/termios.h
index e2319f992af2..fb2925d08c49 100644
--- a/include/asm-h8300/termios.h
+++ b/include/asm-h8300/termios.h
@@ -49,24 +49,6 @@ struct termio {
49 49
50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
51 51
52/* line disciplines */
53#define N_TTY 0
54#define N_SLIP 1
55#define N_MOUSE 2
56#define N_PPP 3
57#define N_STRIP 4
58#define N_AX25 5
59#define N_X25 6 /* X.25 async */
60#define N_6PACK 7
61#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
62#define N_R3964 9 /* Reserved for Simatic R3964 module */
63#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
64#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
65#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
66#define N_HDLC 13 /* synchronous HDLC */
67#define N_SYNC_PPP 14
68#define N_HCI 15 /* Bluetooth HCI UART */
69
70#ifdef __KERNEL__ 52#ifdef __KERNEL__
71 53
72/* 54/*
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
index 7cfad93edf10..5e657eb8946c 100644
--- a/include/asm-i386/acpi.h
+++ b/include/asm-i386/acpi.h
@@ -39,7 +39,7 @@
39 * Calling conventions: 39 * Calling conventions:
40 * 40 *
41 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) 41 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
42 * ACPI_EXTERNAL_XFACE - External ACPI interfaces 42 * ACPI_EXTERNAL_XFACE - External ACPI interfaces
43 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces 43 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
44 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces 44 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
45 */ 45 */
@@ -59,11 +59,11 @@
59int __acpi_acquire_global_lock(unsigned int *lock); 59int __acpi_acquire_global_lock(unsigned int *lock);
60int __acpi_release_global_lock(unsigned int *lock); 60int __acpi_release_global_lock(unsigned int *lock);
61 61
62#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ 62#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
63 ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr)) 63 ((Acq) = __acpi_acquire_global_lock(&facs->global_lock))
64 64
65#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ 65#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
66 ((Acq) = __acpi_release_global_lock((unsigned int *) GLptr)) 66 ((Acq) = __acpi_release_global_lock(&facs->global_lock))
67 67
68/* 68/*
69 * Math helper asm macros 69 * Math helper asm macros
@@ -87,7 +87,7 @@ extern void check_acpi_pci(void);
87static inline void check_acpi_pci(void) { } 87static inline void check_acpi_pci(void) { }
88#endif 88#endif
89 89
90#ifdef CONFIG_ACPI 90#ifdef CONFIG_ACPI
91extern int acpi_lapic; 91extern int acpi_lapic;
92extern int acpi_ioapic; 92extern int acpi_ioapic;
93extern int acpi_noirq; 93extern int acpi_noirq;
@@ -95,9 +95,9 @@ extern int acpi_strict;
95extern int acpi_disabled; 95extern int acpi_disabled;
96extern int acpi_ht; 96extern int acpi_ht;
97extern int acpi_pci_disabled; 97extern int acpi_pci_disabled;
98static inline void disable_acpi(void) 98static inline void disable_acpi(void)
99{ 99{
100 acpi_disabled = 1; 100 acpi_disabled = 1;
101 acpi_ht = 0; 101 acpi_ht = 0;
102 acpi_pci_disabled = 1; 102 acpi_pci_disabled = 1;
103 acpi_noirq = 1; 103 acpi_noirq = 1;
@@ -114,9 +114,9 @@ extern int acpi_use_timer_override;
114#endif 114#endif
115 115
116static inline void acpi_noirq_set(void) { acpi_noirq = 1; } 116static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
117static inline void acpi_disable_pci(void) 117static inline void acpi_disable_pci(void)
118{ 118{
119 acpi_pci_disabled = 1; 119 acpi_pci_disabled = 1;
120 acpi_noirq_set(); 120 acpi_noirq_set();
121} 121}
122extern int acpi_irq_balance_set(char *str); 122extern int acpi_irq_balance_set(char *str);
@@ -144,8 +144,6 @@ extern void acpi_reserve_bootmem(void);
144 144
145#endif /*CONFIG_ACPI_SLEEP*/ 145#endif /*CONFIG_ACPI_SLEEP*/
146 146
147extern u8 x86_acpiid_to_apicid[];
148
149#define ARCH_HAS_POWER_INIT 1 147#define ARCH_HAS_POWER_INIT 1
150 148
151#endif /*__KERNEL__*/ 149#endif /*__KERNEL__*/
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h
index c57441bb2905..4dd272331361 100644
--- a/include/asm-i386/atomic.h
+++ b/include/asm-i386/atomic.h
@@ -211,12 +211,12 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v)
211#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 211#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
212 212
213/** 213/**
214 * atomic_add_unless - add unless the number is a given value 214 * atomic_add_unless - add unless the number is already a given value
215 * @v: pointer of type atomic_t 215 * @v: pointer of type atomic_t
216 * @a: the amount to add to v... 216 * @a: the amount to add to v...
217 * @u: ...unless v is equal to u. 217 * @u: ...unless v is equal to u.
218 * 218 *
219 * Atomically adds @a to @v, so long as it was not @u. 219 * Atomically adds @a to @v, so long as @v was not already @u.
220 * Returns non-zero if @v was not @u, and zero otherwise. 220 * Returns non-zero if @v was not @u, and zero otherwise.
221 */ 221 */
222#define atomic_add_unless(v, a, u) \ 222#define atomic_add_unless(v, a, u) \
diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h
index 1c780fa1e762..273b50629357 100644
--- a/include/asm-i386/bitops.h
+++ b/include/asm-i386/bitops.h
@@ -371,7 +371,7 @@ static inline unsigned long ffz(unsigned long word)
371 * 371 *
372 * This is defined the same way as 372 * This is defined the same way as
373 * the libc and compiler builtin ffs routines, therefore 373 * the libc and compiler builtin ffs routines, therefore
374 * differs in spirit from the above ffz (man ffs). 374 * differs in spirit from the above ffz() (man ffs).
375 */ 375 */
376static inline int ffs(int x) 376static inline int ffs(int x)
377{ 377{
@@ -388,7 +388,7 @@ static inline int ffs(int x)
388 * fls - find last bit set 388 * fls - find last bit set
389 * @x: the word to search 389 * @x: the word to search
390 * 390 *
391 * This is defined the same way as ffs. 391 * This is defined the same way as ffs().
392 */ 392 */
393static inline int fls(int x) 393static inline int fls(int x)
394{ 394{
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h
index 86ff5e83be2f..59fe616933c4 100644
--- a/include/asm-i386/io.h
+++ b/include/asm-i386/io.h
@@ -219,12 +219,6 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
219#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET)) 219#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET))
220 220
221/* 221/*
222 * Again, i386 does not require mem IO specific function.
223 */
224
225#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void __force *)(b),(c),(d))
226
227/*
228 * Cache management 222 * Cache management
229 * 223 *
230 * This needed for two cases 224 * This needed for two cases
diff --git a/include/asm-i386/mach-es7000/mach_mpparse.h b/include/asm-i386/mach-es7000/mach_mpparse.h
index 99f66be240be..24990e546da3 100644
--- a/include/asm-i386/mach-es7000/mach_mpparse.h
+++ b/include/asm-i386/mach-es7000/mach_mpparse.h
@@ -3,13 +3,13 @@
3 3
4#include <linux/acpi.h> 4#include <linux/acpi.h>
5 5
6static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, 6static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
7 struct mpc_config_translation *translation) 7 struct mpc_config_translation *translation)
8{ 8{
9 Dprintk("Bus #%d is %s\n", m->mpc_busid, name); 9 Dprintk("Bus #%d is %s\n", m->mpc_busid, name);
10} 10}
11 11
12static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, 12static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,
13 struct mpc_config_translation *translation) 13 struct mpc_config_translation *translation)
14{ 14{
15} 15}
@@ -22,7 +22,7 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
22 char *productid) 22 char *productid)
23{ 23{
24 if (mpc->mpc_oemptr) { 24 if (mpc->mpc_oemptr) {
25 struct mp_config_oemtable *oem_table = 25 struct mp_config_oemtable *oem_table =
26 (struct mp_config_oemtable *)mpc->mpc_oemptr; 26 (struct mp_config_oemtable *)mpc->mpc_oemptr;
27 if (!strncmp(oem, "UNISYS", 6)) 27 if (!strncmp(oem, "UNISYS", 6))
28 return parse_unisys_oem((char *)oem_table); 28 return parse_unisys_oem((char *)oem_table);
@@ -31,12 +31,13 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
31} 31}
32 32
33#ifdef CONFIG_ACPI 33#ifdef CONFIG_ACPI
34
34static inline int es7000_check_dsdt(void) 35static inline int es7000_check_dsdt(void)
35{ 36{
36 struct acpi_table_header *header = NULL; 37 struct acpi_table_header header;
37 if(!acpi_get_table_header_early(ACPI_DSDT, &header)) 38 memcpy(&header, 0, sizeof(struct acpi_table_header));
38 acpi_table_print(header, 0); 39 acpi_get_table_header(ACPI_SIG_DSDT, 0, &header);
39 if (!strncmp(header->oem_id, "UNISYS", 6)) 40 if (!strncmp(header.oem_id, "UNISYS", 6))
40 return 1; 41 return 1;
41 return 0; 42 return 0;
42} 43}
@@ -44,7 +45,7 @@ static inline int es7000_check_dsdt(void)
44/* Hook from generic ACPI tables.c */ 45/* Hook from generic ACPI tables.c */
45static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) 46static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
46{ 47{
47 unsigned long oem_addr; 48 unsigned long oem_addr;
48 if (!find_unisys_acpi_oem_table(&oem_addr)) { 49 if (!find_unisys_acpi_oem_table(&oem_addr)) {
49 if (es7000_check_dsdt()) 50 if (es7000_check_dsdt())
50 return parse_unisys_oem((char *)oem_addr); 51 return parse_unisys_oem((char *)oem_addr);
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h
index 67659dbaf120..76316275d6f9 100644
--- a/include/asm-i386/setup.h
+++ b/include/asm-i386/setup.h
@@ -6,7 +6,7 @@
6#ifndef _i386_SETUP_H 6#ifndef _i386_SETUP_H
7#define _i386_SETUP_H 7#define _i386_SETUP_H
8 8
9#define COMMAND_LINE_SIZE 256 9#define COMMAND_LINE_SIZE 2048
10 10
11#ifdef __KERNEL__ 11#ifdef __KERNEL__
12#include <linux/pfn.h> 12#include <linux/pfn.h>
diff --git a/include/asm-i386/termios.h b/include/asm-i386/termios.h
index 03f548536d6b..7c99678a8f86 100644
--- a/include/asm-i386/termios.h
+++ b/include/asm-i386/termios.h
@@ -39,24 +39,6 @@ struct termio {
39 39
40/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 40/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
41 41
42/* line disciplines */
43#define N_TTY 0
44#define N_SLIP 1
45#define N_MOUSE 2
46#define N_PPP 3
47#define N_STRIP 4
48#define N_AX25 5
49#define N_X25 6 /* X.25 async */
50#define N_6PACK 7
51#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
52#define N_R3964 9 /* Reserved for Simatic R3964 module */
53#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
54#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
55#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
56#define N_HDLC 13 /* synchronous HDLC */
57#define N_SYNC_PPP 14 /* synchronous PPP */
58#define N_HCI 15 /* Bluetooth HCI UART */
59
60#ifdef __KERNEL__ 42#ifdef __KERNEL__
61#include <linux/module.h> 43#include <linux/module.h>
62 44
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index eef5133b9ce2..70829ae3ad52 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -54,10 +54,10 @@ extern struct movsl_mask {
54 * This needs 33-bit arithmetic. We have a carry... 54 * This needs 33-bit arithmetic. We have a carry...
55 */ 55 */
56#define __range_ok(addr,size) ({ \ 56#define __range_ok(addr,size) ({ \
57 unsigned long flag,sum; \ 57 unsigned long flag,roksum; \
58 __chk_user_ptr(addr); \ 58 __chk_user_ptr(addr); \
59 asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \ 59 asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \
60 :"=&r" (flag), "=r" (sum) \ 60 :"=&r" (flag), "=r" (roksum) \
61 :"1" (addr),"g" ((int)(size)),"rm" (current_thread_info()->addr_limit.seg)); \ 61 :"1" (addr),"g" ((int)(size)),"rm" (current_thread_info()->addr_limit.seg)); \
62 flag; }) 62 flag; })
63 63
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
index 09a5dd0e44a8..5d03792d4f65 100644
--- a/include/asm-ia64/acpi.h
+++ b/include/asm-ia64/acpi.h
@@ -82,11 +82,11 @@ ia64_acpi_release_global_lock (unsigned int *lock)
82 return old & 0x1; 82 return old & 0x1;
83} 83}
84 84
85#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ 85#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
86 ((Acq) = ia64_acpi_acquire_global_lock((unsigned int *) GLptr)) 86 ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock))
87 87
88#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ 88#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
89 ((Acq) = ia64_acpi_release_global_lock((unsigned int *) GLptr)) 89 ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock))
90 90
91#define acpi_disabled 0 /* ACPI always enabled on IA64 */ 91#define acpi_disabled 0 /* ACPI always enabled on IA64 */
92#define acpi_noirq 0 /* ACPI always enabled on IA64 */ 92#define acpi_noirq 0 /* ACPI always enabled on IA64 */
@@ -119,8 +119,6 @@ extern int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS];
119extern int __initdata nid_to_pxm_map[MAX_NUMNODES]; 119extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
120#endif 120#endif
121 121
122extern u16 ia64_acpiid_to_sapicid[];
123
124/* 122/*
125 * Refer Intel ACPI _PDC support document for bit definitions 123 * Refer Intel ACPI _PDC support document for bit definitions
126 */ 124 */
diff --git a/include/asm-ia64/dma.h b/include/asm-ia64/dma.h
index dad3a735df8b..4d97f60f1ef5 100644
--- a/include/asm-ia64/dma.h
+++ b/include/asm-ia64/dma.h
@@ -19,4 +19,6 @@ extern unsigned long MAX_DMA_ADDRESS;
19 19
20#define free_dma(x) 20#define free_dma(x)
21 21
22void dma_mark_clean(void *addr, size_t size);
23
22#endif /* _ASM_IA64_DMA_H */ 24#endif /* _ASM_IA64_DMA_H */
diff --git a/include/asm-ia64/esi.h b/include/asm-ia64/esi.h
index 84aac0e0b583..40991c6ba647 100644
--- a/include/asm-ia64/esi.h
+++ b/include/asm-ia64/esi.h
@@ -19,7 +19,6 @@ enum esi_proc_type {
19 ESI_PROC_REENTRANT /* MP-safe and reentrant */ 19 ESI_PROC_REENTRANT /* MP-safe and reentrant */
20}; 20};
21 21
22extern int ia64_esi_init (void);
23extern struct ia64_sal_retval esi_call_phys (void *, u64 *); 22extern struct ia64_sal_retval esi_call_phys (void *, u64 *);
24extern int ia64_esi_call(efi_guid_t, struct ia64_sal_retval *, 23extern int ia64_esi_call(efi_guid_t, struct ia64_sal_retval *,
25 enum esi_proc_type, 24 enum esi_proc_type,
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
index a3891eb3f217..3c96ac19154e 100644
--- a/include/asm-ia64/machvec.h
+++ b/include/asm-ia64/machvec.h
@@ -21,6 +21,7 @@ struct mm_struct;
21struct pci_bus; 21struct pci_bus;
22struct task_struct; 22struct task_struct;
23struct pci_dev; 23struct pci_dev;
24struct msi_desc;
24 25
25typedef void ia64_mv_setup_t (char **); 26typedef void ia64_mv_setup_t (char **);
26typedef void ia64_mv_cpu_init_t (void); 27typedef void ia64_mv_cpu_init_t (void);
@@ -79,7 +80,7 @@ typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *);
79typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *); 80typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *);
80typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *); 81typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *);
81 82
82typedef int ia64_mv_setup_msi_irq_t (unsigned int irq, struct pci_dev *pdev); 83typedef int ia64_mv_setup_msi_irq_t (struct pci_dev *pdev, struct msi_desc *);
83typedef void ia64_mv_teardown_msi_irq_t (unsigned int irq); 84typedef void ia64_mv_teardown_msi_irq_t (unsigned int irq);
84 85
85static inline void 86static inline void
diff --git a/include/asm-ia64/meminit.h b/include/asm-ia64/meminit.h
index c8df75901083..6dd476b652c6 100644
--- a/include/asm-ia64/meminit.h
+++ b/include/asm-ia64/meminit.h
@@ -51,12 +51,13 @@ extern void efi_memmap_init(unsigned long *, unsigned long *);
51 51
52#define IGNORE_PFN0 1 /* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */ 52#define IGNORE_PFN0 1 /* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */
53 53
54extern int register_active_ranges(u64 start, u64 end, void *arg);
55
54#ifdef CONFIG_VIRTUAL_MEM_MAP 56#ifdef CONFIG_VIRTUAL_MEM_MAP
55# define LARGE_GAP 0x40000000 /* Use virtual mem map if hole is > than this */ 57# define LARGE_GAP 0x40000000 /* Use virtual mem map if hole is > than this */
56 extern unsigned long vmalloc_end; 58 extern unsigned long vmalloc_end;
57 extern struct page *vmem_map; 59 extern struct page *vmem_map;
58 extern int find_largest_hole (u64 start, u64 end, void *arg); 60 extern int find_largest_hole (u64 start, u64 end, void *arg);
59 extern int register_active_ranges (u64 start, u64 end, void *arg);
60 extern int create_mem_map_page_table (u64 start, u64 end, void *arg); 61 extern int create_mem_map_page_table (u64 start, u64 end, void *arg);
61 extern int vmemmap_find_next_valid_pfn(int, int); 62 extern int vmemmap_find_next_valid_pfn(int, int);
62#else 63#else
diff --git a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h
index 393e04c42a2c..560c287b1233 100644
--- a/include/asm-ia64/pgalloc.h
+++ b/include/asm-ia64/pgalloc.h
@@ -137,7 +137,8 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte)
137static inline struct page *pte_alloc_one(struct mm_struct *mm, 137static inline struct page *pte_alloc_one(struct mm_struct *mm,
138 unsigned long addr) 138 unsigned long addr)
139{ 139{
140 return virt_to_page(pgtable_quicklist_alloc()); 140 void *pg = pgtable_quicklist_alloc();
141 return pg ? virt_to_page(pg) : NULL;
141} 142}
142 143
143static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 144static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
diff --git a/include/asm-ia64/setup.h b/include/asm-ia64/setup.h
index ea29b57affcb..4399a44355b3 100644
--- a/include/asm-ia64/setup.h
+++ b/include/asm-ia64/setup.h
@@ -1,6 +1,6 @@
1#ifndef __IA64_SETUP_H 1#ifndef __IA64_SETUP_H
2#define __IA64_SETUP_H 2#define __IA64_SETUP_H
3 3
4#define COMMAND_LINE_SIZE 512 4#define COMMAND_LINE_SIZE 2048
5 5
6#endif 6#endif
diff --git a/include/asm-ia64/sn/acpi.h b/include/asm-ia64/sn/acpi.h
index 2850a7ef5e71..9ce2801cbd57 100644
--- a/include/asm-ia64/sn/acpi.h
+++ b/include/asm-ia64/sn/acpi.h
@@ -11,6 +11,7 @@
11 11
12#include "acpi/acglobal.h" 12#include "acpi/acglobal.h"
13 13
14#define SN_ACPI_BASE_SUPPORT() (acpi_gbl_DSDT->oem_revision >= 0x20101) 14extern int sn_acpi_rev;
15#define SN_ACPI_BASE_SUPPORT() (sn_acpi_rev >= 0x20101)
15 16
16#endif /* _ASM_IA64_SN_ACPI_H */ 17#endif /* _ASM_IA64_SN_ACPI_H */
diff --git a/include/asm-ia64/sn/pcibr_provider.h b/include/asm-ia64/sn/pcibr_provider.h
index da3eade0cae2..17cb6cc3f21a 100644
--- a/include/asm-ia64/sn/pcibr_provider.h
+++ b/include/asm-ia64/sn/pcibr_provider.h
@@ -142,7 +142,7 @@ extern int pcibr_ate_alloc(struct pcibus_info *, int);
142extern void pcibr_ate_free(struct pcibus_info *, int); 142extern void pcibr_ate_free(struct pcibus_info *, int);
143extern void ate_write(struct pcibus_info *, int, int, u64); 143extern void ate_write(struct pcibus_info *, int, int, u64);
144extern int sal_pcibr_slot_enable(struct pcibus_info *soft, int device, 144extern int sal_pcibr_slot_enable(struct pcibus_info *soft, int device,
145 void *resp); 145 void *resp, char **ssdt);
146extern int sal_pcibr_slot_disable(struct pcibus_info *soft, int device, 146extern int sal_pcibr_slot_disable(struct pcibus_info *soft, int device,
147 int action, void *resp); 147 int action, void *resp);
148extern u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus); 148extern u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus);
diff --git a/include/asm-ia64/sn/pcidev.h b/include/asm-ia64/sn/pcidev.h
index 9fe89a93d880..1c2382cea807 100644
--- a/include/asm-ia64/sn/pcidev.h
+++ b/include/asm-ia64/sn/pcidev.h
@@ -70,10 +70,16 @@ extern void sn_irq_fixup(struct pci_dev *pci_dev,
70 struct sn_irq_info *sn_irq_info); 70 struct sn_irq_info *sn_irq_info);
71extern void sn_irq_unfixup(struct pci_dev *pci_dev); 71extern void sn_irq_unfixup(struct pci_dev *pci_dev);
72extern struct pcidev_info * sn_pcidev_info_get(struct pci_dev *); 72extern struct pcidev_info * sn_pcidev_info_get(struct pci_dev *);
73extern void sn_bus_fixup(struct pci_bus *);
74extern void sn_acpi_bus_fixup(struct pci_bus *);
75extern void sn_common_bus_fixup(struct pci_bus *, struct pcibus_bussoft *);
73extern void sn_bus_store_sysdata(struct pci_dev *dev); 76extern void sn_bus_store_sysdata(struct pci_dev *dev);
74extern void sn_bus_free_sysdata(void); 77extern void sn_bus_free_sysdata(void);
75extern void sn_generate_path(struct pci_bus *pci_bus, char *address); 78extern void sn_generate_path(struct pci_bus *pci_bus, char *address);
76extern void sn_pci_fixup_slot(struct pci_dev *dev); 79extern void sn_io_slot_fixup(struct pci_dev *);
80extern void sn_acpi_slot_fixup(struct pci_dev *);
81extern void sn_pci_fixup_slot(struct pci_dev *dev, struct pcidev_info *,
82 struct sn_irq_info *);
77extern void sn_pci_unfixup_slot(struct pci_dev *dev); 83extern void sn_pci_unfixup_slot(struct pci_dev *dev);
78extern void sn_irq_lh_init(void); 84extern void sn_irq_lh_init(void);
79#endif /* _ASM_IA64_SN_PCI_PCIDEV_H */ 85#endif /* _ASM_IA64_SN_PCI_PCIDEV_H */
diff --git a/include/asm-ia64/swiotlb.h b/include/asm-ia64/swiotlb.h
new file mode 100644
index 000000000000..452c162dee4e
--- /dev/null
+++ b/include/asm-ia64/swiotlb.h
@@ -0,0 +1,9 @@
1#ifndef _ASM_SWIOTLB_H
2#define _ASM_SWIOTLB_H 1
3
4#include <asm/machvec.h>
5
6#define SWIOTLB_ARCH_NEED_LATE_INIT
7#define SWIOTLB_ARCH_NEED_ALLOC
8
9#endif /* _ASM_SWIOTLB_H */
diff --git a/include/asm-ia64/termios.h b/include/asm-ia64/termios.h
index 42c95693240c..08750c2d3607 100644
--- a/include/asm-ia64/termios.h
+++ b/include/asm-ia64/termios.h
@@ -46,24 +46,6 @@ struct termio {
46 46
47/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 47/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
48 48
49/* line disciplines */
50#define N_TTY 0
51#define N_SLIP 1
52#define N_MOUSE 2
53#define N_PPP 3
54#define N_STRIP 4
55#define N_AX25 5
56#define N_X25 6 /* X.25 async */
57#define N_6PACK 7
58#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
59#define N_R3964 9 /* Reserved for Simatic R3964 module */
60#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
61#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
62#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS msgs */
63#define N_HDLC 13 /* synchronous HDLC */
64#define N_SYNC_PPP 14 /* synchronous PPP */
65#define N_HCI 15 /* Bluetooth HCI UART */
66
67# ifdef __KERNEL__ 49# ifdef __KERNEL__
68 50
69/* intr=^C quit=^\ erase=del kill=^U 51/* intr=^C quit=^\ erase=del kill=^U
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h
index 9b505b25544f..91698599f918 100644
--- a/include/asm-ia64/thread_info.h
+++ b/include/asm-ia64/thread_info.h
@@ -84,6 +84,7 @@ struct thread_info {
84#define TIF_NEED_RESCHED 2 /* rescheduling necessary */ 84#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
85#define TIF_SYSCALL_TRACE 3 /* syscall trace active */ 85#define TIF_SYSCALL_TRACE 3 /* syscall trace active */
86#define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ 86#define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */
87#define TIF_SINGLESTEP 5 /* restore singlestep on return to user mode */
87#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 88#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
88#define TIF_MEMDIE 17 89#define TIF_MEMDIE 17
89#define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */ 90#define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */
@@ -92,7 +93,8 @@ struct thread_info {
92 93
93#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 94#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
94#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 95#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
95#define _TIF_SYSCALL_TRACEAUDIT (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) 96#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
97#define _TIF_SYSCALL_TRACEAUDIT (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
96#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 98#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
97#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 99#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
98#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 100#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index 53c5c0ee122c..a9e1fa4cac4d 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -291,11 +291,13 @@
291#define __NR_sync_file_range 1300 291#define __NR_sync_file_range 1300
292#define __NR_tee 1301 292#define __NR_tee 1301
293#define __NR_vmsplice 1302 293#define __NR_vmsplice 1302
294/* 1303 reserved for move_pages */
295#define __NR_getcpu 1304
294 296
295#ifdef __KERNEL__ 297#ifdef __KERNEL__
296 298
297 299
298#define NR_syscalls 279 /* length of syscall table */ 300#define NR_syscalls 281 /* length of syscall table */
299 301
300#define __ARCH_WANT_SYS_RT_SIGACTION 302#define __ARCH_WANT_SYS_RT_SIGACTION
301 303
diff --git a/include/asm-m32r/a.out.h b/include/asm-m32r/a.out.h
index 4619ba5c372e..9a4a5d20160a 100644
--- a/include/asm-m32r/a.out.h
+++ b/include/asm-m32r/a.out.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_A_OUT_H 1#ifndef _ASM_M32R_A_OUT_H
2#define _ASM_M32R_A_OUT_H 2#define _ASM_M32R_A_OUT_H
3 3
4/* orig : i386 2.4.18 */
5
6struct exec 4struct exec
7{ 5{
8 unsigned long a_info; /* Use macros N_MAGIC, etc for access */ 6 unsigned long a_info; /* Use macros N_MAGIC, etc for access */
diff --git a/include/asm-m32r/addrspace.h b/include/asm-m32r/addrspace.h
index 06a83dc94648..81782c122da4 100644
--- a/include/asm-m32r/addrspace.h
+++ b/include/asm-m32r/addrspace.h
@@ -1,4 +1,3 @@
1/* $Id$ */
2/* 1/*
3 * This file is subject to the terms and conditions of the GNU General Public 2 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
diff --git a/include/asm-m32r/bugs.h b/include/asm-m32r/bugs.h
index 9a56f661bdb3..f77214eff136 100644
--- a/include/asm-m32r/bugs.h
+++ b/include/asm-m32r/bugs.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_BUGS_H 1#ifndef _ASM_M32R_BUGS_H
2#define _ASM_M32R_BUGS_H 2#define _ASM_M32R_BUGS_H
3 3
4/* $Id$ */
5
6/* 4/*
7 * This is included by init/main.c to check for architecture-dependent bugs. 5 * This is included by init/main.c to check for architecture-dependent bugs.
8 * 6 *
diff --git a/include/asm-m32r/byteorder.h b/include/asm-m32r/byteorder.h
index 3c0b9a2e03bc..10b2c1d11614 100644
--- a/include/asm-m32r/byteorder.h
+++ b/include/asm-m32r/byteorder.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_BYTEORDER_H 1#ifndef _ASM_M32R_BYTEORDER_H
2#define _ASM_M32R_BYTEORDER_H 2#define _ASM_M32R_BYTEORDER_H
3 3
4/* $Id$ */
5
6#include <asm/types.h> 4#include <asm/types.h>
7 5
8#if !defined(__STRICT_ANSI__) || defined(__KERNEL__) 6#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
diff --git a/include/asm-m32r/cache.h b/include/asm-m32r/cache.h
index 9c2b2d9998bc..40b3ee98193d 100644
--- a/include/asm-m32r/cache.h
+++ b/include/asm-m32r/cache.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_CACHE_H 1#ifndef _ASM_M32R_CACHE_H
2#define _ASM_M32R_CACHE_H 2#define _ASM_M32R_CACHE_H
3 3
4/* $Id$ */
5
6/* L1 cache line size */ 4/* L1 cache line size */
7#define L1_CACHE_SHIFT 4 5#define L1_CACHE_SHIFT 4
8#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 6#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
diff --git a/include/asm-m32r/cacheflush.h b/include/asm-m32r/cacheflush.h
index 56961a9511b2..78587c958146 100644
--- a/include/asm-m32r/cacheflush.h
+++ b/include/asm-m32r/cacheflush.h
@@ -67,4 +67,3 @@ do { \
67 memcpy(dst, src, len) 67 memcpy(dst, src, len)
68 68
69#endif /* _ASM_M32R_CACHEFLUSH_H */ 69#endif /* _ASM_M32R_CACHEFLUSH_H */
70
diff --git a/include/asm-m32r/current.h b/include/asm-m32r/current.h
index c19d927ff22d..7859d864f2c2 100644
--- a/include/asm-m32r/current.h
+++ b/include/asm-m32r/current.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_CURRENT_H 1#ifndef _ASM_M32R_CURRENT_H
2#define _ASM_M32R_CURRENT_H 2#define _ASM_M32R_CURRENT_H
3 3
4/* $Id$ */
5
6#include <linux/thread_info.h> 4#include <linux/thread_info.h>
7 5
8struct task_struct; 6struct task_struct;
@@ -15,4 +13,3 @@ static __inline__ struct task_struct *get_current(void)
15#define current (get_current()) 13#define current (get_current())
16 14
17#endif /* _ASM_M32R_CURRENT_H */ 15#endif /* _ASM_M32R_CURRENT_H */
18
diff --git a/include/asm-m32r/delay.h b/include/asm-m32r/delay.h
index f285eaee7d27..164448d23850 100644
--- a/include/asm-m32r/delay.h
+++ b/include/asm-m32r/delay.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_DELAY_H 1#ifndef _ASM_M32R_DELAY_H
2#define _ASM_M32R_DELAY_H 2#define _ASM_M32R_DELAY_H
3 3
4/* $Id$ */
5
6/* 4/*
7 * Copyright (C) 1993 Linus Torvalds 5 * Copyright (C) 1993 Linus Torvalds
8 * 6 *
diff --git a/include/asm-m32r/dma.h b/include/asm-m32r/dma.h
index 7263b013b67e..52f6a22dd232 100644
--- a/include/asm-m32r/dma.h
+++ b/include/asm-m32r/dma.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_DMA_H 1#ifndef _ASM_M32R_DMA_H
2#define _ASM_M32R_DMA_H 2#define _ASM_M32R_DMA_H
3 3
4/* $Id$ */
5
6#include <asm/io.h> 4#include <asm/io.h>
7 5
8/* 6/*
diff --git a/include/asm-m32r/errno.h b/include/asm-m32r/errno.h
index 7a98520194a7..777149262aad 100644
--- a/include/asm-m32r/errno.h
+++ b/include/asm-m32r/errno.h
@@ -1,9 +1,6 @@
1#ifndef _ASM_M32R_ERRNO_H 1#ifndef _ASM_M32R_ERRNO_H
2#define _ASM_M32R_ERRNO_H 2#define _ASM_M32R_ERRNO_H
3 3
4/* $Id$ */
5
6#include <asm-generic/errno.h> 4#include <asm-generic/errno.h>
7 5
8#endif /* _ASM_M32R_ERRNO_H */ 6#endif /* _ASM_M32R_ERRNO_H */
9
diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h
index c82ebe8f250d..4672a49e8760 100644
--- a/include/asm-m32r/ide.h
+++ b/include/asm-m32r/ide.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_IDE_H 1#ifndef _ASM_M32R_IDE_H
2#define _ASM_M32R_IDE_H 2#define _ASM_M32R_IDE_H
3 3
4/* $Id$ */
5
6/* 4/*
7 * linux/include/asm-m32r/ide.h 5 * linux/include/asm-m32r/ide.h
8 * 6 *
@@ -15,6 +13,7 @@
15 13
16#ifdef __KERNEL__ 14#ifdef __KERNEL__
17 15
16#include <asm/m32r.h>
18 17
19#ifndef MAX_HWIFS 18#ifndef MAX_HWIFS
20# ifdef CONFIG_BLK_DEV_IDEPCI 19# ifdef CONFIG_BLK_DEV_IDEPCI
@@ -24,9 +23,6 @@
24# endif 23# endif
25#endif 24#endif
26 25
27#include <asm/m32r.h>
28
29
30#define IDE_ARCH_OBSOLETE_DEFAULTS 26#define IDE_ARCH_OBSOLETE_DEFAULTS
31 27
32static __inline__ int ide_default_irq(unsigned long base) 28static __inline__ int ide_default_irq(unsigned long base)
diff --git a/include/asm-m32r/ioctls.h b/include/asm-m32r/ioctls.h
index b3508292246a..d23cfc45738a 100644
--- a/include/asm-m32r/ioctls.h
+++ b/include/asm-m32r/ioctls.h
@@ -1,10 +1,6 @@
1#ifndef __ARCH_M32R_IOCTLS_H__ 1#ifndef __ARCH_M32R_IOCTLS_H__
2#define __ARCH_M32R_IOCTLS_H__ 2#define __ARCH_M32R_IOCTLS_H__
3 3
4/* $Id$ */
5
6/* orig : i386 2.5.67 */
7
8#include <asm/ioctl.h> 4#include <asm/ioctl.h>
9 5
10/* 0x54 is just a magic number to make these relatively unique ('T') */ 6/* 0x54 is just a magic number to make these relatively unique ('T') */
@@ -85,4 +81,3 @@
85#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ 81#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
86 82
87#endif /* __ARCH_M32R_IOCTLS_H__ */ 83#endif /* __ARCH_M32R_IOCTLS_H__ */
88
diff --git a/include/asm-m32r/ipcbuf.h b/include/asm-m32r/ipcbuf.h
index 7c77fb0b1467..8d2d7c8ffdb0 100644
--- a/include/asm-m32r/ipcbuf.h
+++ b/include/asm-m32r/ipcbuf.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_M32R_IPCBUF_H 1#ifndef _ASM_M32R_IPCBUF_H
2#define _ASM_M32R_IPCBUF_H 2#define _ASM_M32R_IPCBUF_H
3 3
4/* $Id$ */
5
6/* orig : i386 2.4.18 */
7
8/* 4/*
9 * The ipc64_perm structure for m32r architecture. 5 * The ipc64_perm structure for m32r architecture.
10 * Note extra padding because this structure is passed back and forth 6 * Note extra padding because this structure is passed back and forth
diff --git a/include/asm-m32r/kmap_types.h b/include/asm-m32r/kmap_types.h
index 0524d89edb0f..fa94dc6410ea 100644
--- a/include/asm-m32r/kmap_types.h
+++ b/include/asm-m32r/kmap_types.h
@@ -1,9 +1,6 @@
1#ifndef __M32R_KMAP_TYPES_H 1#ifndef __M32R_KMAP_TYPES_H
2#define __M32R_KMAP_TYPES_H 2#define __M32R_KMAP_TYPES_H
3 3
4/* Dummy header just to define km_type. */
5
6
7#ifdef CONFIG_DEBUG_HIGHMEM 4#ifdef CONFIG_DEBUG_HIGHMEM
8# define D(n) __KM_FENCE_##n , 5# define D(n) __KM_FENCE_##n ,
9#else 6#else
@@ -30,4 +27,3 @@ D(13) KM_TYPE_NR
30#undef D 27#undef D
31 28
32#endif /* __M32R_KMAP_TYPES_H */ 29#endif /* __M32R_KMAP_TYPES_H */
33
diff --git a/include/asm-m32r/m32104ut/m32104ut_pld.h b/include/asm-m32r/m32104ut/m32104ut_pld.h
index cbdbc5891445..2dc89d68b6d9 100644
--- a/include/asm-m32r/m32104ut/m32104ut_pld.h
+++ b/include/asm-m32r/m32104ut/m32104ut_pld.h
@@ -1,3 +1,6 @@
1#ifndef _M32104UT_M32104UT_PLD_H
2#define _M32104UT_M32104UT_PLD_H
3
1/* 4/*
2 * include/asm-m32r/m32104ut/m32104ut_pld.h 5 * include/asm-m32r/m32104ut/m32104ut_pld.h
3 * 6 *
@@ -12,10 +15,6 @@
12 * this archive for more details. 15 * this archive for more details.
13 */ 16 */
14 17
15#ifndef _M32104UT_M32104UT_PLD_H
16#define _M32104UT_M32104UT_PLD_H
17
18
19#if defined(CONFIG_PLAT_M32104UT) 18#if defined(CONFIG_PLAT_M32104UT)
20#define PLD_PLAT_BASE 0x02c00000 19#define PLD_PLAT_BASE 0x02c00000
21#else 20#else
@@ -35,7 +34,7 @@
35#define __reg8 34#define __reg8
36#define __reg16 35#define __reg16
37#define __reg32 36#define __reg32
38#endif /* __ASSEMBLY__ */ 37#endif /* __ASSEMBLY__ */
39 38
40/* CFC */ 39/* CFC */
41#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000) 40#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000)
@@ -159,4 +158,4 @@
159#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c) 158#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c)
160#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e) 159#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e)
161 160
162#endif /* _M32104UT_M32104UT_PLD_H */ 161#endif /* _M32104UT_M32104UT_PLD_H */
diff --git a/include/asm-m32r/m32700ut/m32700ut_lan.h b/include/asm-m32r/m32700ut/m32700ut_lan.h
index f1e47ae1f891..aae810a4fb2c 100644
--- a/include/asm-m32r/m32700ut/m32700ut_lan.h
+++ b/include/asm-m32r/m32700ut/m32700ut_lan.h
@@ -1,3 +1,6 @@
1#ifndef _M32700UT_M32700UT_LAN_H
2#define _M32700UT_M32700UT_LAN_H
3
1/* 4/*
2 * include/asm-m32r/m32700ut/m32700ut_lan.h 5 * include/asm-m32r/m32700ut/m32700ut_lan.h
3 * 6 *
@@ -8,14 +11,8 @@
8 * This file is subject to the terms and conditions of the GNU General 11 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file "COPYING" in the main directory of 12 * Public License. See the file "COPYING" in the main directory of
10 * this archive for more details. 13 * this archive for more details.
11 *
12 * $Id$
13 */ 14 */
14 15
15#ifndef _M32700UT_M32700UT_LAN_H
16#define _M32700UT_M32700UT_LAN_H
17
18
19#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
20/* 17/*
21 * C functions use non-cache address. 18 * C functions use non-cache address.
@@ -23,7 +20,7 @@
23#define M32700UT_LAN_BASE (0x10000000 /* + NONCACHE_OFFSET */) 20#define M32700UT_LAN_BASE (0x10000000 /* + NONCACHE_OFFSET */)
24#else 21#else
25#define M32700UT_LAN_BASE (0x10000000 + NONCACHE_OFFSET) 22#define M32700UT_LAN_BASE (0x10000000 + NONCACHE_OFFSET)
26#endif /* __ASSEMBLY__ */ 23#endif /* __ASSEMBLY__ */
27 24
28/* ICU 25/* ICU
29 * ICUISTS: status register 26 * ICUISTS: status register
@@ -103,4 +100,4 @@
103#define PLDI2CSTS_BB 0x00000010 100#define PLDI2CSTS_BB 0x00000010
104#define PLDI2CSTS_NOACK 0x00000001 /* 0:ack, 1:noack */ 101#define PLDI2CSTS_NOACK 0x00000001 /* 0:ack, 1:noack */
105 102
106#endif /* _M32700UT_M32700UT_LAN_H */ 103#endif /* _M32700UT_M32700UT_LAN_H */
diff --git a/include/asm-m32r/m32700ut/m32700ut_lcd.h b/include/asm-m32r/m32700ut/m32700ut_lcd.h
index e41c4aa48b4c..4c2489079788 100644
--- a/include/asm-m32r/m32700ut/m32700ut_lcd.h
+++ b/include/asm-m32r/m32700ut/m32700ut_lcd.h
@@ -1,3 +1,6 @@
1#ifndef _M32700UT_M32700UT_LCD_H
2#define _M32700UT_M32700UT_LCD_H
3
1/* 4/*
2 * include/asm-m32r/m32700ut/m32700ut_lcd.h 5 * include/asm-m32r/m32700ut/m32700ut_lcd.h
3 * 6 *
@@ -8,14 +11,8 @@
8 * This file is subject to the terms and conditions of the GNU General 11 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file "COPYING" in the main directory of 12 * Public License. See the file "COPYING" in the main directory of
10 * this archive for more details. 13 * this archive for more details.
11 *
12 * $Id$
13 */ 14 */
14 15
15#ifndef _M32700UT_M32700UT_LCD_H
16#define _M32700UT_M32700UT_LCD_H
17
18
19#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
20/* 17/*
21 * C functions use non-cache address. 18 * C functions use non-cache address.
@@ -23,7 +20,7 @@
23#define M32700UT_LCD_BASE (0x10000000 /* + NONCACHE_OFFSET */) 20#define M32700UT_LCD_BASE (0x10000000 /* + NONCACHE_OFFSET */)
24#else 21#else
25#define M32700UT_LCD_BASE (0x10000000 + NONCACHE_OFFSET) 22#define M32700UT_LCD_BASE (0x10000000 + NONCACHE_OFFSET)
26#endif /* __ASSEMBLY__ */ 23#endif /* __ASSEMBLY__ */
27 24
28/* 25/*
29 * ICU 26 * ICU
@@ -55,4 +52,4 @@
55#define M32700UT_LCD_ICUCR19 __reg16(M32700UT_LCD_BASE + 0x300036) 52#define M32700UT_LCD_ICUCR19 __reg16(M32700UT_LCD_BASE + 0x300036)
56#define M32700UT_LCD_ICUCR21 __reg16(M32700UT_LCD_BASE + 0x30003a) 53#define M32700UT_LCD_ICUCR21 __reg16(M32700UT_LCD_BASE + 0x30003a)
57 54
58#endif /* _M32700UT_M32700UT_LCD_H */ 55#endif /* _M32700UT_M32700UT_LCD_H */
diff --git a/include/asm-m32r/m32700ut/m32700ut_pld.h b/include/asm-m32r/m32700ut/m32700ut_pld.h
index a48c22c978ca..d39121279a1a 100644
--- a/include/asm-m32r/m32700ut/m32700ut_pld.h
+++ b/include/asm-m32r/m32700ut/m32700ut_pld.h
@@ -1,3 +1,6 @@
1#ifndef _M32700UT_M32700UT_PLD_H
2#define _M32700UT_M32700UT_PLD_H
3
1/* 4/*
2 * include/asm-m32r/m32700ut/m32700ut_pld.h 5 * include/asm-m32r/m32700ut/m32700ut_pld.h
3 * 6 *
@@ -8,14 +11,8 @@
8 * This file is subject to the terms and conditions of the GNU General 11 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file "COPYING" in the main directory of 12 * Public License. See the file "COPYING" in the main directory of
10 * this archive for more details. 13 * this archive for more details.
11 *
12 * $Id$
13 */ 14 */
14 15
15#ifndef _M32700UT_M32700UT_PLD_H
16#define _M32700UT_M32700UT_PLD_H
17
18
19#if defined(CONFIG_PLAT_M32700UT_Alpha) 16#if defined(CONFIG_PLAT_M32700UT_Alpha)
20#define PLD_PLAT_BASE 0x08c00000 17#define PLD_PLAT_BASE 0x08c00000
21#elif defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) 18#elif defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV)
@@ -37,7 +34,7 @@
37#define __reg8 34#define __reg8
38#define __reg16 35#define __reg16
39#define __reg32 36#define __reg32
40#endif /* __ASSEMBLY__ */ 37#endif /* __ASSEMBLY__ */
41 38
42/* CFC */ 39/* CFC */
43#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000) 40#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000)
@@ -261,4 +258,4 @@
261#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c) 258#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c)
262#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e) 259#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e)
263 260
264#endif /* _M32700UT_M32700UT_PLD.H */ 261#endif /* _M32700UT_M32700UT_PLD.H */
diff --git a/include/asm-m32r/mappi2/mappi2_pld.h b/include/asm-m32r/mappi2/mappi2_pld.h
index 56a2b12f2bfc..2624c9db7255 100644
--- a/include/asm-m32r/mappi2/mappi2_pld.h
+++ b/include/asm-m32r/mappi2/mappi2_pld.h
@@ -1,18 +1,17 @@
1#ifndef _MAPPI2_PLD_H
2#define _MAPPI2_PLD_H
3
1/* 4/*
2 * include/asm-m32r/mappi2/mappi2_pld.h 5 * include/asm-m32r/mappi2/mappi2_pld.h
3 * 6 *
4 * Definitions for Extended IO Logic on MAPPI2 board. 7 * Definitions for Extended IO Logic on MAPPI2 board.
5 * based on m32700ut_pld.h by 8 * based on m32700ut_pld.h
6 * 9 *
7 * This file is subject to the terms and conditions of the GNU General 10 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file "COPYING" in the main directory of 11 * Public License. See the file "COPYING" in the main directory of
9 * this archive for more details. 12 * this archive for more details.
10 *
11 */ 13 */
12 14
13#ifndef _MAPPI2_PLD_H
14#define _MAPPI2_PLD_H
15
16#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
17/* FIXME: 16/* FIXME:
18 * Some C functions use non-cache address, so can't define non-cache address. 17 * Some C functions use non-cache address, so can't define non-cache address.
@@ -26,7 +25,7 @@
26#define __reg8 25#define __reg8
27#define __reg16 26#define __reg16
28#define __reg32 27#define __reg32
29#endif /* __ASSEMBLY__ */ 28#endif /* __ASSEMBLY__ */
30 29
31/* CFC */ 30/* CFC */
32#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000) 31#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000)
@@ -148,4 +147,4 @@
148 147
149#endif 148#endif
150 149
151#endif /* _MAPPI2_PLD.H */ 150#endif /* _MAPPI2_PLD.H */
diff --git a/include/asm-m32r/mappi3/mappi3_pld.h b/include/asm-m32r/mappi3/mappi3_pld.h
index 92f10defaef8..451c40ee70af 100644
--- a/include/asm-m32r/mappi3/mappi3_pld.h
+++ b/include/asm-m32r/mappi3/mappi3_pld.h
@@ -1,3 +1,6 @@
1#ifndef _MAPPI3_PLD_H
2#define _MAPPI3_PLD_H
3
1/* 4/*
2 * include/asm-m32r/mappi3/mappi3_pld.h 5 * include/asm-m32r/mappi3/mappi3_pld.h
3 * 6 *
@@ -7,12 +10,8 @@
7 * This file is subject to the terms and conditions of the GNU General 10 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file "COPYING" in the main directory of 11 * Public License. See the file "COPYING" in the main directory of
9 * this archive for more details. 12 * this archive for more details.
10 *
11 */ 13 */
12 14
13#ifndef _MAPPI3_PLD_H
14#define _MAPPI3_PLD_H
15
16#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
17/* FIXME: 16/* FIXME:
18 * Some C functions use non-cache address, so can't define non-cache address. 17 * Some C functions use non-cache address, so can't define non-cache address.
@@ -26,7 +25,7 @@
26#define __reg8 25#define __reg8
27#define __reg16 26#define __reg16
28#define __reg32 27#define __reg32
29#endif /* __ASSEMBLY__ */ 28#endif /* __ASSEMBLY__ */
30 29
31/* CFC */ 30/* CFC */
32#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000) 31#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000)
@@ -140,4 +139,4 @@
140/* Reset Control */ 139/* Reset Control */
141#define PLD_REBOOT __reg16(PLD_BASE + 0x38000) 140#define PLD_REBOOT __reg16(PLD_BASE + 0x38000)
142 141
143#endif /* _MAPPI3_PLD.H */ 142#endif /* _MAPPI3_PLD.H */
diff --git a/include/asm-m32r/mc146818rtc.h b/include/asm-m32r/mc146818rtc.h
index 755601d053cc..aa1b7bf84f51 100644
--- a/include/asm-m32r/mc146818rtc.h
+++ b/include/asm-m32r/mc146818rtc.h
@@ -7,7 +7,6 @@
7#include <asm/io.h> 7#include <asm/io.h>
8 8
9#ifndef RTC_PORT 9#ifndef RTC_PORT
10// #define RTC_PORT(x) (0x70 + (x))
11#define RTC_PORT(x) ((x)) 10#define RTC_PORT(x) ((x))
12#define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */ 11#define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */
13#endif 12#endif
@@ -26,7 +25,5 @@ outb_p((val),RTC_PORT(1)); \
26}) 25})
27 26
28#define RTC_IRQ 8 27#define RTC_IRQ 8
29#if 0
30#endif
31 28
32#endif /* _ASM_MC146818RTC_H */ 29#endif /* _ASM_MC146818RTC_H */
diff --git a/include/asm-m32r/mman.h b/include/asm-m32r/mman.h
index 695a860c024f..516a8973b130 100644
--- a/include/asm-m32r/mman.h
+++ b/include/asm-m32r/mman.h
@@ -3,8 +3,6 @@
3 3
4#include <asm-generic/mman.h> 4#include <asm-generic/mman.h>
5 5
6/* orig : i386 2.6.0-test6 */
7
8#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ 6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
9#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ 7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
10#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ 8#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
diff --git a/include/asm-m32r/mmu.h b/include/asm-m32r/mmu.h
index cf3f6d78ac66..d9bd724479cf 100644
--- a/include/asm-m32r/mmu.h
+++ b/include/asm-m32r/mmu.h
@@ -1,13 +1,14 @@
1#ifndef _ASM_M32R_MMU_H 1#ifndef _ASM_M32R_MMU_H
2#define _ASM_M32R_MMU_H 2#define _ASM_M32R_MMU_H
3 3
4
5#if !defined(CONFIG_MMU) 4#if !defined(CONFIG_MMU)
5
6typedef struct { 6typedef struct {
7 struct vm_list_struct *vmlist; 7 struct vm_list_struct *vmlist;
8 unsigned long end_brk; 8 unsigned long end_brk;
9} mm_context_t; 9} mm_context_t;
10#else 10
11#else /* CONFIG_MMU */
11 12
12/* Default "unsigned long" context */ 13/* Default "unsigned long" context */
13#ifndef CONFIG_SMP 14#ifndef CONFIG_SMP
@@ -16,5 +17,6 @@ typedef unsigned long mm_context_t;
16typedef unsigned long mm_context_t[NR_CPUS]; 17typedef unsigned long mm_context_t[NR_CPUS];
17#endif 18#endif
18 19
19#endif /* CONFIG_MMU */ 20#endif /* CONFIG_MMU */
20#endif /* _ASM_M32R_MMU_H */ 21
22#endif /* _ASM_M32R_MMU_H */
diff --git a/include/asm-m32r/mmu_context.h b/include/asm-m32r/mmu_context.h
index 542302eb6bcb..1f40d4a0acf1 100644
--- a/include/asm-m32r/mmu_context.h
+++ b/include/asm-m32r/mmu_context.h
@@ -1,9 +1,7 @@
1#ifndef _ASM_M32R_MMU_CONTEXT_H 1#ifndef _ASM_M32R_MMU_CONTEXT_H
2#define _ASM_M32R_MMU_CONTEXT_H 2#define _ASM_M32R_MMU_CONTEXT_H
3
4#ifdef __KERNEL__ 3#ifdef __KERNEL__
5 4
6
7#include <asm/m32r.h> 5#include <asm/m32r.h>
8 6
9#define MMU_CONTEXT_ASID_MASK (0x000000FF) 7#define MMU_CONTEXT_ASID_MASK (0x000000FF)
@@ -11,7 +9,6 @@
11#define MMU_CONTEXT_FIRST_VERSION (0x00000100) 9#define MMU_CONTEXT_FIRST_VERSION (0x00000100)
12#define NO_CONTEXT (0x00000000) 10#define NO_CONTEXT (0x00000000)
13 11
14
15#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
16 13
17#include <asm/atomic.h> 14#include <asm/atomic.h>
@@ -147,7 +144,7 @@ static inline void switch_mm(struct mm_struct *prev,
147#define activate_mm(prev, next) \ 144#define activate_mm(prev, next) \
148 switch_mm((prev), (next), NULL) 145 switch_mm((prev), (next), NULL)
149 146
150#else 147#else /* not CONFIG_MMU */
151#define get_mmu_context(mm) do { } while (0) 148#define get_mmu_context(mm) do { } while (0)
152#define init_new_context(tsk,mm) (0) 149#define init_new_context(tsk,mm) (0)
153#define destroy_context(mm) do { } while (0) 150#define destroy_context(mm) do { } while (0)
@@ -158,11 +155,9 @@ static inline void switch_mm(struct mm_struct *prev,
158#define deactivate_mm(mm,tsk) do { } while (0) 155#define deactivate_mm(mm,tsk) do { } while (0)
159#define activate_mm(prev,next) do { } while (0) 156#define activate_mm(prev,next) do { } while (0)
160#define enter_lazy_tlb(mm,tsk) do { } while (0) 157#define enter_lazy_tlb(mm,tsk) do { } while (0)
161#endif /* CONFIG_MMU */ 158#endif /* not CONFIG_MMU */
162
163 159
164#endif /* not __ASSEMBLY__ */ 160#endif /* not __ASSEMBLY__ */
165 161
166#endif /* __KERNEL__ */ 162#endif /* __KERNEL__ */
167
168#endif /* _ASM_M32R_MMU_CONTEXT_H */ 163#endif /* _ASM_M32R_MMU_CONTEXT_H */
diff --git a/include/asm-m32r/module.h b/include/asm-m32r/module.h
index 3f2541c92a7b..eb73ee011215 100644
--- a/include/asm-m32r/module.h
+++ b/include/asm-m32r/module.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_MODULE_H 1#ifndef _ASM_M32R_MODULE_H
2#define _ASM_M32R_MODULE_H 2#define _ASM_M32R_MODULE_H
3 3
4/* $Id$ */
5
6struct mod_arch_specific { }; 4struct mod_arch_specific { };
7 5
8#define Elf_Shdr Elf32_Shdr 6#define Elf_Shdr Elf32_Shdr
@@ -10,4 +8,3 @@ struct mod_arch_specific { };
10#define Elf_Ehdr Elf32_Ehdr 8#define Elf_Ehdr Elf32_Ehdr
11 9
12#endif /* _ASM_M32R_MODULE_H */ 10#endif /* _ASM_M32R_MODULE_H */
13
diff --git a/include/asm-m32r/msgbuf.h b/include/asm-m32r/msgbuf.h
index 852ff52af4c2..0d5a877b813e 100644
--- a/include/asm-m32r/msgbuf.h
+++ b/include/asm-m32r/msgbuf.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_M32R_MSGBUF_H 1#ifndef _ASM_M32R_MSGBUF_H
2#define _ASM_M32R_MSGBUF_H 2#define _ASM_M32R_MSGBUF_H
3 3
4/* $Id$ */
5
6/* orig : i386 2.4.18 */
7
8/* 4/*
9 * The msqid64_ds structure for m32r architecture. 5 * The msqid64_ds structure for m32r architecture.
10 * Note extra padding because this structure is passed back and forth 6 * Note extra padding because this structure is passed back and forth
diff --git a/include/asm-m32r/namei.h b/include/asm-m32r/namei.h
index 7172d3d2e260..210f8056b805 100644
--- a/include/asm-m32r/namei.h
+++ b/include/asm-m32r/namei.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_M32R_NAMEI_H 1#ifndef _ASM_M32R_NAMEI_H
2#define _ASM_M32R_NAMEI_H 2#define _ASM_M32R_NAMEI_H
3 3
4/* $Id$ */
5
6/* orig : i386 2.4.18 */
7
8/* 4/*
9 * linux/include/asm-m32r/namei.h 5 * linux/include/asm-m32r/namei.h
10 * 6 *
diff --git a/include/asm-m32r/opsput/opsput_lan.h b/include/asm-m32r/opsput/opsput_lan.h
index f53e10187c03..a5f18dd1ab20 100644
--- a/include/asm-m32r/opsput/opsput_lan.h
+++ b/include/asm-m32r/opsput/opsput_lan.h
@@ -1,3 +1,6 @@
1#ifndef _OPSPUT_OPSPUT_LAN_H
2#define _OPSPUT_OPSPUT_LAN_H
3
1/* 4/*
2 * include/asm-m32r/opsput/opsput_lan.h 5 * include/asm-m32r/opsput/opsput_lan.h
3 * 6 *
@@ -8,14 +11,8 @@
8 * This file is subject to the terms and conditions of the GNU General 11 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file "COPYING" in the main directory of 12 * Public License. See the file "COPYING" in the main directory of
10 * this archive for more details. 13 * this archive for more details.
11 *
12 * $Id: opsput_lan.h,v 1.1 2004/07/27 06:54:20 sakugawa Exp $
13 */ 14 */
14 15
15#ifndef _OPSPUT_OPSPUT_LAN_H
16#define _OPSPUT_OPSPUT_LAN_H
17
18
19#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
20/* 17/*
21 * C functions use non-cache address. 18 * C functions use non-cache address.
@@ -23,7 +20,7 @@
23#define OPSPUT_LAN_BASE (0x10000000 /* + NONCACHE_OFFSET */) 20#define OPSPUT_LAN_BASE (0x10000000 /* + NONCACHE_OFFSET */)
24#else 21#else
25#define OPSPUT_LAN_BASE (0x10000000 + NONCACHE_OFFSET) 22#define OPSPUT_LAN_BASE (0x10000000 + NONCACHE_OFFSET)
26#endif /* __ASSEMBLY__ */ 23#endif /* __ASSEMBLY__ */
27 24
28/* ICU 25/* ICU
29 * ICUISTS: status register 26 * ICUISTS: status register
@@ -52,4 +49,4 @@
52#define OPSPUT_LAN_ICUCR1 __reg16(OPSPUT_LAN_BASE + 0xc0010) 49#define OPSPUT_LAN_ICUCR1 __reg16(OPSPUT_LAN_BASE + 0xc0010)
53#define OPSPUT_LAN_ICUCR3 __reg16(OPSPUT_LAN_BASE + 0xc0014) 50#define OPSPUT_LAN_ICUCR3 __reg16(OPSPUT_LAN_BASE + 0xc0014)
54 51
55#endif /* _OPSPUT_OPSPUT_LAN_H */ 52#endif /* _OPSPUT_OPSPUT_LAN_H */
diff --git a/include/asm-m32r/opsput/opsput_lcd.h b/include/asm-m32r/opsput/opsput_lcd.h
index 99f296e1b61b..369c9f0832a6 100644
--- a/include/asm-m32r/opsput/opsput_lcd.h
+++ b/include/asm-m32r/opsput/opsput_lcd.h
@@ -1,3 +1,6 @@
1#ifndef _OPSPUT_OPSPUT_LCD_H
2#define _OPSPUT_OPSPUT_LCD_H
3
1/* 4/*
2 * include/asm-m32r/opsput/opsput_lcd.h 5 * include/asm-m32r/opsput/opsput_lcd.h
3 * 6 *
@@ -8,14 +11,8 @@
8 * This file is subject to the terms and conditions of the GNU General 11 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file "COPYING" in the main directory of 12 * Public License. See the file "COPYING" in the main directory of
10 * this archive for more details. 13 * this archive for more details.
11 *
12 * $Id: opsput_lcd.h,v 1.1 2004/07/27 06:54:20 sakugawa Exp $
13 */ 14 */
14 15
15#ifndef _OPSPUT_OPSPUT_LCD_H
16#define _OPSPUT_OPSPUT_LCD_H
17
18
19#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
20/* 17/*
21 * C functions use non-cache address. 18 * C functions use non-cache address.
@@ -23,7 +20,7 @@
23#define OPSPUT_LCD_BASE (0x10000000 /* + NONCACHE_OFFSET */) 20#define OPSPUT_LCD_BASE (0x10000000 /* + NONCACHE_OFFSET */)
24#else 21#else
25#define OPSPUT_LCD_BASE (0x10000000 + NONCACHE_OFFSET) 22#define OPSPUT_LCD_BASE (0x10000000 + NONCACHE_OFFSET)
26#endif /* __ASSEMBLY__ */ 23#endif /* __ASSEMBLY__ */
27 24
28/* 25/*
29 * ICU 26 * ICU
@@ -55,4 +52,4 @@
55#define OPSPUT_LCD_ICUCR19 __reg16(OPSPUT_LCD_BASE + 0x300036) 52#define OPSPUT_LCD_ICUCR19 __reg16(OPSPUT_LCD_BASE + 0x300036)
56#define OPSPUT_LCD_ICUCR21 __reg16(OPSPUT_LCD_BASE + 0x30003a) 53#define OPSPUT_LCD_ICUCR21 __reg16(OPSPUT_LCD_BASE + 0x30003a)
57 54
58#endif /* _OPSPUT_OPSPUT_LCD_H */ 55#endif /* _OPSPUT_OPSPUT_LCD_H */
diff --git a/include/asm-m32r/opsput/opsput_pld.h b/include/asm-m32r/opsput/opsput_pld.h
index a8d6452076f1..3f11ea1aac2d 100644
--- a/include/asm-m32r/opsput/opsput_pld.h
+++ b/include/asm-m32r/opsput/opsput_pld.h
@@ -1,3 +1,6 @@
1#ifndef _OPSPUT_OPSPUT_PLD_H
2#define _OPSPUT_OPSPUT_PLD_H
3
1/* 4/*
2 * include/asm-m32r/opsput/opsput_pld.h 5 * include/asm-m32r/opsput/opsput_pld.h
3 * 6 *
@@ -8,14 +11,8 @@
8 * This file is subject to the terms and conditions of the GNU General 11 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file "COPYING" in the main directory of 12 * Public License. See the file "COPYING" in the main directory of
10 * this archive for more details. 13 * this archive for more details.
11 *
12 * $Id: opsput_pld.h,v 1.1 2004/07/27 06:54:20 sakugawa Exp $
13 */ 14 */
14 15
15#ifndef _OPSPUT_OPSPUT_PLD_H
16#define _OPSPUT_OPSPUT_PLD_H
17
18
19#define PLD_PLAT_BASE 0x1cc00000 16#define PLD_PLAT_BASE 0x1cc00000
20 17
21#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
@@ -31,7 +28,7 @@
31#define __reg8 28#define __reg8
32#define __reg16 29#define __reg16
33#define __reg32 30#define __reg32
34#endif /* __ASSEMBLY__ */ 31#endif /* __ASSEMBLY__ */
35 32
36/* CFC */ 33/* CFC */
37#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000) 34#define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000)
@@ -255,4 +252,4 @@
255#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c) 252#define PLD_SCTXB __reg16(PLD_BASE + 0x3800c)
256#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e) 253#define PLD_SCRXB __reg16(PLD_BASE + 0x3800e)
257 254
258#endif /* _OPSPUT_OPSPUT_PLD.H */ 255#endif /* _OPSPUT_OPSPUT_PLD.H */
diff --git a/include/asm-m32r/page.h b/include/asm-m32r/page.h
index 404a4c24007b..6f6ecf7d14a3 100644
--- a/include/asm-m32r/page.h
+++ b/include/asm-m32r/page.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_M32R_PAGE_H 1#ifndef _ASM_M32R_PAGE_H
2#define _ASM_M32R_PAGE_H 2#define _ASM_M32R_PAGE_H
3 3
4
5/* PAGE_SHIFT determines the page size */ 4/* PAGE_SHIFT determines the page size */
6#define PAGE_SHIFT 12 5#define PAGE_SHIFT 12
7#define PAGE_SIZE (1UL << PAGE_SHIFT) 6#define PAGE_SIZE (1UL << PAGE_SHIFT)
@@ -57,9 +56,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
57 * and CONFIG_HIGHMEM64G options in the kernel configuration. 56 * and CONFIG_HIGHMEM64G options in the kernel configuration.
58 */ 57 */
59 58
60
61/* This handles the memory map.. */
62
63#define __MEMORY_START CONFIG_MEMORY_START 59#define __MEMORY_START CONFIG_MEMORY_START
64#define __MEMORY_SIZE CONFIG_MEMORY_SIZE 60#define __MEMORY_SIZE CONFIG_MEMORY_SIZE
65 61
@@ -92,4 +88,3 @@ typedef struct { unsigned long pgprot; } pgprot_t;
92 88
93#endif /* __KERNEL__ */ 89#endif /* __KERNEL__ */
94#endif /* _ASM_M32R_PAGE_H */ 90#endif /* _ASM_M32R_PAGE_H */
95
diff --git a/include/asm-m32r/param.h b/include/asm-m32r/param.h
index 750b938ccb52..3e14026e39cd 100644
--- a/include/asm-m32r/param.h
+++ b/include/asm-m32r/param.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_M32R_PARAM_H 1#ifndef _ASM_M32R_PARAM_H
2#define _ASM_M32R_PARAM_H 2#define _ASM_M32R_PARAM_H
3 3
4/* $Id$ */
5
6/* orig : i386 2.5.67 */
7
8#ifdef __KERNEL__ 4#ifdef __KERNEL__
9# define HZ 100 /* Internal kernel timer frequency */ 5# define HZ 100 /* Internal kernel timer frequency */
10# define USER_HZ 100 /* .. some user interfaces are in "ticks" */ 6# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
diff --git a/include/asm-m32r/pci.h b/include/asm-m32r/pci.h
index 00d7b6f39a33..fe785d167db6 100644
--- a/include/asm-m32r/pci.h
+++ b/include/asm-m32r/pci.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_PCI_H 1#ifndef _ASM_M32R_PCI_H
2#define _ASM_M32R_PCI_H 2#define _ASM_M32R_PCI_H
3 3
4/* $Id$ */
5
6#include <asm-generic/pci.h> 4#include <asm-generic/pci.h>
7 5
8#define PCI_DMA_BUS_IS_PHYS (1) 6#define PCI_DMA_BUS_IS_PHYS (1)
diff --git a/include/asm-m32r/pgalloc.h b/include/asm-m32r/pgalloc.h
index e09a86c3cadf..943ba63c1ebc 100644
--- a/include/asm-m32r/pgalloc.h
+++ b/include/asm-m32r/pgalloc.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_PGALLOC_H 1#ifndef _ASM_M32R_PGALLOC_H
2#define _ASM_M32R_PGALLOC_H 2#define _ASM_M32R_PGALLOC_H
3 3
4/* $Id$ */
5
6#include <linux/mm.h> 4#include <linux/mm.h>
7 5
8#include <asm/io.h> 6#include <asm/io.h>
@@ -74,4 +72,3 @@ static __inline__ void pte_free(struct page *pte)
74#define check_pgt_cache() do { } while (0) 72#define check_pgt_cache() do { } while (0)
75 73
76#endif /* _ASM_M32R_PGALLOC_H */ 74#endif /* _ASM_M32R_PGALLOC_H */
77
diff --git a/include/asm-m32r/pgtable-2level.h b/include/asm-m32r/pgtable-2level.h
index 84152760e0b5..750925726a10 100644
--- a/include/asm-m32r/pgtable-2level.h
+++ b/include/asm-m32r/pgtable-2level.h
@@ -1,9 +1,7 @@
1#ifndef _ASM_M32R_PGTABLE_2LEVEL_H 1#ifndef _ASM_M32R_PGTABLE_2LEVEL_H
2#define _ASM_M32R_PGTABLE_2LEVEL_H 2#define _ASM_M32R_PGTABLE_2LEVEL_H
3
4#ifdef __KERNEL__ 3#ifdef __KERNEL__
5 4
6
7/* 5/*
8 * traditional M32R two-level paging structure: 6 * traditional M32R two-level paging structure:
9 */ 7 */
@@ -77,5 +75,4 @@ static inline pmd_t *pmd_offset(pgd_t * dir, unsigned long address)
77#define pgoff_to_pte(off) ((pte_t) { (((off) & 0xef) << 2) | (((off) >> 7) << 10) | _PAGE_FILE }) 75#define pgoff_to_pte(off) ((pte_t) { (((off) & 0xef) << 2) | (((off) >> 7) << 10) | _PAGE_FILE })
78 76
79#endif /* __KERNEL__ */ 77#endif /* __KERNEL__ */
80
81#endif /* _ASM_M32R_PGTABLE_2LEVEL_H */ 78#endif /* _ASM_M32R_PGTABLE_2LEVEL_H */
diff --git a/include/asm-m32r/posix_types.h b/include/asm-m32r/posix_types.h
index 47e7e85a3dc3..1caac65d208f 100644
--- a/include/asm-m32r/posix_types.h
+++ b/include/asm-m32r/posix_types.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_M32R_POSIX_TYPES_H 1#ifndef _ASM_M32R_POSIX_TYPES_H
2#define _ASM_M32R_POSIX_TYPES_H 2#define _ASM_M32R_POSIX_TYPES_H
3 3
4/* $Id$ */
5
6/* orig : i386, sh 2.4.18 */
7
8/* 4/*
9 * This file is generally used by user-level software, so you need to 5 * This file is generally used by user-level software, so you need to
10 * be a little careful about namespace pollution etc. Also, we cannot 6 * be a little careful about namespace pollution etc. Also, we cannot
diff --git a/include/asm-m32r/rtc.h b/include/asm-m32r/rtc.h
index 6b2b837c5978..0340633f3f4d 100644
--- a/include/asm-m32r/rtc.h
+++ b/include/asm-m32r/rtc.h
@@ -1,10 +1,6 @@
1/* $Id: rtc.h,v 1.1.1.1 2004/03/25 04:29:22 hitoshiy Exp $ */
2
3#ifndef __RTC_H__ 1#ifndef __RTC_H__
4#define __RTC_H__ 2#define __RTC_H__
5 3
6
7
8 /* Dallas DS1302 clock/calendar register numbers. */ 4 /* Dallas DS1302 clock/calendar register numbers. */
9# define RTC_SECONDS 0 5# define RTC_SECONDS 0
10# define RTC_MINUTES 1 6# define RTC_MINUTES 1
diff --git a/include/asm-m32r/scatterlist.h b/include/asm-m32r/scatterlist.h
index 09a10e43bf0f..c2de96cb69ed 100644
--- a/include/asm-m32r/scatterlist.h
+++ b/include/asm-m32r/scatterlist.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_SCATTERLIST_H 1#ifndef _ASM_M32R_SCATTERLIST_H
2#define _ASM_M32R_SCATTERLIST_H 2#define _ASM_M32R_SCATTERLIST_H
3 3
4/* $Id$ */
5
6struct scatterlist { 4struct scatterlist {
7 char * address; /* Location data is to be transferred to, NULL for 5 char * address; /* Location data is to be transferred to, NULL for
8 * highmem page */ 6 * highmem page */
diff --git a/include/asm-m32r/sections.h b/include/asm-m32r/sections.h
index 6b969e53b806..5e5d21c4908a 100644
--- a/include/asm-m32r/sections.h
+++ b/include/asm-m32r/sections.h
@@ -5,4 +5,3 @@
5#include <asm-generic/sections.h> 5#include <asm-generic/sections.h>
6 6
7#endif /* _M32R_SECTIONS_H */ 7#endif /* _M32R_SECTIONS_H */
8
diff --git a/include/asm-m32r/segment.h b/include/asm-m32r/segment.h
index e45db68e6c2d..42b11aeb3249 100644
--- a/include/asm-m32r/segment.h
+++ b/include/asm-m32r/segment.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_M32R_SEGMENT_H 1#ifndef _ASM_M32R_SEGMENT_H
2#define _ASM_M32R_SEGMENT_H 2#define _ASM_M32R_SEGMENT_H
3 3
4/* $Id$ */
5
6/* orig : i386 (2.4.18) */
7
8#define __KERNEL_CS 0x10 4#define __KERNEL_CS 0x10
9#define __KERNEL_DS 0x18 5#define __KERNEL_DS 0x18
10 6
diff --git a/include/asm-m32r/sembuf.h b/include/asm-m32r/sembuf.h
index e69018e6ff71..c9873d6890e2 100644
--- a/include/asm-m32r/sembuf.h
+++ b/include/asm-m32r/sembuf.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_M32R_SEMBUF_H 1#ifndef _ASM_M32R_SEMBUF_H
2#define _ASM_M32R_SEMBUF_H 2#define _ASM_M32R_SEMBUF_H
3 3
4/* $Id$ */
5
6/* orig : i386 2.4.18 */
7
8/* 4/*
9 * The semid64_ds structure for m32r architecture. 5 * The semid64_ds structure for m32r architecture.
10 * Note extra padding because this structure is passed back and forth 6 * Note extra padding because this structure is passed back and forth
diff --git a/include/asm-m32r/setup.h b/include/asm-m32r/setup.h
index 6a0b32202d4e..c637ab992394 100644
--- a/include/asm-m32r/setup.h
+++ b/include/asm-m32r/setup.h
@@ -1,3 +1,6 @@
1#ifndef _ASM_M32R_SETUP_H
2#define _ASM_M32R_SETUP_H
3
1/* 4/*
2 * This is set up by the setup-routine at boot-time 5 * This is set up by the setup-routine at boot-time
3 */ 6 */
@@ -32,3 +35,4 @@ extern unsigned long memory_end;
32 35
33#endif /* __KERNEL__ */ 36#endif /* __KERNEL__ */
34 37
38#endif /* _ASM_M32R_SETUP_H */
diff --git a/include/asm-m32r/shmbuf.h b/include/asm-m32r/shmbuf.h
index b84e897fa87b..b0cdf0aa7d65 100644
--- a/include/asm-m32r/shmbuf.h
+++ b/include/asm-m32r/shmbuf.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_M32R_SHMBUF_H 1#ifndef _ASM_M32R_SHMBUF_H
2#define _ASM_M32R_SHMBUF_H 2#define _ASM_M32R_SHMBUF_H
3 3
4/* $Id$ */
5
6/* orig : i386 2.4.18 */
7
8/* 4/*
9 * The shmid64_ds structure for M32R architecture. 5 * The shmid64_ds structure for M32R architecture.
10 * Note extra padding because this structure is passed back and forth 6 * Note extra padding because this structure is passed back and forth
diff --git a/include/asm-m32r/shmparam.h b/include/asm-m32r/shmparam.h
index db0019ba955d..35986d81a528 100644
--- a/include/asm-m32r/shmparam.h
+++ b/include/asm-m32r/shmparam.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_SHMPARAM_H 1#ifndef _ASM_M32R_SHMPARAM_H
2#define _ASM_M32R_SHMPARAM_H 2#define _ASM_M32R_SHMPARAM_H
3 3
4/* $Id$ */
5
6#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ 4#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
7 5
8#endif /* _ASM_M32R_SHMPARAM_H */ 6#endif /* _ASM_M32R_SHMPARAM_H */
diff --git a/include/asm-m32r/sigcontext.h b/include/asm-m32r/sigcontext.h
index 62537dc4dec9..da4a9c36d09b 100644
--- a/include/asm-m32r/sigcontext.h
+++ b/include/asm-m32r/sigcontext.h
@@ -1,9 +1,6 @@
1#ifndef _ASM_M32R_SIGCONTEXT_H 1#ifndef _ASM_M32R_SIGCONTEXT_H
2#define _ASM_M32R_SIGCONTEXT_H 2#define _ASM_M32R_SIGCONTEXT_H
3 3
4/* $Id$ */
5
6
7struct sigcontext { 4struct sigcontext {
8 /* CPU registers */ 5 /* CPU registers */
9 /* Saved main processor registers. */ 6 /* Saved main processor registers. */
diff --git a/include/asm-m32r/siginfo.h b/include/asm-m32r/siginfo.h
index 482202f2e77f..7d9cd9ebfd0e 100644
--- a/include/asm-m32r/siginfo.h
+++ b/include/asm-m32r/siginfo.h
@@ -1,8 +1,6 @@
1#ifndef _M32R_SIGINFO_H 1#ifndef _M32R_SIGINFO_H
2#define _M32R_SIGINFO_H 2#define _M32R_SIGINFO_H
3 3
4/* $Id$ */
5
6#include <asm-generic/siginfo.h> 4#include <asm-generic/siginfo.h>
7 5
8#endif /* _M32R_SIGINFO_H */ 6#endif /* _M32R_SIGINFO_H */
diff --git a/include/asm-m32r/signal.h b/include/asm-m32r/signal.h
index 65423bed32b1..937258686ba5 100644
--- a/include/asm-m32r/signal.h
+++ b/include/asm-m32r/signal.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_M32R_SIGNAL_H 1#ifndef _ASM_M32R_SIGNAL_H
2#define _ASM_M32R_SIGNAL_H 2#define _ASM_M32R_SIGNAL_H
3 3
4/* $Id$ */
5
6/* orig : i386 2.4.18 */
7
8#include <linux/types.h> 4#include <linux/types.h>
9#include <linux/time.h> 5#include <linux/time.h>
10#include <linux/compiler.h> 6#include <linux/compiler.h>
diff --git a/include/asm-m32r/smp.h b/include/asm-m32r/smp.h
index 650d2558c304..abd937ac5239 100644
--- a/include/asm-m32r/smp.h
+++ b/include/asm-m32r/smp.h
@@ -1,9 +1,6 @@
1#ifndef _ASM_M32R_SMP_H 1#ifndef _ASM_M32R_SMP_H
2#define _ASM_M32R_SMP_H 2#define _ASM_M32R_SMP_H
3 3
4/* $Id$ */
5
6
7#ifdef CONFIG_SMP 4#ifdef CONFIG_SMP
8#ifndef __ASSEMBLY__ 5#ifndef __ASSEMBLY__
9 6
diff --git a/include/asm-m32r/sockios.h b/include/asm-m32r/sockios.h
index 147a118442ac..f89962e231fe 100644
--- a/include/asm-m32r/sockios.h
+++ b/include/asm-m32r/sockios.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_SOCKIOS_H 1#ifndef _ASM_M32R_SOCKIOS_H
2#define _ASM_M32R_SOCKIOS_H 2#define _ASM_M32R_SOCKIOS_H
3 3
4/* $Id$ */
5
6/* Socket-level I/O control calls. */ 4/* Socket-level I/O control calls. */
7#define FIOSETOWN 0x8901 5#define FIOSETOWN 0x8901
8#define SIOCSPGRP 0x8902 6#define SIOCSPGRP 0x8902
diff --git a/include/asm-m32r/spinlock_types.h b/include/asm-m32r/spinlock_types.h
index 7e9941c45f40..83f52105c0e4 100644
--- a/include/asm-m32r/spinlock_types.h
+++ b/include/asm-m32r/spinlock_types.h
@@ -20,4 +20,4 @@ typedef struct {
20 20
21#define __RAW_RW_LOCK_UNLOCKED { RW_LOCK_BIAS } 21#define __RAW_RW_LOCK_UNLOCKED { RW_LOCK_BIAS }
22 22
23#endif 23#endif /* _ASM_M32R_SPINLOCK_TYPES_H */
diff --git a/include/asm-m32r/stat.h b/include/asm-m32r/stat.h
index 05748fef4c8e..da4518f82d6d 100644
--- a/include/asm-m32r/stat.h
+++ b/include/asm-m32r/stat.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_M32R_STAT_H 1#ifndef _ASM_M32R_STAT_H
2#define _ASM_M32R_STAT_H 2#define _ASM_M32R_STAT_H
3 3
4/* $Id$ */
5
6/* orig : i386 2.4.18 */
7
8#include <asm/byteorder.h> 4#include <asm/byteorder.h>
9 5
10struct __old_kernel_stat { 6struct __old_kernel_stat {
diff --git a/include/asm-m32r/string.h b/include/asm-m32r/string.h
index cb54bcc2e677..e61e2b0bfc1f 100644
--- a/include/asm-m32r/string.h
+++ b/include/asm-m32r/string.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_STRING_H 1#ifndef _ASM_M32R_STRING_H
2#define _ASM_M32R_STRING_H 2#define _ASM_M32R_STRING_H
3 3
4/* $Id$ */
5
6#define __HAVE_ARCH_STRLEN 4#define __HAVE_ARCH_STRLEN
7extern size_t strlen(const char * s); 5extern size_t strlen(const char * s);
8 6
diff --git a/include/asm-m32r/syscall.h b/include/asm-m32r/syscall.h
index d8d4b2c7a7d4..25f316f2b78d 100644
--- a/include/asm-m32r/syscall.h
+++ b/include/asm-m32r/syscall.h
@@ -1,11 +1,8 @@
1#ifndef _ASM_M32R_SYSCALL_H 1#ifndef _ASM_M32R_SYSCALL_H
2#define _ASM_M32R_SYSCALL_H 2#define _ASM_M32R_SYSCALL_H
3 3
4/* $Id$ */
5
6/* Definitions for the system call vector. */ 4/* Definitions for the system call vector. */
7#define SYSCALL_VECTOR "2" 5#define SYSCALL_VECTOR "2"
8#define SYSCALL_VECTOR_ADDRESS "0xa0" 6#define SYSCALL_VECTOR_ADDRESS "0xa0"
9 7
10#endif /* _ASM_M32R_SYSCALL_H */ 8#endif /* _ASM_M32R_SYSCALL_H */
11
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h
index 4ce0619f6989..99ee09889ff7 100644
--- a/include/asm-m32r/system.h
+++ b/include/asm-m32r/system.h
@@ -339,4 +339,4 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
339 339
340#define arch_align_stack(x) (x) 340#define arch_align_stack(x) (x)
341 341
342#endif /* _ASM_M32R_SYSTEM_H */ 342#endif /* _ASM_M32R_SYSTEM_H */
diff --git a/include/asm-m32r/termbits.h b/include/asm-m32r/termbits.h
index faf2bd0504c1..e402641dfbad 100644
--- a/include/asm-m32r/termbits.h
+++ b/include/asm-m32r/termbits.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_TERMBITS_H 1#ifndef _ASM_M32R_TERMBITS_H
2#define _ASM_M32R_TERMBITS_H 2#define _ASM_M32R_TERMBITS_H
3 3
4/* $Id$ */
5
6#include <linux/posix_types.h> 4#include <linux/posix_types.h>
7 5
8typedef unsigned char cc_t; 6typedef unsigned char cc_t;
@@ -184,4 +182,4 @@ struct ktermios {
184#define TCSADRAIN 1 182#define TCSADRAIN 1
185#define TCSAFLUSH 2 183#define TCSAFLUSH 2
186 184
187#endif /* _ASM_M32R_TERMBITS_H */ 185#endif /* _ASM_M32R_TERMBITS_H */
diff --git a/include/asm-m32r/termios.h b/include/asm-m32r/termios.h
index fc99d2e178d8..4943dd8db44d 100644
--- a/include/asm-m32r/termios.h
+++ b/include/asm-m32r/termios.h
@@ -1,8 +1,6 @@
1#ifndef _M32R_TERMIOS_H 1#ifndef _M32R_TERMIOS_H
2#define _M32R_TERMIOS_H 2#define _M32R_TERMIOS_H
3 3
4/* orig : i386 2.6.0-test5 */
5
6#include <asm/termbits.h> 4#include <asm/termbits.h>
7#include <asm/ioctls.h> 5#include <asm/ioctls.h>
8 6
@@ -41,24 +39,6 @@ struct termio {
41 39
42/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 40/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
43 41
44/* line disciplines */
45#define N_TTY 0
46#define N_SLIP 1
47#define N_MOUSE 2
48#define N_PPP 3
49#define N_STRIP 4
50#define N_AX25 5
51#define N_X25 6 /* X.25 async */
52#define N_6PACK 7
53#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
54#define N_R3964 9 /* Reserved for Simatic R3964 module */
55#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
56#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
57#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
58#define N_HDLC 13 /* synchronous HDLC */
59#define N_SYNC_PPP 14 /* synchronous PPP */
60#define N_HCI 15 /* Bluetooth HCI UART */
61
62#ifdef __KERNEL__ 42#ifdef __KERNEL__
63#include <linux/module.h> 43#include <linux/module.h>
64 44
diff --git a/include/asm-m32r/timex.h b/include/asm-m32r/timex.h
index 019441c1d7a0..bb9fe4feb12d 100644
--- a/include/asm-m32r/timex.h
+++ b/include/asm-m32r/timex.h
@@ -1,15 +1,12 @@
1#ifndef _ASM_M32R_TIMEX_H 1#ifndef _ASM_M32R_TIMEX_H
2#define _ASM_M32R_TIMEX_H 2#define _ASM_M32R_TIMEX_H
3 3
4/* $Id$ */
5
6/* 4/*
7 * linux/include/asm-m32r/timex.h 5 * linux/include/asm-m32r/timex.h
8 * 6 *
9 * m32r architecture timex specifications 7 * m32r architecture timex specifications
10 */ 8 */
11 9
12
13#define CLOCK_TICK_RATE (CONFIG_BUS_CLOCK / CONFIG_TIMER_DIVIDE) 10#define CLOCK_TICK_RATE (CONFIG_BUS_CLOCK / CONFIG_TIMER_DIVIDE)
14#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ 11#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */
15 12
diff --git a/include/asm-m32r/tlbflush.h b/include/asm-m32r/tlbflush.h
index ae4494960593..3d37ac002bcc 100644
--- a/include/asm-m32r/tlbflush.h
+++ b/include/asm-m32r/tlbflush.h
@@ -98,4 +98,3 @@ static __inline__ void __flush_tlb_all(void)
98extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); 98extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t);
99 99
100#endif /* _ASM_M32R_TLBFLUSH_H */ 100#endif /* _ASM_M32R_TLBFLUSH_H */
101
diff --git a/include/asm-m32r/types.h b/include/asm-m32r/types.h
index fcf24c64c3ba..27d3eb539c50 100644
--- a/include/asm-m32r/types.h
+++ b/include/asm-m32r/types.h
@@ -3,10 +3,6 @@
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5 5
6/* $Id$ */
7
8/* orig : i386 2.4.18 */
9
10typedef unsigned short umode_t; 6typedef unsigned short umode_t;
11 7
12/* 8/*
@@ -59,4 +55,4 @@ typedef u64 dma64_addr_t;
59 55
60#endif /* __KERNEL__ */ 56#endif /* __KERNEL__ */
61 57
62#endif /* _ASM_M32R_TYPES_H */ 58#endif /* _ASM_M32R_TYPES_H */
diff --git a/include/asm-m32r/uaccess.h b/include/asm-m32r/uaccess.h
index 26e978c7e3b4..bd8c83765a5c 100644
--- a/include/asm-m32r/uaccess.h
+++ b/include/asm-m32r/uaccess.h
@@ -68,7 +68,7 @@ static inline void set_fs(mm_segment_t s)
68 * This needs 33-bit arithmetic. We have a carry... 68 * This needs 33-bit arithmetic. We have a carry...
69 */ 69 */
70#define __range_ok(addr,size) ({ \ 70#define __range_ok(addr,size) ({ \
71 unsigned long flag, sum; \ 71 unsigned long flag, roksum; \
72 __chk_user_ptr(addr); \ 72 __chk_user_ptr(addr); \
73 asm ( \ 73 asm ( \
74 " cmpu %1, %1 ; clear cbit\n" \ 74 " cmpu %1, %1 ; clear cbit\n" \
@@ -76,7 +76,7 @@ static inline void set_fs(mm_segment_t s)
76 " subx %0, %0\n" \ 76 " subx %0, %0\n" \
77 " cmpu %4, %1\n" \ 77 " cmpu %4, %1\n" \
78 " subx %0, %5\n" \ 78 " subx %0, %5\n" \
79 : "=&r" (flag), "=r" (sum) \ 79 : "=&r" (flag), "=r" (roksum) \
80 : "1" (addr), "r" ((int)(size)), \ 80 : "1" (addr), "r" ((int)(size)), \
81 "r" (current_thread_info()->addr_limit.seg), "r" (0) \ 81 "r" (current_thread_info()->addr_limit.seg), "r" (0) \
82 : "cbit" ); \ 82 : "cbit" ); \
diff --git a/include/asm-m32r/ucontext.h b/include/asm-m32r/ucontext.h
index 2de709a5c53c..09324741eec3 100644
--- a/include/asm-m32r/ucontext.h
+++ b/include/asm-m32r/ucontext.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_UCONTEXT_H 1#ifndef _ASM_M32R_UCONTEXT_H
2#define _ASM_M32R_UCONTEXT_H 2#define _ASM_M32R_UCONTEXT_H
3 3
4/* orig : i386 2.4.18 */
5
6struct ucontext { 4struct ucontext {
7 unsigned long uc_flags; 5 unsigned long uc_flags;
8 struct ucontext *uc_link; 6 struct ucontext *uc_link;
diff --git a/include/asm-m32r/unaligned.h b/include/asm-m32r/unaligned.h
index 3aef9ac8d3aa..fccc180c3913 100644
--- a/include/asm-m32r/unaligned.h
+++ b/include/asm-m32r/unaligned.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_M32R_UNALIGNED_H 1#ifndef _ASM_M32R_UNALIGNED_H
2#define _ASM_M32R_UNALIGNED_H 2#define _ASM_M32R_UNALIGNED_H
3 3
4/* $Id$ */
5
6/* orig : generic 2.4.18 */
7
8/* 4/*
9 * For the benefit of those who are trying to port Linux to another 5 * For the benefit of those who are trying to port Linux to another
10 * architecture, here are some C-language equivalents. 6 * architecture, here are some C-language equivalents.
@@ -12,7 +8,6 @@
12 8
13#include <asm/string.h> 9#include <asm/string.h>
14 10
15
16#define get_unaligned(ptr) \ 11#define get_unaligned(ptr) \
17 ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) 12 ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
18 13
@@ -21,5 +16,4 @@
21 memmove((ptr), &__tmp, sizeof(*(ptr))); \ 16 memmove((ptr), &__tmp, sizeof(*(ptr))); \
22 (void)0; }) 17 (void)0; })
23 18
24 19#endif /* _ASM_M32R_UNALIGNED_H */
25#endif /* _ASM_M32R_UNALIGNED_H */
diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h
index 5b66bd3c6ed6..cbbd53762ea6 100644
--- a/include/asm-m32r/unistd.h
+++ b/include/asm-m32r/unistd.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_UNISTD_H 1#ifndef _ASM_M32R_UNISTD_H
2#define _ASM_M32R_UNISTD_H 2#define _ASM_M32R_UNISTD_H
3 3
4/* $Id$ */
5
6/* 4/*
7 * This file contains the system call numbers. 5 * This file contains the system call numbers.
8 */ 6 */
diff --git a/include/asm-m32r/user.h b/include/asm-m32r/user.h
index 1ad4ded8483b..035258d713d0 100644
--- a/include/asm-m32r/user.h
+++ b/include/asm-m32r/user.h
@@ -1,12 +1,6 @@
1#ifndef _ASM_M32R_USER_H 1#ifndef _ASM_M32R_USER_H
2#define _ASM_M32R_USER_H 2#define _ASM_M32R_USER_H
3 3
4/* $Id$ */
5
6/* orig : sh 2.4.18
7 * mod : remove fpu registers
8 */
9
10#include <linux/types.h> 4#include <linux/types.h>
11#include <asm/ptrace.h> 5#include <asm/ptrace.h>
12#include <asm/page.h> 6#include <asm/page.h>
diff --git a/include/asm-m32r/vga.h b/include/asm-m32r/vga.h
index 533163447cc9..a1b63061c06f 100644
--- a/include/asm-m32r/vga.h
+++ b/include/asm-m32r/vga.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_VGA_H 1#ifndef _ASM_M32R_VGA_H
2#define _ASM_M32R_VGA_H 2#define _ASM_M32R_VGA_H
3 3
4/* $Id$ */
5
6/* 4/*
7 * Access to VGA videoram 5 * Access to VGA videoram
8 * 6 *
@@ -19,4 +17,4 @@
19#define vga_readb(x) (*(x)) 17#define vga_readb(x) (*(x))
20#define vga_writeb(x,y) (*(y) = (x)) 18#define vga_writeb(x,y) (*(y) = (x))
21 19
22#endif /* _ASM_M32R_VGA_H */ 20#endif /* _ASM_M32R_VGA_H */
diff --git a/include/asm-m32r/xor.h b/include/asm-m32r/xor.h
index fd960dc9bf76..6d525259df3e 100644
--- a/include/asm-m32r/xor.h
+++ b/include/asm-m32r/xor.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_M32R_XOR_H 1#ifndef _ASM_M32R_XOR_H
2#define _ASM_M32R_XOR_H 2#define _ASM_M32R_XOR_H
3 3
4/* $Id$ */
5
6#include <asm-generic/xor.h> 4#include <asm-generic/xor.h>
7 5
8#endif /* _ASM_M32R_XOR_H */ 6#endif /* _ASM_M32R_XOR_H */
diff --git a/include/asm-m68k/math-emu.h b/include/asm-m68k/math-emu.h
index 7ac6259b68df..ddfab96403cb 100644
--- a/include/asm-m68k/math-emu.h
+++ b/include/asm-m68k/math-emu.h
@@ -226,6 +226,21 @@ extern unsigned int fp_debugprint;
226 .previous 226 .previous
227.endm 227.endm
228 228
229/* work around binutils idiocy */
230old_gas=-1
231.irp gas_ident.x .x
232old_gas=old_gas+1
233.endr
234.if !old_gas
235.irp m b,w,l
236.macro getuser.\m src,dest,label,addr
237 getuser .\m,\src,\dest,\label,\addr
238.endm
239.macro putuser.\m src,dest,label,addr
240 putuser .\m,\src,\dest,\label,\addr
241.endm
242.endr
243.endif
229 244
230.macro movestack nr,arg1,arg2,arg3,arg4,arg5 245.macro movestack nr,arg1,arg2,arg3,arg4,arg5
231 .if \nr 246 .if \nr
diff --git a/include/asm-m68k/termios.h b/include/asm-m68k/termios.h
index 857f0c9a9120..00edabd76168 100644
--- a/include/asm-m68k/termios.h
+++ b/include/asm-m68k/termios.h
@@ -49,24 +49,6 @@ struct termio {
49 49
50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
51 51
52/* line disciplines */
53#define N_TTY 0
54#define N_SLIP 1
55#define N_MOUSE 2
56#define N_PPP 3
57#define N_STRIP 4
58#define N_AX25 5
59#define N_X25 6 /* X.25 async */
60#define N_6PACK 7
61#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
62#define N_R3964 9 /* Reserved for Simatic R3964 module */
63#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
64#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
65#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
66#define N_HDLC 13 /* synchronous HDLC */
67#define N_SYNC_PPP 14
68#define N_HCI 15 /* Bluetooth HCI UART */
69
70#ifdef __KERNEL__ 52#ifdef __KERNEL__
71 53
72/* 54/*
diff --git a/include/asm-m68k/user.h b/include/asm-m68k/user.h
index d7c0b109bd45..8c56ccab4849 100644
--- a/include/asm-m68k/user.h
+++ b/include/asm-m68k/user.h
@@ -1,8 +1,6 @@
1#ifndef _M68K_USER_H 1#ifndef _M68K_USER_H
2#define _M68K_USER_H 2#define _M68K_USER_H
3 3
4#include <asm/page.h>
5
6/* Core file format: The core file is written in such a way that gdb 4/* Core file format: The core file is written in such a way that gdb
7 can understand it and provide useful information to the user (under 5 can understand it and provide useful information to the user (under
8 linux we use the 'trad-core' bfd). There are quite a number of 6 linux we use the 'trad-core' bfd). There are quite a number of
diff --git a/include/asm-m68knommu/bitops.h b/include/asm-m68knommu/bitops.h
index d7fa7d9c0e0f..7d6075d9b5cb 100644
--- a/include/asm-m68knommu/bitops.h
+++ b/include/asm-m68knommu/bitops.h
@@ -7,7 +7,6 @@
7 7
8#include <linux/compiler.h> 8#include <linux/compiler.h>
9#include <asm/byteorder.h> /* swab32 */ 9#include <asm/byteorder.h> /* swab32 */
10#include <asm/system.h> /* save_flags */
11 10
12#ifdef __KERNEL__ 11#ifdef __KERNEL__
13 12
diff --git a/include/asm-mips/apm.h b/include/asm-mips/apm.h
deleted file mode 100644
index 4b99ffc11529..000000000000
--- a/include/asm-mips/apm.h
+++ /dev/null
@@ -1,64 +0,0 @@
1/* -*- linux-c -*-
2 *
3 * (C) 2003 zecke@handhelds.org
4 *
5 * GPL version 2
6 *
7 * based on arch/arm/kernel/apm.c
8 * factor out the information needed by architectures to provide
9 * apm status
10 *
11 *
12 */
13#ifndef MIPS_ASM_SA1100_APM_H
14#define MIPS_ASM_SA1100_APM_H
15
16#include <linux/apm_bios.h>
17
18/*
19 * This structure gets filled in by the machine specific 'get_power_status'
20 * implementation. Any fields which are not set default to a safe value.
21 */
22struct apm_power_info {
23 unsigned char ac_line_status;
24#define APM_AC_OFFLINE 0
25#define APM_AC_ONLINE 1
26#define APM_AC_BACKUP 2
27#define APM_AC_UNKNOWN 0xff
28
29 unsigned char battery_status;
30#define APM_BATTERY_STATUS_HIGH 0
31#define APM_BATTERY_STATUS_LOW 1
32#define APM_BATTERY_STATUS_CRITICAL 2
33#define APM_BATTERY_STATUS_CHARGING 3
34#define APM_BATTERY_STATUS_NOT_PRESENT 4
35#define APM_BATTERY_STATUS_UNKNOWN 0xff
36
37 unsigned char battery_flag;
38#define APM_BATTERY_FLAG_HIGH (1 << 0)
39#define APM_BATTERY_FLAG_LOW (1 << 1)
40#define APM_BATTERY_FLAG_CRITICAL (1 << 2)
41#define APM_BATTERY_FLAG_CHARGING (1 << 3)
42#define APM_BATTERY_FLAG_NOT_PRESENT (1 << 7)
43#define APM_BATTERY_FLAG_UNKNOWN 0xff
44
45 int battery_life;
46 int time;
47 int units;
48#define APM_UNITS_MINS 0
49#define APM_UNITS_SECS 1
50#define APM_UNITS_UNKNOWN -1
51
52};
53
54/*
55 * This allows machines to provide their own "apm get power status" function.
56 */
57extern void (*apm_get_power_status)(struct apm_power_info *);
58
59/*
60 * Queue an event (APM_SYS_SUSPEND or APM_CRITICAL_SUSPEND)
61 */
62void apm_queue_event(apm_event_t event);
63
64#endif
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h
index 8e321f53a382..c7c945baf1ee 100644
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -243,6 +243,10 @@ extern struct boot_mem_map boot_mem_map;
243extern void add_memory_region(phys_t start, phys_t size, long type); 243extern void add_memory_region(phys_t start, phys_t size, long type);
244 244
245extern void prom_init(void); 245extern void prom_init(void);
246extern void prom_free_prom_memory(void);
247
248extern void free_init_pages(const char *what,
249 unsigned long begin, unsigned long end);
246 250
247/* 251/*
248 * Initial kernel command line, usually setup by prom_init() 252 * Initial kernel command line, usually setup by prom_init()
diff --git a/include/asm-mips/ddb5xxx/ddb5477.h b/include/asm-mips/ddb5xxx/ddb5477.h
index c5af4b73fdd7..6cf177caf6d5 100644
--- a/include/asm-mips/ddb5xxx/ddb5477.h
+++ b/include/asm-mips/ddb5xxx/ddb5477.h
@@ -17,6 +17,7 @@
17#ifndef __ASM_DDB5XXX_DDB5477_H 17#ifndef __ASM_DDB5XXX_DDB5477_H
18#define __ASM_DDB5XXX_DDB5477_H 18#define __ASM_DDB5XXX_DDB5477_H
19 19
20#include <irq.h>
20 21
21/* 22/*
22 * This contains macros that are specific to DDB5477 or renamed from 23 * This contains macros that are specific to DDB5477 or renamed from
@@ -251,14 +252,10 @@ extern void ll_vrc5477_irq_disable(int vrc5477_irq);
251 */ 252 */
252 253
253#define NUM_CPU_IRQ 8 254#define NUM_CPU_IRQ 8
254#define NUM_I8259_IRQ 16
255#define NUM_VRC5477_IRQ 32 255#define NUM_VRC5477_IRQ 32
256 256
257#define DDB_IRQ_BASE 0 257#define CPU_IRQ_BASE MIPS_CPU_IRQ_BASE
258 258#define VRC5477_IRQ_BASE (CPU_IRQ_BASE + NUM_CPU_IRQ)
259#define I8259_IRQ_BASE DDB_IRQ_BASE
260#define VRC5477_IRQ_BASE (I8259_IRQ_BASE + NUM_I8259_IRQ)
261#define CPU_IRQ_BASE (VRC5477_IRQ_BASE + NUM_VRC5477_IRQ)
262 259
263/* 260/*
264 * vrc5477 irq defs 261 * vrc5477 irq defs
@@ -300,22 +297,22 @@ extern void ll_vrc5477_irq_disable(int vrc5477_irq);
300/* 297/*
301 * i2859 irq assignment 298 * i2859 irq assignment
302 */ 299 */
303#define I8259_IRQ_RESERVED_0 (0 + I8259_IRQ_BASE) 300#define I8259_IRQ_RESERVED_0 (0 + I8259A_IRQ_BASE)
304#define I8259_IRQ_KEYBOARD (1 + I8259_IRQ_BASE) /* M1543 default */ 301#define I8259_IRQ_KEYBOARD (1 + I8259A_IRQ_BASE) /* M1543 default */
305#define I8259_IRQ_CASCADE (2 + I8259_IRQ_BASE) 302#define I8259_IRQ_CASCADE (2 + I8259A_IRQ_BASE)
306#define I8259_IRQ_UART_B (3 + I8259_IRQ_BASE) /* M1543 default, may conflict with RTC according to schematic diagram */ 303#define I8259_IRQ_UART_B (3 + I8259A_IRQ_BASE) /* M1543 default, may conflict with RTC according to schematic diagram */
307#define I8259_IRQ_UART_A (4 + I8259_IRQ_BASE) /* M1543 default */ 304#define I8259_IRQ_UART_A (4 + I8259A_IRQ_BASE) /* M1543 default */
308#define I8259_IRQ_PARALLEL (5 + I8259_IRQ_BASE) /* M1543 default */ 305#define I8259_IRQ_PARALLEL (5 + I8259A_IRQ_BASE) /* M1543 default */
309#define I8259_IRQ_RESERVED_6 (6 + I8259_IRQ_BASE) 306#define I8259_IRQ_RESERVED_6 (6 + I8259A_IRQ_BASE)
310#define I8259_IRQ_RESERVED_7 (7 + I8259_IRQ_BASE) 307#define I8259_IRQ_RESERVED_7 (7 + I8259A_IRQ_BASE)
311#define I8259_IRQ_RTC (8 + I8259_IRQ_BASE) /* who set this? */ 308#define I8259_IRQ_RTC (8 + I8259A_IRQ_BASE) /* who set this? */
312#define I8259_IRQ_USB (9 + I8259_IRQ_BASE) /* ddb_setup */ 309#define I8259_IRQ_USB (9 + I8259A_IRQ_BASE) /* ddb_setup */
313#define I8259_IRQ_PMU (10 + I8259_IRQ_BASE) /* ddb_setup */ 310#define I8259_IRQ_PMU (10 + I8259A_IRQ_BASE) /* ddb_setup */
314#define I8259_IRQ_RESERVED_11 (11 + I8259_IRQ_BASE) 311#define I8259_IRQ_RESERVED_11 (11 + I8259A_IRQ_BASE)
315#define I8259_IRQ_RESERVED_12 (12 + I8259_IRQ_BASE) /* m1543_irq_setup */ 312#define I8259_IRQ_RESERVED_12 (12 + I8259A_IRQ_BASE) /* m1543_irq_setup */
316#define I8259_IRQ_RESERVED_13 (13 + I8259_IRQ_BASE) 313#define I8259_IRQ_RESERVED_13 (13 + I8259A_IRQ_BASE)
317#define I8259_IRQ_HDC1 (14 + I8259_IRQ_BASE) /* default and ddb_setup */ 314#define I8259_IRQ_HDC1 (14 + I8259A_IRQ_BASE) /* default and ddb_setup */
318#define I8259_IRQ_HDC2 (15 + I8259_IRQ_BASE) /* default */ 315#define I8259_IRQ_HDC2 (15 + I8259A_IRQ_BASE) /* default */
319 316
320 317
321/* 318/*
diff --git a/include/asm-mips/dec/interrupts.h b/include/asm-mips/dec/interrupts.h
index 273e4d65bfe6..e10d341067c8 100644
--- a/include/asm-mips/dec/interrupts.h
+++ b/include/asm-mips/dec/interrupts.h
@@ -14,6 +14,7 @@
14#ifndef __ASM_DEC_INTERRUPTS_H 14#ifndef __ASM_DEC_INTERRUPTS_H
15#define __ASM_DEC_INTERRUPTS_H 15#define __ASM_DEC_INTERRUPTS_H
16 16
17#include <irq.h>
17#include <asm/mipsregs.h> 18#include <asm/mipsregs.h>
18 19
19 20
@@ -87,7 +88,7 @@
87#define DEC_CPU_INR_SW1 1 /* software #1 */ 88#define DEC_CPU_INR_SW1 1 /* software #1 */
88#define DEC_CPU_INR_SW0 0 /* software #0 */ 89#define DEC_CPU_INR_SW0 0 /* software #0 */
89 90
90#define DEC_CPU_IRQ_BASE 0 /* first IRQ assigned to CPU */ 91#define DEC_CPU_IRQ_BASE MIPS_CPU_IRQ_BASE /* first IRQ assigned to CPU */
91 92
92#define DEC_CPU_IRQ_NR(n) ((n) + DEC_CPU_IRQ_BASE) 93#define DEC_CPU_IRQ_NR(n) ((n) + DEC_CPU_IRQ_BASE)
93#define DEC_CPU_IRQ_MASK(n) (1 << ((n) + CAUSEB_IP)) 94#define DEC_CPU_IRQ_MASK(n) (1 << ((n) + CAUSEB_IP))
diff --git a/include/asm-mips/dec/system.h b/include/asm-mips/dec/system.h
index 78af51fbc797..b2afaccd6831 100644
--- a/include/asm-mips/dec/system.h
+++ b/include/asm-mips/dec/system.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Generic DECstation/DECsystem bits. 4 * Generic DECstation/DECsystem bits.
5 * 5 *
6 * Copyright (C) 2005 Maciej W. Rozycki 6 * Copyright (C) 2005, 2006 Maciej W. Rozycki
7 * 7 *
8 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 9 * modify it under the terms of the GNU General Public License
@@ -14,5 +14,6 @@
14#define __ASM_DEC_SYSTEM_H 14#define __ASM_DEC_SYSTEM_H
15 15
16extern unsigned long dec_kn_slot_base, dec_kn_slot_size; 16extern unsigned long dec_kn_slot_base, dec_kn_slot_size;
17extern int dec_tc_bus;
17 18
18#endif /* __ASM_DEC_SYSTEM_H */ 19#endif /* __ASM_DEC_SYSTEM_H */
diff --git a/include/asm-mips/dec/tc.h b/include/asm-mips/dec/tc.h
deleted file mode 100644
index 9cb51f24d42c..000000000000
--- a/include/asm-mips/dec/tc.h
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * Interface to the TURBOchannel related routines
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (c) 1998 Harald Koerfgen
9 */
10#ifndef __ASM_DEC_TC_H
11#define __ASM_DEC_TC_H
12
13/*
14 * Search for a TURBOchannel Option Module
15 * with a certain name. Returns slot number
16 * of the first card not in use or -ENODEV
17 * if none found.
18 */
19extern int search_tc_card(const char *);
20/*
21 * Marks the card in slot as used
22 */
23extern void claim_tc_card(int);
24/*
25 * Marks the card in slot as free
26 */
27extern void release_tc_card(int);
28/*
29 * Return base address of card in slot
30 */
31extern unsigned long get_tc_base_addr(int);
32/*
33 * Return interrupt number of slot
34 */
35extern unsigned long get_tc_irq_nr(int);
36/*
37 * Return TURBOchannel clock frequency in Hz
38 */
39extern unsigned long get_tc_speed(void);
40
41#endif /* __ASM_DEC_TC_H */
diff --git a/include/asm-mips/dec/tcinfo.h b/include/asm-mips/dec/tcinfo.h
deleted file mode 100644
index cc23509ee77a..000000000000
--- a/include/asm-mips/dec/tcinfo.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * Various TURBOchannel related stuff
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Information obtained through the get_tcinfo prom call
9 * created from:
10 *
11 * TURBOchannel Firmware Specification
12 *
13 * EK-TCAAD-FS-004
14 * from Digital Equipment Corporation
15 *
16 * Copyright (c) 1998 Harald Koerfgen
17 */
18
19typedef struct {
20 int revision;
21 int clk_period;
22 int slot_size;
23 int io_timeout;
24 int dma_range;
25 int max_dma_burst;
26 int parity;
27 int reserved[4];
28} tcinfo;
29
30#define MAX_SLOT 7
31
32typedef struct {
33 unsigned long base_addr;
34 unsigned char name[9];
35 unsigned char vendor[9];
36 unsigned char firmware[9];
37 int interrupt;
38 int flags;
39} slot_info;
40
41/*
42 * Values for flags
43 */
44#define FREE 1<<0
45#define IN_USE 1<<1
46
47
diff --git a/include/asm-mips/dec/tcmodule.h b/include/asm-mips/dec/tcmodule.h
deleted file mode 100644
index 6268e8915d87..000000000000
--- a/include/asm-mips/dec/tcmodule.h
+++ /dev/null
@@ -1,39 +0,0 @@
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 * Offsets for the ROM header locations for
7 * TURBOchannel cards
8 *
9 * created from:
10 *
11 * TURBOchannel Firmware Specification
12 *
13 * EK-TCAAD-FS-004
14 * from Digital Equipment Corporation
15 *
16 * Jan.1998 Harald Koerfgen
17 */
18#ifndef __ASM_DEC_TCMODULE_H
19#define __ASM_DEC_TCMODULE_H
20
21#define OLDCARD 0x3c0000
22#define NEWCARD 0x000000
23
24#define TC_ROM_WIDTH 0x3e0
25#define TC_ROM_STRIDE 0x3e4
26#define TC_ROM_SIZE 0x3e8
27#define TC_SLOT_SIZE 0x3ec
28#define TC_PATTERN0 0x3f0
29#define TC_PATTERN1 0x3f4
30#define TC_PATTERN2 0x3f8
31#define TC_PATTERN3 0x3fc
32#define TC_FIRM_VER 0x400
33#define TC_VENDOR 0x420
34#define TC_MODULE 0x440
35#define TC_FIRM_TYPE 0x460
36#define TC_FLAGS 0x470
37#define TC_ROM_OBJECTS 0x480
38
39#endif /* __ASM_DEC_TCMODULE_H */
diff --git a/include/asm-mips/dma.h b/include/asm-mips/dma.h
index 23f789c80845..e06ef0776d48 100644
--- a/include/asm-mips/dma.h
+++ b/include/asm-mips/dma.h
@@ -91,6 +91,7 @@
91#else 91#else
92#define MAX_DMA_ADDRESS (PAGE_OFFSET + 0x01000000) 92#define MAX_DMA_ADDRESS (PAGE_OFFSET + 0x01000000)
93#endif 93#endif
94#define MAX_DMA_PFN PFN_DOWN(virt_to_phys((void *)MAX_DMA_ADDRESS))
94 95
95/* 8237 DMA controllers */ 96/* 8237 DMA controllers */
96#define IO_DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */ 97#define IO_DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */
diff --git a/include/asm-mips/emma2rh/emma2rh.h b/include/asm-mips/emma2rh/emma2rh.h
index 4fb8df71caa9..6a1af0af51e3 100644
--- a/include/asm-mips/emma2rh/emma2rh.h
+++ b/include/asm-mips/emma2rh/emma2rh.h
@@ -24,6 +24,8 @@
24#ifndef __ASM_EMMA2RH_EMMA2RH_H 24#ifndef __ASM_EMMA2RH_EMMA2RH_H
25#define __ASM_EMMA2RH_EMMA2RH_H 25#define __ASM_EMMA2RH_EMMA2RH_H
26 26
27#include <irq.h>
28
27/* 29/*
28 * EMMA2RH registers 30 * EMMA2RH registers
29 */ 31 */
@@ -104,7 +106,8 @@
104#define NUM_EMMA2RH_IRQ 96 106#define NUM_EMMA2RH_IRQ 96
105 107
106#define CPU_EMMA2RH_CASCADE 2 108#define CPU_EMMA2RH_CASCADE 2
107#define EMMA2RH_IRQ_BASE 0 109#define CPU_IRQ_BASE MIPS_CPU_IRQ_BASE
110#define EMMA2RH_IRQ_BASE (CPU_IRQ_BASE + NUM_CPU_IRQ)
108 111
109/* 112/*
110 * emma2rh irq defs 113 * emma2rh irq defs
diff --git a/include/asm-mips/emma2rh/markeins.h b/include/asm-mips/emma2rh/markeins.h
index 8fa766795078..973b0628490d 100644
--- a/include/asm-mips/emma2rh/markeins.h
+++ b/include/asm-mips/emma2rh/markeins.h
@@ -33,7 +33,6 @@
33 33
34#define EMMA2RH_SW_IRQ_BASE (EMMA2RH_IRQ_BASE + NUM_EMMA2RH_IRQ) 34#define EMMA2RH_SW_IRQ_BASE (EMMA2RH_IRQ_BASE + NUM_EMMA2RH_IRQ)
35#define EMMA2RH_GPIO_IRQ_BASE (EMMA2RH_SW_IRQ_BASE + NUM_EMMA2RH_IRQ_SW) 35#define EMMA2RH_GPIO_IRQ_BASE (EMMA2RH_SW_IRQ_BASE + NUM_EMMA2RH_IRQ_SW)
36#define CPU_IRQ_BASE (EMMA2RH_GPIO_IRQ_BASE + NUM_EMMA2RH_IRQ_GPIO)
37 36
38#define EMMA2RH_SW_IRQ_INT0 (0+EMMA2RH_SW_IRQ_BASE) 37#define EMMA2RH_SW_IRQ_INT0 (0+EMMA2RH_SW_IRQ_BASE)
39#define EMMA2RH_SW_IRQ_INT1 (1+EMMA2RH_SW_IRQ_BASE) 38#define EMMA2RH_SW_IRQ_INT1 (1+EMMA2RH_SW_IRQ_BASE)
diff --git a/include/asm-mips/i8259.h b/include/asm-mips/i8259.h
index 4df8d8b118c0..e88a01607fea 100644
--- a/include/asm-mips/i8259.h
+++ b/include/asm-mips/i8259.h
@@ -18,6 +18,7 @@
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19 19
20#include <asm/io.h> 20#include <asm/io.h>
21#include <irq.h>
21 22
22/* i8259A PIC registers */ 23/* i8259A PIC registers */
23#define PIC_MASTER_CMD 0x20 24#define PIC_MASTER_CMD 0x20
@@ -42,8 +43,6 @@ extern void disable_8259A_irq(unsigned int irq);
42 43
43extern void init_i8259_irqs(void); 44extern void init_i8259_irqs(void);
44 45
45#define I8259A_IRQ_BASE 0
46
47/* 46/*
48 * Do the traditional i8259 interrupt polling thing. This is for the few 47 * Do the traditional i8259 interrupt polling thing. This is for the few
49 * cases where no better interrupt acknowledge method is available and we 48 * cases where no better interrupt acknowledge method is available and we
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
index d77b657c09c7..b6a2eb816628 100644
--- a/include/asm-mips/io.h
+++ b/include/asm-mips/io.h
@@ -115,7 +115,7 @@ static inline void set_io_port_base(unsigned long base)
115 */ 115 */
116static inline unsigned long virt_to_phys(volatile const void *address) 116static inline unsigned long virt_to_phys(volatile const void *address)
117{ 117{
118 return (unsigned long)address - PAGE_OFFSET; 118 return (unsigned long)address - PAGE_OFFSET + PHYS_OFFSET;
119} 119}
120 120
121/* 121/*
@@ -132,7 +132,7 @@ static inline unsigned long virt_to_phys(volatile const void *address)
132 */ 132 */
133static inline void * phys_to_virt(unsigned long address) 133static inline void * phys_to_virt(unsigned long address)
134{ 134{
135 return (void *)(address + PAGE_OFFSET); 135 return (void *)(address + PAGE_OFFSET - PHYS_OFFSET);
136} 136}
137 137
138/* 138/*
@@ -556,12 +556,6 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
556#define __ISA_IO_base ((char *)(isa_slot_offset)) 556#define __ISA_IO_base ((char *)(isa_slot_offset))
557 557
558/* 558/*
559 * We don't have csum_partial_copy_fromio() yet, so we cheat here and
560 * just copy it. The net code will then do the checksum later.
561 */
562#define eth_io_copy_and_sum(skb,src,len,unused) memcpy_fromio((skb)->data,(src),(len))
563
564/*
565 * The caches on some architectures aren't dma-coherent and have need to 559 * The caches on some architectures aren't dma-coherent and have need to
566 * handle this in software. There are three types of operations that 560 * handle this in software. There are three types of operations that
567 * can be applied to dma buffers. 561 * can be applied to dma buffers.
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index 386da82e5774..91803ba30ff2 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -18,7 +18,7 @@
18#ifdef CONFIG_I8259 18#ifdef CONFIG_I8259
19static inline int irq_canonicalize(int irq) 19static inline int irq_canonicalize(int irq)
20{ 20{
21 return ((irq == 2) ? 9 : irq); 21 return ((irq == I8259A_IRQ_BASE + 2) ? I8259A_IRQ_BASE + 9 : irq);
22} 22}
23#else 23#else
24#define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */ 24#define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
diff --git a/include/asm-mips/irq_cpu.h b/include/asm-mips/irq_cpu.h
index ed3d1e3d09ec..ef6a07cddb23 100644
--- a/include/asm-mips/irq_cpu.h
+++ b/include/asm-mips/irq_cpu.h
@@ -13,8 +13,8 @@
13#ifndef _ASM_IRQ_CPU_H 13#ifndef _ASM_IRQ_CPU_H
14#define _ASM_IRQ_CPU_H 14#define _ASM_IRQ_CPU_H
15 15
16extern void mips_cpu_irq_init(int irq_base); 16extern void mips_cpu_irq_init(void);
17extern void rm7k_cpu_irq_init(int irq_base); 17extern void rm7k_cpu_irq_init(void);
18extern void rm9k_cpu_irq_init(int irq_base); 18extern void rm9k_cpu_irq_init(void);
19 19
20#endif /* _ASM_IRQ_CPU_H */ 20#endif /* _ASM_IRQ_CPU_H */
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h
index 582acd8adb81..58fca8a5a9a6 100644
--- a/include/asm-mips/mach-au1x00/au1000.h
+++ b/include/asm-mips/mach-au1x00/au1000.h
@@ -39,6 +39,7 @@
39#ifndef _LANGUAGE_ASSEMBLY 39#ifndef _LANGUAGE_ASSEMBLY
40 40
41#include <linux/delay.h> 41#include <linux/delay.h>
42#include <linux/types.h>
42#include <asm/io.h> 43#include <asm/io.h>
43 44
44/* cpu pipeline flush */ 45/* cpu pipeline flush */
diff --git a/include/asm-mips/mach-cobalt/cobalt.h b/include/asm-mips/mach-cobalt/cobalt.h
index 00b0fc68d5cb..24a8d51a55a3 100644
--- a/include/asm-mips/mach-cobalt/cobalt.h
+++ b/include/asm-mips/mach-cobalt/cobalt.h
@@ -12,6 +12,8 @@
12#ifndef __ASM_COBALT_H 12#ifndef __ASM_COBALT_H
13#define __ASM_COBALT_H 13#define __ASM_COBALT_H
14 14
15#include <irq.h>
16
15/* 17/*
16 * i8259 legacy interrupts used on Cobalt: 18 * i8259 legacy interrupts used on Cobalt:
17 * 19 *
@@ -25,7 +27,7 @@
25/* 27/*
26 * CPU IRQs are 16 ... 23 28 * CPU IRQs are 16 ... 23
27 */ 29 */
28#define COBALT_CPU_IRQ 16 30#define COBALT_CPU_IRQ MIPS_CPU_IRQ_BASE
29 31
30#define COBALT_GALILEO_IRQ (COBALT_CPU_IRQ + 2) 32#define COBALT_GALILEO_IRQ (COBALT_CPU_IRQ + 2)
31#define COBALT_SCC_IRQ (COBALT_CPU_IRQ + 3) /* pre-production has 85C30 */ 33#define COBALT_SCC_IRQ (COBALT_CPU_IRQ + 3) /* pre-production has 85C30 */
diff --git a/include/asm-mips/mach-emma2rh/irq.h b/include/asm-mips/mach-emma2rh/irq.h
index bce64244b800..5439eb856461 100644
--- a/include/asm-mips/mach-emma2rh/irq.h
+++ b/include/asm-mips/mach-emma2rh/irq.h
@@ -10,4 +10,6 @@
10 10
11#define NR_IRQS 256 11#define NR_IRQS 256
12 12
13#include_next <irq.h>
14
13#endif /* __ASM_MACH_EMMA2RH_IRQ_H */ 15#endif /* __ASM_MACH_EMMA2RH_IRQ_H */
diff --git a/include/asm-mips/mach-generic/irq.h b/include/asm-mips/mach-generic/irq.h
index 500e10ff24de..70d9a25132c5 100644
--- a/include/asm-mips/mach-generic/irq.h
+++ b/include/asm-mips/mach-generic/irq.h
@@ -8,6 +8,38 @@
8#ifndef __ASM_MACH_GENERIC_IRQ_H 8#ifndef __ASM_MACH_GENERIC_IRQ_H
9#define __ASM_MACH_GENERIC_IRQ_H 9#define __ASM_MACH_GENERIC_IRQ_H
10 10
11#ifndef NR_IRQS
11#define NR_IRQS 128 12#define NR_IRQS 128
13#endif
14
15#ifdef CONFIG_I8259
16#ifndef I8259A_IRQ_BASE
17#define I8259A_IRQ_BASE 0
18#endif
19#endif
20
21#ifdef CONFIG_IRQ_CPU
22
23#ifndef MIPS_CPU_IRQ_BASE
24#ifdef CONFIG_I8259
25#define MIPS_CPU_IRQ_BASE 16
26#else
27#define MIPS_CPU_IRQ_BASE 0
28#endif /* CONFIG_I8259 */
29#endif
30
31#ifdef CONFIG_IRQ_CPU_RM7K
32#ifndef RM7K_CPU_IRQ_BASE
33#define RM7K_CPU_IRQ_BASE (MIPS_CPU_IRQ_BASE+8)
34#endif
35#endif
36
37#ifdef CONFIG_IRQ_CPU_RM9K
38#ifndef RM9K_CPU_IRQ_BASE
39#define RM9K_CPU_IRQ_BASE (MIPS_CPU_IRQ_BASE+12)
40#endif
41#endif
42
43#endif /* CONFIG_IRQ_CPU */
12 44
13#endif /* __ASM_MACH_GENERIC_IRQ_H */ 45#endif /* __ASM_MACH_GENERIC_IRQ_H */
diff --git a/include/asm-mips/mach-mips/irq.h b/include/asm-mips/mach-mips/irq.h
index e994b0c01227..9b9da26683c2 100644
--- a/include/asm-mips/mach-mips/irq.h
+++ b/include/asm-mips/mach-mips/irq.h
@@ -4,4 +4,6 @@
4 4
5#define NR_IRQS 256 5#define NR_IRQS 256
6 6
7#include_next <irq.h>
8
7#endif /* __ASM_MACH_MIPS_IRQ_H */ 9#endif /* __ASM_MACH_MIPS_IRQ_H */
diff --git a/include/asm-mips/mach-vr41xx/irq.h b/include/asm-mips/mach-vr41xx/irq.h
new file mode 100644
index 000000000000..848812296052
--- /dev/null
+++ b/include/asm-mips/mach-vr41xx/irq.h
@@ -0,0 +1,11 @@
1#ifndef __ASM_MACH_VR41XX_IRQ_H
2#define __ASM_MACH_VR41XX_IRQ_H
3
4#include <asm/vr41xx/irq.h> /* for MIPS_CPU_IRQ_BASE */
5#ifdef CONFIG_NEC_CMBVR4133
6#include <asm/vr41xx/cmbvr4133.h> /* for I8259A_IRQ_BASE */
7#endif
8
9#include_next <irq.h>
10
11#endif /* __ASM_MACH_VR41XX_IRQ_H */
diff --git a/include/asm-mips/mips-boards/atlasint.h b/include/asm-mips/mips-boards/atlasint.h
index b15e4ea0b091..76add42e486e 100644
--- a/include/asm-mips/mips-boards/atlasint.h
+++ b/include/asm-mips/mips-boards/atlasint.h
@@ -26,10 +26,12 @@
26#ifndef _MIPS_ATLASINT_H 26#ifndef _MIPS_ATLASINT_H
27#define _MIPS_ATLASINT_H 27#define _MIPS_ATLASINT_H
28 28
29#include <irq.h>
30
29/* 31/*
30 * Interrupts 0..7 are used for Atlas CPU interrupts (nonEIC mode) 32 * Interrupts 0..7 are used for Atlas CPU interrupts (nonEIC mode)
31 */ 33 */
32#define MIPSCPU_INT_BASE 0 34#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
33 35
34/* CPU interrupt offsets */ 36/* CPU interrupt offsets */
35#define MIPSCPU_INT_SW0 0 37#define MIPSCPU_INT_SW0 0
diff --git a/include/asm-mips/mips-boards/maltaint.h b/include/asm-mips/mips-boards/maltaint.h
index da6cc2fbbc78..9180d6466113 100644
--- a/include/asm-mips/mips-boards/maltaint.h
+++ b/include/asm-mips/mips-boards/maltaint.h
@@ -25,6 +25,8 @@
25#ifndef _MIPS_MALTAINT_H 25#ifndef _MIPS_MALTAINT_H
26#define _MIPS_MALTAINT_H 26#define _MIPS_MALTAINT_H
27 27
28#include <irq.h>
29
28/* 30/*
29 * Interrupts 0..15 are used for Malta ISA compatible interrupts 31 * Interrupts 0..15 are used for Malta ISA compatible interrupts
30 */ 32 */
@@ -33,7 +35,7 @@
33/* 35/*
34 * Interrupts 16..23 are used for Malta CPU interrupts (nonEIC mode) 36 * Interrupts 16..23 are used for Malta CPU interrupts (nonEIC mode)
35 */ 37 */
36#define MIPSCPU_INT_BASE 16 38#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
37 39
38/* CPU interrupt offsets */ 40/* CPU interrupt offsets */
39#define MIPSCPU_INT_SW0 0 41#define MIPSCPU_INT_SW0 0
diff --git a/include/asm-mips/mips-boards/prom.h b/include/asm-mips/mips-boards/prom.h
index 4168c7fcd43e..7bf6f5f6ab9c 100644
--- a/include/asm-mips/mips-boards/prom.h
+++ b/include/asm-mips/mips-boards/prom.h
@@ -33,7 +33,6 @@ extern void prom_printf(char *fmt, ...);
33extern void prom_init_cmdline(void); 33extern void prom_init_cmdline(void);
34extern void prom_meminit(void); 34extern void prom_meminit(void);
35extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem); 35extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem);
36extern unsigned long prom_free_prom_memory (void);
37extern void mips_display_message(const char *str); 36extern void mips_display_message(const char *str);
38extern void mips_display_word(unsigned int num); 37extern void mips_display_word(unsigned int num);
39extern int get_ethernet_addr(char *ethernet_addr); 38extern int get_ethernet_addr(char *ethernet_addr);
diff --git a/include/asm-mips/mips-boards/seadint.h b/include/asm-mips/mips-boards/seadint.h
index 365c2a3c64f5..4f6a3933699d 100644
--- a/include/asm-mips/mips-boards/seadint.h
+++ b/include/asm-mips/mips-boards/seadint.h
@@ -20,10 +20,12 @@
20#ifndef _MIPS_SEADINT_H 20#ifndef _MIPS_SEADINT_H
21#define _MIPS_SEADINT_H 21#define _MIPS_SEADINT_H
22 22
23#include <irq.h>
24
23/* 25/*
24 * Interrupts 0..7 are used for SEAD CPU interrupts 26 * Interrupts 0..7 are used for SEAD CPU interrupts
25 */ 27 */
26#define MIPSCPU_INT_BASE 0 28#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
27 29
28#define MIPSCPU_INT_UART0 2 30#define MIPSCPU_INT_UART0 2
29#define MIPSCPU_INT_UART1 3 31#define MIPSCPU_INT_UART1 3
diff --git a/include/asm-mips/mips-boards/simint.h b/include/asm-mips/mips-boards/simint.h
index 4952e0b3bf11..54f2fe621d69 100644
--- a/include/asm-mips/mips-boards/simint.h
+++ b/include/asm-mips/mips-boards/simint.h
@@ -17,10 +17,11 @@
17#ifndef _MIPS_SIMINT_H 17#ifndef _MIPS_SIMINT_H
18#define _MIPS_SIMINT_H 18#define _MIPS_SIMINT_H
19 19
20#include <irq.h>
20 21
21#define SIM_INT_BASE 0 22#define SIM_INT_BASE 0
22#define MIPSCPU_INT_MB0 2 23#define MIPSCPU_INT_MB0 2
23#define MIPSCPU_INT_BASE 16 24#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
24#define MIPS_CPU_TIMER_IRQ 7 25#define MIPS_CPU_TIMER_IRQ 7
25 26
26 27
diff --git a/include/asm-mips/mips_mt.h b/include/asm-mips/mips_mt.h
index c31a312b9783..fdfff0b8ce42 100644
--- a/include/asm-mips/mips_mt.h
+++ b/include/asm-mips/mips_mt.h
@@ -12,4 +12,7 @@ extern unsigned long mt_fpemul_threshold;
12extern void mips_mt_regdump(unsigned long previous_mvpcontrol_value); 12extern void mips_mt_regdump(unsigned long previous_mvpcontrol_value);
13extern void mips_mt_set_cpuoptions(void); 13extern void mips_mt_set_cpuoptions(void);
14 14
15struct class;
16extern struct class *mt_class;
17
15#endif /* __ASM_MIPS_MT_H */ 18#endif /* __ASM_MIPS_MT_H */
diff --git a/include/asm-mips/mipsmtregs.h b/include/asm-mips/mipsmtregs.h
index 3e9468f424f4..294bca12cd3f 100644
--- a/include/asm-mips/mipsmtregs.h
+++ b/include/asm-mips/mipsmtregs.h
@@ -165,8 +165,6 @@
165 165
166#ifndef __ASSEMBLY__ 166#ifndef __ASSEMBLY__
167 167
168extern void mips_mt_regdump(unsigned long previous_mvpcontrol_value);
169
170static inline unsigned int dvpe(void) 168static inline unsigned int dvpe(void)
171{ 169{
172 int res = 0; 170 int res = 0;
diff --git a/include/asm-mips/mman.h b/include/asm-mips/mman.h
index 046cf686bee7..e4d6f1fb1cf7 100644
--- a/include/asm-mips/mman.h
+++ b/include/asm-mips/mman.h
@@ -72,7 +72,6 @@
72#define MADV_DOFORK 11 /* do inherit across fork */ 72#define MADV_DOFORK 11 /* do inherit across fork */
73 73
74/* compatibility flags */ 74/* compatibility flags */
75#define MAP_ANON MAP_ANONYMOUS
76#define MAP_FILE 0 75#define MAP_FILE 0
77 76
78#endif /* _ASM_MMAN_H */ 77#endif /* _ASM_MMAN_H */
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 2f9e1a9ec51f..d3fbd83ff545 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -34,6 +34,20 @@
34 34
35#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
36 36
37/*
38 * This gives the physical RAM offset.
39 */
40#ifndef PHYS_OFFSET
41#define PHYS_OFFSET 0UL
42#endif
43
44/*
45 * It's normally defined only for FLATMEM config but it's
46 * used in our early mem init code for all memory models.
47 * So always define it.
48 */
49#define ARCH_PFN_OFFSET PFN_UP(PHYS_OFFSET)
50
37#include <linux/pfn.h> 51#include <linux/pfn.h>
38#include <asm/io.h> 52#include <asm/io.h>
39 53
@@ -132,20 +146,23 @@ typedef struct { unsigned long pgprot; } pgprot_t;
132/* to align the pointer to the (next) page boundary */ 146/* to align the pointer to the (next) page boundary */
133#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) 147#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK)
134 148
149/*
150 * __pa()/__va() should be used only during mem init.
151 */
135#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) 152#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
136#define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0) 153#define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0)
137#else 154#else
138#define __pa_page_offset(x) PAGE_OFFSET 155#define __pa_page_offset(x) PAGE_OFFSET
139#endif 156#endif
140#define __pa(x) ((unsigned long)(x) - __pa_page_offset(x)) 157#define __pa(x) ((unsigned long)(x) - __pa_page_offset(x) + PHYS_OFFSET)
141#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0)) 158#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
142#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET)) 159#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0))
143 160
144#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 161#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
145 162
146#ifdef CONFIG_FLATMEM 163#ifdef CONFIG_FLATMEM
147 164
148#define pfn_valid(pfn) ((pfn) < max_mapnr) 165#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr)
149 166
150#elif defined(CONFIG_SPARSEMEM) 167#elif defined(CONFIG_SPARSEMEM)
151 168
diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h
index 76cd51c6be39..59162f74a798 100644
--- a/include/asm-mips/rtlx.h
+++ b/include/asm-mips/rtlx.h
@@ -6,9 +6,10 @@
6#ifndef __ASM_RTLX_H 6#ifndef __ASM_RTLX_H
7#define __ASM_RTLX_H_ 7#define __ASM_RTLX_H_
8 8
9#include <irq.h>
10
9#define LX_NODE_BASE 10 11#define LX_NODE_BASE 10
10 12
11#define MIPSCPU_INT_BASE 16
12#define MIPS_CPU_RTLX_IRQ 0 13#define MIPS_CPU_RTLX_IRQ 0
13 14
14#define RTLX_VERSION 2 15#define RTLX_VERSION 2
diff --git a/include/asm-mips/sections.h b/include/asm-mips/sections.h
index f7016278b266..b7e37262c246 100644
--- a/include/asm-mips/sections.h
+++ b/include/asm-mips/sections.h
@@ -3,6 +3,4 @@
3 3
4#include <asm-generic/sections.h> 4#include <asm-generic/sections.h>
5 5
6extern char _fdata;
7
8#endif /* _ASM_SECTIONS_H */ 6#endif /* _ASM_SECTIONS_H */
diff --git a/include/asm-mips/sgi/ip22.h b/include/asm-mips/sgi/ip22.h
index bbfc05c3cab9..6592f3bd1999 100644
--- a/include/asm-mips/sgi/ip22.h
+++ b/include/asm-mips/sgi/ip22.h
@@ -21,15 +21,16 @@
21 * HAL2 driver). This will prevent many complications, trust me ;-) 21 * HAL2 driver). This will prevent many complications, trust me ;-)
22 */ 22 */
23 23
24#include <irq.h>
24#include <asm/sgi/ioc.h> 25#include <asm/sgi/ioc.h>
25 26
26#define SGINT_EISA 0 /* 16 EISA irq levels (Indigo2) */ 27#define SGINT_EISA 0 /* 16 EISA irq levels (Indigo2) */
27#define SGINT_CPU 16 /* MIPS CPU define 8 interrupt sources */ 28#define SGINT_CPU MIPS_CPU_IRQ_BASE /* MIPS CPU define 8 interrupt sources */
28#define SGINT_LOCAL0 24 /* 8 local0 irq levels */ 29#define SGINT_LOCAL0 (SGINT_CPU+8) /* 8 local0 irq levels */
29#define SGINT_LOCAL1 32 /* 8 local1 irq levels */ 30#define SGINT_LOCAL1 (SGINT_CPU+16) /* 8 local1 irq levels */
30#define SGINT_LOCAL2 40 /* 8 local2 vectored irq levels */ 31#define SGINT_LOCAL2 (SGINT_CPU+24) /* 8 local2 vectored irq levels */
31#define SGINT_LOCAL3 48 /* 8 local3 vectored irq levels */ 32#define SGINT_LOCAL3 (SGINT_CPU+32) /* 8 local3 vectored irq levels */
32#define SGINT_END 56 /* End of 'spaces' */ 33#define SGINT_END (SGINT_CPU+40) /* End of 'spaces' */
33 34
34/* 35/*
35 * Individual interrupt definitions for the Indy and Indigo2 36 * Individual interrupt definitions for the Indy and Indigo2
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h
index cefa657dd04a..3c175a7e4345 100644
--- a/include/asm-mips/sigcontext.h
+++ b/include/asm-mips/sigcontext.h
@@ -19,7 +19,7 @@
19 */ 19 */
20struct sigcontext { 20struct sigcontext {
21 unsigned int sc_regmask; /* Unused */ 21 unsigned int sc_regmask; /* Unused */
22 unsigned int sc_status; 22 unsigned int sc_status; /* Unused */
23 unsigned long long sc_pc; 23 unsigned long long sc_pc;
24 unsigned long long sc_regs[32]; 24 unsigned long long sc_regs[32];
25 unsigned long long sc_fpregs[32]; 25 unsigned long long sc_fpregs[32];
@@ -76,7 +76,7 @@ struct sigcontext {
76 76
77struct sigcontext32 { 77struct sigcontext32 {
78 __u32 sc_regmask; /* Unused */ 78 __u32 sc_regmask; /* Unused */
79 __u32 sc_status; 79 __u32 sc_status; /* Unused */
80 __u64 sc_pc; 80 __u64 sc_pc;
81 __u64 sc_regs[32]; 81 __u64 sc_regs[32];
82 __u64 sc_fpregs[32]; 82 __u64 sc_fpregs[32];
diff --git a/include/asm-mips/smtc_ipi.h b/include/asm-mips/smtc_ipi.h
index f22c3e2f993a..55f3419f6546 100644
--- a/include/asm-mips/smtc_ipi.h
+++ b/include/asm-mips/smtc_ipi.h
@@ -44,9 +44,6 @@ struct smtc_ipi_q {
44 int depth; 44 int depth;
45}; 45};
46 46
47extern struct smtc_ipi_q IPIQ[NR_CPUS];
48extern struct smtc_ipi_q freeIPIq;
49
50static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p) 47static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p)
51{ 48{
52 long flags; 49 long flags;
diff --git a/include/asm-mips/termios.h b/include/asm-mips/termios.h
index 4906204d34fe..2ce07f4be369 100644
--- a/include/asm-mips/termios.h
+++ b/include/asm-mips/termios.h
@@ -87,24 +87,6 @@ struct termio {
87#define TIOCM_OUT2 0x4000 87#define TIOCM_OUT2 0x4000
88#define TIOCM_LOOP 0x8000 88#define TIOCM_LOOP 0x8000
89 89
90/* line disciplines */
91#define N_TTY 0
92#define N_SLIP 1
93#define N_MOUSE 2
94#define N_PPP 3
95#define N_STRIP 4
96#define N_AX25 5
97#define N_X25 6 /* X.25 async */
98#define N_6PACK 7
99#define N_MASC 8 /* Reserved fo Mobitex module <kaz@cafe.net> */
100#define N_R3964 9 /* Reserved for Simatic R3964 module */
101#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
102#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
103#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
104#define N_HDLC 13 /* synchronous HDLC */
105#define N_SYNC_PPP 14 /* synchronous PPP */
106#define N_HCI 15 /* Bluetooth HCI UART */
107
108#ifdef __KERNEL__ 90#ifdef __KERNEL__
109 91
110#include <linux/string.h> 92#include <linux/string.h>
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h
index 1cdd4eeb2f73..825fcbd9eabd 100644
--- a/include/asm-mips/uaccess.h
+++ b/include/asm-mips/uaccess.h
@@ -265,8 +265,6 @@ do { \
265 */ 265 */
266#define __get_user_asm_ll32(val, addr) \ 266#define __get_user_asm_ll32(val, addr) \
267{ \ 267{ \
268 unsigned long long __gu_tmp; \
269 \
270 __asm__ __volatile__( \ 268 __asm__ __volatile__( \
271 "1: lw %1, (%3) \n" \ 269 "1: lw %1, (%3) \n" \
272 "2: lw %D1, 4(%3) \n" \ 270 "2: lw %D1, 4(%3) \n" \
@@ -281,9 +279,8 @@ do { \
281 " " __UA_ADDR " 1b, 4b \n" \ 279 " " __UA_ADDR " 1b, 4b \n" \
282 " " __UA_ADDR " 2b, 4b \n" \ 280 " " __UA_ADDR " 2b, 4b \n" \
283 " .previous \n" \ 281 " .previous \n" \
284 : "=r" (__gu_err), "=&r" (__gu_tmp) \ 282 : "=r" (__gu_err), "=&r" (val) \
285 : "0" (0), "r" (addr), "i" (-EFAULT)); \ 283 : "0" (0), "r" (addr), "i" (-EFAULT)); \
286 (val) = (__typeof__(*(addr))) __gu_tmp; \
287} 284}
288 285
289/* 286/*
@@ -488,7 +485,8 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
488}) 485})
489 486
490/* 487/*
491 * __copy_from_user: - Copy a block of data from user space, with less checking. * @to: Destination address, in kernel space. 488 * __copy_from_user: - Copy a block of data from user space, with less checking.
489 * @to: Destination address, in kernel space.
492 * @from: Source address, in user space. 490 * @from: Source address, in user space.
493 * @n: Number of bytes to copy. 491 * @n: Number of bytes to copy.
494 * 492 *
diff --git a/include/asm-mips/vr41xx/cmbvr4133.h b/include/asm-mips/vr41xx/cmbvr4133.h
index 9490ade58b46..42300037d593 100644
--- a/include/asm-mips/vr41xx/cmbvr4133.h
+++ b/include/asm-mips/vr41xx/cmbvr4133.h
@@ -35,8 +35,8 @@
35#define CMBVR41XX_INTD_IRQ GIU_IRQ(CMBVR41XX_INTD_PIN) 35#define CMBVR41XX_INTD_IRQ GIU_IRQ(CMBVR41XX_INTD_PIN)
36#define CMBVR41XX_INTE_IRQ GIU_IRQ(CMBVR41XX_INTE_PIN) 36#define CMBVR41XX_INTE_IRQ GIU_IRQ(CMBVR41XX_INTE_PIN)
37 37
38#define I8259_IRQ_BASE 72 38#define I8259A_IRQ_BASE 72
39#define I8259_IRQ(x) (I8259_IRQ_BASE + (x)) 39#define I8259_IRQ(x) (I8259A_IRQ_BASE + (x))
40#define TIMER_IRQ I8259_IRQ(0) 40#define TIMER_IRQ I8259_IRQ(0)
41#define KEYBOARD_IRQ I8259_IRQ(1) 41#define KEYBOARD_IRQ I8259_IRQ(1)
42#define I8259_SLAVE_IRQ I8259_IRQ(2) 42#define I8259_SLAVE_IRQ I8259_IRQ(2)
@@ -52,6 +52,5 @@
52#define AUX_IRQ I8259_IRQ(12) 52#define AUX_IRQ I8259_IRQ(12)
53#define IDE_PRIMARY_IRQ I8259_IRQ(14) 53#define IDE_PRIMARY_IRQ I8259_IRQ(14)
54#define IDE_SECONDARY_IRQ I8259_IRQ(15) 54#define IDE_SECONDARY_IRQ I8259_IRQ(15)
55#define I8259_IRQ_LAST IDE_SECONDARY_IRQ
56 55
57#endif /* __NEC_CMBVR4133_H */ 56#endif /* __NEC_CMBVR4133_H */
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h
index c1963ce19dd2..ca46e7cc0940 100644
--- a/include/asm-parisc/io.h
+++ b/include/asm-parisc/io.h
@@ -191,15 +191,6 @@ void memset_io(volatile void __iomem *addr, unsigned char val, int count);
191void memcpy_fromio(void *dst, const volatile void __iomem *src, int count); 191void memcpy_fromio(void *dst, const volatile void __iomem *src, int count);
192void memcpy_toio(volatile void __iomem *dst, const void *src, int count); 192void memcpy_toio(volatile void __iomem *dst, const void *src, int count);
193 193
194/*
195 * XXX - We don't have csum_partial_copy_fromio() yet, so we cheat here and
196 * just copy it. The net code will then do the checksum later. Presently
197 * only used by some shared memory 8390 Ethernet cards anyway.
198 */
199
200#define eth_io_copy_and_sum(skb,src,len,unused) \
201 memcpy_fromio((skb)->data,(src),(len))
202
203/* Port-space IO */ 194/* Port-space IO */
204 195
205#define inb_p inb 196#define inb_p inb
diff --git a/include/asm-parisc/mman.h b/include/asm-parisc/mman.h
index 0ef15ee0f17e..defe752cc996 100644
--- a/include/asm-parisc/mman.h
+++ b/include/asm-parisc/mman.h
@@ -55,7 +55,6 @@
55#define MADV_64M_PAGES 26 /* Use 64 Megabyte pages */ 55#define MADV_64M_PAGES 26 /* Use 64 Megabyte pages */
56 56
57/* compatibility flags */ 57/* compatibility flags */
58#define MAP_ANON MAP_ANONYMOUS
59#define MAP_FILE 0 58#define MAP_FILE 0
60#define MAP_VARIABLE 0 59#define MAP_VARIABLE 0
61 60
diff --git a/include/asm-parisc/termios.h b/include/asm-parisc/termios.h
index 6965e8f6c3e1..5345b3420475 100644
--- a/include/asm-parisc/termios.h
+++ b/include/asm-parisc/termios.h
@@ -39,24 +39,6 @@ struct termio {
39 39
40/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 40/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
41 41
42/* line disciplines */
43#define N_TTY 0
44#define N_SLIP 1
45#define N_MOUSE 2
46#define N_PPP 3
47#define N_STRIP 4
48#define N_AX25 5
49#define N_X25 6 /* X.25 async */
50#define N_6PACK 7
51#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
52#define N_R3964 9 /* Reserved for Simatic R3964 module */
53#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
54#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
55#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
56#define N_HDLC 13 /* synchronous HDLC */
57#define N_SYNC_PPP 14
58#define N_HCI 15 /* Bluetooth HCI UART */
59
60#ifdef __KERNEL__ 42#ifdef __KERNEL__
61 43
62/* intr=^C quit=^\ erase=del kill=^U 44/* intr=^C quit=^\ erase=del kill=^U
diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild
index 703970fb0ec0..4869513b872f 100644
--- a/include/asm-powerpc/Kbuild
+++ b/include/asm-powerpc/Kbuild
@@ -23,6 +23,7 @@ header-y += linkage.h
23header-y += resource.h 23header-y += resource.h
24header-y += sigcontext.h 24header-y += sigcontext.h
25header-y += statfs.h 25header-y += statfs.h
26header-y += ps3fb.h
26 27
27unifdef-y += a.out.h 28unifdef-y += a.out.h
28unifdef-y += asm-compat.h 29unifdef-y += asm-compat.h
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 7384b8086b75..e870b5393175 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -50,6 +50,12 @@ enum powerpc_oprofile_type {
50 PPC_OPROFILE_CELL = 5, 50 PPC_OPROFILE_CELL = 5,
51}; 51};
52 52
53enum powerpc_pmc_type {
54 PPC_PMC_DEFAULT = 0,
55 PPC_PMC_IBM = 1,
56 PPC_PMC_PA6T = 2,
57};
58
53struct cpu_spec { 59struct cpu_spec {
54 /* CPU is matched via (PVR & pvr_mask) == pvr_value */ 60 /* CPU is matched via (PVR & pvr_mask) == pvr_value */
55 unsigned int pvr_mask; 61 unsigned int pvr_mask;
@@ -65,6 +71,7 @@ struct cpu_spec {
65 71
66 /* number of performance monitor counters */ 72 /* number of performance monitor counters */
67 unsigned int num_pmcs; 73 unsigned int num_pmcs;
74 enum powerpc_pmc_type pmc_type;
68 75
69 /* this is called to initialize various CPU bits like L1 cache, 76 /* this is called to initialize various CPU bits like L1 cache,
70 * BHT, SPD, etc... from head.S before branching to identify_machine 77 * BHT, SPD, etc... from head.S before branching to identify_machine
@@ -337,12 +344,6 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
337 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 344 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
338 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ 345 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
339 CPU_FTR_DSCR) 346 CPU_FTR_DSCR)
340#define CPU_FTRS_POWER6X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
341 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
342 CPU_FTR_MMCRA | CPU_FTR_SMT | \
343 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
344 CPU_FTR_PURR | CPU_FTR_CI_LARGE_PAGE | \
345 CPU_FTR_SPURR | CPU_FTR_REAL_LE | CPU_FTR_DSCR)
346#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 347#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
347 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 348 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
348 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ 349 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
diff --git a/include/asm-powerpc/dcr.h b/include/asm-powerpc/dcr.h
index b66c5e6941f0..9338d50538f1 100644
--- a/include/asm-powerpc/dcr.h
+++ b/include/asm-powerpc/dcr.h
@@ -33,6 +33,7 @@
33 * base from the device-tree 33 * base from the device-tree
34 */ 34 */
35#ifdef CONFIG_PPC_MERGE 35#ifdef CONFIG_PPC_MERGE
36struct device_node;
36extern unsigned int dcr_resource_start(struct device_node *np, 37extern unsigned int dcr_resource_start(struct device_node *np,
37 unsigned int index); 38 unsigned int index);
38extern unsigned int dcr_resource_len(struct device_node *np, 39extern unsigned int dcr_resource_len(struct device_node *np,
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h
index d36426c01b6b..de507995c7b1 100644
--- a/include/asm-powerpc/elf.h
+++ b/include/asm-powerpc/elf.h
@@ -173,7 +173,7 @@ typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32];
173 the loader. We need to make sure that it is out of the way of the program 173 the loader. We need to make sure that it is out of the way of the program
174 that it will "exec", and that there is sufficient room for the brk. */ 174 that it will "exec", and that there is sufficient room for the brk. */
175 175
176#define ELF_ET_DYN_BASE (0x08000000) 176#define ELF_ET_DYN_BASE (0x20000000)
177 177
178/* Common routine for both 32-bit and 64-bit processes */ 178/* Common routine for both 32-bit and 64-bit processes */
179static inline void ppc_elf_core_copy_regs(elf_gregset_t elf_regs, 179static inline void ppc_elf_core_copy_regs(elf_gregset_t elf_regs,
diff --git a/include/asm-powerpc/firmware.h b/include/asm-powerpc/firmware.h
index 98f7b62422c9..3671c128f271 100644
--- a/include/asm-powerpc/firmware.h
+++ b/include/asm-powerpc/firmware.h
@@ -43,6 +43,8 @@
43#define FW_FEATURE_ISERIES ASM_CONST(0x0000000000200000) 43#define FW_FEATURE_ISERIES ASM_CONST(0x0000000000200000)
44#define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000) 44#define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000)
45#define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000) 45#define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000)
46#define FW_FEATURE_BEAT ASM_CONST(0x0000000001000000)
47#define FW_FEATURE_BULK_REMOVE ASM_CONST(0x0000000002000000)
46 48
47#ifndef __ASSEMBLY__ 49#ifndef __ASSEMBLY__
48 50
@@ -61,6 +63,8 @@ enum {
61 FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, 63 FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR,
62 FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1, 64 FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
63 FW_FEATURE_PS3_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1, 65 FW_FEATURE_PS3_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
66 FW_FEATURE_CELLEB_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_BEAT,
67 FW_FEATURE_CELLEB_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_BEAT,
64 FW_FEATURE_NATIVE_POSSIBLE = 0, 68 FW_FEATURE_NATIVE_POSSIBLE = 0,
65 FW_FEATURE_NATIVE_ALWAYS = 0, 69 FW_FEATURE_NATIVE_ALWAYS = 0,
66 FW_FEATURE_POSSIBLE = 70 FW_FEATURE_POSSIBLE =
@@ -73,6 +77,9 @@ enum {
73#ifdef CONFIG_PPC_PS3 77#ifdef CONFIG_PPC_PS3
74 FW_FEATURE_PS3_POSSIBLE | 78 FW_FEATURE_PS3_POSSIBLE |
75#endif 79#endif
80#ifdef CONFIG_PPC_CELLEB
81 FW_FEATURE_CELLEB_POSSIBLE |
82#endif
76#ifdef CONFIG_PPC_NATIVE 83#ifdef CONFIG_PPC_NATIVE
77 FW_FEATURE_NATIVE_ALWAYS | 84 FW_FEATURE_NATIVE_ALWAYS |
78#endif 85#endif
@@ -87,6 +94,9 @@ enum {
87#ifdef CONFIG_PPC_PS3 94#ifdef CONFIG_PPC_PS3
88 FW_FEATURE_PS3_ALWAYS & 95 FW_FEATURE_PS3_ALWAYS &
89#endif 96#endif
97#ifdef CONFIG_PPC_CELLEB
98 FW_FEATURE_CELLEB_ALWAYS &
99#endif
90#ifdef CONFIG_PPC_NATIVE 100#ifdef CONFIG_PPC_NATIVE
91 FW_FEATURE_NATIVE_ALWAYS & 101 FW_FEATURE_NATIVE_ALWAYS &
92#endif 102#endif
diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h
index 3d0e819d37f1..c624915b757e 100644
--- a/include/asm-powerpc/fs_pd.h
+++ b/include/asm-powerpc/fs_pd.h
@@ -11,19 +11,17 @@
11 11
12#ifndef FS_PD_H 12#ifndef FS_PD_H
13#define FS_PD_H 13#define FS_PD_H
14#include <asm/cpm2.h>
15#include <sysdev/fsl_soc.h> 14#include <sysdev/fsl_soc.h>
16#include <asm/time.h> 15#include <asm/time.h>
17 16
18static inline int uart_baudrate(void) 17#ifdef CONFIG_CPM2
19{ 18#include <asm/cpm2.h>
20 return get_baudrate();
21}
22 19
23static inline int uart_clock(void) 20#if defined(CONFIG_8260)
24{ 21#include <asm/mpc8260.h>
25 return ppc_proc_freq; 22#elif defined(CONFIG_85xx)
26} 23#include <asm/mpc85xx.h>
24#endif
27 25
28#define cpm2_map(member) \ 26#define cpm2_map(member) \
29({ \ 27({ \
@@ -41,5 +39,38 @@ static inline int uart_clock(void)
41}) 39})
42 40
43#define cpm2_unmap(addr) iounmap(addr) 41#define cpm2_unmap(addr) iounmap(addr)
42#endif
43
44#ifdef CONFIG_8xx
45#include <asm/8xx_immap.h>
46#include <asm/mpc8xx.h>
47
48#define immr_map(member) \
49({ \
50 u32 offset = offsetof(immap_t, member); \
51 void *addr = ioremap (IMAP_ADDR + offset, \
52 sizeof( ((immap_t*)0)->member)); \
53 addr; \
54})
55
56#define immr_map_size(member, size) \
57({ \
58 u32 offset = offsetof(immap_t, member); \
59 void *addr = ioremap (IMAP_ADDR + offset, size); \
60 addr; \
61})
62
63#define immr_unmap(addr) iounmap(addr)
64#endif
65
66static inline int uart_baudrate(void)
67{
68 return get_baudrate();
69}
70
71static inline int uart_clock(void)
72{
73 return ppc_proc_freq;
74}
44 75
45#endif 76#endif
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h
index 7a500732b671..60977806d2f4 100644
--- a/include/asm-powerpc/hvcall.h
+++ b/include/asm-powerpc/hvcall.h
@@ -168,6 +168,7 @@
168#define H_FREE_LOGICAL_LAN 0x118 168#define H_FREE_LOGICAL_LAN 0x118
169#define H_ADD_LOGICAL_LAN_BUFFER 0x11C 169#define H_ADD_LOGICAL_LAN_BUFFER 0x11C
170#define H_SEND_LOGICAL_LAN 0x120 170#define H_SEND_LOGICAL_LAN 0x120
171#define H_BULK_REMOVE 0x124
171#define H_MULTICAST_CTRL 0x130 172#define H_MULTICAST_CTRL 0x130
172#define H_SET_XDABR 0x134 173#define H_SET_XDABR 0x134
173#define H_STUFF_TCE 0x138 174#define H_STUFF_TCE 0x138
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 1cd532379c30..301c9bb308b1 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -732,6 +732,12 @@ static inline void * bus_to_virt(unsigned long address)
732 732
733#endif /* CONFIG_PPC32 */ 733#endif /* CONFIG_PPC32 */
734 734
735/* access ports */
736#define setbits32(_addr, _v) out_be32((_addr), in_be32(_addr) | (_v))
737#define clrbits32(_addr, _v) out_be32((_addr), in_be32(_addr) & ~(_v))
738
739#define setbits16(_addr, _v) out_be16((_addr), in_be16(_addr) | (_v))
740#define clrbits16(_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v))
735 741
736#endif /* __KERNEL__ */ 742#endif /* __KERNEL__ */
737 743
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h
index f85dbd305558..b2e56b30306a 100644
--- a/include/asm-powerpc/iommu.h
+++ b/include/asm-powerpc/iommu.h
@@ -99,6 +99,7 @@ extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
99extern void iommu_init_early_pSeries(void); 99extern void iommu_init_early_pSeries(void);
100extern void iommu_init_early_iSeries(void); 100extern void iommu_init_early_iSeries(void);
101extern void iommu_init_early_dart(void); 101extern void iommu_init_early_dart(void);
102extern void iommu_init_early_pasemi(void);
102 103
103#ifdef CONFIG_PCI 104#ifdef CONFIG_PCI
104extern void pci_iommu_init(void); 105extern void pci_iommu_init(void);
diff --git a/include/asm-powerpc/ipic.h b/include/asm-powerpc/ipic.h
index 9fbb03415860..edec79dcb7c1 100644
--- a/include/asm-powerpc/ipic.h
+++ b/include/asm-powerpc/ipic.h
@@ -78,7 +78,7 @@ extern u32 ipic_get_mcp_status(void);
78extern void ipic_clear_mcp_status(u32 mask); 78extern void ipic_clear_mcp_status(u32 mask);
79 79
80#ifdef CONFIG_PPC_MERGE 80#ifdef CONFIG_PPC_MERGE
81extern void ipic_init(struct device_node *node, unsigned int flags); 81extern struct ipic * ipic_init(struct device_node *node, unsigned int flags);
82extern unsigned int ipic_get_irq(void); 82extern unsigned int ipic_get_irq(void);
83#else 83#else
84extern void ipic_init(phys_addr_t phys_addr, unsigned int flags, 84extern void ipic_init(phys_addr_t phys_addr, unsigned int flags,
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index 46476e9a494a..4734cc178db5 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -89,6 +89,9 @@ struct irq_host_ops {
89 /* Dispose of such a mapping */ 89 /* Dispose of such a mapping */
90 void (*unmap)(struct irq_host *h, unsigned int virq); 90 void (*unmap)(struct irq_host *h, unsigned int virq);
91 91
92 /* Update of such a mapping */
93 void (*remap)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw);
94
92 /* Translate device-tree interrupt specifier from raw format coming 95 /* Translate device-tree interrupt specifier from raw format coming
93 * from the firmware to a irq_hw_number_t (interrupt line number) and 96 * from the firmware to a irq_hw_number_t (interrupt line number) and
94 * type (sense) that can be passed to set_irq_type(). In the absence 97 * type (sense) that can be passed to set_irq_type(). In the absence
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index 2dafa376a63f..3a5dd492588f 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -44,6 +44,7 @@ typedef unsigned int kprobe_opcode_t;
44#define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) 44#define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000)
45#define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) 45#define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000)
46 46
47#ifdef CONFIG_PPC64
47/* 48/*
48 * 64bit powerpc uses function descriptors. 49 * 64bit powerpc uses function descriptors.
49 * Handle cases where: 50 * Handle cases where:
@@ -67,9 +68,13 @@ typedef unsigned int kprobe_opcode_t;
67} 68}
68 69
69#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) 70#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry)
70
71#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ 71#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \
72 IS_TWI(instr) || IS_TDI(instr)) 72 IS_TWI(instr) || IS_TDI(instr))
73#else
74/* Use stock kprobe_lookup_name since ppc32 doesn't use function descriptors */
75#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)(pentry)
76#define is_trap(instr) (IS_TW(instr) || IS_TWI(instr))
77#endif
73 78
74#define ARCH_SUPPORTS_KRETPROBES 79#define ARCH_SUPPORTS_KRETPROBES
75#define ARCH_INACTIVE_KPROBE_COUNT 1 80#define ARCH_INACTIVE_KPROBE_COUNT 1
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h
index 41c8c9c5a254..200055a4b82b 100644
--- a/include/asm-powerpc/mmu.h
+++ b/include/asm-powerpc/mmu.h
@@ -247,6 +247,7 @@ extern void htab_initialize_secondary(void);
247extern void hpte_init_native(void); 247extern void hpte_init_native(void);
248extern void hpte_init_lpar(void); 248extern void hpte_init_lpar(void);
249extern void hpte_init_iSeries(void); 249extern void hpte_init_iSeries(void);
250extern void hpte_init_beat(void);
250 251
251extern void stabs_alloc(void); 252extern void stabs_alloc(void);
252extern void slb_initialize(void); 253extern void slb_initialize(void);
diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
index 4560d72fc758..7afd5bf94528 100644
--- a/include/asm-powerpc/mpc52xx.h
+++ b/include/asm-powerpc/mpc52xx.h
@@ -249,6 +249,8 @@ extern void mpc52xx_declare_of_platform_devices(void);
249extern void mpc52xx_init_irq(void); 249extern void mpc52xx_init_irq(void);
250extern unsigned int mpc52xx_get_irq(void); 250extern unsigned int mpc52xx_get_irq(void);
251 251
252extern int __init mpc52xx_add_bridge(struct device_node *node);
253
252#endif /* __ASSEMBLY__ */ 254#endif /* __ASSEMBLY__ */
253 255
254#endif /* __ASM_POWERPC_MPC52xx_H__ */ 256#endif /* __ASM_POWERPC_MPC52xx_H__ */
diff --git a/include/asm-powerpc/mpc8260.h b/include/asm-powerpc/mpc8260.h
new file mode 100644
index 000000000000..f1b83b09ab2e
--- /dev/null
+++ b/include/asm-powerpc/mpc8260.h
@@ -0,0 +1,24 @@
1/*
2 * Since there are many different boards and no standard configuration,
3 * we have a unique include file for each. Rather than change every
4 * file that has to include MPC8260 configuration, they all include
5 * this one and the configuration switching is done here.
6 */
7#ifdef __KERNEL__
8#ifndef __ASM_PPC_MPC8260_H__
9#define __ASM_PPC_MPC8260_H__
10
11
12#ifdef CONFIG_8260
13
14#if defined(CONFIG_PQ2ADS) || defined (CONFIG_PQ2FADS)
15#include <platforms/82xx/pq2ads.h>
16#endif
17
18#ifdef CONFIG_PCI_8260
19#include <platforms/82xx/m82xx_pci.h>
20#endif
21
22#endif /* CONFIG_8260 */
23#endif /* !__ASM_PPC_MPC8260_H__ */
24#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h
new file mode 100644
index 000000000000..580371120e1a
--- /dev/null
+++ b/include/asm-powerpc/mpc8xx.h
@@ -0,0 +1,28 @@
1/* This is the single file included by all MPC8xx build options.
2 * Since there are many different boards and no standard configuration,
3 * we have a unique include file for each. Rather than change every
4 * file that has to include MPC8xx configuration, they all include
5 * this one and the configuration switching is done here.
6 */
7#ifdef __KERNEL__
8#ifndef __CONFIG_8xx_DEFS
9#define __CONFIG_8xx_DEFS
10
11
12#ifdef CONFIG_8xx
13
14#ifdef CONFIG_FADS
15#include <platforms/fads.h>
16#endif
17
18#if defined(CONFIG_MPC86XADS)
19#include <platforms/8xx/mpc86xads.h>
20#endif
21
22#if defined(CONFIG_MPC885ADS)
23#include <platforms/8xx/mpc885ads.h>
24#endif
25
26#endif /* CONFIG_8xx */
27#endif /* __CONFIG_8xx_DEFS */
28#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index b71e7b32a555..cb204a71e912 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -103,21 +103,6 @@
103#define MPIC_MAX_ISU 32 103#define MPIC_MAX_ISU 32
104 104
105/* 105/*
106 * Special vector numbers (internal use only)
107 */
108#define MPIC_VEC_SPURRIOUS 255
109#define MPIC_VEC_IPI_3 254
110#define MPIC_VEC_IPI_2 253
111#define MPIC_VEC_IPI_1 252
112#define MPIC_VEC_IPI_0 251
113
114/* unused */
115#define MPIC_VEC_TIMER_3 250
116#define MPIC_VEC_TIMER_2 249
117#define MPIC_VEC_TIMER_1 248
118#define MPIC_VEC_TIMER_0 247
119
120/*
121 * Tsi108 implementation of MPIC has many differences from the original one 106 * Tsi108 implementation of MPIC has many differences from the original one
122 */ 107 */
123 108
@@ -276,6 +261,13 @@ struct mpic
276 unsigned char *senses; 261 unsigned char *senses;
277 unsigned int senses_count; 262 unsigned int senses_count;
278 263
264 /* vector numbers used for internal sources (ipi/timers) */
265 unsigned int ipi_vecs[4];
266 unsigned int timer_vecs[4];
267
268 /* Spurious vector to program into unused sources */
269 unsigned int spurious_vec;
270
279#ifdef CONFIG_MPIC_BROKEN_U3 271#ifdef CONFIG_MPIC_BROKEN_U3
280 /* The fixup table */ 272 /* The fixup table */
281 struct mpic_irq_fixup *fixups; 273 struct mpic_irq_fixup *fixups;
@@ -332,6 +324,8 @@ struct mpic
332#define MPIC_NO_PTHROU_DIS 0x00000040 324#define MPIC_NO_PTHROU_DIS 0x00000040
333/* DCR based MPIC */ 325/* DCR based MPIC */
334#define MPIC_USES_DCR 0x00000080 326#define MPIC_USES_DCR 0x00000080
327/* MPIC has 11-bit vector fields (or larger) */
328#define MPIC_LARGE_VECTORS 0x00000100
335 329
336/* MPIC HW modification ID */ 330/* MPIC HW modification ID */
337#define MPIC_REGSET_MASK 0xf0000000 331#define MPIC_REGSET_MASK 0xf0000000
diff --git a/include/asm-powerpc/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h
index 71043bf3641f..94c0ad2bff96 100644
--- a/include/asm-powerpc/oprofile_impl.h
+++ b/include/asm-powerpc/oprofile_impl.h
@@ -58,10 +58,8 @@ extern struct op_powerpc_model op_model_power4;
58extern struct op_powerpc_model op_model_7450; 58extern struct op_powerpc_model op_model_7450;
59extern struct op_powerpc_model op_model_cell; 59extern struct op_powerpc_model op_model_cell;
60 60
61#ifndef CONFIG_FSL_BOOKE
62
63/* All the classic PPC parts use these */ 61/* All the classic PPC parts use these */
64static inline unsigned int ctr_read(unsigned int i) 62static inline unsigned int classic_ctr_read(unsigned int i)
65{ 63{
66 switch(i) { 64 switch(i) {
67 case 0: 65 case 0:
@@ -89,7 +87,7 @@ static inline unsigned int ctr_read(unsigned int i)
89 } 87 }
90} 88}
91 89
92static inline void ctr_write(unsigned int i, unsigned int val) 90static inline void classic_ctr_write(unsigned int i, unsigned int val)
93{ 91{
94 switch(i) { 92 switch(i) {
95 case 0: 93 case 0:
@@ -124,89 +122,6 @@ static inline void ctr_write(unsigned int i, unsigned int val)
124 break; 122 break;
125 } 123 }
126} 124}
127#else /* CONFIG_FSL_BOOKE */
128static inline u32 get_pmlca(int ctr)
129{
130 u32 pmlca;
131
132 switch (ctr) {
133 case 0:
134 pmlca = mfpmr(PMRN_PMLCA0);
135 break;
136 case 1:
137 pmlca = mfpmr(PMRN_PMLCA1);
138 break;
139 case 2:
140 pmlca = mfpmr(PMRN_PMLCA2);
141 break;
142 case 3:
143 pmlca = mfpmr(PMRN_PMLCA3);
144 break;
145 default:
146 panic("Bad ctr number\n");
147 }
148
149 return pmlca;
150}
151
152static inline void set_pmlca(int ctr, u32 pmlca)
153{
154 switch (ctr) {
155 case 0:
156 mtpmr(PMRN_PMLCA0, pmlca);
157 break;
158 case 1:
159 mtpmr(PMRN_PMLCA1, pmlca);
160 break;
161 case 2:
162 mtpmr(PMRN_PMLCA2, pmlca);
163 break;
164 case 3:
165 mtpmr(PMRN_PMLCA3, pmlca);
166 break;
167 default:
168 panic("Bad ctr number\n");
169 }
170}
171
172static inline unsigned int ctr_read(unsigned int i)
173{
174 switch(i) {
175 case 0:
176 return mfpmr(PMRN_PMC0);
177 case 1:
178 return mfpmr(PMRN_PMC1);
179 case 2:
180 return mfpmr(PMRN_PMC2);
181 case 3:
182 return mfpmr(PMRN_PMC3);
183 default:
184 return 0;
185 }
186}
187
188static inline void ctr_write(unsigned int i, unsigned int val)
189{
190 switch(i) {
191 case 0:
192 mtpmr(PMRN_PMC0, val);
193 break;
194 case 1:
195 mtpmr(PMRN_PMC1, val);
196 break;
197 case 2:
198 mtpmr(PMRN_PMC2, val);
199 break;
200 case 3:
201 mtpmr(PMRN_PMC3, val);
202 break;
203 default:
204 break;
205 }
206}
207
208
209#endif /* CONFIG_FSL_BOOKE */
210 125
211 126
212extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth); 127extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth);
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index cb02c9d1ef93..d9bf5aba96cb 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -53,6 +53,8 @@ struct pci_controller {
53 unsigned long buid; 53 unsigned long buid;
54 unsigned long dma_window_base_cur; 54 unsigned long dma_window_base_cur;
55 unsigned long dma_window_size; 55 unsigned long dma_window_size;
56
57 void *private_data;
56}; 58};
57 59
58/* 60/*
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h
index 52a69ed0d90a..e5982ad46576 100644
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -21,11 +21,33 @@
21#if !defined(_ASM_POWERPC_PS3_H) 21#if !defined(_ASM_POWERPC_PS3_H)
22#define _ASM_POWERPC_PS3_H 22#define _ASM_POWERPC_PS3_H
23 23
24#include <linux/compiler.h> /* for __deprecated */
25#include <linux/init.h> 24#include <linux/init.h>
26#include <linux/types.h> 25#include <linux/types.h>
27#include <linux/device.h> 26#include <linux/device.h>
28 27
28union ps3_firmware_version {
29 u64 raw;
30 struct {
31 u16 pad;
32 u16 major;
33 u16 minor;
34 u16 rev;
35 };
36};
37
38int ps3_get_firmware_version(union ps3_firmware_version *v);
39
40/* 'Other OS' area */
41
42enum ps3_param_av_multi_out {
43 PS3_PARAM_AV_MULTI_OUT_NTSC = 0,
44 PS3_PARAM_AV_MULTI_OUT_PAL_RGB = 1,
45 PS3_PARAM_AV_MULTI_OUT_PAL_YCBCR = 2,
46 PS3_PARAM_AV_MULTI_OUT_SECAM = 3,
47};
48
49enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void);
50
29/** 51/**
30 * struct ps3_device_id - HV bus device identifier from the system repository 52 * struct ps3_device_id - HV bus device identifier from the system repository
31 * @bus_id: HV bus id, {1..} (zero invalid) 53 * @bus_id: HV bus id, {1..} (zero invalid)
@@ -139,20 +161,32 @@ unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr);
139 161
140/* inrerrupt routines */ 162/* inrerrupt routines */
141 163
142int ps3_alloc_io_irq(unsigned int interrupt_id, unsigned int *virq); 164enum ps3_cpu_binding {
165 PS3_BINDING_CPU_ANY = -1,
166 PS3_BINDING_CPU_0 = 0,
167 PS3_BINDING_CPU_1 = 1,
168};
169
170int ps3_alloc_io_irq(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
171 unsigned int *virq);
143int ps3_free_io_irq(unsigned int virq); 172int ps3_free_io_irq(unsigned int virq);
144int ps3_alloc_event_irq(unsigned int *virq); 173int ps3_alloc_event_irq(enum ps3_cpu_binding cpu, unsigned int *virq);
145int ps3_free_event_irq(unsigned int virq); 174int ps3_free_event_irq(unsigned int virq);
146int ps3_send_event_locally(unsigned int virq); 175int ps3_send_event_locally(unsigned int virq);
147int ps3_connect_event_irq(const struct ps3_device_id *did, 176int ps3_connect_event_irq(enum ps3_cpu_binding cpu,
148 unsigned int interrupt_id, unsigned int *virq); 177 const struct ps3_device_id *did, unsigned int interrupt_id,
178 unsigned int *virq);
149int ps3_disconnect_event_irq(const struct ps3_device_id *did, 179int ps3_disconnect_event_irq(const struct ps3_device_id *did,
150 unsigned int interrupt_id, unsigned int virq); 180 unsigned int interrupt_id, unsigned int virq);
151int ps3_alloc_vuart_irq(void* virt_addr_bmp, unsigned int *virq); 181int ps3_alloc_vuart_irq(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
152int ps3_free_vuart_irq(unsigned int virq);
153int ps3_alloc_spe_irq(unsigned long spe_id, unsigned int class,
154 unsigned int *virq); 182 unsigned int *virq);
183int ps3_free_vuart_irq(unsigned int virq);
184int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id,
185 unsigned int class, unsigned int *virq);
155int ps3_free_spe_irq(unsigned int virq); 186int ps3_free_spe_irq(unsigned int virq);
187int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet,
188 unsigned int *virq);
189int ps3_free_irq(unsigned int virq);
156 190
157/* lv1 result codes */ 191/* lv1 result codes */
158 192
@@ -247,146 +281,6 @@ static inline const char* ps3_result(int result)
247#endif 281#endif
248} 282}
249 283
250/* repository bus info */
251
252enum ps3_bus_type {
253 PS3_BUS_TYPE_SB = 4,
254 PS3_BUS_TYPE_STORAGE = 5,
255};
256
257enum ps3_dev_type {
258 PS3_DEV_TYPE_SB_GELIC = 3,
259 PS3_DEV_TYPE_SB_USB = 4,
260 PS3_DEV_TYPE_SB_GPIO = 6,
261};
262
263int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str,
264 u64 *value);
265int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id);
266int ps3_repository_read_bus_type(unsigned int bus_index,
267 enum ps3_bus_type *bus_type);
268int ps3_repository_read_bus_num_dev(unsigned int bus_index,
269 unsigned int *num_dev);
270
271/* repository bus device info */
272
273enum ps3_interrupt_type {
274 PS3_INTERRUPT_TYPE_EVENT_PORT = 2,
275 PS3_INTERRUPT_TYPE_SB_OHCI = 3,
276 PS3_INTERRUPT_TYPE_SB_EHCI = 4,
277 PS3_INTERRUPT_TYPE_OTHER = 5,
278};
279
280enum ps3_region_type {
281 PS3_REGION_TYPE_SB_OHCI = 3,
282 PS3_REGION_TYPE_SB_EHCI = 4,
283 PS3_REGION_TYPE_SB_GPIO = 5,
284};
285
286int ps3_repository_read_dev_str(unsigned int bus_index,
287 unsigned int dev_index, const char *dev_str, u64 *value);
288int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index,
289 unsigned int *dev_id);
290int ps3_repository_read_dev_type(unsigned int bus_index,
291 unsigned int dev_index, enum ps3_dev_type *dev_type);
292int ps3_repository_read_dev_intr(unsigned int bus_index,
293 unsigned int dev_index, unsigned int intr_index,
294 enum ps3_interrupt_type *intr_type, unsigned int *interrupt_id);
295int ps3_repository_read_dev_reg_type(unsigned int bus_index,
296 unsigned int dev_index, unsigned int reg_index,
297 enum ps3_region_type *reg_type);
298int ps3_repository_read_dev_reg_addr(unsigned int bus_index,
299 unsigned int dev_index, unsigned int reg_index, u64 *bus_addr,
300 u64 *len);
301int ps3_repository_read_dev_reg(unsigned int bus_index,
302 unsigned int dev_index, unsigned int reg_index,
303 enum ps3_region_type *reg_type, u64 *bus_addr, u64 *len);
304
305/* repository bus enumerators */
306
307struct ps3_repository_device {
308 unsigned int bus_index;
309 unsigned int dev_index;
310 struct ps3_device_id did;
311};
312
313int ps3_repository_find_device(enum ps3_bus_type bus_type,
314 enum ps3_dev_type dev_type,
315 const struct ps3_repository_device *start_dev,
316 struct ps3_repository_device *dev);
317static inline int ps3_repository_find_first_device(
318 enum ps3_bus_type bus_type, enum ps3_dev_type dev_type,
319 struct ps3_repository_device *dev)
320{
321 return ps3_repository_find_device(bus_type, dev_type, NULL, dev);
322}
323int ps3_repository_find_interrupt(const struct ps3_repository_device *dev,
324 enum ps3_interrupt_type intr_type, unsigned int *interrupt_id);
325int ps3_repository_find_region(const struct ps3_repository_device *dev,
326 enum ps3_region_type reg_type, u64 *bus_addr, u64 *len);
327
328/* repository block device info */
329
330int ps3_repository_read_dev_port(unsigned int bus_index,
331 unsigned int dev_index, u64 *port);
332int ps3_repository_read_dev_blk_size(unsigned int bus_index,
333 unsigned int dev_index, u64 *blk_size);
334int ps3_repository_read_dev_num_blocks(unsigned int bus_index,
335 unsigned int dev_index, u64 *num_blocks);
336int ps3_repository_read_dev_num_regions(unsigned int bus_index,
337 unsigned int dev_index, unsigned int *num_regions);
338int ps3_repository_read_dev_region_id(unsigned int bus_index,
339 unsigned int dev_index, unsigned int region_index,
340 unsigned int *region_id);
341int ps3_repository_read_dev_region_size(unsigned int bus_index,
342 unsigned int dev_index, unsigned int region_index, u64 *region_size);
343int ps3_repository_read_dev_region_start(unsigned int bus_index,
344 unsigned int dev_index, unsigned int region_index, u64 *region_start);
345
346/* repository pu and memory info */
347
348int ps3_repository_read_num_pu(unsigned int *num_pu);
349int ps3_repository_read_ppe_id(unsigned int *pu_index, unsigned int *ppe_id);
350int ps3_repository_read_rm_base(unsigned int ppe_id, u64 *rm_base);
351int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size);
352int ps3_repository_read_region_total(u64 *region_total);
353int ps3_repository_read_mm_info(u64 *rm_base, u64 *rm_size,
354 u64 *region_total);
355
356/* repository pme info */
357
358int ps3_repository_read_num_be(unsigned int *num_be);
359int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id);
360int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq);
361int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq);
362
363/* repository 'Other OS' area */
364
365int ps3_repository_read_boot_dat_addr(u64 *lpar_addr);
366int ps3_repository_read_boot_dat_size(unsigned int *size);
367int ps3_repository_read_boot_dat_info(u64 *lpar_addr, unsigned int *size);
368
369/* repository spu info */
370
371/**
372 * enum spu_resource_type - Type of spu resource.
373 * @spu_resource_type_shared: Logical spu is shared with other partions.
374 * @spu_resource_type_exclusive: Logical spu is not shared with other partions.
375 *
376 * Returned by ps3_repository_read_spu_resource_id().
377 */
378
379enum ps3_spu_resource_type {
380 PS3_SPU_RESOURCE_TYPE_SHARED = 0,
381 PS3_SPU_RESOURCE_TYPE_EXCLUSIVE = 0x8000000000000000UL,
382};
383
384int ps3_repository_read_num_spu_reserved(unsigned int *num_spu_reserved);
385int ps3_repository_read_num_spu_resource_id(unsigned int *num_resource_id);
386int ps3_repository_read_spu_resource_id(unsigned int res_index,
387 enum ps3_spu_resource_type* resource_type, unsigned int *resource_id);
388
389
390/* system bus routines */ 284/* system bus routines */
391 285
392enum ps3_match_id { 286enum ps3_match_id {
@@ -459,4 +353,48 @@ static inline void *ps3_system_bus_get_driver_data(
459 353
460extern struct bus_type ps3_system_bus_type; 354extern struct bus_type ps3_system_bus_type;
461 355
356/* vuart routines */
357
358struct ps3_vuart_stats {
359 unsigned long bytes_written;
360 unsigned long bytes_read;
361 unsigned long tx_interrupts;
362 unsigned long rx_interrupts;
363 unsigned long disconnect_interrupts;
364};
365
366/**
367 * struct ps3_vuart_port_device - a device on a vuart port
368 */
369
370struct ps3_vuart_port_device {
371 enum ps3_match_id match_id;
372 struct device core;
373
374 /* private driver variables */
375 unsigned int port_number;
376 u64 interrupt_mask;
377 struct {
378 spinlock_t lock;
379 struct list_head head;
380 } tx_list;
381 struct {
382 unsigned long bytes_held;
383 spinlock_t lock;
384 struct list_head head;
385 } rx_list;
386 struct ps3_vuart_stats stats;
387};
388
389int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev);
390
391struct ps3_prealloc {
392 const char *name;
393 void *address;
394 unsigned long size;
395 unsigned long align;
396};
397
398extern struct ps3_prealloc ps3fb_videomemory;
399
462#endif 400#endif
diff --git a/include/asm-powerpc/ps3av.h b/include/asm-powerpc/ps3av.h
new file mode 100644
index 000000000000..43e90ea96136
--- /dev/null
+++ b/include/asm-powerpc/ps3av.h
@@ -0,0 +1,738 @@
1/*
2 * Copyright (C) 2006 Sony Computer Entertainment Inc.
3 * Copyright 2006, 2007 Sony Corporation
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published
7 * by the Free Software Foundation; version 2 of the License.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18#ifndef _ASM_POWERPC_PS3AV_H_
19#define _ASM_POWERPC_PS3AV_H_
20
21#include <linux/mutex.h>
22
23/** command for ioctl() **/
24#define PS3AV_VERSION 0x205 /* version of ps3av command */
25
26#define PS3AV_CID_AV_INIT 0x00000001
27#define PS3AV_CID_AV_FIN 0x00000002
28#define PS3AV_CID_AV_GET_HW_CONF 0x00000003
29#define PS3AV_CID_AV_GET_MONITOR_INFO 0x00000004
30#define PS3AV_CID_AV_ENABLE_EVENT 0x00000006
31#define PS3AV_CID_AV_DISABLE_EVENT 0x00000007
32#define PS3AV_CID_AV_TV_MUTE 0x0000000a
33
34#define PS3AV_CID_AV_VIDEO_CS 0x00010001
35#define PS3AV_CID_AV_VIDEO_MUTE 0x00010002
36#define PS3AV_CID_AV_VIDEO_DISABLE_SIG 0x00010003
37#define PS3AV_CID_AV_AUDIO_PARAM 0x00020001
38#define PS3AV_CID_AV_AUDIO_MUTE 0x00020002
39#define PS3AV_CID_AV_HDMI_MODE 0x00040001
40
41#define PS3AV_CID_VIDEO_INIT 0x01000001
42#define PS3AV_CID_VIDEO_MODE 0x01000002
43#define PS3AV_CID_VIDEO_FORMAT 0x01000004
44#define PS3AV_CID_VIDEO_PITCH 0x01000005
45
46#define PS3AV_CID_AUDIO_INIT 0x02000001
47#define PS3AV_CID_AUDIO_MODE 0x02000002
48#define PS3AV_CID_AUDIO_MUTE 0x02000003
49#define PS3AV_CID_AUDIO_ACTIVE 0x02000004
50#define PS3AV_CID_AUDIO_INACTIVE 0x02000005
51#define PS3AV_CID_AUDIO_SPDIF_BIT 0x02000006
52#define PS3AV_CID_AUDIO_CTRL 0x02000007
53
54#define PS3AV_CID_EVENT_UNPLUGGED 0x10000001
55#define PS3AV_CID_EVENT_PLUGGED 0x10000002
56#define PS3AV_CID_EVENT_HDCP_DONE 0x10000003
57#define PS3AV_CID_EVENT_HDCP_FAIL 0x10000004
58#define PS3AV_CID_EVENT_HDCP_AUTH 0x10000005
59#define PS3AV_CID_EVENT_HDCP_ERROR 0x10000006
60
61#define PS3AV_CID_AVB_PARAM 0x04000001
62
63/* max backend ports */
64#define PS3AV_HDMI_MAX 2 /* HDMI_0 HDMI_1 */
65#define PS3AV_AVMULTI_MAX 1 /* AVMULTI_0 */
66#define PS3AV_AV_PORT_MAX (PS3AV_HDMI_MAX + PS3AV_AVMULTI_MAX)
67#define PS3AV_OPT_PORT_MAX 1 /* SPDIF0 */
68#define PS3AV_HEAD_MAX 2 /* HEAD_A HEAD_B */
69
70/* num of pkt for PS3AV_CID_AVB_PARAM */
71#define PS3AV_AVB_NUM_VIDEO PS3AV_HEAD_MAX
72#define PS3AV_AVB_NUM_AUDIO 0 /* not supported */
73#define PS3AV_AVB_NUM_AV_VIDEO PS3AV_AV_PORT_MAX
74#define PS3AV_AVB_NUM_AV_AUDIO PS3AV_HDMI_MAX
75
76#define PS3AV_MUTE_PORT_MAX 1 /* num of ports in mute pkt */
77
78/* event_bit */
79#define PS3AV_CMD_EVENT_BIT_UNPLUGGED (1 << 0)
80#define PS3AV_CMD_EVENT_BIT_PLUGGED (1 << 1)
81#define PS3AV_CMD_EVENT_BIT_HDCP_DONE (1 << 2)
82#define PS3AV_CMD_EVENT_BIT_HDCP_FAIL (1 << 3)
83#define PS3AV_CMD_EVENT_BIT_HDCP_REAUTH (1 << 4)
84#define PS3AV_CMD_EVENT_BIT_HDCP_TOPOLOGY (1 << 5)
85
86/* common params */
87/* mute */
88#define PS3AV_CMD_MUTE_OFF 0x0000
89#define PS3AV_CMD_MUTE_ON 0x0001
90/* avport */
91#define PS3AV_CMD_AVPORT_HDMI_0 0x0000
92#define PS3AV_CMD_AVPORT_HDMI_1 0x0001
93#define PS3AV_CMD_AVPORT_AVMULTI_0 0x0010
94#define PS3AV_CMD_AVPORT_SPDIF_0 0x0020
95#define PS3AV_CMD_AVPORT_SPDIF_1 0x0021
96
97/* for av backend */
98/* av_mclk */
99#define PS3AV_CMD_AV_MCLK_128 0x0000
100#define PS3AV_CMD_AV_MCLK_256 0x0001
101#define PS3AV_CMD_AV_MCLK_512 0x0003
102/* av_inputlen */
103#define PS3AV_CMD_AV_INPUTLEN_16 0x02
104#define PS3AV_CMD_AV_INPUTLEN_20 0x0a
105#define PS3AV_CMD_AV_INPUTLEN_24 0x0b
106/* alayout */
107#define PS3AV_CMD_AV_LAYOUT_32 (1 << 0)
108#define PS3AV_CMD_AV_LAYOUT_44 (1 << 1)
109#define PS3AV_CMD_AV_LAYOUT_48 (1 << 2)
110#define PS3AV_CMD_AV_LAYOUT_88 (1 << 3)
111#define PS3AV_CMD_AV_LAYOUT_96 (1 << 4)
112#define PS3AV_CMD_AV_LAYOUT_176 (1 << 5)
113#define PS3AV_CMD_AV_LAYOUT_192 (1 << 6)
114/* hdmi_mode */
115#define PS3AV_CMD_AV_HDMI_MODE_NORMAL 0xff
116#define PS3AV_CMD_AV_HDMI_HDCP_OFF 0x01
117#define PS3AV_CMD_AV_HDMI_EDID_PASS 0x80
118#define PS3AV_CMD_AV_HDMI_DVI 0x40
119
120/* for video module */
121/* video_head */
122#define PS3AV_CMD_VIDEO_HEAD_A 0x0000
123#define PS3AV_CMD_VIDEO_HEAD_B 0x0001
124/* video_cs_out video_cs_in */
125#define PS3AV_CMD_VIDEO_CS_NONE 0x0000
126#define PS3AV_CMD_VIDEO_CS_RGB_8 0x0001
127#define PS3AV_CMD_VIDEO_CS_YUV444_8 0x0002
128#define PS3AV_CMD_VIDEO_CS_YUV422_8 0x0003
129#define PS3AV_CMD_VIDEO_CS_XVYCC_8 0x0004
130#define PS3AV_CMD_VIDEO_CS_RGB_10 0x0005
131#define PS3AV_CMD_VIDEO_CS_YUV444_10 0x0006
132#define PS3AV_CMD_VIDEO_CS_YUV422_10 0x0007
133#define PS3AV_CMD_VIDEO_CS_XVYCC_10 0x0008
134#define PS3AV_CMD_VIDEO_CS_RGB_12 0x0009
135#define PS3AV_CMD_VIDEO_CS_YUV444_12 0x000a
136#define PS3AV_CMD_VIDEO_CS_YUV422_12 0x000b
137#define PS3AV_CMD_VIDEO_CS_XVYCC_12 0x000c
138/* video_vid */
139#define PS3AV_CMD_VIDEO_VID_NONE 0x0000
140#define PS3AV_CMD_VIDEO_VID_480I 0x0001
141#define PS3AV_CMD_VIDEO_VID_576I 0x0003
142#define PS3AV_CMD_VIDEO_VID_480P 0x0005
143#define PS3AV_CMD_VIDEO_VID_576P 0x0006
144#define PS3AV_CMD_VIDEO_VID_1080I_60HZ 0x0007
145#define PS3AV_CMD_VIDEO_VID_1080I_50HZ 0x0008
146#define PS3AV_CMD_VIDEO_VID_720P_60HZ 0x0009
147#define PS3AV_CMD_VIDEO_VID_720P_50HZ 0x000a
148#define PS3AV_CMD_VIDEO_VID_1080P_60HZ 0x000b
149#define PS3AV_CMD_VIDEO_VID_1080P_50HZ 0x000c
150#define PS3AV_CMD_VIDEO_VID_WXGA 0x000d
151#define PS3AV_CMD_VIDEO_VID_SXGA 0x000e
152#define PS3AV_CMD_VIDEO_VID_WUXGA 0x000f
153#define PS3AV_CMD_VIDEO_VID_480I_A 0x0010
154/* video_format */
155#define PS3AV_CMD_VIDEO_FORMAT_BLACK 0x0000
156#define PS3AV_CMD_VIDEO_FORMAT_ARGB_8BIT 0x0007
157/* video_order */
158#define PS3AV_CMD_VIDEO_ORDER_RGB 0x0000
159#define PS3AV_CMD_VIDEO_ORDER_BGR 0x0001
160/* video_fmt */
161#define PS3AV_CMD_VIDEO_FMT_X8R8G8B8 0x0000
162/* video_out_format */
163#define PS3AV_CMD_VIDEO_OUT_FORMAT_RGB_12BIT 0x0000
164/* video_sync */
165#define PS3AV_CMD_VIDEO_SYNC_VSYNC 0x0001
166#define PS3AV_CMD_VIDEO_SYNC_CSYNC 0x0004
167#define PS3AV_CMD_VIDEO_SYNC_HSYNC 0x0010
168
169/* for audio module */
170/* num_of_ch */
171#define PS3AV_CMD_AUDIO_NUM_OF_CH_2 0x0000
172#define PS3AV_CMD_AUDIO_NUM_OF_CH_3 0x0001
173#define PS3AV_CMD_AUDIO_NUM_OF_CH_4 0x0002
174#define PS3AV_CMD_AUDIO_NUM_OF_CH_5 0x0003
175#define PS3AV_CMD_AUDIO_NUM_OF_CH_6 0x0004
176#define PS3AV_CMD_AUDIO_NUM_OF_CH_7 0x0005
177#define PS3AV_CMD_AUDIO_NUM_OF_CH_8 0x0006
178/* audio_fs */
179#define PS3AV_CMD_AUDIO_FS_32K 0x0001
180#define PS3AV_CMD_AUDIO_FS_44K 0x0002
181#define PS3AV_CMD_AUDIO_FS_48K 0x0003
182#define PS3AV_CMD_AUDIO_FS_88K 0x0004
183#define PS3AV_CMD_AUDIO_FS_96K 0x0005
184#define PS3AV_CMD_AUDIO_FS_176K 0x0006
185#define PS3AV_CMD_AUDIO_FS_192K 0x0007
186/* audio_word_bits */
187#define PS3AV_CMD_AUDIO_WORD_BITS_16 0x0001
188#define PS3AV_CMD_AUDIO_WORD_BITS_20 0x0002
189#define PS3AV_CMD_AUDIO_WORD_BITS_24 0x0003
190/* audio_format */
191#define PS3AV_CMD_AUDIO_FORMAT_PCM 0x0001
192#define PS3AV_CMD_AUDIO_FORMAT_BITSTREAM 0x00ff
193/* audio_source */
194#define PS3AV_CMD_AUDIO_SOURCE_SERIAL 0x0000
195#define PS3AV_CMD_AUDIO_SOURCE_SPDIF 0x0001
196/* audio_swap */
197#define PS3AV_CMD_AUDIO_SWAP_0 0x0000
198#define PS3AV_CMD_AUDIO_SWAP_1 0x0000
199/* audio_map */
200#define PS3AV_CMD_AUDIO_MAP_OUTPUT_0 0x0000
201#define PS3AV_CMD_AUDIO_MAP_OUTPUT_1 0x0001
202#define PS3AV_CMD_AUDIO_MAP_OUTPUT_2 0x0002
203#define PS3AV_CMD_AUDIO_MAP_OUTPUT_3 0x0003
204/* audio_layout */
205#define PS3AV_CMD_AUDIO_LAYOUT_2CH 0x0000
206#define PS3AV_CMD_AUDIO_LAYOUT_6CH 0x000b /* LREClr */
207#define PS3AV_CMD_AUDIO_LAYOUT_8CH 0x001f /* LREClrXY */
208/* audio_downmix */
209#define PS3AV_CMD_AUDIO_DOWNMIX_PERMITTED 0x0000
210#define PS3AV_CMD_AUDIO_DOWNMIX_PROHIBITED 0x0001
211
212/* audio_port */
213#define PS3AV_CMD_AUDIO_PORT_HDMI_0 ( 1 << 0 )
214#define PS3AV_CMD_AUDIO_PORT_HDMI_1 ( 1 << 1 )
215#define PS3AV_CMD_AUDIO_PORT_AVMULTI_0 ( 1 << 10 )
216#define PS3AV_CMD_AUDIO_PORT_SPDIF_0 ( 1 << 20 )
217#define PS3AV_CMD_AUDIO_PORT_SPDIF_1 ( 1 << 21 )
218
219/* audio_ctrl_id */
220#define PS3AV_CMD_AUDIO_CTRL_ID_DAC_RESET 0x0000
221#define PS3AV_CMD_AUDIO_CTRL_ID_DAC_DE_EMPHASIS 0x0001
222#define PS3AV_CMD_AUDIO_CTRL_ID_AVCLK 0x0002
223/* audio_ctrl_data[0] reset */
224#define PS3AV_CMD_AUDIO_CTRL_RESET_NEGATE 0x0000
225#define PS3AV_CMD_AUDIO_CTRL_RESET_ASSERT 0x0001
226/* audio_ctrl_data[0] de-emphasis */
227#define PS3AV_CMD_AUDIO_CTRL_DE_EMPHASIS_OFF 0x0000
228#define PS3AV_CMD_AUDIO_CTRL_DE_EMPHASIS_ON 0x0001
229/* audio_ctrl_data[0] avclk */
230#define PS3AV_CMD_AUDIO_CTRL_AVCLK_22 0x0000
231#define PS3AV_CMD_AUDIO_CTRL_AVCLK_18 0x0001
232
233/* av_vid */
234/* do not use these params directly, use vid_video2av */
235#define PS3AV_CMD_AV_VID_480I 0x0000
236#define PS3AV_CMD_AV_VID_480P 0x0001
237#define PS3AV_CMD_AV_VID_720P_60HZ 0x0002
238#define PS3AV_CMD_AV_VID_1080I_60HZ 0x0003
239#define PS3AV_CMD_AV_VID_1080P_60HZ 0x0004
240#define PS3AV_CMD_AV_VID_576I 0x0005
241#define PS3AV_CMD_AV_VID_576P 0x0006
242#define PS3AV_CMD_AV_VID_720P_50HZ 0x0007
243#define PS3AV_CMD_AV_VID_1080I_50HZ 0x0008
244#define PS3AV_CMD_AV_VID_1080P_50HZ 0x0009
245#define PS3AV_CMD_AV_VID_WXGA 0x000a
246#define PS3AV_CMD_AV_VID_SXGA 0x000b
247#define PS3AV_CMD_AV_VID_WUXGA 0x000c
248/* av_cs_out av_cs_in */
249/* use cs_video2av() */
250#define PS3AV_CMD_AV_CS_RGB_8 0x0000
251#define PS3AV_CMD_AV_CS_YUV444_8 0x0001
252#define PS3AV_CMD_AV_CS_YUV422_8 0x0002
253#define PS3AV_CMD_AV_CS_XVYCC_8 0x0003
254#define PS3AV_CMD_AV_CS_RGB_10 0x0004
255#define PS3AV_CMD_AV_CS_YUV444_10 0x0005
256#define PS3AV_CMD_AV_CS_YUV422_10 0x0006
257#define PS3AV_CMD_AV_CS_XVYCC_10 0x0007
258#define PS3AV_CMD_AV_CS_RGB_12 0x0008
259#define PS3AV_CMD_AV_CS_YUV444_12 0x0009
260#define PS3AV_CMD_AV_CS_YUV422_12 0x000a
261#define PS3AV_CMD_AV_CS_XVYCC_12 0x000b
262#define PS3AV_CMD_AV_CS_8 0x0000
263#define PS3AV_CMD_AV_CS_10 0x0001
264#define PS3AV_CMD_AV_CS_12 0x0002
265/* dither */
266#define PS3AV_CMD_AV_DITHER_OFF 0x0000
267#define PS3AV_CMD_AV_DITHER_ON 0x0001
268#define PS3AV_CMD_AV_DITHER_8BIT 0x0000
269#define PS3AV_CMD_AV_DITHER_10BIT 0x0002
270#define PS3AV_CMD_AV_DITHER_12BIT 0x0004
271/* super_white */
272#define PS3AV_CMD_AV_SUPER_WHITE_OFF 0x0000
273#define PS3AV_CMD_AV_SUPER_WHITE_ON 0x0001
274/* aspect */
275#define PS3AV_CMD_AV_ASPECT_16_9 0x0000
276#define PS3AV_CMD_AV_ASPECT_4_3 0x0001
277/* video_cs_cnv() */
278#define PS3AV_CMD_VIDEO_CS_RGB 0x0001
279#define PS3AV_CMD_VIDEO_CS_YUV422 0x0002
280#define PS3AV_CMD_VIDEO_CS_YUV444 0x0003
281
282/* for automode */
283#define PS3AV_RESBIT_720x480P 0x0003 /* 0x0001 | 0x0002 */
284#define PS3AV_RESBIT_720x576P 0x0003 /* 0x0001 | 0x0002 */
285#define PS3AV_RESBIT_1280x720P 0x0004
286#define PS3AV_RESBIT_1920x1080I 0x0008
287#define PS3AV_RESBIT_1920x1080P 0x4000
288#define PS3AV_RES_MASK_60 (PS3AV_RESBIT_720x480P \
289 | PS3AV_RESBIT_1280x720P \
290 | PS3AV_RESBIT_1920x1080I \
291 | PS3AV_RESBIT_1920x1080P)
292#define PS3AV_RES_MASK_50 (PS3AV_RESBIT_720x576P \
293 | PS3AV_RESBIT_1280x720P \
294 | PS3AV_RESBIT_1920x1080I \
295 | PS3AV_RESBIT_1920x1080P)
296
297#define PS3AV_MONITOR_TYPE_HDMI 1 /* HDMI */
298#define PS3AV_MONITOR_TYPE_DVI 2 /* DVI */
299#define PS3AV_DEFAULT_HDMI_VID_REG_60 PS3AV_CMD_VIDEO_VID_480P
300#define PS3AV_DEFAULT_AVMULTI_VID_REG_60 PS3AV_CMD_VIDEO_VID_480I
301#define PS3AV_DEFAULT_HDMI_VID_REG_50 PS3AV_CMD_VIDEO_VID_576P
302#define PS3AV_DEFAULT_AVMULTI_VID_REG_50 PS3AV_CMD_VIDEO_VID_576I
303#define PS3AV_DEFAULT_DVI_VID PS3AV_CMD_VIDEO_VID_480P
304
305#define PS3AV_REGION_60 0x01
306#define PS3AV_REGION_50 0x02
307#define PS3AV_REGION_RGB 0x10
308
309#define get_status(buf) (((__u32 *)buf)[2])
310#define PS3AV_HDR_SIZE 4 /* version + size */
311
312/* for video mode */
313#define PS3AV_MODE_MASK 0x000F
314#define PS3AV_MODE_HDCP_OFF 0x1000 /* Retail PS3 product doesn't support this */
315#define PS3AV_MODE_DITHER 0x0800
316#define PS3AV_MODE_FULL 0x0080
317#define PS3AV_MODE_DVI 0x0040
318#define PS3AV_MODE_RGB 0x0020
319
320
321/** command packet structure **/
322struct ps3av_send_hdr {
323 u16 version;
324 u16 size; /* size of command packet */
325 u32 cid; /* command id */
326};
327
328struct ps3av_reply_hdr {
329 u16 version;
330 u16 size;
331 u32 cid;
332 u32 status;
333};
334
335/* backend: initialization */
336struct ps3av_pkt_av_init {
337 struct ps3av_send_hdr send_hdr;
338 u32 event_bit;
339};
340
341/* backend: finalize */
342struct ps3av_pkt_av_fin {
343 struct ps3av_send_hdr send_hdr;
344 /* recv */
345 u32 reserved;
346};
347
348/* backend: get port */
349struct ps3av_pkt_av_get_hw_conf {
350 struct ps3av_send_hdr send_hdr;
351 /* recv */
352 u32 status;
353 u16 num_of_hdmi; /* out: number of hdmi */
354 u16 num_of_avmulti; /* out: number of avmulti */
355 u16 num_of_spdif; /* out: number of hdmi */
356 u16 reserved;
357};
358
359/* backend: get monitor info */
360struct ps3av_info_resolution {
361 u32 res_bits;
362 u32 native;
363};
364
365struct ps3av_info_cs {
366 u8 rgb;
367 u8 yuv444;
368 u8 yuv422;
369 u8 reserved;
370};
371
372struct ps3av_info_color {
373 u16 red_x;
374 u16 red_y;
375 u16 green_x;
376 u16 green_y;
377 u16 blue_x;
378 u16 blue_y;
379 u16 white_x;
380 u16 white_y;
381 u32 gamma;
382};
383
384struct ps3av_info_audio {
385 u8 type;
386 u8 max_num_of_ch;
387 u8 fs;
388 u8 sbit;
389};
390
391struct ps3av_info_monitor {
392 u8 avport;
393 u8 monitor_id[10];
394 u8 monitor_type;
395 u8 monitor_name[16];
396 struct ps3av_info_resolution res_60;
397 struct ps3av_info_resolution res_50;
398 struct ps3av_info_resolution res_other;
399 struct ps3av_info_resolution res_vesa;
400 struct ps3av_info_cs cs;
401 struct ps3av_info_color color;
402 u8 supported_ai;
403 u8 speaker_info;
404 u8 num_of_audio_block;
405 struct ps3av_info_audio audio[0]; /* 0 or more audio blocks */
406 u8 reserved[169];
407} __attribute__ ((packed));
408
409struct ps3av_pkt_av_get_monitor_info {
410 struct ps3av_send_hdr send_hdr;
411 u16 avport; /* in: avport */
412 u16 reserved;
413 /* recv */
414 struct ps3av_info_monitor info; /* out: monitor info */
415};
416
417/* backend: enable/disable event */
418struct ps3av_pkt_av_event {
419 struct ps3av_send_hdr send_hdr;
420 u32 event_bit; /* in */
421};
422
423/* backend: video cs param */
424struct ps3av_pkt_av_video_cs {
425 struct ps3av_send_hdr send_hdr;
426 u16 avport; /* in: avport */
427 u16 av_vid; /* in: video resolution */
428 u16 av_cs_out; /* in: output color space */
429 u16 av_cs_in; /* in: input color space */
430 u8 dither; /* in: dither bit length */
431 u8 bitlen_out; /* in: bit length */
432 u8 super_white; /* in: super white */
433 u8 aspect; /* in: aspect ratio */
434};
435
436/* backend: video mute */
437struct ps3av_av_mute {
438 u16 avport; /* in: avport */
439 u16 mute; /* in: mute on/off */
440};
441
442struct ps3av_pkt_av_video_mute {
443 struct ps3av_send_hdr send_hdr;
444 struct ps3av_av_mute mute[PS3AV_MUTE_PORT_MAX];
445};
446
447/* backend: video disable signal */
448struct ps3av_pkt_av_video_disable_sig {
449 struct ps3av_send_hdr send_hdr;
450 u16 avport; /* in: avport */
451 u16 reserved;
452};
453
454/* backend: audio param */
455struct ps3av_audio_info_frame {
456 struct pb1_bit {
457 u8 ct:4;
458 u8 rsv:1;
459 u8 cc:3;
460 } pb1;
461 struct pb2_bit {
462 u8 rsv:3;
463 u8 sf:3;
464 u8 ss:2;
465 } pb2;
466 u8 pb3;
467 u8 pb4;
468 struct pb5_bit {
469 u8 dm:1;
470 u8 lsv:4;
471 u8 rsv:3;
472 } pb5;
473};
474
475struct ps3av_pkt_av_audio_param {
476 struct ps3av_send_hdr send_hdr;
477 u16 avport; /* in: avport */
478 u16 reserved;
479 u8 mclk; /* in: audio mclk */
480 u8 ns[3]; /* in: audio ns val */
481 u8 enable; /* in: audio enable */
482 u8 swaplr; /* in: audio swap */
483 u8 fifomap; /* in: audio fifomap */
484 u8 inputctrl; /* in: audio input ctrl */
485 u8 inputlen; /* in: sample bit size */
486 u8 layout; /* in: speaker layout param */
487 struct ps3av_audio_info_frame info; /* in: info */
488 u8 chstat[5]; /* in: ch stat */
489};
490
491/* backend: audio_mute */
492struct ps3av_pkt_av_audio_mute {
493 struct ps3av_send_hdr send_hdr;
494 struct ps3av_av_mute mute[PS3AV_MUTE_PORT_MAX];
495};
496
497/* backend: hdmi_mode */
498struct ps3av_pkt_av_hdmi_mode {
499 struct ps3av_send_hdr send_hdr;
500 u8 mode; /* in: hdmi_mode */
501 u8 reserved0;
502 u8 reserved1;
503 u8 reserved2;
504};
505
506/* backend: tv_mute */
507struct ps3av_pkt_av_tv_mute {
508 struct ps3av_send_hdr send_hdr;
509 u16 avport; /* in: avport HDMI only */
510 u16 mute; /* in: mute */
511};
512
513/* video: initialize */
514struct ps3av_pkt_video_init {
515 struct ps3av_send_hdr send_hdr;
516 /* recv */
517 u32 reserved;
518};
519
520/* video: mode setting */
521struct ps3av_pkt_video_mode {
522 struct ps3av_send_hdr send_hdr;
523 u32 video_head; /* in: head */
524 u32 reserved;
525 u32 video_vid; /* in: video resolution */
526 u16 reserved1;
527 u16 width; /* in: width in pixel */
528 u16 reserved2;
529 u16 height; /* in: height in pixel */
530 u32 pitch; /* in: line size in byte */
531 u32 video_out_format; /* in: out format */
532 u32 video_format; /* in: input frame buffer format */
533 u8 reserved3;
534 u8 reserved4;
535 u16 video_order; /* in: input RGB order */
536 u32 reserved5;
537};
538
539/* video: format */
540struct ps3av_pkt_video_format {
541 struct ps3av_send_hdr send_hdr;
542 u32 video_head; /* in: head */
543 u32 video_format; /* in: frame buffer format */
544 u16 reserved;
545 u16 video_order; /* in: input RGB order */
546};
547
548/* video: pitch */
549struct ps3av_pkt_video_pitch {
550 u16 version;
551 u16 size; /* size of command packet */
552 u32 cid; /* command id */
553 u32 video_head; /* in: head */
554 u32 pitch; /* in: line size in byte */
555};
556
557/* audio: initialize */
558struct ps3av_pkt_audio_init {
559 struct ps3av_send_hdr send_hdr;
560 /* recv */
561 u32 reserved;
562};
563
564/* audio: mode setting */
565struct ps3av_pkt_audio_mode {
566 struct ps3av_send_hdr send_hdr;
567 u8 avport; /* in: avport */
568 u8 reserved0[3];
569 u32 mask; /* in: mask */
570 u32 audio_num_of_ch; /* in: number of ch */
571 u32 audio_fs; /* in: sampling freq */
572 u32 audio_word_bits; /* in: sample bit size */
573 u32 audio_format; /* in: audio output format */
574 u32 audio_source; /* in: audio source */
575 u8 audio_enable[4]; /* in: audio enable */
576 u8 audio_swap[4]; /* in: audio swap */
577 u8 audio_map[4]; /* in: audio map */
578 u32 audio_layout; /* in: speaker layout */
579 u32 audio_downmix; /* in: audio downmix permission */
580 u32 audio_downmix_level;
581 u8 audio_cs_info[8]; /* in: IEC channel status */
582};
583
584/* audio: mute */
585struct ps3av_audio_mute {
586 u8 avport; /* in: opt_port optical */
587 u8 reserved[3];
588 u32 mute; /* in: mute */
589};
590
591struct ps3av_pkt_audio_mute {
592 struct ps3av_send_hdr send_hdr;
593 struct ps3av_audio_mute mute[PS3AV_OPT_PORT_MAX];
594};
595
596/* audio: active/inactive */
597struct ps3av_pkt_audio_active {
598 struct ps3av_send_hdr send_hdr;
599 u32 audio_port; /* in: audio active/inactive port */
600};
601
602/* audio: SPDIF user bit */
603struct ps3av_pkt_audio_spdif_bit {
604 u16 version;
605 u16 size; /* size of command packet */
606 u32 cid; /* command id */
607 u8 avport; /* in: avport SPDIF only */
608 u8 reserved[3];
609 u32 audio_port; /* in: SPDIF only */
610 u32 spdif_bit_data[12]; /* in: user bit data */
611};
612
613/* audio: audio control */
614struct ps3av_pkt_audio_ctrl {
615 u16 version;
616 u16 size; /* size of command packet */
617 u32 cid; /* command id */
618 u32 audio_ctrl_id; /* in: control id */
619 u32 audio_ctrl_data[4]; /* in: control data */
620};
621
622/* avb:param */
623#define PS3AV_PKT_AVB_PARAM_MAX_BUF_SIZE \
624 (PS3AV_AVB_NUM_VIDEO*sizeof(struct ps3av_pkt_video_mode) + \
625 PS3AV_AVB_NUM_AUDIO*sizeof(struct ps3av_pkt_audio_mode) + \
626 PS3AV_AVB_NUM_AV_VIDEO*sizeof(struct ps3av_pkt_av_video_cs) + \
627 PS3AV_AVB_NUM_AV_AUDIO*sizeof(struct ps3av_pkt_av_audio_param))
628
629struct ps3av_pkt_avb_param {
630 struct ps3av_send_hdr send_hdr;
631 u16 num_of_video_pkt;
632 u16 num_of_audio_pkt;
633 u16 num_of_av_video_pkt;
634 u16 num_of_av_audio_pkt;
635 /*
636 * The actual buffer layout depends on the fields above:
637 *
638 * struct ps3av_pkt_video_mode video[num_of_video_pkt];
639 * struct ps3av_pkt_audio_mode audio[num_of_audio_pkt];
640 * struct ps3av_pkt_av_video_cs av_video[num_of_av_video_pkt];
641 * struct ps3av_pkt_av_audio_param av_audio[num_of_av_audio_pkt];
642 */
643 u8 buf[PS3AV_PKT_AVB_PARAM_MAX_BUF_SIZE];
644};
645
646struct ps3av {
647 int available;
648 struct semaphore sem;
649 struct semaphore ping;
650 struct semaphore pong;
651 struct mutex mutex;
652 int open_count;
653 struct ps3_vuart_port_device *dev;
654
655 int region;
656 struct ps3av_pkt_av_get_hw_conf av_hw_conf;
657 u32 av_port[PS3AV_AV_PORT_MAX + PS3AV_OPT_PORT_MAX];
658 u32 opt_port[PS3AV_OPT_PORT_MAX];
659 u32 head[PS3AV_HEAD_MAX];
660 u32 audio_port;
661 int ps3av_mode;
662 int ps3av_mode_old;
663};
664
665/** command status **/
666#define PS3AV_STATUS_SUCCESS 0x0000 /* success */
667#define PS3AV_STATUS_RECEIVE_VUART_ERROR 0x0001 /* receive vuart error */
668#define PS3AV_STATUS_SYSCON_COMMUNICATE_FAIL 0x0002 /* syscon communication error */
669#define PS3AV_STATUS_INVALID_COMMAND 0x0003 /* obsolete invalid CID */
670#define PS3AV_STATUS_INVALID_PORT 0x0004 /* invalid port number */
671#define PS3AV_STATUS_INVALID_VID 0x0005 /* invalid video format */
672#define PS3AV_STATUS_INVALID_COLOR_SPACE 0x0006 /* invalid video colose space */
673#define PS3AV_STATUS_INVALID_FS 0x0007 /* invalid audio sampling freq */
674#define PS3AV_STATUS_INVALID_AUDIO_CH 0x0008 /* invalid audio channel number */
675#define PS3AV_STATUS_UNSUPPORTED_VERSION 0x0009 /* version mismatch */
676#define PS3AV_STATUS_INVALID_SAMPLE_SIZE 0x000a /* invalid audio sample bit size */
677#define PS3AV_STATUS_FAILURE 0x000b /* other failures */
678#define PS3AV_STATUS_UNSUPPORTED_COMMAND 0x000c /* unsupported cid */
679#define PS3AV_STATUS_BUFFER_OVERFLOW 0x000d /* write buffer overflow */
680#define PS3AV_STATUS_INVALID_VIDEO_PARAM 0x000e /* invalid video param */
681#define PS3AV_STATUS_NO_SEL 0x000f /* not exist selector */
682#define PS3AV_STATUS_INVALID_AV_PARAM 0x0010 /* invalid backend param */
683#define PS3AV_STATUS_INVALID_AUDIO_PARAM 0x0011 /* invalid audio param */
684#define PS3AV_STATUS_UNSUPPORTED_HDMI_MODE 0x0012 /* unsupported hdmi mode */
685#define PS3AV_STATUS_NO_SYNC_HEAD 0x0013 /* sync head failed */
686
687extern void ps3av_set_hdr(u32, u16, struct ps3av_send_hdr *);
688extern int ps3av_do_pkt(u32, u16, size_t, struct ps3av_send_hdr *);
689
690extern int ps3av_cmd_init(void);
691extern int ps3av_cmd_fin(void);
692extern int ps3av_cmd_av_video_mute(int, u32 *, u32);
693extern int ps3av_cmd_av_video_disable_sig(u32);
694extern int ps3av_cmd_av_tv_mute(u32, u32);
695extern int ps3av_cmd_enable_event(void);
696extern int ps3av_cmd_av_hdmi_mode(u8);
697extern u32 ps3av_cmd_set_av_video_cs(void *, u32, int, int, int, u32);
698extern u32 ps3av_cmd_set_video_mode(void *, u32, int, int, u32);
699extern int ps3av_cmd_video_format_black(u32, u32, u32);
700extern int ps3av_cmd_av_audio_mute(int, u32 *, u32);
701extern u32 ps3av_cmd_set_av_audio_param(void *, u32,
702 const struct ps3av_pkt_audio_mode *,
703 u32);
704extern void ps3av_cmd_set_audio_mode(struct ps3av_pkt_audio_mode *, u32, u32,
705 u32, u32, u32, u32);
706extern int ps3av_cmd_audio_mode(struct ps3av_pkt_audio_mode *);
707extern int ps3av_cmd_audio_mute(int, u32 *, u32);
708extern int ps3av_cmd_audio_active(int, u32);
709extern int ps3av_cmd_avb_param(struct ps3av_pkt_avb_param *, u32);
710extern int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *);
711#ifdef PS3AV_DEBUG
712extern void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *);
713extern void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *);
714#else
715static inline void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *hw_conf) {}
716static inline void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *monitor_info) {}
717#endif
718extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *,
719 u32);
720
721extern int ps3av_vuart_write(struct ps3_vuart_port_device *dev,
722 const void *buf, unsigned long size);
723extern int ps3av_vuart_read(struct ps3_vuart_port_device *dev, void *buf,
724 unsigned long size, int timeout);
725
726extern int ps3av_set_video_mode(u32, int);
727extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32);
728extern int ps3av_set_mode(u32, int);
729extern int ps3av_get_mode(void);
730extern int ps3av_get_scanmode(int);
731extern int ps3av_get_refresh_rate(int);
732extern int ps3av_video_mode2res(u32, u32 *, u32 *);
733extern int ps3av_video_mute(int);
734extern int ps3av_audio_mute(int);
735extern int ps3av_dev_open(void);
736extern int ps3av_dev_close(void);
737
738#endif /* _ASM_POWERPC_PS3AV_H_ */
diff --git a/include/asm-powerpc/ps3fb.h b/include/asm-powerpc/ps3fb.h
new file mode 100644
index 000000000000..ad81cf431964
--- /dev/null
+++ b/include/asm-powerpc/ps3fb.h
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) 2006 Sony Computer Entertainment Inc.
3 * Copyright 2006, 2007 Sony Corporation
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published
7 * by the Free Software Foundation; version 2 of the License.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#ifndef _ASM_POWERPC_PS3FB_H_
20#define _ASM_POWERPC_PS3FB_H_
21
22#include <linux/ioctl.h>
23
24/* ioctl */
25#define PS3FB_IOCTL_SETMODE _IOW('r', 1, int) /* set video mode */
26#define PS3FB_IOCTL_GETMODE _IOR('r', 2, int) /* get video mode */
27#define PS3FB_IOCTL_SCREENINFO _IOR('r', 3, int) /* get screen info */
28#define PS3FB_IOCTL_ON _IO('r', 4) /* use IOCTL_FSEL */
29#define PS3FB_IOCTL_OFF _IO('r', 5) /* return to normal-flip */
30#define PS3FB_IOCTL_FSEL _IOW('r', 6, int) /* blit and flip request */
31
32#ifndef FBIO_WAITFORVSYNC
33#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) /* wait for vsync */
34#endif
35
36struct ps3fb_ioctl_res {
37 __u32 xres; /* frame buffer x_size */
38 __u32 yres; /* frame buffer y_size */
39 __u32 xoff; /* margine x */
40 __u32 yoff; /* margine y */
41 __u32 num_frames; /* num of frame buffers */
42};
43
44#ifdef __KERNEL__
45
46#ifdef CONFIG_FB_PS3
47extern void ps3fb_flip_ctl(int on);
48extern void ps3fb_cleanup(void);
49#else
50static inline void ps3fb_flip_ctl(int on) {}
51static inline void ps3fb_cleanup(void) {}
52#endif
53
54#endif /* __KERNEL__ */
55
56#endif /* _ASM_POWERPC_PS3FB_H_ */
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h
index a3631b15754c..0d7f0164ed81 100644
--- a/include/asm-powerpc/reg.h
+++ b/include/asm-powerpc/reg.h
@@ -166,6 +166,7 @@
166#define SPRN_TBWU 0x11D /* Time Base Upper Register (super, R/W) */ 166#define SPRN_TBWU 0x11D /* Time Base Upper Register (super, R/W) */
167#define SPRN_SPURR 0x134 /* Scaled PURR */ 167#define SPRN_SPURR 0x134 /* Scaled PURR */
168#define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */ 168#define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */
169#define SPRN_LPCR 0x13E /* LPAR Control Register */
169#define SPRN_DBAT0L 0x219 /* Data BAT 0 Lower Register */ 170#define SPRN_DBAT0L 0x219 /* Data BAT 0 Lower Register */
170#define SPRN_DBAT0U 0x218 /* Data BAT 0 Upper Register */ 171#define SPRN_DBAT0U 0x218 /* Data BAT 0 Upper Register */
171#define SPRN_DBAT1L 0x21B /* Data BAT 1 Lower Register */ 172#define SPRN_DBAT1L 0x21B /* Data BAT 1 Lower Register */
@@ -391,6 +392,12 @@
391#define SPRN_HSRR0 0x13A /* Save/Restore Register 0 */ 392#define SPRN_HSRR0 0x13A /* Save/Restore Register 0 */
392#define SPRN_HSRR1 0x13B /* Save/Restore Register 1 */ 393#define SPRN_HSRR1 0x13B /* Save/Restore Register 1 */
393 394
395#define SPRN_TBCTL 0x35f /* PA6T Timebase control register */
396#define TBCTL_FREEZE 0x0000000000000000ull /* Freeze all tbs */
397#define TBCTL_RESTART 0x0000000100000000ull /* Restart all tbs */
398#define TBCTL_UPDATE_UPPER 0x0000000200000000ull /* Set upper 32 bits */
399#define TBCTL_UPDATE_LOWER 0x0000000300000000ull /* Set lower 32 bits */
400
394#ifndef SPRN_SVR 401#ifndef SPRN_SVR
395#define SPRN_SVR 0x11E /* System Version Register */ 402#define SPRN_SVR 0x11E /* System Version Register */
396#endif 403#endif
@@ -462,6 +469,13 @@
462#define SPRN_SIAR 780 469#define SPRN_SIAR 780
463#define SPRN_SDAR 781 470#define SPRN_SDAR 781
464 471
472#define PA6T_SPRN_PMC0 787
473#define PA6T_SPRN_PMC1 788
474#define PA6T_SPRN_PMC2 789
475#define PA6T_SPRN_PMC3 790
476#define PA6T_SPRN_PMC4 791
477#define PA6T_SPRN_PMC5 792
478
465#else /* 32-bit */ 479#else /* 32-bit */
466#define SPRN_MMCR0 952 /* Monitor Mode Control Register 0 */ 480#define SPRN_MMCR0 952 /* Monitor Mode Control Register 0 */
467#define MMCR0_FC 0x80000000UL /* freeze counters */ 481#define MMCR0_FC 0x80000000UL /* freeze counters */
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h
index 20ea7c70bc38..01717f266dc9 100644
--- a/include/asm-powerpc/smp.h
+++ b/include/asm-powerpc/smp.h
@@ -75,6 +75,7 @@ extern cpumask_t cpu_sibling_map[NR_CPUS];
75void smp_init_iSeries(void); 75void smp_init_iSeries(void);
76void smp_init_pSeries(void); 76void smp_init_pSeries(void);
77void smp_init_cell(void); 77void smp_init_cell(void);
78void smp_init_celleb(void);
78void smp_setup_cpu_maps(void); 79void smp_setup_cpu_maps(void);
79 80
80extern int __cpu_disable(void); 81extern int __cpu_disable(void);
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index 3d90264e9d36..b634e16575f2 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -104,6 +104,7 @@
104 104
105struct spu_context; 105struct spu_context;
106struct spu_runqueue; 106struct spu_runqueue;
107struct device_node;
107 108
108struct spu { 109struct spu {
109 const char *name; 110 const char *name;
@@ -142,7 +143,19 @@ struct spu {
142 char irq_c1[8]; 143 char irq_c1[8];
143 char irq_c2[8]; 144 char irq_c2[8];
144 145
146 u64 spe_id;
147
145 void* pdata; /* platform private data */ 148 void* pdata; /* platform private data */
149
150 /* of based platforms only */
151 struct device_node *devnode;
152
153 /* native only */
154 struct spu_priv1 __iomem *priv1;
155
156 /* beat only */
157 u64 shadow_int_mask_RW[3];
158
146 struct sys_device sysdev; 159 struct sys_device sysdev;
147}; 160};
148 161
diff --git a/include/asm-powerpc/spu_priv1.h b/include/asm-powerpc/spu_priv1.h
index 69dcb0c53884..7e78f6a1ab8b 100644
--- a/include/asm-powerpc/spu_priv1.h
+++ b/include/asm-powerpc/spu_priv1.h
@@ -206,6 +206,8 @@ spu_destroy_spu (struct spu *spu)
206 */ 206 */
207 207
208extern const struct spu_priv1_ops spu_priv1_mmio_ops; 208extern const struct spu_priv1_ops spu_priv1_mmio_ops;
209extern const struct spu_priv1_ops spu_priv1_beat_ops;
210
209extern const struct spu_management_ops spu_management_of_ops; 211extern const struct spu_management_ops spu_management_of_ops;
210 212
211#endif /* __KERNEL__ */ 213#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/sstep.h b/include/asm-powerpc/sstep.h
index 630a9889c07c..f593b0f9b627 100644
--- a/include/asm-powerpc/sstep.h
+++ b/include/asm-powerpc/sstep.h
@@ -21,6 +21,7 @@ struct pt_regs;
21 */ 21 */
22#define IS_MTMSRD(instr) (((instr) & 0xfc0007be) == 0x7c000124) 22#define IS_MTMSRD(instr) (((instr) & 0xfc0007be) == 0x7c000124)
23#define IS_RFID(instr) (((instr) & 0xfc0007fe) == 0x4c000024) 23#define IS_RFID(instr) (((instr) & 0xfc0007fe) == 0x4c000024)
24#define IS_RFI(instr) (((instr) & 0xfc0007fe) == 0x4c000064)
24 25
25/* Emulate instructions that cause a transfer of control. */ 26/* Emulate instructions that cause a transfer of control. */
26extern int emulate_step(struct pt_regs *regs, unsigned int instr); 27extern int emulate_step(struct pt_regs *regs, unsigned int instr);
diff --git a/include/asm-powerpc/termios.h b/include/asm-powerpc/termios.h
index 7f80a019b6a0..2c14fea07c8a 100644
--- a/include/asm-powerpc/termios.h
+++ b/include/asm-powerpc/termios.h
@@ -71,24 +71,6 @@ struct termio {
71#define _VEOL2 8 71#define _VEOL2 8
72#define _VSWTC 9 72#define _VSWTC 9
73 73
74/* line disciplines */
75#define N_TTY 0
76#define N_SLIP 1
77#define N_MOUSE 2
78#define N_PPP 3
79#define N_STRIP 4
80#define N_AX25 5
81#define N_X25 6 /* X.25 async */
82#define N_6PACK 7
83#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
84#define N_R3964 9 /* Reserved for Simatic R3964 module */
85#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
86#define N_IRDA 11 /* Linux IrDa - http://www.cs.uit.no/~dagb/irda/irda.html */
87#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
88#define N_HDLC 13 /* synchronous HDLC */
89#define N_SYNC_PPP 14
90#define N_HCI 15 /* Bluetooth HCI UART */
91
92#ifdef __KERNEL__ 74#ifdef __KERNEL__
93/* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^U */ 75/* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^U */
94#define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\025" 76#define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\025"
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index 4cff977ad526..3fd57c048f59 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -39,6 +39,8 @@ extern void generic_calibrate_decr(void);
39extern void wakeup_decrementer(void); 39extern void wakeup_decrementer(void);
40extern void snapshot_timebase(void); 40extern void snapshot_timebase(void);
41 41
42extern void set_dec_cpu6(unsigned int val);
43
42/* Some sane defaults: 125 MHz timebase, 1GHz processor */ 44/* Some sane defaults: 125 MHz timebase, 1GHz processor */
43extern unsigned long ppc_proc_freq; 45extern unsigned long ppc_proc_freq;
44#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) 46#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8)
diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h
index 55e57844fa78..4cbc313aa02a 100644
--- a/include/asm-powerpc/udbg.h
+++ b/include/asm-powerpc/udbg.h
@@ -41,9 +41,11 @@ extern void __init udbg_early_init(void);
41extern void __init udbg_init_debug_lpar(void); 41extern void __init udbg_init_debug_lpar(void);
42extern void __init udbg_init_pmac_realmode(void); 42extern void __init udbg_init_pmac_realmode(void);
43extern void __init udbg_init_maple_realmode(void); 43extern void __init udbg_init_maple_realmode(void);
44extern void __init udbg_init_pas_realmode(void);
44extern void __init udbg_init_iseries(void); 45extern void __init udbg_init_iseries(void);
45extern void __init udbg_init_rtas_panel(void); 46extern void __init udbg_init_rtas_panel(void);
46extern void __init udbg_init_rtas_console(void); 47extern void __init udbg_init_rtas_console(void);
48extern void __init udbg_init_debug_beat(void);
47 49
48#endif /* __KERNEL__ */ 50#endif /* __KERNEL__ */
49#endif /* _ASM_POWERPC_UDBG_H */ 51#endif /* _ASM_POWERPC_UDBG_H */
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h
index 7b06b4e6bf30..4f99df1bafd7 100644
--- a/include/asm-ppc/commproc.h
+++ b/include/asm-ppc/commproc.h
@@ -77,6 +77,7 @@ extern int cpm_dpfree(uint offset);
77extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align); 77extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align);
78extern void cpm_dpdump(void); 78extern void cpm_dpdump(void);
79extern void *cpm_dpram_addr(uint offset); 79extern void *cpm_dpram_addr(uint offset);
80extern uint cpm_dpram_phys(u8* addr);
80extern void cpm_setbrg(uint brg, uint rate); 81extern void cpm_setbrg(uint brg, uint rate);
81 82
82extern uint m8xx_cpm_hostalloc(uint size); 83extern uint m8xx_cpm_hostalloc(uint size);
diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h
index 499c14691c71..7a64ede53bb6 100644
--- a/include/asm-ppc/ibm4xx.h
+++ b/include/asm-ppc/ibm4xx.h
@@ -15,6 +15,7 @@
15#define __ASM_IBM4XX_H__ 15#define __ASM_IBM4XX_H__
16 16
17#include <asm/types.h> 17#include <asm/types.h>
18#include <asm/dcr.h>
18 19
19#ifdef CONFIG_40x 20#ifdef CONFIG_40x
20 21
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index ccf1a9bb2e43..95d590423cf2 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -358,8 +358,6 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
358} 358}
359#endif 359#endif
360 360
361#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void __force *)(void __iomem *)(b),(c),(d))
362
363/* 361/*
364 * Map in an area of physical address space, for accessing 362 * Map in an area of physical address space, for accessing
365 * I/O devices etc. 363 * I/O devices etc.
diff --git a/include/asm-ppc/m48t35.h b/include/asm-ppc/m48t35.h
deleted file mode 100644
index a5277ea4b194..000000000000
--- a/include/asm-ppc/m48t35.h
+++ /dev/null
@@ -1,77 +0,0 @@
1/*
2 * Registers for the SGS-Thomson M48T35 Timekeeper RAM chip
3 * and
4 * Registers for the SGS-Thomson M48T37 Timekeeper RAM chip
5 * The 37 is the 35 plus alarm and century thus the offsets
6 * are shifted by the extra registers.
7 */
8
9#ifndef __PPC_M48T35_H
10#define __PPC_M48T35_H
11
12/* RTC offsets */
13#define M48T35_RTC_FLAGS (-8) /* the negative regs are really T37 only */
14#define M48T35_RTC_CENTURY (-7)
15#define M48T35_RTC_AL_SEC (-6)
16#define M48T35_RTC_AL_MIN (-5)
17#define M48T35_RTC_AL_HRS (-4)
18#define M48T35_RTC_AL_DOM (-3)
19#define M48T35_RTC_INTERRUPT (-2)
20#define M48T35_RTC_WATCHDOG (-1)
21#define M48T35_RTC_CONTROL 0 /* T35 starts here */
22#define M48T35_RTC_SECONDS 1
23#define M48T35_RTC_MINUTES 2
24#define M48T35_RTC_HOURS 3
25#define M48T35_RTC_DAY 4
26#define M48T35_RTC_DOM 5
27#define M48T35_RTC_MONTH 6
28#define M48T35_RTC_YEAR 7
29
30/* this way help us know which bits go with which regs */
31#define M48T35_RTC_FLAGS_BL 0x10
32#define M48T35_RTC_FLAGS_AF 0x40
33#define M48T35_RTC_FLAGS_WDF 0x80
34
35#define M48T35_RTC_INTERRUPT_AFE 0x80
36#define M48T35_RTC_INTERRUPT_ABE 0x20
37#define M48T35_RTC_INTERRUPT_ALL (M48T35_RTC_INTERRUPT_AFE|M48T35_RTC_INTERRUPT_ABE)
38
39#define M48T35_RTC_WATCHDOG_RB 0x03
40#define M48T35_RTC_WATCHDOG_BMB 0x7c
41#define M48T35_RTC_WATCHDOG_WDS 0x80
42#define M48T35_RTC_WATCHDOG_ALL (M48T35_RTC_WATCHDOG_RB|M48T35_RTC_WATCHDOG_BMB|M48T35_RTC_W)
43
44#define M48T35_RTC_CONTROL_WRITE 0x80
45#define M48T35_RTC_CONTROL_READ 0x40
46#define M48T35_RTC_CONTROL_CAL_SIGN 0x20
47#define M48T35_RTC_CONTROL_CAL_VALUE 0x1f
48#define M48T35_RTC_CONTROL_LOCKED (M48T35_RTC_WRITE|M48T35_RTC_READ)
49#define M48T35_RTC_CONTROL_CALIBRATION (M48T35_RTC_CONTROL_CAL_SIGN|M48T35_RTC_CONTROL_CAL_VALUE)
50
51#define M48T35_RTC_SECONDS_SEC_1 0x0f
52#define M48T35_RTC_SECONDS_SEC_10 0x70
53#define M48T35_RTC_SECONDS_ST 0x80
54#define M48T35_RTC_SECONDS_SEC_ALL (M48T35_RTC_SECONDS_SEC_1|M48T35_RTC_SECONDS_SEC_10)
55
56#define M48T35_RTC_MINUTES_MIN_1 0x0f
57#define M48T35_RTC_MINUTES_MIN_10 0x70
58#define M48T35_RTC_MINUTES_MIN_ALL (M48T35_RTC_MINUTES_MIN_1|M48T35_RTC_MINUTES_MIN_10)
59
60#define M48T35_RTC_HOURS_HRS_1 0x0f
61#define M48T35_RTC_HOURS_HRS_10 0x30
62#define M48T35_RTC_HOURS_HRS_ALL (M48T35_RTC_HOURS_HRS_1|M48T35_RTC_HOURS_HRS_10)
63
64#define M48T35_RTC_DAY_DAY_1 0x03
65#define M48T35_RTC_DAY_FT 0x40
66
67#define M48T35_RTC_ALARM_OFF 0x00
68#define M48T35_RTC_WATCHDOG_OFF 0x00
69
70
71/* legacy */
72#define M48T35_RTC_SET 0x80
73#define M48T35_RTC_STOPPED 0x80
74#define M48T35_RTC_READ 0x40
75
76
77#endif
diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
index a263fc1e65c4..82948ed2744a 100644
--- a/include/asm-ppc/reg_booke.h
+++ b/include/asm-ppc/reg_booke.h
@@ -9,8 +9,6 @@
9#ifndef __ASM_PPC_REG_BOOKE_H__ 9#ifndef __ASM_PPC_REG_BOOKE_H__
10#define __ASM_PPC_REG_BOOKE_H__ 10#define __ASM_PPC_REG_BOOKE_H__
11 11
12#include <asm/dcr.h>
13
14#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
15/* Performance Monitor Registers */ 13/* Performance Monitor Registers */
16#define mfpmr(rn) ({unsigned int rval; \ 14#define mfpmr(rn) ({unsigned int rval; \
diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h
index 8a59f8871f32..8fc1b546613d 100644
--- a/include/asm-ppc/serial.h
+++ b/include/asm-ppc/serial.h
@@ -11,8 +11,6 @@
11#include <platforms/ev64260.h> 11#include <platforms/ev64260.h>
12#elif defined(CONFIG_CHESTNUT) 12#elif defined(CONFIG_CHESTNUT)
13#include <platforms/chestnut.h> 13#include <platforms/chestnut.h>
14#elif defined(CONFIG_GEMINI)
15#include <platforms/gemini_serial.h>
16#elif defined(CONFIG_POWERPMC250) 14#elif defined(CONFIG_POWERPMC250)
17#include <platforms/powerpmc250.h> 15#include <platforms/powerpmc250.h>
18#elif defined(CONFIG_LOPEC) 16#elif defined(CONFIG_LOPEC)
diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h
index 58c70acffc73..cfc81533b9ba 100644
--- a/include/asm-s390/ccwdev.h
+++ b/include/asm-s390/ccwdev.h
@@ -110,7 +110,9 @@ extern void ccw_driver_unregister (struct ccw_driver *driver);
110 110
111struct ccw1; 111struct ccw1;
112 112
113extern int ccw_device_set_options_mask(struct ccw_device *, unsigned long);
113extern int ccw_device_set_options(struct ccw_device *, unsigned long); 114extern int ccw_device_set_options(struct ccw_device *, unsigned long);
115extern void ccw_device_clear_options(struct ccw_device *, unsigned long);
114 116
115/* Allow for i/o completion notification after primary interrupt status. */ 117/* Allow for i/o completion notification after primary interrupt status. */
116#define CCWDEV_EARLY_NOTIFICATION 0x0001 118#define CCWDEV_EARLY_NOTIFICATION 0x0001
diff --git a/include/asm-s390/compat.h b/include/asm-s390/compat.h
index 356a0b183539..296f4f1a20e1 100644
--- a/include/asm-s390/compat.h
+++ b/include/asm-s390/compat.h
@@ -6,6 +6,34 @@
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/sched.h> 7#include <linux/sched.h>
8 8
9#define PSW32_MASK_PER 0x40000000UL
10#define PSW32_MASK_DAT 0x04000000UL
11#define PSW32_MASK_IO 0x02000000UL
12#define PSW32_MASK_EXT 0x01000000UL
13#define PSW32_MASK_KEY 0x00F00000UL
14#define PSW32_MASK_MCHECK 0x00040000UL
15#define PSW32_MASK_WAIT 0x00020000UL
16#define PSW32_MASK_PSTATE 0x00010000UL
17#define PSW32_MASK_ASC 0x0000C000UL
18#define PSW32_MASK_CC 0x00003000UL
19#define PSW32_MASK_PM 0x00000f00UL
20
21#define PSW32_ADDR_AMODE31 0x80000000UL
22#define PSW32_ADDR_INSN 0x7FFFFFFFUL
23
24#define PSW32_BASE_BITS 0x00080000UL
25
26#define PSW32_ASC_PRIMARY 0x00000000UL
27#define PSW32_ASC_ACCREG 0x00004000UL
28#define PSW32_ASC_SECONDARY 0x00008000UL
29#define PSW32_ASC_HOME 0x0000C000UL
30
31#define PSW32_MASK_MERGE(CURRENT,NEW) \
32 (((CURRENT) & ~(PSW32_MASK_CC|PSW32_MASK_PM)) | \
33 ((NEW) & (PSW32_MASK_CC|PSW32_MASK_PM)))
34
35extern long psw32_user_bits;
36
9#define COMPAT_USER_HZ 100 37#define COMPAT_USER_HZ 100
10 38
11typedef u32 compat_size_t; 39typedef u32 compat_size_t;
diff --git a/include/asm-s390/etr.h b/include/asm-s390/etr.h
new file mode 100644
index 000000000000..b498f19bb9a7
--- /dev/null
+++ b/include/asm-s390/etr.h
@@ -0,0 +1,219 @@
1/*
2 * include/asm-s390/etr.h
3 *
4 * Copyright IBM Corp. 2006
5 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
6 */
7#ifndef __S390_ETR_H
8#define __S390_ETR_H
9
10/* ETR attachment control register */
11struct etr_eacr {
12 unsigned int e0 : 1; /* port 0 stepping control */
13 unsigned int e1 : 1; /* port 1 stepping control */
14 unsigned int _pad0 : 5; /* must be 00100 */
15 unsigned int dp : 1; /* data port control */
16 unsigned int p0 : 1; /* port 0 change recognition control */
17 unsigned int p1 : 1; /* port 1 change recognition control */
18 unsigned int _pad1 : 3; /* must be 000 */
19 unsigned int ea : 1; /* ETR alert control */
20 unsigned int es : 1; /* ETR sync check control */
21 unsigned int sl : 1; /* switch to local control */
22} __attribute__ ((packed));
23
24/* Port state returned by steai */
25enum etr_psc {
26 etr_psc_operational = 0,
27 etr_psc_semi_operational = 1,
28 etr_psc_protocol_error = 4,
29 etr_psc_no_symbols = 8,
30 etr_psc_no_signal = 12,
31 etr_psc_pps_mode = 13
32};
33
34/* Logical port state returned by stetr */
35enum etr_lpsc {
36 etr_lpsc_operational_step = 0,
37 etr_lpsc_operational_alt = 1,
38 etr_lpsc_semi_operational = 2,
39 etr_lpsc_protocol_error = 4,
40 etr_lpsc_no_symbol_sync = 8,
41 etr_lpsc_no_signal = 12,
42 etr_lpsc_pps_mode = 13
43};
44
45/* ETR status words */
46struct etr_esw {
47 struct etr_eacr eacr; /* attachment control register */
48 unsigned int y : 1; /* stepping mode */
49 unsigned int _pad0 : 5; /* must be 00000 */
50 unsigned int p : 1; /* stepping port number */
51 unsigned int q : 1; /* data port number */
52 unsigned int psc0 : 4; /* port 0 state code */
53 unsigned int psc1 : 4; /* port 1 state code */
54} __attribute__ ((packed));
55
56/* Second level data register status word */
57struct etr_slsw {
58 unsigned int vv1 : 1; /* copy of validity bit data frame 1 */
59 unsigned int vv2 : 1; /* copy of validity bit data frame 2 */
60 unsigned int vv3 : 1; /* copy of validity bit data frame 3 */
61 unsigned int vv4 : 1; /* copy of validity bit data frame 4 */
62 unsigned int _pad0 : 19; /* must by all zeroes */
63 unsigned int n : 1; /* EAF port number */
64 unsigned int v1 : 1; /* validity bit ETR data frame 1 */
65 unsigned int v2 : 1; /* validity bit ETR data frame 2 */
66 unsigned int v3 : 1; /* validity bit ETR data frame 3 */
67 unsigned int v4 : 1; /* validity bit ETR data frame 4 */
68 unsigned int _pad1 : 4; /* must be 0000 */
69} __attribute__ ((packed));
70
71/* ETR data frames */
72struct etr_edf1 {
73 unsigned int u : 1; /* untuned bit */
74 unsigned int _pad0 : 1; /* must be 0 */
75 unsigned int r : 1; /* service request bit */
76 unsigned int _pad1 : 4; /* must be 0000 */
77 unsigned int a : 1; /* time adjustment bit */
78 unsigned int net_id : 8; /* ETR network id */
79 unsigned int etr_id : 8; /* id of ETR which sends data frames */
80 unsigned int etr_pn : 8; /* port number of ETR output port */
81} __attribute__ ((packed));
82
83struct etr_edf2 {
84 unsigned int etv : 32; /* Upper 32 bits of TOD. */
85} __attribute__ ((packed));
86
87struct etr_edf3 {
88 unsigned int rc : 8; /* failure reason code */
89 unsigned int _pad0 : 3; /* must be 000 */
90 unsigned int c : 1; /* ETR coupled bit */
91 unsigned int tc : 4; /* ETR type code */
92 unsigned int blto : 8; /* biased local time offset */
93 /* (blto - 128) * 15 = minutes */
94 unsigned int buo : 8; /* biased utc offset */
95 /* (buo - 128) = leap seconds */
96} __attribute__ ((packed));
97
98struct etr_edf4 {
99 unsigned int ed : 8; /* ETS device dependent data */
100 unsigned int _pad0 : 1; /* must be 0 */
101 unsigned int buc : 5; /* biased ut1 correction */
102 /* (buc - 16) * 0.1 seconds */
103 unsigned int em : 6; /* ETS error magnitude */
104 unsigned int dc : 6; /* ETS drift code */
105 unsigned int sc : 6; /* ETS steering code */
106} __attribute__ ((packed));
107
108/*
109 * ETR attachment information block, two formats
110 * format 1 has 4 reserved words with a size of 64 bytes
111 * format 2 has 16 reserved words with a size of 96 bytes
112 */
113struct etr_aib {
114 struct etr_esw esw;
115 struct etr_slsw slsw;
116 unsigned long long tsp;
117 struct etr_edf1 edf1;
118 struct etr_edf2 edf2;
119 struct etr_edf3 edf3;
120 struct etr_edf4 edf4;
121 unsigned int reserved[16];
122} __attribute__ ((packed,aligned(8)));
123
124/* ETR interruption parameter */
125struct etr_interruption_parameter {
126 unsigned int _pad0 : 8;
127 unsigned int pc0 : 1; /* port 0 state change */
128 unsigned int pc1 : 1; /* port 1 state change */
129 unsigned int _pad1 : 3;
130 unsigned int eai : 1; /* ETR alert indication */
131 unsigned int _pad2 : 18;
132} __attribute__ ((packed));
133
134/* Query TOD offset result */
135struct etr_ptff_qto {
136 unsigned long long physical_clock;
137 unsigned long long tod_offset;
138 unsigned long long logical_tod_offset;
139 unsigned long long tod_epoch_difference;
140} __attribute__ ((packed));
141
142/* Inline assembly helper functions */
143static inline int etr_setr(struct etr_eacr *ctrl)
144{
145 int rc = -ENOSYS;
146
147 asm volatile(
148 " .insn s,0xb2160000,0(%2)\n"
149 "0: la %0,0\n"
150 "1:\n"
151 EX_TABLE(0b,1b)
152 : "+d" (rc) : "m" (*ctrl), "a" (ctrl));
153 return rc;
154}
155
156/* Stores a format 1 aib with 64 bytes */
157static inline int etr_stetr(struct etr_aib *aib)
158{
159 int rc = -ENOSYS;
160
161 asm volatile(
162 " .insn s,0xb2170000,0(%2)\n"
163 "0: la %0,0\n"
164 "1:\n"
165 EX_TABLE(0b,1b)
166 : "+d" (rc) : "m" (*aib), "a" (aib));
167 return rc;
168}
169
170/* Stores a format 2 aib with 96 bytes for specified port */
171static inline int etr_steai(struct etr_aib *aib, unsigned int func)
172{
173 register unsigned int reg0 asm("0") = func;
174 int rc = -ENOSYS;
175
176 asm volatile(
177 " .insn s,0xb2b30000,0(%2)\n"
178 "0: la %0,0\n"
179 "1:\n"
180 EX_TABLE(0b,1b)
181 : "+d" (rc) : "m" (*aib), "a" (aib), "d" (reg0));
182 return rc;
183}
184
185/* Function codes for the steai instruction. */
186#define ETR_STEAI_STEPPING_PORT 0x10
187#define ETR_STEAI_ALTERNATE_PORT 0x11
188#define ETR_STEAI_PORT_0 0x12
189#define ETR_STEAI_PORT_1 0x13
190
191static inline int etr_ptff(void *ptff_block, unsigned int func)
192{
193 register unsigned int reg0 asm("0") = func;
194 register unsigned long reg1 asm("1") = (unsigned long) ptff_block;
195 int rc = -ENOSYS;
196
197 asm volatile(
198 " .word 0x0104\n"
199 " ipm %0\n"
200 " srl %0,28\n"
201 : "=d" (rc), "=m" (ptff_block)
202 : "d" (reg0), "d" (reg1), "m" (ptff_block) : "cc");
203 return rc;
204}
205
206/* Function codes for the ptff instruction. */
207#define ETR_PTFF_QAF 0x00 /* query available functions */
208#define ETR_PTFF_QTO 0x01 /* query tod offset */
209#define ETR_PTFF_QSI 0x02 /* query steering information */
210#define ETR_PTFF_ATO 0x40 /* adjust tod offset */
211#define ETR_PTFF_STO 0x41 /* set tod offset */
212#define ETR_PTFF_SFS 0x42 /* set fine steering rate */
213#define ETR_PTFF_SGS 0x43 /* set gross steering rate */
214
215/* Functions needed by the machine check handler */
216extern void etr_switch_to_local(void);
217extern void etr_sync_check(void);
218
219#endif /* __S390_ETR_H */
diff --git a/include/asm-s390/hardirq.h b/include/asm-s390/hardirq.h
index c2f6a8782d31..31beb18cb3d1 100644
--- a/include/asm-s390/hardirq.h
+++ b/include/asm-s390/hardirq.h
@@ -32,6 +32,6 @@ typedef struct {
32 32
33#define HARDIRQ_BITS 8 33#define HARDIRQ_BITS 8
34 34
35extern void account_ticks(void); 35extern void account_ticks(u64 time);
36 36
37#endif /* __ASM_HARDIRQ_H */ 37#endif /* __ASM_HARDIRQ_H */
diff --git a/include/asm-s390/io.h b/include/asm-s390/io.h
index efb7de9c1c6b..b7ff6afc3caa 100644
--- a/include/asm-s390/io.h
+++ b/include/asm-s390/io.h
@@ -13,13 +13,10 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/vmalloc.h>
17#include <asm/page.h> 16#include <asm/page.h>
18 17
19#define IO_SPACE_LIMIT 0xffffffff 18#define IO_SPACE_LIMIT 0xffffffff
20 19
21#define __io_virt(x) ((void *)(PAGE_OFFSET | (unsigned long)(x)))
22
23/* 20/*
24 * Change virtual addresses to physical addresses and vv. 21 * Change virtual addresses to physical addresses and vv.
25 * These are pretty trivial 22 * These are pretty trivial
@@ -28,11 +25,7 @@ static inline unsigned long virt_to_phys(volatile void * address)
28{ 25{
29 unsigned long real_address; 26 unsigned long real_address;
30 asm volatile( 27 asm volatile(
31#ifndef __s390x__
32 " lra %0,0(%1)\n" 28 " lra %0,0(%1)\n"
33#else /* __s390x__ */
34 " lrag %0,0(%1)\n"
35#endif /* __s390x__ */
36 " jz 0f\n" 29 " jz 0f\n"
37 " la %0,0\n" 30 " la %0,0\n"
38 "0:" 31 "0:"
@@ -42,75 +35,9 @@ static inline unsigned long virt_to_phys(volatile void * address)
42 35
43static inline void * phys_to_virt(unsigned long address) 36static inline void * phys_to_virt(unsigned long address)
44{ 37{
45 return __io_virt(address); 38 return (void *) address;
46}
47
48extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
49
50static inline void * ioremap (unsigned long offset, unsigned long size)
51{
52 return __ioremap(offset, size, 0);
53}
54
55/*
56 * This one maps high address device memory and turns off caching for that area.
57 * it's useful if some control registers are in such an area and write combining
58 * or read caching is not desirable:
59 */
60static inline void * ioremap_nocache (unsigned long offset, unsigned long size)
61{
62 return __ioremap(offset, size, 0);
63} 39}
64 40
65extern void iounmap(void *addr);
66
67/*
68 * IO bus memory addresses are also 1:1 with the physical address
69 */
70#define virt_to_bus virt_to_phys
71#define bus_to_virt phys_to_virt
72
73/*
74 * readX/writeX() are used to access memory mapped devices. On some
75 * architectures the memory mapped IO stuff needs to be accessed
76 * differently.
77 */
78
79#define readb(addr) (*(volatile unsigned char *) __io_virt(addr))
80#define readw(addr) (*(volatile unsigned short *) __io_virt(addr))
81#define readl(addr) (*(volatile unsigned int *) __io_virt(addr))
82#define readq(addr) (*(volatile unsigned long long *) __io_virt(addr))
83
84#define readb_relaxed(addr) readb(addr)
85#define readw_relaxed(addr) readw(addr)
86#define readl_relaxed(addr) readl(addr)
87#define readq_relaxed(addr) readq(addr)
88#define __raw_readb readb
89#define __raw_readw readw
90#define __raw_readl readl
91#define __raw_readq readq
92
93#define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b))
94#define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b))
95#define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b))
96#define writeq(b,addr) (*(volatile unsigned long long *) __io_virt(addr) = (b))
97#define __raw_writeb writeb
98#define __raw_writew writew
99#define __raw_writel writel
100#define __raw_writeq writeq
101
102#define memset_io(a,b,c) memset(__io_virt(a),(b),(c))
103#define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c))
104#define memcpy_toio(a,b,c) memcpy(__io_virt(a),(b),(c))
105
106#define inb_p(addr) readb(addr)
107#define inb(addr) readb(addr)
108
109#define outb(x,addr) ((void) writeb(x,addr))
110#define outb_p(x,addr) outb(x,addr)
111
112#define mmiowb() do { } while (0)
113
114/* 41/*
115 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 42 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
116 * access 43 * access
diff --git a/include/asm-s390/kdebug.h b/include/asm-s390/kdebug.h
index 40cc68025e01..1b50f89819a4 100644
--- a/include/asm-s390/kdebug.h
+++ b/include/asm-s390/kdebug.h
@@ -26,7 +26,6 @@ extern int register_page_fault_notifier(struct notifier_block *);
26extern int unregister_page_fault_notifier(struct notifier_block *); 26extern int unregister_page_fault_notifier(struct notifier_block *);
27extern struct atomic_notifier_head s390die_chain; 27extern struct atomic_notifier_head s390die_chain;
28 28
29
30enum die_val { 29enum die_val {
31 DIE_OOPS = 1, 30 DIE_OOPS = 1,
32 DIE_BPT, 31 DIE_BPT,
@@ -56,4 +55,6 @@ static inline int notify_die(enum die_val val, const char *str,
56 return atomic_notifier_call_chain(&s390die_chain, val, &args); 55 return atomic_notifier_call_chain(&s390die_chain, val, &args);
57} 56}
58 57
58extern void die(const char *, struct pt_regs *, long);
59
59#endif 60#endif
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h
index 74f7389bd3ee..4a31d0a7ee83 100644
--- a/include/asm-s390/lowcore.h
+++ b/include/asm-s390/lowcore.h
@@ -220,7 +220,8 @@ struct _lowcore
220 __u32 kernel_asce; /* 0xc4c */ 220 __u32 kernel_asce; /* 0xc4c */
221 __u32 user_asce; /* 0xc50 */ 221 __u32 user_asce; /* 0xc50 */
222 __u32 panic_stack; /* 0xc54 */ 222 __u32 panic_stack; /* 0xc54 */
223 __u8 pad10[0xc60-0xc58]; /* 0xc58 */ 223 __u32 user_exec_asce; /* 0xc58 */
224 __u8 pad10[0xc60-0xc5c]; /* 0xc5c */
224 /* entry.S sensitive area start */ 225 /* entry.S sensitive area start */
225 struct cpuinfo_S390 cpu_data; /* 0xc60 */ 226 struct cpuinfo_S390 cpu_data; /* 0xc60 */
226 __u32 ipl_device; /* 0xc7c */ 227 __u32 ipl_device; /* 0xc7c */
@@ -310,7 +311,8 @@ struct _lowcore
310 __u64 kernel_asce; /* 0xd58 */ 311 __u64 kernel_asce; /* 0xd58 */
311 __u64 user_asce; /* 0xd60 */ 312 __u64 user_asce; /* 0xd60 */
312 __u64 panic_stack; /* 0xd68 */ 313 __u64 panic_stack; /* 0xd68 */
313 __u8 pad10[0xd80-0xd70]; /* 0xd70 */ 314 __u64 user_exec_asce; /* 0xd70 */
315 __u8 pad10[0xd80-0xd78]; /* 0xd78 */
314 /* entry.S sensitive area start */ 316 /* entry.S sensitive area start */
315 struct cpuinfo_S390 cpu_data; /* 0xd80 */ 317 struct cpuinfo_S390 cpu_data; /* 0xd80 */
316 __u32 ipl_device; /* 0xdb8 */ 318 __u32 ipl_device; /* 0xdb8 */
diff --git a/include/asm-s390/mmu_context.h b/include/asm-s390/mmu_context.h
index bcf24a873874..1d21da220d49 100644
--- a/include/asm-s390/mmu_context.h
+++ b/include/asm-s390/mmu_context.h
@@ -9,6 +9,7 @@
9#ifndef __S390_MMU_CONTEXT_H 9#ifndef __S390_MMU_CONTEXT_H
10#define __S390_MMU_CONTEXT_H 10#define __S390_MMU_CONTEXT_H
11 11
12#include <asm/pgalloc.h>
12/* 13/*
13 * get a new mmu context.. S390 don't know about contexts. 14 * get a new mmu context.. S390 don't know about contexts.
14 */ 15 */
@@ -16,29 +17,44 @@
16 17
17#define destroy_context(mm) do { } while (0) 18#define destroy_context(mm) do { } while (0)
18 19
20#ifndef __s390x__
21#define LCTL_OPCODE "lctl"
22#define PGTABLE_BITS (_SEGMENT_TABLE|USER_STD_MASK)
23#else
24#define LCTL_OPCODE "lctlg"
25#define PGTABLE_BITS (_REGION_TABLE|USER_STD_MASK)
26#endif
27
19static inline void enter_lazy_tlb(struct mm_struct *mm, 28static inline void enter_lazy_tlb(struct mm_struct *mm,
20 struct task_struct *tsk) 29 struct task_struct *tsk)
21{ 30{
22} 31}
23 32
24static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 33static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
25 struct task_struct *tsk) 34 struct task_struct *tsk)
26{ 35{
27 if (prev != next) { 36 pgd_t *shadow_pgd = get_shadow_pgd(next->pgd);
28#ifndef __s390x__ 37
29 S390_lowcore.user_asce = (__pa(next->pgd)&PAGE_MASK) | 38 if (prev != next) {
30 (_SEGMENT_TABLE|USER_STD_MASK); 39 S390_lowcore.user_asce = (__pa(next->pgd) & PAGE_MASK) |
31 /* Load home space page table origin. */ 40 PGTABLE_BITS;
32 asm volatile("lctl 13,13,%0" 41 if (shadow_pgd) {
33 : : "m" (S390_lowcore.user_asce) ); 42 /* Load primary/secondary space page table origin. */
34#else /* __s390x__ */ 43 S390_lowcore.user_exec_asce =
35 S390_lowcore.user_asce = (__pa(next->pgd) & PAGE_MASK) | 44 (__pa(shadow_pgd) & PAGE_MASK) | PGTABLE_BITS;
36 (_REGION_TABLE|USER_STD_MASK); 45 asm volatile(LCTL_OPCODE" 1,1,%0\n"
37 /* Load home space page table origin. */ 46 LCTL_OPCODE" 7,7,%1"
38 asm volatile("lctlg 13,13,%0" 47 : : "m" (S390_lowcore.user_exec_asce),
39 : : "m" (S390_lowcore.user_asce) ); 48 "m" (S390_lowcore.user_asce) );
40#endif /* __s390x__ */ 49 } else if (switch_amode) {
41 } 50 /* Load primary space page table origin. */
51 asm volatile(LCTL_OPCODE" 1,1,%0"
52 : : "m" (S390_lowcore.user_asce) );
53 } else
54 /* Load home space page table origin. */
55 asm volatile(LCTL_OPCODE" 13,13,%0"
56 : : "m" (S390_lowcore.user_asce) );
57 }
42 cpu_set(smp_processor_id(), next->cpu_vm_mask); 58 cpu_set(smp_processor_id(), next->cpu_vm_mask);
43} 59}
44 60
@@ -51,4 +67,4 @@ static inline void activate_mm(struct mm_struct *prev,
51 set_fs(current->thread.mm_segment); 67 set_fs(current->thread.mm_segment);
52} 68}
53 69
54#endif 70#endif /* __S390_MMU_CONTEXT_H */
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
index 0707a7e2fc16..56c8a6c80e2e 100644
--- a/include/asm-s390/pgalloc.h
+++ b/include/asm-s390/pgalloc.h
@@ -47,6 +47,17 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
47 47
48 if (!pgd) 48 if (!pgd)
49 return NULL; 49 return NULL;
50 if (s390_noexec) {
51 pgd_t *shadow_pgd = (pgd_t *)
52 __get_free_pages(GFP_KERNEL, PGD_ALLOC_ORDER);
53 struct page *page = virt_to_page(pgd);
54
55 if (!shadow_pgd) {
56 free_pages((unsigned long) pgd, PGD_ALLOC_ORDER);
57 return NULL;
58 }
59 page->lru.next = (void *) shadow_pgd;
60 }
50 for (i = 0; i < PTRS_PER_PGD; i++) 61 for (i = 0; i < PTRS_PER_PGD; i++)
51#ifndef __s390x__ 62#ifndef __s390x__
52 pmd_clear(pmd_offset(pgd + i, i*PGDIR_SIZE)); 63 pmd_clear(pmd_offset(pgd + i, i*PGDIR_SIZE));
@@ -58,6 +69,10 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
58 69
59static inline void pgd_free(pgd_t *pgd) 70static inline void pgd_free(pgd_t *pgd)
60{ 71{
72 pgd_t *shadow_pgd = get_shadow_pgd(pgd);
73
74 if (shadow_pgd)
75 free_pages((unsigned long) shadow_pgd, PGD_ALLOC_ORDER);
61 free_pages((unsigned long) pgd, PGD_ALLOC_ORDER); 76 free_pages((unsigned long) pgd, PGD_ALLOC_ORDER);
62} 77}
63 78
@@ -71,6 +86,7 @@ static inline void pgd_free(pgd_t *pgd)
71#define pmd_free(x) do { } while (0) 86#define pmd_free(x) do { } while (0)
72#define __pmd_free_tlb(tlb,x) do { } while (0) 87#define __pmd_free_tlb(tlb,x) do { } while (0)
73#define pgd_populate(mm, pmd, pte) BUG() 88#define pgd_populate(mm, pmd, pte) BUG()
89#define pgd_populate_kernel(mm, pmd, pte) BUG()
74#else /* __s390x__ */ 90#else /* __s390x__ */
75static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) 91static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
76{ 92{
@@ -79,6 +95,17 @@ static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
79 95
80 if (!pmd) 96 if (!pmd)
81 return NULL; 97 return NULL;
98 if (s390_noexec) {
99 pmd_t *shadow_pmd = (pmd_t *)
100 __get_free_pages(GFP_KERNEL, PMD_ALLOC_ORDER);
101 struct page *page = virt_to_page(pmd);
102
103 if (!shadow_pmd) {
104 free_pages((unsigned long) pmd, PMD_ALLOC_ORDER);
105 return NULL;
106 }
107 page->lru.next = (void *) shadow_pmd;
108 }
82 for (i=0; i < PTRS_PER_PMD; i++) 109 for (i=0; i < PTRS_PER_PMD; i++)
83 pmd_clear(pmd + i); 110 pmd_clear(pmd + i);
84 return pmd; 111 return pmd;
@@ -86,6 +113,10 @@ static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
86 113
87static inline void pmd_free (pmd_t *pmd) 114static inline void pmd_free (pmd_t *pmd)
88{ 115{
116 pmd_t *shadow_pmd = get_shadow_pmd(pmd);
117
118 if (shadow_pmd)
119 free_pages((unsigned long) shadow_pmd, PMD_ALLOC_ORDER);
89 free_pages((unsigned long) pmd, PMD_ALLOC_ORDER); 120 free_pages((unsigned long) pmd, PMD_ALLOC_ORDER);
90} 121}
91 122
@@ -95,11 +126,22 @@ static inline void pmd_free (pmd_t *pmd)
95 pmd_free(pmd); \ 126 pmd_free(pmd); \
96 } while (0) 127 } while (0)
97 128
98static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd) 129static inline void
130pgd_populate_kernel(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
99{ 131{
100 pgd_val(*pgd) = _PGD_ENTRY | __pa(pmd); 132 pgd_val(*pgd) = _PGD_ENTRY | __pa(pmd);
101} 133}
102 134
135static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
136{
137 pgd_t *shadow_pgd = get_shadow_pgd(pgd);
138 pmd_t *shadow_pmd = get_shadow_pmd(pmd);
139
140 if (shadow_pgd && shadow_pmd)
141 pgd_populate_kernel(mm, shadow_pgd, shadow_pmd);
142 pgd_populate_kernel(mm, pgd, pmd);
143}
144
103#endif /* __s390x__ */ 145#endif /* __s390x__ */
104 146
105static inline void 147static inline void
@@ -119,7 +161,13 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
119static inline void 161static inline void
120pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *page) 162pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *page)
121{ 163{
122 pmd_populate_kernel(mm, pmd, (pte_t *)page_to_phys(page)); 164 pte_t *pte = (pte_t *)page_to_phys(page);
165 pmd_t *shadow_pmd = get_shadow_pmd(pmd);
166 pte_t *shadow_pte = get_shadow_pte(pte);
167
168 pmd_populate_kernel(mm, pmd, pte);
169 if (shadow_pmd && shadow_pte)
170 pmd_populate_kernel(mm, shadow_pmd, shadow_pte);
123} 171}
124 172
125/* 173/*
@@ -133,6 +181,17 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long vmaddr)
133 181
134 if (!pte) 182 if (!pte)
135 return NULL; 183 return NULL;
184 if (s390_noexec) {
185 pte_t *shadow_pte = (pte_t *)
186 __get_free_page(GFP_KERNEL|__GFP_REPEAT);
187 struct page *page = virt_to_page(pte);
188
189 if (!shadow_pte) {
190 free_page((unsigned long) pte);
191 return NULL;
192 }
193 page->lru.next = (void *) shadow_pte;
194 }
136 for (i=0; i < PTRS_PER_PTE; i++) { 195 for (i=0; i < PTRS_PER_PTE; i++) {
137 pte_clear(mm, vmaddr, pte + i); 196 pte_clear(mm, vmaddr, pte + i);
138 vmaddr += PAGE_SIZE; 197 vmaddr += PAGE_SIZE;
@@ -151,14 +210,30 @@ pte_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
151 210
152static inline void pte_free_kernel(pte_t *pte) 211static inline void pte_free_kernel(pte_t *pte)
153{ 212{
154 free_page((unsigned long) pte); 213 pte_t *shadow_pte = get_shadow_pte(pte);
214
215 if (shadow_pte)
216 free_page((unsigned long) shadow_pte);
217 free_page((unsigned long) pte);
155} 218}
156 219
157static inline void pte_free(struct page *pte) 220static inline void pte_free(struct page *pte)
158{ 221{
159 __free_page(pte); 222 struct page *shadow_page = get_shadow_page(pte);
223
224 if (shadow_page)
225 __free_page(shadow_page);
226 __free_page(pte);
160} 227}
161 228
162#define __pte_free_tlb(tlb,pte) tlb_remove_page(tlb,pte) 229#define __pte_free_tlb(tlb, pte) \
230({ \
231 struct mmu_gather *__tlb = (tlb); \
232 struct page *__pte = (pte); \
233 struct page *shadow_page = get_shadow_page(__pte); \
234 if (shadow_page) \
235 tlb_remove_page(__tlb, shadow_page); \
236 tlb_remove_page(__tlb, __pte); \
237})
163 238
164#endif /* _S390_PGALLOC_H */ 239#endif /* _S390_PGALLOC_H */
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index ae61aca5d483..13c16546eff5 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -40,6 +40,7 @@ struct mm_struct;
40 40
41extern pgd_t swapper_pg_dir[] __attribute__ ((aligned (4096))); 41extern pgd_t swapper_pg_dir[] __attribute__ ((aligned (4096)));
42extern void paging_init(void); 42extern void paging_init(void);
43extern void vmem_map_init(void);
43 44
44/* 45/*
45 * The S390 doesn't have any external MMU info: the kernel page 46 * The S390 doesn't have any external MMU info: the kernel page
@@ -223,6 +224,8 @@ extern unsigned long vmalloc_end;
223#define _PAGE_TYPE_FILE 0x601 /* bit 0x002 is used for offset !! */ 224#define _PAGE_TYPE_FILE 0x601 /* bit 0x002 is used for offset !! */
224#define _PAGE_TYPE_RO 0x200 225#define _PAGE_TYPE_RO 0x200
225#define _PAGE_TYPE_RW 0x000 226#define _PAGE_TYPE_RW 0x000
227#define _PAGE_TYPE_EX_RO 0x202
228#define _PAGE_TYPE_EX_RW 0x002
226 229
227/* 230/*
228 * PTE type bits are rather complicated. handle_pte_fault uses pte_present, 231 * PTE type bits are rather complicated. handle_pte_fault uses pte_present,
@@ -243,11 +246,13 @@ extern unsigned long vmalloc_end;
243 * _PAGE_TYPE_FILE 11?1 -> 11?1 246 * _PAGE_TYPE_FILE 11?1 -> 11?1
244 * _PAGE_TYPE_RO 0100 -> 1100 247 * _PAGE_TYPE_RO 0100 -> 1100
245 * _PAGE_TYPE_RW 0000 -> 1000 248 * _PAGE_TYPE_RW 0000 -> 1000
249 * _PAGE_TYPE_EX_RO 0110 -> 1110
250 * _PAGE_TYPE_EX_RW 0010 -> 1010
246 * 251 *
247 * pte_none is true for bits combinations 1000, 1100 252 * pte_none is true for bits combinations 1000, 1010, 1100, 1110
248 * pte_present is true for bits combinations 0000, 0010, 0100, 0110, 1001 253 * pte_present is true for bits combinations 0000, 0010, 0100, 0110, 1001
249 * pte_file is true for bits combinations 1101, 1111 254 * pte_file is true for bits combinations 1101, 1111
250 * swap pte is 1011 and 0001, 0011, 0101, 0111, 1010 and 1110 are invalid. 255 * swap pte is 1011 and 0001, 0011, 0101, 0111 are invalid.
251 */ 256 */
252 257
253#ifndef __s390x__ 258#ifndef __s390x__
@@ -312,33 +317,100 @@ extern unsigned long vmalloc_end;
312#define PAGE_NONE __pgprot(_PAGE_TYPE_NONE) 317#define PAGE_NONE __pgprot(_PAGE_TYPE_NONE)
313#define PAGE_RO __pgprot(_PAGE_TYPE_RO) 318#define PAGE_RO __pgprot(_PAGE_TYPE_RO)
314#define PAGE_RW __pgprot(_PAGE_TYPE_RW) 319#define PAGE_RW __pgprot(_PAGE_TYPE_RW)
320#define PAGE_EX_RO __pgprot(_PAGE_TYPE_EX_RO)
321#define PAGE_EX_RW __pgprot(_PAGE_TYPE_EX_RW)
315 322
316#define PAGE_KERNEL PAGE_RW 323#define PAGE_KERNEL PAGE_RW
317#define PAGE_COPY PAGE_RO 324#define PAGE_COPY PAGE_RO
318 325
319/* 326/*
320 * The S390 can't do page protection for execute, and considers that the 327 * Dependent on the EXEC_PROTECT option s390 can do execute protection.
321 * same are read. Also, write permissions imply read permissions. This is 328 * Write permission always implies read permission. In theory with a
322 * the closest we can get.. 329 * primary/secondary page table execute only can be implemented but
330 * it would cost an additional bit in the pte to distinguish all the
331 * different pte types. To avoid that execute permission currently
332 * implies read permission as well.
323 */ 333 */
324 /*xwr*/ 334 /*xwr*/
325#define __P000 PAGE_NONE 335#define __P000 PAGE_NONE
326#define __P001 PAGE_RO 336#define __P001 PAGE_RO
327#define __P010 PAGE_RO 337#define __P010 PAGE_RO
328#define __P011 PAGE_RO 338#define __P011 PAGE_RO
329#define __P100 PAGE_RO 339#define __P100 PAGE_EX_RO
330#define __P101 PAGE_RO 340#define __P101 PAGE_EX_RO
331#define __P110 PAGE_RO 341#define __P110 PAGE_EX_RO
332#define __P111 PAGE_RO 342#define __P111 PAGE_EX_RO
333 343
334#define __S000 PAGE_NONE 344#define __S000 PAGE_NONE
335#define __S001 PAGE_RO 345#define __S001 PAGE_RO
336#define __S010 PAGE_RW 346#define __S010 PAGE_RW
337#define __S011 PAGE_RW 347#define __S011 PAGE_RW
338#define __S100 PAGE_RO 348#define __S100 PAGE_EX_RO
339#define __S101 PAGE_RO 349#define __S101 PAGE_EX_RO
340#define __S110 PAGE_RW 350#define __S110 PAGE_EX_RW
341#define __S111 PAGE_RW 351#define __S111 PAGE_EX_RW
352
353#ifndef __s390x__
354# define PMD_SHADOW_SHIFT 1
355# define PGD_SHADOW_SHIFT 1
356#else /* __s390x__ */
357# define PMD_SHADOW_SHIFT 2
358# define PGD_SHADOW_SHIFT 2
359#endif /* __s390x__ */
360
361static inline struct page *get_shadow_page(struct page *page)
362{
363 if (s390_noexec && !list_empty(&page->lru))
364 return virt_to_page(page->lru.next);
365 return NULL;
366}
367
368static inline pte_t *get_shadow_pte(pte_t *ptep)
369{
370 unsigned long pteptr = (unsigned long) (ptep);
371
372 if (s390_noexec) {
373 unsigned long offset = pteptr & (PAGE_SIZE - 1);
374 void *addr = (void *) (pteptr ^ offset);
375 struct page *page = virt_to_page(addr);
376 if (!list_empty(&page->lru))
377 return (pte_t *) ((unsigned long) page->lru.next |
378 offset);
379 }
380 return NULL;
381}
382
383static inline pmd_t *get_shadow_pmd(pmd_t *pmdp)
384{
385 unsigned long pmdptr = (unsigned long) (pmdp);
386
387 if (s390_noexec) {
388 unsigned long offset = pmdptr &
389 ((PAGE_SIZE << PMD_SHADOW_SHIFT) - 1);
390 void *addr = (void *) (pmdptr ^ offset);
391 struct page *page = virt_to_page(addr);
392 if (!list_empty(&page->lru))
393 return (pmd_t *) ((unsigned long) page->lru.next |
394 offset);
395 }
396 return NULL;
397}
398
399static inline pgd_t *get_shadow_pgd(pgd_t *pgdp)
400{
401 unsigned long pgdptr = (unsigned long) (pgdp);
402
403 if (s390_noexec) {
404 unsigned long offset = pgdptr &
405 ((PAGE_SIZE << PGD_SHADOW_SHIFT) - 1);
406 void *addr = (void *) (pgdptr ^ offset);
407 struct page *page = virt_to_page(addr);
408 if (!list_empty(&page->lru))
409 return (pgd_t *) ((unsigned long) page->lru.next |
410 offset);
411 }
412 return NULL;
413}
342 414
343/* 415/*
344 * Certain architectures need to do special things when PTEs 416 * Certain architectures need to do special things when PTEs
@@ -347,7 +419,16 @@ extern unsigned long vmalloc_end;
347 */ 419 */
348static inline void set_pte(pte_t *pteptr, pte_t pteval) 420static inline void set_pte(pte_t *pteptr, pte_t pteval)
349{ 421{
422 pte_t *shadow_pte = get_shadow_pte(pteptr);
423
350 *pteptr = pteval; 424 *pteptr = pteval;
425 if (shadow_pte) {
426 if (!(pte_val(pteval) & _PAGE_INVALID) &&
427 (pte_val(pteval) & _PAGE_SWX))
428 pte_val(*shadow_pte) = pte_val(pteval) | _PAGE_RO;
429 else
430 pte_val(*shadow_pte) = _PAGE_TYPE_EMPTY;
431 }
351} 432}
352#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 433#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
353 434
@@ -465,7 +546,7 @@ static inline int pte_read(pte_t pte)
465 546
466static inline void pgd_clear(pgd_t * pgdp) { } 547static inline void pgd_clear(pgd_t * pgdp) { }
467 548
468static inline void pmd_clear(pmd_t * pmdp) 549static inline void pmd_clear_kernel(pmd_t * pmdp)
469{ 550{
470 pmd_val(pmdp[0]) = _PAGE_TABLE_INV; 551 pmd_val(pmdp[0]) = _PAGE_TABLE_INV;
471 pmd_val(pmdp[1]) = _PAGE_TABLE_INV; 552 pmd_val(pmdp[1]) = _PAGE_TABLE_INV;
@@ -473,24 +554,55 @@ static inline void pmd_clear(pmd_t * pmdp)
473 pmd_val(pmdp[3]) = _PAGE_TABLE_INV; 554 pmd_val(pmdp[3]) = _PAGE_TABLE_INV;
474} 555}
475 556
557static inline void pmd_clear(pmd_t * pmdp)
558{
559 pmd_t *shadow_pmd = get_shadow_pmd(pmdp);
560
561 pmd_clear_kernel(pmdp);
562 if (shadow_pmd)
563 pmd_clear_kernel(shadow_pmd);
564}
565
476#else /* __s390x__ */ 566#else /* __s390x__ */
477 567
478static inline void pgd_clear(pgd_t * pgdp) 568static inline void pgd_clear_kernel(pgd_t * pgdp)
479{ 569{
480 pgd_val(*pgdp) = _PGD_ENTRY_INV | _PGD_ENTRY; 570 pgd_val(*pgdp) = _PGD_ENTRY_INV | _PGD_ENTRY;
481} 571}
482 572
483static inline void pmd_clear(pmd_t * pmdp) 573static inline void pgd_clear(pgd_t * pgdp)
574{
575 pgd_t *shadow_pgd = get_shadow_pgd(pgdp);
576
577 pgd_clear_kernel(pgdp);
578 if (shadow_pgd)
579 pgd_clear_kernel(shadow_pgd);
580}
581
582static inline void pmd_clear_kernel(pmd_t * pmdp)
484{ 583{
485 pmd_val(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY; 584 pmd_val(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY;
486 pmd_val1(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY; 585 pmd_val1(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY;
487} 586}
488 587
588static inline void pmd_clear(pmd_t * pmdp)
589{
590 pmd_t *shadow_pmd = get_shadow_pmd(pmdp);
591
592 pmd_clear_kernel(pmdp);
593 if (shadow_pmd)
594 pmd_clear_kernel(shadow_pmd);
595}
596
489#endif /* __s390x__ */ 597#endif /* __s390x__ */
490 598
491static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 599static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
492{ 600{
601 pte_t *shadow_pte = get_shadow_pte(ptep);
602
493 pte_val(*ptep) = _PAGE_TYPE_EMPTY; 603 pte_val(*ptep) = _PAGE_TYPE_EMPTY;
604 if (shadow_pte)
605 pte_val(*shadow_pte) = _PAGE_TYPE_EMPTY;
494} 606}
495 607
496/* 608/*
@@ -608,8 +720,11 @@ ptep_clear_flush(struct vm_area_struct *vma,
608 unsigned long address, pte_t *ptep) 720 unsigned long address, pte_t *ptep)
609{ 721{
610 pte_t pte = *ptep; 722 pte_t pte = *ptep;
723 pte_t *shadow_pte = get_shadow_pte(ptep);
611 724
612 __ptep_ipte(address, ptep); 725 __ptep_ipte(address, ptep);
726 if (shadow_pte)
727 __ptep_ipte(address, shadow_pte);
613 return pte; 728 return pte;
614} 729}
615 730
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index cbbedc63ba25..4c1b73940351 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -50,6 +50,7 @@ struct cpuinfo_S390
50 unsigned long pgtable_cache_sz; 50 unsigned long pgtable_cache_sz;
51}; 51};
52 52
53extern void s390_adjust_jiffies(void);
53extern void print_cpu_info(struct cpuinfo_S390 *); 54extern void print_cpu_info(struct cpuinfo_S390 *);
54 55
55/* Lazy FPU handling on uni-processor */ 56/* Lazy FPU handling on uni-processor */
@@ -144,7 +145,8 @@ struct stack_frame {
144#ifndef __s390x__ 145#ifndef __s390x__
145 146
146#define start_thread(regs, new_psw, new_stackp) do { \ 147#define start_thread(regs, new_psw, new_stackp) do { \
147 regs->psw.mask = PSW_USER_BITS; \ 148 set_fs(USER_DS); \
149 regs->psw.mask = psw_user_bits; \
148 regs->psw.addr = new_psw | PSW_ADDR_AMODE; \ 150 regs->psw.addr = new_psw | PSW_ADDR_AMODE; \
149 regs->gprs[15] = new_stackp ; \ 151 regs->gprs[15] = new_stackp ; \
150} while (0) 152} while (0)
@@ -152,13 +154,15 @@ struct stack_frame {
152#else /* __s390x__ */ 154#else /* __s390x__ */
153 155
154#define start_thread(regs, new_psw, new_stackp) do { \ 156#define start_thread(regs, new_psw, new_stackp) do { \
155 regs->psw.mask = PSW_USER_BITS; \ 157 set_fs(USER_DS); \
158 regs->psw.mask = psw_user_bits; \
156 regs->psw.addr = new_psw; \ 159 regs->psw.addr = new_psw; \
157 regs->gprs[15] = new_stackp; \ 160 regs->gprs[15] = new_stackp; \
158} while (0) 161} while (0)
159 162
160#define start_thread31(regs, new_psw, new_stackp) do { \ 163#define start_thread31(regs, new_psw, new_stackp) do { \
161 regs->psw.mask = PSW_USER32_BITS; \ 164 set_fs(USER_DS); \
165 regs->psw.mask = psw_user32_bits; \
162 regs->psw.addr = new_psw; \ 166 regs->psw.addr = new_psw; \
163 regs->gprs[15] = new_stackp; \ 167 regs->gprs[15] = new_stackp; \
164} while (0) 168} while (0)
@@ -201,9 +205,8 @@ unsigned long get_wchan(struct task_struct *p);
201static inline void cpu_relax(void) 205static inline void cpu_relax(void)
202{ 206{
203 if (MACHINE_HAS_DIAG44) 207 if (MACHINE_HAS_DIAG44)
204 asm volatile("diag 0,0,68" : : : "memory"); 208 asm volatile("diag 0,0,68");
205 else 209 barrier();
206 barrier();
207} 210}
208 211
209/* 212/*
@@ -328,6 +331,18 @@ static inline void disabled_wait(unsigned long code)
328} 331}
329 332
330/* 333/*
334 * Basic Machine Check/Program Check Handler.
335 */
336
337extern void s390_base_mcck_handler(void);
338extern void s390_base_pgm_handler(void);
339extern void s390_base_ext_handler(void);
340
341extern void (*s390_base_mcck_handler_fn)(void);
342extern void (*s390_base_pgm_handler_fn)(void);
343extern void (*s390_base_ext_handler_fn)(void);
344
345/*
331 * CPU idle notifier chain. 346 * CPU idle notifier chain.
332 */ 347 */
333#define CPU_IDLE 0 348#define CPU_IDLE 0
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
index 7b768c5c68a8..fa6ca87080e8 100644
--- a/include/asm-s390/ptrace.h
+++ b/include/asm-s390/ptrace.h
@@ -266,17 +266,12 @@ typedef struct
266#define PSW_ASC_SECONDARY 0x0000800000000000UL 266#define PSW_ASC_SECONDARY 0x0000800000000000UL
267#define PSW_ASC_HOME 0x0000C00000000000UL 267#define PSW_ASC_HOME 0x0000C00000000000UL
268 268
269#define PSW_USER32_BITS (PSW_BASE32_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \ 269extern long psw_user32_bits;
270 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \
271 PSW_MASK_PSTATE | PSW_DEFAULT_KEY)
272 270
273#endif /* __s390x__ */ 271#endif /* __s390x__ */
274 272
275#define PSW_KERNEL_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY | \ 273extern long psw_kernel_bits;
276 PSW_MASK_MCHECK | PSW_DEFAULT_KEY) 274extern long psw_user_bits;
277#define PSW_USER_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \
278 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \
279 PSW_MASK_PSTATE | PSW_DEFAULT_KEY)
280 275
281/* This macro merges a NEW PSW mask specified by the user into 276/* This macro merges a NEW PSW mask specified by the user into
282 the currently active PSW mask CURRENT, modifying only those 277 the currently active PSW mask CURRENT, modifying only those
diff --git a/include/asm-s390/reset.h b/include/asm-s390/reset.h
index 532e65a2aafc..f584f4a52581 100644
--- a/include/asm-s390/reset.h
+++ b/include/asm-s390/reset.h
@@ -18,7 +18,4 @@ struct reset_call {
18extern void register_reset_call(struct reset_call *reset); 18extern void register_reset_call(struct reset_call *reset);
19extern void unregister_reset_call(struct reset_call *reset); 19extern void unregister_reset_call(struct reset_call *reset);
20extern void s390_reset_system(void); 20extern void s390_reset_system(void);
21extern void (*s390_reset_mcck_handler)(void);
22extern void (*s390_reset_pgm_handler)(void);
23
24#endif /* _ASM_S390_RESET_H */ 21#endif /* _ASM_S390_RESET_H */
diff --git a/include/asm-s390/sclp.h b/include/asm-s390/sclp.h
new file mode 100644
index 000000000000..468b97018405
--- /dev/null
+++ b/include/asm-s390/sclp.h
@@ -0,0 +1,39 @@
1/*
2 * include/asm-s390/sclp.h
3 *
4 * Copyright IBM Corp. 2007
5 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
6 */
7
8#ifndef _ASM_S390_SCLP_H
9#define _ASM_S390_SCLP_H
10
11#include <linux/types.h>
12
13struct sccb_header {
14 u16 length;
15 u8 function_code;
16 u8 control_mask[3];
17 u16 response_code;
18} __attribute__((packed));
19
20#define LOADPARM_LEN 8
21
22struct sclp_readinfo_sccb {
23 struct sccb_header header; /* 0-7 */
24 u16 rnmax; /* 8-9 */
25 u8 rnsize; /* 10 */
26 u8 _reserved0[24 - 11]; /* 11-23 */
27 u8 loadparm[LOADPARM_LEN]; /* 24-31 */
28 u8 _reserved1[91 - 32]; /* 32-90 */
29 u8 flags; /* 91 */
30 u8 _reserved2[100 - 92]; /* 92-99 */
31 u32 rnsize2; /* 100-103 */
32 u64 rnmax2; /* 104-111 */
33 u8 _reserved3[4096 - 112]; /* 112-4095 */
34} __attribute__((packed, aligned(4096)));
35
36extern struct sclp_readinfo_sccb s390_readinfo_sccb;
37extern void sclp_readinfo_early(void);
38
39#endif /* _ASM_S390_SCLP_H */
diff --git a/include/asm-s390/sections.h b/include/asm-s390/sections.h
index 3a0b8ffeab7a..1c5a2c4ccdad 100644
--- a/include/asm-s390/sections.h
+++ b/include/asm-s390/sections.h
@@ -3,4 +3,6 @@
3 3
4#include <asm-generic/sections.h> 4#include <asm-generic/sections.h>
5 5
6extern char _eshared[];
7
6#endif 8#endif
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h
index 9574fe80a046..3388bb52597c 100644
--- a/include/asm-s390/setup.h
+++ b/include/asm-s390/setup.h
@@ -42,6 +42,18 @@ struct mem_chunk {
42 42
43extern struct mem_chunk memory_chunk[]; 43extern struct mem_chunk memory_chunk[];
44 44
45#ifdef CONFIG_S390_SWITCH_AMODE
46extern unsigned int switch_amode;
47#else
48#define switch_amode (0)
49#endif
50
51#ifdef CONFIG_S390_EXEC_PROTECT
52extern unsigned int s390_noexec;
53#else
54#define s390_noexec (0)
55#endif
56
45/* 57/*
46 * Machine features detected in head.S 58 * Machine features detected in head.S
47 */ 59 */
@@ -74,6 +86,9 @@ extern unsigned int console_mode;
74extern unsigned int console_devno; 86extern unsigned int console_devno;
75extern unsigned int console_irq; 87extern unsigned int console_irq;
76 88
89extern char vmhalt_cmd[];
90extern char vmpoff_cmd[];
91
77#define CONSOLE_IS_UNDEFINED (console_mode == 0) 92#define CONSOLE_IS_UNDEFINED (console_mode == 0)
78#define CONSOLE_IS_SCLP (console_mode == 1) 93#define CONSOLE_IS_SCLP (console_mode == 1)
79#define CONSOLE_IS_3215 (console_mode == 2) 94#define CONSOLE_IS_3215 (console_mode == 2)
@@ -141,13 +156,19 @@ struct ipl_parameter_block {
141extern u32 ipl_flags; 156extern u32 ipl_flags;
142extern u16 ipl_devno; 157extern u16 ipl_devno;
143 158
144void do_reipl(void); 159extern void do_reipl(void);
160extern void ipl_save_parameters(void);
145 161
146enum { 162enum {
147 IPL_DEVNO_VALID = 1, 163 IPL_DEVNO_VALID = 1,
148 IPL_PARMBLOCK_VALID = 2, 164 IPL_PARMBLOCK_VALID = 2,
165 IPL_NSS_VALID = 4,
149}; 166};
150 167
168#define NSS_NAME_SIZE 8
169
170extern char kernel_nss_name[];
171
151#define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \ 172#define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \
152 IPL_PARMBLOCK_ORIGIN) 173 IPL_PARMBLOCK_ORIGIN)
153#define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len) 174#define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len)
diff --git a/include/asm-s390/sfp-util.h b/include/asm-s390/sfp-util.h
new file mode 100644
index 000000000000..8cabcd23d976
--- /dev/null
+++ b/include/asm-s390/sfp-util.h
@@ -0,0 +1,66 @@
1#include <linux/kernel.h>
2#include <linux/sched.h>
3#include <linux/types.h>
4#include <asm/byteorder.h>
5
6#define add_ssaaaa(sh, sl, ah, al, bh, bl) ({ \
7 unsigned int __sh = (ah); \
8 unsigned int __sl = (al); \
9 asm volatile( \
10 " alr %1,%3\n" \
11 " brc 12,0f\n" \
12 " ahi %0,1\n" \
13 "0: alr %0,%2" \
14 : "+&d" (__sh), "+d" (__sl) \
15 : "d" (bh), "d" (bl) : "cc"); \
16 (sh) = __sh; \
17 (sl) = __sl; \
18})
19
20#define sub_ddmmss(sh, sl, ah, al, bh, bl) ({ \
21 unsigned int __sh = (ah); \
22 unsigned int __sl = (al); \
23 asm volatile( \
24 " slr %1,%3\n" \
25 " brc 3,0f\n" \
26 " ahi %0,-1\n" \
27 "0: slr %0,%2" \
28 : "+&d" (__sh), "+d" (__sl) \
29 : "d" (bh), "d" (bl) : "cc"); \
30 (sh) = __sh; \
31 (sl) = __sl; \
32})
33
34/* a umul b = a mul b + (a>=2<<31) ? b<<32:0 + (b>=2<<31) ? a<<32:0 */
35#define umul_ppmm(wh, wl, u, v) ({ \
36 unsigned int __wh = u; \
37 unsigned int __wl = v; \
38 asm volatile( \
39 " ltr 1,%0\n" \
40 " mr 0,%1\n" \
41 " jnm 0f\n" \
42 " alr 0,%1\n" \
43 "0: ltr %1,%1\n" \
44 " jnm 1f\n" \
45 " alr 0,%0\n" \
46 "1: lr %0,0\n" \
47 " lr %1,1\n" \
48 : "+d" (__wh), "+d" (__wl) \
49 : : "0", "1", "cc"); \
50 wh = __wh; \
51 wl = __wl; \
52})
53
54#define udiv_qrnnd(q, r, n1, n0, d) \
55 do { unsigned int __r; \
56 (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
57 (r) = __r; \
58 } while (0)
59extern unsigned long __udiv_qrnnd (unsigned int *, unsigned int,
60 unsigned int , unsigned int);
61
62#define UDIV_NEEDS_NORMALIZATION 0
63
64#define abort() return 0
65
66#define __BYTE_ORDER __BIG_ENDIAN
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h
index 7097c96ed026..b957e4cda464 100644
--- a/include/asm-s390/smp.h
+++ b/include/asm-s390/smp.h
@@ -31,6 +31,10 @@ typedef struct
31 __u16 cpu; 31 __u16 cpu;
32} sigp_info; 32} sigp_info;
33 33
34extern void machine_restart_smp(char *);
35extern void machine_halt_smp(void);
36extern void machine_power_off_smp(void);
37
34extern void smp_setup_cpu_possible_map(void); 38extern void smp_setup_cpu_possible_map(void);
35extern int smp_call_function_on(void (*func) (void *info), void *info, 39extern int smp_call_function_on(void (*func) (void *info), void *info,
36 int nonatomic, int wait, int cpu); 40 int nonatomic, int wait, int cpu);
@@ -106,7 +110,7 @@ smp_call_function_on(void (*func) (void *info), void *info,
106static inline void smp_send_stop(void) 110static inline void smp_send_stop(void)
107{ 111{
108 /* Disable all interrupts/machine checks */ 112 /* Disable all interrupts/machine checks */
109 __load_psw_mask(PSW_KERNEL_BITS & ~PSW_MASK_MCHECK); 113 __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK);
110} 114}
111 115
112#define smp_cpu_not_running(cpu) 1 116#define smp_cpu_not_running(cpu) 1
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index bd0b05ae87d2..bbe137c3ed69 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -373,8 +373,8 @@ __set_psw_mask(unsigned long mask)
373 __load_psw_mask(mask | (__raw_local_irq_stosm(0x00) & ~(-1UL >> 8))); 373 __load_psw_mask(mask | (__raw_local_irq_stosm(0x00) & ~(-1UL >> 8)));
374} 374}
375 375
376#define local_mcck_enable() __set_psw_mask(PSW_KERNEL_BITS) 376#define local_mcck_enable() __set_psw_mask(psw_kernel_bits)
377#define local_mcck_disable() __set_psw_mask(PSW_KERNEL_BITS & ~PSW_MASK_MCHECK) 377#define local_mcck_disable() __set_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK)
378 378
379#ifdef CONFIG_SMP 379#ifdef CONFIG_SMP
380 380
diff --git a/include/asm-s390/tape390.h b/include/asm-s390/tape390.h
index f1d66ba0deef..884fba48f1ff 100644
--- a/include/asm-s390/tape390.h
+++ b/include/asm-s390/tape390.h
@@ -1,11 +1,11 @@
1/************************************************************************* 1/*************************************************************************
2 * 2 *
3 * tape390.h 3 * tape390.h
4 * enables user programs to display messages on the tape device 4 * enables user programs to display messages and control encryption
5 * on s390 tape devices
5 * 6 *
6 * S390 and zSeries version 7 * Copyright IBM Corp. 2001,2006
7 * Copyright (C) 2001 IBM Corporation 8 * Author(s): Michael Holzheu <holzheu@de.ibm.com>
8 * Author(s): Despina Papadopoulou <despina_p@de.ibm.com>
9 * 9 *
10 *************************************************************************/ 10 *************************************************************************/
11 11
@@ -36,4 +36,68 @@ typedef struct display_struct {
36 char message2[8]; 36 char message2[8];
37} display_struct; 37} display_struct;
38 38
39/*
40 * Tape encryption support
41 */
42
43struct tape390_crypt_info {
44 char capability;
45 char status;
46 char medium_status;
47} __attribute__ ((packed));
48
49
50/* Macros for "capable" field */
51#define TAPE390_CRYPT_SUPPORTED_MASK 0x01
52#define TAPE390_CRYPT_SUPPORTED(x) \
53 ((x.capability & TAPE390_CRYPT_SUPPORTED_MASK))
54
55/* Macros for "status" field */
56#define TAPE390_CRYPT_ON_MASK 0x01
57#define TAPE390_CRYPT_ON(x) (((x.status) & TAPE390_CRYPT_ON_MASK))
58
59/* Macros for "medium status" field */
60#define TAPE390_MEDIUM_LOADED_MASK 0x01
61#define TAPE390_MEDIUM_ENCRYPTED_MASK 0x02
62#define TAPE390_MEDIUM_ENCRYPTED(x) \
63 (((x.medium_status) & TAPE390_MEDIUM_ENCRYPTED_MASK))
64#define TAPE390_MEDIUM_LOADED(x) \
65 (((x.medium_status) & TAPE390_MEDIUM_LOADED_MASK))
66
67/*
68 * The TAPE390_CRYPT_SET ioctl is used to switch on/off encryption.
69 * The "encryption_capable" and "tape_status" fields are ignored for this ioctl!
70 */
71#define TAPE390_CRYPT_SET _IOW('d', 2, struct tape390_crypt_info)
72
73/*
74 * The TAPE390_CRYPT_QUERY ioctl is used to query the encryption state.
75 */
76#define TAPE390_CRYPT_QUERY _IOR('d', 3, struct tape390_crypt_info)
77
78/* Values for "kekl1/2_type" and "kekl1/2_type_on_tape" fields */
79#define TAPE390_KEKL_TYPE_NONE 0
80#define TAPE390_KEKL_TYPE_LABEL 1
81#define TAPE390_KEKL_TYPE_HASH 2
82
83struct tape390_kekl {
84 unsigned char type;
85 unsigned char type_on_tape;
86 char label[65];
87} __attribute__ ((packed));
88
89struct tape390_kekl_pair {
90 struct tape390_kekl kekl[2];
91} __attribute__ ((packed));
92
93/*
94 * The TAPE390_KEKL_SET ioctl is used to set Key Encrypting Key labels.
95 */
96#define TAPE390_KEKL_SET _IOW('d', 4, struct tape390_kekl_pair)
97
98/*
99 * The TAPE390_KEKL_QUERY ioctl is used to query Key Encrypting Key labels.
100 */
101#define TAPE390_KEKL_QUERY _IOR('d', 5, struct tape390_kekl_pair)
102
39#endif 103#endif
diff --git a/include/asm-s390/termios.h b/include/asm-s390/termios.h
index 62b23caf370e..a3480e25eb4b 100644
--- a/include/asm-s390/termios.h
+++ b/include/asm-s390/termios.h
@@ -47,24 +47,6 @@ struct termio {
47 47
48/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 48/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
49 49
50/* line disciplines */
51#define N_TTY 0
52#define N_SLIP 1
53#define N_MOUSE 2
54#define N_PPP 3
55#define N_STRIP 4
56#define N_AX25 5
57#define N_X25 6 /* X.25 async */
58#define N_6PACK 7
59#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
60#define N_R3964 9 /* Reserved for Simatic R3964 module */
61#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
62#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
63#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
64#define N_HDLC 13 /* synchronous HDLC */
65#define N_SYNC_PPP 14 /* synchronous PPP */
66#define N_HCI 15 /* Bluetooth HCI UART */
67
68#ifdef __KERNEL__ 50#ifdef __KERNEL__
69 51
70/* intr=^C quit=^\ erase=del kill=^U 52/* intr=^C quit=^\ erase=del kill=^U
diff --git a/include/asm-s390/timer.h b/include/asm-s390/timer.h
index 30e5cbe570f2..adb34860a543 100644
--- a/include/asm-s390/timer.h
+++ b/include/asm-s390/timer.h
@@ -45,6 +45,9 @@ extern void add_virt_timer_periodic(void *new);
45extern int mod_virt_timer(struct vtimer_list *timer, __u64 expires); 45extern int mod_virt_timer(struct vtimer_list *timer, __u64 expires);
46extern int del_virt_timer(struct vtimer_list *timer); 46extern int del_virt_timer(struct vtimer_list *timer);
47 47
48extern void init_cpu_vtimer(void);
49extern void vtime_init(void);
50
48#endif /* __KERNEL__ */ 51#endif /* __KERNEL__ */
49 52
50#endif /* _ASM_S390_TIMER_H */ 53#endif /* _ASM_S390_TIMER_H */
diff --git a/include/asm-s390/timex.h b/include/asm-s390/timex.h
index 4df4a41029a3..98229db24314 100644
--- a/include/asm-s390/timex.h
+++ b/include/asm-s390/timex.h
@@ -11,6 +11,41 @@
11#ifndef _ASM_S390_TIMEX_H 11#ifndef _ASM_S390_TIMEX_H
12#define _ASM_S390_TIMEX_H 12#define _ASM_S390_TIMEX_H
13 13
14/* Inline functions for clock register access. */
15static inline int set_clock(__u64 time)
16{
17 int cc;
18
19 asm volatile(
20 " sck 0(%2)\n"
21 " ipm %0\n"
22 " srl %0,28\n"
23 : "=d" (cc) : "m" (time), "a" (&time) : "cc");
24 return cc;
25}
26
27static inline int store_clock(__u64 *time)
28{
29 int cc;
30
31 asm volatile(
32 " stck 0(%2)\n"
33 " ipm %0\n"
34 " srl %0,28\n"
35 : "=d" (cc), "=m" (*time) : "a" (time) : "cc");
36 return cc;
37}
38
39static inline void set_clock_comparator(__u64 time)
40{
41 asm volatile("sckc 0(%1)" : : "m" (time), "a" (&time));
42}
43
44static inline void store_clock_comparator(__u64 *time)
45{
46 asm volatile("stckc 0(%1)" : "=m" (*time) : "a" (time));
47}
48
14#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ 49#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
15 50
16typedef unsigned long long cycles_t; 51typedef unsigned long long cycles_t;
@@ -27,9 +62,24 @@ static inline unsigned long long get_clock (void)
27 return clk; 62 return clk;
28} 63}
29 64
65static inline void get_clock_extended(void *dest)
66{
67 typedef struct { unsigned long long clk[2]; } __clock_t;
68
69#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
70 asm volatile("stcke %0" : "=Q" (*((__clock_t *)dest)) : : "cc");
71#else /* __GNUC__ */
72 asm volatile("stcke 0(%1)" : "=m" (*((__clock_t *)dest))
73 : "a" ((__clock_t *)dest) : "cc");
74#endif /* __GNUC__ */
75}
76
30static inline cycles_t get_cycles(void) 77static inline cycles_t get_cycles(void)
31{ 78{
32 return (cycles_t) get_clock() >> 2; 79 return (cycles_t) get_clock() >> 2;
33} 80}
34 81
82int get_sync_clock(unsigned long long *clock);
83void init_cpu_timer(void);
84
35#endif 85#endif
diff --git a/include/asm-s390/tlbflush.h b/include/asm-s390/tlbflush.h
index fa4dc916a9bf..66793f55c8b2 100644
--- a/include/asm-s390/tlbflush.h
+++ b/include/asm-s390/tlbflush.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5#include <asm/processor.h> 5#include <asm/processor.h>
6#include <asm/pgalloc.h>
6 7
7/* 8/*
8 * TLB flushing: 9 * TLB flushing:
@@ -102,6 +103,14 @@ static inline void __flush_tlb_mm(struct mm_struct * mm)
102 if (unlikely(cpus_empty(mm->cpu_vm_mask))) 103 if (unlikely(cpus_empty(mm->cpu_vm_mask)))
103 return; 104 return;
104 if (MACHINE_HAS_IDTE) { 105 if (MACHINE_HAS_IDTE) {
106 pgd_t *shadow_pgd = get_shadow_pgd(mm->pgd);
107
108 if (shadow_pgd) {
109 asm volatile(
110 " .insn rrf,0xb98e0000,0,%0,%1,0"
111 : : "a" (2048),
112 "a" (__pa(shadow_pgd) & PAGE_MASK) : "cc" );
113 }
105 asm volatile( 114 asm volatile(
106 " .insn rrf,0xb98e0000,0,%0,%1,0" 115 " .insn rrf,0xb98e0000,0,%0,%1,0"
107 : : "a" (2048), "a" (__pa(mm->pgd)&PAGE_MASK) : "cc"); 116 : : "a" (2048), "a" (__pa(mm->pgd)&PAGE_MASK) : "cc");
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h
index 73ac4e82217b..0235970278f0 100644
--- a/include/asm-s390/uaccess.h
+++ b/include/asm-s390/uaccess.h
@@ -90,6 +90,8 @@ struct uaccess_ops {
90extern struct uaccess_ops uaccess; 90extern struct uaccess_ops uaccess;
91extern struct uaccess_ops uaccess_std; 91extern struct uaccess_ops uaccess_std;
92extern struct uaccess_ops uaccess_mvcos; 92extern struct uaccess_ops uaccess_mvcos;
93extern struct uaccess_ops uaccess_mvcos_switch;
94extern struct uaccess_ops uaccess_pt;
93 95
94static inline int __put_user_fn(size_t size, void __user *ptr, void *x) 96static inline int __put_user_fn(size_t size, void __user *ptr, void *x)
95{ 97{
diff --git a/include/asm-sh/apm.h b/include/asm-sh/apm.h
deleted file mode 100644
index 8b091e93651f..000000000000
--- a/include/asm-sh/apm.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * Copyright 2006 (c) Andriy Skulysh <askulysh@gmail.com>
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 */
9
10#ifndef __ASM_SH_APM_H
11#define __ASM_SH_APM_H
12
13#define APM_AC_OFFLINE 0
14#define APM_AC_ONLINE 1
15#define APM_AC_BACKUP 2
16#define APM_AC_UNKNOWN 0xff
17
18#define APM_BATTERY_STATUS_HIGH 0
19#define APM_BATTERY_STATUS_LOW 1
20#define APM_BATTERY_STATUS_CRITICAL 2
21#define APM_BATTERY_STATUS_CHARGING 3
22#define APM_BATTERY_STATUS_NOT_PRESENT 4
23#define APM_BATTERY_STATUS_UNKNOWN 0xff
24
25#define APM_BATTERY_LIFE_UNKNOWN 0xFFFF
26#define APM_BATTERY_LIFE_MINUTES 0x8000
27#define APM_BATTERY_LIFE_VALUE_MASK 0x7FFF
28
29#define APM_BATTERY_FLAG_HIGH (1 << 0)
30#define APM_BATTERY_FLAG_LOW (1 << 1)
31#define APM_BATTERY_FLAG_CRITICAL (1 << 2)
32#define APM_BATTERY_FLAG_CHARGING (1 << 3)
33#define APM_BATTERY_FLAG_NOT_PRESENT (1 << 7)
34#define APM_BATTERY_FLAG_UNKNOWN 0xff
35
36#define APM_UNITS_MINS 0
37#define APM_UNITS_SECS 1
38#define APM_UNITS_UNKNOWN -1
39
40
41extern int (*apm_get_info)(char *buf, char **start, off_t fpos, int length);
42extern int apm_suspended;
43
44void apm_queue_event(apm_event_t event);
45
46#endif
diff --git a/include/asm-sh/termios.h b/include/asm-sh/termios.h
index 44edfd471443..e7c8f86ef890 100644
--- a/include/asm-sh/termios.h
+++ b/include/asm-sh/termios.h
@@ -39,24 +39,6 @@ struct termio {
39 39
40/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 40/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
41 41
42/* line disciplines */
43#define N_TTY 0
44#define N_SLIP 1
45#define N_MOUSE 2
46#define N_PPP 3
47#define N_STRIP 4
48#define N_AX25 5
49#define N_X25 6 /* X.25 async */
50#define N_6PACK 7
51#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
52#define N_R3964 9 /* Reserved for Simatic R3964 module */
53#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
54#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
55#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
56#define N_HDLC 13 /* synchronous HDLC */
57#define N_SYNC_PPP 14
58#define N_HCI 15 /* Bluetooth HCI UART */
59
60#ifdef __KERNEL__ 42#ifdef __KERNEL__
61 43
62/* intr=^C quit=^\ erase=del kill=^U 44/* intr=^C quit=^\ erase=del kill=^U
diff --git a/include/asm-sh64/termios.h b/include/asm-sh64/termios.h
index 4a9c7fb411bc..dc44e6ed3a7c 100644
--- a/include/asm-sh64/termios.h
+++ b/include/asm-sh64/termios.h
@@ -50,24 +50,6 @@ struct termio {
50 50
51/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 51/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
52 52
53/* line disciplines */
54#define N_TTY 0
55#define N_SLIP 1
56#define N_MOUSE 2
57#define N_PPP 3
58#define N_STRIP 4
59#define N_AX25 5
60#define N_X25 6 /* X.25 async */
61#define N_6PACK 7
62#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
63#define N_R3964 9 /* Reserved for Simatic R3964 module */
64#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
65#define N_IRDA 11 /* Linux IR - http://www.cs.uit.no/~dagb/irda/irda.html */
66#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
67#define N_HDLC 13 /* synchronous HDLC */
68#define N_SYNC_PPP 14
69#define N_HCI 15 /* Bluetooth HCI UART */
70
71#ifdef __KERNEL__ 53#ifdef __KERNEL__
72 54
73/* intr=^C quit=^\ erase=del kill=^U 55/* intr=^C quit=^\ erase=del kill=^U
diff --git a/include/asm-sparc/io.h b/include/asm-sparc/io.h
index cab0b851b8b1..c23e74a0eaa8 100644
--- a/include/asm-sparc/io.h
+++ b/include/asm-sparc/io.h
@@ -256,6 +256,35 @@ extern void iounmap(volatile void __iomem *addr);
256#define iowrite16(val,X) writew(val,X) 256#define iowrite16(val,X) writew(val,X)
257#define iowrite32(val,X) writel(val,X) 257#define iowrite32(val,X) writel(val,X)
258 258
259static inline void ioread8_rep(void __iomem *port, void *buf, unsigned long count)
260{
261 insb((unsigned long __force)port, buf, count);
262}
263static inline void ioread16_rep(void __iomem *port, void *buf, unsigned long count)
264{
265 insw((unsigned long __force)port, buf, count);
266}
267
268static inline void ioread32_rep(void __iomem *port, void *buf, unsigned long count)
269{
270 insl((unsigned long __force)port, buf, count);
271}
272
273static inline void iowrite8_rep(void __iomem *port, const void *buf, unsigned long count)
274{
275 outsb((unsigned long __force)port, buf, count);
276}
277
278static inline void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count)
279{
280 outsw((unsigned long __force)port, buf, count);
281}
282
283static inline void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count)
284{
285 outsl((unsigned long __force)port, buf, count);
286}
287
259/* Create a virtual mapping cookie for an IO port range */ 288/* Create a virtual mapping cookie for an IO port range */
260extern void __iomem *ioport_map(unsigned long port, unsigned int nr); 289extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
261extern void ioport_unmap(void __iomem *); 290extern void ioport_unmap(void __iomem *);
diff --git a/include/asm-sparc/termios.h b/include/asm-sparc/termios.h
index d05f83c80989..d767f206ab33 100644
--- a/include/asm-sparc/termios.h
+++ b/include/asm-sparc/termios.h
@@ -45,24 +45,6 @@ struct winsize {
45 unsigned short ws_ypixel; 45 unsigned short ws_ypixel;
46}; 46};
47 47
48/* line disciplines */
49#define N_TTY 0
50#define N_SLIP 1
51#define N_MOUSE 2
52#define N_PPP 3
53#define N_STRIP 4
54#define N_AX25 5
55#define N_X25 6
56#define N_6PACK 7
57#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
58#define N_R3964 9 /* Reserved for Simatic R3964 module */
59#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
60#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
61#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
62#define N_HDLC 13 /* synchronous HDLC */
63#define N_SYNC_PPP 14 /* synchronous PPP */
64#define N_HCI 15 /* Bluetooth HCI UART */
65
66#ifdef __KERNEL__ 48#ifdef __KERNEL__
67#include <linux/module.h> 49#include <linux/module.h>
68 50
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
index 905e59b4a737..5d233b42fe13 100644
--- a/include/asm-sparc64/irq.h
+++ b/include/asm-sparc64/irq.h
@@ -46,6 +46,10 @@ extern void irq_install_pre_handler(int virt_irq,
46#define irq_canonicalize(irq) (irq) 46#define irq_canonicalize(irq) (irq)
47extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap); 47extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap);
48extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino); 48extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino);
49extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p,
50 unsigned int msi_devino_start,
51 unsigned int msi_devino_end);
52extern void sun4v_destroy_msi(unsigned int virt_irq);
49extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); 53extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
50 54
51static __inline__ void set_softint(unsigned long bits) 55static __inline__ void set_softint(unsigned long bits)
diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h
index dcfa7629358c..7a246d8a1828 100644
--- a/include/asm-sparc64/pbm.h
+++ b/include/asm-sparc64/pbm.h
@@ -11,6 +11,7 @@
11#include <linux/pci.h> 11#include <linux/pci.h>
12#include <linux/ioport.h> 12#include <linux/ioport.h>
13#include <linux/spinlock.h> 13#include <linux/spinlock.h>
14#include <linux/msi.h>
14 15
15#include <asm/io.h> 16#include <asm/io.h>
16#include <asm/page.h> 17#include <asm/page.h>
@@ -177,6 +178,24 @@ struct pci_pbm_info {
177 int is_66mhz_capable; 178 int is_66mhz_capable;
178 int all_devs_66mhz; 179 int all_devs_66mhz;
179 180
181#ifdef CONFIG_PCI_MSI
182 /* MSI info. */
183 u32 msiq_num;
184 u32 msiq_ent_count;
185 u32 msiq_first;
186 u32 msiq_first_devino;
187 u32 msi_num;
188 u32 msi_first;
189 u32 msi_data_mask;
190 u32 msix_data_width;
191 u64 msi32_start;
192 u64 msi64_start;
193 u32 msi32_len;
194 u32 msi64_len;
195 void *msi_queues;
196 unsigned long *msi_bitmap;
197#endif /* !(CONFIG_PCI_MSI) */
198
180 /* This PBM's streaming buffer. */ 199 /* This PBM's streaming buffer. */
181 struct pci_strbuf stc; 200 struct pci_strbuf stc;
182 201
@@ -213,6 +232,12 @@ struct pci_controller_info {
213 void (*base_address_update)(struct pci_dev *, int); 232 void (*base_address_update)(struct pci_dev *, int);
214 void (*resource_adjust)(struct pci_dev *, struct resource *, struct resource *); 233 void (*resource_adjust)(struct pci_dev *, struct resource *, struct resource *);
215 234
235#ifdef CONFIG_PCI_MSI
236 int (*setup_msi_irq)(unsigned int *virt_irq_p, struct pci_dev *pdev,
237 struct msi_desc *entry);
238 void (*teardown_msi_irq)(unsigned int virt_irq, struct pci_dev *pdev);
239#endif
240
216 /* Now things for the actual PCI bus probes. */ 241 /* Now things for the actual PCI bus probes. */
217 struct pci_ops *pci_ops; 242 struct pci_ops *pci_ops;
218 unsigned int pci_first_busno; 243 unsigned int pci_first_busno;
@@ -231,6 +256,9 @@ struct pcidev_cookie {
231 int num_prom_regs; 256 int num_prom_regs;
232 struct linux_prom_pci_registers prom_assignments[PROMREG_MAX]; 257 struct linux_prom_pci_registers prom_assignments[PROMREG_MAX];
233 int num_prom_assignments; 258 int num_prom_assignments;
259#ifdef CONFIG_PCI_MSI
260 unsigned int msi_num;
261#endif
234}; 262};
235 263
236/* Currently these are the same across all PCI controllers 264/* Currently these are the same across all PCI controllers
diff --git a/include/asm-sparc64/setup.h b/include/asm-sparc64/setup.h
index b356ee2cda92..5053df3cec40 100644
--- a/include/asm-sparc64/setup.h
+++ b/include/asm-sparc64/setup.h
@@ -5,6 +5,6 @@
5#ifndef _SPARC64_SETUP_H 5#ifndef _SPARC64_SETUP_H
6#define _SPARC64_SETUP_H 6#define _SPARC64_SETUP_H
7 7
8#define COMMAND_LINE_SIZE 256 8#define COMMAND_LINE_SIZE 2048
9 9
10#endif /* _SPARC64_SETUP_H */ 10#endif /* _SPARC64_SETUP_H */
diff --git a/include/asm-sparc64/termios.h b/include/asm-sparc64/termios.h
index ee26a071c677..f05d390993d5 100644
--- a/include/asm-sparc64/termios.h
+++ b/include/asm-sparc64/termios.h
@@ -45,24 +45,6 @@ struct winsize {
45 unsigned short ws_ypixel; 45 unsigned short ws_ypixel;
46}; 46};
47 47
48/* line disciplines */
49#define N_TTY 0
50#define N_SLIP 1
51#define N_MOUSE 2
52#define N_PPP 3
53#define N_STRIP 4
54#define N_AX25 5
55#define N_X25 6
56#define N_6PACK 7
57#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
58#define N_R3964 9 /* Reserved for Simatic R3964 module */
59#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
60#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
61#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
62#define N_HDLC 13 /* synchronous HDLC */
63#define N_SYNC_PPP 14 /* synchronous PPP */
64#define N_HCI 15 /* Bluetooth HCI UART */
65
66#ifdef __KERNEL__ 48#ifdef __KERNEL__
67#include <linux/module.h> 49#include <linux/module.h>
68 50
diff --git a/include/asm-um/elf-ppc.h b/include/asm-um/elf-ppc.h
index 99711134e477..d3b90b7ac3e9 100644
--- a/include/asm-um/elf-ppc.h
+++ b/include/asm-um/elf-ppc.h
@@ -11,7 +11,7 @@ extern long elf_aux_hwcap;
11 11
12#define elf_check_arch(x) (1) 12#define elf_check_arch(x) (1)
13 13
14#ifdef CONFIG_64_BIT 14#ifdef CONFIG_64BIT
15#define ELF_CLASS ELFCLASS64 15#define ELF_CLASS ELFCLASS64
16#else 16#else
17#define ELF_CLASS ELFCLASS32 17#define ELF_CLASS ELFCLASS32
diff --git a/include/asm-um/processor-x86_64.h b/include/asm-um/processor-x86_64.h
index 10609af376c0..31c2d4d685bd 100644
--- a/include/asm-um/processor-x86_64.h
+++ b/include/asm-um/processor-x86_64.h
@@ -13,6 +13,7 @@
13struct arch_thread { 13struct arch_thread {
14 unsigned long debugregs[8]; 14 unsigned long debugregs[8];
15 int debugregs_seq; 15 int debugregs_seq;
16 unsigned long fs;
16 struct faultinfo faultinfo; 17 struct faultinfo faultinfo;
17}; 18};
18 19
@@ -25,8 +26,9 @@ extern inline void rep_nop(void)
25#define cpu_relax() rep_nop() 26#define cpu_relax() rep_nop()
26 27
27#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \ 28#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
28 .debugregs_seq = 0, \ 29 .debugregs_seq = 0, \
29 .faultinfo = { 0, 0, 0 } } 30 .fs = 0, \
31 .faultinfo = { 0, 0, 0 } }
30 32
31static inline void arch_flush_thread(struct arch_thread *thread) 33static inline void arch_flush_thread(struct arch_thread *thread)
32{ 34{
diff --git a/include/asm-um/ptrace-x86_64.h b/include/asm-um/ptrace-x86_64.h
index 03b4af4ac09a..bf61d17de3f7 100644
--- a/include/asm-um/ptrace-x86_64.h
+++ b/include/asm-um/ptrace-x86_64.h
@@ -81,9 +81,10 @@ static inline void arch_switch_to_tt(struct task_struct *from,
81{ 81{
82} 82}
83 83
84static inline void arch_switch_to_skas(struct task_struct *from, 84extern void arch_switch_to_skas(struct task_struct *from,
85 struct task_struct *to) 85 struct task_struct *to);
86{ 86
87} 87extern long arch_prctl_skas(struct task_struct *task, int code,
88 unsigned long __user *addr);
88 89
89#endif 90#endif
diff --git a/include/asm-v850/termios.h b/include/asm-v850/termios.h
index 79e97b59806e..c2c2b1d58776 100644
--- a/include/asm-v850/termios.h
+++ b/include/asm-v850/termios.h
@@ -39,24 +39,6 @@ struct termio {
39 39
40/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 40/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
41 41
42/* line disciplines */
43#define N_TTY 0
44#define N_SLIP 1
45#define N_MOUSE 2
46#define N_PPP 3
47#define N_STRIP 4
48#define N_AX25 5
49#define N_X25 6 /* X.25 async */
50#define N_6PACK 7
51#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
52#define N_R3964 9 /* Reserved for Simatic R3964 module */
53#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
54#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
55#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
56#define N_HDLC 13 /* synchronous HDLC */
57#define N_SYNC_PPP 14 /* synchronous PPP */
58#define N_HCI 15 /* Bluetooth HCI UART */
59
60#ifdef __KERNEL__ 42#ifdef __KERNEL__
61 43
62/* intr=^C quit=^\ erase=del kill=^U 44/* intr=^C quit=^\ erase=del kill=^U
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index 6b6fc6f8be7e..a29f05087a31 100644
--- a/include/asm-x86_64/acpi.h
+++ b/include/asm-x86_64/acpi.h
@@ -37,7 +37,7 @@
37 * Calling conventions: 37 * Calling conventions:
38 * 38 *
39 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) 39 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
40 * ACPI_EXTERNAL_XFACE - External ACPI interfaces 40 * ACPI_EXTERNAL_XFACE - External ACPI interfaces
41 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces 41 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
42 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces 42 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
43 */ 43 */
@@ -57,11 +57,11 @@
57int __acpi_acquire_global_lock(unsigned int *lock); 57int __acpi_acquire_global_lock(unsigned int *lock);
58int __acpi_release_global_lock(unsigned int *lock); 58int __acpi_release_global_lock(unsigned int *lock);
59 59
60#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ 60#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
61 ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr)) 61 ((Acq) = __acpi_acquire_global_lock(&facs->global_lock))
62 62
63#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ 63#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
64 ((Acq) = __acpi_release_global_lock((unsigned int *) GLptr)) 64 ((Acq) = __acpi_release_global_lock(&facs->global_lock))
65 65
66/* 66/*
67 * Math helper asm macros 67 * Math helper asm macros
@@ -87,10 +87,10 @@ extern int acpi_strict;
87extern int acpi_disabled; 87extern int acpi_disabled;
88extern int acpi_pci_disabled; 88extern int acpi_pci_disabled;
89extern int acpi_ht; 89extern int acpi_ht;
90static inline void disable_acpi(void) 90static inline void disable_acpi(void)
91{ 91{
92 acpi_disabled = 1; 92 acpi_disabled = 1;
93 acpi_ht = 0; 93 acpi_ht = 0;
94 acpi_pci_disabled = 1; 94 acpi_pci_disabled = 1;
95 acpi_noirq = 1; 95 acpi_noirq = 1;
96} 96}
@@ -100,9 +100,9 @@ static inline void disable_acpi(void)
100 100
101extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq); 101extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
102static inline void acpi_noirq_set(void) { acpi_noirq = 1; } 102static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
103static inline void acpi_disable_pci(void) 103static inline void acpi_disable_pci(void)
104{ 104{
105 acpi_pci_disabled = 1; 105 acpi_pci_disabled = 1;
106 acpi_noirq_set(); 106 acpi_noirq_set();
107} 107}
108extern int acpi_irq_balance_set(char *str); 108extern int acpi_irq_balance_set(char *str);
@@ -136,8 +136,6 @@ extern void acpi_reserve_bootmem(void);
136extern int acpi_disabled; 136extern int acpi_disabled;
137extern int acpi_pci_disabled; 137extern int acpi_pci_disabled;
138 138
139extern u8 x86_acpiid_to_apicid[];
140
141#define ARCH_HAS_POWER_INIT 1 139#define ARCH_HAS_POWER_INIT 1
142 140
143extern int acpi_skip_timer_override; 141extern int acpi_skip_timer_override;
diff --git a/include/asm-x86_64/bootsetup.h b/include/asm-x86_64/bootsetup.h
index b829f7b534be..7b1c3ad155fd 100644
--- a/include/asm-x86_64/bootsetup.h
+++ b/include/asm-x86_64/bootsetup.h
@@ -31,7 +31,7 @@ extern char x86_boot_params[BOOT_PARAM_SIZE];
31#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF)) 31#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF))
32#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF)) 32#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF))
33#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF)) 33#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF))
34#define COMMAND_LINE saved_command_line 34#define COMMAND_LINE boot_command_line
35 35
36#define RAMDISK_IMAGE_START_MASK 0x07FF 36#define RAMDISK_IMAGE_START_MASK 0x07FF
37#define RAMDISK_PROMPT_FLAG 0x8000 37#define RAMDISK_PROMPT_FLAG 0x8000
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h
index 6ee9fadaaacb..f5d84bb7c948 100644
--- a/include/asm-x86_64/io.h
+++ b/include/asm-x86_64/io.h
@@ -248,12 +248,6 @@ void memset_io(volatile void __iomem *a, int b, size_t c);
248 */ 248 */
249#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET)) 249#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET))
250 250
251/*
252 * Again, x86-64 does not require mem IO specific function.
253 */
254
255#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void *)(b),(c),(d))
256
257/* Nothing to do */ 251/* Nothing to do */
258 252
259#define dma_cache_inv(_start,_size) do { } while (0) 253#define dma_cache_inv(_start,_size) do { } while (0)
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h
index 6d324b838972..a6d2ff5c69b7 100644
--- a/include/asm-x86_64/proto.h
+++ b/include/asm-x86_64/proto.h
@@ -81,7 +81,6 @@ extern void swap_low_mappings(void);
81extern void __show_regs(struct pt_regs * regs); 81extern void __show_regs(struct pt_regs * regs);
82extern void show_regs(struct pt_regs * regs); 82extern void show_regs(struct pt_regs * regs);
83 83
84extern char *syscall32_page;
85extern void syscall32_cpu_init(void); 84extern void syscall32_cpu_init(void);
86 85
87extern void setup_node_bootmem(int nodeid, unsigned long start, unsigned long end); 86extern void setup_node_bootmem(int nodeid, unsigned long start, unsigned long end);
diff --git a/include/asm-x86_64/setup.h b/include/asm-x86_64/setup.h
index 985d4e3c79da..eaeff73d6c10 100644
--- a/include/asm-x86_64/setup.h
+++ b/include/asm-x86_64/setup.h
@@ -1,6 +1,6 @@
1#ifndef _x8664_SETUP_H 1#ifndef _x8664_SETUP_H
2#define _x8664_SETUP_H 2#define _x8664_SETUP_H
3 3
4#define COMMAND_LINE_SIZE 256 4#define COMMAND_LINE_SIZE 2048
5 5
6#endif 6#endif
diff --git a/include/asm-x86_64/swiotlb.h b/include/asm-x86_64/swiotlb.h
index ba94ab3d2673..ab913ffcad56 100644
--- a/include/asm-x86_64/swiotlb.h
+++ b/include/asm-x86_64/swiotlb.h
@@ -1,6 +1,5 @@
1#ifndef _ASM_SWIOTLB_H 1#ifndef _ASM_SWIOTLB_H
2#define _ASM_SWTIOLB_H 1 2#define _ASM_SWIOTLB_H 1
3
4 3
5#include <asm/dma-mapping.h> 4#include <asm/dma-mapping.h>
6 5
@@ -45,6 +44,7 @@ extern void swiotlb_init(void);
45extern int swiotlb_force; 44extern int swiotlb_force;
46 45
47#ifdef CONFIG_SWIOTLB 46#ifdef CONFIG_SWIOTLB
47#define SWIOTLB_ARCH_NEED_ALLOC
48extern int swiotlb; 48extern int swiotlb;
49#else 49#else
50#define swiotlb 0 50#define swiotlb 0
@@ -52,4 +52,6 @@ extern int swiotlb;
52 52
53extern void pci_swiotlb_init(void); 53extern void pci_swiotlb_init(void);
54 54
55#endif /* _ASM_SWTIOLB_H */ 55static inline void dma_mark_clean(void *addr, size_t size) {}
56
57#endif /* _ASM_SWIOTLB_H */
diff --git a/include/asm-x86_64/termios.h b/include/asm-x86_64/termios.h
index 443b225537f0..35ee59b78329 100644
--- a/include/asm-x86_64/termios.h
+++ b/include/asm-x86_64/termios.h
@@ -39,24 +39,6 @@ struct termio {
39 39
40/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 40/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
41 41
42/* line disciplines */
43#define N_TTY 0
44#define N_SLIP 1
45#define N_MOUSE 2
46#define N_PPP 3
47#define N_STRIP 4
48#define N_AX25 5
49#define N_X25 6 /* X.25 async */
50#define N_6PACK 7
51#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
52#define N_R3964 9 /* Reserved for Simatic R3964 module */
53#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
54#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
55#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
56#define N_HDLC 13 /* synchronous HDLC */
57#define N_SYNC_PPP 14 /* synchronous PPP */
58#define N_HCI 15 /* Bluetooth HCI UART */
59
60#ifdef __KERNEL__ 42#ifdef __KERNEL__
61 43
62/* intr=^C quit=^\ erase=del kill=^U 44/* intr=^C quit=^\ erase=del kill=^U
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index c0eac519840b..8079e29c14fd 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -37,11 +37,11 @@
37 * Uhhuh, this needs 65-bit arithmetic. We have a carry.. 37 * Uhhuh, this needs 65-bit arithmetic. We have a carry..
38 */ 38 */
39#define __range_not_ok(addr,size) ({ \ 39#define __range_not_ok(addr,size) ({ \
40 unsigned long flag,sum; \ 40 unsigned long flag,roksum; \
41 __chk_user_ptr(addr); \ 41 __chk_user_ptr(addr); \
42 asm("# range_ok\n\r" \ 42 asm("# range_ok\n\r" \
43 "addq %3,%1 ; sbbq %0,%0 ; cmpq %1,%4 ; sbbq $0,%0" \ 43 "addq %3,%1 ; sbbq %0,%0 ; cmpq %1,%4 ; sbbq $0,%0" \
44 :"=&r" (flag), "=r" (sum) \ 44 :"=&r" (flag), "=r" (roksum) \
45 :"1" (addr),"g" ((long)(size)),"g" (current_thread_info()->addr_limit.seg)); \ 45 :"1" (addr),"g" ((long)(size)),"g" (current_thread_info()->addr_limit.seg)); \
46 flag; }) 46 flag; })
47 47
diff --git a/include/asm-xtensa/mman.h b/include/asm-xtensa/mman.h
index ba394cbb4807..9b92620c8a1e 100644
--- a/include/asm-xtensa/mman.h
+++ b/include/asm-xtensa/mman.h
@@ -79,7 +79,6 @@
79#define MADV_DOFORK 11 /* do inherit across fork */ 79#define MADV_DOFORK 11 /* do inherit across fork */
80 80
81/* compatibility flags */ 81/* compatibility flags */
82#define MAP_ANON MAP_ANONYMOUS
83#define MAP_FILE 0 82#define MAP_FILE 0
84 83
85#endif /* _XTENSA_MMAN_H */ 84#endif /* _XTENSA_MMAN_H */
diff --git a/include/asm-xtensa/termios.h b/include/asm-xtensa/termios.h
index 83c6aed1d115..f14b42c8dac0 100644
--- a/include/asm-xtensa/termios.h
+++ b/include/asm-xtensa/termios.h
@@ -52,25 +52,6 @@ struct termio {
52 52
53/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ 53/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
54 54
55/* Line disciplines */
56
57#define N_TTY 0
58#define N_SLIP 1
59#define N_MOUSE 2
60#define N_PPP 3
61#define N_STRIP 4
62#define N_AX25 5
63#define N_X25 6 /* X.25 async */
64#define N_6PACK 7
65#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
66#define N_R3964 9 /* Reserved for Simatic R3964 module */
67#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
68#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
69#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
70#define N_HDLC 13 /* synchronous HDLC */
71#define N_SYNC_PPP 14
72#define N_HCI 15 /* Bluetooth HCI UART */
73
74#ifdef __KERNEL__ 55#ifdef __KERNEL__
75 56
76/* intr=^C quit=^\ erase=del kill=^U 57/* intr=^C quit=^\ erase=del kill=^U
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index 5748aecdb414..4e05e93ff681 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -18,8 +18,8 @@ struct module;
18struct seq_file; 18struct seq_file;
19 19
20struct crypto_type { 20struct crypto_type {
21 unsigned int (*ctxsize)(struct crypto_alg *alg); 21 unsigned int (*ctxsize)(struct crypto_alg *alg, u32 type, u32 mask);
22 int (*init)(struct crypto_tfm *tfm); 22 int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask);
23 void (*exit)(struct crypto_tfm *tfm); 23 void (*exit)(struct crypto_tfm *tfm);
24 void (*show)(struct seq_file *m, struct crypto_alg *alg); 24 void (*show)(struct seq_file *m, struct crypto_alg *alg);
25}; 25};
@@ -93,7 +93,8 @@ struct crypto_template *crypto_lookup_template(const char *name);
93int crypto_init_spawn(struct crypto_spawn *spawn, struct crypto_alg *alg, 93int crypto_init_spawn(struct crypto_spawn *spawn, struct crypto_alg *alg,
94 struct crypto_instance *inst); 94 struct crypto_instance *inst);
95void crypto_drop_spawn(struct crypto_spawn *spawn); 95void crypto_drop_spawn(struct crypto_spawn *spawn);
96struct crypto_tfm *crypto_spawn_tfm(struct crypto_spawn *spawn); 96struct crypto_tfm *crypto_spawn_tfm(struct crypto_spawn *spawn, u32 type,
97 u32 mask);
97 98
98struct crypto_alg *crypto_get_attr_alg(void *param, unsigned int len, 99struct crypto_alg *crypto_get_attr_alg(void *param, unsigned int len,
99 u32 type, u32 mask); 100 u32 type, u32 mask);
@@ -132,11 +133,28 @@ static inline void *crypto_blkcipher_ctx_aligned(struct crypto_blkcipher *tfm)
132 return crypto_tfm_ctx_aligned(&tfm->base); 133 return crypto_tfm_ctx_aligned(&tfm->base);
133} 134}
134 135
136static inline struct crypto_cipher *crypto_spawn_cipher(
137 struct crypto_spawn *spawn)
138{
139 u32 type = CRYPTO_ALG_TYPE_CIPHER;
140 u32 mask = CRYPTO_ALG_TYPE_MASK;
141
142 return __crypto_cipher_cast(crypto_spawn_tfm(spawn, type, mask));
143}
144
135static inline struct cipher_alg *crypto_cipher_alg(struct crypto_cipher *tfm) 145static inline struct cipher_alg *crypto_cipher_alg(struct crypto_cipher *tfm)
136{ 146{
137 return &crypto_cipher_tfm(tfm)->__crt_alg->cra_cipher; 147 return &crypto_cipher_tfm(tfm)->__crt_alg->cra_cipher;
138} 148}
139 149
150static inline struct crypto_hash *crypto_spawn_hash(struct crypto_spawn *spawn)
151{
152 u32 type = CRYPTO_ALG_TYPE_HASH;
153 u32 mask = CRYPTO_ALG_TYPE_HASH_MASK;
154
155 return __crypto_hash_cast(crypto_spawn_tfm(spawn, type, mask));
156}
157
140static inline void *crypto_hash_ctx_aligned(struct crypto_hash *tfm) 158static inline void *crypto_hash_ctx_aligned(struct crypto_hash *tfm)
141{ 159{
142 return crypto_tfm_ctx_aligned(&tfm->base); 160 return crypto_tfm_ctx_aligned(&tfm->base);
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 157db77a7170..e81e301a4d71 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -11,6 +11,7 @@ header-y += netfilter_arp/
11header-y += netfilter_bridge/ 11header-y += netfilter_bridge/
12header-y += netfilter_ipv4/ 12header-y += netfilter_ipv4/
13header-y += netfilter_ipv6/ 13header-y += netfilter_ipv6/
14header-y += usb/
14 15
15header-y += affs_hardblocks.h 16header-y += affs_hardblocks.h
16header-y += aio_abi.h 17header-y += aio_abi.h
@@ -155,7 +156,6 @@ header-y += video_encoder.h
155header-y += videotext.h 156header-y += videotext.h
156header-y += vt.h 157header-y += vt.h
157header-y += wireless.h 158header-y += wireless.h
158header-y += xattr.h
159header-y += x25.h 159header-y += x25.h
160 160
161unifdef-y += acct.h 161unifdef-y += acct.h
@@ -323,10 +323,10 @@ unifdef-y += tty.h
323unifdef-y += types.h 323unifdef-y += types.h
324unifdef-y += udf_fs_i.h 324unifdef-y += udf_fs_i.h
325unifdef-y += udp.h 325unifdef-y += udp.h
326unifdef-y += ufs_fs.h
326unifdef-y += uinput.h 327unifdef-y += uinput.h
327unifdef-y += uio.h 328unifdef-y += uio.h
328unifdef-y += unistd.h 329unifdef-y += unistd.h
329unifdef-y += usb_ch9.h
330unifdef-y += usbdevice_fs.h 330unifdef-y += usbdevice_fs.h
331unifdef-y += user.h 331unifdef-y += user.h
332unifdef-y += utsname.h 332unifdef-y += utsname.h
@@ -336,6 +336,7 @@ unifdef-y += wait.h
336unifdef-y += wanrouter.h 336unifdef-y += wanrouter.h
337unifdef-y += watchdog.h 337unifdef-y += watchdog.h
338unifdef-y += wireless.h 338unifdef-y += wireless.h
339unifdef-y += xattr.h
339unifdef-y += xfrm.h 340unifdef-y += xfrm.h
340 341
341objhdr-y += version.h 342objhdr-y += version.h
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 91f1f2363870..815f1fb4ce21 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -53,166 +53,6 @@ enum acpi_irq_model_id {
53 53
54extern enum acpi_irq_model_id acpi_irq_model; 54extern enum acpi_irq_model_id acpi_irq_model;
55 55
56
57/* Root System Description Pointer (RSDP) */
58
59struct acpi_table_rsdp {
60 char signature[8];
61 u8 checksum;
62 char oem_id[6];
63 u8 revision;
64 u32 rsdt_address;
65} __attribute__ ((packed));
66
67struct acpi20_table_rsdp {
68 char signature[8];
69 u8 checksum;
70 char oem_id[6];
71 u8 revision;
72 u32 rsdt_address;
73 u32 length;
74 u64 xsdt_address;
75 u8 ext_checksum;
76 u8 reserved[3];
77} __attribute__ ((packed));
78
79typedef struct {
80 u8 type;
81 u8 length;
82} __attribute__ ((packed)) acpi_table_entry_header;
83
84/* Root System Description Table (RSDT) */
85
86struct acpi_table_rsdt {
87 struct acpi_table_header header;
88 u32 entry[8];
89} __attribute__ ((packed));
90
91/* Extended System Description Table (XSDT) */
92
93struct acpi_table_xsdt {
94 struct acpi_table_header header;
95 u64 entry[1];
96} __attribute__ ((packed));
97
98/* Fixed ACPI Description Table (FADT) */
99
100struct acpi_table_fadt {
101 struct acpi_table_header header;
102 u32 facs_addr;
103 u32 dsdt_addr;
104 /* ... */
105} __attribute__ ((packed));
106
107/* Multiple APIC Description Table (MADT) */
108
109struct acpi_table_madt {
110 struct acpi_table_header header;
111 u32 lapic_address;
112 struct {
113 u32 pcat_compat:1;
114 u32 reserved:31;
115 } flags;
116} __attribute__ ((packed));
117
118enum acpi_madt_entry_id {
119 ACPI_MADT_LAPIC = 0,
120 ACPI_MADT_IOAPIC,
121 ACPI_MADT_INT_SRC_OVR,
122 ACPI_MADT_NMI_SRC,
123 ACPI_MADT_LAPIC_NMI,
124 ACPI_MADT_LAPIC_ADDR_OVR,
125 ACPI_MADT_IOSAPIC,
126 ACPI_MADT_LSAPIC,
127 ACPI_MADT_PLAT_INT_SRC,
128 ACPI_MADT_ENTRY_COUNT
129};
130
131typedef struct {
132 u16 polarity:2;
133 u16 trigger:2;
134 u16 reserved:12;
135} __attribute__ ((packed)) acpi_interrupt_flags;
136
137struct acpi_table_lapic {
138 acpi_table_entry_header header;
139 u8 acpi_id;
140 u8 id;
141 struct {
142 u32 enabled:1;
143 u32 reserved:31;
144 } flags;
145} __attribute__ ((packed));
146
147struct acpi_table_ioapic {
148 acpi_table_entry_header header;
149 u8 id;
150 u8 reserved;
151 u32 address;
152 u32 global_irq_base;
153} __attribute__ ((packed));
154
155struct acpi_table_int_src_ovr {
156 acpi_table_entry_header header;
157 u8 bus;
158 u8 bus_irq;
159 u32 global_irq;
160 acpi_interrupt_flags flags;
161} __attribute__ ((packed));
162
163struct acpi_table_nmi_src {
164 acpi_table_entry_header header;
165 acpi_interrupt_flags flags;
166 u32 global_irq;
167} __attribute__ ((packed));
168
169struct acpi_table_lapic_nmi {
170 acpi_table_entry_header header;
171 u8 acpi_id;
172 acpi_interrupt_flags flags;
173 u8 lint;
174} __attribute__ ((packed));
175
176struct acpi_table_lapic_addr_ovr {
177 acpi_table_entry_header header;
178 u8 reserved[2];
179 u64 address;
180} __attribute__ ((packed));
181
182struct acpi_table_iosapic {
183 acpi_table_entry_header header;
184 u8 id;
185 u8 reserved;
186 u32 global_irq_base;
187 u64 address;
188} __attribute__ ((packed));
189
190struct acpi_table_lsapic {
191 acpi_table_entry_header header;
192 u8 acpi_id;
193 u8 id;
194 u8 eid;
195 u8 reserved[3];
196 struct {
197 u32 enabled:1;
198 u32 reserved:31;
199 } flags;
200} __attribute__ ((packed));
201
202struct acpi_table_plat_int_src {
203 acpi_table_entry_header header;
204 acpi_interrupt_flags flags;
205 u8 type; /* See acpi_interrupt_type */
206 u8 id;
207 u8 eid;
208 u8 iosapic_vector;
209 u32 global_irq;
210 struct {
211 u32 cpei_override_flag:1;
212 u32 reserved:31;
213 } plint_flags;
214} __attribute__ ((packed));
215
216enum acpi_interrupt_id { 56enum acpi_interrupt_id {
217 ACPI_INTERRUPT_PMI = 1, 57 ACPI_INTERRUPT_PMI = 1,
218 ACPI_INTERRUPT_INIT, 58 ACPI_INTERRUPT_INIT,
@@ -222,89 +62,6 @@ enum acpi_interrupt_id {
222 62
223#define ACPI_SPACE_MEM 0 63#define ACPI_SPACE_MEM 0
224 64
225struct acpi_gen_regaddr {
226 u8 space_id;
227 u8 bit_width;
228 u8 bit_offset;
229 u8 resv;
230 u32 addrl;
231 u32 addrh;
232} __attribute__ ((packed));
233
234struct acpi_table_hpet {
235 struct acpi_table_header header;
236 u32 id;
237 struct acpi_gen_regaddr addr;
238 u8 number;
239 u16 min_tick;
240 u8 page_protect;
241} __attribute__ ((packed));
242
243/*
244 * Simple Boot Flags
245 * http://www.microsoft.com/whdc/hwdev/resources/specs/simp_bios.mspx
246 */
247struct acpi_table_sbf
248{
249 u8 sbf_signature[4];
250 u32 sbf_len;
251 u8 sbf_revision;
252 u8 sbf_csum;
253 u8 sbf_oemid[6];
254 u8 sbf_oemtable[8];
255 u8 sbf_revdata[4];
256 u8 sbf_creator[4];
257 u8 sbf_crearev[4];
258 u8 sbf_cmos;
259 u8 sbf_spare[3];
260} __attribute__ ((packed));
261
262/*
263 * System Resource Affinity Table (SRAT)
264 * http://www.microsoft.com/whdc/hwdev/platform/proc/SRAT.mspx
265 */
266
267struct acpi_table_srat {
268 struct acpi_table_header header;
269 u32 table_revision;
270 u64 reserved;
271} __attribute__ ((packed));
272
273enum acpi_srat_entry_id {
274 ACPI_SRAT_PROCESSOR_AFFINITY = 0,
275 ACPI_SRAT_MEMORY_AFFINITY,
276 ACPI_SRAT_ENTRY_COUNT
277};
278
279struct acpi_table_processor_affinity {
280 acpi_table_entry_header header;
281 u8 proximity_domain;
282 u8 apic_id;
283 struct {
284 u32 enabled:1;
285 u32 reserved:31;
286 } flags;
287 u8 lsapic_eid;
288 u8 reserved[7];
289} __attribute__ ((packed));
290
291struct acpi_table_memory_affinity {
292 acpi_table_entry_header header;
293 u8 proximity_domain;
294 u8 reserved1[5];
295 u32 base_addr_lo;
296 u32 base_addr_hi;
297 u32 length_lo;
298 u32 length_hi;
299 u32 memory_type; /* See acpi_address_range_id */
300 struct {
301 u32 enabled:1;
302 u32 hot_pluggable:1;
303 u32 reserved:30;
304 } flags;
305 u64 reserved2;
306} __attribute__ ((packed));
307
308enum acpi_address_range_id { 65enum acpi_address_range_id {
309 ACPI_ADDRESS_RANGE_MEMORY = 1, 66 ACPI_ADDRESS_RANGE_MEMORY = 1,
310 ACPI_ADDRESS_RANGE_RESERVED = 2, 67 ACPI_ADDRESS_RANGE_RESERVED = 2,
@@ -313,84 +70,12 @@ enum acpi_address_range_id {
313 ACPI_ADDRESS_RANGE_COUNT 70 ACPI_ADDRESS_RANGE_COUNT
314}; 71};
315 72
316/*
317 * System Locality Information Table (SLIT)
318 * see http://devresource.hp.com/devresource/docs/techpapers/ia64/slit.pdf
319 */
320
321struct acpi_table_slit {
322 struct acpi_table_header header;
323 u64 localities;
324 u8 entry[1]; /* real size = localities^2 */
325} __attribute__ ((packed));
326
327/* Smart Battery Description Table (SBST) */
328
329struct acpi_table_sbst {
330 struct acpi_table_header header;
331 u32 warning; /* Warn user */
332 u32 low; /* Critical sleep */
333 u32 critical; /* Critical shutdown */
334} __attribute__ ((packed));
335
336/* Embedded Controller Boot Resources Table (ECDT) */
337
338struct acpi_table_ecdt {
339 struct acpi_table_header header;
340 struct acpi_generic_address ec_control;
341 struct acpi_generic_address ec_data;
342 u32 uid;
343 u8 gpe_bit;
344 char ec_id[0];
345} __attribute__ ((packed));
346
347/* PCI MMCONFIG */
348
349/* Defined in PCI Firmware Specification 3.0 */
350struct acpi_table_mcfg_config {
351 u32 base_address;
352 u32 base_reserved;
353 u16 pci_segment_group_number;
354 u8 start_bus_number;
355 u8 end_bus_number;
356 u8 reserved[4];
357} __attribute__ ((packed));
358struct acpi_table_mcfg {
359 struct acpi_table_header header;
360 u8 reserved[8];
361 struct acpi_table_mcfg_config config[0];
362} __attribute__ ((packed));
363 73
364/* Table Handlers */ 74/* Table Handlers */
365 75
366enum acpi_table_id { 76typedef int (*acpi_table_handler) (struct acpi_table_header *table);
367 ACPI_TABLE_UNKNOWN = 0,
368 ACPI_APIC,
369 ACPI_BOOT,
370 ACPI_DBGP,
371 ACPI_DSDT,
372 ACPI_ECDT,
373 ACPI_ETDT,
374 ACPI_FADT,
375 ACPI_FACS,
376 ACPI_OEMX,
377 ACPI_PSDT,
378 ACPI_SBST,
379 ACPI_SLIT,
380 ACPI_SPCR,
381 ACPI_SRAT,
382 ACPI_SSDT,
383 ACPI_SPMI,
384 ACPI_HPET,
385 ACPI_MCFG,
386 ACPI_TABLE_COUNT
387};
388
389typedef int (*acpi_table_handler) (unsigned long phys_addr, unsigned long size);
390
391extern acpi_table_handler acpi_table_ops[ACPI_TABLE_COUNT];
392 77
393typedef int (*acpi_madt_entry_handler) (acpi_table_entry_header *header, const unsigned long end); 78typedef int (*acpi_madt_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
394 79
395char * __acpi_map_table (unsigned long phys_addr, unsigned long size); 80char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
396unsigned long acpi_find_rsdp (void); 81unsigned long acpi_find_rsdp (void);
@@ -399,14 +84,12 @@ int acpi_boot_table_init (void);
399int acpi_numa_init (void); 84int acpi_numa_init (void);
400 85
401int acpi_table_init (void); 86int acpi_table_init (void);
402int acpi_table_parse (enum acpi_table_id id, acpi_table_handler handler); 87int acpi_table_parse (char *id, acpi_table_handler handler);
403int acpi_get_table_header_early (enum acpi_table_id id, struct acpi_table_header **header); 88int acpi_table_parse_madt (enum acpi_madt_type id, acpi_madt_entry_handler handler, unsigned int max_entries);
404int acpi_table_parse_madt (enum acpi_madt_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries); 89int acpi_table_parse_srat (enum acpi_srat_type id, acpi_madt_entry_handler handler, unsigned int max_entries);
405int acpi_table_parse_srat (enum acpi_srat_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries); 90int acpi_parse_mcfg (struct acpi_table_header *header);
406int acpi_parse_mcfg (unsigned long phys_addr, unsigned long size); 91void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
407void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr); 92void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
408void acpi_table_print_madt_entry (acpi_table_entry_header *madt);
409void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
410 93
411/* the following four functions are architecture-dependent */ 94/* the following four functions are architecture-dependent */
412#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT 95#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
@@ -417,8 +100,8 @@ void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
417#define acpi_numa_arch_fixup() do {} while (0) 100#define acpi_numa_arch_fixup() do {} while (0)
418#else 101#else
419void acpi_numa_slit_init (struct acpi_table_slit *slit); 102void acpi_numa_slit_init (struct acpi_table_slit *slit);
420void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa); 103void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
421void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma); 104void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
422void acpi_numa_arch_fixup(void); 105void acpi_numa_arch_fixup(void);
423#endif 106#endif
424 107
@@ -433,7 +116,7 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
433 116
434extern int acpi_mp_config; 117extern int acpi_mp_config;
435 118
436extern struct acpi_table_mcfg_config *pci_mmcfg_config; 119extern struct acpi_mcfg_allocation *pci_mmcfg_config;
437extern int pci_mmcfg_config_num; 120extern int pci_mmcfg_config_num;
438 121
439extern int sbf_port; 122extern int sbf_port;
diff --git a/include/asm-arm/apm.h b/include/linux/apm-emulation.h
index d09113b37e4a..e6d800358dd6 100644
--- a/include/asm-arm/apm.h
+++ b/include/linux/apm-emulation.h
@@ -7,11 +7,9 @@
7 * based on arch/arm/kernel/apm.c 7 * based on arch/arm/kernel/apm.c
8 * factor out the information needed by architectures to provide 8 * factor out the information needed by architectures to provide
9 * apm status 9 * apm status
10 *
11 *
12 */ 10 */
13#ifndef ARM_ASM_SA1100_APM_H 11#ifndef __LINUX_APM_EMULATION_H
14#define ARM_ASM_SA1100_APM_H 12#define __LINUX_APM_EMULATION_H
15 13
16#include <linux/apm_bios.h> 14#include <linux/apm_bios.h>
17 15
@@ -61,4 +59,4 @@ extern void (*apm_get_power_status)(struct apm_power_info *);
61 */ 59 */
62void apm_queue_event(apm_event_t event); 60void apm_queue_event(apm_event_t event);
63 61
64#endif 62#endif /* __LINUX_APM_EMULATION_H */
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 1df941648a57..18e401ff7eaf 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -44,9 +44,9 @@ enum {
44 ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ 44 ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */
45 45
46 ATA_ID_WORDS = 256, 46 ATA_ID_WORDS = 256,
47 ATA_ID_SERNO_OFS = 10, 47 ATA_ID_SERNO = 10,
48 ATA_ID_FW_REV_OFS = 23, 48 ATA_ID_FW_REV = 23,
49 ATA_ID_PROD_OFS = 27, 49 ATA_ID_PROD = 27,
50 ATA_ID_OLD_PIO_MODES = 51, 50 ATA_ID_OLD_PIO_MODES = 51,
51 ATA_ID_FIELD_VALID = 53, 51 ATA_ID_FIELD_VALID = 53,
52 ATA_ID_MWDMA_MODES = 63, 52 ATA_ID_MWDMA_MODES = 63,
@@ -58,8 +58,11 @@ enum {
58 ATA_ID_MAJOR_VER = 80, 58 ATA_ID_MAJOR_VER = 80,
59 ATA_ID_PIO4 = (1 << 1), 59 ATA_ID_PIO4 = (1 << 1),
60 60
61 ATA_ID_SERNO_LEN = 20,
62 ATA_ID_FW_REV_LEN = 8,
63 ATA_ID_PROD_LEN = 40,
64
61 ATA_PCI_CTL_OFS = 2, 65 ATA_PCI_CTL_OFS = 2,
62 ATA_SERNO_LEN = 20,
63 ATA_UDMA0 = (1 << 0), 66 ATA_UDMA0 = (1 << 0),
64 ATA_UDMA1 = ATA_UDMA0 | (1 << 1), 67 ATA_UDMA1 = ATA_UDMA0 | (1 << 1),
65 ATA_UDMA2 = ATA_UDMA1 | (1 << 2), 68 ATA_UDMA2 = ATA_UDMA1 | (1 << 2),
@@ -296,6 +299,8 @@ struct ata_taskfile {
296#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1) 299#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1)
297#define ata_id_removeable(id) ((id)[0] & (1 << 7)) 300#define ata_id_removeable(id) ((id)[0] & (1 << 7))
298#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) 301#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0))
302#define ata_id_iordy_disable(id) ((id)[49] & (1 << 10))
303#define ata_id_has_iordy(id) ((id)[49] & (1 << 9))
299#define ata_id_u32(id,n) \ 304#define ata_id_u32(id,n) \
300 (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)])) 305 (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)]))
301#define ata_id_u64(id,n) \ 306#define ata_id_u64(id,n) \
diff --git a/include/linux/atalk.h b/include/linux/atalk.h
index 75b8baca08f3..d12984ddaa9f 100644
--- a/include/linux/atalk.h
+++ b/include/linux/atalk.h
@@ -182,7 +182,7 @@ extern rwlock_t atalk_interfaces_lock;
182 182
183extern struct atalk_route atrtr_default; 183extern struct atalk_route atrtr_default;
184 184
185extern struct file_operations atalk_seq_arp_fops; 185extern const struct file_operations atalk_seq_arp_fops;
186 186
187extern int sysctl_aarp_expiry_time; 187extern int sysctl_aarp_expiry_time;
188extern int sysctl_aarp_tick_time; 188extern int sysctl_aarp_tick_time;
diff --git a/include/linux/atmarp.h b/include/linux/atmarp.h
index ee108f9e9cb7..231f4bdec730 100644
--- a/include/linux/atmarp.h
+++ b/include/linux/atmarp.h
@@ -6,9 +6,7 @@
6#ifndef _LINUX_ATMARP_H 6#ifndef _LINUX_ATMARP_H
7#define _LINUX_ATMARP_H 7#define _LINUX_ATMARP_H
8 8
9#ifdef __KERNEL__
10#include <linux/types.h> 9#include <linux/types.h>
11#endif
12#include <linux/atmapi.h> 10#include <linux/atmapi.h>
13#include <linux/atmioc.h> 11#include <linux/atmioc.h>
14 12
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 36a6eacefe20..83dcd8c0e974 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -82,7 +82,6 @@ struct cfq_io_context {
82 82
83 unsigned long last_end_request; 83 unsigned long last_end_request;
84 sector_t last_request_pos; 84 sector_t last_request_pos;
85 unsigned long last_queue;
86 85
87 unsigned long ttime_total; 86 unsigned long ttime_total;
88 unsigned long ttime_samples; 87 unsigned long ttime_samples;
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 5d9fb0e94156..dd27b1c7227f 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -34,6 +34,7 @@ enum bh_state_bits {
34 BH_Write_EIO, /* I/O error on write */ 34 BH_Write_EIO, /* I/O error on write */
35 BH_Ordered, /* ordered write */ 35 BH_Ordered, /* ordered write */
36 BH_Eopnotsupp, /* operation not supported (barrier) */ 36 BH_Eopnotsupp, /* operation not supported (barrier) */
37 BH_Unwritten, /* Buffer is allocated on disk but not written */
37 38
38 BH_PrivateStart,/* not a state bit, but the first bit available 39 BH_PrivateStart,/* not a state bit, but the first bit available
39 * for private allocation by other entities 40 * for private allocation by other entities
@@ -126,6 +127,7 @@ BUFFER_FNS(Boundary, boundary)
126BUFFER_FNS(Write_EIO, write_io_error) 127BUFFER_FNS(Write_EIO, write_io_error)
127BUFFER_FNS(Ordered, ordered) 128BUFFER_FNS(Ordered, ordered)
128BUFFER_FNS(Eopnotsupp, eopnotsupp) 129BUFFER_FNS(Eopnotsupp, eopnotsupp)
130BUFFER_FNS(Unwritten, unwritten)
129 131
130#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) 132#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK)
131#define touch_buffer(bh) mark_page_accessed(bh->b_page) 133#define touch_buffer(bh) mark_page_accessed(bh->b_page)
@@ -172,12 +174,14 @@ struct super_block *freeze_bdev(struct block_device *);
172void thaw_bdev(struct block_device *, struct super_block *); 174void thaw_bdev(struct block_device *, struct super_block *);
173int fsync_super(struct super_block *); 175int fsync_super(struct super_block *);
174int fsync_no_super(struct block_device *); 176int fsync_no_super(struct block_device *);
175struct buffer_head *__find_get_block(struct block_device *, sector_t, int); 177struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block,
176struct buffer_head * __getblk(struct block_device *, sector_t, int); 178 unsigned size);
179struct buffer_head *__getblk(struct block_device *bdev, sector_t block,
180 unsigned size);
177void __brelse(struct buffer_head *); 181void __brelse(struct buffer_head *);
178void __bforget(struct buffer_head *); 182void __bforget(struct buffer_head *);
179void __breadahead(struct block_device *, sector_t block, int size); 183void __breadahead(struct block_device *, sector_t block, unsigned int size);
180struct buffer_head *__bread(struct block_device *, sector_t block, int size); 184struct buffer_head *__bread(struct block_device *, sector_t block, unsigned size);
181struct buffer_head *alloc_buffer_head(gfp_t gfp_flags); 185struct buffer_head *alloc_buffer_head(gfp_t gfp_flags);
182void free_buffer_head(struct buffer_head * bh); 186void free_buffer_head(struct buffer_head * bh);
183void FASTCALL(unlock_buffer(struct buffer_head *bh)); 187void FASTCALL(unlock_buffer(struct buffer_head *bh));
diff --git a/include/linux/byteorder/Kbuild b/include/linux/byteorder/Kbuild
index 56499ab9e32e..79bedddfd9ca 100644
--- a/include/linux/byteorder/Kbuild
+++ b/include/linux/byteorder/Kbuild
@@ -1,7 +1,5 @@
1header-y += big_endian.h 1header-y += big_endian.h
2header-y += little_endian.h 2header-y += little_endian.h
3header-y += pdp_endian.h
4 3
5unifdef-y += generic.h 4unifdef-y += generic.h
6unifdef-y += swabb.h
7unifdef-y += swab.h 5unifdef-y += swab.h
diff --git a/include/linux/byteorder/pdp_endian.h b/include/linux/byteorder/pdp_endian.h
deleted file mode 100644
index 618631cbc6e3..000000000000
--- a/include/linux/byteorder/pdp_endian.h
+++ /dev/null
@@ -1,88 +0,0 @@
1#ifndef _LINUX_BYTEORDER_PDP_ENDIAN_H
2#define _LINUX_BYTEORDER_PDP_ENDIAN_H
3
4/*
5 * Could have been named NUXI-endian, but we use the same name as in glibc.
6 * hopefully only the PDP and its evolutions (old VAXen in compatibility mode)
7 * should ever use this braindead byteorder.
8 * This file *should* work, but has not been tested.
9 *
10 * little-endian is 1234; big-endian is 4321; nuxi/pdp-endian is 3412
11 *
12 * I thought vaxen were NUXI-endian, but was told they were correct-endian
13 * (little-endian), though indeed there existed NUXI-endian machines
14 * (DEC PDP-11 and old VAXen in compatibility mode).
15 * This makes this file a bit useless, but as a proof-of-concept.
16 *
17 * But what does a __u64 look like: is it 34127856 or 78563412 ???
18 * I don't dare imagine! Hence, no 64-bit byteorder support yet.
19 * Hopefully, there 64-bit pdp-endian support shouldn't ever be required.
20 *
21 */
22
23#ifndef __PDP_ENDIAN
24#define __PDP_ENDIAN 3412
25#endif
26#ifndef __PDP_ENDIAN_BITFIELD
27#define __PDP_ENDIAN_BITFIELD
28#endif
29
30#include <linux/byteorder/swab.h>
31#include <linux/byteorder/swabb.h>
32
33#define __constant_htonl(x) ___constant_swahb32((x))
34#define __constant_ntohl(x) ___constant_swahb32((x))
35#define __constant_htons(x) ___constant_swab16((x))
36#define __constant_ntohs(x) ___constant_swab16((x))
37#define __constant_cpu_to_le64(x) I DON'T KNOW
38#define __constant_le64_to_cpu(x) I DON'T KNOW
39#define __constant_cpu_to_le32(x) ___constant_swahw32((x))
40#define __constant_le32_to_cpu(x) ___constant_swahw32((x))
41#define __constant_cpu_to_le16(x) ((__u16)(x)
42#define __constant_le16_to_cpu(x) ((__u16)(x)
43#define __constant_cpu_to_be64(x) I DON'T KNOW
44#define __constant_be64_to_cpu(x) I DON'T KNOW
45#define __constant_cpu_to_be32(x) ___constant_swahb32((x))
46#define __constant_be32_to_cpu(x) ___constant_swahb32((x))
47#define __constant_cpu_to_be16(x) ___constant_swab16((x))
48#define __constant_be16_to_cpu(x) ___constant_swab16((x))
49#define __cpu_to_le64(x) I DON'T KNOW
50#define __le64_to_cpu(x) I DON'T KNOW
51#define __cpu_to_le32(x) ___swahw32((x))
52#define __le32_to_cpu(x) ___swahw32((x))
53#define __cpu_to_le16(x) ((__u16)(x)
54#define __le16_to_cpu(x) ((__u16)(x)
55#define __cpu_to_be64(x) I DON'T KNOW
56#define __be64_to_cpu(x) I DON'T KNOW
57#define __cpu_to_be32(x) __swahb32((x))
58#define __be32_to_cpu(x) __swahb32((x))
59#define __cpu_to_be16(x) __swab16((x))
60#define __be16_to_cpu(x) __swab16((x))
61#define __cpu_to_le64p(x) I DON'T KNOW
62#define __le64_to_cpup(x) I DON'T KNOW
63#define __cpu_to_le32p(x) ___swahw32p((x))
64#define __le32_to_cpup(x) ___swahw32p((x))
65#define __cpu_to_le16p(x) (*(__u16*)(x))
66#define __le16_to_cpup(x) (*(__u16*)(x))
67#define __cpu_to_be64p(x) I DON'T KNOW
68#define __be64_to_cpup(x) I DON'T KNOW
69#define __cpu_to_be32p(x) __swahb32p((x))
70#define __be32_to_cpup(x) __swahb32p((x))
71#define __cpu_to_be16p(x) __swab16p((x))
72#define __be16_to_cpup(x) __swab16p((x))
73#define __cpu_to_le64s(x) I DON'T KNOW
74#define __le64_to_cpus(x) I DON'T KNOW
75#define __cpu_to_le32s(x) ___swahw32s((x))
76#define __le32_to_cpus(x) ___swahw32s((x))
77#define __cpu_to_le16s(x) do {} while (0)
78#define __le16_to_cpus(x) do {} while (0)
79#define __cpu_to_be64s(x) I DON'T KNOW
80#define __be64_to_cpus(x) I DON'T KNOW
81#define __cpu_to_be32s(x) __swahb32s((x))
82#define __be32_to_cpus(x) __swahb32s((x))
83#define __cpu_to_be16s(x) __swab16s((x))
84#define __be16_to_cpus(x) __swab16s((x))
85
86#include <linux/byteorder/generic.h>
87
88#endif /* _LINUX_BYTEORDER_PDP_ENDIAN_H */
diff --git a/include/linux/byteorder/swabb.h b/include/linux/byteorder/swabb.h
index ae5e5f914bf4..8c780c7d779e 100644
--- a/include/linux/byteorder/swabb.h
+++ b/include/linux/byteorder/swabb.h
@@ -25,6 +25,8 @@
25 * 25 *
26 */ 26 */
27 27
28#include <linux/types.h>
29
28#define ___swahw32(x) \ 30#define ___swahw32(x) \
29({ \ 31({ \
30 __u32 __x = (x); \ 32 __u32 __x = (x); \
@@ -77,19 +79,14 @@
77/* 79/*
78 * Allow constant folding 80 * Allow constant folding
79 */ 81 */
80#if defined(__GNUC__) && defined(__OPTIMIZE__) 82#define __swahw32(x) \
81# define __swahw32(x) \
82(__builtin_constant_p((__u32)(x)) ? \ 83(__builtin_constant_p((__u32)(x)) ? \
83 ___swahw32((x)) : \ 84 ___swahw32((x)) : \
84 __fswahw32((x))) 85 __fswahw32((x)))
85# define __swahb32(x) \ 86#define __swahb32(x) \
86(__builtin_constant_p((__u32)(x)) ? \ 87(__builtin_constant_p((__u32)(x)) ? \
87 ___swahb32((x)) : \ 88 ___swahb32((x)) : \
88 __fswahb32((x))) 89 __fswahb32((x)))
89#else
90# define __swahw32(x) __fswahw32(x)
91# define __swahb32(x) __fswahb32(x)
92#endif /* OPTIMIZE */
93 90
94 91
95static inline __u32 __fswahw32(__u32 x) 92static inline __u32 __fswahw32(__u32 x)
@@ -128,13 +125,11 @@ static inline void __swahb32s(__u32 *addr)
128 */ 125 */
129#endif /* __BYTEORDER_HAS_U64__ */ 126#endif /* __BYTEORDER_HAS_U64__ */
130 127
131#if defined(__KERNEL__)
132#define swahw32 __swahw32 128#define swahw32 __swahw32
133#define swahb32 __swahb32 129#define swahb32 __swahb32
134#define swahw32p __swahw32p 130#define swahw32p __swahw32p
135#define swahb32p __swahb32p 131#define swahb32p __swahb32p
136#define swahw32s __swahw32s 132#define swahw32s __swahw32s
137#define swahb32s __swahb32s 133#define swahb32s __swahb32s
138#endif
139 134
140#endif /* _LINUX_BYTEORDER_SWABB_H */ 135#endif /* _LINUX_BYTEORDER_SWABB_H */
diff --git a/include/linux/cfag12864b.h b/include/linux/cfag12864b.h
new file mode 100644
index 000000000000..0bc45e69da5a
--- /dev/null
+++ b/include/linux/cfag12864b.h
@@ -0,0 +1,77 @@
1/*
2 * Filename: cfag12864b.h
3 * Version: 0.1.0
4 * Description: cfag12864b LCD driver header
5 * License: GPLv2
6 *
7 * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@gmail.com>
8 * Date: 2006-10-12
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 * 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#ifndef _CFAG12864B_H_
26#define _CFAG12864B_H_
27
28#define CFAG12864B_WIDTH (128)
29#define CFAG12864B_HEIGHT (64)
30#define CFAG12864B_CONTROLLERS (2)
31#define CFAG12864B_PAGES (8)
32#define CFAG12864B_ADDRESSES (64)
33#define CFAG12864B_SIZE ((CFAG12864B_CONTROLLERS) * \
34 (CFAG12864B_PAGES) * \
35 (CFAG12864B_ADDRESSES))
36
37/*
38 * The driver will blit this buffer to the LCD
39 *
40 * Its size is CFAG12864B_SIZE.
41 */
42extern unsigned char * cfag12864b_buffer;
43
44/*
45 * Get the refresh rate of the LCD
46 *
47 * Returns the refresh rate (hertzs).
48 */
49extern unsigned int cfag12864b_getrate(void);
50
51/*
52 * Enable refreshing
53 *
54 * Returns 0 if successful (anyone was using it),
55 * or != 0 if failed (someone is using it).
56 */
57extern unsigned char cfag12864b_enable(void);
58
59/*
60 * Disable refreshing
61 *
62 * You should call this only when you finish using the LCD.
63 */
64extern void cfag12864b_disable(void);
65
66/*
67 * Is enabled refreshing? (is anyone using the module?)
68 *
69 * Returns 0 if refreshing is not enabled (anyone is using it),
70 * or != 0 if refreshing is enabled (someone is using it).
71 *
72 * Useful for buffer read-only modules.
73 */
74extern unsigned char cfag12864b_isenabled(void);
75
76#endif /* _CFAG12864B_H_ */
77
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index 4c2632a8d31b..e4ac016ad272 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -23,9 +23,9 @@
23#include <linux/coda_fs_i.h> 23#include <linux/coda_fs_i.h>
24 24
25/* operations */ 25/* operations */
26extern struct inode_operations coda_dir_inode_operations; 26extern const struct inode_operations coda_dir_inode_operations;
27extern struct inode_operations coda_file_inode_operations; 27extern const struct inode_operations coda_file_inode_operations;
28extern struct inode_operations coda_ioctl_inode_operations; 28extern const struct inode_operations coda_ioctl_inode_operations;
29 29
30extern const struct address_space_operations coda_file_aops; 30extern const struct address_space_operations coda_file_aops;
31extern const struct address_space_operations coda_symlink_aops; 31extern const struct address_space_operations coda_symlink_aops;
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 6e1c44a935d4..9008eabb9c3d 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -27,6 +27,13 @@
27#define __inline__ __inline__ __attribute__((always_inline)) 27#define __inline__ __inline__ __attribute__((always_inline))
28#define __inline __inline __attribute__((always_inline)) 28#define __inline __inline __attribute__((always_inline))
29#define __deprecated __attribute__((deprecated)) 29#define __deprecated __attribute__((deprecated))
30#define __packed __attribute__((packed))
31#define __weak __attribute__((weak))
32#define __naked __attribute__((naked))
33#define __noreturn __attribute__((noreturn))
34#define __pure __attribute__((pure))
35#define __aligned(x) __attribute__((aligned(x)))
36#define __printf(a,b) __attribute__((format(printf,a,b)))
30#define noinline __attribute__((noinline)) 37#define noinline __attribute__((noinline))
31#define __attribute_pure__ __attribute__((pure)) 38#define __attribute_pure__ __attribute__((pure))
32#define __attribute_const__ __attribute__((__const__)) 39#define __attribute_const__ __attribute__((__const__))
diff --git a/include/linux/console.h b/include/linux/console.h
index 7d0420274de0..de25ee3b7919 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -21,6 +21,7 @@ struct vc_data;
21struct console_font_op; 21struct console_font_op;
22struct console_font; 22struct console_font;
23struct module; 23struct module;
24struct tty_struct;
24 25
25/* 26/*
26 * this is what the terminal answers to a ESC-Z or csi0c query. 27 * this is what the terminal answers to a ESC-Z or csi0c query.
@@ -132,6 +133,9 @@ static inline void resume_console(void) {}
132int mda_console_init(void); 133int mda_console_init(void);
133void prom_con_init(void); 134void prom_con_init(void);
134 135
136void vcs_make_sysfs(struct tty_struct *tty);
137void vcs_remove_sysfs(struct tty_struct *tty);
138
135/* Some debug stub to catch some of the obvious races in the VT code */ 139/* Some debug stub to catch some of the obvious races in the VT code */
136#if 1 140#if 1
137#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) 141#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress)
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index ed6c0fee1ac7..a86162b26c0d 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -11,6 +11,7 @@
11 11
12#include <linux/wait.h> 12#include <linux/wait.h>
13#include <linux/vt.h> 13#include <linux/vt.h>
14#include <linux/workqueue.h>
14 15
15struct vt_struct; 16struct vt_struct;
16 17
@@ -103,6 +104,7 @@ struct vc_data {
103 104
104struct vc { 105struct vc {
105 struct vc_data *d; 106 struct vc_data *d;
107 struct work_struct SAK_work;
106 108
107 /* might add scrmem, vt_struct, kbd at some time, 109 /* might add scrmem, vt_struct, kbd at some time,
108 to have everything in one place - the disadvantage 110 to have everything in one place - the disadvantage
@@ -110,6 +112,7 @@ struct vc {
110}; 112};
111 113
112extern struct vc vc_cons [MAX_NR_CONSOLES]; 114extern struct vc vc_cons [MAX_NR_CONSOLES];
115extern void vc_SAK(struct work_struct *work);
113 116
114#define CUR_DEF 0 117#define CUR_DEF 0
115#define CUR_NONE 1 118#define CUR_NONE 1
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index bfb520212d71..769ddc6df492 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -49,10 +49,20 @@ struct notifier_block;
49 49
50#ifdef CONFIG_SMP 50#ifdef CONFIG_SMP
51/* Need to know about CPUs going up/down? */ 51/* Need to know about CPUs going up/down? */
52extern int register_cpu_notifier(struct notifier_block *nb);
53#ifdef CONFIG_HOTPLUG_CPU 52#ifdef CONFIG_HOTPLUG_CPU
53extern int register_cpu_notifier(struct notifier_block *nb);
54extern void unregister_cpu_notifier(struct notifier_block *nb); 54extern void unregister_cpu_notifier(struct notifier_block *nb);
55#else 55#else
56
57#ifndef MODULE
58extern int register_cpu_notifier(struct notifier_block *nb);
59#else
60static inline int register_cpu_notifier(struct notifier_block *nb)
61{
62 return 0;
63}
64#endif
65
56static inline void unregister_cpu_notifier(struct notifier_block *nb) 66static inline void unregister_cpu_notifier(struct notifier_block *nb)
57{ 67{
58} 68}
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index fd404416f31c..826b15e914e2 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -55,7 +55,7 @@ extern int cpuset_excl_nodes_overlap(const struct task_struct *p);
55extern int cpuset_memory_pressure_enabled; 55extern int cpuset_memory_pressure_enabled;
56extern void __cpuset_memory_pressure_bump(void); 56extern void __cpuset_memory_pressure_bump(void);
57 57
58extern struct file_operations proc_cpuset_operations; 58extern const struct file_operations proc_cpuset_operations;
59extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); 59extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer);
60 60
61extern void cpuset_lock(void); 61extern void cpuset_lock(void);
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 4aa9046601da..779aa78ee643 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -51,15 +51,9 @@
51/* 51/*
52 * Transform masks and values (for crt_flags). 52 * Transform masks and values (for crt_flags).
53 */ 53 */
54#define CRYPTO_TFM_MODE_MASK 0x000000ff
55#define CRYPTO_TFM_REQ_MASK 0x000fff00 54#define CRYPTO_TFM_REQ_MASK 0x000fff00
56#define CRYPTO_TFM_RES_MASK 0xfff00000 55#define CRYPTO_TFM_RES_MASK 0xfff00000
57 56
58#define CRYPTO_TFM_MODE_ECB 0x00000001
59#define CRYPTO_TFM_MODE_CBC 0x00000002
60#define CRYPTO_TFM_MODE_CFB 0x00000004
61#define CRYPTO_TFM_MODE_CTR 0x00000008
62
63#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 57#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100
64#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200 58#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200
65#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 59#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000
@@ -71,12 +65,8 @@
71/* 65/*
72 * Miscellaneous stuff. 66 * Miscellaneous stuff.
73 */ 67 */
74#define CRYPTO_UNSPEC 0
75#define CRYPTO_MAX_ALG_NAME 64 68#define CRYPTO_MAX_ALG_NAME 64
76 69
77#define CRYPTO_DIR_ENCRYPT 1
78#define CRYPTO_DIR_DECRYPT 0
79
80/* 70/*
81 * The macro CRYPTO_MINALIGN_ATTR (along with the void * type in the actual 71 * The macro CRYPTO_MINALIGN_ATTR (along with the void * type in the actual
82 * declaration) is used to ensure that the crypto_tfm context structure is 72 * declaration) is used to ensure that the crypto_tfm context structure is
@@ -148,19 +138,6 @@ struct cipher_alg {
148 unsigned int keylen); 138 unsigned int keylen);
149 void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); 139 void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
150 void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); 140 void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
151
152 unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc,
153 u8 *dst, const u8 *src,
154 unsigned int nbytes) __deprecated;
155 unsigned int (*cia_decrypt_ecb)(const struct cipher_desc *desc,
156 u8 *dst, const u8 *src,
157 unsigned int nbytes) __deprecated;
158 unsigned int (*cia_encrypt_cbc)(const struct cipher_desc *desc,
159 u8 *dst, const u8 *src,
160 unsigned int nbytes) __deprecated;
161 unsigned int (*cia_decrypt_cbc)(const struct cipher_desc *desc,
162 u8 *dst, const u8 *src,
163 unsigned int nbytes) __deprecated;
164}; 141};
165 142
166struct digest_alg { 143struct digest_alg {
@@ -243,11 +220,6 @@ int crypto_unregister_alg(struct crypto_alg *alg);
243#ifdef CONFIG_CRYPTO 220#ifdef CONFIG_CRYPTO
244int crypto_has_alg(const char *name, u32 type, u32 mask); 221int crypto_has_alg(const char *name, u32 type, u32 mask);
245#else 222#else
246static inline int crypto_alg_available(const char *name, u32 flags)
247{
248 return 0;
249}
250
251static inline int crypto_has_alg(const char *name, u32 type, u32 mask) 223static inline int crypto_has_alg(const char *name, u32 type, u32 mask)
252{ 224{
253 return 0; 225 return 0;
@@ -339,13 +311,18 @@ struct crypto_tfm {
339 void *__crt_ctx[] CRYPTO_MINALIGN_ATTR; 311 void *__crt_ctx[] CRYPTO_MINALIGN_ATTR;
340}; 312};
341 313
342#define crypto_cipher crypto_tfm
343#define crypto_comp crypto_tfm
344
345struct crypto_blkcipher { 314struct crypto_blkcipher {
346 struct crypto_tfm base; 315 struct crypto_tfm base;
347}; 316};
348 317
318struct crypto_cipher {
319 struct crypto_tfm base;
320};
321
322struct crypto_comp {
323 struct crypto_tfm base;
324};
325
349struct crypto_hash { 326struct crypto_hash {
350 struct crypto_tfm base; 327 struct crypto_tfm base;
351}; 328};
@@ -395,40 +372,11 @@ static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
395 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; 372 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK;
396} 373}
397 374
398static unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm)
399 __deprecated;
400static inline unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm)
401{
402 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
403 return tfm->__crt_alg->cra_cipher.cia_min_keysize;
404}
405
406static unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm)
407 __deprecated;
408static inline unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm)
409{
410 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
411 return tfm->__crt_alg->cra_cipher.cia_max_keysize;
412}
413
414static unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm) __deprecated;
415static inline unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm)
416{
417 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
418 return tfm->crt_cipher.cit_ivsize;
419}
420
421static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm) 375static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm)
422{ 376{
423 return tfm->__crt_alg->cra_blocksize; 377 return tfm->__crt_alg->cra_blocksize;
424} 378}
425 379
426static inline unsigned int crypto_tfm_alg_digestsize(struct crypto_tfm *tfm)
427{
428 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST);
429 return tfm->__crt_alg->cra_digest.dia_digestsize;
430}
431
432static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm) 380static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm)
433{ 381{
434 return tfm->__crt_alg->cra_alignmask; 382 return tfm->__crt_alg->cra_alignmask;
@@ -633,7 +581,7 @@ static inline struct crypto_cipher *crypto_alloc_cipher(const char *alg_name,
633 581
634static inline struct crypto_tfm *crypto_cipher_tfm(struct crypto_cipher *tfm) 582static inline struct crypto_tfm *crypto_cipher_tfm(struct crypto_cipher *tfm)
635{ 583{
636 return tfm; 584 return &tfm->base;
637} 585}
638 586
639static inline void crypto_free_cipher(struct crypto_cipher *tfm) 587static inline void crypto_free_cipher(struct crypto_cipher *tfm)
@@ -809,76 +757,6 @@ static inline int crypto_hash_setkey(struct crypto_hash *hash,
809 return crypto_hash_crt(hash)->setkey(hash, key, keylen); 757 return crypto_hash_crt(hash)->setkey(hash, key, keylen);
810} 758}
811 759
812static int crypto_cipher_encrypt(struct crypto_tfm *tfm,
813 struct scatterlist *dst,
814 struct scatterlist *src,
815 unsigned int nbytes) __deprecated;
816static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm,
817 struct scatterlist *dst,
818 struct scatterlist *src,
819 unsigned int nbytes)
820{
821 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
822 return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes);
823}
824
825static int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
826 struct scatterlist *dst,
827 struct scatterlist *src,
828 unsigned int nbytes, u8 *iv) __deprecated;
829static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
830 struct scatterlist *dst,
831 struct scatterlist *src,
832 unsigned int nbytes, u8 *iv)
833{
834 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
835 return tfm->crt_cipher.cit_encrypt_iv(tfm, dst, src, nbytes, iv);
836}
837
838static int crypto_cipher_decrypt(struct crypto_tfm *tfm,
839 struct scatterlist *dst,
840 struct scatterlist *src,
841 unsigned int nbytes) __deprecated;
842static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm,
843 struct scatterlist *dst,
844 struct scatterlist *src,
845 unsigned int nbytes)
846{
847 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
848 return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes);
849}
850
851static int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
852 struct scatterlist *dst,
853 struct scatterlist *src,
854 unsigned int nbytes, u8 *iv) __deprecated;
855static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
856 struct scatterlist *dst,
857 struct scatterlist *src,
858 unsigned int nbytes, u8 *iv)
859{
860 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
861 return tfm->crt_cipher.cit_decrypt_iv(tfm, dst, src, nbytes, iv);
862}
863
864static void crypto_cipher_set_iv(struct crypto_tfm *tfm,
865 const u8 *src, unsigned int len) __deprecated;
866static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm,
867 const u8 *src, unsigned int len)
868{
869 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
870 memcpy(tfm->crt_cipher.cit_iv, src, len);
871}
872
873static void crypto_cipher_get_iv(struct crypto_tfm *tfm,
874 u8 *dst, unsigned int len) __deprecated;
875static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm,
876 u8 *dst, unsigned int len)
877{
878 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
879 memcpy(dst, tfm->crt_cipher.cit_iv, len);
880}
881
882static inline struct crypto_comp *__crypto_comp_cast(struct crypto_tfm *tfm) 760static inline struct crypto_comp *__crypto_comp_cast(struct crypto_tfm *tfm)
883{ 761{
884 return (struct crypto_comp *)tfm; 762 return (struct crypto_comp *)tfm;
@@ -903,7 +781,7 @@ static inline struct crypto_comp *crypto_alloc_comp(const char *alg_name,
903 781
904static inline struct crypto_tfm *crypto_comp_tfm(struct crypto_comp *tfm) 782static inline struct crypto_tfm *crypto_comp_tfm(struct crypto_comp *tfm)
905{ 783{
906 return tfm; 784 return &tfm->base;
907} 785}
908 786
909static inline void crypto_free_comp(struct crypto_comp *tfm) 787static inline void crypto_free_comp(struct crypto_comp *tfm)
@@ -934,14 +812,16 @@ static inline int crypto_comp_compress(struct crypto_comp *tfm,
934 const u8 *src, unsigned int slen, 812 const u8 *src, unsigned int slen,
935 u8 *dst, unsigned int *dlen) 813 u8 *dst, unsigned int *dlen)
936{ 814{
937 return crypto_comp_crt(tfm)->cot_compress(tfm, src, slen, dst, dlen); 815 return crypto_comp_crt(tfm)->cot_compress(crypto_comp_tfm(tfm),
816 src, slen, dst, dlen);
938} 817}
939 818
940static inline int crypto_comp_decompress(struct crypto_comp *tfm, 819static inline int crypto_comp_decompress(struct crypto_comp *tfm,
941 const u8 *src, unsigned int slen, 820 const u8 *src, unsigned int slen,
942 u8 *dst, unsigned int *dlen) 821 u8 *dst, unsigned int *dlen)
943{ 822{
944 return crypto_comp_crt(tfm)->cot_decompress(tfm, src, slen, dst, dlen); 823 return crypto_comp_crt(tfm)->cot_decompress(crypto_comp_tfm(tfm),
824 src, slen, dst, dlen);
945} 825}
946 826
947#endif /* _LINUX_CRYPTO_H */ 827#endif /* _LINUX_CRYPTO_H */
diff --git a/include/linux/device.h b/include/linux/device.h
index f44247fe8135..26e4692f2d1a 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -126,6 +126,7 @@ struct device_driver {
126 struct klist_node knode_bus; 126 struct klist_node knode_bus;
127 127
128 struct module * owner; 128 struct module * owner;
129 const char * mod_name; /* used for built-in modules */
129 130
130 int (*probe) (struct device * dev); 131 int (*probe) (struct device * dev);
131 int (*remove) (struct device * dev); 132 int (*remove) (struct device * dev);
@@ -327,6 +328,13 @@ extern struct class_device *class_device_create(struct class *cls,
327 __attribute__((format(printf,5,6))); 328 __attribute__((format(printf,5,6)));
328extern void class_device_destroy(struct class *cls, dev_t devt); 329extern void class_device_destroy(struct class *cls, dev_t devt);
329 330
331struct device_type {
332 struct device_attribute *attrs;
333 int (*uevent)(struct device *dev, char **envp, int num_envp,
334 char *buffer, int buffer_size);
335 void (*release)(struct device *dev);
336};
337
330/* interface for exporting device attributes */ 338/* interface for exporting device attributes */
331struct device_attribute { 339struct device_attribute {
332 struct attribute attr; 340 struct attribute attr;
@@ -346,6 +354,41 @@ extern int __must_check device_create_bin_file(struct device *dev,
346 struct bin_attribute *attr); 354 struct bin_attribute *attr);
347extern void device_remove_bin_file(struct device *dev, 355extern void device_remove_bin_file(struct device *dev,
348 struct bin_attribute *attr); 356 struct bin_attribute *attr);
357
358/* device resource management */
359typedef void (*dr_release_t)(struct device *dev, void *res);
360typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
361
362#ifdef CONFIG_DEBUG_DEVRES
363extern void * __devres_alloc(dr_release_t release, size_t size, gfp_t gfp,
364 const char *name);
365#define devres_alloc(release, size, gfp) \
366 __devres_alloc(release, size, gfp, #release)
367#else
368extern void * devres_alloc(dr_release_t release, size_t size, gfp_t gfp);
369#endif
370extern void devres_free(void *res);
371extern void devres_add(struct device *dev, void *res);
372extern void * devres_find(struct device *dev, dr_release_t release,
373 dr_match_t match, void *match_data);
374extern void * devres_get(struct device *dev, void *new_res,
375 dr_match_t match, void *match_data);
376extern void * devres_remove(struct device *dev, dr_release_t release,
377 dr_match_t match, void *match_data);
378extern int devres_destroy(struct device *dev, dr_release_t release,
379 dr_match_t match, void *match_data);
380
381/* devres group */
382extern void * __must_check devres_open_group(struct device *dev, void *id,
383 gfp_t gfp);
384extern void devres_close_group(struct device *dev, void *id);
385extern void devres_remove_group(struct device *dev, void *id);
386extern int devres_release_group(struct device *dev, void *id);
387
388/* managed kzalloc/kfree for device drivers, no kmalloc, always use kzalloc */
389extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp);
390extern void devm_kfree(struct device *dev, void *p);
391
349struct device { 392struct device {
350 struct klist klist_children; 393 struct klist klist_children;
351 struct klist_node knode_parent; /* node in sibling list */ 394 struct klist_node knode_parent; /* node in sibling list */
@@ -355,6 +398,7 @@ struct device {
355 398
356 struct kobject kobj; 399 struct kobject kobj;
357 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 400 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
401 struct device_type *type;
358 unsigned is_registered:1; 402 unsigned is_registered:1;
359 struct device_attribute uevent_attr; 403 struct device_attribute uevent_attr;
360 struct device_attribute *devt_attr; 404 struct device_attribute *devt_attr;
@@ -388,11 +432,15 @@ struct device {
388 /* arch specific additions */ 432 /* arch specific additions */
389 struct dev_archdata archdata; 433 struct dev_archdata archdata;
390 434
435 spinlock_t devres_lock;
436 struct list_head devres_head;
437
391 /* class_device migration path */ 438 /* class_device migration path */
392 struct list_head node; 439 struct list_head node;
393 struct class *class; /* optional*/ 440 struct class *class;
394 dev_t devt; /* dev_t, creates the sysfs "dev" */ 441 dev_t devt; /* dev_t, creates the sysfs "dev" */
395 struct attribute_group **groups; /* optional groups */ 442 struct attribute_group **groups; /* optional groups */
443 int uevent_suppress;
396 444
397 void (*release)(struct device * dev); 445 void (*release)(struct device * dev);
398}; 446};
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ff203c465fed..9a663c6db16a 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -66,6 +66,33 @@ dma_mark_declared_memory_occupied(struct device *dev,
66} 66}
67#endif 67#endif
68 68
69#endif 69/*
70 * Managed DMA API
71 */
72extern void *dmam_alloc_coherent(struct device *dev, size_t size,
73 dma_addr_t *dma_handle, gfp_t gfp);
74extern void dmam_free_coherent(struct device *dev, size_t size, void *vaddr,
75 dma_addr_t dma_handle);
76extern void *dmam_alloc_noncoherent(struct device *dev, size_t size,
77 dma_addr_t *dma_handle, gfp_t gfp);
78extern void dmam_free_noncoherent(struct device *dev, size_t size, void *vaddr,
79 dma_addr_t dma_handle);
80#ifdef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
81extern int dmam_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
82 dma_addr_t device_addr, size_t size,
83 int flags);
84extern void dmam_release_declared_memory(struct device *dev);
85#else /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */
86static inline int dmam_declare_coherent_memory(struct device *dev,
87 dma_addr_t bus_addr, dma_addr_t device_addr,
88 size_t size, gfp_t gfp)
89{
90 return 0;
91}
70 92
93static inline void dmam_release_declared_memory(struct device *dev)
94{
95}
96#endif /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */
71 97
98#endif
diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h
index 76f12f46db7f..022e34fcbd1b 100644
--- a/include/linux/dmapool.h
+++ b/include/linux/dmapool.h
@@ -24,5 +24,12 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
24 24
25void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr); 25void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr);
26 26
27/*
28 * Managed DMA pool
29 */
30struct dma_pool *dmam_pool_create(const char *name, struct device *dev,
31 size_t size, size_t align, size_t allocation);
32void dmam_pool_destroy(struct dma_pool *pool);
33
27#endif 34#endif
28 35
diff --git a/include/linux/dn.h b/include/linux/dn.h
index 10b6a6fd5837..02bba040fcfb 100644
--- a/include/linux/dn.h
+++ b/include/linux/dn.h
@@ -113,7 +113,7 @@ struct accessdata_dn
113 * DECnet logical link information structure 113 * DECnet logical link information structure
114 */ 114 */
115struct linkinfo_dn { 115struct linkinfo_dn {
116 __le16 idn_segsize; /* Segment size for link */ 116 __u16 idn_segsize; /* Segment size for link */
117 __u8 idn_linkstate; /* Logical link state */ 117 __u8 idn_linkstate; /* Logical link state */
118}; 118};
119 119
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index 278ef4495819..dfed8009ebff 100644
--- a/include/linux/efs_fs.h
+++ b/include/linux/efs_fs.h
@@ -36,7 +36,7 @@ static inline struct efs_sb_info *SUPER_INFO(struct super_block *sb)
36 36
37struct statfs; 37struct statfs;
38 38
39extern struct inode_operations efs_dir_inode_operations; 39extern const struct inode_operations efs_dir_inode_operations;
40extern const struct file_operations efs_dir_operations; 40extern const struct file_operations efs_dir_operations;
41extern const struct address_space_operations efs_symlink_aops; 41extern const struct address_space_operations efs_symlink_aops;
42 42
diff --git a/include/linux/eisa.h b/include/linux/eisa.h
index 1ff7c1392525..fe806b6f030d 100644
--- a/include/linux/eisa.h
+++ b/include/linux/eisa.h
@@ -61,10 +61,20 @@ struct eisa_driver {
61 61
62#define to_eisa_driver(drv) container_of(drv,struct eisa_driver, driver) 62#define to_eisa_driver(drv) container_of(drv,struct eisa_driver, driver)
63 63
64/* These external functions are only available when EISA support is enabled. */
65#ifdef CONFIG_EISA
66
64extern struct bus_type eisa_bus_type; 67extern struct bus_type eisa_bus_type;
65int eisa_driver_register (struct eisa_driver *edrv); 68int eisa_driver_register (struct eisa_driver *edrv);
66void eisa_driver_unregister (struct eisa_driver *edrv); 69void eisa_driver_unregister (struct eisa_driver *edrv);
67 70
71#else /* !CONFIG_EISA */
72
73static inline int eisa_driver_register (struct eisa_driver *edrv) { return 0; }
74static inline void eisa_driver_unregister (struct eisa_driver *edrv) { }
75
76#endif /* !CONFIG_EISA */
77
68/* Mimics pci.h... */ 78/* Mimics pci.h... */
69static inline void *eisa_get_drvdata (struct eisa_device *edev) 79static inline void *eisa_get_drvdata (struct eisa_device *edev)
70{ 80{
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 11cca1bdc0c7..4eb18ac510ae 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -868,16 +868,16 @@ do { \
868extern const struct file_operations ext3_dir_operations; 868extern const struct file_operations ext3_dir_operations;
869 869
870/* file.c */ 870/* file.c */
871extern struct inode_operations ext3_file_inode_operations; 871extern const struct inode_operations ext3_file_inode_operations;
872extern const struct file_operations ext3_file_operations; 872extern const struct file_operations ext3_file_operations;
873 873
874/* namei.c */ 874/* namei.c */
875extern struct inode_operations ext3_dir_inode_operations; 875extern const struct inode_operations ext3_dir_inode_operations;
876extern struct inode_operations ext3_special_inode_operations; 876extern const struct inode_operations ext3_special_inode_operations;
877 877
878/* symlink.c */ 878/* symlink.c */
879extern struct inode_operations ext3_symlink_inode_operations; 879extern const struct inode_operations ext3_symlink_inode_operations;
880extern struct inode_operations ext3_fast_symlink_inode_operations; 880extern const struct inode_operations ext3_fast_symlink_inode_operations;
881 881
882 882
883#endif /* __KERNEL__ */ 883#endif /* __KERNEL__ */
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index 498503ee613d..54c576d414c3 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -955,16 +955,16 @@ do { \
955extern const struct file_operations ext4_dir_operations; 955extern const struct file_operations ext4_dir_operations;
956 956
957/* file.c */ 957/* file.c */
958extern struct inode_operations ext4_file_inode_operations; 958extern const struct inode_operations ext4_file_inode_operations;
959extern const struct file_operations ext4_file_operations; 959extern const struct file_operations ext4_file_operations;
960 960
961/* namei.c */ 961/* namei.c */
962extern struct inode_operations ext4_dir_inode_operations; 962extern const struct inode_operations ext4_dir_inode_operations;
963extern struct inode_operations ext4_special_inode_operations; 963extern const struct inode_operations ext4_special_inode_operations;
964 964
965/* symlink.c */ 965/* symlink.c */
966extern struct inode_operations ext4_symlink_inode_operations; 966extern const struct inode_operations ext4_symlink_inode_operations;
967extern struct inode_operations ext4_fast_symlink_inode_operations; 967extern const struct inode_operations ext4_fast_symlink_inode_operations;
968 968
969/* extents.c */ 969/* extents.c */
970extern int ext4_ext_tree_init(handle_t *handle, struct inode *); 970extern int ext4_ext_tree_init(handle_t *handle, struct inode *);
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 64177ec9a019..a78e25683f82 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -49,6 +49,13 @@
49#define FB_AUX_TEXT_S3_MMIO 2 /* S3 MMIO fasttext */ 49#define FB_AUX_TEXT_S3_MMIO 2 /* S3 MMIO fasttext */
50#define FB_AUX_TEXT_MGA_STEP16 3 /* MGA Millenium I: text, attr, 14 reserved bytes */ 50#define FB_AUX_TEXT_MGA_STEP16 3 /* MGA Millenium I: text, attr, 14 reserved bytes */
51#define FB_AUX_TEXT_MGA_STEP8 4 /* other MGAs: text, attr, 6 reserved bytes */ 51#define FB_AUX_TEXT_MGA_STEP8 4 /* other MGAs: text, attr, 6 reserved bytes */
52#define FB_AUX_TEXT_SVGA_GROUP 8 /* 8-15: SVGA tileblit compatible modes */
53#define FB_AUX_TEXT_SVGA_MASK 7 /* lower three bits says step */
54#define FB_AUX_TEXT_SVGA_STEP2 8 /* SVGA text mode: text, attr */
55#define FB_AUX_TEXT_SVGA_STEP4 9 /* SVGA text mode: text, attr, 2 reserved bytes */
56#define FB_AUX_TEXT_SVGA_STEP8 10 /* SVGA text mode: text, attr, 6 reserved bytes */
57#define FB_AUX_TEXT_SVGA_STEP16 11 /* SVGA text mode: text, attr, 14 reserved bytes */
58#define FB_AUX_TEXT_SVGA_LAST 15 /* reserved up to 15 */
52 59
53#define FB_AUX_VGA_PLANES_VGA4 0 /* 16 color planes (EGA/VGA) */ 60#define FB_AUX_VGA_PLANES_VGA4 0 /* 16 color planes (EGA/VGA) */
54#define FB_AUX_VGA_PLANES_CFB4 1 /* CFB4 in planes (VGA) */ 61#define FB_AUX_VGA_PLANES_CFB4 1 /* CFB4 in planes (VGA) */
@@ -945,25 +952,26 @@ extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter);
945/* drivers/video/modedb.c */ 952/* drivers/video/modedb.c */
946#define VESA_MODEDB_SIZE 34 953#define VESA_MODEDB_SIZE 34
947extern void fb_var_to_videomode(struct fb_videomode *mode, 954extern void fb_var_to_videomode(struct fb_videomode *mode,
948 struct fb_var_screeninfo *var); 955 const struct fb_var_screeninfo *var);
949extern void fb_videomode_to_var(struct fb_var_screeninfo *var, 956extern void fb_videomode_to_var(struct fb_var_screeninfo *var,
950 struct fb_videomode *mode); 957 const struct fb_videomode *mode);
951extern int fb_mode_is_equal(struct fb_videomode *mode1, 958extern int fb_mode_is_equal(const struct fb_videomode *mode1,
952 struct fb_videomode *mode2); 959 const struct fb_videomode *mode2);
953extern int fb_add_videomode(struct fb_videomode *mode, struct list_head *head); 960extern int fb_add_videomode(const struct fb_videomode *mode,
954extern void fb_delete_videomode(struct fb_videomode *mode, 961 struct list_head *head);
962extern void fb_delete_videomode(const struct fb_videomode *mode,
955 struct list_head *head); 963 struct list_head *head);
956extern struct fb_videomode *fb_match_mode(struct fb_var_screeninfo *var, 964extern const struct fb_videomode *fb_match_mode(const struct fb_var_screeninfo *var,
957 struct list_head *head); 965 struct list_head *head);
958extern struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var, 966extern const struct fb_videomode *fb_find_best_mode(const struct fb_var_screeninfo *var,
959 struct list_head *head); 967 struct list_head *head);
960extern struct fb_videomode *fb_find_nearest_mode(struct fb_videomode *mode, 968extern const struct fb_videomode *fb_find_nearest_mode(const struct fb_videomode *mode,
961 struct list_head *head); 969 struct list_head *head);
962extern void fb_destroy_modelist(struct list_head *head); 970extern void fb_destroy_modelist(struct list_head *head);
963extern void fb_videomode_to_modelist(struct fb_videomode *modedb, int num, 971extern void fb_videomode_to_modelist(const struct fb_videomode *modedb, int num,
964 struct list_head *head); 972 struct list_head *head);
965extern struct fb_videomode *fb_find_best_display(struct fb_monspecs *specs, 973extern const struct fb_videomode *fb_find_best_display(const struct fb_monspecs *specs,
966 struct list_head *head); 974 struct list_head *head);
967 975
968/* drivers/video/fbcmap.c */ 976/* drivers/video/fbcmap.c */
969extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); 977extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 1410e5330c8d..86ec3f4a7da6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -169,6 +169,7 @@ extern int dir_notify_enable;
169#define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \ 169#define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
170 ((inode)->i_flags & (S_SYNC|S_DIRSYNC))) 170 ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
171#define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK) 171#define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK)
172#define IS_NOATIME(inode) __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
172 173
173#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) 174#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA)
174#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) 175#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
@@ -550,7 +551,7 @@ struct inode {
550 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 551 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
551 struct mutex i_mutex; 552 struct mutex i_mutex;
552 struct rw_semaphore i_alloc_sem; 553 struct rw_semaphore i_alloc_sem;
553 struct inode_operations *i_op; 554 const struct inode_operations *i_op;
554 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 555 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
555 struct super_block *i_sb; 556 struct super_block *i_sb;
556 struct file_lock *i_flock; 557 struct file_lock *i_flock;
@@ -906,7 +907,7 @@ struct super_block {
906 unsigned char s_dirt; 907 unsigned char s_dirt;
907 unsigned long long s_maxbytes; /* Max file size */ 908 unsigned long long s_maxbytes; /* Max file size */
908 struct file_system_type *s_type; 909 struct file_system_type *s_type;
909 struct super_operations *s_op; 910 const struct super_operations *s_op;
910 struct dquot_operations *dq_op; 911 struct dquot_operations *dq_op;
911 struct quotactl_ops *s_qcop; 912 struct quotactl_ops *s_qcop;
912 struct export_operations *s_export_op; 913 struct export_operations *s_export_op;
@@ -1382,7 +1383,7 @@ struct super_block *sget(struct file_system_type *type,
1382 int (*set)(struct super_block *,void *), 1383 int (*set)(struct super_block *,void *),
1383 void *data); 1384 void *data);
1384extern int get_sb_pseudo(struct file_system_type *, char *, 1385extern int get_sb_pseudo(struct file_system_type *, char *,
1385 struct super_operations *ops, unsigned long, 1386 const struct super_operations *ops, unsigned long,
1386 struct vfsmount *mnt); 1387 struct vfsmount *mnt);
1387extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); 1388extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1388int __put_super(struct super_block *sb); 1389int __put_super(struct super_block *sb);
@@ -1572,12 +1573,18 @@ extern int invalidate_partition(struct gendisk *, int);
1572extern int invalidate_inodes(struct super_block *); 1573extern int invalidate_inodes(struct super_block *);
1573unsigned long invalidate_mapping_pages(struct address_space *mapping, 1574unsigned long invalidate_mapping_pages(struct address_space *mapping,
1574 pgoff_t start, pgoff_t end); 1575 pgoff_t start, pgoff_t end);
1575unsigned long invalidate_inode_pages(struct address_space *mapping); 1576
1577static inline unsigned long __deprecated
1578invalidate_inode_pages(struct address_space *mapping)
1579{
1580 return invalidate_mapping_pages(mapping, 0, ~0UL);
1581}
1582
1576static inline void invalidate_remote_inode(struct inode *inode) 1583static inline void invalidate_remote_inode(struct inode *inode)
1577{ 1584{
1578 if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || 1585 if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
1579 S_ISLNK(inode->i_mode)) 1586 S_ISLNK(inode->i_mode))
1580 invalidate_inode_pages(inode->i_mapping); 1587 invalidate_mapping_pages(inode->i_mapping, 0, -1);
1581} 1588}
1582extern int invalidate_inode_pages2(struct address_space *mapping); 1589extern int invalidate_inode_pages2(struct address_space *mapping);
1583extern int invalidate_inode_pages2_range(struct address_space *mapping, 1590extern int invalidate_inode_pages2_range(struct address_space *mapping,
@@ -1681,7 +1688,6 @@ extern struct inode *new_inode(struct super_block *);
1681extern int __remove_suid(struct dentry *, int); 1688extern int __remove_suid(struct dentry *, int);
1682extern int should_remove_suid(struct dentry *); 1689extern int should_remove_suid(struct dentry *);
1683extern int remove_suid(struct dentry *); 1690extern int remove_suid(struct dentry *);
1684extern void remove_dquot_ref(struct super_block *, int, struct list_head *);
1685 1691
1686extern void __insert_inode_hash(struct inode *, unsigned long hashval); 1692extern void __insert_inode_hash(struct inode *, unsigned long hashval);
1687extern void remove_inode_hash(struct inode *); 1693extern void remove_inode_hash(struct inode *);
@@ -1822,7 +1828,7 @@ extern void page_put_link(struct dentry *, struct nameidata *, void *);
1822extern int __page_symlink(struct inode *inode, const char *symname, int len, 1828extern int __page_symlink(struct inode *inode, const char *symname, int len,
1823 gfp_t gfp_mask); 1829 gfp_t gfp_mask);
1824extern int page_symlink(struct inode *inode, const char *symname, int len); 1830extern int page_symlink(struct inode *inode, const char *symname, int len);
1825extern struct inode_operations page_symlink_inode_operations; 1831extern const struct inode_operations page_symlink_inode_operations;
1826extern int generic_readlink(struct dentry *, char __user *, int); 1832extern int generic_readlink(struct dentry *, char __user *, int);
1827extern void generic_fillattr(struct inode *, struct kstat *); 1833extern void generic_fillattr(struct inode *, struct kstat *);
1828extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 1834extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
@@ -1867,7 +1873,7 @@ extern int simple_commit_write(struct file *file, struct page *page,
1867extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); 1873extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
1868extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); 1874extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
1869extern const struct file_operations simple_dir_operations; 1875extern const struct file_operations simple_dir_operations;
1870extern struct inode_operations simple_dir_inode_operations; 1876extern const struct inode_operations simple_dir_inode_operations;
1871struct tree_descr { char *name; const struct file_operations *ops; int mode; }; 1877struct tree_descr { char *name; const struct file_operations *ops; int mode; };
1872struct dentry *d_alloc_name(struct dentry *, const char *); 1878struct dentry *d_alloc_name(struct dentry *, const char *);
1873extern int simple_fill_super(struct super_block *, int, struct tree_descr *); 1879extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 0a022b2f63fc..2c65da7cabb2 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -20,7 +20,11 @@ enum {
20 LINUX_EXTENDED_PARTITION = 0x85, 20 LINUX_EXTENDED_PARTITION = 0x85,
21 WIN98_EXTENDED_PARTITION = 0x0f, 21 WIN98_EXTENDED_PARTITION = 0x0f,
22 22
23 SUN_WHOLE_DISK = DOS_EXTENDED_PARTITION,
24
23 LINUX_SWAP_PARTITION = 0x82, 25 LINUX_SWAP_PARTITION = 0x82,
26 LINUX_DATA_PARTITION = 0x83,
27 LINUX_LVM_PARTITION = 0x8e,
24 LINUX_RAID_PARTITION = 0xfd, /* autodetect RAID partition */ 28 LINUX_RAID_PARTITION = 0xfd, /* autodetect RAID partition */
25 29
26 SOLARIS_X86_PARTITION = LINUX_SWAP_PARTITION, 30 SOLARIS_X86_PARTITION = LINUX_SWAP_PARTITION,
@@ -400,10 +404,14 @@ struct unixware_disklabel {
400 404
401#ifdef __KERNEL__ 405#ifdef __KERNEL__
402 406
407#define ADDPART_FLAG_NONE 0
408#define ADDPART_FLAG_RAID 1
409#define ADDPART_FLAG_WHOLEDISK 2
410
403char *disk_name (struct gendisk *hd, int part, char *buf); 411char *disk_name (struct gendisk *hd, int part, char *buf);
404 412
405extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); 413extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev);
406extern void add_partition(struct gendisk *, int, sector_t, sector_t); 414extern void add_partition(struct gendisk *, int, sector_t, sector_t, int);
407extern void delete_partition(struct gendisk *, int); 415extern void delete_partition(struct gendisk *, int);
408 416
409extern struct gendisk *alloc_disk_node(int minors, int node_id); 417extern struct gendisk *alloc_disk_node(int minors, int node_id);
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 00c314aedab7..2a7d15bcde46 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -70,7 +70,7 @@ struct vm_area_struct;
70#ifdef CONFIG_NUMA 70#ifdef CONFIG_NUMA
71#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) 71#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
72#else 72#else
73#define GFP_THISNODE 0 73#define GFP_THISNODE ((__force gfp_t)0)
74#endif 74#endif
75 75
76 76
@@ -85,8 +85,10 @@ struct vm_area_struct;
85 85
86static inline enum zone_type gfp_zone(gfp_t flags) 86static inline enum zone_type gfp_zone(gfp_t flags)
87{ 87{
88#ifdef CONFIG_ZONE_DMA
88 if (flags & __GFP_DMA) 89 if (flags & __GFP_DMA)
89 return ZONE_DMA; 90 return ZONE_DMA;
91#endif
90#ifdef CONFIG_ZONE_DMA32 92#ifdef CONFIG_ZONE_DMA32
91 if (flags & __GFP_DMA32) 93 if (flags & __GFP_DMA32)
92 return ZONE_DMA32; 94 return ZONE_DMA32;
diff --git a/include/linux/gigaset_dev.h b/include/linux/gigaset_dev.h
index 70ad09c8ad1e..5dc4a316ca37 100644
--- a/include/linux/gigaset_dev.h
+++ b/include/linux/gigaset_dev.h
@@ -9,8 +9,6 @@
9 * published by the Free Software Foundation; either version 2 of 9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * ===================================================================== 11 * =====================================================================
12 * Version: $Id: gigaset_dev.h,v 1.4.4.4 2005/11/21 22:28:09 hjlipp Exp $
13 * =====================================================================
14 */ 12 */
15 13
16#ifndef GIGASET_INTERFACE_H 14#ifndef GIGASET_INTERFACE_H
diff --git a/include/linux/hid-debug.h b/include/linux/hid-debug.h
index 8e4dbb51fc70..50d568ec178a 100644
--- a/include/linux/hid-debug.h
+++ b/include/linux/hid-debug.h
@@ -1,10 +1,8 @@
1#ifndef __HID_DEBUG_H
2#define __HID_DEBUG_H
3
1/* 4/*
2 * $Id: hid-debug.h,v 1.8 2001/09/25 09:37:57 vojtech Exp $ 5 * Copyright (c) 2007 Jiri Kosina
3 *
4 * (c) 1999 Andreas Gal <gal@cs.uni-magdeburg.de>
5 * (c) 2000-2001 Vojtech Pavlik <vojtech@ucw.cz>
6 *
7 * Some debug stuff for the HID parser.
8 */ 6 */
9 7
10/* 8/*
@@ -22,737 +20,26 @@
22 * along with this program; if not, write to the Free Software 20 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * 22 *
25 * Should you need to contact me, the author, you can do so either by
26 * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
27 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
28 */ 23 */
29 24
30#include <linux/input.h> 25#ifdef CONFIG_HID_DEBUG
31
32struct hid_usage_entry {
33 unsigned page;
34 unsigned usage;
35 char *description;
36};
37
38static const struct hid_usage_entry hid_usage_table[] = {
39 { 0, 0, "Undefined" },
40 { 1, 0, "GenericDesktop" },
41 {0, 0x01, "Pointer"},
42 {0, 0x02, "Mouse"},
43 {0, 0x04, "Joystick"},
44 {0, 0x05, "GamePad"},
45 {0, 0x06, "Keyboard"},
46 {0, 0x07, "Keypad"},
47 {0, 0x08, "MultiAxis"},
48 {0, 0x30, "X"},
49 {0, 0x31, "Y"},
50 {0, 0x32, "Z"},
51 {0, 0x33, "Rx"},
52 {0, 0x34, "Ry"},
53 {0, 0x35, "Rz"},
54 {0, 0x36, "Slider"},
55 {0, 0x37, "Dial"},
56 {0, 0x38, "Wheel"},
57 {0, 0x39, "HatSwitch"},
58 {0, 0x3a, "CountedBuffer"},
59 {0, 0x3b, "ByteCount"},
60 {0, 0x3c, "MotionWakeup"},
61 {0, 0x3d, "Start"},
62 {0, 0x3e, "Select"},
63 {0, 0x40, "Vx"},
64 {0, 0x41, "Vy"},
65 {0, 0x42, "Vz"},
66 {0, 0x43, "Vbrx"},
67 {0, 0x44, "Vbry"},
68 {0, 0x45, "Vbrz"},
69 {0, 0x46, "Vno"},
70 {0, 0x80, "SystemControl"},
71 {0, 0x81, "SystemPowerDown"},
72 {0, 0x82, "SystemSleep"},
73 {0, 0x83, "SystemWakeUp"},
74 {0, 0x84, "SystemContextMenu"},
75 {0, 0x85, "SystemMainMenu"},
76 {0, 0x86, "SystemAppMenu"},
77 {0, 0x87, "SystemMenuHelp"},
78 {0, 0x88, "SystemMenuExit"},
79 {0, 0x89, "SystemMenuSelect"},
80 {0, 0x8a, "SystemMenuRight"},
81 {0, 0x8b, "SystemMenuLeft"},
82 {0, 0x8c, "SystemMenuUp"},
83 {0, 0x8d, "SystemMenuDown"},
84 {0, 0x90, "D-PadUp"},
85 {0, 0x91, "D-PadDown"},
86 {0, 0x92, "D-PadRight"},
87 {0, 0x93, "D-PadLeft"},
88 { 2, 0, "Simulation" },
89 {0, 0xb0, "Aileron"},
90 {0, 0xb1, "AileronTrim"},
91 {0, 0xb2, "Anti-Torque"},
92 {0, 0xb3, "Autopilot"},
93 {0, 0xb4, "Chaff"},
94 {0, 0xb5, "Collective"},
95 {0, 0xb6, "DiveBrake"},
96 {0, 0xb7, "ElectronicCountermeasures"},
97 {0, 0xb8, "Elevator"},
98 {0, 0xb9, "ElevatorTrim"},
99 {0, 0xba, "Rudder"},
100 {0, 0xbb, "Throttle"},
101 {0, 0xbc, "FlightCommunications"},
102 {0, 0xbd, "FlareRelease"},
103 {0, 0xbe, "LandingGear"},
104 {0, 0xbf, "ToeBrake"},
105 { 7, 0, "Keyboard" },
106 { 8, 0, "LED" },
107 {0, 0x01, "NumLock"},
108 {0, 0x02, "CapsLock"},
109 {0, 0x03, "ScrollLock"},
110 {0, 0x04, "Compose"},
111 {0, 0x05, "Kana"},
112 {0, 0x4b, "GenericIndicator"},
113 { 9, 0, "Button" },
114 { 10, 0, "Ordinal" },
115 { 12, 0, "Consumer" },
116 {0, 0x238, "HorizontalWheel"},
117 { 13, 0, "Digitizers" },
118 {0, 0x01, "Digitizer"},
119 {0, 0x02, "Pen"},
120 {0, 0x03, "LightPen"},
121 {0, 0x04, "TouchScreen"},
122 {0, 0x05, "TouchPad"},
123 {0, 0x20, "Stylus"},
124 {0, 0x21, "Puck"},
125 {0, 0x22, "Finger"},
126 {0, 0x30, "TipPressure"},
127 {0, 0x31, "BarrelPressure"},
128 {0, 0x32, "InRange"},
129 {0, 0x33, "Touch"},
130 {0, 0x34, "UnTouch"},
131 {0, 0x35, "Tap"},
132 {0, 0x39, "TabletFunctionKey"},
133 {0, 0x3a, "ProgramChangeKey"},
134 {0, 0x3c, "Invert"},
135 {0, 0x42, "TipSwitch"},
136 {0, 0x43, "SecondaryTipSwitch"},
137 {0, 0x44, "BarrelSwitch"},
138 {0, 0x45, "Eraser"},
139 {0, 0x46, "TabletPick"},
140 { 15, 0, "PhysicalInterfaceDevice" },
141 {0, 0x00, "Undefined"},
142 {0, 0x01, "Physical_Interface_Device"},
143 {0, 0x20, "Normal"},
144 {0, 0x21, "Set_Effect_Report"},
145 {0, 0x22, "Effect_Block_Index"},
146 {0, 0x23, "Parameter_Block_Offset"},
147 {0, 0x24, "ROM_Flag"},
148 {0, 0x25, "Effect_Type"},
149 {0, 0x26, "ET_Constant_Force"},
150 {0, 0x27, "ET_Ramp"},
151 {0, 0x28, "ET_Custom_Force_Data"},
152 {0, 0x30, "ET_Square"},
153 {0, 0x31, "ET_Sine"},
154 {0, 0x32, "ET_Triangle"},
155 {0, 0x33, "ET_Sawtooth_Up"},
156 {0, 0x34, "ET_Sawtooth_Down"},
157 {0, 0x40, "ET_Spring"},
158 {0, 0x41, "ET_Damper"},
159 {0, 0x42, "ET_Inertia"},
160 {0, 0x43, "ET_Friction"},
161 {0, 0x50, "Duration"},
162 {0, 0x51, "Sample_Period"},
163 {0, 0x52, "Gain"},
164 {0, 0x53, "Trigger_Button"},
165 {0, 0x54, "Trigger_Repeat_Interval"},
166 {0, 0x55, "Axes_Enable"},
167 {0, 0x56, "Direction_Enable"},
168 {0, 0x57, "Direction"},
169 {0, 0x58, "Type_Specific_Block_Offset"},
170 {0, 0x59, "Block_Type"},
171 {0, 0x5A, "Set_Envelope_Report"},
172 {0, 0x5B, "Attack_Level"},
173 {0, 0x5C, "Attack_Time"},
174 {0, 0x5D, "Fade_Level"},
175 {0, 0x5E, "Fade_Time"},
176 {0, 0x5F, "Set_Condition_Report"},
177 {0, 0x60, "CP_Offset"},
178 {0, 0x61, "Positive_Coefficient"},
179 {0, 0x62, "Negative_Coefficient"},
180 {0, 0x63, "Positive_Saturation"},
181 {0, 0x64, "Negative_Saturation"},
182 {0, 0x65, "Dead_Band"},
183 {0, 0x66, "Download_Force_Sample"},
184 {0, 0x67, "Isoch_Custom_Force_Enable"},
185 {0, 0x68, "Custom_Force_Data_Report"},
186 {0, 0x69, "Custom_Force_Data"},
187 {0, 0x6A, "Custom_Force_Vendor_Defined_Data"},
188 {0, 0x6B, "Set_Custom_Force_Report"},
189 {0, 0x6C, "Custom_Force_Data_Offset"},
190 {0, 0x6D, "Sample_Count"},
191 {0, 0x6E, "Set_Periodic_Report"},
192 {0, 0x6F, "Offset"},
193 {0, 0x70, "Magnitude"},
194 {0, 0x71, "Phase"},
195 {0, 0x72, "Period"},
196 {0, 0x73, "Set_Constant_Force_Report"},
197 {0, 0x74, "Set_Ramp_Force_Report"},
198 {0, 0x75, "Ramp_Start"},
199 {0, 0x76, "Ramp_End"},
200 {0, 0x77, "Effect_Operation_Report"},
201 {0, 0x78, "Effect_Operation"},
202 {0, 0x79, "Op_Effect_Start"},
203 {0, 0x7A, "Op_Effect_Start_Solo"},
204 {0, 0x7B, "Op_Effect_Stop"},
205 {0, 0x7C, "Loop_Count"},
206 {0, 0x7D, "Device_Gain_Report"},
207 {0, 0x7E, "Device_Gain"},
208 {0, 0x7F, "PID_Pool_Report"},
209 {0, 0x80, "RAM_Pool_Size"},
210 {0, 0x81, "ROM_Pool_Size"},
211 {0, 0x82, "ROM_Effect_Block_Count"},
212 {0, 0x83, "Simultaneous_Effects_Max"},
213 {0, 0x84, "Pool_Alignment"},
214 {0, 0x85, "PID_Pool_Move_Report"},
215 {0, 0x86, "Move_Source"},
216 {0, 0x87, "Move_Destination"},
217 {0, 0x88, "Move_Length"},
218 {0, 0x89, "PID_Block_Load_Report"},
219 {0, 0x8B, "Block_Load_Status"},
220 {0, 0x8C, "Block_Load_Success"},
221 {0, 0x8D, "Block_Load_Full"},
222 {0, 0x8E, "Block_Load_Error"},
223 {0, 0x8F, "Block_Handle"},
224 {0, 0x90, "PID_Block_Free_Report"},
225 {0, 0x91, "Type_Specific_Block_Handle"},
226 {0, 0x92, "PID_State_Report"},
227 {0, 0x94, "Effect_Playing"},
228 {0, 0x95, "PID_Device_Control_Report"},
229 {0, 0x96, "PID_Device_Control"},
230 {0, 0x97, "DC_Enable_Actuators"},
231 {0, 0x98, "DC_Disable_Actuators"},
232 {0, 0x99, "DC_Stop_All_Effects"},
233 {0, 0x9A, "DC_Device_Reset"},
234 {0, 0x9B, "DC_Device_Pause"},
235 {0, 0x9C, "DC_Device_Continue"},
236 {0, 0x9F, "Device_Paused"},
237 {0, 0xA0, "Actuators_Enabled"},
238 {0, 0xA4, "Safety_Switch"},
239 {0, 0xA5, "Actuator_Override_Switch"},
240 {0, 0xA6, "Actuator_Power"},
241 {0, 0xA7, "Start_Delay"},
242 {0, 0xA8, "Parameter_Block_Size"},
243 {0, 0xA9, "Device_Managed_Pool"},
244 {0, 0xAA, "Shared_Parameter_Blocks"},
245 {0, 0xAB, "Create_New_Effect_Report"},
246 {0, 0xAC, "RAM_Pool_Available"},
247 { 0x84, 0, "Power Device" },
248 { 0x84, 0x02, "PresentStatus" },
249 { 0x84, 0x03, "ChangeStatus" },
250 { 0x84, 0x04, "UPS" },
251 { 0x84, 0x05, "PowerSupply" },
252 { 0x84, 0x10, "BatterySystem" },
253 { 0x84, 0x11, "BatterySystemID" },
254 { 0x84, 0x12, "Battery" },
255 { 0x84, 0x13, "BatteryID" },
256 { 0x84, 0x14, "Charger" },
257 { 0x84, 0x15, "ChargerID" },
258 { 0x84, 0x16, "PowerConverter" },
259 { 0x84, 0x17, "PowerConverterID" },
260 { 0x84, 0x18, "OutletSystem" },
261 { 0x84, 0x19, "OutletSystemID" },
262 { 0x84, 0x1a, "Input" },
263 { 0x84, 0x1b, "InputID" },
264 { 0x84, 0x1c, "Output" },
265 { 0x84, 0x1d, "OutputID" },
266 { 0x84, 0x1e, "Flow" },
267 { 0x84, 0x1f, "FlowID" },
268 { 0x84, 0x20, "Outlet" },
269 { 0x84, 0x21, "OutletID" },
270 { 0x84, 0x22, "Gang" },
271 { 0x84, 0x24, "PowerSummary" },
272 { 0x84, 0x25, "PowerSummaryID" },
273 { 0x84, 0x30, "Voltage" },
274 { 0x84, 0x31, "Current" },
275 { 0x84, 0x32, "Frequency" },
276 { 0x84, 0x33, "ApparentPower" },
277 { 0x84, 0x35, "PercentLoad" },
278 { 0x84, 0x40, "ConfigVoltage" },
279 { 0x84, 0x41, "ConfigCurrent" },
280 { 0x84, 0x43, "ConfigApparentPower" },
281 { 0x84, 0x53, "LowVoltageTransfer" },
282 { 0x84, 0x54, "HighVoltageTransfer" },
283 { 0x84, 0x56, "DelayBeforeStartup" },
284 { 0x84, 0x57, "DelayBeforeShutdown" },
285 { 0x84, 0x58, "Test" },
286 { 0x84, 0x5a, "AudibleAlarmControl" },
287 { 0x84, 0x60, "Present" },
288 { 0x84, 0x61, "Good" },
289 { 0x84, 0x62, "InternalFailure" },
290 { 0x84, 0x65, "Overload" },
291 { 0x84, 0x66, "OverCharged" },
292 { 0x84, 0x67, "OverTemperature" },
293 { 0x84, 0x68, "ShutdownRequested" },
294 { 0x84, 0x69, "ShutdownImminent" },
295 { 0x84, 0x6b, "SwitchOn/Off" },
296 { 0x84, 0x6c, "Switchable" },
297 { 0x84, 0x6d, "Used" },
298 { 0x84, 0x6e, "Boost" },
299 { 0x84, 0x73, "CommunicationLost" },
300 { 0x84, 0xfd, "iManufacturer" },
301 { 0x84, 0xfe, "iProduct" },
302 { 0x84, 0xff, "iSerialNumber" },
303 { 0x85, 0, "Battery System" },
304 { 0x85, 0x01, "SMBBatteryMode" },
305 { 0x85, 0x02, "SMBBatteryStatus" },
306 { 0x85, 0x03, "SMBAlarmWarning" },
307 { 0x85, 0x04, "SMBChargerMode" },
308 { 0x85, 0x05, "SMBChargerStatus" },
309 { 0x85, 0x06, "SMBChargerSpecInfo" },
310 { 0x85, 0x07, "SMBSelectorState" },
311 { 0x85, 0x08, "SMBSelectorPresets" },
312 { 0x85, 0x09, "SMBSelectorInfo" },
313 { 0x85, 0x29, "RemainingCapacityLimit" },
314 { 0x85, 0x2c, "CapacityMode" },
315 { 0x85, 0x42, "BelowRemainingCapacityLimit" },
316 { 0x85, 0x44, "Charging" },
317 { 0x85, 0x45, "Discharging" },
318 { 0x85, 0x4b, "NeedReplacement" },
319 { 0x85, 0x66, "RemainingCapacity" },
320 { 0x85, 0x68, "RunTimeToEmpty" },
321 { 0x85, 0x6a, "AverageTimeToFull" },
322 { 0x85, 0x83, "DesignCapacity" },
323 { 0x85, 0x85, "ManufacturerDate" },
324 { 0x85, 0x89, "iDeviceChemistry" },
325 { 0x85, 0x8b, "Rechargable" },
326 { 0x85, 0x8f, "iOEMInformation" },
327 { 0x85, 0x8d, "CapacityGranularity1" },
328 { 0x85, 0xd0, "ACPresent" },
329 /* pages 0xff00 to 0xffff are vendor-specific */
330 { 0xffff, 0, "Vendor-specific-FF" },
331 { 0, 0, NULL }
332};
333
334static void resolv_usage_page(unsigned page) {
335 const struct hid_usage_entry *p;
336
337 for (p = hid_usage_table; p->description; p++)
338 if (p->page == page) {
339 printk("%s", p->description);
340 return;
341 }
342 printk("%04x", page);
343}
344
345static void resolv_usage(unsigned usage) {
346 const struct hid_usage_entry *p;
347
348 resolv_usage_page(usage >> 16);
349 printk(".");
350 for (p = hid_usage_table; p->description; p++)
351 if (p->page == (usage >> 16)) {
352 for(++p; p->description && p->usage != 0; p++)
353 if (p->usage == (usage & 0xffff)) {
354 printk("%s", p->description);
355 return;
356 }
357 break;
358 }
359 printk("%04x", usage & 0xffff);
360}
361
362__inline__ static void tab(int n) {
363 while (n--) printk(" ");
364}
365
366static void hid_dump_field(struct hid_field *field, int n) {
367 int j;
368
369 if (field->physical) {
370 tab(n);
371 printk("Physical(");
372 resolv_usage(field->physical); printk(")\n");
373 }
374 if (field->logical) {
375 tab(n);
376 printk("Logical(");
377 resolv_usage(field->logical); printk(")\n");
378 }
379 tab(n); printk("Usage(%d)\n", field->maxusage);
380 for (j = 0; j < field->maxusage; j++) {
381 tab(n+2);resolv_usage(field->usage[j].hid); printk("\n");
382 }
383 if (field->logical_minimum != field->logical_maximum) {
384 tab(n); printk("Logical Minimum(%d)\n", field->logical_minimum);
385 tab(n); printk("Logical Maximum(%d)\n", field->logical_maximum);
386 }
387 if (field->physical_minimum != field->physical_maximum) {
388 tab(n); printk("Physical Minimum(%d)\n", field->physical_minimum);
389 tab(n); printk("Physical Maximum(%d)\n", field->physical_maximum);
390 }
391 if (field->unit_exponent) {
392 tab(n); printk("Unit Exponent(%d)\n", field->unit_exponent);
393 }
394 if (field->unit) {
395 char *systems[5] = { "None", "SI Linear", "SI Rotation", "English Linear", "English Rotation" };
396 char *units[5][8] = {
397 { "None", "None", "None", "None", "None", "None", "None", "None" },
398 { "None", "Centimeter", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" },
399 { "None", "Radians", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" },
400 { "None", "Inch", "Slug", "Seconds", "Fahrenheit", "Ampere", "Candela", "None" },
401 { "None", "Degrees", "Slug", "Seconds", "Fahrenheit", "Ampere", "Candela", "None" }
402 };
403
404 int i;
405 int sys;
406 __u32 data = field->unit;
407
408 /* First nibble tells us which system we're in. */
409 sys = data & 0xf;
410 data >>= 4;
411
412 if(sys > 4) {
413 tab(n); printk("Unit(Invalid)\n");
414 }
415 else {
416 int earlier_unit = 0;
417
418 tab(n); printk("Unit(%s : ", systems[sys]);
419
420 for (i=1 ; i<sizeof(__u32)*2 ; i++) {
421 char nibble = data & 0xf;
422 data >>= 4;
423 if (nibble != 0) {
424 if(earlier_unit++ > 0)
425 printk("*");
426 printk("%s", units[sys][i]);
427 if(nibble != 1) {
428 /* This is a _signed_ nibble(!) */
429
430 int val = nibble & 0x7;
431 if(nibble & 0x08)
432 val = -((0x7 & ~val) +1);
433 printk("^%d", val);
434 }
435 }
436 }
437 printk(")\n");
438 }
439 }
440 tab(n); printk("Report Size(%u)\n", field->report_size);
441 tab(n); printk("Report Count(%u)\n", field->report_count);
442 tab(n); printk("Report Offset(%u)\n", field->report_offset);
443
444 tab(n); printk("Flags( ");
445 j = field->flags;
446 printk("%s", HID_MAIN_ITEM_CONSTANT & j ? "Constant " : "");
447 printk("%s", HID_MAIN_ITEM_VARIABLE & j ? "Variable " : "Array ");
448 printk("%s", HID_MAIN_ITEM_RELATIVE & j ? "Relative " : "Absolute ");
449 printk("%s", HID_MAIN_ITEM_WRAP & j ? "Wrap " : "");
450 printk("%s", HID_MAIN_ITEM_NONLINEAR & j ? "NonLinear " : "");
451 printk("%s", HID_MAIN_ITEM_NO_PREFERRED & j ? "NoPrefferedState " : "");
452 printk("%s", HID_MAIN_ITEM_NULL_STATE & j ? "NullState " : "");
453 printk("%s", HID_MAIN_ITEM_VOLATILE & j ? "Volatile " : "");
454 printk("%s", HID_MAIN_ITEM_BUFFERED_BYTE & j ? "BufferedByte " : "");
455 printk(")\n");
456}
457
458static void __attribute__((unused)) hid_dump_device(struct hid_device *device) {
459 struct hid_report_enum *report_enum;
460 struct hid_report *report;
461 struct list_head *list;
462 unsigned i,k;
463 static char *table[] = {"INPUT", "OUTPUT", "FEATURE"};
464
465 for (i = 0; i < HID_REPORT_TYPES; i++) {
466 report_enum = device->report_enum + i;
467 list = report_enum->report_list.next;
468 while (list != &report_enum->report_list) {
469 report = (struct hid_report *) list;
470 tab(2);
471 printk("%s", table[i]);
472 if (report->id)
473 printk("(%d)", report->id);
474 printk("[%s]", table[report->type]);
475 printk("\n");
476 for (k = 0; k < report->maxfield; k++) {
477 tab(4);
478 printk("Field(%d)\n", k);
479 hid_dump_field(report->field[k], 6);
480 }
481 list = list->next;
482 }
483 }
484}
485
486static void __attribute__((unused)) hid_dump_input(struct hid_usage *usage, __s32 value) {
487 printk("hid-debug: input ");
488 resolv_usage(usage->hid);
489 printk(" = %d\n", value);
490}
491
492
493static char *events[EV_MAX + 1] = {
494 [EV_SYN] = "Sync", [EV_KEY] = "Key",
495 [EV_REL] = "Relative", [EV_ABS] = "Absolute",
496 [EV_MSC] = "Misc", [EV_LED] = "LED",
497 [EV_SND] = "Sound", [EV_REP] = "Repeat",
498 [EV_FF] = "ForceFeedback", [EV_PWR] = "Power",
499 [EV_FF_STATUS] = "ForceFeedbackStatus",
500};
501
502static char *syncs[2] = {
503 [SYN_REPORT] = "Report", [SYN_CONFIG] = "Config",
504};
505static char *keys[KEY_MAX + 1] = {
506 [KEY_RESERVED] = "Reserved", [KEY_ESC] = "Esc",
507 [KEY_1] = "1", [KEY_2] = "2",
508 [KEY_3] = "3", [KEY_4] = "4",
509 [KEY_5] = "5", [KEY_6] = "6",
510 [KEY_7] = "7", [KEY_8] = "8",
511 [KEY_9] = "9", [KEY_0] = "0",
512 [KEY_MINUS] = "Minus", [KEY_EQUAL] = "Equal",
513 [KEY_BACKSPACE] = "Backspace", [KEY_TAB] = "Tab",
514 [KEY_Q] = "Q", [KEY_W] = "W",
515 [KEY_E] = "E", [KEY_R] = "R",
516 [KEY_T] = "T", [KEY_Y] = "Y",
517 [KEY_U] = "U", [KEY_I] = "I",
518 [KEY_O] = "O", [KEY_P] = "P",
519 [KEY_LEFTBRACE] = "LeftBrace", [KEY_RIGHTBRACE] = "RightBrace",
520 [KEY_ENTER] = "Enter", [KEY_LEFTCTRL] = "LeftControl",
521 [KEY_A] = "A", [KEY_S] = "S",
522 [KEY_D] = "D", [KEY_F] = "F",
523 [KEY_G] = "G", [KEY_H] = "H",
524 [KEY_J] = "J", [KEY_K] = "K",
525 [KEY_L] = "L", [KEY_SEMICOLON] = "Semicolon",
526 [KEY_APOSTROPHE] = "Apostrophe", [KEY_GRAVE] = "Grave",
527 [KEY_LEFTSHIFT] = "LeftShift", [KEY_BACKSLASH] = "BackSlash",
528 [KEY_Z] = "Z", [KEY_X] = "X",
529 [KEY_C] = "C", [KEY_V] = "V",
530 [KEY_B] = "B", [KEY_N] = "N",
531 [KEY_M] = "M", [KEY_COMMA] = "Comma",
532 [KEY_DOT] = "Dot", [KEY_SLASH] = "Slash",
533 [KEY_RIGHTSHIFT] = "RightShift", [KEY_KPASTERISK] = "KPAsterisk",
534 [KEY_LEFTALT] = "LeftAlt", [KEY_SPACE] = "Space",
535 [KEY_CAPSLOCK] = "CapsLock", [KEY_F1] = "F1",
536 [KEY_F2] = "F2", [KEY_F3] = "F3",
537 [KEY_F4] = "F4", [KEY_F5] = "F5",
538 [KEY_F6] = "F6", [KEY_F7] = "F7",
539 [KEY_F8] = "F8", [KEY_F9] = "F9",
540 [KEY_F10] = "F10", [KEY_NUMLOCK] = "NumLock",
541 [KEY_SCROLLLOCK] = "ScrollLock", [KEY_KP7] = "KP7",
542 [KEY_KP8] = "KP8", [KEY_KP9] = "KP9",
543 [KEY_KPMINUS] = "KPMinus", [KEY_KP4] = "KP4",
544 [KEY_KP5] = "KP5", [KEY_KP6] = "KP6",
545 [KEY_KPPLUS] = "KPPlus", [KEY_KP1] = "KP1",
546 [KEY_KP2] = "KP2", [KEY_KP3] = "KP3",
547 [KEY_KP0] = "KP0", [KEY_KPDOT] = "KPDot",
548 [KEY_ZENKAKUHANKAKU] = "Zenkaku/Hankaku", [KEY_102ND] = "102nd",
549 [KEY_F11] = "F11", [KEY_F12] = "F12",
550 [KEY_RO] = "RO", [KEY_KATAKANA] = "Katakana",
551 [KEY_HIRAGANA] = "HIRAGANA", [KEY_HENKAN] = "Henkan",
552 [KEY_KATAKANAHIRAGANA] = "Katakana/Hiragana", [KEY_MUHENKAN] = "Muhenkan",
553 [KEY_KPJPCOMMA] = "KPJpComma", [KEY_KPENTER] = "KPEnter",
554 [KEY_RIGHTCTRL] = "RightCtrl", [KEY_KPSLASH] = "KPSlash",
555 [KEY_SYSRQ] = "SysRq", [KEY_RIGHTALT] = "RightAlt",
556 [KEY_LINEFEED] = "LineFeed", [KEY_HOME] = "Home",
557 [KEY_UP] = "Up", [KEY_PAGEUP] = "PageUp",
558 [KEY_LEFT] = "Left", [KEY_RIGHT] = "Right",
559 [KEY_END] = "End", [KEY_DOWN] = "Down",
560 [KEY_PAGEDOWN] = "PageDown", [KEY_INSERT] = "Insert",
561 [KEY_DELETE] = "Delete", [KEY_MACRO] = "Macro",
562 [KEY_MUTE] = "Mute", [KEY_VOLUMEDOWN] = "VolumeDown",
563 [KEY_VOLUMEUP] = "VolumeUp", [KEY_POWER] = "Power",
564 [KEY_KPEQUAL] = "KPEqual", [KEY_KPPLUSMINUS] = "KPPlusMinus",
565 [KEY_PAUSE] = "Pause", [KEY_KPCOMMA] = "KPComma",
566 [KEY_HANGUEL] = "Hangeul", [KEY_HANJA] = "Hanja",
567 [KEY_YEN] = "Yen", [KEY_LEFTMETA] = "LeftMeta",
568 [KEY_RIGHTMETA] = "RightMeta", [KEY_COMPOSE] = "Compose",
569 [KEY_STOP] = "Stop", [KEY_AGAIN] = "Again",
570 [KEY_PROPS] = "Props", [KEY_UNDO] = "Undo",
571 [KEY_FRONT] = "Front", [KEY_COPY] = "Copy",
572 [KEY_OPEN] = "Open", [KEY_PASTE] = "Paste",
573 [KEY_FIND] = "Find", [KEY_CUT] = "Cut",
574 [KEY_HELP] = "Help", [KEY_MENU] = "Menu",
575 [KEY_CALC] = "Calc", [KEY_SETUP] = "Setup",
576 [KEY_SLEEP] = "Sleep", [KEY_WAKEUP] = "WakeUp",
577 [KEY_FILE] = "File", [KEY_SENDFILE] = "SendFile",
578 [KEY_DELETEFILE] = "DeleteFile", [KEY_XFER] = "X-fer",
579 [KEY_PROG1] = "Prog1", [KEY_PROG2] = "Prog2",
580 [KEY_WWW] = "WWW", [KEY_MSDOS] = "MSDOS",
581 [KEY_COFFEE] = "Coffee", [KEY_DIRECTION] = "Direction",
582 [KEY_CYCLEWINDOWS] = "CycleWindows", [KEY_MAIL] = "Mail",
583 [KEY_BOOKMARKS] = "Bookmarks", [KEY_COMPUTER] = "Computer",
584 [KEY_BACK] = "Back", [KEY_FORWARD] = "Forward",
585 [KEY_CLOSECD] = "CloseCD", [KEY_EJECTCD] = "EjectCD",
586 [KEY_EJECTCLOSECD] = "EjectCloseCD", [KEY_NEXTSONG] = "NextSong",
587 [KEY_PLAYPAUSE] = "PlayPause", [KEY_PREVIOUSSONG] = "PreviousSong",
588 [KEY_STOPCD] = "StopCD", [KEY_RECORD] = "Record",
589 [KEY_REWIND] = "Rewind", [KEY_PHONE] = "Phone",
590 [KEY_ISO] = "ISOKey", [KEY_CONFIG] = "Config",
591 [KEY_HOMEPAGE] = "HomePage", [KEY_REFRESH] = "Refresh",
592 [KEY_EXIT] = "Exit", [KEY_MOVE] = "Move",
593 [KEY_EDIT] = "Edit", [KEY_SCROLLUP] = "ScrollUp",
594 [KEY_SCROLLDOWN] = "ScrollDown", [KEY_KPLEFTPAREN] = "KPLeftParenthesis",
595 [KEY_KPRIGHTPAREN] = "KPRightParenthesis", [KEY_NEW] = "New",
596 [KEY_REDO] = "Redo", [KEY_F13] = "F13",
597 [KEY_F14] = "F14", [KEY_F15] = "F15",
598 [KEY_F16] = "F16", [KEY_F17] = "F17",
599 [KEY_F18] = "F18", [KEY_F19] = "F19",
600 [KEY_F20] = "F20", [KEY_F21] = "F21",
601 [KEY_F22] = "F22", [KEY_F23] = "F23",
602 [KEY_F24] = "F24", [KEY_PLAYCD] = "PlayCD",
603 [KEY_PAUSECD] = "PauseCD", [KEY_PROG3] = "Prog3",
604 [KEY_PROG4] = "Prog4", [KEY_SUSPEND] = "Suspend",
605 [KEY_CLOSE] = "Close", [KEY_PLAY] = "Play",
606 [KEY_FASTFORWARD] = "FastForward", [KEY_BASSBOOST] = "BassBoost",
607 [KEY_PRINT] = "Print", [KEY_HP] = "HP",
608 [KEY_CAMERA] = "Camera", [KEY_SOUND] = "Sound",
609 [KEY_QUESTION] = "Question", [KEY_EMAIL] = "Email",
610 [KEY_CHAT] = "Chat", [KEY_SEARCH] = "Search",
611 [KEY_CONNECT] = "Connect", [KEY_FINANCE] = "Finance",
612 [KEY_SPORT] = "Sport", [KEY_SHOP] = "Shop",
613 [KEY_ALTERASE] = "AlternateErase", [KEY_CANCEL] = "Cancel",
614 [KEY_BRIGHTNESSDOWN] = "BrightnessDown", [KEY_BRIGHTNESSUP] = "BrightnessUp",
615 [KEY_MEDIA] = "Media", [KEY_UNKNOWN] = "Unknown",
616 [BTN_0] = "Btn0", [BTN_1] = "Btn1",
617 [BTN_2] = "Btn2", [BTN_3] = "Btn3",
618 [BTN_4] = "Btn4", [BTN_5] = "Btn5",
619 [BTN_6] = "Btn6", [BTN_7] = "Btn7",
620 [BTN_8] = "Btn8", [BTN_9] = "Btn9",
621 [BTN_LEFT] = "LeftBtn", [BTN_RIGHT] = "RightBtn",
622 [BTN_MIDDLE] = "MiddleBtn", [BTN_SIDE] = "SideBtn",
623 [BTN_EXTRA] = "ExtraBtn", [BTN_FORWARD] = "ForwardBtn",
624 [BTN_BACK] = "BackBtn", [BTN_TASK] = "TaskBtn",
625 [BTN_TRIGGER] = "Trigger", [BTN_THUMB] = "ThumbBtn",
626 [BTN_THUMB2] = "ThumbBtn2", [BTN_TOP] = "TopBtn",
627 [BTN_TOP2] = "TopBtn2", [BTN_PINKIE] = "PinkieBtn",
628 [BTN_BASE] = "BaseBtn", [BTN_BASE2] = "BaseBtn2",
629 [BTN_BASE3] = "BaseBtn3", [BTN_BASE4] = "BaseBtn4",
630 [BTN_BASE5] = "BaseBtn5", [BTN_BASE6] = "BaseBtn6",
631 [BTN_DEAD] = "BtnDead", [BTN_A] = "BtnA",
632 [BTN_B] = "BtnB", [BTN_C] = "BtnC",
633 [BTN_X] = "BtnX", [BTN_Y] = "BtnY",
634 [BTN_Z] = "BtnZ", [BTN_TL] = "BtnTL",
635 [BTN_TR] = "BtnTR", [BTN_TL2] = "BtnTL2",
636 [BTN_TR2] = "BtnTR2", [BTN_SELECT] = "BtnSelect",
637 [BTN_START] = "BtnStart", [BTN_MODE] = "BtnMode",
638 [BTN_THUMBL] = "BtnThumbL", [BTN_THUMBR] = "BtnThumbR",
639 [BTN_TOOL_PEN] = "ToolPen", [BTN_TOOL_RUBBER] = "ToolRubber",
640 [BTN_TOOL_BRUSH] = "ToolBrush", [BTN_TOOL_PENCIL] = "ToolPencil",
641 [BTN_TOOL_AIRBRUSH] = "ToolAirbrush", [BTN_TOOL_FINGER] = "ToolFinger",
642 [BTN_TOOL_MOUSE] = "ToolMouse", [BTN_TOOL_LENS] = "ToolLens",
643 [BTN_TOUCH] = "Touch", [BTN_STYLUS] = "Stylus",
644 [BTN_STYLUS2] = "Stylus2", [BTN_TOOL_DOUBLETAP] = "ToolDoubleTap",
645 [BTN_TOOL_TRIPLETAP] = "ToolTripleTap", [BTN_GEAR_DOWN] = "WheelBtn",
646 [BTN_GEAR_UP] = "Gear up", [KEY_OK] = "Ok",
647 [KEY_SELECT] = "Select", [KEY_GOTO] = "Goto",
648 [KEY_CLEAR] = "Clear", [KEY_POWER2] = "Power2",
649 [KEY_OPTION] = "Option", [KEY_INFO] = "Info",
650 [KEY_TIME] = "Time", [KEY_VENDOR] = "Vendor",
651 [KEY_ARCHIVE] = "Archive", [KEY_PROGRAM] = "Program",
652 [KEY_CHANNEL] = "Channel", [KEY_FAVORITES] = "Favorites",
653 [KEY_EPG] = "EPG", [KEY_PVR] = "PVR",
654 [KEY_MHP] = "MHP", [KEY_LANGUAGE] = "Language",
655 [KEY_TITLE] = "Title", [KEY_SUBTITLE] = "Subtitle",
656 [KEY_ANGLE] = "Angle", [KEY_ZOOM] = "Zoom",
657 [KEY_MODE] = "Mode", [KEY_KEYBOARD] = "Keyboard",
658 [KEY_SCREEN] = "Screen", [KEY_PC] = "PC",
659 [KEY_TV] = "TV", [KEY_TV2] = "TV2",
660 [KEY_VCR] = "VCR", [KEY_VCR2] = "VCR2",
661 [KEY_SAT] = "Sat", [KEY_SAT2] = "Sat2",
662 [KEY_CD] = "CD", [KEY_TAPE] = "Tape",
663 [KEY_RADIO] = "Radio", [KEY_TUNER] = "Tuner",
664 [KEY_PLAYER] = "Player", [KEY_TEXT] = "Text",
665 [KEY_DVD] = "DVD", [KEY_AUX] = "Aux",
666 [KEY_MP3] = "MP3", [KEY_AUDIO] = "Audio",
667 [KEY_VIDEO] = "Video", [KEY_DIRECTORY] = "Directory",
668 [KEY_LIST] = "List", [KEY_MEMO] = "Memo",
669 [KEY_CALENDAR] = "Calendar", [KEY_RED] = "Red",
670 [KEY_GREEN] = "Green", [KEY_YELLOW] = "Yellow",
671 [KEY_BLUE] = "Blue", [KEY_CHANNELUP] = "ChannelUp",
672 [KEY_CHANNELDOWN] = "ChannelDown", [KEY_FIRST] = "First",
673 [KEY_LAST] = "Last", [KEY_AB] = "AB",
674 [KEY_NEXT] = "Next", [KEY_RESTART] = "Restart",
675 [KEY_SLOW] = "Slow", [KEY_SHUFFLE] = "Shuffle",
676 [KEY_BREAK] = "Break", [KEY_PREVIOUS] = "Previous",
677 [KEY_DIGITS] = "Digits", [KEY_TEEN] = "TEEN",
678 [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "DeleteEOL",
679 [KEY_DEL_EOS] = "DeleteEOS", [KEY_INS_LINE] = "InsertLine",
680 [KEY_DEL_LINE] = "DeleteLine",
681 [KEY_SEND] = "Send", [KEY_REPLY] = "Reply",
682 [KEY_FORWARDMAIL] = "ForwardMail", [KEY_SAVE] = "Save",
683 [KEY_DOCUMENTS] = "Documents",
684 [KEY_FN] = "Fn", [KEY_FN_ESC] = "Fn+ESC",
685 [KEY_FN_1] = "Fn+1", [KEY_FN_2] = "Fn+2",
686 [KEY_FN_B] = "Fn+B", [KEY_FN_D] = "Fn+D",
687 [KEY_FN_E] = "Fn+E", [KEY_FN_F] = "Fn+F",
688 [KEY_FN_S] = "Fn+S",
689 [KEY_FN_F1] = "Fn+F1", [KEY_FN_F2] = "Fn+F2",
690 [KEY_FN_F3] = "Fn+F3", [KEY_FN_F4] = "Fn+F4",
691 [KEY_FN_F5] = "Fn+F5", [KEY_FN_F6] = "Fn+F6",
692 [KEY_FN_F7] = "Fn+F7", [KEY_FN_F8] = "Fn+F8",
693 [KEY_FN_F9] = "Fn+F9", [KEY_FN_F10] = "Fn+F10",
694 [KEY_FN_F11] = "Fn+F11", [KEY_FN_F12] = "Fn+F12",
695 [KEY_KBDILLUMTOGGLE] = "KbdIlluminationToggle",
696 [KEY_KBDILLUMDOWN] = "KbdIlluminationDown",
697 [KEY_KBDILLUMUP] = "KbdIlluminationUp",
698 [KEY_SWITCHVIDEOMODE] = "SwitchVideoMode",
699};
700
701static char *relatives[REL_MAX + 1] = {
702 [REL_X] = "X", [REL_Y] = "Y",
703 [REL_Z] = "Z", [REL_RX] = "Rx",
704 [REL_RY] = "Ry", [REL_RZ] = "Rz",
705 [REL_HWHEEL] = "HWheel", [REL_DIAL] = "Dial",
706 [REL_WHEEL] = "Wheel", [REL_MISC] = "Misc",
707};
708
709static char *absolutes[ABS_MAX + 1] = {
710 [ABS_X] = "X", [ABS_Y] = "Y",
711 [ABS_Z] = "Z", [ABS_RX] = "Rx",
712 [ABS_RY] = "Ry", [ABS_RZ] = "Rz",
713 [ABS_THROTTLE] = "Throttle", [ABS_RUDDER] = "Rudder",
714 [ABS_WHEEL] = "Wheel", [ABS_GAS] = "Gas",
715 [ABS_BRAKE] = "Brake", [ABS_HAT0X] = "Hat0X",
716 [ABS_HAT0Y] = "Hat0Y", [ABS_HAT1X] = "Hat1X",
717 [ABS_HAT1Y] = "Hat1Y", [ABS_HAT2X] = "Hat2X",
718 [ABS_HAT2Y] = "Hat2Y", [ABS_HAT3X] = "Hat3X",
719 [ABS_HAT3Y] = "Hat 3Y", [ABS_PRESSURE] = "Pressure",
720 [ABS_DISTANCE] = "Distance", [ABS_TILT_X] = "XTilt",
721 [ABS_TILT_Y] = "YTilt", [ABS_TOOL_WIDTH] = "Tool Width",
722 [ABS_VOLUME] = "Volume", [ABS_MISC] = "Misc",
723};
724 26
725static char *misc[MSC_MAX + 1] = { 27void hid_dump_input(struct hid_usage *, __s32);
726 [MSC_SERIAL] = "Serial", [MSC_PULSELED] = "Pulseled", 28void hid_dump_device(struct hid_device *);
727 [MSC_GESTURE] = "Gesture", [MSC_RAW] = "RawData" 29void hid_dump_field(struct hid_field *, int);
728}; 30void hid_resolv_usage(unsigned);
31void hid_resolv_event(__u8, __u16);
729 32
730static char *leds[LED_MAX + 1] = { 33#else
731 [LED_NUML] = "NumLock", [LED_CAPSL] = "CapsLock",
732 [LED_SCROLLL] = "ScrollLock", [LED_COMPOSE] = "Compose",
733 [LED_KANA] = "Kana", [LED_SLEEP] = "Sleep",
734 [LED_SUSPEND] = "Suspend", [LED_MUTE] = "Mute",
735 [LED_MISC] = "Misc",
736};
737 34
738static char *repeats[REP_MAX + 1] = { 35#define hid_dump_input(a,b) do { } while (0)
739 [REP_DELAY] = "Delay", [REP_PERIOD] = "Period" 36#define hid_dump_device(c) do { } while (0)
740}; 37#define hid_dump_field(a,b) do { } while (0)
38#define hid_resolv_usage(a) do { } while (0)
39#define hid_resolv_event(a,b) do { } while (0)
741 40
742static char *sounds[SND_MAX + 1] = { 41#endif /* CONFIG_HID_DEBUG */
743 [SND_CLICK] = "Click", [SND_BELL] = "Bell",
744 [SND_TONE] = "Tone"
745};
746 42
747static char **names[EV_MAX + 1] = {
748 [EV_SYN] = syncs, [EV_KEY] = keys,
749 [EV_REL] = relatives, [EV_ABS] = absolutes,
750 [EV_MSC] = misc, [EV_LED] = leds,
751 [EV_SND] = sounds, [EV_REP] = repeats,
752};
753 43
754static void __attribute__((unused)) resolv_event(__u8 type, __u16 code) { 44#endif
755 45
756 printk("%s.%s", events[type] ? events[type] : "?",
757 names[type] ? (names[type][code] ? names[type][code] : "?") : "?");
758}
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 342b4e639acb..d26b08f461f2 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -264,6 +264,9 @@ struct hid_item {
264#define HID_QUIRK_INVERT_HWHEEL 0x00004000 264#define HID_QUIRK_INVERT_HWHEEL 0x00004000
265#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000 265#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000
266#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000 266#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000
267#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00020000
268#define HID_QUIRK_IGNORE_MOUSE 0x00040000
269#define HID_QUIRK_SONY_PS3_CONTROLLER 0x00080000
267 270
268/* 271/*
269 * This is the global environment of the parser. This information is 272 * This is the global environment of the parser. This information is
@@ -430,8 +433,8 @@ struct hid_device { /* device report descriptor */
430 433
431 /* device-specific function pointers */ 434 /* device-specific function pointers */
432 int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int); 435 int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int);
433 int (*hidinput_open) (struct input_dev *); 436 int (*hid_open) (struct hid_device *);
434 void (*hidinput_close) (struct input_dev *); 437 void (*hid_close) (struct hid_device *);
435 438
436 /* hiddev event handler */ 439 /* hiddev event handler */
437 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, 440 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
@@ -471,16 +474,6 @@ struct hid_descriptor {
471 struct hid_class_descriptor desc[1]; 474 struct hid_class_descriptor desc[1];
472} __attribute__ ((packed)); 475} __attribute__ ((packed));
473 476
474#ifdef DEBUG
475#include "hid-debug.h"
476#else
477#define hid_dump_input(a,b) do { } while (0)
478#define hid_dump_device(c) do { } while (0)
479#define hid_dump_field(a,b) do { } while (0)
480#define resolv_usage(a) do { } while (0)
481#define resolv_event(a,b) do { } while (0)
482#endif
483
484/* Applications from HID Usage Tables 4/8/99 Version 1.1 */ 477/* Applications from HID Usage Tables 4/8/99 Version 1.1 */
485/* We ignore a few input applications that are not widely used */ 478/* We ignore a few input applications that are not widely used */
486#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) 479#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001))
@@ -503,6 +496,7 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size);
503int hid_ff_init(struct hid_device *hid); 496int hid_ff_init(struct hid_device *hid);
504 497
505int hid_lgff_init(struct hid_device *hid); 498int hid_lgff_init(struct hid_device *hid);
499int hid_plff_init(struct hid_device *hid);
506int hid_tmff_init(struct hid_device *hid); 500int hid_tmff_init(struct hid_device *hid);
507int hid_zpff_init(struct hid_device *hid); 501int hid_zpff_init(struct hid_device *hid);
508#ifdef CONFIG_HID_PID 502#ifdef CONFIG_HID_PID
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index d38778f2fbec..6e7ec4c76178 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -115,6 +115,8 @@
115#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ 115#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */
116#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ 116#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
117#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */ 117#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */
118#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */
119#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */
118 120
119#define I2C_DRIVERID_I2CDEV 900 121#define I2C_DRIVERID_I2CDEV 900
120#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ 122#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index e26a03981a94..04e0fa97ac99 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -18,6 +18,9 @@
18#include <linux/device.h> 18#include <linux/device.h>
19#include <linux/pci.h> 19#include <linux/pci.h>
20#include <linux/completion.h> 20#include <linux/completion.h>
21#ifdef CONFIG_BLK_DEV_IDEACPI
22#include <acpi/acpi.h>
23#endif
21#include <asm/byteorder.h> 24#include <asm/byteorder.h>
22#include <asm/system.h> 25#include <asm/system.h>
23#include <asm/io.h> 26#include <asm/io.h>
@@ -541,6 +544,11 @@ typedef enum {
541struct ide_driver_s; 544struct ide_driver_s;
542struct ide_settings_s; 545struct ide_settings_s;
543 546
547#ifdef CONFIG_BLK_DEV_IDEACPI
548struct ide_acpi_drive_link;
549struct ide_acpi_hwif_link;
550#endif
551
544typedef struct ide_drive_s { 552typedef struct ide_drive_s {
545 char name[4]; /* drive name, such as "hda" */ 553 char name[4]; /* drive name, such as "hda" */
546 char driver_req[10]; /* requests specific driver */ 554 char driver_req[10]; /* requests specific driver */
@@ -637,6 +645,9 @@ typedef struct ide_drive_s {
637 645
638 int lun; /* logical unit */ 646 int lun; /* logical unit */
639 int crc_count; /* crc counter to reduce drive speed */ 647 int crc_count; /* crc counter to reduce drive speed */
648#ifdef CONFIG_BLK_DEV_IDEACPI
649 struct ide_acpi_drive_link *acpidata;
650#endif
640 struct list_head list; 651 struct list_head list;
641 struct device gendev; 652 struct device gendev;
642 struct completion gendev_rel_comp; /* to deal with device release() */ 653 struct completion gendev_rel_comp; /* to deal with device release() */
@@ -804,6 +815,10 @@ typedef struct hwif_s {
804 void *hwif_data; /* extra hwif data */ 815 void *hwif_data; /* extra hwif data */
805 816
806 unsigned dma; 817 unsigned dma;
818
819#ifdef CONFIG_BLK_DEV_IDEACPI
820 struct ide_acpi_hwif_link *acpidata;
821#endif
807} ____cacheline_internodealigned_in_smp ide_hwif_t; 822} ____cacheline_internodealigned_in_smp ide_hwif_t;
808 823
809/* 824/*
@@ -1192,8 +1207,8 @@ void ide_init_disk(struct gendisk *, ide_drive_t *);
1192extern int ideprobe_init(void); 1207extern int ideprobe_init(void);
1193 1208
1194extern void ide_scan_pcibus(int scan_direction) __init; 1209extern void ide_scan_pcibus(int scan_direction) __init;
1195extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner); 1210extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name);
1196#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE) 1211#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE, KBUILD_MODNAME)
1197void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); 1212void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *);
1198extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); 1213extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d);
1199 1214
@@ -1298,6 +1313,18 @@ static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
1298static inline void ide_release_dma(ide_hwif_t *drive) {;} 1313static inline void ide_release_dma(ide_hwif_t *drive) {;}
1299#endif 1314#endif
1300 1315
1316#ifdef CONFIG_BLK_DEV_IDEACPI
1317extern int ide_acpi_exec_tfs(ide_drive_t *drive);
1318extern void ide_acpi_get_timing(ide_hwif_t *hwif);
1319extern void ide_acpi_push_timing(ide_hwif_t *hwif);
1320extern void ide_acpi_init(ide_hwif_t *hwif);
1321#else
1322static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; }
1323static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; }
1324static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; }
1325static inline void ide_acpi_init(ide_hwif_t *hwif) { ; }
1326#endif
1327
1301extern int ide_hwif_request_regions(ide_hwif_t *hwif); 1328extern int ide_hwif_request_regions(ide_hwif_t *hwif);
1302extern void ide_hwif_release_regions(ide_hwif_t* hwif); 1329extern void ide_hwif_release_regions(ide_hwif_t* hwif);
1303extern void ide_unregister (unsigned int index); 1330extern void ide_unregister (unsigned int index);
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index 99393ef3af39..f3de05c30678 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -41,6 +41,7 @@ struct sockaddr_ll
41#define PACKET_RX_RING 5 41#define PACKET_RX_RING 5
42#define PACKET_STATISTICS 6 42#define PACKET_STATISTICS 6
43#define PACKET_COPY_THRESH 7 43#define PACKET_COPY_THRESH 7
44#define PACKET_AUXDATA 8
44 45
45struct tpacket_stats 46struct tpacket_stats
46{ 47{
@@ -48,6 +49,15 @@ struct tpacket_stats
48 unsigned int tp_drops; 49 unsigned int tp_drops;
49}; 50};
50 51
52struct tpacket_auxdata
53{
54 __u32 tp_status;
55 __u32 tp_len;
56 __u32 tp_snaplen;
57 __u16 tp_mac;
58 __u16 tp_net;
59};
60
51struct tpacket_hdr 61struct tpacket_hdr
52{ 62{
53 unsigned long tp_status; 63 unsigned long tp_status;
diff --git a/include/linux/init.h b/include/linux/init.h
index 5a593a1dec1e..e290a010e3f2 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -67,7 +67,8 @@ extern initcall_t __con_initcall_start[], __con_initcall_end[];
67extern initcall_t __security_initcall_start[], __security_initcall_end[]; 67extern initcall_t __security_initcall_start[], __security_initcall_end[];
68 68
69/* Defined in init/main.c */ 69/* Defined in init/main.c */
70extern char saved_command_line[]; 70extern char __initdata boot_command_line[];
71extern char *saved_command_line;
71extern unsigned int reset_devices; 72extern unsigned int reset_devices;
72 73
73/* used by init/main.c */ 74/* used by init/main.c */
@@ -164,7 +165,7 @@ struct obs_kernel_param {
164#define early_param(str, fn) \ 165#define early_param(str, fn) \
165 __setup_param(str, fn, fn, 1) 166 __setup_param(str, fn, fn, 1)
166 167
167/* Relies on saved_command_line being set */ 168/* Relies on boot_command_line being set */
168void __init parse_early_param(void); 169void __init parse_early_param(void);
169#endif /* __ASSEMBLY__ */ 170#endif /* __ASSEMBLY__ */
170 171
@@ -172,7 +173,7 @@ void __init parse_early_param(void);
172 * module_init() - driver initialization entry point 173 * module_init() - driver initialization entry point
173 * @x: function to be run at kernel boot time or module insertion 174 * @x: function to be run at kernel boot time or module insertion
174 * 175 *
175 * module_init() will either be called during do_initcalls (if 176 * module_init() will either be called during do_initcalls() (if
176 * builtin) or at module insertion time (if a module). There can only 177 * builtin) or at module insertion time (if a module). There can only
177 * be one per module. 178 * be one per module.
178 */ 179 */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 6383d2d83bb0..a2d95ff50e9b 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -66,7 +66,7 @@
66 .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ 66 .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \
67 .rlim = INIT_RLIMITS, \ 67 .rlim = INIT_RLIMITS, \
68 .pgrp = 1, \ 68 .pgrp = 1, \
69 .tty_old_pgrp = 0, \ 69 .tty_old_pgrp = NULL, \
70 { .__session = 1}, \ 70 { .__session = 1}, \
71} 71}
72 72
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index e36e86c869fb..5a8ba0b8ccba 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -12,6 +12,7 @@
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/irqflags.h> 13#include <linux/irqflags.h>
14#include <linux/bottom_half.h> 14#include <linux/bottom_half.h>
15#include <linux/device.h>
15#include <asm/atomic.h> 16#include <asm/atomic.h>
16#include <asm/ptrace.h> 17#include <asm/ptrace.h>
17#include <asm/system.h> 18#include <asm/system.h>
@@ -83,6 +84,11 @@ extern int request_irq(unsigned int, irq_handler_t handler,
83 unsigned long, const char *, void *); 84 unsigned long, const char *, void *);
84extern void free_irq(unsigned int, void *); 85extern void free_irq(unsigned int, void *);
85 86
87extern int devm_request_irq(struct device *dev, unsigned int irq,
88 irq_handler_t handler, unsigned long irqflags,
89 const char *devname, void *dev_id);
90extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
91
86/* 92/*
87 * On lockdep we dont want to enable hardirqs in hardirq 93 * On lockdep we dont want to enable hardirqs in hardirq
88 * context. Use local_irq_enable_in_hardirq() to annotate 94 * context. Use local_irq_enable_in_hardirq() to annotate
diff --git a/include/linux/io.h b/include/linux/io.h
index 81877ea39309..c244a0cc9319 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -22,12 +22,27 @@
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/page.h> 23#include <asm/page.h>
24 24
25struct device;
26
25void __iowrite32_copy(void __iomem *to, const void *from, size_t count); 27void __iowrite32_copy(void __iomem *to, const void *from, size_t count);
26void __iowrite64_copy(void __iomem *to, const void *from, size_t count); 28void __iowrite64_copy(void __iomem *to, const void *from, size_t count);
27 29
28int ioremap_page_range(unsigned long addr, unsigned long end, 30int ioremap_page_range(unsigned long addr, unsigned long end,
29 unsigned long phys_addr, pgprot_t prot); 31 unsigned long phys_addr, pgprot_t prot);
30 32
33/*
34 * Managed iomap interface
35 */
36void __iomem * devm_ioport_map(struct device *dev, unsigned long port,
37 unsigned int nr);
38void devm_ioport_unmap(struct device *dev, void __iomem *addr);
39
40void __iomem * devm_ioremap(struct device *dev, unsigned long offset,
41 unsigned long size);
42void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset,
43 unsigned long size);
44void devm_iounmap(struct device *dev, void __iomem *addr);
45
31/** 46/**
32 * check_signature - find BIOS signatures 47 * check_signature - find BIOS signatures
33 * @io_addr: mmio address to check 48 * @io_addr: mmio address to check
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 15228d79c5bc..6859a3b14088 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -137,4 +137,24 @@ static inline int __deprecated check_region(resource_size_t s,
137{ 137{
138 return __check_region(&ioport_resource, s, n); 138 return __check_region(&ioport_resource, s, n);
139} 139}
140
141/* Wrappers for managed devices */
142struct device;
143#define devm_request_region(dev,start,n,name) \
144 __devm_request_region(dev, &ioport_resource, (start), (n), (name))
145#define devm_request_mem_region(dev,start,n,name) \
146 __devm_request_region(dev, &iomem_resource, (start), (n), (name))
147
148extern struct resource * __devm_request_region(struct device *dev,
149 struct resource *parent, resource_size_t start,
150 resource_size_t n, const char *name);
151
152#define devm_release_region(start,n) \
153 __devm_release_region(dev, &ioport_resource, (start), (n))
154#define devm_release_mem_region(start,n) \
155 __devm_release_region(dev, &iomem_resource, (start), (n))
156
157extern void __devm_release_region(struct device *dev, struct resource *parent,
158 resource_size_t start, resource_size_t n);
159
140#endif /* _LINUX_IOPORT_H */ 160#endif /* _LINUX_IOPORT_H */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 52fc4052a0ae..5504b671357f 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -68,6 +68,7 @@ typedef void fastcall (*irq_flow_handler_t)(unsigned int irq,
68#define IRQ_MOVE_PENDING 0x40000000 /* need to re-target IRQ destination */ 68#define IRQ_MOVE_PENDING 0x40000000 /* need to re-target IRQ destination */
69 69
70struct proc_dir_entry; 70struct proc_dir_entry;
71struct msi_desc;
71 72
72/** 73/**
73 * struct irq_chip - hardware interrupt chip descriptor 74 * struct irq_chip - hardware interrupt chip descriptor
@@ -148,6 +149,7 @@ struct irq_chip {
148struct irq_desc { 149struct irq_desc {
149 irq_flow_handler_t handle_irq; 150 irq_flow_handler_t handle_irq;
150 struct irq_chip *chip; 151 struct irq_chip *chip;
152 struct msi_desc *msi_desc;
151 void *handler_data; 153 void *handler_data;
152 void *chip_data; 154 void *chip_data;
153 struct irqaction *action; /* IRQ action list */ 155 struct irqaction *action; /* IRQ action list */
@@ -373,10 +375,12 @@ extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
373extern int set_irq_data(unsigned int irq, void *data); 375extern int set_irq_data(unsigned int irq, void *data);
374extern int set_irq_chip_data(unsigned int irq, void *data); 376extern int set_irq_chip_data(unsigned int irq, void *data);
375extern int set_irq_type(unsigned int irq, unsigned int type); 377extern int set_irq_type(unsigned int irq, unsigned int type);
378extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
376 379
377#define get_irq_chip(irq) (irq_desc[irq].chip) 380#define get_irq_chip(irq) (irq_desc[irq].chip)
378#define get_irq_chip_data(irq) (irq_desc[irq].chip_data) 381#define get_irq_chip_data(irq) (irq_desc[irq].chip_data)
379#define get_irq_data(irq) (irq_desc[irq].handler_data) 382#define get_irq_data(irq) (irq_desc[irq].handler_data)
383#define get_irq_msi(irq) (irq_desc[irq].msi_desc)
380 384
381#endif /* CONFIG_GENERIC_HARDIRQS */ 385#endif /* CONFIG_GENERIC_HARDIRQS */
382 386
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 63fb18dcac30..9ddf25c21538 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -92,11 +92,6 @@ extern int cond_resched(void);
92 (__x < 0) ? -__x : __x; \ 92 (__x < 0) ? -__x : __x; \
93 }) 93 })
94 94
95#define labs(x) ({ \
96 long __x = (x); \
97 (__x < 0) ? -__x : __x; \
98 })
99
100extern struct atomic_notifier_head panic_notifier_list; 95extern struct atomic_notifier_head panic_notifier_list;
101extern long (*panic_blink)(long time); 96extern long (*panic_blink)(long time);
102NORET_TYPE void panic(const char * fmt, ...) 97NORET_TYPE void panic(const char * fmt, ...)
@@ -139,7 +134,8 @@ extern unsigned long long memparse(char *ptr, char **retptr);
139extern int core_kernel_text(unsigned long addr); 134extern int core_kernel_text(unsigned long addr);
140extern int __kernel_text_address(unsigned long addr); 135extern int __kernel_text_address(unsigned long addr);
141extern int kernel_text_address(unsigned long addr); 136extern int kernel_text_address(unsigned long addr);
142extern int session_of_pgrp(int pgrp); 137struct pid;
138extern struct pid *session_of_pgrp(struct pid *pgrp);
143 139
144extern void dump_thread(struct pt_regs *regs, struct user *dump); 140extern void dump_thread(struct pt_regs *regs, struct user *dump);
145 141
@@ -176,6 +172,7 @@ static inline void console_verbose(void)
176} 172}
177 173
178extern void bust_spinlocks(int yes); 174extern void bust_spinlocks(int yes);
175extern void wake_up_klogd(void);
179extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ 176extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
180extern int panic_timeout; 177extern int panic_timeout;
181extern int panic_on_oops; 178extern int panic_on_oops;
@@ -200,6 +197,7 @@ extern enum system_states {
200#define TAINT_FORCED_RMMOD (1<<3) 197#define TAINT_FORCED_RMMOD (1<<3)
201#define TAINT_MACHINE_CHECK (1<<4) 198#define TAINT_MACHINE_CHECK (1<<4)
202#define TAINT_BAD_PAGE (1<<5) 199#define TAINT_BAD_PAGE (1<<5)
200#define TAINT_USER (1<<6)
203 201
204extern void dump_stack(void); 202extern void dump_stack(void);
205 203
@@ -312,6 +310,9 @@ static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char *
312 (void)__tmp; \ 310 (void)__tmp; \
313}) 311})
314 312
313struct sysinfo;
314extern int do_sysinfo(struct sysinfo *info);
315
315#endif /* __KERNEL__ */ 316#endif /* __KERNEL__ */
316 317
317#define SI_LOAD_SHIFT 16 318#define SI_LOAD_SHIFT 16
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 48eccd865bd8..404f4464cb1a 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -74,7 +74,7 @@ static inline void kfifo_reset(struct kfifo *fifo)
74 * @buffer: the data to be added. 74 * @buffer: the data to be added.
75 * @len: the length of the data to be added. 75 * @len: the length of the data to be added.
76 * 76 *
77 * This function copies at most 'len' bytes from the 'buffer' into 77 * This function copies at most @len bytes from the @buffer into
78 * the FIFO depending on the free space, and returns the number of 78 * the FIFO depending on the free space, and returns the number of
79 * bytes copied. 79 * bytes copied.
80 */ 80 */
@@ -99,8 +99,8 @@ static inline unsigned int kfifo_put(struct kfifo *fifo,
99 * @buffer: where the data must be copied. 99 * @buffer: where the data must be copied.
100 * @len: the size of the destination buffer. 100 * @len: the size of the destination buffer.
101 * 101 *
102 * This function copies at most 'len' bytes from the FIFO into the 102 * This function copies at most @len bytes from the FIFO into the
103 * 'buffer' and returns the number of copied bytes. 103 * @buffer and returns the number of copied bytes.
104 */ 104 */
105static inline unsigned int kfifo_get(struct kfifo *fifo, 105static inline unsigned int kfifo_get(struct kfifo *fifo,
106 unsigned char *buffer, unsigned int len) 106 unsigned char *buffer, unsigned int len)
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 76538fcf2c4e..b850e0310538 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -74,9 +74,13 @@ extern void kobject_init(struct kobject *);
74extern void kobject_cleanup(struct kobject *); 74extern void kobject_cleanup(struct kobject *);
75 75
76extern int __must_check kobject_add(struct kobject *); 76extern int __must_check kobject_add(struct kobject *);
77extern int __must_check kobject_shadow_add(struct kobject *, struct dentry *);
77extern void kobject_del(struct kobject *); 78extern void kobject_del(struct kobject *);
78 79
79extern int __must_check kobject_rename(struct kobject *, const char *new_name); 80extern int __must_check kobject_rename(struct kobject *, const char *new_name);
81extern int __must_check kobject_shadow_rename(struct kobject *kobj,
82 struct dentry *new_parent,
83 const char *new_name);
80extern int __must_check kobject_move(struct kobject *, struct kobject *); 84extern int __must_check kobject_move(struct kobject *, struct kobject *);
81 85
82extern int __must_check kobject_register(struct kobject *); 86extern int __must_check kobject_register(struct kobject *);
diff --git a/include/linux/ks0108.h b/include/linux/ks0108.h
new file mode 100644
index 000000000000..8047d4b17bf1
--- /dev/null
+++ b/include/linux/ks0108.h
@@ -0,0 +1,46 @@
1/*
2 * Filename: ks0108.h
3 * Version: 0.1.0
4 * Description: ks0108 LCD Controller driver header
5 * License: GPLv2
6 *
7 * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@gmail.com>
8 * Date: 2006-10-31
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 * 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#ifndef _KS0108_H_
26#define _KS0108_H_
27
28/* Write a byte to the data port */
29extern void ks0108_writedata(unsigned char byte);
30
31/* Write a byte to the control port */
32extern void ks0108_writecontrol(unsigned char byte);
33
34/* Set the controller's current display state (0..1) */
35extern void ks0108_displaystate(unsigned char state);
36
37/* Set the controller's current startline (0..63) */
38extern void ks0108_startline(unsigned char startline);
39
40/* Set the controller's current address (0..63) */
41extern void ks0108_address(unsigned char address);
42
43/* Set the controller's current page (0..7) */
44extern void ks0108_page(unsigned char page);
45
46#endif /* _KS0108_H_ */
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 611f17f79eef..7444a6326231 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -163,7 +163,7 @@ static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs)
163 * @add1: addend1 163 * @add1: addend1
164 * @add2: addend2 164 * @add2: addend2
165 * 165 *
166 * Returns the sum of addend1 and addend2 166 * Returns the sum of @add1 and @add2.
167 */ 167 */
168static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2) 168static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2)
169{ 169{
@@ -189,7 +189,7 @@ static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2)
189 * @kt: addend 189 * @kt: addend
190 * @nsec: the scalar nsec value to add 190 * @nsec: the scalar nsec value to add
191 * 191 *
192 * Returns the sum of kt and nsec in ktime_t format 192 * Returns the sum of @kt and @nsec in ktime_t format
193 */ 193 */
194extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec); 194extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec);
195 195
@@ -246,7 +246,7 @@ static inline struct timeval ktime_to_timeval(const ktime_t kt)
246 * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds 246 * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds
247 * @kt: the ktime_t variable to convert 247 * @kt: the ktime_t variable to convert
248 * 248 *
249 * Returns the scalar nanoseconds representation of kt 249 * Returns the scalar nanoseconds representation of @kt
250 */ 250 */
251static inline s64 ktime_to_ns(const ktime_t kt) 251static inline s64 ktime_to_ns(const ktime_t kt)
252{ 252{
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 1be148f0fce4..f3604593fb76 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -11,7 +11,7 @@
11#include <asm/types.h> 11#include <asm/types.h>
12#include <linux/ioctl.h> 12#include <linux/ioctl.h>
13 13
14#define KVM_API_VERSION 2 14#define KVM_API_VERSION 3
15 15
16/* 16/*
17 * Architectural interrupt line count, and the size of the bitmap needed 17 * Architectural interrupt line count, and the size of the bitmap needed
@@ -65,6 +65,8 @@ struct kvm_run {
65 __u8 ready_for_interrupt_injection; 65 __u8 ready_for_interrupt_injection;
66 __u8 if_flag; 66 __u8 if_flag;
67 __u16 padding2; 67 __u16 padding2;
68
69 /* in (pre_kvm_run), out (post_kvm_run) */
68 __u64 cr8; 70 __u64 cr8;
69 __u64 apic_base; 71 __u64 apic_base;
70 72
@@ -185,6 +187,7 @@ struct kvm_translation {
185 __u8 valid; 187 __u8 valid;
186 __u8 writeable; 188 __u8 writeable;
187 __u8 usermode; 189 __u8 usermode;
190 __u8 pad[5];
188}; 191};
189 192
190/* for KVM_INTERRUPT */ 193/* for KVM_INTERRUPT */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 91bb8ceef0b5..596e0c18887d 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -31,7 +31,7 @@
31#include <linux/pci.h> 31#include <linux/pci.h>
32#include <linux/dma-mapping.h> 32#include <linux/dma-mapping.h>
33#include <asm/scatterlist.h> 33#include <asm/scatterlist.h>
34#include <asm/io.h> 34#include <linux/io.h>
35#include <linux/ata.h> 35#include <linux/ata.h>
36#include <linux/workqueue.h> 36#include <linux/workqueue.h>
37#include <scsi/scsi_host.h> 37#include <scsi/scsi_host.h>
@@ -54,8 +54,6 @@
54#undef ATA_VERBOSE_DEBUG /* yet more debugging output */ 54#undef ATA_VERBOSE_DEBUG /* yet more debugging output */
55#undef ATA_IRQ_TRAP /* define to ack screaming irqs */ 55#undef ATA_IRQ_TRAP /* define to ack screaming irqs */
56#undef ATA_NDEBUG /* define to disable quick runtime checks */ 56#undef ATA_NDEBUG /* define to disable quick runtime checks */
57#define ATA_ENABLE_PATA /* define to enable PATA support in some
58 * low-level drivers */
59 57
60 58
61/* note: prints function name for you */ 59/* note: prints function name for you */
@@ -109,10 +107,6 @@ static inline u32 ata_msg_init(int dval, int default_msg_enable_bits)
109#define ATA_TAG_POISON 0xfafbfcfdU 107#define ATA_TAG_POISON 0xfafbfcfdU
110 108
111/* move to PCI layer? */ 109/* move to PCI layer? */
112#define PCI_VDEVICE(vendor, device) \
113 PCI_VENDOR_ID_##vendor, (device), \
114 PCI_ANY_ID, PCI_ANY_ID, 0, 0
115
116static inline struct device *pci_dev_to_dev(struct pci_dev *pdev) 110static inline struct device *pci_dev_to_dev(struct pci_dev *pdev)
117{ 111{
118 return &pdev->dev; 112 return &pdev->dev;
@@ -308,7 +302,7 @@ enum {
308 * most devices. 302 * most devices.
309 */ 303 */
310 ATA_SPINUP_WAIT = 8000, 304 ATA_SPINUP_WAIT = 8000,
311 305
312 /* Horkage types. May be set by libata or controller on drives 306 /* Horkage types. May be set by libata or controller on drives
313 (some horkage may be drive/controller pair dependant */ 307 (some horkage may be drive/controller pair dependant */
314 308
@@ -352,21 +346,21 @@ typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes);
352typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes); 346typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes);
353 347
354struct ata_ioports { 348struct ata_ioports {
355 unsigned long cmd_addr; 349 void __iomem *cmd_addr;
356 unsigned long data_addr; 350 void __iomem *data_addr;
357 unsigned long error_addr; 351 void __iomem *error_addr;
358 unsigned long feature_addr; 352 void __iomem *feature_addr;
359 unsigned long nsect_addr; 353 void __iomem *nsect_addr;
360 unsigned long lbal_addr; 354 void __iomem *lbal_addr;
361 unsigned long lbam_addr; 355 void __iomem *lbam_addr;
362 unsigned long lbah_addr; 356 void __iomem *lbah_addr;
363 unsigned long device_addr; 357 void __iomem *device_addr;
364 unsigned long status_addr; 358 void __iomem *status_addr;
365 unsigned long command_addr; 359 void __iomem *command_addr;
366 unsigned long altstatus_addr; 360 void __iomem *altstatus_addr;
367 unsigned long ctl_addr; 361 void __iomem *ctl_addr;
368 unsigned long bmdma_addr; 362 void __iomem *bmdma_addr;
369 unsigned long scr_addr; 363 void __iomem *scr_addr;
370}; 364};
371 365
372struct ata_probe_ent { 366struct ata_probe_ent {
@@ -385,7 +379,7 @@ struct ata_probe_ent {
385 unsigned int irq_flags; 379 unsigned int irq_flags;
386 unsigned long port_flags; 380 unsigned long port_flags;
387 unsigned long _host_flags; 381 unsigned long _host_flags;
388 void __iomem *mmio_base; 382 void __iomem * const *iomap;
389 void *private_data; 383 void *private_data;
390 384
391 /* port_info for the secondary port. Together with irq2, it's 385 /* port_info for the secondary port. Together with irq2, it's
@@ -402,7 +396,7 @@ struct ata_host {
402 struct device *dev; 396 struct device *dev;
403 unsigned long irq; 397 unsigned long irq;
404 unsigned long irq2; 398 unsigned long irq2;
405 void __iomem *mmio_base; 399 void __iomem * const *iomap;
406 unsigned int n_ports; 400 unsigned int n_ports;
407 void *private_data; 401 void *private_data;
408 const struct ata_port_operations *ops; 402 const struct ata_port_operations *ops;
@@ -431,9 +425,6 @@ struct ata_queued_cmd {
431 425
432 unsigned int pad_len; 426 unsigned int pad_len;
433 427
434 unsigned int nsect;
435 unsigned int cursect;
436
437 unsigned int nbytes; 428 unsigned int nbytes;
438 unsigned int curbytes; 429 unsigned int curbytes;
439 430
@@ -639,6 +630,8 @@ struct ata_port_operations {
639 630
640 irq_handler_t irq_handler; 631 irq_handler_t irq_handler;
641 void (*irq_clear) (struct ata_port *); 632 void (*irq_clear) (struct ata_port *);
633 u8 (*irq_on) (struct ata_port *);
634 u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq);
642 635
643 u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); 636 u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
644 void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 637 void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
@@ -720,20 +713,18 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i
720 unsigned int n_ports); 713 unsigned int n_ports);
721extern void ata_pci_remove_one (struct pci_dev *pdev); 714extern void ata_pci_remove_one (struct pci_dev *pdev);
722extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg); 715extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg);
723extern void ata_pci_device_do_resume(struct pci_dev *pdev); 716extern int __must_check ata_pci_device_do_resume(struct pci_dev *pdev);
724extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); 717extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
725extern int ata_pci_device_resume(struct pci_dev *pdev); 718extern int ata_pci_device_resume(struct pci_dev *pdev);
726extern int ata_pci_clear_simplex(struct pci_dev *pdev); 719extern int ata_pci_clear_simplex(struct pci_dev *pdev);
727#endif /* CONFIG_PCI */ 720#endif /* CONFIG_PCI */
728extern int ata_device_add(const struct ata_probe_ent *ent); 721extern int ata_device_add(const struct ata_probe_ent *ent);
729extern void ata_port_detach(struct ata_port *ap); 722extern void ata_host_detach(struct ata_host *host);
730extern void ata_host_init(struct ata_host *, struct device *, 723extern void ata_host_init(struct ata_host *, struct device *,
731 unsigned long, const struct ata_port_operations *); 724 unsigned long, const struct ata_port_operations *);
732extern void ata_host_remove(struct ata_host *host);
733extern int ata_scsi_detect(struct scsi_host_template *sht); 725extern int ata_scsi_detect(struct scsi_host_template *sht);
734extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 726extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
735extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); 727extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
736extern int ata_scsi_release(struct Scsi_Host *host);
737extern void ata_sas_port_destroy(struct ata_port *); 728extern void ata_sas_port_destroy(struct ata_port *);
738extern struct ata_port *ata_sas_port_alloc(struct ata_host *, 729extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
739 struct ata_port_info *, struct Scsi_Host *); 730 struct ata_port_info *, struct Scsi_Host *);
@@ -776,15 +767,11 @@ extern u8 ata_check_status(struct ata_port *ap);
776extern u8 ata_altstatus(struct ata_port *ap); 767extern u8 ata_altstatus(struct ata_port *ap);
777extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); 768extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf);
778extern int ata_port_start (struct ata_port *ap); 769extern int ata_port_start (struct ata_port *ap);
779extern void ata_port_stop (struct ata_port *ap);
780extern void ata_host_stop (struct ata_host *host);
781extern irqreturn_t ata_interrupt (int irq, void *dev_instance); 770extern irqreturn_t ata_interrupt (int irq, void *dev_instance);
782extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf, 771extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf,
783 unsigned int buflen, int write_data); 772 unsigned int buflen, int write_data);
784extern void ata_pio_data_xfer(struct ata_device *adev, unsigned char *buf, 773extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf,
785 unsigned int buflen, int write_data); 774 unsigned int buflen, int write_data);
786extern void ata_pio_data_xfer_noirq(struct ata_device *adev, unsigned char *buf,
787 unsigned int buflen, int write_data);
788extern void ata_qc_prep(struct ata_queued_cmd *qc); 775extern void ata_qc_prep(struct ata_queued_cmd *qc);
789extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); 776extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
790extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); 777extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc);
@@ -826,6 +813,10 @@ extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
826extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, 813extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
827 int queue_depth); 814 int queue_depth);
828extern struct ata_device *ata_dev_pair(struct ata_device *adev); 815extern struct ata_device *ata_dev_pair(struct ata_device *adev);
816extern u8 ata_irq_on(struct ata_port *ap);
817extern u8 ata_dummy_irq_on(struct ata_port *ap);
818extern u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq);
819extern u8 ata_dummy_irq_ack(struct ata_port *ap, unsigned int chk_drq);
829 820
830/* 821/*
831 * Timing helpers 822 * Timing helpers
@@ -864,7 +855,6 @@ struct pci_bits {
864 unsigned long val; 855 unsigned long val;
865}; 856};
866 857
867extern void ata_pci_host_stop (struct ata_host *host);
868extern struct ata_probe_ent * 858extern struct ata_probe_ent *
869ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); 859ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask);
870extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); 860extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
@@ -1096,10 +1086,9 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
1096 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); 1086 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
1097 1087
1098 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) { 1088 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) {
1099 unsigned long l = ap->ioaddr.status_addr;
1100 if (ata_msg_warn(ap)) 1089 if (ata_msg_warn(ap))
1101 printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%lX\n", 1090 printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%p\n",
1102 status, l); 1091 status, ap->ioaddr.status_addr);
1103 } 1092 }
1104 1093
1105 return status; 1094 return status;
@@ -1149,8 +1138,7 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1149 qc->dma_dir = DMA_NONE; 1138 qc->dma_dir = DMA_NONE;
1150 qc->__sg = NULL; 1139 qc->__sg = NULL;
1151 qc->flags = 0; 1140 qc->flags = 0;
1152 qc->cursect = qc->cursg = qc->cursg_ofs = 0; 1141 qc->cursg = qc->cursg_ofs = 0;
1153 qc->nsect = 0;
1154 qc->nbytes = qc->curbytes = 0; 1142 qc->nbytes = qc->curbytes = 0;
1155 qc->n_elem = 0; 1143 qc->n_elem = 0;
1156 qc->err_mask = 0; 1144 qc->err_mask = 0;
@@ -1163,51 +1151,6 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1163 qc->result_tf.feature = 0; 1151 qc->result_tf.feature = 0;
1164} 1152}
1165 1153
1166/**
1167 * ata_irq_ack - Acknowledge a device interrupt.
1168 * @ap: Port on which interrupts are enabled.
1169 *
1170 * Wait up to 10 ms for legacy IDE device to become idle (BUSY
1171 * or BUSY+DRQ clear). Obtain dma status and port status from
1172 * device. Clear the interrupt. Return port status.
1173 *
1174 * LOCKING:
1175 */
1176
1177static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
1178{
1179 unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY;
1180 u8 host_stat, post_stat, status;
1181
1182 status = ata_busy_wait(ap, bits, 1000);
1183 if (status & bits)
1184 if (ata_msg_err(ap))
1185 printk(KERN_ERR "abnormal status 0x%X\n", status);
1186
1187 /* get controller status; clear intr, err bits */
1188 if (ap->flags & ATA_FLAG_MMIO) {
1189 void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
1190 host_stat = readb(mmio + ATA_DMA_STATUS);
1191 writeb(host_stat | ATA_DMA_INTR | ATA_DMA_ERR,
1192 mmio + ATA_DMA_STATUS);
1193
1194 post_stat = readb(mmio + ATA_DMA_STATUS);
1195 } else {
1196 host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
1197 outb(host_stat | ATA_DMA_INTR | ATA_DMA_ERR,
1198 ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
1199
1200 post_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
1201 }
1202
1203 if (ata_msg_intr(ap))
1204 printk(KERN_INFO "%s: irq ack: host_stat 0x%X, new host_stat 0x%X, drv_stat 0x%X\n",
1205 __FUNCTION__,
1206 host_stat, post_stat, status);
1207
1208 return status;
1209}
1210
1211static inline int ata_try_flush_cache(const struct ata_device *dev) 1154static inline int ata_try_flush_cache(const struct ata_device *dev)
1212{ 1155{
1213 return ata_id_wcache_enabled(dev->id) || 1156 return ata_id_wcache_enabled(dev->id) ||
@@ -1235,14 +1178,14 @@ static inline unsigned int __ac_err_mask(u8 status)
1235static inline int ata_pad_alloc(struct ata_port *ap, struct device *dev) 1178static inline int ata_pad_alloc(struct ata_port *ap, struct device *dev)
1236{ 1179{
1237 ap->pad_dma = 0; 1180 ap->pad_dma = 0;
1238 ap->pad = dma_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ, 1181 ap->pad = dmam_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ,
1239 &ap->pad_dma, GFP_KERNEL); 1182 &ap->pad_dma, GFP_KERNEL);
1240 return (ap->pad == NULL) ? -ENOMEM : 0; 1183 return (ap->pad == NULL) ? -ENOMEM : 0;
1241} 1184}
1242 1185
1243static inline void ata_pad_free(struct ata_port *ap, struct device *dev) 1186static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
1244{ 1187{
1245 dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma); 1188 dmam_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
1246} 1189}
1247 1190
1248static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host) 1191static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host)
diff --git a/include/linux/list.h b/include/linux/list.h
index 611059d633f4..f9d71eab05ee 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -161,7 +161,7 @@ static inline void __list_del(struct list_head * prev, struct list_head * next)
161/** 161/**
162 * list_del - deletes entry from list. 162 * list_del - deletes entry from list.
163 * @entry: the element to delete from the list. 163 * @entry: the element to delete from the list.
164 * Note: list_empty on entry does not return true after this, the entry is 164 * Note: list_empty() on entry does not return true after this, the entry is
165 * in an undefined state. 165 * in an undefined state.
166 */ 166 */
167#ifndef CONFIG_DEBUG_LIST 167#ifndef CONFIG_DEBUG_LIST
@@ -179,7 +179,7 @@ extern void list_del(struct list_head *entry);
179 * list_del_rcu - deletes entry from list without re-initialization 179 * list_del_rcu - deletes entry from list without re-initialization
180 * @entry: the element to delete from the list. 180 * @entry: the element to delete from the list.
181 * 181 *
182 * Note: list_empty on entry does not return true after this, 182 * Note: list_empty() on entry does not return true after this,
183 * the entry is in an undefined state. It is useful for RCU based 183 * the entry is in an undefined state. It is useful for RCU based
184 * lockfree traversal. 184 * lockfree traversal.
185 * 185 *
@@ -209,7 +209,8 @@ static inline void list_del_rcu(struct list_head *entry)
209 * list_replace - replace old entry by new one 209 * list_replace - replace old entry by new one
210 * @old : the element to be replaced 210 * @old : the element to be replaced
211 * @new : the new element to insert 211 * @new : the new element to insert
212 * Note: if 'old' was empty, it will be overwritten. 212 *
213 * If @old was empty, it will be overwritten.
213 */ 214 */
214static inline void list_replace(struct list_head *old, 215static inline void list_replace(struct list_head *old,
215 struct list_head *new) 216 struct list_head *new)
@@ -360,6 +361,62 @@ static inline void list_splice_init(struct list_head *list,
360} 361}
361 362
362/** 363/**
364 * list_splice_init_rcu - splice an RCU-protected list into an existing list.
365 * @list: the RCU-protected list to splice
366 * @head: the place in the list to splice the first list into
367 * @sync: function to sync: synchronize_rcu(), synchronize_sched(), ...
368 *
369 * @head can be RCU-read traversed concurrently with this function.
370 *
371 * Note that this function blocks.
372 *
373 * Important note: the caller must take whatever action is necessary to
374 * prevent any other updates to @head. In principle, it is possible
375 * to modify the list as soon as sync() begins execution.
376 * If this sort of thing becomes necessary, an alternative version
377 * based on call_rcu() could be created. But only if -really-
378 * needed -- there is no shortage of RCU API members.
379 */
380static inline void list_splice_init_rcu(struct list_head *list,
381 struct list_head *head,
382 void (*sync)(void))
383{
384 struct list_head *first = list->next;
385 struct list_head *last = list->prev;
386 struct list_head *at = head->next;
387
388 if (list_empty(head))
389 return;
390
391 /* "first" and "last" tracking list, so initialize it. */
392
393 INIT_LIST_HEAD(list);
394
395 /*
396 * At this point, the list body still points to the source list.
397 * Wait for any readers to finish using the list before splicing
398 * the list body into the new list. Any new readers will see
399 * an empty list.
400 */
401
402 sync();
403
404 /*
405 * Readers are finished with the source list, so perform splice.
406 * The order is important if the new list is global and accessible
407 * to concurrent RCU readers. Note that RCU readers are not
408 * permitted to traverse the prev pointers without excluding
409 * this function.
410 */
411
412 last->next = at;
413 smp_wmb();
414 head->next = first;
415 first->prev = head;
416 at->prev = last;
417}
418
419/**
363 * list_entry - get the struct for this entry 420 * list_entry - get the struct for this entry
364 * @ptr: the &struct list_head pointer. 421 * @ptr: the &struct list_head pointer.
365 * @type: the type of the struct this is embedded in. 422 * @type: the type of the struct this is embedded in.
@@ -432,12 +489,12 @@ static inline void list_splice_init(struct list_head *list,
432 pos = list_entry(pos->member.prev, typeof(*pos), member)) 489 pos = list_entry(pos->member.prev, typeof(*pos), member))
433 490
434/** 491/**
435 * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue 492 * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue()
436 * @pos: the type * to use as a start point 493 * @pos: the type * to use as a start point
437 * @head: the head of the list 494 * @head: the head of the list
438 * @member: the name of the list_struct within the struct. 495 * @member: the name of the list_struct within the struct.
439 * 496 *
440 * Prepares a pos entry for use as a start point in list_for_each_entry_continue. 497 * Prepares a pos entry for use as a start point in list_for_each_entry_continue().
441 */ 498 */
442#define list_prepare_entry(pos, head, member) \ 499#define list_prepare_entry(pos, head, member) \
443 ((pos) ? : list_entry(head, typeof(*pos), member)) 500 ((pos) ? : list_entry(head, typeof(*pos), member))
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index ea097dddc44f..06fe93a3e916 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -8,6 +8,8 @@
8#ifndef __LINUX_LOCKDEP_H 8#ifndef __LINUX_LOCKDEP_H
9#define __LINUX_LOCKDEP_H 9#define __LINUX_LOCKDEP_H
10 10
11struct task_struct;
12
11#ifdef CONFIG_LOCKDEP 13#ifdef CONFIG_LOCKDEP
12 14
13#include <linux/linkage.h> 15#include <linux/linkage.h>
@@ -132,6 +134,7 @@ struct lock_list {
132 struct list_head entry; 134 struct list_head entry;
133 struct lock_class *class; 135 struct lock_class *class;
134 struct stack_trace trace; 136 struct stack_trace trace;
137 int distance;
135}; 138};
136 139
137/* 140/*
diff --git a/include/linux/log2.h b/include/linux/log2.h
index d02e1a547a7e..99922bedfcc9 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -44,6 +44,17 @@ int __ilog2_u64(u64 n)
44#endif 44#endif
45 45
46/* 46/*
47 * Determine whether some value is a power of two, where zero is
48 * *not* considered a power of two.
49 */
50
51static inline __attribute__((const))
52bool is_power_of_2(unsigned long n)
53{
54 return (n != 0 && ((n & (n - 1)) == 0));
55}
56
57/*
47 * round up to nearest power of two 58 * round up to nearest power of two
48 */ 59 */
49static inline __attribute__((const)) 60static inline __attribute__((const))
diff --git a/include/linux/magic.h b/include/linux/magic.h
index b78bbf42135a..b32c8a97fcec 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -18,6 +18,7 @@
18#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ 18#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
19#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ 19#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */
20#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ 20#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
21#define MINIX3_SUPER_MAGIC 0x4d5a /* minix V3 fs */
21 22
22#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ 23#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
23#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */ 24#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */
diff --git a/include/linux/mc146818rtc.h b/include/linux/mc146818rtc.h
index 432b2fa24929..bdc01127dced 100644
--- a/include/linux/mc146818rtc.h
+++ b/include/linux/mc146818rtc.h
@@ -18,6 +18,16 @@
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19#include <linux/spinlock.h> /* spinlock_t */ 19#include <linux/spinlock.h> /* spinlock_t */
20extern spinlock_t rtc_lock; /* serialize CMOS RAM access */ 20extern spinlock_t rtc_lock; /* serialize CMOS RAM access */
21
22/* Some RTCs extend the mc146818 register set to support alarms of more
23 * than 24 hours in the future; or dates that include a century code.
24 * This platform_data structure can pass this information to the driver.
25 */
26struct cmos_rtc_board_info {
27 u8 rtc_day_alarm; /* zero, or register index */
28 u8 rtc_mon_alarm; /* zero, or register index */
29 u8 rtc_century; /* zero, or register index */
30};
21#endif 31#endif
22 32
23/********************************************************************** 33/**********************************************************************
diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h
index 916e8f72c63d..9850d513ff60 100644
--- a/include/linux/minix_fs.h
+++ b/include/linux/minix_fs.h
@@ -25,7 +25,6 @@
25#define MINIX_ERROR_FS 0x0002 /* fs has errors. */ 25#define MINIX_ERROR_FS 0x0002 /* fs has errors. */
26 26
27#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) 27#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
28#define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode)))
29 28
30/* 29/*
31 * This is the original minix inode layout on disk. 30 * This is the original minix inode layout on disk.
@@ -75,9 +74,33 @@ struct minix_super_block {
75 __u32 s_zones; 74 __u32 s_zones;
76}; 75};
77 76
77/*
78 * V3 minix super-block data on disk
79 */
80struct minix3_super_block {
81 __u16 s_ninodes;
82 __u16 s_nzones;
83 __u16 s_pad0;
84 __u16 s_imap_blocks;
85 __u16 s_zmap_blocks;
86 __u16 s_firstdatazone;
87 __u16 s_log_zone_size;
88 __u16 s_pad1;
89 __u32 s_max_size;
90 __u32 s_zones;
91 __u16 s_magic;
92 __u16 s_pad2;
93 __u16 s_blocksize;
94 __u8 s_disk_version;
95};
96
78struct minix_dir_entry { 97struct minix_dir_entry {
79 __u16 inode; 98 __u16 inode;
80 char name[0]; 99 char name[0];
81}; 100};
82 101
102struct minix3_dir_entry {
103 __u32 inode;
104 char name[0];
105};
83#endif 106#endif
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 2d2c08d5f473..a0eec16eb0bd 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -437,15 +437,15 @@ static inline compound_page_dtor *get_compound_page_dtor(struct page *page)
437/* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allcator */ 437/* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allcator */
438#ifdef NODE_NOT_IN_PAGEFLAGS 438#ifdef NODE_NOT_IN_PAGEFLAGS
439#define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT) 439#define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT)
440#define ZONEID_PGOFF ((SECTIONS_PGOFF < ZONES_PGOFF)? \
441 SECTIONS_PGOFF : ZONES_PGOFF)
440#else 442#else
441#define ZONEID_SHIFT (NODES_SHIFT + ZONES_SHIFT) 443#define ZONEID_SHIFT (NODES_SHIFT + ZONES_SHIFT)
444#define ZONEID_PGOFF ((NODES_PGOFF < ZONES_PGOFF)? \
445 NODES_PGOFF : ZONES_PGOFF)
442#endif 446#endif
443 447
444#if ZONES_WIDTH > 0 448#define ZONEID_PGSHIFT (ZONEID_PGOFF * (ZONEID_SHIFT != 0))
445#define ZONEID_PGSHIFT ZONES_PGSHIFT
446#else
447#define ZONEID_PGSHIFT NODES_PGOFF
448#endif
449 449
450#if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED 450#if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED
451#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED 451#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED
@@ -471,7 +471,6 @@ static inline enum zone_type page_zonenum(struct page *page)
471 */ 471 */
472static inline int page_zone_id(struct page *page) 472static inline int page_zone_id(struct page *page)
473{ 473{
474 BUILD_BUG_ON(ZONEID_PGSHIFT == 0 && ZONEID_MASK);
475 return (page->flags >> ZONEID_PGSHIFT) & ZONEID_MASK; 474 return (page->flags >> ZONEID_PGSHIFT) & ZONEID_MASK;
476} 475}
477 476
@@ -638,6 +637,7 @@ static inline int page_mapped(struct page *page)
638 */ 637 */
639#define NOPFN_SIGBUS ((unsigned long) -1) 638#define NOPFN_SIGBUS ((unsigned long) -1)
640#define NOPFN_OOM ((unsigned long) -2) 639#define NOPFN_OOM ((unsigned long) -2)
640#define NOPFN_REFAULT ((unsigned long) -3)
641 641
642/* 642/*
643 * Different kinds of faults, as returned by handle_mm_fault(). 643 * Different kinds of faults, as returned by handle_mm_fault().
@@ -786,6 +786,7 @@ extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
786extern void do_invalidatepage(struct page *page, unsigned long offset); 786extern void do_invalidatepage(struct page *page, unsigned long offset);
787 787
788int __set_page_dirty_nobuffers(struct page *page); 788int __set_page_dirty_nobuffers(struct page *page);
789int __set_page_dirty_no_writeback(struct page *page);
789int redirty_page_for_writepage(struct writeback_control *wbc, 790int redirty_page_for_writepage(struct writeback_control *wbc,
790 struct page *page); 791 struct page *page);
791int FASTCALL(set_page_dirty(struct page *page)); 792int FASTCALL(set_page_dirty(struct page *page));
@@ -1030,6 +1031,9 @@ extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
1030 unsigned long addr, unsigned long len, pgoff_t pgoff); 1031 unsigned long addr, unsigned long len, pgoff_t pgoff);
1031extern void exit_mmap(struct mm_struct *); 1032extern void exit_mmap(struct mm_struct *);
1032extern int may_expand_vm(struct mm_struct *mm, unsigned long npages); 1033extern int may_expand_vm(struct mm_struct *mm, unsigned long npages);
1034extern int install_special_mapping(struct mm_struct *mm,
1035 unsigned long addr, unsigned long len,
1036 unsigned long flags, struct page **pages);
1033 1037
1034extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 1038extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
1035 1039
@@ -1121,6 +1125,8 @@ unsigned long vmalloc_to_pfn(void *addr);
1121int remap_pfn_range(struct vm_area_struct *, unsigned long addr, 1125int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
1122 unsigned long pfn, unsigned long size, pgprot_t); 1126 unsigned long pfn, unsigned long size, pgprot_t);
1123int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *); 1127int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *);
1128int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
1129 unsigned long pfn);
1124 1130
1125struct page *follow_page(struct vm_area_struct *, unsigned long address, 1131struct page *follow_page(struct vm_area_struct *, unsigned long address,
1126 unsigned int foll_flags); 1132 unsigned int foll_flags);
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index 3b6723dfaff3..895bc4e93039 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -1,30 +1,29 @@
1
2static inline void 1static inline void
3add_page_to_active_list(struct zone *zone, struct page *page) 2add_page_to_active_list(struct zone *zone, struct page *page)
4{ 3{
5 list_add(&page->lru, &zone->active_list); 4 list_add(&page->lru, &zone->active_list);
6 zone->nr_active++; 5 __inc_zone_state(zone, NR_ACTIVE);
7} 6}
8 7
9static inline void 8static inline void
10add_page_to_inactive_list(struct zone *zone, struct page *page) 9add_page_to_inactive_list(struct zone *zone, struct page *page)
11{ 10{
12 list_add(&page->lru, &zone->inactive_list); 11 list_add(&page->lru, &zone->inactive_list);
13 zone->nr_inactive++; 12 __inc_zone_state(zone, NR_INACTIVE);
14} 13}
15 14
16static inline void 15static inline void
17del_page_from_active_list(struct zone *zone, struct page *page) 16del_page_from_active_list(struct zone *zone, struct page *page)
18{ 17{
19 list_del(&page->lru); 18 list_del(&page->lru);
20 zone->nr_active--; 19 __dec_zone_state(zone, NR_ACTIVE);
21} 20}
22 21
23static inline void 22static inline void
24del_page_from_inactive_list(struct zone *zone, struct page *page) 23del_page_from_inactive_list(struct zone *zone, struct page *page)
25{ 24{
26 list_del(&page->lru); 25 list_del(&page->lru);
27 zone->nr_inactive--; 26 __dec_zone_state(zone, NR_INACTIVE);
28} 27}
29 28
30static inline void 29static inline void
@@ -33,9 +32,9 @@ del_page_from_lru(struct zone *zone, struct page *page)
33 list_del(&page->lru); 32 list_del(&page->lru);
34 if (PageActive(page)) { 33 if (PageActive(page)) {
35 __ClearPageActive(page); 34 __ClearPageActive(page);
36 zone->nr_active--; 35 __dec_zone_state(zone, NR_ACTIVE);
37 } else { 36 } else {
38 zone->nr_inactive--; 37 __dec_zone_state(zone, NR_INACTIVE);
39 } 38 }
40} 39}
41 40
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index d0e6a5497614..e45712acfac5 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -71,6 +71,7 @@ struct mmc_card {
71#define MMC_STATE_SDCARD (1<<3) /* is an SD card */ 71#define MMC_STATE_SDCARD (1<<3) /* is an SD card */
72#define MMC_STATE_READONLY (1<<4) /* card is read-only */ 72#define MMC_STATE_READONLY (1<<4) /* card is read-only */
73#define MMC_STATE_HIGHSPEED (1<<5) /* card is in high speed mode */ 73#define MMC_STATE_HIGHSPEED (1<<5) /* card is in high speed mode */
74#define MMC_STATE_BLOCKADDR (1<<6) /* card uses block-addressing */
74 u32 raw_cid[4]; /* raw card CID */ 75 u32 raw_cid[4]; /* raw card CID */
75 u32 raw_csd[4]; /* raw card CSD */ 76 u32 raw_csd[4]; /* raw card CSD */
76 u32 raw_scr[2]; /* raw card SCR */ 77 u32 raw_scr[2]; /* raw card SCR */
@@ -87,6 +88,7 @@ struct mmc_card {
87#define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD) 88#define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD)
88#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) 89#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
89#define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) 90#define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED)
91#define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR)
90 92
91#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) 93#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
92#define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD) 94#define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD)
@@ -94,6 +96,7 @@ struct mmc_card {
94#define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD) 96#define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD)
95#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) 97#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
96#define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) 98#define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
99#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
97 100
98#define mmc_card_name(c) ((c)->cid.prod_name) 101#define mmc_card_name(c) ((c)->cid.prod_name)
99#define mmc_card_id(c) ((c)->dev.bus_id) 102#define mmc_card_id(c) ((c)->dev.bus_id)
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index c15ae1986b98..913e5752569f 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -92,8 +92,10 @@ struct mmc_host {
92 unsigned int max_seg_size; /* see blk_queue_max_segment_size */ 92 unsigned int max_seg_size; /* see blk_queue_max_segment_size */
93 unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */ 93 unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */
94 unsigned short max_phys_segs; /* see blk_queue_max_phys_segments */ 94 unsigned short max_phys_segs; /* see blk_queue_max_phys_segments */
95 unsigned short max_sectors; /* see blk_queue_max_sectors */
96 unsigned short unused; 95 unsigned short unused;
96 unsigned int max_req_size; /* maximum number of bytes in one req */
97 unsigned int max_blk_size; /* maximum size of one mmc block */
98 unsigned int max_blk_count; /* maximum number of blocks in one req */
97 99
98 /* private data */ 100 /* private data */
99 struct mmc_ios ios; /* current io bus settings */ 101 struct mmc_ios ios; /* current io bus settings */
@@ -106,8 +108,9 @@ struct mmc_host {
106 struct list_head cards; /* devices attached to this host */ 108 struct list_head cards; /* devices attached to this host */
107 109
108 wait_queue_head_t wq; 110 wait_queue_head_t wq;
109 spinlock_t lock; /* card_busy lock */ 111 spinlock_t lock; /* claimed lock */
110 struct mmc_card *card_busy; /* the MMC card claiming host */ 112 unsigned int claimed:1; /* host exclusively claimed */
113
111 struct mmc_card *card_selected; /* the selected MMC card */ 114 struct mmc_card *card_selected; /* the selected MMC card */
112 115
113 struct delayed_work detect; 116 struct delayed_work detect;
@@ -126,6 +129,7 @@ static inline void *mmc_priv(struct mmc_host *host)
126} 129}
127 130
128#define mmc_dev(x) ((x)->parent) 131#define mmc_dev(x) ((x)->parent)
132#define mmc_classdev(x) (&(x)->class_dev)
129#define mmc_hostname(x) ((x)->class_dev.bus_id) 133#define mmc_hostname(x) ((x)->class_dev.bus_id)
130 134
131extern int mmc_suspend_host(struct mmc_host *, pm_message_t); 135extern int mmc_suspend_host(struct mmc_host *, pm_message_t);
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index bcf24909d677..cdc54be804f1 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -43,6 +43,7 @@ struct mmc_command {
43#define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC) 43#define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC)
44#define MMC_RSP_R3 (MMC_RSP_PRESENT) 44#define MMC_RSP_R3 (MMC_RSP_PRESENT)
45#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) 45#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
46#define MMC_RSP_R7 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
46 47
47#define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE)) 48#define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE))
48 49
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h
index 2dce60c43f4b..c90b6768329d 100644
--- a/include/linux/mmc/protocol.h
+++ b/include/linux/mmc/protocol.h
@@ -79,9 +79,12 @@
79#define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1 */ 79#define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1 */
80 80
81/* SD commands type argument response */ 81/* SD commands type argument response */
82 /* class 8 */ 82 /* class 0 */
83/* This is basically the same command as for MMC with some quirks. */ 83/* This is basically the same command as for MMC with some quirks. */
84#define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */ 84#define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */
85#define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */
86
87 /* class 10 */
85#define SD_SWITCH 6 /* adtc [31:0] See below R1 */ 88#define SD_SWITCH 6 /* adtc [31:0] See below R1 */
86 89
87 /* Application commands */ 90 /* Application commands */
@@ -115,6 +118,14 @@
115 */ 118 */
116 119
117/* 120/*
121 * SD_SEND_IF_COND argument format:
122 *
123 * [31:12] Reserved (0)
124 * [11:8] Host Voltage Supply Flags
125 * [7:0] Check Pattern (0xAA)
126 */
127
128/*
118 MMC status in R1 129 MMC status in R1
119 Type 130 Type
120 e : error bit 131 e : error bit
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index b262f47961fb..ee9e3143df4f 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -47,15 +47,20 @@ struct zone_padding {
47#endif 47#endif
48 48
49enum zone_stat_item { 49enum zone_stat_item {
50 /* First 128 byte cacheline (assuming 64 bit words) */
51 NR_FREE_PAGES,
52 NR_INACTIVE,
53 NR_ACTIVE,
50 NR_ANON_PAGES, /* Mapped anonymous pages */ 54 NR_ANON_PAGES, /* Mapped anonymous pages */
51 NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. 55 NR_FILE_MAPPED, /* pagecache pages mapped into pagetables.
52 only modified from process context */ 56 only modified from process context */
53 NR_FILE_PAGES, 57 NR_FILE_PAGES,
54 NR_SLAB_RECLAIMABLE,
55 NR_SLAB_UNRECLAIMABLE,
56 NR_PAGETABLE, /* used for pagetables */
57 NR_FILE_DIRTY, 58 NR_FILE_DIRTY,
58 NR_WRITEBACK, 59 NR_WRITEBACK,
60 /* Second 128 byte cacheline */
61 NR_SLAB_RECLAIMABLE,
62 NR_SLAB_UNRECLAIMABLE,
63 NR_PAGETABLE, /* used for pagetables */
59 NR_UNSTABLE_NFS, /* NFS unstable pages */ 64 NR_UNSTABLE_NFS, /* NFS unstable pages */
60 NR_BOUNCE, 65 NR_BOUNCE,
61 NR_VMSCAN_WRITE, 66 NR_VMSCAN_WRITE,
@@ -91,6 +96,7 @@ struct per_cpu_pageset {
91#endif 96#endif
92 97
93enum zone_type { 98enum zone_type {
99#ifdef CONFIG_ZONE_DMA
94 /* 100 /*
95 * ZONE_DMA is used when there are devices that are not able 101 * ZONE_DMA is used when there are devices that are not able
96 * to do DMA to all of addressable memory (ZONE_NORMAL). Then we 102 * to do DMA to all of addressable memory (ZONE_NORMAL). Then we
@@ -111,6 +117,7 @@ enum zone_type {
111 * <16M. 117 * <16M.
112 */ 118 */
113 ZONE_DMA, 119 ZONE_DMA,
120#endif
114#ifdef CONFIG_ZONE_DMA32 121#ifdef CONFIG_ZONE_DMA32
115 /* 122 /*
116 * x86_64 needs two ZONE_DMAs because it supports devices that are 123 * x86_64 needs two ZONE_DMAs because it supports devices that are
@@ -147,15 +154,30 @@ enum zone_type {
147 * match the requested limits. See gfp_zone() in include/linux/gfp.h 154 * match the requested limits. See gfp_zone() in include/linux/gfp.h
148 */ 155 */
149 156
150#if !defined(CONFIG_ZONE_DMA32) && !defined(CONFIG_HIGHMEM) 157/*
158 * Count the active zones. Note that the use of defined(X) outside
159 * #if and family is not necessarily defined so ensure we cannot use
160 * it later. Use __ZONE_COUNT to work out how many shift bits we need.
161 */
162#define __ZONE_COUNT ( \
163 defined(CONFIG_ZONE_DMA) \
164 + defined(CONFIG_ZONE_DMA32) \
165 + 1 \
166 + defined(CONFIG_HIGHMEM) \
167)
168#if __ZONE_COUNT < 2
169#define ZONES_SHIFT 0
170#elif __ZONE_COUNT <= 2
151#define ZONES_SHIFT 1 171#define ZONES_SHIFT 1
152#else 172#elif __ZONE_COUNT <= 4
153#define ZONES_SHIFT 2 173#define ZONES_SHIFT 2
174#else
175#error ZONES_SHIFT -- too many zones configured adjust calculation
154#endif 176#endif
177#undef __ZONE_COUNT
155 178
156struct zone { 179struct zone {
157 /* Fields commonly accessed by the page allocator */ 180 /* Fields commonly accessed by the page allocator */
158 unsigned long free_pages;
159 unsigned long pages_min, pages_low, pages_high; 181 unsigned long pages_min, pages_low, pages_high;
160 /* 182 /*
161 * We don't know if the memory that we're going to allocate will be freeable 183 * We don't know if the memory that we're going to allocate will be freeable
@@ -197,8 +219,6 @@ struct zone {
197 struct list_head inactive_list; 219 struct list_head inactive_list;
198 unsigned long nr_scan_active; 220 unsigned long nr_scan_active;
199 unsigned long nr_scan_inactive; 221 unsigned long nr_scan_inactive;
200 unsigned long nr_active;
201 unsigned long nr_inactive;
202 unsigned long pages_scanned; /* since last reclaim */ 222 unsigned long pages_scanned; /* since last reclaim */
203 int all_unreclaimable; /* All pages pinned */ 223 int all_unreclaimable; /* All pages pinned */
204 224
@@ -442,8 +462,6 @@ typedef struct pglist_data {
442 462
443#include <linux/memory_hotplug.h> 463#include <linux/memory_hotplug.h>
444 464
445void __get_zone_counts(unsigned long *active, unsigned long *inactive,
446 unsigned long *free, struct pglist_data *pgdat);
447void get_zone_counts(unsigned long *active, unsigned long *inactive, 465void get_zone_counts(unsigned long *active, unsigned long *inactive,
448 unsigned long *free); 466 unsigned long *free);
449void build_all_zonelists(void); 467void build_all_zonelists(void);
@@ -523,7 +541,11 @@ static inline int is_dma32(struct zone *zone)
523 541
524static inline int is_dma(struct zone *zone) 542static inline int is_dma(struct zone *zone)
525{ 543{
544#ifdef CONFIG_ZONE_DMA
526 return zone == zone->zone_pgdat->node_zones + ZONE_DMA; 545 return zone == zone->zone_pgdat->node_zones + ZONE_DMA;
546#else
547 return 0;
548#endif
527} 549}
528 550
529/* These two functions are used to setup the per zone pages min values */ 551/* These two functions are used to setup the per zone pages min values */
diff --git a/include/linux/module.h b/include/linux/module.h
index 10f771a49997..419d3ef293dd 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -58,6 +58,7 @@ struct module_kobject
58{ 58{
59 struct kobject kobj; 59 struct kobject kobj;
60 struct module *mod; 60 struct module *mod;
61 struct kobject *drivers_dir;
61}; 62};
62 63
63/* These are either module local, or the kernel's dummy ones. */ 64/* These are either module local, or the kernel's dummy ones. */
@@ -263,7 +264,7 @@ struct module
263 struct module_attribute *modinfo_attrs; 264 struct module_attribute *modinfo_attrs;
264 const char *version; 265 const char *version;
265 const char *srcversion; 266 const char *srcversion;
266 struct kobject *drivers_dir; 267 struct kobject *holders_dir;
267 268
268 /* Exported symbols */ 269 /* Exported symbols */
269 const struct kernel_symbol *syms; 270 const struct kernel_symbol *syms;
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 1b7e178b0d84..dab69afee2fa 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -43,9 +43,8 @@ struct vfsmount {
43 struct super_block *mnt_sb; /* pointer to superblock */ 43 struct super_block *mnt_sb; /* pointer to superblock */
44 struct list_head mnt_mounts; /* list of children, anchored here */ 44 struct list_head mnt_mounts; /* list of children, anchored here */
45 struct list_head mnt_child; /* and going through their mnt_child */ 45 struct list_head mnt_child; /* and going through their mnt_child */
46 atomic_t mnt_count;
47 int mnt_flags; 46 int mnt_flags;
48 int mnt_expiry_mark; /* true if marked for expiry */ 47 /* 4 bytes hole on 64bits arches */
49 char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ 48 char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
50 struct list_head mnt_list; 49 struct list_head mnt_list;
51 struct list_head mnt_expire; /* link in fs-specific expiry list */ 50 struct list_head mnt_expire; /* link in fs-specific expiry list */
@@ -54,6 +53,13 @@ struct vfsmount {
54 struct list_head mnt_slave; /* slave list entry */ 53 struct list_head mnt_slave; /* slave list entry */
55 struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ 54 struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */
56 struct mnt_namespace *mnt_ns; /* containing namespace */ 55 struct mnt_namespace *mnt_ns; /* containing namespace */
56 /*
57 * We put mnt_count & mnt_expiry_mark at the end of struct vfsmount
58 * to let these frequently modified fields in a separate cache line
59 * (so that reads of mnt_flags wont ping-pong on SMP machines)
60 */
61 atomic_t mnt_count;
62 int mnt_expiry_mark; /* true if marked for expiry */
57 int mnt_pinned; 63 int mnt_pinned;
58}; 64};
59 65
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index 24a9ef1506b6..fa253fa73aa3 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -234,7 +234,7 @@ struct msdos_sb_info {
234 struct fat_mount_options options; 234 struct fat_mount_options options;
235 struct nls_table *nls_disk; /* Codepage used on disk */ 235 struct nls_table *nls_disk; /* Codepage used on disk */
236 struct nls_table *nls_io; /* Charset used for input and display */ 236 struct nls_table *nls_io; /* Charset used for input and display */
237 void *dir_ops; /* Opaque; default directory operations */ 237 const void *dir_ops; /* Opaque; default directory operations */
238 int dir_per_block; /* dir entries per block */ 238 int dir_per_block; /* dir entries per block */
239 int dir_per_block_bits; /* log2(dir_per_block) */ 239 int dir_per_block_bits; /* log2(dir_per_block) */
240 240
@@ -399,7 +399,7 @@ extern int fat_count_free_clusters(struct super_block *sb);
399extern int fat_generic_ioctl(struct inode *inode, struct file *filp, 399extern int fat_generic_ioctl(struct inode *inode, struct file *filp,
400 unsigned int cmd, unsigned long arg); 400 unsigned int cmd, unsigned long arg);
401extern const struct file_operations fat_file_operations; 401extern const struct file_operations fat_file_operations;
402extern struct inode_operations fat_file_inode_operations; 402extern const struct inode_operations fat_file_inode_operations;
403extern int fat_notify_change(struct dentry * dentry, struct iattr * attr); 403extern int fat_notify_change(struct dentry * dentry, struct iattr * attr);
404extern void fat_truncate(struct inode *inode); 404extern void fat_truncate(struct inode *inode);
405extern int fat_getattr(struct vfsmount *mnt, struct dentry *dentry, 405extern int fat_getattr(struct vfsmount *mnt, struct dentry *dentry,
@@ -413,7 +413,7 @@ extern struct inode *fat_build_inode(struct super_block *sb,
413 struct msdos_dir_entry *de, loff_t i_pos); 413 struct msdos_dir_entry *de, loff_t i_pos);
414extern int fat_sync_inode(struct inode *inode); 414extern int fat_sync_inode(struct inode *inode);
415extern int fat_fill_super(struct super_block *sb, void *data, int silent, 415extern int fat_fill_super(struct super_block *sb, void *data, int silent,
416 struct inode_operations *fs_dir_inode_ops, int isvfat); 416 const struct inode_operations *fs_dir_inode_ops, int isvfat);
417 417
418extern int fat_flush_inodes(struct super_block *sb, struct inode *i1, 418extern int fat_flush_inodes(struct super_block *sb, struct inode *i1,
419 struct inode *i2); 419 struct inode *i2);
diff --git a/include/linux/msi.h b/include/linux/msi.h
index c7ef94343673..74c8a2ecc9dd 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -7,11 +7,10 @@ struct msi_msg {
7 u32 data; /* 16 bits of msi message data */ 7 u32 data; /* 16 bits of msi message data */
8}; 8};
9 9
10/* Heper functions */ 10/* Helper functions */
11extern void mask_msi_irq(unsigned int irq); 11extern void mask_msi_irq(unsigned int irq);
12extern void unmask_msi_irq(unsigned int irq); 12extern void unmask_msi_irq(unsigned int irq);
13extern void read_msi_msg(unsigned int irq, struct msi_msg *msg); 13extern void read_msi_msg(unsigned int irq, struct msi_msg *msg);
14
15extern void write_msi_msg(unsigned int irq, struct msi_msg *msg); 14extern void write_msi_msg(unsigned int irq, struct msi_msg *msg);
16 15
17struct msi_desc { 16struct msi_desc {
@@ -42,7 +41,7 @@ struct msi_desc {
42/* 41/*
43 * The arch hook for setup up msi irqs 42 * The arch hook for setup up msi irqs
44 */ 43 */
45int arch_setup_msi_irq(unsigned int irq, struct pci_dev *dev); 44int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc);
46void arch_teardown_msi_irq(unsigned int irq); 45void arch_teardown_msi_irq(unsigned int irq);
47 46
48 47
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 0ea7f89e613c..83e39eb054d3 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -204,7 +204,7 @@ void ncp_update_inode(struct inode *, struct ncp_entry_info *);
204void ncp_update_inode2(struct inode *, struct ncp_entry_info *); 204void ncp_update_inode2(struct inode *, struct ncp_entry_info *);
205 205
206/* linux/fs/ncpfs/dir.c */ 206/* linux/fs/ncpfs/dir.c */
207extern struct inode_operations ncp_dir_inode_operations; 207extern const struct inode_operations ncp_dir_inode_operations;
208extern const struct file_operations ncp_dir_operations; 208extern const struct file_operations ncp_dir_operations;
209int ncp_conn_logged_in(struct super_block *); 209int ncp_conn_logged_in(struct super_block *);
210int ncp_date_dos2unix(__le16 time, __le16 date); 210int ncp_date_dos2unix(__le16 time, __le16 date);
@@ -226,7 +226,7 @@ void ncp_lock_server(struct ncp_server *server);
226void ncp_unlock_server(struct ncp_server *server); 226void ncp_unlock_server(struct ncp_server *server);
227 227
228/* linux/fs/ncpfs/file.c */ 228/* linux/fs/ncpfs/file.c */
229extern struct inode_operations ncp_file_inode_operations; 229extern const struct inode_operations ncp_file_inode_operations;
230extern const struct file_operations ncp_file_operations; 230extern const struct file_operations ncp_file_operations;
231int ncp_make_open(struct inode *, int); 231int ncp_make_open(struct inode *, int);
232 232
diff --git a/include/linux/net.h b/include/linux/net.h
index f28d8a2e2c91..4db21e63d8d2 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -24,7 +24,7 @@
24struct poll_table_struct; 24struct poll_table_struct;
25struct inode; 25struct inode;
26 26
27#define NPROTO 32 /* should be enough for now.. */ 27#define NPROTO 33 /* should be enough for now.. */
28 28
29#define SYS_SOCKET 1 /* sys_socket(2) */ 29#define SYS_SOCKET 1 /* sys_socket(2) */
30#define SYS_BIND 2 /* sys_bind(2) */ 30#define SYS_BIND 2 /* sys_bind(2) */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index fea0d9db6846..1a528548cd1d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -529,10 +529,11 @@ struct net_device
529 struct net_bridge_port *br_port; 529 struct net_bridge_port *br_port;
530 530
531 /* class/net/name entry */ 531 /* class/net/name entry */
532 struct class_device class_dev; 532 struct device dev;
533 /* space for optional statistics and wireless sysfs groups */ 533 /* space for optional statistics and wireless sysfs groups */
534 struct attribute_group *sysfs_groups[3]; 534 struct attribute_group *sysfs_groups[3];
535}; 535};
536#define to_net_dev(d) container_of(d, struct net_device, dev)
536 537
537#define NETDEV_ALIGN 32 538#define NETDEV_ALIGN 32
538#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) 539#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1)
@@ -548,7 +549,7 @@ static inline void *netdev_priv(struct net_device *dev)
548/* Set the sysfs physical device reference for the network logical device 549/* Set the sysfs physical device reference for the network logical device
549 * if set prior to registration will cause a symlink during initialization. 550 * if set prior to registration will cause a symlink during initialization.
550 */ 551 */
551#define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev)) 552#define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev))
552 553
553struct packet_type { 554struct packet_type {
554 __be16 type; /* This is really htons(ether_type). */ 555 __be16 type; /* This is really htons(ether_type). */
@@ -588,7 +589,7 @@ extern int dev_open(struct net_device *dev);
588extern int dev_close(struct net_device *dev); 589extern int dev_close(struct net_device *dev);
589extern int dev_queue_xmit(struct sk_buff *skb); 590extern int dev_queue_xmit(struct sk_buff *skb);
590extern int register_netdevice(struct net_device *dev); 591extern int register_netdevice(struct net_device *dev);
591extern int unregister_netdevice(struct net_device *dev); 592extern void unregister_netdevice(struct net_device *dev);
592extern void free_netdev(struct net_device *dev); 593extern void free_netdev(struct net_device *dev);
593extern void synchronize_net(void); 594extern void synchronize_net(void);
594extern int register_netdevice_notifier(struct notifier_block *nb); 595extern int register_netdevice_notifier(struct notifier_block *nb);
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index d4c4c5120bc0..70d3b4f1e48d 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -172,8 +172,8 @@ struct nf_logger {
172 172
173/* Function to register/unregister log function. */ 173/* Function to register/unregister log function. */
174int nf_log_register(int pf, struct nf_logger *logger); 174int nf_log_register(int pf, struct nf_logger *logger);
175int nf_log_unregister_pf(int pf); 175void nf_log_unregister(struct nf_logger *logger);
176void nf_log_unregister_logger(struct nf_logger *logger); 176void nf_log_unregister_pf(int pf);
177 177
178/* Calls the registered backend logging function */ 178/* Calls the registered backend logging function */
179void nf_log_packet(int pf, 179void nf_log_packet(int pf,
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 6328175a1c3a..43397a414cd6 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -33,6 +33,7 @@ header-y += xt_tcpmss.h
33header-y += xt_tcpudp.h 33header-y += xt_tcpudp.h
34header-y += xt_SECMARK.h 34header-y += xt_SECMARK.h
35header-y += xt_CONNSECMARK.h 35header-y += xt_CONNSECMARK.h
36header-y += xt_TCPMSS.h
36 37
37unifdef-y += nf_conntrack_common.h 38unifdef-y += nf_conntrack_common.h
38unifdef-y += nf_conntrack_ftp.h 39unifdef-y += nf_conntrack_ftp.h
diff --git a/include/linux/netfilter/nf_conntrack_sane.h b/include/linux/netfilter/nf_conntrack_sane.h
new file mode 100644
index 000000000000..4767d6e23e97
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_sane.h
@@ -0,0 +1,21 @@
1#ifndef _NF_CONNTRACK_SANE_H
2#define _NF_CONNTRACK_SANE_H
3/* SANE tracking. */
4
5#ifdef __KERNEL__
6
7#define SANE_PORT 6566
8
9enum sane_state {
10 SANE_STATE_NORMAL,
11 SANE_STATE_START_REQUESTED,
12};
13
14/* This structure exists only once per master */
15struct nf_ct_sane_master {
16 enum sane_state state;
17};
18
19#endif /* __KERNEL__ */
20
21#endif /* _NF_CONNTRACK_SANE_H */
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
index 2f4e98b90cc0..007af4c2770b 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -27,6 +27,9 @@ enum tcp_conntrack {
27/* This sender sent FIN first */ 27/* This sender sent FIN first */
28#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04 28#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04
29 29
30/* Be liberal in window checking */
31#define IP_CT_TCP_FLAG_BE_LIBERAL 0x08
32
30#ifdef __KERNEL__ 33#ifdef __KERNEL__
31 34
32struct ip_ct_tcp_state { 35struct ip_ct_tcp_state {
@@ -34,7 +37,6 @@ struct ip_ct_tcp_state {
34 u_int32_t td_maxend; /* max of ack + max(win, 1) */ 37 u_int32_t td_maxend; /* max of ack + max(win, 1) */
35 u_int32_t td_maxwin; /* max(win) */ 38 u_int32_t td_maxwin; /* max(win) */
36 u_int8_t td_scale; /* window scale factor */ 39 u_int8_t td_scale; /* window scale factor */
37 u_int8_t loose; /* used when connection picked up from the middle */
38 u_int8_t flags; /* per direction options */ 40 u_int8_t flags; /* per direction options */
39}; 41};
40 42
diff --git a/include/linux/netfilter/xt_TCPMSS.h b/include/linux/netfilter/xt_TCPMSS.h
new file mode 100644
index 000000000000..53a292cd47f3
--- /dev/null
+++ b/include/linux/netfilter/xt_TCPMSS.h
@@ -0,0 +1,10 @@
1#ifndef _XT_TCPMSS_H
2#define _XT_TCPMSS_H
3
4struct xt_tcpmss_info {
5 u_int16_t mss;
6};
7
8#define XT_TCPMSS_CLAMP_PMTU 0xffff
9
10#endif /* _XT_TCPMSS_H */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index 33581c13d947..da9274e6bf12 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -301,6 +301,12 @@ extern unsigned int ip_conntrack_htable_size;
301extern int ip_conntrack_checksum; 301extern int ip_conntrack_checksum;
302 302
303#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) 303#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++)
304#define CONNTRACK_STAT_INC_ATOMIC(count) \
305do { \
306 local_bh_disable(); \
307 __get_cpu_var(ip_conntrack_stat).count++; \
308 local_bh_enable(); \
309} while (0)
304 310
305#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS 311#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS
306#include <linux/notifier.h> 312#include <linux/notifier.h>
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h
index bdf553620ca1..bbca89aab813 100644
--- a/include/linux/netfilter_ipv4/ip_nat.h
+++ b/include/linux/netfilter_ipv4/ip_nat.h
@@ -16,6 +16,7 @@ enum ip_nat_manip_type
16 16
17#define IP_NAT_RANGE_MAP_IPS 1 17#define IP_NAT_RANGE_MAP_IPS 1
18#define IP_NAT_RANGE_PROTO_SPECIFIED 2 18#define IP_NAT_RANGE_PROTO_SPECIFIED 2
19#define IP_NAT_RANGE_PROTO_RANDOM 4 /* add randomness to "port" selection */
19 20
20/* NAT sequence number modifications */ 21/* NAT sequence number modifications */
21struct ip_nat_seq { 22struct ip_nat_seq {
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 98d566c5e32a..9527296595cd 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -272,25 +272,9 @@ ipt_get_target(struct ipt_entry *e)
272#include <linux/init.h> 272#include <linux/init.h>
273extern void ipt_init(void) __init; 273extern void ipt_init(void) __init;
274 274
275#define ipt_register_target(tgt) \ 275extern int ipt_register_table(struct xt_table *table,
276({ (tgt)->family = AF_INET; \
277 xt_register_target(tgt); })
278#define ipt_unregister_target(tgt) xt_unregister_target(tgt)
279
280#define ipt_register_match(mtch) \
281({ (mtch)->family = AF_INET; \
282 xt_register_match(mtch); })
283#define ipt_unregister_match(mtch) xt_unregister_match(mtch)
284
285//#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl)
286//#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl)
287
288extern int ipt_register_table(struct ipt_table *table,
289 const struct ipt_replace *repl); 276 const struct ipt_replace *repl);
290extern void ipt_unregister_table(struct ipt_table *table); 277extern void ipt_unregister_table(struct xt_table *table);
291
292/* net/sched/ipt.c: Gimme access to your targets! Gets target->me. */
293extern struct ipt_target *ipt_find_target(const char *name, u8 revision);
294 278
295/* Standard entry. */ 279/* Standard entry. */
296struct ipt_standard 280struct ipt_standard
@@ -315,7 +299,7 @@ extern unsigned int ipt_do_table(struct sk_buff **pskb,
315 unsigned int hook, 299 unsigned int hook,
316 const struct net_device *in, 300 const struct net_device *in,
317 const struct net_device *out, 301 const struct net_device *out,
318 struct ipt_table *table); 302 struct xt_table *table);
319 303
320#define IPT_ALIGN(s) XT_ALIGN(s) 304#define IPT_ALIGN(s) XT_ALIGN(s)
321 305
diff --git a/include/linux/netfilter_ipv4/ipt_TCPMSS.h b/include/linux/netfilter_ipv4/ipt_TCPMSS.h
index aadb39580cd3..7a850f945824 100644
--- a/include/linux/netfilter_ipv4/ipt_TCPMSS.h
+++ b/include/linux/netfilter_ipv4/ipt_TCPMSS.h
@@ -1,10 +1,9 @@
1#ifndef _IPT_TCPMSS_H 1#ifndef _IPT_TCPMSS_H
2#define _IPT_TCPMSS_H 2#define _IPT_TCPMSS_H
3 3
4struct ipt_tcpmss_info { 4#include <linux/netfilter/xt_TCPMSS.h>
5 u_int16_t mss;
6};
7 5
8#define IPT_TCPMSS_CLAMP_PMTU 0xffff 6#define ipt_tcpmss_info xt_tcpmss_info
7#define IPT_TCPMSS_CLAMP_PMTU XT_TCPMSS_CLAMP_PMTU
9 8
10#endif /*_IPT_TCPMSS_H*/ 9#endif /*_IPT_TCPMSS_H*/
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 4aed340401db..61aa10412fc8 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -104,6 +104,25 @@ struct ip6t_entry
104 unsigned char elems[0]; 104 unsigned char elems[0];
105}; 105};
106 106
107/* Standard entry */
108struct ip6t_standard
109{
110 struct ip6t_entry entry;
111 struct ip6t_standard_target target;
112};
113
114struct ip6t_error_target
115{
116 struct ip6t_entry_target target;
117 char errorname[IP6T_FUNCTION_MAXNAMELEN];
118};
119
120struct ip6t_error
121{
122 struct ip6t_entry entry;
123 struct ip6t_error_target target;
124};
125
107/* 126/*
108 * New IP firewall options for [gs]etsockopt at the RAW IP level. 127 * New IP firewall options for [gs]etsockopt at the RAW IP level.
109 * Unlike BSD Linux inherits IP options so you don't have to use 128 * Unlike BSD Linux inherits IP options so you don't have to use
@@ -286,24 +305,14 @@ ip6t_get_target(struct ip6t_entry *e)
286#include <linux/init.h> 305#include <linux/init.h>
287extern void ip6t_init(void) __init; 306extern void ip6t_init(void) __init;
288 307
289#define ip6t_register_target(tgt) \ 308extern int ip6t_register_table(struct xt_table *table,
290({ (tgt)->family = AF_INET6; \
291 xt_register_target(tgt); })
292#define ip6t_unregister_target(tgt) xt_unregister_target(tgt)
293
294#define ip6t_register_match(match) \
295({ (match)->family = AF_INET6; \
296 xt_register_match(match); })
297#define ip6t_unregister_match(match) xt_unregister_match(match)
298
299extern int ip6t_register_table(struct ip6t_table *table,
300 const struct ip6t_replace *repl); 309 const struct ip6t_replace *repl);
301extern void ip6t_unregister_table(struct ip6t_table *table); 310extern void ip6t_unregister_table(struct xt_table *table);
302extern unsigned int ip6t_do_table(struct sk_buff **pskb, 311extern unsigned int ip6t_do_table(struct sk_buff **pskb,
303 unsigned int hook, 312 unsigned int hook,
304 const struct net_device *in, 313 const struct net_device *in,
305 const struct net_device *out, 314 const struct net_device *out,
306 struct ip6t_table *table); 315 struct xt_table *table);
307 316
308/* Check for an extension */ 317/* Check for an extension */
309extern int ip6t_ext_hdr(u8 nexthdr); 318extern int ip6t_ext_hdr(u8 nexthdr);
diff --git a/include/linux/netfilter_ipv6/ip6t_mh.h b/include/linux/netfilter_ipv6/ip6t_mh.h
new file mode 100644
index 000000000000..b9ca9a5f74d0
--- /dev/null
+++ b/include/linux/netfilter_ipv6/ip6t_mh.h
@@ -0,0 +1,15 @@
1#ifndef _IP6T_MH_H
2#define _IP6T_MH_H
3
4/* MH matching stuff */
5struct ip6t_mh
6{
7 u_int8_t types[2]; /* MH type range */
8 u_int8_t invflags; /* Inverse flags */
9};
10
11/* Values for "invflags" field in struct ip6t_mh. */
12#define IP6T_MH_INV_TYPE 0x01 /* Invert the sense of type. */
13#define IP6T_MH_INV_MASK 0x01 /* All possible flags. */
14
15#endif /*_IP6T_MH_H*/
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index b3b9b609ee89..2a20f488ac1b 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -23,6 +23,7 @@
23#define NETLINK_GENERIC 16 23#define NETLINK_GENERIC 16
24/* leave room for NETLINK_DM (DM Events) */ 24/* leave room for NETLINK_DM (DM Events) */
25#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */ 25#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */
26#define NETLINK_ECRYPTFS 19
26 27
27#define MAX_LINKS 32 28#define MAX_LINKS 32
28 29
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index c0d03767b8c4..47aaa2c66738 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -323,9 +323,9 @@ static inline void nfs_fattr_init(struct nfs_fattr *fattr)
323/* 323/*
324 * linux/fs/nfs/file.c 324 * linux/fs/nfs/file.c
325 */ 325 */
326extern struct inode_operations nfs_file_inode_operations; 326extern const struct inode_operations nfs_file_inode_operations;
327#ifdef CONFIG_NFS_V3 327#ifdef CONFIG_NFS_V3
328extern struct inode_operations nfs3_file_inode_operations; 328extern const struct inode_operations nfs3_file_inode_operations;
329#endif /* CONFIG_NFS_V3 */ 329#endif /* CONFIG_NFS_V3 */
330extern const struct file_operations nfs_file_operations; 330extern const struct file_operations nfs_file_operations;
331extern const struct address_space_operations nfs_file_aops; 331extern const struct address_space_operations nfs_file_aops;
@@ -372,9 +372,9 @@ extern ssize_t nfs_file_direct_write(struct kiocb *iocb,
372/* 372/*
373 * linux/fs/nfs/dir.c 373 * linux/fs/nfs/dir.c
374 */ 374 */
375extern struct inode_operations nfs_dir_inode_operations; 375extern const struct inode_operations nfs_dir_inode_operations;
376#ifdef CONFIG_NFS_V3 376#ifdef CONFIG_NFS_V3
377extern struct inode_operations nfs3_dir_inode_operations; 377extern const struct inode_operations nfs3_dir_inode_operations;
378#endif /* CONFIG_NFS_V3 */ 378#endif /* CONFIG_NFS_V3 */
379extern const struct file_operations nfs_dir_operations; 379extern const struct file_operations nfs_dir_operations;
380extern struct dentry_operations nfs_dentry_operations; 380extern struct dentry_operations nfs_dentry_operations;
@@ -384,7 +384,7 @@ extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_
384/* 384/*
385 * linux/fs/nfs/symlink.c 385 * linux/fs/nfs/symlink.c
386 */ 386 */
387extern struct inode_operations nfs_symlink_inode_operations; 387extern const struct inode_operations nfs_symlink_inode_operations;
388 388
389/* 389/*
390 * linux/fs/nfs/sysctl.c 390 * linux/fs/nfs/sysctl.c
@@ -401,8 +401,8 @@ extern void nfs_unregister_sysctl(void);
401 * linux/fs/nfs/namespace.c 401 * linux/fs/nfs/namespace.c
402 */ 402 */
403extern struct list_head nfs_automount_list; 403extern struct list_head nfs_automount_list;
404extern struct inode_operations nfs_mountpoint_inode_operations; 404extern const struct inode_operations nfs_mountpoint_inode_operations;
405extern struct inode_operations nfs_referral_inode_operations; 405extern const struct inode_operations nfs_referral_inode_operations;
406extern int nfs_mountpoint_expiry_timeout; 406extern int nfs_mountpoint_expiry_timeout;
407extern void nfs_release_automount_timer(void); 407extern void nfs_release_automount_timer(void);
408 408
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 115c8120ff13..10c26ed0db71 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -767,8 +767,8 @@ struct nfs_access_entry;
767struct nfs_rpc_ops { 767struct nfs_rpc_ops {
768 int version; /* Protocol version */ 768 int version; /* Protocol version */
769 struct dentry_operations *dentry_ops; 769 struct dentry_operations *dentry_ops;
770 struct inode_operations *dir_inode_ops; 770 const struct inode_operations *dir_inode_ops;
771 struct inode_operations *file_inode_ops; 771 const struct inode_operations *file_inode_ops;
772 772
773 int (*getroot) (struct nfs_server *, struct nfs_fh *, 773 int (*getroot) (struct nfs_server *, struct nfs_fh *,
774 struct nfs_fsinfo *); 774 struct nfs_fsinfo *);
diff --git a/include/linux/nfsd/const.h b/include/linux/nfsd/const.h
index f0cc77790527..323f8cfa060a 100644
--- a/include/linux/nfsd/const.h
+++ b/include/linux/nfsd/const.h
@@ -30,10 +30,6 @@
30 30
31#include <linux/sunrpc/msg_prot.h> 31#include <linux/sunrpc/msg_prot.h>
32 32
33#ifndef NFS_SUPER_MAGIC
34# define NFS_SUPER_MAGIC 0x6969
35#endif
36
37/* 33/*
38 * Largest number of bytes we need to allocate for an NFS 34 * Largest number of bytes we need to allocate for an NFS
39 * call or reply. Used to control buffer sizes. We use 35 * call or reply. Used to control buffer sizes. We use
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index c3e255bf8594..7a8dcb82a699 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -76,8 +76,6 @@ extern struct page * find_get_page(struct address_space *mapping,
76 unsigned long index); 76 unsigned long index);
77extern struct page * find_lock_page(struct address_space *mapping, 77extern struct page * find_lock_page(struct address_space *mapping,
78 unsigned long index); 78 unsigned long index);
79extern __deprecated_for_modules struct page * find_trylock_page(
80 struct address_space *mapping, unsigned long index);
81extern struct page * find_or_create_page(struct address_space *mapping, 79extern struct page * find_or_create_page(struct address_space *mapping,
82 unsigned long index, gfp_t gfp_mask); 80 unsigned long index, gfp_t gfp_mask);
83unsigned find_get_pages(struct address_space *mapping, pgoff_t start, 81unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
diff --git a/include/linux/pci.h b/include/linux/pci.h
index f3c617eabd8d..98c8765a488e 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -167,6 +167,7 @@ struct pci_dev {
167 unsigned int broken_parity_status:1; /* Device generates false positive parity */ 167 unsigned int broken_parity_status:1; /* Device generates false positive parity */
168 unsigned int msi_enabled:1; 168 unsigned int msi_enabled:1;
169 unsigned int msix_enabled:1; 169 unsigned int msix_enabled:1;
170 unsigned int is_managed:1;
170 atomic_t enable_cnt; /* pci_enable_device has been called */ 171 atomic_t enable_cnt; /* pci_enable_device has been called */
171 172
172 u32 saved_config_space[16]; /* config space saved at suspend time */ 173 u32 saved_config_space[16]; /* config space saved at suspend time */
@@ -174,6 +175,9 @@ struct pci_dev {
174 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ 175 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */
175 int rom_attr_enabled; /* has display of the rom attribute been enabled? */ 176 int rom_attr_enabled; /* has display of the rom attribute been enabled? */
176 struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ 177 struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */
178#ifdef CONFIG_PCI_MSI
179 unsigned int first_msi_irq;
180#endif
177}; 181};
178 182
179#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) 183#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
@@ -181,6 +185,11 @@ struct pci_dev {
181#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 185#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
182#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 186#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
183 187
188static inline int pci_channel_offline(struct pci_dev *pdev)
189{
190 return (pdev->error_state != pci_channel_io_normal);
191}
192
184static inline struct pci_cap_saved_state *pci_find_saved_cap( 193static inline struct pci_cap_saved_state *pci_find_saved_cap(
185 struct pci_dev *pci_dev,char cap) 194 struct pci_dev *pci_dev,char cap)
186{ 195{
@@ -463,8 +472,7 @@ extern void pci_sort_breadthfirst(void);
463 472
464/* Generic PCI functions exported to card drivers */ 473/* Generic PCI functions exported to card drivers */
465 474
466struct pci_dev *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from); 475struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from);
467struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int device, const struct pci_dev *from);
468struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); 476struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
469int pci_find_capability (struct pci_dev *dev, int cap); 477int pci_find_capability (struct pci_dev *dev, int cap);
470int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 478int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
@@ -521,6 +529,14 @@ static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val
521 529
522int __must_check pci_enable_device(struct pci_dev *dev); 530int __must_check pci_enable_device(struct pci_dev *dev);
523int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); 531int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask);
532int __must_check pcim_enable_device(struct pci_dev *pdev);
533void pcim_pin_device(struct pci_dev *pdev);
534
535static inline int pci_is_managed(struct pci_dev *pdev)
536{
537 return pdev->is_managed;
538}
539
524void pci_disable_device(struct pci_dev *dev); 540void pci_disable_device(struct pci_dev *dev);
525void pci_set_master(struct pci_dev *dev); 541void pci_set_master(struct pci_dev *dev);
526#define HAVE_PCI_SET_MWI 542#define HAVE_PCI_SET_MWI
@@ -533,6 +549,7 @@ void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
533int __must_check pci_assign_resource(struct pci_dev *dev, int i); 549int __must_check pci_assign_resource(struct pci_dev *dev, int i);
534int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i); 550int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i);
535void pci_restore_bars(struct pci_dev *dev); 551void pci_restore_bars(struct pci_dev *dev);
552int pci_select_bars(struct pci_dev *dev, unsigned long flags);
536 553
537/* ROM control related routines */ 554/* ROM control related routines */
538void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); 555void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size);
@@ -561,6 +578,8 @@ int __must_check pci_request_regions(struct pci_dev *, const char *);
561void pci_release_regions(struct pci_dev *); 578void pci_release_regions(struct pci_dev *);
562int __must_check pci_request_region(struct pci_dev *, int, const char *); 579int __must_check pci_request_region(struct pci_dev *, int, const char *);
563void pci_release_region(struct pci_dev *, int); 580void pci_release_region(struct pci_dev *, int);
581int pci_request_selected_regions(struct pci_dev *, int, const char *);
582void pci_release_selected_regions(struct pci_dev *, int);
564 583
565/* drivers/pci/bus.c */ 584/* drivers/pci/bus.c */
566int __must_check pci_bus_alloc_resource(struct pci_bus *bus, 585int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
@@ -573,10 +592,11 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
573void pci_enable_bridges(struct pci_bus *bus); 592void pci_enable_bridges(struct pci_bus *bus);
574 593
575/* Proper probing supporting hot-pluggable devices */ 594/* Proper probing supporting hot-pluggable devices */
576int __must_check __pci_register_driver(struct pci_driver *, struct module *); 595int __must_check __pci_register_driver(struct pci_driver *, struct module *,
596 const char *mod_name);
577static inline int __must_check pci_register_driver(struct pci_driver *driver) 597static inline int __must_check pci_register_driver(struct pci_driver *driver)
578{ 598{
579 return __pci_register_driver(driver, THIS_MODULE); 599 return __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME);
580} 600}
581 601
582void pci_unregister_driver(struct pci_driver *); 602void pci_unregister_driver(struct pci_driver *);
@@ -611,10 +631,6 @@ enum pci_dma_burst_strategy {
611 strategy_parameter byte boundaries */ 631 strategy_parameter byte boundaries */
612}; 632};
613 633
614#if defined(CONFIG_ISA) || defined(CONFIG_EISA)
615extern struct pci_dev *isa_bridge;
616#endif
617
618struct msix_entry { 634struct msix_entry {
619 u16 vector; /* kernel uses to write allocated vector */ 635 u16 vector; /* kernel uses to write allocated vector */
620 u16 entry; /* driver uses to specify entry, OS writes */ 636 u16 entry; /* driver uses to specify entry, OS writes */
@@ -622,7 +638,6 @@ struct msix_entry {
622 638
623 639
624#ifndef CONFIG_PCI_MSI 640#ifndef CONFIG_PCI_MSI
625static inline void pci_scan_msi_device(struct pci_dev *dev) {}
626static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} 641static inline int pci_enable_msi(struct pci_dev *dev) {return -1;}
627static inline void pci_disable_msi(struct pci_dev *dev) {} 642static inline void pci_disable_msi(struct pci_dev *dev) {}
628static inline int pci_enable_msix(struct pci_dev* dev, 643static inline int pci_enable_msix(struct pci_dev* dev,
@@ -630,7 +645,6 @@ static inline int pci_enable_msix(struct pci_dev* dev,
630static inline void pci_disable_msix(struct pci_dev *dev) {} 645static inline void pci_disable_msix(struct pci_dev *dev) {}
631static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {} 646static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {}
632#else 647#else
633extern void pci_scan_msi_device(struct pci_dev *dev);
634extern int pci_enable_msi(struct pci_dev *dev); 648extern int pci_enable_msi(struct pci_dev *dev);
635extern void pci_disable_msi(struct pci_dev *dev); 649extern void pci_disable_msi(struct pci_dev *dev);
636extern int pci_enable_msix(struct pci_dev* dev, 650extern int pci_enable_msix(struct pci_dev* dev,
@@ -722,8 +736,6 @@ static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) {
722static inline pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { return PCI_D0; } 736static inline pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { return PCI_D0; }
723static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) { return 0; } 737static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) { return 0; }
724 738
725#define isa_bridge ((struct pci_dev *)NULL)
726
727#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) 739#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
728 740
729static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } 741static inline void pci_block_user_cfg_access(struct pci_dev *dev) { }
@@ -828,6 +840,11 @@ enum pci_fixup_pass {
828 840
829void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); 841void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);
830 842
843void __iomem * pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
844void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr);
845void __iomem * const * pcim_iomap_table(struct pci_dev *pdev);
846int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name);
847
831extern int pci_pci_problems; 848extern int pci_pci_problems;
832#define PCIPCI_FAIL 1 /* No PCI PCI DMA */ 849#define PCIPCI_FAIL 1 /* No PCI PCI DMA */
833#define PCIPCI_TRITON 2 850#define PCIPCI_TRITON 2
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 3d1d21035dec..8fb9c3e06eef 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -15,6 +15,8 @@
15#define PCI_CLASS_STORAGE_FLOPPY 0x0102 15#define PCI_CLASS_STORAGE_FLOPPY 0x0102
16#define PCI_CLASS_STORAGE_IPI 0x0103 16#define PCI_CLASS_STORAGE_IPI 0x0103
17#define PCI_CLASS_STORAGE_RAID 0x0104 17#define PCI_CLASS_STORAGE_RAID 0x0104
18#define PCI_CLASS_STORAGE_SATA 0x0106
19#define PCI_CLASS_STORAGE_SATA_AHCI 0x010601
18#define PCI_CLASS_STORAGE_SAS 0x0107 20#define PCI_CLASS_STORAGE_SAS 0x0107
19#define PCI_CLASS_STORAGE_OTHER 0x0180 21#define PCI_CLASS_STORAGE_OTHER 0x0180
20 22
@@ -95,6 +97,7 @@
95 97
96#define PCI_BASE_CLASS_SERIAL 0x0c 98#define PCI_BASE_CLASS_SERIAL 0x0c
97#define PCI_CLASS_SERIAL_FIREWIRE 0x0c00 99#define PCI_CLASS_SERIAL_FIREWIRE 0x0c00
100#define PCI_CLASS_SERIAL_FIREWIRE_OHCI 0x0c0010
98#define PCI_CLASS_SERIAL_ACCESS 0x0c01 101#define PCI_CLASS_SERIAL_ACCESS 0x0c01
99#define PCI_CLASS_SERIAL_SSA 0x0c02 102#define PCI_CLASS_SERIAL_SSA 0x0c02
100#define PCI_CLASS_SERIAL_USB 0x0c03 103#define PCI_CLASS_SERIAL_USB 0x0c03
@@ -735,9 +738,11 @@
735#define PCI_DEVICE_ID_TI_TVP4020 0x3d07 738#define PCI_DEVICE_ID_TI_TVP4020 0x3d07
736#define PCI_DEVICE_ID_TI_4450 0x8011 739#define PCI_DEVICE_ID_TI_4450 0x8011
737#define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 740#define PCI_DEVICE_ID_TI_XX21_XX11 0x8031
741#define PCI_DEVICE_ID_TI_XX21_XX11_FM 0x8033
738#define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034 742#define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034
739#define PCI_DEVICE_ID_TI_X515 0x8036 743#define PCI_DEVICE_ID_TI_X515 0x8036
740#define PCI_DEVICE_ID_TI_XX12 0x8039 744#define PCI_DEVICE_ID_TI_XX12 0x8039
745#define PCI_DEVICE_ID_TI_XX12_FM 0x803b
741#define PCI_DEVICE_ID_TI_1130 0xac12 746#define PCI_DEVICE_ID_TI_1130 0xac12
742#define PCI_DEVICE_ID_TI_1031 0xac13 747#define PCI_DEVICE_ID_TI_1031 0xac13
743#define PCI_DEVICE_ID_TI_1131 0xac15 748#define PCI_DEVICE_ID_TI_1131 0xac15
@@ -765,6 +770,7 @@
765#define PCI_DEVICE_ID_TI_1510 0xac56 770#define PCI_DEVICE_ID_TI_1510 0xac56
766#define PCI_DEVICE_ID_TI_X620 0xac8d 771#define PCI_DEVICE_ID_TI_X620 0xac8d
767#define PCI_DEVICE_ID_TI_X420 0xac8e 772#define PCI_DEVICE_ID_TI_X420 0xac8e
773#define PCI_DEVICE_ID_TI_XX20_FM 0xac8f
768 774
769#define PCI_VENDOR_ID_SONY 0x104d 775#define PCI_VENDOR_ID_SONY 0x104d
770 776
@@ -953,6 +959,7 @@
953#define PCI_DEVICE_ID_PLX_R753 0x1152 959#define PCI_DEVICE_ID_PLX_R753 0x1152
954#define PCI_DEVICE_ID_PLX_OLITEC 0x1187 960#define PCI_DEVICE_ID_PLX_OLITEC 0x1187
955#define PCI_DEVICE_ID_PLX_PCI200SYN 0x3196 961#define PCI_DEVICE_ID_PLX_PCI200SYN 0x3196
962#define PCI_DEVICE_ID_PLX_9030 0x9030
956#define PCI_DEVICE_ID_PLX_9050 0x9050 963#define PCI_DEVICE_ID_PLX_9050 0x9050
957#define PCI_DEVICE_ID_PLX_9080 0x9080 964#define PCI_DEVICE_ID_PLX_9080 0x9080
958#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 965#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001
@@ -1451,6 +1458,7 @@
1451 1458
1452#define PCI_VENDOR_ID_TOSHIBA_2 0x102f 1459#define PCI_VENDOR_ID_TOSHIBA_2 0x102f
1453#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 1460#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030
1461#define PCI_DEVICE_ID_TOSHIBA_TC86C001_IDE 0x0105
1454#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 1462#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108
1455#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3 1463#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3
1456 1464
@@ -1628,6 +1636,7 @@
1628#define PCI_VENDOR_ID_ITE 0x1283 1636#define PCI_VENDOR_ID_ITE 0x1283
1629#define PCI_DEVICE_ID_ITE_8211 0x8211 1637#define PCI_DEVICE_ID_ITE_8211 0x8211
1630#define PCI_DEVICE_ID_ITE_8212 0x8212 1638#define PCI_DEVICE_ID_ITE_8212 0x8212
1639#define PCI_DEVICE_ID_ITE_8213 0x8213
1631#define PCI_DEVICE_ID_ITE_8872 0x8872 1640#define PCI_DEVICE_ID_ITE_8872 0x8872
1632#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886 1641#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886
1633 1642
@@ -1688,6 +1697,8 @@
1688#define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8 1697#define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8
1689#define PCI_DEVICE_ID_LML_33R10 0x8a02 1698#define PCI_DEVICE_ID_LML_33R10 0x8a02
1690 1699
1700#define PCI_VENDOR_ID_ESDGMBH 0x12fe
1701#define PCI_DEVICE_ID_ESDGMBH_CPCIASIO4 0x0111
1691 1702
1692#define PCI_VENDOR_ID_SIIG 0x131f 1703#define PCI_VENDOR_ID_SIIG 0x131f
1693#define PCI_SUBVENDOR_ID_SIIG 0x131f 1704#define PCI_SUBVENDOR_ID_SIIG 0x131f
@@ -1803,6 +1814,9 @@
1803#define PCI_DEVICE_ID_MOXA_C168 0x1680 1814#define PCI_DEVICE_ID_MOXA_C168 0x1680
1804#define PCI_DEVICE_ID_MOXA_CP168U 0x1681 1815#define PCI_DEVICE_ID_MOXA_CP168U 0x1681
1805#define PCI_DEVICE_ID_MOXA_CP168EL 0x1682 1816#define PCI_DEVICE_ID_MOXA_CP168EL 0x1682
1817#define PCI_DEVICE_ID_MOXA_CP204J 0x2040
1818#define PCI_DEVICE_ID_MOXA_C218 0x2180
1819#define PCI_DEVICE_ID_MOXA_C320 0x3200
1806 1820
1807#define PCI_VENDOR_ID_CCD 0x1397 1821#define PCI_VENDOR_ID_CCD 0x1397
1808#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 1822#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0
@@ -1971,6 +1985,7 @@
1971#define PCI_DEVICE_ID_TOPIC_TP560 0x0000 1985#define PCI_DEVICE_ID_TOPIC_TP560 0x0000
1972 1986
1973#define PCI_VENDOR_ID_ENE 0x1524 1987#define PCI_VENDOR_ID_ENE 0x1524
1988#define PCI_DEVICE_ID_ENE_CB712_SD 0x0550
1974#define PCI_DEVICE_ID_ENE_1211 0x1211 1989#define PCI_DEVICE_ID_ENE_1211 0x1211
1975#define PCI_DEVICE_ID_ENE_1225 0x1225 1990#define PCI_DEVICE_ID_ENE_1225 0x1225
1976#define PCI_DEVICE_ID_ENE_1410 0x1410 1991#define PCI_DEVICE_ID_ENE_1410 0x1410
@@ -1982,6 +1997,10 @@
1982 1997
1983#define PCI_VENDOR_ID_CHELSIO 0x1425 1998#define PCI_VENDOR_ID_CHELSIO 0x1425
1984 1999
2000#define PCI_SUBVENDOR_ID_PERLE 0x155f
2001#define PCI_SUBDEVICE_ID_PCI_RAS4 0xf001
2002#define PCI_SUBDEVICE_ID_PCI_RAS8 0xf010
2003
1985 2004
1986#define PCI_VENDOR_ID_SYBA 0x1592 2005#define PCI_VENDOR_ID_SYBA 0x1592
1987#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 2006#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782
@@ -2066,6 +2085,10 @@
2066#define PCI_VENDOR_ID_TDI 0x192E 2085#define PCI_VENDOR_ID_TDI 0x192E
2067#define PCI_DEVICE_ID_TDI_EHCI 0x0101 2086#define PCI_DEVICE_ID_TDI_EHCI 0x0101
2068 2087
2088#define PCI_VENDOR_ID_PASEMI 0x1959
2089
2090#define PCI_VENDOR_ID_ATTANSIC 0x1969
2091
2069#define PCI_VENDOR_ID_JMICRON 0x197B 2092#define PCI_VENDOR_ID_JMICRON 0x197B
2070#define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 2093#define PCI_DEVICE_ID_JMICRON_JMB360 0x2360
2071#define PCI_DEVICE_ID_JMICRON_JMB361 0x2361 2094#define PCI_DEVICE_ID_JMICRON_JMB361 0x2361
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index 265bafab6494..d9db5f62ee48 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -251,7 +251,8 @@ struct sadb_x_sec_ctx {
251#define SADB_X_SPDEXPIRE 21 251#define SADB_X_SPDEXPIRE 21
252#define SADB_X_SPDDELETE2 22 252#define SADB_X_SPDDELETE2 22
253#define SADB_X_NAT_T_NEW_MAPPING 23 253#define SADB_X_NAT_T_NEW_MAPPING 23
254#define SADB_MAX 23 254#define SADB_X_MIGRATE 24
255#define SADB_MAX 24
255 256
256/* Security Association flags */ 257/* Security Association flags */
257#define SADB_SAFLAGS_PFS 1 258#define SADB_SAFLAGS_PFS 1
@@ -297,6 +298,7 @@ struct sadb_x_sec_ctx {
297#define SADB_X_EALG_BLOWFISHCBC 7 298#define SADB_X_EALG_BLOWFISHCBC 7
298#define SADB_EALG_NULL 11 299#define SADB_EALG_NULL 11
299#define SADB_X_EALG_AESCBC 12 300#define SADB_X_EALG_AESCBC 12
301#define SADB_X_EALG_CAMELLIACBC 22
300#define SADB_EALG_MAX 253 /* last EALG */ 302#define SADB_EALG_MAX 253 /* last EALG */
301/* private allocations should use 249-255 (RFC2407) */ 303/* private allocations should use 249-255 (RFC2407) */
302#define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */ 304#define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */
diff --git a/include/linux/phonedev.h b/include/linux/phonedev.h
index a0e31adf3abe..4269de99e320 100644
--- a/include/linux/phonedev.h
+++ b/include/linux/phonedev.h
@@ -9,7 +9,7 @@
9 9
10struct phone_device { 10struct phone_device {
11 struct phone_device *next; 11 struct phone_device *next;
12 struct file_operations *f_op; 12 const struct file_operations *f_op;
13 int (*open) (struct phone_device *, struct file *); 13 int (*open) (struct phone_device *, struct file *);
14 int board; /* Device private index */ 14 int board; /* Device private index */
15 int minor; 15 int minor;
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 4dec047b1837..2ac27f9997dd 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -105,20 +105,6 @@ static inline pid_t pid_nr(struct pid *pid)
105 return nr; 105 return nr;
106} 106}
107 107
108
109#define do_each_task_pid(who, type, task) \
110 do { \
111 struct hlist_node *pos___; \
112 struct pid *pid___ = find_pid(who); \
113 if (pid___ != NULL) \
114 hlist_for_each_entry_rcu((task), pos___, \
115 &pid___->tasks[type], pids[type].node) {
116
117#define while_each_task_pid(who, type, task) \
118 } \
119 } while (0)
120
121
122#define do_each_pid_task(pid, type, task) \ 108#define do_each_pid_task(pid, type, task) \
123 do { \ 109 do { \
124 struct hlist_node *pos___; \ 110 struct hlist_node *pos___; \
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index ab8a8dd8d64c..9a5226f0f169 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -352,6 +352,8 @@ struct pnp_protocol {
352 (dev) = protocol_to_pnp_dev((dev)->protocol_list.next)) 352 (dev) = protocol_to_pnp_dev((dev)->protocol_list.next))
353 353
354 354
355extern struct bus_type pnp_bus_type;
356
355#if defined(CONFIG_PNP) 357#if defined(CONFIG_PNP)
356 358
357/* device management */ 359/* device management */
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 87dec8fe6de9..2e132473cbe5 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -55,8 +55,8 @@ struct proc_dir_entry {
55 uid_t uid; 55 uid_t uid;
56 gid_t gid; 56 gid_t gid;
57 loff_t size; 57 loff_t size;
58 struct inode_operations * proc_iops; 58 const struct inode_operations *proc_iops;
59 const struct file_operations * proc_fops; 59 const struct file_operations *proc_fops;
60 get_info_t *get_info; 60 get_info_t *get_info;
61 struct module *owner; 61 struct module *owner;
62 struct proc_dir_entry *next, *parent, *subdir; 62 struct proc_dir_entry *next, *parent, *subdir;
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h
index 0c7ac444fd35..19bc9b8b6191 100644
--- a/include/linux/qnx4_fs.h
+++ b/include/linux/qnx4_fs.h
@@ -116,8 +116,8 @@ extern unsigned long qnx4_block_map(struct inode *inode, long iblock);
116 116
117extern struct buffer_head *qnx4_bread(struct inode *, int, int); 117extern struct buffer_head *qnx4_bread(struct inode *, int, int);
118 118
119extern struct inode_operations qnx4_file_inode_operations; 119extern const struct inode_operations qnx4_file_inode_operations;
120extern struct inode_operations qnx4_dir_inode_operations; 120extern const struct inode_operations qnx4_dir_inode_operations;
121extern const struct file_operations qnx4_file_operations; 121extern const struct file_operations qnx4_file_operations;
122extern const struct file_operations qnx4_dir_operations; 122extern const struct file_operations qnx4_dir_operations;
123extern int qnx4_is_free(struct super_block *sb, long block); 123extern int qnx4_is_free(struct super_block *sb, long block);
diff --git a/include/linux/quota.h b/include/linux/quota.h
index b8fbf26eb885..77db80a953d6 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -132,6 +132,7 @@ struct if_dqinfo {
132 132
133#ifdef __KERNEL__ 133#ifdef __KERNEL__
134#include <linux/spinlock.h> 134#include <linux/spinlock.h>
135#include <linux/rwsem.h>
135#include <linux/mutex.h> 136#include <linux/mutex.h>
136 137
137#include <linux/dqblk_xfs.h> 138#include <linux/dqblk_xfs.h>
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index ebd42a3710b4..6db9a4c15355 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -247,6 +247,7 @@ struct bitmap {
247 247
248 atomic_t pending_writes; /* pending writes to the bitmap file */ 248 atomic_t pending_writes; /* pending writes to the bitmap file */
249 wait_queue_head_t write_wait; 249 wait_queue_head_t write_wait;
250 wait_queue_head_t overflow_wait;
250 251
251}; 252};
252 253
diff --git a/include/linux/random.h b/include/linux/random.h
index 01ad71033d65..36f125c0c603 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -63,7 +63,7 @@ extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
63 __be16 sport, __be16 dport); 63 __be16 sport, __be16 dport);
64 64
65#ifndef MODULE 65#ifndef MODULE
66extern struct file_operations random_fops, urandom_fops; 66extern const struct file_operations random_fops, urandom_fops;
67#endif 67#endif
68 68
69unsigned int get_random_int(void); 69unsigned int get_random_int(void);
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index c3fc6caaad3f..965d5b3ea9eb 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1949,9 +1949,9 @@ int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset,
1949#endif 1949#endif
1950 1950
1951/* dir.c */ 1951/* dir.c */
1952extern struct inode_operations reiserfs_dir_inode_operations; 1952extern const struct inode_operations reiserfs_dir_inode_operations;
1953extern struct inode_operations reiserfs_symlink_inode_operations; 1953extern const struct inode_operations reiserfs_symlink_inode_operations;
1954extern struct inode_operations reiserfs_special_inode_operations; 1954extern const struct inode_operations reiserfs_special_inode_operations;
1955extern const struct file_operations reiserfs_dir_operations; 1955extern const struct file_operations reiserfs_dir_operations;
1956 1956
1957/* tail_conversion.c */ 1957/* tail_conversion.c */
@@ -1963,7 +1963,7 @@ int indirect2direct(struct reiserfs_transaction_handle *, struct inode *,
1963void reiserfs_unmap_buffer(struct buffer_head *); 1963void reiserfs_unmap_buffer(struct buffer_head *);
1964 1964
1965/* file.c */ 1965/* file.c */
1966extern struct inode_operations reiserfs_file_inode_operations; 1966extern const struct inode_operations reiserfs_file_inode_operations;
1967extern const struct file_operations reiserfs_file_operations; 1967extern const struct file_operations reiserfs_file_operations;
1968extern const struct address_space_operations reiserfs_address_space_operations; 1968extern const struct address_space_operations reiserfs_address_space_operations;
1969 1969
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 966c35851b2e..66a96814d614 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -2,7 +2,10 @@
2 File: linux/reiserfs_xattr.h 2 File: linux/reiserfs_xattr.h
3*/ 3*/
4 4
5#include <linux/xattr.h> 5#ifndef _LINUX_REISERFS_XATTR_H
6#define _LINUX_REISERFS_XATTR_H
7
8#include <linux/types.h>
6 9
7/* Magic value in header */ 10/* Magic value in header */
8#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */ 11#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */
@@ -13,7 +16,18 @@ struct reiserfs_xattr_header {
13}; 16};
14 17
15#ifdef __KERNEL__ 18#ifdef __KERNEL__
19
16#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/list.h>
22#include <linux/rwsem.h>
23#include <linux/reiserfs_fs_i.h>
24#include <linux/reiserfs_fs.h>
25
26struct inode;
27struct dentry;
28struct iattr;
29struct super_block;
30struct nameidata;
17 31
18struct reiserfs_xattr_handler { 32struct reiserfs_xattr_handler {
19 char *prefix; 33 char *prefix;
@@ -49,9 +63,7 @@ int reiserfs_xattr_set(struct inode *, const char *, const void *, size_t, int);
49 63
50extern struct reiserfs_xattr_handler user_handler; 64extern struct reiserfs_xattr_handler user_handler;
51extern struct reiserfs_xattr_handler trusted_handler; 65extern struct reiserfs_xattr_handler trusted_handler;
52#ifdef CONFIG_REISERFS_FS_SECURITY
53extern struct reiserfs_xattr_handler security_handler; 66extern struct reiserfs_xattr_handler security_handler;
54#endif
55 67
56int reiserfs_xattr_register_handlers(void) __init; 68int reiserfs_xattr_register_handlers(void) __init;
57void reiserfs_xattr_unregister_handlers(void); 69void reiserfs_xattr_unregister_handlers(void);
@@ -137,6 +149,8 @@ static inline int reiserfs_xattr_init(struct super_block *sb, int mount_flags)
137static inline void reiserfs_init_xattr_rwsem(struct inode *inode) 149static inline void reiserfs_init_xattr_rwsem(struct inode *inode)
138{ 150{
139} 151}
140#endif 152#endif /* CONFIG_REISERFS_FS_XATTR */
153
154#endif /* __KERNEL__ */
141 155
142#endif /* __KERNEL__ */ 156#endif /* _LINUX_REISERFS_XATTR_H */
diff --git a/include/linux/relay.h b/include/linux/relay.h
index c6a48bfc8b14..759a0f97bec2 100644
--- a/include/linux/relay.h
+++ b/include/linux/relay.h
@@ -24,7 +24,7 @@
24/* 24/*
25 * Tracks changes to rchan/rchan_buf structs 25 * Tracks changes to rchan/rchan_buf structs
26 */ 26 */
27#define RELAYFS_CHANNEL_VERSION 6 27#define RELAYFS_CHANNEL_VERSION 7
28 28
29/* 29/*
30 * Per-cpu relay channel buffer 30 * Per-cpu relay channel buffer
@@ -64,6 +64,10 @@ struct rchan
64 void *private_data; /* for user-defined data */ 64 void *private_data; /* for user-defined data */
65 size_t last_toobig; /* tried to log event > subbuf size */ 65 size_t last_toobig; /* tried to log event > subbuf size */
66 struct rchan_buf *buf[NR_CPUS]; /* per-cpu channel buffers */ 66 struct rchan_buf *buf[NR_CPUS]; /* per-cpu channel buffers */
67 int is_global; /* One global buffer ? */
68 struct list_head list; /* for channel list */
69 struct dentry *parent; /* parent dentry passed to open */
70 char base_filename[NAME_MAX]; /* saved base filename */
67}; 71};
68 72
69/* 73/*
@@ -162,7 +166,8 @@ struct rchan *relay_open(const char *base_filename,
162 struct dentry *parent, 166 struct dentry *parent,
163 size_t subbuf_size, 167 size_t subbuf_size,
164 size_t n_subbufs, 168 size_t n_subbufs,
165 struct rchan_callbacks *cb); 169 struct rchan_callbacks *cb,
170 void *private_data);
166extern void relay_close(struct rchan *chan); 171extern void relay_close(struct rchan *chan);
167extern void relay_flush(struct rchan *chan); 172extern void relay_flush(struct rchan *chan);
168extern void relay_subbufs_consumed(struct rchan *chan, 173extern void relay_subbufs_consumed(struct rchan *chan,
diff --git a/include/linux/rio.h b/include/linux/rio.h
index d93857056cb9..68e3f6853fa6 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -25,6 +25,7 @@
25 25
26#define RIO_ANY_DESTID 0xff 26#define RIO_ANY_DESTID 0xff
27#define RIO_NO_HOPCOUNT -1 27#define RIO_NO_HOPCOUNT -1
28#define RIO_INVALID_DESTID 0xffff
28 29
29#define RIO_MAX_MPORT_RESOURCES 16 30#define RIO_MAX_MPORT_RESOURCES 16
30#define RIO_MAX_DEV_RESOURCES 16 31#define RIO_MAX_DEV_RESOURCES 16
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 446373535190..5053dc01fad4 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -436,7 +436,7 @@ struct signal_struct {
436 436
437 /* job control IDs */ 437 /* job control IDs */
438 pid_t pgrp; 438 pid_t pgrp;
439 pid_t tty_old_pgrp; 439 struct pid *tty_old_pgrp;
440 440
441 union { 441 union {
442 pid_t session __deprecated; 442 pid_t session __deprecated;
@@ -1013,8 +1013,10 @@ struct task_struct {
1013 * to a stack based synchronous wait) if its doing sync IO. 1013 * to a stack based synchronous wait) if its doing sync IO.
1014 */ 1014 */
1015 wait_queue_t *io_wait; 1015 wait_queue_t *io_wait;
1016#ifdef CONFIG_TASK_XACCT
1016/* i/o counters(bytes read/written, #syscalls */ 1017/* i/o counters(bytes read/written, #syscalls */
1017 u64 rchar, wchar, syscr, syscw; 1018 u64 rchar, wchar, syscr, syscw;
1019#endif
1018 struct task_io_accounting ioac; 1020 struct task_io_accounting ioac;
1019#if defined(CONFIG_TASK_XACCT) 1021#if defined(CONFIG_TASK_XACCT)
1020 u64 acct_rss_mem1; /* accumulated rss usage */ 1022 u64 acct_rss_mem1; /* accumulated rss usage */
@@ -1327,14 +1329,11 @@ extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid);
1327extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); 1329extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32);
1328extern int kill_pgrp(struct pid *pid, int sig, int priv); 1330extern int kill_pgrp(struct pid *pid, int sig, int priv);
1329extern int kill_pid(struct pid *pid, int sig, int priv); 1331extern int kill_pid(struct pid *pid, int sig, int priv);
1330extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp);
1331extern int kill_pg_info(int, struct siginfo *, pid_t);
1332extern void do_notify_parent(struct task_struct *, int); 1332extern void do_notify_parent(struct task_struct *, int);
1333extern void force_sig(int, struct task_struct *); 1333extern void force_sig(int, struct task_struct *);
1334extern void force_sig_specific(int, struct task_struct *); 1334extern void force_sig_specific(int, struct task_struct *);
1335extern int send_sig(int, struct task_struct *, int); 1335extern int send_sig(int, struct task_struct *, int);
1336extern void zap_other_threads(struct task_struct *p); 1336extern void zap_other_threads(struct task_struct *p);
1337extern int kill_pg(pid_t, int, int);
1338extern int kill_proc(pid_t, int, int); 1337extern int kill_proc(pid_t, int, int);
1339extern struct sigqueue *sigqueue_alloc(void); 1338extern struct sigqueue *sigqueue_alloc(void);
1340extern void sigqueue_free(struct sigqueue *); 1339extern void sigqueue_free(struct sigqueue *);
@@ -1649,6 +1648,44 @@ extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls);
1649 1648
1650extern void normalize_rt_tasks(void); 1649extern void normalize_rt_tasks(void);
1651 1650
1651#ifdef CONFIG_TASK_XACCT
1652static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
1653{
1654 tsk->rchar += amt;
1655}
1656
1657static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
1658{
1659 tsk->wchar += amt;
1660}
1661
1662static inline void inc_syscr(struct task_struct *tsk)
1663{
1664 tsk->syscr++;
1665}
1666
1667static inline void inc_syscw(struct task_struct *tsk)
1668{
1669 tsk->syscw++;
1670}
1671#else
1672static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
1673{
1674}
1675
1676static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
1677{
1678}
1679
1680static inline void inc_syscr(struct task_struct *tsk)
1681{
1682}
1683
1684static inline void inc_syscw(struct task_struct *tsk)
1685{
1686}
1687#endif
1688
1652#endif /* __KERNEL__ */ 1689#endif /* __KERNEL__ */
1653 1690
1654#endif 1691#endif
diff --git a/include/linux/security.h b/include/linux/security.h
index 83cdefae9931..7f88d97575fd 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -492,7 +492,7 @@ struct request_sock;
492 * Note that the fown_struct, @fown, is never outside the context of a 492 * Note that the fown_struct, @fown, is never outside the context of a
493 * struct file, so the file structure (and associated security information) 493 * struct file, so the file structure (and associated security information)
494 * can always be obtained: 494 * can always be obtained:
495 * (struct file *)((long)fown - offsetof(struct file,f_owner)); 495 * container_of(fown, struct file, f_owner)
496 * @tsk contains the structure of task receiving signal. 496 * @tsk contains the structure of task receiving signal.
497 * @fown contains the file owner information. 497 * @fown contains the file owner information.
498 * @sig is the signal that will be sent. When 0, kernel sends SIGIO. 498 * @sig is the signal that will be sent. When 0, kernel sends SIGIO.
@@ -2130,7 +2130,7 @@ extern int mod_reg_security (const char *name, struct security_operations *ops);
2130extern int mod_unreg_security (const char *name, struct security_operations *ops); 2130extern int mod_unreg_security (const char *name, struct security_operations *ops);
2131extern struct dentry *securityfs_create_file(const char *name, mode_t mode, 2131extern struct dentry *securityfs_create_file(const char *name, mode_t mode,
2132 struct dentry *parent, void *data, 2132 struct dentry *parent, void *data,
2133 struct file_operations *fops); 2133 const struct file_operations *fops);
2134extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent); 2134extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent);
2135extern void securityfs_remove(struct dentry *dentry); 2135extern void securityfs_remove(struct dentry *dentry);
2136 2136
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 0f478a8791a2..ac2c70e7f760 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -86,6 +86,11 @@ static inline void serio_register_port(struct serio *serio)
86void serio_unregister_port(struct serio *serio); 86void serio_unregister_port(struct serio *serio);
87void serio_unregister_child_port(struct serio *serio); 87void serio_unregister_child_port(struct serio *serio);
88 88
89int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name);
90static inline int serio_register_driver(struct serio_driver *drv)
91{
92 return __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME);
93}
89int serio_register_driver(struct serio_driver *drv); 94int serio_register_driver(struct serio_driver *drv);
90void serio_unregister_driver(struct serio_driver *drv); 95void serio_unregister_driver(struct serio_driver *drv);
91 96
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 4b463e66ddea..5e4364644ed1 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -19,7 +19,9 @@
19struct cache_sizes { 19struct cache_sizes {
20 size_t cs_size; 20 size_t cs_size;
21 struct kmem_cache *cs_cachep; 21 struct kmem_cache *cs_cachep;
22#ifdef CONFIG_ZONE_DMA
22 struct kmem_cache *cs_dmacachep; 23 struct kmem_cache *cs_dmacachep;
24#endif
23}; 25};
24extern struct cache_sizes malloc_sizes[]; 26extern struct cache_sizes malloc_sizes[];
25 27
@@ -39,9 +41,12 @@ static inline void *kmalloc(size_t size, gfp_t flags)
39 __you_cannot_kmalloc_that_much(); 41 __you_cannot_kmalloc_that_much();
40 } 42 }
41found: 43found:
42 return kmem_cache_alloc((flags & GFP_DMA) ? 44#ifdef CONFIG_ZONE_DMA
43 malloc_sizes[i].cs_dmacachep : 45 if (flags & GFP_DMA)
44 malloc_sizes[i].cs_cachep, flags); 46 return kmem_cache_alloc(malloc_sizes[i].cs_dmacachep,
47 flags);
48#endif
49 return kmem_cache_alloc(malloc_sizes[i].cs_cachep, flags);
45 } 50 }
46 return __kmalloc(size, flags); 51 return __kmalloc(size, flags);
47} 52}
@@ -62,9 +67,12 @@ static inline void *kzalloc(size_t size, gfp_t flags)
62 __you_cannot_kzalloc_that_much(); 67 __you_cannot_kzalloc_that_much();
63 } 68 }
64found: 69found:
65 return kmem_cache_zalloc((flags & GFP_DMA) ? 70#ifdef CONFIG_ZONE_DMA
66 malloc_sizes[i].cs_dmacachep : 71 if (flags & GFP_DMA)
67 malloc_sizes[i].cs_cachep, flags); 72 return kmem_cache_zalloc(malloc_sizes[i].cs_dmacachep,
73 flags);
74#endif
75 return kmem_cache_zalloc(malloc_sizes[i].cs_cachep, flags);
68 } 76 }
69 return __kzalloc(size, flags); 77 return __kzalloc(size, flags);
70} 78}
@@ -88,9 +96,13 @@ static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
88 __you_cannot_kmalloc_that_much(); 96 __you_cannot_kmalloc_that_much();
89 } 97 }
90found: 98found:
91 return kmem_cache_alloc_node((flags & GFP_DMA) ? 99#ifdef CONFIG_ZONE_DMA
92 malloc_sizes[i].cs_dmacachep : 100 if (flags & GFP_DMA)
93 malloc_sizes[i].cs_cachep, flags, node); 101 return kmem_cache_alloc_node(malloc_sizes[i].cs_dmacachep,
102 flags, node);
103#endif
104 return kmem_cache_alloc_node(malloc_sizes[i].cs_cachep,
105 flags, node);
94 } 106 }
95 return __kmalloc_node(size, flags, node); 107 return __kmalloc_node(size, flags, node);
96} 108}
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 92cd38efad7f..28157a36e6cc 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -16,7 +16,7 @@ struct __kernel_sockaddr_storage {
16 /* _SS_MAXSIZE value minus size of ss_family */ 16 /* _SS_MAXSIZE value minus size of ss_family */
17} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ 17} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */
18 18
19#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) 19#ifdef __KERNEL__
20 20
21#include <asm/socket.h> /* arch-dependent defines */ 21#include <asm/socket.h> /* arch-dependent defines */
22#include <linux/sockios.h> /* the SIOCxxx I/O controls */ 22#include <linux/sockios.h> /* the SIOCxxx I/O controls */
@@ -187,7 +187,8 @@ struct ucred {
187#define AF_LLC 26 /* Linux LLC */ 187#define AF_LLC 26 /* Linux LLC */
188#define AF_TIPC 30 /* TIPC sockets */ 188#define AF_TIPC 30 /* TIPC sockets */
189#define AF_BLUETOOTH 31 /* Bluetooth sockets */ 189#define AF_BLUETOOTH 31 /* Bluetooth sockets */
190#define AF_MAX 32 /* For now.. */ 190#define AF_IUCV 32 /* IUCV sockets */
191#define AF_MAX 33 /* For now.. */
191 192
192/* Protocol families, same as address families. */ 193/* Protocol families, same as address families. */
193#define PF_UNSPEC AF_UNSPEC 194#define PF_UNSPEC AF_UNSPEC
@@ -220,6 +221,7 @@ struct ucred {
220#define PF_LLC AF_LLC 221#define PF_LLC AF_LLC
221#define PF_TIPC AF_TIPC 222#define PF_TIPC AF_TIPC
222#define PF_BLUETOOTH AF_BLUETOOTH 223#define PF_BLUETOOTH AF_BLUETOOTH
224#define PF_IUCV AF_IUCV
223#define PF_MAX AF_MAX 225#define PF_MAX AF_MAX
224 226
225/* Maximum queue length specifiable by listen. */ 227/* Maximum queue length specifiable by listen. */
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index adb3dafd33e9..3387e44dfd13 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -5,9 +5,17 @@
5 * 5 *
6 * It's OK if the min/max values are zero. 6 * It's OK if the min/max values are zero.
7 */ 7 */
8enum ads7846_filter {
9 ADS7846_FILTER_OK,
10 ADS7846_FILTER_REPEAT,
11 ADS7846_FILTER_IGNORE,
12};
13
8struct ads7846_platform_data { 14struct ads7846_platform_data {
9 u16 model; /* 7843, 7845, 7846. */ 15 u16 model; /* 7843, 7845, 7846. */
10 u16 vref_delay_usecs; /* 0 for external vref; etc */ 16 u16 vref_delay_usecs; /* 0 for external vref; etc */
17 int keep_vref_on:1; /* set to keep vref on for differential
18 * measurements as well */
11 u16 x_plate_ohms; 19 u16 x_plate_ohms;
12 u16 y_plate_ohms; 20 u16 y_plate_ohms;
13 21
@@ -21,5 +29,9 @@ struct ads7846_platform_data {
21 u16 debounce_rep; /* additional consecutive good readings 29 u16 debounce_rep; /* additional consecutive good readings
22 * required after the first two */ 30 * required after the first two */
23 int (*get_pendown_state)(void); 31 int (*get_pendown_state)(void);
32 int (*filter_init) (struct ads7846_platform_data *pdata,
33 void **filter_data);
34 int (*filter) (void *filter_data, int data_idx, int *val);
35 void (*filter_cleanup)(void *filter_data);
24}; 36};
25 37
diff --git a/include/linux/spi/eeprom.h b/include/linux/spi/eeprom.h
new file mode 100644
index 000000000000..1085212c446e
--- /dev/null
+++ b/include/linux/spi/eeprom.h
@@ -0,0 +1,22 @@
1#ifndef __LINUX_SPI_EEPROM_H
2#define __LINUX_SPI_EEPROM_H
3
4/*
5 * Put one of these structures in platform_data for SPI EEPROMS handled
6 * by the "at25" driver. On SPI, most EEPROMS understand the same core
7 * command set. If you need to support EEPROMs that don't yet fit, add
8 * flags to support those protocol options. These values all come from
9 * the chip datasheets.
10 */
11struct spi_eeprom {
12 u32 byte_len;
13 char name[10];
14 u16 page_size; /* for writes */
15 u16 flags;
16#define EE_ADDR1 0x0001 /* 8 bit addrs */
17#define EE_ADDR2 0x0002 /* 16 bit addrs */
18#define EE_ADDR3 0x0004 /* 24 bit addrs */
19#define EE_READONLY 0x0008 /* disallow writes */
20};
21
22#endif /* __LINUX_SPI_EEPROM_H */
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 176f6e36dbfa..4f0f8c2e58a5 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -114,6 +114,17 @@ static inline void spi_set_ctldata(struct spi_device *spi, void *state)
114 spi->controller_state = state; 114 spi->controller_state = state;
115} 115}
116 116
117/* device driver data */
118
119static inline void spi_set_drvdata(struct spi_device *spi, void *data)
120{
121 dev_set_drvdata(&spi->dev, data);
122}
123
124static inline void *spi_get_drvdata(struct spi_device *spi)
125{
126 return dev_get_drvdata(&spi->dev);
127}
117 128
118struct spi_message; 129struct spi_message;
119 130
@@ -137,13 +148,11 @@ extern int spi_register_driver(struct spi_driver *sdrv);
137 148
138static inline void spi_unregister_driver(struct spi_driver *sdrv) 149static inline void spi_unregister_driver(struct spi_driver *sdrv)
139{ 150{
140 if (!sdrv) 151 if (sdrv)
141 return; 152 driver_unregister(&sdrv->driver);
142 driver_unregister(&sdrv->driver);
143} 153}
144 154
145 155
146
147/** 156/**
148 * struct spi_master - interface to SPI master controller 157 * struct spi_master - interface to SPI master controller
149 * @cdev: class interface to this driver 158 * @cdev: class interface to this driver
@@ -154,7 +163,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
154 * each slave has a chipselect signal, but it's common that not 163 * each slave has a chipselect signal, but it's common that not
155 * every chipselect is connected to a slave. 164 * every chipselect is connected to a slave.
156 * @setup: updates the device mode and clocking records used by a 165 * @setup: updates the device mode and clocking records used by a
157 * device's SPI controller; protocol code may call this. 166 * device's SPI controller; protocol code may call this. This
167 * must fail if an unrecognized or unsupported mode is requested.
158 * @transfer: adds a message to the controller's transfer queue. 168 * @transfer: adds a message to the controller's transfer queue.
159 * @cleanup: frees controller-specific state 169 * @cleanup: frees controller-specific state
160 * 170 *
@@ -211,7 +221,7 @@ struct spi_master {
211 struct spi_message *mesg); 221 struct spi_message *mesg);
212 222
213 /* called on release() to free memory provided by spi_master */ 223 /* called on release() to free memory provided by spi_master */
214 void (*cleanup)(const struct spi_device *spi); 224 void (*cleanup)(struct spi_device *spi);
215}; 225};
216 226
217static inline void *spi_master_get_devdata(struct spi_master *master) 227static inline void *spi_master_get_devdata(struct spi_master *master)
@@ -296,6 +306,16 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
296 * shifting out three bytes with word size of sixteen or twenty bits; 306 * shifting out three bytes with word size of sixteen or twenty bits;
297 * the former uses two bytes per word, the latter uses four bytes.) 307 * the former uses two bytes per word, the latter uses four bytes.)
298 * 308 *
309 * In-memory data values are always in native CPU byte order, translated
310 * from the wire byte order (big-endian except with SPI_LSB_FIRST). So
311 * for example when bits_per_word is sixteen, buffers are 2N bytes long
312 * and hold N sixteen bit words in CPU byte order.
313 *
314 * When the word size of the SPI transfer is not a power-of-two multiple
315 * of eight bits, those in-memory words include extra bits. In-memory
316 * words are always seen by protocol drivers as right-justified, so the
317 * undefined (rx) or unused (tx) bits are always the most significant bits.
318 *
299 * All SPI transfers start with the relevant chipselect active. Normally 319 * All SPI transfers start with the relevant chipselect active. Normally
300 * it stays selected until after the last transfer in a message. Drivers 320 * it stays selected until after the last transfer in a message. Drivers
301 * can affect the chipselect signal using cs_change: 321 * can affect the chipselect signal using cs_change:
@@ -453,6 +473,11 @@ static inline void spi_message_free(struct spi_message *m)
453 * changes those settings, and must be called from a context that can sleep. 473 * changes those settings, and must be called from a context that can sleep.
454 * The changes take effect the next time the device is selected and data 474 * The changes take effect the next time the device is selected and data
455 * is transferred to or from it. 475 * is transferred to or from it.
476 *
477 * Note that this call wil fail if the protocol driver specifies an option
478 * that the underlying controller or its driver does not support. For
479 * example, not all hardware supports wire transfers using nine bit words,
480 * LSB-first wire encoding, or active-high chipselects.
456 */ 481 */
457static inline int 482static inline int
458spi_setup(struct spi_device *spi) 483spi_setup(struct spi_device *spi)
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h
index 16ce178f54d7..2e8c048b9b80 100644
--- a/include/linux/spi/spi_bitbang.h
+++ b/include/linux/spi/spi_bitbang.h
@@ -55,7 +55,7 @@ struct spi_bitbang {
55 * methods, if you like. 55 * methods, if you like.
56 */ 56 */
57extern int spi_bitbang_setup(struct spi_device *spi); 57extern int spi_bitbang_setup(struct spi_device *spi);
58extern void spi_bitbang_cleanup(const struct spi_device *spi); 58extern void spi_bitbang_cleanup(struct spi_device *spi);
59extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m); 59extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m);
60extern int spi_bitbang_setup_transfer(struct spi_device *spi, 60extern int spi_bitbang_setup_transfer(struct spi_device *spi,
61 struct spi_transfer *t); 61 struct spi_transfer *t);
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 94b767d64275..61fef376ed2e 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -228,15 +228,30 @@ do { \
228# define read_unlock_irq(lock) _read_unlock_irq(lock) 228# define read_unlock_irq(lock) _read_unlock_irq(lock)
229# define write_unlock_irq(lock) _write_unlock_irq(lock) 229# define write_unlock_irq(lock) _write_unlock_irq(lock)
230#else 230#else
231# define spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock) 231# define spin_unlock(lock) \
232# define read_unlock(lock) __raw_read_unlock(&(lock)->raw_lock) 232 do {__raw_spin_unlock(&(lock)->raw_lock); __release(lock); } while (0)
233# define write_unlock(lock) __raw_write_unlock(&(lock)->raw_lock) 233# define read_unlock(lock) \
234# define spin_unlock_irq(lock) \ 234 do {__raw_read_unlock(&(lock)->raw_lock); __release(lock); } while (0)
235 do { __raw_spin_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) 235# define write_unlock(lock) \
236# define read_unlock_irq(lock) \ 236 do {__raw_write_unlock(&(lock)->raw_lock); __release(lock); } while (0)
237 do { __raw_read_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) 237# define spin_unlock_irq(lock) \
238# define write_unlock_irq(lock) \ 238do { \
239 do { __raw_write_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) 239 __raw_spin_unlock(&(lock)->raw_lock); \
240 __release(lock); \
241 local_irq_enable(); \
242} while (0)
243# define read_unlock_irq(lock) \
244do { \
245 __raw_read_unlock(&(lock)->raw_lock); \
246 __release(lock); \
247 local_irq_enable(); \
248} while (0)
249# define write_unlock_irq(lock) \
250do { \
251 __raw_write_unlock(&(lock)->raw_lock); \
252 __release(lock); \
253 local_irq_enable(); \
254} while (0)
240#endif 255#endif
241 256
242#define spin_unlock_irqrestore(lock, flags) \ 257#define spin_unlock_irqrestore(lock, flags) \
diff --git a/include/linux/stat.h b/include/linux/stat.h
index 679ef0d70b6b..4f8539ccff6c 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -7,7 +7,7 @@
7 7
8#endif 8#endif
9 9
10#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) 10#ifdef __KERNEL__
11 11
12#define S_IFMT 00170000 12#define S_IFMT 00170000
13#define S_IFSOCK 0140000 13#define S_IFSOCK 0140000
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 64f3d60c72af..83b3c7b433aa 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -11,6 +11,7 @@
11#define SUNRPC_SVC_H 11#define SUNRPC_SVC_H
12 12
13#include <linux/in.h> 13#include <linux/in.h>
14#include <linux/in6.h>
14#include <linux/sunrpc/types.h> 15#include <linux/sunrpc/types.h>
15#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
16#include <linux/sunrpc/auth.h> 17#include <linux/sunrpc/auth.h>
@@ -191,7 +192,13 @@ static inline void svc_putu32(struct kvec *iov, __be32 val)
191 iov->iov_len += sizeof(__be32); 192 iov->iov_len += sizeof(__be32);
192} 193}
193 194
194 195union svc_addr_u {
196 struct in_addr addr;
197#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
198 struct in6_addr addr6;
199#endif
200};
201
195/* 202/*
196 * The context of a single thread, including the request currently being 203 * The context of a single thread, including the request currently being
197 * processed. 204 * processed.
@@ -200,8 +207,8 @@ struct svc_rqst {
200 struct list_head rq_list; /* idle list */ 207 struct list_head rq_list; /* idle list */
201 struct list_head rq_all; /* all threads list */ 208 struct list_head rq_all; /* all threads list */
202 struct svc_sock * rq_sock; /* socket */ 209 struct svc_sock * rq_sock; /* socket */
203 struct sockaddr_in rq_addr; /* peer address */ 210 struct sockaddr_storage rq_addr; /* peer address */
204 int rq_addrlen; 211 size_t rq_addrlen;
205 212
206 struct svc_serv * rq_server; /* RPC service definition */ 213 struct svc_serv * rq_server; /* RPC service definition */
207 struct svc_pool * rq_pool; /* thread pool */ 214 struct svc_pool * rq_pool; /* thread pool */
@@ -227,8 +234,8 @@ struct svc_rqst {
227 unsigned short 234 unsigned short
228 rq_secure : 1; /* secure port */ 235 rq_secure : 1; /* secure port */
229 236
230 237 union svc_addr_u rq_daddr; /* dest addr of request
231 __be32 rq_daddr; /* dest addr of request - reply from here */ 238 * - reply from here */
232 239
233 void * rq_argp; /* decoded arguments */ 240 void * rq_argp; /* decoded arguments */
234 void * rq_resp; /* xdr'd results */ 241 void * rq_resp; /* xdr'd results */
@@ -256,6 +263,24 @@ struct svc_rqst {
256}; 263};
257 264
258/* 265/*
266 * Rigorous type checking on sockaddr type conversions
267 */
268static inline struct sockaddr_in *svc_addr_in(struct svc_rqst *rqst)
269{
270 return (struct sockaddr_in *) &rqst->rq_addr;
271}
272
273static inline struct sockaddr_in6 *svc_addr_in6(struct svc_rqst *rqst)
274{
275 return (struct sockaddr_in6 *) &rqst->rq_addr;
276}
277
278static inline struct sockaddr *svc_addr(struct svc_rqst *rqst)
279{
280 return (struct sockaddr *) &rqst->rq_addr;
281}
282
283/*
259 * Check buffer bounds after decoding arguments 284 * Check buffer bounds after decoding arguments
260 */ 285 */
261static inline int 286static inline int
@@ -292,9 +317,10 @@ static inline void svc_free_res_pages(struct svc_rqst *rqstp)
292 317
293struct svc_deferred_req { 318struct svc_deferred_req {
294 u32 prot; /* protocol (UDP or TCP) */ 319 u32 prot; /* protocol (UDP or TCP) */
295 struct sockaddr_in addr; 320 struct svc_sock *svsk;
296 struct svc_sock *svsk; /* where reply must go */ 321 struct sockaddr_storage addr; /* where reply must go */
297 __be32 daddr; /* where reply must come from */ 322 size_t addrlen;
323 union svc_addr_u daddr; /* where reply must come from */
298 struct cache_deferred_req handle; 324 struct cache_deferred_req handle;
299 int argslen; 325 int argslen;
300 __be32 args[0]; 326 __be32 args[0];
@@ -368,5 +394,8 @@ int svc_register(struct svc_serv *, int, unsigned short);
368void svc_wake_up(struct svc_serv *); 394void svc_wake_up(struct svc_serv *);
369void svc_reserve(struct svc_rqst *rqstp, int space); 395void svc_reserve(struct svc_rqst *rqstp, int space);
370struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu); 396struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu);
397char * svc_print_addr(struct svc_rqst *, char *, size_t);
398
399#define RPC_MAX_ADDRBUFLEN (63U)
371 400
372#endif /* SUNRPC_SVC_H */ 401#endif /* SUNRPC_SVC_H */
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 98b21ad370fd..cccea0a0feb4 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -57,13 +57,16 @@ struct svc_sock {
57 57
58 /* cache of various info for TCP sockets */ 58 /* cache of various info for TCP sockets */
59 void *sk_info_authunix; 59 void *sk_info_authunix;
60
61 struct sockaddr_storage sk_remote; /* remote peer's address */
62 int sk_remotelen; /* length of address */
60}; 63};
61 64
62/* 65/*
63 * Function prototypes. 66 * Function prototypes.
64 */ 67 */
65int svc_makesock(struct svc_serv *, int, unsigned short); 68int svc_makesock(struct svc_serv *, int, unsigned short, int flags);
66void svc_delete_socket(struct svc_sock *); 69void svc_close_socket(struct svc_sock *);
67int svc_recv(struct svc_rqst *, long); 70int svc_recv(struct svc_rqst *, long);
68int svc_send(struct svc_rqst *); 71int svc_send(struct svc_rqst *);
69void svc_drop(struct svc_rqst *); 72void svc_drop(struct svc_rqst *);
@@ -74,4 +77,11 @@ int svc_addsock(struct svc_serv *serv,
74 char *name_return, 77 char *name_return,
75 int *proto); 78 int *proto);
76 79
80/*
81 * svc_makesock socket characteristics
82 */
83#define SVC_SOCK_DEFAULTS (0U)
84#define SVC_SOCK_ANONYMOUS (1U << 0) /* don't register with pmap */
85#define SVC_SOCK_TEMPORARY (1U << 1) /* flag socket as temporary */
86
77#endif /* SUNRPC_SVCSOCK_H */ 87#endif /* SUNRPC_SVCSOCK_H */
diff --git a/include/linux/svga.h b/include/linux/svga.h
new file mode 100644
index 000000000000..eadb981bb37c
--- /dev/null
+++ b/include/linux/svga.h
@@ -0,0 +1,124 @@
1#ifndef _LINUX_SVGA_H
2#define _LINUX_SVGA_H
3
4#ifdef __KERNEL__
5
6#include <linux/pci.h>
7#include <video/vga.h>
8
9/* Terminator for register set */
10
11#define VGA_REGSET_END_VAL 0xFF
12#define VGA_REGSET_END {VGA_REGSET_END_VAL, 0, 0}
13
14struct vga_regset {
15 u8 regnum;
16 u8 lowbit;
17 u8 highbit;
18};
19
20/* ------------------------------------------------------------------------- */
21
22#define SVGA_FORMAT_END_VAL 0xFFFF
23#define SVGA_FORMAT_END {SVGA_FORMAT_END_VAL, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, 0, 0, 0, 0, 0, 0}
24
25struct svga_fb_format {
26 /* var part */
27 u32 bits_per_pixel;
28 struct fb_bitfield red;
29 struct fb_bitfield green;
30 struct fb_bitfield blue;
31 struct fb_bitfield transp;
32 u32 nonstd;
33 /* fix part */
34 u32 type;
35 u32 type_aux;
36 u32 visual;
37 u32 xpanstep;
38 u32 xresstep;
39};
40
41struct svga_timing_regs {
42 const struct vga_regset *h_total_regs;
43 const struct vga_regset *h_display_regs;
44 const struct vga_regset *h_blank_start_regs;
45 const struct vga_regset *h_blank_end_regs;
46 const struct vga_regset *h_sync_start_regs;
47 const struct vga_regset *h_sync_end_regs;
48
49 const struct vga_regset *v_total_regs;
50 const struct vga_regset *v_display_regs;
51 const struct vga_regset *v_blank_start_regs;
52 const struct vga_regset *v_blank_end_regs;
53 const struct vga_regset *v_sync_start_regs;
54 const struct vga_regset *v_sync_end_regs;
55};
56
57struct svga_pll {
58 u16 m_min;
59 u16 m_max;
60 u16 n_min;
61 u16 n_max;
62 u16 r_min;
63 u16 r_max; /* r_max < 32 */
64 u32 f_vco_min;
65 u32 f_vco_max;
66 u32 f_base;
67};
68
69
70/* Write a value to the attribute register */
71
72static inline void svga_wattr(u8 index, u8 data)
73{
74 inb(0x3DA);
75 outb(index, 0x3C0);
76 outb(data, 0x3C0);
77}
78
79/* Write a value to a sequence register with a mask */
80
81static inline void svga_wseq_mask(u8 index, u8 data, u8 mask)
82{
83 vga_wseq(NULL, index, (data & mask) | (vga_rseq(NULL, index) & ~mask));
84}
85
86/* Write a value to a CRT register with a mask */
87
88static inline void svga_wcrt_mask(u8 index, u8 data, u8 mask)
89{
90 vga_wcrt(NULL, index, (data & mask) | (vga_rcrt(NULL, index) & ~mask));
91}
92
93static inline int svga_primary_device(struct pci_dev *dev)
94{
95 u16 flags;
96 pci_read_config_word(dev, PCI_COMMAND, &flags);
97 return (flags & PCI_COMMAND_IO);
98}
99
100
101void svga_wcrt_multi(const struct vga_regset *regset, u32 value);
102void svga_wseq_multi(const struct vga_regset *regset, u32 value);
103
104void svga_set_default_gfx_regs(void);
105void svga_set_default_atc_regs(void);
106void svga_set_default_seq_regs(void);
107void svga_set_default_crt_regs(void);
108void svga_set_textmode_vga_regs(void);
109
110void svga_settile(struct fb_info *info, struct fb_tilemap *map);
111void svga_tilecopy(struct fb_info *info, struct fb_tilearea *area);
112void svga_tilefill(struct fb_info *info, struct fb_tilerect *rect);
113void svga_tileblit(struct fb_info *info, struct fb_tileblit *blit);
114void svga_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor);
115
116int svga_compute_pll(const struct svga_pll *pll, u32 f_wanted, u16 *m, u16 *n, u16 *r, int node);
117int svga_check_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, int node);
118void svga_set_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, u32 hmul, u32 hdiv, u32 vmul, u32 vdiv, u32 hborder, int node);
119
120int svga_match_format(const struct svga_fb_format *frm, struct fb_var_screeninfo *var, struct fb_fix_screeninfo *fix);
121
122#endif /* __KERNEL__ */
123#endif /* _LINUX_SVGA_H */
124
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 5423559a44a6..006868881346 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -170,11 +170,13 @@ extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *
170extern unsigned long totalram_pages; 170extern unsigned long totalram_pages;
171extern unsigned long totalreserve_pages; 171extern unsigned long totalreserve_pages;
172extern long nr_swap_pages; 172extern long nr_swap_pages;
173extern unsigned int nr_free_pages(void);
174extern unsigned int nr_free_pages_pgdat(pg_data_t *pgdat);
175extern unsigned int nr_free_buffer_pages(void); 173extern unsigned int nr_free_buffer_pages(void);
176extern unsigned int nr_free_pagecache_pages(void); 174extern unsigned int nr_free_pagecache_pages(void);
177 175
176/* Definition of global_page_state not available yet */
177#define nr_free_pages() global_page_state(NR_FREE_PAGES)
178
179
178/* linux/mm/swap.c */ 180/* linux/mm/swap.c */
179extern void FASTCALL(lru_cache_add(struct page *)); 181extern void FASTCALL(lru_cache_add(struct page *));
180extern void FASTCALL(lru_cache_add_active(struct page *)); 182extern void FASTCALL(lru_cache_add_active(struct page *));
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 81480e613467..665412c4f4b9 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -699,7 +699,8 @@ enum {
699 NET_X25_CALL_REQUEST_TIMEOUT=2, 699 NET_X25_CALL_REQUEST_TIMEOUT=2,
700 NET_X25_RESET_REQUEST_TIMEOUT=3, 700 NET_X25_RESET_REQUEST_TIMEOUT=3,
701 NET_X25_CLEAR_REQUEST_TIMEOUT=4, 701 NET_X25_CLEAR_REQUEST_TIMEOUT=4,
702 NET_X25_ACK_HOLD_BACK_TIMEOUT=5 702 NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
703 NET_X25_FORWARD=6
703}; 704};
704 705
705/* /proc/sys/net/token-ring */ 706/* /proc/sys/net/token-ring */
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index 166a2e58c287..389ccf858d37 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -98,12 +98,16 @@ struct sysdev_attribute {
98}; 98};
99 99
100 100
101#define SYSDEV_ATTR(_name,_mode,_show,_store) \ 101#define _SYSDEV_ATTR(_name,_mode,_show,_store) \
102struct sysdev_attribute attr_##_name = { \ 102{ \
103 .attr = {.name = __stringify(_name), .mode = _mode }, \ 103 .attr = { .name = __stringify(_name), .mode = _mode, \
104 .owner = THIS_MODULE }, \
104 .show = _show, \ 105 .show = _show, \
105 .store = _store, \ 106 .store = _store, \
106}; 107}
108
109#define SYSDEV_ATTR(_name,_mode,_show,_store) \
110struct sysdev_attribute attr_##_name = _SYSDEV_ATTR(_name,_mode,_show,_store);
107 111
108extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); 112extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
109extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); 113extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 2129d1b6c874..192de3afa96b 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -11,10 +11,12 @@
11#define _SYSFS_H_ 11#define _SYSFS_H_
12 12
13#include <linux/compiler.h> 13#include <linux/compiler.h>
14#include <linux/list.h>
14#include <asm/atomic.h> 15#include <asm/atomic.h>
15 16
16struct kobject; 17struct kobject;
17struct module; 18struct module;
19struct nameidata;
18 20
19struct attribute { 21struct attribute {
20 const char * name; 22 const char * name;
@@ -88,13 +90,13 @@ struct sysfs_dirent {
88#ifdef CONFIG_SYSFS 90#ifdef CONFIG_SYSFS
89 91
90extern int __must_check 92extern int __must_check
91sysfs_create_dir(struct kobject *); 93sysfs_create_dir(struct kobject *, struct dentry *);
92 94
93extern void 95extern void
94sysfs_remove_dir(struct kobject *); 96sysfs_remove_dir(struct kobject *);
95 97
96extern int __must_check 98extern int __must_check
97sysfs_rename_dir(struct kobject *, const char *new_name); 99sysfs_rename_dir(struct kobject *, struct dentry *, const char *new_name);
98 100
99extern int __must_check 101extern int __must_check
100sysfs_move_dir(struct kobject *, struct kobject *); 102sysfs_move_dir(struct kobject *, struct kobject *);
@@ -126,11 +128,17 @@ int __must_check sysfs_create_group(struct kobject *,
126void sysfs_remove_group(struct kobject *, const struct attribute_group *); 128void sysfs_remove_group(struct kobject *, const struct attribute_group *);
127void sysfs_notify(struct kobject * k, char *dir, char *attr); 129void sysfs_notify(struct kobject * k, char *dir, char *attr);
128 130
131
132extern int sysfs_make_shadowed_dir(struct kobject *kobj,
133 void * (*follow_link)(struct dentry *, struct nameidata *));
134extern struct dentry *sysfs_create_shadow_dir(struct kobject *kobj);
135extern void sysfs_remove_shadow_dir(struct dentry *dir);
136
129extern int __must_check sysfs_init(void); 137extern int __must_check sysfs_init(void);
130 138
131#else /* CONFIG_SYSFS */ 139#else /* CONFIG_SYSFS */
132 140
133static inline int sysfs_create_dir(struct kobject * k) 141static inline int sysfs_create_dir(struct kobject * k, struct dentry *shadow)
134{ 142{
135 return 0; 143 return 0;
136} 144}
@@ -140,7 +148,9 @@ static inline void sysfs_remove_dir(struct kobject * k)
140 ; 148 ;
141} 149}
142 150
143static inline int sysfs_rename_dir(struct kobject * k, const char *new_name) 151static inline int sysfs_rename_dir(struct kobject * k,
152 struct dentry *new_parent,
153 const char *new_name)
144{ 154{
145 return 0; 155 return 0;
146} 156}
@@ -204,6 +214,12 @@ static inline void sysfs_notify(struct kobject * k, char *dir, char *attr)
204{ 214{
205} 215}
206 216
217static inline int sysfs_make_shadowed_dir(struct kobject *kobj,
218 void * (*follow_link)(struct dentry *, struct nameidata *))
219{
220 return 0;
221}
222
207static inline int __must_check sysfs_init(void) 223static inline int __must_check sysfs_init(void)
208{ 224{
209 return 0; 225 return 0;
diff --git a/include/linux/tc.h b/include/linux/tc.h
new file mode 100644
index 000000000000..f92511e57cdb
--- /dev/null
+++ b/include/linux/tc.h
@@ -0,0 +1,141 @@
1/*
2 * Interface to the TURBOchannel related routines.
3 *
4 * Copyright (c) 1998 Harald Koerfgen
5 * Copyright (c) 2005 James Simmons
6 * Copyright (c) 2006 Maciej W. Rozycki
7 *
8 * Based on:
9 *
10 * "TURBOchannel Firmware Specification", EK-TCAAD-FS-004
11 *
12 * from Digital Equipment Corporation.
13 *
14 * This file is subject to the terms and conditions of the GNU
15 * General Public License. See the file "COPYING" in the main
16 * directory of this archive for more details.
17 */
18#ifndef _LINUX_TC_H
19#define _LINUX_TC_H
20
21#include <linux/compiler.h>
22#include <linux/device.h>
23#include <linux/ioport.h>
24#include <linux/types.h>
25
26/*
27 * Offsets for the ROM header locations for TURBOchannel cards.
28 */
29#define TC_OLDCARD 0x3c0000
30#define TC_NEWCARD 0x000000
31
32#define TC_ROM_WIDTH 0x3e0
33#define TC_ROM_STRIDE 0x3e4
34#define TC_ROM_SIZE 0x3e8
35#define TC_SLOT_SIZE 0x3ec
36#define TC_PATTERN0 0x3f0
37#define TC_PATTERN1 0x3f4
38#define TC_PATTERN2 0x3f8
39#define TC_PATTERN3 0x3fc
40#define TC_FIRM_VER 0x400
41#define TC_VENDOR 0x420
42#define TC_MODULE 0x440
43#define TC_FIRM_TYPE 0x460
44#define TC_FLAGS 0x470
45#define TC_ROM_OBJECTS 0x480
46
47/*
48 * Information obtained through the get_tcinfo() PROM call.
49 */
50struct tcinfo {
51 s32 revision; /* Hardware revision level. */
52 s32 clk_period; /* Clock period in nanoseconds. */
53 s32 slot_size; /* Slot size in megabytes. */
54 s32 io_timeout; /* I/O timeout in cycles. */
55 s32 dma_range; /* DMA address range in megabytes. */
56 s32 max_dma_burst; /* Maximum DMA burst length. */
57 s32 parity; /* System module supports TC parity. */
58 s32 reserved[4];
59};
60
61/*
62 * TURBOchannel bus.
63 */
64struct tc_bus {
65 struct list_head devices; /* List of devices on this bus. */
66 struct resource resource[2]; /* Address space routed to this bus. */
67
68 struct device dev;
69 char name[13];
70 resource_size_t slot_base;
71 resource_size_t ext_slot_base;
72 resource_size_t ext_slot_size;
73 int num_tcslots;
74 struct tcinfo info;
75};
76
77/*
78 * TURBOchannel device.
79 */
80struct tc_dev {
81 struct list_head node; /* Node in list of all TC devices. */
82 struct tc_bus *bus; /* Bus this device is on. */
83 struct tc_driver *driver; /* Which driver has allocated this
84 device. */
85 struct device dev; /* Generic device interface. */
86 struct resource resource; /* Address space of this device. */
87 char vendor[9];
88 char name[9];
89 char firmware[9];
90 int interrupt;
91 int slot;
92};
93
94#define to_tc_dev(n) container_of(n, struct tc_dev, dev)
95
96struct tc_device_id {
97 char vendor[9];
98 char name[9];
99};
100
101/*
102 * TURBOchannel driver.
103 */
104struct tc_driver {
105 struct list_head node;
106 const struct tc_device_id *id_table;
107 struct device_driver driver;
108};
109
110#define to_tc_driver(drv) container_of(drv, struct tc_driver, driver)
111
112/*
113 * Return TURBOchannel clock frequency in Hz.
114 */
115static inline unsigned long tc_get_speed(struct tc_bus *tbus)
116{
117 return 100000 * (10000 / (unsigned long)tbus->info.clk_period);
118}
119
120#ifdef CONFIG_TC
121
122extern struct bus_type tc_bus_type;
123
124extern int tc_register_driver(struct tc_driver *tdrv);
125extern void tc_unregister_driver(struct tc_driver *tdrv);
126
127#else /* !CONFIG_TC */
128
129static inline int tc_register_driver(struct tc_driver *tdrv) { return 0; }
130static inline void tc_unregister_driver(struct tc_driver *tdrv) { }
131
132#endif /* CONFIG_TC */
133
134/*
135 * These have to be provided by the architecture.
136 */
137extern int tc_preadb(u8 *valp, void __iomem *addr);
138extern int tc_bus_get_info(struct tc_bus *tbus);
139extern void tc_device_get_irq(struct tc_dev *tdev);
140
141#endif /* _LINUX_TC_H */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 3cc70d1a3504..29d3089038ab 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -316,7 +316,7 @@ struct tcp_sock {
316 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ 316 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
317 struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ 317 struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/
318 318
319 struct tcp_sack_block recv_sack_cache[4]; 319 struct tcp_sack_block_wire recv_sack_cache[4];
320 320
321 /* from STCP, retrans queue hinting */ 321 /* from STCP, retrans queue hinting */
322 struct sk_buff* lost_skb_hint; 322 struct sk_buff* lost_skb_hint;
diff --git a/include/linux/tifm.h b/include/linux/tifm.h
index dfb8052eee5e..3deb0a6c1370 100644
--- a/include/linux/tifm.h
+++ b/include/linux/tifm.h
@@ -17,7 +17,7 @@
17#include <linux/wait.h> 17#include <linux/wait.h>
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/pci.h> 19#include <linux/pci.h>
20#include <linux/scatterlist.h> 20#include <linux/kthread.h>
21 21
22/* Host registers (relative to pci base address): */ 22/* Host registers (relative to pci base address): */
23enum { 23enum {
@@ -62,11 +62,10 @@ enum {
62 62
63 63
64#define TIFM_IRQ_ENABLE 0x80000000 64#define TIFM_IRQ_ENABLE 0x80000000
65#define TIFM_IRQ_SOCKMASK 0x00000001 65#define TIFM_IRQ_SOCKMASK(x) (x)
66#define TIFM_IRQ_CARDMASK 0x00000100 66#define TIFM_IRQ_CARDMASK(x) ((x) << 8)
67#define TIFM_IRQ_FIFOMASK 0x00010000 67#define TIFM_IRQ_FIFOMASK(x) ((x) << 16)
68#define TIFM_IRQ_SETALL 0xffffffff 68#define TIFM_IRQ_SETALL 0xffffffff
69#define TIFM_IRQ_SETALLSOCK 0x0000000f
70 69
71#define TIFM_CTRL_LED 0x00000040 70#define TIFM_CTRL_LED 0x00000040
72#define TIFM_CTRL_FAST_CLK 0x00000100 71#define TIFM_CTRL_FAST_CLK 0x00000100
@@ -89,10 +88,9 @@ struct tifm_dev {
89 char __iomem *addr; 88 char __iomem *addr;
90 spinlock_t lock; 89 spinlock_t lock;
91 tifm_media_id media_id; 90 tifm_media_id media_id;
92 char wq_name[KOBJ_NAME_LEN]; 91 unsigned int socket_id;
93 struct workqueue_struct *wq;
94 92
95 unsigned int (*signal_irq)(struct tifm_dev *sock, 93 void (*signal_irq)(struct tifm_dev *sock,
96 unsigned int sock_irq_status); 94 unsigned int sock_irq_status);
97 95
98 struct tifm_driver *drv; 96 struct tifm_driver *drv;
@@ -103,24 +101,23 @@ struct tifm_driver {
103 tifm_media_id *id_table; 101 tifm_media_id *id_table;
104 int (*probe)(struct tifm_dev *dev); 102 int (*probe)(struct tifm_dev *dev);
105 void (*remove)(struct tifm_dev *dev); 103 void (*remove)(struct tifm_dev *dev);
104 int (*suspend)(struct tifm_dev *dev,
105 pm_message_t state);
106 int (*resume)(struct tifm_dev *dev);
106 107
107 struct device_driver driver; 108 struct device_driver driver;
108}; 109};
109 110
110struct tifm_adapter { 111struct tifm_adapter {
111 char __iomem *addr; 112 char __iomem *addr;
112 unsigned int irq_status;
113 unsigned int insert_mask;
114 unsigned int remove_mask;
115 spinlock_t lock; 113 spinlock_t lock;
114 unsigned int irq_status;
115 unsigned int socket_change_set;
116 wait_queue_head_t change_set_notify;
116 unsigned int id; 117 unsigned int id;
117 unsigned int max_sockets; 118 unsigned int num_sockets;
118 char wq_name[KOBJ_NAME_LEN];
119 unsigned int inhibit_new_cards;
120 struct workqueue_struct *wq;
121 struct work_struct media_inserter;
122 struct work_struct media_remover;
123 struct tifm_dev **sockets; 119 struct tifm_dev **sockets;
120 struct task_struct *media_switcher;
124 struct class_device cdev; 121 struct class_device cdev;
125 struct device *dev; 122 struct device *dev;
126 123
@@ -130,9 +127,9 @@ struct tifm_adapter {
130struct tifm_adapter *tifm_alloc_adapter(void); 127struct tifm_adapter *tifm_alloc_adapter(void);
131void tifm_free_device(struct device *dev); 128void tifm_free_device(struct device *dev);
132void tifm_free_adapter(struct tifm_adapter *fm); 129void tifm_free_adapter(struct tifm_adapter *fm);
133int tifm_add_adapter(struct tifm_adapter *fm); 130int tifm_add_adapter(struct tifm_adapter *fm, int (*mediathreadfn)(void *data));
134void tifm_remove_adapter(struct tifm_adapter *fm); 131void tifm_remove_adapter(struct tifm_adapter *fm);
135struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id); 132struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm);
136int tifm_register_driver(struct tifm_driver *drv); 133int tifm_register_driver(struct tifm_driver *drv);
137void tifm_unregister_driver(struct tifm_driver *drv); 134void tifm_unregister_driver(struct tifm_driver *drv);
138void tifm_eject(struct tifm_dev *sock); 135void tifm_eject(struct tifm_dev *sock);
diff --git a/include/linux/time.h b/include/linux/time.h
index a5b739967b74..55cee172d723 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -46,7 +46,7 @@ static inline int timespec_equal(struct timespec *a, struct timespec *b)
46 * lhs == rhs: return 0 46 * lhs == rhs: return 0
47 * lhs > rhs: return >0 47 * lhs > rhs: return >0
48 */ 48 */
49static inline int timespec_compare(struct timespec *lhs, struct timespec *rhs) 49static inline int timespec_compare(const struct timespec *lhs, const struct timespec *rhs)
50{ 50{
51 if (lhs->tv_sec < rhs->tv_sec) 51 if (lhs->tv_sec < rhs->tv_sec)
52 return -1; 52 return -1;
@@ -55,7 +55,7 @@ static inline int timespec_compare(struct timespec *lhs, struct timespec *rhs)
55 return lhs->tv_nsec - rhs->tv_nsec; 55 return lhs->tv_nsec - rhs->tv_nsec;
56} 56}
57 57
58static inline int timeval_compare(struct timeval *lhs, struct timeval *rhs) 58static inline int timeval_compare(const struct timeval *lhs, const struct timeval *rhs)
59{ 59{
60 if (lhs->tv_sec < rhs->tv_sec) 60 if (lhs->tv_sec < rhs->tv_sec)
61 return -1; 61 return -1;
diff --git a/include/linux/timex.h b/include/linux/timex.h
index db501dc23c29..9a24e500c311 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -255,10 +255,10 @@ struct time_interpolator {
255 u8 jitter; /* if set compensate for fluctuations */ 255 u8 jitter; /* if set compensate for fluctuations */
256 u32 nsec_per_cyc; /* set by register_time_interpolator() */ 256 u32 nsec_per_cyc; /* set by register_time_interpolator() */
257 void *addr; /* address of counter or function */ 257 void *addr; /* address of counter or function */
258 u64 mask; /* mask the valid bits of the counter */ 258 cycles_t mask; /* mask the valid bits of the counter */
259 unsigned long offset; /* nsec offset at last update of interpolator */ 259 unsigned long offset; /* nsec offset at last update of interpolator */
260 u64 last_counter; /* counter value in units of the counter at last update */ 260 u64 last_counter; /* counter value in units of the counter at last update */
261 u64 last_cycle; /* Last timer value if TIME_SOURCE_JITTER is set */ 261 cycles_t last_cycle; /* Last timer value if TIME_SOURCE_JITTER is set */
262 u64 frequency; /* frequency in counts/second */ 262 u64 frequency; /* frequency in counts/second */
263 long drift; /* drift in parts-per-million (or -1) */ 263 long drift; /* drift in parts-per-million (or -1) */
264 unsigned long skips; /* skips forward */ 264 unsigned long skips; /* skips forward */
diff --git a/include/linux/toshiba.h b/include/linux/toshiba.h
index 916e5e3a699b..6a7c4edf0e13 100644
--- a/include/linux/toshiba.h
+++ b/include/linux/toshiba.h
@@ -33,4 +33,6 @@ typedef struct {
33 unsigned int edi __attribute__ ((packed)); 33 unsigned int edi __attribute__ ((packed));
34} SMMRegisters; 34} SMMRegisters;
35 35
36int tosh_smm(SMMRegisters *regs);
37
36#endif 38#endif
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 65cbcf22c31e..dee72b9a20fb 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -24,7 +24,27 @@
24#define NR_PTYS CONFIG_LEGACY_PTY_COUNT /* Number of legacy ptys */ 24#define NR_PTYS CONFIG_LEGACY_PTY_COUNT /* Number of legacy ptys */
25#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ 25#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */
26#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ 26#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */
27#define NR_LDISCS 16 27#define NR_LDISCS 17
28
29/* line disciplines */
30#define N_TTY 0
31#define N_SLIP 1
32#define N_MOUSE 2
33#define N_PPP 3
34#define N_STRIP 4
35#define N_AX25 5
36#define N_X25 6 /* X.25 async */
37#define N_6PACK 7
38#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
39#define N_R3964 9 /* Reserved for Simatic R3964 module */
40#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
41#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
42#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data */
43 /* cards about SMS messages */
44#define N_HDLC 13 /* synchronous HDLC */
45#define N_SYNC_PPP 14 /* synchronous PPP */
46#define N_HCI 15 /* Bluetooth HCI UART */
47#define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */
28 48
29/* 49/*
30 * This character is the same as _POSIX_VDISABLE: it cannot be used as 50 * This character is the same as _POSIX_VDISABLE: it cannot be used as
@@ -177,8 +197,8 @@ struct tty_struct {
177 struct mutex termios_mutex; 197 struct mutex termios_mutex;
178 struct ktermios *termios, *termios_locked; 198 struct ktermios *termios, *termios_locked;
179 char name[64]; 199 char name[64];
180 int pgrp; 200 struct pid *pgrp;
181 int session; 201 struct pid *session;
182 unsigned long flags; 202 unsigned long flags;
183 int count; 203 int count;
184 struct winsize winsize; 204 struct winsize winsize;
@@ -283,7 +303,7 @@ extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
283 int buflen); 303 int buflen);
284extern void tty_write_message(struct tty_struct *tty, char *msg); 304extern void tty_write_message(struct tty_struct *tty, char *msg);
285 305
286extern int is_orphaned_pgrp(int pgrp); 306extern int is_current_pgrp_orphaned(void);
287extern int is_ignored(int sig); 307extern int is_ignored(int sig);
288extern int tty_signal(int sig, struct tty_struct *tty); 308extern int tty_signal(int sig, struct tty_struct *tty);
289extern void tty_hangup(struct tty_struct * tty); 309extern void tty_hangup(struct tty_struct * tty);
@@ -291,6 +311,7 @@ extern void tty_vhangup(struct tty_struct * tty);
291extern void tty_unhangup(struct file *filp); 311extern void tty_unhangup(struct file *filp);
292extern int tty_hung_up_p(struct file * filp); 312extern int tty_hung_up_p(struct file * filp);
293extern void do_SAK(struct tty_struct *tty); 313extern void do_SAK(struct tty_struct *tty);
314extern void __do_SAK(struct tty_struct *tty);
294extern void disassociate_ctty(int priv); 315extern void disassociate_ctty(int priv);
295extern void tty_flip_buffer_push(struct tty_struct *tty); 316extern void tty_flip_buffer_push(struct tty_struct *tty);
296extern speed_t tty_get_baud_rate(struct tty_struct *tty); 317extern speed_t tty_get_baud_rate(struct tty_struct *tty);
@@ -312,7 +333,6 @@ extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
312 333
313extern dev_t tty_devnum(struct tty_struct *tty); 334extern dev_t tty_devnum(struct tty_struct *tty);
314extern void proc_clear_tty(struct task_struct *p); 335extern void proc_clear_tty(struct task_struct *p);
315extern void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty);
316extern void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty); 336extern void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty);
317extern struct tty_struct *get_current_tty(void); 337extern struct tty_struct *get_current_tty(void);
318 338
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 28967eda9d7b..dc2e9fe69418 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -40,13 +40,16 @@ typedef __u64 __fs64;
40typedef __u32 __fs32; 40typedef __u32 __fs32;
41typedef __u16 __fs16; 41typedef __u16 __fs16;
42#else 42#else
43#include <asm/div64.h>
43typedef __u64 __bitwise __fs64; 44typedef __u64 __bitwise __fs64;
44typedef __u32 __bitwise __fs32; 45typedef __u32 __bitwise __fs32;
45typedef __u16 __bitwise __fs16; 46typedef __u16 __bitwise __fs16;
46#endif 47#endif
47 48
49#ifdef __KERNEL__
48#include <linux/ufs_fs_i.h> 50#include <linux/ufs_fs_i.h>
49#include <linux/ufs_fs_sb.h> 51#include <linux/ufs_fs_sb.h>
52#endif
50 53
51#define UFS_BBLOCK 0 54#define UFS_BBLOCK 0
52#define UFS_BBSIZE 8192 55#define UFS_BBSIZE 8192
@@ -261,17 +264,10 @@ typedef __u16 __bitwise __fs16;
261 */ 264 */
262#define ufs_inotocg(x) ((x) / uspi->s_ipg) 265#define ufs_inotocg(x) ((x) / uspi->s_ipg)
263#define ufs_inotocgoff(x) ((x) % uspi->s_ipg) 266#define ufs_inotocgoff(x) ((x) % uspi->s_ipg)
264#define ufs_inotofsba(x) (ufs_cgimin(ufs_inotocg(x)) + ufs_inotocgoff(x) / uspi->s_inopf) 267#define ufs_inotofsba(x) (((u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf)
265#define ufs_inotofsbo(x) ((x) % uspi->s_inopf) 268#define ufs_inotofsbo(x) ((x) % uspi->s_inopf)
266 269
267/* 270/*
268 * Give cylinder group number for a file system block.
269 * Give cylinder group block number for a file system block.
270 */
271#define ufs_dtog(d) ((d) / uspi->s_fpg)
272#define ufs_dtogd(d) ((d) % uspi->s_fpg)
273
274/*
275 * Compute the cylinder and rotational position of a cyl block addr. 271 * Compute the cylinder and rotational position of a cyl block addr.
276 */ 272 */
277#define ufs_cbtocylno(bno) \ 273#define ufs_cbtocylno(bno) \
@@ -303,7 +299,7 @@ typedef __u16 __bitwise __fs16;
303#define UFS_MAXMNTLEN 512 299#define UFS_MAXMNTLEN 512
304#define UFS2_MAXMNTLEN 468 300#define UFS2_MAXMNTLEN 468
305#define UFS2_MAXVOLLEN 32 301#define UFS2_MAXVOLLEN 32
306/* #define UFS_MAXCSBUFS 31 */ 302#define UFS_MAXCSBUFS 31
307#define UFS_LINK_MAX 32000 303#define UFS_LINK_MAX 32000
308/* 304/*
309#define UFS2_NOCSPTRS ((128 / sizeof(void *)) - 4) 305#define UFS2_NOCSPTRS ((128 / sizeof(void *)) - 4)
@@ -721,6 +717,7 @@ struct ufs_cg_private_info {
721 __u32 c_nclusterblks; /* number of clusters this cg */ 717 __u32 c_nclusterblks; /* number of clusters this cg */
722}; 718};
723 719
720
724struct ufs_sb_private_info { 721struct ufs_sb_private_info {
725 struct ufs_buffer_head s_ubh; /* buffer containing super block */ 722 struct ufs_buffer_head s_ubh; /* buffer containing super block */
726 struct ufs_csum_core cs_total; 723 struct ufs_csum_core cs_total;
@@ -754,7 +751,7 @@ struct ufs_sb_private_info {
754 __u32 s_npsect; /* # sectors/track including spares */ 751 __u32 s_npsect; /* # sectors/track including spares */
755 __u32 s_interleave; /* hardware sector interleave */ 752 __u32 s_interleave; /* hardware sector interleave */
756 __u32 s_trackskew; /* sector 0 skew, per track */ 753 __u32 s_trackskew; /* sector 0 skew, per track */
757 __u32 s_csaddr; /* blk addr of cyl grp summary area */ 754 __u64 s_csaddr; /* blk addr of cyl grp summary area */
758 __u32 s_cssize; /* size of cyl grp summary area */ 755 __u32 s_cssize; /* size of cyl grp summary area */
759 __u32 s_cgsize; /* cylinder group size */ 756 __u32 s_cgsize; /* cylinder group size */
760 __u32 s_ntrak; /* tracks per cylinder */ 757 __u32 s_ntrak; /* tracks per cylinder */
@@ -789,6 +786,7 @@ struct ufs_sb_private_info {
789 786
790 __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */ 787 __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */
791 __s32 fs_magic; /* filesystem magic */ 788 __s32 fs_magic; /* filesystem magic */
789 unsigned int s_dirblksize;
792}; 790};
793 791
794/* 792/*
@@ -949,17 +947,17 @@ struct ufs_super_block_third {
949#ifdef __KERNEL__ 947#ifdef __KERNEL__
950 948
951/* balloc.c */ 949/* balloc.c */
952extern void ufs_free_fragments (struct inode *, unsigned, unsigned); 950extern void ufs_free_fragments (struct inode *, u64, unsigned);
953extern void ufs_free_blocks (struct inode *, unsigned, unsigned); 951extern void ufs_free_blocks (struct inode *, u64, unsigned);
954extern unsigned ufs_new_fragments(struct inode *, __fs32 *, unsigned, unsigned, 952extern u64 ufs_new_fragments(struct inode *, void *, u64, u64,
955 unsigned, int *, struct page *); 953 unsigned, int *, struct page *);
956 954
957/* cylinder.c */ 955/* cylinder.c */
958extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); 956extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned);
959extern void ufs_put_cylinder (struct super_block *, unsigned); 957extern void ufs_put_cylinder (struct super_block *, unsigned);
960 958
961/* dir.c */ 959/* dir.c */
962extern struct inode_operations ufs_dir_inode_operations; 960extern const struct inode_operations ufs_dir_inode_operations;
963extern int ufs_add_link (struct dentry *, struct inode *); 961extern int ufs_add_link (struct dentry *, struct inode *);
964extern ino_t ufs_inode_by_name(struct inode *, struct dentry *); 962extern ino_t ufs_inode_by_name(struct inode *, struct dentry *);
965extern int ufs_make_empty(struct inode *, struct inode *); 963extern int ufs_make_empty(struct inode *, struct inode *);
@@ -971,7 +969,7 @@ extern void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de,
971 struct page *page, struct inode *inode); 969 struct page *page, struct inode *inode);
972 970
973/* file.c */ 971/* file.c */
974extern struct inode_operations ufs_file_inode_operations; 972extern const struct inode_operations ufs_file_inode_operations;
975extern const struct file_operations ufs_file_operations; 973extern const struct file_operations ufs_file_operations;
976 974
977extern const struct address_space_operations ufs_aops; 975extern const struct address_space_operations ufs_aops;
@@ -998,7 +996,7 @@ extern void ufs_error (struct super_block *, const char *, const char *, ...) __
998extern void ufs_panic (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); 996extern void ufs_panic (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4)));
999 997
1000/* symlink.c */ 998/* symlink.c */
1001extern struct inode_operations ufs_fast_symlink_inode_operations; 999extern const struct inode_operations ufs_fast_symlink_inode_operations;
1002 1000
1003/* truncate.c */ 1001/* truncate.c */
1004extern int ufs_truncate (struct inode *, loff_t); 1002extern int ufs_truncate (struct inode *, loff_t);
@@ -1013,6 +1011,22 @@ static inline struct ufs_inode_info *UFS_I(struct inode *inode)
1013 return container_of(inode, struct ufs_inode_info, vfs_inode); 1011 return container_of(inode, struct ufs_inode_info, vfs_inode);
1014} 1012}
1015 1013
1014/*
1015 * Give cylinder group number for a file system block.
1016 * Give cylinder group block number for a file system block.
1017 */
1018/* #define ufs_dtog(d) ((d) / uspi->s_fpg) */
1019static inline u64 ufs_dtog(struct ufs_sb_private_info * uspi, u64 b)
1020{
1021 do_div(b, uspi->s_fpg);
1022 return b;
1023}
1024/* #define ufs_dtogd(d) ((d) % uspi->s_fpg) */
1025static inline u32 ufs_dtogd(struct ufs_sb_private_info * uspi, u64 b)
1026{
1027 return do_div(b, uspi->s_fpg);
1028}
1029
1016#endif /* __KERNEL__ */ 1030#endif /* __KERNEL__ */
1017 1031
1018#endif /* __LINUX_UFS_FS_H */ 1032#endif /* __LINUX_UFS_FS_H */
diff --git a/include/linux/ufs_fs_i.h b/include/linux/ufs_fs_i.h
index f50ce3b0cd52..6496caa82f9e 100644
--- a/include/linux/ufs_fs_i.h
+++ b/include/linux/ufs_fs_i.h
@@ -20,13 +20,12 @@ struct ufs_inode_info {
20 __fs64 u2_i_data[15]; 20 __fs64 u2_i_data[15];
21 } i_u1; 21 } i_u1;
22 __u32 i_flags; 22 __u32 i_flags;
23 __u32 i_gen;
24 __u32 i_shadow; 23 __u32 i_shadow;
25 __u32 i_unused1; 24 __u32 i_unused1;
26 __u32 i_unused2; 25 __u32 i_unused2;
27 __u32 i_oeftflag; 26 __u32 i_oeftflag;
28 __u16 i_osync; 27 __u16 i_osync;
29 __u32 i_lastfrag; 28 __u64 i_lastfrag;
30 __u32 i_dir_start_lookup; 29 __u32 i_dir_start_lookup;
31 struct inode vfs_inode; 30 struct inode vfs_inode;
32}; 31};
diff --git a/include/linux/ufs_fs_sb.h b/include/linux/ufs_fs_sb.h
index 8ff13c160f3d..e114c93fc578 100644
--- a/include/linux/ufs_fs_sb.h
+++ b/include/linux/ufs_fs_sb.h
@@ -21,7 +21,6 @@
21struct ufs_sb_private_info; 21struct ufs_sb_private_info;
22struct ufs_cg_private_info; 22struct ufs_cg_private_info;
23struct ufs_csum; 23struct ufs_csum;
24#define UFS_MAXCSBUFS 31
25 24
26struct ufs_sb_info { 25struct ufs_sb_info {
27 struct ufs_sb_private_info * s_uspi; 26 struct ufs_sb_private_info * s_uspi;
diff --git a/include/linux/usb.h b/include/linux/usb.h
index aab5b1b72021..b5c226a87ed8 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -2,7 +2,7 @@
2#define __LINUX_USB_H 2#define __LINUX_USB_H
3 3
4#include <linux/mod_devicetable.h> 4#include <linux/mod_devicetable.h>
5#include <linux/usb_ch9.h> 5#include <linux/usb/ch9.h>
6 6
7#define USB_MAJOR 180 7#define USB_MAJOR 180
8#define USB_DEVICE_MAJOR 189 8#define USB_DEVICE_MAJOR 189
@@ -107,7 +107,8 @@ enum usb_interface_condition {
107 * @needs_remote_wakeup: flag set when the driver requires remote-wakeup 107 * @needs_remote_wakeup: flag set when the driver requires remote-wakeup
108 * capability during autosuspend. 108 * capability during autosuspend.
109 * @dev: driver model's view of this device 109 * @dev: driver model's view of this device
110 * @class_dev: driver model's class view of this device. 110 * @usb_dev: if an interface is bound to the USB major, this will point
111 * to the sysfs representation for that device.
111 * @pm_usage_cnt: PM usage counter for this interface; autosuspend is not 112 * @pm_usage_cnt: PM usage counter for this interface; autosuspend is not
112 * allowed unless the counter is 0. 113 * allowed unless the counter is 0.
113 * 114 *
@@ -152,7 +153,7 @@ struct usb_interface {
152 unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ 153 unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */
153 154
154 struct device dev; /* interface specific device info */ 155 struct device dev; /* interface specific device info */
155 struct class_device *class_dev; 156 struct device *usb_dev; /* pointer to the usb class's device, if any */
156 int pm_usage_cnt; /* usage counter for autosuspend */ 157 int pm_usage_cnt; /* usage counter for autosuspend */
157}; 158};
158#define to_usb_interface(d) container_of(d, struct usb_interface, dev) 159#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
@@ -372,7 +373,7 @@ struct usb_device {
372 char *serial; /* iSerialNumber string, if present */ 373 char *serial; /* iSerialNumber string, if present */
373 374
374 struct list_head filelist; 375 struct list_head filelist;
375 struct class_device *class_dev; 376 struct device *usbfs_dev;
376 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 377 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
377 378
378 /* 379 /*
@@ -475,6 +476,8 @@ extern void usb_driver_release_interface(struct usb_driver *driver,
475 struct usb_interface *iface); 476 struct usb_interface *iface);
476const struct usb_device_id *usb_match_id(struct usb_interface *interface, 477const struct usb_device_id *usb_match_id(struct usb_interface *interface,
477 const struct usb_device_id *id); 478 const struct usb_device_id *id);
479extern int usb_match_one_id(struct usb_interface *interface,
480 const struct usb_device_id *id);
478 481
479extern struct usb_interface *usb_find_interface(struct usb_driver *drv, 482extern struct usb_interface *usb_find_interface(struct usb_driver *drv,
480 int minor); 483 int minor);
@@ -554,6 +557,18 @@ static inline int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *e
554} 557}
555 558
556/** 559/**
560 * usb_endpoint_xfer_control - check if the endpoint has control transfer type
561 * @epd: endpoint to be checked
562 *
563 * Returns true if the endpoint is of type control, otherwise it returns false.
564 */
565static inline int usb_endpoint_xfer_control(const struct usb_endpoint_descriptor *epd)
566{
567 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
568 USB_ENDPOINT_XFER_CONTROL);
569}
570
571/**
557 * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type 572 * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
558 * @epd: endpoint to be checked 573 * @epd: endpoint to be checked
559 * 574 *
@@ -723,11 +738,21 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor
723 738
724/* ----------------------------------------------------------------------- */ 739/* ----------------------------------------------------------------------- */
725 740
741/* Stuff for dynamic usb ids */
726struct usb_dynids { 742struct usb_dynids {
727 spinlock_t lock; 743 spinlock_t lock;
728 struct list_head list; 744 struct list_head list;
729}; 745};
730 746
747struct usb_dynid {
748 struct list_head node;
749 struct usb_device_id id;
750};
751
752extern ssize_t usb_store_new_id(struct usb_dynids *dynids,
753 struct device_driver *driver,
754 const char *buf, size_t count);
755
731/** 756/**
732 * struct usbdrv_wrap - wrapper for driver-model structure 757 * struct usbdrv_wrap - wrapper for driver-model structure
733 * @driver: The driver-model core driver structure. 758 * @driver: The driver-model core driver structure.
@@ -868,10 +893,11 @@ struct usb_class_driver {
868 * use these in module_init()/module_exit() 893 * use these in module_init()/module_exit()
869 * and don't forget MODULE_DEVICE_TABLE(usb, ...) 894 * and don't forget MODULE_DEVICE_TABLE(usb, ...)
870 */ 895 */
871extern int usb_register_driver(struct usb_driver *, struct module *); 896extern int usb_register_driver(struct usb_driver *, struct module *,
897 const char *);
872static inline int usb_register(struct usb_driver *driver) 898static inline int usb_register(struct usb_driver *driver)
873{ 899{
874 return usb_register_driver(driver, THIS_MODULE); 900 return usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME);
875} 901}
876extern void usb_deregister(struct usb_driver *); 902extern void usb_deregister(struct usb_driver *);
877 903
@@ -1085,7 +1111,6 @@ struct urb
1085 struct kref kref; /* reference count of the URB */ 1111 struct kref kref; /* reference count of the URB */
1086 spinlock_t lock; /* lock for the URB */ 1112 spinlock_t lock; /* lock for the URB */
1087 void *hcpriv; /* private data for host controller */ 1113 void *hcpriv; /* private data for host controller */
1088 int bandwidth; /* bandwidth for INT/ISO request */
1089 atomic_t use_count; /* concurrent submissions counter */ 1114 atomic_t use_count; /* concurrent submissions counter */
1090 u8 reject; /* submissions will fail */ 1115 u8 reject; /* submissions will fail */
1091 1116
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild
new file mode 100644
index 000000000000..43f160cfe003
--- /dev/null
+++ b/include/linux/usb/Kbuild
@@ -0,0 +1,5 @@
1unifdef-y += audio.h
2unifdef-y += cdc.h
3unifdef-y += ch9.h
4unifdef-y += midi.h
5
diff --git a/include/linux/usb_ch9.h b/include/linux/usb/ch9.h
index c720d107ff29..ae7833749fa2 100644
--- a/include/linux/usb_ch9.h
+++ b/include/linux/usb/ch9.h
@@ -224,6 +224,7 @@ struct usb_device_descriptor {
224#define USB_CLASS_CONTENT_SEC 0x0d /* content security */ 224#define USB_CLASS_CONTENT_SEC 0x0d /* content security */
225#define USB_CLASS_VIDEO 0x0e 225#define USB_CLASS_VIDEO 0x0e
226#define USB_CLASS_WIRELESS_CONTROLLER 0xe0 226#define USB_CLASS_WIRELESS_CONTROLLER 0xe0
227#define USB_CLASS_MISC 0xef
227#define USB_CLASS_APP_SPEC 0xfe 228#define USB_CLASS_APP_SPEC 0xfe
228#define USB_CLASS_VENDOR_SPEC 0xff 229#define USB_CLASS_VENDOR_SPEC 0xff
229 230
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 10f99e5f1a97..33dcd8576696 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -179,6 +179,9 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
179 * memory structure allocation at this point in time. 179 * memory structure allocation at this point in time.
180 * @shutdown: pointer to the driver's shutdown function. This will be 180 * @shutdown: pointer to the driver's shutdown function. This will be
181 * called when the device is removed from the system. 181 * called when the device is removed from the system.
182 * @usb_driver: pointer to the struct usb_driver that controls this
183 * device. This is necessary to allow dynamic ids to be added to
184 * the driver from sysfs.
182 * 185 *
183 * This structure is defines a USB Serial driver. It provides all of 186 * This structure is defines a USB Serial driver. It provides all of
184 * the information that the USB serial core code needs. If the function 187 * the information that the USB serial core code needs. If the function
@@ -202,6 +205,8 @@ struct usb_serial_driver {
202 205
203 struct list_head driver_list; 206 struct list_head driver_list;
204 struct device_driver driver; 207 struct device_driver driver;
208 struct usb_driver *usb_driver;
209 struct usb_dynids dynids;
205 210
206 int (*probe) (struct usb_serial *serial, const struct usb_device_id *id); 211 int (*probe) (struct usb_serial *serial, const struct usb_device_id *id);
207 int (*attach) (struct usb_serial *serial); 212 int (*attach) (struct usb_serial *serial);
diff --git a/include/linux/usb_gadgetfs.h b/include/linux/usb_gadgetfs.h
index b53d6ae8e55e..8086d5a9b94e 100644
--- a/include/linux/usb_gadgetfs.h
+++ b/include/linux/usb_gadgetfs.h
@@ -2,7 +2,7 @@
2#include <asm/types.h> 2#include <asm/types.h>
3#include <asm/ioctl.h> 3#include <asm/ioctl.h>
4 4
5#include <linux/usb_ch9.h> 5#include <linux/usb/ch9.h>
6 6
7/* 7/*
8 * Filesystem based user-mode API to USB Gadget controller hardware 8 * Filesystem based user-mode API to USB Gadget controller hardware
diff --git a/include/linux/video_output.h b/include/linux/video_output.h
new file mode 100644
index 000000000000..e63e0c03ee0d
--- /dev/null
+++ b/include/linux/video_output.h
@@ -0,0 +1,42 @@
1/*
2 *
3 * Copyright (C) 2006 Luming Yu <luming.yu@intel.com>
4 *
5 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20 *
21 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 */
23#ifndef _LINUX_VIDEO_OUTPUT_H
24#define _LINUX_VIDEO_OUTPUT_H
25#include <linux/device.h>
26struct output_device;
27struct output_properties {
28 int (*set_state)(struct output_device *);
29 int (*get_status)(struct output_device *);
30};
31struct output_device {
32 int request_state;
33 struct output_properties *props;
34 struct class_device class_dev;
35};
36#define to_output_device(obj) container_of(obj, struct output_device, class_dev)
37struct output_device *video_output_register(const char *name,
38 struct device *dev,
39 void *devdata,
40 struct output_properties *op);
41void video_output_unregister(struct output_device *dev);
42#endif
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 5e9803ed17fc..acb1f105870c 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -3,20 +3,15 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/percpu.h> 5#include <linux/percpu.h>
6#include <linux/mm.h>
6#include <linux/mmzone.h> 7#include <linux/mmzone.h>
7#include <asm/atomic.h> 8#include <asm/atomic.h>
8 9
9#ifdef CONFIG_VM_EVENT_COUNTERS 10#ifdef CONFIG_ZONE_DMA
10/* 11#define DMA_ZONE(xx) xx##_DMA,
11 * Light weight per cpu counter implementation. 12#else
12 * 13#define DMA_ZONE(xx)
13 * Counters should only be incremented. You need to set EMBEDDED 14#endif
14 * to disable VM_EVENT_COUNTERS. Things like procps (vmstat,
15 * top, etc) use /proc/vmstat and depend on these counters.
16 *
17 * Counters are handled completely inline. On many platforms the code
18 * generated will simply be the increment of a global address.
19 */
20 15
21#ifdef CONFIG_ZONE_DMA32 16#ifdef CONFIG_ZONE_DMA32
22#define DMA32_ZONE(xx) xx##_DMA32, 17#define DMA32_ZONE(xx) xx##_DMA32,
@@ -30,7 +25,7 @@
30#define HIGHMEM_ZONE(xx) 25#define HIGHMEM_ZONE(xx)
31#endif 26#endif
32 27
33#define FOR_ALL_ZONES(xx) xx##_DMA, DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) 28#define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx)
34 29
35enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, 30enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
36 FOR_ALL_ZONES(PGALLOC), 31 FOR_ALL_ZONES(PGALLOC),
@@ -45,6 +40,17 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
45 NR_VM_EVENT_ITEMS 40 NR_VM_EVENT_ITEMS
46}; 41};
47 42
43#ifdef CONFIG_VM_EVENT_COUNTERS
44/*
45 * Light weight per cpu counter implementation.
46 *
47 * Counters should only be incremented and no critical kernel component
48 * should rely on the counter values.
49 *
50 * Counters are handled completely inline. On many platforms the code
51 * generated will simply be the increment of a global address.
52 */
53
48struct vm_event_state { 54struct vm_event_state {
49 unsigned long event[NR_VM_EVENT_ITEMS]; 55 unsigned long event[NR_VM_EVENT_ITEMS];
50}; 56};
@@ -85,17 +91,30 @@ static inline void vm_events_fold_cpu(int cpu)
85#else 91#else
86 92
87/* Disable counters */ 93/* Disable counters */
88#define get_cpu_vm_events(e) 0L 94static inline void count_vm_event(enum vm_event_item item)
89#define count_vm_event(e) do { } while (0) 95{
90#define count_vm_events(e,d) do { } while (0) 96}
91#define __count_vm_event(e) do { } while (0) 97static inline void count_vm_events(enum vm_event_item item, long delta)
92#define __count_vm_events(e,d) do { } while (0) 98{
93#define vm_events_fold_cpu(x) do { } while (0) 99}
100static inline void __count_vm_event(enum vm_event_item item)
101{
102}
103static inline void __count_vm_events(enum vm_event_item item, long delta)
104{
105}
106static inline void all_vm_events(unsigned long *ret)
107{
108}
109static inline void vm_events_fold_cpu(int cpu)
110{
111}
94 112
95#endif /* CONFIG_VM_EVENT_COUNTERS */ 113#endif /* CONFIG_VM_EVENT_COUNTERS */
96 114
97#define __count_zone_vm_events(item, zone, delta) \ 115#define __count_zone_vm_events(item, zone, delta) \
98 __count_vm_events(item##_DMA + zone_idx(zone), delta) 116 __count_vm_events(item##_NORMAL - ZONE_NORMAL + \
117 zone_idx(zone), delta)
99 118
100/* 119/*
101 * Zone based page accounting with per cpu differentials. 120 * Zone based page accounting with per cpu differentials.
@@ -142,14 +161,16 @@ static inline unsigned long node_page_state(int node,
142 struct zone *zones = NODE_DATA(node)->node_zones; 161 struct zone *zones = NODE_DATA(node)->node_zones;
143 162
144 return 163 return
164#ifdef CONFIG_ZONE_DMA
165 zone_page_state(&zones[ZONE_DMA], item) +
166#endif
145#ifdef CONFIG_ZONE_DMA32 167#ifdef CONFIG_ZONE_DMA32
146 zone_page_state(&zones[ZONE_DMA32], item) + 168 zone_page_state(&zones[ZONE_DMA32], item) +
147#endif 169#endif
148 zone_page_state(&zones[ZONE_NORMAL], item) +
149#ifdef CONFIG_HIGHMEM 170#ifdef CONFIG_HIGHMEM
150 zone_page_state(&zones[ZONE_HIGHMEM], item) + 171 zone_page_state(&zones[ZONE_HIGHMEM], item) +
151#endif 172#endif
152 zone_page_state(&zones[ZONE_DMA], item); 173 zone_page_state(&zones[ZONE_NORMAL], item);
153} 174}
154 175
155extern void zone_statistics(struct zonelist *, struct zone *); 176extern void zone_statistics(struct zonelist *, struct zone *);
@@ -186,6 +207,9 @@ void inc_zone_page_state(struct page *, enum zone_stat_item);
186void dec_zone_page_state(struct page *, enum zone_stat_item); 207void dec_zone_page_state(struct page *, enum zone_stat_item);
187 208
188extern void inc_zone_state(struct zone *, enum zone_stat_item); 209extern void inc_zone_state(struct zone *, enum zone_stat_item);
210extern void __inc_zone_state(struct zone *, enum zone_stat_item);
211extern void dec_zone_state(struct zone *, enum zone_stat_item);
212extern void __dec_zone_state(struct zone *, enum zone_stat_item);
189 213
190void refresh_cpu_vm_stats(int); 214void refresh_cpu_vm_stats(int);
191void refresh_vm_stats(void); 215void refresh_vm_stats(void);
@@ -214,6 +238,12 @@ static inline void __inc_zone_page_state(struct page *page,
214 __inc_zone_state(page_zone(page), item); 238 __inc_zone_state(page_zone(page), item);
215} 239}
216 240
241static inline void __dec_zone_state(struct zone *zone, enum zone_stat_item item)
242{
243 atomic_long_dec(&zone->vm_stat[item]);
244 atomic_long_dec(&vm_stat[item]);
245}
246
217static inline void __dec_zone_page_state(struct page *page, 247static inline void __dec_zone_page_state(struct page *page,
218 enum zone_stat_item item) 248 enum zone_stat_item item)
219{ 249{
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index 2cd05013edfc..3add87465b1f 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -516,9 +516,6 @@ struct wan_device {
516/* Public functions available for device drivers */ 516/* Public functions available for device drivers */
517extern int register_wan_device(struct wan_device *wandev); 517extern int register_wan_device(struct wan_device *wandev);
518extern int unregister_wan_device(char *name); 518extern int unregister_wan_device(char *name);
519__be16 wanrouter_type_trans(struct sk_buff *skb, struct net_device *dev);
520int wanrouter_encapsulate(struct sk_buff *skb, struct net_device *dev,
521 unsigned short type);
522 519
523/* Proc interface functions. These must not be called by the drivers! */ 520/* Proc interface functions. These must not be called by the drivers! */
524extern int wanrouter_proc_init(void); 521extern int wanrouter_proc_init(void);
@@ -527,11 +524,6 @@ extern int wanrouter_proc_add(struct wan_device *wandev);
527extern int wanrouter_proc_delete(struct wan_device *wandev); 524extern int wanrouter_proc_delete(struct wan_device *wandev);
528extern int wanrouter_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); 525extern int wanrouter_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
529 526
530extern void lock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
531extern void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
532
533
534
535/* Public Data */ 527/* Public Data */
536/* list of registered devices */ 528/* list of registered devices */
537extern struct wan_device *wanrouter_router_devlist; 529extern struct wan_device *wanrouter_router_devlist;
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index 0e7f1e20ea45..def131a5ac70 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -13,6 +13,10 @@
13#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ 13#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
14#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ 14#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
15 15
16#ifdef __KERNEL__
17
18#include <linux/types.h>
19
16/* Namespaces */ 20/* Namespaces */
17#define XATTR_OS2_PREFIX "os2." 21#define XATTR_OS2_PREFIX "os2."
18#define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1) 22#define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1)
@@ -29,6 +33,8 @@
29#define XATTR_USER_PREFIX "user." 33#define XATTR_USER_PREFIX "user."
30#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1) 34#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
31 35
36struct inode;
37struct dentry;
32 38
33struct xattr_handler { 39struct xattr_handler {
34 char *prefix; 40 char *prefix;
@@ -50,4 +56,6 @@ ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_siz
50int generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags); 56int generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags);
51int generic_removexattr(struct dentry *dentry, const char *name); 57int generic_removexattr(struct dentry *dentry, const char *name);
52 58
59#endif /* __KERNEL__ */
60
53#endif /* _LINUX_XATTR_H */ 61#endif /* _LINUX_XATTR_H */
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 9529ea1ae392..15ca89e9961b 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -178,6 +178,9 @@ enum {
178 XFRM_MSG_REPORT, 178 XFRM_MSG_REPORT,
179#define XFRM_MSG_REPORT XFRM_MSG_REPORT 179#define XFRM_MSG_REPORT XFRM_MSG_REPORT
180 180
181 XFRM_MSG_MIGRATE,
182#define XFRM_MSG_MIGRATE XFRM_MSG_MIGRATE
183
181 __XFRM_MSG_MAX 184 __XFRM_MSG_MAX
182}; 185};
183#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) 186#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
@@ -256,6 +259,7 @@ enum xfrm_attr_type_t {
256 XFRMA_COADDR, /* xfrm_address_t */ 259 XFRMA_COADDR, /* xfrm_address_t */
257 XFRMA_LASTUSED, 260 XFRMA_LASTUSED,
258 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ 261 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */
262 XFRMA_MIGRATE,
259 __XFRMA_MAX 263 __XFRMA_MAX
260 264
261#define XFRMA_MAX (__XFRMA_MAX - 1) 265#define XFRMA_MAX (__XFRMA_MAX - 1)
@@ -351,6 +355,19 @@ struct xfrm_user_report {
351 struct xfrm_selector sel; 355 struct xfrm_selector sel;
352}; 356};
353 357
358struct xfrm_user_migrate {
359 xfrm_address_t old_daddr;
360 xfrm_address_t old_saddr;
361 xfrm_address_t new_daddr;
362 xfrm_address_t new_saddr;
363 __u8 proto;
364 __u8 mode;
365 __u16 reserved;
366 __u32 reqid;
367 __u16 old_family;
368 __u16 new_family;
369};
370
354#ifndef __KERNEL__ 371#ifndef __KERNEL__
355/* backwards compatibility for userspace */ 372/* backwards compatibility for userspace */
356#define XFRMGRP_ACQUIRE 1 373#define XFRMGRP_ACQUIRE 1
@@ -375,6 +392,8 @@ enum xfrm_nlgroups {
375#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS 392#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS
376 XFRMNLGRP_REPORT, 393 XFRMNLGRP_REPORT,
377#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT 394#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
395 XFRMNLGRP_MIGRATE,
396#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE
378 __XFRMNLGRP_MAX 397 __XFRMNLGRP_MAX
379}; 398};
380#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) 399#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 5ae10dd2e32e..47ff2f46e908 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -377,7 +377,7 @@ extern int ax25_check_iframes_acked(ax25_cb *, unsigned short);
377/* ax25_route.c */ 377/* ax25_route.c */
378extern void ax25_rt_device_down(struct net_device *); 378extern void ax25_rt_device_down(struct net_device *);
379extern int ax25_rt_ioctl(unsigned int, void __user *); 379extern int ax25_rt_ioctl(unsigned int, void __user *);
380extern struct file_operations ax25_route_fops; 380extern const struct file_operations ax25_route_fops;
381extern ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev); 381extern ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev);
382extern int ax25_rt_autobind(ax25_cb *, ax25_address *); 382extern int ax25_rt_autobind(ax25_cb *, ax25_address *);
383extern struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, ax25_address *, ax25_digi *); 383extern struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, ax25_address *, ax25_digi *);
@@ -430,7 +430,7 @@ extern unsigned long ax25_display_timer(struct timer_list *);
430extern int ax25_uid_policy; 430extern int ax25_uid_policy;
431extern ax25_uid_assoc *ax25_findbyuid(uid_t); 431extern ax25_uid_assoc *ax25_findbyuid(uid_t);
432extern int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *); 432extern int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *);
433extern struct file_operations ax25_uid_fops; 433extern const struct file_operations ax25_uid_fops;
434extern void ax25_uid_free(void); 434extern void ax25_uid_free(void);
435 435
436/* sysctl_net_ax25.c */ 436/* sysctl_net_ax25.c */
diff --git a/include/net/dn_route.h b/include/net/dn_route.h
index 76f957e258b0..a566944c4962 100644
--- a/include/net/dn_route.h
+++ b/include/net/dn_route.h
@@ -68,9 +68,10 @@ extern void dn_rt_cache_flush(int delay);
68struct dn_route { 68struct dn_route {
69 union { 69 union {
70 struct dst_entry dst; 70 struct dst_entry dst;
71 struct dn_route *rt_next;
72 } u; 71 } u;
73 72
73 struct flowi fl;
74
74 __le16 rt_saddr; 75 __le16 rt_saddr;
75 __le16 rt_daddr; 76 __le16 rt_daddr;
76 __le16 rt_gateway; 77 __le16 rt_gateway;
@@ -80,8 +81,6 @@ struct dn_route {
80 81
81 unsigned rt_flags; 82 unsigned rt_flags;
82 unsigned rt_type; 83 unsigned rt_type;
83
84 struct flowi fl;
85}; 84};
86 85
87extern void dn_route_init(void); 86extern void dn_route_init(void);
diff --git a/include/net/dst.h b/include/net/dst.h
index 62b7e7598e9a..e12a8ce0b9b3 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -37,9 +37,7 @@ struct sk_buff;
37 37
38struct dst_entry 38struct dst_entry
39{ 39{
40 struct dst_entry *next; 40 struct rcu_head rcu_head;
41 atomic_t __refcnt; /* client references */
42 int __use;
43 struct dst_entry *child; 41 struct dst_entry *child;
44 struct net_device *dev; 42 struct net_device *dev;
45 short error; 43 short error;
@@ -50,7 +48,6 @@ struct dst_entry
50#define DST_NOPOLICY 4 48#define DST_NOPOLICY 4
51#define DST_NOHASH 8 49#define DST_NOHASH 8
52#define DST_BALANCED 0x10 50#define DST_BALANCED 0x10
53 unsigned long lastuse;
54 unsigned long expires; 51 unsigned long expires;
55 52
56 unsigned short header_len; /* more space at head required */ 53 unsigned short header_len; /* more space at head required */
@@ -75,8 +72,16 @@ struct dst_entry
75#endif 72#endif
76 73
77 struct dst_ops *ops; 74 struct dst_ops *ops;
78 struct rcu_head rcu_head;
79 75
76 unsigned long lastuse;
77 atomic_t __refcnt; /* client references */
78 int __use;
79 union {
80 struct dst_entry *next;
81 struct rtable *rt_next;
82 struct rt6_info *rt6_next;
83 struct dn_route *dn_next;
84 };
80 char info[0]; 85 char info[0];
81}; 86};
82 87
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 34cc76e3ddb4..d27ee8c0da3f 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -34,12 +34,13 @@
34#include <asm/byteorder.h> 34#include <asm/byteorder.h>
35 35
36/* This is for all connections with a full identity, no wildcards. 36/* This is for all connections with a full identity, no wildcards.
37 * New scheme, half the table is for TIME_WAIT, the other half is 37 * One chain is dedicated to TIME_WAIT sockets.
38 * for the rest. I'll experiment with dynamic table growth later. 38 * I'll experiment with dynamic table growth later.
39 */ 39 */
40struct inet_ehash_bucket { 40struct inet_ehash_bucket {
41 rwlock_t lock; 41 rwlock_t lock;
42 struct hlist_head chain; 42 struct hlist_head chain;
43 struct hlist_head twchain;
43}; 44};
44 45
45/* There are a few simple rules, which allow for local port reuse by 46/* There are a few simple rules, which allow for local port reuse by
@@ -97,8 +98,7 @@ struct inet_hashinfo {
97 * 98 *
98 * TCP_ESTABLISHED <= sk->sk_state < TCP_CLOSE 99 * TCP_ESTABLISHED <= sk->sk_state < TCP_CLOSE
99 * 100 *
100 * First half of the table is for sockets not in TIME_WAIT, second half 101 * TIME_WAIT sockets use a separate chain (twchain).
101 * is for TIME_WAIT sockets only.
102 */ 102 */
103 struct inet_ehash_bucket *ehash; 103 struct inet_ehash_bucket *ehash;
104 104
@@ -369,7 +369,7 @@ static inline struct sock *
369 } 369 }
370 370
371 /* Must check for a TIME_WAIT'er before going to listener hash. */ 371 /* Must check for a TIME_WAIT'er before going to listener hash. */
372 sk_for_each(sk, node, &(head + hashinfo->ehash_size)->chain) { 372 sk_for_each(sk, node, &head->twchain) {
373 if (INET_TW_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) 373 if (INET_TW_MATCH(sk, hash, acookie, saddr, daddr, ports, dif))
374 goto hit; 374 goto hit;
375 } 375 }
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 7be4f4e3a0f2..9eda572a2a65 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -83,7 +83,6 @@ struct rt6_info
83{ 83{
84 union { 84 union {
85 struct dst_entry dst; 85 struct dst_entry dst;
86 struct rt6_info *next;
87 } u; 86 } u;
88 87
89 struct inet6_dev *rt6i_idev; 88 struct inet6_dev *rt6i_idev;
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
new file mode 100644
index 000000000000..04d1abb72d25
--- /dev/null
+++ b/include/net/iucv/af_iucv.h
@@ -0,0 +1,106 @@
1/*
2 * Copyright 2006 IBM Corporation
3 * IUCV protocol stack for Linux on zSeries
4 * Version 1.0
5 * Author(s): Jennifer Hunt <jenhunt@us.ibm.com>
6 *
7 */
8
9#ifndef __AFIUCV_H
10#define __AFIUCV_H
11
12#include <asm/types.h>
13#include <asm/byteorder.h>
14#include <linux/list.h>
15#include <linux/poll.h>
16#include <linux/socket.h>
17
18#ifndef AF_IUCV
19#define AF_IUCV 32
20#define PF_IUCV AF_IUCV
21#endif
22
23/* Connection and socket states */
24enum {
25 IUCV_CONNECTED = 1,
26 IUCV_OPEN,
27 IUCV_BOUND,
28 IUCV_LISTEN,
29 IUCV_SEVERED,
30 IUCV_DISCONN,
31 IUCV_CLOSED
32};
33
34#define IUCV_QUEUELEN_DEFAULT 65535
35#define IUCV_CONN_TIMEOUT (HZ * 40)
36#define IUCV_DISCONN_TIMEOUT (HZ * 2)
37#define IUCV_CONN_IDLE_TIMEOUT (HZ * 60)
38#define IUCV_BUFSIZE_DEFAULT 32768
39
40/* IUCV socket address */
41struct sockaddr_iucv {
42 sa_family_t siucv_family;
43 unsigned short siucv_port; /* Reserved */
44 unsigned int siucv_addr; /* Reserved */
45 char siucv_nodeid[8]; /* Reserved */
46 char siucv_user_id[8]; /* Guest User Id */
47 char siucv_name[8]; /* Application Name */
48};
49
50
51/* Common socket structures and functions */
52
53#define iucv_sk(__sk) ((struct iucv_sock *) __sk)
54
55struct iucv_sock {
56 struct sock sk;
57 char src_user_id[8];
58 char src_name[8];
59 char dst_user_id[8];
60 char dst_name[8];
61 struct list_head accept_q;
62 struct sock *parent;
63 struct iucv_path *path;
64 struct sk_buff_head send_skb_q;
65 unsigned int send_tag;
66};
67
68struct iucv_sock_list {
69 struct hlist_head head;
70 rwlock_t lock;
71 atomic_t autobind_name;
72};
73
74static void iucv_sock_destruct(struct sock *sk);
75static void iucv_sock_cleanup_listen(struct sock *parent);
76static void iucv_sock_kill(struct sock *sk);
77static void iucv_sock_close(struct sock *sk);
78static int iucv_sock_create(struct socket *sock, int proto);
79static int iucv_sock_bind(struct socket *sock, struct sockaddr *addr,
80 int addr_len);
81static int iucv_sock_connect(struct socket *sock, struct sockaddr *addr,
82 int alen, int flags);
83static int iucv_sock_listen(struct socket *sock, int backlog);
84static int iucv_sock_accept(struct socket *sock, struct socket *newsock,
85 int flags);
86static int iucv_sock_getname(struct socket *sock, struct sockaddr *addr,
87 int *len, int peer);
88static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
89 struct msghdr *msg, size_t len);
90static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
91 struct msghdr *msg, size_t len, int flags);
92unsigned int iucv_sock_poll(struct file *file, struct socket *sock,
93 poll_table *wait);
94static int iucv_sock_release(struct socket *sock);
95static int iucv_sock_shutdown(struct socket *sock, int how);
96
97void iucv_sock_link(struct iucv_sock_list *l, struct sock *s);
98void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s);
99int iucv_sock_wait_state(struct sock *sk, int state, int state2,
100 unsigned long timeo);
101int iucv_sock_wait_cnt(struct sock *sk, unsigned long timeo);
102void iucv_accept_enqueue(struct sock *parent, struct sock *sk);
103void iucv_accept_unlink(struct sock *sk);
104struct sock *iucv_accept_dequeue(struct sock *parent, struct socket *newsock);
105
106#endif /* __IUCV_H */
diff --git a/include/net/iucv/iucv.h b/include/net/iucv/iucv.h
new file mode 100644
index 000000000000..746e7416261e
--- /dev/null
+++ b/include/net/iucv/iucv.h
@@ -0,0 +1,415 @@
1/*
2 * drivers/s390/net/iucv.h
3 * IUCV base support.
4 *
5 * S390 version
6 * Copyright 2000, 2006 IBM Corporation
7 * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com)
8 * Xenia Tkatschow (xenia@us.ibm.com)
9 * Rewritten for af_iucv:
10 * Martin Schwidefsky <schwidefsky@de.ibm.com>
11 *
12 *
13 * Functionality:
14 * To explore any of the IUCV functions, one must first register their
15 * program using iucv_register(). Once your program has successfully
16 * completed a register, it can exploit the other functions.
17 * For furthur reference on all IUCV functionality, refer to the
18 * CP Programming Services book, also available on the web thru
19 * www.ibm.com/s390/vm/pubs, manual # SC24-5760
20 *
21 * Definition of Return Codes
22 * - All positive return codes including zero are reflected back
23 * from CP. The definition of each return code can be found in
24 * CP Programming Services book.
25 * - Return Code of:
26 * -EINVAL: Invalid value
27 * -ENOMEM: storage allocation failed
28 */
29
30#include <linux/types.h>
31#include <asm/debug.h>
32
33/*
34 * IUCV option flags usable by device drivers:
35 *
36 * IUCV_IPRMDATA Indicates that your program can handle a message in the
37 * parameter list / a message is sent in the parameter list.
38 * Used for iucv_path_accept, iucv_path_connect,
39 * iucv_message_reply, iucv_message_send, iucv_message_send2way.
40 * IUCV_IPQUSCE Indicates that you do not want to receive messages on this
41 * path until an iucv_path_resume is issued.
42 * Used for iucv_path_accept, iucv_path_connect.
43 * IUCV_IPBUFLST Indicates that an address list is used for the message data.
44 * Used for iucv_message_receive, iucv_message_send,
45 * iucv_message_send2way.
46 * IUCV_IPPRTY Specifies that you want to send priority messages.
47 * Used for iucv_path_accept, iucv_path_connect,
48 * iucv_message_reply, iucv_message_send, iucv_message_send2way.
49 * IUCV_IPSYNC Indicates a synchronous send request.
50 * Used for iucv_message_send, iucv_message_send2way.
51 * IUCV_IPANSLST Indicates that an address list is used for the reply data.
52 * Used for iucv_message_reply, iucv_message_send2way.
53 * IUCV_IPLOCAL Specifies that the communication partner has to be on the
54 * local system. If local is specified no target class can be
55 * specified.
56 * Used for iucv_path_connect.
57 *
58 * All flags are defined in the input field IPFLAGS1 of each function
59 * and can be found in CP Programming Services.
60 */
61#define IUCV_IPRMDATA 0x80
62#define IUCV_IPQUSCE 0x40
63#define IUCV_IPBUFLST 0x40
64#define IUCV_IPPRTY 0x20
65#define IUCV_IPANSLST 0x08
66#define IUCV_IPSYNC 0x04
67#define IUCV_IPLOCAL 0x01
68
69/*
70 * iucv_array : Defines buffer array.
71 * Inside the array may be 31- bit addresses and 31-bit lengths.
72 * Use a pointer to an iucv_array as the buffer, reply or answer
73 * parameter on iucv_message_send, iucv_message_send2way, iucv_message_receive
74 * and iucv_message_reply if IUCV_IPBUFLST or IUCV_IPANSLST are used.
75 */
76struct iucv_array {
77 u32 address;
78 u32 length;
79} __attribute__ ((aligned (8)));
80
81extern struct bus_type iucv_bus;
82extern struct device *iucv_root;
83
84/*
85 * struct iucv_path
86 * pathid: 16 bit path identification
87 * msglim: 16 bit message limit
88 * flags: properties of the path: IPRMDATA, IPQUSCE, IPPRTY
89 * handler: address of iucv handler structure
90 * private: private information of the handler associated with the path
91 * list: list_head for the iucv_handler path list.
92 */
93struct iucv_path {
94 u16 pathid;
95 u16 msglim;
96 u8 flags;
97 void *private;
98 struct iucv_handler *handler;
99 struct list_head list;
100};
101
102/*
103 * struct iucv_message
104 * id: 32 bit message id
105 * audit: 32 bit error information of purged or replied messages
106 * class: 32 bit target class of a message (source class for replies)
107 * tag: 32 bit tag to be associated with the message
108 * length: 32 bit length of the message / reply
109 * reply_size: 32 bit maximum allowed length of the reply
110 * rmmsg: 8 byte inline message
111 * flags: message properties (IUCV_IPPRTY)
112 */
113struct iucv_message {
114 u32 id;
115 u32 audit;
116 u32 class;
117 u32 tag;
118 u32 length;
119 u32 reply_size;
120 u8 rmmsg[8];
121 u8 flags;
122};
123
124/*
125 * struct iucv_handler
126 *
127 * A vector of functions that handle IUCV interrupts. Each functions gets
128 * a parameter area as defined by the CP Programming Services and private
129 * pointer that is provided by the user of the interface.
130 */
131struct iucv_handler {
132 /*
133 * The path_pending function is called after an iucv interrupt
134 * type 0x01 has been received. The base code allocates a path
135 * structure and "asks" the handler if this path belongs to the
136 * handler. To accept the path the path_pending function needs
137 * to call iucv_path_accept and return 0. If the callback returns
138 * a value != 0 the iucv base code will continue with the next
139 * handler. The order in which the path_pending functions are
140 * called is the order of the registration of the iucv handlers
141 * to the base code.
142 */
143 int (*path_pending)(struct iucv_path *, u8 ipvmid[8], u8 ipuser[16]);
144 /*
145 * The path_complete function is called after an iucv interrupt
146 * type 0x02 has been received for a path that has been established
147 * for this handler with iucv_path_connect and got accepted by the
148 * peer with iucv_path_accept.
149 */
150 void (*path_complete)(struct iucv_path *, u8 ipuser[16]);
151 /*
152 * The path_severed function is called after an iucv interrupt
153 * type 0x03 has been received. The communication peer shutdown
154 * his end of the communication path. The path still exists and
155 * remaining messages can be received until a iucv_path_sever
156 * shuts down the other end of the path as well.
157 */
158 void (*path_severed)(struct iucv_path *, u8 ipuser[16]);
159 /*
160 * The path_quiesced function is called after an icuv interrupt
161 * type 0x04 has been received. The communication peer has quiesced
162 * the path. Delivery of messages is stopped until iucv_path_resume
163 * has been called.
164 */
165 void (*path_quiesced)(struct iucv_path *, u8 ipuser[16]);
166 /*
167 * The path_resumed function is called after an icuv interrupt
168 * type 0x05 has been received. The communication peer has resumed
169 * the path.
170 */
171 void (*path_resumed)(struct iucv_path *, u8 ipuser[16]);
172 /*
173 * The message_pending function is called after an icuv interrupt
174 * type 0x06 or type 0x07 has been received. A new message is
175 * availabe and can be received with iucv_message_receive.
176 */
177 void (*message_pending)(struct iucv_path *, struct iucv_message *);
178 /*
179 * The message_complete function is called after an icuv interrupt
180 * type 0x08 or type 0x09 has been received. A message send with
181 * iucv_message_send2way has been replied to. The reply can be
182 * received with iucv_message_receive.
183 */
184 void (*message_complete)(struct iucv_path *, struct iucv_message *);
185
186 struct list_head list;
187 struct list_head paths;
188};
189
190/**
191 * iucv_register:
192 * @handler: address of iucv handler structure
193 * @smp: != 0 indicates that the handler can deal with out of order messages
194 *
195 * Registers a driver with IUCV.
196 *
197 * Returns 0 on success, -ENOMEM if the memory allocation for the pathid
198 * table failed, or -EIO if IUCV_DECLARE_BUFFER failed on all cpus.
199 */
200int iucv_register(struct iucv_handler *handler, int smp);
201
202/**
203 * iucv_unregister
204 * @handler: address of iucv handler structure
205 * @smp: != 0 indicates that the handler can deal with out of order messages
206 *
207 * Unregister driver from IUCV.
208 */
209void iucv_unregister(struct iucv_handler *handle, int smp);
210
211/**
212 * iucv_path_alloc
213 * @msglim: initial message limit
214 * @flags: initial flags
215 * @gfp: kmalloc allocation flag
216 *
217 * Allocate a new path structure for use with iucv_connect.
218 *
219 * Returns NULL if the memory allocation failed or a pointer to the
220 * path structure.
221 */
222static inline struct iucv_path *iucv_path_alloc(u16 msglim, u8 flags, gfp_t gfp)
223{
224 struct iucv_path *path;
225
226 path = kzalloc(sizeof(struct iucv_path), gfp);
227 if (path) {
228 path->msglim = msglim;
229 path->flags = flags;
230 }
231 return path;
232}
233
234/**
235 * iucv_path_free
236 * @path: address of iucv path structure
237 *
238 * Frees a path structure.
239 */
240static inline void iucv_path_free(struct iucv_path *path)
241{
242 kfree(path);
243}
244
245/**
246 * iucv_path_accept
247 * @path: address of iucv path structure
248 * @handler: address of iucv handler structure
249 * @userdata: 16 bytes of data reflected to the communication partner
250 * @private: private data passed to interrupt handlers for this path
251 *
252 * This function is issued after the user received a connection pending
253 * external interrupt and now wishes to complete the IUCV communication path.
254 *
255 * Returns the result of the CP IUCV call.
256 */
257int iucv_path_accept(struct iucv_path *path, struct iucv_handler *handler,
258 u8 userdata[16], void *private);
259
260/**
261 * iucv_path_connect
262 * @path: address of iucv path structure
263 * @handler: address of iucv handler structure
264 * @userid: 8-byte user identification
265 * @system: 8-byte target system identification
266 * @userdata: 16 bytes of data reflected to the communication partner
267 * @private: private data passed to interrupt handlers for this path
268 *
269 * This function establishes an IUCV path. Although the connect may complete
270 * successfully, you are not able to use the path until you receive an IUCV
271 * Connection Complete external interrupt.
272 *
273 * Returns the result of the CP IUCV call.
274 */
275int iucv_path_connect(struct iucv_path *path, struct iucv_handler *handler,
276 u8 userid[8], u8 system[8], u8 userdata[16],
277 void *private);
278
279/**
280 * iucv_path_quiesce:
281 * @path: address of iucv path structure
282 * @userdata: 16 bytes of data reflected to the communication partner
283 *
284 * This function temporarily suspends incoming messages on an IUCV path.
285 * You can later reactivate the path by invoking the iucv_resume function.
286 *
287 * Returns the result from the CP IUCV call.
288 */
289int iucv_path_quiesce(struct iucv_path *path, u8 userdata[16]);
290
291/**
292 * iucv_path_resume:
293 * @path: address of iucv path structure
294 * @userdata: 16 bytes of data reflected to the communication partner
295 *
296 * This function resumes incoming messages on an IUCV path that has
297 * been stopped with iucv_path_quiesce.
298 *
299 * Returns the result from the CP IUCV call.
300 */
301int iucv_path_resume(struct iucv_path *path, u8 userdata[16]);
302
303/**
304 * iucv_path_sever
305 * @path: address of iucv path structure
306 * @userdata: 16 bytes of data reflected to the communication partner
307 *
308 * This function terminates an IUCV path.
309 *
310 * Returns the result from the CP IUCV call.
311 */
312int iucv_path_sever(struct iucv_path *path, u8 userdata[16]);
313
314/**
315 * iucv_message_purge
316 * @path: address of iucv path structure
317 * @msg: address of iucv msg structure
318 * @srccls: source class of message
319 *
320 * Cancels a message you have sent.
321 *
322 * Returns the result from the CP IUCV call.
323 */
324int iucv_message_purge(struct iucv_path *path, struct iucv_message *msg,
325 u32 srccls);
326
327/**
328 * iucv_message_receive
329 * @path: address of iucv path structure
330 * @msg: address of iucv msg structure
331 * @flags: flags that affect how the message is received (IUCV_IPBUFLST)
332 * @buffer: address of data buffer or address of struct iucv_array
333 * @size: length of data buffer
334 * @residual:
335 *
336 * This function receives messages that are being sent to you over
337 * established paths. This function will deal with RMDATA messages
338 * embedded in struct iucv_message as well.
339 *
340 * Returns the result from the CP IUCV call.
341 */
342int iucv_message_receive(struct iucv_path *path, struct iucv_message *msg,
343 u8 flags, void *buffer, size_t size, size_t *residual);
344
345/**
346 * iucv_message_reject
347 * @path: address of iucv path structure
348 * @msg: address of iucv msg structure
349 *
350 * The reject function refuses a specified message. Between the time you
351 * are notified of a message and the time that you complete the message,
352 * the message may be rejected.
353 *
354 * Returns the result from the CP IUCV call.
355 */
356int iucv_message_reject(struct iucv_path *path, struct iucv_message *msg);
357
358/**
359 * iucv_message_reply
360 * @path: address of iucv path structure
361 * @msg: address of iucv msg structure
362 * @flags: how the reply is sent (IUCV_IPRMDATA, IUCV_IPPRTY, IUCV_IPBUFLST)
363 * @reply: address of data buffer or address of struct iucv_array
364 * @size: length of reply data buffer
365 *
366 * This function responds to the two-way messages that you receive. You
367 * must identify completely the message to which you wish to reply. ie,
368 * pathid, msgid, and trgcls. Prmmsg signifies the data is moved into
369 * the parameter list.
370 *
371 * Returns the result from the CP IUCV call.
372 */
373int iucv_message_reply(struct iucv_path *path, struct iucv_message *msg,
374 u8 flags, void *reply, size_t size);
375
376/**
377 * iucv_message_send
378 * @path: address of iucv path structure
379 * @msg: address of iucv msg structure
380 * @flags: how the message is sent (IUCV_IPRMDATA, IUCV_IPPRTY, IUCV_IPBUFLST)
381 * @srccls: source class of message
382 * @buffer: address of data buffer or address of struct iucv_array
383 * @size: length of send buffer
384 *
385 * This function transmits data to another application. Data to be
386 * transmitted is in a buffer and this is a one-way message and the
387 * receiver will not reply to the message.
388 *
389 * Returns the result from the CP IUCV call.
390 */
391int iucv_message_send(struct iucv_path *path, struct iucv_message *msg,
392 u8 flags, u32 srccls, void *buffer, size_t size);
393
394/**
395 * iucv_message_send2way
396 * @path: address of iucv path structure
397 * @msg: address of iucv msg structure
398 * @flags: how the message is sent and the reply is received
399 * (IUCV_IPRMDATA, IUCV_IPBUFLST, IUCV_IPPRTY, IUCV_ANSLST)
400 * @srccls: source class of message
401 * @buffer: address of data buffer or address of struct iucv_array
402 * @size: length of send buffer
403 * @ansbuf: address of answer buffer or address of struct iucv_array
404 * @asize: size of reply buffer
405 *
406 * This function transmits data to another application. Data to be
407 * transmitted is in a buffer. The receiver of the send is expected to
408 * reply to the message and a buffer is provided into which IUCV moves
409 * the reply to this message.
410 *
411 * Returns the result from the CP IUCV call.
412 */
413int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg,
414 u8 flags, u32 srccls, void *buffer, size_t size,
415 void *answer, size_t asize, size_t *residual);
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index bd01b4633ee2..0e690e34c00b 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -45,6 +45,7 @@ union nf_conntrack_expect_proto {
45#include <linux/netfilter/nf_conntrack_ftp.h> 45#include <linux/netfilter/nf_conntrack_ftp.h>
46#include <linux/netfilter/nf_conntrack_pptp.h> 46#include <linux/netfilter/nf_conntrack_pptp.h>
47#include <linux/netfilter/nf_conntrack_h323.h> 47#include <linux/netfilter/nf_conntrack_h323.h>
48#include <linux/netfilter/nf_conntrack_sane.h>
48 49
49/* per conntrack: application helper private data */ 50/* per conntrack: application helper private data */
50union nf_conntrack_help { 51union nf_conntrack_help {
@@ -52,6 +53,7 @@ union nf_conntrack_help {
52 struct nf_ct_ftp_master ct_ftp_info; 53 struct nf_ct_ftp_master ct_ftp_info;
53 struct nf_ct_pptp_master ct_pptp_info; 54 struct nf_ct_pptp_master ct_pptp_info;
54 struct nf_ct_h323_master ct_h323_info; 55 struct nf_ct_h323_master ct_h323_info;
56 struct nf_ct_sane_master ct_sane_info;
55}; 57};
56 58
57#include <linux/types.h> 59#include <linux/types.h>
@@ -255,6 +257,12 @@ extern int nf_conntrack_max;
255 257
256DECLARE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat); 258DECLARE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat);
257#define NF_CT_STAT_INC(count) (__get_cpu_var(nf_conntrack_stat).count++) 259#define NF_CT_STAT_INC(count) (__get_cpu_var(nf_conntrack_stat).count++)
260#define NF_CT_STAT_INC_ATOMIC(count) \
261do { \
262 local_bh_disable(); \
263 __get_cpu_var(nf_conntrack_stat).count++; \
264 local_bh_enable(); \
265} while (0)
258 266
259/* no helper, no nat */ 267/* no helper, no nat */
260#define NF_CT_F_BASIC 0 268#define NF_CT_F_BASIC 0
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h
index 41bcc9eb4206..173c7c1eff23 100644
--- a/include/net/netfilter/nf_conntrack_expect.h
+++ b/include/net/netfilter/nf_conntrack_expect.h
@@ -8,7 +8,7 @@
8 8
9extern struct list_head nf_conntrack_expect_list; 9extern struct list_head nf_conntrack_expect_list;
10extern struct kmem_cache *nf_conntrack_expect_cachep; 10extern struct kmem_cache *nf_conntrack_expect_cachep;
11extern struct file_operations exp_file_ops; 11extern const struct file_operations exp_file_ops;
12 12
13struct nf_conntrack_expect 13struct nf_conntrack_expect
14{ 14{
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h
index 664ddcffe00d..eb575cbd4c95 100644
--- a/include/net/netfilter/nf_conntrack_l3proto.h
+++ b/include/net/netfilter/nf_conntrack_l3proto.h
@@ -89,7 +89,7 @@ extern struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX];
89 89
90/* Protocol registration. */ 90/* Protocol registration. */
91extern int nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto); 91extern int nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto);
92extern int nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto); 92extern void nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto);
93 93
94extern struct nf_conntrack_l3proto * 94extern struct nf_conntrack_l3proto *
95nf_ct_l3proto_find_get(u_int16_t l3proto); 95nf_ct_l3proto_find_get(u_int16_t l3proto);
@@ -106,7 +106,7 @@ __nf_ct_l3proto_find(u_int16_t l3proto)
106{ 106{
107 if (unlikely(l3proto >= AF_MAX)) 107 if (unlikely(l3proto >= AF_MAX))
108 return &nf_conntrack_l3proto_generic; 108 return &nf_conntrack_l3proto_generic;
109 return nf_ct_l3protos[l3proto]; 109 return rcu_dereference(nf_ct_l3protos[l3proto]);
110} 110}
111 111
112#endif /*_NF_CONNTRACK_L3PROTO_H*/ 112#endif /*_NF_CONNTRACK_L3PROTO_H*/
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index fc8af08ff542..8415182ec126 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -109,7 +109,7 @@ extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p);
109 109
110/* Protocol registration. */ 110/* Protocol registration. */
111extern int nf_conntrack_l4proto_register(struct nf_conntrack_l4proto *proto); 111extern int nf_conntrack_l4proto_register(struct nf_conntrack_l4proto *proto);
112extern int nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *proto); 112extern void nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *proto);
113 113
114/* Generic netlink helpers */ 114/* Generic netlink helpers */
115extern int nf_ct_port_tuple_to_nfattr(struct sk_buff *skb, 115extern int nf_ct_port_tuple_to_nfattr(struct sk_buff *skb,
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index 61c62068ca6b..bc57dd7b9b5c 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -16,6 +16,7 @@ enum nf_nat_manip_type
16 16
17#define IP_NAT_RANGE_MAP_IPS 1 17#define IP_NAT_RANGE_MAP_IPS 1
18#define IP_NAT_RANGE_PROTO_SPECIFIED 2 18#define IP_NAT_RANGE_PROTO_SPECIFIED 2
19#define IP_NAT_RANGE_PROTO_RANDOM 4
19 20
20/* NAT sequence number modifications */ 21/* NAT sequence number modifications */
21struct nf_nat_seq { 22struct nf_nat_seq {
diff --git a/include/net/netrom.h b/include/net/netrom.h
index e0ca112024a3..f06852bba62a 100644
--- a/include/net/netrom.h
+++ b/include/net/netrom.h
@@ -215,8 +215,8 @@ extern struct net_device *nr_dev_get(ax25_address *);
215extern int nr_rt_ioctl(unsigned int, void __user *); 215extern int nr_rt_ioctl(unsigned int, void __user *);
216extern void nr_link_failed(ax25_cb *, int); 216extern void nr_link_failed(ax25_cb *, int);
217extern int nr_route_frame(struct sk_buff *, ax25_cb *); 217extern int nr_route_frame(struct sk_buff *, ax25_cb *);
218extern struct file_operations nr_nodes_fops; 218extern const struct file_operations nr_nodes_fops;
219extern struct file_operations nr_neigh_fops; 219extern const struct file_operations nr_neigh_fops;
220extern void nr_rt_free(void); 220extern void nr_rt_free(void);
221 221
222/* nr_subr.c */ 222/* nr_subr.c */
diff --git a/include/net/rose.h b/include/net/rose.h
index 4c05a88b921b..a4047d3cf5dd 100644
--- a/include/net/rose.h
+++ b/include/net/rose.h
@@ -189,9 +189,9 @@ extern void rose_enquiry_response(struct sock *);
189 189
190/* rose_route.c */ 190/* rose_route.c */
191extern struct rose_neigh rose_loopback_neigh; 191extern struct rose_neigh rose_loopback_neigh;
192extern struct file_operations rose_neigh_fops; 192extern const struct file_operations rose_neigh_fops;
193extern struct file_operations rose_nodes_fops; 193extern const struct file_operations rose_nodes_fops;
194extern struct file_operations rose_routes_fops; 194extern const struct file_operations rose_routes_fops;
195 195
196extern void rose_add_loopback_neigh(void); 196extern void rose_add_loopback_neigh(void);
197extern int __must_check rose_add_loopback_node(rose_address *); 197extern int __must_check rose_add_loopback_node(rose_address *);
diff --git a/include/net/route.h b/include/net/route.h
index 486e37aff06c..749e4dfe5ff3 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -53,9 +53,11 @@ struct rtable
53 union 53 union
54 { 54 {
55 struct dst_entry dst; 55 struct dst_entry dst;
56 struct rtable *rt_next;
57 } u; 56 } u;
58 57
58 /* Cache lookup keys */
59 struct flowi fl;
60
59 struct in_device *idev; 61 struct in_device *idev;
60 62
61 unsigned rt_flags; 63 unsigned rt_flags;
@@ -69,9 +71,6 @@ struct rtable
69 /* Info on neighbour */ 71 /* Info on neighbour */
70 __be32 rt_gateway; 72 __be32 rt_gateway;
71 73
72 /* Cache lookup keys */
73 struct flowi fl;
74
75 /* Miscellaneous cached information */ 74 /* Miscellaneous cached information */
76 __be32 rt_spec_dst; /* RFC1122 specific destination */ 75 __be32 rt_spec_dst; /* RFC1122 specific destination */
77 struct inet_peer *peer; /* long-living peer info */ 76 struct inet_peer *peer; /* long-living peer info */
@@ -146,7 +145,8 @@ static inline char rt_tos2priority(u8 tos)
146 145
147static inline int ip_route_connect(struct rtable **rp, __be32 dst, 146static inline int ip_route_connect(struct rtable **rp, __be32 dst,
148 __be32 src, u32 tos, int oif, u8 protocol, 147 __be32 src, u32 tos, int oif, u8 protocol,
149 __be16 sport, __be16 dport, struct sock *sk) 148 __be16 sport, __be16 dport, struct sock *sk,
149 int flags)
150{ 150{
151 struct flowi fl = { .oif = oif, 151 struct flowi fl = { .oif = oif,
152 .nl_u = { .ip4_u = { .daddr = dst, 152 .nl_u = { .ip4_u = { .daddr = dst,
@@ -168,7 +168,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
168 *rp = NULL; 168 *rp = NULL;
169 } 169 }
170 security_sk_classify_flow(sk, &fl); 170 security_sk_classify_flow(sk, &fl);
171 return ip_route_output_flow(rp, &fl, sk, 0); 171 return ip_route_output_flow(rp, &fl, sk, flags);
172} 172}
173 173
174static inline int ip_route_newports(struct rtable **rp, u8 protocol, 174static inline int ip_route_newports(struct rtable **rp, u8 protocol,
diff --git a/include/net/tcp.h b/include/net/tcp.h
index cd8fa0c858ae..5c472f255b77 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -802,9 +802,8 @@ static inline void tcp_update_wl(struct tcp_sock *tp, u32 ack, u32 seq)
802/* 802/*
803 * Calculate(/check) TCP checksum 803 * Calculate(/check) TCP checksum
804 */ 804 */
805static inline __sum16 tcp_v4_check(struct tcphdr *th, int len, 805static inline __sum16 tcp_v4_check(int len, __be32 saddr,
806 __be32 saddr, __be32 daddr, 806 __be32 daddr, __wsum base)
807 __wsum base)
808{ 807{
809 return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base); 808 return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base);
810} 809}
diff --git a/include/net/x25.h b/include/net/x25.h
index e47fe440d9d7..fc3f03d976f8 100644
--- a/include/net/x25.h
+++ b/include/net/x25.h
@@ -161,6 +161,14 @@ struct x25_sock {
161 unsigned long vc_facil_mask; /* inc_call facilities mask */ 161 unsigned long vc_facil_mask; /* inc_call facilities mask */
162}; 162};
163 163
164struct x25_forward {
165 struct list_head node;
166 unsigned int lci;
167 struct net_device *dev1;
168 struct net_device *dev2;
169 atomic_t refcnt;
170};
171
164static inline struct x25_sock *x25_sk(const struct sock *sk) 172static inline struct x25_sock *x25_sk(const struct sock *sk)
165{ 173{
166 return (struct x25_sock *)sk; 174 return (struct x25_sock *)sk;
@@ -172,6 +180,7 @@ extern int sysctl_x25_call_request_timeout;
172extern int sysctl_x25_reset_request_timeout; 180extern int sysctl_x25_reset_request_timeout;
173extern int sysctl_x25_clear_request_timeout; 181extern int sysctl_x25_clear_request_timeout;
174extern int sysctl_x25_ack_holdback_timeout; 182extern int sysctl_x25_ack_holdback_timeout;
183extern int sysctl_x25_forward;
175 184
176extern int x25_addr_ntoa(unsigned char *, struct x25_address *, 185extern int x25_addr_ntoa(unsigned char *, struct x25_address *,
177 struct x25_address *); 186 struct x25_address *);
@@ -198,6 +207,13 @@ extern int x25_negotiate_facilities(struct sk_buff *, struct sock *,
198 struct x25_dte_facilities *); 207 struct x25_dte_facilities *);
199extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *); 208extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *);
200 209
210/* x25_forward.c */
211extern void x25_clear_forward_by_lci(unsigned int lci);
212extern void x25_clear_forward_by_dev(struct net_device *);
213extern int x25_forward_data(int, struct x25_neigh *, struct sk_buff *);
214extern int x25_forward_call(struct x25_address *, struct x25_neigh *,
215 struct sk_buff *, int);
216
201/* x25_in.c */ 217/* x25_in.c */
202extern int x25_process_rx_frame(struct sock *, struct sk_buff *); 218extern int x25_process_rx_frame(struct sock *, struct sk_buff *);
203extern int x25_backlog_rcv(struct sock *, struct sk_buff *); 219extern int x25_backlog_rcv(struct sock *, struct sk_buff *);
@@ -282,6 +298,8 @@ extern struct hlist_head x25_list;
282extern rwlock_t x25_list_lock; 298extern rwlock_t x25_list_lock;
283extern struct list_head x25_route_list; 299extern struct list_head x25_route_list;
284extern rwlock_t x25_route_list_lock; 300extern rwlock_t x25_route_list_lock;
301extern struct list_head x25_forward_list;
302extern rwlock_t x25_forward_list_lock;
285 303
286extern int x25_proc_init(void); 304extern int x25_proc_init(void);
287extern void x25_proc_exit(void); 305extern void x25_proc_exit(void);
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index e4765413cf80..16924cb772c9 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -252,10 +252,13 @@ struct xfrm_state_afinfo {
252 xfrm_address_t *daddr, xfrm_address_t *saddr); 252 xfrm_address_t *daddr, xfrm_address_t *saddr);
253 int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n); 253 int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n);
254 int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n); 254 int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n);
255 int (*output)(struct sk_buff *skb);
255}; 256};
256 257
257extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); 258extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo);
258extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); 259extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);
260extern struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family);
261extern void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo);
259 262
260extern void xfrm_state_delete_tunnel(struct xfrm_state *x); 263extern void xfrm_state_delete_tunnel(struct xfrm_state *x);
261 264
@@ -359,6 +362,19 @@ struct xfrm_policy
359 struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; 362 struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH];
360}; 363};
361 364
365struct xfrm_migrate {
366 xfrm_address_t old_daddr;
367 xfrm_address_t old_saddr;
368 xfrm_address_t new_daddr;
369 xfrm_address_t new_saddr;
370 u8 proto;
371 u8 mode;
372 u16 reserved;
373 u32 reqid;
374 u16 old_family;
375 u16 new_family;
376};
377
362#define XFRM_KM_TIMEOUT 30 378#define XFRM_KM_TIMEOUT 30
363/* which seqno */ 379/* which seqno */
364#define XFRM_REPLAY_SEQ 1 380#define XFRM_REPLAY_SEQ 1
@@ -385,6 +401,7 @@ struct xfrm_mgr
385 int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); 401 int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);
386 int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); 402 int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c);
387 int (*report)(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); 403 int (*report)(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr);
404 int (*migrate)(struct xfrm_selector *sel, u8 dir, u8 type, struct xfrm_migrate *m, int num_bundles);
388}; 405};
389 406
390extern int xfrm_register_km(struct xfrm_mgr *km); 407extern int xfrm_register_km(struct xfrm_mgr *km);
@@ -985,6 +1002,16 @@ extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst,
985 struct flowi *fl, int family, int strict); 1002 struct flowi *fl, int family, int strict);
986extern void xfrm_init_pmtu(struct dst_entry *dst); 1003extern void xfrm_init_pmtu(struct dst_entry *dst);
987 1004
1005#ifdef CONFIG_XFRM_MIGRATE
1006extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
1007 struct xfrm_migrate *m, int num_bundles);
1008extern struct xfrm_state * xfrm_migrate_state_find(struct xfrm_migrate *m);
1009extern struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x,
1010 struct xfrm_migrate *m);
1011extern int xfrm_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
1012 struct xfrm_migrate *m, int num_bundles);
1013#endif
1014
988extern wait_queue_head_t km_waitq; 1015extern wait_queue_head_t km_waitq;
989extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); 1016extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);
990extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); 1017extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid);
@@ -1050,5 +1077,25 @@ static inline void xfrm_aevent_doreplay(struct xfrm_state *x)
1050 xfrm_replay_notify(x, XFRM_REPLAY_UPDATE); 1077 xfrm_replay_notify(x, XFRM_REPLAY_UPDATE);
1051} 1078}
1052 1079
1080#ifdef CONFIG_XFRM_MIGRATE
1081static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig)
1082{
1083 return (struct xfrm_algo *)kmemdup(orig, sizeof(*orig) + orig->alg_key_len, GFP_KERNEL);
1084}
1085
1086static inline void xfrm_states_put(struct xfrm_state **states, int n)
1087{
1088 int i;
1089 for (i = 0; i < n; i++)
1090 xfrm_state_put(*(states + i));
1091}
1092
1093static inline void xfrm_states_delete(struct xfrm_state **states, int n)
1094{
1095 int i;
1096 for (i = 0; i < n; i++)
1097 xfrm_state_delete(*(states + i));
1098}
1099#endif
1053 1100
1054#endif /* _NET_XFRM_H */ 1101#endif /* _NET_XFRM_H */
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 623a0fc0dae1..6e84258b94de 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -284,7 +284,7 @@ struct pcmcia_socket {
284#endif 284#endif
285 285
286 /* socket device */ 286 /* socket device */
287 struct class_device dev; 287 struct device dev;
288 void *driver_data; /* data internal to the socket driver */ 288 void *driver_data; /* data internal to the socket driver */
289 289
290}; 290};
diff --git a/include/rdma/ib_user_mad.h b/include/rdma/ib_user_mad.h
index 44537aa32e62..d66b15ea82c4 100644
--- a/include/rdma/ib_user_mad.h
+++ b/include/rdma/ib_user_mad.h
@@ -98,7 +98,7 @@ struct ib_user_mad_hdr {
98 */ 98 */
99struct ib_user_mad { 99struct ib_user_mad {
100 struct ib_user_mad_hdr hdr; 100 struct ib_user_mad_hdr hdr;
101 __u8 data[0]; 101 __u64 data[0];
102}; 102};
103 103
104/** 104/**
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 0bfa3328d686..765589f4d166 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -45,6 +45,7 @@
45#include <linux/device.h> 45#include <linux/device.h>
46#include <linux/mm.h> 46#include <linux/mm.h>
47#include <linux/dma-mapping.h> 47#include <linux/dma-mapping.h>
48#include <linux/kref.h>
48 49
49#include <asm/atomic.h> 50#include <asm/atomic.h>
50#include <asm/scatterlist.h> 51#include <asm/scatterlist.h>
@@ -419,8 +420,8 @@ struct ib_wc {
419 enum ib_wc_opcode opcode; 420 enum ib_wc_opcode opcode;
420 u32 vendor_err; 421 u32 vendor_err;
421 u32 byte_len; 422 u32 byte_len;
423 struct ib_qp *qp;
422 __be32 imm_data; 424 __be32 imm_data;
423 u32 qp_num;
424 u32 src_qp; 425 u32 src_qp;
425 int wc_flags; 426 int wc_flags;
426 u16 pkey_index; 427 u16 pkey_index;
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index 02f6e4b9e693..4a44278ed768 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -40,6 +40,14 @@
40} 40}
41#define zero_data(p) {p[0]=0;p[1]=0;p[2]=0;} 41#define zero_data(p) {p[0]=0;p[1]=0;p[2]=0;}
42 42
43/* initiator tags; opaque for target */
44typedef uint32_t __bitwise__ itt_t;
45/* below makes sense only for initiator that created this tag */
46#define build_itt(itt, id, age) ((__force itt_t)\
47 ((itt) | ((id) << ISCSI_CID_SHIFT) | ((age) << ISCSI_AGE_SHIFT)))
48#define get_itt(itt) ((__force uint32_t)(itt_t)(itt) & ISCSI_ITT_MASK)
49#define RESERVED_ITT ((__force itt_t)0xffffffff)
50
43/* 51/*
44 * iSCSI Template Message Header 52 * iSCSI Template Message Header
45 */ 53 */
@@ -50,7 +58,7 @@ struct iscsi_hdr {
50 uint8_t hlength; /* AHSs total length */ 58 uint8_t hlength; /* AHSs total length */
51 uint8_t dlength[3]; /* Data length */ 59 uint8_t dlength[3]; /* Data length */
52 uint8_t lun[8]; 60 uint8_t lun[8];
53 __be32 itt; /* Initiator Task Tag */ 61 itt_t itt; /* Initiator Task Tag, opaque for target */
54 __be32 ttt; /* Target Task Tag */ 62 __be32 ttt; /* Target Task Tag */
55 __be32 statsn; 63 __be32 statsn;
56 __be32 exp_statsn; 64 __be32 exp_statsn;
@@ -111,7 +119,7 @@ struct iscsi_cmd {
111 uint8_t hlength; 119 uint8_t hlength;
112 uint8_t dlength[3]; 120 uint8_t dlength[3];
113 uint8_t lun[8]; 121 uint8_t lun[8];
114 __be32 itt; /* Initiator Task Tag */ 122 itt_t itt; /* Initiator Task Tag */
115 __be32 data_length; 123 __be32 data_length;
116 __be32 cmdsn; 124 __be32 cmdsn;
117 __be32 exp_statsn; 125 __be32 exp_statsn;
@@ -148,7 +156,7 @@ struct iscsi_cmd_rsp {
148 uint8_t hlength; 156 uint8_t hlength;
149 uint8_t dlength[3]; 157 uint8_t dlength[3];
150 uint8_t rsvd[8]; 158 uint8_t rsvd[8];
151 __be32 itt; /* Initiator Task Tag */ 159 itt_t itt; /* Initiator Task Tag */
152 __be32 rsvd1; 160 __be32 rsvd1;
153 __be32 statsn; 161 __be32 statsn;
154 __be32 exp_cmdsn; 162 __be32 exp_cmdsn;
@@ -206,7 +214,7 @@ struct iscsi_nopout {
206 uint8_t rsvd3; 214 uint8_t rsvd3;
207 uint8_t dlength[3]; 215 uint8_t dlength[3];
208 uint8_t lun[8]; 216 uint8_t lun[8];
209 __be32 itt; /* Initiator Task Tag */ 217 itt_t itt; /* Initiator Task Tag */
210 __be32 ttt; /* Target Transfer Tag */ 218 __be32 ttt; /* Target Transfer Tag */
211 __be32 cmdsn; 219 __be32 cmdsn;
212 __be32 exp_statsn; 220 __be32 exp_statsn;
@@ -221,7 +229,7 @@ struct iscsi_nopin {
221 uint8_t rsvd3; 229 uint8_t rsvd3;
222 uint8_t dlength[3]; 230 uint8_t dlength[3];
223 uint8_t lun[8]; 231 uint8_t lun[8];
224 __be32 itt; /* Initiator Task Tag */ 232 itt_t itt; /* Initiator Task Tag */
225 __be32 ttt; /* Target Transfer Tag */ 233 __be32 ttt; /* Target Transfer Tag */
226 __be32 statsn; 234 __be32 statsn;
227 __be32 exp_cmdsn; 235 __be32 exp_cmdsn;
@@ -237,8 +245,8 @@ struct iscsi_tm {
237 uint8_t hlength; 245 uint8_t hlength;
238 uint8_t dlength[3]; 246 uint8_t dlength[3];
239 uint8_t lun[8]; 247 uint8_t lun[8];
240 __be32 itt; /* Initiator Task Tag */ 248 itt_t itt; /* Initiator Task Tag */
241 __be32 rtt; /* Reference Task Tag */ 249 itt_t rtt; /* Reference Task Tag */
242 __be32 cmdsn; 250 __be32 cmdsn;
243 __be32 exp_statsn; 251 __be32 exp_statsn;
244 __be32 refcmdsn; 252 __be32 refcmdsn;
@@ -267,8 +275,8 @@ struct iscsi_tm_rsp {
267 uint8_t hlength; 275 uint8_t hlength;
268 uint8_t dlength[3]; 276 uint8_t dlength[3];
269 uint8_t rsvd2[8]; 277 uint8_t rsvd2[8];
270 __be32 itt; /* Initiator Task Tag */ 278 itt_t itt; /* Initiator Task Tag */
271 __be32 rtt; /* Reference Task Tag */ 279 itt_t rtt; /* Reference Task Tag */
272 __be32 statsn; 280 __be32 statsn;
273 __be32 exp_cmdsn; 281 __be32 exp_cmdsn;
274 __be32 max_cmdsn; 282 __be32 max_cmdsn;
@@ -293,7 +301,7 @@ struct iscsi_r2t_rsp {
293 uint8_t hlength; 301 uint8_t hlength;
294 uint8_t dlength[3]; 302 uint8_t dlength[3];
295 uint8_t lun[8]; 303 uint8_t lun[8];
296 __be32 itt; /* Initiator Task Tag */ 304 itt_t itt; /* Initiator Task Tag */
297 __be32 ttt; /* Target Transfer Tag */ 305 __be32 ttt; /* Target Transfer Tag */
298 __be32 statsn; 306 __be32 statsn;
299 __be32 exp_cmdsn; 307 __be32 exp_cmdsn;
@@ -311,7 +319,7 @@ struct iscsi_data {
311 uint8_t rsvd3; 319 uint8_t rsvd3;
312 uint8_t dlength[3]; 320 uint8_t dlength[3];
313 uint8_t lun[8]; 321 uint8_t lun[8];
314 __be32 itt; 322 itt_t itt;
315 __be32 ttt; 323 __be32 ttt;
316 __be32 rsvd4; 324 __be32 rsvd4;
317 __be32 exp_statsn; 325 __be32 exp_statsn;
@@ -331,7 +339,7 @@ struct iscsi_data_rsp {
331 uint8_t hlength; 339 uint8_t hlength;
332 uint8_t dlength[3]; 340 uint8_t dlength[3];
333 uint8_t lun[8]; 341 uint8_t lun[8];
334 __be32 itt; 342 itt_t itt;
335 __be32 ttt; 343 __be32 ttt;
336 __be32 statsn; 344 __be32 statsn;
337 __be32 exp_cmdsn; 345 __be32 exp_cmdsn;
@@ -355,7 +363,7 @@ struct iscsi_text {
355 uint8_t hlength; 363 uint8_t hlength;
356 uint8_t dlength[3]; 364 uint8_t dlength[3];
357 uint8_t rsvd4[8]; 365 uint8_t rsvd4[8];
358 __be32 itt; 366 itt_t itt;
359 __be32 ttt; 367 __be32 ttt;
360 __be32 cmdsn; 368 __be32 cmdsn;
361 __be32 exp_statsn; 369 __be32 exp_statsn;
@@ -373,7 +381,7 @@ struct iscsi_text_rsp {
373 uint8_t hlength; 381 uint8_t hlength;
374 uint8_t dlength[3]; 382 uint8_t dlength[3];
375 uint8_t rsvd4[8]; 383 uint8_t rsvd4[8];
376 __be32 itt; 384 itt_t itt;
377 __be32 ttt; 385 __be32 ttt;
378 __be32 statsn; 386 __be32 statsn;
379 __be32 exp_cmdsn; 387 __be32 exp_cmdsn;
@@ -392,7 +400,7 @@ struct iscsi_login {
392 uint8_t dlength[3]; 400 uint8_t dlength[3];
393 uint8_t isid[6]; /* Initiator Session ID */ 401 uint8_t isid[6]; /* Initiator Session ID */
394 __be16 tsih; /* Target Session Handle */ 402 __be16 tsih; /* Target Session Handle */
395 __be32 itt; /* Initiator Task Tag */ 403 itt_t itt; /* Initiator Task Tag */
396 __be16 cid; 404 __be16 cid;
397 __be16 rsvd3; 405 __be16 rsvd3;
398 __be32 cmdsn; 406 __be32 cmdsn;
@@ -421,7 +429,7 @@ struct iscsi_login_rsp {
421 uint8_t dlength[3]; 429 uint8_t dlength[3];
422 uint8_t isid[6]; /* Initiator Session ID */ 430 uint8_t isid[6]; /* Initiator Session ID */
423 __be16 tsih; /* Target Session Handle */ 431 __be16 tsih; /* Target Session Handle */
424 __be32 itt; /* Initiator Task Tag */ 432 itt_t itt; /* Initiator Task Tag */
425 __be32 rsvd3; 433 __be32 rsvd3;
426 __be32 statsn; 434 __be32 statsn;
427 __be32 exp_cmdsn; 435 __be32 exp_cmdsn;
@@ -478,7 +486,7 @@ struct iscsi_logout {
478 uint8_t hlength; 486 uint8_t hlength;
479 uint8_t dlength[3]; 487 uint8_t dlength[3];
480 uint8_t rsvd2[8]; 488 uint8_t rsvd2[8];
481 __be32 itt; /* Initiator Task Tag */ 489 itt_t itt; /* Initiator Task Tag */
482 __be16 cid; 490 __be16 cid;
483 uint8_t rsvd3[2]; 491 uint8_t rsvd3[2];
484 __be32 cmdsn; 492 __be32 cmdsn;
@@ -505,7 +513,7 @@ struct iscsi_logout_rsp {
505 uint8_t hlength; 513 uint8_t hlength;
506 uint8_t dlength[3]; 514 uint8_t dlength[3];
507 uint8_t rsvd3[8]; 515 uint8_t rsvd3[8];
508 __be32 itt; /* Initiator Task Tag */ 516 itt_t itt; /* Initiator Task Tag */
509 __be32 rsvd4; 517 __be32 rsvd4;
510 __be32 statsn; 518 __be32 statsn;
511 __be32 exp_cmdsn; 519 __be32 exp_cmdsn;
@@ -528,7 +536,7 @@ struct iscsi_snack {
528 uint8_t opcode; 536 uint8_t opcode;
529 uint8_t flags; 537 uint8_t flags;
530 uint8_t rsvd2[14]; 538 uint8_t rsvd2[14];
531 __be32 itt; 539 itt_t itt;
532 __be32 begrun; 540 __be32 begrun;
533 __be32 runlength; 541 __be32 runlength;
534 __be32 exp_statsn; 542 __be32 exp_statsn;
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 0c775fceb675..ad0182ef7809 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -323,12 +323,20 @@ struct sas_ha_event {
323 struct sas_ha_struct *ha; 323 struct sas_ha_struct *ha;
324}; 324};
325 325
326enum sas_ha_state {
327 SAS_HA_REGISTERED,
328 SAS_HA_UNREGISTERED
329};
330
326struct sas_ha_struct { 331struct sas_ha_struct {
327/* private: */ 332/* private: */
328 spinlock_t event_lock; 333 spinlock_t event_lock;
329 struct sas_ha_event ha_events[HA_NUM_EVENTS]; 334 struct sas_ha_event ha_events[HA_NUM_EVENTS];
330 unsigned long pending; 335 unsigned long pending;
331 336
337 enum sas_ha_state state;
338 spinlock_t state_lock;
339
332 struct scsi_core core; 340 struct scsi_core core;
333 341
334/* public: */ 342/* public: */
@@ -553,15 +561,15 @@ struct sas_task {
553#define SAS_TASK_STATE_PENDING 1 561#define SAS_TASK_STATE_PENDING 1
554#define SAS_TASK_STATE_DONE 2 562#define SAS_TASK_STATE_DONE 2
555#define SAS_TASK_STATE_ABORTED 4 563#define SAS_TASK_STATE_ABORTED 4
556#define SAS_TASK_INITIATOR_ABORTED 8 564#define SAS_TASK_NEED_DEV_RESET 8
565#define SAS_TASK_AT_INITIATOR 16
557 566
558static inline struct sas_task *sas_alloc_task(gfp_t flags) 567static inline struct sas_task *sas_alloc_task(gfp_t flags)
559{ 568{
560 extern struct kmem_cache *sas_task_cache; 569 extern struct kmem_cache *sas_task_cache;
561 struct sas_task *task = kmem_cache_alloc(sas_task_cache, flags); 570 struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags);
562 571
563 if (task) { 572 if (task) {
564 memset(task, 0, sizeof(*task));
565 INIT_LIST_HEAD(&task->list); 573 INIT_LIST_HEAD(&task->list);
566 spin_lock_init(&task->task_state_lock); 574 spin_lock_init(&task->task_state_lock);
567 task->task_state_flags = SAS_TASK_STATE_PENDING; 575 task->task_state_flags = SAS_TASK_STATE_PENDING;
@@ -613,6 +621,9 @@ struct sas_domain_function_template {
613extern int sas_register_ha(struct sas_ha_struct *); 621extern int sas_register_ha(struct sas_ha_struct *);
614extern int sas_unregister_ha(struct sas_ha_struct *); 622extern int sas_unregister_ha(struct sas_ha_struct *);
615 623
624int sas_set_phy_speed(struct sas_phy *phy,
625 struct sas_phy_linkrates *rates);
626int sas_phy_enable(struct sas_phy *phy, int enabled);
616int sas_phy_reset(struct sas_phy *phy, int hard_reset); 627int sas_phy_reset(struct sas_phy *phy, int hard_reset);
617extern int sas_queuecommand(struct scsi_cmnd *, 628extern int sas_queuecommand(struct scsi_cmnd *,
618 void (*scsi_done)(struct scsi_cmnd *)); 629 void (*scsi_done)(struct scsi_cmnd *));
@@ -646,6 +657,9 @@ void sas_unregister_dev(struct domain_device *);
646 657
647void sas_init_dev(struct domain_device *); 658void sas_init_dev(struct domain_device *);
648 659
649void sas_task_abort(struct work_struct *); 660void sas_task_abort(struct sas_task *);
661int __sas_task_abort(struct sas_task *);
662int sas_eh_device_reset_handler(struct scsi_cmnd *cmd);
663int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd);
650 664
651#endif /* _SASLIB_H_ */ 665#endif /* _SASLIB_H_ */
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 59633a82de47..9aedc19820b0 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -54,6 +54,7 @@ struct sas_identify {
54struct sas_phy { 54struct sas_phy {
55 struct device dev; 55 struct device dev;
56 int number; 56 int number;
57 int enabled;
57 58
58 /* phy identification */ 59 /* phy identification */
59 struct sas_identify identify; 60 struct sas_identify identify;
@@ -163,6 +164,7 @@ struct sas_function_template {
163 int (*get_enclosure_identifier)(struct sas_rphy *, u64 *); 164 int (*get_enclosure_identifier)(struct sas_rphy *, u64 *);
164 int (*get_bay_identifier)(struct sas_rphy *); 165 int (*get_bay_identifier)(struct sas_rphy *);
165 int (*phy_reset)(struct sas_phy *, int); 166 int (*phy_reset)(struct sas_phy *, int);
167 int (*phy_enable)(struct sas_phy *, int);
166 int (*set_phy_speed)(struct sas_phy *, struct sas_phy_linkrates *); 168 int (*set_phy_speed)(struct sas_phy *, struct sas_phy_linkrates *);
167}; 169};
168 170
@@ -180,6 +182,7 @@ extern struct sas_rphy *sas_end_device_alloc(struct sas_port *);
180extern struct sas_rphy *sas_expander_alloc(struct sas_port *, enum sas_device_type); 182extern struct sas_rphy *sas_expander_alloc(struct sas_port *, enum sas_device_type);
181void sas_rphy_free(struct sas_rphy *); 183void sas_rphy_free(struct sas_rphy *);
182extern int sas_rphy_add(struct sas_rphy *); 184extern int sas_rphy_add(struct sas_rphy *);
185extern void sas_rphy_remove(struct sas_rphy *);
183extern void sas_rphy_delete(struct sas_rphy *); 186extern void sas_rphy_delete(struct sas_rphy *);
184extern int scsi_is_sas_rphy(const struct device *); 187extern int scsi_is_sas_rphy(const struct device *);
185 188
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h
index da180f738477..286e9628ed8b 100644
--- a/include/scsi/scsi_transport_spi.h
+++ b/include/scsi/scsi_transport_spi.h
@@ -85,6 +85,7 @@ struct spi_host_attrs {
85#define spi_pcomp_en(x) (((struct spi_transport_attrs *)&(x)->starget_data)->pcomp_en) 85#define spi_pcomp_en(x) (((struct spi_transport_attrs *)&(x)->starget_data)->pcomp_en)
86#define spi_hold_mcs(x) (((struct spi_transport_attrs *)&(x)->starget_data)->hold_mcs) 86#define spi_hold_mcs(x) (((struct spi_transport_attrs *)&(x)->starget_data)->hold_mcs)
87#define spi_initial_dv(x) (((struct spi_transport_attrs *)&(x)->starget_data)->initial_dv) 87#define spi_initial_dv(x) (((struct spi_transport_attrs *)&(x)->starget_data)->initial_dv)
88#define spi_dv_pending(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_pending)
88 89
89#define spi_support_sync(x) (((struct spi_transport_attrs *)&(x)->starget_data)->support_sync) 90#define spi_support_sync(x) (((struct spi_transport_attrs *)&(x)->starget_data)->support_sync)
90#define spi_support_wide(x) (((struct spi_transport_attrs *)&(x)->starget_data)->support_wide) 91#define spi_support_wide(x) (((struct spi_transport_attrs *)&(x)->starget_data)->support_wide)
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index 33720397a904..246ac23534bd 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -375,6 +375,7 @@
375#define AC97_SCAP_DETECT_BY_VENDOR (1<<8) /* use vendor registers for read tests */ 375#define AC97_SCAP_DETECT_BY_VENDOR (1<<8) /* use vendor registers for read tests */
376#define AC97_SCAP_NO_SPDIF (1<<9) /* don't build SPDIF controls */ 376#define AC97_SCAP_NO_SPDIF (1<<9) /* don't build SPDIF controls */
377#define AC97_SCAP_EAPD_LED (1<<10) /* EAPD as mute LED */ 377#define AC97_SCAP_EAPD_LED (1<<10) /* EAPD as mute LED */
378#define AC97_SCAP_POWER_SAVE (1<<11) /* capable for aggresive power-saving */
378 379
379/* ac97->flags */ 380/* ac97->flags */
380#define AC97_HAS_PC_BEEP (1<<0) /* force PC Speaker usage */ 381#define AC97_HAS_PC_BEEP (1<<0) /* force PC Speaker usage */
@@ -425,6 +426,7 @@ struct snd_ac97_build_ops {
425 426
426struct snd_ac97_bus_ops { 427struct snd_ac97_bus_ops {
427 void (*reset) (struct snd_ac97 *ac97); 428 void (*reset) (struct snd_ac97 *ac97);
429 void (*warm_reset)(struct snd_ac97 *ac97);
428 void (*write) (struct snd_ac97 *ac97, unsigned short reg, unsigned short val); 430 void (*write) (struct snd_ac97 *ac97, unsigned short reg, unsigned short val);
429 unsigned short (*read) (struct snd_ac97 *ac97, unsigned short reg); 431 unsigned short (*read) (struct snd_ac97 *ac97, unsigned short reg);
430 void (*wait) (struct snd_ac97 *ac97); 432 void (*wait) (struct snd_ac97 *ac97);
@@ -501,6 +503,7 @@ struct snd_ac97 {
501 unsigned short id[3]; // codec IDs (lower 16-bit word) 503 unsigned short id[3]; // codec IDs (lower 16-bit word)
502 unsigned short pcmreg[3]; // PCM registers 504 unsigned short pcmreg[3]; // PCM registers
503 unsigned short codec_cfg[3]; // CODEC_CFG bits 505 unsigned short codec_cfg[3]; // CODEC_CFG bits
506 unsigned char swap_mic_linein; // AD1986/AD1986A only
504 } ad18xx; 507 } ad18xx;
505 unsigned int dev_flags; /* device specific */ 508 unsigned int dev_flags; /* device specific */
506 } spec; 509 } spec;
@@ -510,7 +513,6 @@ struct snd_ac97 {
510 513
511#ifdef CONFIG_SND_AC97_POWER_SAVE 514#ifdef CONFIG_SND_AC97_POWER_SAVE
512 unsigned int power_up; /* power states */ 515 unsigned int power_up; /* power states */
513 struct workqueue_struct *power_workq;
514 struct delayed_work power_work; 516 struct delayed_work power_work;
515#endif 517#endif
516 struct device dev; 518 struct device dev;
diff --git a/include/sound/ad1848.h b/include/sound/ad1848.h
index c8de6f83338f..b2c3f00a9b35 100644
--- a/include/sound/ad1848.h
+++ b/include/sound/ad1848.h
@@ -185,7 +185,7 @@ struct ad1848_mix_elem {
185 int index; 185 int index;
186 int type; 186 int type;
187 unsigned long private_value; 187 unsigned long private_value;
188 unsigned int *tlv; 188 const unsigned int *tlv;
189}; 189};
190 190
191#define AD1848_SINGLE(xname, xindex, reg, shift, mask, invert) \ 191#define AD1848_SINGLE(xname, xindex, reg, shift, mask, invert) \
diff --git a/include/sound/ak4114.h b/include/sound/ak4114.h
index 2ee061625fd0..c149d3b2558b 100644
--- a/include/sound/ak4114.h
+++ b/include/sound/ak4114.h
@@ -181,7 +181,6 @@ struct ak4114 {
181 unsigned long ccrc_errors; 181 unsigned long ccrc_errors;
182 unsigned char rcs0; 182 unsigned char rcs0;
183 unsigned char rcs1; 183 unsigned char rcs1;
184 struct workqueue_struct *workqueue;
185 struct delayed_work work; 184 struct delayed_work work;
186 void *change_callback_private; 185 void *change_callback_private;
187 void (*change_callback)(struct ak4114 *ak4114, unsigned char c0, unsigned char c1); 186 void (*change_callback)(struct ak4114 *ak4114, unsigned char c0, unsigned char c1);
@@ -189,7 +188,7 @@ struct ak4114 {
189 188
190int snd_ak4114_create(struct snd_card *card, 189int snd_ak4114_create(struct snd_card *card,
191 ak4114_read_t *read, ak4114_write_t *write, 190 ak4114_read_t *read, ak4114_write_t *write,
192 unsigned char pgm[7], unsigned char txcsb[5], 191 const unsigned char pgm[7], const unsigned char txcsb[5],
193 void *private_data, struct ak4114 **r_ak4114); 192 void *private_data, struct ak4114 **r_ak4114);
194void snd_ak4114_reg_write(struct ak4114 *ak4114, unsigned char reg, unsigned char mask, unsigned char val); 193void snd_ak4114_reg_write(struct ak4114 *ak4114, unsigned char reg, unsigned char mask, unsigned char val);
195void snd_ak4114_reinit(struct ak4114 *ak4114); 194void snd_ak4114_reinit(struct ak4114 *ak4114);
diff --git a/include/sound/ak4117.h b/include/sound/ak4117.h
index 2b96c32f06fd..d650d52e3d29 100644
--- a/include/sound/ak4117.h
+++ b/include/sound/ak4117.h
@@ -178,7 +178,7 @@ struct ak4117 {
178}; 178};
179 179
180int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t *write, 180int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t *write,
181 unsigned char pgm[5], void *private_data, struct ak4117 **r_ak4117); 181 const unsigned char pgm[5], void *private_data, struct ak4117 **r_ak4117);
182void snd_ak4117_reg_write(struct ak4117 *ak4117, unsigned char reg, unsigned char mask, unsigned char val); 182void snd_ak4117_reg_write(struct ak4117 *ak4117, unsigned char reg, unsigned char mask, unsigned char val);
183void snd_ak4117_reinit(struct ak4117 *ak4117); 183void snd_ak4117_reinit(struct ak4117 *ak4117);
184int snd_ak4117_build(struct ak4117 *ak4117, struct snd_pcm_substream *capture_substream); 184int snd_ak4117_build(struct ak4117 *ak4117, struct snd_pcm_substream *capture_substream);
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h
index d0deca669b92..aa49dda4f410 100644
--- a/include/sound/ak4xxx-adda.h
+++ b/include/sound/ak4xxx-adda.h
@@ -50,6 +50,8 @@ struct snd_akm4xxx_adc_channel {
50 char *name; /* capture gain volume label */ 50 char *name; /* capture gain volume label */
51 char *switch_name; /* capture switch */ 51 char *switch_name; /* capture switch */
52 unsigned int num_channels; 52 unsigned int num_channels;
53 char *selector_name; /* capture source select label */
54 const char **input_names; /* capture source names (NULL terminated) */
53}; 55};
54 56
55struct snd_akm4xxx { 57struct snd_akm4xxx {
@@ -69,8 +71,8 @@ struct snd_akm4xxx {
69 } type; 71 } type;
70 72
71 /* (array) information of combined codecs */ 73 /* (array) information of combined codecs */
72 struct snd_akm4xxx_dac_channel *dac_info; 74 const struct snd_akm4xxx_dac_channel *dac_info;
73 struct snd_akm4xxx_adc_channel *adc_info; 75 const struct snd_akm4xxx_adc_channel *adc_info;
74 76
75 struct snd_ak4xxx_ops ops; 77 struct snd_ak4xxx_ops ops;
76}; 78};
diff --git a/include/sound/control.h b/include/sound/control.h
index 1de148b0fd94..72e759f619b1 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -49,7 +49,7 @@ struct snd_kcontrol_new {
49 snd_kcontrol_put_t *put; 49 snd_kcontrol_put_t *put;
50 union { 50 union {
51 snd_kcontrol_tlv_rw_t *c; 51 snd_kcontrol_tlv_rw_t *c;
52 unsigned int *p; 52 const unsigned int *p;
53 } tlv; 53 } tlv;
54 unsigned long private_value; 54 unsigned long private_value;
55}; 55};
@@ -69,7 +69,7 @@ struct snd_kcontrol {
69 snd_kcontrol_put_t *put; 69 snd_kcontrol_put_t *put;
70 union { 70 union {
71 snd_kcontrol_tlv_rw_t *c; 71 snd_kcontrol_tlv_rw_t *c;
72 unsigned int *p; 72 const unsigned int *p;
73 } tlv; 73 } tlv;
74 unsigned long private_value; 74 unsigned long private_value;
75 void *private_data; 75 void *private_data;
@@ -108,7 +108,6 @@ typedef int (*snd_kctl_ioctl_func_t) (struct snd_card * card,
108 108
109void snd_ctl_notify(struct snd_card * card, unsigned int mask, struct snd_ctl_elem_id * id); 109void snd_ctl_notify(struct snd_card * card, unsigned int mask, struct snd_ctl_elem_id * id);
110 110
111struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol * kcontrol, unsigned int access);
112struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new * kcontrolnew, void * private_data); 111struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new * kcontrolnew, void * private_data);
113void snd_ctl_free_one(struct snd_kcontrol * kcontrol); 112void snd_ctl_free_one(struct snd_kcontrol * kcontrol);
114int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol); 113int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol);
diff --git a/include/sound/core.h b/include/sound/core.h
index 521f036cce99..4b9e609975ab 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -211,9 +211,40 @@ extern struct class *sound_class;
211 211
212void snd_request_card(int card); 212void snd_request_card(int card);
213 213
214int snd_register_device(int type, struct snd_card *card, int dev, 214int snd_register_device_for_dev(int type, struct snd_card *card,
215 const struct file_operations *f_ops, void *private_data, 215 int dev,
216 const char *name); 216 const struct file_operations *f_ops,
217 void *private_data,
218 const char *name,
219 struct device *device);
220
221/**
222 * snd_register_device - Register the ALSA device file for the card
223 * @type: the device type, SNDRV_DEVICE_TYPE_XXX
224 * @card: the card instance
225 * @dev: the device index
226 * @f_ops: the file operations
227 * @private_data: user pointer for f_ops->open()
228 * @name: the device file name
229 *
230 * Registers an ALSA device file for the given card.
231 * The operators have to be set in reg parameter.
232 *
233 * This function uses the card's device pointer to link to the
234 * correct &struct device.
235 *
236 * Returns zero if successful, or a negative error code on failure.
237 */
238static inline int snd_register_device(int type, struct snd_card *card, int dev,
239 const struct file_operations *f_ops,
240 void *private_data,
241 const char *name)
242{
243 return snd_register_device_for_dev(type, card, dev, f_ops,
244 private_data, name,
245 snd_card_get_device_link(card));
246}
247
217int snd_unregister_device(int type, struct snd_card *card, int dev); 248int snd_unregister_device(int type, struct snd_card *card, int dev);
218void *snd_lookup_minor_data(unsigned int minor, int type); 249void *snd_lookup_minor_data(unsigned int minor, int type);
219int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, 250int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev,
@@ -396,6 +427,29 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
396#endif 427#endif
397#endif 428#endif
398 429
399#include "typedefs.h" 430/* PCI quirk list helper */
431struct snd_pci_quirk {
432 unsigned short subvendor; /* PCI subvendor ID */
433 unsigned short subdevice; /* PCI subdevice ID */
434 int value; /* value */
435#ifdef CONFIG_SND_DEBUG_DETECT
436 const char *name; /* name of the device (optional) */
437#endif
438};
439
440#define _SND_PCI_QUIRK_ID(vend,dev) \
441 .subvendor = (vend), .subdevice = (dev)
442#define SND_PCI_QUIRK_ID(vend,dev) {_SND_PCI_QUIRK_ID(vend, dev)}
443#ifdef CONFIG_SND_DEBUG_DETECT
444#define SND_PCI_QUIRK(vend,dev,xname,val) \
445 {_SND_PCI_QUIRK_ID(vend, dev), .value = (val), .name = (xname)}
446#else
447#define SND_PCI_QUIRK(vend,dev,xname,val) \
448 {_SND_PCI_QUIRK_ID(vend, dev), .value = (val)}
449#endif
450
451const struct snd_pci_quirk *
452snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list);
453
400 454
401#endif /* __SOUND_CORE_H */ 455#endif /* __SOUND_CORE_H */
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 3d3c1514cf71..eb7ce96ddf3a 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -188,7 +188,35 @@
188#define HCFG_LEGACYINT 0x00200000 /* 1 = legacy event captured. Write 1 to clear. */ 188#define HCFG_LEGACYINT 0x00200000 /* 1 = legacy event captured. Write 1 to clear. */
189 /* NOTE: The rest of the bits in this register */ 189 /* NOTE: The rest of the bits in this register */
190 /* _are_ relevant under Linux. */ 190 /* _are_ relevant under Linux. */
191#define HCFG_CODECFORMAT_MASK 0x00070000 /* CODEC format */ 191#define HCFG_PUSH_BUTTON_ENABLE 0x00100000 /* Enables Volume Inc/Dec and Mute functions */
192#define HCFG_BAUD_RATE 0x00080000 /* 0 = 48kHz, 1 = 44.1kHz */
193#define HCFG_EXPANDED_MEM 0x00040000 /* 1 = any 16M of 4G addr, 0 = 32M of 2G addr */
194#define HCFG_CODECFORMAT_MASK 0x00030000 /* CODEC format */
195
196/* Specific to Alice2, CA0102 */
197#define HCFG_CODECFORMAT_AC97_1 0x00000000 /* AC97 CODEC format -- Ver 1.03 */
198#define HCFG_CODECFORMAT_AC97_2 0x00010000 /* AC97 CODEC format -- Ver 2.1 */
199#define HCFG_AUTOMUTE_ASYNC 0x00008000 /* When set, the async sample rate convertors */
200 /* will automatically mute their output when */
201 /* they are not rate-locked to the external */
202 /* async audio source */
203#define HCFG_AUTOMUTE_SPDIF 0x00004000 /* When set, the async sample rate convertors */
204 /* will automatically mute their output when */
205 /* the SPDIF V-bit indicates invalid audio */
206#define HCFG_EMU32_SLAVE 0x00002000 /* 0 = Master, 1 = Slave. Slave for EMU1010 */
207#define HCFG_SLOW_RAMP 0x00001000 /* Increases Send Smoothing time constant */
208/* 0x00000800 not used on Alice2 */
209#define HCFG_PHASE_TRACK_MASK 0x00000700 /* When set, forces corresponding input to */
210 /* phase track the previous input. */
211 /* I2S0 can phase track the last S/PDIF input */
212#define HCFG_I2S_ASRC_ENABLE 0x00000070 /* When set, enables asynchronous sample rate */
213 /* conversion for the corresponding */
214 /* I2S format input */
215/* Rest of HCFG 0x0000000f same as below. LOCKSOUNDCACHE etc. */
216
217
218
219/* Older chips */
192#define HCFG_CODECFORMAT_AC97 0x00000000 /* AC97 CODEC format -- Primary Output */ 220#define HCFG_CODECFORMAT_AC97 0x00000000 /* AC97 CODEC format -- Primary Output */
193#define HCFG_CODECFORMAT_I2S 0x00010000 /* I2S CODEC format -- Secondary (Rear) Output */ 221#define HCFG_CODECFORMAT_I2S 0x00010000 /* I2S CODEC format -- Secondary (Rear) Output */
194#define HCFG_GPINPUT0 0x00004000 /* External pin112 */ 222#define HCFG_GPINPUT0 0x00004000 /* External pin112 */
@@ -432,6 +460,7 @@
432#define FXRT_CHANNELC 0x0f000000 /* Effects send bus number for channel's effects send C */ 460#define FXRT_CHANNELC 0x0f000000 /* Effects send bus number for channel's effects send C */
433#define FXRT_CHANNELD 0xf0000000 /* Effects send bus number for channel's effects send D */ 461#define FXRT_CHANNELD 0xf0000000 /* Effects send bus number for channel's effects send D */
434 462
463#define A_HR 0x0b /* High Resolution. 24bit playback from host to DSP. */
435#define MAPA 0x0c /* Cache map A */ 464#define MAPA 0x0c /* Cache map A */
436 465
437#define MAPB 0x0d /* Cache map B */ 466#define MAPB 0x0d /* Cache map B */
@@ -439,6 +468,8 @@
439#define MAP_PTE_MASK 0xffffe000 /* The 19 MSBs of the PTE indexed by the PTI */ 468#define MAP_PTE_MASK 0xffffe000 /* The 19 MSBs of the PTE indexed by the PTI */
440#define MAP_PTI_MASK 0x00001fff /* The 13 bit index to one of the 8192 PTE dwords */ 469#define MAP_PTI_MASK 0x00001fff /* The 13 bit index to one of the 8192 PTE dwords */
441 470
471/* 0x0e, 0x0f: Not used */
472
442#define ENVVOL 0x10 /* Volume envelope register */ 473#define ENVVOL 0x10 /* Volume envelope register */
443#define ENVVOL_MASK 0x0000ffff /* Current value of volume envelope state variable */ 474#define ENVVOL_MASK 0x0000ffff /* Current value of volume envelope state variable */
444 /* 0x8000-n == 666*n usec delay */ 475 /* 0x8000-n == 666*n usec delay */
@@ -527,7 +558,7 @@
527 /* NOTE: All channels contain internal variables; do */ 558 /* NOTE: All channels contain internal variables; do */
528 /* not write to these locations. */ 559 /* not write to these locations. */
529 560
530/* 1f something */ 561/* 0x1f: not used */
531 562
532#define CD0 0x20 /* Cache data 0 register */ 563#define CD0 0x20 /* Cache data 0 register */
533#define CD1 0x21 /* Cache data 1 register */ 564#define CD1 0x21 /* Cache data 1 register */
@@ -597,6 +628,8 @@
597#define FXWC_SPDIFLEFT (1<<22) /* 0x00400000 */ 628#define FXWC_SPDIFLEFT (1<<22) /* 0x00400000 */
598#define FXWC_SPDIFRIGHT (1<<23) /* 0x00800000 */ 629#define FXWC_SPDIFRIGHT (1<<23) /* 0x00800000 */
599 630
631#define A_TBLSZ ` 0x43 /* Effects Tank Internal Table Size. Only low byte or register used */
632
600#define TCBS 0x44 /* Tank cache buffer size register */ 633#define TCBS 0x44 /* Tank cache buffer size register */
601#define TCBS_MASK 0x00000007 /* Tank cache buffer size field */ 634#define TCBS_MASK 0x00000007 /* Tank cache buffer size field */
602#define TCBS_BUFFSIZE_16K 0x00000000 635#define TCBS_BUFFSIZE_16K 0x00000000
@@ -617,7 +650,7 @@
617#define FXBA 0x47 /* FX Buffer Address */ 650#define FXBA 0x47 /* FX Buffer Address */
618#define FXBA_MASK 0xfffff000 /* 20 bit base address */ 651#define FXBA_MASK 0xfffff000 /* 20 bit base address */
619 652
620/* 0x48 something - word access, defaults to 3f */ 653#define A_HWM 0x48 /* High PCI Water Mark - word access, defaults to 3f */
621 654
622#define MICBS 0x49 /* Microphone buffer size register */ 655#define MICBS 0x49 /* Microphone buffer size register */
623 656
@@ -661,6 +694,18 @@
661#define ADCBS_BUFSIZE_57344 0x0000001e 694#define ADCBS_BUFSIZE_57344 0x0000001e
662#define ADCBS_BUFSIZE_65536 0x0000001f 695#define ADCBS_BUFSIZE_65536 0x0000001f
663 696
697/* Current Send B, A Amounts */
698#define A_CSBA 0x4c
699
700/* Current Send D, C Amounts */
701#define A_CSDC 0x4d
702
703/* Current Send F, E Amounts */
704#define A_CSFE 0x4e
705
706/* Current Send H, G Amounts */
707#define A_CSHG 0x4f
708
664 709
665#define CDCS 0x50 /* CD-ROM digital channel status register */ 710#define CDCS 0x50 /* CD-ROM digital channel status register */
666 711
@@ -668,6 +713,9 @@
668 713
669#define DBG 0x52 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */ 714#define DBG 0x52 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */
670 715
716/* S/PDIF Input C Channel Status */
717#define A_SPSC 0x52
718
671#define REG53 0x53 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */ 719#define REG53 0x53 /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */
672 720
673#define A_DBG 0x53 721#define A_DBG 0x53
@@ -708,6 +756,8 @@
708#define SPCS_NOTAUDIODATA 0x00000002 /* 0 = Digital audio, 1 = not audio */ 756#define SPCS_NOTAUDIODATA 0x00000002 /* 0 = Digital audio, 1 = not audio */
709#define SPCS_PROFESSIONAL 0x00000001 /* 0 = Consumer (IEC-958), 1 = pro (AES3-1992) */ 757#define SPCS_PROFESSIONAL 0x00000001 /* 0 = Consumer (IEC-958), 1 = pro (AES3-1992) */
710 758
759/* 0x57: Not used */
760
711/* The 32-bit CLIx and SOLx registers all have one bit per channel control/status */ 761/* The 32-bit CLIx and SOLx registers all have one bit per channel control/status */
712#define CLIEL 0x58 /* Channel loop interrupt enable low register */ 762#define CLIEL 0x58 /* Channel loop interrupt enable low register */
713 763
@@ -733,6 +783,9 @@
733#define AC97SLOT_CNTR 0x10 /* Center enable */ 783#define AC97SLOT_CNTR 0x10 /* Center enable */
734#define AC97SLOT_LFE 0x20 /* LFE enable */ 784#define AC97SLOT_LFE 0x20 /* LFE enable */
735 785
786/* PCB Revision */
787#define A_PCB 0x5f
788
736// NOTE: 0x60,61,62: 64-bit 789// NOTE: 0x60,61,62: 64-bit
737#define CDSRCS 0x60 /* CD-ROM Sample Rate Converter status register */ 790#define CDSRCS 0x60 /* CD-ROM Sample Rate Converter status register */
738 791
@@ -780,9 +833,18 @@
780 833
781#define HLIPH 0x69 /* Channel half loop interrupt pending high register */ 834#define HLIPH 0x69 /* Channel half loop interrupt pending high register */
782 835
783// 0x6a,6b,6c used for some recording 836/* S/PDIF Host Record Index (bypasses SRC) */
784// 0x6d unused 837#define A_SPRI 0x6a
785// 0x6e,6f - tanktable base / offset 838/* S/PDIF Host Record Address */
839#define A_SPRA 0x6b
840/* S/PDIF Host Record Control */
841#define A_SPRC 0x6c
842/* Delayed Interrupt Counter & Enable */
843#define A_DICE 0x6d
844/* Tank Table Base */
845#define A_TTB 0x6e
846/* Tank Delay Offset */
847#define A_TDOF 0x6f
786 848
787/* This is the MPU port on the card (via the game port) */ 849/* This is the MPU port on the card (via the game port) */
788#define A_MUDATA1 0x70 850#define A_MUDATA1 0x70
@@ -800,6 +862,7 @@
800#define A_FXWC1 0x74 /* Selects 0x7f-0x60 for FX recording */ 862#define A_FXWC1 0x74 /* Selects 0x7f-0x60 for FX recording */
801#define A_FXWC2 0x75 /* Selects 0x9f-0x80 for FX recording */ 863#define A_FXWC2 0x75 /* Selects 0x9f-0x80 for FX recording */
802 864
865/* Extended Hardware Control */
803#define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */ 866#define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */
804#define A_SAMPLE_RATE 0x76 /* Various sample rate settings. */ 867#define A_SAMPLE_RATE 0x76 /* Various sample rate settings. */
805#define A_SAMPLE_RATE_NOT_USED 0x0ffc111e /* Bits that are not used and cannot be set. */ 868#define A_SAMPLE_RATE_NOT_USED 0x0ffc111e /* Bits that are not used and cannot be set. */
@@ -822,8 +885,20 @@
822#define A_PCM_96000 0x00004000 885#define A_PCM_96000 0x00004000
823#define A_PCM_44100 0x00008000 886#define A_PCM_44100 0x00008000
824 887
825/* 0x77,0x78,0x79 "something i2s-related" - default to 0x01080000 on my audigy 2 ZS --rlrevell */ 888/* I2S0 Sample Rate Tracker Status */
826/* 0x7a, 0x7b - lookup tables */ 889#define A_SRT3 0x77
890
891/* I2S1 Sample Rate Tracker Status */
892#define A_SRT4 0x78
893
894/* I2S2 Sample Rate Tracker Status */
895#define A_SRT5 0x79
896/* - default to 0x01080000 on my audigy 2 ZS --rlrevell */
897
898/* Tank Table DMA Address */
899#define A_TTDA 0x7a
900/* Tank Table DMA Data */
901#define A_TTDD 0x7b
827 902
828#define A_FXRT2 0x7c 903#define A_FXRT2 0x7c
829#define A_FXRT_CHANNELE 0x0000003f /* Effects send bus number for channel's effects send E */ 904#define A_FXRT_CHANNELE 0x0000003f /* Effects send bus number for channel's effects send E */
@@ -845,7 +920,7 @@
845#define A_FXRT_CHANNELC 0x003f0000 920#define A_FXRT_CHANNELC 0x003f0000
846#define A_FXRT_CHANNELD 0x3f000000 921#define A_FXRT_CHANNELD 0x3f000000
847 922
848 923/* 0x7f: Not used */
849/* Each FX general purpose register is 32 bits in length, all bits are used */ 924/* Each FX general purpose register is 32 bits in length, all bits are used */
850#define FXGPREGBASE 0x100 /* FX general purpose registers base */ 925#define FXGPREGBASE 0x100 /* FX general purpose registers base */
851#define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */ 926#define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */
@@ -886,6 +961,293 @@
886#define A_HIWORD_RESULT_MASK 0x007ff000 961#define A_HIWORD_RESULT_MASK 0x007ff000
887#define A_HIWORD_OPA_MASK 0x000007ff 962#define A_HIWORD_OPA_MASK 0x000007ff
888 963
964/************************************************************************************************/
965/* EMU1010m HANA FPGA registers */
966/************************************************************************************************/
967#define EMU_HANA_DESTHI 0x00 /* 0000xxx 3 bits Link Destination */
968#define EMU_HANA_DESTLO 0x01 /* 00xxxxx 5 bits */
969#define EMU_HANA_SRCHI 0x02 /* 0000xxx 3 bits Link Source */
970#define EMU_HANA_SRCLO 0x03 /* 00xxxxx 5 bits */
971#define EMU_HANA_DOCK_PWR 0x04 /* 000000x 1 bits Audio Dock power */
972#define EMU_HANA_DOCK_PWR_ON 0x01 /* Audio Dock power on */
973#define EMU_HANA_WCLOCK 0x05 /* 0000xxx 3 bits Word Clock source select */
974 /* Must be written after power on to reset DLL */
975 /* One is unable to detect the Audio dock without this */
976#define EMU_HANA_WCLOCK_SRC_MASK 0x07
977#define EMU_HANA_WCLOCK_INT_48K 0x00
978#define EMU_HANA_WCLOCK_INT_44_1K 0x01
979#define EMU_HANA_WCLOCK_HANA_SPDIF_IN 0x02
980#define EMU_HANA_WCLOCK_HANA_ADAT_IN 0x03
981#define EMU_HANA_WCLOCK_SYNC_BNCN 0x04
982#define EMU_HANA_WCLOCK_2ND_HANA 0x05
983#define EMU_HANA_WCLOCK_SRC_RESERVED 0x06
984#define EMU_HANA_WCLOCK_OFF 0x07 /* For testing, forces fallback to DEFCLOCK */
985#define EMU_HANA_WCLOCK_MULT_MASK 0x18
986#define EMU_HANA_WCLOCK_1X 0x00
987#define EMU_HANA_WCLOCK_2X 0x08
988#define EMU_HANA_WCLOCK_4X 0x10
989#define EMU_HANA_WCLOCK_MULT_RESERVED 0x18
990
991#define EMU_HANA_DEFCLOCK 0x06 /* 000000x 1 bits Default Word Clock */
992#define EMU_HANA_DEFCLOCK_48K 0x00
993#define EMU_HANA_DEFCLOCK_44_1K 0x01
994
995#define EMU_HANA_UNMUTE 0x07 /* 000000x 1 bits Mute all audio outputs */
996#define EMU_MUTE 0x00
997#define EMU_UNMUTE 0x01
998
999#define EMU_HANA_FPGA_CONFIG 0x08 /* 00000xx 2 bits Config control of FPGAs */
1000#define EMU_HANA_FPGA_CONFIG_AUDIODOCK 0x01 /* Set in order to program FPGA on Audio Dock */
1001#define EMU_HANA_FPGA_CONFIG_HANA 0x02 /* Set in order to program FPGA on Hana */
1002
1003#define EMU_HANA_IRQ_ENABLE 0x09 /* 000xxxx 4 bits IRQ Enable */
1004#define EMU_HANA_IRQ_WCLK_CHANGED 0x01
1005#define EMU_HANA_IRQ_ADAT 0x02
1006#define EMU_HANA_IRQ_DOCK 0x04
1007#define EMU_HANA_IRQ_DOCK_LOST 0x08
1008
1009#define EMU_HANA_SPDIF_MODE 0x0a /* 00xxxxx 5 bits SPDIF MODE */
1010#define EMU_HANA_SPDIF_MODE_TX_COMSUMER 0x00
1011#define EMU_HANA_SPDIF_MODE_TX_PRO 0x01
1012#define EMU_HANA_SPDIF_MODE_TX_NOCOPY 0x02
1013#define EMU_HANA_SPDIF_MODE_RX_COMSUMER 0x00
1014#define EMU_HANA_SPDIF_MODE_RX_PRO 0x04
1015#define EMU_HANA_SPDIF_MODE_RX_NOCOPY 0x08
1016#define EMU_HANA_SPDIF_MODE_RX_INVALID 0x10
1017
1018#define EMU_HANA_OPTICAL_TYPE 0x0b /* 00000xx 2 bits ADAT or SPDIF in/out */
1019#define EMU_HANA_OPTICAL_IN_SPDIF 0x00
1020#define EMU_HANA_OPTICAL_IN_ADAT 0x01
1021#define EMU_HANA_OPTICAL_OUT_SPDIF 0x00
1022#define EMU_HANA_OPTICAL_OUT_ADAT 0x02
1023
1024#define EMU_HANA_MIDI_IN 0x0c /* 000000x 1 bit Control MIDI */
1025#define EMU_HANA_MIDI_IN_FROM_HAMOA 0x00 /* HAMOA MIDI in to Alice 2 MIDI B */
1026#define EMU_HANA_MIDI_IN_FROM_DOCK 0x01 /* Audio Dock MIDI in to Alice 2 MIDI B */
1027
1028#define EMU_HANA_DOCK_LEDS_1 0x0d /* 000xxxx 4 bit Audio Dock LEDs */
1029#define EMU_HANA_DOCK_LEDS_1_MIDI1 0x01 /* MIDI 1 LED on */
1030#define EMU_HANA_DOCK_LEDS_1_MIDI2 0x02 /* MIDI 2 LED on */
1031#define EMU_HANA_DOCK_LEDS_1_SMPTE_IN 0x04 /* SMPTE IN LED on */
1032#define EMU_HANA_DOCK_LEDS_1_SMPTE_OUT 0x08 /* SMPTE OUT LED on */
1033
1034#define EMU_HANA_DOCK_LEDS_2 0x0e /* 0xxxxxx 6 bit Audio Dock LEDs */
1035#define EMU_HANA_DOCK_LEDS_2_44K 0x01 /* 44.1 kHz LED on */
1036#define EMU_HANA_DOCK_LEDS_2_48K 0x02 /* 48 kHz LED on */
1037#define EMU_HANA_DOCK_LEDS_2_96K 0x04 /* 96 kHz LED on */
1038#define EMU_HANA_DOCK_LEDS_2_192K 0x08 /* 192 kHz LED on */
1039#define EMU_HANA_DOCK_LEDS_2_LOCK 0x10 /* LOCK LED on */
1040#define EMU_HANA_DOCK_LEDS_2_EXT 0x20 /* EXT LED on */
1041
1042#define EMU_HANA_DOCK_LEDS_3 0x0f /* 0xxxxxx 6 bit Audio Dock LEDs */
1043#define EMU_HANA_DOCK_LEDS_3_CLIP_A 0x01 /* Mic A Clip LED on */
1044#define EMU_HANA_DOCK_LEDS_3_CLIP_B 0x02 /* Mic B Clip LED on */
1045#define EMU_HANA_DOCK_LEDS_3_SIGNAL_A 0x04 /* Signal A Clip LED on */
1046#define EMU_HANA_DOCK_LEDS_3_SIGNAL_B 0x08 /* Signal B Clip LED on */
1047#define EMU_HANA_DOCK_LEDS_3_MANUAL_CLIP 0x10 /* Manual Clip detection */
1048#define EMU_HANA_DOCK_LEDS_3_MANUAL_SIGNAL 0x20 /* Manual Signal detection */
1049
1050#define EMU_HANA_ADC_PADS 0x10 /* 0000xxx 3 bit Audio Dock ADC 14dB pads */
1051#define EMU_HANA_DOCK_ADC_PAD1 0x01 /* 14dB Attenuation on Audio Dock ADC 1 */
1052#define EMU_HANA_DOCK_ADC_PAD2 0x02 /* 14dB Attenuation on Audio Dock ADC 2 */
1053#define EMU_HANA_DOCK_ADC_PAD3 0x04 /* 14dB Attenuation on Audio Dock ADC 3 */
1054#define EMU_HANA_0202_ADC_PAD1 0x08 /* 14dB Attenuation on 0202 ADC 1 */
1055
1056#define EMU_HANA_DOCK_MISC 0x11 /* 0xxxxxx 6 bit Audio Dock misc bits */
1057#define EMU_HANA_DOCK_DAC1_MUTE 0x01 /* DAC 1 Mute */
1058#define EMU_HANA_DOCK_DAC2_MUTE 0x02 /* DAC 2 Mute */
1059#define EMU_HANA_DOCK_DAC3_MUTE 0x04 /* DAC 3 Mute */
1060#define EMU_HANA_DOCK_DAC4_MUTE 0x08 /* DAC 4 Mute */
1061#define EMU_HANA_DOCK_PHONES_192_DAC1 0x00 /* DAC 1 Headphones source at 192kHz */
1062#define EMU_HANA_DOCK_PHONES_192_DAC2 0x10 /* DAC 2 Headphones source at 192kHz */
1063#define EMU_HANA_DOCK_PHONES_192_DAC3 0x20 /* DAC 3 Headphones source at 192kHz */
1064#define EMU_HANA_DOCK_PHONES_192_DAC4 0x30 /* DAC 4 Headphones source at 192kHz */
1065
1066#define EMU_HANA_MIDI_OUT 0x12 /* 00xxxxx 5 bit Source for each MIDI out port */
1067#define EMU_HANA_MIDI_OUT_0202 0x01 /* 0202 MIDI from Alice 2. 0 = A, 1 = B */
1068#define EMU_HANA_MIDI_OUT_DOCK1 0x02 /* Audio Dock MIDI1 front, from Alice 2. 0 = A, 1 = B */
1069#define EMU_HANA_MIDI_OUT_DOCK2 0x04 /* Audio Dock MIDI2 rear, from Alice 2. 0 = A, 1 = B */
1070#define EMU_HANA_MIDI_OUT_SYNC2 0x08 /* Sync card. Not the actual MIDI out jack. 0 = A, 1 = B */
1071#define EMU_HANA_MIDI_OUT_LOOP 0x10 /* 0 = bits (3:0) normal. 1 = MIDI loopback enabled. */
1072
1073#define EMU_HANA_DAC_PADS 0x13 /* 00xxxxx 5 bit DAC 14dB attenuation pads */
1074#define EMU_HANA_DOCK_DAC_PAD1 0x01 /* 14dB Attenuation on AudioDock DAC 1. Left and Right */
1075#define EMU_HANA_DOCK_DAC_PAD2 0x02 /* 14dB Attenuation on AudioDock DAC 2. Left and Right */
1076#define EMU_HANA_DOCK_DAC_PAD3 0x04 /* 14dB Attenuation on AudioDock DAC 3. Left and Right */
1077#define EMU_HANA_DOCK_DAC_PAD4 0x08 /* 14dB Attenuation on AudioDock DAC 4. Left and Right */
1078#define EMU_HANA_0202_DAC_PAD1 0x10 /* 14dB Attenuation on 0202 DAC 1. Left and Right */
1079
1080/* 0x14 - 0x1f Unused R/W registers */
1081#define EMU_HANA_IRQ_STATUS 0x20 /* 000xxxx 4 bits IRQ Status */
1082#if 0 /* Already defined for reg 0x09 IRQ_ENABLE */
1083#define EMU_HANA_IRQ_WCLK_CHANGED 0x01
1084#define EMU_HANA_IRQ_ADAT 0x02
1085#define EMU_HANA_IRQ_DOCK 0x04
1086#define EMU_HANA_IRQ_DOCK_LOST 0x08
1087#endif
1088
1089#define EMU_HANA_OPTION_CARDS 0x21 /* 000xxxx 4 bits Presence of option cards */
1090#define EMU_HANA_OPTION_HAMOA 0x01 /* HAMOA card present */
1091#define EMU_HANA_OPTION_SYNC 0x02 /* Sync card present */
1092#define EMU_HANA_OPTION_DOCK_ONLINE 0x04 /* Audio Dock online and FPGA configured */
1093#define EMU_HANA_OPTION_DOCK_OFFLINE 0x08 /* Audio Dock online and FPGA not configured */
1094
1095#define EMU_HANA_ID 0x22 /* 1010101 7 bits ID byte & 0x7f = 0x55 */
1096
1097#define EMU_HANA_MAJOR_REV 0x23 /* 0000xxx 3 bit Hana FPGA Major rev */
1098#define EMU_HANA_MINOR_REV 0x24 /* 0000xxx 3 bit Hana FPGA Minor rev */
1099
1100#define EMU_DOCK_MAJOR_REV 0x25 /* 0000xxx 3 bit Audio Dock FPGA Major rev */
1101#define EMU_DOCK_MINOR_REV 0x26 /* 0000xxx 3 bit Audio Dock FPGA Minor rev */
1102
1103#define EMU_DOCK_BOARD_ID 0x27 /* 00000xx 2 bits Audio Dock ID pins */
1104#define EMU_DOCK_BOARD_ID0 0x00 /* ID bit 0 */
1105#define EMU_DOCK_BOARD_ID1 0x03 /* ID bit 1 */
1106
1107#define EMU_HANA_WC_SPDIF_HI 0x28 /* 0xxxxxx 6 bit SPDIF IN Word clock, upper 6 bits */
1108#define EMU_HANA_WC_SPDIF_LO 0x29 /* 0xxxxxx 6 bit SPDIF IN Word clock, lower 6 bits */
1109
1110#define EMU_HANA_WC_ADAT_HI 0x2a /* 0xxxxxx 6 bit ADAT IN Word clock, upper 6 bits */
1111#define EMU_HANA_WC_ADAT_LO 0x2b /* 0xxxxxx 6 bit ADAT IN Word clock, lower 6 bits */
1112
1113#define EMU_HANA_WC_BNC_LO 0x2c /* 0xxxxxx 6 bit BNC IN Word clock, lower 6 bits */
1114#define EMU_HANA_WC_BNC_HI 0x2d /* 0xxxxxx 6 bit BNC IN Word clock, upper 6 bits */
1115
1116#define EMU_HANA2_WC_SPDIF_HI 0x2e /* 0xxxxxx 6 bit HANA2 SPDIF IN Word clock, upper 6 bits */
1117#define EMU_HANA2_WC_SPDIF_LO 0x2f /* 0xxxxxx 6 bit HANA2 SPDIF IN Word clock, lower 6 bits */
1118/* 0x30 - 0x3f Unused Read only registers */
1119
1120/************************************************************************************************/
1121/* EMU1010m HANA Destinations */
1122/************************************************************************************************/
1123#define EMU_DST_ALICE2_EMU32_0 0x000f /* 16 EMU32 channels to Alice2 +0 to +0xf */
1124#define EMU_DST_ALICE2_EMU32_1 0x0000 /* 16 EMU32 channels to Alice2 +0 to +0xf */
1125#define EMU_DST_ALICE2_EMU32_2 0x0001 /* 16 EMU32 channels to Alice2 +0 to +0xf */
1126#define EMU_DST_ALICE2_EMU32_3 0x0002 /* 16 EMU32 channels to Alice2 +0 to +0xf */
1127#define EMU_DST_ALICE2_EMU32_4 0x0003 /* 16 EMU32 channels to Alice2 +0 to +0xf */
1128#define EMU_DST_ALICE2_EMU32_5 0x0004 /* 16 EMU32 channels to Alice2 +0 to +0xf */
1129#define EMU_DST_ALICE2_EMU32_6 0x0005 /* 16 EMU32 channels to Alice2 +0 to +0xf */
1130#define EMU_DST_ALICE2_EMU32_7 0x0006 /* 16 EMU32 channels to Alice2 +0 to +0xf */
1131#define EMU_DST_ALICE2_EMU32_8 0x0007 /* 16 EMU32 channels to Alice2 +0 to +0xf */
1132#define EMU_DST_ALICE2_EMU32_9 0x0008 /* 16 EMU32 channels to Alice2 +0 to +0xf */
1133#define EMU_DST_ALICE2_EMU32_A 0x0009 /* 16 EMU32 channels to Alice2 +0 to +0xf */
1134#define EMU_DST_ALICE2_EMU32_B 0x000a /* 16 EMU32 channels to Alice2 +0 to +0xf */
1135#define EMU_DST_ALICE2_EMU32_C 0x000b /* 16 EMU32 channels to Alice2 +0 to +0xf */
1136#define EMU_DST_ALICE2_EMU32_D 0x000c /* 16 EMU32 channels to Alice2 +0 to +0xf */
1137#define EMU_DST_ALICE2_EMU32_E 0x000d /* 16 EMU32 channels to Alice2 +0 to +0xf */
1138#define EMU_DST_ALICE2_EMU32_F 0x000e /* 16 EMU32 channels to Alice2 +0 to +0xf */
1139#define EMU_DST_DOCK_DAC1_LEFT1 0x0100 /* Audio Dock DAC1 Left, 1st or 48kHz only */
1140#define EMU_DST_DOCK_DAC1_LEFT2 0x0101 /* Audio Dock DAC1 Left, 2nd or 96kHz */
1141#define EMU_DST_DOCK_DAC1_LEFT3 0x0102 /* Audio Dock DAC1 Left, 3rd or 192kHz */
1142#define EMU_DST_DOCK_DAC1_LEFT4 0x0103 /* Audio Dock DAC1 Left, 4th or 192kHz */
1143#define EMU_DST_DOCK_DAC1_RIGHT1 0x0104 /* Audio Dock DAC1 Right, 1st or 48kHz only */
1144#define EMU_DST_DOCK_DAC1_RIGHT2 0x0105 /* Audio Dock DAC1 Right, 2nd or 96kHz */
1145#define EMU_DST_DOCK_DAC1_RIGHT3 0x0106 /* Audio Dock DAC1 Right, 3rd or 192kHz */
1146#define EMU_DST_DOCK_DAC1_RIGHT4 0x0107 /* Audio Dock DAC1 Right, 4th or 192kHz */
1147#define EMU_DST_DOCK_DAC2_LEFT1 0x0108 /* Audio Dock DAC2 Left, 1st or 48kHz only */
1148#define EMU_DST_DOCK_DAC2_LEFT2 0x0109 /* Audio Dock DAC2 Left, 2nd or 96kHz */
1149#define EMU_DST_DOCK_DAC2_LEFT3 0x010a /* Audio Dock DAC2 Left, 3rd or 192kHz */
1150#define EMU_DST_DOCK_DAC2_LEFT4 0x010b /* Audio Dock DAC2 Left, 4th or 192kHz */
1151#define EMU_DST_DOCK_DAC2_RIGHT1 0x010c /* Audio Dock DAC2 Right, 1st or 48kHz only */
1152#define EMU_DST_DOCK_DAC2_RIGHT2 0x010d /* Audio Dock DAC2 Right, 2nd or 96kHz */
1153#define EMU_DST_DOCK_DAC2_RIGHT3 0x010e /* Audio Dock DAC2 Right, 3rd or 192kHz */
1154#define EMU_DST_DOCK_DAC2_RIGHT4 0x010f /* Audio Dock DAC2 Right, 4th or 192kHz */
1155#define EMU_DST_DOCK_DAC3_LEFT1 0x0110 /* Audio Dock DAC1 Left, 1st or 48kHz only */
1156#define EMU_DST_DOCK_DAC3_LEFT2 0x0111 /* Audio Dock DAC1 Left, 2nd or 96kHz */
1157#define EMU_DST_DOCK_DAC3_LEFT3 0x0112 /* Audio Dock DAC1 Left, 3rd or 192kHz */
1158#define EMU_DST_DOCK_DAC3_LEFT4 0x0113 /* Audio Dock DAC1 Left, 4th or 192kHz */
1159#define EMU_DST_DOCK_PHONES_LEFT1 0x0112 /* Audio Dock PHONES Left, 1st or 48kHz only */
1160#define EMU_DST_DOCK_PHONES_LEFT2 0x0113 /* Audio Dock PHONES Left, 2nd or 96kHz */
1161#define EMU_DST_DOCK_DAC3_RIGHT1 0x0114 /* Audio Dock DAC1 Right, 1st or 48kHz only */
1162#define EMU_DST_DOCK_DAC3_RIGHT2 0x0115 /* Audio Dock DAC1 Right, 2nd or 96kHz */
1163#define EMU_DST_DOCK_DAC3_RIGHT3 0x0116 /* Audio Dock DAC1 Right, 3rd or 192kHz */
1164#define EMU_DST_DOCK_DAC3_RIGHT4 0x0117 /* Audio Dock DAC1 Right, 4th or 192kHz */
1165#define EMU_DST_DOCK_PHONES_RIGHT1 0x0116 /* Audio Dock PHONES Right, 1st or 48kHz only */
1166#define EMU_DST_DOCK_PHONES_RIGHT2 0x0117 /* Audio Dock PHONES Right, 2nd or 96kHz */
1167#define EMU_DST_DOCK_DAC4_LEFT1 0x0118 /* Audio Dock DAC2 Left, 1st or 48kHz only */
1168#define EMU_DST_DOCK_DAC4_LEFT2 0x0119 /* Audio Dock DAC2 Left, 2nd or 96kHz */
1169#define EMU_DST_DOCK_DAC4_LEFT3 0x011a /* Audio Dock DAC2 Left, 3rd or 192kHz */
1170#define EMU_DST_DOCK_DAC4_LEFT4 0x011b /* Audio Dock DAC2 Left, 4th or 192kHz */
1171#define EMU_DST_DOCK_SPDIF_LEFT1 0x011a /* Audio Dock SPDIF Left, 1st or 48kHz only */
1172#define EMU_DST_DOCK_SPDIF_LEFT2 0x011b /* Audio Dock SPDIF Left, 2nd or 96kHz */
1173#define EMU_DST_DOCK_DAC4_RIGHT1 0x011c /* Audio Dock DAC2 Right, 1st or 48kHz only */
1174#define EMU_DST_DOCK_DAC4_RIGHT2 0x011d /* Audio Dock DAC2 Right, 2nd or 96kHz */
1175#define EMU_DST_DOCK_DAC4_RIGHT3 0x011e /* Audio Dock DAC2 Right, 3rd or 192kHz */
1176#define EMU_DST_DOCK_DAC4_RIGHT4 0x011f /* Audio Dock DAC2 Right, 4th or 192kHz */
1177#define EMU_DST_DOCK_SPDIF_RIGHT1 0x011e /* Audio Dock SPDIF Right, 1st or 48kHz only */
1178#define EMU_DST_DOCK_SPDIF_RIGHT2 0x011f /* Audio Dock SPDIF Right, 2nd or 96kHz */
1179#define EMU_DST_HANA_SPDIF_LEFT1 0x0200 /* Hana SPDIF Left, 1st or 48kHz only */
1180#define EMU_DST_HANA_SPDIF_LEFT2 0x0202 /* Hana SPDIF Left, 2nd or 96kHz */
1181#define EMU_DST_HANA_SPDIF_RIGHT1 0x0201 /* Hana SPDIF Right, 1st or 48kHz only */
1182#define EMU_DST_HANA_SPDIF_RIGHT2 0x0203 /* Hana SPDIF Right, 2nd or 96kHz */
1183#define EMU_DST_HAMOA_DAC_LEFT1 0x0300 /* Hamoa DAC Left, 1st or 48kHz only */
1184#define EMU_DST_HAMOA_DAC_LEFT2 0x0302 /* Hamoa DAC Left, 2nd or 96kHz */
1185#define EMU_DST_HAMOA_DAC_LEFT3 0x0304 /* Hamoa DAC Left, 3rd or 192kHz */
1186#define EMU_DST_HAMOA_DAC_LEFT4 0x0306 /* Hamoa DAC Left, 4th or 192kHz */
1187#define EMU_DST_HAMOA_DAC_RIGHT1 0x0301 /* Hamoa DAC Right, 1st or 48kHz only */
1188#define EMU_DST_HAMOA_DAC_RIGHT2 0x0303 /* Hamoa DAC Right, 2nd or 96kHz */
1189#define EMU_DST_HAMOA_DAC_RIGHT3 0x0305 /* Hamoa DAC Right, 3rd or 192kHz */
1190#define EMU_DST_HAMOA_DAC_RIGHT4 0x0307 /* Hamoa DAC Right, 4th or 192kHz */
1191#define EMU_DST_HANA_ADAT 0x0400 /* Hana ADAT 8 channel out +0 to +7 */
1192#define EMU_DST_ALICE_I2S0_LEFT 0x0500 /* Alice2 I2S0 Left */
1193#define EMU_DST_ALICE_I2S0_RIGHT 0x0501 /* Alice2 I2S0 Right */
1194#define EMU_DST_ALICE_I2S1_LEFT 0x0600 /* Alice2 I2S1 Left */
1195#define EMU_DST_ALICE_I2S1_RIGHT 0x0601 /* Alice2 I2S1 Right */
1196#define EMU_DST_ALICE_I2S2_LEFT 0x0700 /* Alice2 I2S2 Left */
1197#define EMU_DST_ALICE_I2S2_RIGHT 0x0701 /* Alice2 I2S2 Right */
1198
1199/************************************************************************************************/
1200/* EMU1010m HANA Sources */
1201/************************************************************************************************/
1202#define EMU_SRC_SILENCE 0x0000 /* Silence */
1203#define EMU_SRC_DOCK_MIC_A1 0x0100 /* Audio Dock Mic A, 1st or 48kHz only */
1204#define EMU_SRC_DOCK_MIC_A2 0x0101 /* Audio Dock Mic A, 2nd or 96kHz */
1205#define EMU_SRC_DOCK_MIC_A3 0x0102 /* Audio Dock Mic A, 3rd or 192kHz */
1206#define EMU_SRC_DOCK_MIC_A4 0x0103 /* Audio Dock Mic A, 4th or 192kHz */
1207#define EMU_SRC_DOCK_MIC_B1 0x0104 /* Audio Dock Mic B, 1st or 48kHz only */
1208#define EMU_SRC_DOCK_MIC_B2 0x0105 /* Audio Dock Mic B, 2nd or 96kHz */
1209#define EMU_SRC_DOCK_MIC_B3 0x0106 /* Audio Dock Mic B, 3rd or 192kHz */
1210#define EMU_SRC_DOCK_MIC_B4 0x0107 /* Audio Dock Mic B, 4th or 192kHz */
1211#define EMU_SRC_DOCK_ADC1_LEFT1 0x0108 /* Audio Dock ADC1 Left, 1st or 48kHz only */
1212#define EMU_SRC_DOCK_ADC1_LEFT2 0x0109 /* Audio Dock ADC1 Left, 2nd or 96kHz */
1213#define EMU_SRC_DOCK_ADC1_LEFT3 0x010a /* Audio Dock ADC1 Left, 3rd or 192kHz */
1214#define EMU_SRC_DOCK_ADC1_LEFT4 0x010b /* Audio Dock ADC1 Left, 4th or 192kHz */
1215#define EMU_SRC_DOCK_ADC1_RIGHT1 0x010c /* Audio Dock ADC1 Right, 1st or 48kHz only */
1216#define EMU_SRC_DOCK_ADC1_RIGHT2 0x010d /* Audio Dock ADC1 Right, 2nd or 96kHz */
1217#define EMU_SRC_DOCK_ADC1_RIGHT3 0x010e /* Audio Dock ADC1 Right, 3rd or 192kHz */
1218#define EMU_SRC_DOCK_ADC1_RIGHT4 0x010f /* Audio Dock ADC1 Right, 4th or 192kHz */
1219#define EMU_SRC_DOCK_ADC2_LEFT1 0x0110 /* Audio Dock ADC2 Left, 1st or 48kHz only */
1220#define EMU_SRC_DOCK_ADC2_LEFT2 0x0111 /* Audio Dock ADC2 Left, 2nd or 96kHz */
1221#define EMU_SRC_DOCK_ADC2_LEFT3 0x0112 /* Audio Dock ADC2 Left, 3rd or 192kHz */
1222#define EMU_SRC_DOCK_ADC2_LEFT4 0x0113 /* Audio Dock ADC2 Left, 4th or 192kHz */
1223#define EMU_SRC_DOCK_ADC2_RIGHT1 0x0114 /* Audio Dock ADC2 Right, 1st or 48kHz only */
1224#define EMU_SRC_DOCK_ADC2_RIGHT2 0x0115 /* Audio Dock ADC2 Right, 2nd or 96kHz */
1225#define EMU_SRC_DOCK_ADC2_RIGHT3 0x0116 /* Audio Dock ADC2 Right, 3rd or 192kHz */
1226#define EMU_SRC_DOCK_ADC2_RIGHT4 0x0117 /* Audio Dock ADC2 Right, 4th or 192kHz */
1227#define EMU_SRC_DOCK_ADC3_LEFT1 0x0118 /* Audio Dock ADC3 Left, 1st or 48kHz only */
1228#define EMU_SRC_DOCK_ADC3_LEFT2 0x0119 /* Audio Dock ADC3 Left, 2nd or 96kHz */
1229#define EMU_SRC_DOCK_ADC3_LEFT3 0x011a /* Audio Dock ADC3 Left, 3rd or 192kHz */
1230#define EMU_SRC_DOCK_ADC3_LEFT4 0x011b /* Audio Dock ADC3 Left, 4th or 192kHz */
1231#define EMU_SRC_DOCK_ADC3_RIGHT1 0x011c /* Audio Dock ADC3 Right, 1st or 48kHz only */
1232#define EMU_SRC_DOCK_ADC3_RIGHT2 0x011d /* Audio Dock ADC3 Right, 2nd or 96kHz */
1233#define EMU_SRC_DOCK_ADC3_RIGHT3 0x011e /* Audio Dock ADC3 Right, 3rd or 192kHz */
1234#define EMU_SRC_DOCK_ADC3_RIGHT4 0x011f /* Audio Dock ADC3 Right, 4th or 192kHz */
1235#define EMU_SRC_HAMOA_ADC_LEFT1 0x0200 /* Hamoa ADC Left, 1st or 48kHz only */
1236#define EMU_SRC_HAMOA_ADC_LEFT2 0x0202 /* Hamoa ADC Left, 2nd or 96kHz */
1237#define EMU_SRC_HAMOA_ADC_LEFT3 0x0204 /* Hamoa ADC Left, 3rd or 192kHz */
1238#define EMU_SRC_HAMOA_ADC_LEFT4 0x0206 /* Hamoa ADC Left, 4th or 192kHz */
1239#define EMU_SRC_HAMOA_ADC_RIGHT1 0x0201 /* Hamoa ADC Right, 1st or 48kHz only */
1240#define EMU_SRC_HAMOA_ADC_RIGHT2 0x0203 /* Hamoa ADC Right, 2nd or 96kHz */
1241#define EMU_SRC_HAMOA_ADC_RIGHT3 0x0205 /* Hamoa ADC Right, 3rd or 192kHz */
1242#define EMU_SRC_HAMOA_ADC_RIGHT4 0x0207 /* Hamoa ADC Right, 4th or 192kHz */
1243#define EMU_SRC_ALICE_EMU32A 0x0300 /* Alice2 EMU32a 16 outputs. +0 to +0xf */
1244#define EMU_SRC_ALICE_EMU32B 0x0310 /* Alice2 EMU32b 16 outputs. +0 to +0xf */
1245#define EMU_SRC_HANA_ADAT 0x0400 /* Hana ADAT 8 channel in +0 to +7 */
1246#define EMU_SRC_HANA_SPDIF_LEFT1 0x0500 /* Hana SPDIF Left, 1st or 48kHz only */
1247#define EMU_SRC_HANA_SPDIF_LEFT2 0x0502 /* Hana SPDIF Left, 2nd or 96kHz */
1248#define EMU_SRC_HANA_SPDIF_RIGHT1 0x0501 /* Hana SPDIF Right, 1st or 48kHz only */
1249#define EMU_SRC_HANA_SPDIF_RIGHT2 0x0503 /* Hana SPDIF Right, 2nd or 96kHz */
1250/* 0x600 and 0x700 no used */
889 1251
890/* ------------------- STRUCTURES -------------------- */ 1252/* ------------------- STRUCTURES -------------------- */
891 1253
@@ -1063,7 +1425,7 @@ struct snd_emu_chip_details {
1063 unsigned char spdif_bug; /* Has Spdif phasing bug */ 1425 unsigned char spdif_bug; /* Has Spdif phasing bug */
1064 unsigned char ac97_chip; /* Has an AC97 chip: 1 = mandatory, 2 = optional */ 1426 unsigned char ac97_chip; /* Has an AC97 chip: 1 = mandatory, 2 = optional */
1065 unsigned char ecard; /* APS EEPROM */ 1427 unsigned char ecard; /* APS EEPROM */
1066 unsigned char emu1212m; /* EMU 1212m card */ 1428 unsigned char emu1010; /* EMU 1010m card */
1067 unsigned char spi_dac; /* SPI interface for DAC */ 1429 unsigned char spi_dac; /* SPI interface for DAC */
1068 unsigned char i2c_adc; /* I2C interface for ADC */ 1430 unsigned char i2c_adc; /* I2C interface for ADC */
1069 unsigned char adc_1361t; /* Use Philips 1361T ADC */ 1431 unsigned char adc_1361t; /* Use Philips 1361T ADC */
@@ -1072,6 +1434,14 @@ struct snd_emu_chip_details {
1072 const char *id; /* for backward compatibility - can be NULL if not needed */ 1434 const char *id; /* for backward compatibility - can be NULL if not needed */
1073}; 1435};
1074 1436
1437struct snd_emu1010 {
1438 unsigned int output_source[64];
1439 unsigned int input_source[64];
1440 unsigned int adc_pads; /* bit mask */
1441 unsigned int dac_pads; /* bit mask */
1442 unsigned int internal_clock; /* 44100 or 48000 */
1443};
1444
1075struct snd_emu10k1 { 1445struct snd_emu10k1 {
1076 int irq; 1446 int irq;
1077 1447
@@ -1079,6 +1449,7 @@ struct snd_emu10k1 {
1079 unsigned int tos_link: 1, /* tos link detected */ 1449 unsigned int tos_link: 1, /* tos link detected */
1080 rear_ac97: 1, /* rear channels are on AC'97 */ 1450 rear_ac97: 1, /* rear channels are on AC'97 */
1081 enable_ir: 1; 1451 enable_ir: 1;
1452 unsigned int support_tlv :1;
1082 /* Contains profile of card capabilities */ 1453 /* Contains profile of card capabilities */
1083 const struct snd_emu_chip_details *card_capabilities; 1454 const struct snd_emu_chip_details *card_capabilities;
1084 unsigned int audigy; /* is Audigy? */ 1455 unsigned int audigy; /* is Audigy? */
@@ -1104,6 +1475,8 @@ struct snd_emu10k1 {
1104 spinlock_t memblk_lock; 1475 spinlock_t memblk_lock;
1105 1476
1106 unsigned int spdif_bits[3]; /* s/pdif out setup */ 1477 unsigned int spdif_bits[3]; /* s/pdif out setup */
1478 unsigned int i2c_capture_source;
1479 u8 i2c_capture_volume[4][2];
1107 1480
1108 struct snd_emu10k1_fx8010 fx8010; /* FX8010 info */ 1481 struct snd_emu10k1_fx8010 fx8010; /* FX8010 info */
1109 int gpr_base; 1482 int gpr_base;
@@ -1132,6 +1505,7 @@ struct snd_emu10k1 {
1132 int p16v_device_offset; 1505 int p16v_device_offset;
1133 u32 p16v_capture_source; 1506 u32 p16v_capture_source;
1134 u32 p16v_capture_channel; 1507 u32 p16v_capture_channel;
1508 struct snd_emu1010 emu1010;
1135 struct snd_emu10k1_pcm_mixer pcm_mixer[32]; 1509 struct snd_emu10k1_pcm_mixer pcm_mixer[32];
1136 struct snd_emu10k1_pcm_mixer efx_pcm_mixer[NUM_EFX_PLAYBACK]; 1510 struct snd_emu10k1_pcm_mixer efx_pcm_mixer[NUM_EFX_PLAYBACK];
1137 struct snd_kcontrol *ctl_send_routing; 1511 struct snd_kcontrol *ctl_send_routing;
@@ -1208,6 +1582,10 @@ void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned i
1208unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn); 1582unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn);
1209void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data); 1583void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data);
1210int snd_emu10k1_spi_write(struct snd_emu10k1 * emu, unsigned int data); 1584int snd_emu10k1_spi_write(struct snd_emu10k1 * emu, unsigned int data);
1585int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu, u32 reg, u32 value);
1586int snd_emu1010_fpga_write(struct snd_emu10k1 * emu, int reg, int value);
1587int snd_emu1010_fpga_read(struct snd_emu10k1 * emu, int reg, int *value);
1588int snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 * emu, int dst, int src);
1211unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc); 1589unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc);
1212void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb); 1590void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb);
1213void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb); 1591void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb);
@@ -1524,11 +1902,20 @@ struct snd_emu10k1_fx8010_control_gpr {
1524 unsigned int value[32]; /* initial values */ 1902 unsigned int value[32]; /* initial values */
1525 unsigned int min; /* minimum range */ 1903 unsigned int min; /* minimum range */
1526 unsigned int max; /* maximum range */ 1904 unsigned int max; /* maximum range */
1527 union {
1528 snd_kcontrol_tlv_rw_t *c;
1529 unsigned int *p;
1530 } tlv;
1531 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ 1905 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
1906 const unsigned int *tlv;
1907};
1908
1909/* old ABI without TLV support */
1910struct snd_emu10k1_fx8010_control_old_gpr {
1911 struct snd_ctl_elem_id id;
1912 unsigned int vcount;
1913 unsigned int count;
1914 unsigned short gpr[32];
1915 unsigned int value[32];
1916 unsigned int min;
1917 unsigned int max;
1918 unsigned int translation;
1532}; 1919};
1533 1920
1534struct snd_emu10k1_fx8010_code { 1921struct snd_emu10k1_fx8010_code {
@@ -1579,6 +1966,8 @@ struct snd_emu10k1_fx8010_pcm_rec {
1579 unsigned int res2; /* reserved */ 1966 unsigned int res2; /* reserved */
1580}; 1967};
1581 1968
1969#define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
1970
1582#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info) 1971#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
1583#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code) 1972#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
1584#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code) 1973#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
@@ -1587,6 +1976,7 @@ struct snd_emu10k1_fx8010_pcm_rec {
1587#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram) 1976#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
1588#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec) 1977#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
1589#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec) 1978#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
1979#define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int)
1590#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80) 1980#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80)
1591#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81) 1981#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81)
1592#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82) 1982#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 2f645dfd7f70..deff5a92efa6 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -56,6 +56,8 @@ struct snd_pcm_hardware {
56 size_t fifo_size; /* fifo size in bytes */ 56 size_t fifo_size; /* fifo size in bytes */
57}; 57};
58 58
59struct snd_pcm_substream;
60
59struct snd_pcm_ops { 61struct snd_pcm_ops {
60 int (*open)(struct snd_pcm_substream *substream); 62 int (*open)(struct snd_pcm_substream *substream);
61 int (*close)(struct snd_pcm_substream *substream); 63 int (*close)(struct snd_pcm_substream *substream);
@@ -384,6 +386,7 @@ struct snd_pcm_substream {
384 struct snd_info_entry *proc_sw_params_entry; 386 struct snd_info_entry *proc_sw_params_entry;
385 struct snd_info_entry *proc_status_entry; 387 struct snd_info_entry *proc_status_entry;
386 struct snd_info_entry *proc_prealloc_entry; 388 struct snd_info_entry *proc_prealloc_entry;
389 struct snd_info_entry *proc_prealloc_max_entry;
387#endif 390#endif
388 /* misc flags */ 391 /* misc flags */
389 unsigned int hw_opened: 1; 392 unsigned int hw_opened: 1;
@@ -427,6 +430,7 @@ struct snd_pcm {
427 wait_queue_head_t open_wait; 430 wait_queue_head_t open_wait;
428 void *private_data; 431 void *private_data;
429 void (*private_free) (struct snd_pcm *pcm); 432 void (*private_free) (struct snd_pcm *pcm);
433 struct device *dev; /* actual hw device this belongs to */
430#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 434#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
431 struct snd_pcm_oss oss; 435 struct snd_pcm_oss oss;
432#endif 436#endif
@@ -443,7 +447,7 @@ struct snd_pcm_notify {
443 * Registering 447 * Registering
444 */ 448 */
445 449
446extern struct file_operations snd_pcm_f_ops[2]; 450extern const struct file_operations snd_pcm_f_ops[2];
447 451
448int snd_pcm_new(struct snd_card *card, char *id, int device, 452int snd_pcm_new(struct snd_card *card, char *id, int device,
449 int playback_count, int capture_count, 453 int playback_count, int capture_count,
diff --git a/include/sound/pt2258.h b/include/sound/pt2258.h
new file mode 100644
index 000000000000..160f812faa42
--- /dev/null
+++ b/include/sound/pt2258.h
@@ -0,0 +1,37 @@
1/*
2 * ALSA Driver for the PT2258 volume controller.
3 *
4 * Copyright (c) 2006 Jochen Voss <voss@seehuhn.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22#ifndef __SOUND_PT2258_H
23#define __SOUND_PT2258_H
24
25struct snd_pt2258 {
26 struct snd_card *card;
27 struct snd_i2c_bus *i2c_bus;
28 struct snd_i2c_device *i2c_dev;
29
30 unsigned char volume[6];
31 int mute;
32};
33
34extern int snd_pt2258_reset(struct snd_pt2258 *pt);
35extern int snd_pt2258_build_controls(struct snd_pt2258 *pt);
36
37#endif /* __SOUND_PT2258_H */
diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h
index caf6fe21514d..736eac71d053 100644
--- a/include/sound/sb16_csp.h
+++ b/include/sound/sb16_csp.h
@@ -114,9 +114,21 @@ struct snd_sb_csp_info {
114#ifdef __KERNEL__ 114#ifdef __KERNEL__
115#include "sb.h" 115#include "sb.h"
116#include "hwdep.h" 116#include "hwdep.h"
117#include <linux/firmware.h>
117 118
118struct snd_sb_csp; 119struct snd_sb_csp;
119 120
121/* indices for the known CSP programs */
122enum {
123 CSP_PROGRAM_MULAW,
124 CSP_PROGRAM_ALAW,
125 CSP_PROGRAM_ADPCM_INIT,
126 CSP_PROGRAM_ADPCM_PLAYBACK,
127 CSP_PROGRAM_ADPCM_CAPTURE,
128
129 CSP_PROGRAM_COUNT
130};
131
120/* 132/*
121 * CSP operators 133 * CSP operators
122 */ 134 */
@@ -159,6 +171,8 @@ struct snd_sb_csp {
159 struct snd_kcontrol *qsound_space; 171 struct snd_kcontrol *qsound_space;
160 172
161 struct mutex access_mutex; /* locking */ 173 struct mutex access_mutex; /* locking */
174
175 const struct firmware *csp_programs[CSP_PROGRAM_COUNT];
162}; 176};
163 177
164int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep); 178int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep);
diff --git a/include/sound/snd_wavefront.h b/include/sound/snd_wavefront.h
index 0b9e5de94ff1..9688d4be918e 100644
--- a/include/sound/snd_wavefront.h
+++ b/include/sound/snd_wavefront.h
@@ -85,6 +85,7 @@ struct _snd_wavefront {
85 char hw_version[2]; /* major = [0], minor = [1] */ 85 char hw_version[2]; /* major = [0], minor = [1] */
86 char israw; /* needs Motorola microcode */ 86 char israw; /* needs Motorola microcode */
87 char has_fx; /* has FX processor (Tropez+) */ 87 char has_fx; /* has FX processor (Tropez+) */
88 char fx_initialized; /* FX's register pages initialized */
88 char prog_status[WF_MAX_PROGRAM]; /* WF_SLOT_* */ 89 char prog_status[WF_MAX_PROGRAM]; /* WF_SLOT_* */
89 char patch_status[WF_MAX_PATCH]; /* WF_SLOT_* */ 90 char patch_status[WF_MAX_PATCH]; /* WF_SLOT_* */
90 char sample_status[WF_MAX_SAMPLE]; /* WF_ST_* | WF_SLOT_* */ 91 char sample_status[WF_MAX_SAMPLE]; /* WF_ST_* | WF_SLOT_* */
@@ -94,6 +95,7 @@ struct _snd_wavefront {
94 spinlock_t irq_lock; 95 spinlock_t irq_lock;
95 wait_queue_head_t interrupt_sleeper; 96 wait_queue_head_t interrupt_sleeper;
96 snd_wavefront_midi_t midi; /* ICS2115 MIDI interface */ 97 snd_wavefront_midi_t midi; /* ICS2115 MIDI interface */
98 struct snd_card *card;
97}; 99};
98 100
99struct _snd_wavefront_card { 101struct _snd_wavefront_card {
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
new file mode 100644
index 000000000000..2b1ae8edc43c
--- /dev/null
+++ b/include/sound/soc-dapm.h
@@ -0,0 +1,286 @@
1/*
2 * linux/sound/soc-dapm.h -- ALSA SoC Dynamic Audio Power Management
3 *
4 * Author: Liam Girdwood
5 * Created: Aug 11th 2005
6 * Copyright: Wolfson Microelectronics. PLC.
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 __LINUX_SND_SOC_DAPM_H
14#define __LINUX_SND_SOC_DAPM_H
15
16#include <linux/device.h>
17#include <linux/types.h>
18#include <sound/control.h>
19#include <sound/soc.h>
20
21/* widget has no PM register bit */
22#define SND_SOC_NOPM -1
23
24/*
25 * SoC dynamic audio power managment
26 *
27 * We can have upto 4 power domains
28 * 1. Codec domain - VREF, VMID
29 * Usually controlled at codec probe/remove, although can be set
30 * at stream time if power is not needed for sidetone, etc.
31 * 2. Platform/Machine domain - physically connected inputs and outputs
32 * Is platform/machine and user action specific, is set in the machine
33 * driver and by userspace e.g when HP are inserted
34 * 3. Path domain - Internal codec path mixers
35 * Are automatically set when mixer and mux settings are
36 * changed by the user.
37 * 4. Stream domain - DAC's and ADC's.
38 * Enabled when stream playback/capture is started.
39 */
40
41/* codec domain */
42#define SND_SOC_DAPM_VMID(wname) \
43{ .id = snd_soc_dapm_vmid, .name = wname, .kcontrols = NULL, \
44 .num_kcontrols = 0}
45
46/* platform domain */
47#define SND_SOC_DAPM_INPUT(wname) \
48{ .id = snd_soc_dapm_input, .name = wname, .kcontrols = NULL, \
49 .num_kcontrols = 0}
50#define SND_SOC_DAPM_OUTPUT(wname) \
51{ .id = snd_soc_dapm_output, .name = wname, .kcontrols = NULL, \
52 .num_kcontrols = 0}
53#define SND_SOC_DAPM_MIC(wname, wevent) \
54{ .id = snd_soc_dapm_mic, .name = wname, .kcontrols = NULL, \
55 .num_kcontrols = 0, .event = wevent, \
56 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
57#define SND_SOC_DAPM_HP(wname, wevent) \
58{ .id = snd_soc_dapm_hp, .name = wname, .kcontrols = NULL, \
59 .num_kcontrols = 0, .event = wevent, \
60 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
61#define SND_SOC_DAPM_SPK(wname, wevent) \
62{ .id = snd_soc_dapm_spk, .name = wname, .kcontrols = NULL, \
63 .num_kcontrols = 0, .event = wevent, \
64 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
65#define SND_SOC_DAPM_LINE(wname, wevent) \
66{ .id = snd_soc_dapm_line, .name = wname, .kcontrols = NULL, \
67 .num_kcontrols = 0, .event = wevent, \
68 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
69
70/* path domain */
71#define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\
72 wcontrols, wncontrols) \
73{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
74 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols}
75#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \
76 wcontrols, wncontrols)\
77{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
78 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols}
79#define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \
80{ .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \
81 .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0}
82#define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \
83{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \
84 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1}
85#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \
86{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \
87 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1}
88
89/* path domain with event - event handler must return 0 for success */
90#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \
91 wncontrols, wevent, wflags) \
92{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
93 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \
94 .event = wevent, .event_flags = wflags}
95#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \
96 wncontrols, wevent, wflags) \
97{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
98 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \
99 .event = wevent, .event_flags = wflags}
100#define SND_SOC_DAPM_MICBIAS_E(wname, wreg, wshift, winvert, wevent, wflags) \
101{ .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \
102 .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0, \
103 .event = wevent, .event_flags = wflags}
104#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \
105 wevent, wflags) \
106{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \
107 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1 \
108 .event = wevent, .event_flags = wflags}
109#define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
110 wevent, wflags) \
111{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \
112 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \
113 .event = wevent, .event_flags = wflags}
114
115/* events that are pre and post DAPM */
116#define SND_SOC_DAPM_PRE(wname, wevent) \
117{ .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \
118 .num_kcontrols = 0, .event = wevent, \
119 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD}
120#define SND_SOC_DAPM_POST(wname, wevent) \
121{ .id = snd_soc_dapm_post, .name = wname, .kcontrols = NULL, \
122 .num_kcontrols = 0, .event = wevent, \
123 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD}
124
125/* stream domain */
126#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \
127{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \
128 .shift = wshift, .invert = winvert}
129#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \
130{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \
131 .shift = wshift, .invert = winvert}
132
133/* dapm kcontrol types */
134#define SOC_DAPM_SINGLE(xname, reg, shift, mask, invert) \
135{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
136 .info = snd_soc_info_volsw, \
137 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
138 .private_value = SOC_SINGLE_VALUE(reg, shift, mask, invert) }
139#define SOC_DAPM_DOUBLE(xname, reg, shift_left, shift_right, mask, invert, \
140 power) \
141{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
142 .info = snd_soc_info_volsw, \
143 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
144 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) |\
145 ((mask) << 16) | ((invert) << 24) }
146#define SOC_DAPM_ENUM(xname, xenum) \
147{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
148 .info = snd_soc_info_enum_double, \
149 .get = snd_soc_dapm_get_enum_double, \
150 .put = snd_soc_dapm_put_enum_double, \
151 .private_value = (unsigned long)&xenum }
152
153/* dapm stream operations */
154#define SND_SOC_DAPM_STREAM_NOP 0x0
155#define SND_SOC_DAPM_STREAM_START 0x1
156#define SND_SOC_DAPM_STREAM_STOP 0x2
157#define SND_SOC_DAPM_STREAM_SUSPEND 0x4
158#define SND_SOC_DAPM_STREAM_RESUME 0x8
159#define SND_SOC_DAPM_STREAM_PAUSE_PUSH 0x10
160#define SND_SOC_DAPM_STREAM_PAUSE_RELEASE 0x20
161
162/* dapm event types */
163#define SND_SOC_DAPM_PRE_PMU 0x1 /* before widget power up */
164#define SND_SOC_DAPM_POST_PMU 0x2 /* after widget power up */
165#define SND_SOC_DAPM_PRE_PMD 0x4 /* before widget power down */
166#define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */
167#define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */
168#define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */
169
170/* convenience event type detection */
171#define SND_SOC_DAPM_EVENT_ON(e) \
172 (e & (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU))
173#define SND_SOC_DAPM_EVENT_OFF(e) \
174 (e & (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD))
175
176struct snd_soc_dapm_widget;
177enum snd_soc_dapm_type;
178struct snd_soc_dapm_path;
179struct snd_soc_dapm_pin;
180
181/* dapm controls */
182int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
183 struct snd_ctl_elem_value *ucontrol);
184int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol,
185 struct snd_ctl_elem_value *ucontrol);
186int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
187 struct snd_ctl_elem_value *ucontrol);
188int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
189 struct snd_ctl_elem_value *ucontrol);
190int snd_soc_dapm_new_control(struct snd_soc_codec *codec,
191 const struct snd_soc_dapm_widget *widget);
192
193/* dapm path setup */
194int snd_soc_dapm_connect_input(struct snd_soc_codec *codec,
195 const char *sink_name, const char *control_name, const char *src_name);
196int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec);
197void snd_soc_dapm_free(struct snd_soc_device *socdev);
198
199/* dapm events */
200int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream,
201 int event);
202
203/* dapm sys fs - used by the core */
204int snd_soc_dapm_sys_add(struct device *dev);
205
206/* dapm audio endpoint control */
207int snd_soc_dapm_set_endpoint(struct snd_soc_codec *codec,
208 char *pin, int status);
209int snd_soc_dapm_sync_endpoints(struct snd_soc_codec *codec);
210
211/* dapm widget types */
212enum snd_soc_dapm_type {
213 snd_soc_dapm_input = 0, /* input pin */
214 snd_soc_dapm_output, /* output pin */
215 snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */
216 snd_soc_dapm_mixer, /* mixes several analog signals together */
217 snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */
218 snd_soc_dapm_adc, /* analog to digital converter */
219 snd_soc_dapm_dac, /* digital to analog converter */
220 snd_soc_dapm_micbias, /* microphone bias (power) */
221 snd_soc_dapm_mic, /* microphone */
222 snd_soc_dapm_hp, /* headphones */
223 snd_soc_dapm_spk, /* speaker */
224 snd_soc_dapm_line, /* line input/output */
225 snd_soc_dapm_switch, /* analog switch */
226 snd_soc_dapm_vmid, /* codec bias/vmid - to minimise pops */
227 snd_soc_dapm_pre, /* machine specific pre widget - exec first */
228 snd_soc_dapm_post, /* machine specific post widget - exec last */
229};
230
231/* dapm audio path between two widgets */
232struct snd_soc_dapm_path {
233 char *name;
234 char *long_name;
235
236 /* source (input) and sink (output) widgets */
237 struct snd_soc_dapm_widget *source;
238 struct snd_soc_dapm_widget *sink;
239 struct snd_kcontrol *kcontrol;
240
241 /* status */
242 u32 connect:1; /* source and sink widgets are connected */
243 u32 walked:1; /* path has been walked */
244
245 struct list_head list_source;
246 struct list_head list_sink;
247 struct list_head list;
248};
249
250/* dapm widget */
251struct snd_soc_dapm_widget {
252 enum snd_soc_dapm_type id;
253 char *name; /* widget name */
254 char *sname; /* stream name */
255 struct snd_soc_codec *codec;
256 struct list_head list;
257
258 /* dapm control */
259 short reg; /* negative reg = no direct dapm */
260 unsigned char shift; /* bits to shift */
261 unsigned int saved_value; /* widget saved value */
262 unsigned int value; /* widget current value */
263 unsigned char power:1; /* block power status */
264 unsigned char invert:1; /* invert the power bit */
265 unsigned char active:1; /* active stream on DAC, ADC's */
266 unsigned char connected:1; /* connected codec pin */
267 unsigned char new:1; /* cnew complete */
268 unsigned char ext:1; /* has external widgets */
269 unsigned char muted:1; /* muted for pop reduction */
270 unsigned char suspend:1; /* was active before suspend */
271 unsigned char pmdown:1; /* waiting for timeout */
272
273 /* external events */
274 unsigned short event_flags; /* flags to specify event types */
275 int (*event)(struct snd_soc_dapm_widget*, int);
276
277 /* kcontrols that relate to this widget */
278 int num_kcontrols;
279 const struct snd_kcontrol_new *kcontrols;
280
281 /* widget input and outputs */
282 struct list_head sources;
283 struct list_head sinks;
284};
285
286#endif
diff --git a/include/sound/soc.h b/include/sound/soc.h
new file mode 100644
index 000000000000..b1dc364b8f74
--- /dev/null
+++ b/include/sound/soc.h
@@ -0,0 +1,461 @@
1/*
2 * linux/sound/soc.h -- ALSA SoC Layer
3 *
4 * Author: Liam Girdwood
5 * Created: Aug 11th 2005
6 * Copyright: Wolfson Microelectronics. PLC.
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 __LINUX_SND_SOC_H
14#define __LINUX_SND_SOC_H
15
16#include <linux/platform_device.h>
17#include <linux/types.h>
18#include <linux/workqueue.h>
19#include <sound/driver.h>
20#include <sound/core.h>
21#include <sound/pcm.h>
22#include <sound/control.h>
23#include <sound/ac97_codec.h>
24
25#define SND_SOC_VERSION "0.13.0"
26
27/*
28 * Convenience kcontrol builders
29 */
30#define SOC_SINGLE_VALUE(reg,shift,mask,invert) ((reg) | ((shift) << 8) |\
31 ((shift) << 12) | ((mask) << 16) | ((invert) << 24))
32#define SOC_SINGLE_VALUE_EXT(reg,mask,invert) ((reg) | ((mask) << 16) |\
33 ((invert) << 31))
34#define SOC_SINGLE(xname, reg, shift, mask, invert) \
35{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
36 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
37 .put = snd_soc_put_volsw, \
38 .private_value = SOC_SINGLE_VALUE(reg, shift, mask, invert) }
39#define SOC_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) \
40{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
41 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
42 .put = snd_soc_put_volsw, \
43 .private_value = (reg) | ((shift_left) << 8) | \
44 ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) }
45#define SOC_DOUBLE_R(xname, reg_left, reg_right, shift, mask, invert) \
46{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
47 .info = snd_soc_info_volsw_2r, \
48 .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \
49 .private_value = (reg_left) | ((shift) << 8) | \
50 ((mask) << 12) | ((invert) << 20) | ((reg_right) << 24) }
51#define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \
52{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
53 .mask = xmask, .texts = xtexts }
54#define SOC_ENUM_SINGLE(xreg, xshift, xmask, xtexts) \
55 SOC_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xtexts)
56#define SOC_ENUM_SINGLE_EXT(xmask, xtexts) \
57{ .mask = xmask, .texts = xtexts }
58#define SOC_ENUM(xname, xenum) \
59{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\
60 .info = snd_soc_info_enum_double, \
61 .get = snd_soc_get_enum_double, .put = snd_soc_put_enum_double, \
62 .private_value = (unsigned long)&xenum }
63#define SOC_SINGLE_EXT(xname, xreg, xshift, xmask, xinvert,\
64 xhandler_get, xhandler_put) \
65{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
66 .info = snd_soc_info_volsw, \
67 .get = xhandler_get, .put = xhandler_put, \
68 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmask, xinvert) }
69#define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
70{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
71 .info = snd_soc_info_bool_ext, \
72 .get = xhandler_get, .put = xhandler_put, \
73 .private_value = xdata }
74#define SOC_ENUM_EXT(xname, xenum, xhandler_get, xhandler_put) \
75{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
76 .info = snd_soc_info_enum_ext, \
77 .get = xhandler_get, .put = xhandler_put, \
78 .private_value = (unsigned long)&xenum }
79
80/*
81 * Digital Audio Interface (DAI) types
82 */
83#define SND_SOC_DAI_AC97 0x1
84#define SND_SOC_DAI_I2S 0x2
85#define SND_SOC_DAI_PCM 0x4
86
87/*
88 * DAI hardware audio formats
89 */
90#define SND_SOC_DAIFMT_I2S 0 /* I2S mode */
91#define SND_SOC_DAIFMT_RIGHT_J 1 /* Right justified mode */
92#define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */
93#define SND_SOC_DAIFMT_DSP_A 3 /* L data msb after FRM or LRC */
94#define SND_SOC_DAIFMT_DSP_B 4 /* L data msb during FRM or LRC */
95#define SND_SOC_DAIFMT_AC97 5 /* AC97 */
96
97#define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J
98#define SND_SOC_DAIFMT_LSB SND_SOC_DAIFMT_RIGHT_J
99
100/*
101 * DAI Gating
102 */
103#define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */
104#define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated when not Tx/Rx */
105
106/*
107 * DAI hardware signal inversions
108 */
109#define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */
110#define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal bclk + inv frm */
111#define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert bclk + nor frm */
112#define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert bclk + frm */
113
114/*
115 * DAI hardware clock masters
116 * This is wrt the codec, the inverse is true for the interface
117 * i.e. if the codec is clk and frm master then the interface is
118 * clk and frame slave.
119 */
120#define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & frm master */
121#define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & frm master */
122#define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */
123#define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & frm slave */
124
125#define SND_SOC_DAIFMT_FORMAT_MASK 0x000f
126#define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0
127#define SND_SOC_DAIFMT_INV_MASK 0x0f00
128#define SND_SOC_DAIFMT_MASTER_MASK 0xf000
129
130
131/*
132 * Master Clock Directions
133 */
134#define SND_SOC_CLOCK_IN 0
135#define SND_SOC_CLOCK_OUT 1
136
137/*
138 * AC97 codec ID's bitmask
139 */
140#define SND_SOC_DAI_AC97_ID0 (1 << 0)
141#define SND_SOC_DAI_AC97_ID1 (1 << 1)
142#define SND_SOC_DAI_AC97_ID2 (1 << 2)
143#define SND_SOC_DAI_AC97_ID3 (1 << 3)
144
145struct snd_soc_device;
146struct snd_soc_pcm_stream;
147struct snd_soc_ops;
148struct snd_soc_dai_mode;
149struct snd_soc_pcm_runtime;
150struct snd_soc_codec_dai;
151struct snd_soc_cpu_dai;
152struct snd_soc_codec;
153struct snd_soc_machine_config;
154struct soc_enum;
155struct snd_soc_ac97_ops;
156struct snd_soc_clock_info;
157
158typedef int (*hw_write_t)(void *,const char* ,int);
159typedef int (*hw_read_t)(void *,char* ,int);
160
161extern struct snd_ac97_bus_ops soc_ac97_ops;
162
163/* pcm <-> DAI connect */
164void snd_soc_free_pcms(struct snd_soc_device *socdev);
165int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid);
166int snd_soc_register_card(struct snd_soc_device *socdev);
167
168/* set runtime hw params */
169int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
170 const struct snd_pcm_hardware *hw);
171
172/* codec IO */
173#define snd_soc_read(codec, reg) codec->read(codec, reg)
174#define snd_soc_write(codec, reg, value) codec->write(codec, reg, value)
175
176/* codec register bit access */
177int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
178 unsigned short mask, unsigned short value);
179int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg,
180 unsigned short mask, unsigned short value);
181
182int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
183 struct snd_ac97_bus_ops *ops, int num);
184void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
185
186/*
187 *Controls
188 */
189struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
190 void *data, char *long_name);
191int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
192 struct snd_ctl_elem_info *uinfo);
193int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
194 struct snd_ctl_elem_info *uinfo);
195int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol,
196 struct snd_ctl_elem_value *ucontrol);
197int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
198 struct snd_ctl_elem_value *ucontrol);
199int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
200 struct snd_ctl_elem_info *uinfo);
201int snd_soc_info_volsw_ext(struct snd_kcontrol *kcontrol,
202 struct snd_ctl_elem_info *uinfo);
203int snd_soc_info_bool_ext(struct snd_kcontrol *kcontrol,
204 struct snd_ctl_elem_info *uinfo);
205int snd_soc_get_volsw(struct snd_kcontrol *kcontrol,
206 struct snd_ctl_elem_value *ucontrol);
207int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
208 struct snd_ctl_elem_value *ucontrol);
209int snd_soc_info_volsw_2r(struct snd_kcontrol *kcontrol,
210 struct snd_ctl_elem_info *uinfo);
211int snd_soc_get_volsw_2r(struct snd_kcontrol *kcontrol,
212 struct snd_ctl_elem_value *ucontrol);
213int snd_soc_put_volsw_2r(struct snd_kcontrol *kcontrol,
214 struct snd_ctl_elem_value *ucontrol);
215
216/* SoC PCM stream information */
217struct snd_soc_pcm_stream {
218 char *stream_name;
219 u64 formats; /* SNDRV_PCM_FMTBIT_* */
220 unsigned int rates; /* SNDRV_PCM_RATE_* */
221 unsigned int rate_min; /* min rate */
222 unsigned int rate_max; /* max rate */
223 unsigned int channels_min; /* min channels */
224 unsigned int channels_max; /* max channels */
225 unsigned int active:1; /* stream is in use */
226};
227
228/* SoC audio ops */
229struct snd_soc_ops {
230 int (*startup)(struct snd_pcm_substream *);
231 void (*shutdown)(struct snd_pcm_substream *);
232 int (*hw_params)(struct snd_pcm_substream *, struct snd_pcm_hw_params *);
233 int (*hw_free)(struct snd_pcm_substream *);
234 int (*prepare)(struct snd_pcm_substream *);
235 int (*trigger)(struct snd_pcm_substream *, int);
236};
237
238/* ASoC codec DAI ops */
239struct snd_soc_codec_ops {
240 /* codec DAI clocking configuration */
241 int (*set_sysclk)(struct snd_soc_codec_dai *codec_dai,
242 int clk_id, unsigned int freq, int dir);
243 int (*set_pll)(struct snd_soc_codec_dai *codec_dai,
244 int pll_id, unsigned int freq_in, unsigned int freq_out);
245 int (*set_clkdiv)(struct snd_soc_codec_dai *codec_dai,
246 int div_id, int div);
247
248 /* CPU DAI format configuration */
249 int (*set_fmt)(struct snd_soc_codec_dai *codec_dai,
250 unsigned int fmt);
251 int (*set_tdm_slot)(struct snd_soc_codec_dai *codec_dai,
252 unsigned int mask, int slots);
253 int (*set_tristate)(struct snd_soc_codec_dai *, int tristate);
254
255 /* digital mute */
256 int (*digital_mute)(struct snd_soc_codec_dai *, int mute);
257};
258
259/* ASoC cpu DAI ops */
260struct snd_soc_cpu_ops {
261 /* CPU DAI clocking configuration */
262 int (*set_sysclk)(struct snd_soc_cpu_dai *cpu_dai,
263 int clk_id, unsigned int freq, int dir);
264 int (*set_clkdiv)(struct snd_soc_cpu_dai *cpu_dai,
265 int div_id, int div);
266 int (*set_pll)(struct snd_soc_cpu_dai *cpu_dai,
267 int pll_id, unsigned int freq_in, unsigned int freq_out);
268
269 /* CPU DAI format configuration */
270 int (*set_fmt)(struct snd_soc_cpu_dai *cpu_dai,
271 unsigned int fmt);
272 int (*set_tdm_slot)(struct snd_soc_cpu_dai *cpu_dai,
273 unsigned int mask, int slots);
274 int (*set_tristate)(struct snd_soc_cpu_dai *, int tristate);
275};
276
277/* SoC Codec DAI */
278struct snd_soc_codec_dai {
279 char *name;
280 int id;
281
282 /* DAI capabilities */
283 struct snd_soc_pcm_stream playback;
284 struct snd_soc_pcm_stream capture;
285
286 /* DAI runtime info */
287 struct snd_soc_codec *codec;
288 unsigned int active;
289 unsigned char pop_wait:1;
290
291 /* ops */
292 struct snd_soc_ops ops;
293 struct snd_soc_codec_ops dai_ops;
294
295 /* DAI private data */
296 void *private_data;
297};
298
299/* SoC CPU DAI */
300struct snd_soc_cpu_dai {
301
302 /* DAI description */
303 char *name;
304 unsigned int id;
305 unsigned char type;
306
307 /* DAI callbacks */
308 int (*probe)(struct platform_device *pdev);
309 void (*remove)(struct platform_device *pdev);
310 int (*suspend)(struct platform_device *pdev,
311 struct snd_soc_cpu_dai *cpu_dai);
312 int (*resume)(struct platform_device *pdev,
313 struct snd_soc_cpu_dai *cpu_dai);
314
315 /* ops */
316 struct snd_soc_ops ops;
317 struct snd_soc_cpu_ops dai_ops;
318
319 /* DAI capabilities */
320 struct snd_soc_pcm_stream capture;
321 struct snd_soc_pcm_stream playback;
322
323 /* DAI runtime info */
324 struct snd_pcm_runtime *runtime;
325 unsigned char active:1;
326 void *dma_data;
327
328 /* DAI private data */
329 void *private_data;
330};
331
332/* SoC Audio Codec */
333struct snd_soc_codec {
334 char *name;
335 struct module *owner;
336 struct mutex mutex;
337
338 /* callbacks */
339 int (*dapm_event)(struct snd_soc_codec *codec, int event);
340
341 /* runtime */
342 struct snd_card *card;
343 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
344 unsigned int active;
345 unsigned int pcm_devs;
346 void *private_data;
347
348 /* codec IO */
349 void *control_data; /* codec control (i2c/3wire) data */
350 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
351 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
352 hw_write_t hw_write;
353 hw_read_t hw_read;
354 void *reg_cache;
355 short reg_cache_size;
356 short reg_cache_step;
357
358 /* dapm */
359 struct list_head dapm_widgets;
360 struct list_head dapm_paths;
361 unsigned int dapm_state;
362 unsigned int suspend_dapm_state;
363 struct delayed_work delayed_work;
364
365 /* codec DAI's */
366 struct snd_soc_codec_dai *dai;
367 unsigned int num_dai;
368};
369
370/* codec device */
371struct snd_soc_codec_device {
372 int (*probe)(struct platform_device *pdev);
373 int (*remove)(struct platform_device *pdev);
374 int (*suspend)(struct platform_device *pdev, pm_message_t state);
375 int (*resume)(struct platform_device *pdev);
376};
377
378/* SoC platform interface */
379struct snd_soc_platform {
380 char *name;
381
382 int (*probe)(struct platform_device *pdev);
383 int (*remove)(struct platform_device *pdev);
384 int (*suspend)(struct platform_device *pdev,
385 struct snd_soc_cpu_dai *cpu_dai);
386 int (*resume)(struct platform_device *pdev,
387 struct snd_soc_cpu_dai *cpu_dai);
388
389 /* pcm creation and destruction */
390 int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *,
391 struct snd_pcm *);
392 void (*pcm_free)(struct snd_pcm *);
393
394 /* platform stream ops */
395 struct snd_pcm_ops *pcm_ops;
396};
397
398/* SoC machine DAI configuration, glues a codec and cpu DAI together */
399struct snd_soc_dai_link {
400 char *name; /* Codec name */
401 char *stream_name; /* Stream name */
402
403 /* DAI */
404 struct snd_soc_codec_dai *codec_dai;
405 struct snd_soc_cpu_dai *cpu_dai;
406
407 /* machine stream operations */
408 struct snd_soc_ops *ops;
409
410 /* codec/machine specific init - e.g. add machine controls */
411 int (*init)(struct snd_soc_codec *codec);
412};
413
414/* SoC machine */
415struct snd_soc_machine {
416 char *name;
417
418 int (*probe)(struct platform_device *pdev);
419 int (*remove)(struct platform_device *pdev);
420
421 /* the pre and post PM functions are used to do any PM work before and
422 * after the codec and DAI's do any PM work. */
423 int (*suspend_pre)(struct platform_device *pdev, pm_message_t state);
424 int (*suspend_post)(struct platform_device *pdev, pm_message_t state);
425 int (*resume_pre)(struct platform_device *pdev);
426 int (*resume_post)(struct platform_device *pdev);
427
428 /* CPU <--> Codec DAI links */
429 struct snd_soc_dai_link *dai_link;
430 int num_links;
431};
432
433/* SoC Device - the audio subsystem */
434struct snd_soc_device {
435 struct device *dev;
436 struct snd_soc_machine *machine;
437 struct snd_soc_platform *platform;
438 struct snd_soc_codec *codec;
439 struct snd_soc_codec_device *codec_dev;
440 struct delayed_work delayed_work;
441 void *codec_data;
442};
443
444/* runtime channel data */
445struct snd_soc_pcm_runtime {
446 struct snd_soc_dai_link *dai;
447 struct snd_soc_device *socdev;
448};
449
450/* enumerated kcontrol */
451struct soc_enum {
452 unsigned short reg;
453 unsigned short reg2;
454 unsigned char shift_l;
455 unsigned char shift_r;
456 unsigned int mask;
457 const char **texts;
458 void *dapm;
459};
460
461#endif
diff --git a/include/sound/typedefs.h b/include/sound/typedefs.h
deleted file mode 100644
index f454b0206b93..000000000000
--- a/include/sound/typedefs.h
+++ /dev/null
@@ -1,173 +0,0 @@
1/*
2 * Typedef's for backward compatibility (for out-of-kernel drivers)
3 *
4 * This file will be removed soon in future
5 */
6
7/* core stuff */
8typedef struct snd_card snd_card_t;
9typedef struct snd_device snd_device_t;
10typedef struct snd_device_ops snd_device_ops_t;
11typedef enum snd_card_type snd_card_type_t;
12typedef struct snd_minor snd_minor_t;
13
14/* info */
15typedef struct snd_info_entry snd_info_entry_t;
16typedef struct snd_info_buffer snd_info_buffer_t;
17
18/* control */
19typedef struct snd_ctl_file snd_ctl_file_t;
20typedef struct snd_kcontrol snd_kcontrol_t;
21typedef struct snd_kcontrol_new snd_kcontrol_new_t;
22typedef struct snd_kcontrol_volatile snd_kcontrol_volatile_t;
23typedef struct snd_kctl_event snd_kctl_event_t;
24typedef struct snd_aes_iec958 snd_aes_iec958_t;
25typedef struct snd_ctl_card_info snd_ctl_card_info_t;
26typedef struct snd_ctl_elem_id snd_ctl_elem_id_t;
27typedef struct snd_ctl_elem_list snd_ctl_elem_list_t;
28typedef struct snd_ctl_elem_info snd_ctl_elem_info_t;
29typedef struct snd_ctl_elem_value snd_ctl_elem_value_t;
30typedef struct snd_ctl_event snd_ctl_event_t;
31#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
32typedef struct snd_mixer_oss snd_mixer_oss_t;
33#endif
34
35/* timer */
36typedef struct snd_timer snd_timer_t;
37typedef struct snd_timer_instance snd_timer_instance_t;
38typedef struct snd_timer_id snd_timer_id_t;
39typedef struct snd_timer_ginfo snd_timer_ginfo_t;
40typedef struct snd_timer_gparams snd_timer_gparams_t;
41typedef struct snd_timer_gstatus snd_timer_gstatus_t;
42typedef struct snd_timer_select snd_timer_select_t;
43typedef struct snd_timer_info snd_timer_info_t;
44typedef struct snd_timer_params snd_timer_params_t;
45typedef struct snd_timer_status snd_timer_status_t;
46typedef struct snd_timer_read snd_timer_read_t;
47typedef struct snd_timer_tread snd_timer_tread_t;
48
49/* PCM */
50typedef struct snd_pcm snd_pcm_t;
51typedef struct snd_pcm_str snd_pcm_str_t;
52typedef struct snd_pcm_substream snd_pcm_substream_t;
53typedef struct snd_pcm_info snd_pcm_info_t;
54typedef struct snd_pcm_hw_params snd_pcm_hw_params_t;
55typedef struct snd_pcm_sw_params snd_pcm_sw_params_t;
56typedef struct snd_pcm_channel_info snd_pcm_channel_info_t;
57typedef struct snd_pcm_status snd_pcm_status_t;
58typedef struct snd_pcm_mmap_status snd_pcm_mmap_status_t;
59typedef struct snd_pcm_mmap_control snd_pcm_mmap_control_t;
60typedef struct snd_mask snd_mask_t;
61typedef struct snd_sg_buf snd_pcm_sgbuf_t;
62
63typedef struct snd_interval snd_interval_t;
64typedef struct snd_xferi snd_xferi_t;
65typedef struct snd_xfern snd_xfern_t;
66typedef struct snd_xferv snd_xferv_t;
67
68typedef struct snd_pcm_file snd_pcm_file_t;
69typedef struct snd_pcm_runtime snd_pcm_runtime_t;
70typedef struct snd_pcm_hardware snd_pcm_hardware_t;
71typedef struct snd_pcm_ops snd_pcm_ops_t;
72typedef struct snd_pcm_hw_rule snd_pcm_hw_rule_t;
73typedef struct snd_pcm_hw_constraints snd_pcm_hw_constraints_t;
74typedef struct snd_ratnum ratnum_t;
75typedef struct snd_ratden ratden_t;
76typedef struct snd_pcm_hw_constraint_ratnums snd_pcm_hw_constraint_ratnums_t;
77typedef struct snd_pcm_hw_constraint_ratdens snd_pcm_hw_constraint_ratdens_t;
78typedef struct snd_pcm_hw_constraint_list snd_pcm_hw_constraint_list_t;
79typedef struct snd_pcm_group snd_pcm_group_t;
80typedef struct snd_pcm_notify snd_pcm_notify_t;
81
82/* rawmidi */
83typedef struct snd_rawmidi snd_rawmidi_t;
84typedef struct snd_rawmidi_info snd_rawmidi_info_t;
85typedef struct snd_rawmidi_params snd_rawmidi_params_t;
86typedef struct snd_rawmidi_status snd_rawmidi_status_t;
87typedef struct snd_rawmidi_runtime snd_rawmidi_runtime_t;
88typedef struct snd_rawmidi_substream snd_rawmidi_substream_t;
89typedef struct snd_rawmidi_str snd_rawmidi_str_t;
90typedef struct snd_rawmidi_ops snd_rawmidi_ops_t;
91typedef struct snd_rawmidi_global_ops snd_rawmidi_global_ops_t;
92typedef struct snd_rawmidi_file snd_rawmidi_file_t;
93
94/* hwdep */
95typedef struct snd_hwdep snd_hwdep_t;
96typedef struct snd_hwdep_info snd_hwdep_info_t;
97typedef struct snd_hwdep_dsp_status snd_hwdep_dsp_status_t;
98typedef struct snd_hwdep_dsp_image snd_hwdep_dsp_image_t;
99typedef struct snd_hwdep_ops snd_hwdep_ops_t;
100
101/* sequencer */
102typedef struct snd_seq_port_info snd_seq_port_info_t;
103typedef struct snd_seq_port_subscribe snd_seq_port_subscribe_t;
104typedef struct snd_seq_event snd_seq_event_t;
105typedef struct snd_seq_addr snd_seq_addr_t;
106typedef struct snd_seq_ev_volume snd_seq_ev_volume_t;
107typedef struct snd_seq_ev_loop snd_seq_ev_loop_t;
108typedef struct snd_seq_remove_events snd_seq_remove_events_t;
109typedef struct snd_seq_query_subs snd_seq_query_subs_t;
110typedef struct snd_seq_system_info snd_seq_system_info_t;
111typedef struct snd_seq_client_info snd_seq_client_info_t;
112typedef struct snd_seq_queue_info snd_seq_queue_info_t;
113typedef struct snd_seq_queue_status snd_seq_queue_status_t;
114typedef struct snd_seq_queue_tempo snd_seq_queue_tempo_t;
115typedef struct snd_seq_queue_owner snd_seq_queue_owner_t;
116typedef struct snd_seq_queue_timer snd_seq_queue_timer_t;
117typedef struct snd_seq_queue_client snd_seq_queue_client_t;
118typedef struct snd_seq_client_pool snd_seq_client_pool_t;
119typedef struct snd_seq_instr snd_seq_instr_t;
120typedef struct snd_seq_instr_data snd_seq_instr_data_t;
121typedef struct snd_seq_instr_header snd_seq_instr_header_t;
122
123typedef struct snd_seq_user_client user_client_t;
124typedef struct snd_seq_kernel_client kernel_client_t;
125typedef struct snd_seq_client client_t;
126typedef struct snd_seq_queue queue_t;
127
128/* seq_device */
129typedef struct snd_seq_device snd_seq_device_t;
130typedef struct snd_seq_dev_ops snd_seq_dev_ops_t;
131
132/* seq_midi */
133typedef struct snd_midi_event snd_midi_event_t;
134
135/* seq_midi_emul */
136typedef struct snd_midi_channel snd_midi_channel_t;
137typedef struct snd_midi_channel_set snd_midi_channel_set_t;
138typedef struct snd_midi_op snd_midi_op_t;
139
140/* seq_oss */
141typedef struct snd_seq_oss_arg snd_seq_oss_arg_t;
142typedef struct snd_seq_oss_callback snd_seq_oss_callback_t;
143typedef struct snd_seq_oss_reg snd_seq_oss_reg_t;
144
145/* virmidi */
146typedef struct snd_virmidi_dev snd_virmidi_dev_t;
147typedef struct snd_virmidi snd_virmidi_t;
148
149/* seq_instr */
150typedef struct snd_seq_kcluster snd_seq_kcluster_t;
151typedef struct snd_seq_kinstr_ops snd_seq_kinstr_ops_t;
152typedef struct snd_seq_kinstr snd_seq_kinstr_t;
153typedef struct snd_seq_kinstr_list snd_seq_kinstr_list_t;
154
155/* ac97 */
156typedef struct snd_ac97_bus ac97_bus_t;
157typedef struct snd_ac97_bus_ops ac97_bus_ops_t;
158typedef struct snd_ac97_template ac97_template_t;
159typedef struct snd_ac97 ac97_t;
160
161/* opl3/4 */
162typedef struct snd_opl3 opl3_t;
163typedef struct snd_opl4 opl4_t;
164
165/* mpu401 */
166typedef struct snd_mpu401 mpu401_t;
167
168/* i2c */
169typedef struct snd_i2c_device snd_i2c_device_t;
170typedef struct snd_i2c_bus snd_i2c_bus_t;
171
172typedef struct snd_ak4531 ak4531_t;
173
diff --git a/include/sound/version.h b/include/sound/version.h
index 20f7babad514..c39b3802cf18 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.14rc1" 2#define CONFIG_SND_VERSION "1.0.14rc2"
3#define CONFIG_SND_DATE " (Tue Jan 09 09:56:17 2007 UTC)" 3#define CONFIG_SND_DATE " (Fri Feb 09 13:50:10 2007 UTC)"
diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h
index 217394652090..4830651cc4cf 100644
--- a/include/sound/vx_core.h
+++ b/include/sound/vx_core.h
@@ -128,7 +128,7 @@ struct snd_vx_hardware {
128 unsigned int num_ins; 128 unsigned int num_ins;
129 unsigned int num_outs; 129 unsigned int num_outs;
130 unsigned int output_level_max; 130 unsigned int output_level_max;
131 unsigned int *output_level_db_scale; 131 const unsigned int *output_level_db_scale;
132}; 132};
133 133
134/* hwdep id string */ 134/* hwdep id string */
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h
index f3514ee96bd9..203d2b45b788 100644
--- a/include/sound/ymfpci.h
+++ b/include/sound/ymfpci.h
@@ -270,6 +270,7 @@ struct snd_ymfpci_pcm {
270 struct snd_pcm_substream *substream; 270 struct snd_pcm_substream *substream;
271 struct snd_ymfpci_voice *voices[2]; /* playback only */ 271 struct snd_ymfpci_voice *voices[2]; /* playback only */
272 unsigned int running: 1, 272 unsigned int running: 1,
273 use_441_slot: 1,
273 output_front: 1, 274 output_front: 1,
274 output_rear: 1, 275 output_rear: 1,
275 swap_rear: 1; 276 swap_rear: 1;
@@ -324,6 +325,7 @@ struct snd_ymfpci {
324 325
325 u32 active_bank; 326 u32 active_bank;
326 struct snd_ymfpci_voice voices[64]; 327 struct snd_ymfpci_voice voices[64];
328 int src441_used;
327 329
328 struct snd_ac97_bus *ac97_bus; 330 struct snd_ac97_bus *ac97_bus;
329 struct snd_ac97 *ac97; 331 struct snd_ac97 *ac97;
@@ -346,7 +348,7 @@ struct snd_ymfpci {
346 int mode_dup4ch; 348 int mode_dup4ch;
347 int rear_opened; 349 int rear_opened;
348 int spdif_opened; 350 int spdif_opened;
349 struct { 351 struct snd_ymfpci_pcm_mixer {
350 u16 left; 352 u16 left;
351 u16 right; 353 u16 right;
352 struct snd_kcontrol *ctl; 354 struct snd_kcontrol *ctl;
@@ -357,6 +359,8 @@ struct snd_ymfpci {
357 wait_queue_head_t interrupt_sleep; 359 wait_queue_head_t interrupt_sleep;
358 atomic_t interrupt_sleep_count; 360 atomic_t interrupt_sleep_count;
359 struct snd_info_entry *proc_entry; 361 struct snd_info_entry *proc_entry;
362 const struct firmware *dsp_microcode;
363 const struct firmware *controller_microcode;
360 364
361#ifdef CONFIG_PM 365#ifdef CONFIG_PM
362 u32 *saved_regs; 366 u32 *saved_regs;
diff --git a/include/video/neomagic.h b/include/video/neomagic.h
index 78b1f15a538f..a9e118a1cd16 100644
--- a/include/video/neomagic.h
+++ b/include/video/neomagic.h
@@ -140,7 +140,8 @@ typedef volatile struct {
140 140
141struct neofb_par { 141struct neofb_par {
142 struct vgastate state; 142 struct vgastate state;
143 atomic_t ref_count; 143 struct mutex open_lock;
144 unsigned int ref_count;
144 145
145 unsigned char MiscOutReg; /* Misc */ 146 unsigned char MiscOutReg; /* Misc */
146 unsigned char CRTC[25]; /* Crtc Controller */ 147 unsigned char CRTC[25]; /* Crtc Controller */
diff --git a/include/video/s3blit.h b/include/video/s3blit.h
deleted file mode 100644
index b1db63187b4e..000000000000
--- a/include/video/s3blit.h
+++ /dev/null
@@ -1,79 +0,0 @@
1#ifndef _VIDEO_S3BLIT_H
2#define _VIDEO_S3BLIT_H
3
4/* s3 commands */
5#define S3_BITBLT 0xc011
6#define S3_TWOPOINTLINE 0x2811
7#define S3_FILLEDRECT 0x40b1
8
9#define S3_FIFO_EMPTY 0x0400
10#define S3_HDW_BUSY 0x0200
11
12/* Enhanced register mapping (MMIO mode) */
13
14#define S3_READ_SEL 0xbee8 /* offset f */
15#define S3_MULT_MISC 0xbee8 /* offset e */
16#define S3_ERR_TERM 0x92e8
17#define S3_FRGD_COLOR 0xa6e8
18#define S3_BKGD_COLOR 0xa2e8
19#define S3_PIXEL_CNTL 0xbee8 /* offset a */
20#define S3_FRGD_MIX 0xbae8
21#define S3_BKGD_MIX 0xb6e8
22#define S3_CUR_Y 0x82e8
23#define S3_CUR_X 0x86e8
24#define S3_DESTY_AXSTP 0x8ae8
25#define S3_DESTX_DIASTP 0x8ee8
26#define S3_MIN_AXIS_PCNT 0xbee8 /* offset 0 */
27#define S3_MAJ_AXIS_PCNT 0x96e8
28#define S3_CMD 0x9ae8
29#define S3_GP_STAT 0x9ae8
30#define S3_ADVFUNC_CNTL 0x4ae8
31#define S3_WRT_MASK 0xaae8
32#define S3_RD_MASK 0xaee8
33
34/* Enhanced register mapping (Packed MMIO mode, write only) */
35#define S3_ALT_CURXY 0x8100
36#define S3_ALT_CURXY2 0x8104
37#define S3_ALT_STEP 0x8108
38#define S3_ALT_STEP2 0x810c
39#define S3_ALT_ERR 0x8110
40#define S3_ALT_CMD 0x8118
41#define S3_ALT_MIX 0x8134
42#define S3_ALT_PCNT 0x8148
43#define S3_ALT_PAT 0x8168
44
45/* Drawing modes */
46#define S3_NOTCUR 0x0000
47#define S3_LOGICALZERO 0x0001
48#define S3_LOGICALONE 0x0002
49#define S3_LEAVEASIS 0x0003
50#define S3_NOTNEW 0x0004
51#define S3_CURXORNEW 0x0005
52#define S3_NOT_CURXORNEW 0x0006
53#define S3_NEW 0x0007
54#define S3_NOTCURORNOTNEW 0x0008
55#define S3_CURORNOTNEW 0x0009
56#define S3_NOTCURORNEW 0x000a
57#define S3_CURORNEW 0x000b
58#define S3_CURANDNEW 0x000c
59#define S3_NOTCURANDNEW 0x000d
60#define S3_CURANDNOTNEW 0x000e
61#define S3_NOTCURANDNOTNEW 0x000f
62
63#define S3_CRTC_ADR 0x03d4
64#define S3_CRTC_DATA 0x03d5
65
66#define S3_REG_LOCK2 0x39
67#define S3_HGC_MODE 0x45
68
69#define S3_HWGC_ORGX_H 0x46
70#define S3_HWGC_ORGX_L 0x47
71#define S3_HWGC_ORGY_H 0x48
72#define S3_HWGC_ORGY_L 0x49
73#define S3_HWGC_DX 0x4e
74#define S3_HWGC_DY 0x4f
75
76
77#define S3_LAW_CTL 0x58
78
79#endif /* _VIDEO_S3BLIT_H */