aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h15
-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.h35
-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/cacheflush.h1
-rw-r--r--include/asm-alpha/dma-mapping.h20
-rw-r--r--include/asm-alpha/io.h9
-rw-r--r--include/asm-alpha/pci.h2
-rw-r--r--include/asm-alpha/posix_types.h2
-rw-r--r--include/asm-alpha/termbits.h13
-rw-r--r--include/asm-alpha/unistd.h11
-rw-r--r--include/asm-arm/apm.h64
-rw-r--r--include/asm-arm/arch-at91rm9200/at91_ecc.h8
-rw-r--r--include/asm-arm/arch-at91rm9200/at91_pmc.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/at91_rstc.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/at91_rtc.h16
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h6
-rw-r--r--include/asm-arm/arch-at91rm9200/at91sam926x_mc.h16
-rw-r--r--include/asm-arm/arch-ep93xx/irqs.h6
-rw-r--r--include/asm-arm/arch-imx/imx-regs.h10
-rw-r--r--include/asm-arm/arch-iop13xx/io.h3
-rw-r--r--include/asm-arm/arch-iop13xx/iq81340.h5
-rw-r--r--include/asm-arm/arch-iop32x/iop32x.h2
-rw-r--r--include/asm-arm/arch-ixp23xx/memory.h16
-rw-r--r--include/asm-arm/arch-ixp4xx/io.h3
-rw-r--r--include/asm-arm/arch-pnx4008/i2c.h67
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h3
-rw-r--r--include/asm-arm/arch-pxa/pxa2xx_spi.h5
-rw-r--r--include/asm-arm/arch-s3c2410/anubis-cpld.h2
-rw-r--r--include/asm-arm/arch-s3c2410/anubis-irq.h2
-rw-r--r--include/asm-arm/arch-s3c2410/anubis-map.h2
-rw-r--r--include/asm-arm/arch-s3c2410/audio.h2
-rw-r--r--include/asm-arm/arch-s3c2410/bast-cpld.h4
-rw-r--r--include/asm-arm/arch-s3c2410/bast-irq.h4
-rw-r--r--include/asm-arm/arch-s3c2410/bast-map.h4
-rw-r--r--include/asm-arm/arch-s3c2410/bast-pmu.h2
-rw-r--r--include/asm-arm/arch-s3c2410/dma.h2
-rw-r--r--include/asm-arm/arch-s3c2410/entry-macro.S2
-rw-r--r--include/asm-arm/arch-s3c2410/fb.h3
-rw-r--r--include/asm-arm/arch-s3c2410/h1940-latch.h4
-rw-r--r--include/asm-arm/arch-s3c2410/hardware.h8
-rw-r--r--include/asm-arm/arch-s3c2410/iic.h2
-rw-r--r--include/asm-arm/arch-s3c2410/irqs.h3
-rw-r--r--include/asm-arm/arch-s3c2410/leds-gpio.h2
-rw-r--r--include/asm-arm/arch-s3c2410/map.h30
-rw-r--r--include/asm-arm/arch-s3c2410/nand.h4
-rw-r--r--include/asm-arm/arch-s3c2410/osiris-cpld.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpio.h4
-rw-r--r--include/asm-arm/arch-s3c2410/regs-mem.h14
-rw-r--r--include/asm-arm/arch-s3c2410/regs-serial.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-udc.h7
-rw-r--r--include/asm-arm/arch-s3c2410/system.h4
-rw-r--r--include/asm-arm/arch-s3c2410/timex.h4
-rw-r--r--include/asm-arm/arch-s3c2410/uncompress.h5
-rw-r--r--include/asm-arm/arch-s3c2410/usb-control.h4
-rw-r--r--include/asm-arm/arch-s3c2410/vr1000-cpld.h4
-rw-r--r--include/asm-arm/arch-s3c2410/vr1000-irq.h4
-rw-r--r--include/asm-arm/arch-s3c2410/vr1000-map.h4
-rw-r--r--include/asm-arm/cacheflush.h14
-rw-r--r--include/asm-arm/cpu-multi32.h7
-rw-r--r--include/asm-arm/cpu-single.h4
-rw-r--r--include/asm-arm/elf.h1
-rw-r--r--include/asm-arm/flat.h4
-rw-r--r--include/asm-arm/fpstate.h3
-rw-r--r--include/asm-arm/hardware/iop3xx.h6
-rw-r--r--include/asm-arm/io.h5
-rw-r--r--include/asm-arm/irq.h5
-rw-r--r--include/asm-arm/pgtable.h11
-rw-r--r--include/asm-arm/processor.h16
-rw-r--r--include/asm-arm/system.h52
-rw-r--r--include/asm-arm/termbits.h12
-rw-r--r--include/asm-arm/thread_info.h2
-rw-r--r--include/asm-arm/unistd.h25
-rw-r--r--include/asm-arm26/cacheflush.h1
-rw-r--r--include/asm-arm26/termbits.h12
-rw-r--r--include/asm-avr32/arch-at32ap/at32ap7000.h35
-rw-r--r--include/asm-avr32/arch-at32ap/board.h3
-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.h22
-rw-r--r--include/asm-avr32/cacheflush.h1
-rw-r--r--include/asm-avr32/checksum.h2
-rw-r--r--include/asm-avr32/dma-mapping.h20
-rw-r--r--include/asm-avr32/gpio.h6
-rw-r--r--include/asm-avr32/irq.h8
-rw-r--r--include/asm-avr32/pgalloc.h2
-rw-r--r--include/asm-avr32/posix_types.h2
-rw-r--r--include/asm-avr32/termbits.h11
-rw-r--r--include/asm-avr32/uaccess.h6
-rw-r--r--include/asm-cris/cacheflush.h1
-rw-r--r--include/asm-cris/io.h5
-rw-r--r--include/asm-cris/termbits.h11
-rw-r--r--include/asm-frv/Kbuild6
-rw-r--r--include/asm-frv/bitops.h44
-rw-r--r--include/asm-frv/cacheflush.h1
-rw-r--r--include/asm-frv/page.h4
-rw-r--r--include/asm-frv/ptrace.h4
-rw-r--r--include/asm-frv/termbits.h11
-rw-r--r--include/asm-frv/termios.h2
-rw-r--r--include/asm-frv/thread_info.h2
-rw-r--r--include/asm-generic/bug.h18
-rw-r--r--include/asm-generic/libata-portmap.h4
-rw-r--r--include/asm-generic/page.h38
-rw-r--r--include/asm-generic/termios.h4
-rw-r--r--include/asm-generic/vmlinux.lds.h34
-rw-r--r--include/asm-h8300/cacheflush.h1
-rw-r--r--include/asm-h8300/termbits.h11
-rw-r--r--include/asm-i386/acpi.h50
-rw-r--r--include/asm-i386/boot.h3
-rw-r--r--include/asm-i386/bug.h28
-rw-r--r--include/asm-i386/cacheflush.h1
-rw-r--r--include/asm-i386/e820.h2
-rw-r--r--include/asm-i386/elf.h51
-rw-r--r--include/asm-i386/fixmap.h2
-rw-r--r--include/asm-i386/ide.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/msr.h5
-rw-r--r--include/asm-i386/page.h2
-rw-r--r--include/asm-i386/processor.h1
-rw-r--r--include/asm-i386/termbits.h11
-rw-r--r--include/asm-i386/thread_info.h2
-rw-r--r--include/asm-i386/topology.h1
-rw-r--r--include/asm-i386/unwind.h91
-rw-r--r--include/asm-ia64/acpi.h10
-rw-r--r--include/asm-ia64/break.h4
-rw-r--r--include/asm-ia64/cacheflush.h1
-rw-r--r--include/asm-ia64/checksum.h6
-rw-r--r--include/asm-ia64/dma.h2
-rw-r--r--include/asm-ia64/esi.h1
-rw-r--r--include/asm-ia64/kprobes.h1
-rw-r--r--include/asm-ia64/machvec.h3
-rw-r--r--include/asm-ia64/meminit.h3
-rw-r--r--include/asm-ia64/pci.h9
-rw-r--r--include/asm-ia64/pgalloc.h3
-rw-r--r--include/asm-ia64/posix_types.h2
-rw-r--r--include/asm-ia64/scatterlist.h3
-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/sn/xpc.h2
-rw-r--r--include/asm-ia64/swiotlb.h9
-rw-r--r--include/asm-ia64/termbits.h11
-rw-r--r--include/asm-ia64/thread_info.h6
-rw-r--r--include/asm-ia64/topology.h1
-rw-r--r--include/asm-ia64/unistd.h4
-rw-r--r--include/asm-m32r/cacheflush.h3
-rw-r--r--include/asm-m32r/ide.h3
-rw-r--r--include/asm-m32r/m32102.h7
-rw-r--r--include/asm-m32r/ptrace.h28
-rw-r--r--include/asm-m32r/sigcontext.h13
-rw-r--r--include/asm-m32r/termbits.h11
-rw-r--r--include/asm-m68k/cacheflush.h2
-rw-r--r--include/asm-m68k/sun3-head.h1
-rw-r--r--include/asm-m68k/sun3ints.h1
-rw-r--r--include/asm-m68k/swim_iop.h221
-rw-r--r--include/asm-m68k/termbits.h11
-rw-r--r--include/asm-m68k/uaccess.h1
-rw-r--r--include/asm-m68knommu/bitops.h1
-rw-r--r--include/asm-m68knommu/cacheflush.h1
-rw-r--r--include/asm-mips/bootinfo.h5
-rw-r--r--include/asm-mips/cacheflush.h2
-rw-r--r--include/asm-mips/checksum.h34
-rw-r--r--include/asm-mips/compat.h1
-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/hazards.h2
-rw-r--r--include/asm-mips/i8259.h3
-rw-r--r--include/asm-mips/io.h10
-rw-r--r--include/asm-mips/irq.h8
-rw-r--r--include/asm-mips/irq_cpu.h6
-rw-r--r--include/asm-mips/irqflags.h22
-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-ip27/irq.h2
-rw-r--r--include/asm-mips/mach-ip27/topology.h1
-rw-r--r--include/asm-mips/mach-mips/irq.h2
-rw-r--r--include/asm-mips/mach-rm/cpu-feature-overrides.h (renamed from include/asm-mips/mach-rm200/cpu-feature-overrides.h)0
-rw-r--r--include/asm-mips/mach-rm/mc146818rtc.h (renamed from include/asm-mips/mach-rm200/mc146818rtc.h)0
-rw-r--r--include/asm-mips/mach-rm/timex.h (renamed from include/asm-mips/mach-rm200/timex.h)0
-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/mipsmtregs.h2
-rw-r--r--include/asm-mips/page.h41
-rw-r--r--include/asm-mips/pci.h6
-rw-r--r--include/asm-mips/pgtable.h10
-rw-r--r--include/asm-mips/ptrace.h8
-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/smtc_ipi.h3
-rw-r--r--include/asm-mips/sn/arch.h1
-rw-r--r--include/asm-mips/sn/klconfig.h2
-rw-r--r--include/asm-mips/system.h9
-rw-r--r--include/asm-mips/termbits.h11
-rw-r--r--include/asm-mips/thread_info.h2
-rw-r--r--include/asm-mips/uaccess.h3
-rw-r--r--include/asm-mips/vr41xx/cmbvr4133.h5
-rw-r--r--include/asm-mips/war.h2
-rw-r--r--include/asm-parisc/cacheflush.h4
-rw-r--r--include/asm-parisc/io.h9
-rw-r--r--include/asm-parisc/termbits.h11
-rw-r--r--include/asm-powerpc/Kbuild2
-rw-r--r--include/asm-powerpc/atomic.h8
-rw-r--r--include/asm-powerpc/bitops.h21
-rw-r--r--include/asm-powerpc/bug.h105
-rw-r--r--include/asm-powerpc/cacheflush.h1
-rw-r--r--include/asm-powerpc/cputable.h27
-rw-r--r--include/asm-powerpc/dcr-native.h37
-rw-r--r--include/asm-powerpc/dcr.h3
-rw-r--r--include/asm-powerpc/dma-mapping.h12
-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.h3
-rw-r--r--include/asm-powerpc/hw_irq.h19
-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/libata-portmap.h12
-rw-r--r--include/asm-powerpc/mmu.h1
-rw-r--r--include/asm-powerpc/module.h2
-rw-r--r--include/asm-powerpc/mpc52xx.h3
-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/page_32.h10
-rw-r--r--include/asm-powerpc/pci-bridge.h6
-rw-r--r--include/asm-powerpc/pci.h33
-rw-r--r--include/asm-powerpc/posix_types.h2
-rw-r--r--include/asm-powerpc/ps3.h225
-rw-r--r--include/asm-powerpc/reg.h16
-rw-r--r--include/asm-powerpc/rtas.h3
-rw-r--r--include/asm-powerpc/smp.h1
-rw-r--r--include/asm-powerpc/spu.h15
-rw-r--r--include/asm-powerpc/spu_priv1.h2
-rw-r--r--include/asm-powerpc/sstep.h1
-rw-r--r--include/asm-powerpc/termbits.h13
-rw-r--r--include/asm-powerpc/thread_info.h2
-rw-r--r--include/asm-powerpc/time.h2
-rw-r--r--include/asm-powerpc/topology.h1
-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/pci-bridge.h8
-rw-r--r--include/asm-ppc/pci.h23
-rw-r--r--include/asm-ppc/reg_booke.h34
-rw-r--r--include/asm-ppc/serial.h2
-rw-r--r--include/asm-s390/cacheflush.h1
-rw-r--r--include/asm-s390/compat.h28
-rw-r--r--include/asm-s390/dasd.h2
-rw-r--r--include/asm-s390/etr.h219
-rw-r--r--include/asm-s390/futex.h4
-rw-r--r--include/asm-s390/hardirq.h2
-rw-r--r--include/asm-s390/io.h4
-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/page.h22
-rw-r--r--include/asm-s390/pgalloc.h88
-rw-r--r--include/asm-s390/pgtable.h163
-rw-r--r--include/asm-s390/posix_types.h2
-rw-r--r--include/asm-s390/processor.h27
-rw-r--r--include/asm-s390/ptrace.h11
-rw-r--r--include/asm-s390/qdio.h1
-rw-r--r--include/asm-s390/reset.h2
-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/termbits.h11
-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/atomic-irq.h71
-rw-r--r--include/asm-sh/atomic-llsc.h107
-rw-r--r--include/asm-sh/atomic.h153
-rw-r--r--include/asm-sh/bug.h53
-rw-r--r--include/asm-sh/bugs.h12
-rw-r--r--include/asm-sh/checksum.h69
-rw-r--r--include/asm-sh/cpu-sh2/cacheflush.h2
-rw-r--r--include/asm-sh/cpu-sh3/cacheflush.h3
-rw-r--r--include/asm-sh/cpu-sh4/cache.h2
-rw-r--r--include/asm-sh/cpu-sh4/cacheflush.h1
-rw-r--r--include/asm-sh/cpu-sh4/freq.h2
-rw-r--r--include/asm-sh/dma-mapping.h10
-rw-r--r--include/asm-sh/irq.h5
-rw-r--r--include/asm-sh/pgtable.h47
-rw-r--r--include/asm-sh/processor.h8
-rw-r--r--include/asm-sh/push-switch.h3
-rw-r--r--include/asm-sh/termbits.h11
-rw-r--r--include/asm-sh/thread_info.h2
-rw-r--r--include/asm-sh64/cacheflush.h2
-rw-r--r--include/asm-sh64/pgalloc.h2
-rw-r--r--include/asm-sparc/bitops.h100
-rw-r--r--include/asm-sparc/cacheflush.h1
-rw-r--r--include/asm-sparc/checksum.h2
-rw-r--r--include/asm-sparc/of_device.h2
-rw-r--r--include/asm-sparc/termbits.h12
-rw-r--r--include/asm-sparc64/cacheflush.h1
-rw-r--r--include/asm-sparc64/dma.h6
-rw-r--r--include/asm-sparc64/hw_irq.h2
-rw-r--r--include/asm-sparc64/irqflags.h89
-rw-r--r--include/asm-sparc64/kprobes.h11
-rw-r--r--include/asm-sparc64/of_device.h2
-rw-r--r--include/asm-sparc64/percpu.h10
-rw-r--r--include/asm-sparc64/rwsem.h32
-rw-r--r--include/asm-sparc64/system.h49
-rw-r--r--include/asm-sparc64/termbits.h12
-rw-r--r--include/asm-sparc64/ttable.h45
-rw-r--r--include/asm-um/bug.h4
-rw-r--r--include/asm-um/pgtable.h9
-rw-r--r--include/asm-v850/cacheflush.h1
-rw-r--r--include/asm-v850/termbits.h11
-rw-r--r--include/asm-x86_64/acpi.h50
-rw-r--r--include/asm-x86_64/bitops.h34
-rw-r--r--include/asm-x86_64/bug.h44
-rw-r--r--include/asm-x86_64/cacheflush.h1
-rw-r--r--include/asm-x86_64/dma-mapping.h3
-rw-r--r--include/asm-x86_64/io.h6
-rw-r--r--include/asm-x86_64/ioctls.h4
-rw-r--r--include/asm-x86_64/msr.h4
-rw-r--r--include/asm-x86_64/proto.h1
-rw-r--r--include/asm-x86_64/swiotlb.h8
-rw-r--r--include/asm-x86_64/termbits.h27
-rw-r--r--include/asm-x86_64/termios.h6
-rw-r--r--include/asm-x86_64/thread_info.h2
-rw-r--r--include/asm-x86_64/topology.h1
-rw-r--r--include/asm-x86_64/uaccess.h2
-rw-r--r--include/asm-x86_64/unwind.h96
-rw-r--r--include/asm-xtensa/asmmacro.h153
-rw-r--r--include/asm-xtensa/bug.h25
-rw-r--r--include/asm-xtensa/byteorder.h5
-rw-r--r--include/asm-xtensa/cache.h20
-rw-r--r--include/asm-xtensa/cacheasm.h177
-rw-r--r--include/asm-xtensa/cacheflush.h4
-rw-r--r--include/asm-xtensa/checksum.h2
-rw-r--r--include/asm-xtensa/coprocessor.h13
-rw-r--r--include/asm-xtensa/dma.h5
-rw-r--r--include/asm-xtensa/elf.h9
-rw-r--r--include/asm-xtensa/fcntl.h98
-rw-r--r--include/asm-xtensa/fixmap.h252
-rw-r--r--include/asm-xtensa/io.h64
-rw-r--r--include/asm-xtensa/irq.h8
-rw-r--r--include/asm-xtensa/irq_regs.h1
-rw-r--r--include/asm-xtensa/mmu_context.h269
-rw-r--r--include/asm-xtensa/page.h10
-rw-r--r--include/asm-xtensa/param.h2
-rw-r--r--include/asm-xtensa/pgtable.h41
-rw-r--r--include/asm-xtensa/platform-iss/hardware.h10
-rw-r--r--include/asm-xtensa/platform-iss/simcall.h62
-rw-r--r--include/asm-xtensa/posix_types.h4
-rw-r--r--include/asm-xtensa/processor.h24
-rw-r--r--include/asm-xtensa/ptrace.h2
-rw-r--r--include/asm-xtensa/regs.h138
-rw-r--r--include/asm-xtensa/sembuf.h2
-rw-r--r--include/asm-xtensa/shmbuf.h21
-rw-r--r--include/asm-xtensa/stat.h112
-rw-r--r--include/asm-xtensa/syscall.h20
-rw-r--r--include/asm-xtensa/system.h2
-rw-r--r--include/asm-xtensa/termbits.h11
-rw-r--r--include/asm-xtensa/timex.h17
-rw-r--r--include/asm-xtensa/tlbflush.h42
-rw-r--r--include/asm-xtensa/uaccess.h1
-rw-r--r--include/asm-xtensa/unistd.h798
-rw-r--r--include/asm-xtensa/variant-fsf/core.h359
-rw-r--r--include/asm-xtensa/variant-fsf/tie.h22
-rw-r--r--include/asm-xtensa/xtensa/cacheasm.h708
-rw-r--r--include/asm-xtensa/xtensa/cacheattrasm.h432
-rw-r--r--include/asm-xtensa/xtensa/config-linux_be/core.h1270
-rw-r--r--include/asm-xtensa/xtensa/config-linux_be/defs.h270
-rw-r--r--include/asm-xtensa/xtensa/config-linux_be/specreg.h99
-rw-r--r--include/asm-xtensa/xtensa/config-linux_be/system.h198
-rw-r--r--include/asm-xtensa/xtensa/config-linux_be/tie.h275
-rw-r--r--include/asm-xtensa/xtensa/coreasm.h526
-rw-r--r--include/asm-xtensa/xtensa/corebits.h77
-rw-r--r--include/asm-xtensa/xtensa/hal.h822
-rw-r--r--include/asm-xtensa/xtensa/simcall.h130
-rw-r--r--include/asm-xtensa/xtensa/xt2000-uart.h155
-rw-r--r--include/asm-xtensa/xtensa/xt2000.h408
-rw-r--r--include/asm-xtensa/xtensa/xtboard.h120
-rw-r--r--include/crypto/algapi.h24
-rw-r--r--include/linux/Kbuild12
-rw-r--r--include/linux/acpi.h340
-rw-r--r--include/linux/aio.h1
-rw-r--r--include/linux/apm-emulation.h (renamed from include/asm-mips/apm.h)8
-rw-r--r--include/linux/ata.h13
-rw-r--r--include/linux/atmarp.h2
-rw-r--r--include/linux/backlight.h2
-rw-r--r--include/linux/bio.h1
-rw-r--r--include/linux/bitops.h6
-rw-r--r--include/linux/bitrev.h15
-rw-r--r--include/linux/blkdev.h19
-rw-r--r--include/linux/bug.h47
-rw-r--r--include/linux/cdev.h4
-rw-r--r--include/linux/clocksource.h2
-rw-r--r--include/linux/coda_linux.h2
-rw-r--r--include/linux/compiler.h2
-rw-r--r--include/linux/configfs.h25
-rw-r--r--include/linux/connector.h2
-rw-r--r--include/linux/cpufreq.h3
-rw-r--r--include/linux/cpuset.h24
-rw-r--r--include/linux/crc32.h4
-rw-r--r--include/linux/crypto.h148
-rw-r--r--include/linux/dccp.h26
-rw-r--r--include/linux/debug_locks.h2
-rw-r--r--include/linux/device-mapper.h7
-rw-r--r--include/linux/device.h52
-rw-r--r--include/linux/dm-ioctl.h9
-rw-r--r--include/linux/dma-mapping.h29
-rw-r--r--include/linux/dmapool.h7
-rw-r--r--include/linux/efi.h2
-rw-r--r--include/linux/eisa.h10
-rw-r--r--include/linux/elevator.h3
-rw-r--r--include/linux/fault-inject.h84
-rw-r--r--include/linux/fb.h8
-rw-r--r--include/linux/file.h20
-rw-r--r--include/linux/freezer.h13
-rw-r--r--include/linux/fs.h31
-rw-r--r--include/linux/fs_stack.h31
-rw-r--r--include/linux/fsl_devices.h1
-rw-r--r--include/linux/fsnotify.h2
-rw-r--r--include/linux/futex.h2
-rw-r--r--include/linux/gameport.h2
-rw-r--r--include/linux/generic_serial.h2
-rw-r--r--include/linux/genhd.h4
-rw-r--r--include/linux/gfp.h2
-rw-r--r--include/linux/hdreg.h8
-rw-r--r--include/linux/hid-debug.h45
-rw-r--r--include/linux/hid.h521
-rw-r--r--include/linux/highmem.h9
-rw-r--r--include/linux/i2c-algo-bit.h5
-rw-r--r--include/linux/i2c-algo-ite.h72
-rw-r--r--include/linux/i2c-algo-pca.h1
-rw-r--r--include/linux/i2c-algo-pcf.h3
-rw-r--r--include/linux/i2c-algo-sgi.h1
-rw-r--r--include/linux/i2c-id.h22
-rw-r--r--include/linux/i2c-pnx.h43
-rw-r--r--include/linux/i2c.h75
-rw-r--r--include/linux/i2o-dev.h5
-rw-r--r--include/linux/ide.h32
-rw-r--r--include/linux/if_addr.h6
-rw-r--r--include/linux/if_fddi.h2
-rw-r--r--include/linux/if_link.h6
-rw-r--r--include/linux/if_packet.h10
-rw-r--r--include/linux/if_tunnel.h2
-rw-r--r--include/linux/init.h1
-rw-r--r--include/linux/init_task.h17
-rw-r--r--include/linux/input.h15
-rw-r--r--include/linux/interrupt.h9
-rw-r--r--include/linux/io.h21
-rw-r--r--include/linux/ioport.h23
-rw-r--r--include/linux/irq.h4
-rw-r--r--include/linux/isdn.h8
-rw-r--r--include/linux/istallion.h36
-rw-r--r--include/linux/kernel.h16
-rw-r--r--include/linux/kobject.h15
-rw-r--r--include/linux/kvm.h240
-rw-r--r--include/linux/libata.h141
-rw-r--r--include/linux/list.h10
-rw-r--r--include/linux/lockd/bind.h2
-rw-r--r--include/linux/lockd/lockd.h4
-rw-r--r--include/linux/lockd/sm_inter.h2
-rw-r--r--include/linux/lockd/xdr.h8
-rw-r--r--include/linux/lockdep.h16
-rw-r--r--include/linux/log2.h168
-rw-r--r--include/linux/magic.h1
-rw-r--r--include/linux/mm.h7
-rw-r--r--include/linux/mmc/card.h3
-rw-r--r--include/linux/mmc/host.h10
-rw-r--r--include/linux/mmc/mmc.h3
-rw-r--r--include/linux/mmc/protocol.h13
-rw-r--r--include/linux/mmzone.h8
-rw-r--r--include/linux/mnt_namespace.h42
-rw-r--r--include/linux/module.h10
-rw-r--r--include/linux/mount.h5
-rw-r--r--include/linux/msi.h5
-rw-r--r--include/linux/mtd/blktrans.h3
-rw-r--r--include/linux/mtd/mtd.h24
-rw-r--r--include/linux/mtd/nand.h15
-rw-r--r--include/linux/mtd/onenand.h8
-rw-r--r--include/linux/mtd/onenand_regs.h1
-rw-r--r--include/linux/mtio.h146
-rw-r--r--include/linux/mutex.h4
-rw-r--r--include/linux/n_r3964.h2
-rw-r--r--include/linux/namei.h5
-rw-r--r--include/linux/namespace.h42
-rw-r--r--include/linux/ncp_mount.h2
-rw-r--r--include/linux/net.h4
-rw-r--r--include/linux/netdevice.h19
-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.h6
-rw-r--r--include/linux/netfilter/xt_TCPMSS.h10
-rw-r--r--include/linux/netfilter_arp/arp_tables.h1
-rw-r--r--include/linux/netfilter_bridge.h1
-rw-r--r--include/linux/netfilter_ipv4.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_nat.h1
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h24
-rw-r--r--include/linux/netfilter_ipv4/ipt_TCPMSS.h7
-rw-r--r--include/linux/netfilter_ipv6.h2
-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/nfs_fs.h1
-rw-r--r--include/linux/nfsd/nfsd.h8
-rw-r--r--include/linux/nfsd/nfsfh.h15
-rw-r--r--include/linux/nfsd/state.h1
-rw-r--r--include/linux/nfsd/xdr.h4
-rw-r--r--include/linux/nfsd/xdr3.h8
-rw-r--r--include/linux/nfsd/xdr4.h40
-rw-r--r--include/linux/nsproxy.h6
-rw-r--r--include/linux/page-flags.h8
-rw-r--r--include/linux/pagemap.h2
-rw-r--r--include/linux/pci.h65
-rw-r--r--include/linux/pci_ids.h29
-rw-r--r--include/linux/pci_regs.h19
-rw-r--r--include/linux/pfkeyv2.h4
-rw-r--r--include/linux/pid.h5
-rw-r--r--include/linux/pid_namespace.h45
-rw-r--r--include/linux/pipe_fs_i.h5
-rw-r--r--include/linux/pktcdvd.h25
-rw-r--r--include/linux/platform_device.h2
-rw-r--r--include/linux/profile.h1
-rw-r--r--include/linux/pspace.h23
-rw-r--r--include/linux/qic117.h290
-rw-r--r--include/linux/raid/bitmap.h1
-rw-r--r--include/linux/raid/md.h2
-rw-r--r--include/linux/raid/raid5.h3
-rw-r--r--include/linux/reciprocal_div.h32
-rw-r--r--include/linux/reiserfs_fs.h44
-rw-r--r--include/linux/reiserfs_fs_i.h2
-rw-r--r--include/linux/rmap.h2
-rw-r--r--include/linux/rtc.h1
-rw-r--r--include/linux/rtmutex.h4
-rw-r--r--include/linux/rtnetlink.h2
-rw-r--r--include/linux/sched.h31
-rw-r--r--include/linux/sctp.h10
-rw-r--r--include/linux/seqlock.h7
-rw-r--r--include/linux/serial_core.h8
-rw-r--r--include/linux/serio.h5
-rw-r--r--include/linux/slab.h306
-rw-r--r--include/linux/slab_def.h100
-rw-r--r--include/linux/smb_fs_sb.h2
-rw-r--r--include/linux/socket.h4
-rw-r--r--include/linux/spi/spi.h2
-rw-r--r--include/linux/stallion.h52
-rw-r--r--include/linux/sunrpc/sched.h1
-rw-r--r--include/linux/sunrpc/svc.h5
-rw-r--r--include/linux/sunrpc/svcsock.h2
-rw-r--r--include/linux/swap.h2
-rw-r--r--include/linux/sysctl.h10
-rw-r--r--include/linux/sysdev.h12
-rw-r--r--include/linux/sysfs.h24
-rw-r--r--include/linux/sysrq.h22
-rw-r--r--include/linux/task_io_accounting.h37
-rw-r--r--include/linux/task_io_accounting_ops.h47
-rw-r--r--include/linux/taskstats.h28
-rw-r--r--include/linux/tc.h141
-rw-r--r--include/linux/tcp.h2
-rw-r--r--include/linux/tfrc.h8
-rw-r--r--include/linux/tifm.h35
-rw-r--r--include/linux/timer.h10
-rw-r--r--include/linux/topology.h5
-rw-r--r--include/linux/tty.h20
-rw-r--r--include/linux/tty_driver.h12
-rw-r--r--include/linux/tty_ldisc.h4
-rw-r--r--include/linux/ufs_fs.h1
-rw-r--r--include/linux/unwind.h63
-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.h7
-rw-r--r--include/linux/usb_gadgetfs.h2
-rw-r--r--include/linux/video_output.h42
-rw-r--r--include/linux/videodev2.h10
-rw-r--r--include/linux/vmstat.h11
-rw-r--r--include/linux/wanrouter.h8
-rw-r--r--include/linux/workqueue.h36
-rw-r--r--include/linux/xfrm.h21
-rw-r--r--include/media/cx2341x.h2
-rw-r--r--include/media/ir-common.h2
-rw-r--r--include/media/saa7146.h20
-rw-r--r--include/media/tuner-types.h4
-rw-r--r--include/media/tuner.h1
-rw-r--r--include/media/tveeprom.h2
-rw-r--r--include/media/v4l2-common.h7
-rw-r--r--include/media/v4l2-dev.h14
-rw-r--r--include/net/ax25.h48
-rw-r--r--include/net/bluetooth/hci.h4
-rw-r--r--include/net/ieee80211.h2
-rw-r--r--include/net/inet6_connection_sock.h2
-rw-r--r--include/net/inet_connection_sock.h3
-rw-r--r--include/net/inet_hashtables.h10
-rw-r--r--include/net/ip.h5
-rw-r--r--include/net/ip6_checksum.h2
-rw-r--r--include/net/ip6_fib.h4
-rw-r--r--include/net/irda/ircomm_tty.h2
-rw-r--r--include/net/iucv/af_iucv.h106
-rw-r--r--include/net/iucv/iucv.h415
-rw-r--r--include/net/neighbour.h18
-rw-r--r--include/net/netfilter/nf_conntrack.h2
-rw-r--r--include/net/netfilter/nf_conntrack_compat.h11
-rw-r--r--include/net/netfilter/nf_nat.h1
-rw-r--r--include/net/rose.h6
-rw-r--r--include/net/route.h5
-rw-r--r--include/net/sctp/sctp.h4
-rw-r--r--include/net/sctp/sm.h1
-rw-r--r--include/net/sctp/structs.h18
-rw-r--r--include/net/sctp/ulpevent.h2
-rw-r--r--include/net/sctp/user.h30
-rw-r--r--include/net/tcp.h12
-rw-r--r--include/net/x25.h19
-rw-r--r--include/net/xfrm.h47
-rw-r--r--include/pcmcia/ss.h2
-rw-r--r--include/rdma/ib_marshall.h5
-rw-r--r--include/rdma/ib_user_mad.h2
-rw-r--r--include/rdma/ib_verbs.h271
-rw-r--r--include/rdma/rdma_cm.h62
-rw-r--r--include/rdma/rdma_cm_ib.h3
-rw-r--r--include/rdma/rdma_user_cm.h206
-rw-r--r--include/scsi/iscsi_proto.h46
-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.h80
-rw-r--r--include/sound/emu10k1.h418
-rw-r--r--include/sound/pcm.h4
-rw-r--r--include/sound/pcm_oss.h1
-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.h11
-rw-r--r--include/video/mbxfb.h31
-rw-r--r--include/video/pm3fb.h24
-rw-r--r--include/video/sstfb.h13
700 files changed, 11438 insertions, 12105 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 9e6c23c360b2..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,
@@ -105,7 +105,7 @@
105 105
106/* Maximum object reference count (detects object deletion issues) */ 106/* Maximum object reference count (detects object deletion issues) */
107 107
108#define ACPI_MAX_REFERENCE_COUNT 0x800 108#define ACPI_MAX_REFERENCE_COUNT 0x1000
109 109
110/* Size of cached memory mapping for system memory operation region */ 110/* Size of cached memory mapping for system memory operation region */
111 111
@@ -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 049e9aa1b867..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,29 +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
100#ifdef ACPI_FUTURE_USAGE
101acpi_status acpi_load_table(struct acpi_table_header *table_ptr); 105acpi_status acpi_load_table(struct acpi_table_header *table_ptr);
102 106
103acpi_status acpi_unload_table(acpi_table_type table_type); 107acpi_status acpi_unload_table_id(acpi_owner_id id);
104 108
105acpi_status 109acpi_status
106acpi_get_table_header(acpi_table_type table_type, 110acpi_get_table_header(acpi_string signature,
107 u32 instance, struct acpi_table_header *out_table_header); 111 acpi_native_uint instance,
108#endif /* ACPI_FUTURE_USAGE */ 112 struct acpi_table_header *out_table_header);
109 113
110acpi_status 114acpi_status
111acpi_get_table(acpi_table_type table_type, 115acpi_get_table(acpi_string signature,
112 u32 instance, struct acpi_buffer *ret_buffer); 116 acpi_native_uint instance, struct acpi_table_header **out_table);
113 117
114acpi_status 118acpi_status
115acpi_get_firmware_table(acpi_string signature, 119acpi_get_table_by_index(acpi_native_uint table_index,
116 u32 instance, 120 struct acpi_table_header **out_table);
117 u32 flags, struct acpi_table_header **table_pointer);
118 121
119/* 122/*
120 * Namespace and name interfaces 123 * Namespace and name interfaces
@@ -180,6 +183,8 @@ acpi_get_next_object(acpi_object_type type,
180 183
181acpi_status acpi_get_type(acpi_handle object, acpi_object_type * out_type); 184acpi_status acpi_get_type(acpi_handle object, acpi_object_type * out_type);
182 185
186acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type);
187
183acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle); 188acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle);
184 189
185/* 190/*
@@ -307,9 +312,9 @@ acpi_resource_to_address64(struct acpi_resource *resource,
307/* 312/*
308 * Hardware (ACPI device) interfaces 313 * Hardware (ACPI device) interfaces
309 */ 314 */
310acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags); 315acpi_status acpi_get_register(u32 register_id, u32 * return_value);
311 316
312acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags); 317acpi_status acpi_set_register(u32 register_id, u32 value);
313 318
314acpi_status 319acpi_status
315acpi_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/cacheflush.h b/include/asm-alpha/cacheflush.h
index 805640b41078..b686cc7fc44e 100644
--- a/include/asm-alpha/cacheflush.h
+++ b/include/asm-alpha/cacheflush.h
@@ -6,6 +6,7 @@
6/* Caches aren't brain-dead on the Alpha. */ 6/* Caches aren't brain-dead on the Alpha. */
7#define flush_cache_all() do { } while (0) 7#define flush_cache_all() do { } while (0)
8#define flush_cache_mm(mm) do { } while (0) 8#define flush_cache_mm(mm) do { } while (0)
9#define flush_cache_dup_mm(mm) do { } while (0)
9#define flush_cache_range(vma, start, end) do { } while (0) 10#define flush_cache_range(vma, start, end) do { } while (0)
10#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 11#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
11#define flush_dcache_page(page) do { } while (0) 12#define flush_dcache_page(page) do { } while (0)
diff --git a/include/asm-alpha/dma-mapping.h b/include/asm-alpha/dma-mapping.h
index 57e09f5e3424..75a1aff5b57b 100644
--- a/include/asm-alpha/dma-mapping.h
+++ b/include/asm-alpha/dma-mapping.h
@@ -41,9 +41,9 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
41#define dma_map_single(dev, va, size, dir) virt_to_phys(va) 41#define dma_map_single(dev, va, size, dir) virt_to_phys(va)
42#define dma_map_page(dev, page, off, size, dir) (page_to_pa(page) + off) 42#define dma_map_page(dev, page, off, size, dir) (page_to_pa(page) + off)
43 43
44#define dma_unmap_single(dev, addr, size, dir) do { } while (0) 44#define dma_unmap_single(dev, addr, size, dir) ((void)0)
45#define dma_unmap_page(dev, addr, size, dir) do { } while (0) 45#define dma_unmap_page(dev, addr, size, dir) ((void)0)
46#define dma_unmap_sg(dev, sg, nents, dir) do { } while (0) 46#define dma_unmap_sg(dev, sg, nents, dir) ((void)0)
47 47
48#define dma_mapping_error(addr) (0) 48#define dma_mapping_error(addr) (0)
49 49
@@ -55,12 +55,14 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
55 55
56int dma_set_mask(struct device *dev, u64 mask); 56int dma_set_mask(struct device *dev, u64 mask);
57 57
58#define dma_sync_single_for_cpu(dev, addr, size, dir) do { } while (0) 58#define dma_sync_single_for_cpu(dev, addr, size, dir) ((void)0)
59#define dma_sync_single_for_device(dev, addr, size, dir) do { } while (0) 59#define dma_sync_single_for_device(dev, addr, size, dir) ((void)0)
60#define dma_sync_single_range(dev, addr, off, size, dir) do { } while (0) 60#define dma_sync_single_range(dev, addr, off, size, dir) ((void)0)
61#define dma_sync_sg_for_cpu(dev, sg, nents, dir) do { } while (0) 61#define dma_sync_sg_for_cpu(dev, sg, nents, dir) ((void)0)
62#define dma_sync_sg_for_device(dev, sg, nents, dir) do { } while (0) 62#define dma_sync_sg_for_device(dev, sg, nents, dir) ((void)0)
63#define dma_cache_sync(dev, va, size, dir) do { } while (0) 63#define dma_cache_sync(dev, va, size, dir) ((void)0)
64#define dma_sync_single_range_for_cpu(dev, addr, offset, size, dir) ((void)0)
65#define dma_sync_single_range_for_device(dev, addr, offset, size, dir) ((void)0)
64 66
65#define dma_get_cache_alignment() L1_CACHE_BYTES 67#define dma_get_cache_alignment() L1_CACHE_BYTES
66 68
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/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/posix_types.h b/include/asm-alpha/posix_types.h
index c78c04a94f4e..db167413300b 100644
--- a/include/asm-alpha/posix_types.h
+++ b/include/asm-alpha/posix_types.h
@@ -49,7 +49,7 @@ typedef unsigned int __kernel_old_dev_t;
49#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) 49#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
50#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) 50#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
51#define __FD_ZERO(set) \ 51#define __FD_ZERO(set) \
52 ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set))) 52 ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))
53 53
54#else /* __GNUC__ */ 54#else /* __GNUC__ */
55 55
diff --git a/include/asm-alpha/termbits.h b/include/asm-alpha/termbits.h
index 5541101b58ae..ad854a4a3af6 100644
--- a/include/asm-alpha/termbits.h
+++ b/include/asm-alpha/termbits.h
@@ -25,6 +25,19 @@ struct termios {
25 speed_t c_ospeed; /* output speed */ 25 speed_t c_ospeed; /* output speed */
26}; 26};
27 27
28/* Alpha has matching termios and ktermios */
29
30struct ktermios {
31 tcflag_t c_iflag; /* input mode flags */
32 tcflag_t c_oflag; /* output mode flags */
33 tcflag_t c_cflag; /* control mode flags */
34 tcflag_t c_lflag; /* local mode flags */
35 cc_t c_cc[NCCS]; /* control characters */
36 cc_t c_line; /* line discipline (== c_cc[19]) */
37 speed_t c_ispeed; /* input speed */
38 speed_t c_ospeed; /* output speed */
39};
40
28/* c_cc characters */ 41/* c_cc characters */
29#define VEOF 0 42#define VEOF 0
30#define VEOL 1 43#define VEOL 1
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index 84313d14e780..e58a427012dd 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -342,9 +342,14 @@
342#define __NR_io_cancel 402 342#define __NR_io_cancel 402
343#define __NR_exit_group 405 343#define __NR_exit_group 405
344#define __NR_lookup_dcookie 406 344#define __NR_lookup_dcookie 406
345#define __NR_sys_epoll_create 407 345#define __NR_epoll_create 407
346#define __NR_sys_epoll_ctl 408 346#define __NR_epoll_ctl 408
347#define __NR_sys_epoll_wait 409 347#define __NR_epoll_wait 409
348/* Feb 2007: These three sys_epoll defines shouldn't be here but culling
349 * them would break userspace apps ... we'll kill them off in 2010 :) */
350#define __NR_sys_epoll_create __NR_epoll_create
351#define __NR_sys_epoll_ctl __NR_epoll_ctl
352#define __NR_sys_epoll_wait __NR_epoll_wait
348#define __NR_remap_file_pages 410 353#define __NR_remap_file_pages 410
349#define __NR_set_tid_address 411 354#define __NR_set_tid_address 411
350#define __NR_restart_syscall 412 355#define __NR_restart_syscall 412
diff --git a/include/asm-arm/apm.h b/include/asm-arm/apm.h
deleted file mode 100644
index d09113b37e4a..000000000000
--- a/include/asm-arm/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 ARM_ASM_SA1100_APM_H
14#define ARM_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-arm/arch-at91rm9200/at91_ecc.h b/include/asm-arm/arch-at91rm9200/at91_ecc.h
index fddf256a98d3..5c564ede5c5d 100644
--- a/include/asm-arm/arch-at91rm9200/at91_ecc.h
+++ b/include/asm-arm/arch-at91rm9200/at91_ecc.h
@@ -14,7 +14,7 @@
14#define AT91_ECC_H 14#define AT91_ECC_H
15 15
16#define AT91_ECC_CR (AT91_ECC + 0x00) /* Control register */ 16#define AT91_ECC_CR (AT91_ECC + 0x00) /* Control register */
17#define AT91_ECC_RST (1 << 0) /* Reset parity */ 17#define AT91_ECC_RST (1 << 0) /* Reset parity */
18 18
19#define AT91_ECC_MR (AT91_ECC + 0x04) /* Mode register */ 19#define AT91_ECC_MR (AT91_ECC + 0x04) /* Mode register */
20#define AT91_ECC_PAGESIZE (3 << 0) /* Page Size */ 20#define AT91_ECC_PAGESIZE (3 << 0) /* Page Size */
@@ -23,16 +23,16 @@
23#define AT91_ECC_PAGESIZE_2112 (2) 23#define AT91_ECC_PAGESIZE_2112 (2)
24#define AT91_ECC_PAGESIZE_4224 (3) 24#define AT91_ECC_PAGESIZE_4224 (3)
25 25
26#define AT91_ECC_SR (AT91_ECC + 0x08) /* Status register */ 26#define AT91_ECC_SR (AT91_ECC + 0x08) /* Status register */
27#define AT91_ECC_RECERR (1 << 0) /* Recoverable Error */ 27#define AT91_ECC_RECERR (1 << 0) /* Recoverable Error */
28#define AT91_ECC_ECCERR (1 << 1) /* ECC Single Bit Error */ 28#define AT91_ECC_ECCERR (1 << 1) /* ECC Single Bit Error */
29#define AT91_ECC_MULERR (1 << 2) /* Multiple Errors */ 29#define AT91_ECC_MULERR (1 << 2) /* Multiple Errors */
30 30
31#define AT91_ECC_PR (AT91_ECC + 0x0c) /* Parity register */ 31#define AT91_ECC_PR (AT91_ECC + 0x0c) /* Parity register */
32#define AT91_ECC_BITADDR (0xf << 0) /* Bit Error Address */ 32#define AT91_ECC_BITADDR (0xf << 0) /* Bit Error Address */
33#define AT91_ECC_WORDADDR (0xfff << 4) /* Word Error Address */ 33#define AT91_ECC_WORDADDR (0xfff << 4) /* Word Error Address */
34 34
35#define AT91_ECC_NPR (AT91_ECC + 0x10) /* NParity register */ 35#define AT91_ECC_NPR (AT91_ECC + 0x10) /* NParity register */
36#define AT91_ECC_NPARITY (0xffff << 0) /* NParity */ 36#define AT91_ECC_NPARITY (0xffff << 0) /* NParity */
37 37
38#endif 38#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91_pmc.h b/include/asm-arm/arch-at91rm9200/at91_pmc.h
index de8c3da74a01..c3b489d09b6c 100644
--- a/include/asm-arm/arch-at91rm9200/at91_pmc.h
+++ b/include/asm-arm/arch-at91rm9200/at91_pmc.h
@@ -61,7 +61,7 @@
61#define AT91_PMC_CSS_PLLA (2 << 0) 61#define AT91_PMC_CSS_PLLA (2 << 0)
62#define AT91_PMC_CSS_PLLB (3 << 0) 62#define AT91_PMC_CSS_PLLB (3 << 0)
63#define AT91_PMC_PRES (7 << 2) /* Master Clock Prescaler */ 63#define AT91_PMC_PRES (7 << 2) /* Master Clock Prescaler */
64#define AT91_PMC_PRES_1 (0 << 2) 64#define AT91_PMC_PRES_1 (0 << 2)
65#define AT91_PMC_PRES_2 (1 << 2) 65#define AT91_PMC_PRES_2 (1 << 2)
66#define AT91_PMC_PRES_4 (2 << 2) 66#define AT91_PMC_PRES_4 (2 << 2)
67#define AT91_PMC_PRES_8 (3 << 2) 67#define AT91_PMC_PRES_8 (3 << 2)
diff --git a/include/asm-arm/arch-at91rm9200/at91_rstc.h b/include/asm-arm/arch-at91rm9200/at91_rstc.h
index ccdc52da973d..237d3c40b318 100644
--- a/include/asm-arm/arch-at91rm9200/at91_rstc.h
+++ b/include/asm-arm/arch-at91rm9200/at91_rstc.h
@@ -17,7 +17,7 @@
17#define AT91_RSTC_PROCRST (1 << 0) /* Processor Reset */ 17#define AT91_RSTC_PROCRST (1 << 0) /* Processor Reset */
18#define AT91_RSTC_PERRST (1 << 2) /* Peripheral Reset */ 18#define AT91_RSTC_PERRST (1 << 2) /* Peripheral Reset */
19#define AT91_RSTC_EXTRST (1 << 3) /* External Reset */ 19#define AT91_RSTC_EXTRST (1 << 3) /* External Reset */
20#define AT01_RSTC_KEY (0xff << 24) /* KEY Password */ 20#define AT91_RSTC_KEY (0xff << 24) /* KEY Password */
21 21
22#define AT91_RSTC_SR (AT91_RSTC + 0x04) /* Reset Controller Status Register */ 22#define AT91_RSTC_SR (AT91_RSTC + 0x04) /* Reset Controller Status Register */
23#define AT91_RSTC_URSTS (1 << 0) /* User Reset Status */ 23#define AT91_RSTC_URSTS (1 << 0) /* User Reset Status */
diff --git a/include/asm-arm/arch-at91rm9200/at91_rtc.h b/include/asm-arm/arch-at91rm9200/at91_rtc.h
index 6e5065d56260..095fe0883102 100644
--- a/include/asm-arm/arch-at91rm9200/at91_rtc.h
+++ b/include/asm-arm/arch-at91rm9200/at91_rtc.h
@@ -21,21 +21,21 @@
21#define AT91_RTC_UPDCAL (1 << 1) /* Update Request Calendar Register */ 21#define AT91_RTC_UPDCAL (1 << 1) /* Update Request Calendar Register */
22#define AT91_RTC_TIMEVSEL (3 << 8) /* Time Event Selection */ 22#define AT91_RTC_TIMEVSEL (3 << 8) /* Time Event Selection */
23#define AT91_RTC_TIMEVSEL_MINUTE (0 << 8) 23#define AT91_RTC_TIMEVSEL_MINUTE (0 << 8)
24#define AT91_RTC_TIMEVSEL_HOUR (1 << 8) 24#define AT91_RTC_TIMEVSEL_HOUR (1 << 8)
25#define AT91_RTC_TIMEVSEL_DAY24 (2 << 8) 25#define AT91_RTC_TIMEVSEL_DAY24 (2 << 8)
26#define AT91_RTC_TIMEVSEL_DAY12 (3 << 8) 26#define AT91_RTC_TIMEVSEL_DAY12 (3 << 8)
27#define AT91_RTC_CALEVSEL (3 << 16) /* Calendar Event Selection */ 27#define AT91_RTC_CALEVSEL (3 << 16) /* Calendar Event Selection */
28#define AT91_RTC_CALEVSEL_WEEK (0 << 16) 28#define AT91_RTC_CALEVSEL_WEEK (0 << 16)
29#define AT91_RTC_CALEVSEL_MONTH (1 << 16) 29#define AT91_RTC_CALEVSEL_MONTH (1 << 16)
30#define AT91_RTC_CALEVSEL_YEAR (2 << 16) 30#define AT91_RTC_CALEVSEL_YEAR (2 << 16)
31 31
32#define AT91_RTC_MR (AT91_RTC + 0x04) /* Mode Register */ 32#define AT91_RTC_MR (AT91_RTC + 0x04) /* Mode Register */
33#define AT91_RTC_HRMOD (1 << 0) /* 12/24 Hour Mode */ 33#define AT91_RTC_HRMOD (1 << 0) /* 12/24 Hour Mode */
34 34
35#define AT91_RTC_TIMR (AT91_RTC + 0x08) /* Time Register */ 35#define AT91_RTC_TIMR (AT91_RTC + 0x08) /* Time Register */
36#define AT91_RTC_SEC (0x7f << 0) /* Current Second */ 36#define AT91_RTC_SEC (0x7f << 0) /* Current Second */
37#define AT91_RTC_MIN (0x7f << 8) /* Current Minute */ 37#define AT91_RTC_MIN (0x7f << 8) /* Current Minute */
38#define AT91_RTC_HOUR (0x3f << 16) /* Current Hour */ 38#define AT91_RTC_HOUR (0x3f << 16) /* Current Hour */
39#define AT91_RTC_AMPM (1 << 22) /* Ante Meridiem Post Meridiem Indicator */ 39#define AT91_RTC_AMPM (1 << 22) /* Ante Meridiem Post Meridiem Indicator */
40 40
41#define AT91_RTC_CALR (AT91_RTC + 0x0c) /* Calendar Register */ 41#define AT91_RTC_CALR (AT91_RTC + 0x0c) /* Calendar Register */
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200.h b/include/asm-arm/arch-at91rm9200/at91rm9200.h
index 4d51177efddd..c569b6a21a42 100644
--- a/include/asm-arm/arch-at91rm9200/at91rm9200.h
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200.h
@@ -274,7 +274,7 @@
274#define AT91_PD19_TPK7 (1 << 19) /* B: ETM Trace Packet Port 7 */ 274#define AT91_PD19_TPK7 (1 << 19) /* B: ETM Trace Packet Port 7 */
275#define AT91_PD20_NPCS3 (1 << 20) /* A: SPI Peripheral Chip Select 3 */ 275#define AT91_PD20_NPCS3 (1 << 20) /* A: SPI Peripheral Chip Select 3 */
276#define AT91_PD20_TPK8 (1 << 20) /* B: ETM Trace Packet Port 8 */ 276#define AT91_PD20_TPK8 (1 << 20) /* B: ETM Trace Packet Port 8 */
277#define AT91_PD21_RTS0 (1 << 21) /* A: USART Ready To Send 0 */ 277#define AT91_PD21_RTS0 (1 << 21) /* A: USART Ready To Send 0 */
278#define AT91_PD21_TPK9 (1 << 21) /* B: ETM Trace Packet Port 9 */ 278#define AT91_PD21_TPK9 (1 << 21) /* B: ETM Trace Packet Port 9 */
279#define AT91_PD22_RTS1 (1 << 22) /* A: USART Ready To Send 1 */ 279#define AT91_PD22_RTS1 (1 << 22) /* A: USART Ready To Send 1 */
280#define AT91_PD22_TPK10 (1 << 22) /* B: ETM Trace Packet Port 10 */ 280#define AT91_PD22_TPK10 (1 << 22) /* B: ETM Trace Packet Port 10 */
diff --git a/include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h b/include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h
index 746d973705bf..78f6b4917b8b 100644
--- a/include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h
+++ b/include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h
@@ -58,7 +58,7 @@
58#define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ 58#define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
59 59
60#define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x11C) /* EBI Chip Select Assignment Register */ 60#define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x11C) /* EBI Chip Select Assignment Register */
61#define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */ 61#define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */
62#define AT91_MATRIX_CS1A_SMC (0 << 1) 62#define AT91_MATRIX_CS1A_SMC (0 << 1)
63#define AT91_MATRIX_CS1A_SDRAMC (1 << 1) 63#define AT91_MATRIX_CS1A_SDRAMC (1 << 1)
64#define AT91_MATRIX_CS3A (1 << 3) /* Chip Select 3 Assignment */ 64#define AT91_MATRIX_CS3A (1 << 3) /* Chip Select 3 Assignment */
diff --git a/include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h b/include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h
index 270a5dcdf1cd..ec88efabbe6c 100644
--- a/include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h
+++ b/include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h
@@ -15,7 +15,7 @@
15 15
16#define AT91_MATRIX_MCFG (AT91_MATRIX + 0x00) /* Master Configuration Register */ 16#define AT91_MATRIX_MCFG (AT91_MATRIX + 0x00) /* Master Configuration Register */
17#define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ 17#define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
18#define AT01_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ 18#define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
19 19
20#define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x04) /* Slave Configuration Register 0 */ 20#define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x04) /* Slave Configuration Register 0 */
21#define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x08) /* Slave Configuration Register 1 */ 21#define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x08) /* Slave Configuration Register 1 */
@@ -43,8 +43,8 @@
43 43
44#define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x30) /* EBI Chip Select Assignment Register */ 44#define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x30) /* EBI Chip Select Assignment Register */
45#define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */ 45#define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */
46#define AT91_MATRIX_CS1A_SMC (0 << 1) 46#define AT91_MATRIX_CS1A_SMC (0 << 1)
47#define AT91_MATRIX_CS1A_SDRAMC (1 << 1) 47#define AT91_MATRIX_CS1A_SDRAMC (1 << 1)
48#define AT91_MATRIX_CS3A (1 << 3) /* Chip Select 3 Assignment */ 48#define AT91_MATRIX_CS3A (1 << 3) /* Chip Select 3 Assignment */
49#define AT91_MATRIX_CS3A_SMC (0 << 3) 49#define AT91_MATRIX_CS3A_SMC (0 << 3)
50#define AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3) 50#define AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3)
diff --git a/include/asm-arm/arch-at91rm9200/at91sam926x_mc.h b/include/asm-arm/arch-at91rm9200/at91sam926x_mc.h
index 7d94968b5d57..972e7531c7f4 100644
--- a/include/asm-arm/arch-at91rm9200/at91sam926x_mc.h
+++ b/include/asm-arm/arch-at91rm9200/at91sam926x_mc.h
@@ -33,14 +33,14 @@
33#define AT91_SDRAMC_NC_9 (1 << 0) 33#define AT91_SDRAMC_NC_9 (1 << 0)
34#define AT91_SDRAMC_NC_10 (2 << 0) 34#define AT91_SDRAMC_NC_10 (2 << 0)
35#define AT91_SDRAMC_NC_11 (3 << 0) 35#define AT91_SDRAMC_NC_11 (3 << 0)
36#define AT91_SDRAMC_NR (3 << 2) /* Number of Row Bits */ 36#define AT91_SDRAMC_NR (3 << 2) /* Number of Row Bits */
37#define AT91_SDRAMC_NR_11 (0 << 2) 37#define AT91_SDRAMC_NR_11 (0 << 2)
38#define AT91_SDRAMC_NR_12 (1 << 2) 38#define AT91_SDRAMC_NR_12 (1 << 2)
39#define AT91_SDRAMC_NR_13 (2 << 2) 39#define AT91_SDRAMC_NR_13 (2 << 2)
40#define AT91_SDRAMC_NB (1 << 4) /* Number of Banks */ 40#define AT91_SDRAMC_NB (1 << 4) /* Number of Banks */
41#define AT91_SDRAMC_NB_2 (0 << 4) 41#define AT91_SDRAMC_NB_2 (0 << 4)
42#define AT91_SDRAMC_NB_4 (1 << 4) 42#define AT91_SDRAMC_NB_4 (1 << 4)
43#define AT91_SDRAMC_CAS (3 << 5) /* CAS Latency */ 43#define AT91_SDRAMC_CAS (3 << 5) /* CAS Latency */
44#define AT91_SDRAMC_CAS_1 (1 << 5) 44#define AT91_SDRAMC_CAS_1 (1 << 5)
45#define AT91_SDRAMC_CAS_2 (2 << 5) 45#define AT91_SDRAMC_CAS_2 (2 << 5)
46#define AT91_SDRAMC_CAS_3 (3 << 5) 46#define AT91_SDRAMC_CAS_3 (3 << 5)
@@ -110,10 +110,10 @@
110#define AT91_SMC_MODE(n) (AT91_SMC + 0x0c + ((n)*0x10)) /* Mode Register for CS n */ 110#define AT91_SMC_MODE(n) (AT91_SMC + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
111#define AT91_SMC_READMODE (1 << 0) /* Read Mode */ 111#define AT91_SMC_READMODE (1 << 0) /* Read Mode */
112#define AT91_SMC_WRITEMODE (1 << 1) /* Write Mode */ 112#define AT91_SMC_WRITEMODE (1 << 1) /* Write Mode */
113#define AT91_SMC_EXNWMODE (3 << 5) /* NWAIT Mode */ 113#define AT91_SMC_EXNWMODE (3 << 4) /* NWAIT Mode */
114#define AT91_SMC_EXNWMODE_DISABLE (0 << 5) 114#define AT91_SMC_EXNWMODE_DISABLE (0 << 4)
115#define AT91_SMC_EXNWMODE_FROZEN (2 << 5) 115#define AT91_SMC_EXNWMODE_FROZEN (2 << 4)
116#define AT91_SMC_EXNWMODE_READY (3 << 5) 116#define AT91_SMC_EXNWMODE_READY (3 << 4)
117#define AT91_SMC_BAT (1 << 8) /* Byte Access Type */ 117#define AT91_SMC_BAT (1 << 8) /* Byte Access Type */
118#define AT91_SMC_BAT_SELECT (0 << 8) 118#define AT91_SMC_BAT_SELECT (0 << 8)
119#define AT91_SMC_BAT_WRITE (1 << 8) 119#define AT91_SMC_BAT_WRITE (1 << 8)
diff --git a/include/asm-arm/arch-ep93xx/irqs.h b/include/asm-arm/arch-ep93xx/irqs.h
index 9a42f5de9e57..ae532e304bf1 100644
--- a/include/asm-arm/arch-ep93xx/irqs.h
+++ b/include/asm-arm/arch-ep93xx/irqs.h
@@ -22,9 +22,9 @@
22#define IRQ_EP93XX_DMAM2P9 16 22#define IRQ_EP93XX_DMAM2P9 16
23#define IRQ_EP93XX_DMAM2M0 17 23#define IRQ_EP93XX_DMAM2M0 17
24#define IRQ_EP93XX_DMAM2M1 18 24#define IRQ_EP93XX_DMAM2M1 18
25#define IRQ_EP93XX_GPIO0MUX 20 25#define IRQ_EP93XX_GPIO0MUX 19
26#define IRQ_EP93XX_GPIO1MUX 21 26#define IRQ_EP93XX_GPIO1MUX 20
27#define IRQ_EP93XX_GPIO2MUX 22 27#define IRQ_EP93XX_GPIO2MUX 21
28#define IRQ_EP93XX_GPIO3MUX 22 28#define IRQ_EP93XX_GPIO3MUX 22
29#define IRQ_EP93XX_UART1RX 23 29#define IRQ_EP93XX_UART1RX 23
30#define IRQ_EP93XX_UART1TX 24 30#define IRQ_EP93XX_UART1TX 24
diff --git a/include/asm-arm/arch-imx/imx-regs.h b/include/asm-arm/arch-imx/imx-regs.h
index a6912b3d8671..e56a4e247d62 100644
--- a/include/asm-arm/arch-imx/imx-regs.h
+++ b/include/asm-arm/arch-imx/imx-regs.h
@@ -41,7 +41,13 @@
41 41
42/* PLL registers */ 42/* PLL registers */
43#define CSCR __REG(IMX_PLL_BASE) /* Clock Source Control Register */ 43#define CSCR __REG(IMX_PLL_BASE) /* Clock Source Control Register */
44#define CSCR_SYSTEM_SEL (1<<16) 44#define CSCR_SPLL_RESTART (1<<22)
45#define CSCR_MPLL_RESTART (1<<21)
46#define CSCR_SYSTEM_SEL (1<<16)
47#define CSCR_BCLK_DIV (0xf<<10)
48#define CSCR_MPU_PRESC (1<<15)
49#define CSCR_SPEN (1<<1)
50#define CSCR_MPEN (1<<0)
45 51
46#define MPCTL0 __REG(IMX_PLL_BASE + 0x4) /* MCU PLL Control Register 0 */ 52#define MPCTL0 __REG(IMX_PLL_BASE + 0x4) /* MCU PLL Control Register 0 */
47#define MPCTL1 __REG(IMX_PLL_BASE + 0x8) /* MCU PLL and System Clock Register 1 */ 53#define MPCTL1 __REG(IMX_PLL_BASE + 0x8) /* MCU PLL and System Clock Register 1 */
@@ -49,8 +55,6 @@
49#define SPCTL1 __REG(IMX_PLL_BASE + 0x10) /* System PLL Control Register 1 */ 55#define SPCTL1 __REG(IMX_PLL_BASE + 0x10) /* System PLL Control Register 1 */
50#define PCDR __REG(IMX_PLL_BASE + 0x20) /* Peripheral Clock Divider Register */ 56#define PCDR __REG(IMX_PLL_BASE + 0x20) /* Peripheral Clock Divider Register */
51 57
52#define CSCR_MPLL_RESTART (1<<21)
53
54/* 58/*
55 * GPIO Module and I/O Multiplexer 59 * GPIO Module and I/O Multiplexer
56 * x = 0..3 for reg_A, reg_B, reg_C, reg_D 60 * x = 0..3 for reg_A, reg_B, reg_C, reg_D
diff --git a/include/asm-arm/arch-iop13xx/io.h b/include/asm-arm/arch-iop13xx/io.h
index db6de2480a24..5a7bdb526606 100644
--- a/include/asm-arm/arch-iop13xx/io.h
+++ b/include/asm-arm/arch-iop13xx/io.h
@@ -21,10 +21,11 @@
21 21
22#define IO_SPACE_LIMIT 0xffffffff 22#define IO_SPACE_LIMIT 0xffffffff
23 23
24#define __io(a) (a) 24#define __io(a) __iop13xx_io(a)
25#define __mem_pci(a) (a) 25#define __mem_pci(a) (a)
26#define __mem_isa(a) (a) 26#define __mem_isa(a) (a)
27 27
28extern void __iomem * __iop13xx_io(unsigned long io_addr);
28extern void __iomem * __ioremap(unsigned long, size_t, unsigned long); 29extern void __iomem * __ioremap(unsigned long, size_t, unsigned long);
29extern void __iomem *__iop13xx_ioremap(unsigned long cookie, size_t size, 30extern void __iomem *__iop13xx_ioremap(unsigned long cookie, size_t size,
30 unsigned long flags); 31 unsigned long flags);
diff --git a/include/asm-arm/arch-iop13xx/iq81340.h b/include/asm-arm/arch-iop13xx/iq81340.h
index b98f8f109c22..ba2cf931e9ce 100644
--- a/include/asm-arm/arch-iop13xx/iq81340.h
+++ b/include/asm-arm/arch-iop13xx/iq81340.h
@@ -24,8 +24,5 @@
24#define PBI_CF_IDE_BASE (IQ81340_CMP_FLSH) 24#define PBI_CF_IDE_BASE (IQ81340_CMP_FLSH)
25#define PBI_CF_BAR_ADDR (IOP13XX_PBI_BAR1) 25#define PBI_CF_BAR_ADDR (IOP13XX_PBI_BAR1)
26 26
27/* These are the values used in the Machine description */ 27
28#define PHYS_IO 0xfeffff00
29#define IO_PG_OFFSET 0xffffff00
30#define BOOT_PARAM_OFFSET 0x00000100
31#endif /* _IQ81340_H_ */ 28#endif /* _IQ81340_H_ */
diff --git a/include/asm-arm/arch-iop32x/iop32x.h b/include/asm-arm/arch-iop32x/iop32x.h
index 4bbd85f3ed2a..2e9469047eb1 100644
--- a/include/asm-arm/arch-iop32x/iop32x.h
+++ b/include/asm-arm/arch-iop32x/iop32x.h
@@ -19,7 +19,7 @@
19 * Peripherals that are shared between the iop32x and iop33x but 19 * Peripherals that are shared between the iop32x and iop33x but
20 * located at different addresses. 20 * located at different addresses.
21 */ 21 */
22#define IOP3XX_GPIO_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07c0 + (reg)) 22#define IOP3XX_GPIO_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07c4 + (reg))
23#define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07e0 + (reg)) 23#define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07e0 + (reg))
24 24
25#include <asm/hardware/iop3xx.h> 25#include <asm/hardware/iop3xx.h>
diff --git a/include/asm-arm/arch-ixp23xx/memory.h b/include/asm-arm/arch-ixp23xx/memory.h
index c85fc06a043c..6d859d742d7f 100644
--- a/include/asm-arm/arch-ixp23xx/memory.h
+++ b/include/asm-arm/arch-ixp23xx/memory.h
@@ -41,21 +41,7 @@
41 data = *((volatile int *)IXP23XX_PCI_SDRAM_BAR); \ 41 data = *((volatile int *)IXP23XX_PCI_SDRAM_BAR); \
42 __phys_to_virt((((b - (data & 0xfffffff0)) + 0x00000000))); }) 42 __phys_to_virt((((b - (data & 0xfffffff0)) + 0x00000000))); })
43 43
44/* 44#define arch_is_coherent() 1
45 * Coherency support. Only supported on A2 CPUs or on A1
46 * systems that have the cache coherency workaround.
47 */
48static inline int __ixp23xx_arch_is_coherent(void)
49{
50 extern unsigned int processor_id;
51
52 if (((processor_id & 15) >= 4) || machine_is_roadrunner())
53 return 1;
54
55 return 0;
56}
57
58#define arch_is_coherent() __ixp23xx_arch_is_coherent()
59 45
60#endif 46#endif
61 47
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-pnx4008/i2c.h b/include/asm-arm/arch-pnx4008/i2c.h
new file mode 100644
index 000000000000..92e8d65006f7
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/i2c.h
@@ -0,0 +1,67 @@
1/*
2 * PNX4008-specific tweaks for I2C IP3204 block
3 *
4 * Author: Vitaly Wool <vwool@ru.mvista.com>
5 *
6 * 2005 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#ifndef __ASM_ARCH_I2C_H__
13#define __ASM_ARCH_I2C_H__
14
15#include <linux/pm.h>
16#include <linux/platform_device.h>
17
18enum {
19 mstatus_tdi = 0x00000001,
20 mstatus_afi = 0x00000002,
21 mstatus_nai = 0x00000004,
22 mstatus_drmi = 0x00000008,
23 mstatus_active = 0x00000020,
24 mstatus_scl = 0x00000040,
25 mstatus_sda = 0x00000080,
26 mstatus_rff = 0x00000100,
27 mstatus_rfe = 0x00000200,
28 mstatus_tff = 0x00000400,
29 mstatus_tfe = 0x00000800,
30};
31
32enum {
33 mcntrl_tdie = 0x00000001,
34 mcntrl_afie = 0x00000002,
35 mcntrl_naie = 0x00000004,
36 mcntrl_drmie = 0x00000008,
37 mcntrl_daie = 0x00000020,
38 mcntrl_rffie = 0x00000040,
39 mcntrl_tffie = 0x00000080,
40 mcntrl_reset = 0x00000100,
41 mcntrl_cdbmode = 0x00000400,
42};
43
44enum {
45 rw_bit = 1 << 0,
46 start_bit = 1 << 8,
47 stop_bit = 1 << 9,
48};
49
50#define I2C_REG_RX(a) ((a)->ioaddr) /* Rx FIFO reg (RO) */
51#define I2C_REG_TX(a) ((a)->ioaddr) /* Tx FIFO reg (WO) */
52#define I2C_REG_STS(a) ((a)->ioaddr + 0x04) /* Status reg (RO) */
53#define I2C_REG_CTL(a) ((a)->ioaddr + 0x08) /* Ctl reg */
54#define I2C_REG_CKL(a) ((a)->ioaddr + 0x0c) /* Clock divider low */
55#define I2C_REG_CKH(a) ((a)->ioaddr + 0x10) /* Clock divider high */
56#define I2C_REG_ADR(a) ((a)->ioaddr + 0x14) /* I2C address */
57#define I2C_REG_RFL(a) ((a)->ioaddr + 0x18) /* Rx FIFO level (RO) */
58#define I2C_REG_TFL(a) ((a)->ioaddr + 0x1c) /* Tx FIFO level (RO) */
59#define I2C_REG_RXB(a) ((a)->ioaddr + 0x20) /* Num of bytes Rx-ed (RO) */
60#define I2C_REG_TXB(a) ((a)->ioaddr + 0x24) /* Num of bytes Tx-ed (RO) */
61#define I2C_REG_TXS(a) ((a)->ioaddr + 0x28) /* Tx slave FIFO (RO) */
62#define I2C_REG_STFL(a) ((a)->ioaddr + 0x2c) /* Tx slave FIFO level (RO) */
63
64#define HCLK_MHZ 13
65#define I2C_CHIP_NAME "PNX4008-I2C"
66
67#endif /* __ASM_ARCH_I2C_H___ */
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index 083e03c5639f..e24f6b6c79ae 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1626,7 +1626,7 @@
1626#define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */ 1626#define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */
1627#define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */ 1627#define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */
1628#define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */ 1628#define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */
1629#define SSCR0_SlotsPerFrm(x) ((x) - 1) /* Time slots per frame [1..8] */ 1629#define SSCR0_SlotsPerFrm(x) (((x) - 1) << 24) /* Time slots per frame [1..8] */
1630#define SSCR0_ADC (1 << 30) /* Audio clock select */ 1630#define SSCR0_ADC (1 << 30) /* Audio clock select */
1631#define SSCR0_MOD (1 << 31) /* Mode (normal or network) */ 1631#define SSCR0_MOD (1 << 31) /* Mode (normal or network) */
1632#endif 1632#endif
@@ -1655,6 +1655,7 @@
1655#define SSCR0_EDSS (1 << 20) /* Extended Data Size Select */ 1655#define SSCR0_EDSS (1 << 20) /* Extended Data Size Select */
1656 1656
1657/* extra bits in PXA255, PXA26x and PXA27x SSP ports */ 1657/* extra bits in PXA255, PXA26x and PXA27x SSP ports */
1658#define SSCR0_TISSP (1 << 4) /* TI Sync Serial Protocol */
1658#define SSCR0_PSP (3 << 4) /* PSP - Programmable Serial Protocol */ 1659#define SSCR0_PSP (3 << 4) /* PSP - Programmable Serial Protocol */
1659#define SSCR1_TTELP (1 << 31) /* TXD Tristate Enable Last Phase */ 1660#define SSCR1_TTELP (1 << 31) /* TXD Tristate Enable Last Phase */
1660#define SSCR1_TTE (1 << 30) /* TXD Tristate Enable */ 1661#define SSCR1_TTE (1 << 30) /* TXD Tristate Enable */
diff --git a/include/asm-arm/arch-pxa/pxa2xx_spi.h b/include/asm-arm/arch-pxa/pxa2xx_spi.h
index 915590c391c8..acc7ec7a84a1 100644
--- a/include/asm-arm/arch-pxa/pxa2xx_spi.h
+++ b/include/asm-arm/arch-pxa/pxa2xx_spi.h
@@ -27,16 +27,13 @@
27#define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/2/(x+1))<<8)&0x0000ff00) 27#define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/2/(x+1))<<8)&0x0000ff00)
28#define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) 28#define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00)
29#define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) 29#define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00)
30#define SSP_TIMEOUT_SCALE (2712)
31#elif defined(CONFIG_PXA27x) 30#elif defined(CONFIG_PXA27x)
32#define CLOCK_SPEED_HZ 13000000 31#define CLOCK_SPEED_HZ 13000000
33#define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) 32#define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00)
34#define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) 33#define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00)
35#define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) 34#define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00)
36#define SSP_TIMEOUT_SCALE (769)
37#endif 35#endif
38 36
39#define SSP_TIMEOUT(x) ((x*10000)/SSP_TIMEOUT_SCALE)
40#define SSP1_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(1))))) 37#define SSP1_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(1)))))
41#define SSP2_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(2))))) 38#define SSP2_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(2)))))
42#define SSP3_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(3))))) 39#define SSP3_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(3)))))
@@ -63,7 +60,7 @@ struct pxa2xx_spi_chip {
63 u8 tx_threshold; 60 u8 tx_threshold;
64 u8 rx_threshold; 61 u8 rx_threshold;
65 u8 dma_burst_size; 62 u8 dma_burst_size;
66 u32 timeout_microsecs; 63 u32 timeout;
67 u8 enable_loopback; 64 u8 enable_loopback;
68 void (*cs_control)(u32 command); 65 void (*cs_control)(u32 command);
69}; 66};
diff --git a/include/asm-arm/arch-s3c2410/anubis-cpld.h b/include/asm-arm/arch-s3c2410/anubis-cpld.h
index 40e8e270d337..dcebf6d61903 100644
--- a/include/asm-arm/arch-s3c2410/anubis-cpld.h
+++ b/include/asm-arm/arch-s3c2410/anubis-cpld.h
@@ -1,6 +1,6 @@
1/* linux/include/asm-arm/arch-s3c2410/anubis-cpld.h 1/* linux/include/asm-arm/arch-s3c2410/anubis-cpld.h
2 * 2 *
3 * (c) 2005 Simtec Electronics 3 * Copyright (c) 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/ 4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/include/asm-arm/arch-s3c2410/anubis-irq.h b/include/asm-arm/arch-s3c2410/anubis-irq.h
index 4b5f423779df..cd77a70d45c0 100644
--- a/include/asm-arm/arch-s3c2410/anubis-irq.h
+++ b/include/asm-arm/arch-s3c2410/anubis-irq.h
@@ -1,6 +1,6 @@
1/* linux/include/asm-arm/arch-s3c2410/anubis-irq.h 1/* linux/include/asm-arm/arch-s3c2410/anubis-irq.h
2 * 2 *
3 * (c) 2005 Simtec Electronics 3 * Copyright (c) 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/ 4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/include/asm-arm/arch-s3c2410/anubis-map.h b/include/asm-arm/arch-s3c2410/anubis-map.h
index 058a2104b035..ab076de4a0d0 100644
--- a/include/asm-arm/arch-s3c2410/anubis-map.h
+++ b/include/asm-arm/arch-s3c2410/anubis-map.h
@@ -1,6 +1,6 @@
1/* linux/include/asm-arm/arch-s3c2410/anubis-map.h 1/* linux/include/asm-arm/arch-s3c2410/anubis-map.h
2 * 2 *
3 * (c) 2005 Simtec Electronics 3 * Copyright (c) 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/ 4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/include/asm-arm/arch-s3c2410/audio.h b/include/asm-arm/arch-s3c2410/audio.h
index 7e0222276c98..65e0acffa1ad 100644
--- a/include/asm-arm/arch-s3c2410/audio.h
+++ b/include/asm-arm/arch-s3c2410/audio.h
@@ -1,6 +1,6 @@
1/* linux/include/asm-arm/arch-s3c2410/audio.h 1/* linux/include/asm-arm/arch-s3c2410/audio.h
2 * 2 *
3 * (c) 2004-2005 Simtec Electronics 3 * Copyright (c) 2004-2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/include/asm-arm/arch-s3c2410/bast-cpld.h b/include/asm-arm/arch-s3c2410/bast-cpld.h
index 8969cffe83fa..034d2c5a47c4 100644
--- a/include/asm-arm/arch-s3c2410/bast-cpld.h
+++ b/include/asm-arm/arch-s3c2410/bast-cpld.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/bast-cpld.h 1/* linux/include/asm-arm/arch-s3c2410/bast-cpld.h
2 * 2 *
3 * (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * BAST - CPLD control constants 6 * BAST - CPLD control constants
7 * 7 *
diff --git a/include/asm-arm/arch-s3c2410/bast-irq.h b/include/asm-arm/arch-s3c2410/bast-irq.h
index 15ffa66f5011..726c0466f85a 100644
--- a/include/asm-arm/arch-s3c2410/bast-irq.h
+++ b/include/asm-arm/arch-s3c2410/bast-irq.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/bast-irq.h 1/* linux/include/asm-arm/arch-s3c2410/bast-irq.h
2 * 2 *
3 * (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Machine BAST - IRQ Number definitions 6 * Machine BAST - IRQ Number definitions
7 * 7 *
diff --git a/include/asm-arm/arch-s3c2410/bast-map.h b/include/asm-arm/arch-s3c2410/bast-map.h
index 727cef84c70e..86ac1c108db8 100644
--- a/include/asm-arm/arch-s3c2410/bast-map.h
+++ b/include/asm-arm/arch-s3c2410/bast-map.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/bast-map.h 1/* linux/include/asm-arm/arch-s3c2410/bast-map.h
2 * 2 *
3 * (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Machine BAST - Memory map definitions 6 * Machine BAST - Memory map definitions
7 * 7 *
diff --git a/include/asm-arm/arch-s3c2410/bast-pmu.h b/include/asm-arm/arch-s3c2410/bast-pmu.h
index 82836027f00f..37a11fe54a78 100644
--- a/include/asm-arm/arch-s3c2410/bast-pmu.h
+++ b/include/asm-arm/arch-s3c2410/bast-pmu.h
@@ -1,6 +1,6 @@
1/* linux/include/asm-arm/arch-s3c2410/bast-pmu.h 1/* linux/include/asm-arm/arch-s3c2410/bast-pmu.h
2 * 2 *
3 * (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * Vincent Sanders <vince@simtec.co.uk> 5 * Vincent Sanders <vince@simtec.co.uk>
6 * 6 *
diff --git a/include/asm-arm/arch-s3c2410/dma.h b/include/asm-arm/arch-s3c2410/dma.h
index 7ac224836971..58ffa7ba3c88 100644
--- a/include/asm-arm/arch-s3c2410/dma.h
+++ b/include/asm-arm/arch-s3c2410/dma.h
@@ -14,7 +14,7 @@
14#define __ASM_ARCH_DMA_H __FILE__ 14#define __ASM_ARCH_DMA_H __FILE__
15 15
16#include <linux/sysdev.h> 16#include <linux/sysdev.h>
17#include "hardware.h" 17#include <asm/hardware.h>
18 18
19/* 19/*
20 * This is the maximum DMA address(physical address) that can be DMAd to. 20 * This is the maximum DMA address(physical address) that can be DMAd to.
diff --git a/include/asm-arm/arch-s3c2410/entry-macro.S b/include/asm-arm/arch-s3c2410/entry-macro.S
index e09a6b8ec153..1eb4e6b8d249 100644
--- a/include/asm-arm/arch-s3c2410/entry-macro.S
+++ b/include/asm-arm/arch-s3c2410/entry-macro.S
@@ -20,7 +20,7 @@
20#define INTOFFSET (0x14) 20#define INTOFFSET (0x14)
21 21
22#include <asm/hardware.h> 22#include <asm/hardware.h>
23#include <asm/arch/irqs.h> 23#include <asm/irq.h>
24 24
25 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 25 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
26 26
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h
index 90894214cace..93a58e7862b0 100644
--- a/include/asm-arm/arch-s3c2410/fb.h
+++ b/include/asm-arm/arch-s3c2410/fb.h
@@ -31,6 +31,9 @@ struct s3c2410fb_hw {
31struct s3c2410fb_mach_info { 31struct s3c2410fb_mach_info {
32 unsigned char fixed_syncs; /* do not update sync/border */ 32 unsigned char fixed_syncs; /* do not update sync/border */
33 33
34 /* LCD types */
35 int type;
36
34 /* Screen size */ 37 /* Screen size */
35 int width; 38 int width;
36 int height; 39 int height;
diff --git a/include/asm-arm/arch-s3c2410/h1940-latch.h b/include/asm-arm/arch-s3c2410/h1940-latch.h
index c5802411f43d..c3de5ab102eb 100644
--- a/include/asm-arm/arch-s3c2410/h1940-latch.h
+++ b/include/asm-arm/arch-s3c2410/h1940-latch.h
@@ -1,6 +1,6 @@
1/* linux/include/asm-arm/arch-s3c2410/h1940-latch.h 1/* linux/include/asm-arm/arch-s3c2410/h1940-latch.h
2 * 2 *
3 * (c) 2005 Simtec Electronics 3 * Copyright (c) 2005 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
@@ -16,7 +16,7 @@
16 16
17 17
18#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
19#define H1940_LATCH ((void __iomem *)0xF8000000) 19#define H1940_LATCH ((void __force __iomem *)0xF8000000)
20#else 20#else
21#define H1940_LATCH 0xF8000000 21#define H1940_LATCH 0xF8000000
22#endif 22#endif
diff --git a/include/asm-arm/arch-s3c2410/hardware.h b/include/asm-arm/arch-s3c2410/hardware.h
index 871f8af09b8b..6dadf58ff984 100644
--- a/include/asm-arm/arch-s3c2410/hardware.h
+++ b/include/asm-arm/arch-s3c2410/hardware.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/hardware.h 1/* linux/include/asm-arm/arch-s3c2410/hardware.h
2 * 2 *
3 * (c) 2003 Simtec Electronics 3 * Copyright (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - hardware 6 * S3C2410 - hardware
7 * 7 *
@@ -13,6 +13,10 @@
13#ifndef __ASM_ARCH_HARDWARE_H 13#ifndef __ASM_ARCH_HARDWARE_H
14#define __ASM_ARCH_HARDWARE_H 14#define __ASM_ARCH_HARDWARE_H
15 15
16#ifndef __ASM_HARDWARE_H
17#error "Do not include this directly, instead #include <asm/hardware.h>"
18#endif
19
16#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
17 21
18/* external functions for GPIO support 22/* external functions for GPIO support
diff --git a/include/asm-arm/arch-s3c2410/iic.h b/include/asm-arm/arch-s3c2410/iic.h
index ed3d6c7bf6d7..71211c8b5384 100644
--- a/include/asm-arm/arch-s3c2410/iic.h
+++ b/include/asm-arm/arch-s3c2410/iic.h
@@ -1,6 +1,6 @@
1/* linux/include/asm-arm/arch-s3c2410/iic.h 1/* linux/include/asm-arm/arch-s3c2410/iic.h
2 * 2 *
3 * (c) 2004 Simtec Electronics 3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - I2C Controller platfrom_device info 6 * S3C2410 - I2C Controller platfrom_device info
diff --git a/include/asm-arm/arch-s3c2410/irqs.h b/include/asm-arm/arch-s3c2410/irqs.h
index 39a69829d163..4b7cff456c4e 100644
--- a/include/asm-arm/arch-s3c2410/irqs.h
+++ b/include/asm-arm/arch-s3c2410/irqs.h
@@ -12,6 +12,9 @@
12#ifndef __ASM_ARCH_IRQS_H 12#ifndef __ASM_ARCH_IRQS_H
13#define __ASM_ARCH_IRQS_H __FILE__ 13#define __ASM_ARCH_IRQS_H __FILE__
14 14
15#ifndef __ASM_ARM_IRQ_H
16#error "Do not include this directly, instead #include <asm/irq.h>"
17#endif
15 18
16/* we keep the first set of CPU IRQs out of the range of 19/* we keep the first set of CPU IRQs out of the range of
17 * the ISA space, so that the PC104 has them to itself 20 * the ISA space, so that the PC104 has them to itself
diff --git a/include/asm-arm/arch-s3c2410/leds-gpio.h b/include/asm-arm/arch-s3c2410/leds-gpio.h
index f07ed040622b..800846ebddba 100644
--- a/include/asm-arm/arch-s3c2410/leds-gpio.h
+++ b/include/asm-arm/arch-s3c2410/leds-gpio.h
@@ -1,6 +1,6 @@
1/* linux/include/asm-arm/arch-s3c2410/leds-gpio.h 1/* linux/include/asm-arm/arch-s3c2410/leds-gpio.h
2 * 2 *
3 * (c) 2006 Simtec Electronics 3 * Copyright (c) 2006 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h
index 7895042d176b..4505aefbad17 100644
--- a/include/asm-arm/arch-s3c2410/map.h
+++ b/include/asm-arm/arch-s3c2410/map.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/map.h 1/* linux/include/asm-arm/arch-s3c2410/map.h
2 * 2 *
3 * (c) 2003 Simtec Electronics 3 * Copyright (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - Memory map definitions 6 * S3C2410 - Memory map definitions
7 * 7 *
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#ifndef __ASSEMBLY__ 27#ifndef __ASSEMBLY__
28#define S3C2410_ADDR(x) ((void __iomem *)0xF0000000 + (x)) 28#define S3C2410_ADDR(x) ((void __iomem __force *)0xF0000000 + (x))
29#else 29#else
30#define S3C2410_ADDR(x) (0xF0000000 + (x)) 30#define S3C2410_ADDR(x) (0xF0000000 + (x))
31#endif 31#endif
@@ -47,73 +47,65 @@
47#define S3C24XX_SZ_MEMCTRL SZ_1M 47#define S3C24XX_SZ_MEMCTRL SZ_1M
48 48
49/* USB host controller */ 49/* USB host controller */
50#define S3C24XX_VA_USBHOST S3C2410_ADDR(0x00200000)
51#define S3C2400_PA_USBHOST (0x14200000) 50#define S3C2400_PA_USBHOST (0x14200000)
52#define S3C2410_PA_USBHOST (0x49000000) 51#define S3C2410_PA_USBHOST (0x49000000)
53#define S3C24XX_SZ_USBHOST SZ_1M 52#define S3C24XX_SZ_USBHOST SZ_1M
54 53
55/* DMA controller */ 54/* DMA controller */
56#define S3C24XX_VA_DMA S3C2410_ADDR(0x00300000)
57#define S3C2400_PA_DMA (0x14600000) 55#define S3C2400_PA_DMA (0x14600000)
58#define S3C2410_PA_DMA (0x4B000000) 56#define S3C2410_PA_DMA (0x4B000000)
59#define S3C24XX_SZ_DMA SZ_1M 57#define S3C24XX_SZ_DMA SZ_1M
60 58
61/* Clock and Power management */ 59/* Clock and Power management */
62#define S3C24XX_VA_CLKPWR S3C2410_ADDR(0x00400000) 60#define S3C24XX_VA_CLKPWR S3C2410_ADDR(0x00200000)
63#define S3C2400_PA_CLKPWR (0x14800000) 61#define S3C2400_PA_CLKPWR (0x14800000)
64#define S3C2410_PA_CLKPWR (0x4C000000) 62#define S3C2410_PA_CLKPWR (0x4C000000)
65#define S3C24XX_SZ_CLKPWR SZ_1M 63#define S3C24XX_SZ_CLKPWR SZ_1M
66 64
67/* LCD controller */ 65/* LCD controller */
68#define S3C24XX_VA_LCD S3C2410_ADDR(0x00600000) 66#define S3C24XX_VA_LCD S3C2410_ADDR(0x00300000)
69#define S3C2400_PA_LCD (0x14A00000) 67#define S3C2400_PA_LCD (0x14A00000)
70#define S3C2410_PA_LCD (0x4D000000) 68#define S3C2410_PA_LCD (0x4D000000)
71#define S3C24XX_SZ_LCD SZ_1M 69#define S3C24XX_SZ_LCD SZ_1M
72 70
73/* NAND flash controller */ 71/* NAND flash controller */
74#define S3C24XX_VA_NAND S3C2410_ADDR(0x00700000)
75#define S3C2410_PA_NAND (0x4E000000) 72#define S3C2410_PA_NAND (0x4E000000)
76#define S3C24XX_SZ_NAND SZ_1M 73#define S3C24XX_SZ_NAND SZ_1M
77 74
78/* MMC controller - available on the S3C2400 */ 75/* MMC controller - available on the S3C2400 */
79#define S3C2400_VA_MMC S3C2400_ADDR(0x00700000)
80#define S3C2400_PA_MMC (0x15A00000) 76#define S3C2400_PA_MMC (0x15A00000)
81#define S3C2400_SZ_MMC SZ_1M 77#define S3C2400_SZ_MMC SZ_1M
82 78
83/* UARTs */ 79/* UARTs */
84#define S3C24XX_VA_UART S3C2410_ADDR(0x00800000) 80#define S3C24XX_VA_UART S3C2410_ADDR(0x00400000)
85#define S3C2400_PA_UART (0x15000000) 81#define S3C2400_PA_UART (0x15000000)
86#define S3C2410_PA_UART (0x50000000) 82#define S3C2410_PA_UART (0x50000000)
87#define S3C24XX_SZ_UART SZ_1M 83#define S3C24XX_SZ_UART SZ_1M
88 84
89/* Timers */ 85/* Timers */
90#define S3C24XX_VA_TIMER S3C2410_ADDR(0x00900000) 86#define S3C24XX_VA_TIMER S3C2410_ADDR(0x00500000)
91#define S3C2400_PA_TIMER (0x15100000) 87#define S3C2400_PA_TIMER (0x15100000)
92#define S3C2410_PA_TIMER (0x51000000) 88#define S3C2410_PA_TIMER (0x51000000)
93#define S3C24XX_SZ_TIMER SZ_1M 89#define S3C24XX_SZ_TIMER SZ_1M
94 90
95/* USB Device port */ 91/* USB Device port */
96#define S3C24XX_VA_USBDEV S3C2410_ADDR(0x00A00000) 92#define S3C24XX_VA_USBDEV S3C2410_ADDR(0x00600000)
97#define S3C2400_PA_USBDEV (0x15200140) 93#define S3C2400_PA_USBDEV (0x15200140)
98#define S3C2410_PA_USBDEV (0x52000000) 94#define S3C2410_PA_USBDEV (0x52000000)
99#define S3C24XX_SZ_USBDEV SZ_1M 95#define S3C24XX_SZ_USBDEV SZ_1M
100 96
101/* Watchdog */ 97/* Watchdog */
102#define S3C24XX_VA_WATCHDOG S3C2410_ADDR(0x00B00000) 98#define S3C24XX_VA_WATCHDOG S3C2410_ADDR(0x00700000)
103#define S3C2400_PA_WATCHDOG (0x15300000) 99#define S3C2400_PA_WATCHDOG (0x15300000)
104#define S3C2410_PA_WATCHDOG (0x53000000) 100#define S3C2410_PA_WATCHDOG (0x53000000)
105#define S3C24XX_SZ_WATCHDOG SZ_1M 101#define S3C24XX_SZ_WATCHDOG SZ_1M
106 102
107/* IIC hardware controller */ 103/* IIC hardware controller */
108#define S3C24XX_VA_IIC S3C2410_ADDR(0x00C00000)
109#define S3C2400_PA_IIC (0x15400000) 104#define S3C2400_PA_IIC (0x15400000)
110#define S3C2410_PA_IIC (0x54000000) 105#define S3C2410_PA_IIC (0x54000000)
111#define S3C24XX_SZ_IIC SZ_1M 106#define S3C24XX_SZ_IIC SZ_1M
112 107
113#define VA_IIC_BASE (S3C24XX_VA_IIC)
114
115/* IIS controller */ 108/* IIS controller */
116#define S3C24XX_VA_IIS S3C2410_ADDR(0x00D00000)
117#define S3C2400_PA_IIS (0x15508000) 109#define S3C2400_PA_IIS (0x15508000)
118#define S3C2410_PA_IIS (0x55000000) 110#define S3C2410_PA_IIS (0x55000000)
119#define S3C24XX_SZ_IIS SZ_1M 111#define S3C24XX_SZ_IIS SZ_1M
@@ -134,25 +126,21 @@
134#define S3C24XX_SZ_GPIO SZ_1M 126#define S3C24XX_SZ_GPIO SZ_1M
135 127
136/* RTC */ 128/* RTC */
137#define S3C24XX_VA_RTC S3C2410_ADDR(0x00F00000)
138#define S3C2400_PA_RTC (0x15700040) 129#define S3C2400_PA_RTC (0x15700040)
139#define S3C2410_PA_RTC (0x57000000) 130#define S3C2410_PA_RTC (0x57000000)
140#define S3C24XX_SZ_RTC SZ_1M 131#define S3C24XX_SZ_RTC SZ_1M
141 132
142/* ADC */ 133/* ADC */
143#define S3C24XX_VA_ADC S3C2410_ADDR(0x01000000)
144#define S3C2400_PA_ADC (0x15800000) 134#define S3C2400_PA_ADC (0x15800000)
145#define S3C2410_PA_ADC (0x58000000) 135#define S3C2410_PA_ADC (0x58000000)
146#define S3C24XX_SZ_ADC SZ_1M 136#define S3C24XX_SZ_ADC SZ_1M
147 137
148/* SPI */ 138/* SPI */
149#define S3C24XX_VA_SPI S3C2410_ADDR(0x01100000)
150#define S3C2400_PA_SPI (0x15900000) 139#define S3C2400_PA_SPI (0x15900000)
151#define S3C2410_PA_SPI (0x59000000) 140#define S3C2410_PA_SPI (0x59000000)
152#define S3C24XX_SZ_SPI SZ_1M 141#define S3C24XX_SZ_SPI SZ_1M
153 142
154/* SDI */ 143/* SDI */
155#define S3C24XX_VA_SDI S3C2410_ADDR(0x01200000)
156#define S3C2410_PA_SDI (0x5A000000) 144#define S3C2410_PA_SDI (0x5A000000)
157#define S3C24XX_SZ_SDI SZ_1M 145#define S3C24XX_SZ_SDI SZ_1M
158 146
diff --git a/include/asm-arm/arch-s3c2410/nand.h b/include/asm-arm/arch-s3c2410/nand.h
index e350ae2acfc6..8816f7f9cee1 100644
--- a/include/asm-arm/arch-s3c2410/nand.h
+++ b/include/asm-arm/arch-s3c2410/nand.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/nand.h 1/* linux/include/asm-arm/arch-s3c2410/nand.h
2 * 2 *
3 * (c) 2004 Simtec Electronics 3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - NAND device controller platfrom_device info 6 * S3C2410 - NAND device controller platfrom_device info
7 * 7 *
diff --git a/include/asm-arm/arch-s3c2410/osiris-cpld.h b/include/asm-arm/arch-s3c2410/osiris-cpld.h
index e9d1ae1f354f..3b6498468d62 100644
--- a/include/asm-arm/arch-s3c2410/osiris-cpld.h
+++ b/include/asm-arm/arch-s3c2410/osiris-cpld.h
@@ -1,6 +1,6 @@
1/* linux/include/asm-arm/arch-s3c2410/osiris-cpld.h 1/* linux/include/asm-arm/arch-s3c2410/osiris-cpld.h
2 * 2 *
3 * (c) 2005 Simtec Electronics 3 * Copyright (c) 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/ 4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h
index b2893e32a236..eae91694edcd 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpio.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpio.h
@@ -52,10 +52,10 @@
52/* general configuration options */ 52/* general configuration options */
53 53
54#define S3C2410_GPIO_LEAVE (0xFFFFFFFF) 54#define S3C2410_GPIO_LEAVE (0xFFFFFFFF)
55#define S3C2410_GPIO_INPUT (0xFFFFFFF0) 55#define S3C2410_GPIO_INPUT (0xFFFFFFF0) /* not available on A */
56#define S3C2410_GPIO_OUTPUT (0xFFFFFFF1) 56#define S3C2410_GPIO_OUTPUT (0xFFFFFFF1)
57#define S3C2410_GPIO_IRQ (0xFFFFFFF2) /* not available for all */ 57#define S3C2410_GPIO_IRQ (0xFFFFFFF2) /* not available for all */
58#define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* not available on A */ 58#define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* bank A => addr/cs/nand */
59#define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */ 59#define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */
60 60
61/* register address for the GPIO registers. 61/* register address for the GPIO registers.
diff --git a/include/asm-arm/arch-s3c2410/regs-mem.h b/include/asm-arm/arch-s3c2410/regs-mem.h
index 375dca50364e..e4d82341f7ba 100644
--- a/include/asm-arm/arch-s3c2410/regs-mem.h
+++ b/include/asm-arm/arch-s3c2410/regs-mem.h
@@ -133,10 +133,10 @@
133#define S3C2410_BANKCON_SDRAM (0x3 << 15) 133#define S3C2410_BANKCON_SDRAM (0x3 << 15)
134 134
135/* next bits only for EDO DRAM in 6,7 */ 135/* next bits only for EDO DRAM in 6,7 */
136#define S3C2400_BANKCON_EDO_Trdc1 (0x00 << 4) 136#define S3C2400_BANKCON_EDO_Trcd1 (0x00 << 4)
137#define S3C2400_BANKCON_EDO_Trdc2 (0x01 << 4) 137#define S3C2400_BANKCON_EDO_Trcd2 (0x01 << 4)
138#define S3C2400_BANKCON_EDO_Trdc3 (0x02 << 4) 138#define S3C2400_BANKCON_EDO_Trcd3 (0x02 << 4)
139#define S3C2400_BANKCON_EDO_Trdc4 (0x03 << 4) 139#define S3C2400_BANKCON_EDO_Trcd4 (0x03 << 4)
140 140
141/* CAS pulse width */ 141/* CAS pulse width */
142#define S3C2400_BANKCON_EDO_PULSE1 (0x00 << 3) 142#define S3C2400_BANKCON_EDO_PULSE1 (0x00 << 3)
@@ -153,9 +153,9 @@
153#define S3C2400_BANKCON_EDO_SCANb11 (0x03 << 0) 153#define S3C2400_BANKCON_EDO_SCANb11 (0x03 << 0)
154 154
155/* next bits only for SDRAM in 6,7 */ 155/* next bits only for SDRAM in 6,7 */
156#define S3C2410_BANKCON_Trdc2 (0x00 << 2) 156#define S3C2410_BANKCON_Trcd2 (0x00 << 2)
157#define S3C2410_BANKCON_Trdc3 (0x01 << 2) 157#define S3C2410_BANKCON_Trcd3 (0x01 << 2)
158#define S3C2410_BANKCON_Trdc4 (0x02 << 2) 158#define S3C2410_BANKCON_Trcd4 (0x02 << 2)
159 159
160/* control column address select */ 160/* control column address select */
161#define S3C2410_BANKCON_SCANb8 (0x00 << 0) 161#define S3C2410_BANKCON_SCANb8 (0x00 << 0)
diff --git a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/arch-s3c2410/regs-serial.h
index 19c77da9c3fe..46f52401d132 100644
--- a/include/asm-arm/arch-s3c2410/regs-serial.h
+++ b/include/asm-arm/arch-s3c2410/regs-serial.h
@@ -197,7 +197,7 @@ struct s3c2410_uartcfg {
197 unsigned char hwport; /* hardware port number */ 197 unsigned char hwport; /* hardware port number */
198 unsigned char unused; 198 unsigned char unused;
199 unsigned short flags; 199 unsigned short flags;
200 unsigned long uart_flags; /* default uart flags */ 200 upf_t uart_flags; /* default uart flags */
201 201
202 unsigned long ucon; /* value of ucon for port */ 202 unsigned long ucon; /* value of ucon for port */
203 unsigned long ulcon; /* value of ulcon for port */ 203 unsigned long ulcon; /* value of ulcon for port */
diff --git a/include/asm-arm/arch-s3c2410/regs-udc.h b/include/asm-arm/arch-s3c2410/regs-udc.h
index 487861d5b49a..3c8354619b60 100644
--- a/include/asm-arm/arch-s3c2410/regs-udc.h
+++ b/include/asm-arm/arch-s3c2410/regs-udc.h
@@ -11,8 +11,7 @@
11#ifndef __ASM_ARCH_REGS_UDC_H 11#ifndef __ASM_ARCH_REGS_UDC_H
12#define __ASM_ARCH_REGS_UDC_H 12#define __ASM_ARCH_REGS_UDC_H
13 13
14 14#define S3C2410_USBDREG(x) (x)
15#define S3C2410_USBDREG(x) ((x) + S3C24XX_VA_USBDEV)
16 15
17#define S3C2410_UDC_FUNC_ADDR_REG S3C2410_USBDREG(0x0140) 16#define S3C2410_UDC_FUNC_ADDR_REG S3C2410_USBDREG(0x0140)
18#define S3C2410_UDC_PWR_REG S3C2410_USBDREG(0x0144) 17#define S3C2410_UDC_PWR_REG S3C2410_USBDREG(0x0144)
@@ -136,8 +135,8 @@
136#define S3C2410_UDC_OCSR2_ISO (1<<6) // R/W 135#define S3C2410_UDC_OCSR2_ISO (1<<6) // R/W
137#define S3C2410_UDC_OCSR2_DMAIEN (1<<5) // R/W 136#define S3C2410_UDC_OCSR2_DMAIEN (1<<5) // R/W
138 137
139#define S3C2410_UDC_SETIX(x) \ 138#define S3C2410_UDC_SETIX(base,x) \
140 __raw_writel(S3C2410_UDC_INDEX_ ## x, S3C2410_UDC_INDEX_REG); 139 writel(S3C2410_UDC_INDEX_ ## x, base+S3C2410_UDC_INDEX_REG);
141 140
142 141
143#define S3C2410_UDC_EP0_CSR_OPKRDY (1<<0) 142#define S3C2410_UDC_EP0_CSR_OPKRDY (1<<0)
diff --git a/include/asm-arm/arch-s3c2410/system.h b/include/asm-arm/arch-s3c2410/system.h
index 4f72a853a5cf..ecf250db45fb 100644
--- a/include/asm-arm/arch-s3c2410/system.h
+++ b/include/asm-arm/arch-s3c2410/system.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/system.h 1/* linux/include/asm-arm/arch-s3c2410/system.h
2 * 2 *
3 * (c) 2003 Simtec Electronics 3 * Copyright (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - System function defines and includes 6 * S3C2410 - System function defines and includes
7 * 7 *
diff --git a/include/asm-arm/arch-s3c2410/timex.h b/include/asm-arm/arch-s3c2410/timex.h
index 703c337c5617..c16a99c5a59a 100644
--- a/include/asm-arm/arch-s3c2410/timex.h
+++ b/include/asm-arm/arch-s3c2410/timex.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/timex.h 1/* linux/include/asm-arm/arch-s3c2410/timex.h
2 * 2 *
3 * (c) 2003-2005 Simtec Electronics 3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - time parameters 6 * S3C2410 - time parameters
7 * 7 *
diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h
index 81b3e91c56ab..dcb2cef38f50 100644
--- a/include/asm-arm/arch-s3c2410/uncompress.h
+++ b/include/asm-arm/arch-s3c2410/uncompress.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/uncompress.h 1/* linux/include/asm-arm/arch-s3c2410/uncompress.h
2 * 2 *
3 * (c) 2003 Simtec Electronics 3 * Copyright (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - uncompress code 6 * S3C2410 - uncompress code
7 * 7 *
@@ -13,6 +13,7 @@
13#ifndef __ASM_ARCH_UNCOMPRESS_H 13#ifndef __ASM_ARCH_UNCOMPRESS_H
14#define __ASM_ARCH_UNCOMPRESS_H 14#define __ASM_ARCH_UNCOMPRESS_H
15 15
16typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
16 17
17/* defines for UART registers */ 18/* defines for UART registers */
18#include "asm/arch/regs-serial.h" 19#include "asm/arch/regs-serial.h"
diff --git a/include/asm-arm/arch-s3c2410/usb-control.h b/include/asm-arm/arch-s3c2410/usb-control.h
index 35723569a17a..5bfa376e33dc 100644
--- a/include/asm-arm/arch-s3c2410/usb-control.h
+++ b/include/asm-arm/arch-s3c2410/usb-control.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/usb-control.h 1/* linux/include/asm-arm/arch-s3c2410/usb-control.h
2 * 2 *
3 * (c) 2004 Simtec Electronics 3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - usb port information 6 * S3C2410 - usb port information
7 * 7 *
diff --git a/include/asm-arm/arch-s3c2410/vr1000-cpld.h b/include/asm-arm/arch-s3c2410/vr1000-cpld.h
index a341b1e1bd98..0557b0a5ab1d 100644
--- a/include/asm-arm/arch-s3c2410/vr1000-cpld.h
+++ b/include/asm-arm/arch-s3c2410/vr1000-cpld.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/vr1000-cpld.h 1/* linux/include/asm-arm/arch-s3c2410/vr1000-cpld.h
2 * 2 *
3 * (c) 2003 Simtec Electronics 3 * Copyright (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * VR1000 - CPLD control constants 6 * VR1000 - CPLD control constants
7 * 7 *
diff --git a/include/asm-arm/arch-s3c2410/vr1000-irq.h b/include/asm-arm/arch-s3c2410/vr1000-irq.h
index c39a0ffa670d..890937083c61 100644
--- a/include/asm-arm/arch-s3c2410/vr1000-irq.h
+++ b/include/asm-arm/arch-s3c2410/vr1000-irq.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/vr1000-irq.h 1/* linux/include/asm-arm/arch-s3c2410/vr1000-irq.h
2 * 2 *
3 * (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Machine VR1000 - IRQ Number definitions 6 * Machine VR1000 - IRQ Number definitions
7 * 7 *
diff --git a/include/asm-arm/arch-s3c2410/vr1000-map.h b/include/asm-arm/arch-s3c2410/vr1000-map.h
index 1fe4db36c834..92a56a724a8c 100644
--- a/include/asm-arm/arch-s3c2410/vr1000-map.h
+++ b/include/asm-arm/arch-s3c2410/vr1000-map.h
@@ -1,7 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/vr1000-map.h 1/* linux/include/asm-arm/arch-s3c2410/vr1000-map.h
2 * 2 *
3 * (c) 2003-2005 Simtec Electronics 3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Machine VR1000 - Memory map definitions 6 * Machine VR1000 - Memory map definitions
7 * 7 *
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
index f0845646aacb..5f531ea03059 100644
--- a/include/asm-arm/cacheflush.h
+++ b/include/asm-arm/cacheflush.h
@@ -319,6 +319,8 @@ extern void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
319 unsigned long len, int write); 319 unsigned long len, int write);
320#endif 320#endif
321 321
322#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
323
322/* 324/*
323 * flush_cache_user_range is used when we want to ensure that the 325 * flush_cache_user_range is used when we want to ensure that the
324 * Harvard caches are synchronised for the user space address range. 326 * Harvard caches are synchronised for the user space address range.
@@ -353,6 +355,18 @@ extern void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
353 */ 355 */
354extern void flush_dcache_page(struct page *); 356extern void flush_dcache_page(struct page *);
355 357
358extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
359
360#define ARCH_HAS_FLUSH_ANON_PAGE
361static inline void flush_anon_page(struct vm_area_struct *vma,
362 struct page *page, unsigned long vmaddr)
363{
364 extern void __flush_anon_page(struct vm_area_struct *vma,
365 struct page *, unsigned long);
366 if (PageAnon(page))
367 __flush_anon_page(vma, page, vmaddr);
368}
369
356#define flush_dcache_mmap_lock(mapping) \ 370#define flush_dcache_mmap_lock(mapping) \
357 write_lock_irq(&(mapping)->tree_lock) 371 write_lock_irq(&(mapping)->tree_lock)
358#define flush_dcache_mmap_unlock(mapping) \ 372#define flush_dcache_mmap_unlock(mapping) \
diff --git a/include/asm-arm/cpu-multi32.h b/include/asm-arm/cpu-multi32.h
index 4679f63688e9..715e18a4add1 100644
--- a/include/asm-arm/cpu-multi32.h
+++ b/include/asm-arm/cpu-multi32.h
@@ -50,9 +50,10 @@ extern struct processor {
50 */ 50 */
51 void (*switch_mm)(unsigned long pgd_phys, struct mm_struct *mm); 51 void (*switch_mm)(unsigned long pgd_phys, struct mm_struct *mm);
52 /* 52 /*
53 * Set a PTE 53 * Set a possibly extended PTE. Non-extended PTEs should
54 * ignore 'ext'.
54 */ 55 */
55 void (*set_pte)(pte_t *ptep, pte_t pte); 56 void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext);
56} processor; 57} processor;
57 58
58#define cpu_proc_init() processor._proc_init() 59#define cpu_proc_init() processor._proc_init()
@@ -60,5 +61,5 @@ extern struct processor {
60#define cpu_reset(addr) processor.reset(addr) 61#define cpu_reset(addr) processor.reset(addr)
61#define cpu_do_idle() processor._do_idle() 62#define cpu_do_idle() processor._do_idle()
62#define cpu_dcache_clean_area(addr,sz) processor.dcache_clean_area(addr,sz) 63#define cpu_dcache_clean_area(addr,sz) processor.dcache_clean_area(addr,sz)
63#define cpu_set_pte(ptep, pte) processor.set_pte(ptep, pte) 64#define cpu_set_pte_ext(ptep,pte,ext) processor.set_pte_ext(ptep,pte,ext)
64#define cpu_do_switch_mm(pgd,mm) processor.switch_mm(pgd,mm) 65#define cpu_do_switch_mm(pgd,mm) processor.switch_mm(pgd,mm)
diff --git a/include/asm-arm/cpu-single.h b/include/asm-arm/cpu-single.h
index 6723e67244fa..0b120ee36091 100644
--- a/include/asm-arm/cpu-single.h
+++ b/include/asm-arm/cpu-single.h
@@ -28,7 +28,7 @@
28#define cpu_do_idle __cpu_fn(CPU_NAME,_do_idle) 28#define cpu_do_idle __cpu_fn(CPU_NAME,_do_idle)
29#define cpu_dcache_clean_area __cpu_fn(CPU_NAME,_dcache_clean_area) 29#define cpu_dcache_clean_area __cpu_fn(CPU_NAME,_dcache_clean_area)
30#define cpu_do_switch_mm __cpu_fn(CPU_NAME,_switch_mm) 30#define cpu_do_switch_mm __cpu_fn(CPU_NAME,_switch_mm)
31#define cpu_set_pte __cpu_fn(CPU_NAME,_set_pte) 31#define cpu_set_pte_ext __cpu_fn(CPU_NAME,_set_pte_ext)
32 32
33#include <asm/page.h> 33#include <asm/page.h>
34 34
@@ -40,5 +40,5 @@ extern void cpu_proc_fin(void);
40extern int cpu_do_idle(void); 40extern int cpu_do_idle(void);
41extern void cpu_dcache_clean_area(void *, int); 41extern void cpu_dcache_clean_area(void *, int);
42extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm); 42extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
43extern void cpu_set_pte(pte_t *ptep, pte_t pte); 43extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext);
44extern void cpu_reset(unsigned long addr) __attribute__((noreturn)); 44extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h
index 642382d2c9f0..3679a8a8922e 100644
--- a/include/asm-arm/elf.h
+++ b/include/asm-arm/elf.h
@@ -52,6 +52,7 @@ typedef struct user_fp elf_fpregset_t;
52#define HWCAP_EDSP 128 52#define HWCAP_EDSP 128
53#define HWCAP_JAVA 256 53#define HWCAP_JAVA 256
54#define HWCAP_IWMMXT 512 54#define HWCAP_IWMMXT 512
55#define HWCAP_CRUNCH 1024
55 56
56#ifdef __KERNEL__ 57#ifdef __KERNEL__
57#ifndef __ASSEMBLY__ 58#ifndef __ASSEMBLY__
diff --git a/include/asm-arm/flat.h b/include/asm-arm/flat.h
index 966946478589..16f5375e57b8 100644
--- a/include/asm-arm/flat.h
+++ b/include/asm-arm/flat.h
@@ -5,7 +5,9 @@
5#ifndef __ARM_FLAT_H__ 5#ifndef __ARM_FLAT_H__
6#define __ARM_FLAT_H__ 6#define __ARM_FLAT_H__
7 7
8#define flat_stack_align(sp) /* nothing needed */ 8/* An odd number of words will be pushed after this alignment, so
9 deliberately misalign the value. */
10#define flat_stack_align(sp) sp = (void *)(((unsigned long)(sp) - 4) | 4)
9#define flat_argvp_envp_on_stack() 1 11#define flat_argvp_envp_on_stack() 1
10#define flat_old_ram_flag(flags) (flags) 12#define flat_old_ram_flag(flags) (flags)
11#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 13#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
diff --git a/include/asm-arm/fpstate.h b/include/asm-arm/fpstate.h
index 6af4e6bd1290..f31cda5a55ee 100644
--- a/include/asm-arm/fpstate.h
+++ b/include/asm-arm/fpstate.h
@@ -35,6 +35,9 @@ struct vfp_hard_struct {
35 */ 35 */
36 __u32 fpinst; 36 __u32 fpinst;
37 __u32 fpinst2; 37 __u32 fpinst2;
38#ifdef CONFIG_SMP
39 __u32 cpu;
40#endif
38}; 41};
39 42
40union vfp_state { 43union vfp_state {
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h
index 1018a7486ab7..13ac8a4cd01f 100644
--- a/include/asm-arm/hardware/iop3xx.h
+++ b/include/asm-arm/hardware/iop3xx.h
@@ -168,9 +168,9 @@ extern void gpio_line_set(int line, int value);
168#define IOP3XX_PERCR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0710) 168#define IOP3XX_PERCR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0710)
169 169
170/* General Purpose I/O */ 170/* General Purpose I/O */
171#define IOP3XX_GPOE (volatile u32 *)IOP3XX_GPIO_REG(0x0004) 171#define IOP3XX_GPOE (volatile u32 *)IOP3XX_GPIO_REG(0x0000)
172#define IOP3XX_GPID (volatile u32 *)IOP3XX_GPIO_REG(0x0008) 172#define IOP3XX_GPID (volatile u32 *)IOP3XX_GPIO_REG(0x0004)
173#define IOP3XX_GPOD (volatile u32 *)IOP3XX_GPIO_REG(0x000c) 173#define IOP3XX_GPOD (volatile u32 *)IOP3XX_GPIO_REG(0x0008)
174 174
175/* Timers */ 175/* Timers */
176#define IOP3XX_TU_TMR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0000) 176#define IOP3XX_TU_TMR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0000)
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/irq.h b/include/asm-arm/irq.h
index 283af50a16cb..1b882a255e35 100644
--- a/include/asm-arm/irq.h
+++ b/include/asm-arm/irq.h
@@ -19,7 +19,6 @@
19#define NO_IRQ ((unsigned int)(-1)) 19#define NO_IRQ ((unsigned int)(-1))
20#endif 20#endif
21 21
22struct irqaction;
23 22
24/* 23/*
25 * Migration helpers 24 * Migration helpers
@@ -37,6 +36,10 @@ struct irqaction;
37#define IRQT_HIGH (__IRQT_HIGHLVL) 36#define IRQT_HIGH (__IRQT_HIGHLVL)
38#define IRQT_PROBE IRQ_TYPE_PROBE 37#define IRQT_PROBE IRQ_TYPE_PROBE
39 38
39#ifndef __ASSEMBLY__
40struct irqaction;
40extern void migrate_irqs(void); 41extern void migrate_irqs(void);
41#endif 42#endif
42 43
44#endif
45
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index 88cd5c784ef0..b8cf2d5ec304 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -21,6 +21,7 @@
21 21
22#include <asm/memory.h> 22#include <asm/memory.h>
23#include <asm/arch/vmalloc.h> 23#include <asm/arch/vmalloc.h>
24#include <asm/pgtable-hwdef.h>
24 25
25/* 26/*
26 * Just any arbitrary offset to the start of the vmalloc VM area: the 27 * Just any arbitrary offset to the start of the vmalloc VM area: the
@@ -170,7 +171,6 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
170#define L_PTE_EXEC (1 << 6) 171#define L_PTE_EXEC (1 << 6)
171#define L_PTE_DIRTY (1 << 7) 172#define L_PTE_DIRTY (1 << 7)
172#define L_PTE_SHARED (1 << 10) /* shared(v6), coherent(xsc3) */ 173#define L_PTE_SHARED (1 << 10) /* shared(v6), coherent(xsc3) */
173#define L_PTE_ASID (1 << 11) /* non-global (use ASID, v6) */
174 174
175#ifndef __ASSEMBLY__ 175#ifndef __ASSEMBLY__
176 176
@@ -228,7 +228,7 @@ extern struct page *empty_zero_page;
228#define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))) 228#define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))
229 229
230#define pte_none(pte) (!pte_val(pte)) 230#define pte_none(pte) (!pte_val(pte))
231#define pte_clear(mm,addr,ptep) set_pte_at((mm),(addr),(ptep), __pte(0)) 231#define pte_clear(mm,addr,ptep) set_pte_ext(ptep, __pte(0), 0)
232#define pte_page(pte) (pfn_to_page(pte_pfn(pte))) 232#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
233#define pte_offset_kernel(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr)) 233#define pte_offset_kernel(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr))
234#define pte_offset_map(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr)) 234#define pte_offset_map(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr))
@@ -236,8 +236,11 @@ extern struct page *empty_zero_page;
236#define pte_unmap(pte) do { } while (0) 236#define pte_unmap(pte) do { } while (0)
237#define pte_unmap_nested(pte) do { } while (0) 237#define pte_unmap_nested(pte) do { } while (0)
238 238
239#define set_pte(ptep, pte) cpu_set_pte(ptep,pte) 239#define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext)
240#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 240
241#define set_pte_at(mm,addr,ptep,pteval) do { \
242 set_pte_ext(ptep, pteval, (addr) >= PAGE_OFFSET ? 0 : PTE_EXT_NG); \
243 } while (0)
241 244
242/* 245/*
243 * The following only work if pte_present() is true. 246 * The following only work if pte_present() is true.
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h
index b442e8e2a809..1bbf16182d62 100644
--- a/include/asm-arm/processor.h
+++ b/include/asm-arm/processor.h
@@ -103,14 +103,14 @@ extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
103#if __LINUX_ARM_ARCH__ >= 5 103#if __LINUX_ARM_ARCH__ >= 5
104 104
105#define ARCH_HAS_PREFETCH 105#define ARCH_HAS_PREFETCH
106#define prefetch(ptr) \ 106static inline void prefetch(const void *ptr)
107 ({ \ 107{
108 __asm__ __volatile__( \ 108 __asm__ __volatile__(
109 "pld\t%0" \ 109 "pld\t%0"
110 : \ 110 :
111 : "o" (*(char *)(ptr)) \ 111 : "o" (*(char *)ptr)
112 : "cc"); \ 112 : "cc");
113 }) 113}
114 114
115#define ARCH_HAS_PREFETCHW 115#define ARCH_HAS_PREFETCHW
116#define prefetchw(ptr) prefetch(ptr) 116#define prefetchw(ptr) prefetch(ptr)
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index f05fbe31576c..aa223fc546af 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -73,6 +73,7 @@
73#ifndef __ASSEMBLY__ 73#ifndef __ASSEMBLY__
74 74
75#include <linux/linkage.h> 75#include <linux/linkage.h>
76#include <linux/irqflags.h>
76 77
77struct thread_info; 78struct thread_info;
78struct task_struct; 79struct task_struct;
@@ -139,23 +140,44 @@ static inline int cpu_is_xsc3(void)
139#define cpu_is_xscale() 1 140#define cpu_is_xscale() 1
140#endif 141#endif
141 142
142#define set_cr(x) \
143 __asm__ __volatile__( \
144 "mcr p15, 0, %0, c1, c0, 0 @ set CR" \
145 : : "r" (x) : "cc")
146
147#define get_cr() \
148 ({ \
149 unsigned int __val; \
150 __asm__ __volatile__( \
151 "mrc p15, 0, %0, c1, c0, 0 @ get CR" \
152 : "=r" (__val) : : "cc"); \
153 __val; \
154 })
155
156extern unsigned long cr_no_alignment; /* defined in entry-armv.S */ 143extern unsigned long cr_no_alignment; /* defined in entry-armv.S */
157extern unsigned long cr_alignment; /* defined in entry-armv.S */ 144extern unsigned long cr_alignment; /* defined in entry-armv.S */
158 145
146static inline unsigned int get_cr(void)
147{
148 unsigned int val;
149 asm("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc");
150 return val;
151}
152
153static inline void set_cr(unsigned int val)
154{
155 asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR"
156 : : "r" (val) : "cc");
157}
158
159#ifndef CONFIG_SMP
160extern void adjust_cr(unsigned long mask, unsigned long set);
161#endif
162
163#define CPACC_FULL(n) (3 << (n * 2))
164#define CPACC_SVC(n) (1 << (n * 2))
165#define CPACC_DISABLE(n) (0 << (n * 2))
166
167static inline unsigned int get_copro_access(void)
168{
169 unsigned int val;
170 asm("mrc p15, 0, %0, c1, c0, 2 @ get copro access"
171 : "=r" (val) : : "cc");
172 return val;
173}
174
175static inline void set_copro_access(unsigned int val)
176{
177 asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access"
178 : : "r" (val) : "cc");
179}
180
159#define UDBG_UNDEFINED (1 << 0) 181#define UDBG_UNDEFINED (1 << 0)
160#define UDBG_SYSCALL (1 << 1) 182#define UDBG_SYSCALL (1 << 1)
161#define UDBG_BADABORT (1 << 2) 183#define UDBG_BADABORT (1 << 2)
@@ -211,8 +233,6 @@ static inline void sched_cacheflush(void)
211{ 233{
212} 234}
213 235
214#include <linux/irqflags.h>
215
216#ifdef CONFIG_SMP 236#ifdef CONFIG_SMP
217 237
218#define smp_mb() mb() 238#define smp_mb() mb()
diff --git a/include/asm-arm/termbits.h b/include/asm-arm/termbits.h
index bbc6e1d24d3f..a3f4fe1742d0 100644
--- a/include/asm-arm/termbits.h
+++ b/include/asm-arm/termbits.h
@@ -15,6 +15,18 @@ struct termios {
15 cc_t c_cc[NCCS]; /* control characters */ 15 cc_t c_cc[NCCS]; /* control characters */
16}; 16};
17 17
18struct ktermios {
19 tcflag_t c_iflag; /* input mode flags */
20 tcflag_t c_oflag; /* output mode flags */
21 tcflag_t c_cflag; /* control mode flags */
22 tcflag_t c_lflag; /* local mode flags */
23 cc_t c_line; /* line discipline */
24 cc_t c_cc[NCCS]; /* control characters */
25 speed_t c_ispeed; /* input speed */
26 speed_t c_ospeed; /* output speed */
27};
28
29
18/* c_cc characters */ 30/* c_cc characters */
19#define VINTR 0 31#define VINTR 0
20#define VQUIT 1 32#define VQUIT 1
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index d9b8bddc8732..5014794f9eb3 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -147,6 +147,7 @@ extern void iwmmxt_task_switch(struct thread_info *);
147#define TIF_POLLING_NRFLAG 16 147#define TIF_POLLING_NRFLAG 16
148#define TIF_USING_IWMMXT 17 148#define TIF_USING_IWMMXT 17
149#define TIF_MEMDIE 18 149#define TIF_MEMDIE 18
150#define TIF_FREEZE 19
150 151
151#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 152#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
152#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 153#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
@@ -154,6 +155,7 @@ extern void iwmmxt_task_switch(struct thread_info *);
154#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 155#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
155#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 156#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
156#define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) 157#define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT)
158#define _TIF_FREEZE (1 << TIF_FREEZE)
157 159
158/* 160/*
159 * Change these and you break ASM code in entry-common.S 161 * Change these and you break ASM code in entry-common.S
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index d44c629d8424..97e7060000cf 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -347,6 +347,31 @@
347#define __NR_mbind (__NR_SYSCALL_BASE+319) 347#define __NR_mbind (__NR_SYSCALL_BASE+319)
348#define __NR_get_mempolicy (__NR_SYSCALL_BASE+320) 348#define __NR_get_mempolicy (__NR_SYSCALL_BASE+320)
349#define __NR_set_mempolicy (__NR_SYSCALL_BASE+321) 349#define __NR_set_mempolicy (__NR_SYSCALL_BASE+321)
350#define __NR_openat (__NR_SYSCALL_BASE+322)
351#define __NR_mkdirat (__NR_SYSCALL_BASE+323)
352#define __NR_mknodat (__NR_SYSCALL_BASE+324)
353#define __NR_fchownat (__NR_SYSCALL_BASE+325)
354#define __NR_futimesat (__NR_SYSCALL_BASE+326)
355#define __NR_fstatat64 (__NR_SYSCALL_BASE+327)
356#define __NR_unlinkat (__NR_SYSCALL_BASE+328)
357#define __NR_renameat (__NR_SYSCALL_BASE+329)
358#define __NR_linkat (__NR_SYSCALL_BASE+330)
359#define __NR_symlinkat (__NR_SYSCALL_BASE+331)
360#define __NR_readlinkat (__NR_SYSCALL_BASE+332)
361#define __NR_fchmodat (__NR_SYSCALL_BASE+333)
362#define __NR_faccessat (__NR_SYSCALL_BASE+334)
363 /* 335 for pselect6 */
364 /* 336 for ppoll */
365#define __NR_unshare (__NR_SYSCALL_BASE+337)
366#define __NR_set_robust_list (__NR_SYSCALL_BASE+338)
367#define __NR_get_robust_list (__NR_SYSCALL_BASE+339)
368#define __NR_splice (__NR_SYSCALL_BASE+340)
369#define __NR_arm_sync_file_range (__NR_SYSCALL_BASE+341)
370#define __NR_tee (__NR_SYSCALL_BASE+342)
371#define __NR_vmsplice (__NR_SYSCALL_BASE+343)
372#define __NR_move_pages (__NR_SYSCALL_BASE+344)
373#define __NR_getcpu (__NR_SYSCALL_BASE+345)
374 /* 346 for epoll_pwait */
350 375
351/* 376/*
352 * The following SWIs are ARM private. 377 * The following SWIs are ARM private.
diff --git a/include/asm-arm26/cacheflush.h b/include/asm-arm26/cacheflush.h
index 9c1b9c7f2ebd..14ae15b6faab 100644
--- a/include/asm-arm26/cacheflush.h
+++ b/include/asm-arm26/cacheflush.h
@@ -22,6 +22,7 @@
22 22
23#define flush_cache_all() do { } while (0) 23#define flush_cache_all() do { } while (0)
24#define flush_cache_mm(mm) do { } while (0) 24#define flush_cache_mm(mm) do { } while (0)
25#define flush_cache_dup_mm(mm) do { } while (0)
25#define flush_cache_range(vma,start,end) do { } while (0) 26#define flush_cache_range(vma,start,end) do { } while (0)
26#define flush_cache_page(vma,vmaddr,pfn) do { } while (0) 27#define flush_cache_page(vma,vmaddr,pfn) do { } while (0)
27#define flush_cache_vmap(start, end) do { } while (0) 28#define flush_cache_vmap(start, end) do { } while (0)
diff --git a/include/asm-arm26/termbits.h b/include/asm-arm26/termbits.h
index bbc6e1d24d3f..a3f4fe1742d0 100644
--- a/include/asm-arm26/termbits.h
+++ b/include/asm-arm26/termbits.h
@@ -15,6 +15,18 @@ struct termios {
15 cc_t c_cc[NCCS]; /* control characters */ 15 cc_t c_cc[NCCS]; /* control characters */
16}; 16};
17 17
18struct ktermios {
19 tcflag_t c_iflag; /* input mode flags */
20 tcflag_t c_oflag; /* output mode flags */
21 tcflag_t c_cflag; /* control mode flags */
22 tcflag_t c_lflag; /* local mode flags */
23 cc_t c_line; /* line discipline */
24 cc_t c_cc[NCCS]; /* control characters */
25 speed_t c_ispeed; /* input speed */
26 speed_t c_ospeed; /* output speed */
27};
28
29
18/* c_cc characters */ 30/* c_cc characters */
19#define VINTR 0 31#define VINTR 0
20#define VQUIT 1 32#define VQUIT 1
diff --git a/include/asm-avr32/arch-at32ap/at32ap7000.h b/include/asm-avr32/arch-at32ap/at32ap7000.h
new file mode 100644
index 000000000000..3914d7b94ff4
--- /dev/null
+++ b/include/asm-avr32/arch-at32ap/at32ap7000.h
@@ -0,0 +1,35 @@
1/*
2 * Pin definitions for AT32AP7000.
3 *
4 * Copyright (C) 2006 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_ARCH_AT32AP7000_H__
11#define __ASM_ARCH_AT32AP7000_H__
12
13#define GPIO_PERIPH_A 0
14#define GPIO_PERIPH_B 1
15
16#define NR_GPIO_CONTROLLERS 4
17
18/*
19 * Pin numbers identifying specific GPIO pins on the chip. They can
20 * also be converted to IRQ numbers by passing them through
21 * gpio_to_irq().
22 */
23#define GPIO_PIOA_BASE (0)
24#define GPIO_PIOB_BASE (GPIO_PIOA_BASE + 32)
25#define GPIO_PIOC_BASE (GPIO_PIOB_BASE + 32)
26#define GPIO_PIOD_BASE (GPIO_PIOC_BASE + 32)
27#define GPIO_PIOE_BASE (GPIO_PIOD_BASE + 32)
28
29#define GPIO_PIN_PA(N) (GPIO_PIOA_BASE + (N))
30#define GPIO_PIN_PB(N) (GPIO_PIOB_BASE + (N))
31#define GPIO_PIN_PC(N) (GPIO_PIOC_BASE + (N))
32#define GPIO_PIN_PD(N) (GPIO_PIOD_BASE + (N))
33#define GPIO_PIN_PE(N) (GPIO_PIOE_BASE + (N))
34
35#endif /* __ASM_ARCH_AT32AP7000_H__ */
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h
index a39b3e999f18..b120ee030c86 100644
--- a/include/asm-avr32/arch-at32ap/board.h
+++ b/include/asm-avr32/arch-at32ap/board.h
@@ -21,10 +21,7 @@ void at32_map_usart(unsigned int hw_id, unsigned int line);
21struct platform_device *at32_add_device_usart(unsigned int id); 21struct platform_device *at32_add_device_usart(unsigned int id);
22 22
23struct eth_platform_data { 23struct eth_platform_data {
24 u8 valid;
25 u8 mii_phy_addr;
26 u8 is_rmii; 24 u8 is_rmii;
27 u8 hw_addr[6];
28}; 25};
29struct platform_device * 26struct platform_device *
30at32_add_device_eth(unsigned int id, struct eth_platform_data *data); 27at32_add_device_eth(unsigned int id, struct eth_platform_data *data);
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 4d50421262a1..9930871decde 100644
--- a/include/asm-avr32/arch-at32ap/portmux.h
+++ b/include/asm-avr32/arch-at32ap/portmux.h
@@ -7,10 +7,22 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#ifndef __ASM_AVR32_AT32_PORTMUX_H__ 10#ifndef __ASM_ARCH_PORTMUX_H__
11#define __ASM_AVR32_AT32_PORTMUX_H__ 11#define __ASM_ARCH_PORTMUX_H__
12 12
13void portmux_set_func(unsigned int portmux_id, unsigned int pin_id, 13/*
14 unsigned int function_id); 14 * Set up pin multiplexing, called from board init only.
15 *
16 * The following flags determine the initial state of the pin.
17 */
18#define AT32_GPIOF_PULLUP 0x00000001 /* (not-OUT) Enable pull-up */
19#define AT32_GPIOF_OUTPUT 0x00000002 /* (OUT) Enable output driver */
20#define AT32_GPIOF_HIGH 0x00000004 /* (OUT) Set output high */
21#define AT32_GPIOF_DEGLITCH 0x00000008 /* (IN) Filter glitches */
22
23void at32_select_periph(unsigned int pin, unsigned int periph,
24 unsigned long flags);
25void at32_select_gpio(unsigned int pin, unsigned long flags);
26void at32_reserve_pin(unsigned int pin);
15 27
16#endif /* __ASM_AVR32_AT32_PORTMUX_H__ */ 28#endif /* __ASM_ARCH_PORTMUX_H__ */
diff --git a/include/asm-avr32/cacheflush.h b/include/asm-avr32/cacheflush.h
index f1bf1708980e..dfaaa88cd412 100644
--- a/include/asm-avr32/cacheflush.h
+++ b/include/asm-avr32/cacheflush.h
@@ -87,6 +87,7 @@ void invalidate_icache_region(void *start, size_t len);
87 */ 87 */
88#define flush_cache_all() do { } while (0) 88#define flush_cache_all() do { } while (0)
89#define flush_cache_mm(mm) do { } while (0) 89#define flush_cache_mm(mm) do { } while (0)
90#define flush_cache_dup_mm(mm) do { } while (0)
90#define flush_cache_range(vma, start, end) do { } while (0) 91#define flush_cache_range(vma, start, end) do { } while (0)
91#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 92#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
92#define flush_cache_vmap(start, end) do { } while (0) 93#define flush_cache_vmap(start, end) do { } while (0)
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 0580b5d62bba..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
@@ -109,7 +117,7 @@ static inline dma_addr_t
109dma_map_single(struct device *dev, void *cpu_addr, size_t size, 117dma_map_single(struct device *dev, void *cpu_addr, size_t size,
110 enum dma_data_direction direction) 118 enum dma_data_direction direction)
111{ 119{
112 dma_cache_sync(cpu_addr, size, direction); 120 dma_cache_sync(dev, cpu_addr, size, direction);
113 return virt_to_bus(cpu_addr); 121 return virt_to_bus(cpu_addr);
114} 122}
115 123
@@ -211,7 +219,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
211 219
212 sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset; 220 sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset;
213 virt = page_address(sg[i].page) + sg[i].offset; 221 virt = page_address(sg[i].page) + sg[i].offset;
214 dma_cache_sync(virt, sg[i].length, direction); 222 dma_cache_sync(dev, virt, sg[i].length, direction);
215 } 223 }
216 224
217 return nents; 225 return nents;
@@ -256,14 +264,14 @@ static inline void
256dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, 264dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
257 size_t size, enum dma_data_direction direction) 265 size_t size, enum dma_data_direction direction)
258{ 266{
259 dma_cache_sync(bus_to_virt(dma_handle), size, direction); 267 dma_cache_sync(dev, bus_to_virt(dma_handle), size, direction);
260} 268}
261 269
262static inline void 270static inline void
263dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, 271dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
264 size_t size, enum dma_data_direction direction) 272 size_t size, enum dma_data_direction direction)
265{ 273{
266 dma_cache_sync(bus_to_virt(dma_handle), size, direction); 274 dma_cache_sync(dev, bus_to_virt(dma_handle), size, direction);
267} 275}
268 276
269/** 277/**
@@ -286,7 +294,7 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
286 int i; 294 int i;
287 295
288 for (i = 0; i < nents; i++) { 296 for (i = 0; i < nents; i++) {
289 dma_cache_sync(page_address(sg[i].page) + sg[i].offset, 297 dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
290 sg[i].length, direction); 298 sg[i].length, direction);
291 } 299 }
292} 300}
@@ -298,7 +306,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
298 int i; 306 int i;
299 307
300 for (i = 0; i < nents; i++) { 308 for (i = 0; i < nents; i++) {
301 dma_cache_sync(page_address(sg[i].page) + sg[i].offset, 309 dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
302 sg[i].length, direction); 310 sg[i].length, direction);
303 } 311 }
304} 312}
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/pgalloc.h b/include/asm-avr32/pgalloc.h
index 7492cfb92ced..bb82e70cde8d 100644
--- a/include/asm-avr32/pgalloc.h
+++ b/include/asm-avr32/pgalloc.h
@@ -28,7 +28,7 @@ static __inline__ void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
28static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm) 28static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm)
29{ 29{
30 unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t)); 30 unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t));
31 pgd_t *pgd = (pgd_t *)kmalloc(pgd_size, GFP_KERNEL); 31 pgd_t *pgd = kmalloc(pgd_size, GFP_KERNEL);
32 32
33 if (pgd) 33 if (pgd)
34 memset(pgd, 0, pgd_size); 34 memset(pgd, 0, pgd_size);
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/termbits.h b/include/asm-avr32/termbits.h
index 9dc6eacafa33..c215fafdae4d 100644
--- a/include/asm-avr32/termbits.h
+++ b/include/asm-avr32/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20/* c_cc characters */ 31/* c_cc characters */
21#define VINTR 0 32#define VINTR 0
22#define VQUIT 1 33#define VQUIT 1
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/cacheflush.h b/include/asm-cris/cacheflush.h
index 72cc71dffe70..01af2de27c5b 100644
--- a/include/asm-cris/cacheflush.h
+++ b/include/asm-cris/cacheflush.h
@@ -9,6 +9,7 @@
9 */ 9 */
10#define flush_cache_all() do { } while (0) 10#define flush_cache_all() do { } while (0)
11#define flush_cache_mm(mm) do { } while (0) 11#define flush_cache_mm(mm) do { } while (0)
12#define flush_cache_dup_mm(mm) do { } while (0)
12#define flush_cache_range(vma, start, end) do { } while (0) 13#define flush_cache_range(vma, start, end) do { } while (0)
13#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 14#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
14#define flush_dcache_page(page) do { } while (0) 15#define flush_dcache_page(page) do { } while (0)
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/termbits.h b/include/asm-cris/termbits.h
index be0836d2f282..8d8cec225fe1 100644
--- a/include/asm-cris/termbits.h
+++ b/include/asm-cris/termbits.h
@@ -19,6 +19,17 @@ struct termios {
19 cc_t c_cc[NCCS]; /* control characters */ 19 cc_t c_cc[NCCS]; /* control characters */
20}; 20};
21 21
22struct ktermios {
23 tcflag_t c_iflag; /* input mode flags */
24 tcflag_t c_oflag; /* output mode flags */
25 tcflag_t c_cflag; /* control mode flags */
26 tcflag_t c_lflag; /* local mode flags */
27 cc_t c_line; /* line discipline */
28 cc_t c_cc[NCCS]; /* control characters */
29 speed_t c_ispeed; /* input speed */
30 speed_t c_ospeed; /* output speed */
31};
32
22/* c_cc characters */ 33/* c_cc characters */
23#define VINTR 0 34#define VINTR 0
24#define VQUIT 1 35#define VQUIT 1
diff --git a/include/asm-frv/Kbuild b/include/asm-frv/Kbuild
index c68e1680da01..966a9836d556 100644
--- a/include/asm-frv/Kbuild
+++ b/include/asm-frv/Kbuild
@@ -1 +1,7 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2
3header-y += registers.h
4
5unifdef-y += termios.h
6unifdef-y += ptrace.h
7unifdef-y += page.h
diff --git a/include/asm-frv/bitops.h b/include/asm-frv/bitops.h
index 1f70d47148bd..f8560edf59ff 100644
--- a/include/asm-frv/bitops.h
+++ b/include/asm-frv/bitops.h
@@ -256,6 +256,50 @@ int __ffs(unsigned long x)
256 return 31 - bit; 256 return 31 - bit;
257} 257}
258 258
259/*
260 * special slimline version of fls() for calculating ilog2_u32()
261 * - note: no protection against n == 0
262 */
263#define ARCH_HAS_ILOG2_U32
264static inline __attribute__((const))
265int __ilog2_u32(u32 n)
266{
267 int bit;
268 asm("scan %1,gr0,%0" : "=r"(bit) : "r"(n));
269 return 31 - bit;
270}
271
272/*
273 * special slimline version of fls64() for calculating ilog2_u64()
274 * - note: no protection against n == 0
275 */
276#define ARCH_HAS_ILOG2_U64
277static inline __attribute__((const))
278int __ilog2_u64(u64 n)
279{
280 union {
281 u64 ll;
282 struct { u32 h, l; };
283 } _;
284 int bit, x, y;
285
286 _.ll = n;
287
288 asm(" subcc %3,gr0,gr0,icc0 \n"
289 " ckeq icc0,cc4 \n"
290 " cscan.p %3,gr0,%0 ,cc4,0 \n"
291 " setlos #63,%1 \n"
292 " cscan.p %4,gr0,%0 ,cc4,1 \n"
293 " setlos #31,%2 \n"
294 " csub.p %1,%0,%0 ,cc4,0 \n"
295 " csub %2,%0,%0 ,cc4,1 \n"
296 : "=&r"(bit), "=r"(x), "=r"(y)
297 : "0r"(_.h), "r"(_.l)
298 : "icc0", "cc4"
299 );
300 return bit;
301}
302
259#include <asm-generic/bitops/sched.h> 303#include <asm-generic/bitops/sched.h>
260#include <asm-generic/bitops/hweight.h> 304#include <asm-generic/bitops/hweight.h>
261 305
diff --git a/include/asm-frv/cacheflush.h b/include/asm-frv/cacheflush.h
index eaa5826bc1c8..02500405a6fb 100644
--- a/include/asm-frv/cacheflush.h
+++ b/include/asm-frv/cacheflush.h
@@ -20,6 +20,7 @@
20 */ 20 */
21#define flush_cache_all() do {} while(0) 21#define flush_cache_all() do {} while(0)
22#define flush_cache_mm(mm) do {} while(0) 22#define flush_cache_mm(mm) do {} while(0)
23#define flush_cache_dup_mm(mm) do {} while(0)
23#define flush_cache_range(mm, start, end) do {} while(0) 24#define flush_cache_range(mm, start, end) do {} while(0)
24#define flush_cache_page(vma, vmaddr, pfn) do {} while(0) 25#define flush_cache_page(vma, vmaddr, pfn) do {} while(0)
25#define flush_cache_vmap(start, end) do {} while(0) 26#define flush_cache_vmap(start, end) do {} while(0)
diff --git a/include/asm-frv/page.h b/include/asm-frv/page.h
index 134cc0cdf6c2..213d92fd652a 100644
--- a/include/asm-frv/page.h
+++ b/include/asm-frv/page.h
@@ -76,8 +76,6 @@ extern unsigned long max_pfn;
76 76
77#endif /* __ASSEMBLY__ */ 77#endif /* __ASSEMBLY__ */
78 78
79#endif /* __KERNEL__ */
80
81#ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC 79#ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC
82#define WANT_PAGE_VIRTUAL 1 80#define WANT_PAGE_VIRTUAL 1
83#endif 81#endif
@@ -85,4 +83,6 @@ extern unsigned long max_pfn;
85#include <asm-generic/memory_model.h> 83#include <asm-generic/memory_model.h>
86#include <asm-generic/page.h> 84#include <asm-generic/page.h>
87 85
86#endif /* __KERNEL__ */
87
88#endif /* _ASM_PAGE_H */ 88#endif /* _ASM_PAGE_H */
diff --git a/include/asm-frv/ptrace.h b/include/asm-frv/ptrace.h
index 9a2241b8eb1e..cf6934012b64 100644
--- a/include/asm-frv/ptrace.h
+++ b/include/asm-frv/ptrace.h
@@ -12,9 +12,11 @@
12#define _ASM_PTRACE_H 12#define _ASM_PTRACE_H
13 13
14#include <asm/registers.h> 14#include <asm/registers.h>
15#ifdef __KERNEL__
15#include <asm/irq_regs.h> 16#include <asm/irq_regs.h>
16 17
17#define in_syscall(regs) (((regs)->tbr & TBR_TT) == TBR_TT_TRAP0) 18#define in_syscall(regs) (((regs)->tbr & TBR_TT) == TBR_TT_TRAP0)
19#endif
18 20
19 21
20#define PT_PSR 0 22#define PT_PSR 0
@@ -60,6 +62,7 @@
60#define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */ 62#define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */
61#define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */ 63#define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */
62 64
65#ifdef __KERNEL__
63#ifndef __ASSEMBLY__ 66#ifndef __ASSEMBLY__
64 67
65/* 68/*
@@ -74,6 +77,7 @@ register struct pt_regs *__frame asm("gr28");
74extern unsigned long user_stack(const struct pt_regs *); 77extern unsigned long user_stack(const struct pt_regs *);
75extern void show_regs(struct pt_regs *); 78extern void show_regs(struct pt_regs *);
76#define profile_pc(regs) ((regs)->pc) 79#define profile_pc(regs) ((regs)->pc)
80#endif
77 81
78#endif /* !__ASSEMBLY__ */ 82#endif /* !__ASSEMBLY__ */
79#endif /* _ASM_PTRACE_H */ 83#endif /* _ASM_PTRACE_H */
diff --git a/include/asm-frv/termbits.h b/include/asm-frv/termbits.h
index 74f20d6e292f..2d6d389cff49 100644
--- a/include/asm-frv/termbits.h
+++ b/include/asm-frv/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20/* c_cc characters */ 31/* c_cc characters */
21#define VINTR 0 32#define VINTR 0
22#define VQUIT 1 33#define VQUIT 1
diff --git a/include/asm-frv/termios.h b/include/asm-frv/termios.h
index b4a664e7f55c..8840cf95e8dd 100644
--- a/include/asm-frv/termios.h
+++ b/include/asm-frv/termios.h
@@ -69,6 +69,8 @@ struct termio {
69#define N_SYNC_PPP 14 69#define N_SYNC_PPP 14
70#define N_HCI 15 /* Bluetooth HCI UART */ 70#define N_HCI 15 /* Bluetooth HCI UART */
71 71
72#ifdef __KERNEL__
72#include <asm-generic/termios.h> 73#include <asm-generic/termios.h>
74#endif
73 75
74#endif /* _ASM_TERMIOS_H */ 76#endif /* _ASM_TERMIOS_H */
diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h
index d66c48e6ef14..d881f518e6a9 100644
--- a/include/asm-frv/thread_info.h
+++ b/include/asm-frv/thread_info.h
@@ -116,6 +116,7 @@ register struct thread_info *__current_thread_info asm("gr15");
116#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */ 116#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
117#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 117#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
118#define TIF_MEMDIE 17 /* OOM killer killed process */ 118#define TIF_MEMDIE 17 /* OOM killer killed process */
119#define TIF_FREEZE 18 /* freezing for suspend */
119 120
120#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 121#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
121#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 122#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
@@ -125,6 +126,7 @@ register struct thread_info *__current_thread_info asm("gr15");
125#define _TIF_IRET (1 << TIF_IRET) 126#define _TIF_IRET (1 << TIF_IRET)
126#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 127#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
127#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 128#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
129#define _TIF_FREEZE (1 << TIF_FREEZE)
128 130
129#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ 131#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
130#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ 132#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index c92ae0f166ff..14fae1fa87df 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -4,6 +4,22 @@
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5 5
6#ifdef CONFIG_BUG 6#ifdef CONFIG_BUG
7
8#ifdef CONFIG_GENERIC_BUG
9#ifndef __ASSEMBLY__
10struct bug_entry {
11 unsigned long bug_addr;
12#ifdef CONFIG_DEBUG_BUGVERBOSE
13 const char *file;
14 unsigned short line;
15#endif
16 unsigned short flags;
17};
18#endif /* __ASSEMBLY__ */
19
20#define BUGFLAG_WARNING (1<<0)
21#endif /* CONFIG_GENERIC_BUG */
22
7#ifndef HAVE_ARCH_BUG 23#ifndef HAVE_ARCH_BUG
8#define BUG() do { \ 24#define BUG() do { \
9 printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ 25 printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \
@@ -19,7 +35,7 @@
19#define WARN_ON(condition) ({ \ 35#define WARN_ON(condition) ({ \
20 typeof(condition) __ret_warn_on = (condition); \ 36 typeof(condition) __ret_warn_on = (condition); \
21 if (unlikely(__ret_warn_on)) { \ 37 if (unlikely(__ret_warn_on)) { \
22 printk("BUG: warning at %s:%d/%s()\n", __FILE__, \ 38 printk("BUG: at %s:%d %s()\n", __FILE__, \
23 __LINE__, __FUNCTION__); \ 39 __LINE__, __FUNCTION__); \
24 dump_stack(); \ 40 dump_stack(); \
25 } \ 41 } \
diff --git a/include/asm-generic/libata-portmap.h b/include/asm-generic/libata-portmap.h
index 9202fd02d5be..62fb3618293d 100644
--- a/include/asm-generic/libata-portmap.h
+++ b/include/asm-generic/libata-portmap.h
@@ -3,10 +3,10 @@
3 3
4#define ATA_PRIMARY_CMD 0x1F0 4#define ATA_PRIMARY_CMD 0x1F0
5#define ATA_PRIMARY_CTL 0x3F6 5#define ATA_PRIMARY_CTL 0x3F6
6#define ATA_PRIMARY_IRQ 14 6#define ATA_PRIMARY_IRQ(dev) 14
7 7
8#define ATA_SECONDARY_CMD 0x170 8#define ATA_SECONDARY_CMD 0x170
9#define ATA_SECONDARY_CTL 0x376 9#define ATA_SECONDARY_CTL 0x376
10#define ATA_SECONDARY_IRQ 15 10#define ATA_SECONDARY_IRQ(dev) 15
11 11
12#endif 12#endif
diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h
index a96b5d986b6e..b55052ce2330 100644
--- a/include/asm-generic/page.h
+++ b/include/asm-generic/page.h
@@ -4,21 +4,51 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5#ifndef __ASSEMBLY__ 5#ifndef __ASSEMBLY__
6 6
7#include <linux/compiler.h> 7#include <linux/log2.h>
8 8
9/* Pure 2^n version of get_order */ 9/*
10static __inline__ __attribute_const__ int get_order(unsigned long size) 10 * non-const pure 2^n version of get_order
11 * - the arch may override these in asm/bitops.h if they can be implemented
12 * more efficiently than using the arch log2 routines
13 * - we use the non-const log2() instead if the arch has defined one suitable
14 */
15#ifndef ARCH_HAS_GET_ORDER
16static inline __attribute__((const))
17int __get_order(unsigned long size, int page_shift)
11{ 18{
19#if BITS_PER_LONG == 32 && defined(ARCH_HAS_ILOG2_U32)
20 int order = __ilog2_u32(size) - page_shift;
21 return order >= 0 ? order : 0;
22#elif BITS_PER_LONG == 64 && defined(ARCH_HAS_ILOG2_U64)
23 int order = __ilog2_u64(size) - page_shift;
24 return order >= 0 ? order : 0;
25#else
12 int order; 26 int order;
13 27
14 size = (size - 1) >> (PAGE_SHIFT - 1); 28 size = (size - 1) >> (page_shift - 1);
15 order = -1; 29 order = -1;
16 do { 30 do {
17 size >>= 1; 31 size >>= 1;
18 order++; 32 order++;
19 } while (size); 33 } while (size);
20 return order; 34 return order;
35#endif
21} 36}
37#endif
38
39/**
40 * get_order - calculate log2(pages) to hold a block of the specified size
41 * @n - size
42 *
43 * calculate allocation order based on the current page size
44 * - this can be used to initialise global variables from constant data
45 */
46#define get_order(n) \
47( \
48 __builtin_constant_p(n) ? \
49 ((n < (1UL << PAGE_SHIFT)) ? 0 : ilog2(n) - PAGE_SHIFT) : \
50 __get_order(n, PAGE_SHIFT) \
51 )
22 52
23#endif /* __ASSEMBLY__ */ 53#endif /* __ASSEMBLY__ */
24#endif /* __KERNEL__ */ 54#endif /* __KERNEL__ */
diff --git a/include/asm-generic/termios.h b/include/asm-generic/termios.h
index 1e58ca39592c..3769e6bd63b1 100644
--- a/include/asm-generic/termios.h
+++ b/include/asm-generic/termios.h
@@ -11,7 +11,7 @@
11/* 11/*
12 * Translate a "termio" structure into a "termios". Ugh. 12 * Translate a "termio" structure into a "termios". Ugh.
13 */ 13 */
14static inline int user_termio_to_kernel_termios(struct termios *termios, 14static inline int user_termio_to_kernel_termios(struct ktermios *termios,
15 struct termio __user *termio) 15 struct termio __user *termio)
16{ 16{
17 unsigned short tmp; 17 unsigned short tmp;
@@ -48,7 +48,7 @@ static inline int user_termio_to_kernel_termios(struct termios *termios,
48 * Translate a "termios" structure into a "termio". Ugh. 48 * Translate a "termios" structure into a "termio". Ugh.
49 */ 49 */
50static inline int kernel_termios_to_user_termio(struct termio __user *termio, 50static inline int kernel_termios_to_user_termio(struct termio __user *termio,
51 struct termios *termios) 51 struct ktermios *termios)
52{ 52{
53 if (put_user(termios->c_iflag, &termio->c_iflag) < 0 || 53 if (put_user(termios->c_iflag, &termio->c_iflag) < 0 ||
54 put_user(termios->c_oflag, &termio->c_oflag) < 0 || 54 put_user(termios->c_oflag, &termio->c_oflag) < 0 ||
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 4d4c62d11059..9fcc8d9fbb14 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -35,6 +35,9 @@
35 VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \ 35 VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \
36 *(.pci_fixup_enable) \ 36 *(.pci_fixup_enable) \
37 VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \ 37 VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \
38 VMLINUX_SYMBOL(__start_pci_fixups_resume) = .; \
39 *(.pci_fixup_resume) \
40 VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \
38 } \ 41 } \
39 \ 42 \
40 /* RapidIO route ops */ \ 43 /* RapidIO route ops */ \
@@ -119,8 +122,6 @@
119 *(__ksymtab_strings) \ 122 *(__ksymtab_strings) \
120 } \ 123 } \
121 \ 124 \
122 EH_FRAME \
123 \
124 /* Built-in module parameters. */ \ 125 /* Built-in module parameters. */ \
125 __param : AT(ADDR(__param) - LOAD_OFFSET) { \ 126 __param : AT(ADDR(__param) - LOAD_OFFSET) { \
126 VMLINUX_SYMBOL(__start___param) = .; \ 127 VMLINUX_SYMBOL(__start___param) = .; \
@@ -160,26 +161,6 @@
160 *(.kprobes.text) \ 161 *(.kprobes.text) \
161 VMLINUX_SYMBOL(__kprobes_text_end) = .; 162 VMLINUX_SYMBOL(__kprobes_text_end) = .;
162 163
163#ifdef CONFIG_STACK_UNWIND
164#define EH_FRAME \
165 /* Unwind data binary search table */ \
166 . = ALIGN(8); \
167 .eh_frame_hdr : AT(ADDR(.eh_frame_hdr) - LOAD_OFFSET) { \
168 VMLINUX_SYMBOL(__start_unwind_hdr) = .; \
169 *(.eh_frame_hdr) \
170 VMLINUX_SYMBOL(__end_unwind_hdr) = .; \
171 } \
172 /* Unwind data */ \
173 . = ALIGN(8); \
174 .eh_frame : AT(ADDR(.eh_frame) - LOAD_OFFSET) { \
175 VMLINUX_SYMBOL(__start_unwind) = .; \
176 *(.eh_frame) \
177 VMLINUX_SYMBOL(__end_unwind) = .; \
178 }
179#else
180#define EH_FRAME
181#endif
182
183 /* DWARF debug sections. 164 /* DWARF debug sections.
184 Symbols in the DWARF debugging sections are relative to 165 Symbols in the DWARF debugging sections are relative to
185 the beginning of the section so we begin them at 0. */ 166 the beginning of the section so we begin them at 0. */
@@ -218,6 +199,14 @@
218 .stab.indexstr 0 : { *(.stab.indexstr) } \ 199 .stab.indexstr 0 : { *(.stab.indexstr) } \
219 .comment 0 : { *(.comment) } 200 .comment 0 : { *(.comment) }
220 201
202#define BUG_TABLE \
203 . = ALIGN(8); \
204 __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \
205 __start___bug_table = .; \
206 *(__bug_table) \
207 __stop___bug_table = .; \
208 }
209
221#define NOTES \ 210#define NOTES \
222 .notes : { *(.note.*) } :note 211 .notes : { *(.note.*) } :note
223 212
@@ -234,6 +223,7 @@
234 *(.initcall4s.init) \ 223 *(.initcall4s.init) \
235 *(.initcall5.init) \ 224 *(.initcall5.init) \
236 *(.initcall5s.init) \ 225 *(.initcall5s.init) \
226 *(.initcallrootfs.init) \
237 *(.initcall6.init) \ 227 *(.initcall6.init) \
238 *(.initcall6s.init) \ 228 *(.initcall6s.init) \
239 *(.initcall7.init) \ 229 *(.initcall7.init) \
diff --git a/include/asm-h8300/cacheflush.h b/include/asm-h8300/cacheflush.h
index 1e4d95bb5ec9..71210d141b64 100644
--- a/include/asm-h8300/cacheflush.h
+++ b/include/asm-h8300/cacheflush.h
@@ -12,6 +12,7 @@
12 12
13#define flush_cache_all() 13#define flush_cache_all()
14#define flush_cache_mm(mm) 14#define flush_cache_mm(mm)
15#define flush_cache_dup_mm(mm) do { } while (0)
15#define flush_cache_range(vma,a,b) 16#define flush_cache_range(vma,a,b)
16#define flush_cache_page(vma,p,pfn) 17#define flush_cache_page(vma,p,pfn)
17#define flush_dcache_page(page) 18#define flush_dcache_page(page)
diff --git a/include/asm-h8300/termbits.h b/include/asm-h8300/termbits.h
index fa69ae00eda3..6a1f4d3807b4 100644
--- a/include/asm-h8300/termbits.h
+++ b/include/asm-h8300/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20/* c_cc characters */ 31/* c_cc characters */
21#define VINTR 0 32#define VINTR 0
22#define VQUIT 1 33#define VQUIT 1
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
index c80b3a94511a..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 */
@@ -56,36 +56,14 @@
56#define ACPI_ENABLE_IRQS() local_irq_enable() 56#define ACPI_ENABLE_IRQS() local_irq_enable()
57#define ACPI_FLUSH_CPU_CACHE() wbinvd() 57#define ACPI_FLUSH_CPU_CACHE() wbinvd()
58 58
59int __acpi_acquire_global_lock(unsigned int *lock);
60int __acpi_release_global_lock(unsigned int *lock);
59 61
60static inline int 62#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
61__acpi_acquire_global_lock (unsigned int *lock) 63 ((Acq) = __acpi_acquire_global_lock(&facs->global_lock))
62{
63 unsigned int old, new, val;
64 do {
65 old = *lock;
66 new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
67 val = cmpxchg(lock, old, new);
68 } while (unlikely (val != old));
69 return (new < 3) ? -1 : 0;
70}
71
72static inline int
73__acpi_release_global_lock (unsigned int *lock)
74{
75 unsigned int old, new, val;
76 do {
77 old = *lock;
78 new = old & ~0x3;
79 val = cmpxchg(lock, old, new);
80 } while (unlikely (val != old));
81 return old & 0x1;
82}
83 64
84#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ 65#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
85 ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr)) 66 ((Acq) = __acpi_release_global_lock(&facs->global_lock))
86
87#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
88 ((Acq) = __acpi_release_global_lock((unsigned int *) GLptr))
89 67
90/* 68/*
91 * Math helper asm macros 69 * Math helper asm macros
@@ -109,7 +87,7 @@ extern void check_acpi_pci(void);
109static inline void check_acpi_pci(void) { } 87static inline void check_acpi_pci(void) { }
110#endif 88#endif
111 89
112#ifdef CONFIG_ACPI 90#ifdef CONFIG_ACPI
113extern int acpi_lapic; 91extern int acpi_lapic;
114extern int acpi_ioapic; 92extern int acpi_ioapic;
115extern int acpi_noirq; 93extern int acpi_noirq;
@@ -117,9 +95,9 @@ extern int acpi_strict;
117extern int acpi_disabled; 95extern int acpi_disabled;
118extern int acpi_ht; 96extern int acpi_ht;
119extern int acpi_pci_disabled; 97extern int acpi_pci_disabled;
120static inline void disable_acpi(void) 98static inline void disable_acpi(void)
121{ 99{
122 acpi_disabled = 1; 100 acpi_disabled = 1;
123 acpi_ht = 0; 101 acpi_ht = 0;
124 acpi_pci_disabled = 1; 102 acpi_pci_disabled = 1;
125 acpi_noirq = 1; 103 acpi_noirq = 1;
@@ -136,9 +114,9 @@ extern int acpi_use_timer_override;
136#endif 114#endif
137 115
138static inline void acpi_noirq_set(void) { acpi_noirq = 1; } 116static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
139static inline void acpi_disable_pci(void) 117static inline void acpi_disable_pci(void)
140{ 118{
141 acpi_pci_disabled = 1; 119 acpi_pci_disabled = 1;
142 acpi_noirq_set(); 120 acpi_noirq_set();
143} 121}
144extern int acpi_irq_balance_set(char *str); 122extern int acpi_irq_balance_set(char *str);
@@ -166,8 +144,6 @@ extern void acpi_reserve_bootmem(void);
166 144
167#endif /*CONFIG_ACPI_SLEEP*/ 145#endif /*CONFIG_ACPI_SLEEP*/
168 146
169extern u8 x86_acpiid_to_apicid[];
170
171#define ARCH_HAS_POWER_INIT 1 147#define ARCH_HAS_POWER_INIT 1
172 148
173#endif /*__KERNEL__*/ 149#endif /*__KERNEL__*/
diff --git a/include/asm-i386/boot.h b/include/asm-i386/boot.h
index 8ce79a6fa891..e7686d0a8413 100644
--- a/include/asm-i386/boot.h
+++ b/include/asm-i386/boot.h
@@ -13,7 +13,8 @@
13#define ASK_VGA 0xfffd /* ask for it at bootup */ 13#define ASK_VGA 0xfffd /* ask for it at bootup */
14 14
15/* Physical address where kenrel should be loaded. */ 15/* Physical address where kenrel should be loaded. */
16#define LOAD_PHYSICAL_ADDR ((0x100000 + CONFIG_PHYSICAL_ALIGN - 1) \ 16#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
17 + (CONFIG_PHYSICAL_ALIGN - 1)) \
17 & ~(CONFIG_PHYSICAL_ALIGN - 1)) 18 & ~(CONFIG_PHYSICAL_ALIGN - 1))
18 19
19#endif /* _LINUX_BOOT_H */ 20#endif /* _LINUX_BOOT_H */
diff --git a/include/asm-i386/bug.h b/include/asm-i386/bug.h
index 8062cdbf2587..b0fd78ca2619 100644
--- a/include/asm-i386/bug.h
+++ b/include/asm-i386/bug.h
@@ -4,20 +4,32 @@
4 4
5/* 5/*
6 * Tell the user there is some problem. 6 * Tell the user there is some problem.
7 * The offending file and line are encoded after the "officially 7 * The offending file and line are encoded encoded in the __bug_table section.
8 * undefined" opcode for parsing in the trap handler.
9 */ 8 */
10 9
11#ifdef CONFIG_BUG 10#ifdef CONFIG_BUG
12#define HAVE_ARCH_BUG 11#define HAVE_ARCH_BUG
12
13#ifdef CONFIG_DEBUG_BUGVERBOSE 13#ifdef CONFIG_DEBUG_BUGVERBOSE
14#define BUG() \ 14#define BUG() \
15 __asm__ __volatile__( "ud2\n" \ 15 do { \
16 "\t.word %c0\n" \ 16 asm volatile("1:\tud2\n" \
17 "\t.long %c1\n" \ 17 ".pushsection __bug_table,\"a\"\n" \
18 : : "i" (__LINE__), "i" (__FILE__)) 18 "2:\t.long 1b, %c0\n" \
19 "\t.word %c1, 0\n" \
20 "\t.org 2b+%c2\n" \
21 ".popsection" \
22 : : "i" (__FILE__), "i" (__LINE__), \
23 "i" (sizeof(struct bug_entry))); \
24 for(;;) ; \
25 } while(0)
26
19#else 27#else
20#define BUG() __asm__ __volatile__("ud2\n") 28#define BUG() \
29 do { \
30 asm volatile("ud2"); \
31 for(;;) ; \
32 } while(0)
21#endif 33#endif
22#endif 34#endif
23 35
diff --git a/include/asm-i386/cacheflush.h b/include/asm-i386/cacheflush.h
index 7199f7b326f1..74e03c8f2e51 100644
--- a/include/asm-i386/cacheflush.h
+++ b/include/asm-i386/cacheflush.h
@@ -7,6 +7,7 @@
7/* Caches aren't brain-dead on the intel. */ 7/* Caches aren't brain-dead on the intel. */
8#define flush_cache_all() do { } while (0) 8#define flush_cache_all() do { } while (0)
9#define flush_cache_mm(mm) do { } while (0) 9#define flush_cache_mm(mm) do { } while (0)
10#define flush_cache_dup_mm(mm) do { } while (0)
10#define flush_cache_range(vma, start, end) do { } while (0) 11#define flush_cache_range(vma, start, end) do { } while (0)
11#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 12#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
12#define flush_dcache_page(page) do { } while (0) 13#define flush_dcache_page(page) do { } while (0)
diff --git a/include/asm-i386/e820.h b/include/asm-i386/e820.h
index 395077aba583..c5b8fc6109d6 100644
--- a/include/asm-i386/e820.h
+++ b/include/asm-i386/e820.h
@@ -40,7 +40,7 @@ extern int e820_all_mapped(unsigned long start, unsigned long end,
40 unsigned type); 40 unsigned type);
41extern void find_max_pfn(void); 41extern void find_max_pfn(void);
42extern void register_bootmem_low_pages(unsigned long max_low_pfn); 42extern void register_bootmem_low_pages(unsigned long max_low_pfn);
43extern void register_memory(void); 43extern void e820_register_memory(void);
44extern void limit_regions(unsigned long long size); 44extern void limit_regions(unsigned long long size);
45extern void print_memory_map(char *who); 45extern void print_memory_map(char *who);
46 46
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index 45d21a0c95bf..369035dfe4b6 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -143,11 +143,8 @@ extern int dump_task_extended_fpu (struct task_struct *, struct user_fxsr_struct
143# define VDSO_PRELINK 0 143# define VDSO_PRELINK 0
144#endif 144#endif
145 145
146#define VDSO_COMPAT_SYM(x) \
147 (VDSO_COMPAT_BASE + (unsigned long)(x) - VDSO_PRELINK)
148
149#define VDSO_SYM(x) \ 146#define VDSO_SYM(x) \
150 (VDSO_BASE + (unsigned long)(x) - VDSO_PRELINK) 147 (VDSO_COMPAT_BASE + (unsigned long)(x) - VDSO_PRELINK)
151 148
152#define VDSO_HIGH_EHDR ((const struct elfhdr *) VDSO_HIGH_BASE) 149#define VDSO_HIGH_EHDR ((const struct elfhdr *) VDSO_HIGH_BASE)
153#define VDSO_EHDR ((const struct elfhdr *) VDSO_COMPAT_BASE) 150#define VDSO_EHDR ((const struct elfhdr *) VDSO_COMPAT_BASE)
@@ -156,10 +153,12 @@ extern void __kernel_vsyscall;
156 153
157#define VDSO_ENTRY VDSO_SYM(&__kernel_vsyscall) 154#define VDSO_ENTRY VDSO_SYM(&__kernel_vsyscall)
158 155
156#ifndef CONFIG_COMPAT_VDSO
159#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 157#define ARCH_HAS_SETUP_ADDITIONAL_PAGES
160struct linux_binprm; 158struct linux_binprm;
161extern int arch_setup_additional_pages(struct linux_binprm *bprm, 159extern int arch_setup_additional_pages(struct linux_binprm *bprm,
162 int executable_stack); 160 int executable_stack);
161#endif
163 162
164extern unsigned int vdso_enabled; 163extern unsigned int vdso_enabled;
165 164
@@ -169,50 +168,6 @@ do if (vdso_enabled) { \
169 NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_COMPAT_BASE); \ 168 NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_COMPAT_BASE); \
170} while (0) 169} while (0)
171 170
172/*
173 * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
174 * extra segments containing the vsyscall DSO contents. Dumping its
175 * contents makes post-mortem fully interpretable later without matching up
176 * the same kernel and hardware config to see what PC values meant.
177 * Dumping its extra ELF program headers includes all the other information
178 * a debugger needs to easily find how the vsyscall DSO was being used.
179 */
180#define ELF_CORE_EXTRA_PHDRS (VDSO_HIGH_EHDR->e_phnum)
181#define ELF_CORE_WRITE_EXTRA_PHDRS \
182do { \
183 const struct elf_phdr *const vsyscall_phdrs = \
184 (const struct elf_phdr *) (VDSO_HIGH_BASE \
185 + VDSO_HIGH_EHDR->e_phoff); \
186 int i; \
187 Elf32_Off ofs = 0; \
188 for (i = 0; i < VDSO_HIGH_EHDR->e_phnum; ++i) { \
189 struct elf_phdr phdr = vsyscall_phdrs[i]; \
190 if (phdr.p_type == PT_LOAD) { \
191 BUG_ON(ofs != 0); \
192 ofs = phdr.p_offset = offset; \
193 phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz); \
194 phdr.p_filesz = phdr.p_memsz; \
195 offset += phdr.p_filesz; \
196 } \
197 else \
198 phdr.p_offset += ofs; \
199 phdr.p_paddr = 0; /* match other core phdrs */ \
200 DUMP_WRITE(&phdr, sizeof(phdr)); \
201 } \
202} while (0)
203#define ELF_CORE_WRITE_EXTRA_DATA \
204do { \
205 const struct elf_phdr *const vsyscall_phdrs = \
206 (const struct elf_phdr *) (VDSO_HIGH_BASE \
207 + VDSO_HIGH_EHDR->e_phoff); \
208 int i; \
209 for (i = 0; i < VDSO_HIGH_EHDR->e_phnum; ++i) { \
210 if (vsyscall_phdrs[i].p_type == PT_LOAD) \
211 DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \
212 PAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \
213 } \
214} while (0)
215
216#endif 171#endif
217 172
218#endif 173#endif
diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h
index 02428cb36621..3e9f610c35df 100644
--- a/include/asm-i386/fixmap.h
+++ b/include/asm-i386/fixmap.h
@@ -23,6 +23,8 @@
23extern unsigned long __FIXADDR_TOP; 23extern unsigned long __FIXADDR_TOP;
24#else 24#else
25#define __FIXADDR_TOP 0xfffff000 25#define __FIXADDR_TOP 0xfffff000
26#define FIXADDR_USER_START __fix_to_virt(FIX_VDSO)
27#define FIXADDR_USER_END __fix_to_virt(FIX_VDSO - 1)
26#endif 28#endif
27 29
28#ifndef __ASSEMBLY__ 30#ifndef __ASSEMBLY__
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
index 73465d2892b9..0fc240c80f49 100644
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -40,13 +40,14 @@ static __inline__ int ide_default_irq(unsigned long base)
40 40
41static __inline__ unsigned long ide_default_io_base(int index) 41static __inline__ unsigned long ide_default_io_base(int index)
42{ 42{
43 struct pci_dev *pdev;
43 /* 44 /*
44 * If PCI is present then it is not safe to poke around 45 * If PCI is present then it is not safe to poke around
45 * the other legacy IDE ports. Only 0x1f0 and 0x170 are 46 * the other legacy IDE ports. Only 0x1f0 and 0x170 are
46 * defined compatibility mode ports for PCI. A user can 47 * defined compatibility mode ports for PCI. A user can
47 * override this using ide= but we must default safe. 48 * override this using ide= but we must default safe.
48 */ 49 */
49 if (pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) { 50 if ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL)) == NULL) {
50 switch(index) { 51 switch(index) {
51 case 2: return 0x1e8; 52 case 2: return 0x1e8;
52 case 3: return 0x168; 53 case 3: return 0x168;
@@ -54,6 +55,7 @@ static __inline__ unsigned long ide_default_io_base(int index)
54 case 5: return 0x160; 55 case 5: return 0x160;
55 } 56 }
56 } 57 }
58 pci_dev_put(pdev);
57 switch (index) { 59 switch (index) {
58 case 0: return 0x1f0; 60 case 0: return 0x1f0;
59 case 1: return 0x170; 61 case 1: return 0x170;
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/msr.h b/include/asm-i386/msr.h
index 5679d4993072..609a3899475c 100644
--- a/include/asm-i386/msr.h
+++ b/include/asm-i386/msr.h
@@ -100,6 +100,8 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val)
100 100
101#define MSR_P6_PERFCTR0 0xc1 101#define MSR_P6_PERFCTR0 0xc1
102#define MSR_P6_PERFCTR1 0xc2 102#define MSR_P6_PERFCTR1 0xc2
103#define MSR_FSB_FREQ 0xcd
104
103 105
104#define MSR_IA32_BBL_CR_CTL 0x119 106#define MSR_IA32_BBL_CR_CTL 0x119
105 107
@@ -130,6 +132,9 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val)
130#define MSR_IA32_PERF_STATUS 0x198 132#define MSR_IA32_PERF_STATUS 0x198
131#define MSR_IA32_PERF_CTL 0x199 133#define MSR_IA32_PERF_CTL 0x199
132 134
135#define MSR_IA32_MPERF 0xE7
136#define MSR_IA32_APERF 0xE8
137
133#define MSR_IA32_THERM_CONTROL 0x19a 138#define MSR_IA32_THERM_CONTROL 0x19a
134#define MSR_IA32_THERM_INTERRUPT 0x19b 139#define MSR_IA32_THERM_INTERRUPT 0x19b
135#define MSR_IA32_THERM_STATUS 0x19c 140#define MSR_IA32_THERM_STATUS 0x19c
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index fd3f64ace248..7b19f454761d 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -143,7 +143,9 @@ extern int page_is_ram(unsigned long pagenr);
143#include <asm-generic/memory_model.h> 143#include <asm-generic/memory_model.h>
144#include <asm-generic/page.h> 144#include <asm-generic/page.h>
145 145
146#ifndef CONFIG_COMPAT_VDSO
146#define __HAVE_ARCH_GATE_AREA 1 147#define __HAVE_ARCH_GATE_AREA 1
148#endif
147#endif /* __KERNEL__ */ 149#endif /* __KERNEL__ */
148 150
149#endif /* _I386_PAGE_H */ 151#endif /* _I386_PAGE_H */
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index a52d65440429..359f10b54f59 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -743,6 +743,7 @@ extern void enable_sep_cpu(void);
743extern int sysenter_setup(void); 743extern int sysenter_setup(void);
744 744
745extern int init_gdt(int cpu, struct task_struct *idle); 745extern int init_gdt(int cpu, struct task_struct *idle);
746extern void cpu_set_gdt(int);
746extern void secondary_cpu_init(void); 747extern void secondary_cpu_init(void);
747 748
748#endif /* __ASM_I386_PROCESSOR_H */ 749#endif /* __ASM_I386_PROCESSOR_H */
diff --git a/include/asm-i386/termbits.h b/include/asm-i386/termbits.h
index 72c10e3190f8..12baf1d6343f 100644
--- a/include/asm-i386/termbits.h
+++ b/include/asm-i386/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20/* c_cc characters */ 31/* c_cc characters */
21#define VINTR 0 32#define VINTR 0
22#define VQUIT 1 33#define VQUIT 1
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 46d32ad92082..4b187bb377b4 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -134,6 +134,7 @@ static inline struct thread_info *current_thread_info(void)
134#define TIF_MEMDIE 16 134#define TIF_MEMDIE 16
135#define TIF_DEBUG 17 /* uses debug registers */ 135#define TIF_DEBUG 17 /* uses debug registers */
136#define TIF_IO_BITMAP 18 /* uses I/O bitmap */ 136#define TIF_IO_BITMAP 18 /* uses I/O bitmap */
137#define TIF_FREEZE 19 /* is freezing for suspend */
137 138
138#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 139#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
139#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 140#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -147,6 +148,7 @@ static inline struct thread_info *current_thread_info(void)
147#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 148#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
148#define _TIF_DEBUG (1<<TIF_DEBUG) 149#define _TIF_DEBUG (1<<TIF_DEBUG)
149#define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP) 150#define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP)
151#define _TIF_FREEZE (1<<TIF_FREEZE)
150 152
151/* work to do on interrupt/exception return */ 153/* work to do on interrupt/exception return */
152#define _TIF_WORK_MASK \ 154#define _TIF_WORK_MASK \
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h
index 978d09596130..ac58580ad664 100644
--- a/include/asm-i386/topology.h
+++ b/include/asm-i386/topology.h
@@ -89,6 +89,7 @@ static inline int node_to_first_cpu(int node)
89 .flags = SD_LOAD_BALANCE \ 89 .flags = SD_LOAD_BALANCE \
90 | SD_BALANCE_EXEC \ 90 | SD_BALANCE_EXEC \
91 | SD_BALANCE_FORK \ 91 | SD_BALANCE_FORK \
92 | SD_SERIALIZE \
92 | SD_WAKE_BALANCE, \ 93 | SD_WAKE_BALANCE, \
93 .last_balance = jiffies, \ 94 .last_balance = jiffies, \
94 .balance_interval = 1, \ 95 .balance_interval = 1, \
diff --git a/include/asm-i386/unwind.h b/include/asm-i386/unwind.h
index aa2c931e30db..43c70c3de2f9 100644
--- a/include/asm-i386/unwind.h
+++ b/include/asm-i386/unwind.h
@@ -1,95 +1,6 @@
1#ifndef _ASM_I386_UNWIND_H 1#ifndef _ASM_I386_UNWIND_H
2#define _ASM_I386_UNWIND_H 2#define _ASM_I386_UNWIND_H
3 3
4/*
5 * Copyright (C) 2002-2006 Novell, Inc.
6 * Jan Beulich <jbeulich@novell.com>
7 * This code is released under version 2 of the GNU GPL.
8 */
9
10#ifdef CONFIG_STACK_UNWIND
11
12#include <linux/sched.h>
13#include <asm/fixmap.h>
14#include <asm/ptrace.h>
15#include <asm/uaccess.h>
16
17struct unwind_frame_info
18{
19 struct pt_regs regs;
20 struct task_struct *task;
21 unsigned call_frame:1;
22};
23
24#define UNW_PC(frame) (frame)->regs.eip
25#define UNW_SP(frame) (frame)->regs.esp
26#ifdef CONFIG_FRAME_POINTER
27#define UNW_FP(frame) (frame)->regs.ebp
28#define FRAME_RETADDR_OFFSET 4
29#define FRAME_LINK_OFFSET 0
30#define STACK_BOTTOM(tsk) STACK_LIMIT((tsk)->thread.esp0)
31#define STACK_TOP(tsk) ((tsk)->thread.esp0)
32#else
33#define UNW_FP(frame) ((void)(frame), 0)
34#endif
35#define STACK_LIMIT(ptr) (((ptr) - 1) & ~(THREAD_SIZE - 1))
36
37#define UNW_REGISTER_INFO \
38 PTREGS_INFO(eax), \
39 PTREGS_INFO(ecx), \
40 PTREGS_INFO(edx), \
41 PTREGS_INFO(ebx), \
42 PTREGS_INFO(esp), \
43 PTREGS_INFO(ebp), \
44 PTREGS_INFO(esi), \
45 PTREGS_INFO(edi), \
46 PTREGS_INFO(eip)
47
48#define UNW_DEFAULT_RA(raItem, dataAlign) \
49 ((raItem).where == Memory && \
50 !((raItem).value * (dataAlign) + 4))
51
52static inline void arch_unw_init_frame_info(struct unwind_frame_info *info,
53 /*const*/ struct pt_regs *regs)
54{
55 if (user_mode_vm(regs))
56 info->regs = *regs;
57 else {
58 memcpy(&info->regs, regs, offsetof(struct pt_regs, esp));
59 info->regs.esp = (unsigned long)&regs->esp;
60 info->regs.xss = __KERNEL_DS;
61 }
62}
63
64static inline void arch_unw_init_blocked(struct unwind_frame_info *info)
65{
66 memset(&info->regs, 0, sizeof(info->regs));
67 info->regs.eip = info->task->thread.eip;
68 info->regs.xcs = __KERNEL_CS;
69 __get_user(info->regs.ebp, (long *)info->task->thread.esp);
70 info->regs.esp = info->task->thread.esp;
71 info->regs.xss = __KERNEL_DS;
72 info->regs.xds = __USER_DS;
73 info->regs.xes = __USER_DS;
74 info->regs.xgs = __KERNEL_PDA;
75}
76
77extern asmlinkage int arch_unwind_init_running(struct unwind_frame_info *,
78 asmlinkage int (*callback)(struct unwind_frame_info *,
79 void *arg),
80 void *arg);
81
82static inline int arch_unw_user_mode(/*const*/ struct unwind_frame_info *info)
83{
84 return user_mode_vm(&info->regs)
85 || info->regs.eip < PAGE_OFFSET
86 || (info->regs.eip >= __fix_to_virt(FIX_VDSO)
87 && info->regs.eip < __fix_to_virt(FIX_VDSO) + PAGE_SIZE)
88 || info->regs.esp < PAGE_OFFSET;
89}
90
91#else
92
93#define UNW_PC(frame) ((void)(frame), 0) 4#define UNW_PC(frame) ((void)(frame), 0)
94#define UNW_SP(frame) ((void)(frame), 0) 5#define UNW_SP(frame) ((void)(frame), 0)
95#define UNW_FP(frame) ((void)(frame), 0) 6#define UNW_FP(frame) ((void)(frame), 0)
@@ -99,6 +10,4 @@ static inline int arch_unw_user_mode(const void *info)
99 return 0; 10 return 0;
100} 11}
101 12
102#endif
103
104#endif /* _ASM_I386_UNWIND_H */ 13#endif /* _ASM_I386_UNWIND_H */
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/break.h b/include/asm-ia64/break.h
index 8167828edc4b..f03402039896 100644
--- a/include/asm-ia64/break.h
+++ b/include/asm-ia64/break.h
@@ -12,8 +12,8 @@
12 * OS-specific debug break numbers: 12 * OS-specific debug break numbers:
13 */ 13 */
14#define __IA64_BREAK_KDB 0x80100 14#define __IA64_BREAK_KDB 0x80100
15#define __IA64_BREAK_KPROBE 0x80200 15#define __IA64_BREAK_KPROBE 0x81000 /* .. 0x81fff */
16#define __IA64_BREAK_JPROBE 0x80300 16#define __IA64_BREAK_JPROBE 0x82000
17 17
18/* 18/*
19 * OS-specific break numbers: 19 * OS-specific break numbers:
diff --git a/include/asm-ia64/cacheflush.h b/include/asm-ia64/cacheflush.h
index f2dacb4245ec..4906916d715b 100644
--- a/include/asm-ia64/cacheflush.h
+++ b/include/asm-ia64/cacheflush.h
@@ -18,6 +18,7 @@
18 18
19#define flush_cache_all() do { } while (0) 19#define flush_cache_all() do { } while (0)
20#define flush_cache_mm(mm) do { } while (0) 20#define flush_cache_mm(mm) do { } while (0)
21#define flush_cache_dup_mm(mm) do { } while (0)
21#define flush_cache_range(vma, start, end) do { } while (0) 22#define flush_cache_range(vma, start, end) do { } while (0)
22#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 23#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
23#define flush_icache_page(vma,page) do { } while (0) 24#define flush_icache_page(vma,page) do { } while (0)
diff --git a/include/asm-ia64/checksum.h b/include/asm-ia64/checksum.h
index 2b78582cbd61..97af155057e4 100644
--- a/include/asm-ia64/checksum.h
+++ b/include/asm-ia64/checksum.h
@@ -72,8 +72,8 @@ static inline __sum16 csum_fold(__wsum csum)
72 72
73#define _HAVE_ARCH_IPV6_CSUM 1 73#define _HAVE_ARCH_IPV6_CSUM 1
74struct in6_addr; 74struct in6_addr;
75extern unsigned short int csum_ipv6_magic(struct in6_addr *saddr, 75extern __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
76 struct in6_addr *daddr, __u32 len, unsigned short proto, 76 const struct in6_addr *daddr, __u32 len, unsigned short proto,
77 unsigned int csum); 77 __wsum csum);
78 78
79#endif /* _ASM_IA64_CHECKSUM_H */ 79#endif /* _ASM_IA64_CHECKSUM_H */
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/kprobes.h b/include/asm-ia64/kprobes.h
index 1b45b71c79b9..828ae00e47c1 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -115,6 +115,7 @@ struct arch_specific_insn {
115 #define INST_FLAG_BREAK_INST 4 115 #define INST_FLAG_BREAK_INST 4
116 unsigned long inst_flag; 116 unsigned long inst_flag;
117 unsigned short target_br_reg; 117 unsigned short target_br_reg;
118 unsigned short slot;
118}; 119};
119 120
120extern int kprobe_exceptions_notify(struct notifier_block *self, 121extern int kprobe_exceptions_notify(struct notifier_block *self,
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/pci.h b/include/asm-ia64/pci.h
index 825eb7d882e6..5160233bbfac 100644
--- a/include/asm-ia64/pci.h
+++ b/include/asm-ia64/pci.h
@@ -78,9 +78,6 @@ pcibios_penalize_isa_irq (int irq, int active)
78#define pci_dac_dma_sync_single_for_cpu(dev,dma_addr,len,dir) do { } while (0) 78#define pci_dac_dma_sync_single_for_cpu(dev,dma_addr,len,dir) do { } while (0)
79#define pci_dac_dma_sync_single_for_device(dev,dma_addr,len,dir) do { mb(); } while (0) 79#define pci_dac_dma_sync_single_for_device(dev,dma_addr,len,dir) do { mb(); } while (0)
80 80
81#define sg_dma_len(sg) ((sg)->dma_length)
82#define sg_dma_address(sg) ((sg)->dma_address)
83
84#ifdef CONFIG_PCI 81#ifdef CONFIG_PCI
85static inline void pci_dma_burst_advice(struct pci_dev *pdev, 82static inline void pci_dma_burst_advice(struct pci_dev *pdev,
86 enum pci_dma_burst_strategy *strat, 83 enum pci_dma_burst_strategy *strat,
@@ -170,4 +167,10 @@ pcibios_select_root(struct pci_dev *pdev, struct resource *res)
170 167
171#define pcibios_scan_all_fns(a, b) 0 168#define pcibios_scan_all_fns(a, b) 0
172 169
170#define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
171static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
172{
173 return channel ? 15 : 14;
174}
175
173#endif /* _ASM_IA64_PCI_H */ 176#endif /* _ASM_IA64_PCI_H */
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/posix_types.h b/include/asm-ia64/posix_types.h
index adb62272694f..17885567b731 100644
--- a/include/asm-ia64/posix_types.h
+++ b/include/asm-ia64/posix_types.h
@@ -54,7 +54,7 @@ typedef unsigned int __kernel_old_dev_t;
54#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) 54#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
55#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) 55#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
56#define __FD_ZERO(set) \ 56#define __FD_ZERO(set) \
57 ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set))) 57 ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))
58 58
59# else /* !__GNUC__ */ 59# else /* !__GNUC__ */
60 60
diff --git a/include/asm-ia64/scatterlist.h b/include/asm-ia64/scatterlist.h
index 834a189ef189..9dbea8844d5e 100644
--- a/include/asm-ia64/scatterlist.h
+++ b/include/asm-ia64/scatterlist.h
@@ -25,4 +25,7 @@ struct scatterlist {
25 */ 25 */
26#define ISA_DMA_THRESHOLD 0xffffffff 26#define ISA_DMA_THRESHOLD 0xffffffff
27 27
28#define sg_dma_len(sg) ((sg)->dma_length)
29#define sg_dma_address(sg) ((sg)->dma_address)
30
28#endif /* _ASM_IA64_SCATTERLIST_H */ 31#endif /* _ASM_IA64_SCATTERLIST_H */
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/sn/xpc.h b/include/asm-ia64/sn/xpc.h
index 1d45e1518fb3..e52b8508083b 100644
--- a/include/asm-ia64/sn/xpc.h
+++ b/include/asm-ia64/sn/xpc.h
@@ -673,7 +673,7 @@ extern irqreturn_t xpc_notify_IRQ_handler(int, void *);
673extern void xpc_dropped_IPI_check(struct xpc_partition *); 673extern void xpc_dropped_IPI_check(struct xpc_partition *);
674extern void xpc_activate_partition(struct xpc_partition *); 674extern void xpc_activate_partition(struct xpc_partition *);
675extern void xpc_activate_kthreads(struct xpc_channel *, int); 675extern void xpc_activate_kthreads(struct xpc_channel *, int);
676extern void xpc_create_kthreads(struct xpc_channel *, int); 676extern void xpc_create_kthreads(struct xpc_channel *, int, int);
677extern void xpc_disconnect_wait(int); 677extern void xpc_disconnect_wait(int);
678 678
679 679
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/termbits.h b/include/asm-ia64/termbits.h
index b9e843f7dc42..4531a511bde5 100644
--- a/include/asm-ia64/termbits.h
+++ b/include/asm-ia64/termbits.h
@@ -26,6 +26,17 @@ struct termios {
26 cc_t c_cc[NCCS]; /* control characters */ 26 cc_t c_cc[NCCS]; /* control characters */
27}; 27};
28 28
29struct ktermios {
30 tcflag_t c_iflag; /* input mode flags */
31 tcflag_t c_oflag; /* output mode flags */
32 tcflag_t c_cflag; /* control mode flags */
33 tcflag_t c_lflag; /* local mode flags */
34 cc_t c_line; /* line discipline */
35 cc_t c_cc[NCCS]; /* control characters */
36 speed_t c_ispeed; /* input speed */
37 speed_t c_ospeed; /* output speed */
38};
39
29/* c_cc characters */ 40/* c_cc characters */
30#define VINTR 0 41#define VINTR 0
31#define VQUIT 1 42#define VQUIT 1
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h
index 8adcde0934ca..91698599f918 100644
--- a/include/asm-ia64/thread_info.h
+++ b/include/asm-ia64/thread_info.h
@@ -84,20 +84,24 @@ 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 */
90#define TIF_DB_DISABLED 19 /* debug trap disabled for fsyscall */ 91#define TIF_DB_DISABLED 19 /* debug trap disabled for fsyscall */
92#define TIF_FREEZE 20 /* is freezing for suspend */
91 93
92#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 94#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
93#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 95#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
94#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)
95#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 98#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
96#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 99#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
97#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 100#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
98#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 101#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
99#define _TIF_MCA_INIT (1 << TIF_MCA_INIT) 102#define _TIF_MCA_INIT (1 << TIF_MCA_INIT)
100#define _TIF_DB_DISABLED (1 << TIF_DB_DISABLED) 103#define _TIF_DB_DISABLED (1 << TIF_DB_DISABLED)
104#define _TIF_FREEZE (1 << TIF_FREEZE)
101 105
102/* "work to do on user-return" bits */ 106/* "work to do on user-return" bits */
103#define TIF_ALLWORK_MASK (_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) 107#define TIF_ALLWORK_MASK (_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h
index a6e38565ab4c..22ed6749557e 100644
--- a/include/asm-ia64/topology.h
+++ b/include/asm-ia64/topology.h
@@ -101,6 +101,7 @@ void build_cpu_to_node_map(void);
101 .flags = SD_LOAD_BALANCE \ 101 .flags = SD_LOAD_BALANCE \
102 | SD_BALANCE_EXEC \ 102 | SD_BALANCE_EXEC \
103 | SD_BALANCE_FORK \ 103 | SD_BALANCE_FORK \
104 | SD_SERIALIZE \
104 | SD_WAKE_BALANCE, \ 105 | SD_WAKE_BALANCE, \
105 .last_balance = jiffies, \ 106 .last_balance = jiffies, \
106 .balance_interval = 64, \ 107 .balance_interval = 64, \
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/cacheflush.h b/include/asm-m32r/cacheflush.h
index 8b261b49149e..56961a9511b2 100644
--- a/include/asm-m32r/cacheflush.h
+++ b/include/asm-m32r/cacheflush.h
@@ -9,6 +9,7 @@ extern void _flush_cache_copyback_all(void);
9#if defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104) 9#if defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104)
10#define flush_cache_all() do { } while (0) 10#define flush_cache_all() do { } while (0)
11#define flush_cache_mm(mm) do { } while (0) 11#define flush_cache_mm(mm) do { } while (0)
12#define flush_cache_dup_mm(mm) do { } while (0)
12#define flush_cache_range(vma, start, end) do { } while (0) 13#define flush_cache_range(vma, start, end) do { } while (0)
13#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 14#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
14#define flush_dcache_page(page) do { } while (0) 15#define flush_dcache_page(page) do { } while (0)
@@ -29,6 +30,7 @@ extern void smp_flush_cache_all(void);
29#elif defined(CONFIG_CHIP_M32102) 30#elif defined(CONFIG_CHIP_M32102)
30#define flush_cache_all() do { } while (0) 31#define flush_cache_all() do { } while (0)
31#define flush_cache_mm(mm) do { } while (0) 32#define flush_cache_mm(mm) do { } while (0)
33#define flush_cache_dup_mm(mm) do { } while (0)
32#define flush_cache_range(vma, start, end) do { } while (0) 34#define flush_cache_range(vma, start, end) do { } while (0)
33#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 35#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
34#define flush_dcache_page(page) do { } while (0) 36#define flush_dcache_page(page) do { } while (0)
@@ -41,6 +43,7 @@ extern void smp_flush_cache_all(void);
41#else 43#else
42#define flush_cache_all() do { } while (0) 44#define flush_cache_all() do { } while (0)
43#define flush_cache_mm(mm) do { } while (0) 45#define flush_cache_mm(mm) do { } while (0)
46#define flush_cache_dup_mm(mm) do { } while (0)
44#define flush_cache_range(vma, start, end) do { } while (0) 47#define flush_cache_range(vma, start, end) do { } while (0)
45#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 48#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
46#define flush_dcache_page(page) do { } while (0) 49#define flush_dcache_page(page) do { } while (0)
diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h
index 219a0f74eff3..c82ebe8f250d 100644
--- a/include/asm-m32r/ide.h
+++ b/include/asm-m32r/ide.h
@@ -32,7 +32,8 @@
32static __inline__ int ide_default_irq(unsigned long base) 32static __inline__ int ide_default_irq(unsigned long base)
33{ 33{
34 switch (base) { 34 switch (base) {
35#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) 35#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \
36 || defined(CONFIG_PLAT_OPSPUT)
36 case 0x1f0: return PLD_IRQ_CFIREQ; 37 case 0x1f0: return PLD_IRQ_CFIREQ;
37 default: 38 default:
38 return 0; 39 return 0;
diff --git a/include/asm-m32r/m32102.h b/include/asm-m32r/m32102.h
index a1f0d1fe9eb8..52807f8db166 100644
--- a/include/asm-m32r/m32102.h
+++ b/include/asm-m32r/m32102.h
@@ -104,7 +104,8 @@
104#define M32R_MFT5RLD_PORTL (0x0C+M32R_MFT5_OFFSET) /* MFT4 reload */ 104#define M32R_MFT5RLD_PORTL (0x0C+M32R_MFT5_OFFSET) /* MFT4 reload */
105#define M32R_MFT5CMPRLD_PORTL (0x10+M32R_MFT5_OFFSET) /* MFT4 compare reload */ 105#define M32R_MFT5CMPRLD_PORTL (0x10+M32R_MFT5_OFFSET) /* MFT4 compare reload */
106 106
107#if defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_M32104) 107#if (defined(CONFIG_CHIP_M32700) && !defined(CONFIG_PLAT_MAPPI2)) \
108 || defined(CONFIG_CHIP_M32104)
108#define M32R_MFTCR_MFT0MSK (1UL<<31) /* b0 */ 109#define M32R_MFTCR_MFT0MSK (1UL<<31) /* b0 */
109#define M32R_MFTCR_MFT1MSK (1UL<<30) /* b1 */ 110#define M32R_MFTCR_MFT1MSK (1UL<<30) /* b1 */
110#define M32R_MFTCR_MFT2MSK (1UL<<29) /* b2 */ 111#define M32R_MFTCR_MFT2MSK (1UL<<29) /* b2 */
@@ -117,7 +118,7 @@
117#define M32R_MFTCR_MFT3EN (1UL<<20) /* b11 */ 118#define M32R_MFTCR_MFT3EN (1UL<<20) /* b11 */
118#define M32R_MFTCR_MFT4EN (1UL<<19) /* b12 */ 119#define M32R_MFTCR_MFT4EN (1UL<<19) /* b12 */
119#define M32R_MFTCR_MFT5EN (1UL<<18) /* b13 */ 120#define M32R_MFTCR_MFT5EN (1UL<<18) /* b13 */
120#else /* not CONFIG_CHIP_M32700 && not CONFIG_CHIP_M32104 */ 121#else
121#define M32R_MFTCR_MFT0MSK (1UL<<15) /* b16 */ 122#define M32R_MFTCR_MFT0MSK (1UL<<15) /* b16 */
122#define M32R_MFTCR_MFT1MSK (1UL<<14) /* b17 */ 123#define M32R_MFTCR_MFT1MSK (1UL<<14) /* b17 */
123#define M32R_MFTCR_MFT2MSK (1UL<<13) /* b18 */ 124#define M32R_MFTCR_MFT2MSK (1UL<<13) /* b18 */
@@ -130,7 +131,7 @@
130#define M32R_MFTCR_MFT3EN (1UL<<4) /* b27 */ 131#define M32R_MFTCR_MFT3EN (1UL<<4) /* b27 */
131#define M32R_MFTCR_MFT4EN (1UL<<3) /* b28 */ 132#define M32R_MFTCR_MFT4EN (1UL<<3) /* b28 */
132#define M32R_MFTCR_MFT5EN (1UL<<2) /* b29 */ 133#define M32R_MFTCR_MFT5EN (1UL<<2) /* b29 */
133#endif /* not CONFIG_CHIP_M32700 && not CONFIG_CHIP_M32104 */ 134#endif
134 135
135#define M32R_MFTMOD_CC_MASK (1UL<<15) /* b16 */ 136#define M32R_MFTMOD_CC_MASK (1UL<<15) /* b16 */
136#define M32R_MFTMOD_TCCR (1UL<<13) /* b18 */ 137#define M32R_MFTMOD_TCCR (1UL<<13) /* b18 */
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h
index 2d2a6c97331e..632b4ce4269a 100644
--- a/include/asm-m32r/ptrace.h
+++ b/include/asm-m32r/ptrace.h
@@ -33,21 +33,10 @@
33#define PT_R15 PT_SP 33#define PT_R15 PT_SP
34 34
35/* processor status and miscellaneous context registers. */ 35/* processor status and miscellaneous context registers. */
36#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
37#define PT_ACC0H 15 36#define PT_ACC0H 15
38#define PT_ACC0L 16 37#define PT_ACC0L 16
39#define PT_ACC1H 17 38#define PT_ACC1H 17 /* ISA_DSP_LEVEL2 only */
40#define PT_ACC1L 18 39#define PT_ACC1L 18 /* ISA_DSP_LEVEL2 only */
41#define PT_ACCH PT_ACC0H
42#define PT_ACCL PT_ACC0L
43#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
44#define PT_ACCH 15
45#define PT_ACCL 16
46#define PT_DUMMY_ACC1H 17
47#define PT_DUMMY_ACC1L 18
48#else
49#error unknown isa conifiguration
50#endif
51#define PT_PSW 19 40#define PT_PSW 19
52#define PT_BPC 20 41#define PT_BPC 20
53#define PT_BBPSW 21 42#define PT_BBPSW 21
@@ -103,19 +92,10 @@ struct pt_regs {
103 long syscall_nr; 92 long syscall_nr;
104 93
105 /* Saved main processor status and miscellaneous context registers. */ 94 /* Saved main processor status and miscellaneous context registers. */
106#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
107 unsigned long acc0h; 95 unsigned long acc0h;
108 unsigned long acc0l; 96 unsigned long acc0l;
109 unsigned long acc1h; 97 unsigned long acc1h; /* ISA_DSP_LEVEL2 only */
110 unsigned long acc1l; 98 unsigned long acc1l; /* ISA_DSP_LEVEL2 only */
111#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
112 unsigned long acch;
113 unsigned long accl;
114 unsigned long dummy_acc1h;
115 unsigned long dummy_acc1l;
116#else
117#error unknown isa configuration
118#endif
119 unsigned long psw; 99 unsigned long psw;
120 unsigned long bpc; /* saved PC for TRAP syscalls */ 100 unsigned long bpc; /* saved PC for TRAP syscalls */
121 unsigned long bbpsw; 101 unsigned long bbpsw;
diff --git a/include/asm-m32r/sigcontext.h b/include/asm-m32r/sigcontext.h
index 73025c0c41a1..62537dc4dec9 100644
--- a/include/asm-m32r/sigcontext.h
+++ b/include/asm-m32r/sigcontext.h
@@ -23,19 +23,10 @@ struct sigcontext {
23 unsigned long sc_r12; 23 unsigned long sc_r12;
24 24
25 /* Saved main processor status and miscellaneous context registers. */ 25 /* Saved main processor status and miscellaneous context registers. */
26#if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
27 unsigned long sc_acc0h; 26 unsigned long sc_acc0h;
28 unsigned long sc_acc0l; 27 unsigned long sc_acc0l;
29 unsigned long sc_acc1h; 28 unsigned long sc_acc1h; /* ISA_DSP_LEVEL2 only */
30 unsigned long sc_acc1l; 29 unsigned long sc_acc1l; /* ISA_DSP_LEVEL2 only */
31#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
32 unsigned long sc_acch;
33 unsigned long sc_accl;
34 unsigned long sc_dummy_acc1h;
35 unsigned long sc_dummy_acc1l;
36#else
37#error unknown isa configuration
38#endif
39 unsigned long sc_psw; 30 unsigned long sc_psw;
40 unsigned long sc_bpc; /* saved PC for TRAP syscalls */ 31 unsigned long sc_bpc; /* saved PC for TRAP syscalls */
41 unsigned long sc_bbpsw; 32 unsigned long sc_bbpsw;
diff --git a/include/asm-m32r/termbits.h b/include/asm-m32r/termbits.h
index 5ace3702df75..faf2bd0504c1 100644
--- a/include/asm-m32r/termbits.h
+++ b/include/asm-m32r/termbits.h
@@ -19,6 +19,17 @@ struct termios {
19 cc_t c_cc[NCCS]; /* control characters */ 19 cc_t c_cc[NCCS]; /* control characters */
20}; 20};
21 21
22struct ktermios {
23 tcflag_t c_iflag; /* input mode flags */
24 tcflag_t c_oflag; /* output mode flags */
25 tcflag_t c_cflag; /* control mode flags */
26 tcflag_t c_lflag; /* local mode flags */
27 cc_t c_line; /* line discipline */
28 cc_t c_cc[NCCS]; /* control characters */
29 speed_t c_ispeed; /* input speed */
30 speed_t c_ospeed; /* output speed */
31};
32
22/* c_cc characters */ 33/* c_cc characters */
23#define VINTR 0 34#define VINTR 0
24#define VQUIT 1 35#define VQUIT 1
diff --git a/include/asm-m68k/cacheflush.h b/include/asm-m68k/cacheflush.h
index 24d3ff449135..16bf375fdbe1 100644
--- a/include/asm-m68k/cacheflush.h
+++ b/include/asm-m68k/cacheflush.h
@@ -89,6 +89,8 @@ static inline void flush_cache_mm(struct mm_struct *mm)
89 __flush_cache_030(); 89 __flush_cache_030();
90} 90}
91 91
92#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
93
92/* flush_cache_range/flush_cache_page must be macros to avoid 94/* flush_cache_range/flush_cache_page must be macros to avoid
93 a dependency on linux/mm.h, which includes this file... */ 95 a dependency on linux/mm.h, which includes this file... */
94static inline void flush_cache_range(struct vm_area_struct *vma, 96static inline void flush_cache_range(struct vm_area_struct *vma,
diff --git a/include/asm-m68k/sun3-head.h b/include/asm-m68k/sun3-head.h
index f799d95bad53..e74f384e269f 100644
--- a/include/asm-m68k/sun3-head.h
+++ b/include/asm-m68k/sun3-head.h
@@ -4,7 +4,6 @@
4 4
5#define KERNBASE 0xE000000 /* First address the kernel will eventually be */ 5#define KERNBASE 0xE000000 /* First address the kernel will eventually be */
6#define LOAD_ADDR 0x4000 /* prom jumps to us here unless this is elf /boot */ 6#define LOAD_ADDR 0x4000 /* prom jumps to us here unless this is elf /boot */
7#define BI_START (KERNBASE + 0x3000) /* beginning of the bootinfo records */
8#define FC_CONTROL 3 7#define FC_CONTROL 3
9#define FC_SUPERD 5 8#define FC_SUPERD 5
10#define FC_CPU 7 9#define FC_CPU 7
diff --git a/include/asm-m68k/sun3ints.h b/include/asm-m68k/sun3ints.h
index de91fa071b99..309d6e6a1374 100644
--- a/include/asm-m68k/sun3ints.h
+++ b/include/asm-m68k/sun3ints.h
@@ -16,6 +16,7 @@
16#include <asm/intersil.h> 16#include <asm/intersil.h>
17#include <asm/oplib.h> 17#include <asm/oplib.h>
18#include <asm/traps.h> 18#include <asm/traps.h>
19#include <asm/irq.h>
19 20
20#define SUN3_INT_VECS 192 21#define SUN3_INT_VECS 192
21 22
diff --git a/include/asm-m68k/swim_iop.h b/include/asm-m68k/swim_iop.h
deleted file mode 100644
index f29b67876b01..000000000000
--- a/include/asm-m68k/swim_iop.h
+++ /dev/null
@@ -1,221 +0,0 @@
1/*
2 * SWIM access through the IOP
3 * Written by Joshua M. Thompson
4 */
5
6/* IOP number and channel number for the SWIM */
7
8#define SWIM_IOP IOP_NUM_ISM
9#define SWIM_CHAN 1
10
11/* Command code: */
12
13#define CMD_INIT 0x01 /* Initialize */
14#define CMD_SHUTDOWN 0x02 /* Shutdown */
15#define CMD_START_POLL 0x03 /* Start insert/eject polling */
16#define CMD_STOP_POLL 0x04 /* Stop insert/eject polling */
17#define CMD_SETHFSTAG 0x05 /* Set HFS tag buffer address */
18#define CMD_STATUS 0x06 /* Status */
19#define CMD_EJECT 0x07 /* Eject */
20#define CMD_FORMAT 0x08 /* Format */
21#define CMD_FORMAT_VERIFY 0x09 /* Format and Verify */
22#define CMD_WRITE 0x0A /* Write */
23#define CMD_READ 0x0B /* Read */
24#define CMD_READ_VERIFY 0x0C /* Read and Verify */
25#define CMD_CACHE_CTRL 0x0D /* Cache control */
26#define CMD_TAGBUFF_CTRL 0x0E /* Tag buffer control */
27#define CMD_GET_ICON 0x0F /* Get Icon */
28
29/* Drive types: */
30
31/* note: apple sez DRV_FDHD is 4, but I get back a type */
32/* of 5 when I do a drive status check on my FDHD */
33
34#define DRV_NONE 0 /* No drive */
35#define DRV_UNKNOWN 1 /* Unspecified drive */
36#define DRV_400K 2 /* 400K */
37#define DRV_800K 3 /* 400K/800K */
38#define DRV_FDHD 5 /* 400K/800K/720K/1440K */
39#define DRV_HD20 7 /* Apple HD20 */
40
41/* Format types: */
42
43#define FMT_HD20 0x0001 /* Apple HD20 */
44#define FMT_400K 0x0002 /* 400K (GCR) */
45#define FMT_800K 0x0004 /* 800K (GCR) */
46#define FMT_720K 0x0008 /* 720K (MFM) */
47#define FMT_1440K 0x0010 /* 1.44M (MFM) */
48
49#define FMD_KIND_400K 1
50#define FMD_KIND_800K 2
51#define FMD_KIND_720K 3
52#define FMD_KIND_1440K 1
53
54/* Icon Flags: */
55
56#define ICON_MEDIA 0x01 /* Have IOP supply media icon */
57#define ICON_DRIVE 0x01 /* Have IOP supply drive icon */
58
59/* Error codes: */
60
61#define gcrOnMFMErr -400 /* GCR (400/800K) on HD media */
62#define verErr -84 /* verify failed */
63#define fmt2Err -83 /* can't get enough sync during format */
64#define fmt1Err -82 /* can't find sector 0 after track format */
65#define sectNFErr -81 /* can't find sector */
66#define seekErr -80 /* drive error during seek */
67#define spdAdjErr -79 /* can't set drive speed */
68#define twoSideErr -78 /* drive is single-sided */
69#define initIWMErr -77 /* error during initialization */
70#define tk0badErr -76 /* track zero is bad */
71#define cantStepErr -75 /* drive error during step */
72#define wrUnderrun -74 /* write underrun occurred */
73#define badDBtSlp -73 /* bad data bitslip marks */
74#define badDCksum -72 /* bad data checksum */
75#define noDtaMkErr -71 /* can't find data mark */
76#define badBtSlpErr -70 /* bad address bitslip marks */
77#define badCksmErr -69 /* bad address-mark checksum */
78#define dataVerErr -68 /* read-verify failed */
79#define noAdrMkErr -67 /* can't find an address mark */
80#define noNybErr -66 /* no nybbles? disk is probably degaussed */
81#define offLinErr -65 /* no disk in drive */
82#define noDriveErr -64 /* drive isn't connected */
83#define nsDrvErr -56 /* no such drive */
84#define paramErr -50 /* bad positioning information */
85#define wPrErr -44 /* write protected */
86#define openErr -23 /* already initialized */
87
88#ifndef __ASSEMBLY__
89
90struct swim_drvstatus {
91 __u16 curr_track; /* Current track number */
92 __u8 write_prot; /* 0x80 if disk is write protected */
93 __u8 disk_in_drive; /* 0x01 or 0x02 if a disk is in the drive */
94 __u8 installed; /* 0x01 if drive installed, 0xFF if not */
95 __u8 num_sides; /* 0x80 if two-sided format supported */
96 __u8 two_sided; /* 0xff if two-sided format diskette */
97 __u8 new_interface; /* 0x00 if old 400K drive, 0xFF if newer */
98 __u16 errors; /* Disk error count */
99 struct { /* 32 bits */
100 __u16 reserved;
101 __u16 :4;
102 __u16 external:1; /* Drive is external */
103 __u16 scsi:1; /* Drive is a SCSI drive */
104 __u16 fixed:1; /* Drive has fixed media */
105 __u16 secondary:1; /* Drive is secondary drive */
106 __u8 type; /* Drive type */
107 } info;
108 __u8 mfm_drive; /* 0xFF if this is an FDHD drive */
109 __u8 mfm_disk; /* 0xFF if 720K/1440K (MFM) disk */
110 __u8 mfm_format; /* 0x00 if 720K, 0xFF if 1440K */
111 __u8 ctlr_type; /* 0x00 if IWM, 0xFF if SWIM */
112 __u16 curr_format; /* Current format type */
113 __u16 allowed_fmt; /* Allowed format types */
114 __u32 num_blocks; /* Number of blocks on disk */
115 __u8 icon_flags; /* Icon flags */
116 __u8 unusued;
117};
118
119/* Commands issued from the host to the IOP: */
120
121struct swimcmd_init {
122 __u8 code; /* CMD_INIT */
123 __u8 unusued;
124 __u16 error;
125 __u8 drives[28]; /* drive type list */
126};
127
128struct swimcmd_startpoll {
129 __u8 code; /* CMD_START_POLL */
130 __u8 unusued;
131 __u16 error;
132};
133
134struct swimcmd_sethfstag {
135 __u8 code; /* CMD_SETHFSTAG */
136 __u8 unusued;
137 __u16 error;
138 caddr_t tagbuf; /* HFS tag buffer address */
139};
140
141struct swimcmd_status {
142 __u8 code; /* CMD_STATUS */
143 __u8 drive_num;
144 __u16 error;
145 struct swim_drvstatus status;
146};
147
148struct swimcmd_eject {
149 __u8 code; /* CMD_EJECT */
150 __u8 drive_num;
151 __u16 error;
152 struct swim_drvstatus status;
153};
154
155struct swimcmd_format {
156 __u8 code; /* CMD_FORMAT */
157 __u8 drive_num;
158 __u16 error;
159 union {
160 struct {
161 __u16 fmt; /* format kind */
162 __u8 hdrbyte; /* fmt byte for hdr (0=default) */
163 __u8 interleave; /* interleave (0 = default) */
164 caddr_t databuf; /* sector data buff (0=default */
165 caddr_t tagbuf; /* tag data buffer (0=default) */
166 } f;
167 struct swim_drvstatus status;
168 } p;
169};
170
171struct swimcmd_fmtverify {
172 __u8 code; /* CMD_FORMAT_VERIFY */
173 __u8 drive_num;
174 __u16 error;
175};
176
177struct swimcmd_rw {
178 __u8 code; /* CMD_READ, CMD_WRITE or CMD_READ_VERIFY */
179 __u8 drive_num;
180 __u16 error;
181 caddr_t buffer; /* R/W buffer address */
182 __u32 first_block; /* Starting block */
183 __u32 num_blocks; /* Number of blocks */
184 __u8 tag[12]; /* tag data */
185};
186
187struct swimcmd_cachectl {
188 __u8 code; /* CMD_CACHE_CTRL */
189 __u8 unused;
190 __u16 error;
191 __u8 enable; /* Nonzero to enable cache */
192 __u8 install; /* +1 = install, -1 = remove, 0 = neither */
193};
194
195struct swimcmd_tagbufctl {
196 __u8 code; /* CMD_TAGBUFF_CTRL */
197 __u8 unused;
198 __u16 error;
199 caddr_t buf; /* buffer address or 0 to disable */
200};
201
202struct swimcmd_geticon {
203 __u8 code; /* CMD_GET_ICON */
204 __u8 drive_num;
205 __u16 error;
206 caddr_t buffer; /* Nuffer address */
207 __u16 kind; /* 0 = media icon, 1 = drive icon */
208 __u16 unused;
209 __u16 max_bytes; /* maximum byte count */
210};
211
212/* Messages from the SWIM IOP to the host CPU: */
213
214struct swimmsg_status {
215 __u8 code; /* 1 = insert, 2 = eject, 3 = status changed */
216 __u8 drive_num;
217 __u16 error;
218 struct swim_drvstatus status;
219};
220
221#endif /* __ASSEMBLY__ */
diff --git a/include/asm-m68k/termbits.h b/include/asm-m68k/termbits.h
index e9eec3eb0718..a194092240fb 100644
--- a/include/asm-m68k/termbits.h
+++ b/include/asm-m68k/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20/* c_cc characters */ 31/* c_cc characters */
21#define VINTR 0 32#define VINTR 0
22#define VQUIT 1 33#define VQUIT 1
diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h
index e4c9f080ff20..6a4cf2081512 100644
--- a/include/asm-m68k/uaccess.h
+++ b/include/asm-m68k/uaccess.h
@@ -7,6 +7,7 @@
7#include <linux/compiler.h> 7#include <linux/compiler.h>
8#include <linux/errno.h> 8#include <linux/errno.h>
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/sched.h>
10#include <asm/segment.h> 11#include <asm/segment.h>
11 12
12#define VERIFY_READ 0 13#define VERIFY_READ 0
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-m68knommu/cacheflush.h b/include/asm-m68knommu/cacheflush.h
index c3aadf3b0d88..163dcb1a9689 100644
--- a/include/asm-m68knommu/cacheflush.h
+++ b/include/asm-m68knommu/cacheflush.h
@@ -8,6 +8,7 @@
8 8
9#define flush_cache_all() __flush_cache_all() 9#define flush_cache_all() __flush_cache_all()
10#define flush_cache_mm(mm) do { } while (0) 10#define flush_cache_mm(mm) do { } while (0)
11#define flush_cache_dup_mm(mm) do { } while (0)
11#define flush_cache_range(vma, start, end) __flush_cache_all() 12#define flush_cache_range(vma, start, end) __flush_cache_all()
12#define flush_cache_page(vma, vmaddr) do { } while (0) 13#define flush_cache_page(vma, vmaddr) do { } while (0)
13#define flush_dcache_range(start,len) __flush_cache_all() 14#define flush_dcache_range(start,len) __flush_cache_all()
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h
index 1e5ccdad3b02..c7c945baf1ee 100644
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -131,6 +131,7 @@
131#define MACH_PHILIPS_NINO 0 /* Nino */ 131#define MACH_PHILIPS_NINO 0 /* Nino */
132#define MACH_PHILIPS_VELO 1 /* Velo */ 132#define MACH_PHILIPS_VELO 1 /* Velo */
133#define MACH_PHILIPS_JBS 2 /* JBS */ 133#define MACH_PHILIPS_JBS 2 /* JBS */
134#define MACH_PHILIPS_STB810 3 /* STB810 */
134 135
135/* 136/*
136 * Valid machtype for group SIBYTE 137 * Valid machtype for group SIBYTE
@@ -242,6 +243,10 @@ extern struct boot_mem_map boot_mem_map;
242extern 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);
243 244
244extern 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);
245 250
246/* 251/*
247 * 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/cacheflush.h b/include/asm-mips/cacheflush.h
index e3c9925876a3..0ddada3bb0b6 100644
--- a/include/asm-mips/cacheflush.h
+++ b/include/asm-mips/cacheflush.h
@@ -17,6 +17,7 @@
17 * 17 *
18 * - flush_cache_all() flushes entire cache 18 * - flush_cache_all() flushes entire cache
19 * - flush_cache_mm(mm) flushes the specified mm context's cache lines 19 * - flush_cache_mm(mm) flushes the specified mm context's cache lines
20 * - flush_cache_dup mm(mm) handles cache flushing when forking
20 * - flush_cache_page(mm, vmaddr, pfn) flushes a single page 21 * - flush_cache_page(mm, vmaddr, pfn) flushes a single page
21 * - flush_cache_range(vma, start, end) flushes a range of pages 22 * - flush_cache_range(vma, start, end) flushes a range of pages
22 * - flush_icache_range(start, end) flush a range of instructions 23 * - flush_icache_range(start, end) flush a range of instructions
@@ -31,6 +32,7 @@
31extern void (*flush_cache_all)(void); 32extern void (*flush_cache_all)(void);
32extern void (*__flush_cache_all)(void); 33extern void (*__flush_cache_all)(void);
33extern void (*flush_cache_mm)(struct mm_struct *mm); 34extern void (*flush_cache_mm)(struct mm_struct *mm);
35#define flush_cache_dup_mm(mm) do { (void) (mm); } while (0)
34extern void (*flush_cache_range)(struct vm_area_struct *vma, 36extern void (*flush_cache_range)(struct vm_area_struct *vma,
35 unsigned long start, unsigned long end); 37 unsigned long start, unsigned long end);
36extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn); 38extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn);
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h
index 9b768c3b96b3..20a81e1548f5 100644
--- a/include/asm-mips/checksum.h
+++ b/include/asm-mips/checksum.h
@@ -29,31 +29,38 @@
29 */ 29 */
30__wsum csum_partial(const void *buff, int len, __wsum sum); 30__wsum csum_partial(const void *buff, int len, __wsum sum);
31 31
32__wsum __csum_partial_copy_user(const void *src, void *dst,
33 int len, __wsum sum, int *err_ptr);
34
32/* 35/*
33 * this is a new version of the above that records errors it finds in *errp, 36 * this is a new version of the above that records errors it finds in *errp,
34 * but continues and zeros the rest of the buffer. 37 * but continues and zeros the rest of the buffer.
35 */ 38 */
36__wsum csum_partial_copy_from_user(const void __user *src, 39static inline
37 void *dst, int len, 40__wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len,
38 __wsum sum, int *errp); 41 __wsum sum, int *err_ptr)
42{
43 might_sleep();
44 return __csum_partial_copy_user((__force void *)src, dst,
45 len, sum, err_ptr);
46}
39 47
40/* 48/*
41 * Copy and checksum to user 49 * Copy and checksum to user
42 */ 50 */
43#define HAVE_CSUM_COPY_USER 51#define HAVE_CSUM_COPY_USER
44static inline __wsum csum_and_copy_to_user (const void *src, void __user *dst, 52static inline
45 int len, __wsum sum, 53__wsum csum_and_copy_to_user(const void *src, void __user *dst, int len,
46 int *err_ptr) 54 __wsum sum, int *err_ptr)
47{ 55{
48 might_sleep(); 56 might_sleep();
49 sum = csum_partial(src, len, sum); 57 if (access_ok(VERIFY_WRITE, dst, len))
50 58 return __csum_partial_copy_user(src, (__force void *)dst,
51 if (copy_to_user(dst, src, len)) { 59 len, sum, err_ptr);
60 if (len)
52 *err_ptr = -EFAULT; 61 *err_ptr = -EFAULT;
53 return (__force __wsum)-1;
54 }
55 62
56 return sum; 63 return (__force __wsum)-1; /* invalid checksum */
57} 64}
58 65
59/* 66/*
@@ -152,7 +159,8 @@ static inline __wsum csum_tcpudp_nofold(__be32 saddr,
152#endif 159#endif
153 " .set pop" 160 " .set pop"
154 : "=r" (sum) 161 : "=r" (sum)
155 : "0" (daddr), "r"(saddr), 162 : "0" ((__force unsigned long)daddr),
163 "r" ((__force unsigned long)saddr),
156#ifdef __MIPSEL__ 164#ifdef __MIPSEL__
157 "r" ((proto + len) << 8), 165 "r" ((proto + len) << 8),
158#else 166#else
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h
index 55a0152feb08..432653d7ae09 100644
--- a/include/asm-mips/compat.h
+++ b/include/asm-mips/compat.h
@@ -5,6 +5,7 @@
5 */ 5 */
6#include <linux/types.h> 6#include <linux/types.h>
7#include <asm/page.h> 7#include <asm/page.h>
8#include <asm/ptrace.h>
8 9
9#define COMPAT_USER_HZ 100 10#define COMPAT_USER_HZ 100
10 11
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/hazards.h b/include/asm-mips/hazards.h
index 0fe02945feba..50073157a617 100644
--- a/include/asm-mips/hazards.h
+++ b/include/asm-mips/hazards.h
@@ -157,7 +157,7 @@ ASMMACRO(back_to_back_c0_hazard,
157 * processors. 157 * processors.
158 */ 158 */
159ASMMACRO(mtc0_tlbw_hazard, 159ASMMACRO(mtc0_tlbw_hazard,
160 nop 160 nop; nop
161 ) 161 )
162ASMMACRO(tlbw_use_hazard, 162ASMMACRO(tlbw_use_hazard,
163 nop; nop; nop 163 nop; nop; nop
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 67657089efa7..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 ... */
@@ -31,14 +31,14 @@ static inline int irq_canonicalize(int irq)
31 * functions will take over re-enabling the low-level mask. 31 * functions will take over re-enabling the low-level mask.
32 * Otherwise it will be done on return from exception. 32 * Otherwise it will be done on return from exception.
33 */ 33 */
34#define __DO_IRQ_SMTC_HOOK() \ 34#define __DO_IRQ_SMTC_HOOK(irq) \
35do { \ 35do { \
36 if (irq_hwmask[irq] & 0x0000ff00) \ 36 if (irq_hwmask[irq] & 0x0000ff00) \
37 write_c0_tccontext(read_c0_tccontext() & \ 37 write_c0_tccontext(read_c0_tccontext() & \
38 ~(irq_hwmask[irq] & 0x0000ff00)); \ 38 ~(irq_hwmask[irq] & 0x0000ff00)); \
39} while (0) 39} while (0)
40#else 40#else
41#define __DO_IRQ_SMTC_HOOK() do { } while (0) 41#define __DO_IRQ_SMTC_HOOK(irq) do { } while (0)
42#endif 42#endif
43 43
44/* 44/*
@@ -52,7 +52,7 @@ do { \
52#define do_IRQ(irq) \ 52#define do_IRQ(irq) \
53do { \ 53do { \
54 irq_enter(); \ 54 irq_enter(); \
55 __DO_IRQ_SMTC_HOOK(); \ 55 __DO_IRQ_SMTC_HOOK(irq); \
56 generic_handle_irq(irq); \ 56 generic_handle_irq(irq); \
57 irq_exit(); \ 57 irq_exit(); \
58} while (0) 58} while (0)
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/irqflags.h b/include/asm-mips/irqflags.h
index 46bf5de5ac72..af3b07dfad4b 100644
--- a/include/asm-mips/irqflags.h
+++ b/include/asm-mips/irqflags.h
@@ -15,6 +15,27 @@
15 15
16#include <asm/hazards.h> 16#include <asm/hazards.h>
17 17
18/*
19 * CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY does prompt replay of deferred IPIs,
20 * at the cost of branch and call overhead on each local_irq_restore()
21 */
22
23#ifdef CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY
24
25extern void smtc_ipi_replay(void);
26
27#define irq_restore_epilog(flags) \
28do { \
29 if (!(flags & 0x0400)) \
30 smtc_ipi_replay(); \
31} while (0)
32
33#else
34
35#define irq_restore_epilog(ignore) do { } while (0)
36
37#endif /* CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY */
38
18__asm__ ( 39__asm__ (
19 " .macro raw_local_irq_enable \n" 40 " .macro raw_local_irq_enable \n"
20 " .set push \n" 41 " .set push \n"
@@ -193,6 +214,7 @@ do { \
193 : "=r" (__tmp1) \ 214 : "=r" (__tmp1) \
194 : "0" (flags) \ 215 : "0" (flags) \
195 : "memory"); \ 216 : "memory"); \
217 irq_restore_epilog(flags); \
196} while(0) 218} while(0)
197 219
198static inline int raw_irqs_disabled_flags(unsigned long flags) 220static inline int raw_irqs_disabled_flags(unsigned long flags)
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-ip27/irq.h b/include/asm-mips/mach-ip27/irq.h
index 806213ce31b6..25f0c3f39adf 100644
--- a/include/asm-mips/mach-ip27/irq.h
+++ b/include/asm-mips/mach-ip27/irq.h
@@ -10,8 +10,6 @@
10#ifndef __ASM_MACH_IP27_IRQ_H 10#ifndef __ASM_MACH_IP27_IRQ_H
11#define __ASM_MACH_IP27_IRQ_H 11#define __ASM_MACH_IP27_IRQ_H
12 12
13#include <asm/sn/arch.h>
14
15/* 13/*
16 * A hardwired interrupt number is completly stupid for this system - a 14 * A hardwired interrupt number is completly stupid for this system - a
17 * large configuration might have thousands if not tenthousands of 15 * large configuration might have thousands if not tenthousands of
diff --git a/include/asm-mips/mach-ip27/topology.h b/include/asm-mips/mach-ip27/topology.h
index a13b715fd9ca..44790fdc5d00 100644
--- a/include/asm-mips/mach-ip27/topology.h
+++ b/include/asm-mips/mach-ip27/topology.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_MACH_TOPOLOGY_H 1#ifndef _ASM_MACH_TOPOLOGY_H
2#define _ASM_MACH_TOPOLOGY_H 1 2#define _ASM_MACH_TOPOLOGY_H 1
3 3
4#include <asm/sn/arch.h>
5#include <asm/sn/hub.h> 4#include <asm/sn/hub.h>
6#include <asm/mmzone.h> 5#include <asm/mmzone.h>
7 6
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-rm200/cpu-feature-overrides.h b/include/asm-mips/mach-rm/cpu-feature-overrides.h
index 11410ae10d36..11410ae10d36 100644
--- a/include/asm-mips/mach-rm200/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-rm/cpu-feature-overrides.h
diff --git a/include/asm-mips/mach-rm200/mc146818rtc.h b/include/asm-mips/mach-rm/mc146818rtc.h
index d37ae68dc6a3..d37ae68dc6a3 100644
--- a/include/asm-mips/mach-rm200/mc146818rtc.h
+++ b/include/asm-mips/mach-rm/mc146818rtc.h
diff --git a/include/asm-mips/mach-rm200/timex.h b/include/asm-mips/mach-rm/timex.h
index 11ff6cb0f214..11ff6cb0f214 100644
--- a/include/asm-mips/mach-rm200/timex.h
+++ b/include/asm-mips/mach-rm/timex.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/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/page.h b/include/asm-mips/page.h
index 0dc1a45c27ed..d3fbd83ff545 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -34,8 +34,21 @@
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/cpu-features.h>
39#include <asm/io.h> 52#include <asm/io.h>
40 53
41extern void clear_page(void * page); 54extern void clear_page(void * page);
@@ -61,16 +74,13 @@ static inline void clear_user_page(void *addr, unsigned long vaddr,
61 flush_data_cache_page((unsigned long)addr); 74 flush_data_cache_page((unsigned long)addr);
62} 75}
63 76
64static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, 77extern void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
65 struct page *to) 78 struct page *to);
66{ 79struct vm_area_struct;
67 extern void (*flush_data_cache_page)(unsigned long addr); 80extern void copy_user_highpage(struct page *to, struct page *from,
81 unsigned long vaddr, struct vm_area_struct *vma);
68 82
69 copy_page(vto, vfrom); 83#define __HAVE_ARCH_COPY_USER_HIGHPAGE
70 if (!cpu_has_ic_fills_f_dc ||
71 pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
72 flush_data_cache_page((unsigned long)vto);
73}
74 84
75/* 85/*
76 * These are used to make use of C type-checking.. 86 * These are used to make use of C type-checking..
@@ -136,20 +146,23 @@ typedef struct { unsigned long pgprot; } pgprot_t;
136/* to align the pointer to the (next) page boundary */ 146/* to align the pointer to the (next) page boundary */
137#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) 147#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK)
138 148
149/*
150 * __pa()/__va() should be used only during mem init.
151 */
139#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) 152#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
140#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)
141#else 154#else
142#define __pa_page_offset(x) PAGE_OFFSET 155#define __pa_page_offset(x) PAGE_OFFSET
143#endif 156#endif
144#define __pa(x) ((unsigned long)(x) - __pa_page_offset(x)) 157#define __pa(x) ((unsigned long)(x) - __pa_page_offset(x) + PHYS_OFFSET)
145#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0)) 158#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
146#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET)) 159#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0))
147 160
148#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 161#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
149 162
150#ifdef CONFIG_FLATMEM 163#ifdef CONFIG_FLATMEM
151 164
152#define pfn_valid(pfn) ((pfn) < max_mapnr) 165#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr)
153 166
154#elif defined(CONFIG_SPARSEMEM) 167#elif defined(CONFIG_SPARSEMEM)
155 168
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index c4d68bebdca6..7f0f120ca07c 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -187,4 +187,10 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev)
187/* Do platform specific device initialization at pci_enable_device() time */ 187/* Do platform specific device initialization at pci_enable_device() time */
188extern int pcibios_plat_dev_init(struct pci_dev *dev); 188extern int pcibios_plat_dev_init(struct pci_dev *dev);
189 189
190/* Chances are this interrupt is wired PC-style ... */
191static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
192{
193 return channel ? 15 : 14;
194}
195
190#endif /* _ASM_PCI_H */ 196#endif /* _ASM_PCI_H */
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index f2e1325fec6c..3fcfd7979de5 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -69,16 +69,6 @@ extern unsigned long zero_page_mask;
69#define ZERO_PAGE(vaddr) \ 69#define ZERO_PAGE(vaddr) \
70 (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask)))) 70 (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))))
71 71
72#define __HAVE_ARCH_MOVE_PTE
73#define move_pte(pte, prot, old_addr, new_addr) \
74({ \
75 pte_t newpte = (pte); \
76 if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \
77 pte_page(pte) == ZERO_PAGE(old_addr)) \
78 newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \
79 newpte; \
80})
81
82extern void paging_init(void); 72extern void paging_init(void);
83 73
84/* 74/*
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index 30bf555faeaa..8a1f2b6f04ac 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -82,6 +82,14 @@ struct pt_regs {
82 82
83extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); 83extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit);
84 84
85extern NORET_TYPE void die(const char *, struct pt_regs *);
86
87static inline void die_if_kernel(const char *str, struct pt_regs *regs)
88{
89 if (unlikely(!user_mode(regs)))
90 die(str, regs);
91}
92
85#endif 93#endif
86 94
87#endif /* _ASM_PTRACE_H */ 95#endif /* _ASM_PTRACE_H */
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/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/sn/arch.h b/include/asm-mips/sn/arch.h
index 51174af6ac52..da523de628be 100644
--- a/include/asm-mips/sn/arch.h
+++ b/include/asm-mips/sn/arch.h
@@ -18,7 +18,6 @@
18#endif 18#endif
19 19
20typedef u64 hubreg_t; 20typedef u64 hubreg_t;
21typedef u64 nic_t;
22 21
23#define cputonasid(cpu) (cpu_data[(cpu)].p_nasid) 22#define cputonasid(cpu) (cpu_data[(cpu)].p_nasid)
24#define cputoslice(cpu) (cpu_data[(cpu)].p_slice) 23#define cputoslice(cpu) (cpu_data[(cpu)].p_slice)
diff --git a/include/asm-mips/sn/klconfig.h b/include/asm-mips/sn/klconfig.h
index 15d70ca56187..82aeb9e322db 100644
--- a/include/asm-mips/sn/klconfig.h
+++ b/include/asm-mips/sn/klconfig.h
@@ -61,6 +61,8 @@
61#endif /* CONFIG_SGI_IP35 */ 61#endif /* CONFIG_SGI_IP35 */
62#endif /* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */ 62#endif /* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */
63 63
64typedef u64 nic_t;
65
64#define KLCFGINFO_MAGIC 0xbeedbabe 66#define KLCFGINFO_MAGIC 0xbeedbabe
65 67
66typedef s32 klconf_off_t; 68typedef s32 klconf_off_t;
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 9428057a50cf..5e1289c85ed9 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -19,7 +19,6 @@
19#include <asm/barrier.h> 19#include <asm/barrier.h>
20#include <asm/cpu-features.h> 20#include <asm/cpu-features.h>
21#include <asm/dsp.h> 21#include <asm/dsp.h>
22#include <asm/ptrace.h>
23#include <asm/war.h> 22#include <asm/war.h>
24 23
25 24
@@ -336,14 +335,6 @@ extern void *set_except_vector(int n, void *addr);
336extern unsigned long ebase; 335extern unsigned long ebase;
337extern void per_cpu_trap_init(void); 336extern void per_cpu_trap_init(void);
338 337
339extern NORET_TYPE void die(const char *, struct pt_regs *);
340
341static inline void die_if_kernel(const char *str, struct pt_regs *regs)
342{
343 if (unlikely(!user_mode(regs)))
344 die(str, regs);
345}
346
347extern int stop_a_enabled; 338extern int stop_a_enabled;
348 339
349/* 340/*
diff --git a/include/asm-mips/termbits.h b/include/asm-mips/termbits.h
index b62ec7c521cc..0bbe07b42a07 100644
--- a/include/asm-mips/termbits.h
+++ b/include/asm-mips/termbits.h
@@ -30,6 +30,17 @@ struct termios {
30 cc_t c_cc[NCCS]; /* control characters */ 30 cc_t c_cc[NCCS]; /* control characters */
31}; 31};
32 32
33struct ktermios {
34 tcflag_t c_iflag; /* input mode flags */
35 tcflag_t c_oflag; /* output mode flags */
36 tcflag_t c_cflag; /* control mode flags */
37 tcflag_t c_lflag; /* local mode flags */
38 cc_t c_line; /* line discipline */
39 cc_t c_cc[NCCS]; /* control characters */
40 speed_t c_ispeed; /* input speed */
41 speed_t c_ospeed; /* output speed */
42};
43
33/* c_cc characters */ 44/* c_cc characters */
34#define VINTR 0 /* Interrupt character [ISIG]. */ 45#define VINTR 0 /* Interrupt character [ISIG]. */
35#define VQUIT 1 /* Quit character [ISIG]. */ 46#define VQUIT 1 /* Quit character [ISIG]. */
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h
index e475c45ea263..fbcda8204473 100644
--- a/include/asm-mips/thread_info.h
+++ b/include/asm-mips/thread_info.h
@@ -118,6 +118,7 @@ register struct thread_info *__current_thread_info __asm__("$28");
118#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 118#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
119#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 119#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */
120#define TIF_MEMDIE 18 120#define TIF_MEMDIE 18
121#define TIF_FREEZE 19
121#define TIF_SYSCALL_TRACE 31 /* syscall trace active */ 122#define TIF_SYSCALL_TRACE 31 /* syscall trace active */
122 123
123#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 124#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -129,6 +130,7 @@ register struct thread_info *__current_thread_info __asm__("$28");
129#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 130#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
130#define _TIF_USEDFPU (1<<TIF_USEDFPU) 131#define _TIF_USEDFPU (1<<TIF_USEDFPU)
131#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 132#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
133#define _TIF_FREEZE (1<<TIF_FREEZE)
132 134
133/* work to do on interrupt/exception return */ 135/* work to do on interrupt/exception return */
134#define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP) 136#define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP)
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h
index 1cdd4eeb2f73..c12ebc53ef31 100644
--- a/include/asm-mips/uaccess.h
+++ b/include/asm-mips/uaccess.h
@@ -488,7 +488,8 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
488}) 488})
489 489
490/* 490/*
491 * __copy_from_user: - Copy a block of data from user space, with less checking. * @to: Destination address, in kernel space. 491 * __copy_from_user: - Copy a block of data from user space, with less checking.
492 * @to: Destination address, in kernel space.
492 * @from: Source address, in user space. 493 * @from: Source address, in user space.
493 * @n: Number of bytes to copy. 494 * @n: Number of bytes to copy.
494 * 495 *
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-mips/war.h b/include/asm-mips/war.h
index 3ac146c019c9..13a3502eef44 100644
--- a/include/asm-mips/war.h
+++ b/include/asm-mips/war.h
@@ -76,7 +76,7 @@
76/* 76/*
77 * But the RM200C seems to have been shipped only with V2.0 R4600s 77 * But the RM200C seems to have been shipped only with V2.0 R4600s
78 */ 78 */
79#ifdef CONFIG_SNI_RM200_PCI 79#ifdef CONFIG_SNI_RM
80 80
81#define R4600_V2_HIT_CACHEOP_WAR 1 81#define R4600_V2_HIT_CACHEOP_WAR 1
82 82
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h
index 2bc41f2e0271..a799dd8ef395 100644
--- a/include/asm-parisc/cacheflush.h
+++ b/include/asm-parisc/cacheflush.h
@@ -15,6 +15,8 @@
15#define flush_cache_mm(mm) flush_cache_all_local() 15#define flush_cache_mm(mm) flush_cache_all_local()
16#endif 16#endif
17 17
18#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
19
18#define flush_kernel_dcache_range(start,size) \ 20#define flush_kernel_dcache_range(start,size) \
19 flush_kernel_dcache_range_asm((start), (start)+(size)); 21 flush_kernel_dcache_range_asm((start), (start)+(size));
20 22
@@ -184,7 +186,7 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
184} 186}
185 187
186static inline void 188static inline void
187flush_anon_page(struct page *page, unsigned long vmaddr) 189flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr)
188{ 190{
189 if (PageAnon(page)) 191 if (PageAnon(page))
190 flush_user_dcache_page(vmaddr); 192 flush_user_dcache_page(vmaddr);
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/termbits.h b/include/asm-parisc/termbits.h
index 372b634892c9..a46e299a9391 100644
--- a/include/asm-parisc/termbits.h
+++ b/include/asm-parisc/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20/* c_cc characters */ 31/* c_cc characters */
21#define VINTR 0 32#define VINTR 0
22#define VQUIT 1 33#define VQUIT 1
diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild
index 1e637381c118..703970fb0ec0 100644
--- a/include/asm-powerpc/Kbuild
+++ b/include/asm-powerpc/Kbuild
@@ -17,7 +17,6 @@ header-y += ipc.h
17header-y += poll.h 17header-y += poll.h
18header-y += shmparam.h 18header-y += shmparam.h
19header-y += sockios.h 19header-y += sockios.h
20header-y += spu_info.h
21header-y += ucontext.h 20header-y += ucontext.h
22header-y += ioctl.h 21header-y += ioctl.h
23header-y += linkage.h 22header-y += linkage.h
@@ -37,6 +36,7 @@ unifdef-y += posix_types.h
37unifdef-y += ptrace.h 36unifdef-y += ptrace.h
38unifdef-y += seccomp.h 37unifdef-y += seccomp.h
39unifdef-y += signal.h 38unifdef-y += signal.h
39unifdef-y += spu_info.h
40unifdef-y += termios.h 40unifdef-y += termios.h
41unifdef-y += types.h 41unifdef-y += types.h
42unifdef-y += unistd.h 42unifdef-y += unistd.h
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h
index 53283e2540b3..f038e33e6d48 100644
--- a/include/asm-powerpc/atomic.h
+++ b/include/asm-powerpc/atomic.h
@@ -207,7 +207,8 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
207 207
208/* 208/*
209 * Atomically test *v and decrement if it is greater than 0. 209 * Atomically test *v and decrement if it is greater than 0.
210 * The function returns the old value of *v minus 1. 210 * The function returns the old value of *v minus 1, even if
211 * the atomic variable, v, was not decremented.
211 */ 212 */
212static __inline__ int atomic_dec_if_positive(atomic_t *v) 213static __inline__ int atomic_dec_if_positive(atomic_t *v)
213{ 214{
@@ -216,14 +217,15 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
216 __asm__ __volatile__( 217 __asm__ __volatile__(
217 LWSYNC_ON_SMP 218 LWSYNC_ON_SMP
218"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ 219"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\
219 addic. %0,%0,-1\n\ 220 cmpwi %0,1\n\
221 addi %0,%0,-1\n\
220 blt- 2f\n" 222 blt- 2f\n"
221 PPC405_ERR77(0,%1) 223 PPC405_ERR77(0,%1)
222" stwcx. %0,0,%1\n\ 224" stwcx. %0,0,%1\n\
223 bne- 1b" 225 bne- 1b"
224 ISYNC_ON_SMP 226 ISYNC_ON_SMP
225 "\n\ 227 "\n\
2262:" : "=&r" (t) 2282:" : "=&b" (t)
227 : "r" (&v->counter) 229 : "r" (&v->counter)
228 : "cc", "memory"); 230 : "cc", "memory");
229 231
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h
index c341063d0804..8f757f6246e4 100644
--- a/include/asm-powerpc/bitops.h
+++ b/include/asm-powerpc/bitops.h
@@ -190,7 +190,8 @@ static __inline__ void set_bits(unsigned long mask, unsigned long *addr)
190 * Return the zero-based bit position (LE, not IBM bit numbering) of 190 * Return the zero-based bit position (LE, not IBM bit numbering) of
191 * the most significant 1-bit in a double word. 191 * the most significant 1-bit in a double word.
192 */ 192 */
193static __inline__ int __ilog2(unsigned long x) 193static __inline__ __attribute__((const))
194int __ilog2(unsigned long x)
194{ 195{
195 int lz; 196 int lz;
196 197
@@ -198,6 +199,24 @@ static __inline__ int __ilog2(unsigned long x)
198 return BITS_PER_LONG - 1 - lz; 199 return BITS_PER_LONG - 1 - lz;
199} 200}
200 201
202static inline __attribute__((const))
203int __ilog2_u32(u32 n)
204{
205 int bit;
206 asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n));
207 return 31 - bit;
208}
209
210#ifdef __powerpc64__
211static inline __attribute__((const))
212int __ilog2_u64(u64 n)
213{
214 int bit;
215 asm ("cntlzd %0,%1" : "=r" (bit) : "r" (n));
216 return 63 - bit;
217}
218#endif
219
201/* 220/*
202 * Determines the bit position of the least significant 0 bit in the 221 * Determines the bit position of the least significant 0 bit in the
203 * specified double word. The returned bit position will be 222 * specified double word. The returned bit position will be
diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h
index 978b2c7e84ea..f6fa39474846 100644
--- a/include/asm-powerpc/bug.h
+++ b/include/asm-powerpc/bug.h
@@ -11,24 +11,48 @@
11#define BUG_OPCODE .long 0x00b00b00 /* For asm */ 11#define BUG_OPCODE .long 0x00b00b00 /* For asm */
12#define BUG_ILLEGAL_INSTR "0x00b00b00" /* For BUG macro */ 12#define BUG_ILLEGAL_INSTR "0x00b00b00" /* For BUG macro */
13 13
14#ifndef __ASSEMBLY__ 14#ifdef CONFIG_BUG
15
16struct bug_entry {
17 unsigned long bug_addr;
18 long line;
19 const char *file;
20 const char *function;
21};
22
23struct bug_entry *find_bug(unsigned long bugaddr);
24 15
25/* 16#ifdef __ASSEMBLY__
26 * If this bit is set in the line number it means that the trap 17#ifdef CONFIG_DEBUG_BUGVERBOSE
27 * is for WARN_ON rather than BUG or BUG_ON. 18.macro EMIT_BUG_ENTRY addr,file,line,flags
28 */ 19 .section __bug_table,"a"
29#define BUG_WARNING_TRAP 0x1000000 205001: PPC_LONG \addr, 5002f
21 .short \line, \flags
22 .org 5001b+BUG_ENTRY_SIZE
23 .previous
24 .section .rodata,"a"
255002: .asciz "\file"
26 .previous
27.endm
28#else
29 .macro EMIT_BUG_ENTRY addr,file,line,flags
30 .section __bug_table,"a"
315001: PPC_LONG \addr
32 .short \flags
33 .org 5001b+BUG_ENTRY_SIZE
34 .previous
35.endm
36#endif /* verbose */
30 37
31#ifdef CONFIG_BUG 38#else /* !__ASSEMBLY__ */
39/* _EMIT_BUG_ENTRY expects args %0,%1,%2,%3 to be FILE, LINE, flags and
40 sizeof(struct bug_entry), respectively */
41#ifdef CONFIG_DEBUG_BUGVERBOSE
42#define _EMIT_BUG_ENTRY \
43 ".section __bug_table,\"a\"\n" \
44 "2:\t" PPC_LONG "1b, %0\n" \
45 "\t.short %1, %2\n" \
46 ".org 2b+%3\n" \
47 ".previous\n"
48#else
49#define _EMIT_BUG_ENTRY \
50 ".section __bug_table,\"a\"\n" \
51 "2:\t" PPC_LONG "1b\n" \
52 "\t.short %2\n" \
53 ".org 2b+%3\n" \
54 ".previous\n"
55#endif
32 56
33/* 57/*
34 * BUG_ON() and WARN_ON() do their best to cooperate with compile-time 58 * BUG_ON() and WARN_ON() do their best to cooperate with compile-time
@@ -36,13 +60,13 @@ struct bug_entry *find_bug(unsigned long bugaddr);
36 * some compiler versions may not produce optimal results. 60 * some compiler versions may not produce optimal results.
37 */ 61 */
38 62
39#define BUG() do { \ 63#define BUG() do { \
40 __asm__ __volatile__( \ 64 __asm__ __volatile__( \
41 "1: twi 31,0,0\n" \ 65 "1: twi 31,0,0\n" \
42 ".section __bug_table,\"a\"\n" \ 66 _EMIT_BUG_ENTRY \
43 "\t"PPC_LONG" 1b,%0,%1,%2\n" \ 67 : : "i" (__FILE__), "i" (__LINE__), \
44 ".previous" \ 68 "i" (0), "i" (sizeof(struct bug_entry))); \
45 : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \ 69 for(;;) ; \
46} while (0) 70} while (0)
47 71
48#define BUG_ON(x) do { \ 72#define BUG_ON(x) do { \
@@ -51,23 +75,21 @@ struct bug_entry *find_bug(unsigned long bugaddr);
51 BUG(); \ 75 BUG(); \
52 } else { \ 76 } else { \
53 __asm__ __volatile__( \ 77 __asm__ __volatile__( \
54 "1: "PPC_TLNEI" %0,0\n" \ 78 "1: "PPC_TLNEI" %4,0\n" \
55 ".section __bug_table,\"a\"\n" \ 79 _EMIT_BUG_ENTRY \
56 "\t"PPC_LONG" 1b,%1,%2,%3\n" \ 80 : : "i" (__FILE__), "i" (__LINE__), "i" (0), \
57 ".previous" \ 81 "i" (sizeof(struct bug_entry)), \
58 : : "r" ((long)(x)), "i" (__LINE__), \ 82 "r" ((long)(x))); \
59 "i" (__FILE__), "i" (__FUNCTION__)); \
60 } \ 83 } \
61} while (0) 84} while (0)
62 85
63#define __WARN() do { \ 86#define __WARN() do { \
64 __asm__ __volatile__( \ 87 __asm__ __volatile__( \
65 "1: twi 31,0,0\n" \ 88 "1: twi 31,0,0\n" \
66 ".section __bug_table,\"a\"\n" \ 89 _EMIT_BUG_ENTRY \
67 "\t"PPC_LONG" 1b,%0,%1,%2\n" \ 90 : : "i" (__FILE__), "i" (__LINE__), \
68 ".previous" \ 91 "i" (BUGFLAG_WARNING), \
69 : : "i" (__LINE__ + BUG_WARNING_TRAP), \ 92 "i" (sizeof(struct bug_entry))); \
70 "i" (__FILE__), "i" (__FUNCTION__)); \
71} while (0) 93} while (0)
72 94
73#define WARN_ON(x) ({ \ 95#define WARN_ON(x) ({ \
@@ -77,13 +99,12 @@ struct bug_entry *find_bug(unsigned long bugaddr);
77 __WARN(); \ 99 __WARN(); \
78 } else { \ 100 } else { \
79 __asm__ __volatile__( \ 101 __asm__ __volatile__( \
80 "1: "PPC_TLNEI" %0,0\n" \ 102 "1: "PPC_TLNEI" %4,0\n" \
81 ".section __bug_table,\"a\"\n" \ 103 _EMIT_BUG_ENTRY \
82 "\t"PPC_LONG" 1b,%1,%2,%3\n" \ 104 : : "i" (__FILE__), "i" (__LINE__), \
83 ".previous" \ 105 "i" (BUGFLAG_WARNING), \
84 : : "r" (__ret_warn_on), \ 106 "i" (sizeof(struct bug_entry)), \
85 "i" (__LINE__ + BUG_WARNING_TRAP), \ 107 "r" (__ret_warn_on)); \
86 "i" (__FILE__), "i" (__FUNCTION__)); \
87 } \ 108 } \
88 unlikely(__ret_warn_on); \ 109 unlikely(__ret_warn_on); \
89}) 110})
@@ -91,8 +112,8 @@ struct bug_entry *find_bug(unsigned long bugaddr);
91#define HAVE_ARCH_BUG 112#define HAVE_ARCH_BUG
92#define HAVE_ARCH_BUG_ON 113#define HAVE_ARCH_BUG_ON
93#define HAVE_ARCH_WARN_ON 114#define HAVE_ARCH_WARN_ON
94#endif /* CONFIG_BUG */
95#endif /* __ASSEMBLY __ */ 115#endif /* __ASSEMBLY __ */
116#endif /* CONFIG_BUG */
96 117
97#include <asm-generic/bug.h> 118#include <asm-generic/bug.h>
98 119
diff --git a/include/asm-powerpc/cacheflush.h b/include/asm-powerpc/cacheflush.h
index 8a740c88d93d..08e93e789219 100644
--- a/include/asm-powerpc/cacheflush.h
+++ b/include/asm-powerpc/cacheflush.h
@@ -18,6 +18,7 @@
18 */ 18 */
19#define flush_cache_all() do { } while (0) 19#define flush_cache_all() do { } while (0)
20#define flush_cache_mm(mm) do { } while (0) 20#define flush_cache_mm(mm) do { } while (0)
21#define flush_cache_dup_mm(mm) do { } while (0)
21#define flush_cache_range(vma, start, end) do { } while (0) 22#define flush_cache_range(vma, start, end) do { } while (0)
22#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 23#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
23#define flush_icache_page(vma, page) do { } while (0) 24#define flush_icache_page(vma, page) do { } while (0)
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 6fe5c9d4ca3b..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
@@ -126,6 +133,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
126#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000) 133#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000)
127#define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000) 134#define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000)
128#define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000) 135#define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000)
136#define CPU_FTR_FPU_UNAVAILABLE ASM_CONST(0x0000000000800000)
129 137
130/* 138/*
131 * Add the 64-bit processor unique features in the top half of the word; 139 * Add the 64-bit processor unique features in the top half of the word;
@@ -152,6 +160,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
152#define CPU_FTR_PURR LONG_ASM_CONST(0x0000400000000000) 160#define CPU_FTR_PURR LONG_ASM_CONST(0x0000400000000000)
153#define CPU_FTR_CELL_TB_BUG LONG_ASM_CONST(0x0000800000000000) 161#define CPU_FTR_CELL_TB_BUG LONG_ASM_CONST(0x0000800000000000)
154#define CPU_FTR_SPURR LONG_ASM_CONST(0x0001000000000000) 162#define CPU_FTR_SPURR LONG_ASM_CONST(0x0001000000000000)
163#define CPU_FTR_DSCR LONG_ASM_CONST(0x0002000000000000)
155 164
156#ifndef __ASSEMBLY__ 165#ifndef __ASSEMBLY__
157 166
@@ -295,6 +304,9 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
295#define CPU_FTRS_E300 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ 304#define CPU_FTRS_E300 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \
296 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \ 305 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \
297 CPU_FTR_COMMON) 306 CPU_FTR_COMMON)
307#define CPU_FTRS_E300C2 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \
308 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \
309 CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE)
298#define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 310#define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
299 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE) 311 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE)
300#define CPU_FTRS_8XX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB) 312#define CPU_FTRS_8XX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB)
@@ -330,13 +342,8 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
330 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 342 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
331 CPU_FTR_MMCRA | CPU_FTR_SMT | \ 343 CPU_FTR_MMCRA | CPU_FTR_SMT | \
332 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 344 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
333 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE) 345 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
334#define CPU_FTRS_POWER6X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 346 CPU_FTR_DSCR)
335 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
336 CPU_FTR_MMCRA | CPU_FTR_SMT | \
337 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
338 CPU_FTR_PURR | CPU_FTR_CI_LARGE_PAGE | \
339 CPU_FTR_SPURR | CPU_FTR_REAL_LE)
340#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 | \
341 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 | \
342 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ 349 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
@@ -364,7 +371,8 @@ enum {
364 CPU_FTRS_7450_21 | CPU_FTRS_7450_23 | CPU_FTRS_7455_1 | 371 CPU_FTRS_7450_21 | CPU_FTRS_7450_23 | CPU_FTRS_7455_1 |
365 CPU_FTRS_7455_20 | CPU_FTRS_7455 | CPU_FTRS_7447_10 | 372 CPU_FTRS_7455_20 | CPU_FTRS_7455 | CPU_FTRS_7447_10 |
366 CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX | 373 CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX |
367 CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_CLASSIC32 | 374 CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_E300C2 |
375 CPU_FTRS_CLASSIC32 |
368#else 376#else
369 CPU_FTRS_GENERIC_32 | 377 CPU_FTRS_GENERIC_32 |
370#endif 378#endif
@@ -403,7 +411,8 @@ enum {
403 CPU_FTRS_7450_21 & CPU_FTRS_7450_23 & CPU_FTRS_7455_1 & 411 CPU_FTRS_7450_21 & CPU_FTRS_7450_23 & CPU_FTRS_7455_1 &
404 CPU_FTRS_7455_20 & CPU_FTRS_7455 & CPU_FTRS_7447_10 & 412 CPU_FTRS_7455_20 & CPU_FTRS_7455 & CPU_FTRS_7447_10 &
405 CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX & 413 CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX &
406 CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_CLASSIC32 & 414 CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_E300C2 &
415 CPU_FTRS_CLASSIC32 &
407#else 416#else
408 CPU_FTRS_GENERIC_32 & 417 CPU_FTRS_GENERIC_32 &
409#endif 418#endif
diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h
index fd4a5f5e33d1..d7a1bc1551c6 100644
--- a/include/asm-powerpc/dcr-native.h
+++ b/include/asm-powerpc/dcr-native.h
@@ -20,8 +20,7 @@
20#ifndef _ASM_POWERPC_DCR_NATIVE_H 20#ifndef _ASM_POWERPC_DCR_NATIVE_H
21#define _ASM_POWERPC_DCR_NATIVE_H 21#define _ASM_POWERPC_DCR_NATIVE_H
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23 23#ifndef __ASSEMBLY__
24#include <asm/reg.h>
25 24
26typedef struct {} dcr_host_t; 25typedef struct {} dcr_host_t;
27 26
@@ -32,7 +31,41 @@ typedef struct {} dcr_host_t;
32#define dcr_read(host, dcr_n) mfdcr(dcr_n) 31#define dcr_read(host, dcr_n) mfdcr(dcr_n)
33#define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value) 32#define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value)
34 33
34/* Device Control Registers */
35void __mtdcr(int reg, unsigned int val);
36unsigned int __mfdcr(int reg);
37#define mfdcr(rn) \
38 ({unsigned int rval; \
39 if (__builtin_constant_p(rn)) \
40 asm volatile("mfdcr %0," __stringify(rn) \
41 : "=r" (rval)); \
42 else \
43 rval = __mfdcr(rn); \
44 rval;})
45
46#define mtdcr(rn, v) \
47do { \
48 if (__builtin_constant_p(rn)) \
49 asm volatile("mtdcr " __stringify(rn) ",%0" \
50 : : "r" (v)); \
51 else \
52 __mtdcr(rn, v); \
53} while (0)
54
55/* R/W of indirect DCRs make use of standard naming conventions for DCRs */
56#define mfdcri(base, reg) \
57({ \
58 mtdcr(base ## _CFGADDR, base ## _ ## reg); \
59 mfdcr(base ## _CFGDATA); \
60})
61
62#define mtdcri(base, reg, data) \
63do { \
64 mtdcr(base ## _CFGADDR, base ## _ ## reg); \
65 mtdcr(base ## _CFGDATA, data); \
66} while (0)
35 67
68#endif /* __ASSEMBLY__ */
36#endif /* __KERNEL__ */ 69#endif /* __KERNEL__ */
37#endif /* _ASM_POWERPC_DCR_NATIVE_H */ 70#endif /* _ASM_POWERPC_DCR_NATIVE_H */
38 71
diff --git a/include/asm-powerpc/dcr.h b/include/asm-powerpc/dcr.h
index 473f2c7fd892..9338d50538f1 100644
--- a/include/asm-powerpc/dcr.h
+++ b/include/asm-powerpc/dcr.h
@@ -20,6 +20,7 @@
20#ifndef _ASM_POWERPC_DCR_H 20#ifndef _ASM_POWERPC_DCR_H
21#define _ASM_POWERPC_DCR_H 21#define _ASM_POWERPC_DCR_H
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23#ifdef CONFIG_PPC_DCR
23 24
24#ifdef CONFIG_PPC_DCR_NATIVE 25#ifdef CONFIG_PPC_DCR_NATIVE
25#include <asm/dcr-native.h> 26#include <asm/dcr-native.h>
@@ -32,11 +33,13 @@
32 * base from the device-tree 33 * base from the device-tree
33 */ 34 */
34#ifdef CONFIG_PPC_MERGE 35#ifdef CONFIG_PPC_MERGE
36struct device_node;
35extern unsigned int dcr_resource_start(struct device_node *np, 37extern unsigned int dcr_resource_start(struct device_node *np,
36 unsigned int index); 38 unsigned int index);
37extern unsigned int dcr_resource_len(struct device_node *np, 39extern unsigned int dcr_resource_len(struct device_node *np,
38 unsigned int index); 40 unsigned int index);
39#endif /* CONFIG_PPC_MERGE */ 41#endif /* CONFIG_PPC_MERGE */
40 42
43#endif /* CONFIG_PPC_DCR */
41#endif /* __KERNEL__ */ 44#endif /* __KERNEL__ */
42#endif /* _ASM_POWERPC_DCR_H */ 45#endif /* _ASM_POWERPC_DCR_H */
diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h
index 7c7de87bd8ae..a19a6f1a1cf1 100644
--- a/include/asm-powerpc/dma-mapping.h
+++ b/include/asm-powerpc/dma-mapping.h
@@ -37,9 +37,9 @@ extern void __dma_sync_page(struct page *page, unsigned long offset,
37 */ 37 */
38 38
39#define __dma_alloc_coherent(gfp, size, handle) NULL 39#define __dma_alloc_coherent(gfp, size, handle) NULL
40#define __dma_free_coherent(size, addr) do { } while (0) 40#define __dma_free_coherent(size, addr) ((void)0)
41#define __dma_sync(addr, size, rw) do { } while (0) 41#define __dma_sync(addr, size, rw) ((void)0)
42#define __dma_sync_page(pg, off, sz, rw) do { } while (0) 42#define __dma_sync_page(pg, off, sz, rw) ((void)0)
43 43
44#endif /* ! CONFIG_NOT_COHERENT_CACHE */ 44#endif /* ! CONFIG_NOT_COHERENT_CACHE */
45 45
@@ -251,7 +251,7 @@ dma_map_single(struct device *dev, void *ptr, size_t size,
251} 251}
252 252
253/* We do nothing. */ 253/* We do nothing. */
254#define dma_unmap_single(dev, addr, size, dir) do { } while (0) 254#define dma_unmap_single(dev, addr, size, dir) ((void)0)
255 255
256static inline dma_addr_t 256static inline dma_addr_t
257dma_map_page(struct device *dev, struct page *page, 257dma_map_page(struct device *dev, struct page *page,
@@ -266,7 +266,7 @@ dma_map_page(struct device *dev, struct page *page,
266} 266}
267 267
268/* We do nothing. */ 268/* We do nothing. */
269#define dma_unmap_page(dev, handle, size, dir) do { } while (0) 269#define dma_unmap_page(dev, handle, size, dir) ((void)0)
270 270
271static inline int 271static inline int
272dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 272dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
@@ -286,7 +286,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
286} 286}
287 287
288/* We don't do anything here. */ 288/* We don't do anything here. */
289#define dma_unmap_sg(dev, sg, nents, dir) do { } while (0) 289#define dma_unmap_sg(dev, sg, nents, dir) ((void)0)
290 290
291#endif /* CONFIG_PPC64 */ 291#endif /* CONFIG_PPC64 */
292 292
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 257d1cecb8c9..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
@@ -252,8 +253,6 @@ struct hcall_stats {
252 unsigned long tb_total; /* total wall time (mftb) of calls. */ 253 unsigned long tb_total; /* total wall time (mftb) of calls. */
253 unsigned long purr_total; /* total cpu time (PURR) of calls. */ 254 unsigned long purr_total; /* total cpu time (PURR) of calls. */
254}; 255};
255void update_hcall_stats(unsigned long opcode, unsigned long tb_delta,
256 unsigned long purr_delta);
257#define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1) 256#define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1)
258 257
259#endif /* __ASSEMBLY__ */ 258#endif /* __ASSEMBLY__ */
diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h
index d604863d72fb..9e4dd98eb220 100644
--- a/include/asm-powerpc/hw_irq.h
+++ b/include/asm-powerpc/hw_irq.h
@@ -107,25 +107,6 @@ static inline void local_irq_save_ptr(unsigned long *flags)
107 107
108#endif /* CONFIG_PPC64 */ 108#endif /* CONFIG_PPC64 */
109 109
110#define mask_irq(irq) \
111 ({ \
112 irq_desc_t *desc = get_irq_desc(irq); \
113 if (desc->chip && desc->chip->disable) \
114 desc->chip->disable(irq); \
115 })
116#define unmask_irq(irq) \
117 ({ \
118 irq_desc_t *desc = get_irq_desc(irq); \
119 if (desc->chip && desc->chip->enable) \
120 desc->chip->enable(irq); \
121 })
122#define ack_irq(irq) \
123 ({ \
124 irq_desc_t *desc = get_irq_desc(irq); \
125 if (desc->chip && desc->chip->ack) \
126 desc->chip->ack(irq); \
127 })
128
129/* 110/*
130 * interrupt-retrigger: should we handle this via lost interrupts and IPIs 111 * interrupt-retrigger: should we handle this via lost interrupts and IPIs
131 * or should we not care like we do now ? --BenH. 112 * or should we not care like we do now ? --BenH.
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/libata-portmap.h b/include/asm-powerpc/libata-portmap.h
new file mode 100644
index 000000000000..4d8518049f4d
--- /dev/null
+++ b/include/asm-powerpc/libata-portmap.h
@@ -0,0 +1,12 @@
1#ifndef __ASM_POWERPC_LIBATA_PORTMAP_H
2#define __ASM_POWERPC_LIBATA_PORTMAP_H
3
4#define ATA_PRIMARY_CMD 0x1F0
5#define ATA_PRIMARY_CTL 0x3F6
6#define ATA_PRIMARY_IRQ(dev) pci_get_legacy_ide_irq(dev, 0)
7
8#define ATA_SECONDARY_CMD 0x170
9#define ATA_SECONDARY_CTL 0x376
10#define ATA_SECONDARY_IRQ(dev) pci_get_legacy_ide_irq(dev, 1)
11
12#endif
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/module.h b/include/asm-powerpc/module.h
index 584fabfb4f08..e5f14b13ccf0 100644
--- a/include/asm-powerpc/module.h
+++ b/include/asm-powerpc/module.h
@@ -46,8 +46,6 @@ struct mod_arch_specific {
46 unsigned int num_bugs; 46 unsigned int num_bugs;
47}; 47};
48 48
49extern struct bug_entry *module_find_bug(unsigned long bugaddr);
50
51/* 49/*
52 * Select ELF headers. 50 * Select ELF headers.
53 * Make empty section for module_frob_arch_sections to expand. 51 * Make empty section for module_frob_arch_sections to expand.
diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
index 4a28a850998c..7afd5bf94528 100644
--- a/include/asm-powerpc/mpc52xx.h
+++ b/include/asm-powerpc/mpc52xx.h
@@ -244,10 +244,13 @@ struct mpc52xx_cdm {
244extern void __iomem * mpc52xx_find_and_map(const char *); 244extern void __iomem * mpc52xx_find_and_map(const char *);
245extern unsigned int mpc52xx_find_ipb_freq(struct device_node *node); 245extern unsigned int mpc52xx_find_ipb_freq(struct device_node *node);
246extern void mpc52xx_setup_cpu(void); 246extern void mpc52xx_setup_cpu(void);
247extern void mpc52xx_declare_of_platform_devices(void);
247 248
248extern void mpc52xx_init_irq(void); 249extern void mpc52xx_init_irq(void);
249extern unsigned int mpc52xx_get_irq(void); 250extern unsigned int mpc52xx_get_irq(void);
250 251
252extern int __init mpc52xx_add_bridge(struct device_node *node);
253
251#endif /* __ASSEMBLY__ */ 254#endif /* __ASSEMBLY__ */
252 255
253#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/page_32.h b/include/asm-powerpc/page_32.h
index 2677bad70f40..07f6d3cf5e5a 100644
--- a/include/asm-powerpc/page_32.h
+++ b/include/asm-powerpc/page_32.h
@@ -26,15 +26,7 @@ extern void clear_pages(void *page, int order);
26static inline void clear_page(void *page) { clear_pages(page, 0); } 26static inline void clear_page(void *page) { clear_pages(page, 0); }
27extern void copy_page(void *to, void *from); 27extern void copy_page(void *to, void *from);
28 28
29/* Pure 2^n version of get_order */ 29#include <asm-generic/page.h>
30extern __inline__ int get_order(unsigned long size)
31{
32 int lz;
33
34 size = (size-1) >> PAGE_SHIFT;
35 asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size));
36 return 32 - lz;
37}
38 30
39#endif /* __ASSEMBLY__ */ 31#endif /* __ASSEMBLY__ */
40 32
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index 7bb7f9009806..d9bf5aba96cb 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -31,12 +31,12 @@ struct pci_controller {
31 int last_busno; 31 int last_busno;
32 32
33 void __iomem *io_base_virt; 33 void __iomem *io_base_virt;
34 unsigned long io_base_phys; 34 resource_size_t io_base_phys;
35 35
36 /* Some machines have a non 1:1 mapping of 36 /* Some machines have a non 1:1 mapping of
37 * the PCI memory space in the CPU bus space 37 * the PCI memory space in the CPU bus space
38 */ 38 */
39 unsigned long pci_mem_offset; 39 resource_size_t pci_mem_offset;
40 unsigned long pci_io_size; 40 unsigned long pci_io_size;
41 41
42 struct pci_ops *ops; 42 struct pci_ops *ops;
@@ -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/pci.h b/include/asm-powerpc/pci.h
index 16f13319c769..ac656ee6bb19 100644
--- a/include/asm-powerpc/pci.h
+++ b/include/asm-powerpc/pci.h
@@ -143,8 +143,13 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
143/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ 143/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */
144#define HAVE_PCI_MMAP 1 144#define HAVE_PCI_MMAP 1
145 145
146#ifdef CONFIG_PPC64 146#if defined(CONFIG_PPC64) || defined(CONFIG_NOT_COHERENT_CACHE)
147/* pci_unmap_{single,page} is not a nop, thus... */ 147/*
148 * For 64-bit kernels, pci_unmap_{single,page} is not a nop.
149 * For 32-bit non-coherent kernels, pci_dma_sync_single_for_cpu() and
150 * so on are not nops.
151 * and thus...
152 */
148#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ 153#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
149 dma_addr_t ADDR_NAME; 154 dma_addr_t ADDR_NAME;
150#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ 155#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
@@ -158,6 +163,20 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
158#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ 163#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
159 (((PTR)->LEN_NAME) = (VAL)) 164 (((PTR)->LEN_NAME) = (VAL))
160 165
166#else /* 32-bit && coherent */
167
168/* pci_unmap_{page,single} is a nop so... */
169#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
170#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
171#define pci_unmap_addr(PTR, ADDR_NAME) (0)
172#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
173#define pci_unmap_len(PTR, LEN_NAME) (0)
174#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
175
176#endif /* CONFIG_PPC64 || CONFIG_NOT_COHERENT_CACHE */
177
178#ifdef CONFIG_PPC64
179
161/* The PCI address space does not equal the physical memory address 180/* The PCI address space does not equal the physical memory address
162 * space (we have an IOMMU). The IDE and SCSI device layers use 181 * space (we have an IOMMU). The IDE and SCSI device layers use
163 * this boolean for bounce buffer decisions. 182 * this boolean for bounce buffer decisions.
@@ -172,16 +191,8 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
172 */ 191 */
173#define PCI_DMA_BUS_IS_PHYS (1) 192#define PCI_DMA_BUS_IS_PHYS (1)
174 193
175/* pci_unmap_{page,single} is a nop so... */
176#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
177#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
178#define pci_unmap_addr(PTR, ADDR_NAME) (0)
179#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
180#define pci_unmap_len(PTR, LEN_NAME) (0)
181#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
182
183#endif /* CONFIG_PPC64 */ 194#endif /* CONFIG_PPC64 */
184 195
185extern void pcibios_resource_to_bus(struct pci_dev *dev, 196extern void pcibios_resource_to_bus(struct pci_dev *dev,
186 struct pci_bus_region *region, 197 struct pci_bus_region *region,
187 struct resource *res); 198 struct resource *res);
diff --git a/include/asm-powerpc/posix_types.h b/include/asm-powerpc/posix_types.h
index c6391077224f..2f2288f520be 100644
--- a/include/asm-powerpc/posix_types.h
+++ b/include/asm-powerpc/posix_types.h
@@ -60,7 +60,7 @@ typedef struct {
60#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) 60#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
61#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) 61#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
62#define __FD_ZERO(set) \ 62#define __FD_ZERO(set) \
63 ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set))) 63 ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))
64 64
65#else /* __GNUC__ */ 65#else /* __GNUC__ */
66 66
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h
index 52a69ed0d90a..4f5a1e01fdac 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,39 @@ 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
462#endif 391#endif
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h
index 6faae7b14d55..0d7f0164ed81 100644
--- a/include/asm-powerpc/reg.h
+++ b/include/asm-powerpc/reg.h
@@ -143,6 +143,7 @@
143 143
144/* Special Purpose Registers (SPRNs)*/ 144/* Special Purpose Registers (SPRNs)*/
145#define SPRN_CTR 0x009 /* Count Register */ 145#define SPRN_CTR 0x009 /* Count Register */
146#define SPRN_DSCR 0x11
146#define SPRN_CTRLF 0x088 147#define SPRN_CTRLF 0x088
147#define SPRN_CTRLT 0x098 148#define SPRN_CTRLT 0x098
148#define CTRL_CT 0xc0000000 /* current thread */ 149#define CTRL_CT 0xc0000000 /* current thread */
@@ -163,7 +164,9 @@
163#define SPRN_TBRU 0x10D /* Time Base Read Upper Register (user, R/O) */ 164#define SPRN_TBRU 0x10D /* Time Base Read Upper Register (user, R/O) */
164#define SPRN_TBWL 0x11C /* Time Base Lower Register (super, R/W) */ 165#define SPRN_TBWL 0x11C /* Time Base Lower Register (super, R/W) */
165#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 */
166#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 */
167#define SPRN_DBAT0L 0x219 /* Data BAT 0 Lower Register */ 170#define SPRN_DBAT0L 0x219 /* Data BAT 0 Lower Register */
168#define SPRN_DBAT0U 0x218 /* Data BAT 0 Upper Register */ 171#define SPRN_DBAT0U 0x218 /* Data BAT 0 Upper Register */
169#define SPRN_DBAT1L 0x21B /* Data BAT 1 Lower Register */ 172#define SPRN_DBAT1L 0x21B /* Data BAT 1 Lower Register */
@@ -389,6 +392,12 @@
389#define SPRN_HSRR0 0x13A /* Save/Restore Register 0 */ 392#define SPRN_HSRR0 0x13A /* Save/Restore Register 0 */
390#define SPRN_HSRR1 0x13B /* Save/Restore Register 1 */ 393#define SPRN_HSRR1 0x13B /* Save/Restore Register 1 */
391 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
392#ifndef SPRN_SVR 401#ifndef SPRN_SVR
393#define SPRN_SVR 0x11E /* System Version Register */ 402#define SPRN_SVR 0x11E /* System Version Register */
394#endif 403#endif
@@ -460,6 +469,13 @@
460#define SPRN_SIAR 780 469#define SPRN_SIAR 780
461#define SPRN_SDAR 781 470#define SPRN_SDAR 781
462 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
463#else /* 32-bit */ 479#else /* 32-bit */
464#define SPRN_MMCR0 952 /* Monitor Mode Control Register 0 */ 480#define SPRN_MMCR0 952 /* Monitor Mode Control Register 0 */
465#define MMCR0_FC 0x80000000UL /* freeze counters */ 481#define MMCR0_FC 0x80000000UL /* freeze counters */
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h
index 5a0c136c0416..8eaa7b28d9d0 100644
--- a/include/asm-powerpc/rtas.h
+++ b/include/asm-powerpc/rtas.h
@@ -159,6 +159,7 @@ extern struct rtas_t rtas;
159 159
160extern void enter_rtas(unsigned long); 160extern void enter_rtas(unsigned long);
161extern int rtas_token(const char *service); 161extern int rtas_token(const char *service);
162extern int rtas_service_present(const char *service);
162extern int rtas_call(int token, int, int, int *, ...); 163extern int rtas_call(int token, int, int, int *, ...);
163extern void rtas_restart(char *cmd); 164extern void rtas_restart(char *cmd);
164extern void rtas_power_off(void); 165extern void rtas_power_off(void);
@@ -221,8 +222,6 @@ extern int rtas_get_error_log_max(void);
221extern spinlock_t rtas_data_buf_lock; 222extern spinlock_t rtas_data_buf_lock;
222extern char rtas_data_buf[RTAS_DATA_BUF_SIZE]; 223extern char rtas_data_buf[RTAS_DATA_BUF_SIZE];
223 224
224extern void rtas_stop_self(void);
225
226/* RMO buffer reserved for user-space RTAS use */ 225/* RMO buffer reserved for user-space RTAS use */
227extern unsigned long rtas_rmo_buf; 226extern unsigned long rtas_rmo_buf;
228 227
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 fdad4267b447..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
@@ -161,6 +174,7 @@ struct spu_syscall_block {
161extern long spu_sys_callback(struct spu_syscall_block *s); 174extern long spu_sys_callback(struct spu_syscall_block *s);
162 175
163/* syscalls implemented in spufs */ 176/* syscalls implemented in spufs */
177struct file;
164extern struct spufs_calls { 178extern struct spufs_calls {
165 asmlinkage long (*create_thread)(const char __user *name, 179 asmlinkage long (*create_thread)(const char __user *name,
166 unsigned int flags, mode_t mode); 180 unsigned int flags, mode_t mode);
@@ -232,6 +246,7 @@ void spu_remove_sysdev_attr_group(struct attribute_group *attrs);
232 * to object-id spufs file from user space and the notifer 246 * to object-id spufs file from user space and the notifer
233 * function can assume that spu->ctx is valid. 247 * function can assume that spu->ctx is valid.
234 */ 248 */
249struct notifier_block;
235int spu_switch_event_register(struct notifier_block * n); 250int spu_switch_event_register(struct notifier_block * n);
236int spu_switch_event_unregister(struct notifier_block * n); 251int spu_switch_event_unregister(struct notifier_block * n);
237 252
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/termbits.h b/include/asm-powerpc/termbits.h
index 6d533b07aaf5..5e79198f7d18 100644
--- a/include/asm-powerpc/termbits.h
+++ b/include/asm-powerpc/termbits.h
@@ -30,6 +30,19 @@ struct termios {
30 speed_t c_ospeed; /* output speed */ 30 speed_t c_ospeed; /* output speed */
31}; 31};
32 32
33/* For PowerPC the termios and ktermios are the same */
34
35struct ktermios {
36 tcflag_t c_iflag; /* input mode flags */
37 tcflag_t c_oflag; /* output mode flags */
38 tcflag_t c_cflag; /* control mode flags */
39 tcflag_t c_lflag; /* local mode flags */
40 cc_t c_cc[NCCS]; /* control characters */
41 cc_t c_line; /* line discipline (== c_cc[19]) */
42 speed_t c_ispeed; /* input speed */
43 speed_t c_ospeed; /* output speed */
44};
45
33/* c_cc characters */ 46/* c_cc characters */
34#define VINTR 0 47#define VINTR 0
35#define VQUIT 1 48#define VQUIT 1
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h
index d339e2e88b11..3f32ca8bfec9 100644
--- a/include/asm-powerpc/thread_info.h
+++ b/include/asm-powerpc/thread_info.h
@@ -122,6 +122,7 @@ static inline struct thread_info *current_thread_info(void)
122#define TIF_RESTOREALL 12 /* Restore all regs (implies NOERROR) */ 122#define TIF_RESTOREALL 12 /* Restore all regs (implies NOERROR) */
123#define TIF_NOERROR 14 /* Force successful syscall return */ 123#define TIF_NOERROR 14 /* Force successful syscall return */
124#define TIF_RESTORE_SIGMASK 15 /* Restore signal mask in do_signal */ 124#define TIF_RESTORE_SIGMASK 15 /* Restore signal mask in do_signal */
125#define TIF_FREEZE 16 /* Freezing for suspend */
125 126
126/* as above, but as bit values */ 127/* as above, but as bit values */
127#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 128#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -138,6 +139,7 @@ static inline struct thread_info *current_thread_info(void)
138#define _TIF_RESTOREALL (1<<TIF_RESTOREALL) 139#define _TIF_RESTOREALL (1<<TIF_RESTOREALL)
139#define _TIF_NOERROR (1<<TIF_NOERROR) 140#define _TIF_NOERROR (1<<TIF_NOERROR)
140#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 141#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
142#define _TIF_FREEZE (1<<TIF_FREEZE)
141#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) 143#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP)
142 144
143#define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ 145#define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \
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/topology.h b/include/asm-powerpc/topology.h
index 50c014007de7..6610495f5f16 100644
--- a/include/asm-powerpc/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -66,6 +66,7 @@ static inline int pcibus_to_node(struct pci_bus *bus)
66 | SD_BALANCE_EXEC \ 66 | SD_BALANCE_EXEC \
67 | SD_BALANCE_NEWIDLE \ 67 | SD_BALANCE_NEWIDLE \
68 | SD_WAKE_IDLE \ 68 | SD_WAKE_IDLE \
69 | SD_SERIALIZE \
69 | SD_WAKE_BALANCE, \ 70 | SD_WAKE_BALANCE, \
70 .last_balance = jiffies, \ 71 .last_balance = jiffies, \
71 .balance_interval = 1, \ 72 .balance_interval = 1, \
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/pci-bridge.h b/include/asm-ppc/pci-bridge.h
index 6c955d0c1ef0..4d35b844bc58 100644
--- a/include/asm-ppc/pci-bridge.h
+++ b/include/asm-ppc/pci-bridge.h
@@ -20,8 +20,8 @@ extern unsigned long pci_bus_mem_base_phys(unsigned int bus);
20extern struct pci_controller* pcibios_alloc_controller(void); 20extern struct pci_controller* pcibios_alloc_controller(void);
21 21
22/* Helper function for setting up resources */ 22/* Helper function for setting up resources */
23extern void pci_init_resource(struct resource *res, unsigned long start, 23extern void pci_init_resource(struct resource *res, resource_size_t start,
24 unsigned long end, int flags, char *name); 24 resource_size_t end, int flags, char *name);
25 25
26/* Get the PCI host controller for a bus */ 26/* Get the PCI host controller for a bus */
27extern struct pci_controller* pci_bus_to_hose(int bus); 27extern struct pci_controller* pci_bus_to_hose(int bus);
@@ -50,12 +50,12 @@ struct pci_controller {
50 int bus_offset; 50 int bus_offset;
51 51
52 void __iomem *io_base_virt; 52 void __iomem *io_base_virt;
53 unsigned long io_base_phys; 53 resource_size_t io_base_phys;
54 54
55 /* Some machines (PReP) have a non 1:1 mapping of 55 /* Some machines (PReP) have a non 1:1 mapping of
56 * the PCI memory space in the CPU bus space 56 * the PCI memory space in the CPU bus space
57 */ 57 */
58 unsigned long pci_mem_offset; 58 resource_size_t pci_mem_offset;
59 59
60 struct pci_ops *ops; 60 struct pci_ops *ops;
61 volatile unsigned int __iomem *cfg_addr; 61 volatile unsigned int __iomem *cfg_addr;
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
index 11ffaaa5da16..9d162028dab9 100644
--- a/include/asm-ppc/pci.h
+++ b/include/asm-ppc/pci.h
@@ -61,6 +61,27 @@ extern unsigned long pci_bus_to_phys(unsigned int ba, int busnr);
61 */ 61 */
62#define PCI_DMA_BUS_IS_PHYS (1) 62#define PCI_DMA_BUS_IS_PHYS (1)
63 63
64#ifdef CONFIG_NOT_COHERENT_CACHE
65/*
66 * pci_unmap_{page,single} are NOPs but pci_dma_sync_single_for_cpu()
67 * and so on are not, so...
68 */
69
70#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
71 dma_addr_t ADDR_NAME;
72#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
73 __u32 LEN_NAME;
74#define pci_unmap_addr(PTR, ADDR_NAME) \
75 ((PTR)->ADDR_NAME)
76#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
77 (((PTR)->ADDR_NAME) = (VAL))
78#define pci_unmap_len(PTR, LEN_NAME) \
79 ((PTR)->LEN_NAME)
80#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
81 (((PTR)->LEN_NAME) = (VAL))
82
83#else /* coherent */
84
64/* pci_unmap_{page,single} is a nop so... */ 85/* pci_unmap_{page,single} is a nop so... */
65#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) 86#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
66#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) 87#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
@@ -69,6 +90,8 @@ extern unsigned long pci_bus_to_phys(unsigned int ba, int busnr);
69#define pci_unmap_len(PTR, LEN_NAME) (0) 90#define pci_unmap_len(PTR, LEN_NAME) (0)
70#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) 91#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
71 92
93#endif /* CONFIG_NOT_COHERENT_CACHE */
94
72#ifdef CONFIG_PCI 95#ifdef CONFIG_PCI
73static inline void pci_dma_burst_advice(struct pci_dev *pdev, 96static inline void pci_dma_burst_advice(struct pci_dev *pdev,
74 enum pci_dma_burst_strategy *strat, 97 enum pci_dma_burst_strategy *strat,
diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
index 602fbadeaf48..82948ed2744a 100644
--- a/include/asm-ppc/reg_booke.h
+++ b/include/asm-ppc/reg_booke.h
@@ -10,40 +10,6 @@
10#define __ASM_PPC_REG_BOOKE_H__ 10#define __ASM_PPC_REG_BOOKE_H__
11 11
12#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
13/* Device Control Registers */
14void __mtdcr(int reg, unsigned int val);
15unsigned int __mfdcr(int reg);
16#define mfdcr(rn) \
17 ({unsigned int rval; \
18 if (__builtin_constant_p(rn)) \
19 asm volatile("mfdcr %0," __stringify(rn) \
20 : "=r" (rval)); \
21 else \
22 rval = __mfdcr(rn); \
23 rval;})
24
25#define mtdcr(rn, v) \
26do { \
27 if (__builtin_constant_p(rn)) \
28 asm volatile("mtdcr " __stringify(rn) ",%0" \
29 : : "r" (v)); \
30 else \
31 __mtdcr(rn, v); \
32} while (0)
33
34/* R/W of indirect DCRs make use of standard naming conventions for DCRs */
35#define mfdcri(base, reg) \
36({ \
37 mtdcr(base ## _CFGADDR, base ## _ ## reg); \
38 mfdcr(base ## _CFGDATA); \
39})
40
41#define mtdcri(base, reg, data) \
42do { \
43 mtdcr(base ## _CFGADDR, base ## _ ## reg); \
44 mtdcr(base ## _CFGDATA, data); \
45} while (0)
46
47/* Performance Monitor Registers */ 13/* Performance Monitor Registers */
48#define mfpmr(rn) ({unsigned int rval; \ 14#define mfpmr(rn) ({unsigned int rval; \
49 asm volatile("mfpmr %0," __stringify(rn) \ 15 asm volatile("mfpmr %0," __stringify(rn) \
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/cacheflush.h b/include/asm-s390/cacheflush.h
index e399a8ba2ed7..f7cade8083f3 100644
--- a/include/asm-s390/cacheflush.h
+++ b/include/asm-s390/cacheflush.h
@@ -7,6 +7,7 @@
7/* Caches aren't brain-dead on the s390. */ 7/* Caches aren't brain-dead on the s390. */
8#define flush_cache_all() do { } while (0) 8#define flush_cache_all() do { } while (0)
9#define flush_cache_mm(mm) do { } while (0) 9#define flush_cache_mm(mm) do { } while (0)
10#define flush_cache_dup_mm(mm) do { } while (0)
10#define flush_cache_range(vma, start, end) do { } while (0) 11#define flush_cache_range(vma, start, end) do { } while (0)
11#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 12#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
12#define flush_dcache_page(page) do { } while (0) 13#define flush_dcache_page(page) do { } while (0)
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/dasd.h b/include/asm-s390/dasd.h
index c042f9578081..604f68fa6f56 100644
--- a/include/asm-s390/dasd.h
+++ b/include/asm-s390/dasd.h
@@ -69,11 +69,13 @@ typedef struct dasd_information2_t {
69 * 0x01: readonly (ro) 69 * 0x01: readonly (ro)
70 * 0x02: use diag discipline (diag) 70 * 0x02: use diag discipline (diag)
71 * 0x04: set the device initially online (internal use only) 71 * 0x04: set the device initially online (internal use only)
72 * 0x08: enable ERP related logging
72 */ 73 */
73#define DASD_FEATURE_DEFAULT 0x00 74#define DASD_FEATURE_DEFAULT 0x00
74#define DASD_FEATURE_READONLY 0x01 75#define DASD_FEATURE_READONLY 0x01
75#define DASD_FEATURE_USEDIAG 0x02 76#define DASD_FEATURE_USEDIAG 0x02
76#define DASD_FEATURE_INITIAL_ONLINE 0x04 77#define DASD_FEATURE_INITIAL_ONLINE 0x04
78#define DASD_FEATURE_ERPLOG 0x08
77 79
78#define DASD_PARTN_BITS 2 80#define DASD_PARTN_BITS 2
79 81
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/futex.h b/include/asm-s390/futex.h
index 5e261e1de671..5c5d02de49e9 100644
--- a/include/asm-s390/futex.h
+++ b/include/asm-s390/futex.h
@@ -4,8 +4,8 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/futex.h> 6#include <linux/futex.h>
7#include <linux/uaccess.h>
7#include <asm/errno.h> 8#include <asm/errno.h>
8#include <asm/uaccess.h>
9 9
10static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr) 10static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
11{ 11{
@@ -21,7 +21,9 @@ static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) 21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT; 22 return -EFAULT;
23 23
24 pagefault_disable();
24 ret = uaccess.futex_atomic_op(op, uaddr, oparg, &oldval); 25 ret = uaccess.futex_atomic_op(op, uaddr, oparg, &oldval);
26 pagefault_enable();
25 27
26 if (!ret) { 28 if (!ret) {
27 switch (cmp) { 29 switch (cmp) {
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..a4c2d550dad4 100644
--- a/include/asm-s390/io.h
+++ b/include/asm-s390/io.h
@@ -28,11 +28,7 @@ static inline unsigned long virt_to_phys(volatile void * address)
28{ 28{
29 unsigned long real_address; 29 unsigned long real_address;
30 asm volatile( 30 asm volatile(
31#ifndef __s390x__
32 " lra %0,0(%1)\n" 31 " lra %0,0(%1)\n"
33#else /* __s390x__ */
34 " lrag %0,0(%1)\n"
35#endif /* __s390x__ */
36 " jz 0f\n" 32 " jz 0f\n"
37 " la %0,0\n" 33 " la %0,0\n"
38 "0:" 34 "0:"
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/page.h b/include/asm-s390/page.h
index 363ea761d5ee..05ea6f172786 100644
--- a/include/asm-s390/page.h
+++ b/include/asm-s390/page.h
@@ -127,6 +127,26 @@ page_get_storage_key(unsigned long addr)
127 return skey; 127 return skey;
128} 128}
129 129
130extern unsigned long max_pfn;
131
132static inline int pfn_valid(unsigned long pfn)
133{
134 unsigned long dummy;
135 int ccode;
136
137 if (pfn >= max_pfn)
138 return 0;
139
140 asm volatile(
141 " lra %0,0(%2)\n"
142 " ipm %1\n"
143 " srl %1,28\n"
144 : "=d" (dummy), "=d" (ccode)
145 : "a" (pfn << PAGE_SHIFT)
146 : "cc");
147 return !ccode;
148}
149
130#endif /* !__ASSEMBLY__ */ 150#endif /* !__ASSEMBLY__ */
131 151
132/* to align the pointer to the (next) page boundary */ 152/* to align the pointer to the (next) page boundary */
@@ -138,8 +158,6 @@ page_get_storage_key(unsigned long addr)
138#define __va(x) (void *)(unsigned long)(x) 158#define __va(x) (void *)(unsigned long)(x)
139#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 159#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
140#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) 160#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
141
142#define pfn_valid(pfn) ((pfn) < max_mapnr)
143#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 161#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
144 162
145#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 163#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
index 28619de5ecae..56c8a6c80e2e 100644
--- a/include/asm-s390/pgalloc.h
+++ b/include/asm-s390/pgalloc.h
@@ -25,8 +25,11 @@ extern void diag10(unsigned long addr);
25 * Page allocation orders. 25 * Page allocation orders.
26 */ 26 */
27#ifndef __s390x__ 27#ifndef __s390x__
28# define PTE_ALLOC_ORDER 0
29# define PMD_ALLOC_ORDER 0
28# define PGD_ALLOC_ORDER 1 30# define PGD_ALLOC_ORDER 1
29#else /* __s390x__ */ 31#else /* __s390x__ */
32# define PTE_ALLOC_ORDER 0
30# define PMD_ALLOC_ORDER 2 33# define PMD_ALLOC_ORDER 2
31# define PGD_ALLOC_ORDER 2 34# define PGD_ALLOC_ORDER 2
32#endif /* __s390x__ */ 35#endif /* __s390x__ */
@@ -44,6 +47,17 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
44 47
45 if (!pgd) 48 if (!pgd)
46 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 }
47 for (i = 0; i < PTRS_PER_PGD; i++) 61 for (i = 0; i < PTRS_PER_PGD; i++)
48#ifndef __s390x__ 62#ifndef __s390x__
49 pmd_clear(pmd_offset(pgd + i, i*PGDIR_SIZE)); 63 pmd_clear(pmd_offset(pgd + i, i*PGDIR_SIZE));
@@ -55,6 +69,10 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
55 69
56static inline void pgd_free(pgd_t *pgd) 70static inline void pgd_free(pgd_t *pgd)
57{ 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);
58 free_pages((unsigned long) pgd, PGD_ALLOC_ORDER); 76 free_pages((unsigned long) pgd, PGD_ALLOC_ORDER);
59} 77}
60 78
@@ -68,6 +86,7 @@ static inline void pgd_free(pgd_t *pgd)
68#define pmd_free(x) do { } while (0) 86#define pmd_free(x) do { } while (0)
69#define __pmd_free_tlb(tlb,x) do { } while (0) 87#define __pmd_free_tlb(tlb,x) do { } while (0)
70#define pgd_populate(mm, pmd, pte) BUG() 88#define pgd_populate(mm, pmd, pte) BUG()
89#define pgd_populate_kernel(mm, pmd, pte) BUG()
71#else /* __s390x__ */ 90#else /* __s390x__ */
72static 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)
73{ 92{
@@ -76,6 +95,17 @@ static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
76 95
77 if (!pmd) 96 if (!pmd)
78 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 }
79 for (i=0; i < PTRS_PER_PMD; i++) 109 for (i=0; i < PTRS_PER_PMD; i++)
80 pmd_clear(pmd + i); 110 pmd_clear(pmd + i);
81 return pmd; 111 return pmd;
@@ -83,6 +113,10 @@ static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
83 113
84static inline void pmd_free (pmd_t *pmd) 114static inline void pmd_free (pmd_t *pmd)
85{ 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);
86 free_pages((unsigned long) pmd, PMD_ALLOC_ORDER); 120 free_pages((unsigned long) pmd, PMD_ALLOC_ORDER);
87} 121}
88 122
@@ -92,11 +126,22 @@ static inline void pmd_free (pmd_t *pmd)
92 pmd_free(pmd); \ 126 pmd_free(pmd); \
93 } while (0) 127 } while (0)
94 128
95static 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)
96{ 131{
97 pgd_val(*pgd) = _PGD_ENTRY | __pa(pmd); 132 pgd_val(*pgd) = _PGD_ENTRY | __pa(pmd);
98} 133}
99 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
100#endif /* __s390x__ */ 145#endif /* __s390x__ */
101 146
102static inline void 147static inline void
@@ -116,7 +161,13 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
116static inline void 161static inline void
117pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *page) 162pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *page)
118{ 163{
119 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);
120} 171}
121 172
122/* 173/*
@@ -130,6 +181,17 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long vmaddr)
130 181
131 if (!pte) 182 if (!pte)
132 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 }
133 for (i=0; i < PTRS_PER_PTE; i++) { 195 for (i=0; i < PTRS_PER_PTE; i++) {
134 pte_clear(mm, vmaddr, pte + i); 196 pte_clear(mm, vmaddr, pte + i);
135 vmaddr += PAGE_SIZE; 197 vmaddr += PAGE_SIZE;
@@ -148,14 +210,30 @@ pte_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
148 210
149static inline void pte_free_kernel(pte_t *pte) 211static inline void pte_free_kernel(pte_t *pte)
150{ 212{
151 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);
152} 218}
153 219
154static inline void pte_free(struct page *pte) 220static inline void pte_free(struct page *pte)
155{ 221{
156 __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);
157} 227}
158 228
159#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})
160 238
161#endif /* _S390_PGALLOC_H */ 239#endif /* _S390_PGALLOC_H */
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index 2d968a69ed1f..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
@@ -107,23 +108,25 @@ extern char empty_zero_page[PAGE_SIZE];
107 * The vmalloc() routines leaves a hole of 4kB between each vmalloced 108 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
108 * area for the same reason. ;) 109 * area for the same reason. ;)
109 */ 110 */
111extern unsigned long vmalloc_end;
110#define VMALLOC_OFFSET (8*1024*1024) 112#define VMALLOC_OFFSET (8*1024*1024)
111#define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) \ 113#define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) \
112 & ~(VMALLOC_OFFSET-1)) 114 & ~(VMALLOC_OFFSET-1))
115#define VMALLOC_END vmalloc_end
113 116
114/* 117/*
115 * We need some free virtual space to be able to do vmalloc. 118 * We need some free virtual space to be able to do vmalloc.
116 * VMALLOC_MIN_SIZE defines the minimum size of the vmalloc 119 * VMALLOC_MIN_SIZE defines the minimum size of the vmalloc
117 * area. On a machine with 2GB memory we make sure that we 120 * area. On a machine with 2GB memory we make sure that we
118 * have at least 128MB free space for vmalloc. On a machine 121 * have at least 128MB free space for vmalloc. On a machine
119 * with 4TB we make sure we have at least 1GB. 122 * with 4TB we make sure we have at least 128GB.
120 */ 123 */
121#ifndef __s390x__ 124#ifndef __s390x__
122#define VMALLOC_MIN_SIZE 0x8000000UL 125#define VMALLOC_MIN_SIZE 0x8000000UL
123#define VMALLOC_END 0x80000000UL 126#define VMALLOC_END_INIT 0x80000000UL
124#else /* __s390x__ */ 127#else /* __s390x__ */
125#define VMALLOC_MIN_SIZE 0x40000000UL 128#define VMALLOC_MIN_SIZE 0x2000000000UL
126#define VMALLOC_END 0x40000000000UL 129#define VMALLOC_END_INIT 0x40000000000UL
127#endif /* __s390x__ */ 130#endif /* __s390x__ */
128 131
129/* 132/*
@@ -221,6 +224,8 @@ extern char empty_zero_page[PAGE_SIZE];
221#define _PAGE_TYPE_FILE 0x601 /* bit 0x002 is used for offset !! */ 224#define _PAGE_TYPE_FILE 0x601 /* bit 0x002 is used for offset !! */
222#define _PAGE_TYPE_RO 0x200 225#define _PAGE_TYPE_RO 0x200
223#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
224 229
225/* 230/*
226 * 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,
@@ -241,11 +246,13 @@ extern char empty_zero_page[PAGE_SIZE];
241 * _PAGE_TYPE_FILE 11?1 -> 11?1 246 * _PAGE_TYPE_FILE 11?1 -> 11?1
242 * _PAGE_TYPE_RO 0100 -> 1100 247 * _PAGE_TYPE_RO 0100 -> 1100
243 * _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
244 * 251 *
245 * pte_none is true for bits combinations 1000, 1100 252 * pte_none is true for bits combinations 1000, 1010, 1100, 1110
246 * 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
247 * pte_file is true for bits combinations 1101, 1111 254 * pte_file is true for bits combinations 1101, 1111
248 * 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.
249 */ 256 */
250 257
251#ifndef __s390x__ 258#ifndef __s390x__
@@ -310,33 +317,100 @@ extern char empty_zero_page[PAGE_SIZE];
310#define PAGE_NONE __pgprot(_PAGE_TYPE_NONE) 317#define PAGE_NONE __pgprot(_PAGE_TYPE_NONE)
311#define PAGE_RO __pgprot(_PAGE_TYPE_RO) 318#define PAGE_RO __pgprot(_PAGE_TYPE_RO)
312#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)
313 322
314#define PAGE_KERNEL PAGE_RW 323#define PAGE_KERNEL PAGE_RW
315#define PAGE_COPY PAGE_RO 324#define PAGE_COPY PAGE_RO
316 325
317/* 326/*
318 * 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.
319 * same are read. Also, write permissions imply read permissions. This is 328 * Write permission always implies read permission. In theory with a
320 * 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.
321 */ 333 */
322 /*xwr*/ 334 /*xwr*/
323#define __P000 PAGE_NONE 335#define __P000 PAGE_NONE
324#define __P001 PAGE_RO 336#define __P001 PAGE_RO
325#define __P010 PAGE_RO 337#define __P010 PAGE_RO
326#define __P011 PAGE_RO 338#define __P011 PAGE_RO
327#define __P100 PAGE_RO 339#define __P100 PAGE_EX_RO
328#define __P101 PAGE_RO 340#define __P101 PAGE_EX_RO
329#define __P110 PAGE_RO 341#define __P110 PAGE_EX_RO
330#define __P111 PAGE_RO 342#define __P111 PAGE_EX_RO
331 343
332#define __S000 PAGE_NONE 344#define __S000 PAGE_NONE
333#define __S001 PAGE_RO 345#define __S001 PAGE_RO
334#define __S010 PAGE_RW 346#define __S010 PAGE_RW
335#define __S011 PAGE_RW 347#define __S011 PAGE_RW
336#define __S100 PAGE_RO 348#define __S100 PAGE_EX_RO
337#define __S101 PAGE_RO 349#define __S101 PAGE_EX_RO
338#define __S110 PAGE_RW 350#define __S110 PAGE_EX_RW
339#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}
340 414
341/* 415/*
342 * Certain architectures need to do special things when PTEs 416 * Certain architectures need to do special things when PTEs
@@ -345,7 +419,16 @@ extern char empty_zero_page[PAGE_SIZE];
345 */ 419 */
346static inline void set_pte(pte_t *pteptr, pte_t pteval) 420static inline void set_pte(pte_t *pteptr, pte_t pteval)
347{ 421{
422 pte_t *shadow_pte = get_shadow_pte(pteptr);
423
348 *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 }
349} 432}
350#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)
351 434
@@ -463,7 +546,7 @@ static inline int pte_read(pte_t pte)
463 546
464static inline void pgd_clear(pgd_t * pgdp) { } 547static inline void pgd_clear(pgd_t * pgdp) { }
465 548
466static inline void pmd_clear(pmd_t * pmdp) 549static inline void pmd_clear_kernel(pmd_t * pmdp)
467{ 550{
468 pmd_val(pmdp[0]) = _PAGE_TABLE_INV; 551 pmd_val(pmdp[0]) = _PAGE_TABLE_INV;
469 pmd_val(pmdp[1]) = _PAGE_TABLE_INV; 552 pmd_val(pmdp[1]) = _PAGE_TABLE_INV;
@@ -471,24 +554,55 @@ static inline void pmd_clear(pmd_t * pmdp)
471 pmd_val(pmdp[3]) = _PAGE_TABLE_INV; 554 pmd_val(pmdp[3]) = _PAGE_TABLE_INV;
472} 555}
473 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
474#else /* __s390x__ */ 566#else /* __s390x__ */
475 567
476static inline void pgd_clear(pgd_t * pgdp) 568static inline void pgd_clear_kernel(pgd_t * pgdp)
477{ 569{
478 pgd_val(*pgdp) = _PGD_ENTRY_INV | _PGD_ENTRY; 570 pgd_val(*pgdp) = _PGD_ENTRY_INV | _PGD_ENTRY;
479} 571}
480 572
481static 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)
482{ 583{
483 pmd_val(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY; 584 pmd_val(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY;
484 pmd_val1(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY; 585 pmd_val1(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY;
485} 586}
486 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
487#endif /* __s390x__ */ 597#endif /* __s390x__ */
488 598
489static 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)
490{ 600{
601 pte_t *shadow_pte = get_shadow_pte(ptep);
602
491 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;
492} 606}
493 607
494/* 608/*
@@ -606,8 +720,11 @@ ptep_clear_flush(struct vm_area_struct *vma,
606 unsigned long address, pte_t *ptep) 720 unsigned long address, pte_t *ptep)
607{ 721{
608 pte_t pte = *ptep; 722 pte_t pte = *ptep;
723 pte_t *shadow_pte = get_shadow_pte(ptep);
609 724
610 __ptep_ipte(address, ptep); 725 __ptep_ipte(address, ptep);
726 if (shadow_pte)
727 __ptep_ipte(address, shadow_pte);
611 return pte; 728 return pte;
612} 729}
613 730
@@ -815,11 +932,17 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
815 932
816#define kern_addr_valid(addr) (1) 933#define kern_addr_valid(addr) (1)
817 934
935extern int add_shared_memory(unsigned long start, unsigned long size);
936extern int remove_shared_memory(unsigned long start, unsigned long size);
937
818/* 938/*
819 * No page table caches to initialise 939 * No page table caches to initialise
820 */ 940 */
821#define pgtable_cache_init() do { } while (0) 941#define pgtable_cache_init() do { } while (0)
822 942
943#define __HAVE_ARCH_MEMMAP_INIT
944extern void memmap_init(unsigned long, int, unsigned long, unsigned long);
945
823#define __HAVE_ARCH_PTEP_ESTABLISH 946#define __HAVE_ARCH_PTEP_ESTABLISH
824#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 947#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
825#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 948#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
diff --git a/include/asm-s390/posix_types.h b/include/asm-s390/posix_types.h
index b94c98856e12..397d93fba3a7 100644
--- a/include/asm-s390/posix_types.h
+++ b/include/asm-s390/posix_types.h
@@ -104,7 +104,7 @@ static inline int __FD_ISSET(unsigned long fd, const __kernel_fd_set *fdsetp)
104 104
105#undef __FD_ZERO 105#undef __FD_ZERO
106#define __FD_ZERO(fdsetp) \ 106#define __FD_ZERO(fdsetp) \
107 ((void) memset ((__ptr_t) (fdsetp), 0, sizeof (__kernel_fd_set))) 107 ((void) memset ((void *) (fdsetp), 0, sizeof (__kernel_fd_set)))
108 108
109#endif /* __KERNEL__ */ 109#endif /* __KERNEL__ */
110 110
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/qdio.h b/include/asm-s390/qdio.h
index 7189c79bc673..127f72e77419 100644
--- a/include/asm-s390/qdio.h
+++ b/include/asm-s390/qdio.h
@@ -34,6 +34,7 @@
34#define QDIO_QETH_QFMT 0 34#define QDIO_QETH_QFMT 0
35#define QDIO_ZFCP_QFMT 1 35#define QDIO_ZFCP_QFMT 1
36#define QDIO_IQDIO_QFMT 2 36#define QDIO_IQDIO_QFMT 2
37#define QDIO_IQDIO_QFMT_ASYNCH 3
37 38
38struct qdio_buffer_element{ 39struct qdio_buffer_element{
39 unsigned int flags; 40 unsigned int flags;
diff --git a/include/asm-s390/reset.h b/include/asm-s390/reset.h
index 9b439cf67800..f584f4a52581 100644
--- a/include/asm-s390/reset.h
+++ b/include/asm-s390/reset.h
@@ -18,6 +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);
22
23#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/termbits.h b/include/asm-s390/termbits.h
index eb3f8bfabf61..585c78a6e407 100644
--- a/include/asm-s390/termbits.h
+++ b/include/asm-s390/termbits.h
@@ -25,6 +25,17 @@ struct termios {
25 cc_t c_cc[NCCS]; /* control characters */ 25 cc_t c_cc[NCCS]; /* control characters */
26}; 26};
27 27
28struct ktermios {
29 tcflag_t c_iflag; /* input mode flags */
30 tcflag_t c_oflag; /* output mode flags */
31 tcflag_t c_cflag; /* control mode flags */
32 tcflag_t c_lflag; /* local mode flags */
33 cc_t c_line; /* line discipline */
34 cc_t c_cc[NCCS]; /* control characters */
35 speed_t c_ispeed; /* input speed */
36 speed_t c_ospeed; /* output speed */
37};
38
28/* c_cc characters */ 39/* c_cc characters */
29#define VINTR 0 40#define VINTR 0
30#define VQUIT 1 41#define VQUIT 1
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/atomic-irq.h b/include/asm-sh/atomic-irq.h
new file mode 100644
index 000000000000..74f7943cff6f
--- /dev/null
+++ b/include/asm-sh/atomic-irq.h
@@ -0,0 +1,71 @@
1#ifndef __ASM_SH_ATOMIC_IRQ_H
2#define __ASM_SH_ATOMIC_IRQ_H
3
4/*
5 * To get proper branch prediction for the main line, we must branch
6 * forward to code at the end of this object's .text section, then
7 * branch back to restart the operation.
8 */
9static inline void atomic_add(int i, atomic_t *v)
10{
11 unsigned long flags;
12
13 local_irq_save(flags);
14 *(long *)v += i;
15 local_irq_restore(flags);
16}
17
18static inline void atomic_sub(int i, atomic_t *v)
19{
20 unsigned long flags;
21
22 local_irq_save(flags);
23 *(long *)v -= i;
24 local_irq_restore(flags);
25}
26
27static inline int atomic_add_return(int i, atomic_t *v)
28{
29 unsigned long temp, flags;
30
31 local_irq_save(flags);
32 temp = *(long *)v;
33 temp += i;
34 *(long *)v = temp;
35 local_irq_restore(flags);
36
37 return temp;
38}
39
40static inline int atomic_sub_return(int i, atomic_t *v)
41{
42 unsigned long temp, flags;
43
44 local_irq_save(flags);
45 temp = *(long *)v;
46 temp -= i;
47 *(long *)v = temp;
48 local_irq_restore(flags);
49
50 return temp;
51}
52
53static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
54{
55 unsigned long flags;
56
57 local_irq_save(flags);
58 *(long *)v &= ~mask;
59 local_irq_restore(flags);
60}
61
62static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
63{
64 unsigned long flags;
65
66 local_irq_save(flags);
67 *(long *)v |= mask;
68 local_irq_restore(flags);
69}
70
71#endif /* __ASM_SH_ATOMIC_IRQ_H */
diff --git a/include/asm-sh/atomic-llsc.h b/include/asm-sh/atomic-llsc.h
new file mode 100644
index 000000000000..4b00b78e3f4f
--- /dev/null
+++ b/include/asm-sh/atomic-llsc.h
@@ -0,0 +1,107 @@
1#ifndef __ASM_SH_ATOMIC_LLSC_H
2#define __ASM_SH_ATOMIC_LLSC_H
3
4/*
5 * To get proper branch prediction for the main line, we must branch
6 * forward to code at the end of this object's .text section, then
7 * branch back to restart the operation.
8 */
9static inline void atomic_add(int i, atomic_t *v)
10{
11 unsigned long tmp;
12
13 __asm__ __volatile__ (
14"1: movli.l @%2, %0 ! atomic_add \n"
15" add %1, %0 \n"
16" movco.l %0, @%2 \n"
17" bf 1b \n"
18 : "=&z" (tmp)
19 : "r" (i), "r" (&v->counter)
20 : "t");
21}
22
23static inline void atomic_sub(int i, atomic_t *v)
24{
25 unsigned long tmp;
26
27 __asm__ __volatile__ (
28"1: movli.l @%2, %0 ! atomic_sub \n"
29" sub %1, %0 \n"
30" movco.l %0, @%2 \n"
31" bf 1b \n"
32 : "=&z" (tmp)
33 : "r" (i), "r" (&v->counter)
34 : "t");
35}
36
37/*
38 * SH-4A note:
39 *
40 * We basically get atomic_xxx_return() for free compared with
41 * atomic_xxx(). movli.l/movco.l require r0 due to the instruction
42 * encoding, so the retval is automatically set without having to
43 * do any special work.
44 */
45static inline int atomic_add_return(int i, atomic_t *v)
46{
47 unsigned long temp;
48
49 __asm__ __volatile__ (
50"1: movli.l @%2, %0 ! atomic_add_return \n"
51" add %1, %0 \n"
52" movco.l %0, @%2 \n"
53" bf 1b \n"
54" synco \n"
55 : "=&z" (temp)
56 : "r" (i), "r" (&v->counter)
57 : "t");
58
59 return temp;
60}
61
62static inline int atomic_sub_return(int i, atomic_t *v)
63{
64 unsigned long temp;
65
66 __asm__ __volatile__ (
67"1: movli.l @%2, %0 ! atomic_sub_return \n"
68" sub %1, %0 \n"
69" movco.l %0, @%2 \n"
70" bf 1b \n"
71" synco \n"
72 : "=&z" (temp)
73 : "r" (i), "r" (&v->counter)
74 : "t");
75
76 return temp;
77}
78
79static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
80{
81 unsigned long tmp;
82
83 __asm__ __volatile__ (
84"1: movli.l @%2, %0 ! atomic_clear_mask \n"
85" and %1, %0 \n"
86" movco.l %0, @%2 \n"
87" bf 1b \n"
88 : "=&z" (tmp)
89 : "r" (~mask), "r" (&v->counter)
90 : "t");
91}
92
93static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
94{
95 unsigned long tmp;
96
97 __asm__ __volatile__ (
98"1: movli.l @%2, %0 ! atomic_set_mask \n"
99" or %1, %0 \n"
100" movco.l %0, @%2 \n"
101" bf 1b \n"
102 : "=&z" (tmp)
103 : "r" (mask), "r" (&v->counter)
104 : "t");
105}
106
107#endif /* __ASM_SH_ATOMIC_LLSC_H */
diff --git a/include/asm-sh/atomic.h b/include/asm-sh/atomic.h
index 28305c3cbddf..e12570b9339d 100644
--- a/include/asm-sh/atomic.h
+++ b/include/asm-sh/atomic.h
@@ -17,119 +17,14 @@ typedef struct { volatile int counter; } atomic_t;
17#include <linux/compiler.h> 17#include <linux/compiler.h>
18#include <asm/system.h> 18#include <asm/system.h>
19 19
20/*
21 * To get proper branch prediction for the main line, we must branch
22 * forward to code at the end of this object's .text section, then
23 * branch back to restart the operation.
24 */
25static inline void atomic_add(int i, atomic_t *v)
26{
27#ifdef CONFIG_CPU_SH4A 20#ifdef CONFIG_CPU_SH4A
28 unsigned long tmp; 21#include <asm/atomic-llsc.h>
29
30 __asm__ __volatile__ (
31"1: movli.l @%2, %0 ! atomic_add \n"
32" add %1, %0 \n"
33" movco.l %0, @%2 \n"
34" bf 1b \n"
35 : "=&z" (tmp)
36 : "r" (i), "r" (&v->counter)
37 : "t");
38#else 22#else
39 unsigned long flags; 23#include <asm/atomic-irq.h>
40
41 local_irq_save(flags);
42 *(long *)v += i;
43 local_irq_restore(flags);
44#endif
45}
46
47static inline void atomic_sub(int i, atomic_t *v)
48{
49#ifdef CONFIG_CPU_SH4A
50 unsigned long tmp;
51
52 __asm__ __volatile__ (
53"1: movli.l @%2, %0 ! atomic_sub \n"
54" sub %1, %0 \n"
55" movco.l %0, @%2 \n"
56" bf 1b \n"
57 : "=&z" (tmp)
58 : "r" (i), "r" (&v->counter)
59 : "t");
60#else
61 unsigned long flags;
62
63 local_irq_save(flags);
64 *(long *)v -= i;
65 local_irq_restore(flags);
66#endif 24#endif
67}
68
69/*
70 * SH-4A note:
71 *
72 * We basically get atomic_xxx_return() for free compared with
73 * atomic_xxx(). movli.l/movco.l require r0 due to the instruction
74 * encoding, so the retval is automatically set without having to
75 * do any special work.
76 */
77static inline int atomic_add_return(int i, atomic_t *v)
78{
79 unsigned long temp;
80
81#ifdef CONFIG_CPU_SH4A
82 __asm__ __volatile__ (
83"1: movli.l @%2, %0 ! atomic_add_return \n"
84" add %1, %0 \n"
85" movco.l %0, @%2 \n"
86" bf 1b \n"
87" synco \n"
88 : "=&z" (temp)
89 : "r" (i), "r" (&v->counter)
90 : "t");
91#else
92 unsigned long flags;
93
94 local_irq_save(flags);
95 temp = *(long *)v;
96 temp += i;
97 *(long *)v = temp;
98 local_irq_restore(flags);
99#endif
100
101 return temp;
102}
103 25
104#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) 26#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
105 27
106static inline int atomic_sub_return(int i, atomic_t *v)
107{
108 unsigned long temp;
109
110#ifdef CONFIG_CPU_SH4A
111 __asm__ __volatile__ (
112"1: movli.l @%2, %0 ! atomic_sub_return \n"
113" sub %1, %0 \n"
114" movco.l %0, @%2 \n"
115" bf 1b \n"
116" synco \n"
117 : "=&z" (temp)
118 : "r" (i), "r" (&v->counter)
119 : "t");
120#else
121 unsigned long flags;
122
123 local_irq_save(flags);
124 temp = *(long *)v;
125 temp -= i;
126 *(long *)v = temp;
127 local_irq_restore(flags);
128#endif
129
130 return temp;
131}
132
133#define atomic_dec_return(v) atomic_sub_return(1,(v)) 28#define atomic_dec_return(v) atomic_sub_return(1,(v))
134#define atomic_inc_return(v) atomic_add_return(1,(v)) 29#define atomic_inc_return(v) atomic_add_return(1,(v))
135 30
@@ -180,50 +75,6 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
180} 75}
181#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 76#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
182 77
183static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
184{
185#ifdef CONFIG_CPU_SH4A
186 unsigned long tmp;
187
188 __asm__ __volatile__ (
189"1: movli.l @%2, %0 ! atomic_clear_mask \n"
190" and %1, %0 \n"
191" movco.l %0, @%2 \n"
192" bf 1b \n"
193 : "=&z" (tmp)
194 : "r" (~mask), "r" (&v->counter)
195 : "t");
196#else
197 unsigned long flags;
198
199 local_irq_save(flags);
200 *(long *)v &= ~mask;
201 local_irq_restore(flags);
202#endif
203}
204
205static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
206{
207#ifdef CONFIG_CPU_SH4A
208 unsigned long tmp;
209
210 __asm__ __volatile__ (
211"1: movli.l @%2, %0 ! atomic_set_mask \n"
212" or %1, %0 \n"
213" movco.l %0, @%2 \n"
214" bf 1b \n"
215 : "=&z" (tmp)
216 : "r" (mask), "r" (&v->counter)
217 : "t");
218#else
219 unsigned long flags;
220
221 local_irq_save(flags);
222 *(long *)v |= mask;
223 local_irq_restore(flags);
224#endif
225}
226
227/* Atomic operations are already serializing on SH */ 78/* Atomic operations are already serializing on SH */
228#define smp_mb__before_atomic_dec() barrier() 79#define smp_mb__before_atomic_dec() barrier()
229#define smp_mb__after_atomic_dec() barrier() 80#define smp_mb__after_atomic_dec() barrier()
diff --git a/include/asm-sh/bug.h b/include/asm-sh/bug.h
index 1b4fc52a59e8..2f89dd06d0cd 100644
--- a/include/asm-sh/bug.h
+++ b/include/asm-sh/bug.h
@@ -1,19 +1,54 @@
1#ifndef __ASM_SH_BUG_H 1#ifndef __ASM_SH_BUG_H
2#define __ASM_SH_BUG_H 2#define __ASM_SH_BUG_H
3 3
4
5#ifdef CONFIG_BUG 4#ifdef CONFIG_BUG
6/* 5
7 * Tell the user there is some problem. 6struct bug_frame {
8 */ 7 unsigned short opcode;
9#define BUG() do { \ 8 unsigned short line;
10 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 9 const char *file;
11 *(volatile int *)0 = 0; \ 10 const char *func;
11};
12
13struct pt_regs;
14
15extern void handle_BUG(struct pt_regs *);
16
17#define TRAPA_BUG_OPCODE 0xc33e /* trapa #0x3e */
18
19#ifdef CONFIG_DEBUG_BUGVERBOSE
20
21#define BUG() \
22do { \
23 __asm__ __volatile__ ( \
24 ".align 2\n\t" \
25 ".short %O0\n\t" \
26 ".short %O1\n\t" \
27 ".long %O2\n\t" \
28 ".long %O3\n\t" \
29 : \
30 : "n" (TRAPA_BUG_OPCODE), \
31 "i" (__LINE__), "X" (__FILE__), \
32 "X" (__FUNCTION__)); \
33} while (0)
34
35#else
36
37#define BUG() \
38do { \
39 __asm__ __volatile__ ( \
40 ".align 2\n\t" \
41 ".short %O0\n\t" \
42 : \
43 : "n" (TRAPA_BUG_OPCODE)); \
12} while (0) 44} while (0)
13 45
46#endif /* CONFIG_DEBUG_BUGVERBOSE */
47
14#define HAVE_ARCH_BUG 48#define HAVE_ARCH_BUG
15#endif 49
50#endif /* CONFIG_BUG */
16 51
17#include <asm-generic/bug.h> 52#include <asm-generic/bug.h>
18 53
19#endif 54#endif /* __ASM_SH_BUG_H */
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h
index 795047da5e17..a294997a8412 100644
--- a/include/asm-sh/bugs.h
+++ b/include/asm-sh/bugs.h
@@ -16,9 +16,8 @@
16 16
17static void __init check_bugs(void) 17static void __init check_bugs(void)
18{ 18{
19 extern char *get_cpu_subtype(void);
20 extern unsigned long loops_per_jiffy; 19 extern unsigned long loops_per_jiffy;
21 char *p= &init_utsname()->machine[2]; /* "sh" */ 20 char *p = &init_utsname()->machine[2]; /* "sh" */
22 21
23 cpu_data->loops_per_jiffy = loops_per_jiffy; 22 cpu_data->loops_per_jiffy = loops_per_jiffy;
24 23
@@ -40,6 +39,15 @@ static void __init check_bugs(void)
40 *p++ = '4'; 39 *p++ = '4';
41 *p++ = 'a'; 40 *p++ = 'a';
42 break; 41 break;
42 case CPU_SH73180 ... CPU_SH7722:
43 *p++ = '4';
44 *p++ = 'a';
45 *p++ = 'l';
46 *p++ = '-';
47 *p++ = 'd';
48 *p++ = 's';
49 *p++ = 'p';
50 break;
43 default: 51 default:
44 *p++ = '?'; 52 *p++ = '?';
45 *p++ = '!'; 53 *p++ = '!';
diff --git a/include/asm-sh/checksum.h b/include/asm-sh/checksum.h
index d44344c88e73..4bc8357e8892 100644
--- a/include/asm-sh/checksum.h
+++ b/include/asm-sh/checksum.h
@@ -34,25 +34,26 @@ asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum);
34 */ 34 */
35 35
36asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst, 36asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst,
37 int len, __wsum sum, int *src_err_ptr, int *dst_err_ptr); 37 int len, __wsum sum,
38 int *src_err_ptr, int *dst_err_ptr);
38 39
39/* 40/*
40 * Note: when you get a NULL pointer exception here this means someone 41 * Note: when you get a NULL pointer exception here this means someone
41 * passed in an incorrect kernel address to one of these functions. 42 * passed in an incorrect kernel address to one of these functions.
42 * 43 *
43 * If you use these functions directly please don't forget the 44 * If you use these functions directly please don't forget the
44 * access_ok(). 45 * access_ok().
45 */ 46 */
46static __inline__ 47static inline
47__wsum csum_partial_copy_nocheck(const void *src, void *dst, 48__wsum csum_partial_copy_nocheck(const void *src, void *dst,
48 int len, __wsum sum) 49 int len, __wsum sum)
49{ 50{
50 return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL); 51 return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL);
51} 52}
52 53
53static __inline__ 54static inline
54__wsum csum_partial_copy_from_user(const void __user *src, void *dst, 55__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
55 int len, __wsum sum, int *err_ptr) 56 int len, __wsum sum, int *err_ptr)
56{ 57{
57 return csum_partial_copy_generic((__force const void *)src, dst, 58 return csum_partial_copy_generic((__force const void *)src, dst,
58 len, sum, err_ptr, NULL); 59 len, sum, err_ptr, NULL);
@@ -62,7 +63,7 @@ __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
62 * Fold a partial checksum 63 * Fold a partial checksum
63 */ 64 */
64 65
65static __inline__ __sum16 csum_fold(__wsum sum) 66static inline __sum16 csum_fold(__wsum sum)
66{ 67{
67 unsigned int __dummy; 68 unsigned int __dummy;
68 __asm__("swap.w %0, %1\n\t" 69 __asm__("swap.w %0, %1\n\t"
@@ -85,7 +86,7 @@ static __inline__ __sum16 csum_fold(__wsum sum)
85 * i386 version by Jorge Cwik <jorge@laser.satlink.net>, adapted 86 * i386 version by Jorge Cwik <jorge@laser.satlink.net>, adapted
86 * for linux by * Arnt Gulbrandsen. 87 * for linux by * Arnt Gulbrandsen.
87 */ 88 */
88static __inline__ __sum16 ip_fast_csum(const void *iph, unsigned int ihl) 89static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
89{ 90{
90 unsigned int sum, __dummy0, __dummy1; 91 unsigned int sum, __dummy0, __dummy1;
91 92
@@ -113,10 +114,10 @@ static __inline__ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
113 return csum_fold(sum); 114 return csum_fold(sum);
114} 115}
115 116
116static __inline__ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, 117static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
117 unsigned short len, 118 unsigned short len,
118 unsigned short proto, 119 unsigned short proto,
119 __wsum sum) 120 __wsum sum)
120{ 121{
121#ifdef __LITTLE_ENDIAN__ 122#ifdef __LITTLE_ENDIAN__
122 unsigned long len_proto = (proto + len) << 8; 123 unsigned long len_proto = (proto + len) << 8;
@@ -132,6 +133,7 @@ static __inline__ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
132 : "=r" (sum), "=r" (len_proto) 133 : "=r" (sum), "=r" (len_proto)
133 : "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum) 134 : "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum)
134 : "t"); 135 : "t");
136
135 return sum; 137 return sum;
136} 138}
137 139
@@ -139,30 +141,28 @@ static __inline__ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
139 * computes the checksum of the TCP/UDP pseudo-header 141 * computes the checksum of the TCP/UDP pseudo-header
140 * returns a 16-bit checksum, already complemented 142 * returns a 16-bit checksum, already complemented
141 */ 143 */
142static __inline__ __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, 144static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
143 unsigned short len, 145 unsigned short len,
144 unsigned short proto, 146 unsigned short proto,
145 __wsum sum) 147 __wsum sum)
146{ 148{
147 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); 149 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
148} 150}
149 151
150/* 152/*
151 * this routine is used for miscellaneous IP-like checksums, mainly 153 * this routine is used for miscellaneous IP-like checksums, mainly
152 * in icmp.c 154 * in icmp.c
153 */ 155 */
154 156static inline __sum16 ip_compute_csum(const void *buff, int len)
155static __inline__ __sum16 ip_compute_csum(const void *buff, int len)
156{ 157{
157 return csum_fold (csum_partial(buff, len, 0)); 158 return csum_fold(csum_partial(buff, len, 0));
158} 159}
159 160
160#define _HAVE_ARCH_IPV6_CSUM 161#define _HAVE_ARCH_IPV6_CSUM
161#ifdef CONFIG_IPV6 162static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
162static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, 163 const struct in6_addr *daddr,
163 const struct in6_addr *daddr, 164 __u32 len, unsigned short proto,
164 __u32 len, unsigned short proto, 165 __wsum sum)
165 __wsum sum)
166{ 166{
167 unsigned int __dummy; 167 unsigned int __dummy;
168 __asm__("clrt\n\t" 168 __asm__("clrt\n\t"
@@ -187,22 +187,21 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
187 "movt %1\n\t" 187 "movt %1\n\t"
188 "add %1, %0\n" 188 "add %1, %0\n"
189 : "=r" (sum), "=&r" (__dummy) 189 : "=r" (sum), "=&r" (__dummy)
190 : "r" (saddr), "r" (daddr), 190 : "r" (saddr), "r" (daddr),
191 "r" (htonl(len)), "r" (htonl(proto)), "0" (sum) 191 "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)
192 : "t"); 192 : "t");
193 193
194 return csum_fold(sum); 194 return csum_fold(sum);
195} 195}
196#endif
197 196
198/* 197/*
199 * Copy and checksum to user 198 * Copy and checksum to user
200 */ 199 */
201#define HAVE_CSUM_COPY_USER 200#define HAVE_CSUM_COPY_USER
202static __inline__ __wsum csum_and_copy_to_user (const void *src, 201static inline __wsum csum_and_copy_to_user(const void *src,
203 void __user *dst, 202 void __user *dst,
204 int len, __wsum sum, 203 int len, __wsum sum,
205 int *err_ptr) 204 int *err_ptr)
206{ 205{
207 if (access_ok(VERIFY_WRITE, dst, len)) 206 if (access_ok(VERIFY_WRITE, dst, len))
208 return csum_partial_copy_generic((__force const void *)src, 207 return csum_partial_copy_generic((__force const void *)src,
diff --git a/include/asm-sh/cpu-sh2/cacheflush.h b/include/asm-sh/cpu-sh2/cacheflush.h
index f556fa80ea97..2979efb26de3 100644
--- a/include/asm-sh/cpu-sh2/cacheflush.h
+++ b/include/asm-sh/cpu-sh2/cacheflush.h
@@ -15,6 +15,7 @@
15 * 15 *
16 * - flush_cache_all() flushes entire cache 16 * - flush_cache_all() flushes entire cache
17 * - flush_cache_mm(mm) flushes the specified mm context's cache lines 17 * - flush_cache_mm(mm) flushes the specified mm context's cache lines
18 * - flush_cache_dup mm(mm) handles cache flushing when forking
18 * - flush_cache_page(mm, vmaddr, pfn) flushes a single page 19 * - flush_cache_page(mm, vmaddr, pfn) flushes a single page
19 * - flush_cache_range(vma, start, end) flushes a range of pages 20 * - flush_cache_range(vma, start, end) flushes a range of pages
20 * 21 *
@@ -27,6 +28,7 @@
27 */ 28 */
28#define flush_cache_all() do { } while (0) 29#define flush_cache_all() do { } while (0)
29#define flush_cache_mm(mm) do { } while (0) 30#define flush_cache_mm(mm) do { } while (0)
31#define flush_cache_dup_mm(mm) do { } while (0)
30#define flush_cache_range(vma, start, end) do { } while (0) 32#define flush_cache_range(vma, start, end) do { } while (0)
31#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 33#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
32#define flush_dcache_page(page) do { } while (0) 34#define flush_dcache_page(page) do { } while (0)
diff --git a/include/asm-sh/cpu-sh3/cacheflush.h b/include/asm-sh/cpu-sh3/cacheflush.h
index 03fde97a7fd0..f70d8ef76a15 100644
--- a/include/asm-sh/cpu-sh3/cacheflush.h
+++ b/include/asm-sh/cpu-sh3/cacheflush.h
@@ -15,6 +15,7 @@
15 * 15 *
16 * - flush_cache_all() flushes entire cache 16 * - flush_cache_all() flushes entire cache
17 * - flush_cache_mm(mm) flushes the specified mm context's cache lines 17 * - flush_cache_mm(mm) flushes the specified mm context's cache lines
18 * - flush_cache_dup mm(mm) handles cache flushing when forking
18 * - flush_cache_page(mm, vmaddr, pfn) flushes a single page 19 * - flush_cache_page(mm, vmaddr, pfn) flushes a single page
19 * - flush_cache_range(vma, start, end) flushes a range of pages 20 * - flush_cache_range(vma, start, end) flushes a range of pages
20 * 21 *
@@ -39,6 +40,7 @@
39 40
40void flush_cache_all(void); 41void flush_cache_all(void);
41void flush_cache_mm(struct mm_struct *mm); 42void flush_cache_mm(struct mm_struct *mm);
43#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
42void flush_cache_range(struct vm_area_struct *vma, unsigned long start, 44void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
43 unsigned long end); 45 unsigned long end);
44void flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn); 46void flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn);
@@ -48,6 +50,7 @@ void flush_icache_page(struct vm_area_struct *vma, struct page *page);
48#else 50#else
49#define flush_cache_all() do { } while (0) 51#define flush_cache_all() do { } while (0)
50#define flush_cache_mm(mm) do { } while (0) 52#define flush_cache_mm(mm) do { } while (0)
53#define flush_cache_dup_mm(mm) do { } while (0)
51#define flush_cache_range(vma, start, end) do { } while (0) 54#define flush_cache_range(vma, start, end) do { } while (0)
52#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 55#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
53#define flush_dcache_page(page) do { } while (0) 56#define flush_dcache_page(page) do { } while (0)
diff --git a/include/asm-sh/cpu-sh4/cache.h b/include/asm-sh/cpu-sh4/cache.h
index 6e9c7e6ee8e4..f92b20a0983d 100644
--- a/include/asm-sh/cpu-sh4/cache.h
+++ b/include/asm-sh/cpu-sh4/cache.h
@@ -22,7 +22,7 @@
22#define CCR_CACHE_ICE 0x0100 /* Instruction Cache Enable */ 22#define CCR_CACHE_ICE 0x0100 /* Instruction Cache Enable */
23#define CCR_CACHE_ICI 0x0800 /* IC Invalidate */ 23#define CCR_CACHE_ICI 0x0800 /* IC Invalidate */
24#define CCR_CACHE_IIX 0x8000 /* IC Index Enable */ 24#define CCR_CACHE_IIX 0x8000 /* IC Index Enable */
25#ifndef CONFIG_CPU_SUBTYPE_SH7780 25#ifndef CONFIG_CPU_SH4A
26#define CCR_CACHE_EMODE 0x80000000 /* EMODE Enable */ 26#define CCR_CACHE_EMODE 0x80000000 /* EMODE Enable */
27#endif 27#endif
28 28
diff --git a/include/asm-sh/cpu-sh4/cacheflush.h b/include/asm-sh/cpu-sh4/cacheflush.h
index 515fd574267c..b01a10f31225 100644
--- a/include/asm-sh/cpu-sh4/cacheflush.h
+++ b/include/asm-sh/cpu-sh4/cacheflush.h
@@ -18,6 +18,7 @@
18 */ 18 */
19void flush_cache_all(void); 19void flush_cache_all(void);
20void flush_cache_mm(struct mm_struct *mm); 20void flush_cache_mm(struct mm_struct *mm);
21#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
21void flush_cache_range(struct vm_area_struct *vma, unsigned long start, 22void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
22 unsigned long end); 23 unsigned long end);
23void flush_cache_page(struct vm_area_struct *vma, unsigned long addr, 24void flush_cache_page(struct vm_area_struct *vma, unsigned long addr,
diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h
index ef2b9b1ae41f..602d061ca2dc 100644
--- a/include/asm-sh/cpu-sh4/freq.h
+++ b/include/asm-sh/cpu-sh4/freq.h
@@ -10,7 +10,7 @@
10#ifndef __ASM_CPU_SH4_FREQ_H 10#ifndef __ASM_CPU_SH4_FREQ_H
11#define __ASM_CPU_SH4_FREQ_H 11#define __ASM_CPU_SH4_FREQ_H
12 12
13#if defined(CONFIG_CPU_SUBTYPE_SH73180) 13#if defined(CONFIG_CPU_SUBTYPE_SH73180) || defined(CONFIG_CPU_SUBTYPE_SH7722)
14#define FRQCR 0xa4150000 14#define FRQCR 0xa4150000
15#elif defined(CONFIG_CPU_SUBTYPE_SH7780) 15#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
16#define FRQCR 0xffc80000 16#define FRQCR 0xffc80000
diff --git a/include/asm-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h
index 37ab0c131a4d..8d0867b98e05 100644
--- a/include/asm-sh/dma-mapping.h
+++ b/include/asm-sh/dma-mapping.h
@@ -67,7 +67,7 @@ static inline dma_addr_t dma_map_single(struct device *dev,
67 if (dev->bus == &pci_bus_type) 67 if (dev->bus == &pci_bus_type)
68 return virt_to_bus(ptr); 68 return virt_to_bus(ptr);
69#endif 69#endif
70 dma_cache_sync(ptr, size, dir); 70 dma_cache_sync(dev, ptr, size, dir);
71 71
72 return virt_to_bus(ptr); 72 return virt_to_bus(ptr);
73} 73}
@@ -81,7 +81,7 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
81 81
82 for (i = 0; i < nents; i++) { 82 for (i = 0; i < nents; i++) {
83#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) 83#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
84 dma_cache_sync(page_address(sg[i].page) + sg[i].offset, 84 dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
85 sg[i].length, dir); 85 sg[i].length, dir);
86#endif 86#endif
87 sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; 87 sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
@@ -112,7 +112,7 @@ static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle,
112 if (dev->bus == &pci_bus_type) 112 if (dev->bus == &pci_bus_type)
113 return; 113 return;
114#endif 114#endif
115 dma_cache_sync(bus_to_virt(dma_handle), size, dir); 115 dma_cache_sync(dev, bus_to_virt(dma_handle), size, dir);
116} 116}
117 117
118static inline void dma_sync_single_range(struct device *dev, 118static inline void dma_sync_single_range(struct device *dev,
@@ -124,7 +124,7 @@ static inline void dma_sync_single_range(struct device *dev,
124 if (dev->bus == &pci_bus_type) 124 if (dev->bus == &pci_bus_type)
125 return; 125 return;
126#endif 126#endif
127 dma_cache_sync(bus_to_virt(dma_handle) + offset, size, dir); 127 dma_cache_sync(dev, bus_to_virt(dma_handle) + offset, size, dir);
128} 128}
129 129
130static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, 130static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
@@ -134,7 +134,7 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
134 134
135 for (i = 0; i < nelems; i++) { 135 for (i = 0; i < nelems; i++) {
136#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) 136#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
137 dma_cache_sync(page_address(sg[i].page) + sg[i].offset, 137 dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
138 sg[i].length, dir); 138 sg[i].length, dir);
139#endif 139#endif
140 sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; 140 sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
index fd576088e47e..bff965ef4b95 100644
--- a/include/asm-sh/irq.h
+++ b/include/asm-sh/irq.h
@@ -37,7 +37,8 @@
37# define ONCHIP_NR_IRQS 144 37# define ONCHIP_NR_IRQS 144
38#elif defined(CONFIG_CPU_SUBTYPE_SH7300) || \ 38#elif defined(CONFIG_CPU_SUBTYPE_SH7300) || \
39 defined(CONFIG_CPU_SUBTYPE_SH73180) || \ 39 defined(CONFIG_CPU_SUBTYPE_SH73180) || \
40 defined(CONFIG_CPU_SUBTYPE_SH7343) 40 defined(CONFIG_CPU_SUBTYPE_SH7343) || \
41 defined(CONFIG_CPU_SUBTYPE_SH7722)
41# define ONCHIP_NR_IRQS 109 42# define ONCHIP_NR_IRQS 109
42#elif defined(CONFIG_CPU_SUBTYPE_SH7780) 43#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
43# define ONCHIP_NR_IRQS 111 44# define ONCHIP_NR_IRQS 111
@@ -79,6 +80,8 @@
79# define OFFCHIP_NR_IRQS 16 80# define OFFCHIP_NR_IRQS 16
80#elif defined(CONFIG_SH_7343_SOLUTION_ENGINE) 81#elif defined(CONFIG_SH_7343_SOLUTION_ENGINE)
81# define OFFCHIP_NR_IRQS 12 82# define OFFCHIP_NR_IRQS 12
83#elif defined(CONFIG_SH_7722_SOLUTION_ENGINE)
84# define OFFCHIP_NR_IRQS 14
82#elif defined(CONFIG_SH_UNKNOWN) 85#elif defined(CONFIG_SH_UNKNOWN)
83# define OFFCHIP_NR_IRQS 16 /* Must also be last */ 86# define OFFCHIP_NR_IRQS 16 /* Must also be last */
84#else 87#else
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index c84901dbd8e5..036ca2843866 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -508,16 +508,50 @@ struct vm_area_struct;
508extern void update_mmu_cache(struct vm_area_struct * vma, 508extern void update_mmu_cache(struct vm_area_struct * vma,
509 unsigned long address, pte_t pte); 509 unsigned long address, pte_t pte);
510 510
511/* Encode and de-code a swap entry */
512/* 511/*
512 * Encode and de-code a swap entry
513 *
514 * Constraints:
515 * _PAGE_FILE at bit 0
516 * _PAGE_PRESENT at bit 8
517 * _PAGE_PROTNONE at bit 9
518 *
519 * For the normal case, we encode the swap type into bits 0:7 and the
520 * swap offset into bits 10:30. For the 64-bit PTE case, we keep the
521 * preserved bits in the low 32-bits and use the upper 32 as the swap
522 * offset (along with a 5-bit type), following the same approach as x86
523 * PAE. This keeps the logic quite simple, and allows for a full 32
524 * PTE_FILE_MAX_BITS, as opposed to the 29-bits we're constrained with
525 * in the pte_low case.
526 *
527 * As is evident by the Alpha code, if we ever get a 64-bit unsigned
528 * long (swp_entry_t) to match up with the 64-bit PTEs, this all becomes
529 * much cleaner..
530 *
513 * NOTE: We should set ZEROs at the position of _PAGE_PRESENT 531 * NOTE: We should set ZEROs at the position of _PAGE_PRESENT
514 * and _PAGE_PROTNONE bits 532 * and _PAGE_PROTNONE bits
515 */ 533 */
516#define __swp_type(x) ((x).val & 0xff) 534#ifdef CONFIG_X2TLB
517#define __swp_offset(x) ((x).val >> 10) 535#define __swp_type(x) ((x).val & 0x1f)
518#define __swp_entry(type, offset) ((swp_entry_t) { (type) | ((offset) << 10) }) 536#define __swp_offset(x) ((x).val >> 5)
519#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 1 }) 537#define __swp_entry(type, offset) ((swp_entry_t){ (type) | (offset) << 5})
520#define __swp_entry_to_pte(x) ((pte_t) { (x).val << 1 }) 538#define __pte_to_swp_entry(pte) ((swp_entry_t){ (pte).pte_high })
539#define __swp_entry_to_pte(x) ((pte_t){ 0, (x).val })
540
541/*
542 * Encode and decode a nonlinear file mapping entry
543 */
544#define pte_to_pgoff(pte) ((pte).pte_high)
545#define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) })
546
547#define PTE_FILE_MAX_BITS 32
548#else
549#define __swp_type(x) ((x).val & 0xff)
550#define __swp_offset(x) ((x).val >> 10)
551#define __swp_entry(type, offset) ((swp_entry_t){(type) | (offset) <<10})
552
553#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 1 })
554#define __swp_entry_to_pte(x) ((pte_t) { (x).val << 1 })
521 555
522/* 556/*
523 * Encode and decode a nonlinear file mapping entry 557 * Encode and decode a nonlinear file mapping entry
@@ -525,6 +559,7 @@ extern void update_mmu_cache(struct vm_area_struct * vma,
525#define PTE_FILE_MAX_BITS 29 559#define PTE_FILE_MAX_BITS 29
526#define pte_to_pgoff(pte) (pte_val(pte) >> 1) 560#define pte_to_pgoff(pte) (pte_val(pte) >> 1)
527#define pgoff_to_pte(off) ((pte_t) { ((off) << 1) | _PAGE_FILE }) 561#define pgoff_to_pte(off) ((pte_t) { ((off) << 1) | _PAGE_FILE })
562#endif
528 563
529typedef pte_t *pte_addr_t; 564typedef pte_t *pte_addr_t;
530 565
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index 6f1dd7ca1b1d..e29f2abb92de 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -27,6 +27,8 @@
27#define CCN_CVR 0xff000040 27#define CCN_CVR 0xff000040
28#define CCN_PRR 0xff000044 28#define CCN_PRR 0xff000044
29 29
30const char *get_cpu_subtype(void);
31
30/* 32/*
31 * CPU type and hardware bug flags. Kept separately for each CPU. 33 * CPU type and hardware bug flags. Kept separately for each CPU.
32 * 34 *
@@ -52,8 +54,10 @@ enum cpu_type {
52 CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501, 54 CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501,
53 55
54 /* SH-4A types */ 56 /* SH-4A types */
55 CPU_SH73180, CPU_SH7343, CPU_SH7770, CPU_SH7780, CPU_SH7781, 57 CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785,
56 CPU_SH7785, 58
59 /* SH4AL-DSP types */
60 CPU_SH73180, CPU_SH7343, CPU_SH7722,
57 61
58 /* Unknown subtype */ 62 /* Unknown subtype */
59 CPU_SH_NONE 63 CPU_SH_NONE
diff --git a/include/asm-sh/push-switch.h b/include/asm-sh/push-switch.h
index dfc6bad567f0..4903f9e52dd8 100644
--- a/include/asm-sh/push-switch.h
+++ b/include/asm-sh/push-switch.h
@@ -4,6 +4,7 @@
4#include <linux/timer.h> 4#include <linux/timer.h>
5#include <linux/interrupt.h> 5#include <linux/interrupt.h>
6#include <linux/workqueue.h> 6#include <linux/workqueue.h>
7#include <linux/platform_device.h>
7 8
8struct push_switch { 9struct push_switch {
9 /* switch state */ 10 /* switch state */
@@ -12,6 +13,8 @@ struct push_switch {
12 struct timer_list debounce; 13 struct timer_list debounce;
13 /* workqueue */ 14 /* workqueue */
14 struct work_struct work; 15 struct work_struct work;
16 /* platform device, for workqueue handler */
17 struct platform_device *pdev;
15}; 18};
16 19
17struct push_switch_platform_info { 20struct push_switch_platform_info {
diff --git a/include/asm-sh/termbits.h b/include/asm-sh/termbits.h
index 4f9822a8e7b4..f1b7b46f4e9a 100644
--- a/include/asm-sh/termbits.h
+++ b/include/asm-sh/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20/* c_cc characters */ 31/* c_cc characters */
21#define VINTR 0 32#define VINTR 0
22#define VQUIT 1 33#define VQUIT 1
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h
index 0c01dc550819..879f741105db 100644
--- a/include/asm-sh/thread_info.h
+++ b/include/asm-sh/thread_info.h
@@ -106,6 +106,7 @@ static inline struct thread_info *current_thread_info(void)
106#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 106#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
107#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 107#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */
108#define TIF_MEMDIE 18 108#define TIF_MEMDIE 18
109#define TIF_FREEZE 19
109 110
110#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 111#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
111#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 112#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -114,6 +115,7 @@ static inline struct thread_info *current_thread_info(void)
114#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 115#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
115#define _TIF_USEDFPU (1<<TIF_USEDFPU) 116#define _TIF_USEDFPU (1<<TIF_USEDFPU)
116#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 117#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
118#define _TIF_FREEZE (1<<TIF_FREEZE)
117 119
118#define _TIF_WORK_MASK 0x000000FE /* work to do on interrupt/exception return */ 120#define _TIF_WORK_MASK 0x000000FE /* work to do on interrupt/exception return */
119#define _TIF_ALLWORK_MASK 0x000000FF /* work to do on any return to u-space */ 121#define _TIF_ALLWORK_MASK 0x000000FF /* work to do on any return to u-space */
diff --git a/include/asm-sh64/cacheflush.h b/include/asm-sh64/cacheflush.h
index 55f71aa0aa6b..1e53a47bdc97 100644
--- a/include/asm-sh64/cacheflush.h
+++ b/include/asm-sh64/cacheflush.h
@@ -21,6 +21,8 @@ extern void flush_icache_user_range(struct vm_area_struct *vma,
21 struct page *page, unsigned long addr, 21 struct page *page, unsigned long addr,
22 int len); 22 int len);
23 23
24#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
25
24#define flush_dcache_mmap_lock(mapping) do { } while (0) 26#define flush_dcache_mmap_lock(mapping) do { } while (0)
25#define flush_dcache_mmap_unlock(mapping) do { } while (0) 27#define flush_dcache_mmap_unlock(mapping) do { } while (0)
26 28
diff --git a/include/asm-sh64/pgalloc.h b/include/asm-sh64/pgalloc.h
index b29dd468817e..cb803e56cb64 100644
--- a/include/asm-sh64/pgalloc.h
+++ b/include/asm-sh64/pgalloc.h
@@ -41,7 +41,7 @@ static inline void pgd_init(unsigned long page)
41static inline pgd_t *get_pgd_slow(void) 41static inline pgd_t *get_pgd_slow(void)
42{ 42{
43 unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t)); 43 unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t));
44 pgd_t *ret = (pgd_t *)kmalloc(pgd_size, GFP_KERNEL); 44 pgd_t *ret = kmalloc(pgd_size, GFP_KERNEL);
45 return ret; 45 return ret;
46} 46}
47 47
diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h
index 04aa3318f76a..329e696e7751 100644
--- a/include/asm-sparc/bitops.h
+++ b/include/asm-sparc/bitops.h
@@ -14,6 +14,10 @@
14 14
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16 16
17extern unsigned long ___set_bit(unsigned long *addr, unsigned long mask);
18extern unsigned long ___clear_bit(unsigned long *addr, unsigned long mask);
19extern unsigned long ___change_bit(unsigned long *addr, unsigned long mask);
20
17/* 21/*
18 * Set bit 'nr' in 32-bit quantity at address 'addr' where bit '0' 22 * Set bit 'nr' in 32-bit quantity at address 'addr' where bit '0'
19 * is in the highest of the four bytes and bit '31' is the high bit 23 * is in the highest of the four bytes and bit '31' is the high bit
@@ -22,134 +26,62 @@
22 */ 26 */
23static inline int test_and_set_bit(unsigned long nr, volatile unsigned long *addr) 27static inline int test_and_set_bit(unsigned long nr, volatile unsigned long *addr)
24{ 28{
25 register unsigned long mask asm("g2"); 29 unsigned long *ADDR, mask;
26 register unsigned long *ADDR asm("g1");
27 register int tmp1 asm("g3");
28 register int tmp2 asm("g4");
29 register int tmp3 asm("g5");
30 register int tmp4 asm("g7");
31 30
32 ADDR = ((unsigned long *) addr) + (nr >> 5); 31 ADDR = ((unsigned long *) addr) + (nr >> 5);
33 mask = 1 << (nr & 31); 32 mask = 1 << (nr & 31);
34 33
35 __asm__ __volatile__( 34 return ___set_bit(ADDR, mask) != 0;
36 "mov %%o7, %%g4\n\t"
37 "call ___set_bit\n\t"
38 " add %%o7, 8, %%o7\n"
39 : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
40 : "0" (mask), "r" (ADDR)
41 : "memory", "cc");
42
43 return mask != 0;
44} 35}
45 36
46static inline void set_bit(unsigned long nr, volatile unsigned long *addr) 37static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
47{ 38{
48 register unsigned long mask asm("g2"); 39 unsigned long *ADDR, mask;
49 register unsigned long *ADDR asm("g1");
50 register int tmp1 asm("g3");
51 register int tmp2 asm("g4");
52 register int tmp3 asm("g5");
53 register int tmp4 asm("g7");
54 40
55 ADDR = ((unsigned long *) addr) + (nr >> 5); 41 ADDR = ((unsigned long *) addr) + (nr >> 5);
56 mask = 1 << (nr & 31); 42 mask = 1 << (nr & 31);
57 43
58 __asm__ __volatile__( 44 (void) ___set_bit(ADDR, mask);
59 "mov %%o7, %%g4\n\t"
60 "call ___set_bit\n\t"
61 " add %%o7, 8, %%o7\n"
62 : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
63 : "0" (mask), "r" (ADDR)
64 : "memory", "cc");
65} 45}
66 46
67static inline int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr) 47static inline int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
68{ 48{
69 register unsigned long mask asm("g2"); 49 unsigned long *ADDR, mask;
70 register unsigned long *ADDR asm("g1");
71 register int tmp1 asm("g3");
72 register int tmp2 asm("g4");
73 register int tmp3 asm("g5");
74 register int tmp4 asm("g7");
75 50
76 ADDR = ((unsigned long *) addr) + (nr >> 5); 51 ADDR = ((unsigned long *) addr) + (nr >> 5);
77 mask = 1 << (nr & 31); 52 mask = 1 << (nr & 31);
78 53
79 __asm__ __volatile__( 54 return ___clear_bit(ADDR, mask) != 0;
80 "mov %%o7, %%g4\n\t"
81 "call ___clear_bit\n\t"
82 " add %%o7, 8, %%o7\n"
83 : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
84 : "0" (mask), "r" (ADDR)
85 : "memory", "cc");
86
87 return mask != 0;
88} 55}
89 56
90static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) 57static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
91{ 58{
92 register unsigned long mask asm("g2"); 59 unsigned long *ADDR, mask;
93 register unsigned long *ADDR asm("g1");
94 register int tmp1 asm("g3");
95 register int tmp2 asm("g4");
96 register int tmp3 asm("g5");
97 register int tmp4 asm("g7");
98 60
99 ADDR = ((unsigned long *) addr) + (nr >> 5); 61 ADDR = ((unsigned long *) addr) + (nr >> 5);
100 mask = 1 << (nr & 31); 62 mask = 1 << (nr & 31);
101 63
102 __asm__ __volatile__( 64 (void) ___clear_bit(ADDR, mask);
103 "mov %%o7, %%g4\n\t"
104 "call ___clear_bit\n\t"
105 " add %%o7, 8, %%o7\n"
106 : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
107 : "0" (mask), "r" (ADDR)
108 : "memory", "cc");
109} 65}
110 66
111static inline int test_and_change_bit(unsigned long nr, volatile unsigned long *addr) 67static inline int test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
112{ 68{
113 register unsigned long mask asm("g2"); 69 unsigned long *ADDR, mask;
114 register unsigned long *ADDR asm("g1");
115 register int tmp1 asm("g3");
116 register int tmp2 asm("g4");
117 register int tmp3 asm("g5");
118 register int tmp4 asm("g7");
119 70
120 ADDR = ((unsigned long *) addr) + (nr >> 5); 71 ADDR = ((unsigned long *) addr) + (nr >> 5);
121 mask = 1 << (nr & 31); 72 mask = 1 << (nr & 31);
122 73
123 __asm__ __volatile__( 74 return ___change_bit(ADDR, mask) != 0;
124 "mov %%o7, %%g4\n\t"
125 "call ___change_bit\n\t"
126 " add %%o7, 8, %%o7\n"
127 : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
128 : "0" (mask), "r" (ADDR)
129 : "memory", "cc");
130
131 return mask != 0;
132} 75}
133 76
134static inline void change_bit(unsigned long nr, volatile unsigned long *addr) 77static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
135{ 78{
136 register unsigned long mask asm("g2"); 79 unsigned long *ADDR, mask;
137 register unsigned long *ADDR asm("g1");
138 register int tmp1 asm("g3");
139 register int tmp2 asm("g4");
140 register int tmp3 asm("g5");
141 register int tmp4 asm("g7");
142 80
143 ADDR = ((unsigned long *) addr) + (nr >> 5); 81 ADDR = ((unsigned long *) addr) + (nr >> 5);
144 mask = 1 << (nr & 31); 82 mask = 1 << (nr & 31);
145 83
146 __asm__ __volatile__( 84 (void) ___change_bit(ADDR, mask);
147 "mov %%o7, %%g4\n\t"
148 "call ___change_bit\n\t"
149 " add %%o7, 8, %%o7\n"
150 : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4)
151 : "0" (mask), "r" (ADDR)
152 : "memory", "cc");
153} 85}
154 86
155#include <asm-generic/bitops/non-atomic.h> 87#include <asm-generic/bitops/non-atomic.h>
diff --git a/include/asm-sparc/cacheflush.h b/include/asm-sparc/cacheflush.h
index fc632f811cd8..68ac10910271 100644
--- a/include/asm-sparc/cacheflush.h
+++ b/include/asm-sparc/cacheflush.h
@@ -48,6 +48,7 @@ BTFIXUPDEF_CALL(void, flush_cache_page, struct vm_area_struct *, unsigned long)
48 48
49#define flush_cache_all() BTFIXUP_CALL(flush_cache_all)() 49#define flush_cache_all() BTFIXUP_CALL(flush_cache_all)()
50#define flush_cache_mm(mm) BTFIXUP_CALL(flush_cache_mm)(mm) 50#define flush_cache_mm(mm) BTFIXUP_CALL(flush_cache_mm)(mm)
51#define flush_cache_dup_mm(mm) BTFIXUP_CALL(flush_cache_mm)(mm)
51#define flush_cache_range(vma,start,end) BTFIXUP_CALL(flush_cache_range)(vma,start,end) 52#define flush_cache_range(vma,start,end) BTFIXUP_CALL(flush_cache_range)(vma,start,end)
52#define flush_cache_page(vma,addr,pfn) BTFIXUP_CALL(flush_cache_page)(vma,addr) 53#define flush_cache_page(vma,addr,pfn) BTFIXUP_CALL(flush_cache_page)(vma,addr)
53#define flush_icache_range(start, end) do { } while (0) 54#define flush_icache_range(start, end) do { } while (0)
diff --git a/include/asm-sparc/checksum.h b/include/asm-sparc/checksum.h
index 267e631e9bbc..34518ea7bf1b 100644
--- a/include/asm-sparc/checksum.h
+++ b/include/asm-sparc/checksum.h
@@ -151,7 +151,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
151 "xnor\t%%g0, %0, %0" 151 "xnor\t%%g0, %0, %0"
152 : "=r" (sum), "=&r" (iph) 152 : "=r" (sum), "=&r" (iph)
153 : "r" (ihl), "1" (iph) 153 : "r" (ihl), "1" (iph)
154 : "g2", "g3", "g4", "cc"); 154 : "g2", "g3", "g4", "cc", "memory");
155 return sum; 155 return sum;
156} 156}
157 157
diff --git a/include/asm-sparc/of_device.h b/include/asm-sparc/of_device.h
index 80ea31f6e17f..7cb00c1b09c6 100644
--- a/include/asm-sparc/of_device.h
+++ b/include/asm-sparc/of_device.h
@@ -33,7 +33,7 @@ struct of_device
33#define to_of_device(d) container_of(d, struct of_device, dev) 33#define to_of_device(d) container_of(d, struct of_device, dev)
34 34
35extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 35extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
36extern void of_iounmap(void __iomem *base, unsigned long size); 36extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
37 37
38extern struct of_device *of_find_device_by_node(struct device_node *); 38extern struct of_device *of_find_device_by_node(struct device_node *);
39 39
diff --git a/include/asm-sparc/termbits.h b/include/asm-sparc/termbits.h
index 1794d71134b7..5eb00a105d7c 100644
--- a/include/asm-sparc/termbits.h
+++ b/include/asm-sparc/termbits.h
@@ -31,6 +31,18 @@ struct termios {
31#endif 31#endif
32}; 32};
33 33
34struct ktermios {
35 tcflag_t c_iflag; /* input mode flags */
36 tcflag_t c_oflag; /* output mode flags */
37 tcflag_t c_cflag; /* control mode flags */
38 tcflag_t c_lflag; /* local mode flags */
39 cc_t c_line; /* line discipline */
40 cc_t c_cc[NCCS]; /* control characters */
41 cc_t _x_cc[2]; /* We need them to hold vmin/vtime */
42 speed_t c_ispeed; /* input speed */
43 speed_t c_ospeed; /* output speed */
44};
45
34/* c_cc characters */ 46/* c_cc characters */
35#define VINTR 0 47#define VINTR 0
36#define VQUIT 1 48#define VQUIT 1
diff --git a/include/asm-sparc64/cacheflush.h b/include/asm-sparc64/cacheflush.h
index 745d1ab60371..122e4058dd9e 100644
--- a/include/asm-sparc64/cacheflush.h
+++ b/include/asm-sparc64/cacheflush.h
@@ -12,6 +12,7 @@
12/* These are the same regardless of whether this is an SMP kernel or not. */ 12/* These are the same regardless of whether this is an SMP kernel or not. */
13#define flush_cache_mm(__mm) \ 13#define flush_cache_mm(__mm) \
14 do { if ((__mm) == current->mm) flushw_user(); } while(0) 14 do { if ((__mm) == current->mm) flushw_user(); } while(0)
15#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
15#define flush_cache_range(vma, start, end) \ 16#define flush_cache_range(vma, start, end) \
16 flush_cache_mm((vma)->vm_mm) 17 flush_cache_mm((vma)->vm_mm)
17#define flush_cache_page(vma, page, pfn) \ 18#define flush_cache_page(vma, page, pfn) \
diff --git a/include/asm-sparc64/dma.h b/include/asm-sparc64/dma.h
index 27f65972b3bb..93e5a062df88 100644
--- a/include/asm-sparc64/dma.h
+++ b/include/asm-sparc64/dma.h
@@ -152,9 +152,9 @@ extern void dvma_init(struct sbus_bus *);
152#define DMA_MAXEND(addr) (0x01000000UL-(((unsigned long)(addr))&0x00ffffffUL)) 152#define DMA_MAXEND(addr) (0x01000000UL-(((unsigned long)(addr))&0x00ffffffUL))
153 153
154/* Yes, I hack a lot of elisp in my spare time... */ 154/* Yes, I hack a lot of elisp in my spare time... */
155#define DMA_ERROR_P(regs) (((sbus_readl((regs) + DMA_CSR) & DMA_HNDL_ERROR)) 155#define DMA_ERROR_P(regs) ((sbus_readl((regs) + DMA_CSR) & DMA_HNDL_ERROR))
156#define DMA_IRQ_P(regs) (((sbus_readl((regs) + DMA_CSR)) & (DMA_HNDL_INTR | DMA_HNDL_ERROR))) 156#define DMA_IRQ_P(regs) ((sbus_readl((regs) + DMA_CSR)) & (DMA_HNDL_INTR | DMA_HNDL_ERROR))
157#define DMA_WRITE_P(regs) (((sbus_readl((regs) + DMA_CSR) & DMA_ST_WRITE)) 157#define DMA_WRITE_P(regs) ((sbus_readl((regs) + DMA_CSR) & DMA_ST_WRITE))
158#define DMA_OFF(__regs) \ 158#define DMA_OFF(__regs) \
159do { u32 tmp = sbus_readl((__regs) + DMA_CSR); \ 159do { u32 tmp = sbus_readl((__regs) + DMA_CSR); \
160 tmp &= ~DMA_ENABLE; \ 160 tmp &= ~DMA_ENABLE; \
diff --git a/include/asm-sparc64/hw_irq.h b/include/asm-sparc64/hw_irq.h
index 599b3b073450..8e44a8360829 100644
--- a/include/asm-sparc64/hw_irq.h
+++ b/include/asm-sparc64/hw_irq.h
@@ -1,6 +1,4 @@
1#ifndef __ASM_SPARC64_HW_IRQ_H 1#ifndef __ASM_SPARC64_HW_IRQ_H
2#define __ASM_SPARC64_HW_IRQ_H 2#define __ASM_SPARC64_HW_IRQ_H
3 3
4extern void hw_resend_irq(struct hw_interrupt_type *handler, unsigned int virt_irq);
5
6#endif 4#endif
diff --git a/include/asm-sparc64/irqflags.h b/include/asm-sparc64/irqflags.h
new file mode 100644
index 000000000000..024fc54d0682
--- /dev/null
+++ b/include/asm-sparc64/irqflags.h
@@ -0,0 +1,89 @@
1/*
2 * include/asm-sparc64/irqflags.h
3 *
4 * IRQ flags handling
5 *
6 * This file gets included from lowlevel asm headers too, to provide
7 * wrapped versions of the local_irq_*() APIs, based on the
8 * raw_local_irq_*() functions from the lowlevel headers.
9 */
10#ifndef _ASM_IRQFLAGS_H
11#define _ASM_IRQFLAGS_H
12
13#ifndef __ASSEMBLY__
14
15static inline unsigned long __raw_local_save_flags(void)
16{
17 unsigned long flags;
18
19 __asm__ __volatile__(
20 "rdpr %%pil, %0"
21 : "=r" (flags)
22 );
23
24 return flags;
25}
26
27#define raw_local_save_flags(flags) \
28 do { (flags) = __raw_local_save_flags(); } while (0)
29
30static inline void raw_local_irq_restore(unsigned long flags)
31{
32 __asm__ __volatile__(
33 "wrpr %0, %%pil"
34 : /* no output */
35 : "r" (flags)
36 : "memory"
37 );
38}
39
40static inline void raw_local_irq_disable(void)
41{
42 __asm__ __volatile__(
43 "wrpr 15, %%pil"
44 : /* no outputs */
45 : /* no inputs */
46 : "memory"
47 );
48}
49
50static inline void raw_local_irq_enable(void)
51{
52 __asm__ __volatile__(
53 "wrpr 0, %%pil"
54 : /* no outputs */
55 : /* no inputs */
56 : "memory"
57 );
58}
59
60static inline int raw_irqs_disabled_flags(unsigned long flags)
61{
62 return (flags > 0);
63}
64
65static inline int raw_irqs_disabled(void)
66{
67 unsigned long flags = __raw_local_save_flags();
68
69 return raw_irqs_disabled_flags(flags);
70}
71
72/*
73 * For spinlocks, etc:
74 */
75static inline unsigned long __raw_local_irq_save(void)
76{
77 unsigned long flags = __raw_local_save_flags();
78
79 raw_local_irq_disable();
80
81 return flags;
82}
83
84#define raw_local_irq_save(flags) \
85 do { (flags) = __raw_local_irq_save(); } while (0)
86
87#endif /* (__ASSEMBLY__) */
88
89#endif /* !(_ASM_IRQFLAGS_H) */
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h
index c9f5c34d318c..becc38fa06c5 100644
--- a/include/asm-sparc64/kprobes.h
+++ b/include/asm-sparc64/kprobes.h
@@ -13,7 +13,11 @@ typedef u32 kprobe_opcode_t;
13#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 13#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
14#define arch_remove_kprobe(p) do {} while (0) 14#define arch_remove_kprobe(p) do {} while (0)
15#define ARCH_INACTIVE_KPROBE_COUNT 0 15#define ARCH_INACTIVE_KPROBE_COUNT 0
16#define flush_insn_slot(p) do { } while (0) 16
17#define flush_insn_slot(p) \
18do { flushi(&(p)->ainsn.insn[0]); \
19 flushi(&(p)->ainsn.insn[1]); \
20} while (0)
17 21
18/* Architecture specific copy of original instruction*/ 22/* Architecture specific copy of original instruction*/
19struct arch_specific_insn { 23struct arch_specific_insn {
@@ -23,7 +27,7 @@ struct arch_specific_insn {
23 27
24struct prev_kprobe { 28struct prev_kprobe {
25 struct kprobe *kp; 29 struct kprobe *kp;
26 unsigned int status; 30 unsigned long status;
27 unsigned long orig_tnpc; 31 unsigned long orig_tnpc;
28 unsigned long orig_tstate_pil; 32 unsigned long orig_tstate_pil;
29}; 33};
@@ -33,10 +37,7 @@ struct kprobe_ctlblk {
33 unsigned long kprobe_status; 37 unsigned long kprobe_status;
34 unsigned long kprobe_orig_tnpc; 38 unsigned long kprobe_orig_tnpc;
35 unsigned long kprobe_orig_tstate_pil; 39 unsigned long kprobe_orig_tstate_pil;
36 long *jprobe_saved_esp;
37 struct pt_regs jprobe_saved_regs; 40 struct pt_regs jprobe_saved_regs;
38 struct pt_regs *jprobe_saved_regs_location;
39 struct sparc_stackf jprobe_saved_stack;
40 struct prev_kprobe prev_kprobe; 41 struct prev_kprobe prev_kprobe;
41}; 42};
42 43
diff --git a/include/asm-sparc64/of_device.h b/include/asm-sparc64/of_device.h
index a62c7b997d66..60e9173c9acb 100644
--- a/include/asm-sparc64/of_device.h
+++ b/include/asm-sparc64/of_device.h
@@ -34,7 +34,7 @@ struct of_device
34#define to_of_device(d) container_of(d, struct of_device, dev) 34#define to_of_device(d) container_of(d, struct of_device, dev)
35 35
36extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 36extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
37extern void of_iounmap(void __iomem *base, unsigned long size); 37extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
38 38
39extern struct of_device *of_find_device_by_node(struct device_node *); 39extern struct of_device *of_find_device_by_node(struct device_node *);
40 40
diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h
index ced8cbde046d..0d3df76aa47f 100644
--- a/include/asm-sparc64/percpu.h
+++ b/include/asm-sparc64/percpu.h
@@ -5,6 +5,16 @@
5 5
6#ifdef CONFIG_SMP 6#ifdef CONFIG_SMP
7 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
8extern void setup_per_cpu_areas(void); 18extern void setup_per_cpu_areas(void);
9 19
10extern unsigned long __per_cpu_base; 20extern unsigned long __per_cpu_base;
diff --git a/include/asm-sparc64/rwsem.h b/include/asm-sparc64/rwsem.h
index cef5e8270421..1294b7ce5d06 100644
--- a/include/asm-sparc64/rwsem.h
+++ b/include/asm-sparc64/rwsem.h
@@ -23,20 +23,33 @@ struct rw_semaphore {
23 signed int count; 23 signed int count;
24 spinlock_t wait_lock; 24 spinlock_t wait_lock;
25 struct list_head wait_list; 25 struct list_head wait_list;
26#ifdef CONFIG_DEBUG_LOCK_ALLOC
27 struct lockdep_map dep_map;
28#endif
26}; 29};
27 30
31#ifdef CONFIG_DEBUG_LOCK_ALLOC
32# define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname }
33#else
34# define __RWSEM_DEP_MAP_INIT(lockname)
35#endif
36
28#define __RWSEM_INITIALIZER(name) \ 37#define __RWSEM_INITIALIZER(name) \
29{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) } 38{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \
39 __RWSEM_DEP_MAP_INIT(name) }
30 40
31#define DECLARE_RWSEM(name) \ 41#define DECLARE_RWSEM(name) \
32 struct rw_semaphore name = __RWSEM_INITIALIZER(name) 42 struct rw_semaphore name = __RWSEM_INITIALIZER(name)
33 43
34static __inline__ void init_rwsem(struct rw_semaphore *sem) 44extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
35{ 45 struct lock_class_key *key);
36 sem->count = RWSEM_UNLOCKED_VALUE; 46
37 spin_lock_init(&sem->wait_lock); 47#define init_rwsem(sem) \
38 INIT_LIST_HEAD(&sem->wait_list); 48do { \
39} 49 static struct lock_class_key __key; \
50 \
51 __init_rwsem((sem), #sem, &__key); \
52} while (0)
40 53
41extern void __down_read(struct rw_semaphore *sem); 54extern void __down_read(struct rw_semaphore *sem);
42extern int __down_read_trylock(struct rw_semaphore *sem); 55extern int __down_read_trylock(struct rw_semaphore *sem);
@@ -46,6 +59,11 @@ extern void __up_read(struct rw_semaphore *sem);
46extern void __up_write(struct rw_semaphore *sem); 59extern void __up_write(struct rw_semaphore *sem);
47extern void __downgrade_write(struct rw_semaphore *sem); 60extern void __downgrade_write(struct rw_semaphore *sem);
48 61
62static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
63{
64 __down_write(sem);
65}
66
49static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) 67static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
50{ 68{
51 return atomic_add_return(delta, (atomic_t *)(&sem->count)); 69 return atomic_add_return(delta, (atomic_t *)(&sem->count));
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index a8b7432c9a70..32281acb878b 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -7,6 +7,9 @@
7#include <asm/visasm.h> 7#include <asm/visasm.h>
8 8
9#ifndef __ASSEMBLY__ 9#ifndef __ASSEMBLY__
10
11#include <linux/irqflags.h>
12
10/* 13/*
11 * Sparc (general) CPU types 14 * Sparc (general) CPU types
12 */ 15 */
@@ -72,52 +75,6 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
72 75
73#endif 76#endif
74 77
75#define setipl(__new_ipl) \
76 __asm__ __volatile__("wrpr %0, %%pil" : : "r" (__new_ipl) : "memory")
77
78#define local_irq_disable() \
79 __asm__ __volatile__("wrpr 15, %%pil" : : : "memory")
80
81#define local_irq_enable() \
82 __asm__ __volatile__("wrpr 0, %%pil" : : : "memory")
83
84#define getipl() \
85({ unsigned long retval; __asm__ __volatile__("rdpr %%pil, %0" : "=r" (retval)); retval; })
86
87#define swap_pil(__new_pil) \
88({ unsigned long retval; \
89 __asm__ __volatile__("rdpr %%pil, %0\n\t" \
90 "wrpr %1, %%pil" \
91 : "=&r" (retval) \
92 : "r" (__new_pil) \
93 : "memory"); \
94 retval; \
95})
96
97#define read_pil_and_cli() \
98({ unsigned long retval; \
99 __asm__ __volatile__("rdpr %%pil, %0\n\t" \
100 "wrpr 15, %%pil" \
101 : "=r" (retval) \
102 : : "memory"); \
103 retval; \
104})
105
106#define local_save_flags(flags) ((flags) = getipl())
107#define local_irq_save(flags) ((flags) = read_pil_and_cli())
108#define local_irq_restore(flags) setipl((flags))
109
110/* On sparc64 IRQ flags are the PIL register. A value of zero
111 * means all interrupt levels are enabled, any other value means
112 * only IRQ levels greater than that value will be received.
113 * Consequently this means that the lowest IRQ level is one.
114 */
115#define irqs_disabled() \
116({ unsigned long flags; \
117 local_save_flags(flags);\
118 (flags > 0); \
119})
120
121#define nop() __asm__ __volatile__ ("nop") 78#define nop() __asm__ __volatile__ ("nop")
122 79
123#define read_barrier_depends() do { } while(0) 80#define read_barrier_depends() do { } while(0)
diff --git a/include/asm-sparc64/termbits.h b/include/asm-sparc64/termbits.h
index b07715273ed4..705cd44b4173 100644
--- a/include/asm-sparc64/termbits.h
+++ b/include/asm-sparc64/termbits.h
@@ -33,6 +33,18 @@ struct termios {
33#endif 33#endif
34}; 34};
35 35
36struct ktermios {
37 tcflag_t c_iflag; /* input mode flags */
38 tcflag_t c_oflag; /* output mode flags */
39 tcflag_t c_cflag; /* control mode flags */
40 tcflag_t c_lflag; /* local mode flags */
41 cc_t c_line; /* line discipline */
42 cc_t c_cc[NCCS]; /* control characters */
43 cc_t _x_cc[2]; /* We need them to hold vmin/vtime */
44 speed_t c_ispeed; /* input speed */
45 speed_t c_ospeed; /* output speed */
46};
47
36/* c_cc characters */ 48/* c_cc characters */
37#define VINTR 0 49#define VINTR 0
38#define VQUIT 1 50#define VQUIT 1
diff --git a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h
index f2352606a79f..c2a16e188499 100644
--- a/include/asm-sparc64/ttable.h
+++ b/include/asm-sparc64/ttable.h
@@ -137,10 +137,49 @@
137#endif 137#endif
138#define BREAKPOINT_TRAP TRAP(breakpoint_trap) 138#define BREAKPOINT_TRAP TRAP(breakpoint_trap)
139 139
140#ifdef CONFIG_TRACE_IRQFLAGS
141
142#define TRAP_IRQ(routine, level) \
143 rdpr %pil, %g2; \
144 wrpr %g0, 15, %pil; \
145 sethi %hi(1f-4), %g7; \
146 ba,pt %xcc, etrap_irq; \
147 or %g7, %lo(1f-4), %g7; \
148 nop; \
149 nop; \
150 nop; \
151 .subsection 2; \
1521: call trace_hardirqs_off; \
153 nop; \
154 mov level, %o0; \
155 call routine; \
156 add %sp, PTREGS_OFF, %o1; \
157 ba,a,pt %xcc, rtrap_irq; \
158 .previous;
159
160#define TICK_SMP_IRQ \
161 rdpr %pil, %g2; \
162 wrpr %g0, 15, %pil; \
163 sethi %hi(1f-4), %g7; \
164 ba,pt %xcc, etrap_irq; \
165 or %g7, %lo(1f-4), %g7; \
166 nop; \
167 nop; \
168 nop; \
169 .subsection 2; \
1701: call trace_hardirqs_off; \
171 nop; \
172 call smp_percpu_timer_interrupt; \
173 add %sp, PTREGS_OFF, %o0; \
174 ba,a,pt %xcc, rtrap_irq; \
175 .previous;
176
177#else
178
140#define TRAP_IRQ(routine, level) \ 179#define TRAP_IRQ(routine, level) \
141 rdpr %pil, %g2; \ 180 rdpr %pil, %g2; \
142 wrpr %g0, 15, %pil; \ 181 wrpr %g0, 15, %pil; \
143 b,pt %xcc, etrap_irq; \ 182 ba,pt %xcc, etrap_irq; \
144 rd %pc, %g7; \ 183 rd %pc, %g7; \
145 mov level, %o0; \ 184 mov level, %o0; \
146 call routine; \ 185 call routine; \
@@ -151,12 +190,14 @@
151 rdpr %pil, %g2; \ 190 rdpr %pil, %g2; \
152 wrpr %g0, 15, %pil; \ 191 wrpr %g0, 15, %pil; \
153 sethi %hi(109f), %g7; \ 192 sethi %hi(109f), %g7; \
154 b,pt %xcc, etrap_irq; \ 193 ba,pt %xcc, etrap_irq; \
155109: or %g7, %lo(109b), %g7; \ 194109: or %g7, %lo(109b), %g7; \
156 call smp_percpu_timer_interrupt; \ 195 call smp_percpu_timer_interrupt; \
157 add %sp, PTREGS_OFF, %o0; \ 196 add %sp, PTREGS_OFF, %o0; \
158 ba,a,pt %xcc, rtrap_irq; 197 ba,a,pt %xcc, rtrap_irq;
159 198
199#endif
200
160#define TRAP_IVEC TRAP_NOSAVE(do_ivec) 201#define TRAP_IVEC TRAP_NOSAVE(do_ivec)
161 202
162#define BTRAP(lvl) TRAP_ARG(bad_trap, lvl) 203#define BTRAP(lvl) TRAP_ARG(bad_trap, lvl)
diff --git a/include/asm-um/bug.h b/include/asm-um/bug.h
index 1e22fa26ff06..3357c5e2468e 100644
--- a/include/asm-um/bug.h
+++ b/include/asm-um/bug.h
@@ -1,4 +1,6 @@
1#ifndef __UM_BUG_H 1#ifndef __UM_BUG_H
2#define __UM_BUG_H 2#define __UM_BUG_H
3#include <asm-generic/bug.h> 3
4#include <asm/arch/bug.h>
5
4#endif 6#endif
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h
index 188f72621776..e57ff136ee51 100644
--- a/include/asm-um/pgtable.h
+++ b/include/asm-um/pgtable.h
@@ -408,6 +408,15 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
408 408
409#include <asm-generic/pgtable-nopud.h> 409#include <asm-generic/pgtable-nopud.h>
410 410
411#ifdef CONFIG_HIGHMEM
412/* Clear a kernel PTE and flush it from the TLB */
413#define kpte_clear_flush(ptep, vaddr) \
414do { \
415 pte_clear(&init_mm, vaddr, ptep); \
416 __flush_tlb_one(vaddr); \
417} while (0)
418#endif
419
411#endif 420#endif
412#endif 421#endif
413 422
diff --git a/include/asm-v850/cacheflush.h b/include/asm-v850/cacheflush.h
index e1a87f82f1a4..9ece05a202ef 100644
--- a/include/asm-v850/cacheflush.h
+++ b/include/asm-v850/cacheflush.h
@@ -24,6 +24,7 @@
24 systems with MMUs, so we don't need them. */ 24 systems with MMUs, so we don't need them. */
25#define flush_cache_all() ((void)0) 25#define flush_cache_all() ((void)0)
26#define flush_cache_mm(mm) ((void)0) 26#define flush_cache_mm(mm) ((void)0)
27#define flush_cache_dup_mm(mm) ((void)0)
27#define flush_cache_range(vma, start, end) ((void)0) 28#define flush_cache_range(vma, start, end) ((void)0)
28#define flush_cache_page(vma, vmaddr, pfn) ((void)0) 29#define flush_cache_page(vma, vmaddr, pfn) ((void)0)
29#define flush_dcache_page(page) ((void)0) 30#define flush_dcache_page(page) ((void)0)
diff --git a/include/asm-v850/termbits.h b/include/asm-v850/termbits.h
index 212d4e279263..f3b433032089 100644
--- a/include/asm-v850/termbits.h
+++ b/include/asm-v850/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20/* c_cc characters */ 31/* c_cc characters */
21#define VINTR 0 32#define VINTR 0
22#define VQUIT 1 33#define VQUIT 1
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index 9d1916e59c04..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 */
@@ -54,36 +54,14 @@
54#define ACPI_ENABLE_IRQS() local_irq_enable() 54#define ACPI_ENABLE_IRQS() local_irq_enable()
55#define ACPI_FLUSH_CPU_CACHE() wbinvd() 55#define ACPI_FLUSH_CPU_CACHE() wbinvd()
56 56
57int __acpi_acquire_global_lock(unsigned int *lock);
58int __acpi_release_global_lock(unsigned int *lock);
57 59
58static inline int 60#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
59__acpi_acquire_global_lock (unsigned int *lock) 61 ((Acq) = __acpi_acquire_global_lock(&facs->global_lock))
60{
61 unsigned int old, new, val;
62 do {
63 old = *lock;
64 new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
65 val = cmpxchg(lock, old, new);
66 } while (unlikely (val != old));
67 return (new < 3) ? -1 : 0;
68}
69
70static inline int
71__acpi_release_global_lock (unsigned int *lock)
72{
73 unsigned int old, new, val;
74 do {
75 old = *lock;
76 new = old & ~0x3;
77 val = cmpxchg(lock, old, new);
78 } while (unlikely (val != old));
79 return old & 0x1;
80}
81 62
82#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ 63#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
83 ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr)) 64 ((Acq) = __acpi_release_global_lock(&facs->global_lock))
84
85#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
86 ((Acq) = __acpi_release_global_lock((unsigned int *) GLptr))
87 65
88/* 66/*
89 * Math helper asm macros 67 * Math helper asm macros
@@ -109,10 +87,10 @@ extern int acpi_strict;
109extern int acpi_disabled; 87extern int acpi_disabled;
110extern int acpi_pci_disabled; 88extern int acpi_pci_disabled;
111extern int acpi_ht; 89extern int acpi_ht;
112static inline void disable_acpi(void) 90static inline void disable_acpi(void)
113{ 91{
114 acpi_disabled = 1; 92 acpi_disabled = 1;
115 acpi_ht = 0; 93 acpi_ht = 0;
116 acpi_pci_disabled = 1; 94 acpi_pci_disabled = 1;
117 acpi_noirq = 1; 95 acpi_noirq = 1;
118} 96}
@@ -122,9 +100,9 @@ static inline void disable_acpi(void)
122 100
123extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq); 101extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
124static inline void acpi_noirq_set(void) { acpi_noirq = 1; } 102static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
125static inline void acpi_disable_pci(void) 103static inline void acpi_disable_pci(void)
126{ 104{
127 acpi_pci_disabled = 1; 105 acpi_pci_disabled = 1;
128 acpi_noirq_set(); 106 acpi_noirq_set();
129} 107}
130extern int acpi_irq_balance_set(char *str); 108extern int acpi_irq_balance_set(char *str);
@@ -158,8 +136,6 @@ extern void acpi_reserve_bootmem(void);
158extern int acpi_disabled; 136extern int acpi_disabled;
159extern int acpi_pci_disabled; 137extern int acpi_pci_disabled;
160 138
161extern u8 x86_acpiid_to_apicid[];
162
163#define ARCH_HAS_POWER_INIT 1 139#define ARCH_HAS_POWER_INIT 1
164 140
165extern int acpi_skip_timer_override; 141extern int acpi_skip_timer_override;
diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h
index 5b535eaf5309..8da9609070f4 100644
--- a/include/asm-x86_64/bitops.h
+++ b/include/asm-x86_64/bitops.h
@@ -7,7 +7,13 @@
7 7
8#include <asm/alternative.h> 8#include <asm/alternative.h>
9 9
10#define ADDR (*(volatile long *) addr) 10#if __GNUC__ < 4 || __GNUC_MINOR__ < 1
11/* Technically wrong, but this avoids compilation errors on some gcc
12 versions. */
13#define ADDR "=m" (*(volatile long *) addr)
14#else
15#define ADDR "+m" (*(volatile long *) addr)
16#endif
11 17
12/** 18/**
13 * set_bit - Atomically set a bit in memory 19 * set_bit - Atomically set a bit in memory
@@ -23,7 +29,7 @@ static __inline__ void set_bit(int nr, volatile void * addr)
23{ 29{
24 __asm__ __volatile__( LOCK_PREFIX 30 __asm__ __volatile__( LOCK_PREFIX
25 "btsl %1,%0" 31 "btsl %1,%0"
26 :"+m" (ADDR) 32 :ADDR
27 :"dIr" (nr) : "memory"); 33 :"dIr" (nr) : "memory");
28} 34}
29 35
@@ -40,7 +46,7 @@ static __inline__ void __set_bit(int nr, volatile void * addr)
40{ 46{
41 __asm__ volatile( 47 __asm__ volatile(
42 "btsl %1,%0" 48 "btsl %1,%0"
43 :"+m" (ADDR) 49 :ADDR
44 :"dIr" (nr) : "memory"); 50 :"dIr" (nr) : "memory");
45} 51}
46 52
@@ -58,7 +64,7 @@ static __inline__ void clear_bit(int nr, volatile void * addr)
58{ 64{
59 __asm__ __volatile__( LOCK_PREFIX 65 __asm__ __volatile__( LOCK_PREFIX
60 "btrl %1,%0" 66 "btrl %1,%0"
61 :"+m" (ADDR) 67 :ADDR
62 :"dIr" (nr)); 68 :"dIr" (nr));
63} 69}
64 70
@@ -66,7 +72,7 @@ static __inline__ void __clear_bit(int nr, volatile void * addr)
66{ 72{
67 __asm__ __volatile__( 73 __asm__ __volatile__(
68 "btrl %1,%0" 74 "btrl %1,%0"
69 :"+m" (ADDR) 75 :ADDR
70 :"dIr" (nr)); 76 :"dIr" (nr));
71} 77}
72 78
@@ -86,7 +92,7 @@ static __inline__ void __change_bit(int nr, volatile void * addr)
86{ 92{
87 __asm__ __volatile__( 93 __asm__ __volatile__(
88 "btcl %1,%0" 94 "btcl %1,%0"
89 :"+m" (ADDR) 95 :ADDR
90 :"dIr" (nr)); 96 :"dIr" (nr));
91} 97}
92 98
@@ -103,7 +109,7 @@ static __inline__ void change_bit(int nr, volatile void * addr)
103{ 109{
104 __asm__ __volatile__( LOCK_PREFIX 110 __asm__ __volatile__( LOCK_PREFIX
105 "btcl %1,%0" 111 "btcl %1,%0"
106 :"+m" (ADDR) 112 :ADDR
107 :"dIr" (nr)); 113 :"dIr" (nr));
108} 114}
109 115
@@ -121,7 +127,7 @@ static __inline__ int test_and_set_bit(int nr, volatile void * addr)
121 127
122 __asm__ __volatile__( LOCK_PREFIX 128 __asm__ __volatile__( LOCK_PREFIX
123 "btsl %2,%1\n\tsbbl %0,%0" 129 "btsl %2,%1\n\tsbbl %0,%0"
124 :"=r" (oldbit),"+m" (ADDR) 130 :"=r" (oldbit),ADDR
125 :"dIr" (nr) : "memory"); 131 :"dIr" (nr) : "memory");
126 return oldbit; 132 return oldbit;
127} 133}
@@ -141,7 +147,7 @@ static __inline__ int __test_and_set_bit(int nr, volatile void * addr)
141 147
142 __asm__( 148 __asm__(
143 "btsl %2,%1\n\tsbbl %0,%0" 149 "btsl %2,%1\n\tsbbl %0,%0"
144 :"=r" (oldbit),"+m" (ADDR) 150 :"=r" (oldbit),ADDR
145 :"dIr" (nr)); 151 :"dIr" (nr));
146 return oldbit; 152 return oldbit;
147} 153}
@@ -160,7 +166,7 @@ static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
160 166
161 __asm__ __volatile__( LOCK_PREFIX 167 __asm__ __volatile__( LOCK_PREFIX
162 "btrl %2,%1\n\tsbbl %0,%0" 168 "btrl %2,%1\n\tsbbl %0,%0"
163 :"=r" (oldbit),"+m" (ADDR) 169 :"=r" (oldbit),ADDR
164 :"dIr" (nr) : "memory"); 170 :"dIr" (nr) : "memory");
165 return oldbit; 171 return oldbit;
166} 172}
@@ -180,7 +186,7 @@ static __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
180 186
181 __asm__( 187 __asm__(
182 "btrl %2,%1\n\tsbbl %0,%0" 188 "btrl %2,%1\n\tsbbl %0,%0"
183 :"=r" (oldbit),"+m" (ADDR) 189 :"=r" (oldbit),ADDR
184 :"dIr" (nr)); 190 :"dIr" (nr));
185 return oldbit; 191 return oldbit;
186} 192}
@@ -192,7 +198,7 @@ static __inline__ int __test_and_change_bit(int nr, volatile void * addr)
192 198
193 __asm__ __volatile__( 199 __asm__ __volatile__(
194 "btcl %2,%1\n\tsbbl %0,%0" 200 "btcl %2,%1\n\tsbbl %0,%0"
195 :"=r" (oldbit),"+m" (ADDR) 201 :"=r" (oldbit),ADDR
196 :"dIr" (nr) : "memory"); 202 :"dIr" (nr) : "memory");
197 return oldbit; 203 return oldbit;
198} 204}
@@ -211,7 +217,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
211 217
212 __asm__ __volatile__( LOCK_PREFIX 218 __asm__ __volatile__( LOCK_PREFIX
213 "btcl %2,%1\n\tsbbl %0,%0" 219 "btcl %2,%1\n\tsbbl %0,%0"
214 :"=r" (oldbit),"+m" (ADDR) 220 :"=r" (oldbit),ADDR
215 :"dIr" (nr) : "memory"); 221 :"dIr" (nr) : "memory");
216 return oldbit; 222 return oldbit;
217} 223}
@@ -237,7 +243,7 @@ static __inline__ int variable_test_bit(int nr, volatile const void * addr)
237 __asm__ __volatile__( 243 __asm__ __volatile__(
238 "btl %2,%1\n\tsbbl %0,%0" 244 "btl %2,%1\n\tsbbl %0,%0"
239 :"=r" (oldbit) 245 :"=r" (oldbit)
240 :"m" (ADDR),"dIr" (nr)); 246 :"m" (*(volatile long *)addr),"dIr" (nr));
241 return oldbit; 247 return oldbit;
242} 248}
243 249
diff --git a/include/asm-x86_64/bug.h b/include/asm-x86_64/bug.h
index 80ac1fe966ac..682606414913 100644
--- a/include/asm-x86_64/bug.h
+++ b/include/asm-x86_64/bug.h
@@ -1,30 +1,30 @@
1#ifndef __ASM_X8664_BUG_H 1#ifndef __ASM_X8664_BUG_H
2#define __ASM_X8664_BUG_H 1 2#define __ASM_X8664_BUG_H 1
3 3
4#include <linux/stringify.h>
5
6/*
7 * Tell the user there is some problem. The exception handler decodes
8 * this frame.
9 */
10struct bug_frame {
11 unsigned char ud2[2];
12 unsigned char push;
13 signed int filename;
14 unsigned char ret;
15 unsigned short line;
16} __attribute__((packed));
17
18#ifdef CONFIG_BUG 4#ifdef CONFIG_BUG
19#define HAVE_ARCH_BUG 5#define HAVE_ARCH_BUG
20/* We turn the bug frame into valid instructions to not confuse 6
21 the disassembler. Thanks to Jan Beulich & Suresh Siddha 7#ifdef CONFIG_DEBUG_BUGVERBOSE
22 for nice instruction selection. 8#define BUG() \
23 The magic numbers generate mov $64bitimm,%eax ; ret $offset. */ 9 do { \
24#define BUG() \ 10 asm volatile("1:\tud2\n" \
25 asm volatile( \ 11 ".pushsection __bug_table,\"a\"\n" \
26 "ud2 ; pushq $%c1 ; ret $%c0" :: \ 12 "2:\t.quad 1b, %c0\n" \
27 "i"(__LINE__), "i" (__FILE__)) 13 "\t.word %c1, 0\n" \
14 "\t.org 2b+%c2\n" \
15 ".popsection" \
16 : : "i" (__FILE__), "i" (__LINE__), \
17 "i" (sizeof(struct bug_entry))); \
18 for(;;) ; \
19 } while(0)
20#else
21#define BUG() \
22 do { \
23 asm volatile("ud2"); \
24 for(;;) ; \
25 } while(0)
26#endif
27
28void out_of_line_bug(void); 28void out_of_line_bug(void);
29#else 29#else
30static inline void out_of_line_bug(void) { } 30static inline void out_of_line_bug(void) { }
diff --git a/include/asm-x86_64/cacheflush.h b/include/asm-x86_64/cacheflush.h
index d32f7f58752a..ab1cb5c7dc92 100644
--- a/include/asm-x86_64/cacheflush.h
+++ b/include/asm-x86_64/cacheflush.h
@@ -7,6 +7,7 @@
7/* Caches aren't brain-dead on the intel. */ 7/* Caches aren't brain-dead on the intel. */
8#define flush_cache_all() do { } while (0) 8#define flush_cache_all() do { } while (0)
9#define flush_cache_mm(mm) do { } while (0) 9#define flush_cache_mm(mm) do { } while (0)
10#define flush_cache_dup_mm(mm) do { } while (0)
10#define flush_cache_range(vma, start, end) do { } while (0) 11#define flush_cache_range(vma, start, end) do { } while (0)
11#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 12#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
12#define flush_dcache_page(page) do { } while (0) 13#define flush_dcache_page(page) do { } while (0)
diff --git a/include/asm-x86_64/dma-mapping.h b/include/asm-x86_64/dma-mapping.h
index be9ec6890723..49dbab09ef2b 100644
--- a/include/asm-x86_64/dma-mapping.h
+++ b/include/asm-x86_64/dma-mapping.h
@@ -63,6 +63,9 @@ static inline int dma_mapping_error(dma_addr_t dma_addr)
63 return (dma_addr == bad_dma_address); 63 return (dma_addr == bad_dma_address);
64} 64}
65 65
66#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
67#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
68
66extern void *dma_alloc_coherent(struct device *dev, size_t size, 69extern void *dma_alloc_coherent(struct device *dev, size_t size,
67 dma_addr_t *dma_handle, gfp_t gfp); 70 dma_addr_t *dma_handle, gfp_t gfp);
68extern void dma_free_coherent(struct device *dev, size_t size, void *vaddr, 71extern void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
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/ioctls.h b/include/asm-x86_64/ioctls.h
index 62caf8b6e4e1..3fc0b15a0d7e 100644
--- a/include/asm-x86_64/ioctls.h
+++ b/include/asm-x86_64/ioctls.h
@@ -46,6 +46,10 @@
46#define TIOCSBRK 0x5427 /* BSD compatibility */ 46#define TIOCSBRK 0x5427 /* BSD compatibility */
47#define TIOCCBRK 0x5428 /* BSD compatibility */ 47#define TIOCCBRK 0x5428 /* BSD compatibility */
48#define TIOCGSID 0x5429 /* Return the session ID of FD */ 48#define TIOCGSID 0x5429 /* Return the session ID of FD */
49#define TCGETS2 _IOR('T',0x2A, struct termios2)
50#define TCSETS2 _IOW('T',0x2B, struct termios2)
51#define TCSETSW2 _IOW('T',0x2C, struct termios2)
52#define TCSETSF2 _IOW('T',0x2D, struct termios2)
49#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 53#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
50#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 54#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
51 55
diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h
index 952783d35c7b..3227bc93d69b 100644
--- a/include/asm-x86_64/msr.h
+++ b/include/asm-x86_64/msr.h
@@ -189,6 +189,7 @@ static inline unsigned int cpuid_edx(unsigned int op)
189 189
190#define MSR_IA32_PERFCTR0 0xc1 190#define MSR_IA32_PERFCTR0 0xc1
191#define MSR_IA32_PERFCTR1 0xc2 191#define MSR_IA32_PERFCTR1 0xc2
192#define MSR_FSB_FREQ 0xcd
192 193
193#define MSR_MTRRcap 0x0fe 194#define MSR_MTRRcap 0x0fe
194#define MSR_IA32_BBL_CR_CTL 0x119 195#define MSR_IA32_BBL_CR_CTL 0x119
@@ -311,6 +312,9 @@ static inline unsigned int cpuid_edx(unsigned int op)
311#define MSR_IA32_PERF_STATUS 0x198 312#define MSR_IA32_PERF_STATUS 0x198
312#define MSR_IA32_PERF_CTL 0x199 313#define MSR_IA32_PERF_CTL 0x199
313 314
315#define MSR_IA32_MPERF 0xE7
316#define MSR_IA32_APERF 0xE8
317
314#define MSR_IA32_THERM_CONTROL 0x19a 318#define MSR_IA32_THERM_CONTROL 0x19a
315#define MSR_IA32_THERM_INTERRUPT 0x19b 319#define MSR_IA32_THERM_INTERRUPT 0x19b
316#define MSR_IA32_THERM_STATUS 0x19c 320#define MSR_IA32_THERM_STATUS 0x19c
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/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/termbits.h b/include/asm-x86_64/termbits.h
index bd950946e52c..6cfc3bb10c1a 100644
--- a/include/asm-x86_64/termbits.h
+++ b/include/asm-x86_64/termbits.h
@@ -17,6 +17,28 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct termios2 {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
31struct ktermios {
32 tcflag_t c_iflag; /* input mode flags */
33 tcflag_t c_oflag; /* output mode flags */
34 tcflag_t c_cflag; /* control mode flags */
35 tcflag_t c_lflag; /* local mode flags */
36 cc_t c_line; /* line discipline */
37 cc_t c_cc[NCCS]; /* control characters */
38 speed_t c_ispeed; /* input speed */
39 speed_t c_ospeed; /* output speed */
40};
41
20/* c_cc characters */ 42/* c_cc characters */
21#define VINTR 0 43#define VINTR 0
22#define VQUIT 1 44#define VQUIT 1
@@ -118,6 +140,7 @@ struct termios {
118#define HUPCL 0002000 140#define HUPCL 0002000
119#define CLOCAL 0004000 141#define CLOCAL 0004000
120#define CBAUDEX 0010000 142#define CBAUDEX 0010000
143#define BOTHER 0010000 /* non standard rate */
121#define B57600 0010001 144#define B57600 0010001
122#define B115200 0010002 145#define B115200 0010002
123#define B230400 0010003 146#define B230400 0010003
@@ -133,10 +156,12 @@ struct termios {
133#define B3000000 0010015 156#define B3000000 0010015
134#define B3500000 0010016 157#define B3500000 0010016
135#define B4000000 0010017 158#define B4000000 0010017
136#define CIBAUD 002003600000 /* input baud rate (not used) */ 159#define CIBAUD 002003600000 /* input baud rate */
137#define CMSPAR 010000000000 /* mark or space (stick) parity */ 160#define CMSPAR 010000000000 /* mark or space (stick) parity */
138#define CRTSCTS 020000000000 /* flow control */ 161#define CRTSCTS 020000000000 /* flow control */
139 162
163#define IBSHIFT 8 /* Shift from CBAUD to CIBAUD */
164
140/* c_lflag bits */ 165/* c_lflag bits */
141#define ISIG 0000001 166#define ISIG 0000001
142#define ICANON 0000002 167#define ICANON 0000002
diff --git a/include/asm-x86_64/termios.h b/include/asm-x86_64/termios.h
index 041a91f7ddfb..443b225537f0 100644
--- a/include/asm-x86_64/termios.h
+++ b/include/asm-x86_64/termios.h
@@ -98,8 +98,10 @@ struct termio {
98 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 98 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
99}) 99})
100 100
101#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) 101#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
102#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) 102#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
103#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
104#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
103 105
104#endif /* __KERNEL__ */ 106#endif /* __KERNEL__ */
105 107
diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h
index 787a08114b48..74a6c74397f7 100644
--- a/include/asm-x86_64/thread_info.h
+++ b/include/asm-x86_64/thread_info.h
@@ -122,6 +122,7 @@ static inline struct thread_info *stack_thread_info(void)
122#define TIF_MEMDIE 20 122#define TIF_MEMDIE 20
123#define TIF_DEBUG 21 /* uses debug registers */ 123#define TIF_DEBUG 21 /* uses debug registers */
124#define TIF_IO_BITMAP 22 /* uses I/O bitmap */ 124#define TIF_IO_BITMAP 22 /* uses I/O bitmap */
125#define TIF_FREEZE 23 /* is freezing for suspend */
125 126
126#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 127#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
127#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 128#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -137,6 +138,7 @@ static inline struct thread_info *stack_thread_info(void)
137#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) 138#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
138#define _TIF_DEBUG (1<<TIF_DEBUG) 139#define _TIF_DEBUG (1<<TIF_DEBUG)
139#define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP) 140#define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP)
141#define _TIF_FREEZE (1<<TIF_FREEZE)
140 142
141/* work to do on interrupt/exception return */ 143/* work to do on interrupt/exception return */
142#define _TIF_WORK_MASK \ 144#define _TIF_WORK_MASK \
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index 5c8f49280dbc..2facec5914d2 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -47,6 +47,7 @@ extern int __node_distance(int, int);
47 .flags = SD_LOAD_BALANCE \ 47 .flags = SD_LOAD_BALANCE \
48 | SD_BALANCE_FORK \ 48 | SD_BALANCE_FORK \
49 | SD_BALANCE_EXEC \ 49 | SD_BALANCE_EXEC \
50 | SD_SERIALIZE \
50 | SD_WAKE_BALANCE, \ 51 | SD_WAKE_BALANCE, \
51 .last_balance = jiffies, \ 52 .last_balance = jiffies, \
52 .balance_interval = 1, \ 53 .balance_interval = 1, \
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index d5dbc87274f8..c0eac519840b 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -157,7 +157,7 @@ do { \
157 case 1: __put_user_asm(x,ptr,retval,"b","b","iq",-EFAULT); break;\ 157 case 1: __put_user_asm(x,ptr,retval,"b","b","iq",-EFAULT); break;\
158 case 2: __put_user_asm(x,ptr,retval,"w","w","ir",-EFAULT); break;\ 158 case 2: __put_user_asm(x,ptr,retval,"w","w","ir",-EFAULT); break;\
159 case 4: __put_user_asm(x,ptr,retval,"l","k","ir",-EFAULT); break;\ 159 case 4: __put_user_asm(x,ptr,retval,"l","k","ir",-EFAULT); break;\
160 case 8: __put_user_asm(x,ptr,retval,"q","","ir",-EFAULT); break;\ 160 case 8: __put_user_asm(x,ptr,retval,"q","","Zr",-EFAULT); break;\
161 default: __put_user_bad(); \ 161 default: __put_user_bad(); \
162 } \ 162 } \
163} while (0) 163} while (0)
diff --git a/include/asm-x86_64/unwind.h b/include/asm-x86_64/unwind.h
index 2f6349e48717..02710f6a4560 100644
--- a/include/asm-x86_64/unwind.h
+++ b/include/asm-x86_64/unwind.h
@@ -1,100 +1,6 @@
1#ifndef _ASM_X86_64_UNWIND_H 1#ifndef _ASM_X86_64_UNWIND_H
2#define _ASM_X86_64_UNWIND_H 2#define _ASM_X86_64_UNWIND_H
3 3
4/*
5 * Copyright (C) 2002-2006 Novell, Inc.
6 * Jan Beulich <jbeulich@novell.com>
7 * This code is released under version 2 of the GNU GPL.
8 */
9
10#ifdef CONFIG_STACK_UNWIND
11
12#include <linux/sched.h>
13#include <asm/ptrace.h>
14#include <asm/uaccess.h>
15#include <asm/vsyscall.h>
16
17struct unwind_frame_info
18{
19 struct pt_regs regs;
20 struct task_struct *task;
21 unsigned call_frame:1;
22};
23
24#define UNW_PC(frame) (frame)->regs.rip
25#define UNW_SP(frame) (frame)->regs.rsp
26#ifdef CONFIG_FRAME_POINTER
27#define UNW_FP(frame) (frame)->regs.rbp
28#define FRAME_RETADDR_OFFSET 8
29#define FRAME_LINK_OFFSET 0
30#define STACK_BOTTOM(tsk) (((tsk)->thread.rsp0 - 1) & ~(THREAD_SIZE - 1))
31#define STACK_TOP(tsk) ((tsk)->thread.rsp0)
32#endif
33/* Might need to account for the special exception and interrupt handling
34 stacks here, since normally
35 EXCEPTION_STACK_ORDER < THREAD_ORDER < IRQSTACK_ORDER,
36 but the construct is needed only for getting across the stack switch to
37 the interrupt stack - thus considering the IRQ stack itself is unnecessary,
38 and the overhead of comparing against all exception handling stacks seems
39 not desirable. */
40#define STACK_LIMIT(ptr) (((ptr) - 1) & ~(THREAD_SIZE - 1))
41
42#define UNW_REGISTER_INFO \
43 PTREGS_INFO(rax), \
44 PTREGS_INFO(rdx), \
45 PTREGS_INFO(rcx), \
46 PTREGS_INFO(rbx), \
47 PTREGS_INFO(rsi), \
48 PTREGS_INFO(rdi), \
49 PTREGS_INFO(rbp), \
50 PTREGS_INFO(rsp), \
51 PTREGS_INFO(r8), \
52 PTREGS_INFO(r9), \
53 PTREGS_INFO(r10), \
54 PTREGS_INFO(r11), \
55 PTREGS_INFO(r12), \
56 PTREGS_INFO(r13), \
57 PTREGS_INFO(r14), \
58 PTREGS_INFO(r15), \
59 PTREGS_INFO(rip)
60
61#define UNW_DEFAULT_RA(raItem, dataAlign) \
62 ((raItem).where == Memory && \
63 !((raItem).value * (dataAlign) + 8))
64
65static inline void arch_unw_init_frame_info(struct unwind_frame_info *info,
66 /*const*/ struct pt_regs *regs)
67{
68 info->regs = *regs;
69}
70
71static inline void arch_unw_init_blocked(struct unwind_frame_info *info)
72{
73 extern const char thread_return[];
74
75 memset(&info->regs, 0, sizeof(info->regs));
76 info->regs.rip = (unsigned long)thread_return;
77 info->regs.cs = __KERNEL_CS;
78 __get_user(info->regs.rbp, (unsigned long *)info->task->thread.rsp);
79 info->regs.rsp = info->task->thread.rsp;
80 info->regs.ss = __KERNEL_DS;
81}
82
83extern int arch_unwind_init_running(struct unwind_frame_info *,
84 int (*callback)(struct unwind_frame_info *,
85 void *arg),
86 void *arg);
87
88static inline int arch_unw_user_mode(const struct unwind_frame_info *info)
89{
90 return user_mode(&info->regs)
91 || (long)info->regs.rip >= 0
92 || (info->regs.rip >= VSYSCALL_START && info->regs.rip < VSYSCALL_END)
93 || (long)info->regs.rsp >= 0;
94}
95
96#else
97
98#define UNW_PC(frame) ((void)(frame), 0UL) 4#define UNW_PC(frame) ((void)(frame), 0UL)
99#define UNW_SP(frame) ((void)(frame), 0UL) 5#define UNW_SP(frame) ((void)(frame), 0UL)
100 6
@@ -103,6 +9,4 @@ static inline int arch_unw_user_mode(const void *info)
103 return 0; 9 return 0;
104} 10}
105 11
106#endif
107
108#endif /* _ASM_X86_64_UNWIND_H */ 12#endif /* _ASM_X86_64_UNWIND_H */
diff --git a/include/asm-xtensa/asmmacro.h b/include/asm-xtensa/asmmacro.h
new file mode 100644
index 000000000000..76915cabad17
--- /dev/null
+++ b/include/asm-xtensa/asmmacro.h
@@ -0,0 +1,153 @@
1/*
2 * include/asm-xtensa/asmmacro.h
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) 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_ASMMACRO_H
12#define _XTENSA_ASMMACRO_H
13
14#include <asm/variant/core.h>
15
16/*
17 * Some little helpers for loops. Use zero-overhead-loops
18 * where applicable and if supported by the processor.
19 *
20 * __loopi ar, at, size, inc
21 * ar register initialized with the start address
22 * at scratch register used by macro
23 * size size immediate value
24 * inc increment
25 *
26 * __loops ar, as, at, inc_log2[, mask_log2][, cond][, ncond]
27 * ar register initialized with the start address
28 * as register initialized with the size
29 * at scratch register use by macro
30 * inc_log2 increment [in log2]
31 * mask_log2 mask [in log2]
32 * cond true condition (used in loop'cond')
33 * ncond false condition (used in b'ncond')
34 *
35 * __loop as
36 * restart loop. 'as' register must not have been modified!
37 *
38 * __endla ar, at, incr
39 * ar start address (modified)
40 * as scratch register used by macro
41 * inc increment
42 */
43
44/*
45 * loop for given size as immediate
46 */
47
48 .macro __loopi ar, at, size, incr
49
50#if XCHAL_HAVE_LOOPS
51 movi \at, ((\size + \incr - 1) / (\incr))
52 loop \at, 99f
53#else
54 addi \at, \ar, \size
55 98:
56#endif
57
58 .endm
59
60/*
61 * loop for given size in register
62 */
63
64 .macro __loops ar, as, at, incr_log2, mask_log2, cond, ncond
65
66#if XCHAL_HAVE_LOOPS
67 .ifgt \incr_log2 - 1
68 addi \at, \as, (1 << \incr_log2) - 1
69 .ifnc \mask_log2,
70 extui \at, \at, \incr_log2, \mask_log2
71 .else
72 srli \at, \at, \incr_log2
73 .endif
74 .endif
75 loop\cond \at, 99f
76#else
77 .ifnc \mask_log2,
78 extui \at, \as, \incr_log2, \mask_log2
79 .else
80 .ifnc \ncond,
81 srli \at, \as, \incr_log2
82 .endif
83 .endif
84 .ifnc \ncond,
85 b\ncond \at, 99f
86
87 .endif
88 .ifnc \mask_log2,
89 slli \at, \at, \incr_log2
90 add \at, \ar, \at
91 .else
92 add \at, \ar, \as
93 .endif
94#endif
95 98:
96
97 .endm
98
99/*
100 * loop from ar to ax
101 */
102
103 .macro __loopt ar, as, at, incr_log2
104
105#if XCHAL_HAVE_LOOPS
106 sub \at, \as, \ar
107 .ifgt \incr_log2 - 1
108 addi \at, \at, (1 << \incr_log2) - 1
109 srli \at, \at, \incr_log2
110 .endif
111 loop \at, 99f
112#else
113 98:
114#endif
115
116 .endm
117
118/*
119 * restart loop. registers must be unchanged
120 */
121
122 .macro __loop as
123
124#if XCHAL_HAVE_LOOPS
125 loop \as, 99f
126#else
127 98:
128#endif
129
130 .endm
131
132/*
133 * end of loop with no increment of the address.
134 */
135
136 .macro __endl ar, as
137#if !XCHAL_HAVE_LOOPS
138 bltu \ar, \as, 98b
139#endif
140 99:
141 .endm
142
143/*
144 * end of loop with increment of the address.
145 */
146
147 .macro __endla ar, as, incr
148 addi \ar, \ar, \incr
149 __endl \ar \as
150 .endm
151
152
153#endif /* _XTENSA_ASMMACRO_H */
diff --git a/include/asm-xtensa/bug.h b/include/asm-xtensa/bug.h
index 56703659b204..3e52d72712f1 100644
--- a/include/asm-xtensa/bug.h
+++ b/include/asm-xtensa/bug.h
@@ -13,29 +13,6 @@
13#ifndef _XTENSA_BUG_H 13#ifndef _XTENSA_BUG_H
14#define _XTENSA_BUG_H 14#define _XTENSA_BUG_H
15 15
16#include <linux/stringify.h> 16#include <asm-generic/bug.h>
17
18#define ILL __asm__ __volatile__ (".byte 0,0,0\n")
19
20#ifdef CONFIG_KALLSYMS
21# define BUG() do { \
22 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
23 ILL; \
24} while (0)
25#else
26# define BUG() do { \
27 printk("kernel BUG!\n"); \
28 ILL; \
29} while (0)
30#endif
31
32#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
33#define PAGE_BUG(page) do { BUG(); } while (0)
34#define WARN_ON(condition) do { \
35 if (unlikely((condition)!=0)) { \
36 printk ("Warning in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
37 dump_stack(); \
38 } \
39} while (0)
40 17
41#endif /* _XTENSA_BUG_H */ 18#endif /* _XTENSA_BUG_H */
diff --git a/include/asm-xtensa/byteorder.h b/include/asm-xtensa/byteorder.h
index 0b1552569aae..0f540a5f4c01 100644
--- a/include/asm-xtensa/byteorder.h
+++ b/include/asm-xtensa/byteorder.h
@@ -11,10 +11,9 @@
11#ifndef _XTENSA_BYTEORDER_H 11#ifndef _XTENSA_BYTEORDER_H
12#define _XTENSA_BYTEORDER_H 12#define _XTENSA_BYTEORDER_H
13 13
14#include <asm/processor.h>
15#include <asm/types.h> 14#include <asm/types.h>
16 15
17static __inline__ __const__ __u32 ___arch__swab32(__u32 x) 16static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
18{ 17{
19 __u32 res; 18 __u32 res;
20 /* instruction sequence from Xtensa ISA release 2/2000 */ 19 /* instruction sequence from Xtensa ISA release 2/2000 */
@@ -29,7 +28,7 @@ static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
29 return res; 28 return res;
30} 29}
31 30
32static __inline__ __const__ __u16 ___arch__swab16(__u16 x) 31static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x)
33{ 32{
34 /* Given that 'short' values are signed (i.e., can be negative), 33 /* Given that 'short' values are signed (i.e., can be negative),
35 * we cannot assume that the upper 16-bits of the register are 34 * we cannot assume that the upper 16-bits of the register are
diff --git a/include/asm-xtensa/cache.h b/include/asm-xtensa/cache.h
index 1e79c0e27460..1c4a78f29ae2 100644
--- a/include/asm-xtensa/cache.h
+++ b/include/asm-xtensa/cache.h
@@ -4,7 +4,6 @@
4 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive 5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details. 6 * for more details.
7 * 2 of the License, or (at your option) any later version.
8 * 7 *
9 * (C) 2001 - 2005 Tensilica Inc. 8 * (C) 2001 - 2005 Tensilica Inc.
10 */ 9 */
@@ -12,21 +11,14 @@
12#ifndef _XTENSA_CACHE_H 11#ifndef _XTENSA_CACHE_H
13#define _XTENSA_CACHE_H 12#define _XTENSA_CACHE_H
14 13
15#include <xtensa/config/core.h> 14#include <asm/variant/core.h>
16 15
17#if XCHAL_ICACHE_SIZE > 0 16#define L1_CACHE_SHIFT XCHAL_DCACHE_LINEWIDTH
18# if (XCHAL_ICACHE_SIZE % (XCHAL_ICACHE_LINESIZE*XCHAL_ICACHE_WAYS*4)) != 0 17#define L1_CACHE_BYTES XCHAL_DCACHE_LINESIZE
19# error cache configuration outside expected/supported range! 18#define SMP_CACHE_BYTES L1_CACHE_BYTES
20# endif
21#endif
22 19
23#if XCHAL_DCACHE_SIZE > 0 20#define DCACHE_WAY_SIZE (XCHAL_DCACHE_SIZE/XCHAL_DCACHE_WAYS)
24# if (XCHAL_DCACHE_SIZE % (XCHAL_DCACHE_LINESIZE*XCHAL_DCACHE_WAYS*4)) != 0 21#define ICACHE_WAY_SIZE (XCHAL_ICACHE_SIZE/XCHAL_ICACHE_WAYS)
25# error cache configuration outside expected/supported range!
26# endif
27#endif
28 22
29#define L1_CACHE_SHIFT XCHAL_CACHE_LINEWIDTH_MAX
30#define L1_CACHE_BYTES XCHAL_CACHE_LINESIZE_MAX
31 23
32#endif /* _XTENSA_CACHE_H */ 24#endif /* _XTENSA_CACHE_H */
diff --git a/include/asm-xtensa/cacheasm.h b/include/asm-xtensa/cacheasm.h
new file mode 100644
index 000000000000..2c20a58f94cd
--- /dev/null
+++ b/include/asm-xtensa/cacheasm.h
@@ -0,0 +1,177 @@
1/*
2 * include/asm-xtensa/cacheasm.h
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) 2006 Tensilica Inc.
9 */
10
11#include <asm/cache.h>
12#include <asm/asmmacro.h>
13#include <linux/stringify.h>
14
15/*
16 * Define cache functions as macros here so that they can be used
17 * by the kernel and boot loader. We should consider moving them to a
18 * library that can be linked by both.
19 *
20 * Locking
21 *
22 * ___unlock_dcache_all
23 * ___unlock_icache_all
24 *
25 * Flush and invaldating
26 *
27 * ___flush_invalidate_dcache_{all|range|page}
28 * ___flush_dcache_{all|range|page}
29 * ___invalidate_dcache_{all|range|page}
30 * ___invalidate_icache_{all|range|page}
31 *
32 */
33
34 .macro __loop_cache_all ar at insn size line_width
35
36 movi \ar, 0
37
38 __loopi \ar, \at, \size, (4 << (\line_width))
39 \insn \ar, 0 << (\line_width)
40 \insn \ar, 1 << (\line_width)
41 \insn \ar, 2 << (\line_width)
42 \insn \ar, 3 << (\line_width)
43 __endla \ar, \at, 4 << (\line_width)
44
45 .endm
46
47
48 .macro __loop_cache_range ar as at insn line_width
49
50 extui \at, \ar, 0, \line_width
51 add \as, \as, \at
52
53 __loops \ar, \as, \at, \line_width
54 \insn \ar, 0
55 __endla \ar, \at, (1 << (\line_width))
56
57 .endm
58
59
60 .macro __loop_cache_page ar at insn line_width
61
62 __loopi \ar, \at, PAGE_SIZE, 4 << (\line_width)
63 \insn \ar, 0 << (\line_width)
64 \insn \ar, 1 << (\line_width)
65 \insn \ar, 2 << (\line_width)
66 \insn \ar, 3 << (\line_width)
67 __endla \ar, \at, 4 << (\line_width)
68
69 .endm
70
71
72#if XCHAL_DCACHE_LINE_LOCKABLE
73
74 .macro ___unlock_dcache_all ar at
75
76 __loop_cache_all \ar \at diu XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
77
78 .endm
79
80#endif
81
82#if XCHAL_ICACHE_LINE_LOCKABLE
83
84 .macro ___unlock_icache_all ar at
85
86 __loop_cache_all \ar \at iiu XCHAL_ICACHE_SIZE XCHAL_ICACHE_LINEWIDTH
87
88 .endm
89#endif
90
91 .macro ___flush_invalidate_dcache_all ar at
92
93 __loop_cache_all \ar \at diwbi XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
94
95 .endm
96
97
98 .macro ___flush_dcache_all ar at
99
100 __loop_cache_all \ar \at diwb XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
101
102 .endm
103
104
105 .macro ___invalidate_dcache_all ar at
106
107 __loop_cache_all \ar \at dii __stringify(DCACHE_WAY_SIZE) \
108 XCHAL_DCACHE_LINEWIDTH
109
110 .endm
111
112
113 .macro ___invalidate_icache_all ar at
114
115 __loop_cache_all \ar \at iii __stringify(ICACHE_WAY_SIZE) \
116 XCHAL_ICACHE_LINEWIDTH
117
118 .endm
119
120
121
122 .macro ___flush_invalidate_dcache_range ar as at
123
124 __loop_cache_range \ar \as \at dhwbi XCHAL_DCACHE_LINEWIDTH
125
126 .endm
127
128
129 .macro ___flush_dcache_range ar as at
130
131 __loop_cache_range \ar \as \at dhwb XCHAL_DCACHE_LINEWIDTH
132
133 .endm
134
135
136 .macro ___invalidate_dcache_range ar as at
137
138 __loop_cache_range \ar \as \at dhi XCHAL_DCACHE_LINEWIDTH
139
140 .endm
141
142
143 .macro ___invalidate_icache_range ar as at
144
145 __loop_cache_range \ar \as \at ihi XCHAL_ICACHE_LINEWIDTH
146
147 .endm
148
149
150
151 .macro ___flush_invalidate_dcache_page ar as
152
153 __loop_cache_page \ar \as dhwbi XCHAL_DCACHE_LINEWIDTH
154
155 .endm
156
157
158 .macro ___flush_dcache_page ar as
159
160 __loop_cache_page \ar \as dhwb XCHAL_DCACHE_LINEWIDTH
161
162 .endm
163
164
165 .macro ___invalidate_dcache_page ar as
166
167 __loop_cache_page \ar \as dhi XCHAL_DCACHE_LINEWIDTH
168
169 .endm
170
171
172 .macro ___invalidate_icache_page ar as
173
174 __loop_cache_page \ar \as ihi XCHAL_ICACHE_LINEWIDTH
175
176 .endm
177
diff --git a/include/asm-xtensa/cacheflush.h b/include/asm-xtensa/cacheflush.h
index 44a36e087844..22ef901b7845 100644
--- a/include/asm-xtensa/cacheflush.h
+++ b/include/asm-xtensa/cacheflush.h
@@ -5,7 +5,7 @@
5 * License. See the file "COPYING" in the main directory of this archive 5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details. 6 * for more details.
7 * 7 *
8 * (C) 2001 - 2005 Tensilica Inc. 8 * (C) 2001 - 2006 Tensilica Inc.
9 */ 9 */
10 10
11#ifndef _XTENSA_CACHEFLUSH_H 11#ifndef _XTENSA_CACHEFLUSH_H
@@ -75,6 +75,7 @@ extern void __flush_invalidate_dcache_range(unsigned long, unsigned long);
75 75
76#define flush_cache_all() __flush_invalidate_cache_all(); 76#define flush_cache_all() __flush_invalidate_cache_all();
77#define flush_cache_mm(mm) __flush_invalidate_cache_all(); 77#define flush_cache_mm(mm) __flush_invalidate_cache_all();
78#define flush_cache_dup_mm(mm) __flush_invalidate_cache_all();
78 79
79#define flush_cache_vmap(start,end) __flush_invalidate_cache_all(); 80#define flush_cache_vmap(start,end) __flush_invalidate_cache_all();
80#define flush_cache_vunmap(start,end) __flush_invalidate_cache_all(); 81#define flush_cache_vunmap(start,end) __flush_invalidate_cache_all();
@@ -88,6 +89,7 @@ extern void flush_cache_page(struct vm_area_struct*, unsigned long, unsigned lon
88 89
89#define flush_cache_all() do { } while (0) 90#define flush_cache_all() do { } while (0)
90#define flush_cache_mm(mm) do { } while (0) 91#define flush_cache_mm(mm) do { } while (0)
92#define flush_cache_dup_mm(mm) do { } while (0)
91 93
92#define flush_cache_vmap(start,end) do { } while (0) 94#define flush_cache_vmap(start,end) do { } while (0)
93#define flush_cache_vunmap(start,end) do { } while (0) 95#define flush_cache_vunmap(start,end) do { } while (0)
diff --git a/include/asm-xtensa/checksum.h b/include/asm-xtensa/checksum.h
index 5435aff9a4b7..23534c60b3a4 100644
--- a/include/asm-xtensa/checksum.h
+++ b/include/asm-xtensa/checksum.h
@@ -12,7 +12,7 @@
12#define _XTENSA_CHECKSUM_H 12#define _XTENSA_CHECKSUM_H
13 13
14#include <linux/in6.h> 14#include <linux/in6.h>
15#include <xtensa/config/core.h> 15#include <asm/variant/core.h>
16 16
17/* 17/*
18 * computes the checksum of a memory block at buff, length len, 18 * computes the checksum of a memory block at buff, length len,
diff --git a/include/asm-xtensa/coprocessor.h b/include/asm-xtensa/coprocessor.h
index 5093034723be..bd09ec02d57f 100644
--- a/include/asm-xtensa/coprocessor.h
+++ b/include/asm-xtensa/coprocessor.h
@@ -11,7 +11,16 @@
11#ifndef _XTENSA_COPROCESSOR_H 11#ifndef _XTENSA_COPROCESSOR_H
12#define _XTENSA_COPROCESSOR_H 12#define _XTENSA_COPROCESSOR_H
13 13
14#include <xtensa/config/core.h> 14#include <asm/variant/core.h>
15#include <asm/variant/tie.h>
16
17#if !XCHAL_HAVE_CP
18
19#define XTENSA_CP_EXTRA_OFFSET 0
20#define XTENSA_CP_EXTRA_ALIGN 1 /* must be a power of 2 */
21#define XTENSA_CP_EXTRA_SIZE 0
22
23#else
15 24
16#define XTOFS(last_start,last_size,align) \ 25#define XTOFS(last_start,last_size,align) \
17 ((last_start+last_size+align-1) & -align) 26 ((last_start+last_size+align-1) & -align)
@@ -67,4 +76,6 @@ extern void save_coprocessor_registers(void*, int);
67# endif 76# endif
68#endif 77#endif
69 78
79#endif
80
70#endif /* _XTENSA_COPROCESSOR_H */ 81#endif /* _XTENSA_COPROCESSOR_H */
diff --git a/include/asm-xtensa/dma.h b/include/asm-xtensa/dma.h
index db2633f67789..e30f3abf48f0 100644
--- a/include/asm-xtensa/dma.h
+++ b/include/asm-xtensa/dma.h
@@ -12,7 +12,6 @@
12#define _XTENSA_DMA_H 12#define _XTENSA_DMA_H
13 13
14#include <asm/io.h> /* need byte IO */ 14#include <asm/io.h> /* need byte IO */
15#include <xtensa/config/core.h>
16 15
17/* 16/*
18 * This is only to be defined if we have PC-like DMA. 17 * This is only to be defined if we have PC-like DMA.
@@ -44,7 +43,9 @@
44 * enters another area, and virt_to_phys() may not return 43 * enters another area, and virt_to_phys() may not return
45 * the value desired). 44 * the value desired).
46 */ 45 */
47#define MAX_DMA_ADDRESS (PAGE_OFFSET + XCHAL_KSEG_CACHED_SIZE - 1) 46
47#define MAX_DMA_ADDRESS (PAGE_OFFSET + XCHAL_KIO_SIZE - 1)
48
48 49
49/* Reserve and release a DMA channel */ 50/* Reserve and release a DMA channel */
50extern int request_dma(unsigned int dmanr, const char * device_id); 51extern int request_dma(unsigned int dmanr, const char * device_id);
diff --git a/include/asm-xtensa/elf.h b/include/asm-xtensa/elf.h
index de0667453b2e..f0f9fd8560a5 100644
--- a/include/asm-xtensa/elf.h
+++ b/include/asm-xtensa/elf.h
@@ -13,9 +13,8 @@
13#ifndef _XTENSA_ELF_H 13#ifndef _XTENSA_ELF_H
14#define _XTENSA_ELF_H 14#define _XTENSA_ELF_H
15 15
16#include <asm/variant/core.h>
16#include <asm/ptrace.h> 17#include <asm/ptrace.h>
17#include <asm/coprocessor.h>
18#include <xtensa/config/core.h>
19 18
20/* Xtensa processor ELF architecture-magic number */ 19/* Xtensa processor ELF architecture-magic number */
21 20
@@ -118,11 +117,15 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
118 * using memcpy(). But we do allow space for such alignment, 117 * using memcpy(). But we do allow space for such alignment,
119 * to allow optimizations of layout and copying. 118 * to allow optimizations of layout and copying.
120 */ 119 */
121 120#if 0
122#define TOTAL_FPREGS_SIZE \ 121#define TOTAL_FPREGS_SIZE \
123 (4 + XTENSA_CPE_LTABLE_SIZE + XTENSA_CP_EXTRA_SIZE) 122 (4 + XTENSA_CPE_LTABLE_SIZE + XTENSA_CP_EXTRA_SIZE)
124#define ELF_NFPREG \ 123#define ELF_NFPREG \
125 ((TOTAL_FPREGS_SIZE + sizeof(elf_fpreg_t) - 1) / sizeof(elf_fpreg_t)) 124 ((TOTAL_FPREGS_SIZE + sizeof(elf_fpreg_t) - 1) / sizeof(elf_fpreg_t))
125#else
126#define TOTAL_FPREGS_SIZE 0
127#define ELF_NFPREG 0
128#endif
126 129
127typedef unsigned int elf_fpreg_t; 130typedef unsigned int elf_fpreg_t;
128typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; 131typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h
index ec066ae96caf..0609fc691b72 100644
--- a/include/asm-xtensa/fcntl.h
+++ b/include/asm-xtensa/fcntl.h
@@ -14,48 +14,86 @@
14 14
15/* open/fcntl - O_SYNC is only implemented on blocks devices and on files 15/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
16 located on an ext2 file system */ 16 located on an ext2 file system */
17#define O_APPEND 0x0008 17#define O_ACCMODE 0003
18#define O_SYNC 0x0010 18#define O_RDONLY 00
19#define O_NONBLOCK 0x0080 19#define O_WRONLY 01
20#define O_CREAT 0x0100 /* not fcntl */ 20#define O_RDWR 02
21#define O_EXCL 0x0400 /* not fcntl */ 21#define O_CREAT 0100 /* not fcntl */
22#define O_NOCTTY 0x0800 /* not fcntl */ 22#define O_EXCL 0200 /* not fcntl */
23#define FASYNC 0x1000 /* fcntl, for BSD compatibility */ 23#define O_NOCTTY 0400 /* not fcntl */
24#define O_LARGEFILE 0x2000 /* allow large file opens - currently ignored */ 24#define O_TRUNC 01000 /* not fcntl */
25#define O_DIRECT 0x8000 /* direct disk access hint - currently ignored*/ 25#define O_APPEND 02000
26#define O_NOATIME 0x100000 26#define O_NONBLOCK 04000
27 27#define O_NDELAY O_NONBLOCK
28#define F_GETLK 14 28#define O_SYNC 010000
29#define F_GETLK64 15 29#define FASYNC 020000 /* fcntl, for BSD compatibility */
30#define O_DIRECT 040000 /* direct disk access hint */
31#define O_LARGEFILE 0100000
32#define O_DIRECTORY 0200000 /* must be a directory */
33#define O_NOFOLLOW 0400000 /* don't follow links */
34#define O_NOATIME 01000000
35
36#define F_DUPFD 0 /* dup */
37#define F_GETFD 1 /* get close_on_exec */
38#define F_SETFD 2 /* set/clear close_on_exec */
39#define F_GETFL 3 /* get file->f_flags */
40#define F_SETFL 4 /* set file->f_flags */
41#define F_GETLK 5
30#define F_SETLK 6 42#define F_SETLK 6
31#define F_SETLKW 7 43#define F_SETLKW 7
32#define F_SETLK64 16
33#define F_SETLKW64 17
34 44
35#define F_SETOWN 24 /* for sockets. */ 45#define F_SETOWN 8 /* for sockets. */
36#define F_GETOWN 23 /* for sockets. */ 46#define F_GETOWN 9 /* for sockets. */
47#define F_SETSIG 10 /* for sockets. */
48#define F_GETSIG 11 /* for sockets. */
49
50#define F_GETLK64 12 /* using 'struct flock64' */
51#define F_SETLK64 13
52#define F_SETLKW64 14
53
54/* for F_[GET|SET]FL */
55#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
56
57/* for posix fcntl() and lockf() */
58#define F_RDLCK 0
59#define F_WRLCK 1
60#define F_UNLCK 2
61
62/* for old implementation of bsd flock () */
63#define F_EXLCK 4 /* or 3 */
64#define F_SHLCK 8 /* or 4 */
37 65
38typedef struct flock { 66/* for leases */
67#define F_INPROGRESS 16
68
69/* operations for bsd flock(), also used by the kernel implementation */
70#define LOCK_SH 1 /* shared lock */
71#define LOCK_EX 2 /* exclusive lock */
72#define LOCK_NB 4 /* or'd with one of the above to prevent
73 blocking */
74#define LOCK_UN 8 /* remove lock */
75
76#define LOCK_MAND 32 /* This is a mandatory flock */
77#define LOCK_READ 64 /* ... Which allows concurrent read operations */
78#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
79#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
80
81struct flock {
39 short l_type; 82 short l_type;
40 short l_whence; 83 short l_whence;
41 __kernel_off_t l_start; 84 off_t l_start;
42 __kernel_off_t l_len; 85 off_t l_len;
43 long l_sysid; 86 pid_t l_pid;
44 __kernel_pid_t l_pid; 87};
45 long pad[4];
46} flock_t;
47 88
48struct flock64 { 89struct flock64 {
49 short l_type; 90 short l_type;
50 short l_whence; 91 short l_whence;
51 __kernel_off_t l_start; 92 loff_t l_start;
52 __kernel_off_t l_len; 93 loff_t l_len;
53 pid_t l_pid; 94 pid_t l_pid;
54}; 95};
55 96
56#define HAVE_ARCH_STRUCT_FLOCK 97#define F_LINUX_SPECIFIC_BASE 1024
57#define HAVE_ARCH_STRUCT_FLOCK64
58
59#include <asm-generic/fcntl.h>
60 98
61#endif /* _XTENSA_FCNTL_H */ 99#endif /* _XTENSA_FCNTL_H */
diff --git a/include/asm-xtensa/fixmap.h b/include/asm-xtensa/fixmap.h
deleted file mode 100644
index 4423b8ad4954..000000000000
--- a/include/asm-xtensa/fixmap.h
+++ /dev/null
@@ -1,252 +0,0 @@
1/*
2 * include/asm-xtensa/fixmap.h
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) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_FIXMAP_H
12#define _XTENSA_FIXMAP_H
13
14#include <asm/processor.h>
15
16#ifdef CONFIG_MMU
17
18/*
19 * Here we define all the compile-time virtual addresses.
20 */
21
22#if XCHAL_SEG_MAPPABLE_VADDR != 0
23# error "Current port requires virtual user space starting at 0"
24#endif
25#if XCHAL_SEG_MAPPABLE_SIZE < 0x80000000
26# error "Current port requires at least 0x8000000 bytes for user space"
27#endif
28
29/* Verify instruction/data ram/rom and xlmi don't overlay vmalloc space. */
30
31#define __IN_VMALLOC(addr) \
32 (((addr) >= VMALLOC_START) && ((addr) < VMALLOC_END))
33#define __SPAN_VMALLOC(start,end) \
34 (((start) < VMALLOC_START) && ((end) >= VMALLOC_END))
35#define INSIDE_VMALLOC(start,end) \
36 (__IN_VMALLOC((start)) || __IN_VMALLOC(end) || __SPAN_VMALLOC((start),(end)))
37
38#if XCHAL_NUM_INSTROM
39# if XCHAL_NUM_INSTROM == 1
40# if INSIDE_VMALLOC(XCHAL_INSTROM0_VADDR,XCHAL_INSTROM0_VADDR+XCHAL_INSTROM0_SIZE)
41# error vmalloc range conflicts with instrom0
42# endif
43# endif
44# if XCHAL_NUM_INSTROM == 2
45# if INSIDE_VMALLOC(XCHAL_INSTROM1_VADDR,XCHAL_INSTROM1_VADDR+XCHAL_INSTROM1_SIZE)
46# error vmalloc range conflicts with instrom1
47# endif
48# endif
49#endif
50
51#if XCHAL_NUM_INSTRAM
52# if XCHAL_NUM_INSTRAM == 1
53# if INSIDE_VMALLOC(XCHAL_INSTRAM0_VADDR,XCHAL_INSTRAM0_VADDR+XCHAL_INSTRAM0_SIZE)
54# error vmalloc range conflicts with instram0
55# endif
56# endif
57# if XCHAL_NUM_INSTRAM == 2
58# if INSIDE_VMALLOC(XCHAL_INSTRAM1_VADDR,XCHAL_INSTRAM1_VADDR+XCHAL_INSTRAM1_SIZE)
59# error vmalloc range conflicts with instram1
60# endif
61# endif
62#endif
63
64#if XCHAL_NUM_DATAROM
65# if XCHAL_NUM_DATAROM == 1
66# if INSIDE_VMALLOC(XCHAL_DATAROM0_VADDR,XCHAL_DATAROM0_VADDR+XCHAL_DATAROM0_SIZE)
67# error vmalloc range conflicts with datarom0
68# endif
69# endif
70# if XCHAL_NUM_DATAROM == 2
71# if INSIDE_VMALLOC(XCHAL_DATAROM1_VADDR,XCHAL_DATAROM1_VADDR+XCHAL_DATAROM1_SIZE)
72# error vmalloc range conflicts with datarom1
73# endif
74# endif
75#endif
76
77#if XCHAL_NUM_DATARAM
78# if XCHAL_NUM_DATARAM == 1
79# if INSIDE_VMALLOC(XCHAL_DATARAM0_VADDR,XCHAL_DATARAM0_VADDR+XCHAL_DATARAM0_SIZE)
80# error vmalloc range conflicts with dataram0
81# endif
82# endif
83# if XCHAL_NUM_DATARAM == 2
84# if INSIDE_VMALLOC(XCHAL_DATARAM1_VADDR,XCHAL_DATARAM1_VADDR+XCHAL_DATARAM1_SIZE)
85# error vmalloc range conflicts with dataram1
86# endif
87# endif
88#endif
89
90#if XCHAL_NUM_XLMI
91# if XCHAL_NUM_XLMI == 1
92# if INSIDE_VMALLOC(XCHAL_XLMI0_VADDR,XCHAL_XLMI0_VADDR+XCHAL_XLMI0_SIZE)
93# error vmalloc range conflicts with xlmi0
94# endif
95# endif
96# if XCHAL_NUM_XLMI == 2
97# if INSIDE_VMALLOC(XCHAL_XLMI1_VADDR,XCHAL_XLMI1_VADDR+XCHAL_XLMI1_SIZE)
98# error vmalloc range conflicts with xlmi1
99# endif
100# endif
101#endif
102
103#if (XCHAL_NUM_INSTROM > 2) || \
104 (XCHAL_NUM_INSTRAM > 2) || \
105 (XCHAL_NUM_DATARAM > 2) || \
106 (XCHAL_NUM_DATAROM > 2) || \
107 (XCHAL_NUM_XLMI > 2)
108# error Insufficient checks on vmalloc above for more than 2 devices
109#endif
110
111/*
112 * USER_VM_SIZE does not necessarily equal TASK_SIZE. We bumped
113 * TASK_SIZE down to 0x4000000 to simplify the handling of windowed
114 * call instructions (currently limited to a range of 1 GByte). User
115 * tasks may very well reclaim the VM space from 0x40000000 to
116 * 0x7fffffff in the future, so we do not want the kernel becoming
117 * accustomed to having any of its stuff (e.g., page tables) in this
118 * region. This VM region is no-man's land for now.
119 */
120
121#define USER_VM_START XCHAL_SEG_MAPPABLE_VADDR
122#define USER_VM_SIZE 0x80000000
123
124/* Size of page table: */
125
126#define PGTABLE_SIZE_BITS (32 - XCHAL_MMU_MIN_PTE_PAGE_SIZE + 2)
127#define PGTABLE_SIZE (1L << PGTABLE_SIZE_BITS)
128
129/* All kernel-mappable space: */
130
131#define KERNEL_ALLMAP_START (USER_VM_START + USER_VM_SIZE)
132#define KERNEL_ALLMAP_SIZE (XCHAL_SEG_MAPPABLE_SIZE - KERNEL_ALLMAP_START)
133
134/* Carve out page table at start of kernel-mappable area: */
135
136#if KERNEL_ALLMAP_SIZE < PGTABLE_SIZE
137#error "Gimme some space for page table!"
138#endif
139#define PGTABLE_START KERNEL_ALLMAP_START
140
141/* Remaining kernel-mappable space: */
142
143#define KERNEL_MAPPED_START (KERNEL_ALLMAP_START + PGTABLE_SIZE)
144#define KERNEL_MAPPED_SIZE (KERNEL_ALLMAP_SIZE - PGTABLE_SIZE)
145
146#if KERNEL_MAPPED_SIZE < 0x01000000 /* 16 MB is arbitrary for now */
147# error "Shouldn't the kernel have at least *some* mappable space?"
148#endif
149
150#define MAX_LOW_MEMORY XCHAL_KSEG_CACHED_SIZE
151
152#endif
153
154/*
155 * Some constants used elsewhere, but perhaps only in Xtensa header
156 * files, so maybe we can get rid of some and access compile-time HAL
157 * directly...
158 *
159 * Note: We assume that system RAM is located at the very start of the
160 * kernel segments !!
161 */
162#define KERNEL_VM_LOW XCHAL_KSEG_CACHED_VADDR
163#define KERNEL_VM_HIGH XCHAL_KSEG_BYPASS_VADDR
164#define KERNEL_SPACE XCHAL_KSEG_CACHED_VADDR
165
166/*
167 * Returns the physical/virtual addresses of the kernel space
168 * (works with the cached kernel segment only, which is the
169 * one normally used for kernel operation).
170 */
171
172/* PHYSICAL BYPASS CACHED
173 *
174 * bypass vaddr bypass paddr * cached vaddr
175 * cached vaddr cached paddr bypass vaddr *
176 * bypass paddr * bypass vaddr cached vaddr
177 * cached paddr * bypass vaddr cached vaddr
178 * other * * *
179 */
180
181#define PHYSADDR(a) \
182(((unsigned)(a) >= XCHAL_KSEG_BYPASS_VADDR \
183 && (unsigned)(a) < XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_BYPASS_SIZE) ? \
184 (unsigned)(a) - XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_BYPASS_PADDR : \
185 ((unsigned)(a) >= XCHAL_KSEG_CACHED_VADDR \
186 && (unsigned)(a) < XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_CACHED_SIZE) ? \
187 (unsigned)(a) - XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_CACHED_PADDR : \
188 (unsigned)(a))
189
190#define BYPASS_ADDR(a) \
191(((unsigned)(a) >= XCHAL_KSEG_BYPASS_PADDR \
192 && (unsigned)(a) < XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_SIZE) ? \
193 (unsigned)(a) - XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_VADDR : \
194 ((unsigned)(a) >= XCHAL_KSEG_CACHED_PADDR \
195 && (unsigned)(a) < XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_SIZE) ? \
196 (unsigned)(a) - XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_BYPASS_VADDR : \
197 ((unsigned)(a) >= XCHAL_KSEG_CACHED_VADDR \
198 && (unsigned)(a) < XCHAL_KSEG_CACHED_VADDR+XCHAL_KSEG_CACHED_SIZE)? \
199 (unsigned)(a) - XCHAL_KSEG_CACHED_VADDR+XCHAL_KSEG_BYPASS_VADDR: \
200 (unsigned)(a))
201
202#define CACHED_ADDR(a) \
203(((unsigned)(a) >= XCHAL_KSEG_BYPASS_PADDR \
204 && (unsigned)(a) < XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_SIZE) ? \
205 (unsigned)(a) - XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_CACHED_VADDR : \
206 ((unsigned)(a) >= XCHAL_KSEG_CACHED_PADDR \
207 && (unsigned)(a) < XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_SIZE) ? \
208 (unsigned)(a) - XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_VADDR : \
209 ((unsigned)(a) >= XCHAL_KSEG_BYPASS_VADDR \
210 && (unsigned)(a) < XCHAL_KSEG_BYPASS_VADDR+XCHAL_KSEG_BYPASS_SIZE) ? \
211 (unsigned)(a) - XCHAL_KSEG_BYPASS_VADDR+XCHAL_KSEG_CACHED_VADDR : \
212 (unsigned)(a))
213
214#define PHYSADDR_IO(a) \
215(((unsigned)(a) >= XCHAL_KIO_BYPASS_VADDR \
216 && (unsigned)(a) < XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_SIZE) ? \
217 (unsigned)(a) - XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_PADDR : \
218 ((unsigned)(a) >= XCHAL_KIO_CACHED_VADDR \
219 && (unsigned)(a) < XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_SIZE) ? \
220 (unsigned)(a) - XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_PADDR : \
221 (unsigned)(a))
222
223#define BYPASS_ADDR_IO(a) \
224(((unsigned)(a) >= XCHAL_KIO_BYPASS_PADDR \
225 && (unsigned)(a) < XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_SIZE) ? \
226 (unsigned)(a) - XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_VADDR : \
227 ((unsigned)(a) >= XCHAL_KIO_CACHED_PADDR \
228 && (unsigned)(a) < XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_SIZE) ? \
229 (unsigned)(a) - XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_BYPASS_VADDR : \
230 ((unsigned)(a) >= XCHAL_KIO_CACHED_VADDR \
231 && (unsigned)(a) < XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_SIZE) ? \
232 (unsigned)(a) - XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_BYPASS_VADDR : \
233 (unsigned)(a))
234
235#define CACHED_ADDR_IO(a) \
236(((unsigned)(a) >= XCHAL_KIO_BYPASS_PADDR \
237 && (unsigned)(a) < XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_SIZE) ? \
238 (unsigned)(a) - XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_CACHED_VADDR : \
239 ((unsigned)(a) >= XCHAL_KIO_CACHED_PADDR \
240 && (unsigned)(a) < XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_SIZE) ? \
241 (unsigned)(a) - XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_VADDR : \
242 ((unsigned)(a) >= XCHAL_KIO_BYPASS_VADDR \
243 && (unsigned)(a) < XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_SIZE) ? \
244 (unsigned)(a) - XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_CACHED_VADDR : \
245 (unsigned)(a))
246
247#endif /* _XTENSA_ADDRSPACE_H */
248
249
250
251
252
diff --git a/include/asm-xtensa/io.h b/include/asm-xtensa/io.h
index 556e5eed34f5..31ffc3f119c1 100644
--- a/include/asm-xtensa/io.h
+++ b/include/asm-xtensa/io.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-xtensa/io.h 2 * include/asm-xtensa/io.h
3 * 3 *
4 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive 5 * License. See the file "COPYING" in the main directory of this archive
@@ -15,10 +15,11 @@
15#include <asm/byteorder.h> 15#include <asm/byteorder.h>
16 16
17#include <linux/types.h> 17#include <linux/types.h>
18#include <asm/fixmap.h>
19
20#define _IO_BASE 0
21 18
19#define XCHAL_KIO_CACHED_VADDR 0xf0000000
20#define XCHAL_KIO_BYPASS_VADDR 0xf8000000
21#define XCHAL_KIO_PADDR 0xf0000000
22#define XCHAL_KIO_SIZE 0x08000000
22 23
23/* 24/*
24 * swap functions to change byte order from little-endian to big-endian and 25 * swap functions to change byte order from little-endian to big-endian and
@@ -42,40 +43,43 @@ static inline unsigned int _swapl (unsigned int v)
42 43
43static inline unsigned long virt_to_phys(volatile void * address) 44static inline unsigned long virt_to_phys(volatile void * address)
44{ 45{
45 return PHYSADDR((unsigned long)address); 46 return __pa(address);
46} 47}
47 48
48static inline void * phys_to_virt(unsigned long address) 49static inline void * phys_to_virt(unsigned long address)
49{ 50{
50 return (void*) CACHED_ADDR(address); 51 return __va(address);
51} 52}
52 53
53/* 54/*
54 * IO bus memory addresses are also 1:1 with the physical address 55 * virt_to_bus and bus_to_virt are deprecated.
55 */ 56 */
56 57
57static inline unsigned long virt_to_bus(volatile void * address) 58#define virt_to_bus(x) virt_to_phys(x)
58{ 59#define bus_to_virt(x) phys_to_virt(x)
59 return PHYSADDR((unsigned long)address);
60}
61
62static inline void * bus_to_virt (unsigned long address)
63{
64 return (void *) CACHED_ADDR(address);
65}
66 60
67/* 61/*
68 * Change "struct page" to physical address. 62 * Return the virtual (cached) address for the specified bus memory.
63 * Note that we currently don't support any address outside the KIO segment.
69 */ 64 */
70 65
71static inline void *ioremap(unsigned long offset, unsigned long size) 66static inline void *ioremap(unsigned long offset, unsigned long size)
72{ 67{
73 return (void *) CACHED_ADDR_IO(offset); 68 if (offset >= XCHAL_KIO_PADDR
69 && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE)
70 return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR);
71
72 else
73 BUG();
74} 74}
75 75
76static inline void *ioremap_nocache(unsigned long offset, unsigned long size) 76static inline void *ioremap_nocache(unsigned long offset, unsigned long size)
77{ 77{
78 return (void *) BYPASS_ADDR_IO(offset); 78 if (offset >= XCHAL_KIO_PADDR
79 && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE)
80 return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR);
81 else
82 BUG();
79} 83}
80 84
81static inline void iounmap(void *addr) 85static inline void iounmap(void *addr)
@@ -121,9 +125,6 @@ static inline void __raw_writel(__u32 b, volatile void __iomem *addr)
121 *(__force volatile __u32 *)(addr) = b; 125 *(__force volatile __u32 *)(addr) = b;
122} 126}
123 127
124
125
126
127/* These are the definitions for the x86 IO instructions 128/* These are the definitions for the x86 IO instructions
128 * inb/inw/inl/outb/outw/outl, the "string" versions 129 * inb/inw/inl/outb/outw/outl, the "string" versions
129 * insb/insw/insl/outsb/outsw/outsl, and the "pausing" versions 130 * insb/insw/insl/outsb/outsw/outsl, and the "pausing" versions
@@ -131,11 +132,11 @@ static inline void __raw_writel(__u32 b, volatile void __iomem *addr)
131 * The macros don't do byte-swapping. 132 * The macros don't do byte-swapping.
132 */ 133 */
133 134
134#define inb(port) readb((u8 *)((port)+_IO_BASE)) 135#define inb(port) readb((u8 *)((port)))
135#define outb(val, port) writeb((val),(u8 *)((unsigned long)(port)+_IO_BASE)) 136#define outb(val, port) writeb((val),(u8 *)((unsigned long)(port)))
136#define inw(port) readw((u16 *)((port)+_IO_BASE)) 137#define inw(port) readw((u16 *)((port)))
137#define outw(val, port) writew((val),(u16 *)((unsigned long)(port)+_IO_BASE)) 138#define outw(val, port) writew((val),(u16 *)((unsigned long)(port)))
138#define inl(port) readl((u32 *)((port)+_IO_BASE)) 139#define inl(port) readl((u32 *)((port)))
139#define outl(val, port) writel((val),(u32 *)((unsigned long)(port))) 140#define outl(val, port) writel((val),(u32 *)((unsigned long)(port)))
140 141
141#define inb_p(port) inb((port)) 142#define inb_p(port) inb((port))
@@ -180,14 +181,13 @@ extern void outsl (unsigned long port, const void *src, unsigned long count);
180 181
181 182
182/* 183/*
183 * * Convert a physical pointer to a virtual kernel pointer for /dev/mem 184 * Convert a physical pointer to a virtual kernel pointer for /dev/mem access
184 * * access 185 */
185 * */
186#define xlate_dev_mem_ptr(p) __va(p) 186#define xlate_dev_mem_ptr(p) __va(p)
187 187
188/* 188/*
189 * * Convert a virtual cached pointer to an uncached pointer 189 * Convert a virtual cached pointer to an uncached pointer
190 * */ 190 */
191#define xlate_dev_kmem_ptr(p) p 191#define xlate_dev_kmem_ptr(p) p
192 192
193 193
diff --git a/include/asm-xtensa/irq.h b/include/asm-xtensa/irq.h
index 049fde7e752d..fc73b7f11aff 100644
--- a/include/asm-xtensa/irq.h
+++ b/include/asm-xtensa/irq.h
@@ -12,8 +12,7 @@
12#define _XTENSA_IRQ_H 12#define _XTENSA_IRQ_H
13 13
14#include <asm/platform/hardware.h> 14#include <asm/platform/hardware.h>
15 15#include <asm/variant/core.h>
16#include <xtensa/config/core.h>
17 16
18#ifndef PLATFORM_NR_IRQS 17#ifndef PLATFORM_NR_IRQS
19# define PLATFORM_NR_IRQS 0 18# define PLATFORM_NR_IRQS 0
@@ -27,10 +26,5 @@ static __inline__ int irq_canonicalize(int irq)
27} 26}
28 27
29struct irqaction; 28struct irqaction;
30#if 0 // FIXME
31extern void disable_irq_nosync(unsigned int);
32extern void disable_irq(unsigned int);
33extern void enable_irq(unsigned int);
34#endif
35 29
36#endif /* _XTENSA_IRQ_H */ 30#endif /* _XTENSA_IRQ_H */
diff --git a/include/asm-xtensa/irq_regs.h b/include/asm-xtensa/irq_regs.h
new file mode 100644
index 000000000000..3dd9c0b70270
--- /dev/null
+++ b/include/asm-xtensa/irq_regs.h
@@ -0,0 +1 @@
#include <asm-generic/irq_regs.h>
diff --git a/include/asm-xtensa/mmu_context.h b/include/asm-xtensa/mmu_context.h
index af683a74a4ec..f14851f086c3 100644
--- a/include/asm-xtensa/mmu_context.h
+++ b/include/asm-xtensa/mmu_context.h
@@ -16,187 +16,32 @@
16#include <linux/stringify.h> 16#include <linux/stringify.h>
17 17
18#include <asm/pgtable.h> 18#include <asm/pgtable.h>
19#include <asm/mmu_context.h>
20#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
21#include <asm/tlbflush.h> 20#include <asm/tlbflush.h>
22 21
23/* 22#define XCHAL_MMU_ASID_BITS 8
24 * Linux was ported to Xtensa assuming all auto-refill ways in set 0
25 * had the same properties (a very likely assumption). Multiple sets
26 * of auto-refill ways will still work properly, but not as optimally
27 * as the Xtensa designer may have assumed.
28 *
29 * We make this case a hard #error, killing the kernel build, to alert
30 * the developer to this condition (which is more likely an error).
31 * You super-duper clever developers can change it to a warning or
32 * remove it altogether if you think you know what you're doing. :)
33 */
34 23
35#if (XCHAL_HAVE_TLBS != 1) 24#if (XCHAL_HAVE_TLBS != 1)
36# error "Linux must have an MMU!" 25# error "Linux must have an MMU!"
37#endif 26#endif
38 27
39#if ((XCHAL_ITLB_ARF_WAYS == 0) || (XCHAL_DTLB_ARF_WAYS == 0))
40# error "MMU must have auto-refill ways"
41#endif
42
43#if ((XCHAL_ITLB_ARF_SETS != 1) || (XCHAL_DTLB_ARF_SETS != 1))
44# error Linux may not use all auto-refill ways as efficiently as you think
45#endif
46
47#if (XCHAL_MMU_MAX_PTE_PAGE_SIZE != XCHAL_MMU_MIN_PTE_PAGE_SIZE)
48# error Only one page size allowed!
49#endif
50
51extern unsigned long asid_cache; 28extern unsigned long asid_cache;
52extern pgd_t *current_pgd;
53
54/*
55 * Define the number of entries per auto-refill way in set 0 of both I and D
56 * TLBs. We deal only with set 0 here (an assumption further explained in
57 * assertions.h). Also, define the total number of ARF entries in both TLBs.
58 */
59
60#define ITLB_ENTRIES_PER_ARF_WAY (XCHAL_ITLB_SET(XCHAL_ITLB_ARF_SET0,ENTRIES))
61#define DTLB_ENTRIES_PER_ARF_WAY (XCHAL_DTLB_SET(XCHAL_DTLB_ARF_SET0,ENTRIES))
62
63#define ITLB_ENTRIES \
64 (ITLB_ENTRIES_PER_ARF_WAY * (XCHAL_ITLB_SET(XCHAL_ITLB_ARF_SET0,WAYS)))
65#define DTLB_ENTRIES \
66 (DTLB_ENTRIES_PER_ARF_WAY * (XCHAL_DTLB_SET(XCHAL_DTLB_ARF_SET0,WAYS)))
67
68
69/*
70 * SMALLEST_NTLB_ENTRIES is the smaller of ITLB_ENTRIES and DTLB_ENTRIES.
71 * In practice, they are probably equal. This macro simplifies function
72 * flush_tlb_range().
73 */
74
75#if (DTLB_ENTRIES < ITLB_ENTRIES)
76# define SMALLEST_NTLB_ENTRIES DTLB_ENTRIES
77#else
78# define SMALLEST_NTLB_ENTRIES ITLB_ENTRIES
79#endif
80
81
82/*
83 * asid_cache tracks only the ASID[USER_RING] field of the RASID special
84 * register, which is the current user-task asid allocation value.
85 * mm->context has the same meaning. When it comes time to write the
86 * asid_cache or mm->context values to the RASID special register, we first
87 * shift the value left by 8, then insert the value.
88 * ASID[0] always contains the kernel's asid value, and we reserve three
89 * other asid values that we never assign to user tasks.
90 */
91
92#define ASID_INC 0x1
93#define ASID_MASK ((1 << XCHAL_MMU_ASID_BITS) - 1)
94
95/*
96 * XCHAL_MMU_ASID_INVALID is a configurable Xtensa processor constant
97 * indicating invalid address space. XCHAL_MMU_ASID_KERNEL is a configurable
98 * Xtensa processor constant indicating the kernel address space. They can
99 * be arbitrary values.
100 *
101 * We identify three more unique, reserved ASID values to use in the unused
102 * ring positions. No other user process will be assigned these reserved
103 * ASID values.
104 *
105 * For example, given that
106 *
107 * XCHAL_MMU_ASID_INVALID == 0
108 * XCHAL_MMU_ASID_KERNEL == 1
109 *
110 * the following maze of #if statements would generate
111 *
112 * ASID_RESERVED_1 == 2
113 * ASID_RESERVED_2 == 3
114 * ASID_RESERVED_3 == 4
115 * ASID_FIRST_NONRESERVED == 5
116 */
117
118#if (XCHAL_MMU_ASID_INVALID != XCHAL_MMU_ASID_KERNEL + 1)
119# define ASID_RESERVED_1 ((XCHAL_MMU_ASID_KERNEL + 1) & ASID_MASK)
120#else
121# define ASID_RESERVED_1 ((XCHAL_MMU_ASID_KERNEL + 2) & ASID_MASK)
122#endif
123
124#if (XCHAL_MMU_ASID_INVALID != ASID_RESERVED_1 + 1)
125# define ASID_RESERVED_2 ((ASID_RESERVED_1 + 1) & ASID_MASK)
126#else
127# define ASID_RESERVED_2 ((ASID_RESERVED_1 + 2) & ASID_MASK)
128#endif
129
130#if (XCHAL_MMU_ASID_INVALID != ASID_RESERVED_2 + 1)
131# define ASID_RESERVED_3 ((ASID_RESERVED_2 + 1) & ASID_MASK)
132#else
133# define ASID_RESERVED_3 ((ASID_RESERVED_2 + 2) & ASID_MASK)
134#endif
135
136#if (XCHAL_MMU_ASID_INVALID != ASID_RESERVED_3 + 1)
137# define ASID_FIRST_NONRESERVED ((ASID_RESERVED_3 + 1) & ASID_MASK)
138#else
139# define ASID_FIRST_NONRESERVED ((ASID_RESERVED_3 + 2) & ASID_MASK)
140#endif
141
142#define ASID_ALL_RESERVED ( ((ASID_RESERVED_1) << 24) + \
143 ((ASID_RESERVED_2) << 16) + \
144 ((ASID_RESERVED_3) << 8) + \
145 ((XCHAL_MMU_ASID_KERNEL)) )
146
147 29
148/* 30/*
149 * NO_CONTEXT is the invalid ASID value that we don't ever assign to 31 * NO_CONTEXT is the invalid ASID value that we don't ever assign to
150 * any user or kernel context. NO_CONTEXT is a better mnemonic than 32 * any user or kernel context.
151 * XCHAL_MMU_ASID_INVALID, so we use it in code instead. 33 *
152 */ 34 * 0 invalid
153 35 * 1 kernel
154#define NO_CONTEXT XCHAL_MMU_ASID_INVALID 36 * 2 reserved
155 37 * 3 reserved
156#if (KERNEL_RING != 0) 38 * 4...255 available
157# error The KERNEL_RING really should be zero.
158#endif
159
160#if (USER_RING >= XCHAL_MMU_RINGS)
161# error USER_RING cannot be greater than the highest numbered ring.
162#endif
163
164#if (USER_RING == KERNEL_RING)
165# error The user and kernel rings really should not be equal.
166#endif
167
168#if (USER_RING == 1)
169#define ASID_INSERT(x) ( ((ASID_RESERVED_1) << 24) + \
170 ((ASID_RESERVED_2) << 16) + \
171 (((x) & (ASID_MASK)) << 8) + \
172 ((XCHAL_MMU_ASID_KERNEL)) )
173
174#elif (USER_RING == 2)
175#define ASID_INSERT(x) ( ((ASID_RESERVED_1) << 24) + \
176 (((x) & (ASID_MASK)) << 16) + \
177 ((ASID_RESERVED_2) << 8) + \
178 ((XCHAL_MMU_ASID_KERNEL)) )
179
180#elif (USER_RING == 3)
181#define ASID_INSERT(x) ( (((x) & (ASID_MASK)) << 24) + \
182 ((ASID_RESERVED_1) << 16) + \
183 ((ASID_RESERVED_2) << 8) + \
184 ((XCHAL_MMU_ASID_KERNEL)) )
185
186#else
187#error Goofy value for USER_RING
188
189#endif /* USER_RING == 1 */
190
191
192/*
193 * All unused by hardware upper bits will be considered
194 * as a software asid extension.
195 */ 39 */
196 40
197#define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1))) 41#define NO_CONTEXT 0
198#define ASID_FIRST_VERSION \ 42#define ASID_USER_FIRST 4
199 ((unsigned long)(~ASID_VERSION_MASK) + 1 + ASID_FIRST_NONRESERVED) 43#define ASID_MASK ((1 << XCHAL_MMU_ASID_BITS) - 1)
44#define ASID_INSERT(x) (0x03020001 | (((x) & ASID_MASK) << 8))
200 45
201static inline void set_rasid_register (unsigned long val) 46static inline void set_rasid_register (unsigned long val)
202{ 47{
@@ -207,67 +52,28 @@ static inline void set_rasid_register (unsigned long val)
207static inline unsigned long get_rasid_register (void) 52static inline unsigned long get_rasid_register (void)
208{ 53{
209 unsigned long tmp; 54 unsigned long tmp;
210 __asm__ __volatile__ (" rsr %0, "__stringify(RASID)"\n\t" : "=a" (tmp)); 55 __asm__ __volatile__ (" rsr %0,"__stringify(RASID)"\n\t" : "=a" (tmp));
211 return tmp; 56 return tmp;
212} 57}
213 58
214
215#if ((XCHAL_MMU_ASID_INVALID == 0) && (XCHAL_MMU_ASID_KERNEL == 1))
216
217static inline void 59static inline void
218get_new_mmu_context(struct mm_struct *mm, unsigned long asid) 60__get_new_mmu_context(struct mm_struct *mm)
219{ 61{
220 extern void flush_tlb_all(void); 62 extern void flush_tlb_all(void);
221 if (! ((asid += ASID_INC) & ASID_MASK) ) { 63 if (! (++asid_cache & ASID_MASK) ) {
222 flush_tlb_all(); /* start new asid cycle */ 64 flush_tlb_all(); /* start new asid cycle */
223 if (!asid) /* fix version if needed */ 65 asid_cache += ASID_USER_FIRST;
224 asid = ASID_FIRST_VERSION - ASID_FIRST_NONRESERVED;
225 asid += ASID_FIRST_NONRESERVED;
226 } 66 }
227 mm->context = asid_cache = asid; 67 mm->context = asid_cache;
228}
229
230#else
231#warning ASID_{INVALID,KERNEL} values impose non-optimal get_new_mmu_context implementation
232
233/* XCHAL_MMU_ASID_INVALID == 0 and XCHAL_MMU_ASID_KERNEL ==1 are
234 really the best, but if you insist... */
235
236static inline int validate_asid (unsigned long asid)
237{
238 switch (asid) {
239 case XCHAL_MMU_ASID_INVALID:
240 case XCHAL_MMU_ASID_KERNEL:
241 case ASID_RESERVED_1:
242 case ASID_RESERVED_2:
243 case ASID_RESERVED_3:
244 return 0; /* can't use these values as ASIDs */
245 }
246 return 1; /* valid */
247} 68}
248 69
249static inline void 70static inline void
250get_new_mmu_context(struct mm_struct *mm, unsigned long asid) 71__load_mmu_context(struct mm_struct *mm)
251{ 72{
252 extern void flush_tlb_all(void); 73 set_rasid_register(ASID_INSERT(mm->context));
253 while (1) { 74 invalidate_page_directory();
254 asid += ASID_INC;
255 if ( ! (asid & ASID_MASK) ) {
256 flush_tlb_all(); /* start new asid cycle */
257 if (!asid) /* fix version if needed */
258 asid = ASID_FIRST_VERSION - ASID_FIRST_NONRESERVED;
259 asid += ASID_FIRST_NONRESERVED;
260 break; /* no need to validate here */
261 }
262 if (validate_asid (asid & ASID_MASK))
263 break;
264 }
265 mm->context = asid_cache = asid;
266} 75}
267 76
268#endif
269
270
271/* 77/*
272 * Initialize the context related info for a new mm_struct 78 * Initialize the context related info for a new mm_struct
273 * instance. 79 * instance.
@@ -280,6 +86,20 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
280 return 0; 86 return 0;
281} 87}
282 88
89/*
90 * After we have set current->mm to a new value, this activates
91 * the context for the new mm so we see the new mappings.
92 */
93static inline void
94activate_mm(struct mm_struct *prev, struct mm_struct *next)
95{
96 /* Unconditionally get a new ASID. */
97
98 __get_new_mmu_context(next);
99 __load_mmu_context(next);
100}
101
102
283static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 103static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
284 struct task_struct *tsk) 104 struct task_struct *tsk)
285{ 105{
@@ -287,11 +107,10 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
287 107
288 /* Check if our ASID is of an older version and thus invalid */ 108 /* Check if our ASID is of an older version and thus invalid */
289 109
290 if ((next->context ^ asid) & ASID_VERSION_MASK) 110 if (next->context == NO_CONTEXT || ((next->context^asid) & ~ASID_MASK))
291 get_new_mmu_context(next, asid); 111 __get_new_mmu_context(next);
292 112
293 set_rasid_register (ASID_INSERT(next->context)); 113 __load_mmu_context(next);
294 invalidate_page_directory();
295} 114}
296 115
297#define deactivate_mm(tsk, mm) do { } while(0) 116#define deactivate_mm(tsk, mm) do { } while(0)
@@ -302,20 +121,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
302 */ 121 */
303static inline void destroy_context(struct mm_struct *mm) 122static inline void destroy_context(struct mm_struct *mm)
304{ 123{
305 /* Nothing to do. */
306}
307
308/*
309 * After we have set current->mm to a new value, this activates
310 * the context for the new mm so we see the new mappings.
311 */
312static inline void
313activate_mm(struct mm_struct *prev, struct mm_struct *next)
314{
315 /* Unconditionally get a new ASID. */
316
317 get_new_mmu_context(next, asid_cache);
318 set_rasid_register (ASID_INSERT(next->context));
319 invalidate_page_directory(); 124 invalidate_page_directory();
320} 125}
321 126
diff --git a/include/asm-xtensa/page.h b/include/asm-xtensa/page.h
index 40f4c6c3f580..c631d006194b 100644
--- a/include/asm-xtensa/page.h
+++ b/include/asm-xtensa/page.h
@@ -15,18 +15,24 @@
15 15
16#include <asm/processor.h> 16#include <asm/processor.h>
17 17
18#define XCHAL_KSEG_CACHED_VADDR 0xd0000000
19#define XCHAL_KSEG_BYPASS_VADDR 0xd8000000
20#define XCHAL_KSEG_PADDR 0x00000000
21#define XCHAL_KSEG_SIZE 0x08000000
22
18/* 23/*
19 * PAGE_SHIFT determines the page size 24 * PAGE_SHIFT determines the page size
20 * PAGE_ALIGN(x) aligns the pointer to the (next) page boundary 25 * PAGE_ALIGN(x) aligns the pointer to the (next) page boundary
21 */ 26 */
22 27
23#define PAGE_SHIFT XCHAL_MMU_MIN_PTE_PAGE_SIZE 28#define PAGE_SHIFT 12
24#define PAGE_SIZE (1 << PAGE_SHIFT) 29#define PAGE_SIZE (1 << PAGE_SHIFT)
25#define PAGE_MASK (~(PAGE_SIZE-1)) 30#define PAGE_MASK (~(PAGE_SIZE-1))
26#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE - 1) & PAGE_MASK) 31#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE - 1) & PAGE_MASK)
27 32
28#define DCACHE_WAY_SIZE (XCHAL_DCACHE_SIZE / XCHAL_DCACHE_WAYS)
29#define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR 33#define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR
34#define MAX_MEM_PFN XCHAL_KSEG_SIZE
35#define PGTABLE_START 0x80000000
30 36
31#ifdef __ASSEMBLY__ 37#ifdef __ASSEMBLY__
32 38
diff --git a/include/asm-xtensa/param.h b/include/asm-xtensa/param.h
index c0eec8260b0e..6f281392e3f8 100644
--- a/include/asm-xtensa/param.h
+++ b/include/asm-xtensa/param.h
@@ -11,7 +11,7 @@
11#ifndef _XTENSA_PARAM_H 11#ifndef _XTENSA_PARAM_H
12#define _XTENSA_PARAM_H 12#define _XTENSA_PARAM_H
13 13
14#include <xtensa/config/core.h> 14#include <asm/variant/core.h>
15 15
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17# define HZ 100 /* internal timer frequency */ 17# define HZ 100 /* internal timer frequency */
diff --git a/include/asm-xtensa/pgtable.h b/include/asm-xtensa/pgtable.h
index b4318934b10d..2d4b5db6ea63 100644
--- a/include/asm-xtensa/pgtable.h
+++ b/include/asm-xtensa/pgtable.h
@@ -14,45 +14,6 @@
14#include <asm-generic/pgtable-nopmd.h> 14#include <asm-generic/pgtable-nopmd.h>
15#include <asm/page.h> 15#include <asm/page.h>
16 16
17/* Assertions. */
18
19#ifdef CONFIG_MMU
20
21
22#if (XCHAL_MMU_RINGS < 2)
23# error Linux build assumes at least 2 ring levels.
24#endif
25
26#if (XCHAL_MMU_CA_BITS != 4)
27# error We assume exactly four bits for CA.
28#endif
29
30#if (XCHAL_MMU_SR_BITS != 0)
31# error We have no room for SR bits.
32#endif
33
34/*
35 * Use the first min-wired way for mapping page-table pages.
36 * Page coloring requires a second min-wired way.
37 */
38
39#if (XCHAL_DTLB_MINWIRED_SETS == 0)
40# error Need a min-wired way for mapping page-table pages
41#endif
42
43#define DTLB_WAY_PGTABLE XCHAL_DTLB_SET(XCHAL_DTLB_MINWIRED_SET0, WAY)
44
45#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK
46# if XCHAL_DTLB_SET(XCHAL_DTLB_MINWIRED_SET0, WAYS) >= 2
47# define DTLB_WAY_DCACHE_ALIAS0 (DTLB_WAY_PGTABLE + 1)
48# define DTLB_WAY_DCACHE_ALIAS1 (DTLB_WAY_PGTABLE + 2)
49# else
50# error Page coloring requires its own wired dtlb way!
51# endif
52#endif
53
54#endif /* CONFIG_MMU */
55
56/* 17/*
57 * We only use two ring levels, user and kernel space. 18 * We only use two ring levels, user and kernel space.
58 */ 19 */
@@ -97,7 +58,7 @@
97#define PGD_ORDER 0 58#define PGD_ORDER 0
98#define PMD_ORDER 0 59#define PMD_ORDER 0
99#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 60#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
100#define FIRST_USER_ADDRESS XCHAL_SEG_MAPPABLE_VADDR 61#define FIRST_USER_ADDRESS 0
101#define FIRST_USER_PGD_NR (FIRST_USER_ADDRESS >> PGDIR_SHIFT) 62#define FIRST_USER_PGD_NR (FIRST_USER_ADDRESS >> PGDIR_SHIFT)
102 63
103/* virtual memory area. We keep a distance to other memory regions to be 64/* virtual memory area. We keep a distance to other memory regions to be
diff --git a/include/asm-xtensa/platform-iss/hardware.h b/include/asm-xtensa/platform-iss/hardware.h
index 22240f001803..6930c12adc16 100644
--- a/include/asm-xtensa/platform-iss/hardware.h
+++ b/include/asm-xtensa/platform-iss/hardware.h
@@ -12,18 +12,18 @@
12 * This file contains the default configuration of ISS. 12 * This file contains the default configuration of ISS.
13 */ 13 */
14 14
15#ifndef __ASM_XTENSA_ISS_HARDWARE 15#ifndef _XTENSA_PLATFORM_ISS_HARDWARE_H
16#define __ASM_XTENSA_ISS_HARDWARE 16#define _XTENSA_PLATFORM_ISS_HARDWARE_H
17 17
18/* 18/*
19 * Memory configuration. 19 * Memory configuration.
20 */ 20 */
21 21
22#define PLATFORM_DEFAULT_MEM_START XSHAL_RAM_PADDR 22#define PLATFORM_DEFAULT_MEM_START 0x00000000
23#define PLATFORM_DEFAULT_MEM_SIZE XSHAL_RAM_VSIZE 23#define PLATFORM_DEFAULT_MEM_SIZE 0x08000000
24 24
25/* 25/*
26 * Interrupt configuration. 26 * Interrupt configuration.
27 */ 27 */
28 28
29#endif /* __ASM_XTENSA_ISS_HARDWARE */ 29#endif /* _XTENSA_PLATFORM_ISS_HARDWARE_H */
diff --git a/include/asm-xtensa/platform-iss/simcall.h b/include/asm-xtensa/platform-iss/simcall.h
new file mode 100644
index 000000000000..6acb572759a6
--- /dev/null
+++ b/include/asm-xtensa/platform-iss/simcall.h
@@ -0,0 +1,62 @@
1/*
2 * include/asm-xtensa/platform-iss/hardware.h
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) 2001 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PLATFORM_ISS_SIMCALL_H
12#define _XTENSA_PLATFORM_ISS_SIMCALL_H
13
14
15/*
16 * System call like services offered by the simulator host.
17 */
18
19#define SYS_nop 0 /* unused */
20#define SYS_exit 1 /*x*/
21#define SYS_fork 2
22#define SYS_read 3 /*x*/
23#define SYS_write 4 /*x*/
24#define SYS_open 5 /*x*/
25#define SYS_close 6 /*x*/
26#define SYS_rename 7 /*x 38 - waitpid */
27#define SYS_creat 8 /*x*/
28#define SYS_link 9 /*x (not implemented on WIN32) */
29#define SYS_unlink 10 /*x*/
30#define SYS_execv 11 /* n/a - execve */
31#define SYS_execve 12 /* 11 - chdir */
32#define SYS_pipe 13 /* 42 - time */
33#define SYS_stat 14 /* 106 - mknod */
34#define SYS_chmod 15
35#define SYS_chown 16 /* 202 - lchown */
36#define SYS_utime 17 /* 30 - break */
37#define SYS_wait 18 /* n/a - oldstat */
38#define SYS_lseek 19 /*x*/
39#define SYS_getpid 20
40#define SYS_isatty 21 /* n/a - mount */
41#define SYS_fstat 22 /* 108 - oldumount */
42#define SYS_time 23 /* 13 - setuid */
43#define SYS_gettimeofday 24 /*x 78 - getuid (not implemented on WIN32) */
44#define SYS_times 25 /*X 43 - stime (Xtensa-specific implementation) */
45#define SYS_socket 26
46#define SYS_sendto 27
47#define SYS_recvfrom 28
48#define SYS_select_one 29 /* not compitible select, one file descriptor at the time */
49#define SYS_bind 30
50#define SYS_ioctl 31
51
52/*
53 * SYS_select_one specifiers
54 */
55
56#define XTISS_SELECT_ONE_READ 1
57#define XTISS_SELECT_ONE_WRITE 2
58#define XTISS_SELECT_ONE_EXCEPT 3
59
60
61#endif /* _XTENSA_PLATFORM_ISS_SIMCALL_H */
62
diff --git a/include/asm-xtensa/posix_types.h b/include/asm-xtensa/posix_types.h
index 2c816b0e7762..4ad77dda6d5f 100644
--- a/include/asm-xtensa/posix_types.h
+++ b/include/asm-xtensa/posix_types.h
@@ -21,7 +21,7 @@
21 21
22typedef unsigned long __kernel_ino_t; 22typedef unsigned long __kernel_ino_t;
23typedef unsigned int __kernel_mode_t; 23typedef unsigned int __kernel_mode_t;
24typedef unsigned short __kernel_nlink_t; 24typedef unsigned long __kernel_nlink_t;
25typedef long __kernel_off_t; 25typedef long __kernel_off_t;
26typedef int __kernel_pid_t; 26typedef int __kernel_pid_t;
27typedef unsigned short __kernel_ipc_pid_t; 27typedef unsigned short __kernel_ipc_pid_t;
@@ -60,7 +60,7 @@ typedef struct {
60#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) 60#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
61#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) 61#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
62#define __FD_ZERO(set) \ 62#define __FD_ZERO(set) \
63 ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set))) 63 ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))
64 64
65#else /* __GNUC__ */ 65#else /* __GNUC__ */
66 66
diff --git a/include/asm-xtensa/processor.h b/include/asm-xtensa/processor.h
index 8b96e77c9d82..4feb9f7f35a6 100644
--- a/include/asm-xtensa/processor.h
+++ b/include/asm-xtensa/processor.h
@@ -11,24 +11,18 @@
11#ifndef _XTENSA_PROCESSOR_H 11#ifndef _XTENSA_PROCESSOR_H
12#define _XTENSA_PROCESSOR_H 12#define _XTENSA_PROCESSOR_H
13 13
14#ifdef __ASSEMBLY__ 14#include <asm/variant/core.h>
15#define _ASMLANGUAGE 15#include <asm/coprocessor.h>
16#endif
17
18#include <xtensa/config/core.h>
19#include <xtensa/config/specreg.h>
20#include <xtensa/config/tie.h>
21#include <xtensa/config/system.h>
22 16
23#include <linux/compiler.h> 17#include <linux/compiler.h>
24#include <asm/ptrace.h> 18#include <asm/ptrace.h>
25#include <asm/types.h> 19#include <asm/types.h>
26#include <asm/coprocessor.h> 20#include <asm/regs.h>
27 21
28/* Assertions. */ 22/* Assertions. */
29 23
30#if (XCHAL_HAVE_WINDOWED != 1) 24#if (XCHAL_HAVE_WINDOWED != 1)
31#error Linux requires the Xtensa Windowed Registers Option. 25# error Linux requires the Xtensa Windowed Registers Option.
32#endif 26#endif
33 27
34/* 28/*
@@ -145,11 +139,11 @@ struct thread_struct {
145 * Note: We set-up ps as if we did a call4 to the new pc. 139 * Note: We set-up ps as if we did a call4 to the new pc.
146 * set_thread_state in signal.c depends on it. 140 * set_thread_state in signal.c depends on it.
147 */ 141 */
148#define USER_PS_VALUE ( (1 << XCHAL_PS_WOE_SHIFT) + \ 142#define USER_PS_VALUE ((1 << PS_WOE_BIT) | \
149 (1 << XCHAL_PS_CALLINC_SHIFT) + \ 143 (1 << PS_CALLINC_SHIFT) | \
150 (USER_RING << XCHAL_PS_RING_SHIFT) + \ 144 (USER_RING << PS_RING_SHIFT) | \
151 (1 << XCHAL_PS_PROGSTACK_SHIFT) + \ 145 (1 << PS_UM_BIT) | \
152 (1 << XCHAL_PS_EXCM_SHIFT) ) 146 (1 << PS_EXCM_BIT))
153 147
154/* Clearing a0 terminates the backtrace. */ 148/* Clearing a0 terminates the backtrace. */
155#define start_thread(regs, new_pc, new_sp) \ 149#define start_thread(regs, new_pc, new_sp) \
diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h
index a5ac71a5205c..1b7fe363fad1 100644
--- a/include/asm-xtensa/ptrace.h
+++ b/include/asm-xtensa/ptrace.h
@@ -11,7 +11,7 @@
11#ifndef _XTENSA_PTRACE_H 11#ifndef _XTENSA_PTRACE_H
12#define _XTENSA_PTRACE_H 12#define _XTENSA_PTRACE_H
13 13
14#include <xtensa/config/core.h> 14#include <asm/variant/core.h>
15 15
16/* 16/*
17 * Kernel stack 17 * Kernel stack
diff --git a/include/asm-xtensa/regs.h b/include/asm-xtensa/regs.h
new file mode 100644
index 000000000000..c913d259faaa
--- /dev/null
+++ b/include/asm-xtensa/regs.h
@@ -0,0 +1,138 @@
1/*
2 * Copyright (c) 2006 Tensilica, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of version 2.1 of the GNU Lesser General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this program; if not, write the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
22 * USA.
23 */
24
25#ifndef _XTENSA_REGS_H
26#define _XTENSA_REGS_H
27
28/* Special registers. */
29
30#define LBEG 0
31#define LEND 1
32#define LCOUNT 2
33#define SAR 3
34#define BR 4
35#define SCOMPARE1 12
36#define ACCHI 16
37#define ACCLO 17
38#define MR 32
39#define WINDOWBASE 72
40#define WINDOWSTART 73
41#define PTEVADDR 83
42#define RASID 90
43#define ITLBCFG 91
44#define DTLBCFG 92
45#define IBREAKENABLE 96
46#define DDR 104
47#define IBREAKA 128
48#define DBREAKA 144
49#define DBREAKC 160
50#define EPC 176
51#define EPC_1 177
52#define DEPC 192
53#define EPS 192
54#define EPS_1 193
55#define EXCSAVE 208
56#define EXCSAVE_1 209
57#define INTERRUPT 226
58#define INTENABLE 228
59#define PS 230
60#define THREADPTR 231
61#define EXCCAUSE 232
62#define DEBUGCAUSE 233
63#define CCOUNT 234
64#define PRID 235
65#define ICOUNT 236
66#define ICOUNTLEVEL 237
67#define EXCVADDR 238
68#define CCOMPARE 240
69#define MISC 244
70
71/* Special names for read-only and write-only interrupt registers. */
72
73#define INTREAD 226
74#define INTSET 226
75#define INTCLEAR 227
76
77/* EXCCAUSE register fields */
78
79#define EXCCAUSE_EXCCAUSE_SHIFT 0
80#define EXCCAUSE_EXCCAUSE_MASK 0x3F
81
82#define EXCCAUSE_ILLEGAL_INSTRUCTION 0
83#define EXCCAUSE_SYSTEM_CALL 1
84#define EXCCAUSE_INSTRUCTION_FETCH_ERROR 2
85#define EXCCAUSE_LOAD_STORE_ERROR 3
86#define EXCCAUSE_LEVEL1_INTERRUPT 4
87#define EXCCAUSE_ALLOCA 5
88#define EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6
89#define EXCCAUSE_SPECULATION 7
90#define EXCCAUSE_PRIVILEGED 8
91#define EXCCAUSE_UNALIGNED 9
92#define EXCCAUSE_ITLB_MISS 16
93#define EXCCAUSE_ITLB_MULTIHIT 17
94#define EXCCAUSE_ITLB_PRIVILEGE 18
95#define EXCCAUSE_ITLB_SIZE_RESTRICTION 19
96#define EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20
97#define EXCCAUSE_DTLB_MISS 24
98#define EXCCAUSE_DTLB_MULTIHIT 25
99#define EXCCAUSE_DTLB_PRIVILEGE 26
100#define EXCCAUSE_DTLB_SIZE_RESTRICTION 27
101#define EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28
102#define EXCCAUSE_STORE_CACHE_ATTRIBUTE 29
103#define EXCCAUSE_FLOATING_POINT 40
104
105/* PS register fields. */
106
107#define PS_WOE_BIT 18
108#define PS_CALLINC_SHIFT 16
109#define PS_CALLINC_MASK 0x00030000
110#define PS_OWB_SHIFT 8
111#define PS_OWB_MASK 0x00000F00
112#define PS_RING_SHIFT 6
113#define PS_RING_MASK 0x000000C0
114#define PS_UM_BIT 5
115#define PS_EXCM_BIT 4
116#define PS_INTLEVEL_SHIFT 0
117#define PS_INTLEVEL_MASK 0x0000000F
118
119/* DBREAKCn register fields. */
120
121#define DBREAKC_MASK_BIT 0
122#define DBREAKC_MASK_MASK 0x0000003F
123#define DBREAKC_LOAD_BIT 30
124#define DBREAKC_LOAD_MASK 0x40000000
125#define DBREAKC_STOR_BIT 31
126#define DBREAKC_STOR_MASK 0x80000000
127
128/* DEBUGCAUSE register fields. */
129
130#define DEBUGCAUSE_DEBUGINT_BIT 5 /* External debug interrupt */
131#define DEBUGCAUSE_BREAKN_BIT 4 /* BREAK.N instruction */
132#define DEBUGCAUSE_BREAK_BIT 3 /* BREAK instruction */
133#define DEBUGCAUSE_DBREAK_BIT 2 /* DBREAK match */
134#define DEBUGCAUSE_IBREAK_BIT 1 /* IBREAK match */
135#define DEBUGCAUSE_ICOUNT_BIT 0 /* ICOUNT would incr. to zero */
136
137#endif /* _XTENSA_SPECREG_H */
138
diff --git a/include/asm-xtensa/sembuf.h b/include/asm-xtensa/sembuf.h
index 2d26c47666fe..c15870493b33 100644
--- a/include/asm-xtensa/sembuf.h
+++ b/include/asm-xtensa/sembuf.h
@@ -25,7 +25,7 @@
25 25
26struct semid64_ds { 26struct semid64_ds {
27 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 27 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
28#if XCHAL_HAVE_LE 28#ifdef __XTENSA_EL__
29 __kernel_time_t sem_otime; /* last semop time */ 29 __kernel_time_t sem_otime; /* last semop time */
30 unsigned long __unused1; 30 unsigned long __unused1;
31 __kernel_time_t sem_ctime; /* last change time */ 31 __kernel_time_t sem_ctime; /* last change time */
diff --git a/include/asm-xtensa/shmbuf.h b/include/asm-xtensa/shmbuf.h
index a30b81a4b933..ad4b0121782c 100644
--- a/include/asm-xtensa/shmbuf.h
+++ b/include/asm-xtensa/shmbuf.h
@@ -19,6 +19,7 @@
19#ifndef _XTENSA_SHMBUF_H 19#ifndef _XTENSA_SHMBUF_H
20#define _XTENSA_SHMBUF_H 20#define _XTENSA_SHMBUF_H
21 21
22#if defined (__XTENSA_EL__)
22struct shmid64_ds { 23struct shmid64_ds {
23 struct ipc64_perm shm_perm; /* operation perms */ 24 struct ipc64_perm shm_perm; /* operation perms */
24 size_t shm_segsz; /* size of segment (bytes) */ 25 size_t shm_segsz; /* size of segment (bytes) */
@@ -34,6 +35,26 @@ struct shmid64_ds {
34 unsigned long __unused4; 35 unsigned long __unused4;
35 unsigned long __unused5; 36 unsigned long __unused5;
36}; 37};
38#elif defined (__XTENSA_EB__)
39struct shmid64_ds {
40 struct ipc64_perm shm_perm; /* operation perms */
41 size_t shm_segsz; /* size of segment (bytes) */
42 __kernel_time_t shm_atime; /* last attach time */
43 unsigned long __unused1;
44 __kernel_time_t shm_dtime; /* last detach time */
45 unsigned long __unused2;
46 __kernel_time_t shm_ctime; /* last change time */
47 unsigned long __unused3;
48 __kernel_pid_t shm_cpid; /* pid of creator */
49 __kernel_pid_t shm_lpid; /* pid of last operator */
50 unsigned long shm_nattch; /* no. of current attaches */
51 unsigned long __unused4;
52 unsigned long __unused5;
53};
54#else
55# error endian order not defined
56#endif
57
37 58
38struct shminfo64 { 59struct shminfo64 {
39 unsigned long shmmax; 60 unsigned long shmmax;
diff --git a/include/asm-xtensa/stat.h b/include/asm-xtensa/stat.h
index 2f4662ff6c3a..149f4bce092f 100644
--- a/include/asm-xtensa/stat.h
+++ b/include/asm-xtensa/stat.h
@@ -13,93 +13,57 @@
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15 15
16struct __old_kernel_stat {
17 unsigned short st_dev;
18 unsigned short st_ino;
19 unsigned short st_mode;
20 unsigned short st_nlink;
21 unsigned short st_uid;
22 unsigned short st_gid;
23 unsigned short st_rdev;
24 unsigned long st_size;
25 unsigned long st_atime;
26 unsigned long st_mtime;
27 unsigned long st_ctime;
28};
29
30#define STAT_HAVE_NSEC 1 16#define STAT_HAVE_NSEC 1
31 17
32struct stat { 18struct stat {
33 unsigned short st_dev; 19 unsigned long st_dev;
34 unsigned short __pad1; 20 ino_t st_ino;
35 unsigned long st_ino; 21 mode_t st_mode;
36 unsigned short st_mode; 22 nlink_t st_nlink;
37 unsigned short st_nlink; 23 uid_t st_uid;
38 unsigned short st_uid; 24 gid_t st_gid;
39 unsigned short st_gid; 25 unsigned int st_rdev;
40 unsigned short st_rdev; 26 off_t st_size;
41 unsigned short __pad2; 27 unsigned long st_blksize;
42 unsigned long st_size; 28 unsigned long st_blocks;
43 unsigned long st_blksize; 29 unsigned long st_atime;
44 unsigned long st_blocks; 30 unsigned long st_atime_nsec;
45 unsigned long st_atime; 31 unsigned long st_mtime;
46 unsigned long st_atime_nsec; 32 unsigned long st_mtime_nsec;
47 unsigned long st_mtime; 33 unsigned long st_ctime;
48 unsigned long st_mtime_nsec; 34 unsigned long st_ctime_nsec;
49 unsigned long st_ctime; 35 unsigned long __unused4;
50 unsigned long st_ctime_nsec; 36 unsigned long __unused5;
51 unsigned long __unused4;
52 unsigned long __unused5;
53}; 37};
54 38
55/* This matches struct stat64 in glibc-2.2.3. */ 39/* This matches struct stat64 in glibc-2.3 */
56 40
57struct stat64 { 41struct stat64 {
58#ifdef __XTENSA_EL__ 42 unsigned long long st_dev; /* Device */
59 unsigned short st_dev; /* Device */ 43 unsigned long long st_ino; /* File serial number */
60 unsigned char __pad0[10];
61#else
62 unsigned char __pad0[6];
63 unsigned short st_dev;
64 unsigned char __pad1[2];
65#endif
66
67#define STAT64_HAS_BROKEN_ST_INO 1
68 unsigned long __st_ino; /* 32bit file serial number. */
69
70 unsigned int st_mode; /* File mode. */ 44 unsigned int st_mode; /* File mode. */
71 unsigned int st_nlink; /* Link count. */ 45 unsigned int st_nlink; /* Link count. */
72 unsigned int st_uid; /* User ID of the file's owner. */ 46 unsigned int st_uid; /* User ID of the file's owner. */
73 unsigned int st_gid; /* Group ID of the file's group. */ 47 unsigned int st_gid; /* Group ID of the file's group. */
74 48 unsigned long long st_rdev; /* Device number, if device. */
75#ifdef __XTENSA_EL__ 49 long long st_size; /* Size of file, in bytes. */
76 unsigned short st_rdev; /* Device number, if device. */ 50 long st_blksize; /* Optimal block size for I/O. */
77 unsigned char __pad3[10]; 51 unsigned long __unused2;
78#else 52#ifdef __XTENSA_EB__
79 unsigned char __pad2[6]; 53 unsigned long __unused3;
80 unsigned short st_rdev; 54 long st_blocks; /* Number 512-byte blocks allocated. */
81 unsigned char __pad3[2];
82#endif
83
84 long long int st_size; /* Size of file, in bytes. */
85 long int st_blksize; /* Optimal block size for I/O. */
86
87#ifdef __XTENSA_EL__
88 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
89 unsigned long __pad4;
90#else 55#else
91 unsigned long __pad4; 56 long st_blocks; /* Number 512-byte blocks allocated. */
92 unsigned long st_blocks; 57 unsigned long __unused3;
93#endif 58#endif
94 59 long st_atime; /* Time of last access. */
95 unsigned long __pad5; 60 unsigned long st_atime_nsec;
96 long int st_atime; /* Time of last access. */ 61 long st_mtime; /* Time of last modification. */
97 unsigned long st_atime_nsec; 62 unsigned long st_mtime_nsec;
98 long int st_mtime; /* Time of last modification. */ 63 long st_ctime; /* Time of last status change. */
99 unsigned long st_mtime_nsec; 64 unsigned long st_ctime_nsec;
100 long int st_ctime; /* Time of last status change. */ 65 unsigned long __unused4;
101 unsigned long st_ctime_nsec; 66 unsigned long __unused5;
102 unsigned long long int st_ino; /* File serial number. */
103}; 67};
104 68
105#endif /* _XTENSA_STAT_H */ 69#endif /* _XTENSA_STAT_H */
diff --git a/include/asm-xtensa/syscall.h b/include/asm-xtensa/syscall.h
new file mode 100644
index 000000000000..6cb0d42f11c8
--- /dev/null
+++ b/include/asm-xtensa/syscall.h
@@ -0,0 +1,20 @@
1struct pt_regs;
2struct sigaction;
3asmlinkage long xtensa_execve(char*, char**, char**, struct pt_regs*);
4asmlinkage long xtensa_clone(unsigned long, unsigned long, struct pt_regs*);
5asmlinkage long xtensa_pipe(int __user *);
6asmlinkage long xtensa_mmap2(unsigned long, unsigned long, unsigned long,
7 unsigned long, unsigned long, unsigned long);
8asmlinkage long xtensa_ptrace(long, long, long, long);
9asmlinkage long xtensa_sigreturn(struct pt_regs*);
10asmlinkage long xtensa_rt_sigreturn(struct pt_regs*);
11asmlinkage long xtensa_sigsuspend(struct pt_regs*);
12asmlinkage long xtensa_rt_sigsuspend(struct pt_regs*);
13asmlinkage long xtensa_sigaction(int, const struct old_sigaction*,
14 struct old_sigaction*);
15asmlinkage long xtensa_sigaltstack(struct pt_regs *regs);
16asmlinkage long sys_rt_sigaction(int,
17 const struct sigaction __user *,
18 struct sigaction __user *,
19 size_t);
20asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg);
diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h
index 932bda92a21c..4aaed7fe6cfe 100644
--- a/include/asm-xtensa/system.h
+++ b/include/asm-xtensa/system.h
@@ -213,7 +213,7 @@ static inline void spill_registers(void)
213 unsigned int a0, ps; 213 unsigned int a0, ps;
214 214
215 __asm__ __volatile__ ( 215 __asm__ __volatile__ (
216 "movi a14," __stringify (PS_EXCM_MASK) " | 1\n\t" 216 "movi a14," __stringify (PS_EXCM_BIT) " | 1\n\t"
217 "mov a12, a0\n\t" 217 "mov a12, a0\n\t"
218 "rsr a13," __stringify(SAR) "\n\t" 218 "rsr a13," __stringify(SAR) "\n\t"
219 "xsr a14," __stringify(PS) "\n\t" 219 "xsr a14," __stringify(PS) "\n\t"
diff --git a/include/asm-xtensa/termbits.h b/include/asm-xtensa/termbits.h
index c780593ff5f9..057b9a3d8f83 100644
--- a/include/asm-xtensa/termbits.h
+++ b/include/asm-xtensa/termbits.h
@@ -30,6 +30,17 @@ struct termios {
30 cc_t c_cc[NCCS]; /* control characters */ 30 cc_t c_cc[NCCS]; /* control characters */
31}; 31};
32 32
33struct ktermios {
34 tcflag_t c_iflag; /* input mode flags */
35 tcflag_t c_oflag; /* output mode flags */
36 tcflag_t c_cflag; /* control mode flags */
37 tcflag_t c_lflag; /* local mode flags */
38 cc_t c_line; /* line discipline */
39 cc_t c_cc[NCCS]; /* control characters */
40 speed_t c_ispeed; /* input speed */
41 speed_t c_ospeed; /* output speed */
42};
43
33/* c_cc characters */ 44/* c_cc characters */
34 45
35#define VINTR 0 46#define VINTR 0
diff --git a/include/asm-xtensa/timex.h b/include/asm-xtensa/timex.h
index c7b705e66655..28c7985a4000 100644
--- a/include/asm-xtensa/timex.h
+++ b/include/asm-xtensa/timex.h
@@ -16,17 +16,22 @@
16#include <asm/processor.h> 16#include <asm/processor.h>
17#include <linux/stringify.h> 17#include <linux/stringify.h>
18 18
19#if XCHAL_INT_LEVEL(XCHAL_TIMER0_INTERRUPT) == 1 19#define _INTLEVEL(x) XCHAL_INT ## x ## _LEVEL
20#define INTLEVEL(x) _INTLEVEL(x)
21
22#if INTLEVEL(XCHAL_TIMER0_INTERRUPT) == 1
20# define LINUX_TIMER 0 23# define LINUX_TIMER 0
21#elif XCHAL_INT_LEVEL(XCHAL_TIMER1_INTERRUPT) == 1 24# define LINUX_TIMER_INT XCHAL_TIMER0_INTERRUPT
25#elif INTLEVEL(XCHAL_TIMER1_INTERRUPT) == 1
22# define LINUX_TIMER 1 26# define LINUX_TIMER 1
23#elif XCHAL_INT_LEVEL(XCHAL_TIMER2_INTERRUPT) == 1 27# define LINUX_TIMER_INT XCHAL_TIMER1_INTERRUPT
28#elif INTLEVEL(XCHAL_TIMER2_INTERRUPT) == 1
24# define LINUX_TIMER 2 29# define LINUX_TIMER 2
30# define LINUX_TIMER_INT XCHAL_TIMER2_INTERRUPT
25#else 31#else
26# error "Bad timer number for Linux configurations!" 32# error "Bad timer number for Linux configurations!"
27#endif 33#endif
28 34
29#define LINUX_TIMER_INT XCHAL_TIMER_INTERRUPT(LINUX_TIMER)
30#define LINUX_TIMER_MASK (1L << LINUX_TIMER_INT) 35#define LINUX_TIMER_MASK (1L << LINUX_TIMER_INT)
31 36
32#define CLOCK_TICK_RATE 1193180 /* (everyone is using this value) */ 37#define CLOCK_TICK_RATE 1193180 /* (everyone is using this value) */
@@ -60,8 +65,8 @@ extern cycles_t cacheflush_time;
60 65
61#define WSR_CCOUNT(r) __asm__("wsr %0,"__stringify(CCOUNT) :: "a" (r)) 66#define WSR_CCOUNT(r) __asm__("wsr %0,"__stringify(CCOUNT) :: "a" (r))
62#define RSR_CCOUNT(r) __asm__("rsr %0,"__stringify(CCOUNT) : "=a" (r)) 67#define RSR_CCOUNT(r) __asm__("rsr %0,"__stringify(CCOUNT) : "=a" (r))
63#define WSR_CCOMPARE(x,r) __asm__("wsr %0,"__stringify(CCOMPARE_0)"+"__stringify(x) :: "a"(r)) 68#define WSR_CCOMPARE(x,r) __asm__("wsr %0,"__stringify(CCOMPARE)"+"__stringify(x) :: "a"(r))
64#define RSR_CCOMPARE(x,r) __asm__("rsr %0,"__stringify(CCOMPARE_0)"+"__stringify(x) : "=a"(r)) 69#define RSR_CCOMPARE(x,r) __asm__("rsr %0,"__stringify(CCOMPARE)"+"__stringify(x) : "=a"(r))
65 70
66static inline unsigned long get_ccount (void) 71static inline unsigned long get_ccount (void)
67{ 72{
diff --git a/include/asm-xtensa/tlbflush.h b/include/asm-xtensa/tlbflush.h
index 43f6ec859af9..7c637b3c352c 100644
--- a/include/asm-xtensa/tlbflush.h
+++ b/include/asm-xtensa/tlbflush.h
@@ -11,12 +11,20 @@
11#ifndef _XTENSA_TLBFLUSH_H 11#ifndef _XTENSA_TLBFLUSH_H
12#define _XTENSA_TLBFLUSH_H 12#define _XTENSA_TLBFLUSH_H
13 13
14#define DEBUG_TLB
15
16#ifdef __KERNEL__ 14#ifdef __KERNEL__
17 15
18#include <asm/processor.h>
19#include <linux/stringify.h> 16#include <linux/stringify.h>
17#include <asm/processor.h>
18
19#define DTLB_WAY_PGD 7
20
21#define ITLB_ARF_WAYS 4
22#define DTLB_ARF_WAYS 4
23
24#define ITLB_HIT_BIT 3
25#define DTLB_HIT_BIT 4
26
27#ifndef __ASSEMBLY__
20 28
21/* TLB flushing: 29/* TLB flushing:
22 * 30 *
@@ -46,11 +54,6 @@ static inline void flush_tlb_pgtables(struct mm_struct *mm,
46 54
47/* TLB operations. */ 55/* TLB operations. */
48 56
49#define ITLB_WAYS_LOG2 XCHAL_ITLB_WAY_BITS
50#define DTLB_WAYS_LOG2 XCHAL_DTLB_WAY_BITS
51#define ITLB_PROBE_SUCCESS (1 << ITLB_WAYS_LOG2)
52#define DTLB_PROBE_SUCCESS (1 << DTLB_WAYS_LOG2)
53
54static inline unsigned long itlb_probe(unsigned long addr) 57static inline unsigned long itlb_probe(unsigned long addr)
55{ 58{
56 unsigned long tmp; 59 unsigned long tmp;
@@ -131,29 +134,30 @@ static inline void write_itlb_entry (pte_t entry, int way)
131 134
132static inline void invalidate_page_directory (void) 135static inline void invalidate_page_directory (void)
133{ 136{
134 invalidate_dtlb_entry (DTLB_WAY_PGTABLE); 137 invalidate_dtlb_entry (DTLB_WAY_PGD);
138 invalidate_dtlb_entry (DTLB_WAY_PGD+1);
139 invalidate_dtlb_entry (DTLB_WAY_PGD+2);
135} 140}
136 141
137static inline void invalidate_itlb_mapping (unsigned address) 142static inline void invalidate_itlb_mapping (unsigned address)
138{ 143{
139 unsigned long tlb_entry; 144 unsigned long tlb_entry;
140 while ((tlb_entry = itlb_probe (address)) & ITLB_PROBE_SUCCESS) 145 if (((tlb_entry = itlb_probe(address)) & (1 << ITLB_HIT_BIT)) != 0)
141 invalidate_itlb_entry (tlb_entry); 146 invalidate_itlb_entry(tlb_entry);
142} 147}
143 148
144static inline void invalidate_dtlb_mapping (unsigned address) 149static inline void invalidate_dtlb_mapping (unsigned address)
145{ 150{
146 unsigned long tlb_entry; 151 unsigned long tlb_entry;
147 while ((tlb_entry = dtlb_probe (address)) & DTLB_PROBE_SUCCESS) 152 if (((tlb_entry = dtlb_probe(address)) & (1 << DTLB_HIT_BIT)) != 0)
148 invalidate_dtlb_entry (tlb_entry); 153 invalidate_dtlb_entry(tlb_entry);
149} 154}
150 155
151#define check_pgt_cache() do { } while (0) 156#define check_pgt_cache() do { } while (0)
152 157
153 158
154#ifdef DEBUG_TLB 159/*
155 160 * DO NOT USE THESE FUNCTIONS. These instructions aren't part of the Xtensa
156/* DO NOT USE THESE FUNCTIONS. These instructions aren't part of the Xtensa
157 * ISA and exist only for test purposes.. 161 * ISA and exist only for test purposes..
158 * You may find it helpful for MMU debugging, however. 162 * You may find it helpful for MMU debugging, however.
159 * 163 *
@@ -193,8 +197,6 @@ static inline unsigned long read_itlb_translation (int way)
193 return tmp; 197 return tmp;
194} 198}
195 199
196#endif /* DEBUG_TLB */ 200#endif /* __ASSEMBLY__ */
197
198
199#endif /* __KERNEL__ */ 201#endif /* __KERNEL__ */
200#endif /* _XTENSA_PGALLOC_H */ 202#endif /* _XTENSA_TLBFLUSH_H */
diff --git a/include/asm-xtensa/uaccess.h b/include/asm-xtensa/uaccess.h
index 88a64e1144d5..d6352da05b10 100644
--- a/include/asm-xtensa/uaccess.h
+++ b/include/asm-xtensa/uaccess.h
@@ -23,7 +23,6 @@
23 23
24#ifdef __ASSEMBLY__ 24#ifdef __ASSEMBLY__
25 25
26#define _ASMLANGUAGE
27#include <asm/current.h> 26#include <asm/current.h>
28#include <asm/asm-offsets.h> 27#include <asm/asm-offsets.h>
29#include <asm/processor.h> 28#include <asm/processor.h>
diff --git a/include/asm-xtensa/unistd.h b/include/asm-xtensa/unistd.h
index 2e1a1b997e7d..8a7fb6964ce1 100644
--- a/include/asm-xtensa/unistd.h
+++ b/include/asm-xtensa/unistd.h
@@ -11,212 +11,593 @@
11#ifndef _XTENSA_UNISTD_H 11#ifndef _XTENSA_UNISTD_H
12#define _XTENSA_UNISTD_H 12#define _XTENSA_UNISTD_H
13 13
14#define __NR_spill 0 14#ifndef __SYSCALL
15#define __NR_exit 1 15# define __SYSCALL(nr,func,nargs)
16#define __NR_read 3 16#endif
17#define __NR_write 4 17
18#define __NR_open 5 18#define __NR_spill 0
19#define __NR_close 6 19__SYSCALL( 0, sys_ni_syscall, 0)
20#define __NR_creat 8 20#define __NR_xtensa 1
21#define __NR_link 9 21__SYSCALL( 1, sys_ni_syscall, 0)
22#define __NR_unlink 10 22#define __NR_available4 2
23#define __NR_execve 11 23__SYSCALL( 2, sys_ni_syscall, 0)
24#define __NR_chdir 12 24#define __NR_available5 3
25#define __NR_mknod 14 25__SYSCALL( 3, sys_ni_syscall, 0)
26#define __NR_chmod 15 26#define __NR_available6 4
27#define __NR_lchown 16 27__SYSCALL( 4, sys_ni_syscall, 0)
28#define __NR_break 17 28#define __NR_available7 5
29#define __NR_lseek 19 29__SYSCALL( 5, sys_ni_syscall, 0)
30#define __NR_getpid 20 30#define __NR_available8 6
31#define __NR_mount 21 31__SYSCALL( 6, sys_ni_syscall, 0)
32#define __NR_setuid 23 32#define __NR_available9 7
33#define __NR_getuid 24 33__SYSCALL( 7, sys_ni_syscall, 0)
34#define __NR_ptrace 26 34
35#define __NR_utime 30 35/* File Operations */
36#define __NR_stty 31 36
37#define __NR_gtty 32 37#define __NR_open 8
38#define __NR_access 33 38__SYSCALL( 8, sys_open, 3)
39#define __NR_ftime 35 39#define __NR_close 9
40#define __NR_sync 36 40__SYSCALL( 9, sys_close, 1)
41#define __NR_kill 37 41#define __NR_dup 10
42#define __NR_rename 38 42__SYSCALL( 10, sys_dup, 1)
43#define __NR_mkdir 39 43#define __NR_dup2 11
44#define __NR_rmdir 40 44__SYSCALL( 11, sys_dup2, 2)
45#define __NR_dup 41 45#define __NR_read 12
46#define __NR_pipe 42 46__SYSCALL( 12, sys_read, 3)
47#define __NR_times 43 47#define __NR_write 13
48#define __NR_prof 44 48__SYSCALL( 13, sys_write, 3)
49#define __NR_brk 45 49#define __NR_select 14
50#define __NR_setgid 46 50__SYSCALL( 14, sys_select, 5)
51#define __NR_getgid 47 51#define __NR_lseek 15
52#define __NR_signal 48 52__SYSCALL( 15, sys_lseek, 3)
53#define __NR_geteuid 49 53#define __NR_poll 16
54#define __NR_getegid 50 54__SYSCALL( 16, sys_poll, 3)
55#define __NR_acct 51 55#define __NR__llseek 17
56#define __NR_lock 53 56__SYSCALL( 17, sys_llseek, 5)
57#define __NR_ioctl 54 57#define __NR_epoll_wait 18
58#define __NR_fcntl 55 58__SYSCALL( 18, sys_epoll_wait, 4)
59#define __NR_setpgid 57 59#define __NR_epoll_ctl 19
60#define __NR_ulimit 58 60__SYSCALL( 19, sys_epoll_ctl, 4)
61#define __NR_umask 60 61#define __NR_epoll_create 20
62#define __NR_chroot 61 62__SYSCALL( 20, sys_epoll_create, 1)
63#define __NR_ustat 62 63#define __NR_creat 21
64#define __NR_dup2 63 64__SYSCALL( 21, sys_creat, 2)
65#define __NR_getppid 64 65#define __NR_truncate 22
66#define __NR_setsid 66 66__SYSCALL( 22, sys_truncate, 2)
67#define __NR_sigaction 67 67#define __NR_ftruncate 23
68#define __NR_setreuid 70 68__SYSCALL( 23, sys_ftruncate, 2)
69#define __NR_setregid 71 69#define __NR_readv 24
70#define __NR_sigsuspend 72 70__SYSCALL( 24, sys_readv, 3)
71#define __NR_sigpending 73 71#define __NR_writev 25
72#define __NR_sethostname 74 72__SYSCALL( 25, sys_writev, 3)
73#define __NR_setrlimit 75 73#define __NR_fsync 26
74#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */ 74__SYSCALL( 26, sys_fsync, 1)
75#define __NR_getrusage 77 75#define __NR_fdatasync 27
76#define __NR_gettimeofday 78 76__SYSCALL( 27, sys_fdatasync, 1)
77#define __NR_settimeofday 79 77#define __NR_truncate64 28
78#define __NR_getgroups 80 78__SYSCALL( 28, sys_truncate64, 2)
79#define __NR_setgroups 81 79#define __NR_ftruncate64 29
80#define __NR_select 82 80__SYSCALL( 29, sys_ftruncate64, 2)
81#define __NR_symlink 83 81#define __NR_pread64 30
82#define __NR_readlink 85 82__SYSCALL( 30, sys_pread64, 6)
83#define __NR_uselib 86 83#define __NR_pwrite64 31
84#define __NR_swapon 87 84__SYSCALL( 31, sys_pwrite64, 6)
85#define __NR_reboot 88 85
86#define __NR_munmap 91 86#define __NR_link 32
87#define __NR_truncate 92 87__SYSCALL( 32, sys_link, 2)
88#define __NR_ftruncate 93 88#define __NR_rename 33
89#define __NR_fchmod 94 89__SYSCALL( 33, sys_rename, 2)
90#define __NR_fchown 95 90#define __NR_symlink 34
91#define __NR_getpriority 96 91__SYSCALL( 34, sys_symlink, 2)
92#define __NR_setpriority 97 92#define __NR_readlink 35
93#define __NR_profil 98 93__SYSCALL( 35, sys_readlink, 3)
94#define __NR_statfs 99 94#define __NR_mknod 36
95#define __NR_fstatfs 100 95__SYSCALL( 36, sys_mknod, 3)
96#define __NR_ioperm 101 96#define __NR_pipe 37
97#define __NR_syslog 103 97__SYSCALL( 37, xtensa_pipe, 1)
98#define __NR_setitimer 104 98#define __NR_unlink 38
99#define __NR_getitimer 105 99__SYSCALL( 38, sys_unlink, 1)
100#define __NR_stat 106 100#define __NR_rmdir 39
101#define __NR_lstat 107 101__SYSCALL( 39, sys_rmdir, 1)
102#define __NR_fstat 108 102
103#define __NR_iopl 110 103#define __NR_mkdir 40
104#define __NR_vhangup 111 104__SYSCALL( 40, sys_mkdir, 2)
105#define __NR_idle 112 105#define __NR_chdir 41
106#define __NR_wait4 114 106__SYSCALL( 41, sys_chdir, 1)
107#define __NR_swapoff 115 107#define __NR_fchdir 42
108#define __NR_sysinfo 116 108__SYSCALL( 42, sys_fchdir, 1)
109#define __NR_fsync 118 109#define __NR_getcwd 43
110#define __NR_sigreturn 119 110__SYSCALL( 43, sys_getcwd, 2)
111#define __NR_clone 120 111
112#define __NR_setdomainname 121 112#define __NR_chmod 44
113#define __NR_uname 122 113__SYSCALL( 44, sys_chmod, 2)
114#define __NR_modify_ldt 123 114#define __NR_chown 45
115#define __NR_adjtimex 124 115__SYSCALL( 45, sys_chown, 3)
116#define __NR_mprotect 125 116#define __NR_stat 46
117#define __NR_create_module 127 117__SYSCALL( 46, sys_newstat, 2)
118#define __NR_init_module 128 118#define __NR_stat64 47
119#define __NR_delete_module 129 119__SYSCALL( 47, sys_stat64, 2)
120#define __NR_quotactl 131 120
121#define __NR_getpgid 132 121#define __NR_lchown 48
122#define __NR_fchdir 133 122__SYSCALL( 48, sys_lchown, 3)
123#define __NR_bdflush 134 123#define __NR_lstat 49
124#define __NR_sysfs 135 124__SYSCALL( 49, sys_newlstat, 2)
125#define __NR_personality 136 125#define __NR_lstat64 50
126#define __NR_setfsuid 138 126__SYSCALL( 50, sys_lstat64, 2)
127#define __NR_setfsgid 139 127#define __NR_available51 51
128#define __NR__llseek 140 128__SYSCALL( 51, sys_ni_syscall, 0)
129#define __NR_getdents 141 129
130#define __NR__newselect 142 130#define __NR_fchmod 52
131#define __NR_flock 143 131__SYSCALL( 52, sys_fchmod, 2)
132#define __NR_msync 144 132#define __NR_fchown 53
133#define __NR_readv 145 133__SYSCALL( 53, sys_fchown, 3)
134#define __NR_writev 146 134#define __NR_fstat 54
135#define __NR_cacheflush 147 135__SYSCALL( 54, sys_newfstat, 2)
136#define __NR_cachectl 148 136#define __NR_fstat64 55
137#define __NR_sysxtensa 149 137__SYSCALL( 55, sys_fstat64, 2)
138#define __NR_sysdummy 150 138
139#define __NR_getsid 151 139#define __NR_flock 56
140#define __NR_fdatasync 152 140__SYSCALL( 56, sys_flock, 2)
141#define __NR__sysctl 153 141#define __NR_access 57
142#define __NR_mlock 154 142__SYSCALL( 57, sys_access, 2)
143#define __NR_munlock 155 143#define __NR_umask 58
144#define __NR_mlockall 156 144__SYSCALL( 58, sys_umask, 1)
145#define __NR_munlockall 157 145#define __NR_getdents 59
146#define __NR_sched_setparam 158 146__SYSCALL( 59, sys_getdents, 3)
147#define __NR_sched_getparam 159 147#define __NR_getdents64 60
148#define __NR_sched_setscheduler 160 148__SYSCALL( 60, sys_getdents64, 3)
149#define __NR_sched_getscheduler 161 149#define __NR_fcntl64 61
150#define __NR_sched_yield 162 150__SYSCALL( 61, sys_fcntl64, 3)
151#define __NR_sched_get_priority_max 163 151#define __NR_available62 62
152#define __NR_sched_get_priority_min 164 152__SYSCALL( 62, sys_ni_syscall, 0)
153#define __NR_sched_rr_get_interval 165 153#define __NR_fadvise64_64 63
154#define __NR_nanosleep 166 154__SYSCALL( 63, sys_fadvise64_64, 6)
155#define __NR_mremap 167 155#define __NR_utime 64 /* glibc 2.3.3 ?? */
156#define __NR_accept 168 156__SYSCALL( 64, sys_utime, 2)
157#define __NR_bind 169 157#define __NR_utimes 65
158#define __NR_connect 170 158__SYSCALL( 65, sys_utimes, 2)
159#define __NR_getpeername 171 159#define __NR_ioctl 66
160#define __NR_getsockname 172 160__SYSCALL( 66, sys_ioctl, 3)
161#define __NR_getsockopt 173 161#define __NR_fcntl 67
162#define __NR_listen 174 162__SYSCALL( 67, sys_fcntl, 3)
163#define __NR_recv 175 163
164#define __NR_recvfrom 176 164#define __NR_setxattr 68
165#define __NR_recvmsg 177 165__SYSCALL( 68, sys_setxattr, 5)
166#define __NR_send 178 166#define __NR_getxattr 69
167#define __NR_sendmsg 179 167__SYSCALL( 69, sys_getxattr, 4)
168#define __NR_sendto 180 168#define __NR_listxattr 70
169#define __NR_setsockopt 181 169__SYSCALL( 70, sys_listxattr, 3)
170#define __NR_shutdown 182 170#define __NR_removexattr 71
171#define __NR_socket 183 171__SYSCALL( 71, sys_removexattr, 2)
172#define __NR_socketpair 184 172#define __NR_lsetxattr 72
173#define __NR_setresuid 185 173__SYSCALL( 72, sys_lsetxattr, 5)
174#define __NR_getresuid 186 174#define __NR_lgetxattr 73
175#define __NR_query_module 187 175__SYSCALL( 73, sys_lgetxattr, 4)
176#define __NR_poll 188 176#define __NR_llistxattr 74
177#define __NR_nfsservctl 189 177__SYSCALL( 74, sys_llistxattr, 3)
178#define __NR_setresgid 190 178#define __NR_lremovexattr 75
179#define __NR_getresgid 191 179__SYSCALL( 75, sys_lremovexattr, 2)
180#define __NR_prctl 192 180#define __NR_fsetxattr 76
181#define __NR_rt_sigreturn 193 181__SYSCALL( 76, sys_fsetxattr, 5)
182#define __NR_rt_sigaction 194 182#define __NR_fgetxattr 77
183#define __NR_rt_sigprocmask 195 183__SYSCALL( 77, sys_fgetxattr, 4)
184#define __NR_rt_sigpending 196 184#define __NR_flistxattr 78
185#define __NR_rt_sigtimedwait 197 185__SYSCALL( 78, sys_flistxattr, 3)
186#define __NR_rt_sigqueueinfo 198 186#define __NR_fremovexattr 79
187#define __NR_rt_sigsuspend 199 187__SYSCALL( 79, sys_fremovexattr, 2)
188#define __NR_pread 200 188
189#define __NR_pwrite 201 189/* File Map / Shared Memory Operations */
190#define __NR_chown 202 190
191#define __NR_getcwd 203 191#define __NR_mmap2 80
192#define __NR_capget 204 192__SYSCALL( 80, xtensa_mmap2, 6)
193#define __NR_capset 205 193#define __NR_munmap 81
194#define __NR_sigaltstack 206 194__SYSCALL( 81, sys_munmap, 2)
195#define __NR_sendfile 207 195#define __NR_mprotect 82
196#define __NR_mmap2 210 196__SYSCALL( 82, sys_mprotect, 3)
197#define __NR_truncate64 211 197#define __NR_brk 83
198#define __NR_ftruncate64 212 198__SYSCALL( 83, sys_brk, 1)
199#define __NR_stat64 213 199#define __NR_mlock 84
200#define __NR_lstat64 214 200__SYSCALL( 84, sys_mlock, 2)
201#define __NR_fstat64 215 201#define __NR_munlock 85
202#define __NR_pivot_root 216 202__SYSCALL( 85, sys_munlock, 2)
203#define __NR_mincore 217 203#define __NR_mlockall 86
204#define __NR_madvise 218 204__SYSCALL( 86, sys_mlockall, 1)
205#define __NR_getdents64 219 205#define __NR_munlockall 87
206 206__SYSCALL( 87, sys_munlockall, 0)
207/* Keep this last; should always equal the last valid call number. */ 207#define __NR_mremap 88
208#define __NR_Linux_syscalls 220 208__SYSCALL( 88, sys_mremap, 4)
209 209#define __NR_msync 89
210/* user-visible error numbers are in the range -1 - -125: see 210__SYSCALL( 89, sys_msync, 3)
211 * <asm-xtensa/errno.h> */ 211#define __NR_mincore 90
212 212__SYSCALL( 90, sys_mincore, 3)
213#define SYSXTENSA_RESERVED 0 /* don't use this */ 213#define __NR_madvise 91
214#define SYSXTENSA_ATOMIC_SET 1 /* set variable */ 214__SYSCALL( 91, sys_madvise, 3)
215#define SYSXTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */ 215#define __NR_shmget 92
216#define SYSXTENSA_ATOMIC_ADD 3 /* add to memory */ 216__SYSCALL( 92, sys_shmget, 4)
217#define SYSXTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */ 217#define __NR_shmat 93
218 218__SYSCALL( 93, xtensa_shmat, 4)
219#define SYSXTENSA_COUNT 5 /* count of syscall0 functions*/ 219#define __NR_shmctl 94
220__SYSCALL( 94, sys_shmctl, 4)
221#define __NR_shmdt 95
222__SYSCALL( 95, sys_shmdt, 4)
223
224/* Socket Operations */
225
226#define __NR_socket 96
227__SYSCALL( 96, sys_socket, 3)
228#define __NR_setsockopt 97
229__SYSCALL( 97, sys_setsockopt, 5)
230#define __NR_getsockopt 98
231__SYSCALL( 98, sys_getsockopt, 5)
232#define __NR_shutdown 99
233__SYSCALL( 99, sys_shutdown, 2)
234
235#define __NR_bind 100
236__SYSCALL(100, sys_bind, 3)
237#define __NR_connect 101
238__SYSCALL(101, sys_connect, 3)
239#define __NR_listen 102
240__SYSCALL(102, sys_listen, 2)
241#define __NR_accept 103
242__SYSCALL(103, sys_accept, 3)
243
244#define __NR_getsockname 104
245__SYSCALL(104, sys_getsockname, 3)
246#define __NR_getpeername 105
247__SYSCALL(105, sys_getpeername, 3)
248#define __NR_sendmsg 106
249__SYSCALL(106, sys_sendmsg, 3)
250#define __NR_recvmsg 107
251__SYSCALL(107, sys_recvmsg, 3)
252#define __NR_send 108
253__SYSCALL(108, sys_send, 4)
254#define __NR_recv 109
255__SYSCALL(109, sys_recv, 4)
256#define __NR_sendto 110
257__SYSCALL(110, sys_sendto, 6)
258#define __NR_recvfrom 111
259__SYSCALL(111, sys_recvfrom, 6)
260
261#define __NR_socketpair 112
262__SYSCALL(112, sys_socketpair, 4)
263#define __NR_sendfile 113
264__SYSCALL(113, sys_sendfile, 4)
265#define __NR_sendfile64 114
266__SYSCALL(114, sys_sendfile64, 4)
267#define __NR_available115 115
268__SYSCALL(115, sys_ni_syscall, 0)
269
270/* Process Operations */
271
272#define __NR_clone 116
273__SYSCALL(116, xtensa_clone, 5)
274#define __NR_execve 117
275__SYSCALL(117, xtensa_execve, 3)
276#define __NR_exit 118
277__SYSCALL(118, sys_exit, 1)
278#define __NR_exit_group 119
279__SYSCALL(119, sys_exit_group, 1)
280#define __NR_getpid 120
281__SYSCALL(120, sys_getpid, 0)
282#define __NR_wait4 121
283__SYSCALL(121, sys_wait4, 4)
284#define __NR_waitid 122
285__SYSCALL(122, sys_waitid, 5)
286#define __NR_kill 123
287__SYSCALL(123, sys_kill, 2)
288#define __NR_tkill 124
289__SYSCALL(124, sys_tkill, 2)
290#define __NR_tgkill 125
291__SYSCALL(125, sys_tgkill, 3)
292#define __NR_set_tid_address 126
293__SYSCALL(126, sys_set_tid_address, 1)
294#define __NR_gettid 127
295__SYSCALL(127, sys_gettid, 0)
296#define __NR_setsid 128
297__SYSCALL(128, sys_setsid, 0)
298#define __NR_getsid 129
299__SYSCALL(129, sys_getsid, 1)
300#define __NR_prctl 130
301__SYSCALL(130, sys_prctl, 5)
302#define __NR_personality 131
303__SYSCALL(131, sys_personality, 1)
304#define __NR_getpriority 132
305__SYSCALL(132, sys_getpriority, 2)
306#define __NR_setpriority 133
307__SYSCALL(133, sys_setpriority, 3)
308#define __NR_setitimer 134
309__SYSCALL(134, sys_setitimer, 3)
310#define __NR_getitimer 135
311__SYSCALL(135, sys_getitimer, 2)
312#define __NR_setuid 136
313__SYSCALL(136, sys_setuid, 1)
314#define __NR_getuid 137
315__SYSCALL(137, sys_getuid, 0)
316#define __NR_setgid 138
317__SYSCALL(138, sys_setgid, 1)
318#define __NR_getgid 139
319__SYSCALL(139, sys_getgid, 0)
320#define __NR_geteuid 140
321__SYSCALL(140, sys_geteuid, 0)
322#define __NR_getegid 141
323__SYSCALL(141, sys_getegid, 0)
324#define __NR_setreuid 142
325__SYSCALL(142, sys_setreuid, 2)
326#define __NR_setregid 143
327__SYSCALL(143, sys_setregid, 2)
328#define __NR_setresuid 144
329__SYSCALL(144, sys_setresuid, 3)
330#define __NR_getresuid 145
331__SYSCALL(145, sys_getresuid, 3)
332#define __NR_setresgid 146
333__SYSCALL(146, sys_setresgid, 3)
334#define __NR_getresgid 147
335__SYSCALL(147, sys_getresgid, 3)
336#define __NR_setpgid 148
337__SYSCALL(148, sys_setpgid, 2)
338#define __NR_getpgid 149
339__SYSCALL(149, sys_getpgid, 1)
340#define __NR_getppid 150
341__SYSCALL(150, sys_getppid, 0)
342#define __NR_available151 151
343__SYSCALL(151, sys_ni_syscall, 0)
344
345#define __NR_reserved152 152 /* set_thread_area */
346__SYSCALL(152, sys_ni_syscall, 0)
347#define __NR_reserved153 153 /* get_thread_area */
348__SYSCALL(153, sys_ni_syscall, 0)
349#define __NR_times 154
350__SYSCALL(154, sys_times, 1)
351#define __NR_acct 155
352__SYSCALL(155, sys_acct, 1)
353#define __NR_sched_setaffinity 156
354__SYSCALL(156, sys_sched_setaffinity, 3)
355#define __NR_sched_getaffinity 157
356__SYSCALL(157, sys_sched_getaffinity, 3)
357#define __NR_capget 158
358__SYSCALL(158, sys_capget, 2)
359#define __NR_capset 159
360__SYSCALL(159, sys_capset, 2)
361#define __NR_ptrace 160
362__SYSCALL(160, sys_ptrace, 4)
363#define __NR_semtimedop 161
364__SYSCALL(161, sys_semtimedop, 5)
365#define __NR_semget 162
366__SYSCALL(162, sys_semget, 4)
367#define __NR_semop 163
368__SYSCALL(163, sys_semop, 4)
369#define __NR_semctl 164
370__SYSCALL(164, sys_semctl, 4)
371#define __NR_available165 165
372__SYSCALL(165, sys_ni_syscall, 0)
373#define __NR_msgget 166
374__SYSCALL(166, sys_msgget, 4)
375#define __NR_msgsnd 167
376__SYSCALL(167, sys_msgsnd, 4)
377#define __NR_msgrcv 168
378__SYSCALL(168, sys_msgrcv, 4)
379#define __NR_msgctl 169
380__SYSCALL(169, sys_msgctl, 4)
381#define __NR_available170 170
382__SYSCALL(170, sys_ni_syscall, 0)
383#define __NR_available171 171
384__SYSCALL(171, sys_ni_syscall, 0)
385
386/* File System */
387
388#define __NR_mount 172
389__SYSCALL(172, sys_mount, 5)
390#define __NR_swapon 173
391__SYSCALL(173, sys_swapon, 2)
392#define __NR_chroot 174
393__SYSCALL(174, sys_chroot, 1)
394#define __NR_pivot_root 175
395__SYSCALL(175, sys_pivot_root, 2)
396#define __NR_umount 176
397__SYSCALL(176, sys_umount, 2)
398#define __NR_swapoff 177
399__SYSCALL(177, sys_swapoff, 1)
400#define __NR_sync 178
401__SYSCALL(178, sys_sync, 0)
402#define __NR_available179 179
403__SYSCALL(179, sys_ni_syscall, 0)
404#define __NR_setfsuid 180
405__SYSCALL(180, sys_setfsuid, 1)
406#define __NR_setfsgid 181
407__SYSCALL(181, sys_setfsgid, 1)
408#define __NR_sysfs 182
409__SYSCALL(182, sys_sysfs, 3)
410#define __NR_ustat 183
411__SYSCALL(183, sys_ustat, 2)
412#define __NR_statfs 184
413__SYSCALL(184, sys_statfs, 2)
414#define __NR_fstatfs 185
415__SYSCALL(185, sys_fstatfs, 2)
416#define __NR_statfs64 186
417__SYSCALL(186, sys_statfs64, 3)
418#define __NR_fstatfs64 187
419__SYSCALL(187, sys_fstatfs64, 3)
420
421/* System */
422
423#define __NR_setrlimit 188
424__SYSCALL(188, sys_setrlimit, 2)
425#define __NR_getrlimit 189
426__SYSCALL(189, sys_getrlimit, 2)
427#define __NR_getrusage 190
428__SYSCALL(190, sys_getrusage, 2)
429#define __NR_futex 191
430__SYSCALL(191, sys_futex, 5)
431#define __NR_gettimeofday 192
432__SYSCALL(192, sys_gettimeofday, 2)
433#define __NR_settimeofday 193
434__SYSCALL(193, sys_settimeofday, 2)
435#define __NR_adjtimex 194
436__SYSCALL(194, sys_adjtimex, 1)
437#define __NR_nanosleep 195
438__SYSCALL(195, sys_nanosleep, 2)
439#define __NR_getgroups 196
440__SYSCALL(196, sys_getgroups, 2)
441#define __NR_setgroups 197
442__SYSCALL(197, sys_setgroups, 2)
443#define __NR_sethostname 198
444__SYSCALL(198, sys_sethostname, 2)
445#define __NR_setdomainname 199
446__SYSCALL(199, sys_setdomainname, 2)
447#define __NR_syslog 200
448__SYSCALL(200, sys_syslog, 3)
449#define __NR_vhangup 201
450__SYSCALL(201, sys_vhangup, 0)
451#define __NR_uselib 202
452__SYSCALL(202, sys_uselib, 1)
453#define __NR_reboot 203
454__SYSCALL(203, sys_reboot, 3)
455#define __NR_quotactl 204
456__SYSCALL(204, sys_quotactl, 4)
457#define __NR_nfsservctl 205
458__SYSCALL(205, sys_nfsservctl, 3)
459#define __NR__sysctl 206
460__SYSCALL(206, sys_sysctl, 1)
461#define __NR_bdflush 207
462__SYSCALL(207, sys_bdflush, 2)
463#define __NR_uname 208
464__SYSCALL(208, sys_newuname, 1)
465#define __NR_sysinfo 209
466__SYSCALL(209, sys_sysinfo, 1)
467#define __NR_init_module 210
468__SYSCALL(210, sys_init_module, 2)
469#define __NR_delete_module 211
470__SYSCALL(211, sys_delete_module, 1)
471
472#define __NR_sched_setparam 212
473__SYSCALL(212, sys_sched_setparam, 2)
474#define __NR_sched_getparam 213
475__SYSCALL(213, sys_sched_getparam, 2)
476#define __NR_sched_setscheduler 214
477__SYSCALL(214, sys_sched_setscheduler, 3)
478#define __NR_sched_getscheduler 215
479__SYSCALL(215, sys_sched_getscheduler, 1)
480#define __NR_sched_get_priority_max 216
481__SYSCALL(216, sys_sched_get_priority_max, 1)
482#define __NR_sched_get_priority_min 217
483__SYSCALL(217, sys_sched_get_priority_min, 1)
484#define __NR_sched_rr_get_interval 218
485__SYSCALL(218, sys_sched_rr_get_interval, 2)
486#define __NR_sched_yield 219
487__SYSCALL(219, sys_sched_yield, 0)
488#define __NR_sigreturn 222
489__SYSCALL(222, xtensa_sigreturn, 0)
490
491/* Signal Handling */
492
493#define __NR_restart_syscall 223
494__SYSCALL(223, sys_restart_syscall, 0)
495#define __NR_sigaltstack 224
496__SYSCALL(224, xtensa_sigaltstack, 2)
497#define __NR_rt_sigreturn 225
498__SYSCALL(225, xtensa_rt_sigreturn, 1)
499#define __NR_rt_sigaction 226
500__SYSCALL(226, sys_rt_sigaction, 4)
501#define __NR_rt_sigprocmask 227
502__SYSCALL(227, sys_rt_sigprocmask, 4)
503#define __NR_rt_sigpending 228
504__SYSCALL(228, sys_rt_sigpending, 2)
505#define __NR_rt_sigtimedwait 229
506__SYSCALL(229, sys_rt_sigtimedwait, 4)
507#define __NR_rt_sigqueueinfo 230
508__SYSCALL(230, sys_rt_sigqueueinfo, 3)
509#define __NR_rt_sigsuspend 231
510__SYSCALL(231, xtensa_rt_sigsuspend, 2)
511
512/* Message */
513
514#define __NR_mq_open 232
515__SYSCALL(232, sys_mq_open, 4)
516#define __NR_mq_unlink 233
517__SYSCALL(233, sys_mq_unlink, 1)
518#define __NR_mq_timedsend 234
519__SYSCALL(234, sys_mq_timedsend, 5)
520#define __NR_mq_timedreceive 235
521__SYSCALL(235, sys_mq_timedreceive, 5)
522#define __NR_mq_notify 236
523__SYSCALL(236, sys_mq_notify, 2)
524#define __NR_mq_getsetattr 237
525__SYSCALL(237, sys_mq_getsetattr, 3)
526#define __NR_available238 238
527__SYSCALL(238, sys_ni_syscall, 0)
528
529/* IO */
530
531#define __NR_io_setup 239
532__SYSCALL(239, sys_io_setup, 2)
533#define __NR_io_destroy 240
534__SYSCALL(240, sys_io_destroy, 1)
535#define __NR_io_submit 241
536__SYSCALL(241, sys_io_submit, 3)
537#define __NR_io_getevents 242
538__SYSCALL(242, sys_io_getevents, 5)
539#define __NR_io_cancel 243
540__SYSCALL(243, sys_io_cancel, 3)
541#define __NR_clock_settime 244
542__SYSCALL(244, sys_clock_settime, 2)
543#define __NR_clock_gettime 245
544__SYSCALL(245, sys_clock_gettime, 2)
545#define __NR_clock_getres 246
546__SYSCALL(246, sys_clock_getres, 2)
547#define __NR_clock_nanosleep 247
548__SYSCALL(247, sys_clock_nanosleep, 4)
549
550/* Timer */
551
552#define __NR_timer_create 248
553__SYSCALL(248, sys_timer_create, 3)
554#define __NR_timer_delete 249
555__SYSCALL(249, sys_timer_delete, 1)
556#define __NR_timer_settime 250
557__SYSCALL(250, sys_timer_settime, 4)
558#define __NR_timer_gettime 251
559__SYSCALL(251, sys_timer_gettime, 2)
560#define __NR_timer_getoverrun 252
561__SYSCALL(252, sys_timer_getoverrun, 1)
562
563/* System */
564
565#define __NR_reserved244 253
566__SYSCALL(253, sys_ni_syscall, 0)
567#define __NR_lookup_dcookie 254
568__SYSCALL(254, sys_lookup_dcookie, 4)
569#define __NR_available255 255
570__SYSCALL(255, sys_ni_syscall, 0)
571#define __NR_add_key 256
572__SYSCALL(256, sys_add_key, 5)
573#define __NR_request_key 257
574__SYSCALL(257, sys_request_key, 5)
575#define __NR_keyctl 258
576__SYSCALL(258, sys_keyctl, 5)
577#define __NR_available259 259
578__SYSCALL(259, sys_ni_syscall, 0)
579
580#define __NR_syscall_count 261
581
582/*
583 * sysxtensa syscall handler
584 *
585 * int sysxtensa (SYS_XTENSA_ATOMIC_SET, ptr, val, unused);
586 * int sysxtensa (SYS_XTENSA_ATOMIC_ADD, ptr, val, unused);
587 * int sysxtensa (SYS_XTENSA_ATOMIC_EXG_ADD, ptr, val, unused);
588 * int sysxtensa (SYS_XTENSA_ATOMIC_CMP_SWP, ptr, oldval, newval);
589 * a2 a6 a3 a4 a5
590 */
591
592#define SYS_XTENSA_RESERVED 0 /* don't use this */
593#define SYS_XTENSA_ATOMIC_SET 1 /* set variable */
594#define SYS_XTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */
595#define SYS_XTENSA_ATOMIC_ADD 3 /* add to memory */
596#define SYS_XTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */
597
598#define SYS_XTENSA_COUNT 5 /* count */
599
600#ifdef __KERNEL__
220 601
221/* 602/*
222 * "Conditional" syscalls 603 * "Conditional" syscalls
@@ -230,6 +611,9 @@
230#define __ARCH_WANT_SYS_UTIME 611#define __ARCH_WANT_SYS_UTIME
231#define __ARCH_WANT_SYS_LLSEEK 612#define __ARCH_WANT_SYS_LLSEEK
232#define __ARCH_WANT_SYS_RT_SIGACTION 613#define __ARCH_WANT_SYS_RT_SIGACTION
233#endif /* __KERNEL__ */ 614#define __ARCH_WANT_SYS_RT_SIGSUSPEND
615
616#endif /* __KERNEL__ */
234 617
235#endif /* _XTENSA_UNISTD_H */ 618#endif /* _XTENSA_UNISTD_H */
619
diff --git a/include/asm-xtensa/variant-fsf/core.h b/include/asm-xtensa/variant-fsf/core.h
new file mode 100644
index 000000000000..2f337605c744
--- /dev/null
+++ b/include/asm-xtensa/variant-fsf/core.h
@@ -0,0 +1,359 @@
1/*
2 * Xtensa processor core configuration information.
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) 1999-2006 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_CORE_H
12#define _XTENSA_CORE_H
13
14
15/****************************************************************************
16 Parameters Useful for Any Code, USER or PRIVILEGED
17 ****************************************************************************/
18
19/*
20 * Note: Macros of the form XCHAL_HAVE_*** have a value of 1 if the option is
21 * configured, and a value of 0 otherwise. These macros are always defined.
22 */
23
24
25/*----------------------------------------------------------------------
26 ISA
27 ----------------------------------------------------------------------*/
28
29#define XCHAL_HAVE_BE 1 /* big-endian byte ordering */
30#define XCHAL_HAVE_WINDOWED 1 /* windowed registers option */
31#define XCHAL_NUM_AREGS 64 /* num of physical addr regs */
32#define XCHAL_NUM_AREGS_LOG2 6 /* log2(XCHAL_NUM_AREGS) */
33#define XCHAL_MAX_INSTRUCTION_SIZE 3 /* max instr bytes (3..8) */
34#define XCHAL_HAVE_DEBUG 1 /* debug option */
35#define XCHAL_HAVE_DENSITY 1 /* 16-bit instructions */
36#define XCHAL_HAVE_LOOPS 1 /* zero-overhead loops */
37#define XCHAL_HAVE_NSA 1 /* NSA/NSAU instructions */
38#define XCHAL_HAVE_MINMAX 0 /* MIN/MAX instructions */
39#define XCHAL_HAVE_SEXT 0 /* SEXT instruction */
40#define XCHAL_HAVE_CLAMPS 0 /* CLAMPS instruction */
41#define XCHAL_HAVE_MUL16 0 /* MUL16S/MUL16U instructions */
42#define XCHAL_HAVE_MUL32 0 /* MULL instruction */
43#define XCHAL_HAVE_MUL32_HIGH 0 /* MULUH/MULSH instructions */
44#define XCHAL_HAVE_L32R 1 /* L32R instruction */
45#define XCHAL_HAVE_ABSOLUTE_LITERALS 1 /* non-PC-rel (extended) L32R */
46#define XCHAL_HAVE_CONST16 0 /* CONST16 instruction */
47#define XCHAL_HAVE_ADDX 1 /* ADDX#/SUBX# instructions */
48#define XCHAL_HAVE_WIDE_BRANCHES 0 /* B*.W18 or B*.W15 instr's */
49#define XCHAL_HAVE_PREDICTED_BRANCHES 0 /* B[EQ/EQZ/NE/NEZ]T instr's */
50#define XCHAL_HAVE_CALL4AND12 1 /* (obsolete option) */
51#define XCHAL_HAVE_ABS 1 /* ABS instruction */
52/*#define XCHAL_HAVE_POPC 0*/ /* POPC instruction */
53/*#define XCHAL_HAVE_CRC 0*/ /* CRC instruction */
54#define XCHAL_HAVE_RELEASE_SYNC 0 /* L32AI/S32RI instructions */
55#define XCHAL_HAVE_S32C1I 0 /* S32C1I instruction */
56#define XCHAL_HAVE_SPECULATION 0 /* speculation */
57#define XCHAL_HAVE_FULL_RESET 1 /* all regs/state reset */
58#define XCHAL_NUM_CONTEXTS 1 /* */
59#define XCHAL_NUM_MISC_REGS 2 /* num of scratch regs (0..4) */
60#define XCHAL_HAVE_TAP_MASTER 0 /* JTAG TAP control instr's */
61#define XCHAL_HAVE_PRID 1 /* processor ID register */
62#define XCHAL_HAVE_THREADPTR 1 /* THREADPTR register */
63#define XCHAL_HAVE_BOOLEANS 0 /* boolean registers */
64#define XCHAL_HAVE_CP 0 /* CPENABLE reg (coprocessor) */
65#define XCHAL_CP_MAXCFG 0 /* max allowed cp id plus one */
66#define XCHAL_HAVE_MAC16 0 /* MAC16 package */
67#define XCHAL_HAVE_VECTORFPU2005 0 /* vector floating-point pkg */
68#define XCHAL_HAVE_FP 0 /* floating point pkg */
69#define XCHAL_HAVE_VECTRA1 0 /* Vectra I pkg */
70#define XCHAL_HAVE_VECTRALX 0 /* Vectra LX pkg */
71#define XCHAL_HAVE_HIFI2 0 /* HiFi2 Audio Engine pkg */
72
73
74/*----------------------------------------------------------------------
75 MISC
76 ----------------------------------------------------------------------*/
77
78#define XCHAL_NUM_WRITEBUFFER_ENTRIES 4 /* size of write buffer */
79#define XCHAL_INST_FETCH_WIDTH 4 /* instr-fetch width in bytes */
80#define XCHAL_DATA_WIDTH 4 /* data width in bytes */
81/* In T1050, applies to selected core load and store instructions (see ISA): */
82#define XCHAL_UNALIGNED_LOAD_EXCEPTION 1 /* unaligned loads cause exc. */
83#define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* unaligned stores cause exc.*/
84
85#define XCHAL_CORE_ID "fsf" /* alphanum core name
86 (CoreID) set in the Xtensa
87 Processor Generator */
88
89#define XCHAL_BUILD_UNIQUE_ID 0x00006700 /* 22-bit sw build ID */
90
91/*
92 * These definitions describe the hardware targeted by this software.
93 */
94#define XCHAL_HW_CONFIGID0 0xC103C3FF /* ConfigID hi 32 bits*/
95#define XCHAL_HW_CONFIGID1 0x0C006700 /* ConfigID lo 32 bits*/
96#define XCHAL_HW_VERSION_NAME "LX2.0.0" /* full version name */
97#define XCHAL_HW_VERSION_MAJOR 2200 /* major ver# of targeted hw */
98#define XCHAL_HW_VERSION_MINOR 0 /* minor ver# of targeted hw */
99#define XTHAL_HW_REL_LX2 1
100#define XTHAL_HW_REL_LX2_0 1
101#define XTHAL_HW_REL_LX2_0_0 1
102#define XCHAL_HW_CONFIGID_RELIABLE 1
103/* If software targets a *range* of hardware versions, these are the bounds: */
104#define XCHAL_HW_MIN_VERSION_MAJOR 2200 /* major v of earliest tgt hw */
105#define XCHAL_HW_MIN_VERSION_MINOR 0 /* minor v of earliest tgt hw */
106#define XCHAL_HW_MAX_VERSION_MAJOR 2200 /* major v of latest tgt hw */
107#define XCHAL_HW_MAX_VERSION_MINOR 0 /* minor v of latest tgt hw */
108
109
110/*----------------------------------------------------------------------
111 CACHE
112 ----------------------------------------------------------------------*/
113
114#define XCHAL_ICACHE_LINESIZE 16 /* I-cache line size in bytes */
115#define XCHAL_DCACHE_LINESIZE 16 /* D-cache line size in bytes */
116#define XCHAL_ICACHE_LINEWIDTH 4 /* log2(I line size in bytes) */
117#define XCHAL_DCACHE_LINEWIDTH 4 /* log2(D line size in bytes) */
118
119#define XCHAL_ICACHE_SIZE 8192 /* I-cache size in bytes or 0 */
120#define XCHAL_DCACHE_SIZE 8192 /* D-cache size in bytes or 0 */
121
122#define XCHAL_DCACHE_IS_WRITEBACK 0 /* writeback feature */
123
124
125
126
127/****************************************************************************
128 Parameters Useful for PRIVILEGED (Supervisory or Non-Virtualized) Code
129 ****************************************************************************/
130
131
132#ifndef XTENSA_HAL_NON_PRIVILEGED_ONLY
133
134/*----------------------------------------------------------------------
135 CACHE
136 ----------------------------------------------------------------------*/
137
138#define XCHAL_HAVE_PIF 1 /* any outbound PIF present */
139
140/* If present, cache size in bytes == (ways * 2^(linewidth + setwidth)). */
141
142/* Number of cache sets in log2(lines per way): */
143#define XCHAL_ICACHE_SETWIDTH 8
144#define XCHAL_DCACHE_SETWIDTH 8
145
146/* Cache set associativity (number of ways): */
147#define XCHAL_ICACHE_WAYS 2
148#define XCHAL_DCACHE_WAYS 2
149
150/* Cache features: */
151#define XCHAL_ICACHE_LINE_LOCKABLE 0
152#define XCHAL_DCACHE_LINE_LOCKABLE 0
153#define XCHAL_ICACHE_ECC_PARITY 0
154#define XCHAL_DCACHE_ECC_PARITY 0
155
156/* Number of encoded cache attr bits (see <xtensa/hal.h> for decoded bits): */
157#define XCHAL_CA_BITS 4
158
159
160/*----------------------------------------------------------------------
161 INTERNAL I/D RAM/ROMs and XLMI
162 ----------------------------------------------------------------------*/
163
164#define XCHAL_NUM_INSTROM 0 /* number of core instr. ROMs */
165#define XCHAL_NUM_INSTRAM 0 /* number of core instr. RAMs */
166#define XCHAL_NUM_DATAROM 0 /* number of core data ROMs */
167#define XCHAL_NUM_DATARAM 0 /* number of core data RAMs */
168#define XCHAL_NUM_URAM 0 /* number of core unified RAMs*/
169#define XCHAL_NUM_XLMI 0 /* number of core XLMI ports */
170
171
172/*----------------------------------------------------------------------
173 INTERRUPTS and TIMERS
174 ----------------------------------------------------------------------*/
175
176#define XCHAL_HAVE_INTERRUPTS 1 /* interrupt option */
177#define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* med/high-pri. interrupts */
178#define XCHAL_HAVE_NMI 0 /* non-maskable interrupt */
179#define XCHAL_HAVE_CCOUNT 1 /* CCOUNT reg. (timer option) */
180#define XCHAL_NUM_TIMERS 3 /* number of CCOMPAREn regs */
181#define XCHAL_NUM_INTERRUPTS 17 /* number of interrupts */
182#define XCHAL_NUM_INTERRUPTS_LOG2 5 /* ceil(log2(NUM_INTERRUPTS)) */
183#define XCHAL_NUM_EXTINTERRUPTS 10 /* num of external interrupts */
184#define XCHAL_NUM_INTLEVELS 4 /* number of interrupt levels
185 (not including level zero) */
186#define XCHAL_EXCM_LEVEL 1 /* level masked by PS.EXCM */
187 /* (always 1 in XEA1; levels 2 .. EXCM_LEVEL are "medium priority") */
188
189/* Masks of interrupts at each interrupt level: */
190#define XCHAL_INTLEVEL1_MASK 0x000064F9
191#define XCHAL_INTLEVEL2_MASK 0x00008902
192#define XCHAL_INTLEVEL3_MASK 0x00011204
193#define XCHAL_INTLEVEL4_MASK 0x00000000
194#define XCHAL_INTLEVEL5_MASK 0x00000000
195#define XCHAL_INTLEVEL6_MASK 0x00000000
196#define XCHAL_INTLEVEL7_MASK 0x00000000
197
198/* Masks of interrupts at each range 1..n of interrupt levels: */
199#define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x000064F9
200#define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x0000EDFB
201#define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x0001FFFF
202#define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x0001FFFF
203#define XCHAL_INTLEVEL5_ANDBELOW_MASK 0x0001FFFF
204#define XCHAL_INTLEVEL6_ANDBELOW_MASK 0x0001FFFF
205#define XCHAL_INTLEVEL7_ANDBELOW_MASK 0x0001FFFF
206
207/* Level of each interrupt: */
208#define XCHAL_INT0_LEVEL 1
209#define XCHAL_INT1_LEVEL 2
210#define XCHAL_INT2_LEVEL 3
211#define XCHAL_INT3_LEVEL 1
212#define XCHAL_INT4_LEVEL 1
213#define XCHAL_INT5_LEVEL 1
214#define XCHAL_INT6_LEVEL 1
215#define XCHAL_INT7_LEVEL 1
216#define XCHAL_INT8_LEVEL 2
217#define XCHAL_INT9_LEVEL 3
218#define XCHAL_INT10_LEVEL 1
219#define XCHAL_INT11_LEVEL 2
220#define XCHAL_INT12_LEVEL 3
221#define XCHAL_INT13_LEVEL 1
222#define XCHAL_INT14_LEVEL 1
223#define XCHAL_INT15_LEVEL 2
224#define XCHAL_INT16_LEVEL 3
225#define XCHAL_DEBUGLEVEL 4 /* debug interrupt level */
226#define XCHAL_HAVE_DEBUG_EXTERN_INT 0 /* OCD external db interrupt */
227
228/* Type of each interrupt: */
229#define XCHAL_INT0_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
230#define XCHAL_INT1_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
231#define XCHAL_INT2_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
232#define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
233#define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
234#define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
235#define XCHAL_INT6_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
236#define XCHAL_INT7_TYPE XTHAL_INTTYPE_EXTERN_EDGE
237#define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_EDGE
238#define XCHAL_INT9_TYPE XTHAL_INTTYPE_EXTERN_EDGE
239#define XCHAL_INT10_TYPE XTHAL_INTTYPE_TIMER
240#define XCHAL_INT11_TYPE XTHAL_INTTYPE_TIMER
241#define XCHAL_INT12_TYPE XTHAL_INTTYPE_TIMER
242#define XCHAL_INT13_TYPE XTHAL_INTTYPE_SOFTWARE
243#define XCHAL_INT14_TYPE XTHAL_INTTYPE_SOFTWARE
244#define XCHAL_INT15_TYPE XTHAL_INTTYPE_SOFTWARE
245#define XCHAL_INT16_TYPE XTHAL_INTTYPE_SOFTWARE
246
247/* Masks of interrupts for each type of interrupt: */
248#define XCHAL_INTTYPE_MASK_UNCONFIGURED 0xFFFE0000
249#define XCHAL_INTTYPE_MASK_SOFTWARE 0x0001E000
250#define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x00000380
251#define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x0000007F
252#define XCHAL_INTTYPE_MASK_TIMER 0x00001C00
253#define XCHAL_INTTYPE_MASK_NMI 0x00000000
254#define XCHAL_INTTYPE_MASK_WRITE_ERROR 0x00000000
255
256/* Interrupt numbers assigned to specific interrupt sources: */
257#define XCHAL_TIMER0_INTERRUPT 10 /* CCOMPARE0 */
258#define XCHAL_TIMER1_INTERRUPT 11 /* CCOMPARE1 */
259#define XCHAL_TIMER2_INTERRUPT 12 /* CCOMPARE2 */
260#define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED
261
262/* Interrupt numbers for levels at which only one interrupt is configured: */
263/* (There are many interrupts each at level(s) 1, 2, 3.) */
264
265
266/*
267 * External interrupt vectors/levels.
268 * These macros describe how Xtensa processor interrupt numbers
269 * (as numbered internally, eg. in INTERRUPT and INTENABLE registers)
270 * map to external BInterrupt<n> pins, for those interrupts
271 * configured as external (level-triggered, edge-triggered, or NMI).
272 * See the Xtensa processor databook for more details.
273 */
274
275/* Core interrupt numbers mapped to each EXTERNAL interrupt number: */
276#define XCHAL_EXTINT0_NUM 0 /* (intlevel 1) */
277#define XCHAL_EXTINT1_NUM 1 /* (intlevel 2) */
278#define XCHAL_EXTINT2_NUM 2 /* (intlevel 3) */
279#define XCHAL_EXTINT3_NUM 3 /* (intlevel 1) */
280#define XCHAL_EXTINT4_NUM 4 /* (intlevel 1) */
281#define XCHAL_EXTINT5_NUM 5 /* (intlevel 1) */
282#define XCHAL_EXTINT6_NUM 6 /* (intlevel 1) */
283#define XCHAL_EXTINT7_NUM 7 /* (intlevel 1) */
284#define XCHAL_EXTINT8_NUM 8 /* (intlevel 2) */
285#define XCHAL_EXTINT9_NUM 9 /* (intlevel 3) */
286
287
288/*----------------------------------------------------------------------
289 EXCEPTIONS and VECTORS
290 ----------------------------------------------------------------------*/
291
292#define XCHAL_XEA_VERSION 2 /* Xtensa Exception Architecture
293 number: 1 == XEA1 (old)
294 2 == XEA2 (new)
295 0 == XEAX (extern) */
296#define XCHAL_HAVE_XEA1 0 /* Exception Architecture 1 */
297#define XCHAL_HAVE_XEA2 1 /* Exception Architecture 2 */
298#define XCHAL_HAVE_XEAX 0 /* External Exception Arch. */
299#define XCHAL_HAVE_EXCEPTIONS 1 /* exception option */
300#define XCHAL_HAVE_MEM_ECC_PARITY 0 /* local memory ECC/parity */
301
302#define XCHAL_RESET_VECTOR_VADDR 0xFE000020
303#define XCHAL_RESET_VECTOR_PADDR 0xFE000020
304#define XCHAL_USER_VECTOR_VADDR 0xD0000220
305#define XCHAL_USER_VECTOR_PADDR 0x00000220
306#define XCHAL_KERNEL_VECTOR_VADDR 0xD0000200
307#define XCHAL_KERNEL_VECTOR_PADDR 0x00000200
308#define XCHAL_DOUBLEEXC_VECTOR_VADDR 0xD0000290
309#define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x00000290
310#define XCHAL_WINDOW_VECTORS_VADDR 0xD0000000
311#define XCHAL_WINDOW_VECTORS_PADDR 0x00000000
312#define XCHAL_INTLEVEL2_VECTOR_VADDR 0xD0000240
313#define XCHAL_INTLEVEL2_VECTOR_PADDR 0x00000240
314#define XCHAL_INTLEVEL3_VECTOR_VADDR 0xD0000250
315#define XCHAL_INTLEVEL3_VECTOR_PADDR 0x00000250
316#define XCHAL_INTLEVEL4_VECTOR_VADDR 0xFE000520
317#define XCHAL_INTLEVEL4_VECTOR_PADDR 0xFE000520
318#define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL4_VECTOR_VADDR
319#define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL4_VECTOR_PADDR
320
321
322/*----------------------------------------------------------------------
323 DEBUG
324 ----------------------------------------------------------------------*/
325
326#define XCHAL_HAVE_OCD 1 /* OnChipDebug option */
327#define XCHAL_NUM_IBREAK 2 /* number of IBREAKn regs */
328#define XCHAL_NUM_DBREAK 2 /* number of DBREAKn regs */
329#define XCHAL_HAVE_OCD_DIR_ARRAY 1 /* faster OCD option */
330
331
332/*----------------------------------------------------------------------
333 MMU
334 ----------------------------------------------------------------------*/
335
336/* See <xtensa/config/core-matmap.h> header file for more details. */
337
338#define XCHAL_HAVE_TLBS 1 /* inverse of HAVE_CACHEATTR */
339#define XCHAL_HAVE_SPANNING_WAY 0 /* one way maps I+D 4GB vaddr */
340#define XCHAL_HAVE_IDENTITY_MAP 0 /* vaddr == paddr always */
341#define XCHAL_HAVE_CACHEATTR 0 /* CACHEATTR register present */
342#define XCHAL_HAVE_MIMIC_CACHEATTR 0 /* region protection */
343#define XCHAL_HAVE_XLT_CACHEATTR 0 /* region prot. w/translation */
344#define XCHAL_HAVE_PTP_MMU 1 /* full MMU (with page table
345 [autorefill] and protection)
346 usable for an MMU-based OS */
347/* If none of the above last 4 are set, it's a custom TLB configuration. */
348#define XCHAL_ITLB_ARF_ENTRIES_LOG2 2 /* log2(autorefill way size) */
349#define XCHAL_DTLB_ARF_ENTRIES_LOG2 2 /* log2(autorefill way size) */
350
351#define XCHAL_MMU_ASID_BITS 8 /* number of bits in ASIDs */
352#define XCHAL_MMU_RINGS 4 /* number of rings (1..4) */
353#define XCHAL_MMU_RING_BITS 2 /* num of bits in RING field */
354
355#endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */
356
357
358#endif /* _XTENSA_CORE_CONFIGURATION_H */
359
diff --git a/include/asm-xtensa/variant-fsf/tie.h b/include/asm-xtensa/variant-fsf/tie.h
new file mode 100644
index 000000000000..a73c71664918
--- /dev/null
+++ b/include/asm-xtensa/variant-fsf/tie.h
@@ -0,0 +1,22 @@
1/*
2 * Xtensa processor core configuration information.
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) 1999-2006 Tensilica Inc.
9 */
10
11#ifndef XTENSA_TIE_H
12#define XTENSA_TIE_H
13
14/*----------------------------------------------------------------------
15 COPROCESSORS and EXTRA STATE
16 ----------------------------------------------------------------------*/
17
18#define XCHAL_CP_NUM 0 /* number of coprocessors */
19#define XCHAL_CP_MASK 0x00
20
21#endif /*XTENSA_CONFIG_TIE_H*/
22
diff --git a/include/asm-xtensa/xtensa/cacheasm.h b/include/asm-xtensa/xtensa/cacheasm.h
deleted file mode 100644
index 0cdbb0bf180e..000000000000
--- a/include/asm-xtensa/xtensa/cacheasm.h
+++ /dev/null
@@ -1,708 +0,0 @@
1#ifndef XTENSA_CACHEASM_H
2#define XTENSA_CACHEASM_H
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/cacheasm.h -- assembler-specific cache
8 * related definitions that depend on CORE configuration.
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file "COPYING" in the main directory of this archive
12 * for more details.
13 *
14 * Copyright (C) 2002 Tensilica Inc.
15 */
16
17
18#include <xtensa/coreasm.h>
19
20
21/*
22 * This header file defines assembler macros of the form:
23 * <x>cache_<func>
24 * where <x> is 'i' or 'd' for instruction and data caches,
25 * and <func> indicates the function of the macro.
26 *
27 * The following functions <func> are defined,
28 * and apply only to the specified cache (I or D):
29 *
30 * reset
31 * Resets the cache.
32 *
33 * sync
34 * Makes sure any previous cache instructions have been completed;
35 * ie. makes sure any previous cache control operations
36 * have had full effect and been synchronized to memory.
37 * Eg. any invalidate completed [so as not to generate a hit],
38 * any writebacks or other pipelined writes written to memory, etc.
39 *
40 * invalidate_line (single cache line)
41 * invalidate_region (specified memory range)
42 * invalidate_all (entire cache)
43 * Invalidates all cache entries that cache
44 * data from the specified memory range.
45 * NOTE: locked entries are not invalidated.
46 *
47 * writeback_line (single cache line)
48 * writeback_region (specified memory range)
49 * writeback_all (entire cache)
50 * Writes back to memory all dirty cache entries
51 * that cache data from the specified memory range,
52 * and marks these entries as clean.
53 * NOTE: on some future implementations, this might
54 * also invalidate.
55 * NOTE: locked entries are written back, but never invalidated.
56 * NOTE: instruction caches never implement writeback.
57 *
58 * writeback_inv_line (single cache line)
59 * writeback_inv_region (specified memory range)
60 * writeback_inv_all (entire cache)
61 * Writes back to memory all dirty cache entries
62 * that cache data from the specified memory range,
63 * and invalidates these entries (including all clean
64 * cache entries that cache data from that range).
65 * NOTE: locked entries are written back but not invalidated.
66 * NOTE: instruction caches never implement writeback.
67 *
68 * lock_line (single cache line)
69 * lock_region (specified memory range)
70 * Prefetch and lock the specified memory range into cache.
71 * NOTE: if any part of the specified memory range cannot
72 * be locked, a ??? exception occurs. These macros don't
73 * do anything special (yet anyway) to handle this situation.
74 *
75 * unlock_line (single cache line)
76 * unlock_region (specified memory range)
77 * unlock_all (entire cache)
78 * Unlock cache entries that cache the specified memory range.
79 * Entries not already locked are unaffected.
80 */
81
82
83
84/*************************** GENERIC -- ALL CACHES ***************************/
85
86
87/*
88 * The following macros assume the following cache size/parameter limits
89 * in the current Xtensa core implementation:
90 * cache size: 1024 bytes minimum
91 * line size: 16 - 64 bytes
92 * way count: 1 - 4
93 *
94 * Minimum entries per way (ie. per associativity) = 1024 / 64 / 4 = 4
95 * Hence the assumption that each loop can execute four cache instructions.
96 *
97 * Correspondingly, the offset range of instructions is assumed able to cover
98 * four lines, ie. offsets {0,1,2,3} * line_size are assumed valid for
99 * both hit and indexed cache instructions. Ie. these offsets are all
100 * valid: 0, 16, 32, 48, 64, 96, 128, 192 (for line sizes 16, 32, 64).
101 * This is true of all original cache instructions
102 * (dhi, ihi, dhwb, dhwbi, dii, iii) which have offsets
103 * of 0 to 1020 in multiples of 4 (ie. 8 bits shifted by 2).
104 * This is also true of subsequent cache instructions
105 * (dhu, ihu, diu, iiu, diwb, diwbi, dpfl, ipfl) which have offsets
106 * of 0 to 240 in multiples of 16 (ie. 4 bits shifted by 4).
107 *
108 * (Maximum cache size, currently 32k, doesn't affect the following macros.
109 * Cache ways > MMU min page size cause aliasing but that's another matter.)
110 */
111
112
113
114/*
115 * Macro to apply an 'indexed' cache instruction to the entire cache.
116 *
117 * Parameters:
118 * cainst instruction/ that takes an address register parameter
119 * and an offset parameter (in range 0 .. 3*linesize).
120 * size size of cache in bytes
121 * linesize size of cache line in bytes
122 * assoc_or1 number of associativities (ways/sets) in cache
123 * if all sets affected by cainst,
124 * or 1 if only one set (or not all sets) of the cache
125 * is affected by cainst (eg. DIWB or DIWBI [not yet ISA defined]).
126 * aa, ab unique address registers (temporaries)
127 */
128
129 .macro cache_index_all cainst, size, linesize, assoc_or1, aa, ab
130
131 // Sanity-check on cache parameters:
132 .ifne (\size % (\linesize * \assoc_or1 * 4))
133 .err // cache configuration outside expected/supported range!
134 .endif
135
136 // \size byte cache, \linesize byte lines, \assoc_or1 way(s) affected by each \cainst.
137 movi \aa, (\size / (\linesize * \assoc_or1 * 4))
138 // Possible improvement: need only loop if \aa > 1 ;
139 // however that particular condition is highly unlikely.
140 movi \ab, 0 // to iterate over cache
141 floop \aa, cachex\@
142 \cainst \ab, 0*\linesize
143 \cainst \ab, 1*\linesize
144 \cainst \ab, 2*\linesize
145 \cainst \ab, 3*\linesize
146 addi \ab, \ab, 4*\linesize // move to next line
147 floopend \aa, cachex\@
148
149 .endm
150
151
152/*
153 * Macro to apply a 'hit' cache instruction to a memory region,
154 * ie. to any cache entries that cache a specified portion (region) of memory.
155 * Takes care of the unaligned cases, ie. may apply to one
156 * more cache line than $asize / lineSize if $aaddr is not aligned.
157 *
158 *
159 * Parameters are:
160 * cainst instruction/macro that takes an address register parameter
161 * and an offset parameter (currently always zero)
162 * and generates a cache instruction (eg. "dhi", "dhwb", "ihi", etc.)
163 * linesize_log2 log2(size of cache line in bytes)
164 * addr register containing start address of region (clobbered)
165 * asize register containing size of the region in bytes (clobbered)
166 * askew unique register used as temporary
167 *
168 * !?!?! 2DO: optimization: iterate max(cache_size and \asize) / linesize
169 */
170
171 .macro cache_hit_region cainst, linesize_log2, addr, asize, askew
172
173 // Make \asize the number of iterations:
174 extui \askew, \addr, 0, \linesize_log2 // get unalignment amount of \addr
175 add \asize, \asize, \askew // ... and add it to \asize
176 addi \asize, \asize, (1 << \linesize_log2) - 1 // round up!
177 srli \asize, \asize, \linesize_log2
178
179 // Iterate over region:
180 floopnez \asize, cacheh\@
181 \cainst \addr, 0
182 addi \addr, \addr, (1 << \linesize_log2) // move to next line
183 floopend \asize, cacheh\@
184
185 .endm
186
187
188
189
190
191/*************************** INSTRUCTION CACHE ***************************/
192
193
194/*
195 * Reset/initialize the instruction cache by simply invalidating it:
196 * (need to unlock first also, if cache locking implemented):
197 *
198 * Parameters:
199 * aa, ab unique address registers (temporaries)
200 */
201 .macro icache_reset aa, ab
202 icache_unlock_all \aa, \ab
203 icache_invalidate_all \aa, \ab
204 .endm
205
206
207/*
208 * Synchronize after an instruction cache operation,
209 * to be sure everything is in sync with memory as to be
210 * expected following any previous instruction cache control operations.
211 *
212 * Parameters are:
213 * ar an address register (temporary) (currently unused, but may be used in future)
214 */
215 .macro icache_sync ar
216#if XCHAL_ICACHE_SIZE > 0
217 isync
218#endif
219 .endm
220
221
222
223/*
224 * Invalidate a single line of the instruction cache.
225 * Parameters are:
226 * ar address register that contains (virtual) address to invalidate
227 * (may get clobbered in a future implementation, but not currently)
228 * offset (optional) offset to add to \ar to compute effective address to invalidate
229 * (note: some number of lsbits are ignored)
230 */
231 .macro icache_invalidate_line ar, offset
232#if XCHAL_ICACHE_SIZE > 0
233 ihi \ar, \offset // invalidate icache line
234 /*
235 * NOTE: in some version of the silicon [!!!SHOULD HAVE BEEN DOCUMENTED!!!]
236 * 'ihi' doesn't work, so it had been replaced with 'iii'
237 * (which would just invalidate more than it should,
238 * which should be okay other than the performance hit
239 * because cache locking did not exist in that version,
240 * unless user somehow relies on something being cached).
241 * [WHAT VERSION IS IT!!?!?
242 * IS THERE ANY WAY TO TEST FOR THAT HERE, TO OUTPUT 'III' ONLY IF NEEDED!?!?].
243 *
244 * iii \ar, \offset
245 */
246 icache_sync \ar
247#endif
248 .endm
249
250
251
252
253/*
254 * Invalidate instruction cache entries that cache a specified portion of memory.
255 * Parameters are:
256 * astart start address (register gets clobbered)
257 * asize size of the region in bytes (register gets clobbered)
258 * ac unique register used as temporary
259 */
260 .macro icache_invalidate_region astart, asize, ac
261#if XCHAL_ICACHE_SIZE > 0
262 // Instruction cache region invalidation:
263 cache_hit_region ihi, XCHAL_ICACHE_LINEWIDTH, \astart, \asize, \ac
264 icache_sync \ac
265 // End of instruction cache region invalidation
266#endif
267 .endm
268
269
270
271/*
272 * Invalidate entire instruction cache.
273 *
274 * Parameters:
275 * aa, ab unique address registers (temporaries)
276 */
277 .macro icache_invalidate_all aa, ab
278#if XCHAL_ICACHE_SIZE > 0
279 // Instruction cache invalidation:
280 cache_index_all iii, XCHAL_ICACHE_SIZE, XCHAL_ICACHE_LINESIZE, XCHAL_ICACHE_WAYS, \aa, \ab
281 icache_sync \aa
282 // End of instruction cache invalidation
283#endif
284 .endm
285
286
287
288/*
289 * Lock (prefetch & lock) a single line of the instruction cache.
290 *
291 * Parameters are:
292 * ar address register that contains (virtual) address to lock
293 * (may get clobbered in a future implementation, but not currently)
294 * offset offset to add to \ar to compute effective address to lock
295 * (note: some number of lsbits are ignored)
296 */
297 .macro icache_lock_line ar, offset
298#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE
299 ipfl \ar, \offset /* prefetch and lock icache line */
300 icache_sync \ar
301#endif
302 .endm
303
304
305
306/*
307 * Lock (prefetch & lock) a specified portion of memory into the instruction cache.
308 * Parameters are:
309 * astart start address (register gets clobbered)
310 * asize size of the region in bytes (register gets clobbered)
311 * ac unique register used as temporary
312 */
313 .macro icache_lock_region astart, asize, ac
314#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE
315 // Instruction cache region lock:
316 cache_hit_region ipfl, XCHAL_ICACHE_LINEWIDTH, \astart, \asize, \ac
317 icache_sync \ac
318 // End of instruction cache region lock
319#endif
320 .endm
321
322
323
324/*
325 * Unlock a single line of the instruction cache.
326 *
327 * Parameters are:
328 * ar address register that contains (virtual) address to unlock
329 * (may get clobbered in a future implementation, but not currently)
330 * offset offset to add to \ar to compute effective address to unlock
331 * (note: some number of lsbits are ignored)
332 */
333 .macro icache_unlock_line ar, offset
334#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE
335 ihu \ar, \offset /* unlock icache line */
336 icache_sync \ar
337#endif
338 .endm
339
340
341
342/*
343 * Unlock a specified portion of memory from the instruction cache.
344 * Parameters are:
345 * astart start address (register gets clobbered)
346 * asize size of the region in bytes (register gets clobbered)
347 * ac unique register used as temporary
348 */
349 .macro icache_unlock_region astart, asize, ac
350#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE
351 // Instruction cache region unlock:
352 cache_hit_region ihu, XCHAL_ICACHE_LINEWIDTH, \astart, \asize, \ac
353 icache_sync \ac
354 // End of instruction cache region unlock
355#endif
356 .endm
357
358
359
360/*
361 * Unlock entire instruction cache.
362 *
363 * Parameters:
364 * aa, ab unique address registers (temporaries)
365 */
366 .macro icache_unlock_all aa, ab
367#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE
368 // Instruction cache unlock:
369 cache_index_all iiu, XCHAL_ICACHE_SIZE, XCHAL_ICACHE_LINESIZE, 1, \aa, \ab
370 icache_sync \aa
371 // End of instruction cache unlock
372#endif
373 .endm
374
375
376
377
378
379/*************************** DATA CACHE ***************************/
380
381
382
383/*
384 * Reset/initialize the data cache by simply invalidating it
385 * (need to unlock first also, if cache locking implemented):
386 *
387 * Parameters:
388 * aa, ab unique address registers (temporaries)
389 */
390 .macro dcache_reset aa, ab
391 dcache_unlock_all \aa, \ab
392 dcache_invalidate_all \aa, \ab
393 .endm
394
395
396
397
398/*
399 * Synchronize after a data cache operation,
400 * to be sure everything is in sync with memory as to be
401 * expected following any previous data cache control operations.
402 *
403 * Parameters are:
404 * ar an address register (temporary) (currently unused, but may be used in future)
405 */
406 .macro dcache_sync ar
407#if XCHAL_DCACHE_SIZE > 0
408 // This previous sequence errs on the conservative side (too much so); a DSYNC should be sufficient:
409 //memw // synchronize data cache changes relative to subsequent memory accesses
410 //isync // be conservative and ISYNC as well (just to be sure)
411
412 dsync
413#endif
414 .endm
415
416
417
418/*
419 * Synchronize after a data store operation,
420 * to be sure the stored data is completely off the processor
421 * (and assuming there is no buffering outside the processor,
422 * that the data is in memory). This may be required to
423 * ensure that the processor's write buffers are emptied.
424 * A MEMW followed by a read guarantees this, by definition.
425 * We also try to make sure the read itself completes.
426 *
427 * Parameters are:
428 * ar an address register (temporary)
429 */
430 .macro write_sync ar
431 memw // ensure previous memory accesses are complete prior to subsequent memory accesses
432 l32i \ar, sp, 0 // completing this read ensures any previous write has completed, because of MEMW
433 //slot
434 add \ar, \ar, \ar // use the result of the read to help ensure the read completes (in future architectures)
435 .endm
436
437
438/*
439 * Invalidate a single line of the data cache.
440 * Parameters are:
441 * ar address register that contains (virtual) address to invalidate
442 * (may get clobbered in a future implementation, but not currently)
443 * offset (optional) offset to add to \ar to compute effective address to invalidate
444 * (note: some number of lsbits are ignored)
445 */
446 .macro dcache_invalidate_line ar, offset
447#if XCHAL_DCACHE_SIZE > 0
448 dhi \ar, \offset
449 dcache_sync \ar
450#endif
451 .endm
452
453
454
455
456
457/*
458 * Invalidate data cache entries that cache a specified portion of memory.
459 * Parameters are:
460 * astart start address (register gets clobbered)
461 * asize size of the region in bytes (register gets clobbered)
462 * ac unique register used as temporary
463 */
464 .macro dcache_invalidate_region astart, asize, ac
465#if XCHAL_DCACHE_SIZE > 0
466 // Data cache region invalidation:
467 cache_hit_region dhi, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac
468 dcache_sync \ac
469 // End of data cache region invalidation
470#endif
471 .endm
472
473
474
475#if 0
476/*
477 * This is a work-around for a bug in SiChip1 (???).
478 * There should be a proper mechanism for not outputting
479 * these instructions when not needed.
480 * To enable work-around, uncomment this and replace 'dii'
481 * with 'dii_s1' everywhere, eg. in dcache_invalidate_all
482 * macro below.
483 */
484 .macro dii_s1 ar, offset
485 dii \ar, \offset
486 or \ar, \ar, \ar
487 or \ar, \ar, \ar
488 or \ar, \ar, \ar
489 or \ar, \ar, \ar
490 .endm
491#endif
492
493
494/*
495 * Invalidate entire data cache.
496 *
497 * Parameters:
498 * aa, ab unique address registers (temporaries)
499 */
500 .macro dcache_invalidate_all aa, ab
501#if XCHAL_DCACHE_SIZE > 0
502 // Data cache invalidation:
503 cache_index_all dii, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, XCHAL_DCACHE_WAYS, \aa, \ab
504 dcache_sync \aa
505 // End of data cache invalidation
506#endif
507 .endm
508
509
510
511/*
512 * Writeback a single line of the data cache.
513 * Parameters are:
514 * ar address register that contains (virtual) address to writeback
515 * (may get clobbered in a future implementation, but not currently)
516 * offset offset to add to \ar to compute effective address to writeback
517 * (note: some number of lsbits are ignored)
518 */
519 .macro dcache_writeback_line ar, offset
520#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK
521 dhwb \ar, \offset
522 dcache_sync \ar
523#endif
524 .endm
525
526
527
528/*
529 * Writeback dirty data cache entries that cache a specified portion of memory.
530 * Parameters are:
531 * astart start address (register gets clobbered)
532 * asize size of the region in bytes (register gets clobbered)
533 * ac unique register used as temporary
534 */
535 .macro dcache_writeback_region astart, asize, ac
536#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK
537 // Data cache region writeback:
538 cache_hit_region dhwb, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac
539 dcache_sync \ac
540 // End of data cache region writeback
541#endif
542 .endm
543
544
545
546/*
547 * Writeback entire data cache.
548 * Parameters:
549 * aa, ab unique address registers (temporaries)
550 */
551 .macro dcache_writeback_all aa, ab
552#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK
553 // Data cache writeback:
554 cache_index_all diwb, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, 1, \aa, \ab
555 dcache_sync \aa
556 // End of data cache writeback
557#endif
558 .endm
559
560
561
562/*
563 * Writeback and invalidate a single line of the data cache.
564 * Parameters are:
565 * ar address register that contains (virtual) address to writeback and invalidate
566 * (may get clobbered in a future implementation, but not currently)
567 * offset offset to add to \ar to compute effective address to writeback and invalidate
568 * (note: some number of lsbits are ignored)
569 */
570 .macro dcache_writeback_inv_line ar, offset
571#if XCHAL_DCACHE_SIZE > 0
572 dhwbi \ar, \offset /* writeback and invalidate dcache line */
573 dcache_sync \ar
574#endif
575 .endm
576
577
578
579/*
580 * Writeback and invalidate data cache entries that cache a specified portion of memory.
581 * Parameters are:
582 * astart start address (register gets clobbered)
583 * asize size of the region in bytes (register gets clobbered)
584 * ac unique register used as temporary
585 */
586 .macro dcache_writeback_inv_region astart, asize, ac
587#if XCHAL_DCACHE_SIZE > 0
588 // Data cache region writeback and invalidate:
589 cache_hit_region dhwbi, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac
590 dcache_sync \ac
591 // End of data cache region writeback and invalidate
592#endif
593 .endm
594
595
596
597/*
598 * Writeback and invalidate entire data cache.
599 * Parameters:
600 * aa, ab unique address registers (temporaries)
601 */
602 .macro dcache_writeback_inv_all aa, ab
603#if XCHAL_DCACHE_SIZE > 0
604 // Data cache writeback and invalidate:
605#if XCHAL_DCACHE_IS_WRITEBACK
606 cache_index_all diwbi, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, 1, \aa, \ab
607 dcache_sync \aa
608#else /*writeback*/
609 // Data cache does not support writeback, so just invalidate: */
610 dcache_invalidate_all \aa, \ab
611#endif /*writeback*/
612 // End of data cache writeback and invalidate
613#endif
614 .endm
615
616
617
618
619/*
620 * Lock (prefetch & lock) a single line of the data cache.
621 *
622 * Parameters are:
623 * ar address register that contains (virtual) address to lock
624 * (may get clobbered in a future implementation, but not currently)
625 * offset offset to add to \ar to compute effective address to lock
626 * (note: some number of lsbits are ignored)
627 */
628 .macro dcache_lock_line ar, offset
629#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE
630 dpfl \ar, \offset /* prefetch and lock dcache line */
631 dcache_sync \ar
632#endif
633 .endm
634
635
636
637/*
638 * Lock (prefetch & lock) a specified portion of memory into the data cache.
639 * Parameters are:
640 * astart start address (register gets clobbered)
641 * asize size of the region in bytes (register gets clobbered)
642 * ac unique register used as temporary
643 */
644 .macro dcache_lock_region astart, asize, ac
645#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE
646 // Data cache region lock:
647 cache_hit_region dpfl, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac
648 dcache_sync \ac
649 // End of data cache region lock
650#endif
651 .endm
652
653
654
655/*
656 * Unlock a single line of the data cache.
657 *
658 * Parameters are:
659 * ar address register that contains (virtual) address to unlock
660 * (may get clobbered in a future implementation, but not currently)
661 * offset offset to add to \ar to compute effective address to unlock
662 * (note: some number of lsbits are ignored)
663 */
664 .macro dcache_unlock_line ar, offset
665#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE
666 dhu \ar, \offset /* unlock dcache line */
667 dcache_sync \ar
668#endif
669 .endm
670
671
672
673/*
674 * Unlock a specified portion of memory from the data cache.
675 * Parameters are:
676 * astart start address (register gets clobbered)
677 * asize size of the region in bytes (register gets clobbered)
678 * ac unique register used as temporary
679 */
680 .macro dcache_unlock_region astart, asize, ac
681#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE
682 // Data cache region unlock:
683 cache_hit_region dhu, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac
684 dcache_sync \ac
685 // End of data cache region unlock
686#endif
687 .endm
688
689
690
691/*
692 * Unlock entire data cache.
693 *
694 * Parameters:
695 * aa, ab unique address registers (temporaries)
696 */
697 .macro dcache_unlock_all aa, ab
698#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE
699 // Data cache unlock:
700 cache_index_all diu, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, 1, \aa, \ab
701 dcache_sync \aa
702 // End of data cache unlock
703#endif
704 .endm
705
706
707#endif /*XTENSA_CACHEASM_H*/
708
diff --git a/include/asm-xtensa/xtensa/cacheattrasm.h b/include/asm-xtensa/xtensa/cacheattrasm.h
deleted file mode 100644
index 1c3e117b3592..000000000000
--- a/include/asm-xtensa/xtensa/cacheattrasm.h
+++ /dev/null
@@ -1,432 +0,0 @@
1#ifndef XTENSA_CACHEATTRASM_H
2#define XTENSA_CACHEATTRASM_H
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/cacheattrasm.h -- assembler-specific
8 * CACHEATTR register related definitions that depend on CORE
9 * configuration.
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
13 * for more details.
14 *
15 * Copyright (C) 2002 Tensilica Inc.
16 */
17
18
19#include <xtensa/coreasm.h>
20
21
22/*
23 * This header file defines assembler macros of the form:
24 * <x>cacheattr_<func>
25 * where:
26 * <x> is 'i', 'd' or absent for instruction, data
27 * or both caches; and
28 * <func> indicates the function of the macro.
29 *
30 * The following functions are defined:
31 *
32 * icacheattr_get
33 * Reads I-cache CACHEATTR into a2 (clobbers a3-a5).
34 *
35 * dcacheattr_get
36 * Reads D-cache CACHEATTR into a2 (clobbers a3-a5).
37 * (Note: for configs with a real CACHEATTR register, the
38 * above two macros are identical.)
39 *
40 * cacheattr_set
41 * Writes both I-cache and D-cache CACHEATTRs from a2 (a3-a8 clobbered).
42 * Works even when changing one's own code's attributes.
43 *
44 * icacheattr_is_enabled label
45 * Branches to \label if I-cache appears to have been enabled
46 * (eg. if CACHEATTR contains a cache-enabled attribute).
47 * (clobbers a2-a5,SAR)
48 *
49 * dcacheattr_is_enabled label
50 * Branches to \label if D-cache appears to have been enabled
51 * (eg. if CACHEATTR contains a cache-enabled attribute).
52 * (clobbers a2-a5,SAR)
53 *
54 * cacheattr_is_enabled label
55 * Branches to \label if either I-cache or D-cache appears to have been enabled
56 * (eg. if CACHEATTR contains a cache-enabled attribute).
57 * (clobbers a2-a5,SAR)
58 *
59 * The following macros are only defined under certain conditions:
60 *
61 * icacheattr_set (if XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR)
62 * Writes I-cache CACHEATTR from a2 (a3-a8 clobbered).
63 *
64 * dcacheattr_set (if XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR)
65 * Writes D-cache CACHEATTR from a2 (a3-a8 clobbered).
66 */
67
68
69
70/*************************** GENERIC -- ALL CACHES ***************************/
71
72/*
73 * _cacheattr_get
74 *
75 * (Internal macro.)
76 * Returns value of CACHEATTR register (or closest equivalent) in a2.
77 *
78 * Entry:
79 * (none)
80 * Exit:
81 * a2 value read from CACHEATTR
82 * a3-a5 clobbered (temporaries)
83 */
84 .macro _cacheattr_get tlb
85#if XCHAL_HAVE_CACHEATTR
86 rsr a2, CACHEATTR
87#elif XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
88 // We have a config that "mimics" CACHEATTR using a simplified
89 // "MMU" composed of a single statically-mapped way.
90 // DTLB and ITLB are independent, so there's no single
91 // cache attribute that can describe both. So for now
92 // just return the DTLB state.
93 movi a5, 0xE0000000
94 movi a2, 0
95 movi a3, 0
961: add a3, a3, a5 // next segment
97 r&tlb&1 a4, a3 // get PPN+CA of segment at 0xE0000000, 0xC0000000, ..., 0
98 dsync // interlock???
99 slli a2, a2, 4
100 extui a4, a4, 0, 4 // extract CA
101 or a2, a2, a4
102 bnez a3, 1b
103#else
104 // This macro isn't applicable to arbitrary MMU configurations.
105 // Just return zero.
106 movi a2, 0
107#endif
108 .endm
109
110 .macro icacheattr_get
111 _cacheattr_get itlb
112 .endm
113
114 .macro dcacheattr_get
115 _cacheattr_get dtlb
116 .endm
117
118
119#define XCHAL_CACHEATTR_ALL_BYPASS 0x22222222 /* default (powerup/reset) value of CACHEATTR, all BYPASS
120 mode (ie. disabled/bypassed caches) */
121
122#if XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
123
124#define XCHAL_FCA_ENAMASK 0x001A /* bitmap of fetch attributes that require enabled icache */
125#define XCHAL_LCA_ENAMASK 0x0003 /* bitmap of load attributes that require enabled dcache */
126#define XCHAL_SCA_ENAMASK 0x0003 /* bitmap of store attributes that require enabled dcache */
127#define XCHAL_LSCA_ENAMASK (XCHAL_LCA_ENAMASK|XCHAL_SCA_ENAMASK) /* l/s attrs requiring enabled dcache */
128#define XCHAL_ALLCA_ENAMASK (XCHAL_FCA_ENAMASK|XCHAL_LSCA_ENAMASK) /* all attrs requiring enabled caches */
129
130/*
131 * _cacheattr_is_enabled
132 *
133 * (Internal macro.)
134 * Branches to \label if CACHEATTR in a2 indicates an enabled
135 * cache, using mask in a3.
136 *
137 * Parameters:
138 * label where to branch to if cache is enabled
139 * Entry:
140 * a2 contains CACHEATTR value used to determine whether
141 * caches are enabled
142 * a3 16-bit constant where each bit correspond to
143 * one of the 16 possible CA values (in a CACHEATTR mask);
144 * CA values that indicate the cache is enabled
145 * have their corresponding bit set in this mask
146 * (eg. use XCHAL_xCA_ENAMASK , above)
147 * Exit:
148 * a2,a4,a5 clobbered
149 * SAR clobbered
150 */
151 .macro _cacheattr_is_enabled label
152 movi a4, 8 // loop 8 times
153.Lcaife\@:
154 extui a5, a2, 0, 4 // get CA nibble
155 ssr a5 // index into mask according to CA...
156 srl a5, a3 // ...and get CA's mask bit in a5 bit 0
157 bbsi.l a5, 0, \label // if CA indicates cache enabled, jump to label
158 srli a2, a2, 4 // next nibble
159 addi a4, a4, -1
160 bnez a4, .Lcaife\@ // loop for each nibble
161 .endm
162
163#else /* XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR */
164 .macro _cacheattr_is_enabled label
165 j \label // macro not applicable, assume caches always enabled
166 .endm
167#endif /* XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR */
168
169
170
171/*
172 * icacheattr_is_enabled
173 *
174 * Branches to \label if I-cache is enabled.
175 *
176 * Parameters:
177 * label where to branch to if icache is enabled
178 * Entry:
179 * (none)
180 * Exit:
181 * a2-a5, SAR clobbered (temporaries)
182 */
183 .macro icacheattr_is_enabled label
184#if XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
185 icacheattr_get
186 movi a3, XCHAL_FCA_ENAMASK
187#endif
188 _cacheattr_is_enabled \label
189 .endm
190
191/*
192 * dcacheattr_is_enabled
193 *
194 * Branches to \label if D-cache is enabled.
195 *
196 * Parameters:
197 * label where to branch to if dcache is enabled
198 * Entry:
199 * (none)
200 * Exit:
201 * a2-a5, SAR clobbered (temporaries)
202 */
203 .macro dcacheattr_is_enabled label
204#if XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
205 dcacheattr_get
206 movi a3, XCHAL_LSCA_ENAMASK
207#endif
208 _cacheattr_is_enabled \label
209 .endm
210
211/*
212 * cacheattr_is_enabled
213 *
214 * Branches to \label if either I-cache or D-cache is enabled.
215 *
216 * Parameters:
217 * label where to branch to if a cache is enabled
218 * Entry:
219 * (none)
220 * Exit:
221 * a2-a5, SAR clobbered (temporaries)
222 */
223 .macro cacheattr_is_enabled label
224#if XCHAL_HAVE_CACHEATTR
225 rsr a2, CACHEATTR
226 movi a3, XCHAL_ALLCA_ENAMASK
227#elif XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
228 icacheattr_get
229 movi a3, XCHAL_FCA_ENAMASK
230 _cacheattr_is_enabled \label
231 dcacheattr_get
232 movi a3, XCHAL_LSCA_ENAMASK
233#endif
234 _cacheattr_is_enabled \label
235 .endm
236
237
238
239/*
240 * The ISA does not have a defined way to change the
241 * instruction cache attributes of the running code,
242 * ie. of the memory area that encloses the current PC.
243 * However, each micro-architecture (or class of
244 * configurations within a micro-architecture)
245 * provides a way to deal with this issue.
246 *
247 * Here are a few macros used to implement the relevant
248 * approach taken.
249 */
250
251#if XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
252 // We have a config that "mimics" CACHEATTR using a simplified
253 // "MMU" composed of a single statically-mapped way.
254
255/*
256 * icacheattr_set
257 *
258 * Entry:
259 * a2 cacheattr value to set
260 * Exit:
261 * a2 unchanged
262 * a3-a8 clobbered (temporaries)
263 */
264 .macro icacheattr_set
265
266 movi a5, 0xE0000000 // mask of upper 3 bits
267 movi a6, 3f // PC where ITLB is set
268 movi a3, 0 // start at region 0 (0 .. 7)
269 and a6, a6, a5 // upper 3 bits of local PC area
270 mov a7, a2 // copy a2 so it doesn't get clobbered
271 j 3f
272
273# if XCHAL_HAVE_XLT_CACHEATTR
274 // Can do translations, use generic method:
2751: sub a6, a3, a5 // address of some other segment
276 ritlb1 a8, a6 // save its PPN+CA
277 dsync // interlock??
278 witlb a4, a6 // make it translate to this code area
279 movi a6, 5f // where to jump into it
280 isync
281 sub a6, a6, a5 // adjust jump address within that other segment
282 jx a6
283
284 // Note that in the following code snippet, which runs at a different virtual
285 // address than it is assembled for, we avoid using literals (eg. via movi/l32r)
286 // just in case literals end up in a different 512 MB segment, and we avoid
287 // instructions that rely on the current PC being what is expected.
288 //
289 .align 4
290 _j 6f // this is at label '5' minus 4 bytes
291 .align 4
2925: witlb a4, a3 // we're in other segment, now can write previous segment's CA
293 isync
294 add a6, a6, a5 // back to previous segment
295 addi a6, a6, -4 // next jump label
296 jx a6
297
2986: sub a6, a3, a5 // address of some other segment
299 witlb a8, a6 // restore PPN+CA of other segment
300 mov a6, a3 // restore a6
301 isync
302# else /* XCHAL_HAVE_XLT_CACHEATTR */
303 // Use micro-architecture specific method.
304 // The following 4-instruction sequence is aligned such that
305 // it all fits within a single I-cache line. Sixteen byte
306 // alignment is sufficient for this (using XCHAL_ICACHE_LINESIZE
307 // actually causes problems because that can be greater than
308 // the alignment of the reset vector, where this macro is often
309 // invoked, which would cause the linker to align the reset
310 // vector code away from the reset vector!!).
311 .align 16 /*XCHAL_ICACHE_LINESIZE*/
3121: _witlb a4, a3 // write wired PTE (CA, no PPN) of 512MB segment to ITLB
313 _isync
314 nop
315 nop
316# endif /* XCHAL_HAVE_XLT_CACHEATTR */
317 beq a3, a5, 4f // done?
318
319 // Note that in the WITLB loop, we don't do any load/stores
320 // (may not be an issue here, but it is important in the DTLB case).
3212: srli a7, a7, 4 // next CA
322 sub a3, a3, a5 // next segment (add 0x20000000)
3233:
324# if XCHAL_HAVE_XLT_CACHEATTR /* if have translation, preserve it */
325 ritlb1 a8, a3 // get current PPN+CA of segment
326 dsync // interlock???
327 extui a4, a7, 0, 4 // extract CA to set
328 srli a8, a8, 4 // clear CA but keep PPN ...
329 slli a8, a8, 4 // ...
330 add a4, a4, a8 // combine new CA with PPN to preserve
331# else
332 extui a4, a7, 0, 4 // extract CA
333# endif
334 beq a3, a6, 1b // current PC's region? if so, do it in a safe way
335 witlb a4, a3 // write wired PTE (CA [+PPN]) of 512MB segment to ITLB
336 bne a3, a5, 2b
337 isync // make sure all ifetch changes take effect
3384:
339 .endm // icacheattr_set
340
341
342/*
343 * dcacheattr_set
344 *
345 * Entry:
346 * a2 cacheattr value to set
347 * Exit:
348 * a2 unchanged
349 * a3-a8 clobbered (temporaries)
350 */
351
352 .macro dcacheattr_set
353
354 movi a5, 0xE0000000 // mask of upper 3 bits
355 movi a3, 0 // start at region 0 (0 .. 7)
356 mov a7, a2 // copy a2 so it doesn't get clobbered
357 j 3f
358 // Note that in the WDTLB loop, we don't do any load/stores
359 // (including implicit l32r via movi) because it isn't safe.
3602: srli a7, a7, 4 // next CA
361 sub a3, a3, a5 // next segment (add 0x20000000)
3623:
363# if XCHAL_HAVE_XLT_CACHEATTR /* if have translation, preserve it */
364 rdtlb1 a8, a3 // get current PPN+CA of segment
365 dsync // interlock???
366 extui a4, a7, 0, 4 // extract CA to set
367 srli a8, a8, 4 // clear CA but keep PPN ...
368 slli a8, a8, 4 // ...
369 add a4, a4, a8 // combine new CA with PPN to preserve
370# else
371 extui a4, a7, 0, 4 // extract CA to set
372# endif
373 wdtlb a4, a3 // write wired PTE (CA [+PPN]) of 512MB segment to DTLB
374 bne a3, a5, 2b
375 dsync // make sure all data path changes take effect
376 .endm // dcacheattr_set
377
378#endif /* XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR */
379
380
381
382/*
383 * cacheattr_set
384 *
385 * Macro that sets the current CACHEATTR safely
386 * (both i and d) according to the current contents of a2.
387 * It works even when changing the cache attributes of
388 * the currently running code.
389 *
390 * Entry:
391 * a2 cacheattr value to set
392 * Exit:
393 * a2 unchanged
394 * a3-a8 clobbered (temporaries)
395 */
396 .macro cacheattr_set
397
398#if XCHAL_HAVE_CACHEATTR
399# if XCHAL_ICACHE_LINESIZE < 4
400 // No i-cache, so can always safely write to CACHEATTR:
401 wsr a2, CACHEATTR
402# else
403 // The Athens micro-architecture, when using the old
404 // exception architecture option (ie. with the CACHEATTR register)
405 // allows changing the cache attributes of the running code
406 // using the following exact sequence aligned to be within
407 // an instruction cache line. (NOTE: using XCHAL_ICACHE_LINESIZE
408 // alignment actually causes problems because that can be greater
409 // than the alignment of the reset vector, where this macro is often
410 // invoked, which would cause the linker to align the reset
411 // vector code away from the reset vector!!).
412 j 1f
413 .align 16 /*XCHAL_ICACHE_LINESIZE*/ // align to within an I-cache line
4141: _wsr a2, CACHEATTR
415 _isync
416 nop
417 nop
418# endif
419#elif XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
420 // DTLB and ITLB are independent, but to keep semantics
421 // of this macro we simply write to both.
422 icacheattr_set
423 dcacheattr_set
424#else
425 // This macro isn't applicable to arbitrary MMU configurations.
426 // Do nothing in this case.
427#endif
428 .endm
429
430
431#endif /*XTENSA_CACHEATTRASM_H*/
432
diff --git a/include/asm-xtensa/xtensa/config-linux_be/core.h b/include/asm-xtensa/xtensa/config-linux_be/core.h
deleted file mode 100644
index d54fe5eb1064..000000000000
--- a/include/asm-xtensa/xtensa/config-linux_be/core.h
+++ /dev/null
@@ -1,1270 +0,0 @@
1/*
2 * xtensa/config/core.h -- HAL definitions that are dependent on CORE configuration
3 *
4 * This header file is sometimes referred to as the "compile-time HAL" or CHAL.
5 * It was generated for a specific Xtensa processor configuration.
6 *
7 * Source for configuration-independent binaries (which link in a
8 * configuration-specific HAL library) must NEVER include this file.
9 * It is perfectly normal, however, for the HAL source itself to include this file.
10 */
11
12/*
13 * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of version 2.1 of the GNU Lesser General Public
17 * License as published by the Free Software Foundation.
18 *
19 * This program is distributed in the hope that it would be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 *
23 * Further, this software is distributed without any warranty that it is
24 * free of the rightful claim of any third person regarding infringement
25 * or the like. Any license provided herein, whether implied or
26 * otherwise, applies only to this software file. Patent licenses, if
27 * any, provided herein do not apply to combinations of this program with
28 * other software, or any other product whatsoever.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this program; if not, write the Free Software
32 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
33 * USA.
34 */
35
36
37#ifndef XTENSA_CONFIG_CORE_H
38#define XTENSA_CONFIG_CORE_H
39
40#include <xtensa/hal.h>
41
42
43/*----------------------------------------------------------------------
44 GENERAL
45 ----------------------------------------------------------------------*/
46
47/*
48 * Separators for macros that expand into arrays.
49 * These can be predefined by files that #include this one,
50 * when different separators are required.
51 */
52/* Element separator for macros that expand into 1-dimensional arrays: */
53#ifndef XCHAL_SEP
54#define XCHAL_SEP ,
55#endif
56/* Array separator for macros that expand into 2-dimensional arrays: */
57#ifndef XCHAL_SEP2
58#define XCHAL_SEP2 },{
59#endif
60
61
62/*----------------------------------------------------------------------
63 ENDIANNESS
64 ----------------------------------------------------------------------*/
65
66#define XCHAL_HAVE_BE 1
67#define XCHAL_HAVE_LE 0
68#define XCHAL_MEMORY_ORDER XTHAL_BIGENDIAN
69
70
71/*----------------------------------------------------------------------
72 REGISTER WINDOWS
73 ----------------------------------------------------------------------*/
74
75#define XCHAL_HAVE_WINDOWED 1 /* 1 if windowed registers option configured, 0 otherwise */
76#define XCHAL_NUM_AREGS 64 /* number of physical address regs */
77#define XCHAL_NUM_AREGS_LOG2 6 /* log2(XCHAL_NUM_AREGS) */
78
79
80/*----------------------------------------------------------------------
81 ADDRESS ALIGNMENT
82 ----------------------------------------------------------------------*/
83
84/* These apply to a selected set of core load and store instructions only (see ISA): */
85#define XCHAL_UNALIGNED_LOAD_EXCEPTION 1 /* 1 if unaligned loads cause an exception, 0 otherwise */
86#define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* 1 if unaligned stores cause an exception, 0 otherwise */
87
88
89/*----------------------------------------------------------------------
90 INTERRUPTS
91 ----------------------------------------------------------------------*/
92
93#define XCHAL_HAVE_INTERRUPTS 1 /* 1 if interrupt option configured, 0 otherwise */
94#define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* 1 if high-priority interrupt option configured, 0 otherwise */
95#define XCHAL_HAVE_HIGHLEVEL_INTERRUPTS XCHAL_HAVE_HIGHPRI_INTERRUPTS
96#define XCHAL_HAVE_NMI 0 /* 1 if NMI option configured, 0 otherwise */
97#define XCHAL_NUM_INTERRUPTS 17 /* number of interrupts */
98#define XCHAL_NUM_INTERRUPTS_LOG2 5 /* number of bits to hold an interrupt number: roundup(log2(number of interrupts)) */
99#define XCHAL_NUM_EXTINTERRUPTS 10 /* number of external interrupts */
100#define XCHAL_NUM_INTLEVELS 4 /* number of interrupt levels (not including level zero!) */
101#define XCHAL_NUM_LOWPRI_LEVELS 1 /* number of low-priority interrupt levels (always 1) */
102#define XCHAL_FIRST_HIGHPRI_LEVEL (XCHAL_NUM_LOWPRI_LEVELS+1) /* level of first high-priority interrupt (always 2) */
103#define XCHAL_EXCM_LEVEL 1 /* level of interrupts masked by PS.EXCM (XEA2 only; always 1 in T10xx);
104 for XEA1, where there is no PS.EXCM, this is always 1;
105 interrupts at levels FIRST_HIGHPRI <= n <= EXCM_LEVEL, if any,
106 are termed "medium priority" interrupts (post T10xx only) */
107/* Note: 1 <= LOWPRI_LEVELS <= EXCM_LEVEL < DEBUGLEVEL <= NUM_INTLEVELS < NMILEVEL <= 15 */
108
109/* Masks of interrupts at each interrupt level: */
110#define XCHAL_INTLEVEL0_MASK 0x00000000
111#define XCHAL_INTLEVEL1_MASK 0x000064F9
112#define XCHAL_INTLEVEL2_MASK 0x00008902
113#define XCHAL_INTLEVEL3_MASK 0x00011204
114#define XCHAL_INTLEVEL4_MASK 0x00000000
115#define XCHAL_INTLEVEL5_MASK 0x00000000
116#define XCHAL_INTLEVEL6_MASK 0x00000000
117#define XCHAL_INTLEVEL7_MASK 0x00000000
118#define XCHAL_INTLEVEL8_MASK 0x00000000
119#define XCHAL_INTLEVEL9_MASK 0x00000000
120#define XCHAL_INTLEVEL10_MASK 0x00000000
121#define XCHAL_INTLEVEL11_MASK 0x00000000
122#define XCHAL_INTLEVEL12_MASK 0x00000000
123#define XCHAL_INTLEVEL13_MASK 0x00000000
124#define XCHAL_INTLEVEL14_MASK 0x00000000
125#define XCHAL_INTLEVEL15_MASK 0x00000000
126/* As an array of entries (eg. for C constant arrays): */
127#define XCHAL_INTLEVEL_MASKS 0x00000000 XCHAL_SEP \
128 0x000064F9 XCHAL_SEP \
129 0x00008902 XCHAL_SEP \
130 0x00011204 XCHAL_SEP \
131 0x00000000 XCHAL_SEP \
132 0x00000000 XCHAL_SEP \
133 0x00000000 XCHAL_SEP \
134 0x00000000 XCHAL_SEP \
135 0x00000000 XCHAL_SEP \
136 0x00000000 XCHAL_SEP \
137 0x00000000 XCHAL_SEP \
138 0x00000000 XCHAL_SEP \
139 0x00000000 XCHAL_SEP \
140 0x00000000 XCHAL_SEP \
141 0x00000000 XCHAL_SEP \
142 0x00000000
143
144/* Masks of interrupts at each range 1..n of interrupt levels: */
145#define XCHAL_INTLEVEL0_ANDBELOW_MASK 0x00000000
146#define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x000064F9
147#define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x0000EDFB
148#define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x0001FFFF
149#define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x0001FFFF
150#define XCHAL_INTLEVEL5_ANDBELOW_MASK 0x0001FFFF
151#define XCHAL_INTLEVEL6_ANDBELOW_MASK 0x0001FFFF
152#define XCHAL_INTLEVEL7_ANDBELOW_MASK 0x0001FFFF
153#define XCHAL_INTLEVEL8_ANDBELOW_MASK 0x0001FFFF
154#define XCHAL_INTLEVEL9_ANDBELOW_MASK 0x0001FFFF
155#define XCHAL_INTLEVEL10_ANDBELOW_MASK 0x0001FFFF
156#define XCHAL_INTLEVEL11_ANDBELOW_MASK 0x0001FFFF
157#define XCHAL_INTLEVEL12_ANDBELOW_MASK 0x0001FFFF
158#define XCHAL_INTLEVEL13_ANDBELOW_MASK 0x0001FFFF
159#define XCHAL_INTLEVEL14_ANDBELOW_MASK 0x0001FFFF
160#define XCHAL_INTLEVEL15_ANDBELOW_MASK 0x0001FFFF
161#define XCHAL_LOWPRI_MASK XCHAL_INTLEVEL1_ANDBELOW_MASK /* mask of all low-priority interrupts */
162#define XCHAL_EXCM_MASK XCHAL_INTLEVEL1_ANDBELOW_MASK /* mask of all interrupts masked by PS.EXCM (or CEXCM) */
163/* As an array of entries (eg. for C constant arrays): */
164#define XCHAL_INTLEVEL_ANDBELOW_MASKS 0x00000000 XCHAL_SEP \
165 0x000064F9 XCHAL_SEP \
166 0x0000EDFB XCHAL_SEP \
167 0x0001FFFF XCHAL_SEP \
168 0x0001FFFF XCHAL_SEP \
169 0x0001FFFF XCHAL_SEP \
170 0x0001FFFF XCHAL_SEP \
171 0x0001FFFF XCHAL_SEP \
172 0x0001FFFF XCHAL_SEP \
173 0x0001FFFF XCHAL_SEP \
174 0x0001FFFF XCHAL_SEP \
175 0x0001FFFF XCHAL_SEP \
176 0x0001FFFF XCHAL_SEP \
177 0x0001FFFF XCHAL_SEP \
178 0x0001FFFF XCHAL_SEP \
179 0x0001FFFF
180
181/* Interrupt numbers for each interrupt level at which only one interrupt was configured: */
182/*#define XCHAL_INTLEVEL1_NUM ...more than one interrupt at this level...*/
183/*#define XCHAL_INTLEVEL2_NUM ...more than one interrupt at this level...*/
184/*#define XCHAL_INTLEVEL3_NUM ...more than one interrupt at this level...*/
185
186/* Level of each interrupt: */
187#define XCHAL_INT0_LEVEL 1
188#define XCHAL_INT1_LEVEL 2
189#define XCHAL_INT2_LEVEL 3
190#define XCHAL_INT3_LEVEL 1
191#define XCHAL_INT4_LEVEL 1
192#define XCHAL_INT5_LEVEL 1
193#define XCHAL_INT6_LEVEL 1
194#define XCHAL_INT7_LEVEL 1
195#define XCHAL_INT8_LEVEL 2
196#define XCHAL_INT9_LEVEL 3
197#define XCHAL_INT10_LEVEL 1
198#define XCHAL_INT11_LEVEL 2
199#define XCHAL_INT12_LEVEL 3
200#define XCHAL_INT13_LEVEL 1
201#define XCHAL_INT14_LEVEL 1
202#define XCHAL_INT15_LEVEL 2
203#define XCHAL_INT16_LEVEL 3
204#define XCHAL_INT17_LEVEL 0
205#define XCHAL_INT18_LEVEL 0
206#define XCHAL_INT19_LEVEL 0
207#define XCHAL_INT20_LEVEL 0
208#define XCHAL_INT21_LEVEL 0
209#define XCHAL_INT22_LEVEL 0
210#define XCHAL_INT23_LEVEL 0
211#define XCHAL_INT24_LEVEL 0
212#define XCHAL_INT25_LEVEL 0
213#define XCHAL_INT26_LEVEL 0
214#define XCHAL_INT27_LEVEL 0
215#define XCHAL_INT28_LEVEL 0
216#define XCHAL_INT29_LEVEL 0
217#define XCHAL_INT30_LEVEL 0
218#define XCHAL_INT31_LEVEL 0
219/* As an array of entries (eg. for C constant arrays): */
220#define XCHAL_INT_LEVELS 1 XCHAL_SEP \
221 2 XCHAL_SEP \
222 3 XCHAL_SEP \
223 1 XCHAL_SEP \
224 1 XCHAL_SEP \
225 1 XCHAL_SEP \
226 1 XCHAL_SEP \
227 1 XCHAL_SEP \
228 2 XCHAL_SEP \
229 3 XCHAL_SEP \
230 1 XCHAL_SEP \
231 2 XCHAL_SEP \
232 3 XCHAL_SEP \
233 1 XCHAL_SEP \
234 1 XCHAL_SEP \
235 2 XCHAL_SEP \
236 3 XCHAL_SEP \
237 0 XCHAL_SEP \
238 0 XCHAL_SEP \
239 0 XCHAL_SEP \
240 0 XCHAL_SEP \
241 0 XCHAL_SEP \
242 0 XCHAL_SEP \
243 0 XCHAL_SEP \
244 0 XCHAL_SEP \
245 0 XCHAL_SEP \
246 0 XCHAL_SEP \
247 0 XCHAL_SEP \
248 0 XCHAL_SEP \
249 0 XCHAL_SEP \
250 0 XCHAL_SEP \
251 0
252
253/* Type of each interrupt: */
254#define XCHAL_INT0_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
255#define XCHAL_INT1_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
256#define XCHAL_INT2_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
257#define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
258#define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
259#define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
260#define XCHAL_INT6_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
261#define XCHAL_INT7_TYPE XTHAL_INTTYPE_EXTERN_EDGE
262#define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_EDGE
263#define XCHAL_INT9_TYPE XTHAL_INTTYPE_EXTERN_EDGE
264#define XCHAL_INT10_TYPE XTHAL_INTTYPE_TIMER
265#define XCHAL_INT11_TYPE XTHAL_INTTYPE_TIMER
266#define XCHAL_INT12_TYPE XTHAL_INTTYPE_TIMER
267#define XCHAL_INT13_TYPE XTHAL_INTTYPE_SOFTWARE
268#define XCHAL_INT14_TYPE XTHAL_INTTYPE_SOFTWARE
269#define XCHAL_INT15_TYPE XTHAL_INTTYPE_SOFTWARE
270#define XCHAL_INT16_TYPE XTHAL_INTTYPE_SOFTWARE
271#define XCHAL_INT17_TYPE XTHAL_INTTYPE_UNCONFIGURED
272#define XCHAL_INT18_TYPE XTHAL_INTTYPE_UNCONFIGURED
273#define XCHAL_INT19_TYPE XTHAL_INTTYPE_UNCONFIGURED
274#define XCHAL_INT20_TYPE XTHAL_INTTYPE_UNCONFIGURED
275#define XCHAL_INT21_TYPE XTHAL_INTTYPE_UNCONFIGURED
276#define XCHAL_INT22_TYPE XTHAL_INTTYPE_UNCONFIGURED
277#define XCHAL_INT23_TYPE XTHAL_INTTYPE_UNCONFIGURED
278#define XCHAL_INT24_TYPE XTHAL_INTTYPE_UNCONFIGURED
279#define XCHAL_INT25_TYPE XTHAL_INTTYPE_UNCONFIGURED
280#define XCHAL_INT26_TYPE XTHAL_INTTYPE_UNCONFIGURED
281#define XCHAL_INT27_TYPE XTHAL_INTTYPE_UNCONFIGURED
282#define XCHAL_INT28_TYPE XTHAL_INTTYPE_UNCONFIGURED
283#define XCHAL_INT29_TYPE XTHAL_INTTYPE_UNCONFIGURED
284#define XCHAL_INT30_TYPE XTHAL_INTTYPE_UNCONFIGURED
285#define XCHAL_INT31_TYPE XTHAL_INTTYPE_UNCONFIGURED
286/* As an array of entries (eg. for C constant arrays): */
287#define XCHAL_INT_TYPES XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
288 XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
289 XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
290 XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
291 XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
292 XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
293 XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
294 XTHAL_INTTYPE_EXTERN_EDGE XCHAL_SEP \
295 XTHAL_INTTYPE_EXTERN_EDGE XCHAL_SEP \
296 XTHAL_INTTYPE_EXTERN_EDGE XCHAL_SEP \
297 XTHAL_INTTYPE_TIMER XCHAL_SEP \
298 XTHAL_INTTYPE_TIMER XCHAL_SEP \
299 XTHAL_INTTYPE_TIMER XCHAL_SEP \
300 XTHAL_INTTYPE_SOFTWARE XCHAL_SEP \
301 XTHAL_INTTYPE_SOFTWARE XCHAL_SEP \
302 XTHAL_INTTYPE_SOFTWARE XCHAL_SEP \
303 XTHAL_INTTYPE_SOFTWARE XCHAL_SEP \
304 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
305 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
306 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
307 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
308 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
309 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
310 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
311 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
312 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
313 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
314 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
315 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
316 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
317 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
318 XTHAL_INTTYPE_UNCONFIGURED
319
320/* Masks of interrupts for each type of interrupt: */
321#define XCHAL_INTTYPE_MASK_UNCONFIGURED 0xFFFE0000
322#define XCHAL_INTTYPE_MASK_SOFTWARE 0x0001E000
323#define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x00000380
324#define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x0000007F
325#define XCHAL_INTTYPE_MASK_TIMER 0x00001C00
326#define XCHAL_INTTYPE_MASK_NMI 0x00000000
327/* As an array of entries (eg. for C constant arrays): */
328#define XCHAL_INTTYPE_MASKS 0xFFFE0000 XCHAL_SEP \
329 0x0001E000 XCHAL_SEP \
330 0x00000380 XCHAL_SEP \
331 0x0000007F XCHAL_SEP \
332 0x00001C00 XCHAL_SEP \
333 0x00000000
334
335/* Interrupts assigned to each timer (CCOMPARE0 to CCOMPARE3), -1 if unassigned */
336#define XCHAL_TIMER0_INTERRUPT 10
337#define XCHAL_TIMER1_INTERRUPT 11
338#define XCHAL_TIMER2_INTERRUPT 12
339#define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED
340/* As an array of entries (eg. for C constant arrays): */
341#define XCHAL_TIMER_INTERRUPTS 10 XCHAL_SEP \
342 11 XCHAL_SEP \
343 12 XCHAL_SEP \
344 XTHAL_TIMER_UNCONFIGURED
345
346/* Indexing macros: */
347#define _XCHAL_INTLEVEL_MASK(n) XCHAL_INTLEVEL ## n ## _MASK
348#define XCHAL_INTLEVEL_MASK(n) _XCHAL_INTLEVEL_MASK(n) /* n = 0 .. 15 */
349#define _XCHAL_INTLEVEL_ANDBELOWMASK(n) XCHAL_INTLEVEL ## n ## _ANDBELOW_MASK
350#define XCHAL_INTLEVEL_ANDBELOW_MASK(n) _XCHAL_INTLEVEL_ANDBELOWMASK(n) /* n = 0 .. 15 */
351#define _XCHAL_INT_LEVEL(n) XCHAL_INT ## n ## _LEVEL
352#define XCHAL_INT_LEVEL(n) _XCHAL_INT_LEVEL(n) /* n = 0 .. 31 */
353#define _XCHAL_INT_TYPE(n) XCHAL_INT ## n ## _TYPE
354#define XCHAL_INT_TYPE(n) _XCHAL_INT_TYPE(n) /* n = 0 .. 31 */
355#define _XCHAL_TIMER_INTERRUPT(n) XCHAL_TIMER ## n ## _INTERRUPT
356#define XCHAL_TIMER_INTERRUPT(n) _XCHAL_TIMER_INTERRUPT(n) /* n = 0 .. 3 */
357
358
359
360/*
361 * External interrupt vectors/levels.
362 * These macros describe how Xtensa processor interrupt numbers
363 * (as numbered internally, eg. in INTERRUPT and INTENABLE registers)
364 * map to external BInterrupt<n> pins, for those interrupts
365 * configured as external (level-triggered, edge-triggered, or NMI).
366 * See the Xtensa processor databook for more details.
367 */
368
369/* Core interrupt numbers mapped to each EXTERNAL interrupt number: */
370#define XCHAL_EXTINT0_NUM 0 /* (intlevel 1) */
371#define XCHAL_EXTINT1_NUM 1 /* (intlevel 2) */
372#define XCHAL_EXTINT2_NUM 2 /* (intlevel 3) */
373#define XCHAL_EXTINT3_NUM 3 /* (intlevel 1) */
374#define XCHAL_EXTINT4_NUM 4 /* (intlevel 1) */
375#define XCHAL_EXTINT5_NUM 5 /* (intlevel 1) */
376#define XCHAL_EXTINT6_NUM 6 /* (intlevel 1) */
377#define XCHAL_EXTINT7_NUM 7 /* (intlevel 1) */
378#define XCHAL_EXTINT8_NUM 8 /* (intlevel 2) */
379#define XCHAL_EXTINT9_NUM 9 /* (intlevel 3) */
380
381/* Corresponding interrupt masks: */
382#define XCHAL_EXTINT0_MASK 0x00000001
383#define XCHAL_EXTINT1_MASK 0x00000002
384#define XCHAL_EXTINT2_MASK 0x00000004
385#define XCHAL_EXTINT3_MASK 0x00000008
386#define XCHAL_EXTINT4_MASK 0x00000010
387#define XCHAL_EXTINT5_MASK 0x00000020
388#define XCHAL_EXTINT6_MASK 0x00000040
389#define XCHAL_EXTINT7_MASK 0x00000080
390#define XCHAL_EXTINT8_MASK 0x00000100
391#define XCHAL_EXTINT9_MASK 0x00000200
392
393/* Core config interrupt levels mapped to each external interrupt: */
394#define XCHAL_EXTINT0_LEVEL 1 /* (int number 0) */
395#define XCHAL_EXTINT1_LEVEL 2 /* (int number 1) */
396#define XCHAL_EXTINT2_LEVEL 3 /* (int number 2) */
397#define XCHAL_EXTINT3_LEVEL 1 /* (int number 3) */
398#define XCHAL_EXTINT4_LEVEL 1 /* (int number 4) */
399#define XCHAL_EXTINT5_LEVEL 1 /* (int number 5) */
400#define XCHAL_EXTINT6_LEVEL 1 /* (int number 6) */
401#define XCHAL_EXTINT7_LEVEL 1 /* (int number 7) */
402#define XCHAL_EXTINT8_LEVEL 2 /* (int number 8) */
403#define XCHAL_EXTINT9_LEVEL 3 /* (int number 9) */
404
405
406/*----------------------------------------------------------------------
407 EXCEPTIONS and VECTORS
408 ----------------------------------------------------------------------*/
409
410#define XCHAL_HAVE_EXCEPTIONS 1 /* 1 if exception option configured, 0 otherwise */
411
412#define XCHAL_XEA_VERSION 2 /* Xtensa Exception Architecture number: 1 for XEA1 (old), 2 for XEA2 (new) */
413#define XCHAL_HAVE_XEA1 0 /* 1 if XEA1, 0 otherwise */
414#define XCHAL_HAVE_XEA2 1 /* 1 if XEA2, 0 otherwise */
415/* For backward compatibility ONLY -- DO NOT USE (will be removed in future release): */
416#define XCHAL_HAVE_OLD_EXC_ARCH XCHAL_HAVE_XEA1 /* (DEPRECATED) 1 if old exception architecture (XEA1), 0 otherwise (eg. XEA2) */
417#define XCHAL_HAVE_EXCM XCHAL_HAVE_XEA2 /* (DEPRECATED) 1 if PS.EXCM bit exists (currently equals XCHAL_HAVE_TLBS) */
418
419#define XCHAL_RESET_VECTOR_VADDR 0xFE000020
420#define XCHAL_RESET_VECTOR_PADDR 0xFE000020
421#define XCHAL_USER_VECTOR_VADDR 0xD0000220
422#define XCHAL_PROGRAMEXC_VECTOR_VADDR XCHAL_USER_VECTOR_VADDR /* for backward compatibility */
423#define XCHAL_USEREXC_VECTOR_VADDR XCHAL_USER_VECTOR_VADDR /* for backward compatibility */
424#define XCHAL_USER_VECTOR_PADDR 0x00000220
425#define XCHAL_PROGRAMEXC_VECTOR_PADDR XCHAL_USER_VECTOR_PADDR /* for backward compatibility */
426#define XCHAL_USEREXC_VECTOR_PADDR XCHAL_USER_VECTOR_PADDR /* for backward compatibility */
427#define XCHAL_KERNEL_VECTOR_VADDR 0xD0000200
428#define XCHAL_STACKEDEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
429#define XCHAL_KERNELEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
430#define XCHAL_KERNEL_VECTOR_PADDR 0x00000200
431#define XCHAL_STACKEDEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
432#define XCHAL_KERNELEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
433#define XCHAL_DOUBLEEXC_VECTOR_VADDR 0xD0000290
434#define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x00000290
435#define XCHAL_WINDOW_VECTORS_VADDR 0xD0000000
436#define XCHAL_WINDOW_VECTORS_PADDR 0x00000000
437#define XCHAL_INTLEVEL2_VECTOR_VADDR 0xD0000240
438#define XCHAL_INTLEVEL2_VECTOR_PADDR 0x00000240
439#define XCHAL_INTLEVEL3_VECTOR_VADDR 0xD0000250
440#define XCHAL_INTLEVEL3_VECTOR_PADDR 0x00000250
441#define XCHAL_INTLEVEL4_VECTOR_VADDR 0xFE000520
442#define XCHAL_INTLEVEL4_VECTOR_PADDR 0xFE000520
443#define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL4_VECTOR_VADDR
444#define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL4_VECTOR_PADDR
445
446/* Indexing macros: */
447#define _XCHAL_INTLEVEL_VECTOR_VADDR(n) XCHAL_INTLEVEL ## n ## _VECTOR_VADDR
448#define XCHAL_INTLEVEL_VECTOR_VADDR(n) _XCHAL_INTLEVEL_VECTOR_VADDR(n) /* n = 0 .. 15 */
449
450/*
451 * General Exception Causes
452 * (values of EXCCAUSE special register set by general exceptions,
453 * which vector to the user, kernel, or double-exception vectors):
454 */
455#define XCHAL_EXCCAUSE_ILLEGAL_INSTRUCTION 0 /* Illegal Instruction (IllegalInstruction) */
456#define XCHAL_EXCCAUSE_SYSTEM_CALL 1 /* System Call (SystemCall) */
457#define XCHAL_EXCCAUSE_INSTRUCTION_FETCH_ERROR 2 /* Instruction Fetch Error (InstructionFetchError) */
458#define XCHAL_EXCCAUSE_LOAD_STORE_ERROR 3 /* Load Store Error (LoadStoreError) */
459#define XCHAL_EXCCAUSE_LEVEL1_INTERRUPT 4 /* Level 1 Interrupt (Level1Interrupt) */
460#define XCHAL_EXCCAUSE_ALLOCA 5 /* Stack Extension Assist (Alloca) */
461#define XCHAL_EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6 /* Integer Divide by Zero (IntegerDivideByZero) */
462#define XCHAL_EXCCAUSE_SPECULATION 7 /* Speculation (Speculation) */
463#define XCHAL_EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction (Privileged) */
464#define XCHAL_EXCCAUSE_UNALIGNED 9 /* Unaligned Load Store (Unaligned) */
465#define XCHAL_EXCCAUSE_ITLB_MISS 16 /* ITlb Miss Exception (ITlbMiss) */
466#define XCHAL_EXCCAUSE_ITLB_MULTIHIT 17 /* ITlb Mutltihit Exception (ITlbMultihit) */
467#define XCHAL_EXCCAUSE_ITLB_PRIVILEGE 18 /* ITlb Privilege Exception (ITlbPrivilege) */
468#define XCHAL_EXCCAUSE_ITLB_SIZE_RESTRICTION 19 /* ITlb Size Restriction Exception (ITlbSizeRestriction) */
469#define XCHAL_EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20 /* Fetch Cache Attribute Exception (FetchCacheAttribute) */
470#define XCHAL_EXCCAUSE_DTLB_MISS 24 /* DTlb Miss Exception (DTlbMiss) */
471#define XCHAL_EXCCAUSE_DTLB_MULTIHIT 25 /* DTlb Multihit Exception (DTlbMultihit) */
472#define XCHAL_EXCCAUSE_DTLB_PRIVILEGE 26 /* DTlb Privilege Exception (DTlbPrivilege) */
473#define XCHAL_EXCCAUSE_DTLB_SIZE_RESTRICTION 27 /* DTlb Size Restriction Exception (DTlbSizeRestriction) */
474#define XCHAL_EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28 /* Load Cache Attribute Exception (LoadCacheAttribute) */
475#define XCHAL_EXCCAUSE_STORE_CACHE_ATTRIBUTE 29 /* Store Cache Attribute Exception (StoreCacheAttribute) */
476#define XCHAL_EXCCAUSE_FLOATING_POINT 40 /* Floating Point Exception (FloatingPoint) */
477
478
479
480/*----------------------------------------------------------------------
481 TIMERS
482 ----------------------------------------------------------------------*/
483
484#define XCHAL_HAVE_CCOUNT 1 /* 1 if have CCOUNT, 0 otherwise */
485/*#define XCHAL_HAVE_TIMERS XCHAL_HAVE_CCOUNT*/
486#define XCHAL_NUM_TIMERS 3 /* number of CCOMPAREn regs */
487
488
489
490/*----------------------------------------------------------------------
491 DEBUG
492 ----------------------------------------------------------------------*/
493
494#define XCHAL_HAVE_DEBUG 1 /* 1 if debug option configured, 0 otherwise */
495#define XCHAL_HAVE_OCD 1 /* 1 if OnChipDebug option configured, 0 otherwise */
496#define XCHAL_NUM_IBREAK 2 /* number of IBREAKn regs */
497#define XCHAL_NUM_DBREAK 2 /* number of DBREAKn regs */
498#define XCHAL_DEBUGLEVEL 4 /* debug interrupt level */
499/*DebugExternalInterrupt 0 0|1*/
500/*DebugUseDIRArray 0 0|1*/
501
502
503
504
505/*----------------------------------------------------------------------
506 COPROCESSORS and EXTRA STATE
507 ----------------------------------------------------------------------*/
508
509#define XCHAL_HAVE_CP 0 /* 1 if coprocessor option configured (CPENABLE present) */
510#define XCHAL_CP_MAXCFG 0 /* max allowed cp id plus one (per cfg) */
511
512#include <xtensa/config/tie.h>
513
514
515
516
517/*----------------------------------------------------------------------
518 INTERNAL I/D RAM/ROMs and XLMI
519 ----------------------------------------------------------------------*/
520
521#define XCHAL_NUM_INSTROM 0 /* number of core instruction ROMs configured */
522#define XCHAL_NUM_INSTRAM 0 /* number of core instruction RAMs configured */
523#define XCHAL_NUM_DATAROM 0 /* number of core data ROMs configured */
524#define XCHAL_NUM_DATARAM 0 /* number of core data RAMs configured */
525#define XCHAL_NUM_XLMI 0 /* number of core XLMI ports configured */
526#define XCHAL_NUM_IROM XCHAL_NUM_INSTROM /* (DEPRECATED) */
527#define XCHAL_NUM_IRAM XCHAL_NUM_INSTRAM /* (DEPRECATED) */
528#define XCHAL_NUM_DROM XCHAL_NUM_DATAROM /* (DEPRECATED) */
529#define XCHAL_NUM_DRAM XCHAL_NUM_DATARAM /* (DEPRECATED) */
530
531
532
533/*----------------------------------------------------------------------
534 CACHE
535 ----------------------------------------------------------------------*/
536
537/* Size of the cache lines in log2(bytes): */
538#define XCHAL_ICACHE_LINEWIDTH 4
539#define XCHAL_DCACHE_LINEWIDTH 4
540/* Size of the cache lines in bytes: */
541#define XCHAL_ICACHE_LINESIZE 16
542#define XCHAL_DCACHE_LINESIZE 16
543/* Max for both I-cache and D-cache (used for general alignment): */
544#define XCHAL_CACHE_LINEWIDTH_MAX 4
545#define XCHAL_CACHE_LINESIZE_MAX 16
546
547/* Number of cache sets in log2(lines per way): */
548#define XCHAL_ICACHE_SETWIDTH 8
549#define XCHAL_DCACHE_SETWIDTH 8
550/* Max for both I-cache and D-cache (used for general cache-coherency page alignment): */
551#define XCHAL_CACHE_SETWIDTH_MAX 8
552#define XCHAL_CACHE_SETSIZE_MAX 256
553
554/* Cache set associativity (number of ways): */
555#define XCHAL_ICACHE_WAYS 2
556#define XCHAL_DCACHE_WAYS 2
557
558/* Size of the caches in bytes (ways * 2^(linewidth + setwidth)): */
559#define XCHAL_ICACHE_SIZE 8192
560#define XCHAL_DCACHE_SIZE 8192
561
562/* Cache features: */
563#define XCHAL_DCACHE_IS_WRITEBACK 0
564/* Whether cache locking feature is available: */
565#define XCHAL_ICACHE_LINE_LOCKABLE 0
566#define XCHAL_DCACHE_LINE_LOCKABLE 0
567
568/* Number of (encoded) cache attribute bits: */
569#define XCHAL_CA_BITS 4 /* number of bits needed to hold cache attribute encoding */
570/* (The number of access mode bits (decoded cache attribute bits) is defined by the architecture; see xtensa/hal.h?) */
571
572
573/* Cache Attribute encodings -- lists of access modes for each cache attribute: */
574#define XCHAL_FCA_LIST XTHAL_FAM_EXCEPTION XCHAL_SEP \
575 XTHAL_FAM_BYPASS XCHAL_SEP \
576 XTHAL_FAM_EXCEPTION XCHAL_SEP \
577 XTHAL_FAM_BYPASS XCHAL_SEP \
578 XTHAL_FAM_EXCEPTION XCHAL_SEP \
579 XTHAL_FAM_CACHED XCHAL_SEP \
580 XTHAL_FAM_EXCEPTION XCHAL_SEP \
581 XTHAL_FAM_CACHED XCHAL_SEP \
582 XTHAL_FAM_EXCEPTION XCHAL_SEP \
583 XTHAL_FAM_CACHED XCHAL_SEP \
584 XTHAL_FAM_EXCEPTION XCHAL_SEP \
585 XTHAL_FAM_CACHED XCHAL_SEP \
586 XTHAL_FAM_EXCEPTION XCHAL_SEP \
587 XTHAL_FAM_EXCEPTION XCHAL_SEP \
588 XTHAL_FAM_EXCEPTION XCHAL_SEP \
589 XTHAL_FAM_EXCEPTION
590#define XCHAL_LCA_LIST XTHAL_LAM_EXCEPTION XCHAL_SEP \
591 XTHAL_LAM_BYPASSG XCHAL_SEP \
592 XTHAL_LAM_EXCEPTION XCHAL_SEP \
593 XTHAL_LAM_BYPASSG XCHAL_SEP \
594 XTHAL_LAM_EXCEPTION XCHAL_SEP \
595 XTHAL_LAM_CACHED XCHAL_SEP \
596 XTHAL_LAM_EXCEPTION XCHAL_SEP \
597 XTHAL_LAM_CACHED XCHAL_SEP \
598 XTHAL_LAM_EXCEPTION XCHAL_SEP \
599 XTHAL_LAM_NACACHED XCHAL_SEP \
600 XTHAL_LAM_EXCEPTION XCHAL_SEP \
601 XTHAL_LAM_NACACHED XCHAL_SEP \
602 XTHAL_LAM_EXCEPTION XCHAL_SEP \
603 XTHAL_LAM_ISOLATE XCHAL_SEP \
604 XTHAL_LAM_EXCEPTION XCHAL_SEP \
605 XTHAL_LAM_CACHED
606#define XCHAL_SCA_LIST XTHAL_SAM_EXCEPTION XCHAL_SEP \
607 XTHAL_SAM_EXCEPTION XCHAL_SEP \
608 XTHAL_SAM_EXCEPTION XCHAL_SEP \
609 XTHAL_SAM_BYPASS XCHAL_SEP \
610 XTHAL_SAM_EXCEPTION XCHAL_SEP \
611 XTHAL_SAM_EXCEPTION XCHAL_SEP \
612 XTHAL_SAM_EXCEPTION XCHAL_SEP \
613 XTHAL_SAM_WRITETHRU XCHAL_SEP \
614 XTHAL_SAM_EXCEPTION XCHAL_SEP \
615 XTHAL_SAM_EXCEPTION XCHAL_SEP \
616 XTHAL_SAM_EXCEPTION XCHAL_SEP \
617 XTHAL_SAM_WRITETHRU XCHAL_SEP \
618 XTHAL_SAM_EXCEPTION XCHAL_SEP \
619 XTHAL_SAM_ISOLATE XCHAL_SEP \
620 XTHAL_SAM_EXCEPTION XCHAL_SEP \
621 XTHAL_SAM_WRITETHRU
622
623/* Test:
624 read/only: 0 + 1 + 2 + 4 + 5 + 6 + 8 + 9 + 10 + 12 + 14
625 read/only: 0 + 1 + 2 + 4 + 5 + 6 + 8 + 9 + 10 + 12 + 14
626 all: 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15
627 fault: 0 + 2 + 4 + 6 + 8 + 10 + 12 + 14
628 r/w/x cached:
629 r/w/x dcached:
630 I-bypass: 1 + 3
631
632 load guard bit set: 1 + 3
633 load guard bit clr: 0 + 2 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15
634 hit-cache r/w/x: 7 + 11
635
636 fams: 5
637 fams: 0 / 6 / 18 / 1 / 2
638 fams: Bypass / Isolate / Cached / Exception / NACached
639
640 MMU okay: yes
641*/
642
643
644/*----------------------------------------------------------------------
645 MMU
646 ----------------------------------------------------------------------*/
647
648/*
649 * General notes on MMU parameters.
650 *
651 * Terminology:
652 * ASID = address-space ID (acts as an "extension" of virtual addresses)
653 * VPN = virtual page number
654 * PPN = physical page number
655 * CA = encoded cache attribute (access modes)
656 * TLB = translation look-aside buffer (term is stretched somewhat here)
657 * I = instruction (fetch accesses)
658 * D = data (load and store accesses)
659 * way = each TLB (ITLB and DTLB) consists of a number of "ways"
660 * that simultaneously match the virtual address of an access;
661 * a TLB successfully translates a virtual address if exactly
662 * one way matches the vaddr; if none match, it is a miss;
663 * if multiple match, one gets a "multihit" exception;
664 * each way can be independently configured in terms of number of
665 * entries, page sizes, which fields are writable or constant, etc.
666 * set = group of contiguous ways with exactly identical parameters
667 * ARF = auto-refill; hardware services a 1st-level miss by loading a PTE
668 * from the page table and storing it in one of the auto-refill ways;
669 * if this PTE load also misses, a miss exception is posted for s/w.
670 * min-wired = a "min-wired" way can be used to map a single (minimum-sized)
671 * page arbitrarily under program control; it has a single entry,
672 * is non-auto-refill (some other way(s) must be auto-refill),
673 * all its fields (VPN, PPN, ASID, CA) are all writable, and it
674 * supports the XCHAL_MMU_MIN_PTE_PAGE_SIZE page size (a current
675 * restriction is that this be the only page size it supports).
676 *
677 * TLB way entries are virtually indexed.
678 * TLB ways that support multiple page sizes:
679 * - must have all writable VPN and PPN fields;
680 * - can only use one page size at any given time (eg. setup at startup),
681 * selected by the respective ITLBCFG or DTLBCFG special register,
682 * whose bits n*4+3 .. n*4 index the list of page sizes for way n
683 * (XCHAL_xTLB_SETm_PAGESZ_LOG2_LIST for set m corresponding to way n);
684 * this list may be sparse for auto-refill ways because auto-refill
685 * ways have independent lists of supported page sizes sharing a
686 * common encoding with PTE entries; the encoding is the index into
687 * this list; unsupported sizes for a given way are zero in the list;
688 * selecting unsupported sizes results in undefined hardware behaviour;
689 * - is only possible for ways 0 thru 7 (due to ITLBCFG/DTLBCFG definition).
690 */
691
692#define XCHAL_HAVE_CACHEATTR 0 /* 1 if CACHEATTR register present, 0 if TLBs present instead */
693#define XCHAL_HAVE_TLBS 1 /* 1 if TLBs present, 0 if CACHEATTR present instead */
694#define XCHAL_HAVE_MMU XCHAL_HAVE_TLBS /* (DEPRECATED; use XCHAL_HAVE_TLBS instead; will be removed in future release) */
695#define XCHAL_HAVE_SPANNING_WAY 0 /* 1 if single way maps entire virtual address space in I+D */
696#define XCHAL_HAVE_IDENTITY_MAP 0 /* 1 if virtual addr == physical addr always, 0 otherwise */
697#define XCHAL_HAVE_MIMIC_CACHEATTR 0 /* 1 if have MMU that mimics a CACHEATTR config (CaMMU) */
698#define XCHAL_HAVE_XLT_CACHEATTR 0 /* 1 if have MMU that mimics a CACHEATTR config, but with translation (CaXltMMU) */
699
700#define XCHAL_MMU_ASID_BITS 8 /* number of bits in ASIDs (address space IDs) */
701#define XCHAL_MMU_ASID_INVALID 0 /* ASID value indicating invalid address space */
702#define XCHAL_MMU_ASID_KERNEL 1 /* ASID value indicating kernel (ring 0) address space */
703#define XCHAL_MMU_RINGS 4 /* number of rings supported (1..4) */
704#define XCHAL_MMU_RING_BITS 2 /* number of bits needed to hold ring number */
705#define XCHAL_MMU_SR_BITS 0 /* number of size-restriction bits supported */
706#define XCHAL_MMU_CA_BITS 4 /* number of bits needed to hold cache attribute encoding */
707#define XCHAL_MMU_MAX_PTE_PAGE_SIZE 12 /* max page size in a PTE structure (log2) */
708#define XCHAL_MMU_MIN_PTE_PAGE_SIZE 12 /* min page size in a PTE structure (log2) */
709
710
711/*** Instruction TLB: ***/
712
713#define XCHAL_ITLB_WAY_BITS 3 /* number of bits holding the ways */
714#define XCHAL_ITLB_WAYS 7 /* number of ways (n-way set-associative TLB) */
715#define XCHAL_ITLB_ARF_WAYS 4 /* number of auto-refill ways */
716#define XCHAL_ITLB_SETS 4 /* number of sets (groups of ways with identical settings) */
717
718/* Way set to which each way belongs: */
719#define XCHAL_ITLB_WAY0_SET 0
720#define XCHAL_ITLB_WAY1_SET 0
721#define XCHAL_ITLB_WAY2_SET 0
722#define XCHAL_ITLB_WAY3_SET 0
723#define XCHAL_ITLB_WAY4_SET 1
724#define XCHAL_ITLB_WAY5_SET 2
725#define XCHAL_ITLB_WAY6_SET 3
726
727/* Ways sets that are used by hardware auto-refill (ARF): */
728#define XCHAL_ITLB_ARF_SETS 1 /* number of auto-refill sets */
729#define XCHAL_ITLB_ARF_SET0 0 /* index of n'th auto-refill set */
730
731/* Way sets that are "min-wired" (see terminology comment above): */
732#define XCHAL_ITLB_MINWIRED_SETS 0 /* number of "min-wired" sets */
733
734
735/* ITLB way set 0 (group of ways 0 thru 3): */
736#define XCHAL_ITLB_SET0_WAY 0 /* index of first way in this way set */
737#define XCHAL_ITLB_SET0_WAYS 4 /* number of (contiguous) ways in this way set */
738#define XCHAL_ITLB_SET0_ENTRIES_LOG2 2 /* log2(number of entries in this way) */
739#define XCHAL_ITLB_SET0_ENTRIES 4 /* number of entries in this way (always a power of 2) */
740#define XCHAL_ITLB_SET0_ARF 1 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
741#define XCHAL_ITLB_SET0_PAGESIZES 1 /* number of supported page sizes in this way */
742#define XCHAL_ITLB_SET0_PAGESZ_BITS 0 /* number of bits to encode the page size */
743#define XCHAL_ITLB_SET0_PAGESZ_LOG2_MIN 12 /* log2(minimum supported page size) */
744#define XCHAL_ITLB_SET0_PAGESZ_LOG2_MAX 12 /* log2(maximum supported page size) */
745#define XCHAL_ITLB_SET0_PAGESZ_LOG2_LIST 12 /* list of log2(page size)s, separated by XCHAL_SEP;
746 2^PAGESZ_BITS entries in list, unsupported entries are zero */
747#define XCHAL_ITLB_SET0_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */
748#define XCHAL_ITLB_SET0_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */
749#define XCHAL_ITLB_SET0_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */
750#define XCHAL_ITLB_SET0_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */
751#define XCHAL_ITLB_SET0_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
752#define XCHAL_ITLB_SET0_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
753#define XCHAL_ITLB_SET0_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
754#define XCHAL_ITLB_SET0_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
755
756/* ITLB way set 1 (group of ways 4 thru 4): */
757#define XCHAL_ITLB_SET1_WAY 4 /* index of first way in this way set */
758#define XCHAL_ITLB_SET1_WAYS 1 /* number of (contiguous) ways in this way set */
759#define XCHAL_ITLB_SET1_ENTRIES_LOG2 2 /* log2(number of entries in this way) */
760#define XCHAL_ITLB_SET1_ENTRIES 4 /* number of entries in this way (always a power of 2) */
761#define XCHAL_ITLB_SET1_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
762#define XCHAL_ITLB_SET1_PAGESIZES 4 /* number of supported page sizes in this way */
763#define XCHAL_ITLB_SET1_PAGESZ_BITS 2 /* number of bits to encode the page size */
764#define XCHAL_ITLB_SET1_PAGESZ_LOG2_MIN 20 /* log2(minimum supported page size) */
765#define XCHAL_ITLB_SET1_PAGESZ_LOG2_MAX 26 /* log2(maximum supported page size) */
766#define XCHAL_ITLB_SET1_PAGESZ_LOG2_LIST 20 XCHAL_SEP 22 XCHAL_SEP 24 XCHAL_SEP 26 /* list of log2(page size)s, separated by XCHAL_SEP;
767 2^PAGESZ_BITS entries in list, unsupported entries are zero */
768#define XCHAL_ITLB_SET1_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */
769#define XCHAL_ITLB_SET1_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */
770#define XCHAL_ITLB_SET1_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */
771#define XCHAL_ITLB_SET1_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */
772#define XCHAL_ITLB_SET1_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
773#define XCHAL_ITLB_SET1_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
774#define XCHAL_ITLB_SET1_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
775#define XCHAL_ITLB_SET1_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
776
777/* ITLB way set 2 (group of ways 5 thru 5): */
778#define XCHAL_ITLB_SET2_WAY 5 /* index of first way in this way set */
779#define XCHAL_ITLB_SET2_WAYS 1 /* number of (contiguous) ways in this way set */
780#define XCHAL_ITLB_SET2_ENTRIES_LOG2 1 /* log2(number of entries in this way) */
781#define XCHAL_ITLB_SET2_ENTRIES 2 /* number of entries in this way (always a power of 2) */
782#define XCHAL_ITLB_SET2_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
783#define XCHAL_ITLB_SET2_PAGESIZES 1 /* number of supported page sizes in this way */
784#define XCHAL_ITLB_SET2_PAGESZ_BITS 0 /* number of bits to encode the page size */
785#define XCHAL_ITLB_SET2_PAGESZ_LOG2_MIN 27 /* log2(minimum supported page size) */
786#define XCHAL_ITLB_SET2_PAGESZ_LOG2_MAX 27 /* log2(maximum supported page size) */
787#define XCHAL_ITLB_SET2_PAGESZ_LOG2_LIST 27 /* list of log2(page size)s, separated by XCHAL_SEP;
788 2^PAGESZ_BITS entries in list, unsupported entries are zero */
789#define XCHAL_ITLB_SET2_ASID_CONSTMASK 0xFF /* constant ASID bits; 0 if all writable */
790#define XCHAL_ITLB_SET2_VPN_CONSTMASK 0xF0000000 /* constant VPN bits, not including entry index bits; 0 if all writable */
791#define XCHAL_ITLB_SET2_PPN_CONSTMASK 0xF8000000 /* constant PPN bits, including entry index bits; 0 if all writable */
792#define XCHAL_ITLB_SET2_CA_CONSTMASK 0x0000000F /* constant CA bits; 0 if all writable */
793#define XCHAL_ITLB_SET2_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
794#define XCHAL_ITLB_SET2_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
795#define XCHAL_ITLB_SET2_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
796#define XCHAL_ITLB_SET2_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
797/* Constant ASID values for each entry of ITLB way set 2 (because ASID_CONSTMASK is non-zero): */
798#define XCHAL_ITLB_SET2_E0_ASID_CONST 0x01
799#define XCHAL_ITLB_SET2_E1_ASID_CONST 0x01
800/* Constant VPN values for each entry of ITLB way set 2 (because VPN_CONSTMASK is non-zero): */
801#define XCHAL_ITLB_SET2_E0_VPN_CONST 0xD0000000
802#define XCHAL_ITLB_SET2_E1_VPN_CONST 0xD8000000
803/* Constant PPN values for each entry of ITLB way set 2 (because PPN_CONSTMASK is non-zero): */
804#define XCHAL_ITLB_SET2_E0_PPN_CONST 0x00000000
805#define XCHAL_ITLB_SET2_E1_PPN_CONST 0x00000000
806/* Constant CA values for each entry of ITLB way set 2 (because CA_CONSTMASK is non-zero): */
807#define XCHAL_ITLB_SET2_E0_CA_CONST 0x07
808#define XCHAL_ITLB_SET2_E1_CA_CONST 0x03
809
810/* ITLB way set 3 (group of ways 6 thru 6): */
811#define XCHAL_ITLB_SET3_WAY 6 /* index of first way in this way set */
812#define XCHAL_ITLB_SET3_WAYS 1 /* number of (contiguous) ways in this way set */
813#define XCHAL_ITLB_SET3_ENTRIES_LOG2 1 /* log2(number of entries in this way) */
814#define XCHAL_ITLB_SET3_ENTRIES 2 /* number of entries in this way (always a power of 2) */
815#define XCHAL_ITLB_SET3_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
816#define XCHAL_ITLB_SET3_PAGESIZES 1 /* number of supported page sizes in this way */
817#define XCHAL_ITLB_SET3_PAGESZ_BITS 0 /* number of bits to encode the page size */
818#define XCHAL_ITLB_SET3_PAGESZ_LOG2_MIN 28 /* log2(minimum supported page size) */
819#define XCHAL_ITLB_SET3_PAGESZ_LOG2_MAX 28 /* log2(maximum supported page size) */
820#define XCHAL_ITLB_SET3_PAGESZ_LOG2_LIST 28 /* list of log2(page size)s, separated by XCHAL_SEP;
821 2^PAGESZ_BITS entries in list, unsupported entries are zero */
822#define XCHAL_ITLB_SET3_ASID_CONSTMASK 0xFF /* constant ASID bits; 0 if all writable */
823#define XCHAL_ITLB_SET3_VPN_CONSTMASK 0xE0000000 /* constant VPN bits, not including entry index bits; 0 if all writable */
824#define XCHAL_ITLB_SET3_PPN_CONSTMASK 0xF0000000 /* constant PPN bits, including entry index bits; 0 if all writable */
825#define XCHAL_ITLB_SET3_CA_CONSTMASK 0x0000000F /* constant CA bits; 0 if all writable */
826#define XCHAL_ITLB_SET3_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
827#define XCHAL_ITLB_SET3_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
828#define XCHAL_ITLB_SET3_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
829#define XCHAL_ITLB_SET3_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
830/* Constant ASID values for each entry of ITLB way set 3 (because ASID_CONSTMASK is non-zero): */
831#define XCHAL_ITLB_SET3_E0_ASID_CONST 0x01
832#define XCHAL_ITLB_SET3_E1_ASID_CONST 0x01
833/* Constant VPN values for each entry of ITLB way set 3 (because VPN_CONSTMASK is non-zero): */
834#define XCHAL_ITLB_SET3_E0_VPN_CONST 0xE0000000
835#define XCHAL_ITLB_SET3_E1_VPN_CONST 0xF0000000
836/* Constant PPN values for each entry of ITLB way set 3 (because PPN_CONSTMASK is non-zero): */
837#define XCHAL_ITLB_SET3_E0_PPN_CONST 0xF0000000
838#define XCHAL_ITLB_SET3_E1_PPN_CONST 0xF0000000
839/* Constant CA values for each entry of ITLB way set 3 (because CA_CONSTMASK is non-zero): */
840#define XCHAL_ITLB_SET3_E0_CA_CONST 0x07
841#define XCHAL_ITLB_SET3_E1_CA_CONST 0x03
842
843/* Indexing macros: */
844#define _XCHAL_ITLB_SET(n,_what) XCHAL_ITLB_SET ## n ## _what
845#define XCHAL_ITLB_SET(n,what) _XCHAL_ITLB_SET(n, _ ## what )
846#define _XCHAL_ITLB_SET_E(n,i,_what) XCHAL_ITLB_SET ## n ## _E ## i ## _what
847#define XCHAL_ITLB_SET_E(n,i,what) _XCHAL_ITLB_SET_E(n,i, _ ## what )
848/*
849 * Example use: XCHAL_ITLB_SET(XCHAL_ITLB_ARF_SET0,ENTRIES)
850 * to get the value of XCHAL_ITLB_SET<n>_ENTRIES where <n> is the first auto-refill set.
851 */
852
853
854/*** Data TLB: ***/
855
856#define XCHAL_DTLB_WAY_BITS 4 /* number of bits holding the ways */
857#define XCHAL_DTLB_WAYS 10 /* number of ways (n-way set-associative TLB) */
858#define XCHAL_DTLB_ARF_WAYS 4 /* number of auto-refill ways */
859#define XCHAL_DTLB_SETS 5 /* number of sets (groups of ways with identical settings) */
860
861/* Way set to which each way belongs: */
862#define XCHAL_DTLB_WAY0_SET 0
863#define XCHAL_DTLB_WAY1_SET 0
864#define XCHAL_DTLB_WAY2_SET 0
865#define XCHAL_DTLB_WAY3_SET 0
866#define XCHAL_DTLB_WAY4_SET 1
867#define XCHAL_DTLB_WAY5_SET 2
868#define XCHAL_DTLB_WAY6_SET 3
869#define XCHAL_DTLB_WAY7_SET 4
870#define XCHAL_DTLB_WAY8_SET 4
871#define XCHAL_DTLB_WAY9_SET 4
872
873/* Ways sets that are used by hardware auto-refill (ARF): */
874#define XCHAL_DTLB_ARF_SETS 1 /* number of auto-refill sets */
875#define XCHAL_DTLB_ARF_SET0 0 /* index of n'th auto-refill set */
876
877/* Way sets that are "min-wired" (see terminology comment above): */
878#define XCHAL_DTLB_MINWIRED_SETS 1 /* number of "min-wired" sets */
879#define XCHAL_DTLB_MINWIRED_SET0 4 /* index of n'th "min-wired" set */
880
881
882/* DTLB way set 0 (group of ways 0 thru 3): */
883#define XCHAL_DTLB_SET0_WAY 0 /* index of first way in this way set */
884#define XCHAL_DTLB_SET0_WAYS 4 /* number of (contiguous) ways in this way set */
885#define XCHAL_DTLB_SET0_ENTRIES_LOG2 2 /* log2(number of entries in this way) */
886#define XCHAL_DTLB_SET0_ENTRIES 4 /* number of entries in this way (always a power of 2) */
887#define XCHAL_DTLB_SET0_ARF 1 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
888#define XCHAL_DTLB_SET0_PAGESIZES 1 /* number of supported page sizes in this way */
889#define XCHAL_DTLB_SET0_PAGESZ_BITS 0 /* number of bits to encode the page size */
890#define XCHAL_DTLB_SET0_PAGESZ_LOG2_MIN 12 /* log2(minimum supported page size) */
891#define XCHAL_DTLB_SET0_PAGESZ_LOG2_MAX 12 /* log2(maximum supported page size) */
892#define XCHAL_DTLB_SET0_PAGESZ_LOG2_LIST 12 /* list of log2(page size)s, separated by XCHAL_SEP;
893 2^PAGESZ_BITS entries in list, unsupported entries are zero */
894#define XCHAL_DTLB_SET0_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */
895#define XCHAL_DTLB_SET0_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */
896#define XCHAL_DTLB_SET0_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */
897#define XCHAL_DTLB_SET0_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */
898#define XCHAL_DTLB_SET0_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
899#define XCHAL_DTLB_SET0_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
900#define XCHAL_DTLB_SET0_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
901#define XCHAL_DTLB_SET0_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
902
903/* DTLB way set 1 (group of ways 4 thru 4): */
904#define XCHAL_DTLB_SET1_WAY 4 /* index of first way in this way set */
905#define XCHAL_DTLB_SET1_WAYS 1 /* number of (contiguous) ways in this way set */
906#define XCHAL_DTLB_SET1_ENTRIES_LOG2 2 /* log2(number of entries in this way) */
907#define XCHAL_DTLB_SET1_ENTRIES 4 /* number of entries in this way (always a power of 2) */
908#define XCHAL_DTLB_SET1_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
909#define XCHAL_DTLB_SET1_PAGESIZES 4 /* number of supported page sizes in this way */
910#define XCHAL_DTLB_SET1_PAGESZ_BITS 2 /* number of bits to encode the page size */
911#define XCHAL_DTLB_SET1_PAGESZ_LOG2_MIN 20 /* log2(minimum supported page size) */
912#define XCHAL_DTLB_SET1_PAGESZ_LOG2_MAX 26 /* log2(maximum supported page size) */
913#define XCHAL_DTLB_SET1_PAGESZ_LOG2_LIST 20 XCHAL_SEP 22 XCHAL_SEP 24 XCHAL_SEP 26 /* list of log2(page size)s, separated by XCHAL_SEP;
914 2^PAGESZ_BITS entries in list, unsupported entries are zero */
915#define XCHAL_DTLB_SET1_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */
916#define XCHAL_DTLB_SET1_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */
917#define XCHAL_DTLB_SET1_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */
918#define XCHAL_DTLB_SET1_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */
919#define XCHAL_DTLB_SET1_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
920#define XCHAL_DTLB_SET1_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
921#define XCHAL_DTLB_SET1_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
922#define XCHAL_DTLB_SET1_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
923
924/* DTLB way set 2 (group of ways 5 thru 5): */
925#define XCHAL_DTLB_SET2_WAY 5 /* index of first way in this way set */
926#define XCHAL_DTLB_SET2_WAYS 1 /* number of (contiguous) ways in this way set */
927#define XCHAL_DTLB_SET2_ENTRIES_LOG2 1 /* log2(number of entries in this way) */
928#define XCHAL_DTLB_SET2_ENTRIES 2 /* number of entries in this way (always a power of 2) */
929#define XCHAL_DTLB_SET2_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
930#define XCHAL_DTLB_SET2_PAGESIZES 1 /* number of supported page sizes in this way */
931#define XCHAL_DTLB_SET2_PAGESZ_BITS 0 /* number of bits to encode the page size */
932#define XCHAL_DTLB_SET2_PAGESZ_LOG2_MIN 27 /* log2(minimum supported page size) */
933#define XCHAL_DTLB_SET2_PAGESZ_LOG2_MAX 27 /* log2(maximum supported page size) */
934#define XCHAL_DTLB_SET2_PAGESZ_LOG2_LIST 27 /* list of log2(page size)s, separated by XCHAL_SEP;
935 2^PAGESZ_BITS entries in list, unsupported entries are zero */
936#define XCHAL_DTLB_SET2_ASID_CONSTMASK 0xFF /* constant ASID bits; 0 if all writable */
937#define XCHAL_DTLB_SET2_VPN_CONSTMASK 0xF0000000 /* constant VPN bits, not including entry index bits; 0 if all writable */
938#define XCHAL_DTLB_SET2_PPN_CONSTMASK 0xF8000000 /* constant PPN bits, including entry index bits; 0 if all writable */
939#define XCHAL_DTLB_SET2_CA_CONSTMASK 0x0000000F /* constant CA bits; 0 if all writable */
940#define XCHAL_DTLB_SET2_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
941#define XCHAL_DTLB_SET2_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
942#define XCHAL_DTLB_SET2_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
943#define XCHAL_DTLB_SET2_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
944/* Constant ASID values for each entry of DTLB way set 2 (because ASID_CONSTMASK is non-zero): */
945#define XCHAL_DTLB_SET2_E0_ASID_CONST 0x01
946#define XCHAL_DTLB_SET2_E1_ASID_CONST 0x01
947/* Constant VPN values for each entry of DTLB way set 2 (because VPN_CONSTMASK is non-zero): */
948#define XCHAL_DTLB_SET2_E0_VPN_CONST 0xD0000000
949#define XCHAL_DTLB_SET2_E1_VPN_CONST 0xD8000000
950/* Constant PPN values for each entry of DTLB way set 2 (because PPN_CONSTMASK is non-zero): */
951#define XCHAL_DTLB_SET2_E0_PPN_CONST 0x00000000
952#define XCHAL_DTLB_SET2_E1_PPN_CONST 0x00000000
953/* Constant CA values for each entry of DTLB way set 2 (because CA_CONSTMASK is non-zero): */
954#define XCHAL_DTLB_SET2_E0_CA_CONST 0x07
955#define XCHAL_DTLB_SET2_E1_CA_CONST 0x03
956
957/* DTLB way set 3 (group of ways 6 thru 6): */
958#define XCHAL_DTLB_SET3_WAY 6 /* index of first way in this way set */
959#define XCHAL_DTLB_SET3_WAYS 1 /* number of (contiguous) ways in this way set */
960#define XCHAL_DTLB_SET3_ENTRIES_LOG2 1 /* log2(number of entries in this way) */
961#define XCHAL_DTLB_SET3_ENTRIES 2 /* number of entries in this way (always a power of 2) */
962#define XCHAL_DTLB_SET3_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
963#define XCHAL_DTLB_SET3_PAGESIZES 1 /* number of supported page sizes in this way */
964#define XCHAL_DTLB_SET3_PAGESZ_BITS 0 /* number of bits to encode the page size */
965#define XCHAL_DTLB_SET3_PAGESZ_LOG2_MIN 28 /* log2(minimum supported page size) */
966#define XCHAL_DTLB_SET3_PAGESZ_LOG2_MAX 28 /* log2(maximum supported page size) */
967#define XCHAL_DTLB_SET3_PAGESZ_LOG2_LIST 28 /* list of log2(page size)s, separated by XCHAL_SEP;
968 2^PAGESZ_BITS entries in list, unsupported entries are zero */
969#define XCHAL_DTLB_SET3_ASID_CONSTMASK 0xFF /* constant ASID bits; 0 if all writable */
970#define XCHAL_DTLB_SET3_VPN_CONSTMASK 0xE0000000 /* constant VPN bits, not including entry index bits; 0 if all writable */
971#define XCHAL_DTLB_SET3_PPN_CONSTMASK 0xF0000000 /* constant PPN bits, including entry index bits; 0 if all writable */
972#define XCHAL_DTLB_SET3_CA_CONSTMASK 0x0000000F /* constant CA bits; 0 if all writable */
973#define XCHAL_DTLB_SET3_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
974#define XCHAL_DTLB_SET3_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
975#define XCHAL_DTLB_SET3_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
976#define XCHAL_DTLB_SET3_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
977/* Constant ASID values for each entry of DTLB way set 3 (because ASID_CONSTMASK is non-zero): */
978#define XCHAL_DTLB_SET3_E0_ASID_CONST 0x01
979#define XCHAL_DTLB_SET3_E1_ASID_CONST 0x01
980/* Constant VPN values for each entry of DTLB way set 3 (because VPN_CONSTMASK is non-zero): */
981#define XCHAL_DTLB_SET3_E0_VPN_CONST 0xE0000000
982#define XCHAL_DTLB_SET3_E1_VPN_CONST 0xF0000000
983/* Constant PPN values for each entry of DTLB way set 3 (because PPN_CONSTMASK is non-zero): */
984#define XCHAL_DTLB_SET3_E0_PPN_CONST 0xF0000000
985#define XCHAL_DTLB_SET3_E1_PPN_CONST 0xF0000000
986/* Constant CA values for each entry of DTLB way set 3 (because CA_CONSTMASK is non-zero): */
987#define XCHAL_DTLB_SET3_E0_CA_CONST 0x07
988#define XCHAL_DTLB_SET3_E1_CA_CONST 0x03
989
990/* DTLB way set 4 (group of ways 7 thru 9): */
991#define XCHAL_DTLB_SET4_WAY 7 /* index of first way in this way set */
992#define XCHAL_DTLB_SET4_WAYS 3 /* number of (contiguous) ways in this way set */
993#define XCHAL_DTLB_SET4_ENTRIES_LOG2 0 /* log2(number of entries in this way) */
994#define XCHAL_DTLB_SET4_ENTRIES 1 /* number of entries in this way (always a power of 2) */
995#define XCHAL_DTLB_SET4_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
996#define XCHAL_DTLB_SET4_PAGESIZES 1 /* number of supported page sizes in this way */
997#define XCHAL_DTLB_SET4_PAGESZ_BITS 0 /* number of bits to encode the page size */
998#define XCHAL_DTLB_SET4_PAGESZ_LOG2_MIN 12 /* log2(minimum supported page size) */
999#define XCHAL_DTLB_SET4_PAGESZ_LOG2_MAX 12 /* log2(maximum supported page size) */
1000#define XCHAL_DTLB_SET4_PAGESZ_LOG2_LIST 12 /* list of log2(page size)s, separated by XCHAL_SEP;
1001 2^PAGESZ_BITS entries in list, unsupported entries are zero */
1002#define XCHAL_DTLB_SET4_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */
1003#define XCHAL_DTLB_SET4_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */
1004#define XCHAL_DTLB_SET4_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */
1005#define XCHAL_DTLB_SET4_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */
1006#define XCHAL_DTLB_SET4_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
1007#define XCHAL_DTLB_SET4_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
1008#define XCHAL_DTLB_SET4_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
1009#define XCHAL_DTLB_SET4_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
1010
1011/* Indexing macros: */
1012#define _XCHAL_DTLB_SET(n,_what) XCHAL_DTLB_SET ## n ## _what
1013#define XCHAL_DTLB_SET(n,what) _XCHAL_DTLB_SET(n, _ ## what )
1014#define _XCHAL_DTLB_SET_E(n,i,_what) XCHAL_DTLB_SET ## n ## _E ## i ## _what
1015#define XCHAL_DTLB_SET_E(n,i,what) _XCHAL_DTLB_SET_E(n,i, _ ## what )
1016/*
1017 * Example use: XCHAL_DTLB_SET(XCHAL_DTLB_ARF_SET0,ENTRIES)
1018 * to get the value of XCHAL_DTLB_SET<n>_ENTRIES where <n> is the first auto-refill set.
1019 */
1020
1021
1022/*
1023 * Determine whether we have a full MMU (with Page Table and Protection)
1024 * usable for an MMU-based OS:
1025 */
1026#if XCHAL_HAVE_TLBS && !XCHAL_HAVE_SPANNING_WAY && XCHAL_ITLB_ARF_WAYS > 0 && XCHAL_DTLB_ARF_WAYS > 0 && XCHAL_MMU_RINGS >= 2
1027# define XCHAL_HAVE_PTP_MMU 1 /* have full MMU (with page table [autorefill] and protection) */
1028#else
1029# define XCHAL_HAVE_PTP_MMU 0 /* don't have full MMU */
1030#endif
1031
1032/*
1033 * For full MMUs, report kernel RAM segment and kernel I/O segment static page mappings:
1034 */
1035#if XCHAL_HAVE_PTP_MMU
1036#define XCHAL_KSEG_CACHED_VADDR 0xD0000000 /* virt.addr of kernel RAM cached static map */
1037#define XCHAL_KSEG_CACHED_PADDR 0x00000000 /* phys.addr of kseg_cached */
1038#define XCHAL_KSEG_CACHED_SIZE 0x08000000 /* size in bytes of kseg_cached (assumed power of 2!!!) */
1039#define XCHAL_KSEG_BYPASS_VADDR 0xD8000000 /* virt.addr of kernel RAM bypass (uncached) static map */
1040#define XCHAL_KSEG_BYPASS_PADDR 0x00000000 /* phys.addr of kseg_bypass */
1041#define XCHAL_KSEG_BYPASS_SIZE 0x08000000 /* size in bytes of kseg_bypass (assumed power of 2!!!) */
1042
1043#define XCHAL_KIO_CACHED_VADDR 0xE0000000 /* virt.addr of kernel I/O cached static map */
1044#define XCHAL_KIO_CACHED_PADDR 0xF0000000 /* phys.addr of kio_cached */
1045#define XCHAL_KIO_CACHED_SIZE 0x10000000 /* size in bytes of kio_cached (assumed power of 2!!!) */
1046#define XCHAL_KIO_BYPASS_VADDR 0xF0000000 /* virt.addr of kernel I/O bypass (uncached) static map */
1047#define XCHAL_KIO_BYPASS_PADDR 0xF0000000 /* phys.addr of kio_bypass */
1048#define XCHAL_KIO_BYPASS_SIZE 0x10000000 /* size in bytes of kio_bypass (assumed power of 2!!!) */
1049
1050#define XCHAL_SEG_MAPPABLE_VADDR 0x00000000 /* start of largest non-static-mapped virtual addr area */
1051#define XCHAL_SEG_MAPPABLE_SIZE 0xD0000000 /* size in bytes of " */
1052/* define XCHAL_SEG_MAPPABLE2_xxx if more areas present, sorted in order of descending size. */
1053#endif
1054
1055
1056/*----------------------------------------------------------------------
1057 MISC
1058 ----------------------------------------------------------------------*/
1059
1060#define XCHAL_NUM_WRITEBUFFER_ENTRIES 4 /* number of write buffer entries */
1061
1062#define XCHAL_CORE_ID "linux_be" /* configuration's alphanumeric core identifier
1063 (CoreID) set in the Xtensa Processor Generator */
1064
1065#define XCHAL_BUILD_UNIQUE_ID 0x00003256 /* software build-unique ID (22-bit) */
1066
1067/* These definitions describe the hardware targeted by this software: */
1068#define XCHAL_HW_CONFIGID0 0xC103D1FF /* config ID reg 0 value (upper 32 of 64 bits) */
1069#define XCHAL_HW_CONFIGID1 0x00803256 /* config ID reg 1 value (lower 32 of 64 bits) */
1070#define XCHAL_CONFIGID0 XCHAL_HW_CONFIGID0 /* for backward compatibility only -- don't use! */
1071#define XCHAL_CONFIGID1 XCHAL_HW_CONFIGID1 /* for backward compatibility only -- don't use! */
1072#define XCHAL_HW_RELEASE_MAJOR 1050 /* major release of targeted hardware */
1073#define XCHAL_HW_RELEASE_MINOR 1 /* minor release of targeted hardware */
1074#define XCHAL_HW_RELEASE_NAME "T1050.1" /* full release name of targeted hardware */
1075#define XTHAL_HW_REL_T1050 1
1076#define XTHAL_HW_REL_T1050_1 1
1077#define XCHAL_HW_CONFIGID_RELIABLE 1
1078
1079
1080/*
1081 * Miscellaneous special register fields:
1082 */
1083
1084
1085/* DBREAKC (special register number 160): */
1086#define XCHAL_DBREAKC_VALIDMASK 0xC000003F /* bits of DBREAKC that are defined */
1087/* MASK field: */
1088#define XCHAL_DBREAKC_MASK_BITS 6 /* number of bits in MASK field */
1089#define XCHAL_DBREAKC_MASK_NUM 64 /* max number of possible causes (2^bits) */
1090#define XCHAL_DBREAKC_MASK_SHIFT 0 /* position of MASK bits in DBREAKC, starting from lsbit */
1091#define XCHAL_DBREAKC_MASK_MASK 0x0000003F /* mask of bits in MASK field of DBREAKC */
1092/* LOADBREAK field: */
1093#define XCHAL_DBREAKC_LOADBREAK_BITS 1 /* number of bits in LOADBREAK field */
1094#define XCHAL_DBREAKC_LOADBREAK_NUM 2 /* max number of possible causes (2^bits) */
1095#define XCHAL_DBREAKC_LOADBREAK_SHIFT 30 /* position of LOADBREAK bits in DBREAKC, starting from lsbit */
1096#define XCHAL_DBREAKC_LOADBREAK_MASK 0x40000000 /* mask of bits in LOADBREAK field of DBREAKC */
1097/* STOREBREAK field: */
1098#define XCHAL_DBREAKC_STOREBREAK_BITS 1 /* number of bits in STOREBREAK field */
1099#define XCHAL_DBREAKC_STOREBREAK_NUM 2 /* max number of possible causes (2^bits) */
1100#define XCHAL_DBREAKC_STOREBREAK_SHIFT 31 /* position of STOREBREAK bits in DBREAKC, starting from lsbit */
1101#define XCHAL_DBREAKC_STOREBREAK_MASK 0x80000000 /* mask of bits in STOREBREAK field of DBREAKC */
1102
1103/* PS (special register number 230): */
1104#define XCHAL_PS_VALIDMASK 0x00070FFF /* bits of PS that are defined */
1105/* INTLEVEL field: */
1106#define XCHAL_PS_INTLEVEL_BITS 4 /* number of bits in INTLEVEL field */
1107#define XCHAL_PS_INTLEVEL_NUM 16 /* max number of possible causes (2^bits) */
1108#define XCHAL_PS_INTLEVEL_SHIFT 0 /* position of INTLEVEL bits in PS, starting from lsbit */
1109#define XCHAL_PS_INTLEVEL_MASK 0x0000000F /* mask of bits in INTLEVEL field of PS */
1110/* EXCM field: */
1111#define XCHAL_PS_EXCM_BITS 1 /* number of bits in EXCM field */
1112#define XCHAL_PS_EXCM_NUM 2 /* max number of possible causes (2^bits) */
1113#define XCHAL_PS_EXCM_SHIFT 4 /* position of EXCM bits in PS, starting from lsbit */
1114#define XCHAL_PS_EXCM_MASK 0x00000010 /* mask of bits in EXCM field of PS */
1115/* PROGSTACK field: */
1116#define XCHAL_PS_PROGSTACK_BITS 1 /* number of bits in PROGSTACK field */
1117#define XCHAL_PS_PROGSTACK_NUM 2 /* max number of possible causes (2^bits) */
1118#define XCHAL_PS_PROGSTACK_SHIFT 5 /* position of PROGSTACK bits in PS, starting from lsbit */
1119#define XCHAL_PS_PROGSTACK_MASK 0x00000020 /* mask of bits in PROGSTACK field of PS */
1120/* RING field: */
1121#define XCHAL_PS_RING_BITS 2 /* number of bits in RING field */
1122#define XCHAL_PS_RING_NUM 4 /* max number of possible causes (2^bits) */
1123#define XCHAL_PS_RING_SHIFT 6 /* position of RING bits in PS, starting from lsbit */
1124#define XCHAL_PS_RING_MASK 0x000000C0 /* mask of bits in RING field of PS */
1125/* OWB field: */
1126#define XCHAL_PS_OWB_BITS 4 /* number of bits in OWB field */
1127#define XCHAL_PS_OWB_NUM 16 /* max number of possible causes (2^bits) */
1128#define XCHAL_PS_OWB_SHIFT 8 /* position of OWB bits in PS, starting from lsbit */
1129#define XCHAL_PS_OWB_MASK 0x00000F00 /* mask of bits in OWB field of PS */
1130/* CALLINC field: */
1131#define XCHAL_PS_CALLINC_BITS 2 /* number of bits in CALLINC field */
1132#define XCHAL_PS_CALLINC_NUM 4 /* max number of possible causes (2^bits) */
1133#define XCHAL_PS_CALLINC_SHIFT 16 /* position of CALLINC bits in PS, starting from lsbit */
1134#define XCHAL_PS_CALLINC_MASK 0x00030000 /* mask of bits in CALLINC field of PS */
1135/* WOE field: */
1136#define XCHAL_PS_WOE_BITS 1 /* number of bits in WOE field */
1137#define XCHAL_PS_WOE_NUM 2 /* max number of possible causes (2^bits) */
1138#define XCHAL_PS_WOE_SHIFT 18 /* position of WOE bits in PS, starting from lsbit */
1139#define XCHAL_PS_WOE_MASK 0x00040000 /* mask of bits in WOE field of PS */
1140
1141/* EXCCAUSE (special register number 232): */
1142#define XCHAL_EXCCAUSE_VALIDMASK 0x0000003F /* bits of EXCCAUSE that are defined */
1143/* EXCCAUSE field: */
1144#define XCHAL_EXCCAUSE_BITS 6 /* number of bits in EXCCAUSE register */
1145#define XCHAL_EXCCAUSE_NUM 64 /* max number of possible causes (2^bits) */
1146#define XCHAL_EXCCAUSE_SHIFT 0 /* position of EXCCAUSE bits in register, starting from lsbit */
1147#define XCHAL_EXCCAUSE_MASK 0x0000003F /* mask of bits in EXCCAUSE register */
1148
1149/* DEBUGCAUSE (special register number 233): */
1150#define XCHAL_DEBUGCAUSE_VALIDMASK 0x0000003F /* bits of DEBUGCAUSE that are defined */
1151/* ICOUNT field: */
1152#define XCHAL_DEBUGCAUSE_ICOUNT_BITS 1 /* number of bits in ICOUNT field */
1153#define XCHAL_DEBUGCAUSE_ICOUNT_NUM 2 /* max number of possible causes (2^bits) */
1154#define XCHAL_DEBUGCAUSE_ICOUNT_SHIFT 0 /* position of ICOUNT bits in DEBUGCAUSE, starting from lsbit */
1155#define XCHAL_DEBUGCAUSE_ICOUNT_MASK 0x00000001 /* mask of bits in ICOUNT field of DEBUGCAUSE */
1156/* IBREAK field: */
1157#define XCHAL_DEBUGCAUSE_IBREAK_BITS 1 /* number of bits in IBREAK field */
1158#define XCHAL_DEBUGCAUSE_IBREAK_NUM 2 /* max number of possible causes (2^bits) */
1159#define XCHAL_DEBUGCAUSE_IBREAK_SHIFT 1 /* position of IBREAK bits in DEBUGCAUSE, starting from lsbit */
1160#define XCHAL_DEBUGCAUSE_IBREAK_MASK 0x00000002 /* mask of bits in IBREAK field of DEBUGCAUSE */
1161/* DBREAK field: */
1162#define XCHAL_DEBUGCAUSE_DBREAK_BITS 1 /* number of bits in DBREAK field */
1163#define XCHAL_DEBUGCAUSE_DBREAK_NUM 2 /* max number of possible causes (2^bits) */
1164#define XCHAL_DEBUGCAUSE_DBREAK_SHIFT 2 /* position of DBREAK bits in DEBUGCAUSE, starting from lsbit */
1165#define XCHAL_DEBUGCAUSE_DBREAK_MASK 0x00000004 /* mask of bits in DBREAK field of DEBUGCAUSE */
1166/* BREAK field: */
1167#define XCHAL_DEBUGCAUSE_BREAK_BITS 1 /* number of bits in BREAK field */
1168#define XCHAL_DEBUGCAUSE_BREAK_NUM 2 /* max number of possible causes (2^bits) */
1169#define XCHAL_DEBUGCAUSE_BREAK_SHIFT 3 /* position of BREAK bits in DEBUGCAUSE, starting from lsbit */
1170#define XCHAL_DEBUGCAUSE_BREAK_MASK 0x00000008 /* mask of bits in BREAK field of DEBUGCAUSE */
1171/* BREAKN field: */
1172#define XCHAL_DEBUGCAUSE_BREAKN_BITS 1 /* number of bits in BREAKN field */
1173#define XCHAL_DEBUGCAUSE_BREAKN_NUM 2 /* max number of possible causes (2^bits) */
1174#define XCHAL_DEBUGCAUSE_BREAKN_SHIFT 4 /* position of BREAKN bits in DEBUGCAUSE, starting from lsbit */
1175#define XCHAL_DEBUGCAUSE_BREAKN_MASK 0x00000010 /* mask of bits in BREAKN field of DEBUGCAUSE */
1176/* DEBUGINT field: */
1177#define XCHAL_DEBUGCAUSE_DEBUGINT_BITS 1 /* number of bits in DEBUGINT field */
1178#define XCHAL_DEBUGCAUSE_DEBUGINT_NUM 2 /* max number of possible causes (2^bits) */
1179#define XCHAL_DEBUGCAUSE_DEBUGINT_SHIFT 5 /* position of DEBUGINT bits in DEBUGCAUSE, starting from lsbit */
1180#define XCHAL_DEBUGCAUSE_DEBUGINT_MASK 0x00000020 /* mask of bits in DEBUGINT field of DEBUGCAUSE */
1181
1182
1183
1184/*----------------------------------------------------------------------
1185 ISA
1186 ----------------------------------------------------------------------*/
1187
1188#define XCHAL_HAVE_DENSITY 1 /* 1 if density option configured, 0 otherwise */
1189#define XCHAL_HAVE_LOOPS 1 /* 1 if zero-overhead loops option configured, 0 otherwise */
1190/* Misc instructions: */
1191#define XCHAL_HAVE_NSA 0 /* 1 if NSA/NSAU instructions option configured, 0 otherwise */
1192#define XCHAL_HAVE_MINMAX 0 /* 1 if MIN/MAX instructions option configured, 0 otherwise */
1193#define XCHAL_HAVE_SEXT 0 /* 1 if sign-extend instruction option configured, 0 otherwise */
1194#define XCHAL_HAVE_CLAMPS 0 /* 1 if CLAMPS instruction option configured, 0 otherwise */
1195#define XCHAL_HAVE_MAC16 0 /* 1 if MAC16 option configured, 0 otherwise */
1196#define XCHAL_HAVE_MUL16 0 /* 1 if 16-bit integer multiply option configured, 0 otherwise */
1197/*#define XCHAL_HAVE_POPC 0*/ /* 1 if CRC instruction option configured, 0 otherwise */
1198/*#define XCHAL_HAVE_CRC 0*/ /* 1 if POPC instruction option configured, 0 otherwise */
1199
1200#define XCHAL_HAVE_SPECULATION 0 /* 1 if speculation option configured, 0 otherwise */
1201/*#define XCHAL_HAVE_MP_SYNC 0*/ /* 1 if multiprocessor sync. option configured, 0 otherwise */
1202#define XCHAL_HAVE_PRID 0 /* 1 if processor ID register configured, 0 otherwise */
1203
1204#define XCHAL_NUM_MISC_REGS 2 /* number of miscellaneous registers (0..4) */
1205
1206/* These relate a bit more to TIE: */
1207#define XCHAL_HAVE_BOOLEANS 0 /* 1 if booleans option configured, 0 otherwise */
1208#define XCHAL_HAVE_MUL32 0 /* 1 if 32-bit integer multiply option configured, 0 otherwise */
1209#define XCHAL_HAVE_MUL32_HIGH 0 /* 1 if MUL32 option includes MULUH and MULSH, 0 otherwise */
1210#define XCHAL_HAVE_FP 0 /* 1 if floating point option configured, 0 otherwise */
1211
1212
1213/*----------------------------------------------------------------------
1214 DERIVED
1215 ----------------------------------------------------------------------*/
1216
1217#if XCHAL_HAVE_BE
1218#define XCHAL_INST_ILLN 0xD60F /* 2-byte illegal instruction, msb-first */
1219#define XCHAL_INST_ILLN_BYTE0 0xD6 /* 2-byte illegal instruction, 1st byte */
1220#define XCHAL_INST_ILLN_BYTE1 0x0F /* 2-byte illegal instruction, 2nd byte */
1221#else
1222#define XCHAL_INST_ILLN 0xF06D /* 2-byte illegal instruction, lsb-first */
1223#define XCHAL_INST_ILLN_BYTE0 0x6D /* 2-byte illegal instruction, 1st byte */
1224#define XCHAL_INST_ILLN_BYTE1 0xF0 /* 2-byte illegal instruction, 2nd byte */
1225#endif
1226/* Belongs in xtensa/hal.h: */
1227#define XTHAL_INST_ILL 0x000000 /* 3-byte illegal instruction */
1228
1229
1230/*
1231 * Because information as to exactly which hardware release is targeted
1232 * by a given software build is not always available, compile-time HAL
1233 * Hardware-Release "_AT" macros are fuzzy (return 0, 1, or XCHAL_MAYBE):
1234 */
1235#ifndef XCHAL_HW_RELEASE_MAJOR
1236# define XCHAL_HW_CONFIGID_RELIABLE 0
1237#endif
1238#if XCHAL_HW_CONFIGID_RELIABLE
1239# define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) (XTHAL_REL_LE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
1240# define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) (XTHAL_REL_GE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
1241# define XCHAL_HW_RELEASE_AT(major,minor) (XTHAL_REL_EQ( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
1242# define XCHAL_HW_RELEASE_MAJOR_AT(major) ((XCHAL_HW_RELEASE_MAJOR == (major)) ? 1 : 0)
1243#else
1244# define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) ( ((major) < 1040 && XCHAL_HAVE_XEA2) ? 0 \
1245 : ((major) > 1050 && XCHAL_HAVE_XEA1) ? 1 \
1246 : XTHAL_MAYBE )
1247# define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) ( ((major) >= 2000 && XCHAL_HAVE_XEA1) ? 0 \
1248 : (XTHAL_REL_LE(major,minor, 1040,0) && XCHAL_HAVE_XEA2) ? 1 \
1249 : XTHAL_MAYBE )
1250# define XCHAL_HW_RELEASE_AT(major,minor) ( (((major) < 1040 && XCHAL_HAVE_XEA2) || \
1251 ((major) >= 2000 && XCHAL_HAVE_XEA1)) ? 0 : XTHAL_MAYBE)
1252# define XCHAL_HW_RELEASE_MAJOR_AT(major) XCHAL_HW_RELEASE_AT(major,0)
1253#endif
1254
1255/*
1256 * Specific errata:
1257 */
1258
1259/*
1260 * Erratum T1020.H13, T1030.H7, T1040.H10, T1050.H4 (fixed in T1040.3 and T1050.1;
1261 * relevant only in XEA1, kernel-vector mode, level-one interrupts and overflows enabled):
1262 */
1263#define XCHAL_MAYHAVE_ERRATUM_XEA1KWIN (XCHAL_HAVE_XEA1 && \
1264 (XCHAL_HW_RELEASE_AT_OR_BELOW(1040,2) != 0 \
1265 || XCHAL_HW_RELEASE_AT(1050,0)))
1266
1267
1268
1269#endif /*XTENSA_CONFIG_CORE_H*/
1270
diff --git a/include/asm-xtensa/xtensa/config-linux_be/defs.h b/include/asm-xtensa/xtensa/config-linux_be/defs.h
deleted file mode 100644
index f7c58b273371..000000000000
--- a/include/asm-xtensa/xtensa/config-linux_be/defs.h
+++ /dev/null
@@ -1,270 +0,0 @@
1/* Definitions for Xtensa instructions, types, and protos. */
2
3/*
4 * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of version 2.1 of the GNU Lesser General Public
8 * License as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it would be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *
14 * Further, this software is distributed without any warranty that it is
15 * free of the rightful claim of any third person regarding infringement
16 * or the like. Any license provided herein, whether implied or
17 * otherwise, applies only to this software file. Patent licenses, if
18 * any, provided herein do not apply to combinations of this program with
19 * other software, or any other product whatsoever.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
24 * USA.
25 */
26
27/* Do not modify. This is automatically generated.*/
28
29#ifndef _XTENSA_BASE_HEADER
30#define _XTENSA_BASE_HEADER
31
32#ifdef __XTENSA__
33#if defined(__GNUC__) && !defined(__XCC__)
34
35#define L8UI_ASM(arr, ars, imm) { \
36 __asm__ volatile("l8ui %0, %1, %2" : "=a" (arr) : "a" (ars) , "i" (imm)); \
37}
38
39#define XT_L8UI(ars, imm) \
40({ \
41 unsigned char _arr; \
42 const unsigned char *_ars = ars; \
43 L8UI_ASM(_arr, _ars, imm); \
44 _arr; \
45})
46
47#define L16UI_ASM(arr, ars, imm) { \
48 __asm__ volatile("l16ui %0, %1, %2" : "=a" (arr) : "a" (ars) , "i" (imm)); \
49}
50
51#define XT_L16UI(ars, imm) \
52({ \
53 unsigned short _arr; \
54 const unsigned short *_ars = ars; \
55 L16UI_ASM(_arr, _ars, imm); \
56 _arr; \
57})
58
59#define L16SI_ASM(arr, ars, imm) {\
60 __asm__ volatile("l16si %0, %1, %2" : "=a" (arr) : "a" (ars) , "i" (imm)); \
61}
62
63#define XT_L16SI(ars, imm) \
64({ \
65 signed short _arr; \
66 const signed short *_ars = ars; \
67 L16SI_ASM(_arr, _ars, imm); \
68 _arr; \
69})
70
71#define L32I_ASM(arr, ars, imm) { \
72 __asm__ volatile("l32i %0, %1, %2" : "=a" (arr) : "a" (ars) , "i" (imm)); \
73}
74
75#define XT_L32I(ars, imm) \
76({ \
77 unsigned _arr; \
78 const unsigned *_ars = ars; \
79 L32I_ASM(_arr, _ars, imm); \
80 _arr; \
81})
82
83#define S8I_ASM(arr, ars, imm) {\
84 __asm__ volatile("s8i %0, %1, %2" : : "a" (arr), "a" (ars) , "i" (imm) : "memory" ); \
85}
86
87#define XT_S8I(arr, ars, imm) \
88({ \
89 signed char _arr = arr; \
90 const signed char *_ars = ars; \
91 S8I_ASM(_arr, _ars, imm); \
92})
93
94#define S16I_ASM(arr, ars, imm) {\
95 __asm__ volatile("s16i %0, %1, %2" : : "a" (arr), "a" (ars) , "i" (imm) : "memory" ); \
96}
97
98#define XT_S16I(arr, ars, imm) \
99({ \
100 signed short _arr = arr; \
101 const signed short *_ars = ars; \
102 S16I_ASM(_arr, _ars, imm); \
103})
104
105#define S32I_ASM(arr, ars, imm) { \
106 __asm__ volatile("s32i %0, %1, %2" : : "a" (arr), "a" (ars) , "i" (imm) : "memory" ); \
107}
108
109#define XT_S32I(arr, ars, imm) \
110({ \
111 signed int _arr = arr; \
112 const signed int *_ars = ars; \
113 S32I_ASM(_arr, _ars, imm); \
114})
115
116#define ADDI_ASM(art, ars, imm) {\
117 __asm__ ("addi %0, %1, %2" : "=a" (art) : "a" (ars), "i" (imm)); \
118}
119
120#define XT_ADDI(ars, imm) \
121({ \
122 unsigned _art; \
123 unsigned _ars = ars; \
124 ADDI_ASM(_art, _ars, imm); \
125 _art; \
126})
127
128#define ABS_ASM(arr, art) {\
129 __asm__ ("abs %0, %1" : "=a" (arr) : "a" (art)); \
130}
131
132#define XT_ABS(art) \
133({ \
134 unsigned _arr; \
135 signed _art = art; \
136 ABS_ASM(_arr, _art); \
137 _arr; \
138})
139
140/* Note: In the following macros that reference SAR, the magic "state"
141 register is used to capture the dependency on SAR. This is because
142 SAR is a 5-bit register and thus there are no C types that can be
143 used to represent it. It doesn't appear that the SAR register is
144 even relevant to GCC, but it is marked as "clobbered" just in
145 case. */
146
147#define SRC_ASM(arr, ars, art) {\
148 register int _xt_sar __asm__ ("state"); \
149 __asm__ ("src %0, %1, %2" \
150 : "=a" (arr) : "a" (ars), "a" (art), "t" (_xt_sar)); \
151}
152
153#define XT_SRC(ars, art) \
154({ \
155 unsigned _arr; \
156 unsigned _ars = ars; \
157 unsigned _art = art; \
158 SRC_ASM(_arr, _ars, _art); \
159 _arr; \
160})
161
162#define SSR_ASM(ars) {\
163 register int _xt_sar __asm__ ("state"); \
164 __asm__ ("ssr %1" : "=t" (_xt_sar) : "a" (ars) : "sar"); \
165}
166
167#define XT_SSR(ars) \
168({ \
169 unsigned _ars = ars; \
170 SSR_ASM(_ars); \
171})
172
173#define SSL_ASM(ars) {\
174 register int _xt_sar __asm__ ("state"); \
175 __asm__ ("ssl %1" : "=t" (_xt_sar) : "a" (ars) : "sar"); \
176}
177
178#define XT_SSL(ars) \
179({ \
180 unsigned _ars = ars; \
181 SSL_ASM(_ars); \
182})
183
184#define SSA8B_ASM(ars) {\
185 register int _xt_sar __asm__ ("state"); \
186 __asm__ ("ssa8b %1" : "=t" (_xt_sar) : "a" (ars) : "sar"); \
187}
188
189#define XT_SSA8B(ars) \
190({ \
191 unsigned _ars = ars; \
192 SSA8B_ASM(_ars); \
193})
194
195#define SSA8L_ASM(ars) {\
196 register int _xt_sar __asm__ ("state"); \
197 __asm__ ("ssa8l %1" : "=t" (_xt_sar) : "a" (ars) : "sar"); \
198}
199
200#define XT_SSA8L(ars) \
201({ \
202 unsigned _ars = ars; \
203 SSA8L_ASM(_ars); \
204})
205
206#define SSAI_ASM(imm) {\
207 register int _xt_sar __asm__ ("state"); \
208 __asm__ ("ssai %1" : "=t" (_xt_sar) : "i" (imm) : "sar"); \
209}
210
211#define XT_SSAI(imm) \
212({ \
213 SSAI_ASM(imm); \
214})
215
216
217
218
219
220
221
222
223#endif /* __GNUC__ && !__XCC__ */
224
225#ifdef __XCC__
226
227/* Core load/store instructions */
228extern unsigned char _TIE_L8UI(const unsigned char * ars, immediate imm);
229extern unsigned short _TIE_L16UI(const unsigned short * ars, immediate imm);
230extern signed short _TIE_L16SI(const signed short * ars, immediate imm);
231extern unsigned _TIE_L32I(const unsigned * ars, immediate imm);
232extern void _TIE_S8I(unsigned char arr, unsigned char * ars, immediate imm);
233extern void _TIE_S16I(unsigned short arr, unsigned short * ars, immediate imm);
234extern void _TIE_S32I(unsigned arr, unsigned * ars, immediate imm);
235
236#define XT_L8UI _TIE_L8UI
237#define XT_L16UI _TIE_L16UI
238#define XT_L16SI _TIE_L16SI
239#define XT_L32I _TIE_L32I
240#define XT_S8I _TIE_S8I
241#define XT_S16I _TIE_S16I
242#define XT_S32I _TIE_S32I
243
244/* Add-immediate instruction */
245extern unsigned _TIE_ADDI(unsigned ars, immediate imm);
246#define XT_ADDI _TIE_ADDI
247
248/* Absolute value instruction */
249extern unsigned _TIE_ABS(int art);
250#define XT_ABS _TIE_ABS
251
252/* funnel shift instructions */
253extern unsigned _TIE_SRC(unsigned ars, unsigned art);
254#define XT_SRC _TIE_SRC
255extern void _TIE_SSR(unsigned ars);
256#define XT_SSR _TIE_SSR
257extern void _TIE_SSL(unsigned ars);
258#define XT_SSL _TIE_SSL
259extern void _TIE_SSA8B(unsigned ars);
260#define XT_SSA8B _TIE_SSA8B
261extern void _TIE_SSA8L(unsigned ars);
262#define XT_SSA8L _TIE_SSA8L
263extern void _TIE_SSAI(immediate imm);
264#define XT_SSAI _TIE_SSAI
265
266
267#endif /* __XCC__ */
268
269#endif /* __XTENSA__ */
270#endif /* !_XTENSA_BASE_HEADER */
diff --git a/include/asm-xtensa/xtensa/config-linux_be/specreg.h b/include/asm-xtensa/xtensa/config-linux_be/specreg.h
deleted file mode 100644
index fa4106aa9a02..000000000000
--- a/include/asm-xtensa/xtensa/config-linux_be/specreg.h
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * Xtensa Special Register symbolic names
3 */
4
5/* $Id: specreg.h,v 1.2 2003/03/07 19:15:18 joetaylor Exp $ */
6
7/*
8 * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2.1 of the GNU Lesser General Public
12 * License as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it would be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 *
18 * Further, this software is distributed without any warranty that it is
19 * free of the rightful claim of any third person regarding infringement
20 * or the like. Any license provided herein, whether implied or
21 * otherwise, applies only to this software file. Patent licenses, if
22 * any, provided herein do not apply to combinations of this program with
23 * other software, or any other product whatsoever.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this program; if not, write the Free Software
27 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
28 * USA.
29 */
30
31#ifndef XTENSA_SPECREG_H
32#define XTENSA_SPECREG_H
33
34/* Include these special register bitfield definitions, for historical reasons: */
35#include <xtensa/corebits.h>
36
37
38/* Special registers: */
39#define LBEG 0
40#define LEND 1
41#define LCOUNT 2
42#define SAR 3
43#define WINDOWBASE 72
44#define WINDOWSTART 73
45#define PTEVADDR 83
46#define RASID 90
47#define ITLBCFG 91
48#define DTLBCFG 92
49#define IBREAKENABLE 96
50#define DDR 104
51#define IBREAKA_0 128
52#define IBREAKA_1 129
53#define DBREAKA_0 144
54#define DBREAKA_1 145
55#define DBREAKC_0 160
56#define DBREAKC_1 161
57#define EPC_1 177
58#define EPC_2 178
59#define EPC_3 179
60#define EPC_4 180
61#define DEPC 192
62#define EPS_2 194
63#define EPS_3 195
64#define EPS_4 196
65#define EXCSAVE_1 209
66#define EXCSAVE_2 210
67#define EXCSAVE_3 211
68#define EXCSAVE_4 212
69#define INTERRUPT 226
70#define INTENABLE 228
71#define PS 230
72#define EXCCAUSE 232
73#define DEBUGCAUSE 233
74#define CCOUNT 234
75#define ICOUNT 236
76#define ICOUNTLEVEL 237
77#define EXCVADDR 238
78#define CCOMPARE_0 240
79#define CCOMPARE_1 241
80#define CCOMPARE_2 242
81#define MISC_REG_0 244
82#define MISC_REG_1 245
83
84/* Special cases (bases of special register series): */
85#define IBREAKA 128
86#define DBREAKA 144
87#define DBREAKC 160
88#define EPC 176
89#define EPS 192
90#define EXCSAVE 208
91#define CCOMPARE 240
92
93/* Special names for read-only and write-only interrupt registers: */
94#define INTREAD 226
95#define INTSET 226
96#define INTCLEAR 227
97
98#endif /* XTENSA_SPECREG_H */
99
diff --git a/include/asm-xtensa/xtensa/config-linux_be/system.h b/include/asm-xtensa/xtensa/config-linux_be/system.h
deleted file mode 100644
index cf9d4d308e3a..000000000000
--- a/include/asm-xtensa/xtensa/config-linux_be/system.h
+++ /dev/null
@@ -1,198 +0,0 @@
1/*
2 * xtensa/config/system.h -- HAL definitions that are dependent on SYSTEM configuration
3 *
4 * NOTE: The location and contents of this file are highly subject to change.
5 *
6 * Source for configuration-independent binaries (which link in a
7 * configuration-specific HAL library) must NEVER include this file.
8 * The HAL itself has historically included this file in some instances,
9 * but this is not appropriate either, because the HAL is meant to be
10 * core-specific but system independent.
11 */
12
13/*
14 * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of version 2.1 of the GNU Lesser General Public
18 * License as published by the Free Software Foundation.
19 *
20 * This program is distributed in the hope that it would be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 *
24 * Further, this software is distributed without any warranty that it is
25 * free of the rightful claim of any third person regarding infringement
26 * or the like. Any license provided herein, whether implied or
27 * otherwise, applies only to this software file. Patent licenses, if
28 * any, provided herein do not apply to combinations of this program with
29 * other software, or any other product whatsoever.
30 *
31 * You should have received a copy of the GNU Lesser General Public
32 * License along with this program; if not, write the Free Software
33 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
34 * USA.
35 */
36
37
38#ifndef XTENSA_CONFIG_SYSTEM_H
39#define XTENSA_CONFIG_SYSTEM_H
40
41/*#include <xtensa/hal.h>*/
42
43
44
45/*----------------------------------------------------------------------
46 DEVICE ADDRESSES
47 ----------------------------------------------------------------------*/
48
49/*
50 * Strange place to find these, but the configuration GUI
51 * allows moving these around to account for various core
52 * configurations. Specific boards (and their BSP software)
53 * will have specific meanings for these components.
54 */
55
56/* I/O Block areas: */
57#define XSHAL_IOBLOCK_CACHED_VADDR 0xE0000000
58#define XSHAL_IOBLOCK_CACHED_PADDR 0xF0000000
59#define XSHAL_IOBLOCK_CACHED_SIZE 0x0E000000
60
61#define XSHAL_IOBLOCK_BYPASS_VADDR 0xF0000000
62#define XSHAL_IOBLOCK_BYPASS_PADDR 0xF0000000
63#define XSHAL_IOBLOCK_BYPASS_SIZE 0x0E000000
64
65/* System ROM: */
66#define XSHAL_ROM_VADDR 0xEE000000
67#define XSHAL_ROM_PADDR 0xFE000000
68#define XSHAL_ROM_SIZE 0x00400000
69/* Largest available area (free of vectors): */
70#define XSHAL_ROM_AVAIL_VADDR 0xEE00052C
71#define XSHAL_ROM_AVAIL_VSIZE 0x003FFAD4
72
73/* System RAM: */
74#define XSHAL_RAM_VADDR 0xD0000000
75#define XSHAL_RAM_PADDR 0x00000000
76#define XSHAL_RAM_VSIZE 0x08000000
77#define XSHAL_RAM_PSIZE 0x10000000
78#define XSHAL_RAM_SIZE XSHAL_RAM_PSIZE
79/* Largest available area (free of vectors): */
80#define XSHAL_RAM_AVAIL_VADDR 0xD0000370
81#define XSHAL_RAM_AVAIL_VSIZE 0x07FFFC90
82
83/*
84 * Shadow system RAM (same device as system RAM, at different address).
85 * (Emulation boards need this for the SONIC Ethernet driver
86 * when data caches are configured for writeback mode.)
87 * NOTE: on full MMU configs, this points to the BYPASS virtual address
88 * of system RAM, ie. is the same as XSHAL_RAM_* except that virtual
89 * addresses are viewed through the BYPASS static map rather than
90 * the CACHED static map.
91 */
92#define XSHAL_RAM_BYPASS_VADDR 0xD8000000
93#define XSHAL_RAM_BYPASS_PADDR 0x00000000
94#define XSHAL_RAM_BYPASS_PSIZE 0x08000000
95
96/* Alternate system RAM (different device than system RAM): */
97#define XSHAL_ALTRAM_VADDR 0xCEE00000
98#define XSHAL_ALTRAM_PADDR 0xC0000000
99#define XSHAL_ALTRAM_SIZE 0x00200000
100
101
102/*----------------------------------------------------------------------
103 * DEVICE-ADDRESS DEPENDENT...
104 *
105 * Values written to CACHEATTR special register (or its equivalent)
106 * to enable and disable caches in various modes.
107 *----------------------------------------------------------------------*/
108
109/*----------------------------------------------------------------------
110 BACKWARD COMPATIBILITY ...
111 ----------------------------------------------------------------------*/
112
113/*
114 * NOTE: the following two macros are DEPRECATED. Use the latter
115 * board-specific macros instead, which are specially tuned for the
116 * particular target environments' memory maps.
117 */
118#define XSHAL_CACHEATTR_BYPASS XSHAL_XT2000_CACHEATTR_BYPASS /* disable caches in bypass mode */
119#define XSHAL_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_DEFAULT /* default setting to enable caches (no writeback!) */
120
121/*----------------------------------------------------------------------
122 ISS (Instruction Set Simulator) SPECIFIC ...
123 ----------------------------------------------------------------------*/
124
125#define XSHAL_ISS_CACHEATTR_WRITEBACK 0x1122222F /* enable caches in write-back mode */
126#define XSHAL_ISS_CACHEATTR_WRITEALLOC 0x1122222F /* enable caches in write-allocate mode */
127#define XSHAL_ISS_CACHEATTR_WRITETHRU 0x1122222F /* enable caches in write-through mode */
128#define XSHAL_ISS_CACHEATTR_BYPASS 0x2222222F /* disable caches in bypass mode */
129#define XSHAL_ISS_CACHEATTR_DEFAULT XSHAL_ISS_CACHEATTR_WRITEBACK /* default setting to enable caches */
130
131/* For Coware only: */
132#define XSHAL_COWARE_CACHEATTR_WRITEBACK 0x11222222 /* enable caches in write-back mode */
133#define XSHAL_COWARE_CACHEATTR_WRITEALLOC 0x11222222 /* enable caches in write-allocate mode */
134#define XSHAL_COWARE_CACHEATTR_WRITETHRU 0x11222222 /* enable caches in write-through mode */
135#define XSHAL_COWARE_CACHEATTR_BYPASS 0x22222222 /* disable caches in bypass mode */
136#define XSHAL_COWARE_CACHEATTR_DEFAULT XSHAL_COWARE_CACHEATTR_WRITEBACK /* default setting to enable caches */
137
138/* For BFM and other purposes: */
139#define XSHAL_ALLVALID_CACHEATTR_WRITEBACK 0x11222222 /* enable caches without any invalid regions */
140#define XSHAL_ALLVALID_CACHEATTR_DEFAULT XSHAL_ALLVALID_CACHEATTR_WRITEBACK /* default setting for caches without any invalid regions */
141
142#define XSHAL_ISS_PIPE_REGIONS 0
143#define XSHAL_ISS_SDRAM_REGIONS 0
144
145
146/*----------------------------------------------------------------------
147 XT2000 BOARD SPECIFIC ...
148 ----------------------------------------------------------------------*/
149
150#define XSHAL_XT2000_CACHEATTR_WRITEBACK 0x22FFFFFF /* enable caches in write-back mode */
151#define XSHAL_XT2000_CACHEATTR_WRITEALLOC 0x22FFFFFF /* enable caches in write-allocate mode */
152#define XSHAL_XT2000_CACHEATTR_WRITETHRU 0x22FFFFFF /* enable caches in write-through mode */
153#define XSHAL_XT2000_CACHEATTR_BYPASS 0x22FFFFFF /* disable caches in bypass mode */
154#define XSHAL_XT2000_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_WRITEBACK /* default setting to enable caches */
155
156#define XSHAL_XT2000_PIPE_REGIONS 0x00001000 /* BusInt pipeline regions */
157#define XSHAL_XT2000_SDRAM_REGIONS 0x00000005 /* BusInt SDRAM regions */
158
159
160/*----------------------------------------------------------------------
161 VECTOR SIZES
162 ----------------------------------------------------------------------*/
163
164/*
165 * Sizes allocated to vectors by the system (memory map) configuration.
166 * These sizes are constrained by core configuration (eg. one vector's
167 * code cannot overflow into another vector) but are dependent on the
168 * system or board (or LSP) memory map configuration.
169 *
170 * Whether or not each vector happens to be in a system ROM is also
171 * a system configuration matter, sometimes useful, included here also:
172 */
173#define XSHAL_RESET_VECTOR_SIZE 0x000004E0
174#define XSHAL_RESET_VECTOR_ISROM 1
175#define XSHAL_USER_VECTOR_SIZE 0x0000001C
176#define XSHAL_USER_VECTOR_ISROM 0
177#define XSHAL_PROGRAMEXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */
178#define XSHAL_USEREXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */
179#define XSHAL_KERNEL_VECTOR_SIZE 0x0000001C
180#define XSHAL_KERNEL_VECTOR_ISROM 0
181#define XSHAL_STACKEDEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */
182#define XSHAL_KERNELEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */
183#define XSHAL_DOUBLEEXC_VECTOR_SIZE 0x000000E0
184#define XSHAL_DOUBLEEXC_VECTOR_ISROM 0
185#define XSHAL_WINDOW_VECTORS_SIZE 0x00000180
186#define XSHAL_WINDOW_VECTORS_ISROM 0
187#define XSHAL_INTLEVEL2_VECTOR_SIZE 0x0000000C
188#define XSHAL_INTLEVEL2_VECTOR_ISROM 0
189#define XSHAL_INTLEVEL3_VECTOR_SIZE 0x0000000C
190#define XSHAL_INTLEVEL3_VECTOR_ISROM 0
191#define XSHAL_INTLEVEL4_VECTOR_SIZE 0x0000000C
192#define XSHAL_INTLEVEL4_VECTOR_ISROM 1
193#define XSHAL_DEBUG_VECTOR_SIZE XSHAL_INTLEVEL4_VECTOR_SIZE
194#define XSHAL_DEBUG_VECTOR_ISROM XSHAL_INTLEVEL4_VECTOR_ISROM
195
196
197#endif /*XTENSA_CONFIG_SYSTEM_H*/
198
diff --git a/include/asm-xtensa/xtensa/config-linux_be/tie.h b/include/asm-xtensa/xtensa/config-linux_be/tie.h
deleted file mode 100644
index 3c2e514602f4..000000000000
--- a/include/asm-xtensa/xtensa/config-linux_be/tie.h
+++ /dev/null
@@ -1,275 +0,0 @@
1/*
2 * xtensa/config/tie.h -- HAL definitions that are dependent on CORE and TIE configuration
3 *
4 * This header file is sometimes referred to as the "compile-time HAL" or CHAL.
5 * It was generated for a specific Xtensa processor configuration,
6 * and furthermore for a specific set of TIE source files that extend
7 * basic core functionality.
8 *
9 * Source for configuration-independent binaries (which link in a
10 * configuration-specific HAL library) must NEVER include this file.
11 * It is perfectly normal, however, for the HAL source itself to include this file.
12 */
13
14/*
15 * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of version 2.1 of the GNU Lesser General Public
19 * License as published by the Free Software Foundation.
20 *
21 * This program is distributed in the hope that it would be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 *
25 * Further, this software is distributed without any warranty that it is
26 * free of the rightful claim of any third person regarding infringement
27 * or the like. Any license provided herein, whether implied or
28 * otherwise, applies only to this software file. Patent licenses, if
29 * any, provided herein do not apply to combinations of this program with
30 * other software, or any other product whatsoever.
31 *
32 * You should have received a copy of the GNU Lesser General Public
33 * License along with this program; if not, write the Free Software
34 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
35 * USA.
36 */
37
38
39#ifndef XTENSA_CONFIG_TIE_H
40#define XTENSA_CONFIG_TIE_H
41
42#include <xtensa/hal.h>
43
44
45/*----------------------------------------------------------------------
46 GENERAL
47 ----------------------------------------------------------------------*/
48
49/*
50 * Separators for macros that expand into arrays.
51 * These can be predefined by files that #include this one,
52 * when different separators are required.
53 */
54/* Element separator for macros that expand into 1-dimensional arrays: */
55#ifndef XCHAL_SEP
56#define XCHAL_SEP ,
57#endif
58/* Array separator for macros that expand into 2-dimensional arrays: */
59#ifndef XCHAL_SEP2
60#define XCHAL_SEP2 },{
61#endif
62
63
64
65
66
67
68/*----------------------------------------------------------------------
69 COPROCESSORS and EXTRA STATE
70 ----------------------------------------------------------------------*/
71
72#define XCHAL_CP_NUM 0 /* number of coprocessors */
73#define XCHAL_CP_MAX 0 /* max coprocessor id plus one (0 if none) */
74#define XCHAL_CP_MASK 0x00 /* bitmask of coprocessors by id */
75
76/* Space for coprocessors' state save areas: */
77#define XCHAL_CP0_SA_SIZE 0
78#define XCHAL_CP1_SA_SIZE 0
79#define XCHAL_CP2_SA_SIZE 0
80#define XCHAL_CP3_SA_SIZE 0
81#define XCHAL_CP4_SA_SIZE 0
82#define XCHAL_CP5_SA_SIZE 0
83#define XCHAL_CP6_SA_SIZE 0
84#define XCHAL_CP7_SA_SIZE 0
85/* Minimum required alignments of CP state save areas: */
86#define XCHAL_CP0_SA_ALIGN 1
87#define XCHAL_CP1_SA_ALIGN 1
88#define XCHAL_CP2_SA_ALIGN 1
89#define XCHAL_CP3_SA_ALIGN 1
90#define XCHAL_CP4_SA_ALIGN 1
91#define XCHAL_CP5_SA_ALIGN 1
92#define XCHAL_CP6_SA_ALIGN 1
93#define XCHAL_CP7_SA_ALIGN 1
94
95/* Indexing macros: */
96#define _XCHAL_CP_SA_SIZE(n) XCHAL_CP ## n ## _SA_SIZE
97#define XCHAL_CP_SA_SIZE(n) _XCHAL_CP_SA_SIZE(n) /* n = 0 .. 7 */
98#define _XCHAL_CP_SA_ALIGN(n) XCHAL_CP ## n ## _SA_ALIGN
99#define XCHAL_CP_SA_ALIGN(n) _XCHAL_CP_SA_ALIGN(n) /* n = 0 .. 7 */
100
101
102/* Space for "extra" state (user special registers and non-cp TIE) save area: */
103#define XCHAL_EXTRA_SA_SIZE 0
104#define XCHAL_EXTRA_SA_ALIGN 1
105
106/* Total save area size (extra + all coprocessors) */
107/* (not useful until xthal_{save,restore}_all_extra() is implemented, */
108/* but included for Tor2 beta; doesn't account for alignment!): */
109#define XCHAL_CPEXTRA_SA_SIZE_TOR2 0 /* Tor2Beta temporary definition -- do not use */
110
111/* Combined required alignment for all CP and EXTRA state save areas */
112/* (does not include required alignment for any base config registers): */
113#define XCHAL_CPEXTRA_SA_ALIGN 1
114
115/* ... */
116
117
118#ifdef _ASMLANGUAGE
119/*
120 * Assembly-language specific definitions (assembly macros, etc.).
121 */
122#include <xtensa/config/specreg.h>
123
124/********************
125 * Macros to save and restore the non-coprocessor TIE portion of EXTRA state.
126 */
127
128/* (none) */
129
130
131/********************
132 * Macros to create functions that save and restore all EXTRA (non-coprocessor) state
133 * (does not include zero-overhead loop registers and non-optional registers).
134 */
135
136 /*
137 * Macro that expands to the body of a function that
138 * stores the extra (non-coprocessor) optional/custom state.
139 * Entry: a2 = ptr to save area in which to save extra state
140 * Exit: any register a2-a15 (?) may have been clobbered.
141 */
142 .macro xchal_extra_store_funcbody
143 .endm
144
145
146 /*
147 * Macro that expands to the body of a function that
148 * loads the extra (non-coprocessor) optional/custom state.
149 * Entry: a2 = ptr to save area from which to restore extra state
150 * Exit: any register a2-a15 (?) may have been clobbered.
151 */
152 .macro xchal_extra_load_funcbody
153 .endm
154
155
156/********************
157 * Macros to save and restore the state of each TIE coprocessor.
158 */
159
160
161
162/********************
163 * Macros to create functions that save and restore the state of *any* TIE coprocessor.
164 */
165
166 /*
167 * Macro that expands to the body of a function
168 * that stores the selected coprocessor's state (registers etc).
169 * Entry: a2 = ptr to save area in which to save cp state
170 * a3 = coprocessor number
171 * Exit: any register a2-a15 (?) may have been clobbered.
172 */
173 .macro xchal_cpi_store_funcbody
174 .endm
175
176
177 /*
178 * Macro that expands to the body of a function
179 * that loads the selected coprocessor's state (registers etc).
180 * Entry: a2 = ptr to save area from which to restore cp state
181 * a3 = coprocessor number
182 * Exit: any register a2-a15 (?) may have been clobbered.
183 */
184 .macro xchal_cpi_load_funcbody
185 .endm
186
187#endif /*_ASMLANGUAGE*/
188
189
190/*
191 * Contents of save areas in terms of libdb register numbers.
192 * NOTE: CONTENTS_LIBDB_{UREG,REGF} macros are not defined in this file;
193 * it is up to the user of this header file to define these macros
194 * usefully before each expansion of the CONTENTS_LIBDB macros.
195 * (Fields rsv[123] are reserved for future additions; they are currently
196 * set to zero but may be set to some useful values in the future.)
197 *
198 * CONTENTS_LIBDB_SREG(libdbnum, offset, size, align, rsv1, name, sregnum, bitmask, rsv2, rsv3)
199 * CONTENTS_LIBDB_UREG(libdbnum, offset, size, align, rsv1, name, uregnum, bitmask, rsv2, rsv3)
200 * CONTENTS_LIBDB_REGF(libdbnum, offset, size, align, rsv1, name, index, numentries, contentsize, regname_base, regfile_name, rsv2, rsv3)
201 */
202
203#define XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM 0
204#define XCHAL_EXTRA_SA_CONTENTS_LIBDB /* empty */
205
206#define XCHAL_CP0_SA_CONTENTS_LIBDB_NUM 0
207#define XCHAL_CP0_SA_CONTENTS_LIBDB /* empty */
208
209#define XCHAL_CP1_SA_CONTENTS_LIBDB_NUM 0
210#define XCHAL_CP1_SA_CONTENTS_LIBDB /* empty */
211
212#define XCHAL_CP2_SA_CONTENTS_LIBDB_NUM 0
213#define XCHAL_CP2_SA_CONTENTS_LIBDB /* empty */
214
215#define XCHAL_CP3_SA_CONTENTS_LIBDB_NUM 0
216#define XCHAL_CP3_SA_CONTENTS_LIBDB /* empty */
217
218#define XCHAL_CP4_SA_CONTENTS_LIBDB_NUM 0
219#define XCHAL_CP4_SA_CONTENTS_LIBDB /* empty */
220
221#define XCHAL_CP5_SA_CONTENTS_LIBDB_NUM 0
222#define XCHAL_CP5_SA_CONTENTS_LIBDB /* empty */
223
224#define XCHAL_CP6_SA_CONTENTS_LIBDB_NUM 0
225#define XCHAL_CP6_SA_CONTENTS_LIBDB /* empty */
226
227#define XCHAL_CP7_SA_CONTENTS_LIBDB_NUM 0
228#define XCHAL_CP7_SA_CONTENTS_LIBDB /* empty */
229
230
231
232
233
234
235/*----------------------------------------------------------------------
236 MISC
237 ----------------------------------------------------------------------*/
238
239#if 0 /* is there something equivalent for user TIE? */
240#define XCHAL_CORE_ID "linux_be" /* configuration's alphanumeric core identifier
241 (CoreID) set in the Xtensa Processor Generator */
242
243#define XCHAL_BUILD_UNIQUE_ID 0x00003256 /* software build-unique ID (22-bit) */
244
245/* These definitions describe the hardware targeted by this software: */
246#define XCHAL_HW_CONFIGID0 0xC103D1FF /* config ID reg 0 value (upper 32 of 64 bits) */
247#define XCHAL_HW_CONFIGID1 0x00803256 /* config ID reg 1 value (lower 32 of 64 bits) */
248#define XCHAL_CONFIGID0 XCHAL_HW_CONFIGID0 /* for backward compatibility only -- don't use! */
249#define XCHAL_CONFIGID1 XCHAL_HW_CONFIGID1 /* for backward compatibility only -- don't use! */
250#define XCHAL_HW_RELEASE_MAJOR 1050 /* major release of targeted hardware */
251#define XCHAL_HW_RELEASE_MINOR 1 /* minor release of targeted hardware */
252#define XCHAL_HW_RELEASE_NAME "T1050.1" /* full release name of targeted hardware */
253#define XTHAL_HW_REL_T1050 1
254#define XTHAL_HW_REL_T1050_1 1
255#define XCHAL_HW_CONFIGID_RELIABLE 1
256#endif /*0*/
257
258
259
260/*----------------------------------------------------------------------
261 ISA
262 ----------------------------------------------------------------------*/
263
264#if 0 /* these probably don't belong here, but are related to or implemented using TIE */
265#define XCHAL_HAVE_BOOLEANS 0 /* 1 if booleans option configured, 0 otherwise */
266/* Misc instructions: */
267#define XCHAL_HAVE_MUL32 0 /* 1 if 32-bit integer multiply option configured, 0 otherwise */
268#define XCHAL_HAVE_MUL32_HIGH 0 /* 1 if MUL32 option includes MULUH and MULSH, 0 otherwise */
269
270#define XCHAL_HAVE_FP 0 /* 1 if floating point option configured, 0 otherwise */
271#endif /*0*/
272
273
274#endif /*XTENSA_CONFIG_TIE_H*/
275
diff --git a/include/asm-xtensa/xtensa/coreasm.h b/include/asm-xtensa/xtensa/coreasm.h
deleted file mode 100644
index a8cfb54c20a1..000000000000
--- a/include/asm-xtensa/xtensa/coreasm.h
+++ /dev/null
@@ -1,526 +0,0 @@
1#ifndef XTENSA_COREASM_H
2#define XTENSA_COREASM_H
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/coreasm.h -- assembler-specific
8 * definitions that depend on CORE configuration.
9 *
10 * Source for configuration-independent binaries (which link in a
11 * configuration-specific HAL library) must NEVER include this file.
12 * It is perfectly normal, however, for the HAL itself to include this
13 * file.
14 *
15 * This file must NOT include xtensa/config/system.h. Any assembler
16 * header file that depends on system information should likely go in
17 * a new systemasm.h (or sysasm.h) header file.
18 *
19 * NOTE: macro beqi32 is NOT configuration-dependent, and is placed
20 * here til we will have configuration-independent header file.
21 *
22 * This file is subject to the terms and conditions of the GNU General
23 * Public License. See the file "COPYING" in the main directory of
24 * this archive for more details.
25 *
26 * Copyright (C) 2002 Tensilica Inc.
27 */
28
29
30#include <xtensa/config/core.h>
31#include <xtensa/config/specreg.h>
32
33/*
34 * Assembly-language specific definitions (assembly macros, etc.).
35 */
36
37/*----------------------------------------------------------------------
38 * find_ms_setbit
39 *
40 * This macro finds the most significant bit that is set in <as>
41 * and return its index + <base> in <ad>, or <base> - 1 if <as> is zero.
42 * The index counts starting at zero for the lsbit, so the return
43 * value ranges from <base>-1 (no bit set) to <base>+31 (msbit set).
44 *
45 * Parameters:
46 * <ad> destination address register (any register)
47 * <as> source address register
48 * <at> temporary address register (must be different than <as>)
49 * <base> constant value added to result (usually 0 or 1)
50 * On entry:
51 * <ad> = undefined if different than <as>
52 * <as> = value whose most significant set bit is to be found
53 * <at> = undefined
54 * no other registers are used by this macro.
55 * On exit:
56 * <ad> = <base> + index of msbit set in original <as>,
57 * = <base> - 1 if original <as> was zero.
58 * <as> clobbered (if not <ad>)
59 * <at> clobbered (if not <ad>)
60 * Example:
61 * find_ms_setbit a0, a4, a0, 0 -- return in a0 index of msbit set in a4
62 */
63
64 .macro find_ms_setbit ad, as, at, base
65#if XCHAL_HAVE_NSA
66 movi \at, 31+\base
67 nsau \as, \as // get index of \as, numbered from msbit (32 if absent)
68 sub \ad, \at, \as // get numbering from lsbit (0..31, -1 if absent)
69#else /* XCHAL_HAVE_NSA */
70 movi \at, \base // start with result of 0 (point to lsbit of 32)
71
72 beqz \as, 2f // special case for zero argument: return -1
73 bltui \as, 0x10000, 1f // is it one of the 16 lsbits? (if so, check lower 16 bits)
74 addi \at, \at, 16 // no, increment result to upper 16 bits (of 32)
75 //srli \as, \as, 16 // check upper half (shift right 16 bits)
76 extui \as, \as, 16, 16 // check upper half (shift right 16 bits)
771: bltui \as, 0x100, 1f // is it one of the 8 lsbits? (if so, check lower 8 bits)
78 addi \at, \at, 8 // no, increment result to upper 8 bits (of 16)
79 srli \as, \as, 8 // shift right to check upper 8 bits
801: bltui \as, 0x10, 1f // is it one of the 4 lsbits? (if so, check lower 4 bits)
81 addi \at, \at, 4 // no, increment result to upper 4 bits (of 8)
82 srli \as, \as, 4 // shift right 4 bits to check upper half
831: bltui \as, 0x4, 1f // is it one of the 2 lsbits? (if so, check lower 2 bits)
84 addi \at, \at, 2 // no, increment result to upper 2 bits (of 4)
85 srli \as, \as, 2 // shift right 2 bits to check upper half
861: bltui \as, 0x2, 1f // is it the lsbit?
87 addi \at, \at, 2 // no, increment result to upper bit (of 2)
882: addi \at, \at, -1 // (from just above: add 1; from beqz: return -1)
89 //srli \as, \as, 1
901: // done! \at contains index of msbit set (or -1 if none set)
91 .if 0x\ad - 0x\at // destination different than \at ? (works because regs are a0-a15)
92 mov \ad, \at // then move result to \ad
93 .endif
94#endif /* XCHAL_HAVE_NSA */
95 .endm // find_ms_setbit
96
97/*----------------------------------------------------------------------
98 * find_ls_setbit
99 *
100 * This macro finds the least significant bit that is set in <as>,
101 * and return its index in <ad>.
102 * Usage is the same as for the find_ms_setbit macro.
103 * Example:
104 * find_ls_setbit a0, a4, a0, 0 -- return in a0 index of lsbit set in a4
105 */
106
107 .macro find_ls_setbit ad, as, at, base
108 neg \at, \as // keep only the least-significant bit that is set...
109 and \as, \at, \as // ... in \as
110 find_ms_setbit \ad, \as, \at, \base
111 .endm // find_ls_setbit
112
113/*----------------------------------------------------------------------
114 * find_ls_one
115 *
116 * Same as find_ls_setbit with base zero.
117 * Source (as) and destination (ad) registers must be different.
118 * Provided for backward compatibility.
119 */
120
121 .macro find_ls_one ad, as
122 find_ls_setbit \ad, \as, \ad, 0
123 .endm // find_ls_one
124
125/*----------------------------------------------------------------------
126 * floop, floopnez, floopgtz, floopend
127 *
128 * These macros are used for fast inner loops that
129 * work whether or not the Loops options is configured.
130 * If the Loops option is configured, they simply use
131 * the zero-overhead LOOP instructions; otherwise
132 * they use explicit decrement and branch instructions.
133 *
134 * They are used in pairs, with floop, floopnez or floopgtz
135 * at the beginning of the loop, and floopend at the end.
136 *
137 * Each pair of loop macro calls must be given the loop count
138 * address register and a unique label for that loop.
139 *
140 * Example:
141 *
142 * movi a3, 16 // loop 16 times
143 * floop a3, myloop1
144 * :
145 * bnez a7, end1 // exit loop if a7 != 0
146 * :
147 * floopend a3, myloop1
148 * end1:
149 *
150 * Like the LOOP instructions, these macros cannot be
151 * nested, must include at least one instruction,
152 * cannot call functions inside the loop, etc.
153 * The loop can be exited by jumping to the instruction
154 * following floopend (or elsewhere outside the loop),
155 * or continued by jumping to a NOP instruction placed
156 * immediately before floopend.
157 *
158 * Unlike LOOP instructions, the register passed to floop*
159 * cannot be used inside the loop, because it is used as
160 * the loop counter if the Loops option is not configured.
161 * And its value is undefined after exiting the loop.
162 * And because the loop counter register is active inside
163 * the loop, you can't easily use this construct to loop
164 * across a register file using ROTW as you might with LOOP
165 * instructions, unless you copy the loop register along.
166 */
167
168 /* Named label version of the macros: */
169
170 .macro floop ar, endlabel
171 floop_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel
172 .endm
173
174 .macro floopnez ar, endlabel
175 floopnez_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel
176 .endm
177
178 .macro floopgtz ar, endlabel
179 floopgtz_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel
180 .endm
181
182 .macro floopend ar, endlabel
183 floopend_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel
184 .endm
185
186 /* Numbered local label version of the macros: */
187#if 0 /*UNTESTED*/
188 .macro floop89 ar
189 floop_ \ar, 8, 9f
190 .endm
191
192 .macro floopnez89 ar
193 floopnez_ \ar, 8, 9f
194 .endm
195
196 .macro floopgtz89 ar
197 floopgtz_ \ar, 8, 9f
198 .endm
199
200 .macro floopend89 ar
201 floopend_ \ar, 8b, 9
202 .endm
203#endif /*0*/
204
205 /* Underlying version of the macros: */
206
207 .macro floop_ ar, startlabel, endlabelref
208 .ifdef _infloop_
209 .if _infloop_
210 .err // Error: floop cannot be nested
211 .endif
212 .endif
213 .set _infloop_, 1
214#if XCHAL_HAVE_LOOPS
215 loop \ar, \endlabelref
216#else /* XCHAL_HAVE_LOOPS */
217\startlabel:
218 addi \ar, \ar, -1
219#endif /* XCHAL_HAVE_LOOPS */
220 .endm // floop_
221
222 .macro floopnez_ ar, startlabel, endlabelref
223 .ifdef _infloop_
224 .if _infloop_
225 .err // Error: floopnez cannot be nested
226 .endif
227 .endif
228 .set _infloop_, 1
229#if XCHAL_HAVE_LOOPS
230 loopnez \ar, \endlabelref
231#else /* XCHAL_HAVE_LOOPS */
232 beqz \ar, \endlabelref
233\startlabel:
234 addi \ar, \ar, -1
235#endif /* XCHAL_HAVE_LOOPS */
236 .endm // floopnez_
237
238 .macro floopgtz_ ar, startlabel, endlabelref
239 .ifdef _infloop_
240 .if _infloop_
241 .err // Error: floopgtz cannot be nested
242 .endif
243 .endif
244 .set _infloop_, 1
245#if XCHAL_HAVE_LOOPS
246 loopgtz \ar, \endlabelref
247#else /* XCHAL_HAVE_LOOPS */
248 bltz \ar, \endlabelref
249 beqz \ar, \endlabelref
250\startlabel:
251 addi \ar, \ar, -1
252#endif /* XCHAL_HAVE_LOOPS */
253 .endm // floopgtz_
254
255
256 .macro floopend_ ar, startlabelref, endlabel
257 .ifndef _infloop_
258 .err // Error: floopend without matching floopXXX
259 .endif
260 .ifeq _infloop_
261 .err // Error: floopend without matching floopXXX
262 .endif
263 .set _infloop_, 0
264#if ! XCHAL_HAVE_LOOPS
265 bnez \ar, \startlabelref
266#endif /* XCHAL_HAVE_LOOPS */
267\endlabel:
268 .endm // floopend_
269
270/*----------------------------------------------------------------------
271 * crsil -- conditional RSIL (read/set interrupt level)
272 *
273 * Executes the RSIL instruction if it exists, else just reads PS.
274 * The RSIL instruction does not exist in the new exception architecture
275 * if the interrupt option is not selected.
276 */
277
278 .macro crsil ar, newlevel
279#if XCHAL_HAVE_OLD_EXC_ARCH || XCHAL_HAVE_INTERRUPTS
280 rsil \ar, \newlevel
281#else
282 rsr \ar, PS
283#endif
284 .endm // crsil
285
286/*----------------------------------------------------------------------
287 * window_spill{4,8,12}
288 *
289 * These macros spill callers' register windows to the stack.
290 * They work for both privileged and non-privileged tasks.
291 * Must be called from a windowed ABI context, eg. within
292 * a windowed ABI function (ie. valid stack frame, window
293 * exceptions enabled, not in exception mode, etc).
294 *
295 * This macro requires a single invocation of the window_spill_common
296 * macro in the same assembly unit and section.
297 *
298 * Note that using window_spill{4,8,12} macros is more efficient
299 * than calling a function implemented using window_spill_function,
300 * because the latter needs extra code to figure out the size of
301 * the call to the spilling function.
302 *
303 * Example usage:
304 *
305 * .text
306 * .align 4
307 * .global some_function
308 * .type some_function,@function
309 * some_function:
310 * entry a1, 16
311 * :
312 * :
313 *
314 * window_spill4 // spill windows of some_function's callers; preserves a0..a3 only;
315 * // to use window_spill{8,12} in this example function we'd have
316 * // to increase space allocated by the entry instruction, because
317 * // 16 bytes only allows call4; 32 or 48 bytes (+locals) are needed
318 * // for call8/window_spill8 or call12/window_spill12 respectively.
319 * :
320 *
321 * retw
322 *
323 * window_spill_common // instantiates code used by window_spill4
324 *
325 *
326 * On entry:
327 * none (if window_spill4)
328 * stack frame has enough space allocated for call8 (if window_spill8)
329 * stack frame has enough space allocated for call12 (if window_spill12)
330 * On exit:
331 * a4..a15 clobbered (if window_spill4)
332 * a8..a15 clobbered (if window_spill8)
333 * a12..a15 clobbered (if window_spill12)
334 * no caller windows are in live registers
335 */
336
337 .macro window_spill4
338#if XCHAL_HAVE_WINDOWED
339# if XCHAL_NUM_AREGS == 16
340 movi a15, 0 // for 16-register files, no need to call to reach the end
341# elif XCHAL_NUM_AREGS == 32
342 call4 .L__wdwspill_assist28 // call deep enough to clear out any live callers
343# elif XCHAL_NUM_AREGS == 64
344 call4 .L__wdwspill_assist60 // call deep enough to clear out any live callers
345# endif
346#endif
347 .endm // window_spill4
348
349 .macro window_spill8
350#if XCHAL_HAVE_WINDOWED
351# if XCHAL_NUM_AREGS == 16
352 movi a15, 0 // for 16-register files, no need to call to reach the end
353# elif XCHAL_NUM_AREGS == 32
354 call8 .L__wdwspill_assist24 // call deep enough to clear out any live callers
355# elif XCHAL_NUM_AREGS == 64
356 call8 .L__wdwspill_assist56 // call deep enough to clear out any live callers
357# endif
358#endif
359 .endm // window_spill8
360
361 .macro window_spill12
362#if XCHAL_HAVE_WINDOWED
363# if XCHAL_NUM_AREGS == 16
364 movi a15, 0 // for 16-register files, no need to call to reach the end
365# elif XCHAL_NUM_AREGS == 32
366 call12 .L__wdwspill_assist20 // call deep enough to clear out any live callers
367# elif XCHAL_NUM_AREGS == 64
368 call12 .L__wdwspill_assist52 // call deep enough to clear out any live callers
369# endif
370#endif
371 .endm // window_spill12
372
373/*----------------------------------------------------------------------
374 * window_spill_function
375 *
376 * This macro outputs a function that will spill its caller's callers'
377 * register windows to the stack. Eg. it could be used to implement
378 * a version of xthal_window_spill() that works in non-privileged tasks.
379 * This works for both privileged and non-privileged tasks.
380 *
381 * Typical usage:
382 *
383 * .text
384 * .align 4
385 * .global my_spill_function
386 * .type my_spill_function,@function
387 * my_spill_function:
388 * window_spill_function
389 *
390 * On entry to resulting function:
391 * none
392 * On exit from resulting function:
393 * none (no caller windows are in live registers)
394 */
395
396 .macro window_spill_function
397#if XCHAL_HAVE_WINDOWED
398# if XCHAL_NUM_AREGS == 32
399 entry sp, 48
400 bbci.l a0, 31, 1f // branch if called with call4
401 bbsi.l a0, 30, 2f // branch if called with call12
402 call8 .L__wdwspill_assist16 // called with call8, only need another 8
403 retw
4041: call12 .L__wdwspill_assist16 // called with call4, only need another 12
405 retw
4062: call4 .L__wdwspill_assist16 // called with call12, only need another 4
407 retw
408# elif XCHAL_NUM_AREGS == 64
409 entry sp, 48
410 bbci.l a0, 31, 1f // branch if called with call4
411 bbsi.l a0, 30, 2f // branch if called with call12
412 call4 .L__wdwspill_assist52 // called with call8, only need a call4
413 retw
4141: call8 .L__wdwspill_assist52 // called with call4, only need a call8
415 retw
4162: call12 .L__wdwspill_assist40 // called with call12, can skip a call12
417 retw
418# elif XCHAL_NUM_AREGS == 16
419 entry sp, 16
420 bbci.l a0, 31, 1f // branch if called with call4
421 bbsi.l a0, 30, 2f // branch if called with call12
422 movi a7, 0 // called with call8
423 retw
4241: movi a11, 0 // called with call4
4252: retw // if called with call12, everything already spilled
426
427// movi a15, 0 // trick to spill all but the direct caller
428// j 1f
429// // The entry instruction is magical in the assembler (gets auto-aligned)
430// // so we have to jump to it to avoid falling through the padding.
431// // We need entry/retw to know where to return.
432//1: entry sp, 16
433// retw
434# else
435# error "unrecognized address register file size"
436# endif
437#endif /* XCHAL_HAVE_WINDOWED */
438 window_spill_common
439 .endm // window_spill_function
440
441/*----------------------------------------------------------------------
442 * window_spill_common
443 *
444 * Common code used by any number of invocations of the window_spill##
445 * and window_spill_function macros.
446 *
447 * Must be instantiated exactly once within a given assembly unit,
448 * within call/j range of and same section as window_spill##
449 * macro invocations for that assembly unit.
450 * (Is automatically instantiated by the window_spill_function macro.)
451 */
452
453 .macro window_spill_common
454#if XCHAL_HAVE_WINDOWED && (XCHAL_NUM_AREGS == 32 || XCHAL_NUM_AREGS == 64)
455 .ifndef .L__wdwspill_defined
456# if XCHAL_NUM_AREGS >= 64
457.L__wdwspill_assist60:
458 entry sp, 32
459 call8 .L__wdwspill_assist52
460 retw
461.L__wdwspill_assist56:
462 entry sp, 16
463 call4 .L__wdwspill_assist52
464 retw
465.L__wdwspill_assist52:
466 entry sp, 48
467 call12 .L__wdwspill_assist40
468 retw
469.L__wdwspill_assist40:
470 entry sp, 48
471 call12 .L__wdwspill_assist28
472 retw
473# endif
474.L__wdwspill_assist28:
475 entry sp, 48
476 call12 .L__wdwspill_assist16
477 retw
478.L__wdwspill_assist24:
479 entry sp, 32
480 call8 .L__wdwspill_assist16
481 retw
482.L__wdwspill_assist20:
483 entry sp, 16
484 call4 .L__wdwspill_assist16
485 retw
486.L__wdwspill_assist16:
487 entry sp, 16
488 movi a15, 0
489 retw
490 .set .L__wdwspill_defined, 1
491 .endif
492#endif /* XCHAL_HAVE_WINDOWED with 32 or 64 aregs */
493 .endm // window_spill_common
494
495/*----------------------------------------------------------------------
496 * beqi32
497 *
498 * macro implements version of beqi for arbitrary 32-bit immidiate value
499 *
500 * beqi32 ax, ay, imm32, label
501 *
502 * Compares value in register ax with imm32 value and jumps to label if
503 * equal. Clobberes register ay if needed
504 *
505 */
506 .macro beqi32 ax, ay, imm, label
507 .ifeq ((\imm-1) & ~7) // 1..8 ?
508 beqi \ax, \imm, \label
509 .else
510 .ifeq (\imm+1) // -1 ?
511 beqi \ax, \imm, \label
512 .else
513 .ifeq (\imm) // 0 ?
514 beqz \ax, \label
515 .else
516 // We could also handle immediates 10,12,16,32,64,128,256
517 // but it would be a long macro...
518 movi \ay, \imm
519 beq \ax, \ay, \label
520 .endif
521 .endif
522 .endif
523 .endm // beqi32
524
525#endif /*XTENSA_COREASM_H*/
526
diff --git a/include/asm-xtensa/xtensa/corebits.h b/include/asm-xtensa/xtensa/corebits.h
deleted file mode 100644
index e578ade41632..000000000000
--- a/include/asm-xtensa/xtensa/corebits.h
+++ /dev/null
@@ -1,77 +0,0 @@
1#ifndef XTENSA_COREBITS_H
2#define XTENSA_COREBITS_H
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * xtensa/corebits.h - Xtensa Special Register field positions and masks.
8 *
9 * (In previous releases, these were defined in specreg.h, a generated file.
10 * This file is not generated, i.e. it is processor configuration independent.)
11 */
12
13
14/* EXCCAUSE register fields: */
15#define EXCCAUSE_EXCCAUSE_SHIFT 0
16#define EXCCAUSE_EXCCAUSE_MASK 0x3F
17/* Exception causes (mostly incomplete!): */
18#define EXCCAUSE_ILLEGAL 0
19#define EXCCAUSE_SYSCALL 1
20#define EXCCAUSE_IFETCHERROR 2
21#define EXCCAUSE_LOADSTOREERROR 3
22#define EXCCAUSE_LEVEL1INTERRUPT 4
23#define EXCCAUSE_ALLOCA 5
24
25/* PS register fields: */
26#define PS_WOE_SHIFT 18
27#define PS_WOE_MASK 0x00040000
28#define PS_WOE PS_WOE_MASK
29#define PS_CALLINC_SHIFT 16
30#define PS_CALLINC_MASK 0x00030000
31#define PS_CALLINC(n) (((n)&3)<<PS_CALLINC_SHIFT) /* n = 0..3 */
32#define PS_OWB_SHIFT 8
33#define PS_OWB_MASK 0x00000F00
34#define PS_OWB(n) (((n)&15)<<PS_OWB_SHIFT) /* n = 0..15 (or 0..7) */
35#define PS_RING_SHIFT 6
36#define PS_RING_MASK 0x000000C0
37#define PS_RING(n) (((n)&3)<<PS_RING_SHIFT) /* n = 0..3 */
38#define PS_UM_SHIFT 5
39#define PS_UM_MASK 0x00000020
40#define PS_UM PS_UM_MASK
41#define PS_EXCM_SHIFT 4
42#define PS_EXCM_MASK 0x00000010
43#define PS_EXCM PS_EXCM_MASK
44#define PS_INTLEVEL_SHIFT 0
45#define PS_INTLEVEL_MASK 0x0000000F
46#define PS_INTLEVEL(n) ((n)&PS_INTLEVEL_MASK) /* n = 0..15 */
47/* Backward compatibility (deprecated): */
48#define PS_PROGSTACK_SHIFT PS_UM_SHIFT
49#define PS_PROGSTACK_MASK PS_UM_MASK
50#define PS_PROG_SHIFT PS_UM_SHIFT
51#define PS_PROG_MASK PS_UM_MASK
52#define PS_PROG PS_UM
53
54/* DBREAKCn register fields: */
55#define DBREAKC_MASK_SHIFT 0
56#define DBREAKC_MASK_MASK 0x0000003F
57#define DBREAKC_LOADBREAK_SHIFT 30
58#define DBREAKC_LOADBREAK_MASK 0x40000000
59#define DBREAKC_STOREBREAK_SHIFT 31
60#define DBREAKC_STOREBREAK_MASK 0x80000000
61
62/* DEBUGCAUSE register fields: */
63#define DEBUGCAUSE_DEBUGINT_SHIFT 5
64#define DEBUGCAUSE_DEBUGINT_MASK 0x20 /* debug interrupt */
65#define DEBUGCAUSE_BREAKN_SHIFT 4
66#define DEBUGCAUSE_BREAKN_MASK 0x10 /* BREAK.N instruction */
67#define DEBUGCAUSE_BREAK_SHIFT 3
68#define DEBUGCAUSE_BREAK_MASK 0x08 /* BREAK instruction */
69#define DEBUGCAUSE_DBREAK_SHIFT 2
70#define DEBUGCAUSE_DBREAK_MASK 0x04 /* DBREAK match */
71#define DEBUGCAUSE_IBREAK_SHIFT 1
72#define DEBUGCAUSE_IBREAK_MASK 0x02 /* IBREAK match */
73#define DEBUGCAUSE_ICOUNT_SHIFT 0
74#define DEBUGCAUSE_ICOUNT_MASK 0x01 /* ICOUNT would increment to zero */
75
76#endif /*XTENSA_COREBITS_H*/
77
diff --git a/include/asm-xtensa/xtensa/hal.h b/include/asm-xtensa/xtensa/hal.h
deleted file mode 100644
index d10472505454..000000000000
--- a/include/asm-xtensa/xtensa/hal.h
+++ /dev/null
@@ -1,822 +0,0 @@
1#ifndef XTENSA_HAL_H
2#define XTENSA_HAL_H
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/hal.h -- contains a definition of the
8 * Core HAL interface.
9 *
10 * All definitions in this header file are independent of any specific
11 * Xtensa processor configuration. Thus an OS or other software can
12 * include this header file and be compiled into configuration-
13 * independent objects that can be distributed and eventually linked
14 * to the HAL library (libhal.a) to create a configuration-specific
15 * final executable.
16 *
17 * Certain definitions, however, are release-specific -- such as the
18 * XTHAL_RELEASE_xxx macros (or additions made in later releases).
19 *
20 * This file is subject to the terms and conditions of the GNU General Public
21 * License. See the file "COPYING" in the main directory of this archive
22 * for more details.
23 *
24 * Copyright (C) 2002 Tensilica Inc.
25 */
26
27
28/*----------------------------------------------------------------------
29 Constant Definitions
30 (shared with assembly)
31 ----------------------------------------------------------------------*/
32
33/* Software release information (not configuration-specific!): */
34#define XTHAL_RELEASE_MAJOR 1050
35#define XTHAL_RELEASE_MINOR 0
36#define XTHAL_RELEASE_NAME "T1050.0-2002-08-06-eng0"
37#define XTHAL_RELEASE_INTERNAL "2002-08-06-eng0"
38#define XTHAL_REL_T1050 1
39#define XTHAL_REL_T1050_0 1
40#define XTHAL_REL_T1050_0_2002 1
41#define XTHAL_REL_T1050_0_2002_08 1
42#define XTHAL_REL_T1050_0_2002_08_06 1
43#define XTHAL_REL_T1050_0_2002_08_06_ENG0 1
44
45/* HAL version numbers (these names are for backward compatibility): */
46#define XTHAL_MAJOR_REV XTHAL_RELEASE_MAJOR
47#define XTHAL_MINOR_REV XTHAL_RELEASE_MINOR
48/*
49 * A bit of software release history on values of XTHAL_{MAJOR,MINOR}_REV:
50 *
51 * Release MAJOR MINOR Comment
52 * ======= ===== ===== =======
53 * T1015.n n/a n/a (HAL not yet available)
54 * T1020.{0,1,2} 0 1 (HAL beta)
55 * T1020.{3,4} 0 2 First release.
56 * T1020.n (n>4) 0 2 or >3 (TBD)
57 * T1030.0 0 1 (HAL beta)
58 * T1030.{1,2} 0 3 Equivalent to first release.
59 * T1030.n (n>=3) 0 >= 3 (TBD)
60 * T1040.n 1040 n Full CHAL available from T1040.2
61 * T1050.n 1050 n Current release.
62 *
63 *
64 * Note: there is a distinction between the software release with
65 * which something is compiled (accessible using XTHAL_RELEASE_* macros)
66 * and the software release with which the HAL library was compiled
67 * (accessible using Xthal_release_* global variables). This
68 * distinction is particularly relevant for vendors that distribute
69 * configuration-independent binaries (eg. an OS), where their customer
70 * might link it with a HAL of a different Xtensa software release.
71 * In this case, it may be appropriate for the OS to verify at run-time
72 * whether XTHAL_RELEASE_* and Xthal_release_* are compatible.
73 * [Guidelines as to which release is compatible with which are not
74 * currently provided explicitly, but might be inferred from reading
75 * OSKit documentation for all releases -- compatibility is also highly
76 * dependent on which HAL features are used. Each release is usually
77 * backward compatible, with very few exceptions if any.]
78 *
79 * Notes:
80 * Tornado 2.0 supported in T1020.3+, T1030.1+, and T1040.{0,1} only.
81 * Tornado 2.0.2 supported in T1040.2+, and T1050.
82 * Compile-time HAL port of NucleusPlus supported by T1040.2+ and T1050.
83 */
84
85
86/*
87 * Architectural limits, independent of configuration.
88 * Note that these are ISA-defined limits, not micro-architecture implementation
89 * limits enforced by the Xtensa Processor Generator (which may be stricter than
90 * these below).
91 */
92#define XTHAL_MAX_CPS 8 /* max number of coprocessors (0..7) */
93#define XTHAL_MAX_INTERRUPTS 32 /* max number of interrupts (0..31) */
94#define XTHAL_MAX_INTLEVELS 16 /* max number of interrupt levels (0..15) */
95 /* (as of T1040, implementation limit is 7: 0..6) */
96#define XTHAL_MAX_TIMERS 4 /* max number of timers (CCOMPARE0..CCOMPARE3) */
97 /* (as of T1040, implementation limit is 3: 0..2) */
98
99/* Misc: */
100#define XTHAL_LITTLEENDIAN 0
101#define XTHAL_BIGENDIAN 1
102
103
104/* Interrupt types: */
105#define XTHAL_INTTYPE_UNCONFIGURED 0
106#define XTHAL_INTTYPE_SOFTWARE 1
107#define XTHAL_INTTYPE_EXTERN_EDGE 2
108#define XTHAL_INTTYPE_EXTERN_LEVEL 3
109#define XTHAL_INTTYPE_TIMER 4
110#define XTHAL_INTTYPE_NMI 5
111#define XTHAL_MAX_INTTYPES 6 /* number of interrupt types */
112
113/* Timer related: */
114#define XTHAL_TIMER_UNCONFIGURED -1 /* Xthal_timer_interrupt[] value for non-existent timers */
115#define XTHAL_TIMER_UNASSIGNED XTHAL_TIMER_UNCONFIGURED /* (for backwards compatibility only) */
116
117
118/* Access Mode bits (tentative): */ /* bit abbr unit short_name PPC equ - Description */
119#define XTHAL_AMB_EXCEPTION 0 /* 001 E EX fls: EXception none - generate exception on any access (aka "illegal") */
120#define XTHAL_AMB_HITCACHE 1 /* 002 C CH fls: use Cache on Hit ~(I CI) - use cache on hit -- way from tag match [or H HC, or U UC] (ISA: same, except for Isolate case) */
121#define XTHAL_AMB_ALLOCATE 2 /* 004 A AL fl?: ALlocate none - refill cache on miss -- way from LRU [or F FI fill] (ISA: Read/Write Miss Refill) */
122#define XTHAL_AMB_WRITETHRU 3 /* 008 W WT --s: WriteThrough W WT - store immediately to memory (ISA: same) */
123#define XTHAL_AMB_ISOLATE 4 /* 010 I IS fls: ISolate none - use cache regardless of hit-vs-miss -- way from vaddr (ISA: use-cache-on-miss+hit) */
124#define XTHAL_AMB_GUARD 5 /* 020 G GU ?l?: GUard G * - non-speculative; spec/replay refs not permitted */
125#if 0
126#define XTHAL_AMB_ORDERED x /* 000 O OR fls: ORdered G * - mem accesses cannot be out of order */
127#define XTHAL_AMB_FUSEWRITES x /* 000 F FW --s: FuseWrites none - allow combining/merging multiple writes (to same datapath data unit) into one (implied by writeback) */
128#define XTHAL_AMB_COHERENT x /* 000 M MC fl?: Mem/MP Coherent M - on reads, other CPUs/bus-masters may need to supply data */
129#define XTHAL_AMB_TRUSTED x /* 000 T TR ?l?: TRusted none - memory will not bus error (if it does, handle as fatal imprecise interrupt) */
130#define XTHAL_AMB_PREFETCH x /* 000 P PR fl?: PRefetch none - on refill, read line+1 into prefetch buffers */
131#define XTHAL_AMB_STREAM x /* 000 S ST ???: STreaming none - access one of N stream buffers */
132#endif /*0*/
133
134#define XTHAL_AM_EXCEPTION (1<<XTHAL_AMB_EXCEPTION)
135#define XTHAL_AM_HITCACHE (1<<XTHAL_AMB_HITCACHE)
136#define XTHAL_AM_ALLOCATE (1<<XTHAL_AMB_ALLOCATE)
137#define XTHAL_AM_WRITETHRU (1<<XTHAL_AMB_WRITETHRU)
138#define XTHAL_AM_ISOLATE (1<<XTHAL_AMB_ISOLATE)
139#define XTHAL_AM_GUARD (1<<XTHAL_AMB_GUARD)
140#if 0
141#define XTHAL_AM_ORDERED (1<<XTHAL_AMB_ORDERED)
142#define XTHAL_AM_FUSEWRITES (1<<XTHAL_AMB_FUSEWRITES)
143#define XTHAL_AM_COHERENT (1<<XTHAL_AMB_COHERENT)
144#define XTHAL_AM_TRUSTED (1<<XTHAL_AMB_TRUSTED)
145#define XTHAL_AM_PREFETCH (1<<XTHAL_AMB_PREFETCH)
146#define XTHAL_AM_STREAM (1<<XTHAL_AMB_STREAM)
147#endif /*0*/
148
149/*
150 * Allowed Access Modes (bit combinations).
151 *
152 * Columns are:
153 * "FOGIWACE"
154 * Access mode bits (see XTHAL_AMB_xxx above).
155 * <letter> = bit is set
156 * '-' = bit is clear
157 * '.' = bit is irrelevant / don't care, as follows:
158 * E=1 makes all others irrelevant
159 * W,F relevant only for stores
160 * "2345"
161 * Indicates which Xtensa releases support the corresponding
162 * access mode. Releases for each character column are:
163 * 2 = prior to T1020.2: T1015 (V1.5), T1020.0, T1020.1
164 * 3 = T1020.2 and later: T1020.2+, T1030
165 * 4 = T1040
166 * 5 = T1050 (maybe)
167 * And the character column contents are:
168 * <number> = support by release(s)
169 * "." = unsupported by release(s)
170 * "?" = support unknown
171 */
172 /* FOGIWACE 2345 */
173/* For instruction fetch: */
174#define XTHAL_FAM_EXCEPTION 0x001 /* .......E 2345 exception */
175#define XTHAL_FAM_ISOLATE 0x012 /* .--I.-C- .... isolate */
176#define XTHAL_FAM_BYPASS 0x000 /* .---.--- 2345 bypass */
177#define XTHAL_FAM_NACACHED 0x002 /* .---.-C- .... cached no-allocate (frozen) */
178#define XTHAL_FAM_CACHED 0x006 /* .---.AC- 2345 cached */
179/* For data load: */
180#define XTHAL_LAM_EXCEPTION 0x001 /* .......E 2345 exception */
181#define XTHAL_LAM_ISOLATE 0x012 /* .--I.-C- 2345 isolate */
182#define XTHAL_LAM_BYPASS 0x000 /* .O--.--- 2... bypass speculative */
183#define XTHAL_LAM_BYPASSG 0x020 /* .OG-.--- .345 bypass guarded */
184#define XTHAL_LAM_NACACHED 0x002 /* .O--.-C- 2... cached no-allocate speculative */
185#define XTHAL_LAM_NACACHEDG 0x022 /* .OG-.-C- .345 cached no-allocate guarded */
186#define XTHAL_LAM_CACHED 0x006 /* .---.AC- 2345 cached speculative */
187#define XTHAL_LAM_CACHEDG 0x026 /* .?G-.AC- .... cached guarded */
188/* For data store: */
189#define XTHAL_SAM_EXCEPTION 0x001 /* .......E 2345 exception */
190#define XTHAL_SAM_ISOLATE 0x032 /* .-GI--C- 2345 isolate */
191#define XTHAL_SAM_BYPASS 0x028 /* -OG-W--- 2345 bypass */
192/*efine XTHAL_SAM_BYPASSF 0x028*/ /* F-G-W--- ...? bypass write-combined */
193#define XTHAL_SAM_WRITETHRU 0x02A /* -OG-W-C- 234? writethrough */
194/*efine XTHAL_SAM_WRITETHRUF 0x02A*/ /* F-G-W-C- ...5 writethrough write-combined */
195#define XTHAL_SAM_WRITEALLOC 0x02E /* -OG-WAC- ...? writethrough-allocate */
196/*efine XTHAL_SAM_WRITEALLOCF 0x02E*/ /* F-G-WAC- ...? writethrough-allocate write-combined */
197#define XTHAL_SAM_WRITEBACK 0x026 /* F-G--AC- ...5 writeback */
198
199#if 0
200/*
201 Cache attribute encoding for CACHEATTR (per ISA):
202 (Note: if this differs from ISA Ref Manual, ISA has precedence)
203
204 Inst-fetches Loads Stores
205 ------------- ------------ -------------
2060x0 FCA_EXCEPTION ?LCA_NACACHED_G* SCA_WRITETHRU "uncached"
2070x1 FCA_CACHED LCA_CACHED SCA_WRITETHRU cached
2080x2 FCA_BYPASS LCA_BYPASS_G* SCA_BYPASS bypass
2090x3 FCA_CACHED LCA_CACHED SCA_WRITEALLOCF write-allocate
210 or LCA_EXCEPTION SCA_EXCEPTION (if unimplemented)
2110x4 FCA_CACHED LCA_CACHED SCA_WRITEBACK write-back
212 or LCA_EXCEPTION SCA_EXCEPTION (if unimplemented)
2130x5..D FCA_EXCEPTION LCA_EXCEPTION SCA_EXCEPTION (reserved)
2140xE FCA_EXCEPTION LCA_ISOLATE SCA_ISOLATE isolate
2150xF FCA_EXCEPTION LCA_EXCEPTION SCA_EXCEPTION illegal
216 * Prior to T1020.2?, guard feature not supported, this defaulted to speculative (no _G)
217*/
218#endif /*0*/
219
220
221#if !defined(__ASSEMBLY__) && !defined(_NOCLANGUAGE)
222#ifdef __cplusplus
223extern "C" {
224#endif
225
226/*----------------------------------------------------------------------
227 HAL
228 ----------------------------------------------------------------------*/
229
230/* Constant to be checked in build = (XTHAL_MAJOR_REV<<16)|XTHAL_MINOR_REV */
231extern const unsigned int Xthal_rev_no;
232
233
234/*----------------------------------------------------------------------
235 Processor State
236 ----------------------------------------------------------------------*/
237/* save & restore the extra processor state */
238extern void xthal_save_extra(void *base);
239extern void xthal_restore_extra(void *base);
240
241extern void xthal_save_cpregs(void *base, int);
242extern void xthal_restore_cpregs(void *base, int);
243
244/*extern void xthal_save_all_extra(void *base);*/
245/*extern void xthal_restore_all_extra(void *base);*/
246
247/* space for processor state */
248extern const unsigned int Xthal_extra_size;
249extern const unsigned int Xthal_extra_align;
250/* space for TIE register files */
251extern const unsigned int Xthal_cpregs_size[XTHAL_MAX_CPS];
252extern const unsigned int Xthal_cpregs_align[XTHAL_MAX_CPS];
253
254/* total of space for the processor state (for Tor2) */
255extern const unsigned int Xthal_all_extra_size;
256extern const unsigned int Xthal_all_extra_align;
257
258/* initialize the extra processor */
259/*extern void xthal_init_extra(void);*/
260/* initialize the TIE coprocessor */
261/*extern void xthal_init_cp(int);*/
262
263/* initialize the extra processor */
264extern void xthal_init_mem_extra(void *);
265/* initialize the TIE coprocessor */
266extern void xthal_init_mem_cp(void *, int);
267
268/* validate & invalidate the TIE register file */
269extern void xthal_validate_cp(int);
270extern void xthal_invalidate_cp(int);
271
272/* the number of TIE coprocessors contiguous from zero (for Tor2) */
273extern const unsigned int Xthal_num_coprocessors;
274
275/* actual number of coprocessors */
276extern const unsigned char Xthal_cp_num;
277/* index of highest numbered coprocessor, plus one */
278extern const unsigned char Xthal_cp_max;
279/* index of highest allowed coprocessor number, per cfg, plus one */
280/*extern const unsigned char Xthal_cp_maxcfg;*/
281/* bitmask of which coprocessors are present */
282extern const unsigned int Xthal_cp_mask;
283
284/* read and write cpenable register */
285extern void xthal_set_cpenable(unsigned);
286extern unsigned xthal_get_cpenable(void);
287
288/* read & write extra state register */
289/*extern int xthal_read_extra(void *base, unsigned reg, unsigned *value);*/
290/*extern int xthal_write_extra(void *base, unsigned reg, unsigned value);*/
291
292/* read & write a TIE coprocessor register */
293/*extern int xthal_read_cpreg(void *base, int cp, unsigned reg, unsigned *value);*/
294/*extern int xthal_write_cpreg(void *base, int cp, unsigned reg, unsigned value);*/
295
296/* return coprocessor number based on register */
297/*extern int xthal_which_cp(unsigned reg);*/
298
299/*----------------------------------------------------------------------
300 Interrupts
301 ----------------------------------------------------------------------*/
302
303/* the number of interrupt levels */
304extern const unsigned char Xthal_num_intlevels;
305/* the number of interrupts */
306extern const unsigned char Xthal_num_interrupts;
307
308/* mask for level of interrupts */
309extern const unsigned int Xthal_intlevel_mask[XTHAL_MAX_INTLEVELS];
310/* mask for level 0 to N interrupts */
311extern const unsigned int Xthal_intlevel_andbelow_mask[XTHAL_MAX_INTLEVELS];
312
313/* level of each interrupt */
314extern const unsigned char Xthal_intlevel[XTHAL_MAX_INTERRUPTS];
315
316/* type per interrupt */
317extern const unsigned char Xthal_inttype[XTHAL_MAX_INTERRUPTS];
318
319/* masks of each type of interrupt */
320extern const unsigned int Xthal_inttype_mask[XTHAL_MAX_INTTYPES];
321
322/* interrupt numbers assigned to each timer interrupt */
323extern const int Xthal_timer_interrupt[XTHAL_MAX_TIMERS];
324
325/*** Virtual interrupt prioritization: ***/
326
327/* Convert between interrupt levels (as per PS.INTLEVEL) and virtual interrupt priorities: */
328extern unsigned xthal_vpri_to_intlevel(unsigned vpri);
329extern unsigned xthal_intlevel_to_vpri(unsigned intlevel);
330
331/* Enables/disables given set (mask) of interrupts; returns previous enabled-mask of all ints: */
332extern unsigned xthal_int_enable(unsigned);
333extern unsigned xthal_int_disable(unsigned);
334
335/* Set/get virtual priority of an interrupt: */
336extern int xthal_set_int_vpri(int intnum, int vpri);
337extern int xthal_get_int_vpri(int intnum);
338
339/* Set/get interrupt lockout level for exclusive access to virtual priority data structures: */
340extern void xthal_set_vpri_locklevel(unsigned intlevel);
341extern unsigned xthal_get_vpri_locklevel(void);
342
343/* Set/get current virtual interrupt priority: */
344extern unsigned xthal_set_vpri(unsigned vpri);
345extern unsigned xthal_get_vpri(unsigned vpri);
346extern unsigned xthal_set_vpri_intlevel(unsigned intlevel);
347extern unsigned xthal_set_vpri_lock(void);
348
349
350
351/*----------------------------------------------------------------------
352 Generic Interrupt Trampolining Support
353 ----------------------------------------------------------------------*/
354
355typedef void (XtHalVoidFunc)(void);
356
357/*
358 * Bitmask of interrupts currently trampolining down:
359 */
360extern unsigned Xthal_tram_pending;
361
362/*
363 * Bitmask of which interrupts currently trampolining down
364 * synchronously are actually enabled; this bitmask is necessary
365 * because INTENABLE cannot hold that state (sync-trampolining
366 * interrupts must be kept disabled while trampolining);
367 * in the current implementation, any bit set here is not set
368 * in INTENABLE, and vice-versa; once a sync-trampoline is
369 * handled (at level one), its enable bit must be moved from
370 * here to INTENABLE:
371 */
372extern unsigned Xthal_tram_enabled;
373
374/*
375 * Bitmask of interrupts configured for sync trampolining:
376 */
377extern unsigned Xthal_tram_sync;
378
379
380/* Trampoline support functions: */
381extern unsigned xthal_tram_pending_to_service( void );
382extern void xthal_tram_done( unsigned serviced_mask );
383extern int xthal_tram_set_sync( int intnum, int sync );
384extern XtHalVoidFunc* xthal_set_tram_trigger_func( XtHalVoidFunc *trigger_fn );
385
386/* INTENABLE,INTREAD,INTSET,INTCLEAR register access functions: */
387extern unsigned xthal_get_intenable( void );
388extern void xthal_set_intenable( unsigned );
389extern unsigned xthal_get_intread( void );
390extern void xthal_set_intset( unsigned );
391extern void xthal_set_intclear( unsigned );
392
393
394/*----------------------------------------------------------------------
395 Register Windows
396 ----------------------------------------------------------------------*/
397
398/* number of registers in register window */
399extern const unsigned int Xthal_num_aregs;
400extern const unsigned char Xthal_num_aregs_log2;
401
402/* This spill any live register windows (other than the caller's): */
403extern void xthal_window_spill( void );
404
405
406/*----------------------------------------------------------------------
407 Cache
408 ----------------------------------------------------------------------*/
409
410/* size of the cache lines in log2(bytes) */
411extern const unsigned char Xthal_icache_linewidth;
412extern const unsigned char Xthal_dcache_linewidth;
413/* size of the cache lines in bytes */
414extern const unsigned short Xthal_icache_linesize;
415extern const unsigned short Xthal_dcache_linesize;
416/* number of cache sets in log2(lines per way) */
417extern const unsigned char Xthal_icache_setwidth;
418extern const unsigned char Xthal_dcache_setwidth;
419/* cache set associativity (number of ways) */
420extern const unsigned int Xthal_icache_ways;
421extern const unsigned int Xthal_dcache_ways;
422/* size of the caches in bytes (ways * 2^(linewidth + setwidth)) */
423extern const unsigned int Xthal_icache_size;
424extern const unsigned int Xthal_dcache_size;
425/* cache features */
426extern const unsigned char Xthal_dcache_is_writeback;
427extern const unsigned char Xthal_icache_line_lockable;
428extern const unsigned char Xthal_dcache_line_lockable;
429
430/* cache attribute register control (used by other HAL routines) */
431extern unsigned xthal_get_cacheattr( void );
432extern unsigned xthal_get_icacheattr( void );
433extern unsigned xthal_get_dcacheattr( void );
434extern void xthal_set_cacheattr( unsigned );
435extern void xthal_set_icacheattr( unsigned );
436extern void xthal_set_dcacheattr( unsigned );
437
438/* initialize cache support (must be called once at startup, before all other cache calls) */
439/*extern void xthal_cache_startinit( void );*/
440/* reset caches */
441/*extern void xthal_icache_reset( void );*/
442/*extern void xthal_dcache_reset( void );*/
443/* enable caches */
444extern void xthal_icache_enable( void ); /* DEPRECATED */
445extern void xthal_dcache_enable( void ); /* DEPRECATED */
446/* disable caches */
447extern void xthal_icache_disable( void ); /* DEPRECATED */
448extern void xthal_dcache_disable( void ); /* DEPRECATED */
449
450/* invalidate the caches */
451extern void xthal_icache_all_invalidate( void );
452extern void xthal_dcache_all_invalidate( void );
453extern void xthal_icache_region_invalidate( void *addr, unsigned size );
454extern void xthal_dcache_region_invalidate( void *addr, unsigned size );
455extern void xthal_icache_line_invalidate(void *addr);
456extern void xthal_dcache_line_invalidate(void *addr);
457/* write dirty data back */
458extern void xthal_dcache_all_writeback( void );
459extern void xthal_dcache_region_writeback( void *addr, unsigned size );
460extern void xthal_dcache_line_writeback(void *addr);
461/* write dirty data back and invalidate */
462extern void xthal_dcache_all_writeback_inv( void );
463extern void xthal_dcache_region_writeback_inv( void *addr, unsigned size );
464extern void xthal_dcache_line_writeback_inv(void *addr);
465/* prefetch and lock specified memory range into cache */
466extern void xthal_icache_region_lock( void *addr, unsigned size );
467extern void xthal_dcache_region_lock( void *addr, unsigned size );
468extern void xthal_icache_line_lock(void *addr);
469extern void xthal_dcache_line_lock(void *addr);
470/* unlock from cache */
471extern void xthal_icache_all_unlock( void );
472extern void xthal_dcache_all_unlock( void );
473extern void xthal_icache_region_unlock( void *addr, unsigned size );
474extern void xthal_dcache_region_unlock( void *addr, unsigned size );
475extern void xthal_icache_line_unlock(void *addr);
476extern void xthal_dcache_line_unlock(void *addr);
477
478
479/* sync icache and memory */
480extern void xthal_icache_sync( void );
481/* sync dcache and memory */
482extern void xthal_dcache_sync( void );
483
484/*----------------------------------------------------------------------
485 Debug
486 ----------------------------------------------------------------------*/
487
488/* 1 if debug option configured, 0 if not: */
489extern const int Xthal_debug_configured;
490
491/* Number of instruction and data break registers: */
492extern const int Xthal_num_ibreak;
493extern const int Xthal_num_dbreak;
494
495/* Set (plant) and remove software breakpoint, both synchronizing cache: */
496extern unsigned int xthal_set_soft_break(void *addr);
497extern void xthal_remove_soft_break(void *addr, unsigned int);
498
499
500/*----------------------------------------------------------------------
501 Disassembler
502 ----------------------------------------------------------------------*/
503
504/* Max expected size of the return buffer for a disassembled instruction (hint only): */
505#define XTHAL_DISASM_BUFSIZE 80
506
507/* Disassembly option bits for selecting what to return: */
508#define XTHAL_DISASM_OPT_ADDR 0x0001 /* display address */
509#define XTHAL_DISASM_OPT_OPHEX 0x0002 /* display opcode bytes in hex */
510#define XTHAL_DISASM_OPT_OPCODE 0x0004 /* display opcode name (mnemonic) */
511#define XTHAL_DISASM_OPT_PARMS 0x0008 /* display parameters */
512#define XTHAL_DISASM_OPT_ALL 0x0FFF /* display everything */
513
514/* routine to get a string for the disassembled instruction */
515extern int xthal_disassemble( unsigned char *instr_buf, void *tgt_addr,
516 char *buffer, unsigned buflen, unsigned options );
517
518/* routine to get the size of the next instruction. Returns 0 for
519 illegal instruction */
520extern int xthal_disassemble_size( unsigned char *instr_buf );
521
522
523/*----------------------------------------------------------------------
524 Core Counter
525 ----------------------------------------------------------------------*/
526
527/* counter info */
528extern const unsigned char Xthal_have_ccount; /* set if CCOUNT register present */
529extern const unsigned char Xthal_num_ccompare; /* number of CCOMPAREn registers */
530
531/* get CCOUNT register (if not present return 0) */
532extern unsigned xthal_get_ccount(void);
533
534/* set and get CCOMPAREn registers (if not present, get returns 0) */
535extern void xthal_set_ccompare(int, unsigned);
536extern unsigned xthal_get_ccompare(int);
537
538
539/*----------------------------------------------------------------------
540 Instruction/Data RAM/ROM Access
541 ----------------------------------------------------------------------*/
542
543extern void* xthal_memcpy(void *dst, const void *src, unsigned len);
544extern void* xthal_bcopy(const void *src, void *dst, unsigned len);
545
546/*----------------------------------------------------------------------
547 MP Synchronization
548 ----------------------------------------------------------------------*/
549extern int xthal_compare_and_set( int *addr, int test_val, int compare_val );
550extern unsigned xthal_get_prid( void );
551
552/*extern const char Xthal_have_s32c1i;*/
553extern const unsigned char Xthal_have_prid;
554
555
556/*----------------------------------------------------------------------
557 Miscellaneous
558 ----------------------------------------------------------------------*/
559
560extern const unsigned int Xthal_release_major;
561extern const unsigned int Xthal_release_minor;
562extern const char * const Xthal_release_name;
563extern const char * const Xthal_release_internal;
564
565extern const unsigned char Xthal_memory_order;
566extern const unsigned char Xthal_have_windowed;
567extern const unsigned char Xthal_have_density;
568extern const unsigned char Xthal_have_booleans;
569extern const unsigned char Xthal_have_loops;
570extern const unsigned char Xthal_have_nsa;
571extern const unsigned char Xthal_have_minmax;
572extern const unsigned char Xthal_have_sext;
573extern const unsigned char Xthal_have_clamps;
574extern const unsigned char Xthal_have_mac16;
575extern const unsigned char Xthal_have_mul16;
576extern const unsigned char Xthal_have_fp;
577extern const unsigned char Xthal_have_speculation;
578extern const unsigned char Xthal_have_exceptions;
579extern const unsigned char Xthal_xea_version;
580extern const unsigned char Xthal_have_interrupts;
581extern const unsigned char Xthal_have_highlevel_interrupts;
582extern const unsigned char Xthal_have_nmi;
583
584extern const unsigned short Xthal_num_writebuffer_entries;
585
586extern const unsigned int Xthal_build_unique_id;
587/* Release info for hardware targeted by software upgrades: */
588extern const unsigned int Xthal_hw_configid0;
589extern const unsigned int Xthal_hw_configid1;
590extern const unsigned int Xthal_hw_release_major;
591extern const unsigned int Xthal_hw_release_minor;
592extern const char * const Xthal_hw_release_name;
593extern const char * const Xthal_hw_release_internal;
594
595
596/* Internal memories... */
597
598extern const unsigned char Xthal_num_instrom;
599extern const unsigned char Xthal_num_instram;
600extern const unsigned char Xthal_num_datarom;
601extern const unsigned char Xthal_num_dataram;
602extern const unsigned char Xthal_num_xlmi;
603extern const unsigned int Xthal_instrom_vaddr[1];
604extern const unsigned int Xthal_instrom_paddr[1];
605extern const unsigned int Xthal_instrom_size [1];
606extern const unsigned int Xthal_instram_vaddr[1];
607extern const unsigned int Xthal_instram_paddr[1];
608extern const unsigned int Xthal_instram_size [1];
609extern const unsigned int Xthal_datarom_vaddr[1];
610extern const unsigned int Xthal_datarom_paddr[1];
611extern const unsigned int Xthal_datarom_size [1];
612extern const unsigned int Xthal_dataram_vaddr[1];
613extern const unsigned int Xthal_dataram_paddr[1];
614extern const unsigned int Xthal_dataram_size [1];
615extern const unsigned int Xthal_xlmi_vaddr[1];
616extern const unsigned int Xthal_xlmi_paddr[1];
617extern const unsigned int Xthal_xlmi_size [1];
618
619
620
621/*----------------------------------------------------------------------
622 Memory Management Unit
623 ----------------------------------------------------------------------*/
624
625extern const unsigned char Xthal_have_spanning_way;
626extern const unsigned char Xthal_have_identity_map;
627extern const unsigned char Xthal_have_mimic_cacheattr;
628extern const unsigned char Xthal_have_xlt_cacheattr;
629extern const unsigned char Xthal_have_cacheattr;
630extern const unsigned char Xthal_have_tlbs;
631
632extern const unsigned char Xthal_mmu_asid_bits; /* 0 .. 8 */
633extern const unsigned char Xthal_mmu_asid_kernel;
634extern const unsigned char Xthal_mmu_rings; /* 1 .. 4 (perhaps 0 if no MMU and/or no protection?) */
635extern const unsigned char Xthal_mmu_ring_bits;
636extern const unsigned char Xthal_mmu_sr_bits;
637extern const unsigned char Xthal_mmu_ca_bits;
638extern const unsigned int Xthal_mmu_max_pte_page_size;
639extern const unsigned int Xthal_mmu_min_pte_page_size;
640
641extern const unsigned char Xthal_itlb_way_bits;
642extern const unsigned char Xthal_itlb_ways;
643extern const unsigned char Xthal_itlb_arf_ways;
644extern const unsigned char Xthal_dtlb_way_bits;
645extern const unsigned char Xthal_dtlb_ways;
646extern const unsigned char Xthal_dtlb_arf_ways;
647
648/* Convert between virtual and physical addresses (through static maps only): */
649/*** WARNING: these two functions may go away in a future release; don't depend on them! ***/
650extern int xthal_static_v2p( unsigned vaddr, unsigned *paddrp );
651extern int xthal_static_p2v( unsigned paddr, unsigned *vaddrp, unsigned cached );
652
653#if 0
654/******************* EXPERIMENTAL AND TENTATIVE ONLY ********************/
655
656#define XTHAL_MMU_PAGESZ_COUNT_MAX 8 /* maximum number of different page sizes */
657extern const char Xthal_mmu_pagesz_count; /* 0 .. 8 number of different page sizes configured */
658
659/* Note: the following table doesn't necessarily have page sizes in increasing order: */
660extern const char Xthal_mmu_pagesz_log2[XTHAL_MMU_PAGESZ_COUNT_MAX]; /* 10 .. 28 (0 past count) */
661
662/* Sorted (increasing) table of page sizes, that indexes into the above table: */
663extern const char Xthal_mmu_pagesz_sorted[XTHAL_MMU_PAGESZ_COUNT_MAX]; /* 0 .. 7 (0 past count) */
664
665/*u32 Xthal_virtual_exceptions;*/ /* bitmask of which exceptions execute in virtual mode... */
666
667extern const char Xthal_mmu_pte_pagesz_log2_min; /* ?? minimum page size in PTEs */
668extern const char Xthal_mmu_pte_pagesz_log2_max; /* ?? maximum page size in PTEs */
669
670/* Cache Attribute Bits Implemented by the Cache (part of the cache abstraction) */
671extern const char Xthal_icache_fca_bits_implemented; /* ITLB/UTLB only! */
672extern const char Xthal_dcache_lca_bits_implemented; /* DTLB/UTLB only! */
673extern const char Xthal_dcache_sca_bits_implemented; /* DTLB/UTLB only! */
674
675/* Per TLB Parameters (Instruction, Data, Unified) */
676struct XtHalMmuTlb Xthal_itlb; /* description of MMU I-TLB generic features */
677struct XtHalMmuTlb Xthal_dtlb; /* description of MMU D-TLB generic features */
678struct XtHalMmuTlb Xthal_utlb; /* description of MMU U-TLB generic features */
679
680#define XTHAL_MMU_WAYS_MAX 8 /* maximum number of ways (associativities) for each TLB */
681
682/* Structure for common information described for each possible TLB (instruction, data and unified): */
683typedef struct XtHalMmuTlb {
684 u8 va_bits; /* 32 (number of virtual address bits) */
685 u8 pa_bits; /* 32 (number of physical address bits) */
686 bool tlb_va_indexed; /* 1 (set if TLB is indexed by virtual address) */
687 bool tlb_va_tagged; /* 0 (set if TLB is tagged by virtual address) */
688 bool cache_va_indexed; /* 1 (set if cache is indexed by virtual address) */
689 bool cache_va_tagged; /* 0 (set if cache is tagged by virtual address) */
690 /*bool (whether page tables are traversed in vaddr sorted order, paddr sorted order, ...) */
691 /*u8 (set of available page attribute bits, other than cache attribute bits defined above) */
692 /*u32 (various masks for pages, MMU table/TLB entries, etc.) */
693 u8 way_count; /* 0 .. 8 (number of ways, a.k.a. associativities, for this TLB) */
694 XtHalMmuTlbWay * ways[XTHAL_MMU_WAYS_MAX]; /* pointers to per-way parms for each way */
695} XtHalMmuTlb;
696
697/* Per TLB Way (Per Associativity) Parameters */
698typedef struct XtHalMmuTlbWay {
699 u32 index_count_log2; /* 0 .. 4 */
700 u32 pagesz_mask; /* 0 .. 2^pagesz_count - 1 (each bit corresponds to a size */
701 /* defined in the Xthal_mmu_pagesz_log2[] table) */
702 u32 vpn_const_mask;
703 u32 vpn_const_value;
704 u64 ppn_const_mask; /* future may support pa_bits > 32 */
705 u64 ppn_const_value;
706 u32 ppn_id_mask; /* paddr bits taken directly from vaddr */
707 bool backgnd_match; /* 0 or 1 */
708 /* These are defined in terms of the XTHAL_CACHE_xxx bits: */
709 u8 fca_const_mask; /* ITLB/UTLB only! */
710 u8 fca_const_value; /* ITLB/UTLB only! */
711 u8 lca_const_mask; /* DTLB/UTLB only! */
712 u8 lca_const_value; /* DTLB/UTLB only! */
713 u8 sca_const_mask; /* DTLB/UTLB only! */
714 u8 sca_const_value; /* DTLB/UTLB only! */
715 /* These define an encoding that map 5 bits in TLB and PTE entries to */
716 /* 8 bits (FCA, ITLB), 16 bits (LCA+SCA, DTLB) or 24 bits (FCA+LCA+SCA, UTLB): */
717 /* (they may be moved to struct XtHalMmuTlb) */
718 u8 ca_bits; /* number of bits in TLB/PTE entries for cache attributes */
719 u32 * ca_map; /* pointer to array of 2^ca_bits entries of FCA+LCA+SCA bits */
720} XtHalMmuTlbWay;
721
722/*
723 * The way to determine whether protection support is present in core
724 * is to [look at Xthal_mmu_rings ???].
725 * Give info on memory requirements for MMU tables and other in-memory
726 * data structures (globally, per task, base and per page, etc.) - whatever bounds can be calculated.
727 */
728
729
730/* Default vectors: */
731xthal_immu_fetch_miss_vector
732xthal_dmmu_load_miss_vector
733xthal_dmmu_store_miss_vector
734
735/* Functions called when a fault is detected: */
736typedef void (XtHalMmuFaultFunc)( unsigned vaddr, ...context... );
737/* Or, */
738/* a? = vaddr */
739/* a? = context... */
740/* PS.xxx = xxx */
741XtHalMMuFaultFunc *Xthal_immu_fetch_fault_func;
742XtHalMMuFaultFunc *Xthal_dmmu_load_fault_func;
743XtHalMMuFaultFunc *Xthal_dmmu_store_fault_func;
744
745/* Default Handlers: */
746/* The user and/or kernel exception handlers may jump to these handlers to handle the relevant exceptions,
747 * according to the value of EXCCAUSE. The exact register state on entry to these handlers is TBD. */
748/* When multiple TLB entries match (hit) on the same access: */
749xthal_immu_fetch_multihit_handler
750xthal_dmmu_load_multihit_handler
751xthal_dmmu_store_multihit_handler
752/* Protection violations according to cache attributes, and other cache attribute mismatches: */
753xthal_immu_fetch_attr_handler
754xthal_dmmu_load_attr_handler
755xthal_dmmu_store_attr_handler
756/* Protection violations due to insufficient ring level: */
757xthal_immu_fetch_priv_handler
758xthal_dmmu_load_priv_handler
759xthal_dmmu_store_priv_handler
760/* Alignment exception handlers (if supported by the particular Xtensa MMU configuration): */
761xthal_dmmu_load_align_handler
762xthal_dmmu_store_align_handler
763
764/* Or, alternatively, the OS user and/or kernel exception handlers may simply jump to the
765 * following entry points which will handle any values of EXCCAUSE not handled by the OS: */
766xthal_user_exc_default_handler
767xthal_kernel_exc_default_handler
768
769#endif /*0*/
770
771#ifdef INCLUDE_DEPRECATED_HAL_CODE
772extern const unsigned char Xthal_have_old_exc_arch;
773extern const unsigned char Xthal_have_mmu;
774extern const unsigned int Xthal_num_regs;
775extern const unsigned char Xthal_num_iroms;
776extern const unsigned char Xthal_num_irams;
777extern const unsigned char Xthal_num_droms;
778extern const unsigned char Xthal_num_drams;
779extern const unsigned int Xthal_configid0;
780extern const unsigned int Xthal_configid1;
781#endif
782
783#ifdef INCLUDE_DEPRECATED_HAL_DEBUG_CODE
784#define XTHAL_24_BIT_BREAK 0x80000000
785#define XTHAL_16_BIT_BREAK 0x40000000
786extern const unsigned short Xthal_ill_inst_16[16];
787#define XTHAL_DEST_REG 0xf0000000 /* Mask for destination register */
788#define XTHAL_DEST_REG_INST 0x08000000 /* Branch address is in register */
789#define XTHAL_DEST_REL_INST 0x04000000 /* Branch address is relative */
790#define XTHAL_RFW_INST 0x00000800
791#define XTHAL_RFUE_INST 0x00000400
792#define XTHAL_RFI_INST 0x00000200
793#define XTHAL_RFE_INST 0x00000100
794#define XTHAL_RET_INST 0x00000080
795#define XTHAL_BREAK_INST 0x00000040
796#define XTHAL_SYSCALL_INST 0x00000020
797#define XTHAL_LOOP_END 0x00000010 /* Not set by xthal_inst_type */
798#define XTHAL_JUMP_INST 0x00000008 /* Call or jump instruction */
799#define XTHAL_BRANCH_INST 0x00000004 /* Branch instruction */
800#define XTHAL_24_BIT_INST 0x00000002
801#define XTHAL_16_BIT_INST 0x00000001
802typedef struct xthal_state {
803 unsigned pc;
804 unsigned ar[16];
805 unsigned lbeg;
806 unsigned lend;
807 unsigned lcount;
808 unsigned extra_ptr;
809 unsigned cpregs_ptr[XTHAL_MAX_CPS];
810} XTHAL_STATE;
811extern unsigned int xthal_inst_type(void *addr);
812extern unsigned int xthal_branch_addr(void *addr);
813extern unsigned int xthal_get_npc(XTHAL_STATE *user_state);
814#endif /* INCLUDE_DEPRECATED_HAL_DEBUG_CODE */
815
816#ifdef __cplusplus
817}
818#endif
819#endif /*!__ASSEMBLY__ */
820
821#endif /*XTENSA_HAL_H*/
822
diff --git a/include/asm-xtensa/xtensa/simcall.h b/include/asm-xtensa/xtensa/simcall.h
deleted file mode 100644
index a2b868929a49..000000000000
--- a/include/asm-xtensa/xtensa/simcall.h
+++ /dev/null
@@ -1,130 +0,0 @@
1#ifndef SIMCALL_INCLUDED
2#define SIMCALL_INCLUDED
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/simcall.h - Simulator call numbers
8 *
9 * This file is subject to the terms and conditions of the GNU General
10 * Public License. See the file "COPYING" in the main directory of
11 * this archive for more details.
12 *
13 * Copyright (C) 2002 Tensilica Inc.
14 */
15
16
17/*
18 * System call like services offered by the simulator host.
19 * These are modeled after the Linux 2.4 kernel system calls
20 * for Xtensa processors. However not all system calls and
21 * not all functionality of a given system call are implemented,
22 * or necessarily have well defined or equivalent semantics in
23 * the context of a simulation (as opposed to a Unix kernel).
24 *
25 * These services behave largely as if they had been invoked
26 * as a task in the simulator host's operating system
27 * (eg. files accessed are those of the simulator host).
28 * However, these SIMCALLs model a virtual operating system
29 * so that various definitions, bit assignments etc
30 * (eg. open mode bits, errno values, etc) are independent
31 * of the host operating system used to run the simulation.
32 * Rather these definitions are specific to the Xtensa ISS.
33 * This way Xtensa ISA code written to use these SIMCALLs
34 * can (in principle) be simulated on any host.
35 *
36 * Up to 6 parameters are passed in registers a3 to a8
37 * (note the 6th parameter isn't passed on the stack,
38 * unlike windowed function calling conventions).
39 * The return value is in a2. A negative value in the
40 * range -4096 to -1 indicates a negated error code to be
41 * reported in errno with a return value of -1, otherwise
42 * the value in a2 is returned as is.
43 */
44
45/* These #defines need to match what's in Xtensa/OS/vxworks/xtiss/simcalls.c */
46
47#define SYS_nop 0 /* n/a - setup; used to flush register windows */
48#define SYS_exit 1 /*x*/
49#define SYS_fork 2
50#define SYS_read 3 /*x*/
51#define SYS_write 4 /*x*/
52#define SYS_open 5 /*x*/
53#define SYS_close 6 /*x*/
54#define SYS_rename 7 /*x 38 - waitpid */
55#define SYS_creat 8 /*x*/
56#define SYS_link 9 /*x (not implemented on WIN32) */
57#define SYS_unlink 10 /*x*/
58#define SYS_execv 11 /* n/a - execve */
59#define SYS_execve 12 /* 11 - chdir */
60#define SYS_pipe 13 /* 42 - time */
61#define SYS_stat 14 /* 106 - mknod */
62#define SYS_chmod 15
63#define SYS_chown 16 /* 202 - lchown */
64#define SYS_utime 17 /* 30 - break */
65#define SYS_wait 18 /* n/a - oldstat */
66#define SYS_lseek 19 /*x*/
67#define SYS_getpid 20
68#define SYS_isatty 21 /* n/a - mount */
69#define SYS_fstat 22 /* 108 - oldumount */
70#define SYS_time 23 /* 13 - setuid */
71#define SYS_gettimeofday 24 /*x 78 - getuid (not implemented on WIN32) */
72#define SYS_times 25 /*X 43 - stime (Xtensa-specific implementation) */
73#define SYS_socket 26
74#define SYS_sendto 27
75#define SYS_recvfrom 28
76#define SYS_select_one 29 /* not compitible select, one file descriptor at the time */
77#define SYS_bind 30
78#define SYS_ioctl 31
79
80/*
81 * Other...
82 */
83#define SYS_iss_argc 1000 /* returns value of argc */
84#define SYS_iss_argv_size 1001 /* bytes needed for argv & arg strings */
85#define SYS_iss_set_argv 1002 /* saves argv & arg strings at given addr */
86
87/*
88 * SIMCALLs for the ferret memory debugger. All are invoked by
89 * libferret.a ... ( Xtensa/Target-Libs/ferret )
90 */
91#define SYS_ferret 1010
92#define SYS_malloc 1011
93#define SYS_free 1012
94#define SYS_more_heap 1013
95#define SYS_no_heap 1014
96
97
98/*
99 * Extra SIMCALLs for GDB:
100 */
101#define SYS_gdb_break -1 /* invoked by XTOS on user exceptions if EPC points
102 to a break.n/break, regardless of cause! */
103#define SYS_xmon_out -2 /* invoked by XMON: ... */
104#define SYS_xmon_in -3 /* invoked by XMON: ... */
105#define SYS_xmon_flush -4 /* invoked by XMON: ... */
106#define SYS_gdb_abort -5 /* invoked by XTOS in _xtos_panic() */
107#define SYS_gdb_illegal_inst -6 /* invoked by XTOS for illegal instructions (too deeply) */
108#define SYS_xmon_init -7 /* invoked by XMON: ... */
109#define SYS_gdb_enter_sktloop -8 /* invoked by XTOS on debug exceptions */
110
111/*
112 * SIMCALLs for vxWorks xtiss BSP:
113 */
114#define SYS_setup_ppp_pipes -83
115#define SYS_log_msg -84
116
117/*
118 * Test SIMCALLs:
119 */
120#define SYS_test_write_state -100
121#define SYS_test_read_state -101
122
123/*
124 * SYS_select_one specifiers
125 */
126#define XTISS_SELECT_ONE_READ 1
127#define XTISS_SELECT_ONE_WRITE 2
128#define XTISS_SELECT_ONE_EXCEPT 3
129
130#endif /* !SIMCALL_INCLUDED */
diff --git a/include/asm-xtensa/xtensa/xt2000-uart.h b/include/asm-xtensa/xtensa/xt2000-uart.h
deleted file mode 100644
index 0154460f0ed8..000000000000
--- a/include/asm-xtensa/xtensa/xt2000-uart.h
+++ /dev/null
@@ -1,155 +0,0 @@
1#ifndef _uart_h_included_
2#define _uart_h_included_
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/xt2000-uart.h -- NatSemi PC16552D DUART
8 * definitions
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file "COPYING" in the main directory of this archive
12 * for more details.
13 *
14 * Copyright (C) 2002 Tensilica Inc.
15 */
16
17
18#include <xtensa/xt2000.h>
19
20
21/* 16550 UART DEVICE REGISTERS
22 The XT2000 board aligns each register to a 32-bit word but the UART device only uses
23 one byte of the word, which is the least-significant byte regardless of the
24 endianness of the core (ie. byte offset 0 for little-endian and 3 for big-endian).
25 So if using word accesses then endianness doesn't matter.
26 The macros provided here do that.
27*/
28struct uart_dev_s {
29 union {
30 unsigned int rxb; /* DLAB=0: receive buffer, read-only */
31 unsigned int txb; /* DLAB=0: transmit buffer, write-only */
32 unsigned int dll; /* DLAB=1: divisor, least-significant byte latch (was write-only?) */
33 } w0;
34 union {
35 unsigned int ier; /* DLAB=0: interrupt-enable register (was write-only?) */
36 unsigned int dlm; /* DLAB=1: divisor, most-significant byte latch (was write-only?) */
37 } w1;
38
39 union {
40 unsigned int isr; /* DLAB=0: interrupt status register, read-only */
41 unsigned int fcr; /* DLAB=0: FIFO control register, write-only */
42 unsigned int afr; /* DLAB=1: alternate function register */
43 } w2;
44
45 unsigned int lcr; /* line control-register, write-only */
46 unsigned int mcr; /* modem control-regsiter, write-only */
47 unsigned int lsr; /* line status register, read-only */
48 unsigned int msr; /* modem status register, read-only */
49 unsigned int scr; /* scratch regsiter, read/write */
50};
51
52#define _RXB(u) ((u)->w0.rxb)
53#define _TXB(u) ((u)->w0.txb)
54#define _DLL(u) ((u)->w0.dll)
55#define _IER(u) ((u)->w1.ier)
56#define _DLM(u) ((u)->w1.dlm)
57#define _ISR(u) ((u)->w2.isr)
58#define _FCR(u) ((u)->w2.fcr)
59#define _AFR(u) ((u)->w2.afr)
60#define _LCR(u) ((u)->lcr)
61#define _MCR(u) ((u)->mcr)
62#define _LSR(u) ((u)->lsr)
63#define _MSR(u) ((u)->msr)
64#define _SCR(u) ((u)->scr)
65
66typedef volatile struct uart_dev_s uart_dev_t;
67
68/* IER bits */
69#define RCVR_DATA_REG_INTENABLE 0x01
70#define XMIT_HOLD_REG_INTENABLE 0x02
71#define RCVR_STATUS_INTENABLE 0x04
72#define MODEM_STATUS_INTENABLE 0x08
73
74/* FCR bits */
75#define _FIFO_ENABLE 0x01
76#define RCVR_FIFO_RESET 0x02
77#define XMIT_FIFO_RESET 0x04
78#define DMA_MODE_SELECT 0x08
79#define RCVR_TRIGGER_LSB 0x40
80#define RCVR_TRIGGER_MSB 0x80
81
82/* AFR bits */
83#define AFR_CONC_WRITE 0x01
84#define AFR_BAUDOUT_SEL 0x02
85#define AFR_RXRDY_SEL 0x04
86
87/* ISR bits */
88#define INT_STATUS(r) ((r)&1)
89#define INT_PRIORITY(r) (((r)>>1)&0x7)
90
91/* LCR bits */
92#define WORD_LENGTH(n) (((n)-5)&0x3)
93#define STOP_BIT_ENABLE 0x04
94#define PARITY_ENABLE 0x08
95#define EVEN_PARITY 0x10
96#define FORCE_PARITY 0x20
97#define XMIT_BREAK 0x40
98#define DLAB_ENABLE 0x80
99
100/* MCR bits */
101#define _DTR 0x01
102#define _RTS 0x02
103#define _OP1 0x04
104#define _OP2 0x08
105#define LOOP_BACK 0x10
106
107/* LSR Bits */
108#define RCVR_DATA_READY 0x01
109#define OVERRUN_ERROR 0x02
110#define PARITY_ERROR 0x04
111#define FRAMING_ERROR 0x08
112#define BREAK_INTERRUPT 0x10
113#define XMIT_HOLD_EMPTY 0x20
114#define XMIT_EMPTY 0x40
115#define FIFO_ERROR 0x80
116#define RCVR_READY(u) (_LSR(u)&RCVR_DATA_READY)
117#define XMIT_READY(u) (_LSR(u)&XMIT_HOLD_EMPTY)
118
119/* MSR bits */
120#define _RDR 0x01
121#define DELTA_DSR 0x02
122#define DELTA_RI 0x04
123#define DELTA_CD 0x08
124#define _CTS 0x10
125#define _DSR 0x20
126#define _RI 0x40
127#define _CD 0x80
128
129/* prototypes */
130void uart_init( uart_dev_t *u, int bitrate );
131void uart_out( uart_dev_t *u, char c );
132void uart_puts( uart_dev_t *u, char *s );
133char uart_in( uart_dev_t *u );
134void uart_enable_rcvr_int( uart_dev_t *u );
135void uart_disable_rcvr_int( uart_dev_t *u );
136
137#ifdef DUART16552_1_VADDR
138/* DUART present. */
139#define DUART_1_BASE (*(uart_dev_t*)DUART16552_1_VADDR)
140#define DUART_2_BASE (*(uart_dev_t*)DUART16552_2_VADDR)
141#define UART1_PUTS(s) uart_puts( &DUART_1_BASE, s )
142#define UART2_PUTS(s) uart_puts( &DUART_2_BASE, s )
143#else
144/* DUART not configured, use dummy placeholders to allow compiles to work. */
145#define DUART_1_BASE (*(uart_dev_t*)0)
146#define DUART_2_BASE (*(uart_dev_t*)0)
147#define UART1_PUTS(s)
148#define UART2_PUTS(s)
149#endif
150
151/* Compute 16-bit divisor for baudrate generator, with rounding: */
152#define DUART_DIVISOR(crystal,speed) (((crystal)/16 + (speed)/2)/(speed))
153
154#endif /*_uart_h_included_*/
155
diff --git a/include/asm-xtensa/xtensa/xt2000.h b/include/asm-xtensa/xtensa/xt2000.h
deleted file mode 100644
index 703a45002f8f..000000000000
--- a/include/asm-xtensa/xtensa/xt2000.h
+++ /dev/null
@@ -1,408 +0,0 @@
1#ifndef _INC_XT2000_H_
2#define _INC_XT2000_H_
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/xt2000.h - Definitions specific to the
8 * Tensilica XT2000 Emulation Board
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file "COPYING" in the main directory of this archive
12 * for more details.
13 *
14 * Copyright (C) 2002 Tensilica Inc.
15 */
16
17
18#include <xtensa/config/core.h>
19#include <xtensa/config/system.h>
20
21
22/*
23 * Default assignment of XT2000 devices to external interrupts.
24 */
25
26/* Ethernet interrupt: */
27#ifdef XCHAL_EXTINT3_NUM
28#define SONIC83934_INTNUM XCHAL_EXTINT3_NUM
29#define SONIC83934_INTLEVEL XCHAL_EXTINT3_LEVEL
30#define SONIC83934_INTMASK XCHAL_EXTINT3_MASK
31#else
32#define SONIC83934_INTMASK 0
33#endif
34
35/* DUART channel 1 interrupt (P1 - console): */
36#ifdef XCHAL_EXTINT4_NUM
37#define DUART16552_1_INTNUM XCHAL_EXTINT4_NUM
38#define DUART16552_1_INTLEVEL XCHAL_EXTINT4_LEVEL
39#define DUART16552_1_INTMASK XCHAL_EXTINT4_MASK
40#else
41#define DUART16552_1_INTMASK 0
42#endif
43
44/* DUART channel 2 interrupt (P2 - 2nd serial port): */
45#ifdef XCHAL_EXTINT5_NUM
46#define DUART16552_2_INTNUM XCHAL_EXTINT5_NUM
47#define DUART16552_2_INTLEVEL XCHAL_EXTINT5_LEVEL
48#define DUART16552_2_INTMASK XCHAL_EXTINT5_MASK
49#else
50#define DUART16552_2_INTMASK 0
51#endif
52
53/* FPGA-combined PCI/etc interrupts: */
54#ifdef XCHAL_EXTINT6_NUM
55#define XT2000_FPGAPCI_INTNUM XCHAL_EXTINT6_NUM
56#define XT2000_FPGAPCI_INTLEVEL XCHAL_EXTINT6_LEVEL
57#define XT2000_FPGAPCI_INTMASK XCHAL_EXTINT6_MASK
58#else
59#define XT2000_FPGAPCI_INTMASK 0
60#endif
61
62
63
64/*
65 * Device addresses.
66 *
67 * Note: for endianness-independence, use 32-bit loads and stores for all
68 * register accesses to Ethernet, DUART and LED devices. Undefined bits
69 * may need to be masked out if needed when reading if the actual register
70 * size is smaller than 32 bits.
71 *
72 * Note: XT2000 bus byte lanes are defined in terms of msbyte and lsbyte
73 * relative to the processor. So 32-bit registers are accessed consistently
74 * from both big and little endian processors. However, this means byte
75 * sequences are not consistent between big and little endian processors.
76 * This is fine for RAM, and for ROM if ROM is created for a specific
77 * processor (and thus has correct byte sequences). However this may be
78 * unexpected for Flash, which might contain a file-system that one wants
79 * to use for multiple processor configurations (eg. the Flash might contain
80 * the Ethernet card's address, endianness-independent application data, etc).
81 * That is, byte sequences written in Flash by a core of a given endianness
82 * will be byte-swapped when seen by a core of the other endianness.
83 * Someone implementing an endianness-independent Flash file system will
84 * likely handle this byte-swapping issue in the Flash driver software.
85 */
86
87#define DUART16552_XTAL_FREQ 18432000 /* crystal frequency in Hz */
88#define XTBOARD_FLASH_MAXSIZE 0x4000000 /* 64 MB (max; depends on what is socketed!) */
89#define XTBOARD_EPROM_MAXSIZE 0x0400000 /* 4 MB (max; depends on what is socketed!) */
90#define XTBOARD_EEPROM_MAXSIZE 0x0080000 /* 512 kB (max; depends on what is socketed!) */
91#define XTBOARD_ASRAM_SIZE 0x0100000 /* 1 MB */
92#define XTBOARD_PCI_MEM_SIZE 0x8000000 /* 128 MB (allocated) */
93#define XTBOARD_PCI_IO_SIZE 0x1000000 /* 16 MB (allocated) */
94
95#ifdef XSHAL_IOBLOCK_BYPASS_PADDR
96/* PCI memory space: */
97# define XTBOARD_PCI_MEM_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0x0000000)
98/* Socketed Flash (eg. 2 x 16-bit devices): */
99# define XTBOARD_FLASH_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0x8000000)
100/* PCI I/O space: */
101# define XTBOARD_PCI_IO_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xC000000)
102/* V3 PCI interface chip register/config space: */
103# define XTBOARD_V3PCI_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD000000)
104/* Bus Interface registers: */
105# define XTBOARD_BUSINT_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD010000)
106/* FPGA registers: */
107# define XT2000_FPGAREGS_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD020000)
108/* SONIC SN83934 Ethernet controller/transceiver: */
109# define SONIC83934_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD030000)
110/* 8-character bitmapped LED display: */
111# define XTBOARD_LED_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD040000)
112/* National-Semi PC16552D DUART: */
113# define DUART16552_1_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD050020) /* channel 1 (P1 - console) */
114# define DUART16552_2_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD050000) /* channel 2 (P2) */
115/* Asynchronous Static RAM: */
116# define XTBOARD_ASRAM_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD400000)
117/* 8-bit EEPROM: */
118# define XTBOARD_EEPROM_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD600000)
119/* 2 x 16-bit EPROMs: */
120# define XTBOARD_EPROM_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD800000)
121#endif /* XSHAL_IOBLOCK_BYPASS_PADDR */
122
123/* These devices might be accessed cached: */
124#ifdef XSHAL_IOBLOCK_CACHED_PADDR
125# define XTBOARD_PCI_MEM_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0x0000000)
126# define XTBOARD_FLASH_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0x8000000)
127# define XTBOARD_ASRAM_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0xD400000)
128# define XTBOARD_EEPROM_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0xD600000)
129# define XTBOARD_EPROM_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0xD800000)
130#endif /* XSHAL_IOBLOCK_CACHED_PADDR */
131
132
133/*** Same thing over again, this time with virtual addresses: ***/
134
135#ifdef XSHAL_IOBLOCK_BYPASS_VADDR
136/* PCI memory space: */
137# define XTBOARD_PCI_MEM_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0x0000000)
138/* Socketed Flash (eg. 2 x 16-bit devices): */
139# define XTBOARD_FLASH_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0x8000000)
140/* PCI I/O space: */
141# define XTBOARD_PCI_IO_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xC000000)
142/* V3 PCI interface chip register/config space: */
143# define XTBOARD_V3PCI_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD000000)
144/* Bus Interface registers: */
145# define XTBOARD_BUSINT_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD010000)
146/* FPGA registers: */
147# define XT2000_FPGAREGS_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD020000)
148/* SONIC SN83934 Ethernet controller/transceiver: */
149# define SONIC83934_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD030000)
150/* 8-character bitmapped LED display: */
151# define XTBOARD_LED_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD040000)
152/* National-Semi PC16552D DUART: */
153# define DUART16552_1_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD050020) /* channel 1 (P1 - console) */
154# define DUART16552_2_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD050000) /* channel 2 (P2) */
155/* Asynchronous Static RAM: */
156# define XTBOARD_ASRAM_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD400000)
157/* 8-bit EEPROM: */
158# define XTBOARD_EEPROM_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD600000)
159/* 2 x 16-bit EPROMs: */
160# define XTBOARD_EPROM_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD800000)
161#endif /* XSHAL_IOBLOCK_BYPASS_VADDR */
162
163/* These devices might be accessed cached: */
164#ifdef XSHAL_IOBLOCK_CACHED_VADDR
165# define XTBOARD_PCI_MEM_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0x0000000)
166# define XTBOARD_FLASH_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0x8000000)
167# define XTBOARD_ASRAM_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0xD400000)
168# define XTBOARD_EEPROM_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0xD600000)
169# define XTBOARD_EPROM_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0xD800000)
170#endif /* XSHAL_IOBLOCK_CACHED_VADDR */
171
172
173/* System ROM: */
174#define XTBOARD_ROM_SIZE XSHAL_ROM_SIZE
175#ifdef XSHAL_ROM_VADDR
176#define XTBOARD_ROM_VADDR XSHAL_ROM_VADDR
177#endif
178#ifdef XSHAL_ROM_PADDR
179#define XTBOARD_ROM_PADDR XSHAL_ROM_PADDR
180#endif
181
182/* System RAM: */
183#define XTBOARD_RAM_SIZE XSHAL_RAM_SIZE
184#ifdef XSHAL_RAM_VADDR
185#define XTBOARD_RAM_VADDR XSHAL_RAM_VADDR
186#endif
187#ifdef XSHAL_RAM_PADDR
188#define XTBOARD_RAM_PADDR XSHAL_RAM_PADDR
189#endif
190#define XTBOARD_RAM_BYPASS_VADDR XSHAL_RAM_BYPASS_VADDR
191#define XTBOARD_RAM_BYPASS_PADDR XSHAL_RAM_BYPASS_PADDR
192
193
194
195/*
196 * Things that depend on device addresses.
197 */
198
199
200#define XTBOARD_CACHEATTR_WRITEBACK XSHAL_XT2000_CACHEATTR_WRITEBACK
201#define XTBOARD_CACHEATTR_WRITEALLOC XSHAL_XT2000_CACHEATTR_WRITEALLOC
202#define XTBOARD_CACHEATTR_WRITETHRU XSHAL_XT2000_CACHEATTR_WRITETHRU
203#define XTBOARD_CACHEATTR_BYPASS XSHAL_XT2000_CACHEATTR_BYPASS
204#define XTBOARD_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_DEFAULT
205
206#define XTBOARD_BUSINT_PIPE_REGIONS XSHAL_XT2000_PIPE_REGIONS
207#define XTBOARD_BUSINT_SDRAM_REGIONS XSHAL_XT2000_SDRAM_REGIONS
208
209
210
211/*
212 * BusLogic (FPGA) registers.
213 * All these registers are normally accessed using 32-bit loads/stores.
214 */
215
216/* Register offsets: */
217#define XT2000_DATECD_OFS 0x00 /* date code (read-only) */
218#define XT2000_STSREG_OFS 0x04 /* status (read-only) */
219#define XT2000_SYSLED_OFS 0x08 /* system LED */
220#define XT2000_WRPROT_OFS 0x0C /* write protect */
221#define XT2000_SWRST_OFS 0x10 /* software reset */
222#define XT2000_SYSRST_OFS 0x14 /* system (peripherals) reset */
223#define XT2000_IMASK_OFS 0x18 /* interrupt mask */
224#define XT2000_ISTAT_OFS 0x1C /* interrupt status */
225#define XT2000_V3CFG_OFS 0x20 /* V3 config (V320 PCI) */
226
227/* Physical register addresses: */
228#ifdef XT2000_FPGAREGS_PADDR
229#define XT2000_DATECD_PADDR (XT2000_FPGAREGS_PADDR+XT2000_DATECD_OFS)
230#define XT2000_STSREG_PADDR (XT2000_FPGAREGS_PADDR+XT2000_STSREG_OFS)
231#define XT2000_SYSLED_PADDR (XT2000_FPGAREGS_PADDR+XT2000_SYSLED_OFS)
232#define XT2000_WRPROT_PADDR (XT2000_FPGAREGS_PADDR+XT2000_WRPROT_OFS)
233#define XT2000_SWRST_PADDR (XT2000_FPGAREGS_PADDR+XT2000_SWRST_OFS)
234#define XT2000_SYSRST_PADDR (XT2000_FPGAREGS_PADDR+XT2000_SYSRST_OFS)
235#define XT2000_IMASK_PADDR (XT2000_FPGAREGS_PADDR+XT2000_IMASK_OFS)
236#define XT2000_ISTAT_PADDR (XT2000_FPGAREGS_PADDR+XT2000_ISTAT_OFS)
237#define XT2000_V3CFG_PADDR (XT2000_FPGAREGS_PADDR+XT2000_V3CFG_OFS)
238#endif
239
240/* Virtual register addresses: */
241#ifdef XT2000_FPGAREGS_VADDR
242#define XT2000_DATECD_VADDR (XT2000_FPGAREGS_VADDR+XT2000_DATECD_OFS)
243#define XT2000_STSREG_VADDR (XT2000_FPGAREGS_VADDR+XT2000_STSREG_OFS)
244#define XT2000_SYSLED_VADDR (XT2000_FPGAREGS_VADDR+XT2000_SYSLED_OFS)
245#define XT2000_WRPROT_VADDR (XT2000_FPGAREGS_VADDR+XT2000_WRPROT_OFS)
246#define XT2000_SWRST_VADDR (XT2000_FPGAREGS_VADDR+XT2000_SWRST_OFS)
247#define XT2000_SYSRST_VADDR (XT2000_FPGAREGS_VADDR+XT2000_SYSRST_OFS)
248#define XT2000_IMASK_VADDR (XT2000_FPGAREGS_VADDR+XT2000_IMASK_OFS)
249#define XT2000_ISTAT_VADDR (XT2000_FPGAREGS_VADDR+XT2000_ISTAT_OFS)
250#define XT2000_V3CFG_VADDR (XT2000_FPGAREGS_VADDR+XT2000_V3CFG_OFS)
251/* Register access (for C code): */
252#define XT2000_DATECD_REG (*(volatile unsigned*) XT2000_DATECD_VADDR)
253#define XT2000_STSREG_REG (*(volatile unsigned*) XT2000_STSREG_VADDR)
254#define XT2000_SYSLED_REG (*(volatile unsigned*) XT2000_SYSLED_VADDR)
255#define XT2000_WRPROT_REG (*(volatile unsigned*) XT2000_WRPROT_VADDR)
256#define XT2000_SWRST_REG (*(volatile unsigned*) XT2000_SWRST_VADDR)
257#define XT2000_SYSRST_REG (*(volatile unsigned*) XT2000_SYSRST_VADDR)
258#define XT2000_IMASK_REG (*(volatile unsigned*) XT2000_IMASK_VADDR)
259#define XT2000_ISTAT_REG (*(volatile unsigned*) XT2000_ISTAT_VADDR)
260#define XT2000_V3CFG_REG (*(volatile unsigned*) XT2000_V3CFG_VADDR)
261#endif
262
263/* DATECD (date code) bit fields: */
264
265/* BCD-coded month (01..12): */
266#define XT2000_DATECD_MONTH_SHIFT 24
267#define XT2000_DATECD_MONTH_BITS 8
268#define XT2000_DATECD_MONTH_MASK 0xFF000000
269/* BCD-coded day (01..31): */
270#define XT2000_DATECD_DAY_SHIFT 16
271#define XT2000_DATECD_DAY_BITS 8
272#define XT2000_DATECD_DAY_MASK 0x00FF0000
273/* BCD-coded year (2001..9999): */
274#define XT2000_DATECD_YEAR_SHIFT 0
275#define XT2000_DATECD_YEAR_BITS 16
276#define XT2000_DATECD_YEAR_MASK 0x0000FFFF
277
278/* STSREG (status) bit fields: */
279
280/* Switch SW3 setting bit fields (0=off/up, 1=on/down): */
281#define XT2000_STSREG_SW3_SHIFT 0
282#define XT2000_STSREG_SW3_BITS 4
283#define XT2000_STSREG_SW3_MASK 0x0000000F
284/* Boot-select bits of switch SW3: */
285#define XT2000_STSREG_BOOTSEL_SHIFT 0
286#define XT2000_STSREG_BOOTSEL_BITS 2
287#define XT2000_STSREG_BOOTSEL_MASK 0x00000003
288/* Boot-select values: */
289#define XT2000_STSREG_BOOTSEL_FLASH 0
290#define XT2000_STSREG_BOOTSEL_EPROM16 1
291#define XT2000_STSREG_BOOTSEL_PROM8 2
292#define XT2000_STSREG_BOOTSEL_ASRAM 3
293/* User-defined bits of switch SW3: */
294#define XT2000_STSREG_SW3_2_SHIFT 2
295#define XT2000_STSREG_SW3_2_MASK 0x00000004
296#define XT2000_STSREG_SW3_3_SHIFT 3
297#define XT2000_STSREG_SW3_3_MASK 0x00000008
298
299/* SYSLED (system LED) bit fields: */
300
301/* LED control bit (0=off, 1=on): */
302#define XT2000_SYSLED_LEDON_SHIFT 0
303#define XT2000_SYSLED_LEDON_MASK 0x00000001
304
305/* WRPROT (write protect) bit fields (0=writable, 1=write-protected [default]): */
306
307/* Flash write protect: */
308#define XT2000_WRPROT_FLWP_SHIFT 0
309#define XT2000_WRPROT_FLWP_MASK 0x00000001
310/* Reserved but present write protect bits: */
311#define XT2000_WRPROT_WRP_SHIFT 1
312#define XT2000_WRPROT_WRP_BITS 7
313#define XT2000_WRPROT_WRP_MASK 0x000000FE
314
315/* SWRST (software reset; allows s/w to generate power-on equivalent reset): */
316
317/* Software reset bits: */
318#define XT2000_SWRST_SWR_SHIFT 0
319#define XT2000_SWRST_SWR_BITS 16
320#define XT2000_SWRST_SWR_MASK 0x0000FFFF
321/* Software reset value -- writing this value resets the board: */
322#define XT2000_SWRST_RESETVALUE 0x0000DEAD
323
324/* SYSRST (system reset; controls reset of individual peripherals): */
325
326/* All-device reset: */
327#define XT2000_SYSRST_ALL_SHIFT 0
328#define XT2000_SYSRST_ALL_BITS 4
329#define XT2000_SYSRST_ALL_MASK 0x0000000F
330/* HDSP-2534 LED display reset (1=reset, 0=nothing): */
331#define XT2000_SYSRST_LED_SHIFT 0
332#define XT2000_SYSRST_LED_MASK 0x00000001
333/* Sonic DP83934 Ethernet controller reset (1=reset, 0=nothing): */
334#define XT2000_SYSRST_SONIC_SHIFT 1
335#define XT2000_SYSRST_SONIC_MASK 0x00000002
336/* DP16552 DUART reset (1=reset, 0=nothing): */
337#define XT2000_SYSRST_DUART_SHIFT 2
338#define XT2000_SYSRST_DUART_MASK 0x00000004
339/* V3 V320 PCI bridge controller reset (1=reset, 0=nothing): */
340#define XT2000_SYSRST_V3_SHIFT 3
341#define XT2000_SYSRST_V3_MASK 0x00000008
342
343/* IMASK (interrupt mask; 0=disable, 1=enable): */
344/* ISTAT (interrupt status; 0=inactive, 1=pending): */
345
346/* PCI INTP interrupt: */
347#define XT2000_INTMUX_PCI_INTP_SHIFT 2
348#define XT2000_INTMUX_PCI_INTP_MASK 0x00000004
349/* PCI INTS interrupt: */
350#define XT2000_INTMUX_PCI_INTS_SHIFT 3
351#define XT2000_INTMUX_PCI_INTS_MASK 0x00000008
352/* PCI INTD interrupt: */
353#define XT2000_INTMUX_PCI_INTD_SHIFT 4
354#define XT2000_INTMUX_PCI_INTD_MASK 0x00000010
355/* V320 PCI controller interrupt: */
356#define XT2000_INTMUX_V3_SHIFT 5
357#define XT2000_INTMUX_V3_MASK 0x00000020
358/* PCI ENUM interrupt: */
359#define XT2000_INTMUX_PCI_ENUM_SHIFT 6
360#define XT2000_INTMUX_PCI_ENUM_MASK 0x00000040
361/* PCI DEG interrupt: */
362#define XT2000_INTMUX_PCI_DEG_SHIFT 7
363#define XT2000_INTMUX_PCI_DEG_MASK 0x00000080
364
365/* V3CFG (V3 config, V320 PCI controller): */
366
367/* V3 address control (0=pass-thru, 1=V3 address bits 31:28 set to 4'b0001 [default]): */
368#define XT2000_V3CFG_V3ADC_SHIFT 0
369#define XT2000_V3CFG_V3ADC_MASK 0x00000001
370
371/* I2C Devices */
372
373#define XT2000_I2C_RTC_ID 0x68
374#define XT2000_I2C_NVRAM0_ID 0x56 /* 1st 256 byte block */
375#define XT2000_I2C_NVRAM1_ID 0x57 /* 2nd 256 byte block */
376
377/* NVRAM Board Info structure: */
378
379#define XT2000_NVRAM_SIZE 512
380
381#define XT2000_NVRAM_BINFO_START 0x100
382#define XT2000_NVRAM_BINFO_SIZE 0x20
383#define XT2000_NVRAM_BINFO_VERSION 0x10 /* version 1.0 */
384#if 0
385#define XT2000_NVRAM_BINFO_VERSION_OFFSET 0x00
386#define XT2000_NVRAM_BINFO_VERSION_SIZE 0x1
387#define XT2000_NVRAM_BINFO_ETH_ADDR_OFFSET 0x02
388#define XT2000_NVRAM_BINFO_ETH_ADDR_SIZE 0x6
389#define XT2000_NVRAM_BINFO_SN_OFFSET 0x10
390#define XT2000_NVRAM_BINFO_SN_SIZE 0xE
391#define XT2000_NVRAM_BINFO_CRC_OFFSET 0x1E
392#define XT2000_NVRAM_BINFO_CRC_SIZE 0x2
393#endif /*0*/
394
395#if !defined(__ASSEMBLY__) && !defined(_NOCLANGUAGE)
396typedef struct xt2000_nvram_binfo {
397 unsigned char version;
398 unsigned char reserved1;
399 unsigned char eth_addr[6];
400 unsigned char reserved8[8];
401 unsigned char serialno[14];
402 unsigned char crc[2]; /* 16-bit CRC */
403} xt2000_nvram_binfo;
404#endif /*!__ASSEMBLY__ && !_NOCLANGUAGE*/
405
406
407#endif /*_INC_XT2000_H_*/
408
diff --git a/include/asm-xtensa/xtensa/xtboard.h b/include/asm-xtensa/xtensa/xtboard.h
deleted file mode 100644
index 22469c175307..000000000000
--- a/include/asm-xtensa/xtensa/xtboard.h
+++ /dev/null
@@ -1,120 +0,0 @@
1#ifndef _xtboard_h_included_
2#define _xtboard_h_included_
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * xtboard.h -- Routines for getting useful information from the board.
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive
11 * for more details.
12 *
13 * Copyright (C) 2002 Tensilica Inc.
14 */
15
16
17#include <xtensa/xt2000.h>
18
19#define XTBOARD_RTC_ERROR -1
20#define XTBOARD_RTC_STOPPED -2
21
22
23/* xt2000-i2cdev.c: */
24typedef void XtboardDelayFunc( unsigned );
25extern XtboardDelayFunc* xtboard_set_nsdelay_func( XtboardDelayFunc *delay_fn );
26extern int xtboard_i2c_read (unsigned id, unsigned char *buf, unsigned addr, unsigned size);
27extern int xtboard_i2c_write(unsigned id, unsigned char *buf, unsigned addr, unsigned size);
28extern int xtboard_i2c_wait_nvram_ack(unsigned id, unsigned swtimer);
29
30/* xtboard.c: */
31extern int xtboard_nvram_read (unsigned addr, unsigned len, unsigned char *buf);
32extern int xtboard_nvram_write(unsigned addr, unsigned len, unsigned char *buf);
33extern int xtboard_nvram_binfo_read (xt2000_nvram_binfo *buf);
34extern int xtboard_nvram_binfo_write(xt2000_nvram_binfo *buf);
35extern int xtboard_nvram_binfo_valid(xt2000_nvram_binfo *buf);
36extern int xtboard_ethermac_get(unsigned char *buf);
37extern int xtboard_ethermac_set(unsigned char *buf);
38
39/*+*----------------------------------------------------------------------------
40/ Function: xtboard_get_rtc_time
41/
42/ Description: Get time stored in real-time clock.
43/
44/ Returns: time in seconds stored in real-time clock.
45/-**----------------------------------------------------------------------------*/
46
47extern unsigned xtboard_get_rtc_time(void);
48
49/*+*----------------------------------------------------------------------------
50/ Function: xtboard_set_rtc_time
51/
52/ Description: Set time stored in real-time clock.
53/
54/ Parameters: time -- time in seconds to store to real-time clock
55/
56/ Returns: 0 on success, xtboard_i2c_write() error code otherwise.
57/-**----------------------------------------------------------------------------*/
58
59extern int xtboard_set_rtc_time(unsigned time);
60
61
62/* xtfreq.c: */
63/*+*----------------------------------------------------------------------------
64/ Function: xtboard_measure_sys_clk
65/
66/ Description: Get frequency of system clock.
67/
68/ Parameters: none
69/
70/ Returns: frequency of system clock.
71/-**----------------------------------------------------------------------------*/
72
73extern unsigned xtboard_measure_sys_clk(void);
74
75
76#if 0 /* old stuff from xtboard.c: */
77
78/*+*----------------------------------------------------------------------------
79/ Function: xtboard_nvram valid
80/
81/ Description: Determines if data in NVRAM is valid.
82/
83/ Parameters: delay -- 10us delay function
84/
85/ Returns: 1 if NVRAM is valid, 0 otherwise
86/-**----------------------------------------------------------------------------*/
87
88extern unsigned xtboard_nvram_valid(void (*delay)( void ));
89
90/*+*----------------------------------------------------------------------------
91/ Function: xtboard_get_nvram_contents
92/
93/ Description: Returns contents of NVRAM.
94/
95/ Parameters: buf -- buffer to NVRAM contents.
96/ delay -- 10us delay function
97/
98/ Returns: 1 if NVRAM is valid, 0 otherwise
99/-**----------------------------------------------------------------------------*/
100
101extern unsigned xtboard_get_nvram_contents(unsigned char *buf, void (*delay)( void ));
102
103/*+*----------------------------------------------------------------------------
104/ Function: xtboard_get_ether_addr
105/
106/ Description: Returns ethernet address of board.
107/
108/ Parameters: buf -- buffer to store ethernet address
109/ delay -- 10us delay function
110/
111/ Returns: nothing.
112/-**----------------------------------------------------------------------------*/
113
114extern void xtboard_get_ether_addr(unsigned char *buf, void (*delay)( void ));
115
116#endif /*0*/
117
118
119#endif /*_xtboard_h_included_*/
120
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 e618b25b5add..683513e310de 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
@@ -61,7 +62,6 @@ header-y += fd.h
61header-y += fdreg.h 62header-y += fdreg.h
62header-y += fib_rules.h 63header-y += fib_rules.h
63header-y += fuse.h 64header-y += fuse.h
64header-y += futex.h
65header-y += genetlink.h 65header-y += genetlink.h
66header-y += gen_stats.h 66header-y += gen_stats.h
67header-y += gigaset_dev.h 67header-y += gigaset_dev.h
@@ -70,7 +70,6 @@ header-y += hysdn_if.h
70header-y += i2c-dev.h 70header-y += i2c-dev.h
71header-y += i8k.h 71header-y += i8k.h
72header-y += icmp.h 72header-y += icmp.h
73header-y += if_addr.h
74header-y += if_arcnet.h 73header-y += if_arcnet.h
75header-y += if_arp.h 74header-y += if_arp.h
76header-y += if_bonding.h 75header-y += if_bonding.h
@@ -80,7 +79,6 @@ header-y += if_fddi.h
80header-y += if.h 79header-y += if.h
81header-y += if_hippi.h 80header-y += if_hippi.h
82header-y += if_infiniband.h 81header-y += if_infiniband.h
83header-y += if_link.h
84header-y += if_packet.h 82header-y += if_packet.h
85header-y += if_plip.h 83header-y += if_plip.h
86header-y += if_ppp.h 84header-y += if_ppp.h
@@ -120,7 +118,6 @@ header-y += nfs4_mount.h
120header-y += nfs_mount.h 118header-y += nfs_mount.h
121header-y += oom.h 119header-y += oom.h
122header-y += param.h 120header-y += param.h
123header-y += pci_ids.h
124header-y += pci_regs.h 121header-y += pci_regs.h
125header-y += personality.h 122header-y += personality.h
126header-y += pfkeyv2.h 123header-y += pfkeyv2.h
@@ -131,7 +128,6 @@ header-y += posix_types.h
131header-y += ppdev.h 128header-y += ppdev.h
132header-y += prctl.h 129header-y += prctl.h
133header-y += ps2esdi.h 130header-y += ps2esdi.h
134header-y += qic117.h
135header-y += qnxtypes.h 131header-y += qnxtypes.h
136header-y += quotaio_v1.h 132header-y += quotaio_v1.h
137header-y += quotaio_v2.h 133header-y += quotaio_v2.h
@@ -139,7 +135,6 @@ header-y += radeonfb.h
139header-y += raw.h 135header-y += raw.h
140header-y += resource.h 136header-y += resource.h
141header-y += rose.h 137header-y += rose.h
142header-y += sctp.h
143header-y += smbno.h 138header-y += smbno.h
144header-y += snmp.h 139header-y += snmp.h
145header-y += sockios.h 140header-y += sockios.h
@@ -163,7 +158,6 @@ header-y += vt.h
163header-y += wireless.h 158header-y += wireless.h
164header-y += xattr.h 159header-y += xattr.h
165header-y += x25.h 160header-y += x25.h
166header-y += zorro_ids.h
167 161
168unifdef-y += acct.h 162unifdef-y += acct.h
169unifdef-y += adb.h 163unifdef-y += adb.h
@@ -203,6 +197,7 @@ unifdef-y += fb.h
203unifdef-y += fcntl.h 197unifdef-y += fcntl.h
204unifdef-y += filter.h 198unifdef-y += filter.h
205unifdef-y += flat.h 199unifdef-y += flat.h
200unifdef-y += futex.h
206unifdef-y += fs.h 201unifdef-y += fs.h
207unifdef-y += gameport.h 202unifdef-y += gameport.h
208unifdef-y += generic_serial.h 203unifdef-y += generic_serial.h
@@ -217,6 +212,7 @@ unifdef-y += hpet.h
217unifdef-y += i2c.h 212unifdef-y += i2c.h
218unifdef-y += i2o-dev.h 213unifdef-y += i2o-dev.h
219unifdef-y += icmpv6.h 214unifdef-y += icmpv6.h
215unifdef-y += if_addr.h
220unifdef-y += if_bridge.h 216unifdef-y += if_bridge.h
221unifdef-y += if_ec.h 217unifdef-y += if_ec.h
222unifdef-y += if_eql.h 218unifdef-y += if_eql.h
@@ -224,6 +220,7 @@ unifdef-y += if_ether.h
224unifdef-y += if_fddi.h 220unifdef-y += if_fddi.h
225unifdef-y += if_frad.h 221unifdef-y += if_frad.h
226unifdef-y += if_ltalk.h 222unifdef-y += if_ltalk.h
223unifdef-y += if_link.h
227unifdef-y += if_pppox.h 224unifdef-y += if_pppox.h
228unifdef-y += if_shaper.h 225unifdef-y += if_shaper.h
229unifdef-y += if_tr.h 226unifdef-y += if_tr.h
@@ -330,7 +327,6 @@ unifdef-y += udp.h
330unifdef-y += uinput.h 327unifdef-y += uinput.h
331unifdef-y += uio.h 328unifdef-y += uio.h
332unifdef-y += unistd.h 329unifdef-y += unistd.h
333unifdef-y += usb_ch9.h
334unifdef-y += usbdevice_fs.h 330unifdef-y += usbdevice_fs.h
335unifdef-y += user.h 331unifdef-y += user.h
336unifdef-y += utsname.h 332unifdef-y += utsname.h
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 2b0c955590fe..815f1fb4ce21 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -47,171 +47,12 @@ enum acpi_irq_model_id {
47 ACPI_IRQ_MODEL_PIC = 0, 47 ACPI_IRQ_MODEL_PIC = 0,
48 ACPI_IRQ_MODEL_IOAPIC, 48 ACPI_IRQ_MODEL_IOAPIC,
49 ACPI_IRQ_MODEL_IOSAPIC, 49 ACPI_IRQ_MODEL_IOSAPIC,
50 ACPI_IRQ_MODEL_PLATFORM,
50 ACPI_IRQ_MODEL_COUNT 51 ACPI_IRQ_MODEL_COUNT
51}; 52};
52 53
53extern enum acpi_irq_model_id acpi_irq_model; 54extern enum acpi_irq_model_id acpi_irq_model;
54 55
55
56/* Root System Description Pointer (RSDP) */
57
58struct acpi_table_rsdp {
59 char signature[8];
60 u8 checksum;
61 char oem_id[6];
62 u8 revision;
63 u32 rsdt_address;
64} __attribute__ ((packed));
65
66struct acpi20_table_rsdp {
67 char signature[8];
68 u8 checksum;
69 char oem_id[6];
70 u8 revision;
71 u32 rsdt_address;
72 u32 length;
73 u64 xsdt_address;
74 u8 ext_checksum;
75 u8 reserved[3];
76} __attribute__ ((packed));
77
78typedef struct {
79 u8 type;
80 u8 length;
81} __attribute__ ((packed)) acpi_table_entry_header;
82
83/* Root System Description Table (RSDT) */
84
85struct acpi_table_rsdt {
86 struct acpi_table_header header;
87 u32 entry[8];
88} __attribute__ ((packed));
89
90/* Extended System Description Table (XSDT) */
91
92struct acpi_table_xsdt {
93 struct acpi_table_header header;
94 u64 entry[1];
95} __attribute__ ((packed));
96
97/* Fixed ACPI Description Table (FADT) */
98
99struct acpi_table_fadt {
100 struct acpi_table_header header;
101 u32 facs_addr;
102 u32 dsdt_addr;
103 /* ... */
104} __attribute__ ((packed));
105
106/* Multiple APIC Description Table (MADT) */
107
108struct acpi_table_madt {
109 struct acpi_table_header header;
110 u32 lapic_address;
111 struct {
112 u32 pcat_compat:1;
113 u32 reserved:31;
114 } flags;
115} __attribute__ ((packed));
116
117enum acpi_madt_entry_id {
118 ACPI_MADT_LAPIC = 0,
119 ACPI_MADT_IOAPIC,
120 ACPI_MADT_INT_SRC_OVR,
121 ACPI_MADT_NMI_SRC,
122 ACPI_MADT_LAPIC_NMI,
123 ACPI_MADT_LAPIC_ADDR_OVR,
124 ACPI_MADT_IOSAPIC,
125 ACPI_MADT_LSAPIC,
126 ACPI_MADT_PLAT_INT_SRC,
127 ACPI_MADT_ENTRY_COUNT
128};
129
130typedef struct {
131 u16 polarity:2;
132 u16 trigger:2;
133 u16 reserved:12;
134} __attribute__ ((packed)) acpi_interrupt_flags;
135
136struct acpi_table_lapic {
137 acpi_table_entry_header header;
138 u8 acpi_id;
139 u8 id;
140 struct {
141 u32 enabled:1;
142 u32 reserved:31;
143 } flags;
144} __attribute__ ((packed));
145
146struct acpi_table_ioapic {
147 acpi_table_entry_header header;
148 u8 id;
149 u8 reserved;
150 u32 address;
151 u32 global_irq_base;
152} __attribute__ ((packed));
153
154struct acpi_table_int_src_ovr {
155 acpi_table_entry_header header;
156 u8 bus;
157 u8 bus_irq;
158 u32 global_irq;
159 acpi_interrupt_flags flags;
160} __attribute__ ((packed));
161
162struct acpi_table_nmi_src {
163 acpi_table_entry_header header;
164 acpi_interrupt_flags flags;
165 u32 global_irq;
166} __attribute__ ((packed));
167
168struct acpi_table_lapic_nmi {
169 acpi_table_entry_header header;
170 u8 acpi_id;
171 acpi_interrupt_flags flags;
172 u8 lint;
173} __attribute__ ((packed));
174
175struct acpi_table_lapic_addr_ovr {
176 acpi_table_entry_header header;
177 u8 reserved[2];
178 u64 address;
179} __attribute__ ((packed));
180
181struct acpi_table_iosapic {
182 acpi_table_entry_header header;
183 u8 id;
184 u8 reserved;
185 u32 global_irq_base;
186 u64 address;
187} __attribute__ ((packed));
188
189struct acpi_table_lsapic {
190 acpi_table_entry_header header;
191 u8 acpi_id;
192 u8 id;
193 u8 eid;
194 u8 reserved[3];
195 struct {
196 u32 enabled:1;
197 u32 reserved:31;
198 } flags;
199} __attribute__ ((packed));
200
201struct acpi_table_plat_int_src {
202 acpi_table_entry_header header;
203 acpi_interrupt_flags flags;
204 u8 type; /* See acpi_interrupt_type */
205 u8 id;
206 u8 eid;
207 u8 iosapic_vector;
208 u32 global_irq;
209 struct {
210 u32 cpei_override_flag:1;
211 u32 reserved:31;
212 } plint_flags;
213} __attribute__ ((packed));
214
215enum acpi_interrupt_id { 56enum acpi_interrupt_id {
216 ACPI_INTERRUPT_PMI = 1, 57 ACPI_INTERRUPT_PMI = 1,
217 ACPI_INTERRUPT_INIT, 58 ACPI_INTERRUPT_INIT,
@@ -221,89 +62,6 @@ enum acpi_interrupt_id {
221 62
222#define ACPI_SPACE_MEM 0 63#define ACPI_SPACE_MEM 0
223 64
224struct acpi_gen_regaddr {
225 u8 space_id;
226 u8 bit_width;
227 u8 bit_offset;
228 u8 resv;
229 u32 addrl;
230 u32 addrh;
231} __attribute__ ((packed));
232
233struct acpi_table_hpet {
234 struct acpi_table_header header;
235 u32 id;
236 struct acpi_gen_regaddr addr;
237 u8 number;
238 u16 min_tick;
239 u8 page_protect;
240} __attribute__ ((packed));
241
242/*
243 * Simple Boot Flags
244 * http://www.microsoft.com/whdc/hwdev/resources/specs/simp_bios.mspx
245 */
246struct acpi_table_sbf
247{
248 u8 sbf_signature[4];
249 u32 sbf_len;
250 u8 sbf_revision;
251 u8 sbf_csum;
252 u8 sbf_oemid[6];
253 u8 sbf_oemtable[8];
254 u8 sbf_revdata[4];
255 u8 sbf_creator[4];
256 u8 sbf_crearev[4];
257 u8 sbf_cmos;
258 u8 sbf_spare[3];
259} __attribute__ ((packed));
260
261/*
262 * System Resource Affinity Table (SRAT)
263 * http://www.microsoft.com/whdc/hwdev/platform/proc/SRAT.mspx
264 */
265
266struct acpi_table_srat {
267 struct acpi_table_header header;
268 u32 table_revision;
269 u64 reserved;
270} __attribute__ ((packed));
271
272enum acpi_srat_entry_id {
273 ACPI_SRAT_PROCESSOR_AFFINITY = 0,
274 ACPI_SRAT_MEMORY_AFFINITY,
275 ACPI_SRAT_ENTRY_COUNT
276};
277
278struct acpi_table_processor_affinity {
279 acpi_table_entry_header header;
280 u8 proximity_domain;
281 u8 apic_id;
282 struct {
283 u32 enabled:1;
284 u32 reserved:31;
285 } flags;
286 u8 lsapic_eid;
287 u8 reserved[7];
288} __attribute__ ((packed));
289
290struct acpi_table_memory_affinity {
291 acpi_table_entry_header header;
292 u8 proximity_domain;
293 u8 reserved1[5];
294 u32 base_addr_lo;
295 u32 base_addr_hi;
296 u32 length_lo;
297 u32 length_hi;
298 u32 memory_type; /* See acpi_address_range_id */
299 struct {
300 u32 enabled:1;
301 u32 hot_pluggable:1;
302 u32 reserved:30;
303 } flags;
304 u64 reserved2;
305} __attribute__ ((packed));
306
307enum acpi_address_range_id { 65enum acpi_address_range_id {
308 ACPI_ADDRESS_RANGE_MEMORY = 1, 66 ACPI_ADDRESS_RANGE_MEMORY = 1,
309 ACPI_ADDRESS_RANGE_RESERVED = 2, 67 ACPI_ADDRESS_RANGE_RESERVED = 2,
@@ -312,84 +70,12 @@ enum acpi_address_range_id {
312 ACPI_ADDRESS_RANGE_COUNT 70 ACPI_ADDRESS_RANGE_COUNT
313}; 71};
314 72
315/*
316 * System Locality Information Table (SLIT)
317 * see http://devresource.hp.com/devresource/docs/techpapers/ia64/slit.pdf
318 */
319
320struct acpi_table_slit {
321 struct acpi_table_header header;
322 u64 localities;
323 u8 entry[1]; /* real size = localities^2 */
324} __attribute__ ((packed));
325
326/* Smart Battery Description Table (SBST) */
327
328struct acpi_table_sbst {
329 struct acpi_table_header header;
330 u32 warning; /* Warn user */
331 u32 low; /* Critical sleep */
332 u32 critical; /* Critical shutdown */
333} __attribute__ ((packed));
334
335/* Embedded Controller Boot Resources Table (ECDT) */
336
337struct acpi_table_ecdt {
338 struct acpi_table_header header;
339 struct acpi_generic_address ec_control;
340 struct acpi_generic_address ec_data;
341 u32 uid;
342 u8 gpe_bit;
343 char ec_id[0];
344} __attribute__ ((packed));
345
346/* PCI MMCONFIG */
347
348/* Defined in PCI Firmware Specification 3.0 */
349struct acpi_table_mcfg_config {
350 u32 base_address;
351 u32 base_reserved;
352 u16 pci_segment_group_number;
353 u8 start_bus_number;
354 u8 end_bus_number;
355 u8 reserved[4];
356} __attribute__ ((packed));
357struct acpi_table_mcfg {
358 struct acpi_table_header header;
359 u8 reserved[8];
360 struct acpi_table_mcfg_config config[0];
361} __attribute__ ((packed));
362 73
363/* Table Handlers */ 74/* Table Handlers */
364 75
365enum acpi_table_id { 76typedef int (*acpi_table_handler) (struct acpi_table_header *table);
366 ACPI_TABLE_UNKNOWN = 0,
367 ACPI_APIC,
368 ACPI_BOOT,
369 ACPI_DBGP,
370 ACPI_DSDT,
371 ACPI_ECDT,
372 ACPI_ETDT,
373 ACPI_FADT,
374 ACPI_FACS,
375 ACPI_OEMX,
376 ACPI_PSDT,
377 ACPI_SBST,
378 ACPI_SLIT,
379 ACPI_SPCR,
380 ACPI_SRAT,
381 ACPI_SSDT,
382 ACPI_SPMI,
383 ACPI_HPET,
384 ACPI_MCFG,
385 ACPI_TABLE_COUNT
386};
387
388typedef int (*acpi_table_handler) (unsigned long phys_addr, unsigned long size);
389
390extern acpi_table_handler acpi_table_ops[ACPI_TABLE_COUNT];
391 77
392typedef 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);
393 79
394char * __acpi_map_table (unsigned long phys_addr, unsigned long size); 80char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
395unsigned long acpi_find_rsdp (void); 81unsigned long acpi_find_rsdp (void);
@@ -398,14 +84,12 @@ int acpi_boot_table_init (void);
398int acpi_numa_init (void); 84int acpi_numa_init (void);
399 85
400int acpi_table_init (void); 86int acpi_table_init (void);
401int acpi_table_parse (enum acpi_table_id id, acpi_table_handler handler); 87int acpi_table_parse (char *id, acpi_table_handler handler);
402int 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);
403int 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);
404int 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);
405int acpi_parse_mcfg (unsigned long phys_addr, unsigned long size); 91void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
406void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr); 92void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
407void acpi_table_print_madt_entry (acpi_table_entry_header *madt);
408void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
409 93
410/* the following four functions are architecture-dependent */ 94/* the following four functions are architecture-dependent */
411#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT 95#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
@@ -416,8 +100,8 @@ void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
416#define acpi_numa_arch_fixup() do {} while (0) 100#define acpi_numa_arch_fixup() do {} while (0)
417#else 101#else
418void acpi_numa_slit_init (struct acpi_table_slit *slit); 102void acpi_numa_slit_init (struct acpi_table_slit *slit);
419void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa); 103void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
420void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma); 104void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
421void acpi_numa_arch_fixup(void); 105void acpi_numa_arch_fixup(void);
422#endif 106#endif
423 107
@@ -432,7 +116,7 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
432 116
433extern int acpi_mp_config; 117extern int acpi_mp_config;
434 118
435extern struct acpi_table_mcfg_config *pci_mmcfg_config; 119extern struct acpi_mcfg_allocation *pci_mmcfg_config;
436extern int pci_mmcfg_config_num; 120extern int pci_mmcfg_config_num;
437 121
438extern int sbf_port; 122extern int sbf_port;
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 3372ec6bf53a..a30ef13c9e62 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -105,6 +105,7 @@ struct kiocb {
105 wait_queue_t ki_wait; 105 wait_queue_t ki_wait;
106 loff_t ki_pos; 106 loff_t ki_pos;
107 107
108 atomic_t ki_bio_count; /* num bio used for this iocb */
108 void *private; 109 void *private;
109 /* State that we remember to be able to restart/retry */ 110 /* State that we remember to be able to restart/retry */
110 unsigned short ki_opcode; 111 unsigned short ki_opcode;
diff --git a/include/asm-mips/apm.h b/include/linux/apm-emulation.h
index 4b99ffc11529..e6d800358dd6 100644
--- a/include/asm-mips/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 MIPS_ASM_SA1100_APM_H 11#ifndef __LINUX_APM_EMULATION_H
14#define MIPS_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/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/backlight.h b/include/linux/backlight.h
index 75e91f5b6a04..a5cf1beacb44 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -54,7 +54,7 @@ struct backlight_device {
54}; 54};
55 55
56extern struct backlight_device *backlight_device_register(const char *name, 56extern struct backlight_device *backlight_device_register(const char *name,
57 void *devdata, struct backlight_properties *bp); 57 struct device *dev,void *devdata,struct backlight_properties *bp);
58extern void backlight_device_unregister(struct backlight_device *bd); 58extern void backlight_device_unregister(struct backlight_device *bd);
59 59
60#define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev) 60#define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 092dbd0e7658..08daf3272c02 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -309,6 +309,7 @@ extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
309 gfp_t); 309 gfp_t);
310extern void bio_set_pages_dirty(struct bio *bio); 310extern void bio_set_pages_dirty(struct bio *bio);
311extern void bio_check_pages_dirty(struct bio *bio); 311extern void bio_check_pages_dirty(struct bio *bio);
312extern void bio_release_pages(struct bio *bio);
312extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); 313extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
313extern int bio_uncopy_user(struct bio *); 314extern int bio_uncopy_user(struct bio *);
314void zero_fill_bio(struct bio *bio); 315void zero_fill_bio(struct bio *bio);
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 5d1eabcde5d5..638165f571da 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -31,9 +31,8 @@ static inline unsigned long hweight_long(unsigned long w)
31 return sizeof(w) == 4 ? hweight32(w) : hweight64(w); 31 return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
32} 32}
33 33
34/* 34/**
35 * rol32 - rotate a 32-bit value left 35 * rol32 - rotate a 32-bit value left
36 *
37 * @word: value to rotate 36 * @word: value to rotate
38 * @shift: bits to roll 37 * @shift: bits to roll
39 */ 38 */
@@ -42,9 +41,8 @@ static inline __u32 rol32(__u32 word, unsigned int shift)
42 return (word << shift) | (word >> (32 - shift)); 41 return (word << shift) | (word >> (32 - shift));
43} 42}
44 43
45/* 44/**
46 * ror32 - rotate a 32-bit value right 45 * ror32 - rotate a 32-bit value right
47 *
48 * @word: value to rotate 46 * @word: value to rotate
49 * @shift: bits to roll 47 * @shift: bits to roll
50 */ 48 */
diff --git a/include/linux/bitrev.h b/include/linux/bitrev.h
new file mode 100644
index 000000000000..05e540d6963a
--- /dev/null
+++ b/include/linux/bitrev.h
@@ -0,0 +1,15 @@
1#ifndef _LINUX_BITREV_H
2#define _LINUX_BITREV_H
3
4#include <linux/types.h>
5
6extern u8 const byte_rev_table[256];
7
8static inline u8 bitrev8(u8 byte)
9{
10 return byte_rev_table[byte];
11}
12
13extern u32 bitrev32(u32 in);
14
15#endif /* _LINUX_BITREV_H */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index e1c7286165ff..36a6eacefe20 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -331,10 +331,6 @@ struct request_pm_state
331 331
332#include <linux/elevator.h> 332#include <linux/elevator.h>
333 333
334typedef int (merge_request_fn) (request_queue_t *, struct request *,
335 struct bio *);
336typedef int (merge_requests_fn) (request_queue_t *, struct request *,
337 struct request *);
338typedef void (request_fn_proc) (request_queue_t *q); 334typedef void (request_fn_proc) (request_queue_t *q);
339typedef int (make_request_fn) (request_queue_t *q, struct bio *bio); 335typedef int (make_request_fn) (request_queue_t *q, struct bio *bio);
340typedef int (prep_rq_fn) (request_queue_t *, struct request *); 336typedef int (prep_rq_fn) (request_queue_t *, struct request *);
@@ -342,7 +338,6 @@ typedef void (unplug_fn) (request_queue_t *);
342 338
343struct bio_vec; 339struct bio_vec;
344typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *); 340typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *);
345typedef void (activity_fn) (void *data, int rw);
346typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *); 341typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *);
347typedef void (prepare_flush_fn) (request_queue_t *, struct request *); 342typedef void (prepare_flush_fn) (request_queue_t *, struct request *);
348typedef void (softirq_done_fn)(struct request *); 343typedef void (softirq_done_fn)(struct request *);
@@ -377,14 +372,10 @@ struct request_queue
377 struct request_list rq; 372 struct request_list rq;
378 373
379 request_fn_proc *request_fn; 374 request_fn_proc *request_fn;
380 merge_request_fn *back_merge_fn;
381 merge_request_fn *front_merge_fn;
382 merge_requests_fn *merge_requests_fn;
383 make_request_fn *make_request_fn; 375 make_request_fn *make_request_fn;
384 prep_rq_fn *prep_rq_fn; 376 prep_rq_fn *prep_rq_fn;
385 unplug_fn *unplug_fn; 377 unplug_fn *unplug_fn;
386 merge_bvec_fn *merge_bvec_fn; 378 merge_bvec_fn *merge_bvec_fn;
387 activity_fn *activity_fn;
388 issue_flush_fn *issue_flush_fn; 379 issue_flush_fn *issue_flush_fn;
389 prepare_flush_fn *prepare_flush_fn; 380 prepare_flush_fn *prepare_flush_fn;
390 softirq_done_fn *softirq_done_fn; 381 softirq_done_fn *softirq_done_fn;
@@ -411,8 +402,6 @@ struct request_queue
411 */ 402 */
412 void *queuedata; 403 void *queuedata;
413 404
414 void *activity_data;
415
416 /* 405 /*
417 * queue needs bounce pages for pages above this limit 406 * queue needs bounce pages for pages above this limit
418 */ 407 */
@@ -653,6 +642,11 @@ extern int sg_scsi_ioctl(struct file *, struct request_queue *,
653 struct gendisk *, struct scsi_ioctl_command __user *); 642 struct gendisk *, struct scsi_ioctl_command __user *);
654 643
655/* 644/*
645 * Temporary export, until SCSI gets fixed up.
646 */
647extern int ll_back_merge_fn(request_queue_t *, struct request *, struct bio *);
648
649/*
656 * A queue has just exitted congestion. Note this in the global counter of 650 * A queue has just exitted congestion. Note this in the global counter of
657 * congested queues, and wake up anyone who was waiting for requests to be 651 * congested queues, and wake up anyone who was waiting for requests to be
658 * put back. 652 * put back.
@@ -677,9 +671,8 @@ extern void blk_sync_queue(struct request_queue *q);
677extern void __blk_stop_queue(request_queue_t *q); 671extern void __blk_stop_queue(request_queue_t *q);
678extern void blk_run_queue(request_queue_t *); 672extern void blk_run_queue(request_queue_t *);
679extern void blk_start_queueing(request_queue_t *); 673extern void blk_start_queueing(request_queue_t *);
680extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
681extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long); 674extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long);
682extern int blk_rq_unmap_user(struct request *); 675extern int blk_rq_unmap_user(struct bio *);
683extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); 676extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t);
684extern int blk_rq_map_user_iov(request_queue_t *, struct request *, 677extern int blk_rq_map_user_iov(request_queue_t *, struct request *,
685 struct sg_iovec *, int, unsigned int); 678 struct sg_iovec *, int, unsigned int);
diff --git a/include/linux/bug.h b/include/linux/bug.h
new file mode 100644
index 000000000000..42aa0a54b6f4
--- /dev/null
+++ b/include/linux/bug.h
@@ -0,0 +1,47 @@
1#ifndef _LINUX_BUG_H
2#define _LINUX_BUG_H
3
4#include <linux/module.h>
5#include <asm/bug.h>
6
7enum bug_trap_type {
8 BUG_TRAP_TYPE_NONE = 0,
9 BUG_TRAP_TYPE_WARN = 1,
10 BUG_TRAP_TYPE_BUG = 2,
11};
12
13#ifdef CONFIG_GENERIC_BUG
14#include <asm-generic/bug.h>
15
16static inline int is_warning_bug(const struct bug_entry *bug)
17{
18 return bug->flags & BUGFLAG_WARNING;
19}
20
21const struct bug_entry *find_bug(unsigned long bugaddr);
22
23enum bug_trap_type report_bug(unsigned long bug_addr);
24
25int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
26 struct module *);
27void module_bug_cleanup(struct module *);
28
29/* These are defined by the architecture */
30int is_valid_bugaddr(unsigned long addr);
31
32#else /* !CONFIG_GENERIC_BUG */
33
34static inline enum bug_trap_type report_bug(unsigned long bug_addr)
35{
36 return BUG_TRAP_TYPE_BUG;
37}
38static inline int module_bug_finalize(const Elf_Ehdr *hdr,
39 const Elf_Shdr *sechdrs,
40 struct module *mod)
41{
42 return 0;
43}
44static inline void module_bug_cleanup(struct module *mod) {}
45
46#endif /* CONFIG_GENERIC_BUG */
47#endif /* _LINUX_BUG_H */
diff --git a/include/linux/cdev.h b/include/linux/cdev.h
index f309b00e986e..1e29b13d0062 100644
--- a/include/linux/cdev.h
+++ b/include/linux/cdev.h
@@ -6,6 +6,10 @@
6#include <linux/kdev_t.h> 6#include <linux/kdev_t.h>
7#include <linux/list.h> 7#include <linux/list.h>
8 8
9struct file_operations;
10struct inode;
11struct module;
12
9struct cdev { 13struct cdev {
10 struct kobject kobj; 14 struct kobject kobj;
11 struct module *owner; 15 struct module *owner;
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index d852024ed095..1622d23a8dc3 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -159,7 +159,7 @@ static inline s64 cyc2ns(struct clocksource *cs, cycle_t cycles)
159 * Unless you're the timekeeping code, you should not be using this! 159 * Unless you're the timekeeping code, you should not be using this!
160 */ 160 */
161static inline void clocksource_calculate_interval(struct clocksource *c, 161static inline void clocksource_calculate_interval(struct clocksource *c,
162 unsigned long length_nsec) 162 unsigned long length_nsec)
163{ 163{
164 u64 tmp; 164 u64 tmp;
165 165
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index be512cc98791..4c2632a8d31b 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -64,7 +64,7 @@ void coda_sysctl_clean(void);
64 64
65#define CODA_ALLOC(ptr, cast, size) do { \ 65#define CODA_ALLOC(ptr, cast, size) do { \
66 if (size < PAGE_SIZE) \ 66 if (size < PAGE_SIZE) \
67 ptr = (cast)kmalloc((unsigned long) size, GFP_KERNEL); \ 67 ptr = kmalloc((unsigned long) size, GFP_KERNEL); \
68 else \ 68 else \
69 ptr = (cast)vmalloc((unsigned long) size); \ 69 ptr = (cast)vmalloc((unsigned long) size); \
70 if (!ptr) \ 70 if (!ptr) \
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 538423d4a865..aca66984aafd 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -40,7 +40,7 @@ extern void __chk_io_ptr(void __iomem *);
40#error no compiler-gcc.h file for this gcc version 40#error no compiler-gcc.h file for this gcc version
41#elif __GNUC__ == 4 41#elif __GNUC__ == 4
42# include <linux/compiler-gcc4.h> 42# include <linux/compiler-gcc4.h>
43#elif __GNUC__ == 3 43#elif __GNUC__ == 3 && __GNUC_MINOR__ >= 2
44# include <linux/compiler-gcc3.h> 44# include <linux/compiler-gcc3.h>
45#else 45#else
46# error Sorry, your compiler is too old/not recognized. 46# error Sorry, your compiler is too old/not recognized.
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index a7f015027535..fef6f3d0a4a7 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -160,31 +160,6 @@ struct configfs_group_operations {
160 void (*drop_item)(struct config_group *group, struct config_item *item); 160 void (*drop_item)(struct config_group *group, struct config_item *item);
161}; 161};
162 162
163
164
165/**
166 * Use these macros to make defining attributes easier. See include/linux/device.h
167 * for examples..
168 */
169
170#if 0
171#define __ATTR(_name,_mode,_show,_store) { \
172 .attr = {.ca_name = __stringify(_name), .ca_mode = _mode, .ca_owner = THIS_MODULE }, \
173 .show = _show, \
174 .store = _store, \
175}
176
177#define __ATTR_RO(_name) { \
178 .attr = { .ca_name = __stringify(_name), .ca_mode = 0444, .ca_owner = THIS_MODULE }, \
179 .show = _name##_show, \
180}
181
182#define __ATTR_NULL { .attr = { .name = NULL } }
183
184#define attr_name(_attr) (_attr).attr.name
185#endif
186
187
188struct configfs_subsystem { 163struct configfs_subsystem {
189 struct config_group su_group; 164 struct config_group su_group;
190 struct semaphore su_sem; 165 struct semaphore su_sem;
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 3ea1cd58de97..10eb56b2940a 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -133,7 +133,7 @@ struct cn_callback_data {
133struct cn_callback_entry { 133struct cn_callback_entry {
134 struct list_head callback_entry; 134 struct list_head callback_entry;
135 struct cn_callback *cb; 135 struct cn_callback *cb;
136 struct delayed_work work; 136 struct work_struct work;
137 struct cn_queue_dev *pdev; 137 struct cn_queue_dev *pdev;
138 138
139 struct cn_callback_id id; 139 struct cn_callback_id id;
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 4ea39fee99c7..7f008f6bfdc3 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -172,6 +172,8 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
172 unsigned int relation); 172 unsigned int relation);
173 173
174 174
175extern int cpufreq_driver_getavg(struct cpufreq_policy *policy);
176
175int cpufreq_register_governor(struct cpufreq_governor *governor); 177int cpufreq_register_governor(struct cpufreq_governor *governor);
176void cpufreq_unregister_governor(struct cpufreq_governor *governor); 178void cpufreq_unregister_governor(struct cpufreq_governor *governor);
177 179
@@ -204,6 +206,7 @@ struct cpufreq_driver {
204 unsigned int (*get) (unsigned int cpu); 206 unsigned int (*get) (unsigned int cpu);
205 207
206 /* optional */ 208 /* optional */
209 unsigned int (*getavg) (unsigned int cpu);
207 int (*exit) (struct cpufreq_policy *policy); 210 int (*exit) (struct cpufreq_policy *policy);
208 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); 211 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg);
209 int (*resume) (struct cpufreq_policy *policy); 212 int (*resume) (struct cpufreq_policy *policy);
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 8821e1f75b44..fd404416f31c 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -30,10 +30,19 @@ void cpuset_update_task_memory_state(void);
30 nodes_subset((nodes), current->mems_allowed) 30 nodes_subset((nodes), current->mems_allowed)
31int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); 31int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl);
32 32
33extern int __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask); 33extern int __cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask);
34static int inline cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) 34extern int __cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask);
35
36static int inline cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask)
37{
38 return number_of_cpusets <= 1 ||
39 __cpuset_zone_allowed_softwall(z, gfp_mask);
40}
41
42static int inline cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask)
35{ 43{
36 return number_of_cpusets <= 1 || __cpuset_zone_allowed(z, gfp_mask); 44 return number_of_cpusets <= 1 ||
45 __cpuset_zone_allowed_hardwall(z, gfp_mask);
37} 46}
38 47
39extern int cpuset_excl_nodes_overlap(const struct task_struct *p); 48extern int cpuset_excl_nodes_overlap(const struct task_struct *p);
@@ -46,7 +55,7 @@ extern int cpuset_excl_nodes_overlap(const struct task_struct *p);
46extern int cpuset_memory_pressure_enabled; 55extern int cpuset_memory_pressure_enabled;
47extern void __cpuset_memory_pressure_bump(void); 56extern void __cpuset_memory_pressure_bump(void);
48 57
49extern const struct file_operations proc_cpuset_operations; 58extern struct file_operations proc_cpuset_operations;
50extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); 59extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer);
51 60
52extern void cpuset_lock(void); 61extern void cpuset_lock(void);
@@ -94,7 +103,12 @@ static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl)
94 return 1; 103 return 1;
95} 104}
96 105
97static inline int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) 106static inline int cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask)
107{
108 return 1;
109}
110
111static inline int cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask)
98{ 112{
99 return 1; 113 return 1;
100} 114}
diff --git a/include/linux/crc32.h b/include/linux/crc32.h
index 56c0645789a9..e20dd1f9b40a 100644
--- a/include/linux/crc32.h
+++ b/include/linux/crc32.h
@@ -6,10 +6,10 @@
6#define _LINUX_CRC32_H 6#define _LINUX_CRC32_H
7 7
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/bitrev.h>
9 10
10extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len); 11extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len);
11extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); 12extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len);
12extern u32 bitreverse(u32 in);
13 13
14#define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length) 14#define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length)
15 15
@@ -21,7 +21,7 @@ extern u32 bitreverse(u32 in);
21 * is in bit nr 0], thus it must be reversed before use. Except for 21 * is in bit nr 0], thus it must be reversed before use. Except for
22 * nics that bit swap the result internally... 22 * nics that bit swap the result internally...
23 */ 23 */
24#define ether_crc(length, data) bitreverse(crc32_le(~0, data, length)) 24#define ether_crc(length, data) bitrev32(crc32_le(~0, data, length))
25#define ether_crc_le(length, data) crc32_le(~0, data, length) 25#define ether_crc_le(length, data) crc32_le(~0, data, length)
26 26
27#endif /* _LINUX_CRC32_H */ 27#endif /* _LINUX_CRC32_H */
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/dccp.h b/include/linux/dccp.h
index ed6cc8962d87..1cb054bd93f2 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -176,20 +176,20 @@ enum {
176}; 176};
177 177
178/* DCCP features (RFC 4340 section 6.4) */ 178/* DCCP features (RFC 4340 section 6.4) */
179 enum { 179enum {
180 DCCPF_RESERVED = 0, 180 DCCPF_RESERVED = 0,
181 DCCPF_CCID = 1, 181 DCCPF_CCID = 1,
182 DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */ 182 DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */
183 DCCPF_SEQUENCE_WINDOW = 3, 183 DCCPF_SEQUENCE_WINDOW = 3,
184 DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */ 184 DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */
185 DCCPF_ACK_RATIO = 5, 185 DCCPF_ACK_RATIO = 5,
186 DCCPF_SEND_ACK_VECTOR = 6, 186 DCCPF_SEND_ACK_VECTOR = 6,
187 DCCPF_SEND_NDP_COUNT = 7, 187 DCCPF_SEND_NDP_COUNT = 7,
188 DCCPF_MIN_CSUM_COVER = 8, 188 DCCPF_MIN_CSUM_COVER = 8,
189 DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */ 189 DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */
190 /* 10-127 reserved */ 190 /* 10-127 reserved */
191 DCCPF_MIN_CCID_SPECIFIC = 128, 191 DCCPF_MIN_CCID_SPECIFIC = 128,
192 DCCPF_MAX_CCID_SPECIFIC = 255, 192 DCCPF_MAX_CCID_SPECIFIC = 255,
193}; 193};
194 194
195/* this structure is argument to DCCP_SOCKOPT_CHANGE_X */ 195/* this structure is argument to DCCP_SOCKOPT_CHANGE_X */
@@ -427,7 +427,7 @@ struct dccp_service_list {
427}; 427};
428 428
429#define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) 429#define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1)
430#define DCCP_SERVICE_CODE_IS_ABSENT 0 430#define DCCP_SERVICE_CODE_IS_ABSENT 0
431 431
432static inline int dccp_list_has_service(const struct dccp_service_list *sl, 432static inline int dccp_list_has_service(const struct dccp_service_list *sl,
433 const __be32 service) 433 const __be32 service)
@@ -436,7 +436,7 @@ static inline int dccp_list_has_service(const struct dccp_service_list *sl,
436 u32 i = sl->dccpsl_nr; 436 u32 i = sl->dccpsl_nr;
437 while (i--) 437 while (i--)
438 if (sl->dccpsl_list[i] == service) 438 if (sl->dccpsl_list[i] == service)
439 return 1; 439 return 1;
440 } 440 }
441 return 0; 441 return 0;
442} 442}
@@ -511,7 +511,7 @@ struct dccp_sock {
511 __u8 dccps_hc_tx_insert_options:1; 511 __u8 dccps_hc_tx_insert_options:1;
512 struct timer_list dccps_xmit_timer; 512 struct timer_list dccps_xmit_timer;
513}; 513};
514 514
515static inline struct dccp_sock *dccp_sk(const struct sock *sk) 515static inline struct dccp_sock *dccp_sk(const struct sock *sk)
516{ 516{
517 return (struct dccp_sock *)sk; 517 return (struct dccp_sock *)sk;
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
index a1c10b0c4cf0..1678a5de7013 100644
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -24,7 +24,7 @@ extern int debug_locks_off(void);
24 int __ret = 0; \ 24 int __ret = 0; \
25 \ 25 \
26 if (unlikely(c)) { \ 26 if (unlikely(c)) { \
27 if (debug_locks_silent || debug_locks_off()) \ 27 if (debug_locks_off() && !debug_locks_silent) \
28 WARN_ON(1); \ 28 WARN_ON(1); \
29 __ret = 1; \ 29 __ret = 1; \
30 } \ 30 } \
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 03ef41c1eaac..499f5373e213 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -39,7 +39,8 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti);
39 * The map function must return: 39 * The map function must return:
40 * < 0: error 40 * < 0: error
41 * = 0: The target will handle the io by resubmitting it later 41 * = 0: The target will handle the io by resubmitting it later
42 * > 0: simple remap complete 42 * = 1: simple remap complete
43 * = 2: The target wants to push back the io
43 */ 44 */
44typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, 45typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio,
45 union map_info *map_context); 46 union map_info *map_context);
@@ -50,6 +51,7 @@ typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio,
50 * 0 : ended successfully 51 * 0 : ended successfully
51 * 1 : for some reason the io has still not completed (eg, 52 * 1 : for some reason the io has still not completed (eg,
52 * multipath target might want to requeue a failed io). 53 * multipath target might want to requeue a failed io).
54 * 2 : The target wants to push back the io
53 */ 55 */
54typedef int (*dm_endio_fn) (struct dm_target *ti, 56typedef int (*dm_endio_fn) (struct dm_target *ti,
55 struct bio *bio, int error, 57 struct bio *bio, int error,
@@ -173,7 +175,7 @@ void *dm_get_mdptr(struct mapped_device *md);
173/* 175/*
174 * A device can still be used while suspended, but I/O is deferred. 176 * A device can still be used while suspended, but I/O is deferred.
175 */ 177 */
176int dm_suspend(struct mapped_device *md, int with_lockfs); 178int dm_suspend(struct mapped_device *md, unsigned suspend_flags);
177int dm_resume(struct mapped_device *md); 179int dm_resume(struct mapped_device *md);
178 180
179/* 181/*
@@ -188,6 +190,7 @@ int dm_wait_event(struct mapped_device *md, int event_nr);
188const char *dm_device_name(struct mapped_device *md); 190const char *dm_device_name(struct mapped_device *md);
189struct gendisk *dm_disk(struct mapped_device *md); 191struct gendisk *dm_disk(struct mapped_device *md);
190int dm_suspended(struct mapped_device *md); 192int dm_suspended(struct mapped_device *md);
193int dm_noflush_suspending(struct dm_target *ti);
191 194
192/* 195/*
193 * Geometry functions. 196 * Geometry functions.
diff --git a/include/linux/device.h b/include/linux/device.h
index 49ab53ce92dc..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};
@@ -433,6 +481,8 @@ static inline int device_is_registered(struct device *dev)
433 return dev->is_registered; 481 return dev->is_registered;
434} 482}
435 483
484void driver_init(void);
485
436/* 486/*
437 * High level routines for use by the bus drivers 487 * High level routines for use by the bus drivers
438 */ 488 */
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index 8853fc4d1c5e..b93486107821 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -285,9 +285,9 @@ typedef char ioctl_struct[308];
285#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 285#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
286 286
287#define DM_VERSION_MAJOR 4 287#define DM_VERSION_MAJOR 4
288#define DM_VERSION_MINOR 10 288#define DM_VERSION_MINOR 11
289#define DM_VERSION_PATCHLEVEL 0 289#define DM_VERSION_PATCHLEVEL 0
290#define DM_VERSION_EXTRA "-ioctl (2006-09-14)" 290#define DM_VERSION_EXTRA "-ioctl (2006-10-12)"
291 291
292/* Status bits */ 292/* Status bits */
293#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 293#define DM_READONLY_FLAG (1 << 0) /* In/Out */
@@ -323,4 +323,9 @@ typedef char ioctl_struct[308];
323 */ 323 */
324#define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */ 324#define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */
325 325
326/*
327 * Set this to suspend without flushing queued ios.
328 */
329#define DM_NOFLUSH_FLAG (1 << 11) /* In */
330
326#endif /* _LINUX_DM_IOCTL_H */ 331#endif /* _LINUX_DM_IOCTL_H */
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/efi.h b/include/linux/efi.h
index df1c91855f0e..f8ebd7c1ddb3 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -301,7 +301,7 @@ extern int __init efi_uart_console_only (void);
301extern void efi_initialize_iomem_resources(struct resource *code_resource, 301extern void efi_initialize_iomem_resources(struct resource *code_resource,
302 struct resource *data_resource); 302 struct resource *data_resource);
303extern unsigned long efi_get_time(void); 303extern unsigned long efi_get_time(void);
304extern int __init efi_set_rtc_mmss(unsigned long nowtime); 304extern int efi_set_rtc_mmss(unsigned long nowtime);
305extern int is_available_memory(efi_memory_desc_t * md); 305extern int is_available_memory(efi_memory_desc_t * md);
306extern struct efi_memory_map memmap; 306extern struct efi_memory_map memmap;
307 307
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/elevator.h b/include/linux/elevator.h
index a24931d24404..e88fcbc77f8f 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -12,6 +12,8 @@ typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struc
12 12
13typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int); 13typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int);
14 14
15typedef int (elevator_allow_merge_fn) (request_queue_t *, struct request *, struct bio *);
16
15typedef int (elevator_dispatch_fn) (request_queue_t *, int); 17typedef int (elevator_dispatch_fn) (request_queue_t *, int);
16 18
17typedef void (elevator_add_req_fn) (request_queue_t *, struct request *); 19typedef void (elevator_add_req_fn) (request_queue_t *, struct request *);
@@ -33,6 +35,7 @@ struct elevator_ops
33 elevator_merge_fn *elevator_merge_fn; 35 elevator_merge_fn *elevator_merge_fn;
34 elevator_merged_fn *elevator_merged_fn; 36 elevator_merged_fn *elevator_merged_fn;
35 elevator_merge_req_fn *elevator_merge_req_fn; 37 elevator_merge_req_fn *elevator_merge_req_fn;
38 elevator_allow_merge_fn *elevator_allow_merge_fn;
36 39
37 elevator_dispatch_fn *elevator_dispatch_fn; 40 elevator_dispatch_fn *elevator_dispatch_fn;
38 elevator_add_req_fn *elevator_add_req_fn; 41 elevator_add_req_fn *elevator_add_req_fn;
diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h
new file mode 100644
index 000000000000..32368c4f0326
--- /dev/null
+++ b/include/linux/fault-inject.h
@@ -0,0 +1,84 @@
1#ifndef _LINUX_FAULT_INJECT_H
2#define _LINUX_FAULT_INJECT_H
3
4#ifdef CONFIG_FAULT_INJECTION
5
6#include <linux/types.h>
7#include <linux/debugfs.h>
8#include <asm/atomic.h>
9
10/*
11 * For explanation of the elements of this struct, see
12 * Documentation/fault-injection/fault-injection.txt
13 */
14struct fault_attr {
15 unsigned long probability;
16 unsigned long interval;
17 atomic_t times;
18 atomic_t space;
19 unsigned long verbose;
20 u32 task_filter;
21 unsigned long stacktrace_depth;
22 unsigned long require_start;
23 unsigned long require_end;
24 unsigned long reject_start;
25 unsigned long reject_end;
26
27 unsigned long count;
28
29#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
30
31 struct {
32 struct dentry *dir;
33
34 struct dentry *probability_file;
35 struct dentry *interval_file;
36 struct dentry *times_file;
37 struct dentry *space_file;
38 struct dentry *verbose_file;
39 struct dentry *task_filter_file;
40 struct dentry *stacktrace_depth_file;
41 struct dentry *require_start_file;
42 struct dentry *require_end_file;
43 struct dentry *reject_start_file;
44 struct dentry *reject_end_file;
45 } dentries;
46
47#endif
48};
49
50#define FAULT_ATTR_INITIALIZER { \
51 .interval = 1, \
52 .times = ATOMIC_INIT(1), \
53 .require_end = ULONG_MAX, \
54 .stacktrace_depth = 32, \
55 .verbose = 2, \
56 }
57
58#define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER
59int setup_fault_attr(struct fault_attr *attr, char *str);
60void should_fail_srandom(unsigned long entropy);
61bool should_fail(struct fault_attr *attr, ssize_t size);
62
63#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
64
65int init_fault_attr_dentries(struct fault_attr *attr, const char *name);
66void cleanup_fault_attr_dentries(struct fault_attr *attr);
67
68#else /* CONFIG_FAULT_INJECTION_DEBUG_FS */
69
70static inline int init_fault_attr_dentries(struct fault_attr *attr,
71 const char *name)
72{
73 return -ENODEV;
74}
75
76static inline void cleanup_fault_attr_dentries(struct fault_attr *attr)
77{
78}
79
80#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */
81
82#endif /* CONFIG_FAULT_INJECTION */
83
84#endif /* _LINUX_FAULT_INJECT_H */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index fa23e0671bb3..64177ec9a019 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -929,8 +929,6 @@ extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max)
929#define FB_MODE_IS_FIRST 16 929#define FB_MODE_IS_FIRST 16
930#define FB_MODE_IS_FROM_VAR 32 930#define FB_MODE_IS_FROM_VAR 32
931 931
932extern int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
933 const struct fb_info *fb_info);
934extern int fbmon_dpms(const struct fb_info *fb_info); 932extern int fbmon_dpms(const struct fb_info *fb_info);
935extern int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var, 933extern int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var,
936 struct fb_info *info); 934 struct fb_info *info);
@@ -970,11 +968,11 @@ extern struct fb_videomode *fb_find_best_display(struct fb_monspecs *specs,
970/* drivers/video/fbcmap.c */ 968/* drivers/video/fbcmap.c */
971extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); 969extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
972extern void fb_dealloc_cmap(struct fb_cmap *cmap); 970extern void fb_dealloc_cmap(struct fb_cmap *cmap);
973extern int fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to); 971extern int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to);
974extern int fb_cmap_to_user(struct fb_cmap *from, struct fb_cmap_user *to); 972extern int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to);
975extern int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *fb_info); 973extern int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *fb_info);
976extern int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *fb_info); 974extern int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *fb_info);
977extern struct fb_cmap *fb_default_cmap(int len); 975extern const struct fb_cmap *fb_default_cmap(int len);
978extern void fb_invert_cmaps(void); 976extern void fb_invert_cmaps(void);
979 977
980struct fb_videomode { 978struct fb_videomode {
diff --git a/include/linux/file.h b/include/linux/file.h
index 6e77b9177f9e..a59001e9ea58 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -26,19 +26,12 @@ struct embedded_fd_set {
26 unsigned long fds_bits[1]; 26 unsigned long fds_bits[1];
27}; 27};
28 28
29/*
30 * More than this number of fds: we use a separately allocated fd_set
31 */
32#define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set))
33
34struct fdtable { 29struct fdtable {
35 unsigned int max_fds; 30 unsigned int max_fds;
36 int max_fdset;
37 struct file ** fd; /* current fd array */ 31 struct file ** fd; /* current fd array */
38 fd_set *close_on_exec; 32 fd_set *close_on_exec;
39 fd_set *open_fds; 33 fd_set *open_fds;
40 struct rcu_head rcu; 34 struct rcu_head rcu;
41 struct files_struct *free_files;
42 struct fdtable *next; 35 struct fdtable *next;
43}; 36};
44 37
@@ -83,16 +76,15 @@ extern int get_unused_fd(void);
83extern void FASTCALL(put_unused_fd(unsigned int fd)); 76extern void FASTCALL(put_unused_fd(unsigned int fd));
84struct kmem_cache; 77struct kmem_cache;
85 78
86extern struct file ** alloc_fd_array(int);
87extern void free_fd_array(struct file **, int);
88
89extern fd_set *alloc_fdset(int);
90extern void free_fdset(fd_set *, int);
91
92extern int expand_files(struct files_struct *, int nr); 79extern int expand_files(struct files_struct *, int nr);
93extern void free_fdtable(struct fdtable *fdt); 80extern void free_fdtable_rcu(struct rcu_head *rcu);
94extern void __init files_defer_init(void); 81extern void __init files_defer_init(void);
95 82
83static inline void free_fdtable(struct fdtable *fdt)
84{
85 call_rcu(&fdt->rcu, free_fdtable_rcu);
86}
87
96static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) 88static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
97{ 89{
98 struct file * file = NULL; 90 struct file * file = NULL;
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 6e05e3e7ce39..5e75e26d4787 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -1,5 +1,7 @@
1/* Freezer declarations */ 1/* Freezer declarations */
2 2
3#include <linux/sched.h>
4
3#ifdef CONFIG_PM 5#ifdef CONFIG_PM
4/* 6/*
5 * Check if a process has been frozen 7 * Check if a process has been frozen
@@ -14,16 +16,15 @@ static inline int frozen(struct task_struct *p)
14 */ 16 */
15static inline int freezing(struct task_struct *p) 17static inline int freezing(struct task_struct *p)
16{ 18{
17 return p->flags & PF_FREEZE; 19 return test_tsk_thread_flag(p, TIF_FREEZE);
18} 20}
19 21
20/* 22/*
21 * Request that a process be frozen 23 * Request that a process be frozen
22 * FIXME: SMP problem. We may not modify other process' flags!
23 */ 24 */
24static inline void freeze(struct task_struct *p) 25static inline void freeze(struct task_struct *p)
25{ 26{
26 p->flags |= PF_FREEZE; 27 set_tsk_thread_flag(p, TIF_FREEZE);
27} 28}
28 29
29/* 30/*
@@ -31,7 +32,7 @@ static inline void freeze(struct task_struct *p)
31 */ 32 */
32static inline void do_not_freeze(struct task_struct *p) 33static inline void do_not_freeze(struct task_struct *p)
33{ 34{
34 p->flags &= ~PF_FREEZE; 35 clear_tsk_thread_flag(p, TIF_FREEZE);
35} 36}
36 37
37/* 38/*
@@ -52,7 +53,9 @@ static inline int thaw_process(struct task_struct *p)
52 */ 53 */
53static inline void frozen_process(struct task_struct *p) 54static inline void frozen_process(struct task_struct *p)
54{ 55{
55 p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN; 56 p->flags |= PF_FROZEN;
57 wmb();
58 clear_tsk_thread_flag(p, TIF_FREEZE);
56} 59}
57 60
58extern void refrigerator(void); 61extern void refrigerator(void);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 70b99fbb560b..1410e5330c8d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -120,6 +120,7 @@ extern int dir_notify_enable;
120#define MS_PRIVATE (1<<18) /* change to private */ 120#define MS_PRIVATE (1<<18) /* change to private */
121#define MS_SLAVE (1<<19) /* change to slave */ 121#define MS_SLAVE (1<<19) /* change to slave */
122#define MS_SHARED (1<<20) /* change to shared */ 122#define MS_SHARED (1<<20) /* change to shared */
123#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
123#define MS_ACTIVE (1<<30) 124#define MS_ACTIVE (1<<30)
124#define MS_NOUSER (1<<31) 125#define MS_NOUSER (1<<31)
125 126
@@ -269,6 +270,7 @@ extern int dir_notify_enable;
269#include <linux/types.h> 270#include <linux/types.h>
270#include <linux/kdev_t.h> 271#include <linux/kdev_t.h>
271#include <linux/dcache.h> 272#include <linux/dcache.h>
273#include <linux/namei.h>
272#include <linux/stat.h> 274#include <linux/stat.h>
273#include <linux/cache.h> 275#include <linux/cache.h>
274#include <linux/kobject.h> 276#include <linux/kobject.h>
@@ -424,6 +426,7 @@ struct address_space_operations {
424 /* migrate the contents of a page to the specified target */ 426 /* migrate the contents of a page to the specified target */
425 int (*migratepage) (struct address_space *, 427 int (*migratepage) (struct address_space *,
426 struct page *, struct page *); 428 struct page *, struct page *);
429 int (*launder_page) (struct page *);
427}; 430};
428 431
429struct backing_dev_info; 432struct backing_dev_info;
@@ -456,7 +459,7 @@ struct block_device {
456 struct inode * bd_inode; /* will die */ 459 struct inode * bd_inode; /* will die */
457 int bd_openers; 460 int bd_openers;
458 struct mutex bd_mutex; /* open/close mutex */ 461 struct mutex bd_mutex; /* open/close mutex */
459 struct mutex bd_mount_mutex; /* mount mutex */ 462 struct semaphore bd_mount_sem;
460 struct list_head bd_inodes; 463 struct list_head bd_inodes;
461 void * bd_holder; 464 void * bd_holder;
462 int bd_holders; 465 int bd_holders;
@@ -482,21 +485,6 @@ struct block_device {
482}; 485};
483 486
484/* 487/*
485 * bdev->bd_mutex nesting subclasses for the lock validator:
486 *
487 * 0: normal
488 * 1: 'whole'
489 * 2: 'partition'
490 */
491enum bdev_bd_mutex_lock_class
492{
493 BD_MUTEX_NORMAL,
494 BD_MUTEX_WHOLE,
495 BD_MUTEX_PARTITION
496};
497
498
499/*
500 * Radix-tree tags, for tagging dirty and writeback pages within the pagecache 488 * Radix-tree tags, for tagging dirty and writeback pages within the pagecache
501 * radix trees 489 * radix trees
502 */ 490 */
@@ -726,8 +714,9 @@ struct file {
726 struct list_head fu_list; 714 struct list_head fu_list;
727 struct rcu_head fu_rcuhead; 715 struct rcu_head fu_rcuhead;
728 } f_u; 716 } f_u;
729 struct dentry *f_dentry; 717 struct path f_path;
730 struct vfsmount *f_vfsmnt; 718#define f_dentry f_path.dentry
719#define f_vfsmnt f_path.mnt
731 const struct file_operations *f_op; 720 const struct file_operations *f_op;
732 atomic_t f_count; 721 atomic_t f_count;
733 unsigned int f_flags; 722 unsigned int f_flags;
@@ -1239,7 +1228,7 @@ extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry);
1239static inline void file_accessed(struct file *file) 1228static inline void file_accessed(struct file *file)
1240{ 1229{
1241 if (!(file->f_flags & O_NOATIME)) 1230 if (!(file->f_flags & O_NOATIME))
1242 touch_atime(file->f_vfsmnt, file->f_dentry); 1231 touch_atime(file->f_path.mnt, file->f_path.dentry);
1243} 1232}
1244 1233
1245int sync_inode(struct inode *inode, struct writeback_control *wbc); 1234int sync_inode(struct inode *inode, struct writeback_control *wbc);
@@ -1499,7 +1488,6 @@ extern void bd_set_size(struct block_device *, loff_t size);
1499extern void bd_forget(struct inode *inode); 1488extern void bd_forget(struct inode *inode);
1500extern void bdput(struct block_device *); 1489extern void bdput(struct block_device *);
1501extern struct block_device *open_by_devnum(dev_t, unsigned); 1490extern struct block_device *open_by_devnum(dev_t, unsigned);
1502extern struct block_device *open_partition_by_devnum(dev_t, unsigned);
1503extern const struct address_space_operations def_blk_aops; 1491extern const struct address_space_operations def_blk_aops;
1504#else 1492#else
1505static inline void bd_forget(struct inode *inode) {} 1493static inline void bd_forget(struct inode *inode) {}
@@ -1517,7 +1505,6 @@ extern int blkdev_driver_ioctl(struct inode *inode, struct file *file,
1517extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1505extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
1518extern int blkdev_get(struct block_device *, mode_t, unsigned); 1506extern int blkdev_get(struct block_device *, mode_t, unsigned);
1519extern int blkdev_put(struct block_device *); 1507extern int blkdev_put(struct block_device *);
1520extern int blkdev_put_partition(struct block_device *);
1521extern int bd_claim(struct block_device *, void *); 1508extern int bd_claim(struct block_device *, void *);
1522extern void bd_release(struct block_device *); 1509extern void bd_release(struct block_device *);
1523#ifdef CONFIG_SYSFS 1510#ifdef CONFIG_SYSFS
@@ -1632,7 +1619,7 @@ static inline void put_write_access(struct inode * inode)
1632static inline void allow_write_access(struct file *file) 1619static inline void allow_write_access(struct file *file)
1633{ 1620{
1634 if (file) 1621 if (file)
1635 atomic_inc(&file->f_dentry->d_inode->i_writecount); 1622 atomic_inc(&file->f_path.dentry->d_inode->i_writecount);
1636} 1623}
1637extern int do_pipe(int *); 1624extern int do_pipe(int *);
1638extern struct file *create_read_pipe(struct file *f); 1625extern struct file *create_read_pipe(struct file *f);
diff --git a/include/linux/fs_stack.h b/include/linux/fs_stack.h
new file mode 100644
index 000000000000..bb516ceeefc9
--- /dev/null
+++ b/include/linux/fs_stack.h
@@ -0,0 +1,31 @@
1#ifndef _LINUX_FS_STACK_H
2#define _LINUX_FS_STACK_H
3
4/* This file defines generic functions used primarily by stackable
5 * filesystems; none of these functions require i_mutex to be held.
6 */
7
8#include <linux/fs.h>
9
10/* externs for fs/stack.c */
11extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
12 int (*get_nlinks)(struct inode *));
13
14extern void fsstack_copy_inode_size(struct inode *dst, const struct inode *src);
15
16/* inlines */
17static inline void fsstack_copy_attr_atime(struct inode *dest,
18 const struct inode *src)
19{
20 dest->i_atime = src->i_atime;
21}
22
23static inline void fsstack_copy_attr_times(struct inode *dest,
24 const struct inode *src)
25{
26 dest->i_atime = src->i_atime;
27 dest->i_mtime = src->i_mtime;
28 dest->i_ctime = src->i_ctime;
29}
30
31#endif /* _LINUX_FS_STACK_H */
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 3da29e2d524a..abb64c437f6f 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -19,6 +19,7 @@
19#define _FSL_DEVICE_H_ 19#define _FSL_DEVICE_H_
20 20
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/phy.h>
22 23
23/* 24/*
24 * Some conventions on how we handle peripherals on Freescale chips 25 * Some conventions on how we handle peripherals on Freescale chips
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index d4f219ffaa5d..dfc4e4f68da4 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -164,7 +164,7 @@ static inline void fsnotify_open(struct dentry *dentry)
164 */ 164 */
165static inline void fsnotify_close(struct file *file) 165static inline void fsnotify_close(struct file *file)
166{ 166{
167 struct dentry *dentry = file->f_dentry; 167 struct dentry *dentry = file->f_path.dentry;
168 struct inode *inode = dentry->d_inode; 168 struct inode *inode = dentry->d_inode;
169 const char *name = dentry->d_name.name; 169 const char *name = dentry->d_name.name;
170 mode_t mode = file->f_mode; 170 mode_t mode = file->f_mode;
diff --git a/include/linux/futex.h b/include/linux/futex.h
index d097b5b72bc6..3f153b4e156c 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -93,6 +93,7 @@ struct robust_list_head {
93 */ 93 */
94#define ROBUST_LIST_LIMIT 2048 94#define ROBUST_LIST_LIMIT 2048
95 95
96#ifdef __KERNEL__
96long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout, 97long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout,
97 u32 __user *uaddr2, u32 val2, u32 val3); 98 u32 __user *uaddr2, u32 val2, u32 val3);
98 99
@@ -110,6 +111,7 @@ static inline void exit_pi_state_list(struct task_struct *curr)
110{ 111{
111} 112}
112#endif 113#endif
114#endif /* __KERNEL__ */
113 115
114#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ 116#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
115#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */ 117#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 2cdba0c23957..afad95272841 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -105,7 +105,7 @@ static inline void gameport_set_phys(struct gameport *gameport,
105 105
106static inline struct gameport *gameport_allocate_port(void) 106static inline struct gameport *gameport_allocate_port(void)
107{ 107{
108 struct gameport *gameport = kcalloc(1, sizeof(struct gameport), GFP_KERNEL); 108 struct gameport *gameport = kzalloc(sizeof(struct gameport), GFP_KERNEL);
109 109
110 return gameport; 110 return gameport;
111} 111}
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h
index e25384561955..5412da28fa47 100644
--- a/include/linux/generic_serial.h
+++ b/include/linux/generic_serial.h
@@ -91,7 +91,7 @@ void gs_hangup(struct tty_struct *tty);
91int gs_block_til_ready(void *port, struct file *filp); 91int gs_block_til_ready(void *port, struct file *filp);
92void gs_close(struct tty_struct *tty, struct file *filp); 92void gs_close(struct tty_struct *tty, struct file *filp);
93void gs_set_termios (struct tty_struct * tty, 93void gs_set_termios (struct tty_struct * tty,
94 struct termios * old_termios); 94 struct ktermios * old_termios);
95int gs_init_port(struct gs_port *port); 95int gs_init_port(struct gs_port *port);
96int gs_setserial(struct gs_port *port, struct serial_struct __user *sp); 96int gs_setserial(struct gs_port *port, struct serial_struct __user *sp);
97int gs_getserial(struct gs_port *port, struct serial_struct __user *sp); 97int gs_getserial(struct gs_port *port, struct serial_struct __user *sp);
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 41f276fdd185..0a022b2f63fc 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -83,6 +83,9 @@ struct hd_struct {
83 struct kobject *holder_dir; 83 struct kobject *holder_dir;
84 unsigned ios[2], sectors[2]; /* READs and WRITEs */ 84 unsigned ios[2], sectors[2]; /* READs and WRITEs */
85 int policy, partno; 85 int policy, partno;
86#ifdef CONFIG_FAIL_MAKE_REQUEST
87 int make_it_fail;
88#endif
86}; 89};
87 90
88#define GENHD_FL_REMOVABLE 1 91#define GENHD_FL_REMOVABLE 1
@@ -90,6 +93,7 @@ struct hd_struct {
90#define GENHD_FL_CD 8 93#define GENHD_FL_CD 8
91#define GENHD_FL_UP 16 94#define GENHD_FL_UP 16
92#define GENHD_FL_SUPPRESS_PARTITION_INFO 32 95#define GENHD_FL_SUPPRESS_PARTITION_INFO 32
96#define GENHD_FL_FAIL 64
93 97
94struct disk_stats { 98struct disk_stats {
95 unsigned long sectors[2]; /* READs and WRITEs */ 99 unsigned long sectors[2]; /* READs and WRITEs */
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 00c314aedab7..063799ea6be0 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
diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h
index 2b54eac738ea..818c6afc1091 100644
--- a/include/linux/hdreg.h
+++ b/include/linux/hdreg.h
@@ -60,13 +60,15 @@
60#define TAG_MASK 0xf8 60#define TAG_MASK 0xf8
61#endif /* __KERNEL__ */ 61#endif /* __KERNEL__ */
62 62
63#include <linux/types.h>
64
63/* 65/*
64 * Command Header sizes for IOCTL commands 66 * Command Header sizes for IOCTL commands
65 */ 67 */
66 68
67#define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(u8)) 69#define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(__u8))
68#define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(u8)) 70#define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(__u8))
69#define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(u8)) 71#define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(__u8))
70 72
71#define IDE_DRIVE_TASK_INVALID -1 73#define IDE_DRIVE_TASK_INVALID -1
72#define IDE_DRIVE_TASK_NO_DATA 0 74#define IDE_DRIVE_TASK_NO_DATA 0
diff --git a/include/linux/hid-debug.h b/include/linux/hid-debug.h
new file mode 100644
index 000000000000..50d568ec178a
--- /dev/null
+++ b/include/linux/hid-debug.h
@@ -0,0 +1,45 @@
1#ifndef __HID_DEBUG_H
2#define __HID_DEBUG_H
3
4/*
5 * Copyright (c) 2007 Jiri Kosina
6 */
7
8/*
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24
25#ifdef CONFIG_HID_DEBUG
26
27void hid_dump_input(struct hid_usage *, __s32);
28void hid_dump_device(struct hid_device *);
29void hid_dump_field(struct hid_field *, int);
30void hid_resolv_usage(unsigned);
31void hid_resolv_event(__u8, __u16);
32
33#else
34
35#define hid_dump_input(a,b) do { } while (0)
36#define hid_dump_device(c) do { } while (0)
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)
40
41#endif /* CONFIG_HID_DEBUG */
42
43
44#endif
45
diff --git a/include/linux/hid.h b/include/linux/hid.h
new file mode 100644
index 000000000000..d26b08f461f2
--- /dev/null
+++ b/include/linux/hid.h
@@ -0,0 +1,521 @@
1#ifndef __HID_H
2#define __HID_H
3
4/*
5 * $Id: hid.h,v 1.24 2001/12/27 10:37:41 vojtech Exp $
6 *
7 * Copyright (c) 1999 Andreas Gal
8 * Copyright (c) 2000-2001 Vojtech Pavlik
9 * Copyright (c) 2006 Jiri Kosina
10 */
11
12/*
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 *
27 * Should you need to contact me, the author, you can do so either by
28 * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
29 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
30 */
31
32#include <linux/types.h>
33#include <linux/slab.h>
34#include <linux/list.h>
35#include <linux/timer.h>
36#include <linux/workqueue.h>
37#include <linux/input.h>
38
39/*
40 * USB HID (Human Interface Device) interface class code
41 */
42
43#define USB_INTERFACE_CLASS_HID 3
44
45/*
46 * USB HID interface subclass and protocol codes
47 */
48
49#define USB_INTERFACE_SUBCLASS_BOOT 1
50#define USB_INTERFACE_PROTOCOL_KEYBOARD 1
51#define USB_INTERFACE_PROTOCOL_MOUSE 2
52
53/*
54 * HID class requests
55 */
56
57#define HID_REQ_GET_REPORT 0x01
58#define HID_REQ_GET_IDLE 0x02
59#define HID_REQ_GET_PROTOCOL 0x03
60#define HID_REQ_SET_REPORT 0x09
61#define HID_REQ_SET_IDLE 0x0A
62#define HID_REQ_SET_PROTOCOL 0x0B
63
64/*
65 * HID class descriptor types
66 */
67
68#define HID_DT_HID (USB_TYPE_CLASS | 0x01)
69#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
70#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
71
72/*
73 * We parse each description item into this structure. Short items data
74 * values are expanded to 32-bit signed int, long items contain a pointer
75 * into the data area.
76 */
77
78struct hid_item {
79 unsigned format;
80 __u8 size;
81 __u8 type;
82 __u8 tag;
83 union {
84 __u8 u8;
85 __s8 s8;
86 __u16 u16;
87 __s16 s16;
88 __u32 u32;
89 __s32 s32;
90 __u8 *longdata;
91 } data;
92};
93
94/*
95 * HID report item format
96 */
97
98#define HID_ITEM_FORMAT_SHORT 0
99#define HID_ITEM_FORMAT_LONG 1
100
101/*
102 * Special tag indicating long items
103 */
104
105#define HID_ITEM_TAG_LONG 15
106
107/*
108 * HID report descriptor item type (prefix bit 2,3)
109 */
110
111#define HID_ITEM_TYPE_MAIN 0
112#define HID_ITEM_TYPE_GLOBAL 1
113#define HID_ITEM_TYPE_LOCAL 2
114#define HID_ITEM_TYPE_RESERVED 3
115
116/*
117 * HID report descriptor main item tags
118 */
119
120#define HID_MAIN_ITEM_TAG_INPUT 8
121#define HID_MAIN_ITEM_TAG_OUTPUT 9
122#define HID_MAIN_ITEM_TAG_FEATURE 11
123#define HID_MAIN_ITEM_TAG_BEGIN_COLLECTION 10
124#define HID_MAIN_ITEM_TAG_END_COLLECTION 12
125
126/*
127 * HID report descriptor main item contents
128 */
129
130#define HID_MAIN_ITEM_CONSTANT 0x001
131#define HID_MAIN_ITEM_VARIABLE 0x002
132#define HID_MAIN_ITEM_RELATIVE 0x004
133#define HID_MAIN_ITEM_WRAP 0x008
134#define HID_MAIN_ITEM_NONLINEAR 0x010
135#define HID_MAIN_ITEM_NO_PREFERRED 0x020
136#define HID_MAIN_ITEM_NULL_STATE 0x040
137#define HID_MAIN_ITEM_VOLATILE 0x080
138#define HID_MAIN_ITEM_BUFFERED_BYTE 0x100
139
140/*
141 * HID report descriptor collection item types
142 */
143
144#define HID_COLLECTION_PHYSICAL 0
145#define HID_COLLECTION_APPLICATION 1
146#define HID_COLLECTION_LOGICAL 2
147
148/*
149 * HID report descriptor global item tags
150 */
151
152#define HID_GLOBAL_ITEM_TAG_USAGE_PAGE 0
153#define HID_GLOBAL_ITEM_TAG_LOGICAL_MINIMUM 1
154#define HID_GLOBAL_ITEM_TAG_LOGICAL_MAXIMUM 2
155#define HID_GLOBAL_ITEM_TAG_PHYSICAL_MINIMUM 3
156#define HID_GLOBAL_ITEM_TAG_PHYSICAL_MAXIMUM 4
157#define HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT 5
158#define HID_GLOBAL_ITEM_TAG_UNIT 6
159#define HID_GLOBAL_ITEM_TAG_REPORT_SIZE 7
160#define HID_GLOBAL_ITEM_TAG_REPORT_ID 8
161#define HID_GLOBAL_ITEM_TAG_REPORT_COUNT 9
162#define HID_GLOBAL_ITEM_TAG_PUSH 10
163#define HID_GLOBAL_ITEM_TAG_POP 11
164
165/*
166 * HID report descriptor local item tags
167 */
168
169#define HID_LOCAL_ITEM_TAG_USAGE 0
170#define HID_LOCAL_ITEM_TAG_USAGE_MINIMUM 1
171#define HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM 2
172#define HID_LOCAL_ITEM_TAG_DESIGNATOR_INDEX 3
173#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MINIMUM 4
174#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MAXIMUM 5
175#define HID_LOCAL_ITEM_TAG_STRING_INDEX 7
176#define HID_LOCAL_ITEM_TAG_STRING_MINIMUM 8
177#define HID_LOCAL_ITEM_TAG_STRING_MAXIMUM 9
178#define HID_LOCAL_ITEM_TAG_DELIMITER 10
179
180/*
181 * HID usage tables
182 */
183
184#define HID_USAGE_PAGE 0xffff0000
185
186#define HID_UP_UNDEFINED 0x00000000
187#define HID_UP_GENDESK 0x00010000
188#define HID_UP_SIMULATION 0x00020000
189#define HID_UP_KEYBOARD 0x00070000
190#define HID_UP_LED 0x00080000
191#define HID_UP_BUTTON 0x00090000
192#define HID_UP_ORDINAL 0x000a0000
193#define HID_UP_CONSUMER 0x000c0000
194#define HID_UP_DIGITIZER 0x000d0000
195#define HID_UP_PID 0x000f0000
196#define HID_UP_HPVENDOR 0xff7f0000
197#define HID_UP_MSVENDOR 0xff000000
198#define HID_UP_CUSTOM 0x00ff0000
199#define HID_UP_LOGIVENDOR 0xffbc0000
200
201#define HID_USAGE 0x0000ffff
202
203#define HID_GD_POINTER 0x00010001
204#define HID_GD_MOUSE 0x00010002
205#define HID_GD_JOYSTICK 0x00010004
206#define HID_GD_GAMEPAD 0x00010005
207#define HID_GD_KEYBOARD 0x00010006
208#define HID_GD_KEYPAD 0x00010007
209#define HID_GD_MULTIAXIS 0x00010008
210#define HID_GD_X 0x00010030
211#define HID_GD_Y 0x00010031
212#define HID_GD_Z 0x00010032
213#define HID_GD_RX 0x00010033
214#define HID_GD_RY 0x00010034
215#define HID_GD_RZ 0x00010035
216#define HID_GD_SLIDER 0x00010036
217#define HID_GD_DIAL 0x00010037
218#define HID_GD_WHEEL 0x00010038
219#define HID_GD_HATSWITCH 0x00010039
220#define HID_GD_BUFFER 0x0001003a
221#define HID_GD_BYTECOUNT 0x0001003b
222#define HID_GD_MOTION 0x0001003c
223#define HID_GD_START 0x0001003d
224#define HID_GD_SELECT 0x0001003e
225#define HID_GD_VX 0x00010040
226#define HID_GD_VY 0x00010041
227#define HID_GD_VZ 0x00010042
228#define HID_GD_VBRX 0x00010043
229#define HID_GD_VBRY 0x00010044
230#define HID_GD_VBRZ 0x00010045
231#define HID_GD_VNO 0x00010046
232#define HID_GD_FEATURE 0x00010047
233#define HID_GD_UP 0x00010090
234#define HID_GD_DOWN 0x00010091
235#define HID_GD_RIGHT 0x00010092
236#define HID_GD_LEFT 0x00010093
237
238/*
239 * HID report types --- Ouch! HID spec says 1 2 3!
240 */
241
242#define HID_INPUT_REPORT 0
243#define HID_OUTPUT_REPORT 1
244#define HID_FEATURE_REPORT 2
245
246/*
247 * HID device quirks.
248 */
249
250#define HID_QUIRK_INVERT 0x00000001
251#define HID_QUIRK_NOTOUCH 0x00000002
252#define HID_QUIRK_IGNORE 0x00000004
253#define HID_QUIRK_NOGET 0x00000008
254#define HID_QUIRK_HIDDEV 0x00000010
255#define HID_QUIRK_BADPAD 0x00000020
256#define HID_QUIRK_MULTI_INPUT 0x00000040
257#define HID_QUIRK_2WHEEL_MOUSE_HACK_7 0x00000080
258#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100
259#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200
260#define HID_QUIRK_MIGHTYMOUSE 0x00000400
261#define HID_QUIRK_CYMOTION 0x00000800
262#define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000
263#define HID_QUIRK_POWERBOOK_FN_ON 0x00002000
264#define HID_QUIRK_INVERT_HWHEEL 0x00004000
265#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000
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
270
271/*
272 * This is the global environment of the parser. This information is
273 * persistent for main-items. The global environment can be saved and
274 * restored with PUSH/POP statements.
275 */
276
277struct hid_global {
278 unsigned usage_page;
279 __s32 logical_minimum;
280 __s32 logical_maximum;
281 __s32 physical_minimum;
282 __s32 physical_maximum;
283 __s32 unit_exponent;
284 unsigned unit;
285 unsigned report_id;
286 unsigned report_size;
287 unsigned report_count;
288};
289
290/*
291 * This is the local environment. It is persistent up the next main-item.
292 */
293
294#define HID_MAX_DESCRIPTOR_SIZE 4096
295#define HID_MAX_USAGES 1024
296#define HID_DEFAULT_NUM_COLLECTIONS 16
297
298struct hid_local {
299 unsigned usage[HID_MAX_USAGES]; /* usage array */
300 unsigned collection_index[HID_MAX_USAGES]; /* collection index array */
301 unsigned usage_index;
302 unsigned usage_minimum;
303 unsigned delimiter_depth;
304 unsigned delimiter_branch;
305};
306
307/*
308 * This is the collection stack. We climb up the stack to determine
309 * application and function of each field.
310 */
311
312struct hid_collection {
313 unsigned type;
314 unsigned usage;
315 unsigned level;
316};
317
318struct hid_usage {
319 unsigned hid; /* hid usage code */
320 unsigned collection_index; /* index into collection array */
321 /* hidinput data */
322 __u16 code; /* input driver code */
323 __u8 type; /* input driver type */
324 __s8 hat_min; /* hat switch fun */
325 __s8 hat_max; /* ditto */
326 __s8 hat_dir; /* ditto */
327};
328
329struct hid_input;
330
331struct hid_field {
332 unsigned physical; /* physical usage for this field */
333 unsigned logical; /* logical usage for this field */
334 unsigned application; /* application usage for this field */
335 struct hid_usage *usage; /* usage table for this function */
336 unsigned maxusage; /* maximum usage index */
337 unsigned flags; /* main-item flags (i.e. volatile,array,constant) */
338 unsigned report_offset; /* bit offset in the report */
339 unsigned report_size; /* size of this field in the report */
340 unsigned report_count; /* number of this field in the report */
341 unsigned report_type; /* (input,output,feature) */
342 __s32 *value; /* last known value(s) */
343 __s32 logical_minimum;
344 __s32 logical_maximum;
345 __s32 physical_minimum;
346 __s32 physical_maximum;
347 __s32 unit_exponent;
348 unsigned unit;
349 struct hid_report *report; /* associated report */
350 unsigned index; /* index into report->field[] */
351 /* hidinput data */
352 struct hid_input *hidinput; /* associated input structure */
353 __u16 dpad; /* dpad input code */
354};
355
356#define HID_MAX_FIELDS 64
357
358struct hid_report {
359 struct list_head list;
360 unsigned id; /* id of this report */
361 unsigned type; /* report type */
362 struct hid_field *field[HID_MAX_FIELDS]; /* fields of the report */
363 unsigned maxfield; /* maximum valid field index */
364 unsigned size; /* size of the report (bits) */
365 struct hid_device *device; /* associated device */
366};
367
368struct hid_report_enum {
369 unsigned numbered;
370 struct list_head report_list;
371 struct hid_report *report_id_hash[256];
372};
373
374#define HID_REPORT_TYPES 3
375
376#define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */
377#define HID_MAX_BUFFER_SIZE 4096 /* 4kb */
378#define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */
379#define HID_OUTPUT_FIFO_SIZE 64
380
381struct hid_control_fifo {
382 unsigned char dir;
383 struct hid_report *report;
384};
385
386#define HID_CLAIMED_INPUT 1
387#define HID_CLAIMED_HIDDEV 2
388
389#define HID_CTRL_RUNNING 1
390#define HID_OUT_RUNNING 2
391#define HID_IN_RUNNING 3
392#define HID_RESET_PENDING 4
393#define HID_SUSPENDED 5
394#define HID_CLEAR_HALT 6
395
396struct hid_input {
397 struct list_head list;
398 struct hid_report *report;
399 struct input_dev *input;
400};
401
402struct hid_device { /* device report descriptor */
403 __u8 *rdesc;
404 unsigned rsize;
405 struct hid_collection *collection; /* List of HID collections */
406 unsigned collection_size; /* Number of allocated hid_collections */
407 unsigned maxcollection; /* Number of parsed collections */
408 unsigned maxapplication; /* Number of applications */
409 unsigned short bus; /* BUS ID */
410 unsigned short vendor; /* Vendor ID */
411 unsigned short product; /* Product ID */
412 unsigned version; /* HID version */
413 unsigned country; /* HID country */
414 struct hid_report_enum report_enum[HID_REPORT_TYPES];
415
416 struct device *dev; /* device */
417
418 unsigned claimed; /* Claimed by hidinput, hiddev? */
419 unsigned quirks; /* Various quirks the device can pull on us */
420
421 struct list_head inputs; /* The list of inputs */
422 void *hiddev; /* The hiddev structure */
423 int minor; /* Hiddev minor number */
424
425 wait_queue_head_t wait; /* For sleeping */
426
427 int open; /* is the device open by anyone? */
428 char name[128]; /* Device name */
429 char phys[64]; /* Device physical location */
430 char uniq[64]; /* Device unique identifier (serial #) */
431
432 void *driver_data;
433
434 /* device-specific function pointers */
435 int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int);
436 int (*hid_open) (struct hid_device *);
437 void (*hid_close) (struct hid_device *);
438
439 /* hiddev event handler */
440 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
441 struct hid_usage *, __s32);
442 void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
443#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
444 unsigned long pb_pressed_fn[NBITS(KEY_MAX)];
445 unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];
446#endif
447};
448
449#define HID_GLOBAL_STACK_SIZE 4
450#define HID_COLLECTION_STACK_SIZE 4
451
452struct hid_parser {
453 struct hid_global global;
454 struct hid_global global_stack[HID_GLOBAL_STACK_SIZE];
455 unsigned global_stack_ptr;
456 struct hid_local local;
457 unsigned collection_stack[HID_COLLECTION_STACK_SIZE];
458 unsigned collection_stack_ptr;
459 struct hid_device *device;
460};
461
462struct hid_class_descriptor {
463 __u8 bDescriptorType;
464 __u16 wDescriptorLength;
465} __attribute__ ((packed));
466
467struct hid_descriptor {
468 __u8 bLength;
469 __u8 bDescriptorType;
470 __u16 bcdHID;
471 __u8 bCountryCode;
472 __u8 bNumDescriptors;
473
474 struct hid_class_descriptor desc[1];
475} __attribute__ ((packed));
476
477/* Applications from HID Usage Tables 4/8/99 Version 1.1 */
478/* We ignore a few input applications that are not widely used */
479#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001))
480
481/* HID core API */
482extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
483extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
484extern int hidinput_connect(struct hid_device *);
485extern void hidinput_disconnect(struct hid_device *);
486
487int hid_set_field(struct hid_field *, unsigned, __s32);
488int hid_input_report(struct hid_device *, int type, u8 *, int, int);
489int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
490void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt);
491void hid_output_report(struct hid_report *report, __u8 *data);
492void hid_free_device(struct hid_device *device);
493struct hid_device *hid_parse_report(__u8 *start, unsigned size);
494
495#ifdef CONFIG_HID_FF
496int hid_ff_init(struct hid_device *hid);
497
498int hid_lgff_init(struct hid_device *hid);
499int hid_plff_init(struct hid_device *hid);
500int hid_tmff_init(struct hid_device *hid);
501int hid_zpff_init(struct hid_device *hid);
502#ifdef CONFIG_HID_PID
503int hid_pidff_init(struct hid_device *hid);
504#else
505static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; }
506#endif
507
508#else
509static inline int hid_ff_init(struct hid_device *hid) { return -1; }
510#endif
511#ifdef DEBUG
512#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \
513 __FILE__ , ## arg)
514#else
515#define dbg(format, arg...) do {} while (0)
516#endif
517
518#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
519 __FILE__ , ## arg)
520#endif
521
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 3d8768b619e9..645d440807c2 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -8,7 +8,7 @@
8#include <asm/cacheflush.h> 8#include <asm/cacheflush.h>
9 9
10#ifndef ARCH_HAS_FLUSH_ANON_PAGE 10#ifndef ARCH_HAS_FLUSH_ANON_PAGE
11static inline void flush_anon_page(struct page *page, unsigned long vmaddr) 11static inline void flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr)
12{ 12{
13} 13}
14#endif 14#endif
@@ -96,7 +96,10 @@ static inline void memclear_highpage_flush(struct page *page, unsigned int offse
96 kunmap_atomic(kaddr, KM_USER0); 96 kunmap_atomic(kaddr, KM_USER0);
97} 97}
98 98
99static inline void copy_user_highpage(struct page *to, struct page *from, unsigned long vaddr) 99#ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE
100
101static inline void copy_user_highpage(struct page *to, struct page *from,
102 unsigned long vaddr, struct vm_area_struct *vma)
100{ 103{
101 char *vfrom, *vto; 104 char *vfrom, *vto;
102 105
@@ -109,6 +112,8 @@ static inline void copy_user_highpage(struct page *to, struct page *from, unsign
109 smp_wmb(); 112 smp_wmb();
110} 113}
111 114
115#endif
116
112static inline void copy_highpage(struct page *to, struct page *from) 117static inline void copy_highpage(struct page *to, struct page *from)
113{ 118{
114 char *vfrom, *vto; 119 char *vfrom, *vto;
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h
index c8f8df25c7e0..937da70cb4c4 100644
--- a/include/linux/i2c-algo-bit.h
+++ b/include/linux/i2c-algo-bit.h
@@ -26,9 +26,9 @@
26 26
27/* --- Defines for bit-adapters --------------------------------------- */ 27/* --- Defines for bit-adapters --------------------------------------- */
28/* 28/*
29 * This struct contains the hw-dependent functions of bit-style adapters to 29 * This struct contains the hw-dependent functions of bit-style adapters to
30 * manipulate the line states, and to init any hw-specific features. This is 30 * manipulate the line states, and to init any hw-specific features. This is
31 * only used if you have more than one hw-type of adapter running. 31 * only used if you have more than one hw-type of adapter running.
32 */ 32 */
33struct i2c_algo_bit_data { 33struct i2c_algo_bit_data {
34 void *data; /* private data for lowlevel routines */ 34 void *data; /* private data for lowlevel routines */
@@ -44,6 +44,5 @@ struct i2c_algo_bit_data {
44}; 44};
45 45
46int i2c_bit_add_bus(struct i2c_adapter *); 46int i2c_bit_add_bus(struct i2c_adapter *);
47int i2c_bit_del_bus(struct i2c_adapter *);
48 47
49#endif /* _LINUX_I2C_ALGO_BIT_H */ 48#endif /* _LINUX_I2C_ALGO_BIT_H */
diff --git a/include/linux/i2c-algo-ite.h b/include/linux/i2c-algo-ite.h
deleted file mode 100644
index 0073fe96c76e..000000000000
--- a/include/linux/i2c-algo-ite.h
+++ /dev/null
@@ -1,72 +0,0 @@
1/* ------------------------------------------------------------------------- */
2/* i2c-algo-ite.h i2c driver algorithms for ITE IIC adapters */
3/* ------------------------------------------------------------------------- */
4/* Copyright (C) 1995-97 Simon G. Vogl
5 1998-99 Hans Berglund
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
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20/* ------------------------------------------------------------------------- */
21
22/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
23 Frodo Looijaard <frodol@dds.nl> */
24
25/* Modifications by MontaVista Software, 2001
26 Changes made to support the ITE IIC peripheral */
27
28
29#ifndef I2C_ALGO_ITE_H
30#define I2C_ALGO_ITE_H 1
31
32#include <linux/types.h>
33
34/* Example of a sequential read request:
35 struct i2c_iic_msg s_msg;
36
37 s_msg.addr=device_address;
38 s_msg.len=length;
39 s_msg.buf=buffer;
40 s_msg.waddr=word_address;
41 ioctl(file,I2C_SREAD, &s_msg);
42 */
43#define I2C_SREAD 0x780 /* SREAD ioctl command */
44
45struct i2c_iic_msg {
46 __u16 addr; /* device address */
47 __u16 waddr; /* word address */
48 short len; /* msg length */
49 char *buf; /* pointer to msg data */
50};
51
52#ifdef __KERNEL__
53struct i2c_adapter;
54
55struct i2c_algo_iic_data {
56 void *data; /* private data for lolevel routines */
57 void (*setiic) (void *data, int ctl, int val);
58 int (*getiic) (void *data, int ctl);
59 int (*getown) (void *data);
60 int (*getclock) (void *data);
61 void (*waitforpin) (void);
62
63 /* local settings */
64 int udelay;
65 int mdelay;
66 int timeout;
67};
68
69int i2c_iic_add_bus(struct i2c_adapter *);
70int i2c_iic_del_bus(struct i2c_adapter *);
71#endif /* __KERNEL__ */
72#endif /* I2C_ALGO_ITE_H */
diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h
index 226693e0d88b..fce47c051bb1 100644
--- a/include/linux/i2c-algo-pca.h
+++ b/include/linux/i2c-algo-pca.h
@@ -10,6 +10,5 @@ struct i2c_algo_pca_data {
10}; 10};
11 11
12int i2c_pca_add_bus(struct i2c_adapter *); 12int i2c_pca_add_bus(struct i2c_adapter *);
13int i2c_pca_del_bus(struct i2c_adapter *);
14 13
15#endif /* _LINUX_I2C_ALGO_PCA_H */ 14#endif /* _LINUX_I2C_ALGO_PCA_H */
diff --git a/include/linux/i2c-algo-pcf.h b/include/linux/i2c-algo-pcf.h
index 9908f3fc4839..994eb86f882c 100644
--- a/include/linux/i2c-algo-pcf.h
+++ b/include/linux/i2c-algo-pcf.h
@@ -31,7 +31,7 @@ struct i2c_algo_pcf_data {
31 int (*getpcf) (void *data, int ctl); 31 int (*getpcf) (void *data, int ctl);
32 int (*getown) (void *data); 32 int (*getown) (void *data);
33 int (*getclock) (void *data); 33 int (*getclock) (void *data);
34 void (*waitforpin) (void); 34 void (*waitforpin) (void);
35 35
36 /* local settings */ 36 /* local settings */
37 int udelay; 37 int udelay;
@@ -39,6 +39,5 @@ struct i2c_algo_pcf_data {
39}; 39};
40 40
41int i2c_pcf_add_bus(struct i2c_adapter *); 41int i2c_pcf_add_bus(struct i2c_adapter *);
42int i2c_pcf_del_bus(struct i2c_adapter *);
43 42
44#endif /* _LINUX_I2C_ALGO_PCF_H */ 43#endif /* _LINUX_I2C_ALGO_PCF_H */
diff --git a/include/linux/i2c-algo-sgi.h b/include/linux/i2c-algo-sgi.h
index 4a0113d64064..3b7715024e69 100644
--- a/include/linux/i2c-algo-sgi.h
+++ b/include/linux/i2c-algo-sgi.h
@@ -22,6 +22,5 @@ struct i2c_algo_sgi_data {
22}; 22};
23 23
24int i2c_sgi_add_bus(struct i2c_adapter *); 24int i2c_sgi_add_bus(struct i2c_adapter *);
25int i2c_sgi_del_bus(struct i2c_adapter *);
26 25
27#endif /* I2C_ALGO_SGI_H */ 26#endif /* I2C_ALGO_SGI_H */
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 0a8f750cbede..6e7ec4c76178 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -1,7 +1,7 @@
1/* ------------------------------------------------------------------------- */ 1/* ------------------------------------------------------------------------- */
2/* */ 2/* */
3/* i2c-id.h - identifier values for i2c drivers and adapters */ 3/* i2c-id.h - identifier values for i2c drivers and adapters */
4/* */ 4/* */
5/* ------------------------------------------------------------------------- */ 5/* ------------------------------------------------------------------------- */
6/* Copyright (C) 1995-1999 Simon G. Vogl 6/* Copyright (C) 1995-1999 Simon G. Vogl
7 7
@@ -40,10 +40,10 @@
40#define I2C_DRIVERID_SAA7120 11 /* video encoder */ 40#define I2C_DRIVERID_SAA7120 11 /* video encoder */
41#define I2C_DRIVERID_SAA7121 12 /* video encoder */ 41#define I2C_DRIVERID_SAA7121 12 /* video encoder */
42#define I2C_DRIVERID_SAA7185B 13 /* video encoder */ 42#define I2C_DRIVERID_SAA7185B 13 /* video encoder */
43#define I2C_DRIVERID_CH7003 14 /* digital pc to tv encoder */ 43#define I2C_DRIVERID_CH7003 14 /* digital pc to tv encoder */
44#define I2C_DRIVERID_PCF8574A 15 /* i2c expander - 8 bit in/out */ 44#define I2C_DRIVERID_PCF8574A 15 /* i2c expander - 8 bit in/out */
45#define I2C_DRIVERID_PCF8582C 16 /* eeprom */ 45#define I2C_DRIVERID_PCF8582C 16 /* eeprom */
46#define I2C_DRIVERID_AT24Cxx 17 /* eeprom 1/2/4/8/16 K */ 46#define I2C_DRIVERID_AT24Cxx 17 /* eeprom 1/2/4/8/16 K */
47#define I2C_DRIVERID_TEA6300 18 /* audio mixer */ 47#define I2C_DRIVERID_TEA6300 18 /* audio mixer */
48#define I2C_DRIVERID_BT829 19 /* pc to tv encoder */ 48#define I2C_DRIVERID_BT829 19 /* pc to tv encoder */
49#define I2C_DRIVERID_TDA9850 20 /* audio mixer */ 49#define I2C_DRIVERID_TDA9850 20 /* audio mixer */
@@ -82,9 +82,8 @@
82#define I2C_DRIVERID_STM41T00 52 /* real time clock */ 82#define I2C_DRIVERID_STM41T00 52 /* real time clock */
83#define I2C_DRIVERID_UDA1342 53 /* UDA1342 audio codec */ 83#define I2C_DRIVERID_UDA1342 53 /* UDA1342 audio codec */
84#define I2C_DRIVERID_ADV7170 54 /* video encoder */ 84#define I2C_DRIVERID_ADV7170 54 /* video encoder */
85#define I2C_DRIVERID_RADEON 55 /* I2C bus on Radeon boards */
86#define I2C_DRIVERID_MAX1617 56 /* temp sensor */ 85#define I2C_DRIVERID_MAX1617 56 /* temp sensor */
87#define I2C_DRIVERID_SAA7191 57 /* video encoder */ 86#define I2C_DRIVERID_SAA7191 57 /* video decoder */
88#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */ 87#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */
89#define I2C_DRIVERID_BT832 59 /* CMOS camera video processor */ 88#define I2C_DRIVERID_BT832 59 /* CMOS camera video processor */
90#define I2C_DRIVERID_TDA9887 60 /* TDA988x IF-PLL demodulator */ 89#define I2C_DRIVERID_TDA9887 60 /* TDA988x IF-PLL demodulator */
@@ -116,6 +115,8 @@
116#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ 115#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */
117#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ 116#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
118#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 */
119 120
120#define I2C_DRIVERID_I2CDEV 900 121#define I2C_DRIVERID_I2CDEV 900
121#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ 122#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
@@ -132,7 +133,6 @@
132#define I2C_DRIVERID_ADM1021 1008 133#define I2C_DRIVERID_ADM1021 1008
133#define I2C_DRIVERID_ADM9240 1009 134#define I2C_DRIVERID_ADM9240 1009
134#define I2C_DRIVERID_LTC1710 1010 135#define I2C_DRIVERID_LTC1710 1010
135#define I2C_DRIVERID_ICSPLL 1012
136#define I2C_DRIVERID_BT869 1013 136#define I2C_DRIVERID_BT869 1013
137#define I2C_DRIVERID_MAXILIFE 1014 137#define I2C_DRIVERID_MAXILIFE 1014
138#define I2C_DRIVERID_MATORB 1015 138#define I2C_DRIVERID_MATORB 1015
@@ -144,7 +144,6 @@
144#define I2C_DRIVERID_MTP008 1023 144#define I2C_DRIVERID_MTP008 1023
145#define I2C_DRIVERID_DS1621 1024 145#define I2C_DRIVERID_DS1621 1024
146#define I2C_DRIVERID_ADM1024 1025 146#define I2C_DRIVERID_ADM1024 1025
147#define I2C_DRIVERID_IT87 1026
148#define I2C_DRIVERID_CH700X 1027 /* single driver for CH7003-7009 digital pc to tv encoders */ 147#define I2C_DRIVERID_CH700X 1027 /* single driver for CH7003-7009 digital pc to tv encoders */
149#define I2C_DRIVERID_FSCPOS 1028 148#define I2C_DRIVERID_FSCPOS 1028
150#define I2C_DRIVERID_FSCSCY 1029 149#define I2C_DRIVERID_FSCSCY 1029
@@ -159,12 +158,13 @@
159#define I2C_DRIVERID_ASB100 1043 158#define I2C_DRIVERID_ASB100 1043
160#define I2C_DRIVERID_FSCHER 1046 159#define I2C_DRIVERID_FSCHER 1046
161#define I2C_DRIVERID_W83L785TS 1047 160#define I2C_DRIVERID_W83L785TS 1047
161#define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */
162 162
163/* 163/*
164 * ---- Adapter types ---------------------------------------------------- 164 * ---- Adapter types ----------------------------------------------------
165 */ 165 */
166 166
167/* --- Bit algorithm adapters */ 167/* --- Bit algorithm adapters */
168#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ 168#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */
169#define I2C_HW_B_SER 0x010002 /* Serial line interface */ 169#define I2C_HW_B_SER 0x010002 /* Serial line interface */
170#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ 170#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */
@@ -212,9 +212,6 @@
212/* --- MPC8xx PowerPC adapters */ 212/* --- MPC8xx PowerPC adapters */
213#define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */ 213#define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */
214 214
215/* --- ITE based algorithms */
216#define I2C_HW_I_IIC 0x080000 /* controller on the ITE */
217
218/* --- PowerPC on-chip adapters */ 215/* --- PowerPC on-chip adapters */
219#define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */ 216#define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */
220 217
@@ -250,6 +247,7 @@
250#define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ 247#define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */
251#define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */ 248#define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */
252#define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */ 249#define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */
250#define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */
253 251
254/* --- ISA pseudo-adapter */ 252/* --- ISA pseudo-adapter */
255#define I2C_HW_ISA 0x050000 253#define I2C_HW_ISA 0x050000
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
new file mode 100644
index 000000000000..e6e9c814da61
--- /dev/null
+++ b/include/linux/i2c-pnx.h
@@ -0,0 +1,43 @@
1/*
2 * Header file for I2C support on PNX010x/4008.
3 *
4 * Author: Dennis Kovalev <dkovalev@ru.mvista.com>
5 *
6 * 2004-2006 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#ifndef __I2C_PNX_H__
13#define __I2C_PNX_H__
14
15#include <asm/arch/i2c.h>
16
17struct i2c_pnx_mif {
18 int ret; /* Return value */
19 int mode; /* Interface mode */
20 struct completion complete; /* I/O completion */
21 struct timer_list timer; /* Timeout */
22 char * buf; /* Data buffer */
23 int len; /* Length of data buffer */
24};
25
26struct i2c_pnx_algo_data {
27 u32 base;
28 u32 ioaddr;
29 int irq;
30 struct i2c_pnx_mif mif;
31 int last;
32};
33
34struct i2c_pnx_data {
35 int (*suspend) (struct platform_device *pdev, pm_message_t state);
36 int (*resume) (struct platform_device *pdev);
37 u32 (*calculate_input_freq) (struct platform_device *pdev);
38 int (*set_clock_run) (struct platform_device *pdev);
39 int (*set_clock_stop) (struct platform_device *pdev);
40 struct i2c_adapter *adapter;
41};
42
43#endif /* __I2C_PNX_H__ */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 9b5d04768c2c..71e50d3e492f 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -1,7 +1,7 @@
1/* ------------------------------------------------------------------------- */ 1/* ------------------------------------------------------------------------- */
2/* */ 2/* */
3/* i2c.h - definitions for the i2c-bus interface */ 3/* i2c.h - definitions for the i2c-bus interface */
4/* */ 4/* */
5/* ------------------------------------------------------------------------- */ 5/* ------------------------------------------------------------------------- */
6/* Copyright (C) 1995-2000 Simon G. Vogl 6/* Copyright (C) 1995-2000 Simon G. Vogl
7 7
@@ -27,7 +27,7 @@
27#define _LINUX_I2C_H 27#define _LINUX_I2C_H
28 28
29#include <linux/types.h> 29#include <linux/types.h>
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31#include <linux/module.h> 31#include <linux/module.h>
32#include <linux/i2c-id.h> 32#include <linux/i2c-id.h>
33#include <linux/mod_devicetable.h> 33#include <linux/mod_devicetable.h>
@@ -53,8 +53,8 @@ union i2c_smbus_data;
53 53
54/* 54/*
55 * The master routines are the ones normally used to transmit data to devices 55 * The master routines are the ones normally used to transmit data to devices
56 * on a bus (or read from them). Apart from two basic transfer functions to 56 * on a bus (or read from them). Apart from two basic transfer functions to
57 * transmit one message at a time, a more complex version can be used to 57 * transmit one message at a time, a more complex version can be used to
58 * transmit an arbitrary number of messages without interruption. 58 * transmit an arbitrary number of messages without interruption.
59 */ 59 */
60extern int i2c_master_send(struct i2c_client *,const char* ,int); 60extern int i2c_master_send(struct i2c_client *,const char* ,int);
@@ -67,10 +67,10 @@ extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
67 67
68/* This is the very generalized SMBus access routine. You probably do not 68/* This is the very generalized SMBus access routine. You probably do not
69 want to use this, though; one of the functions below may be much easier, 69 want to use this, though; one of the functions below may be much easier,
70 and probably just as fast. 70 and probably just as fast.
71 Note that we use i2c_adapter here, because you do not need a specific 71 Note that we use i2c_adapter here, because you do not need a specific
72 smbus adapter to call this function. */ 72 smbus adapter to call this function. */
73extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr, 73extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr,
74 unsigned short flags, 74 unsigned short flags,
75 char read_write, u8 command, int size, 75 char read_write, u8 command, int size,
76 union i2c_smbus_data * data); 76 union i2c_smbus_data * data);
@@ -112,14 +112,14 @@ struct i2c_driver {
112 112
113 /* Notifies the driver that a new bus has appeared. This routine 113 /* Notifies the driver that a new bus has appeared. This routine
114 * can be used by the driver to test if the bus meets its conditions 114 * can be used by the driver to test if the bus meets its conditions
115 * & seek for the presence of the chip(s) it supports. If found, it 115 * & seek for the presence of the chip(s) it supports. If found, it
116 * registers the client(s) that are on the bus to the i2c admin. via 116 * registers the client(s) that are on the bus to the i2c admin. via
117 * i2c_attach_client. 117 * i2c_attach_client.
118 */ 118 */
119 int (*attach_adapter)(struct i2c_adapter *); 119 int (*attach_adapter)(struct i2c_adapter *);
120 int (*detach_adapter)(struct i2c_adapter *); 120 int (*detach_adapter)(struct i2c_adapter *);
121 121
122 /* tells the driver that a client is about to be deleted & gives it 122 /* tells the driver that a client is about to be deleted & gives it
123 * the chance to remove its private data. Also, if the client struct 123 * the chance to remove its private data. Also, if the client struct
124 * has been dynamically allocated by the driver in the function above, 124 * has been dynamically allocated by the driver in the function above,
125 * it must be freed here. 125 * it must be freed here.
@@ -139,13 +139,13 @@ struct i2c_driver {
139#define I2C_NAME_SIZE 50 139#define I2C_NAME_SIZE 50
140 140
141/* 141/*
142 * i2c_client identifies a single device (i.e. chip) that is connected to an 142 * i2c_client identifies a single device (i.e. chip) that is connected to an
143 * i2c bus. The behaviour is defined by the routines of the driver. This 143 * i2c bus. The behaviour is defined by the routines of the driver. This
144 * function is mainly used for lookup & other admin. functions. 144 * function is mainly used for lookup & other admin. functions.
145 */ 145 */
146struct i2c_client { 146struct i2c_client {
147 unsigned int flags; /* div., see below */ 147 unsigned int flags; /* div., see below */
148 unsigned short addr; /* chip address - NOTE: 7bit */ 148 unsigned short addr; /* chip address - NOTE: 7bit */
149 /* addresses are stored in the */ 149 /* addresses are stored in the */
150 /* _LOWER_ 7 bits */ 150 /* _LOWER_ 7 bits */
151 struct i2c_adapter *adapter; /* the adapter we sit on */ 151 struct i2c_adapter *adapter; /* the adapter we sit on */
@@ -182,14 +182,14 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
182 */ 182 */
183struct i2c_algorithm { 183struct i2c_algorithm {
184 /* If an adapter algorithm can't do I2C-level access, set master_xfer 184 /* If an adapter algorithm can't do I2C-level access, set master_xfer
185 to NULL. If an adapter algorithm can do SMBus access, set 185 to NULL. If an adapter algorithm can do SMBus access, set
186 smbus_xfer. If set to NULL, the SMBus protocol is simulated 186 smbus_xfer. If set to NULL, the SMBus protocol is simulated
187 using common I2C messages */ 187 using common I2C messages */
188 /* master_xfer should return the number of messages successfully 188 /* master_xfer should return the number of messages successfully
189 processed, or a negative value on error */ 189 processed, or a negative value on error */
190 int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, 190 int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs,
191 int num); 191 int num);
192 int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, 192 int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
193 unsigned short flags, char read_write, 193 unsigned short flags, char read_write,
194 u8 command, int size, union i2c_smbus_data * data); 194 u8 command, int size, union i2c_smbus_data * data);
195 195
@@ -216,6 +216,7 @@ struct i2c_adapter {
216 int (*client_unregister)(struct i2c_client *); 216 int (*client_unregister)(struct i2c_client *);
217 217
218 /* data fields that are valid for all devices */ 218 /* data fields that are valid for all devices */
219 u8 level; /* nesting level for lockdep */
219 struct mutex bus_lock; 220 struct mutex bus_lock;
220 struct mutex clist_lock; 221 struct mutex clist_lock;
221 222
@@ -316,7 +317,7 @@ extern int i2c_check_addr (struct i2c_adapter *adapter, int addr);
316 * It will only call found_proc if some client is connected at the 317 * It will only call found_proc if some client is connected at the
317 * specific address (unless a 'force' matched); 318 * specific address (unless a 'force' matched);
318 */ 319 */
319extern int i2c_probe(struct i2c_adapter *adapter, 320extern int i2c_probe(struct i2c_adapter *adapter,
320 struct i2c_client_address_data *address_data, 321 struct i2c_client_address_data *address_data,
321 int (*found_proc) (struct i2c_adapter *, int, int)); 322 int (*found_proc) (struct i2c_adapter *, int, int));
322 323
@@ -352,15 +353,15 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
352 */ 353 */
353struct i2c_msg { 354struct i2c_msg {
354 __u16 addr; /* slave address */ 355 __u16 addr; /* slave address */
355 __u16 flags; 356 __u16 flags;
356#define I2C_M_TEN 0x10 /* we have a ten bit chip address */ 357#define I2C_M_TEN 0x10 /* we have a ten bit chip address */
357#define I2C_M_RD 0x01 358#define I2C_M_RD 0x01
358#define I2C_M_NOSTART 0x4000 359#define I2C_M_NOSTART 0x4000
359#define I2C_M_REV_DIR_ADDR 0x2000 360#define I2C_M_REV_DIR_ADDR 0x2000
360#define I2C_M_IGNORE_NAK 0x1000 361#define I2C_M_IGNORE_NAK 0x1000
361#define I2C_M_NO_RD_ACK 0x0800 362#define I2C_M_NO_RD_ACK 0x0800
362 __u16 len; /* msg length */ 363 __u16 len; /* msg length */
363 __u8 *buf; /* pointer to msg data */ 364 __u8 *buf; /* pointer to msg data */
364}; 365};
365 366
366/* To determine what functionality is present */ 367/* To determine what functionality is present */
@@ -370,16 +371,16 @@ struct i2c_msg {
370#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ 371#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
371#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ 372#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */
372#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ 373#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
373#define I2C_FUNC_SMBUS_QUICK 0x00010000 374#define I2C_FUNC_SMBUS_QUICK 0x00010000
374#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 375#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
375#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000 376#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
376#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000 377#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
377#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000 378#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
378#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000 379#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
379#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000 380#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
380#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000 381#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
381#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 382#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
382#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 383#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
383#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */ 384#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
384#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ 385#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
385#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ 386#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */
@@ -406,10 +407,10 @@ struct i2c_msg {
406 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ 407 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
407 I2C_FUNC_SMBUS_I2C_BLOCK) 408 I2C_FUNC_SMBUS_I2C_BLOCK)
408 409
409/* 410/*
410 * Data for SMBus Messages 411 * Data for SMBus Messages
411 */ 412 */
412#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ 413#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
413union i2c_smbus_data { 414union i2c_smbus_data {
414 __u8 byte; 415 __u8 byte;
415 __u16 word; 416 __u16 word;
@@ -421,11 +422,11 @@ union i2c_smbus_data {
421#define I2C_SMBUS_READ 1 422#define I2C_SMBUS_READ 1
422#define I2C_SMBUS_WRITE 0 423#define I2C_SMBUS_WRITE 0
423 424
424/* SMBus transaction types (size parameter in the above functions) 425/* SMBus transaction types (size parameter in the above functions)
425 Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */ 426 Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
426#define I2C_SMBUS_QUICK 0 427#define I2C_SMBUS_QUICK 0
427#define I2C_SMBUS_BYTE 1 428#define I2C_SMBUS_BYTE 1
428#define I2C_SMBUS_BYTE_DATA 2 429#define I2C_SMBUS_BYTE_DATA 2
429#define I2C_SMBUS_WORD_DATA 3 430#define I2C_SMBUS_WORD_DATA 3
430#define I2C_SMBUS_PROC_CALL 4 431#define I2C_SMBUS_PROC_CALL 4
431#define I2C_SMBUS_BLOCK_DATA 5 432#define I2C_SMBUS_BLOCK_DATA 5
@@ -434,15 +435,15 @@ union i2c_smbus_data {
434 435
435 436
436/* ----- commands for the ioctl like i2c_command call: 437/* ----- commands for the ioctl like i2c_command call:
437 * note that additional calls are defined in the algorithm and hw 438 * note that additional calls are defined in the algorithm and hw
438 * dependent layers - these can be listed here, or see the 439 * dependent layers - these can be listed here, or see the
439 * corresponding header files. 440 * corresponding header files.
440 */ 441 */
441 /* -> bit-adapter specific ioctls */ 442 /* -> bit-adapter specific ioctls */
442#define I2C_RETRIES 0x0701 /* number of times a device address */ 443#define I2C_RETRIES 0x0701 /* number of times a device address */
443 /* should be polled when not */ 444 /* should be polled when not */
444 /* acknowledging */ 445 /* acknowledging */
445#define I2C_TIMEOUT 0x0702 /* set timeout - call with int */ 446#define I2C_TIMEOUT 0x0702 /* set timeout - call with int */
446 447
447 448
448/* this is for i2c-dev.c */ 449/* this is for i2c-dev.c */
diff --git a/include/linux/i2o-dev.h b/include/linux/i2o-dev.h
index c2519df1b6dc..a0b23dd45239 100644
--- a/include/linux/i2o-dev.h
+++ b/include/linux/i2o-dev.h
@@ -24,12 +24,13 @@
24#define MAX_I2O_CONTROLLERS 32 24#define MAX_I2O_CONTROLLERS 32
25 25
26#include <linux/ioctl.h> 26#include <linux/ioctl.h>
27#include <linux/types.h>
27 28
28/* 29/*
29 * I2O Control IOCTLs and structures 30 * I2O Control IOCTLs and structures
30 */ 31 */
31#define I2O_MAGIC_NUMBER 'i' 32#define I2O_MAGIC_NUMBER 'i'
32#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,u8[MAX_I2O_CONTROLLERS]) 33#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,__u8[MAX_I2O_CONTROLLERS])
33#define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct) 34#define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct)
34#define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct) 35#define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct)
35#define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget) 36#define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget)
@@ -37,7 +38,7 @@
37#define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer) 38#define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer)
38#define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer) 39#define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer)
39#define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer) 40#define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer)
40#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,u32) 41#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,__u32)
41#define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html) 42#define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html)
42#define I2OEVTREG _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id) 43#define I2OEVTREG _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id)
43#define I2OEVTGET _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info) 44#define I2OEVTGET _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info)
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 9c2050293f17..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() */
@@ -796,6 +807,7 @@ typedef struct hwif_s {
796 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ 807 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
797 unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ 808 unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */
798 unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ 809 unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */
810 unsigned atapi_irq_bogon : 1; /* Generates spurious DMA interrupts in PIO mode */
799 811
800 struct device gendev; 812 struct device gendev;
801 struct completion gendev_rel_comp; /* To deal with device release() */ 813 struct completion gendev_rel_comp; /* To deal with device release() */
@@ -804,7 +816,9 @@ typedef struct hwif_s {
804 816
805 unsigned dma; 817 unsigned dma;
806 818
807 void (*led_act)(void *data, int rw); 819#ifdef CONFIG_BLK_DEV_IDEACPI
820 struct ide_acpi_hwif_link *acpidata;
821#endif
808} ____cacheline_internodealigned_in_smp ide_hwif_t; 822} ____cacheline_internodealigned_in_smp ide_hwif_t;
809 823
810/* 824/*
@@ -1193,8 +1207,8 @@ void ide_init_disk(struct gendisk *, ide_drive_t *);
1193extern int ideprobe_init(void); 1207extern int ideprobe_init(void);
1194 1208
1195extern void ide_scan_pcibus(int scan_direction) __init; 1209extern void ide_scan_pcibus(int scan_direction) __init;
1196extern 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);
1197#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)
1198void 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 *);
1199extern 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);
1200 1214
@@ -1299,6 +1313,18 @@ static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
1299static inline void ide_release_dma(ide_hwif_t *drive) {;} 1313static inline void ide_release_dma(ide_hwif_t *drive) {;}
1300#endif 1314#endif
1301 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
1302extern int ide_hwif_request_regions(ide_hwif_t *hwif); 1328extern int ide_hwif_request_regions(ide_hwif_t *hwif);
1303extern void ide_hwif_release_regions(ide_hwif_t* hwif); 1329extern void ide_hwif_release_regions(ide_hwif_t* hwif);
1304extern void ide_unregister (unsigned int index); 1330extern void ide_unregister (unsigned int index);
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h
index dbe8f6120a40..d557e4ce9b6b 100644
--- a/include/linux/if_addr.h
+++ b/include/linux/if_addr.h
@@ -52,4 +52,10 @@ struct ifa_cacheinfo
52 __u32 tstamp; /* updated timestamp, hundredths of seconds */ 52 __u32 tstamp; /* updated timestamp, hundredths of seconds */
53}; 53};
54 54
55/* backwards compatibility for userspace */
56#ifndef __KERNEL__
57#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
58#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
59#endif
60
55#endif 61#endif
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h
index e0a150046208..4aba6b0ad41c 100644
--- a/include/linux/if_fddi.h
+++ b/include/linux/if_fddi.h
@@ -103,6 +103,8 @@ struct fddihdr
103 } __attribute__ ((packed)); 103 } __attribute__ ((packed));
104 104
105#ifdef __KERNEL__ 105#ifdef __KERNEL__
106#include <linux/netdevice.h>
107
106/* Define FDDI statistics structure */ 108/* Define FDDI statistics structure */
107struct fddi_statistics { 109struct fddi_statistics {
108 110
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index e963a077e6f5..35ed3b5467f3 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -82,6 +82,12 @@ enum
82 82
83#define IFLA_MAX (__IFLA_MAX - 1) 83#define IFLA_MAX (__IFLA_MAX - 1)
84 84
85/* backwards compatibility for userspace */
86#ifndef __KERNEL__
87#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
88#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
89#endif
90
85/* ifi_flags. 91/* ifi_flags.
86 92
87 IFF_* flags. 93 IFF_* flags.
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/if_tunnel.h b/include/linux/if_tunnel.h
index 8de079ba1107..660b5010c2d9 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -1,6 +1,8 @@
1#ifndef _IF_TUNNEL_H_ 1#ifndef _IF_TUNNEL_H_
2#define _IF_TUNNEL_H_ 2#define _IF_TUNNEL_H_
3 3
4#include <linux/types.h>
5
4#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0) 6#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
5#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1) 7#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
6#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2) 8#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
diff --git a/include/linux/init.h b/include/linux/init.h
index 5eb5d24b7680..5a593a1dec1e 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -111,6 +111,7 @@ extern void setup_arch(char **);
111#define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s) 111#define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s)
112#define fs_initcall(fn) __define_initcall("5",fn,5) 112#define fs_initcall(fn) __define_initcall("5",fn,5)
113#define fs_initcall_sync(fn) __define_initcall("5s",fn,5s) 113#define fs_initcall_sync(fn) __define_initcall("5s",fn,5s)
114#define rootfs_initcall(fn) __define_initcall("rootfs",fn,rootfs)
114#define device_initcall(fn) __define_initcall("6",fn,6) 115#define device_initcall(fn) __define_initcall("6",fn,6)
115#define device_initcall_sync(fn) __define_initcall("6s",fn,6s) 116#define device_initcall_sync(fn) __define_initcall("6s",fn,6s)
116#define late_initcall(fn) __define_initcall("7",fn,7) 117#define late_initcall(fn) __define_initcall("7",fn,7)
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 733790d4f7db..6383d2d83bb0 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -7,16 +7,15 @@
7#include <linux/utsname.h> 7#include <linux/utsname.h>
8#include <linux/lockdep.h> 8#include <linux/lockdep.h>
9#include <linux/ipc.h> 9#include <linux/ipc.h>
10#include <linux/pid_namespace.h>
10 11
11#define INIT_FDTABLE \ 12#define INIT_FDTABLE \
12{ \ 13{ \
13 .max_fds = NR_OPEN_DEFAULT, \ 14 .max_fds = NR_OPEN_DEFAULT, \
14 .max_fdset = EMBEDDED_FD_SET_SIZE, \
15 .fd = &init_files.fd_array[0], \ 15 .fd = &init_files.fd_array[0], \
16 .close_on_exec = (fd_set *)&init_files.close_on_exec_init, \ 16 .close_on_exec = (fd_set *)&init_files.close_on_exec_init, \
17 .open_fds = (fd_set *)&init_files.open_fds_init, \ 17 .open_fds = (fd_set *)&init_files.open_fds_init, \
18 .rcu = RCU_HEAD_INIT, \ 18 .rcu = RCU_HEAD_INIT, \
19 .free_files = NULL, \
20 .next = NULL, \ 19 .next = NULL, \
21} 20}
22 21
@@ -57,25 +56,27 @@
57 .cpu_vm_mask = CPU_MASK_ALL, \ 56 .cpu_vm_mask = CPU_MASK_ALL, \
58} 57}
59 58
60#define INIT_SIGNALS(sig) { \ 59#define INIT_SIGNALS(sig) { \
61 .count = ATOMIC_INIT(1), \ 60 .count = ATOMIC_INIT(1), \
62 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ 61 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
63 .shared_pending = { \ 62 .shared_pending = { \
64 .list = LIST_HEAD_INIT(sig.shared_pending.list), \ 63 .list = LIST_HEAD_INIT(sig.shared_pending.list), \
65 .signal = {{0}}}, \ 64 .signal = {{0}}}, \
66 .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ 65 .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \
67 .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ 66 .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \
68 .rlim = INIT_RLIMITS, \ 67 .rlim = INIT_RLIMITS, \
69 .pgrp = 1, \ 68 .pgrp = 1, \
70 .session = 1, \ 69 .tty_old_pgrp = 0, \
70 { .__session = 1}, \
71} 71}
72 72
73extern struct nsproxy init_nsproxy; 73extern struct nsproxy init_nsproxy;
74#define INIT_NSPROXY(nsproxy) { \ 74#define INIT_NSPROXY(nsproxy) { \
75 .pid_ns = &init_pid_ns, \
75 .count = ATOMIC_INIT(1), \ 76 .count = ATOMIC_INIT(1), \
76 .nslock = __SPIN_LOCK_UNLOCKED(nsproxy.nslock), \ 77 .nslock = __SPIN_LOCK_UNLOCKED(nsproxy.nslock), \
77 .uts_ns = &init_uts_ns, \ 78 .uts_ns = &init_uts_ns, \
78 .namespace = NULL, \ 79 .mnt_ns = NULL, \
79 INIT_IPC_NS(ipc_ns) \ 80 INIT_IPC_NS(ipc_ns) \
80} 81}
81 82
diff --git a/include/linux/input.h b/include/linux/input.h
index 4e61158b06a0..bde65c8a3519 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -491,6 +491,21 @@ struct input_absinfo {
491#define KEY_DIGITS 0x19d 491#define KEY_DIGITS 0x19d
492#define KEY_TEEN 0x19e 492#define KEY_TEEN 0x19e
493#define KEY_TWEN 0x19f 493#define KEY_TWEN 0x19f
494#define KEY_VIDEOPHONE 0x1a0
495#define KEY_GAMES 0x1a1
496#define KEY_ZOOMIN 0x1a2
497#define KEY_ZOOMOUT 0x1a3
498#define KEY_ZOOMRESET 0x1a4
499#define KEY_WORDPROCESSOR 0x1a5
500#define KEY_EDITOR 0x1a6
501#define KEY_SPREADSHEET 0x1a7
502#define KEY_GRAPHICSEDITOR 0x1a8
503#define KEY_PRESENTATION 0x1a9
504#define KEY_DATABASE 0x1aa
505#define KEY_NEWS 0x1ab
506#define KEY_VOICEMAIL 0x1ac
507#define KEY_ADDRESSBOOK 0x1ad
508#define KEY_MESSENGER 0x1ae
494 509
495#define KEY_DEL_EOL 0x1c0 510#define KEY_DEL_EOL 0x1c0
496#define KEY_DEL_EOS 0x1c1 511#define KEY_DEL_EOS 0x1c1
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index de7593f4e895..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
@@ -231,7 +237,8 @@ enum
231 NET_TX_SOFTIRQ, 237 NET_TX_SOFTIRQ,
232 NET_RX_SOFTIRQ, 238 NET_RX_SOFTIRQ,
233 BLOCK_SOFTIRQ, 239 BLOCK_SOFTIRQ,
234 TASKLET_SOFTIRQ 240 TASKLET_SOFTIRQ,
241 SCHED_SOFTIRQ,
235}; 242};
236 243
237/* softirq mask and active fields moved to irq_cpustat_t in 244/* softirq mask and active fields moved to irq_cpustat_t in
diff --git a/include/linux/io.h b/include/linux/io.h
index 81877ea39309..9e419ebfc98b 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -22,12 +22,33 @@
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
46void __iomem * pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
47void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr);
48void __iomem * const * pcim_iomap_table(struct pci_dev *pdev);
49
50int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name);
51
31/** 52/**
32 * check_signature - find BIOS signatures 53 * check_signature - find BIOS signatures
33 * @io_addr: mmio address to check 54 * @io_addr: mmio address to check
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index cf8696d4a138..6859a3b14088 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -91,6 +91,9 @@ struct resource_list {
91#define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource field overlaid */ 91#define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource field overlaid */
92#define IORESOURCE_ROM_BIOS_COPY (1<<3) /* ROM is BIOS copy, resource field overlaid */ 92#define IORESOURCE_ROM_BIOS_COPY (1<<3) /* ROM is BIOS copy, resource field overlaid */
93 93
94/* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */
95#define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */
96
94/* PC/ISA/whatever - the normal PC address spaces: IO and memory */ 97/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
95extern struct resource ioport_resource; 98extern struct resource ioport_resource;
96extern struct resource iomem_resource; 99extern struct resource iomem_resource;
@@ -134,4 +137,24 @@ static inline int __deprecated check_region(resource_size_t s,
134{ 137{
135 return __check_region(&ioport_resource, s, n); 138 return __check_region(&ioport_resource, s, n);
136} 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
137#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/isdn.h b/include/linux/isdn.h
index 62991148d5a5..3c7875b7ab5b 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -511,8 +511,8 @@ typedef struct modem_info {
511#endif 511#endif
512 struct tty_struct *tty; /* Pointer to corresponding tty */ 512 struct tty_struct *tty; /* Pointer to corresponding tty */
513 atemu emu; /* AT-emulator data */ 513 atemu emu; /* AT-emulator data */
514 struct termios normal_termios; /* For saving termios structs */ 514 struct ktermios normal_termios; /* For saving termios structs */
515 struct termios callout_termios; 515 struct ktermios callout_termios;
516 wait_queue_head_t open_wait, close_wait; 516 wait_queue_head_t open_wait, close_wait;
517 struct semaphore write_sem; 517 struct semaphore write_sem;
518 spinlock_t readlock; 518 spinlock_t readlock;
@@ -525,8 +525,8 @@ typedef struct _isdn_modem {
525 int refcount; /* Number of opens */ 525 int refcount; /* Number of opens */
526 struct tty_driver *tty_modem; /* tty-device */ 526 struct tty_driver *tty_modem; /* tty-device */
527 struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */ 527 struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */
528 struct termios *modem_termios[ISDN_MAX_CHANNELS]; 528 struct ktermios *modem_termios[ISDN_MAX_CHANNELS];
529 struct termios *modem_termios_locked[ISDN_MAX_CHANNELS]; 529 struct ktermios *modem_termios_locked[ISDN_MAX_CHANNELS];
530 modem_info info[ISDN_MAX_CHANNELS]; /* Private data */ 530 modem_info info[ISDN_MAX_CHANNELS]; /* Private data */
531} isdn_modem_t; 531} isdn_modem_t;
532 532
diff --git a/include/linux/istallion.h b/include/linux/istallion.h
index b55e2a035605..106a5e85e5c4 100644
--- a/include/linux/istallion.h
+++ b/include/linux/istallion.h
@@ -49,13 +49,13 @@
49 * communication with the slave board will always be on a per port 49 * communication with the slave board will always be on a per port
50 * basis. 50 * basis.
51 */ 51 */
52typedef struct { 52struct stliport {
53 unsigned long magic; 53 unsigned long magic;
54 int portnr; 54 unsigned int portnr;
55 int panelnr; 55 unsigned int panelnr;
56 int brdnr; 56 unsigned int brdnr;
57 unsigned long state; 57 unsigned long state;
58 int devnr; 58 unsigned int devnr;
59 int flags; 59 int flags;
60 int baud_base; 60 int baud_base;
61 int custom_divisor; 61 int custom_divisor;
@@ -72,7 +72,7 @@ typedef struct {
72 wait_queue_head_t close_wait; 72 wait_queue_head_t close_wait;
73 wait_queue_head_t raw_wait; 73 wait_queue_head_t raw_wait;
74 struct work_struct tqhangup; 74 struct work_struct tqhangup;
75 asysigs_t asig; 75 struct asysigs asig;
76 unsigned long addr; 76 unsigned long addr;
77 unsigned long rxoffset; 77 unsigned long rxoffset;
78 unsigned long txoffset; 78 unsigned long txoffset;
@@ -83,31 +83,31 @@ typedef struct {
83 unsigned char reqbit; 83 unsigned char reqbit;
84 unsigned char portidx; 84 unsigned char portidx;
85 unsigned char portbit; 85 unsigned char portbit;
86} stliport_t; 86};
87 87
88/* 88/*
89 * Use a structure of function pointers to do board level operations. 89 * Use a structure of function pointers to do board level operations.
90 * These include, enable/disable, paging shared memory, interrupting, etc. 90 * These include, enable/disable, paging shared memory, interrupting, etc.
91 */ 91 */
92typedef struct stlibrd { 92struct stlibrd {
93 unsigned long magic; 93 unsigned long magic;
94 int brdnr; 94 unsigned int brdnr;
95 int brdtype; 95 unsigned int brdtype;
96 int state; 96 unsigned int state;
97 int nrpanels; 97 unsigned int nrpanels;
98 int nrports; 98 unsigned int nrports;
99 int nrdevs; 99 unsigned int nrdevs;
100 unsigned int iobase; 100 unsigned int iobase;
101 int iosize; 101 int iosize;
102 unsigned long memaddr; 102 unsigned long memaddr;
103 void __iomem *membase; 103 void __iomem *membase;
104 int memsize; 104 unsigned long memsize;
105 int pagesize; 105 int pagesize;
106 int hostoffset; 106 int hostoffset;
107 int slaveoffset; 107 int slaveoffset;
108 int bitsize; 108 int bitsize;
109 int enabval; 109 int enabval;
110 int panels[STL_MAXPANELS]; 110 unsigned int panels[STL_MAXPANELS];
111 int panelids[STL_MAXPANELS]; 111 int panelids[STL_MAXPANELS];
112 void (*init)(struct stlibrd *brdp); 112 void (*init)(struct stlibrd *brdp);
113 void (*enable)(struct stlibrd *brdp); 113 void (*enable)(struct stlibrd *brdp);
@@ -116,8 +116,8 @@ typedef struct stlibrd {
116 void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line); 116 void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line);
117 void (*intr)(struct stlibrd *brdp); 117 void (*intr)(struct stlibrd *brdp);
118 void (*reset)(struct stlibrd *brdp); 118 void (*reset)(struct stlibrd *brdp);
119 stliport_t *ports[STL_MAXPORTS]; 119 struct stliport *ports[STL_MAXPORTS];
120} stlibrd_t; 120};
121 121
122 122
123/* 123/*
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 6738283ac385..63fb18dcac30 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -13,10 +13,12 @@
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/compiler.h> 14#include <linux/compiler.h>
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/log2.h>
16#include <asm/byteorder.h> 17#include <asm/byteorder.h>
17#include <asm/bug.h> 18#include <asm/bug.h>
18 19
19extern const char linux_banner[]; 20extern const char linux_banner[];
21extern const char linux_proc_banner[];
20 22
21#define INT_MAX ((int)(~0U>>1)) 23#define INT_MAX ((int)(~0U>>1))
22#define INT_MIN (-INT_MAX - 1) 24#define INT_MIN (-INT_MAX - 1)
@@ -157,20 +159,6 @@ static inline int printk(const char *s, ...) { return 0; }
157 159
158unsigned long int_sqrt(unsigned long); 160unsigned long int_sqrt(unsigned long);
159 161
160static inline int __attribute_pure__ long_log2(unsigned long x)
161{
162 int r = 0;
163 for (x >>= 1; x > 0; x >>= 1)
164 r++;
165 return r;
166}
167
168static inline unsigned long
169__attribute_const__ roundup_pow_of_two(unsigned long x)
170{
171 return 1UL << fls_long(x - 1);
172}
173
174extern int printk_ratelimit(void); 162extern int printk_ratelimit(void);
175extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); 163extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
176extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, 164extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index d1c8d28fa92e..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 *);
@@ -265,8 +269,8 @@ extern int __must_check subsys_create_file(struct subsystem * ,
265 struct subsys_attribute *); 269 struct subsys_attribute *);
266 270
267#if defined(CONFIG_HOTPLUG) 271#if defined(CONFIG_HOTPLUG)
268void kobject_uevent(struct kobject *kobj, enum kobject_action action); 272int kobject_uevent(struct kobject *kobj, enum kobject_action action);
269void kobject_uevent_env(struct kobject *kobj, enum kobject_action action, 273int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
270 char *envp[]); 274 char *envp[]);
271 275
272int add_uevent_var(char **envp, int num_envp, int *cur_index, 276int add_uevent_var(char **envp, int num_envp, int *cur_index,
@@ -274,11 +278,12 @@ int add_uevent_var(char **envp, int num_envp, int *cur_index,
274 const char *format, ...) 278 const char *format, ...)
275 __attribute__((format (printf, 7, 8))); 279 __attribute__((format (printf, 7, 8)));
276#else 280#else
277static inline void kobject_uevent(struct kobject *kobj, enum kobject_action action) { } 281static inline int kobject_uevent(struct kobject *kobj, enum kobject_action action)
278static inline void kobject_uevent_env(struct kobject *kobj, 282{ return 0; }
283static inline int kobject_uevent_env(struct kobject *kobj,
279 enum kobject_action action, 284 enum kobject_action action,
280 char *envp[]) 285 char *envp[])
281{ } 286{ return 0; }
282 287
283static inline int add_uevent_var(char **envp, int num_envp, int *cur_index, 288static inline int add_uevent_var(char **envp, int num_envp, int *cur_index,
284 char *buffer, int buffer_size, int *cur_len, 289 char *buffer, int buffer_size, int *cur_len,
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
new file mode 100644
index 000000000000..1be148f0fce4
--- /dev/null
+++ b/include/linux/kvm.h
@@ -0,0 +1,240 @@
1#ifndef __LINUX_KVM_H
2#define __LINUX_KVM_H
3
4/*
5 * Userspace interface for /dev/kvm - kernel based virtual machine
6 *
7 * Note: this interface is considered experimental and may change without
8 * notice.
9 */
10
11#include <asm/types.h>
12#include <linux/ioctl.h>
13
14#define KVM_API_VERSION 2
15
16/*
17 * Architectural interrupt line count, and the size of the bitmap needed
18 * to hold them.
19 */
20#define KVM_NR_INTERRUPTS 256
21#define KVM_IRQ_BITMAP_SIZE_BYTES ((KVM_NR_INTERRUPTS + 7) / 8)
22#define KVM_IRQ_BITMAP_SIZE(type) (KVM_IRQ_BITMAP_SIZE_BYTES / sizeof(type))
23
24
25/* for KVM_CREATE_MEMORY_REGION */
26struct kvm_memory_region {
27 __u32 slot;
28 __u32 flags;
29 __u64 guest_phys_addr;
30 __u64 memory_size; /* bytes */
31};
32
33/* for kvm_memory_region::flags */
34#define KVM_MEM_LOG_DIRTY_PAGES 1UL
35
36
37#define KVM_EXIT_TYPE_FAIL_ENTRY 1
38#define KVM_EXIT_TYPE_VM_EXIT 2
39
40enum kvm_exit_reason {
41 KVM_EXIT_UNKNOWN = 0,
42 KVM_EXIT_EXCEPTION = 1,
43 KVM_EXIT_IO = 2,
44 KVM_EXIT_CPUID = 3,
45 KVM_EXIT_DEBUG = 4,
46 KVM_EXIT_HLT = 5,
47 KVM_EXIT_MMIO = 6,
48 KVM_EXIT_IRQ_WINDOW_OPEN = 7,
49 KVM_EXIT_SHUTDOWN = 8,
50};
51
52/* for KVM_RUN */
53struct kvm_run {
54 /* in */
55 __u32 vcpu;
56 __u32 emulated; /* skip current instruction */
57 __u32 mmio_completed; /* mmio request completed */
58 __u8 request_interrupt_window;
59 __u8 padding1[3];
60
61 /* out */
62 __u32 exit_type;
63 __u32 exit_reason;
64 __u32 instruction_length;
65 __u8 ready_for_interrupt_injection;
66 __u8 if_flag;
67 __u16 padding2;
68 __u64 cr8;
69 __u64 apic_base;
70
71 union {
72 /* KVM_EXIT_UNKNOWN */
73 struct {
74 __u32 hardware_exit_reason;
75 } hw;
76 /* KVM_EXIT_EXCEPTION */
77 struct {
78 __u32 exception;
79 __u32 error_code;
80 } ex;
81 /* KVM_EXIT_IO */
82 struct {
83#define KVM_EXIT_IO_IN 0
84#define KVM_EXIT_IO_OUT 1
85 __u8 direction;
86 __u8 size; /* bytes */
87 __u8 string;
88 __u8 string_down;
89 __u8 rep;
90 __u8 pad;
91 __u16 port;
92 __u64 count;
93 union {
94 __u64 address;
95 __u32 value;
96 };
97 } io;
98 struct {
99 } debug;
100 /* KVM_EXIT_MMIO */
101 struct {
102 __u64 phys_addr;
103 __u8 data[8];
104 __u32 len;
105 __u8 is_write;
106 } mmio;
107 };
108};
109
110/* for KVM_GET_REGS and KVM_SET_REGS */
111struct kvm_regs {
112 /* in */
113 __u32 vcpu;
114 __u32 padding;
115
116 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
117 __u64 rax, rbx, rcx, rdx;
118 __u64 rsi, rdi, rsp, rbp;
119 __u64 r8, r9, r10, r11;
120 __u64 r12, r13, r14, r15;
121 __u64 rip, rflags;
122};
123
124struct kvm_segment {
125 __u64 base;
126 __u32 limit;
127 __u16 selector;
128 __u8 type;
129 __u8 present, dpl, db, s, l, g, avl;
130 __u8 unusable;
131 __u8 padding;
132};
133
134struct kvm_dtable {
135 __u64 base;
136 __u16 limit;
137 __u16 padding[3];
138};
139
140/* for KVM_GET_SREGS and KVM_SET_SREGS */
141struct kvm_sregs {
142 /* in */
143 __u32 vcpu;
144 __u32 padding;
145
146 /* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */
147 struct kvm_segment cs, ds, es, fs, gs, ss;
148 struct kvm_segment tr, ldt;
149 struct kvm_dtable gdt, idt;
150 __u64 cr0, cr2, cr3, cr4, cr8;
151 __u64 efer;
152 __u64 apic_base;
153 __u64 interrupt_bitmap[KVM_IRQ_BITMAP_SIZE(__u64)];
154};
155
156struct kvm_msr_entry {
157 __u32 index;
158 __u32 reserved;
159 __u64 data;
160};
161
162/* for KVM_GET_MSRS and KVM_SET_MSRS */
163struct kvm_msrs {
164 __u32 vcpu;
165 __u32 nmsrs; /* number of msrs in entries */
166
167 struct kvm_msr_entry entries[0];
168};
169
170/* for KVM_GET_MSR_INDEX_LIST */
171struct kvm_msr_list {
172 __u32 nmsrs; /* number of msrs in entries */
173 __u32 indices[0];
174};
175
176/* for KVM_TRANSLATE */
177struct kvm_translation {
178 /* in */
179 __u64 linear_address;
180 __u32 vcpu;
181 __u32 padding;
182
183 /* out */
184 __u64 physical_address;
185 __u8 valid;
186 __u8 writeable;
187 __u8 usermode;
188};
189
190/* for KVM_INTERRUPT */
191struct kvm_interrupt {
192 /* in */
193 __u32 vcpu;
194 __u32 irq;
195};
196
197struct kvm_breakpoint {
198 __u32 enabled;
199 __u32 padding;
200 __u64 address;
201};
202
203/* for KVM_DEBUG_GUEST */
204struct kvm_debug_guest {
205 /* int */
206 __u32 vcpu;
207 __u32 enabled;
208 struct kvm_breakpoint breakpoints[4];
209 __u32 singlestep;
210};
211
212/* for KVM_GET_DIRTY_LOG */
213struct kvm_dirty_log {
214 __u32 slot;
215 __u32 padding;
216 union {
217 void __user *dirty_bitmap; /* one bit per page */
218 __u64 padding;
219 };
220};
221
222#define KVMIO 0xAE
223
224#define KVM_GET_API_VERSION _IO(KVMIO, 1)
225#define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run)
226#define KVM_GET_REGS _IOWR(KVMIO, 3, struct kvm_regs)
227#define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs)
228#define KVM_GET_SREGS _IOWR(KVMIO, 5, struct kvm_sregs)
229#define KVM_SET_SREGS _IOW(KVMIO, 6, struct kvm_sregs)
230#define KVM_TRANSLATE _IOWR(KVMIO, 7, struct kvm_translation)
231#define KVM_INTERRUPT _IOW(KVMIO, 8, struct kvm_interrupt)
232#define KVM_DEBUG_GUEST _IOW(KVMIO, 9, struct kvm_debug_guest)
233#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 10, struct kvm_memory_region)
234#define KVM_CREATE_VCPU _IOW(KVMIO, 11, int /* vcpu_slot */)
235#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 12, struct kvm_dirty_log)
236#define KVM_GET_MSRS _IOWR(KVMIO, 13, struct kvm_msrs)
237#define KVM_SET_MSRS _IOWR(KVMIO, 14, struct kvm_msrs)
238#define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 15, struct kvm_msr_list)
239
240#endif
diff --git a/include/linux/libata.h b/include/linux/libata.h
index ab2754830322..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;
@@ -177,6 +171,7 @@ enum {
177 * Register FIS clearing BSY */ 171 * Register FIS clearing BSY */
178 ATA_FLAG_DEBUGMSG = (1 << 13), 172 ATA_FLAG_DEBUGMSG = (1 << 13),
179 ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ 173 ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */
174 ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */
180 175
181 /* The following flag belongs to ap->pflags but is kept in 176 /* The following flag belongs to ap->pflags but is kept in
182 * ap->flags because it's referenced in many LLDs and will be 177 * ap->flags because it's referenced in many LLDs and will be
@@ -307,7 +302,7 @@ enum {
307 * most devices. 302 * most devices.
308 */ 303 */
309 ATA_SPINUP_WAIT = 8000, 304 ATA_SPINUP_WAIT = 8000,
310 305
311 /* Horkage types. May be set by libata or controller on drives 306 /* Horkage types. May be set by libata or controller on drives
312 (some horkage may be drive/controller pair dependant */ 307 (some horkage may be drive/controller pair dependant */
313 308
@@ -351,21 +346,21 @@ typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes);
351typedef 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);
352 347
353struct ata_ioports { 348struct ata_ioports {
354 unsigned long cmd_addr; 349 void __iomem *cmd_addr;
355 unsigned long data_addr; 350 void __iomem *data_addr;
356 unsigned long error_addr; 351 void __iomem *error_addr;
357 unsigned long feature_addr; 352 void __iomem *feature_addr;
358 unsigned long nsect_addr; 353 void __iomem *nsect_addr;
359 unsigned long lbal_addr; 354 void __iomem *lbal_addr;
360 unsigned long lbam_addr; 355 void __iomem *lbam_addr;
361 unsigned long lbah_addr; 356 void __iomem *lbah_addr;
362 unsigned long device_addr; 357 void __iomem *device_addr;
363 unsigned long status_addr; 358 void __iomem *status_addr;
364 unsigned long command_addr; 359 void __iomem *command_addr;
365 unsigned long altstatus_addr; 360 void __iomem *altstatus_addr;
366 unsigned long ctl_addr; 361 void __iomem *ctl_addr;
367 unsigned long bmdma_addr; 362 void __iomem *bmdma_addr;
368 unsigned long scr_addr; 363 void __iomem *scr_addr;
369}; 364};
370 365
371struct ata_probe_ent { 366struct ata_probe_ent {
@@ -384,7 +379,7 @@ struct ata_probe_ent {
384 unsigned int irq_flags; 379 unsigned int irq_flags;
385 unsigned long port_flags; 380 unsigned long port_flags;
386 unsigned long _host_flags; 381 unsigned long _host_flags;
387 void __iomem *mmio_base; 382 void __iomem * const *iomap;
388 void *private_data; 383 void *private_data;
389 384
390 /* port_info for the secondary port. Together with irq2, it's 385 /* port_info for the secondary port. Together with irq2, it's
@@ -401,7 +396,7 @@ struct ata_host {
401 struct device *dev; 396 struct device *dev;
402 unsigned long irq; 397 unsigned long irq;
403 unsigned long irq2; 398 unsigned long irq2;
404 void __iomem *mmio_base; 399 void __iomem * const *iomap;
405 unsigned int n_ports; 400 unsigned int n_ports;
406 void *private_data; 401 void *private_data;
407 const struct ata_port_operations *ops; 402 const struct ata_port_operations *ops;
@@ -430,9 +425,6 @@ struct ata_queued_cmd {
430 425
431 unsigned int pad_len; 426 unsigned int pad_len;
432 427
433 unsigned int nsect;
434 unsigned int cursect;
435
436 unsigned int nbytes; 428 unsigned int nbytes;
437 unsigned int curbytes; 429 unsigned int curbytes;
438 430
@@ -612,11 +604,11 @@ struct ata_port_operations {
612 void (*dev_select)(struct ata_port *ap, unsigned int device); 604 void (*dev_select)(struct ata_port *ap, unsigned int device);
613 605
614 void (*phy_reset) (struct ata_port *ap); /* obsolete */ 606 void (*phy_reset) (struct ata_port *ap); /* obsolete */
615 void (*set_mode) (struct ata_port *ap); 607 int (*set_mode) (struct ata_port *ap, struct ata_device **r_failed_dev);
616 608
617 void (*post_set_mode) (struct ata_port *ap); 609 void (*post_set_mode) (struct ata_port *ap);
618 610
619 int (*check_atapi_dma) (struct ata_queued_cmd *qc); 611 int (*check_atapi_dma) (struct ata_queued_cmd *qc);
620 612
621 void (*bmdma_setup) (struct ata_queued_cmd *qc); 613 void (*bmdma_setup) (struct ata_queued_cmd *qc);
622 void (*bmdma_start) (struct ata_queued_cmd *qc); 614 void (*bmdma_start) (struct ata_queued_cmd *qc);
@@ -638,6 +630,8 @@ struct ata_port_operations {
638 630
639 irq_handler_t irq_handler; 631 irq_handler_t irq_handler;
640 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);
641 635
642 u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); 636 u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
643 void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 637 void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
@@ -719,20 +713,18 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i
719 unsigned int n_ports); 713 unsigned int n_ports);
720extern void ata_pci_remove_one (struct pci_dev *pdev); 714extern void ata_pci_remove_one (struct pci_dev *pdev);
721extern 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);
722extern void ata_pci_device_do_resume(struct pci_dev *pdev); 716extern int __must_check ata_pci_device_do_resume(struct pci_dev *pdev);
723extern 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);
724extern int ata_pci_device_resume(struct pci_dev *pdev); 718extern int ata_pci_device_resume(struct pci_dev *pdev);
725extern int ata_pci_clear_simplex(struct pci_dev *pdev); 719extern int ata_pci_clear_simplex(struct pci_dev *pdev);
726#endif /* CONFIG_PCI */ 720#endif /* CONFIG_PCI */
727extern int ata_device_add(const struct ata_probe_ent *ent); 721extern int ata_device_add(const struct ata_probe_ent *ent);
728extern void ata_port_detach(struct ata_port *ap); 722extern void ata_host_detach(struct ata_host *host);
729extern void ata_host_init(struct ata_host *, struct device *, 723extern void ata_host_init(struct ata_host *, struct device *,
730 unsigned long, const struct ata_port_operations *); 724 unsigned long, const struct ata_port_operations *);
731extern void ata_host_remove(struct ata_host *host);
732extern int ata_scsi_detect(struct scsi_host_template *sht); 725extern int ata_scsi_detect(struct scsi_host_template *sht);
733extern 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);
734extern 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 *));
735extern int ata_scsi_release(struct Scsi_Host *host);
736extern void ata_sas_port_destroy(struct ata_port *); 728extern void ata_sas_port_destroy(struct ata_port *);
737extern struct ata_port *ata_sas_port_alloc(struct ata_host *, 729extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
738 struct ata_port_info *, struct Scsi_Host *); 730 struct ata_port_info *, struct Scsi_Host *);
@@ -775,15 +767,11 @@ extern u8 ata_check_status(struct ata_port *ap);
775extern u8 ata_altstatus(struct ata_port *ap); 767extern u8 ata_altstatus(struct ata_port *ap);
776extern 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);
777extern int ata_port_start (struct ata_port *ap); 769extern int ata_port_start (struct ata_port *ap);
778extern void ata_port_stop (struct ata_port *ap);
779extern void ata_host_stop (struct ata_host *host);
780extern irqreturn_t ata_interrupt (int irq, void *dev_instance); 770extern irqreturn_t ata_interrupt (int irq, void *dev_instance);
781extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf, 771extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf,
782 unsigned int buflen, int write_data); 772 unsigned int buflen, int write_data);
783extern 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,
784 unsigned int buflen, int write_data); 774 unsigned int buflen, int write_data);
785extern void ata_pio_data_xfer_noirq(struct ata_device *adev, unsigned char *buf,
786 unsigned int buflen, int write_data);
787extern void ata_qc_prep(struct ata_queued_cmd *qc); 775extern void ata_qc_prep(struct ata_queued_cmd *qc);
788extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); 776extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
789extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); 777extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc);
@@ -825,6 +813,10 @@ extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
825extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, 813extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
826 int queue_depth); 814 int queue_depth);
827extern 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);
828 820
829/* 821/*
830 * Timing helpers 822 * Timing helpers
@@ -863,7 +855,6 @@ struct pci_bits {
863 unsigned long val; 855 unsigned long val;
864}; 856};
865 857
866extern void ata_pci_host_stop (struct ata_host *host);
867extern struct ata_probe_ent * 858extern struct ata_probe_ent *
868ata_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);
869extern 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);
@@ -1053,6 +1044,8 @@ static inline void ata_pause(struct ata_port *ap)
1053/** 1044/**
1054 * ata_busy_wait - Wait for a port status register 1045 * ata_busy_wait - Wait for a port status register
1055 * @ap: Port to wait for. 1046 * @ap: Port to wait for.
1047 * @bits: bits that must be clear
1048 * @max: number of 10uS waits to perform
1056 * 1049 *
1057 * Waits up to max*10 microseconds for the selected bits in the port's 1050 * Waits up to max*10 microseconds for the selected bits in the port's
1058 * status register to be cleared. 1051 * status register to be cleared.
@@ -1093,10 +1086,9 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
1093 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); 1086 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
1094 1087
1095 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) { 1088 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) {
1096 unsigned long l = ap->ioaddr.status_addr;
1097 if (ata_msg_warn(ap)) 1089 if (ata_msg_warn(ap))
1098 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",
1099 status, l); 1091 status, ap->ioaddr.status_addr);
1100 } 1092 }
1101 1093
1102 return status; 1094 return status;
@@ -1143,12 +1135,14 @@ static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf)
1143 1135
1144static inline void ata_qc_reinit(struct ata_queued_cmd *qc) 1136static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1145{ 1137{
1138 qc->dma_dir = DMA_NONE;
1146 qc->__sg = NULL; 1139 qc->__sg = NULL;
1147 qc->flags = 0; 1140 qc->flags = 0;
1148 qc->cursect = qc->cursg = qc->cursg_ofs = 0; 1141 qc->cursg = qc->cursg_ofs = 0;
1149 qc->nsect = 0;
1150 qc->nbytes = qc->curbytes = 0; 1142 qc->nbytes = qc->curbytes = 0;
1143 qc->n_elem = 0;
1151 qc->err_mask = 0; 1144 qc->err_mask = 0;
1145 qc->pad_len = 0;
1152 1146
1153 ata_tf_init(qc->dev, &qc->tf); 1147 ata_tf_init(qc->dev, &qc->tf);
1154 1148
@@ -1157,51 +1151,6 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1157 qc->result_tf.feature = 0; 1151 qc->result_tf.feature = 0;
1158} 1152}
1159 1153
1160/**
1161 * ata_irq_ack - Acknowledge a device interrupt.
1162 * @ap: Port on which interrupts are enabled.
1163 *
1164 * Wait up to 10 ms for legacy IDE device to become idle (BUSY
1165 * or BUSY+DRQ clear). Obtain dma status and port status from
1166 * device. Clear the interrupt. Return port status.
1167 *
1168 * LOCKING:
1169 */
1170
1171static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
1172{
1173 unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY;
1174 u8 host_stat, post_stat, status;
1175
1176 status = ata_busy_wait(ap, bits, 1000);
1177 if (status & bits)
1178 if (ata_msg_err(ap))
1179 printk(KERN_ERR "abnormal status 0x%X\n", status);
1180
1181 /* get controller status; clear intr, err bits */
1182 if (ap->flags & ATA_FLAG_MMIO) {
1183 void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
1184 host_stat = readb(mmio + ATA_DMA_STATUS);
1185 writeb(host_stat | ATA_DMA_INTR | ATA_DMA_ERR,
1186 mmio + ATA_DMA_STATUS);
1187
1188 post_stat = readb(mmio + ATA_DMA_STATUS);
1189 } else {
1190 host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
1191 outb(host_stat | ATA_DMA_INTR | ATA_DMA_ERR,
1192 ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
1193
1194 post_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
1195 }
1196
1197 if (ata_msg_intr(ap))
1198 printk(KERN_INFO "%s: irq ack: host_stat 0x%X, new host_stat 0x%X, drv_stat 0x%X\n",
1199 __FUNCTION__,
1200 host_stat, post_stat, status);
1201
1202 return status;
1203}
1204
1205static inline int ata_try_flush_cache(const struct ata_device *dev) 1154static inline int ata_try_flush_cache(const struct ata_device *dev)
1206{ 1155{
1207 return ata_id_wcache_enabled(dev->id) || 1156 return ata_id_wcache_enabled(dev->id) ||
@@ -1229,14 +1178,14 @@ static inline unsigned int __ac_err_mask(u8 status)
1229static 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)
1230{ 1179{
1231 ap->pad_dma = 0; 1180 ap->pad_dma = 0;
1232 ap->pad = dma_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ, 1181 ap->pad = dmam_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ,
1233 &ap->pad_dma, GFP_KERNEL); 1182 &ap->pad_dma, GFP_KERNEL);
1234 return (ap->pad == NULL) ? -ENOMEM : 0; 1183 return (ap->pad == NULL) ? -ENOMEM : 0;
1235} 1184}
1236 1185
1237static 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)
1238{ 1187{
1239 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);
1240} 1189}
1241 1190
1242static 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 a9c90287c0ff..611059d633f4 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -227,13 +227,13 @@ static inline void list_replace_init(struct list_head *old,
227 INIT_LIST_HEAD(old); 227 INIT_LIST_HEAD(old);
228} 228}
229 229
230/* 230/**
231 * list_replace_rcu - replace old entry by new one 231 * list_replace_rcu - replace old entry by new one
232 * @old : the element to be replaced 232 * @old : the element to be replaced
233 * @new : the new element to insert 233 * @new : the new element to insert
234 * 234 *
235 * The old entry will be replaced with the new entry atomically. 235 * The @old entry will be replaced with the @new entry atomically.
236 * Note: 'old' should not be empty. 236 * Note: @old should not be empty.
237 */ 237 */
238static inline void list_replace_rcu(struct list_head *old, 238static inline void list_replace_rcu(struct list_head *old,
239 struct list_head *new) 239 struct list_head *new)
@@ -680,12 +680,12 @@ static inline void hlist_del_init(struct hlist_node *n)
680 } 680 }
681} 681}
682 682
683/* 683/**
684 * hlist_replace_rcu - replace old entry by new one 684 * hlist_replace_rcu - replace old entry by new one
685 * @old : the element to be replaced 685 * @old : the element to be replaced
686 * @new : the new element to insert 686 * @new : the new element to insert
687 * 687 *
688 * The old entry will be replaced with the new entry atomically. 688 * The @old entry will be replaced with the @new entry atomically.
689 */ 689 */
690static inline void hlist_replace_rcu(struct hlist_node *old, 690static inline void hlist_replace_rcu(struct hlist_node *old,
691 struct hlist_node *new) 691 struct hlist_node *new)
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
index aa50d89eacd7..246de1d84a26 100644
--- a/include/linux/lockd/bind.h
+++ b/include/linux/lockd/bind.h
@@ -23,7 +23,7 @@ struct svc_rqst;
23 * This is the set of functions for lockd->nfsd communication 23 * This is the set of functions for lockd->nfsd communication
24 */ 24 */
25struct nlmsvc_binding { 25struct nlmsvc_binding {
26 u32 (*fopen)(struct svc_rqst *, 26 __be32 (*fopen)(struct svc_rqst *,
27 struct nfs_fh *, 27 struct nfs_fh *,
28 struct file **); 28 struct file **);
29 void (*fclose)(struct file *); 29 void (*fclose)(struct file *);
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 8c39654549d8..ac25b5649c59 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -191,7 +191,7 @@ __be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
191unsigned long nlmsvc_retry_blocked(void); 191unsigned long nlmsvc_retry_blocked(void);
192void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, 192void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
193 nlm_host_match_fn_t match); 193 nlm_host_match_fn_t match);
194void nlmsvc_grant_reply(struct nlm_cookie *, u32); 194void nlmsvc_grant_reply(struct nlm_cookie *, __be32);
195 195
196/* 196/*
197 * File handling for the server personality 197 * File handling for the server personality
@@ -206,7 +206,7 @@ void nlmsvc_invalidate_all(void);
206static __inline__ struct inode * 206static __inline__ struct inode *
207nlmsvc_file_inode(struct nlm_file *file) 207nlmsvc_file_inode(struct nlm_file *file)
208{ 208{
209 return file->f_file->f_dentry->d_inode; 209 return file->f_file->f_path.dentry->d_inode;
210} 210}
211 211
212/* 212/*
diff --git a/include/linux/lockd/sm_inter.h b/include/linux/lockd/sm_inter.h
index fc61d40964da..22a645828f26 100644
--- a/include/linux/lockd/sm_inter.h
+++ b/include/linux/lockd/sm_inter.h
@@ -24,7 +24,7 @@
24 * Arguments for all calls to statd 24 * Arguments for all calls to statd
25 */ 25 */
26struct nsm_args { 26struct nsm_args {
27 u32 addr; /* remote address */ 27 __be32 addr; /* remote address */
28 u32 prog; /* RPC callback info */ 28 u32 prog; /* RPC callback info */
29 u32 vers; 29 u32 vers;
30 u32 proc; 30 u32 proc;
diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h
index 29e7d9fc9dad..83a1f9f6237b 100644
--- a/include/linux/lockd/xdr.h
+++ b/include/linux/lockd/xdr.h
@@ -69,7 +69,7 @@ typedef struct nlm_args nlm_args;
69 */ 69 */
70struct nlm_res { 70struct nlm_res {
71 struct nlm_cookie cookie; 71 struct nlm_cookie cookie;
72 u32 status; 72 __be32 status;
73 struct nlm_lock lock; 73 struct nlm_lock lock;
74}; 74};
75 75
@@ -80,9 +80,9 @@ struct nlm_reboot {
80 char * mon; 80 char * mon;
81 int len; 81 int len;
82 u32 state; 82 u32 state;
83 u32 addr; 83 __be32 addr;
84 u32 vers; 84 __be32 vers;
85 u32 proto; 85 __be32 proto;
86}; 86};
87 87
88/* 88/*
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 498bfbd3b4e1..ea097dddc44f 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -281,15 +281,25 @@ struct lock_class_key { };
281#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS) 281#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS)
282extern void early_init_irq_lock_class(void); 282extern void early_init_irq_lock_class(void);
283#else 283#else
284# define early_init_irq_lock_class() do { } while (0) 284static inline void early_init_irq_lock_class(void)
285{
286}
285#endif 287#endif
286 288
287#ifdef CONFIG_TRACE_IRQFLAGS 289#ifdef CONFIG_TRACE_IRQFLAGS
288extern void early_boot_irqs_off(void); 290extern void early_boot_irqs_off(void);
289extern void early_boot_irqs_on(void); 291extern void early_boot_irqs_on(void);
292extern void print_irqtrace_events(struct task_struct *curr);
290#else 293#else
291# define early_boot_irqs_off() do { } while (0) 294static inline void early_boot_irqs_off(void)
292# define early_boot_irqs_on() do { } while (0) 295{
296}
297static inline void early_boot_irqs_on(void)
298{
299}
300static inline void print_irqtrace_events(struct task_struct *curr)
301{
302}
293#endif 303#endif
294 304
295/* 305/*
diff --git a/include/linux/log2.h b/include/linux/log2.h
new file mode 100644
index 000000000000..99922bedfcc9
--- /dev/null
+++ b/include/linux/log2.h
@@ -0,0 +1,168 @@
1/* Integer base 2 logarithm calculation
2 *
3 * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef _LINUX_LOG2_H
13#define _LINUX_LOG2_H
14
15#include <linux/types.h>
16#include <linux/bitops.h>
17
18/*
19 * deal with unrepresentable constant logarithms
20 */
21extern __attribute__((const, noreturn))
22int ____ilog2_NaN(void);
23
24/*
25 * non-constant log of base 2 calculators
26 * - the arch may override these in asm/bitops.h if they can be implemented
27 * more efficiently than using fls() and fls64()
28 * - the arch is not required to handle n==0 if implementing the fallback
29 */
30#ifndef CONFIG_ARCH_HAS_ILOG2_U32
31static inline __attribute__((const))
32int __ilog2_u32(u32 n)
33{
34 return fls(n) - 1;
35}
36#endif
37
38#ifndef CONFIG_ARCH_HAS_ILOG2_U64
39static inline __attribute__((const))
40int __ilog2_u64(u64 n)
41{
42 return fls64(n) - 1;
43}
44#endif
45
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/*
58 * round up to nearest power of two
59 */
60static inline __attribute__((const))
61unsigned long __roundup_pow_of_two(unsigned long n)
62{
63 return 1UL << fls_long(n - 1);
64}
65
66/**
67 * ilog2 - log of base 2 of 32-bit or a 64-bit unsigned value
68 * @n - parameter
69 *
70 * constant-capable log of base 2 calculation
71 * - this can be used to initialise global variables from constant data, hence
72 * the massive ternary operator construction
73 *
74 * selects the appropriately-sized optimised version depending on sizeof(n)
75 */
76#define ilog2(n) \
77( \
78 __builtin_constant_p(n) ? ( \
79 (n) < 1 ? ____ilog2_NaN() : \
80 (n) & (1ULL << 63) ? 63 : \
81 (n) & (1ULL << 62) ? 62 : \
82 (n) & (1ULL << 61) ? 61 : \
83 (n) & (1ULL << 60) ? 60 : \
84 (n) & (1ULL << 59) ? 59 : \
85 (n) & (1ULL << 58) ? 58 : \
86 (n) & (1ULL << 57) ? 57 : \
87 (n) & (1ULL << 56) ? 56 : \
88 (n) & (1ULL << 55) ? 55 : \
89 (n) & (1ULL << 54) ? 54 : \
90 (n) & (1ULL << 53) ? 53 : \
91 (n) & (1ULL << 52) ? 52 : \
92 (n) & (1ULL << 51) ? 51 : \
93 (n) & (1ULL << 50) ? 50 : \
94 (n) & (1ULL << 49) ? 49 : \
95 (n) & (1ULL << 48) ? 48 : \
96 (n) & (1ULL << 47) ? 47 : \
97 (n) & (1ULL << 46) ? 46 : \
98 (n) & (1ULL << 45) ? 45 : \
99 (n) & (1ULL << 44) ? 44 : \
100 (n) & (1ULL << 43) ? 43 : \
101 (n) & (1ULL << 42) ? 42 : \
102 (n) & (1ULL << 41) ? 41 : \
103 (n) & (1ULL << 40) ? 40 : \
104 (n) & (1ULL << 39) ? 39 : \
105 (n) & (1ULL << 38) ? 38 : \
106 (n) & (1ULL << 37) ? 37 : \
107 (n) & (1ULL << 36) ? 36 : \
108 (n) & (1ULL << 35) ? 35 : \
109 (n) & (1ULL << 34) ? 34 : \
110 (n) & (1ULL << 33) ? 33 : \
111 (n) & (1ULL << 32) ? 32 : \
112 (n) & (1ULL << 31) ? 31 : \
113 (n) & (1ULL << 30) ? 30 : \
114 (n) & (1ULL << 29) ? 29 : \
115 (n) & (1ULL << 28) ? 28 : \
116 (n) & (1ULL << 27) ? 27 : \
117 (n) & (1ULL << 26) ? 26 : \
118 (n) & (1ULL << 25) ? 25 : \
119 (n) & (1ULL << 24) ? 24 : \
120 (n) & (1ULL << 23) ? 23 : \
121 (n) & (1ULL << 22) ? 22 : \
122 (n) & (1ULL << 21) ? 21 : \
123 (n) & (1ULL << 20) ? 20 : \
124 (n) & (1ULL << 19) ? 19 : \
125 (n) & (1ULL << 18) ? 18 : \
126 (n) & (1ULL << 17) ? 17 : \
127 (n) & (1ULL << 16) ? 16 : \
128 (n) & (1ULL << 15) ? 15 : \
129 (n) & (1ULL << 14) ? 14 : \
130 (n) & (1ULL << 13) ? 13 : \
131 (n) & (1ULL << 12) ? 12 : \
132 (n) & (1ULL << 11) ? 11 : \
133 (n) & (1ULL << 10) ? 10 : \
134 (n) & (1ULL << 9) ? 9 : \
135 (n) & (1ULL << 8) ? 8 : \
136 (n) & (1ULL << 7) ? 7 : \
137 (n) & (1ULL << 6) ? 6 : \
138 (n) & (1ULL << 5) ? 5 : \
139 (n) & (1ULL << 4) ? 4 : \
140 (n) & (1ULL << 3) ? 3 : \
141 (n) & (1ULL << 2) ? 2 : \
142 (n) & (1ULL << 1) ? 1 : \
143 (n) & (1ULL << 0) ? 0 : \
144 ____ilog2_NaN() \
145 ) : \
146 (sizeof(n) <= 4) ? \
147 __ilog2_u32(n) : \
148 __ilog2_u64(n) \
149 )
150
151/**
152 * roundup_pow_of_two - round the given value up to nearest power of two
153 * @n - parameter
154 *
155 * round the given balue up to the nearest power of two
156 * - the result is undefined when n == 0
157 * - this can be used to initialise global variables from constant data
158 */
159#define roundup_pow_of_two(n) \
160( \
161 __builtin_constant_p(n) ? ( \
162 (n == 1) ? 0 : \
163 (1UL << (ilog2((n) - 1) + 1)) \
164 ) : \
165 __roundup_pow_of_two(n) \
166 )
167
168#endif /* _LINUX_LOG2_H */
diff --git a/include/linux/magic.h b/include/linux/magic.h
index 156c40fc664e..b78bbf42135a 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -3,6 +3,7 @@
3 3
4#define ADFS_SUPER_MAGIC 0xadf5 4#define ADFS_SUPER_MAGIC 0xadf5
5#define AFFS_SUPER_MAGIC 0xadff 5#define AFFS_SUPER_MAGIC 0xadff
6#define AFS_SUPER_MAGIC 0x5346414F
6#define AUTOFS_SUPER_MAGIC 0x0187 7#define AUTOFS_SUPER_MAGIC 0x0187
7#define CODA_SUPER_MAGIC 0x73757245 8#define CODA_SUPER_MAGIC 0x73757245
8#define EFS_SUPER_MAGIC 0x414A53 9#define EFS_SUPER_MAGIC 0x414A53
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a17b147c61e7..bb793a4c8e9e 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -168,6 +168,7 @@ extern unsigned int kobjsize(const void *objp);
168#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ 168#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
169#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ 169#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */
170#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */ 170#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
171#define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */
171 172
172#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ 173#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
173#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS 174#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
@@ -978,7 +979,8 @@ extern int early_pfn_to_nid(unsigned long pfn);
978#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ 979#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
979#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ 980#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
980extern void set_dma_reserve(unsigned long new_dma_reserve); 981extern void set_dma_reserve(unsigned long new_dma_reserve);
981extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); 982extern void memmap_init_zone(unsigned long, int, unsigned long,
983 unsigned long, enum memmap_context);
982extern void setup_per_zone_pages_min(void); 984extern void setup_per_zone_pages_min(void);
983extern void mem_init(void); 985extern void mem_init(void);
984extern void show_mem(void); 986extern void show_mem(void);
@@ -1028,6 +1030,9 @@ extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
1028 unsigned long addr, unsigned long len, pgoff_t pgoff); 1030 unsigned long addr, unsigned long len, pgoff_t pgoff);
1029extern void exit_mmap(struct mm_struct *); 1031extern void exit_mmap(struct mm_struct *);
1030extern int may_expand_vm(struct mm_struct *mm, unsigned long npages); 1032extern int may_expand_vm(struct mm_struct *mm, unsigned long npages);
1033extern int install_special_mapping(struct mm_struct *mm,
1034 unsigned long addr, unsigned long len,
1035 unsigned long flags, struct page **pages);
1031 1036
1032extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 1037extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
1033 1038
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 a3594dfd6963..cdc54be804f1 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -42,7 +42,8 @@ struct mmc_command {
42#define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY) 42#define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY)
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) 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 e339a7345f25..b262f47961fb 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -450,9 +450,13 @@ void build_all_zonelists(void);
450void wakeup_kswapd(struct zone *zone, int order); 450void wakeup_kswapd(struct zone *zone, int order);
451int zone_watermark_ok(struct zone *z, int order, unsigned long mark, 451int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
452 int classzone_idx, int alloc_flags); 452 int classzone_idx, int alloc_flags);
453 453enum memmap_context {
454 MEMMAP_EARLY,
455 MEMMAP_HOTPLUG,
456};
454extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn, 457extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
455 unsigned long size); 458 unsigned long size,
459 enum memmap_context context);
456 460
457#ifdef CONFIG_HAVE_MEMORY_PRESENT 461#ifdef CONFIG_HAVE_MEMORY_PRESENT
458void memory_present(int nid, unsigned long start, unsigned long end); 462void memory_present(int nid, unsigned long start, unsigned long end);
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
new file mode 100644
index 000000000000..4af0b1fc282a
--- /dev/null
+++ b/include/linux/mnt_namespace.h
@@ -0,0 +1,42 @@
1#ifndef _NAMESPACE_H_
2#define _NAMESPACE_H_
3#ifdef __KERNEL__
4
5#include <linux/mount.h>
6#include <linux/sched.h>
7#include <linux/nsproxy.h>
8
9struct mnt_namespace {
10 atomic_t count;
11 struct vfsmount * root;
12 struct list_head list;
13 wait_queue_head_t poll;
14 int event;
15};
16
17extern int copy_mnt_ns(int, struct task_struct *);
18extern void __put_mnt_ns(struct mnt_namespace *ns);
19extern struct mnt_namespace *dup_mnt_ns(struct task_struct *,
20 struct fs_struct *);
21
22static inline void put_mnt_ns(struct mnt_namespace *ns)
23{
24 if (atomic_dec_and_lock(&ns->count, &vfsmount_lock))
25 /* releases vfsmount_lock */
26 __put_mnt_ns(ns);
27}
28
29static inline void exit_mnt_ns(struct task_struct *p)
30{
31 struct mnt_namespace *ns = p->nsproxy->mnt_ns;
32 if (ns)
33 put_mnt_ns(ns);
34}
35
36static inline void get_mnt_ns(struct mnt_namespace *ns)
37{
38 atomic_inc(&ns->count);
39}
40
41#endif
42#endif
diff --git a/include/linux/module.h b/include/linux/module.h
index d33df2408e05..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;
@@ -319,6 +320,13 @@ struct module
319 320
320 unsigned int taints; /* same bits as kernel:tainted */ 321 unsigned int taints; /* same bits as kernel:tainted */
321 322
323#ifdef CONFIG_GENERIC_BUG
324 /* Support for BUG */
325 struct list_head bug_list;
326 struct bug_entry *bug_table;
327 unsigned num_bugs;
328#endif
329
322#ifdef CONFIG_MODULE_UNLOAD 330#ifdef CONFIG_MODULE_UNLOAD
323 /* Reference counts */ 331 /* Reference counts */
324 struct module_ref ref[NR_CPUS]; 332 struct module_ref ref[NR_CPUS];
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 403d1a97c512..1b7e178b0d84 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -20,13 +20,14 @@
20struct super_block; 20struct super_block;
21struct vfsmount; 21struct vfsmount;
22struct dentry; 22struct dentry;
23struct namespace; 23struct mnt_namespace;
24 24
25#define MNT_NOSUID 0x01 25#define MNT_NOSUID 0x01
26#define MNT_NODEV 0x02 26#define MNT_NODEV 0x02
27#define MNT_NOEXEC 0x04 27#define MNT_NOEXEC 0x04
28#define MNT_NOATIME 0x08 28#define MNT_NOATIME 0x08
29#define MNT_NODIRATIME 0x10 29#define MNT_NODIRATIME 0x10
30#define MNT_RELATIME 0x20
30 31
31#define MNT_SHRINKABLE 0x100 32#define MNT_SHRINKABLE 0x100
32 33
@@ -52,7 +53,7 @@ struct vfsmount {
52 struct list_head mnt_slave_list;/* list of slave mounts */ 53 struct list_head mnt_slave_list;/* list of slave mounts */
53 struct list_head mnt_slave; /* slave list entry */ 54 struct list_head mnt_slave; /* slave list entry */
54 struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ 55 struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */
55 struct namespace *mnt_namespace; /* containing namespace */ 56 struct mnt_namespace *mnt_ns; /* containing namespace */
56 int mnt_pinned; 57 int mnt_pinned;
57}; 58};
58 59
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/mtd/blktrans.h b/include/linux/mtd/blktrans.h
index 72fc68c5ee96..9a6e2f953cba 100644
--- a/include/linux/mtd/blktrans.h
+++ b/include/linux/mtd/blktrans.h
@@ -24,7 +24,6 @@ struct mtd_blktrans_dev {
24 struct mtd_info *mtd; 24 struct mtd_info *mtd;
25 struct mutex lock; 25 struct mutex lock;
26 int devnum; 26 int devnum;
27 int blksize;
28 unsigned long size; 27 unsigned long size;
29 int readonly; 28 int readonly;
30 void *blkcore_priv; /* gendisk in 2.5, devfs_handle in 2.4 */ 29 void *blkcore_priv; /* gendisk in 2.5, devfs_handle in 2.4 */
@@ -36,6 +35,8 @@ struct mtd_blktrans_ops {
36 char *name; 35 char *name;
37 int major; 36 int major;
38 int part_bits; 37 int part_bits;
38 int blksize;
39 int blkshift;
39 40
40 /* Access functions */ 41 /* Access functions */
41 int (*readsect)(struct mtd_blktrans_dev *dev, 42 int (*readsect)(struct mtd_blktrans_dev *dev,
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 94a443d45258..d644e57703ad 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -23,7 +23,7 @@
23 23
24#define MTD_CHAR_MAJOR 90 24#define MTD_CHAR_MAJOR 90
25#define MTD_BLOCK_MAJOR 31 25#define MTD_BLOCK_MAJOR 31
26#define MAX_MTD_DEVICES 16 26#define MAX_MTD_DEVICES 32
27 27
28#define MTD_ERASE_PENDING 0x01 28#define MTD_ERASE_PENDING 0x01
29#define MTD_ERASING 0x02 29#define MTD_ERASING 0x02
@@ -75,15 +75,12 @@ typedef enum {
75 * struct mtd_oob_ops - oob operation operands 75 * struct mtd_oob_ops - oob operation operands
76 * @mode: operation mode 76 * @mode: operation mode
77 * 77 *
78 * @len: number of bytes to write/read. When a data buffer is given 78 * @len: number of data bytes to write/read
79 * (datbuf != NULL) this is the number of data bytes. When
80 * no data buffer is available this is the number of oob bytes.
81 * 79 *
82 * @retlen: number of bytes written/read. When a data buffer is given 80 * @retlen: number of data bytes written/read
83 * (datbuf != NULL) this is the number of data bytes. When
84 * no data buffer is available this is the number of oob bytes.
85 * 81 *
86 * @ooblen: number of oob bytes per page 82 * @ooblen: number of oob bytes to write/read
83 * @oobretlen: number of oob bytes written/read
87 * @ooboffs: offset of oob data in the oob area (only relevant when 84 * @ooboffs: offset of oob data in the oob area (only relevant when
88 * mode = MTD_OOB_PLACE) 85 * mode = MTD_OOB_PLACE)
89 * @datbuf: data buffer - if NULL only oob data are read/written 86 * @datbuf: data buffer - if NULL only oob data are read/written
@@ -94,6 +91,7 @@ struct mtd_oob_ops {
94 size_t len; 91 size_t len;
95 size_t retlen; 92 size_t retlen;
96 size_t ooblen; 93 size_t ooblen;
94 size_t oobretlen;
97 uint32_t ooboffs; 95 uint32_t ooboffs;
98 uint8_t *datbuf; 96 uint8_t *datbuf;
99 uint8_t *oobbuf; 97 uint8_t *oobbuf;
@@ -202,11 +200,20 @@ struct mtd_info {
202 200
203 /* ECC status information */ 201 /* ECC status information */
204 struct mtd_ecc_stats ecc_stats; 202 struct mtd_ecc_stats ecc_stats;
203 /* Subpage shift (NAND) */
204 int subpage_sft;
205 205
206 void *priv; 206 void *priv;
207 207
208 struct module *owner; 208 struct module *owner;
209 int usecount; 209 int usecount;
210
211 /* If the driver is something smart, like UBI, it may need to maintain
212 * its own reference counting. The below functions are only for driver.
213 * The driver may register its callbacks. These callbacks are not
214 * supposed to be called by MTD users */
215 int (*get_device) (struct mtd_info *mtd);
216 void (*put_device) (struct mtd_info *mtd);
210}; 217};
211 218
212 219
@@ -216,6 +223,7 @@ extern int add_mtd_device(struct mtd_info *mtd);
216extern int del_mtd_device (struct mtd_info *mtd); 223extern int del_mtd_device (struct mtd_info *mtd);
217 224
218extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); 225extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
226extern struct mtd_info *get_mtd_device_nm(const char *name);
219 227
220extern void put_mtd_device(struct mtd_info *mtd); 228extern void put_mtd_device(struct mtd_info *mtd);
221 229
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 8b3ef4187219..2071b02f0526 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -166,6 +166,9 @@ typedef enum {
166 * for all large page devices, as they do not support 166 * for all large page devices, as they do not support
167 * autoincrement.*/ 167 * autoincrement.*/
168#define NAND_NO_READRDY 0x00000100 168#define NAND_NO_READRDY 0x00000100
169/* Chip does not allow subpage writes */
170#define NAND_NO_SUBPAGE_WRITE 0x00000200
171
169 172
170/* Options valid for Samsung large page devices */ 173/* Options valid for Samsung large page devices */
171#define NAND_SAMSUNG_LP_OPTIONS \ 174#define NAND_SAMSUNG_LP_OPTIONS \
@@ -193,6 +196,9 @@ typedef enum {
193/* Nand scan has allocated controller struct */ 196/* Nand scan has allocated controller struct */
194#define NAND_CONTROLLER_ALLOC 0x80000000 197#define NAND_CONTROLLER_ALLOC 0x80000000
195 198
199/* Cell info constants */
200#define NAND_CI_CHIPNR_MSK 0x03
201#define NAND_CI_CELLTYPE_MSK 0x0C
196 202
197/* 203/*
198 * nand_state_t - chip states 204 * nand_state_t - chip states
@@ -286,9 +292,7 @@ struct nand_ecc_ctrl {
286 * struct nand_buffers - buffer structure for read/write 292 * struct nand_buffers - buffer structure for read/write
287 * @ecccalc: buffer for calculated ecc 293 * @ecccalc: buffer for calculated ecc
288 * @ecccode: buffer for ecc read from flash 294 * @ecccode: buffer for ecc read from flash
289 * @oobwbuf: buffer for write oob data
290 * @databuf: buffer for data - dynamically sized 295 * @databuf: buffer for data - dynamically sized
291 * @oobrbuf: buffer to read oob data
292 * 296 *
293 * Do not change the order of buffers. databuf and oobrbuf must be in 297 * Do not change the order of buffers. databuf and oobrbuf must be in
294 * consecutive order. 298 * consecutive order.
@@ -296,9 +300,7 @@ struct nand_ecc_ctrl {
296struct nand_buffers { 300struct nand_buffers {
297 uint8_t ecccalc[NAND_MAX_OOBSIZE]; 301 uint8_t ecccalc[NAND_MAX_OOBSIZE];
298 uint8_t ecccode[NAND_MAX_OOBSIZE]; 302 uint8_t ecccode[NAND_MAX_OOBSIZE];
299 uint8_t oobwbuf[NAND_MAX_OOBSIZE]; 303 uint8_t databuf[NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE];
300 uint8_t databuf[NAND_MAX_PAGESIZE];
301 uint8_t oobrbuf[NAND_MAX_OOBSIZE];
302}; 304};
303 305
304/** 306/**
@@ -345,6 +347,7 @@ struct nand_buffers {
345 * @chipsize: [INTERN] the size of one chip for multichip arrays 347 * @chipsize: [INTERN] the size of one chip for multichip arrays
346 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 348 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
347 * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf 349 * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf
350 * @subpagesize: [INTERN] holds the subpagesize
348 * @ecclayout: [REPLACEABLE] the default ecc placement scheme 351 * @ecclayout: [REPLACEABLE] the default ecc placement scheme
349 * @bbt: [INTERN] bad block table pointer 352 * @bbt: [INTERN] bad block table pointer
350 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup 353 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup
@@ -392,6 +395,8 @@ struct nand_chip {
392 unsigned long chipsize; 395 unsigned long chipsize;
393 int pagemask; 396 int pagemask;
394 int pagebuf; 397 int pagebuf;
398 int subpagesize;
399 uint8_t cellinfo;
395 int badblockpos; 400 int badblockpos;
396 401
397 nand_state_t state; 402 nand_state_t state;
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 6f045b586e76..f775a7af3890 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -13,6 +13,7 @@
13#define __LINUX_MTD_ONENAND_H 13#define __LINUX_MTD_ONENAND_H
14 14
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/completion.h>
16#include <linux/mtd/onenand_regs.h> 17#include <linux/mtd/onenand_regs.h>
17#include <linux/mtd/bbm.h> 18#include <linux/mtd/bbm.h>
18 19
@@ -33,7 +34,6 @@ typedef enum {
33 FL_WRITING, 34 FL_WRITING,
34 FL_ERASING, 35 FL_ERASING,
35 FL_SYNCING, 36 FL_SYNCING,
36 FL_UNLOCKING,
37 FL_LOCKING, 37 FL_LOCKING,
38 FL_RESETING, 38 FL_RESETING,
39 FL_OTPING, 39 FL_OTPING,
@@ -88,6 +88,7 @@ struct onenand_bufferram {
88 * operation is in progress 88 * operation is in progress
89 * @state: [INTERN] the current state of the OneNAND device 89 * @state: [INTERN] the current state of the OneNAND device
90 * @page_buf: data buffer 90 * @page_buf: data buffer
91 * @subpagesize: [INTERN] holds the subpagesize
91 * @ecclayout: [REPLACEABLE] the default ecc placement scheme 92 * @ecclayout: [REPLACEABLE] the default ecc placement scheme
92 * @bbm: [REPLACEABLE] pointer to Bad Block Management 93 * @bbm: [REPLACEABLE] pointer to Bad Block Management
93 * @priv: [OPTIONAL] pointer to private chip date 94 * @priv: [OPTIONAL] pointer to private chip date
@@ -120,11 +121,15 @@ struct onenand_chip {
120 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); 121 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
121 int (*scan_bbt)(struct mtd_info *mtd); 122 int (*scan_bbt)(struct mtd_info *mtd);
122 123
124 struct completion complete;
125 int irq;
126
123 spinlock_t chip_lock; 127 spinlock_t chip_lock;
124 wait_queue_head_t wq; 128 wait_queue_head_t wq;
125 onenand_state_t state; 129 onenand_state_t state;
126 unsigned char *page_buf; 130 unsigned char *page_buf;
127 131
132 int subpagesize;
128 struct nand_ecclayout *ecclayout; 133 struct nand_ecclayout *ecclayout;
129 134
130 void *bbm; 135 void *bbm;
@@ -138,6 +143,7 @@ struct onenand_chip {
138#define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index) 143#define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index)
139#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1) 144#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1)
140#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1) 145#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1)
146#define ONENAND_SET_PREV_BUFFERRAM(this) (this->bufferram_index ^= 1)
141 147
142#define ONENAND_GET_SYS_CFG1(this) \ 148#define ONENAND_GET_SYS_CFG1(this) \
143 (this->read_word(this->base + ONENAND_REG_SYS_CFG1)) 149 (this->read_word(this->base + ONENAND_REG_SYS_CFG1))
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index 9e409fe6ded6..e31c8f5d4271 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -179,6 +179,7 @@
179 * ECC Status Reigser FF00h (R) 179 * ECC Status Reigser FF00h (R)
180 */ 180 */
181#define ONENAND_ECC_1BIT (1 << 0) 181#define ONENAND_ECC_1BIT (1 << 0)
182#define ONENAND_ECC_1BIT_ALL (0x5555)
182#define ONENAND_ECC_2BIT (1 << 1) 183#define ONENAND_ECC_2BIT (1 << 1)
183#define ONENAND_ECC_2BIT_ALL (0xAAAA) 184#define ONENAND_ECC_2BIT_ALL (0xAAAA)
184 185
diff --git a/include/linux/mtio.h b/include/linux/mtio.h
index 8c66151821e3..6f8d2d45a8fb 100644
--- a/include/linux/mtio.h
+++ b/include/linux/mtio.h
@@ -10,7 +10,6 @@
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/ioctl.h> 12#include <linux/ioctl.h>
13#include <linux/qic117.h>
14 13
15/* 14/*
16 * Structures and definitions for mag tape io control commands 15 * Structures and definitions for mag tape io control commands
@@ -116,32 +115,6 @@ struct mtget {
116#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */ 115#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */
117#define MT_ISFTAPE_FLAG 0x800000 116#define MT_ISFTAPE_FLAG 0x800000
118 117
119struct mt_tape_info {
120 long t_type; /* device type id (mt_type) */
121 char *t_name; /* descriptive name */
122};
123
124#define MT_TAPE_INFO { \
125 {MT_ISUNKNOWN, "Unknown type of tape device"}, \
126 {MT_ISQIC02, "Generic QIC-02 tape streamer"}, \
127 {MT_ISWT5150, "Wangtek 5150, QIC-150"}, \
128 {MT_ISARCHIVE_5945L2, "Archive 5945L-2"}, \
129 {MT_ISCMSJ500, "CMS Jumbo 500"}, \
130 {MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"}, \
131 {MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"}, \
132 {MT_ISARCHIVE_2150L, "Archive Viper 2150L"}, \
133 {MT_ISARCHIVE_2060L, "Archive Viper 2060L"}, \
134 {MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"}, \
135 {MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"}, \
136 {MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"}, \
137 {MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"}, \
138 {MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \
139 {MT_ISONSTREAM_SC, "OnStream SC-, DI-, DP-, or USB tape drive"}, \
140 {MT_ISSCSI1, "Generic SCSI-1 tape"}, \
141 {MT_ISSCSI2, "Generic SCSI-2 tape"}, \
142 {0, NULL} \
143}
144
145 118
146/* structure for MTIOCPOS - mag tape get position command */ 119/* structure for MTIOCPOS - mag tape get position command */
147 120
@@ -150,130 +123,11 @@ struct mtpos {
150}; 123};
151 124
152 125
153/* structure for MTIOCVOLINFO, query information about the volume
154 * currently positioned at (zftape)
155 */
156struct mtvolinfo {
157 unsigned int mt_volno; /* vol-number */
158 unsigned int mt_blksz; /* blocksize used when recording */
159 unsigned int mt_rawsize; /* raw tape space consumed, in kb */
160 unsigned int mt_size; /* volume size after decompression, in kb */
161 unsigned int mt_cmpr:1; /* this volume has been compressed */
162};
163
164/* raw access to a floppy drive, read and write an arbitrary segment.
165 * For ftape/zftape to support formatting etc.
166 */
167#define MT_FT_RD_SINGLE 0
168#define MT_FT_RD_AHEAD 1
169#define MT_FT_WR_ASYNC 0 /* start tape only when all buffers are full */
170#define MT_FT_WR_MULTI 1 /* start tape, continue until buffers are empty */
171#define MT_FT_WR_SINGLE 2 /* write a single segment and stop afterwards */
172#define MT_FT_WR_DELETE 3 /* write deleted data marks, one segment at time */
173
174struct mtftseg
175{
176 unsigned mt_segno; /* the segment to read or write */
177 unsigned mt_mode; /* modes for read/write (sync/async etc.) */
178 int mt_result; /* result of r/w request, not of the ioctl */
179 void __user *mt_data; /* User space buffer: must be 29kb */
180};
181
182/* get tape capacity (ftape/zftape)
183 */
184struct mttapesize {
185 unsigned long mt_capacity; /* entire, uncompressed capacity
186 * of a cartridge
187 */
188 unsigned long mt_used; /* what has been used so far, raw
189 * uncompressed amount
190 */
191};
192
193/* possible values of the ftfmt_op field
194 */
195#define FTFMT_SET_PARMS 1 /* set software parms */
196#define FTFMT_GET_PARMS 2 /* get software parms */
197#define FTFMT_FORMAT_TRACK 3 /* start formatting a tape track */
198#define FTFMT_STATUS 4 /* monitor formatting a tape track */
199#define FTFMT_VERIFY 5 /* verify the given segment */
200
201struct ftfmtparms {
202 unsigned char ft_qicstd; /* QIC-40/QIC-80/QIC-3010/QIC-3020 */
203 unsigned char ft_fmtcode; /* Refer to the QIC specs */
204 unsigned char ft_fhm; /* floppy head max */
205 unsigned char ft_ftm; /* floppy track max */
206 unsigned short ft_spt; /* segments per track */
207 unsigned short ft_tpc; /* tracks per cartridge */
208};
209
210struct ftfmttrack {
211 unsigned int ft_track; /* track to format */
212 unsigned char ft_gap3; /* size of gap3, for FORMAT_TRK */
213};
214
215struct ftfmtstatus {
216 unsigned int ft_segment; /* segment currently being formatted */
217};
218
219struct ftfmtverify {
220 unsigned int ft_segment; /* segment to verify */
221 unsigned long ft_bsm; /* bsm as result of VERIFY cmd */
222};
223
224struct mtftformat {
225 unsigned int fmt_op; /* operation to perform */
226 union fmt_arg {
227 struct ftfmtparms fmt_parms; /* format parameters */
228 struct ftfmttrack fmt_track; /* ctrl while formatting */
229 struct ftfmtstatus fmt_status;
230 struct ftfmtverify fmt_verify; /* for verifying */
231 } fmt_arg;
232};
233
234struct mtftcmd {
235 unsigned int ft_wait_before; /* timeout to wait for drive to get ready
236 * before command is sent. Milliseconds
237 */
238 qic117_cmd_t ft_cmd; /* command to send */
239 unsigned char ft_parm_cnt; /* zero: no parm is sent. */
240 unsigned char ft_parms[3]; /* parameter(s) to send to
241 * the drive. The parms are nibbles
242 * driver sends cmd + 2 step pulses */
243 unsigned int ft_result_bits; /* if non zero, number of bits
244 * returned by the tape drive
245 */
246 unsigned int ft_result; /* the result returned by the tape drive*/
247 unsigned int ft_wait_after; /* timeout to wait for drive to get ready
248 * after command is sent. 0: don't wait */
249 int ft_status; /* status returned by ready wait
250 * undefined if timeout was 0.
251 */
252 int ft_error; /* error code if error status was set by
253 * command
254 */
255};
256
257/* mag tape io control commands */ 126/* mag tape io control commands */
258#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */ 127#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */
259#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */ 128#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */
260#define MTIOCPOS _IOR('m', 3, struct mtpos) /* get tape position */ 129#define MTIOCPOS _IOR('m', 3, struct mtpos) /* get tape position */
261 130
262/* The next two are used by the QIC-02 driver for runtime reconfiguration.
263 * See tpqic02.h for struct mtconfiginfo.
264 */
265#define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo) /* get tape config */
266#define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo) /* set tape config */
267
268/* the next six are used by the floppy ftape drivers and its frontends
269 * sorry, but MTIOCTOP commands are write only.
270 */
271#define MTIOCRDFTSEG _IOWR('m', 6, struct mtftseg) /* read a segment */
272#define MTIOCWRFTSEG _IOWR('m', 7, struct mtftseg) /* write a segment */
273#define MTIOCVOLINFO _IOR('m', 8, struct mtvolinfo) /* info about volume */
274#define MTIOCGETSIZE _IOR('m', 9, struct mttapesize)/* get cartridge size*/
275#define MTIOCFTFORMAT _IOWR('m', 10, struct mtftformat) /* format ftape */
276#define MTIOCFTCMD _IOWR('m', 11, struct mtftcmd) /* send QIC-117 cmd */
277 131
278/* Generic Mag Tape (device independent) status macros for examining 132/* Generic Mag Tape (device independent) status macros for examining
279 * mt_gstat -- HP-UX compatible. 133 * mt_gstat -- HP-UX compatible.
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index b2b91c477563..b81bc2adaeff 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -105,7 +105,7 @@ do { \
105extern void __mutex_init(struct mutex *lock, const char *name, 105extern void __mutex_init(struct mutex *lock, const char *name,
106 struct lock_class_key *key); 106 struct lock_class_key *key);
107 107
108/*** 108/**
109 * mutex_is_locked - is the mutex locked 109 * mutex_is_locked - is the mutex locked
110 * @lock: the mutex to be queried 110 * @lock: the mutex to be queried
111 * 111 *
@@ -125,8 +125,10 @@ extern int fastcall mutex_lock_interruptible(struct mutex *lock);
125 125
126#ifdef CONFIG_DEBUG_LOCK_ALLOC 126#ifdef CONFIG_DEBUG_LOCK_ALLOC
127extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); 127extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
128extern int mutex_lock_interruptible_nested(struct mutex *lock, unsigned int subclass);
128#else 129#else
129# define mutex_lock_nested(lock, subclass) mutex_lock(lock) 130# define mutex_lock_nested(lock, subclass) mutex_lock(lock)
131# define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
130#endif 132#endif
131 133
132/* 134/*
diff --git a/include/linux/n_r3964.h b/include/linux/n_r3964.h
index db4f3776978a..de24af79ebd3 100644
--- a/include/linux/n_r3964.h
+++ b/include/linux/n_r3964.h
@@ -116,7 +116,7 @@ struct r3964_message;
116 116
117struct r3964_client_info { 117struct r3964_client_info {
118 spinlock_t lock; 118 spinlock_t lock;
119 pid_t pid; 119 struct pid *pid;
120 unsigned int sig_flags; 120 unsigned int sig_flags;
121 121
122 struct r3964_client_info *next; 122 struct r3964_client_info *next;
diff --git a/include/linux/namei.h b/include/linux/namei.h
index f5f19606effb..d39a5a67e979 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -29,6 +29,11 @@ struct nameidata {
29 } intent; 29 } intent;
30}; 30};
31 31
32struct path {
33 struct vfsmount *mnt;
34 struct dentry *dentry;
35};
36
32/* 37/*
33 * Type of the last component on LOOKUP_PARENT 38 * Type of the last component on LOOKUP_PARENT
34 */ 39 */
diff --git a/include/linux/namespace.h b/include/linux/namespace.h
deleted file mode 100644
index d137009f0b2b..000000000000
--- a/include/linux/namespace.h
+++ /dev/null
@@ -1,42 +0,0 @@
1#ifndef _NAMESPACE_H_
2#define _NAMESPACE_H_
3#ifdef __KERNEL__
4
5#include <linux/mount.h>
6#include <linux/sched.h>
7#include <linux/nsproxy.h>
8
9struct namespace {
10 atomic_t count;
11 struct vfsmount * root;
12 struct list_head list;
13 wait_queue_head_t poll;
14 int event;
15};
16
17extern int copy_namespace(int, struct task_struct *);
18extern void __put_namespace(struct namespace *namespace);
19extern struct namespace *dup_namespace(struct task_struct *, struct fs_struct *);
20
21static inline void put_namespace(struct namespace *namespace)
22{
23 if (atomic_dec_and_lock(&namespace->count, &vfsmount_lock))
24 /* releases vfsmount_lock */
25 __put_namespace(namespace);
26}
27
28static inline void exit_namespace(struct task_struct *p)
29{
30 struct namespace *namespace = p->nsproxy->namespace;
31 if (namespace) {
32 put_namespace(namespace);
33 }
34}
35
36static inline void get_namespace(struct namespace *namespace)
37{
38 atomic_inc(&namespace->count);
39}
40
41#endif
42#endif
diff --git a/include/linux/ncp_mount.h b/include/linux/ncp_mount.h
index f46bddcdbd3b..a2b549eb1eca 100644
--- a/include/linux/ncp_mount.h
+++ b/include/linux/ncp_mount.h
@@ -75,7 +75,7 @@ struct ncp_mount_data_kernel {
75 unsigned int int_flags; /* internal flags */ 75 unsigned int int_flags; /* internal flags */
76#define NCP_IMOUNT_LOGGEDIN_POSSIBLE 0x0001 76#define NCP_IMOUNT_LOGGEDIN_POSSIBLE 0x0001
77 __kernel_uid32_t mounted_uid; /* Who may umount() this filesystem? */ 77 __kernel_uid32_t mounted_uid; /* Who may umount() this filesystem? */
78 __kernel_pid_t wdog_pid; /* Who cares for our watchdog packets? */ 78 struct pid *wdog_pid; /* Who cares for our watchdog packets? */
79 unsigned int ncp_fd; /* The socket to the ncp port */ 79 unsigned int ncp_fd; /* The socket to the ncp port */
80 unsigned int time_out; /* How long should I wait after 80 unsigned int time_out; /* How long should I wait after
81 sending a NCP request? */ 81 sending a NCP request? */
diff --git a/include/linux/net.h b/include/linux/net.h
index 6f0dfeba509a..4db21e63d8d2 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -19,13 +19,12 @@
19#define _LINUX_NET_H 19#define _LINUX_NET_H
20 20
21#include <linux/wait.h> 21#include <linux/wait.h>
22#include <linux/random.h>
23#include <asm/socket.h> 22#include <asm/socket.h>
24 23
25struct poll_table_struct; 24struct poll_table_struct;
26struct inode; 25struct inode;
27 26
28#define NPROTO 32 /* should be enough for now.. */ 27#define NPROTO 33 /* should be enough for now.. */
29 28
30#define SYS_SOCKET 1 /* sys_socket(2) */ 29#define SYS_SOCKET 1 /* sys_socket(2) */
31#define SYS_BIND 2 /* sys_bind(2) */ 30#define SYS_BIND 2 /* sys_bind(2) */
@@ -57,6 +56,7 @@ typedef enum {
57 56
58#ifdef __KERNEL__ 57#ifdef __KERNEL__
59#include <linux/stringify.h> 58#include <linux/stringify.h>
59#include <linux/random.h>
60 60
61#define SOCK_ASYNC_NOSPACE 0 61#define SOCK_ASYNC_NOSPACE 0
62#define SOCK_ASYNC_WAITDATA 1 62#define SOCK_ASYNC_WAITDATA 1
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c57088f575a3..1a528548cd1d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -193,13 +193,20 @@ struct hh_cache
193{ 193{
194 struct hh_cache *hh_next; /* Next entry */ 194 struct hh_cache *hh_next; /* Next entry */
195 atomic_t hh_refcnt; /* number of users */ 195 atomic_t hh_refcnt; /* number of users */
196 __be16 hh_type; /* protocol identifier, f.e ETH_P_IP 196/*
197 * We want hh_output, hh_len, hh_lock and hh_data be a in a separate
198 * cache line on SMP.
199 * They are mostly read, but hh_refcnt may be changed quite frequently,
200 * incurring cache line ping pongs.
201 */
202 __be16 hh_type ____cacheline_aligned_in_smp;
203 /* protocol identifier, f.e ETH_P_IP
197 * NOTE: For VLANs, this will be the 204 * NOTE: For VLANs, this will be the
198 * encapuslated type. --BLG 205 * encapuslated type. --BLG
199 */ 206 */
200 u16 hh_len; /* length of header */ 207 u16 hh_len; /* length of header */
201 int (*hh_output)(struct sk_buff *skb); 208 int (*hh_output)(struct sk_buff *skb);
202 rwlock_t hh_lock; 209 seqlock_t hh_lock;
203 210
204 /* cached hardware header; allow for machine alignment needs. */ 211 /* cached hardware header; allow for machine alignment needs. */
205#define HH_DATA_MOD 16 212#define HH_DATA_MOD 16
@@ -522,10 +529,11 @@ struct net_device
522 struct net_bridge_port *br_port; 529 struct net_bridge_port *br_port;
523 530
524 /* class/net/name entry */ 531 /* class/net/name entry */
525 struct class_device class_dev; 532 struct device dev;
526 /* space for optional statistics and wireless sysfs groups */ 533 /* space for optional statistics and wireless sysfs groups */
527 struct attribute_group *sysfs_groups[3]; 534 struct attribute_group *sysfs_groups[3];
528}; 535};
536#define to_net_dev(d) container_of(d, struct net_device, dev)
529 537
530#define NETDEV_ALIGN 32 538#define NETDEV_ALIGN 32
531#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) 539#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1)
@@ -541,7 +549,7 @@ static inline void *netdev_priv(struct net_device *dev)
541/* Set the sysfs physical device reference for the network logical device 549/* Set the sysfs physical device reference for the network logical device
542 * if set prior to registration will cause a symlink during initialization. 550 * if set prior to registration will cause a symlink during initialization.
543 */ 551 */
544#define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev)) 552#define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev))
545 553
546struct packet_type { 554struct packet_type {
547 __be16 type; /* This is really htons(ether_type). */ 555 __be16 type; /* This is really htons(ether_type). */
@@ -581,7 +589,7 @@ extern int dev_open(struct net_device *dev);
581extern int dev_close(struct net_device *dev); 589extern int dev_close(struct net_device *dev);
582extern int dev_queue_xmit(struct sk_buff *skb); 590extern int dev_queue_xmit(struct sk_buff *skb);
583extern int register_netdevice(struct net_device *dev); 591extern int register_netdevice(struct net_device *dev);
584extern int unregister_netdevice(struct net_device *dev); 592extern void unregister_netdevice(struct net_device *dev);
585extern void free_netdev(struct net_device *dev); 593extern void free_netdev(struct net_device *dev);
586extern void synchronize_net(void); 594extern void synchronize_net(void);
587extern int register_netdevice_notifier(struct notifier_block *nb); 595extern int register_netdevice_notifier(struct notifier_block *nb);
@@ -899,6 +907,7 @@ static inline void netif_poll_disable(struct net_device *dev)
899 907
900static inline void netif_poll_enable(struct net_device *dev) 908static inline void netif_poll_enable(struct net_device *dev)
901{ 909{
910 smp_mb__before_clear_bit();
902 clear_bit(__LINK_STATE_RX_SCHED, &dev->state); 911 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
903} 912}
904 913
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 6b01ba297727..007af4c2770b 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -25,7 +25,10 @@ enum tcp_conntrack {
25#define IP_CT_TCP_FLAG_SACK_PERM 0x02 25#define IP_CT_TCP_FLAG_SACK_PERM 0x02
26 26
27/* This sender sent FIN first */ 27/* This sender sent FIN first */
28#define IP_CT_TCP_FLAG_CLOSE_INIT 0x03 28#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04
29
30/* Be liberal in window checking */
31#define IP_CT_TCP_FLAG_BE_LIBERAL 0x08
29 32
30#ifdef __KERNEL__ 33#ifdef __KERNEL__
31 34
@@ -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_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 0be235418a2f..24c8786d12e9 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -190,6 +190,7 @@ struct arpt_replace
190 190
191/* The argument to ARPT_SO_ADD_COUNTERS. */ 191/* The argument to ARPT_SO_ADD_COUNTERS. */
192#define arpt_counters_info xt_counters_info 192#define arpt_counters_info xt_counters_info
193#define arpt_counters xt_counters
193 194
194/* The argument to ARPT_SO_GET_ENTRIES. */ 195/* The argument to ARPT_SO_GET_ENTRIES. */
195struct arpt_get_entries 196struct arpt_get_entries
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index 6c4613f8ad75..55689f39f77a 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -68,7 +68,6 @@ struct bridge_skb_cb {
68 } daddr; 68 } daddr;
69}; 69};
70 70
71extern int brnf_deferred_hooks;
72#else 71#else
73#define nf_bridge_maybe_copy_header(skb) (0) 72#define nf_bridge_maybe_copy_header(skb) (0)
74#define nf_bridge_pad(skb) (0) 73#define nf_bridge_pad(skb) (0)
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index 5821eb5a0a3e..ceae87a4c891 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -57,10 +57,8 @@ enum nf_ip_hook_priorities {
57 NF_IP_PRI_RAW = -300, 57 NF_IP_PRI_RAW = -300,
58 NF_IP_PRI_SELINUX_FIRST = -225, 58 NF_IP_PRI_SELINUX_FIRST = -225,
59 NF_IP_PRI_CONNTRACK = -200, 59 NF_IP_PRI_CONNTRACK = -200,
60 NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
61 NF_IP_PRI_MANGLE = -150, 60 NF_IP_PRI_MANGLE = -150,
62 NF_IP_PRI_NAT_DST = -100, 61 NF_IP_PRI_NAT_DST = -100,
63 NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT = -50,
64 NF_IP_PRI_FILTER = 0, 62 NF_IP_PRI_FILTER = 0,
65 NF_IP_PRI_NAT_SRC = 100, 63 NF_IP_PRI_NAT_SRC = 100,
66 NF_IP_PRI_SELINUX_LAST = 225, 64 NF_IP_PRI_SELINUX_LAST = 225,
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 4f06dad0bde9..9527296595cd 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -28,7 +28,7 @@
28#include <linux/netfilter/x_tables.h> 28#include <linux/netfilter/x_tables.h>
29 29
30#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 30#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
31#define IPT_TABLE_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 31#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
32#define ipt_match xt_match 32#define ipt_match xt_match
33#define ipt_target xt_target 33#define ipt_target xt_target
34#define ipt_table xt_table 34#define ipt_table xt_table
@@ -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.h b/include/linux/netfilter_ipv6.h
index ab81a6dc94ea..66ca8e3100dc 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -62,10 +62,8 @@ enum nf_ip6_hook_priorities {
62 NF_IP6_PRI_CONNTRACK_DEFRAG = -400, 62 NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
63 NF_IP6_PRI_SELINUX_FIRST = -225, 63 NF_IP6_PRI_SELINUX_FIRST = -225,
64 NF_IP6_PRI_CONNTRACK = -200, 64 NF_IP6_PRI_CONNTRACK = -200,
65 NF_IP6_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
66 NF_IP6_PRI_MANGLE = -150, 65 NF_IP6_PRI_MANGLE = -150,
67 NF_IP6_PRI_NAT_DST = -100, 66 NF_IP6_PRI_NAT_DST = -100,
68 NF_IP6_PRI_BRIDGE_SABOTAGE_LOCAL_OUT = -50,
69 NF_IP6_PRI_FILTER = 0, 67 NF_IP6_PRI_FILTER = 0,
70 NF_IP6_PRI_NAT_SRC = 100, 68 NF_IP6_PRI_NAT_SRC = 100,
71 NF_IP6_PRI_SELINUX_LAST = 225, 69 NF_IP6_PRI_SELINUX_LAST = 225,
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/nfs_fs.h b/include/linux/nfs_fs.h
index 04963063e620..c5d4084773e8 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -308,6 +308,7 @@ extern int nfs_attribute_timeout(struct inode *inode);
308extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); 308extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode);
309extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); 309extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *);
310extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); 310extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping);
311extern int nfs_revalidate_mapping_nolock(struct inode *inode, struct address_space *mapping);
311extern int nfs_setattr(struct dentry *, struct iattr *); 312extern int nfs_setattr(struct dentry *, struct iattr *);
312extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); 313extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr);
313extern void nfs_begin_attr_update(struct inode *); 314extern void nfs_begin_attr_update(struct inode *);
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index edb54c3171b3..4b7c4b568f6d 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -52,8 +52,6 @@
52struct readdir_cd { 52struct readdir_cd {
53 __be32 err; /* 0, nfserr, or nfserr_eof */ 53 __be32 err; /* 0, nfserr, or nfserr_eof */
54}; 54};
55typedef int (*encode_dent_fn)(struct readdir_cd *, const char *,
56 int, loff_t, ino_t, unsigned int);
57typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int); 55typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int);
58 56
59extern struct svc_program nfsd_program; 57extern struct svc_program nfsd_program;
@@ -117,7 +115,7 @@ __be32 nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type,
117int nfsd_truncate(struct svc_rqst *, struct svc_fh *, 115int nfsd_truncate(struct svc_rqst *, struct svc_fh *,
118 unsigned long size); 116 unsigned long size);
119__be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *, 117__be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *,
120 loff_t *, struct readdir_cd *, encode_dent_fn); 118 loff_t *, struct readdir_cd *, filldir_t);
121__be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *, 119__be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *,
122 struct kstatfs *); 120 struct kstatfs *);
123 121
@@ -275,12 +273,12 @@ static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh)
275 * we might process an operation with side effects, and be unable to 273 * we might process an operation with side effects, and be unable to
276 * tell the client that the operation succeeded. 274 * tell the client that the operation succeeded.
277 * 275 *
278 * COMPOUND_SLACK_SPACE - this is the minimum amount of buffer space 276 * COMPOUND_SLACK_SPACE - this is the minimum bytes of buffer space
279 * needed to encode an "ordinary" _successful_ operation. (GETATTR, 277 * needed to encode an "ordinary" _successful_ operation. (GETATTR,
280 * READ, READDIR, and READLINK have their own buffer checks.) if we 278 * READ, READDIR, and READLINK have their own buffer checks.) if we
281 * fall below this level, we fail the next operation with NFS4ERR_RESOURCE. 279 * fall below this level, we fail the next operation with NFS4ERR_RESOURCE.
282 * 280 *
283 * COMPOUND_ERR_SLACK_SPACE - this is the minimum amount of buffer space 281 * COMPOUND_ERR_SLACK_SPACE - this is the minimum bytes of buffer space
284 * needed to encode an operation which has failed with NFS4ERR_RESOURCE. 282 * needed to encode an operation which has failed with NFS4ERR_RESOURCE.
285 * care is taken to ensure that we never fall below this level for any 283 * care is taken to ensure that we never fall below this level for any
286 * reason. 284 * reason.
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index f3b51d62ec7d..d9c6c382165d 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -217,11 +217,7 @@ void fh_put(struct svc_fh *);
217static __inline__ struct svc_fh * 217static __inline__ struct svc_fh *
218fh_copy(struct svc_fh *dst, struct svc_fh *src) 218fh_copy(struct svc_fh *dst, struct svc_fh *src)
219{ 219{
220 if (src->fh_dentry || src->fh_locked) { 220 WARN_ON(src->fh_dentry || src->fh_locked);
221 struct dentry *dentry = src->fh_dentry;
222 printk(KERN_ERR "fh_copy: copying %s/%s, already verified!\n",
223 dentry->d_parent->d_name.name, dentry->d_name.name);
224 }
225 221
226 *dst = *src; 222 *dst = *src;
227 return dst; 223 return dst;
@@ -300,10 +296,8 @@ fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
300 dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n", 296 dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n",
301 SVCFH_fmt(fhp), fhp->fh_locked); 297 SVCFH_fmt(fhp), fhp->fh_locked);
302 298
303 if (!fhp->fh_dentry) { 299 BUG_ON(!dentry);
304 printk(KERN_ERR "fh_lock: fh not verified!\n"); 300
305 return;
306 }
307 if (fhp->fh_locked) { 301 if (fhp->fh_locked) {
308 printk(KERN_WARNING "fh_lock: %s/%s already locked!\n", 302 printk(KERN_WARNING "fh_lock: %s/%s already locked!\n",
309 dentry->d_parent->d_name.name, dentry->d_name.name); 303 dentry->d_parent->d_name.name, dentry->d_name.name);
@@ -328,8 +322,7 @@ fh_lock(struct svc_fh *fhp)
328static inline void 322static inline void
329fh_unlock(struct svc_fh *fhp) 323fh_unlock(struct svc_fh *fhp)
330{ 324{
331 if (!fhp->fh_dentry) 325 BUG_ON(!fhp->fh_dentry);
332 printk(KERN_ERR "fh_unlock: fh not verified!\n");
333 326
334 if (fhp->fh_locked) { 327 if (fhp->fh_locked) {
335 fill_post_wcc(fhp); 328 fill_post_wcc(fhp);
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index c3673f487e84..ab5c236bd9a7 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -273,7 +273,6 @@ struct nfs4_stateid {
273 ((err) != nfserr_stale_stateid) && \ 273 ((err) != nfserr_stale_stateid) && \
274 ((err) != nfserr_bad_stateid)) 274 ((err) != nfserr_bad_stateid))
275 275
276extern __be32 nfsd4_renew(clientid_t *clid);
277extern __be32 nfs4_preprocess_stateid_op(struct svc_fh *current_fh, 276extern __be32 nfs4_preprocess_stateid_op(struct svc_fh *current_fh,
278 stateid_t *stateid, int flags, struct file **filp); 277 stateid_t *stateid, int flags, struct file **filp);
279extern void nfs4_lock_state(void); 278extern void nfs4_lock_state(void);
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h
index 877192d3ae79..67885d5e6e50 100644
--- a/include/linux/nfsd/xdr.h
+++ b/include/linux/nfsd/xdr.h
@@ -165,8 +165,8 @@ int nfssvc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd_readres *);
165int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *, struct nfsd_statfsres *); 165int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *, struct nfsd_statfsres *);
166int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *, struct nfsd_readdirres *); 166int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *, struct nfsd_readdirres *);
167 167
168int nfssvc_encode_entry(struct readdir_cd *, const char *name, 168int nfssvc_encode_entry(void *, const char *name,
169 int namlen, loff_t offset, ino_t ino, unsigned int); 169 int namlen, loff_t offset, u64 ino, unsigned int);
170 170
171int nfssvc_release_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); 171int nfssvc_release_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *);
172 172
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
index 79963867b0d7..89d9d6061a62 100644
--- a/include/linux/nfsd/xdr3.h
+++ b/include/linux/nfsd/xdr3.h
@@ -331,11 +331,11 @@ int nfs3svc_release_fhandle(struct svc_rqst *, __be32 *,
331 struct nfsd3_attrstat *); 331 struct nfsd3_attrstat *);
332int nfs3svc_release_fhandle2(struct svc_rqst *, __be32 *, 332int nfs3svc_release_fhandle2(struct svc_rqst *, __be32 *,
333 struct nfsd3_fhandle_pair *); 333 struct nfsd3_fhandle_pair *);
334int nfs3svc_encode_entry(struct readdir_cd *, const char *name, 334int nfs3svc_encode_entry(void *, const char *name,
335 int namlen, loff_t offset, ino_t ino, 335 int namlen, loff_t offset, u64 ino,
336 unsigned int); 336 unsigned int);
337int nfs3svc_encode_entry_plus(struct readdir_cd *, const char *name, 337int nfs3svc_encode_entry_plus(void *, const char *name,
338 int namlen, loff_t offset, ino_t ino, 338 int namlen, loff_t offset, u64 ino,
339 unsigned int); 339 unsigned int);
340/* Helper functions for NFSv3 ACL code */ 340/* Helper functions for NFSv3 ACL code */
341__be32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, 341__be32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p,
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 45ca01b5f844..09799bcee0ac 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -44,6 +44,12 @@
44#define NFSD4_MAX_TAGLEN 128 44#define NFSD4_MAX_TAGLEN 128
45#define XDR_LEN(n) (((n) + 3) & ~3) 45#define XDR_LEN(n) (((n) + 3) & ~3)
46 46
47struct nfsd4_compound_state {
48 struct svc_fh current_fh;
49 struct svc_fh save_fh;
50 struct nfs4_stateowner *replay_owner;
51};
52
47struct nfsd4_change_info { 53struct nfsd4_change_info {
48 u32 atomic; 54 u32 atomic;
49 u32 before_ctime_sec; 55 u32 before_ctime_sec;
@@ -430,35 +436,39 @@ __be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
430 struct dentry *dentry, __be32 *buffer, int *countp, 436 struct dentry *dentry, __be32 *buffer, int *countp,
431 u32 *bmval, struct svc_rqst *); 437 u32 *bmval, struct svc_rqst *);
432extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp, 438extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp,
439 struct nfsd4_compound_state *,
433 struct nfsd4_setclientid *setclid); 440 struct nfsd4_setclientid *setclid);
434extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp, 441extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
442 struct nfsd4_compound_state *,
435 struct nfsd4_setclientid_confirm *setclientid_confirm); 443 struct nfsd4_setclientid_confirm *setclientid_confirm);
436extern __be32 nfsd4_process_open1(struct nfsd4_open *open); 444extern __be32 nfsd4_process_open1(struct nfsd4_open *open);
437extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp, 445extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp,
438 struct svc_fh *current_fh, struct nfsd4_open *open); 446 struct svc_fh *current_fh, struct nfsd4_open *open);
439extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp, 447extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp,
440 struct svc_fh *current_fh, struct nfsd4_open_confirm *oc, 448 struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc);
441 struct nfs4_stateowner **); 449extern __be32 nfsd4_close(struct svc_rqst *rqstp,
442extern __be32 nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh, 450 struct nfsd4_compound_state *,
443 struct nfsd4_close *close, 451 struct nfsd4_close *close);
444 struct nfs4_stateowner **replay_owner);
445extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp, 452extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp,
446 struct svc_fh *current_fh, struct nfsd4_open_downgrade *od, 453 struct nfsd4_compound_state *,
447 struct nfs4_stateowner **replay_owner); 454 struct nfsd4_open_downgrade *od);
448extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, 455extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
449 struct nfsd4_lock *lock, 456 struct nfsd4_lock *lock);
450 struct nfs4_stateowner **replay_owner); 457extern __be32 nfsd4_lockt(struct svc_rqst *rqstp,
451extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, struct svc_fh *current_fh, 458 struct nfsd4_compound_state *,
452 struct nfsd4_lockt *lockt); 459 struct nfsd4_lockt *lockt);
453extern __be32 nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh, 460extern __be32 nfsd4_locku(struct svc_rqst *rqstp,
454 struct nfsd4_locku *locku, 461 struct nfsd4_compound_state *,
455 struct nfs4_stateowner **replay_owner); 462 struct nfsd4_locku *locku);
456extern __be32 463extern __be32
457nfsd4_release_lockowner(struct svc_rqst *rqstp, 464nfsd4_release_lockowner(struct svc_rqst *rqstp,
465 struct nfsd4_compound_state *,
458 struct nfsd4_release_lockowner *rlockowner); 466 struct nfsd4_release_lockowner *rlockowner);
459extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *); 467extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *);
460extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp, 468extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp,
461 struct svc_fh *current_fh, struct nfsd4_delegreturn *dr); 469 struct nfsd4_compound_state *, struct nfsd4_delegreturn *dr);
470extern __be32 nfsd4_renew(struct svc_rqst *rqstp,
471 struct nfsd4_compound_state *, clientid_t *clid);
462#endif 472#endif
463 473
464/* 474/*
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index 971d1c6dfc4b..0b9f0dc30d61 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -4,9 +4,10 @@
4#include <linux/spinlock.h> 4#include <linux/spinlock.h>
5#include <linux/sched.h> 5#include <linux/sched.h>
6 6
7struct namespace; 7struct mnt_namespace;
8struct uts_namespace; 8struct uts_namespace;
9struct ipc_namespace; 9struct ipc_namespace;
10struct pid_namespace;
10 11
11/* 12/*
12 * A structure to contain pointers to all per-process 13 * A structure to contain pointers to all per-process
@@ -25,7 +26,8 @@ struct nsproxy {
25 spinlock_t nslock; 26 spinlock_t nslock;
26 struct uts_namespace *uts_ns; 27 struct uts_namespace *uts_ns;
27 struct ipc_namespace *ipc_ns; 28 struct ipc_namespace *ipc_ns;
28 struct namespace *namespace; 29 struct mnt_namespace *mnt_ns;
30 struct pid_namespace *pid_ns;
29}; 31};
30extern struct nsproxy init_nsproxy; 32extern struct nsproxy init_nsproxy;
31 33
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 4830a3bedfb2..350878a2d848 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -253,15 +253,11 @@ static inline void SetPageUptodate(struct page *page)
253 253
254struct page; /* forward declaration */ 254struct page; /* forward declaration */
255 255
256int test_clear_page_dirty(struct page *page); 256extern void cancel_dirty_page(struct page *page, unsigned int account_size);
257
257int test_clear_page_writeback(struct page *page); 258int test_clear_page_writeback(struct page *page);
258int test_set_page_writeback(struct page *page); 259int test_set_page_writeback(struct page *page);
259 260
260static inline void clear_page_dirty(struct page *page)
261{
262 test_clear_page_dirty(page);
263}
264
265static inline void set_page_writeback(struct page *page) 261static inline void set_page_writeback(struct page *page)
266{ 262{
267 test_set_page_writeback(page); 263 test_set_page_writeback(page);
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 01c707261f9c..9e3042e7e1cc 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -20,9 +20,6 @@
20/* Include the pci register defines */ 20/* Include the pci register defines */
21#include <linux/pci_regs.h> 21#include <linux/pci_regs.h>
22 22
23/* Include the ID list */
24#include <linux/pci_ids.h>
25
26/* 23/*
27 * The PCI interface treats multi-function devices as independent 24 * The PCI interface treats multi-function devices as independent
28 * devices. The slot/function address of each device is encoded 25 * devices. The slot/function address of each device is encoded
@@ -54,6 +51,9 @@
54#include <asm/atomic.h> 51#include <asm/atomic.h>
55#include <linux/device.h> 52#include <linux/device.h>
56 53
54/* Include the ID list */
55#include <linux/pci_ids.h>
56
57/* File state for mmap()s on /proc/bus/pci/X/Y */ 57/* File state for mmap()s on /proc/bus/pci/X/Y */
58enum pci_mmap_state { 58enum pci_mmap_state {
59 pci_mmap_io, 59 pci_mmap_io,
@@ -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{
@@ -396,6 +405,21 @@ struct pci_driver {
396 */ 405 */
397#define pci_module_init pci_register_driver 406#define pci_module_init pci_register_driver
398 407
408/**
409 * PCI_VDEVICE - macro used to describe a specific pci device in short form
410 * @vend: the vendor name
411 * @dev: the 16 bit PCI Device ID
412 *
413 * This macro is used to create a struct pci_device_id that matches a
414 * specific PCI device. The subvendor, and subdevice fields will be set
415 * to PCI_ANY_ID. The macro allows the next field to follow as the device
416 * private data.
417 */
418
419#define PCI_VDEVICE(vendor, device) \
420 PCI_VENDOR_ID_##vendor, (device), \
421 PCI_ANY_ID, PCI_ANY_ID, 0, 0
422
399/* these external functions are only available when PCI support is enabled */ 423/* these external functions are only available when PCI support is enabled */
400#ifdef CONFIG_PCI 424#ifdef CONFIG_PCI
401 425
@@ -448,12 +472,13 @@ extern void pci_sort_breadthfirst(void);
448 472
449/* Generic PCI functions exported to card drivers */ 473/* Generic PCI functions exported to card drivers */
450 474
451struct 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);
452struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int device, const struct pci_dev *from);
453struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); 476struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
454int pci_find_capability (struct pci_dev *dev, int cap); 477int pci_find_capability (struct pci_dev *dev, int cap);
455int 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);
456int pci_find_ext_capability (struct pci_dev *dev, int cap); 479int pci_find_ext_capability (struct pci_dev *dev, int cap);
480int pci_find_ht_capability (struct pci_dev *dev, int ht_cap);
481int pci_find_next_ht_capability (struct pci_dev *dev, int pos, int ht_cap);
457struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 482struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
458 483
459struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, 484struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
@@ -468,6 +493,7 @@ struct pci_dev *pci_get_slot (struct pci_bus *bus, unsigned int devfn);
468struct pci_dev *pci_get_bus_and_slot (unsigned int bus, unsigned int devfn); 493struct pci_dev *pci_get_bus_and_slot (unsigned int bus, unsigned int devfn);
469struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from); 494struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from);
470int pci_dev_present(const struct pci_device_id *ids); 495int pci_dev_present(const struct pci_device_id *ids);
496const struct pci_device_id *pci_find_present(const struct pci_device_id *ids);
471 497
472int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val); 498int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val);
473int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *val); 499int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *val);
@@ -503,6 +529,14 @@ static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val
503 529
504int __must_check pci_enable_device(struct pci_dev *dev); 530int __must_check pci_enable_device(struct pci_dev *dev);
505int __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
506void pci_disable_device(struct pci_dev *dev); 540void pci_disable_device(struct pci_dev *dev);
507void pci_set_master(struct pci_dev *dev); 541void pci_set_master(struct pci_dev *dev);
508#define HAVE_PCI_SET_MWI 542#define HAVE_PCI_SET_MWI
@@ -515,6 +549,7 @@ void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
515int __must_check pci_assign_resource(struct pci_dev *dev, int i); 549int __must_check pci_assign_resource(struct pci_dev *dev, int i);
516int __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);
517void 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);
518 553
519/* ROM control related routines */ 554/* ROM control related routines */
520void __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);
@@ -543,6 +578,8 @@ int __must_check pci_request_regions(struct pci_dev *, const char *);
543void pci_release_regions(struct pci_dev *); 578void pci_release_regions(struct pci_dev *);
544int __must_check pci_request_region(struct pci_dev *, int, const char *); 579int __must_check pci_request_region(struct pci_dev *, int, const char *);
545void 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);
546 583
547/* drivers/pci/bus.c */ 584/* drivers/pci/bus.c */
548int __must_check pci_bus_alloc_resource(struct pci_bus *bus, 585int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
@@ -555,10 +592,11 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
555void pci_enable_bridges(struct pci_bus *bus); 592void pci_enable_bridges(struct pci_bus *bus);
556 593
557/* Proper probing supporting hot-pluggable devices */ 594/* Proper probing supporting hot-pluggable devices */
558int __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);
559static inline int __must_check pci_register_driver(struct pci_driver *driver) 597static inline int __must_check pci_register_driver(struct pci_driver *driver)
560{ 598{
561 return __pci_register_driver(driver, THIS_MODULE); 599 return __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME);
562} 600}
563 601
564void pci_unregister_driver(struct pci_driver *); 602void pci_unregister_driver(struct pci_driver *);
@@ -593,10 +631,6 @@ enum pci_dma_burst_strategy {
593 strategy_parameter byte boundaries */ 631 strategy_parameter byte boundaries */
594}; 632};
595 633
596#if defined(CONFIG_ISA) || defined(CONFIG_EISA)
597extern struct pci_dev *isa_bridge;
598#endif
599
600struct msix_entry { 634struct msix_entry {
601 u16 vector; /* kernel uses to write allocated vector */ 635 u16 vector; /* kernel uses to write allocated vector */
602 u16 entry; /* driver uses to specify entry, OS writes */ 636 u16 entry; /* driver uses to specify entry, OS writes */
@@ -604,7 +638,6 @@ struct msix_entry {
604 638
605 639
606#ifndef CONFIG_PCI_MSI 640#ifndef CONFIG_PCI_MSI
607static inline void pci_scan_msi_device(struct pci_dev *dev) {}
608static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} 641static inline int pci_enable_msi(struct pci_dev *dev) {return -1;}
609static inline void pci_disable_msi(struct pci_dev *dev) {} 642static inline void pci_disable_msi(struct pci_dev *dev) {}
610static inline int pci_enable_msix(struct pci_dev* dev, 643static inline int pci_enable_msix(struct pci_dev* dev,
@@ -612,7 +645,6 @@ static inline int pci_enable_msix(struct pci_dev* dev,
612static inline void pci_disable_msix(struct pci_dev *dev) {} 645static inline void pci_disable_msix(struct pci_dev *dev) {}
613static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {} 646static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {}
614#else 647#else
615extern void pci_scan_msi_device(struct pci_dev *dev);
616extern int pci_enable_msi(struct pci_dev *dev); 648extern int pci_enable_msi(struct pci_dev *dev);
617extern void pci_disable_msi(struct pci_dev *dev); 649extern void pci_disable_msi(struct pci_dev *dev);
618extern int pci_enable_msix(struct pci_dev* dev, 650extern int pci_enable_msix(struct pci_dev* dev,
@@ -681,6 +713,7 @@ static inline struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *
681{ return NULL; } 713{ return NULL; }
682 714
683#define pci_dev_present(ids) (0) 715#define pci_dev_present(ids) (0)
716#define pci_find_present(ids) (NULL)
684#define pci_dev_put(dev) do { } while (0) 717#define pci_dev_put(dev) do { } while (0)
685 718
686static inline void pci_set_master(struct pci_dev *dev) { } 719static inline void pci_set_master(struct pci_dev *dev) { }
@@ -703,8 +736,6 @@ static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) {
703static 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; }
704static 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; }
705 738
706#define isa_bridge ((struct pci_dev *)NULL)
707
708#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)
709 740
710static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } 741static inline void pci_block_user_cfg_access(struct pci_dev *dev) { }
@@ -783,6 +814,7 @@ enum pci_fixup_pass {
783 pci_fixup_header, /* After reading configuration header */ 814 pci_fixup_header, /* After reading configuration header */
784 pci_fixup_final, /* Final phase of device fixups */ 815 pci_fixup_final, /* Final phase of device fixups */
785 pci_fixup_enable, /* pci_enable_device() time */ 816 pci_fixup_enable, /* pci_enable_device() time */
817 pci_fixup_resume, /* pci_enable_device() time */
786}; 818};
787 819
788/* Anonymous variables would be nice... */ 820/* Anonymous variables would be nice... */
@@ -801,6 +833,9 @@ enum pci_fixup_pass {
801#define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ 833#define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \
802 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ 834 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \
803 vendor##device##hook, vendor, device, hook) 835 vendor##device##hook, vendor, device, hook)
836#define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \
837 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \
838 resume##vendor##device##hook, vendor, device, hook)
804 839
805 840
806void 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);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 4d972bbef316..e67b68ca235a 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
@@ -104,6 +107,10 @@
104#define PCI_CLASS_SERIAL_FIBER 0x0c04 107#define PCI_CLASS_SERIAL_FIBER 0x0c04
105#define PCI_CLASS_SERIAL_SMBUS 0x0c05 108#define PCI_CLASS_SERIAL_SMBUS 0x0c05
106 109
110#define PCI_BASE_CLASS_WIRELESS 0x0d
111#define PCI_CLASS_WIRELESS_RF_CONTROLLER 0x0d10
112#define PCI_CLASS_WIRELESS_WHCI 0x0d1010
113
107#define PCI_BASE_CLASS_INTELLIGENT 0x0e 114#define PCI_BASE_CLASS_INTELLIGENT 0x0e
108#define PCI_CLASS_INTELLIGENT_I2O 0x0e00 115#define PCI_CLASS_INTELLIGENT_I2O 0x0e00
109 116
@@ -731,9 +738,11 @@
731#define PCI_DEVICE_ID_TI_TVP4020 0x3d07 738#define PCI_DEVICE_ID_TI_TVP4020 0x3d07
732#define PCI_DEVICE_ID_TI_4450 0x8011 739#define PCI_DEVICE_ID_TI_4450 0x8011
733#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
734#define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034 742#define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034
735#define PCI_DEVICE_ID_TI_X515 0x8036 743#define PCI_DEVICE_ID_TI_X515 0x8036
736#define PCI_DEVICE_ID_TI_XX12 0x8039 744#define PCI_DEVICE_ID_TI_XX12 0x8039
745#define PCI_DEVICE_ID_TI_XX12_FM 0x803b
737#define PCI_DEVICE_ID_TI_1130 0xac12 746#define PCI_DEVICE_ID_TI_1130 0xac12
738#define PCI_DEVICE_ID_TI_1031 0xac13 747#define PCI_DEVICE_ID_TI_1031 0xac13
739#define PCI_DEVICE_ID_TI_1131 0xac15 748#define PCI_DEVICE_ID_TI_1131 0xac15
@@ -761,6 +770,7 @@
761#define PCI_DEVICE_ID_TI_1510 0xac56 770#define PCI_DEVICE_ID_TI_1510 0xac56
762#define PCI_DEVICE_ID_TI_X620 0xac8d 771#define PCI_DEVICE_ID_TI_X620 0xac8d
763#define PCI_DEVICE_ID_TI_X420 0xac8e 772#define PCI_DEVICE_ID_TI_X420 0xac8e
773#define PCI_DEVICE_ID_TI_XX20_FM 0xac8f
764 774
765#define PCI_VENDOR_ID_SONY 0x104d 775#define PCI_VENDOR_ID_SONY 0x104d
766 776
@@ -1273,12 +1283,13 @@
1273#define PCI_DEVICE_ID_VIA_3296_0 0x0296 1283#define PCI_DEVICE_ID_VIA_3296_0 0x0296
1274#define PCI_DEVICE_ID_VIA_8363_0 0x0305 1284#define PCI_DEVICE_ID_VIA_8363_0 0x0305
1275#define PCI_DEVICE_ID_VIA_P4M800CE 0x0314 1285#define PCI_DEVICE_ID_VIA_P4M800CE 0x0314
1286#define PCI_DEVICE_ID_VIA_P4M890 0x0327
1287#define PCI_DEVICE_ID_VIA_VT3336 0x0336
1276#define PCI_DEVICE_ID_VIA_8371_0 0x0391 1288#define PCI_DEVICE_ID_VIA_8371_0 0x0391
1277#define PCI_DEVICE_ID_VIA_8501_0 0x0501 1289#define PCI_DEVICE_ID_VIA_8501_0 0x0501
1278#define PCI_DEVICE_ID_VIA_82C561 0x0561 1290#define PCI_DEVICE_ID_VIA_82C561 0x0561
1279#define PCI_DEVICE_ID_VIA_82C586_1 0x0571 1291#define PCI_DEVICE_ID_VIA_82C586_1 0x0571
1280#define PCI_DEVICE_ID_VIA_82C576 0x0576 1292#define PCI_DEVICE_ID_VIA_82C576 0x0576
1281#define PCI_DEVICE_ID_VIA_SATA_EIDE 0x0581
1282#define PCI_DEVICE_ID_VIA_82C586_0 0x0586 1293#define PCI_DEVICE_ID_VIA_82C586_0 0x0586
1283#define PCI_DEVICE_ID_VIA_82C596 0x0596 1294#define PCI_DEVICE_ID_VIA_82C596 0x0596
1284#define PCI_DEVICE_ID_VIA_82C597_0 0x0597 1295#define PCI_DEVICE_ID_VIA_82C597_0 0x0597
@@ -1321,6 +1332,8 @@
1321#define PCI_DEVICE_ID_VIA_8237 0x3227 1332#define PCI_DEVICE_ID_VIA_8237 0x3227
1322#define PCI_DEVICE_ID_VIA_8251 0x3287 1333#define PCI_DEVICE_ID_VIA_8251 0x3287
1323#define PCI_DEVICE_ID_VIA_8237A 0x3337 1334#define PCI_DEVICE_ID_VIA_8237A 0x3337
1335#define PCI_DEVICE_ID_VIA_8237S 0x3372
1336#define PCI_DEVICE_ID_VIA_SATA_EIDE 0x5324
1324#define PCI_DEVICE_ID_VIA_8231 0x8231 1337#define PCI_DEVICE_ID_VIA_8231 0x8231
1325#define PCI_DEVICE_ID_VIA_8231_4 0x8235 1338#define PCI_DEVICE_ID_VIA_8231_4 0x8235
1326#define PCI_DEVICE_ID_VIA_8365_1 0x8305 1339#define PCI_DEVICE_ID_VIA_8365_1 0x8305
@@ -1444,6 +1457,7 @@
1444 1457
1445#define PCI_VENDOR_ID_TOSHIBA_2 0x102f 1458#define PCI_VENDOR_ID_TOSHIBA_2 0x102f
1446#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 1459#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030
1460#define PCI_DEVICE_ID_TOSHIBA_TC86C001_IDE 0x0105
1447#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 1461#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108
1448#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3 1462#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3
1449 1463
@@ -1621,6 +1635,7 @@
1621#define PCI_VENDOR_ID_ITE 0x1283 1635#define PCI_VENDOR_ID_ITE 0x1283
1622#define PCI_DEVICE_ID_ITE_8211 0x8211 1636#define PCI_DEVICE_ID_ITE_8211 0x8211
1623#define PCI_DEVICE_ID_ITE_8212 0x8212 1637#define PCI_DEVICE_ID_ITE_8212 0x8212
1638#define PCI_DEVICE_ID_ITE_8213 0x8213
1624#define PCI_DEVICE_ID_ITE_8872 0x8872 1639#define PCI_DEVICE_ID_ITE_8872 0x8872
1625#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886 1640#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886
1626 1641
@@ -1785,14 +1800,17 @@
1785#define PCI_DEVICE_ID_MOXA_C104 0x1040 1800#define PCI_DEVICE_ID_MOXA_C104 0x1040
1786#define PCI_DEVICE_ID_MOXA_CP104U 0x1041 1801#define PCI_DEVICE_ID_MOXA_CP104U 0x1041
1787#define PCI_DEVICE_ID_MOXA_CP104JU 0x1042 1802#define PCI_DEVICE_ID_MOXA_CP104JU 0x1042
1803#define PCI_DEVICE_ID_MOXA_CP104EL 0x1043
1788#define PCI_DEVICE_ID_MOXA_CT114 0x1140 1804#define PCI_DEVICE_ID_MOXA_CT114 0x1140
1789#define PCI_DEVICE_ID_MOXA_CP114 0x1141 1805#define PCI_DEVICE_ID_MOXA_CP114 0x1141
1790#define PCI_DEVICE_ID_MOXA_CP118U 0x1180 1806#define PCI_DEVICE_ID_MOXA_CP118U 0x1180
1807#define PCI_DEVICE_ID_MOXA_CP118EL 0x1181
1791#define PCI_DEVICE_ID_MOXA_CP132 0x1320 1808#define PCI_DEVICE_ID_MOXA_CP132 0x1320
1792#define PCI_DEVICE_ID_MOXA_CP132U 0x1321 1809#define PCI_DEVICE_ID_MOXA_CP132U 0x1321
1793#define PCI_DEVICE_ID_MOXA_CP134U 0x1340 1810#define PCI_DEVICE_ID_MOXA_CP134U 0x1340
1794#define PCI_DEVICE_ID_MOXA_C168 0x1680 1811#define PCI_DEVICE_ID_MOXA_C168 0x1680
1795#define PCI_DEVICE_ID_MOXA_CP168U 0x1681 1812#define PCI_DEVICE_ID_MOXA_CP168U 0x1681
1813#define PCI_DEVICE_ID_MOXA_CP168EL 0x1682
1796 1814
1797#define PCI_VENDOR_ID_CCD 0x1397 1815#define PCI_VENDOR_ID_CCD 0x1397
1798#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 1816#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0
@@ -1961,6 +1979,7 @@
1961#define PCI_DEVICE_ID_TOPIC_TP560 0x0000 1979#define PCI_DEVICE_ID_TOPIC_TP560 0x0000
1962 1980
1963#define PCI_VENDOR_ID_ENE 0x1524 1981#define PCI_VENDOR_ID_ENE 0x1524
1982#define PCI_DEVICE_ID_ENE_CB712_SD 0x0550
1964#define PCI_DEVICE_ID_ENE_1211 0x1211 1983#define PCI_DEVICE_ID_ENE_1211 0x1211
1965#define PCI_DEVICE_ID_ENE_1225 0x1225 1984#define PCI_DEVICE_ID_ENE_1225 0x1225
1966#define PCI_DEVICE_ID_ENE_1410 0x1410 1985#define PCI_DEVICE_ID_ENE_1410 0x1410
@@ -2056,6 +2075,10 @@
2056#define PCI_VENDOR_ID_TDI 0x192E 2075#define PCI_VENDOR_ID_TDI 0x192E
2057#define PCI_DEVICE_ID_TDI_EHCI 0x0101 2076#define PCI_DEVICE_ID_TDI_EHCI 0x0101
2058 2077
2078#define PCI_VENDOR_ID_PASEMI 0x1959
2079
2080#define PCI_VENDOR_ID_ATTANSIC 0x1969
2081
2059#define PCI_VENDOR_ID_JMICRON 0x197B 2082#define PCI_VENDOR_ID_JMICRON 0x197B
2060#define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 2083#define PCI_DEVICE_ID_JMICRON_JMB360 0x2360
2061#define PCI_DEVICE_ID_JMICRON_JMB361 0x2361 2084#define PCI_DEVICE_ID_JMICRON_JMB361 0x2361
@@ -2064,6 +2087,10 @@
2064#define PCI_DEVICE_ID_JMICRON_JMB366 0x2366 2087#define PCI_DEVICE_ID_JMICRON_JMB366 0x2366
2065#define PCI_DEVICE_ID_JMICRON_JMB368 0x2368 2088#define PCI_DEVICE_ID_JMICRON_JMB368 0x2368
2066 2089
2090#define PCI_VENDOR_ID_KORENIX 0x1982
2091#define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600
2092#define PCI_DEVICE_ID_KORENIX_JETCARDF1 0x16ff
2093
2067#define PCI_VENDOR_ID_TEKRAM 0x1de1 2094#define PCI_VENDOR_ID_TEKRAM 0x1de1
2068#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 2095#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29
2069 2096
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 064b1dc71c22..7a6d34ee5ab1 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -475,15 +475,32 @@
475#define PCI_PWR_CAP 12 /* Capability */ 475#define PCI_PWR_CAP 12 /* Capability */
476#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ 476#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
477 477
478/* Hypertransport sub capability types */ 478/*
479 * Hypertransport sub capability types
480 *
481 * Unfortunately there are both 3 bit and 5 bit capability types defined
482 * in the HT spec, catering for that is a little messy. You probably don't
483 * want to use these directly, just use pci_find_ht_capability() and it
484 * will do the right thing for you.
485 */
486#define HT_3BIT_CAP_MASK 0xE0
479#define HT_CAPTYPE_SLAVE 0x00 /* Slave/Primary link configuration */ 487#define HT_CAPTYPE_SLAVE 0x00 /* Slave/Primary link configuration */
480#define HT_CAPTYPE_HOST 0x20 /* Host/Secondary link configuration */ 488#define HT_CAPTYPE_HOST 0x20 /* Host/Secondary link configuration */
489
490#define HT_5BIT_CAP_MASK 0xF8
481#define HT_CAPTYPE_IRQ 0x80 /* IRQ Configuration */ 491#define HT_CAPTYPE_IRQ 0x80 /* IRQ Configuration */
482#define HT_CAPTYPE_REMAPPING_40 0xA0 /* 40 bit address remapping */ 492#define HT_CAPTYPE_REMAPPING_40 0xA0 /* 40 bit address remapping */
483#define HT_CAPTYPE_REMAPPING_64 0xA2 /* 64 bit address remapping */ 493#define HT_CAPTYPE_REMAPPING_64 0xA2 /* 64 bit address remapping */
484#define HT_CAPTYPE_UNITID_CLUMP 0x90 /* Unit ID clumping */ 494#define HT_CAPTYPE_UNITID_CLUMP 0x90 /* Unit ID clumping */
485#define HT_CAPTYPE_EXTCONF 0x98 /* Extended Configuration Space Access */ 495#define HT_CAPTYPE_EXTCONF 0x98 /* Extended Configuration Space Access */
486#define HT_CAPTYPE_MSI_MAPPING 0xA8 /* MSI Mapping Capability */ 496#define HT_CAPTYPE_MSI_MAPPING 0xA8 /* MSI Mapping Capability */
497#define HT_MSI_FLAGS 0x02 /* Offset to flags */
498#define HT_MSI_FLAGS_ENABLE 0x1 /* Mapping enable */
499#define HT_MSI_FLAGS_FIXED 0x2 /* Fixed mapping only */
500#define HT_MSI_FIXED_ADDR 0x00000000FEE00000ULL /* Fixed addr */
501#define HT_MSI_ADDR_LO 0x04 /* Offset to low addr bits */
502#define HT_MSI_ADDR_LO_MASK 0xFFF00000 /* Low address bit mask */
503#define HT_MSI_ADDR_HI 0x08 /* Offset to high addr bits */
487#define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */ 504#define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */
488#define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */ 505#define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */
489#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */ 506#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */
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/pid.h b/include/linux/pid.h
index 2c0007d17218..4dec047b1837 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -35,8 +35,9 @@ enum pid_type
35 * 35 *
36 * Holding a reference to struct pid solves both of these problems. 36 * Holding a reference to struct pid solves both of these problems.
37 * It is small so holding a reference does not consume a lot of 37 * It is small so holding a reference does not consume a lot of
38 * resources, and since a new struct pid is allocated when the numeric 38 * resources, and since a new struct pid is allocated when the numeric pid
39 * pid value is reused we don't mistakenly refer to new processes. 39 * value is reused (when pids wrap around) we don't mistakenly refer to new
40 * processes.
40 */ 41 */
41 42
42struct pid 43struct pid
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
new file mode 100644
index 000000000000..2833806d42c6
--- /dev/null
+++ b/include/linux/pid_namespace.h
@@ -0,0 +1,45 @@
1#ifndef _LINUX_PID_NS_H
2#define _LINUX_PID_NS_H
3
4#include <linux/sched.h>
5#include <linux/mm.h>
6#include <linux/threads.h>
7#include <linux/pid.h>
8#include <linux/nsproxy.h>
9#include <linux/kref.h>
10
11struct pidmap {
12 atomic_t nr_free;
13 void *page;
14};
15
16#define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8)
17
18struct pid_namespace {
19 struct kref kref;
20 struct pidmap pidmap[PIDMAP_ENTRIES];
21 int last_pid;
22 struct task_struct *child_reaper;
23};
24
25extern struct pid_namespace init_pid_ns;
26
27static inline void get_pid_ns(struct pid_namespace *ns)
28{
29 kref_get(&ns->kref);
30}
31
32extern int copy_pid_ns(int flags, struct task_struct *tsk);
33extern void free_pid_ns(struct kref *kref);
34
35static inline void put_pid_ns(struct pid_namespace *ns)
36{
37 kref_put(&ns->kref, free_pid_ns);
38}
39
40static inline struct task_struct *child_reaper(struct task_struct *tsk)
41{
42 return init_pid_ns.child_reaper;
43}
44
45#endif /* _LINUX_PID_NS_H */
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index ea4f7cd7bfd8..2e19478e9e84 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -12,7 +12,7 @@
12struct pipe_buffer { 12struct pipe_buffer {
13 struct page *page; 13 struct page *page;
14 unsigned int offset, len; 14 unsigned int offset, len;
15 struct pipe_buf_operations *ops; 15 const struct pipe_buf_operations *ops;
16 unsigned int flags; 16 unsigned int flags;
17}; 17};
18 18
@@ -41,9 +41,7 @@ struct pipe_buf_operations {
41struct pipe_inode_info { 41struct pipe_inode_info {
42 wait_queue_head_t wait; 42 wait_queue_head_t wait;
43 unsigned int nrbufs, curbuf; 43 unsigned int nrbufs, curbuf;
44 struct pipe_buffer bufs[PIPE_BUFFERS];
45 struct page *tmp_page; 44 struct page *tmp_page;
46 unsigned int start;
47 unsigned int readers; 45 unsigned int readers;
48 unsigned int writers; 46 unsigned int writers;
49 unsigned int waiting_writers; 47 unsigned int waiting_writers;
@@ -52,6 +50,7 @@ struct pipe_inode_info {
52 struct fasync_struct *fasync_readers; 50 struct fasync_struct *fasync_readers;
53 struct fasync_struct *fasync_writers; 51 struct fasync_struct *fasync_writers;
54 struct inode *inode; 52 struct inode *inode;
53 struct pipe_buffer bufs[PIPE_BUFFERS];
55}; 54};
56 55
57/* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual 56/* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h
index 8a94c717c266..5ea4f05683f6 100644
--- a/include/linux/pktcdvd.h
+++ b/include/linux/pktcdvd.h
@@ -111,6 +111,13 @@ struct pkt_ctrl_command {
111#include <linux/blkdev.h> 111#include <linux/blkdev.h>
112#include <linux/completion.h> 112#include <linux/completion.h>
113#include <linux/cdrom.h> 113#include <linux/cdrom.h>
114#include <linux/kobject.h>
115#include <linux/sysfs.h>
116
117/* default bio write queue congestion marks */
118#define PKT_WRITE_CONGESTION_ON 10000
119#define PKT_WRITE_CONGESTION_OFF 9000
120
114 121
115struct packet_settings 122struct packet_settings
116{ 123{
@@ -241,6 +248,14 @@ struct packet_stacked_data
241}; 248};
242#define PSD_POOL_SIZE 64 249#define PSD_POOL_SIZE 64
243 250
251struct pktcdvd_kobj
252{
253 struct kobject kobj;
254 struct pktcdvd_device *pd;
255};
256#define to_pktcdvdkobj(_k) \
257 ((struct pktcdvd_kobj*)container_of(_k,struct pktcdvd_kobj,kobj))
258
244struct pktcdvd_device 259struct pktcdvd_device
245{ 260{
246 struct block_device *bdev; /* dev attached */ 261 struct block_device *bdev; /* dev attached */
@@ -271,6 +286,16 @@ struct pktcdvd_device
271 286
272 struct packet_iosched iosched; 287 struct packet_iosched iosched;
273 struct gendisk *disk; 288 struct gendisk *disk;
289
290 int write_congestion_off;
291 int write_congestion_on;
292
293 struct class_device *clsdev; /* sysfs pktcdvd[0-7] class dev */
294 struct pktcdvd_kobj *kobj_stat; /* sysfs pktcdvd[0-7]/stat/ */
295 struct pktcdvd_kobj *kobj_wqueue; /* sysfs pktcdvd[0-7]/write_queue/ */
296
297 struct dentry *dfs_d_root; /* debugfs: devname directory */
298 struct dentry *dfs_f_info; /* debugfs: info file */
274}; 299};
275 300
276#endif /* __KERNEL__ */ 301#endif /* __KERNEL__ */
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 20f47b81d3fa..8bbd459eafdc 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -39,7 +39,7 @@ extern struct platform_device *platform_device_register_simple(char *, unsigned
39 39
40extern struct platform_device *platform_device_alloc(const char *name, unsigned int id); 40extern struct platform_device *platform_device_alloc(const char *name, unsigned int id);
41extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); 41extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num);
42extern int platform_device_add_data(struct platform_device *pdev, void *data, size_t size); 42extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size);
43extern int platform_device_add(struct platform_device *pdev); 43extern int platform_device_add(struct platform_device *pdev);
44extern void platform_device_del(struct platform_device *pdev); 44extern void platform_device_del(struct platform_device *pdev);
45extern void platform_device_put(struct platform_device *pdev); 45extern void platform_device_put(struct platform_device *pdev);
diff --git a/include/linux/profile.h b/include/linux/profile.h
index 5670b340c4ef..eec48f5f9348 100644
--- a/include/linux/profile.h
+++ b/include/linux/profile.h
@@ -15,6 +15,7 @@ extern int prof_on __read_mostly;
15#define CPU_PROFILING 1 15#define CPU_PROFILING 1
16#define SCHED_PROFILING 2 16#define SCHED_PROFILING 2
17#define SLEEP_PROFILING 3 17#define SLEEP_PROFILING 3
18#define KVM_PROFILING 4
18 19
19struct proc_dir_entry; 20struct proc_dir_entry;
20struct pt_regs; 21struct pt_regs;
diff --git a/include/linux/pspace.h b/include/linux/pspace.h
deleted file mode 100644
index 91d48b8b2d99..000000000000
--- a/include/linux/pspace.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef _LINUX_PSPACE_H
2#define _LINUX_PSPACE_H
3
4#include <linux/sched.h>
5#include <linux/mm.h>
6#include <linux/threads.h>
7#include <linux/pid.h>
8
9struct pidmap {
10 atomic_t nr_free;
11 void *page;
12};
13
14#define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8)
15
16struct pspace {
17 struct pidmap pidmap[PIDMAP_ENTRIES];
18 int last_pid;
19};
20
21extern struct pspace init_pspace;
22
23#endif /* _LINUX_PSPACE_H */
diff --git a/include/linux/qic117.h b/include/linux/qic117.h
deleted file mode 100644
index 07b537e5d359..000000000000
--- a/include/linux/qic117.h
+++ /dev/null
@@ -1,290 +0,0 @@
1#ifndef _QIC117_H
2#define _QIC117_H
3
4/*
5 * Copyright (C) 1993-1996 Bas Laarhoven,
6 * (C) 1997 Claus-Justus Heine.
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, or (at your option)
11 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; see the file COPYING. If not, write to
20 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21
22 *
23 * $Source: /homes/cvs/ftape-stacked/include/linux/qic117.h,v $
24 * $Revision: 1.2 $
25 * $Date: 1997/10/05 19:19:32 $
26 *
27 * This file contains QIC-117 spec. related definitions for the
28 * QIC-40/80/3010/3020 floppy-tape driver "ftape" for Linux.
29 *
30 * These data were taken from the Quarter-Inch Cartridge
31 * Drive Standards, Inc. document titled:
32 * `Common Command Set Interface Specification for Flexible
33 * Disk Controller Based Minicartridge Tape Drives'
34 * document QIC-117 Revision J, 28 Aug 96.
35 * For more information, contact:
36 * Quarter-Inch Cartridge Drive Standards, Inc.
37 * 311 East Carrillo Street
38 * Santa Barbara, California 93101
39 * Telephone (805) 963-3853
40 * Fax (805) 962-1541
41 * WWW http://www.qic.org
42 *
43 * Current QIC standard revisions (of interest) are:
44 * QIC-40-MC, Rev. M, 2 Sep 92.
45 * QIC-80-MC, Rev. N, 20 Mar 96.
46 * QIC-80-MC, Rev. K, 15 Dec 94.
47 * QIC-113, Rev. G, 15 Jun 95.
48 * QIC-117, Rev. J, 28 Aug 96.
49 * QIC-122, Rev. B, 6 Mar 91.
50 * QIC-130, Rev. C, 2 Sep 92.
51 * QIC-3010-MC, Rev. F, 14 Jun 95.
52 * QIC-3020-MC, Rev. G, 31 Aug 95.
53 * QIC-CRF3, Rev. B, 15 Jun 95.
54 * */
55
56/*
57 * QIC-117 common command set rev. J.
58 * These commands are sent to the tape unit
59 * as number of pulses over the step line.
60 */
61
62typedef enum {
63 QIC_NO_COMMAND = 0,
64 QIC_RESET = 1,
65 QIC_REPORT_NEXT_BIT = 2,
66 QIC_PAUSE = 3,
67 QIC_MICRO_STEP_PAUSE = 4,
68 QIC_ALTERNATE_TIMEOUT = 5,
69 QIC_REPORT_DRIVE_STATUS = 6,
70 QIC_REPORT_ERROR_CODE = 7,
71 QIC_REPORT_DRIVE_CONFIGURATION = 8,
72 QIC_REPORT_ROM_VERSION = 9,
73 QIC_LOGICAL_FORWARD = 10,
74 QIC_PHYSICAL_REVERSE = 11,
75 QIC_PHYSICAL_FORWARD = 12,
76 QIC_SEEK_HEAD_TO_TRACK = 13,
77 QIC_SEEK_LOAD_POINT = 14,
78 QIC_ENTER_FORMAT_MODE = 15,
79 QIC_WRITE_REFERENCE_BURST = 16,
80 QIC_ENTER_VERIFY_MODE = 17,
81 QIC_STOP_TAPE = 18,
82/* commands 19-20: reserved */
83 QIC_MICRO_STEP_HEAD_UP = 21,
84 QIC_MICRO_STEP_HEAD_DOWN = 22,
85 QIC_SOFT_SELECT = 23,
86 QIC_SOFT_DESELECT = 24,
87 QIC_SKIP_REVERSE = 25,
88 QIC_SKIP_FORWARD = 26,
89 QIC_SELECT_RATE = 27,
90/* command 27, in ccs2: Select Rate or Format */
91 QIC_ENTER_DIAGNOSTIC_1 = 28,
92 QIC_ENTER_DIAGNOSTIC_2 = 29,
93 QIC_ENTER_PRIMARY_MODE = 30,
94/* command 31: vendor unique */
95 QIC_REPORT_VENDOR_ID = 32,
96 QIC_REPORT_TAPE_STATUS = 33,
97 QIC_SKIP_EXTENDED_REVERSE = 34,
98 QIC_SKIP_EXTENDED_FORWARD = 35,
99 QIC_CALIBRATE_TAPE_LENGTH = 36,
100 QIC_REPORT_FORMAT_SEGMENTS = 37,
101 QIC_SET_FORMAT_SEGMENTS = 38,
102/* commands 39-45: reserved */
103 QIC_PHANTOM_SELECT = 46,
104 QIC_PHANTOM_DESELECT = 47
105} qic117_cmd_t;
106
107typedef enum {
108 discretional = 0, required, ccs1, ccs2
109} qic_compatibility;
110
111typedef enum {
112 unused, mode, motion, report
113} command_types;
114
115struct qic117_command_table {
116 char *name;
117 __u8 mask;
118 __u8 state;
119 __u8 cmd_type;
120 __u8 non_intr;
121 __u8 level;
122};
123
124#define QIC117_COMMANDS {\
125/* command mask state cmd_type */\
126/* | name | | | non_intr */\
127/* | | | | | | level */\
128/* 0*/ {NULL, 0x00, 0x00, mode, 0, discretional},\
129/* 1*/ {"soft reset", 0x00, 0x00, motion, 1, required},\
130/* 2*/ {"report next bit", 0x00, 0x00, report, 0, required},\
131/* 3*/ {"pause", 0x36, 0x24, motion, 1, required},\
132/* 4*/ {"micro step pause", 0x36, 0x24, motion, 1, required},\
133/* 5*/ {"alternate command timeout", 0x00, 0x00, mode, 0, required},\
134/* 6*/ {"report drive status", 0x00, 0x00, report, 0, required},\
135/* 7*/ {"report error code", 0x01, 0x01, report, 0, required},\
136/* 8*/ {"report drive configuration",0x00, 0x00, report, 0, required},\
137/* 9*/ {"report rom version", 0x00, 0x00, report, 0, required},\
138/*10*/ {"logical forward", 0x37, 0x25, motion, 0, required},\
139/*11*/ {"physical reverse", 0x17, 0x05, motion, 0, required},\
140/*12*/ {"physical forward", 0x17, 0x05, motion, 0, required},\
141/*13*/ {"seek head to track", 0x37, 0x25, motion, 0, required},\
142/*14*/ {"seek load point", 0x17, 0x05, motion, 1, required},\
143/*15*/ {"enter format mode", 0x1f, 0x05, mode, 0, required},\
144/*16*/ {"write reference burst", 0x1f, 0x05, motion, 1, required},\
145/*17*/ {"enter verify mode", 0x37, 0x25, mode, 0, required},\
146/*18*/ {"stop tape", 0x00, 0x00, motion, 1, required},\
147/*19*/ {"reserved (19)", 0x00, 0x00, unused, 0, discretional},\
148/*20*/ {"reserved (20)", 0x00, 0x00, unused, 0, discretional},\
149/*21*/ {"micro step head up", 0x02, 0x00, motion, 0, required},\
150/*22*/ {"micro step head down", 0x02, 0x00, motion, 0, required},\
151/*23*/ {"soft select", 0x00, 0x00, mode, 0, discretional},\
152/*24*/ {"soft deselect", 0x00, 0x00, mode, 0, discretional},\
153/*25*/ {"skip segments reverse", 0x36, 0x24, motion, 1, required},\
154/*26*/ {"skip segments forward", 0x36, 0x24, motion, 1, required},\
155/*27*/ {"select rate or format", 0x03, 0x01, mode, 0, required /* [ccs2] */},\
156/*28*/ {"enter diag mode 1", 0x00, 0x00, mode, 0, discretional},\
157/*29*/ {"enter diag mode 2", 0x00, 0x00, mode, 0, discretional},\
158/*30*/ {"enter primary mode", 0x00, 0x00, mode, 0, required},\
159/*31*/ {"vendor unique (31)", 0x00, 0x00, unused, 0, discretional},\
160/*32*/ {"report vendor id", 0x00, 0x00, report, 0, required},\
161/*33*/ {"report tape status", 0x04, 0x04, report, 0, ccs1},\
162/*34*/ {"skip extended reverse", 0x36, 0x24, motion, 1, ccs1},\
163/*35*/ {"skip extended forward", 0x36, 0x24, motion, 1, ccs1},\
164/*36*/ {"calibrate tape length", 0x17, 0x05, motion, 1, ccs2},\
165/*37*/ {"report format segments", 0x17, 0x05, report, 0, ccs2},\
166/*38*/ {"set format segments", 0x17, 0x05, mode, 0, ccs2},\
167/*39*/ {"reserved (39)", 0x00, 0x00, unused, 0, discretional},\
168/*40*/ {"vendor unique (40)", 0x00, 0x00, unused, 0, discretional},\
169/*41*/ {"vendor unique (41)", 0x00, 0x00, unused, 0, discretional},\
170/*42*/ {"vendor unique (42)", 0x00, 0x00, unused, 0, discretional},\
171/*43*/ {"vendor unique (43)", 0x00, 0x00, unused, 0, discretional},\
172/*44*/ {"vendor unique (44)", 0x00, 0x00, unused, 0, discretional},\
173/*45*/ {"vendor unique (45)", 0x00, 0x00, unused, 0, discretional},\
174/*46*/ {"phantom select", 0x00, 0x00, mode, 0, discretional},\
175/*47*/ {"phantom deselect", 0x00, 0x00, mode, 0, discretional},\
176}
177
178/*
179 * Status bits returned by QIC_REPORT_DRIVE_STATUS
180 */
181
182#define QIC_STATUS_READY 0x01 /* Drive is ready or idle. */
183#define QIC_STATUS_ERROR 0x02 /* Error detected, must read
184 error code to clear this */
185#define QIC_STATUS_CARTRIDGE_PRESENT 0x04 /* Tape is present */
186#define QIC_STATUS_WRITE_PROTECT 0x08 /* Tape is write protected */
187#define QIC_STATUS_NEW_CARTRIDGE 0x10 /* New cartridge inserted, must
188 read error status to clear. */
189#define QIC_STATUS_REFERENCED 0x20 /* Cartridge appears to have been
190 formatted. */
191#define QIC_STATUS_AT_BOT 0x40 /* Cartridge is at physical
192 beginning of tape. */
193#define QIC_STATUS_AT_EOT 0x80 /* Cartridge is at physical end
194 of tape. */
195/*
196 * Status bits returned by QIC_REPORT_DRIVE_CONFIGURATION
197 */
198
199#define QIC_CONFIG_RATE_MASK 0x18
200#define QIC_CONFIG_RATE_SHIFT 3
201#define QIC_CONFIG_RATE_250 0
202#define QIC_CONFIG_RATE_500 2
203#define QIC_CONFIG_RATE_1000 3
204#define QIC_CONFIG_RATE_2000 1
205#define QIC_CONFIG_RATE_4000 0 /* since QIC-117 Rev. J */
206
207#define QIC_CONFIG_LONG 0x40 /* Extra Length Tape Detected */
208#define QIC_CONFIG_80 0x80 /* QIC-80 detected. */
209
210/*
211 * Status bits returned by QIC_REPORT_TAPE_STATUS
212 */
213
214#define QIC_TAPE_STD_MASK 0x0f
215#define QIC_TAPE_QIC40 0x01
216#define QIC_TAPE_QIC80 0x02
217#define QIC_TAPE_QIC3020 0x03
218#define QIC_TAPE_QIC3010 0x04
219
220#define QIC_TAPE_LEN_MASK 0x70
221#define QIC_TAPE_205FT 0x10
222#define QIC_TAPE_307FT 0x20
223#define QIC_TAPE_VARIABLE 0x30
224#define QIC_TAPE_1100FT 0x40
225#define QIC_TAPE_FLEX 0x60
226
227#define QIC_TAPE_WIDE 0x80
228
229/* Define a value (in feet) slightly higher than
230 * the possible maximum tape length.
231 */
232#define QIC_TOP_TAPE_LEN 1500
233
234/*
235 * Errors: List of error codes, and their severity.
236 */
237
238typedef struct {
239 char *message; /* Text describing the error. */
240 unsigned int fatal:1; /* Non-zero if the error is fatal. */
241} ftape_error;
242
243#define QIC117_ERRORS {\
244 /* 0*/ { "No error", 0, },\
245 /* 1*/ { "Command Received while Drive Not Ready", 0, },\
246 /* 2*/ { "Cartridge Not Present or Removed", 1, },\
247 /* 3*/ { "Motor Speed Error (not within 1%)", 1, },\
248 /* 4*/ { "Motor Speed Fault (jammed, or gross speed error", 1, },\
249 /* 5*/ { "Cartridge Write Protected", 1, },\
250 /* 6*/ { "Undefined or Reserved Command Code", 1, },\
251 /* 7*/ { "Illegal Track Address Specified for Seek", 1, },\
252 /* 8*/ { "Illegal Command in Report Subcontext", 0, },\
253 /* 9*/ { "Illegal Entry into a Diagnostic Mode", 1, },\
254 /*10*/ { "Broken Tape Detected (based on hole sensor)", 1, },\
255 /*11*/ { "Warning--Read Gain Setting Error", 1, },\
256 /*12*/ { "Command Received While Error Status Pending (obs)", 1, },\
257 /*13*/ { "Command Received While New Cartridge Pending", 1, },\
258 /*14*/ { "Command Illegal or Undefined in Primary Mode", 1, },\
259 /*15*/ { "Command Illegal or Undefined in Format Mode", 1, },\
260 /*16*/ { "Command Illegal or Undefined in Verify Mode", 1, },\
261 /*17*/ { "Logical Forward Not at Logical BOT or no Format Segments in Format Mode", 1, },\
262 /*18*/ { "Logical EOT Before All Segments generated", 1, },\
263 /*19*/ { "Command Illegal When Cartridge Not Referenced", 1, },\
264 /*20*/ { "Self-Diagnostic Failed (cannot be cleared)", 1, },\
265 /*21*/ { "Warning EEPROM Not Initialized, Defaults Set", 1, },\
266 /*22*/ { "EEPROM Corrupted or Hardware Failure", 1, },\
267 /*23*/ { "Motion Time-out Error", 1, },\
268 /*24*/ { "Data Segment Too Long -- Logical Forward or Pause", 1, },\
269 /*25*/ { "Transmit Overrun (obs)", 1, },\
270 /*26*/ { "Power On Reset Occurred", 0, },\
271 /*27*/ { "Software Reset Occurred", 0, },\
272 /*28*/ { "Diagnostic Mode 1 Error", 1, },\
273 /*29*/ { "Diagnostic Mode 2 Error", 1, },\
274 /*30*/ { "Command Received During Non-Interruptible Process", 1, },\
275 /*31*/ { "Rate or Format Selection Error", 1, },\
276 /*32*/ { "Illegal Command While in High Speed Mode", 1, },\
277 /*33*/ { "Illegal Seek Segment Value", 1, },\
278 /*34*/ { "Invalid Media", 1, },\
279 /*35*/ { "Head Positioning Failure", 1, },\
280 /*36*/ { "Write Reference Burst Failure", 1, },\
281 /*37*/ { "Prom Code Missing", 1, },\
282 /*38*/ { "Invalid Format", 1, },\
283 /*39*/ { "EOT/BOT System Failure", 1, },\
284 /*40*/ { "Prom A Checksum Error", 1, },\
285 /*41*/ { "Drive Wakeup Reset Occurred", 1, },\
286 /*42*/ { "Prom B Checksum Error", 1, },\
287 /*43*/ { "Illegal Entry into Format Mode", 1, },\
288}
289
290#endif /* _QIC117_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/raid/md.h b/include/linux/raid/md.h
index 866a1e2b0ce0..fbaeda79b2e9 100644
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -94,7 +94,7 @@ extern int sync_page_io(struct block_device *bdev, sector_t sector, int size,
94 struct page *page, int rw); 94 struct page *page, int rw);
95extern void md_do_sync(mddev_t *mddev); 95extern void md_do_sync(mddev_t *mddev);
96extern void md_new_event(mddev_t *mddev); 96extern void md_new_event(mddev_t *mddev);
97 97extern void md_allow_write(mddev_t *mddev);
98 98
99#endif /* CONFIG_MD */ 99#endif /* CONFIG_MD */
100#endif 100#endif
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
index 03636d7918fe..d8286db60b96 100644
--- a/include/linux/raid/raid5.h
+++ b/include/linux/raid/raid5.h
@@ -227,7 +227,10 @@ struct raid5_private_data {
227 struct list_head handle_list; /* stripes needing handling */ 227 struct list_head handle_list; /* stripes needing handling */
228 struct list_head delayed_list; /* stripes that have plugged requests */ 228 struct list_head delayed_list; /* stripes that have plugged requests */
229 struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */ 229 struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */
230 struct bio *retry_read_aligned; /* currently retrying aligned bios */
231 struct bio *retry_read_aligned_list; /* aligned bios retry list */
230 atomic_t preread_active_stripes; /* stripes with scheduled io */ 232 atomic_t preread_active_stripes; /* stripes with scheduled io */
233 atomic_t active_aligned_reads;
231 234
232 atomic_t reshape_stripes; /* stripes with pending writes for reshape */ 235 atomic_t reshape_stripes; /* stripes with pending writes for reshape */
233 /* unfortunately we need two cache names as we temporarily have 236 /* unfortunately we need two cache names as we temporarily have
diff --git a/include/linux/reciprocal_div.h b/include/linux/reciprocal_div.h
new file mode 100644
index 000000000000..f9c90b33285b
--- /dev/null
+++ b/include/linux/reciprocal_div.h
@@ -0,0 +1,32 @@
1#ifndef _LINUX_RECIPROCAL_DIV_H
2#define _LINUX_RECIPROCAL_DIV_H
3
4#include <linux/types.h>
5
6/*
7 * This file describes reciprocical division.
8 *
9 * This optimizes the (A/B) problem, when A and B are two u32
10 * and B is a known value (but not known at compile time)
11 *
12 * The math principle used is :
13 * Let RECIPROCAL_VALUE(B) be (((1LL << 32) + (B - 1))/ B)
14 * Then A / B = (u32)(((u64)(A) * (R)) >> 32)
15 *
16 * This replaces a divide by a multiply (and a shift), and
17 * is generally less expensive in CPU cycles.
18 */
19
20/*
21 * Computes the reciprocal value (R) for the value B of the divisor.
22 * Should not be called before each reciprocal_divide(),
23 * or else the performance is slower than a normal divide.
24 */
25extern u32 reciprocal_value(u32 B);
26
27
28static inline u32 reciprocal_divide(u32 A, u32 R)
29{
30 return (u32)(((u64)A * R) >> 32);
31}
32#endif
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index d0e4dce33ad5..c3fc6caaad3f 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1159,7 +1159,7 @@ znodes are the way! */
1159#define PATH_READA 0x1 /* do read ahead */ 1159#define PATH_READA 0x1 /* do read ahead */
1160#define PATH_READA_BACK 0x2 /* read backwards */ 1160#define PATH_READA_BACK 0x2 /* read backwards */
1161 1161
1162struct path { 1162struct treepath {
1163 int path_length; /* Length of the array above. */ 1163 int path_length; /* Length of the array above. */
1164 int reada; 1164 int reada;
1165 struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */ 1165 struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */
@@ -1169,7 +1169,7 @@ struct path {
1169#define pos_in_item(path) ((path)->pos_in_item) 1169#define pos_in_item(path) ((path)->pos_in_item)
1170 1170
1171#define INITIALIZE_PATH(var) \ 1171#define INITIALIZE_PATH(var) \
1172struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,} 1172struct treepath var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}
1173 1173
1174/* Get path element by path and path position. */ 1174/* Get path element by path and path position. */
1175#define PATH_OFFSET_PELEMENT(p_s_path,n_offset) ((p_s_path)->path_elements +(n_offset)) 1175#define PATH_OFFSET_PELEMENT(p_s_path,n_offset) ((p_s_path)->path_elements +(n_offset))
@@ -1327,7 +1327,7 @@ struct tree_balance {
1327 int need_balance_dirty; 1327 int need_balance_dirty;
1328 struct super_block *tb_sb; 1328 struct super_block *tb_sb;
1329 struct reiserfs_transaction_handle *transaction_handle; 1329 struct reiserfs_transaction_handle *transaction_handle;
1330 struct path *tb_path; 1330 struct treepath *tb_path;
1331 struct buffer_head *L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */ 1331 struct buffer_head *L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */
1332 struct buffer_head *R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path */ 1332 struct buffer_head *R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path */
1333 struct buffer_head *FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */ 1333 struct buffer_head *FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */
@@ -1793,41 +1793,41 @@ static inline void copy_key(struct reiserfs_key *to,
1793 memcpy(to, from, KEY_SIZE); 1793 memcpy(to, from, KEY_SIZE);
1794} 1794}
1795 1795
1796int comp_items(const struct item_head *stored_ih, const struct path *p_s_path); 1796int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path);
1797const struct reiserfs_key *get_rkey(const struct path *p_s_chk_path, 1797const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path,
1798 const struct super_block *p_s_sb); 1798 const struct super_block *p_s_sb);
1799int search_by_key(struct super_block *, const struct cpu_key *, 1799int search_by_key(struct super_block *, const struct cpu_key *,
1800 struct path *, int); 1800 struct treepath *, int);
1801#define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) 1801#define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL)
1802int search_for_position_by_key(struct super_block *p_s_sb, 1802int search_for_position_by_key(struct super_block *p_s_sb,
1803 const struct cpu_key *p_s_cpu_key, 1803 const struct cpu_key *p_s_cpu_key,
1804 struct path *p_s_search_path); 1804 struct treepath *p_s_search_path);
1805extern void decrement_bcount(struct buffer_head *p_s_bh); 1805extern void decrement_bcount(struct buffer_head *p_s_bh);
1806void decrement_counters_in_path(struct path *p_s_search_path); 1806void decrement_counters_in_path(struct treepath *p_s_search_path);
1807void pathrelse(struct path *p_s_search_path); 1807void pathrelse(struct treepath *p_s_search_path);
1808int reiserfs_check_path(struct path *p); 1808int reiserfs_check_path(struct treepath *p);
1809void pathrelse_and_restore(struct super_block *s, struct path *p_s_search_path); 1809void pathrelse_and_restore(struct super_block *s, struct treepath *p_s_search_path);
1810 1810
1811int reiserfs_insert_item(struct reiserfs_transaction_handle *th, 1811int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
1812 struct path *path, 1812 struct treepath *path,
1813 const struct cpu_key *key, 1813 const struct cpu_key *key,
1814 struct item_head *ih, 1814 struct item_head *ih,
1815 struct inode *inode, const char *body); 1815 struct inode *inode, const char *body);
1816 1816
1817int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, 1817int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th,
1818 struct path *path, 1818 struct treepath *path,
1819 const struct cpu_key *key, 1819 const struct cpu_key *key,
1820 struct inode *inode, 1820 struct inode *inode,
1821 const char *body, int paste_size); 1821 const char *body, int paste_size);
1822 1822
1823int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, 1823int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
1824 struct path *path, 1824 struct treepath *path,
1825 struct cpu_key *key, 1825 struct cpu_key *key,
1826 struct inode *inode, 1826 struct inode *inode,
1827 struct page *page, loff_t new_file_size); 1827 struct page *page, loff_t new_file_size);
1828 1828
1829int reiserfs_delete_item(struct reiserfs_transaction_handle *th, 1829int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
1830 struct path *path, 1830 struct treepath *path,
1831 const struct cpu_key *key, 1831 const struct cpu_key *key,
1832 struct inode *inode, struct buffer_head *p_s_un_bh); 1832 struct inode *inode, struct buffer_head *p_s_un_bh);
1833 1833
@@ -1858,7 +1858,7 @@ void padd_item(char *item, int total_length, int length);
1858#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */ 1858#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */
1859 1859
1860int restart_transaction(struct reiserfs_transaction_handle *th, 1860int restart_transaction(struct reiserfs_transaction_handle *th,
1861 struct inode *inode, struct path *path); 1861 struct inode *inode, struct treepath *path);
1862void reiserfs_read_locked_inode(struct inode *inode, 1862void reiserfs_read_locked_inode(struct inode *inode,
1863 struct reiserfs_iget_args *args); 1863 struct reiserfs_iget_args *args);
1864int reiserfs_find_actor(struct inode *inode, void *p); 1864int reiserfs_find_actor(struct inode *inode, void *p);
@@ -1905,7 +1905,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr);
1905/* namei.c */ 1905/* namei.c */
1906void set_de_name_and_namelen(struct reiserfs_dir_entry *de); 1906void set_de_name_and_namelen(struct reiserfs_dir_entry *de);
1907int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, 1907int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
1908 struct path *path, struct reiserfs_dir_entry *de); 1908 struct treepath *path, struct reiserfs_dir_entry *de);
1909struct dentry *reiserfs_get_parent(struct dentry *); 1909struct dentry *reiserfs_get_parent(struct dentry *);
1910/* procfs.c */ 1910/* procfs.c */
1911 1911
@@ -1956,9 +1956,9 @@ extern const struct file_operations reiserfs_dir_operations;
1956 1956
1957/* tail_conversion.c */ 1957/* tail_conversion.c */
1958int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, 1958int direct2indirect(struct reiserfs_transaction_handle *, struct inode *,
1959 struct path *, struct buffer_head *, loff_t); 1959 struct treepath *, struct buffer_head *, loff_t);
1960int indirect2direct(struct reiserfs_transaction_handle *, struct inode *, 1960int indirect2direct(struct reiserfs_transaction_handle *, struct inode *,
1961 struct page *, struct path *, const struct cpu_key *, 1961 struct page *, struct treepath *, const struct cpu_key *,
1962 loff_t, char *); 1962 loff_t, char *);
1963void reiserfs_unmap_buffer(struct buffer_head *); 1963void reiserfs_unmap_buffer(struct buffer_head *);
1964 1964
@@ -2045,7 +2045,7 @@ struct __reiserfs_blocknr_hint {
2045 struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */ 2045 struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */
2046 long block; /* file offset, in blocks */ 2046 long block; /* file offset, in blocks */
2047 struct in_core_key key; 2047 struct in_core_key key;
2048 struct path *path; /* search path, used by allocator to deternine search_start by 2048 struct treepath *path; /* search path, used by allocator to deternine search_start by
2049 * various ways */ 2049 * various ways */
2050 struct reiserfs_transaction_handle *th; /* transaction handle is needed to log super blocks and 2050 struct reiserfs_transaction_handle *th; /* transaction handle is needed to log super blocks and
2051 * bitmap blocks changes */ 2051 * bitmap blocks changes */
@@ -2101,7 +2101,7 @@ static inline int reiserfs_new_form_blocknrs(struct tree_balance *tb,
2101static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle 2101static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle
2102 *th, struct inode *inode, 2102 *th, struct inode *inode,
2103 b_blocknr_t * new_blocknrs, 2103 b_blocknr_t * new_blocknrs,
2104 struct path *path, long block) 2104 struct treepath *path, long block)
2105{ 2105{
2106 reiserfs_blocknr_hint_t hint = { 2106 reiserfs_blocknr_hint_t hint = {
2107 .th = th, 2107 .th = th,
@@ -2118,7 +2118,7 @@ static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle
2118static inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle 2118static inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle
2119 *th, struct inode *inode, 2119 *th, struct inode *inode,
2120 b_blocknr_t * new_blocknrs, 2120 b_blocknr_t * new_blocknrs,
2121 struct path *path, long block) 2121 struct treepath *path, long block)
2122{ 2122{
2123 reiserfs_blocknr_hint_t hint = { 2123 reiserfs_blocknr_hint_t hint = {
2124 .th = th, 2124 .th = th,
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h
index 5b3b297aa2c5..ce3663fb0101 100644
--- a/include/linux/reiserfs_fs_i.h
+++ b/include/linux/reiserfs_fs_i.h
@@ -25,6 +25,7 @@ typedef enum {
25 i_link_saved_truncate_mask = 0x0020, 25 i_link_saved_truncate_mask = 0x0020,
26 i_has_xattr_dir = 0x0040, 26 i_has_xattr_dir = 0x0040,
27 i_data_log = 0x0080, 27 i_data_log = 0x0080,
28 i_ever_mapped = 0x0100
28} reiserfs_inode_flags; 29} reiserfs_inode_flags;
29 30
30struct reiserfs_inode_info { 31struct reiserfs_inode_info {
@@ -52,6 +53,7 @@ struct reiserfs_inode_info {
52 ** flushed */ 53 ** flushed */
53 unsigned long i_trans_id; 54 unsigned long i_trans_id;
54 struct reiserfs_journal_list *i_jl; 55 struct reiserfs_journal_list *i_jl;
56 struct mutex i_mmap;
55#ifdef CONFIG_REISERFS_FS_POSIX_ACL 57#ifdef CONFIG_REISERFS_FS_POSIX_ACL
56 struct posix_acl *i_acl_access; 58 struct posix_acl *i_acl_access;
57 struct posix_acl *i_acl_default; 59 struct posix_acl *i_acl_default;
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 36f850373d2c..bdd277223af0 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -72,7 +72,7 @@ void __anon_vma_link(struct vm_area_struct *);
72void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); 72void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long);
73void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); 73void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long);
74void page_add_file_rmap(struct page *); 74void page_add_file_rmap(struct page *);
75void page_remove_rmap(struct page *); 75void page_remove_rmap(struct page *, struct vm_area_struct *);
76 76
77/** 77/**
78 * page_dup_rmap - duplicate pte mapping to a page 78 * page_dup_rmap - duplicate pte mapping to a page
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 09ff4c3e2713..5e22d4510d11 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -106,6 +106,7 @@ extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year
106extern int rtc_valid_tm(struct rtc_time *tm); 106extern int rtc_valid_tm(struct rtc_time *tm);
107extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); 107extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time);
108extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); 108extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm);
109extern void rtc_merge_alarm(struct rtc_time *now, struct rtc_time *alarm);
109 110
110#include <linux/device.h> 111#include <linux/device.h>
111#include <linux/seq_file.h> 112#include <linux/seq_file.h>
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
index b0090e9f7884..382bb7951166 100644
--- a/include/linux/rtmutex.h
+++ b/include/linux/rtmutex.h
@@ -16,7 +16,7 @@
16#include <linux/plist.h> 16#include <linux/plist.h>
17#include <linux/spinlock_types.h> 17#include <linux/spinlock_types.h>
18 18
19/* 19/**
20 * The rt_mutex structure 20 * The rt_mutex structure
21 * 21 *
22 * @wait_lock: spinlock to protect the structure 22 * @wait_lock: spinlock to protect the structure
@@ -71,7 +71,7 @@ struct hrtimer_sleeper;
71#define DEFINE_RT_MUTEX(mutexname) \ 71#define DEFINE_RT_MUTEX(mutexname) \
72 struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname) 72 struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname)
73 73
74/*** 74/**
75 * rt_mutex_is_locked - is the mutex locked 75 * rt_mutex_is_locked - is the mutex locked
76 * @lock: the mutex to be queried 76 * @lock: the mutex to be queried
77 * 77 *
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 493297acdae8..4a629ea70cc4 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -3,6 +3,8 @@
3 3
4#include <linux/netlink.h> 4#include <linux/netlink.h>
5#include <linux/if_link.h> 5#include <linux/if_link.h>
6#include <linux/if_addr.h>
7#include <linux/neighbour.h>
6 8
7/**** 9/****
8 * Routing/neighbour discovery messages. 10 * Routing/neighbour discovery messages.
diff --git a/include/linux/sched.h b/include/linux/sched.h
index dede82c63445..446373535190 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -82,6 +82,7 @@ struct sched_param {
82#include <linux/resource.h> 82#include <linux/resource.h>
83#include <linux/timer.h> 83#include <linux/timer.h>
84#include <linux/hrtimer.h> 84#include <linux/hrtimer.h>
85#include <linux/task_io_accounting.h>
85 86
86#include <asm/processor.h> 87#include <asm/processor.h>
87 88
@@ -436,7 +437,12 @@ struct signal_struct {
436 /* job control IDs */ 437 /* job control IDs */
437 pid_t pgrp; 438 pid_t pgrp;
438 pid_t tty_old_pgrp; 439 pid_t tty_old_pgrp;
439 pid_t session; 440
441 union {
442 pid_t session __deprecated;
443 pid_t __session;
444 };
445
440 /* boolean value for session group leader */ 446 /* boolean value for session group leader */
441 int leader; 447 int leader;
442 448
@@ -642,6 +648,7 @@ enum idle_type
642#define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ 648#define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */
643#define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ 649#define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */
644#define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */ 650#define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */
651#define SD_SERIALIZE 1024 /* Only a single load balancing instance */
645 652
646#define BALANCE_FOR_MC_POWER \ 653#define BALANCE_FOR_MC_POWER \
647 (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0) 654 (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0)
@@ -1008,6 +1015,7 @@ struct task_struct {
1008 wait_queue_t *io_wait; 1015 wait_queue_t *io_wait;
1009/* i/o counters(bytes read/written, #syscalls */ 1016/* i/o counters(bytes read/written, #syscalls */
1010 u64 rchar, wchar, syscr, syscw; 1017 u64 rchar, wchar, syscr, syscw;
1018 struct task_io_accounting ioac;
1011#if defined(CONFIG_TASK_XACCT) 1019#if defined(CONFIG_TASK_XACCT)
1012 u64 acct_rss_mem1; /* accumulated rss usage */ 1020 u64 acct_rss_mem1; /* accumulated rss usage */
1013 u64 acct_vm_mem1; /* accumulated virtual memory usage */ 1021 u64 acct_vm_mem1; /* accumulated virtual memory usage */
@@ -1040,6 +1048,9 @@ struct task_struct {
1040#ifdef CONFIG_TASK_DELAY_ACCT 1048#ifdef CONFIG_TASK_DELAY_ACCT
1041 struct task_delay_info *delays; 1049 struct task_delay_info *delays;
1042#endif 1050#endif
1051#ifdef CONFIG_FAULT_INJECTION
1052 int make_it_fail;
1053#endif
1043}; 1054};
1044 1055
1045static inline pid_t process_group(struct task_struct *tsk) 1056static inline pid_t process_group(struct task_struct *tsk)
@@ -1047,6 +1058,21 @@ static inline pid_t process_group(struct task_struct *tsk)
1047 return tsk->signal->pgrp; 1058 return tsk->signal->pgrp;
1048} 1059}
1049 1060
1061static inline pid_t signal_session(struct signal_struct *sig)
1062{
1063 return sig->__session;
1064}
1065
1066static inline pid_t process_session(struct task_struct *tsk)
1067{
1068 return signal_session(tsk->signal);
1069}
1070
1071static inline void set_signal_session(struct signal_struct *sig, pid_t session)
1072{
1073 sig->__session = session;
1074}
1075
1050static inline struct pid *task_pid(struct task_struct *task) 1076static inline struct pid *task_pid(struct task_struct *task)
1051{ 1077{
1052 return task->pids[PIDTYPE_PID].pid; 1078 return task->pids[PIDTYPE_PID].pid;
@@ -1118,7 +1144,6 @@ static inline void put_task_struct(struct task_struct *t)
1118#define PF_MEMALLOC 0x00000800 /* Allocating memory */ 1144#define PF_MEMALLOC 0x00000800 /* Allocating memory */
1119#define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ 1145#define PF_FLUSHER 0x00001000 /* responsible for disk writeback */
1120#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ 1146#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
1121#define PF_FREEZE 0x00004000 /* this task is being frozen for suspend now */
1122#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ 1147#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
1123#define PF_FROZEN 0x00010000 /* frozen for system suspend */ 1148#define PF_FROZEN 0x00010000 /* frozen for system suspend */
1124#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ 1149#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
@@ -1240,7 +1265,6 @@ extern struct mm_struct init_mm;
1240 1265
1241#define find_task_by_pid(nr) find_task_by_pid_type(PIDTYPE_PID, nr) 1266#define find_task_by_pid(nr) find_task_by_pid_type(PIDTYPE_PID, nr)
1242extern struct task_struct *find_task_by_pid_type(int type, int pid); 1267extern struct task_struct *find_task_by_pid_type(int type, int pid);
1243extern void set_special_pids(pid_t session, pid_t pgrp);
1244extern void __set_special_pids(pid_t session, pid_t pgrp); 1268extern void __set_special_pids(pid_t session, pid_t pgrp);
1245 1269
1246/* per-UID process charging. */ 1270/* per-UID process charging. */
@@ -1381,7 +1405,6 @@ extern NORET_TYPE void do_group_exit(int);
1381extern void daemonize(const char *, ...); 1405extern void daemonize(const char *, ...);
1382extern int allow_signal(int); 1406extern int allow_signal(int);
1383extern int disallow_signal(int); 1407extern int disallow_signal(int);
1384extern struct task_struct *child_reaper;
1385 1408
1386extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *); 1409extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *);
1387extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); 1410extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 35108fe7a686..d4f86560bfff 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -180,7 +180,7 @@ typedef enum {
180 SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003), 180 SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003),
181 SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004), 181 SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004),
182 SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005), 182 SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005),
183 SCTP_PARAM_ADAPTION_LAYER_IND = __constant_htons(0xc006), 183 SCTP_PARAM_ADAPTATION_LAYER_IND = __constant_htons(0xc006),
184 184
185} sctp_param_t; /* enum */ 185} sctp_param_t; /* enum */
186 186
@@ -281,11 +281,11 @@ typedef struct sctp_ecn_capable_param {
281 sctp_paramhdr_t param_hdr; 281 sctp_paramhdr_t param_hdr;
282} __attribute__((packed)) sctp_ecn_capable_param_t; 282} __attribute__((packed)) sctp_ecn_capable_param_t;
283 283
284/* ADDIP Section 3.2.6 Adaption Layer Indication */ 284/* ADDIP Section 3.2.6 Adaptation Layer Indication */
285typedef struct sctp_adaption_ind_param { 285typedef struct sctp_adaptation_ind_param {
286 struct sctp_paramhdr param_hdr; 286 struct sctp_paramhdr param_hdr;
287 __be32 adaption_ind; 287 __be32 adaptation_ind;
288} __attribute__((packed)) sctp_adaption_ind_param_t; 288} __attribute__((packed)) sctp_adaptation_ind_param_t;
289 289
290/* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2): 290/* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2):
291 * The INIT ACK chunk is used to acknowledge the initiation of an SCTP 291 * The INIT ACK chunk is used to acknowledge the initiation of an SCTP
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index 46000936f8f1..6b0648cfdffc 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -44,8 +44,11 @@ typedef struct {
44#define SEQLOCK_UNLOCKED \ 44#define SEQLOCK_UNLOCKED \
45 __SEQLOCK_UNLOCKED(old_style_seqlock_init) 45 __SEQLOCK_UNLOCKED(old_style_seqlock_init)
46 46
47#define seqlock_init(x) \ 47#define seqlock_init(x) \
48 do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); } while (0) 48 do { \
49 (x)->sequence = 0; \
50 spin_lock_init(&(x)->lock); \
51 } while (0)
49 52
50#define DEFINE_SEQLOCK(x) \ 53#define DEFINE_SEQLOCK(x) \
51 seqlock_t x = __SEQLOCK_UNLOCKED(x) 54 seqlock_t x = __SEQLOCK_UNLOCKED(x)
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 827672136646..cf23813cbec2 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -166,8 +166,8 @@ struct uart_ops {
166 void (*break_ctl)(struct uart_port *, int ctl); 166 void (*break_ctl)(struct uart_port *, int ctl);
167 int (*startup)(struct uart_port *); 167 int (*startup)(struct uart_port *);
168 void (*shutdown)(struct uart_port *); 168 void (*shutdown)(struct uart_port *);
169 void (*set_termios)(struct uart_port *, struct termios *new, 169 void (*set_termios)(struct uart_port *, struct ktermios *new,
170 struct termios *old); 170 struct ktermios *old);
171 void (*pm)(struct uart_port *, unsigned int state, 171 void (*pm)(struct uart_port *, unsigned int state,
172 unsigned int oldstate); 172 unsigned int oldstate);
173 int (*set_wake)(struct uart_port *, unsigned int state); 173 int (*set_wake)(struct uart_port *, unsigned int state);
@@ -361,8 +361,8 @@ void uart_write_wakeup(struct uart_port *port);
361 */ 361 */
362void uart_update_timeout(struct uart_port *port, unsigned int cflag, 362void uart_update_timeout(struct uart_port *port, unsigned int cflag,
363 unsigned int baud); 363 unsigned int baud);
364unsigned int uart_get_baud_rate(struct uart_port *port, struct termios *termios, 364unsigned int uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
365 struct termios *old, unsigned int min, 365 struct ktermios *old, unsigned int min,
366 unsigned int max); 366 unsigned int max);
367unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud); 367unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud);
368 368
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.h b/include/linux/slab.h
index 2271886744f8..1ef822e31c77 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -1,7 +1,9 @@
1/* 1/*
2 * linux/include/linux/slab.h 2 * Written by Mark Hemment, 1996 (markhe@nextd.demon.co.uk).
3 * Written by Mark Hemment, 1996. 3 *
4 * (markhe@nextd.demon.co.uk) 4 * (C) SGI 2006, Christoph Lameter <clameter@sgi.com>
5 * Cleaned up and restructured to ease the addition of alternative
6 * implementations of SLAB allocators.
5 */ 7 */
6 8
7#ifndef _LINUX_SLAB_H 9#ifndef _LINUX_SLAB_H
@@ -10,64 +12,95 @@
10#ifdef __KERNEL__ 12#ifdef __KERNEL__
11 13
12#include <linux/gfp.h> 14#include <linux/gfp.h>
13#include <linux/init.h>
14#include <linux/types.h> 15#include <linux/types.h>
15#include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */
16#include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */
17#include <linux/compiler.h>
18 16
19/* kmem_cache_t exists for legacy reasons and is not used by code in mm */
20typedef struct kmem_cache kmem_cache_t __deprecated; 17typedef struct kmem_cache kmem_cache_t __deprecated;
21 18
22/* flags to pass to kmem_cache_create(). 19/*
23 * The first 3 are only valid when the allocator as been build 20 * Flags to pass to kmem_cache_create().
24 * SLAB_DEBUG_SUPPORT. 21 * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set.
25 */ 22 */
26#define SLAB_DEBUG_FREE 0x00000100UL /* Peform (expensive) checks on free */ 23#define SLAB_DEBUG_FREE 0x00000100UL /* DEBUG: Perform (expensive) checks on free */
27#define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ 24#define SLAB_DEBUG_INITIAL 0x00000200UL /* DEBUG: Call constructor (as verifier) */
28#define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */ 25#define SLAB_RED_ZONE 0x00000400UL /* DEBUG: Red zone objs in a cache */
29#define SLAB_POISON 0x00000800UL /* Poison objects */ 26#define SLAB_POISON 0x00000800UL /* DEBUG: Poison objects */
30#define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ 27#define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */
31#define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */ 28#define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */
32#define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* force alignment */ 29#define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* Force alignment even if debuggin is active */
33#define SLAB_STORE_USER 0x00010000UL /* store the last owner for bug hunting */ 30#define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */
34#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* track pages allocated to indicate 31#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
35 what is reclaimable later*/ 32#define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */
36#define SLAB_PANIC 0x00040000UL /* panic if kmem_cache_create() fails */ 33#define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */
37#define SLAB_DESTROY_BY_RCU 0x00080000UL /* defer freeing pages to RCU */
38#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ 34#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */
39 35
40/* flags passed to a constructor func */ 36/* Flags passed to a constructor functions */
41#define SLAB_CTOR_CONSTRUCTOR 0x001UL /* if not set, then deconstructor */ 37#define SLAB_CTOR_CONSTRUCTOR 0x001UL /* If not set, then deconstructor */
42#define SLAB_CTOR_ATOMIC 0x002UL /* tell constructor it can't sleep */ 38#define SLAB_CTOR_ATOMIC 0x002UL /* Tell constructor it can't sleep */
43#define SLAB_CTOR_VERIFY 0x004UL /* tell constructor it's a verify call */ 39#define SLAB_CTOR_VERIFY 0x004UL /* Tell constructor it's a verify call */
44 40
45#ifndef CONFIG_SLOB 41/*
46 42 * struct kmem_cache related prototypes
47/* prototypes */ 43 */
48extern void __init kmem_cache_init(void); 44void __init kmem_cache_init(void);
45extern int slab_is_available(void);
49 46
50extern struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, 47struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
51 unsigned long, 48 unsigned long,
52 void (*)(void *, struct kmem_cache *, unsigned long), 49 void (*)(void *, struct kmem_cache *, unsigned long),
53 void (*)(void *, struct kmem_cache *, unsigned long)); 50 void (*)(void *, struct kmem_cache *, unsigned long));
54extern void kmem_cache_destroy(struct kmem_cache *); 51void kmem_cache_destroy(struct kmem_cache *);
55extern int kmem_cache_shrink(struct kmem_cache *); 52int kmem_cache_shrink(struct kmem_cache *);
56extern void *kmem_cache_alloc(struct kmem_cache *, gfp_t); 53void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
57extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); 54void *kmem_cache_zalloc(struct kmem_cache *, gfp_t);
58extern void kmem_cache_free(struct kmem_cache *, void *); 55void kmem_cache_free(struct kmem_cache *, void *);
59extern unsigned int kmem_cache_size(struct kmem_cache *); 56unsigned int kmem_cache_size(struct kmem_cache *);
60extern const char *kmem_cache_name(struct kmem_cache *); 57const char *kmem_cache_name(struct kmem_cache *);
58int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
59
60#ifdef CONFIG_NUMA
61extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
62#else
63static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
64 gfp_t flags, int node)
65{
66 return kmem_cache_alloc(cachep, flags);
67}
68#endif
69
70/*
71 * Common kmalloc functions provided by all allocators
72 */
73void *__kmalloc(size_t, gfp_t);
74void *__kzalloc(size_t, gfp_t);
75void kfree(const void *);
76unsigned int ksize(const void *);
77
78/**
79 * kcalloc - allocate memory for an array. The memory is set to zero.
80 * @n: number of elements.
81 * @size: element size.
82 * @flags: the type of memory to allocate.
83 */
84static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
85{
86 if (n != 0 && size > ULONG_MAX / n)
87 return NULL;
88 return __kzalloc(n * size, flags);
89}
61 90
62/* Size description struct for general caches. */ 91/*
63struct cache_sizes { 92 * Allocator specific definitions. These are mainly used to establish optimized
64 size_t cs_size; 93 * ways to convert kmalloc() calls to kmem_cache_alloc() invocations by selecting
65 struct kmem_cache *cs_cachep; 94 * the appropriate general cache at compile time.
66 struct kmem_cache *cs_dmacachep; 95 */
67};
68extern struct cache_sizes malloc_sizes[];
69 96
70extern void *__kmalloc(size_t, gfp_t); 97#ifdef CONFIG_SLAB
98#include <linux/slab_def.h>
99#else
100/*
101 * Fallback definitions for an allocator not wanting to provide
102 * its own optimized kmalloc definitions (like SLOB).
103 */
71 104
72/** 105/**
73 * kmalloc - allocate memory 106 * kmalloc - allocate memory
@@ -116,46 +149,9 @@ extern void *__kmalloc(size_t, gfp_t);
116 */ 149 */
117static inline void *kmalloc(size_t size, gfp_t flags) 150static inline void *kmalloc(size_t size, gfp_t flags)
118{ 151{
119 if (__builtin_constant_p(size)) {
120 int i = 0;
121#define CACHE(x) \
122 if (size <= x) \
123 goto found; \
124 else \
125 i++;
126#include "kmalloc_sizes.h"
127#undef CACHE
128 {
129 extern void __you_cannot_kmalloc_that_much(void);
130 __you_cannot_kmalloc_that_much();
131 }
132found:
133 return kmem_cache_alloc((flags & GFP_DMA) ?
134 malloc_sizes[i].cs_dmacachep :
135 malloc_sizes[i].cs_cachep, flags);
136 }
137 return __kmalloc(size, flags); 152 return __kmalloc(size, flags);
138} 153}
139 154
140/*
141 * kmalloc_track_caller is a special version of kmalloc that records the
142 * calling function of the routine calling it for slab leak tracking instead
143 * of just the calling function (confusing, eh?).
144 * It's useful when the call to kmalloc comes from a widely-used standard
145 * allocator where we care about the real place the memory allocation
146 * request comes from.
147 */
148#ifndef CONFIG_DEBUG_SLAB
149#define kmalloc_track_caller(size, flags) \
150 __kmalloc(size, flags)
151#else
152extern void *__kmalloc_track_caller(size_t, gfp_t, void*);
153#define kmalloc_track_caller(size, flags) \
154 __kmalloc_track_caller(size, flags, __builtin_return_address(0))
155#endif
156
157extern void *__kzalloc(size_t, gfp_t);
158
159/** 155/**
160 * kzalloc - allocate memory. The memory is set to zero. 156 * kzalloc - allocate memory. The memory is set to zero.
161 * @size: how many bytes of memory are required. 157 * @size: how many bytes of memory are required.
@@ -163,72 +159,41 @@ extern void *__kzalloc(size_t, gfp_t);
163 */ 159 */
164static inline void *kzalloc(size_t size, gfp_t flags) 160static inline void *kzalloc(size_t size, gfp_t flags)
165{ 161{
166 if (__builtin_constant_p(size)) {
167 int i = 0;
168#define CACHE(x) \
169 if (size <= x) \
170 goto found; \
171 else \
172 i++;
173#include "kmalloc_sizes.h"
174#undef CACHE
175 {
176 extern void __you_cannot_kzalloc_that_much(void);
177 __you_cannot_kzalloc_that_much();
178 }
179found:
180 return kmem_cache_zalloc((flags & GFP_DMA) ?
181 malloc_sizes[i].cs_dmacachep :
182 malloc_sizes[i].cs_cachep, flags);
183 }
184 return __kzalloc(size, flags); 162 return __kzalloc(size, flags);
185} 163}
164#endif
186 165
187/** 166#ifndef CONFIG_NUMA
188 * kcalloc - allocate memory for an array. The memory is set to zero. 167static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
189 * @n: number of elements.
190 * @size: element size.
191 * @flags: the type of memory to allocate.
192 */
193static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
194{ 168{
195 if (n != 0 && size > ULONG_MAX / n) 169 return kmalloc(size, flags);
196 return NULL;
197 return kzalloc(n * size, flags);
198} 170}
199 171
200extern void kfree(const void *); 172static inline void *__kmalloc_node(size_t size, gfp_t flags, int node)
201extern unsigned int ksize(const void *);
202extern int slab_is_available(void);
203
204#ifdef CONFIG_NUMA
205extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
206extern void *__kmalloc_node(size_t size, gfp_t flags, int node);
207
208static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
209{ 173{
210 if (__builtin_constant_p(size)) { 174 return __kmalloc(size, flags);
211 int i = 0;
212#define CACHE(x) \
213 if (size <= x) \
214 goto found; \
215 else \
216 i++;
217#include "kmalloc_sizes.h"
218#undef CACHE
219 {
220 extern void __you_cannot_kmalloc_that_much(void);
221 __you_cannot_kmalloc_that_much();
222 }
223found:
224 return kmem_cache_alloc_node((flags & GFP_DMA) ?
225 malloc_sizes[i].cs_dmacachep :
226 malloc_sizes[i].cs_cachep, flags, node);
227 }
228 return __kmalloc_node(size, flags, node);
229} 175}
176#endif /* !CONFIG_NUMA */
230 177
231/* 178/*
179 * kmalloc_track_caller is a special version of kmalloc that records the
180 * calling function of the routine calling it for slab leak tracking instead
181 * of just the calling function (confusing, eh?).
182 * It's useful when the call to kmalloc comes from a widely-used standard
183 * allocator where we care about the real place the memory allocation
184 * request comes from.
185 */
186#ifdef CONFIG_DEBUG_SLAB
187extern void *__kmalloc_track_caller(size_t, gfp_t, void*);
188#define kmalloc_track_caller(size, flags) \
189 __kmalloc_track_caller(size, flags, __builtin_return_address(0))
190#else
191#define kmalloc_track_caller(size, flags) \
192 __kmalloc(size, flags)
193#endif /* DEBUG_SLAB */
194
195#ifdef CONFIG_NUMA
196/*
232 * kmalloc_node_track_caller is a special version of kmalloc_node that 197 * kmalloc_node_track_caller is a special version of kmalloc_node that
233 * records the calling function of the routine calling it for slab leak 198 * records the calling function of the routine calling it for slab leak
234 * tracking instead of just the calling function (confusing, eh?). 199 * tracking instead of just the calling function (confusing, eh?).
@@ -236,70 +201,23 @@ found:
236 * standard allocator where we care about the real place the memory 201 * standard allocator where we care about the real place the memory
237 * allocation request comes from. 202 * allocation request comes from.
238 */ 203 */
239#ifndef CONFIG_DEBUG_SLAB 204#ifdef CONFIG_DEBUG_SLAB
240#define kmalloc_node_track_caller(size, flags, node) \
241 __kmalloc_node(size, flags, node)
242#else
243extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *); 205extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *);
244#define kmalloc_node_track_caller(size, flags, node) \ 206#define kmalloc_node_track_caller(size, flags, node) \
245 __kmalloc_node_track_caller(size, flags, node, \ 207 __kmalloc_node_track_caller(size, flags, node, \
246 __builtin_return_address(0)) 208 __builtin_return_address(0))
209#else
210#define kmalloc_node_track_caller(size, flags, node) \
211 __kmalloc_node(size, flags, node)
247#endif 212#endif
213
248#else /* CONFIG_NUMA */ 214#else /* CONFIG_NUMA */
249static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
250 gfp_t flags, int node)
251{
252 return kmem_cache_alloc(cachep, flags);
253}
254static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
255{
256 return kmalloc(size, flags);
257}
258 215
259#define kmalloc_node_track_caller(size, flags, node) \ 216#define kmalloc_node_track_caller(size, flags, node) \
260 kmalloc_track_caller(size, flags) 217 kmalloc_track_caller(size, flags)
261#endif
262 218
263extern int FASTCALL(kmem_cache_reap(int)); 219#endif /* DEBUG_SLAB */
264extern int FASTCALL(kmem_ptr_validate(struct kmem_cache *cachep, void *ptr));
265
266#else /* CONFIG_SLOB */
267
268/* SLOB allocator routines */
269
270void kmem_cache_init(void);
271struct kmem_cache *kmem_cache_create(const char *c, size_t, size_t,
272 unsigned long,
273 void (*)(void *, struct kmem_cache *, unsigned long),
274 void (*)(void *, struct kmem_cache *, unsigned long));
275void kmem_cache_destroy(struct kmem_cache *c);
276void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags);
277void *kmem_cache_zalloc(struct kmem_cache *, gfp_t);
278void kmem_cache_free(struct kmem_cache *c, void *b);
279const char *kmem_cache_name(struct kmem_cache *);
280void *kmalloc(size_t size, gfp_t flags);
281void *__kzalloc(size_t size, gfp_t flags);
282void kfree(const void *m);
283unsigned int ksize(const void *m);
284unsigned int kmem_cache_size(struct kmem_cache *c);
285
286static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
287{
288 return __kzalloc(n * size, flags);
289}
290
291#define kmem_cache_shrink(d) (0)
292#define kmem_cache_reap(a)
293#define kmem_ptr_validate(a, b) (0)
294#define kmem_cache_alloc_node(c, f, n) kmem_cache_alloc(c, f)
295#define kmalloc_node(s, f, n) kmalloc(s, f)
296#define kzalloc(s, f) __kzalloc(s, f)
297#define kmalloc_track_caller kmalloc
298
299#define kmalloc_node_track_caller kmalloc_node
300
301#endif /* CONFIG_SLOB */
302 220
303#endif /* __KERNEL__ */ 221#endif /* __KERNEL__ */
304
305#endif /* _LINUX_SLAB_H */ 222#endif /* _LINUX_SLAB_H */
223
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
new file mode 100644
index 000000000000..4b463e66ddea
--- /dev/null
+++ b/include/linux/slab_def.h
@@ -0,0 +1,100 @@
1#ifndef _LINUX_SLAB_DEF_H
2#define _LINUX_SLAB_DEF_H
3
4/*
5 * Definitions unique to the original Linux SLAB allocator.
6 *
7 * What we provide here is a way to optimize the frequent kmalloc
8 * calls in the kernel by selecting the appropriate general cache
9 * if kmalloc was called with a size that can be established at
10 * compile time.
11 */
12
13#include <linux/init.h>
14#include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */
15#include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */
16#include <linux/compiler.h>
17
18/* Size description struct for general caches. */
19struct cache_sizes {
20 size_t cs_size;
21 struct kmem_cache *cs_cachep;
22 struct kmem_cache *cs_dmacachep;
23};
24extern struct cache_sizes malloc_sizes[];
25
26static inline void *kmalloc(size_t size, gfp_t flags)
27{
28 if (__builtin_constant_p(size)) {
29 int i = 0;
30#define CACHE(x) \
31 if (size <= x) \
32 goto found; \
33 else \
34 i++;
35#include "kmalloc_sizes.h"
36#undef CACHE
37 {
38 extern void __you_cannot_kmalloc_that_much(void);
39 __you_cannot_kmalloc_that_much();
40 }
41found:
42 return kmem_cache_alloc((flags & GFP_DMA) ?
43 malloc_sizes[i].cs_dmacachep :
44 malloc_sizes[i].cs_cachep, flags);
45 }
46 return __kmalloc(size, flags);
47}
48
49static inline void *kzalloc(size_t size, gfp_t flags)
50{
51 if (__builtin_constant_p(size)) {
52 int i = 0;
53#define CACHE(x) \
54 if (size <= x) \
55 goto found; \
56 else \
57 i++;
58#include "kmalloc_sizes.h"
59#undef CACHE
60 {
61 extern void __you_cannot_kzalloc_that_much(void);
62 __you_cannot_kzalloc_that_much();
63 }
64found:
65 return kmem_cache_zalloc((flags & GFP_DMA) ?
66 malloc_sizes[i].cs_dmacachep :
67 malloc_sizes[i].cs_cachep, flags);
68 }
69 return __kzalloc(size, flags);
70}
71
72#ifdef CONFIG_NUMA
73extern void *__kmalloc_node(size_t size, gfp_t flags, int node);
74
75static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
76{
77 if (__builtin_constant_p(size)) {
78 int i = 0;
79#define CACHE(x) \
80 if (size <= x) \
81 goto found; \
82 else \
83 i++;
84#include "kmalloc_sizes.h"
85#undef CACHE
86 {
87 extern void __you_cannot_kmalloc_that_much(void);
88 __you_cannot_kmalloc_that_much();
89 }
90found:
91 return kmem_cache_alloc_node((flags & GFP_DMA) ?
92 malloc_sizes[i].cs_dmacachep :
93 malloc_sizes[i].cs_cachep, flags, node);
94 }
95 return __kmalloc_node(size, flags, node);
96}
97
98#endif /* CONFIG_NUMA */
99
100#endif /* _LINUX_SLAB_DEF_H */
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h
index 5b4ae2cc445c..3aa97aa4277f 100644
--- a/include/linux/smb_fs_sb.h
+++ b/include/linux/smb_fs_sb.h
@@ -55,7 +55,7 @@ struct smb_sb_info {
55 * generation is incremented. 55 * generation is incremented.
56 */ 56 */
57 unsigned int generation; 57 unsigned int generation;
58 pid_t conn_pid; 58 struct pid *conn_pid;
59 struct smb_conn_opt opt; 59 struct smb_conn_opt opt;
60 wait_queue_head_t conn_wq; 60 wait_queue_head_t conn_wq;
61 int conn_complete; 61 int conn_complete;
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 92cd38efad7f..fcd35a210e7f 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -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/spi.h b/include/linux/spi/spi.h
index c8bb68099eb9..176f6e36dbfa 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -289,7 +289,7 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
289 * the data being transferred; that may reduce overhead, when the 289 * the data being transferred; that may reduce overhead, when the
290 * underlying driver uses dma. 290 * underlying driver uses dma.
291 * 291 *
292 * If the transmit buffer is null, undefined data will be shifted out 292 * If the transmit buffer is null, zeroes will be shifted out
293 * while filling rx_buf. If the receive buffer is null, the data 293 * while filling rx_buf. If the receive buffer is null, the data
294 * shifted in will be discarded. Only "len" bytes shift out (or in). 294 * shifted in will be discarded. Only "len" bytes shift out (or in).
295 * It's an error to try to shift out a partial word. (For example, by 295 * It's an error to try to shift out a partial word. (For example, by
diff --git a/include/linux/stallion.h b/include/linux/stallion.h
index 13a37f137ea2..4a0a329beafb 100644
--- a/include/linux/stallion.h
+++ b/include/linux/stallion.h
@@ -52,11 +52,11 @@
52 * protection - since "write" code only needs to change the head, and 52 * protection - since "write" code only needs to change the head, and
53 * interrupt code only needs to change the tail. 53 * interrupt code only needs to change the tail.
54 */ 54 */
55typedef struct { 55struct stlrq {
56 char *buf; 56 char *buf;
57 char *head; 57 char *head;
58 char *tail; 58 char *tail;
59} stlrq_t; 59};
60 60
61/* 61/*
62 * Port, panel and board structures to hold status info about each. 62 * Port, panel and board structures to hold status info about each.
@@ -67,14 +67,14 @@ typedef struct {
67 * is associated with, this makes it (fairly) easy to get back to the 67 * is associated with, this makes it (fairly) easy to get back to the
68 * board/panel info for a port. 68 * board/panel info for a port.
69 */ 69 */
70typedef struct stlport { 70struct stlport {
71 unsigned long magic; 71 unsigned long magic;
72 int portnr; 72 unsigned int portnr;
73 int panelnr; 73 unsigned int panelnr;
74 int brdnr; 74 unsigned int brdnr;
75 int ioaddr; 75 int ioaddr;
76 int uartaddr; 76 int uartaddr;
77 int pagenr; 77 unsigned int pagenr;
78 long istate; 78 long istate;
79 int flags; 79 int flags;
80 int baud_base; 80 int baud_base;
@@ -97,31 +97,31 @@ typedef struct stlport {
97 wait_queue_head_t close_wait; 97 wait_queue_head_t close_wait;
98 struct work_struct tqueue; 98 struct work_struct tqueue;
99 comstats_t stats; 99 comstats_t stats;
100 stlrq_t tx; 100 struct stlrq tx;
101} stlport_t; 101};
102 102
103typedef struct stlpanel { 103struct stlpanel {
104 unsigned long magic; 104 unsigned long magic;
105 int panelnr; 105 unsigned int panelnr;
106 int brdnr; 106 unsigned int brdnr;
107 int pagenr; 107 unsigned int pagenr;
108 int nrports; 108 unsigned int nrports;
109 int iobase; 109 int iobase;
110 void *uartp; 110 void *uartp;
111 void (*isr)(struct stlpanel *panelp, unsigned int iobase); 111 void (*isr)(struct stlpanel *panelp, unsigned int iobase);
112 unsigned int hwid; 112 unsigned int hwid;
113 unsigned int ackmask; 113 unsigned int ackmask;
114 stlport_t *ports[STL_PORTSPERPANEL]; 114 struct stlport *ports[STL_PORTSPERPANEL];
115} stlpanel_t; 115};
116 116
117typedef struct stlbrd { 117struct stlbrd {
118 unsigned long magic; 118 unsigned long magic;
119 int brdnr; 119 unsigned int brdnr;
120 int brdtype; 120 unsigned int brdtype;
121 int state; 121 unsigned int state;
122 int nrpanels; 122 unsigned int nrpanels;
123 int nrports; 123 unsigned int nrports;
124 int nrbnks; 124 unsigned int nrbnks;
125 int irq; 125 int irq;
126 int irqtype; 126 int irqtype;
127 int (*isr)(struct stlbrd *brdp); 127 int (*isr)(struct stlbrd *brdp);
@@ -136,9 +136,9 @@ typedef struct stlbrd {
136 unsigned long clk; 136 unsigned long clk;
137 unsigned int bnkpageaddr[STL_MAXBANKS]; 137 unsigned int bnkpageaddr[STL_MAXBANKS];
138 unsigned int bnkstataddr[STL_MAXBANKS]; 138 unsigned int bnkstataddr[STL_MAXBANKS];
139 stlpanel_t *bnk2panel[STL_MAXBANKS]; 139 struct stlpanel *bnk2panel[STL_MAXBANKS];
140 stlpanel_t *panels[STL_MAXPANELS]; 140 struct stlpanel *panels[STL_MAXPANELS];
141} stlbrd_t; 141};
142 142
143 143
144/* 144/*
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 97c761652581..8b6ce60ea057 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -250,7 +250,6 @@ void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt,
250 int flags, const struct rpc_call_ops *ops, 250 int flags, const struct rpc_call_ops *ops,
251 void *data); 251 void *data);
252void rpc_put_task(struct rpc_task *); 252void rpc_put_task(struct rpc_task *);
253void rpc_release_task(struct rpc_task *);
254void rpc_exit_task(struct rpc_task *); 253void rpc_exit_task(struct rpc_task *);
255void rpc_release_calldata(const struct rpc_call_ops *, void *); 254void rpc_release_calldata(const struct rpc_call_ops *, void *);
256void rpc_killall_tasks(struct rpc_clnt *); 255void rpc_killall_tasks(struct rpc_clnt *);
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 965d6c20086e..64f3d60c72af 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -144,8 +144,11 @@ extern u32 svc_max_payload(const struct svc_rqst *rqstp);
144 * 144 *
145 * Each request/reply pair can have at most one "payload", plus two pages, 145 * Each request/reply pair can have at most one "payload", plus two pages,
146 * one for the request, and one for the reply. 146 * one for the request, and one for the reply.
147 * We using ->sendfile to return read data, we might need one extra page
148 * if the request is not page-aligned. So add another '1'.
147 */ 149 */
148#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) 150#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE \
151 + 2 + 1)
149 152
150static inline u32 svc_getnl(struct kvec *iov) 153static inline u32 svc_getnl(struct kvec *iov)
151{ 154{
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 98b21ad370fd..db312a1e2eeb 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -63,7 +63,7 @@ struct svc_sock {
63 * Function prototypes. 63 * Function prototypes.
64 */ 64 */
65int svc_makesock(struct svc_serv *, int, unsigned short); 65int svc_makesock(struct svc_serv *, int, unsigned short);
66void svc_delete_socket(struct svc_sock *); 66void svc_close_socket(struct svc_sock *);
67int svc_recv(struct svc_rqst *, long); 67int svc_recv(struct svc_rqst *, long);
68int svc_send(struct svc_rqst *); 68int svc_send(struct svc_rqst *);
69void svc_drop(struct svc_rqst *); 69void svc_drop(struct svc_rqst *);
diff --git a/include/linux/swap.h b/include/linux/swap.h
index add51cebc8d9..5423559a44a6 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -245,7 +245,7 @@ extern int swap_duplicate(swp_entry_t);
245extern int valid_swaphandles(swp_entry_t, unsigned long *); 245extern int valid_swaphandles(swp_entry_t, unsigned long *);
246extern void swap_free(swp_entry_t); 246extern void swap_free(swp_entry_t);
247extern void free_swap_and_cache(swp_entry_t); 247extern void free_swap_and_cache(swp_entry_t);
248extern int swap_type_of(dev_t, sector_t); 248extern int swap_type_of(dev_t, sector_t, struct block_device **);
249extern unsigned int count_swap_pages(int, int); 249extern unsigned int count_swap_pages(int, int);
250extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); 250extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t);
251extern sector_t swapdev_block(int, pgoff_t); 251extern sector_t swapdev_block(int, pgoff_t);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 94316a98e0d0..665412c4f4b9 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -11,7 +11,7 @@
11 ** the sysctl() binary interface. Do *NOT* change the 11 ** the sysctl() binary interface. Do *NOT* change the
12 ** numbering of any existing values here, and do not change 12 ** numbering of any existing values here, and do not change
13 ** any numbers within any one set of values. If you have to 13 ** any numbers within any one set of values. If you have to
14 ** have to redefine an existing interface, use a new number for it. 14 ** redefine an existing interface, use a new number for it.
15 ** The kernel will then return -ENOTDIR to any application using 15 ** The kernel will then return -ENOTDIR to any application using
16 ** the old binary interface. 16 ** the old binary interface.
17 ** 17 **
@@ -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 */
@@ -918,8 +919,7 @@ typedef struct ctl_table ctl_table;
918 919
919typedef int ctl_handler (ctl_table *table, int __user *name, int nlen, 920typedef int ctl_handler (ctl_table *table, int __user *name, int nlen,
920 void __user *oldval, size_t __user *oldlenp, 921 void __user *oldval, size_t __user *oldlenp,
921 void __user *newval, size_t newlen, 922 void __user *newval, size_t newlen);
922 void **context);
923 923
924typedef int proc_handler (ctl_table *ctl, int write, struct file * filp, 924typedef int proc_handler (ctl_table *ctl, int write, struct file * filp,
925 void __user *buffer, size_t *lenp, loff_t *ppos); 925 void __user *buffer, size_t *lenp, loff_t *ppos);
@@ -950,7 +950,7 @@ extern int do_sysctl (int __user *name, int nlen,
950extern int do_sysctl_strategy (ctl_table *table, 950extern int do_sysctl_strategy (ctl_table *table,
951 int __user *name, int nlen, 951 int __user *name, int nlen,
952 void __user *oldval, size_t __user *oldlenp, 952 void __user *oldval, size_t __user *oldlenp,
953 void __user *newval, size_t newlen, void ** context); 953 void __user *newval, size_t newlen);
954 954
955extern ctl_handler sysctl_string; 955extern ctl_handler sysctl_string;
956extern ctl_handler sysctl_intvec; 956extern ctl_handler sysctl_intvec;
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/sysrq.h b/include/linux/sysrq.h
index 9df8833670cb..98a1d8cfb73d 100644
--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -37,23 +37,37 @@ struct sysrq_key_op {
37 37
38#ifdef CONFIG_MAGIC_SYSRQ 38#ifdef CONFIG_MAGIC_SYSRQ
39 39
40extern int sysrq_on(void);
41
42/*
43 * Do not use this one directly:
44 */
45extern int __sysrq_enabled;
46
40/* Generic SysRq interface -- you may call it from any device driver, supplying 47/* Generic SysRq interface -- you may call it from any device driver, supplying
41 * ASCII code of the key, pointer to registers and kbd/tty structs (if they 48 * ASCII code of the key, pointer to registers and kbd/tty structs (if they
42 * are available -- else NULL's). 49 * are available -- else NULL's).
43 */ 50 */
44 51
45void handle_sysrq(int, struct tty_struct *); 52void handle_sysrq(int key, struct tty_struct *tty);
46void __handle_sysrq(int, struct tty_struct *, int check_mask); 53void __handle_sysrq(int key, struct tty_struct *tty, int check_mask);
47int register_sysrq_key(int, struct sysrq_key_op *); 54int register_sysrq_key(int key, struct sysrq_key_op *op);
48int unregister_sysrq_key(int, struct sysrq_key_op *); 55int unregister_sysrq_key(int key, struct sysrq_key_op *op);
49struct sysrq_key_op *__sysrq_get_key_op(int key); 56struct sysrq_key_op *__sysrq_get_key_op(int key);
50 57
51#else 58#else
52 59
60static inline int sysrq_on(void)
61{
62 return 0;
63}
53static inline int __reterr(void) 64static inline int __reterr(void)
54{ 65{
55 return -EINVAL; 66 return -EINVAL;
56} 67}
68static inline void handle_sysrq(int key, struct tty_struct *tty)
69{
70}
57 71
58#define register_sysrq_key(ig,nore) __reterr() 72#define register_sysrq_key(ig,nore) __reterr()
59#define unregister_sysrq_key(ig,nore) __reterr() 73#define unregister_sysrq_key(ig,nore) __reterr()
diff --git a/include/linux/task_io_accounting.h b/include/linux/task_io_accounting.h
new file mode 100644
index 000000000000..44d00e9cceea
--- /dev/null
+++ b/include/linux/task_io_accounting.h
@@ -0,0 +1,37 @@
1/*
2 * task_io_accounting: a structure which is used for recording a single task's
3 * IO statistics.
4 *
5 * Don't include this header file directly - it is designed to be dragged in via
6 * sched.h.
7 *
8 * Blame akpm@osdl.org for all this.
9 */
10
11#ifdef CONFIG_TASK_IO_ACCOUNTING
12struct task_io_accounting {
13 /*
14 * The number of bytes which this task has caused to be read from
15 * storage.
16 */
17 u64 read_bytes;
18
19 /*
20 * The number of bytes which this task has caused, or shall cause to be
21 * written to disk.
22 */
23 u64 write_bytes;
24
25 /*
26 * A task can cause "negative" IO too. If this task truncates some
27 * dirty pagecache, some IO which another task has been accounted for
28 * (in its write_bytes) will not be happening. We _could_ just
29 * subtract that from the truncating task's write_bytes, but there is
30 * information loss in doing that.
31 */
32 u64 cancelled_write_bytes;
33};
34#else
35struct task_io_accounting {
36};
37#endif
diff --git a/include/linux/task_io_accounting_ops.h b/include/linux/task_io_accounting_ops.h
new file mode 100644
index 000000000000..df2a319106b2
--- /dev/null
+++ b/include/linux/task_io_accounting_ops.h
@@ -0,0 +1,47 @@
1/*
2 * Task I/O accounting operations
3 */
4#ifndef __TASK_IO_ACCOUNTING_OPS_INCLUDED
5#define __TASK_IO_ACCOUNTING_OPS_INCLUDED
6
7#ifdef CONFIG_TASK_IO_ACCOUNTING
8static inline void task_io_account_read(size_t bytes)
9{
10 current->ioac.read_bytes += bytes;
11}
12
13static inline void task_io_account_write(size_t bytes)
14{
15 current->ioac.write_bytes += bytes;
16}
17
18static inline void task_io_account_cancelled_write(size_t bytes)
19{
20 current->ioac.cancelled_write_bytes += bytes;
21}
22
23static inline void task_io_accounting_init(struct task_struct *tsk)
24{
25 memset(&tsk->ioac, 0, sizeof(tsk->ioac));
26}
27
28#else
29
30static inline void task_io_account_read(size_t bytes)
31{
32}
33
34static inline void task_io_account_write(size_t bytes)
35{
36}
37
38static inline void task_io_account_cancelled_write(size_t bytes)
39{
40}
41
42static inline void task_io_accounting_init(struct task_struct *tsk)
43{
44}
45
46#endif /* CONFIG_TASK_IO_ACCOUNTING */
47#endif /* __TASK_IO_ACCOUNTING_OPS_INCLUDED */
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
index 45248806ae9c..3fced4798255 100644
--- a/include/linux/taskstats.h
+++ b/include/linux/taskstats.h
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33 33
34#define TASKSTATS_VERSION 2 34#define TASKSTATS_VERSION 3
35#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN 35#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
36 * in linux/sched.h */ 36 * in linux/sched.h */
37 37
@@ -115,31 +115,37 @@ struct taskstats {
115 __u64 ac_majflt; /* Major Page Fault Count */ 115 __u64 ac_majflt; /* Major Page Fault Count */
116 /* Basic Accounting Fields end */ 116 /* Basic Accounting Fields end */
117 117
118 /* Extended accounting fields start */ 118 /* Extended accounting fields start */
119 /* Accumulated RSS usage in duration of a task, in MBytes-usecs. 119 /* Accumulated RSS usage in duration of a task, in MBytes-usecs.
120 * The current rss usage is added to this counter every time 120 * The current rss usage is added to this counter every time
121 * a tick is charged to a task's system time. So, at the end we 121 * a tick is charged to a task's system time. So, at the end we
122 * will have memory usage multiplied by system time. Thus an 122 * will have memory usage multiplied by system time. Thus an
123 * average usage per system time unit can be calculated. 123 * average usage per system time unit can be calculated.
124 */ 124 */
125 __u64 coremem; /* accumulated RSS usage in MB-usec */ 125 __u64 coremem; /* accumulated RSS usage in MB-usec */
126 /* Accumulated virtual memory usage in duration of a task. 126 /* Accumulated virtual memory usage in duration of a task.
127 * Same as acct_rss_mem1 above except that we keep track of VM usage. 127 * Same as acct_rss_mem1 above except that we keep track of VM usage.
128 */ 128 */
129 __u64 virtmem; /* accumulated VM usage in MB-usec */ 129 __u64 virtmem; /* accumulated VM usage in MB-usec */
130 130
131 /* High watermark of RSS and virtual memory usage in duration of 131 /* High watermark of RSS and virtual memory usage in duration of
132 * a task, in KBytes. 132 * a task, in KBytes.
133 */ 133 */
134 __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */ 134 __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */
135 __u64 hiwater_vm; /* High-water VM usage, in KB */ 135 __u64 hiwater_vm; /* High-water VM usage, in KB */
136 136
137 /* The following four fields are I/O statistics of a task. */ 137 /* The following four fields are I/O statistics of a task. */
138 __u64 read_char; /* bytes read */ 138 __u64 read_char; /* bytes read */
139 __u64 write_char; /* bytes written */ 139 __u64 write_char; /* bytes written */
140 __u64 read_syscalls; /* read syscalls */ 140 __u64 read_syscalls; /* read syscalls */
141 __u64 write_syscalls; /* write syscalls */ 141 __u64 write_syscalls; /* write syscalls */
142 /* Extended accounting fields end */ 142 /* Extended accounting fields end */
143
144#define TASKSTATS_HAS_IO_ACCOUNTING
145 /* Per-task storage I/O accounting starts */
146 __u64 read_bytes; /* bytes of read I/O */
147 __u64 write_bytes; /* bytes of write I/O */
148 __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */
143}; 149};
144 150
145 151
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/tfrc.h b/include/linux/tfrc.h
index 31a9b25276fe..8a8462b4a4dd 100644
--- a/include/linux/tfrc.h
+++ b/include/linux/tfrc.h
@@ -37,10 +37,14 @@ struct tfrc_rx_info {
37 * @tfrctx_p: current loss event rate (5.4) 37 * @tfrctx_p: current loss event rate (5.4)
38 * @tfrctx_rto: estimate of RTO, equals 4*RTT (4.3) 38 * @tfrctx_rto: estimate of RTO, equals 4*RTT (4.3)
39 * @tfrctx_ipi: inter-packet interval (4.6) 39 * @tfrctx_ipi: inter-packet interval (4.6)
40 *
41 * Note: X and X_recv are both maintained in units of 64 * bytes/second. This
42 * enables a finer resolution of sending rates and avoids problems with
43 * integer arithmetic; u32 is not sufficient as scaling consumes 6 bits.
40 */ 44 */
41struct tfrc_tx_info { 45struct tfrc_tx_info {
42 __u32 tfrctx_x; 46 __u64 tfrctx_x;
43 __u32 tfrctx_x_recv; 47 __u64 tfrctx_x_recv;
44 __u32 tfrctx_x_calc; 48 __u32 tfrctx_x_calc;
45 __u32 tfrctx_rtt; 49 __u32 tfrctx_rtt;
46 __u32 tfrctx_p; 50 __u32 tfrctx_p;
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/timer.h b/include/linux/timer.h
index c982304dbafd..fb5edaaf0ebd 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -41,7 +41,7 @@ static inline void setup_timer(struct timer_list * timer,
41 init_timer(timer); 41 init_timer(timer);
42} 42}
43 43
44/*** 44/**
45 * timer_pending - is a timer pending? 45 * timer_pending - is a timer pending?
46 * @timer: the timer in question 46 * @timer: the timer in question
47 * 47 *
@@ -63,7 +63,7 @@ extern int mod_timer(struct timer_list *timer, unsigned long expires);
63 63
64extern unsigned long next_timer_interrupt(void); 64extern unsigned long next_timer_interrupt(void);
65 65
66/*** 66/**
67 * add_timer - start a timer 67 * add_timer - start a timer
68 * @timer: the timer to be added 68 * @timer: the timer to be added
69 * 69 *
@@ -98,4 +98,10 @@ extern void run_local_timers(void);
98struct hrtimer; 98struct hrtimer;
99extern int it_real_fn(struct hrtimer *); 99extern int it_real_fn(struct hrtimer *);
100 100
101unsigned long __round_jiffies(unsigned long j, int cpu);
102unsigned long __round_jiffies_relative(unsigned long j, int cpu);
103unsigned long round_jiffies(unsigned long j);
104unsigned long round_jiffies_relative(unsigned long j);
105
106
101#endif 107#endif
diff --git a/include/linux/topology.h b/include/linux/topology.h
index da508d1998e4..6c5a6e6e813b 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -93,7 +93,7 @@
93 .groups = NULL, \ 93 .groups = NULL, \
94 .min_interval = 1, \ 94 .min_interval = 1, \
95 .max_interval = 2, \ 95 .max_interval = 2, \
96 .busy_factor = 8, \ 96 .busy_factor = 64, \
97 .imbalance_pct = 110, \ 97 .imbalance_pct = 110, \
98 .cache_nice_tries = 0, \ 98 .cache_nice_tries = 0, \
99 .per_cpu_gain = 25, \ 99 .per_cpu_gain = 25, \
@@ -194,7 +194,8 @@
194 .wake_idx = 0, /* unused */ \ 194 .wake_idx = 0, /* unused */ \
195 .forkexec_idx = 0, /* unused */ \ 195 .forkexec_idx = 0, /* unused */ \
196 .per_cpu_gain = 100, \ 196 .per_cpu_gain = 100, \
197 .flags = SD_LOAD_BALANCE, \ 197 .flags = SD_LOAD_BALANCE \
198 | SD_SERIALIZE, \
198 .last_balance = jiffies, \ 199 .last_balance = jiffies, \
199 .balance_interval = 64, \ 200 .balance_interval = 64, \
200 .nr_balance_failed = 0, \ 201 .nr_balance_failed = 0, \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index f717f0898238..65cbcf22c31e 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -175,7 +175,7 @@ struct tty_struct {
175 int index; 175 int index;
176 struct tty_ldisc ldisc; 176 struct tty_ldisc ldisc;
177 struct mutex termios_mutex; 177 struct mutex termios_mutex;
178 struct termios *termios, *termios_locked; 178 struct ktermios *termios, *termios_locked;
179 char name[64]; 179 char name[64];
180 int pgrp; 180 int pgrp;
181 int session; 181 int session;
@@ -258,7 +258,7 @@ struct tty_struct {
258 258
259extern void tty_write_flush(struct tty_struct *); 259extern void tty_write_flush(struct tty_struct *);
260 260
261extern struct termios tty_std_termios; 261extern struct ktermios tty_std_termios;
262 262
263extern int kmsg_redirect; 263extern int kmsg_redirect;
264 264
@@ -293,8 +293,9 @@ extern int tty_hung_up_p(struct file * filp);
293extern void do_SAK(struct tty_struct *tty); 293extern void do_SAK(struct tty_struct *tty);
294extern void disassociate_ctty(int priv); 294extern void disassociate_ctty(int priv);
295extern void tty_flip_buffer_push(struct tty_struct *tty); 295extern void tty_flip_buffer_push(struct tty_struct *tty);
296extern int tty_get_baud_rate(struct tty_struct *tty); 296extern speed_t tty_get_baud_rate(struct tty_struct *tty);
297extern int tty_termios_baud_rate(struct termios *termios); 297extern speed_t tty_termios_baud_rate(struct ktermios *termios);
298extern speed_t tty_termios_input_baud_rate(struct ktermios *termios);
298 299
299extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); 300extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *);
300extern void tty_ldisc_deref(struct tty_ldisc *); 301extern void tty_ldisc_deref(struct tty_ldisc *);
@@ -309,6 +310,12 @@ extern void tty_ldisc_flush(struct tty_struct *tty);
309extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 310extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
310 unsigned long arg); 311 unsigned long arg);
311 312
313extern dev_t tty_devnum(struct tty_struct *tty);
314extern 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);
317extern struct tty_struct *get_current_tty(void);
318
312extern struct mutex tty_mutex; 319extern struct mutex tty_mutex;
313 320
314/* n_tty.c */ 321/* n_tty.c */
@@ -335,10 +342,5 @@ extern void console_print(const char *);
335extern int vt_ioctl(struct tty_struct *tty, struct file * file, 342extern int vt_ioctl(struct tty_struct *tty, struct file * file,
336 unsigned int cmd, unsigned long arg); 343 unsigned int cmd, unsigned long arg);
337 344
338static inline dev_t tty_devnum(struct tty_struct *tty)
339{
340 return MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index;
341}
342
343#endif /* __KERNEL__ */ 345#endif /* __KERNEL__ */
344#endif 346#endif
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 5c8473bb6882..659487e3ebeb 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -53,7 +53,7 @@
53 * device-specific ioctl's. If the ioctl number passed in cmd 53 * device-specific ioctl's. If the ioctl number passed in cmd
54 * is not recognized by the driver, it should return ENOIOCTLCMD. 54 * is not recognized by the driver, it should return ENOIOCTLCMD.
55 * 55 *
56 * void (*set_termios)(struct tty_struct *tty, struct termios * old); 56 * void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
57 * 57 *
58 * This routine allows the tty driver to be notified when 58 * This routine allows the tty driver to be notified when
59 * device's termios settings have changed. Note that a 59 * device's termios settings have changed. Note that a
@@ -132,7 +132,7 @@ struct tty_operations {
132 int (*chars_in_buffer)(struct tty_struct *tty); 132 int (*chars_in_buffer)(struct tty_struct *tty);
133 int (*ioctl)(struct tty_struct *tty, struct file * file, 133 int (*ioctl)(struct tty_struct *tty, struct file * file,
134 unsigned int cmd, unsigned long arg); 134 unsigned int cmd, unsigned long arg);
135 void (*set_termios)(struct tty_struct *tty, struct termios * old); 135 void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
136 void (*throttle)(struct tty_struct * tty); 136 void (*throttle)(struct tty_struct * tty);
137 void (*unthrottle)(struct tty_struct * tty); 137 void (*unthrottle)(struct tty_struct * tty);
138 void (*stop)(struct tty_struct *tty); 138 void (*stop)(struct tty_struct *tty);
@@ -165,7 +165,7 @@ struct tty_driver {
165 int num; /* number of devices allocated */ 165 int num; /* number of devices allocated */
166 short type; /* type of tty driver */ 166 short type; /* type of tty driver */
167 short subtype; /* subtype of tty driver */ 167 short subtype; /* subtype of tty driver */
168 struct termios init_termios; /* Initial termios */ 168 struct ktermios init_termios; /* Initial termios */
169 int flags; /* tty driver flags */ 169 int flags; /* tty driver flags */
170 int refcount; /* for loadable tty drivers */ 170 int refcount; /* for loadable tty drivers */
171 struct proc_dir_entry *proc_entry; /* /proc fs entry */ 171 struct proc_dir_entry *proc_entry; /* /proc fs entry */
@@ -175,8 +175,8 @@ struct tty_driver {
175 * Pointer to the tty data structures 175 * Pointer to the tty data structures
176 */ 176 */
177 struct tty_struct **ttys; 177 struct tty_struct **ttys;
178 struct termios **termios; 178 struct ktermios **termios;
179 struct termios **termios_locked; 179 struct ktermios **termios_locked;
180 void *driver_state; /* only used for the PTY driver */ 180 void *driver_state; /* only used for the PTY driver */
181 181
182 /* 182 /*
@@ -193,7 +193,7 @@ struct tty_driver {
193 int (*chars_in_buffer)(struct tty_struct *tty); 193 int (*chars_in_buffer)(struct tty_struct *tty);
194 int (*ioctl)(struct tty_struct *tty, struct file * file, 194 int (*ioctl)(struct tty_struct *tty, struct file * file,
195 unsigned int cmd, unsigned long arg); 195 unsigned int cmd, unsigned long arg);
196 void (*set_termios)(struct tty_struct *tty, struct termios * old); 196 void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
197 void (*throttle)(struct tty_struct * tty); 197 void (*throttle)(struct tty_struct * tty);
198 void (*unthrottle)(struct tty_struct * tty); 198 void (*unthrottle)(struct tty_struct * tty);
199 void (*stop)(struct tty_struct *tty); 199 void (*stop)(struct tty_struct *tty);
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 83c6e6c10ebb..d75932e27710 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -59,7 +59,7 @@
59 * low-level driver can "grab" an ioctl request before the line 59 * low-level driver can "grab" an ioctl request before the line
60 * discpline has a chance to see it. 60 * discpline has a chance to see it.
61 * 61 *
62 * void (*set_termios)(struct tty_struct *tty, struct termios * old); 62 * void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
63 * 63 *
64 * This function notifies the line discpline that a change has 64 * This function notifies the line discpline that a change has
65 * been made to the termios structure. 65 * been made to the termios structure.
@@ -118,7 +118,7 @@ struct tty_ldisc {
118 const unsigned char * buf, size_t nr); 118 const unsigned char * buf, size_t nr);
119 int (*ioctl)(struct tty_struct * tty, struct file * file, 119 int (*ioctl)(struct tty_struct * tty, struct file * file,
120 unsigned int cmd, unsigned long arg); 120 unsigned int cmd, unsigned long arg);
121 void (*set_termios)(struct tty_struct *tty, struct termios * old); 121 void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
122 unsigned int (*poll)(struct tty_struct *, struct file *, 122 unsigned int (*poll)(struct tty_struct *, struct file *,
123 struct poll_table_struct *); 123 struct poll_table_struct *);
124 int (*hangup)(struct tty_struct *tty); 124 int (*hangup)(struct tty_struct *tty);
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 28967eda9d7b..d3a4f994a5dc 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -789,6 +789,7 @@ struct ufs_sb_private_info {
789 789
790 __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */ 790 __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */
791 __s32 fs_magic; /* filesystem magic */ 791 __s32 fs_magic; /* filesystem magic */
792 unsigned int s_dirblksize;
792}; 793};
793 794
794/* 795/*
diff --git a/include/linux/unwind.h b/include/linux/unwind.h
index 749928c161fb..7760860fa170 100644
--- a/include/linux/unwind.h
+++ b/include/linux/unwind.h
@@ -14,63 +14,6 @@
14 14
15struct module; 15struct module;
16 16
17#ifdef CONFIG_STACK_UNWIND
18
19#include <asm/unwind.h>
20
21#ifndef ARCH_UNWIND_SECTION_NAME
22#define ARCH_UNWIND_SECTION_NAME ".eh_frame"
23#endif
24
25/*
26 * Initialize unwind support.
27 */
28extern void unwind_init(void);
29extern void unwind_setup(void);
30
31#ifdef CONFIG_MODULES
32
33extern void *unwind_add_table(struct module *,
34 const void *table_start,
35 unsigned long table_size);
36
37extern void unwind_remove_table(void *handle, int init_only);
38
39#endif
40
41extern int unwind_init_frame_info(struct unwind_frame_info *,
42 struct task_struct *,
43 /*const*/ struct pt_regs *);
44
45/*
46 * Prepare to unwind a blocked task.
47 */
48extern int unwind_init_blocked(struct unwind_frame_info *,
49 struct task_struct *);
50
51/*
52 * Prepare to unwind the currently running thread.
53 */
54extern int unwind_init_running(struct unwind_frame_info *,
55 asmlinkage int (*callback)(struct unwind_frame_info *,
56 void *arg),
57 void *arg);
58
59/*
60 * Unwind to previous to frame. Returns 0 if successful, negative
61 * number in case of an error.
62 */
63extern int unwind(struct unwind_frame_info *);
64
65/*
66 * Unwind until the return pointer is in user-land (or until an error
67 * occurs). Returns 0 if successful, negative number in case of
68 * error.
69 */
70extern int unwind_to_user(struct unwind_frame_info *);
71
72#else
73
74struct unwind_frame_info {}; 17struct unwind_frame_info {};
75 18
76static inline void unwind_init(void) {} 19static inline void unwind_init(void) {}
@@ -85,12 +28,12 @@ static inline void *unwind_add_table(struct module *mod,
85 return NULL; 28 return NULL;
86} 29}
87 30
88#endif
89
90static inline void unwind_remove_table(void *handle, int init_only) 31static inline void unwind_remove_table(void *handle, int init_only)
91{ 32{
92} 33}
93 34
35#endif
36
94static inline int unwind_init_frame_info(struct unwind_frame_info *info, 37static inline int unwind_init_frame_info(struct unwind_frame_info *info,
95 struct task_struct *tsk, 38 struct task_struct *tsk,
96 const struct pt_regs *regs) 39 const struct pt_regs *regs)
@@ -122,6 +65,4 @@ static inline int unwind_to_user(struct unwind_frame_info *info)
122 return -ENOSYS; 65 return -ENOSYS;
123} 66}
124 67
125#endif
126
127#endif /* _LINUX_UNWIND_H */ 68#endif /* _LINUX_UNWIND_H */
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 91b3ea2bbb14..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);
@@ -218,7 +223,7 @@ struct usb_serial_driver {
218 int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count); 223 int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count);
219 int (*write_room) (struct usb_serial_port *port); 224 int (*write_room) (struct usb_serial_port *port);
220 int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); 225 int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
221 void (*set_termios) (struct usb_serial_port *port, struct termios * old); 226 void (*set_termios) (struct usb_serial_port *port, struct ktermios * old);
222 void (*break_ctl) (struct usb_serial_port *port, int break_state); 227 void (*break_ctl) (struct usb_serial_port *port, int break_state);
223 int (*chars_in_buffer) (struct usb_serial_port *port); 228 int (*chars_in_buffer) (struct usb_serial_port *port);
224 void (*throttle) (struct usb_serial_port *port); 229 void (*throttle) (struct usb_serial_port *port);
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/videodev2.h b/include/linux/videodev2.h
index df5c4654360d..d94e2683be52 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -244,6 +244,7 @@ struct v4l2_pix_format
244#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ 244#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */
245#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ 245#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */
246#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:2:0 16x16 macroblocks */ 246#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:2:0 16x16 macroblocks */
247#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R','4','4','4') /* 16 xxxxrrrr ggggbbbb */
247 248
248/* see http://www.siliconimaging.com/RGB%20Bayer.htm */ 249/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
249#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ 250#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */
@@ -661,6 +662,15 @@ typedef __u64 v4l2_std_id;
661#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) 662#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
662#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000) 663#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
663 664
665/* FIXME:
666 Although std_id is 64 bits, there is an issue on PPC32 architecture that
667 makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
668 this value to 32 bits.
669 As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
670 it should work fine. However, if needed to add more than two standards,
671 v4l2-common.c should be fixed.
672 */
673
664/* some merged standards */ 674/* some merged standards */
665#define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC) 675#define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC)
666#define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B) 676#define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B)
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index c89df55f6e03..5e9803ed17fc 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -10,8 +10,9 @@
10/* 10/*
11 * Light weight per cpu counter implementation. 11 * Light weight per cpu counter implementation.
12 * 12 *
13 * Counters should only be incremented and no critical kernel component 13 * Counters should only be incremented. You need to set EMBEDDED
14 * should rely on the counter values. 14 * to disable VM_EVENT_COUNTERS. Things like procps (vmstat,
15 * top, etc) use /proc/vmstat and depend on these counters.
15 * 16 *
16 * Counters are handled completely inline. On many platforms the code 17 * Counters are handled completely inline. On many platforms the code
17 * generated will simply be the increment of a global address. 18 * generated will simply be the increment of a global address.
@@ -73,7 +74,13 @@ static inline void count_vm_events(enum vm_event_item item, long delta)
73} 74}
74 75
75extern void all_vm_events(unsigned long *); 76extern void all_vm_events(unsigned long *);
77#ifdef CONFIG_HOTPLUG
76extern void vm_events_fold_cpu(int cpu); 78extern void vm_events_fold_cpu(int cpu);
79#else
80static inline void vm_events_fold_cpu(int cpu)
81{
82}
83#endif
77 84
78#else 85#else
79 86
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/workqueue.h b/include/linux/workqueue.h
index edef8d50b26b..2a7b38d87018 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -8,16 +8,21 @@
8#include <linux/timer.h> 8#include <linux/timer.h>
9#include <linux/linkage.h> 9#include <linux/linkage.h>
10#include <linux/bitops.h> 10#include <linux/bitops.h>
11#include <asm/atomic.h>
11 12
12struct workqueue_struct; 13struct workqueue_struct;
13 14
14struct work_struct; 15struct work_struct;
15typedef void (*work_func_t)(struct work_struct *work); 16typedef void (*work_func_t)(struct work_struct *work);
16 17
18/*
19 * The first word is the work queue pointer and the flags rolled into
20 * one
21 */
22#define work_data_bits(work) ((unsigned long *)(&(work)->data))
23
17struct work_struct { 24struct work_struct {
18 /* the first word is the work queue pointer and the flags rolled into 25 atomic_long_t data;
19 * one */
20 unsigned long management;
21#define WORK_STRUCT_PENDING 0 /* T if work item pending execution */ 26#define WORK_STRUCT_PENDING 0 /* T if work item pending execution */
22#define WORK_STRUCT_NOAUTOREL 1 /* F if work item automatically released on exec */ 27#define WORK_STRUCT_NOAUTOREL 1 /* F if work item automatically released on exec */
23#define WORK_STRUCT_FLAG_MASK (3UL) 28#define WORK_STRUCT_FLAG_MASK (3UL)
@@ -26,6 +31,9 @@ struct work_struct {
26 work_func_t func; 31 work_func_t func;
27}; 32};
28 33
34#define WORK_DATA_INIT(autorelease) \
35 ATOMIC_LONG_INIT((autorelease) << WORK_STRUCT_NOAUTOREL)
36
29struct delayed_work { 37struct delayed_work {
30 struct work_struct work; 38 struct work_struct work;
31 struct timer_list timer; 39 struct timer_list timer;
@@ -36,13 +44,13 @@ struct execute_work {
36}; 44};
37 45
38#define __WORK_INITIALIZER(n, f) { \ 46#define __WORK_INITIALIZER(n, f) { \
39 .management = 0, \ 47 .data = WORK_DATA_INIT(0), \
40 .entry = { &(n).entry, &(n).entry }, \ 48 .entry = { &(n).entry, &(n).entry }, \
41 .func = (f), \ 49 .func = (f), \
42 } 50 }
43 51
44#define __WORK_INITIALIZER_NAR(n, f) { \ 52#define __WORK_INITIALIZER_NAR(n, f) { \
45 .management = (1 << WORK_STRUCT_NOAUTOREL), \ 53 .data = WORK_DATA_INIT(1), \
46 .entry = { &(n).entry, &(n).entry }, \ 54 .entry = { &(n).entry, &(n).entry }, \
47 .func = (f), \ 55 .func = (f), \
48 } 56 }
@@ -82,17 +90,21 @@ struct execute_work {
82 90
83/* 91/*
84 * initialize all of a work item in one go 92 * initialize all of a work item in one go
93 *
94 * NOTE! No point in using "atomic_long_set()": useing a direct
95 * assignment of the work data initializer allows the compiler
96 * to generate better code.
85 */ 97 */
86#define INIT_WORK(_work, _func) \ 98#define INIT_WORK(_work, _func) \
87 do { \ 99 do { \
88 (_work)->management = 0; \ 100 (_work)->data = (atomic_long_t) WORK_DATA_INIT(0); \
89 INIT_LIST_HEAD(&(_work)->entry); \ 101 INIT_LIST_HEAD(&(_work)->entry); \
90 PREPARE_WORK((_work), (_func)); \ 102 PREPARE_WORK((_work), (_func)); \
91 } while (0) 103 } while (0)
92 104
93#define INIT_WORK_NAR(_work, _func) \ 105#define INIT_WORK_NAR(_work, _func) \
94 do { \ 106 do { \
95 (_work)->management = (1 << WORK_STRUCT_NOAUTOREL); \ 107 (_work)->data = (atomic_long_t) WORK_DATA_INIT(1); \
96 INIT_LIST_HEAD(&(_work)->entry); \ 108 INIT_LIST_HEAD(&(_work)->entry); \
97 PREPARE_WORK((_work), (_func)); \ 109 PREPARE_WORK((_work), (_func)); \
98 } while (0) 110 } while (0)
@@ -114,15 +126,15 @@ struct execute_work {
114 * @work: The work item in question 126 * @work: The work item in question
115 */ 127 */
116#define work_pending(work) \ 128#define work_pending(work) \
117 test_bit(WORK_STRUCT_PENDING, &(work)->management) 129 test_bit(WORK_STRUCT_PENDING, work_data_bits(work))
118 130
119/** 131/**
120 * delayed_work_pending - Find out whether a delayable work item is currently 132 * delayed_work_pending - Find out whether a delayable work item is currently
121 * pending 133 * pending
122 * @work: The work item in question 134 * @work: The work item in question
123 */ 135 */
124#define delayed_work_pending(work) \ 136#define delayed_work_pending(w) \
125 test_bit(WORK_STRUCT_PENDING, &(work)->work.management) 137 work_pending(&(w)->work)
126 138
127/** 139/**
128 * work_release - Release a work item under execution 140 * work_release - Release a work item under execution
@@ -143,7 +155,7 @@ struct execute_work {
143 * This should also be used to release a delayed work item. 155 * This should also be used to release a delayed work item.
144 */ 156 */
145#define work_release(work) \ 157#define work_release(work) \
146 clear_bit(WORK_STRUCT_PENDING, &(work)->management) 158 clear_bit(WORK_STRUCT_PENDING, work_data_bits(work))
147 159
148 160
149extern struct workqueue_struct *__create_workqueue(const char *name, 161extern struct workqueue_struct *__create_workqueue(const char *name,
@@ -188,7 +200,7 @@ static inline int cancel_delayed_work(struct delayed_work *work)
188 200
189 ret = del_timer_sync(&work->timer); 201 ret = del_timer_sync(&work->timer);
190 if (ret) 202 if (ret)
191 clear_bit(WORK_STRUCT_PENDING, &work->work.management); 203 work_release(&work->work);
192 return ret; 204 return ret;
193} 205}
194 206
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 088ba8113f7e..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,13 +355,26 @@ 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
357#define XFRMGRP_EXPIRE 2 374#define XFRMGRP_EXPIRE 2
358#define XFRMGRP_SA 4 375#define XFRMGRP_SA 4
359#define XFRMGRP_POLICY 8 376#define XFRMGRP_POLICY 8
360#define XFRMGRP_REPORT 0x10 377#define XFRMGRP_REPORT 0x20
361#endif 378#endif
362 379
363enum xfrm_nlgroups { 380enum xfrm_nlgroups {
@@ -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/media/cx2341x.h b/include/media/cx2341x.h
index d91d88f93c8b..ecad55bf0162 100644
--- a/include/media/cx2341x.h
+++ b/include/media/cx2341x.h
@@ -49,7 +49,7 @@ struct cx2341x_mpeg_params {
49 enum v4l2_mpeg_audio_mode_extension audio_mode_extension; 49 enum v4l2_mpeg_audio_mode_extension audio_mode_extension;
50 enum v4l2_mpeg_audio_emphasis audio_emphasis; 50 enum v4l2_mpeg_audio_emphasis audio_emphasis;
51 enum v4l2_mpeg_audio_crc audio_crc; 51 enum v4l2_mpeg_audio_crc audio_crc;
52 u8 audio_properties; 52 u16 audio_properties;
53 53
54 /* video */ 54 /* video */
55 enum v4l2_mpeg_video_encoding video_encoding; 55 enum v4l2_mpeg_video_encoding video_encoding;
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 8f58406533c6..4bb0ad810179 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -24,6 +24,7 @@
24#define _IR_COMMON 24#define _IR_COMMON
25 25
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/workqueue.h>
27 28
28#define IR_TYPE_RC5 1 29#define IR_TYPE_RC5 1
29#define IR_TYPE_PD 2 /* Pulse distance encoded IR */ 30#define IR_TYPE_PD 2 /* Pulse distance encoded IR */
@@ -92,6 +93,7 @@ extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE];
92extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE]; 93extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE];
93extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE]; 94extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE];
94extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE]; 95extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE];
96extern IR_KEYTAB_TYPE ir_codes_budget_ci_old[IR_KEYTAB_SIZE];
95 97
96#endif 98#endif
97 99
diff --git a/include/media/saa7146.h b/include/media/saa7146.h
index fee579f10b32..796bcf151a3a 100644
--- a/include/media/saa7146.h
+++ b/include/media/saa7146.h
@@ -42,10 +42,6 @@ extern unsigned int saa7146_debug;
42#define DEB_INT(x) if (0!=(DEBUG_VARIABLE&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */ 42#define DEB_INT(x) if (0!=(DEBUG_VARIABLE&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */
43#define DEB_CAP(x) if (0!=(DEBUG_VARIABLE&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */ 43#define DEB_CAP(x) if (0!=(DEBUG_VARIABLE&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */
44 44
45#define SAA7146_IER_DISABLE(x,y) \
46 saa7146_write(x, IER, saa7146_read(x, IER) & ~(y));
47#define SAA7146_IER_ENABLE(x,y) \
48 saa7146_write(x, IER, saa7146_read(x, IER) | (y));
49#define SAA7146_ISR_CLEAR(x,y) \ 45#define SAA7146_ISR_CLEAR(x,y) \
50 saa7146_write(x, ISR, (y)); 46 saa7146_write(x, ISR, (y));
51 47
@@ -441,4 +437,20 @@ int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop);
441#define SAA7146_I2C_BUS_BIT_RATE_80 (0x200) 437#define SAA7146_I2C_BUS_BIT_RATE_80 (0x200)
442#define SAA7146_I2C_BUS_BIT_RATE_60 (0x300) 438#define SAA7146_I2C_BUS_BIT_RATE_60 (0x300)
443 439
440static inline void SAA7146_IER_DISABLE(struct saa7146_dev *x, unsigned y)
441{
442 unsigned long flags;
443 spin_lock_irqsave(&x->int_slock, flags);
444 saa7146_write(x, IER, saa7146_read(x, IER) & ~y);
445 spin_unlock_irqrestore(&x->int_slock, flags);
446}
447
448static inline void SAA7146_IER_ENABLE(struct saa7146_dev *x, unsigned y)
449{
450 unsigned long flags;
451 spin_lock_irqsave(&x->int_slock, flags);
452 saa7146_write(x, IER, saa7146_read(x, IER) | y);
453 spin_unlock_irqrestore(&x->int_slock, flags);
454}
455
444#endif 456#endif
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h
index 37dad07a8439..e5ad3fcfe984 100644
--- a/include/media/tuner-types.h
+++ b/include/media/tuner-types.h
@@ -50,6 +50,10 @@ struct tuner_params {
50 sensitivity. If this setting is 1, then set PORT2 to 1 to 50 sensitivity. If this setting is 1, then set PORT2 to 1 to
51 get proper FM reception. */ 51 get proper FM reception. */
52 unsigned int port2_fm_high_sensitivity:1; 52 unsigned int port2_fm_high_sensitivity:1;
53 /* Some Philips tuners use tda9887 cGainNormal to select the FM radio
54 sensitivity. If this setting is 1, e register will use cGainNormal
55 instead of cGainLow. */
56 unsigned int fm_gain_normal:1;
53 /* Most tuners with a tda9887 use QSS mode. Some (cheaper) tuners 57 /* Most tuners with a tda9887 use QSS mode. Some (cheaper) tuners
54 use Intercarrier mode. If this setting is 1, then the tuner 58 use Intercarrier mode. If this setting is 1, then the tuner
55 needs to be set to intercarrier mode. */ 59 needs to be set to intercarrier mode. */
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 3116e750132f..99acf847365c 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -145,6 +145,7 @@ extern int tuner_debug;
145#define TDA9887_DEEMPHASIS_75 (3<<16) 145#define TDA9887_DEEMPHASIS_75 (3<<16)
146#define TDA9887_AUTOMUTE (1<<18) 146#define TDA9887_AUTOMUTE (1<<18)
147#define TDA9887_GATING_18 (1<<19) 147#define TDA9887_GATING_18 (1<<19)
148#define TDA9887_GAIN_NORMAL (1<<20)
148 149
149#ifdef __KERNEL__ 150#ifdef __KERNEL__
150 151
diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h
index e9fc1a785497..5660ea24996b 100644
--- a/include/media/tveeprom.h
+++ b/include/media/tveeprom.h
@@ -3,7 +3,7 @@
3 3
4struct tveeprom { 4struct tveeprom {
5 u32 has_radio; 5 u32 has_radio;
6 u32 has_ir; /* 0: no IR, 1: IR present, 2: unknown */ 6 u32 has_ir; /* bit 0: IR receiver present, bit 1: IR transmitter (blaster) present. -1 == unknown */
7 u32 has_MAC_address; /* 0: no MAC, 1: MAC present, 2: unknown */ 7 u32 has_MAC_address; /* 0: no MAC, 1: MAC present, 2: unknown */
8 8
9 u32 tuner_type; 9 u32 tuner_type;
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index aecc946980a3..91b19921f958 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -144,6 +144,9 @@ enum v4l2_chip_ident {
144 V4L2_IDENT_CX25841 = 241, 144 V4L2_IDENT_CX25841 = 241,
145 V4L2_IDENT_CX25842 = 242, 145 V4L2_IDENT_CX25842 = 242,
146 V4L2_IDENT_CX25843 = 243, 146 V4L2_IDENT_CX25843 = 243,
147
148 /* OmniVision sensors - range 250-299 */
149 V4L2_IDENT_OV7670 = 250,
147}; 150};
148 151
149/* audio ioctls */ 152/* audio ioctls */
@@ -251,4 +254,8 @@ struct v4l2_crystal_freq {
251 If the frequency is not supported, then -EINVAL is returned. */ 254 If the frequency is not supported, then -EINVAL is returned. */
252#define VIDIOC_INT_S_CRYSTAL_FREQ _IOW ('d', 113, struct v4l2_crystal_freq) 255#define VIDIOC_INT_S_CRYSTAL_FREQ _IOW ('d', 113, struct v4l2_crystal_freq)
253 256
257/* Initialize the sensor registors to some sort of reasonable
258 default values. */
259#define VIDIOC_INT_INIT _IOW ('d', 114, u32)
260
254#endif /* V4L2_COMMON_H_ */ 261#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 6a11d772700f..fb96472a1bd3 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -43,6 +43,7 @@
43 43
44/* Video standard functions */ 44/* Video standard functions */
45extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs); 45extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
46extern char *v4l2_norm_to_name(v4l2_std_id id);
46extern int v4l2_video_std_construct(struct v4l2_standard *vs, 47extern int v4l2_video_std_construct(struct v4l2_standard *vs,
47 int id, char *name); 48 int id, char *name);
48 49
@@ -81,12 +82,6 @@ extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
81 * This version moves redundant code from video device code to 82 * This version moves redundant code from video device code to
82 * the common handler 83 * the common handler
83 */ 84 */
84struct v4l2_tvnorm {
85 char *name;
86 v4l2_std_id id;
87
88 void *priv_data;
89};
90 85
91struct video_device 86struct video_device
92{ 87{
@@ -104,9 +99,8 @@ struct video_device
104 int debug; /* Activates debug level*/ 99 int debug; /* Activates debug level*/
105 100
106 /* Video standard vars */ 101 /* Video standard vars */
107 int tvnormsize; /* Size of tvnorm array */ 102 v4l2_std_id tvnorms; /* Supported tv norms */
108 v4l2_std_id current_norm; /* Current tvnorm */ 103 v4l2_std_id current_norm; /* Current tvnorm */
109 struct v4l2_tvnorm *tvnorms;
110 104
111 /* callbacks */ 105 /* callbacks */
112 void (*release)(struct video_device *vfd); 106 void (*release)(struct video_device *vfd);
@@ -211,7 +205,7 @@ struct video_device
211 /* Standard handling 205 /* Standard handling
212 G_STD and ENUMSTD are handled by videodev.c 206 G_STD and ENUMSTD are handled by videodev.c
213 */ 207 */
214 int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id a); 208 int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm);
215 int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a); 209 int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a);
216 210
217 /* Input handling */ 211 /* Input handling */
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 69374cd1a857..5ae10dd2e32e 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -277,20 +277,24 @@ struct sock *ax25_get_socket(ax25_address *, ax25_address *, int);
277extern ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *, struct net_device *); 277extern ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *, struct net_device *);
278extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int); 278extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int);
279extern void ax25_destroy_socket(ax25_cb *); 279extern void ax25_destroy_socket(ax25_cb *);
280extern ax25_cb *ax25_create_cb(void); 280extern ax25_cb * __must_check ax25_create_cb(void);
281extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); 281extern void ax25_fillin_cb(ax25_cb *, ax25_dev *);
282extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *); 282extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *);
283 283
284/* ax25_addr.c */ 284/* ax25_addr.c */
285extern ax25_address null_ax25_address; 285extern const ax25_address ax25_bcast;
286extern char *ax2asc(char *buf, ax25_address *); 286extern const ax25_address ax25_defaddr;
287extern void asc2ax(ax25_address *addr, char *callsign); 287extern const ax25_address null_ax25_address;
288extern int ax25cmp(ax25_address *, ax25_address *); 288extern char *ax2asc(char *buf, const ax25_address *);
289extern int ax25digicmp(ax25_digi *, ax25_digi *); 289extern void asc2ax(ax25_address *addr, const char *callsign);
290extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *); 290extern int ax25cmp(const ax25_address *, const ax25_address *);
291extern int ax25_addr_build(unsigned char *, ax25_address *, ax25_address *, ax25_digi *, int, int); 291extern int ax25digicmp(const ax25_digi *, const ax25_digi *);
292extern int ax25_addr_size(ax25_digi *); 292extern const unsigned char *ax25_addr_parse(const unsigned char *, int,
293extern void ax25_digi_invert(ax25_digi *, ax25_digi *); 293 ax25_address *, ax25_address *, ax25_digi *, int *, int *);
294extern int ax25_addr_build(unsigned char *, const ax25_address *,
295 const ax25_address *, const ax25_digi *, int, int);
296extern int ax25_addr_size(const ax25_digi *);
297extern void ax25_digi_invert(const ax25_digi *, ax25_digi *);
294 298
295/* ax25_dev.c */ 299/* ax25_dev.c */
296extern ax25_dev *ax25_dev_list; 300extern ax25_dev *ax25_dev_list;
@@ -329,11 +333,25 @@ extern void ax25_ds_t3timer_expiry(ax25_cb *);
329extern void ax25_ds_idletimer_expiry(ax25_cb *); 333extern void ax25_ds_idletimer_expiry(ax25_cb *);
330 334
331/* ax25_iface.c */ 335/* ax25_iface.c */
332extern int ax25_protocol_register(unsigned int, int (*)(struct sk_buff *, ax25_cb *)); 336
337struct ax25_protocol {
338 struct ax25_protocol *next;
339 unsigned int pid;
340 int (*func)(struct sk_buff *, ax25_cb *);
341};
342
343extern void ax25_register_pid(struct ax25_protocol *ap);
333extern void ax25_protocol_release(unsigned int); 344extern void ax25_protocol_release(unsigned int);
334extern int ax25_linkfail_register(void (*)(ax25_cb *, int)); 345
335extern void ax25_linkfail_release(void (*)(ax25_cb *, int)); 346struct ax25_linkfail {
336extern int ax25_listen_register(ax25_address *, struct net_device *); 347 struct hlist_node lf_node;
348 void (*func)(ax25_cb *, int);
349};
350
351extern void ax25_linkfail_register(struct ax25_linkfail *lf);
352extern void ax25_linkfail_release(struct ax25_linkfail *lf);
353extern int __must_check ax25_listen_register(ax25_address *,
354 struct net_device *);
337extern void ax25_listen_release(ax25_address *, struct net_device *); 355extern void ax25_listen_release(ax25_address *, struct net_device *);
338extern int (*ax25_protocol_function(unsigned int))(struct sk_buff *, ax25_cb *); 356extern int (*ax25_protocol_function(unsigned int))(struct sk_buff *, ax25_cb *);
339extern int ax25_listen_mine(ax25_address *, struct net_device *); 357extern int ax25_listen_mine(ax25_address *, struct net_device *);
@@ -411,7 +429,7 @@ extern unsigned long ax25_display_timer(struct timer_list *);
411/* ax25_uid.c */ 429/* ax25_uid.c */
412extern int ax25_uid_policy; 430extern int ax25_uid_policy;
413extern ax25_uid_assoc *ax25_findbyuid(uid_t); 431extern ax25_uid_assoc *ax25_findbyuid(uid_t);
414extern int ax25_uid_ioctl(int, struct sockaddr_ax25 *); 432extern int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *);
415extern struct file_operations ax25_uid_fops; 433extern struct file_operations ax25_uid_fops;
416extern void ax25_uid_free(void); 434extern void ax25_uid_free(void);
417 435
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 10a3eec191fd..41456c148842 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -739,13 +739,13 @@ struct sockaddr_hci {
739struct hci_filter { 739struct hci_filter {
740 unsigned long type_mask; 740 unsigned long type_mask;
741 unsigned long event_mask[2]; 741 unsigned long event_mask[2];
742 __u16 opcode; 742 __le16 opcode;
743}; 743};
744 744
745struct hci_ufilter { 745struct hci_ufilter {
746 __u32 type_mask; 746 __u32 type_mask;
747 __u32 event_mask[2]; 747 __u32 event_mask[2];
748 __u16 opcode; 748 __le16 opcode;
749}; 749};
750 750
751#define HCI_FLT_TYPE_BITS 31 751#define HCI_FLT_TYPE_BITS 31
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index e6af381e206d..e02d85f56e60 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -218,7 +218,7 @@ struct ieee80211_snap_hdr {
218#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE) 218#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE)
219 219
220#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG) 220#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
221#define WLAN_GET_SEQ_SEQ(seq) ((seq) & IEEE80211_SCTL_SEQ) 221#define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
222 222
223/* Authentication algorithms */ 223/* Authentication algorithms */
224#define WLAN_AUTH_OPEN 0 224#define WLAN_AUTH_OPEN 0
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h
index 16aa96a6a53b..f13ddc2543b1 100644
--- a/include/net/inet6_connection_sock.h
+++ b/include/net/inet6_connection_sock.h
@@ -38,5 +38,5 @@ extern void inet6_csk_reqsk_queue_hash_add(struct sock *sk,
38 38
39extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); 39extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr);
40 40
41extern int inet6_csk_xmit(struct sk_buff *skb, struct sock *sk, int ipfragok); 41extern int inet6_csk_xmit(struct sk_buff *skb, int ipfragok);
42#endif /* _INET6_CONNECTION_SOCK_H */ 42#endif /* _INET6_CONNECTION_SOCK_H */
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index bf16d98d372c..133cf30d2d79 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -37,8 +37,7 @@ struct tcp_congestion_ops;
37 * (i.e. things that depend on the address family) 37 * (i.e. things that depend on the address family)
38 */ 38 */
39struct inet_connection_sock_af_ops { 39struct inet_connection_sock_af_ops {
40 int (*queue_xmit)(struct sk_buff *skb, struct sock *sk, 40 int (*queue_xmit)(struct sk_buff *skb, int ipfragok);
41 int ipfragok);
42 void (*send_check)(struct sock *sk, int len, 41 void (*send_check)(struct sock *sk, int len,
43 struct sk_buff *skb); 42 struct sk_buff *skb);
44 int (*rebuild_header)(struct sock *sk); 43 int (*rebuild_header)(struct sock *sk);
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/ip.h b/include/net/ip.h
index 83cb9ac5554e..e79c3e3aa4f6 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -97,7 +97,7 @@ extern int ip_mc_output(struct sk_buff *skb);
97extern int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); 97extern int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
98extern int ip_do_nat(struct sk_buff *skb); 98extern int ip_do_nat(struct sk_buff *skb);
99extern void ip_send_check(struct iphdr *ip); 99extern void ip_send_check(struct iphdr *ip);
100extern int ip_queue_xmit(struct sk_buff *skb, struct sock *sk, int ipfragok); 100extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok);
101extern void ip_init(void); 101extern void ip_init(void);
102extern int ip_append_data(struct sock *sk, 102extern int ip_append_data(struct sock *sk,
103 int getfrag(void *from, char *to, int offset, int len, 103 int getfrag(void *from, char *to, int offset, int len,
@@ -376,8 +376,7 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write,
376 size_t *lenp, loff_t *ppos); 376 size_t *lenp, loff_t *ppos);
377int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen, 377int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen,
378 void __user *oldval, size_t __user *oldlenp, 378 void __user *oldval, size_t __user *oldlenp,
379 void __user *newval, size_t newlen, 379 void __user *newval, size_t newlen);
380 void **context);
381#ifdef CONFIG_PROC_FS 380#ifdef CONFIG_PROC_FS
382extern int ip_misc_proc_init(void); 381extern int ip_misc_proc_init(void);
383#endif 382#endif
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h
index 68e2b32cf1d6..bc1b0fda2b04 100644
--- a/include/net/ip6_checksum.h
+++ b/include/net/ip6_checksum.h
@@ -87,7 +87,7 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
87 carry = (sum < uproto); 87 carry = (sum < uproto);
88 sum += carry; 88 sum += carry;
89 89
90 return csum_fold((__force __wsum)csum); 90 return csum_fold((__force __wsum)sum);
91} 91}
92 92
93#endif 93#endif
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index f9cde44f93b4..7be4f4e3a0f2 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -50,9 +50,9 @@ struct fib6_node
50 struct fib6_node *parent; 50 struct fib6_node *parent;
51 struct fib6_node *left; 51 struct fib6_node *left;
52 struct fib6_node *right; 52 struct fib6_node *right;
53 53#ifdef CONFIG_IPV6_SUBTREES
54 struct fib6_node *subtree; 54 struct fib6_node *subtree;
55 55#endif
56 struct rt6_info *leaf; 56 struct rt6_info *leaf;
57 57
58 __u16 fn_bit; /* bit key */ 58 __u16 fn_bit; /* bit key */
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h
index 87699cb4ef8c..8dabdd603fe1 100644
--- a/include/net/irda/ircomm_tty.h
+++ b/include/net/irda/ircomm_tty.h
@@ -126,7 +126,7 @@ extern int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file,
126extern int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, 126extern int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file,
127 unsigned int cmd, unsigned long arg); 127 unsigned int cmd, unsigned long arg);
128extern void ircomm_tty_set_termios(struct tty_struct *tty, 128extern void ircomm_tty_set_termios(struct tty_struct *tty,
129 struct termios *old_termios); 129 struct ktermios *old_termios);
130extern hashbin_t *ircomm_tty; 130extern hashbin_t *ircomm_tty;
131 131
132#endif 132#endif
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/neighbour.h b/include/net/neighbour.h
index 23967031ddb7..3725b93c52f3 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -309,6 +309,24 @@ static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
309 return 0; 309 return 0;
310} 310}
311 311
312static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb)
313{
314 unsigned seq;
315 int hh_len;
316
317 do {
318 int hh_alen;
319
320 seq = read_seqbegin(&hh->hh_lock);
321 hh_len = hh->hh_len;
322 hh_alen = HH_DATA_ALIGN(hh_len);
323 memcpy(skb->data - hh_alen, hh->hh_data, hh_alen);
324 } while (read_seqretry(&hh->hh_lock, seq));
325
326 skb_push(skb, hh_len);
327 return hh->hh_output(skb);
328}
329
312static inline struct neighbour * 330static inline struct neighbour *
313__neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat) 331__neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat)
314{ 332{
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index bd01b4633ee2..68ec27490c20 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>
diff --git a/include/net/netfilter/nf_conntrack_compat.h b/include/net/netfilter/nf_conntrack_compat.h
index f1b1482d7200..6f84c1f7fcd4 100644
--- a/include/net/netfilter/nf_conntrack_compat.h
+++ b/include/net/netfilter/nf_conntrack_compat.h
@@ -6,6 +6,7 @@
6#if defined(CONFIG_IP_NF_CONNTRACK) || defined(CONFIG_IP_NF_CONNTRACK_MODULE) 6#if defined(CONFIG_IP_NF_CONNTRACK) || defined(CONFIG_IP_NF_CONNTRACK_MODULE)
7 7
8#include <linux/netfilter_ipv4/ip_conntrack.h> 8#include <linux/netfilter_ipv4/ip_conntrack.h>
9#include <linux/socket.h>
9 10
10#ifdef CONFIG_IP_NF_CONNTRACK_MARK 11#ifdef CONFIG_IP_NF_CONNTRACK_MARK
11static inline u_int32_t *nf_ct_get_mark(const struct sk_buff *skb, 12static inline u_int32_t *nf_ct_get_mark(const struct sk_buff *skb,
@@ -64,6 +65,16 @@ static inline int nf_ct_get_ctinfo(const struct sk_buff *skb,
64 return (ct != NULL); 65 return (ct != NULL);
65} 66}
66 67
68static inline int nf_ct_l3proto_try_module_get(unsigned short l3proto)
69{
70 need_conntrack();
71 return l3proto == PF_INET ? 0 : -1;
72}
73
74static inline void nf_ct_l3proto_module_put(unsigned short l3proto)
75{
76}
77
67#else /* CONFIG_IP_NF_CONNTRACK */ 78#else /* CONFIG_IP_NF_CONNTRACK */
68 79
69#include <net/netfilter/ipv4/nf_conntrack_ipv4.h> 80#include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
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/rose.h b/include/net/rose.h
index 012b09ed2401..4c05a88b921b 100644
--- a/include/net/rose.h
+++ b/include/net/rose.h
@@ -188,13 +188,13 @@ extern void rose_kick(struct sock *);
188extern void rose_enquiry_response(struct sock *); 188extern 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 struct file_operations rose_neigh_fops;
193extern struct file_operations rose_nodes_fops; 193extern struct file_operations rose_nodes_fops;
194extern struct file_operations rose_routes_fops; 194extern struct file_operations rose_routes_fops;
195 195
196extern int rose_add_loopback_neigh(void); 196extern void rose_add_loopback_neigh(void);
197extern int rose_add_loopback_node(rose_address *); 197extern int __must_check rose_add_loopback_node(rose_address *);
198extern void rose_del_loopback_node(rose_address *); 198extern void rose_del_loopback_node(rose_address *);
199extern void rose_rt_device_down(struct net_device *); 199extern void rose_rt_device_down(struct net_device *);
200extern void rose_link_device_down(struct net_device *); 200extern void rose_link_device_down(struct net_device *);
diff --git a/include/net/route.h b/include/net/route.h
index 486e37aff06c..1440bdb5a27d 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -146,7 +146,8 @@ static inline char rt_tos2priority(u8 tos)
146 146
147static inline int ip_route_connect(struct rtable **rp, __be32 dst, 147static inline int ip_route_connect(struct rtable **rp, __be32 dst,
148 __be32 src, u32 tos, int oif, u8 protocol, 148 __be32 src, u32 tos, int oif, u8 protocol,
149 __be16 sport, __be16 dport, struct sock *sk) 149 __be16 sport, __be16 dport, struct sock *sk,
150 int flags)
150{ 151{
151 struct flowi fl = { .oif = oif, 152 struct flowi fl = { .oif = oif,
152 .nl_u = { .ip4_u = { .daddr = dst, 153 .nl_u = { .ip4_u = { .daddr = dst,
@@ -168,7 +169,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
168 *rp = NULL; 169 *rp = NULL;
169 } 170 }
170 security_sk_classify_flow(sk, &fl); 171 security_sk_classify_flow(sk, &fl);
171 return ip_route_output_flow(rp, &fl, sk, 0); 172 return ip_route_output_flow(rp, &fl, sk, flags);
172} 173}
173 174
174static inline int ip_route_newports(struct rtable **rp, u8 protocol, 175static inline int ip_route_newports(struct rtable **rp, u8 protocol,
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 215461f18db1..28af68059521 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -128,8 +128,6 @@ extern int sctp_copy_local_addr_list(struct sctp_bind_addr *,
128 int flags); 128 int flags);
129extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); 129extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family);
130extern int sctp_register_pf(struct sctp_pf *, sa_family_t); 130extern int sctp_register_pf(struct sctp_pf *, sa_family_t);
131int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
132 void *ptr);
133 131
134/* 132/*
135 * sctp/socket.c 133 * sctp/socket.c
@@ -368,7 +366,7 @@ static inline void sctp_sysctl_register(void) { return; }
368static inline void sctp_sysctl_unregister(void) { return; } 366static inline void sctp_sysctl_unregister(void) { return; }
369static inline int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int nlen, 367static inline int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int nlen,
370 void __user *oldval, size_t __user *oldlenp, 368 void __user *oldval, size_t __user *oldlenp,
371 void __user *newval, size_t newlen, void **context) { 369 void __user *newval, size_t newlen) {
372 return -ENOSYS; 370 return -ENOSYS;
373} 371}
374#endif 372#endif
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 3269ed1cc222..73cb9943c8a8 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -134,6 +134,7 @@ sctp_state_fn_t sctp_sf_violation;
134sctp_state_fn_t sctp_sf_discard_chunk; 134sctp_state_fn_t sctp_sf_discard_chunk;
135sctp_state_fn_t sctp_sf_do_5_2_1_siminit; 135sctp_state_fn_t sctp_sf_do_5_2_1_siminit;
136sctp_state_fn_t sctp_sf_do_5_2_2_dupinit; 136sctp_state_fn_t sctp_sf_do_5_2_2_dupinit;
137sctp_state_fn_t sctp_sf_do_5_2_3_initack;
137sctp_state_fn_t sctp_sf_do_5_2_4_dupcook; 138sctp_state_fn_t sctp_sf_do_5_2_4_dupcook;
138sctp_state_fn_t sctp_sf_unk_chunk; 139sctp_state_fn_t sctp_sf_unk_chunk;
139sctp_state_fn_t sctp_sf_do_8_5_1_E_sa; 140sctp_state_fn_t sctp_sf_do_8_5_1_E_sa;
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index c089f93ba591..31a8e88f1a74 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -201,13 +201,12 @@ extern struct sctp_globals {
201 struct sctp_bind_hashbucket *port_hashtable; 201 struct sctp_bind_hashbucket *port_hashtable;
202 202
203 /* This is the global local address list. 203 /* This is the global local address list.
204 * We actively maintain this complete list of interfaces on 204 * We actively maintain this complete list of addresses on
205 * the system by catching routing events. 205 * the system by catching address add/delete events.
206 * 206 *
207 * It is a list of sctp_sockaddr_entry. 207 * It is a list of sctp_sockaddr_entry.
208 */ 208 */
209 struct list_head local_addr_list; 209 struct list_head local_addr_list;
210 spinlock_t local_addr_lock;
211 210
212 /* Flag to indicate if addip is enabled. */ 211 /* Flag to indicate if addip is enabled. */
213 int addip_enable; 212 int addip_enable;
@@ -243,7 +242,6 @@ extern struct sctp_globals {
243#define sctp_port_alloc_lock (sctp_globals.port_alloc_lock) 242#define sctp_port_alloc_lock (sctp_globals.port_alloc_lock)
244#define sctp_port_hashtable (sctp_globals.port_hashtable) 243#define sctp_port_hashtable (sctp_globals.port_hashtable)
245#define sctp_local_addr_list (sctp_globals.local_addr_list) 244#define sctp_local_addr_list (sctp_globals.local_addr_list)
246#define sctp_local_addr_lock (sctp_globals.local_addr_lock)
247#define sctp_addip_enable (sctp_globals.addip_enable) 245#define sctp_addip_enable (sctp_globals.addip_enable)
248#define sctp_prsctp_enable (sctp_globals.prsctp_enable) 246#define sctp_prsctp_enable (sctp_globals.prsctp_enable)
249 247
@@ -277,6 +275,7 @@ struct sctp_sock {
277 __u16 default_flags; 275 __u16 default_flags;
278 __u32 default_context; 276 __u32 default_context;
279 __u32 default_timetolive; 277 __u32 default_timetolive;
278 __u32 default_rcv_context;
280 279
281 /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to 280 /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to
282 * the destination address every heartbeat interval. This value 281 * the destination address every heartbeat interval. This value
@@ -307,7 +306,7 @@ struct sctp_sock {
307 __u8 disable_fragments; 306 __u8 disable_fragments;
308 __u8 pd_mode; 307 __u8 pd_mode;
309 __u8 v4mapped; 308 __u8 v4mapped;
310 __u32 adaption_ind; 309 __u32 adaptation_ind;
311 310
312 /* Receive to here while partial delivery is in effect. */ 311 /* Receive to here while partial delivery is in effect. */
313 struct sk_buff_head pd_lobby; 312 struct sk_buff_head pd_lobby;
@@ -389,7 +388,7 @@ struct sctp_cookie {
389 /* Padding for future use */ 388 /* Padding for future use */
390 __u8 padding; 389 __u8 padding;
391 390
392 __u32 adaption_ind; 391 __u32 adaptation_ind;
393 392
394 393
395 /* This is a shim for my peer's INIT packet, followed by 394 /* This is a shim for my peer's INIT packet, followed by
@@ -432,7 +431,7 @@ union sctp_params {
432 struct sctp_ipv4addr_param *v4; 431 struct sctp_ipv4addr_param *v4;
433 struct sctp_ipv6addr_param *v6; 432 struct sctp_ipv6addr_param *v6;
434 union sctp_addr_param *addr; 433 union sctp_addr_param *addr;
435 struct sctp_adaption_ind_param *aind; 434 struct sctp_adaptation_ind_param *aind;
436}; 435};
437 436
438/* RFC 2960. Section 3.3.5 Heartbeat. 437/* RFC 2960. Section 3.3.5 Heartbeat.
@@ -1484,7 +1483,7 @@ struct sctp_association {
1484 __u8 asconf_capable; /* Does peer support ADDIP? */ 1483 __u8 asconf_capable; /* Does peer support ADDIP? */
1485 __u8 prsctp_capable; /* Can peer do PR-SCTP? */ 1484 __u8 prsctp_capable; /* Can peer do PR-SCTP? */
1486 1485
1487 __u32 adaption_ind; /* Adaption Code point. */ 1486 __u32 adaptation_ind; /* Adaptation Code point. */
1488 1487
1489 /* This mask is used to disable sending the ASCONF chunk 1488 /* This mask is used to disable sending the ASCONF chunk
1490 * with specified parameter to peer. 1489 * with specified parameter to peer.
@@ -1659,6 +1658,9 @@ struct sctp_association {
1659 __u32 default_context; 1658 __u32 default_context;
1660 __u32 default_timetolive; 1659 __u32 default_timetolive;
1661 1660
1661 /* Default receive parameters */
1662 __u32 default_rcv_context;
1663
1662 /* This tracks outbound ssn for a given stream. */ 1664 /* This tracks outbound ssn for a given stream. */
1663 struct sctp_ssnmap *ssnmap; 1665 struct sctp_ssnmap *ssnmap;
1664 1666
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index 1a4ddc1ec7d2..2923e3d31a08 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -120,7 +120,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_pdapi(
120 const struct sctp_association *asoc, 120 const struct sctp_association *asoc,
121 __u32 indication, gfp_t gfp); 121 __u32 indication, gfp_t gfp);
122 122
123struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication( 123struct sctp_ulpevent *sctp_ulpevent_make_adaptation_indication(
124 const struct sctp_association *asoc, gfp_t gfp); 124 const struct sctp_association *asoc, gfp_t gfp);
125 125
126struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, 126struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 1b7aae6cdd82..67a30eb2b3a4 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -75,8 +75,8 @@ enum sctp_optname {
75#define SCTP_SET_PEER_PRIMARY_ADDR SCTP_SET_PEER_PRIMARY_ADDR 75#define SCTP_SET_PEER_PRIMARY_ADDR SCTP_SET_PEER_PRIMARY_ADDR
76 SCTP_PRIMARY_ADDR, 76 SCTP_PRIMARY_ADDR,
77#define SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR 77#define SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR
78 SCTP_ADAPTION_LAYER, 78 SCTP_ADAPTATION_LAYER,
79#define SCTP_ADAPTION_LAYER SCTP_ADAPTION_LAYER 79#define SCTP_ADAPTATION_LAYER SCTP_ADAPTATION_LAYER
80 SCTP_DISABLE_FRAGMENTS, 80 SCTP_DISABLE_FRAGMENTS,
81#define SCTP_DISABLE_FRAGMENTS SCTP_DISABLE_FRAGMENTS 81#define SCTP_DISABLE_FRAGMENTS SCTP_DISABLE_FRAGMENTS
82 SCTP_PEER_ADDR_PARAMS, 82 SCTP_PEER_ADDR_PARAMS,
@@ -95,6 +95,8 @@ enum sctp_optname {
95#define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO 95#define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO
96 SCTP_DELAYED_ACK_TIME, 96 SCTP_DELAYED_ACK_TIME,
97#define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK_TIME 97#define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK_TIME
98 SCTP_CONTEXT, /* Receive Context */
99#define SCTP_CONTEXT SCTP_CONTEXT
98 100
99 /* Internal Socket Options. Some of the sctp library functions are 101 /* Internal Socket Options. Some of the sctp library functions are
100 * implemented using these socket options. 102 * implemented using these socket options.
@@ -329,17 +331,17 @@ struct sctp_shutdown_event {
329}; 331};
330 332
331/* 333/*
332 * 5.3.1.6 SCTP_ADAPTION_INDICATION 334 * 5.3.1.6 SCTP_ADAPTATION_INDICATION
333 * 335 *
334 * When a peer sends a Adaption Layer Indication parameter , SCTP 336 * When a peer sends a Adaptation Layer Indication parameter , SCTP
335 * delivers this notification to inform the application 337 * delivers this notification to inform the application
336 * that of the peers requested adaption layer. 338 * that of the peers requested adaptation layer.
337 */ 339 */
338struct sctp_adaption_event { 340struct sctp_adaptation_event {
339 __u16 sai_type; 341 __u16 sai_type;
340 __u16 sai_flags; 342 __u16 sai_flags;
341 __u32 sai_length; 343 __u32 sai_length;
342 __u32 sai_adaption_ind; 344 __u32 sai_adaptation_ind;
343 sctp_assoc_t sai_assoc_id; 345 sctp_assoc_t sai_assoc_id;
344}; 346};
345 347
@@ -372,7 +374,7 @@ struct sctp_event_subscribe {
372 __u8 sctp_peer_error_event; 374 __u8 sctp_peer_error_event;
373 __u8 sctp_shutdown_event; 375 __u8 sctp_shutdown_event;
374 __u8 sctp_partial_delivery_event; 376 __u8 sctp_partial_delivery_event;
375 __u8 sctp_adaption_layer_event; 377 __u8 sctp_adaptation_layer_event;
376}; 378};
377 379
378/* 380/*
@@ -393,7 +395,7 @@ union sctp_notification {
393 struct sctp_remote_error sn_remote_error; 395 struct sctp_remote_error sn_remote_error;
394 struct sctp_send_failed sn_send_failed; 396 struct sctp_send_failed sn_send_failed;
395 struct sctp_shutdown_event sn_shutdown_event; 397 struct sctp_shutdown_event sn_shutdown_event;
396 struct sctp_adaption_event sn_adaption_event; 398 struct sctp_adaptation_event sn_adaptation_event;
397 struct sctp_pdapi_event sn_pdapi_event; 399 struct sctp_pdapi_event sn_pdapi_event;
398}; 400};
399 401
@@ -410,7 +412,7 @@ enum sctp_sn_type {
410 SCTP_REMOTE_ERROR, 412 SCTP_REMOTE_ERROR,
411 SCTP_SHUTDOWN_EVENT, 413 SCTP_SHUTDOWN_EVENT,
412 SCTP_PARTIAL_DELIVERY_EVENT, 414 SCTP_PARTIAL_DELIVERY_EVENT,
413 SCTP_ADAPTION_INDICATION, 415 SCTP_ADAPTATION_INDICATION,
414}; 416};
415 417
416/* Notification error codes used to fill up the error fields in some 418/* Notification error codes used to fill up the error fields in some
@@ -486,13 +488,13 @@ struct sctp_prim {
486} __attribute__((packed, aligned(4))); 488} __attribute__((packed, aligned(4)));
487 489
488/* 490/*
489 * 7.1.11 Set Adaption Layer Indicator (SCTP_ADAPTION_LAYER) 491 * 7.1.11 Set Adaptation Layer Indicator (SCTP_ADAPTATION_LAYER)
490 * 492 *
491 * Requests that the local endpoint set the specified Adaption Layer 493 * Requests that the local endpoint set the specified Adaptation Layer
492 * Indication parameter for all future INIT and INIT-ACK exchanges. 494 * Indication parameter for all future INIT and INIT-ACK exchanges.
493 */ 495 */
494struct sctp_setadaption { 496struct sctp_setadaptation {
495 __u32 ssb_adaption_ind; 497 __u32 ssb_adaptation_ind;
496}; 498};
497 499
498/* 500/*
diff --git a/include/net/tcp.h b/include/net/tcp.h
index c99774f15eba..5c472f255b77 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -244,12 +244,7 @@ static inline int before(__u32 seq1, __u32 seq2)
244{ 244{
245 return (__s32)(seq1-seq2) < 0; 245 return (__s32)(seq1-seq2) < 0;
246} 246}
247 247#define after(seq2, seq1) before(seq1, seq2)
248static inline int after(__u32 seq1, __u32 seq2)
249{
250 return (__s32)(seq2-seq1) < 0;
251}
252
253 248
254/* is s2<=s1<=s3 ? */ 249/* is s2<=s1<=s3 ? */
255static inline int between(__u32 seq1, __u32 seq2, __u32 seq3) 250static inline int between(__u32 seq1, __u32 seq2, __u32 seq3)
@@ -807,9 +802,8 @@ static inline void tcp_update_wl(struct tcp_sock *tp, u32 ack, u32 seq)
807/* 802/*
808 * Calculate(/check) TCP checksum 803 * Calculate(/check) TCP checksum
809 */ 804 */
810static inline __sum16 tcp_v4_check(struct tcphdr *th, int len, 805static inline __sum16 tcp_v4_check(int len, __be32 saddr,
811 __be32 saddr, __be32 daddr, 806 __be32 daddr, __wsum base)
812 __wsum base)
813{ 807{
814 return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base); 808 return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base);
815} 809}
diff --git a/include/net/x25.h b/include/net/x25.h
index 0ad90ebcf86e..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 *);
@@ -259,6 +275,7 @@ extern int x25_decode(struct sock *, struct sk_buff *, int *, int *, int *, int
259extern void x25_disconnect(struct sock *, int, unsigned char, unsigned char); 275extern void x25_disconnect(struct sock *, int, unsigned char, unsigned char);
260 276
261/* x25_timer.c */ 277/* x25_timer.c */
278extern void x25_init_timers(struct sock *sk);
262extern void x25_start_heartbeat(struct sock *); 279extern void x25_start_heartbeat(struct sock *);
263extern void x25_start_t2timer(struct sock *); 280extern void x25_start_t2timer(struct sock *);
264extern void x25_start_t21timer(struct sock *); 281extern void x25_start_t21timer(struct sock *);
@@ -281,6 +298,8 @@ extern struct hlist_head x25_list;
281extern rwlock_t x25_list_lock; 298extern rwlock_t x25_list_lock;
282extern struct list_head x25_route_list; 299extern struct list_head x25_route_list;
283extern 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;
284 303
285extern int x25_proc_init(void); 304extern int x25_proc_init(void);
286extern 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_marshall.h b/include/rdma/ib_marshall.h
index 66bf4d7d0dfb..db037205c9e8 100644
--- a/include/rdma/ib_marshall.h
+++ b/include/rdma/ib_marshall.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2005 Intel Corporation. All rights reserved. 2 * Copyright (c) 2005-2006 Intel Corporation. All rights reserved.
3 * 3 *
4 * This software is available to you under a choice of one of two 4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU 5 * licenses. You may choose to be licensed under the terms of the GNU
@@ -41,6 +41,9 @@
41void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst, 41void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst,
42 struct ib_qp_attr *src); 42 struct ib_qp_attr *src);
43 43
44void ib_copy_ah_attr_to_user(struct ib_uverbs_ah_attr *dst,
45 struct ib_ah_attr *src);
46
44void ib_copy_path_rec_to_user(struct ib_user_path_rec *dst, 47void ib_copy_path_rec_to_user(struct ib_user_path_rec *dst,
45 struct ib_sa_path_rec *src); 48 struct ib_sa_path_rec *src);
46 49
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 8eacc3510993..765589f4d166 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -43,6 +43,9 @@
43 43
44#include <linux/types.h> 44#include <linux/types.h>
45#include <linux/device.h> 45#include <linux/device.h>
46#include <linux/mm.h>
47#include <linux/dma-mapping.h>
48#include <linux/kref.h>
46 49
47#include <asm/atomic.h> 50#include <asm/atomic.h>
48#include <asm/scatterlist.h> 51#include <asm/scatterlist.h>
@@ -417,8 +420,8 @@ struct ib_wc {
417 enum ib_wc_opcode opcode; 420 enum ib_wc_opcode opcode;
418 u32 vendor_err; 421 u32 vendor_err;
419 u32 byte_len; 422 u32 byte_len;
423 struct ib_qp *qp;
420 __be32 imm_data; 424 __be32 imm_data;
421 u32 qp_num;
422 u32 src_qp; 425 u32 src_qp;
423 int wc_flags; 426 int wc_flags;
424 u16 pkey_index; 427 u16 pkey_index;
@@ -848,6 +851,49 @@ struct ib_cache {
848 u8 *lmc_cache; 851 u8 *lmc_cache;
849}; 852};
850 853
854struct ib_dma_mapping_ops {
855 int (*mapping_error)(struct ib_device *dev,
856 u64 dma_addr);
857 u64 (*map_single)(struct ib_device *dev,
858 void *ptr, size_t size,
859 enum dma_data_direction direction);
860 void (*unmap_single)(struct ib_device *dev,
861 u64 addr, size_t size,
862 enum dma_data_direction direction);
863 u64 (*map_page)(struct ib_device *dev,
864 struct page *page, unsigned long offset,
865 size_t size,
866 enum dma_data_direction direction);
867 void (*unmap_page)(struct ib_device *dev,
868 u64 addr, size_t size,
869 enum dma_data_direction direction);
870 int (*map_sg)(struct ib_device *dev,
871 struct scatterlist *sg, int nents,
872 enum dma_data_direction direction);
873 void (*unmap_sg)(struct ib_device *dev,
874 struct scatterlist *sg, int nents,
875 enum dma_data_direction direction);
876 u64 (*dma_address)(struct ib_device *dev,
877 struct scatterlist *sg);
878 unsigned int (*dma_len)(struct ib_device *dev,
879 struct scatterlist *sg);
880 void (*sync_single_for_cpu)(struct ib_device *dev,
881 u64 dma_handle,
882 size_t size,
883 enum dma_data_direction dir);
884 void (*sync_single_for_device)(struct ib_device *dev,
885 u64 dma_handle,
886 size_t size,
887 enum dma_data_direction dir);
888 void *(*alloc_coherent)(struct ib_device *dev,
889 size_t size,
890 u64 *dma_handle,
891 gfp_t flag);
892 void (*free_coherent)(struct ib_device *dev,
893 size_t size, void *cpu_addr,
894 u64 dma_handle);
895};
896
851struct iw_cm_verbs; 897struct iw_cm_verbs;
852 898
853struct ib_device { 899struct ib_device {
@@ -992,6 +1038,8 @@ struct ib_device {
992 struct ib_mad *in_mad, 1038 struct ib_mad *in_mad,
993 struct ib_mad *out_mad); 1039 struct ib_mad *out_mad);
994 1040
1041 struct ib_dma_mapping_ops *dma_ops;
1042
995 struct module *owner; 1043 struct module *owner;
996 struct class_device class_dev; 1044 struct class_device class_dev;
997 struct kobject ports_parent; 1045 struct kobject ports_parent;
@@ -1395,10 +1443,231 @@ static inline int ib_req_ncomp_notif(struct ib_cq *cq, int wc_cnt)
1395 * usable for DMA. 1443 * usable for DMA.
1396 * @pd: The protection domain associated with the memory region. 1444 * @pd: The protection domain associated with the memory region.
1397 * @mr_access_flags: Specifies the memory access rights. 1445 * @mr_access_flags: Specifies the memory access rights.
1446 *
1447 * Note that the ib_dma_*() functions defined below must be used
1448 * to create/destroy addresses used with the Lkey or Rkey returned
1449 * by ib_get_dma_mr().
1398 */ 1450 */
1399struct ib_mr *ib_get_dma_mr(struct ib_pd *pd, int mr_access_flags); 1451struct ib_mr *ib_get_dma_mr(struct ib_pd *pd, int mr_access_flags);
1400 1452
1401/** 1453/**
1454 * ib_dma_mapping_error - check a DMA addr for error
1455 * @dev: The device for which the dma_addr was created
1456 * @dma_addr: The DMA address to check
1457 */
1458static inline int ib_dma_mapping_error(struct ib_device *dev, u64 dma_addr)
1459{
1460 if (dev->dma_ops)
1461 return dev->dma_ops->mapping_error(dev, dma_addr);
1462 return dma_mapping_error(dma_addr);
1463}
1464
1465/**
1466 * ib_dma_map_single - Map a kernel virtual address to DMA address
1467 * @dev: The device for which the dma_addr is to be created
1468 * @cpu_addr: The kernel virtual address
1469 * @size: The size of the region in bytes
1470 * @direction: The direction of the DMA
1471 */
1472static inline u64 ib_dma_map_single(struct ib_device *dev,
1473 void *cpu_addr, size_t size,
1474 enum dma_data_direction direction)
1475{
1476 if (dev->dma_ops)
1477 return dev->dma_ops->map_single(dev, cpu_addr, size, direction);
1478 return dma_map_single(dev->dma_device, cpu_addr, size, direction);
1479}
1480
1481/**
1482 * ib_dma_unmap_single - Destroy a mapping created by ib_dma_map_single()
1483 * @dev: The device for which the DMA address was created
1484 * @addr: The DMA address
1485 * @size: The size of the region in bytes
1486 * @direction: The direction of the DMA
1487 */
1488static inline void ib_dma_unmap_single(struct ib_device *dev,
1489 u64 addr, size_t size,
1490 enum dma_data_direction direction)
1491{
1492 if (dev->dma_ops)
1493 dev->dma_ops->unmap_single(dev, addr, size, direction);
1494 else
1495 dma_unmap_single(dev->dma_device, addr, size, direction);
1496}
1497
1498/**
1499 * ib_dma_map_page - Map a physical page to DMA address
1500 * @dev: The device for which the dma_addr is to be created
1501 * @page: The page to be mapped
1502 * @offset: The offset within the page
1503 * @size: The size of the region in bytes
1504 * @direction: The direction of the DMA
1505 */
1506static inline u64 ib_dma_map_page(struct ib_device *dev,
1507 struct page *page,
1508 unsigned long offset,
1509 size_t size,
1510 enum dma_data_direction direction)
1511{
1512 if (dev->dma_ops)
1513 return dev->dma_ops->map_page(dev, page, offset, size, direction);
1514 return dma_map_page(dev->dma_device, page, offset, size, direction);
1515}
1516
1517/**
1518 * ib_dma_unmap_page - Destroy a mapping created by ib_dma_map_page()
1519 * @dev: The device for which the DMA address was created
1520 * @addr: The DMA address
1521 * @size: The size of the region in bytes
1522 * @direction: The direction of the DMA
1523 */
1524static inline void ib_dma_unmap_page(struct ib_device *dev,
1525 u64 addr, size_t size,
1526 enum dma_data_direction direction)
1527{
1528 if (dev->dma_ops)
1529 dev->dma_ops->unmap_page(dev, addr, size, direction);
1530 else
1531 dma_unmap_page(dev->dma_device, addr, size, direction);
1532}
1533
1534/**
1535 * ib_dma_map_sg - Map a scatter/gather list to DMA addresses
1536 * @dev: The device for which the DMA addresses are to be created
1537 * @sg: The array of scatter/gather entries
1538 * @nents: The number of scatter/gather entries
1539 * @direction: The direction of the DMA
1540 */
1541static inline int ib_dma_map_sg(struct ib_device *dev,
1542 struct scatterlist *sg, int nents,
1543 enum dma_data_direction direction)
1544{
1545 if (dev->dma_ops)
1546 return dev->dma_ops->map_sg(dev, sg, nents, direction);
1547 return dma_map_sg(dev->dma_device, sg, nents, direction);
1548}
1549
1550/**
1551 * ib_dma_unmap_sg - Unmap a scatter/gather list of DMA addresses
1552 * @dev: The device for which the DMA addresses were created
1553 * @sg: The array of scatter/gather entries
1554 * @nents: The number of scatter/gather entries
1555 * @direction: The direction of the DMA
1556 */
1557static inline void ib_dma_unmap_sg(struct ib_device *dev,
1558 struct scatterlist *sg, int nents,
1559 enum dma_data_direction direction)
1560{
1561 if (dev->dma_ops)
1562 dev->dma_ops->unmap_sg(dev, sg, nents, direction);
1563 else
1564 dma_unmap_sg(dev->dma_device, sg, nents, direction);
1565}
1566
1567/**
1568 * ib_sg_dma_address - Return the DMA address from a scatter/gather entry
1569 * @dev: The device for which the DMA addresses were created
1570 * @sg: The scatter/gather entry
1571 */
1572static inline u64 ib_sg_dma_address(struct ib_device *dev,
1573 struct scatterlist *sg)
1574{
1575 if (dev->dma_ops)
1576 return dev->dma_ops->dma_address(dev, sg);
1577 return sg_dma_address(sg);
1578}
1579
1580/**
1581 * ib_sg_dma_len - Return the DMA length from a scatter/gather entry
1582 * @dev: The device for which the DMA addresses were created
1583 * @sg: The scatter/gather entry
1584 */
1585static inline unsigned int ib_sg_dma_len(struct ib_device *dev,
1586 struct scatterlist *sg)
1587{
1588 if (dev->dma_ops)
1589 return dev->dma_ops->dma_len(dev, sg);
1590 return sg_dma_len(sg);
1591}
1592
1593/**
1594 * ib_dma_sync_single_for_cpu - Prepare DMA region to be accessed by CPU
1595 * @dev: The device for which the DMA address was created
1596 * @addr: The DMA address
1597 * @size: The size of the region in bytes
1598 * @dir: The direction of the DMA
1599 */
1600static inline void ib_dma_sync_single_for_cpu(struct ib_device *dev,
1601 u64 addr,
1602 size_t size,
1603 enum dma_data_direction dir)
1604{
1605 if (dev->dma_ops)
1606 dev->dma_ops->sync_single_for_cpu(dev, addr, size, dir);
1607 else
1608 dma_sync_single_for_cpu(dev->dma_device, addr, size, dir);
1609}
1610
1611/**
1612 * ib_dma_sync_single_for_device - Prepare DMA region to be accessed by device
1613 * @dev: The device for which the DMA address was created
1614 * @addr: The DMA address
1615 * @size: The size of the region in bytes
1616 * @dir: The direction of the DMA
1617 */
1618static inline void ib_dma_sync_single_for_device(struct ib_device *dev,
1619 u64 addr,
1620 size_t size,
1621 enum dma_data_direction dir)
1622{
1623 if (dev->dma_ops)
1624 dev->dma_ops->sync_single_for_device(dev, addr, size, dir);
1625 else
1626 dma_sync_single_for_device(dev->dma_device, addr, size, dir);
1627}
1628
1629/**
1630 * ib_dma_alloc_coherent - Allocate memory and map it for DMA
1631 * @dev: The device for which the DMA address is requested
1632 * @size: The size of the region to allocate in bytes
1633 * @dma_handle: A pointer for returning the DMA address of the region
1634 * @flag: memory allocator flags
1635 */
1636static inline void *ib_dma_alloc_coherent(struct ib_device *dev,
1637 size_t size,
1638 u64 *dma_handle,
1639 gfp_t flag)
1640{
1641 if (dev->dma_ops)
1642 return dev->dma_ops->alloc_coherent(dev, size, dma_handle, flag);
1643 else {
1644 dma_addr_t handle;
1645 void *ret;
1646
1647 ret = dma_alloc_coherent(dev->dma_device, size, &handle, flag);
1648 *dma_handle = handle;
1649 return ret;
1650 }
1651}
1652
1653/**
1654 * ib_dma_free_coherent - Free memory allocated by ib_dma_alloc_coherent()
1655 * @dev: The device for which the DMA addresses were allocated
1656 * @size: The size of the region
1657 * @cpu_addr: the address returned by ib_dma_alloc_coherent()
1658 * @dma_handle: the DMA address returned by ib_dma_alloc_coherent()
1659 */
1660static inline void ib_dma_free_coherent(struct ib_device *dev,
1661 size_t size, void *cpu_addr,
1662 u64 dma_handle)
1663{
1664 if (dev->dma_ops)
1665 dev->dma_ops->free_coherent(dev, size, cpu_addr, dma_handle);
1666 else
1667 dma_free_coherent(dev->dma_device, size, cpu_addr, dma_handle);
1668}
1669
1670/**
1402 * ib_reg_phys_mr - Prepares a virtually addressed memory region for use 1671 * ib_reg_phys_mr - Prepares a virtually addressed memory region for use
1403 * by an HCA. 1672 * by an HCA.
1404 * @pd: The protection domain associated assigned to the registered region. 1673 * @pd: The protection domain associated assigned to the registered region.
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h
index deb5a0a4cee5..36cd8a8526a0 100644
--- a/include/rdma/rdma_cm.h
+++ b/include/rdma/rdma_cm.h
@@ -77,11 +77,34 @@ struct rdma_route {
77 int num_paths; 77 int num_paths;
78}; 78};
79 79
80struct rdma_conn_param {
81 const void *private_data;
82 u8 private_data_len;
83 u8 responder_resources;
84 u8 initiator_depth;
85 u8 flow_control;
86 u8 retry_count; /* ignored when accepting */
87 u8 rnr_retry_count;
88 /* Fields below ignored if a QP is created on the rdma_cm_id. */
89 u8 srq;
90 u32 qp_num;
91};
92
93struct rdma_ud_param {
94 const void *private_data;
95 u8 private_data_len;
96 struct ib_ah_attr ah_attr;
97 u32 qp_num;
98 u32 qkey;
99};
100
80struct rdma_cm_event { 101struct rdma_cm_event {
81 enum rdma_cm_event_type event; 102 enum rdma_cm_event_type event;
82 int status; 103 int status;
83 void *private_data; 104 union {
84 u8 private_data_len; 105 struct rdma_conn_param conn;
106 struct rdma_ud_param ud;
107 } param;
85}; 108};
86 109
87struct rdma_cm_id; 110struct rdma_cm_id;
@@ -204,25 +227,17 @@ void rdma_destroy_qp(struct rdma_cm_id *id);
204int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr, 227int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
205 int *qp_attr_mask); 228 int *qp_attr_mask);
206 229
207struct rdma_conn_param {
208 const void *private_data;
209 u8 private_data_len;
210 u8 responder_resources;
211 u8 initiator_depth;
212 u8 flow_control;
213 u8 retry_count; /* ignored when accepting */
214 u8 rnr_retry_count;
215 /* Fields below ignored if a QP is created on the rdma_cm_id. */
216 u8 srq;
217 u32 qp_num;
218 enum ib_qp_type qp_type;
219};
220
221/** 230/**
222 * rdma_connect - Initiate an active connection request. 231 * rdma_connect - Initiate an active connection request.
232 * @id: Connection identifier to connect.
233 * @conn_param: Connection information used for connected QPs.
223 * 234 *
224 * Users must have resolved a route for the rdma_cm_id to connect with 235 * Users must have resolved a route for the rdma_cm_id to connect with
225 * by having called rdma_resolve_route before calling this routine. 236 * by having called rdma_resolve_route before calling this routine.
237 *
238 * This call will either connect to a remote QP or obtain remote QP
239 * information for unconnected rdma_cm_id's. The actual operation is
240 * based on the rdma_cm_id's port space.
226 */ 241 */
227int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param); 242int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param);
228 243
@@ -253,6 +268,21 @@ int rdma_listen(struct rdma_cm_id *id, int backlog);
253int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param); 268int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param);
254 269
255/** 270/**
271 * rdma_notify - Notifies the RDMA CM of an asynchronous event that has
272 * occurred on the connection.
273 * @id: Connection identifier to transition to established.
274 * @event: Asynchronous event.
275 *
276 * This routine should be invoked by users to notify the CM of relevant
277 * communication events. Events that should be reported to the CM and
278 * when to report them are:
279 *
280 * IB_EVENT_COMM_EST - Used when a message is received on a connected
281 * QP before an RTU has been received.
282 */
283int rdma_notify(struct rdma_cm_id *id, enum ib_event_type event);
284
285/**
256 * rdma_reject - Called to reject a connection request or response. 286 * rdma_reject - Called to reject a connection request or response.
257 */ 287 */
258int rdma_reject(struct rdma_cm_id *id, const void *private_data, 288int rdma_reject(struct rdma_cm_id *id, const void *private_data,
diff --git a/include/rdma/rdma_cm_ib.h b/include/rdma/rdma_cm_ib.h
index e8c3af1804d4..9b176df1d667 100644
--- a/include/rdma/rdma_cm_ib.h
+++ b/include/rdma/rdma_cm_ib.h
@@ -44,4 +44,7 @@
44int rdma_set_ib_paths(struct rdma_cm_id *id, 44int rdma_set_ib_paths(struct rdma_cm_id *id,
45 struct ib_sa_path_rec *path_rec, int num_paths); 45 struct ib_sa_path_rec *path_rec, int num_paths);
46 46
47/* Global qkey for UD QPs and multicast groups. */
48#define RDMA_UD_QKEY 0x01234567
49
47#endif /* RDMA_CM_IB_H */ 50#endif /* RDMA_CM_IB_H */
diff --git a/include/rdma/rdma_user_cm.h b/include/rdma/rdma_user_cm.h
new file mode 100644
index 000000000000..9572ab8eeac1
--- /dev/null
+++ b/include/rdma/rdma_user_cm.h
@@ -0,0 +1,206 @@
1/*
2 * Copyright (c) 2005-2006 Intel Corporation. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#ifndef RDMA_USER_CM_H
34#define RDMA_USER_CM_H
35
36#include <linux/types.h>
37#include <linux/in6.h>
38#include <rdma/ib_user_verbs.h>
39#include <rdma/ib_user_sa.h>
40
41#define RDMA_USER_CM_ABI_VERSION 3
42
43#define RDMA_MAX_PRIVATE_DATA 256
44
45enum {
46 RDMA_USER_CM_CMD_CREATE_ID,
47 RDMA_USER_CM_CMD_DESTROY_ID,
48 RDMA_USER_CM_CMD_BIND_ADDR,
49 RDMA_USER_CM_CMD_RESOLVE_ADDR,
50 RDMA_USER_CM_CMD_RESOLVE_ROUTE,
51 RDMA_USER_CM_CMD_QUERY_ROUTE,
52 RDMA_USER_CM_CMD_CONNECT,
53 RDMA_USER_CM_CMD_LISTEN,
54 RDMA_USER_CM_CMD_ACCEPT,
55 RDMA_USER_CM_CMD_REJECT,
56 RDMA_USER_CM_CMD_DISCONNECT,
57 RDMA_USER_CM_CMD_INIT_QP_ATTR,
58 RDMA_USER_CM_CMD_GET_EVENT,
59 RDMA_USER_CM_CMD_GET_OPTION,
60 RDMA_USER_CM_CMD_SET_OPTION,
61 RDMA_USER_CM_CMD_NOTIFY
62};
63
64/*
65 * command ABI structures.
66 */
67struct rdma_ucm_cmd_hdr {
68 __u32 cmd;
69 __u16 in;
70 __u16 out;
71};
72
73struct rdma_ucm_create_id {
74 __u64 uid;
75 __u64 response;
76 __u16 ps;
77 __u8 reserved[6];
78};
79
80struct rdma_ucm_create_id_resp {
81 __u32 id;
82};
83
84struct rdma_ucm_destroy_id {
85 __u64 response;
86 __u32 id;
87 __u32 reserved;
88};
89
90struct rdma_ucm_destroy_id_resp {
91 __u32 events_reported;
92};
93
94struct rdma_ucm_bind_addr {
95 __u64 response;
96 struct sockaddr_in6 addr;
97 __u32 id;
98};
99
100struct rdma_ucm_resolve_addr {
101 struct sockaddr_in6 src_addr;
102 struct sockaddr_in6 dst_addr;
103 __u32 id;
104 __u32 timeout_ms;
105};
106
107struct rdma_ucm_resolve_route {
108 __u32 id;
109 __u32 timeout_ms;
110};
111
112struct rdma_ucm_query_route {
113 __u64 response;
114 __u32 id;
115 __u32 reserved;
116};
117
118struct rdma_ucm_query_route_resp {
119 __u64 node_guid;
120 struct ib_user_path_rec ib_route[2];
121 struct sockaddr_in6 src_addr;
122 struct sockaddr_in6 dst_addr;
123 __u32 num_paths;
124 __u8 port_num;
125 __u8 reserved[3];
126};
127
128struct rdma_ucm_conn_param {
129 __u32 qp_num;
130 __u32 reserved;
131 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
132 __u8 private_data_len;
133 __u8 srq;
134 __u8 responder_resources;
135 __u8 initiator_depth;
136 __u8 flow_control;
137 __u8 retry_count;
138 __u8 rnr_retry_count;
139 __u8 valid;
140};
141
142struct rdma_ucm_ud_param {
143 __u32 qp_num;
144 __u32 qkey;
145 struct ib_uverbs_ah_attr ah_attr;
146 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
147 __u8 private_data_len;
148 __u8 reserved[7];
149};
150
151struct rdma_ucm_connect {
152 struct rdma_ucm_conn_param conn_param;
153 __u32 id;
154 __u32 reserved;
155};
156
157struct rdma_ucm_listen {
158 __u32 id;
159 __u32 backlog;
160};
161
162struct rdma_ucm_accept {
163 __u64 uid;
164 struct rdma_ucm_conn_param conn_param;
165 __u32 id;
166 __u32 reserved;
167};
168
169struct rdma_ucm_reject {
170 __u32 id;
171 __u8 private_data_len;
172 __u8 reserved[3];
173 __u8 private_data[RDMA_MAX_PRIVATE_DATA];
174};
175
176struct rdma_ucm_disconnect {
177 __u32 id;
178};
179
180struct rdma_ucm_init_qp_attr {
181 __u64 response;
182 __u32 id;
183 __u32 qp_state;
184};
185
186struct rdma_ucm_notify {
187 __u32 id;
188 __u32 event;
189};
190
191struct rdma_ucm_get_event {
192 __u64 response;
193};
194
195struct rdma_ucm_event_resp {
196 __u64 uid;
197 __u32 id;
198 __u32 event;
199 __u32 status;
200 union {
201 struct rdma_ucm_conn_param conn;
202 struct rdma_ucm_ud_param ud;
203 } param;
204};
205
206#endif /* RDMA_USER_CM_H */
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/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 a994bea09cd6..4b9e609975ab 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -132,8 +132,10 @@ struct snd_card {
132 int shutdown; /* this card is going down */ 132 int shutdown; /* this card is going down */
133 int free_on_last_close; /* free in context of file_release */ 133 int free_on_last_close; /* free in context of file_release */
134 wait_queue_head_t shutdown_sleep; 134 wait_queue_head_t shutdown_sleep;
135 struct device *parent; 135 struct device *dev; /* device assigned to this card */
136 struct device *dev; 136#ifndef CONFIG_SYSFS_DEPRECATED
137 struct device *card_dev; /* cardX object for sysfs */
138#endif
137 139
138#ifdef CONFIG_PM 140#ifdef CONFIG_PM
139 unsigned int power_state; /* power state */ 141 unsigned int power_state; /* power state */
@@ -191,6 +193,16 @@ struct snd_minor {
191 struct device *dev; /* device for sysfs */ 193 struct device *dev; /* device for sysfs */
192}; 194};
193 195
196/* return a device pointer linked to each sound device as a parent */
197static inline struct device *snd_card_get_device_link(struct snd_card *card)
198{
199#ifdef CONFIG_SYSFS_DEPRECATED
200 return card ? card->dev : NULL;
201#else
202 return card ? card->card_dev : NULL;
203#endif
204}
205
194/* sound.c */ 206/* sound.c */
195 207
196extern int snd_major; 208extern int snd_major;
@@ -199,9 +211,40 @@ extern struct class *sound_class;
199 211
200void snd_request_card(int card); 212void snd_request_card(int card);
201 213
202int snd_register_device(int type, struct snd_card *card, int dev, 214int snd_register_device_for_dev(int type, struct snd_card *card,
203 const struct file_operations *f_ops, void *private_data, 215 int dev,
204 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
205int snd_unregister_device(int type, struct snd_card *card, int dev); 248int snd_unregister_device(int type, struct snd_card *card, int dev);
206void *snd_lookup_minor_data(unsigned int minor, int type); 249void *snd_lookup_minor_data(unsigned int minor, int type);
207int 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,
@@ -257,7 +300,7 @@ int snd_card_file_add(struct snd_card *card, struct file *file);
257int snd_card_file_remove(struct snd_card *card, struct file *file); 300int snd_card_file_remove(struct snd_card *card, struct file *file);
258 301
259#ifndef snd_card_set_dev 302#ifndef snd_card_set_dev
260#define snd_card_set_dev(card,devptr) ((card)->parent = (devptr)) 303#define snd_card_set_dev(card,devptr) ((card)->dev = (devptr))
261#endif 304#endif
262 305
263/* device.c */ 306/* device.c */
@@ -384,6 +427,29 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
384#endif 427#endif
385#endif 428#endif
386 429
387#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
388 454
389#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..ee6bc2d06803 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
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h
index c854647b6f3c..1cd4f64cdf31 100644
--- a/include/sound/pcm_oss.h
+++ b/include/sound/pcm_oss.h
@@ -56,6 +56,7 @@ struct snd_pcm_oss_runtime {
56 size_t mmap_bytes; 56 size_t mmap_bytes;
57 char *buffer; /* vmallocated period */ 57 char *buffer; /* vmallocated period */
58 size_t buffer_used; /* used length from period buffer */ 58 size_t buffer_used; /* used length from period buffer */
59 struct mutex params_lock;
59#ifdef CONFIG_SND_PCM_OSS_PLUGINS 60#ifdef CONFIG_SND_PCM_OSS_PLUGINS
60 struct snd_pcm_plugin *plugin_first; 61 struct snd_pcm_plugin *plugin_first;
61 struct snd_pcm_plugin *plugin_last; 62 struct snd_pcm_plugin *plugin_last;
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 17137f3a3b6f..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.13" 2#define CONFIG_SND_VERSION "1.0.14rc2"
3#define CONFIG_SND_DATE " (Tue Nov 28 14:07:24 2006 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 d41cda97e952..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;
@@ -286,7 +287,7 @@ struct snd_ymfpci {
286 int irq; 287 int irq;
287 288
288 unsigned int device_id; /* PCI device ID */ 289 unsigned int device_id; /* PCI device ID */
289 unsigned int rev; /* PCI revision */ 290 unsigned char rev; /* PCI revision */
290 unsigned long reg_area_phys; 291 unsigned long reg_area_phys;
291 void __iomem *reg_area_virt; 292 void __iomem *reg_area_virt;
292 struct resource *res_reg_area; 293 struct resource *res_reg_area;
@@ -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;
@@ -345,9 +347,8 @@ struct snd_ymfpci {
345 struct snd_kcontrol *spdif_pcm_ctl; 347 struct snd_kcontrol *spdif_pcm_ctl;
346 int mode_dup4ch; 348 int mode_dup4ch;
347 int rear_opened; 349 int rear_opened;
348 int rear_swap;
349 int spdif_opened; 350 int spdif_opened;
350 struct { 351 struct snd_ymfpci_pcm_mixer {
351 u16 left; 352 u16 left;
352 u16 right; 353 u16 right;
353 struct snd_kcontrol *ctl; 354 struct snd_kcontrol *ctl;
@@ -358,6 +359,8 @@ struct snd_ymfpci {
358 wait_queue_head_t interrupt_sleep; 359 wait_queue_head_t interrupt_sleep;
359 atomic_t interrupt_sleep_count; 360 atomic_t interrupt_sleep_count;
360 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;
361 364
362#ifdef CONFIG_PM 365#ifdef CONFIG_PM
363 u32 *saved_regs; 366 u32 *saved_regs;
@@ -378,7 +381,7 @@ int snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
378int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); 381int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
379int snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); 382int snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
380int snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); 383int snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
381int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch, int rear_swap); 384int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch);
382int snd_ymfpci_timer(struct snd_ymfpci *chip, int device); 385int snd_ymfpci_timer(struct snd_ymfpci *chip, int device);
383 386
384#endif /* __SOUND_YMFPCI_H */ 387#endif /* __SOUND_YMFPCI_H */
diff --git a/include/video/mbxfb.h b/include/video/mbxfb.h
index 3bde0f5cd55c..20b9002712ef 100644
--- a/include/video/mbxfb.h
+++ b/include/video/mbxfb.h
@@ -1,6 +1,9 @@
1#ifndef __MBX_FB_H 1#ifndef __MBX_FB_H
2#define __MBX_FB_H 2#define __MBX_FB_H
3 3
4#include <asm/ioctl.h>
5#include <asm/types.h>
6
4struct mbxfb_val { 7struct mbxfb_val {
5 unsigned int defval; 8 unsigned int defval;
6 unsigned int min; 9 unsigned int min;
@@ -25,4 +28,32 @@ struct mbxfb_platform_data {
25 int (*remove)(struct fb_info *fb); 28 int (*remove)(struct fb_info *fb);
26}; 29};
27 30
31/* planar */
32#define MBXFB_FMT_YUV12 0
33
34/* packed */
35#define MBXFB_FMT_UY0VY1 1
36#define MBXFB_FMT_VY0UY1 2
37#define MBXFB_FMT_Y0UY1V 3
38#define MBXFB_FMT_Y0VY1U 4
39struct mbxfb_overlaySetup {
40 __u32 enable;
41 __u32 x, y;
42 __u32 width, height;
43 __u32 alpha;
44 __u32 fmt;
45 __u32 mem_offset;
46 __u32 scaled_width;
47 __u32 scaled_height;
48
49 /* Filled by the driver */
50 __u32 U_offset;
51 __u32 V_offset;
52
53 __u16 Y_stride;
54 __u16 UV_stride;
55};
56
57#define MBXFB_IOCX_OVERLAY _IOWR(0xF4, 0x00,struct mbxfb_overlaySetup)
58
28#endif /* __MBX_FB_H */ 59#endif /* __MBX_FB_H */
diff --git a/include/video/pm3fb.h b/include/video/pm3fb.h
index ac021379ac40..94c7d2da90ea 100644
--- a/include/video/pm3fb.h
+++ b/include/video/pm3fb.h
@@ -607,16 +607,16 @@
607#define PM3FBDestReadModeOr 0xac98 607#define PM3FBDestReadModeOr 0xac98
608 #define PM3FBDestReadMode_ReadDisable 0<<0 608 #define PM3FBDestReadMode_ReadDisable 0<<0
609 #define PM3FBDestReadMode_ReadEnable 1<<0 609 #define PM3FBDestReadMode_ReadEnable 1<<0
610 #define PM3FBDestReadMode_StripePitch(sp) (((sp)&0x7)<<2 610 #define PM3FBDestReadMode_StripePitch(sp) (((sp)&0x7)<<2)
611 #define PM3FBDestReadMode_StripeHeight(sh) (((sh)&0x7)<<7 611 #define PM3FBDestReadMode_StripeHeight(sh) (((sh)&0x7)<<7)
612 #define PM3FBDestReadMode_Enable0 1<<8 612 #define PM3FBDestReadMode_Enable0 1<<8
613 #define PM3FBDestReadMode_Enable1 1<<9 613 #define PM3FBDestReadMode_Enable1 1<<9
614 #define PM3FBDestReadMode_Enable2 1<<10 614 #define PM3FBDestReadMode_Enable2 1<<10
615 #define PM3FBDestReadMode_Enable3 1<<11 615 #define PM3FBDestReadMode_Enable3 1<<11
616 #define PM3FBDestReadMode_Layout0(l) (((l)&0x3)<<12 616 #define PM3FBDestReadMode_Layout0(l) (((l)&0x3)<<12)
617 #define PM3FBDestReadMode_Layout1(l) (((l)&0x3)<<14 617 #define PM3FBDestReadMode_Layout1(l) (((l)&0x3)<<14)
618 #define PM3FBDestReadMode_Layout2(l) (((l)&0x3)<<16 618 #define PM3FBDestReadMode_Layout2(l) (((l)&0x3)<<16)
619 #define PM3FBDestReadMode_Layout3(l) (((l)&0x3)<<18 619 #define PM3FBDestReadMode_Layout3(l) (((l)&0x3)<<18)
620 #define PM3FBDestReadMode_Origin0 1<<20 620 #define PM3FBDestReadMode_Origin0 1<<20
621 #define PM3FBDestReadMode_Origin1 1<<21 621 #define PM3FBDestReadMode_Origin1 1<<21
622 #define PM3FBDestReadMode_Origin2 1<<22 622 #define PM3FBDestReadMode_Origin2 1<<22
@@ -640,16 +640,16 @@
640#define PM3FBSourceReadModeOr 0xaca8 640#define PM3FBSourceReadModeOr 0xaca8
641 #define PM3FBSourceReadMode_ReadDisable (0<<0) 641 #define PM3FBSourceReadMode_ReadDisable (0<<0)
642 #define PM3FBSourceReadMode_ReadEnable (1<<0) 642 #define PM3FBSourceReadMode_ReadEnable (1<<0)
643 #define PM3FBSourceReadMode_StripePitch(sp) (((sp)&0x7)<<2 643 #define PM3FBSourceReadMode_StripePitch(sp) (((sp)&0x7)<<2)
644 #define PM3FBSourceReadMode_StripeHeight(sh) (((sh)&0x7)<<7 644 #define PM3FBSourceReadMode_StripeHeight(sh) (((sh)&0x7)<<7)
645 #define PM3FBSourceReadMode_Layout(l) (((l)&0x3)<<8 645 #define PM3FBSourceReadMode_Layout(l) (((l)&0x3)<<8)
646 #define PM3FBSourceReadMode_Origin 1<<10 646 #define PM3FBSourceReadMode_Origin 1<<10
647 #define PM3FBSourceReadMode_Blocking 1<<11 647 #define PM3FBSourceReadMode_Blocking 1<<11
648 #define PM3FBSourceReadMode_UserTexelCoord 1<<13 648 #define PM3FBSourceReadMode_UserTexelCoord 1<<13
649 #define PM3FBSourceReadMode_WrapXEnable 1<<14 649 #define PM3FBSourceReadMode_WrapXEnable 1<<14
650 #define PM3FBSourceReadMode_WrapYEnable 1<<15 650 #define PM3FBSourceReadMode_WrapYEnable 1<<15
651 #define PM3FBSourceReadMode_WrapX(w) (((w)&0xf)<<16 651 #define PM3FBSourceReadMode_WrapX(w) (((w)&0xf)<<16)
652 #define PM3FBSourceReadMode_WrapY(w) (((w)&0xf)<<20 652 #define PM3FBSourceReadMode_WrapY(w) (((w)&0xf)<<20)
653 #define PM3FBSourceReadMode_ExternalSourceData 1<<24 653 #define PM3FBSourceReadMode_ExternalSourceData 1<<24
654#define PM3FBWriteBufferAddr0 0xb000 654#define PM3FBWriteBufferAddr0 0xb000
655#define PM3FBWriteBufferAddr1 0xb008 655#define PM3FBWriteBufferAddr1 0xb008
@@ -942,7 +942,7 @@
942#define PM3Window 0x8980 942#define PM3Window 0x8980
943 #define PM3Window_ForceLBUpdate 1<<3 943 #define PM3Window_ForceLBUpdate 1<<3
944 #define PM3Window_LBUpdateSource 1<<4 944 #define PM3Window_LBUpdateSource 1<<4
945 #define PM3Window_FrameCount(c) (((c)&0xff)<<9 945 #define PM3Window_FrameCount(c) (((c)&0xff)<<9)
946 #define PM3Window_StencilFCP 1<<17 946 #define PM3Window_StencilFCP 1<<17
947 #define PM3Window_DepthFCP 1<<18 947 #define PM3Window_DepthFCP 1<<18
948 #define PM3Window_OverrideWriteFiltering 1<<19 948 #define PM3Window_OverrideWriteFiltering 1<<19
diff --git a/include/video/sstfb.h b/include/video/sstfb.h
index 5dbf5e7e50a8..baa163f770ab 100644
--- a/include/video/sstfb.h
+++ b/include/video/sstfb.h
@@ -119,7 +119,7 @@
119#define BACKPORCH 0x0208 119#define BACKPORCH 0x0208
120#define VIDEODIMENSIONS 0x020c 120#define VIDEODIMENSIONS 0x020c
121#define FBIINIT0 0x0210 /* misc+fifo controls */ 121#define FBIINIT0 0x0210 /* misc+fifo controls */
122# define EN_VGA_PASSTHROUGH BIT(0) 122# define DIS_VGA_PASSTHROUGH BIT(0)
123# define FBI_RESET BIT(1) 123# define FBI_RESET BIT(1)
124# define FIFO_RESET BIT(2) 124# define FIFO_RESET BIT(2)
125#define FBIINIT1 0x0214 /* PCI + video controls */ 125#define FBIINIT1 0x0214 /* PCI + video controls */
@@ -251,7 +251,7 @@
251# define DACREG_ICS_CLK1_A 0 /* bit4 */ 251# define DACREG_ICS_CLK1_A 0 /* bit4 */
252 252
253/* sst default init registers */ 253/* sst default init registers */
254#define FBIINIT0_DEFAULT EN_VGA_PASSTHROUGH 254#define FBIINIT0_DEFAULT DIS_VGA_PASSTHROUGH
255 255
256#define FBIINIT1_DEFAULT \ 256#define FBIINIT1_DEFAULT \
257 ( \ 257 ( \
@@ -296,6 +296,11 @@
296 * 296 *
297 */ 297 */
298 298
299/* ioctl to enable/disable VGA passthrough */
300#define SSTFB_SET_VGAPASS _IOW('F', 0xdd, __u32)
301#define SSTFB_GET_VGAPASS _IOR('F', 0xdd, __u32)
302
303
299/* used to know witch clock to set */ 304/* used to know witch clock to set */
300enum { 305enum {
301 VID_CLOCK=0, 306 VID_CLOCK=0,
@@ -317,7 +322,7 @@ struct pll_timing {
317}; 322};
318 323
319struct dac_switch { 324struct dac_switch {
320 char * name; 325 const char *name;
321 int (*detect) (struct fb_info *info); 326 int (*detect) (struct fb_info *info);
322 int (*set_pll) (struct fb_info *info, const struct pll_timing *t, const int clock); 327 int (*set_pll) (struct fb_info *info, const struct pll_timing *t, const int clock);
323 void (*set_vidmod) (struct fb_info *info, const int bpp); 328 void (*set_vidmod) (struct fb_info *info, const int bpp);
@@ -345,7 +350,7 @@ struct sstfb_par {
345 struct pci_dev *dev; 350 struct pci_dev *dev;
346 int type; 351 int type;
347 u8 revision; 352 u8 revision;
348 int gfx_clock; /* status */ 353 u8 vgapass; /* VGA pass through: 1=enabled, 0=disabled */
349}; 354};
350 355
351#endif /* _SSTFB_H_ */ 356#endif /* _SSTFB_H_ */