aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h18
-rw-r--r--include/acpi/acdisasm.h173
-rw-r--r--include/acpi/acdispat.h6
-rw-r--r--include/acpi/acevents.h4
-rw-r--r--include/acpi/acexcep.h6
-rw-r--r--include/acpi/acglobal.h29
-rw-r--r--include/acpi/aclocal.h284
-rw-r--r--include/acpi/acmacros.h81
-rw-r--r--include/acpi/acnamesp.h28
-rw-r--r--include/acpi/acobject.h188
-rw-r--r--include/acpi/acopcode.h2
-rw-r--r--include/acpi/acoutput.h10
-rw-r--r--include/acpi/acparser.h4
-rw-r--r--include/acpi/acpi_bus.h10
-rw-r--r--include/acpi/acpi_numa.h23
-rw-r--r--include/acpi/acpiosxf.h35
-rw-r--r--include/acpi/acpixf.h4
-rw-r--r--include/acpi/acresrc.h20
-rw-r--r--include/acpi/acstruct.h121
-rw-r--r--include/acpi/actables.h6
-rw-r--r--include/acpi/actbl.h400
-rw-r--r--include/acpi/actbl1.h639
-rw-r--r--include/acpi/actbl2.h230
-rw-r--r--include/acpi/actypes.h88
-rw-r--r--include/acpi/acutils.h95
-rw-r--r--include/acpi/amlcode.h6
-rw-r--r--include/acpi/amlresrc.h85
-rw-r--r--include/acpi/pdc_intel.h5
-rw-r--r--include/acpi/platform/acenv.h47
-rw-r--r--include/acpi/platform/aclinux.h24
-rw-r--r--include/acpi/processor.h28
-rw-r--r--include/asm-alpha/bitops.h1
-rw-r--r--include/asm-alpha/cache.h1
-rw-r--r--include/asm-alpha/cacheflush.h1
-rw-r--r--include/asm-alpha/core_cia.h1
-rw-r--r--include/asm-alpha/core_t2.h1
-rw-r--r--include/asm-alpha/dma-mapping.h1
-rw-r--r--include/asm-alpha/dma.h1
-rw-r--r--include/asm-alpha/floppy.h1
-rw-r--r--include/asm-alpha/hardirq.h1
-rw-r--r--include/asm-alpha/hw_irq.h1
-rw-r--r--include/asm-alpha/ide.h1
-rw-r--r--include/asm-alpha/io.h1
-rw-r--r--include/asm-alpha/irq.h5
-rw-r--r--include/asm-alpha/kmap_types.h1
-rw-r--r--include/asm-alpha/machvec.h1
-rw-r--r--include/asm-alpha/mmu_context.h1
-rw-r--r--include/asm-alpha/mmzone.h1
-rw-r--r--include/asm-alpha/page.h1
-rw-r--r--include/asm-alpha/param.h1
-rw-r--r--include/asm-alpha/pgalloc.h1
-rw-r--r--include/asm-alpha/pgtable.h1
-rw-r--r--include/asm-alpha/serial.h1
-rw-r--r--include/asm-alpha/smp.h1
-rw-r--r--include/asm-alpha/spinlock.h1
-rw-r--r--include/asm-alpha/system.h1
-rw-r--r--include/asm-alpha/tlbflush.h1
-rw-r--r--include/asm-alpha/unistd.h7
-rw-r--r--include/asm-alpha/vga.h2
-rw-r--r--include/asm-arm/apm.h1
-rw-r--r--include/asm-arm/arch-aaec2000/io.h1
-rw-r--r--include/asm-arm/arch-aaec2000/memory.h1
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_spi.h81
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_ssc.h96
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_sys.h11
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_tc.h146
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_udp.h77
-rw-r--r--include/asm-arm/arch-at91rm9200/board.h30
-rw-r--r--include/asm-arm/arch-at91rm9200/gpio.h5
-rw-r--r--include/asm-arm/arch-at91rm9200/hardware.h9
-rw-r--r--include/asm-arm/arch-at91rm9200/io.h1
-rw-r--r--include/asm-arm/arch-at91rm9200/irqs.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/memory.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/pio.h115
-rw-r--r--include/asm-arm/arch-at91rm9200/system.h10
-rw-r--r--include/asm-arm/arch-at91rm9200/timex.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/uncompress.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/vmalloc.h2
-rw-r--r--include/asm-arm/arch-cl7500/acornfb.h1
-rw-r--r--include/asm-arm/arch-clps711x/hardware.h1
-rw-r--r--include/asm-arm/arch-clps711x/io.h1
-rw-r--r--include/asm-arm/arch-clps711x/memory.h1
-rw-r--r--include/asm-arm/arch-clps711x/uncompress.h1
-rw-r--r--include/asm-arm/arch-ebsa285/hardware.h1
-rw-r--r--include/asm-arm/arch-ebsa285/io.h8
-rw-r--r--include/asm-arm/arch-ebsa285/memory.h1
-rw-r--r--include/asm-arm/arch-ebsa285/vmalloc.h1
-rw-r--r--include/asm-arm/arch-ep93xx/ep93xx-regs.h2
-rw-r--r--include/asm-arm/arch-ep93xx/platform.h1
-rw-r--r--include/asm-arm/arch-imx/imx-dma.h8
-rw-r--r--include/asm-arm/arch-integrator/io.h1
-rw-r--r--include/asm-arm/arch-integrator/smp.h1
-rw-r--r--include/asm-arm/arch-iop3xx/io.h1
-rw-r--r--include/asm-arm/arch-iop3xx/memory.h1
-rw-r--r--include/asm-arm/arch-iop3xx/timex.h1
-rw-r--r--include/asm-arm/arch-iop3xx/uncompress.h1
-rw-r--r--include/asm-arm/arch-ixp23xx/entry-macro.S2
-rw-r--r--include/asm-arm/arch-ixp23xx/ixp23xx.h5
-rw-r--r--include/asm-arm/arch-ixp23xx/platform.h15
-rw-r--r--include/asm-arm/arch-ixp4xx/dma.h1
-rw-r--r--include/asm-arm/arch-l7200/io.h1
-rw-r--r--include/asm-arm/arch-lh7a40x/clocks.h20
-rw-r--r--include/asm-arm/arch-lh7a40x/constants.h9
-rw-r--r--include/asm-arm/arch-lh7a40x/dma.h79
-rw-r--r--include/asm-arm/arch-lh7a40x/entry-macro.S70
-rw-r--r--include/asm-arm/arch-lh7a40x/hardware.h4
-rw-r--r--include/asm-arm/arch-lh7a40x/io.h1
-rw-r--r--include/asm-arm/arch-lh7a40x/irqs.h8
-rw-r--r--include/asm-arm/arch-lh7a40x/registers.h65
-rw-r--r--include/asm-arm/arch-lh7a40x/ssp.h71
-rw-r--r--include/asm-arm/arch-lh7a40x/uncompress.h2
-rw-r--r--include/asm-arm/arch-netx/debug-macro.S38
-rw-r--r--include/asm-arm/arch-netx/dma.h21
-rw-r--r--include/asm-arm/arch-netx/entry-macro.S35
-rw-r--r--include/asm-arm/arch-netx/eth.h27
-rw-r--r--include/asm-arm/arch-netx/hardware.h39
-rw-r--r--include/asm-arm/arch-netx/io.h28
-rw-r--r--include/asm-arm/arch-netx/irqs.h70
-rw-r--r--include/asm-arm/arch-netx/memory.h36
-rw-r--r--include/asm-arm/arch-netx/netx-regs.h410
-rw-r--r--include/asm-arm/arch-netx/param.h18
-rw-r--r--include/asm-arm/arch-netx/pfifo.h54
-rw-r--r--include/asm-arm/arch-netx/system.h38
-rw-r--r--include/asm-arm/arch-netx/timex.h20
-rw-r--r--include/asm-arm/arch-netx/uncompress.h76
-rw-r--r--include/asm-arm/arch-netx/vmalloc.h19
-rw-r--r--include/asm-arm/arch-netx/xc.h42
-rw-r--r--include/asm-arm/arch-omap/board.h1
-rw-r--r--include/asm-arm/arch-omap/hardware.h1
-rw-r--r--include/asm-arm/arch-omap/io.h1
-rw-r--r--include/asm-arm/arch-omap/system.h1
-rw-r--r--include/asm-arm/arch-omap/uncompress.h1
-rw-r--r--include/asm-arm/arch-pnx4008/clock.h61
-rw-r--r--include/asm-arm/arch-pnx4008/debug-macro.S23
-rw-r--r--include/asm-arm/arch-pnx4008/dma.h162
-rw-r--r--include/asm-arm/arch-pnx4008/entry-macro.S121
-rw-r--r--include/asm-arm/arch-pnx4008/gpio.h241
-rw-r--r--include/asm-arm/arch-pnx4008/hardware.h32
-rw-r--r--include/asm-arm/arch-pnx4008/io.h21
-rw-r--r--include/asm-arm/arch-pnx4008/irq.h42
-rw-r--r--include/asm-arm/arch-pnx4008/irqs.h215
-rw-r--r--include/asm-arm/arch-pnx4008/memory.h24
-rw-r--r--include/asm-arm/arch-pnx4008/param.h21
-rw-r--r--include/asm-arm/arch-pnx4008/platform.h69
-rw-r--r--include/asm-arm/arch-pnx4008/pm.h33
-rw-r--r--include/asm-arm/arch-pnx4008/system.h38
-rw-r--r--include/asm-arm/arch-pnx4008/timex.h73
-rw-r--r--include/asm-arm/arch-pnx4008/uncompress.h46
-rw-r--r--include/asm-arm/arch-pnx4008/vmalloc.h20
-rw-r--r--include/asm-arm/arch-pxa/idp.h1
-rw-r--r--include/asm-arm/arch-pxa/io.h1
-rw-r--r--include/asm-arm/arch-pxa/irqs.h1
-rw-r--r--include/asm-arm/arch-pxa/poodle.h4
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h19
-rw-r--r--include/asm-arm/arch-pxa/system.h1
-rw-r--r--include/asm-arm/arch-pxa/timex.h1
-rw-r--r--include/asm-arm/arch-realview/io.h1
-rw-r--r--include/asm-arm/arch-realview/smp.h1
-rw-r--r--include/asm-arm/arch-s3c2410/debug-macro.S10
-rw-r--r--include/asm-arm/arch-s3c2410/dma.h1
-rw-r--r--include/asm-arm/arch-s3c2410/entry-macro.S30
-rw-r--r--include/asm-arm/arch-s3c2410/map.h27
-rw-r--r--include/asm-arm/arch-s3c2410/regs-clock.h71
-rw-r--r--include/asm-arm/arch-s3c2410/regs-dsc.h5
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpio.h68
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpioj.h5
-rw-r--r--include/asm-arm/arch-s3c2410/regs-irq.h6
-rw-r--r--include/asm-arm/arch-s3c2410/regs-serial.h15
-rw-r--r--include/asm-arm/arch-s3c2410/uncompress.h6
-rw-r--r--include/asm-arm/arch-sa1100/assabet.h1
-rw-r--r--include/asm-arm/arch-sa1100/cerf.h1
-rw-r--r--include/asm-arm/arch-sa1100/collie.h1
-rw-r--r--include/asm-arm/arch-sa1100/dma.h1
-rw-r--r--include/asm-arm/arch-sa1100/hardware.h1
-rw-r--r--include/asm-arm/arch-sa1100/ide.h1
-rw-r--r--include/asm-arm/arch-sa1100/io.h1
-rw-r--r--include/asm-arm/arch-sa1100/irqs.h1
-rw-r--r--include/asm-arm/arch-sa1100/memory.h1
-rw-r--r--include/asm-arm/arch-sa1100/system.h1
-rw-r--r--include/asm-arm/arch-versatile/io.h1
-rw-r--r--include/asm-arm/arch-versatile/system.h16
-rw-r--r--include/asm-arm/atomic.h1
-rw-r--r--include/asm-arm/bug.h1
-rw-r--r--include/asm-arm/byteorder.h10
-rw-r--r--include/asm-arm/cacheflush.h1
-rw-r--r--include/asm-arm/cpu.h1
-rw-r--r--include/asm-arm/dma-mapping.h1
-rw-r--r--include/asm-arm/dma.h1
-rw-r--r--include/asm-arm/elf.h1
-rw-r--r--include/asm-arm/fpstate.h1
-rw-r--r--include/asm-arm/glue.h1
-rw-r--r--include/asm-arm/hardirq.h1
-rw-r--r--include/asm-arm/hardware/dec21285.h1
-rw-r--r--include/asm-arm/hardware/iomd.h1
-rw-r--r--include/asm-arm/hardware/sharpsl_pm.h11
-rw-r--r--include/asm-arm/irq.h4
-rw-r--r--include/asm-arm/leds.h1
-rw-r--r--include/asm-arm/mach/serial_at91.h (renamed from include/asm-arm/mach/serial_at91rm9200.h)9
-rw-r--r--include/asm-arm/mach/serial_sa1100.h1
-rw-r--r--include/asm-arm/mach/time.h1
-rw-r--r--include/asm-arm/memory.h1
-rw-r--r--include/asm-arm/page.h1
-rw-r--r--include/asm-arm/pci.h1
-rw-r--r--include/asm-arm/proc-fns.h1
-rw-r--r--include/asm-arm/ptrace.h1
-rw-r--r--include/asm-arm/smp.h1
-rw-r--r--include/asm-arm/system.h4
-rw-r--r--include/asm-arm/thread_notify.h48
-rw-r--r--include/asm-arm/tlbflush.h1
-rw-r--r--include/asm-arm/ucontext.h79
-rw-r--r--include/asm-arm/unistd.h10
-rw-r--r--include/asm-arm/vga.h2
-rw-r--r--include/asm-arm26/atomic.h1
-rw-r--r--include/asm-arm26/bug.h1
-rw-r--r--include/asm-arm26/dma.h1
-rw-r--r--include/asm-arm26/hardirq.h1
-rw-r--r--include/asm-arm26/hardware.h1
-rw-r--r--include/asm-arm26/io.h1
-rw-r--r--include/asm-arm26/irq.h4
-rw-r--r--include/asm-arm26/leds.h1
-rw-r--r--include/asm-arm26/mach-types.h1
-rw-r--r--include/asm-arm26/page.h1
-rw-r--r--include/asm-arm26/pgtable.h1
-rw-r--r--include/asm-arm26/serial.h1
-rw-r--r--include/asm-arm26/smp.h1
-rw-r--r--include/asm-arm26/sysirq.h1
-rw-r--r--include/asm-arm26/system.h1
-rw-r--r--include/asm-arm26/unistd.h10
-rw-r--r--include/asm-cris/arch-v10/io.h1
-rw-r--r--include/asm-cris/arch-v10/page.h1
-rw-r--r--include/asm-cris/arch-v10/system.h1
-rw-r--r--include/asm-cris/arch-v32/io.h1
-rw-r--r--include/asm-cris/arch-v32/irq.h1
-rw-r--r--include/asm-cris/arch-v32/page.h1
-rw-r--r--include/asm-cris/arch-v32/processor.h1
-rw-r--r--include/asm-cris/arch-v32/system.h1
-rw-r--r--include/asm-cris/eshlibld.h1
-rw-r--r--include/asm-cris/etraxgpio.h1
-rw-r--r--include/asm-cris/fasttimer.h1
-rw-r--r--include/asm-cris/page.h1
-rw-r--r--include/asm-cris/pci.h1
-rw-r--r--include/asm-cris/pgtable.h1
-rw-r--r--include/asm-cris/processor.h1
-rw-r--r--include/asm-cris/rtc.h1
-rw-r--r--include/asm-cris/tlbflush.h1
-rw-r--r--include/asm-cris/unistd.h9
-rw-r--r--include/asm-frv/atomic.h5
-rw-r--r--include/asm-frv/bitops.h1
-rw-r--r--include/asm-frv/bug.h1
-rw-r--r--include/asm-frv/cache.h1
-rw-r--r--include/asm-frv/checksum.h2
-rw-r--r--include/asm-frv/dma.h1
-rw-r--r--include/asm-frv/elf.h1
-rw-r--r--include/asm-frv/fpu.h1
-rw-r--r--include/asm-frv/hardirq.h1
-rw-r--r--include/asm-frv/highmem.h3
-rw-r--r--include/asm-frv/ide.h1
-rw-r--r--include/asm-frv/io.h41
-rw-r--r--include/asm-frv/irq.h1
-rw-r--r--include/asm-frv/mb-regs.h27
-rw-r--r--include/asm-frv/mmu_context.h1
-rw-r--r--include/asm-frv/page.h1
-rw-r--r--include/asm-frv/pci.h1
-rw-r--r--include/asm-frv/pgalloc.h1
-rw-r--r--include/asm-frv/pgtable.h1
-rw-r--r--include/asm-frv/processor.h1
-rw-r--r--include/asm-frv/segment.h1
-rw-r--r--include/asm-frv/serial.h1
-rw-r--r--include/asm-frv/signal.h6
-rw-r--r--include/asm-frv/smp.h1
-rw-r--r--include/asm-frv/system.h1
-rw-r--r--include/asm-frv/tlbflush.h1
-rw-r--r--include/asm-frv/types.h1
-rw-r--r--include/asm-frv/uaccess.h64
-rw-r--r--include/asm-frv/unaligned.h1
-rw-r--r--include/asm-frv/unistd.h26
-rw-r--r--include/asm-frv/virtconvert.h1
-rw-r--r--include/asm-generic/bug.h1
-rw-r--r--include/asm-generic/dma-mapping.h1
-rw-r--r--include/asm-generic/fcntl.h1
-rw-r--r--include/asm-generic/local.h1
-rw-r--r--include/asm-generic/memory_model.h27
-rw-r--r--include/asm-generic/rtc.h7
-rw-r--r--include/asm-generic/signal.h7
-rw-r--r--include/asm-generic/tlb.h1
-rw-r--r--include/asm-h8300/bitops.h1
-rw-r--r--include/asm-h8300/dma.h1
-rw-r--r--include/asm-h8300/elf.h1
-rw-r--r--include/asm-h8300/hardirq.h1
-rw-r--r--include/asm-h8300/io.h1
-rw-r--r--include/asm-h8300/irq.h4
-rw-r--r--include/asm-h8300/keyboard.h1
-rw-r--r--include/asm-h8300/mmu_context.h1
-rw-r--r--include/asm-h8300/page.h1
-rw-r--r--include/asm-h8300/page_offset.h1
-rw-r--r--include/asm-h8300/param.h1
-rw-r--r--include/asm-h8300/pgtable.h1
-rw-r--r--include/asm-h8300/processor.h1
-rw-r--r--include/asm-h8300/semaphore-helper.h1
-rw-r--r--include/asm-h8300/shm.h1
-rw-r--r--include/asm-h8300/system.h1
-rw-r--r--include/asm-h8300/unaligned.h1
-rw-r--r--include/asm-h8300/unistd.h7
-rw-r--r--include/asm-h8300/virtconvert.h1
-rw-r--r--include/asm-i386/alternative.h2
-rw-r--r--include/asm-i386/apic.h3
-rw-r--r--include/asm-i386/apicdef.h1
-rw-r--r--include/asm-i386/atomic.h1
-rw-r--r--include/asm-i386/bitops.h1
-rw-r--r--include/asm-i386/bug.h1
-rw-r--r--include/asm-i386/bugs.h1
-rw-r--r--include/asm-i386/byteorder.h1
-rw-r--r--include/asm-i386/cache.h1
-rw-r--r--include/asm-i386/cpufeature.h12
-rw-r--r--include/asm-i386/dma.h1
-rw-r--r--include/asm-i386/fixmap.h1
-rw-r--r--include/asm-i386/hardirq.h1
-rw-r--r--include/asm-i386/highmem.h1
-rw-r--r--include/asm-i386/hpet.h1
-rw-r--r--include/asm-i386/hw_irq.h1
-rw-r--r--include/asm-i386/ide.h1
-rw-r--r--include/asm-i386/io.h1
-rw-r--r--include/asm-i386/io_apic.h1
-rw-r--r--include/asm-i386/irq.h1
-rw-r--r--include/asm-i386/kmap_types.h1
-rw-r--r--include/asm-i386/mach-summit/mach_apic.h1
-rw-r--r--include/asm-i386/mce.h5
-rw-r--r--include/asm-i386/mmu_context.h1
-rw-r--r--include/asm-i386/msi.h10
-rw-r--r--include/asm-i386/mtrr.h5
-rw-r--r--include/asm-i386/page.h5
-rw-r--r--include/asm-i386/param.h1
-rw-r--r--include/asm-i386/pci.h1
-rw-r--r--include/asm-i386/pgalloc.h1
-rw-r--r--include/asm-i386/pgtable.h1
-rw-r--r--include/asm-i386/processor.h15
-rw-r--r--include/asm-i386/serial.h1
-rw-r--r--include/asm-i386/smp.h1
-rw-r--r--include/asm-i386/spinlock.h1
-rw-r--r--include/asm-i386/string.h1
-rw-r--r--include/asm-i386/system.h1
-rw-r--r--include/asm-i386/thread_info.h1
-rw-r--r--include/asm-i386/timex.h1
-rw-r--r--include/asm-i386/tlbflush.h1
-rw-r--r--include/asm-i386/types.h1
-rw-r--r--include/asm-i386/uaccess.h36
-rw-r--r--include/asm-i386/unistd.h10
-rw-r--r--include/asm-i386/vga.h2
-rw-r--r--include/asm-ia64/asmmacro.h1
-rw-r--r--include/asm-ia64/cache.h1
-rw-r--r--include/asm-ia64/delay.h1
-rw-r--r--include/asm-ia64/dma-mapping.h1
-rw-r--r--include/asm-ia64/dma.h1
-rw-r--r--include/asm-ia64/elf.h1
-rw-r--r--include/asm-ia64/hardirq.h1
-rw-r--r--include/asm-ia64/hw_irq.h15
-rw-r--r--include/asm-ia64/ia32.h1
-rw-r--r--include/asm-ia64/ide.h1
-rw-r--r--include/asm-ia64/intrinsics.h1
-rw-r--r--include/asm-ia64/io.h1
-rw-r--r--include/asm-ia64/kmap_types.h1
-rw-r--r--include/asm-ia64/machvec.h8
-rw-r--r--include/asm-ia64/machvec_sn2.h7
-rw-r--r--include/asm-ia64/mca.h9
-rw-r--r--include/asm-ia64/meminit.h1
-rw-r--r--include/asm-ia64/msi.h12
-rw-r--r--include/asm-ia64/nodedata.h1
-rw-r--r--include/asm-ia64/numa.h1
-rw-r--r--include/asm-ia64/page.h1
-rw-r--r--include/asm-ia64/param.h1
-rw-r--r--include/asm-ia64/percpu.h1
-rw-r--r--include/asm-ia64/pgalloc.h1
-rw-r--r--include/asm-ia64/pgtable.h23
-rw-r--r--include/asm-ia64/processor.h1
-rw-r--r--include/asm-ia64/ptrace.h1
-rw-r--r--include/asm-ia64/smp.h1
-rw-r--r--include/asm-ia64/sn/intr.h8
-rw-r--r--include/asm-ia64/sn/pcibr_provider.h5
-rw-r--r--include/asm-ia64/sn/pcibus_provider_defs.h17
-rw-r--r--include/asm-ia64/sn/simulator.h1
-rw-r--r--include/asm-ia64/sn/sn_cpuid.h1
-rw-r--r--include/asm-ia64/sn/sn_sal.h3
-rw-r--r--include/asm-ia64/sn/tiocp.h3
-rw-r--r--include/asm-ia64/sn/xpc.h1
-rw-r--r--include/asm-ia64/string.h1
-rw-r--r--include/asm-ia64/system.h1
-rw-r--r--include/asm-ia64/tlb.h1
-rw-r--r--include/asm-ia64/tlbflush.h1
-rw-r--r--include/asm-ia64/unistd.h3
-rw-r--r--include/asm-ia64/vga.h2
-rw-r--r--include/asm-m32r/assembler.h1
-rw-r--r--include/asm-m32r/atomic.h1
-rw-r--r--include/asm-m32r/bitops.h1
-rw-r--r--include/asm-m32r/cacheflush.h1
-rw-r--r--include/asm-m32r/hardirq.h1
-rw-r--r--include/asm-m32r/ide.h1
-rw-r--r--include/asm-m32r/irq.h1
-rw-r--r--include/asm-m32r/kmap_types.h1
-rw-r--r--include/asm-m32r/m32104ut/m32104ut_pld.h1
-rw-r--r--include/asm-m32r/m32700ut/m32700ut_lan.h1
-rw-r--r--include/asm-m32r/m32700ut/m32700ut_lcd.h1
-rw-r--r--include/asm-m32r/m32700ut/m32700ut_pld.h1
-rw-r--r--include/asm-m32r/m32r.h1
-rw-r--r--include/asm-m32r/mmu.h1
-rw-r--r--include/asm-m32r/mmu_context.h2
-rw-r--r--include/asm-m32r/opsput/opsput_lan.h1
-rw-r--r--include/asm-m32r/opsput/opsput_lcd.h1
-rw-r--r--include/asm-m32r/opsput/opsput_pld.h1
-rw-r--r--include/asm-m32r/page.h1
-rw-r--r--include/asm-m32r/pgalloc.h1
-rw-r--r--include/asm-m32r/pgtable-2level.h1
-rw-r--r--include/asm-m32r/pgtable.h1
-rw-r--r--include/asm-m32r/processor.h1
-rw-r--r--include/asm-m32r/ptrace.h1
-rw-r--r--include/asm-m32r/rtc.h1
-rw-r--r--include/asm-m32r/semaphore.h1
-rw-r--r--include/asm-m32r/serial.h1
-rw-r--r--include/asm-m32r/sigcontext.h1
-rw-r--r--include/asm-m32r/smp.h1
-rw-r--r--include/asm-m32r/spinlock.h1
-rw-r--r--include/asm-m32r/system.h1
-rw-r--r--include/asm-m32r/timex.h1
-rw-r--r--include/asm-m32r/tlbflush.h1
-rw-r--r--include/asm-m32r/uaccess.h1
-rw-r--r--include/asm-m32r/unistd.h5
-rw-r--r--include/asm-m32r/vga.h2
-rw-r--r--include/asm-m68k/atomic.h1
-rw-r--r--include/asm-m68k/bug.h1
-rw-r--r--include/asm-m68k/dma-mapping.h1
-rw-r--r--include/asm-m68k/dma.h1
-rw-r--r--include/asm-m68k/dvma.h1
-rw-r--r--include/asm-m68k/elf.h1
-rw-r--r--include/asm-m68k/entry.h1
-rw-r--r--include/asm-m68k/fpu.h1
-rw-r--r--include/asm-m68k/hardirq.h1
-rw-r--r--include/asm-m68k/ide.h1
-rw-r--r--include/asm-m68k/io.h1
-rw-r--r--include/asm-m68k/irq.h5
-rw-r--r--include/asm-m68k/mc146818rtc.h1
-rw-r--r--include/asm-m68k/mmu_context.h1
-rw-r--r--include/asm-m68k/motorola_pgtable.h1
-rw-r--r--include/asm-m68k/openprom.h1
-rw-r--r--include/asm-m68k/page.h1
-rw-r--r--include/asm-m68k/page_offset.h1
-rw-r--r--include/asm-m68k/pgalloc.h1
-rw-r--r--include/asm-m68k/pgtable.h1
-rw-r--r--include/asm-m68k/processor.h9
-rw-r--r--include/asm-m68k/semaphore-helper.h1
-rw-r--r--include/asm-m68k/serial.h1
-rw-r--r--include/asm-m68k/setup.h1
-rw-r--r--include/asm-m68k/shm.h1
-rw-r--r--include/asm-m68k/system.h1
-rw-r--r--include/asm-m68k/tlbflush.h1
-rw-r--r--include/asm-m68k/uaccess.h1084
-rw-r--r--include/asm-m68k/unistd.h46
-rw-r--r--include/asm-m68k/virtconvert.h1
-rw-r--r--include/asm-m68knommu/bitops.h1
-rw-r--r--include/asm-m68knommu/coldfire.h1
-rw-r--r--include/asm-m68knommu/commproc.h1
-rw-r--r--include/asm-m68knommu/dma-mapping.h1
-rw-r--r--include/asm-m68knommu/dma.h1
-rw-r--r--include/asm-m68knommu/elf.h1
-rw-r--r--include/asm-m68knommu/elia.h1
-rw-r--r--include/asm-m68knommu/entry.h1
-rw-r--r--include/asm-m68knommu/fpu.h1
-rw-r--r--include/asm-m68knommu/hardirq.h1
-rw-r--r--include/asm-m68knommu/io.h1
-rw-r--r--include/asm-m68knommu/irq.h5
-rw-r--r--include/asm-m68knommu/m5206sim.h1
-rw-r--r--include/asm-m68knommu/m520xsim.h1
-rw-r--r--include/asm-m68knommu/m523xsim.h1
-rw-r--r--include/asm-m68knommu/m5272sim.h1
-rw-r--r--include/asm-m68knommu/m527xsim.h1
-rw-r--r--include/asm-m68knommu/m528xsim.h1
-rw-r--r--include/asm-m68knommu/mcfcache.h1
-rw-r--r--include/asm-m68knommu/mcfdma.h1
-rw-r--r--include/asm-m68knommu/mcfmbus.h1
-rw-r--r--include/asm-m68knommu/mcfne.h1
-rw-r--r--include/asm-m68knommu/mcfpci.h1
-rw-r--r--include/asm-m68knommu/mcfpit.h1
-rw-r--r--include/asm-m68knommu/mcfsim.h1
-rw-r--r--include/asm-m68knommu/mcfsmc.h1
-rw-r--r--include/asm-m68knommu/mcftimer.h1
-rw-r--r--include/asm-m68knommu/mcfuart.h1
-rw-r--r--include/asm-m68knommu/mcfwdebug.h1
-rw-r--r--include/asm-m68knommu/mmu_context.h1
-rw-r--r--include/asm-m68knommu/nettel.h1
-rw-r--r--include/asm-m68knommu/page.h1
-rw-r--r--include/asm-m68knommu/page_offset.h1
-rw-r--r--include/asm-m68knommu/param.h1
-rw-r--r--include/asm-m68knommu/pgtable.h1
-rw-r--r--include/asm-m68knommu/processor.h1
-rw-r--r--include/asm-m68knommu/ptrace.h2
-rw-r--r--include/asm-m68knommu/semaphore-helper.h1
-rw-r--r--include/asm-m68knommu/system.h1
-rw-r--r--include/asm-m68knommu/unaligned.h1
-rw-r--r--include/asm-m68knommu/unistd.h7
-rw-r--r--include/asm-mips/a.out.h1
-rw-r--r--include/asm-mips/addrspace.h1
-rw-r--r--include/asm-mips/arc/types.h1
-rw-r--r--include/asm-mips/asm.h1
-rw-r--r--include/asm-mips/asmmacro.h1
-rw-r--r--include/asm-mips/atomic.h1
-rw-r--r--include/asm-mips/bcache.h1
-rw-r--r--include/asm-mips/bitops.h1
-rw-r--r--include/asm-mips/bug.h1
-rw-r--r--include/asm-mips/bugs.h1
-rw-r--r--include/asm-mips/byteorder.h1
-rw-r--r--include/asm-mips/cache.h1
-rw-r--r--include/asm-mips/checksum.h1
-rw-r--r--include/asm-mips/cpu-features.h1
-rw-r--r--include/asm-mips/cpu-info.h1
-rw-r--r--include/asm-mips/ddb5xxx/ddb5477.h1
-rw-r--r--include/asm-mips/ddb5xxx/ddb5xxx.h1
-rw-r--r--include/asm-mips/debug.h1
-rw-r--r--include/asm-mips/dec/prom.h1
-rw-r--r--include/asm-mips/delay.h1
-rw-r--r--include/asm-mips/dma.h1
-rw-r--r--include/asm-mips/elf.h1
-rw-r--r--include/asm-mips/fcntl.h1
-rw-r--r--include/asm-mips/fixmap.h1
-rw-r--r--include/asm-mips/fpu.h1
-rw-r--r--include/asm-mips/futex.h1
-rw-r--r--include/asm-mips/hazards.h1
-rw-r--r--include/asm-mips/highmem.h1
-rw-r--r--include/asm-mips/interrupt.h1
-rw-r--r--include/asm-mips/io.h1
-rw-r--r--include/asm-mips/ip32/machine.h1
-rw-r--r--include/asm-mips/irq.h1
-rw-r--r--include/asm-mips/isadep.h1
-rw-r--r--include/asm-mips/jmr3927/irq.h1
-rw-r--r--include/asm-mips/kmap_types.h1
-rw-r--r--include/asm-mips/local.h1
-rw-r--r--include/asm-mips/mach-au1x00/au1000.h1
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx.h1
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_dbdma.h1
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_ide.h1
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_psc.h10
-rw-r--r--include/asm-mips/mach-au1x00/ioremap.h1
-rw-r--r--include/asm-mips/mach-cobalt/cpu-feature-overrides.h1
-rw-r--r--include/asm-mips/mach-db1x00/db1x00.h13
-rw-r--r--include/asm-mips/mach-generic/ide.h1
-rw-r--r--include/asm-mips/mach-generic/kmalloc.h1
-rw-r--r--include/asm-mips/mach-generic/spaces.h1
-rw-r--r--include/asm-mips/mach-ip22/spaces.h1
-rw-r--r--include/asm-mips/mach-ip32/cpu-feature-overrides.h1
-rw-r--r--include/asm-mips/mach-ip32/kmalloc.h1
-rw-r--r--include/asm-mips/mach-mips/cpu-feature-overrides.h1
-rw-r--r--include/asm-mips/mach-mips/irq.h1
-rw-r--r--include/asm-mips/mach-pb1x00/pb1550.h1
-rw-r--r--include/asm-mips/mach-sim/cpu-feature-overrides.h1
-rw-r--r--include/asm-mips/mips-boards/generic.h1
-rw-r--r--include/asm-mips/mipsregs.h1
-rw-r--r--include/asm-mips/mmu_context.h1
-rw-r--r--include/asm-mips/mmzone.h2
-rw-r--r--include/asm-mips/module.h1
-rw-r--r--include/asm-mips/msgbuf.h1
-rw-r--r--include/asm-mips/paccess.h1
-rw-r--r--include/asm-mips/page.h1
-rw-r--r--include/asm-mips/pci.h1
-rw-r--r--include/asm-mips/pgalloc.h1
-rw-r--r--include/asm-mips/pgtable-32.h1
-rw-r--r--include/asm-mips/pgtable-64.h1
-rw-r--r--include/asm-mips/pgtable-bits.h1
-rw-r--r--include/asm-mips/pgtable.h1
-rw-r--r--include/asm-mips/prefetch.h1
-rw-r--r--include/asm-mips/processor.h1
-rw-r--r--include/asm-mips/ptrace.h1
-rw-r--r--include/asm-mips/reg.h1
-rw-r--r--include/asm-mips/resource.h1
-rw-r--r--include/asm-mips/serial.h1
-rw-r--r--include/asm-mips/sgiarcs.h1
-rw-r--r--include/asm-mips/sibyte/board.h1
-rw-r--r--include/asm-mips/sibyte/carmel.h1
-rw-r--r--include/asm-mips/sibyte/sentosa.h1
-rw-r--r--include/asm-mips/sibyte/swarm.h1
-rw-r--r--include/asm-mips/siginfo.h1
-rw-r--r--include/asm-mips/signal.h1
-rw-r--r--include/asm-mips/sim.h1
-rw-r--r--include/asm-mips/smp.h1
-rw-r--r--include/asm-mips/sn/addrs.h1
-rw-r--r--include/asm-mips/sn/agent.h1
-rw-r--r--include/asm-mips/sn/arch.h1
-rw-r--r--include/asm-mips/sn/io.h1
-rw-r--r--include/asm-mips/sn/klconfig.h1
-rw-r--r--include/asm-mips/sn/kldir.h1
-rw-r--r--include/asm-mips/sn/launch.h1
-rw-r--r--include/asm-mips/sn/mapped_kernel.h1
-rw-r--r--include/asm-mips/sn/sn0/addrs.h1
-rw-r--r--include/asm-mips/sn/sn0/arch.h1
-rw-r--r--include/asm-mips/sn/sn0/hubmd.h1
-rw-r--r--include/asm-mips/stackframe.h1
-rw-r--r--include/asm-mips/string.h1
-rw-r--r--include/asm-mips/system.h1
-rw-r--r--include/asm-mips/thread_info.h1
-rw-r--r--include/asm-mips/tlbflush.h1
-rw-r--r--include/asm-mips/tx4927/toshiba_rbtx4927.h1
-rw-r--r--include/asm-mips/types.h1
-rw-r--r--include/asm-mips/uaccess.h1
-rw-r--r--include/asm-mips/unistd.h7
-rw-r--r--include/asm-mips/vga.h2
-rw-r--r--include/asm-mips/vr41xx/vrc4173.h1
-rw-r--r--include/asm-mips/war.h1
-rw-r--r--include/asm-mips/wbflush.h1
-rw-r--r--include/asm-parisc/atomic.h1
-rw-r--r--include/asm-parisc/cache.h1
-rw-r--r--include/asm-parisc/cacheflush.h1
-rw-r--r--include/asm-parisc/dma-mapping.h1
-rw-r--r--include/asm-parisc/dma.h1
-rw-r--r--include/asm-parisc/io.h1
-rw-r--r--include/asm-parisc/irq.h1
-rw-r--r--include/asm-parisc/kmap_types.h1
-rw-r--r--include/asm-parisc/mmzone.h5
-rw-r--r--include/asm-parisc/page.h1
-rw-r--r--include/asm-parisc/param.h1
-rw-r--r--include/asm-parisc/pci.h1
-rw-r--r--include/asm-parisc/pdc.h1
-rw-r--r--include/asm-parisc/pgtable.h1
-rw-r--r--include/asm-parisc/processor.h1
-rw-r--r--include/asm-parisc/psw.h1
-rw-r--r--include/asm-parisc/smp.h1
-rw-r--r--include/asm-parisc/system.h1
-rw-r--r--include/asm-parisc/tlbflush.h1
-rw-r--r--include/asm-parisc/unistd.h4
-rw-r--r--include/asm-powerpc/abs_addr.h1
-rw-r--r--include/asm-powerpc/bitops.h6
-rw-r--r--include/asm-powerpc/cache.h1
-rw-r--r--include/asm-powerpc/cputable.h82
-rw-r--r--include/asm-powerpc/delay.h13
-rw-r--r--include/asm-powerpc/dma-mapping.h1
-rw-r--r--include/asm-powerpc/dma.h1
-rw-r--r--include/asm-powerpc/eeh.h16
-rw-r--r--include/asm-powerpc/eeh_event.h10
-rw-r--r--include/asm-powerpc/elf.h11
-rw-r--r--include/asm-powerpc/floppy.h1
-rw-r--r--include/asm-powerpc/hvcall.h10
-rw-r--r--include/asm-powerpc/hw_irq.h1
-rw-r--r--include/asm-powerpc/ide.h1
-rw-r--r--include/asm-powerpc/immap_86xx.h199
-rw-r--r--include/asm-powerpc/io.h6
-rw-r--r--include/asm-powerpc/iommu.h7
-rw-r--r--include/asm-powerpc/irq.h87
-rw-r--r--include/asm-powerpc/iseries/iommu.h35
-rw-r--r--include/asm-powerpc/iseries/iseries_io.h1
-rw-r--r--include/asm-powerpc/kdump.h29
-rw-r--r--include/asm-powerpc/kexec.h16
-rw-r--r--include/asm-powerpc/machdep.h6
-rw-r--r--include/asm-powerpc/mmu.h16
-rw-r--r--include/asm-powerpc/mmu_context.h12
-rw-r--r--include/asm-powerpc/mmzone.h1
-rw-r--r--include/asm-powerpc/mpc86xx.h47
-rw-r--r--include/asm-powerpc/mpic.h10
-rw-r--r--include/asm-powerpc/paca.h5
-rw-r--r--include/asm-powerpc/page.h12
-rw-r--r--include/asm-powerpc/pci-bridge.h14
-rw-r--r--include/asm-powerpc/pgtable-4k.h2
-rw-r--r--include/asm-powerpc/pgtable-64k.h2
-rw-r--r--include/asm-powerpc/pgtable.h11
-rw-r--r--include/asm-powerpc/ppc_asm.h1
-rw-r--r--include/asm-powerpc/processor.h16
-rw-r--r--include/asm-powerpc/prom.h10
-rw-r--r--include/asm-powerpc/ptrace.h2
-rw-r--r--include/asm-powerpc/reg.h69
-rw-r--r--include/asm-powerpc/rtas.h9
-rw-r--r--include/asm-powerpc/smp.h1
-rw-r--r--include/asm-powerpc/smu.h1
-rw-r--r--include/asm-powerpc/spu.h30
-rw-r--r--include/asm-powerpc/spu_csa.h13
-rw-r--r--include/asm-powerpc/spu_priv1.h182
-rw-r--r--include/asm-powerpc/systbl.h306
-rw-r--r--include/asm-powerpc/tce.h35
-rw-r--r--include/asm-powerpc/thread_info.h1
-rw-r--r--include/asm-powerpc/time.h1
-rw-r--r--include/asm-powerpc/timex.h1
-rw-r--r--include/asm-powerpc/tlb.h1
-rw-r--r--include/asm-powerpc/tlbflush.h1
-rw-r--r--include/asm-powerpc/topology.h10
-rw-r--r--include/asm-powerpc/types.h1
-rw-r--r--include/asm-powerpc/udbg.h3
-rw-r--r--include/asm-powerpc/unistd.h8
-rw-r--r--include/asm-powerpc/vga.h5
-rw-r--r--include/asm-powerpc/vio.h17
-rw-r--r--include/asm-ppc/amigahw.h1
-rw-r--r--include/asm-ppc/bootinfo.h1
-rw-r--r--include/asm-ppc/commproc.h1
-rw-r--r--include/asm-ppc/ibm403.h1
-rw-r--r--include/asm-ppc/ibm44x.h1
-rw-r--r--include/asm-ppc/ibm4xx.h1
-rw-r--r--include/asm-ppc/io.h1
-rw-r--r--include/asm-ppc/machdep.h1
-rw-r--r--include/asm-ppc/mmu.h24
-rw-r--r--include/asm-ppc/mmu_context.h28
-rw-r--r--include/asm-ppc/mpc8260.h1
-rw-r--r--include/asm-ppc/mpc83xx.h1
-rw-r--r--include/asm-ppc/mpc85xx.h4
-rw-r--r--include/asm-ppc/mpc8xx.h1
-rw-r--r--include/asm-ppc/mv64x60.h1
-rw-r--r--include/asm-ppc/ocp.h1
-rw-r--r--include/asm-ppc/open_pic.h1
-rw-r--r--include/asm-ppc/page.h2
-rw-r--r--include/asm-ppc/pc_serial.h1
-rw-r--r--include/asm-ppc/pgalloc.h1
-rw-r--r--include/asm-ppc/pgtable.h3
-rw-r--r--include/asm-ppc/ppc4xx_dma.h1
-rw-r--r--include/asm-ppc/ppc4xx_pic.h1
-rw-r--r--include/asm-ppc/serial.h1
-rw-r--r--include/asm-ppc/smp.h1
-rw-r--r--include/asm-ppc/time.h1
-rw-r--r--include/asm-s390/bitops.h1
-rw-r--r--include/asm-s390/cmb.h2
-rw-r--r--include/asm-s390/debug.h1
-rw-r--r--include/asm-s390/hardirq.h1
-rw-r--r--include/asm-s390/idals.h1
-rw-r--r--include/asm-s390/io.h5
-rw-r--r--include/asm-s390/irq.h4
-rw-r--r--include/asm-s390/local.h1
-rw-r--r--include/asm-s390/lowcore.h1
-rw-r--r--include/asm-s390/page.h6
-rw-r--r--include/asm-s390/pgalloc.h1
-rw-r--r--include/asm-s390/posix_types.h44
-rw-r--r--include/asm-s390/ptrace.h6
-rw-r--r--include/asm-s390/sfp-machine.h1
-rw-r--r--include/asm-s390/smp.h1
-rw-r--r--include/asm-s390/system.h1
-rw-r--r--include/asm-s390/tlbflush.h1
-rw-r--r--include/asm-s390/types.h1
-rw-r--r--include/asm-s390/unistd.h8
-rw-r--r--include/asm-s390/vtoc.h38
-rw-r--r--include/asm-s390/z90crypt.h212
-rw-r--r--include/asm-sh/bug.h1
-rw-r--r--include/asm-sh/checksum.h1
-rw-r--r--include/asm-sh/dma-mapping.h1
-rw-r--r--include/asm-sh/dma.h1
-rw-r--r--include/asm-sh/fixmap.h1
-rw-r--r--include/asm-sh/hardirq.h1
-rw-r--r--include/asm-sh/hd64461/hd64461.h1
-rw-r--r--include/asm-sh/hd64465/hd64465.h1
-rw-r--r--include/asm-sh/ide.h1
-rw-r--r--include/asm-sh/io.h1
-rw-r--r--include/asm-sh/irq.h1
-rw-r--r--include/asm-sh/keyboard.h1
-rw-r--r--include/asm-sh/kmap_types.h1
-rw-r--r--include/asm-sh/machvec.h1
-rw-r--r--include/asm-sh/machvec_init.h1
-rw-r--r--include/asm-sh/mpc1211/dma.h1
-rw-r--r--include/asm-sh/overdrive/overdrive.h1
-rw-r--r--include/asm-sh/page.h1
-rw-r--r--include/asm-sh/pgtable.h1
-rw-r--r--include/asm-sh/serial.h1
-rw-r--r--include/asm-sh/smp.h1
-rw-r--r--include/asm-sh/system.h1
-rw-r--r--include/asm-sh/types.h1
-rw-r--r--include/asm-sh/unistd.h7
-rw-r--r--include/asm-sh/watchdog.h1
-rw-r--r--include/asm-sh64/bug.h1
-rw-r--r--include/asm-sh64/dma-mapping.h1
-rw-r--r--include/asm-sh64/hardirq.h1
-rw-r--r--include/asm-sh64/ide.h1
-rw-r--r--include/asm-sh64/irq.h1
-rw-r--r--include/asm-sh64/mmu_context.h1
-rw-r--r--include/asm-sh64/page.h1
-rw-r--r--include/asm-sh64/param.h1
-rw-r--r--include/asm-sh64/pgtable.h1
-rw-r--r--include/asm-sh64/system.h1
-rw-r--r--include/asm-sh64/unistd.h7
-rw-r--r--include/asm-sparc/asmmacro.h1
-rw-r--r--include/asm-sparc/atomic.h1
-rw-r--r--include/asm-sparc/bugs.h1
-rw-r--r--include/asm-sparc/cacheflush.h1
-rw-r--r--include/asm-sparc/delay.h1
-rw-r--r--include/asm-sparc/dma-mapping.h1
-rw-r--r--include/asm-sparc/dma.h1
-rw-r--r--include/asm-sparc/ebus.h17
-rw-r--r--include/asm-sparc/elf.h1
-rw-r--r--include/asm-sparc/fixmap.h1
-rw-r--r--include/asm-sparc/hardirq.h1
-rw-r--r--include/asm-sparc/ide.h1
-rw-r--r--include/asm-sparc/irq.h7
-rw-r--r--include/asm-sparc/mostek.h1
-rw-r--r--include/asm-sparc/of_device.h63
-rw-r--r--include/asm-sparc/page.h1
-rw-r--r--include/asm-sparc/pbm.h3
-rw-r--r--include/asm-sparc/pgalloc.h1
-rw-r--r--include/asm-sparc/pgtable.h1
-rw-r--r--include/asm-sparc/prom.h98
-rw-r--r--include/asm-sparc/sbus.h28
-rw-r--r--include/asm-sparc/sfp-machine.h1
-rw-r--r--include/asm-sparc/smp.h9
-rw-r--r--include/asm-sparc/spinlock.h3
-rw-r--r--include/asm-sparc/system.h2
-rw-r--r--include/asm-sparc/timer.h1
-rw-r--r--include/asm-sparc/tlbflush.h1
-rw-r--r--include/asm-sparc/unistd.h4
-rw-r--r--include/asm-sparc/vac-ops.h1
-rw-r--r--include/asm-sparc/winmacro.h1
-rw-r--r--include/asm-sparc64/atomic.h1
-rw-r--r--include/asm-sparc64/bitops.h1
-rw-r--r--include/asm-sparc64/bugs.h1
-rw-r--r--include/asm-sparc64/cacheflush.h1
-rw-r--r--include/asm-sparc64/cpudata.h19
-rw-r--r--include/asm-sparc64/delay.h1
-rw-r--r--include/asm-sparc64/dma-mapping.h1
-rw-r--r--include/asm-sparc64/dma.h1
-rw-r--r--include/asm-sparc64/ebus.h20
-rw-r--r--include/asm-sparc64/fhc.h7
-rw-r--r--include/asm-sparc64/floppy.h28
-rw-r--r--include/asm-sparc64/hardirq.h2
-rw-r--r--include/asm-sparc64/hw_irq.h2
-rw-r--r--include/asm-sparc64/ide.h1
-rw-r--r--include/asm-sparc64/irq.h97
-rw-r--r--include/asm-sparc64/isa.h21
-rw-r--r--include/asm-sparc64/kprobes.h1
-rw-r--r--include/asm-sparc64/mc146818rtc.h1
-rw-r--r--include/asm-sparc64/mmu.h1
-rw-r--r--include/asm-sparc64/of_device.h64
-rw-r--r--include/asm-sparc64/oplib.h6
-rw-r--r--include/asm-sparc64/page.h1
-rw-r--r--include/asm-sparc64/param.h1
-rw-r--r--include/asm-sparc64/parport.h25
-rw-r--r--include/asm-sparc64/pbm.h15
-rw-r--r--include/asm-sparc64/pgalloc.h1
-rw-r--r--include/asm-sparc64/pgtable.h3
-rw-r--r--include/asm-sparc64/pil.h7
-rw-r--r--include/asm-sparc64/processor.h1
-rw-r--r--include/asm-sparc64/prom.h98
-rw-r--r--include/asm-sparc64/sbus.h29
-rw-r--r--include/asm-sparc64/siginfo.h1
-rw-r--r--include/asm-sparc64/signal.h1
-rw-r--r--include/asm-sparc64/smp.h1
-rw-r--r--include/asm-sparc64/spinlock.h1
-rw-r--r--include/asm-sparc64/system.h1
-rw-r--r--include/asm-sparc64/timer.h1
-rw-r--r--include/asm-sparc64/tlb.h1
-rw-r--r--include/asm-sparc64/tlbflush.h1
-rw-r--r--include/asm-sparc64/ttable.h1
-rw-r--r--include/asm-sparc64/unistd.h4
-rw-r--r--include/asm-sparc64/vdev.h5
-rw-r--r--include/asm-sparc64/vga.h2
-rw-r--r--include/asm-um/a.out.h1
-rw-r--r--include/asm-um/cache.h1
-rw-r--r--include/asm-um/elf-ppc.h1
-rw-r--r--include/asm-um/fixmap.h1
-rw-r--r--include/asm-um/hardirq.h1
-rw-r--r--include/asm-um/linkage.h1
-rw-r--r--include/asm-um/mmu_context.h1
-rw-r--r--include/asm-um/page.h1
-rw-r--r--include/asm-um/pgalloc.h1
-rw-r--r--include/asm-um/processor-generic.h1
-rw-r--r--include/asm-um/ptrace-generic.h1
-rw-r--r--include/asm-um/smp.h1
-rw-r--r--include/asm-um/thread_info.h1
-rw-r--r--include/asm-v850/atomic.h1
-rw-r--r--include/asm-v850/bitops.h1
-rw-r--r--include/asm-v850/dma-mapping.h1
-rw-r--r--include/asm-v850/hardirq.h1
-rw-r--r--include/asm-v850/irq.h2
-rw-r--r--include/asm-v850/machdep.h1
-rw-r--r--include/asm-v850/pgtable.h1
-rw-r--r--include/asm-v850/processor.h1
-rw-r--r--include/asm-v850/serial.h1
-rw-r--r--include/asm-v850/unistd.h12
-rw-r--r--include/asm-v850/v850e_uart.h1
-rw-r--r--include/asm-x86_64/acpi.h2
-rw-r--r--include/asm-x86_64/apic.h1
-rw-r--r--include/asm-x86_64/apicdef.h2
-rw-r--r--include/asm-x86_64/atomic.h1
-rw-r--r--include/asm-x86_64/bitops.h1
-rw-r--r--include/asm-x86_64/bugs.h1
-rw-r--r--include/asm-x86_64/cache.h1
-rw-r--r--include/asm-x86_64/calling.h1
-rw-r--r--include/asm-x86_64/dma-mapping.h1
-rw-r--r--include/asm-x86_64/dma.h1
-rw-r--r--include/asm-x86_64/dwarf2.h1
-rw-r--r--include/asm-x86_64/fixmap.h1
-rw-r--r--include/asm-x86_64/hardirq.h1
-rw-r--r--include/asm-x86_64/hw_irq.h1
-rw-r--r--include/asm-x86_64/ia32.h1
-rw-r--r--include/asm-x86_64/io.h1
-rw-r--r--include/asm-x86_64/io_apic.h1
-rw-r--r--include/asm-x86_64/mmu_context.h1
-rw-r--r--include/asm-x86_64/mmzone.h2
-rw-r--r--include/asm-x86_64/msi.h10
-rw-r--r--include/asm-x86_64/mtrr.h9
-rw-r--r--include/asm-x86_64/numa.h1
-rw-r--r--include/asm-x86_64/page.h5
-rw-r--r--include/asm-x86_64/param.h1
-rw-r--r--include/asm-x86_64/pci.h1
-rw-r--r--include/asm-x86_64/processor.h1
-rw-r--r--include/asm-x86_64/serial.h1
-rw-r--r--include/asm-x86_64/smp.h1
-rw-r--r--include/asm-x86_64/spinlock.h1
-rw-r--r--include/asm-x86_64/swiotlb.h1
-rw-r--r--include/asm-x86_64/system.h1
-rw-r--r--include/asm-x86_64/tlbflush.h1
-rw-r--r--include/asm-x86_64/topology.h1
-rw-r--r--include/asm-x86_64/uaccess.h1
-rw-r--r--include/asm-x86_64/unistd.h11
-rw-r--r--include/asm-x86_64/vga.h2
-rw-r--r--include/asm-xtensa/atomic.h1
-rw-r--r--include/asm-xtensa/checksum.h4
-rw-r--r--include/asm-xtensa/delay.h1
-rw-r--r--include/asm-xtensa/dma.h1
-rw-r--r--include/asm-xtensa/hardirq.h1
-rw-r--r--include/asm-xtensa/ide.h1
-rw-r--r--include/asm-xtensa/io.h1
-rw-r--r--include/asm-xtensa/irq.h1
-rw-r--r--include/asm-xtensa/mmu_context.h1
-rw-r--r--include/asm-xtensa/page.h1
-rw-r--r--include/asm-xtensa/pgalloc.h1
-rw-r--r--include/asm-xtensa/platform.h1
-rw-r--r--include/asm-xtensa/rwsem.h7
-rw-r--r--include/asm-xtensa/system.h1
-rw-r--r--include/asm-xtensa/uaccess.h34
-rw-r--r--include/asm-xtensa/unistd.h21
-rw-r--r--include/asm-xtensa/vga.h2
-rw-r--r--include/linux/acct.h3
-rw-r--r--include/linux/acpi.h10
-rw-r--r--include/linux/affs_hardblocks.h72
-rw-r--r--include/linux/agpgart.h3
-rw-r--r--include/linux/amba/clcd.h1
-rw-r--r--include/linux/ata.h37
-rw-r--r--include/linux/atmdev.h1
-rw-r--r--include/linux/audit.h103
-rw-r--r--include/linux/blkdev.h22
-rw-r--r--include/linux/blkpg.h1
-rw-r--r--include/linux/blktrace_api.h7
-rw-r--r--include/linux/blockgroup_lock.h1
-rw-r--r--include/linux/bootmem.h4
-rw-r--r--include/linux/cache.h1
-rw-r--r--include/linux/cn_proc.h21
-rw-r--r--include/linux/coda.h1
-rw-r--r--include/linux/coda_linux.h2
-rw-r--r--include/linux/coda_psdev.h2
-rw-r--r--include/linux/compat.h1
-rw-r--r--include/linux/compiler.h19
-rw-r--r--include/linux/connector.h5
-rw-r--r--include/linux/cpufreq.h5
-rw-r--r--include/linux/cramfs_fs.h34
-rw-r--r--include/linux/crypto.h1
-rw-r--r--include/linux/cyclomx.h1
-rw-r--r--include/linux/dcache.h1
-rw-r--r--include/linux/dcookies.h1
-rw-r--r--include/linux/delay.h5
-rw-r--r--include/linux/devfs_fs_kernel.h1
-rw-r--r--include/linux/device.h26
-rw-r--r--include/linux/divert.h20
-rw-r--r--include/linux/dmi.h1
-rw-r--r--include/linux/dnotify.h1
-rw-r--r--include/linux/efi.h1
-rw-r--r--include/linux/elf-em.h44
-rw-r--r--include/linux/elf.h59
-rw-r--r--include/linux/errqueue.h1
-rw-r--r--include/linux/ethtool.h171
-rw-r--r--include/linux/ext2_fs.h2
-rw-r--r--include/linux/ext3_fs.h10
-rw-r--r--include/linux/fs.h43
-rw-r--r--include/linux/fsnotify.h32
-rw-r--r--include/linux/ftape.h1
-rw-r--r--include/linux/gameport.h6
-rw-r--r--include/linux/genalloc.h35
-rw-r--r--include/linux/generic_serial.h6
-rw-r--r--include/linux/genhd.h12
-rw-r--r--include/linux/gfp.h1
-rw-r--r--include/linux/hardirq.h1
-rw-r--r--include/linux/hdlc.h2
-rw-r--r--include/linux/highmem.h1
-rw-r--r--include/linux/highuid.h1
-rw-r--r--include/linux/hrtimer.h2
-rw-r--r--include/linux/hugetlb.h8
-rw-r--r--include/linux/i2c-algo-ite.h7
-rw-r--r--include/linux/i2c-ocores.h19
-rw-r--r--include/linux/i2c.h13
-rw-r--r--include/linux/i2o-dev.h167
-rw-r--r--include/linux/ide.h1
-rw-r--r--include/linux/if_fddi.h2
-rw-r--r--include/linux/if_frad.h1
-rw-r--r--include/linux/if_tr.h1
-rw-r--r--include/linux/init.h1
-rw-r--r--include/linux/inotify.h109
-rw-r--r--include/linux/input.h1
-rw-r--r--include/linux/interrupt.h22
-rw-r--r--include/linux/io.h1
-rw-r--r--include/linux/ioc4.h5
-rw-r--r--include/linux/ipmi.h2
-rw-r--r--include/linux/ipv6.h1
-rw-r--r--include/linux/irq.h12
-rw-r--r--include/linux/irq_cpustat.h1
-rw-r--r--include/linux/irqreturn.h25
-rw-r--r--include/linux/isa.h28
-rw-r--r--include/linux/isapnp.h1
-rw-r--r--include/linux/isdn.h1
-rw-r--r--include/linux/isdn/tpam.h1
-rw-r--r--include/linux/isdn_ppp.h1
-rw-r--r--include/linux/isdnif.h1
-rw-r--r--include/linux/jbd.h8
-rw-r--r--include/linux/jffs2.h56
-rw-r--r--include/linux/jffs2_fs_i.h50
-rw-r--r--include/linux/jffs2_fs_sb.h122
-rw-r--r--include/linux/joystick.h22
-rw-r--r--include/linux/kallsyms.h1
-rw-r--r--include/linux/kernel.h5
-rw-r--r--include/linux/kernel_stat.h1
-rw-r--r--include/linux/kexec.h1
-rw-r--r--include/linux/key.h23
-rw-r--r--include/linux/kmod.h1
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/kprobes.h1
-rw-r--r--include/linux/libata.h473
-rw-r--r--include/linux/linkage.h1
-rw-r--r--include/linux/list.h23
-rw-r--r--include/linux/lockd/lockd.h1
-rw-r--r--include/linux/lockd/nlm.h1
-rw-r--r--include/linux/m41t00.h50
-rw-r--r--include/linux/mempolicy.h1
-rw-r--r--include/linux/migrate.h21
-rw-r--r--include/linux/mii.h30
-rw-r--r--include/linux/mm.h12
-rw-r--r--include/linux/mman.h12
-rw-r--r--include/linux/mmzone.h13
-rw-r--r--include/linux/module.h12
-rw-r--r--include/linux/mount.h5
-rw-r--r--include/linux/msg.h2
-rw-r--r--include/linux/mtd/cfi.h1
-rw-r--r--include/linux/mtd/inftl.h2
-rw-r--r--include/linux/mtd/map.h1
-rw-r--r--include/linux/mtd/mtd.h98
-rw-r--r--include/linux/mtd/nand.h355
-rw-r--r--include/linux/mtd/ndfc.h67
-rw-r--r--include/linux/mtd/nftl.h2
-rw-r--r--include/linux/mtd/onenand.h11
-rw-r--r--include/linux/mtd/onenand_regs.h8
-rw-r--r--include/linux/mtd/partitions.h2
-rw-r--r--include/linux/mtd/physmap.h29
-rw-r--r--include/linux/mtd/xip.h1
-rw-r--r--include/linux/nbd.h12
-rw-r--r--include/linux/ncp_fs.h5
-rw-r--r--include/linux/net.h3
-rw-r--r--include/linux/netdevice.h25
-rw-r--r--include/linux/netfilter.h1
-rw-r--r--include/linux/netfilter/xt_conntrack.h2
-rw-r--r--include/linux/netfilter_arp.h1
-rw-r--r--include/linux/netfilter_bridge.h1
-rw-r--r--include/linux/netfilter_ipv4.h1
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h1
-rw-r--r--include/linux/netfilter_ipv4/listhelp.h1
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/nfs.h8
-rw-r--r--include/linux/nfs4.h6
-rw-r--r--include/linux/nfs_fs.h39
-rw-r--r--include/linux/nfsd/nfsd.h1
-rw-r--r--include/linux/nfsd/nfsfh.h1
-rw-r--r--include/linux/nfsd/syscall.h1
-rw-r--r--include/linux/numa.h1
-rw-r--r--include/linux/page-flags.h14
-rw-r--r--include/linux/pagemap.h7
-rw-r--r--include/linux/parport.h1
-rw-r--r--include/linux/pci.h9
-rw-r--r--include/linux/pci_ids.h25
-rw-r--r--include/linux/pci_regs.h1
-rw-r--r--include/linux/percpu_counter.h39
-rw-r--r--include/linux/pm.h1
-rw-r--r--include/linux/pm_legacy.h1
-rw-r--r--include/linux/pmu.h1
-rw-r--r--include/linux/ppp_defs.h14
-rw-r--r--include/linux/prctl.h7
-rw-r--r--include/linux/preempt.h1
-rw-r--r--include/linux/proc_fs.h1
-rw-r--r--include/linux/profile.h1
-rw-r--r--include/linux/ptrace.h4
-rw-r--r--include/linux/quota.h4
-rw-r--r--include/linux/quotaops.h1
-rw-r--r--include/linux/radix-tree.h5
-rw-r--r--include/linux/ramfs.h4
-rw-r--r--include/linux/rbtree.h30
-rw-r--r--include/linux/rcupdate.h3
-rw-r--r--include/linux/reiserfs_xattr.h3
-rw-r--r--include/linux/relay.h1
-rw-r--r--include/linux/resume-trace.h30
-rw-r--r--include/linux/rio.h1
-rw-r--r--include/linux/rio_drv.h1
-rw-r--r--include/linux/rmap.h2
-rw-r--r--include/linux/rtnetlink.h1
-rw-r--r--include/linux/rwsem.h1
-rw-r--r--include/linux/scc.h1
-rw-r--r--include/linux/sched.h105
-rw-r--r--include/linux/seccomp.h1
-rw-r--r--include/linux/security.h55
-rw-r--r--include/linux/sem.h2
-rw-r--r--include/linux/seqlock.h1
-rw-r--r--include/linux/serialP.h1
-rw-r--r--include/linux/serial_core.h8
-rw-r--r--include/linux/signal.h4
-rw-r--r--include/linux/skbuff.h27
-rw-r--r--include/linux/slab.h51
-rw-r--r--include/linux/smb_fs.h4
-rw-r--r--include/linux/smp.h1
-rw-r--r--include/linux/smp_lock.h1
-rw-r--r--include/linux/socket.h2
-rw-r--r--include/linux/spinlock.h1
-rw-r--r--include/linux/stop_machine.h1
-rw-r--r--include/linux/string.h1
-rw-r--r--include/linux/sunrpc/auth.h1
-rw-r--r--include/linux/sunrpc/debug.h24
-rw-r--r--include/linux/sunrpc/stats.h1
-rw-r--r--include/linux/suspend.h2
-rw-r--r--include/linux/swap.h102
-rw-r--r--include/linux/swapops.h53
-rw-r--r--include/linux/syscalls.h11
-rw-r--r--include/linux/sysctl.h1
-rw-r--r--include/linux/sysdev.h18
-rw-r--r--include/linux/sysrq.h1
-rw-r--r--include/linux/tcp.h3
-rw-r--r--include/linux/threads.h1
-rw-r--r--include/linux/timer.h1
-rw-r--r--include/linux/timex.h1
-rw-r--r--include/linux/tty.h5
-rw-r--r--include/linux/types.h1
-rw-r--r--include/linux/uaccess.h22
-rw-r--r--include/linux/udp.h1
-rw-r--r--include/linux/ufs_fs.h1
-rw-r--r--include/linux/unistd.h2
-rw-r--r--include/linux/usb.h23
-rw-r--r--include/linux/usb/cdc.h (renamed from include/linux/usb_cdc.h)0
-rw-r--r--include/linux/usb/input.h (renamed from include/linux/usb_input.h)0
-rw-r--r--include/linux/usb/isp116x.h (renamed from include/linux/usb_isp116x.h)0
-rw-r--r--include/linux/usb/sl811.h (renamed from include/linux/usb_sl811.h)8
-rw-r--r--include/linux/usb_usual.h1
-rw-r--r--include/linux/usbdevice_fs.h2
-rw-r--r--include/linux/vmalloc.h8
-rw-r--r--include/linux/vt_buffer.h1
-rw-r--r--include/linux/vt_kern.h1
-rw-r--r--include/linux/wait.h1
-rw-r--r--include/linux/wanrouter.h4
-rw-r--r--include/linux/writeback.h5
-rw-r--r--include/linux/zconf.h12
-rw-r--r--include/linux/zlib.h209
-rw-r--r--include/linux/zorro.h42
-rw-r--r--include/linux/zutil.h12
-rw-r--r--include/mtd/mtd-abi.h95
-rw-r--r--include/mtd/mtd-user.h1
-rw-r--r--include/net/addrconf.h1
-rw-r--r--include/net/af_unix.h1
-rw-r--r--include/net/ax25.h1
-rw-r--r--include/net/compat.h1
-rw-r--r--include/net/dst.h1
-rw-r--r--include/net/icmp.h1
-rw-r--r--include/net/ieee80211.h5
-rw-r--r--include/net/inet6_hashtables.h1
-rw-r--r--include/net/inet_hashtables.h1
-rw-r--r--include/net/inet_sock.h1
-rw-r--r--include/net/inet_timewait_sock.h1
-rw-r--r--include/net/ip.h1
-rw-r--r--include/net/ip_fib.h1
-rw-r--r--include/net/ip_mp_alg.h1
-rw-r--r--include/net/ip_vs.h1
-rw-r--r--include/net/ipv6.h1
-rw-r--r--include/net/irda/irda.h1
-rw-r--r--include/net/irda/irda_device.h1
-rw-r--r--include/net/irda/irlap.h1
-rw-r--r--include/net/irda/irlmp.h1
-rw-r--r--include/net/irda/irlmp_frame.h1
-rw-r--r--include/net/irda/qos.h1
-rw-r--r--include/net/ndisc.h1
-rw-r--r--include/net/netfilter/nf_conntrack.h1
-rw-r--r--include/net/pkt_act.h1
-rw-r--r--include/net/pkt_sched.h7
-rw-r--r--include/net/protocol.h2
-rw-r--r--include/net/raw.h1
-rw-r--r--include/net/red.h1
-rw-r--r--include/net/route.h1
-rw-r--r--include/net/sch_generic.h1
-rw-r--r--include/net/sctp/sctp.h3
-rw-r--r--include/net/sock.h6
-rw-r--r--include/net/tcp.h7
-rw-r--r--include/pcmcia/ss.h1
-rw-r--r--include/scsi/iscsi_if.h127
-rw-r--r--include/scsi/iscsi_proto.h2
-rw-r--r--include/scsi/libiscsi.h282
-rw-r--r--include/scsi/scsi_cmnd.h11
-rw-r--r--include/scsi/scsi_dbg.h2
-rw-r--r--include/scsi/scsi_devinfo.h1
-rw-r--r--include/scsi/scsi_eh.h3
-rw-r--r--include/scsi/scsi_host.h1
-rw-r--r--include/scsi/scsi_request.h54
-rw-r--r--include/scsi/scsi_transport_fc.h1
-rw-r--r--include/scsi/scsi_transport_iscsi.h119
-rw-r--r--include/scsi/scsi_transport_spi.h1
-rw-r--r--include/scsi/sg_request.h26
-rw-r--r--include/sound/ac97_codec.h1
-rw-r--r--include/sound/asequencer.h4
-rw-r--r--include/sound/asound.h2
-rw-r--r--include/sound/core.h3
-rw-r--r--include/sound/driver.h1
-rw-r--r--include/sound/emu10k1.h2
-rw-r--r--include/sound/hdsp.h12
-rw-r--r--include/sound/info.h11
-rw-r--r--include/sound/mpu401.h14
-rw-r--r--include/sound/pcm.h19
-rw-r--r--include/sound/pcm_params.h125
-rw-r--r--include/sound/rawmidi.h3
-rw-r--r--include/sound/version.h4
-rw-r--r--include/video/edid.h1
-rw-r--r--include/video/vga.h1
1203 files changed, 10737 insertions, 5482 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index e27dc8f29972..b9beceb33141 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
63 63
64/* Current ACPICA subsystem version in YYYYMMDD format */ 64/* Current ACPICA subsystem version in YYYYMMDD format */
65 65
66#define ACPI_CA_VERSION 0x20060127 66#define ACPI_CA_VERSION 0x20060608
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,
@@ -81,6 +81,7 @@
81#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ 81#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */
82#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ 82#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */
83#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ 83#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */
84#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */
84 85
85/* 86/*
86 * Should the subsystem abort the loading of an ACPI table if the 87 * Should the subsystem abort the loading of an ACPI table if the
@@ -102,9 +103,9 @@
102 103
103#define ACPI_MAX_SEMAPHORE_COUNT 256 104#define ACPI_MAX_SEMAPHORE_COUNT 256
104 105
105/* Max reference count (for debug only) */ 106/* Maximum object reference count (detects object deletion issues) */
106 107
107#define ACPI_MAX_REFERENCE_COUNT 0x400 108#define ACPI_MAX_REFERENCE_COUNT 0x800
108 109
109/* Size of cached memory mapping for system memory operation region */ 110/* Size of cached memory mapping for system memory operation region */
110 111
@@ -171,12 +172,7 @@
171 172
172/* Array sizes. Used for range checking also */ 173/* Array sizes. Used for range checking also */
173 174
174#define ACPI_NUM_ACCESS_TYPES 6 175#define ACPI_MAX_MATCH_OPCODE 5
175#define ACPI_NUM_UPDATE_RULES 3
176#define ACPI_NUM_LOCK_RULES 2
177#define ACPI_NUM_MATCH_OPS 6
178#define ACPI_NUM_OPCODES 256
179#define ACPI_NUM_FIELD_NAMES 2
180 176
181/* RSDP checksums */ 177/* RSDP checksums */
182 178
@@ -187,10 +183,6 @@
187 183
188#define ACPI_SMBUS_BUFFER_SIZE 34 184#define ACPI_SMBUS_BUFFER_SIZE 34
189 185
190/* Number of strings associated with the _OSI reserved method */
191
192#define ACPI_NUM_OSI_STRINGS 10
193
194/****************************************************************************** 186/******************************************************************************
195 * 187 *
196 * ACPI AML Debugger 188 * ACPI AML Debugger
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 11a8fe39cb04..9a7d6921f534 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -50,26 +50,72 @@
50#define BLOCK_PAREN 1 50#define BLOCK_PAREN 1
51#define BLOCK_BRACE 2 51#define BLOCK_BRACE 2
52#define BLOCK_COMMA_LIST 4 52#define BLOCK_COMMA_LIST 4
53#define ACPI_DEFAULT_RESNAME *(u32 *) "__RD"
53 54
54struct acpi_external_list { 55struct acpi_external_list {
55 char *path; 56 char *path;
57 char *internal_path;
56 struct acpi_external_list *next; 58 struct acpi_external_list *next;
59 u32 value;
60 u16 length;
61 u8 type;
57}; 62};
58 63
59extern struct acpi_external_list *acpi_gbl_external_list; 64extern struct acpi_external_list *acpi_gbl_external_list;
60 65
61/* Strings used for decoding flags to ASL keywords */ 66typedef const struct acpi_dmtable_info {
67 u8 opcode;
68 u8 offset;
69 char *name;
70
71} acpi_dmtable_info;
72
73/*
74 * Values for Opcode above.
75 * Note: 0-7 must not change, used as a flag shift value
76 */
77#define ACPI_DMT_FLAG0 0
78#define ACPI_DMT_FLAG1 1
79#define ACPI_DMT_FLAG2 2
80#define ACPI_DMT_FLAG3 3
81#define ACPI_DMT_FLAG4 4
82#define ACPI_DMT_FLAG5 5
83#define ACPI_DMT_FLAG6 6
84#define ACPI_DMT_FLAG7 7
85#define ACPI_DMT_FLAGS0 8
86#define ACPI_DMT_FLAGS2 9
87#define ACPI_DMT_UINT8 10
88#define ACPI_DMT_UINT16 11
89#define ACPI_DMT_UINT24 12
90#define ACPI_DMT_UINT32 13
91#define ACPI_DMT_UINT56 14
92#define ACPI_DMT_UINT64 15
93#define ACPI_DMT_STRING 16
94#define ACPI_DMT_NAME4 17
95#define ACPI_DMT_NAME6 18
96#define ACPI_DMT_NAME8 19
97#define ACPI_DMT_CHKSUM 20
98#define ACPI_DMT_SPACEID 21
99#define ACPI_DMT_GAS 22
100#define ACPI_DMT_MADT 23
101#define ACPI_DMT_SRAT 24
102#define ACPI_DMT_EXIT 25
62 103
63extern const char *acpi_gbl_word_decode[4]; 104typedef
64extern const char *acpi_gbl_irq_decode[2]; 105void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table);
65extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; 106
66extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; 107struct acpi_dmtable_data {
67extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; 108 char *signature;
68extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS]; 109 struct acpi_dmtable_info *table_info;
110 ACPI_TABLE_HANDLER table_handler;
111};
69 112
70struct acpi_op_walk_info { 113struct acpi_op_walk_info {
71 u32 level; 114 u32 level;
115 u32 last_level;
116 u32 count;
72 u32 bit_offset; 117 u32 bit_offset;
118 u32 flags;
73 struct acpi_walk_state *walk_state; 119 struct acpi_walk_state *walk_state;
74}; 120};
75 121
@@ -77,6 +123,100 @@ typedef
77acpi_status(*asl_walk_callback) (union acpi_parse_object * op, 123acpi_status(*asl_walk_callback) (union acpi_parse_object * op,
78 u32 level, void *context); 124 u32 level, void *context);
79 125
126struct acpi_resource_tag {
127 u32 bit_index;
128 char *tag;
129};
130
131/* Strings used for decoding flags to ASL keywords */
132
133extern const char *acpi_gbl_word_decode[];
134extern const char *acpi_gbl_irq_decode[];
135extern const char *acpi_gbl_lock_rule[];
136extern const char *acpi_gbl_access_types[];
137extern const char *acpi_gbl_update_rules[];
138extern const char *acpi_gbl_match_ops[];
139
140extern struct acpi_dmtable_info acpi_dm_table_info_asf0[];
141extern struct acpi_dmtable_info acpi_dm_table_info_asf1[];
142extern struct acpi_dmtable_info acpi_dm_table_info_asf2[];
143extern struct acpi_dmtable_info acpi_dm_table_info_asf3[];
144extern struct acpi_dmtable_info acpi_dm_table_info_asf4[];
145extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[];
146extern struct acpi_dmtable_info acpi_dm_table_info_boot[];
147extern struct acpi_dmtable_info acpi_dm_table_info_cpep[];
148extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[];
149extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[];
150extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
151extern struct acpi_dmtable_info acpi_dm_table_info_facs[];
152extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[];
153extern struct acpi_dmtable_info acpi_dm_table_info_fadt2[];
154extern struct acpi_dmtable_info acpi_dm_table_info_gas[];
155extern struct acpi_dmtable_info acpi_dm_table_info_header[];
156extern struct acpi_dmtable_info acpi_dm_table_info_hpet[];
157extern struct acpi_dmtable_info acpi_dm_table_info_madt[];
158extern struct acpi_dmtable_info acpi_dm_table_info_madt0[];
159extern struct acpi_dmtable_info acpi_dm_table_info_madt1[];
160extern struct acpi_dmtable_info acpi_dm_table_info_madt2[];
161extern struct acpi_dmtable_info acpi_dm_table_info_madt3[];
162extern struct acpi_dmtable_info acpi_dm_table_info_madt4[];
163extern struct acpi_dmtable_info acpi_dm_table_info_madt5[];
164extern struct acpi_dmtable_info acpi_dm_table_info_madt6[];
165extern struct acpi_dmtable_info acpi_dm_table_info_madt7[];
166extern struct acpi_dmtable_info acpi_dm_table_info_madt8[];
167extern struct acpi_dmtable_info acpi_dm_table_info_madt_hdr[];
168extern struct acpi_dmtable_info acpi_dm_table_info_mcfg[];
169extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[];
170extern struct acpi_dmtable_info acpi_dm_table_info_rsdp1[];
171extern struct acpi_dmtable_info acpi_dm_table_info_rsdp2[];
172extern struct acpi_dmtable_info acpi_dm_table_info_sbst[];
173extern struct acpi_dmtable_info acpi_dm_table_info_slit[];
174extern struct acpi_dmtable_info acpi_dm_table_info_spcr[];
175extern struct acpi_dmtable_info acpi_dm_table_info_spmi[];
176extern struct acpi_dmtable_info acpi_dm_table_info_srat[];
177extern struct acpi_dmtable_info acpi_dm_table_info_srat0[];
178extern struct acpi_dmtable_info acpi_dm_table_info_srat1[];
179extern struct acpi_dmtable_info acpi_dm_table_info_tcpa[];
180extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[];
181
182/*
183 * dmtable
184 */
185void acpi_dm_dump_data_table(struct acpi_table_header *table);
186
187void
188acpi_dm_dump_table(u32 table_length,
189 u32 table_offset,
190 void *table,
191 u32 sub_table_length, struct acpi_dmtable_info *info);
192
193void acpi_dm_line_header(u32 offset, u32 byte_length, char *name);
194
195void acpi_dm_line_header2(u32 offset, u32 byte_length, char *name, u32 value);
196
197/*
198 * dmtbdump
199 */
200void acpi_dm_dump_asf(struct acpi_table_header *table);
201
202void acpi_dm_dump_cpep(struct acpi_table_header *table);
203
204void acpi_dm_dump_fadt(struct acpi_table_header *table);
205
206void acpi_dm_dump_srat(struct acpi_table_header *table);
207
208void acpi_dm_dump_mcfg(struct acpi_table_header *table);
209
210void acpi_dm_dump_madt(struct acpi_table_header *table);
211
212u32 acpi_dm_dump_rsdp(struct acpi_table_header *table);
213
214void acpi_dm_dump_rsdt(struct acpi_table_header *table);
215
216void acpi_dm_dump_slit(struct acpi_table_header *table);
217
218void acpi_dm_dump_xsdt(struct acpi_table_header *table);
219
80/* 220/*
81 * dmwalk 221 * dmwalk
82 */ 222 */
@@ -84,6 +224,11 @@ void
84acpi_dm_disassemble(struct acpi_walk_state *walk_state, 224acpi_dm_disassemble(struct acpi_walk_state *walk_state,
85 union acpi_parse_object *origin, u32 num_opcodes); 225 union acpi_parse_object *origin, u32 num_opcodes);
86 226
227void
228acpi_dm_walk_parse_tree(union acpi_parse_object *op,
229 asl_walk_callback descending_callback,
230 asl_walk_callback ascending_callback, void *context);
231
87/* 232/*
88 * dmopcode 233 * dmopcode
89 */ 234 */
@@ -166,6 +311,7 @@ void acpi_dm_dump_integer64(u64 value, char *name);
166 311
167void 312void
168acpi_dm_resource_template(struct acpi_op_walk_info *info, 313acpi_dm_resource_template(struct acpi_op_walk_info *info,
314 union acpi_parse_object *op,
169 u8 * byte_data, u32 byte_count); 315 u8 * byte_data, u32 byte_count);
170 316
171u8 acpi_dm_is_resource_template(union acpi_parse_object *op); 317u8 acpi_dm_is_resource_template(union acpi_parse_object *op);
@@ -176,6 +322,8 @@ void acpi_dm_bit_list(u16 mask);
176 322
177void acpi_dm_decode_attribute(u8 attribute); 323void acpi_dm_decode_attribute(u8 attribute);
178 324
325void acpi_dm_descriptor_name(void);
326
179/* 327/*
180 * dmresrcl 328 * dmresrcl
181 */ 329 */
@@ -248,6 +396,15 @@ acpi_dm_vendor_small_descriptor(union aml_resource *resource,
248/* 396/*
249 * dmutils 397 * dmutils
250 */ 398 */
251void acpi_dm_add_to_external_list(char *path); 399void acpi_dm_add_to_external_list(char *path, u8 type, u32 value);
400
401/*
402 * dmrestag
403 */
404void acpi_dm_find_resources(union acpi_parse_object *root);
405
406void
407acpi_dm_check_resource_reference(union acpi_parse_object *op,
408 struct acpi_walk_state *walk_state);
252 409
253#endif /* __ACDISASM_H__ */ 410#endif /* __ACDISASM_H__ */
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index c41a926ff317..288f84903af7 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -194,7 +194,9 @@ acpi_status
194acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, 194acpi_ds_restart_control_method(struct acpi_walk_state *walk_state,
195 union acpi_operand_object *return_desc); 195 union acpi_operand_object *return_desc);
196 196
197void acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state); 197void
198acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
199 struct acpi_walk_state *walk_state);
198 200
199acpi_status 201acpi_status
200acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, 202acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
@@ -302,7 +304,7 @@ acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state,
302 struct acpi_namespace_node *method_node, 304 struct acpi_namespace_node *method_node,
303 u8 * aml_start, 305 u8 * aml_start,
304 u32 aml_length, 306 u32 aml_length,
305 struct acpi_parameter_info *info, u8 pass_number); 307 struct acpi_evaluate_info *info, u8 pass_number);
306 308
307acpi_status 309acpi_status
308acpi_ds_obj_stack_pop_and_delete(u32 pop_count, 310acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h
index f2717be4fe0d..234142828e1a 100644
--- a/include/acpi/acevents.h
+++ b/include/acpi/acevents.h
@@ -93,7 +93,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
93 */ 93 */
94u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info); 94u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info);
95 95
96acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback); 96acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback);
97 97
98acpi_status 98acpi_status
99acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, 99acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
@@ -138,7 +138,7 @@ acpi_status
138acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, 138acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
139 u32 function, 139 u32 function,
140 acpi_physical_address address, 140 acpi_physical_address address,
141 u32 bit_width, void *value); 141 u32 bit_width, acpi_integer * value);
142 142
143acpi_status 143acpi_status
144acpi_ev_attach_region(union acpi_operand_object *handler_obj, 144acpi_ev_attach_region(union acpi_operand_object *handler_obj,
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index dc768aa580e4..797ca1ea5214 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -160,8 +160,9 @@
160#define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001F | AE_CODE_AML) 160#define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001F | AE_CODE_AML)
161#define AE_AML_CIRCULAR_REFERENCE (acpi_status) (0x0020 | AE_CODE_AML) 161#define AE_AML_CIRCULAR_REFERENCE (acpi_status) (0x0020 | AE_CODE_AML)
162#define AE_AML_BAD_RESOURCE_LENGTH (acpi_status) (0x0021 | AE_CODE_AML) 162#define AE_AML_BAD_RESOURCE_LENGTH (acpi_status) (0x0021 | AE_CODE_AML)
163#define AE_AML_ILLEGAL_ADDRESS (acpi_status) (0x0022 | AE_CODE_AML)
163 164
164#define AE_CODE_AML_MAX 0x0021 165#define AE_CODE_AML_MAX 0x0022
165 166
166/* 167/*
167 * Internal exceptions used for control 168 * Internal exceptions used for control
@@ -275,7 +276,8 @@ char const *acpi_gbl_exception_names_aml[] = {
275 "AE_AML_NO_RESOURCE_END_TAG", 276 "AE_AML_NO_RESOURCE_END_TAG",
276 "AE_AML_BAD_RESOURCE_VALUE", 277 "AE_AML_BAD_RESOURCE_VALUE",
277 "AE_AML_CIRCULAR_REFERENCE", 278 "AE_AML_CIRCULAR_REFERENCE",
278 "AE_AML_BAD_RESOURCE_LENGTH" 279 "AE_AML_BAD_RESOURCE_LENGTH",
280 "AE_AML_ILLEGAL_ADDRESS"
279}; 281};
280 282
281char const *acpi_gbl_exception_names_ctrl[] = { 283char const *acpi_gbl_exception_names_ctrl[] = {
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 734cc77bf2c7..14531d48f6b6 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -107,6 +107,7 @@ ACPI_EXTERN u32 acpi_gbl_trace_flags;
107 * 3) Allow access to uninitialized locals/args (auto-init to integer 0) 107 * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
108 * 4) Allow ANY object type to be a source operand for the Store() operator 108 * 4) Allow ANY object type to be a source operand for the Store() operator
109 * 5) Allow unresolved references (invalid target name) in package objects 109 * 5) Allow unresolved references (invalid target name) in package objects
110 * 6) Enable warning messages for behavior that is not ACPI spec compliant
110 */ 111 */
111ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); 112ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE);
112 113
@@ -114,7 +115,7 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE);
114 * Automatically serialize ALL control methods? Default is FALSE, meaning 115 * Automatically serialize ALL control methods? Default is FALSE, meaning
115 * to use the Serialized/not_serialized method flags on a per method basis. 116 * to use the Serialized/not_serialized method flags on a per method basis.
116 * Only change this if the ASL code is poorly written and cannot handle 117 * Only change this if the ASL code is poorly written and cannot handle
117 * reentrancy even though methods are marked "not_serialized". 118 * reentrancy even though methods are marked "NotSerialized".
118 */ 119 */
119ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE); 120ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE);
120 121
@@ -149,10 +150,10 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);
149ACPI_EXTERN u32 acpi_gbl_table_flags; 150ACPI_EXTERN u32 acpi_gbl_table_flags;
150ACPI_EXTERN u32 acpi_gbl_rsdt_table_count; 151ACPI_EXTERN u32 acpi_gbl_rsdt_table_count;
151ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP; 152ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP;
152ACPI_EXTERN XSDT_DESCRIPTOR *acpi_gbl_XSDT; 153ACPI_EXTERN struct xsdt_descriptor *acpi_gbl_XSDT;
153ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT; 154ACPI_EXTERN struct fadt_descriptor *acpi_gbl_FADT;
154ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT; 155ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT;
155ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; 156ACPI_EXTERN struct facs_descriptor *acpi_gbl_FACS;
156ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; 157ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS;
157/* 158/*
158 * Since there may be multiple SSDTs and PSDTs, a single pointer is not 159 * Since there may be multiple SSDTs and PSDTs, a single pointer is not
@@ -177,15 +178,15 @@ ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
177/* 178/*
178 * ACPI Table info arrays 179 * ACPI Table info arrays
179 */ 180 */
180extern struct acpi_table_list acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES]; 181extern struct acpi_table_list acpi_gbl_table_lists[ACPI_TABLE_ID_MAX + 1];
181extern struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES]; 182extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1];
182 183
183/* 184/*
184 * Predefined mutex objects. This array contains the 185 * Predefined mutex objects. This array contains the
185 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. 186 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
186 * (The table maps local handles to the real OS handles) 187 * (The table maps local handles to the real OS handles)
187 */ 188 */
188ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX]; 189ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX];
189 190
190/***************************************************************************** 191/*****************************************************************************
191 * 192 *
@@ -203,6 +204,7 @@ ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
203 204
204/* Object caches */ 205/* Object caches */
205 206
207ACPI_EXTERN acpi_cache_t *acpi_gbl_namespace_cache;
206ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; 208ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache;
207ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; 209ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache;
208ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; 210ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache;
@@ -244,7 +246,6 @@ extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
244extern const char *acpi_gbl_highest_dstate_names[4]; 246extern const char *acpi_gbl_highest_dstate_names[4];
245extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; 247extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
246extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; 248extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
247extern const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS];
248 249
249/***************************************************************************** 250/*****************************************************************************
250 * 251 *
@@ -291,14 +292,6 @@ ACPI_EXTERN u8 acpi_gbl_cm_single_step;
291 292
292/***************************************************************************** 293/*****************************************************************************
293 * 294 *
294 * Parser globals
295 *
296 ****************************************************************************/
297
298ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root;
299
300/*****************************************************************************
301 *
302 * Hardware globals 295 * Hardware globals
303 * 296 *
304 ****************************************************************************/ 297 ****************************************************************************/
@@ -321,7 +314,11 @@ ACPI_EXTERN struct acpi_fixed_event_handler
321ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; 314ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
322ACPI_EXTERN struct acpi_gpe_block_info 315ACPI_EXTERN struct acpi_gpe_block_info
323 *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; 316 *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
317
318/* Spinlocks */
319
324ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; 320ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock;
321ACPI_EXTERN acpi_handle acpi_gbl_hardware_lock;
325 322
326/***************************************************************************** 323/*****************************************************************************
327 * 324 *
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 8361820d2970..1eeca7adca95 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -44,7 +44,10 @@
44#ifndef __ACLOCAL_H__ 44#ifndef __ACLOCAL_H__
45#define __ACLOCAL_H__ 45#define __ACLOCAL_H__
46 46
47/* acpisrc:struct_defs -- for acpisrc conversion */
48
47#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ 49#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */
50#define ACPI_INFINITE_CONCURRENCY 0xFF
48 51
49typedef void *acpi_mutex; 52typedef void *acpi_mutex;
50typedef u32 acpi_mutex_handle; 53typedef u32 acpi_mutex_handle;
@@ -69,52 +72,55 @@ union acpi_parse_object;
69 * Predefined handles for the mutex objects used within the subsystem 72 * Predefined handles for the mutex objects used within the subsystem
70 * All mutex objects are automatically created by acpi_ut_mutex_initialize. 73 * All mutex objects are automatically created by acpi_ut_mutex_initialize.
71 * 74 *
72 * The acquire/release ordering protocol is implied via this list. Mutexes 75 * The acquire/release ordering protocol is implied via this list. Mutexes
73 * with a lower value must be acquired before mutexes with a higher value. 76 * with a lower value must be acquired before mutexes with a higher value.
74 * 77 *
75 * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names table also! 78 * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names
79 * table below also!
76 */ 80 */
77#define ACPI_MTX_EXECUTE 0 81#define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */
78#define ACPI_MTX_INTERPRETER 1 82#define ACPI_MTX_CONTROL_METHOD 1 /* Control method termination [TBD: may no longer be necessary] */
79#define ACPI_MTX_PARSER 2 83#define ACPI_MTX_TABLES 2 /* Data for ACPI tables */
80#define ACPI_MTX_DISPATCHER 3 84#define ACPI_MTX_NAMESPACE 3 /* ACPI Namespace */
81#define ACPI_MTX_TABLES 4 85#define ACPI_MTX_EVENTS 4 /* Data for ACPI events */
82#define ACPI_MTX_OP_REGIONS 5 86#define ACPI_MTX_CACHES 5 /* Internal caches, general purposes */
83#define ACPI_MTX_NAMESPACE 6 87#define ACPI_MTX_MEMORY 6 /* Debug memory tracking lists */
84#define ACPI_MTX_EVENTS 7 88#define ACPI_MTX_DEBUG_CMD_COMPLETE 7 /* AML debugger */
85#define ACPI_MTX_HARDWARE 8 89#define ACPI_MTX_DEBUG_CMD_READY 8 /* AML debugger */
86#define ACPI_MTX_CACHES 9 90
87#define ACPI_MTX_MEMORY 10 91#define ACPI_MAX_MUTEX 8
88#define ACPI_MTX_DEBUG_CMD_COMPLETE 11 92#define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1
89#define ACPI_MTX_DEBUG_CMD_READY 12
90
91#define MAX_MUTEX 12
92#define NUM_MUTEX MAX_MUTEX+1
93 93
94#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 94#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
95#ifdef DEFINE_ACPI_GLOBALS 95#ifdef DEFINE_ACPI_GLOBALS
96 96
97/* Names for the mutexes used in the subsystem */ 97/* Debug names for the mutexes above */
98 98
99static char *acpi_gbl_mutex_names[] = { 99static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = {
100 "ACPI_MTX_Execute",
101 "ACPI_MTX_Interpreter", 100 "ACPI_MTX_Interpreter",
102 "ACPI_MTX_Parser", 101 "ACPI_MTX_Method",
103 "ACPI_MTX_Dispatcher",
104 "ACPI_MTX_Tables", 102 "ACPI_MTX_Tables",
105 "ACPI_MTX_op_regions",
106 "ACPI_MTX_Namespace", 103 "ACPI_MTX_Namespace",
107 "ACPI_MTX_Events", 104 "ACPI_MTX_Events",
108 "ACPI_MTX_Hardware",
109 "ACPI_MTX_Caches", 105 "ACPI_MTX_Caches",
110 "ACPI_MTX_Memory", 106 "ACPI_MTX_Memory",
111 "ACPI_MTX_debug_cmd_complete", 107 "ACPI_MTX_DebugCmdComplete",
112 "ACPI_MTX_debug_cmd_ready", 108 "ACPI_MTX_DebugCmdReady"
113}; 109};
114 110
115#endif 111#endif
116#endif 112#endif
117 113
114/*
115 * Predefined handles for spinlocks used within the subsystem.
116 * These spinlocks are created by acpi_ut_mutex_initialize
117 */
118#define ACPI_LOCK_GPES 0
119#define ACPI_LOCK_HARDWARE 1
120
121#define ACPI_MAX_LOCK 1
122#define ACPI_NUM_LOCK ACPI_MAX_LOCK+1
123
118/* Owner IDs are used to track namespace nodes for selective deletion */ 124/* Owner IDs are used to track namespace nodes for selective deletion */
119 125
120typedef u8 acpi_owner_id; 126typedef u8 acpi_owner_id;
@@ -129,7 +135,7 @@ typedef u8 acpi_owner_id;
129struct acpi_mutex_info { 135struct acpi_mutex_info {
130 acpi_mutex mutex; 136 acpi_mutex mutex;
131 u32 use_count; 137 u32 use_count;
132 u32 thread_id; 138 acpi_thread_id thread_id;
133}; 139};
134 140
135/* Lock flag parameter for various interfaces */ 141/* Lock flag parameter for various interfaces */
@@ -144,6 +150,8 @@ struct acpi_mutex_info {
144#define ACPI_FIELD_DWORD_GRANULARITY 4 150#define ACPI_FIELD_DWORD_GRANULARITY 4
145#define ACPI_FIELD_QWORD_GRANULARITY 8 151#define ACPI_FIELD_QWORD_GRANULARITY 8
146 152
153#define ACPI_ENTRY_NOT_FOUND NULL
154
147/***************************************************************************** 155/*****************************************************************************
148 * 156 *
149 * Namespace typedefs and structs 157 * Namespace typedefs and structs
@@ -158,49 +166,55 @@ typedef enum {
158 ACPI_IMODE_EXECUTE = 0x0E 166 ACPI_IMODE_EXECUTE = 0x0E
159} acpi_interpreter_mode; 167} acpi_interpreter_mode;
160 168
161/*
162 * The Node describes a named object that appears in the AML
163 * An acpi_node is used to store Nodes.
164 *
165 * data_type is used to differentiate between internal descriptors, and MUST
166 * be the first byte in this structure.
167 */
168union acpi_name_union { 169union acpi_name_union {
169 u32 integer; 170 u32 integer;
170 char ascii[4]; 171 char ascii[4];
171}; 172};
172 173
174/*
175 * The Namespace Node describes a named object that appears in the AML.
176 * descriptor_type is used to differentiate between internal descriptors.
177 *
178 * The node is optimized for both 32-bit and 64-bit platforms:
179 * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
180 *
181 * Note: The descriptor_type and Type fields must appear in the identical
182 * position in both the struct acpi_namespace_node and union acpi_operand_object
183 * structures.
184 */
173struct acpi_namespace_node { 185struct acpi_namespace_node {
174 u8 descriptor; /* Used to differentiate object descriptor types */ 186 union acpi_operand_object *object; /* Interpreter object */
175 u8 type; /* Type associated with this name */ 187 u8 descriptor_type; /* Differentiate object descriptor types */
176 u16 reference_count; /* Current count of references and children */ 188 u8 type; /* ACPI Type associated with this name */
189 u8 flags; /* Miscellaneous flags */
190 acpi_owner_id owner_id; /* Node creator */
177 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ 191 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */
178 union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */
179 struct acpi_namespace_node *child; /* First child */ 192 struct acpi_namespace_node *child; /* First child */
180 struct acpi_namespace_node *peer; /* Next peer */ 193 struct acpi_namespace_node *peer; /* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */
181 u8 owner_id; /* Who created this node */
182 u8 flags;
183
184 /* Fields used by the ASL compiler only */
185 194
186#ifdef ACPI_ASL_COMPILER 195 /*
187 u32 value; 196 * The following fields are used by the ASL compiler and disassembler only
197 */
198#ifdef ACPI_LARGE_NAMESPACE_NODE
188 union acpi_parse_object *op; 199 union acpi_parse_object *op;
200 u32 value;
201 u32 length;
189#endif 202#endif
190}; 203};
191 204
192#define ACPI_ENTRY_NOT_FOUND NULL 205/* Namespace Node flags */
193 206
194/* Node flags */ 207#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */
208#define ANOBJ_DATA_WIDTH_32 0x02 /* Parent table uses 32-bit math */
209#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
210#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
211#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
195 212
196#define ANOBJ_RESERVED 0x01 213#define ANOBJ_IS_EXTERNAL 0x08 /* i_aSL only: This object created via External() */
197#define ANOBJ_END_OF_PEER_LIST 0x02 214#define ANOBJ_METHOD_NO_RETVAL 0x10 /* i_aSL only: Method has no return value */
198#define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */ 215#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* i_aSL only: Method has at least one return value */
199#define ANOBJ_METHOD_ARG 0x08 216#define ANOBJ_IS_BIT_OFFSET 0x40 /* i_aSL only: Reference is a bit offset */
200#define ANOBJ_METHOD_LOCAL 0x10 217#define ANOBJ_IS_REFERENCED 0x80 /* i_aSL only: Object was referenced */
201#define ANOBJ_METHOD_NO_RETVAL 0x20
202#define ANOBJ_METHOD_SOME_NO_RETVAL 0x40
203#define ANOBJ_IS_BIT_OFFSET 0x80
204 218
205/* 219/*
206 * ACPI Table Descriptor. One per ACPI table 220 * ACPI Table Descriptor. One per ACPI table
@@ -212,8 +226,8 @@ struct acpi_table_desc {
212 struct acpi_table_header *pointer; 226 struct acpi_table_header *pointer;
213 u8 *aml_start; 227 u8 *aml_start;
214 u64 physical_address; 228 u64 physical_address;
215 u32 aml_length;
216 acpi_size length; 229 acpi_size length;
230 u32 aml_length;
217 acpi_owner_id owner_id; 231 acpi_owner_id owner_id;
218 u8 type; 232 u8 type;
219 u8 allocation; 233 u8 allocation;
@@ -276,6 +290,9 @@ struct acpi_create_field_info {
276 u8 field_type; 290 u8 field_type;
277}; 291};
278 292
293typedef
294acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state);
295
279/* 296/*
280 * Bitmapped ACPI types. Used internally only 297 * Bitmapped ACPI types. Used internally only
281 */ 298 */
@@ -377,7 +394,7 @@ struct acpi_gpe_walk_info {
377 struct acpi_gpe_block_info *gpe_block; 394 struct acpi_gpe_block_info *gpe_block;
378}; 395};
379 396
380typedef acpi_status(*ACPI_GPE_CALLBACK) (struct acpi_gpe_xrupt_info * 397typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info *
381 gpe_xrupt_info, 398 gpe_xrupt_info,
382 struct acpi_gpe_block_info * 399 struct acpi_gpe_block_info *
383 gpe_block); 400 gpe_block);
@@ -416,13 +433,14 @@ struct acpi_field_info {
416#define ACPI_CONTROL_PREDICATE_FALSE 0xC3 433#define ACPI_CONTROL_PREDICATE_FALSE 0xC3
417#define ACPI_CONTROL_PREDICATE_TRUE 0xC4 434#define ACPI_CONTROL_PREDICATE_TRUE 0xC4
418 435
419#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ 436#define ACPI_STATE_COMMON \
420 u8 data_type; /* To differentiate various internal objs */\ 437 void *next; \
421 u8 flags; \ 438 u8 descriptor_type; /* To differentiate various internal objs */\
422 u16 value; \ 439 u8 flags; \
423 u16 state; \ 440 u16 value; \
424 u16 reserved; \ 441 u16 state;
425 void *next; 442
443 /* There are 2 bytes available here until the next natural alignment boundary */
426 444
427struct acpi_common_state { 445struct acpi_common_state {
428ACPI_STATE_COMMON}; 446ACPI_STATE_COMMON};
@@ -438,12 +456,12 @@ struct acpi_update_state {
438 * Pkg state - used to traverse nested package structures 456 * Pkg state - used to traverse nested package structures
439 */ 457 */
440struct acpi_pkg_state { 458struct acpi_pkg_state {
441 ACPI_STATE_COMMON union acpi_operand_object *source_object; 459 ACPI_STATE_COMMON u16 index;
460 union acpi_operand_object *source_object;
442 union acpi_operand_object *dest_object; 461 union acpi_operand_object *dest_object;
443 struct acpi_walk_state *walk_state; 462 struct acpi_walk_state *walk_state;
444 void *this_target_obj; 463 void *this_target_obj;
445 u32 num_packages; 464 u32 num_packages;
446 u16 index;
447}; 465};
448 466
449/* 467/*
@@ -451,10 +469,10 @@ struct acpi_pkg_state {
451 * Allows nesting of these constructs 469 * Allows nesting of these constructs
452 */ 470 */
453struct acpi_control_state { 471struct acpi_control_state {
454 ACPI_STATE_COMMON union acpi_parse_object *predicate_op; 472 ACPI_STATE_COMMON u16 opcode;
473 union acpi_parse_object *predicate_op;
455 u8 *aml_predicate_start; /* Start of if/while predicate */ 474 u8 *aml_predicate_start; /* Start of if/while predicate */
456 u8 *package_end; /* End of if/while block */ 475 u8 *package_end; /* End of if/while block */
457 u16 opcode;
458}; 476};
459 477
460/* 478/*
@@ -465,11 +483,11 @@ struct acpi_scope_state {
465}; 483};
466 484
467struct acpi_pscope_state { 485struct acpi_pscope_state {
468 ACPI_STATE_COMMON union acpi_parse_object *op; /* Current op being parsed */ 486 ACPI_STATE_COMMON u32 arg_count; /* Number of fixed arguments */
487 union acpi_parse_object *op; /* Current op being parsed */
469 u8 *arg_end; /* Current argument end */ 488 u8 *arg_end; /* Current argument end */
470 u8 *pkg_end; /* Current package end */ 489 u8 *pkg_end; /* Current package end */
471 u32 arg_list; /* Next argument to parse */ 490 u32 arg_list; /* Next argument to parse */
472 u32 arg_count; /* Number of fixed arguments */
473}; 491};
474 492
475/* 493/*
@@ -477,10 +495,10 @@ struct acpi_pscope_state {
477 * states are created when there are nested control methods executing. 495 * states are created when there are nested control methods executing.
478 */ 496 */
479struct acpi_thread_state { 497struct acpi_thread_state {
480 ACPI_STATE_COMMON struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ 498 ACPI_STATE_COMMON u8 current_sync_level; /* Mutex Sync (nested acquire) level */
499 struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */
481 union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ 500 union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */
482 u32 thread_id; /* Running thread ID */ 501 acpi_thread_id thread_id; /* Running thread ID */
483 u8 current_sync_level; /* Mutex Sync (nested acquire) level */
484}; 502};
485 503
486/* 504/*
@@ -488,10 +506,9 @@ struct acpi_thread_state {
488 * AML arguments 506 * AML arguments
489 */ 507 */
490struct acpi_result_values { 508struct acpi_result_values {
491 ACPI_STATE_COMMON 509 ACPI_STATE_COMMON u8 num_results;
492 union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS];
493 u8 num_results;
494 u8 last_insert; 510 u8 last_insert;
511 union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS];
495}; 512};
496 513
497typedef 514typedef
@@ -546,7 +563,7 @@ struct acpi_opcode_info {
546#endif 563#endif
547 u32 parse_args; /* Grammar/Parse time arguments */ 564 u32 parse_args; /* Grammar/Parse time arguments */
548 u32 runtime_args; /* Interpret time arguments */ 565 u32 runtime_args; /* Interpret time arguments */
549 u32 flags; /* Misc flags */ 566 u16 flags; /* Misc flags */
550 u8 object_type; /* Corresponding internal object type */ 567 u8 object_type; /* Corresponding internal object type */
551 u8 class; /* Opcode class */ 568 u8 class; /* Opcode class */
552 u8 type; /* Opcode type */ 569 u8 type; /* Opcode type */
@@ -563,29 +580,31 @@ union acpi_parse_value {
563}; 580};
564 581
565#define ACPI_PARSE_COMMON \ 582#define ACPI_PARSE_COMMON \
566 u8 data_type; /* To differentiate various internal objs */\ 583 union acpi_parse_object *parent; /* Parent op */\
567 u8 flags; /* Type of Op */\ 584 u8 descriptor_type; /* To differentiate various internal objs */\
568 u16 aml_opcode; /* AML opcode */\ 585 u8 flags; /* Type of Op */\
569 u32 aml_offset; /* Offset of declaration in AML */\ 586 u16 aml_opcode; /* AML opcode */\
570 union acpi_parse_object *parent; /* Parent op */\ 587 u32 aml_offset; /* Offset of declaration in AML */\
571 union acpi_parse_object *next; /* Next op */\ 588 union acpi_parse_object *next; /* Next op */\
589 struct acpi_namespace_node *node; /* For use by interpreter */\
590 union acpi_parse_value value; /* Value or args associated with the opcode */\
572 ACPI_DISASM_ONLY_MEMBERS (\ 591 ACPI_DISASM_ONLY_MEMBERS (\
573 u8 disasm_flags; /* Used during AML disassembly */\ 592 u8 disasm_flags; /* Used during AML disassembly */\
574 u8 disasm_opcode; /* Subtype used for disassembly */\ 593 u8 disasm_opcode; /* Subtype used for disassembly */\
575 char aml_op_name[16]) /* Op name (debug only) */\ 594 char aml_op_name[16]) /* Op name (debug only) */
576 /* NON-DEBUG members below: */\ 595
577 struct acpi_namespace_node *node; /* For use by interpreter */\ 596#define ACPI_DASM_BUFFER 0x00
578 union acpi_parse_value value; /* Value or args associated with the opcode */ 597#define ACPI_DASM_RESOURCE 0x01
579 598#define ACPI_DASM_STRING 0x02
580#define ACPI_DASM_BUFFER 0x00 599#define ACPI_DASM_UNICODE 0x03
581#define ACPI_DASM_RESOURCE 0x01 600#define ACPI_DASM_EISAID 0x04
582#define ACPI_DASM_STRING 0x02 601#define ACPI_DASM_MATCHOP 0x05
583#define ACPI_DASM_UNICODE 0x03 602#define ACPI_DASM_LNOT_PREFIX 0x06
584#define ACPI_DASM_EISAID 0x04 603#define ACPI_DASM_LNOT_SUFFIX 0x07
585#define ACPI_DASM_MATCHOP 0x05 604#define ACPI_DASM_IGNORE 0x08
586 605
587/* 606/*
588 * generic operation (for example: If, While, Store) 607 * Generic operation (for example: If, While, Store)
589 */ 608 */
590struct acpi_parse_obj_common { 609struct acpi_parse_obj_common {
591ACPI_PARSE_COMMON}; 610ACPI_PARSE_COMMON};
@@ -601,7 +620,7 @@ struct acpi_parse_obj_named {
601 u32 name; /* 4-byte name or zero if no name */ 620 u32 name; /* 4-byte name or zero if no name */
602}; 621};
603 622
604/* The parse node is the fundamental element of the parse tree */ 623/* This version is used by the i_aSL compiler only */
605 624
606#define ACPI_MAX_PARSEOP_NAME 20 625#define ACPI_MAX_PARSEOP_NAME 20
607 626
@@ -643,7 +662,6 @@ union acpi_parse_object {
643 * method. 662 * method.
644 */ 663 */
645struct acpi_parse_state { 664struct acpi_parse_state {
646 u32 aml_size;
647 u8 *aml_start; /* First AML byte */ 665 u8 *aml_start; /* First AML byte */
648 u8 *aml; /* Next AML byte */ 666 u8 *aml; /* Next AML byte */
649 u8 *aml_end; /* (last + 1) AML byte */ 667 u8 *aml_end; /* (last + 1) AML byte */
@@ -653,22 +671,23 @@ struct acpi_parse_state {
653 struct acpi_namespace_node *start_node; 671 struct acpi_namespace_node *start_node;
654 union acpi_generic_state *scope; /* Current scope */ 672 union acpi_generic_state *scope; /* Current scope */
655 union acpi_parse_object *start_scope; 673 union acpi_parse_object *start_scope;
674 u32 aml_size;
656}; 675};
657 676
658/* Parse object flags */ 677/* Parse object flags */
659 678
660#define ACPI_PARSEOP_GENERIC 0x01 679#define ACPI_PARSEOP_GENERIC 0x01
661#define ACPI_PARSEOP_NAMED 0x02 680#define ACPI_PARSEOP_NAMED 0x02
662#define ACPI_PARSEOP_DEFERRED 0x04 681#define ACPI_PARSEOP_DEFERRED 0x04
663#define ACPI_PARSEOP_BYTELIST 0x08 682#define ACPI_PARSEOP_BYTELIST 0x08
664#define ACPI_PARSEOP_IN_CACHE 0x80 683#define ACPI_PARSEOP_IN_CACHE 0x80
665 684
666/* Parse object disasm_flags */ 685/* Parse object disasm_flags */
667 686
668#define ACPI_PARSEOP_IGNORE 0x01 687#define ACPI_PARSEOP_IGNORE 0x01
669#define ACPI_PARSEOP_PARAMLIST 0x02 688#define ACPI_PARSEOP_PARAMLIST 0x02
670#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 689#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
671#define ACPI_PARSEOP_SPECIAL 0x10 690#define ACPI_PARSEOP_SPECIAL 0x10
672 691
673/***************************************************************************** 692/*****************************************************************************
674 * 693 *
@@ -676,8 +695,8 @@ struct acpi_parse_state {
676 * 695 *
677 ****************************************************************************/ 696 ****************************************************************************/
678 697
679#define PCI_ROOT_HID_STRING "PNP0A03" 698#define PCI_ROOT_HID_STRING "PNP0A03"
680#define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" 699#define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08"
681 700
682struct acpi_bit_register_info { 701struct acpi_bit_register_info {
683 u8 parent_register; 702 u8 parent_register;
@@ -710,13 +729,14 @@ struct acpi_bit_register_info {
710#define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ 729#define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */
711#define ACPI_BITMASK_WAKE_STATUS 0x8000 730#define ACPI_BITMASK_WAKE_STATUS 0x8000
712 731
713#define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \ 732#define ACPI_BITMASK_ALL_FIXED_STATUS (\
714 ACPI_BITMASK_BUS_MASTER_STATUS | \ 733 ACPI_BITMASK_TIMER_STATUS | \
715 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ 734 ACPI_BITMASK_BUS_MASTER_STATUS | \
716 ACPI_BITMASK_POWER_BUTTON_STATUS | \ 735 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \
717 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ 736 ACPI_BITMASK_POWER_BUTTON_STATUS | \
718 ACPI_BITMASK_RT_CLOCK_STATUS | \ 737 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
719 ACPI_BITMASK_WAKE_STATUS) 738 ACPI_BITMASK_RT_CLOCK_STATUS | \
739 ACPI_BITMASK_WAKE_STATUS)
720 740
721#define ACPI_BITMASK_TIMER_ENABLE 0x0001 741#define ACPI_BITMASK_TIMER_ENABLE 0x0001
722#define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 742#define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020
@@ -820,7 +840,7 @@ struct acpi_bit_register_info {
820 * 840 *
821 ****************************************************************************/ 841 ****************************************************************************/
822 842
823#define ACPI_ASCII_ZERO 0x30 843#define ACPI_ASCII_ZERO 0x30
824 844
825/***************************************************************************** 845/*****************************************************************************
826 * 846 *
@@ -842,9 +862,9 @@ struct acpi_integrity_info {
842 u32 objects; 862 u32 objects;
843}; 863};
844 864
845#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 865#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
846#define ACPI_DB_CONSOLE_OUTPUT 0x02 866#define ACPI_DB_CONSOLE_OUTPUT 0x02
847#define ACPI_DB_DUPLICATE_OUTPUT 0x03 867#define ACPI_DB_DUPLICATE_OUTPUT 0x03
848 868
849/***************************************************************************** 869/*****************************************************************************
850 * 870 *
@@ -854,18 +874,18 @@ struct acpi_integrity_info {
854 874
855/* Entry for a memory allocation (debug only) */ 875/* Entry for a memory allocation (debug only) */
856 876
857#define ACPI_MEM_MALLOC 0 877#define ACPI_MEM_MALLOC 0
858#define ACPI_MEM_CALLOC 1 878#define ACPI_MEM_CALLOC 1
859#define ACPI_MAX_MODULE_NAME 16 879#define ACPI_MAX_MODULE_NAME 16
860 880
861#define ACPI_COMMON_DEBUG_MEM_HEADER \ 881#define ACPI_COMMON_DEBUG_MEM_HEADER \
862 struct acpi_debug_mem_block *previous; \ 882 struct acpi_debug_mem_block *previous; \
863 struct acpi_debug_mem_block *next; \ 883 struct acpi_debug_mem_block *next; \
864 u32 size; \ 884 u32 size; \
865 u32 component; \ 885 u32 component; \
866 u32 line; \ 886 u32 line; \
867 char module[ACPI_MAX_MODULE_NAME]; \ 887 char module[ACPI_MAX_MODULE_NAME]; \
868 u8 alloc_type; 888 u8 alloc_type;
869 889
870struct acpi_debug_mem_header { 890struct acpi_debug_mem_header {
871ACPI_COMMON_DEBUG_MEM_HEADER}; 891ACPI_COMMON_DEBUG_MEM_HEADER};
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index f2be2a881730..38f9aa4bef00 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -56,6 +56,10 @@
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 58
59/* Size calculation */
60
61#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
62
59#if ACPI_MACHINE_WIDTH == 16 63#if ACPI_MACHINE_WIDTH == 16
60 64
61/* 65/*
@@ -99,7 +103,7 @@
99 * printf() format helpers 103 * printf() format helpers
100 */ 104 */
101 105
102/* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */ 106/* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */
103 107
104#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) 108#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i)
105 109
@@ -130,7 +134,6 @@
130#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) 134#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i)
131#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) 135#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL)
132#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) 136#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
133#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f)
134 137
135#if ACPI_MACHINE_WIDTH == 16 138#if ACPI_MACHINE_WIDTH == 16
136#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) 139#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s)
@@ -141,6 +144,12 @@
141#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) 144#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
142#endif 145#endif
143 146
147#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
148#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b)))
149#else
150#define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char,(a)), ACPI_CAST_PTR (char,(b)), ACPI_NAME_SIZE))
151#endif
152
144/* 153/*
145 * Macros for moving data around to/from buffers that are possibly unaligned. 154 * Macros for moving data around to/from buffers that are possibly unaligned.
146 * If the hardware supports the transfer of unaligned data, just do the store. 155 * If the hardware supports the transfer of unaligned data, just do the store.
@@ -341,29 +350,33 @@
341/* 350/*
342 * Rounding macros (Power of two boundaries only) 351 * Rounding macros (Power of two boundaries only)
343 */ 352 */
344#define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \ 353#define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \
345 (~(((acpi_native_uint) boundary)-1))) 354 (~(((acpi_native_uint) boundary)-1)))
346 355
347#define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \ 356#define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \
348 (((acpi_native_uint) boundary)-1)) & \ 357 (((acpi_native_uint) boundary)-1)) & \
349 (~(((acpi_native_uint) boundary)-1))) 358 (~(((acpi_native_uint) boundary)-1)))
350 359
351#define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4) 360/* Note: sizeof(acpi_native_uint) evaluates to either 2, 4, or 8 */
352#define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8) 361
353#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,ALIGNED_ADDRESS_BOUNDARY) 362#define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a,4)
363#define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a,8)
364#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(acpi_native_uint))
354 365
355#define ACPI_ROUND_UP_to_32_bITS(a) ACPI_ROUND_UP(a,4) 366#define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a,4)
356#define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8) 367#define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a,8)
357#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) 368#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(acpi_native_uint))
358 369
359#define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) 370#define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7)
360#define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) 371#define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a))
361 372
362#define ACPI_ROUND_UP_TO_1K(a) (((a) + 1023) >> 10) 373#define ACPI_ROUND_UP_TO_1K(a) (((a) + 1023) >> 10)
363 374
364/* Generic (non-power-of-two) rounding */ 375/* Generic (non-power-of-two) rounding */
365 376
366#define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) 377#define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary))
378
379#define ACPI_IS_MISALIGNED(value) (((acpi_native_uint)value) & (sizeof(acpi_native_uint)-1))
367 380
368/* 381/*
369 * Bitmask creation 382 * Bitmask creation
@@ -371,10 +384,10 @@
371 * MASK_BITS_ABOVE creates a mask starting AT the position and above 384 * MASK_BITS_ABOVE creates a mask starting AT the position and above
372 * MASK_BITS_BELOW creates a mask starting one bit BELOW the position 385 * MASK_BITS_BELOW creates a mask starting one bit BELOW the position
373 */ 386 */
374#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((u32) (position)))) 387#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((u32) (position))))
375#define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((u32) (position))) 388#define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((u32) (position)))
376 389
377#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) 390#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7'))
378 391
379/* Bitfields within ACPI registers */ 392/* Bitfields within ACPI registers */
380 393
@@ -396,8 +409,8 @@
396 * 409 *
397 * The "Descriptor" field is the first field in both structures. 410 * The "Descriptor" field is the first field in both structures.
398 */ 411 */
399#define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id) 412#define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type)
400#define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t) 413#define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t)
401 414
402/* Macro to test the object type */ 415/* Macro to test the object type */
403 416
@@ -486,7 +499,6 @@
486#define ACPI_ERROR(plist) 499#define ACPI_ERROR(plist)
487#define ACPI_ERROR_NAMESPACE(s,e) 500#define ACPI_ERROR_NAMESPACE(s,e)
488#define ACPI_ERROR_METHOD(s,n,p,e) 501#define ACPI_ERROR_METHOD(s,n,p,e)
489
490#endif 502#endif
491 503
492/* 504/*
@@ -514,12 +526,12 @@
514#define ACPI_GET_FUNCTION_NAME _acpi_function_name 526#define ACPI_GET_FUNCTION_NAME _acpi_function_name
515/* 527/*
516 * The Name parameter should be the procedure name as a quoted string. 528 * The Name parameter should be the procedure name as a quoted string.
517 * This is declared as a local string ("my_function_name") so that it can 529 * This is declared as a local string ("MyFunctionName") so that it can
518 * be also used by the function exit macros below. 530 * be also used by the function exit macros below.
519 * Note: (const char) is used to be compatible with the debug interfaces 531 * Note: (const char) is used to be compatible with the debug interfaces
520 * and macros such as __FUNCTION__. 532 * and macros such as __FUNCTION__.
521 */ 533 */
522#define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = name; 534#define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = #name;
523 535
524#else 536#else
525/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ 537/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
@@ -528,13 +540,13 @@
528#endif 540#endif
529 541
530#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ 542#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
531 acpi_ut_trace(ACPI_DEBUG_PARAMETERS) 543 acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
532#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ 544#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \
533 acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) 545 acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b)
534#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ 546#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \
535 acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b) 547 acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b)
536#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ 548#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \
537 acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b) 549 acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b)
538 550
539#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() 551#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr()
540 552
@@ -543,7 +555,7 @@
543 * WARNING: These macros include a return statement. This is usually considered 555 * WARNING: These macros include a return statement. This is usually considered
544 * bad form, but having a separate exit macro is very ugly and difficult to maintain. 556 * bad form, but having a separate exit macro is very ugly and difficult to maintain.
545 * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros 557 * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
546 * so that "_acpi_function_name" is defined. 558 * so that "_AcpiFunctionName" is defined.
547 * 559 *
548 * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining 560 * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining
549 * about these constructs. 561 * about these constructs.
@@ -654,6 +666,7 @@
654#define ACPI_DUMP_STACK_ENTRY(a) 666#define ACPI_DUMP_STACK_ENTRY(a)
655#define ACPI_DUMP_OPERANDS(a,b,c,d,e) 667#define ACPI_DUMP_OPERANDS(a,b,c,d,e)
656#define ACPI_DUMP_ENTRY(a,b) 668#define ACPI_DUMP_ENTRY(a,b)
669#define ACPI_DUMP_TABLES(a,b)
657#define ACPI_DUMP_PATHNAME(a,b,c,d) 670#define ACPI_DUMP_PATHNAME(a,b,c,d)
658#define ACPI_DUMP_RESOURCE_LIST(a) 671#define ACPI_DUMP_RESOURCE_LIST(a)
659#define ACPI_DUMP_BUFFER(a,b) 672#define ACPI_DUMP_BUFFER(a,b)
@@ -709,19 +722,19 @@
709 722
710/* Memory allocation */ 723/* Memory allocation */
711 724
712#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) 725#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
713#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) 726#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
714#define ACPI_MEM_FREE(a) acpi_os_free(a) 727#define ACPI_FREE(a) acpi_os_free(a)
715#define ACPI_MEM_TRACKING(a) 728#define ACPI_MEM_TRACKING(a)
716 729
717#else 730#else
718 731
719/* Memory allocation */ 732/* Memory allocation */
720 733
721#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) 734#define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
722#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) 735#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
723#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) 736#define ACPI_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__)
724#define ACPI_MEM_TRACKING(a) a 737#define ACPI_MEM_TRACKING(a) a
725 738
726#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ 739#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
727 740
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index b667a804fc8a..83b52f9f899a 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -63,6 +63,8 @@
63#define ACPI_NS_DONT_OPEN_SCOPE 0x02 63#define ACPI_NS_DONT_OPEN_SCOPE 0x02
64#define ACPI_NS_NO_PEER_SEARCH 0x04 64#define ACPI_NS_NO_PEER_SEARCH 0x04
65#define ACPI_NS_ERROR_IF_FOUND 0x08 65#define ACPI_NS_ERROR_IF_FOUND 0x08
66#define ACPI_NS_PREFIX_IS_SCOPE 0x10
67#define ACPI_NS_EXTERNAL 0x20
66 68
67#define ACPI_NS_WALK_UNLOCK TRUE 69#define ACPI_NS_WALK_UNLOCK TRUE
68#define ACPI_NS_WALK_NO_UNLOCK FALSE 70#define ACPI_NS_WALK_NO_UNLOCK FALSE
@@ -171,19 +173,17 @@ acpi_ns_dump_objects(acpi_object_type type,
171/* 173/*
172 * nseval - Namespace evaluation functions 174 * nseval - Namespace evaluation functions
173 */ 175 */
174acpi_status acpi_ns_evaluate_by_handle(struct acpi_parameter_info *info); 176acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);
175
176acpi_status
177acpi_ns_evaluate_by_name(char *pathname, struct acpi_parameter_info *info);
178
179acpi_status
180acpi_ns_evaluate_relative(char *pathname, struct acpi_parameter_info *info);
181 177
182/* 178/*
183 * nsnames - Name and Scope manipulation 179 * nsnames - Name and Scope manipulation
184 */ 180 */
185u32 acpi_ns_opens_scope(acpi_object_type type); 181u32 acpi_ns_opens_scope(acpi_object_type type);
186 182
183void
184acpi_ns_build_external_path(struct acpi_namespace_node *node,
185 acpi_size size, char *name_buffer);
186
187char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node); 187char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node);
188 188
189char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state); 189char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state);
@@ -196,9 +196,9 @@ u8
196acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for); 196acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for);
197 197
198acpi_status 198acpi_status
199acpi_ns_get_node_by_path(char *external_pathname, 199acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
200 struct acpi_namespace_node *in_prefix_node, 200 char *external_pathname,
201 u32 flags, struct acpi_namespace_node **out_node); 201 u32 flags, struct acpi_namespace_node **out_node);
202 202
203acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node); 203acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node);
204 204
@@ -241,10 +241,10 @@ acpi_ns_search_and_enter(u32 entry_name,
241 u32 flags, struct acpi_namespace_node **ret_node); 241 u32 flags, struct acpi_namespace_node **ret_node);
242 242
243acpi_status 243acpi_status
244acpi_ns_search_node(u32 entry_name, 244acpi_ns_search_one_scope(u32 entry_name,
245 struct acpi_namespace_node *node, 245 struct acpi_namespace_node *node,
246 acpi_object_type type, 246 acpi_object_type type,
247 struct acpi_namespace_node **ret_node); 247 struct acpi_namespace_node **ret_node);
248 248
249void 249void
250acpi_ns_install_node(struct acpi_walk_state *walk_state, 250acpi_ns_install_node(struct acpi_walk_state *walk_state,
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index d130cfed8d55..1747d94084d8 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -1,7 +1,7 @@
1 1
2/****************************************************************************** 2/******************************************************************************
3 * 3 *
4 * Name: acobject.h - Definition of union acpi_operand_object (Internal object only) 4 * Name: acobject.h - Definition of union acpi_operand_object (Internal object only)
5 * 5 *
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
@@ -45,10 +45,12 @@
45#ifndef _ACOBJECT_H 45#ifndef _ACOBJECT_H
46#define _ACOBJECT_H 46#define _ACOBJECT_H
47 47
48/* acpisrc:struct_defs -- for acpisrc conversion */
49
48/* 50/*
49 * The union acpi_operand_object is used to pass AML operands from the dispatcher 51 * The union acpi_operand_object is used to pass AML operands from the dispatcher
50 * 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
51 * address space handlers and notify handlers. The object is a constant 53 * address space handlers and notify handlers. The object is a constant
52 * size in order to allow it to be cached and reused. 54 * size in order to allow it to be cached and reused.
53 */ 55 */
54 56
@@ -61,17 +63,25 @@
61/* 63/*
62 * Common area for all objects. 64 * Common area for all objects.
63 * 65 *
64 * data_type is used to differentiate between internal descriptors, and MUST 66 * descriptor_type is used to differentiate between internal descriptors, and
65 * be the first byte in this structure. 67 * must be in the same place across all descriptors
68 *
69 * Note: The descriptor_type and Type fields must appear in the identical
70 * position in both the struct acpi_namespace_node and union acpi_operand_object
71 * structures.
66 */ 72 */
67#define ACPI_OBJECT_COMMON_HEADER /* SIZE/ALIGNMENT: 32 bits, one ptr plus trailing 8-bit flag */\ 73#define ACPI_OBJECT_COMMON_HEADER \
68 u8 descriptor; /* To differentiate various internal objs */\ 74 union acpi_operand_object *next_object; /* Objects linked to parent NS node */\
69 u8 type; /* acpi_object_type */\ 75 u8 descriptor_type; /* To differentiate various internal objs */\
70 u16 reference_count; /* For object deletion management */\ 76 u8 type; /* acpi_object_type */\
71 union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ 77 u16 reference_count; /* For object deletion management */\
72 u8 flags; 78 u8 flags;
73 79 /*
74/* Values for flag byte above */ 80 * Note: There are 3 bytes available here before the
81 * next natural alignment boundary (for both 32/64 cases)
82 */
83
84/* Values for Flag byte above */
75 85
76#define AOPOBJ_AML_CONSTANT 0x01 86#define AOPOBJ_AML_CONSTANT 0x01
77#define AOPOBJ_STATIC_POINTER 0x02 87#define AOPOBJ_STATIC_POINTER 0x02
@@ -79,36 +89,7 @@
79#define AOPOBJ_OBJECT_INITIALIZED 0x08 89#define AOPOBJ_OBJECT_INITIALIZED 0x08
80#define AOPOBJ_SETUP_COMPLETE 0x10 90#define AOPOBJ_SETUP_COMPLETE 0x10
81#define AOPOBJ_SINGLE_DATUM 0x20 91#define AOPOBJ_SINGLE_DATUM 0x20
82 92#define AOPOBJ_INVALID 0x40 /* Used if host OS won't allow an op_region address */
83/*
84 * Common bitfield for the field objects
85 * "Field Datum" -- a datum from the actual field object
86 * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field
87 */
88#define ACPI_COMMON_FIELD_INFO /* SIZE/ALIGNMENT: 24 bits + three 32-bit values */\
89 u8 field_flags; /* Access, update, and lock bits */\
90 u8 attribute; /* From access_as keyword */\
91 u8 access_byte_width; /* Read/Write size in bytes */\
92 u32 bit_length; /* Length of field in bits */\
93 u32 base_byte_offset; /* Byte offset within containing object */\
94 u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\
95 u8 access_bit_width; /* Read/Write size in bits (8-64) */\
96 u32 value; /* Value to store into the Bank or Index register */\
97 struct acpi_namespace_node *node; /* Link back to parent node */
98
99/*
100 * Fields common to both Strings and Buffers
101 */
102#define ACPI_COMMON_BUFFER_INFO \
103 u32 length;
104
105/*
106 * Common fields for objects that support ASL notifications
107 */
108#define ACPI_COMMON_NOTIFY_INFO \
109 union acpi_operand_object *system_notify; /* Handler for system notifies */\
110 union acpi_operand_object *device_notify; /* Handler for driver notifies */\
111 union acpi_operand_object *handler; /* Handler for Address space */
112 93
113/****************************************************************************** 94/******************************************************************************
114 * 95 *
@@ -125,25 +106,31 @@ struct acpi_object_integer {
125 106
126/* 107/*
127 * Note: The String and Buffer object must be identical through the Pointer 108 * Note: The String and Buffer object must be identical through the Pointer
128 * element. There is code that depends on this. 109 * and length elements. There is code that depends on this.
110 *
111 * Fields common to both Strings and Buffers
129 */ 112 */
113#define ACPI_COMMON_BUFFER_INFO(_type) \
114 _type *pointer; \
115 u32 length;
116
130struct acpi_object_string { /* Null terminated, ASCII characters only */ 117struct acpi_object_string { /* Null terminated, ASCII characters only */
131 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO char *pointer; /* String in AML stream or allocated string */ 118 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO(char) /* String in AML stream or allocated string */
132}; 119};
133 120
134struct acpi_object_buffer { 121struct acpi_object_buffer {
135 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO u8 * pointer; /* Buffer in AML stream or allocated buffer */ 122 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO(u8) /* Buffer in AML stream or allocated buffer */
136 struct acpi_namespace_node *node; /* Link back to parent node */
137 u8 *aml_start;
138 u32 aml_length; 123 u32 aml_length;
124 u8 *aml_start;
125 struct acpi_namespace_node *node; /* Link back to parent node */
139}; 126};
140 127
141struct acpi_object_package { 128struct acpi_object_package {
142 ACPI_OBJECT_COMMON_HEADER u32 count; /* # of elements in package */ 129 ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Link back to parent node */
143 u32 aml_length;
144 u8 *aml_start;
145 struct acpi_namespace_node *node; /* Link back to parent node */
146 union acpi_operand_object **elements; /* Array of pointers to acpi_objects */ 130 union acpi_operand_object **elements; /* Array of pointers to acpi_objects */
131 u8 *aml_start;
132 u32 aml_length;
133 u32 count; /* # of elements in package */
147}; 134};
148 135
149/****************************************************************************** 136/******************************************************************************
@@ -156,23 +143,6 @@ struct acpi_object_event {
156 ACPI_OBJECT_COMMON_HEADER void *semaphore; 143 ACPI_OBJECT_COMMON_HEADER void *semaphore;
157}; 144};
158 145
159#define ACPI_INFINITE_CONCURRENCY 0xFF
160
161typedef
162acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state);
163
164struct acpi_object_method {
165 ACPI_OBJECT_COMMON_HEADER u8 method_flags;
166 u8 param_count;
167 u32 aml_length;
168 void *semaphore;
169 u8 *aml_start;
170 ACPI_INTERNAL_METHOD implementation;
171 u8 concurrency;
172 u8 thread_count;
173 acpi_owner_id owner_id;
174};
175
176struct acpi_object_mutex { 146struct acpi_object_mutex {
177 ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ 147 ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */
178 u16 acquisition_depth; /* Allow multiple Acquires, same thread */ 148 u16 acquisition_depth; /* Allow multiple Acquires, same thread */
@@ -186,11 +156,23 @@ struct acpi_object_mutex {
186 156
187struct acpi_object_region { 157struct acpi_object_region {
188 ACPI_OBJECT_COMMON_HEADER u8 space_id; 158 ACPI_OBJECT_COMMON_HEADER u8 space_id;
189 union acpi_operand_object *handler; /* Handler for region access */
190 struct acpi_namespace_node *node; /* Containing namespace node */ 159 struct acpi_namespace_node *node; /* Containing namespace node */
160 union acpi_operand_object *handler; /* Handler for region access */
191 union acpi_operand_object *next; 161 union acpi_operand_object *next;
192 u32 length;
193 acpi_physical_address address; 162 acpi_physical_address address;
163 u32 length;
164};
165
166struct acpi_object_method {
167 ACPI_OBJECT_COMMON_HEADER u8 method_flags;
168 u8 param_count;
169 u8 concurrency;
170 void *semaphore;
171 u8 *aml_start;
172 ACPI_INTERNAL_METHOD implementation;
173 u32 aml_length;
174 u8 thread_count;
175 acpi_owner_id owner_id;
194}; 176};
195 177
196/****************************************************************************** 178/******************************************************************************
@@ -199,6 +181,14 @@ struct acpi_object_region {
199 * 181 *
200 *****************************************************************************/ 182 *****************************************************************************/
201 183
184/*
185 * Common fields for objects that support ASL notifications
186 */
187#define ACPI_COMMON_NOTIFY_INFO \
188 union acpi_operand_object *system_notify; /* Handler for system notifies */\
189 union acpi_operand_object *device_notify; /* Handler for driver notifies */\
190 union acpi_operand_object *handler; /* Handler for Address space */
191
202struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ 192struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */
203ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; 193ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO};
204 194
@@ -213,9 +203,9 @@ struct acpi_object_power_resource {
213}; 203};
214 204
215struct acpi_object_processor { 205struct acpi_object_processor {
216 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO u32 proc_id; 206 ACPI_OBJECT_COMMON_HEADER u8 proc_id;
217 u32 length; 207 u8 length;
218 acpi_io_address address; 208 ACPI_COMMON_NOTIFY_INFO acpi_io_address address;
219}; 209};
220 210
221struct acpi_object_thermal_zone { 211struct acpi_object_thermal_zone {
@@ -227,9 +217,24 @@ ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO};
227 * 217 *
228 *****************************************************************************/ 218 *****************************************************************************/
229 219
220/*
221 * Common bitfield for the field objects
222 * "Field Datum" -- a datum from the actual field object
223 * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field
224 */
225#define ACPI_COMMON_FIELD_INFO \
226 u8 field_flags; /* Access, update, and lock bits */\
227 u8 attribute; /* From access_as keyword */\
228 u8 access_byte_width; /* Read/Write size in bytes */\
229 struct acpi_namespace_node *node; /* Link back to parent node */\
230 u32 bit_length; /* Length of field in bits */\
231 u32 base_byte_offset; /* Byte offset within containing object */\
232 u32 value; /* Value to store into the Bank or Index register */\
233 u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\
234 u8 access_bit_width; /* Read/Write size in bits (8-64) */
235
230struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ 236struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
231 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing Operation Region object */ 237 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Parent Operation Region object (REGION/BANK fields only) */
232 /* (REGION/BANK fields only) */
233}; 238};
234 239
235struct acpi_object_region_field { 240struct acpi_object_region_field {
@@ -244,7 +249,7 @@ struct acpi_object_bank_field {
244struct acpi_object_index_field { 249struct acpi_object_index_field {
245 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO 250 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO
246 /* 251 /*
247 * No "region_obj" pointer needed since the Index and Data registers 252 * No "RegionObj" pointer needed since the Index and Data registers
248 * are each field definitions unto themselves. 253 * are each field definitions unto themselves.
249 */ 254 */
250 union acpi_operand_object *index_obj; /* Index register */ 255 union acpi_operand_object *index_obj; /* Index register */
@@ -269,13 +274,9 @@ struct acpi_object_notify_handler {
269 void *context; 274 void *context;
270}; 275};
271 276
272/* Flags for address handler */
273
274#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x1
275
276struct acpi_object_addr_handler { 277struct acpi_object_addr_handler {
277 ACPI_OBJECT_COMMON_HEADER u8 space_id; 278 ACPI_OBJECT_COMMON_HEADER u8 space_id;
278 u16 hflags; 279 u8 handler_flags;
279 acpi_adr_space_handler handler; 280 acpi_adr_space_handler handler;
280 struct acpi_namespace_node *node; /* Parent device */ 281 struct acpi_namespace_node *node; /* Parent device */
281 void *context; 282 void *context;
@@ -284,6 +285,10 @@ struct acpi_object_addr_handler {
284 union acpi_operand_object *next; 285 union acpi_operand_object *next;
285}; 286};
286 287
288/* Flags for address handler (handler_flags) */
289
290#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x01
291
287/****************************************************************************** 292/******************************************************************************
288 * 293 *
289 * Special internal objects 294 * Special internal objects
@@ -297,10 +302,10 @@ struct acpi_object_addr_handler {
297struct acpi_object_reference { 302struct acpi_object_reference {
298 ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */ 303 ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */
299 u16 opcode; 304 u16 opcode;
300 u32 offset; /* Used for arg_op, local_op, and index_op */ 305 void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */
301 void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */
302 struct acpi_namespace_node *node; 306 struct acpi_namespace_node *node;
303 union acpi_operand_object **where; 307 union acpi_operand_object **where;
308 u32 offset; /* Used for arg_op, local_op, and index_op */
304}; 309};
305 310
306/* 311/*
@@ -311,12 +316,10 @@ struct acpi_object_reference {
311 * Currently: Region and field_unit types 316 * Currently: Region and field_unit types
312 */ 317 */
313struct acpi_object_extra { 318struct acpi_object_extra {
314 ACPI_OBJECT_COMMON_HEADER u8 byte_fill1; 319 ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */
315 u16 word_fill1;
316 u32 aml_length;
317 u8 *aml_start;
318 struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */
319 void *region_context; /* Region-specific data */ 320 void *region_context; /* Region-specific data */
321 u8 *aml_start;
322 u32 aml_length;
320}; 323};
321 324
322/* Additional data that can be attached to namespace nodes */ 325/* Additional data that can be attached to namespace nodes */
@@ -391,8 +394,13 @@ union acpi_operand_object {
391#define ACPI_DESC_TYPE_NAMED 0x0F 394#define ACPI_DESC_TYPE_NAMED 0x0F
392#define ACPI_DESC_TYPE_MAX 0x0F 395#define ACPI_DESC_TYPE_MAX 0x0F
393 396
397struct acpi_common_descriptor {
398 void *common_pointer;
399 u8 descriptor_type; /* To differentiate various internal objs */
400};
401
394union acpi_descriptor { 402union acpi_descriptor {
395 u8 descriptor_id; /* To differentiate various internal objs */ 403 struct acpi_common_descriptor common;
396 union acpi_operand_object object; 404 union acpi_operand_object object;
397 struct acpi_namespace_node node; 405 struct acpi_namespace_node node;
398 union acpi_parse_object op; 406 union acpi_parse_object op;
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h
index e6d78bd9e90a..7659a46bc432 100644
--- a/include/acpi/acopcode.h
+++ b/include/acpi/acopcode.h
@@ -94,7 +94,7 @@
94#define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) 94#define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
95#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME) 95#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME)
96#define ARGP_CONTINUE_OP ARG_NONE 96#define ARGP_CONTINUE_OP ARG_NONE
97#define ARGP_COPY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SIMPLENAME) 97#define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME)
98#define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) 98#define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
99#define ARGP_CREATE_BYTE_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) 99#define ARGP_CREATE_BYTE_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
100#define ARGP_CREATE_DWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) 100#define ARGP_CREATE_DWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 7785d481dc3e..8d5039d0b430 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -50,7 +50,7 @@
50 * component basis and a per-exception-type basis. 50 * component basis and a per-exception-type basis.
51 */ 51 */
52 52
53/* Component IDs are used in the global "debug_layer" */ 53/* Component IDs are used in the global "DebugLayer" */
54 54
55#define ACPI_UTILITIES 0x00000001 55#define ACPI_UTILITIES 0x00000001
56#define ACPI_HARDWARE 0x00000002 56#define ACPI_HARDWARE 0x00000002
@@ -121,7 +121,7 @@
121#define ACPI_LV_INTERRUPTS 0x08000000 121#define ACPI_LV_INTERRUPTS 0x08000000
122#define ACPI_LV_VERBOSITY3 0x0F000000 | ACPI_LV_VERBOSITY2 122#define ACPI_LV_VERBOSITY3 0x0F000000 | ACPI_LV_VERBOSITY2
123 123
124/* Exceptionally verbose output -- also used in the global "debug_level" */ 124/* Exceptionally verbose output -- also used in the global "DebugLevel" */
125 125
126#define ACPI_LV_AML_DISASSEMBLE 0x10000000 126#define ACPI_LV_AML_DISASSEMBLE 0x10000000
127#define ACPI_LV_VERBOSE_INFO 0x20000000 127#define ACPI_LV_VERBOSE_INFO 0x20000000
@@ -135,7 +135,7 @@
135 */ 135 */
136#define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS 136#define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS
137 137
138/* Exception level -- used in the global "debug_level" */ 138/* Exception level -- used in the global "DebugLevel" */
139 139
140#define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) 140#define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT)
141#define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) 141#define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT)
@@ -144,13 +144,13 @@
144 144
145/* 145/*
146 * These two levels are essentially obsolete, all instances in the 146 * These two levels are essentially obsolete, all instances in the
147 * ACPICA core code have been replaced by REPORT_ERROR and REPORT_WARNING 147 * ACPICA core code have been replaced by ACPI_ERROR and ACPI_WARNING
148 * (Kept here because some drivers may still use them) 148 * (Kept here because some drivers may still use them)
149 */ 149 */
150#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) 150#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR)
151#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN) 151#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN)
152 152
153/* Trace level -- also used in the global "debug_level" */ 153/* Trace level -- also used in the global "DebugLevel" */
154 154
155#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) 155#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES)
156#define ACPI_DB_THREADS ACPI_DEBUG_LEVEL (ACPI_LV_THREADS) 156#define ACPI_DB_THREADS ACPI_DEBUG_LEVEL (ACPI_LV_THREADS)
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index 5a1ff484af33..9d49d3c41cd9 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -46,7 +46,7 @@
46 46
47#define OP_HAS_RETURN_VALUE 1 47#define OP_HAS_RETURN_VALUE 1
48 48
49/* variable # arguments */ 49/* Variable number of arguments. This field must be 32 bits */
50 50
51#define ACPI_VAR_ARGS ACPI_UINT32_MAX 51#define ACPI_VAR_ARGS ACPI_UINT32_MAX
52 52
@@ -71,7 +71,7 @@
71/* 71/*
72 * psxface - Parser external interfaces 72 * psxface - Parser external interfaces
73 */ 73 */
74acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info); 74acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info);
75 75
76/* 76/*
77 * psargs - Parse AML opcode arguments 77 * psargs - Parse AML opcode arguments
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 6dca3d542080..a2b3e390a503 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -26,7 +26,7 @@
26#ifndef __ACPI_BUS_H__ 26#ifndef __ACPI_BUS_H__
27#define __ACPI_BUS_H__ 27#define __ACPI_BUS_H__
28 28
29#include <linux/kobject.h> 29#include <linux/device.h>
30 30
31#include <acpi/acpi.h> 31#include <acpi/acpi.h>
32 32
@@ -59,7 +59,7 @@ 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 FADT_DESCRIPTOR acpi_fadt; 62extern struct fadt_descriptor acpi_fadt;
63 63
64enum acpi_bus_removal_type { 64enum acpi_bus_removal_type {
65 ACPI_BUS_REMOVAL_NORMAL = 0, 65 ACPI_BUS_REMOVAL_NORMAL = 0,
@@ -169,7 +169,8 @@ struct acpi_device_flags {
169 u32 power_manageable:1; 169 u32 power_manageable:1;
170 u32 performance_manageable:1; 170 u32 performance_manageable:1;
171 u32 wake_capable:1; /* Wakeup(_PRW) supported? */ 171 u32 wake_capable:1; /* Wakeup(_PRW) supported? */
172 u32 reserved:20; 172 u32 force_power_state:1;
173 u32 reserved:19;
173}; 174};
174 175
175/* File System */ 176/* File System */
@@ -296,6 +297,7 @@ struct acpi_device {
296 struct acpi_driver *driver; 297 struct acpi_driver *driver;
297 void *driver_data; 298 void *driver_data;
298 struct kobject kobj; 299 struct kobject kobj;
300 struct device dev;
299}; 301};
300 302
301#define acpi_driver_data(d) ((d)->driver_data) 303#define acpi_driver_data(d) ((d)->driver_data)
@@ -327,7 +329,7 @@ int acpi_bus_set_power(acpi_handle handle, int state);
327int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data); 329int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data);
328int acpi_bus_receive_event(struct acpi_bus_event *event); 330int acpi_bus_receive_event(struct acpi_bus_event *event);
329int acpi_bus_register_driver(struct acpi_driver *driver); 331int acpi_bus_register_driver(struct acpi_driver *driver);
330int acpi_bus_unregister_driver(struct acpi_driver *driver); 332void acpi_bus_unregister_driver(struct acpi_driver *driver);
331int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, 333int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
332 acpi_handle handle, int type); 334 acpi_handle handle, int type);
333int acpi_bus_trim(struct acpi_device *start, int rmdevice); 335int acpi_bus_trim(struct acpi_device *start, int rmdevice);
diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h
new file mode 100644
index 000000000000..1049f2a0a6db
--- /dev/null
+++ b/include/acpi/acpi_numa.h
@@ -0,0 +1,23 @@
1#ifndef __ACPI_NUMA_H
2#define __ACPI_NUMA_H
3
4#ifdef CONFIG_ACPI_NUMA
5#include <linux/kernel.h>
6
7/* Proximity bitmap length */
8#if MAX_NUMNODES > 256
9#define MAX_PXM_DOMAINS MAX_NUMNODES
10#else
11#define MAX_PXM_DOMAINS (256) /* Old pxm spec is defined 8 bit */
12#endif
13
14extern int __cpuinitdata pxm_to_node_map[MAX_PXM_DOMAINS];
15extern int __cpuinitdata node_to_pxm_map[MAX_NUMNODES];
16
17extern int __cpuinit pxm_to_node(int);
18extern int __cpuinit node_to_pxm(int);
19extern int __cpuinit acpi_map_pxm_to_node(int);
20extern void __cpuinit acpi_unmap_pxm_to_node(int);
21
22#endif /* CONFIG_ACPI_NUMA */
23#endif /* __ACP_NUMA_H */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 970e9a6372c3..8f473c83b7c4 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -50,12 +50,16 @@
50#include "platform/acenv.h" 50#include "platform/acenv.h"
51#include "actypes.h" 51#include "actypes.h"
52 52
53/* Priorities for acpi_os_queue_for_execution */ 53/* Types for acpi_os_execute */
54 54
55#define OSD_PRIORITY_GPE 1 55typedef enum {
56#define OSD_PRIORITY_HIGH 2 56 OSL_GLOBAL_LOCK_HANDLER,
57#define OSD_PRIORITY_MED 3 57 OSL_NOTIFY_HANDLER,
58#define OSD_PRIORITY_LO 4 58 OSL_GPE_HANDLER,
59 OSL_DEBUGGER_THREAD,
60 OSL_EC_POLL_HANDLER,
61 OSL_EC_BURST_HANDLER
62} acpi_execute_type;
59 63
60#define ACPI_NO_UNIT_LIMIT ((u32) -1) 64#define ACPI_NO_UNIT_LIMIT ((u32) -1)
61#define ACPI_MUTEX_SEM 1 65#define ACPI_MUTEX_SEM 1
@@ -161,13 +165,11 @@ acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine);
161/* 165/*
162 * Threads and Scheduling 166 * Threads and Scheduling
163 */ 167 */
164u32 acpi_os_get_thread_id(void); 168acpi_thread_id acpi_os_get_thread_id(void);
165 169
166acpi_status 170acpi_status
167acpi_os_queue_for_execution(u32 priority, 171acpi_os_execute(acpi_execute_type type,
168 acpi_osd_exec_callback function, void *context); 172 acpi_osd_exec_callback function, void *context);
169
170void acpi_os_wait_events_complete(void *context);
171 173
172void acpi_os_wait_events_complete(void *context); 174void acpi_os_wait_events_complete(void *context);
173 175
@@ -214,6 +216,12 @@ acpi_os_derive_pci_id(acpi_handle rhandle,
214/* 216/*
215 * Miscellaneous 217 * Miscellaneous
216 */ 218 */
219acpi_status acpi_os_validate_interface(char *interface);
220
221acpi_status
222acpi_os_validate_address(u8 space_id,
223 acpi_physical_address address, acpi_size length);
224
217u8 acpi_os_readable(void *pointer, acpi_size length); 225u8 acpi_os_readable(void *pointer, acpi_size length);
218 226
219#ifdef ACPI_FUTURE_USAGE 227#ifdef ACPI_FUTURE_USAGE
@@ -255,11 +263,4 @@ char *acpi_os_get_next_filename(void *dir_handle);
255 263
256void acpi_os_close_directory(void *dir_handle); 264void acpi_os_close_directory(void *dir_handle);
257 265
258/*
259 * Debug
260 */
261void
262acpi_os_dbg_assert(void *failed_assertion,
263 void *file_name, u32 line_number, char *message);
264
265#endif /* __ACPIOSXF_H__ */ 266#endif /* __ACPIOSXF_H__ */
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 66cf2ecef57a..049e9aa1b867 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -268,7 +268,7 @@ acpi_status acpi_remove_gpe_block(acpi_handle gpe_device);
268 * Resource interfaces 268 * Resource interfaces
269 */ 269 */
270typedef 270typedef
271acpi_status(*ACPI_WALK_RESOURCE_CALLBACK) (struct acpi_resource * resource, 271acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource,
272 void *context); 272 void *context);
273 273
274acpi_status 274acpi_status
@@ -290,7 +290,7 @@ acpi_get_possible_resources(acpi_handle device_handle,
290acpi_status 290acpi_status
291acpi_walk_resources(acpi_handle device_handle, 291acpi_walk_resources(acpi_handle device_handle,
292 char *name, 292 char *name,
293 ACPI_WALK_RESOURCE_CALLBACK user_function, void *context); 293 acpi_walk_resource_callback user_function, void *context);
294 294
295acpi_status 295acpi_status
296acpi_set_current_resources(acpi_handle device_handle, 296acpi_set_current_resources(acpi_handle device_handle,
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index fa02e8083381..ad11fc13fbef 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -164,23 +164,26 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
164/* 164/*
165 * rsutils 165 * rsutils
166 */ 166 */
167
167acpi_status 168acpi_status
168acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); 169acpi_rs_get_prt_method_data(struct acpi_namespace_node *node,
170 struct acpi_buffer *ret_buffer);
169 171
170acpi_status 172acpi_status
171acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); 173acpi_rs_get_crs_method_data(struct acpi_namespace_node *node,
174 struct acpi_buffer *ret_buffer);
172 175
173#ifdef ACPI_FUTURE_USAGE
174acpi_status 176acpi_status
175acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); 177acpi_rs_get_prs_method_data(struct acpi_namespace_node *node,
176#endif /* ACPI_FUTURE_USAGE */ 178 struct acpi_buffer *ret_buffer);
177 179
178acpi_status 180acpi_status
179acpi_rs_get_method_data(acpi_handle handle, 181acpi_rs_get_method_data(acpi_handle handle,
180 char *path, struct acpi_buffer *ret_buffer); 182 char *path, struct acpi_buffer *ret_buffer);
181 183
182acpi_status 184acpi_status
183acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); 185acpi_rs_set_srs_method_data(struct acpi_namespace_node *node,
186 struct acpi_buffer *ret_buffer);
184 187
185/* 188/*
186 * rscalc 189 * rscalc
@@ -198,8 +201,9 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
198 acpi_size * buffer_size_needed); 201 acpi_size * buffer_size_needed);
199 202
200acpi_status 203acpi_status
201acpi_rs_convert_aml_to_resources(u8 * aml_buffer, 204acpi_rs_convert_aml_to_resources(u8 * aml,
202 u32 aml_buffer_length, u8 * output_buffer); 205 u32 length,
206 u32 offset, u8 resource_index, void **context);
203 207
204acpi_status 208acpi_status
205acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, 209acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index d8c1c2cdac0c..5e8095f0f78f 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -44,6 +44,8 @@
44#ifndef __ACSTRUCT_H__ 44#ifndef __ACSTRUCT_H__
45#define __ACSTRUCT_H__ 45#define __ACSTRUCT_H__
46 46
47/* acpisrc:struct_defs -- for acpisrc conversion */
48
47/***************************************************************************** 49/*****************************************************************************
48 * 50 *
49 * Tree walking typedefs and structs 51 * Tree walking typedefs and structs
@@ -51,67 +53,76 @@
51 ****************************************************************************/ 53 ****************************************************************************/
52 54
53/* 55/*
54 * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through 56 * Walk state - current state of a parse tree walk. Used for both a leisurely
55 * the tree (for whatever reason), and for control method execution. 57 * stroll through the tree (for whatever reason), and for control method
58 * execution.
56 */ 59 */
57#define ACPI_NEXT_OP_DOWNWARD 1 60#define ACPI_NEXT_OP_DOWNWARD 1
58#define ACPI_NEXT_OP_UPWARD 2 61#define ACPI_NEXT_OP_UPWARD 2
59 62
63/*
64 * Groups of definitions for walk_type used for different implementations of
65 * walkers (never simultaneously) - flags for interpreter:
66 */
60#define ACPI_WALK_NON_METHOD 0 67#define ACPI_WALK_NON_METHOD 0
61#define ACPI_WALK_METHOD 1 68#define ACPI_WALK_METHOD 0x01
62#define ACPI_WALK_METHOD_RESTART 2 69#define ACPI_WALK_METHOD_RESTART 0x02
63#define ACPI_WALK_CONST_REQUIRED 3 70
64#define ACPI_WALK_CONST_OPTIONAL 4 71/* Flags for i_aSL compiler only */
72
73#define ACPI_WALK_CONST_REQUIRED 0x10
74#define ACPI_WALK_CONST_OPTIONAL 0x20
65 75
66struct acpi_walk_state { 76struct acpi_walk_state {
67 u8 data_type; /* To differentiate various internal objs MUST BE FIRST! */ 77 struct acpi_walk_state *next; /* Next walk_state in list */
78 u8 descriptor_type; /* To differentiate various internal objs */
68 u8 walk_type; 79 u8 walk_type;
69 acpi_owner_id owner_id; /* Owner of objects created during the walk */ 80 u16 opcode; /* Current AML opcode */
70 u8 last_predicate; /* Result of last predicate */
71 u8 current_result; /* */
72 u8 next_op_info; /* Info about next_op */ 81 u8 next_op_info; /* Info about next_op */
73 u8 num_operands; /* Stack pointer for Operands[] array */ 82 u8 num_operands; /* Stack pointer for Operands[] array */
83 acpi_owner_id owner_id; /* Owner of objects created during the walk */
84 u8 last_predicate; /* Result of last predicate */
85 u8 current_result;
74 u8 return_used; 86 u8 return_used;
75 u16 opcode; /* Current AML opcode */
76 u8 scope_depth; 87 u8 scope_depth;
77 u8 pass_number; /* Parse pass during table load */ 88 u8 pass_number; /* Parse pass during table load */
78 u32 arg_count; /* push for fixed or var args */
79 u32 aml_offset; 89 u32 aml_offset;
80 u32 arg_types; 90 u32 arg_types;
81 u32 method_breakpoint; /* For single stepping */ 91 u32 method_breakpoint; /* For single stepping */
82 u32 user_breakpoint; /* User AML breakpoint */ 92 u32 user_breakpoint; /* User AML breakpoint */
83 u32 parse_flags; 93 u32 parse_flags;
94
95 struct acpi_parse_state parser_state; /* Current state of parser */
84 u32 prev_arg_types; 96 u32 prev_arg_types;
97 u32 arg_count; /* push for fixed or var args */
85 98
86 u8 *aml_last_while;
87 struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ 99 struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
100 struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
101 union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
102 union acpi_operand_object **params;
103
104 u8 *aml_last_while;
88 union acpi_operand_object **caller_return_desc; 105 union acpi_operand_object **caller_return_desc;
89 union acpi_generic_state *control_state; /* List of control states (nested IFs) */ 106 union acpi_generic_state *control_state; /* List of control states (nested IFs) */
90 struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ 107 struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */
91 struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ 108 struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */
92 union acpi_operand_object *implicit_return_obj; 109 union acpi_operand_object *implicit_return_obj;
93 struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
94 struct acpi_namespace_node *method_call_node; /* Called method Node */ 110 struct acpi_namespace_node *method_call_node; /* Called method Node */
95 union acpi_parse_object *method_call_op; /* method_call Op if running a method */ 111 union acpi_parse_object *method_call_op; /* method_call Op if running a method */
96 union acpi_operand_object *method_desc; /* Method descriptor if running a method */ 112 union acpi_operand_object *method_desc; /* Method descriptor if running a method */
97 struct acpi_namespace_node *method_node; /* Method node if running a method. */ 113 struct acpi_namespace_node *method_node; /* Method node if running a method. */
98 union acpi_parse_object *op; /* Current parser op */ 114 union acpi_parse_object *op; /* Current parser op */
99 union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
100 const struct acpi_opcode_info *op_info; /* Info on current opcode */ 115 const struct acpi_opcode_info *op_info; /* Info on current opcode */
101 union acpi_parse_object *origin; /* Start of walk [Obsolete] */ 116 union acpi_parse_object *origin; /* Start of walk [Obsolete] */
102 union acpi_operand_object **params;
103 struct acpi_parse_state parser_state; /* Current state of parser */
104 union acpi_operand_object *result_obj; 117 union acpi_operand_object *result_obj;
105 union acpi_generic_state *results; /* Stack of accumulated results */ 118 union acpi_generic_state *results; /* Stack of accumulated results */
106 union acpi_operand_object *return_desc; /* Return object, if any */ 119 union acpi_operand_object *return_desc; /* Return object, if any */
107 union acpi_generic_state *scope_info; /* Stack of nested scopes */ 120 union acpi_generic_state *scope_info; /* Stack of nested scopes */
108
109 union acpi_parse_object *prev_op; /* Last op that was processed */ 121 union acpi_parse_object *prev_op; /* Last op that was processed */
110 union acpi_parse_object *next_op; /* next op to be processed */ 122 union acpi_parse_object *next_op; /* next op to be processed */
123 struct acpi_thread_state *thread;
111 acpi_parse_downwards descending_callback; 124 acpi_parse_downwards descending_callback;
112 acpi_parse_upwards ascending_callback; 125 acpi_parse_upwards ascending_callback;
113 struct acpi_thread_state *thread;
114 struct acpi_walk_state *next; /* Next walk_state in list */
115}; 126};
116 127
117/* Info used by acpi_ps_init_objects */ 128/* Info used by acpi_ps_init_objects */
@@ -131,32 +142,6 @@ struct acpi_init_walk_info {
131 struct acpi_table_desc *table_desc; 142 struct acpi_table_desc *table_desc;
132}; 143};
133 144
134/* Info used by acpi_ns_initialize_devices */
135
136struct acpi_device_walk_info {
137 u16 device_count;
138 u16 num_STA;
139 u16 num_INI;
140 struct acpi_table_desc *table_desc;
141};
142
143/* TBD: [Restructure] Merge with struct above */
144
145struct acpi_walk_info {
146 u32 debug_level;
147 u32 count;
148 acpi_owner_id owner_id;
149 u8 display_type;
150};
151
152/* Display Types */
153
154#define ACPI_DISPLAY_SUMMARY (u8) 0
155#define ACPI_DISPLAY_OBJECTS (u8) 1
156#define ACPI_DISPLAY_MASK (u8) 1
157
158#define ACPI_DISPLAY_SHORT (u8) 2
159
160struct acpi_get_devices_info { 145struct acpi_get_devices_info {
161 acpi_walk_callback user_function; 146 acpi_walk_callback user_function;
162 void *context; 147 void *context;
@@ -189,16 +174,21 @@ union acpi_aml_operands {
189 } mid; 174 } mid;
190}; 175};
191 176
192/* Internal method parameter list */ 177/*
193 178 * Structure used to pass object evaluation parameters.
194struct acpi_parameter_info { 179 * Purpose is to reduce CPU stack use.
195 struct acpi_namespace_node *node; 180 */
181struct acpi_evaluate_info {
182 struct acpi_namespace_node *prefix_node;
183 char *pathname;
196 union acpi_operand_object *obj_desc; 184 union acpi_operand_object *obj_desc;
197 union acpi_operand_object **parameters; 185 union acpi_operand_object **parameters;
186 struct acpi_namespace_node *resolved_node;
198 union acpi_operand_object *return_object; 187 union acpi_operand_object *return_object;
199 u8 pass_number; 188 u8 pass_number;
200 u8 parameter_type; 189 u8 parameter_type;
201 u8 return_object_type; 190 u8 return_object_type;
191 u8 flags;
202}; 192};
203 193
204/* Types for parameter_type above */ 194/* Types for parameter_type above */
@@ -206,4 +196,35 @@ struct acpi_parameter_info {
206#define ACPI_PARAM_ARGS 0 196#define ACPI_PARAM_ARGS 0
207#define ACPI_PARAM_GPE 1 197#define ACPI_PARAM_GPE 1
208 198
199/* Values for Flags above */
200
201#define ACPI_IGNORE_RETURN_VALUE 1
202
203/* Info used by acpi_ns_initialize_devices */
204
205struct acpi_device_walk_info {
206 u16 device_count;
207 u16 num_STA;
208 u16 num_INI;
209 struct acpi_table_desc *table_desc;
210 struct acpi_evaluate_info *evaluate_info;
211};
212
213/* TBD: [Restructure] Merge with struct above */
214
215struct acpi_walk_info {
216 u32 debug_level;
217 u32 count;
218 acpi_owner_id owner_id;
219 u8 display_type;
220};
221
222/* Display Types */
223
224#define ACPI_DISPLAY_SUMMARY (u8) 0
225#define ACPI_DISPLAY_OBJECTS (u8) 1
226#define ACPI_DISPLAY_MASK (u8) 1
227
228#define ACPI_DISPLAY_SHORT (u8) 2
229
209#endif 230#endif
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 30a47542e1c8..4dbaf02fe526 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -136,7 +136,11 @@ acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc);
136acpi_status 136acpi_status
137acpi_tb_verify_table_checksum(struct acpi_table_header *table_header); 137acpi_tb_verify_table_checksum(struct acpi_table_header *table_header);
138 138
139u8 acpi_tb_generate_checksum(void *buffer, u32 length); 139u8 acpi_tb_sum_table(void *buffer, u32 length);
140
141u8 acpi_tb_generate_checksum(struct acpi_table_header *table);
142
143void acpi_tb_set_checksum(struct acpi_table_header *table);
140 144
141acpi_status 145acpi_status
142acpi_tb_validate_table_header(struct acpi_table_header *table_header); 146acpi_tb_validate_table_header(struct acpi_table_header *table_header);
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index ed53f842dad4..b125ceed9cb7 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Name: actbl.h - Table data structures defined in ACPI specification 3 * Name: actbl.h - Basic ACPI Table Definitions
4 * 4 *
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
@@ -45,66 +45,45 @@
45#define __ACTBL_H__ 45#define __ACTBL_H__
46 46
47/* 47/*
48 * Note about bitfields: The u8 type is used for bitfields in ACPI tables. 48 * Values for description table header signatures. Useful because they make
49 * This is the only type that is even remotely portable. Anything else is not 49 * it more difficult to inadvertently type in the wrong signature.
50 * portable, so do not use any other bitfield types.
51 */
52
53/*
54 * Values for description table header signatures
55 */ 50 */
56#define RSDP_NAME "RSDP"
57#define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */
58#define APIC_SIG "APIC" /* Multiple APIC Description Table */
59#define DSDT_SIG "DSDT" /* Differentiated System Description Table */ 51#define DSDT_SIG "DSDT" /* Differentiated System Description Table */
60#define FADT_SIG "FACP" /* Fixed ACPI Description Table */ 52#define FADT_SIG "FACP" /* Fixed ACPI Description Table */
61#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ 53#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */
62#define PSDT_SIG "PSDT" /* Persistent System Description Table */ 54#define PSDT_SIG "PSDT" /* Persistent System Description Table */
55#define RSDP_SIG "RSD PTR " /* Root System Description Pointer */
63#define RSDT_SIG "RSDT" /* Root System Description Table */ 56#define RSDT_SIG "RSDT" /* Root System Description Table */
64#define XSDT_SIG "XSDT" /* Extended System Description Table */ 57#define XSDT_SIG "XSDT" /* Extended System Description Table */
65#define SSDT_SIG "SSDT" /* Secondary System Description Table */ 58#define SSDT_SIG "SSDT" /* Secondary System Description Table */
66#define SBST_SIG "SBST" /* Smart Battery Specification Table */ 59#define RSDP_NAME "RSDP"
67#define SPIC_SIG "SPIC" /* IOSAPIC table */
68#define BOOT_SIG "BOOT" /* Boot table */
69
70#define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */
71 60
72/* 61/*
73 * Common table types. The base code can remain 62 * All tables and structures must be byte-packed to match the ACPI
74 * constant if the underlying tables are changed 63 * specification, since the tables are provided by the system BIOS
75 */ 64 */
76#define RSDT_DESCRIPTOR struct rsdt_descriptor_rev2
77#define XSDT_DESCRIPTOR struct xsdt_descriptor_rev2
78#define FACS_DESCRIPTOR struct facs_descriptor_rev2
79#define FADT_DESCRIPTOR struct fadt_descriptor_rev2
80
81#pragma pack(1) 65#pragma pack(1)
82 66
83/* 67/*
84 * ACPI Version-independent tables 68 * These are the ACPI tables that are directly consumed by the subsystem.
69 *
70 * The RSDP and FACS do not use the common ACPI table header. All other ACPI
71 * tables use the header.
85 * 72 *
86 * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.) 73 * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
87 * are in separate files. 74 * This is the only type that is even remotely portable. Anything else is not
75 * portable, so do not use any other bitfield types.
88 */ 76 */
89struct rsdp_descriptor { /* Root System Descriptor Pointer */
90 char signature[8]; /* ACPI signature, contains "RSD PTR " */
91 u8 checksum; /* ACPI 1.0 checksum */
92 char oem_id[6]; /* OEM identification */
93 u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */
94 u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */
95 u32 length; /* XSDT Length in bytes, including header */
96 u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */
97 u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */
98 char reserved[3]; /* Reserved, must be zero */
99};
100 77
101struct acpi_common_facs { /* Common FACS for internal use */ 78/*******************************************************************************
102 u32 *global_lock; 79 *
103 u64 *firmware_waking_vector; 80 * ACPI Table Header. This common header is used by all tables except the
104 u8 vector_width; 81 * RSDP and FACS. The define is used for direct inclusion of header into
105}; 82 * other ACPI tables
83 *
84 ******************************************************************************/
106 85
107#define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ 86#define ACPI_TABLE_HEADER_DEF \
108 char signature[4]; /* ASCII table signature */\ 87 char signature[4]; /* ASCII table signature */\
109 u32 length; /* Length of table in bytes, including this header */\ 88 u32 length; /* Length of table in bytes, including this header */\
110 u8 revision; /* ACPI Specification minor version # */\ 89 u8 revision; /* ACPI Specification minor version # */\
@@ -112,154 +91,239 @@ struct acpi_common_facs { /* Common FACS for internal use */
112 char oem_id[6]; /* ASCII OEM identification */\ 91 char oem_id[6]; /* ASCII OEM identification */\
113 char oem_table_id[8]; /* ASCII OEM table identification */\ 92 char oem_table_id[8]; /* ASCII OEM table identification */\
114 u32 oem_revision; /* OEM revision number */\ 93 u32 oem_revision; /* OEM revision number */\
115 char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\ 94 char asl_compiler_id[4]; /* ASCII ASL compiler vendor ID */\
116 u32 asl_compiler_revision; /* ASL compiler version */ 95 u32 asl_compiler_revision; /* ASL compiler version */
117 96
118struct acpi_table_header { /* ACPI common table header */ 97struct acpi_table_header {
119ACPI_TABLE_HEADER_DEF}; 98ACPI_TABLE_HEADER_DEF};
120 99
121/* 100/*
122 * MADT values and structures 101 * GAS - Generic Address Structure (ACPI 2.0+)
123 */ 102 */
103struct acpi_generic_address {
104 u8 address_space_id; /* Address space where struct or register exists */
105 u8 register_bit_width; /* Size in bits of given register */
106 u8 register_bit_offset; /* Bit offset within the register */
107 u8 access_width; /* Minimum Access size (ACPI 3.0) */
108 u64 address; /* 64-bit address of struct or register */
109};
124 110
125/* Values for MADT PCATCompat */ 111/*******************************************************************************
112 *
113 * RSDP - Root System Description Pointer (Signature is "RSD PTR ")
114 *
115 ******************************************************************************/
116
117struct rsdp_descriptor {
118 char signature[8]; /* ACPI signature, contains "RSD PTR " */
119 u8 checksum; /* ACPI 1.0 checksum */
120 char oem_id[6]; /* OEM identification */
121 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 */
123 u32 length; /* Table length in bytes, including header (ACPI 2.0+) */
124 u64 xsdt_physical_address; /* 64-bit physical address of the XSDT (ACPI 2.0+) */
125 u8 extended_checksum; /* Checksum of entire table (ACPI 2.0+) */
126 u8 reserved[3]; /* Reserved, must be zero */
127};
126 128
127#define DUAL_PIC 0 129#define ACPI_RSDP_REV0_SIZE 20 /* Size of original ACPI 1.0 RSDP */
128#define MULTIPLE_APIC 1
129 130
130/* Master MADT */ 131/*******************************************************************************
132 *
133 * RSDT/XSDT - Root System Description Tables
134 *
135 ******************************************************************************/
131 136
132struct multiple_apic_table { 137struct rsdt_descriptor {
133 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 138 ACPI_TABLE_HEADER_DEF u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
134 u32 local_apic_address; /* Physical address of local APIC */ 139};
140
141struct xsdt_descriptor {
142 ACPI_TABLE_HEADER_DEF u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
143};
144
145/*******************************************************************************
146 *
147 * FACS - Firmware ACPI Control Structure (FACS)
148 *
149 ******************************************************************************/
150
151struct facs_descriptor {
152 char signature[4]; /* ASCII table signature */
153 u32 length; /* Length of structure, in bytes */
154 u32 hardware_signature; /* Hardware configuration signature */
155 u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector */
156 u32 global_lock; /* Global Lock for shared hardware resources */
135 157
136 /* Flags (32 bits) */ 158 /* Flags (32 bits) */
137 159
138 u8 PCATcompat:1; /* 00: System also has dual 8259s */ 160 u8 S4bios_f:1; /* 00: S4BIOS support is present */
139 u8:7; /* 01-07: Reserved, must be zero */ 161 u8:7; /* 01-07: Reserved, must be zero */
140 u8 reserved1[3]; /* 08-31: Reserved, must be zero */ 162 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
141};
142 163
143/* Values for Type in APIC_HEADER_DEF */ 164 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+) */
166 u8 reserved[31]; /* Reserved, must be zero */
167};
144 168
145#define APIC_PROCESSOR 0 169#define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */
146#define APIC_IO 1 170#define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */
147#define APIC_XRUPT_OVERRIDE 2
148#define APIC_NMI 3
149#define APIC_LOCAL_NMI 4
150#define APIC_ADDRESS_OVERRIDE 5
151#define APIC_IO_SAPIC 6
152#define APIC_LOCAL_SAPIC 7
153#define APIC_XRUPT_SOURCE 8
154#define APIC_RESERVED 9 /* 9 and greater are reserved */
155 171
156/* 172/*
157 * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE) 173 * Common FACS - This is a version-independent FACS structure used for internal use only
158 */ 174 */
159#define APIC_HEADER_DEF /* Common APIC sub-structure header */\ 175struct acpi_common_facs {
160 u8 type; \ 176 u32 *global_lock;
161 u8 length; 177 u64 *firmware_waking_vector;
162 178 u8 vector_width;
163struct apic_header {
164APIC_HEADER_DEF};
165
166/* Values for MPS INTI flags */
167
168#define POLARITY_CONFORMS 0
169#define POLARITY_ACTIVE_HIGH 1
170#define POLARITY_RESERVED 2
171#define POLARITY_ACTIVE_LOW 3
172
173#define TRIGGER_CONFORMS 0
174#define TRIGGER_EDGE 1
175#define TRIGGER_RESERVED 2
176#define TRIGGER_LEVEL 3
177
178/* Common flag definitions (16 bits each) */
179
180#define MPS_INTI_FLAGS \
181 u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\
182 u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\
183 u8 : 4; /* 04-07: Reserved, must be zero */\
184 u8 reserved1; /* 08-15: Reserved, must be zero */
185
186#define LOCAL_APIC_FLAGS \
187 u8 processor_enabled: 1; /* 00: Processor is usable if set */\
188 u8 : 7; /* 01-07: Reserved, must be zero */\
189 u8 reserved2; /* 08-15: Reserved, must be zero */
190
191/* Sub-structures for MADT */
192
193struct madt_processor_apic {
194 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
195 u8 local_apic_id; /* Processor's local APIC id */
196 LOCAL_APIC_FLAGS};
197
198struct madt_io_apic {
199 APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */
200 u8 reserved; /* Reserved - must be zero */
201 u32 address; /* APIC physical address */
202 u32 interrupt; /* Global system interrupt where INTI
203 * lines start */
204}; 179};
205 180
206struct madt_interrupt_override { 181/*******************************************************************************
207 APIC_HEADER_DEF u8 bus; /* 0 - ISA */ 182 *
208 u8 source; /* Interrupt source (IRQ) */ 183 * FADT - Fixed ACPI Description Table (Signature "FACP")
209 u32 interrupt; /* Global system interrupt */ 184 *
210 MPS_INTI_FLAGS}; 185 ******************************************************************************/
186
187/* Fields common to all versions of the FADT */
188
189#define ACPI_FADT_COMMON \
190 ACPI_TABLE_HEADER_DEF \
191 u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \
192 u32 V1_dsdt; /* 32-bit physical address of DSDT */ \
193 u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ \
194 u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ \
195 u16 sci_int; /* System vector of SCI interrupt */ \
196 u32 smi_cmd; /* Port address of SMI command port */ \
197 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 */ \
199 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ \
200 u8 pstate_cnt; /* Processor performance state control*/ \
201 u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a Event Reg Blk */ \
202 u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b Event Reg Blk */ \
203 u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ \
204 u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ \
205 u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ \
206 u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ \
207 u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ \
208 u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ \
209 u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */ \
210 u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */ \
211 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ \
212 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ \
213 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ \
214 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ \
215 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ \
216 u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ \
217 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ \
218 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ \
219 u16 flush_size; /* Processor's memory cache line width, in bytes */ \
220 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*/ \
222 u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/ \
223 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ \
224 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ \
225 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*/ \
227 u8 reserved2; /* Reserved, must be zero */
211 228
212struct madt_nmi_source { 229/*
213 APIC_HEADER_DEF MPS_INTI_FLAGS u32 interrupt; /* Global system interrupt */ 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 */
261 u8 reserved4[3]; /* These three bytes must be zero */
262 u64 xfirmware_ctrl; /* 64-bit physical address of FACS */
263 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 */
265 struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */
266 struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */
267 struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */
268 struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */
269 struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */
270 struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */
271 struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */
214}; 272};
215 273
216struct madt_local_apic_nmi { 274/*
217 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 275 * "Down-revved" ACPI 2.0 FADT descriptor
218 MPS_INTI_FLAGS u8 lint; /* LINTn to which NMI is connected */ 276 * Defined here to allow compiler to generate the length of the struct
277 */
278struct fadt_descriptor_rev2_minus {
279 ACPI_FADT_COMMON u32 flags;
280 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
281 u8 reset_value; /* Value to write to the reset_register port to reset the system. */
282 u8 reserved7[3]; /* Reserved, must be zero */
219}; 283};
220 284
221struct madt_address_override { 285/*
222 APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */ 286 * ACPI 1.0 FADT
223 u64 address; /* APIC physical address */ 287 * Defined here to allow compiler to generate the length of the struct
288 */
289struct fadt_descriptor_rev1 {
290 ACPI_FADT_COMMON u32 flags;
224}; 291};
225 292
226struct madt_io_sapic { 293/* FADT: Prefered Power Management Profiles */
227 APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */
228 u8 reserved; /* Reserved, must be zero */
229 u32 interrupt_base; /* Glocal interrupt for SAPIC start */
230 u64 address; /* SAPIC physical address */
231};
232 294
233struct madt_local_sapic { 295#define PM_UNSPECIFIED 0
234 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 296#define PM_DESKTOP 1
235 u8 local_sapic_id; /* SAPIC ID */ 297#define PM_MOBILE 2
236 u8 local_sapic_eid; /* SAPIC EID */ 298#define PM_WORKSTATION 3
237 u8 reserved[3]; /* Reserved, must be zero */ 299#define PM_ENTERPRISE_SERVER 4
238 LOCAL_APIC_FLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ 300#define PM_SOHO_SERVER 5
239 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ 301#define PM_APPLIANCE_PC 6
240};
241 302
242struct madt_interrupt_source { 303/* FADT: Boot Arch Flags */
243 APIC_HEADER_DEF MPS_INTI_FLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */
244 u8 processor_id; /* Processor ID */
245 u8 processor_eid; /* Processor EID */
246 u8 io_sapic_vector; /* Vector value for PMI interrupts */
247 u32 interrupt; /* Global system interrupt */
248 u32 flags; /* Interrupt Source Flags */
249};
250 304
251/* 305#define BAF_LEGACY_DEVICES 0x0001
252 * Smart Battery 306#define BAF_8042_KEYBOARD_CONTROLLER 0x0002
253 */ 307
254struct smart_battery_table { 308#define FADT2_REVISION_ID 3
255 ACPI_TABLE_HEADER_DEF u32 warning_level; 309#define FADT2_MINUS_REVISION_ID 2
256 u32 low_level; 310
257 u32 critical_level; 311/* Reset to default packing */
258};
259 312
260#pragma pack() 313#pragma pack()
261 314
262/* 315/*
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
326/*
263 * ACPI Table information. We save the table address, length, 327 * ACPI Table information. We save the table address, length,
264 * and type of memory allocation (mapped or allocated) for each 328 * and type of memory allocation (mapped or allocated) for each
265 * table for 1) when we exit, and 2) if a new table is installed 329 * table for 1) when we exit, and 2) if a new table is installed
@@ -290,27 +354,17 @@ struct acpi_table_support {
290 u8 flags; 354 u8 flags;
291}; 355};
292 356
293/*
294 * Get the ACPI version-specific tables
295 */
296#include "actbl1.h" /* Acpi 1.0 table definitions */
297#include "actbl2.h" /* Acpi 2.0 table definitions */
298
299extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, 357extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1,
300 * needed for certain workarounds */ 358 * needed for certain workarounds */
359/* Macros used to generate offsets to specific table fields */
301 360
302#pragma pack(1) 361#define ACPI_FACS_OFFSET(f) (u8) ACPI_OFFSET (struct facs_descriptor,f)
303/* 362#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct fadt_descriptor, f)
304 * High performance timer 363#define ACPI_GAS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_generic_address,f)
305 */ 364#define ACPI_HDR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_header,f)
306struct hpet_table { 365#define ACPI_RSDP_OFFSET(f) (u8) ACPI_OFFSET (struct rsdp_descriptor,f)
307 ACPI_TABLE_HEADER_DEF u32 hardware_id;
308 struct acpi_generic_address base_address;
309 u8 hpet_number;
310 u16 clock_tick;
311 u8 attributes;
312};
313 366
314#pragma pack() 367#define ACPI_FADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct fadt_descriptor,f,o)
368#define ACPI_FACS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct facs_descriptor,f,o)
315 369
316#endif /* __ACTBL_H__ */ 370#endif /* __ACTBL_H__ */
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index cd428d57add0..745a6445a4f9 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Name: actbl1.h - ACPI 1.0 tables 3 * Name: actbl1.h - Additional ACPI table definitions
4 * 4 *
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
@@ -44,92 +44,599 @@
44#ifndef __ACTBL1_H__ 44#ifndef __ACTBL1_H__
45#define __ACTBL1_H__ 45#define __ACTBL1_H__
46 46
47/*******************************************************************************
48 *
49 * Additional ACPI Tables
50 *
51 * These tables are not consumed directly by the ACPICA subsystem, but are
52 * included here to support device drivers and the AML disassembler.
53 *
54 ******************************************************************************/
55
56/*
57 * Values for description table header signatures. Useful because they make
58 * it more difficult to inadvertently type in the wrong signature.
59 */
60#define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */
61#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
62#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
63#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
64#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_MADT "APIC" /* Multiple APIC Description Table */
67#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
68#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
69#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
70#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
71#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */
72#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
73#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
74#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
75
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/*
83 * All tables must be byte-packed to match the ACPI specification, since
84 * the tables are provided by the system BIOS.
85 */
47#pragma pack(1) 86#pragma pack(1)
48 87
49/* 88/*
50 * ACPI 1.0 Root System Description Table (RSDT) 89 * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
90 * This is the only type that is even remotely portable. Anything else is not
91 * portable, so do not use any other bitfield types.
51 */ 92 */
52struct rsdt_descriptor_rev1 { 93
53 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 94/*******************************************************************************
54 u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ 95 *
55}; 96 * ASF - Alert Standard Format table (Signature "ASF!")
97 *
98 ******************************************************************************/
99
100struct acpi_table_asf {
101ACPI_TABLE_HEADER_DEF};
102
103#define ACPI_ASF_HEADER_DEF \
104 u8 type; \
105 u8 reserved; \
106 u16 length;
107
108struct acpi_asf_header {
109ACPI_ASF_HEADER_DEF};
110
111/* Values for Type field */
112
113#define ASF_INFO 0
114#define ASF_ALERT 1
115#define ASF_CONTROL 2
116#define ASF_BOOT 3
117#define ASF_ADDRESS 4
118#define ASF_RESERVED 5
56 119
57/* 120/*
58 * ACPI 1.0 Firmware ACPI Control Structure (FACS) 121 * ASF subtables
59 */ 122 */
60struct facs_descriptor_rev1 { 123
61 char signature[4]; /* ASCII table signature */ 124/* 0: ASF Information */
62 u32 length; /* Length of structure in bytes */ 125
63 u32 hardware_signature; /* Hardware configuration signature */ 126struct acpi_asf_info {
64 u32 firmware_waking_vector; /* ACPI OS waking vector */ 127 ACPI_ASF_HEADER_DEF u8 min_reset_value;
65 u32 global_lock; /* Global Lock */ 128 u8 min_poll_interval;
129 u16 system_id;
130 u32 mfg_id;
131 u8 flags;
132 u8 reserved2[3];
133};
134
135/* 1: ASF Alerts */
136
137struct acpi_asf_alert {
138 ACPI_ASF_HEADER_DEF u8 assert_mask;
139 u8 deassert_mask;
140 u8 alerts;
141 u8 data_length;
142 u8 array[1];
143};
144
145/* 2: ASF Remote Control */
146
147struct acpi_asf_remote {
148 ACPI_ASF_HEADER_DEF u8 controls;
149 u8 data_length;
150 u16 reserved2;
151 u8 array[1];
152};
153
154/* 3: ASF RMCP Boot Options */
155
156struct acpi_asf_rmcp {
157 ACPI_ASF_HEADER_DEF u8 capabilities[7];
158 u8 completion_code;
159 u32 enterprise_id;
160 u8 command;
161 u16 parameter;
162 u16 boot_options;
163 u16 oem_parameters;
164};
165
166/* 4: ASF Address */
167
168struct acpi_asf_address {
169 ACPI_ASF_HEADER_DEF u8 eprom_address;
170 u8 devices;
171 u8 smbus_addresses[1];
172};
173
174/*******************************************************************************
175 *
176 * BOOT - Simple Boot Flag Table
177 *
178 ******************************************************************************/
179
180struct acpi_table_boot {
181 ACPI_TABLE_HEADER_DEF u8 cmos_index; /* Index in CMOS RAM for the boot register */
182 u8 reserved[3];
183};
184
185/*******************************************************************************
186 *
187 * CPEP - Corrected Platform Error Polling table
188 *
189 ******************************************************************************/
190
191struct acpi_table_cpep {
192 ACPI_TABLE_HEADER_DEF u64 reserved;
193};
194
195/* Subtable */
196
197struct acpi_cpep_polling {
198 u8 type;
199 u8 length;
200 u8 processor_id; /* Processor ID */
201 u8 processor_eid; /* Processor EID */
202 u32 polling_interval; /* Polling interval (msec) */
203};
204
205/*******************************************************************************
206 *
207 * DBGP - Debug Port table
208 *
209 ******************************************************************************/
210
211struct acpi_table_dbgp {
212 ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
213 u8 reserved[3];
214 struct acpi_generic_address debug_port;
215};
216
217/*******************************************************************************
218 *
219 * ECDT - Embedded Controller Boot Resources Table
220 *
221 ******************************************************************************/
222
223struct ec_boot_resources {
224 ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */
225 struct acpi_generic_address ec_data; /* Address of EC data register */
226 u32 uid; /* Unique ID - must be same as the EC _UID method */
227 u8 gpe_bit; /* The GPE for the EC */
228 u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */
229};
230
231/*******************************************************************************
232 *
233 * HPET - High Precision Event Timer table
234 *
235 ******************************************************************************/
236
237struct acpi_hpet_table {
238 ACPI_TABLE_HEADER_DEF u32 hardware_id; /* Hardware ID of event timer block */
239 struct acpi_generic_address base_address; /* Address of event timer block */
240 u8 hpet_number; /* HPET sequence number */
241 u16 clock_tick; /* Main counter min tick, periodic mode */
242 u8 attributes;
243};
244
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/*******************************************************************************
255 *
256 * MADT - Multiple APIC Description Table
257 *
258 ******************************************************************************/
259
260struct multiple_apic_table {
261 ACPI_TABLE_HEADER_DEF u32 local_apic_address; /* Physical address of local APIC */
66 262
67 /* Flags (32 bits) */ 263 /* Flags (32 bits) */
68 264
69 u8 S4bios_f:1; /* 00: S4BIOS support is present */ 265 u8 PCATcompat:1; /* 00: System also has dual 8259s */
70 u8:7; /* 01-07: Reserved, must be zero */ 266 u8:7; /* 01-07: Reserved, must be zero */
71 u8 reserved1[3]; /* 08-31: Reserved, must be zero */ 267 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
72
73 u8 reserved2[40]; /* Reserved, must be zero */
74}; 268};
75 269
270/* Values for MADT PCATCompat */
271
272#define DUAL_PIC 0
273#define MULTIPLE_APIC 1
274
275/* Common MADT Sub-table header */
276
277#define APIC_HEADER_DEF \
278 u8 type; \
279 u8 length;
280
281struct apic_header {
282APIC_HEADER_DEF};
283
284/* Values for Type in struct apic_header */
285
286#define APIC_PROCESSOR 0
287#define APIC_IO 1
288#define APIC_XRUPT_OVERRIDE 2
289#define APIC_NMI 3
290#define APIC_LOCAL_NMI 4
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
297/* Flag definitions for MADT sub-tables */
298
299#define ACPI_MADT_IFLAGS /* INTI flags (16 bits) */ \
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
305#define ACPI_MADT_LFLAGS /* Local Sapic flags (32 bits) */ \
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
310/* Values for MPS INTI flags */
311
312#define POLARITY_CONFORMS 0
313#define POLARITY_ACTIVE_HIGH 1
314#define POLARITY_RESERVED 2
315#define POLARITY_ACTIVE_LOW 3
316
317#define TRIGGER_CONFORMS 0
318#define TRIGGER_EDGE 1
319#define TRIGGER_RESERVED 2
320#define TRIGGER_LEVEL 3
321
76/* 322/*
77 * ACPI 1.0 Fixed ACPI Description Table (FADT) 323 * MADT Sub-tables, correspond to Type in struct apic_header
78 */ 324 */
79struct fadt_descriptor_rev1 { 325
80 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 326/* 0: processor APIC */
81 u32 firmware_ctrl; /* Physical address of FACS */ 327
82 u32 dsdt; /* Physical address of DSDT */ 328struct madt_processor_apic {
83 u8 model; /* System Interrupt Model */ 329 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
84 u8 reserved1; /* Reserved, must be zero */ 330 u8 local_apic_id; /* Processor's local APIC id */
85 u16 sci_int; /* System vector of SCI interrupt */ 331 ACPI_MADT_LFLAGS};
86 u32 smi_cmd; /* Port address of SMI command port */ 332
87 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ 333/* 1: IO APIC */
88 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ 334
89 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ 335struct madt_io_apic {
90 u8 reserved2; /* Reserved, must be zero */ 336 APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */
91 u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ 337 u8 reserved; /* Reserved - must be zero */
92 u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ 338 u32 address; /* APIC physical address */
93 u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ 339 u32 interrupt; /* Global system interrupt where INTI lines start */
94 u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ 340};
95 u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ 341
96 u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ 342/* 2: Interrupt Override */
97 u32 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ 343
98 u32 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ 344struct madt_interrupt_override {
99 u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ 345 APIC_HEADER_DEF u8 bus; /* 0 - ISA */
100 u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ 346 u8 source; /* Interrupt source (IRQ) */
101 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ 347 u32 interrupt; /* Global system interrupt */
102 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ 348 ACPI_MADT_IFLAGS};
103 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ 349
104 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ 350/* 3: NMI Sources */
105 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ 351
106 u8 reserved3; /* Reserved, must be zero */ 352struct madt_nmi_source {
107 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ 353 APIC_HEADER_DEF ACPI_MADT_IFLAGS u32 interrupt; /* Global system interrupt */
108 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ 354};
109 u16 flush_size; /* Size of area read to flush caches */ 355
110 u16 flush_stride; /* Stride used in flushing caches */ 356/* 4: Local APIC NMI */
111 u8 duty_offset; /* Bit location of duty cycle field in p_cnt reg */ 357
112 u8 duty_width; /* Bit width of duty cycle field in p_cnt reg */ 358struct madt_local_apic_nmi {
113 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ 359 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
114 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ 360 ACPI_MADT_IFLAGS u8 lint; /* LINTn to which NMI is connected */
115 u8 century; /* Index to century in RTC CMOS RAM */ 361};
116 u8 reserved4[3]; /* Reserved, must be zero */ 362
363/* 5: Address Override */
364
365struct madt_address_override {
366 APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */
367 u64 address; /* APIC physical address */
368};
369
370/* 6: I/O Sapic */
371
372struct madt_io_sapic {
373 APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */
374 u8 reserved; /* Reserved, must be zero */
375 u32 interrupt_base; /* Glocal interrupt for SAPIC start */
376 u64 address; /* SAPIC physical address */
377};
378
379/* 7: Local Sapic */
380
381struct madt_local_sapic {
382 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
383 u8 local_sapic_id; /* SAPIC ID */
384 u8 local_sapic_eid; /* SAPIC EID */
385 u8 reserved[3]; /* Reserved, must be zero */
386 ACPI_MADT_LFLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */
387 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */
388};
389
390/* 8: Platform Interrupt Source */
391
392struct madt_interrupt_source {
393 APIC_HEADER_DEF ACPI_MADT_IFLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */
394 u8 processor_id; /* Processor ID */
395 u8 processor_eid; /* Processor EID */
396 u8 io_sapic_vector; /* Vector value for PMI interrupts */
397 u32 interrupt; /* Global system interrupt */
398 u32 flags; /* Interrupt Source Flags */
399};
400
401#ifdef DUPLICATE_DEFINITION_WITH_LINUX_ACPI_H
402/*******************************************************************************
403 *
404 * MCFG - PCI Memory Mapped Configuration table and sub-table
405 *
406 ******************************************************************************/
407
408struct acpi_table_mcfg {
409 ACPI_TABLE_HEADER_DEF u8 reserved[8];
410};
411
412struct acpi_mcfg_allocation {
413 u64 base_address; /* Base address, processor-relative */
414 u16 pci_segment; /* PCI segment group number */
415 u8 start_bus_number; /* Starting PCI Bus number */
416 u8 end_bus_number; /* Final PCI Bus number */
417 u32 reserved;
418};
419#endif
420
421/*******************************************************************************
422 *
423 * SBST - Smart Battery Specification Table
424 *
425 ******************************************************************************/
426
427struct smart_battery_table {
428 ACPI_TABLE_HEADER_DEF u32 warning_level;
429 u32 low_level;
430 u32 critical_level;
431};
432
433/*******************************************************************************
434 *
435 * SLIT - System Locality Distance Information Table
436 *
437 ******************************************************************************/
438
439struct system_locality_info {
440 ACPI_TABLE_HEADER_DEF u64 locality_count;
441 u8 entry[1][1];
442};
443
444/*******************************************************************************
445 *
446 * SPCR - Serial Port Console Redirection table
447 *
448 ******************************************************************************/
449
450struct acpi_table_spcr {
451 ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
452 u8 reserved[3];
453 struct acpi_generic_address serial_port;
454 u8 interrupt_type;
455 u8 pc_interrupt;
456 u32 interrupt;
457 u8 baud_rate;
458 u8 parity;
459 u8 stop_bits;
460 u8 flow_control;
461 u8 terminal_type;
462 u8 reserved2;
463 u16 pci_device_id;
464 u16 pci_vendor_id;
465 u8 pci_bus;
466 u8 pci_device;
467 u8 pci_function;
468 u32 pci_flags;
469 u8 pci_segment;
470 u32 reserved3;
471};
472
473/*******************************************************************************
474 *
475 * SPMI - Server Platform Management Interface table
476 *
477 ******************************************************************************/
478
479struct acpi_table_spmi {
480 ACPI_TABLE_HEADER_DEF u8 reserved;
481 u8 interface_type;
482 u16 spec_revision; /* Version of IPMI */
483 u8 interrupt_type;
484 u8 gpe_number; /* GPE assigned */
485 u8 reserved2;
486 u8 pci_device_flag;
487 u32 interrupt;
488 struct acpi_generic_address ipmi_register;
489 u8 pci_segment;
490 u8 pci_bus;
491 u8 pci_device;
492 u8 pci_function;
493};
494
495/*******************************************************************************
496 *
497 * SRAT - System Resource Affinity Table
498 *
499 ******************************************************************************/
500
501struct system_resource_affinity {
502 ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */
503 u64 reserved2; /* Reserved, must be zero */
504};
505
506/* SRAT common sub-table header */
507
508#define SRAT_SUBTABLE_HEADER \
509 u8 type; \
510 u8 length;
511
512/* Values for Type above */
513
514#define SRAT_CPU_AFFINITY 0
515#define SRAT_MEMORY_AFFINITY 1
516#define SRAT_RESERVED 2
517
518/* SRAT sub-tables */
519
520struct static_resource_alloc {
521 SRAT_SUBTABLE_HEADER u8 proximity_domain_lo;
522 u8 apic_id;
523
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;
531 u8 proximity_domain_hi[3];
532 u32 reserved4; /* Reserved, must be zero */
533};
534
535struct memory_affinity {
536 SRAT_SUBTABLE_HEADER u32 proximity_domain;
537 u16 reserved3;
538 u64 base_address;
539 u64 address_length;
540 u32 reserved4;
117 541
118 /* Flags (32 bits) */ 542 /* Flags (32 bits) */
119 543
120 u8 wb_invd:1; /* 00: The wbinvd instruction works properly */ 544 u8 enabled:1; /* 00: Use affinity structure */
121 u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */ 545 u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */
122 u8 proc_c1:1; /* 02: All processors support C1 state */ 546 u8 non_volatile:1; /* 02: Memory is non-volatile */
123 u8 plvl2_up:1; /* 03: C2 state works on MP system */ 547 u8:5; /* 03-07: Reserved, must be zero */
124 u8 pwr_button:1; /* 04: Power button is handled as a generic feature */ 548 u8 reserved5[3]; /* 08-31: Reserved, must be zero */
125 u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */ 549
126 u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */ 550 u64 reserved6; /* Reserved, must be zero */
127 u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */ 551};
128 u8 tmr_val_ext:1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */ 552
129 u8:7; /* 09-15: Reserved, must be zero */ 553/*******************************************************************************
130 u8 reserved5[2]; /* 16-31: Reserved, must be zero */ 554 *
555 * TCPA - Trusted Computing Platform Alliance table
556 *
557 ******************************************************************************/
558
559struct acpi_table_tcpa {
560 ACPI_TABLE_HEADER_DEF u16 reserved;
561 u32 max_log_length; /* Maximum length for the event log area */
562 u64 log_address; /* Address of the event log area */
131}; 563};
132 564
565/*******************************************************************************
566 *
567 * WDRT - Watchdog Resource Table
568 *
569 ******************************************************************************/
570
571struct acpi_table_wdrt {
572 ACPI_TABLE_HEADER_DEF u32 header_length; /* Watchdog Header Length */
573 u8 pci_segment; /* PCI Segment number */
574 u8 pci_bus; /* PCI Bus number */
575 u8 pci_device; /* PCI Device number */
576 u8 pci_function; /* PCI Function number */
577 u32 timer_period; /* Period of one timer count (msec) */
578 u32 max_count; /* Maximum counter value supported */
579 u32 min_count; /* Minimum counter value */
580 u8 flags;
581 u8 reserved[3];
582 u32 entries; /* Number of watchdog entries that follow */
583};
584
585#if 0 /* Flags, will be converted to macros */
586u8 enabled:1; /* 00: Timer enabled */
587u8:6; /* 01-06: Reserved */
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
638/* Reset to default packing */
639
133#pragma pack() 640#pragma pack()
134 641
135#endif /* __ACTBL1_H__ */ 642#endif /* __ACTBL1_H__ */
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index dfc7ac1094bb..67efe6cad27b 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -44,234 +44,6 @@
44#ifndef __ACTBL2_H__ 44#ifndef __ACTBL2_H__
45#define __ACTBL2_H__ 45#define __ACTBL2_H__
46 46
47/* 47/* Code moved to both actbl.h and actbl1.h */
48 * Prefered Power Management Profiles
49 */
50#define PM_UNSPECIFIED 0
51#define PM_DESKTOP 1
52#define PM_MOBILE 2
53#define PM_WORKSTATION 3
54#define PM_ENTERPRISE_SERVER 4
55#define PM_SOHO_SERVER 5
56#define PM_APPLIANCE_PC 6
57
58/*
59 * ACPI Boot Arch Flags
60 */
61#define BAF_LEGACY_DEVICES 0x0001
62#define BAF_8042_KEYBOARD_CONTROLLER 0x0002
63
64#define FADT2_REVISION_ID 3
65#define FADT2_MINUS_REVISION_ID 2
66
67#pragma pack(1)
68
69/*
70 * ACPI 2.0 Root System Description Table (RSDT)
71 */
72struct rsdt_descriptor_rev2 {
73 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
74 u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
75};
76
77/*
78 * ACPI 2.0 Extended System Description Table (XSDT)
79 */
80struct xsdt_descriptor_rev2 {
81 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
82 u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
83};
84
85/*
86 * ACPI 2.0 Firmware ACPI Control Structure (FACS)
87 */
88struct facs_descriptor_rev2 {
89 char signature[4]; /* ASCII table signature */
90 u32 length; /* Length of structure, in bytes */
91 u32 hardware_signature; /* Hardware configuration signature */
92 u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */
93 u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */
94
95 /* Flags (32 bits) */
96
97 u8 S4bios_f:1; /* 00: S4BIOS support is present */
98 u8:7; /* 01-07: Reserved, must be zero */
99 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
100
101 u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */
102 u8 version; /* Version of this table */
103 u8 reserved3[31]; /* Reserved, must be zero */
104};
105
106/*
107 * ACPI 2.0+ Generic Address Structure (GAS)
108 */
109struct acpi_generic_address {
110 u8 address_space_id; /* Address space where struct or register exists. */
111 u8 register_bit_width; /* Size in bits of given register */
112 u8 register_bit_offset; /* Bit offset within the register */
113 u8 access_width; /* Minimum Access size (ACPI 3.0) */
114 u64 address; /* 64-bit address of struct or register */
115};
116
117#define FADT_REV2_COMMON \
118 u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \
119 u32 V1_dsdt; /* 32-bit physical address of DSDT */ \
120 u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ \
121 u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ \
122 u16 sci_int; /* System vector of SCI interrupt */ \
123 u32 smi_cmd; /* Port address of SMI command port */ \
124 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ \
125 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ \
126 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ \
127 u8 pstate_cnt; /* Processor performance state control*/ \
128 u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ \
129 u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ \
130 u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ \
131 u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ \
132 u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ \
133 u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ \
134 u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ \
135 u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ \
136 u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ \
137 u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ \
138 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ \
139 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ \
140 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ \
141 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ \
142 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ \
143 u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ \
144 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ \
145 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ \
146 u16 flush_size; /* Number of flush strides that need to be read */ \
147 u16 flush_stride; /* Processor's memory cache line width, in bytes */ \
148 u8 duty_offset; /* Processor's duty cycle index in processor's P_CNT reg*/ \
149 u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/ \
150 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ \
151 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ \
152 u8 century; /* Index to century in RTC CMOS RAM */ \
153 u16 iapc_boot_arch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/
154
155/*
156 * ACPI 2.0+ Fixed ACPI Description Table (FADT)
157 */
158struct fadt_descriptor_rev2 {
159 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
160 FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */
161
162 /* Flags (32 bits) */
163
164 u8 wb_invd:1; /* 00: The wbinvd instruction works properly */
165 u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */
166 u8 proc_c1:1; /* 02: All processors support C1 state */
167 u8 plvl2_up:1; /* 03: C2 state works on MP system */
168 u8 pwr_button:1; /* 04: Power button is handled as a generic feature */
169 u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */
170 u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */
171 u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */
172 u8 tmr_val_ext:1; /* 08: tmr_val is 32 bits 0=24-bits */
173 u8 dock_cap:1; /* 09: Docking supported */
174 u8 reset_reg_sup:1; /* 10: System reset via the FADT RESET_REG supported */
175 u8 sealed_case:1; /* 11: No internal expansion capabilities and case is sealed */
176 u8 headless:1; /* 12: No local video capabilities or local input devices */
177 u8 cpu_sw_sleep:1; /* 13: Must execute native instruction after writing SLP_TYPx register */
178
179 u8 pci_exp_wak:1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
180 u8 use_platform_clock:1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */
181 u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
182 u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */
183 u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */
184 u8 force_apic_physical_destination_mode:1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */
185 u8:4; /* 20-23: Reserved, must be zero */
186 u8 reserved3; /* 24-31: Reserved, must be zero */
187
188 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
189 u8 reset_value; /* Value to write to the reset_register port to reset the system */
190 u8 reserved4[3]; /* These three bytes must be zero */
191 u64 xfirmware_ctrl; /* 64-bit physical address of FACS */
192 u64 Xdsdt; /* 64-bit physical address of DSDT */
193 struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */
194 struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */
195 struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */
196 struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */
197 struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */
198 struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */
199 struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */
200 struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */
201};
202
203/* "Down-revved" ACPI 2.0 FADT descriptor */
204
205struct fadt_descriptor_rev2_minus {
206 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
207 FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */
208 u32 flags;
209 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
210 u8 reset_value; /* Value to write to the reset_register port to reset the system. */
211 u8 reserved7[3]; /* Reserved, must be zero */
212};
213
214/* ECDT - Embedded Controller Boot Resources Table */
215
216struct ec_boot_resources {
217 ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */
218 struct acpi_generic_address ec_data; /* Address of EC data register */
219 u32 uid; /* Unique ID - must be same as the EC _UID method */
220 u8 gpe_bit; /* The GPE for the EC */
221 u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */
222};
223
224/* SRAT - System Resource Affinity Table */
225
226struct static_resource_alloc {
227 u8 type;
228 u8 length;
229 u8 proximity_domain_lo;
230 u8 apic_id;
231
232 /* Flags (32 bits) */
233
234 u8 enabled:1; /* 00: Use affinity structure */
235 u8:7; /* 01-07: Reserved, must be zero */
236 u8 reserved3[3]; /* 08-31: Reserved, must be zero */
237
238 u8 local_sapic_eid;
239 u8 proximity_domain_hi[3];
240 u32 reserved4; /* Reserved, must be zero */
241};
242
243struct memory_affinity {
244 u8 type;
245 u8 length;
246 u32 proximity_domain;
247 u16 reserved3;
248 u64 base_address;
249 u64 address_length;
250 u32 reserved4;
251
252 /* Flags (32 bits) */
253
254 u8 enabled:1; /* 00: Use affinity structure */
255 u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */
256 u8 non_volatile:1; /* 02: Memory is non-volatile */
257 u8:5; /* 03-07: Reserved, must be zero */
258 u8 reserved5[3]; /* 08-31: Reserved, must be zero */
259
260 u64 reserved6; /* Reserved, must be zero */
261};
262
263struct system_resource_affinity {
264 ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */
265 u64 reserved2; /* Reserved, must be zero */
266};
267
268/* SLIT - System Locality Distance Information Table */
269
270struct system_locality_info {
271 ACPI_TABLE_HEADER_DEF u64 locality_count;
272 u8 entry[1][1];
273};
274
275#pragma pack()
276 48
277#endif /* __ACTBL2_H__ */ 49#endif /* __ACTBL2_H__ */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 7ca89cde706e..77cf1236b05a 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -44,6 +44,8 @@
44#ifndef __ACTYPES_H__ 44#ifndef __ACTYPES_H__
45#define __ACTYPES_H__ 45#define __ACTYPES_H__
46 46
47/* acpisrc:struct_defs -- for acpisrc conversion */
48
47/* 49/*
48 * 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
49 * and must be either 16, 32, or 64 51 * and must be either 16, 32, or 64
@@ -154,7 +156,6 @@ typedef u64 acpi_physical_address;
154#define ACPI_MAX_PTR ACPI_UINT64_MAX 156#define ACPI_MAX_PTR ACPI_UINT64_MAX
155#define ACPI_SIZE_MAX ACPI_UINT64_MAX 157#define ACPI_SIZE_MAX ACPI_UINT64_MAX
156 158
157#define ALIGNED_ADDRESS_BOUNDARY 0x00000008
158#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ 159#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */
159 160
160/* 161/*
@@ -195,8 +196,6 @@ typedef u64 acpi_physical_address;
195#define ACPI_MAX_PTR ACPI_UINT32_MAX 196#define ACPI_MAX_PTR ACPI_UINT32_MAX
196#define ACPI_SIZE_MAX ACPI_UINT32_MAX 197#define ACPI_SIZE_MAX ACPI_UINT32_MAX
197 198
198#define ALIGNED_ADDRESS_BOUNDARY 0x00000004
199
200/******************************************************************************* 199/*******************************************************************************
201 * 200 *
202 * Types specific to 16-bit targets 201 * Types specific to 16-bit targets
@@ -223,7 +222,6 @@ typedef char *acpi_physical_address;
223#define ACPI_MAX_PTR ACPI_UINT16_MAX 222#define ACPI_MAX_PTR ACPI_UINT16_MAX
224#define ACPI_SIZE_MAX ACPI_UINT16_MAX 223#define ACPI_SIZE_MAX ACPI_UINT16_MAX
225 224
226#define ALIGNED_ADDRESS_BOUNDARY 0x00000002
227#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ 225#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
228 226
229/* 64-bit integers cannot be supported */ 227/* 64-bit integers cannot be supported */
@@ -254,7 +252,7 @@ typedef acpi_native_uint acpi_size;
254/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ 252/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
255 253
256#ifndef acpi_uintptr_t 254#ifndef acpi_uintptr_t
257#define acpi_uintptr_t void * 255#define acpi_uintptr_t void *
258#endif 256#endif
259 257
260/* 258/*
@@ -263,7 +261,7 @@ typedef acpi_native_uint acpi_size;
263 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE) 261 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
264 */ 262 */
265#ifndef acpi_cache_t 263#ifndef acpi_cache_t
266#define acpi_cache_t struct acpi_memory_list 264#define acpi_cache_t struct acpi_memory_list
267#endif 265#endif
268 266
269/* 267/*
@@ -271,7 +269,7 @@ typedef acpi_native_uint acpi_size;
271 * lock and unlock OSL interfaces. 269 * lock and unlock OSL interfaces.
272 */ 270 */
273#ifndef acpi_cpu_flags 271#ifndef acpi_cpu_flags
274#define acpi_cpu_flags acpi_native_uint 272#define acpi_cpu_flags acpi_native_uint
275#endif 273#endif
276 274
277/* 275/*
@@ -292,6 +290,21 @@ typedef acpi_native_uint acpi_size;
292#define ACPI_UNUSED_VAR 290#define ACPI_UNUSED_VAR
293#endif 291#endif
294 292
293/*
294 * All ACPICA functions that are available to the rest of the kernel are
295 * tagged with this macro which can be defined as appropriate for the host.
296 */
297#ifndef ACPI_EXPORT_SYMBOL
298#define ACPI_EXPORT_SYMBOL(symbol)
299#endif
300
301/*
302 * thread_id is returned by acpi_os_get_thread_id.
303 */
304#ifndef acpi_thread_id
305#define acpi_thread_id acpi_native_uint
306#endif
307
295/******************************************************************************* 308/*******************************************************************************
296 * 309 *
297 * Independent types 310 * Independent types
@@ -477,15 +490,15 @@ typedef u64 acpi_integer;
477 */ 490 */
478typedef u32 acpi_table_type; 491typedef u32 acpi_table_type;
479 492
480#define ACPI_TABLE_RSDP (acpi_table_type) 0 493#define ACPI_TABLE_ID_RSDP (acpi_table_type) 0
481#define ACPI_TABLE_DSDT (acpi_table_type) 1 494#define ACPI_TABLE_ID_DSDT (acpi_table_type) 1
482#define ACPI_TABLE_FADT (acpi_table_type) 2 495#define ACPI_TABLE_ID_FADT (acpi_table_type) 2
483#define ACPI_TABLE_FACS (acpi_table_type) 3 496#define ACPI_TABLE_ID_FACS (acpi_table_type) 3
484#define ACPI_TABLE_PSDT (acpi_table_type) 4 497#define ACPI_TABLE_ID_PSDT (acpi_table_type) 4
485#define ACPI_TABLE_SSDT (acpi_table_type) 5 498#define ACPI_TABLE_ID_SSDT (acpi_table_type) 5
486#define ACPI_TABLE_XSDT (acpi_table_type) 6 499#define ACPI_TABLE_ID_XSDT (acpi_table_type) 6
487#define ACPI_TABLE_MAX 6 500#define ACPI_TABLE_ID_MAX 6
488#define NUM_ACPI_TABLE_TYPES (ACPI_TABLE_MAX+1) 501#define ACPI_NUM_TABLE_TYPES (ACPI_TABLE_ID_MAX+1)
489 502
490/* 503/*
491 * Types associated with ACPI names and objects. The first group of 504 * Types associated with ACPI names and objects. The first group of
@@ -816,7 +829,7 @@ struct acpi_system_info {
816 u32 debug_level; 829 u32 debug_level;
817 u32 debug_layer; 830 u32 debug_layer;
818 u32 num_table_types; 831 u32 num_table_types;
819 struct acpi_table_info table_info[NUM_ACPI_TABLE_TYPES]; 832 struct acpi_table_info table_info[ACPI_TABLE_ID_MAX + 1];
820}; 833};
821 834
822/* 835/*
@@ -858,7 +871,7 @@ acpi_status(*acpi_adr_space_handler) (u32 function,
858 void *handler_context, 871 void *handler_context,
859 void *region_context); 872 void *region_context);
860 873
861#define ACPI_DEFAULT_HANDLER NULL 874#define ACPI_DEFAULT_HANDLER NULL
862 875
863typedef 876typedef
864acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, 877acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle,
@@ -911,12 +924,13 @@ struct acpi_compatible_id_list {
911#define ACPI_STA_DEVICE_PRESENT 0x01 924#define ACPI_STA_DEVICE_PRESENT 0x01
912#define ACPI_STA_DEVICE_ENABLED 0x02 925#define ACPI_STA_DEVICE_ENABLED 0x02
913#define ACPI_STA_DEVICE_UI 0x04 926#define ACPI_STA_DEVICE_UI 0x04
914#define ACPI_STA_DEVICE_OK 0x08 927#define ACPI_STA_DEVICE_FUNCTIONING 0x08
928#define ACPI_STA_DEVICE_OK 0x08 /* Synonym */
915#define ACPI_STA_BATTERY_PRESENT 0x10 929#define ACPI_STA_BATTERY_PRESENT 0x10
916 930
917#define ACPI_COMMON_OBJ_INFO \ 931#define ACPI_COMMON_OBJ_INFO \
918 acpi_object_type type; /* ACPI object type */ \ 932 acpi_object_type type; /* ACPI object type */ \
919 acpi_name name /* ACPI object Name */ 933 acpi_name name /* ACPI object Name */
920 934
921struct acpi_obj_info_header { 935struct acpi_obj_info_header {
922 ACPI_COMMON_OBJ_INFO; 936 ACPI_COMMON_OBJ_INFO;
@@ -957,7 +971,7 @@ struct acpi_mem_space_context {
957 * Definitions for Resource Attributes 971 * Definitions for Resource Attributes
958 */ 972 */
959typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */ 973typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */
960typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (64_k-1)+3 */ 974typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (64_k-1)+3 */
961 975
962/* 976/*
963 * Memory Attributes 977 * Memory Attributes
@@ -972,8 +986,8 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (6
972 986
973/* 987/*
974 * IO Attributes 988 * IO Attributes
975 * The ISA Io ranges are: n000-n0_ffh, n400-n4_ffh, n800-n8_ffh, n_c00-n_cFFh. 989 * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh.
976 * The non-ISA Io ranges are: n100-n3_ffh, n500-n7_ffh, n900-n_bFfh, n_cd0-n_fFFh. 990 * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh.
977 */ 991 */
978#define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 992#define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01
979#define ACPI_ISA_ONLY_RANGES (u8) 0x02 993#define ACPI_ISA_ONLY_RANGES (u8) 0x02
@@ -1171,12 +1185,12 @@ struct acpi_resource_source {
1171/* Fields common to all address descriptors, 16/32/64 bit */ 1185/* Fields common to all address descriptors, 16/32/64 bit */
1172 1186
1173#define ACPI_RESOURCE_ADDRESS_COMMON \ 1187#define ACPI_RESOURCE_ADDRESS_COMMON \
1174 u8 resource_type; \ 1188 u8 resource_type; \
1175 u8 producer_consumer; \ 1189 u8 producer_consumer; \
1176 u8 decode; \ 1190 u8 decode; \
1177 u8 min_address_fixed; \ 1191 u8 min_address_fixed; \
1178 u8 max_address_fixed; \ 1192 u8 max_address_fixed; \
1179 union acpi_resource_attribute info; 1193 union acpi_resource_attribute info;
1180 1194
1181struct acpi_resource_address { 1195struct acpi_resource_address {
1182ACPI_RESOURCE_ADDRESS_COMMON}; 1196ACPI_RESOURCE_ADDRESS_COMMON};
@@ -1297,16 +1311,6 @@ struct acpi_resource {
1297 1311
1298#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) 1312#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length)
1299 1313
1300#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
1301#define ACPI_ALIGN_RESOURCE_SIZE(length) (length)
1302#else
1303#define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length)
1304#endif
1305
1306/*
1307 * END: of definitions for Resource Attributes
1308 */
1309
1310struct acpi_pci_routing_table { 1314struct acpi_pci_routing_table {
1311 u32 length; 1315 u32 length;
1312 u32 pin; 1316 u32 pin;
@@ -1315,8 +1319,4 @@ struct acpi_pci_routing_table {
1315 char source[4]; /* pad to 64 bits so sizeof() works in all cases */ 1319 char source[4]; /* pad to 64 bits so sizeof() works in all cases */
1316}; 1320};
1317 1321
1318/*
1319 * END: of definitions for PCI Routing tables
1320 */
1321
1322#endif /* __ACTYPES_H__ */ 1322#endif /* __ACTYPES_H__ */
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index 0927765df6aa..ba039ea1a057 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -50,24 +50,24 @@ extern const u8 acpi_gbl_resource_aml_sizes[];
50 50
51#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) 51#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
52 52
53extern const char *acpi_gbl_BMdecode[2]; 53extern const char *acpi_gbl_bm_decode[];
54extern const char *acpi_gbl_config_decode[4]; 54extern const char *acpi_gbl_config_decode[];
55extern const char *acpi_gbl_consume_decode[2]; 55extern const char *acpi_gbl_consume_decode[];
56extern const char *acpi_gbl_DECdecode[2]; 56extern const char *acpi_gbl_dec_decode[];
57extern const char *acpi_gbl_HEdecode[2]; 57extern const char *acpi_gbl_he_decode[];
58extern const char *acpi_gbl_io_decode[2]; 58extern const char *acpi_gbl_io_decode[];
59extern const char *acpi_gbl_LLdecode[2]; 59extern const char *acpi_gbl_ll_decode[];
60extern const char *acpi_gbl_max_decode[2]; 60extern const char *acpi_gbl_max_decode[];
61extern const char *acpi_gbl_MEMdecode[4]; 61extern const char *acpi_gbl_mem_decode[];
62extern const char *acpi_gbl_min_decode[2]; 62extern const char *acpi_gbl_min_decode[];
63extern const char *acpi_gbl_MTPdecode[4]; 63extern const char *acpi_gbl_mtp_decode[];
64extern const char *acpi_gbl_RNGdecode[4]; 64extern const char *acpi_gbl_rng_decode[];
65extern const char *acpi_gbl_RWdecode[2]; 65extern const char *acpi_gbl_rw_decode[];
66extern const char *acpi_gbl_SHRdecode[2]; 66extern const char *acpi_gbl_shr_decode[];
67extern const char *acpi_gbl_SIZdecode[4]; 67extern const char *acpi_gbl_siz_decode[];
68extern const char *acpi_gbl_TRSdecode[2]; 68extern const char *acpi_gbl_trs_decode[];
69extern const char *acpi_gbl_TTPdecode[2]; 69extern const char *acpi_gbl_ttp_decode[];
70extern const char *acpi_gbl_TYPdecode[4]; 70extern const char *acpi_gbl_typ_decode[];
71#endif 71#endif
72 72
73/* Types for Resource descriptor entries */ 73/* Types for Resource descriptor entries */
@@ -78,6 +78,12 @@ extern const char *acpi_gbl_TYPdecode[4];
78#define ACPI_SMALL_VARIABLE_LENGTH 3 78#define ACPI_SMALL_VARIABLE_LENGTH 3
79 79
80typedef 80typedef
81acpi_status(*acpi_walk_aml_callback) (u8 * aml,
82 u32 length,
83 u32 offset,
84 u8 resource_index, void **context);
85
86typedef
81acpi_status(*acpi_pkg_callback) (u8 object_type, 87acpi_status(*acpi_pkg_callback) (u8 object_type,
82 union acpi_operand_object * source_object, 88 union acpi_operand_object * source_object,
83 union acpi_generic_state * state, 89 union acpi_generic_state * state,
@@ -277,6 +283,8 @@ acpi_ut_ptr_exit(u32 line_number,
277 283
278void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); 284void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id);
279 285
286void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display);
287
280void acpi_ut_report_error(char *module_name, u32 line_number); 288void acpi_ut_report_error(char *module_name, u32 line_number);
281 289
282void acpi_ut_report_info(char *module_name, u32 line_number); 290void acpi_ut_report_info(char *module_name, u32 line_number);
@@ -445,6 +453,8 @@ acpi_ut_short_divide(acpi_integer in_dividend,
445/* 453/*
446 * utmisc 454 * utmisc
447 */ 455 */
456u8 acpi_ut_is_aml_table(struct acpi_table_header *table);
457
448acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); 458acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id);
449 459
450void acpi_ut_release_owner_id(acpi_owner_id * owner_id); 460void acpi_ut_release_owner_id(acpi_owner_id * owner_id);
@@ -460,7 +470,9 @@ void acpi_ut_print_string(char *string, u8 max_length);
460 470
461u8 acpi_ut_valid_acpi_name(u32 name); 471u8 acpi_ut_valid_acpi_name(u32 name);
462 472
463u8 acpi_ut_valid_acpi_character(char character); 473acpi_name acpi_ut_repair_name(acpi_name name);
474
475u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position);
464 476
465acpi_status 477acpi_status
466acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); 478acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer);
@@ -469,6 +481,25 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer);
469 481
470#define ACPI_ANY_BASE 0 482#define ACPI_ANY_BASE 0
471 483
484u32 acpi_ut_dword_byte_swap(u32 value);
485
486void acpi_ut_set_integer_width(u8 revision);
487
488#ifdef ACPI_DEBUG_OUTPUT
489void
490acpi_ut_display_init_pathname(u8 type,
491 struct acpi_namespace_node *obj_handle,
492 char *path);
493#endif
494
495/*
496 * utresrc
497 */
498acpi_status
499acpi_ut_walk_aml_resources(u8 * aml,
500 acpi_size aml_length,
501 acpi_walk_aml_callback user_function, void **context);
502
472acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index); 503acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index);
473 504
474u32 acpi_ut_get_descriptor_length(void *aml); 505u32 acpi_ut_get_descriptor_length(void *aml);
@@ -483,20 +514,6 @@ acpi_status
483acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, 514acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc,
484 u8 ** end_tag); 515 u8 ** end_tag);
485 516
486u8 acpi_ut_generate_checksum(u8 * buffer, u32 length);
487
488u32 acpi_ut_dword_byte_swap(u32 value);
489
490void acpi_ut_set_integer_width(u8 revision);
491
492#ifdef ACPI_DEBUG_OUTPUT
493void
494acpi_ut_display_init_pathname(u8 type,
495 struct acpi_namespace_node *obj_handle,
496 char *path);
497
498#endif
499
500/* 517/*
501 * utmutex - mutex support 518 * utmutex - mutex support
502 */ 519 */
@@ -523,14 +540,15 @@ acpi_ut_initialize_buffer(struct acpi_buffer *buffer,
523 540
524void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line); 541void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line);
525 542
526void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line); 543void *acpi_ut_allocate_zeroed(acpi_size size,
544 u32 component, char *module, u32 line);
527 545
528#ifdef ACPI_DBG_TRACK_ALLOCATIONS 546#ifdef ACPI_DBG_TRACK_ALLOCATIONS
529void *acpi_ut_allocate_and_track(acpi_size size, 547void *acpi_ut_allocate_and_track(acpi_size size,
530 u32 component, char *module, u32 line); 548 u32 component, char *module, u32 line);
531 549
532void *acpi_ut_callocate_and_track(acpi_size size, 550void *acpi_ut_allocate_zeroed_and_track(acpi_size size,
533 u32 component, char *module, u32 line); 551 u32 component, char *module, u32 line);
534 552
535void 553void
536acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line); 554acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line);
@@ -540,6 +558,11 @@ void acpi_ut_dump_allocation_info(void);
540#endif /* ACPI_FUTURE_USAGE */ 558#endif /* ACPI_FUTURE_USAGE */
541 559
542void acpi_ut_dump_allocations(u32 component, char *module); 560void acpi_ut_dump_allocations(u32 component, char *module);
561
562acpi_status
563acpi_ut_create_list(char *list_name,
564 u16 object_size, struct acpi_memory_list **return_cache);
565
543#endif 566#endif
544 567
545#endif /* _ACUTILS_H */ 568#endif /* _ACUTILS_H */
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h
index 37964a59aef8..cf18426a87b1 100644
--- a/include/acpi/amlcode.h
+++ b/include/acpi/amlcode.h
@@ -180,8 +180,10 @@
180#define AML_BANK_FIELD_OP (u16) 0x5b87 180#define AML_BANK_FIELD_OP (u16) 0x5b87
181#define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */ 181#define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */
182 182
183/* Bogus opcodes (they are actually two separate opcodes) */ 183/*
184 184 * Combination opcodes (actually two one-byte opcodes)
185 * Used by the disassembler and i_aSL compiler
186 */
185#define AML_LGREATEREQUAL_OP (u16) 0x9295 187#define AML_LGREATEREQUAL_OP (u16) 0x9295
186#define AML_LLESSEQUAL_OP (u16) 0x9294 188#define AML_LLESSEQUAL_OP (u16) 0x9294
187#define AML_LNOTEQUAL_OP (u16) 0x9293 189#define AML_LNOTEQUAL_OP (u16) 0x9293
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h
index fb4735315ad3..be03818af9d1 100644
--- a/include/acpi/amlresrc.h
+++ b/include/acpi/amlresrc.h
@@ -42,39 +42,45 @@
42 * POSSIBILITY OF SUCH DAMAGES. 42 * POSSIBILITY OF SUCH DAMAGES.
43 */ 43 */
44 44
45/* acpisrc:struct_defs -- for acpisrc conversion */
46
45#ifndef __AMLRESRC_H 47#ifndef __AMLRESRC_H
46#define __AMLRESRC_H 48#define __AMLRESRC_H
47 49
48#define ASL_RESNAME_ADDRESS "_ADR" 50/*
49#define ASL_RESNAME_ALIGNMENT "_ALN" 51 * Resource descriptor tags, as defined in the ACPI specification.
50#define ASL_RESNAME_ADDRESSSPACE "_ASI" 52 * Used to symbolically reference fields within a descriptor.
51#define ASL_RESNAME_ACCESSSIZE "_ASZ" 53 */
52#define ASL_RESNAME_TYPESPECIFICATTRIBUTES "_ATT" 54#define ACPI_RESTAG_ADDRESS "_ADR"
53#define ASL_RESNAME_BASEADDRESS "_BAS" 55#define ACPI_RESTAG_ALIGNMENT "_ALN"
54#define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */ 56#define ACPI_RESTAG_ADDRESSSPACE "_ASI"
55#define ASL_RESNAME_DECODE "_DEC" 57#define ACPI_RESTAG_ACCESSSIZE "_ASZ"
56#define ASL_RESNAME_DMA "_DMA" 58#define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT"
57#define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ 59#define ACPI_RESTAG_BASEADDRESS "_BAS"
58#define ASL_RESNAME_GRANULARITY "_GRA" 60#define ACPI_RESTAG_BUSMASTER "_BM_" /* Master(1), Slave(0) */
59#define ASL_RESNAME_INTERRUPT "_INT" 61#define ACPI_RESTAG_DECODE "_DEC"
60#define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ 62#define ACPI_RESTAG_DMA "_DMA"
61#define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ 63#define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */
62#define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ 64#define ACPI_RESTAG_GRANULARITY "_GRA"
63#define ASL_RESNAME_LENGTH "_LEN" 65#define ACPI_RESTAG_INTERRUPT "_INT"
64#define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ 66#define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */
65#define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ 67#define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */
66#define ASL_RESNAME_MAXADDR "_MAX" 68#define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */
67#define ASL_RESNAME_MINADDR "_MIN" 69#define ACPI_RESTAG_LENGTH "_LEN"
68#define ASL_RESNAME_MAXTYPE "_MAF" 70#define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
69#define ASL_RESNAME_MINTYPE "_MIF" 71#define ACPI_RESTAG_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
70#define ASL_RESNAME_REGISTERBITOFFSET "_RBO" 72#define ACPI_RESTAG_MAXADDR "_MAX"
71#define ASL_RESNAME_REGISTERBITWIDTH "_RBW" 73#define ACPI_RESTAG_MINADDR "_MIN"
72#define ASL_RESNAME_RANGETYPE "_RNG" 74#define ACPI_RESTAG_MAXTYPE "_MAF"
73#define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ 75#define ACPI_RESTAG_MINTYPE "_MIF"
74#define ASL_RESNAME_TRANSLATION "_TRA" 76#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO"
75#define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ 77#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW"
76#define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */ 78#define ACPI_RESTAG_RANGETYPE "_RNG"
77#define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */ 79#define ACPI_RESTAG_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */
80#define ACPI_RESTAG_TRANSLATION "_TRA"
81#define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */
82#define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */
83#define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8_and16(1), 16(2) */
78 84
79/* Default sizes for "small" resource descriptors */ 85/* Default sizes for "small" resource descriptors */
80 86
@@ -109,7 +115,7 @@ struct asl_resource_node {
109 * SMALL descriptors 115 * SMALL descriptors
110 */ 116 */
111#define AML_RESOURCE_SMALL_HEADER_COMMON \ 117#define AML_RESOURCE_SMALL_HEADER_COMMON \
112 u8 descriptor_type; 118 u8 descriptor_type;
113 119
114struct aml_resource_small_header { 120struct aml_resource_small_header {
115AML_RESOURCE_SMALL_HEADER_COMMON}; 121AML_RESOURCE_SMALL_HEADER_COMMON};
@@ -162,8 +168,8 @@ struct aml_resource_end_tag {
162 * LARGE descriptors 168 * LARGE descriptors
163 */ 169 */
164#define AML_RESOURCE_LARGE_HEADER_COMMON \ 170#define AML_RESOURCE_LARGE_HEADER_COMMON \
165 u8 descriptor_type;\ 171 u8 descriptor_type;\
166 u16 resource_length; 172 u16 resource_length;
167 173
168struct aml_resource_large_header { 174struct aml_resource_large_header {
169AML_RESOURCE_LARGE_HEADER_COMMON}; 175AML_RESOURCE_LARGE_HEADER_COMMON};
@@ -194,9 +200,9 @@ struct aml_resource_fixed_memory32 {
194}; 200};
195 201
196#define AML_RESOURCE_ADDRESS_COMMON \ 202#define AML_RESOURCE_ADDRESS_COMMON \
197 u8 resource_type; \ 203 u8 resource_type; \
198 u8 flags; \ 204 u8 flags; \
199 u8 specific_flags; 205 u8 specific_flags;
200 206
201struct aml_resource_address { 207struct aml_resource_address {
202AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON}; 208AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON};
@@ -266,6 +272,7 @@ struct aml_resource_generic_register {
266union aml_resource { 272union aml_resource {
267 /* Descriptor headers */ 273 /* Descriptor headers */
268 274
275 u8 descriptor_type;
269 struct aml_resource_small_header small_header; 276 struct aml_resource_small_header small_header;
270 struct aml_resource_large_header large_header; 277 struct aml_resource_large_header large_header;
271 278
@@ -296,9 +303,9 @@ union aml_resource {
296 /* Utility overlays */ 303 /* Utility overlays */
297 304
298 struct aml_resource_address address; 305 struct aml_resource_address address;
299 u32 u32_item; 306 u32 dword_item;
300 u16 u16_item; 307 u16 word_item;
301 u8 U8item; 308 u8 byte_item;
302}; 309};
303 310
304#endif 311#endif
diff --git a/include/acpi/pdc_intel.h b/include/acpi/pdc_intel.h
index 3fa81d55cd0c..c5472be6f3a2 100644
--- a/include/acpi/pdc_intel.h
+++ b/include/acpi/pdc_intel.h
@@ -18,6 +18,11 @@
18 ACPI_PDC_C_C1_HALT | \ 18 ACPI_PDC_C_C1_HALT | \
19 ACPI_PDC_P_FFH) 19 ACPI_PDC_P_FFH)
20 20
21#define ACPI_PDC_EST_CAPABILITY_SWSMP (ACPI_PDC_SMP_C1PT | \
22 ACPI_PDC_C_C1_HALT | \
23 ACPI_PDC_SMP_P_SWCOORD | \
24 ACPI_PDC_P_FFH)
25
21#define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \ 26#define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \
22 ACPI_PDC_SMP_C1PT | \ 27 ACPI_PDC_SMP_C1PT | \
23 ACPI_PDC_C_C1_HALT) 28 ACPI_PDC_C_C1_HALT)
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 223ec6467108..453a469fd397 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -49,33 +49,41 @@
49 */ 49 */
50 50
51#ifdef ACPI_LIBRARY 51#ifdef ACPI_LIBRARY
52/*
53 * Note: The non-debug version of the acpi_library does not contain any
54 * debug support, for minimimal size. The debug version uses ACPI_FULL_DEBUG
55 */
52#define ACPI_USE_LOCAL_CACHE 56#define ACPI_USE_LOCAL_CACHE
53#endif 57#endif
54 58
55#ifdef ACPI_DUMP_APP 59#ifdef ACPI_ASL_COMPILER
56#ifndef MSDOS
57#define ACPI_DEBUG_OUTPUT 60#define ACPI_DEBUG_OUTPUT
58#endif
59#define ACPI_APPLICATION 61#define ACPI_APPLICATION
60#define ACPI_DISASSEMBLER 62#define ACPI_DISASSEMBLER
61#define ACPI_NO_METHOD_EXECUTION 63#define ACPI_CONSTANT_EVAL_ONLY
64#define ACPI_LARGE_NAMESPACE_NODE
65#define ACPI_DATA_TABLE_DISASSEMBLY
62#endif 66#endif
63 67
64#ifdef ACPI_EXEC_APP 68#ifdef ACPI_EXEC_APP
65#undef DEBUGGER_THREADING 69#undef DEBUGGER_THREADING
66#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED 70#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
67#define ACPI_DEBUG_OUTPUT 71#define ACPI_FULL_DEBUG
68#define ACPI_APPLICATION 72#define ACPI_APPLICATION
69#define ACPI_DEBUGGER 73#define ACPI_DEBUGGER
70#define ACPI_DISASSEMBLER
71#define ACPI_MUTEX_DEBUG 74#define ACPI_MUTEX_DEBUG
75#define ACPI_DBG_TRACK_ALLOCATIONS
72#endif 76#endif
73 77
74#ifdef ACPI_ASL_COMPILER 78#ifdef ACPI_DASM_APP
79#ifndef MSDOS
75#define ACPI_DEBUG_OUTPUT 80#define ACPI_DEBUG_OUTPUT
81#endif
76#define ACPI_APPLICATION 82#define ACPI_APPLICATION
77#define ACPI_DISASSEMBLER 83#define ACPI_DISASSEMBLER
78#define ACPI_CONSTANT_EVAL_ONLY 84#define ACPI_NO_METHOD_EXECUTION
85#define ACPI_LARGE_NAMESPACE_NODE
86#define ACPI_DATA_TABLE_DISASSEMBLY
79#endif 87#endif
80 88
81#ifdef ACPI_APPLICATION 89#ifdef ACPI_APPLICATION
@@ -83,6 +91,12 @@
83#define ACPI_USE_LOCAL_CACHE 91#define ACPI_USE_LOCAL_CACHE
84#endif 92#endif
85 93
94#ifdef ACPI_FULL_DEBUG
95#define ACPI_DEBUGGER
96#define ACPI_DEBUG_OUTPUT
97#define ACPI_DISASSEMBLER
98#endif
99
86/* 100/*
87 * Environment configuration. The purpose of this file is to interface to the 101 * Environment configuration. The purpose of this file is to interface to the
88 * local generation environment. 102 * local generation environment.
@@ -137,7 +151,7 @@
137#elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ 151#elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */
138#include "acdos16.h" 152#include "acdos16.h"
139 153
140#elif defined(__FreeBSD__) 154#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
141#include "acfreebsd.h" 155#include "acfreebsd.h"
142 156
143#elif defined(__NetBSD__) 157#elif defined(__NetBSD__)
@@ -163,17 +177,6 @@
163 177
164#endif 178#endif
165 179
166/*
167 * Memory allocation tracking. Used only if
168 * 1) This is the debug version
169 * 2) This is NOT a 16-bit version of the code (not enough real-mode memory)
170 */
171#ifdef ACPI_DEBUG_OUTPUT
172#if ACPI_MACHINE_WIDTH != 16
173#define ACPI_DBG_TRACK_ALLOCATIONS
174#endif
175#endif
176
177/*! [End] no source code translation !*/ 180/*! [End] no source code translation !*/
178 181
179/* 182/*
@@ -271,8 +274,8 @@ typedef char *va_list;
271/* 274/*
272 * Storage alignment properties 275 * Storage alignment properties
273 */ 276 */
274#define _AUPBND (sizeof (acpi_native_uint) - 1) 277#define _AUPBND (sizeof (acpi_native_int) - 1)
275#define _ADNBND (sizeof (acpi_native_uint) - 1) 278#define _ADNBND (sizeof (acpi_native_int) - 1)
276 279
277/* 280/*
278 * Variable argument list macro definitions 281 * Variable argument list macro definitions
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 2e6d54569ee8..277d35bced03 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -49,30 +49,24 @@
49 49
50#ifdef __KERNEL__ 50#ifdef __KERNEL__
51 51
52#include <linux/config.h>
53#include <linux/string.h> 52#include <linux/string.h>
54#include <linux/kernel.h> 53#include <linux/kernel.h>
54#include <linux/module.h>
55#include <linux/ctype.h> 55#include <linux/ctype.h>
56#include <asm/system.h> 56#include <asm/system.h>
57#include <asm/atomic.h> 57#include <asm/atomic.h>
58#include <asm/div64.h> 58#include <asm/div64.h>
59#include <asm/acpi.h> 59#include <asm/acpi.h>
60#include <linux/slab.h>
60 61
61#define strtoul simple_strtoul 62/* Host-dependent types and defines */
62
63#define ACPI_MACHINE_WIDTH BITS_PER_LONG
64 63
65/* Type(s) for the OSL */ 64#define ACPI_MACHINE_WIDTH BITS_PER_LONG
66 65#define acpi_cache_t kmem_cache_t
67#ifdef ACPI_USE_LOCAL_CACHE 66#define ACPI_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol);
68#define acpi_cache_t struct acpi_memory_list 67#define strtoul simple_strtoul
69#else
70#include <linux/slab.h>
71#define acpi_cache_t kmem_cache_t
72#endif
73 68
74/* Full namespace pathname length limit - arbitrary */ 69/* Full namespace pathname length limit - arbitrary */
75
76#define ACPI_PATHNAME_MAX 256 70#define ACPI_PATHNAME_MAX 256
77 71
78#else /* !__KERNEL__ */ 72#else /* !__KERNEL__ */
@@ -104,4 +98,8 @@
104 98
105#define acpi_cpu_flags unsigned long 99#define acpi_cpu_flags unsigned long
106 100
101#define acpi_thread_id u32
102
103static inline acpi_thread_id acpi_os_get_thread_id(void) { return 0; }
104
107#endif /* __ACLINUX_H__ */ 105#endif /* __ACLINUX_H__ */
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index badf0277b1be..77371b3cdc44 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -2,7 +2,7 @@
2#define __ACPI_PROCESSOR_H 2#define __ACPI_PROCESSOR_H
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/config.h> 5#include <linux/cpu.h>
6 6
7#include <asm/acpi.h> 7#include <asm/acpi.h>
8 8
@@ -18,6 +18,17 @@
18 18
19#define ACPI_PDC_REVISION_ID 0x1 19#define ACPI_PDC_REVISION_ID 0x1
20 20
21#define ACPI_PSD_REV0_REVISION 0 /* Support for _PSD as in ACPI 3.0 */
22#define ACPI_PSD_REV0_ENTRIES 5
23
24/*
25 * Types of coordination defined in ACPI 3.0. Same macros can be used across
26 * P, C and T states
27 */
28#define DOMAIN_COORD_TYPE_SW_ALL 0xfc
29#define DOMAIN_COORD_TYPE_SW_ANY 0xfd
30#define DOMAIN_COORD_TYPE_HW_ALL 0xfe
31
21/* Power Management */ 32/* Power Management */
22 33
23struct acpi_processor_cx; 34struct acpi_processor_cx;
@@ -66,6 +77,14 @@ struct acpi_processor_power {
66 77
67/* Performance Management */ 78/* Performance Management */
68 79
80struct acpi_psd_package {
81 acpi_integer num_entries;
82 acpi_integer revision;
83 acpi_integer domain;
84 acpi_integer coord_type;
85 acpi_integer num_processors;
86} __attribute__ ((packed));
87
69struct acpi_pct_register { 88struct acpi_pct_register {
70 u8 descriptor; 89 u8 descriptor;
71 u16 length; 90 u16 length;
@@ -92,7 +111,9 @@ struct acpi_processor_performance {
92 struct acpi_pct_register status_register; 111 struct acpi_pct_register status_register;
93 unsigned int state_count; 112 unsigned int state_count;
94 struct acpi_processor_px *states; 113 struct acpi_processor_px *states;
95 114 struct acpi_psd_package domain_info;
115 cpumask_t shared_cpu_map;
116 unsigned int shared_type;
96}; 117};
97 118
98/* Throttling Control */ 119/* Throttling Control */
@@ -161,6 +182,9 @@ struct acpi_processor_errata {
161 } piix4; 182 } piix4;
162}; 183};
163 184
185extern int acpi_processor_preregister_performance(
186 struct acpi_processor_performance **performance);
187
164extern int acpi_processor_register_performance(struct acpi_processor_performance 188extern int acpi_processor_register_performance(struct acpi_processor_performance
165 *performance, unsigned int cpu); 189 *performance, unsigned int cpu);
166extern void acpi_processor_unregister_performance(struct 190extern void acpi_processor_unregister_performance(struct
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h
index 3f88715e811e..4b6ef7f21b93 100644
--- a/include/asm-alpha/bitops.h
+++ b/include/asm-alpha/bitops.h
@@ -1,7 +1,6 @@
1#ifndef _ALPHA_BITOPS_H 1#ifndef _ALPHA_BITOPS_H
2#define _ALPHA_BITOPS_H 2#define _ALPHA_BITOPS_H
3 3
4#include <linux/config.h>
5#include <asm/compiler.h> 4#include <asm/compiler.h>
6 5
7/* 6/*
diff --git a/include/asm-alpha/cache.h b/include/asm-alpha/cache.h
index e6d4d1695e25..f199e69a5d0b 100644
--- a/include/asm-alpha/cache.h
+++ b/include/asm-alpha/cache.h
@@ -4,7 +4,6 @@
4#ifndef __ARCH_ALPHA_CACHE_H 4#ifndef __ARCH_ALPHA_CACHE_H
5#define __ARCH_ALPHA_CACHE_H 5#define __ARCH_ALPHA_CACHE_H
6 6
7#include <linux/config.h>
8 7
9/* Bytes per L1 (data) cache line. */ 8/* Bytes per L1 (data) cache line. */
10#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_EV6) 9#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_EV6)
diff --git a/include/asm-alpha/cacheflush.h b/include/asm-alpha/cacheflush.h
index 3fc6ef726d8c..805640b41078 100644
--- a/include/asm-alpha/cacheflush.h
+++ b/include/asm-alpha/cacheflush.h
@@ -1,7 +1,6 @@
1#ifndef _ALPHA_CACHEFLUSH_H 1#ifndef _ALPHA_CACHEFLUSH_H
2#define _ALPHA_CACHEFLUSH_H 2#define _ALPHA_CACHEFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6 5
7/* Caches aren't brain-dead on the Alpha. */ 6/* Caches aren't brain-dead on the Alpha. */
diff --git a/include/asm-alpha/core_cia.h b/include/asm-alpha/core_cia.h
index 3a70d68bfce8..9e0516c0ca27 100644
--- a/include/asm-alpha/core_cia.h
+++ b/include/asm-alpha/core_cia.h
@@ -4,7 +4,6 @@
4/* Define to experiment with fitting everything into one 512MB HAE window. */ 4/* Define to experiment with fitting everything into one 512MB HAE window. */
5#define CIA_ONE_HAE_WINDOW 1 5#define CIA_ONE_HAE_WINDOW 1
6 6
7#include <linux/config.h>
8#include <linux/types.h> 7#include <linux/types.h>
9#include <asm/compiler.h> 8#include <asm/compiler.h>
10 9
diff --git a/include/asm-alpha/core_t2.h b/include/asm-alpha/core_t2.h
index 5c1c40338c82..dba70c62a16c 100644
--- a/include/asm-alpha/core_t2.h
+++ b/include/asm-alpha/core_t2.h
@@ -1,7 +1,6 @@
1#ifndef __ALPHA_T2__H__ 1#ifndef __ALPHA_T2__H__
2#define __ALPHA_T2__H__ 2#define __ALPHA_T2__H__
3 3
4#include <linux/config.h>
5#include <linux/types.h> 4#include <linux/types.h>
6#include <linux/spinlock.h> 5#include <linux/spinlock.h>
7#include <asm/compiler.h> 6#include <asm/compiler.h>
diff --git a/include/asm-alpha/dma-mapping.h b/include/asm-alpha/dma-mapping.h
index 62d0d6681aa9..b9ff4d8cb33a 100644
--- a/include/asm-alpha/dma-mapping.h
+++ b/include/asm-alpha/dma-mapping.h
@@ -1,7 +1,6 @@
1#ifndef _ALPHA_DMA_MAPPING_H 1#ifndef _ALPHA_DMA_MAPPING_H
2#define _ALPHA_DMA_MAPPING_H 2#define _ALPHA_DMA_MAPPING_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_PCI 5#ifdef CONFIG_PCI
7 6
diff --git a/include/asm-alpha/dma.h b/include/asm-alpha/dma.h
index 683afaa3deed..87cfdbdf08fc 100644
--- a/include/asm-alpha/dma.h
+++ b/include/asm-alpha/dma.h
@@ -18,7 +18,6 @@
18#ifndef _ASM_DMA_H 18#ifndef _ASM_DMA_H
19#define _ASM_DMA_H 19#define _ASM_DMA_H
20 20
21#include <linux/config.h>
22#include <linux/spinlock.h> 21#include <linux/spinlock.h>
23#include <asm/io.h> 22#include <asm/io.h>
24 23
diff --git a/include/asm-alpha/floppy.h b/include/asm-alpha/floppy.h
index 289a00d51a90..e177d4180f83 100644
--- a/include/asm-alpha/floppy.h
+++ b/include/asm-alpha/floppy.h
@@ -10,7 +10,6 @@
10#ifndef __ASM_ALPHA_FLOPPY_H 10#ifndef __ASM_ALPHA_FLOPPY_H
11#define __ASM_ALPHA_FLOPPY_H 11#define __ASM_ALPHA_FLOPPY_H
12 12
13#include <linux/config.h>
14 13
15#define fd_inb(port) inb_p(port) 14#define fd_inb(port) inb_p(port)
16#define fd_outb(value,port) outb_p(value,port) 15#define fd_outb(value,port) outb_p(value,port)
diff --git a/include/asm-alpha/hardirq.h b/include/asm-alpha/hardirq.h
index 7bb6a36c96a1..d953e234daa8 100644
--- a/include/asm-alpha/hardirq.h
+++ b/include/asm-alpha/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef _ALPHA_HARDIRQ_H 1#ifndef _ALPHA_HARDIRQ_H
2#define _ALPHA_HARDIRQ_H 2#define _ALPHA_HARDIRQ_H
3 3
4#include <linux/config.h>
5#include <linux/threads.h> 4#include <linux/threads.h>
6#include <linux/cache.h> 5#include <linux/cache.h>
7 6
diff --git a/include/asm-alpha/hw_irq.h b/include/asm-alpha/hw_irq.h
index a310b9efc906..ca9d43b63502 100644
--- a/include/asm-alpha/hw_irq.h
+++ b/include/asm-alpha/hw_irq.h
@@ -1,7 +1,6 @@
1#ifndef _ALPHA_HW_IRQ_H 1#ifndef _ALPHA_HW_IRQ_H
2#define _ALPHA_HW_IRQ_H 2#define _ALPHA_HW_IRQ_H
3 3
4#include <linux/config.h>
5 4
6static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} 5static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
7 6
diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h
index 6126afe27380..2a5cc0b367ab 100644
--- a/include/asm-alpha/ide.h
+++ b/include/asm-alpha/ide.h
@@ -13,7 +13,6 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/config.h>
17 16
18#define IDE_ARCH_OBSOLETE_DEFAULTS 17#define IDE_ARCH_OBSOLETE_DEFAULTS
19 18
diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h
index 3ebbeee753e9..f5ae98c25d1f 100644
--- a/include/asm-alpha/io.h
+++ b/include/asm-alpha/io.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7#include <linux/kernel.h> 6#include <linux/kernel.h>
8#include <asm/compiler.h> 7#include <asm/compiler.h>
9#include <asm/system.h> 8#include <asm/system.h>
diff --git a/include/asm-alpha/irq.h b/include/asm-alpha/irq.h
index 566db720000a..917b9fe372cf 100644
--- a/include/asm-alpha/irq.h
+++ b/include/asm-alpha/irq.h
@@ -8,7 +8,6 @@
8 */ 8 */
9 9
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <linux/config.h>
12 11
13#if defined(CONFIG_ALPHA_GENERIC) 12#if defined(CONFIG_ALPHA_GENERIC)
14 13
@@ -93,8 +92,4 @@ extern void enable_irq(unsigned int);
93struct pt_regs; 92struct pt_regs;
94extern void (*perf_irq)(unsigned long, struct pt_regs *); 93extern void (*perf_irq)(unsigned long, struct pt_regs *);
95 94
96struct irqaction;
97int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
98
99
100#endif /* _ALPHA_IRQ_H */ 95#endif /* _ALPHA_IRQ_H */
diff --git a/include/asm-alpha/kmap_types.h b/include/asm-alpha/kmap_types.h
index 3d10cd3ea75f..3e6735a34c57 100644
--- a/include/asm-alpha/kmap_types.h
+++ b/include/asm-alpha/kmap_types.h
@@ -3,7 +3,6 @@
3 3
4/* Dummy header just to define km_type. */ 4/* Dummy header just to define km_type. */
5 5
6#include <linux/config.h>
7 6
8#ifdef CONFIG_DEBUG_HIGHMEM 7#ifdef CONFIG_DEBUG_HIGHMEM
9# define D(n) __KM_FENCE_##n , 8# define D(n) __KM_FENCE_##n ,
diff --git a/include/asm-alpha/machvec.h b/include/asm-alpha/machvec.h
index ece166a203ec..aced22f91752 100644
--- a/include/asm-alpha/machvec.h
+++ b/include/asm-alpha/machvec.h
@@ -1,7 +1,6 @@
1#ifndef __ALPHA_MACHVEC_H 1#ifndef __ALPHA_MACHVEC_H
2#define __ALPHA_MACHVEC_H 1 2#define __ALPHA_MACHVEC_H 1
3 3
4#include <linux/config.h>
5#include <linux/types.h> 4#include <linux/types.h>
6 5
7/* 6/*
diff --git a/include/asm-alpha/mmu_context.h b/include/asm-alpha/mmu_context.h
index 0c017fc181c1..fe249e9d3360 100644
--- a/include/asm-alpha/mmu_context.h
+++ b/include/asm-alpha/mmu_context.h
@@ -7,7 +7,6 @@
7 * Copyright (C) 1996, Linus Torvalds 7 * Copyright (C) 1996, Linus Torvalds
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <asm/system.h> 10#include <asm/system.h>
12#include <asm/machvec.h> 11#include <asm/machvec.h>
13#include <asm/compiler.h> 12#include <asm/compiler.h>
diff --git a/include/asm-alpha/mmzone.h b/include/asm-alpha/mmzone.h
index 192d80c875b0..64d0ab98fcd8 100644
--- a/include/asm-alpha/mmzone.h
+++ b/include/asm-alpha/mmzone.h
@@ -5,7 +5,6 @@
5#ifndef _ASM_MMZONE_H_ 5#ifndef _ASM_MMZONE_H_
6#define _ASM_MMZONE_H_ 6#define _ASM_MMZONE_H_
7 7
8#include <linux/config.h>
9#include <asm/smp.h> 8#include <asm/smp.h>
10 9
11struct bootmem_data_t; /* stupid forward decl. */ 10struct bootmem_data_t; /* stupid forward decl. */
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h
index 61bcf70b5eac..8c7cd50d4eae 100644
--- a/include/asm-alpha/page.h
+++ b/include/asm-alpha/page.h
@@ -1,7 +1,6 @@
1#ifndef _ALPHA_PAGE_H 1#ifndef _ALPHA_PAGE_H
2#define _ALPHA_PAGE_H 2#define _ALPHA_PAGE_H
3 3
4#include <linux/config.h>
5#include <asm/pal.h> 4#include <asm/pal.h>
6 5
7/* PAGE_SHIFT determines the page size */ 6/* PAGE_SHIFT determines the page size */
diff --git a/include/asm-alpha/param.h b/include/asm-alpha/param.h
index 3ed0b3b02e52..214e7996346f 100644
--- a/include/asm-alpha/param.h
+++ b/include/asm-alpha/param.h
@@ -5,7 +5,6 @@
5 hardware ignores reprogramming. We also need userland buy-in to the 5 hardware ignores reprogramming. We also need userland buy-in to the
6 change in HZ, since this is visible in the wait4 resources etc. */ 6 change in HZ, since this is visible in the wait4 resources etc. */
7 7
8#include <linux/config.h>
9 8
10#ifndef HZ 9#ifndef HZ
11# ifndef CONFIG_ALPHA_RAWHIDE 10# ifndef CONFIG_ALPHA_RAWHIDE
diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h
index 308475642913..471864e8d4c3 100644
--- a/include/asm-alpha/pgalloc.h
+++ b/include/asm-alpha/pgalloc.h
@@ -1,7 +1,6 @@
1#ifndef _ALPHA_PGALLOC_H 1#ifndef _ALPHA_PGALLOC_H
2#define _ALPHA_PGALLOC_H 2#define _ALPHA_PGALLOC_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6#include <linux/mmzone.h> 5#include <linux/mmzone.h>
7 6
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h
index a985cd29b6db..93eaa58b7961 100644
--- a/include/asm-alpha/pgtable.h
+++ b/include/asm-alpha/pgtable.h
@@ -10,7 +10,6 @@
10 * This hopefully works with any standard Alpha page-size, as defined 10 * This hopefully works with any standard Alpha page-size, as defined
11 * in <asm/page.h> (currently 8192). 11 * in <asm/page.h> (currently 8192).
12 */ 12 */
13#include <linux/config.h>
14#include <linux/mmzone.h> 13#include <linux/mmzone.h>
15 14
16#include <asm/page.h> 15#include <asm/page.h>
diff --git a/include/asm-alpha/serial.h b/include/asm-alpha/serial.h
index 7e4b2987d453..9d263e8d8ccc 100644
--- a/include/asm-alpha/serial.h
+++ b/include/asm-alpha/serial.h
@@ -2,7 +2,6 @@
2 * include/asm-alpha/serial.h 2 * include/asm-alpha/serial.h
3 */ 3 */
4 4
5#include <linux/config.h>
6 5
7/* 6/*
8 * This assumes you have a 1.8432 MHz clock for your UART. 7 * This assumes you have a 1.8432 MHz clock for your UART.
diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h
index e1432102be05..a1a1eca6be45 100644
--- a/include/asm-alpha/smp.h
+++ b/include/asm-alpha/smp.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SMP_H 1#ifndef __ASM_SMP_H
2#define __ASM_SMP_H 2#define __ASM_SMP_H
3 3
4#include <linux/config.h>
5#include <linux/threads.h> 4#include <linux/threads.h>
6#include <linux/cpumask.h> 5#include <linux/cpumask.h>
7#include <linux/bitops.h> 6#include <linux/bitops.h>
diff --git a/include/asm-alpha/spinlock.h b/include/asm-alpha/spinlock.h
index 8197c69eff44..0c294c9b0c55 100644
--- a/include/asm-alpha/spinlock.h
+++ b/include/asm-alpha/spinlock.h
@@ -1,7 +1,6 @@
1#ifndef _ALPHA_SPINLOCK_H 1#ifndef _ALPHA_SPINLOCK_H
2#define _ALPHA_SPINLOCK_H 2#define _ALPHA_SPINLOCK_H
3 3
4#include <linux/config.h>
5#include <asm/system.h> 4#include <asm/system.h>
6#include <linux/kernel.h> 5#include <linux/kernel.h>
7#include <asm/current.h> 6#include <asm/current.h>
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
index f3b7b1a59c56..03e9c0e5ed74 100644
--- a/include/asm-alpha/system.h
+++ b/include/asm-alpha/system.h
@@ -1,7 +1,6 @@
1#ifndef __ALPHA_SYSTEM_H 1#ifndef __ALPHA_SYSTEM_H
2#define __ALPHA_SYSTEM_H 2#define __ALPHA_SYSTEM_H
3 3
4#include <linux/config.h>
5#include <asm/pal.h> 4#include <asm/pal.h>
6#include <asm/page.h> 5#include <asm/page.h>
7#include <asm/barrier.h> 6#include <asm/barrier.h>
diff --git a/include/asm-alpha/tlbflush.h b/include/asm-alpha/tlbflush.h
index 9d484c1fdc82..1ca3ed3bd6d3 100644
--- a/include/asm-alpha/tlbflush.h
+++ b/include/asm-alpha/tlbflush.h
@@ -1,7 +1,6 @@
1#ifndef _ALPHA_TLBFLUSH_H 1#ifndef _ALPHA_TLBFLUSH_H
2#define _ALPHA_TLBFLUSH_H 2#define _ALPHA_TLBFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6#include <asm/compiler.h> 5#include <asm/compiler.h>
7 6
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index ef25b6585119..bc6e6a9259dc 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -383,6 +383,8 @@
383#define __NR_inotify_add_watch 445 383#define __NR_inotify_add_watch 445
384#define __NR_inotify_rm_watch 446 384#define __NR_inotify_rm_watch 446
385 385
386#ifdef __KERNEL__
387
386#define NR_SYSCALLS 447 388#define NR_SYSCALLS 447
387 389
388#if defined(__GNUC__) 390#if defined(__GNUC__)
@@ -565,9 +567,8 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, type6 arg6)\
565 _syscall_return(type); \ 567 _syscall_return(type); \
566} 568}
567 569
568#endif /* __LIBRARY__ && __GNUC__ */ 570#endif /* __GNUC__ */
569 571
570#ifdef __KERNEL__
571#define __ARCH_WANT_IPC_PARSE_VERSION 572#define __ARCH_WANT_IPC_PARSE_VERSION
572#define __ARCH_WANT_OLD_READDIR 573#define __ARCH_WANT_OLD_READDIR
573#define __ARCH_WANT_STAT64 574#define __ARCH_WANT_STAT64
@@ -578,7 +579,6 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, type6 arg6)\
578#define __ARCH_WANT_SYS_OLD_GETRLIMIT 579#define __ARCH_WANT_SYS_OLD_GETRLIMIT
579#define __ARCH_WANT_SYS_OLDUMOUNT 580#define __ARCH_WANT_SYS_OLDUMOUNT
580#define __ARCH_WANT_SYS_SIGPENDING 581#define __ARCH_WANT_SYS_SIGPENDING
581#endif
582 582
583#ifdef __KERNEL_SYSCALLS__ 583#ifdef __KERNEL_SYSCALLS__
584 584
@@ -661,4 +661,5 @@ asmlinkage long sys_rt_sigaction(int sig,
661 661
662#define cond_syscall(x) asm(".weak\t" #x "\n" #x " = sys_ni_syscall") 662#define cond_syscall(x) asm(".weak\t" #x "\n" #x " = sys_ni_syscall")
663 663
664#endif /* __KERNEL__ */
664#endif /* _ALPHA_UNISTD_H */ 665#endif /* _ALPHA_UNISTD_H */
diff --git a/include/asm-alpha/vga.h b/include/asm-alpha/vga.h
index 8ca4f6b2da19..ed06f59b544d 100644
--- a/include/asm-alpha/vga.h
+++ b/include/asm-alpha/vga.h
@@ -46,6 +46,6 @@ extern void scr_memcpyw(u16 *d, const u16 *s, unsigned int count);
46#define vga_readb(a) readb((u8 __iomem *)(a)) 46#define vga_readb(a) readb((u8 __iomem *)(a))
47#define vga_writeb(v,a) writeb(v, (u8 __iomem *)(a)) 47#define vga_writeb(v,a) writeb(v, (u8 __iomem *)(a))
48 48
49#define VGA_MAP_MEM(x) ((unsigned long) ioremap(x, 0)) 49#define VGA_MAP_MEM(x,s) ((unsigned long) ioremap(x, s))
50 50
51#endif 51#endif
diff --git a/include/asm-arm/apm.h b/include/asm-arm/apm.h
index 3a50eb759c28..d09113b37e4a 100644
--- a/include/asm-arm/apm.h
+++ b/include/asm-arm/apm.h
@@ -13,7 +13,6 @@
13#ifndef ARM_ASM_SA1100_APM_H 13#ifndef ARM_ASM_SA1100_APM_H
14#define ARM_ASM_SA1100_APM_H 14#define ARM_ASM_SA1100_APM_H
15 15
16#include <linux/config.h>
17#include <linux/apm_bios.h> 16#include <linux/apm_bios.h>
18 17
19/* 18/*
diff --git a/include/asm-arm/arch-aaec2000/io.h b/include/asm-arm/arch-aaec2000/io.h
index 8d67907fd4f0..d710204ac747 100644
--- a/include/asm-arm/arch-aaec2000/io.h
+++ b/include/asm-arm/arch-aaec2000/io.h
@@ -16,6 +16,5 @@
16 */ 16 */
17#define __io(a) ((void __iomem *)(a)) 17#define __io(a) ((void __iomem *)(a))
18#define __mem_pci(a) (a) 18#define __mem_pci(a) (a)
19#define __mem_isa(a) (a)
20 19
21#endif 20#endif
diff --git a/include/asm-arm/arch-aaec2000/memory.h b/include/asm-arm/arch-aaec2000/memory.h
index d8209f8911d6..24b51cccde8f 100644
--- a/include/asm-arm/arch-aaec2000/memory.h
+++ b/include/asm-arm/arch-aaec2000/memory.h
@@ -11,7 +11,6 @@
11#ifndef __ASM_ARCH_MEMORY_H 11#ifndef __ASM_ARCH_MEMORY_H
12#define __ASM_ARCH_MEMORY_H 12#define __ASM_ARCH_MEMORY_H
13 13
14#include <linux/config.h>
15 14
16#define PHYS_OFFSET UL(0xf0000000) 15#define PHYS_OFFSET UL(0xf0000000)
17 16
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_spi.h b/include/asm-arm/arch-at91rm9200/at91rm9200_spi.h
new file mode 100644
index 000000000000..bff5ea45f604
--- /dev/null
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_spi.h
@@ -0,0 +1,81 @@
1/*
2 * include/asm-arm/arch-at91rm9200/at91rm9200_spi.h
3 *
4 * Copyright (C) 2005 Ivan Kokshaysky
5 * Copyright (C) SAN People
6 *
7 * Serial Peripheral Interface (SPI) registers.
8 * Based on AT91RM9200 datasheet revision E.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 */
15
16#ifndef AT91RM9200_SPI_H
17#define AT91RM9200_SPI_H
18
19#define AT91_SPI_CR 0x00 /* Control Register */
20#define AT91_SPI_SPIEN (1 << 0) /* SPI Enable */
21#define AT91_SPI_SPIDIS (1 << 1) /* SPI Disable */
22#define AT91_SPI_SWRST (1 << 7) /* SPI Software Reset */
23#define AT91_SPI_LASTXFER (1 << 24) /* Last Transfer [SAM9261 only] */
24
25#define AT91_SPI_MR 0x04 /* Mode Register */
26#define AT91_SPI_MSTR (1 << 0) /* Master/Slave Mode */
27#define AT91_SPI_PS (1 << 1) /* Peripheral Select */
28#define AT91_SPI_PS_FIXED (0 << 1)
29#define AT91_SPI_PS_VARIABLE (1 << 1)
30#define AT91_SPI_PCSDEC (1 << 2) /* Chip Select Decode */
31#define AT91_SPI_DIV32 (1 << 3) /* Clock Selection */
32#define AT91_SPI_MODFDIS (1 << 4) /* Mode Fault Detection */
33#define AT91_SPI_LLB (1 << 7) /* Local Loopback Enable */
34#define AT91_SPI_PCS (0xf << 16) /* Peripheral Chip Select */
35#define AT91_SPI_DLYBCS (0xff << 24) /* Delay Between Chip Selects */
36
37#define AT91_SPI_RDR 0x08 /* Receive Data Register */
38#define AT91_SPI_RD (0xffff << 0) /* Receive Data */
39#define AT91_SPI_PCS (0xf << 16) /* Peripheral Chip Select */
40
41#define AT91_SPI_TDR 0x0c /* Transmit Data Register */
42#define AT91_SPI_TD (0xffff << 0) /* Transmit Data */
43#define AT91_SPI_PCS (0xf << 16) /* Peripheral Chip Select */
44#define AT91_SPI_LASTXFER (1 << 24) /* Last Transfer [SAM9261 only] */
45
46#define AT91_SPI_SR 0x10 /* Status Register */
47#define AT91_SPI_RDRF (1 << 0) /* Receive Data Register Full */
48#define AT91_SPI_TDRE (1 << 1) /* Transmit Data Register Full */
49#define AT91_SPI_MODF (1 << 2) /* Mode Fault Error */
50#define AT91_SPI_OVRES (1 << 3) /* Overrun Error Status */
51#define AT91_SPI_ENDRX (1 << 4) /* End of RX buffer */
52#define AT91_SPI_ENDTX (1 << 5) /* End of TX buffer */
53#define AT91_SPI_RXBUFF (1 << 6) /* RX Buffer Full */
54#define AT91_SPI_TXBUFE (1 << 7) /* TX Buffer Empty */
55#define AT91_SPI_NSSR (1 << 8) /* NSS Rising [SAM9261 only] */
56#define AT91_SPI_TXEMPTY (1 << 9) /* Transmission Register Empty [SAM9261 only] */
57#define AT91_SPI_SPIENS (1 << 16) /* SPI Enable Status */
58
59#define AT91_SPI_IER 0x14 /* Interrupt Enable Register */
60#define AT91_SPI_IDR 0x18 /* Interrupt Disable Register */
61#define AT91_SPI_IMR 0x1c /* Interrupt Mask Register */
62
63#define AT91_SPI_CSR(n) (0x30 + ((n) * 4)) /* Chip Select Registers 0-3 */
64#define AT91_SPI_CPOL (1 << 0) /* Clock Polarity */
65#define AT91_SPI_NCPHA (1 << 1) /* Clock Phase */
66#define AT91_SPI_CSAAT (1 << 3) /* Chip Select Active After Transfer [SAM9261 only] */
67#define AT91_SPI_BITS (0xf << 4) /* Bits Per Transfer */
68#define AT91_SPI_BITS_8 (0 << 4)
69#define AT91_SPI_BITS_9 (1 << 4)
70#define AT91_SPI_BITS_10 (2 << 4)
71#define AT91_SPI_BITS_11 (3 << 4)
72#define AT91_SPI_BITS_12 (4 << 4)
73#define AT91_SPI_BITS_13 (5 << 4)
74#define AT91_SPI_BITS_14 (6 << 4)
75#define AT91_SPI_BITS_15 (7 << 4)
76#define AT91_SPI_BITS_16 (8 << 4)
77#define AT91_SPI_SCBR (0xff << 8) /* Serial Clock Baud Rate */
78#define AT91_SPI_DLYBS (0xff << 16) /* Delay before SPCK */
79#define AT91_SPI_DLYBCT (0xff << 24) /* Delay between Consecutive Transfers */
80
81#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_ssc.h b/include/asm-arm/arch-at91rm9200/at91rm9200_ssc.h
new file mode 100644
index 000000000000..ac880227147f
--- /dev/null
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_ssc.h
@@ -0,0 +1,96 @@
1/*
2 * include/asm-arm/arch-at91rm9200/at91rm9200_ssc.h
3 *
4 * Copyright (C) SAN People
5 *
6 * Serial Synchronous Controller (SSC) registers.
7 * Based on AT91RM9200 datasheet revision E.
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
15#ifndef AT91RM9200_SSC_H
16#define AT91RM9200_SSC_H
17
18#define AT91_SSC_CR 0x00 /* Control Register */
19#define AT91_SSC_RXEN (1 << 0) /* Receive Enable */
20#define AT91_SSC_RXDIS (1 << 1) /* Receive Disable */
21#define AT91_SSC_TXEN (1 << 8) /* Transmit Enable */
22#define AT91_SSC_TXDIS (1 << 9) /* Transmit Disable */
23#define AT91_SSC_SWRST (1 << 15) /* Software Reset */
24
25#define AT91_SSC_CMR 0x04 /* Clock Mode Register */
26#define AT91_SSC_CMR_DIV (0xfff << 0) /* Clock Divider */
27
28#define AT91_SSC_RCMR 0x10 /* Receive Clock Mode Register */
29#define AT91_SSC_CKS (3 << 0) /* Clock Selection */
30#define AT91_SSC_CKS_DIV (0 << 0)
31#define AT91_SSC_CKS_CLOCK (1 << 0)
32#define AT91_SSC_CKS_PIN (2 << 0)
33#define AT91_SSC_CKO (7 << 2) /* Clock Output Mode Selection */
34#define AT91_SSC_CKO_NONE (0 << 2)
35#define AT91_SSC_CKO_CONTINUOUS (1 << 2)
36#define AT91_SSC_CKI (1 << 5) /* Clock Inversion */
37#define AT91_SSC_CKI_FALLING (0 << 5)
38#define AT91_SSC_CK_RISING (1 << 5)
39#define AT91_SSC_START (0xf << 8) /* Start Selection */
40#define AT91_SSC_START_CONTINUOUS (0 << 8)
41#define AT91_SSC_START_TX_RX (1 << 8)
42#define AT91_SSC_START_LOW_RF (2 << 8)
43#define AT91_SSC_START_HIGH_RF (3 << 8)
44#define AT91_SSC_START_FALLING_RF (4 << 8)
45#define AT91_SSC_START_RISING_RF (5 << 8)
46#define AT91_SSC_START_LEVEL_RF (6 << 8)
47#define AT91_SSC_START_EDGE_RF (7 << 8)
48#define AT91_SSC_STTDLY (0xff << 16) /* Start Delay */
49#define AT91_SSC_PERIOD (0xff << 24) /* Period Divider Selection */
50
51#define AT91_SSC_RFMR 0x14 /* Receive Frame Mode Register */
52#define AT91_SSC_DATALEN (0x1f << 0) /* Data Length */
53#define AT91_SSC_LOOP (1 << 5) /* Loop Mode */
54#define AT91_SSC_MSBF (1 << 7) /* Most Significant Bit First */
55#define AT91_SSC_DATNB (0xf << 8) /* Data Number per Frame */
56#define AT91_SSC_FSLEN (0xf << 16) /* Frame Sync Length */
57#define AT91_SSC_FSOS (7 << 20) /* Frame Sync Output Selection */
58#define AT91_SSC_FSOS_NONE (0 << 20)
59#define AT91_SSC_FSOS_NEGATIVE (1 << 20)
60#define AT91_SSC_FSOS_POSITIVE (2 << 20)
61#define AT91_SSC_FSOS_LOW (3 << 20)
62#define AT91_SSC_FSOS_HIGH (4 << 20)
63#define AT91_SSC_FSOS_TOGGLE (5 << 20)
64#define AT91_SSC_FSEDGE (1 << 24) /* Frame Sync Edge Detection */
65#define AT91_SSC_FSEDGE_POSITIVE (0 << 24)
66#define AT91_SSC_FSEDGE_NEGATIVE (1 << 24)
67
68#define AT91_SSC_TCMR 0x18 /* Transmit Clock Mode Register */
69#define AT91_SSC_TFMR 0x1c /* Transmit Fram Mode Register */
70#define AT91_SSC_DATDEF (1 << 5) /* Data Default Value */
71#define AT91_SSC_FSDEN (1 << 23) /* Frame Sync Data Enable */
72
73#define AT91_SSC_RHR 0x20 /* Receive Holding Register */
74#define AT91_SSC_THR 0x24 /* Transmit Holding Register */
75#define AT91_SSC_RSHR 0x30 /* Receive Sync Holding Register */
76#define AT91_SSC_TSHR 0x34 /* Transmit Sync Holding Register */
77
78#define AT91_SSC_SR 0x40 /* Status Register */
79#define AT91_SSC_TXRDY (1 << 0) /* Transmit Ready */
80#define AT91_SSC_TXEMPTY (1 << 1) /* Transmit Empty */
81#define AT91_SSC_ENDTX (1 << 2) /* End of Transmission */
82#define AT91_SSC_TXBUFE (1 << 3) /* Transmit Buffer Empty */
83#define AT91_SSC_RXRDY (1 << 4) /* Receive Ready */
84#define AT91_SSC_OVRUN (1 << 5) /* Receive Overrun */
85#define AT91_SSC_ENDRX (1 << 6) /* End of Reception */
86#define AT91_SSC_RXBUFF (1 << 7) /* Receive Buffer Full */
87#define AT91_SSC_TXSYN (1 << 10) /* Transmit Sync */
88#define AT91_SSC_RXSYN (1 << 11) /* Receive Sync */
89#define AT91_SSC_TXENA (1 << 16) /* Transmit Enable */
90#define AT91_SSC_RXENA (1 << 17) /* Receive Enable */
91
92#define AT91_SSC_IER 0x44 /* Interrupt Enable Register */
93#define AT91_SSC_IDR 0x48 /* Interrupt Disable Register */
94#define AT91_SSC_IMR 0x4c /* Interrupt Mask Register */
95
96#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h b/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h
index 2910d359f919..0f4c12d5f0cd 100644
--- a/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h
@@ -68,8 +68,17 @@
68#define AT91_DBGU_RHR (AT91_DBGU + 0x18) /* Receiver Holding Register */ 68#define AT91_DBGU_RHR (AT91_DBGU + 0x18) /* Receiver Holding Register */
69#define AT91_DBGU_THR (AT91_DBGU + 0x1c) /* Transmitter Holding Register */ 69#define AT91_DBGU_THR (AT91_DBGU + 0x1c) /* Transmitter Holding Register */
70#define AT91_DBGU_BRGR (AT91_DBGU + 0x20) /* Baud Rate Generator Register */ 70#define AT91_DBGU_BRGR (AT91_DBGU + 0x20) /* Baud Rate Generator Register */
71
71#define AT91_DBGU_CIDR (AT91_DBGU + 0x40) /* Chip ID Register */ 72#define AT91_DBGU_CIDR (AT91_DBGU + 0x40) /* Chip ID Register */
72#define AT91_DBGU_EXID (AT91_DBGU + 0x44) /* Chip ID Extension Register */ 73#define AT91_DBGU_EXID (AT91_DBGU + 0x44) /* Chip ID Extension Register */
74#define AT91_CIDR_VERSION (0x1f << 0) /* Version of the Device */
75#define AT91_CIDR_EPROC (7 << 5) /* Embedded Processor */
76#define AT91_CIDR_NVPSIZ (0xf << 8) /* Nonvolatile Program Memory Size */
77#define AT91_CIDR_NVPSIZ2 (0xf << 12) /* Second Nonvolatile Program Memory Size */
78#define AT91_CIDR_SRAMSIZ (0xf << 16) /* Internal SRAM Size */
79#define AT91_CIDR_ARCH (0xff << 20) /* Architecture Identifier */
80#define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */
81#define AT91_CIDR_EXT (1 << 31) /* Extension Flag */
73 82
74 83
75/* 84/*
@@ -241,7 +250,7 @@
241#define AT91_RTC_SEC (0x7f << 0) /* Current Second */ 250#define AT91_RTC_SEC (0x7f << 0) /* Current Second */
242#define AT91_RTC_MIN (0x7f << 8) /* Current Minute */ 251#define AT91_RTC_MIN (0x7f << 8) /* Current Minute */
243#define AT91_RTC_HOUR (0x3f << 16) /* Current Hour */ 252#define AT91_RTC_HOUR (0x3f << 16) /* Current Hour */
244#define At91_RTC_AMPM (1 << 22) /* Ante Meridiem Post Meridiem Indicator */ 253#define AT91_RTC_AMPM (1 << 22) /* Ante Meridiem Post Meridiem Indicator */
245 254
246#define AT91_RTC_CALR (AT91_RTC + 0x0c) /* Calendar Register */ 255#define AT91_RTC_CALR (AT91_RTC + 0x0c) /* Calendar Register */
247#define AT91_RTC_CENT (0x7f << 0) /* Current Century */ 256#define AT91_RTC_CENT (0x7f << 0) /* Current Century */
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_tc.h b/include/asm-arm/arch-at91rm9200/at91rm9200_tc.h
new file mode 100644
index 000000000000..f4da752bb0c8
--- /dev/null
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_tc.h
@@ -0,0 +1,146 @@
1/*
2 * include/asm-arm/arch-at91rm9200/at91rm9200_tc.h
3 *
4 * Copyright (C) SAN People
5 *
6 * Timer/Counter Unit (TC) registers.
7 * Based on AT91RM9200 datasheet revision E.
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
15#ifndef AT91RM9200_TC_H
16#define AT91RM9200_TC_H
17
18#define AT91_TC_BCR 0xc0 /* TC Block Control Register */
19#define AT91_TC_SYNC (1 << 0) /* Synchro Command */
20
21#define AT91_TC_BMR 0xc4 /* TC Block Mode Register */
22#define AT91_TC_TC0XC0S (3 << 0) /* External Clock Signal 0 Selection */
23#define AT91_TC_TC0XC0S_TCLK0 (0 << 0)
24#define AT91_TC_TC0XC0S_NONE (1 << 0)
25#define AT91_TC_TC0XC0S_TIOA1 (2 << 0)
26#define AT91_TC_TC0XC0S_TIOA2 (3 << 0)
27#define AT91_TC_TC1XC1S (3 << 2) /* External Clock Signal 1 Selection */
28#define AT91_TC_TC1XC1S_TCLK1 (0 << 2)
29#define AT91_TC_TC1XC1S_NONE (1 << 2)
30#define AT91_TC_TC1XC1S_TIOA0 (2 << 2)
31#define AT91_TC_TC1XC1S_TIOA2 (3 << 2)
32#define AT91_TC_TC2XC2S (3 << 4) /* External Clock Signal 2 Selection */
33#define AT91_TC_TC2XC2S_TCLK2 (0 << 4)
34#define AT91_TC_TC2XC2S_NONE (1 << 4)
35#define AT91_TC_TC2XC2S_TIOA0 (2 << 4)
36#define AT91_TC_TC2XC2S_TIOA1 (3 << 4)
37
38
39#define AT91_TC_CCR 0x00 /* Channel Control Register */
40#define AT91_TC_CLKEN (1 << 0) /* Counter Clock Enable Command */
41#define AT91_TC_CLKDIS (1 << 1) /* Counter CLock Disable Command */
42#define AT91_TC_SWTRG (1 << 2) /* Software Trigger Command */
43
44#define AT91_TC_CMR 0x04 /* Channel Mode Register */
45#define AT91_TC_TCCLKS (7 << 0) /* Capture/Waveform Mode: Clock Selection */
46#define AT91_TC_TIMER_CLOCK1 (0 << 0)
47#define AT91_TC_TIMER_CLOCK2 (1 << 0)
48#define AT91_TC_TIMER_CLOCK3 (2 << 0)
49#define AT91_TC_TIMER_CLOCK4 (3 << 0)
50#define AT91_TC_TIMER_CLOCK5 (4 << 0)
51#define AT91_TC_XC0 (5 << 0)
52#define AT91_TC_XC1 (6 << 0)
53#define AT91_TC_XC2 (7 << 0)
54#define AT91_TC_CLKI (1 << 3) /* Capture/Waveform Mode: Clock Invert */
55#define AT91_TC_BURST (3 << 4) /* Capture/Waveform Mode: Burst Signal Selection */
56#define AT91_TC_LDBSTOP (1 << 6) /* Capture Mode: Counter Clock Stopped with TB Loading */
57#define AT91_TC_LDBDIS (1 << 7) /* Capture Mode: Counter Clock Disable with RB Loading */
58#define AT91_TC_ETRGEDG (3 << 8) /* Capture Mode: External Trigger Edge Selection */
59#define AT91_TC_ABETRG (1 << 10) /* Capture Mode: TIOA or TIOB External Trigger Selection */
60#define AT91_TC_CPCTRG (1 << 14) /* Capture Mode: RC Compare Trigger Enable */
61#define AT91_TC_WAVE (1 << 15) /* Capture/Waveform mode */
62#define AT91_TC_LDRA (3 << 16) /* Capture Mode: RA Loading Selection */
63#define AT91_TC_LDRB (3 << 18) /* Capture Mode: RB Loading Selection */
64
65#define AT91_TC_CPCSTOP (1 << 6) /* Waveform Mode: Counter Clock Stopped with RC Compare */
66#define AT91_TC_CPCDIS (1 << 7) /* Waveform Mode: Counter Clock Disable with RC Compare */
67#define AT91_TC_EEVTEDG (3 << 8) /* Waveform Mode: External Event Edge Selection */
68#define AT91_TC_EEVTEDG_NONE (0 << 8)
69#define AT91_TC_EEVTEDG_RISING (1 << 8)
70#define AT91_TC_EEVTEDG_FALLING (2 << 8)
71#define AT91_TC_EEVTEDG_BOTH (3 << 8)
72#define AT91_TC_EEVT (3 << 10) /* Waveform Mode: External Event Selection */
73#define AT91_TC_EEVT_TIOB (0 << 10)
74#define AT91_TC_EEVT_XC0 (1 << 10)
75#define AT91_TC_EEVT_XC1 (2 << 10)
76#define AT91_TC_EEVT_XC2 (3 << 10)
77#define AT91_TC_ENETRG (1 << 12) /* Waveform Mode: External Event Trigger Enable */
78#define AT91_TC_WAVESEL (3 << 13) /* Waveform Mode: Waveform Selection */
79#define AT91_TC_WAVESEL_UP (0 << 13)
80#define AT91_TC_WAVESEL_UP_AUTO (2 << 13)
81#define AT91_TC_WAVESEL_UPDOWN (1 << 13)
82#define AT91_TC_WAVESEL_UPDOWN_AUTO (3 << 13)
83#define AT91_TC_ACPA (3 << 16) /* Waveform Mode: RA Compare Effect on TIOA */
84#define AT91_TC_ACPA_NONE (0 << 16)
85#define AT91_TC_ACPA_SET (1 << 16)
86#define AT91_TC_ACPA_CLEAR (2 << 16)
87#define AT91_TC_ACPA_TOGGLE (3 << 16)
88#define AT91_TC_ACPC (3 << 18) /* Waveform Mode: RC Compre Effect on TIOA */
89#define AT91_TC_ACPC_NONE (0 << 18)
90#define AT91_TC_ACPC_SET (1 << 18)
91#define AT91_TC_ACPC_CLEAR (2 << 18)
92#define AT91_TC_ACPC_TOGGLE (3 << 18)
93#define AT91_TC_AEEVT (3 << 20) /* Waveform Mode: External Event Effect on TIOA */
94#define AT91_TC_AEEVT_NONE (0 << 20)
95#define AT91_TC_AEEVT_SET (1 << 20)
96#define AT91_TC_AEEVT_CLEAR (2 << 20)
97#define AT91_TC_AEEVT_TOGGLE (3 << 20)
98#define AT91_TC_ASWTRG (3 << 22) /* Waveform Mode: Software Trigger Effect on TIOA */
99#define AT91_TC_ASWTRG_NONE (0 << 22)
100#define AT91_TC_ASWTRG_SET (1 << 22)
101#define AT91_TC_ASWTRG_CLEAR (2 << 22)
102#define AT91_TC_ASWTRG_TOGGLE (3 << 22)
103#define AT91_TC_BCPB (3 << 24) /* Waveform Mode: RB Compare Effect on TIOB */
104#define AT91_TC_BCPB_NONE (0 << 24)
105#define AT91_TC_BCPB_SET (1 << 24)
106#define AT91_TC_BCPB_CLEAR (2 << 24)
107#define AT91_TC_BCPB_TOGGLE (3 << 24)
108#define AT91_TC_BCPC (3 << 26) /* Waveform Mode: RC Compare Effect on TIOB */
109#define AT91_TC_BCPC_NONE (0 << 26)
110#define AT91_TC_BCPC_SET (1 << 26)
111#define AT91_TC_BCPC_CLEAR (2 << 26)
112#define AT91_TC_BCPC_TOGGLE (3 << 26)
113#define AT91_TC_BEEVT (3 << 28) /* Waveform Mode: External Event Effect on TIOB */
114#define AT91_TC_BEEVT_NONE (0 << 28)
115#define AT91_TC_BEEVT_SET (1 << 28)
116#define AT91_TC_BEEVT_CLEAR (2 << 28)
117#define AT91_TC_BEEVT_TOGGLE (3 << 28)
118#define AT91_TC_BSWTRG (3 << 30) /* Waveform Mode: Software Trigger Effect on TIOB */
119#define AT91_TC_BSWTRG_NONE (0 << 30)
120#define AT91_TC_BSWTRG_SET (1 << 30)
121#define AT91_TC_BSWTRG_CLEAR (2 << 30)
122#define AT91_TC_BSWTRG_TOGGLE (3 << 30)
123
124#define AT91_TC_CV 0x10 /* Counter Value */
125#define AT91_TC_RA 0x14 /* Register A */
126#define AT91_TC_RB 0x18 /* Register B */
127#define AT91_TC_RC 0x1c /* Register C */
128
129#define AT91_TC_SR 0x20 /* Status Register */
130#define AT91_TC_COVFS (1 << 0) /* Counter Overflow Status */
131#define AT91_TC_LOVRS (1 << 1) /* Load Overrun Status */
132#define AT91_TC_CPAS (1 << 2) /* RA Compare Status */
133#define AT91_TC_CPBS (1 << 3) /* RB Compare Status */
134#define AT91_TC_CPCS (1 << 4) /* RC Compare Status */
135#define AT91_TC_LDRAS (1 << 5) /* RA Loading Status */
136#define AT91_TC_LDRBS (1 << 6) /* RB Loading Status */
137#define AT91_TC_ETRGS (1 << 7) /* External Trigger Status */
138#define AT91_TC_CLKSTA (1 << 16) /* Clock Enabling Status */
139#define AT91_TC_MTIOA (1 << 17) /* TIOA Mirror */
140#define AT91_TC_MTIOB (1 << 18) /* TIOB Mirror */
141
142#define AT91_TC_IER 0x24 /* Interrupt Enable Register */
143#define AT91_TC_IDR 0x28 /* Interrupt Disable Register */
144#define AT91_TC_IMR 0x2c /* Interrupt Mask Register */
145
146#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_udp.h b/include/asm-arm/arch-at91rm9200/at91rm9200_udp.h
new file mode 100644
index 000000000000..951e3f61cef4
--- /dev/null
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_udp.h
@@ -0,0 +1,77 @@
1/*
2 * include/asm-arm/arch-at91rm9200/at91rm9200_udp.h
3 *
4 * Copyright (C) 2005 Ivan Kokshaysky
5 * Copyright (C) SAN People
6 *
7 * USB Device Port (UDP) registers.
8 * Based on AT91RM9200 datasheet revision E.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 */
15
16#ifndef AT91RM9200_UDP_H
17#define AT91RM9200_UDP_H
18
19#define AT91_UDP_FRM_NUM 0x00 /* Frame Number Register */
20#define AT91_UDP_NUM (0x7ff << 0) /* Frame Number */
21#define AT91_UDP_FRM_ERR (1 << 16) /* Frame Error */
22#define AT91_UDP_FRM_OK (1 << 17) /* Frame OK */
23
24#define AT91_UDP_GLB_STAT 0x04 /* Global State Register */
25#define AT91_UDP_FADDEN (1 << 0) /* Function Address Enable */
26#define AT91_UDP_CONFG (1 << 1) /* Configured */
27#define AT91_UDP_ESR (1 << 2) /* Enable Send Resume */
28#define AT91_UDP_RSMINPR (1 << 3) /* Resume has been sent */
29#define AT91_UDP_RMWUPE (1 << 4) /* Remote Wake Up Enable */
30
31#define AT91_UDP_FADDR 0x08 /* Function Address Register */
32#define AT91_UDP_FADD (0x7f << 0) /* Function Address Value */
33#define AT91_UDP_FEN (1 << 8) /* Function Enable */
34
35#define AT91_UDP_IER 0x10 /* Interrupt Enable Register */
36#define AT91_UDP_IDR 0x14 /* Interrupt Disable Register */
37#define AT91_UDP_IMR 0x18 /* Interrupt Mask Register */
38
39#define AT91_UDP_ISR 0x1c /* Interrupt Status Register */
40#define AT91_UDP_EP(n) (1 << (n)) /* Endpoint Interrupt Status */
41#define AT91_UDP_RXSUSP (1 << 8) /* USB Suspend Interrupt Status */
42#define AT91_UDP_RXRSM (1 << 9) /* USB Resume Interrupt Status */
43#define AT91_UDP_EXTRSM (1 << 10) /* External Resume Interrupt Status */
44#define AT91_UDP_SOFINT (1 << 11) /* Start of Frame Interrupt Status */
45#define AT91_UDP_ENDBUSRES (1 << 12) /* End of Bus Reset Interrpt Status */
46#define AT91_UDP_WAKEUP (1 << 13) /* USB Wakeup Interrupt Status */
47
48#define AT91_UDP_ICR 0x20 /* Interrupt Clear Register */
49#define AT91_UDP_RST_EP 0x28 /* Reset Endpoint Register */
50
51#define AT91_UDP_CSR(n) (0x30 + ((n) * 4)) /* Endpoint Control/Status Registers 0-7 */
52#define AT91_UDP_TXCOMP (1 << 0) /* Generates IN packet with data previously written in DPR */
53#define AT91_UDP_RX_DATA_BK0 (1 << 1) /* Receive Data Bank 0 */
54#define AT91_UDP_RXSETUP (1 << 2) /* Send STALL to the host */
55#define AT91_UDP_STALLSENT (1 << 3) /* Stall Sent / Isochronous error (Isochronous endpoints) */
56#define AT91_UDP_TXPKTRDY (1 << 4) /* Transmit Packet Ready */
57#define AT91_UDP_FORCESTALL (1 << 5) /* Force Stall */
58#define AT91_UDP_RX_DATA_BK1 (1 << 6) /* Receive Data Bank 1 */
59#define AT91_UDP_DIR (1 << 7) /* Transfer Direction */
60#define AT91_UDP_EPTYPE (7 << 8) /* Endpoint Type */
61#define AT91_UDP_EPTYPE_CTRL (0 << 8)
62#define AT91_UDP_EPTYPE_ISO_OUT (1 << 8)
63#define AT91_UDP_EPTYPE_BULK_OUT (2 << 8)
64#define AT91_UDP_EPTYPE_INT_OUT (3 << 8)
65#define AT91_UDP_EPTYPE_ISO_IN (5 << 8)
66#define AT91_UDP_EPTYPE_BULK_IN (6 << 8)
67#define AT91_UDP_EPTYPE_INT_IN (7 << 8)
68#define AT91_UDP_DTGLE (1 << 11) /* Data Toggle */
69#define AT91_UDP_EPEDS (1 << 15) /* Endpoint Enable/Disable */
70#define AT91_UDP_RXBYTECNT (0x7ff << 16) /* Number of bytes in FIFO */
71
72#define AT91_UDP_FDR(n) (0x50 + ((n) * 4)) /* Endpoint FIFO Data Registers 0-7 */
73
74#define AT91_UDP_TXVC 0x74 /* Transceiver Control Register */
75#define AT91_UDP_TXVC_TXVDIS (1 << 8) /* Transceiver Disable */
76
77#endif
diff --git a/include/asm-arm/arch-at91rm9200/board.h b/include/asm-arm/arch-at91rm9200/board.h
index 4fdef13d01d4..1fdd70b23809 100644
--- a/include/asm-arm/arch-at91rm9200/board.h
+++ b/include/asm-arm/arch-at91rm9200/board.h
@@ -31,14 +31,9 @@
31#ifndef __ASM_ARCH_BOARD_H 31#ifndef __ASM_ARCH_BOARD_H
32#define __ASM_ARCH_BOARD_H 32#define __ASM_ARCH_BOARD_H
33 33
34 /* Clocks */
35extern unsigned long at91_master_clock;
36
37 /* Serial Port */
38extern int at91_serial_map[AT91_NR_UART];
39extern int at91_console_port;
40
41#include <linux/mtd/partitions.h> 34#include <linux/mtd/partitions.h>
35#include <linux/device.h>
36#include <linux/spi/spi.h>
42 37
43 /* USB Device */ 38 /* USB Device */
44struct at91_udc_data { 39struct at91_udc_data {
@@ -91,10 +86,25 @@ struct at91_nand_data {
91extern void __init at91_add_device_nand(struct at91_nand_data *data); 86extern void __init at91_add_device_nand(struct at91_nand_data *data);
92 87
93 /* I2C*/ 88 /* I2C*/
94void __init at91_add_device_i2c(void); 89extern void __init at91_add_device_i2c(void);
90
91 /* SPI */
92extern void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices);
95 93
96 /* RTC */ 94 /* Serial */
97void __init at91_add_device_rtc(void); 95struct at91_uart_config {
96 unsigned short console_tty; /* tty number of serial console */
97 unsigned short nr_tty; /* number of serial tty's */
98 short tty_map[]; /* map UART to tty number */
99};
100extern struct platform_device *at91_default_console_device;
101extern void __init at91_init_serial(struct at91_uart_config *config);
102
103struct at91_uart_data {
104 short use_dma_tx; /* use transmit DMA? */
105 short use_dma_rx; /* use receive DMA? */
106};
107extern void __init at91_add_device_serial(void);
98 108
99 /* LEDs */ 109 /* LEDs */
100extern u8 at91_leds_cpu; 110extern u8 at91_leds_cpu;
diff --git a/include/asm-arm/arch-at91rm9200/gpio.h b/include/asm-arm/arch-at91rm9200/gpio.h
index 6176ab2dc417..dbde1baaf251 100644
--- a/include/asm-arm/arch-at91rm9200/gpio.h
+++ b/include/asm-arm/arch-at91rm9200/gpio.h
@@ -13,6 +13,8 @@
13#ifndef __ASM_ARCH_AT91RM9200_GPIO_H 13#ifndef __ASM_ARCH_AT91RM9200_GPIO_H
14#define __ASM_ARCH_AT91RM9200_GPIO_H 14#define __ASM_ARCH_AT91RM9200_GPIO_H
15 15
16#include <asm/irq.h>
17
16#define PIN_BASE NR_AIC_IRQS 18#define PIN_BASE NR_AIC_IRQS
17 19
18#define PQFP_GPIO_BANKS 3 /* PQFP package has 3 banks */ 20#define PQFP_GPIO_BANKS 3 /* PQFP package has 3 banks */
@@ -188,6 +190,9 @@ extern int at91_set_multi_drive(unsigned pin, int is_on);
188/* callable at any time */ 190/* callable at any time */
189extern int at91_set_gpio_value(unsigned pin, int value); 191extern int at91_set_gpio_value(unsigned pin, int value);
190extern int at91_get_gpio_value(unsigned pin); 192extern int at91_get_gpio_value(unsigned pin);
193
194extern void at91_gpio_suspend(void);
195extern void at91_gpio_resume(void);
191#endif 196#endif
192 197
193#endif 198#endif
diff --git a/include/asm-arm/arch-at91rm9200/hardware.h b/include/asm-arm/arch-at91rm9200/hardware.h
index 59e6f44d3a0d..235d39d91107 100644
--- a/include/asm-arm/arch-at91rm9200/hardware.h
+++ b/include/asm-arm/arch-at91rm9200/hardware.h
@@ -50,9 +50,12 @@
50#define AT91_VA_BASE_TCB0 AT91_IO_P2V(AT91_BASE_TCB0) 50#define AT91_VA_BASE_TCB0 AT91_IO_P2V(AT91_BASE_TCB0)
51 51
52/* Internal SRAM */ 52/* Internal SRAM */
53#define AT91_BASE_SRAM 0x00200000 /* Internal SRAM base address */ 53#define AT91_SRAM_BASE 0x00200000 /* Internal SRAM base address */
54#define AT91_SRAM_SIZE 0x00004000 /* Internal SRAM SIZE (16Kb) */ 54#define AT91_SRAM_SIZE 0x00004000 /* Internal SRAM SIZE (16Kb) */
55 55
56 /* Internal SRAM is mapped below the IO devices */
57#define AT91_SRAM_VIRT_BASE (AT91_IO_VIRT_BASE - AT91_SRAM_SIZE)
58
56/* Serial ports */ 59/* Serial ports */
57#define AT91_NR_UART 5 /* 4 USART3's and one DBGU port */ 60#define AT91_NR_UART 5 /* 4 USART3's and one DBGU port */
58 61
@@ -81,14 +84,14 @@ static inline unsigned int at91_sys_read(unsigned int reg_offset)
81{ 84{
82 void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS; 85 void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
83 86
84 return readl(addr + reg_offset); 87 return __raw_readl(addr + reg_offset);
85} 88}
86 89
87static inline void at91_sys_write(unsigned int reg_offset, unsigned long value) 90static inline void at91_sys_write(unsigned int reg_offset, unsigned long value)
88{ 91{
89 void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS; 92 void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
90 93
91 writel(value, addr + reg_offset); 94 __raw_writel(value, addr + reg_offset);
92} 95}
93#endif 96#endif
94 97
diff --git a/include/asm-arm/arch-at91rm9200/io.h b/include/asm-arm/arch-at91rm9200/io.h
index 23e670d85c9d..88fd1bebcef3 100644
--- a/include/asm-arm/arch-at91rm9200/io.h
+++ b/include/asm-arm/arch-at91rm9200/io.h
@@ -21,7 +21,6 @@
21#ifndef __ASM_ARCH_IO_H 21#ifndef __ASM_ARCH_IO_H
22#define __ASM_ARCH_IO_H 22#define __ASM_ARCH_IO_H
23 23
24#include <asm/arch/at91rm9200.h>
25#include <asm/io.h> 24#include <asm/io.h>
26 25
27#define IO_SPACE_LIMIT 0xFFFFFFFF 26#define IO_SPACE_LIMIT 0xFFFFFFFF
diff --git a/include/asm-arm/arch-at91rm9200/irqs.h b/include/asm-arm/arch-at91rm9200/irqs.h
index 27b0497f1b36..2dc93b174a8f 100644
--- a/include/asm-arm/arch-at91rm9200/irqs.h
+++ b/include/asm-arm/arch-at91rm9200/irqs.h
@@ -37,8 +37,6 @@
37 * symbols in gpio.h for ones handled indirectly as GPIOs. 37 * symbols in gpio.h for ones handled indirectly as GPIOs.
38 * We make provision for 4 banks of GPIO. 38 * We make provision for 4 banks of GPIO.
39 */ 39 */
40#include <asm/arch/gpio.h>
41
42#define NR_IRQS (NR_AIC_IRQS + (4 * 32)) 40#define NR_IRQS (NR_AIC_IRQS + (4 * 32))
43 41
44 42
diff --git a/include/asm-arm/arch-at91rm9200/memory.h b/include/asm-arm/arch-at91rm9200/memory.h
index 462f1f0ad67c..3c327c404373 100644
--- a/include/asm-arm/arch-at91rm9200/memory.h
+++ b/include/asm-arm/arch-at91rm9200/memory.h
@@ -21,7 +21,7 @@
21#ifndef __ASM_ARCH_MEMORY_H 21#ifndef __ASM_ARCH_MEMORY_H
22#define __ASM_ARCH_MEMORY_H 22#define __ASM_ARCH_MEMORY_H
23 23
24#include <asm/arch/hardware.h> 24#include <asm/hardware.h>
25 25
26#define PHYS_OFFSET (AT91_SDRAM_BASE) 26#define PHYS_OFFSET (AT91_SDRAM_BASE)
27 27
diff --git a/include/asm-arm/arch-at91rm9200/pio.h b/include/asm-arm/arch-at91rm9200/pio.h
deleted file mode 100644
index a89501b4a703..000000000000
--- a/include/asm-arm/arch-at91rm9200/pio.h
+++ /dev/null
@@ -1,115 +0,0 @@
1/*
2 * include/asm-arm/arch-at91rm9200/pio.h
3 *
4 * Copyright (C) 2003 SAN People
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 */
12
13#ifndef __ASM_ARCH_PIO_H
14#define __ASM_ARCH_PIO_H
15
16#include <asm/arch/hardware.h>
17
18static inline void AT91_CfgPIO_USART0(void) {
19 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA17_TXD0 | AT91_PA18_RXD0 | AT91_PA20_CTS0);
20
21 /*
22 * Errata #39 - RTS0 is not internally connected to PA21. We need to drive
23 * the pin manually. Default is off (RTS is active low).
24 */
25 at91_sys_write(AT91_PIOA + PIO_PER, AT91_PA21_RTS0);
26 at91_sys_write(AT91_PIOA + PIO_OER, AT91_PA21_RTS0);
27 at91_sys_write(AT91_PIOA + PIO_SODR, AT91_PA21_RTS0);
28}
29
30static inline void AT91_CfgPIO_USART1(void) {
31 at91_sys_write(AT91_PIOB + PIO_PDR, AT91_PB18_RI1 | AT91_PB19_DTR1
32 | AT91_PB20_TXD1 | AT91_PB21_RXD1 | AT91_PB23_DCD1
33 | AT91_PB24_CTS1 | AT91_PB25_DSR1 | AT91_PB26_RTS1);
34}
35
36static inline void AT91_CfgPIO_USART2(void) {
37 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA22_RXD2 | AT91_PA23_TXD2);
38}
39
40static inline void AT91_CfgPIO_USART3(void) {
41 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA5_TXD3 | AT91_PA6_RXD3);
42 at91_sys_write(AT91_PIOA + PIO_BSR, AT91_PA5_TXD3 | AT91_PA6_RXD3);
43}
44
45static inline void AT91_CfgPIO_DBGU(void) {
46 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA31_DTXD | AT91_PA30_DRXD);
47}
48
49/*
50 * Enable the Two-Wire interface.
51 */
52static inline void AT91_CfgPIO_TWI(void) {
53 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA25_TWD | AT91_PA26_TWCK);
54 at91_sys_write(AT91_PIOA + PIO_ASR, AT91_PA25_TWD | AT91_PA26_TWCK);
55 at91_sys_write(AT91_PIOA + PIO_MDER, AT91_PA25_TWD | AT91_PA26_TWCK); /* open drain */
56}
57
58/*
59 * Enable the Serial Peripheral Interface.
60 */
61static inline void AT91_CfgPIO_SPI(void) {
62 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA0_MISO | AT91_PA1_MOSI | AT91_PA2_SPCK);
63}
64
65static inline void AT91_CfgPIO_SPI_CS0(void) {
66 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA3_NPCS0);
67}
68
69static inline void AT91_CfgPIO_SPI_CS1(void) {
70 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA4_NPCS1);
71}
72
73static inline void AT91_CfgPIO_SPI_CS2(void) {
74 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA5_NPCS2);
75}
76
77static inline void AT91_CfgPIO_SPI_CS3(void) {
78 at91_sys_write(AT91_PIOA + PIO_PDR, AT91_PA6_NPCS3);
79}
80
81/*
82 * Select the DataFlash card.
83 */
84static inline void AT91_CfgPIO_DataFlashCard(void) {
85 at91_sys_write(AT91_PIOB + PIO_PER, AT91_PIO_P(7));
86 at91_sys_write(AT91_PIOB + PIO_OER, AT91_PIO_P(7));
87 at91_sys_write(AT91_PIOB + PIO_CODR, AT91_PIO_P(7));
88}
89
90/*
91 * Enable NAND Flash (SmartMedia) interface.
92 */
93static inline void AT91_CfgPIO_SmartMedia(void) {
94 /* enable PC0=SMCE, PC1=SMOE, PC3=SMWE, A21=CLE, A22=ALE */
95 at91_sys_write(AT91_PIOC + PIO_ASR, AT91_PC0_BFCK | AT91_PC1_BFRDY_SMOE | AT91_PC3_BFBAA_SMWE);
96 at91_sys_write(AT91_PIOC + PIO_PDR, AT91_PC0_BFCK | AT91_PC1_BFRDY_SMOE | AT91_PC3_BFBAA_SMWE);
97
98 /* Configure PC2 as input (signal READY of the SmartMedia) */
99 at91_sys_write(AT91_PIOC + PIO_PER, AT91_PC2_BFAVD); /* enable direct output enable */
100 at91_sys_write(AT91_PIOC + PIO_ODR, AT91_PC2_BFAVD); /* disable output */
101
102 /* Configure PB1 as input (signal Card Detect of the SmartMedia) */
103 at91_sys_write(AT91_PIOB + PIO_PER, AT91_PIO_P(1)); /* enable direct output enable */
104 at91_sys_write(AT91_PIOB + PIO_ODR, AT91_PIO_P(1)); /* disable output */
105}
106
107static inline int AT91_PIO_SmartMedia_RDY(void) {
108 return (at91_sys_read(AT91_PIOC + PIO_PDSR) & AT91_PIO_P(2)) ? 1 : 0;
109}
110
111static inline int AT91_PIO_SmartMedia_CardDetect(void) {
112 return (at91_sys_read(AT91_PIOB + PIO_PDSR) & AT91_PIO_P(1)) ? 1 : 0;
113}
114
115#endif
diff --git a/include/asm-arm/arch-at91rm9200/system.h b/include/asm-arm/arch-at91rm9200/system.h
index 29c42655f05c..8a2ff472e4cf 100644
--- a/include/asm-arm/arch-at91rm9200/system.h
+++ b/include/asm-arm/arch-at91rm9200/system.h
@@ -21,7 +21,7 @@
21#ifndef __ASM_ARCH_SYSTEM_H 21#ifndef __ASM_ARCH_SYSTEM_H
22#define __ASM_ARCH_SYSTEM_H 22#define __ASM_ARCH_SYSTEM_H
23 23
24#include <asm/arch/hardware.h> 24#include <asm/hardware.h>
25 25
26static inline void arch_idle(void) 26static inline void arch_idle(void)
27{ 27{
@@ -48,4 +48,12 @@ static inline void arch_reset(char mode)
48 at91_sys_write(AT91_ST_CR, AT91_ST_WDRST); 48 at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
49} 49}
50 50
51#define ARCH_ID_AT91RM9200 0x09200080
52#define ARCH_ID_AT91SAM9261 0x019000a0
53
54static inline unsigned long arch_identify(void)
55{
56 return at91_sys_read(AT91_DBGU_CIDR) & (AT91_CIDR_EPROC | AT91_CIDR_ARCH);
57}
58
51#endif 59#endif
diff --git a/include/asm-arm/arch-at91rm9200/timex.h b/include/asm-arm/arch-at91rm9200/timex.h
index 3f112dd12587..88687cefe6eb 100644
--- a/include/asm-arm/arch-at91rm9200/timex.h
+++ b/include/asm-arm/arch-at91rm9200/timex.h
@@ -21,7 +21,7 @@
21#ifndef __ASM_ARCH_TIMEX_H 21#ifndef __ASM_ARCH_TIMEX_H
22#define __ASM_ARCH_TIMEX_H 22#define __ASM_ARCH_TIMEX_H
23 23
24#include <asm/arch/hardware.h> 24#include <asm/hardware.h>
25 25
26#define CLOCK_TICK_RATE (AT91_SLOW_CLOCK) 26#define CLOCK_TICK_RATE (AT91_SLOW_CLOCK)
27 27
diff --git a/include/asm-arm/arch-at91rm9200/uncompress.h b/include/asm-arm/arch-at91rm9200/uncompress.h
index 7b38497c24b5..ec7811ab0a52 100644
--- a/include/asm-arm/arch-at91rm9200/uncompress.h
+++ b/include/asm-arm/arch-at91rm9200/uncompress.h
@@ -21,7 +21,7 @@
21#ifndef __ASM_ARCH_UNCOMPRESS_H 21#ifndef __ASM_ARCH_UNCOMPRESS_H
22#define __ASM_ARCH_UNCOMPRESS_H 22#define __ASM_ARCH_UNCOMPRESS_H
23 23
24#include <asm/arch/hardware.h> 24#include <asm/hardware.h>
25 25
26/* 26/*
27 * The following code assumes the serial port has already been 27 * The following code assumes the serial port has already been
diff --git a/include/asm-arm/arch-at91rm9200/vmalloc.h b/include/asm-arm/arch-at91rm9200/vmalloc.h
index 34d9718feb90..4c367eb57f47 100644
--- a/include/asm-arm/arch-at91rm9200/vmalloc.h
+++ b/include/asm-arm/arch-at91rm9200/vmalloc.h
@@ -21,6 +21,6 @@
21#ifndef __ASM_ARCH_VMALLOC_H 21#ifndef __ASM_ARCH_VMALLOC_H
22#define __ASM_ARCH_VMALLOC_H 22#define __ASM_ARCH_VMALLOC_H
23 23
24#define VMALLOC_END (AT91_IO_VIRT_BASE & PGDIR_MASK) 24#define VMALLOC_END (AT91_SRAM_VIRT_BASE & PGDIR_MASK)
25 25
26#endif 26#endif
diff --git a/include/asm-arm/arch-cl7500/acornfb.h b/include/asm-arm/arch-cl7500/acornfb.h
index 3867231a4470..aea6330c9745 100644
--- a/include/asm-arm/arch-cl7500/acornfb.h
+++ b/include/asm-arm/arch-cl7500/acornfb.h
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#define acornfb_valid_pixrate(var) (var->pixclock >= 39325 && var->pixclock <= 40119) 1#define acornfb_valid_pixrate(var) (var->pixclock >= 39325 && var->pixclock <= 40119)
3 2
4static inline void 3static inline void
diff --git a/include/asm-arm/arch-clps711x/hardware.h b/include/asm-arm/arch-clps711x/hardware.h
index 1386871e1a5a..0fdbe72fff2a 100644
--- a/include/asm-arm/arch-clps711x/hardware.h
+++ b/include/asm-arm/arch-clps711x/hardware.h
@@ -22,7 +22,6 @@
22#ifndef __ASM_ARCH_HARDWARE_H 22#ifndef __ASM_ARCH_HARDWARE_H
23#define __ASM_ARCH_HARDWARE_H 23#define __ASM_ARCH_HARDWARE_H
24 24
25#include <linux/config.h>
26 25
27#define CLPS7111_VIRT_BASE 0xff000000 26#define CLPS7111_VIRT_BASE 0xff000000
28#define CLPS7111_BASE CLPS7111_VIRT_BASE 27#define CLPS7111_BASE CLPS7111_VIRT_BASE
diff --git a/include/asm-arm/arch-clps711x/io.h b/include/asm-arm/arch-clps711x/io.h
index 62613b0e2d96..53d790202c19 100644
--- a/include/asm-arm/arch-clps711x/io.h
+++ b/include/asm-arm/arch-clps711x/io.h
@@ -26,7 +26,6 @@
26 26
27#define __io(a) ((void __iomem *)(a)) 27#define __io(a) ((void __iomem *)(a))
28#define __mem_pci(a) (a) 28#define __mem_pci(a) (a)
29#define __mem_isa(a) (a)
30 29
31/* 30/*
32 * We don't support ins[lb]/outs[lb]. Make them fault. 31 * We don't support ins[lb]/outs[lb]. Make them fault.
diff --git a/include/asm-arm/arch-clps711x/memory.h b/include/asm-arm/arch-clps711x/memory.h
index 61d8717406ce..c6e8dcf674de 100644
--- a/include/asm-arm/arch-clps711x/memory.h
+++ b/include/asm-arm/arch-clps711x/memory.h
@@ -20,7 +20,6 @@
20#ifndef __ASM_ARCH_MEMORY_H 20#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H 21#define __ASM_ARCH_MEMORY_H
22 22
23#include <linux/config.h>
24 23
25/* 24/*
26 * Physical DRAM offset. 25 * Physical DRAM offset.
diff --git a/include/asm-arm/arch-clps711x/uncompress.h b/include/asm-arm/arch-clps711x/uncompress.h
index 07157b7e4b20..03d233ae87ce 100644
--- a/include/asm-arm/arch-clps711x/uncompress.h
+++ b/include/asm-arm/arch-clps711x/uncompress.h
@@ -17,7 +17,6 @@
17 * along with this program; if not, write to the Free Software 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 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20#include <linux/config.h>
21#include <asm/arch/io.h> 20#include <asm/arch/io.h>
22#include <asm/hardware.h> 21#include <asm/hardware.h>
23#include <asm/hardware/clps7111.h> 22#include <asm/hardware/clps7111.h>
diff --git a/include/asm-arm/arch-ebsa285/hardware.h b/include/asm-arm/arch-ebsa285/hardware.h
index ec51fe92483b..daad8ee2d194 100644
--- a/include/asm-arm/arch-ebsa285/hardware.h
+++ b/include/asm-arm/arch-ebsa285/hardware.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_ARCH_HARDWARE_H 12#ifndef __ASM_ARCH_HARDWARE_H
13#define __ASM_ARCH_HARDWARE_H 13#define __ASM_ARCH_HARDWARE_H
14 14
15#include <linux/config.h>
16#include <asm/arch/memory.h> 15#include <asm/arch/memory.h>
17 16
18#ifdef CONFIG_ARCH_FOOTBRIDGE 17#ifdef CONFIG_ARCH_FOOTBRIDGE
diff --git a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h
index 776f9d377057..f9c729141860 100644
--- a/include/asm-arm/arch-ebsa285/io.h
+++ b/include/asm-arm/arch-ebsa285/io.h
@@ -24,7 +24,6 @@
24#define __io(a) ((void __iomem *)(PCIO_BASE + (a))) 24#define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
25#if 1 25#if 1
26#define __mem_pci(a) (a) 26#define __mem_pci(a) (a)
27#define __mem_isa(a) ((a) + PCIMEM_BASE)
28#else 27#else
29 28
30static inline void __iomem *___mem_pci(void __iomem *p) 29static inline void __iomem *___mem_pci(void __iomem *p)
@@ -34,14 +33,7 @@ static inline void __iomem *___mem_pci(void __iomem *p)
34 return p; 33 return p;
35} 34}
36 35
37static inline void __iomem *___mem_isa(void __iomem *p)
38{
39 unsigned long a = (unsigned long)p;
40 BUG_ON(a >= 16*1048576);
41 return p + PCIMEM_BASE;
42}
43#define __mem_pci(a) ___mem_pci(a) 36#define __mem_pci(a) ___mem_pci(a)
44#define __mem_isa(a) ___mem_isa(a)
45#endif 37#endif
46 38
47#endif 39#endif
diff --git a/include/asm-arm/arch-ebsa285/memory.h b/include/asm-arm/arch-ebsa285/memory.h
index 99181ffc7e27..cbd7ae64bcc9 100644
--- a/include/asm-arm/arch-ebsa285/memory.h
+++ b/include/asm-arm/arch-ebsa285/memory.h
@@ -19,7 +19,6 @@
19#ifndef __ASM_ARCH_MEMORY_H 19#ifndef __ASM_ARCH_MEMORY_H
20#define __ASM_ARCH_MEMORY_H 20#define __ASM_ARCH_MEMORY_H
21 21
22#include <linux/config.h>
23 22
24#if defined(CONFIG_FOOTBRIDGE_ADDIN) 23#if defined(CONFIG_FOOTBRIDGE_ADDIN)
25/* 24/*
diff --git a/include/asm-arm/arch-ebsa285/vmalloc.h b/include/asm-arm/arch-ebsa285/vmalloc.h
index d1ca955ce434..02598200997d 100644
--- a/include/asm-arm/arch-ebsa285/vmalloc.h
+++ b/include/asm-arm/arch-ebsa285/vmalloc.h
@@ -6,7 +6,6 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11#ifdef CONFIG_ARCH_FOOTBRIDGE 10#ifdef CONFIG_ARCH_FOOTBRIDGE
12#define VMALLOC_END (PAGE_OFFSET + 0x30000000) 11#define VMALLOC_END (PAGE_OFFSET + 0x30000000)
diff --git a/include/asm-arm/arch-ep93xx/ep93xx-regs.h b/include/asm-arm/arch-ep93xx/ep93xx-regs.h
index 71cea0b5841b..8c322975f96e 100644
--- a/include/asm-arm/arch-ep93xx/ep93xx-regs.h
+++ b/include/asm-arm/arch-ep93xx/ep93xx-regs.h
@@ -115,6 +115,8 @@
115#define EP93XX_SYSCON_CLOCK_USH_EN 0x10000000 115#define EP93XX_SYSCON_CLOCK_USH_EN 0x10000000
116#define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08) 116#define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08)
117#define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c) 117#define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c)
118#define EP93XX_SYSCON_CLOCK_SET1 EP93XX_SYSCON_REG(0x20)
119#define EP93XX_SYSCON_CLOCK_SET2 EP93XX_SYSCON_REG(0x24)
118#define EP93XX_SYSCON_DEVICE_CONFIG EP93XX_SYSCON_REG(0x80) 120#define EP93XX_SYSCON_DEVICE_CONFIG EP93XX_SYSCON_REG(0x80)
119#define EP93XX_SYSCON_DEVICE_CONFIG_CRUNCH_ENABLE 0x00800000 121#define EP93XX_SYSCON_DEVICE_CONFIG_CRUNCH_ENABLE 0x00800000
120#define EP93XX_SYSCON_SWLOCK EP93XX_SYSCON_REG(0xc0) 122#define EP93XX_SYSCON_SWLOCK EP93XX_SYSCON_REG(0xc0)
diff --git a/include/asm-arm/arch-ep93xx/platform.h b/include/asm-arm/arch-ep93xx/platform.h
index df9cbb6ef660..d7a34ce20293 100644
--- a/include/asm-arm/arch-ep93xx/platform.h
+++ b/include/asm-arm/arch-ep93xx/platform.h
@@ -8,6 +8,7 @@ void ep93xx_map_io(void);
8void ep93xx_init_irq(void); 8void ep93xx_init_irq(void);
9void ep93xx_init_time(unsigned long); 9void ep93xx_init_time(unsigned long);
10void ep93xx_init_devices(void); 10void ep93xx_init_devices(void);
11void ep93xx_clock_init(void);
11extern struct sys_timer ep93xx_timer; 12extern struct sys_timer ep93xx_timer;
12 13
13 14
diff --git a/include/asm-arm/arch-imx/imx-dma.h b/include/asm-arm/arch-imx/imx-dma.h
index f2063c1d610d..599f03e5a9ef 100644
--- a/include/asm-arm/arch-imx/imx-dma.h
+++ b/include/asm-arm/arch-imx/imx-dma.h
@@ -46,7 +46,7 @@
46struct imx_dma_channel { 46struct imx_dma_channel {
47 const char *name; 47 const char *name;
48 void (*irq_handler) (int, void *, struct pt_regs *); 48 void (*irq_handler) (int, void *, struct pt_regs *);
49 void (*err_handler) (int, void *, struct pt_regs *); 49 void (*err_handler) (int, void *, struct pt_regs *, int errcode);
50 void *data; 50 void *data;
51 dmamode_t dma_mode; 51 dmamode_t dma_mode;
52 struct scatterlist *sg; 52 struct scatterlist *sg;
@@ -58,6 +58,10 @@ struct imx_dma_channel {
58 58
59extern struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS]; 59extern struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS];
60 60
61#define IMX_DMA_ERR_BURST 1
62#define IMX_DMA_ERR_REQUEST 2
63#define IMX_DMA_ERR_TRANSFER 4
64#define IMX_DMA_ERR_BUFFER 8
61 65
62/* The type to distinguish channel numbers parameter from ordinal int type */ 66/* The type to distinguish channel numbers parameter from ordinal int type */
63typedef int imx_dmach_t; 67typedef int imx_dmach_t;
@@ -74,7 +78,7 @@ imx_dma_setup_sg(imx_dmach_t dma_ch,
74int 78int
75imx_dma_setup_handlers(imx_dmach_t dma_ch, 79imx_dma_setup_handlers(imx_dmach_t dma_ch,
76 void (*irq_handler) (int, void *, struct pt_regs *), 80 void (*irq_handler) (int, void *, struct pt_regs *),
77 void (*err_handler) (int, void *, struct pt_regs *), void *data); 81 void (*err_handler) (int, void *, struct pt_regs *, int), void *data);
78 82
79void imx_dma_enable(imx_dmach_t dma_ch); 83void imx_dma_enable(imx_dmach_t dma_ch);
80 84
diff --git a/include/asm-arm/arch-integrator/io.h b/include/asm-arm/arch-integrator/io.h
index 31f2deab51b0..c8f2175948bd 100644
--- a/include/asm-arm/arch-integrator/io.h
+++ b/include/asm-arm/arch-integrator/io.h
@@ -32,6 +32,5 @@
32 32
33#define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a))) 33#define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a)))
34#define __mem_pci(a) (a) 34#define __mem_pci(a) (a)
35#define __mem_isa(a) ((a) + PCI_MEMORY_VADDR)
36 35
37#endif 36#endif
diff --git a/include/asm-arm/arch-integrator/smp.h b/include/asm-arm/arch-integrator/smp.h
index da6981efdc39..ab2c79bb9505 100644
--- a/include/asm-arm/arch-integrator/smp.h
+++ b/include/asm-arm/arch-integrator/smp.h
@@ -1,7 +1,6 @@
1#ifndef ASMARM_ARCH_SMP_H 1#ifndef ASMARM_ARCH_SMP_H
2#define ASMARM_ARCH_SMP_H 2#define ASMARM_ARCH_SMP_H
3 3
4#include <linux/config.h>
5 4
6#include <asm/hardware.h> 5#include <asm/hardware.h>
7#include <asm/io.h> 6#include <asm/io.h>
diff --git a/include/asm-arm/arch-iop3xx/io.h b/include/asm-arm/arch-iop3xx/io.h
index f39046a6ab14..36adbdf5055a 100644
--- a/include/asm-arm/arch-iop3xx/io.h
+++ b/include/asm-arm/arch-iop3xx/io.h
@@ -17,6 +17,5 @@
17 17
18#define __io(p) ((void __iomem *)(p)) 18#define __io(p) ((void __iomem *)(p))
19#define __mem_pci(a) (a) 19#define __mem_pci(a) (a)
20#define __mem_isa(a) (a)
21 20
22#endif 21#endif
diff --git a/include/asm-arm/arch-iop3xx/memory.h b/include/asm-arm/arch-iop3xx/memory.h
index bc62f4b13235..e43ebd984745 100644
--- a/include/asm-arm/arch-iop3xx/memory.h
+++ b/include/asm-arm/arch-iop3xx/memory.h
@@ -5,7 +5,6 @@
5#ifndef __ASM_ARCH_MEMORY_H 5#ifndef __ASM_ARCH_MEMORY_H
6#define __ASM_ARCH_MEMORY_H 6#define __ASM_ARCH_MEMORY_H
7 7
8#include <linux/config.h>
9#include <asm/hardware.h> 8#include <asm/hardware.h>
10 9
11/* 10/*
diff --git a/include/asm-arm/arch-iop3xx/timex.h b/include/asm-arm/arch-iop3xx/timex.h
index 472badb451c4..14ca8d0f7b29 100644
--- a/include/asm-arm/arch-iop3xx/timex.h
+++ b/include/asm-arm/arch-iop3xx/timex.h
@@ -3,7 +3,6 @@
3 * 3 *
4 * IOP3xx architecture timex specifications 4 * IOP3xx architecture timex specifications
5 */ 5 */
6#include <linux/config.h>
7#include <asm/hardware.h> 6#include <asm/hardware.h>
8 7
9#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) 8#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244)
diff --git a/include/asm-arm/arch-iop3xx/uncompress.h b/include/asm-arm/arch-iop3xx/uncompress.h
index c98eb6254b1f..fbdd5af644fe 100644
--- a/include/asm-arm/arch-iop3xx/uncompress.h
+++ b/include/asm-arm/arch-iop3xx/uncompress.h
@@ -1,7 +1,6 @@
1/* 1/*
2 * linux/include/asm-arm/arch-iop3xx/uncompress.h 2 * linux/include/asm-arm/arch-iop3xx/uncompress.h
3 */ 3 */
4#include <linux/config.h>
5#include <asm/types.h> 4#include <asm/types.h>
6#include <asm/mach-types.h> 5#include <asm/mach-types.h>
7#include <linux/serial_reg.h> 6#include <linux/serial_reg.h>
diff --git a/include/asm-arm/arch-ixp23xx/entry-macro.S b/include/asm-arm/arch-ixp23xx/entry-macro.S
index 0ef4e6016ac4..867761677b57 100644
--- a/include/asm-arm/arch-ixp23xx/entry-macro.S
+++ b/include/asm-arm/arch-ixp23xx/entry-macro.S
@@ -8,7 +8,7 @@
8 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 8 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
9 ldr \irqnr, =(IXP23XX_INTC_VIRT + IXP23XX_INTR_IRQ_ENC_ST_OFFSET) 9 ldr \irqnr, =(IXP23XX_INTC_VIRT + IXP23XX_INTR_IRQ_ENC_ST_OFFSET)
10 ldr \irqnr, [\irqnr] @ get interrupt number 10 ldr \irqnr, [\irqnr] @ get interrupt number
11 cmp \irqnr, #0x0 @ suprious interrupt ? 11 cmp \irqnr, #0x0 @ spurious interrupt ?
12 movne \irqnr, \irqnr, lsr #2 @ skip unwanted low order bits 12 movne \irqnr, \irqnr, lsr #2 @ skip unwanted low order bits
13 subne \irqnr, \irqnr, #1 @ convert to 0 based 13 subne \irqnr, \irqnr, #1 @ convert to 0 based
14 14
diff --git a/include/asm-arm/arch-ixp23xx/ixp23xx.h b/include/asm-arm/arch-ixp23xx/ixp23xx.h
index e49e1ca61b1a..d0a72201ee96 100644
--- a/include/asm-arm/arch-ixp23xx/ixp23xx.h
+++ b/include/asm-arm/arch-ixp23xx/ixp23xx.h
@@ -124,6 +124,7 @@
124 124
125#define IXP23XX_EXP_UNIT_FUSE IXP23XX_EXP_CFG_REG(0x28) 125#define IXP23XX_EXP_UNIT_FUSE IXP23XX_EXP_CFG_REG(0x28)
126#define IXP23XX_EXP_MSF_MUX IXP23XX_EXP_CFG_REG(0x30) 126#define IXP23XX_EXP_MSF_MUX IXP23XX_EXP_CFG_REG(0x30)
127#define IXP23XX_EXP_CFG_FUSE IXP23XX_EXP_CFG_REG(0x34)
127 128
128#define IXP23XX_EXP_BUS_PHYS 0x90000000 129#define IXP23XX_EXP_BUS_PHYS 0x90000000
129#define IXP23XX_EXP_BUS_WINDOW_SIZE 0x01000000 130#define IXP23XX_EXP_BUS_WINDOW_SIZE 0x01000000
@@ -251,7 +252,7 @@
251 * CAP CSRs. 252 * CAP CSRs.
252 ****************************************************************************/ 253 ****************************************************************************/
253#define IXP23XX_GLOBAL_REG(x) ((volatile unsigned long *)(IXP23XX_CAP_CSR_VIRT + 0x4a00 + (x))) 254#define IXP23XX_GLOBAL_REG(x) ((volatile unsigned long *)(IXP23XX_CAP_CSR_VIRT + 0x4a00 + (x)))
254#define IXP23XX_PROD_IDG IXP23XX_GLOBAL_REG(0x00) 255#define IXP23XX_PRODUCT_ID IXP23XX_GLOBAL_REG(0x00)
255#define IXP23XX_MISC_CONTROL IXP23XX_GLOBAL_REG(0x04) 256#define IXP23XX_MISC_CONTROL IXP23XX_GLOBAL_REG(0x04)
256#define IXP23XX_MSF_CLK_CNTRL IXP23XX_GLOBAL_REG(0x08) 257#define IXP23XX_MSF_CLK_CNTRL IXP23XX_GLOBAL_REG(0x08)
257#define IXP23XX_RESET0 IXP23XX_GLOBAL_REG(0x0c) 258#define IXP23XX_RESET0 IXP23XX_GLOBAL_REG(0x0c)
@@ -265,6 +266,8 @@
265#define IXP23XX_PCI_UNIT_RESET (1 << 1) 266#define IXP23XX_PCI_UNIT_RESET (1 << 1)
266#define IXP23XX_XSCALE_RESET (1 << 0) 267#define IXP23XX_XSCALE_RESET (1 << 0)
267 268
269#define IXP23XX_UENGINE_CSR_VIRT_BASE (IXP23XX_CAP_CSR_VIRT + 0x18000)
270
268 271
269/**************************************************************************** 272/****************************************************************************
270 * PCI CSRs. 273 * PCI CSRs.
diff --git a/include/asm-arm/arch-ixp23xx/platform.h b/include/asm-arm/arch-ixp23xx/platform.h
index e4d99060a049..19a73b39c864 100644
--- a/include/asm-arm/arch-ixp23xx/platform.h
+++ b/include/asm-arm/arch-ixp23xx/platform.h
@@ -14,6 +14,21 @@
14 14
15#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
16 16
17extern inline unsigned long ixp2000_reg_read(volatile void *reg)
18{
19 return *((volatile unsigned long *)reg);
20}
21
22extern inline void ixp2000_reg_write(volatile void *reg, unsigned long val)
23{
24 *((volatile unsigned long *)reg) = val;
25}
26
27extern inline void ixp2000_reg_wrb(volatile void *reg, unsigned long val)
28{
29 *((volatile unsigned long *)reg) = val;
30}
31
17struct pci_sys_data; 32struct pci_sys_data;
18 33
19void ixp23xx_map_io(void); 34void ixp23xx_map_io(void);
diff --git a/include/asm-arm/arch-ixp4xx/dma.h b/include/asm-arm/arch-ixp4xx/dma.h
index b1a071ecebc8..789f7f53c357 100644
--- a/include/asm-arm/arch-ixp4xx/dma.h
+++ b/include/asm-arm/arch-ixp4xx/dma.h
@@ -11,7 +11,6 @@
11#ifndef __ASM_ARCH_DMA_H 11#ifndef __ASM_ARCH_DMA_H
12#define __ASM_ARCH_DMA_H 12#define __ASM_ARCH_DMA_H
13 13
14#include <linux/config.h>
15#include <linux/device.h> 14#include <linux/device.h>
16#include <linux/pci.h> 15#include <linux/pci.h>
17#include <asm/page.h> 16#include <asm/page.h>
diff --git a/include/asm-arm/arch-l7200/io.h b/include/asm-arm/arch-l7200/io.h
index cab8ad0adf09..cd080d8384d9 100644
--- a/include/asm-arm/arch-l7200/io.h
+++ b/include/asm-arm/arch-l7200/io.h
@@ -19,7 +19,6 @@
19 */ 19 */
20#define __io_pci(a) ((void __iomem *)(PCIO_BASE + (a))) 20#define __io_pci(a) ((void __iomem *)(PCIO_BASE + (a)))
21#define __mem_pci(a) (a) 21#define __mem_pci(a) (a)
22#define __mem_isa(a) (a)
23 22
24#define __ioaddr(p) __io_pci(p) 23#define __ioaddr(p) __io_pci(p)
25 24
diff --git a/include/asm-arm/arch-lh7a40x/clocks.h b/include/asm-arm/arch-lh7a40x/clocks.h
new file mode 100644
index 000000000000..bee02fd8dab1
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/clocks.h
@@ -0,0 +1,20 @@
1/* include/asm-arm/arch-lh7a40x/clocks.h
2 *
3 * Copyright (C) 2004 Marc Singer
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/config.h>
12
13#ifndef __ASM_ARCH_CLOCKS_H
14#define __ASM_ARCH_CLOCKS_H
15
16unsigned int fclkfreq_get (void);
17unsigned int hclkfreq_get (void);
18unsigned int pclkfreq_get (void);
19
20#endif /* _ASM_ARCH_CLOCKS_H */
diff --git a/include/asm-arm/arch-lh7a40x/constants.h b/include/asm-arm/arch-lh7a40x/constants.h
index 52c1cb9c39c6..51de96e87faf 100644
--- a/include/asm-arm/arch-lh7a40x/constants.h
+++ b/include/asm-arm/arch-lh7a40x/constants.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_ARCH_CONSTANTS_H 12#ifndef __ASM_ARCH_CONSTANTS_H
13#define __ASM_ARCH_CONSTANTS_H 13#define __ASM_ARCH_CONSTANTS_H
14 14
15#include <linux/config.h>
16 15
17/* Addressing constants */ 16/* Addressing constants */
18 17
@@ -29,8 +28,7 @@
29 28
30#if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404) 29#if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404)
31 30
32# define IOBARRIER_PHYS 0xc0000000 /* Start of SDRAM */ 31# define IOBARRIER_PHYS 0x10000000 /* Second bank, fastest timing */
33/*# define IOBARRIER_PHYS 0x00000000 */ /* Start of flash */
34# define IOBARRIER_VIRT 0xf0000000 32# define IOBARRIER_VIRT 0xf0000000
35# define IOBARRIER_SIZE PAGE_SIZE 33# define IOBARRIER_SIZE PAGE_SIZE
36 34
@@ -53,6 +51,9 @@
53# define CPLD08_PHYS CPLDX_PHYS (0x08) 51# define CPLD08_PHYS CPLDX_PHYS (0x08)
54# define CPLD08_VIRT CPLDX_VIRT (0x08) 52# define CPLD08_VIRT CPLDX_VIRT (0x08)
55# define CPLD08_SIZE PAGE_SIZE 53# define CPLD08_SIZE PAGE_SIZE
54# define CPLD0A_PHYS CPLDX_PHYS (0x0a)
55# define CPLD0A_VIRT CPLDX_VIRT (0x0a)
56# define CPLD0A_SIZE PAGE_SIZE
56# define CPLD0C_PHYS CPLDX_PHYS (0x0c) 57# define CPLD0C_PHYS CPLDX_PHYS (0x0c)
57# define CPLD0C_VIRT CPLDX_VIRT (0x0c) 58# define CPLD0C_VIRT CPLDX_VIRT (0x0c)
58# define CPLD0C_SIZE PAGE_SIZE 59# define CPLD0C_SIZE PAGE_SIZE
@@ -84,5 +85,7 @@
84#define XTAL_IN 14745600 /* 14.7456 MHz crystal */ 85#define XTAL_IN 14745600 /* 14.7456 MHz crystal */
85#define PLL_CLOCK (XTAL_IN * 21) /* 309 MHz PLL clock */ 86#define PLL_CLOCK (XTAL_IN * 21) /* 309 MHz PLL clock */
86#define MAX_HCLK_KHZ 100000 /* HCLK max limit ~100MHz */ 87#define MAX_HCLK_KHZ 100000 /* HCLK max limit ~100MHz */
88#define HCLK (99993600)
89//#define HCLK (119808000)
87 90
88#endif /* __ASM_ARCH_CONSTANTS_H */ 91#endif /* __ASM_ARCH_CONSTANTS_H */
diff --git a/include/asm-arm/arch-lh7a40x/dma.h b/include/asm-arm/arch-lh7a40x/dma.h
index 15492e3253f6..a8cbd14bbf9d 100644
--- a/include/asm-arm/arch-lh7a40x/dma.h
+++ b/include/asm-arm/arch-lh7a40x/dma.h
@@ -1,9 +1,86 @@
1/* include/asm-arm/arch-lh7a40x/dma.h 1/* include/asm-arm/arch-lh7a40x/dma.h
2 * 2 *
3 * Copyright (C) 2003 Coastal Environmental Systems 3 * Copyright (C) 2005 Marc Singer
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License 6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation. 7 * version 2 as published by the Free Software Foundation.
8 * 8 *
9 */ 9 */
10
11typedef enum {
12 DMA_M2M0 = 0,
13 DMA_M2M1 = 1,
14 DMA_M2P0 = 2, /* Tx */
15 DMA_M2P1 = 3, /* Rx */
16 DMA_M2P2 = 4, /* Tx */
17 DMA_M2P3 = 5, /* Rx */
18 DMA_M2P4 = 6, /* Tx - AC97 */
19 DMA_M2P5 = 7, /* Rx - AC97 */
20 DMA_M2P6 = 8, /* Tx */
21 DMA_M2P7 = 9, /* Rx */
22} dma_device_t;
23
24#define DMA_LENGTH_MAX ((64*1024) - 4) /* bytes */
25
26#define DMAC_GCA __REG(DMAC_PHYS + 0x2b80)
27#define DMAC_GIR __REG(DMAC_PHYS + 0x2bc0)
28
29#define DMAC_GIR_MMI1 (1<<11)
30#define DMAC_GIR_MMI0 (1<<10)
31#define DMAC_GIR_MPI8 (1<<9)
32#define DMAC_GIR_MPI9 (1<<8)
33#define DMAC_GIR_MPI6 (1<<7)
34#define DMAC_GIR_MPI7 (1<<6)
35#define DMAC_GIR_MPI4 (1<<5)
36#define DMAC_GIR_MPI5 (1<<4)
37#define DMAC_GIR_MPI2 (1<<3)
38#define DMAC_GIR_MPI3 (1<<2)
39#define DMAC_GIR_MPI0 (1<<1)
40#define DMAC_GIR_MPI1 (1<<0)
41
42#define DMAC_M2P0 0x0000
43#define DMAC_M2P1 0x0040
44#define DMAC_M2P2 0x0080
45#define DMAC_M2P3 0x00c0
46#define DMAC_M2P4 0x0240
47#define DMAC_M2P5 0x0200
48#define DMAC_M2P6 0x02c0
49#define DMAC_M2P7 0x0280
50#define DMAC_M2P8 0x0340
51#define DMAC_M2P9 0x0300
52#define DMAC_M2M0 0x0100
53#define DMAC_M2M1 0x0140
54
55#define DMAC_P_PCONTROL(c) __REG(DMAC_PHYS + (c) + 0x00)
56#define DMAC_P_PINTERRUPT(c) __REG(DMAC_PHYS + (c) + 0x04)
57#define DMAC_P_PPALLOC(c) __REG(DMAC_PHYS + (c) + 0x08)
58#define DMAC_P_PSTATUS(c) __REG(DMAC_PHYS + (c) + 0x0c)
59#define DMAC_P_REMAIN(c) __REG(DMAC_PHYS + (c) + 0x14)
60#define DMAC_P_MAXCNT0(c) __REG(DMAC_PHYS + (c) + 0x20)
61#define DMAC_P_BASE0(c) __REG(DMAC_PHYS + (c) + 0x24)
62#define DMAC_P_CURRENT0(c) __REG(DMAC_PHYS + (c) + 0x28)
63#define DMAC_P_MAXCNT1(c) __REG(DMAC_PHYS + (c) + 0x30)
64#define DMAC_P_BASE1(c) __REG(DMAC_PHYS + (c) + 0x34)
65#define DMAC_P_CURRENT1(c) __REG(DMAC_PHYS + (c) + 0x38)
66
67#define DMAC_PCONTROL_ENABLE (1<<4)
68
69#define DMAC_PORT_USB 0
70#define DMAC_PORT_SDMMC 1
71#define DMAC_PORT_AC97_1 2
72#define DMAC_PORT_AC97_2 3
73#define DMAC_PORT_AC97_3 4
74#define DMAC_PORT_UART1 6
75#define DMAC_PORT_UART2 7
76#define DMAC_PORT_UART3 8
77
78#define DMAC_PSTATUS_CURRSTATE_SHIFT 4
79#define DMAC_PSTATUS_CURRSTATE_MASK 0x3
80
81#define DMAC_PSTATUS_NEXTBUF (1<<6)
82#define DMAC_PSTATUS_STALLRINT (1<<0)
83
84#define DMAC_INT_CHE (1<<3)
85#define DMAC_INT_NFB (1<<1)
86#define DMAC_INT_STALL (1<<0)
diff --git a/include/asm-arm/arch-lh7a40x/entry-macro.S b/include/asm-arm/arch-lh7a40x/entry-macro.S
index a2f67c06d9c9..9fc7f4988124 100644
--- a/include/asm-arm/arch-lh7a40x/entry-macro.S
+++ b/include/asm-arm/arch-lh7a40x/entry-macro.S
@@ -10,11 +10,73 @@
10#include <asm/hardware.h> 10#include <asm/hardware.h>
11#include <asm/arch/irqs.h> 11#include <asm/arch/irqs.h>
12 12
13# if defined (CONFIG_ARCH_LH7A400) && defined (CONFIG_ARCH_LH7A404) 13/* In order to allow there to be support for both of the processor
14# error "LH7A400 and LH7A404 are mutually exclusive" 14 classes at the same time, we make a hack here that isn't very
15# endif 15 pretty. At startup, the link pointed to with the
16 branch_irq_lh7a400 symbol is replaced with a NOP when the CPU is
17 detected as a lh7a404.
16 18
17# if defined (CONFIG_ARCH_LH7A400) 19 *** FIXME: we should clean this up so that there is only one
20 implementation for each CPU's design.
21
22*/
23
24#if defined (CONFIG_ARCH_LH7A400) && defined (CONFIG_ARCH_LH7A404)
25
26 .macro disable_fiq
27 .endm
28
29 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
30
31branch_irq_lh7a400: b 1000f
32
33@ Implementation of the LH7A404 get_irqnr_and_base.
34
35 mov \irqnr, #0 @ VIC1 irq base
36 mov \base, #io_p2v(0x80000000) @ APB registers
37 add \base, \base, #0x8000
38 ldr \tmp, [\base, #0x0030] @ VIC1_VECTADDR
39 tst \tmp, #VA_VECTORED @ Direct vectored
40 bne 1002f
41 tst \tmp, #VA_VIC1DEFAULT @ Default vectored VIC1
42 ldrne \irqstat, [\base, #0] @ VIC1_IRQSTATUS
43 bne 1001f
44 add \base, \base, #(0xa000 - 0x8000)
45 ldr \tmp, [\base, #0x0030] @ VIC2_VECTADDR
46 tst \tmp, #VA_VECTORED @ Direct vectored
47 bne 1002f
48 ldr \irqstat, [\base, #0] @ VIC2_IRQSTATUS
49 mov \irqnr, #32 @ VIC2 irq base
50
511001: movs \irqstat, \irqstat, lsr #1 @ Shift into carry
52 bcs 1008f @ Bit set; irq found
53 add \irqnr, \irqnr, #1
54 bne 1001b @ Until no bits
55 b 1009f @ Nothing? Hmm.
561002: and \irqnr, \tmp, #0x3f @ Mask for valid bits
571008: movs \irqstat, #1 @ Force !Z
58 str \tmp, [\base, #0x0030] @ Clear vector
59 b 1009f
60
61@ Implementation of the LH7A400 get_irqnr_and_base.
62
631000: mov \irqnr, #0
64 mov \base, #io_p2v(0x80000000) @ APB registers
65 ldr \irqstat, [\base, #0x500] @ PIC INTSR
66
671001: movs \irqstat, \irqstat, lsr #1 @ Shift into carry
68 bcs 1008f @ Bit set; irq found
69 add \irqnr, \irqnr, #1
70 bne 1001b @ Until no bits
71 b 1009f @ Nothing? Hmm.
721008: movs \irqstat, #1 @ Force !Z
73
741009:
75 .endm
76
77
78
79#elif defined (CONFIG_ARCH_LH7A400)
18 .macro disable_fiq 80 .macro disable_fiq
19 .endm 81 .endm
20 82
diff --git a/include/asm-arm/arch-lh7a40x/hardware.h b/include/asm-arm/arch-lh7a40x/hardware.h
index aeb07c162e25..e9ff74fd7939 100644
--- a/include/asm-arm/arch-lh7a40x/hardware.h
+++ b/include/asm-arm/arch-lh7a40x/hardware.h
@@ -13,6 +13,8 @@
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#include <asm/sizes.h> /* Added for the sake of amba-clcd driver */
17
16#define io_p2v(x) (0xf0000000 | (((x) & 0xfff00000) >> 4) | ((x) & 0x0000ffff)) 18#define io_p2v(x) (0xf0000000 | (((x) & 0xfff00000) >> 4) | ((x) & 0x0000ffff))
17#define io_v2p(x) ( (((x) & 0x0fff0000) << 4) | ((x) & 0x0000ffff)) 19#define io_v2p(x) ( (((x) & 0x0fff0000) << 4) | ((x) & 0x0000ffff))
18 20
@@ -53,6 +55,8 @@ typedef struct { volatile u8 offset[4096]; } __regbase8;
53 55
54#endif 56#endif
55 57
58#define MASK_AND_SET(v,m,s) (v) = ((v)&~(m))|(s)
59
56#include "registers.h" 60#include "registers.h"
57 61
58#endif /* _ASM_ARCH_HARDWARE_H */ 62#endif /* _ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-lh7a40x/io.h b/include/asm-arm/arch-lh7a40x/io.h
index bbcd4335f441..17bc94097481 100644
--- a/include/asm-arm/arch-lh7a40x/io.h
+++ b/include/asm-arm/arch-lh7a40x/io.h
@@ -18,6 +18,5 @@
18/* No ISA or PCI bus on this machine. */ 18/* No ISA or PCI bus on this machine. */
19#define __io(a) ((void __iomem *)(a)) 19#define __io(a) ((void __iomem *)(a))
20#define __mem_pci(a) (a) 20#define __mem_pci(a) (a)
21#define __mem_isa(a) (a)
22 21
23#endif /* __ASM_ARCH_IO_H */ 22#endif /* __ASM_ARCH_IO_H */
diff --git a/include/asm-arm/arch-lh7a40x/irqs.h b/include/asm-arm/arch-lh7a40x/irqs.h
index f91f3e59f3ab..afe8c7cbad6a 100644
--- a/include/asm-arm/arch-lh7a40x/irqs.h
+++ b/include/asm-arm/arch-lh7a40x/irqs.h
@@ -18,7 +18,6 @@
18#ifndef __ASM_ARCH_IRQS_H 18#ifndef __ASM_ARCH_IRQS_H
19#define __ASM_ARCH_IRQS_H 19#define __ASM_ARCH_IRQS_H
20 20
21#include <linux/config.h>
22 21
23#define FIQ_START 80 22#define FIQ_START 80
24 23
@@ -154,9 +153,10 @@
154#if !defined (IRQ_GPIO0INTR) 153#if !defined (IRQ_GPIO0INTR)
155# define IRQ_GPIO0INTR IRQ_GPIO0FIQ 154# define IRQ_GPIO0INTR IRQ_GPIO0FIQ
156#endif 155#endif
157#define IRQ_TICK IRQ_TINTR 156#define IRQ_TICK IRQ_TINTR
158#define IRQ_PCC1_RDY IRQ_GPIO6INTR /* PCCard 1 ready */ 157#define IRQ_PCC1_RDY IRQ_GPIO6INTR /* PCCard 1 ready */
159#define IRQ_PCC2_RDY IRQ_GPIO7INTR /* PCCard 2 ready */ 158#define IRQ_PCC2_RDY IRQ_GPIO7INTR /* PCCard 2 ready */
159#define IRQ_USB IRQ_USBINTR /* USB device */
160 160
161#ifdef CONFIG_MACH_KEV7A400 161#ifdef CONFIG_MACH_KEV7A400
162# define IRQ_TS IRQ_GPIOFIQ /* Touchscreen */ 162# define IRQ_TS IRQ_GPIOFIQ /* Touchscreen */
@@ -191,6 +191,10 @@
191# define IRQ_LPD7A400_TS IRQ_LPD7A40X_CPLD + 1 /* Touch screen */ 191# define IRQ_LPD7A400_TS IRQ_LPD7A40X_CPLD + 1 /* Touch screen */
192#endif 192#endif
193 193
194#if defined (CONFIG_MACH_LPD7A400)
195# define IRQ_TOUCH IRQ_LPD7A400_TS
196#endif
197
194#define NR_IRQS (NR_IRQ_CPU + NR_IRQ_BOARD) 198#define NR_IRQS (NR_IRQ_CPU + NR_IRQ_BOARD)
195 199
196#endif 200#endif
diff --git a/include/asm-arm/arch-lh7a40x/registers.h b/include/asm-arm/arch-lh7a40x/registers.h
index 2edb22e35450..b4f09b3e2d03 100644
--- a/include/asm-arm/arch-lh7a40x/registers.h
+++ b/include/asm-arm/arch-lh7a40x/registers.h
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <asm/arch/constants.h> 12#include <asm/arch/constants.h>
14 13
15#ifndef __ASM_ARCH_REGISTERS_H 14#ifndef __ASM_ARCH_REGISTERS_H
@@ -18,7 +17,7 @@
18 17
19 /* Physical register base addresses */ 18 /* Physical register base addresses */
20 19
21#define AC97_PHYS (0x80000000) /* AC97 Controller */ 20#define AC97C_PHYS (0x80000000) /* AC97 Controller */
22#define MMC_PHYS (0x80000100) /* Multimedia Card Controller */ 21#define MMC_PHYS (0x80000100) /* Multimedia Card Controller */
23#define USB_PHYS (0x80000200) /* USB Client */ 22#define USB_PHYS (0x80000200) /* USB Client */
24#define SCI_PHYS (0x80000300) /* Secure Card Interface */ 23#define SCI_PHYS (0x80000300) /* Secure Card Interface */
@@ -35,6 +34,8 @@
35#define RTC_PHYS (0x80000d00) /* Real-time Clock */ 34#define RTC_PHYS (0x80000d00) /* Real-time Clock */
36#define GPIO_PHYS (0x80000e00) /* General Purpose IO */ 35#define GPIO_PHYS (0x80000e00) /* General Purpose IO */
37#define BMI_PHYS (0x80000f00) /* Battery Monitor Interface */ 36#define BMI_PHYS (0x80000f00) /* Battery Monitor Interface */
37#define HRTFTC_PHYS (0x80001000) /* High-res TFT Controller (LH7A400) */
38#define ALI_PHYS (0x80001000) /* Advanced LCD Interface (LH7A404) */
38#define WDT_PHYS (0x80001400) /* Watchdog Timer */ 39#define WDT_PHYS (0x80001400) /* Watchdog Timer */
39#define SMC_PHYS (0x80002000) /* Static Memory Controller */ 40#define SMC_PHYS (0x80002000) /* Static Memory Controller */
40#define SDRC_PHYS (0x80002400) /* SDRAM Controller */ 41#define SDRC_PHYS (0x80002400) /* SDRAM Controller */
@@ -43,6 +44,7 @@
43 44
44 /* Physical registers of the LH7A404 */ 45 /* Physical registers of the LH7A404 */
45 46
47#define ADC_PHYS (0x80001300) /* A/D & Touchscreen Controller */
46#define VIC1_PHYS (0x80008000) /* Vectored Interrupt Controller 1 */ 48#define VIC1_PHYS (0x80008000) /* Vectored Interrupt Controller 1 */
47#define USBH_PHYS (0x80009000) /* USB OHCI host controller */ 49#define USBH_PHYS (0x80009000) /* USB OHCI host controller */
48#define VIC2_PHYS (0x8000a000) /* Vectored Interrupt Controller 2 */ 50#define VIC2_PHYS (0x8000a000) /* Vectored Interrupt Controller 2 */
@@ -53,10 +55,32 @@
53 55
54 /* Clock/State Controller register */ 56 /* Clock/State Controller register */
55 57
58#define CSC_PWRSR __REG(CSC_PHYS + 0x00) /* Reset register & ID */
56#define CSC_PWRCNT __REG(CSC_PHYS + 0x04) /* Power control */ 59#define CSC_PWRCNT __REG(CSC_PHYS + 0x04) /* Power control */
60#define CSC_CLKSET __REG(CSC_PHYS + 0x20) /* Clock speed control */
61#define CSC_USBDRESET __REG(CSC_PHYS + 0x4c) /* USB Device resets */
57 62
58#define CSC_PWRCNT_USBH_EN (1<<28) /* USB Host power enable */ 63#define CSC_PWRCNT_USBH_EN (1<<28) /* USB Host power enable */
59 64#define CSC_PWRCNT_DMAC_M2M1_EN (1<<27)
65#define CSC_PWRCNT_DMAC_M2M0_EN (1<<26)
66#define CSC_PWRCNT_DMAC_M2P8_EN (1<<25)
67#define CSC_PWRCNT_DMAC_M2P9_EN (1<<24)
68#define CSC_PWRCNT_DMAC_M2P6_EN (1<<23)
69#define CSC_PWRCNT_DMAC_M2P7_EN (1<<22)
70#define CSC_PWRCNT_DMAC_M2P4_EN (1<<21)
71#define CSC_PWRCNT_DMAC_M2P5_EN (1<<20)
72#define CSC_PWRCNT_DMAC_M2P2_EN (1<<19)
73#define CSC_PWRCNT_DMAC_M2P3_EN (1<<18)
74#define CSC_PWRCNT_DMAC_M2P0_EN (1<<17)
75#define CSC_PWRCNT_DMAC_M2P1_EN (1<<16)
76
77#define CSC_PWRSR_CHIPMAN_SHIFT (24)
78#define CSC_PWRSR_CHIPMAN_MASK (0xff)
79#define CSC_PWRSR_CHIPID_SHIFT (16)
80#define CSC_PWRSR_CHIPID_MASK (0xff)
81
82#define CSC_USBDRESET_APBRESETREG (1<<1)
83#define CSC_USBDRESET_IORESETREG (1<<0)
60 84
61 /* Interrupt Controller registers */ 85 /* Interrupt Controller registers */
62 86
@@ -109,6 +133,13 @@
109#define GPIO_GPIOFEOI __REG(GPIO_PHYS + 0x54) /* GPIO End-of-Interrupt */ 133#define GPIO_GPIOFEOI __REG(GPIO_PHYS + 0x54) /* GPIO End-of-Interrupt */
110#define GPIO_GPIOINTEN __REG(GPIO_PHYS + 0x58) /* GPIO Interrupt Enable */ 134#define GPIO_GPIOINTEN __REG(GPIO_PHYS + 0x58) /* GPIO Interrupt Enable */
111#define GPIO_INTSTATUS __REG(GPIO_PHYS + 0x5c) /* GPIO Interrupt Status */ 135#define GPIO_INTSTATUS __REG(GPIO_PHYS + 0x5c) /* GPIO Interrupt Status */
136#define GPIO_PINMUX __REG(GPIO_PHYS + 0x2c)
137#define GPIO_PADD __REG(GPIO_PHYS + 0x10)
138#define GPIO_PAD __REG(GPIO_PHYS + 0x00)
139#define GPIO_PCD __REG(GPIO_PHYS + 0x08)
140#define GPIO_PCDD __REG(GPIO_PHYS + 0x18)
141#define GPIO_PEDD __REG(GPIO_PHYS + 0x24)
142#define GPIO_PED __REG(GPIO_PHYS + 0x20)
112 143
113 144
114 /* Static Memory Controller registers */ 145 /* Static Memory Controller registers */
@@ -138,20 +169,21 @@
138#endif 169#endif
139 170
140#if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404) 171#if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404)
141# define CPLD_CONTROL __REG8(CPLD02_PHYS)
142# define CPLD_SPI_DATA __REG8(CPLD06_PHYS)
143# define CPLD_SPI_CONTROL __REG8(CPLD08_PHYS)
144# define CPLD_SPI_EEPROM __REG8(CPLD0A_PHYS)
145# define CPLD_INTERRUPTS __REG8(CPLD0C_PHYS) /* IRQ mask/status */
146# define CPLD_BOOT_MODE __REG8(CPLD0E_PHYS)
147# define CPLD_FLASH __REG8(CPLD10_PHYS)
148# define CPLD_POWER_MGMT __REG8(CPLD12_PHYS)
149# define CPLD_REVISION __REG8(CPLD14_PHYS)
150# define CPLD_GPIO_EXT __REG8(CPLD16_PHYS)
151# define CPLD_GPIO_DATA __REG8(CPLD18_PHYS)
152# define CPLD_GPIO_DIR __REG8(CPLD1A_PHYS)
153#endif
154 172
173# define CPLD_CONTROL __REG16(CPLD02_PHYS)
174# define CPLD_SPI_DATA __REG16(CPLD06_PHYS)
175# define CPLD_SPI_CONTROL __REG16(CPLD08_PHYS)
176# define CPLD_SPI_EEPROM __REG16(CPLD0A_PHYS)
177# define CPLD_INTERRUPTS __REG16(CPLD0C_PHYS) /* IRQ mask/status */
178# define CPLD_BOOT_MODE __REG16(CPLD0E_PHYS)
179# define CPLD_FLASH __REG16(CPLD10_PHYS)
180# define CPLD_POWER_MGMT __REG16(CPLD12_PHYS)
181# define CPLD_REVISION __REG16(CPLD14_PHYS)
182# define CPLD_GPIO_EXT __REG16(CPLD16_PHYS)
183# define CPLD_GPIO_DATA __REG16(CPLD18_PHYS)
184# define CPLD_GPIO_DIR __REG16(CPLD1A_PHYS)
185
186#endif
155 187
156 /* Timer registers */ 188 /* Timer registers */
157 189
@@ -190,4 +222,3 @@
190 222
191 223
192#endif /* _ASM_ARCH_REGISTERS_H */ 224#endif /* _ASM_ARCH_REGISTERS_H */
193
diff --git a/include/asm-arm/arch-lh7a40x/ssp.h b/include/asm-arm/arch-lh7a40x/ssp.h
new file mode 100644
index 000000000000..132b1c4d5ce6
--- /dev/null
+++ b/include/asm-arm/arch-lh7a40x/ssp.h
@@ -0,0 +1,71 @@
1/* ssp.h
2 $Id$
3
4 written by Marc Singer
5 6 Dec 2004
6
7 Copyright (C) 2004 Marc Singer
8
9 -----------
10 DESCRIPTION
11 -----------
12
13 This SSP header is available throughout the kernel, for this
14 machine/architecture, because drivers that use it may be dispersed.
15
16 This file was cloned from the 7952x implementation. It would be
17 better to share them, but we're taking an easier approach for the
18 time being.
19
20*/
21
22#if !defined (__SSP_H__)
23# define __SSP_H__
24
25/* ----- Includes */
26
27/* ----- Types */
28
29struct ssp_driver {
30 int (*init) (void);
31 void (*exit) (void);
32 void (*acquire) (void);
33 void (*release) (void);
34 int (*configure) (int device, int mode, int speed,
35 int frame_size_write, int frame_size_read);
36 void (*chip_select) (int enable);
37 void (*set_callbacks) (void* handle,
38 irqreturn_t (*callback_tx)(void*),
39 irqreturn_t (*callback_rx)(void*));
40 void (*enable) (void);
41 void (*disable) (void);
42// int (*save_state) (void*);
43// void (*restore_state) (void*);
44 int (*read) (void);
45 int (*write) (u16 data);
46 int (*write_read) (u16 data);
47 void (*flush) (void);
48 void (*write_async) (void* pv, size_t cb);
49 size_t (*write_pos) (void);
50};
51
52 /* These modes are only available on the LH79524 */
53#define SSP_MODE_SPI (1)
54#define SSP_MODE_SSI (2)
55#define SSP_MODE_MICROWIRE (3)
56#define SSP_MODE_I2S (4)
57
58 /* CPLD SPI devices */
59#define DEVICE_EEPROM 0 /* Configuration eeprom */
60#define DEVICE_MAC 1 /* MAC eeprom (LPD79524) */
61#define DEVICE_CODEC 2 /* Audio codec */
62#define DEVICE_TOUCH 3 /* Touch screen (LPD79520) */
63
64/* ----- Globals */
65
66/* ----- Prototypes */
67
68//extern struct ssp_driver lh79520_i2s_driver;
69extern struct ssp_driver lh7a400_cpld_ssp_driver;
70
71#endif /* __SSP_H__ */
diff --git a/include/asm-arm/arch-lh7a40x/uncompress.h b/include/asm-arm/arch-lh7a40x/uncompress.h
index f8053346f608..3d1ce0426a33 100644
--- a/include/asm-arm/arch-lh7a40x/uncompress.h
+++ b/include/asm-arm/arch-lh7a40x/uncompress.h
@@ -16,7 +16,7 @@
16#ifndef UART_R_STATUS 16#ifndef UART_R_STATUS
17# define UART_R_STATUS (0x10) 17# define UART_R_STATUS (0x10)
18#endif 18#endif
19#define nTxRdy (0x20) /* Not TxReady (literally Tx FIFO full) */ 19#define nTxRdy (0x20) /* Not TxReady (literally Tx FIFO full) */
20 20
21 /* Access UART with physical addresses before MMU is setup */ 21 /* Access UART with physical addresses before MMU is setup */
22#define UART_STATUS (*(volatile unsigned long*) (UART2_PHYS + UART_R_STATUS)) 22#define UART_STATUS (*(volatile unsigned long*) (UART2_PHYS + UART_R_STATUS))
diff --git a/include/asm-arm/arch-netx/debug-macro.S b/include/asm-arm/arch-netx/debug-macro.S
new file mode 100644
index 000000000000..a940d0e80cb2
--- /dev/null
+++ b/include/asm-arm/arch-netx/debug-macro.S
@@ -0,0 +1,38 @@
1/* linux/include/asm-arm/arch-netx/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14#include "hardware.h"
15
16 .macro addruart,rx
17 mrc p15, 0, \rx, c1, c0
18 tst \rx, #1 @ MMU enabled?
19 moveq \rx, #0x00100000 @ physical
20 movne \rx, #io_p2v(0x00100000) @ virtual
21 orr \rx, \rx, #0x00000a00
22 .endm
23
24 .macro senduart,rd,rx
25 str \rd, [\rx, #0]
26 .endm
27
28 .macro busyuart,rd,rx
291002: ldr \rd, [\rx, #0x18]
30 tst \rd, #(1 << 3)
31 bne 1002b
32 .endm
33
34 .macro waituart,rd,rx
351001: ldr \rd, [\rx, #0x18]
36 tst \rd, #(1 << 3)
37 bne 1001b
38 .endm
diff --git a/include/asm-arm/arch-netx/dma.h b/include/asm-arm/arch-netx/dma.h
new file mode 100644
index 000000000000..4eda5feed81c
--- /dev/null
+++ b/include/asm-arm/arch-netx/dma.h
@@ -0,0 +1,21 @@
1/*
2 * linux/include/asm-arm/arch-netx/dma.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#define MAX_DMA_CHANNELS 0
21#define MAX_DMA_ADDRESS ~0
diff --git a/include/asm-arm/arch-netx/entry-macro.S b/include/asm-arm/arch-netx/entry-macro.S
new file mode 100644
index 000000000000..658df4d60ff3
--- /dev/null
+++ b/include/asm-arm/arch-netx/entry-macro.S
@@ -0,0 +1,35 @@
1/*
2 * include/asm-arm/arch-netx/entry-macro.S
3 *
4 * Low-level IRQ helper macros for Hilscher netX based platforms
5 *
6 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
10 * as published by the Free Software Foundation.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#include <asm/hardware.h>
22
23 .macro disable_fiq
24 .endm
25
26 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
27 mov \base, #io_p2v(0x00100000)
28 add \base, \base, #0x000ff000
29
30 ldr \irqstat, [\base, #0]
31 clz \irqnr, \irqstat
32 rsb \irqnr, \irqnr, #31
33 cmp \irqstat, #0
34 .endm
35
diff --git a/include/asm-arm/arch-netx/eth.h b/include/asm-arm/arch-netx/eth.h
new file mode 100644
index 000000000000..643c90ef8b72
--- /dev/null
+++ b/include/asm-arm/arch-netx/eth.h
@@ -0,0 +1,27 @@
1/*
2 * include/asm-arm/arch-netx/eth.h
3 *
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef ASMARM_ARCH_ETH_H
21#define ASMARM_ARCH_ETH_H
22
23struct netxeth_platform_data {
24 unsigned int xcno; /* number of xmac/xpec engine this eth uses */
25};
26
27#endif
diff --git a/include/asm-arm/arch-netx/hardware.h b/include/asm-arm/arch-netx/hardware.h
new file mode 100644
index 000000000000..7786c45455cd
--- /dev/null
+++ b/include/asm-arm/arch-netx/hardware.h
@@ -0,0 +1,39 @@
1/*
2 * include/asm-arm/arch-netx/hardware.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __ASM_ARCH_HARDWARE_H
20#define __ASM_ARCH_HARDWARE_H
21
22#define NETX_IO_PHYS 0x00100000
23#define NETX_IO_VIRT 0xe0000000
24#define NETX_IO_SIZE 0x00100000
25
26#define SRAM_INTERNAL_PHYS_0 0x00000
27#define SRAM_INTERNAL_PHYS_1 0x08000
28#define SRAM_INTERNAL_PHYS_2 0x10000
29#define SRAM_INTERNAL_PHYS_3 0x18000
30#define SRAM_INTERNAL_PHYS(no) ((no) * 0x8000)
31
32#define XPEC_MEM_SIZE 0x4000
33#define XMAC_MEM_SIZE 0x1000
34#define SRAM_MEM_SIZE 0x8000
35
36#define io_p2v(x) ((x) - NETX_IO_PHYS + NETX_IO_VIRT)
37#define io_v2p(x) ((x) - NETX_IO_VIRT + NETX_IO_PHYS)
38
39#endif
diff --git a/include/asm-arm/arch-netx/io.h b/include/asm-arm/arch-netx/io.h
new file mode 100644
index 000000000000..a7a53f80165d
--- /dev/null
+++ b/include/asm-arm/arch-netx/io.h
@@ -0,0 +1,28 @@
1/*
2 * linux/include/asm-arm/arch-netx/io.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22
23#define IO_SPACE_LIMIT 0xffffffff
24
25#define __io(a) ((void __iomem *)(a))
26#define __mem_pci(a) (a)
27
28#endif
diff --git a/include/asm-arm/arch-netx/irqs.h b/include/asm-arm/arch-netx/irqs.h
new file mode 100644
index 000000000000..a487dc6e2661
--- /dev/null
+++ b/include/asm-arm/arch-netx/irqs.h
@@ -0,0 +1,70 @@
1/*
2 * include/asm-arm/arch-netx/irqs.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#define NETX_IRQ_VIC_START 0
21#define NETX_IRQ_SOFTINT 0
22#define NETX_IRQ_TIMER0 1
23#define NETX_IRQ_TIMER1 2
24#define NETX_IRQ_TIMER2 3
25#define NETX_IRQ_SYSTIME_NS 4
26#define NETX_IRQ_SYSTIME_S 5
27#define NETX_IRQ_GPIO_15 6
28#define NETX_IRQ_WATCHDOG 7
29#define NETX_IRQ_UART0 8
30#define NETX_IRQ_UART1 9
31#define NETX_IRQ_UART2 10
32#define NETX_IRQ_USB 11
33#define NETX_IRQ_SPI 12
34#define NETX_IRQ_I2C 13
35#define NETX_IRQ_LCD 14
36#define NETX_IRQ_HIF 15
37#define NETX_IRQ_GPIO_0_14 16
38#define NETX_IRQ_XPEC0 17
39#define NETX_IRQ_XPEC1 18
40#define NETX_IRQ_XPEC2 19
41#define NETX_IRQ_XPEC3 20
42#define NETX_IRQ_XPEC(no) (17 + (no))
43#define NETX_IRQ_MSYNC0 21
44#define NETX_IRQ_MSYNC1 22
45#define NETX_IRQ_MSYNC2 23
46#define NETX_IRQ_MSYNC3 24
47#define NETX_IRQ_IRQ_PHY 25
48#define NETX_IRQ_ISO_AREA 26
49/* int 27 is reserved */
50/* int 28 is reserved */
51#define NETX_IRQ_TIMER3 29
52#define NETX_IRQ_TIMER4 30
53/* int 31 is reserved */
54
55#define NETX_IRQS 32
56
57/* for multiplexed irqs on gpio 0..14 */
58#define NETX_IRQ_GPIO(x) (NETX_IRQS + (x))
59#define NETX_IRQ_GPIO_LAST NETX_IRQ_GPIO(14)
60
61/* Host interface interrupts */
62#define NETX_IRQ_HIF_CHAINED(x) (NETX_IRQ_GPIO_LAST + 1 + (x))
63#define NETX_IRQ_HIF_PIO35 NETX_IRQ_HIF_CHAINED(0)
64#define NETX_IRQ_HIF_PIO36 NETX_IRQ_HIF_CHAINED(1)
65#define NETX_IRQ_HIF_PIO40 NETX_IRQ_HIF_CHAINED(2)
66#define NETX_IRQ_HIF_PIO47 NETX_IRQ_HIF_CHAINED(3)
67#define NETX_IRQ_HIF_PIO72 NETX_IRQ_HIF_CHAINED(4)
68#define NETX_IRQ_HIF_LAST NETX_IRQ_HIF_CHAINED(4)
69
70#define NR_IRQS (NETX_IRQ_HIF_LAST + 1)
diff --git a/include/asm-arm/arch-netx/memory.h b/include/asm-arm/arch-netx/memory.h
new file mode 100644
index 000000000000..6d8d2df3e99d
--- /dev/null
+++ b/include/asm-arm/arch-netx/memory.h
@@ -0,0 +1,36 @@
1/*
2 * linux/include/asm-arm/arch-netx/memory.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H
22
23#define PHYS_OFFSET UL(0x80000000)
24
25/*
26 * Virtual view <-> DMA view memory address translations
27 * virt_to_bus: Used to translate the virtual address to an
28 * address suitable to be passed to set_dma_addr
29 * bus_to_virt: Used to convert an address for DMA operations
30 * to an address that the kernel can use.
31 */
32#define __virt_to_bus(x) __virt_to_phys(x)
33#define __bus_to_virt(x) __phys_to_virt(x)
34
35#endif
36
diff --git a/include/asm-arm/arch-netx/netx-regs.h b/include/asm-arm/arch-netx/netx-regs.h
new file mode 100644
index 000000000000..8ab45bea83ca
--- /dev/null
+++ b/include/asm-arm/arch-netx/netx-regs.h
@@ -0,0 +1,410 @@
1/*
2 * include/asm-arm/arch-netx/netx-regs.h
3 *
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_ARCH_NETX_REGS_H
21#define __ASM_ARCH_NETX_REGS_H
22
23/* offsets relative to the beginning of the io space */
24#define NETX_OFS_SYSTEM 0x00000
25#define NETX_OFS_MEMCR 0x00100
26#define NETX_OFS_DPMAS 0x03000
27#define NETX_OFS_GPIO 0x00800
28#define NETX_OFS_PIO 0x00900
29#define NETX_OFS_UART0 0x00a00
30#define NETX_OFS_UART1 0x00a40
31#define NETX_OFS_UART2 0x00a80
32#define NETX_OF_MIIMU 0x00b00
33#define NETX_OFS_SPI 0x00c00
34#define NETX_OFS_I2C 0x00d00
35#define NETX_OFS_SYSTIME 0x01100
36#define NETX_OFS_RTC 0x01200
37#define NETX_OFS_EXTBUS 0x03600
38#define NETX_OFS_LCD 0x04000
39#define NETX_OFS_USB 0x20000
40#define NETX_OFS_XMAC0 0x60000
41#define NETX_OFS_XMAC1 0x61000
42#define NETX_OFS_XMAC2 0x62000
43#define NETX_OFS_XMAC3 0x63000
44#define NETX_OFS_XMAC(no) (0x60000 + (no) * 0x1000)
45#define NETX_OFS_PFIFO 0x64000
46#define NETX_OFS_XPEC0 0x70000
47#define NETX_OFS_XPEC1 0x74000
48#define NETX_OFS_XPEC2 0x78000
49#define NETX_OFS_XPEC3 0x7c000
50#define NETX_OFS_XPEC(no) (0x70000 + (no) * 0x4000)
51#define NETX_OFS_VIC 0xff000
52
53/* physical addresses */
54#define NETX_PA_SYSTEM (NETX_IO_PHYS + NETX_OFS_SYSTEM)
55#define NETX_PA_MEMCR (NETX_IO_PHYS + NETX_OFS_MEMCR)
56#define NETX_PA_DPMAS (NETX_IO_PHYS + NETX_OFS_DPMAS)
57#define NETX_PA_GPIO (NETX_IO_PHYS + NETX_OFS_GPIO)
58#define NETX_PA_PIO (NETX_IO_PHYS + NETX_OFS_PIO)
59#define NETX_PA_UART0 (NETX_IO_PHYS + NETX_OFS_UART0)
60#define NETX_PA_UART1 (NETX_IO_PHYS + NETX_OFS_UART1)
61#define NETX_PA_UART2 (NETX_IO_PHYS + NETX_OFS_UART2)
62#define NETX_PA_MIIMU (NETX_IO_PHYS + NETX_OF_MIIMU)
63#define NETX_PA_SPI (NETX_IO_PHYS + NETX_OFS_SPI)
64#define NETX_PA_I2C (NETX_IO_PHYS + NETX_OFS_I2C)
65#define NETX_PA_SYSTIME (NETX_IO_PHYS + NETX_OFS_SYSTIME)
66#define NETX_PA_RTC (NETX_IO_PHYS + NETX_OFS_RTC)
67#define NETX_PA_EXTBUS (NETX_IO_PHYS + NETX_OFS_EXTBUS)
68#define NETX_PA_LCD (NETX_IO_PHYS + NETX_OFS_LCD)
69#define NETX_PA_USB (NETX_IO_PHYS + NETX_OFS_USB)
70#define NETX_PA_XMAC0 (NETX_IO_PHYS + NETX_OFS_XMAC0)
71#define NETX_PA_XMAC1 (NETX_IO_PHYS + NETX_OFS_XMAC1)
72#define NETX_PA_XMAC2 (NETX_IO_PHYS + NETX_OFS_XMAC2)
73#define NETX_PA_XMAC3 (NETX_IO_PHYS + NETX_OFS_XMAC3)
74#define NETX_PA_XMAC(no) (NETX_IO_PHYS + NETX_OFS_XMAC(no))
75#define NETX_PA_PFIFO (NETX_IO_PHYS + NETX_OFS_PFIFO)
76#define NETX_PA_XPEC0 (NETX_IO_PHYS + NETX_OFS_XPEC0)
77#define NETX_PA_XPEC1 (NETX_IO_PHYS + NETX_OFS_XPEC1)
78#define NETX_PA_XPEC2 (NETX_IO_PHYS + NETX_OFS_XPEC2)
79#define NETX_PA_XPEC3 (NETX_IO_PHYS + NETX_OFS_XPEC3)
80#define NETX_PA_XPEC(no) (NETX_IO_PHYS + NETX_OFS_XPEC(no))
81#define NETX_PA_VIC (NETX_IO_PHYS + NETX_OFS_VIC)
82
83/* virual addresses */
84#define NETX_VA_SYSTEM (NETX_IO_VIRT + NETX_OFS_SYSTEM)
85#define NETX_VA_MEMCR (NETX_IO_VIRT + NETX_OFS_MEMCR)
86#define NETX_VA_DPMAS (NETX_IO_VIRT + NETX_OFS_DPMAS)
87#define NETX_VA_GPIO (NETX_IO_VIRT + NETX_OFS_GPIO)
88#define NETX_VA_PIO (NETX_IO_VIRT + NETX_OFS_PIO)
89#define NETX_VA_UART0 (NETX_IO_VIRT + NETX_OFS_UART0)
90#define NETX_VA_UART1 (NETX_IO_VIRT + NETX_OFS_UART1)
91#define NETX_VA_UART2 (NETX_IO_VIRT + NETX_OFS_UART2)
92#define NETX_VA_MIIMU (NETX_IO_VIRT + NETX_OF_MIIMU)
93#define NETX_VA_SPI (NETX_IO_VIRT + NETX_OFS_SPI)
94#define NETX_VA_I2C (NETX_IO_VIRT + NETX_OFS_I2C)
95#define NETX_VA_SYSTIME (NETX_IO_VIRT + NETX_OFS_SYSTIME)
96#define NETX_VA_RTC (NETX_IO_VIRT + NETX_OFS_RTC)
97#define NETX_VA_EXTBUS (NETX_IO_VIRT + NETX_OFS_EXTBUS)
98#define NETX_VA_LCD (NETX_IO_VIRT + NETX_OFS_LCD)
99#define NETX_VA_USB (NETX_IO_VIRT + NETX_OFS_USB)
100#define NETX_VA_XMAC0 (NETX_IO_VIRT + NETX_OFS_XMAC0)
101#define NETX_VA_XMAC1 (NETX_IO_VIRT + NETX_OFS_XMAC1)
102#define NETX_VA_XMAC2 (NETX_IO_VIRT + NETX_OFS_XMAC2)
103#define NETX_VA_XMAC3 (NETX_IO_VIRT + NETX_OFS_XMAC3)
104#define NETX_VA_XMAC(no) (NETX_IO_VIRT + NETX_OFS_XMAC(no))
105#define NETX_VA_PFIFO (NETX_IO_VIRT + NETX_OFS_PFIFO)
106#define NETX_VA_XPEC0 (NETX_IO_VIRT + NETX_OFS_XPEC0)
107#define NETX_VA_XPEC1 (NETX_IO_VIRT + NETX_OFS_XPEC1)
108#define NETX_VA_XPEC2 (NETX_IO_VIRT + NETX_OFS_XPEC2)
109#define NETX_VA_XPEC3 (NETX_IO_VIRT + NETX_OFS_XPEC3)
110#define NETX_VA_XPEC(no) (NETX_IO_VIRT + NETX_OFS_XPEC(no))
111#define NETX_VA_VIC (NETX_IO_VIRT + NETX_OFS_VIC)
112
113/*********************************
114 * System functions *
115 *********************************/
116
117/* Registers */
118#define NETX_SYSTEM_REG(ofs) __io(NETX_VA_SYSTEM + (ofs))
119#define NETX_SYSTEM_BOO_SR NETX_SYSTEM_REG(0x00)
120#define NETX_SYSTEM_IOC_CR NETX_SYSTEM_REG(0x04)
121#define NETX_SYSTEM_IOC_MR NETX_SYSTEM_REG(0x08)
122
123/* FIXME: Docs are not consistent */
124#define NETX_SYSTEM_RES_CR NETX_SYSTEM_REG(0x08)
125/* #define NETX_SYSTEM_RES_CR NETX_SYSTEM_REG(0x0c) */
126
127#define NETX_SYSTEM_PHY_CONTROL NETX_SYSTEM_REG(0x10)
128#define NETX_SYSTEM_REV NETX_SYSTEM_REG(0x34)
129#define NETX_SYSTEM_IOC_ACCESS_KEY NETX_SYSTEM_REG(0x70)
130#define NETX_SYSTEM_WDG_TR NETX_SYSTEM_REG(0x200)
131#define NETX_SYSTEM_WDG_CTR NETX_SYSTEM_REG(0x204)
132#define NETX_SYSTEM_WDG_IRQ_TIMEOUT NETX_SYSTEM_REG(0x208)
133#define NETX_SYSTEM_WDG_RES_TIMEOUT NETX_SYSTEM_REG(0x20c)
134
135/* Bits */
136#define NETX_SYSTEM_RES_CR_RSTIN (1<<0)
137#define NETX_SYSTEM_RES_CR_WDG_RES (1<<1)
138#define NETX_SYSTEM_RES_CR_HOST_RES (1<<2)
139#define NETX_SYSTEM_RES_CR_FIRMW_RES (1<<3)
140#define NETX_SYSTEM_RES_CR_XPEC0_RES (1<<4)
141#define NETX_SYSTEM_RES_CR_XPEC1_RES (1<<5)
142#define NETX_SYSTEM_RES_CR_XPEC2_RES (1<<6)
143#define NETX_SYSTEM_RES_CR_XPEC3_RES (1<<7)
144#define NETX_SYSTEM_RES_CR_DIS_XPEC0_RES (1<<16)
145#define NETX_SYSTEM_RES_CR_DIS_XPEC1_RES (1<<17)
146#define NETX_SYSTEM_RES_CR_DIS_XPEC2_RES (1<<18)
147#define NETX_SYSTEM_RES_CR_DIS_XPEC3_RES (1<<19)
148#define NETX_SYSTEM_RES_CR_FIRMW_FLG0 (1<<20)
149#define NETX_SYSTEM_RES_CR_FIRMW_FLG1 (1<<21)
150#define NETX_SYSTEM_RES_CR_FIRMW_FLG2 (1<<22)
151#define NETX_SYSTEM_RES_CR_FIRMW_FLG3 (1<<23)
152#define NETX_SYSTEM_RES_CR_FIRMW_RES_EN (1<<24)
153#define NETX_SYSTEM_RES_CR_RSTOUT (1<<25)
154#define NETX_SYSTEM_RES_CR_EN_RSTOUT (1<<26)
155
156#define PHY_CONTROL_RESET (1<<31)
157#define PHY_CONTROL_SIM_BYP (1<<30)
158#define PHY_CONTROL_CLK_XLATIN (1<<29)
159#define PHY_CONTROL_PHY1_EN (1<<21)
160#define PHY_CONTROL_PHY1_NP_MSG_CODE
161#define PHY_CONTROL_PHY1_AUTOMDIX (1<<17)
162#define PHY_CONTROL_PHY1_FIXMODE (1<<16)
163#define PHY_CONTROL_PHY1_MODE(mode) (((mode) & 0x7) << 13)
164#define PHY_CONTROL_PHY0_EN (1<<12)
165#define PHY_CONTROL_PHY0_NP_MSG_CODE
166#define PHY_CONTROL_PHY0_AUTOMDIX (1<<8)
167#define PHY_CONTROL_PHY0_FIXMODE (1<<7)
168#define PHY_CONTROL_PHY0_MODE(mode) (((mode) & 0x7) << 4)
169#define PHY_CONTROL_PHY_ADDRESS(adr) ((adr) & 0xf)
170
171#define PHY_MODE_10BASE_T_HALF 0
172#define PHY_MODE_10BASE_T_FULL 1
173#define PHY_MODE_100BASE_TX_FX_FULL 2
174#define PHY_MODE_100BASE_TX_FX_HALF 3
175#define PHY_MODE_100BASE_TX_HALF 4
176#define PHY_MODE_REPEATER 5
177#define PHY_MODE_POWER_DOWN 6
178#define PHY_MODE_ALL 7
179
180/* Bits */
181#define VECT_CNTL_ENABLE (1 << 5)
182
183/*******************************
184 * GPIO and timer module *
185 *******************************/
186
187/* Registers */
188#define NETX_GPIO_REG(ofs) __io(NETX_VA_GPIO + (ofs))
189#define NETX_GPIO_CFG(gpio) NETX_GPIO_REG(0x0 + ((gpio)<<2))
190#define NETX_GPIO_THRESHOLD_CAPTURE(gpio) NETX_GPIO_REG(0x40 + ((gpio)<<2))
191#define NETX_GPIO_COUNTER_CTRL(counter) NETX_GPIO_REG(0x80 + ((counter)<<2))
192#define NETX_GPIO_COUNTER_MAX(counter) NETX_GPIO_REG(0x94 + ((counter)<<2))
193#define NETX_GPIO_COUNTER_CURRENT(counter) NETX_GPIO_REG(0xa8 + ((counter)<<2))
194#define NETX_GPIO_IRQ_ENABLE NETX_GPIO_REG(0xbc)
195#define NETX_GPIO_IRQ_DISABLE NETX_GPIO_REG(0xc0)
196#define NETX_GPIO_SYSTIME_NS_CMP NETX_GPIO_REG(0xc4)
197#define NETX_GPIO_LINE NETX_GPIO_REG(0xc8)
198#define NETX_GPIO_IRQ NETX_GPIO_REG(0xd0)
199
200/* Bits */
201#define NETX_GPIO_CFG_IOCFG_GP_INPUT (0x0)
202#define NETX_GPIO_CFG_IOCFG_GP_OUTPUT (0x1)
203#define NETX_GPIO_CFG_IOCFG_GP_UART (0x2)
204#define NETX_GPIO_CFG_INV (1<<2)
205#define NETX_GPIO_CFG_MODE_INPUT_READ (0<<3)
206#define NETX_GPIO_CFG_MODE_INPUT_CAPTURE_CONT_RISING (1<<3)
207#define NETX_GPIO_CFG_MODE_INPUT_CAPTURE_ONCE_RISING (2<<3)
208#define NETX_GPIO_CFG_MODE_INPUT_CAPTURE_HIGH_LEVEL (3<<3)
209#define NETX_GPIO_CFG_COUNT_REF_COUNTER0 (0<<5)
210#define NETX_GPIO_CFG_COUNT_REF_COUNTER1 (1<<5)
211#define NETX_GPIO_CFG_COUNT_REF_COUNTER2 (2<<5)
212#define NETX_GPIO_CFG_COUNT_REF_COUNTER3 (3<<5)
213#define NETX_GPIO_CFG_COUNT_REF_COUNTER4 (4<<5)
214#define NETX_GPIO_CFG_COUNT_REF_SYSTIME (7<<5)
215
216#define NETX_GPIO_COUNTER_CTRL_RUN (1<<0)
217#define NETX_GPIO_COUNTER_CTRL_SYM (1<<1)
218#define NETX_GPIO_COUNTER_CTRL_ONCE (1<<2)
219#define NETX_GPIO_COUNTER_CTRL_IRQ_EN (1<<3)
220#define NETX_GPIO_COUNTER_CTRL_CNT_EVENT (1<<4)
221#define NETX_GPIO_COUNTER_CTRL_RST_EN (1<<5)
222#define NETX_GPIO_COUNTER_CTRL_SEL_EVENT (1<<6)
223#define NETX_GPIO_COUNTER_CTRL_GPIO_REF /* FIXME */
224
225#define GPIO_BIT(gpio) (1<<(gpio))
226#define COUNTER_BIT(counter) ((1<<16)<<(counter))
227
228/*******************************
229 * PIO *
230 *******************************/
231
232/* Registers */
233#define NETX_PIO_REG(ofs) __io(NETX_VA_PIO + (ofs))
234#define NETX_PIO_INPIO NETX_PIO_REG(0x0)
235#define NETX_PIO_OUTPIO NETX_PIO_REG(0x4)
236#define NETX_PIO_OEPIO NETX_PIO_REG(0x8)
237
238/*******************************
239 * MII Unit *
240 *******************************/
241
242/* Registers */
243#define NETX_MIIMU __io(NETX_VA_MIIMU)
244
245/* Bits */
246#define MIIMU_SNRDY (1<<0)
247#define MIIMU_PREAMBLE (1<<1)
248#define MIIMU_OPMODE_WRITE (1<<2)
249#define MIIMU_MDC_PERIOD (1<<3)
250#define MIIMU_PHY_NRES (1<<4)
251#define MIIMU_RTA (1<<5)
252#define MIIMU_REGADDR(adr) (((adr) & 0x1f) << 6)
253#define MIIMU_PHYADDR(adr) (((adr) & 0x1f) << 11)
254#define MIIMU_DATA(data) (((data) & 0xffff) << 16)
255
256/*******************************
257 * xmac / xpec *
258 *******************************/
259
260/* XPEC register offsets relative to NETX_VA_XPEC(no) */
261#define NETX_XPEC_R0_OFS 0x00
262#define NETX_XPEC_R1_OFS 0x04
263#define NETX_XPEC_R2_OFS 0x08
264#define NETX_XPEC_R3_OFS 0x0c
265#define NETX_XPEC_R4_OFS 0x10
266#define NETX_XPEC_R5_OFS 0x14
267#define NETX_XPEC_R6_OFS 0x18
268#define NETX_XPEC_R7_OFS 0x1c
269#define NETX_XPEC_RANGE01_OFS 0x20
270#define NETX_XPEC_RANGE23_OFS 0x24
271#define NETX_XPEC_RANGE45_OFS 0x28
272#define NETX_XPEC_RANGE67_OFS 0x2c
273#define NETX_XPEC_PC_OFS 0x48
274#define NETX_XPEC_TIMER_OFS(timer) (0x30 + ((timer)<<2))
275#define NETX_XPEC_IRQ_OFS 0x8c
276#define NETX_XPEC_SYSTIME_NS_OFS 0x90
277#define NETX_XPEC_FIFO_DATA_OFS 0x94
278#define NETX_XPEC_SYSTIME_S_OFS 0x98
279#define NETX_XPEC_ADC_OFS 0x9c
280#define NETX_XPEC_URX_COUNT_OFS 0x40
281#define NETX_XPEC_UTX_COUNT_OFS 0x44
282#define NETX_XPEC_PC_OFS 0x48
283#define NETX_XPEC_ZERO_OFS 0x4c
284#define NETX_XPEC_STATCFG_OFS 0x50
285#define NETX_XPEC_EC_MASKA_OFS 0x54
286#define NETX_XPEC_EC_MASKB_OFS 0x58
287#define NETX_XPEC_EC_MASK0_OFS 0x5c
288#define NETX_XPEC_EC_MASK8_OFS 0x7c
289#define NETX_XPEC_EC_MASK9_OFS 0x80
290#define NETX_XPEC_XPU_HOLD_PC_OFS 0x100
291#define NETX_XPEC_RAM_START_OFS 0x2000
292
293/* Bits */
294#define XPU_HOLD_PC (1<<0)
295
296/* XMAC register offsets relative to NETX_VA_XMAC(no) */
297#define NETX_XMAC_RPU_PROGRAM_START_OFS 0x000
298#define NETX_XMAC_RPU_PROGRAM_END_OFS 0x3ff
299#define NETX_XMAC_TPU_PROGRAM_START_OFS 0x400
300#define NETX_XMAC_TPU_PROGRAM_END_OFS 0x7ff
301#define NETX_XMAC_RPU_HOLD_PC_OFS 0xa00
302#define NETX_XMAC_TPU_HOLD_PC_OFS 0xa04
303#define NETX_XMAC_STATUS_SHARED0_OFS 0x840
304#define NETX_XMAC_CONFIG_SHARED0_OFS 0x844
305#define NETX_XMAC_STATUS_SHARED1_OFS 0x848
306#define NETX_XMAC_CONFIG_SHARED1_OFS 0x84c
307#define NETX_XMAC_STATUS_SHARED2_OFS 0x850
308#define NETX_XMAC_CONFIG_SHARED2_OFS 0x854
309#define NETX_XMAC_STATUS_SHARED3_OFS 0x858
310#define NETX_XMAC_CONFIG_SHARED3_OFS 0x85c
311
312#define RPU_HOLD_PC (1<<15)
313#define TPU_HOLD_PC (1<<15)
314
315/*******************************
316 * Pointer FIFO *
317 *******************************/
318
319/* Registers */
320#define NETX_PFIFO_REG(ofs) __io(NETX_VA_PFIFO + (ofs))
321#define NETX_PFIFO_BASE(pfifo) NETX_PFIFO_REG(0x00 + ((pfifo)<<2))
322#define NETX_PFIFO_BORDER_BASE(pfifo) NETX_PFIFO_REG(0x80 + ((pfifo)<<2))
323#define NETX_PFIFO_RESET NETX_PFIFO_REG(0x100)
324#define NETX_PFIFO_FULL NETX_PFIFO_REG(0x104)
325#define NETX_PFIFO_EMPTY NETX_PFIFO_REG(0x108)
326#define NETX_PFIFO_OVEFLOW NETX_PFIFO_REG(0x10c)
327#define NETX_PFIFO_UNDERRUN NETX_PFIFO_REG(0x110)
328#define NETX_PFIFO_FILL_LEVEL(pfifo) NETX_PFIFO_REG(0x180 + ((pfifo)<<2))
329#define NETX_PFIFO_XPEC_ISR(xpec) NETX_PFIFO_REG(0x400 + ((xpec) << 2))
330
331/*******************************
332 * Dual Port Memory *
333 *******************************/
334
335/* Registers */
336#define NETX_DPMAS_REG(ofs) __io(NETX_VA_DPMAS + (ofs))
337#define NETX_DPMAS_SYS_STAT NETX_DPMAS_REG(0x4d8)
338#define NETX_DPMAS_INT_STAT NETX_DPMAS_REG(0x4e0)
339#define NETX_DPMAS_INT_EN NETX_DPMAS_REG(0x4f0)
340#define NETX_DPMAS_IF_CONF0 NETX_DPMAS_REG(0x608)
341#define NETX_DPMAS_IF_CONF1 NETX_DPMAS_REG(0x60c)
342#define NETX_DPMAS_EXT_CONFIG(cs) NETX_DPMAS_REG(0x610 + 4 * (cs))
343#define NETX_DPMAS_IO_MODE0 NETX_DPMAS_REG(0x620) /* I/O 32..63 */
344#define NETX_DPMAS_DRV_EN0 NETX_DPMAS_REG(0x624)
345#define NETX_DPMAS_DATA0 NETX_DPMAS_REG(0x628)
346#define NETX_DPMAS_IO_MODE1 NETX_DPMAS_REG(0x630) /* I/O 64..84 */
347#define NETX_DPMAS_DRV_EN1 NETX_DPMAS_REG(0x634)
348#define NETX_DPMAS_DATA1 NETX_DPMAS_REG(0x638)
349
350/* Bits */
351#define NETX_DPMAS_INT_EN_GLB_EN (1<<31)
352#define NETX_DPMAS_INT_EN_MEM_LCK (1<<30)
353#define NETX_DPMAS_INT_EN_WDG (1<<29)
354#define NETX_DPMAS_INT_EN_PIO72 (1<<28)
355#define NETX_DPMAS_INT_EN_PIO47 (1<<27)
356#define NETX_DPMAS_INT_EN_PIO40 (1<<26)
357#define NETX_DPMAS_INT_EN_PIO36 (1<<25)
358#define NETX_DPMAS_INT_EN_PIO35 (1<<24)
359
360#define NETX_DPMAS_IF_CONF0_HIF_DISABLED (0<<28)
361#define NETX_DPMAS_IF_CONF0_HIF_EXT_BUS (1<<28)
362#define NETX_DPMAS_IF_CONF0_HIF_UP_8BIT (2<<28)
363#define NETX_DPMAS_IF_CONF0_HIF_UP_16BIT (3<<28)
364#define NETX_DPMAS_IF_CONF0_HIF_IO (4<<28)
365#define NETX_DPMAS_IF_CONF0_WAIT_DRV_PP (1<<14)
366#define NETX_DPMAS_IF_CONF0_WAIT_DRV_OD (2<<14)
367#define NETX_DPMAS_IF_CONF0_WAIT_DRV_TRI (3<<14)
368
369#define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO35 (1<<26)
370#define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO36 (1<<27)
371#define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO40 (1<<28)
372#define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO47 (1<<29)
373#define NETX_DPMAS_IF_CONF1_IRQ_POL_PIO72 (1<<30)
374
375#define NETX_EXT_CONFIG_TALEWIDTH(x) (((x) & 0x7) << 29)
376#define NETX_EXT_CONFIG_TADRHOLD(x) (((x) & 0x7) << 26)
377#define NETX_EXT_CONFIG_TCSON(x) (((x) & 0x7) << 23)
378#define NETX_EXT_CONFIG_TRDON(x) (((x) & 0x7) << 20)
379#define NETX_EXT_CONFIG_TWRON(x) (((x) & 0x7) << 17)
380#define NETX_EXT_CONFIG_TWROFF(x) (((x) & 0x1f) << 12)
381#define NETX_EXT_CONFIG_TRDWRCYC(x) (((x) & 0x1f) << 7)
382#define NETX_EXT_CONFIG_WAIT_POL (1<<6)
383#define NETX_EXT_CONFIG_WAIT_EN (1<<5)
384#define NETX_EXT_CONFIG_NRD_MODE (1<<4)
385#define NETX_EXT_CONFIG_DS_MODE (1<<3)
386#define NETX_EXT_CONFIG_NWR_MODE (1<<2)
387#define NETX_EXT_CONFIG_16BIT (1<<1)
388#define NETX_EXT_CONFIG_CS_ENABLE (1<<0)
389
390#define NETX_DPMAS_IO_MODE0_WRL (1<<13)
391#define NETX_DPMAS_IO_MODE0_WAIT (1<<14)
392#define NETX_DPMAS_IO_MODE0_READY (1<<15)
393#define NETX_DPMAS_IO_MODE0_CS0 (1<<19)
394#define NETX_DPMAS_IO_MODE0_EXTRD (1<<20)
395
396#define NETX_DPMAS_IO_MODE1_CS2 (1<<15)
397#define NETX_DPMAS_IO_MODE1_CS1 (1<<16)
398#define NETX_DPMAS_IO_MODE1_SAMPLE_NPOR (0<<30)
399#define NETX_DPMAS_IO_MODE1_SAMPLE_100MHZ (1<<30)
400#define NETX_DPMAS_IO_MODE1_SAMPLE_NPIO36 (2<<30)
401#define NETX_DPMAS_IO_MODE1_SAMPLE_PIO36 (3<<30)
402
403/*******************************
404 * I2C *
405 *******************************/
406#define NETX_I2C_REG(ofs) __io(NETX_VA_I2C, (ofs))
407#define NETX_I2C_CTRL NETX_I2C_REG(0x0)
408#define NETX_I2C_DATA NETX_I2C_REG(0x4)
409
410#endif /* __ASM_ARCH_NETX_REGS_H */
diff --git a/include/asm-arm/arch-netx/param.h b/include/asm-arm/arch-netx/param.h
new file mode 100644
index 000000000000..7a80c26178a8
--- /dev/null
+++ b/include/asm-arm/arch-netx/param.h
@@ -0,0 +1,18 @@
1/*
2 * linux/include/asm-arm/arch-netx/param.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
diff --git a/include/asm-arm/arch-netx/pfifo.h b/include/asm-arm/arch-netx/pfifo.h
new file mode 100644
index 000000000000..4af2ee4a32c1
--- /dev/null
+++ b/include/asm-arm/arch-netx/pfifo.h
@@ -0,0 +1,54 @@
1/*
2 * include/asm-arm/arch-netx/pfifo.h
3 *
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20
21#ifndef ASM_ARCH_PFIFO_H
22#define ASM_ARCH_PFIFO_H
23
24static inline int pfifo_push(int no, unsigned int pointer)
25{
26 writel(pointer, NETX_PFIFO_BASE(no));
27 return 0;
28}
29
30static inline unsigned int pfifo_pop(int no)
31{
32 return readl(NETX_PFIFO_BASE(no));
33}
34
35static inline int pfifo_fill_level(int no)
36{
37
38 return readl(NETX_PFIFO_FILL_LEVEL(no));
39}
40
41static inline int pfifo_full(int no)
42{
43 return readl(NETX_PFIFO_FULL) & (1<<no) ? 1 : 0;
44}
45
46static inline int pfifo_empty(int no)
47{
48 return readl(NETX_PFIFO_EMPTY) & (1<<no) ? 1 : 0;
49}
50
51int pfifo_request(unsigned int pfifo_mask);
52void pfifo_free(unsigned int pfifo_mask);
53
54#endif /* ASM_ARCH_PFIFO_H */
diff --git a/include/asm-arm/arch-netx/system.h b/include/asm-arm/arch-netx/system.h
new file mode 100644
index 000000000000..52adf368d765
--- /dev/null
+++ b/include/asm-arm/arch-netx/system.h
@@ -0,0 +1,38 @@
1/*
2 * include/asm-arm/arch-netx/system.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __ASM_ARCH_SYSTEM_H
20#define __ASM_ARCH_SYSTEM_H
21
22#include <asm/io.h>
23#include <asm/hardware.h>
24#include "netx-regs.h"
25
26static inline void arch_idle(void)
27{
28 cpu_do_idle();
29}
30
31static inline void arch_reset(char mode)
32{
33 writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
34 NETX_SYSTEM_RES_CR);
35}
36
37#endif
38
diff --git a/include/asm-arm/arch-netx/timex.h b/include/asm-arm/arch-netx/timex.h
new file mode 100644
index 000000000000..7fdb42da0b40
--- /dev/null
+++ b/include/asm-arm/arch-netx/timex.h
@@ -0,0 +1,20 @@
1/*
2 * include/asm-arm/arch-netx/timex.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#define CLOCK_TICK_RATE 100000000
diff --git a/include/asm-arm/arch-netx/uncompress.h b/include/asm-arm/arch-netx/uncompress.h
new file mode 100644
index 000000000000..f89434547102
--- /dev/null
+++ b/include/asm-arm/arch-netx/uncompress.h
@@ -0,0 +1,76 @@
1/*
2 * include/asm-arm/arch-netx/uncompress.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20/*
21 * The following code assumes the serial port has already been
22 * initialized by the bootloader. We search for the first enabled
23 * port in the most probable order. If you didn't setup a port in
24 * your bootloader then nothing will appear (which might be desired).
25 *
26 * This does not append a newline
27 */
28
29#define REG(x) (*(volatile unsigned long *)(x))
30
31#define UART1_BASE 0x100a00
32#define UART2_BASE 0x100a80
33
34#define UART_DR 0x0
35
36#define UART_CR 0x14
37#define CR_UART_EN (1<<0)
38
39#define UART_FR 0x18
40#define FR_BUSY (1<<3)
41#define FR_TXFF (1<<5)
42
43static void putc(char c)
44{
45 unsigned long base;
46
47 if (REG(UART1_BASE + UART_CR) & CR_UART_EN)
48 base = UART1_BASE;
49 else if (REG(UART2_BASE + UART_CR) & CR_UART_EN)
50 base = UART2_BASE;
51 else
52 return;
53
54 while (REG(base + UART_FR) & FR_TXFF);
55 REG(base + UART_DR) = c;
56}
57
58static inline void flush(void)
59{
60 unsigned long base;
61
62 if (REG(UART1_BASE + UART_CR) & CR_UART_EN)
63 base = UART1_BASE;
64 else if (REG(UART2_BASE + UART_CR) & CR_UART_EN)
65 base = UART2_BASE;
66 else
67 return;
68
69 while (REG(base + UART_FR) & FR_BUSY);
70}
71
72/*
73 * nothing to do
74 */
75#define arch_decomp_setup()
76#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-netx/vmalloc.h b/include/asm-arm/arch-netx/vmalloc.h
new file mode 100644
index 000000000000..da2da5a595da
--- /dev/null
+++ b/include/asm-arm/arch-netx/vmalloc.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm-arm/arch-netx/vmalloc.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-netx/xc.h b/include/asm-arm/arch-netx/xc.h
new file mode 100644
index 000000000000..659af19512a9
--- /dev/null
+++ b/include/asm-arm/arch-netx/xc.h
@@ -0,0 +1,42 @@
1/*
2 * linux/include/asm-arm/arch-netx/xc.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_ARCH_XC_H
21#define __ASM_ARCH_XC_H
22
23struct xc {
24 int no;
25 unsigned int type;
26 unsigned int version;
27 void __iomem *xpec_base;
28 void __iomem *xmac_base;
29 void __iomem *sram_base;
30 int irq;
31 struct device *dev;
32};
33
34int xc_reset(struct xc *x);
35int xc_stop(struct xc* x);
36int xc_start(struct xc *x);
37int xc_running(struct xc *x);
38int xc_request_firmware(struct xc* x);
39struct xc* request_xc(int xcno, struct device *dev);
40void free_xc(struct xc *x);
41
42#endif /* __ASM_ARCH_XC_H */
diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h
index 6d6240a4681c..dfdbf06fd646 100644
--- a/include/asm-arm/arch-omap/board.h
+++ b/include/asm-arm/arch-omap/board.h
@@ -10,7 +10,6 @@
10#ifndef _OMAP_BOARD_H 10#ifndef _OMAP_BOARD_H
11#define _OMAP_BOARD_H 11#define _OMAP_BOARD_H
12 12
13#include <linux/config.h>
14#include <linux/types.h> 13#include <linux/types.h>
15 14
16/* Different peripheral ids */ 15/* Different peripheral ids */
diff --git a/include/asm-arm/arch-omap/hardware.h b/include/asm-arm/arch-omap/hardware.h
index 7909b729826c..c7d9e857795d 100644
--- a/include/asm-arm/arch-omap/hardware.h
+++ b/include/asm-arm/arch-omap/hardware.h
@@ -37,7 +37,6 @@
37#define __ASM_ARCH_OMAP_HARDWARE_H 37#define __ASM_ARCH_OMAP_HARDWARE_H
38 38
39#include <asm/sizes.h> 39#include <asm/sizes.h>
40#include <linux/config.h>
41#ifndef __ASSEMBLER__ 40#ifndef __ASSEMBLER__
42#include <asm/types.h> 41#include <asm/types.h>
43#include <asm/arch/cpu.h> 42#include <asm/arch/cpu.h>
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h
index b726acfcab14..78f68e6a4f0c 100644
--- a/include/asm-arm/arch-omap/io.h
+++ b/include/asm-arm/arch-omap/io.h
@@ -44,7 +44,6 @@
44 */ 44 */
45#define __io(a) ((void __iomem *)(PCIO_BASE + (a))) 45#define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
46#define __mem_pci(a) (a) 46#define __mem_pci(a) (a)
47#define __mem_isa(a) (a)
48 47
49/* 48/*
50 * ---------------------------------------------------------------------------- 49 * ----------------------------------------------------------------------------
diff --git a/include/asm-arm/arch-omap/system.h b/include/asm-arm/arch-omap/system.h
index 67970d1a2020..ac2bfa433f06 100644
--- a/include/asm-arm/arch-omap/system.h
+++ b/include/asm-arm/arch-omap/system.h
@@ -4,7 +4,6 @@
4 */ 4 */
5#ifndef __ASM_ARCH_SYSTEM_H 5#ifndef __ASM_ARCH_SYSTEM_H
6#define __ASM_ARCH_SYSTEM_H 6#define __ASM_ARCH_SYSTEM_H
7#include <linux/config.h>
8#include <linux/clk.h> 7#include <linux/clk.h>
9 8
10#include <asm/mach-types.h> 9#include <asm/mach-types.h>
diff --git a/include/asm-arm/arch-omap/uncompress.h b/include/asm-arm/arch-omap/uncompress.h
index ca2c8bec82e7..aca0adfef1b8 100644
--- a/include/asm-arm/arch-omap/uncompress.h
+++ b/include/asm-arm/arch-omap/uncompress.h
@@ -17,7 +17,6 @@
17 * kind, whether express or implied. 17 * kind, whether express or implied.
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/types.h> 20#include <linux/types.h>
22#include <linux/serial_reg.h> 21#include <linux/serial_reg.h>
23#include <asm/arch/serial.h> 22#include <asm/arch/serial.h>
diff --git a/include/asm-arm/arch-pnx4008/clock.h b/include/asm-arm/arch-pnx4008/clock.h
new file mode 100644
index 000000000000..91ae0030fdf2
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/clock.h
@@ -0,0 +1,61 @@
1/*
2 * include/asm-arm/arch-pnx4008/clock.h
3 *
4 * Clock control driver for PNX4008 - header file
5 *
6 * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#ifndef __PNX4008_CLOCK_H__
14#define __PNX4008_CLOCK_H__
15
16struct module;
17struct clk;
18
19#define PWRMAN_VA_BASE IO_ADDRESS(PNX4008_PWRMAN_BASE)
20#define HCLKDIVCTRL_REG (PWRMAN_VA_BASE + 0x40)
21#define PWRCTRL_REG (PWRMAN_VA_BASE + 0x44)
22#define PLLCTRL_REG (PWRMAN_VA_BASE + 0x48)
23#define OSC13CTRL_REG (PWRMAN_VA_BASE + 0x4c)
24#define SYSCLKCTRL_REG (PWRMAN_VA_BASE + 0x50)
25#define HCLKPLLCTRL_REG (PWRMAN_VA_BASE + 0x58)
26#define USBCTRL_REG (PWRMAN_VA_BASE + 0x64)
27#define SDRAMCLKCTRL_REG (PWRMAN_VA_BASE + 0x68)
28#define MSCTRL_REG (PWRMAN_VA_BASE + 0x80)
29#define BTCLKCTRL (PWRMAN_VA_BASE + 0x84)
30#define DUMCLKCTRL_REG (PWRMAN_VA_BASE + 0x90)
31#define I2CCLKCTRL_REG (PWRMAN_VA_BASE + 0xac)
32#define KEYCLKCTRL_REG (PWRMAN_VA_BASE + 0xb0)
33#define TSCLKCTRL_REG (PWRMAN_VA_BASE + 0xb4)
34#define PWMCLKCTRL_REG (PWRMAN_VA_BASE + 0xb8)
35#define SPICTRL_REG (PWRMAN_VA_BASE + 0xc4)
36#define FLASHCLKCTRL_REG (PWRMAN_VA_BASE + 0xc8)
37#define UART3CLK_REG (PWRMAN_VA_BASE + 0xd0)
38#define UARTCLKCTRL_REG (PWRMAN_VA_BASE + 0xe4)
39#define DMACLKCTRL_REG (PWRMAN_VA_BASE + 0xe8)
40#define AUTOCLK_CTRL (PWRMAN_VA_BASE + 0xec)
41#define JPEGCLKCTRL_REG (PWRMAN_VA_BASE + 0xfc)
42
43#define AUDIOCONFIG_VA_BASE IO_ADDRESS(PNX4008_AUDIOCONFIG_BASE)
44#define DSPPLLCTRL_REG (AUDIOCONFIG_VA_BASE + 0x60)
45#define DSPCLKCTRL_REG (AUDIOCONFIG_VA_BASE + 0x64)
46#define AUDIOCLKCTRL_REG (AUDIOCONFIG_VA_BASE + 0x68)
47#define AUDIOPLLCTRL_REG (AUDIOCONFIG_VA_BASE + 0x6C)
48
49#define USB_OTG_CLKCTRL_REG IO_ADDRESS(PNX4008_USB_CONFIG_BASE + 0xff4)
50
51#define VFP9CLKCTRL_REG IO_ADDRESS(PNX4008_DEBUG_BASE)
52
53#define CLK_RATE_13MHZ 13000
54#define CLK_RATE_1MHZ 1000
55#define CLK_RATE_208MHZ 208000
56#define CLK_RATE_48MHZ 48000
57#define CLK_RATE_32KHZ 32
58
59#define PNX4008_UART_CLK CLK_RATE_13MHZ * 1000 /* in MHz */
60
61#endif
diff --git a/include/asm-arm/arch-pnx4008/debug-macro.S b/include/asm-arm/arch-pnx4008/debug-macro.S
new file mode 100644
index 000000000000..67d18a203d23
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/debug-macro.S
@@ -0,0 +1,23 @@
1/* linux/include/asm-arm/arch-pnx4008/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled?
17 mov \rx, #0x00090000
18 addeq \rx, \rx, #0x40000000
19 addne \rx, \rx, #0xf4000000
20 .endm
21
22#define UART_SHIFT 2
23#include <asm/hardware/debug-8250.S>
diff --git a/include/asm-arm/arch-pnx4008/dma.h b/include/asm-arm/arch-pnx4008/dma.h
new file mode 100644
index 000000000000..3aee1204795b
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/dma.h
@@ -0,0 +1,162 @@
1/*
2 * linux/include/asm-arm/arch-pnx4008/dma.h
3 *
4 * PNX4008 DMA header file
5 *
6 * Author: Vitaly Wool
7 * Copyright: MontaVista Software Inc. (c) 2005
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef __ASM_ARCH_DMA_H
15#define __ASM_ARCH_DMA_H
16
17#include "platform.h"
18
19#define MAX_DMA_ADDRESS 0xffffffff
20
21#define MAX_DMA_CHANNELS 8
22
23#define DMAC_BASE IO_ADDRESS(PNX4008_DMA_CONFIG_BASE)
24#define DMAC_INT_STAT (DMAC_BASE + 0x0000)
25#define DMAC_INT_TC_STAT (DMAC_BASE + 0x0004)
26#define DMAC_INT_TC_CLEAR (DMAC_BASE + 0x0008)
27#define DMAC_INT_ERR_STAT (DMAC_BASE + 0x000c)
28#define DMAC_INT_ERR_CLEAR (DMAC_BASE + 0x0010)
29#define DMAC_SOFT_SREQ (DMAC_BASE + 0x0024)
30#define DMAC_CONFIG (DMAC_BASE + 0x0030)
31#define DMAC_Cx_SRC_ADDR(c) (DMAC_BASE + 0x0100 + (c) * 0x20)
32#define DMAC_Cx_DEST_ADDR(c) (DMAC_BASE + 0x0104 + (c) * 0x20)
33#define DMAC_Cx_LLI(c) (DMAC_BASE + 0x0108 + (c) * 0x20)
34#define DMAC_Cx_CONTROL(c) (DMAC_BASE + 0x010c + (c) * 0x20)
35#define DMAC_Cx_CONFIG(c) (DMAC_BASE + 0x0110 + (c) * 0x20)
36
37enum {
38 WIDTH_BYTE = 0,
39 WIDTH_HWORD,
40 WIDTH_WORD
41};
42
43enum {
44 FC_MEM2MEM_DMA,
45 FC_MEM2PER_DMA,
46 FC_PER2MEM_DMA,
47 FC_PER2PER_DMA,
48 FC_PER2PER_DPER,
49 FC_MEM2PER_PER,
50 FC_PER2MEM_PER,
51 FC_PER2PER_SPER
52};
53
54enum {
55 DMA_INT_UNKNOWN = 0,
56 DMA_ERR_INT = 1,
57 DMA_TC_INT = 2,
58};
59
60enum {
61 DMA_BUFFER_ALLOCATED = 1,
62 DMA_HAS_LL = 2,
63};
64
65enum {
66 PER_CAM_DMA_1 = 0,
67 PER_NDF_FLASH = 1,
68 PER_MBX_SLAVE_FIFO = 2,
69 PER_SPI2_REC_XMIT = 3,
70 PER_MS_SD_RX_XMIT = 4,
71 PER_HS_UART_1_XMIT = 5,
72 PER_HS_UART_1_RX = 6,
73 PER_HS_UART_2_XMIT = 7,
74 PER_HS_UART_2_RX = 8,
75 PER_HS_UART_7_XMIT = 9,
76 PER_HS_UART_7_RX = 10,
77 PER_SPI1_REC_XMIT = 11,
78 PER_MLC_NDF_SREC = 12,
79 PER_CAM_DMA_2 = 13,
80 PER_PRNG_INFIFO = 14,
81 PER_PRNG_OUTFIFO = 15,
82};
83
84struct pnx4008_dma_ch_ctrl {
85 int tc_mask;
86 int cacheable;
87 int bufferable;
88 int priv_mode;
89 int di;
90 int si;
91 int dest_ahb1;
92 int src_ahb1;
93 int dwidth;
94 int swidth;
95 int dbsize;
96 int sbsize;
97 int tr_size;
98};
99
100struct pnx4008_dma_ch_config {
101 int halt;
102 int active;
103 int lock;
104 int itc;
105 int ie;
106 int flow_cntrl;
107 int dest_per;
108 int src_per;
109};
110
111struct pnx4008_dma_ll {
112 unsigned long src_addr;
113 unsigned long dest_addr;
114 u32 next_dma;
115 unsigned long ch_ctrl;
116 struct pnx4008_dma_ll *next;
117 int flags;
118 void *alloc_data;
119 int (*free) (void *);
120};
121
122struct pnx4008_dma_config {
123 int is_ll;
124 unsigned long src_addr;
125 unsigned long dest_addr;
126 unsigned long ch_ctrl;
127 unsigned long ch_cfg;
128 struct pnx4008_dma_ll *ll;
129 u32 ll_dma;
130 int flags;
131 void *alloc_data;
132 int (*free) (void *);
133};
134
135extern struct pnx4008_dma_ll *pnx4008_alloc_ll_entry(dma_addr_t *);
136extern void pnx4008_free_ll_entry(struct pnx4008_dma_ll *, dma_addr_t);
137extern void pnx4008_free_ll(u32 ll_dma, struct pnx4008_dma_ll *);
138
139extern int pnx4008_request_channel(char *, int,
140 void (*)(int, int, void *, struct pt_regs *),
141 void *);
142extern void pnx4008_free_channel(int);
143extern int pnx4008_config_dma(int, int, int);
144extern int pnx4008_dma_pack_control(const struct pnx4008_dma_ch_ctrl *,
145 unsigned long *);
146extern int pnx4008_dma_parse_control(unsigned long,
147 struct pnx4008_dma_ch_ctrl *);
148extern int pnx4008_dma_pack_config(const struct pnx4008_dma_ch_config *,
149 unsigned long *);
150extern int pnx4008_dma_parse_config(unsigned long,
151 struct pnx4008_dma_ch_config *);
152extern int pnx4008_config_channel(int, struct pnx4008_dma_config *);
153extern int pnx4008_channel_get_config(int, struct pnx4008_dma_config *);
154extern int pnx4008_dma_ch_enable(int);
155extern int pnx4008_dma_ch_disable(int);
156extern int pnx4008_dma_ch_enabled(int);
157extern void pnx4008_dma_split_head_entry(struct pnx4008_dma_config *,
158 struct pnx4008_dma_ch_ctrl *);
159extern void pnx4008_dma_split_ll_entry(struct pnx4008_dma_ll *,
160 struct pnx4008_dma_ch_ctrl *);
161
162#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-pnx4008/entry-macro.S b/include/asm-arm/arch-pnx4008/entry-macro.S
new file mode 100644
index 000000000000..c1c198e3680b
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/entry-macro.S
@@ -0,0 +1,121 @@
1/*
2 * include/asm-arm/arch-pnx4008/entry-macro.S
3 *
4 * Low-level IRQ helper macros for PNX4008-based platforms
5 *
6 * 2005-2006 (c) MontaVista Software, Inc.
7 * Author: Vitaly Wool <vwool@ru.mvista.com>
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include "platform.h"
14
15#define IO_BASE 0xF0000000
16#define IO_ADDRESS(x) (((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) | IO_BASE)
17
18#define INTRC_MASK 0x00
19#define INTRC_RAW_STAT 0x04
20#define INTRC_STAT 0x08
21#define INTRC_POLAR 0x0C
22#define INTRC_ACT_TYPE 0x10
23#define INTRC_TYPE 0x14
24
25#define SIC1_BASE_INT 32
26#define SIC2_BASE_INT 64
27
28 .macro disable_fiq
29 .endm
30
31 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
32/* decode the MIC interrupt numbers */
33 ldr \base, =IO_ADDRESS(PNX4008_INTCTRLMIC_BASE)
34 ldr \irqstat, [\base, #INTRC_STAT]
35
36 cmp \irqstat,#1<<16
37 movhs \irqnr,#16
38 movlo \irqnr,#0
39 movhs \irqstat,\irqstat,lsr#16
40 cmp \irqstat,#1<<8
41 addhs \irqnr,\irqnr,#8
42 movhs \irqstat,\irqstat,lsr#8
43 cmp \irqstat,#1<<4
44 addhs \irqnr,\irqnr,#4
45 movhs \irqstat,\irqstat,lsr#4
46 cmp \irqstat,#1<<2
47 addhs \irqnr,\irqnr,#2
48 movhs \irqstat,\irqstat,lsr#2
49 cmp \irqstat,#1<<1
50 addhs \irqnr,\irqnr,#1
51
52/* was there an interrupt ? if not then drop out with EQ status */
53 teq \irqstat,#0
54 beq 1003f
55
56/* and now check for extended IRQ reasons */
57 cmp \irqnr,#1
58 bls 1003f
59 cmp \irqnr,#30
60 blo 1002f
61
62/* IRQ 31,30 : High priority cascade IRQ handle */
63/* read the correct SIC */
64/* decoding status after compare : eq is 30 (SIC1) , ne is 31 (SIC2) */
65/* set the base IRQ number */
66 ldreq \base, =IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE)
67 moveq \irqnr,#SIC1_BASE_INT
68 ldrne \base, =IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE)
69 movne \irqnr,#SIC2_BASE_INT
70 ldr \irqstat, [\base, #INTRC_STAT]
71 ldr \tmp, [\base, #INTRC_TYPE]
72/* and with inverted mask : low priority interrupts */
73 and \irqstat,\irqstat,\tmp
74 b 1004f
75
761003:
77/* IRQ 1,0 : Low priority cascade IRQ handle */
78/* read the correct SIC */
79/* decoding status after compare : eq is 1 (SIC2) , ne is 0 (SIC1)*/
80/* read the correct SIC */
81/* set the base IRQ number */
82 ldrne \base, =IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE)
83 movne \irqnr,#SIC1_BASE_INT
84 ldreq \base, =IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE)
85 moveq \irqnr,#SIC2_BASE_INT
86 ldr \irqstat, [\base, #INTRC_STAT]
87 ldr \tmp, [\base, #INTRC_TYPE]
88/* and with inverted mask : low priority interrupts */
89 bic \irqstat,\irqstat,\tmp
90
911004:
92
93 cmp \irqstat,#1<<16
94 addhs \irqnr,\irqnr,#16
95 movhs \irqstat,\irqstat,lsr#16
96 cmp \irqstat,#1<<8
97 addhs \irqnr,\irqnr,#8
98 movhs \irqstat,\irqstat,lsr#8
99 cmp \irqstat,#1<<4
100 addhs \irqnr,\irqnr,#4
101 movhs \irqstat,\irqstat,lsr#4
102 cmp \irqstat,#1<<2
103 addhs \irqnr,\irqnr,#2
104 movhs \irqstat,\irqstat,lsr#2
105 cmp \irqstat,#1<<1
106 addhs \irqnr,\irqnr,#1
107
108
109/* is irqstat not zero */
110
1111002:
112/* we assert that irqstat is not equal to zero and return ne status if true*/
113 teq \irqstat,#0
1141003:
115 .endm
116
117
118 .macro irq_prio_table
119 .endm
120
121
diff --git a/include/asm-arm/arch-pnx4008/gpio.h b/include/asm-arm/arch-pnx4008/gpio.h
new file mode 100644
index 000000000000..d01bf83d55c2
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/gpio.h
@@ -0,0 +1,241 @@
1/*
2 * include/asm-arm/arch-pnx4008/gpio.h
3 *
4 * PNX4008 GPIO driver - header file
5 *
6 * Author: Dmitry Chigirev <source@mvista.com>
7 *
8 * Based on reference code by Iwo Mergler and Z.Tabaaloute from Philips:
9 * Copyright (c) 2005 Koninklijke Philips Electronics N.V.
10 *
11 * 2005 (c) MontaVista Software, Inc. This file is licensed under
12 * the terms of the GNU General Public License version 2. This program
13 * is licensed "as is" without any warranty of any kind, whether express
14 * or implied.
15 */
16
17#ifndef _PNX4008_GPIO_H_
18#define _PNX4008_GPIO_H_
19
20
21/* Block numbers */
22#define GPIO_IN (0)
23#define GPIO_OUT (0x100)
24#define GPIO_BID (0x200)
25#define GPIO_RAM (0x300)
26#define GPIO_MUX (0x400)
27
28#define GPIO_TYPE_MASK(K) ((K) & 0x700)
29
30/* INPUT GPIOs */
31/* GPI */
32#define GPI_00 (GPIO_IN | 0)
33#define GPI_01 (GPIO_IN | 1)
34#define GPI_02 (GPIO_IN | 2)
35#define GPI_03 (GPIO_IN | 3)
36#define GPI_04 (GPIO_IN | 4)
37#define GPI_05 (GPIO_IN | 5)
38#define GPI_06 (GPIO_IN | 6)
39#define GPI_07 (GPIO_IN | 7)
40#define GPI_08 (GPIO_IN | 8)
41#define GPI_09 (GPIO_IN | 9)
42#define U1_RX (GPIO_IN | 15)
43#define U2_HTCS (GPIO_IN | 16)
44#define U2_RX (GPIO_IN | 17)
45#define U3_RX (GPIO_IN | 18)
46#define U4_RX (GPIO_IN | 19)
47#define U5_RX (GPIO_IN | 20)
48#define U6_IRRX (GPIO_IN | 21)
49#define U7_HCTS (GPIO_IN | 22)
50#define U7_RX (GPIO_IN | 23)
51/* MISC IN */
52#define SPI1_DATIN (GPIO_IN | 25)
53#define DISP_SYNC (GPIO_IN | 26)
54#define SPI2_DATIN (GPIO_IN | 27)
55#define GPI_11 (GPIO_IN | 28)
56
57#define GPIO_IN_MASK 0x1eff83ff
58
59/* OUTPUT GPIOs */
60/* GPO */
61#define GPO_00 (GPIO_OUT | 0)
62#define GPO_01 (GPIO_OUT | 1)
63#define GPO_02 (GPIO_OUT | 2)
64#define GPO_03 (GPIO_OUT | 3)
65#define GPO_04 (GPIO_OUT | 4)
66#define GPO_05 (GPIO_OUT | 5)
67#define GPO_06 (GPIO_OUT | 6)
68#define GPO_07 (GPIO_OUT | 7)
69#define GPO_08 (GPIO_OUT | 8)
70#define GPO_09 (GPIO_OUT | 9)
71#define GPO_10 (GPIO_OUT | 10)
72#define GPO_11 (GPIO_OUT | 11)
73#define GPO_12 (GPIO_OUT | 12)
74#define GPO_13 (GPIO_OUT | 13)
75#define GPO_14 (GPIO_OUT | 14)
76#define GPO_15 (GPIO_OUT | 15)
77#define GPO_16 (GPIO_OUT | 16)
78#define GPO_17 (GPIO_OUT | 17)
79#define GPO_18 (GPIO_OUT | 18)
80#define GPO_19 (GPIO_OUT | 19)
81#define GPO_20 (GPIO_OUT | 20)
82#define GPO_21 (GPIO_OUT | 21)
83#define GPO_22 (GPIO_OUT | 22)
84#define GPO_23 (GPIO_OUT | 23)
85
86#define GPIO_OUT_MASK 0xffffff
87
88/* BIDIRECTIONAL GPIOs */
89/* RAM pins */
90#define RAM_D19 (GPIO_RAM | 0)
91#define RAM_D20 (GPIO_RAM | 1)
92#define RAM_D21 (GPIO_RAM | 2)
93#define RAM_D22 (GPIO_RAM | 3)
94#define RAM_D23 (GPIO_RAM | 4)
95#define RAM_D24 (GPIO_RAM | 5)
96#define RAM_D25 (GPIO_RAM | 6)
97#define RAM_D26 (GPIO_RAM | 7)
98#define RAM_D27 (GPIO_RAM | 8)
99#define RAM_D28 (GPIO_RAM | 9)
100#define RAM_D29 (GPIO_RAM | 10)
101#define RAM_D30 (GPIO_RAM | 11)
102#define RAM_D31 (GPIO_RAM | 12)
103
104#define GPIO_RAM_MASK 0x1fff
105
106/* I/O pins */
107#define GPIO_00 (GPIO_BID | 25)
108#define GPIO_01 (GPIO_BID | 26)
109#define GPIO_02 (GPIO_BID | 27)
110#define GPIO_03 (GPIO_BID | 28)
111#define GPIO_04 (GPIO_BID | 29)
112#define GPIO_05 (GPIO_BID | 30)
113
114#define GPIO_BID_MASK 0x7e000000
115
116/* Non-GPIO multiplexed PIOs. For multiplexing with GPIO, please use GPIO macros */
117#define GPIO_SDRAM_SEL (GPIO_MUX | 3)
118
119#define GPIO_MUX_MASK 0x8
120
121/* Extraction/assembly macros */
122#define GPIO_BIT_MASK(K) ((K) & 0x1F)
123#define GPIO_BIT(K) (1 << GPIO_BIT_MASK(K))
124#define GPIO_ISMUX(K) ((GPIO_TYPE_MASK(K) == GPIO_MUX) && (GPIO_BIT(K) & GPIO_MUX_MASK))
125#define GPIO_ISRAM(K) ((GPIO_TYPE_MASK(K) == GPIO_RAM) && (GPIO_BIT(K) & GPIO_RAM_MASK))
126#define GPIO_ISBID(K) ((GPIO_TYPE_MASK(K) == GPIO_BID) && (GPIO_BIT(K) & GPIO_BID_MASK))
127#define GPIO_ISOUT(K) ((GPIO_TYPE_MASK(K) == GPIO_OUT) && (GPIO_BIT(K) & GPIO_OUT_MASK))
128#define GPIO_ISIN(K) ((GPIO_TYPE_MASK(K) == GPIO_IN) && (GPIO_BIT(K) & GPIO_IN_MASK))
129
130/* Start Enable Pin Interrupts - table 58 page 66 */
131
132#define SE_PIN_BASE_INT 32
133
134#define SE_U7_RX_INT 63
135#define SE_U7_HCTS_INT 62
136#define SE_BT_CLKREQ_INT 61
137#define SE_U6_IRRX_INT 60
138/*59 unused*/
139#define SE_U5_RX_INT 58
140#define SE_GPI_11_INT 57
141#define SE_U3_RX_INT 56
142#define SE_U2_HCTS_INT 55
143#define SE_U2_RX_INT 54
144#define SE_U1_RX_INT 53
145#define SE_DISP_SYNC_INT 52
146/*51 unused*/
147#define SE_SDIO_INT_N 50
148#define SE_MSDIO_START_INT 49
149#define SE_GPI_06_INT 48
150#define SE_GPI_05_INT 47
151#define SE_GPI_04_INT 46
152#define SE_GPI_03_INT 45
153#define SE_GPI_02_INT 44
154#define SE_GPI_01_INT 43
155#define SE_GPI_00_INT 42
156#define SE_SYSCLKEN_PIN_INT 41
157#define SE_SPI1_DATAIN_INT 40
158#define SE_GPI_07_INT 39
159#define SE_SPI2_DATAIN_INT 38
160#define SE_GPI_10_INT 37
161#define SE_GPI_09_INT 36
162#define SE_GPI_08_INT 35
163/*34-32 unused*/
164
165/* Start Enable Internal Interrupts - table 57 page 65 */
166
167#define SE_INT_BASE_INT 0
168
169#define SE_TS_IRQ 31
170#define SE_TS_P_INT 30
171#define SE_TS_AUX_INT 29
172/*27-28 unused*/
173#define SE_USB_AHB_NEED_CLK_INT 26
174#define SE_MSTIMER_INT 25
175#define SE_RTC_INT 24
176#define SE_USB_NEED_CLK_INT 23
177#define SE_USB_INT 22
178#define SE_USB_I2C_INT 21
179#define SE_USB_OTG_TIMER_INT 20
180#define SE_USB_OTG_ATX_INT_N 19
181/*18 unused*/
182#define SE_DSP_GPIO4_INT 17
183#define SE_KEY_IRQ 16
184#define SE_DSP_SLAVEPORT_INT 15
185#define SE_DSP_GPIO1_INT 14
186#define SE_DSP_GPIO0_INT 13
187#define SE_DSP_AHB_INT 12
188/*11-6 unused*/
189#define SE_GPIO_05_INT 5
190#define SE_GPIO_04_INT 4
191#define SE_GPIO_03_INT 3
192#define SE_GPIO_02_INT 2
193#define SE_GPIO_01_INT 1
194#define SE_GPIO_00_INT 0
195
196#define START_INT_REG_BIT(irq) (1<<((irq)&0x1F))
197
198#define START_INT_ER_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x20 + (((irq)&(0x1<<5))>>1)))
199#define START_INT_RSR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x24 + (((irq)&(0x1<<5))>>1)))
200#define START_INT_SR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x28 + (((irq)&(0x1<<5))>>1)))
201#define START_INT_APR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x2C + (((irq)&(0x1<<5))>>1)))
202
203extern int pnx4008_gpio_register_pin(unsigned short pin);
204extern int pnx4008_gpio_unregister_pin(unsigned short pin);
205extern unsigned long pnx4008_gpio_read_pin(unsigned short pin);
206extern int pnx4008_gpio_write_pin(unsigned short pin, int output);
207extern int pnx4008_gpio_set_pin_direction(unsigned short pin, int output);
208extern int pnx4008_gpio_read_pin_direction(unsigned short pin);
209extern int pnx4008_gpio_set_pin_mux(unsigned short pin, int output);
210extern int pnx4008_gpio_read_pin_mux(unsigned short pin);
211
212static inline void start_int_umask(u8 irq)
213{
214 __raw_writel(__raw_readl(START_INT_ER_REG(irq)) |
215 START_INT_REG_BIT(irq), START_INT_ER_REG(irq));
216}
217
218static inline void start_int_mask(u8 irq)
219{
220 __raw_writel(__raw_readl(START_INT_ER_REG(irq)) &
221 ~START_INT_REG_BIT(irq), START_INT_ER_REG(irq));
222}
223
224static inline void start_int_ack(u8 irq)
225{
226 __raw_writel(START_INT_REG_BIT(irq), START_INT_RSR_REG(irq));
227}
228
229static inline void start_int_set_falling_edge(u8 irq)
230{
231 __raw_writel(__raw_readl(START_INT_APR_REG(irq)) &
232 ~START_INT_REG_BIT(irq), START_INT_APR_REG(irq));
233}
234
235static inline void start_int_set_rising_edge(u8 irq)
236{
237 __raw_writel(__raw_readl(START_INT_APR_REG(irq)) |
238 START_INT_REG_BIT(irq), START_INT_APR_REG(irq));
239}
240
241#endif /* _PNX4008_GPIO_H_ */
diff --git a/include/asm-arm/arch-pnx4008/hardware.h b/include/asm-arm/arch-pnx4008/hardware.h
new file mode 100644
index 000000000000..a4410397a921
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/hardware.h
@@ -0,0 +1,32 @@
1/*
2 * linux/include/asm-arm/arch-pnx4008/hardware.h
3 *
4 * Copyright (c) 2005 MontaVista Software, Inc. <source@mvista.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARCH_HARDWARE_H
21#define __ASM_ARCH_HARDWARE_H
22
23#include <asm/sizes.h>
24#include <asm/arch/platform.h>
25
26/* Start of virtual addresses for IO devices */
27#define IO_BASE 0xF0000000
28
29/* This macro relies on fact that for all HW i/o addresses bits 20-23 are 0 */
30#define IO_ADDRESS(x) (((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) | IO_BASE)
31
32#endif
diff --git a/include/asm-arm/arch-pnx4008/io.h b/include/asm-arm/arch-pnx4008/io.h
new file mode 100644
index 000000000000..29ee43955c52
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/io.h
@@ -0,0 +1,21 @@
1
2/*
3 * include/asm-arm/arch-pnx4008/io.h
4 *
5 * Author: Dmitry Chigirev <chigirev@ru.mvista.com>
6 *
7 * 2005 (c) MontaVista Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13#ifndef __ASM_ARM_ARCH_IO_H
14#define __ASM_ARM_ARCH_IO_H
15
16#define IO_SPACE_LIMIT 0xffffffff
17
18#define __io(a) ((void __iomem *)(a))
19#define __mem_pci(a) (a)
20
21#endif
diff --git a/include/asm-arm/arch-pnx4008/irq.h b/include/asm-arm/arch-pnx4008/irq.h
new file mode 100644
index 000000000000..fabff5dc337f
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/irq.h
@@ -0,0 +1,42 @@
1/*
2 * include/asm-arm/arch-pnx4008/irq.h
3 *
4 * PNX4008 IRQ controller driver - header file
5 * this one is used in entry-arnv.S as well so it cannot contain C code
6 *
7 * Copyright (c) 2005 Philips Semiconductors
8 * Copyright (c) 2005 MontaVista Software, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15#ifndef __PNX4008_IRQ_H__
16#define __PNX4008_IRQ_H__
17
18#define MIC_VA_BASE IO_ADDRESS(PNX4008_INTCTRLMIC_BASE)
19#define SIC1_VA_BASE IO_ADDRESS(PNX4008_INTCTRLSIC1_BASE)
20#define SIC2_VA_BASE IO_ADDRESS(PNX4008_INTCTRLSIC2_BASE)
21
22/* Manual: Chapter 20, page 195 */
23
24#define INTC_BIT(irq) (1<< ((irq) & 0x1F))
25
26#define INTC_ER(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x0 + (((irq)&(0x3<<5))<<9)))
27#define INTC_RSR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x4 + (((irq)&(0x3<<5))<<9)))
28#define INTC_SR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x8 + (((irq)&(0x3<<5))<<9)))
29#define INTC_APR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0xC + (((irq)&(0x3<<5))<<9)))
30#define INTC_ATR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x10 + (((irq)&(0x3<<5))<<9)))
31#define INTC_ITR(irq) IO_ADDRESS((PNX4008_INTCTRLMIC_BASE + 0x14 + (((irq)&(0x3<<5))<<9)))
32
33#define START_INT_REG_BIT(irq) (1<<((irq)&0x1F))
34
35#define START_INT_ER_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x20 + (((irq)&(0x1<<5))>>1)))
36#define START_INT_RSR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x24 + (((irq)&(0x1<<5))>>1)))
37#define START_INT_SR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x28 + (((irq)&(0x1<<5))>>1)))
38#define START_INT_APR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x2C + (((irq)&(0x1<<5))>>1)))
39
40extern void __init pnx4008_init_irq(void);
41
42#endif /* __PNX4008_IRQ_H__ */
diff --git a/include/asm-arm/arch-pnx4008/irqs.h b/include/asm-arm/arch-pnx4008/irqs.h
new file mode 100644
index 000000000000..13ec7ed0f501
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/irqs.h
@@ -0,0 +1,215 @@
1/*
2 * include/asm-arm/arch-pnx4008/irqs.h
3 *
4 * PNX4008 IRQ controller driver - header file
5 *
6 * Author: Dmitry Chigirev <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#ifndef __PNX4008_IRQS_h__
14#define __PNX4008_IRQS_h__
15
16#define NR_IRQS 96
17
18/*Manual: table 259, page 199*/
19
20/*SUB2 Interrupt Routing (SIC2)*/
21
22#define SIC2_BASE_INT 64
23
24#define CLK_SWITCH_ARM_INT 95 /*manual: Clkswitch ARM */
25#define CLK_SWITCH_DSP_INT 94 /*manual: ClkSwitch DSP */
26#define CLK_SWITCH_AUD_INT 93 /*manual: Clkswitch AUD */
27#define GPI_06_INT 92
28#define GPI_05_INT 91
29#define GPI_04_INT 90
30#define GPI_03_INT 89
31#define GPI_02_INT 88
32#define GPI_01_INT 87
33#define GPI_00_INT 86
34#define BT_CLKREQ_INT 85
35#define SPI1_DATIN_INT 84
36#define U5_RX_INT 83
37#define SDIO_INT_N 82
38#define CAM_HS_INT 81
39#define CAM_VS_INT 80
40#define GPI_07_INT 79
41#define DISP_SYNC_INT 78
42#define DSP_INT8 77
43#define U7_HCTS_INT 76
44#define GPI_10_INT 75
45#define GPI_09_INT 74
46#define GPI_08_INT 73
47#define DSP_INT7 72
48#define U2_HCTS_INT 71
49#define SPI2_DATIN_INT 70
50#define GPIO_05_INT 69
51#define GPIO_04_INT 68
52#define GPIO_03_INT 67
53#define GPIO_02_INT 66
54#define GPIO_01_INT 65
55#define GPIO_00_INT 64
56
57/*Manual: table 258, page 198*/
58
59/*SUB1 Interrupt Routing (SIC1)*/
60
61#define SIC1_BASE_INT 32
62
63#define USB_I2C_INT 63
64#define USB_DEV_HP_INT 62
65#define USB_DEV_LP_INT 61
66#define USB_DEV_DMA_INT 60
67#define USB_HOST_INT 59
68#define USB_OTG_ATX_INT_N 58
69#define USB_OTG_TIMER_INT 57
70#define SW_INT 56
71#define SPI1_INT 55
72#define KEY_IRQ 54
73#define DSP_M_INT 53
74#define RTC_INT 52
75#define I2C_1_INT 51
76#define I2C_2_INT 50
77#define PLL1_LOCK_INT 49
78#define PLL2_LOCK_INT 48
79#define PLL3_LOCK_INT 47
80#define PLL4_LOCK_INT 46
81#define PLL5_LOCK_INT 45
82#define SPI2_INT 44
83#define DSP_INT1 43
84#define DSP_INT2 42
85#define DSP_TDM_INT2 41
86#define TS_AUX_INT 40
87#define TS_IRQ 39
88#define TS_P_INT 38
89#define UOUT1_TO_PAD_INT 37
90#define GPI_11_INT 36
91#define DSP_INT4 35
92#define JTAG_COMM_RX_INT 34
93#define JTAG_COMM_TX_INT 33
94#define DSP_INT3 32
95
96/*Manual: table 257, page 197*/
97
98/*MAIN Interrupt Routing*/
99
100#define MAIN_BASE_INT 0
101
102#define SUB2_FIQ_N 31 /*active low */
103#define SUB1_FIQ_N 30 /*active low */
104#define JPEG_INT 29
105#define DMA_INT 28
106#define MSTIMER_INT 27
107#define IIR1_INT 26
108#define IIR2_INT 25
109#define IIR7_INT 24
110#define DSP_TDM_INT0 23
111#define DSP_TDM_INT1 22
112#define DSP_P_INT 21
113#define DSP_INT0 20
114#define DUM_INT 19
115#define UOUT0_TO_PAD_INT 18
116#define MP4_ENC_INT 17
117#define MP4_DEC_INT 16
118#define SD0_INT 15
119#define MBX_INT 14
120#define SD1_INT 13
121#define MS_INT_N 12
122#define FLASH_INT 11 /*NAND*/
123#define IIR6_INT 10
124#define IIR5_INT 9
125#define IIR4_INT 8
126#define IIR3_INT 7
127#define WATCH_INT 6
128#define HSTIMER_INT 5
129#define ARCH_TIMER_IRQ HSTIMER_INT
130#define CAM_INT 4
131#define PRNG_INT 3
132#define CRYPTO_INT 2
133#define SUB2_IRQ_N 1 /*active low */
134#define SUB1_IRQ_N 0 /*active low */
135
136#define PNX4008_IRQ_TYPES \
137{ /*IRQ #'s: */ \
138IRQT_LOW, IRQT_LOW, IRQT_LOW, IRQT_HIGH, /* 0, 1, 2, 3 */ \
139IRQT_LOW, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 4, 5, 6, 7 */ \
140IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 8, 9,10,11 */ \
141IRQT_LOW, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 12,13,14,15 */ \
142IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 16,17,18,19 */ \
143IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 20,21,22,23 */ \
144IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 24,25,26,27 */ \
145IRQT_HIGH, IRQT_HIGH, IRQT_LOW, IRQT_LOW, /* 28,29,30,31 */ \
146IRQT_HIGH, IRQT_LOW, IRQT_HIGH, IRQT_HIGH, /* 32,33,34,35 */ \
147IRQT_HIGH, IRQT_HIGH, IRQT_FALLING, IRQT_HIGH, /* 36,37,38,39 */ \
148IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 40,41,42,43 */ \
149IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 44,45,46,47 */ \
150IRQT_HIGH, IRQT_HIGH, IRQT_LOW, IRQT_LOW, /* 48,49,50,51 */ \
151IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 52,53,54,55 */ \
152IRQT_HIGH, IRQT_HIGH, IRQT_LOW, IRQT_HIGH, /* 56,57,58,59 */ \
153IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 60,61,62,63 */ \
154IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 64,65,66,67 */ \
155IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 68,69,70,71 */ \
156IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 72,73,74,75 */ \
157IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 76,77,78,79 */ \
158IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 80,81,82,83 */ \
159IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 84,85,86,87 */ \
160IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 88,89,90,91 */ \
161IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, IRQT_HIGH, /* 92,93,94,95 */ \
162}
163
164/* Start Enable Pin Interrupts - table 58 page 66 */
165
166#define SE_PIN_BASE_INT 32
167
168#define SE_U7_RX_INT 63
169#define SE_U7_HCTS_INT 62
170#define SE_BT_CLKREQ_INT 61
171#define SE_U6_IRRX_INT 60
172/*59 unused*/
173#define SE_U5_RX_INT 58
174#define SE_GPI_11_INT 57
175#define SE_U3_RX_INT 56
176#define SE_U2_HCTS_INT 55
177#define SE_U2_RX_INT 54
178#define SE_U1_RX_INT 53
179#define SE_DISP_SYNC_INT 52
180/*51 unused*/
181#define SE_SDIO_INT_N 50
182#define SE_MSDIO_START_INT 49
183#define SE_GPI_06_INT 48
184#define SE_GPI_05_INT 47
185#define SE_GPI_04_INT 46
186#define SE_GPI_03_INT 45
187#define SE_GPI_02_INT 44
188#define SE_GPI_01_INT 43
189#define SE_GPI_00_INT 42
190#define SE_SYSCLKEN_PIN_INT 41
191#define SE_SPI1_DATAIN_INT 40
192#define SE_GPI_07_INT 39
193#define SE_SPI2_DATAIN_INT 38
194#define SE_GPI_10_INT 37
195#define SE_GPI_09_INT 36
196#define SE_GPI_08_INT 35
197/*34-32 unused*/
198
199/* Start Enable Internal Interrupts - table 57 page 65 */
200
201#define SE_INT_BASE_INT 0
202
203#define SE_TS_IRQ 31
204#define SE_TS_P_INT 30
205#define SE_TS_AUX_INT 29
206/*27-28 unused*/
207#define SE_USB_AHB_NEED_CLK_INT 26
208#define SE_MSTIMER_INT 25
209#define SE_RTC_INT 24
210#define SE_USB_NEED_CLK_INT 23
211#define SE_USB_INT 22
212#define SE_USB_I2C_INT 21
213#define SE_USB_OTG_TIMER_INT 20
214
215#endif /* __PNX4008_IRQS_h__ */
diff --git a/include/asm-arm/arch-pnx4008/memory.h b/include/asm-arm/arch-pnx4008/memory.h
new file mode 100644
index 000000000000..0d8268a95261
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/memory.h
@@ -0,0 +1,24 @@
1/*
2 * linux/include/asm-arm/arch-pnx4008/memory.h
3 *
4 * Copyright (c) 2005 Philips Semiconductors
5 * Copyright (c) 2005 MontaVista Software, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H
15
16/*
17 * Physical DRAM offset.
18 */
19#define PHYS_OFFSET (0x80000000)
20
21#define __virt_to_bus(x) ((x) - PAGE_OFFSET + PHYS_OFFSET)
22#define __bus_to_virt(x) ((x) + PAGE_OFFSET - PHYS_OFFSET)
23
24#endif
diff --git a/include/asm-arm/arch-pnx4008/param.h b/include/asm-arm/arch-pnx4008/param.h
new file mode 100644
index 000000000000..95d5f547b416
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/param.h
@@ -0,0 +1,21 @@
1/*
2 * linux/include/asm-arm/arch-pnx4008/param.h
3 *
4 * Copyright (C) 1999 ARM Limited
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#define HZ 100
diff --git a/include/asm-arm/arch-pnx4008/platform.h b/include/asm-arm/arch-pnx4008/platform.h
new file mode 100644
index 000000000000..485a3651b4d7
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/platform.h
@@ -0,0 +1,69 @@
1/*
2 * include/asm-arm/arch-pnx4008/platfrom.h
3 *
4 * PNX4008 Base addresses - header file
5 *
6 * Author: Dmitry Chigirev <source@mvista.com>
7 *
8 * Based on reference code received from Philips:
9 * Copyright (C) 2003 Philips Semiconductors
10 *
11 * 2005 (c) MontaVista Software, Inc. This file is licensed under
12 * the terms of the GNU General Public License version 2. This program
13 * is licensed "as is" without any warranty of any kind, whether express
14 * or implied.
15 */
16
17
18#ifndef __ASM_ARCH_PLATFORM_H__
19#define __ASM_ARCH_PLATFORM_H__
20
21#define PNX4008_IRAM_BASE 0x08000000
22#define PNX4008_IRAM_SIZE 0x00010000
23#define PNX4008_YUV_SLAVE_BASE 0x10000000
24#define PNX4008_DUM_SLAVE_BASE 0x18000000
25#define PNX4008_NDF_FLASH_BASE 0x20020000
26#define PNX4008_SPI1_BASE 0x20088000
27#define PNX4008_SPI2_BASE 0x20090000
28#define PNX4008_SD_CONFIG_BASE 0x20098000
29#define PNX4008_FLASH_DATA 0x200B0000
30#define PNX4008_MLC_FLASH_BASE 0x200B8000
31#define PNX4008_JPEG_CONFIG_BASE 0x300A0000
32#define PNX4008_DMA_CONFIG_BASE 0x31000000
33#define PNX4008_USB_CONFIG_BASE 0x31020000
34#define PNX4008_SDRAM_CFG_BASE 0x31080000
35#define PNX4008_AHB2FAB_BASE 0x40000000
36#define PNX4008_PWRMAN_BASE 0x40004000
37#define PNX4008_INTCTRLMIC_BASE 0x40008000
38#define PNX4008_INTCTRLSIC1_BASE 0x4000C000
39#define PNX4008_INTCTRLSIC2_BASE 0x40010000
40#define PNX4008_HSUART1_BASE 0x40014000
41#define PNX4008_HSUART2_BASE 0x40018000
42#define PNX4008_HSUART7_BASE 0x4001C000
43#define PNX4008_RTC_BASE 0x40024000
44#define PNX4008_PIO_BASE 0x40028000
45#define PNX4008_MSTIMER_BASE 0x40034000
46#define PNX4008_HSTIMER_BASE 0x40038000
47#define PNX4008_WDOG_BASE 0x4003C000
48#define PNX4008_DEBUG_BASE 0x40040000
49#define PNX4008_TOUCH1_BASE 0x40048000
50#define PNX4008_KEYSCAN_BASE 0x40050000
51#define PNX4008_UARTCTRL_BASE 0x40054000
52#define PNX4008_PWM_BASE 0x4005C000
53#define PNX4008_UART3_BASE 0x40080000
54#define PNX4008_UART4_BASE 0x40088000
55#define PNX4008_UART5_BASE 0x40090000
56#define PNX4008_UART6_BASE 0x40098000
57#define PNX4008_I2C1_BASE 0x400A0000
58#define PNX4008_I2C2_BASE 0x400A8000
59#define PNX4008_MAGICGATE_BASE 0x400B0000
60#define PNX4008_DUMCONF_BASE 0x400B8000
61#define PNX4008_DUM_MAINCFG_BASE 0x400BC000
62#define PNX4008_DSP_BASE 0x400C0000
63#define PNX4008_PROFCOUNTER_BASE 0x400C8000
64#define PNX4008_CRYPTO_BASE 0x400D0000
65#define PNX4008_CAMIFCONF_BASE 0x400D8000
66#define PNX4008_YUV2RGB_BASE 0x400E0000
67#define PNX4008_AUDIOCONFIG_BASE 0x400E8000
68
69#endif
diff --git a/include/asm-arm/arch-pnx4008/pm.h b/include/asm-arm/arch-pnx4008/pm.h
new file mode 100644
index 000000000000..bac1634cb3e0
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/pm.h
@@ -0,0 +1,33 @@
1/*
2 * include/asm-arm/arch-pnx4008/pm.h
3 *
4 * PNX4008 Power Management Routiness - header file
5 *
6 * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#ifndef __ASM_ARCH_PNX4008_PM_H
15#define __ASM_ARCH_PNX4008_PM_H
16
17#ifndef __ASSEMBLER__
18#include "irq.h"
19#include "irqs.h"
20#include "clock.h"
21
22extern void pnx4008_pm_idle(void);
23extern void pnx4008_pm_suspend(void);
24extern unsigned int pnx4008_cpu_suspend_sz;
25extern void pnx4008_cpu_suspend(void);
26extern unsigned int pnx4008_cpu_standby_sz;
27extern void pnx4008_cpu_standby(void);
28
29extern int pnx4008_startup_pll(struct clk *);
30extern int pnx4008_shutdown_pll(struct clk *);
31
32#endif /* ASSEMBLER */
33#endif /* __ASM_ARCH_PNX4008_PM_H */
diff --git a/include/asm-arm/arch-pnx4008/system.h b/include/asm-arm/arch-pnx4008/system.h
new file mode 100644
index 000000000000..6e3da70ab107
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/system.h
@@ -0,0 +1,38 @@
1/*
2 * linux/include/asm-arm/arch-pnx4008/system.h
3 *
4 * Copyright (C) 2003 Philips Semiconductors
5 * Copyright (C) 2005 MontaVista Software, Inc.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef __ASM_ARCH_SYSTEM_H
22#define __ASM_ARCH_SYSTEM_H
23
24#include <asm/hardware.h>
25#include <asm/io.h>
26#include <asm/arch/platform.h>
27
28static void arch_idle(void)
29{
30 cpu_do_idle();
31}
32
33static inline void arch_reset(char mode)
34{
35 cpu_reset(0);
36}
37
38#endif
diff --git a/include/asm-arm/arch-pnx4008/timex.h b/include/asm-arm/arch-pnx4008/timex.h
new file mode 100644
index 000000000000..ee470a39089a
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/timex.h
@@ -0,0 +1,73 @@
1/*
2 * include/asm-arm/arch-pnx4008/timex.h
3 *
4 * PNX4008 timers header file
5 *
6 * Author: Dmitry Chigirev <source@mvista.com>
7 *
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13
14#ifndef __PNX4008_TIMEX_H
15#define __PNX4008_TIMEX_H
16
17#include <asm/hardware.h>
18#include <asm/io.h>
19
20#define CLOCK_TICK_RATE 1000000
21
22#define TICKS2USECS(x) (x)
23
24/* MilliSecond Timer - Chapter 21 Page 202 */
25
26#define MSTIM_INT IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x0))
27#define MSTIM_CTRL IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x4))
28#define MSTIM_COUNTER IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x8))
29#define MSTIM_MCTRL IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x14))
30#define MSTIM_MATCH0 IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x18))
31#define MSTIM_MATCH1 IO_ADDRESS((PNX4008_MSTIMER_BASE + 0x1c))
32
33/* High Speed Timer - Chpater 22, Page 205 */
34
35#define HSTIM_INT IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x0))
36#define HSTIM_CTRL IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x4))
37#define HSTIM_COUNTER IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x8))
38#define HSTIM_PMATCH IO_ADDRESS((PNX4008_HSTIMER_BASE + 0xC))
39#define HSTIM_PCOUNT IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x10))
40#define HSTIM_MCTRL IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x14))
41#define HSTIM_MATCH0 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x18))
42#define HSTIM_MATCH1 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x1c))
43#define HSTIM_MATCH2 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x20))
44#define HSTIM_CCR IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x28))
45#define HSTIM_CR0 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x2C))
46#define HSTIM_CR1 IO_ADDRESS((PNX4008_HSTIMER_BASE + 0x30))
47
48/* IMPORTANT: both timers are UPCOUNTING */
49
50/* xSTIM_MCTRL bit definitions */
51#define MR0_INT 1
52#define RESET_COUNT0 (1<<1)
53#define STOP_COUNT0 (1<<2)
54#define MR1_INT (1<<3)
55#define RESET_COUNT1 (1<<4)
56#define STOP_COUNT1 (1<<5)
57#define MR2_INT (1<<6)
58#define RESET_COUNT2 (1<<7)
59#define STOP_COUNT2 (1<<8)
60
61/* xSTIM_CTRL bit definitions */
62#define COUNT_ENAB 1
63#define RESET_COUNT (1<<1)
64#define DEBUG_EN (1<<2)
65
66/* xSTIM_INT bit definitions */
67#define MATCH0_INT 1
68#define MATCH1_INT (1<<1)
69#define MATCH2_INT (1<<2)
70#define RTC_TICK0 (1<<4)
71#define RTC_TICK1 (1<<5)
72
73#endif
diff --git a/include/asm-arm/arch-pnx4008/uncompress.h b/include/asm-arm/arch-pnx4008/uncompress.h
new file mode 100644
index 000000000000..8fa4d24b72b4
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/uncompress.h
@@ -0,0 +1,46 @@
1/*
2 * linux/include/asm-arm/arch-pnx4008/uncompress.h
3 *
4 * Copyright (C) 1999 ARM Limited
5 * Copyright (C) 2006 MontaVista Software, Inc.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#define UART5_BASE 0x40090000
23
24#define UART5_DR (*(volatile unsigned char *) (UART5_BASE))
25#define UART5_FR (*(volatile unsigned char *) (UART5_BASE + 18))
26
27static __inline__ void putc(char c)
28{
29 while (UART5_FR & (1 << 5))
30 barrier();
31
32 UART5_DR = c;
33}
34
35/*
36 * This does not append a newline
37 */
38static inline void flush(void)
39{
40}
41
42/*
43 * nothing to do
44 */
45#define arch_decomp_setup()
46#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-pnx4008/vmalloc.h b/include/asm-arm/arch-pnx4008/vmalloc.h
new file mode 100644
index 000000000000..140d925f6f37
--- /dev/null
+++ b/include/asm-arm/arch-pnx4008/vmalloc.h
@@ -0,0 +1,20 @@
1/*
2 * include/asm-arm/arch-pnx4008/vmalloc.h
3 *
4 * Author: Vitaly Wool <source@mvista.com>
5 *
6 * 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/*
13 * Just any arbitrary offset to the start of the vmalloc VM area: the
14 * current 8MB value just means that there will be a 8MB "hole" after the
15 * physical memory until the kernel virtual memory starts. That means that
16 * any out-of-bounds memory accesses will hopefully be caught.
17 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
18 * area for the same reason. ;)
19 */
20#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/arch-pxa/idp.h b/include/asm-arm/arch-pxa/idp.h
index e7ef497417bb..b6952534a4e1 100644
--- a/include/asm-arm/arch-pxa/idp.h
+++ b/include/asm-arm/arch-pxa/idp.h
@@ -15,7 +15,6 @@
15 * Changes for 2.6 kernel. 15 * Changes for 2.6 kernel.
16 */ 16 */
17 17
18#include <linux/config.h>
19 18
20/* 19/*
21 * Note: this file must be safe to include in assembly files 20 * Note: this file must be safe to include in assembly files
diff --git a/include/asm-arm/arch-pxa/io.h b/include/asm-arm/arch-pxa/io.h
index eb2dd58d397f..7f8d817b446f 100644
--- a/include/asm-arm/arch-pxa/io.h
+++ b/include/asm-arm/arch-pxa/io.h
@@ -16,6 +16,5 @@
16 */ 16 */
17#define __io(a) ((void __iomem *)(a)) 17#define __io(a) ((void __iomem *)(a))
18#define __mem_pci(a) (a) 18#define __mem_pci(a) (a)
19#define __mem_isa(a) (a)
20 19
21#endif 20#endif
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h
index 67af238a8f8e..f3bc70eee35b 100644
--- a/include/asm-arm/arch-pxa/irqs.h
+++ b/include/asm-arm/arch-pxa/irqs.h
@@ -10,7 +10,6 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12
13#include <linux/config.h>
14 13
15#ifdef CONFIG_PXA27x 14#ifdef CONFIG_PXA27x
16#define PXA_IRQ_SKIP 0 15#define PXA_IRQ_SKIP 0
diff --git a/include/asm-arm/arch-pxa/poodle.h b/include/asm-arm/arch-pxa/poodle.h
index 6b5ac5144e70..4d6a40315764 100644
--- a/include/asm-arm/arch-pxa/poodle.h
+++ b/include/asm-arm/arch-pxa/poodle.h
@@ -31,6 +31,7 @@
31#define POODLE_GPIO_CF_CD (14) 31#define POODLE_GPIO_CF_CD (14)
32#define POODLE_GPIO_CF_STSCHG (14) 32#define POODLE_GPIO_CF_STSCHG (14)
33#define POODLE_GPIO_SD_PWR (33) 33#define POODLE_GPIO_SD_PWR (33)
34#define POODLE_GPIO_SD_PWR1 (3)
34#define POODLE_GPIO_nSD_CLK (6) 35#define POODLE_GPIO_nSD_CLK (6)
35#define POODLE_GPIO_nSD_WP (7) 36#define POODLE_GPIO_nSD_WP (7)
36#define POODLE_GPIO_nSD_INT (8) 37#define POODLE_GPIO_nSD_INT (8)
@@ -42,6 +43,7 @@
42#define POODLE_GPIO_BYPASS_ON (36) 43#define POODLE_GPIO_BYPASS_ON (36)
43#define POODLE_GPIO_CHRG_ON (38) 44#define POODLE_GPIO_CHRG_ON (38)
44#define POODLE_GPIO_CHRG_FULL (16) 45#define POODLE_GPIO_CHRG_FULL (16)
46#define POODLE_GPIO_DISCHARGE_ON (42) /* Enable battery discharge */
45 47
46/* PXA GPIOs */ 48/* PXA GPIOs */
47#define POODLE_IRQ_GPIO_ON_KEY IRQ_GPIO(0) 49#define POODLE_IRQ_GPIO_ON_KEY IRQ_GPIO(0)
@@ -68,4 +70,6 @@
68#define POODLE_SCOOP_IO_DIR ( POODLE_SCOOP_VPEN | POODLE_SCOOP_HS_OUT ) 70#define POODLE_SCOOP_IO_DIR ( POODLE_SCOOP_VPEN | POODLE_SCOOP_HS_OUT )
69#define POODLE_SCOOP_IO_OUT ( 0 ) 71#define POODLE_SCOOP_IO_OUT ( 0 )
70 72
73extern struct platform_device poodle_locomo_device;
74
71#endif /* __ASM_ARCH_POODLE_H */ 75#endif /* __ASM_ARCH_POODLE_H */
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index c8f53a71c076..9f83f4adfbf3 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -13,7 +13,6 @@
13#ifndef __PXA_REGS_H 13#ifndef __PXA_REGS_H
14#define __PXA_REGS_H 14#define __PXA_REGS_H
15 15
16#include <linux/config.h>
17 16
18/* 17/*
19 * PXA Chip selects 18 * PXA Chip selects
@@ -1626,7 +1625,7 @@
1626#define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */ 1625#define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */
1627#define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */ 1626#define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */
1628#define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */ 1627#define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */
1629#define SSCR0_SlotsPerFrm(c) ((x) - 1) /* Time slots per frame [1..8] */ 1628#define SSCR0_SlotsPerFrm(x) ((x) - 1) /* Time slots per frame [1..8] */
1630#define SSCR0_ADC (1 << 30) /* Audio clock select */ 1629#define SSCR0_ADC (1 << 30) /* Audio clock select */
1631#define SSCR0_MOD (1 << 31) /* Mode (normal or network) */ 1630#define SSCR0_MOD (1 << 31) /* Mode (normal or network) */
1632#endif 1631#endif
@@ -1707,6 +1706,10 @@
1707#if defined (CONFIG_PXA27x) 1706#if defined (CONFIG_PXA27x)
1708#define SSTO_P1 __REG(0x41000028) /* SSP Port 1 Time Out Register */ 1707#define SSTO_P1 __REG(0x41000028) /* SSP Port 1 Time Out Register */
1709#define SSPSP_P1 __REG(0x4100002C) /* SSP Port 1 Programmable Serial Protocol */ 1708#define SSPSP_P1 __REG(0x4100002C) /* SSP Port 1 Programmable Serial Protocol */
1709#define SSTSA_P1 __REG(0x41000030) /* SSP Port 1 Tx Timeslot Active */
1710#define SSRSA_P1 __REG(0x41000034) /* SSP Port 1 Rx Timeslot Active */
1711#define SSTSS_P1 __REG(0x41000038) /* SSP Port 1 Timeslot Status */
1712#define SSACD_P1 __REG(0x4100003C) /* SSP Port 1 Audio Clock Divider */
1710#define SSCR0_P2 __REG(0x41700000) /* SSP Port 2 Control Register 0 */ 1713#define SSCR0_P2 __REG(0x41700000) /* SSP Port 2 Control Register 0 */
1711#define SSCR1_P2 __REG(0x41700004) /* SSP Port 2 Control Register 1 */ 1714#define SSCR1_P2 __REG(0x41700004) /* SSP Port 2 Control Register 1 */
1712#define SSSR_P2 __REG(0x41700008) /* SSP Port 2 Status Register */ 1715#define SSSR_P2 __REG(0x41700008) /* SSP Port 2 Status Register */
@@ -1714,6 +1717,10 @@
1714#define SSDR_P2 __REG(0x41700010) /* (Write / Read) SSP Port 2 Data Write Register/SSP Data Read Register */ 1717#define SSDR_P2 __REG(0x41700010) /* (Write / Read) SSP Port 2 Data Write Register/SSP Data Read Register */
1715#define SSTO_P2 __REG(0x41700028) /* SSP Port 2 Time Out Register */ 1718#define SSTO_P2 __REG(0x41700028) /* SSP Port 2 Time Out Register */
1716#define SSPSP_P2 __REG(0x4170002C) /* SSP Port 2 Programmable Serial Protocol */ 1719#define SSPSP_P2 __REG(0x4170002C) /* SSP Port 2 Programmable Serial Protocol */
1720#define SSTSA_P2 __REG(0x41700030) /* SSP Port 2 Tx Timeslot Active */
1721#define SSRSA_P2 __REG(0x41700034) /* SSP Port 2 Rx Timeslot Active */
1722#define SSTSS_P2 __REG(0x41700038) /* SSP Port 2 Timeslot Status */
1723#define SSACD_P2 __REG(0x4170003C) /* SSP Port 2 Audio Clock Divider */
1717#define SSCR0_P3 __REG(0x41900000) /* SSP Port 3 Control Register 0 */ 1724#define SSCR0_P3 __REG(0x41900000) /* SSP Port 3 Control Register 0 */
1718#define SSCR1_P3 __REG(0x41900004) /* SSP Port 3 Control Register 1 */ 1725#define SSCR1_P3 __REG(0x41900004) /* SSP Port 3 Control Register 1 */
1719#define SSSR_P3 __REG(0x41900008) /* SSP Port 3 Status Register */ 1726#define SSSR_P3 __REG(0x41900008) /* SSP Port 3 Status Register */
@@ -1721,6 +1728,10 @@
1721#define SSDR_P3 __REG(0x41900010) /* (Write / Read) SSP Port 3 Data Write Register/SSP Data Read Register */ 1728#define SSDR_P3 __REG(0x41900010) /* (Write / Read) SSP Port 3 Data Write Register/SSP Data Read Register */
1722#define SSTO_P3 __REG(0x41900028) /* SSP Port 3 Time Out Register */ 1729#define SSTO_P3 __REG(0x41900028) /* SSP Port 3 Time Out Register */
1723#define SSPSP_P3 __REG(0x4190002C) /* SSP Port 3 Programmable Serial Protocol */ 1730#define SSPSP_P3 __REG(0x4190002C) /* SSP Port 3 Programmable Serial Protocol */
1731#define SSTSA_P3 __REG(0x41900030) /* SSP Port 3 Tx Timeslot Active */
1732#define SSRSA_P3 __REG(0x41900034) /* SSP Port 3 Rx Timeslot Active */
1733#define SSTSS_P3 __REG(0x41900038) /* SSP Port 3 Timeslot Status */
1734#define SSACD_P3 __REG(0x4190003C) /* SSP Port 3 Audio Clock Divider */
1724#else /* PXA255 (only port 2) and PXA26x ports*/ 1735#else /* PXA255 (only port 2) and PXA26x ports*/
1725#define SSTO_P1 __REG(0x41000028) /* SSP Port 1 Time Out Register */ 1736#define SSTO_P1 __REG(0x41000028) /* SSP Port 1 Time Out Register */
1726#define SSPSP_P1 __REG(0x4100002C) /* SSP Port 1 Programmable Serial Protocol */ 1737#define SSPSP_P1 __REG(0x4100002C) /* SSP Port 1 Programmable Serial Protocol */
@@ -1747,6 +1758,10 @@
1747#define SSDR_P(x) (*(((x) == 1) ? &SSDR_P1 : ((x) == 2) ? &SSDR_P2 : ((x) == 3) ? &SSDR_P3 : NULL)) 1758#define SSDR_P(x) (*(((x) == 1) ? &SSDR_P1 : ((x) == 2) ? &SSDR_P2 : ((x) == 3) ? &SSDR_P3 : NULL))
1748#define SSTO_P(x) (*(((x) == 1) ? &SSTO_P1 : ((x) == 2) ? &SSTO_P2 : ((x) == 3) ? &SSTO_P3 : NULL)) 1759#define SSTO_P(x) (*(((x) == 1) ? &SSTO_P1 : ((x) == 2) ? &SSTO_P2 : ((x) == 3) ? &SSTO_P3 : NULL))
1749#define SSPSP_P(x) (*(((x) == 1) ? &SSPSP_P1 : ((x) == 2) ? &SSPSP_P2 : ((x) == 3) ? &SSPSP_P3 : NULL)) 1760#define SSPSP_P(x) (*(((x) == 1) ? &SSPSP_P1 : ((x) == 2) ? &SSPSP_P2 : ((x) == 3) ? &SSPSP_P3 : NULL))
1761#define SSTSA_P(x) (*(((x) == 1) ? &SSTSA_P1 : ((x) == 2) ? &SSTSA_P2 : ((x) == 3) ? &SSTSA_P3 : NULL))
1762#define SSRSA_P(x) (*(((x) == 1) ? &SSRSA_P1 : ((x) == 2) ? &SSRSA_P2 : ((x) == 3) ? &SSRSA_P3 : NULL))
1763#define SSTSS_P(x) (*(((x) == 1) ? &SSTSS_P1 : ((x) == 2) ? &SSTSS_P2 : ((x) == 3) ? &SSTSS_P3 : NULL))
1764#define SSACD_P(x) (*(((x) == 1) ? &SSACD_P1 : ((x) == 2) ? &SSACD_P2 : ((x) == 3) ? &SSACD_P3 : NULL))
1750 1765
1751/* 1766/*
1752 * MultiMediaCard (MMC) controller 1767 * MultiMediaCard (MMC) controller
diff --git a/include/asm-arm/arch-pxa/system.h b/include/asm-arm/arch-pxa/system.h
index 840a46bfbc54..1d56a3ef89fd 100644
--- a/include/asm-arm/arch-pxa/system.h
+++ b/include/asm-arm/arch-pxa/system.h
@@ -10,6 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12
13#include <asm/proc-fns.h>
13#include "hardware.h" 14#include "hardware.h"
14#include "pxa-regs.h" 15#include "pxa-regs.h"
15 16
diff --git a/include/asm-arm/arch-pxa/timex.h b/include/asm-arm/arch-pxa/timex.h
index aa125ec56a32..2473bb51d0a6 100644
--- a/include/asm-arm/arch-pxa/timex.h
+++ b/include/asm-arm/arch-pxa/timex.h
@@ -10,7 +10,6 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12
13#include <linux/config.h>
14 13
15#if defined(CONFIG_PXA25x) 14#if defined(CONFIG_PXA25x)
16/* PXA250/210 timer base */ 15/* PXA250/210 timer base */
diff --git a/include/asm-arm/arch-realview/io.h b/include/asm-arm/arch-realview/io.h
index d444a68ac330..c70f1dfbe135 100644
--- a/include/asm-arm/arch-realview/io.h
+++ b/include/asm-arm/arch-realview/io.h
@@ -29,6 +29,5 @@ static inline void __iomem *__io(unsigned long addr)
29 29
30#define __io(a) __io(a) 30#define __io(a) __io(a)
31#define __mem_pci(a) (a) 31#define __mem_pci(a) (a)
32#define __mem_isa(a) (a)
33 32
34#endif 33#endif
diff --git a/include/asm-arm/arch-realview/smp.h b/include/asm-arm/arch-realview/smp.h
index fc87783e8e8b..515819efd046 100644
--- a/include/asm-arm/arch-realview/smp.h
+++ b/include/asm-arm/arch-realview/smp.h
@@ -1,7 +1,6 @@
1#ifndef ASMARM_ARCH_SMP_H 1#ifndef ASMARM_ARCH_SMP_H
2#define ASMARM_ARCH_SMP_H 2#define ASMARM_ARCH_SMP_H
3 3
4#include <linux/config.h>
5 4
6#include <asm/hardware/gic.h> 5#include <asm/hardware/gic.h>
7 6
diff --git a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S
index 5f8223e700d3..b7d15d125458 100644
--- a/include/asm-arm/arch-s3c2410/debug-macro.S
+++ b/include/asm-arm/arch-s3c2410/debug-macro.S
@@ -33,7 +33,7 @@
33 .endm 33 .endm
34 34
35 .macro senduart,rd,rx 35 .macro senduart,rd,rx
36 str \rd, [\rx, # S3C2410_UTXH ] 36 strb \rd, [\rx, # S3C2410_UTXH ]
37 .endm 37 .endm
38 38
39 .macro busyuart, rd, rx 39 .macro busyuart, rd, rx
@@ -42,6 +42,12 @@
42 beq 1001f @ 42 beq 1001f @
43 @ FIFO enabled... 43 @ FIFO enabled...
441003: 441003:
45 @ check for arm920 vs arm926. currently assume all arm926
46 @ devices have an 64 byte FIFO identical to the s3c2440
47 mrc p15, 0, \rd, c0, c0
48 and \rd, \rd, #0xff0
49 teq \rd, #0x260
50 beq 1004f
45 mrc p15, 0, \rd, c1, c0 51 mrc p15, 0, \rd, c1, c0
46 tst \rd, #1 52 tst \rd, #1
47 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) 53 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
@@ -50,7 +56,7 @@
50 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] 56 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ]
51 and \rd, \rd, #0x00ff0000 57 and \rd, \rd, #0x00ff0000
52 teq \rd, #0x00440000 @ is it 2440? 58 teq \rd, #0x00440000 @ is it 2440?
53 591004:
54 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 60 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
55 moveq \rd, \rd, lsr #SHIFT_2440TXF 61 moveq \rd, \rd, lsr #SHIFT_2440TXF
56 tst \rd, #S3C2410_UFSTAT_TXFULL 62 tst \rd, #S3C2410_UFSTAT_TXFULL
diff --git a/include/asm-arm/arch-s3c2410/dma.h b/include/asm-arm/arch-s3c2410/dma.h
index b011e14f3bc6..72964f9b8414 100644
--- a/include/asm-arm/arch-s3c2410/dma.h
+++ b/include/asm-arm/arch-s3c2410/dma.h
@@ -18,7 +18,6 @@
18#ifndef __ASM_ARCH_DMA_H 18#ifndef __ASM_ARCH_DMA_H
19#define __ASM_ARCH_DMA_H __FILE__ 19#define __ASM_ARCH_DMA_H __FILE__
20 20
21#include <linux/config.h>
22#include <linux/sysdev.h> 21#include <linux/sysdev.h>
23#include "hardware.h" 22#include "hardware.h"
24 23
diff --git a/include/asm-arm/arch-s3c2410/entry-macro.S b/include/asm-arm/arch-s3c2410/entry-macro.S
index 894c35cf3b1e..e09a6b8ec153 100644
--- a/include/asm-arm/arch-s3c2410/entry-macro.S
+++ b/include/asm-arm/arch-s3c2410/entry-macro.S
@@ -18,8 +18,6 @@
18 18
19#define INTPND (0x10) 19#define INTPND (0x10)
20#define INTOFFSET (0x14) 20#define INTOFFSET (0x14)
21#define EXTINTPEND (0xa8)
22#define EXTINTMASK (0xa4)
23 21
24#include <asm/hardware.h> 22#include <asm/hardware.h>
25#include <asm/arch/irqs.h> 23#include <asm/arch/irqs.h>
@@ -28,37 +26,23 @@
28 26
29 mov \base, #S3C24XX_VA_IRQ 27 mov \base, #S3C24XX_VA_IRQ
30 28
31 ldr \irqstat, [ \base, #INTPND]
32 bics \irqnr, \irqstat, #3<<4 @@ only an GPIO IRQ
33 beq 2000f
34
35 @@ try the interrupt offset register, since it is there 29 @@ try the interrupt offset register, since it is there
36 30
31 ldr \irqstat, [ \base, #INTPND ]
32 teq \irqstat, #0
33 beq 1002f
37 ldr \irqnr, [ \base, #INTOFFSET ] 34 ldr \irqnr, [ \base, #INTOFFSET ]
38 mov \tmp, #1 35 mov \tmp, #1
39 tst \irqstat, \tmp, lsl \irqnr 36 tst \irqstat, \tmp, lsl \irqnr
40 addne \irqnr, \irqnr, #IRQ_EINT0
41 bne 1001f 37 bne 1001f
42 38
43 @@ the number specified is not a valid irq, so try 39 @@ the number specified is not a valid irq, so try
44 @@ and work it out for ourselves 40 @@ and work it out for ourselves
45 41
46 mov \irqnr, #IRQ_EINT0 @@ start here 42 mov \irqnr, #0 @@ start here
47 b 3000f
48
492000:
50 @@ load the GPIO interrupt register, and check it
51
52 add \tmp, \base, #S3C24XX_VA_GPIO - S3C24XX_VA_IRQ
53 ldr \irqstat, [ \tmp, # EXTINTPEND ]
54 ldr \irqnr, [ \tmp, # EXTINTMASK ]
55 bics \irqstat, \irqstat, \irqnr
56 beq 1001f
57
58 mov \irqnr, #(IRQ_EINT4 - 4)
59 43
60 @@ work out which irq (if any) we got 44 @@ work out which irq (if any) we got
613000: 45
62 movs \tmp, \irqstat, lsl#16 46 movs \tmp, \irqstat, lsl#16
63 addeq \irqnr, \irqnr, #16 47 addeq \irqnr, \irqnr, #16
64 moveq \irqstat, \irqstat, lsr#16 48 moveq \irqstat, \irqstat, lsr#16
@@ -75,9 +59,9 @@
75 addeq \irqnr, \irqnr, #1 59 addeq \irqnr, \irqnr, #1
76 60
77 @@ we have the value 61 @@ we have the value
78 movs \irqnr, \irqnr
79
801001: 621001:
63 adds \irqnr, \irqnr, #IRQ_EINT0
641002:
81 @@ exit here, Z flag unset if IRQ 65 @@ exit here, Z flag unset if IRQ
82 66
83 .endm 67 .endm
diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h
index c380d264a847..fae2766ff32b 100644
--- a/include/asm-arm/arch-s3c2410/map.h
+++ b/include/asm-arm/arch-s3c2410/map.h
@@ -126,9 +126,18 @@
126#define S3C24XX_SZ_IIS SZ_1M 126#define S3C24XX_SZ_IIS SZ_1M
127 127
128/* GPIO ports */ 128/* GPIO ports */
129#define S3C24XX_VA_GPIO S3C2410_ADDR(0x00E00000) 129
130/* the calculation for the VA of this must ensure that
131 * it is the same distance apart from the UART in the
132 * phsyical address space, as the initial mapping for the IO
133 * is done as a 1:1 maping. This puts it (currently) at
134 * 0xF6800000, which is not in the way of any current mapping
135 * by the base system.
136*/
137
130#define S3C2400_PA_GPIO (0x15600000) 138#define S3C2400_PA_GPIO (0x15600000)
131#define S3C2410_PA_GPIO (0x56000000) 139#define S3C2410_PA_GPIO (0x56000000)
140#define S3C24XX_VA_GPIO ((S3C2410_PA_GPIO - S3C24XX_PA_UART) + S3C24XX_VA_UART)
132#define S3C24XX_SZ_GPIO SZ_1M 141#define S3C24XX_SZ_GPIO SZ_1M
133 142
134/* RTC */ 143/* RTC */
@@ -227,4 +236,20 @@
227#define S3C24XX_PA_SPI S3C2410_PA_SPI 236#define S3C24XX_PA_SPI S3C2410_PA_SPI
228#endif 237#endif
229 238
239/* deal with the registers that move under the 2412/2413 */
240
241#if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413)
242#ifndef __ASSEMBLY__
243extern void __iomem *s3c24xx_va_gpio2;
244#endif
245#ifdef CONFIG_CPU_S3C2412_ONLY
246#define S3C24XX_VA_GPIO2 (S3C24XX_VA_GPIO + 0x10)
247#else
248#define S3C24XX_VA_GPIO2 s3c24xx_va_gpio2
249#endif
250#else
251#define s3c24xx_va_gpio2 S3C24XX_VA_GPIO
252#define S3C24XX_VA_GPIO2 S3C24XX_VA_GPIO
253#endif
254
230#endif /* __ASM_ARCH_MAP_H */ 255#endif /* __ASM_ARCH_MAP_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-clock.h b/include/asm-arm/arch-s3c2410/regs-clock.h
index 34360706e016..a7c61feb8433 100644
--- a/include/asm-arm/arch-s3c2410/regs-clock.h
+++ b/include/asm-arm/arch-s3c2410/regs-clock.h
@@ -1,6 +1,6 @@
1/* linux/include/asm/arch-s3c2410/regs-clock.h 1/* linux/include/asm/arch-s3c2410/regs-clock.h
2 * 2 *
3 * Copyright (c) 2003,2004,2005 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003,2004,2005,2006 Simtec Electronics <linux@simtec.co.uk>
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
@@ -114,7 +114,7 @@ s3c2410_get_pll(unsigned int pllval, unsigned int baseclk)
114 114
115#endif /* __ASSEMBLY__ */ 115#endif /* __ASSEMBLY__ */
116 116
117#ifdef CONFIG_CPU_S3C2440 117#if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2442)
118 118
119/* extra registers */ 119/* extra registers */
120#define S3C2440_CAMDIVN S3C2410_CLKREG(0x18) 120#define S3C2440_CAMDIVN S3C2410_CLKREG(0x18)
@@ -136,7 +136,70 @@ s3c2410_get_pll(unsigned int pllval, unsigned int baseclk)
136#define S3C2440_CAMDIVN_HCLK4_HALF (1<<9) 136#define S3C2440_CAMDIVN_HCLK4_HALF (1<<9)
137#define S3C2440_CAMDIVN_DVSEN (1<<12) 137#define S3C2440_CAMDIVN_DVSEN (1<<12)
138 138
139#endif /* CONFIG_CPU_S3C2440 */ 139#define S3C2442_CAMDIVN_CAMCLK_DIV3 (1<<5)
140 140
141#endif /* CONFIG_CPU_S3C2440 or CONFIG_CPU_S3C2442 */
142
143#if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413)
144
145#define S3C2412_OSCSET S3C2410_CLKREG(0x18)
146#define S3C2412_CLKSRC S3C2410_CLKREG(0x1C)
147
148#define S3C2412_PLLCON_OFF (1<<20)
149
150#define S3C2412_CLKDIVN_PDIVN (1<<2)
151#define S3C2412_CLKDIVN_HDIVN_MASK (3<<0)
152#define S3C2421_CLKDIVN_ARMDIVN (1<<3)
153#define S3C2412_CLKDIVN_USB48DIV (1<<6)
154#define S3C2412_CLKDIVN_UARTDIV_MASK (15<<8)
155#define S3C2412_CLKDIVN_UARTDIV_SHIFT (8)
156#define S3C2412_CLKDIVN_I2SDIV_MASK (15<<12)
157#define S3C2412_CLKDIVN_I2SDIV_SHIFT (12)
158#define S3C2412_CLKDIVN_CAMDIV_MASK (15<<16)
159#define S3C2412_CLKDIVN_CAMDIV_SHIFT (16)
160
161#define S3C2412_CLKCON_WDT (1<<28)
162#define S3C2412_CLKCON_SPI (1<<27)
163#define S3C2412_CLKCON_IIS (1<<26)
164#define S3C2412_CLKCON_IIC (1<<25)
165#define S3C2412_CLKCON_ADC (1<<24)
166#define S3C2412_CLKCON_RTC (1<<23)
167#define S3C2412_CLKCON_GPIO (1<<22)
168#define S3C2412_CLKCON_UART2 (1<<21)
169#define S3C2412_CLKCON_UART1 (1<<20)
170#define S3C2412_CLKCON_UART0 (1<<19)
171#define S3C2412_CLKCON_SDI (1<<18)
172#define S3C2412_CLKCON_PWMT (1<<17)
173#define S3C2412_CLKCON_USBD (1<<16)
174#define S3C2412_CLKCON_CAMCLK (1<<15)
175#define S3C2412_CLKCON_UARTCLK (1<<14)
176/* missing 13 */
177#define S3C2412_CLKCON_USB_HOST48 (1<<12)
178#define S3C2412_CLKCON_USB_DEV48 (1<<11)
179#define S3C2412_CLKCON_HCLKdiv2 (1<<10)
180#define S3C2412_CLKCON_HCLKx2 (1<<9)
181#define S3C2412_CLKCON_SDRAM (1<<8)
182/* missing 7 */
183#define S3C2412_CLKCON_USBH S3C2410_CLKCON_USBH
184#define S3C2412_CLKCON_LCDC S3C2410_CLKCON_LCDC
185#define S3C2412_CLKCON_NAND S3C2410_CLKCON_NAND
186#define S3C2412_CLKCON_DMA3 (1<<3)
187#define S3C2412_CLKCON_DMA2 (1<<2)
188#define S3C2412_CLKCON_DMA1 (1<<1)
189#define S3C2412_CLKCON_DMA0 (1<<0)
190
191/* clock sourec controls */
192
193#define S3C2412_CLKSRC_EXTCLKDIV_MASK (7 << 0)
194#define S3C2412_CLKSRC_EXTCLKDIV_SHIFT (0)
195#define S3C2412_CLKSRC_MDIVCLK_EXTCLKDIV (1<<3)
196#define S3C2412_CLKSRC_MSYSCLK_MPLL (1<<4)
197#define S3C2412_CLKSRC_USYSCLK_UPLL (1<<5)
198#define S3C2412_CLKSRC_UARTCLK_MPLL (1<<8)
199#define S3C2412_CLKSRC_I2SCLK_MPLL (1<<9)
200#define S3C2412_CLKSRC_USBCLK_HCLK (1<<10)
201#define S3C2412_CLKSRC_CAMCLK_HCLK (1<<11)
202
203#endif /* CONFIG_CPU_S3C2412 | CONFIG_CPU_S3C2413 */
141 204
142#endif /* __ASM_ARM_REGS_CLOCK */ 205#endif /* __ASM_ARM_REGS_CLOCK */
diff --git a/include/asm-arm/arch-s3c2410/regs-dsc.h b/include/asm-arm/arch-s3c2410/regs-dsc.h
index a023b0434efe..84aca61cbaa3 100644
--- a/include/asm-arm/arch-s3c2410/regs-dsc.h
+++ b/include/asm-arm/arch-s3c2410/regs-dsc.h
@@ -23,6 +23,9 @@
23#define S3C2440_DSC0 S3C2410_GPIOREG(0xc4) 23#define S3C2440_DSC0 S3C2410_GPIOREG(0xc4)
24#define S3C2440_DSC1 S3C2410_GPIOREG(0xc8) 24#define S3C2440_DSC1 S3C2410_GPIOREG(0xc8)
25 25
26#define S3C2412_DSC0 S3C2410_GPIOREG(0xdc)
27#define S3C2412_DSC1 S3C2410_GPIOREG(0xe0)
28
26#define S3C2440_SELECT_DSC0 (0) 29#define S3C2440_SELECT_DSC0 (0)
27#define S3C2440_SELECT_DSC1 (1<<31) 30#define S3C2440_SELECT_DSC1 (1<<31)
28 31
@@ -170,7 +173,7 @@
170#define S3C2440_DSC1_CS1_4mA (3<<2) 173#define S3C2440_DSC1_CS1_4mA (3<<2)
171#define S3C2440_DSC1_CS1_MASK (3<<2) 174#define S3C2440_DSC1_CS1_MASK (3<<2)
172 175
173#define S3C2440_DSC1_CS0 (S3C2440_SELECT_DSC1 | 0 176#define S3C2440_DSC1_CS0 (S3C2440_SELECT_DSC1 | 0)
174#define S3C2440_DSC1_CS0_10mA (0<<0) 177#define S3C2440_DSC1_CS0_10mA (0<<0)
175#define S3C2440_DSC1_CS0_8mA (1<<0) 178#define S3C2440_DSC1_CS0_8mA (1<<0)
176#define S3C2440_DSC1_CS0_6mA (2<<0) 179#define S3C2440_DSC1_CS0_6mA (2<<0)
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h
index d2574084697f..6dd17f0f84e0 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpio.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpio.h
@@ -45,7 +45,7 @@
45#define S3C24XX_MISCCR S3C2400_MISCCR 45#define S3C24XX_MISCCR S3C2400_MISCCR
46#else 46#else
47#define S3C24XX_GPIO_BASE(x) S3C2410_GPIO_BASE(x) 47#define S3C24XX_GPIO_BASE(x) S3C2410_GPIO_BASE(x)
48#define S3C24XX_MISCCR S3C2410_MISCCR 48#define S3C24XX_MISCCR S3C24XX_GPIOREG2(0x80)
49#endif /* CONFIG_CPU_S3C2400 */ 49#endif /* CONFIG_CPU_S3C2400 */
50 50
51 51
@@ -73,9 +73,15 @@
73#define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* not available on A */ 73#define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* not available on A */
74#define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */ 74#define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */
75 75
76/* configure GPIO ports A..G */ 76/* register address for the GPIO registers.
77 * S3C24XX_GPIOREG2 is for the second set of registers in the
78 * GPIO which move between s3c2410 and s3c2412 type systems */
77 79
78#define S3C2410_GPIOREG(x) ((x) + S3C24XX_VA_GPIO) 80#define S3C2410_GPIOREG(x) ((x) + S3C24XX_VA_GPIO)
81#define S3C24XX_GPIOREG2(x) ((x) + S3C24XX_VA_GPIO2)
82
83
84/* configure GPIO ports A..G */
79 85
80/* port A - S3C2410: 22bits, zero in bit X makes pin X output 86/* port A - S3C2410: 22bits, zero in bit X makes pin X output
81 * S3C2400: 18bits, zero in bit X makes pin X output 87 * S3C2400: 18bits, zero in bit X makes pin X output
@@ -450,12 +456,14 @@
450#define S3C2410_GPD0_OUTP (0x01 << 0) 456#define S3C2410_GPD0_OUTP (0x01 << 0)
451#define S3C2410_GPD0_VD8 (0x02 << 0) 457#define S3C2410_GPD0_VD8 (0x02 << 0)
452#define S3C2400_GPD0_VFRAME (0x02 << 0) 458#define S3C2400_GPD0_VFRAME (0x02 << 0)
459#define S3C2442_GPD0_nSPICS1 (0x03 << 0)
453 460
454#define S3C2410_GPD1 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 1) 461#define S3C2410_GPD1 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 1)
455#define S3C2410_GPD1_INP (0x00 << 2) 462#define S3C2410_GPD1_INP (0x00 << 2)
456#define S3C2410_GPD1_OUTP (0x01 << 2) 463#define S3C2410_GPD1_OUTP (0x01 << 2)
457#define S3C2410_GPD1_VD9 (0x02 << 2) 464#define S3C2410_GPD1_VD9 (0x02 << 2)
458#define S3C2400_GPD1_VM (0x02 << 2) 465#define S3C2400_GPD1_VM (0x02 << 2)
466#define S3C2442_GPD1_SPICLK1 (0x03 << 2)
459 467
460#define S3C2410_GPD2 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 2) 468#define S3C2410_GPD2 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 2)
461#define S3C2410_GPD2_INP (0x00 << 4) 469#define S3C2410_GPD2_INP (0x00 << 4)
@@ -858,6 +866,7 @@
858#define S3C2410_GPG12_OUTP (0x01 << 24) 866#define S3C2410_GPG12_OUTP (0x01 << 24)
859#define S3C2410_GPG12_EINT20 (0x02 << 24) 867#define S3C2410_GPG12_EINT20 (0x02 << 24)
860#define S3C2410_GPG12_XMON (0x03 << 24) 868#define S3C2410_GPG12_XMON (0x03 << 24)
869#define S3C2442_GPG12_nSPICS0 (0x03 << 24)
861 870
862#define S3C2410_GPG13 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 13) 871#define S3C2410_GPG13 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 13)
863#define S3C2410_GPG13_INP (0x00 << 26) 872#define S3C2410_GPG13_INP (0x00 << 26)
@@ -943,17 +952,25 @@
943#define S3C2410_GPH9_INP (0x00 << 18) 952#define S3C2410_GPH9_INP (0x00 << 18)
944#define S3C2410_GPH9_OUTP (0x01 << 18) 953#define S3C2410_GPH9_OUTP (0x01 << 18)
945#define S3C2410_GPH9_CLKOUT0 (0x02 << 18) 954#define S3C2410_GPH9_CLKOUT0 (0x02 << 18)
955#define S3C2442_GPH9_nSPICS0 (0x03 << 18)
946 956
947#define S3C2410_GPH10 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 10) 957#define S3C2410_GPH10 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 10)
948#define S3C2410_GPH10_INP (0x00 << 20) 958#define S3C2410_GPH10_INP (0x00 << 20)
949#define S3C2410_GPH10_OUTP (0x01 << 20) 959#define S3C2410_GPH10_OUTP (0x01 << 20)
950#define S3C2410_GPH10_CLKOUT1 (0x02 << 20) 960#define S3C2410_GPH10_CLKOUT1 (0x02 << 20)
951 961
962/* The S3C2412 and S3C2413 move the GPJ register set to after
963 * GPH, which means all registers after 0x80 are now offset by 0x10
964 * for the 2412/2413 from the 2410/2440/2442
965*/
966
952/* miscellaneous control */ 967/* miscellaneous control */
953#define S3C2400_MISCCR S3C2410_GPIOREG(0x54) 968#define S3C2400_MISCCR S3C2410_GPIOREG(0x54)
954#define S3C2410_MISCCR S3C2410_GPIOREG(0x80) 969#define S3C2410_MISCCR S3C2410_GPIOREG(0x80)
955#define S3C2410_DCLKCON S3C2410_GPIOREG(0x84) 970#define S3C2410_DCLKCON S3C2410_GPIOREG(0x84)
956 971
972#define S3C24XX_DCLKCON S3C24XX_GPIOREG2(0x84)
973
957/* see clock.h for dclk definitions */ 974/* see clock.h for dclk definitions */
958 975
959/* pullup control on databus */ 976/* pullup control on databus */
@@ -981,6 +998,8 @@
981#define S3C2410_MISCCR_CLK0_DCLK0 (5<<4) 998#define S3C2410_MISCCR_CLK0_DCLK0 (5<<4)
982#define S3C2410_MISCCR_CLK0_MASK (7<<4) 999#define S3C2410_MISCCR_CLK0_MASK (7<<4)
983 1000
1001#define S3C2412_MISCCR_CLK0_RTC (2<<4)
1002
984#define S3C2410_MISCCR_CLK1_MPLL (0<<8) 1003#define S3C2410_MISCCR_CLK1_MPLL (0<<8)
985#define S3C2410_MISCCR_CLK1_UPLL (1<<8) 1004#define S3C2410_MISCCR_CLK1_UPLL (1<<8)
986#define S3C2410_MISCCR_CLK1_FCLK (2<<8) 1005#define S3C2410_MISCCR_CLK1_FCLK (2<<8)
@@ -989,6 +1008,8 @@
989#define S3C2410_MISCCR_CLK1_DCLK1 (5<<8) 1008#define S3C2410_MISCCR_CLK1_DCLK1 (5<<8)
990#define S3C2410_MISCCR_CLK1_MASK (7<<8) 1009#define S3C2410_MISCCR_CLK1_MASK (7<<8)
991 1010
1011#define S3C2412_MISCCR_CLK1_CLKsrc (0<<8)
1012
992#define S3C2410_MISCCR_USBSUSPND0 (1<<12) 1013#define S3C2410_MISCCR_USBSUSPND0 (1<<12)
993#define S3C2410_MISCCR_USBSUSPND1 (1<<13) 1014#define S3C2410_MISCCR_USBSUSPND1 (1<<13)
994 1015
@@ -996,7 +1017,7 @@
996 1017
997#define S3C2410_MISCCR_nEN_SCLK0 (1<<17) 1018#define S3C2410_MISCCR_nEN_SCLK0 (1<<17)
998#define S3C2410_MISCCR_nEN_SCLK1 (1<<18) 1019#define S3C2410_MISCCR_nEN_SCLK1 (1<<18)
999#define S3C2410_MISCCR_nEN_SCLKE (1<<19) 1020#define S3C2410_MISCCR_nEN_SCLKE (1<<19) /* not 2412 */
1000#define S3C2410_MISCCR_SDSLEEP (7<<17) 1021#define S3C2410_MISCCR_SDSLEEP (7<<17)
1001 1022
1002/* external interrupt control... */ 1023/* external interrupt control... */
@@ -1013,6 +1034,10 @@
1013#define S3C2410_EXTINT1 S3C2410_GPIOREG(0x8C) 1034#define S3C2410_EXTINT1 S3C2410_GPIOREG(0x8C)
1014#define S3C2410_EXTINT2 S3C2410_GPIOREG(0x90) 1035#define S3C2410_EXTINT2 S3C2410_GPIOREG(0x90)
1015 1036
1037#define S3C24XX_EXTINT0 S3C24XX_GPIOREG2(0x88)
1038#define S3C24XX_EXTINT1 S3C24XX_GPIOREG2(0x8C)
1039#define S3C24XX_EXTINT2 S3C24XX_GPIOREG2(0x90)
1040
1016/* values for S3C2410_EXTINT0/1/2 */ 1041/* values for S3C2410_EXTINT0/1/2 */
1017#define S3C2410_EXTINT_LOWLEV (0x00) 1042#define S3C2410_EXTINT_LOWLEV (0x00)
1018#define S3C2410_EXTINT_HILEV (0x01) 1043#define S3C2410_EXTINT_HILEV (0x01)
@@ -1026,6 +1051,11 @@
1026#define S3C2410_EINFLT2 S3C2410_GPIOREG(0x9C) 1051#define S3C2410_EINFLT2 S3C2410_GPIOREG(0x9C)
1027#define S3C2410_EINFLT3 S3C2410_GPIOREG(0xA0) 1052#define S3C2410_EINFLT3 S3C2410_GPIOREG(0xA0)
1028 1053
1054#define S3C24XX_EINFLT0 S3C24XX_GPIOREG2(0x94)
1055#define S3C24XX_EINFLT1 S3C24XX_GPIOREG2(0x98)
1056#define S3C24XX_EINFLT2 S3C24XX_GPIOREG2(0x9C)
1057#define S3C24XX_EINFLT3 S3C24XX_GPIOREG2(0xA0)
1058
1029/* values for interrupt filtering */ 1059/* values for interrupt filtering */
1030#define S3C2410_EINTFLT_PCLK (0x00) 1060#define S3C2410_EINTFLT_PCLK (0x00)
1031#define S3C2410_EINTFLT_EXTCLK (1<<7) 1061#define S3C2410_EINTFLT_EXTCLK (1<<7)
@@ -1035,6 +1065,7 @@
1035 1065
1036/* GSTATUS have miscellaneous information in them 1066/* GSTATUS have miscellaneous information in them
1037 * 1067 *
1068 * These move between s3c2410 and s3c2412 style systems.
1038 */ 1069 */
1039 1070
1040#define S3C2410_GSTATUS0 S3C2410_GPIOREG(0x0AC) 1071#define S3C2410_GSTATUS0 S3C2410_GPIOREG(0x0AC)
@@ -1043,6 +1074,18 @@
1043#define S3C2410_GSTATUS3 S3C2410_GPIOREG(0x0B8) 1074#define S3C2410_GSTATUS3 S3C2410_GPIOREG(0x0B8)
1044#define S3C2410_GSTATUS4 S3C2410_GPIOREG(0x0BC) 1075#define S3C2410_GSTATUS4 S3C2410_GPIOREG(0x0BC)
1045 1076
1077#define S3C2412_GSTATUS0 S3C2410_GPIOREG(0x0BC)
1078#define S3C2412_GSTATUS1 S3C2410_GPIOREG(0x0C0)
1079#define S3C2412_GSTATUS2 S3C2410_GPIOREG(0x0C4)
1080#define S3C2412_GSTATUS3 S3C2410_GPIOREG(0x0C8)
1081#define S3C2412_GSTATUS4 S3C2410_GPIOREG(0x0CC)
1082
1083#define S3C24XX_GSTATUS0 S3C24XX_GPIOREG2(0x0AC)
1084#define S3C24XX_GSTATUS1 S3C24XX_GPIOREG2(0x0B0)
1085#define S3C24XX_GSTATUS2 S3C24XX_GPIOREG2(0x0B4)
1086#define S3C24XX_GSTATUS3 S3C24XX_GPIOREG2(0x0B8)
1087#define S3C24XX_GSTATUS4 S3C24XX_GPIOREG2(0x0BC)
1088
1046#define S3C2410_GSTATUS0_nWAIT (1<<3) 1089#define S3C2410_GSTATUS0_nWAIT (1<<3)
1047#define S3C2410_GSTATUS0_NCON (1<<2) 1090#define S3C2410_GSTATUS0_NCON (1<<2)
1048#define S3C2410_GSTATUS0_RnB (1<<1) 1091#define S3C2410_GSTATUS0_RnB (1<<1)
@@ -1050,7 +1093,9 @@
1050 1093
1051#define S3C2410_GSTATUS1_IDMASK (0xffff0000) 1094#define S3C2410_GSTATUS1_IDMASK (0xffff0000)
1052#define S3C2410_GSTATUS1_2410 (0x32410000) 1095#define S3C2410_GSTATUS1_2410 (0x32410000)
1096#define S3C2410_GSTATUS1_2412 (0x32412001)
1053#define S3C2410_GSTATUS1_2440 (0x32440000) 1097#define S3C2410_GSTATUS1_2440 (0x32440000)
1098#define S3C2410_GSTATUS1_2442 (0x32440aaa)
1054 1099
1055#define S3C2410_GSTATUS2_WTRESET (1<<2) 1100#define S3C2410_GSTATUS2_WTRESET (1<<2)
1056#define S3C2410_GSTATUS2_OFFRESET (1<<1) 1101#define S3C2410_GSTATUS2_OFFRESET (1<<1)
@@ -1072,5 +1117,22 @@
1072#define S3C2400_OPENCR_OPC_MOSIDIS (0<<5) 1117#define S3C2400_OPENCR_OPC_MOSIDIS (0<<5)
1073#define S3C2400_OPENCR_OPC_MOSIEN (1<<5) 1118#define S3C2400_OPENCR_OPC_MOSIEN (1<<5)
1074 1119
1120/* 2412/2413 sleep configuration registers */
1121
1122#define S3C2412_GPBSLPCON S3C2410_GPIOREG(0x1C)
1123#define S3C2412_GPCSLPCON S3C2410_GPIOREG(0x2C)
1124#define S3C2412_GPDSLPCON S3C2410_GPIOREG(0x3C)
1125#define S3C2412_GPESLPCON S3C2410_GPIOREG(0x4C)
1126#define S3C2412_GPFSLPCON S3C2410_GPIOREG(0x5C)
1127#define S3C2412_GPGSLPCON S3C2410_GPIOREG(0x6C)
1128#define S3C2412_GPHSLPCON S3C2410_GPIOREG(0x7C)
1129
1130/* definitions for each pin bit */
1131#define S3C2412_SLPCON_LOW(x) ( 0x00 << ((x) * 2))
1132#define S3C2412_SLPCON_HI(x) ( 0x01 << ((x) * 2))
1133#define S3C2412_SLPCON_IN(x) ( 0x02 << ((x) * 2))
1134#define S3C2412_SLPCON_PDWN(x) ( 0x03 << ((x) * 2))
1135#define S3C2412_SLPCON_MASK(x) ( 0x03 << ((x) * 2))
1136
1075#endif /* __ASM_ARCH_REGS_GPIO_H */ 1137#endif /* __ASM_ARCH_REGS_GPIO_H */
1076 1138
diff --git a/include/asm-arm/arch-s3c2410/regs-gpioj.h b/include/asm-arm/arch-s3c2410/regs-gpioj.h
index 3ad2324acc39..18edae50d0b8 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpioj.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpioj.h
@@ -32,6 +32,11 @@
32#define S3C2440_GPJDAT S3C2410_GPIOREG(0xd4) 32#define S3C2440_GPJDAT S3C2410_GPIOREG(0xd4)
33#define S3C2440_GPJUP S3C2410_GPIOREG(0xd8) 33#define S3C2440_GPJUP S3C2410_GPIOREG(0xd8)
34 34
35#define S3C2413_GPJCON S3C2410_GPIOREG(0x80)
36#define S3C2413_GPJDAT S3C2410_GPIOREG(0x84)
37#define S3C2413_GPJUP S3C2410_GPIOREG(0x88)
38#define S3C2413_GPJSLPCON S3C2410_GPIOREG(0x8C)
39
35#define S3C2440_GPJ0 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 0) 40#define S3C2440_GPJ0 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 0)
36#define S3C2440_GPJ0_INP (0x00 << 0) 41#define S3C2440_GPJ0_INP (0x00 << 0)
37#define S3C2440_GPJ0_OUTP (0x01 << 0) 42#define S3C2440_GPJ0_OUTP (0x01 << 0)
diff --git a/include/asm-arm/arch-s3c2410/regs-irq.h b/include/asm-arm/arch-s3c2410/regs-irq.h
index 24b7292df79e..572fca5d9acf 100644
--- a/include/asm-arm/arch-s3c2410/regs-irq.h
+++ b/include/asm-arm/arch-s3c2410/regs-irq.h
@@ -23,6 +23,7 @@
23 23
24#define S3C2410_IRQREG(x) ((x) + S3C24XX_VA_IRQ) 24#define S3C2410_IRQREG(x) ((x) + S3C24XX_VA_IRQ)
25#define S3C2410_EINTREG(x) ((x) + S3C24XX_VA_GPIO) 25#define S3C2410_EINTREG(x) ((x) + S3C24XX_VA_GPIO)
26#define S3C24XX_EINTREG(x) ((x) + S3C24XX_VA_GPIO2)
26 27
27#define S3C2410_SRCPND S3C2410_IRQREG(0x000) 28#define S3C2410_SRCPND S3C2410_IRQREG(0x000)
28#define S3C2410_INTMOD S3C2410_IRQREG(0x004) 29#define S3C2410_INTMOD S3C2410_IRQREG(0x004)
@@ -40,5 +41,10 @@
40 41
41#define S3C2410_EINTMASK S3C2410_EINTREG(0x0A4) 42#define S3C2410_EINTMASK S3C2410_EINTREG(0x0A4)
42#define S3C2410_EINTPEND S3C2410_EINTREG(0X0A8) 43#define S3C2410_EINTPEND S3C2410_EINTREG(0X0A8)
44#define S3C2412_EINTMASK S3C2410_EINTREG(0x0B4)
45#define S3C2412_EINTPEND S3C2410_EINTREG(0X0B8)
46
47#define S3C24XX_EINTMASK S3C24XX_EINTREG(0x0A4)
48#define S3C24XX_EINTPEND S3C24XX_EINTREG(0X0A8)
43 49
44#endif /* ___ASM_ARCH_REGS_IRQ_H */ 50#endif /* ___ASM_ARCH_REGS_IRQ_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/arch-s3c2410/regs-serial.h
index 83b01254c4ac..93f651ae2967 100644
--- a/include/asm-arm/arch-s3c2410/regs-serial.h
+++ b/include/asm-arm/arch-s3c2410/regs-serial.h
@@ -82,6 +82,12 @@
82#define S3C2440_UCON2_DIVMASK (7 << 12) 82#define S3C2440_UCON2_DIVMASK (7 << 12)
83#define S3C2440_UCON_DIVSHIFT (12) 83#define S3C2440_UCON_DIVSHIFT (12)
84 84
85#define S3C2412_UCON_CLKMASK (3<<10)
86#define S3C2412_UCON_UCLK (1<<10)
87#define S3C2412_UCON_USYSCLK (3<<10)
88#define S3C2412_UCON_PCLK (0<<10)
89#define S3C2412_UCON_PCLK2 (2<<10)
90
85#define S3C2410_UCON_UCLK (1<<10) 91#define S3C2410_UCON_UCLK (1<<10)
86#define S3C2410_UCON_SBREAK (1<<4) 92#define S3C2410_UCON_SBREAK (1<<4)
87 93
@@ -124,6 +130,15 @@
124#define S3C2410_UMCOM_AFC (1<<4) 130#define S3C2410_UMCOM_AFC (1<<4)
125#define S3C2410_UMCOM_RTS_LOW (1<<0) 131#define S3C2410_UMCOM_RTS_LOW (1<<0)
126 132
133#define S3C2412_UMCON_AFC_63 (0<<5)
134#define S3C2412_UMCON_AFC_56 (1<<5)
135#define S3C2412_UMCON_AFC_48 (2<<5)
136#define S3C2412_UMCON_AFC_40 (3<<5)
137#define S3C2412_UMCON_AFC_32 (4<<5)
138#define S3C2412_UMCON_AFC_24 (5<<5)
139#define S3C2412_UMCON_AFC_16 (6<<5)
140#define S3C2412_UMCON_AFC_8 (7<<5)
141
127#define S3C2410_UFSTAT_TXFULL (1<<9) 142#define S3C2410_UFSTAT_TXFULL (1<<9)
128#define S3C2410_UFSTAT_RXFULL (1<<8) 143#define S3C2410_UFSTAT_RXFULL (1<<8)
129#define S3C2410_UFSTAT_TXMASK (15<<4) 144#define S3C2410_UFSTAT_TXMASK (15<<4)
diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h
index a6f6a0e44afa..8e152a05e533 100644
--- a/include/asm-arm/arch-s3c2410/uncompress.h
+++ b/include/asm-arm/arch-s3c2410/uncompress.h
@@ -22,7 +22,6 @@
22#ifndef __ASM_ARCH_UNCOMPRESS_H 22#ifndef __ASM_ARCH_UNCOMPRESS_H
23#define __ASM_ARCH_UNCOMPRESS_H 23#define __ASM_ARCH_UNCOMPRESS_H
24 24
25#include <linux/config.h>
26 25
27/* defines for UART registers */ 26/* defines for UART registers */
28#include "asm/arch/regs-serial.h" 27#include "asm/arch/regs-serial.h"
@@ -82,7 +81,8 @@ static void putc(int ch)
82 while (1) { 81 while (1) {
83 level = uart_rd(S3C2410_UFSTAT); 82 level = uart_rd(S3C2410_UFSTAT);
84 83
85 if (cpuid == S3C2410_GSTATUS1_2440) { 84 if (cpuid == S3C2410_GSTATUS1_2440 ||
85 cpuid == S3C2410_GSTATUS1_2442) {
86 level &= S3C2440_UFSTAT_TXMASK; 86 level &= S3C2440_UFSTAT_TXMASK;
87 level >>= S3C2440_UFSTAT_TXSHIFT; 87 level >>= S3C2440_UFSTAT_TXSHIFT;
88 } else { 88 } else {
@@ -130,7 +130,7 @@ static void arch_decomp_wdog_start(void)
130{ 130{
131 __raw_writel(WDOG_COUNT, S3C2410_WTDAT); 131 __raw_writel(WDOG_COUNT, S3C2410_WTDAT);
132 __raw_writel(WDOG_COUNT, S3C2410_WTCNT); 132 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
133 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON); 133 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
134} 134}
135 135
136#else 136#else
diff --git a/include/asm-arm/arch-sa1100/assabet.h b/include/asm-arm/arch-sa1100/assabet.h
index 1f59b368c3f6..d6a1bb5b4944 100644
--- a/include/asm-arm/arch-sa1100/assabet.h
+++ b/include/asm-arm/arch-sa1100/assabet.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_ARCH_ASSABET_H 12#ifndef __ASM_ARCH_ASSABET_H
13#define __ASM_ARCH_ASSABET_H 13#define __ASM_ARCH_ASSABET_H
14 14
15#include <linux/config.h>
16 15
17/* System Configuration Register flags */ 16/* System Configuration Register flags */
18 17
diff --git a/include/asm-arm/arch-sa1100/cerf.h b/include/asm-arm/arch-sa1100/cerf.h
index 356d5ba88991..9a19c3d07c1e 100644
--- a/include/asm-arm/arch-sa1100/cerf.h
+++ b/include/asm-arm/arch-sa1100/cerf.h
@@ -10,7 +10,6 @@
10#ifndef _INCLUDE_CERF_H_ 10#ifndef _INCLUDE_CERF_H_
11#define _INCLUDE_CERF_H_ 11#define _INCLUDE_CERF_H_
12 12
13#include <linux/config.h>
14 13
15#define CERF_ETH_IO 0xf0000000 14#define CERF_ETH_IO 0xf0000000
16#define CERF_ETH_IRQ IRQ_GPIO26 15#define CERF_ETH_IRQ IRQ_GPIO26
diff --git a/include/asm-arm/arch-sa1100/collie.h b/include/asm-arm/arch-sa1100/collie.h
index d49e5ff63ca4..14a344aa3cc7 100644
--- a/include/asm-arm/arch-sa1100/collie.h
+++ b/include/asm-arm/arch-sa1100/collie.h
@@ -13,7 +13,6 @@
13#ifndef __ASM_ARCH_COLLIE_H 13#ifndef __ASM_ARCH_COLLIE_H
14#define __ASM_ARCH_COLLIE_H 14#define __ASM_ARCH_COLLIE_H
15 15
16#include <linux/config.h>
17 16
18#define COLLIE_SCP_CHARGE_ON SCOOP_GPCR_PA11 17#define COLLIE_SCP_CHARGE_ON SCOOP_GPCR_PA11
19#define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12 18#define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12
diff --git a/include/asm-arm/arch-sa1100/dma.h b/include/asm-arm/arch-sa1100/dma.h
index 02575d72ac6b..6b7917a2e77a 100644
--- a/include/asm-arm/arch-sa1100/dma.h
+++ b/include/asm-arm/arch-sa1100/dma.h
@@ -10,7 +10,6 @@
10#ifndef __ASM_ARCH_DMA_H 10#ifndef __ASM_ARCH_DMA_H
11#define __ASM_ARCH_DMA_H 11#define __ASM_ARCH_DMA_H
12 12
13#include <linux/config.h>
14#include "hardware.h" 13#include "hardware.h"
15 14
16 15
diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h
index ee008a5484f3..1abd7cfc8bce 100644
--- a/include/asm-arm/arch-sa1100/hardware.h
+++ b/include/asm-arm/arch-sa1100/hardware.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_ARCH_HARDWARE_H 12#ifndef __ASM_ARCH_HARDWARE_H
13#define __ASM_ARCH_HARDWARE_H 13#define __ASM_ARCH_HARDWARE_H
14 14
15#include <linux/config.h>
16 15
17#define UNCACHEABLE_ADDR 0xfa050000 16#define UNCACHEABLE_ADDR 0xfa050000
18 17
diff --git a/include/asm-arm/arch-sa1100/ide.h b/include/asm-arm/arch-sa1100/ide.h
index 2153538069c7..98b10bcf9f1b 100644
--- a/include/asm-arm/arch-sa1100/ide.h
+++ b/include/asm-arm/arch-sa1100/ide.h
@@ -9,7 +9,6 @@
9 * architectures. 9 * architectures.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <asm/irq.h> 12#include <asm/irq.h>
14#include <asm/hardware.h> 13#include <asm/hardware.h>
15#include <asm/mach-types.h> 14#include <asm/mach-types.h>
diff --git a/include/asm-arm/arch-sa1100/io.h b/include/asm-arm/arch-sa1100/io.h
index 040ccde7a11e..0756269404b1 100644
--- a/include/asm-arm/arch-sa1100/io.h
+++ b/include/asm-arm/arch-sa1100/io.h
@@ -22,6 +22,5 @@ static inline void __iomem *__io(unsigned long addr)
22} 22}
23#define __io(a) __io(a) 23#define __io(a) __io(a)
24#define __mem_pci(a) (a) 24#define __mem_pci(a) (a)
25#define __mem_isa(a) (a)
26 25
27#endif 26#endif
diff --git a/include/asm-arm/arch-sa1100/irqs.h b/include/asm-arm/arch-sa1100/irqs.h
index eabd3be3d705..d7940683efb1 100644
--- a/include/asm-arm/arch-sa1100/irqs.h
+++ b/include/asm-arm/arch-sa1100/irqs.h
@@ -7,7 +7,6 @@
7 * 7 *
8 * 2001/11/14 RMK Cleaned up and standardised a lot of the IRQs. 8 * 2001/11/14 RMK Cleaned up and standardised a lot of the IRQs.
9 */ 9 */
10#include <linux/config.h>
11 10
12#define IRQ_GPIO0 0 11#define IRQ_GPIO0 0
13#define IRQ_GPIO1 1 12#define IRQ_GPIO1 1
diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h
index a29fac1387ca..1ff172dc8e33 100644
--- a/include/asm-arm/arch-sa1100/memory.h
+++ b/include/asm-arm/arch-sa1100/memory.h
@@ -7,7 +7,6 @@
7#ifndef __ASM_ARCH_MEMORY_H 7#ifndef __ASM_ARCH_MEMORY_H
8#define __ASM_ARCH_MEMORY_H 8#define __ASM_ARCH_MEMORY_H
9 9
10#include <linux/config.h>
11#include <asm/sizes.h> 10#include <asm/sizes.h>
12 11
13/* 12/*
diff --git a/include/asm-arm/arch-sa1100/system.h b/include/asm-arm/arch-sa1100/system.h
index 0f0612f79b2b..aef91e3b63fe 100644
--- a/include/asm-arm/arch-sa1100/system.h
+++ b/include/asm-arm/arch-sa1100/system.h
@@ -3,7 +3,6 @@
3 * 3 *
4 * Copyright (c) 1999 Nicolas Pitre <nico@cam.org> 4 * Copyright (c) 1999 Nicolas Pitre <nico@cam.org>
5 */ 5 */
6#include <linux/config.h>
7#include <asm/hardware.h> 6#include <asm/hardware.h>
8 7
9static inline void arch_idle(void) 8static inline void arch_idle(void)
diff --git a/include/asm-arm/arch-versatile/io.h b/include/asm-arm/arch-versatile/io.h
index 47e904cf25c7..c4d01948e00b 100644
--- a/include/asm-arm/arch-versatile/io.h
+++ b/include/asm-arm/arch-versatile/io.h
@@ -28,6 +28,5 @@ static inline void __iomem *__io(unsigned long addr)
28} 28}
29#define __io(a) __io(a) 29#define __io(a) __io(a)
30#define __mem_pci(a) (a) 30#define __mem_pci(a) (a)
31#define __mem_isa(a) (a)
32 31
33#endif 32#endif
diff --git a/include/asm-arm/arch-versatile/system.h b/include/asm-arm/arch-versatile/system.h
index 8889a189739f..71c6254c0d9b 100644
--- a/include/asm-arm/arch-versatile/system.h
+++ b/include/asm-arm/arch-versatile/system.h
@@ -36,16 +36,14 @@ static inline void arch_idle(void)
36 36
37static inline void arch_reset(char mode) 37static inline void arch_reset(char mode)
38{ 38{
39 unsigned int hdr_ctrl = (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_RESETCTL_OFFSET); 39 u32 val;
40 unsigned int val;
41 40
42 /* 41 val = __raw_readl(IO_ADDRESS(VERSATILE_SYS_RESETCTL)) & ~0x7;
43 * To reset, we hit the on-board reset register 42 val |= 0x105;
44 * in the system FPGA 43
45 */ 44 __raw_writel(0xa05f, IO_ADDRESS(VERSATILE_SYS_LOCK));
46 val = __raw_readl(hdr_ctrl); 45 __raw_writel(val, IO_ADDRESS(VERSATILE_SYS_RESETCTL));
47 val |= VERSATILE_SYS_CTRL_RESET_CONFIGCLR; 46 __raw_writel(0, IO_ADDRESS(VERSATILE_SYS_LOCK));
48 __raw_writel(val, hdr_ctrl);
49} 47}
50 48
51#endif 49#endif
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
index 3d7283d84405..4b0ce3e7de9a 100644
--- a/include/asm-arm/atomic.h
+++ b/include/asm-arm/atomic.h
@@ -11,7 +11,6 @@
11#ifndef __ASM_ARM_ATOMIC_H 11#ifndef __ASM_ARM_ATOMIC_H
12#define __ASM_ARM_ATOMIC_H 12#define __ASM_ARM_ATOMIC_H
13 13
14#include <linux/config.h>
15#include <linux/compiler.h> 14#include <linux/compiler.h>
16 15
17typedef struct { volatile int counter; } atomic_t; 16typedef struct { volatile int counter; } atomic_t;
diff --git a/include/asm-arm/bug.h b/include/asm-arm/bug.h
index 5ab8216f5204..7fb02138f585 100644
--- a/include/asm-arm/bug.h
+++ b/include/asm-arm/bug.h
@@ -2,7 +2,6 @@
2#define _ASMARM_BUG_H 2#define _ASMARM_BUG_H
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5#include <linux/stddef.h>
6 5
7#ifdef CONFIG_BUG 6#ifdef CONFIG_BUG
8#ifdef CONFIG_DEBUG_BUGVERBOSE 7#ifdef CONFIG_DEBUG_BUGVERBOSE
diff --git a/include/asm-arm/byteorder.h b/include/asm-arm/byteorder.h
index 17eaf8bdf092..e6f7fcdc73b0 100644
--- a/include/asm-arm/byteorder.h
+++ b/include/asm-arm/byteorder.h
@@ -22,16 +22,18 @@ static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
22{ 22{
23 __u32 t; 23 __u32 t;
24 24
25 if (__builtin_constant_p(x)) { 25#ifndef __thumb__
26 t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */ 26 if (!__builtin_constant_p(x)) {
27 } else {
28 /* 27 /*
29 * The compiler needs a bit of a hint here to always do the 28 * The compiler needs a bit of a hint here to always do the
30 * right thing and not screw it up to different degrees 29 * right thing and not screw it up to different degrees
31 * depending on the gcc version. 30 * depending on the gcc version.
32 */ 31 */
33 asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x)); 32 asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
34 } 33 } else
34#endif
35 t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
36
35 x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */ 37 x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */
36 t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */ 38 t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */
37 x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */ 39 x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
index 746be56b1b70..fe0c744e0266 100644
--- a/include/asm-arm/cacheflush.h
+++ b/include/asm-arm/cacheflush.h
@@ -10,7 +10,6 @@
10#ifndef _ASMARM_CACHEFLUSH_H 10#ifndef _ASMARM_CACHEFLUSH_H
11#define _ASMARM_CACHEFLUSH_H 11#define _ASMARM_CACHEFLUSH_H
12 12
13#include <linux/config.h>
14#include <linux/sched.h> 13#include <linux/sched.h>
15#include <linux/mm.h> 14#include <linux/mm.h>
16 15
diff --git a/include/asm-arm/cpu.h b/include/asm-arm/cpu.h
index 751bc7462074..715426b9b08e 100644
--- a/include/asm-arm/cpu.h
+++ b/include/asm-arm/cpu.h
@@ -10,7 +10,6 @@
10#ifndef __ASM_ARM_CPU_H 10#ifndef __ASM_ARM_CPU_H
11#define __ASM_ARM_CPU_H 11#define __ASM_ARM_CPU_H
12 12
13#include <linux/config.h>
14#include <linux/percpu.h> 13#include <linux/percpu.h>
15 14
16struct cpuinfo_arm { 15struct cpuinfo_arm {
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h
index 63ca7412a462..55eb4dc3253d 100644
--- a/include/asm-arm/dma-mapping.h
+++ b/include/asm-arm/dma-mapping.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7#include <linux/mm.h> /* need struct page */ 6#include <linux/mm.h> /* need struct page */
8 7
9#include <asm/scatterlist.h> 8#include <asm/scatterlist.h>
diff --git a/include/asm-arm/dma.h b/include/asm-arm/dma.h
index 49c01e2bf7c8..9f2c5305c260 100644
--- a/include/asm-arm/dma.h
+++ b/include/asm-arm/dma.h
@@ -3,7 +3,6 @@
3 3
4typedef unsigned int dmach_t; 4typedef unsigned int dmach_t;
5 5
6#include <linux/config.h>
7#include <linux/spinlock.h> 6#include <linux/spinlock.h>
8#include <asm/system.h> 7#include <asm/system.h>
9#include <asm/scatterlist.h> 8#include <asm/scatterlist.h>
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h
index 2d44b42d1847..71061ca5c5d0 100644
--- a/include/asm-arm/elf.h
+++ b/include/asm-arm/elf.h
@@ -1,7 +1,6 @@
1#ifndef __ASMARM_ELF_H 1#ifndef __ASMARM_ELF_H
2#define __ASMARM_ELF_H 2#define __ASMARM_ELF_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * ELF register definitions.. 6 * ELF register definitions..
diff --git a/include/asm-arm/fpstate.h b/include/asm-arm/fpstate.h
index 52bae088a185..132c3c5628b2 100644
--- a/include/asm-arm/fpstate.h
+++ b/include/asm-arm/fpstate.h
@@ -11,7 +11,6 @@
11#ifndef __ASM_ARM_FPSTATE_H 11#ifndef __ASM_ARM_FPSTATE_H
12#define __ASM_ARM_FPSTATE_H 12#define __ASM_ARM_FPSTATE_H
13 13
14#include <linux/config.h>
15 14
16#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
17 16
diff --git a/include/asm-arm/glue.h b/include/asm-arm/glue.h
index 223e0d6c41be..0cc5d3b10ce2 100644
--- a/include/asm-arm/glue.h
+++ b/include/asm-arm/glue.h
@@ -15,7 +15,6 @@
15 */ 15 */
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17 17
18#include <linux/config.h>
19 18
20#ifdef __STDC__ 19#ifdef __STDC__
21#define ____glue(name,fn) name##fn 20#define ____glue(name,fn) name##fn
diff --git a/include/asm-arm/hardirq.h b/include/asm-arm/hardirq.h
index 1cbb173bf5b1..182310b99195 100644
--- a/include/asm-arm/hardirq.h
+++ b/include/asm-arm/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_HARDIRQ_H 1#ifndef __ASM_HARDIRQ_H
2#define __ASM_HARDIRQ_H 2#define __ASM_HARDIRQ_H
3 3
4#include <linux/config.h>
5#include <linux/cache.h> 4#include <linux/cache.h>
6#include <linux/threads.h> 5#include <linux/threads.h>
7#include <asm/irq.h> 6#include <asm/irq.h>
diff --git a/include/asm-arm/hardware/dec21285.h b/include/asm-arm/hardware/dec21285.h
index 6685e3fb97b1..546f7077be9c 100644
--- a/include/asm-arm/hardware/dec21285.h
+++ b/include/asm-arm/hardware/dec21285.h
@@ -18,7 +18,6 @@
18#define DC21285_PCI_IO 0x7c000000 18#define DC21285_PCI_IO 0x7c000000
19#define DC21285_PCI_MEM 0x80000000 19#define DC21285_PCI_MEM 0x80000000
20 20
21#include <linux/config.h>
22#ifndef __ASSEMBLY__ 21#ifndef __ASSEMBLY__
23#include <asm/hardware.h> 22#include <asm/hardware.h>
24#define DC21285_IO(x) ((volatile unsigned long *)(ARMCSR_BASE+(x))) 23#define DC21285_IO(x) ((volatile unsigned long *)(ARMCSR_BASE+(x)))
diff --git a/include/asm-arm/hardware/iomd.h b/include/asm-arm/hardware/iomd.h
index 82fa2c279a18..396e55ad06c6 100644
--- a/include/asm-arm/hardware/iomd.h
+++ b/include/asm-arm/hardware/iomd.h
@@ -13,7 +13,6 @@
13#ifndef __ASMARM_HARDWARE_IOMD_H 13#ifndef __ASMARM_HARDWARE_IOMD_H
14#define __ASMARM_HARDWARE_IOMD_H 14#define __ASMARM_HARDWARE_IOMD_H
15 15
16#include <linux/config.h>
17 16
18#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
19 18
diff --git a/include/asm-arm/hardware/sharpsl_pm.h b/include/asm-arm/hardware/sharpsl_pm.h
index 36983e5f3665..ecf15b83956f 100644
--- a/include/asm-arm/hardware/sharpsl_pm.h
+++ b/include/asm-arm/hardware/sharpsl_pm.h
@@ -16,6 +16,7 @@ struct sharpsl_charger_machinfo {
16 void (*exit)(void); 16 void (*exit)(void);
17 int gpio_acin; 17 int gpio_acin;
18 int gpio_batfull; 18 int gpio_batfull;
19 int batfull_irq;
19 int gpio_batlock; 20 int gpio_batlock;
20 int gpio_fatal; 21 int gpio_fatal;
21 void (*discharge)(int); 22 void (*discharge)(int);
@@ -34,9 +35,19 @@ struct sharpsl_charger_machinfo {
34#define SHARPSL_STATUS_FATAL 7 35#define SHARPSL_STATUS_FATAL 7
35 unsigned long (*charger_wakeup)(void); 36 unsigned long (*charger_wakeup)(void);
36 int (*should_wakeup)(unsigned int resume_on_alarm); 37 int (*should_wakeup)(unsigned int resume_on_alarm);
38 void (*backlight_limit)(int);
39 int (*backlight_get_status) (void);
40 int charge_on_volt;
41 int charge_on_temp;
42 int charge_acin_high;
43 int charge_acin_low;
44 int fatal_acin_volt;
45 int fatal_noacin_volt;
37 int bat_levels; 46 int bat_levels;
38 struct battery_thresh *bat_levels_noac; 47 struct battery_thresh *bat_levels_noac;
39 struct battery_thresh *bat_levels_acin; 48 struct battery_thresh *bat_levels_acin;
49 struct battery_thresh *bat_levels_noac_bl;
50 struct battery_thresh *bat_levels_acin_bl;
40 int status_high_acin; 51 int status_high_acin;
41 int status_low_acin; 52 int status_low_acin;
42 int status_high_noac; 53 int status_high_noac;
diff --git a/include/asm-arm/irq.h b/include/asm-arm/irq.h
index 60b5105c9c93..66e67e60bc56 100644
--- a/include/asm-arm/irq.h
+++ b/include/asm-arm/irq.h
@@ -47,10 +47,6 @@ void disable_irq_wake(unsigned int irq);
47void enable_irq_wake(unsigned int irq); 47void enable_irq_wake(unsigned int irq);
48int setup_irq(unsigned int, struct irqaction *); 48int setup_irq(unsigned int, struct irqaction *);
49 49
50struct irqaction;
51struct pt_regs;
52int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
53
54extern void migrate_irqs(void); 50extern void migrate_irqs(void);
55#endif 51#endif
56 52
diff --git a/include/asm-arm/leds.h b/include/asm-arm/leds.h
index 88ce4124f854..12290ea55801 100644
--- a/include/asm-arm/leds.h
+++ b/include/asm-arm/leds.h
@@ -13,7 +13,6 @@
13#ifndef ASM_ARM_LEDS_H 13#ifndef ASM_ARM_LEDS_H
14#define ASM_ARM_LEDS_H 14#define ASM_ARM_LEDS_H
15 15
16#include <linux/config.h>
17 16
18typedef enum { 17typedef enum {
19 led_idle_start, 18 led_idle_start,
diff --git a/include/asm-arm/mach/serial_at91rm9200.h b/include/asm-arm/mach/serial_at91.h
index 98f4b0cb883c..1290bb32802d 100644
--- a/include/asm-arm/mach/serial_at91rm9200.h
+++ b/include/asm-arm/mach/serial_at91.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/mach/serial_at91rm9200.h 2 * linux/include/asm-arm/mach/serial_at91.h
3 * 3 *
4 * Based on serial_sa1100.h by Nicolas Pitre 4 * Based on serial_sa1100.h by Nicolas Pitre
5 * 5 *
@@ -7,7 +7,6 @@
7 * 7 *
8 * Low level machine dependent UART functions. 8 * Low level machine dependent UART functions.
9 */ 9 */
10#include <linux/config.h>
11 10
12struct uart_port; 11struct uart_port;
13 12
@@ -15,7 +14,7 @@ struct uart_port;
15 * This is a temporary structure for registering these 14 * This is a temporary structure for registering these
16 * functions; it is intended to be discarded after boot. 15 * functions; it is intended to be discarded after boot.
17 */ 16 */
18struct at91rm9200_port_fns { 17struct at91_port_fns {
19 void (*set_mctrl)(struct uart_port *, u_int); 18 void (*set_mctrl)(struct uart_port *, u_int);
20 u_int (*get_mctrl)(struct uart_port *); 19 u_int (*get_mctrl)(struct uart_port *);
21 void (*enable_ms)(struct uart_port *); 20 void (*enable_ms)(struct uart_port *);
@@ -26,11 +25,9 @@ struct at91rm9200_port_fns {
26}; 25};
27 26
28#if defined(CONFIG_SERIAL_AT91) 27#if defined(CONFIG_SERIAL_AT91)
29void at91_register_uart_fns(struct at91rm9200_port_fns *fns); 28void at91_register_uart_fns(struct at91_port_fns *fns);
30void at91_register_uart(int idx, int port);
31#else 29#else
32#define at91_register_uart_fns(fns) do { } while (0) 30#define at91_register_uart_fns(fns) do { } while (0)
33#define at91_register_uart(idx,port) do { } while (0)
34#endif 31#endif
35 32
36 33
diff --git a/include/asm-arm/mach/serial_sa1100.h b/include/asm-arm/mach/serial_sa1100.h
index 9162018585df..20c22bb218d9 100644
--- a/include/asm-arm/mach/serial_sa1100.h
+++ b/include/asm-arm/mach/serial_sa1100.h
@@ -7,7 +7,6 @@
7 * 7 *
8 * Low level machine dependent UART functions. 8 * Low level machine dependent UART functions.
9 */ 9 */
10#include <linux/config.h>
11 10
12struct uart_port; 11struct uart_port;
13struct uart_info; 12struct uart_info;
diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h
index 96c6db7dd0e1..9f28073559e8 100644
--- a/include/asm-arm/mach/time.h
+++ b/include/asm-arm/mach/time.h
@@ -50,6 +50,7 @@ struct sys_timer {
50#define DYN_TICK_ENABLED (1 << 1) 50#define DYN_TICK_ENABLED (1 << 1)
51 51
52struct dyn_tick_timer { 52struct dyn_tick_timer {
53 spinlock_t lock;
53 unsigned int state; /* Current state */ 54 unsigned int state; /* Current state */
54 int (*enable)(void); /* Enables dynamic tick */ 55 int (*enable)(void); /* Enables dynamic tick */
55 int (*disable)(void); /* Disables dynamic tick */ 56 int (*disable)(void); /* Disables dynamic tick */
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index 209289407595..731e321a57d1 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -22,7 +22,6 @@
22#define UL(x) (x) 22#define UL(x) (x)
23#endif 23#endif
24 24
25#include <linux/config.h>
26#include <linux/compiler.h> 25#include <linux/compiler.h>
27#include <asm/arch/memory.h> 26#include <asm/arch/memory.h>
28#include <asm/sizes.h> 27#include <asm/sizes.h>
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h
index a404d2bf0c68..66cfeb5290ea 100644
--- a/include/asm-arm/page.h
+++ b/include/asm-arm/page.h
@@ -10,7 +10,6 @@
10#ifndef _ASMARM_PAGE_H 10#ifndef _ASMARM_PAGE_H
11#define _ASMARM_PAGE_H 11#define _ASMARM_PAGE_H
12 12
13#include <linux/config.h>
14 13
15/* PAGE_SHIFT determines the page size */ 14/* PAGE_SHIFT determines the page size */
16#define PAGE_SHIFT 12 15#define PAGE_SHIFT 12
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
index ead3ced38cb8..f21abd4ddac6 100644
--- a/include/asm-arm/pci.h
+++ b/include/asm-arm/pci.h
@@ -2,7 +2,6 @@
2#define ASMARM_PCI_H 2#define ASMARM_PCI_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5#include <linux/config.h>
6#include <asm-generic/pci-dma-compat.h> 5#include <asm-generic/pci-dma-compat.h>
7 6
8#include <asm/hardware.h> /* for PCIBIOS_MIN_* */ 7#include <asm/hardware.h> /* for PCIBIOS_MIN_* */
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h
index 106045edb862..e9310895e79d 100644
--- a/include/asm-arm/proc-fns.h
+++ b/include/asm-arm/proc-fns.h
@@ -13,7 +13,6 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/config.h>
17 16
18/* 17/*
19 * Work out if we need multiple CPU support 18 * Work out if we need multiple CPU support
diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
index 77adb7fa169b..2bebe3dc0a30 100644
--- a/include/asm-arm/ptrace.h
+++ b/include/asm-arm/ptrace.h
@@ -10,7 +10,6 @@
10#ifndef __ASM_ARM_PTRACE_H 10#ifndef __ASM_ARM_PTRACE_H
11#define __ASM_ARM_PTRACE_H 11#define __ASM_ARM_PTRACE_H
12 12
13#include <linux/config.h>
14 13
15#define PTRACE_GETREGS 12 14#define PTRACE_GETREGS 12
16#define PTRACE_SETREGS 13 15#define PTRACE_SETREGS 13
diff --git a/include/asm-arm/smp.h b/include/asm-arm/smp.h
index fe45f7f61223..f67acce387e7 100644
--- a/include/asm-arm/smp.h
+++ b/include/asm-arm/smp.h
@@ -10,7 +10,6 @@
10#ifndef __ASM_ARM_SMP_H 10#ifndef __ASM_ARM_SMP_H
11#define __ASM_ARM_SMP_H 11#define __ASM_ARM_SMP_H
12 12
13#include <linux/config.h>
14#include <linux/threads.h> 13#include <linux/threads.h>
15#include <linux/cpumask.h> 14#include <linux/cpumask.h>
16#include <linux/thread_info.h> 15#include <linux/thread_info.h>
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 7c9568d30307..6001febfe63b 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7 6
8#define CPU_ARCH_UNKNOWN 0 7#define CPU_ARCH_UNKNOWN 0
9#define CPU_ARCH_ARMv3 1 8#define CPU_ARCH_ARMv3 1
@@ -108,6 +107,9 @@ extern void __show_regs(struct pt_regs *);
108extern int cpu_architecture(void); 107extern int cpu_architecture(void);
109extern void cpu_init(void); 108extern void cpu_init(void);
110 109
110void arm_machine_restart(char mode);
111extern void (*arm_pm_restart)(char str);
112
111/* 113/*
112 * Intel's XScale3 core supports some v6 features (supersections, L2) 114 * Intel's XScale3 core supports some v6 features (supersections, L2)
113 * but advertises itself as v5 as it does not support the v6 ISA. For 115 * but advertises itself as v5 as it does not support the v6 ISA. For
diff --git a/include/asm-arm/thread_notify.h b/include/asm-arm/thread_notify.h
new file mode 100644
index 000000000000..8866e5216840
--- /dev/null
+++ b/include/asm-arm/thread_notify.h
@@ -0,0 +1,48 @@
1/*
2 * linux/include/asm-arm/thread_notify.h
3 *
4 * Copyright (C) 2006 Russell King.
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 ASMARM_THREAD_NOTIFY_H
11#define ASMARM_THREAD_NOTIFY_H
12
13#ifdef __KERNEL__
14
15#ifndef __ASSEMBLY__
16
17#include <linux/notifier.h>
18#include <asm/thread_info.h>
19
20static inline int thread_register_notifier(struct notifier_block *n)
21{
22 extern struct atomic_notifier_head thread_notify_head;
23 return atomic_notifier_chain_register(&thread_notify_head, n);
24}
25
26static inline void thread_unregister_notifier(struct notifier_block *n)
27{
28 extern struct atomic_notifier_head thread_notify_head;
29 atomic_notifier_chain_unregister(&thread_notify_head, n);
30}
31
32static inline void thread_notify(unsigned long rc, struct thread_info *thread)
33{
34 extern struct atomic_notifier_head thread_notify_head;
35 atomic_notifier_call_chain(&thread_notify_head, rc, thread);
36}
37
38#endif
39
40/*
41 * These are the reason codes for the thread notifier.
42 */
43#define THREAD_NOTIFY_FLUSH 0
44#define THREAD_NOTIFY_RELEASE 1
45#define THREAD_NOTIFY_SWITCH 2
46
47#endif
48#endif
diff --git a/include/asm-arm/tlbflush.h b/include/asm-arm/tlbflush.h
index 728992451dd1..d97fc76189a5 100644
--- a/include/asm-arm/tlbflush.h
+++ b/include/asm-arm/tlbflush.h
@@ -10,7 +10,6 @@
10#ifndef _ASMARM_TLBFLUSH_H 10#ifndef _ASMARM_TLBFLUSH_H
11#define _ASMARM_TLBFLUSH_H 11#define _ASMARM_TLBFLUSH_H
12 12
13#include <linux/config.h>
14 13
15#ifndef CONFIG_MMU 14#ifndef CONFIG_MMU
16 15
diff --git a/include/asm-arm/ucontext.h b/include/asm-arm/ucontext.h
index f853130137cc..9e6f7ca9f5ae 100644
--- a/include/asm-arm/ucontext.h
+++ b/include/asm-arm/ucontext.h
@@ -1,12 +1,89 @@
1#ifndef _ASMARM_UCONTEXT_H 1#ifndef _ASMARM_UCONTEXT_H
2#define _ASMARM_UCONTEXT_H 2#define _ASMARM_UCONTEXT_H
3 3
4#include <asm/fpstate.h>
5
6/*
7 * struct sigcontext only has room for the basic registers, but struct
8 * ucontext now has room for all registers which need to be saved and
9 * restored. Coprocessor registers are stored in uc_regspace. Each
10 * coprocessor's saved state should start with a documented 32-bit magic
11 * number, followed by a 32-bit word giving the coproccesor's saved size.
12 * uc_regspace may be expanded if necessary, although this takes some
13 * coordination with glibc.
14 */
15
4struct ucontext { 16struct ucontext {
5 unsigned long uc_flags; 17 unsigned long uc_flags;
6 struct ucontext *uc_link; 18 struct ucontext *uc_link;
7 stack_t uc_stack; 19 stack_t uc_stack;
8 struct sigcontext uc_mcontext; 20 struct sigcontext uc_mcontext;
9 sigset_t uc_sigmask; /* mask last for extensibility */ 21 sigset_t uc_sigmask;
22 /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */
23 int __unused[32 - (sizeof (sigset_t) / sizeof (int))];
24 /* Last for extensibility. Eight byte aligned because some
25 coprocessors require eight byte alignment. */
26 unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
10}; 27};
11 28
29#ifdef __KERNEL__
30
31/*
32 * Coprocessor save state. The magic values and specific
33 * coprocessor's layouts are part of the userspace ABI. Each one of
34 * these should be a multiple of eight bytes and aligned to eight
35 * bytes, to prevent unpredictable padding in the signal frame.
36 */
37
38#ifdef CONFIG_IWMMXT
39/* iwmmxt_area is 0x98 bytes long, preceeded by 8 bytes of signature */
40#define IWMMXT_MAGIC 0x12ef842a
41#define IWMMXT_STORAGE_SIZE (IWMMXT_SIZE + 8)
42
43struct iwmmxt_sigframe {
44 unsigned long magic;
45 unsigned long size;
46 struct iwmmxt_struct storage;
47} __attribute__((__aligned__(8)));
48#endif /* CONFIG_IWMMXT */
49
50#ifdef CONFIG_VFP
51#if __LINUX_ARM_ARCH__ < 6
52/* For ARM pre-v6, we use fstmiax and fldmiax. This adds one extra
53 * word after the registers, and a word of padding at the end for
54 * alignment. */
55#define VFP_MAGIC 0x56465001
56#define VFP_STORAGE_SIZE 152
57#else
58#define VFP_MAGIC 0x56465002
59#define VFP_STORAGE_SIZE 144
60#endif
61
62struct vfp_sigframe
63{
64 unsigned long magic;
65 unsigned long size;
66 union vfp_state storage;
67};
68#endif /* CONFIG_VFP */
69
70/*
71 * Auxiliary signal frame. This saves stuff like FP state.
72 * The layout of this structure is not part of the user ABI,
73 * because the config options aren't. uc_regspace is really
74 * one of these.
75 */
76struct aux_sigframe {
77#ifdef CONFIG_IWMMXT
78 struct iwmmxt_sigframe iwmmxt;
79#endif
80#if 0 && defined CONFIG_VFP /* Not yet saved. */
81 struct vfp_sigframe vfp;
82#endif
83 /* Something that isn't a valid magic number for any coprocessor. */
84 unsigned long end_magic;
85} __attribute__((__aligned__(8)));
86
87#endif
88
12#endif /* !_ASMARM_UCONTEXT_H */ 89#endif /* !_ASMARM_UCONTEXT_H */
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index cbf39a56dbe7..1e891f860ef3 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -13,8 +13,6 @@
13#ifndef __ASM_ARM_UNISTD_H 13#ifndef __ASM_ARM_UNISTD_H
14#define __ASM_ARM_UNISTD_H 14#define __ASM_ARM_UNISTD_H
15 15
16#include <linux/linkage.h>
17
18#define __NR_OABI_SYSCALL_BASE 0x900000 16#define __NR_OABI_SYSCALL_BASE 0x900000
19 17
20#if defined(__thumb__) || defined(__ARM_EABI__) 18#if defined(__thumb__) || defined(__ARM_EABI__)
@@ -378,6 +376,9 @@
378#undef __NR_ipc 376#undef __NR_ipc
379#endif 377#endif
380 378
379#ifdef __KERNEL__
380#include <linux/linkage.h>
381
381#define __sys2(x) #x 382#define __sys2(x) #x
382#define __sys1(x) __sys2(x) 383#define __sys1(x) __sys2(x)
383 384
@@ -526,7 +527,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
526 __syscall_return(type,__res); \ 527 __syscall_return(type,__res); \
527} 528}
528 529
529#ifdef __KERNEL__
530#define __ARCH_WANT_IPC_PARSE_VERSION 530#define __ARCH_WANT_IPC_PARSE_VERSION
531#define __ARCH_WANT_STAT64 531#define __ARCH_WANT_STAT64
532#define __ARCH_WANT_SYS_GETHOSTNAME 532#define __ARCH_WANT_SYS_GETHOSTNAME
@@ -547,7 +547,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
547#define __ARCH_WANT_OLD_READDIR 547#define __ARCH_WANT_OLD_READDIR
548#define __ARCH_WANT_SYS_SOCKETCALL 548#define __ARCH_WANT_SYS_SOCKETCALL
549#endif 549#endif
550#endif
551 550
552#ifdef __KERNEL_SYSCALLS__ 551#ifdef __KERNEL_SYSCALLS__
553 552
@@ -571,7 +570,7 @@ asmlinkage long sys_rt_sigaction(int sig,
571 struct sigaction __user *oact, 570 struct sigaction __user *oact,
572 size_t sigsetsize); 571 size_t sigsetsize);
573 572
574#endif 573#endif /* __KERNEL_SYSCALLS__ */
575 574
576/* 575/*
577 * "Conditional" syscalls 576 * "Conditional" syscalls
@@ -581,4 +580,5 @@ asmlinkage long sys_rt_sigaction(int sig,
581 */ 580 */
582#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 581#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
583 582
583#endif /* __KERNEL__ */
584#endif /* __ASM_ARM_UNISTD_H */ 584#endif /* __ASM_ARM_UNISTD_H */
diff --git a/include/asm-arm/vga.h b/include/asm-arm/vga.h
index 926e5ee128e9..1e0b913c3d71 100644
--- a/include/asm-arm/vga.h
+++ b/include/asm-arm/vga.h
@@ -4,7 +4,7 @@
4#include <asm/hardware.h> 4#include <asm/hardware.h>
5#include <asm/io.h> 5#include <asm/io.h>
6 6
7#define VGA_MAP_MEM(x) (PCIMEM_BASE + (x)) 7#define VGA_MAP_MEM(x,s) (PCIMEM_BASE + (x))
8 8
9#define vga_readb(x) (*((volatile unsigned char *)x)) 9#define vga_readb(x) (*((volatile unsigned char *)x))
10#define vga_writeb(x,y) (*((volatile unsigned char *)y) = (x)) 10#define vga_writeb(x,y) (*((volatile unsigned char *)y) = (x))
diff --git a/include/asm-arm26/atomic.h b/include/asm-arm26/atomic.h
index 1552c8653990..97e944fe1cff 100644
--- a/include/asm-arm26/atomic.h
+++ b/include/asm-arm26/atomic.h
@@ -20,7 +20,6 @@
20#ifndef __ASM_ARM_ATOMIC_H 20#ifndef __ASM_ARM_ATOMIC_H
21#define __ASM_ARM_ATOMIC_H 21#define __ASM_ARM_ATOMIC_H
22 22
23#include <linux/config.h>
24 23
25#ifdef CONFIG_SMP 24#ifdef CONFIG_SMP
26#error SMP is NOT supported 25#error SMP is NOT supported
diff --git a/include/asm-arm26/bug.h b/include/asm-arm26/bug.h
index 7177c7399967..8545d58b0475 100644
--- a/include/asm-arm26/bug.h
+++ b/include/asm-arm26/bug.h
@@ -1,7 +1,6 @@
1#ifndef _ASMARM_BUG_H 1#ifndef _ASMARM_BUG_H
2#define _ASMARM_BUG_H 2#define _ASMARM_BUG_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_BUG 5#ifdef CONFIG_BUG
7#ifdef CONFIG_DEBUG_BUGVERBOSE 6#ifdef CONFIG_DEBUG_BUGVERBOSE
diff --git a/include/asm-arm26/dma.h b/include/asm-arm26/dma.h
index 995e223e43a1..4326ba85eb72 100644
--- a/include/asm-arm26/dma.h
+++ b/include/asm-arm26/dma.h
@@ -3,7 +3,6 @@
3 3
4typedef unsigned int dmach_t; 4typedef unsigned int dmach_t;
5 5
6#include <linux/config.h>
7#include <linux/spinlock.h> 6#include <linux/spinlock.h>
8#include <asm/system.h> 7#include <asm/system.h>
9#include <asm/memory.h> 8#include <asm/memory.h>
diff --git a/include/asm-arm26/hardirq.h b/include/asm-arm26/hardirq.h
index 87c19d2bb6a8..e717742ffce0 100644
--- a/include/asm-arm26/hardirq.h
+++ b/include/asm-arm26/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_HARDIRQ_H 1#ifndef __ASM_HARDIRQ_H
2#define __ASM_HARDIRQ_H 2#define __ASM_HARDIRQ_H
3 3
4#include <linux/config.h>
5#include <linux/cache.h> 4#include <linux/cache.h>
6#include <linux/threads.h> 5#include <linux/threads.h>
7#include <asm/irq.h> 6#include <asm/irq.h>
diff --git a/include/asm-arm26/hardware.h b/include/asm-arm26/hardware.h
index 82fc55e2a009..801df0bde8b7 100644
--- a/include/asm-arm26/hardware.h
+++ b/include/asm-arm26/hardware.h
@@ -16,7 +16,6 @@
16#ifndef __ASM_HARDWARE_H 16#ifndef __ASM_HARDWARE_H
17#define __ASM_HARDWARE_H 17#define __ASM_HARDWARE_H
18 18
19#include <linux/config.h>
20 19
21 20
22/* 21/*
diff --git a/include/asm-arm26/io.h b/include/asm-arm26/io.h
index 02f94d88a124..2aa033bd0678 100644
--- a/include/asm-arm26/io.h
+++ b/include/asm-arm26/io.h
@@ -22,7 +22,6 @@
22 22
23#ifdef __KERNEL__ 23#ifdef __KERNEL__
24 24
25#include <linux/config.h>
26#include <linux/types.h> 25#include <linux/types.h>
27#include <asm/byteorder.h> 26#include <asm/byteorder.h>
28#include <asm/memory.h> 27#include <asm/memory.h>
diff --git a/include/asm-arm26/irq.h b/include/asm-arm26/irq.h
index 06bd5a543d13..9aaac87efba9 100644
--- a/include/asm-arm26/irq.h
+++ b/include/asm-arm26/irq.h
@@ -44,9 +44,5 @@ extern void enable_irq(unsigned int);
44 44
45int set_irq_type(unsigned int irq, unsigned int type); 45int set_irq_type(unsigned int irq, unsigned int type);
46 46
47int setup_irq(unsigned int, struct irqaction *);
48struct pt_regs;
49int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
50
51#endif 47#endif
52 48
diff --git a/include/asm-arm26/leds.h b/include/asm-arm26/leds.h
index 88ce4124f854..12290ea55801 100644
--- a/include/asm-arm26/leds.h
+++ b/include/asm-arm26/leds.h
@@ -13,7 +13,6 @@
13#ifndef ASM_ARM_LEDS_H 13#ifndef ASM_ARM_LEDS_H
14#define ASM_ARM_LEDS_H 14#define ASM_ARM_LEDS_H
15 15
16#include <linux/config.h>
17 16
18typedef enum { 17typedef enum {
19 led_idle_start, 18 led_idle_start,
diff --git a/include/asm-arm26/mach-types.h b/include/asm-arm26/mach-types.h
index b34045b78128..0aeaedcbac96 100644
--- a/include/asm-arm26/mach-types.h
+++ b/include/asm-arm26/mach-types.h
@@ -6,7 +6,6 @@
6#ifndef __ASM_ARM_MACH_TYPE_H 6#ifndef __ASM_ARM_MACH_TYPE_H
7#define __ASM_ARM_MACH_TYPE_H 7#define __ASM_ARM_MACH_TYPE_H
8 8
9#include <linux/config.h>
10 9
11#ifndef __ASSEMBLY__ 10#ifndef __ASSEMBLY__
12extern unsigned int __machine_arch_type; 11extern unsigned int __machine_arch_type;
diff --git a/include/asm-arm26/page.h b/include/asm-arm26/page.h
index d3f23ac4d468..fa19de28fda0 100644
--- a/include/asm-arm26/page.h
+++ b/include/asm-arm26/page.h
@@ -1,7 +1,6 @@
1#ifndef _ASMARM_PAGE_H 1#ifndef _ASMARM_PAGE_H
2#define _ASMARM_PAGE_H 2#define _ASMARM_PAGE_H
3 3
4#include <linux/config.h>
5 4
6#ifdef __KERNEL__ 5#ifdef __KERNEL__
7#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
diff --git a/include/asm-arm26/pgtable.h b/include/asm-arm26/pgtable.h
index a590250277f8..19ac9101a6bb 100644
--- a/include/asm-arm26/pgtable.h
+++ b/include/asm-arm26/pgtable.h
@@ -13,7 +13,6 @@
13 13
14#include <asm-generic/4level-fixup.h> 14#include <asm-generic/4level-fixup.h>
15 15
16#include <linux/config.h>
17#include <asm/memory.h> 16#include <asm/memory.h>
18 17
19/* 18/*
diff --git a/include/asm-arm26/serial.h b/include/asm-arm26/serial.h
index 5fc747d1b501..dd86a716cb0b 100644
--- a/include/asm-arm26/serial.h
+++ b/include/asm-arm26/serial.h
@@ -14,7 +14,6 @@
14#ifndef __ASM_SERIAL_H 14#ifndef __ASM_SERIAL_H
15#define __ASM_SERIAL_H 15#define __ASM_SERIAL_H
16 16
17#include <linux/config.h>
18 17
19/* 18/*
20 * This assumes you have a 1.8432 MHz clock for your UART. 19 * This assumes you have a 1.8432 MHz clock for your UART.
diff --git a/include/asm-arm26/smp.h b/include/asm-arm26/smp.h
index 5ca771631fd8..38349ec8b61b 100644
--- a/include/asm-arm26/smp.h
+++ b/include/asm-arm26/smp.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SMP_H 1#ifndef __ASM_SMP_H
2#define __ASM_SMP_H 2#define __ASM_SMP_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_SMP 5#ifdef CONFIG_SMP
7#error SMP not supported 6#error SMP not supported
diff --git a/include/asm-arm26/sysirq.h b/include/asm-arm26/sysirq.h
index cad250c7b9ec..81dca90d9a3f 100644
--- a/include/asm-arm26/sysirq.h
+++ b/include/asm-arm26/sysirq.h
@@ -11,7 +11,6 @@
11 * 04-04-1998 PJB Merged arc and a5k versions 11 * 04-04-1998 PJB Merged arc and a5k versions
12 */ 12 */
13 13
14#include <linux/config.h>
15 14
16#if defined(CONFIG_ARCH_A5K) 15#if defined(CONFIG_ARCH_A5K)
17#define IRQ_PRINTER 0 16#define IRQ_PRINTER 0
diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h
index 702884926a55..d1f69d706198 100644
--- a/include/asm-arm26/system.h
+++ b/include/asm-arm26/system.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7 6
8/* 7/*
9 * This is used to ensure the compiler did actually allocate the register we 8 * This is used to ensure the compiler did actually allocate the register we
diff --git a/include/asm-arm26/unistd.h b/include/asm-arm26/unistd.h
index be4c2fb9c049..70eb6d91cfd0 100644
--- a/include/asm-arm26/unistd.h
+++ b/include/asm-arm26/unistd.h
@@ -14,8 +14,6 @@
14#ifndef __ASM_ARM_UNISTD_H 14#ifndef __ASM_ARM_UNISTD_H
15#define __ASM_ARM_UNISTD_H 15#define __ASM_ARM_UNISTD_H
16 16
17#include <linux/linkage.h>
18
19#define __NR_SYSCALL_BASE 0x900000 17#define __NR_SYSCALL_BASE 0x900000
20 18
21/* 19/*
@@ -312,6 +310,9 @@
312#define __ARM_NR_cacheflush (__ARM_NR_BASE+2) 310#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
313#define __ARM_NR_usr26 (__ARM_NR_BASE+3) 311#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
314 312
313#ifdef __KERNEL__
314#include <linux/linkage.h>
315
315#define __sys2(x) #x 316#define __sys2(x) #x
316#define __sys1(x) __sys2(x) 317#define __sys1(x) __sys2(x)
317 318
@@ -443,7 +444,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
443 __syscall_return(type,__res); \ 444 __syscall_return(type,__res); \
444} 445}
445 446
446#ifdef __KERNEL__
447#define __ARCH_WANT_IPC_PARSE_VERSION 447#define __ARCH_WANT_IPC_PARSE_VERSION
448#define __ARCH_WANT_OLD_READDIR 448#define __ARCH_WANT_OLD_READDIR
449#define __ARCH_WANT_STAT64 449#define __ARCH_WANT_STAT64
@@ -462,7 +462,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
462#define __ARCH_WANT_SYS_SIGPENDING 462#define __ARCH_WANT_SYS_SIGPENDING
463#define __ARCH_WANT_SYS_SIGPROCMASK 463#define __ARCH_WANT_SYS_SIGPROCMASK
464#define __ARCH_WANT_SYS_RT_SIGACTION 464#define __ARCH_WANT_SYS_RT_SIGACTION
465#endif
466 465
467#ifdef __KERNEL_SYSCALLS__ 466#ifdef __KERNEL_SYSCALLS__
468 467
@@ -486,7 +485,7 @@ asmlinkage long sys_rt_sigaction(int sig,
486 struct sigaction __user *oact, 485 struct sigaction __user *oact,
487 size_t sigsetsize); 486 size_t sigsetsize);
488 487
489#endif 488#endif /* __KERNEL_SYSCALLS__ */
490 489
491/* 490/*
492 * "Conditional" syscalls 491 * "Conditional" syscalls
@@ -496,4 +495,5 @@ asmlinkage long sys_rt_sigaction(int sig,
496 */ 495 */
497#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 496#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
498 497
498#endif /* __KERNEL__ */
499#endif /* __ASM_ARM_UNISTD_H */ 499#endif /* __ASM_ARM_UNISTD_H */
diff --git a/include/asm-cris/arch-v10/io.h b/include/asm-cris/arch-v10/io.h
index dd39198ec67d..11ef5b53d84e 100644
--- a/include/asm-cris/arch-v10/io.h
+++ b/include/asm-cris/arch-v10/io.h
@@ -2,7 +2,6 @@
2#define _ASM_ARCH_CRIS_IO_H 2#define _ASM_ARCH_CRIS_IO_H
3 3
4#include <asm/arch/svinto.h> 4#include <asm/arch/svinto.h>
5#include <linux/config.h>
6 5
7/* Etrax shadow registers - which live in arch/cris/kernel/shadows.c */ 6/* Etrax shadow registers - which live in arch/cris/kernel/shadows.c */
8 7
diff --git a/include/asm-cris/arch-v10/page.h b/include/asm-cris/arch-v10/page.h
index 407e6e68f49e..7d8307aed7f3 100644
--- a/include/asm-cris/arch-v10/page.h
+++ b/include/asm-cris/arch-v10/page.h
@@ -1,7 +1,6 @@
1#ifndef _CRIS_ARCH_PAGE_H 1#ifndef _CRIS_ARCH_PAGE_H
2#define _CRIS_ARCH_PAGE_H 2#define _CRIS_ARCH_PAGE_H
3 3
4#include <linux/config.h>
5 4
6#ifdef __KERNEL__ 5#ifdef __KERNEL__
7 6
diff --git a/include/asm-cris/arch-v10/system.h b/include/asm-cris/arch-v10/system.h
index 1ac7b639b1b0..4a9cd36c9e16 100644
--- a/include/asm-cris/arch-v10/system.h
+++ b/include/asm-cris/arch-v10/system.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_CRIS_ARCH_SYSTEM_H 1#ifndef __ASM_CRIS_ARCH_SYSTEM_H
2#define __ASM_CRIS_ARCH_SYSTEM_H 2#define __ASM_CRIS_ARCH_SYSTEM_H
3 3
4#include <linux/config.h>
5 4
6/* read the CPU version register */ 5/* read the CPU version register */
7 6
diff --git a/include/asm-cris/arch-v32/io.h b/include/asm-cris/arch-v32/io.h
index 043c9ce5294e..5efe4d949001 100644
--- a/include/asm-cris/arch-v32/io.h
+++ b/include/asm-cris/arch-v32/io.h
@@ -4,7 +4,6 @@
4#include <asm/arch/hwregs/reg_map.h> 4#include <asm/arch/hwregs/reg_map.h>
5#include <asm/arch/hwregs/reg_rdwr.h> 5#include <asm/arch/hwregs/reg_rdwr.h>
6#include <asm/arch/hwregs/gio_defs.h> 6#include <asm/arch/hwregs/gio_defs.h>
7#include <linux/config.h>
8 7
9enum crisv32_io_dir 8enum crisv32_io_dir
10{ 9{
diff --git a/include/asm-cris/arch-v32/irq.h b/include/asm-cris/arch-v32/irq.h
index d35aa8174c2f..eeb0a80262c8 100644
--- a/include/asm-cris/arch-v32/irq.h
+++ b/include/asm-cris/arch-v32/irq.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_ARCH_IRQ_H 1#ifndef _ASM_ARCH_IRQ_H
2#define _ASM_ARCH_IRQ_H 2#define _ASM_ARCH_IRQ_H
3 3
4#include <linux/config.h>
5#include "hwregs/intr_vect.h" 4#include "hwregs/intr_vect.h"
6 5
7/* Number of non-cpu interrupts. */ 6/* Number of non-cpu interrupts. */
diff --git a/include/asm-cris/arch-v32/page.h b/include/asm-cris/arch-v32/page.h
index 77827bc17cca..fa454fe12425 100644
--- a/include/asm-cris/arch-v32/page.h
+++ b/include/asm-cris/arch-v32/page.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_CRIS_ARCH_PAGE_H 1#ifndef _ASM_CRIS_ARCH_PAGE_H
2#define _ASM_CRIS_ARCH_PAGE_H 2#define _ASM_CRIS_ARCH_PAGE_H
3 3
4#include <linux/config.h>
5 4
6#ifdef __KERNEL__ 5#ifdef __KERNEL__
7 6
diff --git a/include/asm-cris/arch-v32/processor.h b/include/asm-cris/arch-v32/processor.h
index 32bf2e538ced..5553b0cd02bf 100644
--- a/include/asm-cris/arch-v32/processor.h
+++ b/include/asm-cris/arch-v32/processor.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_CRIS_ARCH_PROCESSOR_H 1#ifndef _ASM_CRIS_ARCH_PROCESSOR_H
2#define _ASM_CRIS_ARCH_PROCESSOR_H 2#define _ASM_CRIS_ARCH_PROCESSOR_H
3 3
4#include <linux/config.h>
5 4
6/* Return current instruction pointer. */ 5/* Return current instruction pointer. */
7#define current_text_addr() \ 6#define current_text_addr() \
diff --git a/include/asm-cris/arch-v32/system.h b/include/asm-cris/arch-v32/system.h
index a3d75d581e2f..d20e2d6d64a3 100644
--- a/include/asm-cris/arch-v32/system.h
+++ b/include/asm-cris/arch-v32/system.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_CRIS_ARCH_SYSTEM_H 1#ifndef _ASM_CRIS_ARCH_SYSTEM_H
2#define _ASM_CRIS_ARCH_SYSTEM_H 2#define _ASM_CRIS_ARCH_SYSTEM_H
3 3
4#include <linux/config.h>
5 4
6/* Read the CPU version register. */ 5/* Read the CPU version register. */
7static inline unsigned long rdvr(void) 6static inline unsigned long rdvr(void)
diff --git a/include/asm-cris/eshlibld.h b/include/asm-cris/eshlibld.h
index 2b577cde17eb..10ce36cf79a9 100644
--- a/include/asm-cris/eshlibld.h
+++ b/include/asm-cris/eshlibld.h
@@ -32,7 +32,6 @@
32/* We have dependencies all over the place for the host system 32/* We have dependencies all over the place for the host system
33 for xsim being a linux system, so let's not pretend anything 33 for xsim being a linux system, so let's not pretend anything
34 else with #ifdef:s here until fixed. */ 34 else with #ifdef:s here until fixed. */
35#include <linux/config.h>
36#include <linux/limits.h> 35#include <linux/limits.h>
37 36
38/* Maybe do sanity checking if file input. */ 37/* Maybe do sanity checking if file input. */
diff --git a/include/asm-cris/etraxgpio.h b/include/asm-cris/etraxgpio.h
index 80ee10f70d43..5d0028dba7c6 100644
--- a/include/asm-cris/etraxgpio.h
+++ b/include/asm-cris/etraxgpio.h
@@ -25,7 +25,6 @@
25#ifndef _ASM_ETRAXGPIO_H 25#ifndef _ASM_ETRAXGPIO_H
26#define _ASM_ETRAXGPIO_H 26#define _ASM_ETRAXGPIO_H
27 27
28#include <linux/config.h>
29/* etraxgpio _IOC_TYPE, bits 8 to 15 in ioctl cmd */ 28/* etraxgpio _IOC_TYPE, bits 8 to 15 in ioctl cmd */
30#ifdef CONFIG_ETRAX_ARCH_V10 29#ifdef CONFIG_ETRAX_ARCH_V10
31#define ETRAXGPIO_IOCTYPE 43 30#define ETRAXGPIO_IOCTYPE 43
diff --git a/include/asm-cris/fasttimer.h b/include/asm-cris/fasttimer.h
index 69522028baa5..a3a77132ce32 100644
--- a/include/asm-cris/fasttimer.h
+++ b/include/asm-cris/fasttimer.h
@@ -5,7 +5,6 @@
5 * This may be useful in other OS than Linux so use 2 space indentation... 5 * This may be useful in other OS than Linux so use 2 space indentation...
6 * Copyright (C) 2000, 2002 Axis Communications AB 6 * Copyright (C) 2000, 2002 Axis Communications AB
7 */ 7 */
8#include <linux/config.h>
9#include <linux/time.h> /* struct timeval */ 8#include <linux/time.h> /* struct timeval */
10#include <linux/timex.h> 9#include <linux/timex.h>
11 10
diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h
index 3787633e6209..81832e9e157f 100644
--- a/include/asm-cris/page.h
+++ b/include/asm-cris/page.h
@@ -1,7 +1,6 @@
1#ifndef _CRIS_PAGE_H 1#ifndef _CRIS_PAGE_H
2#define _CRIS_PAGE_H 2#define _CRIS_PAGE_H
3 3
4#include <linux/config.h>
5#include <asm/arch/page.h> 4#include <asm/arch/page.h>
6 5
7/* PAGE_SHIFT determines the page size */ 6/* PAGE_SHIFT determines the page size */
diff --git a/include/asm-cris/pci.h b/include/asm-cris/pci.h
index 2064bc1de074..b2ac8a331da1 100644
--- a/include/asm-cris/pci.h
+++ b/include/asm-cris/pci.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_CRIS_PCI_H 1#ifndef __ASM_CRIS_PCI_H
2#define __ASM_CRIS_PCI_H 2#define __ASM_CRIS_PCI_H
3 3
4#include <linux/config.h>
5 4
6#ifdef __KERNEL__ 5#ifdef __KERNEL__
7#include <linux/mm.h> /* for struct page */ 6#include <linux/mm.h> /* for struct page */
diff --git a/include/asm-cris/pgtable.h b/include/asm-cris/pgtable.h
index 70a832514f62..5d76c1c0d6c9 100644
--- a/include/asm-cris/pgtable.h
+++ b/include/asm-cris/pgtable.h
@@ -9,7 +9,6 @@
9#include <asm-generic/pgtable-nopmd.h> 9#include <asm-generic/pgtable-nopmd.h>
10 10
11#ifndef __ASSEMBLY__ 11#ifndef __ASSEMBLY__
12#include <linux/config.h>
13#include <linux/sched.h> 12#include <linux/sched.h>
14#include <asm/mmu.h> 13#include <asm/mmu.h>
15#endif 14#endif
diff --git a/include/asm-cris/processor.h b/include/asm-cris/processor.h
index 961e2bceadbc..568da1deceb9 100644
--- a/include/asm-cris/processor.h
+++ b/include/asm-cris/processor.h
@@ -10,7 +10,6 @@
10#ifndef __ASM_CRIS_PROCESSOR_H 10#ifndef __ASM_CRIS_PROCESSOR_H
11#define __ASM_CRIS_PROCESSOR_H 11#define __ASM_CRIS_PROCESSOR_H
12 12
13#include <linux/config.h>
14#include <asm/system.h> 13#include <asm/system.h>
15#include <asm/page.h> 14#include <asm/page.h>
16#include <asm/ptrace.h> 15#include <asm/ptrace.h>
diff --git a/include/asm-cris/rtc.h b/include/asm-cris/rtc.h
index 97c13039834a..cb4bf9217fee 100644
--- a/include/asm-cris/rtc.h
+++ b/include/asm-cris/rtc.h
@@ -4,7 +4,6 @@
4#define __RTC_H__ 4#define __RTC_H__
5 5
6 6
7#include <linux/config.h>
8 7
9#ifdef CONFIG_ETRAX_DS1302 8#ifdef CONFIG_ETRAX_DS1302
10 /* Dallas DS1302 clock/calendar register numbers. */ 9 /* Dallas DS1302 clock/calendar register numbers. */
diff --git a/include/asm-cris/tlbflush.h b/include/asm-cris/tlbflush.h
index c52238005b55..0569612477e3 100644
--- a/include/asm-cris/tlbflush.h
+++ b/include/asm-cris/tlbflush.h
@@ -1,7 +1,6 @@
1#ifndef _CRIS_TLBFLUSH_H 1#ifndef _CRIS_TLBFLUSH_H
2#define _CRIS_TLBFLUSH_H 2#define _CRIS_TLBFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6#include <asm/processor.h> 5#include <asm/processor.h>
7#include <asm/pgtable.h> 6#include <asm/pgtable.h>
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h
index bb2dfe480213..c2954e90aa24 100644
--- a/include/asm-cris/unistd.h
+++ b/include/asm-cris/unistd.h
@@ -295,11 +295,11 @@
295#define __NR_request_key 287 295#define __NR_request_key 287
296#define __NR_keyctl 288 296#define __NR_keyctl 288
297 297
298#define NR_syscalls 289 298#ifdef __KERNEL__
299 299
300#define NR_syscalls 289
300 301
301 302
302#ifdef __KERNEL__
303#define __ARCH_WANT_IPC_PARSE_VERSION 303#define __ARCH_WANT_IPC_PARSE_VERSION
304#define __ARCH_WANT_OLD_READDIR 304#define __ARCH_WANT_OLD_READDIR
305#define __ARCH_WANT_OLD_STAT 305#define __ARCH_WANT_OLD_STAT
@@ -379,12 +379,10 @@ asmlinkage long sys_rt_sigaction(int sig,
379 * complaints. We don't want to use -fno-builtin, so just use a 379 * complaints. We don't want to use -fno-builtin, so just use a
380 * different name when in the kernel. 380 * different name when in the kernel.
381 */ 381 */
382#ifdef __KERNEL__
383#define _exit kernel_syscall_exit 382#define _exit kernel_syscall_exit
384#endif
385static inline _syscall1(int,_exit,int,exitcode) 383static inline _syscall1(int,_exit,int,exitcode)
386static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) 384static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
387#endif 385#endif /* __KERNEL_SYSCALLS__ */
388 386
389 387
390/* 388/*
@@ -395,4 +393,5 @@ static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
395 */ 393 */
396#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 394#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
397 395
396#endif /* __KERNEL__ */
398#endif /* _ASM_CRIS_UNISTD_H_ */ 397#endif /* _ASM_CRIS_UNISTD_H_ */
diff --git a/include/asm-frv/atomic.h b/include/asm-frv/atomic.h
index 5d9f84bfdcad..066386ac238e 100644
--- a/include/asm-frv/atomic.h
+++ b/include/asm-frv/atomic.h
@@ -14,7 +14,6 @@
14#ifndef _ASM_ATOMIC_H 14#ifndef _ASM_ATOMIC_H
15#define _ASM_ATOMIC_H 15#define _ASM_ATOMIC_H
16 16
17#include <linux/config.h>
18#include <linux/types.h> 17#include <linux/types.h>
19#include <asm/spr-regs.h> 18#include <asm/spr-regs.h>
20 19
@@ -228,7 +227,7 @@ extern unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsig
228 break; \ 227 break; \
229 \ 228 \
230 default: \ 229 default: \
231 __xg_orig = 0; \ 230 __xg_orig = (__typeof__(__xg_orig))0; \
232 asm volatile("break"); \ 231 asm volatile("break"); \
233 break; \ 232 break; \
234 } \ 233 } \
@@ -248,7 +247,7 @@ extern uint32_t __xchg_32(uint32_t i, volatile void *v);
248 switch (sizeof(__xg_orig)) { \ 247 switch (sizeof(__xg_orig)) { \
249 case 4: __xg_orig = (__typeof__(*(ptr))) __xchg_32((uint32_t) x, __xg_ptr); break; \ 248 case 4: __xg_orig = (__typeof__(*(ptr))) __xchg_32((uint32_t) x, __xg_ptr); break; \
250 default: \ 249 default: \
251 __xg_orig = 0; \ 250 __xg_orig = (__typeof__(__xg_orig))0; \
252 asm volatile("break"); \ 251 asm volatile("break"); \
253 break; \ 252 break; \
254 } \ 253 } \
diff --git a/include/asm-frv/bitops.h b/include/asm-frv/bitops.h
index 6344d06390b9..980ae1b0cd28 100644
--- a/include/asm-frv/bitops.h
+++ b/include/asm-frv/bitops.h
@@ -14,7 +14,6 @@
14#ifndef _ASM_BITOPS_H 14#ifndef _ASM_BITOPS_H
15#define _ASM_BITOPS_H 15#define _ASM_BITOPS_H
16 16
17#include <linux/config.h>
18#include <linux/compiler.h> 17#include <linux/compiler.h>
19#include <asm/byteorder.h> 18#include <asm/byteorder.h>
20#include <asm/system.h> 19#include <asm/system.h>
diff --git a/include/asm-frv/bug.h b/include/asm-frv/bug.h
index 451712cc3060..6b1b44d71028 100644
--- a/include/asm-frv/bug.h
+++ b/include/asm-frv/bug.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_BUG_H 11#ifndef _ASM_BUG_H
12#define _ASM_BUG_H 12#define _ASM_BUG_H
13 13
14#include <linux/config.h>
15#include <linux/linkage.h> 14#include <linux/linkage.h>
16 15
17#ifdef CONFIG_BUG 16#ifdef CONFIG_BUG
diff --git a/include/asm-frv/cache.h b/include/asm-frv/cache.h
index cf69b6373b34..2797163b8f4f 100644
--- a/include/asm-frv/cache.h
+++ b/include/asm-frv/cache.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_CACHE_H 12#ifndef __ASM_CACHE_H
13#define __ASM_CACHE_H 13#define __ASM_CACHE_H
14 14
15#include <linux/config.h>
16 15
17/* bytes per L1 cache line */ 16/* bytes per L1 cache line */
18#define L1_CACHE_SHIFT (CONFIG_FRV_L1_CACHE_SHIFT) 17#define L1_CACHE_SHIFT (CONFIG_FRV_L1_CACHE_SHIFT)
diff --git a/include/asm-frv/checksum.h b/include/asm-frv/checksum.h
index 10236f6802db..42bf0db2287a 100644
--- a/include/asm-frv/checksum.h
+++ b/include/asm-frv/checksum.h
@@ -43,7 +43,7 @@ unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum);
43 * here even more important to align src and dst on a 32-bit (or even 43 * here even more important to align src and dst on a 32-bit (or even
44 * better 64-bit) boundary 44 * better 64-bit) boundary
45 */ 45 */
46extern unsigned int csum_partial_copy_from_user(const char *src, char *dst, 46extern unsigned int csum_partial_copy_from_user(const char __user *src, char *dst,
47 int len, int sum, int *csum_err); 47 int len, int sum, int *csum_err);
48 48
49#define csum_partial_copy_nocheck(src, dst, len, sum) \ 49#define csum_partial_copy_nocheck(src, dst, len, sum) \
diff --git a/include/asm-frv/dma.h b/include/asm-frv/dma.h
index d8f9a2f21521..18d6bb8f84fc 100644
--- a/include/asm-frv/dma.h
+++ b/include/asm-frv/dma.h
@@ -14,7 +14,6 @@
14 14
15//#define DMA_DEBUG 1 15//#define DMA_DEBUG 1
16 16
17#include <linux/config.h>
18#include <linux/interrupt.h> 17#include <linux/interrupt.h>
19 18
20#undef MAX_DMA_CHANNELS /* don't use kernel/dma.c */ 19#undef MAX_DMA_CHANNELS /* don't use kernel/dma.c */
diff --git a/include/asm-frv/elf.h b/include/asm-frv/elf.h
index 7d2098f0476b..38656da00e40 100644
--- a/include/asm-frv/elf.h
+++ b/include/asm-frv/elf.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_ELF_H 12#ifndef __ASM_ELF_H
13#define __ASM_ELF_H 13#define __ASM_ELF_H
14 14
15#include <linux/config.h>
16#include <asm/ptrace.h> 15#include <asm/ptrace.h>
17#include <asm/user.h> 16#include <asm/user.h>
18 17
diff --git a/include/asm-frv/fpu.h b/include/asm-frv/fpu.h
index b1178f8ca5ce..d73c60b56641 100644
--- a/include/asm-frv/fpu.h
+++ b/include/asm-frv/fpu.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_FPU_H 1#ifndef __ASM_FPU_H
2#define __ASM_FPU_H 2#define __ASM_FPU_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * MAX floating point unit state size (FSAVE/FRESTORE) 6 * MAX floating point unit state size (FSAVE/FRESTORE)
diff --git a/include/asm-frv/hardirq.h b/include/asm-frv/hardirq.h
index 685123981e8b..7581b5a7559a 100644
--- a/include/asm-frv/hardirq.h
+++ b/include/asm-frv/hardirq.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_HARDIRQ_H 12#ifndef __ASM_HARDIRQ_H
13#define __ASM_HARDIRQ_H 13#define __ASM_HARDIRQ_H
14 14
15#include <linux/config.h>
16#include <linux/threads.h> 15#include <linux/threads.h>
17#include <linux/irq.h> 16#include <linux/irq.h>
18 17
diff --git a/include/asm-frv/highmem.h b/include/asm-frv/highmem.h
index 295f74a57f22..e2247c22a638 100644
--- a/include/asm-frv/highmem.h
+++ b/include/asm-frv/highmem.h
@@ -17,7 +17,6 @@
17 17
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19 19
20#include <linux/config.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <asm/mem-layout.h> 21#include <asm/mem-layout.h>
23#include <asm/spr-regs.h> 22#include <asm/spr-regs.h>
@@ -135,7 +134,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
135 134
136 default: 135 default:
137 BUG(); 136 BUG();
138 return 0; 137 return NULL;
139 } 138 }
140} 139}
141 140
diff --git a/include/asm-frv/ide.h b/include/asm-frv/ide.h
index ae031eaa3dd2..f0bd2cb250c1 100644
--- a/include/asm-frv/ide.h
+++ b/include/asm-frv/ide.h
@@ -14,7 +14,6 @@
14 14
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16 16
17#include <linux/config.h>
18#include <asm/setup.h> 17#include <asm/setup.h>
19#include <asm/io.h> 18#include <asm/io.h>
20#include <asm/irq.h> 19#include <asm/irq.h>
diff --git a/include/asm-frv/io.h b/include/asm-frv/io.h
index 01247cb2bc39..7765f5528894 100644
--- a/include/asm-frv/io.h
+++ b/include/asm-frv/io.h
@@ -17,7 +17,6 @@
17 17
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19 19
20#include <linux/config.h>
21#include <linux/types.h> 20#include <linux/types.h>
22#include <asm/virtconvert.h> 21#include <asm/virtconvert.h>
23#include <asm/string.h> 22#include <asm/string.h>
@@ -41,13 +40,13 @@ static inline unsigned long _swapl(unsigned long v)
41//#define __iormb() asm volatile("membar") 40//#define __iormb() asm volatile("membar")
42//#define __iowmb() asm volatile("membar") 41//#define __iowmb() asm volatile("membar")
43 42
44#define __raw_readb(addr) __builtin_read8((void *) (addr)) 43#define __raw_readb __builtin_read8
45#define __raw_readw(addr) __builtin_read16((void *) (addr)) 44#define __raw_readw __builtin_read16
46#define __raw_readl(addr) __builtin_read32((void *) (addr)) 45#define __raw_readl __builtin_read32
47 46
48#define __raw_writeb(datum, addr) __builtin_write8((void *) (addr), datum) 47#define __raw_writeb(datum, addr) __builtin_write8(addr, datum)
49#define __raw_writew(datum, addr) __builtin_write16((void *) (addr), datum) 48#define __raw_writew(datum, addr) __builtin_write16(addr, datum)
50#define __raw_writel(datum, addr) __builtin_write32((void *) (addr), datum) 49#define __raw_writel(datum, addr) __builtin_write32(addr, datum)
51 50
52static inline void io_outsb(unsigned int addr, const void *buf, int len) 51static inline void io_outsb(unsigned int addr, const void *buf, int len)
53{ 52{
@@ -117,7 +116,7 @@ static inline void memset_io(volatile void __iomem *addr, unsigned char val, int
117 memset((void __force *) addr, val, count); 116 memset((void __force *) addr, val, count);
118} 117}
119 118
120static inline void memcpy_fromio(void *dst, volatile void __iomem *src, int count) 119static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
121{ 120{
122 memcpy(dst, (void __force *) src, count); 121 memcpy(dst, (void __force *) src, count);
123} 122}
@@ -129,12 +128,12 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
129 128
130static inline uint8_t inb(unsigned long addr) 129static inline uint8_t inb(unsigned long addr)
131{ 130{
132 return __builtin_read8((void *)addr); 131 return __builtin_read8((void __iomem *)addr);
133} 132}
134 133
135static inline uint16_t inw(unsigned long addr) 134static inline uint16_t inw(unsigned long addr)
136{ 135{
137 uint16_t ret = __builtin_read16((void *)addr); 136 uint16_t ret = __builtin_read16((void __iomem *)addr);
138 137
139 if (__is_PCI_IO(addr)) 138 if (__is_PCI_IO(addr))
140 ret = _swapw(ret); 139 ret = _swapw(ret);
@@ -144,7 +143,7 @@ static inline uint16_t inw(unsigned long addr)
144 143
145static inline uint32_t inl(unsigned long addr) 144static inline uint32_t inl(unsigned long addr)
146{ 145{
147 uint32_t ret = __builtin_read32((void *)addr); 146 uint32_t ret = __builtin_read32((void __iomem *)addr);
148 147
149 if (__is_PCI_IO(addr)) 148 if (__is_PCI_IO(addr))
150 ret = _swapl(ret); 149 ret = _swapl(ret);
@@ -154,21 +153,21 @@ static inline uint32_t inl(unsigned long addr)
154 153
155static inline void outb(uint8_t datum, unsigned long addr) 154static inline void outb(uint8_t datum, unsigned long addr)
156{ 155{
157 __builtin_write8((void *)addr, datum); 156 __builtin_write8((void __iomem *)addr, datum);
158} 157}
159 158
160static inline void outw(uint16_t datum, unsigned long addr) 159static inline void outw(uint16_t datum, unsigned long addr)
161{ 160{
162 if (__is_PCI_IO(addr)) 161 if (__is_PCI_IO(addr))
163 datum = _swapw(datum); 162 datum = _swapw(datum);
164 __builtin_write16((void *)addr, datum); 163 __builtin_write16((void __iomem *)addr, datum);
165} 164}
166 165
167static inline void outl(uint32_t datum, unsigned long addr) 166static inline void outl(uint32_t datum, unsigned long addr)
168{ 167{
169 if (__is_PCI_IO(addr)) 168 if (__is_PCI_IO(addr))
170 datum = _swapl(datum); 169 datum = _swapl(datum);
171 __builtin_write32((void *)addr, datum); 170 __builtin_write32((void __iomem *)addr, datum);
172} 171}
173 172
174#define inb_p(addr) inb(addr) 173#define inb_p(addr) inb(addr)
@@ -190,12 +189,12 @@ static inline void outl(uint32_t datum, unsigned long addr)
190 189
191static inline uint8_t readb(const volatile void __iomem *addr) 190static inline uint8_t readb(const volatile void __iomem *addr)
192{ 191{
193 return __builtin_read8((volatile uint8_t __force *) addr); 192 return __builtin_read8((__force void volatile __iomem *) addr);
194} 193}
195 194
196static inline uint16_t readw(const volatile void __iomem *addr) 195static inline uint16_t readw(const volatile void __iomem *addr)
197{ 196{
198 uint16_t ret = __builtin_read16((volatile uint16_t __force *)addr); 197 uint16_t ret = __builtin_read16((__force void volatile __iomem *)addr);
199 198
200 if (__is_PCI_MEM(addr)) 199 if (__is_PCI_MEM(addr))
201 ret = _swapw(ret); 200 ret = _swapw(ret);
@@ -204,7 +203,7 @@ static inline uint16_t readw(const volatile void __iomem *addr)
204 203
205static inline uint32_t readl(const volatile void __iomem *addr) 204static inline uint32_t readl(const volatile void __iomem *addr)
206{ 205{
207 uint32_t ret = __builtin_read32((volatile uint32_t __force *)addr); 206 uint32_t ret = __builtin_read32((__force void volatile __iomem *)addr);
208 207
209 if (__is_PCI_MEM(addr)) 208 if (__is_PCI_MEM(addr))
210 ret = _swapl(ret); 209 ret = _swapl(ret);
@@ -218,7 +217,7 @@ static inline uint32_t readl(const volatile void __iomem *addr)
218 217
219static inline void writeb(uint8_t datum, volatile void __iomem *addr) 218static inline void writeb(uint8_t datum, volatile void __iomem *addr)
220{ 219{
221 __builtin_write8((volatile uint8_t __force *) addr, datum); 220 __builtin_write8(addr, datum);
222 if (__is_PCI_MEM(addr)) 221 if (__is_PCI_MEM(addr))
223 __flush_PCI_writes(); 222 __flush_PCI_writes();
224} 223}
@@ -228,7 +227,7 @@ static inline void writew(uint16_t datum, volatile void __iomem *addr)
228 if (__is_PCI_MEM(addr)) 227 if (__is_PCI_MEM(addr))
229 datum = _swapw(datum); 228 datum = _swapw(datum);
230 229
231 __builtin_write16((volatile uint16_t __force *) addr, datum); 230 __builtin_write16(addr, datum);
232 if (__is_PCI_MEM(addr)) 231 if (__is_PCI_MEM(addr))
233 __flush_PCI_writes(); 232 __flush_PCI_writes();
234} 233}
@@ -238,7 +237,7 @@ static inline void writel(uint32_t datum, volatile void __iomem *addr)
238 if (__is_PCI_MEM(addr)) 237 if (__is_PCI_MEM(addr))
239 datum = _swapl(datum); 238 datum = _swapl(datum);
240 239
241 __builtin_write32((volatile uint32_t __force *) addr, datum); 240 __builtin_write32(addr, datum);
242 if (__is_PCI_MEM(addr)) 241 if (__is_PCI_MEM(addr))
243 __flush_PCI_writes(); 242 __flush_PCI_writes();
244} 243}
@@ -272,7 +271,7 @@ static inline void __iomem *ioremap_fullcache(unsigned long physaddr, unsigned l
272 return __ioremap(physaddr, size, IOMAP_FULL_CACHING); 271 return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
273} 272}
274 273
275extern void iounmap(void __iomem *addr); 274extern void iounmap(void volatile __iomem *addr);
276 275
277static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) 276static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
278{ 277{
diff --git a/include/asm-frv/irq.h b/include/asm-frv/irq.h
index 2c16d8dc02fd..58b619215a50 100644
--- a/include/asm-frv/irq.h
+++ b/include/asm-frv/irq.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_IRQ_H_ 12#ifndef _ASM_IRQ_H_
13#define _ASM_IRQ_H_ 13#define _ASM_IRQ_H_
14 14
15#include <linux/config.h>
16 15
17/* 16/*
18 * the system has an on-CPU PIC and another PIC on the FPGA and other PICs on other peripherals, 17 * the system has an on-CPU PIC and another PIC on the FPGA and other PICs on other peripherals,
diff --git a/include/asm-frv/mb-regs.h b/include/asm-frv/mb-regs.h
index 93fa732fb0cd..219e5f926f18 100644
--- a/include/asm-frv/mb-regs.h
+++ b/include/asm-frv/mb-regs.h
@@ -16,6 +16,17 @@
16#include <asm/sections.h> 16#include <asm/sections.h>
17#include <asm/mem-layout.h> 17#include <asm/mem-layout.h>
18 18
19#ifndef __ASSEMBLY__
20/* gcc builtins, annotated */
21
22unsigned long __builtin_read8(volatile void __iomem *);
23unsigned long __builtin_read16(volatile void __iomem *);
24unsigned long __builtin_read32(volatile void __iomem *);
25void __builtin_write8(volatile void __iomem *, unsigned char);
26void __builtin_write16(volatile void __iomem *, unsigned short);
27void __builtin_write32(volatile void __iomem *, unsigned long);
28#endif
29
19#define __region_IO KERNEL_IO_START /* the region from 0xe0000000 to 0xffffffff has suitable 30#define __region_IO KERNEL_IO_START /* the region from 0xe0000000 to 0xffffffff has suitable
20 * protection laid over the top for use in memory-mapped 31 * protection laid over the top for use in memory-mapped
21 * I/O 32 * I/O
@@ -59,7 +70,7 @@
59#define __region_PCI_MEM (__region_CS2 + 0x08000000UL) 70#define __region_PCI_MEM (__region_CS2 + 0x08000000UL)
60#define __flush_PCI_writes() \ 71#define __flush_PCI_writes() \
61do { \ 72do { \
62 __builtin_write8((volatile void *) __region_PCI_MEM, 0); \ 73 __builtin_write8((volatile void __iomem *) __region_PCI_MEM, 0); \
63} while(0) 74} while(0)
64 75
65#define __is_PCI_IO(addr) \ 76#define __is_PCI_IO(addr) \
@@ -83,15 +94,15 @@ extern int __nongprelbss mb93090_mb00_detected;
83#define __set_LEDS(X) \ 94#define __set_LEDS(X) \
84do { \ 95do { \
85 if (mb93090_mb00_detected) \ 96 if (mb93090_mb00_detected) \
86 __builtin_write32((void *) __addr_LEDS(), ~(X)); \ 97 __builtin_write32((void __iomem *) __addr_LEDS(), ~(X)); \
87} while (0) 98} while (0)
88#else 99#else
89#define __set_LEDS(X) 100#define __set_LEDS(X)
90#endif 101#endif
91 102
92#define __addr_LCD() (__region_CS2 + 0x01200008UL) 103#define __addr_LCD() (__region_CS2 + 0x01200008UL)
93#define __get_LCD(B) __builtin_read32((volatile void *) (B)) 104#define __get_LCD(B) __builtin_read32((volatile void __iomem *) (B))
94#define __set_LCD(B,X) __builtin_write32((volatile void *) (B), (X)) 105#define __set_LCD(B,X) __builtin_write32((volatile void __iomem *) (B), (X))
95 106
96#define LCD_D 0x000000ff /* LCD data bus */ 107#define LCD_D 0x000000ff /* LCD data bus */
97#define LCD_RW 0x00000100 /* LCD R/W signal */ 108#define LCD_RW 0x00000100 /* LCD R/W signal */
@@ -161,11 +172,11 @@ do { \
161#define __get_CLKIN() 66000000UL 172#define __get_CLKIN() 66000000UL
162 173
163#define __addr_LEDS() (__region_CS2 + 0x00000023UL) 174#define __addr_LEDS() (__region_CS2 + 0x00000023UL)
164#define __set_LEDS(X) __builtin_write8((volatile void *) __addr_LEDS(), (X)) 175#define __set_LEDS(X) __builtin_write8((volatile void __iomem *) __addr_LEDS(), (X))
165 176
166#define __addr_FPGATR() (__region_CS2 + 0x00000030UL) 177#define __addr_FPGATR() (__region_CS2 + 0x00000030UL)
167#define __set_FPGATR(X) __builtin_write32((volatile void *) __addr_FPGATR(), (X)) 178#define __set_FPGATR(X) __builtin_write32((volatile void __iomem *) __addr_FPGATR(), (X))
168#define __get_FPGATR() __builtin_read32((volatile void *) __addr_FPGATR()) 179#define __get_FPGATR() __builtin_read32((volatile void __iomem *) __addr_FPGATR())
169 180
170#define MB93093_FPGA_FPGATR_AUDIO_CLK 0x00000003 181#define MB93093_FPGA_FPGATR_AUDIO_CLK 0x00000003
171 182
@@ -180,7 +191,7 @@ do { \
180#define MB93093_FPGA_SWR_PUSHSWMASK (0x1F<<26) 191#define MB93093_FPGA_SWR_PUSHSWMASK (0x1F<<26)
181#define MB93093_FPGA_SWR_PUSHSW4 (1<<29) 192#define MB93093_FPGA_SWR_PUSHSW4 (1<<29)
182 193
183#define __addr_FPGA_SWR ((volatile void *)(__region_CS2 + 0x28UL)) 194#define __addr_FPGA_SWR ((volatile void __iomem *)(__region_CS2 + 0x28UL))
184#define __get_FPGA_PUSHSW1_5() (__builtin_read32(__addr_FPGA_SWR) & MB93093_FPGA_SWR_PUSHSWMASK) 195#define __get_FPGA_PUSHSW1_5() (__builtin_read32(__addr_FPGA_SWR) & MB93093_FPGA_SWR_PUSHSWMASK)
185 196
186 197
diff --git a/include/asm-frv/mmu_context.h b/include/asm-frv/mmu_context.h
index 4fb9ea3c5bc9..72edcaaccd5d 100644
--- a/include/asm-frv/mmu_context.h
+++ b/include/asm-frv/mmu_context.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_MMU_CONTEXT_H 12#ifndef _ASM_MMU_CONTEXT_H
13#define _ASM_MMU_CONTEXT_H 13#define _ASM_MMU_CONTEXT_H
14 14
15#include <linux/config.h>
16#include <asm/setup.h> 15#include <asm/setup.h>
17#include <asm/page.h> 16#include <asm/page.h>
18#include <asm/pgalloc.h> 17#include <asm/pgalloc.h>
diff --git a/include/asm-frv/page.h b/include/asm-frv/page.h
index dc0f7e08a4c2..134cc0cdf6c2 100644
--- a/include/asm-frv/page.h
+++ b/include/asm-frv/page.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7#include <asm/virtconvert.h> 6#include <asm/virtconvert.h>
8#include <asm/mem-layout.h> 7#include <asm/mem-layout.h>
9#include <asm/sections.h> 8#include <asm/sections.h>
diff --git a/include/asm-frv/pci.h b/include/asm-frv/pci.h
index 598b0c6b695d..f35a4511e7b9 100644
--- a/include/asm-frv/pci.h
+++ b/include/asm-frv/pci.h
@@ -13,7 +13,6 @@
13#ifndef ASM_PCI_H 13#ifndef ASM_PCI_H
14#define ASM_PCI_H 14#define ASM_PCI_H
15 15
16#include <linux/config.h>
17#include <linux/mm.h> 16#include <linux/mm.h>
18#include <asm/scatterlist.h> 17#include <asm/scatterlist.h>
19#include <asm-generic/pci-dma-compat.h> 18#include <asm-generic/pci-dma-compat.h>
diff --git a/include/asm-frv/pgalloc.h b/include/asm-frv/pgalloc.h
index 1bd28f41bfa8..ce982a6c610f 100644
--- a/include/asm-frv/pgalloc.h
+++ b/include/asm-frv/pgalloc.h
@@ -15,7 +15,6 @@
15#ifndef _ASM_PGALLOC_H 15#ifndef _ASM_PGALLOC_H
16#define _ASM_PGALLOC_H 16#define _ASM_PGALLOC_H
17 17
18#include <linux/config.h>
19#include <asm/setup.h> 18#include <asm/setup.h>
20#include <asm/virtconvert.h> 19#include <asm/virtconvert.h>
21 20
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h
index d1c3b182c691..7af7485e889e 100644
--- a/include/asm-frv/pgtable.h
+++ b/include/asm-frv/pgtable.h
@@ -16,7 +16,6 @@
16#ifndef _ASM_PGTABLE_H 16#ifndef _ASM_PGTABLE_H
17#define _ASM_PGTABLE_H 17#define _ASM_PGTABLE_H
18 18
19#include <linux/config.h>
20#include <asm/mem-layout.h> 19#include <asm/mem-layout.h>
21#include <asm/setup.h> 20#include <asm/setup.h>
22#include <asm/processor.h> 21#include <asm/processor.h>
diff --git a/include/asm-frv/processor.h b/include/asm-frv/processor.h
index 5228c18b7f78..1c4dba1c5f57 100644
--- a/include/asm-frv/processor.h
+++ b/include/asm-frv/processor.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_PROCESSOR_H 12#ifndef _ASM_PROCESSOR_H
13#define _ASM_PROCESSOR_H 13#define _ASM_PROCESSOR_H
14 14
15#include <linux/config.h>
16#include <asm/mem-layout.h> 15#include <asm/mem-layout.h>
17 16
18#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
diff --git a/include/asm-frv/segment.h b/include/asm-frv/segment.h
index 61222f00dfc1..e3616a6f941d 100644
--- a/include/asm-frv/segment.h
+++ b/include/asm-frv/segment.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_SEGMENT_H 12#ifndef _ASM_SEGMENT_H
13#define _ASM_SEGMENT_H 13#define _ASM_SEGMENT_H
14 14
15#include <linux/config.h>
16 15
17#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
18 17
diff --git a/include/asm-frv/serial.h b/include/asm-frv/serial.h
index 6917d556a1e1..dbb825998689 100644
--- a/include/asm-frv/serial.h
+++ b/include/asm-frv/serial.h
@@ -6,7 +6,6 @@
6 * 6 *
7 * Based on linux/include/asm-i386/serial.h 7 * Based on linux/include/asm-i386/serial.h
8 */ 8 */
9#include <linux/config.h>
10#include <asm/serial-regs.h> 9#include <asm/serial-regs.h>
11 10
12/* 11/*
diff --git a/include/asm-frv/signal.h b/include/asm-frv/signal.h
index 67366894780f..dcc1b3592918 100644
--- a/include/asm-frv/signal.h
+++ b/include/asm-frv/signal.h
@@ -114,13 +114,13 @@ struct old_sigaction {
114 __sighandler_t sa_handler; 114 __sighandler_t sa_handler;
115 old_sigset_t sa_mask; 115 old_sigset_t sa_mask;
116 unsigned long sa_flags; 116 unsigned long sa_flags;
117 void (*sa_restorer)(void); 117 __sigrestore_t sa_restorer;
118}; 118};
119 119
120struct sigaction { 120struct sigaction {
121 __sighandler_t sa_handler; 121 __sighandler_t sa_handler;
122 unsigned long sa_flags; 122 unsigned long sa_flags;
123 void (*sa_restorer)(void); 123 __sigrestore_t sa_restorer;
124 sigset_t sa_mask; /* mask last for extensibility */ 124 sigset_t sa_mask; /* mask last for extensibility */
125}; 125};
126 126
@@ -146,7 +146,7 @@ struct sigaction {
146#endif /* __KERNEL__ */ 146#endif /* __KERNEL__ */
147 147
148typedef struct sigaltstack { 148typedef struct sigaltstack {
149 void *ss_sp; 149 void __user *ss_sp;
150 int ss_flags; 150 int ss_flags;
151 size_t ss_size; 151 size_t ss_size;
152} stack_t; 152} stack_t;
diff --git a/include/asm-frv/smp.h b/include/asm-frv/smp.h
index 5ca771631fd8..38349ec8b61b 100644
--- a/include/asm-frv/smp.h
+++ b/include/asm-frv/smp.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SMP_H 1#ifndef __ASM_SMP_H
2#define __ASM_SMP_H 2#define __ASM_SMP_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_SMP 5#ifdef CONFIG_SMP
7#error SMP not supported 6#error SMP not supported
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h
index 1734ed91bcdc..351863dfd06e 100644
--- a/include/asm-frv/system.h
+++ b/include/asm-frv/system.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_SYSTEM_H 12#ifndef _ASM_SYSTEM_H
13#define _ASM_SYSTEM_H 13#define _ASM_SYSTEM_H
14 14
15#include <linux/config.h> /* get configuration macros */
16#include <linux/linkage.h> 15#include <linux/linkage.h>
17#include <asm/atomic.h> 16#include <asm/atomic.h>
18 17
diff --git a/include/asm-frv/tlbflush.h b/include/asm-frv/tlbflush.h
index bc3462625084..da3a3179a85d 100644
--- a/include/asm-frv/tlbflush.h
+++ b/include/asm-frv/tlbflush.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_TLBFLUSH_H 12#ifndef _ASM_TLBFLUSH_H
13#define _ASM_TLBFLUSH_H 13#define _ASM_TLBFLUSH_H
14 14
15#include <linux/config.h>
16#include <linux/mm.h> 15#include <linux/mm.h>
17#include <asm/processor.h> 16#include <asm/processor.h>
18 17
diff --git a/include/asm-frv/types.h b/include/asm-frv/types.h
index 2560f596a75d..1b6d1923b25b 100644
--- a/include/asm-frv/types.h
+++ b/include/asm-frv/types.h
@@ -46,7 +46,6 @@ typedef unsigned long long __u64;
46 46
47#ifndef __ASSEMBLY__ 47#ifndef __ASSEMBLY__
48 48
49#include <linux/config.h>
50 49
51typedef signed char s8; 50typedef signed char s8;
52typedef unsigned char u8; 51typedef unsigned char u8;
diff --git a/include/asm-frv/uaccess.h b/include/asm-frv/uaccess.h
index a1d140438863..3d90e1018ee2 100644
--- a/include/asm-frv/uaccess.h
+++ b/include/asm-frv/uaccess.h
@@ -22,7 +22,7 @@
22 22
23#define HAVE_ARCH_UNMAPPED_AREA /* we decide where to put mmaps */ 23#define HAVE_ARCH_UNMAPPED_AREA /* we decide where to put mmaps */
24 24
25#define __ptr(x) ((unsigned long *)(x)) 25#define __ptr(x) ((unsigned long __force *)(x))
26 26
27#define VERIFY_READ 0 27#define VERIFY_READ 0
28#define VERIFY_WRITE 1 28#define VERIFY_WRITE 1
@@ -64,7 +64,7 @@ static inline int ___range_ok(unsigned long addr, unsigned long size)
64 64
65#define __range_ok(addr,size) ___range_ok((unsigned long) (addr), (unsigned long) (size)) 65#define __range_ok(addr,size) ___range_ok((unsigned long) (addr), (unsigned long) (size))
66 66
67#define access_ok(type,addr,size) (__range_ok((addr), (size)) == 0) 67#define access_ok(type,addr,size) (__range_ok((void __user *)(addr), (size)) == 0)
68#define __access_ok(addr,size) (__range_ok((addr), (size)) == 0) 68#define __access_ok(addr,size) (__range_ok((addr), (size)) == 0)
69 69
70/* 70/*
@@ -97,6 +97,7 @@ extern unsigned long search_exception_table(unsigned long);
97 int __pu_err = 0; \ 97 int __pu_err = 0; \
98 \ 98 \
99 typeof(*(ptr)) __pu_val = (x); \ 99 typeof(*(ptr)) __pu_val = (x); \
100 __chk_user_ptr(ptr); \
100 \ 101 \
101 switch (sizeof (*(ptr))) { \ 102 switch (sizeof (*(ptr))) { \
102 case 1: \ 103 case 1: \
@@ -120,7 +121,7 @@ extern unsigned long search_exception_table(unsigned long);
120 121
121#define put_user(x, ptr) \ 122#define put_user(x, ptr) \
122({ \ 123({ \
123 typeof(&*ptr) _p = (ptr); \ 124 typeof(*(ptr)) __user *_p = (ptr); \
124 int _e; \ 125 int _e; \
125 \ 126 \
126 _e = __range_ok(_p, sizeof(*_p)); \ 127 _e = __range_ok(_p, sizeof(*_p)); \
@@ -175,33 +176,44 @@ do { \
175 */ 176 */
176#define __get_user(x, ptr) \ 177#define __get_user(x, ptr) \
177({ \ 178({ \
178 typeof(*(ptr)) __gu_val = 0; \
179 int __gu_err = 0; \ 179 int __gu_err = 0; \
180 __chk_user_ptr(ptr); \
180 \ 181 \
181 switch (sizeof(*(ptr))) { \ 182 switch (sizeof(*(ptr))) { \
182 case 1: \ 183 case 1: { \
183 __get_user_asm(__gu_err, *(u8*)&__gu_val, ptr, "ub", "=r"); \ 184 unsigned char __gu_val; \
185 __get_user_asm(__gu_err, __gu_val, ptr, "ub", "=r"); \
186 (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \
184 break; \ 187 break; \
185 case 2: \ 188 } \
186 __get_user_asm(__gu_err, *(u16*)&__gu_val, ptr, "uh", "=r"); \ 189 case 2: { \
190 unsigned short __gu_val; \
191 __get_user_asm(__gu_err, __gu_val, ptr, "uh", "=r"); \
192 (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \
187 break; \ 193 break; \
188 case 4: \ 194 } \
189 __get_user_asm(__gu_err, *(u32*)&__gu_val, ptr, "", "=r"); \ 195 case 4: { \
196 unsigned int __gu_val; \
197 __get_user_asm(__gu_err, __gu_val, ptr, "", "=r"); \
198 (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \
190 break; \ 199 break; \
191 case 8: \ 200 } \
192 __get_user_asm(__gu_err, *(u64*)&__gu_val, ptr, "d", "=e"); \ 201 case 8: { \
202 unsigned long long __gu_val; \
203 __get_user_asm(__gu_err, __gu_val, ptr, "d", "=e"); \
204 (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \
193 break; \ 205 break; \
206 } \
194 default: \ 207 default: \
195 __gu_err = __get_user_bad(); \ 208 __gu_err = __get_user_bad(); \
196 break; \ 209 break; \
197 } \ 210 } \
198 (x) = __gu_val; \
199 __gu_err; \ 211 __gu_err; \
200}) 212})
201 213
202#define get_user(x, ptr) \ 214#define get_user(x, ptr) \
203({ \ 215({ \
204 typeof(&*ptr) _p = (ptr); \ 216 const typeof(*(ptr)) __user *_p = (ptr);\
205 int _e; \ 217 int _e; \
206 \ 218 \
207 _e = __range_ok(_p, sizeof(*_p)); \ 219 _e = __range_ok(_p, sizeof(*_p)); \
@@ -248,19 +260,20 @@ do { \
248/* 260/*
249 * 261 *
250 */ 262 */
263#define ____force(x) (__force void *)(void __user *)(x)
251#ifdef CONFIG_MMU 264#ifdef CONFIG_MMU
252extern long __memset_user(void *dst, unsigned long count); 265extern long __memset_user(void *dst, unsigned long count);
253extern long __memcpy_user(void *dst, const void *src, unsigned long count); 266extern long __memcpy_user(void *dst, const void *src, unsigned long count);
254 267
255#define clear_user(dst,count) __memset_user((dst), (count)) 268#define clear_user(dst,count) __memset_user(____force(dst), (count))
256#define __copy_from_user_inatomic(to, from, n) __memcpy_user((to), (from), (n)) 269#define __copy_from_user_inatomic(to, from, n) __memcpy_user((to), ____force(from), (n))
257#define __copy_to_user_inatomic(to, from, n) __memcpy_user((to), (from), (n)) 270#define __copy_to_user_inatomic(to, from, n) __memcpy_user(____force(to), (from), (n))
258 271
259#else 272#else
260 273
261#define clear_user(dst,count) (memset((dst), 0, (count)), 0) 274#define clear_user(dst,count) (memset(____force(dst), 0, (count)), 0)
262#define __copy_from_user_inatomic(to, from, n) (memcpy((to), (from), (n)), 0) 275#define __copy_from_user_inatomic(to, from, n) (memcpy((to), ____force(from), (n)), 0)
263#define __copy_to_user_inatomic(to, from, n) (memcpy((to), (from), (n)), 0) 276#define __copy_to_user_inatomic(to, from, n) (memcpy(____force(to), (from), (n)), 0)
264 277
265#endif 278#endif
266 279
@@ -278,7 +291,7 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)
278 return __copy_from_user_inatomic(to, from, n); 291 return __copy_from_user_inatomic(to, from, n);
279} 292}
280 293
281static inline long copy_from_user(void *to, const void *from, unsigned long n) 294static inline long copy_from_user(void *to, const void __user *from, unsigned long n)
282{ 295{
283 unsigned long ret = n; 296 unsigned long ret = n;
284 297
@@ -291,16 +304,13 @@ static inline long copy_from_user(void *to, const void *from, unsigned long n)
291 return ret; 304 return ret;
292} 305}
293 306
294static inline long copy_to_user(void *to, const void *from, unsigned long n) 307static inline long copy_to_user(void __user *to, const void *from, unsigned long n)
295{ 308{
296 return likely(__access_ok(to, n)) ? __copy_to_user(to, from, n) : n; 309 return likely(__access_ok(to, n)) ? __copy_to_user(to, from, n) : n;
297} 310}
298 311
299#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; }) 312extern long strncpy_from_user(char *dst, const char __user *src, long count);
300#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; }) 313extern long strnlen_user(const char __user *src, long count);
301
302extern long strncpy_from_user(char *dst, const char *src, long count);
303extern long strnlen_user(const char *src, long count);
304 314
305#define strlen_user(str) strnlen_user(str, 32767) 315#define strlen_user(str) strnlen_user(str, 32767)
306 316
diff --git a/include/asm-frv/unaligned.h b/include/asm-frv/unaligned.h
index a0d199bf01d9..dc8e9c9bf6bd 100644
--- a/include/asm-frv/unaligned.h
+++ b/include/asm-frv/unaligned.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_UNALIGNED_H 12#ifndef _ASM_UNALIGNED_H
13#define _ASM_UNALIGNED_H 13#define _ASM_UNALIGNED_H
14 14
15#include <linux/config.h>
16 15
17/* 16/*
18 * Unaligned accesses on uClinux can't be performed in a fault handler - the 17 * Unaligned accesses on uClinux can't be performed in a fault handler - the
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h
index 2662a3e12dc4..b80dbd839475 100644
--- a/include/asm-frv/unistd.h
+++ b/include/asm-frv/unistd.h
@@ -306,7 +306,7 @@
306#define __NR_mknodat 297 306#define __NR_mknodat 297
307#define __NR_fchownat 298 307#define __NR_fchownat 298
308#define __NR_futimesat 299 308#define __NR_futimesat 299
309#define __NR_newfstatat 300 309#define __NR_fstatat64 300
310#define __NR_unlinkat 301 310#define __NR_unlinkat 301
311#define __NR_renameat 302 311#define __NR_renameat 302
312#define __NR_linkat 303 312#define __NR_linkat 303
@@ -317,6 +317,8 @@
317#define __NR_pselect6 308 317#define __NR_pselect6 308
318#define __NR_ppoll 309 318#define __NR_ppoll 309
319 319
320#ifdef __KERNEL__
321
320#define NR_syscalls 310 322#define NR_syscalls 310
321 323
322/* 324/*
@@ -458,28 +460,10 @@ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg
458 * some others too. 460 * some others too.
459 */ 461 */
460#define __NR__exit __NR_exit 462#define __NR__exit __NR_exit
461static inline _syscall0(int,pause)
462static inline _syscall0(int,sync)
463static inline _syscall0(pid_t,setsid)
464static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
465static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
466static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
467static inline _syscall1(int,dup,int,fd)
468static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) 463static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
469static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
470static inline _syscall1(int,close,int,fd)
471static inline _syscall1(int,_exit,int,exitcode)
472static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
473static inline _syscall1(int,delete_module,const char *,name)
474 464
475static inline pid_t wait(int * wait_stat) 465#endif /* __KERNEL_SYSCALLS__ */
476{
477 return waitpid(-1,wait_stat,0);
478}
479 466
480#endif
481
482#ifdef __KERNEL__
483#define __ARCH_WANT_IPC_PARSE_VERSION 467#define __ARCH_WANT_IPC_PARSE_VERSION
484/* #define __ARCH_WANT_OLD_READDIR */ 468/* #define __ARCH_WANT_OLD_READDIR */
485#define __ARCH_WANT_OLD_STAT 469#define __ARCH_WANT_OLD_STAT
@@ -503,7 +487,6 @@ static inline pid_t wait(int * wait_stat)
503#define __ARCH_WANT_SYS_SIGPROCMASK 487#define __ARCH_WANT_SYS_SIGPROCMASK
504#define __ARCH_WANT_SYS_RT_SIGACTION 488#define __ARCH_WANT_SYS_RT_SIGACTION
505#define __ARCH_WANT_SYS_RT_SIGSUSPEND 489#define __ARCH_WANT_SYS_RT_SIGSUSPEND
506#endif
507 490
508/* 491/*
509 * "Conditional" syscalls 492 * "Conditional" syscalls
@@ -515,4 +498,5 @@ static inline pid_t wait(int * wait_stat)
515#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 498#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
516#endif 499#endif
517 500
501#endif /* __KERNEL__ */
518#endif /* _ASM_UNISTD_H_ */ 502#endif /* _ASM_UNISTD_H_ */
diff --git a/include/asm-frv/virtconvert.h b/include/asm-frv/virtconvert.h
index a29a0aec291f..59788fa2a813 100644
--- a/include/asm-frv/virtconvert.h
+++ b/include/asm-frv/virtconvert.h
@@ -17,7 +17,6 @@
17 17
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19 19
20#include <linux/config.h>
21#include <asm/setup.h> 20#include <asm/setup.h>
22 21
23#ifdef CONFIG_MMU 22#ifdef CONFIG_MMU
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 1a565a9d2fa7..0cd9711895fa 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -2,7 +2,6 @@
2#define _ASM_GENERIC_BUG_H 2#define _ASM_GENERIC_BUG_H
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <linux/config.h>
6 5
7#ifdef CONFIG_BUG 6#ifdef CONFIG_BUG
8#ifndef HAVE_ARCH_BUG 7#ifndef HAVE_ARCH_BUG
diff --git a/include/asm-generic/dma-mapping.h b/include/asm-generic/dma-mapping.h
index 1b356207712c..b541e48cc545 100644
--- a/include/asm-generic/dma-mapping.h
+++ b/include/asm-generic/dma-mapping.h
@@ -7,7 +7,6 @@
7#ifndef _ASM_GENERIC_DMA_MAPPING_H 7#ifndef _ASM_GENERIC_DMA_MAPPING_H
8#define _ASM_GENERIC_DMA_MAPPING_H 8#define _ASM_GENERIC_DMA_MAPPING_H
9 9
10#include <linux/config.h>
11 10
12#ifdef CONFIG_PCI 11#ifdef CONFIG_PCI
13 12
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h
index b663520dcdc4..c154b9d6e7e5 100644
--- a/include/asm-generic/fcntl.h
+++ b/include/asm-generic/fcntl.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_GENERIC_FCNTL_H 1#ifndef _ASM_GENERIC_FCNTL_H
2#define _ASM_GENERIC_FCNTL_H 2#define _ASM_GENERIC_FCNTL_H
3 3
4#include <linux/config.h>
5#include <linux/types.h> 4#include <linux/types.h>
6 5
7/* open/fcntl - O_SYNC is only implemented on blocks devices and on files 6/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h
index 9291c24f5819..ab469297272c 100644
--- a/include/asm-generic/local.h
+++ b/include/asm-generic/local.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_GENERIC_LOCAL_H 1#ifndef _ASM_GENERIC_LOCAL_H
2#define _ASM_GENERIC_LOCAL_H 2#define _ASM_GENERIC_LOCAL_H
3 3
4#include <linux/config.h>
5#include <linux/percpu.h> 4#include <linux/percpu.h>
6#include <linux/hardirq.h> 5#include <linux/hardirq.h>
7#include <asm/atomic.h> 6#include <asm/atomic.h>
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h
index 0cfb086dd373..8078cbd2c016 100644
--- a/include/asm-generic/memory_model.h
+++ b/include/asm-generic/memory_model.h
@@ -23,29 +23,23 @@
23 23
24#endif /* CONFIG_DISCONTIGMEM */ 24#endif /* CONFIG_DISCONTIGMEM */
25 25
26#ifdef CONFIG_OUT_OF_LINE_PFN_TO_PAGE
27struct page;
28/* this is useful when inlined pfn_to_page is too big */
29extern struct page *pfn_to_page(unsigned long pfn);
30extern unsigned long page_to_pfn(struct page *page);
31#else
32/* 26/*
33 * supports 3 memory models. 27 * supports 3 memory models.
34 */ 28 */
35#if defined(CONFIG_FLATMEM) 29#if defined(CONFIG_FLATMEM)
36 30
37#define pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET)) 31#define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))
38#define page_to_pfn(page) ((unsigned long)((page) - mem_map) + \ 32#define __page_to_pfn(page) ((unsigned long)((page) - mem_map) + \
39 ARCH_PFN_OFFSET) 33 ARCH_PFN_OFFSET)
40#elif defined(CONFIG_DISCONTIGMEM) 34#elif defined(CONFIG_DISCONTIGMEM)
41 35
42#define pfn_to_page(pfn) \ 36#define __pfn_to_page(pfn) \
43({ unsigned long __pfn = (pfn); \ 37({ unsigned long __pfn = (pfn); \
44 unsigned long __nid = arch_pfn_to_nid(pfn); \ 38 unsigned long __nid = arch_pfn_to_nid(pfn); \
45 NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ 39 NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\
46}) 40})
47 41
48#define page_to_pfn(pg) \ 42#define __page_to_pfn(pg) \
49({ struct page *__pg = (pg); \ 43({ struct page *__pg = (pg); \
50 struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ 44 struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \
51 (unsigned long)(__pg - __pgdat->node_mem_map) + \ 45 (unsigned long)(__pg - __pgdat->node_mem_map) + \
@@ -57,18 +51,27 @@ extern unsigned long page_to_pfn(struct page *page);
57 * Note: section's mem_map is encorded to reflect its start_pfn. 51 * Note: section's mem_map is encorded to reflect its start_pfn.
58 * section[i].section_mem_map == mem_map's address - start_pfn; 52 * section[i].section_mem_map == mem_map's address - start_pfn;
59 */ 53 */
60#define page_to_pfn(pg) \ 54#define __page_to_pfn(pg) \
61({ struct page *__pg = (pg); \ 55({ struct page *__pg = (pg); \
62 int __sec = page_to_section(__pg); \ 56 int __sec = page_to_section(__pg); \
63 __pg - __section_mem_map_addr(__nr_to_section(__sec)); \ 57 __pg - __section_mem_map_addr(__nr_to_section(__sec)); \
64}) 58})
65 59
66#define pfn_to_page(pfn) \ 60#define __pfn_to_page(pfn) \
67({ unsigned long __pfn = (pfn); \ 61({ unsigned long __pfn = (pfn); \
68 struct mem_section *__sec = __pfn_to_section(__pfn); \ 62 struct mem_section *__sec = __pfn_to_section(__pfn); \
69 __section_mem_map_addr(__sec) + __pfn; \ 63 __section_mem_map_addr(__sec) + __pfn; \
70}) 64})
71#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ 65#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */
66
67#ifdef CONFIG_OUT_OF_LINE_PFN_TO_PAGE
68struct page;
69/* this is useful when inlined pfn_to_page is too big */
70extern struct page *pfn_to_page(unsigned long pfn);
71extern unsigned long page_to_pfn(struct page *page);
72#else
73#define page_to_pfn __page_to_pfn
74#define pfn_to_page __pfn_to_page
72#endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */ 75#endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */
73 76
74#endif /* __ASSEMBLY__ */ 77#endif /* __ASSEMBLY__ */
diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h
index cef08db34ada..4087037a4225 100644
--- a/include/asm-generic/rtc.h
+++ b/include/asm-generic/rtc.h
@@ -114,6 +114,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
114/* Set the current date and time in the real time clock. */ 114/* Set the current date and time in the real time clock. */
115static inline int set_rtc_time(struct rtc_time *time) 115static inline int set_rtc_time(struct rtc_time *time)
116{ 116{
117 unsigned long flags;
117 unsigned char mon, day, hrs, min, sec; 118 unsigned char mon, day, hrs, min, sec;
118 unsigned char save_control, save_freq_select; 119 unsigned char save_control, save_freq_select;
119 unsigned int yrs; 120 unsigned int yrs;
@@ -131,7 +132,7 @@ static inline int set_rtc_time(struct rtc_time *time)
131 if (yrs > 255) /* They are unsigned */ 132 if (yrs > 255) /* They are unsigned */
132 return -EINVAL; 133 return -EINVAL;
133 134
134 spin_lock_irq(&rtc_lock); 135 spin_lock_irqsave(&rtc_lock, flags);
135#ifdef CONFIG_MACH_DECSTATION 136#ifdef CONFIG_MACH_DECSTATION
136 real_yrs = yrs; 137 real_yrs = yrs;
137 leap_yr = ((!((yrs + 1900) % 4) && ((yrs + 1900) % 100)) || 138 leap_yr = ((!((yrs + 1900) % 4) && ((yrs + 1900) % 100)) ||
@@ -152,7 +153,7 @@ static inline int set_rtc_time(struct rtc_time *time)
152 * whether the chip is in binary mode or not. 153 * whether the chip is in binary mode or not.
153 */ 154 */
154 if (yrs > 169) { 155 if (yrs > 169) {
155 spin_unlock_irq(&rtc_lock); 156 spin_unlock_irqrestore(&rtc_lock, flags);
156 return -EINVAL; 157 return -EINVAL;
157 } 158 }
158 159
@@ -187,7 +188,7 @@ static inline int set_rtc_time(struct rtc_time *time)
187 CMOS_WRITE(save_control, RTC_CONTROL); 188 CMOS_WRITE(save_control, RTC_CONTROL);
188 CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); 189 CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
189 190
190 spin_unlock_irq(&rtc_lock); 191 spin_unlock_irqrestore(&rtc_lock, flags);
191 192
192 return 0; 193 return 0;
193} 194}
diff --git a/include/asm-generic/signal.h b/include/asm-generic/signal.h
index 9418d6e9b8cd..dae1d8720076 100644
--- a/include/asm-generic/signal.h
+++ b/include/asm-generic/signal.h
@@ -1,3 +1,8 @@
1#ifndef __ASM_GENERIC_SIGNAL_H
2#define __ASM_GENERIC_SIGNAL_H
3
4#include <linux/compiler.h>
5
1#ifndef SIG_BLOCK 6#ifndef SIG_BLOCK
2#define SIG_BLOCK 0 /* for blocking signals */ 7#define SIG_BLOCK 0 /* for blocking signals */
3#endif 8#endif
@@ -19,3 +24,5 @@ typedef __restorefn_t __user *__sigrestore_t;
19#define SIG_IGN ((__force __sighandler_t)1) /* ignore signal */ 24#define SIG_IGN ((__force __sighandler_t)1) /* ignore signal */
20#define SIG_ERR ((__force __sighandler_t)-1) /* error return from signal */ 25#define SIG_ERR ((__force __sighandler_t)-1) /* error return from signal */
21#endif 26#endif
27
28#endif /* __ASM_GENERIC_SIGNAL_H */
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index cdd4145243cd..867d9008fafa 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -13,7 +13,6 @@
13#ifndef _ASM_GENERIC__TLB_H 13#ifndef _ASM_GENERIC__TLB_H
14#define _ASM_GENERIC__TLB_H 14#define _ASM_GENERIC__TLB_H
15 15
16#include <linux/config.h>
17#include <linux/swap.h> 16#include <linux/swap.h>
18#include <asm/pgalloc.h> 17#include <asm/pgalloc.h>
19#include <asm/tlbflush.h> 18#include <asm/tlbflush.h>
diff --git a/include/asm-h8300/bitops.h b/include/asm-h8300/bitops.h
index 574f57b6c4d1..d76299c98b81 100644
--- a/include/asm-h8300/bitops.h
+++ b/include/asm-h8300/bitops.h
@@ -6,7 +6,6 @@
6 * Copyright 2002, Yoshinori Sato 6 * Copyright 2002, Yoshinori Sato
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/compiler.h> 9#include <linux/compiler.h>
11#include <asm/system.h> 10#include <asm/system.h>
12 11
diff --git a/include/asm-h8300/dma.h b/include/asm-h8300/dma.h
index 3708681b7ddc..3edbaaaedf5b 100644
--- a/include/asm-h8300/dma.h
+++ b/include/asm-h8300/dma.h
@@ -1,7 +1,6 @@
1#ifndef _H8300_DMA_H 1#ifndef _H8300_DMA_H
2#define _H8300_DMA_H 2#define _H8300_DMA_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * Set number of channels of DMA on ColdFire for different implementations. 6 * Set number of channels of DMA on ColdFire for different implementations.
diff --git a/include/asm-h8300/elf.h b/include/asm-h8300/elf.h
index f4af1553a55f..7ba6a0af447c 100644
--- a/include/asm-h8300/elf.h
+++ b/include/asm-h8300/elf.h
@@ -5,7 +5,6 @@
5 * ELF register definitions.. 5 * ELF register definitions..
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <asm/ptrace.h> 8#include <asm/ptrace.h>
10#include <asm/user.h> 9#include <asm/user.h>
11 10
diff --git a/include/asm-h8300/hardirq.h b/include/asm-h8300/hardirq.h
index e961bfe201b8..18fa7931e09f 100644
--- a/include/asm-h8300/hardirq.h
+++ b/include/asm-h8300/hardirq.h
@@ -2,7 +2,6 @@
2#define __H8300_HARDIRQ_H 2#define __H8300_HARDIRQ_H
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/config.h>
6#include <linux/threads.h> 5#include <linux/threads.h>
7#include <linux/interrupt.h> 6#include <linux/interrupt.h>
8#include <linux/irq.h> 7#include <linux/irq.h>
diff --git a/include/asm-h8300/io.h b/include/asm-h8300/io.h
index 1773e373e9c6..91b7487cb7ae 100644
--- a/include/asm-h8300/io.h
+++ b/include/asm-h8300/io.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7#include <asm/virtconvert.h> 6#include <asm/virtconvert.h>
8 7
9#if defined(CONFIG_H83007) || defined(CONFIG_H83068) 8#if defined(CONFIG_H83007) || defined(CONFIG_H83068)
diff --git a/include/asm-h8300/irq.h b/include/asm-h8300/irq.h
index 73065f5bda0e..42a3ac424a9e 100644
--- a/include/asm-h8300/irq.h
+++ b/include/asm-h8300/irq.h
@@ -63,8 +63,4 @@ extern void enable_irq(unsigned int);
63extern void disable_irq(unsigned int); 63extern void disable_irq(unsigned int);
64#define disable_irq_nosync(x) disable_irq(x) 64#define disable_irq_nosync(x) disable_irq(x)
65 65
66struct irqaction;
67struct pt_regs;
68int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
69
70#endif /* _H8300_IRQ_H_ */ 66#endif /* _H8300_IRQ_H_ */
diff --git a/include/asm-h8300/keyboard.h b/include/asm-h8300/keyboard.h
index b05d11387ae5..fbad65e8a5c0 100644
--- a/include/asm-h8300/keyboard.h
+++ b/include/asm-h8300/keyboard.h
@@ -7,7 +7,6 @@
7#ifndef _H8300_KEYBOARD_H 7#ifndef _H8300_KEYBOARD_H
8#define _H8300_KEYBOARD_H 8#define _H8300_KEYBOARD_H
9 9
10#include <linux/config.h>
11 10
12/* dummy i.e. no real keyboard */ 11/* dummy i.e. no real keyboard */
13#define kbd_setkeycode(x...) (-ENOSYS) 12#define kbd_setkeycode(x...) (-ENOSYS)
diff --git a/include/asm-h8300/mmu_context.h b/include/asm-h8300/mmu_context.h
index 23b555b7b4b9..855721a5dcc9 100644
--- a/include/asm-h8300/mmu_context.h
+++ b/include/asm-h8300/mmu_context.h
@@ -1,7 +1,6 @@
1#ifndef __H8300_MMU_CONTEXT_H 1#ifndef __H8300_MMU_CONTEXT_H
2#define __H8300_MMU_CONTEXT_H 2#define __H8300_MMU_CONTEXT_H
3 3
4#include <linux/config.h>
5#include <asm/setup.h> 4#include <asm/setup.h>
6#include <asm/page.h> 5#include <asm/page.h>
7#include <asm/pgalloc.h> 6#include <asm/pgalloc.h>
diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h
index 6472c9f88227..f9f9d3eea8ed 100644
--- a/include/asm-h8300/page.h
+++ b/include/asm-h8300/page.h
@@ -1,7 +1,6 @@
1#ifndef _H8300_PAGE_H 1#ifndef _H8300_PAGE_H
2#define _H8300_PAGE_H 2#define _H8300_PAGE_H
3 3
4#include <linux/config.h>
5 4
6/* PAGE_SHIFT determines the page size */ 5/* PAGE_SHIFT determines the page size */
7 6
diff --git a/include/asm-h8300/page_offset.h b/include/asm-h8300/page_offset.h
index 8cc6e17218a8..f8706463008c 100644
--- a/include/asm-h8300/page_offset.h
+++ b/include/asm-h8300/page_offset.h
@@ -1,4 +1,3 @@
1 1
2#include <linux/config.h>
3#define PAGE_OFFSET_RAW 0x00000000 2#define PAGE_OFFSET_RAW 0x00000000
4 3
diff --git a/include/asm-h8300/param.h b/include/asm-h8300/param.h
index 126dddf72359..c25806ed1fb3 100644
--- a/include/asm-h8300/param.h
+++ b/include/asm-h8300/param.h
@@ -1,7 +1,6 @@
1#ifndef _H8300_PARAM_H 1#ifndef _H8300_PARAM_H
2#define _H8300_PARAM_H 2#define _H8300_PARAM_H
3 3
4#include <linux/config.h>
5 4
6#ifndef HZ 5#ifndef HZ
7#define HZ 100 6#define HZ 100
diff --git a/include/asm-h8300/pgtable.h b/include/asm-h8300/pgtable.h
index f6e296fc1297..8b7c6857998b 100644
--- a/include/asm-h8300/pgtable.h
+++ b/include/asm-h8300/pgtable.h
@@ -3,7 +3,6 @@
3 3
4#include <asm-generic/4level-fixup.h> 4#include <asm-generic/4level-fixup.h>
5 5
6#include <linux/config.h>
7#include <linux/slab.h> 6#include <linux/slab.h>
8#include <asm/processor.h> 7#include <asm/processor.h>
9#include <asm/page.h> 8#include <asm/page.h>
diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h
index c6f0a7108ef3..c7e2f454b83a 100644
--- a/include/asm-h8300/processor.h
+++ b/include/asm-h8300/processor.h
@@ -17,7 +17,6 @@
17 */ 17 */
18#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 18#define current_text_addr() ({ __label__ _l; _l: &&_l;})
19 19
20#include <linux/config.h>
21#include <asm/segment.h> 20#include <asm/segment.h>
22#include <asm/fpu.h> 21#include <asm/fpu.h>
23#include <asm/ptrace.h> 22#include <asm/ptrace.h>
diff --git a/include/asm-h8300/semaphore-helper.h b/include/asm-h8300/semaphore-helper.h
index 29e0fbf1acb7..4fea36be5fd8 100644
--- a/include/asm-h8300/semaphore-helper.h
+++ b/include/asm-h8300/semaphore-helper.h
@@ -10,7 +10,6 @@
10 * m68k version by Andreas Schwab 10 * m68k version by Andreas Schwab
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
15 14
16/* 15/*
diff --git a/include/asm-h8300/shm.h b/include/asm-h8300/shm.h
index bec758524839..ed6623c0545d 100644
--- a/include/asm-h8300/shm.h
+++ b/include/asm-h8300/shm.h
@@ -1,7 +1,6 @@
1#ifndef _H8300_SHM_H 1#ifndef _H8300_SHM_H
2#define _H8300_SHM_H 2#define _H8300_SHM_H
3 3
4#include <linux/config.h>
5 4
6/* format of page table entries that correspond to shared memory pages 5/* format of page table entries that correspond to shared memory pages
7 currently out in swap space (see also mm/swap.c): 6 currently out in swap space (see also mm/swap.c):
diff --git a/include/asm-h8300/system.h b/include/asm-h8300/system.h
index 8e81cf665e75..134e0929fce5 100644
--- a/include/asm-h8300/system.h
+++ b/include/asm-h8300/system.h
@@ -1,7 +1,6 @@
1#ifndef _H8300_SYSTEM_H 1#ifndef _H8300_SYSTEM_H
2#define _H8300_SYSTEM_H 2#define _H8300_SYSTEM_H
3 3
4#include <linux/config.h> /* get configuration macros */
5#include <linux/linkage.h> 4#include <linux/linkage.h>
6 5
7/* 6/*
diff --git a/include/asm-h8300/unaligned.h b/include/asm-h8300/unaligned.h
index 8a93961173c3..ffb67f472070 100644
--- a/include/asm-h8300/unaligned.h
+++ b/include/asm-h8300/unaligned.h
@@ -1,7 +1,6 @@
1#ifndef __H8300_UNALIGNED_H 1#ifndef __H8300_UNALIGNED_H
2#define __H8300_UNALIGNED_H 2#define __H8300_UNALIGNED_H
3 3
4#include <linux/config.h>
5 4
6/* Use memmove here, so gcc does not insert a __builtin_memcpy. */ 5/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
7 6
diff --git a/include/asm-h8300/unistd.h b/include/asm-h8300/unistd.h
index adb05159379b..226dd596c2da 100644
--- a/include/asm-h8300/unistd.h
+++ b/include/asm-h8300/unistd.h
@@ -292,6 +292,8 @@
292#define __NR_request_key 287 292#define __NR_request_key 287
293#define __NR_keyctl 288 293#define __NR_keyctl 288
294 294
295#ifdef __KERNEL__
296
295#define NR_syscalls 289 297#define NR_syscalls 289
296 298
297 299
@@ -460,7 +462,6 @@ type name(atype a, btype b, ctype c, dtype d, etype e, ftype f) \
460 __syscall_return(type, __res); \ 462 __syscall_return(type, __res); \
461} 463}
462 464
463#ifdef __KERNEL__
464#define __ARCH_WANT_IPC_PARSE_VERSION 465#define __ARCH_WANT_IPC_PARSE_VERSION
465#define __ARCH_WANT_OLD_READDIR 466#define __ARCH_WANT_OLD_READDIR
466#define __ARCH_WANT_OLD_STAT 467#define __ARCH_WANT_OLD_STAT
@@ -483,7 +484,6 @@ type name(atype a, btype b, ctype c, dtype d, etype e, ftype f) \
483#define __ARCH_WANT_SYS_SIGPENDING 484#define __ARCH_WANT_SYS_SIGPENDING
484#define __ARCH_WANT_SYS_SIGPROCMASK 485#define __ARCH_WANT_SYS_SIGPROCMASK
485#define __ARCH_WANT_SYS_RT_SIGACTION 486#define __ARCH_WANT_SYS_RT_SIGACTION
486#endif
487 487
488#ifdef __KERNEL_SYSCALLS__ 488#ifdef __KERNEL_SYSCALLS__
489 489
@@ -534,7 +534,7 @@ asmlinkage long sys_rt_sigaction(int sig,
534 struct sigaction __user *oact, 534 struct sigaction __user *oact,
535 size_t sigsetsize); 535 size_t sigsetsize);
536 536
537#endif 537#endif /* __KERNEL_SYSCALLS__ */
538 538
539/* 539/*
540 * "Conditional" syscalls 540 * "Conditional" syscalls
@@ -543,4 +543,5 @@ asmlinkage long sys_rt_sigaction(int sig,
543 asm (".weak\t_" #name "\n" \ 543 asm (".weak\t_" #name "\n" \
544 ".set\t_" #name ",_sys_ni_syscall"); 544 ".set\t_" #name ",_sys_ni_syscall");
545 545
546#endif /* __KERNEL__ */
546#endif /* _ASM_H8300_UNISTD_H_ */ 547#endif /* _ASM_H8300_UNISTD_H_ */
diff --git a/include/asm-h8300/virtconvert.h b/include/asm-h8300/virtconvert.h
index 3b344c1dfe0f..ee7d5ea10065 100644
--- a/include/asm-h8300/virtconvert.h
+++ b/include/asm-h8300/virtconvert.h
@@ -7,7 +7,6 @@
7 7
8#ifdef __KERNEL__ 8#ifdef __KERNEL__
9 9
10#include <linux/config.h>
11#include <asm/setup.h> 10#include <asm/setup.h>
12#include <asm/page.h> 11#include <asm/page.h>
13 12
diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h
index e201decea0c9..d79e9ee10fd7 100644
--- a/include/asm-i386/alternative.h
+++ b/include/asm-i386/alternative.h
@@ -3,6 +3,8 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <asm/types.h>
7
6struct alt_instr { 8struct alt_instr {
7 u8 *instr; /* original instruction */ 9 u8 *instr; /* original instruction */
8 u8 *replacement; 10 u8 *replacement;
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h
index 288233fd77d7..1d8362cb2c5d 100644
--- a/include/asm-i386/apic.h
+++ b/include/asm-i386/apic.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_APIC_H 1#ifndef __ASM_APIC_H
2#define __ASM_APIC_H 2#define __ASM_APIC_H
3 3
4#include <linux/config.h>
5#include <linux/pm.h> 4#include <linux/pm.h>
6#include <asm/fixmap.h> 5#include <asm/fixmap.h>
7#include <asm/apicdef.h> 6#include <asm/apicdef.h>
@@ -139,8 +138,6 @@ void switch_ipi_to_APIC_timer(void *cpumask);
139 138
140extern int timer_over_8254; 139extern int timer_over_8254;
141 140
142extern int modern_apic(void);
143
144#else /* !CONFIG_X86_LOCAL_APIC */ 141#else /* !CONFIG_X86_LOCAL_APIC */
145static inline void lapic_shutdown(void) { } 142static inline void lapic_shutdown(void) { }
146 143
diff --git a/include/asm-i386/apicdef.h b/include/asm-i386/apicdef.h
index 5e4a35af2921..9f6995341fdc 100644
--- a/include/asm-i386/apicdef.h
+++ b/include/asm-i386/apicdef.h
@@ -121,7 +121,6 @@
121 */ 121 */
122#define u32 unsigned int 122#define u32 unsigned int
123 123
124#define lapic ((volatile struct local_apic *)APIC_BASE)
125 124
126struct local_apic { 125struct local_apic {
127 126
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h
index 4ddce5296a78..4f061fa73794 100644
--- a/include/asm-i386/atomic.h
+++ b/include/asm-i386/atomic.h
@@ -1,7 +1,6 @@
1#ifndef __ARCH_I386_ATOMIC__ 1#ifndef __ARCH_I386_ATOMIC__
2#define __ARCH_I386_ATOMIC__ 2#define __ARCH_I386_ATOMIC__
3 3
4#include <linux/config.h>
5#include <linux/compiler.h> 4#include <linux/compiler.h>
6#include <asm/processor.h> 5#include <asm/processor.h>
7 6
diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h
index 08deaeee6be9..1c780fa1e762 100644
--- a/include/asm-i386/bitops.h
+++ b/include/asm-i386/bitops.h
@@ -5,7 +5,6 @@
5 * Copyright 1992, Linus Torvalds. 5 * Copyright 1992, Linus Torvalds.
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/compiler.h> 8#include <linux/compiler.h>
10#include <asm/alternative.h> 9#include <asm/alternative.h>
11 10
diff --git a/include/asm-i386/bug.h b/include/asm-i386/bug.h
index 8f79de19eb94..8062cdbf2587 100644
--- a/include/asm-i386/bug.h
+++ b/include/asm-i386/bug.h
@@ -1,7 +1,6 @@
1#ifndef _I386_BUG_H 1#ifndef _I386_BUG_H
2#define _I386_BUG_H 2#define _I386_BUG_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * Tell the user there is some problem. 6 * Tell the user there is some problem.
diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h
index 50233e0345fb..2a9e4ee5904d 100644
--- a/include/asm-i386/bugs.h
+++ b/include/asm-i386/bugs.h
@@ -17,7 +17,6 @@
17 * void check_bugs(void); 17 * void check_bugs(void);
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <asm/processor.h> 21#include <asm/processor.h>
23#include <asm/i387.h> 22#include <asm/i387.h>
diff --git a/include/asm-i386/byteorder.h b/include/asm-i386/byteorder.h
index a0d73f48d5be..a45470a8b74a 100644
--- a/include/asm-i386/byteorder.h
+++ b/include/asm-i386/byteorder.h
@@ -8,7 +8,6 @@
8 8
9/* For avoiding bswap on i386 */ 9/* For avoiding bswap on i386 */
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11#include <linux/config.h>
12#endif 11#endif
13 12
14static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x) 13static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
diff --git a/include/asm-i386/cache.h b/include/asm-i386/cache.h
index ca15c9c665cf..57c62f414158 100644
--- a/include/asm-i386/cache.h
+++ b/include/asm-i386/cache.h
@@ -4,7 +4,6 @@
4#ifndef __ARCH_I386_CACHE_H 4#ifndef __ARCH_I386_CACHE_H
5#define __ARCH_I386_CACHE_H 5#define __ARCH_I386_CACHE_H
6 6
7#include <linux/config.h>
8 7
9/* L1 cache line size */ 8/* L1 cache line size */
10#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) 9#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h
index b44bfc6239cb..3ecedbafa8ce 100644
--- a/include/asm-i386/cpufeature.h
+++ b/include/asm-i386/cpufeature.h
@@ -88,6 +88,12 @@
88#define X86_FEATURE_XSTORE_EN (5*32+ 3) /* on-CPU RNG enabled */ 88#define X86_FEATURE_XSTORE_EN (5*32+ 3) /* on-CPU RNG enabled */
89#define X86_FEATURE_XCRYPT (5*32+ 6) /* on-CPU crypto (xcrypt insn) */ 89#define X86_FEATURE_XCRYPT (5*32+ 6) /* on-CPU crypto (xcrypt insn) */
90#define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */ 90#define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */
91#define X86_FEATURE_ACE2 (5*32+ 8) /* Advanced Cryptography Engine v2 */
92#define X86_FEATURE_ACE2_EN (5*32+ 9) /* ACE v2 enabled */
93#define X86_FEATURE_PHE (5*32+ 10) /* PadLock Hash Engine */
94#define X86_FEATURE_PHE_EN (5*32+ 11) /* PHE enabled */
95#define X86_FEATURE_PMM (5*32+ 12) /* PadLock Montgomery Multiplier */
96#define X86_FEATURE_PMM_EN (5*32+ 13) /* PMM enabled */
91 97
92/* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */ 98/* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */
93#define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */ 99#define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */
@@ -121,6 +127,12 @@
121#define cpu_has_xstore_enabled boot_cpu_has(X86_FEATURE_XSTORE_EN) 127#define cpu_has_xstore_enabled boot_cpu_has(X86_FEATURE_XSTORE_EN)
122#define cpu_has_xcrypt boot_cpu_has(X86_FEATURE_XCRYPT) 128#define cpu_has_xcrypt boot_cpu_has(X86_FEATURE_XCRYPT)
123#define cpu_has_xcrypt_enabled boot_cpu_has(X86_FEATURE_XCRYPT_EN) 129#define cpu_has_xcrypt_enabled boot_cpu_has(X86_FEATURE_XCRYPT_EN)
130#define cpu_has_ace2 boot_cpu_has(X86_FEATURE_ACE2)
131#define cpu_has_ace2_enabled boot_cpu_has(X86_FEATURE_ACE2_EN)
132#define cpu_has_phe boot_cpu_has(X86_FEATURE_PHE)
133#define cpu_has_phe_enabled boot_cpu_has(X86_FEATURE_PHE_EN)
134#define cpu_has_pmm boot_cpu_has(X86_FEATURE_PMM)
135#define cpu_has_pmm_enabled boot_cpu_has(X86_FEATURE_PMM_EN)
124 136
125#endif /* __ASM_I386_CPUFEATURE_H */ 137#endif /* __ASM_I386_CPUFEATURE_H */
126 138
diff --git a/include/asm-i386/dma.h b/include/asm-i386/dma.h
index f24b2bba2831..d23aac8e1a50 100644
--- a/include/asm-i386/dma.h
+++ b/include/asm-i386/dma.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_DMA_H 8#ifndef _ASM_DMA_H
9#define _ASM_DMA_H 9#define _ASM_DMA_H
10 10
11#include <linux/config.h>
12#include <linux/spinlock.h> /* And spinlocks */ 11#include <linux/spinlock.h> /* And spinlocks */
13#include <asm/io.h> /* need byte IO */ 12#include <asm/io.h> /* need byte IO */
14#include <linux/delay.h> 13#include <linux/delay.h>
diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h
index cfb1c61d3b9c..f7e068f4d2f9 100644
--- a/include/asm-i386/fixmap.h
+++ b/include/asm-i386/fixmap.h
@@ -13,7 +13,6 @@
13#ifndef _ASM_FIXMAP_H 13#ifndef _ASM_FIXMAP_H
14#define _ASM_FIXMAP_H 14#define _ASM_FIXMAP_H
15 15
16#include <linux/config.h>
17 16
18/* used by vmalloc.c, vsyscall.lds.S. 17/* used by vmalloc.c, vsyscall.lds.S.
19 * 18 *
diff --git a/include/asm-i386/hardirq.h b/include/asm-i386/hardirq.h
index ee754d359734..0e358dc405f8 100644
--- a/include/asm-i386/hardirq.h
+++ b/include/asm-i386/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_HARDIRQ_H 1#ifndef __ASM_HARDIRQ_H
2#define __ASM_HARDIRQ_H 2#define __ASM_HARDIRQ_H
3 3
4#include <linux/config.h>
5#include <linux/threads.h> 4#include <linux/threads.h>
6#include <linux/irq.h> 5#include <linux/irq.h>
7 6
diff --git a/include/asm-i386/highmem.h b/include/asm-i386/highmem.h
index 0fd331306b60..e9a34ebc25d5 100644
--- a/include/asm-i386/highmem.h
+++ b/include/asm-i386/highmem.h
@@ -20,7 +20,6 @@
20 20
21#ifdef __KERNEL__ 21#ifdef __KERNEL__
22 22
23#include <linux/config.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
25#include <linux/threads.h> 24#include <linux/threads.h>
26#include <asm/kmap_types.h> 25#include <asm/kmap_types.h>
diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h
index 7f1a8a6ee32f..af5d435519d1 100644
--- a/include/asm-i386/hpet.h
+++ b/include/asm-i386/hpet.h
@@ -27,7 +27,6 @@
27#include <asm/processor.h> 27#include <asm/processor.h>
28 28
29#include <linux/timex.h> 29#include <linux/timex.h>
30#include <linux/config.h>
31 30
32#include <asm/fixmap.h> 31#include <asm/fixmap.h>
33 32
diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h
index 622815bf3243..95d3fd090298 100644
--- a/include/asm-i386/hw_irq.h
+++ b/include/asm-i386/hw_irq.h
@@ -12,7 +12,6 @@
12 * <tomsoft@informatik.tu-chemnitz.de> 12 * <tomsoft@informatik.tu-chemnitz.de>
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/profile.h> 15#include <linux/profile.h>
17#include <asm/atomic.h> 16#include <asm/atomic.h>
18#include <asm/irq.h> 17#include <asm/irq.h>
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
index 454440193eac..73465d2892b9 100644
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -13,7 +13,6 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/config.h>
17 16
18#ifndef MAX_HWIFS 17#ifndef MAX_HWIFS
19# ifdef CONFIG_BLK_DEV_IDEPCI 18# ifdef CONFIG_BLK_DEV_IDEPCI
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h
index 79670bb4b0c7..b3724fe93ff1 100644
--- a/include/asm-i386/io.h
+++ b/include/asm-i386/io.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_IO_H 1#ifndef _ASM_IO_H
2#define _ASM_IO_H 2#define _ASM_IO_H
3 3
4#include <linux/config.h>
5#include <linux/string.h> 4#include <linux/string.h>
6#include <linux/compiler.h> 5#include <linux/compiler.h>
7 6
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h
index d92e253f7f6f..5092e819b8a2 100644
--- a/include/asm-i386/io_apic.h
+++ b/include/asm-i386/io_apic.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_IO_APIC_H 1#ifndef __ASM_IO_APIC_H
2#define __ASM_IO_APIC_H 2#define __ASM_IO_APIC_H
3 3
4#include <linux/config.h>
5#include <asm/types.h> 4#include <asm/types.h>
6#include <asm/mpspec.h> 5#include <asm/mpspec.h>
7 6
diff --git a/include/asm-i386/irq.h b/include/asm-i386/irq.h
index 5169d7af456f..331726b41128 100644
--- a/include/asm-i386/irq.h
+++ b/include/asm-i386/irq.h
@@ -10,7 +10,6 @@
10 * <tomsoft@informatik.tu-chemnitz.de> 10 * <tomsoft@informatik.tu-chemnitz.de>
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/sched.h> 13#include <linux/sched.h>
15/* include comes from machine specific directory */ 14/* include comes from machine specific directory */
16#include "irq_vectors.h" 15#include "irq_vectors.h"
diff --git a/include/asm-i386/kmap_types.h b/include/asm-i386/kmap_types.h
index 6886a0c3fedf..806aae3c5338 100644
--- a/include/asm-i386/kmap_types.h
+++ b/include/asm-i386/kmap_types.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_KMAP_TYPES_H 1#ifndef _ASM_KMAP_TYPES_H
2#define _ASM_KMAP_TYPES_H 2#define _ASM_KMAP_TYPES_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_DEBUG_HIGHMEM 5#ifdef CONFIG_DEBUG_HIGHMEM
7# define D(n) __KM_FENCE_##n , 6# define D(n) __KM_FENCE_##n ,
diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
index 3d6d12937e1f..9fd073286289 100644
--- a/include/asm-i386/mach-summit/mach_apic.h
+++ b/include/asm-i386/mach-summit/mach_apic.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_MACH_APIC_H 1#ifndef __ASM_MACH_APIC_H
2#define __ASM_MACH_APIC_H 2#define __ASM_MACH_APIC_H
3 3
4#include <linux/config.h>
5#include <asm/smp.h> 4#include <asm/smp.h>
6 5
7#define esr_disable (1) 6#define esr_disable (1)
diff --git a/include/asm-i386/mce.h b/include/asm-i386/mce.h
new file mode 100644
index 000000000000..7cc1a973bf00
--- /dev/null
+++ b/include/asm-i386/mce.h
@@ -0,0 +1,5 @@
1#ifdef CONFIG_X86_MCE
2extern void mcheck_init(struct cpuinfo_x86 *c);
3#else
4#define mcheck_init(c) do {} while(0)
5#endif
diff --git a/include/asm-i386/mmu_context.h b/include/asm-i386/mmu_context.h
index bf08218357ea..62b7bf184094 100644
--- a/include/asm-i386/mmu_context.h
+++ b/include/asm-i386/mmu_context.h
@@ -1,7 +1,6 @@
1#ifndef __I386_SCHED_H 1#ifndef __I386_SCHED_H
2#define __I386_SCHED_H 2#define __I386_SCHED_H
3 3
4#include <linux/config.h>
5#include <asm/desc.h> 4#include <asm/desc.h>
6#include <asm/atomic.h> 5#include <asm/atomic.h>
7#include <asm/pgalloc.h> 6#include <asm/pgalloc.h>
diff --git a/include/asm-i386/msi.h b/include/asm-i386/msi.h
index f041d4495faf..b11c4b7dfaef 100644
--- a/include/asm-i386/msi.h
+++ b/include/asm-i386/msi.h
@@ -9,7 +9,15 @@
9#include <asm/desc.h> 9#include <asm/desc.h>
10#include <mach_apic.h> 10#include <mach_apic.h>
11 11
12#define LAST_DEVICE_VECTOR 232 12#define LAST_DEVICE_VECTOR (FIRST_SYSTEM_VECTOR - 1)
13#define MSI_TARGET_CPU_SHIFT 12 13#define MSI_TARGET_CPU_SHIFT 12
14 14
15extern struct msi_ops msi_apic_ops;
16
17static inline int msi_arch_init(void)
18{
19 msi_register(&msi_apic_ops);
20 return 0;
21}
22
15#endif /* ASM_MSI_H */ 23#endif /* ASM_MSI_H */
diff --git a/include/asm-i386/mtrr.h b/include/asm-i386/mtrr.h
index 64cf937c7e33..07f063ae26ea 100644
--- a/include/asm-i386/mtrr.h
+++ b/include/asm-i386/mtrr.h
@@ -23,7 +23,6 @@
23#ifndef _LINUX_MTRR_H 23#ifndef _LINUX_MTRR_H
24#define _LINUX_MTRR_H 24#define _LINUX_MTRR_H
25 25
26#include <linux/config.h>
27#include <linux/ioctl.h> 26#include <linux/ioctl.h>
28#include <linux/errno.h> 27#include <linux/errno.h>
29 28
@@ -77,6 +76,8 @@ extern int mtrr_add_page (unsigned long base, unsigned long size,
77extern int mtrr_del (int reg, unsigned long base, unsigned long size); 76extern int mtrr_del (int reg, unsigned long base, unsigned long size);
78extern int mtrr_del_page (int reg, unsigned long base, unsigned long size); 77extern int mtrr_del_page (int reg, unsigned long base, unsigned long size);
79extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi); 78extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi);
79extern void mtrr_ap_init(void);
80extern void mtrr_bp_init(void);
80# else 81# else
81static __inline__ int mtrr_add (unsigned long base, unsigned long size, 82static __inline__ int mtrr_add (unsigned long base, unsigned long size,
82 unsigned int type, char increment) 83 unsigned int type, char increment)
@@ -101,6 +102,8 @@ static __inline__ int mtrr_del_page (int reg, unsigned long base,
101 102
102static __inline__ void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi) {;} 103static __inline__ void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi) {;}
103 104
105#define mtrr_ap_init() do {} while (0)
106#define mtrr_bp_init() do {} while (0)
104# endif 107# endif
105 108
106#endif 109#endif
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index 30f52a2263ba..e3a552fa5538 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -12,7 +12,6 @@
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
14 14
15#include <linux/config.h>
16 15
17#ifdef CONFIG_X86_USE_3DNOW 16#ifdef CONFIG_X86_USE_3DNOW
18 17
@@ -137,9 +136,9 @@ extern int page_is_ram(unsigned long pagenr);
137 ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ 136 ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
138 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 137 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
139 138
140#endif /* __KERNEL__ */
141
142#include <asm-generic/memory_model.h> 139#include <asm-generic/memory_model.h>
143#include <asm-generic/page.h> 140#include <asm-generic/page.h>
144 141
142#endif /* __KERNEL__ */
143
145#endif /* _I386_PAGE_H */ 144#endif /* _I386_PAGE_H */
diff --git a/include/asm-i386/param.h b/include/asm-i386/param.h
index 095580f3a45c..745dc5bd0fbc 100644
--- a/include/asm-i386/param.h
+++ b/include/asm-i386/param.h
@@ -2,7 +2,6 @@
2#define _ASMi386_PARAM_H 2#define _ASMi386_PARAM_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5# include <linux/config.h>
6# define HZ CONFIG_HZ /* Internal kernel timer frequency */ 5# define HZ CONFIG_HZ /* Internal kernel timer frequency */
7# define USER_HZ 100 /* .. some user interfaces are in "ticks" */ 6# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
8# define CLOCKS_PER_SEC (USER_HZ) /* like times() */ 7# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index 78c85985aee3..64b6d0baedbc 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -1,7 +1,6 @@
1#ifndef __i386_PCI_H 1#ifndef __i386_PCI_H
2#define __i386_PCI_H 2#define __i386_PCI_H
3 3
4#include <linux/config.h>
5 4
6#ifdef __KERNEL__ 5#ifdef __KERNEL__
7#include <linux/mm.h> /* for struct page */ 6#include <linux/mm.h> /* for struct page */
diff --git a/include/asm-i386/pgalloc.h b/include/asm-i386/pgalloc.h
index 0380c3dc1f7e..4b1e61359f89 100644
--- a/include/asm-i386/pgalloc.h
+++ b/include/asm-i386/pgalloc.h
@@ -1,7 +1,6 @@
1#ifndef _I386_PGALLOC_H 1#ifndef _I386_PGALLOC_H
2#define _I386_PGALLOC_H 2#define _I386_PGALLOC_H
3 3
4#include <linux/config.h>
5#include <asm/fixmap.h> 4#include <asm/fixmap.h>
6#include <linux/threads.h> 5#include <linux/threads.h>
7#include <linux/mm.h> /* for struct page */ 6#include <linux/mm.h> /* for struct page */
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 672c3f76b9df..09697fec3d2b 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -1,7 +1,6 @@
1#ifndef _I386_PGTABLE_H 1#ifndef _I386_PGTABLE_H
2#define _I386_PGTABLE_H 2#define _I386_PGTABLE_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * The Linux memory management assumes a three-level page table setup. On 6 * The Linux memory management assumes a three-level page table setup. On
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 805f0dcda468..0c83cf12eec9 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -17,7 +17,6 @@
17#include <asm/msr.h> 17#include <asm/msr.h>
18#include <asm/system.h> 18#include <asm/system.h>
19#include <linux/cache.h> 19#include <linux/cache.h>
20#include <linux/config.h>
21#include <linux/threads.h> 20#include <linux/threads.h>
22#include <asm/percpu.h> 21#include <asm/percpu.h>
23#include <linux/cpumask.h> 22#include <linux/cpumask.h>
@@ -729,18 +728,4 @@ extern unsigned long boot_option_idle_override;
729extern void enable_sep_cpu(void); 728extern void enable_sep_cpu(void);
730extern int sysenter_setup(void); 729extern int sysenter_setup(void);
731 730
732#ifdef CONFIG_MTRR
733extern void mtrr_ap_init(void);
734extern void mtrr_bp_init(void);
735#else
736#define mtrr_ap_init() do {} while (0)
737#define mtrr_bp_init() do {} while (0)
738#endif
739
740#ifdef CONFIG_X86_MCE
741extern void mcheck_init(struct cpuinfo_x86 *c);
742#else
743#define mcheck_init(c) do {} while(0)
744#endif
745
746#endif /* __ASM_I386_PROCESSOR_H */ 731#endif /* __ASM_I386_PROCESSOR_H */
diff --git a/include/asm-i386/serial.h b/include/asm-i386/serial.h
index e1ecfccb743b..bd67480ca109 100644
--- a/include/asm-i386/serial.h
+++ b/include/asm-i386/serial.h
@@ -2,7 +2,6 @@
2 * include/asm-i386/serial.h 2 * include/asm-i386/serial.h
3 */ 3 */
4 4
5#include <linux/config.h>
6 5
7/* 6/*
8 * This assumes you have a 1.8432 MHz clock for your UART. 7 * This assumes you have a 1.8432 MHz clock for your UART.
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index 61d3ab9db70c..142d10e34ade 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -5,7 +5,6 @@
5 * We need the APIC definitions automatically as part of 'smp.h' 5 * We need the APIC definitions automatically as part of 'smp.h'
6 */ 6 */
7#ifndef __ASSEMBLY__ 7#ifndef __ASSEMBLY__
8#include <linux/config.h>
9#include <linux/kernel.h> 8#include <linux/kernel.h>
10#include <linux/threads.h> 9#include <linux/threads.h>
11#include <linux/cpumask.h> 10#include <linux/cpumask.h>
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index d76b7693cf1d..04ba30234c48 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -4,7 +4,6 @@
4#include <asm/atomic.h> 4#include <asm/atomic.h>
5#include <asm/rwlock.h> 5#include <asm/rwlock.h>
6#include <asm/page.h> 6#include <asm/page.h>
7#include <linux/config.h>
8#include <linux/compiler.h> 7#include <linux/compiler.h>
9 8
10/* 9/*
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index bb5f88a27f7a..b9277361954b 100644
--- a/include/asm-i386/string.h
+++ b/include/asm-i386/string.h
@@ -2,7 +2,6 @@
2#define _I386_STRING_H_ 2#define _I386_STRING_H_
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5#include <linux/config.h>
6/* 5/*
7 * On a 486 or Pentium, we are better off not using the 6 * On a 486 or Pentium, we are better off not using the
8 * byte string operations. But on a 386 or a PPro the 7 * byte string operations. But on a 386 or a PPro the
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 19cc79c9a35d..0249f912a29c 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SYSTEM_H 1#ifndef __ASM_SYSTEM_H
2#define __ASM_SYSTEM_H 2#define __ASM_SYSTEM_H
3 3
4#include <linux/config.h>
5#include <linux/kernel.h> 4#include <linux/kernel.h>
6#include <asm/segment.h> 5#include <asm/segment.h>
7#include <asm/cpufeature.h> 6#include <asm/cpufeature.h>
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 1f7d48c9ba3f..8420ed12491e 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -9,7 +9,6 @@
9 9
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11 11
12#include <linux/config.h>
13#include <linux/compiler.h> 12#include <linux/compiler.h>
14#include <asm/page.h> 13#include <asm/page.h>
15 14
diff --git a/include/asm-i386/timex.h b/include/asm-i386/timex.h
index 292b5a68f627..d434984303ca 100644
--- a/include/asm-i386/timex.h
+++ b/include/asm-i386/timex.h
@@ -6,7 +6,6 @@
6#ifndef _ASMi386_TIMEX_H 6#ifndef _ASMi386_TIMEX_H
7#define _ASMi386_TIMEX_H 7#define _ASMi386_TIMEX_H
8 8
9#include <linux/config.h>
10#include <asm/processor.h> 9#include <asm/processor.h>
11 10
12#ifdef CONFIG_X86_ELAN 11#ifdef CONFIG_X86_ELAN
diff --git a/include/asm-i386/tlbflush.h b/include/asm-i386/tlbflush.h
index ab216e1370ef..d57ca5c540b6 100644
--- a/include/asm-i386/tlbflush.h
+++ b/include/asm-i386/tlbflush.h
@@ -1,7 +1,6 @@
1#ifndef _I386_TLBFLUSH_H 1#ifndef _I386_TLBFLUSH_H
2#define _I386_TLBFLUSH_H 2#define _I386_TLBFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6#include <asm/processor.h> 5#include <asm/processor.h>
7 6
diff --git a/include/asm-i386/types.h b/include/asm-i386/types.h
index e50a08bd7ced..4b4b295ccdb9 100644
--- a/include/asm-i386/types.h
+++ b/include/asm-i386/types.h
@@ -35,7 +35,6 @@ typedef unsigned long long __u64;
35 35
36#ifndef __ASSEMBLY__ 36#ifndef __ASSEMBLY__
37 37
38#include <linux/config.h>
39 38
40typedef signed char s8; 39typedef signed char s8;
41typedef unsigned char u8; 40typedef unsigned char u8;
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index 371457b1ceb6..8462f8e0e658 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -4,7 +4,6 @@
4/* 4/*
5 * User space memory access functions 5 * User space memory access functions
6 */ 6 */
7#include <linux/config.h>
8#include <linux/errno.h> 7#include <linux/errno.h>
9#include <linux/thread_info.h> 8#include <linux/thread_info.h>
10#include <linux/prefetch.h> 9#include <linux/prefetch.h>
@@ -59,7 +58,7 @@ extern struct movsl_mask {
59 __chk_user_ptr(addr); \ 58 __chk_user_ptr(addr); \
60 asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \ 59 asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \
61 :"=&r" (flag), "=r" (sum) \ 60 :"=&r" (flag), "=r" (sum) \
62 :"1" (addr),"g" ((int)(size)),"g" (current_thread_info()->addr_limit.seg)); \ 61 :"1" (addr),"g" ((int)(size)),"rm" (current_thread_info()->addr_limit.seg)); \
63 flag; }) 62 flag; })
64 63
65/** 64/**
@@ -391,6 +390,8 @@ unsigned long __must_check __copy_to_user_ll(void __user *to,
391 const void *from, unsigned long n); 390 const void *from, unsigned long n);
392unsigned long __must_check __copy_from_user_ll(void *to, 391unsigned long __must_check __copy_from_user_ll(void *to,
393 const void __user *from, unsigned long n); 392 const void __user *from, unsigned long n);
393unsigned long __must_check __copy_from_user_ll_nocache(void *to,
394 const void __user *from, unsigned long n);
394 395
395/* 396/*
396 * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault 397 * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault
@@ -479,12 +480,43 @@ __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n)
479 return __copy_from_user_ll(to, from, n); 480 return __copy_from_user_ll(to, from, n);
480} 481}
481 482
483#define ARCH_HAS_NOCACHE_UACCESS
484
485static __always_inline unsigned long __copy_from_user_inatomic_nocache(void *to,
486 const void __user *from, unsigned long n)
487{
488 if (__builtin_constant_p(n)) {
489 unsigned long ret;
490
491 switch (n) {
492 case 1:
493 __get_user_size(*(u8 *)to, from, 1, ret, 1);
494 return ret;
495 case 2:
496 __get_user_size(*(u16 *)to, from, 2, ret, 2);
497 return ret;
498 case 4:
499 __get_user_size(*(u32 *)to, from, 4, ret, 4);
500 return ret;
501 }
502 }
503 return __copy_from_user_ll_nocache(to, from, n);
504}
505
482static __always_inline unsigned long 506static __always_inline unsigned long
483__copy_from_user(void *to, const void __user *from, unsigned long n) 507__copy_from_user(void *to, const void __user *from, unsigned long n)
484{ 508{
485 might_sleep(); 509 might_sleep();
486 return __copy_from_user_inatomic(to, from, n); 510 return __copy_from_user_inatomic(to, from, n);
487} 511}
512
513static __always_inline unsigned long
514__copy_from_user_nocache(void *to, const void __user *from, unsigned long n)
515{
516 might_sleep();
517 return __copy_from_user_inatomic_nocache(to, from, n);
518}
519
488unsigned long __must_check copy_to_user(void __user *to, 520unsigned long __must_check copy_to_user(void __user *to,
489 const void *from, unsigned long n); 521 const void *from, unsigned long n);
490unsigned long __must_check copy_from_user(void *to, 522unsigned long __must_check copy_from_user(void *to,
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index eb4b152c82fc..fc1c8ddae149 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -322,8 +322,11 @@
322#define __NR_sync_file_range 314 322#define __NR_sync_file_range 314
323#define __NR_tee 315 323#define __NR_tee 315
324#define __NR_vmsplice 316 324#define __NR_vmsplice 316
325#define __NR_move_pages 317
325 326
326#define NR_syscalls 317 327#ifdef __KERNEL__
328
329#define NR_syscalls 318
327 330
328/* 331/*
329 * user-visible error numbers are in the range -1 - -128: see 332 * user-visible error numbers are in the range -1 - -128: see
@@ -422,7 +425,6 @@ __asm__ volatile ("push %%ebp ; push %%ebx ; movl 4(%2),%%ebp ; " \
422__syscall_return(type,__res); \ 425__syscall_return(type,__res); \
423} 426}
424 427
425#ifdef __KERNEL__
426#define __ARCH_WANT_IPC_PARSE_VERSION 428#define __ARCH_WANT_IPC_PARSE_VERSION
427#define __ARCH_WANT_OLD_READDIR 429#define __ARCH_WANT_OLD_READDIR
428#define __ARCH_WANT_OLD_STAT 430#define __ARCH_WANT_OLD_STAT
@@ -446,7 +448,6 @@ __syscall_return(type,__res); \
446#define __ARCH_WANT_SYS_SIGPROCMASK 448#define __ARCH_WANT_SYS_SIGPROCMASK
447#define __ARCH_WANT_SYS_RT_SIGACTION 449#define __ARCH_WANT_SYS_RT_SIGACTION
448#define __ARCH_WANT_SYS_RT_SIGSUSPEND 450#define __ARCH_WANT_SYS_RT_SIGSUSPEND
449#endif
450 451
451#ifdef __KERNEL_SYSCALLS__ 452#ifdef __KERNEL_SYSCALLS__
452 453
@@ -485,7 +486,7 @@ asmlinkage long sys_rt_sigaction(int sig,
485 struct sigaction __user *oact, 486 struct sigaction __user *oact,
486 size_t sigsetsize); 487 size_t sigsetsize);
487 488
488#endif 489#endif /* __KERNEL_SYSCALLS__ */
489 490
490/* 491/*
491 * "Conditional" syscalls 492 * "Conditional" syscalls
@@ -497,4 +498,5 @@ asmlinkage long sys_rt_sigaction(int sig,
497#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 498#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
498#endif 499#endif
499 500
501#endif /* __KERNEL__ */
500#endif /* _ASM_I386_UNISTD_H_ */ 502#endif /* _ASM_I386_UNISTD_H_ */
diff --git a/include/asm-i386/vga.h b/include/asm-i386/vga.h
index ef0c0e50cc95..0ecf68ac03aa 100644
--- a/include/asm-i386/vga.h
+++ b/include/asm-i386/vga.h
@@ -12,7 +12,7 @@
12 * access the videoram directly without any black magic. 12 * access the videoram directly without any black magic.
13 */ 13 */
14 14
15#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) 15#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
16 16
17#define vga_readb(x) (*(x)) 17#define vga_readb(x) (*(x))
18#define vga_writeb(x,y) (*(y) = (x)) 18#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/asm-ia64/asmmacro.h b/include/asm-ia64/asmmacro.h
index edf2cebb2969..c22b4658fc61 100644
--- a/include/asm-ia64/asmmacro.h
+++ b/include/asm-ia64/asmmacro.h
@@ -6,7 +6,6 @@
6 * David Mosberger-Tang <davidm@hpl.hp.com> 6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11#define ENTRY(name) \ 10#define ENTRY(name) \
12 .align 32; \ 11 .align 32; \
diff --git a/include/asm-ia64/cache.h b/include/asm-ia64/cache.h
index f0a104db8f20..e7482bd628ff 100644
--- a/include/asm-ia64/cache.h
+++ b/include/asm-ia64/cache.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_IA64_CACHE_H 1#ifndef _ASM_IA64_CACHE_H
2#define _ASM_IA64_CACHE_H 2#define _ASM_IA64_CACHE_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * Copyright (C) 1998-2000 Hewlett-Packard Co 6 * Copyright (C) 1998-2000 Hewlett-Packard Co
diff --git a/include/asm-ia64/delay.h b/include/asm-ia64/delay.h
index bba702076391..a30a62f235e1 100644
--- a/include/asm-ia64/delay.h
+++ b/include/asm-ia64/delay.h
@@ -12,7 +12,6 @@
12 * Copyright (C) 1999 Don Dugger <don.dugger@intel.com> 12 * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/sched.h> 16#include <linux/sched.h>
18#include <linux/compiler.h> 17#include <linux/compiler.h>
diff --git a/include/asm-ia64/dma-mapping.h b/include/asm-ia64/dma-mapping.h
index df67d40801de..99a8f8e1218c 100644
--- a/include/asm-ia64/dma-mapping.h
+++ b/include/asm-ia64/dma-mapping.h
@@ -5,7 +5,6 @@
5 * Copyright (C) 2003-2004 Hewlett-Packard Co 5 * Copyright (C) 2003-2004 Hewlett-Packard Co
6 * David Mosberger-Tang <davidm@hpl.hp.com> 6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */ 7 */
8#include <linux/config.h>
9#include <asm/machvec.h> 8#include <asm/machvec.h>
10 9
11#define dma_alloc_coherent platform_dma_alloc_coherent 10#define dma_alloc_coherent platform_dma_alloc_coherent
diff --git a/include/asm-ia64/dma.h b/include/asm-ia64/dma.h
index 3be1b4925e18..dad3a735df8b 100644
--- a/include/asm-ia64/dma.h
+++ b/include/asm-ia64/dma.h
@@ -6,7 +6,6 @@
6 * David Mosberger-Tang <davidm@hpl.hp.com> 6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11#include <asm/io.h> /* need byte IO */ 10#include <asm/io.h> /* need byte IO */
12 11
diff --git a/include/asm-ia64/elf.h b/include/asm-ia64/elf.h
index 446fce036fd9..25f9835d5459 100644
--- a/include/asm-ia64/elf.h
+++ b/include/asm-ia64/elf.h
@@ -8,7 +8,6 @@
8 * David Mosberger-Tang <davidm@hpl.hp.com> 8 * David Mosberger-Tang <davidm@hpl.hp.com>
9 */ 9 */
10 10
11#include <linux/config.h>
12 11
13#include <asm/fpu.h> 12#include <asm/fpu.h>
14#include <asm/page.h> 13#include <asm/page.h>
diff --git a/include/asm-ia64/hardirq.h b/include/asm-ia64/hardirq.h
index 33ef8f096d95..140e495b8e0e 100644
--- a/include/asm-ia64/hardirq.h
+++ b/include/asm-ia64/hardirq.h
@@ -6,7 +6,6 @@
6 * David Mosberger-Tang <davidm@hpl.hp.com> 6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11#include <linux/threads.h> 10#include <linux/threads.h>
12#include <linux/irq.h> 11#include <linux/irq.h>
diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h
index 0cf119b42f7d..ea8b8c407ab4 100644
--- a/include/asm-ia64/hw_irq.h
+++ b/include/asm-ia64/hw_irq.h
@@ -47,9 +47,19 @@ typedef u8 ia64_vector;
47#define IA64_CMC_VECTOR 0x1f /* corrected machine-check interrupt vector */ 47#define IA64_CMC_VECTOR 0x1f /* corrected machine-check interrupt vector */
48/* 48/*
49 * Vectors 0x20-0x2f are reserved for legacy ISA IRQs. 49 * Vectors 0x20-0x2f are reserved for legacy ISA IRQs.
50 * Use vectors 0x30-0xe7 as the default device vector range for ia64.
51 * Platforms may choose to reduce this range in platform_irq_setup, but the
52 * platform range must fall within
53 * [IA64_DEF_FIRST_DEVICE_VECTOR..IA64_DEF_LAST_DEVICE_VECTOR]
50 */ 54 */
51#define IA64_FIRST_DEVICE_VECTOR 0x30 55extern int ia64_first_device_vector;
52#define IA64_LAST_DEVICE_VECTOR 0xe7 56extern int ia64_last_device_vector;
57
58#define IA64_DEF_FIRST_DEVICE_VECTOR 0x30
59#define IA64_DEF_LAST_DEVICE_VECTOR 0xe7
60#define IA64_FIRST_DEVICE_VECTOR ia64_first_device_vector
61#define IA64_LAST_DEVICE_VECTOR ia64_last_device_vector
62#define IA64_MAX_DEVICE_VECTORS (IA64_DEF_LAST_DEVICE_VECTOR - IA64_DEF_FIRST_DEVICE_VECTOR + 1)
53#define IA64_NUM_DEVICE_VECTORS (IA64_LAST_DEVICE_VECTOR - IA64_FIRST_DEVICE_VECTOR + 1) 63#define IA64_NUM_DEVICE_VECTORS (IA64_LAST_DEVICE_VECTOR - IA64_FIRST_DEVICE_VECTOR + 1)
54 64
55#define IA64_MCA_RENDEZ_VECTOR 0xe8 /* MCA rendez interrupt */ 65#define IA64_MCA_RENDEZ_VECTOR 0xe8 /* MCA rendez interrupt */
@@ -83,6 +93,7 @@ extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt
83 93
84extern int assign_irq_vector (int irq); /* allocate a free vector */ 94extern int assign_irq_vector (int irq); /* allocate a free vector */
85extern void free_irq_vector (int vector); 95extern void free_irq_vector (int vector);
96extern int reserve_irq_vector (int vector);
86extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); 97extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
87extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); 98extern void register_percpu_irq (ia64_vector vec, struct irqaction *action);
88 99
diff --git a/include/asm-ia64/ia32.h b/include/asm-ia64/ia32.h
index f8044a1169cd..5ff8d74c3e00 100644
--- a/include/asm-ia64/ia32.h
+++ b/include/asm-ia64/ia32.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_IA64_IA32_H 1#ifndef _ASM_IA64_IA32_H
2#define _ASM_IA64_IA32_H 2#define _ASM_IA64_IA32_H
3 3
4#include <linux/config.h>
5 4
6#include <asm/ptrace.h> 5#include <asm/ptrace.h>
7#include <asm/signal.h> 6#include <asm/signal.h>
diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h
index 93f45c5f189f..e928675de352 100644
--- a/include/asm-ia64/ide.h
+++ b/include/asm-ia64/ide.h
@@ -13,7 +13,6 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/config.h>
17 16
18#include <linux/irq.h> 17#include <linux/irq.h>
19 18
diff --git a/include/asm-ia64/intrinsics.h b/include/asm-ia64/intrinsics.h
index 8089f955e5d2..3a95aa432e99 100644
--- a/include/asm-ia64/intrinsics.h
+++ b/include/asm-ia64/intrinsics.h
@@ -9,7 +9,6 @@
9 */ 9 */
10 10
11#ifndef __ASSEMBLY__ 11#ifndef __ASSEMBLY__
12#include <linux/config.h>
13 12
14/* include compiler specific intrinsics */ 13/* include compiler specific intrinsics */
15#include <asm/ia64regs.h> 14#include <asm/ia64regs.h>
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h
index c2e3742108bb..781ee2c7e8c3 100644
--- a/include/asm-ia64/io.h
+++ b/include/asm-ia64/io.h
@@ -88,6 +88,7 @@ phys_to_virt (unsigned long address)
88} 88}
89 89
90#define ARCH_HAS_VALID_PHYS_ADDR_RANGE 90#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
91extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size);
91extern int valid_phys_addr_range (unsigned long addr, size_t count); /* efi.c */ 92extern int valid_phys_addr_range (unsigned long addr, size_t count); /* efi.c */
92extern int valid_mmap_phys_addr_range (unsigned long addr, size_t count); 93extern int valid_mmap_phys_addr_range (unsigned long addr, size_t count);
93 94
diff --git a/include/asm-ia64/kmap_types.h b/include/asm-ia64/kmap_types.h
index bc777525fa12..5d1658aa2b3b 100644
--- a/include/asm-ia64/kmap_types.h
+++ b/include/asm-ia64/kmap_types.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_IA64_KMAP_TYPES_H 1#ifndef _ASM_IA64_KMAP_TYPES_H
2#define _ASM_IA64_KMAP_TYPES_H 2#define _ASM_IA64_KMAP_TYPES_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_DEBUG_HIGHMEM 5#ifdef CONFIG_DEBUG_HIGHMEM
7# define D(n) __KM_FENCE_##n , 6# define D(n) __KM_FENCE_##n ,
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
index a9c995a86c21..15b545a897a4 100644
--- a/include/asm-ia64/machvec.h
+++ b/include/asm-ia64/machvec.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_IA64_MACHVEC_H 10#ifndef _ASM_IA64_MACHVEC_H
11#define _ASM_IA64_MACHVEC_H 11#define _ASM_IA64_MACHVEC_H
12 12
13#include <linux/config.h>
14#include <linux/types.h> 13#include <linux/types.h>
15 14
16/* forward declarations: */ 15/* forward declarations: */
@@ -76,6 +75,7 @@ typedef unsigned char ia64_mv_readb_relaxed_t (const volatile void __iomem *);
76typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *); 75typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *);
77typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *); 76typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *);
78typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *); 77typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *);
78typedef int ia64_mv_msi_init_t (void);
79 79
80static inline void 80static inline void
81machvec_noop (void) 81machvec_noop (void)
@@ -154,6 +154,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *);
154# define platform_readl_relaxed ia64_mv.readl_relaxed 154# define platform_readl_relaxed ia64_mv.readl_relaxed
155# define platform_readq_relaxed ia64_mv.readq_relaxed 155# define platform_readq_relaxed ia64_mv.readq_relaxed
156# define platform_migrate ia64_mv.migrate 156# define platform_migrate ia64_mv.migrate
157# define platform_msi_init ia64_mv.msi_init
157# endif 158# endif
158 159
159/* __attribute__((__aligned__(16))) is required to make size of the 160/* __attribute__((__aligned__(16))) is required to make size of the
@@ -203,6 +204,7 @@ struct ia64_machine_vector {
203 ia64_mv_readl_relaxed_t *readl_relaxed; 204 ia64_mv_readl_relaxed_t *readl_relaxed;
204 ia64_mv_readq_relaxed_t *readq_relaxed; 205 ia64_mv_readq_relaxed_t *readq_relaxed;
205 ia64_mv_migrate_t *migrate; 206 ia64_mv_migrate_t *migrate;
207 ia64_mv_msi_init_t *msi_init;
206} __attribute__((__aligned__(16))); /* align attrib? see above comment */ 208} __attribute__((__aligned__(16))); /* align attrib? see above comment */
207 209
208#define MACHVEC_INIT(name) \ 210#define MACHVEC_INIT(name) \
@@ -248,6 +250,7 @@ struct ia64_machine_vector {
248 platform_readl_relaxed, \ 250 platform_readl_relaxed, \
249 platform_readq_relaxed, \ 251 platform_readq_relaxed, \
250 platform_migrate, \ 252 platform_migrate, \
253 platform_msi_init, \
251} 254}
252 255
253extern struct ia64_machine_vector ia64_mv; 256extern struct ia64_machine_vector ia64_mv;
@@ -401,5 +404,8 @@ extern int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size
401#ifndef platform_migrate 404#ifndef platform_migrate
402# define platform_migrate machvec_noop_task 405# define platform_migrate machvec_noop_task
403#endif 406#endif
407#ifndef platform_msi_init
408# define platform_msi_init ((ia64_mv_msi_init_t*)NULL)
409#endif
404 410
405#endif /* _ASM_IA64_MACHVEC_H */ 411#endif /* _ASM_IA64_MACHVEC_H */
diff --git a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h
index da1d43755afe..cf724dc79d8c 100644
--- a/include/asm-ia64/machvec_sn2.h
+++ b/include/asm-ia64/machvec_sn2.h
@@ -67,6 +67,8 @@ extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device;
67extern ia64_mv_dma_mapping_error sn_dma_mapping_error; 67extern ia64_mv_dma_mapping_error sn_dma_mapping_error;
68extern ia64_mv_dma_supported sn_dma_supported; 68extern ia64_mv_dma_supported sn_dma_supported;
69extern ia64_mv_migrate_t sn_migrate; 69extern ia64_mv_migrate_t sn_migrate;
70extern ia64_mv_msi_init_t sn_msi_init;
71
70 72
71/* 73/*
72 * This stuff has dual use! 74 * This stuff has dual use!
@@ -117,6 +119,11 @@ extern ia64_mv_migrate_t sn_migrate;
117#define platform_dma_mapping_error sn_dma_mapping_error 119#define platform_dma_mapping_error sn_dma_mapping_error
118#define platform_dma_supported sn_dma_supported 120#define platform_dma_supported sn_dma_supported
119#define platform_migrate sn_migrate 121#define platform_migrate sn_migrate
122#ifdef CONFIG_PCI_MSI
123#define platform_msi_init sn_msi_init
124#else
125#define platform_msi_init ((ia64_mv_msi_init_t*)NULL)
126#endif
120 127
121#include <asm/sn/io.h> 128#include <asm/sn/io.h>
122 129
diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h
index 9c5389b7e623..ee97f7c2d462 100644
--- a/include/asm-ia64/mca.h
+++ b/include/asm-ia64/mca.h
@@ -69,14 +69,16 @@ typedef struct ia64_mc_info_s {
69 */ 69 */
70 70
71struct ia64_sal_os_state { 71struct ia64_sal_os_state {
72 /* SAL to OS, must be at offset 0 */ 72
73 /* SAL to OS */
73 u64 os_gp; /* GP of the os registered with the SAL, physical */ 74 u64 os_gp; /* GP of the os registered with the SAL, physical */
74 u64 pal_proc; /* PAL_PROC entry point, physical */ 75 u64 pal_proc; /* PAL_PROC entry point, physical */
75 u64 sal_proc; /* SAL_PROC entry point, physical */ 76 u64 sal_proc; /* SAL_PROC entry point, physical */
76 u64 rv_rc; /* MCA - Rendezvous state, INIT - reason code */ 77 u64 rv_rc; /* MCA - Rendezvous state, INIT - reason code */
77 u64 proc_state_param; /* from R18 */ 78 u64 proc_state_param; /* from R18 */
78 u64 monarch; /* 1 for a monarch event, 0 for a slave */ 79 u64 monarch; /* 1 for a monarch event, 0 for a slave */
79 /* common, must follow SAL to OS */ 80
81 /* common */
80 u64 sal_ra; /* Return address in SAL, physical */ 82 u64 sal_ra; /* Return address in SAL, physical */
81 u64 sal_gp; /* GP of the SAL - physical */ 83 u64 sal_gp; /* GP of the SAL - physical */
82 pal_min_state_area_t *pal_min_state; /* from R17. physical in asm, virtual in C */ 84 pal_min_state_area_t *pal_min_state; /* from R17. physical in asm, virtual in C */
@@ -98,7 +100,8 @@ struct ia64_sal_os_state {
98 u64 iipa; 100 u64 iipa;
99 u64 iim; 101 u64 iim;
100 u64 iha; 102 u64 iha;
101 /* OS to SAL, must follow common */ 103
104 /* OS to SAL */
102 u64 os_status; /* OS status to SAL, enum below */ 105 u64 os_status; /* OS status to SAL, enum below */
103 u64 context; /* 0 if return to same context 106 u64 context; /* 0 if return to same context
104 1 if return to new context */ 107 1 if return to new context */
diff --git a/include/asm-ia64/meminit.h b/include/asm-ia64/meminit.h
index 46501b01a5c5..894bc4d89dc0 100644
--- a/include/asm-ia64/meminit.h
+++ b/include/asm-ia64/meminit.h
@@ -7,7 +7,6 @@
7 * for more details. 7 * for more details.
8 */ 8 */
9 9
10#include <linux/config.h>
11 10
12/* 11/*
13 * Entries defined so far: 12 * Entries defined so far:
diff --git a/include/asm-ia64/msi.h b/include/asm-ia64/msi.h
index 97890f7762b3..bb92b0dbde2f 100644
--- a/include/asm-ia64/msi.h
+++ b/include/asm-ia64/msi.h
@@ -14,4 +14,16 @@ static inline void set_intr_gate (int nr, void *func) {}
14#define ack_APIC_irq ia64_eoi 14#define ack_APIC_irq ia64_eoi
15#define MSI_TARGET_CPU_SHIFT 4 15#define MSI_TARGET_CPU_SHIFT 4
16 16
17extern struct msi_ops msi_apic_ops;
18
19static inline int msi_arch_init(void)
20{
21 if (platform_msi_init)
22 return platform_msi_init();
23
24 /* default ops for most ia64 platforms */
25 msi_register(&msi_apic_ops);
26 return 0;
27}
28
17#endif /* ASM_MSI_H */ 29#endif /* ASM_MSI_H */
diff --git a/include/asm-ia64/nodedata.h b/include/asm-ia64/nodedata.h
index 9978c7ce7549..a140310bf84d 100644
--- a/include/asm-ia64/nodedata.h
+++ b/include/asm-ia64/nodedata.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_IA64_NODEDATA_H 11#ifndef _ASM_IA64_NODEDATA_H
12#define _ASM_IA64_NODEDATA_H 12#define _ASM_IA64_NODEDATA_H
13 13
14#include <linux/config.h>
15#include <linux/numa.h> 14#include <linux/numa.h>
16 15
17#include <asm/percpu.h> 16#include <asm/percpu.h>
diff --git a/include/asm-ia64/numa.h b/include/asm-ia64/numa.h
index dae6aeb7b119..e5a8260593a5 100644
--- a/include/asm-ia64/numa.h
+++ b/include/asm-ia64/numa.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_IA64_NUMA_H 11#ifndef _ASM_IA64_NUMA_H
12#define _ASM_IA64_NUMA_H 12#define _ASM_IA64_NUMA_H
13 13
14#include <linux/config.h>
15 14
16#ifdef CONFIG_NUMA 15#ifdef CONFIG_NUMA
17 16
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
index 2087825eefa4..f5a949ec6e1e 100644
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -7,7 +7,6 @@
7 * David Mosberger-Tang <davidm@hpl.hp.com> 7 * David Mosberger-Tang <davidm@hpl.hp.com>
8 */ 8 */
9 9
10#include <linux/config.h>
11 10
12#include <asm/intrinsics.h> 11#include <asm/intrinsics.h>
13#include <asm/types.h> 12#include <asm/types.h>
diff --git a/include/asm-ia64/param.h b/include/asm-ia64/param.h
index 5e1e0d2d7baf..49c62dd5eccf 100644
--- a/include/asm-ia64/param.h
+++ b/include/asm-ia64/param.h
@@ -19,7 +19,6 @@
19#define MAXHOSTNAMELEN 64 /* max length of hostname */ 19#define MAXHOSTNAMELEN 64 /* max length of hostname */
20 20
21#ifdef __KERNEL__ 21#ifdef __KERNEL__
22# include <linux/config.h> /* mustn't include <linux/config.h> outside of #ifdef __KERNEL__ */
23# ifdef CONFIG_IA64_HP_SIM 22# ifdef CONFIG_IA64_HP_SIM
24 /* 23 /*
25 * Yeah, simulating stuff is slow, so let us catch some breath between 24 * Yeah, simulating stuff is slow, so let us catch some breath between
diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h
index 2b14dee29ce7..ae357d504fba 100644
--- a/include/asm-ia64/percpu.h
+++ b/include/asm-ia64/percpu.h
@@ -12,7 +12,6 @@
12# define THIS_CPU(var) (per_cpu__##var) /* use this to mark accesses to per-CPU variables... */ 12# define THIS_CPU(var) (per_cpu__##var) /* use this to mark accesses to per-CPU variables... */
13#else /* !__ASSEMBLY__ */ 13#else /* !__ASSEMBLY__ */
14 14
15#include <linux/config.h>
16 15
17#include <linux/threads.h> 16#include <linux/threads.h>
18 17
diff --git a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h
index f2f233846476..9cb68e9b377e 100644
--- a/include/asm-ia64/pgalloc.h
+++ b/include/asm-ia64/pgalloc.h
@@ -13,7 +13,6 @@
13 * Copyright (C) 2000, Goutham Rao <goutham.rao@intel.com> 13 * Copyright (C) 2000, Goutham Rao <goutham.rao@intel.com>
14 */ 14 */
15 15
16#include <linux/config.h>
17 16
18#include <linux/compiler.h> 17#include <linux/compiler.h>
19#include <linux/mm.h> 18#include <linux/mm.h>
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h
index c0f8144f2349..228981cadf8f 100644
--- a/include/asm-ia64/pgtable.h
+++ b/include/asm-ia64/pgtable.h
@@ -12,7 +12,6 @@
12 * David Mosberger-Tang <davidm@hpl.hp.com> 12 * David Mosberger-Tang <davidm@hpl.hp.com>
13 */ 13 */
14 14
15#include <linux/config.h>
16 15
17#include <asm/mman.h> 16#include <asm/mman.h>
18#include <asm/page.h> 17#include <asm/page.h>
@@ -317,22 +316,20 @@ ia64_phys_addr_valid (unsigned long addr)
317#define pte_mkhuge(pte) (__pte(pte_val(pte))) 316#define pte_mkhuge(pte) (__pte(pte_val(pte)))
318 317
319/* 318/*
320 * Macro to a page protection value as "uncacheable". Note that "protection" is really a 319 * Make page protection values cacheable, uncacheable, or write-
321 * misnomer here as the protection value contains the memory attribute bits, dirty bits, 320 * combining. Note that "protection" is really a misnomer here as the
322 * and various other bits as well. 321 * protection value contains the memory attribute bits, dirty bits, and
322 * various other bits as well.
323 */ 323 */
324#define pgprot_cacheable(prot) __pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_WB)
324#define pgprot_noncached(prot) __pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_UC) 325#define pgprot_noncached(prot) __pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_UC)
325
326/*
327 * Macro to make mark a page protection value as "write-combining".
328 * Note that "protection" is really a misnomer here as the protection
329 * value contains the memory attribute bits, dirty bits, and various
330 * other bits as well. Accesses through a write-combining translation
331 * works bypasses the caches, but does allow for consecutive writes to
332 * be combined into single (but larger) write transactions.
333 */
334#define pgprot_writecombine(prot) __pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_WC) 326#define pgprot_writecombine(prot) __pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_WC)
335 327
328struct file;
329extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
330 unsigned long size, pgprot_t vma_prot);
331#define __HAVE_PHYS_MEM_ACCESS_PROT
332
336static inline unsigned long 333static inline unsigned long
337pgd_index (unsigned long address) 334pgd_index (unsigned long address)
338{ 335{
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index b3bd58e80690..265f4824db0e 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -13,7 +13,6 @@
13 * 06/16/00 A. Mallick added csd/ssd/tssd for ia32 support 13 * 06/16/00 A. Mallick added csd/ssd/tssd for ia32 support
14 */ 14 */
15 15
16#include <linux/config.h>
17 16
18#include <asm/intrinsics.h> 17#include <asm/intrinsics.h>
19#include <asm/kregs.h> 18#include <asm/kregs.h>
diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h
index 9471cdc3f4c0..415abb23b210 100644
--- a/include/asm-ia64/ptrace.h
+++ b/include/asm-ia64/ptrace.h
@@ -54,7 +54,6 @@
54 * This is because ar.ec is saved as part of ar.pfs. 54 * This is because ar.ec is saved as part of ar.pfs.
55 */ 55 */
56 56
57#include <linux/config.h>
58 57
59#include <asm/fpu.h> 58#include <asm/fpu.h>
60#ifndef ASM_OFFSETS_C 59#ifndef ASM_OFFSETS_C
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h
index a3914352c995..719ff309ce09 100644
--- a/include/asm-ia64/smp.h
+++ b/include/asm-ia64/smp.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_IA64_SMP_H 10#ifndef _ASM_IA64_SMP_H
11#define _ASM_IA64_SMP_H 11#define _ASM_IA64_SMP_H
12 12
13#include <linux/config.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/threads.h> 14#include <linux/threads.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
diff --git a/include/asm-ia64/sn/intr.h b/include/asm-ia64/sn/intr.h
index 60a51a406eec..12b54ddb06be 100644
--- a/include/asm-ia64/sn/intr.h
+++ b/include/asm-ia64/sn/intr.h
@@ -10,6 +10,7 @@
10#define _ASM_IA64_SN_INTR_H 10#define _ASM_IA64_SN_INTR_H
11 11
12#include <linux/rcupdate.h> 12#include <linux/rcupdate.h>
13#include <asm/sn/types.h>
13 14
14#define SGI_UART_VECTOR 0xe9 15#define SGI_UART_VECTOR 0xe9
15 16
@@ -40,6 +41,7 @@ struct sn_irq_info {
40 int irq_cpuid; /* kernel logical cpuid */ 41 int irq_cpuid; /* kernel logical cpuid */
41 int irq_irq; /* the IRQ number */ 42 int irq_irq; /* the IRQ number */
42 int irq_int_bit; /* Bridge interrupt pin */ 43 int irq_int_bit; /* Bridge interrupt pin */
44 /* <0 means MSI */
43 u64 irq_xtalkaddr; /* xtalkaddr IRQ is sent to */ 45 u64 irq_xtalkaddr; /* xtalkaddr IRQ is sent to */
44 int irq_bridge_type;/* pciio asic type (pciio.h) */ 46 int irq_bridge_type;/* pciio asic type (pciio.h) */
45 void *irq_bridge; /* bridge generating irq */ 47 void *irq_bridge; /* bridge generating irq */
@@ -53,6 +55,12 @@ struct sn_irq_info {
53}; 55};
54 56
55extern void sn_send_IPI_phys(int, long, int, int); 57extern void sn_send_IPI_phys(int, long, int, int);
58extern u64 sn_intr_alloc(nasid_t, int,
59 struct sn_irq_info *,
60 int, nasid_t, int);
61extern void sn_intr_free(nasid_t, int, struct sn_irq_info *);
62extern struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *, nasid_t, int);
63extern struct list_head **sn_irq_lh;
56 64
57#define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector) 65#define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector)
58 66
diff --git a/include/asm-ia64/sn/pcibr_provider.h b/include/asm-ia64/sn/pcibr_provider.h
index 51260ab70d91..e3b0c3fe5eed 100644
--- a/include/asm-ia64/sn/pcibr_provider.h
+++ b/include/asm-ia64/sn/pcibr_provider.h
@@ -55,6 +55,7 @@
55#define PCI32_ATE_V (0x1 << 0) 55#define PCI32_ATE_V (0x1 << 0)
56#define PCI32_ATE_CO (0x1 << 1) 56#define PCI32_ATE_CO (0x1 << 1)
57#define PCI32_ATE_PREC (0x1 << 2) 57#define PCI32_ATE_PREC (0x1 << 2)
58#define PCI32_ATE_MSI (0x1 << 2)
58#define PCI32_ATE_PREF (0x1 << 3) 59#define PCI32_ATE_PREF (0x1 << 3)
59#define PCI32_ATE_BAR (0x1 << 4) 60#define PCI32_ATE_BAR (0x1 << 4)
60#define PCI32_ATE_ADDR_SHFT 12 61#define PCI32_ATE_ADDR_SHFT 12
@@ -117,8 +118,8 @@ struct pcibus_info {
117 118
118extern int pcibr_init_provider(void); 119extern int pcibr_init_provider(void);
119extern void *pcibr_bus_fixup(struct pcibus_bussoft *, struct pci_controller *); 120extern void *pcibr_bus_fixup(struct pcibus_bussoft *, struct pci_controller *);
120extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t); 121extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t, int type);
121extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t); 122extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t, int type);
122extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int); 123extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int);
123 124
124/* 125/*
diff --git a/include/asm-ia64/sn/pcibus_provider_defs.h b/include/asm-ia64/sn/pcibus_provider_defs.h
index ce3f6c328241..8f7c83d0f6d3 100644
--- a/include/asm-ia64/sn/pcibus_provider_defs.h
+++ b/include/asm-ia64/sn/pcibus_provider_defs.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8#ifndef _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H 8#ifndef _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H
9#define _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H 9#define _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H
@@ -45,13 +45,24 @@ struct pci_controller;
45 */ 45 */
46 46
47struct sn_pcibus_provider { 47struct sn_pcibus_provider {
48 dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t); 48 dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t, int flags);
49 dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t); 49 dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t, int flags);
50 void (*dma_unmap)(struct pci_dev *, dma_addr_t, int); 50 void (*dma_unmap)(struct pci_dev *, dma_addr_t, int);
51 void * (*bus_fixup)(struct pcibus_bussoft *, struct pci_controller *); 51 void * (*bus_fixup)(struct pcibus_bussoft *, struct pci_controller *);
52 void (*force_interrupt)(struct sn_irq_info *); 52 void (*force_interrupt)(struct sn_irq_info *);
53 void (*target_interrupt)(struct sn_irq_info *); 53 void (*target_interrupt)(struct sn_irq_info *);
54}; 54};
55 55
56/*
57 * Flags used by the map interfaces
58 * bits 3:0 specifies format of passed in address
59 * bit 4 specifies that address is to be used for MSI
60 */
61
62#define SN_DMA_ADDRTYPE(x) ((x) & 0xf)
63#define SN_DMA_ADDR_PHYS 1 /* address is an xio address. */
64#define SN_DMA_ADDR_XIO 2 /* address is phys memory */
65#define SN_DMA_MSI 0x10 /* Bus address is to be used for MSI */
66
56extern struct sn_pcibus_provider *sn_pci_provider[]; 67extern struct sn_pcibus_provider *sn_pci_provider[];
57#endif /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */ 68#endif /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */
diff --git a/include/asm-ia64/sn/simulator.h b/include/asm-ia64/sn/simulator.h
index 16a48b5a039c..c3fd3eb25768 100644
--- a/include/asm-ia64/sn/simulator.h
+++ b/include/asm-ia64/sn/simulator.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_IA64_SN_SIMULATOR_H 8#ifndef _ASM_IA64_SN_SIMULATOR_H
9#define _ASM_IA64_SN_SIMULATOR_H 9#define _ASM_IA64_SN_SIMULATOR_H
10 10
11#include <linux/config.h>
12 11
13#define SNMAGIC 0xaeeeeeee8badbeefL 12#define SNMAGIC 0xaeeeeeee8badbeefL
14#define IS_MEDUSA() ({long sn; asm("mov %0=cpuid[%1]" : "=r"(sn) : "r"(2)); sn == SNMAGIC;}) 13#define IS_MEDUSA() ({long sn; asm("mov %0=cpuid[%1]" : "=r"(sn) : "r"(2)); sn == SNMAGIC;})
diff --git a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h
index 749deb2ca6c1..a676dd9ace3e 100644
--- a/include/asm-ia64/sn/sn_cpuid.h
+++ b/include/asm-ia64/sn/sn_cpuid.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_IA64_SN_SN_CPUID_H 11#ifndef _ASM_IA64_SN_SN_CPUID_H
12#define _ASM_IA64_SN_SN_CPUID_H 12#define _ASM_IA64_SN_SN_CPUID_H
13 13
14#include <linux/config.h>
15#include <linux/smp.h> 14#include <linux/smp.h>
16#include <asm/sn/addrs.h> 15#include <asm/sn/addrs.h>
17#include <asm/sn/pda.h> 16#include <asm/sn/pda.h>
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index 51aca022cf39..cd490b20d592 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -12,7 +12,6 @@
12 */ 12 */
13 13
14 14
15#include <linux/config.h>
16#include <asm/sal.h> 15#include <asm/sal.h>
17#include <asm/sn/sn_cpuid.h> 16#include <asm/sn/sn_cpuid.h>
18#include <asm/sn/arch.h> 17#include <asm/sn/arch.h>
@@ -346,7 +345,7 @@ ia64_sn_plat_set_error_handling_features(void)
346 ret_stuff.v1 = 0; 345 ret_stuff.v1 = 0;
347 ret_stuff.v2 = 0; 346 ret_stuff.v2 = 0;
348 SAL_CALL_REENTRANT(ret_stuff, SN_SAL_SET_ERROR_HANDLING_FEATURES, 347 SAL_CALL_REENTRANT(ret_stuff, SN_SAL_SET_ERROR_HANDLING_FEATURES,
349 (SAL_ERR_FEAT_MCA_SLV_TO_OS_INIT_SLV | SAL_ERR_FEAT_LOG_SBES), 348 SAL_ERR_FEAT_LOG_SBES,
350 0, 0, 0, 0, 0, 0); 349 0, 0, 0, 0, 0, 0);
351 350
352 return ret_stuff.status; 351 return ret_stuff.status;
diff --git a/include/asm-ia64/sn/tiocp.h b/include/asm-ia64/sn/tiocp.h
index f47c08ab483c..e8ad0bb5b6c5 100644
--- a/include/asm-ia64/sn/tiocp.h
+++ b/include/asm-ia64/sn/tiocp.h
@@ -3,13 +3,14 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 2003-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8#ifndef _ASM_IA64_SN_PCI_TIOCP_H 8#ifndef _ASM_IA64_SN_PCI_TIOCP_H
9#define _ASM_IA64_SN_PCI_TIOCP_H 9#define _ASM_IA64_SN_PCI_TIOCP_H
10 10
11#define TIOCP_HOST_INTR_ADDR 0x003FFFFFFFFFFFFFUL 11#define TIOCP_HOST_INTR_ADDR 0x003FFFFFFFFFFFFFUL
12#define TIOCP_PCI64_CMDTYPE_MEM (0x1ull << 60) 12#define TIOCP_PCI64_CMDTYPE_MEM (0x1ull << 60)
13#define TIOCP_PCI64_CMDTYPE_MSI (0x3ull << 60)
13 14
14 15
15/***************************************************************************** 16/*****************************************************************************
diff --git a/include/asm-ia64/sn/xpc.h b/include/asm-ia64/sn/xpc.h
index aa3b8ace9030..8406f1ef4caf 100644
--- a/include/asm-ia64/sn/xpc.h
+++ b/include/asm-ia64/sn/xpc.h
@@ -15,7 +15,6 @@
15#define _ASM_IA64_SN_XPC_H 15#define _ASM_IA64_SN_XPC_H
16 16
17 17
18#include <linux/config.h>
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20#include <linux/sysctl.h> 19#include <linux/sysctl.h>
21#include <linux/device.h> 20#include <linux/device.h>
diff --git a/include/asm-ia64/string.h b/include/asm-ia64/string.h
index 43502d3b57e5..85fd65c52a8c 100644
--- a/include/asm-ia64/string.h
+++ b/include/asm-ia64/string.h
@@ -9,7 +9,6 @@
9 * David Mosberger-Tang <davidm@hpl.hp.com> 9 * David Mosberger-Tang <davidm@hpl.hp.com>
10 */ 10 */
11 11
12#include <linux/config.h> /* remove this once we remove the A-step workaround... */
13 12
14#define __HAVE_ARCH_STRLEN 1 /* see arch/ia64/lib/strlen.S */ 13#define __HAVE_ARCH_STRLEN 1 /* see arch/ia64/lib/strlen.S */
15#define __HAVE_ARCH_MEMSET 1 /* see arch/ia64/lib/memset.S */ 14#define __HAVE_ARCH_MEMSET 1 /* see arch/ia64/lib/memset.S */
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index 2f3620593687..65db43ce4de6 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -12,7 +12,6 @@
12 * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com> 12 * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
13 * Copyright (C) 1999 Don Dugger <don.dugger@intel.com> 13 * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
14 */ 14 */
15#include <linux/config.h>
16 15
17#include <asm/kregs.h> 16#include <asm/kregs.h>
18#include <asm/page.h> 17#include <asm/page.h>
diff --git a/include/asm-ia64/tlb.h b/include/asm-ia64/tlb.h
index 834370b9dea1..26edcb750f9f 100644
--- a/include/asm-ia64/tlb.h
+++ b/include/asm-ia64/tlb.h
@@ -37,7 +37,6 @@
37 * } 37 * }
38 * tlb_finish_mmu(tlb, start, end); // finish unmap for address space MM 38 * tlb_finish_mmu(tlb, start, end); // finish unmap for address space MM
39 */ 39 */
40#include <linux/config.h>
41#include <linux/mm.h> 40#include <linux/mm.h>
42#include <linux/pagemap.h> 41#include <linux/pagemap.h>
43#include <linux/swap.h> 42#include <linux/swap.h>
diff --git a/include/asm-ia64/tlbflush.h b/include/asm-ia64/tlbflush.h
index a35b323bae4c..cf9acb9bb1fb 100644
--- a/include/asm-ia64/tlbflush.h
+++ b/include/asm-ia64/tlbflush.h
@@ -6,7 +6,6 @@
6 * David Mosberger-Tang <davidm@hpl.hp.com> 6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11#include <linux/mm.h> 10#include <linux/mm.h>
12 11
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index 7107763168bf..bb0eb727dcd0 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -265,7 +265,7 @@
265#define __NR_keyctl 1273 265#define __NR_keyctl 1273
266#define __NR_ioprio_set 1274 266#define __NR_ioprio_set 1274
267#define __NR_ioprio_get 1275 267#define __NR_ioprio_get 1275
268/* 1276 is available for reuse (was briefly sys_set_zone_reclaim) */ 268#define __NR_move_pages 1276
269#define __NR_inotify_init 1277 269#define __NR_inotify_init 1277
270#define __NR_inotify_add_watch 1278 270#define __NR_inotify_add_watch 1278
271#define __NR_inotify_rm_watch 1279 271#define __NR_inotify_rm_watch 1279
@@ -294,7 +294,6 @@
294 294
295#ifdef __KERNEL__ 295#ifdef __KERNEL__
296 296
297#include <linux/config.h>
298 297
299#define NR_syscalls 279 /* length of syscall table */ 298#define NR_syscalls 279 /* length of syscall table */
300 299
diff --git a/include/asm-ia64/vga.h b/include/asm-ia64/vga.h
index 091177cda223..02184ecd8208 100644
--- a/include/asm-ia64/vga.h
+++ b/include/asm-ia64/vga.h
@@ -17,7 +17,7 @@
17extern unsigned long vga_console_iobase; 17extern unsigned long vga_console_iobase;
18extern unsigned long vga_console_membase; 18extern unsigned long vga_console_membase;
19 19
20#define VGA_MAP_MEM(x) ((unsigned long) ioremap_nocache(vga_console_membase + (x), 0)) 20#define VGA_MAP_MEM(x,s) ((unsigned long) ioremap_nocache(vga_console_membase + (x), s))
21 21
22#define vga_readb(x) (*(x)) 22#define vga_readb(x) (*(x))
23#define vga_writeb(x,y) (*(y) = (x)) 23#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/asm-m32r/assembler.h b/include/asm-m32r/assembler.h
index 1a1aa17edd33..47041d19d4a8 100644
--- a/include/asm-m32r/assembler.h
+++ b/include/asm-m32r/assembler.h
@@ -9,7 +9,6 @@
9 * This file contains M32R architecture specific macro definitions. 9 * This file contains M32R architecture specific macro definitions.
10 */ 10 */
11 11
12#include <linux/config.h>
13 12
14#ifndef __STR 13#ifndef __STR
15#ifdef __ASSEMBLY__ 14#ifdef __ASSEMBLY__
diff --git a/include/asm-m32r/atomic.h b/include/asm-m32r/atomic.h
index 3122fe106f05..f5a7d7301c72 100644
--- a/include/asm-m32r/atomic.h
+++ b/include/asm-m32r/atomic.h
@@ -9,7 +9,6 @@
9 * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> 9 * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <asm/assembler.h> 12#include <asm/assembler.h>
14#include <asm/system.h> 13#include <asm/system.h>
15 14
diff --git a/include/asm-m32r/bitops.h b/include/asm-m32r/bitops.h
index 902a366101a5..66ab672162cd 100644
--- a/include/asm-m32r/bitops.h
+++ b/include/asm-m32r/bitops.h
@@ -11,7 +11,6 @@
11 * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> 11 * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org>
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/compiler.h> 14#include <linux/compiler.h>
16#include <asm/assembler.h> 15#include <asm/assembler.h>
17#include <asm/system.h> 16#include <asm/system.h>
diff --git a/include/asm-m32r/cacheflush.h b/include/asm-m32r/cacheflush.h
index e57427b6e249..8b261b49149e 100644
--- a/include/asm-m32r/cacheflush.h
+++ b/include/asm-m32r/cacheflush.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_M32R_CACHEFLUSH_H 1#ifndef _ASM_M32R_CACHEFLUSH_H
2#define _ASM_M32R_CACHEFLUSH_H 2#define _ASM_M32R_CACHEFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6 5
7extern void _flush_cache_all(void); 6extern void _flush_cache_all(void);
diff --git a/include/asm-m32r/hardirq.h b/include/asm-m32r/hardirq.h
index 5da830ec1587..cb8aa762f235 100644
--- a/include/asm-m32r/hardirq.h
+++ b/include/asm-m32r/hardirq.h
@@ -2,7 +2,6 @@
2#ifndef __ASM_HARDIRQ_H 2#ifndef __ASM_HARDIRQ_H
3#define __ASM_HARDIRQ_H 3#define __ASM_HARDIRQ_H
4 4
5#include <linux/config.h>
6#include <linux/threads.h> 5#include <linux/threads.h>
7#include <linux/irq.h> 6#include <linux/irq.h>
8 7
diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h
index f7aa96970d18..219a0f74eff3 100644
--- a/include/asm-m32r/ide.h
+++ b/include/asm-m32r/ide.h
@@ -15,7 +15,6 @@
15 15
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17 17
18#include <linux/config.h>
19 18
20#ifndef MAX_HWIFS 19#ifndef MAX_HWIFS
21# ifdef CONFIG_BLK_DEV_IDEPCI 20# ifdef CONFIG_BLK_DEV_IDEPCI
diff --git a/include/asm-m32r/irq.h b/include/asm-m32r/irq.h
index ca943954572a..2f93f4743add 100644
--- a/include/asm-m32r/irq.h
+++ b/include/asm-m32r/irq.h
@@ -2,7 +2,6 @@
2#ifndef _ASM_M32R_IRQ_H 2#ifndef _ASM_M32R_IRQ_H
3#define _ASM_M32R_IRQ_H 3#define _ASM_M32R_IRQ_H
4 4
5#include <linux/config.h>
6 5
7#if defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_USRV) 6#if defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_USRV)
8/* 7/*
diff --git a/include/asm-m32r/kmap_types.h b/include/asm-m32r/kmap_types.h
index 7429591010b6..0524d89edb0f 100644
--- a/include/asm-m32r/kmap_types.h
+++ b/include/asm-m32r/kmap_types.h
@@ -3,7 +3,6 @@
3 3
4/* Dummy header just to define km_type. */ 4/* Dummy header just to define km_type. */
5 5
6#include <linux/config.h>
7 6
8#ifdef CONFIG_DEBUG_HIGHMEM 7#ifdef CONFIG_DEBUG_HIGHMEM
9# define D(n) __KM_FENCE_##n , 8# define D(n) __KM_FENCE_##n ,
diff --git a/include/asm-m32r/m32104ut/m32104ut_pld.h b/include/asm-m32r/m32104ut/m32104ut_pld.h
index a4eac20553df..6ba4ddf7dcf7 100644
--- a/include/asm-m32r/m32104ut/m32104ut_pld.h
+++ b/include/asm-m32r/m32104ut/m32104ut_pld.h
@@ -15,7 +15,6 @@
15#ifndef _M32104UT_M32104UT_PLD_H 15#ifndef _M32104UT_M32104UT_PLD_H
16#define _M32104UT_M32104UT_PLD_H 16#define _M32104UT_M32104UT_PLD_H
17 17
18#include <linux/config.h>
19 18
20#if defined(CONFIG_PLAT_M32104UT) 19#if defined(CONFIG_PLAT_M32104UT)
21#define PLD_PLAT_BASE 0x02c00000 20#define PLD_PLAT_BASE 0x02c00000
diff --git a/include/asm-m32r/m32700ut/m32700ut_lan.h b/include/asm-m32r/m32700ut/m32700ut_lan.h
index 50545ec9c42c..c050b19e8101 100644
--- a/include/asm-m32r/m32700ut/m32700ut_lan.h
+++ b/include/asm-m32r/m32700ut/m32700ut_lan.h
@@ -15,7 +15,6 @@
15#ifndef _M32700UT_M32700UT_LAN_H 15#ifndef _M32700UT_M32700UT_LAN_H
16#define _M32700UT_M32700UT_LAN_H 16#define _M32700UT_M32700UT_LAN_H
17 17
18#include <linux/config.h>
19 18
20#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
21/* 20/*
diff --git a/include/asm-m32r/m32700ut/m32700ut_lcd.h b/include/asm-m32r/m32700ut/m32700ut_lcd.h
index ede6c77bd5e6..4da4e822e2f3 100644
--- a/include/asm-m32r/m32700ut/m32700ut_lcd.h
+++ b/include/asm-m32r/m32700ut/m32700ut_lcd.h
@@ -15,7 +15,6 @@
15#ifndef _M32700UT_M32700UT_LCD_H 15#ifndef _M32700UT_M32700UT_LCD_H
16#define _M32700UT_M32700UT_LCD_H 16#define _M32700UT_M32700UT_LCD_H
17 17
18#include <linux/config.h>
19 18
20#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
21/* 20/*
diff --git a/include/asm-m32r/m32700ut/m32700ut_pld.h b/include/asm-m32r/m32700ut/m32700ut_pld.h
index f5e479486696..f35f9159acff 100644
--- a/include/asm-m32r/m32700ut/m32700ut_pld.h
+++ b/include/asm-m32r/m32700ut/m32700ut_pld.h
@@ -15,7 +15,6 @@
15#ifndef _M32700UT_M32700UT_PLD_H 15#ifndef _M32700UT_M32700UT_PLD_H
16#define _M32700UT_M32700UT_PLD_H 16#define _M32700UT_M32700UT_PLD_H
17 17
18#include <linux/config.h>
19 18
20#if defined(CONFIG_PLAT_M32700UT_Alpha) 19#if defined(CONFIG_PLAT_M32700UT_Alpha)
21#define PLD_PLAT_BASE 0x08c00000 20#define PLD_PLAT_BASE 0x08c00000
diff --git a/include/asm-m32r/m32r.h b/include/asm-m32r/m32r.h
index b133ca61acf1..decfc59907c7 100644
--- a/include/asm-m32r/m32r.h
+++ b/include/asm-m32r/m32r.h
@@ -7,7 +7,6 @@
7 * Copyright (C) 2003, 2004 Renesas Technology Corp. 7 * Copyright (C) 2003, 2004 Renesas Technology Corp.
8 */ 8 */
9 9
10#include <linux/config.h>
11 10
12/* Chip type */ 11/* Chip type */
13#if defined(CONFIG_CHIP_XNUX_MP) || defined(CONFIG_CHIP_XNUX2_MP) 12#if defined(CONFIG_CHIP_XNUX_MP) || defined(CONFIG_CHIP_XNUX2_MP)
diff --git a/include/asm-m32r/mmu.h b/include/asm-m32r/mmu.h
index 9c00eb78ee50..cf3f6d78ac66 100644
--- a/include/asm-m32r/mmu.h
+++ b/include/asm-m32r/mmu.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_M32R_MMU_H 1#ifndef _ASM_M32R_MMU_H
2#define _ASM_M32R_MMU_H 2#define _ASM_M32R_MMU_H
3 3
4#include <linux/config.h>
5 4
6#if !defined(CONFIG_MMU) 5#if !defined(CONFIG_MMU)
7typedef struct { 6typedef struct {
diff --git a/include/asm-m32r/mmu_context.h b/include/asm-m32r/mmu_context.h
index 3634c5361a9b..542302eb6bcb 100644
--- a/include/asm-m32r/mmu_context.h
+++ b/include/asm-m32r/mmu_context.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7 6
8#include <asm/m32r.h> 7#include <asm/m32r.h>
9 8
@@ -15,7 +14,6 @@
15 14
16#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
17 16
18#include <linux/config.h>
19#include <asm/atomic.h> 17#include <asm/atomic.h>
20#include <asm/pgalloc.h> 18#include <asm/pgalloc.h>
21#include <asm/mmu.h> 19#include <asm/mmu.h>
diff --git a/include/asm-m32r/opsput/opsput_lan.h b/include/asm-m32r/opsput/opsput_lan.h
index 7a2a839eedab..61948296f445 100644
--- a/include/asm-m32r/opsput/opsput_lan.h
+++ b/include/asm-m32r/opsput/opsput_lan.h
@@ -15,7 +15,6 @@
15#ifndef _OPSPUT_OPSPUT_LAN_H 15#ifndef _OPSPUT_OPSPUT_LAN_H
16#define _OPSPUT_OPSPUT_LAN_H 16#define _OPSPUT_OPSPUT_LAN_H
17 17
18#include <linux/config.h>
19 18
20#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
21/* 20/*
diff --git a/include/asm-m32r/opsput/opsput_lcd.h b/include/asm-m32r/opsput/opsput_lcd.h
index 3a883e3d7187..44cfd7fe2d88 100644
--- a/include/asm-m32r/opsput/opsput_lcd.h
+++ b/include/asm-m32r/opsput/opsput_lcd.h
@@ -15,7 +15,6 @@
15#ifndef _OPSPUT_OPSPUT_LCD_H 15#ifndef _OPSPUT_OPSPUT_LCD_H
16#define _OPSPUT_OPSPUT_LCD_H 16#define _OPSPUT_OPSPUT_LCD_H
17 17
18#include <linux/config.h>
19 18
20#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
21/* 20/*
diff --git a/include/asm-m32r/opsput/opsput_pld.h b/include/asm-m32r/opsput/opsput_pld.h
index 2018e6925035..46296fe1ec1a 100644
--- a/include/asm-m32r/opsput/opsput_pld.h
+++ b/include/asm-m32r/opsput/opsput_pld.h
@@ -15,7 +15,6 @@
15#ifndef _OPSPUT_OPSPUT_PLD_H 15#ifndef _OPSPUT_OPSPUT_PLD_H
16#define _OPSPUT_OPSPUT_PLD_H 16#define _OPSPUT_OPSPUT_PLD_H
17 17
18#include <linux/config.h>
19 18
20#define PLD_PLAT_BASE 0x1cc00000 19#define PLD_PLAT_BASE 0x1cc00000
21 20
diff --git a/include/asm-m32r/page.h b/include/asm-m32r/page.h
index 9ddbc087dbc5..9688be003620 100644
--- a/include/asm-m32r/page.h
+++ b/include/asm-m32r/page.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_M32R_PAGE_H 1#ifndef _ASM_M32R_PAGE_H
2#define _ASM_M32R_PAGE_H 2#define _ASM_M32R_PAGE_H
3 3
4#include <linux/config.h>
5 4
6/* PAGE_SHIFT determines the page size */ 5/* PAGE_SHIFT determines the page size */
7#define PAGE_SHIFT 12 6#define PAGE_SHIFT 12
diff --git a/include/asm-m32r/pgalloc.h b/include/asm-m32r/pgalloc.h
index 6da309b6fda7..e09a86c3cadf 100644
--- a/include/asm-m32r/pgalloc.h
+++ b/include/asm-m32r/pgalloc.h
@@ -3,7 +3,6 @@
3 3
4/* $Id$ */ 4/* $Id$ */
5 5
6#include <linux/config.h>
7#include <linux/mm.h> 6#include <linux/mm.h>
8 7
9#include <asm/io.h> 8#include <asm/io.h>
diff --git a/include/asm-m32r/pgtable-2level.h b/include/asm-m32r/pgtable-2level.h
index 861727c20e8f..be0f167e344a 100644
--- a/include/asm-m32r/pgtable-2level.h
+++ b/include/asm-m32r/pgtable-2level.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7 6
8/* 7/*
9 * traditional M32R two-level paging structure: 8 * traditional M32R two-level paging structure:
diff --git a/include/asm-m32r/pgtable.h b/include/asm-m32r/pgtable.h
index 75740debcd01..1983b7f4527a 100644
--- a/include/asm-m32r/pgtable.h
+++ b/include/asm-m32r/pgtable.h
@@ -20,7 +20,6 @@
20 20
21#ifndef __ASSEMBLY__ 21#ifndef __ASSEMBLY__
22 22
23#include <linux/config.h>
24#include <linux/threads.h> 23#include <linux/threads.h>
25#include <asm/processor.h> 24#include <asm/processor.h>
26#include <asm/addrspace.h> 25#include <asm/addrspace.h>
diff --git a/include/asm-m32r/processor.h b/include/asm-m32r/processor.h
index 09fd1813e780..32755bf136de 100644
--- a/include/asm-m32r/processor.h
+++ b/include/asm-m32r/processor.h
@@ -14,7 +14,6 @@
14 */ 14 */
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/config.h>
18#include <asm/cache.h> 17#include <asm/cache.h>
19#include <asm/ptrace.h> /* pt_regs */ 18#include <asm/ptrace.h> /* pt_regs */
20 19
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h
index 53c792452dfc..a07fa90314d2 100644
--- a/include/asm-m32r/ptrace.h
+++ b/include/asm-m32r/ptrace.h
@@ -12,7 +12,6 @@
12 * Copyright (C) 2001-2002, 2004 Hirokazu Takata <takata at linux-m32r.org> 12 * Copyright (C) 2001-2002, 2004 Hirokazu Takata <takata at linux-m32r.org>
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */ 15#include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */
17 16
18/* 0 - 13 are integer registers (general purpose registers). */ 17/* 0 - 13 are integer registers (general purpose registers). */
diff --git a/include/asm-m32r/rtc.h b/include/asm-m32r/rtc.h
index ec3cdf666c68..6b2b837c5978 100644
--- a/include/asm-m32r/rtc.h
+++ b/include/asm-m32r/rtc.h
@@ -4,7 +4,6 @@
4#define __RTC_H__ 4#define __RTC_H__
5 5
6 6
7#include <linux/config.h>
8 7
9 /* Dallas DS1302 clock/calendar register numbers. */ 8 /* Dallas DS1302 clock/calendar register numbers. */
10# define RTC_SECONDS 0 9# define RTC_SECONDS 0
diff --git a/include/asm-m32r/semaphore.h b/include/asm-m32r/semaphore.h
index 81750edc8916..41e45d7b87ef 100644
--- a/include/asm-m32r/semaphore.h
+++ b/include/asm-m32r/semaphore.h
@@ -12,7 +12,6 @@
12 * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org> 12 * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org>
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/wait.h> 15#include <linux/wait.h>
17#include <linux/rwsem.h> 16#include <linux/rwsem.h>
18#include <asm/assembler.h> 17#include <asm/assembler.h>
diff --git a/include/asm-m32r/serial.h b/include/asm-m32r/serial.h
index 1bf480f58493..5ac244c72f15 100644
--- a/include/asm-m32r/serial.h
+++ b/include/asm-m32r/serial.h
@@ -3,7 +3,6 @@
3 3
4/* include/asm-m32r/serial.h */ 4/* include/asm-m32r/serial.h */
5 5
6#include <linux/config.h>
7 6
8#define BASE_BAUD 115200 7#define BASE_BAUD 115200
9 8
diff --git a/include/asm-m32r/sigcontext.h b/include/asm-m32r/sigcontext.h
index 942b8a30937d..73025c0c41a1 100644
--- a/include/asm-m32r/sigcontext.h
+++ b/include/asm-m32r/sigcontext.h
@@ -3,7 +3,6 @@
3 3
4/* $Id$ */ 4/* $Id$ */
5 5
6#include <linux/config.h>
7 6
8struct sigcontext { 7struct sigcontext {
9 /* CPU registers */ 8 /* CPU registers */
diff --git a/include/asm-m32r/smp.h b/include/asm-m32r/smp.h
index 1184293e5712..650d2558c304 100644
--- a/include/asm-m32r/smp.h
+++ b/include/asm-m32r/smp.h
@@ -3,7 +3,6 @@
3 3
4/* $Id$ */ 4/* $Id$ */
5 5
6#include <linux/config.h>
7 6
8#ifdef CONFIG_SMP 7#ifdef CONFIG_SMP
9#ifndef __ASSEMBLY__ 8#ifndef __ASSEMBLY__
diff --git a/include/asm-m32r/spinlock.h b/include/asm-m32r/spinlock.h
index 7de7def28da9..f94c1a673569 100644
--- a/include/asm-m32r/spinlock.h
+++ b/include/asm-m32r/spinlock.h
@@ -9,7 +9,6 @@
9 * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> 9 * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org>
10 */ 10 */
11 11
12#include <linux/config.h> /* CONFIG_DEBUG_SPINLOCK, CONFIG_SMP */
13#include <linux/compiler.h> 12#include <linux/compiler.h>
14#include <asm/atomic.h> 13#include <asm/atomic.h>
15#include <asm/page.h> 14#include <asm/page.h>
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h
index e55013f378e5..33567e8bfe6b 100644
--- a/include/asm-m32r/system.h
+++ b/include/asm-m32r/system.h
@@ -10,7 +10,6 @@
10 * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org> 10 * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org>
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <asm/assembler.h> 13#include <asm/assembler.h>
15 14
16#ifdef __KERNEL__ 15#ifdef __KERNEL__
diff --git a/include/asm-m32r/timex.h b/include/asm-m32r/timex.h
index abf12e7ffbf3..e89bfd17db51 100644
--- a/include/asm-m32r/timex.h
+++ b/include/asm-m32r/timex.h
@@ -9,7 +9,6 @@
9 * m32r architecture timex specifications 9 * m32r architecture timex specifications
10 */ 10 */
11 11
12#include <linux/config.h>
13 12
14#define CLOCK_TICK_RATE (CONFIG_BUS_CLOCK / CONFIG_TIMER_DIVIDE) 13#define CLOCK_TICK_RATE (CONFIG_BUS_CLOCK / CONFIG_TIMER_DIVIDE)
15#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ 14#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */
diff --git a/include/asm-m32r/tlbflush.h b/include/asm-m32r/tlbflush.h
index bc7c407dbd92..ae4494960593 100644
--- a/include/asm-m32r/tlbflush.h
+++ b/include/asm-m32r/tlbflush.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_M32R_TLBFLUSH_H 1#ifndef _ASM_M32R_TLBFLUSH_H
2#define _ASM_M32R_TLBFLUSH_H 2#define _ASM_M32R_TLBFLUSH_H
3 3
4#include <linux/config.h>
5#include <asm/m32r.h> 4#include <asm/m32r.h>
6 5
7/* 6/*
diff --git a/include/asm-m32r/uaccess.h b/include/asm-m32r/uaccess.h
index 819cc28a94f7..26e978c7e3b4 100644
--- a/include/asm-m32r/uaccess.h
+++ b/include/asm-m32r/uaccess.h
@@ -11,7 +11,6 @@
11/* 11/*
12 * User space memory access functions 12 * User space memory access functions
13 */ 13 */
14#include <linux/config.h>
15#include <linux/errno.h> 14#include <linux/errno.h>
16#include <linux/thread_info.h> 15#include <linux/thread_info.h>
17#include <asm/page.h> 16#include <asm/page.h>
diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h
index be0eb014c3b0..cc31790d8077 100644
--- a/include/asm-m32r/unistd.h
+++ b/include/asm-m32r/unistd.h
@@ -295,6 +295,8 @@
295#define __NR_kexec_load 283 295#define __NR_kexec_load 283
296#define __NR_waitid 284 296#define __NR_waitid 284
297 297
298#ifdef __KERNEL__
299
298#define NR_syscalls 285 300#define NR_syscalls 285
299 301
300/* user-visible error numbers are in the range -1 - -124: see 302/* user-visible error numbers are in the range -1 - -124: see
@@ -405,7 +407,6 @@ __asm__ __volatile__ (\
405__syscall_return(type,__res); \ 407__syscall_return(type,__res); \
406} 408}
407 409
408#ifdef __KERNEL__
409#define __ARCH_WANT_IPC_PARSE_VERSION 410#define __ARCH_WANT_IPC_PARSE_VERSION
410#define __ARCH_WANT_STAT64 411#define __ARCH_WANT_STAT64
411#define __ARCH_WANT_SYS_ALARM 412#define __ARCH_WANT_SYS_ALARM
@@ -421,7 +422,6 @@ __syscall_return(type,__res); \
421#define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/ 422#define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/
422#define __ARCH_WANT_SYS_OLDUMOUNT 423#define __ARCH_WANT_SYS_OLDUMOUNT
423#define __ARCH_WANT_SYS_RT_SIGACTION 424#define __ARCH_WANT_SYS_RT_SIGACTION
424#endif
425 425
426#ifdef __KERNEL_SYSCALLS__ 426#ifdef __KERNEL_SYSCALLS__
427 427
@@ -470,4 +470,5 @@ asmlinkage long sys_rt_sigaction(int sig,
470#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 470#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
471#endif 471#endif
472 472
473#endif /* __KERNEL__ */
473#endif /* _ASM_M32R_UNISTD_H */ 474#endif /* _ASM_M32R_UNISTD_H */
diff --git a/include/asm-m32r/vga.h b/include/asm-m32r/vga.h
index d0f4b6eed7a3..533163447cc9 100644
--- a/include/asm-m32r/vga.h
+++ b/include/asm-m32r/vga.h
@@ -14,7 +14,7 @@
14 * access the videoram directly without any black magic. 14 * access the videoram directly without any black magic.
15 */ 15 */
16 16
17#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) 17#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
18 18
19#define vga_readb(x) (*(x)) 19#define vga_readb(x) (*(x))
20#define vga_writeb(x,y) (*(y) = (x)) 20#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/asm-m68k/atomic.h b/include/asm-m68k/atomic.h
index 732d696d31a6..d5eed64cb833 100644
--- a/include/asm-m68k/atomic.h
+++ b/include/asm-m68k/atomic.h
@@ -1,7 +1,6 @@
1#ifndef __ARCH_M68K_ATOMIC__ 1#ifndef __ARCH_M68K_ATOMIC__
2#define __ARCH_M68K_ATOMIC__ 2#define __ARCH_M68K_ATOMIC__
3 3
4#include <linux/config.h>
5 4
6#include <asm/system.h> /* local_irq_XXX() */ 5#include <asm/system.h> /* local_irq_XXX() */
7 6
diff --git a/include/asm-m68k/bug.h b/include/asm-m68k/bug.h
index 072ce274d537..7b60776cc966 100644
--- a/include/asm-m68k/bug.h
+++ b/include/asm-m68k/bug.h
@@ -1,7 +1,6 @@
1#ifndef _M68K_BUG_H 1#ifndef _M68K_BUG_H
2#define _M68K_BUG_H 2#define _M68K_BUG_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_BUG 5#ifdef CONFIG_BUG
7#ifdef CONFIG_DEBUG_BUGVERBOSE 6#ifdef CONFIG_DEBUG_BUGVERBOSE
diff --git a/include/asm-m68k/dma-mapping.h b/include/asm-m68k/dma-mapping.h
index b1920c703d82..dffd59cf1364 100644
--- a/include/asm-m68k/dma-mapping.h
+++ b/include/asm-m68k/dma-mapping.h
@@ -1,7 +1,6 @@
1#ifndef _M68K_DMA_MAPPING_H 1#ifndef _M68K_DMA_MAPPING_H
2#define _M68K_DMA_MAPPING_H 2#define _M68K_DMA_MAPPING_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_PCI 5#ifdef CONFIG_PCI
7#include <asm-generic/dma-mapping.h> 6#include <asm-generic/dma-mapping.h>
diff --git a/include/asm-m68k/dma.h b/include/asm-m68k/dma.h
index d5266a886226..d0c9e61e57b4 100644
--- a/include/asm-m68k/dma.h
+++ b/include/asm-m68k/dma.h
@@ -1,7 +1,6 @@
1#ifndef _M68K_DMA_H 1#ifndef _M68K_DMA_H
2#define _M68K_DMA_H 1 2#define _M68K_DMA_H 1
3 3
4#include <linux/config.h>
5 4
6/* it's useless on the m68k, but unfortunately needed by the new 5/* it's useless on the m68k, but unfortunately needed by the new
7 bootmem allocator (but this should do it for this) */ 6 bootmem allocator (but this should do it for this) */
diff --git a/include/asm-m68k/dvma.h b/include/asm-m68k/dvma.h
index 5978f87b0a8a..e1112de5a5e3 100644
--- a/include/asm-m68k/dvma.h
+++ b/include/asm-m68k/dvma.h
@@ -9,7 +9,6 @@
9#ifndef __M68K_DVMA_H 9#ifndef __M68K_DVMA_H
10#define __M68K_DVMA_H 10#define __M68K_DVMA_H
11 11
12#include <linux/config.h>
13 12
14#define DVMA_PAGE_SHIFT 13 13#define DVMA_PAGE_SHIFT 13
15#define DVMA_PAGE_SIZE (1UL << DVMA_PAGE_SHIFT) 14#define DVMA_PAGE_SIZE (1UL << DVMA_PAGE_SHIFT)
diff --git a/include/asm-m68k/elf.h b/include/asm-m68k/elf.h
index 38bf8347f14d..eb63b85f9336 100644
--- a/include/asm-m68k/elf.h
+++ b/include/asm-m68k/elf.h
@@ -5,7 +5,6 @@
5 * ELF register definitions.. 5 * ELF register definitions..
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <asm/ptrace.h> 8#include <asm/ptrace.h>
10#include <asm/user.h> 9#include <asm/user.h>
11 10
diff --git a/include/asm-m68k/entry.h b/include/asm-m68k/entry.h
index 0396495cd97d..f8f6b185d793 100644
--- a/include/asm-m68k/entry.h
+++ b/include/asm-m68k/entry.h
@@ -1,7 +1,6 @@
1#ifndef __M68K_ENTRY_H 1#ifndef __M68K_ENTRY_H
2#define __M68K_ENTRY_H 2#define __M68K_ENTRY_H
3 3
4#include <linux/config.h>
5#include <asm/setup.h> 4#include <asm/setup.h>
6#include <asm/page.h> 5#include <asm/page.h>
7 6
diff --git a/include/asm-m68k/fpu.h b/include/asm-m68k/fpu.h
index 3bcf85065c19..59701d7b4e78 100644
--- a/include/asm-m68k/fpu.h
+++ b/include/asm-m68k/fpu.h
@@ -1,7 +1,6 @@
1#ifndef __M68K_FPU_H 1#ifndef __M68K_FPU_H
2#define __M68K_FPU_H 2#define __M68K_FPU_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * MAX floating point unit state size (FSAVE/FRESTORE) 6 * MAX floating point unit state size (FSAVE/FRESTORE)
diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h
index 5e1c5826c83d..394ee946015c 100644
--- a/include/asm-m68k/hardirq.h
+++ b/include/asm-m68k/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef __M68K_HARDIRQ_H 1#ifndef __M68K_HARDIRQ_H
2#define __M68K_HARDIRQ_H 2#define __M68K_HARDIRQ_H
3 3
4#include <linux/config.h>
5#include <linux/threads.h> 4#include <linux/threads.h>
6#include <linux/cache.h> 5#include <linux/cache.h>
7 6
diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h
index 36118fd01867..365f76fb8013 100644
--- a/include/asm-m68k/ide.h
+++ b/include/asm-m68k/ide.h
@@ -31,7 +31,6 @@
31 31
32#ifdef __KERNEL__ 32#ifdef __KERNEL__
33 33
34#include <linux/config.h>
35 34
36#include <asm/setup.h> 35#include <asm/setup.h>
37#include <asm/io.h> 36#include <asm/io.h>
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h
index dcfaa352d34c..5e0fcf41804d 100644
--- a/include/asm-m68k/io.h
+++ b/include/asm-m68k/io.h
@@ -23,7 +23,6 @@
23 23
24#ifdef __KERNEL__ 24#ifdef __KERNEL__
25 25
26#include <linux/config.h>
27#include <linux/compiler.h> 26#include <linux/compiler.h>
28#include <asm/raw_io.h> 27#include <asm/raw_io.h>
29#include <asm/virtconvert.h> 28#include <asm/virtconvert.h>
diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h
index 9ac047c400c4..9727ca9d9f26 100644
--- a/include/asm-m68k/irq.h
+++ b/include/asm-m68k/irq.h
@@ -1,7 +1,6 @@
1#ifndef _M68K_IRQ_H_ 1#ifndef _M68K_IRQ_H_
2#define _M68K_IRQ_H_ 2#define _M68K_IRQ_H_
3 3
4#include <linux/config.h>
5#include <linux/interrupt.h> 4#include <linux/interrupt.h>
6 5
7/* 6/*
@@ -131,8 +130,4 @@ extern volatile unsigned int num_spurious;
131 */ 130 */
132extern irq_node_t *new_irq_node(void); 131extern irq_node_t *new_irq_node(void);
133 132
134struct irqaction;
135struct pt_regs;
136int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
137
138#endif /* _M68K_IRQ_H_ */ 133#endif /* _M68K_IRQ_H_ */
diff --git a/include/asm-m68k/mc146818rtc.h b/include/asm-m68k/mc146818rtc.h
index 11442095a8cf..11fe12ddb913 100644
--- a/include/asm-m68k/mc146818rtc.h
+++ b/include/asm-m68k/mc146818rtc.h
@@ -4,7 +4,6 @@
4#ifndef _ASM_MC146818RTC_H 4#ifndef _ASM_MC146818RTC_H
5#define _ASM_MC146818RTC_H 5#define _ASM_MC146818RTC_H
6 6
7#include <linux/config.h>
8 7
9#ifdef CONFIG_ATARI 8#ifdef CONFIG_ATARI
10/* RTC in Atari machines */ 9/* RTC in Atari machines */
diff --git a/include/asm-m68k/mmu_context.h b/include/asm-m68k/mmu_context.h
index 661191d15c81..231d11bd8e32 100644
--- a/include/asm-m68k/mmu_context.h
+++ b/include/asm-m68k/mmu_context.h
@@ -1,7 +1,6 @@
1#ifndef __M68K_MMU_CONTEXT_H 1#ifndef __M68K_MMU_CONTEXT_H
2#define __M68K_MMU_CONTEXT_H 2#define __M68K_MMU_CONTEXT_H
3 3
4#include <linux/config.h>
5 4
6static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) 5static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
7{ 6{
diff --git a/include/asm-m68k/motorola_pgtable.h b/include/asm-m68k/motorola_pgtable.h
index 1628723458f5..1ccc7338a54b 100644
--- a/include/asm-m68k/motorola_pgtable.h
+++ b/include/asm-m68k/motorola_pgtable.h
@@ -1,7 +1,6 @@
1#ifndef _MOTOROLA_PGTABLE_H 1#ifndef _MOTOROLA_PGTABLE_H
2#define _MOTOROLA_PGTABLE_H 2#define _MOTOROLA_PGTABLE_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * Definitions for MMU descriptors 6 * Definitions for MMU descriptors
diff --git a/include/asm-m68k/openprom.h b/include/asm-m68k/openprom.h
index efbfb0bec6e2..869ab9176e9f 100644
--- a/include/asm-m68k/openprom.h
+++ b/include/asm-m68k/openprom.h
@@ -8,7 +8,6 @@
8 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 8 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
9 */ 9 */
10 10
11#include <linux/config.h>
12 11
13/* Empirical constants... */ 12/* Empirical constants... */
14#ifdef CONFIG_SUN3 13#ifdef CONFIG_SUN3
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h
index f206dfbc1d48..db017f838c29 100644
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -1,7 +1,6 @@
1#ifndef _M68K_PAGE_H 1#ifndef _M68K_PAGE_H
2#define _M68K_PAGE_H 2#define _M68K_PAGE_H
3 3
4#include <linux/config.h>
5 4
6/* PAGE_SHIFT determines the page size */ 5/* PAGE_SHIFT determines the page size */
7#ifndef CONFIG_SUN3 6#ifndef CONFIG_SUN3
diff --git a/include/asm-m68k/page_offset.h b/include/asm-m68k/page_offset.h
index 86d3c2845ad4..1cbdb7f30ac2 100644
--- a/include/asm-m68k/page_offset.h
+++ b/include/asm-m68k/page_offset.h
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2 1
3/* This handles the memory map.. */ 2/* This handles the memory map.. */
4#ifndef CONFIG_SUN3 3#ifndef CONFIG_SUN3
diff --git a/include/asm-m68k/pgalloc.h b/include/asm-m68k/pgalloc.h
index b468b7958aaa..a9cfb4b99d88 100644
--- a/include/asm-m68k/pgalloc.h
+++ b/include/asm-m68k/pgalloc.h
@@ -2,7 +2,6 @@
2#ifndef M68K_PGALLOC_H 2#ifndef M68K_PGALLOC_H
3#define M68K_PGALLOC_H 3#define M68K_PGALLOC_H
4 4
5#include <linux/config.h>
6#include <linux/mm.h> 5#include <linux/mm.h>
7#include <linux/highmem.h> 6#include <linux/highmem.h>
8#include <asm/setup.h> 7#include <asm/setup.h>
diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h
index add129e93fd7..f3aa05377987 100644
--- a/include/asm-m68k/pgtable.h
+++ b/include/asm-m68k/pgtable.h
@@ -3,7 +3,6 @@
3 3
4#include <asm-generic/4level-fixup.h> 4#include <asm-generic/4level-fixup.h>
5 5
6#include <linux/config.h>
7#include <asm/setup.h> 6#include <asm/setup.h>
8 7
9#ifndef __ASSEMBLY__ 8#ifndef __ASSEMBLY__
diff --git a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h
index 7982285e84ed..8455f778b601 100644
--- a/include/asm-m68k/processor.h
+++ b/include/asm-m68k/processor.h
@@ -13,7 +13,6 @@
13 */ 13 */
14#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 14#define current_text_addr() ({ __label__ _l; _l: &&_l;})
15 15
16#include <linux/config.h>
17#include <linux/thread_info.h> 16#include <linux/thread_info.h>
18#include <asm/segment.h> 17#include <asm/segment.h>
19#include <asm/fpu.h> 18#include <asm/fpu.h>
@@ -72,10 +71,10 @@ struct thread_struct {
72}; 71};
73 72
74#define INIT_THREAD { \ 73#define INIT_THREAD { \
75 ksp: sizeof(init_stack) + (unsigned long) init_stack, \ 74 .ksp = sizeof(init_stack) + (unsigned long) init_stack, \
76 sr: PS_S, \ 75 .sr = PS_S, \
77 fs: __KERNEL_DS, \ 76 .fs = __KERNEL_DS, \
78 info: INIT_THREAD_INFO(init_task) \ 77 .info = INIT_THREAD_INFO(init_task), \
79} 78}
80 79
81/* 80/*
diff --git a/include/asm-m68k/semaphore-helper.h b/include/asm-m68k/semaphore-helper.h
index 1516a642f9a5..eef30ba0b499 100644
--- a/include/asm-m68k/semaphore-helper.h
+++ b/include/asm-m68k/semaphore-helper.h
@@ -9,7 +9,6 @@
9 * m68k version by Andreas Schwab 9 * m68k version by Andreas Schwab
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/errno.h> 12#include <linux/errno.h>
14 13
15/* 14/*
diff --git a/include/asm-m68k/serial.h b/include/asm-m68k/serial.h
index 3fe29f8b0194..2b90d6e69070 100644
--- a/include/asm-m68k/serial.h
+++ b/include/asm-m68k/serial.h
@@ -6,7 +6,6 @@
6 * 6 *
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11/* 10/*
12 * This assumes you have a 1.8432 MHz clock for your UART. 11 * This assumes you have a 1.8432 MHz clock for your UART.
diff --git a/include/asm-m68k/setup.h b/include/asm-m68k/setup.h
index a89aa84073e5..7facc9a46e74 100644
--- a/include/asm-m68k/setup.h
+++ b/include/asm-m68k/setup.h
@@ -23,7 +23,6 @@
23#ifndef _M68K_SETUP_H 23#ifndef _M68K_SETUP_H
24#define _M68K_SETUP_H 24#define _M68K_SETUP_H
25 25
26#include <linux/config.h>
27 26
28 27
29 /* 28 /*
diff --git a/include/asm-m68k/shm.h b/include/asm-m68k/shm.h
index 3fa2f368fc1a..fa56ec84a126 100644
--- a/include/asm-m68k/shm.h
+++ b/include/asm-m68k/shm.h
@@ -1,7 +1,6 @@
1#ifndef _M68K_SHM_H 1#ifndef _M68K_SHM_H
2#define _M68K_SHM_H 2#define _M68K_SHM_H
3 3
4#include <linux/config.h>
5 4
6/* format of page table entries that correspond to shared memory pages 5/* format of page table entries that correspond to shared memory pages
7 currently out in swap space (see also mm/swap.c): 6 currently out in swap space (see also mm/swap.c):
diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h
index 64d3481df74c..d6dd8052cd6f 100644
--- a/include/asm-m68k/system.h
+++ b/include/asm-m68k/system.h
@@ -1,7 +1,6 @@
1#ifndef _M68K_SYSTEM_H 1#ifndef _M68K_SYSTEM_H
2#define _M68K_SYSTEM_H 2#define _M68K_SYSTEM_H
3 3
4#include <linux/config.h> /* get configuration macros */
5#include <linux/linkage.h> 4#include <linux/linkage.h>
6#include <linux/kernel.h> 5#include <linux/kernel.h>
7#include <asm/segment.h> 6#include <asm/segment.h>
diff --git a/include/asm-m68k/tlbflush.h b/include/asm-m68k/tlbflush.h
index 8e61ccffe13a..31678831ee47 100644
--- a/include/asm-m68k/tlbflush.h
+++ b/include/asm-m68k/tlbflush.h
@@ -1,7 +1,6 @@
1#ifndef _M68K_TLBFLUSH_H 1#ifndef _M68K_TLBFLUSH_H
2#define _M68K_TLBFLUSH_H 2#define _M68K_TLBFLUSH_H
3 3
4#include <linux/config.h>
5 4
6#ifndef CONFIG_SUN3 5#ifndef CONFIG_SUN3
7 6
diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h
index 2ffd87b0a769..b761ef218cea 100644
--- a/include/asm-m68k/uaccess.h
+++ b/include/asm-m68k/uaccess.h
@@ -4,8 +4,9 @@
4/* 4/*
5 * User space memory access functions 5 * User space memory access functions
6 */ 6 */
7#include <linux/compiler.h>
7#include <linux/errno.h> 8#include <linux/errno.h>
8#include <linux/sched.h> 9#include <linux/types.h>
9#include <asm/segment.h> 10#include <asm/segment.h>
10 11
11#define VERIFY_READ 0 12#define VERIFY_READ 0
@@ -32,858 +33,315 @@ struct exception_table_entry
32 unsigned long insn, fixup; 33 unsigned long insn, fixup;
33}; 34};
34 35
36extern int __put_user_bad(void);
37extern int __get_user_bad(void);
38
39#define __put_user_asm(res, x, ptr, bwl, reg, err) \
40asm volatile ("\n" \
41 "1: moves."#bwl" %2,%1\n" \
42 "2:\n" \
43 " .section .fixup,\"ax\"\n" \
44 " .even\n" \
45 "10: moveq.l %3,%0\n" \
46 " jra 2b\n" \
47 " .previous\n" \
48 "\n" \
49 " .section __ex_table,\"a\"\n" \
50 " .align 4\n" \
51 " .long 1b,10b\n" \
52 " .long 2b,10b\n" \
53 " .previous" \
54 : "+d" (res), "=m" (*(ptr)) \
55 : #reg (x), "i" (err))
35 56
36/* 57/*
37 * These are the main single-value transfer routines. They automatically 58 * These are the main single-value transfer routines. They automatically
38 * use the right size if we just have the right pointer type. 59 * use the right size if we just have the right pointer type.
39 */ 60 */
40 61
41#define put_user(x, ptr) \ 62#define __put_user(x, ptr) \
42({ \ 63({ \
43 int __pu_err; \ 64 typeof(*(ptr)) __pu_val = (x); \
44 typeof(*(ptr)) __pu_val = (x); \ 65 int __pu_err = 0; \
45 __chk_user_ptr(ptr); \ 66 __chk_user_ptr(ptr); \
46 switch (sizeof (*(ptr))) { \ 67 switch (sizeof (*(ptr))) { \
47 case 1: \ 68 case 1: \
48 __put_user_asm(__pu_err, __pu_val, ptr, b); \ 69 __put_user_asm(__pu_err, __pu_val, ptr, b, d, -EFAULT); \
49 break; \ 70 break; \
50 case 2: \ 71 case 2: \
51 __put_user_asm(__pu_err, __pu_val, ptr, w); \ 72 __put_user_asm(__pu_err, __pu_val, ptr, w, d, -EFAULT); \
52 break; \ 73 break; \
53 case 4: \ 74 case 4: \
54 __put_user_asm(__pu_err, __pu_val, ptr, l); \ 75 __put_user_asm(__pu_err, __pu_val, ptr, l, r, -EFAULT); \
55 break; \ 76 break; \
56 case 8: \ 77 case 8: \
57 __pu_err = __constant_copy_to_user(ptr, &__pu_val, 8); \ 78 { \
58 break; \ 79 const void *__pu_ptr = (ptr); \
59 default: \ 80 asm volatile ("\n" \
60 __pu_err = __put_user_bad(); \ 81 "1: moves.l %2,(%1)+\n" \
61 break; \ 82 "2: moves.l %R2,(%1)\n" \
62 } \ 83 "3:\n" \
63 __pu_err; \ 84 " .section .fixup,\"ax\"\n" \
85 " .even\n" \
86 "10: movel %3,%0\n" \
87 " jra 3b\n" \
88 " .previous\n" \
89 "\n" \
90 " .section __ex_table,\"a\"\n" \
91 " .align 4\n" \
92 " .long 1b,10b\n" \
93 " .long 2b,10b\n" \
94 " .long 3b,10b\n" \
95 " .previous" \
96 : "+d" (__pu_err), "+a" (__pu_ptr) \
97 : "r" (__pu_val), "i" (-EFAULT) \
98 : "memory"); \
99 break; \
100 } \
101 default: \
102 __pu_err = __put_user_bad(); \
103 break; \
104 } \
105 __pu_err; \
64}) 106})
65#define __put_user(x, ptr) put_user(x, ptr) 107#define put_user(x, ptr) __put_user(x, ptr)
66 108
67extern int __put_user_bad(void);
68 109
69/* 110#define __get_user_asm(res, x, ptr, type, bwl, reg, err) ({ \
70 * Tell gcc we read from memory instead of writing: this is because 111 type __gu_val; \
71 * we do not write to any memory gcc knows about, so there are no 112 asm volatile ("\n" \
72 * aliasing issues. 113 "1: moves."#bwl" %2,%1\n" \
73 */ 114 "2:\n" \
74#define __put_user_asm(err,x,ptr,bwl) \ 115 " .section .fixup,\"ax\"\n" \
75__asm__ __volatile__ \ 116 " .even\n" \
76 ("21:moves" #bwl " %2,%1\n" \ 117 "10: move.l %3,%0\n" \
77 "1:\n" \ 118 " sub."#bwl" %1,%1\n" \
78 ".section .fixup,\"ax\"\n" \ 119 " jra 2b\n" \
79 " .even\n" \ 120 " .previous\n" \
80 "2: movel %3,%0\n" \ 121 "\n" \
81 " jra 1b\n" \ 122 " .section __ex_table,\"a\"\n" \
82 ".previous\n" \ 123 " .align 4\n" \
83 ".section __ex_table,\"a\"\n" \ 124 " .long 1b,10b\n" \
84 " .align 4\n" \ 125 " .previous" \
85 " .long 21b,2b\n" \ 126 : "+d" (res), "=&" #reg (__gu_val) \
86 " .long 1b,2b\n" \ 127 : "m" (*(ptr)), "i" (err)); \
87 ".previous" \ 128 (x) = (typeof(*(ptr)))(long)__gu_val; \
88 : "=d"(err) \
89 : "m"(*(ptr)), "r"(x), "i"(-EFAULT), "0"(0))
90
91#define get_user(x, ptr) \
92({ \
93 int __gu_err; \
94 typeof(*(ptr)) __gu_val; \
95 __chk_user_ptr(ptr); \
96 switch (sizeof(*(ptr))) { \
97 case 1: \
98 __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \
99 break; \
100 case 2: \
101 __get_user_asm(__gu_err, __gu_val, ptr, w, "=r"); \
102 break; \
103 case 4: \
104 __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \
105 break; \
106 case 8: \
107 __gu_err = __constant_copy_from_user(&__gu_val, ptr, 8); \
108 break; \
109 default: \
110 __gu_val = (typeof(*(ptr)))0; \
111 __gu_err = __get_user_bad(); \
112 break; \
113 } \
114 (x) = __gu_val; \
115 __gu_err; \
116}) 129})
117#define __get_user(x, ptr) get_user(x, ptr)
118 130
119extern int __get_user_bad(void); 131#define __get_user(x, ptr) \
132({ \
133 int __gu_err = 0; \
134 __chk_user_ptr(ptr); \
135 switch (sizeof(*(ptr))) { \
136 case 1: \
137 __get_user_asm(__gu_err, x, ptr, u8, b, d, -EFAULT); \
138 break; \
139 case 2: \
140 __get_user_asm(__gu_err, x, ptr, u16, w, d, -EFAULT); \
141 break; \
142 case 4: \
143 __get_user_asm(__gu_err, x, ptr, u32, l, r, -EFAULT); \
144 break; \
145/* case 8: disabled because gcc-4.1 has a broken typeof \
146 { \
147 const void *__gu_ptr = (ptr); \
148 u64 __gu_val; \
149 asm volatile ("\n" \
150 "1: moves.l (%2)+,%1\n" \
151 "2: moves.l (%2),%R1\n" \
152 "3:\n" \
153 " .section .fixup,\"ax\"\n" \
154 " .even\n" \
155 "10: move.l %3,%0\n" \
156 " sub.l %1,%1\n" \
157 " sub.l %R1,%R1\n" \
158 " jra 3b\n" \
159 " .previous\n" \
160 "\n" \
161 " .section __ex_table,\"a\"\n" \
162 " .align 4\n" \
163 " .long 1b,10b\n" \
164 " .long 2b,10b\n" \
165 " .previous" \
166 : "+d" (__gu_err), "=&r" (__gu_val), \
167 "+a" (__gu_ptr) \
168 : "i" (-EFAULT) \
169 : "memory"); \
170 (x) = (typeof(*(ptr)))__gu_val; \
171 break; \
172 } */ \
173 default: \
174 __gu_err = __get_user_bad(); \
175 break; \
176 } \
177 __gu_err; \
178})
179#define get_user(x, ptr) __get_user(x, ptr)
120 180
121#define __get_user_asm(err,x,ptr,bwl,reg) \ 181unsigned long __generic_copy_from_user(void *to, const void __user *from, unsigned long n);
122__asm__ __volatile__ \ 182unsigned long __generic_copy_to_user(void __user *to, const void *from, unsigned long n);
123 ("1: moves" #bwl " %2,%1\n" \
124 "2:\n" \
125 ".section .fixup,\"ax\"\n" \
126 " .even\n" \
127 "3: movel %3,%0\n" \
128 " sub" #bwl " %1,%1\n" \
129 " jra 2b\n" \
130 ".previous\n" \
131 ".section __ex_table,\"a\"\n" \
132 " .align 4\n" \
133 " .long 1b,3b\n" \
134 ".previous" \
135 : "=d"(err), reg(x) \
136 : "m"(*(ptr)), "i" (-EFAULT), "0"(0))
137 183
138static inline unsigned long 184static __always_inline unsigned long
139__generic_copy_from_user(void *to, const void __user *from, unsigned long n) 185__constant_copy_from_user(void *to, const void __user *from, unsigned long n)
140{
141 unsigned long tmp;
142 __asm__ __volatile__
143 (" tstl %2\n"
144 " jeq 2f\n"
145 "1: movesl (%1)+,%3\n"
146 " movel %3,(%0)+\n"
147 " subql #1,%2\n"
148 " jne 1b\n"
149 "2: movel %4,%2\n"
150 " bclr #1,%2\n"
151 " jeq 4f\n"
152 "3: movesw (%1)+,%3\n"
153 " movew %3,(%0)+\n"
154 "4: bclr #0,%2\n"
155 " jeq 6f\n"
156 "5: movesb (%1)+,%3\n"
157 " moveb %3,(%0)+\n"
158 "6:\n"
159 ".section .fixup,\"ax\"\n"
160 " .even\n"
161 "7: movel %2,%%d0\n"
162 "71:clrl (%0)+\n"
163 " subql #1,%%d0\n"
164 " jne 71b\n"
165 " lsll #2,%2\n"
166 " addl %4,%2\n"
167 " btst #1,%4\n"
168 " jne 81f\n"
169 " btst #0,%4\n"
170 " jne 91f\n"
171 " jra 6b\n"
172 "8: addql #2,%2\n"
173 "81:clrw (%0)+\n"
174 " btst #0,%4\n"
175 " jne 91f\n"
176 " jra 6b\n"
177 "9: addql #1,%2\n"
178 "91:clrb (%0)+\n"
179 " jra 6b\n"
180 ".previous\n"
181 ".section __ex_table,\"a\"\n"
182 " .align 4\n"
183 " .long 1b,7b\n"
184 " .long 3b,8b\n"
185 " .long 5b,9b\n"
186 ".previous"
187 : "=a"(to), "=a"(from), "=d"(n), "=&d"(tmp)
188 : "d"(n & 3), "0"(to), "1"(from), "2"(n/4)
189 : "d0", "memory");
190 return n;
191}
192
193static inline unsigned long
194__generic_copy_to_user(void __user *to, const void *from, unsigned long n)
195{ 186{
196 unsigned long tmp; 187 unsigned long res = 0, tmp;
197 __asm__ __volatile__
198 (" tstl %2\n"
199 " jeq 3f\n"
200 "1: movel (%1)+,%3\n"
201 "22:movesl %3,(%0)+\n"
202 "2: subql #1,%2\n"
203 " jne 1b\n"
204 "3: movel %4,%2\n"
205 " bclr #1,%2\n"
206 " jeq 4f\n"
207 " movew (%1)+,%3\n"
208 "24:movesw %3,(%0)+\n"
209 "4: bclr #0,%2\n"
210 " jeq 5f\n"
211 " moveb (%1)+,%3\n"
212 "25:movesb %3,(%0)+\n"
213 "5:\n"
214 ".section .fixup,\"ax\"\n"
215 " .even\n"
216 "60:addql #1,%2\n"
217 "6: lsll #2,%2\n"
218 " addl %4,%2\n"
219 " jra 5b\n"
220 "7: addql #2,%2\n"
221 " jra 5b\n"
222 "8: addql #1,%2\n"
223 " jra 5b\n"
224 ".previous\n"
225 ".section __ex_table,\"a\"\n"
226 " .align 4\n"
227 " .long 1b,60b\n"
228 " .long 22b,6b\n"
229 " .long 2b,6b\n"
230 " .long 24b,7b\n"
231 " .long 3b,60b\n"
232 " .long 4b,7b\n"
233 " .long 25b,8b\n"
234 " .long 5b,8b\n"
235 ".previous"
236 : "=a"(to), "=a"(from), "=d"(n), "=&d"(tmp)
237 : "r"(n & 3), "0"(to), "1"(from), "2"(n / 4)
238 : "memory");
239 return n;
240}
241 188
242#define __copy_from_user_big(to, from, n, fixup, copy) \ 189 /* limit the inlined version to 3 moves */
243 __asm__ __volatile__ \ 190 if (n == 11 || n > 12)
244 ("10: movesl (%1)+,%%d0\n" \ 191 return __generic_copy_from_user(to, from, n);
245 " movel %%d0,(%0)+\n" \
246 " subql #1,%2\n" \
247 " jne 10b\n" \
248 ".section .fixup,\"ax\"\n" \
249 " .even\n" \
250 "11: movel %2,%%d0\n" \
251 "13: clrl (%0)+\n" \
252 " subql #1,%%d0\n" \
253 " jne 13b\n" \
254 " lsll #2,%2\n" \
255 fixup "\n" \
256 " jra 12f\n" \
257 ".previous\n" \
258 ".section __ex_table,\"a\"\n" \
259 " .align 4\n" \
260 " .long 10b,11b\n" \
261 ".previous\n" \
262 copy "\n" \
263 "12:" \
264 : "=a"(to), "=a"(from), "=d"(n) \
265 : "0"(to), "1"(from), "2"(n/4) \
266 : "d0", "memory")
267 192
268static inline unsigned long 193 switch (n) {
269__constant_copy_from_user(void *to, const void __user *from, unsigned long n)
270{
271 switch (n) {
272 case 0:
273 break;
274 case 1:
275 __asm__ __volatile__
276 ("1: movesb (%1)+,%%d0\n"
277 " moveb %%d0,(%0)+\n"
278 "2:\n"
279 ".section .fixup,\"ax\"\n"
280 " .even\n"
281 "3: addql #1,%2\n"
282 " clrb (%0)+\n"
283 " jra 2b\n"
284 ".previous\n"
285 ".section __ex_table,\"a\"\n"
286 " .align 4\n"
287 " .long 1b,3b\n"
288 ".previous"
289 : "=a"(to), "=a"(from), "=d"(n)
290 : "0"(to), "1"(from), "2"(0)
291 : "d0", "memory");
292 break;
293 case 2:
294 __asm__ __volatile__
295 ("1: movesw (%1)+,%%d0\n"
296 " movew %%d0,(%0)+\n"
297 "2:\n"
298 ".section .fixup,\"ax\"\n"
299 " .even\n"
300 "3: addql #2,%2\n"
301 " clrw (%0)+\n"
302 " jra 2b\n"
303 ".previous\n"
304 ".section __ex_table,\"a\"\n"
305 " .align 4\n"
306 " .long 1b,3b\n"
307 ".previous"
308 : "=a"(to), "=a"(from), "=d"(n)
309 : "0"(to), "1"(from), "2"(0)
310 : "d0", "memory");
311 break;
312 case 3:
313 __asm__ __volatile__
314 ("1: movesw (%1)+,%%d0\n"
315 " movew %%d0,(%0)+\n"
316 "2: movesb (%1)+,%%d0\n"
317 " moveb %%d0,(%0)+\n"
318 "3:"
319 ".section .fixup,\"ax\"\n"
320 " .even\n"
321 "4: addql #2,%2\n"
322 " clrw (%0)+\n"
323 "5: addql #1,%2\n"
324 " clrb (%0)+\n"
325 " jra 3b\n"
326 ".previous\n"
327 ".section __ex_table,\"a\"\n"
328 " .align 4\n"
329 " .long 1b,4b\n"
330 " .long 2b,5b\n"
331 ".previous"
332 : "=a"(to), "=a"(from), "=d"(n)
333 : "0"(to), "1"(from), "2"(0)
334 : "d0", "memory");
335 break;
336 case 4:
337 __asm__ __volatile__
338 ("1: movesl (%1)+,%%d0\n"
339 " movel %%d0,(%0)+\n"
340 "2:"
341 ".section .fixup,\"ax\"\n"
342 " .even\n"
343 "3: addql #4,%2\n"
344 " clrl (%0)+\n"
345 " jra 2b\n"
346 ".previous\n"
347 ".section __ex_table,\"a\"\n"
348 " .align 4\n"
349 " .long 1b,3b\n"
350 ".previous"
351 : "=a"(to), "=a"(from), "=d"(n)
352 : "0"(to), "1"(from), "2"(0)
353 : "d0", "memory");
354 break;
355 case 8:
356 __asm__ __volatile__
357 ("1: movesl (%1)+,%%d0\n"
358 " movel %%d0,(%0)+\n"
359 "2: movesl (%1)+,%%d0\n"
360 " movel %%d0,(%0)+\n"
361 "3:"
362 ".section .fixup,\"ax\"\n"
363 " .even\n"
364 "4: addql #4,%2\n"
365 " clrl (%0)+\n"
366 "5: addql #4,%2\n"
367 " clrl (%0)+\n"
368 " jra 3b\n"
369 ".previous\n"
370 ".section __ex_table,\"a\"\n"
371 " .align 4\n"
372 " .long 1b,4b\n"
373 " .long 2b,5b\n"
374 ".previous"
375 : "=a"(to), "=a"(from), "=d"(n)
376 : "0"(to), "1"(from), "2"(0)
377 : "d0", "memory");
378 break;
379 case 12:
380 __asm__ __volatile__
381 ("1: movesl (%1)+,%%d0\n"
382 " movel %%d0,(%0)+\n"
383 "2: movesl (%1)+,%%d0\n"
384 " movel %%d0,(%0)+\n"
385 "3: movesl (%1)+,%%d0\n"
386 " movel %%d0,(%0)+\n"
387 "4:"
388 ".section .fixup,\"ax\"\n"
389 " .even\n"
390 "5: addql #4,%2\n"
391 " clrl (%0)+\n"
392 "6: addql #4,%2\n"
393 " clrl (%0)+\n"
394 "7: addql #4,%2\n"
395 " clrl (%0)+\n"
396 " jra 4b\n"
397 ".previous\n"
398 ".section __ex_table,\"a\"\n"
399 " .align 4\n"
400 " .long 1b,5b\n"
401 " .long 2b,6b\n"
402 " .long 3b,7b\n"
403 ".previous"
404 : "=a"(to), "=a"(from), "=d"(n)
405 : "0"(to), "1"(from), "2"(0)
406 : "d0", "memory");
407 break;
408 case 16:
409 __asm__ __volatile__
410 ("1: movesl (%1)+,%%d0\n"
411 " movel %%d0,(%0)+\n"
412 "2: movesl (%1)+,%%d0\n"
413 " movel %%d0,(%0)+\n"
414 "3: movesl (%1)+,%%d0\n"
415 " movel %%d0,(%0)+\n"
416 "4: movesl (%1)+,%%d0\n"
417 " movel %%d0,(%0)+\n"
418 "5:"
419 ".section .fixup,\"ax\"\n"
420 " .even\n"
421 "6: addql #4,%2\n"
422 " clrl (%0)+\n"
423 "7: addql #4,%2\n"
424 " clrl (%0)+\n"
425 "8: addql #4,%2\n"
426 " clrl (%0)+\n"
427 "9: addql #4,%2\n"
428 " clrl (%0)+\n"
429 " jra 5b\n"
430 ".previous\n"
431 ".section __ex_table,\"a\"\n"
432 " .align 4\n"
433 " .long 1b,6b\n"
434 " .long 2b,7b\n"
435 " .long 3b,8b\n"
436 " .long 4b,9b\n"
437 ".previous"
438 : "=a"(to), "=a"(from), "=d"(n)
439 : "0"(to), "1"(from), "2"(0)
440 : "d0", "memory");
441 break;
442 default:
443 switch (n & 3) {
444 case 0:
445 __copy_from_user_big(to, from, n, "", "");
446 break;
447 case 1: 194 case 1:
448 __copy_from_user_big(to, from, n, 195 __get_user_asm(res, *(u8 *)to, (u8 *)from, u8, b, d, 1);
449 /* fixup */ 196 return res;
450 "1: addql #1,%2\n"
451 " clrb (%0)+",
452 /* copy */
453 "2: movesb (%1)+,%%d0\n"
454 " moveb %%d0,(%0)+\n"
455 ".section __ex_table,\"a\"\n"
456 " .long 2b,1b\n"
457 ".previous");
458 break;
459 case 2: 197 case 2:
460 __copy_from_user_big(to, from, n, 198 __get_user_asm(res, *(u16 *)to, (u16 *)from, u16, w, d, 2);
461 /* fixup */ 199 return res;
462 "1: addql #2,%2\n" 200 case 4:
463 " clrw (%0)+", 201 __get_user_asm(res, *(u32 *)to, (u32 *)from, u32, l, r, 4);
464 /* copy */ 202 return res;
465 "2: movesw (%1)+,%%d0\n"
466 " movew %%d0,(%0)+\n"
467 ".section __ex_table,\"a\"\n"
468 " .long 2b,1b\n"
469 ".previous");
470 break;
471 case 3:
472 __copy_from_user_big(to, from, n,
473 /* fixup */
474 "1: addql #2,%2\n"
475 " clrw (%0)+\n"
476 "2: addql #1,%2\n"
477 " clrb (%0)+",
478 /* copy */
479 "3: movesw (%1)+,%%d0\n"
480 " movew %%d0,(%0)+\n"
481 "4: movesb (%1)+,%%d0\n"
482 " moveb %%d0,(%0)+\n"
483 ".section __ex_table,\"a\"\n"
484 " .long 3b,1b\n"
485 " .long 4b,2b\n"
486 ".previous");
487 break;
488 } 203 }
489 break;
490 }
491 return n;
492}
493 204
494#define __copy_to_user_big(to, from, n, fixup, copy) \ 205 asm volatile ("\n"
495 __asm__ __volatile__ \ 206 " .ifndef .Lfrom_user\n"
496 ("10: movel (%1)+,%%d0\n" \ 207 " .set .Lfrom_user,1\n"
497 "31: movesl %%d0,(%0)+\n" \ 208 " .macro copy_from_user to,from,tmp\n"
498 "11: subql #1,%2\n" \ 209 " .if .Lcnt >= 4\n"
499 " jne 10b\n" \ 210 "1: moves.l (\\from)+,\\tmp\n"
500 "41:\n" \ 211 " move.l \\tmp,(\\to)+\n"
501 ".section .fixup,\"ax\"\n" \ 212 " .set .Lcnt,.Lcnt-4\n"
502 " .even\n" \ 213 " .elseif .Lcnt & 2\n"
503 "22: addql #1,%2\n" \ 214 "1: moves.w (\\from)+,\\tmp\n"
504 "12: lsll #2,%2\n" \ 215 " move.w \\tmp,(\\to)+\n"
505 fixup "\n" \ 216 " .set .Lcnt,.Lcnt-2\n"
506 " jra 13f\n" \ 217 " .elseif .Lcnt & 1\n"
507 ".previous\n" \ 218 "1: moves.b (\\from)+,\\tmp\n"
508 ".section __ex_table,\"a\"\n" \ 219 " move.b \\tmp,(\\to)+\n"
509 " .align 4\n" \ 220 " .set .Lcnt,.Lcnt-1\n"
510 " .long 10b,22b\n" \ 221 " .else\n"
511 " .long 31b,12b\n" \ 222 " .exitm\n"
512 " .long 11b,12b\n" \ 223 " .endif\n"
513 " .long 41b,22b\n" \ 224 "\n"
514 ".previous\n" \ 225 " .section __ex_table,\"a\"\n"
515 copy "\n" \ 226 " .align 4\n"
516 "13:" \ 227 " .long 1b,3f\n"
517 : "=a"(to), "=a"(from), "=d"(n) \ 228 " .previous\n"
518 : "0"(to), "1"(from), "2"(n/4) \ 229 " .endm\n"
519 : "d0", "memory") 230 " .endif\n"
231 "\n"
232 " .set .Lcnt,%c4\n"
233 " copy_from_user %1,%2,%3\n"
234 " copy_from_user %1,%2,%3\n"
235 " copy_from_user %1,%2,%3\n"
236 "2:\n"
237 " .section .fixup,\"ax\"\n"
238 " .even\n"
239 "3: moveq.l %4,%0\n"
240 " move.l %5,%1\n"
241 " .rept %c4 / 4\n"
242 " clr.l (%1)+\n"
243 " .endr\n"
244 " .if %c4 & 2\n"
245 " clr.w (%1)+\n"
246 " .endif\n"
247 " .if %c4 & 1\n"
248 " clr.b (%1)+\n"
249 " .endif\n"
250 " jra 2b\n"
251 " .previous\n"
252 : "+r" (res), "+a" (to), "+a" (from), "=&d" (tmp)
253 : "i" (n), "g" (to)
254 : "memory");
520 255
521#define __copy_to_user_inatomic __copy_to_user 256 return res;
522#define __copy_from_user_inatomic __copy_from_user 257}
523 258
524static inline unsigned long 259static __always_inline unsigned long
525__constant_copy_to_user(void __user *to, const void *from, unsigned long n) 260__constant_copy_to_user(void __user *to, const void *from, unsigned long n)
526{ 261{
527 switch (n) { 262 unsigned long res = 0, tmp;
528 case 0: 263
529 break; 264 /* limit the inlined version to 3 moves */
530 case 1: 265 if (n == 11 || n > 12)
531 __asm__ __volatile__ 266 return __generic_copy_to_user(to, from, n);
532 (" moveb (%1)+,%%d0\n" 267
533 "21:movesb %%d0,(%0)+\n" 268 switch (n) {
534 "1:\n"
535 ".section .fixup,\"ax\"\n"
536 " .even\n"
537 "2: addql #1,%2\n"
538 " jra 1b\n"
539 ".previous\n"
540 ".section __ex_table,\"a\"\n"
541 " .align 4\n "
542 " .long 21b,2b\n"
543 " .long 1b,2b\n"
544 ".previous"
545 : "=a"(to), "=a"(from), "=d"(n)
546 : "0"(to), "1"(from), "2"(0)
547 : "d0", "memory");
548 break;
549 case 2:
550 __asm__ __volatile__
551 (" movew (%1)+,%%d0\n"
552 "21:movesw %%d0,(%0)+\n"
553 "1:\n"
554 ".section .fixup,\"ax\"\n"
555 " .even\n"
556 "2: addql #2,%2\n"
557 " jra 1b\n"
558 ".previous\n"
559 ".section __ex_table,\"a\"\n"
560 " .align 4\n"
561 " .long 21b,2b\n"
562 " .long 1b,2b\n"
563 ".previous"
564 : "=a"(to), "=a"(from), "=d"(n)
565 : "0"(to), "1"(from), "2"(0)
566 : "d0", "memory");
567 break;
568 case 3:
569 __asm__ __volatile__
570 (" movew (%1)+,%%d0\n"
571 "21:movesw %%d0,(%0)+\n"
572 "1: moveb (%1)+,%%d0\n"
573 "22:movesb %%d0,(%0)+\n"
574 "2:\n"
575 ".section .fixup,\"ax\"\n"
576 " .even\n"
577 "3: addql #2,%2\n"
578 "4: addql #1,%2\n"
579 " jra 2b\n"
580 ".previous\n"
581 ".section __ex_table,\"a\"\n"
582 " .align 4\n"
583 " .long 21b,3b\n"
584 " .long 1b,3b\n"
585 " .long 22b,4b\n"
586 " .long 2b,4b\n"
587 ".previous"
588 : "=a"(to), "=a"(from), "=d"(n)
589 : "0"(to), "1"(from), "2"(0)
590 : "d0", "memory");
591 break;
592 case 4:
593 __asm__ __volatile__
594 (" movel (%1)+,%%d0\n"
595 "21:movesl %%d0,(%0)+\n"
596 "1:\n"
597 ".section .fixup,\"ax\"\n"
598 " .even\n"
599 "2: addql #4,%2\n"
600 " jra 1b\n"
601 ".previous\n"
602 ".section __ex_table,\"a\"\n"
603 " .align 4\n"
604 " .long 21b,2b\n"
605 " .long 1b,2b\n"
606 ".previous"
607 : "=a"(to), "=a"(from), "=d"(n)
608 : "0"(to), "1"(from), "2"(0)
609 : "d0", "memory");
610 break;
611 case 8:
612 __asm__ __volatile__
613 (" movel (%1)+,%%d0\n"
614 "21:movesl %%d0,(%0)+\n"
615 "1: movel (%1)+,%%d0\n"
616 "22:movesl %%d0,(%0)+\n"
617 "2:\n"
618 ".section .fixup,\"ax\"\n"
619 " .even\n"
620 "3: addql #4,%2\n"
621 "4: addql #4,%2\n"
622 " jra 2b\n"
623 ".previous\n"
624 ".section __ex_table,\"a\"\n"
625 " .align 4\n"
626 " .long 21b,3b\n"
627 " .long 1b,3b\n"
628 " .long 22b,4b\n"
629 " .long 2b,4b\n"
630 ".previous"
631 : "=a"(to), "=a"(from), "=d"(n)
632 : "0"(to), "1"(from), "2"(0)
633 : "d0", "memory");
634 break;
635 case 12:
636 __asm__ __volatile__
637 (" movel (%1)+,%%d0\n"
638 "21:movesl %%d0,(%0)+\n"
639 "1: movel (%1)+,%%d0\n"
640 "22:movesl %%d0,(%0)+\n"
641 "2: movel (%1)+,%%d0\n"
642 "23:movesl %%d0,(%0)+\n"
643 "3:\n"
644 ".section .fixup,\"ax\"\n"
645 " .even\n"
646 "4: addql #4,%2\n"
647 "5: addql #4,%2\n"
648 "6: addql #4,%2\n"
649 " jra 3b\n"
650 ".previous\n"
651 ".section __ex_table,\"a\"\n"
652 " .align 4\n"
653 " .long 21b,4b\n"
654 " .long 1b,4b\n"
655 " .long 22b,5b\n"
656 " .long 2b,5b\n"
657 " .long 23b,6b\n"
658 " .long 3b,6b\n"
659 ".previous"
660 : "=a"(to), "=a"(from), "=d"(n)
661 : "0"(to), "1"(from), "2"(0)
662 : "d0", "memory");
663 break;
664 case 16:
665 __asm__ __volatile__
666 (" movel (%1)+,%%d0\n"
667 "21:movesl %%d0,(%0)+\n"
668 "1: movel (%1)+,%%d0\n"
669 "22:movesl %%d0,(%0)+\n"
670 "2: movel (%1)+,%%d0\n"
671 "23:movesl %%d0,(%0)+\n"
672 "3: movel (%1)+,%%d0\n"
673 "24:movesl %%d0,(%0)+\n"
674 "4:"
675 ".section .fixup,\"ax\"\n"
676 " .even\n"
677 "5: addql #4,%2\n"
678 "6: addql #4,%2\n"
679 "7: addql #4,%2\n"
680 "8: addql #4,%2\n"
681 " jra 4b\n"
682 ".previous\n"
683 ".section __ex_table,\"a\"\n"
684 " .align 4\n"
685 " .long 21b,5b\n"
686 " .long 1b,5b\n"
687 " .long 22b,6b\n"
688 " .long 2b,6b\n"
689 " .long 23b,7b\n"
690 " .long 3b,7b\n"
691 " .long 24b,8b\n"
692 " .long 4b,8b\n"
693 ".previous"
694 : "=a"(to), "=a"(from), "=d"(n)
695 : "0"(to), "1"(from), "2"(0)
696 : "d0", "memory");
697 break;
698 default:
699 switch (n & 3) {
700 case 0:
701 __copy_to_user_big(to, from, n, "", "");
702 break;
703 case 1: 269 case 1:
704 __copy_to_user_big(to, from, n, 270 __put_user_asm(res, *(u8 *)from, (u8 *)to, b, d, 1);
705 /* fixup */ 271 return res;
706 "1: addql #1,%2",
707 /* copy */
708 " moveb (%1)+,%%d0\n"
709 "22:movesb %%d0,(%0)+\n"
710 "2:"
711 ".section __ex_table,\"a\"\n"
712 " .long 22b,1b\n"
713 " .long 2b,1b\n"
714 ".previous");
715 break;
716 case 2: 272 case 2:
717 __copy_to_user_big(to, from, n, 273 __put_user_asm(res, *(u16 *)from, (u16 *)to, w, d, 2);
718 /* fixup */ 274 return res;
719 "1: addql #2,%2", 275 case 4:
720 /* copy */ 276 __put_user_asm(res, *(u32 *)from, (u32 *)to, l, r, 4);
721 " movew (%1)+,%%d0\n" 277 return res;
722 "22:movesw %%d0,(%0)+\n"
723 "2:"
724 ".section __ex_table,\"a\"\n"
725 " .long 22b,1b\n"
726 " .long 2b,1b\n"
727 ".previous");
728 break;
729 case 3:
730 __copy_to_user_big(to, from, n,
731 /* fixup */
732 "1: addql #2,%2\n"
733 "2: addql #1,%2",
734 /* copy */
735 " movew (%1)+,%%d0\n"
736 "23:movesw %%d0,(%0)+\n"
737 "3: moveb (%1)+,%%d0\n"
738 "24:movesb %%d0,(%0)+\n"
739 "4:"
740 ".section __ex_table,\"a\"\n"
741 " .long 23b,1b\n"
742 " .long 3b,1b\n"
743 " .long 24b,2b\n"
744 " .long 4b,2b\n"
745 ".previous");
746 break;
747 } 278 }
748 break; 279
749 } 280 asm volatile ("\n"
750 return n; 281 " .ifndef .Lto_user\n"
282 " .set .Lto_user,1\n"
283 " .macro copy_to_user to,from,tmp\n"
284 " .if .Lcnt >= 4\n"
285 " move.l (\\from)+,\\tmp\n"
286 "11: moves.l \\tmp,(\\to)+\n"
287 "12: .set .Lcnt,.Lcnt-4\n"
288 " .elseif .Lcnt & 2\n"
289 " move.w (\\from)+,\\tmp\n"
290 "11: moves.w \\tmp,(\\to)+\n"
291 "12: .set .Lcnt,.Lcnt-2\n"
292 " .elseif .Lcnt & 1\n"
293 " move.b (\\from)+,\\tmp\n"
294 "11: moves.b \\tmp,(\\to)+\n"
295 "12: .set .Lcnt,.Lcnt-1\n"
296 " .else\n"
297 " .exitm\n"
298 " .endif\n"
299 "\n"
300 " .section __ex_table,\"a\"\n"
301 " .align 4\n"
302 " .long 11b,3f\n"
303 " .long 12b,3f\n"
304 " .previous\n"
305 " .endm\n"
306 " .endif\n"
307 "\n"
308 " .set .Lcnt,%c4\n"
309 " copy_to_user %1,%2,%3\n"
310 " copy_to_user %1,%2,%3\n"
311 " copy_to_user %1,%2,%3\n"
312 "2:\n"
313 " .section .fixup,\"ax\"\n"
314 " .even\n"
315 "3: moveq.l %4,%0\n"
316 " jra 2b\n"
317 " .previous\n"
318 : "+r" (res), "+a" (to), "+a" (from), "=&d" (tmp)
319 : "i" (n)
320 : "memory");
321
322 return res;
751} 323}
752 324
753#define copy_from_user(to, from, n) \ 325#define __copy_from_user(to, from, n) \
754(__builtin_constant_p(n) ? \ 326(__builtin_constant_p(n) ? \
755 __constant_copy_from_user(to, from, n) : \ 327 __constant_copy_from_user(to, from, n) : \
756 __generic_copy_from_user(to, from, n)) 328 __generic_copy_from_user(to, from, n))
757 329
758#define copy_to_user(to, from, n) \ 330#define __copy_to_user(to, from, n) \
759(__builtin_constant_p(n) ? \ 331(__builtin_constant_p(n) ? \
760 __constant_copy_to_user(to, from, n) : \ 332 __constant_copy_to_user(to, from, n) : \
761 __generic_copy_to_user(to, from, n)) 333 __generic_copy_to_user(to, from, n))
762 334
763#define __copy_from_user(to, from, n) copy_from_user(to, from, n) 335#define __copy_to_user_inatomic __copy_to_user
764#define __copy_to_user(to, from, n) copy_to_user(to, from, n) 336#define __copy_from_user_inatomic __copy_from_user
765 337
766/* 338#define copy_from_user(to, from, n) __copy_from_user(to, from, n)
767 * Copy a null terminated string from userspace. 339#define copy_to_user(to, from, n) __copy_to_user(to, from, n)
768 */
769 340
770static inline long 341long strncpy_from_user(char *dst, const char __user *src, long count);
771strncpy_from_user(char *dst, const char __user *src, long count) 342long strnlen_user(const char __user *src, long n);
772{ 343unsigned long clear_user(void __user *to, unsigned long n);
773 long res;
774 if (count == 0) return count;
775 __asm__ __volatile__
776 ("1: movesb (%2)+,%%d0\n"
777 "12:moveb %%d0,(%1)+\n"
778 " jeq 2f\n"
779 " subql #1,%3\n"
780 " jne 1b\n"
781 "2: subl %3,%0\n"
782 "3:\n"
783 ".section .fixup,\"ax\"\n"
784 " .even\n"
785 "4: movel %4,%0\n"
786 " jra 3b\n"
787 ".previous\n"
788 ".section __ex_table,\"a\"\n"
789 " .align 4\n"
790 " .long 1b,4b\n"
791 " .long 12b,4b\n"
792 ".previous"
793 : "=d"(res), "=a"(dst), "=a"(src), "=d"(count)
794 : "i"(-EFAULT), "0"(count), "1"(dst), "2"(src), "3"(count)
795 : "d0", "memory");
796 return res;
797}
798
799/*
800 * Return the size of a string (including the ending 0)
801 *
802 * Return 0 on exception, a value greater than N if too long
803 */
804static inline long strnlen_user(const char __user *src, long n)
805{
806 long res;
807
808 res = -(unsigned long)src;
809 __asm__ __volatile__
810 ("1:\n"
811 " tstl %2\n"
812 " jeq 3f\n"
813 "2: movesb (%1)+,%%d0\n"
814 "22:\n"
815 " subql #1,%2\n"
816 " tstb %%d0\n"
817 " jne 1b\n"
818 " jra 4f\n"
819 "3:\n"
820 " addql #1,%0\n"
821 "4:\n"
822 " addl %1,%0\n"
823 "5:\n"
824 ".section .fixup,\"ax\"\n"
825 " .even\n"
826 "6: moveq %3,%0\n"
827 " jra 5b\n"
828 ".previous\n"
829 ".section __ex_table,\"a\"\n"
830 " .align 4\n"
831 " .long 2b,6b\n"
832 " .long 22b,6b\n"
833 ".previous"
834 : "=d"(res), "=a"(src), "=d"(n)
835 : "i"(0), "0"(res), "1"(src), "2"(n)
836 : "d0");
837 return res;
838}
839 344
840#define strlen_user(str) strnlen_user(str, 32767) 345#define strlen_user(str) strnlen_user(str, 32767)
841 346
842/*
843 * Zero Userspace
844 */
845
846static inline unsigned long
847clear_user(void __user *to, unsigned long n)
848{
849 __asm__ __volatile__
850 (" tstl %1\n"
851 " jeq 3f\n"
852 "1: movesl %3,(%0)+\n"
853 "2: subql #1,%1\n"
854 " jne 1b\n"
855 "3: movel %2,%1\n"
856 " bclr #1,%1\n"
857 " jeq 4f\n"
858 "24:movesw %3,(%0)+\n"
859 "4: bclr #0,%1\n"
860 " jeq 5f\n"
861 "25:movesb %3,(%0)+\n"
862 "5:\n"
863 ".section .fixup,\"ax\"\n"
864 " .even\n"
865 "61:addql #1,%1\n"
866 "6: lsll #2,%1\n"
867 " addl %2,%1\n"
868 " jra 5b\n"
869 "7: addql #2,%1\n"
870 " jra 5b\n"
871 "8: addql #1,%1\n"
872 " jra 5b\n"
873 ".previous\n"
874 ".section __ex_table,\"a\"\n"
875 " .align 4\n"
876 " .long 1b,61b\n"
877 " .long 2b,6b\n"
878 " .long 3b,61b\n"
879 " .long 24b,7b\n"
880 " .long 4b,7b\n"
881 " .long 25b,8b\n"
882 " .long 5b,8b\n"
883 ".previous"
884 : "=a"(to), "=d"(n)
885 : "r"(n & 3), "r"(0), "0"(to), "1"(n/4));
886 return n;
887}
888
889#endif /* _M68K_UACCESS_H */ 347#endif /* _M68K_UACCESS_H */
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h
index c2554bcd1747..7c0b6296b45c 100644
--- a/include/asm-m68k/unistd.h
+++ b/include/asm-m68k/unistd.h
@@ -285,6 +285,8 @@
285#define __NR_request_key 280 285#define __NR_request_key 280
286#define __NR_keyctl 281 286#define __NR_keyctl 281
287 287
288#ifdef __KERNEL__
289
288#define NR_syscalls 282 290#define NR_syscalls 282
289 291
290/* user-visible error numbers are in the range -1 - -124: see 292/* user-visible error numbers are in the range -1 - -124: see
@@ -383,7 +385,6 @@ __asm__ __volatile__ ("trap #0" \
383__syscall_return(type,__res); \ 385__syscall_return(type,__res); \
384} 386}
385 387
386#ifdef __KERNEL__
387#define __ARCH_WANT_IPC_PARSE_VERSION 388#define __ARCH_WANT_IPC_PARSE_VERSION
388#define __ARCH_WANT_OLD_READDIR 389#define __ARCH_WANT_OLD_READDIR
389#define __ARCH_WANT_OLD_STAT 390#define __ARCH_WANT_OLD_STAT
@@ -406,52 +407,12 @@ __syscall_return(type,__res); \
406#define __ARCH_WANT_SYS_SIGPENDING 407#define __ARCH_WANT_SYS_SIGPENDING
407#define __ARCH_WANT_SYS_SIGPROCMASK 408#define __ARCH_WANT_SYS_SIGPROCMASK
408#define __ARCH_WANT_SYS_RT_SIGACTION 409#define __ARCH_WANT_SYS_RT_SIGACTION
409#endif
410 410
411#ifdef __KERNEL_SYSCALLS__ 411#ifdef __KERNEL_SYSCALLS__
412 412
413#include <linux/compiler.h>
414#include <linux/interrupt.h>
415#include <linux/types.h>
416
417/*
418 * we need this inline - forking from kernel space will result
419 * in NO COPY ON WRITE (!!!), until an execve is executed. This
420 * is no problem, but for the stack. This is handled by not letting
421 * main() use the stack at all after fork(). Thus, no function
422 * calls - which means inline code for fork too, as otherwise we
423 * would use the stack upon exit from 'fork()'.
424 *
425 * Actually only pause and fork are needed inline, so that there
426 * won't be any messing with the stack from main(), but we define
427 * some others too.
428 */
429#define __NR__exit __NR_exit
430static inline _syscall0(pid_t,setsid)
431static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
432static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
433static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
434static inline _syscall1(int,dup,int,fd)
435static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) 413static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
436static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
437static inline _syscall1(int,close,int,fd)
438static inline _syscall1(int,_exit,int,exitcode)
439static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
440
441asmlinkage long sys_mmap2(
442 unsigned long addr, unsigned long len,
443 unsigned long prot, unsigned long flags,
444 unsigned long fd, unsigned long pgoff);
445asmlinkage int sys_execve(char *name, char **argv, char **envp);
446asmlinkage int sys_pipe(unsigned long *fildes);
447struct pt_regs;
448struct sigaction;
449asmlinkage long sys_rt_sigaction(int sig,
450 const struct sigaction __user *act,
451 struct sigaction __user *oact,
452 size_t sigsetsize);
453 414
454#endif 415#endif /* __KERNEL_SYSCALLS__ */
455 416
456/* 417/*
457 * "Conditional" syscalls 418 * "Conditional" syscalls
@@ -461,4 +422,5 @@ asmlinkage long sys_rt_sigaction(int sig,
461 */ 422 */
462#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 423#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
463 424
425#endif /* __KERNEL__ */
464#endif /* _ASM_M68K_UNISTD_H_ */ 426#endif /* _ASM_M68K_UNISTD_H_ */
diff --git a/include/asm-m68k/virtconvert.h b/include/asm-m68k/virtconvert.h
index 8c4e8037b898..83a87c9b1a16 100644
--- a/include/asm-m68k/virtconvert.h
+++ b/include/asm-m68k/virtconvert.h
@@ -7,7 +7,6 @@
7 7
8#ifdef __KERNEL__ 8#ifdef __KERNEL__
9 9
10#include <linux/config.h>
11#include <linux/compiler.h> 10#include <linux/compiler.h>
12#include <asm/setup.h> 11#include <asm/setup.h>
13#include <asm/page.h> 12#include <asm/page.h>
diff --git a/include/asm-m68knommu/bitops.h b/include/asm-m68knommu/bitops.h
index 0b68ccd327f7..d7fa7d9c0e0f 100644
--- a/include/asm-m68knommu/bitops.h
+++ b/include/asm-m68knommu/bitops.h
@@ -5,7 +5,6 @@
5 * Copyright 1992, Linus Torvalds. 5 * Copyright 1992, Linus Torvalds.
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/compiler.h> 8#include <linux/compiler.h>
10#include <asm/byteorder.h> /* swab32 */ 9#include <asm/byteorder.h> /* swab32 */
11#include <asm/system.h> /* save_flags */ 10#include <asm/system.h> /* save_flags */
diff --git a/include/asm-m68knommu/coldfire.h b/include/asm-m68knommu/coldfire.h
index 6190f77b1e6c..2fabca91df83 100644
--- a/include/asm-m68knommu/coldfire.h
+++ b/include/asm-m68knommu/coldfire.h
@@ -12,7 +12,6 @@
12#define coldfire_h 12#define coldfire_h
13/****************************************************************************/ 13/****************************************************************************/
14 14
15#include <linux/config.h>
16 15
17/* 16/*
18 * Define the processor support peripherals base address. 17 * Define the processor support peripherals base address.
diff --git a/include/asm-m68knommu/commproc.h b/include/asm-m68knommu/commproc.h
index e522ca8193a2..0161ebb5d883 100644
--- a/include/asm-m68knommu/commproc.h
+++ b/include/asm-m68knommu/commproc.h
@@ -17,7 +17,6 @@
17#ifndef __CPM_360__ 17#ifndef __CPM_360__
18#define __CPM_360__ 18#define __CPM_360__
19 19
20#include <linux/config.h>
21 20
22/* CPM Command register masks: */ 21/* CPM Command register masks: */
23#define CPM_CR_RST ((ushort)0x8000) 22#define CPM_CR_RST ((ushort)0x8000)
diff --git a/include/asm-m68knommu/dma-mapping.h b/include/asm-m68knommu/dma-mapping.h
index a6c42ba48da6..5622b855a577 100644
--- a/include/asm-m68knommu/dma-mapping.h
+++ b/include/asm-m68knommu/dma-mapping.h
@@ -1,7 +1,6 @@
1#ifndef _M68KNOMMU_DMA_MAPPING_H 1#ifndef _M68KNOMMU_DMA_MAPPING_H
2#define _M68KNOMMU_DMA_MAPPING_H 2#define _M68KNOMMU_DMA_MAPPING_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_PCI 5#ifdef CONFIG_PCI
7#include <asm-generic/dma-mapping.h> 6#include <asm-generic/dma-mapping.h>
diff --git a/include/asm-m68knommu/dma.h b/include/asm-m68knommu/dma.h
index 43e98c96a5c2..3338001abb40 100644
--- a/include/asm-m68knommu/dma.h
+++ b/include/asm-m68knommu/dma.h
@@ -3,7 +3,6 @@
3 3
4//#define DMA_DEBUG 1 4//#define DMA_DEBUG 1
5 5
6#include <linux/config.h>
7 6
8#ifdef CONFIG_COLDFIRE 7#ifdef CONFIG_COLDFIRE
9/* 8/*
diff --git a/include/asm-m68knommu/elf.h b/include/asm-m68knommu/elf.h
index 9919487703bc..40b1ed6827db 100644
--- a/include/asm-m68knommu/elf.h
+++ b/include/asm-m68knommu/elf.h
@@ -5,7 +5,6 @@
5 * ELF register definitions.. 5 * ELF register definitions..
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <asm/ptrace.h> 8#include <asm/ptrace.h>
10#include <asm/user.h> 9#include <asm/user.h>
11 10
diff --git a/include/asm-m68knommu/elia.h b/include/asm-m68knommu/elia.h
index f18b8e9d8c36..e037d4e2de33 100644
--- a/include/asm-m68knommu/elia.h
+++ b/include/asm-m68knommu/elia.h
@@ -12,7 +12,6 @@
12#define elia_h 12#define elia_h
13/****************************************************************************/ 13/****************************************************************************/
14 14
15#include <linux/config.h>
16#include <asm/coldfire.h> 15#include <asm/coldfire.h>
17 16
18#ifdef CONFIG_eLIA 17#ifdef CONFIG_eLIA
diff --git a/include/asm-m68knommu/entry.h b/include/asm-m68knommu/entry.h
index 06f5aa70b0b5..c2553d26273d 100644
--- a/include/asm-m68knommu/entry.h
+++ b/include/asm-m68knommu/entry.h
@@ -1,7 +1,6 @@
1#ifndef __M68KNOMMU_ENTRY_H 1#ifndef __M68KNOMMU_ENTRY_H
2#define __M68KNOMMU_ENTRY_H 2#define __M68KNOMMU_ENTRY_H
3 3
4#include <linux/config.h>
5#include <asm/setup.h> 4#include <asm/setup.h>
6#include <asm/page.h> 5#include <asm/page.h>
7 6
diff --git a/include/asm-m68knommu/fpu.h b/include/asm-m68knommu/fpu.h
index 225082991a03..b16b2e4fca2a 100644
--- a/include/asm-m68knommu/fpu.h
+++ b/include/asm-m68knommu/fpu.h
@@ -1,7 +1,6 @@
1#ifndef __M68KNOMMU_FPU_H 1#ifndef __M68KNOMMU_FPU_H
2#define __M68KNOMMU_FPU_H 2#define __M68KNOMMU_FPU_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * MAX floating point unit state size (FSAVE/FRESTORE) 6 * MAX floating point unit state size (FSAVE/FRESTORE)
diff --git a/include/asm-m68knommu/hardirq.h b/include/asm-m68knommu/hardirq.h
index 476180f4cba2..980075bab792 100644
--- a/include/asm-m68knommu/hardirq.h
+++ b/include/asm-m68knommu/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef __M68K_HARDIRQ_H 1#ifndef __M68K_HARDIRQ_H
2#define __M68K_HARDIRQ_H 2#define __M68K_HARDIRQ_H
3 3
4#include <linux/config.h>
5#include <linux/cache.h> 4#include <linux/cache.h>
6#include <linux/threads.h> 5#include <linux/threads.h>
7#include <asm/irq.h> 6#include <asm/irq.h>
diff --git a/include/asm-m68knommu/io.h b/include/asm-m68knommu/io.h
index e08f2ee4b4a2..8df4cee2a0cd 100644
--- a/include/asm-m68knommu/io.h
+++ b/include/asm-m68knommu/io.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7 6
8/* 7/*
9 * These are for ISA/PCI shared memory _only_ and should never be used 8 * These are for ISA/PCI shared memory _only_ and should never be used
diff --git a/include/asm-m68knommu/irq.h b/include/asm-m68knommu/irq.h
index 20c48ec858a4..c5247516fcfe 100644
--- a/include/asm-m68knommu/irq.h
+++ b/include/asm-m68knommu/irq.h
@@ -1,7 +1,6 @@
1#ifndef _M68K_IRQ_H_ 1#ifndef _M68K_IRQ_H_
2#define _M68K_IRQ_H_ 2#define _M68K_IRQ_H_
3 3
4#include <linux/config.h>
5#include <asm/ptrace.h> 4#include <asm/ptrace.h>
6 5
7#ifdef CONFIG_COLDFIRE 6#ifdef CONFIG_COLDFIRE
@@ -88,8 +87,4 @@ extern void (*mach_disable_irq)(unsigned int);
88#define disable_irq(x) do { } while (0) 87#define disable_irq(x) do { } while (0)
89#define disable_irq_nosync(x) disable_irq(x) 88#define disable_irq_nosync(x) disable_irq(x)
90 89
91struct irqaction;
92struct pt_regs;
93int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
94
95#endif /* _M68K_IRQ_H_ */ 90#endif /* _M68K_IRQ_H_ */
diff --git a/include/asm-m68knommu/m5206sim.h b/include/asm-m68knommu/m5206sim.h
index d1e7509021c5..7e3594dea88b 100644
--- a/include/asm-m68knommu/m5206sim.h
+++ b/include/asm-m68knommu/m5206sim.h
@@ -12,7 +12,6 @@
12#define m5206sim_h 12#define m5206sim_h
13/****************************************************************************/ 13/****************************************************************************/
14 14
15#include <linux/config.h>
16 15
17/* 16/*
18 * Define the 5206 SIM register set addresses. 17 * Define the 5206 SIM register set addresses.
diff --git a/include/asm-m68knommu/m520xsim.h b/include/asm-m68knommu/m520xsim.h
index 6dc62869e62b..1dac22ea95ba 100644
--- a/include/asm-m68knommu/m520xsim.h
+++ b/include/asm-m68knommu/m520xsim.h
@@ -11,7 +11,6 @@
11#define m520xsim_h 11#define m520xsim_h
12/****************************************************************************/ 12/****************************************************************************/
13 13
14#include <linux/config.h>
15 14
16/* 15/*
17 * Define the 5282 SIM register set addresses. 16 * Define the 5282 SIM register set addresses.
diff --git a/include/asm-m68knommu/m523xsim.h b/include/asm-m68knommu/m523xsim.h
index 926cfb805df7..bf397313e93f 100644
--- a/include/asm-m68knommu/m523xsim.h
+++ b/include/asm-m68knommu/m523xsim.h
@@ -11,7 +11,6 @@
11#define m523xsim_h 11#define m523xsim_h
12/****************************************************************************/ 12/****************************************************************************/
13 13
14#include <linux/config.h>
15 14
16/* 15/*
17 * Define the 523x SIM register set addresses. 16 * Define the 523x SIM register set addresses.
diff --git a/include/asm-m68knommu/m5272sim.h b/include/asm-m68knommu/m5272sim.h
index b40875362f46..6217edc21139 100644
--- a/include/asm-m68knommu/m5272sim.h
+++ b/include/asm-m68knommu/m5272sim.h
@@ -12,7 +12,6 @@
12#define m5272sim_h 12#define m5272sim_h
13/****************************************************************************/ 13/****************************************************************************/
14 14
15#include <linux/config.h>
16 15
17/* 16/*
18 * Define the 5272 SIM register set addresses. 17 * Define the 5272 SIM register set addresses.
diff --git a/include/asm-m68knommu/m527xsim.h b/include/asm-m68knommu/m527xsim.h
index e7878d0f7d7a..1f63ab3fb3e6 100644
--- a/include/asm-m68knommu/m527xsim.h
+++ b/include/asm-m68knommu/m527xsim.h
@@ -11,7 +11,6 @@
11#define m527xsim_h 11#define m527xsim_h
12/****************************************************************************/ 12/****************************************************************************/
13 13
14#include <linux/config.h>
15 14
16/* 15/*
17 * Define the 5270/5271 SIM register set addresses. 16 * Define the 5270/5271 SIM register set addresses.
diff --git a/include/asm-m68knommu/m528xsim.h b/include/asm-m68knommu/m528xsim.h
index 610774a17f70..1a3b1ae06b1e 100644
--- a/include/asm-m68knommu/m528xsim.h
+++ b/include/asm-m68knommu/m528xsim.h
@@ -11,7 +11,6 @@
11#define m528xsim_h 11#define m528xsim_h
12/****************************************************************************/ 12/****************************************************************************/
13 13
14#include <linux/config.h>
15 14
16/* 15/*
17 * Define the 5280/5282 SIM register set addresses. 16 * Define the 5280/5282 SIM register set addresses.
diff --git a/include/asm-m68knommu/mcfcache.h b/include/asm-m68knommu/mcfcache.h
index 9cb401421835..45d1ac57ea82 100644
--- a/include/asm-m68knommu/mcfcache.h
+++ b/include/asm-m68knommu/mcfcache.h
@@ -11,7 +11,6 @@
11#define __M68KNOMMU_MCFCACHE_H 11#define __M68KNOMMU_MCFCACHE_H
12/****************************************************************************/ 12/****************************************************************************/
13 13
14#include <linux/config.h>
15 14
16/* 15/*
17 * The different ColdFire families have different cache arrangments. 16 * The different ColdFire families have different cache arrangments.
diff --git a/include/asm-m68knommu/mcfdma.h b/include/asm-m68knommu/mcfdma.h
index b93f8ba8a248..ea729e81a6be 100644
--- a/include/asm-m68knommu/mcfdma.h
+++ b/include/asm-m68knommu/mcfdma.h
@@ -11,7 +11,6 @@
11#define mcfdma_h 11#define mcfdma_h
12/****************************************************************************/ 12/****************************************************************************/
13 13
14#include <linux/config.h>
15 14
16/* 15/*
17 * Get address specific defines for this Coldfire member. 16 * Get address specific defines for this Coldfire member.
diff --git a/include/asm-m68knommu/mcfmbus.h b/include/asm-m68knommu/mcfmbus.h
index 4762589e858a..13df9d41bd1a 100644
--- a/include/asm-m68knommu/mcfmbus.h
+++ b/include/asm-m68knommu/mcfmbus.h
@@ -11,7 +11,6 @@
11 11
12#ifndef mcfmbus_h 12#ifndef mcfmbus_h
13#define mcfmbus_h 13#define mcfmbus_h
14#include <linux/config.h>
15 14
16 15
17#define MCFMBUS_BASE 0x280 16#define MCFMBUS_BASE 0x280
diff --git a/include/asm-m68knommu/mcfne.h b/include/asm-m68knommu/mcfne.h
index a71b1c8cb4f8..c920ccdb61fe 100644
--- a/include/asm-m68knommu/mcfne.h
+++ b/include/asm-m68knommu/mcfne.h
@@ -18,7 +18,6 @@
18#define mcfne_h 18#define mcfne_h
19/****************************************************************************/ 19/****************************************************************************/
20 20
21#include <linux/config.h>
22 21
23/* 22/*
24 * Support for NE2000 clones devices in ColdFire based boards. 23 * Support for NE2000 clones devices in ColdFire based boards.
diff --git a/include/asm-m68knommu/mcfpci.h b/include/asm-m68knommu/mcfpci.h
index d6229047d06e..f1507dd06ec6 100644
--- a/include/asm-m68knommu/mcfpci.h
+++ b/include/asm-m68knommu/mcfpci.h
@@ -12,7 +12,6 @@
12#define mcfpci_h 12#define mcfpci_h
13/****************************************************************************/ 13/****************************************************************************/
14 14
15#include <linux/config.h>
16 15
17#ifdef CONFIG_PCI 16#ifdef CONFIG_PCI
18 17
diff --git a/include/asm-m68knommu/mcfpit.h b/include/asm-m68knommu/mcfpit.h
index a685f1b45401..0d2672dd518a 100644
--- a/include/asm-m68knommu/mcfpit.h
+++ b/include/asm-m68knommu/mcfpit.h
@@ -11,7 +11,6 @@
11#define mcfpit_h 11#define mcfpit_h
12/****************************************************************************/ 12/****************************************************************************/
13 13
14#include <linux/config.h>
15 14
16/* 15/*
17 * Get address specific defines for the 5270/5271, 5280/5282, and 5208. 16 * Get address specific defines for the 5270/5271, 5280/5282, and 5208.
diff --git a/include/asm-m68knommu/mcfsim.h b/include/asm-m68knommu/mcfsim.h
index 81d74a31dc43..97a0c2734a72 100644
--- a/include/asm-m68knommu/mcfsim.h
+++ b/include/asm-m68knommu/mcfsim.h
@@ -12,7 +12,6 @@
12#define mcfsim_h 12#define mcfsim_h
13/****************************************************************************/ 13/****************************************************************************/
14 14
15#include <linux/config.h>
16 15
17/* 16/*
18 * Include 5204, 5206/e, 5235, 5249, 5270/5271, 5272, 5280/5282, 17 * Include 5204, 5206/e, 5235, 5249, 5270/5271, 5272, 5280/5282,
diff --git a/include/asm-m68knommu/mcfsmc.h b/include/asm-m68knommu/mcfsmc.h
index 2583900b9591..2d7a4dbd9683 100644
--- a/include/asm-m68knommu/mcfsmc.h
+++ b/include/asm-m68knommu/mcfsmc.h
@@ -17,7 +17,6 @@
17 * allow 8 bit accesses. So this code is 16bit access only. 17 * allow 8 bit accesses. So this code is 16bit access only.
18 */ 18 */
19 19
20#include <linux/config.h>
21 20
22#undef outb 21#undef outb
23#undef inb 22#undef inb
diff --git a/include/asm-m68knommu/mcftimer.h b/include/asm-m68knommu/mcftimer.h
index 0f47164c33a9..68bf33ac10d1 100644
--- a/include/asm-m68knommu/mcftimer.h
+++ b/include/asm-m68knommu/mcftimer.h
@@ -12,7 +12,6 @@
12#define mcftimer_h 12#define mcftimer_h
13/****************************************************************************/ 13/****************************************************************************/
14 14
15#include <linux/config.h>
16 15
17/* 16/*
18 * Get address specific defines for this ColdFire member. 17 * Get address specific defines for this ColdFire member.
diff --git a/include/asm-m68knommu/mcfuart.h b/include/asm-m68knommu/mcfuart.h
index b016fad83119..8040e43786be 100644
--- a/include/asm-m68knommu/mcfuart.h
+++ b/include/asm-m68knommu/mcfuart.h
@@ -12,7 +12,6 @@
12#define mcfuart_h 12#define mcfuart_h
13/****************************************************************************/ 13/****************************************************************************/
14 14
15#include <linux/config.h>
16 15
17/* 16/*
18 * Define the base address of the UARTS within the MBAR address 17 * Define the base address of the UARTS within the MBAR address
diff --git a/include/asm-m68knommu/mcfwdebug.h b/include/asm-m68knommu/mcfwdebug.h
index 6ceae103596b..27f70e45d700 100644
--- a/include/asm-m68knommu/mcfwdebug.h
+++ b/include/asm-m68knommu/mcfwdebug.h
@@ -10,7 +10,6 @@
10#ifndef mcfdebug_h 10#ifndef mcfdebug_h
11#define mcfdebug_h 11#define mcfdebug_h
12/****************************************************************************/ 12/****************************************************************************/
13#include <linux/config.h>
14 13
15/* Define the debug module registers */ 14/* Define the debug module registers */
16#define MCFDEBUG_CSR 0x0 /* Configuration status */ 15#define MCFDEBUG_CSR 0x0 /* Configuration status */
diff --git a/include/asm-m68knommu/mmu_context.h b/include/asm-m68knommu/mmu_context.h
index 1e080eca9ca8..6c077d3a2572 100644
--- a/include/asm-m68knommu/mmu_context.h
+++ b/include/asm-m68knommu/mmu_context.h
@@ -1,7 +1,6 @@
1#ifndef __M68KNOMMU_MMU_CONTEXT_H 1#ifndef __M68KNOMMU_MMU_CONTEXT_H
2#define __M68KNOMMU_MMU_CONTEXT_H 2#define __M68KNOMMU_MMU_CONTEXT_H
3 3
4#include <linux/config.h>
5#include <asm/setup.h> 4#include <asm/setup.h>
6#include <asm/page.h> 5#include <asm/page.h>
7#include <asm/pgalloc.h> 6#include <asm/pgalloc.h>
diff --git a/include/asm-m68knommu/nettel.h b/include/asm-m68knommu/nettel.h
index 9bda307e6544..0299f6a2deeb 100644
--- a/include/asm-m68knommu/nettel.h
+++ b/include/asm-m68knommu/nettel.h
@@ -13,7 +13,6 @@
13#define nettel_h 13#define nettel_h
14/****************************************************************************/ 14/****************************************************************************/
15 15
16#include <linux/config.h>
17 16
18/****************************************************************************/ 17/****************************************************************************/
19#ifdef CONFIG_NETtel 18#ifdef CONFIG_NETtel
diff --git a/include/asm-m68knommu/page.h b/include/asm-m68knommu/page.h
index 942dfbead27f..a22bf5a88160 100644
--- a/include/asm-m68knommu/page.h
+++ b/include/asm-m68knommu/page.h
@@ -1,7 +1,6 @@
1#ifndef _M68KNOMMU_PAGE_H 1#ifndef _M68KNOMMU_PAGE_H
2#define _M68KNOMMU_PAGE_H 2#define _M68KNOMMU_PAGE_H
3 3
4#include <linux/config.h>
5 4
6/* PAGE_SHIFT determines the page size */ 5/* PAGE_SHIFT determines the page size */
7 6
diff --git a/include/asm-m68knommu/page_offset.h b/include/asm-m68knommu/page_offset.h
index 2b45645e9b29..8ed6d7b7d9d1 100644
--- a/include/asm-m68knommu/page_offset.h
+++ b/include/asm-m68knommu/page_offset.h
@@ -1,5 +1,4 @@
1 1
2#include <linux/config.h>
3 2
4/* This handles the memory map.. */ 3/* This handles the memory map.. */
5 4
diff --git a/include/asm-m68knommu/param.h b/include/asm-m68knommu/param.h
index 3f57d5db81f5..4c9904d6512e 100644
--- a/include/asm-m68knommu/param.h
+++ b/include/asm-m68knommu/param.h
@@ -1,7 +1,6 @@
1#ifndef _M68KNOMMU_PARAM_H 1#ifndef _M68KNOMMU_PARAM_H
2#define _M68KNOMMU_PARAM_H 2#define _M68KNOMMU_PARAM_H
3 3
4#include <linux/config.h>
5 4
6#if defined(CONFIG_CLEOPATRA) 5#if defined(CONFIG_CLEOPATRA)
7#define HZ 1000 6#define HZ 1000
diff --git a/include/asm-m68knommu/pgtable.h b/include/asm-m68knommu/pgtable.h
index 00893055e6c2..549ad231efad 100644
--- a/include/asm-m68knommu/pgtable.h
+++ b/include/asm-m68knommu/pgtable.h
@@ -7,7 +7,6 @@
7 * (C) Copyright 2000-2002, Greg Ungerer <gerg@snapgear.com> 7 * (C) Copyright 2000-2002, Greg Ungerer <gerg@snapgear.com>
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/slab.h> 10#include <linux/slab.h>
12#include <asm/processor.h> 11#include <asm/processor.h>
13#include <asm/page.h> 12#include <asm/page.h>
diff --git a/include/asm-m68knommu/processor.h b/include/asm-m68knommu/processor.h
index ba393b1a023b..278b00bc60c5 100644
--- a/include/asm-m68knommu/processor.h
+++ b/include/asm-m68knommu/processor.h
@@ -13,7 +13,6 @@
13 */ 13 */
14#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 14#define current_text_addr() ({ __label__ _l; _l: &&_l;})
15 15
16#include <linux/config.h>
17#include <linux/threads.h> 16#include <linux/threads.h>
18#include <asm/types.h> 17#include <asm/types.h>
19#include <asm/segment.h> 18#include <asm/segment.h>
diff --git a/include/asm-m68knommu/ptrace.h b/include/asm-m68knommu/ptrace.h
index f65bd90749e6..1e19c457de7d 100644
--- a/include/asm-m68knommu/ptrace.h
+++ b/include/asm-m68knommu/ptrace.h
@@ -70,7 +70,7 @@ struct switch_stack {
70/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ 70/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
71#define PTRACE_GETREGS 12 71#define PTRACE_GETREGS 12
72#define PTRACE_SETREGS 13 72#define PTRACE_SETREGS 13
73#ifdef COFNIG_FPU 73#ifdef CONFIG_FPU
74#define PTRACE_GETFPREGS 14 74#define PTRACE_GETFPREGS 14
75#define PTRACE_SETFPREGS 15 75#define PTRACE_SETFPREGS 15
76#endif 76#endif
diff --git a/include/asm-m68knommu/semaphore-helper.h b/include/asm-m68knommu/semaphore-helper.h
index a6586417c1c2..43da7bc483c7 100644
--- a/include/asm-m68knommu/semaphore-helper.h
+++ b/include/asm-m68knommu/semaphore-helper.h
@@ -9,7 +9,6 @@
9 * m68k version by Andreas Schwab 9 * m68k version by Andreas Schwab
10 */ 10 */
11 11
12#include <linux/config.h>
13 12
14/* 13/*
15 * These two _must_ execute atomically wrt each other. 14 * These two _must_ execute atomically wrt each other.
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h
index 6338afc850ba..2bbe2db00a22 100644
--- a/include/asm-m68knommu/system.h
+++ b/include/asm-m68knommu/system.h
@@ -1,7 +1,6 @@
1#ifndef _M68KNOMMU_SYSTEM_H 1#ifndef _M68KNOMMU_SYSTEM_H
2#define _M68KNOMMU_SYSTEM_H 2#define _M68KNOMMU_SYSTEM_H
3 3
4#include <linux/config.h> /* get configuration macros */
5#include <linux/linkage.h> 4#include <linux/linkage.h>
6#include <asm/segment.h> 5#include <asm/segment.h>
7#include <asm/entry.h> 6#include <asm/entry.h>
diff --git a/include/asm-m68knommu/unaligned.h b/include/asm-m68knommu/unaligned.h
index 8876f034ea64..869e9dd24f54 100644
--- a/include/asm-m68knommu/unaligned.h
+++ b/include/asm-m68knommu/unaligned.h
@@ -1,7 +1,6 @@
1#ifndef __M68K_UNALIGNED_H 1#ifndef __M68K_UNALIGNED_H
2#define __M68K_UNALIGNED_H 2#define __M68K_UNALIGNED_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_COLDFIRE 5#ifdef CONFIG_COLDFIRE
7 6
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h
index 5373988a7e51..1b2abdf281e1 100644
--- a/include/asm-m68knommu/unistd.h
+++ b/include/asm-m68knommu/unistd.h
@@ -286,6 +286,8 @@
286#define __NR_request_key 280 286#define __NR_request_key 280
287#define __NR_keyctl 281 287#define __NR_keyctl 281
288 288
289#ifdef __KERNEL__
290
289#define NR_syscalls 282 291#define NR_syscalls 282
290 292
291/* user-visible error numbers are in the range -1 - -122: see 293/* user-visible error numbers are in the range -1 - -122: see
@@ -437,7 +439,6 @@ type name(atype a, btype b, ctype c, dtype d, etype e) \
437 return (type)__res; \ 439 return (type)__res; \
438} 440}
439 441
440#ifdef __KERNEL__
441#define __ARCH_WANT_IPC_PARSE_VERSION 442#define __ARCH_WANT_IPC_PARSE_VERSION
442#define __ARCH_WANT_OLD_READDIR 443#define __ARCH_WANT_OLD_READDIR
443#define __ARCH_WANT_OLD_STAT 444#define __ARCH_WANT_OLD_STAT
@@ -460,7 +461,6 @@ type name(atype a, btype b, ctype c, dtype d, etype e) \
460#define __ARCH_WANT_SYS_SIGPENDING 461#define __ARCH_WANT_SYS_SIGPENDING
461#define __ARCH_WANT_SYS_SIGPROCMASK 462#define __ARCH_WANT_SYS_SIGPROCMASK
462#define __ARCH_WANT_SYS_RT_SIGACTION 463#define __ARCH_WANT_SYS_RT_SIGACTION
463#endif
464 464
465#ifdef __KERNEL_SYSCALLS__ 465#ifdef __KERNEL_SYSCALLS__
466 466
@@ -515,7 +515,7 @@ asmlinkage long sys_rt_sigaction(int sig,
515 struct sigaction __user *oact, 515 struct sigaction __user *oact,
516 size_t sigsetsize); 516 size_t sigsetsize);
517 517
518#endif 518#endif /* __KERNEL_SYSCALLS__ */
519 519
520/* 520/*
521 * "Conditional" syscalls 521 * "Conditional" syscalls
@@ -525,4 +525,5 @@ asmlinkage long sys_rt_sigaction(int sig,
525 */ 525 */
526#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 526#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
527 527
528#endif /* __KERNEL__ */
528#endif /* _ASM_M68K_UNISTD_H_ */ 529#endif /* _ASM_M68K_UNISTD_H_ */
diff --git a/include/asm-mips/a.out.h b/include/asm-mips/a.out.h
index 2b3dc3bed4da..ef33c3f13484 100644
--- a/include/asm-mips/a.out.h
+++ b/include/asm-mips/a.out.h
@@ -10,7 +10,6 @@
10 10
11#ifdef __KERNEL__ 11#ifdef __KERNEL__
12 12
13#include <linux/config.h>
14 13
15#endif 14#endif
16 15
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
index 0cc6c7060f3c..45c706e34df1 100644
--- a/include/asm-mips/addrspace.h
+++ b/include/asm-mips/addrspace.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_ADDRSPACE_H 10#ifndef _ASM_ADDRSPACE_H
11#define _ASM_ADDRSPACE_H 11#define _ASM_ADDRSPACE_H
12 12
13#include <linux/config.h>
14#include <spaces.h> 13#include <spaces.h>
15 14
16/* 15/*
diff --git a/include/asm-mips/arc/types.h b/include/asm-mips/arc/types.h
index bbb725c366fb..b9adcd6f0860 100644
--- a/include/asm-mips/arc/types.h
+++ b/include/asm-mips/arc/types.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_ARC_TYPES_H 9#ifndef _ASM_ARC_TYPES_H
10#define _ASM_ARC_TYPES_H 10#define _ASM_ARC_TYPES_H
11 11
12#include <linux/config.h>
13 12
14#ifdef CONFIG_ARC32 13#ifdef CONFIG_ARC32
15 14
diff --git a/include/asm-mips/asm.h b/include/asm-mips/asm.h
index 4b090f3142e0..e3038a4599ee 100644
--- a/include/asm-mips/asm.h
+++ b/include/asm-mips/asm.h
@@ -17,7 +17,6 @@
17#ifndef __ASM_ASM_H 17#ifndef __ASM_ASM_H
18#define __ASM_ASM_H 18#define __ASM_ASM_H
19 19
20#include <linux/config.h>
21#include <asm/sgidefs.h> 20#include <asm/sgidefs.h>
22 21
23#ifndef CAT 22#ifndef CAT
diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h
index f54aa147ec19..2c42f6b00a49 100644
--- a/include/asm-mips/asmmacro.h
+++ b/include/asm-mips/asmmacro.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_ASMMACRO_H 8#ifndef _ASM_ASMMACRO_H
9#define _ASM_ASMMACRO_H 9#define _ASM_ASMMACRO_H
10 10
11#include <linux/config.h>
12#include <asm/hazards.h> 11#include <asm/hazards.h>
13 12
14#ifdef CONFIG_32BIT 13#ifdef CONFIG_32BIT
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index 2c8b853376c9..13d44e14025a 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -17,7 +17,6 @@
17 * <linux/spinlock.h> we have to include <linux/spinlock.h> outside the 17 * <linux/spinlock.h> we have to include <linux/spinlock.h> outside the
18 * main big wrapper ... 18 * main big wrapper ...
19 */ 19 */
20#include <linux/config.h>
21#include <linux/spinlock.h> 20#include <linux/spinlock.h>
22 21
23#ifndef _ASM_ATOMIC_H 22#ifndef _ASM_ATOMIC_H
diff --git a/include/asm-mips/bcache.h b/include/asm-mips/bcache.h
index 446102b34f4e..3646a3f2ed38 100644
--- a/include/asm-mips/bcache.h
+++ b/include/asm-mips/bcache.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_BCACHE_H 9#ifndef _ASM_BCACHE_H
10#define _ASM_BCACHE_H 10#define _ASM_BCACHE_H
11 11
12#include <linux/config.h>
13 12
14/* Some R4000 / R4400 / R4600 / R5000 machines may have a non-dma-coherent, 13/* Some R4000 / R4400 / R4600 / R5000 machines may have a non-dma-coherent,
15 chipset implemented caches. On machines with other CPUs the CPU does the 14 chipset implemented caches. On machines with other CPUs the CPU does the
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index d2f444537e4b..098cec263681 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_BITOPS_H 9#ifndef _ASM_BITOPS_H
10#define _ASM_BITOPS_H 10#define _ASM_BITOPS_H
11 11
12#include <linux/config.h>
13#include <linux/compiler.h> 12#include <linux/compiler.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <asm/bug.h> 14#include <asm/bug.h>
diff --git a/include/asm-mips/bug.h b/include/asm-mips/bug.h
index 87d49a5bdc63..7b4739dc8f3f 100644
--- a/include/asm-mips/bug.h
+++ b/include/asm-mips/bug.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_BUG_H 1#ifndef __ASM_BUG_H
2#define __ASM_BUG_H 2#define __ASM_BUG_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_BUG 5#ifdef CONFIG_BUG
7 6
diff --git a/include/asm-mips/bugs.h b/include/asm-mips/bugs.h
index cb2ea7c15c7a..0d7f9c1f5546 100644
--- a/include/asm-mips/bugs.h
+++ b/include/asm-mips/bugs.h
@@ -7,7 +7,6 @@
7#ifndef _ASM_BUGS_H 7#ifndef _ASM_BUGS_H
8#define _ASM_BUGS_H 8#define _ASM_BUGS_H
9 9
10#include <linux/config.h>
11#include <linux/delay.h> 10#include <linux/delay.h>
12#include <asm/cpu.h> 11#include <asm/cpu.h>
13#include <asm/cpu-info.h> 12#include <asm/cpu-info.h>
diff --git a/include/asm-mips/byteorder.h b/include/asm-mips/byteorder.h
index aefc02f16fd8..eee83cbdf2b0 100644
--- a/include/asm-mips/byteorder.h
+++ b/include/asm-mips/byteorder.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_BYTEORDER_H 8#ifndef _ASM_BYTEORDER_H
9#define _ASM_BYTEORDER_H 9#define _ASM_BYTEORDER_H
10 10
11#include <linux/config.h>
12#include <linux/compiler.h> 11#include <linux/compiler.h>
13#include <asm/types.h> 12#include <asm/types.h>
14 13
diff --git a/include/asm-mips/cache.h b/include/asm-mips/cache.h
index 55e19f2ff0e0..37f175c42bb5 100644
--- a/include/asm-mips/cache.h
+++ b/include/asm-mips/cache.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_CACHE_H 9#ifndef _ASM_CACHE_H
10#define _ASM_CACHE_H 10#define _ASM_CACHE_H
11 11
12#include <linux/config.h>
13#include <kmalloc.h> 12#include <kmalloc.h>
14 13
15#define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT 14#define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h
index b09f8971e95d..a5e6050ec0f3 100644
--- a/include/asm-mips/checksum.h
+++ b/include/asm-mips/checksum.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_CHECKSUM_H 11#ifndef _ASM_CHECKSUM_H
12#define _ASM_CHECKSUM_H 12#define _ASM_CHECKSUM_H
13 13
14#include <linux/config.h>
15#include <linux/in6.h> 14#include <linux/in6.h>
16 15
17#include <asm/uaccess.h> 16#include <asm/uaccess.h>
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h
index 254e11ed247b..881ce1f9803d 100644
--- a/include/asm-mips/cpu-features.h
+++ b/include/asm-mips/cpu-features.h
@@ -9,7 +9,6 @@
9#ifndef __ASM_CPU_FEATURES_H 9#ifndef __ASM_CPU_FEATURES_H
10#define __ASM_CPU_FEATURES_H 10#define __ASM_CPU_FEATURES_H
11 11
12#include <linux/config.h>
13 12
14#include <asm/cpu.h> 13#include <asm/cpu.h>
15#include <asm/cpu-info.h> 14#include <asm/cpu-info.h>
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h
index 6572ac703662..a2f0c8ea9160 100644
--- a/include/asm-mips/cpu-info.h
+++ b/include/asm-mips/cpu-info.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_CPU_INFO_H 12#ifndef __ASM_CPU_INFO_H
13#define __ASM_CPU_INFO_H 13#define __ASM_CPU_INFO_H
14 14
15#include <linux/config.h>
16#include <asm/cache.h> 15#include <asm/cache.h>
17 16
18#ifdef CONFIG_SGI_IP27 17#ifdef CONFIG_SGI_IP27
diff --git a/include/asm-mips/ddb5xxx/ddb5477.h b/include/asm-mips/ddb5xxx/ddb5477.h
index a438548e6ef3..c5af4b73fdd7 100644
--- a/include/asm-mips/ddb5xxx/ddb5477.h
+++ b/include/asm-mips/ddb5xxx/ddb5477.h
@@ -17,7 +17,6 @@
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 <linux/config.h>
21 20
22/* 21/*
23 * This contains macros that are specific to DDB5477 or renamed from 22 * This contains macros that are specific to DDB5477 or renamed from
diff --git a/include/asm-mips/ddb5xxx/ddb5xxx.h b/include/asm-mips/ddb5xxx/ddb5xxx.h
index 2f1b191c6fff..e97fcc8d548b 100644
--- a/include/asm-mips/ddb5xxx/ddb5xxx.h
+++ b/include/asm-mips/ddb5xxx/ddb5xxx.h
@@ -18,7 +18,6 @@
18#ifndef __ASM_DDB5XXX_DDB5XXX_H 18#ifndef __ASM_DDB5XXX_DDB5XXX_H
19#define __ASM_DDB5XXX_DDB5XXX_H 19#define __ASM_DDB5XXX_DDB5XXX_H
20 20
21#include <linux/config.h>
22#include <linux/types.h> 21#include <linux/types.h>
23 22
24/* 23/*
diff --git a/include/asm-mips/debug.h b/include/asm-mips/debug.h
index 930f2b75e766..1fd5a2b39445 100644
--- a/include/asm-mips/debug.h
+++ b/include/asm-mips/debug.h
@@ -15,7 +15,6 @@
15#ifndef _ASM_DEBUG_H 15#ifndef _ASM_DEBUG_H
16#define _ASM_DEBUG_H 16#define _ASM_DEBUG_H
17 17
18#include <linux/config.h>
19 18
20/* 19/*
21 * run-time macros for catching spurious errors. Eable CONFIG_RUNTIME_DEBUG in 20 * run-time macros for catching spurious errors. Eable CONFIG_RUNTIME_DEBUG in
diff --git a/include/asm-mips/dec/prom.h b/include/asm-mips/dec/prom.h
index 1384dd0964b9..b9c8203688d5 100644
--- a/include/asm-mips/dec/prom.h
+++ b/include/asm-mips/dec/prom.h
@@ -15,7 +15,6 @@
15#ifndef _ASM_DEC_PROM_H 15#ifndef _ASM_DEC_PROM_H
16#define _ASM_DEC_PROM_H 16#define _ASM_DEC_PROM_H
17 17
18#include <linux/config.h>
19#include <linux/types.h> 18#include <linux/types.h>
20 19
21#include <asm/addrspace.h> 20#include <asm/addrspace.h>
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h
index 928f30f8c45c..ea77050f8e3a 100644
--- a/include/asm-mips/delay.h
+++ b/include/asm-mips/delay.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_DELAY_H 10#ifndef _ASM_DELAY_H
11#define _ASM_DELAY_H 11#define _ASM_DELAY_H
12 12
13#include <linux/config.h>
14#include <linux/param.h> 13#include <linux/param.h>
15#include <linux/smp.h> 14#include <linux/smp.h>
16#include <asm/compiler.h> 15#include <asm/compiler.h>
diff --git a/include/asm-mips/dma.h b/include/asm-mips/dma.h
index 6aaf9939a716..e85849ac165f 100644
--- a/include/asm-mips/dma.h
+++ b/include/asm-mips/dma.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_DMA_H 12#ifndef _ASM_DMA_H
13#define _ASM_DMA_H 13#define _ASM_DMA_H
14 14
15#include <linux/config.h>
16#include <asm/io.h> /* need byte IO */ 15#include <asm/io.h> /* need byte IO */
17#include <linux/spinlock.h> /* And spinlocks */ 16#include <linux/spinlock.h> /* And spinlocks */
18#include <linux/delay.h> 17#include <linux/delay.h>
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h
index bdc9de2df1ef..ebd6bfb19d66 100644
--- a/include/asm-mips/elf.h
+++ b/include/asm-mips/elf.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_ELF_H 8#ifndef _ASM_ELF_H
9#define _ASM_ELF_H 9#define _ASM_ELF_H
10 10
11#include <linux/config.h>
12 11
13/* ELF header e_flags defines. */ 12/* ELF header e_flags defines. */
14/* MIPS architecture level. */ 13/* MIPS architecture level. */
diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h
index 43d047a9a6af..787220e6c1fc 100644
--- a/include/asm-mips/fcntl.h
+++ b/include/asm-mips/fcntl.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_FCNTL_H 8#ifndef _ASM_FCNTL_H
9#define _ASM_FCNTL_H 9#define _ASM_FCNTL_H
10 10
11#include <linux/config.h>
12 11
13#define O_APPEND 0x0008 12#define O_APPEND 0x0008
14#define O_SYNC 0x0010 13#define O_SYNC 0x0010
diff --git a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h
index 73a3028dd9f9..1cadefbbc037 100644
--- a/include/asm-mips/fixmap.h
+++ b/include/asm-mips/fixmap.h
@@ -13,7 +13,6 @@
13#ifndef _ASM_FIXMAP_H 13#ifndef _ASM_FIXMAP_H
14#define _ASM_FIXMAP_H 14#define _ASM_FIXMAP_H
15 15
16#include <linux/config.h>
17#include <asm/page.h> 16#include <asm/page.h>
18#ifdef CONFIG_HIGHMEM 17#ifdef CONFIG_HIGHMEM
19#include <linux/threads.h> 18#include <linux/threads.h>
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h
index 8bf510a27c64..58c561a9ec6b 100644
--- a/include/asm-mips/fpu.h
+++ b/include/asm-mips/fpu.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_FPU_H 10#ifndef _ASM_FPU_H
11#define _ASM_FPU_H 11#define _ASM_FPU_H
12 12
13#include <linux/config.h>
14#include <linux/sched.h> 13#include <linux/sched.h>
15#include <linux/thread_info.h> 14#include <linux/thread_info.h>
16 15
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h
index 1f94640becc4..ed023eae0674 100644
--- a/include/asm-mips/futex.h
+++ b/include/asm-mips/futex.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7#include <linux/futex.h> 6#include <linux/futex.h>
8#include <asm/errno.h> 7#include <asm/errno.h>
9#include <asm/uaccess.h> 8#include <asm/uaccess.h>
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h
index dadc05188db7..66943c451c1d 100644
--- a/include/asm-mips/hazards.h
+++ b/include/asm-mips/hazards.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_HAZARDS_H 10#ifndef _ASM_HAZARDS_H
11#define _ASM_HAZARDS_H 11#define _ASM_HAZARDS_H
12 12
13#include <linux/config.h>
14 13
15#ifdef __ASSEMBLY__ 14#ifdef __ASSEMBLY__
16 15
diff --git a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h
index 8cf598402492..c976bfaaba83 100644
--- a/include/asm-mips/highmem.h
+++ b/include/asm-mips/highmem.h
@@ -19,7 +19,6 @@
19 19
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#include <linux/config.h>
23#include <linux/init.h> 22#include <linux/init.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
25#include <asm/kmap_types.h> 24#include <asm/kmap_types.h>
diff --git a/include/asm-mips/interrupt.h b/include/asm-mips/interrupt.h
index 4bb9c06f4410..a99d6867510f 100644
--- a/include/asm-mips/interrupt.h
+++ b/include/asm-mips/interrupt.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_INTERRUPT_H 11#ifndef _ASM_INTERRUPT_H
12#define _ASM_INTERRUPT_H 12#define _ASM_INTERRUPT_H
13 13
14#include <linux/config.h>
15#include <asm/hazards.h> 14#include <asm/hazards.h>
16 15
17__asm__ ( 16__asm__ (
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
index 6b17eb9d79a5..df624e1ee6e2 100644
--- a/include/asm-mips/io.h
+++ b/include/asm-mips/io.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_IO_H 12#ifndef _ASM_IO_H
13#define _ASM_IO_H 13#define _ASM_IO_H
14 14
15#include <linux/config.h>
16#include <linux/compiler.h> 15#include <linux/compiler.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/include/asm-mips/ip32/machine.h b/include/asm-mips/ip32/machine.h
index e440fdf4b232..1b631b8da6f8 100644
--- a/include/asm-mips/ip32/machine.h
+++ b/include/asm-mips/ip32/machine.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_IP32_MACHINE_H 10#ifndef _ASM_IP32_MACHINE_H
11#define _ASM_IP32_MACHINE_H 11#define _ASM_IP32_MACHINE_H
12 12
13#include <linux/config.h>
14 13
15#ifdef CONFIG_SGI_IP32 14#ifdef CONFIG_SGI_IP32
16 15
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index dde677f02bc0..d35c61776a02 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_IRQ_H 9#ifndef _ASM_IRQ_H
10#define _ASM_IRQ_H 10#define _ASM_IRQ_H
11 11
12#include <linux/config.h>
13#include <linux/linkage.h> 12#include <linux/linkage.h>
14 13
15#include <asm/mipsmtregs.h> 14#include <asm/mipsmtregs.h>
diff --git a/include/asm-mips/isadep.h b/include/asm-mips/isadep.h
index 7bb003511d9e..24c6cda79377 100644
--- a/include/asm-mips/isadep.h
+++ b/include/asm-mips/isadep.h
@@ -5,7 +5,6 @@
5 * 5 *
6 * Copyright (c) 1998 Harald Koerfgen 6 * Copyright (c) 1998 Harald Koerfgen
7 */ 7 */
8#include <linux/config.h>
9 8
10#ifndef __ASM_ISADEP_H 9#ifndef __ASM_ISADEP_H
11#define __ASM_ISADEP_H 10#define __ASM_ISADEP_H
diff --git a/include/asm-mips/jmr3927/irq.h b/include/asm-mips/jmr3927/irq.h
index b0c325a22343..fe551f33a74f 100644
--- a/include/asm-mips/jmr3927/irq.h
+++ b/include/asm-mips/jmr3927/irq.h
@@ -12,7 +12,6 @@
12 12
13#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
14 14
15#include <linux/config.h>
16#include <asm/irq.h> 15#include <asm/irq.h>
17 16
18struct tb_irq_space { 17struct tb_irq_space {
diff --git a/include/asm-mips/kmap_types.h b/include/asm-mips/kmap_types.h
index 6886a0c3fedf..806aae3c5338 100644
--- a/include/asm-mips/kmap_types.h
+++ b/include/asm-mips/kmap_types.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_KMAP_TYPES_H 1#ifndef _ASM_KMAP_TYPES_H
2#define _ASM_KMAP_TYPES_H 2#define _ASM_KMAP_TYPES_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_DEBUG_HIGHMEM 5#ifdef CONFIG_DEBUG_HIGHMEM
7# define D(n) __KM_FENCE_##n , 6# define D(n) __KM_FENCE_##n ,
diff --git a/include/asm-mips/local.h b/include/asm-mips/local.h
index c38844f615fc..9e2d43bae388 100644
--- a/include/asm-mips/local.h
+++ b/include/asm-mips/local.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_LOCAL_H 1#ifndef _ASM_LOCAL_H
2#define _ASM_LOCAL_H 2#define _ASM_LOCAL_H
3 3
4#include <linux/config.h>
5#include <linux/percpu.h> 4#include <linux/percpu.h>
6#include <asm/atomic.h> 5#include <asm/atomic.h>
7 6
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h
index 4686e17c206c..582acd8adb81 100644
--- a/include/asm-mips/mach-au1x00/au1000.h
+++ b/include/asm-mips/mach-au1x00/au1000.h
@@ -35,7 +35,6 @@
35#ifndef _AU1000_H_ 35#ifndef _AU1000_H_
36#define _AU1000_H_ 36#define _AU1000_H_
37 37
38#include <linux/config.h>
39 38
40#ifndef _LANGUAGE_ASSEMBLY 39#ifndef _LANGUAGE_ASSEMBLY
41 40
diff --git a/include/asm-mips/mach-au1x00/au1xxx.h b/include/asm-mips/mach-au1x00/au1xxx.h
index b7b46dd9b929..947135941033 100644
--- a/include/asm-mips/mach-au1x00/au1xxx.h
+++ b/include/asm-mips/mach-au1x00/au1xxx.h
@@ -23,7 +23,6 @@
23#ifndef _AU1XXX_H_ 23#ifndef _AU1XXX_H_
24#define _AU1XXX_H_ 24#define _AU1XXX_H_
25 25
26#include <linux/config.h>
27 26
28#include <asm/mach-au1x00/au1000.h> 27#include <asm/mach-au1x00/au1000.h>
29 28
diff --git a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h b/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
index b327bcd3fee1..d5b38a247e5a 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_dbdma.h
@@ -34,7 +34,6 @@
34#ifndef _AU1000_DBDMA_H_ 34#ifndef _AU1000_DBDMA_H_
35#define _AU1000_DBDMA_H_ 35#define _AU1000_DBDMA_H_
36 36
37#include <linux/config.h>
38 37
39#ifndef _LANGUAGE_ASSEMBLY 38#ifndef _LANGUAGE_ASSEMBLY
40 39
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h
index e867b4ef96d1..301e71300779 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_ide.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h
@@ -29,7 +29,6 @@
29 * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE 29 * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE
30 * Interface and Linux Device Driver" Application Note. 30 * Interface and Linux Device Driver" Application Note.
31 */ 31 */
32#include <linux/config.h>
33 32
34#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 33#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
35 #define DMA_WAIT_TIMEOUT 100 34 #define DMA_WAIT_TIMEOUT 100
diff --git a/include/asm-mips/mach-au1x00/au1xxx_psc.h b/include/asm-mips/mach-au1x00/au1xxx_psc.h
index 8e5fb3c7da4d..d7cbacdd21fe 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_psc.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_psc.h
@@ -33,14 +33,18 @@
33#ifndef _AU1000_PSC_H_ 33#ifndef _AU1000_PSC_H_
34#define _AU1000_PSC_H_ 34#define _AU1000_PSC_H_
35 35
36#include <linux/config.h>
37 36
38/* The PSC base addresses. */ 37/* The PSC base addresses. */
39#ifdef CONFIG_SOC_AU1550 38#ifdef CONFIG_SOC_AU1550
40#define PSC0_BASE_ADDR 0xb1a00000 39#define PSC0_BASE_ADDR 0xb1a00000
41#define PSC1_BASE_ADDR 0xb1b00000 40#define PSC1_BASE_ADDR 0xb1b00000
42#define PSC2_BASE_ADDR 0xb0a00000 41#define PSC2_BASE_ADDR 0xb0a00000
43#define PSC3_BASE_ADDR 0xb0d00000 42#define PSC3_BASE_ADDR 0xb0b00000
43#endif
44
45#ifdef CONFIG_SOC_AU1200
46#define PSC0_BASE_ADDR 0xb1a00000
47#define PSC1_BASE_ADDR 0xb1b00000
44#endif 48#endif
45 49
46/* The PSC select and control registers are common to 50/* The PSC select and control registers are common to
@@ -228,6 +232,8 @@ typedef struct psc_i2s {
228#define PSC_I2SCFG_DD_DISABLE (1 << 27) 232#define PSC_I2SCFG_DD_DISABLE (1 << 27)
229#define PSC_I2SCFG_DE_ENABLE (1 << 26) 233#define PSC_I2SCFG_DE_ENABLE (1 << 26)
230#define PSC_I2SCFG_SET_WS(x) (((((x) / 2) - 1) & 0x7f) << 16) 234#define PSC_I2SCFG_SET_WS(x) (((((x) / 2) - 1) & 0x7f) << 16)
235#define PSC_I2SCFG_WS(n) ((n & 0xFF) << 16)
236#define PSC_I2SCFG_WS_MASK (PSC_I2SCFG_WS(0x3F))
231#define PSC_I2SCFG_WI (1 << 15) 237#define PSC_I2SCFG_WI (1 << 15)
232 238
233#define PSC_I2SCFG_DIV_MASK (3 << 13) 239#define PSC_I2SCFG_DIV_MASK (3 << 13)
diff --git a/include/asm-mips/mach-au1x00/ioremap.h b/include/asm-mips/mach-au1x00/ioremap.h
index d3ec6274575a..098fca4289bb 100644
--- a/include/asm-mips/mach-au1x00/ioremap.h
+++ b/include/asm-mips/mach-au1x00/ioremap.h
@@ -9,7 +9,6 @@
9#ifndef __ASM_MACH_AU1X00_IOREMAP_H 9#ifndef __ASM_MACH_AU1X00_IOREMAP_H
10#define __ASM_MACH_AU1X00_IOREMAP_H 10#define __ASM_MACH_AU1X00_IOREMAP_H
11 11
12#include <linux/config.h>
13#include <linux/types.h> 12#include <linux/types.h>
14 13
15#ifdef CONFIG_64BIT_PHYS_ADDR 14#ifdef CONFIG_64BIT_PHYS_ADDR
diff --git a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
index ace8c5ef9701..e0e08fc5d7f7 100644
--- a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
@@ -8,7 +8,6 @@
8#ifndef __ASM_COBALT_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_COBALT_CPU_FEATURE_OVERRIDES_H
9#define __ASM_COBALT_CPU_FEATURE_OVERRIDES_H 9#define __ASM_COBALT_CPU_FEATURE_OVERRIDES_H
10 10
11#include <linux/config.h>
12 11
13#define cpu_has_tlb 1 12#define cpu_has_tlb 1
14#define cpu_has_4kex 1 13#define cpu_has_4kex 1
diff --git a/include/asm-mips/mach-db1x00/db1x00.h b/include/asm-mips/mach-db1x00/db1x00.h
index 7b28b23f91ce..0f5f4c29f4e8 100644
--- a/include/asm-mips/mach-db1x00/db1x00.h
+++ b/include/asm-mips/mach-db1x00/db1x00.h
@@ -28,11 +28,22 @@
28#ifndef __ASM_DB1X00_H 28#ifndef __ASM_DB1X00_H
29#define __ASM_DB1X00_H 29#define __ASM_DB1X00_H
30 30
31#include <linux/config.h>
32 31
33#ifdef CONFIG_MIPS_DB1550 32#ifdef CONFIG_MIPS_DB1550
33
34#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
35#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
36#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC3_TX
37#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC3_RX
38
39#define SPI_PSC_BASE PSC0_BASE_ADDR
40#define AC97_PSC_BASE PSC1_BASE_ADDR
41#define SMBUS_PSC_BASE PSC2_BASE_ADDR
42#define I2S_PSC_BASE PSC3_BASE_ADDR
43
34#define BCSR_KSEG1_ADDR 0xAF000000 44#define BCSR_KSEG1_ADDR 0xAF000000
35#define NAND_PHYS_ADDR 0x20000000 45#define NAND_PHYS_ADDR 0x20000000
46
36#else 47#else
37#define BCSR_KSEG1_ADDR 0xAE000000 48#define BCSR_KSEG1_ADDR 0xAE000000
38#endif 49#endif
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h
index e3315359500a..6eba2e576aaa 100644
--- a/include/asm-mips/mach-generic/ide.h
+++ b/include/asm-mips/mach-generic/ide.h
@@ -15,7 +15,6 @@
15 15
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17 17
18#include <linux/config.h>
19#include <linux/pci.h> 18#include <linux/pci.h>
20#include <linux/stddef.h> 19#include <linux/stddef.h>
21#include <asm/processor.h> 20#include <asm/processor.h>
diff --git a/include/asm-mips/mach-generic/kmalloc.h b/include/asm-mips/mach-generic/kmalloc.h
index 373d66dee9d7..410ab5f6c563 100644
--- a/include/asm-mips/mach-generic/kmalloc.h
+++ b/include/asm-mips/mach-generic/kmalloc.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_MACH_GENERIC_KMALLOC_H 1#ifndef __ASM_MACH_GENERIC_KMALLOC_H
2#define __ASM_MACH_GENERIC_KMALLOC_H 2#define __ASM_MACH_GENERIC_KMALLOC_H
3 3
4#include <linux/config.h>
5 4
6#ifndef CONFIG_DMA_COHERENT 5#ifndef CONFIG_DMA_COHERENT
7/* 6/*
diff --git a/include/asm-mips/mach-generic/spaces.h b/include/asm-mips/mach-generic/spaces.h
index b849d8dd7e78..0ae9997bc9a8 100644
--- a/include/asm-mips/mach-generic/spaces.h
+++ b/include/asm-mips/mach-generic/spaces.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_MACH_GENERIC_SPACES_H 10#ifndef _ASM_MACH_GENERIC_SPACES_H
11#define _ASM_MACH_GENERIC_SPACES_H 11#define _ASM_MACH_GENERIC_SPACES_H
12 12
13#include <linux/config.h>
14 13
15#ifdef CONFIG_32BIT 14#ifdef CONFIG_32BIT
16 15
diff --git a/include/asm-mips/mach-ip22/spaces.h b/include/asm-mips/mach-ip22/spaces.h
index 8385f716798d..ab20c026fd19 100644
--- a/include/asm-mips/mach-ip22/spaces.h
+++ b/include/asm-mips/mach-ip22/spaces.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_MACH_IP22_SPACES_H 10#ifndef _ASM_MACH_IP22_SPACES_H
11#define _ASM_MACH_IP22_SPACES_H 11#define _ASM_MACH_IP22_SPACES_H
12 12
13#include <linux/config.h>
14 13
15#ifdef CONFIG_32BIT 14#ifdef CONFIG_32BIT
16 15
diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
index f0ef1ac9ecd7..2a3de092bf13 100644
--- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
@@ -9,7 +9,6 @@
9#ifndef __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H 9#ifndef __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H
10#define __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H 10#define __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H
11 11
12#include <linux/config.h>
13 12
14/* 13/*
15 * R5000 has an interesting "restriction": ll(d)/sc(d) 14 * R5000 has an interesting "restriction": ll(d)/sc(d)
diff --git a/include/asm-mips/mach-ip32/kmalloc.h b/include/asm-mips/mach-ip32/kmalloc.h
index 9d2d4d9ac036..f6198a21fba1 100644
--- a/include/asm-mips/mach-ip32/kmalloc.h
+++ b/include/asm-mips/mach-ip32/kmalloc.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_MACH_IP32_KMALLOC_H 1#ifndef __ASM_MACH_IP32_KMALLOC_H
2#define __ASM_MACH_IP32_KMALLOC_H 2#define __ASM_MACH_IP32_KMALLOC_H
3 3
4#include <linux/config.h>
5 4
6#if defined(CONFIG_CPU_R5000) || defined (CONFIG_CPU_RM7000) 5#if defined(CONFIG_CPU_R5000) || defined (CONFIG_CPU_RM7000)
7#define ARCH_KMALLOC_MINALIGN 32 6#define ARCH_KMALLOC_MINALIGN 32
diff --git a/include/asm-mips/mach-mips/cpu-feature-overrides.h b/include/asm-mips/mach-mips/cpu-feature-overrides.h
index 12c937283bb4..e960679f54ba 100644
--- a/include/asm-mips/mach-mips/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-mips/cpu-feature-overrides.h
@@ -9,7 +9,6 @@
9#ifndef __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H 9#ifndef __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H
10#define __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H 10#define __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H
11 11
12#include <linux/config.h>
13 12
14/* 13/*
15 * CPU feature overrides for MIPS boards 14 * CPU feature overrides for MIPS boards
diff --git a/include/asm-mips/mach-mips/irq.h b/include/asm-mips/mach-mips/irq.h
index f8579696ca54..083d9c512a04 100644
--- a/include/asm-mips/mach-mips/irq.h
+++ b/include/asm-mips/mach-mips/irq.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_MACH_MIPS_IRQ_H 1#ifndef __ASM_MACH_MIPS_IRQ_H
2#define __ASM_MACH_MIPS_IRQ_H 2#define __ASM_MACH_MIPS_IRQ_H
3 3
4#include <linux/config.h>
5 4
6#define NR_IRQS 256 5#define NR_IRQS 256
7 6
diff --git a/include/asm-mips/mach-pb1x00/pb1550.h b/include/asm-mips/mach-pb1x00/pb1550.h
index 9578ead11e8a..9a4955ce3b4a 100644
--- a/include/asm-mips/mach-pb1x00/pb1550.h
+++ b/include/asm-mips/mach-pb1x00/pb1550.h
@@ -27,7 +27,6 @@
27#ifndef __ASM_PB1550_H 27#ifndef __ASM_PB1550_H
28#define __ASM_PB1550_H 28#define __ASM_PB1550_H
29 29
30#include <linux/config.h>
31#include <linux/types.h> 30#include <linux/types.h>
32 31
33#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX 32#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
diff --git a/include/asm-mips/mach-sim/cpu-feature-overrides.h b/include/asm-mips/mach-sim/cpu-feature-overrides.h
index d9653e47d5fc..d736bdadb6df 100644
--- a/include/asm-mips/mach-sim/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-sim/cpu-feature-overrides.h
@@ -8,7 +8,6 @@
8#ifndef __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H
10 10
11#include <linux/config.h>
12 11
13/* 12/*
14 * CPU feature overrides for MIPS boards 13 * CPU feature overrides for MIPS boards
diff --git a/include/asm-mips/mips-boards/generic.h b/include/asm-mips/mips-boards/generic.h
index fa8b913cc3e0..b98f1658cfd0 100644
--- a/include/asm-mips/mips-boards/generic.h
+++ b/include/asm-mips/mips-boards/generic.h
@@ -20,7 +20,6 @@
20#ifndef __ASM_MIPS_BOARDS_GENERIC_H 20#ifndef __ASM_MIPS_BOARDS_GENERIC_H
21#define __ASM_MIPS_BOARDS_GENERIC_H 21#define __ASM_MIPS_BOARDS_GENERIC_H
22 22
23#include <linux/config.h>
24#include <asm/addrspace.h> 23#include <asm/addrspace.h>
25#include <asm/byteorder.h> 24#include <asm/byteorder.h>
26#include <asm/mips-boards/bonito64.h> 25#include <asm/mips-boards/bonito64.h>
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h
index 98b68089aa53..673977901ed3 100644
--- a/include/asm-mips/mipsregs.h
+++ b/include/asm-mips/mipsregs.h
@@ -13,7 +13,6 @@
13#ifndef _ASM_MIPSREGS_H 13#ifndef _ASM_MIPSREGS_H
14#define _ASM_MIPSREGS_H 14#define _ASM_MIPSREGS_H
15 15
16#include <linux/config.h>
17#include <linux/linkage.h> 16#include <linux/linkage.h>
18#include <asm/hazards.h> 17#include <asm/hazards.h>
19 18
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h
index 6e09f4c87211..18b69de87daa 100644
--- a/include/asm-mips/mmu_context.h
+++ b/include/asm-mips/mmu_context.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_MMU_CONTEXT_H 11#ifndef _ASM_MMU_CONTEXT_H
12#define _ASM_MMU_CONTEXT_H 12#define _ASM_MMU_CONTEXT_H
13 13
14#include <linux/config.h>
15#include <linux/errno.h> 14#include <linux/errno.h>
16#include <linux/sched.h> 15#include <linux/sched.h>
17#include <linux/slab.h> 16#include <linux/slab.h>
diff --git a/include/asm-mips/mmzone.h b/include/asm-mips/mmzone.h
index f6bd2e0c45a1..f53ec54c92ff 100644
--- a/include/asm-mips/mmzone.h
+++ b/include/asm-mips/mmzone.h
@@ -5,13 +5,11 @@
5#ifndef _ASM_MMZONE_H_ 5#ifndef _ASM_MMZONE_H_
6#define _ASM_MMZONE_H_ 6#define _ASM_MMZONE_H_
7 7
8#include <linux/config.h>
9#include <asm/page.h> 8#include <asm/page.h>
10#include <mmzone.h> 9#include <mmzone.h>
11 10
12#ifdef CONFIG_DISCONTIGMEM 11#ifdef CONFIG_DISCONTIGMEM
13 12
14#define kvaddr_to_nid(kvaddr) pa_to_nid(__pa(kvaddr))
15#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT) 13#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT)
16 14
17#endif /* CONFIG_DISCONTIGMEM */ 15#endif /* CONFIG_DISCONTIGMEM */
diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h
index 2af496c78c12..399d03f1c4fc 100644
--- a/include/asm-mips/module.h
+++ b/include/asm-mips/module.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_MODULE_H 1#ifndef _ASM_MODULE_H
2#define _ASM_MODULE_H 2#define _ASM_MODULE_H
3 3
4#include <linux/config.h>
5#include <linux/list.h> 4#include <linux/list.h>
6#include <asm/uaccess.h> 5#include <asm/uaccess.h>
7 6
diff --git a/include/asm-mips/msgbuf.h b/include/asm-mips/msgbuf.h
index a1533959742e..0d6c7f14de31 100644
--- a/include/asm-mips/msgbuf.h
+++ b/include/asm-mips/msgbuf.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_MSGBUF_H 1#ifndef _ASM_MSGBUF_H
2#define _ASM_MSGBUF_H 2#define _ASM_MSGBUF_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * The msqid64_ds structure for the MIPS architecture. 6 * The msqid64_ds structure for the MIPS architecture.
diff --git a/include/asm-mips/paccess.h b/include/asm-mips/paccess.h
index 46f2d23d2697..147844ef103b 100644
--- a/include/asm-mips/paccess.h
+++ b/include/asm-mips/paccess.h
@@ -13,7 +13,6 @@
13#ifndef _ASM_PACCESS_H 13#ifndef _ASM_PACCESS_H
14#define _ASM_PACCESS_H 14#define _ASM_PACCESS_H
15 15
16#include <linux/config.h>
17#include <linux/errno.h> 16#include <linux/errno.h>
18 17
19#ifdef CONFIG_32BIT 18#ifdef CONFIG_32BIT
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 3d262c01521c..6b97744f00cd 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_PAGE_H 9#ifndef _ASM_PAGE_H
10#define _ASM_PAGE_H 10#define _ASM_PAGE_H
11 11
12#include <linux/config.h>
13 12
14#ifdef __KERNEL__ 13#ifdef __KERNEL__
15 14
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index 6c9ad8171a77..c4d68bebdca6 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -6,7 +6,6 @@
6#ifndef _ASM_PCI_H 6#ifndef _ASM_PCI_H
7#define _ASM_PCI_H 7#define _ASM_PCI_H
8 8
9#include <linux/config.h>
10#include <linux/mm.h> 9#include <linux/mm.h>
11 10
12#ifdef __KERNEL__ 11#ifdef __KERNEL__
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h
index fe1df572318b..582c1fe6cc4a 100644
--- a/include/asm-mips/pgalloc.h
+++ b/include/asm-mips/pgalloc.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_PGALLOC_H 9#ifndef _ASM_PGALLOC_H
10#define _ASM_PGALLOC_H 10#define _ASM_PGALLOC_H
11 11
12#include <linux/config.h>
13#include <linux/highmem.h> 12#include <linux/highmem.h>
14#include <linux/mm.h> 13#include <linux/mm.h>
15 14
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
index 087c20769256..4b26d8528133 100644
--- a/include/asm-mips/pgtable-32.h
+++ b/include/asm-mips/pgtable-32.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_PGTABLE_32_H 9#ifndef _ASM_PGTABLE_32_H
10#define _ASM_PGTABLE_32_H 10#define _ASM_PGTABLE_32_H
11 11
12#include <linux/config.h>
13#include <asm/addrspace.h> 12#include <asm/addrspace.h>
14#include <asm/page.h> 13#include <asm/page.h>
15 14
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h
index 2faf5c9ff127..e3db93212eab 100644
--- a/include/asm-mips/pgtable-64.h
+++ b/include/asm-mips/pgtable-64.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_PGTABLE_64_H 9#ifndef _ASM_PGTABLE_64_H
10#define _ASM_PGTABLE_64_H 10#define _ASM_PGTABLE_64_H
11 11
12#include <linux/config.h>
13#include <linux/linkage.h> 12#include <linux/linkage.h>
14 13
15#include <asm/addrspace.h> 14#include <asm/addrspace.h>
diff --git a/include/asm-mips/pgtable-bits.h b/include/asm-mips/pgtable-bits.h
index 01e76e932e3f..7494ba91112a 100644
--- a/include/asm-mips/pgtable-bits.h
+++ b/include/asm-mips/pgtable-bits.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_PGTABLE_BITS_H 10#ifndef _ASM_PGTABLE_BITS_H
11#define _ASM_PGTABLE_BITS_H 11#define _ASM_PGTABLE_BITS_H
12 12
13#include <linux/config.h>
14 13
15/* 14/*
16 * Note that we shift the lower 32bits of each EntryLo[01] entry 15 * Note that we shift the lower 32bits of each EntryLo[01] entry
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index be75cca20e8d..a36ca1be17f2 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_PGTABLE_H 8#ifndef _ASM_PGTABLE_H
9#define _ASM_PGTABLE_H 9#define _ASM_PGTABLE_H
10 10
11#include <linux/config.h>
12#ifdef CONFIG_32BIT 11#ifdef CONFIG_32BIT
13#include <asm/pgtable-32.h> 12#include <asm/pgtable-32.h>
14#endif 13#endif
diff --git a/include/asm-mips/prefetch.h b/include/asm-mips/prefetch.h
index 71293ec1657c..17850834ccb0 100644
--- a/include/asm-mips/prefetch.h
+++ b/include/asm-mips/prefetch.h
@@ -8,7 +8,6 @@
8#ifndef __ASM_PREFETCH_H 8#ifndef __ASM_PREFETCH_H
9#define __ASM_PREFETCH_H 9#define __ASM_PREFETCH_H
10 10
11#include <linux/config.h>
12 11
13/* 12/*
14 * R5000 and RM5200 implements pref and prefx instructions but they're nops, so 13 * R5000 and RM5200 implements pref and prefx instructions but they're nops, so
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index 83936469fe87..5f80ba71ab92 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_PROCESSOR_H 11#ifndef _ASM_PROCESSOR_H
12#define _ASM_PROCESSOR_H 12#define _ASM_PROCESSOR_H
13 13
14#include <linux/config.h>
15#include <linux/cpumask.h> 14#include <linux/cpumask.h>
16#include <linux/threads.h> 15#include <linux/threads.h>
17 16
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index fa9d8713c12a..4113316ee0da 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_PTRACE_H 9#ifndef _ASM_PTRACE_H
10#define _ASM_PTRACE_H 10#define _ASM_PTRACE_H
11 11
12#include <linux/config.h>
13 12
14#include <asm/isadep.h> 13#include <asm/isadep.h>
15 14
diff --git a/include/asm-mips/reg.h b/include/asm-mips/reg.h
index 6173004cc88e..634b55d7e7f6 100644
--- a/include/asm-mips/reg.h
+++ b/include/asm-mips/reg.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_MIPS_REG_H 12#ifndef __ASM_MIPS_REG_H
13#define __ASM_MIPS_REG_H 13#define __ASM_MIPS_REG_H
14 14
15#include <linux/config.h>
16 15
17#if defined(CONFIG_32BIT) || defined(WANT_COMPAT_REG_H) 16#if defined(CONFIG_32BIT) || defined(WANT_COMPAT_REG_H)
18 17
diff --git a/include/asm-mips/resource.h b/include/asm-mips/resource.h
index 1fba00c22077..87cb3085269c 100644
--- a/include/asm-mips/resource.h
+++ b/include/asm-mips/resource.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_RESOURCE_H 9#ifndef _ASM_RESOURCE_H
10#define _ASM_RESOURCE_H 10#define _ASM_RESOURCE_H
11 11
12#include <linux/config.h>
13 12
14/* 13/*
15 * These five resource limit IDs have a MIPS/Linux-specific ordering, 14 * These five resource limit IDs have a MIPS/Linux-specific ordering,
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
index 7196ceb0e948..584bd9c0ab2e 100644
--- a/include/asm-mips/serial.h
+++ b/include/asm-mips/serial.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SERIAL_H 9#ifndef _ASM_SERIAL_H
10#define _ASM_SERIAL_H 10#define _ASM_SERIAL_H
11 11
12#include <linux/config.h>
13 12
14/* 13/*
15 * This assumes you have a 1.8432 MHz clock for your UART. 14 * This assumes you have a 1.8432 MHz clock for your UART.
diff --git a/include/asm-mips/sgiarcs.h b/include/asm-mips/sgiarcs.h
index 722b77a8c5e5..ddb859d05257 100644
--- a/include/asm-mips/sgiarcs.h
+++ b/include/asm-mips/sgiarcs.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_SGIARCS_H 12#ifndef _ASM_SGIARCS_H
13#define _ASM_SGIARCS_H 13#define _ASM_SGIARCS_H
14 14
15#include <linux/config.h>
16#include <asm/types.h> 15#include <asm/types.h>
17#include <asm/arc/types.h> 16#include <asm/arc/types.h>
18 17
diff --git a/include/asm-mips/sibyte/board.h b/include/asm-mips/sibyte/board.h
index 900edcbeec37..3dfe29ed42a8 100644
--- a/include/asm-mips/sibyte/board.h
+++ b/include/asm-mips/sibyte/board.h
@@ -19,7 +19,6 @@
19#ifndef _SIBYTE_BOARD_H 19#ifndef _SIBYTE_BOARD_H
20#define _SIBYTE_BOARD_H 20#define _SIBYTE_BOARD_H
21 21
22#include <linux/config.h>
23 22
24#if defined(CONFIG_SIBYTE_SWARM) || defined(CONFIG_SIBYTE_PTSWARM) || \ 23#if defined(CONFIG_SIBYTE_SWARM) || defined(CONFIG_SIBYTE_PTSWARM) || \
25 defined(CONFIG_SIBYTE_CRHONE) || defined(CONFIG_SIBYTE_CRHINE) || \ 24 defined(CONFIG_SIBYTE_CRHONE) || defined(CONFIG_SIBYTE_CRHINE) || \
diff --git a/include/asm-mips/sibyte/carmel.h b/include/asm-mips/sibyte/carmel.h
index b5e7dae19f0f..57c53e62a37a 100644
--- a/include/asm-mips/sibyte/carmel.h
+++ b/include/asm-mips/sibyte/carmel.h
@@ -18,7 +18,6 @@
18#ifndef __ASM_SIBYTE_CARMEL_H 18#ifndef __ASM_SIBYTE_CARMEL_H
19#define __ASM_SIBYTE_CARMEL_H 19#define __ASM_SIBYTE_CARMEL_H
20 20
21#include <linux/config.h>
22 21
23#include <asm/sibyte/sb1250.h> 22#include <asm/sibyte/sb1250.h>
24#include <asm/sibyte/sb1250_int.h> 23#include <asm/sibyte/sb1250_int.h>
diff --git a/include/asm-mips/sibyte/sentosa.h b/include/asm-mips/sibyte/sentosa.h
index 824605847af4..64c47874f32d 100644
--- a/include/asm-mips/sibyte/sentosa.h
+++ b/include/asm-mips/sibyte/sentosa.h
@@ -18,7 +18,6 @@
18#ifndef __ASM_SIBYTE_SENTOSA_H 18#ifndef __ASM_SIBYTE_SENTOSA_H
19#define __ASM_SIBYTE_SENTOSA_H 19#define __ASM_SIBYTE_SENTOSA_H
20 20
21#include <linux/config.h>
22#include <asm/sibyte/sb1250.h> 21#include <asm/sibyte/sb1250.h>
23#include <asm/sibyte/sb1250_int.h> 22#include <asm/sibyte/sb1250_int.h>
24 23
diff --git a/include/asm-mips/sibyte/swarm.h b/include/asm-mips/sibyte/swarm.h
index 06e1d528e03a..86db37e5ad85 100644
--- a/include/asm-mips/sibyte/swarm.h
+++ b/include/asm-mips/sibyte/swarm.h
@@ -18,7 +18,6 @@
18#ifndef __ASM_SIBYTE_SWARM_H 18#ifndef __ASM_SIBYTE_SWARM_H
19#define __ASM_SIBYTE_SWARM_H 19#define __ASM_SIBYTE_SWARM_H
20 20
21#include <linux/config.h>
22#include <asm/sibyte/sb1250.h> 21#include <asm/sibyte/sb1250.h>
23#include <asm/sibyte/sb1250_int.h> 22#include <asm/sibyte/sb1250_int.h>
24 23
diff --git a/include/asm-mips/siginfo.h b/include/asm-mips/siginfo.h
index 2ba313d94a78..2e32949bd674 100644
--- a/include/asm-mips/siginfo.h
+++ b/include/asm-mips/siginfo.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SIGINFO_H 9#ifndef _ASM_SIGINFO_H
10#define _ASM_SIGINFO_H 10#define _ASM_SIGINFO_H
11 11
12#include <linux/config.h>
13 12
14#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int)) 13#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
15#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */ 14#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h
index d8349e4b55ee..a1f3a3fa9bd6 100644
--- a/include/asm-mips/signal.h
+++ b/include/asm-mips/signal.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SIGNAL_H 9#ifndef _ASM_SIGNAL_H
10#define _ASM_SIGNAL_H 10#define _ASM_SIGNAL_H
11 11
12#include <linux/config.h>
13#include <linux/types.h> 12#include <linux/types.h>
14 13
15#define _NSIG 128 14#define _NSIG 128
diff --git a/include/asm-mips/sim.h b/include/asm-mips/sim.h
index 9c2af1b00e19..67c4fe52bb42 100644
--- a/include/asm-mips/sim.h
+++ b/include/asm-mips/sim.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SIM_H 9#ifndef _ASM_SIM_H
10#define _ASM_SIM_H 10#define _ASM_SIM_H
11 11
12#include <linux/config.h>
13 12
14#include <asm/asm-offsets.h> 13#include <asm/asm-offsets.h>
15 14
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h
index e14e4b69de21..1608fd71d6f7 100644
--- a/include/asm-mips/smp.h
+++ b/include/asm-mips/smp.h
@@ -11,7 +11,6 @@
11#ifndef __ASM_SMP_H 11#ifndef __ASM_SMP_H
12#define __ASM_SMP_H 12#define __ASM_SMP_H
13 13
14#include <linux/config.h>
15 14
16#ifdef CONFIG_SMP 15#ifdef CONFIG_SMP
17 16
diff --git a/include/asm-mips/sn/addrs.h b/include/asm-mips/sn/addrs.h
index 6c8a5577ddf1..8fa0af6b68d2 100644
--- a/include/asm-mips/sn/addrs.h
+++ b/include/asm-mips/sn/addrs.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SN_ADDRS_H 9#ifndef _ASM_SN_ADDRS_H
10#define _ASM_SN_ADDRS_H 10#define _ASM_SN_ADDRS_H
11 11
12#include <linux/config.h>
13 12
14#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
15#include <linux/types.h> 14#include <linux/types.h>
diff --git a/include/asm-mips/sn/agent.h b/include/asm-mips/sn/agent.h
index d6df13aaed49..ac4ea85c3a5c 100644
--- a/include/asm-mips/sn/agent.h
+++ b/include/asm-mips/sn/agent.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_SGI_SN_AGENT_H 11#ifndef _ASM_SGI_SN_AGENT_H
12#define _ASM_SGI_SN_AGENT_H 12#define _ASM_SGI_SN_AGENT_H
13 13
14#include <linux/config.h>
15#include <linux/topology.h> 14#include <linux/topology.h>
16#include <asm/sn/addrs.h> 15#include <asm/sn/addrs.h>
17#include <asm/sn/arch.h> 16#include <asm/sn/arch.h>
diff --git a/include/asm-mips/sn/arch.h b/include/asm-mips/sn/arch.h
index d247a819de7f..51174af6ac52 100644
--- a/include/asm-mips/sn/arch.h
+++ b/include/asm-mips/sn/arch.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_SN_ARCH_H 11#ifndef _ASM_SN_ARCH_H
12#define _ASM_SN_ARCH_H 12#define _ASM_SN_ARCH_H
13 13
14#include <linux/config.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <asm/sn/types.h> 15#include <asm/sn/types.h>
17#ifdef CONFIG_SGI_IP27 16#ifdef CONFIG_SGI_IP27
diff --git a/include/asm-mips/sn/io.h b/include/asm-mips/sn/io.h
index 13326453efc9..ab2fa8cd2627 100644
--- a/include/asm-mips/sn/io.h
+++ b/include/asm-mips/sn/io.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SN_IO_H 9#ifndef _ASM_SN_IO_H
10#define _ASM_SN_IO_H 10#define _ASM_SN_IO_H
11 11
12#include <linux/config.h>
13#if defined (CONFIG_SGI_IP27) 12#if defined (CONFIG_SGI_IP27)
14#include <asm/sn/sn0/hubio.h> 13#include <asm/sn/sn0/hubio.h>
15#endif 14#endif
diff --git a/include/asm-mips/sn/klconfig.h b/include/asm-mips/sn/klconfig.h
index dc706268d2cf..52238e65af8e 100644
--- a/include/asm-mips/sn/klconfig.h
+++ b/include/asm-mips/sn/klconfig.h
@@ -27,7 +27,6 @@
27 * that offsets of existing fields do not change. 27 * that offsets of existing fields do not change.
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <asm/sn/types.h> 31#include <asm/sn/types.h>
33 32
diff --git a/include/asm-mips/sn/kldir.h b/include/asm-mips/sn/kldir.h
index 97ad52e3cbc7..0573cbffc104 100644
--- a/include/asm-mips/sn/kldir.h
+++ b/include/asm-mips/sn/kldir.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_SN_KLDIR_H 11#ifndef _ASM_SN_KLDIR_H
12#define _ASM_SN_KLDIR_H 12#define _ASM_SN_KLDIR_H
13 13
14#include <linux/config.h>
15 14
16/* 15/*
17 * The kldir memory area resides at a fixed place in each node's memory and 16 * The kldir memory area resides at a fixed place in each node's memory and
diff --git a/include/asm-mips/sn/launch.h b/include/asm-mips/sn/launch.h
index b67699c0c475..b7c2226312c6 100644
--- a/include/asm-mips/sn/launch.h
+++ b/include/asm-mips/sn/launch.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_SN_LAUNCH_H 9#ifndef _ASM_SN_LAUNCH_H
10#define _ASM_SN_LAUNCH_H 10#define _ASM_SN_LAUNCH_H
11 11
12#include <linux/config.h>
13#include <asm/sn/types.h> 12#include <asm/sn/types.h>
14#include <asm/sn/addrs.h> 13#include <asm/sn/addrs.h>
15 14
diff --git a/include/asm-mips/sn/mapped_kernel.h b/include/asm-mips/sn/mapped_kernel.h
index 59edb20f8ec5..c3dd5d0d525f 100644
--- a/include/asm-mips/sn/mapped_kernel.h
+++ b/include/asm-mips/sn/mapped_kernel.h
@@ -20,7 +20,6 @@
20 * code. So no jumps can be done before we have switched to using 20 * code. So no jumps can be done before we have switched to using
21 * cksseg addresses. 21 * cksseg addresses.
22 */ 22 */
23#include <linux/config.h>
24#include <asm/addrspace.h> 23#include <asm/addrspace.h>
25 24
26#define REP_BASE CAC_BASE 25#define REP_BASE CAC_BASE
diff --git a/include/asm-mips/sn/sn0/addrs.h b/include/asm-mips/sn/sn0/addrs.h
index 2c4b758f6736..9e8cc52910f6 100644
--- a/include/asm-mips/sn/sn0/addrs.h
+++ b/include/asm-mips/sn/sn0/addrs.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_SN_SN0_ADDRS_H 11#ifndef _ASM_SN_SN0_ADDRS_H
12#define _ASM_SN_SN0_ADDRS_H 12#define _ASM_SN_SN0_ADDRS_H
13 13
14#include <linux/config.h>
15 14
16/* 15/*
17 * SN0 (on a T5) Address map 16 * SN0 (on a T5) Address map
diff --git a/include/asm-mips/sn/sn0/arch.h b/include/asm-mips/sn/sn0/arch.h
index f7c43fa24aa8..f734f2007f24 100644
--- a/include/asm-mips/sn/sn0/arch.h
+++ b/include/asm-mips/sn/sn0/arch.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_SN_SN0_ARCH_H 11#ifndef _ASM_SN_SN0_ARCH_H
12#define _ASM_SN_SN0_ARCH_H 12#define _ASM_SN_SN0_ARCH_H
13 13
14#include <linux/config.h>
15 14
16#ifndef SN0XXL /* 128 cpu SMP max */ 15#ifndef SN0XXL /* 128 cpu SMP max */
17/* 16/*
diff --git a/include/asm-mips/sn/sn0/hubmd.h b/include/asm-mips/sn/sn0/hubmd.h
index 1006aa26d771..14c225d80664 100644
--- a/include/asm-mips/sn/sn0/hubmd.h
+++ b/include/asm-mips/sn/sn0/hubmd.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_SN_SN0_HUBMD_H 11#ifndef _ASM_SN_SN0_HUBMD_H
12#define _ASM_SN_SN0_HUBMD_H 12#define _ASM_SN_SN0_HUBMD_H
13 13
14#include <linux/config.h>
15 14
16/* 15/*
17 * Hub Memory/Directory interface registers 16 * Hub Memory/Directory interface registers
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index c4856a874965..513aa5133830 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_STACKFRAME_H 10#ifndef _ASM_STACKFRAME_H
11#define _ASM_STACKFRAME_H 11#define _ASM_STACKFRAME_H
12 12
13#include <linux/config.h>
14#include <linux/threads.h> 13#include <linux/threads.h>
15 14
16#include <asm/asm.h> 15#include <asm/asm.h>
diff --git a/include/asm-mips/string.h b/include/asm-mips/string.h
index 907da600fddd..436e3ad352d9 100644
--- a/include/asm-mips/string.h
+++ b/include/asm-mips/string.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_STRING_H 10#ifndef _ASM_STRING_H
11#define _ASM_STRING_H 11#define _ASM_STRING_H
12 12
13#include <linux/config.h>
14 13
15/* 14/*
16 * Most of the inline functions are rather naive implementations so I just 15 * Most of the inline functions are rather naive implementations so I just
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 261f71d16a07..130333d7c4ee 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -12,7 +12,6 @@
12#ifndef _ASM_SYSTEM_H 12#ifndef _ASM_SYSTEM_H
13#define _ASM_SYSTEM_H 13#define _ASM_SYSTEM_H
14 14
15#include <linux/config.h>
16#include <linux/types.h> 15#include <linux/types.h>
17 16
18#include <asm/addrspace.h> 17#include <asm/addrspace.h>
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h
index f8d97dafd2f4..ae8ada5b42a9 100644
--- a/include/asm-mips/thread_info.h
+++ b/include/asm-mips/thread_info.h
@@ -9,7 +9,6 @@
9 9
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11 11
12#include <linux/config.h>
13 12
14#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
15 14
diff --git a/include/asm-mips/tlbflush.h b/include/asm-mips/tlbflush.h
index bb4ae3cdcbf1..276be77c3e85 100644
--- a/include/asm-mips/tlbflush.h
+++ b/include/asm-mips/tlbflush.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_TLBFLUSH_H 1#ifndef __ASM_TLBFLUSH_H
2#define __ASM_TLBFLUSH_H 2#define __ASM_TLBFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6 5
7/* 6/*
diff --git a/include/asm-mips/tx4927/toshiba_rbtx4927.h b/include/asm-mips/tx4927/toshiba_rbtx4927.h
index 6ce1e9475f99..94bef03d9635 100644
--- a/include/asm-mips/tx4927/toshiba_rbtx4927.h
+++ b/include/asm-mips/tx4927/toshiba_rbtx4927.h
@@ -27,7 +27,6 @@
27#ifndef __ASM_TX4927_TOSHIBA_RBTX4927_H 27#ifndef __ASM_TX4927_TOSHIBA_RBTX4927_H
28#define __ASM_TX4927_TOSHIBA_RBTX4927_H 28#define __ASM_TX4927_TOSHIBA_RBTX4927_H
29 29
30#include <linux/config.h>
31#include <asm/tx4927/tx4927.h> 30#include <asm/tx4927/tx4927.h>
32#include <asm/tx4927/tx4927_mips.h> 31#include <asm/tx4927/tx4927_mips.h>
33#ifdef CONFIG_PCI 32#ifdef CONFIG_PCI
diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h
index cd2813d8e136..2b52e180c6f2 100644
--- a/include/asm-mips/types.h
+++ b/include/asm-mips/types.h
@@ -52,7 +52,6 @@ typedef unsigned long long __u64;
52 52
53#ifndef __ASSEMBLY__ 53#ifndef __ASSEMBLY__
54 54
55#include <linux/config.h>
56 55
57typedef __signed char s8; 56typedef __signed char s8;
58typedef unsigned char u8; 57typedef unsigned char u8;
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h
index b96f3e0f3933..1cdd4eeb2f73 100644
--- a/include/asm-mips/uaccess.h
+++ b/include/asm-mips/uaccess.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_UACCESS_H 9#ifndef _ASM_UACCESS_H
10#define _ASM_UACCESS_H 10#define _ASM_UACCESS_H
11 11
12#include <linux/config.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
15#include <linux/thread_info.h> 14#include <linux/thread_info.h>
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 1068fe9a0a58..8bb0bb9b2e68 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -905,6 +905,8 @@
905#define __NR_N32_Linux 6000 905#define __NR_N32_Linux 6000
906#define __NR_N32_Linux_syscalls 268 906#define __NR_N32_Linux_syscalls 268
907 907
908#ifdef __KERNEL__
909
908#ifndef __ASSEMBLY__ 910#ifndef __ASSEMBLY__
909 911
910/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */ 912/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
@@ -1168,9 +1170,6 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \
1168 1170
1169#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */ 1171#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
1170 1172
1171#ifdef __KERNEL__
1172
1173#include <linux/config.h>
1174 1173
1175#define __ARCH_WANT_IPC_PARSE_VERSION 1174#define __ARCH_WANT_IPC_PARSE_VERSION
1176#define __ARCH_WANT_OLD_READDIR 1175#define __ARCH_WANT_OLD_READDIR
@@ -1197,7 +1196,6 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \
1197# ifdef CONFIG_MIPS32_O32 1196# ifdef CONFIG_MIPS32_O32
1198# define __ARCH_WANT_COMPAT_SYS_TIME 1197# define __ARCH_WANT_COMPAT_SYS_TIME
1199# endif 1198# endif
1200#endif
1201 1199
1202#ifdef __KERNEL_SYSCALLS__ 1200#ifdef __KERNEL_SYSCALLS__
1203 1201
@@ -1248,4 +1246,5 @@ asmlinkage long sys_rt_sigaction(int sig,
1248 */ 1246 */
1249#define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall") 1247#define cond_syscall(x) asm(".weak\t" #x "\n" #x "\t=\tsys_ni_syscall")
1250 1248
1249#endif /* __KERNEL__ */
1251#endif /* _ASM_UNISTD_H */ 1250#endif /* _ASM_UNISTD_H */
diff --git a/include/asm-mips/vga.h b/include/asm-mips/vga.h
index 34755c0a6398..c1dd0b10bc27 100644
--- a/include/asm-mips/vga.h
+++ b/include/asm-mips/vga.h
@@ -13,7 +13,7 @@
13 * access the videoram directly without any black magic. 13 * access the videoram directly without any black magic.
14 */ 14 */
15 15
16#define VGA_MAP_MEM(x) (0xb0000000L + (unsigned long)(x)) 16#define VGA_MAP_MEM(x,s) (0xb0000000L + (unsigned long)(x))
17 17
18#define vga_readb(x) (*(x)) 18#define vga_readb(x) (*(x))
19#define vga_writeb(x,y) (*(y) = (x)) 19#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/asm-mips/vr41xx/vrc4173.h b/include/asm-mips/vr41xx/vrc4173.h
index 4d41a9c091d4..96fdcd54cec7 100644
--- a/include/asm-mips/vr41xx/vrc4173.h
+++ b/include/asm-mips/vr41xx/vrc4173.h
@@ -24,7 +24,6 @@
24#ifndef __NEC_VRC4173_H 24#ifndef __NEC_VRC4173_H
25#define __NEC_VRC4173_H 25#define __NEC_VRC4173_H
26 26
27#include <linux/config.h>
28#include <asm/io.h> 27#include <asm/io.h>
29 28
30/* 29/*
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h
index 70636b41832c..3ac146c019c9 100644
--- a/include/asm-mips/war.h
+++ b/include/asm-mips/war.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_WAR_H 8#ifndef _ASM_WAR_H
9#define _ASM_WAR_H 9#define _ASM_WAR_H
10 10
11#include <linux/config.h>
12 11
13/* 12/*
14 * Another R4600 erratum. Due to the lack of errata information the exact 13 * Another R4600 erratum. Due to the lack of errata information the exact
diff --git a/include/asm-mips/wbflush.h b/include/asm-mips/wbflush.h
index c3bef50f37a8..eadc0ac47e24 100644
--- a/include/asm-mips/wbflush.h
+++ b/include/asm-mips/wbflush.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_WBFLUSH_H 11#ifndef _ASM_WBFLUSH_H
12#define _ASM_WBFLUSH_H 12#define _ASM_WBFLUSH_H
13 13
14#include <linux/config.h>
15 14
16#ifdef CONFIG_CPU_HAS_WB 15#ifdef CONFIG_CPU_HAS_WB
17 16
diff --git a/include/asm-parisc/atomic.h b/include/asm-parisc/atomic.h
index 403ea97316cf..48bf9b8ab8ff 100644
--- a/include/asm-parisc/atomic.h
+++ b/include/asm-parisc/atomic.h
@@ -5,7 +5,6 @@
5#ifndef _ASM_PARISC_ATOMIC_H_ 5#ifndef _ASM_PARISC_ATOMIC_H_
6#define _ASM_PARISC_ATOMIC_H_ 6#define _ASM_PARISC_ATOMIC_H_
7 7
8#include <linux/config.h>
9#include <linux/types.h> 8#include <linux/types.h>
10#include <asm/system.h> 9#include <asm/system.h>
11 10
diff --git a/include/asm-parisc/cache.h b/include/asm-parisc/cache.h
index c831665473cb..7d22fa206fc4 100644
--- a/include/asm-parisc/cache.h
+++ b/include/asm-parisc/cache.h
@@ -5,7 +5,6 @@
5#ifndef __ARCH_PARISC_CACHE_H 5#ifndef __ARCH_PARISC_CACHE_H
6#define __ARCH_PARISC_CACHE_H 6#define __ARCH_PARISC_CACHE_H
7 7
8#include <linux/config.h>
9 8
10/* 9/*
11 * PA 2.0 processors have 64-byte cachelines; PA 1.1 processors have 10 * PA 2.0 processors have 64-byte cachelines; PA 1.1 processors have
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h
index 76b6b7d6046a..0b459cdfbd6f 100644
--- a/include/asm-parisc/cacheflush.h
+++ b/include/asm-parisc/cacheflush.h
@@ -1,7 +1,6 @@
1#ifndef _PARISC_CACHEFLUSH_H 1#ifndef _PARISC_CACHEFLUSH_H
2#define _PARISC_CACHEFLUSH_H 2#define _PARISC_CACHEFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6#include <asm/cache.h> /* for flush_user_dcache_range_asm() proto */ 5#include <asm/cache.h> /* for flush_user_dcache_range_asm() proto */
7 6
diff --git a/include/asm-parisc/dma-mapping.h b/include/asm-parisc/dma-mapping.h
index 74d4ac6f2151..1e387e1dad30 100644
--- a/include/asm-parisc/dma-mapping.h
+++ b/include/asm-parisc/dma-mapping.h
@@ -1,7 +1,6 @@
1#ifndef _PARISC_DMA_MAPPING_H 1#ifndef _PARISC_DMA_MAPPING_H
2#define _PARISC_DMA_MAPPING_H 2#define _PARISC_DMA_MAPPING_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6#include <asm/cacheflush.h> 5#include <asm/cacheflush.h>
7#include <asm/scatterlist.h> 6#include <asm/scatterlist.h>
diff --git a/include/asm-parisc/dma.h b/include/asm-parisc/dma.h
index 31fd10df43a7..9979c3cb3745 100644
--- a/include/asm-parisc/dma.h
+++ b/include/asm-parisc/dma.h
@@ -9,7 +9,6 @@
9#ifndef _ASM_DMA_H 9#ifndef _ASM_DMA_H
10#define _ASM_DMA_H 10#define _ASM_DMA_H
11 11
12#include <linux/config.h>
13#include <asm/io.h> /* need byte IO */ 12#include <asm/io.h> /* need byte IO */
14#include <asm/system.h> 13#include <asm/system.h>
15 14
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h
index 244f6b8883f4..b9eb245b8874 100644
--- a/include/asm-parisc/io.h
+++ b/include/asm-parisc/io.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_IO_H 1#ifndef _ASM_IO_H
2#define _ASM_IO_H 2#define _ASM_IO_H
3 3
4#include <linux/config.h>
5#include <linux/types.h> 4#include <linux/types.h>
6#include <asm/pgtable.h> 5#include <asm/pgtable.h>
7 6
diff --git a/include/asm-parisc/irq.h b/include/asm-parisc/irq.h
index b0a30e2c9813..377ba90c7d02 100644
--- a/include/asm-parisc/irq.h
+++ b/include/asm-parisc/irq.h
@@ -7,7 +7,6 @@
7#ifndef _ASM_PARISC_IRQ_H 7#ifndef _ASM_PARISC_IRQ_H
8#define _ASM_PARISC_IRQ_H 8#define _ASM_PARISC_IRQ_H
9 9
10#include <linux/config.h>
11#include <linux/cpumask.h> 10#include <linux/cpumask.h>
12#include <asm/types.h> 11#include <asm/types.h>
13 12
diff --git a/include/asm-parisc/kmap_types.h b/include/asm-parisc/kmap_types.h
index 6886a0c3fedf..806aae3c5338 100644
--- a/include/asm-parisc/kmap_types.h
+++ b/include/asm-parisc/kmap_types.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_KMAP_TYPES_H 1#ifndef _ASM_KMAP_TYPES_H
2#define _ASM_KMAP_TYPES_H 2#define _ASM_KMAP_TYPES_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_DEBUG_HIGHMEM 5#ifdef CONFIG_DEBUG_HIGHMEM
7# define D(n) __KM_FENCE_##n , 6# define D(n) __KM_FENCE_##n ,
diff --git a/include/asm-parisc/mmzone.h b/include/asm-parisc/mmzone.h
index ceb9b73199d1..c87813662d4d 100644
--- a/include/asm-parisc/mmzone.h
+++ b/include/asm-parisc/mmzone.h
@@ -14,11 +14,6 @@ extern struct node_map_data node_data[];
14 14
15#define NODE_DATA(nid) (&node_data[nid].pg_data) 15#define NODE_DATA(nid) (&node_data[nid].pg_data)
16 16
17/*
18 * Given a kernel address, find the home node of the underlying memory.
19 */
20#define kvaddr_to_nid(kaddr) pfn_to_nid(__pa(kaddr) >> PAGE_SHIFT)
21
22#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) 17#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
23#define node_end_pfn(nid) \ 18#define node_end_pfn(nid) \
24({ \ 19({ \
diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h
index c0dd461fb8f1..0695bc958d56 100644
--- a/include/asm-parisc/page.h
+++ b/include/asm-parisc/page.h
@@ -10,7 +10,6 @@
10 10
11 11
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13#include <linux/config.h>
14 13
15#if defined(CONFIG_PARISC_PAGE_SIZE_4KB) 14#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
16# define PAGE_SHIFT 12 /* 4k */ 15# define PAGE_SHIFT 12 /* 4k */
diff --git a/include/asm-parisc/param.h b/include/asm-parisc/param.h
index f4694d452dd6..07cb9b93cfe2 100644
--- a/include/asm-parisc/param.h
+++ b/include/asm-parisc/param.h
@@ -2,7 +2,6 @@
2#define _ASMPARISC_PARAM_H 2#define _ASMPARISC_PARAM_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5#include <linux/config.h>
6# ifdef CONFIG_PA20 5# ifdef CONFIG_PA20
7# define HZ 1000 /* Faster machines */ 6# define HZ 1000 /* Faster machines */
8# else 7# else
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h
index 77bbafb7f73e..8b631f47eb25 100644
--- a/include/asm-parisc/pci.h
+++ b/include/asm-parisc/pci.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_PARISC_PCI_H 1#ifndef __ASM_PARISC_PCI_H
2#define __ASM_PARISC_PCI_H 2#define __ASM_PARISC_PCI_H
3 3
4#include <linux/config.h>
5#include <asm/scatterlist.h> 4#include <asm/scatterlist.h>
6 5
7 6
diff --git a/include/asm-parisc/pdc.h b/include/asm-parisc/pdc.h
index 0a3face6c480..08364f957e7a 100644
--- a/include/asm-parisc/pdc.h
+++ b/include/asm-parisc/pdc.h
@@ -1,7 +1,6 @@
1#ifndef _PARISC_PDC_H 1#ifndef _PARISC_PDC_H
2#define _PARISC_PDC_H 2#define _PARISC_PDC_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * PDC return values ... 6 * PDC return values ...
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index aec089eb8b85..b6bcc672ba80 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -3,7 +3,6 @@
3 3
4#include <asm-generic/4level-fixup.h> 4#include <asm-generic/4level-fixup.h>
5 5
6#include <linux/config.h>
7#include <asm/fixmap.h> 6#include <asm/fixmap.h>
8 7
9#ifndef __ASSEMBLY__ 8#ifndef __ASSEMBLY__
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h
index 89f2f1c16c12..ca49dc91f4fc 100644
--- a/include/asm-parisc/processor.h
+++ b/include/asm-parisc/processor.h
@@ -9,7 +9,6 @@
9#define __ASM_PARISC_PROCESSOR_H 9#define __ASM_PARISC_PROCESSOR_H
10 10
11#ifndef __ASSEMBLY__ 11#ifndef __ASSEMBLY__
12#include <linux/config.h>
13#include <linux/threads.h> 12#include <linux/threads.h>
14#include <linux/spinlock_types.h> 13#include <linux/spinlock_types.h>
15 14
diff --git a/include/asm-parisc/psw.h b/include/asm-parisc/psw.h
index 4334d6ca2add..5a3e23c9ce63 100644
--- a/include/asm-parisc/psw.h
+++ b/include/asm-parisc/psw.h
@@ -1,6 +1,5 @@
1#ifndef _PARISC_PSW_H 1#ifndef _PARISC_PSW_H
2 2
3#include <linux/config.h>
4 3
5#define PSW_I 0x00000001 4#define PSW_I 0x00000001
6#define PSW_D 0x00000002 5#define PSW_D 0x00000002
diff --git a/include/asm-parisc/smp.h b/include/asm-parisc/smp.h
index dbdbd2e9fdf9..d4c0e26afcd1 100644
--- a/include/asm-parisc/smp.h
+++ b/include/asm-parisc/smp.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SMP_H 1#ifndef __ASM_SMP_H
2#define __ASM_SMP_H 2#define __ASM_SMP_H
3 3
4#include <linux/config.h>
5 4
6#if defined(CONFIG_SMP) 5#if defined(CONFIG_SMP)
7 6
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h
index a5a973c0c07f..863876134b2c 100644
--- a/include/asm-parisc/system.h
+++ b/include/asm-parisc/system.h
@@ -1,7 +1,6 @@
1#ifndef __PARISC_SYSTEM_H 1#ifndef __PARISC_SYSTEM_H
2#define __PARISC_SYSTEM_H 2#define __PARISC_SYSTEM_H
3 3
4#include <linux/config.h>
5#include <asm/psw.h> 4#include <asm/psw.h>
6 5
7/* The program status word as bitfields. */ 6/* The program status word as bitfields. */
diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h
index 825994a90e2d..f662e837dea1 100644
--- a/include/asm-parisc/tlbflush.h
+++ b/include/asm-parisc/tlbflush.h
@@ -3,7 +3,6 @@
3 3
4/* TLB flushing routines.... */ 4/* TLB flushing routines.... */
5 5
6#include <linux/config.h>
7#include <linux/mm.h> 6#include <linux/mm.h>
8#include <asm/mmu_context.h> 7#include <asm/mmu_context.h>
9 8
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index 0e1a30be2e30..12b867238a47 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -792,6 +792,7 @@
792#define HPUX_GATEWAY_ADDR 0xC0000004 792#define HPUX_GATEWAY_ADDR 0xC0000004
793#define LINUX_GATEWAY_ADDR 0x100 793#define LINUX_GATEWAY_ADDR 0x100
794 794
795#ifdef __KERNEL__
795#ifndef __ASSEMBLY__ 796#ifndef __ASSEMBLY__
796 797
797#define SYS_ify(syscall_name) __NR_##syscall_name 798#define SYS_ify(syscall_name) __NR_##syscall_name
@@ -934,7 +935,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
934 return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5); \ 935 return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5); \
935} 936}
936 937
937#ifdef __KERNEL__
938#define __ARCH_WANT_OLD_READDIR 938#define __ARCH_WANT_OLD_READDIR
939#define __ARCH_WANT_STAT64 939#define __ARCH_WANT_STAT64
940#define __ARCH_WANT_SYS_ALARM 940#define __ARCH_WANT_SYS_ALARM
@@ -956,7 +956,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
956#define __ARCH_WANT_SYS_SIGPENDING 956#define __ARCH_WANT_SYS_SIGPENDING
957#define __ARCH_WANT_SYS_SIGPROCMASK 957#define __ARCH_WANT_SYS_SIGPROCMASK
958#define __ARCH_WANT_SYS_RT_SIGACTION 958#define __ARCH_WANT_SYS_RT_SIGACTION
959#endif
960 959
961/* mmap & mmap2 take 6 arguments */ 960/* mmap & mmap2 take 6 arguments */
962#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \ 961#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
@@ -1056,4 +1055,5 @@ asmlinkage long sys_rt_sigaction(int sig,
1056 */ 1055 */
1057#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 1056#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
1058 1057
1058#endif /* __KERNEL__ */
1059#endif /* _ASM_PARISC_UNISTD_H_ */ 1059#endif /* _ASM_PARISC_UNISTD_H_ */
diff --git a/include/asm-powerpc/abs_addr.h b/include/asm-powerpc/abs_addr.h
index c5c3259e0f86..4aa220718b19 100644
--- a/include/asm-powerpc/abs_addr.h
+++ b/include/asm-powerpc/abs_addr.h
@@ -2,7 +2,6 @@
2#define _ASM_POWERPC_ABS_ADDR_H 2#define _ASM_POWERPC_ABS_ADDR_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/config.h>
6 5
7/* 6/*
8 * c 2001 PPC 64 Team, IBM Corp 7 * c 2001 PPC 64 Team, IBM Corp
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h
index d1c2a4405660..76e2f08c3c83 100644
--- a/include/asm-powerpc/bitops.h
+++ b/include/asm-powerpc/bitops.h
@@ -288,8 +288,8 @@ static __inline__ int test_le_bit(unsigned long nr,
288#define __test_and_clear_le_bit(nr, addr) \ 288#define __test_and_clear_le_bit(nr, addr) \
289 __test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr)) 289 __test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
290 290
291#define find_first_zero_le_bit(addr, size) find_next_zero_le_bit((addr), (size), 0) 291#define find_first_zero_le_bit(addr, size) generic_find_next_zero_le_bit((addr), (size), 0)
292unsigned long find_next_zero_le_bit(const unsigned long *addr, 292unsigned long generic_find_next_zero_le_bit(const unsigned long *addr,
293 unsigned long size, unsigned long offset); 293 unsigned long size, unsigned long offset);
294 294
295/* Bitmap functions for the ext2 filesystem */ 295/* Bitmap functions for the ext2 filesystem */
@@ -309,7 +309,7 @@ unsigned long find_next_zero_le_bit(const unsigned long *addr,
309#define ext2_find_first_zero_bit(addr, size) \ 309#define ext2_find_first_zero_bit(addr, size) \
310 find_first_zero_le_bit((unsigned long*)addr, size) 310 find_first_zero_le_bit((unsigned long*)addr, size)
311#define ext2_find_next_zero_bit(addr, size, off) \ 311#define ext2_find_next_zero_bit(addr, size, off) \
312 find_next_zero_le_bit((unsigned long*)addr, size, off) 312 generic_find_next_zero_le_bit((unsigned long*)addr, size, off)
313 313
314/* Bitmap functions for the minix filesystem. */ 314/* Bitmap functions for the minix filesystem. */
315 315
diff --git a/include/asm-powerpc/cache.h b/include/asm-powerpc/cache.h
index 6379c2df5c40..642be62cf393 100644
--- a/include/asm-powerpc/cache.h
+++ b/include/asm-powerpc/cache.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7 6
8/* bytes per L1 cache line */ 7/* bytes per L1 cache line */
9#if defined(CONFIG_8xx) || defined(CONFIG_403GCX) 8#if defined(CONFIG_8xx) || defined(CONFIG_403GCX)
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index f6265c2a0dd2..fab41c280aa1 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -24,6 +24,9 @@
24#define PPC_FEATURE_ICACHE_SNOOP 0x00002000 24#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
25#define PPC_FEATURE_ARCH_2_05 0x00001000 25#define PPC_FEATURE_ARCH_2_05 0x00001000
26 26
27#define PPC_FEATURE_TRUE_LE 0x00000002
28#define PPC_FEATURE_PPC_LE 0x00000001
29
27#ifdef __KERNEL__ 30#ifdef __KERNEL__
28#ifndef __ASSEMBLY__ 31#ifndef __ASSEMBLY__
29 32
@@ -69,6 +72,13 @@ struct cpu_spec {
69 /* Processor specific oprofile operations */ 72 /* Processor specific oprofile operations */
70 enum powerpc_oprofile_type oprofile_type; 73 enum powerpc_oprofile_type oprofile_type;
71 74
75 /* Bit locations inside the mmcra change */
76 unsigned long oprofile_mmcra_sihv;
77 unsigned long oprofile_mmcra_sipr;
78
79 /* Bits to clear during an oprofile exception */
80 unsigned long oprofile_mmcra_clear;
81
72 /* Name of processor class, for the ELF AT_PLATFORM entry */ 82 /* Name of processor class, for the ELF AT_PLATFORM entry */
73 char *platform; 83 char *platform;
74}; 84};
@@ -104,6 +114,8 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
104#define CPU_FTR_NO_BTIC ASM_CONST(0x0000000000040000) 114#define CPU_FTR_NO_BTIC ASM_CONST(0x0000000000040000)
105#define CPU_FTR_BIG_PHYS ASM_CONST(0x0000000000080000) 115#define CPU_FTR_BIG_PHYS ASM_CONST(0x0000000000080000)
106#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000) 116#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000)
117#define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000)
118#define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000)
107 119
108#ifdef __powerpc64__ 120#ifdef __powerpc64__
109/* Add the 64b processor unique features in the top half of the word */ 121/* Add the 64b processor unique features in the top half of the word */
@@ -117,7 +129,6 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
117#define CPU_FTR_SMT ASM_CONST(0x0000010000000000) 129#define CPU_FTR_SMT ASM_CONST(0x0000010000000000)
118#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) 130#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000)
119#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) 131#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000)
120#define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000)
121#define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0000100000000000) 132#define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0000100000000000)
122#define CPU_FTR_PAUSE_ZERO ASM_CONST(0x0000200000000000) 133#define CPU_FTR_PAUSE_ZERO ASM_CONST(0x0000200000000000)
123#define CPU_FTR_PURR ASM_CONST(0x0000400000000000) 134#define CPU_FTR_PURR ASM_CONST(0x0000400000000000)
@@ -134,7 +145,6 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
134#define CPU_FTR_SMT ASM_CONST(0x0) 145#define CPU_FTR_SMT ASM_CONST(0x0)
135#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0) 146#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0)
136#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0) 147#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0)
137#define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0)
138#define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0) 148#define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0)
139#define CPU_FTR_PURR ASM_CONST(0x0) 149#define CPU_FTR_PURR ASM_CONST(0x0)
140#endif 150#endif
@@ -192,92 +202,95 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
192#define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE) 202#define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE)
193#define CPU_FTRS_603 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 203#define CPU_FTRS_603 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
194 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ 204 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
195 CPU_FTR_MAYBE_CAN_NAP) 205 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
196#define CPU_FTRS_604 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 206#define CPU_FTRS_604 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
197 CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE) 207 CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE | \
208 CPU_FTR_PPC_LE)
198#define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 209#define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
199 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 210 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
200 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP) 211 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
201#define CPU_FTRS_740 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 212#define CPU_FTRS_740 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
202 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 213 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
203 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP) 214 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
215 CPU_FTR_PPC_LE)
204#define CPU_FTRS_750 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 216#define CPU_FTRS_750 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
205 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 217 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
206 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP) 218 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
219 CPU_FTR_PPC_LE)
207#define CPU_FTRS_750FX1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 220#define CPU_FTRS_750FX1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
208 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 221 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
209 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ 222 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
210 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM) 223 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM | CPU_FTR_PPC_LE)
211#define CPU_FTRS_750FX2 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 224#define CPU_FTRS_750FX2 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
212 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 225 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
213 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ 226 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
214 CPU_FTR_NO_DPM) 227 CPU_FTR_NO_DPM | CPU_FTR_PPC_LE)
215#define CPU_FTRS_750FX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 228#define CPU_FTRS_750FX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
216 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 229 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
217 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ 230 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
218 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS) 231 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE)
219#define CPU_FTRS_750GX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ 232#define CPU_FTRS_750GX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \
220 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | \ 233 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | \
221 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ 234 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
222 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS) 235 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE)
223#define CPU_FTRS_7400_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 236#define CPU_FTRS_7400_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
224 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 237 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
225 CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ 238 CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \
226 CPU_FTR_MAYBE_CAN_NAP) 239 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
227#define CPU_FTRS_7400 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 240#define CPU_FTRS_7400 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
228 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ 241 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
229 CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ 242 CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \
230 CPU_FTR_MAYBE_CAN_NAP) 243 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE)
231#define CPU_FTRS_7450_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 244#define CPU_FTRS_7450_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
232 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 245 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
233 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 246 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
234 CPU_FTR_NEED_COHERENT) 247 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
235#define CPU_FTRS_7450_21 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 248#define CPU_FTRS_7450_21 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
236 CPU_FTR_USE_TB | \ 249 CPU_FTR_USE_TB | \
237 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 250 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
238 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 251 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
239 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ 252 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
240 CPU_FTR_NEED_COHERENT) 253 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
241#define CPU_FTRS_7450_23 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 254#define CPU_FTRS_7450_23 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
242 CPU_FTR_USE_TB | \ 255 CPU_FTR_USE_TB | \
243 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 256 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
244 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 257 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
245 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT) 258 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
246#define CPU_FTRS_7455_1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 259#define CPU_FTRS_7455_1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
247 CPU_FTR_USE_TB | \ 260 CPU_FTR_USE_TB | \
248 CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \ 261 CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \
249 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | \ 262 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | \
250 CPU_FTR_NEED_COHERENT) 263 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
251#define CPU_FTRS_7455_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 264#define CPU_FTRS_7455_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
252 CPU_FTR_USE_TB | \ 265 CPU_FTR_USE_TB | \
253 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 266 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
254 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 267 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
255 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ 268 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
256 CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS) 269 CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE)
257#define CPU_FTRS_7455 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 270#define CPU_FTRS_7455 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
258 CPU_FTR_USE_TB | \ 271 CPU_FTR_USE_TB | \
259 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 272 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
260 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 273 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
261 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ 274 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
262 CPU_FTR_NEED_COHERENT) 275 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
263#define CPU_FTRS_7447_10 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 276#define CPU_FTRS_7447_10 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
264 CPU_FTR_USE_TB | \ 277 CPU_FTR_USE_TB | \
265 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 278 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
266 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 279 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
267 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ 280 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
268 CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC) 281 CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC | CPU_FTR_PPC_LE)
269#define CPU_FTRS_7447 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 282#define CPU_FTRS_7447 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
270 CPU_FTR_USE_TB | \ 283 CPU_FTR_USE_TB | \
271 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 284 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
272 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 285 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
273 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ 286 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
274 CPU_FTR_NEED_COHERENT) 287 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
275#define CPU_FTRS_7447A (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 288#define CPU_FTRS_7447A (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
276 CPU_FTR_USE_TB | \ 289 CPU_FTR_USE_TB | \
277 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ 290 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
278 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ 291 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
279 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ 292 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
280 CPU_FTR_NEED_COHERENT) 293 CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE)
281#define CPU_FTRS_82XX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 294#define CPU_FTRS_82XX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
282 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB) 295 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB)
283#define CPU_FTRS_G2_LE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ 296#define CPU_FTRS_G2_LE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \
@@ -287,13 +300,6 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
287 CPU_FTR_COMMON) 300 CPU_FTR_COMMON)
288#define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ 301#define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
289 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE) 302 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE)
290#define CPU_FTRS_POWER3_32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
291 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE)
292#define CPU_FTRS_POWER4_32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
293 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_NODSISRALIGN)
294#define CPU_FTRS_970_32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
295 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_ALTIVEC_COMP | \
296 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN)
297#define CPU_FTRS_8XX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB) 303#define CPU_FTRS_8XX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB)
298#define CPU_FTRS_40X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 304#define CPU_FTRS_40X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
299 CPU_FTR_NODSISRALIGN) 305 CPU_FTR_NODSISRALIGN)
@@ -307,7 +313,7 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
307#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) 313#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
308#ifdef __powerpc64__ 314#ifdef __powerpc64__
309#define CPU_FTRS_POWER3 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 315#define CPU_FTRS_POWER3 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
310 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR) 316 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_PPC_LE)
311#define CPU_FTRS_RS64 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 317#define CPU_FTRS_RS64 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
312 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \ 318 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \
313 CPU_FTR_MMCRA | CPU_FTR_CTRL) 319 CPU_FTR_MMCRA | CPU_FTR_CTRL)
@@ -320,12 +326,12 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
320 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ 326 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
321 CPU_FTR_MMCRA | CPU_FTR_SMT | \ 327 CPU_FTR_MMCRA | CPU_FTR_SMT | \
322 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 328 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
323 CPU_FTR_MMCRA_SIHV | CPU_FTR_PURR) 329 CPU_FTR_PURR)
324#define CPU_FTRS_POWER6 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 330#define CPU_FTRS_POWER6 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
325 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ 331 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
326 CPU_FTR_MMCRA | CPU_FTR_SMT | \ 332 CPU_FTR_MMCRA | CPU_FTR_SMT | \
327 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 333 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
328 CPU_FTR_PURR | CPU_FTR_CI_LARGE_PAGE) 334 CPU_FTR_PURR | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_REAL_LE)
329#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 335#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
330 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ 336 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
331 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ 337 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
@@ -354,12 +360,6 @@ enum {
354#else 360#else
355 CPU_FTRS_GENERIC_32 | 361 CPU_FTRS_GENERIC_32 |
356#endif 362#endif
357#ifdef CONFIG_PPC64BRIDGE
358 CPU_FTRS_POWER3_32 |
359#endif
360#ifdef CONFIG_POWER4
361 CPU_FTRS_POWER4_32 | CPU_FTRS_970_32 |
362#endif
363#ifdef CONFIG_8xx 363#ifdef CONFIG_8xx
364 CPU_FTRS_8XX | 364 CPU_FTRS_8XX |
365#endif 365#endif
@@ -399,12 +399,6 @@ enum {
399#else 399#else
400 CPU_FTRS_GENERIC_32 & 400 CPU_FTRS_GENERIC_32 &
401#endif 401#endif
402#ifdef CONFIG_PPC64BRIDGE
403 CPU_FTRS_POWER3_32 &
404#endif
405#ifdef CONFIG_POWER4
406 CPU_FTRS_POWER4_32 & CPU_FTRS_970_32 &
407#endif
408#ifdef CONFIG_8xx 402#ifdef CONFIG_8xx
409 CPU_FTRS_8XX & 403 CPU_FTRS_8XX &
410#endif 404#endif
diff --git a/include/asm-powerpc/delay.h b/include/asm-powerpc/delay.h
index 057a60955474..f9200a65c632 100644
--- a/include/asm-powerpc/delay.h
+++ b/include/asm-powerpc/delay.h
@@ -17,5 +17,18 @@
17extern void __delay(unsigned long loops); 17extern void __delay(unsigned long loops);
18extern void udelay(unsigned long usecs); 18extern void udelay(unsigned long usecs);
19 19
20/*
21 * On shared processor machines the generic implementation of mdelay can
22 * result in large errors. While each iteration of the loop inside mdelay
23 * is supposed to take 1ms, the hypervisor could sleep our partition for
24 * longer (eg 10ms). With the right timing these errors can add up.
25 *
26 * Since there is no 32bit overflow issue on 64bit kernels, just call
27 * udelay directly.
28 */
29#ifdef CONFIG_PPC64
30#define mdelay(n) udelay((n) * 1000)
31#endif
32
20#endif /* __KERNEL__ */ 33#endif /* __KERNEL__ */
21#endif /* _ASM_POWERPC_DELAY_H */ 34#endif /* _ASM_POWERPC_DELAY_H */
diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h
index 2ac63f569592..2ab9baf78bb4 100644
--- a/include/asm-powerpc/dma-mapping.h
+++ b/include/asm-powerpc/dma-mapping.h
@@ -8,7 +8,6 @@
8#define _ASM_DMA_MAPPING_H 8#define _ASM_DMA_MAPPING_H
9#ifdef __KERNEL__ 9#ifdef __KERNEL__
10 10
11#include <linux/config.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/cache.h> 12#include <linux/cache.h>
14/* need struct page definitions */ 13/* need struct page definitions */
diff --git a/include/asm-powerpc/dma.h b/include/asm-powerpc/dma.h
index 4bb57fe37097..7a4374bdbef4 100644
--- a/include/asm-powerpc/dma.h
+++ b/include/asm-powerpc/dma.h
@@ -22,7 +22,6 @@
22 * with a grain of salt. 22 * with a grain of salt.
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <asm/io.h> 25#include <asm/io.h>
27#include <linux/spinlock.h> 26#include <linux/spinlock.h>
28#include <asm/system.h> 27#include <asm/system.h>
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h
index 868c7139dbff..4df3e80118f4 100644
--- a/include/asm-powerpc/eeh.h
+++ b/include/asm-powerpc/eeh.h
@@ -21,7 +21,6 @@
21#define _PPC64_EEH_H 21#define _PPC64_EEH_H
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23 23
24#include <linux/config.h>
25#include <linux/init.h> 24#include <linux/init.h>
26#include <linux/list.h> 25#include <linux/list.h>
27#include <linux/string.h> 26#include <linux/string.h>
@@ -293,8 +292,6 @@ static inline void eeh_memcpy_toio(volatile void __iomem *dest, const void *src,
293static inline u8 eeh_inb(unsigned long port) 292static inline u8 eeh_inb(unsigned long port)
294{ 293{
295 u8 val; 294 u8 val;
296 if (!_IO_IS_VALID(port))
297 return ~0;
298 val = in_8((u8 __iomem *)(port+pci_io_base)); 295 val = in_8((u8 __iomem *)(port+pci_io_base));
299 if (EEH_POSSIBLE_ERROR(val, u8)) 296 if (EEH_POSSIBLE_ERROR(val, u8))
300 return eeh_check_failure((void __iomem *)(port), val); 297 return eeh_check_failure((void __iomem *)(port), val);
@@ -303,15 +300,12 @@ static inline u8 eeh_inb(unsigned long port)
303 300
304static inline void eeh_outb(u8 val, unsigned long port) 301static inline void eeh_outb(u8 val, unsigned long port)
305{ 302{
306 if (_IO_IS_VALID(port)) 303 out_8((u8 __iomem *)(port+pci_io_base), val);
307 out_8((u8 __iomem *)(port+pci_io_base), val);
308} 304}
309 305
310static inline u16 eeh_inw(unsigned long port) 306static inline u16 eeh_inw(unsigned long port)
311{ 307{
312 u16 val; 308 u16 val;
313 if (!_IO_IS_VALID(port))
314 return ~0;
315 val = in_le16((u16 __iomem *)(port+pci_io_base)); 309 val = in_le16((u16 __iomem *)(port+pci_io_base));
316 if (EEH_POSSIBLE_ERROR(val, u16)) 310 if (EEH_POSSIBLE_ERROR(val, u16))
317 return eeh_check_failure((void __iomem *)(port), val); 311 return eeh_check_failure((void __iomem *)(port), val);
@@ -320,15 +314,12 @@ static inline u16 eeh_inw(unsigned long port)
320 314
321static inline void eeh_outw(u16 val, unsigned long port) 315static inline void eeh_outw(u16 val, unsigned long port)
322{ 316{
323 if (_IO_IS_VALID(port)) 317 out_le16((u16 __iomem *)(port+pci_io_base), val);
324 out_le16((u16 __iomem *)(port+pci_io_base), val);
325} 318}
326 319
327static inline u32 eeh_inl(unsigned long port) 320static inline u32 eeh_inl(unsigned long port)
328{ 321{
329 u32 val; 322 u32 val;
330 if (!_IO_IS_VALID(port))
331 return ~0;
332 val = in_le32((u32 __iomem *)(port+pci_io_base)); 323 val = in_le32((u32 __iomem *)(port+pci_io_base));
333 if (EEH_POSSIBLE_ERROR(val, u32)) 324 if (EEH_POSSIBLE_ERROR(val, u32))
334 return eeh_check_failure((void __iomem *)(port), val); 325 return eeh_check_failure((void __iomem *)(port), val);
@@ -337,8 +328,7 @@ static inline u32 eeh_inl(unsigned long port)
337 328
338static inline void eeh_outl(u32 val, unsigned long port) 329static inline void eeh_outl(u32 val, unsigned long port)
339{ 330{
340 if (_IO_IS_VALID(port)) 331 out_le32((u32 __iomem *)(port+pci_io_base), val);
341 out_le32((u32 __iomem *)(port+pci_io_base), val);
342} 332}
343 333
344/* in-string eeh macros */ 334/* in-string eeh macros */
diff --git a/include/asm-powerpc/eeh_event.h b/include/asm-powerpc/eeh_event.h
index 93d55a2bebfd..dc6bf0ffb796 100644
--- a/include/asm-powerpc/eeh_event.h
+++ b/include/asm-powerpc/eeh_event.h
@@ -18,8 +18,8 @@
18 * Copyright (c) 2005 Linas Vepstas <linas@linas.org> 18 * Copyright (c) 2005 Linas Vepstas <linas@linas.org>
19 */ 19 */
20 20
21#ifndef ASM_PPC64_EEH_EVENT_H 21#ifndef ASM_POWERPC_EEH_EVENT_H
22#define ASM_PPC64_EEH_EVENT_H 22#define ASM_POWERPC_EEH_EVENT_H
23#ifdef __KERNEL__ 23#ifdef __KERNEL__
24 24
25/** EEH event -- structure holding pci controller data that describes 25/** EEH event -- structure holding pci controller data that describes
@@ -39,7 +39,7 @@ struct eeh_event {
39 * @dev pci device 39 * @dev pci device
40 * 40 *
41 * This routine builds a PCI error event which will be delivered 41 * This routine builds a PCI error event which will be delivered
42 * to all listeners on the peh_notifier_chain. 42 * to all listeners on the eeh_notifier_chain.
43 * 43 *
44 * This routine can be called within an interrupt context; 44 * This routine can be called within an interrupt context;
45 * the actual event will be delivered in a normal context 45 * the actual event will be delivered in a normal context
@@ -51,7 +51,7 @@ int eeh_send_failure_event (struct device_node *dn,
51 int time_unavail); 51 int time_unavail);
52 52
53/* Main recovery function */ 53/* Main recovery function */
54void handle_eeh_events (struct eeh_event *); 54struct pci_dn * handle_eeh_events (struct eeh_event *);
55 55
56#endif /* __KERNEL__ */ 56#endif /* __KERNEL__ */
57#endif /* ASM_PPC64_EEH_EVENT_H */ 57#endif /* ASM_POWERPC_EEH_EVENT_H */
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h
index 94d228f9c6ac..9a83a987d396 100644
--- a/include/asm-powerpc/elf.h
+++ b/include/asm-powerpc/elf.h
@@ -3,14 +3,14 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5#include <linux/sched.h> /* for task_struct */ 5#include <linux/sched.h> /* for task_struct */
6#include <asm/page.h>
7#include <asm/string.h>
6#endif 8#endif
7 9
8#include <asm/types.h> 10#include <asm/types.h>
9#include <asm/ptrace.h> 11#include <asm/ptrace.h>
10#include <asm/cputable.h> 12#include <asm/cputable.h>
11#include <asm/auxvec.h> 13#include <asm/auxvec.h>
12#include <asm/page.h>
13#include <asm/string.h>
14 14
15/* PowerPC relocations defined by the ABIs */ 15/* PowerPC relocations defined by the ABIs */
16#define R_PPC_NONE 0 16#define R_PPC_NONE 0
@@ -129,7 +129,7 @@ typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG];
129 /* Assumption: ELF_ARCH == EM_PPC and ELF_CLASS == ELFCLASS32 */ 129 /* Assumption: ELF_ARCH == EM_PPC and ELF_CLASS == ELFCLASS32 */
130 typedef elf_greg_t32 elf_greg_t; 130 typedef elf_greg_t32 elf_greg_t;
131 typedef elf_gregset_t32 elf_gregset_t; 131 typedef elf_gregset_t32 elf_gregset_t;
132# define elf_addr_t u32 132# define elf_addr_t __u32
133#endif /* ELF_ARCH */ 133#endif /* ELF_ARCH */
134 134
135/* Floating point registers */ 135/* Floating point registers */
@@ -161,6 +161,7 @@ typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
161typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32]; 161typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32];
162#endif 162#endif
163 163
164#ifdef __KERNEL__
164/* 165/*
165 * This is used to ensure we don't load something for the wrong architecture. 166 * This is used to ensure we don't load something for the wrong architecture.
166 */ 167 */
@@ -176,8 +177,6 @@ typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32];
176 177
177#define ELF_ET_DYN_BASE (0x08000000) 178#define ELF_ET_DYN_BASE (0x08000000)
178 179
179#ifdef __KERNEL__
180
181/* Common routine for both 32-bit and 64-bit processes */ 180/* Common routine for both 32-bit and 64-bit processes */
182static inline void ppc_elf_core_copy_regs(elf_gregset_t elf_regs, 181static inline void ppc_elf_core_copy_regs(elf_gregset_t elf_regs,
183 struct pt_regs *regs) 182 struct pt_regs *regs)
@@ -294,7 +293,7 @@ do { \
294 NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \ 293 NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \
295 NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \ 294 NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \
296 NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \ 295 NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \
297 VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->thread.vdso_base) \ 296 VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->mm->context.vdso_base) \
298} while (0) 297} while (0)
299 298
300/* PowerPC64 relocations defined by the ABIs */ 299/* PowerPC64 relocations defined by the ABIs */
diff --git a/include/asm-powerpc/floppy.h b/include/asm-powerpc/floppy.h
index 608164c39efb..7e2d169ee856 100644
--- a/include/asm-powerpc/floppy.h
+++ b/include/asm-powerpc/floppy.h
@@ -11,7 +11,6 @@
11#define __ASM_POWERPC_FLOPPY_H 11#define __ASM_POWERPC_FLOPPY_H
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13 13
14#include <linux/config.h>
15#include <asm/machdep.h> 14#include <asm/machdep.h>
16 15
17#define fd_inb(port) inb_p(port) 16#define fd_inb(port) inb_p(port)
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h
index 6cc7e1fb7bfd..0d3c4e85711a 100644
--- a/include/asm-powerpc/hvcall.h
+++ b/include/asm-powerpc/hvcall.h
@@ -102,6 +102,15 @@
102#define H_PP1 (1UL<<(63-62)) 102#define H_PP1 (1UL<<(63-62))
103#define H_PP2 (1UL<<(63-63)) 103#define H_PP2 (1UL<<(63-63))
104 104
105/* VASI States */
106#define H_VASI_INVALID 0
107#define H_VASI_ENABLED 1
108#define H_VASI_ABORTED 2
109#define H_VASI_SUSPENDING 3
110#define H_VASI_SUSPENDED 4
111#define H_VASI_RESUMED 5
112#define H_VASI_COMPLETED 6
113
105/* DABRX flags */ 114/* DABRX flags */
106#define H_DABRX_HYPERVISOR (1UL<<(63-61)) 115#define H_DABRX_HYPERVISOR (1UL<<(63-61))
107#define H_DABRX_KERNEL (1UL<<(63-62)) 116#define H_DABRX_KERNEL (1UL<<(63-62))
@@ -190,6 +199,7 @@
190#define H_QUERY_INT_STATE 0x1E4 199#define H_QUERY_INT_STATE 0x1E4
191#define H_POLL_PENDING 0x1D8 200#define H_POLL_PENDING 0x1D8
192#define H_JOIN 0x298 201#define H_JOIN 0x298
202#define H_VASI_STATE 0x2A4
193#define H_ENABLE_CRQ 0x2B0 203#define H_ENABLE_CRQ 0x2B0
194 204
195#ifndef __ASSEMBLY__ 205#ifndef __ASSEMBLY__
diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h
index 26b89d859c56..ce0f7db63c16 100644
--- a/include/asm-powerpc/hw_irq.h
+++ b/include/asm-powerpc/hw_irq.h
@@ -6,7 +6,6 @@
6 6
7#ifdef __KERNEL__ 7#ifdef __KERNEL__
8 8
9#include <linux/config.h>
10#include <linux/errno.h> 9#include <linux/errno.h>
11#include <asm/ptrace.h> 10#include <asm/ptrace.h>
12#include <asm/processor.h> 11#include <asm/processor.h>
diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h
index da5f640480cf..b09b42af6a1e 100644
--- a/include/asm-powerpc/ide.h
+++ b/include/asm-powerpc/ide.h
@@ -22,7 +22,6 @@
22#endif 22#endif
23 23
24#ifndef __powerpc64__ 24#ifndef __powerpc64__
25#include <linux/config.h>
26#include <linux/hdreg.h> 25#include <linux/hdreg.h>
27#include <linux/ioport.h> 26#include <linux/ioport.h>
28#include <asm/io.h> 27#include <asm/io.h>
diff --git a/include/asm-powerpc/immap_86xx.h b/include/asm-powerpc/immap_86xx.h
new file mode 100644
index 000000000000..d905b6622268
--- /dev/null
+++ b/include/asm-powerpc/immap_86xx.h
@@ -0,0 +1,199 @@
1/*
2 * MPC86xx Internal Memory Map
3 *
4 * Author: Jeff Brown
5 *
6 * Copyright 2004 Freescale Semiconductor, Inc
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifndef __ASM_POWERPC_IMMAP_86XX_H__
16#define __ASM_POWERPC_IMMAP_86XX_H__
17#ifdef __KERNEL__
18
19/* Eventually this should define all the IO block registers in 86xx */
20
21/* PCI Registers */
22typedef struct ccsr_pci {
23 uint cfg_addr; /* 0x.000 - PCI Configuration Address Register */
24 uint cfg_data; /* 0x.004 - PCI Configuration Data Register */
25 uint int_ack; /* 0x.008 - PCI Interrupt Acknowledge Register */
26 char res1[3060];
27 uint potar0; /* 0x.c00 - PCI Outbound Transaction Address Register 0 */
28 uint potear0; /* 0x.c04 - PCI Outbound Translation Extended Address Register 0 */
29 uint powbar0; /* 0x.c08 - PCI Outbound Window Base Address Register 0 */
30 char res2[4];
31 uint powar0; /* 0x.c10 - PCI Outbound Window Attributes Register 0 */
32 char res3[12];
33 uint potar1; /* 0x.c20 - PCI Outbound Transaction Address Register 1 */
34 uint potear1; /* 0x.c24 - PCI Outbound Translation Extended Address Register 1 */
35 uint powbar1; /* 0x.c28 - PCI Outbound Window Base Address Register 1 */
36 char res4[4];
37 uint powar1; /* 0x.c30 - PCI Outbound Window Attributes Register 1 */
38 char res5[12];
39 uint potar2; /* 0x.c40 - PCI Outbound Transaction Address Register 2 */
40 uint potear2; /* 0x.c44 - PCI Outbound Translation Extended Address Register 2 */
41 uint powbar2; /* 0x.c48 - PCI Outbound Window Base Address Register 2 */
42 char res6[4];
43 uint powar2; /* 0x.c50 - PCI Outbound Window Attributes Register 2 */
44 char res7[12];
45 uint potar3; /* 0x.c60 - PCI Outbound Transaction Address Register 3 */
46 uint potear3; /* 0x.c64 - PCI Outbound Translation Extended Address Register 3 */
47 uint powbar3; /* 0x.c68 - PCI Outbound Window Base Address Register 3 */
48 char res8[4];
49 uint powar3; /* 0x.c70 - PCI Outbound Window Attributes Register 3 */
50 char res9[12];
51 uint potar4; /* 0x.c80 - PCI Outbound Transaction Address Register 4 */
52 uint potear4; /* 0x.c84 - PCI Outbound Translation Extended Address Register 4 */
53 uint powbar4; /* 0x.c88 - PCI Outbound Window Base Address Register 4 */
54 char res10[4];
55 uint powar4; /* 0x.c90 - PCI Outbound Window Attributes Register 4 */
56 char res11[268];
57 uint pitar3; /* 0x.da0 - PCI Inbound Translation Address Register 3 */
58 char res12[4];
59 uint piwbar3; /* 0x.da8 - PCI Inbound Window Base Address Register 3 */
60 uint piwbear3; /* 0x.dac - PCI Inbound Window Base Extended Address Register 3 */
61 uint piwar3; /* 0x.db0 - PCI Inbound Window Attributes Register 3 */
62 char res13[12];
63 uint pitar2; /* 0x.dc0 - PCI Inbound Translation Address Register 2 */
64 char res14[4];
65 uint piwbar2; /* 0x.dc8 - PCI Inbound Window Base Address Register 2 */
66 uint piwbear2; /* 0x.dcc - PCI Inbound Window Base Extended Address Register 2 */
67 uint piwar2; /* 0x.dd0 - PCI Inbound Window Attributes Register 2 */
68 char res15[12];
69 uint pitar1; /* 0x.de0 - PCI Inbound Translation Address Register 1 */
70 char res16[4];
71 uint piwbar1; /* 0x.de8 - PCI Inbound Window Base Address Register 1 */
72 char res17[4];
73 uint piwar1; /* 0x.df0 - PCI Inbound Window Attributes Register 1 */
74 char res18[12];
75 uint err_dr; /* 0x.e00 - PCI Error Detect Register */
76 uint err_cap_dr; /* 0x.e04 - PCI Error Capture Disable Register */
77 uint err_en; /* 0x.e08 - PCI Error Enable Register */
78 uint err_attrib; /* 0x.e0c - PCI Error Attributes Capture Register */
79 uint err_addr; /* 0x.e10 - PCI Error Address Capture Register */
80 uint err_ext_addr; /* 0x.e14 - PCI Error Extended Address Capture Register */
81 uint err_dl; /* 0x.e18 - PCI Error Data Low Capture Register */
82 uint err_dh; /* 0x.e1c - PCI Error Data High Capture Register */
83 uint gas_timr; /* 0x.e20 - PCI Gasket Timer Register */
84 uint pci_timr; /* 0x.e24 - PCI Timer Register */
85 char res19[472];
86} ccsr_pci_t;
87
88/* PCI Express Registers */
89typedef struct ccsr_pex {
90 uint pex_config_addr; /* 0x.000 - PCI Express Configuration Address Register */
91 uint pex_config_data; /* 0x.004 - PCI Express Configuration Data Register */
92 char res1[4];
93 uint pex_otb_cpl_tor; /* 0x.00c - PCI Express Outbound completion timeout register */
94 uint pex_conf_tor; /* 0x.010 - PCI Express configuration timeout register */
95 char res2[12];
96 uint pex_pme_mes_dr; /* 0x.020 - PCI Express PME and message detect register */
97 uint pex_pme_mes_disr; /* 0x.024 - PCI Express PME and message disable register */
98 uint pex_pme_mes_ier; /* 0x.028 - PCI Express PME and message interrupt enable register */
99 uint pex_pmcr; /* 0x.02c - PCI Express power management command register */
100 char res3[3024];
101 uint pexotar0; /* 0x.c00 - PCI Express outbound translation address register 0 */
102 uint pexotear0; /* 0x.c04 - PCI Express outbound translation extended address register 0*/
103 char res4[8];
104 uint pexowar0; /* 0x.c10 - PCI Express outbound window attributes register 0*/
105 char res5[12];
106 uint pexotar1; /* 0x.c20 - PCI Express outbound translation address register 1 */
107 uint pexotear1; /* 0x.c24 - PCI Express outbound translation extended address register 1*/
108 uint pexowbar1; /* 0x.c28 - PCI Express outbound window base address register 1*/
109 char res6[4];
110 uint pexowar1; /* 0x.c30 - PCI Express outbound window attributes register 1*/
111 char res7[12];
112 uint pexotar2; /* 0x.c40 - PCI Express outbound translation address register 2 */
113 uint pexotear2; /* 0x.c44 - PCI Express outbound translation extended address register 2*/
114 uint pexowbar2; /* 0x.c48 - PCI Express outbound window base address register 2*/
115 char res8[4];
116 uint pexowar2; /* 0x.c50 - PCI Express outbound window attributes register 2*/
117 char res9[12];
118 uint pexotar3; /* 0x.c60 - PCI Express outbound translation address register 3 */
119 uint pexotear3; /* 0x.c64 - PCI Express outbound translation extended address register 3*/
120 uint pexowbar3; /* 0x.c68 - PCI Express outbound window base address register 3*/
121 char res10[4];
122 uint pexowar3; /* 0x.c70 - PCI Express outbound window attributes register 3*/
123 char res11[12];
124 uint pexotar4; /* 0x.c80 - PCI Express outbound translation address register 4 */
125 uint pexotear4; /* 0x.c84 - PCI Express outbound translation extended address register 4*/
126 uint pexowbar4; /* 0x.c88 - PCI Express outbound window base address register 4*/
127 char res12[4];
128 uint pexowar4; /* 0x.c90 - PCI Express outbound window attributes register 4*/
129 char res13[12];
130 char res14[256];
131 uint pexitar3; /* 0x.da0 - PCI Express inbound translation address register 3 */
132 char res15[4];
133 uint pexiwbar3; /* 0x.da8 - PCI Express inbound window base address register 3 */
134 uint pexiwbear3; /* 0x.dac - PCI Express inbound window base extended address register 3 */
135 uint pexiwar3; /* 0x.db0 - PCI Express inbound window attributes register 3 */
136 char res16[12];
137 uint pexitar2; /* 0x.dc0 - PCI Express inbound translation address register 2 */
138 char res17[4];
139 uint pexiwbar2; /* 0x.dc8 - PCI Express inbound window base address register 2 */
140 uint pexiwbear2; /* 0x.dcc - PCI Express inbound window base extended address register 2 */
141 uint pexiwar2; /* 0x.dd0 - PCI Express inbound window attributes register 2 */
142 char res18[12];
143 uint pexitar1; /* 0x.de0 - PCI Express inbound translation address register 2 */
144 char res19[4];
145 uint pexiwbar1; /* 0x.de8 - PCI Express inbound window base address register 2 */
146 uint pexiwbear1; /* 0x.dec - PCI Express inbound window base extended address register 2 */
147 uint pexiwar1; /* 0x.df0 - PCI Express inbound window attributes register 2 */
148 char res20[12];
149 uint pex_err_dr; /* 0x.e00 - PCI Express error detect register */
150 char res21[4];
151 uint pex_err_en; /* 0x.e08 - PCI Express error interrupt enable register */
152 char res22[4];
153 uint pex_err_disr; /* 0x.e10 - PCI Express error disable register */
154 char res23[12];
155 uint pex_err_cap_stat; /* 0x.e20 - PCI Express error capture status register */
156 char res24[4];
157 uint pex_err_cap_r0; /* 0x.e28 - PCI Express error capture register 0 */
158 uint pex_err_cap_r1; /* 0x.e2c - PCI Express error capture register 0 */
159 uint pex_err_cap_r2; /* 0x.e30 - PCI Express error capture register 0 */
160 uint pex_err_cap_r3; /* 0x.e34 - PCI Express error capture register 0 */
161} ccsr_pex_t;
162
163/* Global Utility Registers */
164typedef struct ccsr_guts {
165 uint porpllsr; /* 0x.0000 - POR PLL Ratio Status Register */
166 uint porbmsr; /* 0x.0004 - POR Boot Mode Status Register */
167 uint porimpscr; /* 0x.0008 - POR I/O Impedance Status and Control Register */
168 uint pordevsr; /* 0x.000c - POR I/O Device Status Register */
169 uint pordbgmsr; /* 0x.0010 - POR Debug Mode Status Register */
170 char res1[12];
171 uint gpporcr; /* 0x.0020 - General-Purpose POR Configuration Register */
172 char res2[12];
173 uint gpiocr; /* 0x.0030 - GPIO Control Register */
174 char res3[12];
175 uint gpoutdr; /* 0x.0040 - General-Purpose Output Data Register */
176 char res4[12];
177 uint gpindr; /* 0x.0050 - General-Purpose Input Data Register */
178 char res5[12];
179 uint pmuxcr; /* 0x.0060 - Alternate Function Signal Multiplex Control */
180 char res6[12];
181 uint devdisr; /* 0x.0070 - Device Disable Control */
182 char res7[12];
183 uint powmgtcsr; /* 0x.0080 - Power Management Status and Control Register */
184 char res8[12];
185 uint mcpsumr; /* 0x.0090 - Machine Check Summary Register */
186 char res9[12];
187 uint pvr; /* 0x.00a0 - Processor Version Register */
188 uint svr; /* 0x.00a4 - System Version Register */
189 char res10[3416];
190 uint clkocr; /* 0x.0e00 - Clock Out Select Register */
191 char res11[12];
192 uint ddrdllcr; /* 0x.0e10 - DDR DLL Control Register */
193 char res12[12];
194 uint lbcdllcr; /* 0x.0e20 - LBC DLL Control Register */
195 char res13[61916];
196} ccsr_guts_t;
197
198#endif /* __ASM_POWERPC_IMMAP_86XX_H__ */
199#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index f1c2469b8844..a9496f34b048 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -40,12 +40,6 @@ extern int check_legacy_ioport(unsigned long base_port);
40 40
41extern unsigned long isa_io_base; 41extern unsigned long isa_io_base;
42extern unsigned long pci_io_base; 42extern unsigned long pci_io_base;
43extern unsigned long io_page_mask;
44
45#define MAX_ISA_PORT 0x10000
46
47#define _IO_IS_VALID(port) ((port) >= MAX_ISA_PORT || (1 << (port>>PAGE_SHIFT)) \
48 & io_page_mask)
49 43
50#ifdef CONFIG_PPC_ISERIES 44#ifdef CONFIG_PPC_ISERIES
51/* __raw_* accessors aren't supported on iSeries */ 45/* __raw_* accessors aren't supported on iSeries */
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h
index 18ca29e9105a..a5e98641a2ae 100644
--- a/include/asm-powerpc/iommu.h
+++ b/include/asm-powerpc/iommu.h
@@ -22,7 +22,6 @@
22#define _ASM_IOMMU_H 22#define _ASM_IOMMU_H
23#ifdef __KERNEL__ 23#ifdef __KERNEL__
24 24
25#include <linux/config.h>
26#include <asm/types.h> 25#include <asm/types.h>
27#include <linux/spinlock.h> 26#include <linux/spinlock.h>
28#include <linux/device.h> 27#include <linux/device.h>
@@ -67,7 +66,8 @@ extern void iommu_free_table(struct device_node *dn);
67/* Initializes an iommu_table based in values set in the passed-in 66/* Initializes an iommu_table based in values set in the passed-in
68 * structure 67 * structure
69 */ 68 */
70extern struct iommu_table *iommu_init_table(struct iommu_table * tbl); 69extern struct iommu_table *iommu_init_table(struct iommu_table * tbl,
70 int nid);
71 71
72extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl, 72extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
73 struct scatterlist *sglist, int nelems, unsigned long mask, 73 struct scatterlist *sglist, int nelems, unsigned long mask,
@@ -76,7 +76,8 @@ extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
76 int nelems, enum dma_data_direction direction); 76 int nelems, enum dma_data_direction direction);
77 77
78extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, 78extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
79 dma_addr_t *dma_handle, unsigned long mask, gfp_t flag); 79 dma_addr_t *dma_handle, unsigned long mask,
80 gfp_t flag, int node);
80extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, 81extern void iommu_free_coherent(struct iommu_table *tbl, size_t size,
81 void *vaddr, dma_addr_t dma_handle); 82 void *vaddr, dma_addr_t dma_handle);
82extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, 83extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index 7bc6d73b2823..a10feec29d4d 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -9,7 +9,6 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/threads.h> 12#include <linux/threads.h>
14 13
15#include <asm/types.h> 14#include <asm/types.h>
@@ -348,6 +347,92 @@ extern u64 ppc64_interrupt_controller;
348#define SIU_INT_PC1 ((uint)0x3e+CPM_IRQ_OFFSET) 347#define SIU_INT_PC1 ((uint)0x3e+CPM_IRQ_OFFSET)
349#define SIU_INT_PC0 ((uint)0x3f+CPM_IRQ_OFFSET) 348#define SIU_INT_PC0 ((uint)0x3f+CPM_IRQ_OFFSET)
350 349
350#elif defined(CONFIG_PPC_86xx)
351#include <asm/mpc86xx.h>
352
353#define NR_EPIC_INTS 48
354#ifndef NR_8259_INTS
355#define NR_8259_INTS 16 /*ULI 1575 can route 12 interrupts */
356#endif
357#define NUM_8259_INTERRUPTS NR_8259_INTS
358
359#ifndef I8259_OFFSET
360#define I8259_OFFSET 0
361#endif
362
363#define NR_IRQS 256
364
365/* Internal IRQs on MPC86xx OpenPIC */
366
367#ifndef MPC86xx_OPENPIC_IRQ_OFFSET
368#define MPC86xx_OPENPIC_IRQ_OFFSET NR_8259_INTS
369#endif
370
371/* The 48 internal sources */
372#define MPC86xx_IRQ_NULL ( 0 + MPC86xx_OPENPIC_IRQ_OFFSET)
373#define MPC86xx_IRQ_MCM ( 1 + MPC86xx_OPENPIC_IRQ_OFFSET)
374#define MPC86xx_IRQ_DDR ( 2 + MPC86xx_OPENPIC_IRQ_OFFSET)
375#define MPC86xx_IRQ_LBC ( 3 + MPC86xx_OPENPIC_IRQ_OFFSET)
376#define MPC86xx_IRQ_DMA0 ( 4 + MPC86xx_OPENPIC_IRQ_OFFSET)
377#define MPC86xx_IRQ_DMA1 ( 5 + MPC86xx_OPENPIC_IRQ_OFFSET)
378#define MPC86xx_IRQ_DMA2 ( 6 + MPC86xx_OPENPIC_IRQ_OFFSET)
379#define MPC86xx_IRQ_DMA3 ( 7 + MPC86xx_OPENPIC_IRQ_OFFSET)
380
381/* no 10,11 */
382#define MPC86xx_IRQ_UART2 (12 + MPC86xx_OPENPIC_IRQ_OFFSET)
383#define MPC86xx_IRQ_TSEC1_TX (13 + MPC86xx_OPENPIC_IRQ_OFFSET)
384#define MPC86xx_IRQ_TSEC1_RX (14 + MPC86xx_OPENPIC_IRQ_OFFSET)
385#define MPC86xx_IRQ_TSEC3_TX (15 + MPC86xx_OPENPIC_IRQ_OFFSET)
386#define MPC86xx_IRQ_TSEC3_RX (16 + MPC86xx_OPENPIC_IRQ_OFFSET)
387#define MPC86xx_IRQ_TSEC3_ERROR (17 + MPC86xx_OPENPIC_IRQ_OFFSET)
388#define MPC86xx_IRQ_TSEC1_ERROR (18 + MPC86xx_OPENPIC_IRQ_OFFSET)
389#define MPC86xx_IRQ_TSEC2_TX (19 + MPC86xx_OPENPIC_IRQ_OFFSET)
390#define MPC86xx_IRQ_TSEC2_RX (20 + MPC86xx_OPENPIC_IRQ_OFFSET)
391#define MPC86xx_IRQ_TSEC4_TX (21 + MPC86xx_OPENPIC_IRQ_OFFSET)
392#define MPC86xx_IRQ_TSEC4_RX (22 + MPC86xx_OPENPIC_IRQ_OFFSET)
393#define MPC86xx_IRQ_TSEC4_ERROR (23 + MPC86xx_OPENPIC_IRQ_OFFSET)
394#define MPC86xx_IRQ_TSEC2_ERROR (24 + MPC86xx_OPENPIC_IRQ_OFFSET)
395/* no 25 */
396#define MPC86xx_IRQ_UART1 (26 + MPC86xx_OPENPIC_IRQ_OFFSET)
397#define MPC86xx_IRQ_IIC (27 + MPC86xx_OPENPIC_IRQ_OFFSET)
398#define MPC86xx_IRQ_PERFMON (28 + MPC86xx_OPENPIC_IRQ_OFFSET)
399/* no 29,30,31 */
400#define MPC86xx_IRQ_SRIO_ERROR (32 + MPC86xx_OPENPIC_IRQ_OFFSET)
401#define MPC86xx_IRQ_SRIO_OUT_BELL (33 + MPC86xx_OPENPIC_IRQ_OFFSET)
402#define MPC86xx_IRQ_SRIO_IN_BELL (34 + MPC86xx_OPENPIC_IRQ_OFFSET)
403/* no 35,36 */
404#define MPC86xx_IRQ_SRIO_OUT_MSG1 (37 + MPC86xx_OPENPIC_IRQ_OFFSET)
405#define MPC86xx_IRQ_SRIO_IN_MSG1 (38 + MPC86xx_OPENPIC_IRQ_OFFSET)
406#define MPC86xx_IRQ_SRIO_OUT_MSG2 (39 + MPC86xx_OPENPIC_IRQ_OFFSET)
407#define MPC86xx_IRQ_SRIO_IN_MSG2 (40 + MPC86xx_OPENPIC_IRQ_OFFSET)
408
409/* The 12 external interrupt lines */
410#define MPC86xx_IRQ_EXT_BASE 48
411#define MPC86xx_IRQ_EXT0 (0 + MPC86xx_IRQ_EXT_BASE \
412 + MPC86xx_OPENPIC_IRQ_OFFSET)
413#define MPC86xx_IRQ_EXT1 (1 + MPC86xx_IRQ_EXT_BASE \
414 + MPC86xx_OPENPIC_IRQ_OFFSET)
415#define MPC86xx_IRQ_EXT2 (2 + MPC86xx_IRQ_EXT_BASE \
416 + MPC86xx_OPENPIC_IRQ_OFFSET)
417#define MPC86xx_IRQ_EXT3 (3 + MPC86xx_IRQ_EXT_BASE \
418 + MPC86xx_OPENPIC_IRQ_OFFSET)
419#define MPC86xx_IRQ_EXT4 (4 + MPC86xx_IRQ_EXT_BASE \
420 + MPC86xx_OPENPIC_IRQ_OFFSET)
421#define MPC86xx_IRQ_EXT5 (5 + MPC86xx_IRQ_EXT_BASE \
422 + MPC86xx_OPENPIC_IRQ_OFFSET)
423#define MPC86xx_IRQ_EXT6 (6 + MPC86xx_IRQ_EXT_BASE \
424 + MPC86xx_OPENPIC_IRQ_OFFSET)
425#define MPC86xx_IRQ_EXT7 (7 + MPC86xx_IRQ_EXT_BASE \
426 + MPC86xx_OPENPIC_IRQ_OFFSET)
427#define MPC86xx_IRQ_EXT8 (8 + MPC86xx_IRQ_EXT_BASE \
428 + MPC86xx_OPENPIC_IRQ_OFFSET)
429#define MPC86xx_IRQ_EXT9 (9 + MPC86xx_IRQ_EXT_BASE \
430 + MPC86xx_OPENPIC_IRQ_OFFSET)
431#define MPC86xx_IRQ_EXT10 (10 + MPC86xx_IRQ_EXT_BASE \
432 + MPC86xx_OPENPIC_IRQ_OFFSET)
433#define MPC86xx_IRQ_EXT11 (11 + MPC86xx_IRQ_EXT_BASE \
434 + MPC86xx_OPENPIC_IRQ_OFFSET)
435
351#else /* CONFIG_40x + CONFIG_8xx */ 436#else /* CONFIG_40x + CONFIG_8xx */
352/* 437/*
353 * this is the # irq's for all ppc arch's (pmac/chrp/prep) 438 * this is the # irq's for all ppc arch's (pmac/chrp/prep)
diff --git a/include/asm-powerpc/iseries/iommu.h b/include/asm-powerpc/iseries/iommu.h
new file mode 100644
index 000000000000..0edbfe10cb37
--- /dev/null
+++ b/include/asm-powerpc/iseries/iommu.h
@@ -0,0 +1,35 @@
1#ifndef _ASM_POWERPC_ISERIES_IOMMU_H
2#define _ASM_POWERPC_ISERIES_IOMMU_H
3
4/*
5 * Copyright (C) 2005 Stephen Rothwell, IBM Corporation
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:
19 * Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330,
21 * Boston, MA 02111-1307 USA
22 */
23
24struct device_node;
25struct iommu_table;
26
27/* Creates table for an individual device node */
28extern void iommu_devnode_init_iSeries(struct device_node *dn);
29
30/* Get table parameters from HV */
31extern void iommu_table_getparms_iSeries(unsigned long busno,
32 unsigned char slotno, unsigned char virtbus,
33 struct iommu_table *tbl);
34
35#endif /* _ASM_POWERPC_ISERIES_IOMMU_H */
diff --git a/include/asm-powerpc/iseries/iseries_io.h b/include/asm-powerpc/iseries/iseries_io.h
index 496aa852b617..f29009bd63c9 100644
--- a/include/asm-powerpc/iseries/iseries_io.h
+++ b/include/asm-powerpc/iseries/iseries_io.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_POWERPC_ISERIES_ISERIES_IO_H 1#ifndef _ASM_POWERPC_ISERIES_ISERIES_IO_H
2#define _ASM_POWERPC_ISERIES_ISERIES_IO_H 2#define _ASM_POWERPC_ISERIES_ISERIES_IO_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_PPC_ISERIES 5#ifdef CONFIG_PPC_ISERIES
7#include <linux/types.h> 6#include <linux/types.h>
diff --git a/include/asm-powerpc/kdump.h b/include/asm-powerpc/kdump.h
index a87aed00d61f..5a5c3b5ab1e0 100644
--- a/include/asm-powerpc/kdump.h
+++ b/include/asm-powerpc/kdump.h
@@ -1,13 +1,38 @@
1#ifndef _PPC64_KDUMP_H 1#ifndef _PPC64_KDUMP_H
2#define _PPC64_KDUMP_H 2#define _PPC64_KDUMP_H
3 3
4/* Kdump kernel runs at 32 MB, change at your peril. */
5#define KDUMP_KERNELBASE 0x2000000
6
4/* How many bytes to reserve at zero for kdump. The reserve limit should 7/* How many bytes to reserve at zero for kdump. The reserve limit should
5 * be greater or equal to the trampoline's end address. */ 8 * be greater or equal to the trampoline's end address.
9 * Reserve to the end of the FWNMI area, see head_64.S */
6#define KDUMP_RESERVE_LIMIT 0x8000 10#define KDUMP_RESERVE_LIMIT 0x8000
7 11
12#ifdef CONFIG_CRASH_DUMP
13
14#define PHYSICAL_START KDUMP_KERNELBASE
8#define KDUMP_TRAMPOLINE_START 0x0100 15#define KDUMP_TRAMPOLINE_START 0x0100
9#define KDUMP_TRAMPOLINE_END 0x3000 16#define KDUMP_TRAMPOLINE_END 0x3000
10 17
11extern void kdump_setup(void); 18#else /* !CONFIG_CRASH_DUMP */
19
20#define PHYSICAL_START 0x0
21
22#endif /* CONFIG_CRASH_DUMP */
23
24#ifndef __ASSEMBLY__
25#ifdef CONFIG_CRASH_DUMP
26
27extern void reserve_kdump_trampoline(void);
28extern void setup_kdump_trampoline(void);
29
30#else /* !CONFIG_CRASH_DUMP */
31
32static inline void reserve_kdump_trampoline(void) { ; }
33static inline void setup_kdump_trampoline(void) { ; }
34
35#endif /* CONFIG_CRASH_DUMP */
36#endif /* __ASSEMBLY__ */
12 37
13#endif /* __PPC64_KDUMP_H */ 38#endif /* __PPC64_KDUMP_H */
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h
index 6a2af2f6853b..efe8872ec583 100644
--- a/include/asm-powerpc/kexec.h
+++ b/include/asm-powerpc/kexec.h
@@ -31,9 +31,10 @@
31#define KEXEC_ARCH KEXEC_ARCH_PPC 31#define KEXEC_ARCH KEXEC_ARCH_PPC
32#endif 32#endif
33 33
34#ifndef __ASSEMBLY__
35
34#ifdef CONFIG_KEXEC 36#ifdef CONFIG_KEXEC
35 37
36#ifndef __ASSEMBLY__
37#ifdef __powerpc64__ 38#ifdef __powerpc64__
38/* 39/*
39 * This function is responsible for capturing register states if coming 40 * This function is responsible for capturing register states if coming
@@ -123,8 +124,19 @@ extern int default_machine_kexec_prepare(struct kimage *image);
123extern void default_machine_crash_shutdown(struct pt_regs *regs); 124extern void default_machine_crash_shutdown(struct pt_regs *regs);
124 125
125extern void machine_kexec_simple(struct kimage *image); 126extern void machine_kexec_simple(struct kimage *image);
127extern int overlaps_crashkernel(unsigned long start, unsigned long size);
128extern void reserve_crashkernel(void);
129
130#else /* !CONFIG_KEXEC */
131
132static inline int overlaps_crashkernel(unsigned long start, unsigned long size)
133{
134 return 0;
135}
136
137static inline void reserve_crashkernel(void) { ; }
126 138
127#endif /* ! __ASSEMBLY__ */
128#endif /* CONFIG_KEXEC */ 139#endif /* CONFIG_KEXEC */
140#endif /* ! __ASSEMBLY__ */
129#endif /* __KERNEL__ */ 141#endif /* __KERNEL__ */
130#endif /* _ASM_POWERPC_KEXEC_H */ 142#endif /* _ASM_POWERPC_KEXEC_H */
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 0f9254c18914..73db1f71329d 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -9,7 +9,6 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/seq_file.h> 12#include <linux/seq_file.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/dma-mapping.h> 14#include <linux/dma-mapping.h>
@@ -238,6 +237,11 @@ struct machdep_calls {
238 */ 237 */
239 void (*machine_kexec)(struct kimage *image); 238 void (*machine_kexec)(struct kimage *image);
240#endif /* CONFIG_KEXEC */ 239#endif /* CONFIG_KEXEC */
240
241#ifdef CONFIG_PCI_MSI
242 int (*enable_msi)(struct pci_dev *pdev);
243 void (*disable_msi)(struct pci_dev *pdev);
244#endif /* CONFIG_PCI_MSI */
241}; 245};
242 246
243extern void power4_idle(void); 247extern void power4_idle(void);
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h
index 31f721994bd8..3a5ebe229af5 100644
--- a/include/asm-powerpc/mmu.h
+++ b/include/asm-powerpc/mmu.h
@@ -96,6 +96,8 @@ extern char initial_stab[];
96#define HPTE_R_FLAGS ASM_CONST(0x00000000000003ff) 96#define HPTE_R_FLAGS ASM_CONST(0x00000000000003ff)
97#define HPTE_R_PP ASM_CONST(0x0000000000000003) 97#define HPTE_R_PP ASM_CONST(0x0000000000000003)
98#define HPTE_R_N ASM_CONST(0x0000000000000004) 98#define HPTE_R_N ASM_CONST(0x0000000000000004)
99#define HPTE_R_C ASM_CONST(0x0000000000000080)
100#define HPTE_R_R ASM_CONST(0x0000000000000100)
99 101
100/* Values for PP (assumes Ks=0, Kp=1) */ 102/* Values for PP (assumes Ks=0, Kp=1) */
101/* pp0 will always be 0 for linux */ 103/* pp0 will always be 0 for linux */
@@ -163,6 +165,16 @@ struct mmu_psize_def
163extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT]; 165extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
164extern int mmu_linear_psize; 166extern int mmu_linear_psize;
165extern int mmu_virtual_psize; 167extern int mmu_virtual_psize;
168extern int mmu_vmalloc_psize;
169extern int mmu_io_psize;
170
171/*
172 * If the processor supports 64k normal pages but not 64k cache
173 * inhibited pages, we have to be prepared to switch processes
174 * to use 4k pages when they create cache-inhibited mappings.
175 * If this is the case, mmu_ci_restrictions will be set to 1.
176 */
177extern int mmu_ci_restrictions;
166 178
167#ifdef CONFIG_HUGETLB_PAGE 179#ifdef CONFIG_HUGETLB_PAGE
168/* 180/*
@@ -254,6 +266,7 @@ extern long iSeries_hpte_insert(unsigned long hpte_group,
254 266
255extern void stabs_alloc(void); 267extern void stabs_alloc(void);
256extern void slb_initialize(void); 268extern void slb_initialize(void);
269extern void slb_flush_and_rebolt(void);
257extern void stab_initialize(unsigned long stab); 270extern void stab_initialize(unsigned long stab);
258 271
259#endif /* __ASSEMBLY__ */ 272#endif /* __ASSEMBLY__ */
@@ -357,9 +370,12 @@ typedef unsigned long mm_context_id_t;
357 370
358typedef struct { 371typedef struct {
359 mm_context_id_t id; 372 mm_context_id_t id;
373 u16 user_psize; /* page size index */
374 u16 sllp; /* SLB entry page size encoding */
360#ifdef CONFIG_HUGETLB_PAGE 375#ifdef CONFIG_HUGETLB_PAGE
361 u16 low_htlb_areas, high_htlb_areas; 376 u16 low_htlb_areas, high_htlb_areas;
362#endif 377#endif
378 unsigned long vdso_base;
363} mm_context_t; 379} mm_context_t;
364 380
365 381
diff --git a/include/asm-powerpc/mmu_context.h b/include/asm-powerpc/mmu_context.h
index 1b8a25fd48f3..8c6b1a6d944f 100644
--- a/include/asm-powerpc/mmu_context.h
+++ b/include/asm-powerpc/mmu_context.h
@@ -20,16 +20,9 @@
20 * 2 of the License, or (at your option) any later version. 20 * 2 of the License, or (at your option) any later version.
21 */ 21 */
22 22
23/*
24 * Getting into a kernel thread, there is no valid user segment, mark
25 * paca->pgdir NULL so that SLB miss on user addresses will fault
26 */
27static inline void enter_lazy_tlb(struct mm_struct *mm, 23static inline void enter_lazy_tlb(struct mm_struct *mm,
28 struct task_struct *tsk) 24 struct task_struct *tsk)
29{ 25{
30#ifdef CONFIG_PPC_64K_PAGES
31 get_paca()->pgdir = NULL;
32#endif /* CONFIG_PPC_64K_PAGES */
33} 26}
34 27
35#define NO_CONTEXT 0 28#define NO_CONTEXT 0
@@ -52,13 +45,8 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
52 cpu_set(smp_processor_id(), next->cpu_vm_mask); 45 cpu_set(smp_processor_id(), next->cpu_vm_mask);
53 46
54 /* No need to flush userspace segments if the mm doesnt change */ 47 /* No need to flush userspace segments if the mm doesnt change */
55#ifdef CONFIG_PPC_64K_PAGES
56 if (prev == next && get_paca()->pgdir == next->pgd)
57 return;
58#else
59 if (prev == next) 48 if (prev == next)
60 return; 49 return;
61#endif /* CONFIG_PPC_64K_PAGES */
62 50
63#ifdef CONFIG_ALTIVEC 51#ifdef CONFIG_ALTIVEC
64 if (cpu_has_feature(CPU_FTR_ALTIVEC)) 52 if (cpu_has_feature(CPU_FTR_ALTIVEC))
diff --git a/include/asm-powerpc/mmzone.h b/include/asm-powerpc/mmzone.h
index 88d70bae7769..d484ca94cb7c 100644
--- a/include/asm-powerpc/mmzone.h
+++ b/include/asm-powerpc/mmzone.h
@@ -8,7 +8,6 @@
8#define _ASM_MMZONE_H_ 8#define _ASM_MMZONE_H_
9#ifdef __KERNEL__ 9#ifdef __KERNEL__
10 10
11#include <linux/config.h>
12 11
13/* 12/*
14 * generic non-linear memory support: 13 * generic non-linear memory support:
diff --git a/include/asm-powerpc/mpc86xx.h b/include/asm-powerpc/mpc86xx.h
new file mode 100644
index 000000000000..d0a6718d188b
--- /dev/null
+++ b/include/asm-powerpc/mpc86xx.h
@@ -0,0 +1,47 @@
1/*
2 * MPC86xx definitions
3 *
4 * Author: Jeff Brown
5 *
6 * Copyright 2004 Freescale Semiconductor, Inc
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#ifdef __KERNEL__
15#ifndef __ASM_POWERPC_MPC86xx_H__
16#define __ASM_POWERPC_MPC86xx_H__
17
18#include <linux/config.h>
19#include <asm/mmu.h>
20
21#ifdef CONFIG_PPC_86xx
22
23#ifdef CONFIG_MPC8641_HPCN
24#include <platforms/86xx/mpc8641_hpcn.h>
25#endif
26
27#define _IO_BASE isa_io_base
28#define _ISA_MEM_BASE isa_mem_base
29#ifdef CONFIG_PCI
30#define PCI_DRAM_OFFSET pci_dram_offset
31#else
32#define PCI_DRAM_OFFSET 0
33#endif
34
35#define CPU0_BOOT_RELEASE 0x01000000
36#define CPU1_BOOT_RELEASE 0x02000000
37#define CPU_ALL_RELEASED (CPU0_BOOT_RELEASE | CPU1_BOOT_RELEASE)
38#define MCM_PORT_CONFIG_OFFSET 0x1010
39
40/* Offset from CCSRBAR */
41#define MPC86xx_OPENPIC_OFFSET (0x40000)
42#define MPC86xx_MCM_OFFSET (0x00000)
43#define MPC86xx_MCM_SIZE (0x02000)
44
45#endif /* CONFIG_PPC_86xx */
46#endif /* __ASM_POWERPC_MPC86xx_H__ */
47#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index 6b9e78142f4f..f0d22ac34b96 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -22,6 +22,10 @@
22#define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000 22#define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000
23#define MPIC_GREG_GCONF_BASE_MASK 0x000fffff 23#define MPIC_GREG_GCONF_BASE_MASK 0x000fffff
24#define MPIC_GREG_GLOBAL_CONF_1 0x00030 24#define MPIC_GREG_GLOBAL_CONF_1 0x00030
25#define MPIC_GREG_GLOBAL_CONF_1_SIE 0x08000000
26#define MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK 0x70000000
27#define MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(r) \
28 (((r) << 28) & MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK)
25#define MPIC_GREG_VENDOR_0 0x00040 29#define MPIC_GREG_VENDOR_0 0x00040
26#define MPIC_GREG_VENDOR_1 0x00050 30#define MPIC_GREG_VENDOR_1 0x00050
27#define MPIC_GREG_VENDOR_2 0x00060 31#define MPIC_GREG_VENDOR_2 0x00060
@@ -284,6 +288,12 @@ extern int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs);
284/* This one gets to the primary mpic */ 288/* This one gets to the primary mpic */
285extern int mpic_get_irq(struct pt_regs *regs); 289extern int mpic_get_irq(struct pt_regs *regs);
286 290
291/* Set the EPIC clock ratio */
292void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio);
293
294/* Enable/Disable EPIC serial interrupt mode */
295void mpic_set_serial_int(struct mpic *mpic, int enable);
296
287/* global mpic for pSeries */ 297/* global mpic for pSeries */
288extern struct mpic *pSeries_mpic; 298extern struct mpic *pSeries_mpic;
289 299
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h
index 706325f99a84..2d4585f06209 100644
--- a/include/asm-powerpc/paca.h
+++ b/include/asm-powerpc/paca.h
@@ -16,7 +16,6 @@
16#define _ASM_POWERPC_PACA_H 16#define _ASM_POWERPC_PACA_H
17#ifdef __KERNEL__ 17#ifdef __KERNEL__
18 18
19#include <linux/config.h>
20#include <asm/types.h> 19#include <asm/types.h>
21#include <asm/lppaca.h> 20#include <asm/lppaca.h>
22#include <asm/mmu.h> 21#include <asm/mmu.h>
@@ -79,11 +78,9 @@ struct paca_struct {
79 u64 exmc[10]; /* used for machine checks */ 78 u64 exmc[10]; /* used for machine checks */
80 u64 exslb[10]; /* used for SLB/segment table misses 79 u64 exslb[10]; /* used for SLB/segment table misses
81 * on the linear mapping */ 80 * on the linear mapping */
82#ifdef CONFIG_PPC_64K_PAGES
83 pgd_t *pgdir;
84#endif /* CONFIG_PPC_64K_PAGES */
85 81
86 mm_context_t context; 82 mm_context_t context;
83 u16 vmalloc_sllp;
87 u16 slb_cache[SLB_CACHE_ENTRIES]; 84 u16 slb_cache[SLB_CACHE_ENTRIES];
88 u16 slb_cache_ptr; 85 u16 slb_cache_ptr;
89 86
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h
index 2fbecebe1c92..fb597b37c2a2 100644
--- a/include/asm-powerpc/page.h
+++ b/include/asm-powerpc/page.h
@@ -11,8 +11,8 @@
11 */ 11 */
12 12
13#ifdef __KERNEL__ 13#ifdef __KERNEL__
14#include <linux/config.h>
15#include <asm/asm-compat.h> 14#include <asm/asm-compat.h>
15#include <asm/kdump.h>
16 16
17/* 17/*
18 * On PPC32 page size is 4K. For PPC64 we support either 4K or 64K software 18 * On PPC32 page size is 4K. For PPC64 we support either 4K or 64K software
@@ -52,13 +52,6 @@
52 * If you want to test if something's a kernel address, use is_kernel_addr(). 52 * If you want to test if something's a kernel address, use is_kernel_addr().
53 */ 53 */
54 54
55#ifdef CONFIG_CRASH_DUMP
56/* Kdump kernel runs at 32 MB, change at your peril. */
57#define PHYSICAL_START 0x2000000
58#else
59#define PHYSICAL_START 0x0
60#endif
61
62#define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START) 55#define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START)
63#define KERNELBASE (PAGE_OFFSET + PHYSICAL_START) 56#define KERNELBASE (PAGE_OFFSET + PHYSICAL_START)
64 57
@@ -198,6 +191,9 @@ extern void copy_user_page(void *to, void *from, unsigned long vaddr,
198 struct page *p); 191 struct page *p);
199extern int page_is_ram(unsigned long pfn); 192extern int page_is_ram(unsigned long pfn);
200 193
194struct vm_area_struct;
195extern const char *arch_vma_name(struct vm_area_struct *vma);
196
201#include <asm-generic/memory_model.h> 197#include <asm-generic/memory_model.h>
202#endif /* __ASSEMBLY__ */ 198#endif /* __ASSEMBLY__ */
203 199
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index 38de92d41a14..4f55573762bb 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -6,6 +6,7 @@
6#include <asm-ppc/pci-bridge.h> 6#include <asm-ppc/pci-bridge.h>
7#else 7#else
8 8
9#include <linux/config.h>
9#include <linux/pci.h> 10#include <linux/pci.h>
10#include <linux/list.h> 11#include <linux/list.h>
11 12
@@ -22,6 +23,7 @@
22struct pci_controller { 23struct pci_controller {
23 struct pci_bus *bus; 24 struct pci_bus *bus;
24 char is_dynamic; 25 char is_dynamic;
26 int node;
25 void *arch_data; 27 void *arch_data;
26 struct list_head list_node; 28 struct list_head list_node;
27 29
@@ -78,12 +80,6 @@ struct pci_dn {
78 struct iommu_table *iommu_table; /* for phb's or bridges */ 80 struct iommu_table *iommu_table; /* for phb's or bridges */
79 struct pci_dev *pcidev; /* back-pointer to the pci device */ 81 struct pci_dev *pcidev; /* back-pointer to the pci device */
80 struct device_node *node; /* back-pointer to the device_node */ 82 struct device_node *node; /* back-pointer to the device_node */
81#ifdef CONFIG_PPC_ISERIES
82 struct list_head Device_List;
83 int Irq; /* Assigned IRQ */
84 int Flags; /* Possible flags(disable/bist)*/
85 u8 LogicalSlot; /* Hv Slot Index for Tces */
86#endif
87 u32 config_space[16]; /* saved PCI config space */ 83 u32 config_space[16]; /* saved PCI config space */
88}; 84};
89 85
@@ -171,6 +167,12 @@ static inline unsigned long pci_address_to_pio(phys_addr_t address)
171#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ 167#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */
172#define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ 168#define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */
173 169
170#ifdef CONFIG_NUMA
171#define PHB_SET_NODE(PHB, NODE) ((PHB)->node = (NODE))
172#else
173#define PHB_SET_NODE(PHB, NODE) ((PHB)->node = -1)
174#endif
175
174#endif /* CONFIG_PPC64 */ 176#endif /* CONFIG_PPC64 */
175#endif /* __KERNEL__ */ 177#endif /* __KERNEL__ */
176#endif 178#endif
diff --git a/include/asm-powerpc/pgtable-4k.h b/include/asm-powerpc/pgtable-4k.h
index b2e18629932a..e7036155672e 100644
--- a/include/asm-powerpc/pgtable-4k.h
+++ b/include/asm-powerpc/pgtable-4k.h
@@ -78,6 +78,8 @@
78 78
79#define pte_iterate_hashed_end() } while(0) 79#define pte_iterate_hashed_end() } while(0)
80 80
81#define pte_pagesize_index(pte) MMU_PAGE_4K
82
81/* 83/*
82 * 4-level page tables related bits 84 * 4-level page tables related bits
83 */ 85 */
diff --git a/include/asm-powerpc/pgtable-64k.h b/include/asm-powerpc/pgtable-64k.h
index 653915014dcd..4b7126c53f37 100644
--- a/include/asm-powerpc/pgtable-64k.h
+++ b/include/asm-powerpc/pgtable-64k.h
@@ -90,6 +90,8 @@
90 90
91#define pte_iterate_hashed_end() } while(0); } } while(0) 91#define pte_iterate_hashed_end() } while(0); } } while(0)
92 92
93#define pte_pagesize_index(pte) \
94 (((pte) & _PAGE_COMBO)? MMU_PAGE_4K: MMU_PAGE_64K)
93 95
94#endif /* __ASSEMBLY__ */ 96#endif /* __ASSEMBLY__ */
95#endif /* __KERNEL__ */ 97#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/pgtable.h b/include/asm-powerpc/pgtable.h
index e9f1f4627e6b..8dbf5ad8150f 100644
--- a/include/asm-powerpc/pgtable.h
+++ b/include/asm-powerpc/pgtable.h
@@ -12,7 +12,6 @@
12 */ 12 */
13 13
14#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
15#include <linux/config.h>
16#include <linux/stddef.h> 15#include <linux/stddef.h>
17#include <asm/processor.h> /* For TASK_SIZE */ 16#include <asm/processor.h> /* For TASK_SIZE */
18#include <asm/mmu.h> 17#include <asm/mmu.h>
@@ -47,8 +46,8 @@ struct mm_struct;
47/* 46/*
48 * Define the address range of the vmalloc VM area. 47 * Define the address range of the vmalloc VM area.
49 */ 48 */
50#define VMALLOC_START (0xD000000000000000ul) 49#define VMALLOC_START ASM_CONST(0xD000000000000000)
51#define VMALLOC_SIZE (0x80000000000UL) 50#define VMALLOC_SIZE ASM_CONST(0x80000000000)
52#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE) 51#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE)
53 52
54/* 53/*
@@ -413,12 +412,6 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
413 flush_tlb_pending(); 412 flush_tlb_pending();
414 } 413 }
415 pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS); 414 pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
416
417#ifdef CONFIG_PPC_64K_PAGES
418 if (mmu_virtual_psize != MMU_PAGE_64K)
419 pte = __pte(pte_val(pte) | _PAGE_COMBO);
420#endif /* CONFIG_PPC_64K_PAGES */
421
422 *ptep = pte; 415 *ptep = pte;
423} 416}
424 417
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h
index dd1c0a913d5f..a940cfe040da 100644
--- a/include/asm-powerpc/ppc_asm.h
+++ b/include/asm-powerpc/ppc_asm.h
@@ -5,7 +5,6 @@
5#define _ASM_POWERPC_PPC_ASM_H 5#define _ASM_POWERPC_PPC_ASM_H
6 6
7#include <linux/stringify.h> 7#include <linux/stringify.h>
8#include <linux/config.h>
9#include <asm/asm-compat.h> 8#include <asm/asm-compat.h>
10 9
11#ifndef __ASSEMBLY__ 10#ifndef __ASSEMBLY__
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h
index 93f83efeb310..22e54a2a6604 100644
--- a/include/asm-powerpc/processor.h
+++ b/include/asm-powerpc/processor.h
@@ -149,11 +149,11 @@ struct thread_struct {
149 unsigned int val; /* Floating point status */ 149 unsigned int val; /* Floating point status */
150 } fpscr; 150 } fpscr;
151 int fpexc_mode; /* floating-point exception mode */ 151 int fpexc_mode; /* floating-point exception mode */
152 unsigned int align_ctl; /* alignment handling control */
152#ifdef CONFIG_PPC64 153#ifdef CONFIG_PPC64
153 unsigned long start_tb; /* Start purr when proc switched in */ 154 unsigned long start_tb; /* Start purr when proc switched in */
154 unsigned long accum_tb; /* Total accumilated purr for process */ 155 unsigned long accum_tb; /* Total accumilated purr for process */
155#endif 156#endif
156 unsigned long vdso_base; /* base of the vDSO library */
157 unsigned long dabr; /* Data address breakpoint register */ 157 unsigned long dabr; /* Data address breakpoint register */
158#ifdef CONFIG_ALTIVEC 158#ifdef CONFIG_ALTIVEC
159 /* Complete AltiVec register set */ 159 /* Complete AltiVec register set */
@@ -190,7 +190,7 @@ struct thread_struct {
190 .fs = KERNEL_DS, \ 190 .fs = KERNEL_DS, \
191 .fpr = {0}, \ 191 .fpr = {0}, \
192 .fpscr = { .val = 0, }, \ 192 .fpscr = { .val = 0, }, \
193 .fpexc_mode = MSR_FE0|MSR_FE1, \ 193 .fpexc_mode = 0, \
194} 194}
195#endif 195#endif
196 196
@@ -212,6 +212,18 @@ unsigned long get_wchan(struct task_struct *p);
212extern int get_fpexc_mode(struct task_struct *tsk, unsigned long adr); 212extern int get_fpexc_mode(struct task_struct *tsk, unsigned long adr);
213extern int set_fpexc_mode(struct task_struct *tsk, unsigned int val); 213extern int set_fpexc_mode(struct task_struct *tsk, unsigned int val);
214 214
215#define GET_ENDIAN(tsk, adr) get_endian((tsk), (adr))
216#define SET_ENDIAN(tsk, val) set_endian((tsk), (val))
217
218extern int get_endian(struct task_struct *tsk, unsigned long adr);
219extern int set_endian(struct task_struct *tsk, unsigned int val);
220
221#define GET_UNALIGN_CTL(tsk, adr) get_unalign_ctl((tsk), (adr))
222#define SET_UNALIGN_CTL(tsk, val) set_unalign_ctl((tsk), (val))
223
224extern int get_unalign_ctl(struct task_struct *tsk, unsigned long adr);
225extern int set_unalign_ctl(struct task_struct *tsk, unsigned int val);
226
215static inline unsigned int __unpack_fe01(unsigned long msr_bits) 227static inline unsigned int __unpack_fe01(unsigned long msr_bits)
216{ 228{
217 return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8); 229 return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 97ef1cd71a4d..010d186d095b 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -15,7 +15,6 @@
15 * as published by the Free Software Foundation; either version 15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version. 16 * 2 of the License, or (at your option) any later version.
17 */ 17 */
18#include <linux/config.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/proc_fs.h> 19#include <linux/proc_fs.h>
21#include <asm/atomic.h> 20#include <asm/atomic.h>
@@ -230,7 +229,16 @@ extern int of_address_to_resource(struct device_node *dev, int index,
230extern int of_pci_address_to_resource(struct device_node *dev, int bar, 229extern int of_pci_address_to_resource(struct device_node *dev, int bar,
231 struct resource *r); 230 struct resource *r);
232 231
232/* Parse the ibm,dma-window property of an OF node into the busno, phys and
233 * size parameters.
234 */
235void of_parse_dma_window(struct device_node *dn, unsigned char *dma_window_prop,
236 unsigned long *busno, unsigned long *phys, unsigned long *size);
237
233extern void kdump_move_device_tree(void); 238extern void kdump_move_device_tree(void);
234 239
240/* CPU OF node matching */
241struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
242
235#endif /* __KERNEL__ */ 243#endif /* __KERNEL__ */
236#endif /* _POWERPC_PROM_H */ 244#endif /* _POWERPC_PROM_H */
diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h
index 9c550b314823..dc4cb9cc73a1 100644
--- a/include/asm-powerpc/ptrace.h
+++ b/include/asm-powerpc/ptrace.h
@@ -229,13 +229,13 @@ do { \
229#define PTRACE_GET_DEBUGREG 25 229#define PTRACE_GET_DEBUGREG 25
230#define PTRACE_SET_DEBUGREG 26 230#define PTRACE_SET_DEBUGREG 26
231 231
232#ifdef __powerpc64__
233/* Additional PTRACE requests implemented on PowerPC. */ 232/* Additional PTRACE requests implemented on PowerPC. */
234#define PPC_PTRACE_GETREGS 0x99 /* Get GPRs 0 - 31 */ 233#define PPC_PTRACE_GETREGS 0x99 /* Get GPRs 0 - 31 */
235#define PPC_PTRACE_SETREGS 0x98 /* Set GPRs 0 - 31 */ 234#define PPC_PTRACE_SETREGS 0x98 /* Set GPRs 0 - 31 */
236#define PPC_PTRACE_GETFPREGS 0x97 /* Get FPRs 0 - 31 */ 235#define PPC_PTRACE_GETFPREGS 0x97 /* Get FPRs 0 - 31 */
237#define PPC_PTRACE_SETFPREGS 0x96 /* Set FPRs 0 - 31 */ 236#define PPC_PTRACE_SETFPREGS 0x96 /* Set FPRs 0 - 31 */
238 237
238#ifdef __powerpc64__
239/* Calls to trace a 64bit program from a 32bit program */ 239/* Calls to trace a 64bit program from a 32bit program */
240#define PPC_PTRACE_PEEKTEXT_3264 0x95 240#define PPC_PTRACE_PEEKTEXT_3264 0x95
241#define PPC_PTRACE_PEEKDATA_3264 0x94 241#define PPC_PTRACE_PEEKDATA_3264 0x94
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h
index bd467bf5cf5a..cf73475a0c69 100644
--- a/include/asm-powerpc/reg.h
+++ b/include/asm-powerpc/reg.h
@@ -93,8 +93,8 @@
93#define MSR_LE __MASK(MSR_LE_LG) /* Little Endian */ 93#define MSR_LE __MASK(MSR_LE_LG) /* Little Endian */
94 94
95#ifdef CONFIG_PPC64 95#ifdef CONFIG_PPC64
96#define MSR_ MSR_ME | MSR_RI | MSR_IR | MSR_DR | MSR_ISF 96#define MSR_ MSR_ME | MSR_RI | MSR_IR | MSR_DR | MSR_ISF |MSR_HV
97#define MSR_KERNEL MSR_ | MSR_SF | MSR_HV 97#define MSR_KERNEL MSR_ | MSR_SF
98 98
99#define MSR_USER32 MSR_ | MSR_PR | MSR_EE 99#define MSR_USER32 MSR_ | MSR_PR | MSR_EE
100#define MSR_USER64 MSR_USER32 | MSR_SF 100#define MSR_USER64 MSR_USER32 | MSR_SF
@@ -153,7 +153,7 @@
153#define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ 153#define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */
154#define DABR_TRANSLATION (1UL << 2) 154#define DABR_TRANSLATION (1UL << 2)
155#define SPRN_DAR 0x013 /* Data Address Register */ 155#define SPRN_DAR 0x013 /* Data Address Register */
156#define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ 156#define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */
157#define DSISR_NOHPTE 0x40000000 /* no translation found */ 157#define DSISR_NOHPTE 0x40000000 /* no translation found */
158#define DSISR_PROTFAULT 0x08000000 /* protection fault */ 158#define DSISR_PROTFAULT 0x08000000 /* protection fault */
159#define DSISR_ISSTORE 0x02000000 /* access was a store */ 159#define DSISR_ISSTORE 0x02000000 /* access was a store */
@@ -258,16 +258,16 @@
258#define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ 258#define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */
259#define SPRN_HID4 0x3F4 /* 970 HID4 */ 259#define SPRN_HID4 0x3F4 /* 970 HID4 */
260#define SPRN_HID5 0x3F6 /* 970 HID5 */ 260#define SPRN_HID5 0x3F6 /* 970 HID5 */
261#define SPRN_HID6 0x3F9 /* BE HID 6 */ 261#define SPRN_HID6 0x3F9 /* BE HID 6 */
262#define HID6_LB (0x0F<<12) /* Concurrent Large Page Modes */ 262#define HID6_LB (0x0F<<12) /* Concurrent Large Page Modes */
263#define HID6_DLP (1<<20) /* Disable all large page modes (4K only) */ 263#define HID6_DLP (1<<20) /* Disable all large page modes (4K only) */
264#define SPRN_TSC_CELL 0x399 /* Thread switch control on Cell */ 264#define SPRN_TSC_CELL 0x399 /* Thread switch control on Cell */
265#define TSC_CELL_DEC_ENABLE_0 0x400000 /* Decrementer Interrupt */ 265#define TSC_CELL_DEC_ENABLE_0 0x400000 /* Decrementer Interrupt */
266#define TSC_CELL_DEC_ENABLE_1 0x200000 /* Decrementer Interrupt */ 266#define TSC_CELL_DEC_ENABLE_1 0x200000 /* Decrementer Interrupt */
267#define TSC_CELL_EE_ENABLE 0x100000 /* External Interrupt */ 267#define TSC_CELL_EE_ENABLE 0x100000 /* External Interrupt */
268#define TSC_CELL_EE_BOOST 0x080000 /* External Interrupt Boost */ 268#define TSC_CELL_EE_BOOST 0x080000 /* External Interrupt Boost */
269#define SPRN_TSC 0x3FD /* Thread switch control on others */ 269#define SPRN_TSC 0x3FD /* Thread switch control on others */
270#define SPRN_TST 0x3FC /* Thread switch timeout on others */ 270#define SPRN_TST 0x3FC /* Thread switch timeout on others */
271#if !defined(SPRN_IAC1) && !defined(SPRN_IAC2) 271#if !defined(SPRN_IAC1) && !defined(SPRN_IAC2)
272#define SPRN_IAC1 0x3F4 /* Instruction Address Compare 1 */ 272#define SPRN_IAC1 0x3F4 /* Instruction Address Compare 1 */
273#define SPRN_IAC2 0x3F5 /* Instruction Address Compare 2 */ 273#define SPRN_IAC2 0x3F5 /* Instruction Address Compare 2 */
@@ -362,7 +362,7 @@
362#endif 362#endif
363#define SPRN_PTEHI 0x3D5 /* 981 7450 PTE HI word (S/W TLB load) */ 363#define SPRN_PTEHI 0x3D5 /* 981 7450 PTE HI word (S/W TLB load) */
364#define SPRN_PTELO 0x3D6 /* 982 7450 PTE LO word (S/W TLB load) */ 364#define SPRN_PTELO 0x3D6 /* 982 7450 PTE LO word (S/W TLB load) */
365#define SPRN_PURR 0x135 /* Processor Utilization of Resources Reg */ 365#define SPRN_PURR 0x135 /* Processor Utilization of Resources Reg */
366#define SPRN_PVR 0x11F /* Processor Version Register */ 366#define SPRN_PVR 0x11F /* Processor Version Register */
367#define SPRN_RPA 0x3D6 /* Required Physical Address Register */ 367#define SPRN_RPA 0x3D6 /* Required Physical Address Register */
368#define SPRN_SDA 0x3BF /* Sampled Data Address Register */ 368#define SPRN_SDA 0x3BF /* Sampled Data Address Register */
@@ -386,6 +386,8 @@
386#define SRR1_WAKEMT 0x00280000 /* mtctrl */ 386#define SRR1_WAKEMT 0x00280000 /* mtctrl */
387#define SRR1_WAKEDEC 0x00180000 /* Decrementer interrupt */ 387#define SRR1_WAKEDEC 0x00180000 /* Decrementer interrupt */
388#define SRR1_WAKETHERM 0x00100000 /* Thermal management interrupt */ 388#define SRR1_WAKETHERM 0x00100000 /* Thermal management interrupt */
389#define SPRN_HSRR0 0x13A /* Save/Restore Register 0 */
390#define SPRN_HSRR1 0x13B /* Save/Restore Register 1 */
389 391
390#ifndef SPRN_SVR 392#ifndef SPRN_SVR
391#define SPRN_SVR 0x11E /* System Version Register */ 393#define SPRN_SVR 0x11E /* System Version Register */
@@ -443,6 +445,10 @@
443#define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */ 445#define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */
444#define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */ 446#define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */
445#define MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */ 447#define MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */
448#define POWER6_MMCRA_SIHV 0x0000040000000000ULL
449#define POWER6_MMCRA_SIPR 0x0000020000000000ULL
450#define POWER6_MMCRA_THRM 0x00000020UL
451#define POWER6_MMCRA_OTHER 0x0000000EUL
446#define SPRN_PMC1 787 452#define SPRN_PMC1 787
447#define SPRN_PMC2 788 453#define SPRN_PMC2 788
448#define SPRN_PMC3 789 454#define SPRN_PMC3 789
@@ -495,6 +501,19 @@
495#define MMCR0_PMC2_LOADMISSTIME 0x5 501#define MMCR0_PMC2_LOADMISSTIME 0x5
496#endif 502#endif
497 503
504/*
505 * An mtfsf instruction with the L bit set. On CPUs that support this a
506 * full 64bits of FPSCR is restored and on other CPUs it is ignored.
507 *
508 * Until binutils gets the new form of mtfsf, hardwire the instruction.
509 */
510#ifdef CONFIG_PPC64
511#define MTFSF_L(REG) \
512 .long (0xfc00058e | ((0xff) << 17) | ((REG) << 11) | (1 << 25))
513#else
514#define MTFSF_L(REG) mtfsf 0xff, (REG)
515#endif
516
498/* Processor Version Register (PVR) field extraction */ 517/* Processor Version Register (PVR) field extraction */
499 518
500#define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */ 519#define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */
@@ -559,20 +578,20 @@
559 578
560/* 64-bit processors */ 579/* 64-bit processors */
561/* XXX the prefix should be PVR_, we'll do a global sweep to fix it one day */ 580/* XXX the prefix should be PVR_, we'll do a global sweep to fix it one day */
562#define PV_NORTHSTAR 0x0033 581#define PV_NORTHSTAR 0x0033
563#define PV_PULSAR 0x0034 582#define PV_PULSAR 0x0034
564#define PV_POWER4 0x0035 583#define PV_POWER4 0x0035
565#define PV_ICESTAR 0x0036 584#define PV_ICESTAR 0x0036
566#define PV_SSTAR 0x0037 585#define PV_SSTAR 0x0037
567#define PV_POWER4p 0x0038 586#define PV_POWER4p 0x0038
568#define PV_970 0x0039 587#define PV_970 0x0039
569#define PV_POWER5 0x003A 588#define PV_POWER5 0x003A
570#define PV_POWER5p 0x003B 589#define PV_POWER5p 0x003B
571#define PV_970FX 0x003C 590#define PV_970FX 0x003C
572#define PV_630 0x0040 591#define PV_630 0x0040
573#define PV_630p 0x0041 592#define PV_630p 0x0041
574#define PV_970MP 0x0044 593#define PV_970MP 0x0044
575#define PV_BE 0x0070 594#define PV_BE 0x0070
576 595
577/* 596/*
578 * Number of entries in the SLB. If this ever changes we should handle 597 * Number of entries in the SLB. If this ever changes we should handle
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h
index f43c6835e62a..02e213e3d69f 100644
--- a/include/asm-powerpc/rtas.h
+++ b/include/asm-powerpc/rtas.h
@@ -24,6 +24,7 @@
24#define RTAS_RMOBUF_MAX (64 * 1024) 24#define RTAS_RMOBUF_MAX (64 * 1024)
25 25
26/* RTAS return status codes */ 26/* RTAS return status codes */
27#define RTAS_NOT_SUSPENDABLE -9004
27#define RTAS_BUSY -2 /* RTAS Busy */ 28#define RTAS_BUSY -2 /* RTAS Busy */
28#define RTAS_EXTENDED_DELAY_MIN 9900 29#define RTAS_EXTENDED_DELAY_MIN 9900
29#define RTAS_EXTENDED_DELAY_MAX 9905 30#define RTAS_EXTENDED_DELAY_MAX 9905
@@ -177,12 +178,8 @@ extern unsigned long rtas_get_boot_time(void);
177extern void rtas_get_rtc_time(struct rtc_time *rtc_time); 178extern void rtas_get_rtc_time(struct rtc_time *rtc_time);
178extern int rtas_set_rtc_time(struct rtc_time *rtc_time); 179extern int rtas_set_rtc_time(struct rtc_time *rtc_time);
179 180
180/* Given an RTAS status code of 9900..9905 compute the hinted delay */ 181extern unsigned int rtas_busy_delay_time(int status);
181unsigned int rtas_extended_busy_delay_time(int status); 182extern unsigned int rtas_busy_delay(int status);
182static inline int rtas_is_extended_busy(int status)
183{
184 return status >= 9900 && status <= 9909;
185}
186 183
187extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal); 184extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
188 185
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h
index 4a716f707cf6..068f119aa298 100644
--- a/include/asm-powerpc/smp.h
+++ b/include/asm-powerpc/smp.h
@@ -17,7 +17,6 @@
17#define _ASM_POWERPC_SMP_H 17#define _ASM_POWERPC_SMP_H
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19 19
20#include <linux/config.h>
21#include <linux/threads.h> 20#include <linux/threads.h>
22#include <linux/cpumask.h> 21#include <linux/cpumask.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
diff --git a/include/asm-powerpc/smu.h b/include/asm-powerpc/smu.h
index 2dc93632f210..51e65fc46a03 100644
--- a/include/asm-powerpc/smu.h
+++ b/include/asm-powerpc/smu.h
@@ -5,7 +5,6 @@
5 * Definitions for talking to the SMU chip in newer G5 PowerMacs 5 * Definitions for talking to the SMU chip in newer G5 PowerMacs
6 */ 6 */
7#ifdef __KERNEL__ 7#ifdef __KERNEL__
8#include <linux/config.h>
9#include <linux/list.h> 8#include <linux/list.h>
10#endif 9#endif
11#include <linux/types.h> 10#include <linux/types.h>
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index 7cfcff3ef027..9609d3ee8798 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -24,9 +24,8 @@
24#define _SPU_H 24#define _SPU_H
25#ifdef __KERNEL__ 25#ifdef __KERNEL__
26 26
27#include <linux/config.h>
28#include <linux/kref.h>
29#include <linux/workqueue.h> 27#include <linux/workqueue.h>
28#include <linux/sysdev.h>
30 29
31#define LS_SIZE (256 * 1024) 30#define LS_SIZE (256 * 1024)
32#define LS_ADDR_MASK (LS_SIZE - 1) 31#define LS_ADDR_MASK (LS_SIZE - 1)
@@ -123,7 +122,6 @@ struct spu {
123 u64 flags; 122 u64 flags;
124 u64 dar; 123 u64 dar;
125 u64 dsisr; 124 u64 dsisr;
126 struct kref kref;
127 size_t ls_size; 125 size_t ls_size;
128 unsigned int slb_replace; 126 unsigned int slb_replace;
129 struct mm_struct *mm; 127 struct mm_struct *mm;
@@ -135,7 +133,6 @@ struct spu {
135 int class_0_pending; 133 int class_0_pending;
136 spinlock_t register_lock; 134 spinlock_t register_lock;
137 135
138 u32 stop_code;
139 void (* wbox_callback)(struct spu *spu); 136 void (* wbox_callback)(struct spu *spu);
140 void (* ibox_callback)(struct spu *spu); 137 void (* ibox_callback)(struct spu *spu);
141 void (* stop_callback)(struct spu *spu); 138 void (* stop_callback)(struct spu *spu);
@@ -144,6 +141,8 @@ struct spu {
144 char irq_c0[8]; 141 char irq_c0[8];
145 char irq_c1[8]; 142 char irq_c1[8];
146 char irq_c2[8]; 143 char irq_c2[8];
144
145 struct sys_device sysdev;
147}; 146};
148 147
149struct spu *spu_alloc(void); 148struct spu *spu_alloc(void);
@@ -182,29 +181,6 @@ static inline void unregister_spu_syscalls(struct spufs_calls *calls)
182#endif /* MODULE */ 181#endif /* MODULE */
183 182
184 183
185/* access to priv1 registers */
186void spu_int_mask_and(struct spu *spu, int class, u64 mask);
187void spu_int_mask_or(struct spu *spu, int class, u64 mask);
188void spu_int_mask_set(struct spu *spu, int class, u64 mask);
189u64 spu_int_mask_get(struct spu *spu, int class);
190void spu_int_stat_clear(struct spu *spu, int class, u64 stat);
191u64 spu_int_stat_get(struct spu *spu, int class);
192void spu_int_route_set(struct spu *spu, u64 route);
193u64 spu_mfc_dar_get(struct spu *spu);
194u64 spu_mfc_dsisr_get(struct spu *spu);
195void spu_mfc_dsisr_set(struct spu *spu, u64 dsisr);
196void spu_mfc_sdr_set(struct spu *spu, u64 sdr);
197void spu_mfc_sr1_set(struct spu *spu, u64 sr1);
198u64 spu_mfc_sr1_get(struct spu *spu);
199void spu_mfc_tclass_id_set(struct spu *spu, u64 tclass_id);
200u64 spu_mfc_tclass_id_get(struct spu *spu);
201void spu_tlb_invalidate(struct spu *spu);
202void spu_resource_allocation_groupID_set(struct spu *spu, u64 id);
203u64 spu_resource_allocation_groupID_get(struct spu *spu);
204void spu_resource_allocation_enable_set(struct spu *spu, u64 enable);
205u64 spu_resource_allocation_enable_get(struct spu *spu);
206
207
208/* 184/*
209 * This defines the Local Store, Problem Area and Privlege Area of an SPU. 185 * This defines the Local Store, Problem Area and Privlege Area of an SPU.
210 */ 186 */
diff --git a/include/asm-powerpc/spu_csa.h b/include/asm-powerpc/spu_csa.h
index ba18d7d4dde2..964c2d38ccb7 100644
--- a/include/asm-powerpc/spu_csa.h
+++ b/include/asm-powerpc/spu_csa.h
@@ -86,10 +86,18 @@ struct spu_lscsa {
86 struct spu_reg128 event_mask; 86 struct spu_reg128 event_mask;
87 struct spu_reg128 srr0; 87 struct spu_reg128 srr0;
88 struct spu_reg128 stopped_status; 88 struct spu_reg128 stopped_status;
89 struct spu_reg128 pad[119]; /* 'ls' must be page-aligned. */ 89
90 unsigned char ls[LS_SIZE]; 90 /*
91 * 'ls' must be page-aligned on all configurations.
92 * Since we don't want to rely on having the spu-gcc
93 * installed to build the kernel and this structure
94 * is used in the SPU-side code, make it 64k-page
95 * aligned for now.
96 */
97 unsigned char ls[LS_SIZE] __attribute__((aligned(65536)));
91}; 98};
92 99
100#ifndef __SPU__
93/* 101/*
94 * struct spu_problem_collapsed - condensed problem state area, w/o pads. 102 * struct spu_problem_collapsed - condensed problem state area, w/o pads.
95 */ 103 */
@@ -250,6 +258,7 @@ extern int spu_restore(struct spu_state *new, struct spu *spu);
250extern int spu_switch(struct spu_state *prev, struct spu_state *new, 258extern int spu_switch(struct spu_state *prev, struct spu_state *new,
251 struct spu *spu); 259 struct spu *spu);
252 260
261#endif /* !__SPU__ */
253#endif /* __KERNEL__ */ 262#endif /* __KERNEL__ */
254#endif /* !__ASSEMBLY__ */ 263#endif /* !__ASSEMBLY__ */
255#endif /* _SPU_CSA_H_ */ 264#endif /* _SPU_CSA_H_ */
diff --git a/include/asm-powerpc/spu_priv1.h b/include/asm-powerpc/spu_priv1.h
new file mode 100644
index 000000000000..300c458b6d06
--- /dev/null
+++ b/include/asm-powerpc/spu_priv1.h
@@ -0,0 +1,182 @@
1/*
2 * Defines an spu hypervisor abstraction layer.
3 *
4 * Copyright 2006 Sony Corp.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#if !defined(_SPU_PRIV1_H)
21#define _SPU_PRIV1_H
22#if defined(__KERNEL__)
23
24struct spu;
25
26/* access to priv1 registers */
27
28struct spu_priv1_ops
29{
30 void (*int_mask_and) (struct spu *spu, int class, u64 mask);
31 void (*int_mask_or) (struct spu *spu, int class, u64 mask);
32 void (*int_mask_set) (struct spu *spu, int class, u64 mask);
33 u64 (*int_mask_get) (struct spu *spu, int class);
34 void (*int_stat_clear) (struct spu *spu, int class, u64 stat);
35 u64 (*int_stat_get) (struct spu *spu, int class);
36 void (*cpu_affinity_set) (struct spu *spu, int cpu);
37 u64 (*mfc_dar_get) (struct spu *spu);
38 u64 (*mfc_dsisr_get) (struct spu *spu);
39 void (*mfc_dsisr_set) (struct spu *spu, u64 dsisr);
40 void (*mfc_sdr_set) (struct spu *spu, u64 sdr);
41 void (*mfc_sr1_set) (struct spu *spu, u64 sr1);
42 u64 (*mfc_sr1_get) (struct spu *spu);
43 void (*mfc_tclass_id_set) (struct spu *spu, u64 tclass_id);
44 u64 (*mfc_tclass_id_get) (struct spu *spu);
45 void (*tlb_invalidate) (struct spu *spu);
46 void (*resource_allocation_groupID_set) (struct spu *spu, u64 id);
47 u64 (*resource_allocation_groupID_get) (struct spu *spu);
48 void (*resource_allocation_enable_set) (struct spu *spu, u64 enable);
49 u64 (*resource_allocation_enable_get) (struct spu *spu);
50};
51
52extern const struct spu_priv1_ops* spu_priv1_ops;
53
54static inline void
55spu_int_mask_and (struct spu *spu, int class, u64 mask)
56{
57 spu_priv1_ops->int_mask_and(spu, class, mask);
58}
59
60static inline void
61spu_int_mask_or (struct spu *spu, int class, u64 mask)
62{
63 spu_priv1_ops->int_mask_or(spu, class, mask);
64}
65
66static inline void
67spu_int_mask_set (struct spu *spu, int class, u64 mask)
68{
69 spu_priv1_ops->int_mask_set(spu, class, mask);
70}
71
72static inline u64
73spu_int_mask_get (struct spu *spu, int class)
74{
75 return spu_priv1_ops->int_mask_get(spu, class);
76}
77
78static inline void
79spu_int_stat_clear (struct spu *spu, int class, u64 stat)
80{
81 spu_priv1_ops->int_stat_clear(spu, class, stat);
82}
83
84static inline u64
85spu_int_stat_get (struct spu *spu, int class)
86{
87 return spu_priv1_ops->int_stat_get (spu, class);
88}
89
90static inline void
91spu_cpu_affinity_set (struct spu *spu, int cpu)
92{
93 spu_priv1_ops->cpu_affinity_set(spu, cpu);
94}
95
96static inline u64
97spu_mfc_dar_get (struct spu *spu)
98{
99 return spu_priv1_ops->mfc_dar_get(spu);
100}
101
102static inline u64
103spu_mfc_dsisr_get (struct spu *spu)
104{
105 return spu_priv1_ops->mfc_dsisr_get(spu);
106}
107
108static inline void
109spu_mfc_dsisr_set (struct spu *spu, u64 dsisr)
110{
111 spu_priv1_ops->mfc_dsisr_set(spu, dsisr);
112}
113
114static inline void
115spu_mfc_sdr_set (struct spu *spu, u64 sdr)
116{
117 spu_priv1_ops->mfc_sdr_set(spu, sdr);
118}
119
120static inline void
121spu_mfc_sr1_set (struct spu *spu, u64 sr1)
122{
123 spu_priv1_ops->mfc_sr1_set(spu, sr1);
124}
125
126static inline u64
127spu_mfc_sr1_get (struct spu *spu)
128{
129 return spu_priv1_ops->mfc_sr1_get(spu);
130}
131
132static inline void
133spu_mfc_tclass_id_set (struct spu *spu, u64 tclass_id)
134{
135 spu_priv1_ops->mfc_tclass_id_set(spu, tclass_id);
136}
137
138static inline u64
139spu_mfc_tclass_id_get (struct spu *spu)
140{
141 return spu_priv1_ops->mfc_tclass_id_get(spu);
142}
143
144static inline void
145spu_tlb_invalidate (struct spu *spu)
146{
147 spu_priv1_ops->tlb_invalidate(spu);
148}
149
150static inline void
151spu_resource_allocation_groupID_set (struct spu *spu, u64 id)
152{
153 spu_priv1_ops->resource_allocation_groupID_set(spu, id);
154}
155
156static inline u64
157spu_resource_allocation_groupID_get (struct spu *spu)
158{
159 return spu_priv1_ops->resource_allocation_groupID_get(spu);
160}
161
162static inline void
163spu_resource_allocation_enable_set (struct spu *spu, u64 enable)
164{
165 spu_priv1_ops->resource_allocation_enable_set(spu, enable);
166}
167
168static inline u64
169spu_resource_allocation_enable_get (struct spu *spu)
170{
171 return spu_priv1_ops->resource_allocation_enable_get(spu);
172}
173
174/* The declarations folowing are put here for convenience
175 * and only intended to be used by the platform setup code
176 * for initializing spu_priv1_ops.
177 */
178
179extern const struct spu_priv1_ops spu_priv1_mmio_ops;
180
181#endif /* __KERNEL__ */
182#endif
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h
new file mode 100644
index 000000000000..eac85ce101b6
--- /dev/null
+++ b/include/asm-powerpc/systbl.h
@@ -0,0 +1,306 @@
1/*
2 * List of powerpc syscalls. For the meaning of the _SPU suffix see
3 * arch/powerpc/platforms/cell/spu_callbacks.c
4 */
5
6SYSCALL(restart_syscall)
7SYSCALL(exit)
8PPC_SYS(fork)
9SYSCALL_SPU(read)
10SYSCALL_SPU(write)
11COMPAT_SYS_SPU(open)
12SYSCALL_SPU(close)
13COMPAT_SYS_SPU(waitpid)
14COMPAT_SYS_SPU(creat)
15SYSCALL_SPU(link)
16SYSCALL_SPU(unlink)
17COMPAT_SYS(execve)
18SYSCALL_SPU(chdir)
19COMPAT_SYS_SPU(time)
20SYSCALL_SPU(mknod)
21SYSCALL_SPU(chmod)
22SYSCALL_SPU(lchown)
23SYSCALL(ni_syscall)
24OLDSYS(stat)
25SYSX_SPU(sys_lseek,ppc32_lseek,sys_lseek)
26SYSCALL_SPU(getpid)
27COMPAT_SYS(mount)
28SYSX(sys_ni_syscall,sys_oldumount,sys_oldumount)
29SYSCALL_SPU(setuid)
30SYSCALL_SPU(getuid)
31COMPAT_SYS_SPU(stime)
32COMPAT_SYS(ptrace)
33SYSCALL_SPU(alarm)
34OLDSYS(fstat)
35COMPAT_SYS(pause)
36COMPAT_SYS(utime)
37SYSCALL(ni_syscall)
38SYSCALL(ni_syscall)
39COMPAT_SYS_SPU(access)
40COMPAT_SYS_SPU(nice)
41SYSCALL(ni_syscall)
42SYSCALL_SPU(sync)
43COMPAT_SYS_SPU(kill)
44SYSCALL_SPU(rename)
45COMPAT_SYS_SPU(mkdir)
46SYSCALL_SPU(rmdir)
47SYSCALL_SPU(dup)
48SYSCALL_SPU(pipe)
49COMPAT_SYS_SPU(times)
50SYSCALL(ni_syscall)
51SYSCALL_SPU(brk)
52SYSCALL_SPU(setgid)
53SYSCALL_SPU(getgid)
54SYSCALL(signal)
55SYSCALL_SPU(geteuid)
56SYSCALL_SPU(getegid)
57SYSCALL(acct)
58SYSCALL(umount)
59SYSCALL(ni_syscall)
60COMPAT_SYS_SPU(ioctl)
61COMPAT_SYS_SPU(fcntl)
62SYSCALL(ni_syscall)
63COMPAT_SYS_SPU(setpgid)
64SYSCALL(ni_syscall)
65SYSX(sys_ni_syscall,sys_olduname, sys_olduname)
66COMPAT_SYS_SPU(umask)
67SYSCALL_SPU(chroot)
68SYSCALL(ustat)
69SYSCALL_SPU(dup2)
70SYSCALL_SPU(getppid)
71SYSCALL_SPU(getpgrp)
72SYSCALL_SPU(setsid)
73SYS32ONLY(sigaction)
74SYSCALL_SPU(sgetmask)
75COMPAT_SYS_SPU(ssetmask)
76SYSCALL_SPU(setreuid)
77SYSCALL_SPU(setregid)
78SYS32ONLY(sigsuspend)
79COMPAT_SYS(sigpending)
80COMPAT_SYS_SPU(sethostname)
81COMPAT_SYS_SPU(setrlimit)
82COMPAT_SYS(old_getrlimit)
83COMPAT_SYS_SPU(getrusage)
84COMPAT_SYS_SPU(gettimeofday)
85COMPAT_SYS_SPU(settimeofday)
86COMPAT_SYS_SPU(getgroups)
87COMPAT_SYS_SPU(setgroups)
88SYSX(sys_ni_syscall,sys_ni_syscall,ppc_select)
89SYSCALL_SPU(symlink)
90OLDSYS(lstat)
91COMPAT_SYS_SPU(readlink)
92SYSCALL(uselib)
93SYSCALL(swapon)
94SYSCALL(reboot)
95SYSX(sys_ni_syscall,old32_readdir,old_readdir)
96SYSCALL_SPU(mmap)
97SYSCALL_SPU(munmap)
98SYSCALL_SPU(truncate)
99SYSCALL_SPU(ftruncate)
100SYSCALL_SPU(fchmod)
101SYSCALL_SPU(fchown)
102COMPAT_SYS_SPU(getpriority)
103COMPAT_SYS_SPU(setpriority)
104SYSCALL(ni_syscall)
105COMPAT_SYS(statfs)
106COMPAT_SYS(fstatfs)
107SYSCALL(ni_syscall)
108COMPAT_SYS_SPU(socketcall)
109COMPAT_SYS_SPU(syslog)
110COMPAT_SYS_SPU(setitimer)
111COMPAT_SYS_SPU(getitimer)
112COMPAT_SYS_SPU(newstat)
113COMPAT_SYS_SPU(newlstat)
114COMPAT_SYS_SPU(newfstat)
115SYSX(sys_ni_syscall,sys_uname,sys_uname)
116SYSCALL(ni_syscall)
117SYSCALL_SPU(vhangup)
118SYSCALL(ni_syscall)
119SYSCALL(ni_syscall)
120COMPAT_SYS_SPU(wait4)
121SYSCALL(swapoff)
122COMPAT_SYS_SPU(sysinfo)
123COMPAT_SYS(ipc)
124SYSCALL_SPU(fsync)
125SYS32ONLY(sigreturn)
126PPC_SYS(clone)
127COMPAT_SYS_SPU(setdomainname)
128PPC_SYS_SPU(newuname)
129SYSCALL(ni_syscall)
130COMPAT_SYS_SPU(adjtimex)
131SYSCALL_SPU(mprotect)
132SYSX(sys_ni_syscall,compat_sys_sigprocmask,sys_sigprocmask)
133SYSCALL(ni_syscall)
134SYSCALL(init_module)
135SYSCALL(delete_module)
136SYSCALL(ni_syscall)
137SYSCALL(quotactl)
138COMPAT_SYS_SPU(getpgid)
139SYSCALL_SPU(fchdir)
140SYSCALL_SPU(bdflush)
141COMPAT_SYS(sysfs)
142SYSX_SPU(ppc64_personality,ppc64_personality,sys_personality)
143SYSCALL(ni_syscall)
144SYSCALL_SPU(setfsuid)
145SYSCALL_SPU(setfsgid)
146SYSCALL_SPU(llseek)
147COMPAT_SYS_SPU(getdents)
148SYSX_SPU(sys_select,ppc32_select,ppc_select)
149SYSCALL_SPU(flock)
150SYSCALL_SPU(msync)
151COMPAT_SYS_SPU(readv)
152COMPAT_SYS_SPU(writev)
153COMPAT_SYS_SPU(getsid)
154SYSCALL_SPU(fdatasync)
155COMPAT_SYS(sysctl)
156SYSCALL_SPU(mlock)
157SYSCALL_SPU(munlock)
158SYSCALL_SPU(mlockall)
159SYSCALL_SPU(munlockall)
160COMPAT_SYS_SPU(sched_setparam)
161COMPAT_SYS_SPU(sched_getparam)
162COMPAT_SYS_SPU(sched_setscheduler)
163COMPAT_SYS_SPU(sched_getscheduler)
164SYSCALL_SPU(sched_yield)
165COMPAT_SYS_SPU(sched_get_priority_max)
166COMPAT_SYS_SPU(sched_get_priority_min)
167COMPAT_SYS_SPU(sched_rr_get_interval)
168COMPAT_SYS_SPU(nanosleep)
169SYSCALL_SPU(mremap)
170SYSCALL_SPU(setresuid)
171SYSCALL_SPU(getresuid)
172SYSCALL(ni_syscall)
173SYSCALL_SPU(poll)
174COMPAT_SYS(nfsservctl)
175SYSCALL_SPU(setresgid)
176SYSCALL_SPU(getresgid)
177COMPAT_SYS_SPU(prctl)
178COMPAT_SYS(rt_sigreturn)
179COMPAT_SYS(rt_sigaction)
180COMPAT_SYS(rt_sigprocmask)
181COMPAT_SYS(rt_sigpending)
182COMPAT_SYS(rt_sigtimedwait)
183COMPAT_SYS(rt_sigqueueinfo)
184COMPAT_SYS(rt_sigsuspend)
185COMPAT_SYS_SPU(pread64)
186COMPAT_SYS_SPU(pwrite64)
187SYSCALL_SPU(chown)
188SYSCALL_SPU(getcwd)
189SYSCALL_SPU(capget)
190SYSCALL_SPU(capset)
191COMPAT_SYS(sigaltstack)
192SYSX_SPU(sys_sendfile64,compat_sys_sendfile,sys_sendfile)
193SYSCALL(ni_syscall)
194SYSCALL(ni_syscall)
195PPC_SYS(vfork)
196COMPAT_SYS_SPU(getrlimit)
197COMPAT_SYS_SPU(readahead)
198SYS32ONLY(mmap2)
199SYS32ONLY(truncate64)
200SYS32ONLY(ftruncate64)
201SYSX(sys_ni_syscall,sys_stat64,sys_stat64)
202SYSX(sys_ni_syscall,sys_lstat64,sys_lstat64)
203SYSX(sys_ni_syscall,sys_fstat64,sys_fstat64)
204SYSCALL(pciconfig_read)
205SYSCALL(pciconfig_write)
206SYSCALL(pciconfig_iobase)
207SYSCALL(ni_syscall)
208SYSCALL_SPU(getdents64)
209SYSCALL_SPU(pivot_root)
210SYSX(sys_ni_syscall,compat_sys_fcntl64,sys_fcntl64)
211SYSCALL_SPU(madvise)
212SYSCALL_SPU(mincore)
213SYSCALL_SPU(gettid)
214SYSCALL_SPU(tkill)
215SYSCALL_SPU(setxattr)
216SYSCALL_SPU(lsetxattr)
217SYSCALL_SPU(fsetxattr)
218SYSCALL_SPU(getxattr)
219SYSCALL_SPU(lgetxattr)
220SYSCALL_SPU(fgetxattr)
221SYSCALL_SPU(listxattr)
222SYSCALL_SPU(llistxattr)
223SYSCALL_SPU(flistxattr)
224SYSCALL_SPU(removexattr)
225SYSCALL_SPU(lremovexattr)
226SYSCALL_SPU(fremovexattr)
227COMPAT_SYS_SPU(futex)
228COMPAT_SYS_SPU(sched_setaffinity)
229COMPAT_SYS_SPU(sched_getaffinity)
230SYSCALL(ni_syscall)
231SYSCALL(ni_syscall)
232SYS32ONLY(sendfile64)
233COMPAT_SYS_SPU(io_setup)
234SYSCALL_SPU(io_destroy)
235COMPAT_SYS_SPU(io_getevents)
236COMPAT_SYS_SPU(io_submit)
237SYSCALL_SPU(io_cancel)
238SYSCALL(set_tid_address)
239SYSX_SPU(sys_fadvise64,ppc32_fadvise64,sys_fadvise64)
240SYSCALL(exit_group)
241SYSX(sys_lookup_dcookie,ppc32_lookup_dcookie,sys_lookup_dcookie)
242SYSCALL_SPU(epoll_create)
243SYSCALL_SPU(epoll_ctl)
244SYSCALL_SPU(epoll_wait)
245SYSCALL_SPU(remap_file_pages)
246SYSX_SPU(sys_timer_create,compat_sys_timer_create,sys_timer_create)
247COMPAT_SYS_SPU(timer_settime)
248COMPAT_SYS_SPU(timer_gettime)
249SYSCALL_SPU(timer_getoverrun)
250SYSCALL_SPU(timer_delete)
251COMPAT_SYS_SPU(clock_settime)
252COMPAT_SYS_SPU(clock_gettime)
253COMPAT_SYS_SPU(clock_getres)
254COMPAT_SYS_SPU(clock_nanosleep)
255SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext)
256COMPAT_SYS_SPU(tgkill)
257COMPAT_SYS_SPU(utimes)
258COMPAT_SYS_SPU(statfs64)
259COMPAT_SYS_SPU(fstatfs64)
260SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64)
261PPC_SYS_SPU(rtas)
262OLDSYS(debug_setcontext)
263SYSCALL(ni_syscall)
264SYSCALL(ni_syscall)
265COMPAT_SYS(mbind)
266COMPAT_SYS(get_mempolicy)
267COMPAT_SYS(set_mempolicy)
268COMPAT_SYS(mq_open)
269SYSCALL(mq_unlink)
270COMPAT_SYS(mq_timedsend)
271COMPAT_SYS(mq_timedreceive)
272COMPAT_SYS(mq_notify)
273COMPAT_SYS(mq_getsetattr)
274COMPAT_SYS(kexec_load)
275COMPAT_SYS(add_key)
276COMPAT_SYS(request_key)
277COMPAT_SYS(keyctl)
278COMPAT_SYS(waitid)
279COMPAT_SYS(ioprio_set)
280COMPAT_SYS(ioprio_get)
281SYSCALL(inotify_init)
282SYSCALL(inotify_add_watch)
283SYSCALL(inotify_rm_watch)
284SYSCALL(spu_run)
285SYSCALL(spu_create)
286COMPAT_SYS(pselect6)
287COMPAT_SYS(ppoll)
288SYSCALL_SPU(unshare)
289SYSCALL_SPU(splice)
290SYSCALL_SPU(tee)
291SYSCALL_SPU(vmsplice)
292COMPAT_SYS_SPU(openat)
293SYSCALL_SPU(mkdirat)
294SYSCALL_SPU(mknodat)
295SYSCALL_SPU(fchownat)
296COMPAT_SYS_SPU(futimesat)
297SYSX_SPU(sys_newfstatat, sys_fstatat64, sys_fstatat64)
298SYSCALL_SPU(unlinkat)
299SYSCALL_SPU(renameat)
300SYSCALL_SPU(linkat)
301SYSCALL_SPU(symlinkat)
302SYSCALL_SPU(readlinkat)
303SYSCALL_SPU(fchmodat)
304SYSCALL_SPU(faccessat)
305COMPAT_SYS_SPU(get_robust_list)
306COMPAT_SYS_SPU(set_robust_list)
diff --git a/include/asm-powerpc/tce.h b/include/asm-powerpc/tce.h
index 6fa200ad7a7f..c9483adbf599 100644
--- a/include/asm-powerpc/tce.h
+++ b/include/asm-powerpc/tce.h
@@ -35,32 +35,15 @@
35#define TCE_PAGE_SIZE (1 << TCE_SHIFT) 35#define TCE_PAGE_SIZE (1 << TCE_SHIFT)
36#define TCE_PAGE_FACTOR (PAGE_SHIFT - TCE_SHIFT) 36#define TCE_PAGE_FACTOR (PAGE_SHIFT - TCE_SHIFT)
37 37
38 38#define TCE_ENTRY_SIZE 8 /* each TCE is 64 bits */
39/* tce_entry 39
40 * Used by pSeries (SMP) and iSeries/pSeries LPAR, but there it's 40#define TCE_RPN_MASK 0xfffffffffful /* 40-bit RPN (4K pages) */
41 * abstracted so layout is irrelevant. 41#define TCE_RPN_SHIFT 12
42 */ 42#define TCE_VALID 0x800 /* TCE valid */
43union tce_entry { 43#define TCE_ALLIO 0x400 /* TCE valid for all lpars */
44 unsigned long te_word; 44#define TCE_PCI_WRITE 0x2 /* write from PCI allowed */
45 struct { 45#define TCE_PCI_READ 0x1 /* read from PCI allowed */
46 unsigned int tb_cacheBits :6; /* Cache hash bits - not used */ 46#define TCE_VB_WRITE 0x1 /* write from VB allowed */
47 unsigned int tb_rsvd :6;
48 unsigned long tb_rpn :40; /* Real page number */
49 unsigned int tb_valid :1; /* Tce is valid (vb only) */
50 unsigned int tb_allio :1; /* Tce is valid for all lps (vb only) */
51 unsigned int tb_lpindex :8; /* LpIndex for user of TCE (vb only) */
52 unsigned int tb_pciwr :1; /* Write allowed (pci only) */
53 unsigned int tb_rdwr :1; /* Read allowed (pci), Write allowed (vb) */
54 } te_bits;
55#define te_cacheBits te_bits.tb_cacheBits
56#define te_rpn te_bits.tb_rpn
57#define te_valid te_bits.tb_valid
58#define te_allio te_bits.tb_allio
59#define te_lpindex te_bits.tb_lpindex
60#define te_pciwr te_bits.tb_pciwr
61#define te_rdwr te_bits.tb_rdwr
62};
63
64 47
65#endif /* __KERNEL__ */ 48#endif /* __KERNEL__ */
66#endif /* _ASM_POWERPC_TCE_H */ 49#endif /* _ASM_POWERPC_TCE_H */
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h
index 88b553c6b26c..d339e2e88b11 100644
--- a/include/asm-powerpc/thread_info.h
+++ b/include/asm-powerpc/thread_info.h
@@ -21,7 +21,6 @@
21#define THREAD_SIZE (1 << THREAD_SHIFT) 21#define THREAD_SIZE (1 << THREAD_SHIFT)
22 22
23#ifndef __ASSEMBLY__ 23#ifndef __ASSEMBLY__
24#include <linux/config.h>
25#include <linux/cache.h> 24#include <linux/cache.h>
26#include <asm/processor.h> 25#include <asm/processor.h>
27#include <asm/page.h> 26#include <asm/page.h>
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index 912118db13ae..4463148c659f 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -14,7 +14,6 @@
14#define __POWERPC_TIME_H 14#define __POWERPC_TIME_H
15 15
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17#include <linux/config.h>
18#include <linux/types.h> 17#include <linux/types.h>
19#include <linux/percpu.h> 18#include <linux/percpu.h>
20 19
diff --git a/include/asm-powerpc/timex.h b/include/asm-powerpc/timex.h
index c02d15aced91..3b9a8e786806 100644
--- a/include/asm-powerpc/timex.h
+++ b/include/asm-powerpc/timex.h
@@ -7,7 +7,6 @@
7 * PowerPC architecture timex specifications 7 * PowerPC architecture timex specifications
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <asm/cputable.h> 10#include <asm/cputable.h>
12 11
13#define CLOCK_TICK_RATE 1024000 /* Underlying HZ */ 12#define CLOCK_TICK_RATE 1024000 /* Underlying HZ */
diff --git a/include/asm-powerpc/tlb.h b/include/asm-powerpc/tlb.h
index 601a53cf96d5..4e2a834683fb 100644
--- a/include/asm-powerpc/tlb.h
+++ b/include/asm-powerpc/tlb.h
@@ -13,7 +13,6 @@
13#define _ASM_POWERPC_TLB_H 13#define _ASM_POWERPC_TLB_H
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/config.h>
17#ifndef __powerpc64__ 16#ifndef __powerpc64__
18#include <asm/pgtable.h> 17#include <asm/pgtable.h>
19#endif 18#endif
diff --git a/include/asm-powerpc/tlbflush.h b/include/asm-powerpc/tlbflush.h
index a2998eee37bb..93c7d0c7230f 100644
--- a/include/asm-powerpc/tlbflush.h
+++ b/include/asm-powerpc/tlbflush.h
@@ -17,7 +17,6 @@
17 */ 17 */
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19 19
20#include <linux/config.h>
21 20
22struct mm_struct; 21struct mm_struct;
23 22
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h
index 87362a05542b..92f3e5507d22 100644
--- a/include/asm-powerpc/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -2,7 +2,6 @@
2#define _ASM_POWERPC_TOPOLOGY_H 2#define _ASM_POWERPC_TOPOLOGY_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/config.h>
6 5
7struct sys_device; 6struct sys_device;
8struct device_node; 7struct device_node;
@@ -32,8 +31,13 @@ static inline int node_to_first_cpu(int node)
32 31
33int of_node_to_nid(struct device_node *device); 32int of_node_to_nid(struct device_node *device);
34 33
35#define pcibus_to_node(node) (-1) 34struct pci_bus;
36#define pcibus_to_cpumask(bus) (cpu_online_map) 35extern int pcibus_to_node(struct pci_bus *bus);
36
37#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
38 CPU_MASK_ALL : \
39 node_to_cpumask(pcibus_to_node(bus)) \
40 )
37 41
38/* sched_domains SD_NODE_INIT for PPC64 machines */ 42/* sched_domains SD_NODE_INIT for PPC64 machines */
39#define SD_NODE_INIT (struct sched_domain) { \ 43#define SD_NODE_INIT (struct sched_domain) { \
diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
index baabba96e313..d6fb56b80453 100644
--- a/include/asm-powerpc/types.h
+++ b/include/asm-powerpc/types.h
@@ -64,7 +64,6 @@ typedef struct {
64 64
65#ifndef __ASSEMBLY__ 65#ifndef __ASSEMBLY__
66 66
67#include <linux/config.h>
68 67
69typedef signed char s8; 68typedef signed char s8;
70typedef unsigned char u8; 69typedef unsigned char u8;
diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h
index 5c4236c342bb..19a1517ac43b 100644
--- a/include/asm-powerpc/udbg.h
+++ b/include/asm-powerpc/udbg.h
@@ -23,7 +23,8 @@ extern int udbg_write(const char *s, int n);
23extern int udbg_read(char *buf, int buflen); 23extern int udbg_read(char *buf, int buflen);
24 24
25extern void register_early_udbg_console(void); 25extern void register_early_udbg_console(void);
26extern void udbg_printf(const char *fmt, ...); 26extern void udbg_printf(const char *fmt, ...)
27 __attribute__ ((format (printf, 1, 2)));
27extern void udbg_progress(char *s, unsigned short hex); 28extern void udbg_progress(char *s, unsigned short hex);
28 29
29extern void udbg_init_uart(void __iomem *comport, unsigned int speed, 30extern void udbg_init_uart(void __iomem *comport, unsigned int speed,
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index edde2462bf52..eb66eae6616f 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -324,12 +324,12 @@
324#define __NR_get_robust_list 299 324#define __NR_get_robust_list 299
325#define __NR_set_robust_list 300 325#define __NR_set_robust_list 300
326 326
327#ifdef __KERNEL__
328
327#define __NR_syscalls 301 329#define __NR_syscalls 301
328 330
329#ifdef __KERNEL__
330#define __NR__exit __NR_exit 331#define __NR__exit __NR_exit
331#define NR_syscalls __NR_syscalls 332#define NR_syscalls __NR_syscalls
332#endif
333 333
334#ifndef __ASSEMBLY__ 334#ifndef __ASSEMBLY__
335 335
@@ -441,9 +441,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
441 __syscall_nr(6, type, name, arg1, arg2, arg3, arg4, arg5, arg6); \ 441 __syscall_nr(6, type, name, arg1, arg2, arg3, arg4, arg5, arg6); \
442} 442}
443 443
444#ifdef __KERNEL__
445 444
446#include <linux/config.h>
447#include <linux/types.h> 445#include <linux/types.h>
448#include <linux/compiler.h> 446#include <linux/compiler.h>
449#include <linux/linkage.h> 447#include <linux/linkage.h>
@@ -499,8 +497,8 @@ extern int execve(const char *file, char **argv, char **envp);
499#define cond_syscall(x) asm(".weak\t." #x "\n\t.set\t." #x ",.sys_ni_syscall") 497#define cond_syscall(x) asm(".weak\t." #x "\n\t.set\t." #x ",.sys_ni_syscall")
500#endif 498#endif
501 499
502#endif /* __KERNEL__ */
503 500
504#endif /* __ASSEMBLY__ */ 501#endif /* __ASSEMBLY__ */
502#endif /* __KERNEL__ */
505 503
506#endif /* _ASM_PPC_UNISTD_H_ */ 504#endif /* _ASM_PPC_UNISTD_H_ */
diff --git a/include/asm-powerpc/vga.h b/include/asm-powerpc/vga.h
index f8d350aabf1a..a2eac409c1ec 100644
--- a/include/asm-powerpc/vga.h
+++ b/include/asm-powerpc/vga.h
@@ -12,7 +12,6 @@
12 12
13#include <asm/io.h> 13#include <asm/io.h>
14 14
15#include <linux/config.h>
16 15
17#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE) 16#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE)
18 17
@@ -42,9 +41,9 @@ static inline u16 scr_readw(volatile const u16 *addr)
42extern unsigned long vgacon_remap_base; 41extern unsigned long vgacon_remap_base;
43 42
44#ifdef __powerpc64__ 43#ifdef __powerpc64__
45#define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) 44#define VGA_MAP_MEM(x,s) ((unsigned long) ioremap((x), s))
46#else 45#else
47#define VGA_MAP_MEM(x) (x + vgacon_remap_base) 46#define VGA_MAP_MEM(x,s) (x + vgacon_remap_base)
48#endif 47#endif
49 48
50#define vga_readb(x) (*(x)) 49#define vga_readb(x) (*(x))
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h
index 0544ece51761..dc9bd101ca14 100644
--- a/include/asm-powerpc/vio.h
+++ b/include/asm-powerpc/vio.h
@@ -15,7 +15,6 @@
15#define _ASM_POWERPC_VIO_H 15#define _ASM_POWERPC_VIO_H
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17 17
18#include <linux/config.h>
19#include <linux/init.h> 18#include <linux/init.h>
20#include <linux/errno.h> 19#include <linux/errno.h>
21#include <linux/device.h> 20#include <linux/device.h>
@@ -64,32 +63,22 @@ struct vio_driver {
64 struct device_driver driver; 63 struct device_driver driver;
65}; 64};
66 65
67struct vio_bus_ops {
68 int (*match)(const struct vio_device_id *id, const struct vio_dev *dev);
69 void (*unregister_device)(struct vio_dev *);
70 void (*release_device)(struct device *);
71};
72
73extern struct dma_mapping_ops vio_dma_ops; 66extern struct dma_mapping_ops vio_dma_ops;
74extern struct bus_type vio_bus_type; 67extern struct bus_type vio_bus_type;
75extern struct vio_dev vio_bus_device;
76 68
77extern int vio_register_driver(struct vio_driver *drv); 69extern int vio_register_driver(struct vio_driver *drv);
78extern void vio_unregister_driver(struct vio_driver *drv); 70extern void vio_unregister_driver(struct vio_driver *drv);
79 71
80extern struct vio_dev * __devinit vio_register_device(struct vio_dev *viodev);
81extern void __devinit vio_unregister_device(struct vio_dev *dev); 72extern void __devinit vio_unregister_device(struct vio_dev *dev);
82 73
83extern int vio_bus_init(struct vio_bus_ops *);
84
85#ifdef CONFIG_PPC_PSERIES
86struct device_node; 74struct device_node;
87 75
88extern struct vio_dev * __devinit vio_register_device_node( 76extern struct vio_dev * __devinit vio_register_device_node(
89 struct device_node *node_vdev); 77 struct device_node *node_vdev);
90extern struct vio_dev *vio_find_node(struct device_node *vnode); 78extern const void *vio_get_attribute(struct vio_dev *vdev, char *which,
91extern const void *vio_get_attribute(struct vio_dev *vdev, void *which,
92 int *length); 79 int *length);
80#ifdef CONFIG_PPC_PSERIES
81extern struct vio_dev *vio_find_node(struct device_node *vnode);
93extern int vio_enable_interrupts(struct vio_dev *dev); 82extern int vio_enable_interrupts(struct vio_dev *dev);
94extern int vio_disable_interrupts(struct vio_dev *dev); 83extern int vio_disable_interrupts(struct vio_dev *dev);
95#endif 84#endif
diff --git a/include/asm-ppc/amigahw.h b/include/asm-ppc/amigahw.h
index 8c98945e7dc1..90fd1274d727 100644
--- a/include/asm-ppc/amigahw.h
+++ b/include/asm-ppc/amigahw.h
@@ -2,7 +2,6 @@
2#ifndef __ASMPPC_AMIGAHW_H 2#ifndef __ASMPPC_AMIGAHW_H
3#define __ASMPPC_AMIGAHW_H 3#define __ASMPPC_AMIGAHW_H
4 4
5#include <linux/config.h>
6#include <asm-m68k/amigahw.h> 5#include <asm-m68k/amigahw.h>
7 6
8#undef CHIP_PHYSADDR 7#undef CHIP_PHYSADDR
diff --git a/include/asm-ppc/bootinfo.h b/include/asm-ppc/bootinfo.h
index 93d955c70d65..2ace4a74f263 100644
--- a/include/asm-ppc/bootinfo.h
+++ b/include/asm-ppc/bootinfo.h
@@ -9,7 +9,6 @@
9#ifndef _PPC_BOOTINFO_H 9#ifndef _PPC_BOOTINFO_H
10#define _PPC_BOOTINFO_H 10#define _PPC_BOOTINFO_H
11 11
12#include <linux/config.h>
13#include <asm/page.h> 12#include <asm/page.h>
14 13
15#if defined(CONFIG_APUS) && !defined(__BOOTER__) 14#if defined(CONFIG_APUS) && !defined(__BOOTER__)
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h
index 31f362966a58..3247bea5fc2b 100644
--- a/include/asm-ppc/commproc.h
+++ b/include/asm-ppc/commproc.h
@@ -17,7 +17,6 @@
17#ifndef __CPM_8XX__ 17#ifndef __CPM_8XX__
18#define __CPM_8XX__ 18#define __CPM_8XX__
19 19
20#include <linux/config.h>
21#include <asm/8xx_immap.h> 20#include <asm/8xx_immap.h>
22#include <asm/ptrace.h> 21#include <asm/ptrace.h>
23 22
diff --git a/include/asm-ppc/ibm403.h b/include/asm-ppc/ibm403.h
index bf6efa0417ab..c9c5d539cfdb 100644
--- a/include/asm-ppc/ibm403.h
+++ b/include/asm-ppc/ibm403.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_IBM403_H__ 12#ifndef __ASM_IBM403_H__
13#define __ASM_IBM403_H__ 13#define __ASM_IBM403_H__
14 14
15#include <linux/config.h>
16 15
17#if defined(CONFIG_403GCX) 16#if defined(CONFIG_403GCX)
18 17
diff --git a/include/asm-ppc/ibm44x.h b/include/asm-ppc/ibm44x.h
index 3acc382cc83f..7818b54b6e37 100644
--- a/include/asm-ppc/ibm44x.h
+++ b/include/asm-ppc/ibm44x.h
@@ -17,7 +17,6 @@
17#ifndef __ASM_IBM44x_H__ 17#ifndef __ASM_IBM44x_H__
18#define __ASM_IBM44x_H__ 18#define __ASM_IBM44x_H__
19 19
20#include <linux/config.h>
21 20
22#ifndef NR_BOARD_IRQS 21#ifndef NR_BOARD_IRQS
23#define NR_BOARD_IRQS 0 22#define NR_BOARD_IRQS 0
diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h
index 38f99710752b..cf62b69cb69a 100644
--- a/include/asm-ppc/ibm4xx.h
+++ b/include/asm-ppc/ibm4xx.h
@@ -14,7 +14,6 @@
14#ifndef __ASM_IBM4XX_H__ 14#ifndef __ASM_IBM4XX_H__
15#define __ASM_IBM4XX_H__ 15#define __ASM_IBM4XX_H__
16 16
17#include <linux/config.h>
18#include <asm/types.h> 17#include <asm/types.h>
19 18
20#ifdef CONFIG_40x 19#ifdef CONFIG_40x
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index b919d8fb7d98..89c6f1bc3aab 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -2,7 +2,6 @@
2#ifndef _PPC_IO_H 2#ifndef _PPC_IO_H
3#define _PPC_IO_H 3#define _PPC_IO_H
4 4
5#include <linux/config.h>
6#include <linux/string.h> 5#include <linux/string.h>
7#include <linux/types.h> 6#include <linux/types.h>
8 7
diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h
index e1a0a7b213d7..da7746738aee 100644
--- a/include/asm-ppc/machdep.h
+++ b/include/asm-ppc/machdep.h
@@ -2,7 +2,6 @@
2#ifndef _PPC_MACHDEP_H 2#ifndef _PPC_MACHDEP_H
3#define _PPC_MACHDEP_H 3#define _PPC_MACHDEP_H
4 4
5#include <linux/config.h>
6#include <linux/init.h> 5#include <linux/init.h>
7#include <linux/kexec.h> 6#include <linux/kexec.h>
8 7
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index 9205db404c7a..14584e505ed5 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -6,7 +6,6 @@
6#ifndef _PPC_MMU_H_ 6#ifndef _PPC_MMU_H_
7#define _PPC_MMU_H_ 7#define _PPC_MMU_H_
8 8
9#include <linux/config.h>
10 9
11#ifndef __ASSEMBLY__ 10#ifndef __ASSEMBLY__
12 11
@@ -24,25 +23,18 @@ extern phys_addr_t fixup_bigphys_addr(phys_addr_t, phys_addr_t);
24#define PHYS_FMT "%16Lx" 23#define PHYS_FMT "%16Lx"
25#endif 24#endif
26 25
27/* Default "unsigned long" context */ 26typedef struct {
28typedef unsigned long mm_context_t; 27 unsigned long id;
28 unsigned long vdso_base;
29} mm_context_t;
29 30
30/* Hardware Page Table Entry */ 31/* Hardware Page Table Entry */
31typedef struct _PTE { 32typedef struct _PTE {
32#ifdef CONFIG_PPC64BRIDGE
33 unsigned long long vsid:52;
34 unsigned long api:5;
35 unsigned long :5;
36 unsigned long h:1;
37 unsigned long v:1;
38 unsigned long long rpn:52;
39#else /* CONFIG_PPC64BRIDGE */
40 unsigned long v:1; /* Entry is valid */ 33 unsigned long v:1; /* Entry is valid */
41 unsigned long vsid:24; /* Virtual segment identifier */ 34 unsigned long vsid:24; /* Virtual segment identifier */
42 unsigned long h:1; /* Hash algorithm indicator */ 35 unsigned long h:1; /* Hash algorithm indicator */
43 unsigned long api:6; /* Abbreviated page index */ 36 unsigned long api:6; /* Abbreviated page index */
44 unsigned long rpn:20; /* Real (physical) page number */ 37 unsigned long rpn:20; /* Real (physical) page number */
45#endif /* CONFIG_PPC64BRIDGE */
46 unsigned long :3; /* Unused */ 38 unsigned long :3; /* Unused */
47 unsigned long r:1; /* Referenced */ 39 unsigned long r:1; /* Referenced */
48 unsigned long c:1; /* Changed */ 40 unsigned long c:1; /* Changed */
@@ -83,11 +75,7 @@ typedef struct _P601_BATU { /* Upper part of BAT for 601 processor */
83} P601_BATU; 75} P601_BATU;
84 76
85typedef struct _BATU { /* Upper part of BAT (all except 601) */ 77typedef struct _BATU { /* Upper part of BAT (all except 601) */
86#ifdef CONFIG_PPC64BRIDGE
87 unsigned long long bepi:47;
88#else /* CONFIG_PPC64BRIDGE */
89 unsigned long bepi:15; /* Effective page index (virtual address) */ 78 unsigned long bepi:15; /* Effective page index (virtual address) */
90#endif /* CONFIG_PPC64BRIDGE */
91 unsigned long :4; /* Unused */ 79 unsigned long :4; /* Unused */
92 unsigned long bl:11; /* Block size mask */ 80 unsigned long bl:11; /* Block size mask */
93 unsigned long vs:1; /* Supervisor valid */ 81 unsigned long vs:1; /* Supervisor valid */
@@ -102,11 +90,7 @@ typedef struct _P601_BATL { /* Lower part of BAT for 601 processor */
102} P601_BATL; 90} P601_BATL;
103 91
104typedef struct _BATL { /* Lower part of BAT (all except 601) */ 92typedef struct _BATL { /* Lower part of BAT (all except 601) */
105#ifdef CONFIG_PPC64BRIDGE
106 unsigned long long brpn:47;
107#else /* CONFIG_PPC64BRIDGE */
108 unsigned long brpn:15; /* Real page index (physical address) */ 93 unsigned long brpn:15; /* Real page index (physical address) */
109#endif /* CONFIG_PPC64BRIDGE */
110 unsigned long :10; /* Unused */ 94 unsigned long :10; /* Unused */
111 unsigned long w:1; /* Write-thru cache */ 95 unsigned long w:1; /* Write-thru cache */
112 unsigned long i:1; /* Cache inhibit */ 96 unsigned long i:1; /* Cache inhibit */
diff --git a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
index 4f152cca13c1..2bc8589cc451 100644
--- a/include/asm-ppc/mmu_context.h
+++ b/include/asm-ppc/mmu_context.h
@@ -2,7 +2,6 @@
2#ifndef __PPC_MMU_CONTEXT_H 2#ifndef __PPC_MMU_CONTEXT_H
3#define __PPC_MMU_CONTEXT_H 3#define __PPC_MMU_CONTEXT_H
4 4
5#include <linux/config.h>
6#include <asm/atomic.h> 5#include <asm/atomic.h>
7#include <asm/bitops.h> 6#include <asm/bitops.h>
8#include <asm/mmu.h> 7#include <asm/mmu.h>
@@ -71,7 +70,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
71#else 70#else
72 71
73/* PPC 6xx, 7xx CPUs */ 72/* PPC 6xx, 7xx CPUs */
74#define NO_CONTEXT ((mm_context_t) -1) 73#define NO_CONTEXT ((unsigned long) -1)
75#define LAST_CONTEXT 32767 74#define LAST_CONTEXT 32767
76#define FIRST_CONTEXT 1 75#define FIRST_CONTEXT 1
77#endif 76#endif
@@ -86,7 +85,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
86 * can be used for debugging on all processors (if you happen to have 85 * can be used for debugging on all processors (if you happen to have
87 * an Abatron). 86 * an Abatron).
88 */ 87 */
89extern void set_context(mm_context_t context, pgd_t *pgd); 88extern void set_context(unsigned long contextid, pgd_t *pgd);
90 89
91/* 90/*
92 * Bitmap of contexts in use. 91 * Bitmap of contexts in use.
@@ -99,7 +98,7 @@ extern unsigned long context_map[];
99 * Its use is an optimization only, we can't rely on this context 98 * Its use is an optimization only, we can't rely on this context
100 * number to be free, but it usually will be. 99 * number to be free, but it usually will be.
101 */ 100 */
102extern mm_context_t next_mmu_context; 101extern unsigned long next_mmu_context;
103 102
104/* 103/*
105 * If we don't have sufficient contexts to give one to every task 104 * If we don't have sufficient contexts to give one to every task
@@ -118,9 +117,9 @@ extern void steal_context(void);
118 */ 117 */
119static inline void get_mmu_context(struct mm_struct *mm) 118static inline void get_mmu_context(struct mm_struct *mm)
120{ 119{
121 mm_context_t ctx; 120 unsigned long ctx;
122 121
123 if (mm->context != NO_CONTEXT) 122 if (mm->context.id != NO_CONTEXT)
124 return; 123 return;
125#ifdef FEW_CONTEXTS 124#ifdef FEW_CONTEXTS
126 while (atomic_dec_if_positive(&nr_free_contexts) < 0) 125 while (atomic_dec_if_positive(&nr_free_contexts) < 0)
@@ -133,7 +132,7 @@ static inline void get_mmu_context(struct mm_struct *mm)
133 ctx = 0; 132 ctx = 0;
134 } 133 }
135 next_mmu_context = (ctx + 1) & LAST_CONTEXT; 134 next_mmu_context = (ctx + 1) & LAST_CONTEXT;
136 mm->context = ctx; 135 mm->context.id = ctx;
137#ifdef FEW_CONTEXTS 136#ifdef FEW_CONTEXTS
138 context_mm[ctx] = mm; 137 context_mm[ctx] = mm;
139#endif 138#endif
@@ -142,7 +141,12 @@ static inline void get_mmu_context(struct mm_struct *mm)
142/* 141/*
143 * Set up the context for a new address space. 142 * Set up the context for a new address space.
144 */ 143 */
145#define init_new_context(tsk,mm) (((mm)->context = NO_CONTEXT), 0) 144static inline int init_new_context(struct task_struct *t, struct mm_struct *mm)
145{
146 mm->context.id = NO_CONTEXT;
147 mm->context.vdso_base = 0;
148 return 0;
149}
146 150
147/* 151/*
148 * We're finished using the context for an address space. 152 * We're finished using the context for an address space.
@@ -150,9 +154,9 @@ static inline void get_mmu_context(struct mm_struct *mm)
150static inline void destroy_context(struct mm_struct *mm) 154static inline void destroy_context(struct mm_struct *mm)
151{ 155{
152 preempt_disable(); 156 preempt_disable();
153 if (mm->context != NO_CONTEXT) { 157 if (mm->context.id != NO_CONTEXT) {
154 clear_bit(mm->context, context_map); 158 clear_bit(mm->context.id, context_map);
155 mm->context = NO_CONTEXT; 159 mm->context.id = NO_CONTEXT;
156#ifdef FEW_CONTEXTS 160#ifdef FEW_CONTEXTS
157 atomic_inc(&nr_free_contexts); 161 atomic_inc(&nr_free_contexts);
158#endif 162#endif
@@ -180,7 +184,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
180 184
181 /* Setup new userspace context */ 185 /* Setup new userspace context */
182 get_mmu_context(next); 186 get_mmu_context(next);
183 set_context(next->context, next->pgd); 187 set_context(next->context.id, next->pgd);
184} 188}
185 189
186#define deactivate_mm(tsk,mm) do { } while (0) 190#define deactivate_mm(tsk,mm) do { } while (0)
diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h
index 6ba69a86b9dd..4b93481e7679 100644
--- a/include/asm-ppc/mpc8260.h
+++ b/include/asm-ppc/mpc8260.h
@@ -8,7 +8,6 @@
8#ifndef __ASM_PPC_MPC8260_H__ 8#ifndef __ASM_PPC_MPC8260_H__
9#define __ASM_PPC_MPC8260_H__ 9#define __ASM_PPC_MPC8260_H__
10 10
11#include <linux/config.h>
12 11
13#ifdef CONFIG_8260 12#ifdef CONFIG_8260
14 13
diff --git a/include/asm-ppc/mpc83xx.h b/include/asm-ppc/mpc83xx.h
index 3c23fc43bfbc..02ed2c325714 100644
--- a/include/asm-ppc/mpc83xx.h
+++ b/include/asm-ppc/mpc83xx.h
@@ -17,7 +17,6 @@
17#ifndef __ASM_MPC83xx_H__ 17#ifndef __ASM_MPC83xx_H__
18#define __ASM_MPC83xx_H__ 18#define __ASM_MPC83xx_H__
19 19
20#include <linux/config.h>
21#include <asm/mmu.h> 20#include <asm/mmu.h>
22 21
23#ifdef CONFIG_83xx 22#ifdef CONFIG_83xx
diff --git a/include/asm-ppc/mpc85xx.h b/include/asm-ppc/mpc85xx.h
index f47002a60edf..9b4851199c76 100644
--- a/include/asm-ppc/mpc85xx.h
+++ b/include/asm-ppc/mpc85xx.h
@@ -17,7 +17,6 @@
17#ifndef __ASM_MPC85xx_H__ 17#ifndef __ASM_MPC85xx_H__
18#define __ASM_MPC85xx_H__ 18#define __ASM_MPC85xx_H__
19 19
20#include <linux/config.h>
21#include <asm/mmu.h> 20#include <asm/mmu.h>
22 21
23#ifdef CONFIG_85xx 22#ifdef CONFIG_85xx
@@ -28,6 +27,9 @@
28#if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS) 27#if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS)
29#include <platforms/85xx/mpc8555_cds.h> 28#include <platforms/85xx/mpc8555_cds.h>
30#endif 29#endif
30#ifdef CONFIG_MPC85xx_CDS
31#include <platforms/85xx/mpc85xx_cds.h>
32#endif
31#ifdef CONFIG_MPC8560_ADS 33#ifdef CONFIG_MPC8560_ADS
32#include <platforms/85xx/mpc8560_ads.h> 34#include <platforms/85xx/mpc8560_ads.h>
33#endif 35#endif
diff --git a/include/asm-ppc/mpc8xx.h b/include/asm-ppc/mpc8xx.h
index 3515a7fa6c89..adcce33f20ae 100644
--- a/include/asm-ppc/mpc8xx.h
+++ b/include/asm-ppc/mpc8xx.h
@@ -8,7 +8,6 @@
8#ifndef __CONFIG_8xx_DEFS 8#ifndef __CONFIG_8xx_DEFS
9#define __CONFIG_8xx_DEFS 9#define __CONFIG_8xx_DEFS
10 10
11#include <linux/config.h>
12 11
13#ifdef CONFIG_8xx 12#ifdef CONFIG_8xx
14 13
diff --git a/include/asm-ppc/mv64x60.h b/include/asm-ppc/mv64x60.h
index 4f2405b83612..663edbee3e91 100644
--- a/include/asm-ppc/mv64x60.h
+++ b/include/asm-ppc/mv64x60.h
@@ -17,7 +17,6 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/pci.h> 18#include <linux/pci.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/config.h>
21 20
22#include <asm/byteorder.h> 21#include <asm/byteorder.h>
23#include <asm/io.h> 22#include <asm/io.h>
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
index 983116f59d90..3be5d760ffcd 100644
--- a/include/asm-ppc/ocp.h
+++ b/include/asm-ppc/ocp.h
@@ -26,7 +26,6 @@
26 26
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/list.h> 28#include <linux/list.h>
29#include <linux/config.h>
30#include <linux/devfs_fs_kernel.h> 29#include <linux/devfs_fs_kernel.h>
31#include <linux/device.h> 30#include <linux/device.h>
32 31
diff --git a/include/asm-ppc/open_pic.h b/include/asm-ppc/open_pic.h
index ec2f46629ca2..a4fe962d9f73 100644
--- a/include/asm-ppc/open_pic.h
+++ b/include/asm-ppc/open_pic.h
@@ -12,7 +12,6 @@
12#ifndef _PPC_KERNEL_OPEN_PIC_H 12#ifndef _PPC_KERNEL_OPEN_PIC_H
13#define _PPC_KERNEL_OPEN_PIC_H 13#define _PPC_KERNEL_OPEN_PIC_H
14 14
15#include <linux/config.h>
16#include <linux/irq.h> 15#include <linux/irq.h>
17 16
18#define OPENPIC_SIZE 0x40000 17#define OPENPIC_SIZE 0x40000
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h
index 0fb68a0b0181..0b19af82507f 100644
--- a/include/asm-ppc/page.h
+++ b/include/asm-ppc/page.h
@@ -1,7 +1,6 @@
1#ifndef _PPC_PAGE_H 1#ifndef _PPC_PAGE_H
2#define _PPC_PAGE_H 2#define _PPC_PAGE_H
3 3
4#include <linux/config.h>
5#include <asm/asm-compat.h> 4#include <asm/asm-compat.h>
6 5
7/* PAGE_SHIFT determines the page size */ 6/* PAGE_SHIFT determines the page size */
@@ -15,7 +14,6 @@
15#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) 14#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
16 15
17#ifdef __KERNEL__ 16#ifdef __KERNEL__
18#include <linux/config.h>
19 17
20/* This must match what is in arch/ppc/Makefile */ 18/* This must match what is in arch/ppc/Makefile */
21#define PAGE_OFFSET CONFIG_KERNEL_START 19#define PAGE_OFFSET CONFIG_KERNEL_START
diff --git a/include/asm-ppc/pc_serial.h b/include/asm-ppc/pc_serial.h
index 8f994f9f8857..81a2d0fdaf00 100644
--- a/include/asm-ppc/pc_serial.h
+++ b/include/asm-ppc/pc_serial.h
@@ -9,7 +9,6 @@
9 * anyone using any of those on a PPC platform. -- paulus 9 * anyone using any of those on a PPC platform. -- paulus
10 */ 10 */
11 11
12#include <linux/config.h>
13 12
14/* 13/*
15 * This assumes you have a 1.8432 MHz clock for your UART. 14 * This assumes you have a 1.8432 MHz clock for your UART.
diff --git a/include/asm-ppc/pgalloc.h b/include/asm-ppc/pgalloc.h
index bdefd1c4a558..44d88a98e87c 100644
--- a/include/asm-ppc/pgalloc.h
+++ b/include/asm-ppc/pgalloc.h
@@ -2,7 +2,6 @@
2#ifndef _PPC_PGALLOC_H 2#ifndef _PPC_PGALLOC_H
3#define _PPC_PGALLOC_H 3#define _PPC_PGALLOC_H
4 4
5#include <linux/config.h>
6#include <linux/threads.h> 5#include <linux/threads.h>
7 6
8extern void __bad_pte(pmd_t *pmd); 7extern void __bad_pte(pmd_t *pmd);
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index 570b355162fa..51fa7c662917 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -4,7 +4,6 @@
4 4
5#include <asm-generic/4level-fixup.h> 5#include <asm-generic/4level-fixup.h>
6 6
7#include <linux/config.h>
8 7
9#ifndef __ASSEMBLY__ 8#ifndef __ASSEMBLY__
10#include <linux/sched.h> 9#include <linux/sched.h>
@@ -663,7 +662,7 @@ static inline int __ptep_test_and_clear_young(unsigned int context, unsigned lon
663 return (old & _PAGE_ACCESSED) != 0; 662 return (old & _PAGE_ACCESSED) != 0;
664} 663}
665#define ptep_test_and_clear_young(__vma, __addr, __ptep) \ 664#define ptep_test_and_clear_young(__vma, __addr, __ptep) \
666 __ptep_test_and_clear_young((__vma)->vm_mm->context, __addr, __ptep) 665 __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep)
667 666
668#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY 667#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
669static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, 668static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma,
diff --git a/include/asm-ppc/ppc4xx_dma.h b/include/asm-ppc/ppc4xx_dma.h
index 46a086fff816..935d1e05366b 100644
--- a/include/asm-ppc/ppc4xx_dma.h
+++ b/include/asm-ppc/ppc4xx_dma.h
@@ -24,7 +24,6 @@
24#ifndef __ASMPPC_PPC4xx_DMA_H 24#ifndef __ASMPPC_PPC4xx_DMA_H
25#define __ASMPPC_PPC4xx_DMA_H 25#define __ASMPPC_PPC4xx_DMA_H
26 26
27#include <linux/config.h>
28#include <linux/types.h> 27#include <linux/types.h>
29#include <asm/mmu.h> 28#include <asm/mmu.h>
30#include <asm/ibm4xx.h> 29#include <asm/ibm4xx.h>
diff --git a/include/asm-ppc/ppc4xx_pic.h b/include/asm-ppc/ppc4xx_pic.h
index c16c7f81cfd8..e44261206f8b 100644
--- a/include/asm-ppc/ppc4xx_pic.h
+++ b/include/asm-ppc/ppc4xx_pic.h
@@ -17,7 +17,6 @@
17#ifndef __PPC4XX_PIC_H__ 17#ifndef __PPC4XX_PIC_H__
18#define __PPC4XX_PIC_H__ 18#define __PPC4XX_PIC_H__
19 19
20#include <linux/config.h>
21#include <linux/types.h> 20#include <linux/types.h>
22#include <linux/irq.h> 21#include <linux/irq.h>
23 22
diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h
index b74af5461564..8a59f8871f32 100644
--- a/include/asm-ppc/serial.h
+++ b/include/asm-ppc/serial.h
@@ -6,7 +6,6 @@
6#ifndef __ASM_SERIAL_H__ 6#ifndef __ASM_SERIAL_H__
7#define __ASM_SERIAL_H__ 7#define __ASM_SERIAL_H__
8 8
9#include <linux/config.h>
10 9
11#if defined(CONFIG_EV64260) 10#if defined(CONFIG_EV64260)
12#include <platforms/ev64260.h> 11#include <platforms/ev64260.h>
diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h
index 30e9268a888c..0b7fa89589df 100644
--- a/include/asm-ppc/smp.h
+++ b/include/asm-ppc/smp.h
@@ -10,7 +10,6 @@
10#ifndef _PPC_SMP_H 10#ifndef _PPC_SMP_H
11#define _PPC_SMP_H 11#define _PPC_SMP_H
12 12
13#include <linux/config.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/bitops.h> 14#include <linux/bitops.h>
16#include <linux/errno.h> 15#include <linux/errno.h>
diff --git a/include/asm-ppc/time.h b/include/asm-ppc/time.h
index c86112323c9f..f7eadf6ac806 100644
--- a/include/asm-ppc/time.h
+++ b/include/asm-ppc/time.h
@@ -9,7 +9,6 @@
9#ifndef __ASM_TIME_H__ 9#ifndef __ASM_TIME_H__
10#define __ASM_TIME_H__ 10#define __ASM_TIME_H__
11 11
12#include <linux/config.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/rtc.h> 13#include <linux/rtc.h>
15#include <linux/threads.h> 14#include <linux/threads.h>
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h
index ca092ffb7a95..4d2b126ba159 100644
--- a/include/asm-s390/bitops.h
+++ b/include/asm-s390/bitops.h
@@ -12,7 +12,6 @@
12 * Copyright (C) 1992, Linus Torvalds 12 * Copyright (C) 1992, Linus Torvalds
13 * 13 *
14 */ 14 */
15#include <linux/config.h>
16#include <linux/compiler.h> 15#include <linux/compiler.h>
17 16
18/* 17/*
diff --git a/include/asm-s390/cmb.h b/include/asm-s390/cmb.h
index dae1dd4fb937..2d09950a9c11 100644
--- a/include/asm-s390/cmb.h
+++ b/include/asm-s390/cmb.h
@@ -47,7 +47,7 @@ struct cmbdata {
47/* reset channel measurement block */ 47/* reset channel measurement block */
48#define BIODASDRESETCMB _IO(DASD_IOCTL_LETTER,34) 48#define BIODASDRESETCMB _IO(DASD_IOCTL_LETTER,34)
49/* read channel measurement data */ 49/* read channel measurement data */
50#define BIODASDREADCMB _IOWR(DASD_IOCTL_LETTER,32,u64) 50#define BIODASDREADCMB _IOWR(DASD_IOCTL_LETTER,32,__u64)
51/* read channel measurement data */ 51/* read channel measurement data */
52#define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata) 52#define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata)
53 53
diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h
index 23450ed4b571..7f1ef99fd1e1 100644
--- a/include/asm-s390/debug.h
+++ b/include/asm-s390/debug.h
@@ -9,7 +9,6 @@
9#ifndef DEBUG_H 9#ifndef DEBUG_H
10#define DEBUG_H 10#define DEBUG_H
11 11
12#include <linux/config.h>
13#include <linux/fs.h> 12#include <linux/fs.h>
14#include <linux/string.h> 13#include <linux/string.h>
15 14
diff --git a/include/asm-s390/hardirq.h b/include/asm-s390/hardirq.h
index 6792c559a124..e84b7ef54aac 100644
--- a/include/asm-s390/hardirq.h
+++ b/include/asm-s390/hardirq.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_HARDIRQ_H 12#ifndef __ASM_HARDIRQ_H
13#define __ASM_HARDIRQ_H 13#define __ASM_HARDIRQ_H
14 14
15#include <linux/config.h>
16#include <linux/threads.h> 15#include <linux/threads.h>
17#include <linux/sched.h> 16#include <linux/sched.h>
18#include <linux/cache.h> 17#include <linux/cache.h>
diff --git a/include/asm-s390/idals.h b/include/asm-s390/idals.h
index 8038858b86bb..e82c10efe65a 100644
--- a/include/asm-s390/idals.h
+++ b/include/asm-s390/idals.h
@@ -13,7 +13,6 @@
13#ifndef _S390_IDALS_H 13#ifndef _S390_IDALS_H
14#define _S390_IDALS_H 14#define _S390_IDALS_H
15 15
16#include <linux/config.h>
17#include <linux/errno.h> 16#include <linux/errno.h>
18#include <linux/err.h> 17#include <linux/err.h>
19#include <linux/types.h> 18#include <linux/types.h>
diff --git a/include/asm-s390/io.h b/include/asm-s390/io.h
index b05825dd16d7..d4614b35f423 100644
--- a/include/asm-s390/io.h
+++ b/include/asm-s390/io.h
@@ -86,20 +86,25 @@ extern void iounmap(void *addr);
86#define readb(addr) (*(volatile unsigned char *) __io_virt(addr)) 86#define readb(addr) (*(volatile unsigned char *) __io_virt(addr))
87#define readw(addr) (*(volatile unsigned short *) __io_virt(addr)) 87#define readw(addr) (*(volatile unsigned short *) __io_virt(addr))
88#define readl(addr) (*(volatile unsigned int *) __io_virt(addr)) 88#define readl(addr) (*(volatile unsigned int *) __io_virt(addr))
89#define readq(addr) (*(volatile unsigned long long *) __io_virt(addr))
89 90
90#define readb_relaxed(addr) readb(addr) 91#define readb_relaxed(addr) readb(addr)
91#define readw_relaxed(addr) readw(addr) 92#define readw_relaxed(addr) readw(addr)
92#define readl_relaxed(addr) readl(addr) 93#define readl_relaxed(addr) readl(addr)
94#define readq_relaxed(addr) readq(addr)
93#define __raw_readb readb 95#define __raw_readb readb
94#define __raw_readw readw 96#define __raw_readw readw
95#define __raw_readl readl 97#define __raw_readl readl
98#define __raw_readq readq
96 99
97#define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b)) 100#define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b))
98#define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) 101#define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b))
99#define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) 102#define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b))
103#define writeq(b,addr) (*(volatile unsigned long long *) __io_virt(addr) = (b))
100#define __raw_writeb writeb 104#define __raw_writeb writeb
101#define __raw_writew writew 105#define __raw_writew writew
102#define __raw_writel writel 106#define __raw_writel writel
107#define __raw_writeq writeq
103 108
104#define memset_io(a,b,c) memset(__io_virt(a),(b),(c)) 109#define memset_io(a,b,c) memset(__io_virt(a),(b),(c))
105#define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c)) 110#define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c))
diff --git a/include/asm-s390/irq.h b/include/asm-s390/irq.h
index 916a1aa0b073..bd1a721f7aa2 100644
--- a/include/asm-s390/irq.h
+++ b/include/asm-s390/irq.h
@@ -21,10 +21,6 @@ enum interruption_class {
21 21
22#define touch_nmi_watchdog() do { } while(0) 22#define touch_nmi_watchdog() do { } while(0)
23 23
24struct irqaction;
25struct pt_regs;
26int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
27
28#endif /* __KERNEL__ */ 24#endif /* __KERNEL__ */
29#endif 25#endif
30 26
diff --git a/include/asm-s390/local.h b/include/asm-s390/local.h
index cf8189009c30..86745a1b29bb 100644
--- a/include/asm-s390/local.h
+++ b/include/asm-s390/local.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_LOCAL_H 1#ifndef _ASM_LOCAL_H
2#define _ASM_LOCAL_H 2#define _ASM_LOCAL_H
3 3
4#include <linux/config.h>
5#include <linux/percpu.h> 4#include <linux/percpu.h>
6#include <asm/atomic.h> 5#include <asm/atomic.h>
7 6
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h
index bea727904287..596c8b172104 100644
--- a/include/asm-s390/lowcore.h
+++ b/include/asm-s390/lowcore.h
@@ -124,7 +124,6 @@
124 124
125#ifndef __ASSEMBLY__ 125#ifndef __ASSEMBLY__
126 126
127#include <linux/config.h>
128#include <asm/processor.h> 127#include <asm/processor.h>
129#include <linux/types.h> 128#include <linux/types.h>
130#include <asm/sigp.h> 129#include <asm/sigp.h>
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h
index 3b1138ac7e79..b2628dc5c490 100644
--- a/include/asm-s390/page.h
+++ b/include/asm-s390/page.h
@@ -9,7 +9,6 @@
9#ifndef _S390_PAGE_H 9#ifndef _S390_PAGE_H
10#define _S390_PAGE_H 10#define _S390_PAGE_H
11 11
12#include <asm/setup.h>
13#include <asm/types.h> 12#include <asm/types.h>
14 13
15/* PAGE_SHIFT determines the page size */ 14/* PAGE_SHIFT determines the page size */
@@ -20,6 +19,7 @@
20#define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4) 19#define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4)
21 20
22#ifdef __KERNEL__ 21#ifdef __KERNEL__
22#include <asm/setup.h>
23#ifndef __ASSEMBLY__ 23#ifndef __ASSEMBLY__
24 24
25#ifndef __s390x__ 25#ifndef __s390x__
@@ -189,9 +189,9 @@ page_get_storage_key(unsigned long addr)
189#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 189#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
190 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 190 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
191 191
192#endif /* __KERNEL__ */
193
194#include <asm-generic/memory_model.h> 192#include <asm-generic/memory_model.h>
195#include <asm-generic/page.h> 193#include <asm-generic/page.h>
196 194
195#endif /* __KERNEL__ */
196
197#endif /* _S390_PAGE_H */ 197#endif /* _S390_PAGE_H */
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
index e28aaf28e4a8..3002fda89d33 100644
--- a/include/asm-s390/pgalloc.h
+++ b/include/asm-s390/pgalloc.h
@@ -13,7 +13,6 @@
13#ifndef _S390_PGALLOC_H 13#ifndef _S390_PGALLOC_H
14#define _S390_PGALLOC_H 14#define _S390_PGALLOC_H
15 15
16#include <linux/config.h>
17#include <linux/threads.h> 16#include <linux/threads.h>
18#include <linux/gfp.h> 17#include <linux/gfp.h>
19#include <linux/mm.h> 18#include <linux/mm.h>
diff --git a/include/asm-s390/posix_types.h b/include/asm-s390/posix_types.h
index 61788de3c0c3..b94c98856e12 100644
--- a/include/asm-s390/posix_types.h
+++ b/include/asm-s390/posix_types.h
@@ -76,24 +76,36 @@ typedef struct {
76} __kernel_fsid_t; 76} __kernel_fsid_t;
77 77
78 78
79#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) 79#ifdef __KERNEL__
80 80
81#ifndef _S390_BITOPS_H 81#undef __FD_SET
82#include <asm/bitops.h> 82static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
83#endif 83{
84 84 unsigned long _tmp = fd / __NFDBITS;
85#undef __FD_SET 85 unsigned long _rem = fd % __NFDBITS;
86#define __FD_SET(fd,fdsetp) set_bit((fd),(fdsetp)->fds_bits) 86 fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
87 87}
88#undef __FD_CLR 88
89#define __FD_CLR(fd,fdsetp) clear_bit((fd),(fdsetp)->fds_bits) 89#undef __FD_CLR
90 90static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
91#undef __FD_ISSET 91{
92#define __FD_ISSET(fd,fdsetp) test_bit((fd),(fdsetp)->fds_bits) 92 unsigned long _tmp = fd / __NFDBITS;
93 unsigned long _rem = fd % __NFDBITS;
94 fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
95}
96
97#undef __FD_ISSET
98static inline int __FD_ISSET(unsigned long fd, const __kernel_fd_set *fdsetp)
99{
100 unsigned long _tmp = fd / __NFDBITS;
101 unsigned long _rem = fd % __NFDBITS;
102 return (fdsetp->fds_bits[_tmp] & (1UL<<_rem)) != 0;
103}
93 104
94#undef __FD_ZERO 105#undef __FD_ZERO
95#define __FD_ZERO(fdsetp) (memset ((fdsetp), 0, sizeof(*(fd_set *)(fdsetp)))) 106#define __FD_ZERO(fdsetp) \
107 ((void) memset ((__ptr_t) (fdsetp), 0, sizeof (__kernel_fd_set)))
96 108
97#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)*/ 109#endif /* __KERNEL__ */
98 110
99#endif 111#endif
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
index a949cc077cc7..4d75d77b0f99 100644
--- a/include/asm-s390/ptrace.h
+++ b/include/asm-s390/ptrace.h
@@ -181,11 +181,8 @@
181#define PTRACE_OLDSETOPTIONS 21 181#define PTRACE_OLDSETOPTIONS 21
182 182
183#ifndef __ASSEMBLY__ 183#ifndef __ASSEMBLY__
184#include <linux/config.h>
185#include <linux/stddef.h> 184#include <linux/stddef.h>
186#include <linux/types.h> 185#include <linux/types.h>
187#include <asm/setup.h>
188#include <asm/page.h>
189 186
190typedef union 187typedef union
191{ 188{
@@ -301,6 +298,9 @@ typedef struct
301} s390_regs; 298} s390_regs;
302 299
303#ifdef __KERNEL__ 300#ifdef __KERNEL__
301#include <asm/setup.h>
302#include <asm/page.h>
303
304/* 304/*
305 * The pt_regs struct defines the way the registers are stored on 305 * The pt_regs struct defines the way the registers are stored on
306 * the stack during a system call. 306 * the stack during a system call.
diff --git a/include/asm-s390/sfp-machine.h b/include/asm-s390/sfp-machine.h
index 3c79b5384f44..de69dfa46fbb 100644
--- a/include/asm-s390/sfp-machine.h
+++ b/include/asm-s390/sfp-machine.h
@@ -25,7 +25,6 @@
25#ifndef _SFP_MACHINE_H 25#ifndef _SFP_MACHINE_H
26#define _SFP_MACHINE_H 26#define _SFP_MACHINE_H
27 27
28#include <linux/config.h>
29 28
30#define _FP_W_TYPE_SIZE 32 29#define _FP_W_TYPE_SIZE 32
31#define _FP_W_TYPE unsigned long 30#define _FP_W_TYPE unsigned long
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h
index 444dae5912e6..657646054c5e 100644
--- a/include/asm-s390/smp.h
+++ b/include/asm-s390/smp.h
@@ -10,7 +10,6 @@
10#ifndef __ASM_SMP_H 10#ifndef __ASM_SMP_H
11#define __ASM_SMP_H 11#define __ASM_SMP_H
12 12
13#include <linux/config.h>
14#include <linux/threads.h> 13#include <linux/threads.h>
15#include <linux/cpumask.h> 14#include <linux/cpumask.h>
16#include <linux/bitops.h> 15#include <linux/bitops.h>
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index 6a89dbb03c1e..71a0732cd518 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -11,7 +11,6 @@
11#ifndef __ASM_SYSTEM_H 11#ifndef __ASM_SYSTEM_H
12#define __ASM_SYSTEM_H 12#define __ASM_SYSTEM_H
13 13
14#include <linux/config.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <asm/types.h> 15#include <asm/types.h>
17#include <asm/ptrace.h> 16#include <asm/ptrace.h>
diff --git a/include/asm-s390/tlbflush.h b/include/asm-s390/tlbflush.h
index 1bb73b0e61fa..73cd85bebfb2 100644
--- a/include/asm-s390/tlbflush.h
+++ b/include/asm-s390/tlbflush.h
@@ -1,7 +1,6 @@
1#ifndef _S390_TLBFLUSH_H 1#ifndef _S390_TLBFLUSH_H
2#define _S390_TLBFLUSH_H 2#define _S390_TLBFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6#include <asm/processor.h> 5#include <asm/processor.h>
7 6
diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h
index 5738ad63537c..ae2951cc83ac 100644
--- a/include/asm-s390/types.h
+++ b/include/asm-s390/types.h
@@ -58,7 +58,6 @@ typedef __signed__ long saddr_t;
58 58
59#ifndef __ASSEMBLY__ 59#ifndef __ASSEMBLY__
60 60
61#include <linux/config.h>
62 61
63typedef signed char s8; 62typedef signed char s8;
64typedef unsigned char u8; 63typedef unsigned char u8;
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 41c2792ff6b0..e21443d3ea1d 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -392,6 +392,8 @@
392 392
393#endif 393#endif
394 394
395#ifdef __KERNEL__
396
395/* user-visible error numbers are in the range -1 - -122: see <asm-s390/errno.h> */ 397/* user-visible error numbers are in the range -1 - -122: see <asm-s390/errno.h> */
396 398
397#define __syscall_return(type, res) \ 399#define __syscall_return(type, res) \
@@ -546,7 +548,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
546 __syscall_return(type,__res); \ 548 __syscall_return(type,__res); \
547} 549}
548 550
549#ifdef __KERNEL__
550#define __ARCH_WANT_IPC_PARSE_VERSION 551#define __ARCH_WANT_IPC_PARSE_VERSION
551#define __ARCH_WANT_OLD_READDIR 552#define __ARCH_WANT_OLD_READDIR
552#define __ARCH_WANT_SYS_ALARM 553#define __ARCH_WANT_SYS_ALARM
@@ -573,11 +574,9 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
573# define __ARCH_WANT_COMPAT_SYS_TIME 574# define __ARCH_WANT_COMPAT_SYS_TIME
574# define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND 575# define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
575# endif 576# endif
576#endif
577 577
578#ifdef __KERNEL_SYSCALLS__ 578#ifdef __KERNEL_SYSCALLS__
579 579
580#include <linux/config.h>
581#include <linux/compiler.h> 580#include <linux/compiler.h>
582#include <linux/types.h> 581#include <linux/types.h>
583#include <asm/ptrace.h> 582#include <asm/ptrace.h>
@@ -625,7 +624,7 @@ asmlinkage long sys_rt_sigaction(int sig,
625 struct sigaction __user *oact, 624 struct sigaction __user *oact,
626 size_t sigsetsize); 625 size_t sigsetsize);
627 626
628#endif 627#endif /* __KERNEL_SYSCALLS__ */
629 628
630/* 629/*
631 * "Conditional" syscalls 630 * "Conditional" syscalls
@@ -635,4 +634,5 @@ asmlinkage long sys_rt_sigaction(int sig,
635 */ 634 */
636#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 635#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
637 636
637#endif /* __KERNEL__ */
638#endif /* _ASM_S390_UNISTD_H_ */ 638#endif /* _ASM_S390_UNISTD_H_ */
diff --git a/include/asm-s390/vtoc.h b/include/asm-s390/vtoc.h
index d1de5b7ebb0b..3a5267d90d29 100644
--- a/include/asm-s390/vtoc.h
+++ b/include/asm-s390/vtoc.h
@@ -177,27 +177,27 @@ struct vtoc_format7_label
177} __attribute__ ((packed)); 177} __attribute__ ((packed));
178 178
179struct vtoc_cms_label { 179struct vtoc_cms_label {
180 u8 label_id[4]; /* Label identifier */ 180 __u8 label_id[4]; /* Label identifier */
181 u8 vol_id[6]; /* Volid */ 181 __u8 vol_id[6]; /* Volid */
182 u16 version_id; /* Version identifier */ 182 __u16 version_id; /* Version identifier */
183 u32 block_size; /* Disk block size */ 183 __u32 block_size; /* Disk block size */
184 u32 origin_ptr; /* Disk origin pointer */ 184 __u32 origin_ptr; /* Disk origin pointer */
185 u32 usable_count; /* Number of usable cylinders/blocks */ 185 __u32 usable_count; /* Number of usable cylinders/blocks */
186 u32 formatted_count; /* Maximum number of formatted cylinders/ 186 __u32 formatted_count; /* Maximum number of formatted cylinders/
187 * blocks */ 187 * blocks */
188 u32 block_count; /* Disk size in CMS blocks */ 188 __u32 block_count; /* Disk size in CMS blocks */
189 u32 used_count; /* Number of CMS blocks in use */ 189 __u32 used_count; /* Number of CMS blocks in use */
190 u32 fst_size; /* File Status Table (FST) size */ 190 __u32 fst_size; /* File Status Table (FST) size */
191 u32 fst_count; /* Number of FSTs per CMS block */ 191 __u32 fst_count; /* Number of FSTs per CMS block */
192 u8 format_date[6]; /* Disk FORMAT date */ 192 __u8 format_date[6]; /* Disk FORMAT date */
193 u8 reserved1[2]; 193 __u8 reserved1[2];
194 u32 disk_offset; /* Disk offset when reserved*/ 194 __u32 disk_offset; /* Disk offset when reserved*/
195 u32 map_block; /* Allocation Map Block with next hole */ 195 __u32 map_block; /* Allocation Map Block with next hole */
196 u32 hblk_disp; /* Displacement into HBLK data of next hole */ 196 __u32 hblk_disp; /* Displacement into HBLK data of next hole */
197 u32 user_disp; /* Displacement into user part of Allocation 197 __u32 user_disp; /* Displacement into user part of Allocation
198 * map */ 198 * map */
199 u8 reserved2[4]; 199 __u8 reserved2[4];
200 u8 segment_name[8]; /* Name of shared segment */ 200 __u8 segment_name[8]; /* Name of shared segment */
201} __attribute__ ((packed)); 201} __attribute__ ((packed));
202 202
203#endif /* _ASM_S390_VTOC_H */ 203#endif /* _ASM_S390_VTOC_H */
diff --git a/include/asm-s390/z90crypt.h b/include/asm-s390/z90crypt.h
new file mode 100644
index 000000000000..31a2439b07bd
--- /dev/null
+++ b/include/asm-s390/z90crypt.h
@@ -0,0 +1,212 @@
1/*
2 * include/asm-s390/z90crypt.h
3 *
4 * z90crypt 1.3.3 (user-visible header)
5 *
6 * Copyright (C) 2001, 2005 IBM Corporation
7 * Author(s): Robert Burroughs
8 * Eric Rossman (edrossma@us.ibm.com)
9 *
10 * Hotplug & misc device support: Jochen Roehrig (roehrig@de.ibm.com)
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, or (at your option)
15 * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26
27#ifndef __ASM_S390_Z90CRYPT_H
28#define __ASM_S390_Z90CRYPT_H
29#include <linux/ioctl.h>
30
31#define z90crypt_VERSION 1
32#define z90crypt_RELEASE 3 // 2 = PCIXCC, 3 = rewrite for coding standards
33#define z90crypt_VARIANT 3 // 3 = CEX2A support
34
35/**
36 * struct ica_rsa_modexpo
37 *
38 * Requirements:
39 * - outputdatalength is at least as large as inputdatalength.
40 * - All key parts are right justified in their fields, padded on
41 * the left with zeroes.
42 * - length(b_key) = inputdatalength
43 * - length(n_modulus) = inputdatalength
44 */
45struct ica_rsa_modexpo {
46 char __user * inputdata;
47 unsigned int inputdatalength;
48 char __user * outputdata;
49 unsigned int outputdatalength;
50 char __user * b_key;
51 char __user * n_modulus;
52};
53
54/**
55 * struct ica_rsa_modexpo_crt
56 *
57 * Requirements:
58 * - inputdatalength is even.
59 * - outputdatalength is at least as large as inputdatalength.
60 * - All key parts are right justified in their fields, padded on
61 * the left with zeroes.
62 * - length(bp_key) = inputdatalength/2 + 8
63 * - length(bq_key) = inputdatalength/2
64 * - length(np_key) = inputdatalength/2 + 8
65 * - length(nq_key) = inputdatalength/2
66 * - length(u_mult_inv) = inputdatalength/2 + 8
67 */
68struct ica_rsa_modexpo_crt {
69 char __user * inputdata;
70 unsigned int inputdatalength;
71 char __user * outputdata;
72 unsigned int outputdatalength;
73 char __user * bp_key;
74 char __user * bq_key;
75 char __user * np_prime;
76 char __user * nq_prime;
77 char __user * u_mult_inv;
78};
79
80#define Z90_IOCTL_MAGIC 'z' // NOTE: Need to allocate from linux folks
81
82/**
83 * Interface notes:
84 *
85 * The ioctl()s which are implemented (along with relevant details)
86 * are:
87 *
88 * ICARSAMODEXPO
89 * Perform an RSA operation using a Modulus-Exponent pair
90 * This takes an ica_rsa_modexpo struct as its arg.
91 *
92 * NOTE: please refer to the comments preceding this structure
93 * for the implementation details for the contents of the
94 * block
95 *
96 * ICARSACRT
97 * Perform an RSA operation using a Chinese-Remainder Theorem key
98 * This takes an ica_rsa_modexpo_crt struct as its arg.
99 *
100 * NOTE: please refer to the comments preceding this structure
101 * for the implementation details for the contents of the
102 * block
103 *
104 * Z90STAT_TOTALCOUNT
105 * Return an integer count of all device types together.
106 *
107 * Z90STAT_PCICACOUNT
108 * Return an integer count of all PCICAs.
109 *
110 * Z90STAT_PCICCCOUNT
111 * Return an integer count of all PCICCs.
112 *
113 * Z90STAT_PCIXCCMCL2COUNT
114 * Return an integer count of all MCL2 PCIXCCs.
115 *
116 * Z90STAT_PCIXCCMCL3COUNT
117 * Return an integer count of all MCL3 PCIXCCs.
118 *
119 * Z90STAT_CEX2CCOUNT
120 * Return an integer count of all CEX2Cs.
121 *
122 * Z90STAT_CEX2ACOUNT
123 * Return an integer count of all CEX2As.
124 *
125 * Z90STAT_REQUESTQ_COUNT
126 * Return an integer count of the number of entries waiting to be
127 * sent to a device.
128 *
129 * Z90STAT_PENDINGQ_COUNT
130 * Return an integer count of the number of entries sent to a
131 * device awaiting the reply.
132 *
133 * Z90STAT_TOTALOPEN_COUNT
134 * Return an integer count of the number of open file handles.
135 *
136 * Z90STAT_DOMAIN_INDEX
137 * Return the integer value of the Cryptographic Domain.
138 *
139 * Z90STAT_STATUS_MASK
140 * Return an 64 element array of unsigned chars for the status of
141 * all devices.
142 * 0x01: PCICA
143 * 0x02: PCICC
144 * 0x03: PCIXCC_MCL2
145 * 0x04: PCIXCC_MCL3
146 * 0x05: CEX2C
147 * 0x06: CEX2A
148 * 0x0d: device is disabled via the proc filesystem
149 *
150 * Z90STAT_QDEPTH_MASK
151 * Return an 64 element array of unsigned chars for the queue
152 * depth of all devices.
153 *
154 * Z90STAT_PERDEV_REQCNT
155 * Return an 64 element array of unsigned integers for the number
156 * of successfully completed requests per device since the device
157 * was detected and made available.
158 *
159 * ICAZ90STATUS (deprecated)
160 * Return some device driver status in a ica_z90_status struct
161 * This takes an ica_z90_status struct as its arg.
162 *
163 * NOTE: this ioctl() is deprecated, and has been replaced with
164 * single ioctl()s for each type of status being requested
165 *
166 * Z90STAT_PCIXCCCOUNT (deprecated)
167 * Return an integer count of all PCIXCCs (MCL2 + MCL3).
168 * This is DEPRECATED now that MCL3 PCIXCCs are treated differently from
169 * MCL2 PCIXCCs.
170 *
171 * Z90QUIESCE (not recommended)
172 * Quiesce the driver. This is intended to stop all new
173 * requests from being processed. Its use is NOT recommended,
174 * except in circumstances where there is no other way to stop
175 * callers from accessing the driver. Its original use was to
176 * allow the driver to be "drained" of work in preparation for
177 * a system shutdown.
178 *
179 * NOTE: once issued, this ban on new work cannot be undone
180 * except by unloading and reloading the driver.
181 */
182
183/**
184 * Supported ioctl calls
185 */
186#define ICARSAMODEXPO _IOC(_IOC_READ|_IOC_WRITE, Z90_IOCTL_MAGIC, 0x05, 0)
187#define ICARSACRT _IOC(_IOC_READ|_IOC_WRITE, Z90_IOCTL_MAGIC, 0x06, 0)
188
189/* DEPRECATED status calls (bound for removal at some point) */
190#define ICAZ90STATUS _IOR(Z90_IOCTL_MAGIC, 0x10, struct ica_z90_status)
191#define Z90STAT_PCIXCCCOUNT _IOR(Z90_IOCTL_MAGIC, 0x43, int)
192
193/* unrelated to ICA callers */
194#define Z90QUIESCE _IO(Z90_IOCTL_MAGIC, 0x11)
195
196/* New status calls */
197#define Z90STAT_TOTALCOUNT _IOR(Z90_IOCTL_MAGIC, 0x40, int)
198#define Z90STAT_PCICACOUNT _IOR(Z90_IOCTL_MAGIC, 0x41, int)
199#define Z90STAT_PCICCCOUNT _IOR(Z90_IOCTL_MAGIC, 0x42, int)
200#define Z90STAT_PCIXCCMCL2COUNT _IOR(Z90_IOCTL_MAGIC, 0x4b, int)
201#define Z90STAT_PCIXCCMCL3COUNT _IOR(Z90_IOCTL_MAGIC, 0x4c, int)
202#define Z90STAT_CEX2CCOUNT _IOR(Z90_IOCTL_MAGIC, 0x4d, int)
203#define Z90STAT_CEX2ACOUNT _IOR(Z90_IOCTL_MAGIC, 0x4e, int)
204#define Z90STAT_REQUESTQ_COUNT _IOR(Z90_IOCTL_MAGIC, 0x44, int)
205#define Z90STAT_PENDINGQ_COUNT _IOR(Z90_IOCTL_MAGIC, 0x45, int)
206#define Z90STAT_TOTALOPEN_COUNT _IOR(Z90_IOCTL_MAGIC, 0x46, int)
207#define Z90STAT_DOMAIN_INDEX _IOR(Z90_IOCTL_MAGIC, 0x47, int)
208#define Z90STAT_STATUS_MASK _IOR(Z90_IOCTL_MAGIC, 0x48, char[64])
209#define Z90STAT_QDEPTH_MASK _IOR(Z90_IOCTL_MAGIC, 0x49, char[64])
210#define Z90STAT_PERDEV_REQCNT _IOR(Z90_IOCTL_MAGIC, 0x4a, int[64])
211
212#endif /* __ASM_S390_Z90CRYPT_H */
diff --git a/include/asm-sh/bug.h b/include/asm-sh/bug.h
index 70508a360cd6..1b4fc52a59e8 100644
--- a/include/asm-sh/bug.h
+++ b/include/asm-sh/bug.h
@@ -1,7 +1,6 @@
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#include <linux/config.h>
5 4
6#ifdef CONFIG_BUG 5#ifdef CONFIG_BUG
7/* 6/*
diff --git a/include/asm-sh/checksum.h b/include/asm-sh/checksum.h
index 5ebd0f24299e..fa03b30c4269 100644
--- a/include/asm-sh/checksum.h
+++ b/include/asm-sh/checksum.h
@@ -9,7 +9,6 @@
9 * Copyright (C) 1999 by Kaz Kojima & Niibe Yutaka 9 * Copyright (C) 1999 by Kaz Kojima & Niibe Yutaka
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/in6.h> 12#include <linux/in6.h>
14 13
15/* 14/*
diff --git a/include/asm-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h
index 48f1f42c5d14..124968f9866e 100644
--- a/include/asm-sh/dma-mapping.h
+++ b/include/asm-sh/dma-mapping.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SH_DMA_MAPPING_H 1#ifndef __ASM_SH_DMA_MAPPING_H
2#define __ASM_SH_DMA_MAPPING_H 2#define __ASM_SH_DMA_MAPPING_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6#include <asm/scatterlist.h> 5#include <asm/scatterlist.h>
7#include <asm/cacheflush.h> 6#include <asm/cacheflush.h>
diff --git a/include/asm-sh/dma.h b/include/asm-sh/dma.h
index a118a0d43053..e62a6d0ed932 100644
--- a/include/asm-sh/dma.h
+++ b/include/asm-sh/dma.h
@@ -11,7 +11,6 @@
11#define __ASM_SH_DMA_H 11#define __ASM_SH_DMA_H
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13 13
14#include <linux/config.h>
15#include <linux/spinlock.h> 14#include <linux/spinlock.h>
16#include <linux/wait.h> 15#include <linux/wait.h>
17#include <linux/sysdev.h> 16#include <linux/sysdev.h>
diff --git a/include/asm-sh/fixmap.h b/include/asm-sh/fixmap.h
index 509224bdba28..412bccaa07e6 100644
--- a/include/asm-sh/fixmap.h
+++ b/include/asm-sh/fixmap.h
@@ -13,7 +13,6 @@
13#ifndef _ASM_FIXMAP_H 13#ifndef _ASM_FIXMAP_H
14#define _ASM_FIXMAP_H 14#define _ASM_FIXMAP_H
15 15
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <asm/page.h> 17#include <asm/page.h>
19#ifdef CONFIG_HIGHMEM 18#ifdef CONFIG_HIGHMEM
diff --git a/include/asm-sh/hardirq.h b/include/asm-sh/hardirq.h
index f2fdf0f760e5..715ee237fc77 100644
--- a/include/asm-sh/hardirq.h
+++ b/include/asm-sh/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SH_HARDIRQ_H 1#ifndef __ASM_SH_HARDIRQ_H
2#define __ASM_SH_HARDIRQ_H 2#define __ASM_SH_HARDIRQ_H
3 3
4#include <linux/config.h>
5#include <linux/threads.h> 4#include <linux/threads.h>
6#include <linux/irq.h> 5#include <linux/irq.h>
7 6
diff --git a/include/asm-sh/hd64461/hd64461.h b/include/asm-sh/hd64461/hd64461.h
index c457ca277a42..87f13d24c630 100644
--- a/include/asm-sh/hd64461/hd64461.h
+++ b/include/asm-sh/hd64461/hd64461.h
@@ -5,7 +5,6 @@
5 * Copyright (C) 2000 YAEGASHI Takeshi 5 * Copyright (C) 2000 YAEGASHI Takeshi
6 * Hitachi HD64461 companion chip support 6 * Hitachi HD64461 companion chip support
7 */ 7 */
8#include <linux/config.h>
9 8
10/* Constants for PCMCIA mappings */ 9/* Constants for PCMCIA mappings */
11#define HD64461_PCC_WINDOW 0x01000000 10#define HD64461_PCC_WINDOW 0x01000000
diff --git a/include/asm-sh/hd64465/hd64465.h b/include/asm-sh/hd64465/hd64465.h
index c672032b72c9..cfd0e803d2a2 100644
--- a/include/asm-sh/hd64465/hd64465.h
+++ b/include/asm-sh/hd64465/hd64465.h
@@ -11,7 +11,6 @@
11 * Derived from <asm/hd64461.h> which bore the message: 11 * Derived from <asm/hd64461.h> which bore the message:
12 * Copyright (C) 2000 YAEGASHI Takeshi 12 * Copyright (C) 2000 YAEGASHI Takeshi
13 */ 13 */
14#include <linux/config.h>
15#include <asm/io.h> 14#include <asm/io.h>
16#include <asm/irq.h> 15#include <asm/irq.h>
17 16
diff --git a/include/asm-sh/ide.h b/include/asm-sh/ide.h
index 711dad4cb48b..9f8e9142dc33 100644
--- a/include/asm-sh/ide.h
+++ b/include/asm-sh/ide.h
@@ -14,7 +14,6 @@
14 14
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16 16
17#include <linux/config.h>
18 17
19#define ide_default_io_ctl(base) (0) 18#define ide_default_io_ctl(base) (0)
20 19
diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h
index 2c3afe71323d..894e64b2d5f0 100644
--- a/include/asm-sh/io.h
+++ b/include/asm-sh/io.h
@@ -23,7 +23,6 @@
23 * inb by default expands to _inb, but the machine specific code may 23 * inb by default expands to _inb, but the machine specific code may
24 * define it to __inb if it chooses. 24 * define it to __inb if it chooses.
25 */ 25 */
26#include <linux/config.h>
27#include <asm/cache.h> 26#include <asm/cache.h>
28#include <asm/system.h> 27#include <asm/system.h>
29#include <asm/addrspace.h> 28#include <asm/addrspace.h>
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
index 42b8394c04ed..611e67cd0627 100644
--- a/include/asm-sh/irq.h
+++ b/include/asm-sh/irq.h
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <asm/machvec.h> 14#include <asm/machvec.h>
16#include <asm/ptrace.h> /* for pt_regs */ 15#include <asm/ptrace.h> /* for pt_regs */
17 16
diff --git a/include/asm-sh/keyboard.h b/include/asm-sh/keyboard.h
index 1103df003243..31dcc4fa5f28 100644
--- a/include/asm-sh/keyboard.h
+++ b/include/asm-sh/keyboard.h
@@ -5,7 +5,6 @@
5 */ 5 */
6 6
7#include <linux/kd.h> 7#include <linux/kd.h>
8#include <linux/config.h>
9#include <asm/machvec.h> 8#include <asm/machvec.h>
10 9
11#ifdef CONFIG_SH_MPC1211 10#ifdef CONFIG_SH_MPC1211
diff --git a/include/asm-sh/kmap_types.h b/include/asm-sh/kmap_types.h
index 2492ba07148f..84d565c696be 100644
--- a/include/asm-sh/kmap_types.h
+++ b/include/asm-sh/kmap_types.h
@@ -3,7 +3,6 @@
3 3
4/* Dummy header just to define km_type. */ 4/* Dummy header just to define km_type. */
5 5
6#include <linux/config.h>
7 6
8#ifdef CONFIG_DEBUG_HIGHMEM 7#ifdef CONFIG_DEBUG_HIGHMEM
9# define D(n) __KM_FENCE_##n , 8# define D(n) __KM_FENCE_##n ,
diff --git a/include/asm-sh/machvec.h b/include/asm-sh/machvec.h
index 550c50a7359e..550501fa4fed 100644
--- a/include/asm-sh/machvec.h
+++ b/include/asm-sh/machvec.h
@@ -10,7 +10,6 @@
10#ifndef _ASM_SH_MACHVEC_H 10#ifndef _ASM_SH_MACHVEC_H
11#define _ASM_SH_MACHVEC_H 1 11#define _ASM_SH_MACHVEC_H 1
12 12
13#include <linux/config.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/time.h> 14#include <linux/time.h>
16 15
diff --git a/include/asm-sh/machvec_init.h b/include/asm-sh/machvec_init.h
index 9e7de808f7f8..e397798ebd94 100644
--- a/include/asm-sh/machvec_init.h
+++ b/include/asm-sh/machvec_init.h
@@ -12,7 +12,6 @@
12#ifndef __SH_MACHVEC_INIT_H 12#ifndef __SH_MACHVEC_INIT_H
13#define __SH_MACHVEC_INIT_H 13#define __SH_MACHVEC_INIT_H
14 14
15#include <linux/config.h>
16 15
17/* 16/*
18 * In a GENERIC kernel, we have lots of these vectors floating about, 17 * In a GENERIC kernel, we have lots of these vectors floating about,
diff --git a/include/asm-sh/mpc1211/dma.h b/include/asm-sh/mpc1211/dma.h
index 0a2fdab3e454..e506d1aaa0d0 100644
--- a/include/asm-sh/mpc1211/dma.h
+++ b/include/asm-sh/mpc1211/dma.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_MPC1211_DMA_H 8#ifndef _ASM_MPC1211_DMA_H
9#define _ASM_MPC1211_DMA_H 9#define _ASM_MPC1211_DMA_H
10 10
11#include <linux/config.h>
12#include <linux/spinlock.h> /* And spinlocks */ 11#include <linux/spinlock.h> /* And spinlocks */
13#include <asm/io.h> /* need byte IO */ 12#include <asm/io.h> /* need byte IO */
14#include <linux/delay.h> 13#include <linux/delay.h>
diff --git a/include/asm-sh/overdrive/overdrive.h b/include/asm-sh/overdrive/overdrive.h
index aa62ae68c55c..fc746c244f83 100644
--- a/include/asm-sh/overdrive/overdrive.h
+++ b/include/asm-sh/overdrive/overdrive.h
@@ -6,7 +6,6 @@
6 * 6 *
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11#ifndef __OVERDRIVE_H__ 10#ifndef __OVERDRIVE_H__
12#define __OVERDRIVE_H__ 11#define __OVERDRIVE_H__
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h
index 9c89287c3e56..a5559e38744e 100644
--- a/include/asm-sh/page.h
+++ b/include/asm-sh/page.h
@@ -13,7 +13,6 @@
13 [ P4 control ] 0xE0000000 13 [ P4 control ] 0xE0000000
14 */ 14 */
15 15
16#include <linux/config.h>
17 16
18/* PAGE_SHIFT determines the page size */ 17/* PAGE_SHIFT determines the page size */
19#define PAGE_SHIFT 12 18#define PAGE_SHIFT 12
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index bb0efb31a8cb..dcd23a03683d 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -8,7 +8,6 @@
8 * Copyright (C) 2002, 2003, 2004 Paul Mundt 8 * Copyright (C) 2002, 2003, 2004 Paul Mundt
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <asm/pgtable-2level.h> 11#include <asm/pgtable-2level.h>
13 12
14/* 13/*
diff --git a/include/asm-sh/serial.h b/include/asm-sh/serial.h
index f51e232d5cd9..8734590d27e8 100644
--- a/include/asm-sh/serial.h
+++ b/include/asm-sh/serial.h
@@ -7,7 +7,6 @@
7#ifndef _ASM_SERIAL_H 7#ifndef _ASM_SERIAL_H
8#define _ASM_SERIAL_H 8#define _ASM_SERIAL_H
9 9
10#include <linux/config.h>
11#include <linux/kernel.h> 10#include <linux/kernel.h>
12 11
13#ifdef CONFIG_SH_EC3104 12#ifdef CONFIG_SH_EC3104
diff --git a/include/asm-sh/smp.h b/include/asm-sh/smp.h
index f19a8b3b69a6..f57c4fe9692a 100644
--- a/include/asm-sh/smp.h
+++ b/include/asm-sh/smp.h
@@ -10,7 +10,6 @@
10#ifndef __ASM_SH_SMP_H 10#ifndef __ASM_SH_SMP_H
11#define __ASM_SH_SMP_H 11#define __ASM_SH_SMP_H
12 12
13#include <linux/config.h>
14#include <linux/bitops.h> 13#include <linux/bitops.h>
15#include <linux/cpumask.h> 14#include <linux/cpumask.h>
16 15
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index bb0330499bdf..b752e5cbb830 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -6,7 +6,6 @@
6 * Copyright (C) 2002 Paul Mundt 6 * Copyright (C) 2002 Paul Mundt
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11/* 10/*
12 * switch_to() should switch tasks to task nr n, first 11 * switch_to() should switch tasks to task nr n, first
diff --git a/include/asm-sh/types.h b/include/asm-sh/types.h
index 488552f43b2a..3c09dd4ca31c 100644
--- a/include/asm-sh/types.h
+++ b/include/asm-sh/types.h
@@ -35,7 +35,6 @@ typedef unsigned long long __u64;
35 35
36#ifndef __ASSEMBLY__ 36#ifndef __ASSEMBLY__
37 37
38#include <linux/config.h>
39 38
40typedef __signed__ char s8; 39typedef __signed__ char s8;
41typedef unsigned char u8; 40typedef unsigned char u8;
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index 05520cebda12..76b5430cb458 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -304,6 +304,8 @@
304 304
305#define NR_syscalls 293 305#define NR_syscalls 293
306 306
307#ifdef __KERNEL__
308
307/* user-visible error numbers are in the range -1 - -124: see <asm-sh/errno.h> */ 309/* user-visible error numbers are in the range -1 - -124: see <asm-sh/errno.h> */
308 310
309#define __syscall_return(type, res) \ 311#define __syscall_return(type, res) \
@@ -420,7 +422,6 @@ __asm__ __volatile__ ("trapa #0x16" \
420__syscall_return(type,__sc0); \ 422__syscall_return(type,__sc0); \
421} 423}
422 424
423#ifdef __KERNEL__
424#define __ARCH_WANT_IPC_PARSE_VERSION 425#define __ARCH_WANT_IPC_PARSE_VERSION
425#define __ARCH_WANT_OLD_READDIR 426#define __ARCH_WANT_OLD_READDIR
426#define __ARCH_WANT_OLD_STAT 427#define __ARCH_WANT_OLD_STAT
@@ -443,7 +444,6 @@ __syscall_return(type,__sc0); \
443#define __ARCH_WANT_SYS_SIGPENDING 444#define __ARCH_WANT_SYS_SIGPENDING
444#define __ARCH_WANT_SYS_SIGPROCMASK 445#define __ARCH_WANT_SYS_SIGPROCMASK
445#define __ARCH_WANT_SYS_RT_SIGACTION 446#define __ARCH_WANT_SYS_RT_SIGACTION
446#endif
447 447
448#ifdef __KERNEL_SYSCALLS__ 448#ifdef __KERNEL_SYSCALLS__
449 449
@@ -513,7 +513,7 @@ asmlinkage long sys_rt_sigaction(int sig,
513 struct sigaction __user *oact, 513 struct sigaction __user *oact,
514 size_t sigsetsize); 514 size_t sigsetsize);
515 515
516#endif 516#endif /* __KERNEL_SYSCALLS__ */
517 517
518/* 518/*
519 * "Conditional" syscalls 519 * "Conditional" syscalls
@@ -525,4 +525,5 @@ asmlinkage long sys_rt_sigaction(int sig,
525#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 525#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
526#endif 526#endif
527 527
528#endif /* __KERNEL__ */
528#endif /* __ASM_SH_UNISTD_H */ 529#endif /* __ASM_SH_UNISTD_H */
diff --git a/include/asm-sh/watchdog.h b/include/asm-sh/watchdog.h
index f0cf4be21655..09ca41972a11 100644
--- a/include/asm-sh/watchdog.h
+++ b/include/asm-sh/watchdog.h
@@ -13,7 +13,6 @@
13#ifdef __KERNEL__ 13#ifdef __KERNEL__
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/config.h>
17#include <asm/cpu/watchdog.h> 16#include <asm/cpu/watchdog.h>
18#include <asm/io.h> 17#include <asm/io.h>
19 18
diff --git a/include/asm-sh64/bug.h b/include/asm-sh64/bug.h
index 5d659ec28e10..81f722efeb63 100644
--- a/include/asm-sh64/bug.h
+++ b/include/asm-sh64/bug.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SH64_BUG_H 1#ifndef __ASM_SH64_BUG_H
2#define __ASM_SH64_BUG_H 2#define __ASM_SH64_BUG_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * Tell the user there is some problem, then force a segfault (in process 6 * Tell the user there is some problem, then force a segfault (in process
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h
index cc9a2e86f5b4..a74a49e47922 100644
--- a/include/asm-sh64/dma-mapping.h
+++ b/include/asm-sh64/dma-mapping.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SH_DMA_MAPPING_H 1#ifndef __ASM_SH_DMA_MAPPING_H
2#define __ASM_SH_DMA_MAPPING_H 2#define __ASM_SH_DMA_MAPPING_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6#include <asm/scatterlist.h> 5#include <asm/scatterlist.h>
7#include <asm/io.h> 6#include <asm/io.h>
diff --git a/include/asm-sh64/hardirq.h b/include/asm-sh64/hardirq.h
index ad2330e41fd5..555fd7a35108 100644
--- a/include/asm-sh64/hardirq.h
+++ b/include/asm-sh64/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SH64_HARDIRQ_H 1#ifndef __ASM_SH64_HARDIRQ_H
2#define __ASM_SH64_HARDIRQ_H 2#define __ASM_SH64_HARDIRQ_H
3 3
4#include <linux/config.h>
5#include <linux/threads.h> 4#include <linux/threads.h>
6#include <linux/irq.h> 5#include <linux/irq.h>
7 6
diff --git a/include/asm-sh64/ide.h b/include/asm-sh64/ide.h
index 852f50afe39c..c9d84d5f772e 100644
--- a/include/asm-sh64/ide.h
+++ b/include/asm-sh64/ide.h
@@ -15,7 +15,6 @@
15 15
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17 17
18#include <linux/config.h>
19 18
20/* Without this, the initialisation of PCI IDE cards end up calling 19/* Without this, the initialisation of PCI IDE cards end up calling
21 * ide_init_hwif_ports, which won't work. */ 20 * ide_init_hwif_ports, which won't work. */
diff --git a/include/asm-sh64/irq.h b/include/asm-sh64/irq.h
index f815b43df845..1ca49e29288a 100644
--- a/include/asm-sh64/irq.h
+++ b/include/asm-sh64/irq.h
@@ -12,7 +12,6 @@
12 * 12 *
13 */ 13 */
14 14
15#include <linux/config.h>
16 15
17/* 16/*
18 * Encoded IRQs are not considered worth to be supported. 17 * Encoded IRQs are not considered worth to be supported.
diff --git a/include/asm-sh64/mmu_context.h b/include/asm-sh64/mmu_context.h
index 991cfda4cdf6..8c860dab2d0e 100644
--- a/include/asm-sh64/mmu_context.h
+++ b/include/asm-sh64/mmu_context.h
@@ -26,7 +26,6 @@
26 */ 26 */
27extern unsigned long mmu_context_cache; 27extern unsigned long mmu_context_cache;
28 28
29#include <linux/config.h>
30#include <asm/page.h> 29#include <asm/page.h>
31 30
32 31
diff --git a/include/asm-sh64/page.h b/include/asm-sh64/page.h
index e4937cdabebd..34fb34754ae6 100644
--- a/include/asm-sh64/page.h
+++ b/include/asm-sh64/page.h
@@ -17,7 +17,6 @@
17 * 17 *
18 */ 18 */
19 19
20#include <linux/config.h>
21 20
22/* PAGE_SHIFT determines the page size */ 21/* PAGE_SHIFT determines the page size */
23#define PAGE_SHIFT 12 22#define PAGE_SHIFT 12
diff --git a/include/asm-sh64/param.h b/include/asm-sh64/param.h
index d18cc87c1a80..f409adb41540 100644
--- a/include/asm-sh64/param.h
+++ b/include/asm-sh64/param.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_SH64_PARAM_H 12#ifndef __ASM_SH64_PARAM_H
13#define __ASM_SH64_PARAM_H 13#define __ASM_SH64_PARAM_H
14 14
15#include <linux/config.h>
16 15
17#ifdef __KERNEL__ 16#ifdef __KERNEL__
18# ifdef CONFIG_SH_WDT 17# ifdef CONFIG_SH_WDT
diff --git a/include/asm-sh64/pgtable.h b/include/asm-sh64/pgtable.h
index 57af6b3eb271..54c7821893f5 100644
--- a/include/asm-sh64/pgtable.h
+++ b/include/asm-sh64/pgtable.h
@@ -22,7 +22,6 @@
22#include <asm/processor.h> 22#include <asm/processor.h>
23#include <asm/page.h> 23#include <asm/page.h>
24#include <linux/threads.h> 24#include <linux/threads.h>
25#include <linux/config.h>
26 25
27struct vm_area_struct; 26struct vm_area_struct;
28 27
diff --git a/include/asm-sh64/system.h b/include/asm-sh64/system.h
index 3002e988180c..7606f6e1f01e 100644
--- a/include/asm-sh64/system.h
+++ b/include/asm-sh64/system.h
@@ -14,7 +14,6 @@
14 * 14 *
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <asm/registers.h> 17#include <asm/registers.h>
19#include <asm/processor.h> 18#include <asm/processor.h>
20 19
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h
index 1f8f394ae371..9a1590fffc15 100644
--- a/include/asm-sh64/unistd.h
+++ b/include/asm-sh64/unistd.h
@@ -344,6 +344,8 @@
344#define __NR_inotify_add_watch 319 344#define __NR_inotify_add_watch 319
345#define __NR_inotify_rm_watch 320 345#define __NR_inotify_rm_watch 320
346 346
347#ifdef __KERNEL__
348
347#define NR_syscalls 321 349#define NR_syscalls 321
348 350
349/* user-visible error numbers are in the range -1 - -125: see <asm-sh64/errno.h> */ 351/* user-visible error numbers are in the range -1 - -125: see <asm-sh64/errno.h> */
@@ -486,7 +488,6 @@ __asm__ __volatile__ ("!dummy %0 %1 %2 %3 %4 %5 %6" \
486__syscall_return(type,__sc0); \ 488__syscall_return(type,__sc0); \
487} 489}
488 490
489#ifdef __KERNEL__
490#define __ARCH_WANT_IPC_PARSE_VERSION 491#define __ARCH_WANT_IPC_PARSE_VERSION
491#define __ARCH_WANT_OLD_READDIR 492#define __ARCH_WANT_OLD_READDIR
492#define __ARCH_WANT_OLD_STAT 493#define __ARCH_WANT_OLD_STAT
@@ -509,7 +510,6 @@ __syscall_return(type,__sc0); \
509#define __ARCH_WANT_SYS_SIGPENDING 510#define __ARCH_WANT_SYS_SIGPENDING
510#define __ARCH_WANT_SYS_SIGPROCMASK 511#define __ARCH_WANT_SYS_SIGPROCMASK
511#define __ARCH_WANT_SYS_RT_SIGACTION 512#define __ARCH_WANT_SYS_RT_SIGACTION
512#endif
513 513
514#ifdef __KERNEL_SYSCALLS__ 514#ifdef __KERNEL_SYSCALLS__
515 515
@@ -550,7 +550,7 @@ static inline pid_t wait(int * wait_stat)
550{ 550{
551 return waitpid(-1,wait_stat,0); 551 return waitpid(-1,wait_stat,0);
552} 552}
553#endif 553#endif /* __KERNEL_SYSCALLS__ */
554 554
555/* 555/*
556 * "Conditional" syscalls 556 * "Conditional" syscalls
@@ -562,4 +562,5 @@ static inline pid_t wait(int * wait_stat)
562#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 562#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
563#endif 563#endif
564 564
565#endif /* __KERNEL__ */
565#endif /* __ASM_SH64_UNISTD_H */ 566#endif /* __ASM_SH64_UNISTD_H */
diff --git a/include/asm-sparc/asmmacro.h b/include/asm-sparc/asmmacro.h
index 0d4b65bd252b..a619a4d97aae 100644
--- a/include/asm-sparc/asmmacro.h
+++ b/include/asm-sparc/asmmacro.h
@@ -6,7 +6,6 @@
6#ifndef _SPARC_ASMMACRO_H 6#ifndef _SPARC_ASMMACRO_H
7#define _SPARC_ASMMACRO_H 7#define _SPARC_ASMMACRO_H
8 8
9#include <linux/config.h>
10#include <asm/btfixup.h> 9#include <asm/btfixup.h>
11#include <asm/asi.h> 10#include <asm/asi.h>
12 11
diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h
index e1033170bd3a..731fa56e0c37 100644
--- a/include/asm-sparc/atomic.h
+++ b/include/asm-sparc/atomic.h
@@ -10,7 +10,6 @@
10#ifndef __ARCH_SPARC_ATOMIC__ 10#ifndef __ARCH_SPARC_ATOMIC__
11#define __ARCH_SPARC_ATOMIC__ 11#define __ARCH_SPARC_ATOMIC__
12 12
13#include <linux/config.h>
14 13
15typedef struct { volatile int counter; } atomic_t; 14typedef struct { volatile int counter; } atomic_t;
16 15
diff --git a/include/asm-sparc/bugs.h b/include/asm-sparc/bugs.h
index e652f89e0eff..a0f939beeea1 100644
--- a/include/asm-sparc/bugs.h
+++ b/include/asm-sparc/bugs.h
@@ -5,7 +5,6 @@
5 */ 5 */
6 6
7#include <asm/cpudata.h> 7#include <asm/cpudata.h>
8#include <linux/config.h>
9 8
10extern unsigned long loops_per_jiffy; 9extern unsigned long loops_per_jiffy;
11 10
diff --git a/include/asm-sparc/cacheflush.h b/include/asm-sparc/cacheflush.h
index 4901217008c0..fc632f811cd8 100644
--- a/include/asm-sparc/cacheflush.h
+++ b/include/asm-sparc/cacheflush.h
@@ -1,7 +1,6 @@
1#ifndef _SPARC_CACHEFLUSH_H 1#ifndef _SPARC_CACHEFLUSH_H
2#define _SPARC_CACHEFLUSH_H 2#define _SPARC_CACHEFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> /* Common for other includes */ 4#include <linux/mm.h> /* Common for other includes */
6// #include <linux/kernel.h> from pgalloc.h 5// #include <linux/kernel.h> from pgalloc.h
7// #include <linux/sched.h> from pgalloc.h 6// #include <linux/sched.h> from pgalloc.h
diff --git a/include/asm-sparc/delay.h b/include/asm-sparc/delay.h
index 7ec8e9f7ad4f..48aa70eef997 100644
--- a/include/asm-sparc/delay.h
+++ b/include/asm-sparc/delay.h
@@ -7,7 +7,6 @@
7#ifndef __SPARC_DELAY_H 7#ifndef __SPARC_DELAY_H
8#define __SPARC_DELAY_H 8#define __SPARC_DELAY_H
9 9
10#include <linux/config.h>
11#include <asm/cpudata.h> 10#include <asm/cpudata.h>
12 11
13static inline void __delay(unsigned long loops) 12static inline void __delay(unsigned long loops)
diff --git a/include/asm-sparc/dma-mapping.h b/include/asm-sparc/dma-mapping.h
index d7c3b0f0a901..6db83dc93cb7 100644
--- a/include/asm-sparc/dma-mapping.h
+++ b/include/asm-sparc/dma-mapping.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_SPARC_DMA_MAPPING_H 1#ifndef _ASM_SPARC_DMA_MAPPING_H
2#define _ASM_SPARC_DMA_MAPPING_H 2#define _ASM_SPARC_DMA_MAPPING_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_PCI 5#ifdef CONFIG_PCI
7#include <asm-generic/dma-mapping.h> 6#include <asm-generic/dma-mapping.h>
diff --git a/include/asm-sparc/dma.h b/include/asm-sparc/dma.h
index 8ec206aa5f2e..407b3614468a 100644
--- a/include/asm-sparc/dma.h
+++ b/include/asm-sparc/dma.h
@@ -7,7 +7,6 @@
7#ifndef _ASM_SPARC_DMA_H 7#ifndef _ASM_SPARC_DMA_H
8#define _ASM_SPARC_DMA_H 8#define _ASM_SPARC_DMA_H
9 9
10#include <linux/config.h>
11#include <linux/kernel.h> 10#include <linux/kernel.h>
12#include <linux/types.h> 11#include <linux/types.h>
13 12
diff --git a/include/asm-sparc/ebus.h b/include/asm-sparc/ebus.h
index 2d6a997c5b0c..54652887c127 100644
--- a/include/asm-sparc/ebus.h
+++ b/include/asm-sparc/ebus.h
@@ -13,13 +13,14 @@
13#include <linux/ioport.h> 13#include <linux/ioport.h>
14#endif 14#endif
15#include <asm/oplib.h> 15#include <asm/oplib.h>
16#include <asm/prom.h>
17#include <asm/of_device.h>
16 18
17struct linux_ebus_child { 19struct linux_ebus_child {
18 struct linux_ebus_child *next; 20 struct linux_ebus_child *next;
19 struct linux_ebus_device *parent; 21 struct linux_ebus_device *parent;
20 struct linux_ebus *bus; 22 struct linux_ebus *bus;
21 int prom_node; 23 struct device_node *prom_node;
22 char prom_name[64];
23 struct resource resource[PROMREG_MAX]; 24 struct resource resource[PROMREG_MAX];
24 int num_addrs; 25 int num_addrs;
25 unsigned int irqs[PROMINTR_MAX]; 26 unsigned int irqs[PROMINTR_MAX];
@@ -27,27 +28,27 @@ struct linux_ebus_child {
27}; 28};
28 29
29struct linux_ebus_device { 30struct linux_ebus_device {
31 struct of_device ofdev;
30 struct linux_ebus_device *next; 32 struct linux_ebus_device *next;
31 struct linux_ebus_child *children; 33 struct linux_ebus_child *children;
32 struct linux_ebus *bus; 34 struct linux_ebus *bus;
33 int prom_node; 35 struct device_node *prom_node;
34 char prom_name[64];
35 struct resource resource[PROMREG_MAX]; 36 struct resource resource[PROMREG_MAX];
36 int num_addrs; 37 int num_addrs;
37 unsigned int irqs[PROMINTR_MAX]; 38 unsigned int irqs[PROMINTR_MAX];
38 int num_irqs; 39 int num_irqs;
39}; 40};
41#define to_ebus_device(d) container_of(d, struct linux_ebus_device, ofdev.dev)
40 42
41struct linux_ebus { 43struct linux_ebus {
44 struct of_device ofdev;
42 struct linux_ebus *next; 45 struct linux_ebus *next;
43 struct linux_ebus_device *devices; 46 struct linux_ebus_device *devices;
44 struct linux_pbm_info *parent; 47 struct linux_pbm_info *parent;
45 struct pci_dev *self; 48 struct pci_dev *self;
46 int prom_node; 49 struct device_node *prom_node;
47 char prom_name[64];
48 struct linux_prom_ebus_ranges ebus_ranges[PROMREG_MAX];
49 int num_ebus_ranges;
50}; 50};
51#define to_ebus(d) container_of(d, struct linux_ebus, ofdev.dev)
51 52
52struct linux_ebus_dma { 53struct linux_ebus_dma {
53 unsigned int dcsr; 54 unsigned int dcsr;
diff --git a/include/asm-sparc/elf.h b/include/asm-sparc/elf.h
index 4a71d7c1eace..83a3dd15a6ed 100644
--- a/include/asm-sparc/elf.h
+++ b/include/asm-sparc/elf.h
@@ -6,7 +6,6 @@
6 * ELF register definitions.. 6 * ELF register definitions..
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <asm/ptrace.h> 9#include <asm/ptrace.h>
11 10
12#ifdef __KERNEL__ 11#ifdef __KERNEL__
diff --git a/include/asm-sparc/fixmap.h b/include/asm-sparc/fixmap.h
index 9de52b4d2cfb..f18fc0755adf 100644
--- a/include/asm-sparc/fixmap.h
+++ b/include/asm-sparc/fixmap.h
@@ -13,7 +13,6 @@
13#ifndef _ASM_FIXMAP_H 13#ifndef _ASM_FIXMAP_H
14#define _ASM_FIXMAP_H 14#define _ASM_FIXMAP_H
15 15
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <asm/page.h> 17#include <asm/page.h>
19#ifdef CONFIG_HIGHMEM 18#ifdef CONFIG_HIGHMEM
diff --git a/include/asm-sparc/hardirq.h b/include/asm-sparc/hardirq.h
index 2a668c479f68..4f63ed8df551 100644
--- a/include/asm-sparc/hardirq.h
+++ b/include/asm-sparc/hardirq.h
@@ -7,7 +7,6 @@
7#ifndef __SPARC_HARDIRQ_H 7#ifndef __SPARC_HARDIRQ_H
8#define __SPARC_HARDIRQ_H 8#define __SPARC_HARDIRQ_H
9 9
10#include <linux/config.h>
11#include <linux/threads.h> 10#include <linux/threads.h>
12#include <linux/spinlock.h> 11#include <linux/spinlock.h>
13#include <linux/cache.h> 12#include <linux/cache.h>
diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h
index 64d810385ea4..a6d735a1310e 100644
--- a/include/asm-sparc/ide.h
+++ b/include/asm-sparc/ide.h
@@ -11,7 +11,6 @@
11 11
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13 13
14#include <linux/config.h>
15#include <asm/pgtable.h> 14#include <asm/pgtable.h>
16#include <asm/io.h> 15#include <asm/io.h>
17#include <asm/psr.h> 16#include <asm/psr.h>
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h
index cee356b0dae3..3141ddfea97d 100644
--- a/include/asm-sparc/irq.h
+++ b/include/asm-sparc/irq.h
@@ -7,7 +7,6 @@
7#ifndef _SPARC_IRQ_H 7#ifndef _SPARC_IRQ_H
8#define _SPARC_IRQ_H 8#define _SPARC_IRQ_H
9 9
10#include <linux/config.h>
11#include <linux/linkage.h> 10#include <linux/linkage.h>
12#include <linux/threads.h> /* For NR_CPUS */ 11#include <linux/threads.h> /* For NR_CPUS */
13#include <linux/interrupt.h> 12#include <linux/interrupt.h>
@@ -17,8 +16,6 @@
17 16
18#define __irq_ino(irq) irq 17#define __irq_ino(irq) irq
19#define __irq_pil(irq) irq 18#define __irq_pil(irq) irq
20BTFIXUPDEF_CALL(char *, __irq_itoa, unsigned int)
21#define __irq_itoa(irq) BTFIXUP_CALL(__irq_itoa)(irq)
22 19
23#define NR_IRQS 16 20#define NR_IRQS 16
24 21
@@ -184,8 +181,4 @@ extern struct sun4m_intregs *sun4m_interrupts;
184#define SUN4M_INT_SBUS(x) (1 << (x+7)) 181#define SUN4M_INT_SBUS(x) (1 << (x+7))
185#define SUN4M_INT_VME(x) (1 << (x)) 182#define SUN4M_INT_VME(x) (1 << (x))
186 183
187struct irqaction;
188struct pt_regs;
189int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
190
191#endif 184#endif
diff --git a/include/asm-sparc/mostek.h b/include/asm-sparc/mostek.h
index 59b86bc793bf..bd92a78f4937 100644
--- a/include/asm-sparc/mostek.h
+++ b/include/asm-sparc/mostek.h
@@ -9,7 +9,6 @@
9#ifndef _SPARC_MOSTEK_H 9#ifndef _SPARC_MOSTEK_H
10#define _SPARC_MOSTEK_H 10#define _SPARC_MOSTEK_H
11 11
12#include <linux/config.h>
13#include <asm/idprom.h> 12#include <asm/idprom.h>
14#include <asm/io.h> 13#include <asm/io.h>
15 14
diff --git a/include/asm-sparc/of_device.h b/include/asm-sparc/of_device.h
new file mode 100644
index 000000000000..4816d102f918
--- /dev/null
+++ b/include/asm-sparc/of_device.h
@@ -0,0 +1,63 @@
1#ifndef _ASM_SPARC_OF_DEVICE_H
2#define _ASM_SPARC_OF_DEVICE_H
3#ifdef __KERNEL__
4
5#include <linux/device.h>
6#include <linux/mod_devicetable.h>
7#include <asm/prom.h>
8
9extern struct bus_type ebus_bus_type;
10extern struct bus_type sbus_bus_type;
11
12/*
13 * The of_device is a kind of "base class" that is a superset of
14 * struct device for use by devices attached to an OF node and
15 * probed using OF properties.
16 */
17struct of_device
18{
19 struct device_node *node; /* OF device node */
20 struct device dev; /* Generic device interface */
21};
22#define to_of_device(d) container_of(d, struct of_device, dev)
23
24extern const struct of_device_id *of_match_device(
25 const struct of_device_id *matches, const struct of_device *dev);
26
27extern struct of_device *of_dev_get(struct of_device *dev);
28extern void of_dev_put(struct of_device *dev);
29
30/*
31 * An of_platform_driver driver is attached to a basic of_device on
32 * the ISA, EBUS, and SBUS busses on sparc64.
33 */
34struct of_platform_driver
35{
36 char *name;
37 struct of_device_id *match_table;
38 struct module *owner;
39
40 int (*probe)(struct of_device* dev, const struct of_device_id *match);
41 int (*remove)(struct of_device* dev);
42
43 int (*suspend)(struct of_device* dev, pm_message_t state);
44 int (*resume)(struct of_device* dev);
45 int (*shutdown)(struct of_device* dev);
46
47 struct device_driver driver;
48};
49#define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver)
50
51extern int of_register_driver(struct of_platform_driver *drv,
52 struct bus_type *bus);
53extern void of_unregister_driver(struct of_platform_driver *drv);
54extern int of_device_register(struct of_device *ofdev);
55extern void of_device_unregister(struct of_device *ofdev);
56extern struct of_device *of_platform_device_create(struct device_node *np,
57 const char *bus_id,
58 struct device *parent,
59 struct bus_type *bus);
60extern void of_release_dev(struct device *dev);
61
62#endif /* __KERNEL__ */
63#endif /* _ASM_SPARC_OF_DEVICE_H */
diff --git a/include/asm-sparc/page.h b/include/asm-sparc/page.h
index ec3274b7ddf4..5bab8a7c25ce 100644
--- a/include/asm-sparc/page.h
+++ b/include/asm-sparc/page.h
@@ -8,7 +8,6 @@
8#ifndef _SPARC_PAGE_H 8#ifndef _SPARC_PAGE_H
9#define _SPARC_PAGE_H 9#define _SPARC_PAGE_H
10 10
11#include <linux/config.h>
12#ifdef CONFIG_SUN4 11#ifdef CONFIG_SUN4
13#define PAGE_SHIFT 13 12#define PAGE_SHIFT 13
14#else 13#else
diff --git a/include/asm-sparc/pbm.h b/include/asm-sparc/pbm.h
index 0aba3a82c2eb..fedd9c6e875c 100644
--- a/include/asm-sparc/pbm.h
+++ b/include/asm-sparc/pbm.h
@@ -22,6 +22,7 @@
22 22
23#include <linux/pci.h> 23#include <linux/pci.h>
24#include <asm/oplib.h> 24#include <asm/oplib.h>
25#include <asm/prom.h>
25 26
26struct linux_pbm_info { 27struct linux_pbm_info {
27 int prom_node; 28 int prom_node;
@@ -40,7 +41,7 @@ struct linux_pbm_info {
40 */ 41 */
41struct pcidev_cookie { 42struct pcidev_cookie {
42 struct linux_pbm_info *pbm; 43 struct linux_pbm_info *pbm;
43 int prom_node; 44 struct device_node *prom_node;
44}; 45};
45 46
46#endif /* !(__SPARC_PBM_H) */ 47#endif /* !(__SPARC_PBM_H) */
diff --git a/include/asm-sparc/pgalloc.h b/include/asm-sparc/pgalloc.h
index 126800acd10d..a449cd4912d1 100644
--- a/include/asm-sparc/pgalloc.h
+++ b/include/asm-sparc/pgalloc.h
@@ -2,7 +2,6 @@
2#ifndef _SPARC_PGALLOC_H 2#ifndef _SPARC_PGALLOC_H
3#define _SPARC_PGALLOC_H 3#define _SPARC_PGALLOC_H
4 4
5#include <linux/config.h>
6#include <linux/kernel.h> 5#include <linux/kernel.h>
7#include <linux/sched.h> 6#include <linux/sched.h>
8 7
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index 9eea8f4d41f0..226c6475c9a2 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -11,7 +11,6 @@
11 11
12#include <asm-generic/4level-fixup.h> 12#include <asm-generic/4level-fixup.h>
13 13
14#include <linux/config.h>
15#include <linux/spinlock.h> 14#include <linux/spinlock.h>
16#include <linux/swap.h> 15#include <linux/swap.h>
17#include <asm/types.h> 16#include <asm/types.h>
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
new file mode 100644
index 000000000000..c5e3d26eabd3
--- /dev/null
+++ b/include/asm-sparc/prom.h
@@ -0,0 +1,98 @@
1#ifndef _SPARC_PROM_H
2#define _SPARC_PROM_H
3#ifdef __KERNEL__
4
5
6/*
7 * Definitions for talking to the Open Firmware PROM on
8 * Power Macintosh computers.
9 *
10 * Copyright (C) 1996-2005 Paul Mackerras.
11 *
12 * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
13 * Updates for SPARC32 by David S. Miller
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version.
19 */
20
21#include <linux/types.h>
22#include <linux/proc_fs.h>
23#include <asm/atomic.h>
24
25typedef u32 phandle;
26typedef u32 ihandle;
27
28struct interrupt_info {
29 int line;
30 int sense; /* +ve/-ve logic, edge or level, etc. */
31};
32
33struct property {
34 char *name;
35 int length;
36 void *value;
37 struct property *next;
38};
39
40struct device_node {
41 char *name;
42 char *type;
43 phandle node;
44 phandle linux_phandle;
45 int n_intrs;
46 struct interrupt_info *intrs;
47 char *path_component_name;
48 char *full_name;
49
50 struct property *properties;
51 struct property *deadprops; /* removed properties */
52 struct device_node *parent;
53 struct device_node *child;
54 struct device_node *sibling;
55 struct device_node *next; /* next device of same type */
56 struct device_node *allnext; /* next in list of all nodes */
57 struct proc_dir_entry *pde; /* this node's proc directory */
58 struct kref kref;
59 unsigned long _flags;
60 void *data;
61};
62
63static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
64{
65 dn->pde = de;
66}
67
68extern struct device_node *of_find_node_by_name(struct device_node *from,
69 const char *name);
70#define for_each_node_by_name(dn, name) \
71 for (dn = of_find_node_by_name(NULL, name); dn; \
72 dn = of_find_node_by_name(dn, name))
73extern struct device_node *of_find_node_by_type(struct device_node *from,
74 const char *type);
75#define for_each_node_by_type(dn, type) \
76 for (dn = of_find_node_by_type(NULL, type); dn; \
77 dn = of_find_node_by_type(dn, type))
78extern struct device_node *of_find_compatible_node(struct device_node *from,
79 const char *type, const char *compat);
80extern struct device_node *of_find_node_by_path(const char *path);
81extern struct device_node *of_find_node_by_phandle(phandle handle);
82extern struct device_node *of_get_parent(const struct device_node *node);
83extern struct device_node *of_get_next_child(const struct device_node *node,
84 struct device_node *prev);
85extern struct property *of_find_property(struct device_node *np,
86 const char *name,
87 int *lenp);
88extern int of_device_is_compatible(struct device_node *device, const char *);
89extern void *of_get_property(struct device_node *node, const char *name,
90 int *lenp);
91extern int of_getintprop_default(struct device_node *np,
92 const char *name,
93 int def);
94
95extern void prom_build_devicetree(void);
96
97#endif /* __KERNEL__ */
98#endif /* _SPARC_PROM_H */
diff --git a/include/asm-sparc/sbus.h b/include/asm-sparc/sbus.h
index a13cddcecec5..d036e4419d79 100644
--- a/include/asm-sparc/sbus.h
+++ b/include/asm-sparc/sbus.h
@@ -11,7 +11,8 @@
11#include <linux/ioport.h> 11#include <linux/ioport.h>
12 12
13#include <asm/oplib.h> 13#include <asm/oplib.h>
14/* #include <asm/iommu.h> */ /* Unused since we use opaque iommu (|io-unit) */ 14#include <asm/prom.h>
15#include <asm/of_device.h>
15#include <asm/scatterlist.h> 16#include <asm/scatterlist.h>
16 17
17/* We scan which devices are on the SBus using the PROM node device 18/* We scan which devices are on the SBus using the PROM node device
@@ -42,18 +43,19 @@ struct sbus_bus;
42 43
43/* Linux SBUS device tables */ 44/* Linux SBUS device tables */
44struct sbus_dev { 45struct sbus_dev {
45 struct sbus_bus *bus; /* Back ptr to sbus */ 46 struct of_device ofdev;
46 struct sbus_dev *next; /* next device on this SBus or null */ 47 struct sbus_bus *bus;
47 struct sbus_dev *child; /* For ledma and espdma on sun4m */ 48 struct sbus_dev *next;
48 struct sbus_dev *parent; /* Parent device if not toplevel */ 49 struct sbus_dev *child;
49 int prom_node; /* PROM device tree node for this device */ 50 struct sbus_dev *parent;
50 char prom_name[64]; /* PROM device name */ 51 int prom_node;
52 char prom_name[64];
51 int slot; 53 int slot;
52 54
53 struct resource resource[PROMREG_MAX]; 55 struct resource resource[PROMREG_MAX];
54 56
55 struct linux_prom_registers reg_addrs[PROMREG_MAX]; 57 struct linux_prom_registers reg_addrs[PROMREG_MAX];
56 int num_registers, ranges_applied; 58 int num_registers;
57 59
58 struct linux_prom_ranges device_ranges[PROMREG_MAX]; 60 struct linux_prom_ranges device_ranges[PROMREG_MAX];
59 int num_device_ranges; 61 int num_device_ranges;
@@ -61,9 +63,11 @@ struct sbus_dev {
61 unsigned int irqs[4]; 63 unsigned int irqs[4];
62 int num_irqs; 64 int num_irqs;
63}; 65};
66#define to_sbus_device(d) container_of(d, struct sbus_dev, ofdev.dev)
64 67
65/* This struct describes the SBus(s) found on this machine. */ 68/* This struct describes the SBus(s) found on this machine. */
66struct sbus_bus { 69struct sbus_bus {
70 struct of_device ofdev;
67 void *iommu; /* Opaque IOMMU cookie */ 71 void *iommu; /* Opaque IOMMU cookie */
68 struct sbus_dev *devices; /* Link to devices on this SBus */ 72 struct sbus_dev *devices; /* Link to devices on this SBus */
69 struct sbus_bus *next; /* next SBus, if more than one SBus */ 73 struct sbus_bus *next; /* next SBus, if more than one SBus */
@@ -77,6 +81,7 @@ struct sbus_bus {
77 int devid; 81 int devid;
78 int board; 82 int board;
79}; 83};
84#define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev)
80 85
81extern struct sbus_bus *sbus_root; 86extern struct sbus_bus *sbus_root;
82 87
@@ -102,6 +107,7 @@ sbus_is_slave(struct sbus_dev *dev)
102#define sbus_can_dma_64bit(sdev) (0) /* actually, sparc_cpu_model==sun4d */ 107#define sbus_can_dma_64bit(sdev) (0) /* actually, sparc_cpu_model==sun4d */
103#define sbus_can_burst64(sdev) (0) /* actually, sparc_cpu_model==sun4d */ 108#define sbus_can_burst64(sdev) (0) /* actually, sparc_cpu_model==sun4d */
104extern void sbus_set_sbus64(struct sbus_dev *, int); 109extern void sbus_set_sbus64(struct sbus_dev *, int);
110extern void sbus_fill_device_irq(struct sbus_dev *);
105 111
106/* These yield IOMMU mappings in consistent mode. */ 112/* These yield IOMMU mappings in consistent mode. */
107extern void *sbus_alloc_consistent(struct sbus_dev *, long, u32 *dma_addrp); 113extern void *sbus_alloc_consistent(struct sbus_dev *, long, u32 *dma_addrp);
@@ -139,4 +145,10 @@ extern void sbus_dma_sync_sg_for_device(struct sbus_dev *, struct scatterlist *,
139BTFIXUPDEF_CALL(unsigned int, sbint_to_irq, struct sbus_dev *sdev, unsigned int) 145BTFIXUPDEF_CALL(unsigned int, sbint_to_irq, struct sbus_dev *sdev, unsigned int)
140#define sbint_to_irq(sdev, sbint) BTFIXUP_CALL(sbint_to_irq)(sdev, sbint) 146#define sbint_to_irq(sdev, sbint) BTFIXUP_CALL(sbint_to_irq)(sdev, sbint)
141 147
148extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *);
149extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *);
150extern void sbus_setup_arch_props(struct sbus_bus *, struct device_node *);
151extern int sbus_arch_preinit(void);
152extern void sbus_arch_postinit(void);
153
142#endif /* !(_SPARC_SBUS_H) */ 154#endif /* !(_SPARC_SBUS_H) */
diff --git a/include/asm-sparc/sfp-machine.h b/include/asm-sparc/sfp-machine.h
index b4ca2d94bf08..ecfc86a4a725 100644
--- a/include/asm-sparc/sfp-machine.h
+++ b/include/asm-sparc/sfp-machine.h
@@ -25,7 +25,6 @@
25#ifndef _SFP_MACHINE_H 25#ifndef _SFP_MACHINE_H
26#define _SFP_MACHINE_H 26#define _SFP_MACHINE_H
27 27
28#include <linux/config.h>
29 28
30#define _FP_W_TYPE_SIZE 32 29#define _FP_W_TYPE_SIZE 32
31#define _FP_W_TYPE unsigned long 30#define _FP_W_TYPE unsigned long
diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h
index 98c46e3fbe8a..b9da9a600e35 100644
--- a/include/asm-sparc/smp.h
+++ b/include/asm-sparc/smp.h
@@ -6,7 +6,6 @@
6#ifndef _SPARC_SMP_H 6#ifndef _SPARC_SMP_H
7#define _SPARC_SMP_H 7#define _SPARC_SMP_H
8 8
9#include <linux/config.h>
10#include <linux/threads.h> 9#include <linux/threads.h>
11#include <asm/head.h> 10#include <asm/head.h>
12#include <asm/btfixup.h> 11#include <asm/btfixup.h>
@@ -146,6 +145,8 @@ static inline int hard_smp_processor_id(void)
146#define prof_multiplier(__cpu) cpu_data(__cpu).multiplier 145#define prof_multiplier(__cpu) cpu_data(__cpu).multiplier
147#define prof_counter(__cpu) cpu_data(__cpu).counter 146#define prof_counter(__cpu) cpu_data(__cpu).counter
148 147
148void smp_setup_cpu_possible_map(void);
149
149#endif /* !(__ASSEMBLY__) */ 150#endif /* !(__ASSEMBLY__) */
150 151
151/* Sparc specific messages. */ 152/* Sparc specific messages. */
@@ -162,7 +163,11 @@ static inline int hard_smp_processor_id(void)
162#define MBOX_IDLECPU2 0xFD 163#define MBOX_IDLECPU2 0xFD
163#define MBOX_STOPCPU2 0xFE 164#define MBOX_STOPCPU2 0xFE
164 165
165#endif /* SMP */ 166#else /* SMP */
167
168#define smp_setup_cpu_possible_map() do { } while (0)
169
170#endif /* !(SMP) */
166 171
167#define NO_PROC_ID 0xFF 172#define NO_PROC_ID 0xFF
168 173
diff --git a/include/asm-sparc/spinlock.h b/include/asm-sparc/spinlock.h
index 3350c90c7869..1c75474ba1df 100644
--- a/include/asm-sparc/spinlock.h
+++ b/include/asm-sparc/spinlock.h
@@ -154,6 +154,9 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
154#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) 154#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
155#define __raw_read_trylock(lock) generic__raw_read_trylock(lock) 155#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
156 156
157#define __raw_read_can_lock(rw) (!((rw)->lock & 0xff))
158#define __raw_write_can_lock(rw) (!(rw)->lock)
159
157#endif /* !(__ASSEMBLY__) */ 160#endif /* !(__ASSEMBLY__) */
158 161
159#endif /* __SPARC_SPINLOCK_H */ 162#endif /* __SPARC_SPINLOCK_H */
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index 58dd162927bb..cb7dda1e5e91 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -1,10 +1,8 @@
1/* $Id: system.h,v 1.86 2001/10/30 04:57:10 davem Exp $ */ 1/* $Id: system.h,v 1.86 2001/10/30 04:57:10 davem Exp $ */
2#include <linux/config.h>
3 2
4#ifndef __SPARC_SYSTEM_H 3#ifndef __SPARC_SYSTEM_H
5#define __SPARC_SYSTEM_H 4#define __SPARC_SYSTEM_H
6 5
7#include <linux/config.h>
8#include <linux/kernel.h> 6#include <linux/kernel.h>
9#include <linux/threads.h> /* NR_CPUS */ 7#include <linux/threads.h> /* NR_CPUS */
10#include <linux/thread_info.h> 8#include <linux/thread_info.h>
diff --git a/include/asm-sparc/timer.h b/include/asm-sparc/timer.h
index b16eb739dddb..cb1fa1d1f184 100644
--- a/include/asm-sparc/timer.h
+++ b/include/asm-sparc/timer.h
@@ -4,7 +4,6 @@
4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
5 */ 5 */
6 6
7#include <linux/config.h>
8 7
9#ifndef _SPARC_TIMER_H 8#ifndef _SPARC_TIMER_H
10#define _SPARC_TIMER_H 9#define _SPARC_TIMER_H
diff --git a/include/asm-sparc/tlbflush.h b/include/asm-sparc/tlbflush.h
index 5643ca31ead9..4a3b66618e75 100644
--- a/include/asm-sparc/tlbflush.h
+++ b/include/asm-sparc/tlbflush.h
@@ -1,7 +1,6 @@
1#ifndef _SPARC_TLBFLUSH_H 1#ifndef _SPARC_TLBFLUSH_H
2#define _SPARC_TLBFLUSH_H 2#define _SPARC_TLBFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6// #include <asm/processor.h> 5// #include <asm/processor.h>
7 6
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 45a576507785..2553762465ca 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -319,6 +319,7 @@
319#define __NR_set_robust_list 300 319#define __NR_set_robust_list 300
320#define __NR_get_robust_list 301 320#define __NR_get_robust_list 301
321 321
322#ifdef __KERNEL__
322/* WARNING: You MAY NOT add syscall numbers larger than 301, since 323/* WARNING: You MAY NOT add syscall numbers larger than 301, since
323 * all of the syscall tables in the Sparc kernel are 324 * all of the syscall tables in the Sparc kernel are
324 * sized to have 301 entries (starting at zero). Therefore 325 * sized to have 301 entries (starting at zero). Therefore
@@ -455,7 +456,6 @@ errno = -__res; \
455return -1; \ 456return -1; \
456} 457}
457 458
458#ifdef __KERNEL__
459#define __ARCH_WANT_IPC_PARSE_VERSION 459#define __ARCH_WANT_IPC_PARSE_VERSION
460#define __ARCH_WANT_OLD_READDIR 460#define __ARCH_WANT_OLD_READDIR
461#define __ARCH_WANT_STAT64 461#define __ARCH_WANT_STAT64
@@ -477,7 +477,6 @@ return -1; \
477#define __ARCH_WANT_SYS_SIGPENDING 477#define __ARCH_WANT_SYS_SIGPENDING
478#define __ARCH_WANT_SYS_SIGPROCMASK 478#define __ARCH_WANT_SYS_SIGPROCMASK
479#define __ARCH_WANT_SYS_RT_SIGSUSPEND 479#define __ARCH_WANT_SYS_RT_SIGSUSPEND
480#endif
481 480
482#ifdef __KERNEL_SYSCALLS__ 481#ifdef __KERNEL_SYSCALLS__
483 482
@@ -534,4 +533,5 @@ asmlinkage long sys_rt_sigaction(int sig,
534 */ 533 */
535#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 534#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
536 535
536#endif /* __KERNEL__ */
537#endif /* _SPARC_UNISTD_H */ 537#endif /* _SPARC_UNISTD_H */
diff --git a/include/asm-sparc/vac-ops.h b/include/asm-sparc/vac-ops.h
index 9e0172323042..ab6f53b913ea 100644
--- a/include/asm-sparc/vac-ops.h
+++ b/include/asm-sparc/vac-ops.h
@@ -8,7 +8,6 @@
8 * Copyright (C) 1994, David S. Miller (davem@caip.rutgers.edu) 8 * Copyright (C) 1994, David S. Miller (davem@caip.rutgers.edu)
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <asm/sysen.h> 11#include <asm/sysen.h>
13#include <asm/contregs.h> 12#include <asm/contregs.h>
14#include <asm/asi.h> 13#include <asm/asi.h>
diff --git a/include/asm-sparc/winmacro.h b/include/asm-sparc/winmacro.h
index 557257eef3f9..096f3d3d90c3 100644
--- a/include/asm-sparc/winmacro.h
+++ b/include/asm-sparc/winmacro.h
@@ -7,7 +7,6 @@
7#ifndef _SPARC_WINMACRO_H 7#ifndef _SPARC_WINMACRO_H
8#define _SPARC_WINMACRO_H 8#define _SPARC_WINMACRO_H
9 9
10#include <linux/config.h>
11#include <asm/ptrace.h> 10#include <asm/ptrace.h>
12 11
13/* Store the register window onto the 8-byte aligned area starting 12/* Store the register window onto the 8-byte aligned area starting
diff --git a/include/asm-sparc64/atomic.h b/include/asm-sparc64/atomic.h
index 468eb48d8142..2f0bec26a695 100644
--- a/include/asm-sparc64/atomic.h
+++ b/include/asm-sparc64/atomic.h
@@ -8,7 +8,6 @@
8#ifndef __ARCH_SPARC64_ATOMIC__ 8#ifndef __ARCH_SPARC64_ATOMIC__
9#define __ARCH_SPARC64_ATOMIC__ 9#define __ARCH_SPARC64_ATOMIC__
10 10
11#include <linux/config.h>
12#include <linux/types.h> 11#include <linux/types.h>
13 12
14typedef struct { volatile int counter; } atomic_t; 13typedef struct { volatile int counter; } atomic_t;
diff --git a/include/asm-sparc64/bitops.h b/include/asm-sparc64/bitops.h
index 71944b0f09de..3d5e1af84723 100644
--- a/include/asm-sparc64/bitops.h
+++ b/include/asm-sparc64/bitops.h
@@ -7,7 +7,6 @@
7#ifndef _SPARC64_BITOPS_H 7#ifndef _SPARC64_BITOPS_H
8#define _SPARC64_BITOPS_H 8#define _SPARC64_BITOPS_H
9 9
10#include <linux/config.h>
11#include <linux/compiler.h> 10#include <linux/compiler.h>
12#include <asm/byteorder.h> 11#include <asm/byteorder.h>
13 12
diff --git a/include/asm-sparc64/bugs.h b/include/asm-sparc64/bugs.h
index 360dd04ed8e4..120422fdb02f 100644
--- a/include/asm-sparc64/bugs.h
+++ b/include/asm-sparc64/bugs.h
@@ -4,7 +4,6 @@
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 */ 5 */
6 6
7#include <linux/config.h>
8 7
9extern unsigned long loops_per_jiffy; 8extern unsigned long loops_per_jiffy;
10 9
diff --git a/include/asm-sparc64/cacheflush.h b/include/asm-sparc64/cacheflush.h
index b3f61659ba81..745d1ab60371 100644
--- a/include/asm-sparc64/cacheflush.h
+++ b/include/asm-sparc64/cacheflush.h
@@ -1,7 +1,6 @@
1#ifndef _SPARC64_CACHEFLUSH_H 1#ifndef _SPARC64_CACHEFLUSH_H
2#define _SPARC64_CACHEFLUSH_H 2#define _SPARC64_CACHEFLUSH_H
3 3
4#include <linux/config.h>
5#include <asm/page.h> 4#include <asm/page.h>
6 5
7#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h
index 9d6a6dbaf126..f2cc9411b4c7 100644
--- a/include/asm-sparc64/cpudata.h
+++ b/include/asm-sparc64/cpudata.h
@@ -74,8 +74,10 @@ struct trap_per_cpu {
74 unsigned long tsb_huge; 74 unsigned long tsb_huge;
75 unsigned long tsb_huge_temp; 75 unsigned long tsb_huge_temp;
76 76
77/* Dcache line 8: Unused, needed to keep trap_block a power-of-2 in size. */ 77/* Dcache line 8: IRQ work list, and keep trap_block a power-of-2 in size. */
78 unsigned long __pad2[4]; 78 unsigned int irq_worklist;
79 unsigned int __pad1;
80 unsigned long __pad2[3];
79} __attribute__((aligned(64))); 81} __attribute__((aligned(64)));
80extern struct trap_per_cpu trap_block[NR_CPUS]; 82extern struct trap_per_cpu trap_block[NR_CPUS];
81extern void init_cur_cpu_trap(struct thread_info *); 83extern void init_cur_cpu_trap(struct thread_info *);
@@ -119,6 +121,7 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
119#define TRAP_PER_CPU_CPU_LIST_PA 0xc8 121#define TRAP_PER_CPU_CPU_LIST_PA 0xc8
120#define TRAP_PER_CPU_TSB_HUGE 0xd0 122#define TRAP_PER_CPU_TSB_HUGE 0xd0
121#define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8 123#define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8
124#define TRAP_PER_CPU_IRQ_WORKLIST 0xe0
122 125
123#define TRAP_BLOCK_SZ_SHIFT 8 126#define TRAP_BLOCK_SZ_SHIFT 8
124 127
@@ -171,11 +174,8 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
171 174
172/* Clobbers TMP, loads local processor's IRQ work area into DEST. */ 175/* Clobbers TMP, loads local processor's IRQ work area into DEST. */
173#define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ 176#define TRAP_LOAD_IRQ_WORK(DEST, TMP) \
174 __GET_CPUID(TMP) \ 177 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
175 sethi %hi(__irq_work), DEST; \ 178 add DEST, TRAP_PER_CPU_IRQ_WORKLIST, DEST;
176 sllx TMP, 6, TMP; \
177 or DEST, %lo(__irq_work), DEST; \
178 add DEST, TMP, DEST;
179 179
180/* Clobbers TMP, loads DEST with current thread info pointer. */ 180/* Clobbers TMP, loads DEST with current thread info pointer. */
181#define TRAP_LOAD_THREAD_REG(DEST, TMP) \ 181#define TRAP_LOAD_THREAD_REG(DEST, TMP) \
@@ -211,9 +211,10 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
211 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ 211 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
212 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST; 212 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST;
213 213
214/* Clobbers TMP, loads local processor's IRQ work area into DEST. */
214#define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ 215#define TRAP_LOAD_IRQ_WORK(DEST, TMP) \
215 sethi %hi(__irq_work), DEST; \ 216 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
216 or DEST, %lo(__irq_work), DEST; 217 add DEST, TRAP_PER_CPU_IRQ_WORKLIST, DEST;
217 218
218#define TRAP_LOAD_THREAD_REG(DEST, TMP) \ 219#define TRAP_LOAD_THREAD_REG(DEST, TMP) \
219 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ 220 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
diff --git a/include/asm-sparc64/delay.h b/include/asm-sparc64/delay.h
index 2901ea0c342d..a4aae6f80627 100644
--- a/include/asm-sparc64/delay.h
+++ b/include/asm-sparc64/delay.h
@@ -11,7 +11,6 @@
11#ifndef __SPARC64_DELAY_H 11#ifndef __SPARC64_DELAY_H
12#define __SPARC64_DELAY_H 12#define __SPARC64_DELAY_H
13 13
14#include <linux/config.h>
15#include <linux/param.h> 14#include <linux/param.h>
16#include <asm/cpudata.h> 15#include <asm/cpudata.h>
17 16
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h
index a8d39f23d43b..3c2b5bc8650b 100644
--- a/include/asm-sparc64/dma-mapping.h
+++ b/include/asm-sparc64/dma-mapping.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_SPARC64_DMA_MAPPING_H 1#ifndef _ASM_SPARC64_DMA_MAPPING_H
2#define _ASM_SPARC64_DMA_MAPPING_H 2#define _ASM_SPARC64_DMA_MAPPING_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_PCI 5#ifdef CONFIG_PCI
7 6
diff --git a/include/asm-sparc64/dma.h b/include/asm-sparc64/dma.h
index 1aab3c8dce2b..27f65972b3bb 100644
--- a/include/asm-sparc64/dma.h
+++ b/include/asm-sparc64/dma.h
@@ -7,7 +7,6 @@
7#ifndef _ASM_SPARC64_DMA_H 7#ifndef _ASM_SPARC64_DMA_H
8#define _ASM_SPARC64_DMA_H 8#define _ASM_SPARC64_DMA_H
9 9
10#include <linux/config.h>
11#include <linux/kernel.h> 10#include <linux/kernel.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/spinlock.h> 12#include <linux/spinlock.h>
diff --git a/include/asm-sparc64/ebus.h b/include/asm-sparc64/ebus.h
index 7a408a030f52..a4afe9d5703a 100644
--- a/include/asm-sparc64/ebus.h
+++ b/include/asm-sparc64/ebus.h
@@ -10,13 +10,14 @@
10 10
11#include <asm/pbm.h> 11#include <asm/pbm.h>
12#include <asm/oplib.h> 12#include <asm/oplib.h>
13#include <asm/prom.h>
14#include <asm/of_device.h>
13 15
14struct linux_ebus_child { 16struct linux_ebus_child {
15 struct linux_ebus_child *next; 17 struct linux_ebus_child *next;
16 struct linux_ebus_device *parent; 18 struct linux_ebus_device *parent;
17 struct linux_ebus *bus; 19 struct linux_ebus *bus;
18 int prom_node; 20 struct device_node *prom_node;
19 char prom_name[64];
20 struct resource resource[PROMREG_MAX]; 21 struct resource resource[PROMREG_MAX];
21 int num_addrs; 22 int num_addrs;
22 unsigned int irqs[PROMINTR_MAX]; 23 unsigned int irqs[PROMINTR_MAX];
@@ -24,32 +25,29 @@ struct linux_ebus_child {
24}; 25};
25 26
26struct linux_ebus_device { 27struct linux_ebus_device {
28 struct of_device ofdev;
27 struct linux_ebus_device *next; 29 struct linux_ebus_device *next;
28 struct linux_ebus_child *children; 30 struct linux_ebus_child *children;
29 struct linux_ebus *bus; 31 struct linux_ebus *bus;
30 int prom_node; 32 struct device_node *prom_node;
31 char prom_name[64];
32 struct resource resource[PROMREG_MAX]; 33 struct resource resource[PROMREG_MAX];
33 int num_addrs; 34 int num_addrs;
34 unsigned int irqs[PROMINTR_MAX]; 35 unsigned int irqs[PROMINTR_MAX];
35 int num_irqs; 36 int num_irqs;
36}; 37};
38#define to_ebus_device(d) container_of(d, struct linux_ebus_device, ofdev.dev)
37 39
38struct linux_ebus { 40struct linux_ebus {
41 struct of_device ofdev;
39 struct linux_ebus *next; 42 struct linux_ebus *next;
40 struct linux_ebus_device *devices; 43 struct linux_ebus_device *devices;
41 struct pci_pbm_info *parent; 44 struct pci_pbm_info *parent;
42 struct pci_dev *self; 45 struct pci_dev *self;
43 int index; 46 int index;
44 int is_rio; 47 int is_rio;
45 int prom_node; 48 struct device_node *prom_node;
46 char prom_name[64];
47 struct linux_prom_ebus_ranges ebus_ranges[PROMREG_MAX];
48 int num_ebus_ranges;
49 struct linux_prom_ebus_intmap ebus_intmap[PROMREG_MAX];
50 int num_ebus_intmap;
51 struct linux_prom_ebus_intmask ebus_intmask;
52}; 49};
50#define to_ebus(d) container_of(d, struct linux_ebus, ofdev.dev)
53 51
54struct ebus_dma_info { 52struct ebus_dma_info {
55 spinlock_t lock; 53 spinlock_t lock;
diff --git a/include/asm-sparc64/fhc.h b/include/asm-sparc64/fhc.h
index f29eaa254055..9e7f1b0d78b9 100644
--- a/include/asm-sparc64/fhc.h
+++ b/include/asm-sparc64/fhc.h
@@ -10,6 +10,7 @@
10#include <linux/timer.h> 10#include <linux/timer.h>
11 11
12#include <asm/oplib.h> 12#include <asm/oplib.h>
13#include <asm/prom.h>
13#include <asm/upa.h> 14#include <asm/upa.h>
14 15
15struct linux_fhc; 16struct linux_fhc;
@@ -34,8 +35,7 @@ struct linux_central {
34 unsigned long clkregs; 35 unsigned long clkregs;
35 unsigned long clkver; 36 unsigned long clkver;
36 int slots; 37 int slots;
37 int prom_node; 38 struct device_node *prom_node;
38 char prom_name[64];
39 39
40 struct linux_prom_ranges central_ranges[PROMREG_MAX]; 40 struct linux_prom_ranges central_ranges[PROMREG_MAX];
41 int num_central_ranges; 41 int num_central_ranges;
@@ -112,8 +112,7 @@ struct linux_fhc {
112 struct fhc_regs fhc_regs; 112 struct fhc_regs fhc_regs;
113 int board; 113 int board;
114 int jtag_master; 114 int jtag_master;
115 int prom_node; 115 struct device_node *prom_node;
116 char prom_name[64];
117 116
118 struct linux_prom_ranges fhc_ranges[PROMREG_MAX]; 117 struct linux_prom_ranges fhc_ranges[PROMREG_MAX];
119 int num_fhc_ranges; 118 int num_fhc_ranges;
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index 6a95d5d0c576..f8d57bb5570c 100644
--- a/include/asm-sparc64/floppy.h
+++ b/include/asm-sparc64/floppy.h
@@ -10,7 +10,6 @@
10#ifndef __ASM_SPARC64_FLOPPY_H 10#ifndef __ASM_SPARC64_FLOPPY_H
11#define __ASM_SPARC64_FLOPPY_H 11#define __ASM_SPARC64_FLOPPY_H
12 12
13#include <linux/config.h>
14#include <linux/init.h> 13#include <linux/init.h>
15 14
16#include <asm/page.h> 15#include <asm/page.h>
@@ -499,15 +498,14 @@ static int sun_pci_fd_test_drive(unsigned long port, int drive)
499#ifdef CONFIG_PCI 498#ifdef CONFIG_PCI
500static int __init ebus_fdthree_p(struct linux_ebus_device *edev) 499static int __init ebus_fdthree_p(struct linux_ebus_device *edev)
501{ 500{
502 if (!strcmp(edev->prom_name, "fdthree")) 501 if (!strcmp(edev->prom_node->name, "fdthree"))
503 return 1; 502 return 1;
504 if (!strcmp(edev->prom_name, "floppy")) { 503 if (!strcmp(edev->prom_node->name, "floppy")) {
505 char compat[16]; 504 char *compat;
506 prom_getstring(edev->prom_node, 505
507 "compatible", 506 compat = of_get_property(edev->prom_node,
508 compat, sizeof(compat)); 507 "compatible", NULL);
509 compat[15] = '\0'; 508 if (compat && !strcmp(compat, "fdthree"))
510 if (!strcmp(compat, "fdthree"))
511 return 1; 509 return 1;
512 } 510 }
513 return 0; 511 return 0;
@@ -525,12 +523,12 @@ static unsigned long __init isa_floppy_init(void)
525 523
526 for_each_isa(isa_br) { 524 for_each_isa(isa_br) {
527 for_each_isadev(isa_dev, isa_br) { 525 for_each_isadev(isa_dev, isa_br) {
528 if (!strcmp(isa_dev->prom_name, "dma")) { 526 if (!strcmp(isa_dev->prom_node->name, "dma")) {
529 struct sparc_isa_device *child = 527 struct sparc_isa_device *child =
530 isa_dev->child; 528 isa_dev->child;
531 529
532 while (child) { 530 while (child) {
533 if (!strcmp(child->prom_name, 531 if (!strcmp(child->prom_node->name,
534 "floppy")) { 532 "floppy")) {
535 isa_dev = child; 533 isa_dev = child;
536 goto isa_done; 534 goto isa_done;
@@ -615,6 +613,7 @@ static unsigned long __init sun_floppy_init(void)
615 struct linux_ebus_device *edev = NULL; 613 struct linux_ebus_device *edev = NULL;
616 unsigned long config = 0; 614 unsigned long config = 0;
617 void __iomem *auxio_reg; 615 void __iomem *auxio_reg;
616 char *state_prop;
618 617
619 for_each_ebus(ebus) { 618 for_each_ebus(ebus) {
620 for_each_ebusdev(edev, ebus) { 619 for_each_ebusdev(edev, ebus) {
@@ -631,9 +630,8 @@ static unsigned long __init sun_floppy_init(void)
631#endif 630#endif
632 } 631 }
633 632
634 prom_getproperty(edev->prom_node, "status", 633 state_prop = of_get_property(edev->prom_node, "status", NULL);
635 state, sizeof(state)); 634 if (state_prop && !strncmp(state_prop, "disabled", 8))
636 if (!strncmp(state, "disabled", 8))
637 return 0; 635 return 0;
638 636
639 FLOPPY_IRQ = edev->irqs[0]; 637 FLOPPY_IRQ = edev->irqs[0];
@@ -704,7 +702,7 @@ static unsigned long __init sun_floppy_init(void)
704 */ 702 */
705 for_each_ebus(ebus) { 703 for_each_ebus(ebus) {
706 for_each_ebusdev(edev, ebus) { 704 for_each_ebusdev(edev, ebus) {
707 if (!strcmp(edev->prom_name, "ecpp")) { 705 if (!strcmp(edev->prom_node->name, "ecpp")) {
708 config = edev->resource[1].start; 706 config = edev->resource[1].start;
709 goto config_done; 707 goto config_done;
710 } 708 }
diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h
index f0cf71376ec5..7c29fd1a87aa 100644
--- a/include/asm-sparc64/hardirq.h
+++ b/include/asm-sparc64/hardirq.h
@@ -12,6 +12,8 @@
12#define local_softirq_pending() \ 12#define local_softirq_pending() \
13 (local_cpu_data().__softirq_pending) 13 (local_cpu_data().__softirq_pending)
14 14
15void ack_bad_irq(unsigned int irq);
16
15#define HARDIRQ_BITS 8 17#define HARDIRQ_BITS 8
16 18
17#endif /* !(__SPARC64_HARDIRQ_H) */ 19#endif /* !(__SPARC64_HARDIRQ_H) */
diff --git a/include/asm-sparc64/hw_irq.h b/include/asm-sparc64/hw_irq.h
index 153cae2ddaee..599b3b073450 100644
--- a/include/asm-sparc64/hw_irq.h
+++ b/include/asm-sparc64/hw_irq.h
@@ -1,6 +1,6 @@
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
4/* Dummy include. */ 4extern void hw_resend_irq(struct hw_interrupt_type *handler, unsigned int virt_irq);
5 5
6#endif 6#endif
diff --git a/include/asm-sparc64/ide.h b/include/asm-sparc64/ide.h
index c393f815b0be..55149cf933c2 100644
--- a/include/asm-sparc64/ide.h
+++ b/include/asm-sparc64/ide.h
@@ -10,7 +10,6 @@
10 10
11#ifdef __KERNEL__ 11#ifdef __KERNEL__
12 12
13#include <linux/config.h>
14#include <asm/pgalloc.h> 13#include <asm/pgalloc.h>
15#include <asm/io.h> 14#include <asm/io.h>
16#include <asm/spitfire.h> 15#include <asm/spitfire.h>
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
index de33d6e1afb5..905e59b4a737 100644
--- a/include/asm-sparc64/irq.h
+++ b/include/asm-sparc64/irq.h
@@ -8,7 +8,6 @@
8#ifndef _SPARC64_IRQ_H 8#ifndef _SPARC64_IRQ_H
9#define _SPARC64_IRQ_H 9#define _SPARC64_IRQ_H
10 10
11#include <linux/config.h>
12#include <linux/linkage.h> 11#include <linux/linkage.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
@@ -16,58 +15,6 @@
16#include <asm/pil.h> 15#include <asm/pil.h>
17#include <asm/ptrace.h> 16#include <asm/ptrace.h>
18 17
19struct ino_bucket;
20
21#define MAX_IRQ_DESC_ACTION 4
22
23struct irq_desc {
24 void (*pre_handler)(struct ino_bucket *, void *, void *);
25 void *pre_handler_arg1;
26 void *pre_handler_arg2;
27 u32 action_active_mask;
28 struct irqaction action[MAX_IRQ_DESC_ACTION];
29};
30
31/* You should not mess with this directly. That's the job of irq.c.
32 *
33 * If you make changes here, please update hand coded assembler of
34 * the vectored interrupt trap handler in entry.S -DaveM
35 *
36 * This is currently one DCACHE line, two buckets per L2 cache
37 * line. Keep this in mind please.
38 */
39struct ino_bucket {
40 /* Next handler in per-CPU PIL worklist. We know that
41 * bucket pointers have the high 32-bits clear, so to
42 * save space we only store the bits we need.
43 */
44/*0x00*/unsigned int irq_chain;
45
46 /* PIL to schedule this IVEC at. */
47/*0x04*/unsigned char pil;
48
49 /* If an IVEC arrives while irq_info is NULL, we
50 * set this to notify request_irq() about the event.
51 */
52/*0x05*/unsigned char pending;
53
54 /* Miscellaneous flags. */
55/*0x06*/unsigned char flags;
56
57 /* Currently unused. */
58/*0x07*/unsigned char __pad;
59
60 /* Reference to IRQ descriptor for this bucket. */
61/*0x08*/struct irq_desc *irq_info;
62
63 /* Sun5 Interrupt Clear Register. */
64/*0x10*/unsigned long iclr;
65
66 /* Sun5 Interrupt Mapping Register. */
67/*0x18*/unsigned long imap;
68
69};
70
71/* IMAP/ICLR register defines */ 18/* IMAP/ICLR register defines */
72#define IMAP_VALID 0x80000000 /* IRQ Enabled */ 19#define IMAP_VALID 0x80000000 /* IRQ Enabled */
73#define IMAP_TID_UPA 0x7c000000 /* UPA TargetID */ 20#define IMAP_TID_UPA 0x7c000000 /* UPA TargetID */
@@ -85,36 +32,20 @@ struct ino_bucket {
85#define ICLR_TRANSMIT 0x00000001 /* Transmit state */ 32#define ICLR_TRANSMIT 0x00000001 /* Transmit state */
86#define ICLR_PENDING 0x00000003 /* Pending state */ 33#define ICLR_PENDING 0x00000003 /* Pending state */
87 34
88/* Only 8-bits are available, be careful. -DaveM */ 35/* The largest number of unique interrupt sources we support.
89#define IBF_PCI 0x02 /* PSYCHO/SABRE/SCHIZO PCI interrupt. */ 36 * If this needs to ever be larger than 255, you need to change
90#define IBF_ACTIVE 0x04 /* Interrupt is active and has a handler.*/ 37 * the type of ino_bucket->virt_irq as appropriate.
91#define IBF_INPROGRESS 0x10 /* IRQ is being serviced. */ 38 *
92 39 * ino_bucket->virt_irq allocation is made during {sun4v_,}build_irq().
93#define NUM_IVECS (IMAP_INR + 1) 40 */
94extern struct ino_bucket ivector_table[NUM_IVECS]; 41#define NR_IRQS 255
95
96#define __irq_ino(irq) \
97 (((struct ino_bucket *)(unsigned long)(irq)) - &ivector_table[0])
98#define __irq_pil(irq) ((struct ino_bucket *)(unsigned long)(irq))->pil
99#define __bucket(irq) ((struct ino_bucket *)(unsigned long)(irq))
100#define __irq(bucket) ((unsigned int)(unsigned long)(bucket))
101
102static __inline__ char *__irq_itoa(unsigned int irq)
103{
104 static char buff[16];
105
106 sprintf(buff, "%d,%x", __irq_pil(irq), (unsigned int)__irq_ino(irq));
107 return buff;
108}
109
110#define NR_IRQS 16
111 42
43extern void irq_install_pre_handler(int virt_irq,
44 void (*func)(unsigned int, void *, void *),
45 void *arg1, void *arg2);
112#define irq_canonicalize(irq) (irq) 46#define irq_canonicalize(irq) (irq)
113extern void disable_irq(unsigned int); 47extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap);
114#define disable_irq_nosync disable_irq 48extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino);
115extern void enable_irq(unsigned int);
116extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap);
117extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino, int pil, unsigned char flags);
118extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); 49extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
119 50
120static __inline__ void set_softint(unsigned long bits) 51static __inline__ void set_softint(unsigned long bits)
@@ -140,8 +71,4 @@ static __inline__ unsigned long get_softint(void)
140 return retval; 71 return retval;
141} 72}
142 73
143struct irqaction;
144struct pt_regs;
145int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
146
147#endif 74#endif
diff --git a/include/asm-sparc64/isa.h b/include/asm-sparc64/isa.h
index 4601bbfc3e7b..d9728b9031fc 100644
--- a/include/asm-sparc64/isa.h
+++ b/include/asm-sparc64/isa.h
@@ -9,37 +9,32 @@
9 9
10#include <asm/pbm.h> 10#include <asm/pbm.h>
11#include <asm/oplib.h> 11#include <asm/oplib.h>
12#include <asm/prom.h>
13#include <asm/of_device.h>
12 14
13struct sparc_isa_bridge; 15struct sparc_isa_bridge;
14 16
15struct sparc_isa_device { 17struct sparc_isa_device {
18 struct of_device ofdev;
16 struct sparc_isa_device *next; 19 struct sparc_isa_device *next;
17 struct sparc_isa_device *child; 20 struct sparc_isa_device *child;
18 struct sparc_isa_bridge *bus; 21 struct sparc_isa_bridge *bus;
19 int prom_node; 22 struct device_node *prom_node;
20 char prom_name[64];
21 char compatible[64];
22 struct resource resource; 23 struct resource resource;
23 unsigned int irq; 24 unsigned int irq;
24}; 25};
26#define to_isa_device(d) container_of(d, struct sparc_isa_device, ofdev.dev)
25 27
26struct sparc_isa_bridge { 28struct sparc_isa_bridge {
29 struct of_device ofdev;
27 struct sparc_isa_bridge *next; 30 struct sparc_isa_bridge *next;
28 struct sparc_isa_device *devices; 31 struct sparc_isa_device *devices;
29 struct pci_pbm_info *parent; 32 struct pci_pbm_info *parent;
30 struct pci_dev *self; 33 struct pci_dev *self;
31 int index; 34 int index;
32 int prom_node; 35 struct device_node *prom_node;
33 char prom_name[64];
34#define linux_prom_isa_ranges linux_prom_ebus_ranges
35 struct linux_prom_isa_ranges isa_ranges[PROMREG_MAX];
36 int num_isa_ranges;
37#define linux_prom_isa_intmap linux_prom_ebus_intmap
38 struct linux_prom_isa_intmap isa_intmap[PROMREG_MAX];
39 int num_isa_intmap;
40#define linux_prom_isa_intmask linux_prom_ebus_intmask
41 struct linux_prom_isa_intmap isa_intmask;
42}; 36};
37#define to_isa_bridge(d) container_of(d, struct sparc_isa_bridge, ofdev.dev)
43 38
44extern struct sparc_isa_bridge *isa_chain; 39extern struct sparc_isa_bridge *isa_chain;
45 40
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h
index e4efe652b54b..e9bb26f770ed 100644
--- a/include/asm-sparc64/kprobes.h
+++ b/include/asm-sparc64/kprobes.h
@@ -1,7 +1,6 @@
1#ifndef _SPARC64_KPROBES_H 1#ifndef _SPARC64_KPROBES_H
2#define _SPARC64_KPROBES_H 2#define _SPARC64_KPROBES_H
3 3
4#include <linux/config.h>
5#include <linux/types.h> 4#include <linux/types.h>
6#include <linux/percpu.h> 5#include <linux/percpu.h>
7 6
diff --git a/include/asm-sparc64/mc146818rtc.h b/include/asm-sparc64/mc146818rtc.h
index 75bd572b35fe..e9c0fcc25c6f 100644
--- a/include/asm-sparc64/mc146818rtc.h
+++ b/include/asm-sparc64/mc146818rtc.h
@@ -4,7 +4,6 @@
4#ifndef __ASM_SPARC64_MC146818RTC_H 4#ifndef __ASM_SPARC64_MC146818RTC_H
5#define __ASM_SPARC64_MC146818RTC_H 5#define __ASM_SPARC64_MC146818RTC_H
6 6
7#include <linux/config.h>
8#include <asm/io.h> 7#include <asm/io.h>
9 8
10#ifndef RTC_PORT 9#ifndef RTC_PORT
diff --git a/include/asm-sparc64/mmu.h b/include/asm-sparc64/mmu.h
index 2d4f2ea9568a..70af4b6ce136 100644
--- a/include/asm-sparc64/mmu.h
+++ b/include/asm-sparc64/mmu.h
@@ -1,7 +1,6 @@
1#ifndef __MMU_H 1#ifndef __MMU_H
2#define __MMU_H 2#define __MMU_H
3 3
4#include <linux/config.h>
5#include <asm/page.h> 4#include <asm/page.h>
6#include <asm/const.h> 5#include <asm/const.h>
7#include <asm/hypervisor.h> 6#include <asm/hypervisor.h>
diff --git a/include/asm-sparc64/of_device.h b/include/asm-sparc64/of_device.h
new file mode 100644
index 000000000000..024088ef9d27
--- /dev/null
+++ b/include/asm-sparc64/of_device.h
@@ -0,0 +1,64 @@
1#ifndef _ASM_SPARC64_OF_DEVICE_H
2#define _ASM_SPARC64_OF_DEVICE_H
3#ifdef __KERNEL__
4
5#include <linux/device.h>
6#include <linux/mod_devicetable.h>
7#include <asm/prom.h>
8
9extern struct bus_type isa_bus_type;
10extern struct bus_type ebus_bus_type;
11extern struct bus_type sbus_bus_type;
12
13/*
14 * The of_device is a kind of "base class" that is a superset of
15 * struct device for use by devices attached to an OF node and
16 * probed using OF properties.
17 */
18struct of_device
19{
20 struct device_node *node; /* OF device node */
21 struct device dev; /* Generic device interface */
22};
23#define to_of_device(d) container_of(d, struct of_device, dev)
24
25extern const struct of_device_id *of_match_device(
26 const struct of_device_id *matches, const struct of_device *dev);
27
28extern struct of_device *of_dev_get(struct of_device *dev);
29extern void of_dev_put(struct of_device *dev);
30
31/*
32 * An of_platform_driver driver is attached to a basic of_device on
33 * the ISA, EBUS, and SBUS busses on sparc64.
34 */
35struct of_platform_driver
36{
37 char *name;
38 struct of_device_id *match_table;
39 struct module *owner;
40
41 int (*probe)(struct of_device* dev, const struct of_device_id *match);
42 int (*remove)(struct of_device* dev);
43
44 int (*suspend)(struct of_device* dev, pm_message_t state);
45 int (*resume)(struct of_device* dev);
46 int (*shutdown)(struct of_device* dev);
47
48 struct device_driver driver;
49};
50#define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver)
51
52extern int of_register_driver(struct of_platform_driver *drv,
53 struct bus_type *bus);
54extern void of_unregister_driver(struct of_platform_driver *drv);
55extern int of_device_register(struct of_device *ofdev);
56extern void of_device_unregister(struct of_device *ofdev);
57extern struct of_device *of_platform_device_create(struct device_node *np,
58 const char *bus_id,
59 struct device *parent,
60 struct bus_type *bus);
61extern void of_release_dev(struct device *dev);
62
63#endif /* __KERNEL__ */
64#endif /* _ASM_SPARC64_OF_DEVICE_H */
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h
index c754676e13ef..a68b0bb05958 100644
--- a/include/asm-sparc64/oplib.h
+++ b/include/asm-sparc64/oplib.h
@@ -9,7 +9,6 @@
9#ifndef __SPARC64_OPLIB_H 9#ifndef __SPARC64_OPLIB_H
10#define __SPARC64_OPLIB_H 10#define __SPARC64_OPLIB_H
11 11
12#include <linux/config.h>
13#include <asm/openprom.h> 12#include <asm/openprom.h>
14 13
15/* OBP version string. */ 14/* OBP version string. */
@@ -324,8 +323,9 @@ extern int prom_pathtoinode(const char *path);
324extern int prom_inst2pkg(int); 323extern int prom_inst2pkg(int);
325 324
326/* CPU probing helpers. */ 325/* CPU probing helpers. */
327int cpu_find_by_instance(int instance, int *prom_node, int *mid); 326struct device_node;
328int cpu_find_by_mid(int mid, int *prom_node); 327int cpu_find_by_instance(int instance, struct device_node **dev_node, int *mid);
328int cpu_find_by_mid(int mid, struct device_node **prom_node);
329 329
330/* Client interface level routines. */ 330/* Client interface level routines. */
331extern void prom_set_trap_table(unsigned long tba); 331extern void prom_set_trap_table(unsigned long tba);
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h
index aabb21906724..fdf0ceb76028 100644
--- a/include/asm-sparc64/page.h
+++ b/include/asm-sparc64/page.h
@@ -3,7 +3,6 @@
3#ifndef _SPARC64_PAGE_H 3#ifndef _SPARC64_PAGE_H
4#define _SPARC64_PAGE_H 4#define _SPARC64_PAGE_H
5 5
6#include <linux/config.h>
7#include <asm/const.h> 6#include <asm/const.h>
8 7
9#if defined(CONFIG_SPARC64_PAGE_SIZE_8KB) 8#if defined(CONFIG_SPARC64_PAGE_SIZE_8KB)
diff --git a/include/asm-sparc64/param.h b/include/asm-sparc64/param.h
index a1cd4974630b..f0125cf5a9df 100644
--- a/include/asm-sparc64/param.h
+++ b/include/asm-sparc64/param.h
@@ -1,7 +1,6 @@
1#ifndef _ASMSPARC64_PARAM_H 1#ifndef _ASMSPARC64_PARAM_H
2#define _ASMSPARC64_PARAM_H 2#define _ASMSPARC64_PARAM_H
3 3
4#include <linux/config.h>
5 4
6#ifdef __KERNEL__ 5#ifdef __KERNEL__
7# define HZ CONFIG_HZ /* Internal kernel timer frequency */ 6# define HZ CONFIG_HZ /* Internal kernel timer frequency */
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h
index 56b5197d7898..d3895873e4c7 100644
--- a/include/asm-sparc64/parport.h
+++ b/include/asm-sparc64/parport.h
@@ -67,18 +67,17 @@ static __inline__ unsigned int get_dma_residue(unsigned int dmanr)
67 67
68static int ebus_ecpp_p(struct linux_ebus_device *edev) 68static int ebus_ecpp_p(struct linux_ebus_device *edev)
69{ 69{
70 if (!strcmp(edev->prom_name, "ecpp")) 70 if (!strcmp(edev->prom_node->name, "ecpp"))
71 return 1; 71 return 1;
72 if (!strcmp(edev->prom_name, "parallel")) { 72 if (!strcmp(edev->prom_node->name, "parallel")) {
73 char compat[19]; 73 char *compat;
74 prom_getstring(edev->prom_node, 74
75 "compatible", 75 compat = of_get_property(edev->prom_node,
76 compat, sizeof(compat)); 76 "compatible", NULL);
77 compat[18] = '\0'; 77 if (compat &&
78 if (!strcmp(compat, "ecpp")) 78 (!strcmp(compat, "ecpp") ||
79 return 1; 79 !strcmp(compat, "ns87317-ecpp") ||
80 if (!strcmp(compat, "ns87317-ecpp") && 80 !strcmp(compat + 13, "ecpp")))
81 !strcmp(compat + 13, "ecpp"))
82 return 1; 81 return 1;
83 } 82 }
84 return 0; 83 return 0;
@@ -94,12 +93,12 @@ static int parport_isa_probe(int count)
94 struct sparc_isa_device *child; 93 struct sparc_isa_device *child;
95 unsigned long base; 94 unsigned long base;
96 95
97 if (strcmp(isa_dev->prom_name, "dma")) 96 if (strcmp(isa_dev->prom_node->name, "dma"))
98 continue; 97 continue;
99 98
100 child = isa_dev->child; 99 child = isa_dev->child;
101 while (child) { 100 while (child) {
102 if (!strcmp(child->prom_name, "parallel")) 101 if (!strcmp(child->prom_node->name, "parallel"))
103 break; 102 break;
104 child = child->next; 103 child = child->next;
105 } 104 }
diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h
index 1396f110939a..cebe80b1da6c 100644
--- a/include/asm-sparc64/pbm.h
+++ b/include/asm-sparc64/pbm.h
@@ -15,6 +15,7 @@
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/page.h> 16#include <asm/page.h>
17#include <asm/oplib.h> 17#include <asm/oplib.h>
18#include <asm/prom.h>
18#include <asm/iommu.h> 19#include <asm/iommu.h>
19 20
20/* The abstraction used here is that there are PCI controllers, 21/* The abstraction used here is that there are PCI controllers,
@@ -153,16 +154,15 @@ struct pci_pbm_info {
153 int chip_revision; 154 int chip_revision;
154 155
155 /* Name used for top-level resources. */ 156 /* Name used for top-level resources. */
156 char name[64]; 157 char *name;
157 158
158 /* OBP specific information. */ 159 /* OBP specific information. */
159 int prom_node; 160 struct device_node *prom_node;
160 char prom_name[64]; 161 struct linux_prom_pci_ranges *pbm_ranges;
161 struct linux_prom_pci_ranges pbm_ranges[PROM_PCIRNG_MAX];
162 int num_pbm_ranges; 162 int num_pbm_ranges;
163 struct linux_prom_pci_intmap pbm_intmap[PROM_PCIIMAP_MAX]; 163 struct linux_prom_pci_intmap *pbm_intmap;
164 int num_pbm_intmap; 164 int num_pbm_intmap;
165 struct linux_prom_pci_intmask pbm_intmask; 165 struct linux_prom_pci_intmask *pbm_intmask;
166 u64 ino_bitmap; 166 u64 ino_bitmap;
167 167
168 /* PBM I/O and Memory space resources. */ 168 /* PBM I/O and Memory space resources. */
@@ -227,8 +227,7 @@ struct pci_controller_info {
227 */ 227 */
228struct pcidev_cookie { 228struct pcidev_cookie {
229 struct pci_pbm_info *pbm; 229 struct pci_pbm_info *pbm;
230 char prom_name[64]; 230 struct device_node *prom_node;
231 int prom_node;
232 struct linux_prom_pci_registers prom_regs[PROMREG_MAX]; 231 struct linux_prom_pci_registers prom_regs[PROMREG_MAX];
233 int num_prom_regs; 232 int num_prom_regs;
234 struct linux_prom_pci_registers prom_assignments[PROMREG_MAX]; 233 struct linux_prom_pci_registers prom_assignments[PROMREG_MAX];
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h
index 12e4a273bd43..010f9cd0a672 100644
--- a/include/asm-sparc64/pgalloc.h
+++ b/include/asm-sparc64/pgalloc.h
@@ -2,7 +2,6 @@
2#ifndef _SPARC64_PGALLOC_H 2#ifndef _SPARC64_PGALLOC_H
3#define _SPARC64_PGALLOC_H 3#define _SPARC64_PGALLOC_H
4 4
5#include <linux/config.h>
6#include <linux/kernel.h> 5#include <linux/kernel.h>
7#include <linux/sched.h> 6#include <linux/sched.h>
8#include <linux/mm.h> 7#include <linux/mm.h>
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index cd464f469a2c..03f5bc9b6bec 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -14,7 +14,6 @@
14 14
15#include <asm-generic/pgtable-nopud.h> 15#include <asm-generic/pgtable-nopud.h>
16 16
17#include <linux/config.h>
18#include <linux/compiler.h> 17#include <linux/compiler.h>
19#include <asm/types.h> 18#include <asm/types.h>
20#include <asm/spitfire.h> 19#include <asm/spitfire.h>
@@ -757,6 +756,8 @@ extern unsigned long *sparc64_valid_addr_bitmap;
757#define kern_addr_valid(addr) \ 756#define kern_addr_valid(addr) \
758 (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap)) 757 (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap))
759 758
759extern int page_in_phys_avail(unsigned long paddr);
760
760extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 761extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
761 unsigned long pfn, 762 unsigned long pfn,
762 unsigned long size, pgprot_t prot); 763 unsigned long size, pgprot_t prot);
diff --git a/include/asm-sparc64/pil.h b/include/asm-sparc64/pil.h
index 79f827eb3f5d..72927749aebf 100644
--- a/include/asm-sparc64/pil.h
+++ b/include/asm-sparc64/pil.h
@@ -5,9 +5,9 @@
5/* To avoid some locking problems, we hard allocate certain PILs 5/* To avoid some locking problems, we hard allocate certain PILs
6 * for SMP cross call messages that must do a etrap/rtrap. 6 * for SMP cross call messages that must do a etrap/rtrap.
7 * 7 *
8 * A cli() does not block the cross call delivery, so when SMP 8 * A local_irq_disable() does not block the cross call delivery, so
9 * locking is an issue we reschedule the event into a PIL interrupt 9 * when SMP locking is an issue we reschedule the event into a PIL
10 * which is blocked by cli(). 10 * interrupt which is blocked by local_irq_disable().
11 * 11 *
12 * In fact any XCALL which has to etrap/rtrap has a problem because 12 * In fact any XCALL which has to etrap/rtrap has a problem because
13 * it is difficult to prevent rtrap from running BH's, and that would 13 * it is difficult to prevent rtrap from running BH's, and that would
@@ -17,6 +17,7 @@
17#define PIL_SMP_RECEIVE_SIGNAL 2 17#define PIL_SMP_RECEIVE_SIGNAL 2
18#define PIL_SMP_CAPTURE 3 18#define PIL_SMP_CAPTURE 3
19#define PIL_SMP_CTX_NEW_VERSION 4 19#define PIL_SMP_CTX_NEW_VERSION 4
20#define PIL_DEVICE_IRQ 5
20 21
21#ifndef __ASSEMBLY__ 22#ifndef __ASSEMBLY__
22#define PIL_RESERVED(PIL) ((PIL) == PIL_SMP_CALL_FUNC || \ 23#define PIL_RESERVED(PIL) ((PIL) == PIL_SMP_CALL_FUNC || \
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h
index c6896b88283e..66dd2fa0e319 100644
--- a/include/asm-sparc64/processor.h
+++ b/include/asm-sparc64/processor.h
@@ -13,7 +13,6 @@
13 */ 13 */
14#define current_text_addr() ({ void *pc; __asm__("rd %%pc, %0" : "=r" (pc)); pc; }) 14#define current_text_addr() ({ void *pc; __asm__("rd %%pc, %0" : "=r" (pc)); pc; })
15 15
16#include <linux/config.h>
17#include <asm/asi.h> 16#include <asm/asi.h>
18#include <asm/a.out.h> 17#include <asm/a.out.h>
19#include <asm/pstate.h> 18#include <asm/pstate.h>
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
new file mode 100644
index 000000000000..6d1556c0c263
--- /dev/null
+++ b/include/asm-sparc64/prom.h
@@ -0,0 +1,98 @@
1#ifndef _SPARC64_PROM_H
2#define _SPARC64_PROM_H
3#ifdef __KERNEL__
4
5
6/*
7 * Definitions for talking to the Open Firmware PROM on
8 * Power Macintosh computers.
9 *
10 * Copyright (C) 1996-2005 Paul Mackerras.
11 *
12 * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
13 * Updates for SPARC64 by David S. Miller
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version.
19 */
20
21#include <linux/types.h>
22#include <linux/proc_fs.h>
23#include <asm/atomic.h>
24
25typedef u32 phandle;
26typedef u32 ihandle;
27
28struct interrupt_info {
29 int line;
30 int sense; /* +ve/-ve logic, edge or level, etc. */
31};
32
33struct property {
34 char *name;
35 int length;
36 void *value;
37 struct property *next;
38};
39
40struct device_node {
41 char *name;
42 char *type;
43 phandle node;
44 phandle linux_phandle;
45 int n_intrs;
46 struct interrupt_info *intrs;
47 char *path_component_name;
48 char *full_name;
49
50 struct property *properties;
51 struct property *deadprops; /* removed properties */
52 struct device_node *parent;
53 struct device_node *child;
54 struct device_node *sibling;
55 struct device_node *next; /* next device of same type */
56 struct device_node *allnext; /* next in list of all nodes */
57 struct proc_dir_entry *pde; /* this node's proc directory */
58 struct kref kref;
59 unsigned long _flags;
60 void *data;
61};
62
63static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
64{
65 dn->pde = de;
66}
67
68extern struct device_node *of_find_node_by_name(struct device_node *from,
69 const char *name);
70#define for_each_node_by_name(dn, name) \
71 for (dn = of_find_node_by_name(NULL, name); dn; \
72 dn = of_find_node_by_name(dn, name))
73extern struct device_node *of_find_node_by_type(struct device_node *from,
74 const char *type);
75#define for_each_node_by_type(dn, type) \
76 for (dn = of_find_node_by_type(NULL, type); dn; \
77 dn = of_find_node_by_type(dn, type))
78extern struct device_node *of_find_compatible_node(struct device_node *from,
79 const char *type, const char *compat);
80extern struct device_node *of_find_node_by_path(const char *path);
81extern struct device_node *of_find_node_by_phandle(phandle handle);
82extern struct device_node *of_get_parent(const struct device_node *node);
83extern struct device_node *of_get_next_child(const struct device_node *node,
84 struct device_node *prev);
85extern struct property *of_find_property(struct device_node *np,
86 const char *name,
87 int *lenp);
88extern int of_device_is_compatible(struct device_node *device, const char *);
89extern void *of_get_property(struct device_node *node, const char *name,
90 int *lenp);
91extern int of_getintprop_default(struct device_node *np,
92 const char *name,
93 int def);
94
95extern void prom_build_devicetree(void);
96
97#endif /* __KERNEL__ */
98#endif /* _SPARC64_PROM_H */
diff --git a/include/asm-sparc64/sbus.h b/include/asm-sparc64/sbus.h
index 48279e10f385..56ee985e4605 100644
--- a/include/asm-sparc64/sbus.h
+++ b/include/asm-sparc64/sbus.h
@@ -11,6 +11,8 @@
11#include <linux/ioport.h> 11#include <linux/ioport.h>
12 12
13#include <asm/oplib.h> 13#include <asm/oplib.h>
14#include <asm/prom.h>
15#include <asm/of_device.h>
14#include <asm/iommu.h> 16#include <asm/iommu.h>
15#include <asm/scatterlist.h> 17#include <asm/scatterlist.h>
16 18
@@ -42,18 +44,19 @@ struct sbus_bus;
42 44
43/* Linux SBUS device tables */ 45/* Linux SBUS device tables */
44struct sbus_dev { 46struct sbus_dev {
45 struct sbus_bus *bus; /* Our toplevel parent SBUS */ 47 struct of_device ofdev;
46 struct sbus_dev *next; /* Chain of siblings */ 48 struct sbus_bus *bus;
47 struct sbus_dev *child; /* Chain of children */ 49 struct sbus_dev *next;
48 struct sbus_dev *parent;/* Parent device if not toplevel*/ 50 struct sbus_dev *child;
49 int prom_node; /* OBP node of this device */ 51 struct sbus_dev *parent;
50 char prom_name[64]; /* OBP device name property */ 52 int prom_node;
51 int slot; /* SBUS slot number */ 53 char prom_name[64];
54 int slot;
52 55
53 struct resource resource[PROMREG_MAX]; 56 struct resource resource[PROMREG_MAX];
54 57
55 struct linux_prom_registers reg_addrs[PROMREG_MAX]; 58 struct linux_prom_registers reg_addrs[PROMREG_MAX];
56 int num_registers, ranges_applied; 59 int num_registers;
57 60
58 struct linux_prom_ranges device_ranges[PROMREG_MAX]; 61 struct linux_prom_ranges device_ranges[PROMREG_MAX];
59 int num_device_ranges; 62 int num_device_ranges;
@@ -61,9 +64,11 @@ struct sbus_dev {
61 unsigned int irqs[4]; 64 unsigned int irqs[4];
62 int num_irqs; 65 int num_irqs;
63}; 66};
67#define to_sbus_device(d) container_of(d, struct sbus_dev, ofdev.dev)
64 68
65/* This struct describes the SBus(s) found on this machine. */ 69/* This struct describes the SBus(s) found on this machine. */
66struct sbus_bus { 70struct sbus_bus {
71 struct of_device ofdev;
67 void *iommu; /* Opaque IOMMU cookie */ 72 void *iommu; /* Opaque IOMMU cookie */
68 struct sbus_dev *devices; /* Tree of SBUS devices */ 73 struct sbus_dev *devices; /* Tree of SBUS devices */
69 struct sbus_bus *next; /* Next SBUS in system */ 74 struct sbus_bus *next; /* Next SBUS in system */
@@ -77,6 +82,7 @@ struct sbus_bus {
77 int portid; 82 int portid;
78 void *starfire_cookie; 83 void *starfire_cookie;
79}; 84};
85#define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev)
80 86
81extern struct sbus_bus *sbus_root; 87extern struct sbus_bus *sbus_root;
82 88
@@ -95,6 +101,7 @@ extern struct sbus_bus *sbus_root;
95#define sbus_can_dma_64bit(sdev) (1) 101#define sbus_can_dma_64bit(sdev) (1)
96#define sbus_can_burst64(sdev) (1) 102#define sbus_can_burst64(sdev) (1)
97extern void sbus_set_sbus64(struct sbus_dev *, int); 103extern void sbus_set_sbus64(struct sbus_dev *, int);
104extern void sbus_fill_device_irq(struct sbus_dev *);
98 105
99/* These yield IOMMU mappings in consistent mode. */ 106/* These yield IOMMU mappings in consistent mode. */
100extern void *sbus_alloc_consistent(struct sbus_dev *, size_t, dma_addr_t *dma_addrp); 107extern void *sbus_alloc_consistent(struct sbus_dev *, size_t, dma_addr_t *dma_addrp);
@@ -119,4 +126,10 @@ extern void sbus_dma_sync_sg_for_cpu(struct sbus_dev *, struct scatterlist *, in
119#define sbus_dma_sync_sg sbus_dma_sync_sg_for_cpu 126#define sbus_dma_sync_sg sbus_dma_sync_sg_for_cpu
120extern void sbus_dma_sync_sg_for_device(struct sbus_dev *, struct scatterlist *, int, int); 127extern void sbus_dma_sync_sg_for_device(struct sbus_dev *, struct scatterlist *, int, int);
121 128
129extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *);
130extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *);
131extern void sbus_setup_arch_props(struct sbus_bus *, struct device_node *);
132extern int sbus_arch_preinit(void);
133extern void sbus_arch_postinit(void);
134
122#endif /* !(_SPARC64_SBUS_H) */ 135#endif /* !(_SPARC64_SBUS_H) */
diff --git a/include/asm-sparc64/siginfo.h b/include/asm-sparc64/siginfo.h
index df17e47abc1c..c96e6c30f8b0 100644
--- a/include/asm-sparc64/siginfo.h
+++ b/include/asm-sparc64/siginfo.h
@@ -11,7 +11,6 @@
11 11
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13 13
14#include <linux/config.h>
15#include <linux/compat.h> 14#include <linux/compat.h>
16 15
17#ifdef CONFIG_COMPAT 16#ifdef CONFIG_COMPAT
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
index e3059bb4a465..fdc42a14d4e6 100644
--- a/include/asm-sparc64/signal.h
+++ b/include/asm-sparc64/signal.h
@@ -6,7 +6,6 @@
6 6
7#ifdef __KERNEL__ 7#ifdef __KERNEL__
8#ifndef __ASSEMBLY__ 8#ifndef __ASSEMBLY__
9#include <linux/config.h>
10#include <linux/personality.h> 9#include <linux/personality.h>
11#include <linux/types.h> 10#include <linux/types.h>
12#include <linux/compat.h> 11#include <linux/compat.h>
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h
index 89d86ecaab24..388249b751c3 100644
--- a/include/asm-sparc64/smp.h
+++ b/include/asm-sparc64/smp.h
@@ -6,7 +6,6 @@
6#ifndef _SPARC64_SMP_H 6#ifndef _SPARC64_SMP_H
7#define _SPARC64_SMP_H 7#define _SPARC64_SMP_H
8 8
9#include <linux/config.h>
10#include <linux/threads.h> 9#include <linux/threads.h>
11#include <asm/asi.h> 10#include <asm/asi.h>
12#include <asm/starfire.h> 11#include <asm/starfire.h>
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h
index 508c416e9d6a..bd5ffc76bc7e 100644
--- a/include/asm-sparc64/spinlock.h
+++ b/include/asm-sparc64/spinlock.h
@@ -6,7 +6,6 @@
6#ifndef __SPARC64_SPINLOCK_H 6#ifndef __SPARC64_SPINLOCK_H
7#define __SPARC64_SPINLOCK_H 7#define __SPARC64_SPINLOCK_H
8 8
9#include <linux/config.h>
10#include <linux/threads.h> /* For NR_CPUS */ 9#include <linux/threads.h> /* For NR_CPUS */
11 10
12#ifndef __ASSEMBLY__ 11#ifndef __ASSEMBLY__
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index a18ec87a52c1..4ca68600c670 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -2,7 +2,6 @@
2#ifndef __SPARC64_SYSTEM_H 2#ifndef __SPARC64_SYSTEM_H
3#define __SPARC64_SYSTEM_H 3#define __SPARC64_SYSTEM_H
4 4
5#include <linux/config.h>
6#include <asm/ptrace.h> 5#include <asm/ptrace.h>
7#include <asm/processor.h> 6#include <asm/processor.h>
8#include <asm/visasm.h> 7#include <asm/visasm.h>
diff --git a/include/asm-sparc64/timer.h b/include/asm-sparc64/timer.h
index edc8e08c3a39..d435594df786 100644
--- a/include/asm-sparc64/timer.h
+++ b/include/asm-sparc64/timer.h
@@ -9,7 +9,6 @@
9 9
10#include <linux/types.h> 10#include <linux/types.h>
11 11
12#include <linux/config.h>
13 12
14struct sparc64_tick_ops { 13struct sparc64_tick_ops {
15 void (*init_tick)(unsigned long); 14 void (*init_tick)(unsigned long);
diff --git a/include/asm-sparc64/tlb.h b/include/asm-sparc64/tlb.h
index 61c01882b562..7af1e1109c49 100644
--- a/include/asm-sparc64/tlb.h
+++ b/include/asm-sparc64/tlb.h
@@ -1,7 +1,6 @@
1#ifndef _SPARC64_TLB_H 1#ifndef _SPARC64_TLB_H
2#define _SPARC64_TLB_H 2#define _SPARC64_TLB_H
3 3
4#include <linux/config.h>
5#include <linux/swap.h> 4#include <linux/swap.h>
6#include <asm/pgalloc.h> 5#include <asm/pgalloc.h>
7#include <asm/tlbflush.h> 6#include <asm/tlbflush.h>
diff --git a/include/asm-sparc64/tlbflush.h b/include/asm-sparc64/tlbflush.h
index e3a7c453b500..3487328570ed 100644
--- a/include/asm-sparc64/tlbflush.h
+++ b/include/asm-sparc64/tlbflush.h
@@ -1,7 +1,6 @@
1#ifndef _SPARC64_TLBFLUSH_H 1#ifndef _SPARC64_TLBFLUSH_H
2#define _SPARC64_TLBFLUSH_H 2#define _SPARC64_TLBFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6#include <asm/mmu_context.h> 5#include <asm/mmu_context.h>
7 6
diff --git a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h
index 2d5e3c464df5..f2352606a79f 100644
--- a/include/asm-sparc64/ttable.h
+++ b/include/asm-sparc64/ttable.h
@@ -2,7 +2,6 @@
2#ifndef _SPARC64_TTABLE_H 2#ifndef _SPARC64_TTABLE_H
3#define _SPARC64_TTABLE_H 3#define _SPARC64_TTABLE_H
4 4
5#include <linux/config.h>
6#include <asm/utrap.h> 5#include <asm/utrap.h>
7 6
8#ifdef __ASSEMBLY__ 7#ifdef __ASSEMBLY__
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 998ef4ab0e06..badc73fdcb97 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -321,6 +321,7 @@
321#define __NR_set_robust_list 300 321#define __NR_set_robust_list 300
322#define __NR_get_robust_list 301 322#define __NR_get_robust_list 301
323 323
324#ifdef __KERNEL__
324/* WARNING: You MAY NOT add syscall numbers larger than 301, since 325/* WARNING: You MAY NOT add syscall numbers larger than 301, since
325 * all of the syscall tables in the Sparc kernel are 326 * all of the syscall tables in the Sparc kernel are
326 * sized to have 301 entries (starting at zero). Therefore 327 * sized to have 301 entries (starting at zero). Therefore
@@ -487,7 +488,6 @@ asmlinkage long sys_rt_sigaction(int sig,
487 488
488#endif /* __KERNEL_SYSCALLS__ */ 489#endif /* __KERNEL_SYSCALLS__ */
489 490
490#ifdef __KERNEL__
491/* sysconf options, for SunOS compatibility */ 491/* sysconf options, for SunOS compatibility */
492#define _SC_ARG_MAX 1 492#define _SC_ARG_MAX 1
493#define _SC_CHILD_MAX 2 493#define _SC_CHILD_MAX 2
@@ -521,7 +521,6 @@ asmlinkage long sys_rt_sigaction(int sig,
521#define __ARCH_WANT_SYS_SIGPROCMASK 521#define __ARCH_WANT_SYS_SIGPROCMASK
522#define __ARCH_WANT_SYS_RT_SIGSUSPEND 522#define __ARCH_WANT_SYS_RT_SIGSUSPEND
523#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND 523#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
524#endif
525 524
526/* 525/*
527 * "Conditional" syscalls 526 * "Conditional" syscalls
@@ -531,4 +530,5 @@ asmlinkage long sys_rt_sigaction(int sig,
531 */ 530 */
532#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 531#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
533 532
533#endif /* __KERNEL__ */
534#endif /* _SPARC64_UNISTD_H */ 534#endif /* _SPARC64_UNISTD_H */
diff --git a/include/asm-sparc64/vdev.h b/include/asm-sparc64/vdev.h
index 996e6be7b976..25637c57675d 100644
--- a/include/asm-sparc64/vdev.h
+++ b/include/asm-sparc64/vdev.h
@@ -7,10 +7,11 @@
7#define _SPARC64_VDEV_H 7#define _SPARC64_VDEV_H
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10#include <asm/prom.h>
10 11
11extern u32 sun4v_vdev_devhandle; 12extern u32 sun4v_vdev_devhandle;
12extern int sun4v_vdev_root; 13extern struct device_node *sun4v_vdev_root;
13 14
14extern unsigned int sun4v_vdev_device_interrupt(unsigned int); 15extern unsigned int sun4v_vdev_device_interrupt(struct device_node *dev_node);
15 16
16#endif /* !(_SPARC64_VDEV_H) */ 17#endif /* !(_SPARC64_VDEV_H) */
diff --git a/include/asm-sparc64/vga.h b/include/asm-sparc64/vga.h
index 9c57eb363b40..c69d5b2ba19a 100644
--- a/include/asm-sparc64/vga.h
+++ b/include/asm-sparc64/vga.h
@@ -28,6 +28,6 @@ static inline u16 scr_readw(const u16 *addr)
28 return *addr; 28 return *addr;
29} 29}
30 30
31#define VGA_MAP_MEM(x) (x) 31#define VGA_MAP_MEM(x,s) (x)
32 32
33#endif 33#endif
diff --git a/include/asm-um/a.out.h b/include/asm-um/a.out.h
index 7c26265e1d7a..50cee7b296f4 100644
--- a/include/asm-um/a.out.h
+++ b/include/asm-um/a.out.h
@@ -1,7 +1,6 @@
1#ifndef __UM_A_OUT_H 1#ifndef __UM_A_OUT_H
2#define __UM_A_OUT_H 2#define __UM_A_OUT_H
3 3
4#include "linux/config.h"
5#include "asm/arch/a.out.h" 4#include "asm/arch/a.out.h"
6#include "choose-mode.h" 5#include "choose-mode.h"
7 6
diff --git a/include/asm-um/cache.h b/include/asm-um/cache.h
index 3d0587075521..19e1bdd67416 100644
--- a/include/asm-um/cache.h
+++ b/include/asm-um/cache.h
@@ -1,7 +1,6 @@
1#ifndef __UM_CACHE_H 1#ifndef __UM_CACHE_H
2#define __UM_CACHE_H 2#define __UM_CACHE_H
3 3
4#include <linux/config.h>
5 4
6#if defined(CONFIG_UML_X86) && !defined(CONFIG_64BIT) 5#if defined(CONFIG_UML_X86) && !defined(CONFIG_64BIT)
7# define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) 6# define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
diff --git a/include/asm-um/elf-ppc.h b/include/asm-um/elf-ppc.h
index 2998cf925042..99711134e477 100644
--- a/include/asm-um/elf-ppc.h
+++ b/include/asm-um/elf-ppc.h
@@ -1,7 +1,6 @@
1#ifndef __UM_ELF_PPC_H 1#ifndef __UM_ELF_PPC_H
2#define __UM_ELF_PPC_H 2#define __UM_ELF_PPC_H
3 3
4#include "linux/config.h"
5 4
6extern long elf_aux_hwcap; 5extern long elf_aux_hwcap;
7#define ELF_HWCAP (elf_aux_hwcap) 6#define ELF_HWCAP (elf_aux_hwcap)
diff --git a/include/asm-um/fixmap.h b/include/asm-um/fixmap.h
index ae0ca3932d50..d352a35cfafb 100644
--- a/include/asm-um/fixmap.h
+++ b/include/asm-um/fixmap.h
@@ -1,7 +1,6 @@
1#ifndef __UM_FIXMAP_H 1#ifndef __UM_FIXMAP_H
2#define __UM_FIXMAP_H 2#define __UM_FIXMAP_H
3 3
4#include <linux/config.h>
5#include <asm/kmap_types.h> 4#include <asm/kmap_types.h>
6#include <asm/archparam.h> 5#include <asm/archparam.h>
7#include <asm/elf.h> 6#include <asm/elf.h>
diff --git a/include/asm-um/hardirq.h b/include/asm-um/hardirq.h
index 1224b2690a23..313ebb8a2566 100644
--- a/include/asm-um/hardirq.h
+++ b/include/asm-um/hardirq.h
@@ -3,7 +3,6 @@
3#ifndef __ASM_UM_HARDIRQ_H 3#ifndef __ASM_UM_HARDIRQ_H
4#define __ASM_UM_HARDIRQ_H 4#define __ASM_UM_HARDIRQ_H
5 5
6#include <linux/config.h>
7#include <linux/threads.h> 6#include <linux/threads.h>
8#include <linux/irq.h> 7#include <linux/irq.h>
9 8
diff --git a/include/asm-um/linkage.h b/include/asm-um/linkage.h
index e3d62dcbd356..78b862472b36 100644
--- a/include/asm-um/linkage.h
+++ b/include/asm-um/linkage.h
@@ -3,7 +3,6 @@
3 3
4#include "asm/arch/linkage.h" 4#include "asm/arch/linkage.h"
5 5
6#include <linux/config.h>
7 6
8/* <linux/linkage.h> will pick sane defaults */ 7/* <linux/linkage.h> will pick sane defaults */
9#ifdef CONFIG_GPROF 8#ifdef CONFIG_GPROF
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h
index 9a0e48eb542e..f709c784bf12 100644
--- a/include/asm-um/mmu_context.h
+++ b/include/asm-um/mmu_context.h
@@ -7,7 +7,6 @@
7#define __UM_MMU_CONTEXT_H 7#define __UM_MMU_CONTEXT_H
8 8
9#include "linux/sched.h" 9#include "linux/sched.h"
10#include "linux/config.h"
11#include "choose-mode.h" 10#include "choose-mode.h"
12#include "um_mmu.h" 11#include "um_mmu.h"
13 12
diff --git a/include/asm-um/page.h b/include/asm-um/page.h
index 41364330aff1..4296d3135aa9 100644
--- a/include/asm-um/page.h
+++ b/include/asm-um/page.h
@@ -9,7 +9,6 @@
9 9
10struct page; 10struct page;
11 11
12#include <linux/config.h>
13#include <asm/vm-flags.h> 12#include <asm/vm-flags.h>
14 13
15/* PAGE_SHIFT determines the page size */ 14/* PAGE_SHIFT determines the page size */
diff --git a/include/asm-um/pgalloc.h b/include/asm-um/pgalloc.h
index ea49411236dc..34ab268ef40e 100644
--- a/include/asm-um/pgalloc.h
+++ b/include/asm-um/pgalloc.h
@@ -8,7 +8,6 @@
8#ifndef __UM_PGALLOC_H 8#ifndef __UM_PGALLOC_H
9#define __UM_PGALLOC_H 9#define __UM_PGALLOC_H
10 10
11#include "linux/config.h"
12#include "linux/mm.h" 11#include "linux/mm.h"
13#include "asm/fixmap.h" 12#include "asm/fixmap.h"
14 13
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h
index da07a69ce82a..824c28896382 100644
--- a/include/asm-um/processor-generic.h
+++ b/include/asm-um/processor-generic.h
@@ -10,7 +10,6 @@ struct pt_regs;
10 10
11struct task_struct; 11struct task_struct;
12 12
13#include "linux/config.h"
14#include "asm/ptrace.h" 13#include "asm/ptrace.h"
15#include "choose-mode.h" 14#include "choose-mode.h"
16#include "registers.h" 15#include "registers.h"
diff --git a/include/asm-um/ptrace-generic.h b/include/asm-um/ptrace-generic.h
index 503484305e67..a36f5371b36b 100644
--- a/include/asm-um/ptrace-generic.h
+++ b/include/asm-um/ptrace-generic.h
@@ -8,7 +8,6 @@
8 8
9#ifndef __ASSEMBLY__ 9#ifndef __ASSEMBLY__
10 10
11#include "linux/config.h"
12 11
13#define pt_regs pt_regs_subarch 12#define pt_regs pt_regs_subarch
14#define show_regs show_regs_subarch 13#define show_regs show_regs_subarch
diff --git a/include/asm-um/smp.h b/include/asm-um/smp.h
index aeda6657f366..ca552261ed1f 100644
--- a/include/asm-um/smp.h
+++ b/include/asm-um/smp.h
@@ -3,7 +3,6 @@
3 3
4#ifdef CONFIG_SMP 4#ifdef CONFIG_SMP
5 5
6#include "linux/config.h"
7#include "linux/bitops.h" 6#include "linux/bitops.h"
8#include "asm/current.h" 7#include "asm/current.h"
9#include "linux/cpumask.h" 8#include "linux/cpumask.h"
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h
index f166b9837c6a..261e2f4528f6 100644
--- a/include/asm-um/thread_info.h
+++ b/include/asm-um/thread_info.h
@@ -8,7 +8,6 @@
8 8
9#ifndef __ASSEMBLY__ 9#ifndef __ASSEMBLY__
10 10
11#include <linux/config.h>
12#include <asm/processor.h> 11#include <asm/processor.h>
13#include <asm/types.h> 12#include <asm/types.h>
14 13
diff --git a/include/asm-v850/atomic.h b/include/asm-v850/atomic.h
index 166df00457ea..e4e57de08f73 100644
--- a/include/asm-v850/atomic.h
+++ b/include/asm-v850/atomic.h
@@ -14,7 +14,6 @@
14#ifndef __V850_ATOMIC_H__ 14#ifndef __V850_ATOMIC_H__
15#define __V850_ATOMIC_H__ 15#define __V850_ATOMIC_H__
16 16
17#include <linux/config.h>
18 17
19#include <asm/system.h> 18#include <asm/system.h>
20 19
diff --git a/include/asm-v850/bitops.h b/include/asm-v850/bitops.h
index 1f6fd5ab4177..1fa99baf4e25 100644
--- a/include/asm-v850/bitops.h
+++ b/include/asm-v850/bitops.h
@@ -14,7 +14,6 @@
14#define __V850_BITOPS_H__ 14#define __V850_BITOPS_H__
15 15
16 16
17#include <linux/config.h>
18#include <linux/compiler.h> /* unlikely */ 17#include <linux/compiler.h> /* unlikely */
19#include <asm/byteorder.h> /* swab32 */ 18#include <asm/byteorder.h> /* swab32 */
20#include <asm/system.h> /* interrupt enable/disable */ 19#include <asm/system.h> /* interrupt enable/disable */
diff --git a/include/asm-v850/dma-mapping.h b/include/asm-v850/dma-mapping.h
index c63fb50ec9ef..1cc42c603a1b 100644
--- a/include/asm-v850/dma-mapping.h
+++ b/include/asm-v850/dma-mapping.h
@@ -1,7 +1,6 @@
1#ifndef __V850_DMA_MAPPING_H__ 1#ifndef __V850_DMA_MAPPING_H__
2#define __V850_DMA_MAPPING_H__ 2#define __V850_DMA_MAPPING_H__
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_PCI 5#ifdef CONFIG_PCI
7#include <asm-generic/dma-mapping.h> 6#include <asm-generic/dma-mapping.h>
diff --git a/include/asm-v850/hardirq.h b/include/asm-v850/hardirq.h
index d98488cd5af1..04e20127c5af 100644
--- a/include/asm-v850/hardirq.h
+++ b/include/asm-v850/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef __V850_HARDIRQ_H__ 1#ifndef __V850_HARDIRQ_H__
2#define __V850_HARDIRQ_H__ 2#define __V850_HARDIRQ_H__
3 3
4#include <linux/config.h>
5#include <linux/threads.h> 4#include <linux/threads.h>
6#include <linux/cache.h> 5#include <linux/cache.h>
7 6
diff --git a/include/asm-v850/irq.h b/include/asm-v850/irq.h
index 44431152b36d..1bf096db8f4c 100644
--- a/include/asm-v850/irq.h
+++ b/include/asm-v850/irq.h
@@ -62,8 +62,6 @@ extern void disable_irq (unsigned int irq);
62/* Disable an irq without waiting. */ 62/* Disable an irq without waiting. */
63extern void disable_irq_nosync (unsigned int irq); 63extern void disable_irq_nosync (unsigned int irq);
64 64
65extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
66
67#endif /* !__ASSEMBLY__ */ 65#endif /* !__ASSEMBLY__ */
68 66
69#endif /* __V850_IRQ_H__ */ 67#endif /* __V850_IRQ_H__ */
diff --git a/include/asm-v850/machdep.h b/include/asm-v850/machdep.h
index 98d8bf63970e..f1e3b8b91508 100644
--- a/include/asm-v850/machdep.h
+++ b/include/asm-v850/machdep.h
@@ -14,7 +14,6 @@
14#ifndef __V850_MACHDEP_H__ 14#ifndef __V850_MACHDEP_H__
15#define __V850_MACHDEP_H__ 15#define __V850_MACHDEP_H__
16 16
17#include <linux/config.h>
18 17
19/* chips */ 18/* chips */
20#ifdef CONFIG_V850E_MA1 19#ifdef CONFIG_V850E_MA1
diff --git a/include/asm-v850/pgtable.h b/include/asm-v850/pgtable.h
index 3cf8775ce85f..1ea2a900f0f8 100644
--- a/include/asm-v850/pgtable.h
+++ b/include/asm-v850/pgtable.h
@@ -3,7 +3,6 @@
3 3
4#include <asm-generic/4level-fixup.h> 4#include <asm-generic/4level-fixup.h>
5 5
6#include <linux/config.h>
7#include <asm/page.h> 6#include <asm/page.h>
8 7
9 8
diff --git a/include/asm-v850/processor.h b/include/asm-v850/processor.h
index 2d31308935a0..6965b66ccaed 100644
--- a/include/asm-v850/processor.h
+++ b/include/asm-v850/processor.h
@@ -14,7 +14,6 @@
14#ifndef __V850_PROCESSOR_H__ 14#ifndef __V850_PROCESSOR_H__
15#define __V850_PROCESSOR_H__ 15#define __V850_PROCESSOR_H__
16 16
17#include <linux/config.h>
18#ifndef __ASSEMBLY__ /* <linux/thread_info.h> is not asm-safe. */ 17#ifndef __ASSEMBLY__ /* <linux/thread_info.h> is not asm-safe. */
19#include <linux/thread_info.h> 18#include <linux/thread_info.h>
20#endif 19#endif
diff --git a/include/asm-v850/serial.h b/include/asm-v850/serial.h
index 8c2a609ba2b0..36d8f4cbbf39 100644
--- a/include/asm-v850/serial.h
+++ b/include/asm-v850/serial.h
@@ -6,7 +6,6 @@
6 * Copyright (C) 1999 by Ralf Baechle 6 * Copyright (C) 1999 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 */ 8 */
9#include <linux/config.h>
10 9
11#ifdef CONFIG_RTE_CB_ME2 10#ifdef CONFIG_RTE_CB_ME2
12 11
diff --git a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h
index 82460a7bb233..bcb44bfe577a 100644
--- a/include/asm-v850/unistd.h
+++ b/include/asm-v850/unistd.h
@@ -14,8 +14,6 @@
14#ifndef __V850_UNISTD_H__ 14#ifndef __V850_UNISTD_H__
15#define __V850_UNISTD_H__ 15#define __V850_UNISTD_H__
16 16
17#include <asm/clinkage.h>
18
19#define __NR_restart_syscall 0 17#define __NR_restart_syscall 0
20#define __NR_exit 1 18#define __NR_exit 1
21#define __NR_fork 2 19#define __NR_fork 2
@@ -237,10 +235,9 @@
237 except the syscall number (r12). */ 235 except the syscall number (r12). */
238#define SYSCALL_SHORT_CLOBBERS SYSCALL_CLOBBERS, "r13", "r14" 236#define SYSCALL_SHORT_CLOBBERS SYSCALL_CLOBBERS, "r13", "r14"
239 237
238#ifdef __KERNEL__
240 239
241/* User programs sometimes end up including this header file 240#include <asm/clinkage.h>
242 (indirectly, via uClibc header files), so I'm a bit nervous just
243 including <linux/compiler.h>. */
244 241
245#define __syscall_return(type, res) \ 242#define __syscall_return(type, res) \
246 do { \ 243 do { \
@@ -368,7 +365,6 @@ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \
368} 365}
369 366
370 367
371#ifdef __KERNEL__
372#define __ARCH_WANT_IPC_PARSE_VERSION 368#define __ARCH_WANT_IPC_PARSE_VERSION
373#define __ARCH_WANT_OLD_READDIR 369#define __ARCH_WANT_OLD_READDIR
374#define __ARCH_WANT_STAT64 370#define __ARCH_WANT_STAT64
@@ -389,7 +385,6 @@ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \
389#define __ARCH_WANT_SYS_SIGPENDING 385#define __ARCH_WANT_SYS_SIGPENDING
390#define __ARCH_WANT_SYS_SIGPROCMASK 386#define __ARCH_WANT_SYS_SIGPROCMASK
391#define __ARCH_WANT_SYS_RT_SIGACTION 387#define __ARCH_WANT_SYS_RT_SIGACTION
392#endif
393 388
394#ifdef __KERNEL_SYSCALLS__ 389#ifdef __KERNEL_SYSCALLS__
395 390
@@ -440,7 +435,7 @@ asmlinkage long sys_rt_sigaction(int sig,
440 struct sigaction __user *oact, 435 struct sigaction __user *oact,
441 size_t sigsetsize); 436 size_t sigsetsize);
442 437
443#endif 438#endif /* __KERNEL_SYSCALLS__ */
444 439
445/* 440/*
446 * "Conditional" syscalls 441 * "Conditional" syscalls
@@ -455,4 +450,5 @@ asmlinkage long sys_rt_sigaction(int sig,
455 void name (void) __attribute__ ((weak, alias ("sys_ni_syscall"))); 450 void name (void) __attribute__ ((weak, alias ("sys_ni_syscall")));
456#endif 451#endif
457 452
453#endif /* __KERNEL__ */
458#endif /* __V850_UNISTD_H__ */ 454#endif /* __V850_UNISTD_H__ */
diff --git a/include/asm-v850/v850e_uart.h b/include/asm-v850/v850e_uart.h
index 5930d5990b19..5182fb4cc989 100644
--- a/include/asm-v850/v850e_uart.h
+++ b/include/asm-v850/v850e_uart.h
@@ -19,7 +19,6 @@
19#ifndef __V850_V850E_UART_H__ 19#ifndef __V850_V850E_UART_H__
20#define __V850_V850E_UART_H__ 20#define __V850_V850E_UART_H__
21 21
22#include <linux/config.h>
23#include <linux/termios.h> 22#include <linux/termios.h>
24 23
25#include <asm/v850e_utils.h> 24#include <asm/v850e_utils.h>
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index aa1c7b2e438c..2c95a319c056 100644
--- a/include/asm-x86_64/acpi.h
+++ b/include/asm-x86_64/acpi.h
@@ -162,6 +162,8 @@ extern int acpi_pci_disabled;
162 162
163extern u8 x86_acpiid_to_apicid[]; 163extern u8 x86_acpiid_to_apicid[];
164 164
165#define ARCH_HAS_POWER_INIT 1
166
165extern int acpi_skip_timer_override; 167extern int acpi_skip_timer_override;
166 168
167#endif /*__KERNEL__*/ 169#endif /*__KERNEL__*/
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h
index bdbd8935612a..a731be2204d2 100644
--- a/include/asm-x86_64/apic.h
+++ b/include/asm-x86_64/apic.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_APIC_H 1#ifndef __ASM_APIC_H
2#define __ASM_APIC_H 2#define __ASM_APIC_H
3 3
4#include <linux/config.h>
5#include <linux/pm.h> 4#include <linux/pm.h>
6#include <asm/fixmap.h> 5#include <asm/fixmap.h>
7#include <asm/apicdef.h> 6#include <asm/apicdef.h>
diff --git a/include/asm-x86_64/apicdef.h b/include/asm-x86_64/apicdef.h
index 5a48e9bcf218..1dd40067c67c 100644
--- a/include/asm-x86_64/apicdef.h
+++ b/include/asm-x86_64/apicdef.h
@@ -137,8 +137,6 @@
137 */ 137 */
138#define u32 unsigned int 138#define u32 unsigned int
139 139
140#define lapic ((volatile struct local_apic *)APIC_BASE)
141
142struct local_apic { 140struct local_apic {
143 141
144/*000*/ struct { u32 __reserved[4]; } __reserved_01; 142/*000*/ struct { u32 __reserved[4]; } __reserved_01;
diff --git a/include/asm-x86_64/atomic.h b/include/asm-x86_64/atomic.h
index cecbf7baa6aa..bd3fa67ed835 100644
--- a/include/asm-x86_64/atomic.h
+++ b/include/asm-x86_64/atomic.h
@@ -1,7 +1,6 @@
1#ifndef __ARCH_X86_64_ATOMIC__ 1#ifndef __ARCH_X86_64_ATOMIC__
2#define __ARCH_X86_64_ATOMIC__ 2#define __ARCH_X86_64_ATOMIC__
3 3
4#include <linux/config.h>
5#include <asm/types.h> 4#include <asm/types.h>
6 5
7/* atomic_t should be 32 bit signed type */ 6/* atomic_t should be 32 bit signed type */
diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h
index 79212128d0f7..e9bf933d25d0 100644
--- a/include/asm-x86_64/bitops.h
+++ b/include/asm-x86_64/bitops.h
@@ -5,7 +5,6 @@
5 * Copyright 1992, Linus Torvalds. 5 * Copyright 1992, Linus Torvalds.
6 */ 6 */
7 7
8#include <linux/config.h>
9 8
10#ifdef CONFIG_SMP 9#ifdef CONFIG_SMP
11#define LOCK_PREFIX "lock ; " 10#define LOCK_PREFIX "lock ; "
diff --git a/include/asm-x86_64/bugs.h b/include/asm-x86_64/bugs.h
index 59bc68925d0f..d86c5dd689fa 100644
--- a/include/asm-x86_64/bugs.h
+++ b/include/asm-x86_64/bugs.h
@@ -10,7 +10,6 @@
10 * void check_bugs(void); 10 * void check_bugs(void);
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <asm/processor.h> 13#include <asm/processor.h>
15#include <asm/i387.h> 14#include <asm/i387.h>
16#include <asm/msr.h> 15#include <asm/msr.h>
diff --git a/include/asm-x86_64/cache.h b/include/asm-x86_64/cache.h
index f8dff1c67538..ed8a9d25272d 100644
--- a/include/asm-x86_64/cache.h
+++ b/include/asm-x86_64/cache.h
@@ -4,7 +4,6 @@
4#ifndef __ARCH_X8664_CACHE_H 4#ifndef __ARCH_X8664_CACHE_H
5#define __ARCH_X8664_CACHE_H 5#define __ARCH_X8664_CACHE_H
6 6
7#include <linux/config.h>
8 7
9/* L1 cache line size */ 8/* L1 cache line size */
10#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) 9#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
diff --git a/include/asm-x86_64/calling.h b/include/asm-x86_64/calling.h
index fc2c5a6c262a..6f4f63af96e1 100644
--- a/include/asm-x86_64/calling.h
+++ b/include/asm-x86_64/calling.h
@@ -2,7 +2,6 @@
2 * Some macros to handle stack frames in assembly. 2 * Some macros to handle stack frames in assembly.
3 */ 3 */
4 4
5#include <linux/config.h>
6 5
7#define R15 0 6#define R15 0
8#define R14 8 7#define R14 8
diff --git a/include/asm-x86_64/dma-mapping.h b/include/asm-x86_64/dma-mapping.h
index 49a81a66516e..498f66df36b9 100644
--- a/include/asm-x86_64/dma-mapping.h
+++ b/include/asm-x86_64/dma-mapping.h
@@ -6,7 +6,6 @@
6 * documentation. 6 * documentation.
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11#include <asm/scatterlist.h> 10#include <asm/scatterlist.h>
12#include <asm/io.h> 11#include <asm/io.h>
diff --git a/include/asm-x86_64/dma.h b/include/asm-x86_64/dma.h
index 6f2a817b6a7c..c556208d3dd7 100644
--- a/include/asm-x86_64/dma.h
+++ b/include/asm-x86_64/dma.h
@@ -8,7 +8,6 @@
8#ifndef _ASM_DMA_H 8#ifndef _ASM_DMA_H
9#define _ASM_DMA_H 9#define _ASM_DMA_H
10 10
11#include <linux/config.h>
12#include <linux/spinlock.h> /* And spinlocks */ 11#include <linux/spinlock.h> /* And spinlocks */
13#include <asm/io.h> /* need byte IO */ 12#include <asm/io.h> /* need byte IO */
14#include <linux/delay.h> 13#include <linux/delay.h>
diff --git a/include/asm-x86_64/dwarf2.h b/include/asm-x86_64/dwarf2.h
index 07654bd155bf..0744db777676 100644
--- a/include/asm-x86_64/dwarf2.h
+++ b/include/asm-x86_64/dwarf2.h
@@ -1,7 +1,6 @@
1#ifndef _DWARF2_H 1#ifndef _DWARF2_H
2#define _DWARF2_H 1 2#define _DWARF2_H 1
3 3
4#include <linux/config.h>
5 4
6#ifndef __ASSEMBLY__ 5#ifndef __ASSEMBLY__
7#warning "asm/dwarf2.h should be only included in pure assembly files" 6#warning "asm/dwarf2.h should be only included in pure assembly files"
diff --git a/include/asm-x86_64/fixmap.h b/include/asm-x86_64/fixmap.h
index 7b286bd21d1d..0b4ffbd1a125 100644
--- a/include/asm-x86_64/fixmap.h
+++ b/include/asm-x86_64/fixmap.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_FIXMAP_H 11#ifndef _ASM_FIXMAP_H
12#define _ASM_FIXMAP_H 12#define _ASM_FIXMAP_H
13 13
14#include <linux/config.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <asm/apicdef.h> 15#include <asm/apicdef.h>
17#include <asm/page.h> 16#include <asm/page.h>
diff --git a/include/asm-x86_64/hardirq.h b/include/asm-x86_64/hardirq.h
index 8689951e3503..64a65ce2f41f 100644
--- a/include/asm-x86_64/hardirq.h
+++ b/include/asm-x86_64/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_HARDIRQ_H 1#ifndef __ASM_HARDIRQ_H
2#define __ASM_HARDIRQ_H 2#define __ASM_HARDIRQ_H
3 3
4#include <linux/config.h>
5#include <linux/threads.h> 4#include <linux/threads.h>
6#include <linux/irq.h> 5#include <linux/irq.h>
7#include <asm/pda.h> 6#include <asm/pda.h>
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
index 0df1715dee71..3de96fd86a70 100644
--- a/include/asm-x86_64/hw_irq.h
+++ b/include/asm-x86_64/hw_irq.h
@@ -17,7 +17,6 @@
17 */ 17 */
18 18
19#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
20#include <linux/config.h>
21#include <asm/atomic.h> 20#include <asm/atomic.h>
22#include <asm/irq.h> 21#include <asm/irq.h>
23#include <linux/profile.h> 22#include <linux/profile.h>
diff --git a/include/asm-x86_64/ia32.h b/include/asm-x86_64/ia32.h
index e6b7f2234e43..0190b7c4e319 100644
--- a/include/asm-x86_64/ia32.h
+++ b/include/asm-x86_64/ia32.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_X86_64_IA32_H 1#ifndef _ASM_X86_64_IA32_H
2#define _ASM_X86_64_IA32_H 2#define _ASM_X86_64_IA32_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_IA32_EMULATION 5#ifdef CONFIG_IA32_EMULATION
7 6
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h
index a05da8a50bfd..70e91fe76344 100644
--- a/include/asm-x86_64/io.h
+++ b/include/asm-x86_64/io.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_IO_H 1#ifndef _ASM_IO_H
2#define _ASM_IO_H 2#define _ASM_IO_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * This file contains the definitions for the x86 IO instructions 6 * This file contains the definitions for the x86 IO instructions
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h
index 52484e82c641..fb7a0909a174 100644
--- a/include/asm-x86_64/io_apic.h
+++ b/include/asm-x86_64/io_apic.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_IO_APIC_H 1#ifndef __ASM_IO_APIC_H
2#define __ASM_IO_APIC_H 2#define __ASM_IO_APIC_H
3 3
4#include <linux/config.h>
5#include <asm/types.h> 4#include <asm/types.h>
6#include <asm/mpspec.h> 5#include <asm/mpspec.h>
7 6
diff --git a/include/asm-x86_64/mmu_context.h b/include/asm-x86_64/mmu_context.h
index 19f0c83d0792..af03b9f852d6 100644
--- a/include/asm-x86_64/mmu_context.h
+++ b/include/asm-x86_64/mmu_context.h
@@ -1,7 +1,6 @@
1#ifndef __X86_64_MMU_CONTEXT_H 1#ifndef __X86_64_MMU_CONTEXT_H
2#define __X86_64_MMU_CONTEXT_H 2#define __X86_64_MMU_CONTEXT_H
3 3
4#include <linux/config.h>
5#include <asm/desc.h> 4#include <asm/desc.h>
6#include <asm/atomic.h> 5#include <asm/atomic.h>
7#include <asm/pgalloc.h> 6#include <asm/pgalloc.h>
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h
index 6944e7122df5..c38ebdf6f426 100644
--- a/include/asm-x86_64/mmzone.h
+++ b/include/asm-x86_64/mmzone.h
@@ -4,7 +4,6 @@
4#ifndef _ASM_X86_64_MMZONE_H 4#ifndef _ASM_X86_64_MMZONE_H
5#define _ASM_X86_64_MMZONE_H 1 5#define _ASM_X86_64_MMZONE_H 1
6 6
7#include <linux/config.h>
8 7
9#ifdef CONFIG_NUMA 8#ifdef CONFIG_NUMA
10 9
@@ -43,7 +42,6 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)
43 42
44#ifdef CONFIG_DISCONTIGMEM 43#ifdef CONFIG_DISCONTIGMEM
45#define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT) 44#define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT)
46#define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr))
47 45
48extern int pfn_valid(unsigned long pfn); 46extern int pfn_valid(unsigned long pfn);
49#endif 47#endif
diff --git a/include/asm-x86_64/msi.h b/include/asm-x86_64/msi.h
index 356e0e82f50b..3ad2346624b2 100644
--- a/include/asm-x86_64/msi.h
+++ b/include/asm-x86_64/msi.h
@@ -10,7 +10,15 @@
10#include <asm/mach_apic.h> 10#include <asm/mach_apic.h>
11#include <asm/smp.h> 11#include <asm/smp.h>
12 12
13#define LAST_DEVICE_VECTOR 232 13#define LAST_DEVICE_VECTOR (FIRST_SYSTEM_VECTOR - 1)
14#define MSI_TARGET_CPU_SHIFT 12 14#define MSI_TARGET_CPU_SHIFT 12
15 15
16extern struct msi_ops msi_apic_ops;
17
18static inline int msi_arch_init(void)
19{
20 msi_register(&msi_apic_ops);
21 return 0;
22}
23
16#endif /* ASM_MSI_H */ 24#endif /* ASM_MSI_H */
diff --git a/include/asm-x86_64/mtrr.h b/include/asm-x86_64/mtrr.h
index 66ac1c0f27e1..d6135b2549bf 100644
--- a/include/asm-x86_64/mtrr.h
+++ b/include/asm-x86_64/mtrr.h
@@ -23,9 +23,7 @@
23#ifndef _LINUX_MTRR_H 23#ifndef _LINUX_MTRR_H
24#define _LINUX_MTRR_H 24#define _LINUX_MTRR_H
25 25
26#include <linux/config.h>
27#include <linux/ioctl.h> 26#include <linux/ioctl.h>
28#include <linux/compat.h>
29 27
30#define MTRR_IOCTL_BASE 'M' 28#define MTRR_IOCTL_BASE 'M'
31 29
@@ -102,11 +100,10 @@ static __inline__ int mtrr_del_page (int reg, unsigned long base,
102 return -ENODEV; 100 return -ENODEV;
103} 101}
104 102
105# endif 103#endif /* CONFIG_MTRR */
106
107#endif
108 104
109#ifdef CONFIG_COMPAT 105#ifdef CONFIG_COMPAT
106#include <linux/compat.h>
110 107
111struct mtrr_sentry32 108struct mtrr_sentry32
112{ 109{
@@ -138,4 +135,6 @@ struct mtrr_gentry32
138 135
139#endif /* CONFIG_COMPAT */ 136#endif /* CONFIG_COMPAT */
140 137
138#endif /* __KERNEL__ */
139
141#endif /* _LINUX_MTRR_H */ 140#endif /* _LINUX_MTRR_H */
diff --git a/include/asm-x86_64/numa.h b/include/asm-x86_64/numa.h
index 1cc92fe02503..933ff11ece15 100644
--- a/include/asm-x86_64/numa.h
+++ b/include/asm-x86_64/numa.h
@@ -8,7 +8,6 @@ struct bootnode {
8}; 8};
9 9
10extern int compute_hash_shift(struct bootnode *nodes, int numnodes); 10extern int compute_hash_shift(struct bootnode *nodes, int numnodes);
11extern int pxm_to_node(int nid);
12 11
13#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) 12#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
14 13
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index 408185bac351..f7bf875aae40 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -1,7 +1,6 @@
1#ifndef _X86_64_PAGE_H 1#ifndef _X86_64_PAGE_H
2#define _X86_64_PAGE_H 2#define _X86_64_PAGE_H
3 3
4#include <linux/config.h>
5 4
6/* PAGE_SHIFT determines the page size */ 5/* PAGE_SHIFT determines the page size */
7#define PAGE_SHIFT 12 6#define PAGE_SHIFT 12
@@ -136,9 +135,9 @@ typedef struct { unsigned long pgprot; } pgprot_t;
136 135
137#define __HAVE_ARCH_GATE_AREA 1 136#define __HAVE_ARCH_GATE_AREA 1
138 137
139#endif /* __KERNEL__ */
140
141#include <asm-generic/memory_model.h> 138#include <asm-generic/memory_model.h>
142#include <asm-generic/page.h> 139#include <asm-generic/page.h>
143 140
141#endif /* __KERNEL__ */
142
144#endif /* _X86_64_PAGE_H */ 143#endif /* _X86_64_PAGE_H */
diff --git a/include/asm-x86_64/param.h b/include/asm-x86_64/param.h
index 5956b23b57c2..a728786c3c7c 100644
--- a/include/asm-x86_64/param.h
+++ b/include/asm-x86_64/param.h
@@ -2,7 +2,6 @@
2#define _ASMx86_64_PARAM_H 2#define _ASMx86_64_PARAM_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5# include <linux/config.h>
6# define HZ CONFIG_HZ /* Internal kernel timer frequency */ 5# define HZ CONFIG_HZ /* Internal kernel timer frequency */
7# define USER_HZ 100 /* .. some user interfaces are in "ticks */ 6# define USER_HZ 100 /* .. some user interfaces are in "ticks */
8#define CLOCKS_PER_SEC (USER_HZ) /* like times() */ 7#define CLOCKS_PER_SEC (USER_HZ) /* like times() */
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h
index 8a05af264d18..2db0620d5449 100644
--- a/include/asm-x86_64/pci.h
+++ b/include/asm-x86_64/pci.h
@@ -1,7 +1,6 @@
1#ifndef __x8664_PCI_H 1#ifndef __x8664_PCI_H
2#define __x8664_PCI_H 2#define __x8664_PCI_H
3 3
4#include <linux/config.h>
5#include <asm/io.h> 4#include <asm/io.h>
6 5
7#ifdef __KERNEL__ 6#ifdef __KERNEL__
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index 37a3ec433ee5..3061a38a3b1d 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -12,7 +12,6 @@
12#include <asm/types.h> 12#include <asm/types.h>
13#include <asm/sigcontext.h> 13#include <asm/sigcontext.h>
14#include <asm/cpufeature.h> 14#include <asm/cpufeature.h>
15#include <linux/config.h>
16#include <linux/threads.h> 15#include <linux/threads.h>
17#include <asm/msr.h> 16#include <asm/msr.h>
18#include <asm/current.h> 17#include <asm/current.h>
diff --git a/include/asm-x86_64/serial.h b/include/asm-x86_64/serial.h
index dc752eafa681..b0496e0d72a6 100644
--- a/include/asm-x86_64/serial.h
+++ b/include/asm-x86_64/serial.h
@@ -2,7 +2,6 @@
2 * include/asm-x86_64/serial.h 2 * include/asm-x86_64/serial.h
3 */ 3 */
4 4
5#include <linux/config.h>
6 5
7/* 6/*
8 * This assumes you have a 1.8432 MHz clock for your UART. 7 * This assumes you have a 1.8432 MHz clock for your UART.
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h
index a4fdaeb5c397..7686b9b25aef 100644
--- a/include/asm-x86_64/smp.h
+++ b/include/asm-x86_64/smp.h
@@ -5,7 +5,6 @@
5 * We need the APIC definitions automatically as part of 'smp.h' 5 * We need the APIC definitions automatically as part of 'smp.h'
6 */ 6 */
7#ifndef __ASSEMBLY__ 7#ifndef __ASSEMBLY__
8#include <linux/config.h>
9#include <linux/threads.h> 8#include <linux/threads.h>
10#include <linux/cpumask.h> 9#include <linux/cpumask.h>
11#include <linux/bitops.h> 10#include <linux/bitops.h>
diff --git a/include/asm-x86_64/spinlock.h b/include/asm-x86_64/spinlock.h
index fe484a699cc3..5d8a5e3589ff 100644
--- a/include/asm-x86_64/spinlock.h
+++ b/include/asm-x86_64/spinlock.h
@@ -4,7 +4,6 @@
4#include <asm/atomic.h> 4#include <asm/atomic.h>
5#include <asm/rwlock.h> 5#include <asm/rwlock.h>
6#include <asm/page.h> 6#include <asm/page.h>
7#include <linux/config.h>
8 7
9/* 8/*
10 * Your basic SMP spinlocks, allowing only a single CPU anywhere 9 * Your basic SMP spinlocks, allowing only a single CPU anywhere
diff --git a/include/asm-x86_64/swiotlb.h b/include/asm-x86_64/swiotlb.h
index 60757efd1353..5f9a01805821 100644
--- a/include/asm-x86_64/swiotlb.h
+++ b/include/asm-x86_64/swiotlb.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_SWIOTLB_H 1#ifndef _ASM_SWIOTLB_H
2#define _ASM_SWTIOLB_H 1 2#define _ASM_SWTIOLB_H 1
3 3
4#include <linux/config.h>
5 4
6#include <asm/dma-mapping.h> 5#include <asm/dma-mapping.h>
7 6
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h
index 397598980228..f48e0dad8b3d 100644
--- a/include/asm-x86_64/system.h
+++ b/include/asm-x86_64/system.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SYSTEM_H 1#ifndef __ASM_SYSTEM_H
2#define __ASM_SYSTEM_H 2#define __ASM_SYSTEM_H
3 3
4#include <linux/config.h>
5#include <linux/kernel.h> 4#include <linux/kernel.h>
6#include <asm/segment.h> 5#include <asm/segment.h>
7 6
diff --git a/include/asm-x86_64/tlbflush.h b/include/asm-x86_64/tlbflush.h
index 4a9c20ea9b10..d16d5b60f419 100644
--- a/include/asm-x86_64/tlbflush.h
+++ b/include/asm-x86_64/tlbflush.h
@@ -1,7 +1,6 @@
1#ifndef _X8664_TLBFLUSH_H 1#ifndef _X8664_TLBFLUSH_H
2#define _X8664_TLBFLUSH_H 2#define _X8664_TLBFLUSH_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6#include <asm/processor.h> 5#include <asm/processor.h>
7 6
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index 9db54e9d17bb..80c4e44d011c 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_X86_64_TOPOLOGY_H 1#ifndef _ASM_X86_64_TOPOLOGY_H
2#define _ASM_X86_64_TOPOLOGY_H 2#define _ASM_X86_64_TOPOLOGY_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_NUMA 5#ifdef CONFIG_NUMA
7 6
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index bddffcb591b8..1e1fa003daa3 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -4,7 +4,6 @@
4/* 4/*
5 * User space memory access functions 5 * User space memory access functions
6 */ 6 */
7#include <linux/config.h>
8#include <linux/compiler.h> 7#include <linux/compiler.h>
9#include <linux/errno.h> 8#include <linux/errno.h>
10#include <linux/sched.h> 9#include <linux/sched.h>
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index feb77cb8c044..94387c915e53 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -617,8 +617,12 @@ __SYSCALL(__NR_tee, sys_tee)
617__SYSCALL(__NR_sync_file_range, sys_sync_file_range) 617__SYSCALL(__NR_sync_file_range, sys_sync_file_range)
618#define __NR_vmsplice 278 618#define __NR_vmsplice 278
619__SYSCALL(__NR_vmsplice, sys_vmsplice) 619__SYSCALL(__NR_vmsplice, sys_vmsplice)
620#define __NR_move_pages 279
621__SYSCALL(__NR_move_pages, sys_move_pages)
620 622
621#define __NR_syscall_max __NR_vmsplice 623#ifdef __KERNEL__
624
625#define __NR_syscall_max __NR_move_pages
622 626
623#ifndef __NO_STUBS 627#ifndef __NO_STUBS
624 628
@@ -635,7 +639,6 @@ do { \
635 return (type) (res); \ 639 return (type) (res); \
636} while (0) 640} while (0)
637 641
638#ifdef __KERNEL__
639#define __ARCH_WANT_OLD_READDIR 642#define __ARCH_WANT_OLD_READDIR
640#define __ARCH_WANT_OLD_STAT 643#define __ARCH_WANT_OLD_STAT
641#define __ARCH_WANT_SYS_ALARM 644#define __ARCH_WANT_SYS_ALARM
@@ -657,7 +660,6 @@ do { \
657#define __ARCH_WANT_SYS_RT_SIGACTION 660#define __ARCH_WANT_SYS_RT_SIGACTION
658#define __ARCH_WANT_SYS_TIME 661#define __ARCH_WANT_SYS_TIME
659#define __ARCH_WANT_COMPAT_SYS_TIME 662#define __ARCH_WANT_COMPAT_SYS_TIME
660#endif
661 663
662#ifndef __KERNEL_SYSCALLS__ 664#ifndef __KERNEL_SYSCALLS__
663 665
@@ -821,7 +823,7 @@ asmlinkage long sys_pipe(int *fildes);
821 823
822#endif /* __KERNEL_SYSCALLS__ */ 824#endif /* __KERNEL_SYSCALLS__ */
823 825
824#if !defined(__ASSEMBLY__) && defined(__KERNEL__) 826#ifndef __ASSEMBLY__
825 827
826#include <linux/linkage.h> 828#include <linux/linkage.h>
827#include <linux/compiler.h> 829#include <linux/compiler.h>
@@ -848,4 +850,5 @@ asmlinkage long sys_rt_sigaction(int sig,
848 */ 850 */
849#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 851#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
850 852
853#endif /* __KERNEL__ */
851#endif 854#endif
diff --git a/include/asm-x86_64/vga.h b/include/asm-x86_64/vga.h
index ef0c0e50cc95..0ecf68ac03aa 100644
--- a/include/asm-x86_64/vga.h
+++ b/include/asm-x86_64/vga.h
@@ -12,7 +12,7 @@
12 * access the videoram directly without any black magic. 12 * access the videoram directly without any black magic.
13 */ 13 */
14 14
15#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) 15#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
16 16
17#define vga_readb(x) (*(x)) 17#define vga_readb(x) (*(x))
18#define vga_writeb(x,y) (*(y) = (x)) 18#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/asm-xtensa/atomic.h b/include/asm-xtensa/atomic.h
index fe105a123924..5c2672021068 100644
--- a/include/asm-xtensa/atomic.h
+++ b/include/asm-xtensa/atomic.h
@@ -13,7 +13,6 @@
13#ifndef _XTENSA_ATOMIC_H 13#ifndef _XTENSA_ATOMIC_H
14#define _XTENSA_ATOMIC_H 14#define _XTENSA_ATOMIC_H
15 15
16#include <linux/config.h>
17#include <linux/stringify.h> 16#include <linux/stringify.h>
18 17
19typedef struct { volatile int counter; } atomic_t; 18typedef struct { volatile int counter; } atomic_t;
diff --git a/include/asm-xtensa/checksum.h b/include/asm-xtensa/checksum.h
index 81a797ae3abe..03114f8d1e18 100644
--- a/include/asm-xtensa/checksum.h
+++ b/include/asm-xtensa/checksum.h
@@ -11,7 +11,6 @@
11#ifndef _XTENSA_CHECKSUM_H 11#ifndef _XTENSA_CHECKSUM_H
12#define _XTENSA_CHECKSUM_H 12#define _XTENSA_CHECKSUM_H
13 13
14#include <linux/config.h>
15#include <linux/in6.h> 14#include <linux/in6.h>
16#include <xtensa/config/core.h> 15#include <xtensa/config/core.h>
17 16
@@ -44,8 +43,7 @@ asmlinkage unsigned int csum_partial_copy_generic( const char *src, char *dst, i
44 * Note: when you get a NULL pointer exception here this means someone 43 * Note: when you get a NULL pointer exception here this means someone
45 * passed in an incorrect kernel address to one of these functions. 44 * passed in an incorrect kernel address to one of these functions.
46 * 45 *
47 * If you use these functions directly please don't forget the 46 * If you use these functions directly please don't forget the access_ok().
48 * verify_area().
49 */ 47 */
50static inline 48static inline
51unsigned int csum_partial_copy_nocheck ( const char *src, char *dst, 49unsigned int csum_partial_copy_nocheck ( const char *src, char *dst,
diff --git a/include/asm-xtensa/delay.h b/include/asm-xtensa/delay.h
index 1bc601ec3621..e1d8c9e010c1 100644
--- a/include/asm-xtensa/delay.h
+++ b/include/asm-xtensa/delay.h
@@ -12,7 +12,6 @@
12#ifndef _XTENSA_DELAY_H 12#ifndef _XTENSA_DELAY_H
13#define _XTENSA_DELAY_H 13#define _XTENSA_DELAY_H
14 14
15#include <linux/config.h>
16#include <asm/processor.h> 15#include <asm/processor.h>
17#include <asm/param.h> 16#include <asm/param.h>
18 17
diff --git a/include/asm-xtensa/dma.h b/include/asm-xtensa/dma.h
index 1c22b0234586..db2633f67789 100644
--- a/include/asm-xtensa/dma.h
+++ b/include/asm-xtensa/dma.h
@@ -11,7 +11,6 @@
11#ifndef _XTENSA_DMA_H 11#ifndef _XTENSA_DMA_H
12#define _XTENSA_DMA_H 12#define _XTENSA_DMA_H
13 13
14#include <linux/config.h>
15#include <asm/io.h> /* need byte IO */ 14#include <asm/io.h> /* need byte IO */
16#include <xtensa/config/core.h> 15#include <xtensa/config/core.h>
17 16
diff --git a/include/asm-xtensa/hardirq.h b/include/asm-xtensa/hardirq.h
index aa9c1adf68d7..87cb19d1b10c 100644
--- a/include/asm-xtensa/hardirq.h
+++ b/include/asm-xtensa/hardirq.h
@@ -11,7 +11,6 @@
11#ifndef _XTENSA_HARDIRQ_H 11#ifndef _XTENSA_HARDIRQ_H
12#define _XTENSA_HARDIRQ_H 12#define _XTENSA_HARDIRQ_H
13 13
14#include <linux/config.h>
15#include <linux/cache.h> 14#include <linux/cache.h>
16#include <asm/irq.h> 15#include <asm/irq.h>
17 16
diff --git a/include/asm-xtensa/ide.h b/include/asm-xtensa/ide.h
index b523cd4a486e..6b912742a42d 100644
--- a/include/asm-xtensa/ide.h
+++ b/include/asm-xtensa/ide.h
@@ -14,7 +14,6 @@
14 14
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16 16
17#include <linux/config.h>
18 17
19#ifndef MAX_HWIFS 18#ifndef MAX_HWIFS
20# define MAX_HWIFS 1 19# define MAX_HWIFS 1
diff --git a/include/asm-xtensa/io.h b/include/asm-xtensa/io.h
index c5c13985bbe1..556e5eed34f5 100644
--- a/include/asm-xtensa/io.h
+++ b/include/asm-xtensa/io.h
@@ -12,7 +12,6 @@
12#define _XTENSA_IO_H 12#define _XTENSA_IO_H
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15#include <linux/config.h>
16#include <asm/byteorder.h> 15#include <asm/byteorder.h>
17 16
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/include/asm-xtensa/irq.h b/include/asm-xtensa/irq.h
index d984e955938f..049fde7e752d 100644
--- a/include/asm-xtensa/irq.h
+++ b/include/asm-xtensa/irq.h
@@ -11,7 +11,6 @@
11#ifndef _XTENSA_IRQ_H 11#ifndef _XTENSA_IRQ_H
12#define _XTENSA_IRQ_H 12#define _XTENSA_IRQ_H
13 13
14#include <linux/config.h>
15#include <asm/platform/hardware.h> 14#include <asm/platform/hardware.h>
16 15
17#include <xtensa/config/core.h> 16#include <xtensa/config/core.h>
diff --git a/include/asm-xtensa/mmu_context.h b/include/asm-xtensa/mmu_context.h
index 364a7b057bfa..af683a74a4ec 100644
--- a/include/asm-xtensa/mmu_context.h
+++ b/include/asm-xtensa/mmu_context.h
@@ -13,7 +13,6 @@
13#ifndef _XTENSA_MMU_CONTEXT_H 13#ifndef _XTENSA_MMU_CONTEXT_H
14#define _XTENSA_MMU_CONTEXT_H 14#define _XTENSA_MMU_CONTEXT_H
15 15
16#include <linux/config.h>
17#include <linux/stringify.h> 16#include <linux/stringify.h>
18 17
19#include <asm/pgtable.h> 18#include <asm/pgtable.h>
diff --git a/include/asm-xtensa/page.h b/include/asm-xtensa/page.h
index 992bac5c1258..40f4c6c3f580 100644
--- a/include/asm-xtensa/page.h
+++ b/include/asm-xtensa/page.h
@@ -14,7 +14,6 @@
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <asm/processor.h> 16#include <asm/processor.h>
17#include <linux/config.h>
18 17
19/* 18/*
20 * PAGE_SHIFT determines the page size 19 * PAGE_SHIFT determines the page size
diff --git a/include/asm-xtensa/pgalloc.h b/include/asm-xtensa/pgalloc.h
index 734a8d060395..d56ddf2055e1 100644
--- a/include/asm-xtensa/pgalloc.h
+++ b/include/asm-xtensa/pgalloc.h
@@ -13,7 +13,6 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/config.h>
17#include <linux/threads.h> 16#include <linux/threads.h>
18#include <linux/highmem.h> 17#include <linux/highmem.h>
19#include <asm/processor.h> 18#include <asm/processor.h>
diff --git a/include/asm-xtensa/platform.h b/include/asm-xtensa/platform.h
index 36163894bc20..48135a9718b0 100644
--- a/include/asm-xtensa/platform.h
+++ b/include/asm-xtensa/platform.h
@@ -13,7 +13,6 @@
13#ifndef _XTENSA_PLATFORM_H 13#ifndef _XTENSA_PLATFORM_H
14#define _XTENSA_PLATFORM_H 14#define _XTENSA_PLATFORM_H
15 15
16#include <linux/config.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/pci.h> 17#include <linux/pci.h>
19 18
diff --git a/include/asm-xtensa/rwsem.h b/include/asm-xtensa/rwsem.h
index 3c02b0e033f0..abcd86dc5ab9 100644
--- a/include/asm-xtensa/rwsem.h
+++ b/include/asm-xtensa/rwsem.h
@@ -172,4 +172,9 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
172 return atomic_add_return(delta, (atomic_t *)(&sem->count)); 172 return atomic_add_return(delta, (atomic_t *)(&sem->count));
173} 173}
174 174
175#endif /* _XTENSA_RWSEM_XADD_H */ 175static inline int rwsem_is_locked(struct rw_semaphore *sem)
176{
177 return (sem->count != 0);
178}
179
180#endif /* _XTENSA_RWSEM_H */
diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h
index b29f7ae6a08a..f986170bd2a1 100644
--- a/include/asm-xtensa/system.h
+++ b/include/asm-xtensa/system.h
@@ -11,7 +11,6 @@
11#ifndef _XTENSA_SYSTEM_H 11#ifndef _XTENSA_SYSTEM_H
12#define _XTENSA_SYSTEM_H 12#define _XTENSA_SYSTEM_H
13 13
14#include <linux/config.h>
15#include <linux/stringify.h> 14#include <linux/stringify.h>
16 15
17#include <asm/processor.h> 16#include <asm/processor.h>
diff --git a/include/asm-xtensa/uaccess.h b/include/asm-xtensa/uaccess.h
index 06a22b83ba17..88a64e1144d5 100644
--- a/include/asm-xtensa/uaccess.h
+++ b/include/asm-xtensa/uaccess.h
@@ -154,35 +154,6 @@
154.Laccess_ok_\@: 154.Laccess_ok_\@:
155 .endm 155 .endm
156 156
157/*
158 * verify_area determines whether a memory access is allowed. It's
159 * mostly an unnecessary wrapper for access_ok, but we provide it as a
160 * duplicate of the verify_area() C inline function below. See the
161 * equivalent C version below for clarity.
162 *
163 * On error, verify_area branches to a label indicated by parameter
164 * <error>. This implies that the macro falls through to the next
165 * instruction on success.
166 *
167 * Note that we assume success is the common case, and we optimize the
168 * branch fall-through case on success.
169 *
170 * On Entry:
171 * <aa> register containing memory address
172 * <as> register containing memory size
173 * <at> temp register
174 * <error> label to branch to on error; implies fall-through
175 * macro on success
176 * On Exit:
177 * <aa> preserved
178 * <as> preserved
179 * <at> destroyed
180 */
181 .macro verify_area aa, as, at, sp, error
182 access_ok \at, \aa, \as, \sp, \error
183 .endm
184
185
186#else /* __ASSEMBLY__ not defined */ 157#else /* __ASSEMBLY__ not defined */
187 158
188#include <linux/sched.h> 159#include <linux/sched.h>
@@ -211,11 +182,6 @@
211#define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size))) 182#define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size)))
212#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) 183#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size))
213 184
214static inline int verify_area(int type, const void * addr, unsigned long size)
215{
216 return access_ok(type,addr,size) ? 0 : -EFAULT;
217}
218
219/* 185/*
220 * These are the main single-value transfer routines. They 186 * These are the main single-value transfer routines. They
221 * automatically use the right size if we just have the right pointer 187 * automatically use the right size if we just have the right pointer
diff --git a/include/asm-xtensa/unistd.h b/include/asm-xtensa/unistd.h
index 6b39d6609d9c..5e1b99dc4ab3 100644
--- a/include/asm-xtensa/unistd.h
+++ b/include/asm-xtensa/unistd.h
@@ -11,8 +11,6 @@
11#ifndef _XTENSA_UNISTD_H 11#ifndef _XTENSA_UNISTD_H
12#define _XTENSA_UNISTD_H 12#define _XTENSA_UNISTD_H
13 13
14#include <linux/linkage.h>
15
16#define __NR_spill 0 14#define __NR_spill 0
17#define __NR_exit 1 15#define __NR_exit 1
18#define __NR_read 3 16#define __NR_read 3
@@ -221,21 +219,9 @@
221#define SYSXTENSA_COUNT 5 /* count of syscall0 functions*/ 219#define SYSXTENSA_COUNT 5 /* count of syscall0 functions*/
222 220
223#ifdef __KERNEL__ 221#ifdef __KERNEL__
224#define __syscall_return(type, res) return ((type)(res)) 222#include <linux/linkage.h>
225#else
226#define __syscall_return(type, res) \
227do { \
228 if ((unsigned long)(res) >= (unsigned long)(-125)) { \
229 /* Avoid using "res" which is declared to be in register r2; \
230 * errno might expand to a function call and clobber it. */ \
231 int __err = -(res); \
232 errno = __err; \
233 res = -1; \
234 } \
235 return (type) (res); \
236} while (0)
237#endif
238 223
224#define __syscall_return(type, res) return ((type)(res))
239 225
240/* Tensilica's xt-xcc compiler is much more agressive at code 226/* Tensilica's xt-xcc compiler is much more agressive at code
241 * optimization than gcc. Multiple __asm__ statements are 227 * optimization than gcc. Multiple __asm__ statements are
@@ -429,11 +415,10 @@ static __inline__ _syscall3(int,execve,const char*,file,char**,argv,char**,envp)
429 */ 415 */
430#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); 416#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
431 417
432#ifdef __KERNEL__
433#define __ARCH_WANT_STAT64 418#define __ARCH_WANT_STAT64
434#define __ARCH_WANT_SYS_UTIME 419#define __ARCH_WANT_SYS_UTIME
435#define __ARCH_WANT_SYS_LLSEEK 420#define __ARCH_WANT_SYS_LLSEEK
436#define __ARCH_WANT_SYS_RT_SIGACTION 421#define __ARCH_WANT_SYS_RT_SIGACTION
437#endif 422#endif /* __KERNEL__ */
438 423
439#endif /* _XTENSA_UNISTD_H */ 424#endif /* _XTENSA_UNISTD_H */
diff --git a/include/asm-xtensa/vga.h b/include/asm-xtensa/vga.h
index 23d82f6acb57..1fd8cab3a297 100644
--- a/include/asm-xtensa/vga.h
+++ b/include/asm-xtensa/vga.h
@@ -11,7 +11,7 @@
11#ifndef _XTENSA_VGA_H 11#ifndef _XTENSA_VGA_H
12#define _XTENSA_VGA_H 12#define _XTENSA_VGA_H
13 13
14#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) 14#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
15 15
16#define vga_readb(x) (*(x)) 16#define vga_readb(x) (*(x))
17#define vga_writeb(x,y) (*(y) = (x)) 17#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 9a66401073fc..3d54fbcf969e 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -16,7 +16,6 @@
16#define _LINUX_ACCT_H 16#define _LINUX_ACCT_H
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/jiffies.h>
20 19
21#include <asm/param.h> 20#include <asm/param.h>
22#include <asm/byteorder.h> 21#include <asm/byteorder.h>
@@ -116,7 +115,6 @@ struct acct_v3
116 115
117#ifdef __KERNEL__ 116#ifdef __KERNEL__
118 117
119#include <linux/config.h>
120 118
121#ifdef CONFIG_BSD_PROCESS_ACCT 119#ifdef CONFIG_BSD_PROCESS_ACCT
122struct vfsmount; 120struct vfsmount;
@@ -165,6 +163,7 @@ typedef struct acct acct_t;
165#endif /* __KERNEL */ 163#endif /* __KERNEL */
166 164
167#ifdef __KERNEL__ 165#ifdef __KERNEL__
166#include <linux/jiffies.h>
168/* 167/*
169 * Yet another set of HZ to *HZ helper functions. 168 * Yet another set of HZ to *HZ helper functions.
170 * See <linux/jiffies.h> for the original. 169 * See <linux/jiffies.h> for the original.
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index d3bc25e6d27d..90d6df1551ed 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -25,7 +25,6 @@
25#ifndef _LINUX_ACPI_H 25#ifndef _LINUX_ACPI_H
26#define _LINUX_ACPI_H 26#define _LINUX_ACPI_H
27 27
28#include <linux/config.h>
29 28
30#ifdef CONFIG_ACPI 29#ifdef CONFIG_ACPI
31 30
@@ -38,6 +37,7 @@
38#include <acpi/acpi.h> 37#include <acpi/acpi.h>
39#include <acpi/acpi_bus.h> 38#include <acpi/acpi_bus.h>
40#include <acpi/acpi_drivers.h> 39#include <acpi/acpi_drivers.h>
40#include <acpi/acpi_numa.h>
41#include <asm/acpi.h> 41#include <asm/acpi.h>
42 42
43 43
@@ -408,10 +408,18 @@ void acpi_table_print_madt_entry (acpi_table_entry_header *madt);
408void acpi_table_print_srat_entry (acpi_table_entry_header *srat); 408void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
409 409
410/* the following four functions are architecture-dependent */ 410/* the following four functions are architecture-dependent */
411#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
412#define NR_NODE_MEMBLKS MAX_NUMNODES
413#define acpi_numa_slit_init(slit) do {} while (0)
414#define acpi_numa_processor_affinity_init(pa) do {} while (0)
415#define acpi_numa_memory_affinity_init(ma) do {} while (0)
416#define acpi_numa_arch_fixup() do {} while (0)
417#else
411void acpi_numa_slit_init (struct acpi_table_slit *slit); 418void acpi_numa_slit_init (struct acpi_table_slit *slit);
412void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa); 419void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa);
413void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma); 420void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma);
414void acpi_numa_arch_fixup(void); 421void acpi_numa_arch_fixup(void);
422#endif
415 423
416#ifdef CONFIG_ACPI_HOTPLUG_CPU 424#ifdef CONFIG_ACPI_HOTPLUG_CPU
417/* Arch dependent functions for cpu hotplug support */ 425/* Arch dependent functions for cpu hotplug support */
diff --git a/include/linux/affs_hardblocks.h b/include/linux/affs_hardblocks.h
index 3fb869939d82..f1b948c1f592 100644
--- a/include/linux/affs_hardblocks.h
+++ b/include/linux/affs_hardblocks.h
@@ -1,45 +1,47 @@
1#ifndef AFFS_HARDBLOCKS_H 1#ifndef AFFS_HARDBLOCKS_H
2#define AFFS_HARDBLOCKS_H 2#define AFFS_HARDBLOCKS_H
3 3
4#include <linux/types.h>
5
4/* Just the needed definitions for the RDB of an Amiga HD. */ 6/* Just the needed definitions for the RDB of an Amiga HD. */
5 7
6struct RigidDiskBlock { 8struct RigidDiskBlock {
7 u32 rdb_ID; 9 __u32 rdb_ID;
8 __be32 rdb_SummedLongs; 10 __be32 rdb_SummedLongs;
9 s32 rdb_ChkSum; 11 __s32 rdb_ChkSum;
10 u32 rdb_HostID; 12 __u32 rdb_HostID;
11 __be32 rdb_BlockBytes; 13 __be32 rdb_BlockBytes;
12 u32 rdb_Flags; 14 __u32 rdb_Flags;
13 u32 rdb_BadBlockList; 15 __u32 rdb_BadBlockList;
14 __be32 rdb_PartitionList; 16 __be32 rdb_PartitionList;
15 u32 rdb_FileSysHeaderList; 17 __u32 rdb_FileSysHeaderList;
16 u32 rdb_DriveInit; 18 __u32 rdb_DriveInit;
17 u32 rdb_Reserved1[6]; 19 __u32 rdb_Reserved1[6];
18 u32 rdb_Cylinders; 20 __u32 rdb_Cylinders;
19 u32 rdb_Sectors; 21 __u32 rdb_Sectors;
20 u32 rdb_Heads; 22 __u32 rdb_Heads;
21 u32 rdb_Interleave; 23 __u32 rdb_Interleave;
22 u32 rdb_Park; 24 __u32 rdb_Park;
23 u32 rdb_Reserved2[3]; 25 __u32 rdb_Reserved2[3];
24 u32 rdb_WritePreComp; 26 __u32 rdb_WritePreComp;
25 u32 rdb_ReducedWrite; 27 __u32 rdb_ReducedWrite;
26 u32 rdb_StepRate; 28 __u32 rdb_StepRate;
27 u32 rdb_Reserved3[5]; 29 __u32 rdb_Reserved3[5];
28 u32 rdb_RDBBlocksLo; 30 __u32 rdb_RDBBlocksLo;
29 u32 rdb_RDBBlocksHi; 31 __u32 rdb_RDBBlocksHi;
30 u32 rdb_LoCylinder; 32 __u32 rdb_LoCylinder;
31 u32 rdb_HiCylinder; 33 __u32 rdb_HiCylinder;
32 u32 rdb_CylBlocks; 34 __u32 rdb_CylBlocks;
33 u32 rdb_AutoParkSeconds; 35 __u32 rdb_AutoParkSeconds;
34 u32 rdb_HighRDSKBlock; 36 __u32 rdb_HighRDSKBlock;
35 u32 rdb_Reserved4; 37 __u32 rdb_Reserved4;
36 char rdb_DiskVendor[8]; 38 char rdb_DiskVendor[8];
37 char rdb_DiskProduct[16]; 39 char rdb_DiskProduct[16];
38 char rdb_DiskRevision[4]; 40 char rdb_DiskRevision[4];
39 char rdb_ControllerVendor[8]; 41 char rdb_ControllerVendor[8];
40 char rdb_ControllerProduct[16]; 42 char rdb_ControllerProduct[16];
41 char rdb_ControllerRevision[4]; 43 char rdb_ControllerRevision[4];
42 u32 rdb_Reserved5[10]; 44 __u32 rdb_Reserved5[10];
43}; 45};
44 46
45#define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */ 47#define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */
@@ -47,16 +49,16 @@ struct RigidDiskBlock {
47struct PartitionBlock { 49struct PartitionBlock {
48 __be32 pb_ID; 50 __be32 pb_ID;
49 __be32 pb_SummedLongs; 51 __be32 pb_SummedLongs;
50 s32 pb_ChkSum; 52 __s32 pb_ChkSum;
51 u32 pb_HostID; 53 __u32 pb_HostID;
52 __be32 pb_Next; 54 __be32 pb_Next;
53 u32 pb_Flags; 55 __u32 pb_Flags;
54 u32 pb_Reserved1[2]; 56 __u32 pb_Reserved1[2];
55 u32 pb_DevFlags; 57 __u32 pb_DevFlags;
56 u8 pb_DriveName[32]; 58 __u8 pb_DriveName[32];
57 u32 pb_Reserved2[15]; 59 __u32 pb_Reserved2[15];
58 __be32 pb_Environment[17]; 60 __be32 pb_Environment[17];
59 u32 pb_EReserved[15]; 61 __u32 pb_EReserved[15];
60}; 62};
61 63
62#define IDNAME_PARTITION 0x50415254 /* "PART" */ 64#define IDNAME_PARTITION 0x50415254 /* "PART" */
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h
index 6d59c8efe3be..bfb8ec791b7b 100644
--- a/include/linux/agpgart.h
+++ b/include/linux/agpgart.h
@@ -27,8 +27,6 @@
27#ifndef _AGP_H 27#ifndef _AGP_H
28#define _AGP_H 1 28#define _AGP_H 1
29 29
30#include <linux/agp_backend.h>
31
32#define AGPIOC_BASE 'A' 30#define AGPIOC_BASE 'A'
33#define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*) 31#define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*)
34#define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1) 32#define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1)
@@ -112,6 +110,7 @@ typedef struct _agp_unbind {
112 110
113#else /* __KERNEL__ */ 111#else /* __KERNEL__ */
114#include <linux/mutex.h> 112#include <linux/mutex.h>
113#include <linux/agp_backend.h>
115 114
116#define AGPGART_MINOR 175 115#define AGPGART_MINOR 175
117 116
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h
index 9cf64b1b688b..29c0448265cf 100644
--- a/include/linux/amba/clcd.h
+++ b/include/linux/amba/clcd.h
@@ -9,7 +9,6 @@
9 * License. See the file COPYING in the main directory of this archive 9 * License. See the file COPYING in the main directory of this archive
10 * for more details. 10 * for more details.
11 */ 11 */
12#include <linux/config.h>
13#include <linux/fb.h> 12#include <linux/fb.h>
14 13
15/* 14/*
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 312a2c0c64e6..3671af869696 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -97,6 +97,9 @@ enum {
97 ATA_DRQ = (1 << 3), /* data request i/o */ 97 ATA_DRQ = (1 << 3), /* data request i/o */
98 ATA_ERR = (1 << 0), /* have an error */ 98 ATA_ERR = (1 << 0), /* have an error */
99 ATA_SRST = (1 << 2), /* software reset */ 99 ATA_SRST = (1 << 2), /* software reset */
100 ATA_ICRC = (1 << 7), /* interface CRC error */
101 ATA_UNC = (1 << 6), /* uncorrectable media error */
102 ATA_IDNF = (1 << 4), /* ID not found */
100 ATA_ABORTED = (1 << 2), /* command aborted */ 103 ATA_ABORTED = (1 << 2), /* command aborted */
101 104
102 /* ATA command block registers */ 105 /* ATA command block registers */
@@ -130,6 +133,8 @@ enum {
130 ATA_CMD_WRITE = 0xCA, 133 ATA_CMD_WRITE = 0xCA,
131 ATA_CMD_WRITE_EXT = 0x35, 134 ATA_CMD_WRITE_EXT = 0x35,
132 ATA_CMD_WRITE_FUA_EXT = 0x3D, 135 ATA_CMD_WRITE_FUA_EXT = 0x3D,
136 ATA_CMD_FPDMA_READ = 0x60,
137 ATA_CMD_FPDMA_WRITE = 0x61,
133 ATA_CMD_PIO_READ = 0x20, 138 ATA_CMD_PIO_READ = 0x20,
134 ATA_CMD_PIO_READ_EXT = 0x24, 139 ATA_CMD_PIO_READ_EXT = 0x24,
135 ATA_CMD_PIO_WRITE = 0x30, 140 ATA_CMD_PIO_WRITE = 0x30,
@@ -148,6 +153,10 @@ enum {
148 ATA_CMD_INIT_DEV_PARAMS = 0x91, 153 ATA_CMD_INIT_DEV_PARAMS = 0x91,
149 ATA_CMD_READ_NATIVE_MAX = 0xF8, 154 ATA_CMD_READ_NATIVE_MAX = 0xF8,
150 ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, 155 ATA_CMD_READ_NATIVE_MAX_EXT = 0x27,
156 ATA_CMD_READ_LOG_EXT = 0x2f,
157
158 /* READ_LOG_EXT pages */
159 ATA_LOG_SATA_NCQ = 0x10,
151 160
152 /* SETFEATURES stuff */ 161 /* SETFEATURES stuff */
153 SETFEATURES_XFER = 0x03, 162 SETFEATURES_XFER = 0x03,
@@ -172,6 +181,9 @@ enum {
172 XFER_PIO_0 = 0x08, 181 XFER_PIO_0 = 0x08,
173 XFER_PIO_SLOW = 0x00, 182 XFER_PIO_SLOW = 0x00,
174 183
184 SETFEATURES_WC_ON = 0x02, /* Enable write cache */
185 SETFEATURES_WC_OFF = 0x82, /* Disable write cache */
186
175 /* ATAPI stuff */ 187 /* ATAPI stuff */
176 ATAPI_PKT_DMA = (1 << 0), 188 ATAPI_PKT_DMA = (1 << 0),
177 ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: 189 ATAPI_DMADIR = (1 << 2), /* ATAPI data dir:
@@ -192,6 +204,16 @@ enum {
192 SCR_ACTIVE = 3, 204 SCR_ACTIVE = 3,
193 SCR_NOTIFICATION = 4, 205 SCR_NOTIFICATION = 4,
194 206
207 /* SError bits */
208 SERR_DATA_RECOVERED = (1 << 0), /* recovered data error */
209 SERR_COMM_RECOVERED = (1 << 1), /* recovered comm failure */
210 SERR_DATA = (1 << 8), /* unrecovered data error */
211 SERR_PERSISTENT = (1 << 9), /* persistent data/comm error */
212 SERR_PROTOCOL = (1 << 10), /* protocol violation */
213 SERR_INTERNAL = (1 << 11), /* host internal error */
214 SERR_PHYRDY_CHG = (1 << 16), /* PHY RDY changed */
215 SERR_DEV_XCHG = (1 << 26), /* device exchanged */
216
195 /* struct ata_taskfile flags */ 217 /* struct ata_taskfile flags */
196 ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */ 218 ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */
197 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ 219 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
@@ -199,6 +221,7 @@ enum {
199 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ 221 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
200 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ 222 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
201 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */ 223 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
224 ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
202}; 225};
203 226
204enum ata_tf_protocols { 227enum ata_tf_protocols {
@@ -207,6 +230,7 @@ enum ata_tf_protocols {
207 ATA_PROT_NODATA, /* no data */ 230 ATA_PROT_NODATA, /* no data */
208 ATA_PROT_PIO, /* PIO single sector */ 231 ATA_PROT_PIO, /* PIO single sector */
209 ATA_PROT_DMA, /* DMA */ 232 ATA_PROT_DMA, /* DMA */
233 ATA_PROT_NCQ, /* NCQ */
210 ATA_PROT_ATAPI, /* packet command, PIO data xfer*/ 234 ATA_PROT_ATAPI, /* packet command, PIO data xfer*/
211 ATA_PROT_ATAPI_NODATA, /* packet command, no data */ 235 ATA_PROT_ATAPI_NODATA, /* packet command, no data */
212 ATA_PROT_ATAPI_DMA, /* packet command with special DMA sauce */ 236 ATA_PROT_ATAPI_DMA, /* packet command with special DMA sauce */
@@ -262,6 +286,8 @@ struct ata_taskfile {
262#define ata_id_has_pm(id) ((id)[82] & (1 << 3)) 286#define ata_id_has_pm(id) ((id)[82] & (1 << 3))
263#define ata_id_has_lba(id) ((id)[49] & (1 << 9)) 287#define ata_id_has_lba(id) ((id)[49] & (1 << 9))
264#define ata_id_has_dma(id) ((id)[49] & (1 << 8)) 288#define ata_id_has_dma(id) ((id)[49] & (1 << 8))
289#define ata_id_has_ncq(id) ((id)[76] & (1 << 8))
290#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1)
265#define ata_id_removeable(id) ((id)[0] & (1 << 7)) 291#define ata_id_removeable(id) ((id)[0] & (1 << 7))
266#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) 292#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0))
267#define ata_id_u32(id,n) \ 293#define ata_id_u32(id,n) \
@@ -272,6 +298,8 @@ struct ata_taskfile {
272 ((u64) (id)[(n) + 1] << 16) | \ 298 ((u64) (id)[(n) + 1] << 16) | \
273 ((u64) (id)[(n) + 0]) ) 299 ((u64) (id)[(n) + 0]) )
274 300
301#define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20)
302
275static inline unsigned int ata_id_major_version(const u16 *id) 303static inline unsigned int ata_id_major_version(const u16 *id)
276{ 304{
277 unsigned int mver; 305 unsigned int mver;
@@ -311,6 +339,15 @@ static inline int is_atapi_taskfile(const struct ata_taskfile *tf)
311 (tf->protocol == ATA_PROT_ATAPI_DMA); 339 (tf->protocol == ATA_PROT_ATAPI_DMA);
312} 340}
313 341
342static inline int is_multi_taskfile(struct ata_taskfile *tf)
343{
344 return (tf->command == ATA_CMD_READ_MULTI) ||
345 (tf->command == ATA_CMD_WRITE_MULTI) ||
346 (tf->command == ATA_CMD_READ_MULTI_EXT) ||
347 (tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
348 (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
349}
350
314static inline int ata_ok(u8 status) 351static inline int ata_ok(u8 status)
315{ 352{
316 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) 353 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index b203ea82a0a8..1eb238affb12 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -209,7 +209,6 @@ struct atm_cirange {
209 209
210#ifdef __KERNEL__ 210#ifdef __KERNEL__
211 211
212#include <linux/config.h>
213#include <linux/wait.h> /* wait_queue_head_t */ 212#include <linux/wait.h> /* wait_queue_head_t */
214#include <linux/time.h> /* struct timeval */ 213#include <linux/time.h> /* struct timeval */
215#include <linux/net.h> 214#include <linux/net.h>
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b74c148f14e3..e051ff9c5b50 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -24,8 +24,7 @@
24#ifndef _LINUX_AUDIT_H_ 24#ifndef _LINUX_AUDIT_H_
25#define _LINUX_AUDIT_H_ 25#define _LINUX_AUDIT_H_
26 26
27#include <linux/sched.h> 27#include <linux/elf-em.h>
28#include <linux/elf.h>
29 28
30/* The netlink messages for the audit system is divided into blocks: 29/* The netlink messages for the audit system is divided into blocks:
31 * 1000 - 1099 are for commanding the audit system 30 * 1000 - 1099 are for commanding the audit system
@@ -83,7 +82,12 @@
83#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */ 82#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */
84#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */ 83#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */
85#define AUDIT_CWD 1307 /* Current working directory */ 84#define AUDIT_CWD 1307 /* Current working directory */
85#define AUDIT_EXECVE 1309 /* execve arguments */
86#define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */ 86#define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */
87#define AUDIT_MQ_OPEN 1312 /* POSIX MQ open record type */
88#define AUDIT_MQ_SENDRECV 1313 /* POSIX MQ send/receive record type */
89#define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */
90#define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */
87 91
88#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 92#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
89#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ 93#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
@@ -151,6 +155,7 @@
151#define AUDIT_SE_TYPE 15 /* security label type */ 155#define AUDIT_SE_TYPE 15 /* security label type */
152#define AUDIT_SE_SEN 16 /* security label sensitivity label */ 156#define AUDIT_SE_SEN 16 /* security label sensitivity label */
153#define AUDIT_SE_CLR 17 /* security label clearance label */ 157#define AUDIT_SE_CLR 17 /* security label clearance label */
158#define AUDIT_PPID 18
154 159
155 /* These are ONLY useful when checking 160 /* These are ONLY useful when checking
156 * at syscall exit time (AUDIT_AT_EXIT). */ 161 * at syscall exit time (AUDIT_AT_EXIT). */
@@ -159,6 +164,7 @@
159#define AUDIT_INODE 102 164#define AUDIT_INODE 102
160#define AUDIT_EXIT 103 165#define AUDIT_EXIT 103
161#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */ 166#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */
167#define AUDIT_WATCH 105
162 168
163#define AUDIT_ARG0 200 169#define AUDIT_ARG0 200
164#define AUDIT_ARG1 (AUDIT_ARG0+1) 170#define AUDIT_ARG1 (AUDIT_ARG0+1)
@@ -273,16 +279,21 @@ struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */
273}; 279};
274 280
275#ifdef __KERNEL__ 281#ifdef __KERNEL__
282#include <linux/sched.h>
276 283
277struct audit_sig_info { 284struct audit_sig_info {
278 uid_t uid; 285 uid_t uid;
279 pid_t pid; 286 pid_t pid;
287 char ctx[0];
280}; 288};
281 289
282struct audit_buffer; 290struct audit_buffer;
283struct audit_context; 291struct audit_context;
284struct inode; 292struct inode;
285struct netlink_skb_parms; 293struct netlink_skb_parms;
294struct linux_binprm;
295struct mq_attr;
296struct mqstat;
286 297
287#define AUDITSC_INVALID 0 298#define AUDITSC_INVALID 0
288#define AUDITSC_SUCCESS 1 299#define AUDITSC_SUCCESS 1
@@ -297,15 +308,19 @@ extern void audit_syscall_entry(int arch,
297 int major, unsigned long a0, unsigned long a1, 308 int major, unsigned long a0, unsigned long a1,
298 unsigned long a2, unsigned long a3); 309 unsigned long a2, unsigned long a3);
299extern void audit_syscall_exit(int failed, long return_code); 310extern void audit_syscall_exit(int failed, long return_code);
300extern void audit_getname(const char *name); 311extern void __audit_getname(const char *name);
301extern void audit_putname(const char *name); 312extern void audit_putname(const char *name);
302extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags); 313extern void __audit_inode(const char *name, const struct inode *inode);
303extern void __audit_inode_child(const char *dname, const struct inode *inode, 314extern void __audit_inode_child(const char *dname, const struct inode *inode,
304 unsigned long pino); 315 unsigned long pino);
305static inline void audit_inode(const char *name, const struct inode *inode, 316static inline void audit_getname(const char *name)
306 unsigned flags) { 317{
307 if (unlikely(current->audit_context)) 318 if (unlikely(current->audit_context))
308 __audit_inode(name, inode, flags); 319 __audit_getname(name);
320}
321static inline void audit_inode(const char *name, const struct inode *inode) {
322 if (unlikely(current->audit_context))
323 __audit_inode(name, inode);
309} 324}
310static inline void audit_inode_child(const char *dname, 325static inline void audit_inode_child(const char *dname,
311 const struct inode *inode, 326 const struct inode *inode,
@@ -320,13 +335,61 @@ extern void auditsc_get_stamp(struct audit_context *ctx,
320 struct timespec *t, unsigned int *serial); 335 struct timespec *t, unsigned int *serial);
321extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); 336extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid);
322extern uid_t audit_get_loginuid(struct audit_context *ctx); 337extern uid_t audit_get_loginuid(struct audit_context *ctx);
323extern int audit_ipc_obj(struct kern_ipc_perm *ipcp); 338extern int __audit_ipc_obj(struct kern_ipc_perm *ipcp);
324extern int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp); 339extern int __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode);
340extern int audit_bprm(struct linux_binprm *bprm);
325extern int audit_socketcall(int nargs, unsigned long *args); 341extern int audit_socketcall(int nargs, unsigned long *args);
326extern int audit_sockaddr(int len, void *addr); 342extern int audit_sockaddr(int len, void *addr);
327extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); 343extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt);
328extern void audit_signal_info(int sig, struct task_struct *t);
329extern int audit_set_macxattr(const char *name); 344extern int audit_set_macxattr(const char *name);
345extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr);
346extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout);
347extern int __audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout);
348extern int __audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification);
349extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
350
351static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp)
352{
353 if (unlikely(current->audit_context))
354 return __audit_ipc_obj(ipcp);
355 return 0;
356}
357static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode)
358{
359 if (unlikely(current->audit_context))
360 return __audit_ipc_set_perm(qbytes, uid, gid, mode);
361 return 0;
362}
363static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr)
364{
365 if (unlikely(current->audit_context))
366 return __audit_mq_open(oflag, mode, u_attr);
367 return 0;
368}
369static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout)
370{
371 if (unlikely(current->audit_context))
372 return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout);
373 return 0;
374}
375static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout)
376{
377 if (unlikely(current->audit_context))
378 return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout);
379 return 0;
380}
381static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification)
382{
383 if (unlikely(current->audit_context))
384 return __audit_mq_notify(mqdes, u_notification);
385 return 0;
386}
387static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
388{
389 if (unlikely(current->audit_context))
390 return __audit_mq_getsetattr(mqdes, mqstat);
391 return 0;
392}
330#else 393#else
331#define audit_alloc(t) ({ 0; }) 394#define audit_alloc(t) ({ 0; })
332#define audit_free(t) do { ; } while (0) 395#define audit_free(t) do { ; } while (0)
@@ -334,19 +397,24 @@ extern int audit_set_macxattr(const char *name);
334#define audit_syscall_exit(f,r) do { ; } while (0) 397#define audit_syscall_exit(f,r) do { ; } while (0)
335#define audit_getname(n) do { ; } while (0) 398#define audit_getname(n) do { ; } while (0)
336#define audit_putname(n) do { ; } while (0) 399#define audit_putname(n) do { ; } while (0)
337#define __audit_inode(n,i,f) do { ; } while (0) 400#define __audit_inode(n,i) do { ; } while (0)
338#define __audit_inode_child(d,i,p) do { ; } while (0) 401#define __audit_inode_child(d,i,p) do { ; } while (0)
339#define audit_inode(n,i,f) do { ; } while (0) 402#define audit_inode(n,i) do { ; } while (0)
340#define audit_inode_child(d,i,p) do { ; } while (0) 403#define audit_inode_child(d,i,p) do { ; } while (0)
341#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) 404#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)
342#define audit_get_loginuid(c) ({ -1; }) 405#define audit_get_loginuid(c) ({ -1; })
343#define audit_ipc_obj(i) ({ 0; }) 406#define audit_ipc_obj(i) ({ 0; })
344#define audit_ipc_set_perm(q,u,g,m,i) ({ 0; }) 407#define audit_ipc_set_perm(q,u,g,m) ({ 0; })
408#define audit_bprm(p) ({ 0; })
345#define audit_socketcall(n,a) ({ 0; }) 409#define audit_socketcall(n,a) ({ 0; })
346#define audit_sockaddr(len, addr) ({ 0; }) 410#define audit_sockaddr(len, addr) ({ 0; })
347#define audit_avc_path(dentry, mnt) ({ 0; }) 411#define audit_avc_path(dentry, mnt) ({ 0; })
348#define audit_signal_info(s,t) do { ; } while (0)
349#define audit_set_macxattr(n) do { ; } while (0) 412#define audit_set_macxattr(n) do { ; } while (0)
413#define audit_mq_open(o,m,a) ({ 0; })
414#define audit_mq_timedsend(d,l,p,t) ({ 0; })
415#define audit_mq_timedreceive(d,l,p,t) ({ 0; })
416#define audit_mq_notify(d,n) ({ 0; })
417#define audit_mq_getsetattr(d,s) ({ 0; })
350#endif 418#endif
351 419
352#ifdef CONFIG_AUDIT 420#ifdef CONFIG_AUDIT
@@ -364,8 +432,11 @@ extern void audit_log_end(struct audit_buffer *ab);
364extern void audit_log_hex(struct audit_buffer *ab, 432extern void audit_log_hex(struct audit_buffer *ab,
365 const unsigned char *buf, 433 const unsigned char *buf,
366 size_t len); 434 size_t len);
367extern void audit_log_untrustedstring(struct audit_buffer *ab, 435extern const char * audit_log_untrustedstring(struct audit_buffer *ab,
368 const char *string); 436 const char *string);
437extern const char * audit_log_n_untrustedstring(struct audit_buffer *ab,
438 size_t n,
439 const char *string);
369extern void audit_log_d_path(struct audit_buffer *ab, 440extern void audit_log_d_path(struct audit_buffer *ab,
370 const char *prefix, 441 const char *prefix,
371 struct dentry *dentry, 442 struct dentry *dentry,
@@ -383,8 +454,8 @@ extern int audit_receive_filter(int type, int pid, int uid, int seq,
383#define audit_log_end(b) do { ; } while (0) 454#define audit_log_end(b) do { ; } while (0)
384#define audit_log_hex(a,b,l) do { ; } while (0) 455#define audit_log_hex(a,b,l) do { ; } while (0)
385#define audit_log_untrustedstring(a,s) do { ; } while (0) 456#define audit_log_untrustedstring(a,s) do { ; } while (0)
457#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0)
386#define audit_log_d_path(b,p,d,v) do { ; } while (0) 458#define audit_log_d_path(b,p,d,v) do { ; } while (0)
387#define audit_panic(m) do { ; } while (0)
388#endif 459#endif
389#endif 460#endif
390#endif 461#endif
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 59e1259b1c40..aafe82788b4e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_BLKDEV_H 1#ifndef _LINUX_BLKDEV_H
2#define _LINUX_BLKDEV_H 2#define _LINUX_BLKDEV_H
3 3
4#include <linux/config.h>
5#include <linux/major.h> 4#include <linux/major.h>
6#include <linux/genhd.h> 5#include <linux/genhd.h>
7#include <linux/list.h> 6#include <linux/list.h>
@@ -152,11 +151,9 @@ struct request {
152 void *elevator_private; 151 void *elevator_private;
153 void *completion_data; 152 void *completion_data;
154 153
155 unsigned short ioprio;
156
157 int rq_status; /* should split this into a few status bits */ 154 int rq_status; /* should split this into a few status bits */
158 struct gendisk *rq_disk;
159 int errors; 155 int errors;
156 struct gendisk *rq_disk;
160 unsigned long start_time; 157 unsigned long start_time;
161 158
162 /* Number of scatter-gather DMA addr+len pairs after 159 /* Number of scatter-gather DMA addr+len pairs after
@@ -171,8 +168,9 @@ struct request {
171 */ 168 */
172 unsigned short nr_hw_segments; 169 unsigned short nr_hw_segments;
173 170
171 unsigned short ioprio;
172
174 int tag; 173 int tag;
175 char *buffer;
176 174
177 int ref_count; 175 int ref_count;
178 request_queue_t *q; 176 request_queue_t *q;
@@ -180,6 +178,7 @@ struct request {
180 178
181 struct completion *waiting; 179 struct completion *waiting;
182 void *special; 180 void *special;
181 char *buffer;
183 182
184 /* 183 /*
185 * when request is used as a packet command carrier 184 * when request is used as a packet command carrier
@@ -188,20 +187,14 @@ struct request {
188 unsigned char cmd[BLK_MAX_CDB]; 187 unsigned char cmd[BLK_MAX_CDB];
189 188
190 unsigned int data_len; 189 unsigned int data_len;
191 void *data;
192
193 unsigned int sense_len; 190 unsigned int sense_len;
191 void *data;
194 void *sense; 192 void *sense;
195 193
196 unsigned int timeout; 194 unsigned int timeout;
197 int retries; 195 int retries;
198 196
199 /* 197 /*
200 * For Power Management requests
201 */
202 struct request_pm_state *pm;
203
204 /*
205 * completion callback. end_io_data should be folded in with waiting 198 * completion callback. end_io_data should be folded in with waiting
206 */ 199 */
207 rq_end_io_fn *end_io; 200 rq_end_io_fn *end_io;
@@ -242,6 +235,7 @@ enum rq_flag_bits {
242 __REQ_PM_RESUME, /* resume request */ 235 __REQ_PM_RESUME, /* resume request */
243 __REQ_PM_SHUTDOWN, /* shutdown request */ 236 __REQ_PM_SHUTDOWN, /* shutdown request */
244 __REQ_ORDERED_COLOR, /* is before or after barrier */ 237 __REQ_ORDERED_COLOR, /* is before or after barrier */
238 __REQ_RW_SYNC, /* request is sync (O_DIRECT) */
245 __REQ_NR_BITS, /* stops here */ 239 __REQ_NR_BITS, /* stops here */
246}; 240};
247 241
@@ -271,6 +265,7 @@ enum rq_flag_bits {
271#define REQ_PM_RESUME (1 << __REQ_PM_RESUME) 265#define REQ_PM_RESUME (1 << __REQ_PM_RESUME)
272#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN) 266#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN)
273#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) 267#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
268#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
274 269
275/* 270/*
276 * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME 271 * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME
@@ -439,9 +434,6 @@ struct request_queue
439 434
440#define RQ_INACTIVE (-1) 435#define RQ_INACTIVE (-1)
441#define RQ_ACTIVE 1 436#define RQ_ACTIVE 1
442#define RQ_SCSI_BUSY 0xffff
443#define RQ_SCSI_DONE 0xfffe
444#define RQ_SCSI_DISCONNECTING 0xffe0
445 437
446#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 438#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
447#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ 439#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
diff --git a/include/linux/blkpg.h b/include/linux/blkpg.h
index be5d0f4ad24c..faf8a45af210 100644
--- a/include/linux/blkpg.h
+++ b/include/linux/blkpg.h
@@ -24,6 +24,7 @@
24 * 24 *
25 * For today, only the partition stuff - aeb, 990515 25 * For today, only the partition stuff - aeb, 990515
26 */ 26 */
27#include <linux/compiler.h>
27#include <linux/ioctl.h> 28#include <linux/ioctl.h>
28 29
29#define BLKPG _IO(0x12,105) 30#define BLKPG _IO(0x12,105)
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index b34d3e73d5ea..a7e8cef73d15 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -1,7 +1,6 @@
1#ifndef BLKTRACE_H 1#ifndef BLKTRACE_H
2#define BLKTRACE_H 2#define BLKTRACE_H
3 3
4#include <linux/config.h>
5#include <linux/blkdev.h> 4#include <linux/blkdev.h>
6#include <linux/relay.h> 5#include <linux/relay.h>
7 6
@@ -91,9 +90,9 @@ struct blk_io_trace {
91 * The remap event 90 * The remap event
92 */ 91 */
93struct blk_io_trace_remap { 92struct blk_io_trace_remap {
94 u32 device; 93 __be32 device;
95 u32 __pad; 94 u32 __pad;
96 u64 sector; 95 __be64 sector;
97}; 96};
98 97
99enum { 98enum {
@@ -225,7 +224,7 @@ static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what,
225 struct bio *bio, unsigned int pdu) 224 struct bio *bio, unsigned int pdu)
226{ 225{
227 struct blk_trace *bt = q->blk_trace; 226 struct blk_trace *bt = q->blk_trace;
228 u64 rpdu = cpu_to_be64(pdu); 227 __be64 rpdu = cpu_to_be64(pdu);
229 228
230 if (likely(!bt)) 229 if (likely(!bt))
231 return; 230 return;
diff --git a/include/linux/blockgroup_lock.h b/include/linux/blockgroup_lock.h
index 0137ee5dd43c..8607312983bd 100644
--- a/include/linux/blockgroup_lock.h
+++ b/include/linux/blockgroup_lock.h
@@ -6,7 +6,6 @@
6 * Simple hashed spinlocking. 6 * Simple hashed spinlocking.
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/spinlock.h> 9#include <linux/spinlock.h>
11#include <linux/cache.h> 10#include <linux/cache.h>
12 11
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index da2d107fe2cf..22866fa2d960 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -91,8 +91,8 @@ static inline void *alloc_remap(int nid, unsigned long size)
91} 91}
92#endif 92#endif
93 93
94extern unsigned long __initdata nr_kernel_pages; 94extern unsigned long nr_kernel_pages;
95extern unsigned long __initdata nr_all_pages; 95extern unsigned long nr_all_pages;
96 96
97extern void *__init alloc_large_system_hash(const char *tablename, 97extern void *__init alloc_large_system_hash(const char *tablename,
98 unsigned long bucketsize, 98 unsigned long bucketsize,
diff --git a/include/linux/cache.h b/include/linux/cache.h
index cc4b3aafad9a..4552504c0228 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -2,7 +2,6 @@
2#define __LINUX_CACHE_H 2#define __LINUX_CACHE_H
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/config.h>
6#include <asm/cache.h> 5#include <asm/cache.h>
7 6
8#ifndef L1_CACHE_ALIGN 7#ifndef L1_CACHE_ALIGN
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
index 1417de935057..dbb7769009be 100644
--- a/include/linux/cn_proc.h
+++ b/include/linux/cn_proc.h
@@ -3,31 +3,22 @@
3 * 3 *
4 * Copyright (C) Matt Helsley, IBM Corp. 2005 4 * Copyright (C) Matt Helsley, IBM Corp. 2005
5 * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin 5 * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin
6 * Original copyright notice follows:
7 * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com> 6 * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com>
8 * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net> 7 * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net>
9 * 8 *
10 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify it
11 * it under the terms of the GNU General Public License as published by 10 * under the terms of version 2.1 of the GNU Lesser General Public License
12 * the Free Software Foundation; either version 2 of the License, or 11 * as published by the Free Software Foundation.
13 * (at your option) any later version.
14 * 12 *
15 * This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it would be useful, but
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */ 16 */
24 17
25#ifndef CN_PROC_H 18#ifndef CN_PROC_H
26#define CN_PROC_H 19#define CN_PROC_H
27 20
28#include <linux/types.h> 21#include <linux/types.h>
29#include <linux/time.h>
30#include <linux/connector.h>
31 22
32/* 23/*
33 * Userspace sends this enum to register with the kernel that it is listening 24 * Userspace sends this enum to register with the kernel that it is listening
diff --git a/include/linux/coda.h b/include/linux/coda.h
index bbc5afcd7db6..b5cf0780c51a 100644
--- a/include/linux/coda.h
+++ b/include/linux/coda.h
@@ -59,7 +59,6 @@ Mellon the rights to redistribute these changes without encumbrance.
59#ifndef _CODA_HEADER_ 59#ifndef _CODA_HEADER_
60#define _CODA_HEADER_ 60#define _CODA_HEADER_
61 61
62#include <linux/config.h>
63 62
64/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */ 63/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
65#if defined(__NetBSD__) || \ 64#if defined(__NetBSD__) || \
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index b3ecf8f71d97..7b5c5df5cb69 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -36,7 +36,7 @@ extern const struct file_operations coda_ioctl_operations;
36 36
37/* operations shared over more than one file */ 37/* operations shared over more than one file */
38int coda_open(struct inode *i, struct file *f); 38int coda_open(struct inode *i, struct file *f);
39int coda_flush(struct file *f); 39int coda_flush(struct file *f, fl_owner_t id);
40int coda_release(struct inode *i, struct file *f); 40int coda_release(struct inode *i, struct file *f);
41int coda_permission(struct inode *inode, int mask, struct nameidata *nd); 41int coda_permission(struct inode *inode, int mask, struct nameidata *nd);
42int coda_revalidate_inode(struct dentry *); 42int coda_revalidate_inode(struct dentry *);
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index d539262a8f89..98f6c52c152b 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -70,7 +70,7 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
70 unsigned int cmd, struct PioctlData *data); 70 unsigned int cmd, struct PioctlData *data);
71int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); 71int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
72int venus_fsync(struct super_block *sb, struct CodaFid *fid); 72int venus_fsync(struct super_block *sb, struct CodaFid *fid);
73int venus_statfs(struct super_block *sb, struct kstatfs *sfs); 73int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
74 74
75 75
76/* messages between coda filesystem in kernel and Venus */ 76/* messages between coda filesystem in kernel and Venus */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 6d3a654be1ae..dda1697ec753 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -4,7 +4,6 @@
4 * These are the type definitions for the architecture specific 4 * These are the type definitions for the architecture specific
5 * syscall compatibility layer. 5 * syscall compatibility layer.
6 */ 6 */
7#include <linux/config.h>
8 7
9#ifdef CONFIG_COMPAT 8#ifdef CONFIG_COMPAT
10 9
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index f23d3c6fc2c0..9b4f11094937 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -78,6 +78,7 @@ extern void __chk_io_ptr(void __iomem *);
78 78
79#endif /* __ASSEMBLY__ */ 79#endif /* __ASSEMBLY__ */
80 80
81#ifdef __KERNEL__
81/* 82/*
82 * Allow us to mark functions as 'deprecated' and have gcc emit a nice 83 * Allow us to mark functions as 'deprecated' and have gcc emit a nice
83 * warning for each use, in hopes of speeding the functions removal. 84 * warning for each use, in hopes of speeding the functions removal.
@@ -127,6 +128,16 @@ extern void __chk_io_ptr(void __iomem *);
127# define __attribute_pure__ /* unimplemented */ 128# define __attribute_pure__ /* unimplemented */
128#endif 129#endif
129 130
131#ifndef noinline
132#define noinline
133#endif
134
135#ifndef __always_inline
136#define __always_inline inline
137#endif
138
139#endif /* __KERNEL__ */
140
130/* 141/*
131 * From the GCC manual: 142 * From the GCC manual:
132 * 143 *
@@ -145,12 +156,4 @@ extern void __chk_io_ptr(void __iomem *);
145# define __attribute_const__ /* unimplemented */ 156# define __attribute_const__ /* unimplemented */
146#endif 157#endif
147 158
148#ifndef noinline
149#define noinline
150#endif
151
152#ifndef __always_inline
153#define __always_inline inline
154#endif
155
156#endif /* __LINUX_COMPILER_H */ 159#endif /* __LINUX_COMPILER_H */
diff --git a/include/linux/connector.h b/include/linux/connector.h
index ad1a22c1c42e..4c02119c6ab9 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -34,8 +34,11 @@
34#define CN_VAL_PROC 0x1 34#define CN_VAL_PROC 0x1
35#define CN_IDX_CIFS 0x2 35#define CN_IDX_CIFS 0x2
36#define CN_VAL_CIFS 0x1 36#define CN_VAL_CIFS 0x1
37#define CN_W1_IDX 0x3 /* w1 communication */
38#define CN_W1_VAL 0x1
37 39
38#define CN_NETLINK_USERS 1 40
41#define CN_NETLINK_USERS 4
39 42
40/* 43/*
41 * Maximum connector's message size. 44 * Maximum connector's message size.
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 17866d7e2b71..466fbe9e4899 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -15,7 +15,6 @@
15#define _LINUX_CPUFREQ_H 15#define _LINUX_CPUFREQ_H
16 16
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/config.h>
19#include <linux/notifier.h> 18#include <linux/notifier.h>
20#include <linux/threads.h> 19#include <linux/threads.h>
21#include <linux/device.h> 20#include <linux/device.h>
@@ -73,6 +72,8 @@ struct cpufreq_real_policy {
73 72
74struct cpufreq_policy { 73struct cpufreq_policy {
75 cpumask_t cpus; /* affected CPUs */ 74 cpumask_t cpus; /* affected CPUs */
75 unsigned int shared_type; /* ANY or ALL affected CPUs
76 should set cpufreq */
76 unsigned int cpu; /* cpu nr of registered CPU */ 77 unsigned int cpu; /* cpu nr of registered CPU */
77 struct cpufreq_cpuinfo cpuinfo;/* see above */ 78 struct cpufreq_cpuinfo cpuinfo;/* see above */
78 79
@@ -99,6 +100,8 @@ struct cpufreq_policy {
99#define CPUFREQ_INCOMPATIBLE (1) 100#define CPUFREQ_INCOMPATIBLE (1)
100#define CPUFREQ_NOTIFY (2) 101#define CPUFREQ_NOTIFY (2)
101 102
103#define CPUFREQ_SHARED_TYPE_ALL (0) /* All dependent CPUs should set freq */
104#define CPUFREQ_SHARED_TYPE_ANY (1) /* Freq can be set from any dependent CPU */
102 105
103/******************** cpufreq transition notifiers *******************/ 106/******************** cpufreq transition notifiers *******************/
104 107
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h
index a8948f34b776..a41f38428c37 100644
--- a/include/linux/cramfs_fs.h
+++ b/include/linux/cramfs_fs.h
@@ -1,13 +1,7 @@
1#ifndef __CRAMFS_H 1#ifndef __CRAMFS_H
2#define __CRAMFS_H 2#define __CRAMFS_H
3 3
4#ifndef __KERNEL__ 4#include <linux/types.h>
5
6typedef unsigned char u8;
7typedef unsigned short u16;
8typedef unsigned int u32;
9
10#endif
11 5
12#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */ 6#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
13#define CRAMFS_SIGNATURE "Compressed ROMFS" 7#define CRAMFS_SIGNATURE "Compressed ROMFS"
@@ -33,9 +27,9 @@ typedef unsigned int u32;
33 * Reasonably terse representation of the inode data. 27 * Reasonably terse representation of the inode data.
34 */ 28 */
35struct cramfs_inode { 29struct cramfs_inode {
36 u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH; 30 __u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH;
37 /* SIZE for device files is i_rdev */ 31 /* SIZE for device files is i_rdev */
38 u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH; 32 __u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH;
39 /* NAMELEN is the length of the file name, divided by 4 and 33 /* NAMELEN is the length of the file name, divided by 4 and
40 rounded up. (cramfs doesn't support hard links.) */ 34 rounded up. (cramfs doesn't support hard links.) */
41 /* OFFSET: For symlinks and non-empty regular files, this 35 /* OFFSET: For symlinks and non-empty regular files, this
@@ -44,27 +38,27 @@ struct cramfs_inode {
44 see README). For non-empty directories it is the offset 38 see README). For non-empty directories it is the offset
45 (divided by 4) of the inode of the first file in that 39 (divided by 4) of the inode of the first file in that
46 directory. For anything else, offset is zero. */ 40 directory. For anything else, offset is zero. */
47 u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH; 41 __u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH;
48}; 42};
49 43
50struct cramfs_info { 44struct cramfs_info {
51 u32 crc; 45 __u32 crc;
52 u32 edition; 46 __u32 edition;
53 u32 blocks; 47 __u32 blocks;
54 u32 files; 48 __u32 files;
55}; 49};
56 50
57/* 51/*
58 * Superblock information at the beginning of the FS. 52 * Superblock information at the beginning of the FS.
59 */ 53 */
60struct cramfs_super { 54struct cramfs_super {
61 u32 magic; /* 0x28cd3d45 - random number */ 55 __u32 magic; /* 0x28cd3d45 - random number */
62 u32 size; /* length in bytes */ 56 __u32 size; /* length in bytes */
63 u32 flags; /* feature flags */ 57 __u32 flags; /* feature flags */
64 u32 future; /* reserved for future use */ 58 __u32 future; /* reserved for future use */
65 u8 signature[16]; /* "Compressed ROMFS" */ 59 __u8 signature[16]; /* "Compressed ROMFS" */
66 struct cramfs_info fsid; /* unique filesystem info */ 60 struct cramfs_info fsid; /* unique filesystem info */
67 u8 name[16]; /* user-defined name */ 61 __u8 name[16]; /* user-defined name */
68 struct cramfs_inode root; /* root inode data */ 62 struct cramfs_inode root; /* root inode data */
69}; 63};
70 64
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 0ab1bc1152ca..5a0470e36111 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -17,7 +17,6 @@
17#ifndef _LINUX_CRYPTO_H 17#ifndef _LINUX_CRYPTO_H
18#define _LINUX_CRYPTO_H 18#define _LINUX_CRYPTO_H
19 19
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/types.h> 22#include <linux/types.h>
diff --git a/include/linux/cyclomx.h b/include/linux/cyclomx.h
index 300d704bdb9a..b88f7f428e58 100644
--- a/include/linux/cyclomx.h
+++ b/include/linux/cyclomx.h
@@ -24,7 +24,6 @@
24* 1998/08/08 acme Version 0.0.1 24* 1998/08/08 acme Version 0.0.1
25*/ 25*/
26 26
27#include <linux/config.h>
28#include <linux/wanrouter.h> 27#include <linux/wanrouter.h>
29#include <linux/spinlock.h> 28#include <linux/spinlock.h>
30 29
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 836325ee0931..0dd1610a94a9 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -217,7 +217,6 @@ extern struct dentry * d_alloc_anon(struct inode *);
217extern struct dentry * d_splice_alias(struct inode *, struct dentry *); 217extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
218extern void shrink_dcache_sb(struct super_block *); 218extern void shrink_dcache_sb(struct super_block *);
219extern void shrink_dcache_parent(struct dentry *); 219extern void shrink_dcache_parent(struct dentry *);
220extern void shrink_dcache_anon(struct hlist_head *);
221extern int d_invalidate(struct dentry *); 220extern int d_invalidate(struct dentry *);
222 221
223/* only used at mount-time */ 222/* only used at mount-time */
diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h
index 1d68428c925d..0fe7cdf326f7 100644
--- a/include/linux/dcookies.h
+++ b/include/linux/dcookies.h
@@ -9,7 +9,6 @@
9#ifndef DCOOKIES_H 9#ifndef DCOOKIES_H
10#define DCOOKIES_H 10#define DCOOKIES_H
11 11
12#include <linux/config.h>
13 12
14#ifdef CONFIG_PROFILING 13#ifdef CONFIG_PROFILING
15 14
diff --git a/include/linux/delay.h b/include/linux/delay.h
index acb74865b973..17ddb55430ae 100644
--- a/include/linux/delay.h
+++ b/include/linux/delay.h
@@ -25,10 +25,7 @@ extern unsigned long loops_per_jiffy;
25#define MAX_UDELAY_MS 5 25#define MAX_UDELAY_MS 5
26#endif 26#endif
27 27
28#ifdef notdef 28#ifndef mdelay
29#define mdelay(n) (\
30 {unsigned long __ms=(n); while (__ms--) udelay(1000);})
31#else
32#define mdelay(n) (\ 29#define mdelay(n) (\
33 (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \ 30 (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \
34 ({unsigned long __ms=(n); while (__ms--) udelay(1000);})) 31 ({unsigned long __ms=(n); while (__ms--) udelay(1000);}))
diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h
index 89810e73d256..0d74a6f22abc 100644
--- a/include/linux/devfs_fs_kernel.h
+++ b/include/linux/devfs_fs_kernel.h
@@ -2,7 +2,6 @@
2#define _LINUX_DEVFS_FS_KERNEL_H 2#define _LINUX_DEVFS_FS_KERNEL_H
3 3
4#include <linux/fs.h> 4#include <linux/fs.h>
5#include <linux/config.h>
6#include <linux/spinlock.h> 5#include <linux/spinlock.h>
7#include <linux/types.h> 6#include <linux/types.h>
8 7
diff --git a/include/linux/device.h b/include/linux/device.h
index e8e53b9accc6..1e5f30da98bc 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -11,7 +11,6 @@
11#ifndef _DEVICE_H_ 11#ifndef _DEVICE_H_
12#define _DEVICE_H_ 12#define _DEVICE_H_
13 13
14#include <linux/config.h>
15#include <linux/ioport.h> 14#include <linux/ioport.h>
16#include <linux/kobject.h> 15#include <linux/kobject.h>
17#include <linux/klist.h> 16#include <linux/klist.h>
@@ -61,11 +60,6 @@ extern void bus_unregister(struct bus_type * bus);
61 60
62extern void bus_rescan_devices(struct bus_type * bus); 61extern void bus_rescan_devices(struct bus_type * bus);
63 62
64extern struct bus_type * get_bus(struct bus_type * bus);
65extern void put_bus(struct bus_type * bus);
66
67extern struct bus_type * find_bus(char * name);
68
69/* iterator helpers for buses */ 63/* iterator helpers for buses */
70 64
71int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, 65int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data,
@@ -148,6 +142,7 @@ struct class {
148 142
149 struct subsystem subsys; 143 struct subsystem subsys;
150 struct list_head children; 144 struct list_head children;
145 struct list_head devices;
151 struct list_head interfaces; 146 struct list_head interfaces;
152 struct semaphore sem; /* locks both the children and interfaces lists */ 147 struct semaphore sem; /* locks both the children and interfaces lists */
153 148
@@ -164,9 +159,6 @@ struct class {
164extern int class_register(struct class *); 159extern int class_register(struct class *);
165extern void class_unregister(struct class *); 160extern void class_unregister(struct class *);
166 161
167extern struct class * class_get(struct class *);
168extern void class_put(struct class *);
169
170 162
171struct class_attribute { 163struct class_attribute {
172 struct attribute attr; 164 struct attribute attr;
@@ -314,6 +306,7 @@ struct device {
314 struct kobject kobj; 306 struct kobject kobj;
315 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 307 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
316 struct device_attribute uevent_attr; 308 struct device_attribute uevent_attr;
309 struct device_attribute *devt_attr;
317 310
318 struct semaphore sem; /* semaphore to synchronize calls to 311 struct semaphore sem; /* semaphore to synchronize calls to
319 * its driver. 312 * its driver.
@@ -341,6 +334,11 @@ struct device {
341 struct dma_coherent_mem *dma_mem; /* internal for coherent mem 334 struct dma_coherent_mem *dma_mem; /* internal for coherent mem
342 override */ 335 override */
343 336
337 /* class_device migration path */
338 struct list_head node;
339 struct class *class; /* optional*/
340 dev_t devt; /* dev_t, creates the sysfs "dev" */
341
344 void (*release)(struct device * dev); 342 void (*release)(struct device * dev);
345}; 343};
346 344
@@ -382,6 +380,13 @@ extern int device_attach(struct device * dev);
382extern void driver_attach(struct device_driver * drv); 380extern void driver_attach(struct device_driver * drv);
383extern void device_reprobe(struct device *dev); 381extern void device_reprobe(struct device *dev);
384 382
383/*
384 * Easy functions for dynamically creating devices on the fly
385 */
386extern struct device *device_create(struct class *cls, struct device *parent,
387 dev_t devt, char *fmt, ...)
388 __attribute__((format(printf,4,5)));
389extern void device_destroy(struct class *cls, dev_t devt);
385 390
386/* 391/*
387 * Platform "fixup" functions - allow the platform to have their say 392 * Platform "fixup" functions - allow the platform to have their say
@@ -411,8 +416,9 @@ extern int firmware_register(struct subsystem *);
411extern void firmware_unregister(struct subsystem *); 416extern void firmware_unregister(struct subsystem *);
412 417
413/* debugging and troubleshooting/diagnostic helpers. */ 418/* debugging and troubleshooting/diagnostic helpers. */
419extern const char *dev_driver_string(struct device *dev);
414#define dev_printk(level, dev, format, arg...) \ 420#define dev_printk(level, dev, format, arg...) \
415 printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg) 421 printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg)
416 422
417#ifdef DEBUG 423#ifdef DEBUG
418#define dev_dbg(dev, format, arg...) \ 424#define dev_dbg(dev, format, arg...) \
diff --git a/include/linux/divert.h b/include/linux/divert.h
index 6919b09133d4..8fb4e9de6843 100644
--- a/include/linux/divert.h
+++ b/include/linux/divert.h
@@ -27,10 +27,10 @@ struct divert_blk
27{ 27{
28 int divert; /* are we active */ 28 int divert; /* are we active */
29 unsigned int protos; /* protocols */ 29 unsigned int protos; /* protocols */
30 u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */ 30 __u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */
31 u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */ 31 __u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */
32 u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */ 32 __u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */
33 u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */ 33 __u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */
34}; 34};
35 35
36/* 36/*
@@ -40,12 +40,12 @@ struct divert_blk
40 40
41typedef union _divert_cf_arg 41typedef union _divert_cf_arg
42{ 42{
43 s16 int16; 43 __s16 int16;
44 u16 uint16; 44 __u16 uint16;
45 s32 int32; 45 __s32 int32;
46 u32 uint32; 46 __u32 uint32;
47 s64 int64; 47 __s64 int64;
48 u64 uint64; 48 __u64 uint64;
49 void __user *ptr; 49 void __user *ptr;
50} divert_cf_arg; 50} divert_cf_arg;
51 51
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 64fd6c366604..b2cd2071d432 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -2,7 +2,6 @@
2#define __DMI_H__ 2#define __DMI_H__
3 3
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/config.h>
6 5
7enum dmi_field { 6enum dmi_field {
8 DMI_NONE, 7 DMI_NONE,
diff --git a/include/linux/dnotify.h b/include/linux/dnotify.h
index f134a01975c7..102a902b4396 100644
--- a/include/linux/dnotify.h
+++ b/include/linux/dnotify.h
@@ -18,7 +18,6 @@ struct dnotify_struct {
18 18
19#ifdef __KERNEL__ 19#ifdef __KERNEL__
20 20
21#include <linux/config.h>
22 21
23#ifdef CONFIG_DNOTIFY 22#ifdef CONFIG_DNOTIFY
24 23
diff --git a/include/linux/efi.h b/include/linux/efi.h
index e203613d3aec..66d621dbcb6c 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -294,6 +294,7 @@ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if pos
294extern u64 efi_get_iobase (void); 294extern u64 efi_get_iobase (void);
295extern u32 efi_mem_type (unsigned long phys_addr); 295extern u32 efi_mem_type (unsigned long phys_addr);
296extern u64 efi_mem_attributes (unsigned long phys_addr); 296extern u64 efi_mem_attributes (unsigned long phys_addr);
297extern u64 efi_mem_attribute (unsigned long phys_addr, unsigned long size);
297extern int efi_mem_attribute_range (unsigned long phys_addr, unsigned long size, 298extern int efi_mem_attribute_range (unsigned long phys_addr, unsigned long size,
298 u64 attr); 299 u64 attr);
299extern int __init efi_uart_console_only (void); 300extern int __init efi_uart_console_only (void);
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h
new file mode 100644
index 000000000000..114a96d25652
--- /dev/null
+++ b/include/linux/elf-em.h
@@ -0,0 +1,44 @@
1#ifndef _LINUX_ELF_EM_H
2#define _LINUX_ELF_EM_H
3
4/* These constants define the various ELF target machines */
5#define EM_NONE 0
6#define EM_M32 1
7#define EM_SPARC 2
8#define EM_386 3
9#define EM_68K 4
10#define EM_88K 5
11#define EM_486 6 /* Perhaps disused */
12#define EM_860 7
13#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
14#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */
15#define EM_PARISC 15 /* HPPA */
16#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
17#define EM_PPC 20 /* PowerPC */
18#define EM_PPC64 21 /* PowerPC64 */
19#define EM_SH 42 /* SuperH */
20#define EM_SPARCV9 43 /* SPARC v9 64-bit */
21#define EM_IA_64 50 /* HP/Intel IA-64 */
22#define EM_X86_64 62 /* AMD x86-64 */
23#define EM_S390 22 /* IBM S/390 */
24#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
25#define EM_V850 87 /* NEC v850 */
26#define EM_M32R 88 /* Renesas M32R */
27#define EM_H8_300 46 /* Renesas H8/300,300H,H8S */
28#define EM_FRV 0x5441 /* Fujitsu FR-V */
29
30/*
31 * This is an interim value that we will use until the committee comes
32 * up with a final number.
33 */
34#define EM_ALPHA 0x9026
35
36/* Bogus old v850 magic number, used by old tools. */
37#define EM_CYGNUS_V850 0x9080
38/* Bogus old m32r magic number, used by old tools. */
39#define EM_CYGNUS_M32R 0x9041
40/* This is the old interim value for S/390 architecture */
41#define EM_S390_OLD 0xA390
42
43
44#endif /* _LINUX_ELF_EM_H */
diff --git a/include/linux/elf.h b/include/linux/elf.h
index d3bfacb24496..b70d1d2c8d28 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/auxvec.h> 5#include <linux/auxvec.h>
6#include <linux/elf-em.h>
6#include <asm/elf.h> 7#include <asm/elf.h>
7 8
8#ifndef elf_read_implies_exec 9#ifndef elf_read_implies_exec
@@ -55,64 +56,6 @@ typedef __s64 Elf64_Sxword;
55#define ET_LOPROC 0xff00 56#define ET_LOPROC 0xff00
56#define ET_HIPROC 0xffff 57#define ET_HIPROC 0xffff
57 58
58/* These constants define the various ELF target machines */
59#define EM_NONE 0
60#define EM_M32 1
61#define EM_SPARC 2
62#define EM_386 3
63#define EM_68K 4
64#define EM_88K 5
65#define EM_486 6 /* Perhaps disused */
66#define EM_860 7
67
68#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
69
70#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */
71
72#define EM_PARISC 15 /* HPPA */
73
74#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
75
76#define EM_PPC 20 /* PowerPC */
77#define EM_PPC64 21 /* PowerPC64 */
78
79#define EM_SH 42 /* SuperH */
80
81#define EM_SPARCV9 43 /* SPARC v9 64-bit */
82
83#define EM_IA_64 50 /* HP/Intel IA-64 */
84
85#define EM_X86_64 62 /* AMD x86-64 */
86
87#define EM_S390 22 /* IBM S/390 */
88
89#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
90
91#define EM_V850 87 /* NEC v850 */
92
93#define EM_M32R 88 /* Renesas M32R */
94
95#define EM_H8_300 46 /* Renesas H8/300,300H,H8S */
96
97/*
98 * This is an interim value that we will use until the committee comes
99 * up with a final number.
100 */
101#define EM_ALPHA 0x9026
102
103/* Bogus old v850 magic number, used by old tools. */
104#define EM_CYGNUS_V850 0x9080
105
106/* Bogus old m32r magic number, used by old tools. */
107#define EM_CYGNUS_M32R 0x9041
108
109/*
110 * This is the old interim value for S/390 architecture
111 */
112#define EM_S390_OLD 0xA390
113
114#define EM_FRV 0x5441 /* Fujitsu FR-V */
115
116/* This is the info that is needed to parse the dynamic section of the file */ 59/* This is the info that is needed to parse the dynamic section of the file */
117#define DT_NULL 0 60#define DT_NULL 0
118#define DT_NEEDED 1 61#define DT_NEEDED 1
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h
index 174582fedb8b..408118a07763 100644
--- a/include/linux/errqueue.h
+++ b/include/linux/errqueue.h
@@ -21,7 +21,6 @@ struct sock_extended_err
21 21
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23 23
24#include <linux/config.h>
25#include <net/ip.h> 24#include <net/ip.h>
26#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 25#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
27#include <linux/ipv6.h> 26#include <linux/ipv6.h>
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 93535f093216..c6310aef5ab0 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -15,24 +15,24 @@
15 15
16/* This should work for both 32 and 64 bit userland. */ 16/* This should work for both 32 and 64 bit userland. */
17struct ethtool_cmd { 17struct ethtool_cmd {
18 u32 cmd; 18 __u32 cmd;
19 u32 supported; /* Features this interface supports */ 19 __u32 supported; /* Features this interface supports */
20 u32 advertising; /* Features this interface advertises */ 20 __u32 advertising; /* Features this interface advertises */
21 u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ 21 __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
22 u8 duplex; /* Duplex, half or full */ 22 __u8 duplex; /* Duplex, half or full */
23 u8 port; /* Which connector port */ 23 __u8 port; /* Which connector port */
24 u8 phy_address; 24 __u8 phy_address;
25 u8 transceiver; /* Which transceiver to use */ 25 __u8 transceiver; /* Which transceiver to use */
26 u8 autoneg; /* Enable or disable autonegotiation */ 26 __u8 autoneg; /* Enable or disable autonegotiation */
27 u32 maxtxpkt; /* Tx pkts before generating tx int */ 27 __u32 maxtxpkt; /* Tx pkts before generating tx int */
28 u32 maxrxpkt; /* Rx pkts before generating rx int */ 28 __u32 maxrxpkt; /* Rx pkts before generating rx int */
29 u32 reserved[4]; 29 __u32 reserved[4];
30}; 30};
31 31
32#define ETHTOOL_BUSINFO_LEN 32 32#define ETHTOOL_BUSINFO_LEN 32
33/* these strings are set to whatever the driver author decides... */ 33/* these strings are set to whatever the driver author decides... */
34struct ethtool_drvinfo { 34struct ethtool_drvinfo {
35 u32 cmd; 35 __u32 cmd;
36 char driver[32]; /* driver short name, "tulip", "eepro100" */ 36 char driver[32]; /* driver short name, "tulip", "eepro100" */
37 char version[32]; /* driver version string */ 37 char version[32]; /* driver version string */
38 char fw_version[32]; /* firmware version string, if applicable */ 38 char fw_version[32]; /* firmware version string, if applicable */
@@ -40,53 +40,53 @@ struct ethtool_drvinfo {
40 /* For PCI devices, use pci_name(pci_dev). */ 40 /* For PCI devices, use pci_name(pci_dev). */
41 char reserved1[32]; 41 char reserved1[32];
42 char reserved2[16]; 42 char reserved2[16];
43 u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ 43 __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
44 u32 testinfo_len; 44 __u32 testinfo_len;
45 u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ 45 __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
46 u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ 46 __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
47}; 47};
48 48
49#define SOPASS_MAX 6 49#define SOPASS_MAX 6
50/* wake-on-lan settings */ 50/* wake-on-lan settings */
51struct ethtool_wolinfo { 51struct ethtool_wolinfo {
52 u32 cmd; 52 __u32 cmd;
53 u32 supported; 53 __u32 supported;
54 u32 wolopts; 54 __u32 wolopts;
55 u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */ 55 __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
56}; 56};
57 57
58/* for passing single values */ 58/* for passing single values */
59struct ethtool_value { 59struct ethtool_value {
60 u32 cmd; 60 __u32 cmd;
61 u32 data; 61 __u32 data;
62}; 62};
63 63
64/* for passing big chunks of data */ 64/* for passing big chunks of data */
65struct ethtool_regs { 65struct ethtool_regs {
66 u32 cmd; 66 __u32 cmd;
67 u32 version; /* driver-specific, indicates different chips/revs */ 67 __u32 version; /* driver-specific, indicates different chips/revs */
68 u32 len; /* bytes */ 68 __u32 len; /* bytes */
69 u8 data[0]; 69 __u8 data[0];
70}; 70};
71 71
72/* for passing EEPROM chunks */ 72/* for passing EEPROM chunks */
73struct ethtool_eeprom { 73struct ethtool_eeprom {
74 u32 cmd; 74 __u32 cmd;
75 u32 magic; 75 __u32 magic;
76 u32 offset; /* in bytes */ 76 __u32 offset; /* in bytes */
77 u32 len; /* in bytes */ 77 __u32 len; /* in bytes */
78 u8 data[0]; 78 __u8 data[0];
79}; 79};
80 80
81/* for configuring coalescing parameters of chip */ 81/* for configuring coalescing parameters of chip */
82struct ethtool_coalesce { 82struct ethtool_coalesce {
83 u32 cmd; /* ETHTOOL_{G,S}COALESCE */ 83 __u32 cmd; /* ETHTOOL_{G,S}COALESCE */
84 84
85 /* How many usecs to delay an RX interrupt after 85 /* How many usecs to delay an RX interrupt after
86 * a packet arrives. If 0, only rx_max_coalesced_frames 86 * a packet arrives. If 0, only rx_max_coalesced_frames
87 * is used. 87 * is used.
88 */ 88 */
89 u32 rx_coalesce_usecs; 89 __u32 rx_coalesce_usecs;
90 90
91 /* How many packets to delay an RX interrupt after 91 /* How many packets to delay an RX interrupt after
92 * a packet arrives. If 0, only rx_coalesce_usecs is 92 * a packet arrives. If 0, only rx_coalesce_usecs is
@@ -94,21 +94,21 @@ struct ethtool_coalesce {
94 * to zero as this would cause RX interrupts to never be 94 * to zero as this would cause RX interrupts to never be
95 * generated. 95 * generated.
96 */ 96 */
97 u32 rx_max_coalesced_frames; 97 __u32 rx_max_coalesced_frames;
98 98
99 /* Same as above two parameters, except that these values 99 /* Same as above two parameters, except that these values
100 * apply while an IRQ is being serviced by the host. Not 100 * apply while an IRQ is being serviced by the host. Not
101 * all cards support this feature and the values are ignored 101 * all cards support this feature and the values are ignored
102 * in that case. 102 * in that case.
103 */ 103 */
104 u32 rx_coalesce_usecs_irq; 104 __u32 rx_coalesce_usecs_irq;
105 u32 rx_max_coalesced_frames_irq; 105 __u32 rx_max_coalesced_frames_irq;
106 106
107 /* How many usecs to delay a TX interrupt after 107 /* How many usecs to delay a TX interrupt after
108 * a packet is sent. If 0, only tx_max_coalesced_frames 108 * a packet is sent. If 0, only tx_max_coalesced_frames
109 * is used. 109 * is used.
110 */ 110 */
111 u32 tx_coalesce_usecs; 111 __u32 tx_coalesce_usecs;
112 112
113 /* How many packets to delay a TX interrupt after 113 /* How many packets to delay a TX interrupt after
114 * a packet is sent. If 0, only tx_coalesce_usecs is 114 * a packet is sent. If 0, only tx_coalesce_usecs is
@@ -116,22 +116,22 @@ struct ethtool_coalesce {
116 * to zero as this would cause TX interrupts to never be 116 * to zero as this would cause TX interrupts to never be
117 * generated. 117 * generated.
118 */ 118 */
119 u32 tx_max_coalesced_frames; 119 __u32 tx_max_coalesced_frames;
120 120
121 /* Same as above two parameters, except that these values 121 /* Same as above two parameters, except that these values
122 * apply while an IRQ is being serviced by the host. Not 122 * apply while an IRQ is being serviced by the host. Not
123 * all cards support this feature and the values are ignored 123 * all cards support this feature and the values are ignored
124 * in that case. 124 * in that case.
125 */ 125 */
126 u32 tx_coalesce_usecs_irq; 126 __u32 tx_coalesce_usecs_irq;
127 u32 tx_max_coalesced_frames_irq; 127 __u32 tx_max_coalesced_frames_irq;
128 128
129 /* How many usecs to delay in-memory statistics 129 /* How many usecs to delay in-memory statistics
130 * block updates. Some drivers do not have an in-memory 130 * block updates. Some drivers do not have an in-memory
131 * statistic block, and in such cases this value is ignored. 131 * statistic block, and in such cases this value is ignored.
132 * This value must not be zero. 132 * This value must not be zero.
133 */ 133 */
134 u32 stats_block_coalesce_usecs; 134 __u32 stats_block_coalesce_usecs;
135 135
136 /* Adaptive RX/TX coalescing is an algorithm implemented by 136 /* Adaptive RX/TX coalescing is an algorithm implemented by
137 * some drivers to improve latency under low packet rates and 137 * some drivers to improve latency under low packet rates and
@@ -140,18 +140,18 @@ struct ethtool_coalesce {
140 * not implemented by the driver causes these values to be 140 * not implemented by the driver causes these values to be
141 * silently ignored. 141 * silently ignored.
142 */ 142 */
143 u32 use_adaptive_rx_coalesce; 143 __u32 use_adaptive_rx_coalesce;
144 u32 use_adaptive_tx_coalesce; 144 __u32 use_adaptive_tx_coalesce;
145 145
146 /* When the packet rate (measured in packets per second) 146 /* When the packet rate (measured in packets per second)
147 * is below pkt_rate_low, the {rx,tx}_*_low parameters are 147 * is below pkt_rate_low, the {rx,tx}_*_low parameters are
148 * used. 148 * used.
149 */ 149 */
150 u32 pkt_rate_low; 150 __u32 pkt_rate_low;
151 u32 rx_coalesce_usecs_low; 151 __u32 rx_coalesce_usecs_low;
152 u32 rx_max_coalesced_frames_low; 152 __u32 rx_max_coalesced_frames_low;
153 u32 tx_coalesce_usecs_low; 153 __u32 tx_coalesce_usecs_low;
154 u32 tx_max_coalesced_frames_low; 154 __u32 tx_max_coalesced_frames_low;
155 155
156 /* When the packet rate is below pkt_rate_high but above 156 /* When the packet rate is below pkt_rate_high but above
157 * pkt_rate_low (both measured in packets per second) the 157 * pkt_rate_low (both measured in packets per second) the
@@ -162,43 +162,43 @@ struct ethtool_coalesce {
162 * is above pkt_rate_high, the {rx,tx}_*_high parameters are 162 * is above pkt_rate_high, the {rx,tx}_*_high parameters are
163 * used. 163 * used.
164 */ 164 */
165 u32 pkt_rate_high; 165 __u32 pkt_rate_high;
166 u32 rx_coalesce_usecs_high; 166 __u32 rx_coalesce_usecs_high;
167 u32 rx_max_coalesced_frames_high; 167 __u32 rx_max_coalesced_frames_high;
168 u32 tx_coalesce_usecs_high; 168 __u32 tx_coalesce_usecs_high;
169 u32 tx_max_coalesced_frames_high; 169 __u32 tx_max_coalesced_frames_high;
170 170
171 /* How often to do adaptive coalescing packet rate sampling, 171 /* How often to do adaptive coalescing packet rate sampling,
172 * measured in seconds. Must not be zero. 172 * measured in seconds. Must not be zero.
173 */ 173 */
174 u32 rate_sample_interval; 174 __u32 rate_sample_interval;
175}; 175};
176 176
177/* for configuring RX/TX ring parameters */ 177/* for configuring RX/TX ring parameters */
178struct ethtool_ringparam { 178struct ethtool_ringparam {
179 u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */ 179 __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */
180 180
181 /* Read only attributes. These indicate the maximum number 181 /* Read only attributes. These indicate the maximum number
182 * of pending RX/TX ring entries the driver will allow the 182 * of pending RX/TX ring entries the driver will allow the
183 * user to set. 183 * user to set.
184 */ 184 */
185 u32 rx_max_pending; 185 __u32 rx_max_pending;
186 u32 rx_mini_max_pending; 186 __u32 rx_mini_max_pending;
187 u32 rx_jumbo_max_pending; 187 __u32 rx_jumbo_max_pending;
188 u32 tx_max_pending; 188 __u32 tx_max_pending;
189 189
190 /* Values changeable by the user. The valid values are 190 /* Values changeable by the user. The valid values are
191 * in the range 1 to the "*_max_pending" counterpart above. 191 * in the range 1 to the "*_max_pending" counterpart above.
192 */ 192 */
193 u32 rx_pending; 193 __u32 rx_pending;
194 u32 rx_mini_pending; 194 __u32 rx_mini_pending;
195 u32 rx_jumbo_pending; 195 __u32 rx_jumbo_pending;
196 u32 tx_pending; 196 __u32 tx_pending;
197}; 197};
198 198
199/* for configuring link flow control parameters */ 199/* for configuring link flow control parameters */
200struct ethtool_pauseparam { 200struct ethtool_pauseparam {
201 u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ 201 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
202 202
203 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg 203 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
204 * being true) the user may set 'autonet' here non-zero to have the 204 * being true) the user may set 'autonet' here non-zero to have the
@@ -210,9 +210,9 @@ struct ethtool_pauseparam {
210 * then {rx,tx}_pause force the driver to use/not-use pause 210 * then {rx,tx}_pause force the driver to use/not-use pause
211 * flow control. 211 * flow control.
212 */ 212 */
213 u32 autoneg; 213 __u32 autoneg;
214 u32 rx_pause; 214 __u32 rx_pause;
215 u32 tx_pause; 215 __u32 tx_pause;
216}; 216};
217 217
218#define ETH_GSTRING_LEN 32 218#define ETH_GSTRING_LEN 32
@@ -223,10 +223,10 @@ enum ethtool_stringset {
223 223
224/* for passing string sets for data tagging */ 224/* for passing string sets for data tagging */
225struct ethtool_gstrings { 225struct ethtool_gstrings {
226 u32 cmd; /* ETHTOOL_GSTRINGS */ 226 __u32 cmd; /* ETHTOOL_GSTRINGS */
227 u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/ 227 __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/
228 u32 len; /* number of strings in the string set */ 228 __u32 len; /* number of strings in the string set */
229 u8 data[0]; 229 __u8 data[0];
230}; 230};
231 231
232enum ethtool_test_flags { 232enum ethtool_test_flags {
@@ -236,26 +236,28 @@ enum ethtool_test_flags {
236 236
237/* for requesting NIC test and getting results*/ 237/* for requesting NIC test and getting results*/
238struct ethtool_test { 238struct ethtool_test {
239 u32 cmd; /* ETHTOOL_TEST */ 239 __u32 cmd; /* ETHTOOL_TEST */
240 u32 flags; /* ETH_TEST_FL_xxx */ 240 __u32 flags; /* ETH_TEST_FL_xxx */
241 u32 reserved; 241 __u32 reserved;
242 u32 len; /* result length, in number of u64 elements */ 242 __u32 len; /* result length, in number of u64 elements */
243 u64 data[0]; 243 __u64 data[0];
244}; 244};
245 245
246/* for dumping NIC-specific statistics */ 246/* for dumping NIC-specific statistics */
247struct ethtool_stats { 247struct ethtool_stats {
248 u32 cmd; /* ETHTOOL_GSTATS */ 248 __u32 cmd; /* ETHTOOL_GSTATS */
249 u32 n_stats; /* number of u64's being returned */ 249 __u32 n_stats; /* number of u64's being returned */
250 u64 data[0]; 250 __u64 data[0];
251}; 251};
252 252
253struct ethtool_perm_addr { 253struct ethtool_perm_addr {
254 u32 cmd; /* ETHTOOL_GPERMADDR */ 254 __u32 cmd; /* ETHTOOL_GPERMADDR */
255 u32 size; 255 __u32 size;
256 u8 data[0]; 256 __u8 data[0];
257}; 257};
258 258
259#ifdef __KERNEL__
260
259struct net_device; 261struct net_device;
260 262
261/* Some generic methods drivers may use in their ethtool_ops */ 263/* Some generic methods drivers may use in their ethtool_ops */
@@ -371,6 +373,7 @@ struct ethtool_ops {
371 u32 (*get_ufo)(struct net_device *); 373 u32 (*get_ufo)(struct net_device *);
372 int (*set_ufo)(struct net_device *, u32); 374 int (*set_ufo)(struct net_device *, u32);
373}; 375};
376#endif /* __KERNEL__ */
374 377
375/* CMDs currently supported */ 378/* CMDs currently supported */
376#define ETHTOOL_GSET 0x00000001 /* Get settings. */ 379#define ETHTOOL_GSET 0x00000001 /* Get settings. */
@@ -408,6 +411,8 @@ struct ethtool_ops {
408#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ 411#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
409#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */ 412#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
410#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */ 413#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
414#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
415#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
411 416
412/* compatibility with older code */ 417/* compatibility with older code */
413#define SPARC_ETH_GSET ETHTOOL_GSET 418#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index f7bd1c7ebefb..facf34e98954 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -17,7 +17,6 @@
17#define _LINUX_EXT2_FS_H 17#define _LINUX_EXT2_FS_H
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/ext2_fs_sb.h>
21 20
22/* 21/*
23 * The second extended filesystem constants/structures 22 * The second extended filesystem constants/structures
@@ -70,6 +69,7 @@
70#define EXT2_SUPER_MAGIC 0xEF53 69#define EXT2_SUPER_MAGIC 0xEF53
71 70
72#ifdef __KERNEL__ 71#ifdef __KERNEL__
72#include <linux/ext2_fs_sb.h>
73static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) 73static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)
74{ 74{
75 return sb->s_fs_info; 75 return sb->s_fs_info;
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 3ade6a4e3bdd..757d54d8f1a5 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -17,11 +17,6 @@
17#define _LINUX_EXT3_FS_H 17#define _LINUX_EXT3_FS_H
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/ext3_fs_i.h>
21#include <linux/ext3_fs_sb.h>
22
23
24struct statfs;
25 20
26/* 21/*
27 * The second extended filesystem constants/structures 22 * The second extended filesystem constants/structures
@@ -487,6 +482,8 @@ struct ext3_super_block {
487}; 482};
488 483
489#ifdef __KERNEL__ 484#ifdef __KERNEL__
485#include <linux/ext3_fs_i.h>
486#include <linux/ext3_fs_sb.h>
490static inline struct ext3_sb_info * EXT3_SB(struct super_block *sb) 487static inline struct ext3_sb_info * EXT3_SB(struct super_block *sb)
491{ 488{
492 return sb->s_fs_info; 489 return sb->s_fs_info;
@@ -664,6 +661,8 @@ struct ext3_dir_entry_2 {
664#define DX_HASH_HALF_MD4 1 661#define DX_HASH_HALF_MD4 1
665#define DX_HASH_TEA 2 662#define DX_HASH_TEA 2
666 663
664#ifdef __KERNEL__
665
667/* hash info structure used by the directory hash */ 666/* hash info structure used by the directory hash */
668struct dx_hash_info 667struct dx_hash_info
669{ 668{
@@ -675,7 +674,6 @@ struct dx_hash_info
675 674
676#define EXT3_HTREE_EOF 0x7fffffff 675#define EXT3_HTREE_EOF 0x7fffffff
677 676
678#ifdef __KERNEL__
679/* 677/*
680 * Control parameters used by ext3_htree_next_block 678 * Control parameters used by ext3_htree_next_block
681 */ 679 */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f813bc8266aa..dba4cbd157ee 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -6,7 +6,6 @@
6 * structures etc. 6 * structures etc.
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/limits.h> 9#include <linux/limits.h>
11#include <linux/ioctl.h> 10#include <linux/ioctl.h>
12 11
@@ -377,7 +376,8 @@ struct address_space_operations {
377 struct page* (*get_xip_page)(struct address_space *, sector_t, 376 struct page* (*get_xip_page)(struct address_space *, sector_t,
378 int); 377 int);
379 /* migrate the contents of a page to the specified target */ 378 /* migrate the contents of a page to the specified target */
380 int (*migratepage) (struct page *, struct page *); 379 int (*migratepage) (struct address_space *,
380 struct page *, struct page *);
381}; 381};
382 382
383struct backing_dev_info; 383struct backing_dev_info;
@@ -683,6 +683,7 @@ extern spinlock_t files_lock;
683#define FL_FLOCK 2 683#define FL_FLOCK 2
684#define FL_ACCESS 8 /* not trying to lock, just looking */ 684#define FL_ACCESS 8 /* not trying to lock, just looking */
685#define FL_LEASE 32 /* lease held on this file */ 685#define FL_LEASE 32 /* lease held on this file */
686#define FL_CLOSE 64 /* unlock on close */
686#define FL_SLEEP 128 /* A blocking lock */ 687#define FL_SLEEP 128 /* A blocking lock */
687 688
688/* 689/*
@@ -775,7 +776,6 @@ extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_l
775extern int posix_lock_file(struct file *, struct file_lock *); 776extern int posix_lock_file(struct file *, struct file_lock *);
776extern int posix_lock_file_wait(struct file *, struct file_lock *); 777extern int posix_lock_file_wait(struct file *, struct file_lock *);
777extern int posix_unblock_lock(struct file *, struct file_lock *); 778extern int posix_unblock_lock(struct file *, struct file_lock *);
778extern int posix_locks_deadlock(struct file_lock *, struct file_lock *);
779extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); 779extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
780extern int __break_lease(struct inode *inode, unsigned int flags); 780extern int __break_lease(struct inode *inode, unsigned int flags);
781extern void lease_get_mtime(struct inode *, struct timespec *time); 781extern void lease_get_mtime(struct inode *, struct timespec *time);
@@ -783,7 +783,6 @@ extern int setlease(struct file *, long, struct file_lock **);
783extern int lease_modify(struct file_lock **, int); 783extern int lease_modify(struct file_lock **, int);
784extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 784extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
785extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 785extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
786extern void steal_locks(fl_owner_t from);
787 786
788struct fasync_struct { 787struct fasync_struct {
789 int magic; 788 int magic;
@@ -1026,7 +1025,7 @@ struct file_operations {
1026 long (*compat_ioctl) (struct file *, unsigned int, unsigned long); 1025 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
1027 int (*mmap) (struct file *, struct vm_area_struct *); 1026 int (*mmap) (struct file *, struct vm_area_struct *);
1028 int (*open) (struct inode *, struct file *); 1027 int (*open) (struct inode *, struct file *);
1029 int (*flush) (struct file *); 1028 int (*flush) (struct file *, fl_owner_t id);
1030 int (*release) (struct inode *, struct file *); 1029 int (*release) (struct inode *, struct file *);
1031 int (*fsync) (struct file *, struct dentry *, int datasync); 1030 int (*fsync) (struct file *, struct dentry *, int datasync);
1032 int (*aio_fsync) (struct kiocb *, int datasync); 1031 int (*aio_fsync) (struct kiocb *, int datasync);
@@ -1098,7 +1097,7 @@ struct super_operations {
1098 int (*sync_fs)(struct super_block *sb, int wait); 1097 int (*sync_fs)(struct super_block *sb, int wait);
1099 void (*write_super_lockfs) (struct super_block *); 1098 void (*write_super_lockfs) (struct super_block *);
1100 void (*unlockfs) (struct super_block *); 1099 void (*unlockfs) (struct super_block *);
1101 int (*statfs) (struct super_block *, struct kstatfs *); 1100 int (*statfs) (struct dentry *, struct kstatfs *);
1102 int (*remount_fs) (struct super_block *, int *, char *); 1101 int (*remount_fs) (struct super_block *, int *, char *);
1103 void (*clear_inode) (struct inode *); 1102 void (*clear_inode) (struct inode *);
1104 void (*umount_begin) (struct super_block *); 1103 void (*umount_begin) (struct super_block *);
@@ -1271,23 +1270,26 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
1271struct file_system_type { 1270struct file_system_type {
1272 const char *name; 1271 const char *name;
1273 int fs_flags; 1272 int fs_flags;
1274 struct super_block *(*get_sb) (struct file_system_type *, int, 1273 int (*get_sb) (struct file_system_type *, int,
1275 const char *, void *); 1274 const char *, void *, struct vfsmount *);
1276 void (*kill_sb) (struct super_block *); 1275 void (*kill_sb) (struct super_block *);
1277 struct module *owner; 1276 struct module *owner;
1278 struct file_system_type * next; 1277 struct file_system_type * next;
1279 struct list_head fs_supers; 1278 struct list_head fs_supers;
1280}; 1279};
1281 1280
1282struct super_block *get_sb_bdev(struct file_system_type *fs_type, 1281extern int get_sb_bdev(struct file_system_type *fs_type,
1283 int flags, const char *dev_name, void *data, 1282 int flags, const char *dev_name, void *data,
1284 int (*fill_super)(struct super_block *, void *, int)); 1283 int (*fill_super)(struct super_block *, void *, int),
1285struct super_block *get_sb_single(struct file_system_type *fs_type, 1284 struct vfsmount *mnt);
1285extern int get_sb_single(struct file_system_type *fs_type,
1286 int flags, void *data, 1286 int flags, void *data,
1287 int (*fill_super)(struct super_block *, void *, int)); 1287 int (*fill_super)(struct super_block *, void *, int),
1288struct super_block *get_sb_nodev(struct file_system_type *fs_type, 1288 struct vfsmount *mnt);
1289extern int get_sb_nodev(struct file_system_type *fs_type,
1289 int flags, void *data, 1290 int flags, void *data,
1290 int (*fill_super)(struct super_block *, void *, int)); 1291 int (*fill_super)(struct super_block *, void *, int),
1292 struct vfsmount *mnt);
1291void generic_shutdown_super(struct super_block *sb); 1293void generic_shutdown_super(struct super_block *sb);
1292void kill_block_super(struct super_block *sb); 1294void kill_block_super(struct super_block *sb);
1293void kill_anon_super(struct super_block *sb); 1295void kill_anon_super(struct super_block *sb);
@@ -1298,8 +1300,10 @@ struct super_block *sget(struct file_system_type *type,
1298 int (*test)(struct super_block *,void *), 1300 int (*test)(struct super_block *,void *),
1299 int (*set)(struct super_block *,void *), 1301 int (*set)(struct super_block *,void *),
1300 void *data); 1302 void *data);
1301struct super_block *get_sb_pseudo(struct file_system_type *, char *, 1303extern int get_sb_pseudo(struct file_system_type *, char *,
1302 struct super_operations *ops, unsigned long); 1304 struct super_operations *ops, unsigned long,
1305 struct vfsmount *mnt);
1306extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1303int __put_super(struct super_block *sb); 1307int __put_super(struct super_block *sb);
1304int __put_super_and_need_restart(struct super_block *sb); 1308int __put_super_and_need_restart(struct super_block *sb);
1305void unnamed_dev_init(void); 1309void unnamed_dev_init(void);
@@ -1322,7 +1326,7 @@ extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);
1322extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, 1326extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
1323 struct vfsmount *); 1327 struct vfsmount *);
1324 1328
1325extern int vfs_statfs(struct super_block *, struct kstatfs *); 1329extern int vfs_statfs(struct dentry *, struct kstatfs *);
1326 1330
1327/* /sys/fs */ 1331/* /sys/fs */
1328extern struct subsystem fs_subsys; 1332extern struct subsystem fs_subsys;
@@ -1743,7 +1747,7 @@ extern int dcache_dir_close(struct inode *, struct file *);
1743extern loff_t dcache_dir_lseek(struct file *, loff_t, int); 1747extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
1744extern int dcache_readdir(struct file *, void *, filldir_t); 1748extern int dcache_readdir(struct file *, void *, filldir_t);
1745extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); 1749extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
1746extern int simple_statfs(struct super_block *, struct kstatfs *); 1750extern int simple_statfs(struct dentry *, struct kstatfs *);
1747extern int simple_link(struct dentry *, struct inode *, struct dentry *); 1751extern int simple_link(struct dentry *, struct inode *, struct dentry *);
1748extern int simple_unlink(struct inode *, struct dentry *); 1752extern int simple_unlink(struct inode *, struct dentry *);
1749extern int simple_rmdir(struct inode *, struct dentry *); 1753extern int simple_rmdir(struct inode *, struct dentry *);
@@ -1769,7 +1773,8 @@ extern void simple_release_fs(struct vfsmount **mount, int *count);
1769extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t); 1773extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t);
1770 1774
1771#ifdef CONFIG_MIGRATION 1775#ifdef CONFIG_MIGRATION
1772extern int buffer_migrate_page(struct page *, struct page *); 1776extern int buffer_migrate_page(struct address_space *,
1777 struct page *, struct page *);
1773#else 1778#else
1774#define buffer_migrate_page NULL 1779#define buffer_migrate_page NULL
1775#endif 1780#endif
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 11438eff4d44..cc5dec70c32c 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -54,19 +54,20 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
54 54
55 if (isdir) 55 if (isdir)
56 isdir = IN_ISDIR; 56 isdir = IN_ISDIR;
57 inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name); 57 inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name,
58 inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name); 58 source);
59 inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name,
60 source);
59 61
60 if (target) { 62 if (target) {
61 inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL); 63 inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL, NULL);
62 inotify_inode_is_dead(target); 64 inotify_inode_is_dead(target);
63 } 65 }
64 66
65 if (source) { 67 if (source) {
66 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL); 68 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL);
67 } 69 }
68 audit_inode_child(old_name, source, old_dir->i_ino); 70 audit_inode_child(new_name, source, new_dir->i_ino);
69 audit_inode_child(new_name, target, new_dir->i_ino);
70} 71}
71 72
72/* 73/*
@@ -85,7 +86,7 @@ static inline void fsnotify_nameremove(struct dentry *dentry, int isdir)
85 */ 86 */
86static inline void fsnotify_inoderemove(struct inode *inode) 87static inline void fsnotify_inoderemove(struct inode *inode)
87{ 88{
88 inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL); 89 inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL, NULL);
89 inotify_inode_is_dead(inode); 90 inotify_inode_is_dead(inode);
90} 91}
91 92
@@ -95,7 +96,8 @@ static inline void fsnotify_inoderemove(struct inode *inode)
95static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) 96static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
96{ 97{
97 inode_dir_notify(inode, DN_CREATE); 98 inode_dir_notify(inode, DN_CREATE);
98 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name); 99 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name,
100 dentry->d_inode);
99 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); 101 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino);
100} 102}
101 103
@@ -106,7 +108,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
106{ 108{
107 inode_dir_notify(inode, DN_CREATE); 109 inode_dir_notify(inode, DN_CREATE);
108 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, 110 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0,
109 dentry->d_name.name); 111 dentry->d_name.name, dentry->d_inode);
110 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); 112 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino);
111} 113}
112 114
@@ -123,7 +125,7 @@ static inline void fsnotify_access(struct dentry *dentry)
123 125
124 dnotify_parent(dentry, DN_ACCESS); 126 dnotify_parent(dentry, DN_ACCESS);
125 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); 127 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
126 inotify_inode_queue_event(inode, mask, 0, NULL); 128 inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
127} 129}
128 130
129/* 131/*
@@ -139,7 +141,7 @@ static inline void fsnotify_modify(struct dentry *dentry)
139 141
140 dnotify_parent(dentry, DN_MODIFY); 142 dnotify_parent(dentry, DN_MODIFY);
141 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); 143 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
142 inotify_inode_queue_event(inode, mask, 0, NULL); 144 inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
143} 145}
144 146
145/* 147/*
@@ -154,7 +156,7 @@ static inline void fsnotify_open(struct dentry *dentry)
154 mask |= IN_ISDIR; 156 mask |= IN_ISDIR;
155 157
156 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); 158 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
157 inotify_inode_queue_event(inode, mask, 0, NULL); 159 inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
158} 160}
159 161
160/* 162/*
@@ -172,7 +174,7 @@ static inline void fsnotify_close(struct file *file)
172 mask |= IN_ISDIR; 174 mask |= IN_ISDIR;
173 175
174 inotify_dentry_parent_queue_event(dentry, mask, 0, name); 176 inotify_dentry_parent_queue_event(dentry, mask, 0, name);
175 inotify_inode_queue_event(inode, mask, 0, NULL); 177 inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
176} 178}
177 179
178/* 180/*
@@ -187,7 +189,7 @@ static inline void fsnotify_xattr(struct dentry *dentry)
187 mask |= IN_ISDIR; 189 mask |= IN_ISDIR;
188 190
189 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); 191 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
190 inotify_inode_queue_event(inode, mask, 0, NULL); 192 inotify_inode_queue_event(inode, mask, 0, NULL, NULL);
191} 193}
192 194
193/* 195/*
@@ -234,7 +236,7 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid)
234 if (in_mask) { 236 if (in_mask) {
235 if (S_ISDIR(inode->i_mode)) 237 if (S_ISDIR(inode->i_mode))
236 in_mask |= IN_ISDIR; 238 in_mask |= IN_ISDIR;
237 inotify_inode_queue_event(inode, in_mask, 0, NULL); 239 inotify_inode_queue_event(inode, in_mask, 0, NULL, NULL);
238 inotify_dentry_parent_queue_event(dentry, in_mask, 0, 240 inotify_dentry_parent_queue_event(dentry, in_mask, 0,
239 dentry->d_name.name); 241 dentry->d_name.name);
240 } 242 }
diff --git a/include/linux/ftape.h b/include/linux/ftape.h
index 72faeec9f6e1..7e7038cba86a 100644
--- a/include/linux/ftape.h
+++ b/include/linux/ftape.h
@@ -35,7 +35,6 @@
35#include <linux/mm.h> 35#include <linux/mm.h>
36#endif 36#endif
37#include <linux/types.h> 37#include <linux/types.h>
38#include <linux/config.h>
39#include <linux/mtio.h> 38#include <linux/mtio.h>
40 39
41#define FT_SECTOR(x) (x+1) /* sector offset into real sector */ 40#define FT_SECTOR(x) (x+1) /* sector offset into real sector */
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 71e7b2847cb3..2cdba0c23957 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -9,6 +9,7 @@
9 * the Free Software Foundation. 9 * the Free Software Foundation.
10 */ 10 */
11 11
12#ifdef __KERNEL__
12#include <asm/io.h> 13#include <asm/io.h>
13#include <linux/list.h> 14#include <linux/list.h>
14#include <linux/mutex.h> 15#include <linux/mutex.h>
@@ -154,6 +155,8 @@ static inline void gameport_register_driver(struct gameport_driver *drv)
154 155
155void gameport_unregister_driver(struct gameport_driver *drv); 156void gameport_unregister_driver(struct gameport_driver *drv);
156 157
158#endif /* __KERNEL__ */
159
157#define GAMEPORT_MODE_DISABLED 0 160#define GAMEPORT_MODE_DISABLED 0
158#define GAMEPORT_MODE_RAW 1 161#define GAMEPORT_MODE_RAW 1
159#define GAMEPORT_MODE_COOKED 2 162#define GAMEPORT_MODE_COOKED 2
@@ -169,6 +172,8 @@ void gameport_unregister_driver(struct gameport_driver *drv);
169#define GAMEPORT_ID_VENDOR_GRAVIS 0x0009 172#define GAMEPORT_ID_VENDOR_GRAVIS 0x0009
170#define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a 173#define GAMEPORT_ID_VENDOR_GUILLEMOT 0x000a
171 174
175#ifdef __KERNEL__
176
172static inline void gameport_trigger(struct gameport *gameport) 177static inline void gameport_trigger(struct gameport *gameport)
173{ 178{
174 if (gameport->trigger) 179 if (gameport->trigger)
@@ -219,4 +224,5 @@ static inline void gameport_set_poll_interval(struct gameport *gameport, unsigne
219void gameport_start_polling(struct gameport *gameport); 224void gameport_start_polling(struct gameport *gameport);
220void gameport_stop_polling(struct gameport *gameport); 225void gameport_stop_polling(struct gameport *gameport);
221 226
227#endif /* __KERNEL__ */
222#endif 228#endif
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h
index 7fd0576a4454..690c42803d2e 100644
--- a/include/linux/genalloc.h
+++ b/include/linux/genalloc.h
@@ -4,37 +4,32 @@
4 * Uses for this includes on-device special memory, uncached memory 4 * Uses for this includes on-device special memory, uncached memory
5 * etc. 5 * etc.
6 * 6 *
7 * This code is based on the buddy allocator found in the sym53c8xx_2
8 * driver, adapted for general purpose use.
9 *
10 * This source code is licensed under the GNU General Public License, 7 * This source code is licensed under the GNU General Public License,
11 * Version 2. See the file COPYING for more details. 8 * Version 2. See the file COPYING for more details.
12 */ 9 */
13 10
14#include <linux/spinlock.h>
15 11
16#define ALLOC_MIN_SHIFT 5 /* 32 bytes minimum */
17/* 12/*
18 * Link between free memory chunks of a given size. 13 * General purpose special memory pool descriptor.
19 */ 14 */
20struct gen_pool_link { 15struct gen_pool {
21 struct gen_pool_link *next; 16 rwlock_t lock;
17 struct list_head chunks; /* list of chunks in this pool */
18 int min_alloc_order; /* minimum allocation order */
22}; 19};
23 20
24/* 21/*
25 * Memory pool descriptor. 22 * General purpose special memory pool chunk descriptor.
26 */ 23 */
27struct gen_pool { 24struct gen_pool_chunk {
28 spinlock_t lock; 25 spinlock_t lock;
29 unsigned long (*get_new_chunk)(struct gen_pool *); 26 struct list_head next_chunk; /* next chunk in pool */
30 struct gen_pool *next; 27 unsigned long start_addr; /* starting address of memory chunk */
31 struct gen_pool_link *h; 28 unsigned long end_addr; /* ending address of memory chunk */
32 unsigned long private; 29 unsigned long bits[0]; /* bitmap for allocating memory chunk */
33 int max_chunk_shift;
34}; 30};
35 31
36unsigned long gen_pool_alloc(struct gen_pool *poolp, int size); 32extern struct gen_pool *gen_pool_create(int, int);
37void gen_pool_free(struct gen_pool *mp, unsigned long ptr, int size); 33extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int);
38struct gen_pool *gen_pool_create(int nr_chunks, int max_chunk_shift, 34extern unsigned long gen_pool_alloc(struct gen_pool *, size_t);
39 unsigned long (*fp)(struct gen_pool *), 35extern void gen_pool_free(struct gen_pool *, unsigned long, size_t);
40 unsigned long data);
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h
index 652611a4bdcd..e25384561955 100644
--- a/include/linux/generic_serial.h
+++ b/include/linux/generic_serial.h
@@ -12,6 +12,7 @@
12#ifndef GENERIC_SERIAL_H 12#ifndef GENERIC_SERIAL_H
13#define GENERIC_SERIAL_H 13#define GENERIC_SERIAL_H
14 14
15#ifdef __KERNEL__
15#include <linux/mutex.h> 16#include <linux/mutex.h>
16 17
17struct real_driver { 18struct real_driver {
@@ -54,6 +55,7 @@ struct gs_port {
54 spinlock_t driver_lock; 55 spinlock_t driver_lock;
55}; 56};
56 57
58#endif /* __KERNEL__ */
57 59
58/* Flags */ 60/* Flags */
59/* Warning: serial.h defines some ASYNC_ flags, they say they are "only" 61/* Warning: serial.h defines some ASYNC_ flags, they say they are "only"
@@ -75,7 +77,7 @@ struct gs_port {
75#define GS_DEBUG_FLOW 0x00000020 77#define GS_DEBUG_FLOW 0x00000020
76#define GS_DEBUG_WRITE 0x00000040 78#define GS_DEBUG_WRITE 0x00000040
77 79
78 80#ifdef __KERNEL__
79void gs_put_char(struct tty_struct *tty, unsigned char ch); 81void gs_put_char(struct tty_struct *tty, unsigned char ch);
80int gs_write(struct tty_struct *tty, 82int gs_write(struct tty_struct *tty,
81 const unsigned char *buf, int count); 83 const unsigned char *buf, int count);
@@ -94,5 +96,5 @@ int gs_init_port(struct gs_port *port);
94int gs_setserial(struct gs_port *port, struct serial_struct __user *sp); 96int gs_setserial(struct gs_port *port, struct serial_struct __user *sp);
95int gs_getserial(struct gs_port *port, struct serial_struct __user *sp); 97int gs_getserial(struct gs_port *port, struct serial_struct __user *sp);
96void gs_got_break(struct gs_port *port); 98void gs_got_break(struct gs_port *port);
97 99#endif /* __KERNEL__ */
98#endif 100#endif
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 2ef845b35175..3498a0c68184 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -9,13 +9,7 @@
9 * <drew@colorado.edu> 9 * <drew@colorado.edu>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/major.h>
15#include <linux/device.h>
16#include <linux/smp.h>
17#include <linux/string.h>
18#include <linux/fs.h>
19 13
20enum { 14enum {
21/* These three have identical behaviour; use the second one if DOS FDISK gets 15/* These three have identical behaviour; use the second one if DOS FDISK gets
@@ -61,6 +55,12 @@ struct partition {
61#endif 55#endif
62 56
63#ifdef __KERNEL__ 57#ifdef __KERNEL__
58#include <linux/major.h>
59#include <linux/device.h>
60#include <linux/smp.h>
61#include <linux/string.h>
62#include <linux/fs.h>
63
64struct partition { 64struct partition {
65 unsigned char boot_ind; /* 0x80 - active */ 65 unsigned char boot_ind; /* 0x80 - active */
66 unsigned char head; /* starting head */ 66 unsigned char head; /* starting head */
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 3ac452945a7d..cc9e60844484 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -4,7 +4,6 @@
4#include <linux/mmzone.h> 4#include <linux/mmzone.h>
5#include <linux/stddef.h> 5#include <linux/stddef.h>
6#include <linux/linkage.h> 6#include <linux/linkage.h>
7#include <linux/config.h>
8 7
9struct vm_area_struct; 8struct vm_area_struct;
10 9
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index eab537091f2a..114ae583cca9 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -1,7 +1,6 @@
1#ifndef LINUX_HARDIRQ_H 1#ifndef LINUX_HARDIRQ_H
2#define LINUX_HARDIRQ_H 2#define LINUX_HARDIRQ_H
3 3
4#include <linux/config.h>
5#include <linux/preempt.h> 4#include <linux/preempt.h>
6#include <linux/smp_lock.h> 5#include <linux/smp_lock.h>
7#include <asm/hardirq.h> 6#include <asm/hardirq.h>
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index df695e9ae327..4513f9e40937 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -188,7 +188,7 @@ int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr);
188int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); 188int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
189 189
190/* Must be used by hardware driver on module startup/exit */ 190/* Must be used by hardware driver on module startup/exit */
191int register_hdlc_device(struct net_device *dev); 191#define register_hdlc_device(dev) register_netdev(dev)
192void unregister_hdlc_device(struct net_device *dev); 192void unregister_hdlc_device(struct net_device *dev);
193 193
194struct net_device *alloc_hdlcdev(void *priv); 194struct net_device *alloc_hdlcdev(void *priv);
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 892c4ea1b425..85ce7ef9a512 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_HIGHMEM_H 1#ifndef _LINUX_HIGHMEM_H
2#define _LINUX_HIGHMEM_H 2#define _LINUX_HIGHMEM_H
3 3
4#include <linux/config.h>
5#include <linux/fs.h> 4#include <linux/fs.h>
6#include <linux/mm.h> 5#include <linux/mm.h>
7 6
diff --git a/include/linux/highuid.h b/include/linux/highuid.h
index 53ecac3905e8..434e56246f67 100644
--- a/include/linux/highuid.h
+++ b/include/linux/highuid.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_HIGHUID_H 1#ifndef _LINUX_HIGHUID_H
2#define _LINUX_HIGHUID_H 2#define _LINUX_HIGHUID_H
3 3
4#include <linux/config.h>
5#include <linux/types.h> 4#include <linux/types.h>
6 5
7/* 6/*
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 306acf1dc6d5..7d2a1b974c5e 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -127,7 +127,7 @@ extern ktime_t hrtimer_get_next_event(void);
127 127
128static inline int hrtimer_active(const struct hrtimer *timer) 128static inline int hrtimer_active(const struct hrtimer *timer)
129{ 129{
130 return timer->node.rb_parent != HRTIMER_INACTIVE; 130 return rb_parent(&timer->node) != &timer->node;
131} 131}
132 132
133/* Forward a hrtimer so it expires after now: */ 133/* Forward a hrtimer so it expires after now: */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 4c5e610fe442..c25a38d8f600 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -23,6 +23,8 @@ int hugetlb_report_node_meminfo(int, char *);
23unsigned long hugetlb_total_pages(void); 23unsigned long hugetlb_total_pages(void);
24int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, 24int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
25 unsigned long address, int write_access); 25 unsigned long address, int write_access);
26int hugetlb_reserve_pages(struct inode *inode, long from, long to);
27void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
26 28
27extern unsigned long max_huge_pages; 29extern unsigned long max_huge_pages;
28extern const unsigned long hugetlb_zero, hugetlb_infinity; 30extern const unsigned long hugetlb_zero, hugetlb_infinity;
@@ -139,8 +141,6 @@ struct hugetlbfs_sb_info {
139 141
140struct hugetlbfs_inode_info { 142struct hugetlbfs_inode_info {
141 struct shared_policy policy; 143 struct shared_policy policy;
142 /* Protected by the (global) hugetlb_lock */
143 unsigned long prereserved_hpages;
144 struct inode vfs_inode; 144 struct inode vfs_inode;
145}; 145};
146 146
@@ -157,10 +157,6 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
157extern const struct file_operations hugetlbfs_file_operations; 157extern const struct file_operations hugetlbfs_file_operations;
158extern struct vm_operations_struct hugetlb_vm_ops; 158extern struct vm_operations_struct hugetlb_vm_ops;
159struct file *hugetlb_zero_setup(size_t); 159struct file *hugetlb_zero_setup(size_t);
160int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info,
161 unsigned long atleast_hpages);
162void hugetlb_truncate_reservation(struct hugetlbfs_inode_info *info,
163 unsigned long atmost_hpages);
164int hugetlb_get_quota(struct address_space *mapping); 160int hugetlb_get_quota(struct address_space *mapping);
165void hugetlb_put_quota(struct address_space *mapping); 161void hugetlb_put_quota(struct address_space *mapping);
166 162
diff --git a/include/linux/i2c-algo-ite.h b/include/linux/i2c-algo-ite.h
index 26a8b89855f1..0073fe96c76e 100644
--- a/include/linux/i2c-algo-ite.h
+++ b/include/linux/i2c-algo-ite.h
@@ -29,7 +29,7 @@
29#ifndef I2C_ALGO_ITE_H 29#ifndef I2C_ALGO_ITE_H
30#define I2C_ALGO_ITE_H 1 30#define I2C_ALGO_ITE_H 1
31 31
32#include <linux/i2c.h> 32#include <linux/types.h>
33 33
34/* Example of a sequential read request: 34/* Example of a sequential read request:
35 struct i2c_iic_msg s_msg; 35 struct i2c_iic_msg s_msg;
@@ -49,6 +49,9 @@ struct i2c_iic_msg {
49 char *buf; /* pointer to msg data */ 49 char *buf; /* pointer to msg data */
50}; 50};
51 51
52#ifdef __KERNEL__
53struct i2c_adapter;
54
52struct i2c_algo_iic_data { 55struct i2c_algo_iic_data {
53 void *data; /* private data for lolevel routines */ 56 void *data; /* private data for lolevel routines */
54 void (*setiic) (void *data, int ctl, int val); 57 void (*setiic) (void *data, int ctl, int val);
@@ -65,5 +68,5 @@ struct i2c_algo_iic_data {
65 68
66int i2c_iic_add_bus(struct i2c_adapter *); 69int i2c_iic_add_bus(struct i2c_adapter *);
67int i2c_iic_del_bus(struct i2c_adapter *); 70int i2c_iic_del_bus(struct i2c_adapter *);
68 71#endif /* __KERNEL__ */
69#endif /* I2C_ALGO_ITE_H */ 72#endif /* I2C_ALGO_ITE_H */
diff --git a/include/linux/i2c-ocores.h b/include/linux/i2c-ocores.h
new file mode 100644
index 000000000000..8ed591b0887e
--- /dev/null
+++ b/include/linux/i2c-ocores.h
@@ -0,0 +1,19 @@
1/*
2 * i2c-ocores.h - definitions for the i2c-ocores interface
3 *
4 * Peter Korsgaard <jacmet@sunsite.dk>
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11#ifndef _LINUX_I2C_OCORES_H
12#define _LINUX_I2C_OCORES_H
13
14struct ocores_i2c_platform_data {
15 u32 regstep; /* distance between registers */
16 u32 clock_khz; /* input clock in kHz */
17};
18
19#endif /* _LINUX_I2C_OCORES_H */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 1635ee25918f..526ddc8eecfb 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -20,14 +20,15 @@
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ 20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
21/* ------------------------------------------------------------------------- */ 21/* ------------------------------------------------------------------------- */
22 22
23/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and 23/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
24 Frodo Looijaard <frodol@dds.nl> */ 24 Frodo Looijaard <frodol@dds.nl> */
25 25
26#ifndef _LINUX_I2C_H 26#ifndef _LINUX_I2C_H
27#define _LINUX_I2C_H 27#define _LINUX_I2C_H
28 28
29#include <linux/module.h>
30#include <linux/types.h> 29#include <linux/types.h>
30#ifdef __KERNEL__
31#include <linux/module.h>
31#include <linux/i2c-id.h> 32#include <linux/i2c-id.h>
32#include <linux/mod_devicetable.h> 33#include <linux/mod_devicetable.h>
33#include <linux/device.h> /* for struct device */ 34#include <linux/device.h> /* for struct device */
@@ -96,13 +97,13 @@ extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
96 u8 command, u16 value); 97 u8 command, u16 value);
97extern s32 i2c_smbus_write_block_data(struct i2c_client * client, 98extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
98 u8 command, u8 length, 99 u8 command, u8 length,
99 u8 *values); 100 const u8 *values);
100/* Returns the number of read bytes */ 101/* Returns the number of read bytes */
101extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, 102extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
102 u8 command, u8 *values); 103 u8 command, u8 *values);
103extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, 104extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
104 u8 command, u8 length, 105 u8 command, u8 length,
105 u8 *values); 106 const u8 *values);
106 107
107/* 108/*
108 * A driver is capable of handling one or more physical devices present on 109 * A driver is capable of handling one or more physical devices present on
@@ -354,6 +355,7 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
354{ 355{
355 return adap->nr; 356 return adap->nr;
356} 357}
358#endif /* __KERNEL__ */
357 359
358/* 360/*
359 * I2C Message - used for pure i2c transaction, also from /dev interface 361 * I2C Message - used for pure i2c transaction, also from /dev interface
@@ -469,6 +471,7 @@ union i2c_smbus_data {
469#define I2C_SMBUS 0x0720 /* SMBus-level access */ 471#define I2C_SMBUS 0x0720 /* SMBus-level access */
470 472
471/* ----- I2C-DEV: char device interface stuff ------------------------- */ 473/* ----- I2C-DEV: char device interface stuff ------------------------- */
474#ifdef __KERNEL__
472 475
473#define I2C_MAJOR 89 /* Device major number */ 476#define I2C_MAJOR 89 /* Device major number */
474 477
@@ -646,5 +649,5 @@ static unsigned short *forces[] = { force, force_##chip1, \
646 force_##chip6, force_##chip7, \ 649 force_##chip6, force_##chip7, \
647 force_##chip8, NULL }; \ 650 force_##chip8, NULL }; \
648I2C_CLIENT_INSMOD_COMMON 651I2C_CLIENT_INSMOD_COMMON
649 652#endif /* __KERNEL__ */
650#endif /* _LINUX_I2C_H */ 653#endif /* _LINUX_I2C_H */
diff --git a/include/linux/i2o-dev.h b/include/linux/i2o-dev.h
index 36fd18cdad28..c2519df1b6dc 100644
--- a/include/linux/i2o-dev.h
+++ b/include/linux/i2o-dev.h
@@ -13,7 +13,7 @@
13 * This header file defines the I2O APIs that are available to both 13 * This header file defines the I2O APIs that are available to both
14 * the kernel and user level applications. Kernel specific structures 14 * the kernel and user level applications. Kernel specific structures
15 * are defined in i2o_osm. OSMs should include _only_ i2o_osm.h which 15 * are defined in i2o_osm. OSMs should include _only_ i2o_osm.h which
16 * automatically includs this file. 16 * automatically includes this file.
17 * 17 *
18 */ 18 */
19 19
@@ -23,14 +23,7 @@
23/* How many controllers are we allowing */ 23/* How many controllers are we allowing */
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#ifndef __KERNEL__
28
29typedef unsigned char u8;
30typedef unsigned short u16;
31typedef unsigned int u32;
32
33#endif /* __KERNEL__ */
34 27
35/* 28/*
36 * I2O Control IOCTLs and structures 29 * I2O Control IOCTLs and structures
@@ -53,7 +46,7 @@ typedef unsigned int u32;
53 46
54struct i2o_cmd_passthru32 { 47struct i2o_cmd_passthru32 {
55 unsigned int iop; /* IOP unit number */ 48 unsigned int iop; /* IOP unit number */
56 u32 msg; /* message */ 49 __u32 msg; /* message */
57}; 50};
58 51
59struct i2o_cmd_passthru { 52struct i2o_cmd_passthru {
@@ -138,53 +131,53 @@ typedef struct i2o_sg_io_hdr {
138#define I2O_BUS_UNKNOWN 0x80 131#define I2O_BUS_UNKNOWN 0x80
139 132
140typedef struct _i2o_pci_bus { 133typedef struct _i2o_pci_bus {
141 u8 PciFunctionNumber; 134 __u8 PciFunctionNumber;
142 u8 PciDeviceNumber; 135 __u8 PciDeviceNumber;
143 u8 PciBusNumber; 136 __u8 PciBusNumber;
144 u8 reserved; 137 __u8 reserved;
145 u16 PciVendorID; 138 __u16 PciVendorID;
146 u16 PciDeviceID; 139 __u16 PciDeviceID;
147} i2o_pci_bus; 140} i2o_pci_bus;
148 141
149typedef struct _i2o_local_bus { 142typedef struct _i2o_local_bus {
150 u16 LbBaseIOPort; 143 __u16 LbBaseIOPort;
151 u16 reserved; 144 __u16 reserved;
152 u32 LbBaseMemoryAddress; 145 __u32 LbBaseMemoryAddress;
153} i2o_local_bus; 146} i2o_local_bus;
154 147
155typedef struct _i2o_isa_bus { 148typedef struct _i2o_isa_bus {
156 u16 IsaBaseIOPort; 149 __u16 IsaBaseIOPort;
157 u8 CSN; 150 __u8 CSN;
158 u8 reserved; 151 __u8 reserved;
159 u32 IsaBaseMemoryAddress; 152 __u32 IsaBaseMemoryAddress;
160} i2o_isa_bus; 153} i2o_isa_bus;
161 154
162typedef struct _i2o_eisa_bus_info { 155typedef struct _i2o_eisa_bus_info {
163 u16 EisaBaseIOPort; 156 __u16 EisaBaseIOPort;
164 u8 reserved; 157 __u8 reserved;
165 u8 EisaSlotNumber; 158 __u8 EisaSlotNumber;
166 u32 EisaBaseMemoryAddress; 159 __u32 EisaBaseMemoryAddress;
167} i2o_eisa_bus; 160} i2o_eisa_bus;
168 161
169typedef struct _i2o_mca_bus { 162typedef struct _i2o_mca_bus {
170 u16 McaBaseIOPort; 163 __u16 McaBaseIOPort;
171 u8 reserved; 164 __u8 reserved;
172 u8 McaSlotNumber; 165 __u8 McaSlotNumber;
173 u32 McaBaseMemoryAddress; 166 __u32 McaBaseMemoryAddress;
174} i2o_mca_bus; 167} i2o_mca_bus;
175 168
176typedef struct _i2o_other_bus { 169typedef struct _i2o_other_bus {
177 u16 BaseIOPort; 170 __u16 BaseIOPort;
178 u16 reserved; 171 __u16 reserved;
179 u32 BaseMemoryAddress; 172 __u32 BaseMemoryAddress;
180} i2o_other_bus; 173} i2o_other_bus;
181 174
182typedef struct _i2o_hrt_entry { 175typedef struct _i2o_hrt_entry {
183 u32 adapter_id; 176 __u32 adapter_id;
184 u32 parent_tid:12; 177 __u32 parent_tid:12;
185 u32 state:4; 178 __u32 state:4;
186 u32 bus_num:8; 179 __u32 bus_num:8;
187 u32 bus_type:8; 180 __u32 bus_type:8;
188 union { 181 union {
189 i2o_pci_bus pci_bus; 182 i2o_pci_bus pci_bus;
190 i2o_local_bus local_bus; 183 i2o_local_bus local_bus;
@@ -196,66 +189,66 @@ typedef struct _i2o_hrt_entry {
196} i2o_hrt_entry; 189} i2o_hrt_entry;
197 190
198typedef struct _i2o_hrt { 191typedef struct _i2o_hrt {
199 u16 num_entries; 192 __u16 num_entries;
200 u8 entry_len; 193 __u8 entry_len;
201 u8 hrt_version; 194 __u8 hrt_version;
202 u32 change_ind; 195 __u32 change_ind;
203 i2o_hrt_entry hrt_entry[1]; 196 i2o_hrt_entry hrt_entry[1];
204} i2o_hrt; 197} i2o_hrt;
205 198
206typedef struct _i2o_lct_entry { 199typedef struct _i2o_lct_entry {
207 u32 entry_size:16; 200 __u32 entry_size:16;
208 u32 tid:12; 201 __u32 tid:12;
209 u32 reserved:4; 202 __u32 reserved:4;
210 u32 change_ind; 203 __u32 change_ind;
211 u32 device_flags; 204 __u32 device_flags;
212 u32 class_id:12; 205 __u32 class_id:12;
213 u32 version:4; 206 __u32 version:4;
214 u32 vendor_id:16; 207 __u32 vendor_id:16;
215 u32 sub_class; 208 __u32 sub_class;
216 u32 user_tid:12; 209 __u32 user_tid:12;
217 u32 parent_tid:12; 210 __u32 parent_tid:12;
218 u32 bios_info:8; 211 __u32 bios_info:8;
219 u8 identity_tag[8]; 212 __u8 identity_tag[8];
220 u32 event_capabilities; 213 __u32 event_capabilities;
221} i2o_lct_entry; 214} i2o_lct_entry;
222 215
223typedef struct _i2o_lct { 216typedef struct _i2o_lct {
224 u32 table_size:16; 217 __u32 table_size:16;
225 u32 boot_tid:12; 218 __u32 boot_tid:12;
226 u32 lct_ver:4; 219 __u32 lct_ver:4;
227 u32 iop_flags; 220 __u32 iop_flags;
228 u32 change_ind; 221 __u32 change_ind;
229 i2o_lct_entry lct_entry[1]; 222 i2o_lct_entry lct_entry[1];
230} i2o_lct; 223} i2o_lct;
231 224
232typedef struct _i2o_status_block { 225typedef struct _i2o_status_block {
233 u16 org_id; 226 __u16 org_id;
234 u16 reserved; 227 __u16 reserved;
235 u16 iop_id:12; 228 __u16 iop_id:12;
236 u16 reserved1:4; 229 __u16 reserved1:4;
237 u16 host_unit_id; 230 __u16 host_unit_id;
238 u16 segment_number:12; 231 __u16 segment_number:12;
239 u16 i2o_version:4; 232 __u16 i2o_version:4;
240 u8 iop_state; 233 __u8 iop_state;
241 u8 msg_type; 234 __u8 msg_type;
242 u16 inbound_frame_size; 235 __u16 inbound_frame_size;
243 u8 init_code; 236 __u8 init_code;
244 u8 reserved2; 237 __u8 reserved2;
245 u32 max_inbound_frames; 238 __u32 max_inbound_frames;
246 u32 cur_inbound_frames; 239 __u32 cur_inbound_frames;
247 u32 max_outbound_frames; 240 __u32 max_outbound_frames;
248 char product_id[24]; 241 char product_id[24];
249 u32 expected_lct_size; 242 __u32 expected_lct_size;
250 u32 iop_capabilities; 243 __u32 iop_capabilities;
251 u32 desired_mem_size; 244 __u32 desired_mem_size;
252 u32 current_mem_size; 245 __u32 current_mem_size;
253 u32 current_mem_base; 246 __u32 current_mem_base;
254 u32 desired_io_size; 247 __u32 desired_io_size;
255 u32 current_io_size; 248 __u32 current_io_size;
256 u32 current_io_base; 249 __u32 current_io_base;
257 u32 reserved3:24; 250 __u32 reserved3:24;
258 u32 cmd_status:8; 251 __u32 cmd_status:8;
259} i2o_status_block; 252} i2o_status_block;
260 253
261/* Event indicator mask flags */ 254/* Event indicator mask flags */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index a8bef1d1371c..77e66d055f5b 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -6,7 +6,6 @@
6 * Copyright (C) 1994-2002 Linus Torvalds & authors 6 * Copyright (C) 1994-2002 Linus Torvalds & authors
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/init.h> 9#include <linux/init.h>
11#include <linux/ioport.h> 10#include <linux/ioport.h>
12#include <linux/hdreg.h> 11#include <linux/hdreg.h>
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h
index 1288a161bc0b..e0a150046208 100644
--- a/include/linux/if_fddi.h
+++ b/include/linux/if_fddi.h
@@ -102,6 +102,7 @@ struct fddihdr
102 } hdr; 102 } hdr;
103 } __attribute__ ((packed)); 103 } __attribute__ ((packed));
104 104
105#ifdef __KERNEL__
105/* Define FDDI statistics structure */ 106/* Define FDDI statistics structure */
106struct fddi_statistics { 107struct fddi_statistics {
107 108
@@ -193,5 +194,6 @@ struct fddi_statistics {
193 __u32 port_ler_flag[2]; 194 __u32 port_ler_flag[2];
194 __u32 port_hardware_present[2]; 195 __u32 port_hardware_present[2];
195 }; 196 };
197#endif /* __KERNEL__ */
196 198
197#endif /* _LINUX_IF_FDDI_H */ 199#endif /* _LINUX_IF_FDDI_H */
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h
index 395f0aad9cbf..f272a80caa3e 100644
--- a/include/linux/if_frad.h
+++ b/include/linux/if_frad.h
@@ -24,7 +24,6 @@
24#ifndef _FRAD_H_ 24#ifndef _FRAD_H_
25#define _FRAD_H_ 25#define _FRAD_H_
26 26
27#include <linux/config.h>
28#include <linux/if.h> 27#include <linux/if.h>
29 28
30#if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE) 29#if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE)
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h
index 5502f597cf0e..2f94cf2c7abb 100644
--- a/include/linux/if_tr.h
+++ b/include/linux/if_tr.h
@@ -43,7 +43,6 @@ struct trh_hdr {
43}; 43};
44 44
45#ifdef __KERNEL__ 45#ifdef __KERNEL__
46#include <linux/config.h>
47#include <linux/skbuff.h> 46#include <linux/skbuff.h>
48 47
49static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb) 48static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb)
diff --git a/include/linux/init.h b/include/linux/init.h
index 93dcbe1abb4c..6667785dd1ff 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_INIT_H 1#ifndef _LINUX_INIT_H
2#define _LINUX_INIT_H 2#define _LINUX_INIT_H
3 3
4#include <linux/config.h>
5#include <linux/compiler.h> 4#include <linux/compiler.h>
6 5
7/* These macros are used to mark some functions or 6/* These macros are used to mark some functions or
diff --git a/include/linux/inotify.h b/include/linux/inotify.h
index 09e00433c78e..d4f48c6402e6 100644
--- a/include/linux/inotify.h
+++ b/include/linux/inotify.h
@@ -67,20 +67,66 @@ struct inotify_event {
67 67
68#include <linux/dcache.h> 68#include <linux/dcache.h>
69#include <linux/fs.h> 69#include <linux/fs.h>
70#include <linux/config.h> 70
71/*
72 * struct inotify_watch - represents a watch request on a specific inode
73 *
74 * h_list is protected by ih->mutex of the associated inotify_handle.
75 * i_list, mask are protected by inode->inotify_mutex of the associated inode.
76 * ih, inode, and wd are never written to once the watch is created.
77 *
78 * Callers must use the established inotify interfaces to access inotify_watch
79 * contents. The content of this structure is private to the inotify
80 * implementation.
81 */
82struct inotify_watch {
83 struct list_head h_list; /* entry in inotify_handle's list */
84 struct list_head i_list; /* entry in inode's list */
85 atomic_t count; /* reference count */
86 struct inotify_handle *ih; /* associated inotify handle */
87 struct inode *inode; /* associated inode */
88 __s32 wd; /* watch descriptor */
89 __u32 mask; /* event mask for this watch */
90};
91
92struct inotify_operations {
93 void (*handle_event)(struct inotify_watch *, u32, u32, u32,
94 const char *, struct inode *);
95 void (*destroy_watch)(struct inotify_watch *);
96};
71 97
72#ifdef CONFIG_INOTIFY 98#ifdef CONFIG_INOTIFY
73 99
100/* Kernel API for producing events */
101
74extern void inotify_d_instantiate(struct dentry *, struct inode *); 102extern void inotify_d_instantiate(struct dentry *, struct inode *);
75extern void inotify_d_move(struct dentry *); 103extern void inotify_d_move(struct dentry *);
76extern void inotify_inode_queue_event(struct inode *, __u32, __u32, 104extern void inotify_inode_queue_event(struct inode *, __u32, __u32,
77 const char *); 105 const char *, struct inode *);
78extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32, 106extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32,
79 const char *); 107 const char *);
80extern void inotify_unmount_inodes(struct list_head *); 108extern void inotify_unmount_inodes(struct list_head *);
81extern void inotify_inode_is_dead(struct inode *); 109extern void inotify_inode_is_dead(struct inode *);
82extern u32 inotify_get_cookie(void); 110extern u32 inotify_get_cookie(void);
83 111
112/* Kernel Consumer API */
113
114extern struct inotify_handle *inotify_init(const struct inotify_operations *);
115extern void inotify_init_watch(struct inotify_watch *);
116extern void inotify_destroy(struct inotify_handle *);
117extern __s32 inotify_find_watch(struct inotify_handle *, struct inode *,
118 struct inotify_watch **);
119extern __s32 inotify_find_update_watch(struct inotify_handle *, struct inode *,
120 u32);
121extern __s32 inotify_add_watch(struct inotify_handle *, struct inotify_watch *,
122 struct inode *, __u32);
123extern int inotify_rm_watch(struct inotify_handle *, struct inotify_watch *);
124extern int inotify_rm_wd(struct inotify_handle *, __u32);
125extern void inotify_remove_watch_locked(struct inotify_handle *,
126 struct inotify_watch *);
127extern void get_inotify_watch(struct inotify_watch *);
128extern void put_inotify_watch(struct inotify_watch *);
129
84#else 130#else
85 131
86static inline void inotify_d_instantiate(struct dentry *dentry, 132static inline void inotify_d_instantiate(struct dentry *dentry,
@@ -94,7 +140,8 @@ static inline void inotify_d_move(struct dentry *dentry)
94 140
95static inline void inotify_inode_queue_event(struct inode *inode, 141static inline void inotify_inode_queue_event(struct inode *inode,
96 __u32 mask, __u32 cookie, 142 __u32 mask, __u32 cookie,
97 const char *filename) 143 const char *filename,
144 struct inode *n_inode)
98{ 145{
99} 146}
100 147
@@ -117,6 +164,62 @@ static inline u32 inotify_get_cookie(void)
117 return 0; 164 return 0;
118} 165}
119 166
167static inline struct inotify_handle *inotify_init(const struct inotify_operations *ops)
168{
169 return ERR_PTR(-EOPNOTSUPP);
170}
171
172static inline void inotify_init_watch(struct inotify_watch *watch)
173{
174}
175
176static inline void inotify_destroy(struct inotify_handle *ih)
177{
178}
179
180static inline __s32 inotify_find_watch(struct inotify_handle *ih, struct inode *inode,
181 struct inotify_watch **watchp)
182{
183 return -EOPNOTSUPP;
184}
185
186static inline __s32 inotify_find_update_watch(struct inotify_handle *ih,
187 struct inode *inode, u32 mask)
188{
189 return -EOPNOTSUPP;
190}
191
192static inline __s32 inotify_add_watch(struct inotify_handle *ih,
193 struct inotify_watch *watch,
194 struct inode *inode, __u32 mask)
195{
196 return -EOPNOTSUPP;
197}
198
199static inline int inotify_rm_watch(struct inotify_handle *ih,
200 struct inotify_watch *watch)
201{
202 return -EOPNOTSUPP;
203}
204
205static inline int inotify_rm_wd(struct inotify_handle *ih, __u32 wd)
206{
207 return -EOPNOTSUPP;
208}
209
210static inline void inotify_remove_watch_locked(struct inotify_handle *ih,
211 struct inotify_watch *watch)
212{
213}
214
215static inline void get_inotify_watch(struct inotify_watch *watch)
216{
217}
218
219static inline void put_inotify_watch(struct inotify_watch *watch)
220{
221}
222
120#endif /* CONFIG_INOTIFY */ 223#endif /* CONFIG_INOTIFY */
121 224
122#endif /* __KERNEL __ */ 225#endif /* __KERNEL __ */
diff --git a/include/linux/input.h b/include/linux/input.h
index ce1a756c4c30..b32c2b6e53f6 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -15,6 +15,7 @@
15#else 15#else
16#include <sys/time.h> 16#include <sys/time.h>
17#include <sys/ioctl.h> 17#include <sys/ioctl.h>
18#include <sys/types.h>
18#include <asm/types.h> 19#include <asm/types.h>
19#endif 20#endif
20 21
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 2c08fdc2bdf7..70741e170114 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -2,38 +2,18 @@
2#ifndef _LINUX_INTERRUPT_H 2#ifndef _LINUX_INTERRUPT_H
3#define _LINUX_INTERRUPT_H 3#define _LINUX_INTERRUPT_H
4 4
5#include <linux/config.h>
6#include <linux/kernel.h> 5#include <linux/kernel.h>
7#include <linux/linkage.h> 6#include <linux/linkage.h>
8#include <linux/bitops.h> 7#include <linux/bitops.h>
9#include <linux/preempt.h> 8#include <linux/preempt.h>
10#include <linux/cpumask.h> 9#include <linux/cpumask.h>
10#include <linux/irqreturn.h>
11#include <linux/hardirq.h> 11#include <linux/hardirq.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <asm/atomic.h> 13#include <asm/atomic.h>
14#include <asm/ptrace.h> 14#include <asm/ptrace.h>
15#include <asm/system.h> 15#include <asm/system.h>
16 16
17/*
18 * For 2.4.x compatibility, 2.4.x can use
19 *
20 * typedef void irqreturn_t;
21 * #define IRQ_NONE
22 * #define IRQ_HANDLED
23 * #define IRQ_RETVAL(x)
24 *
25 * To mix old-style and new-style irq handler returns.
26 *
27 * IRQ_NONE means we didn't handle it.
28 * IRQ_HANDLED means that we did have a valid interrupt and handled it.
29 * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled)
30 */
31typedef int irqreturn_t;
32
33#define IRQ_NONE (0)
34#define IRQ_HANDLED (1)
35#define IRQ_RETVAL(x) ((x) != 0)
36
37struct irqaction { 17struct irqaction {
38 irqreturn_t (*handler)(int, void *, struct pt_regs *); 18 irqreturn_t (*handler)(int, void *, struct pt_regs *);
39 unsigned long flags; 19 unsigned long flags;
diff --git a/include/linux/io.h b/include/linux/io.h
index 85533ec5aaa1..420e2fdf26f6 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -21,5 +21,6 @@
21#include <asm/io.h> 21#include <asm/io.h>
22 22
23void __iowrite32_copy(void __iomem *to, const void *from, size_t count); 23void __iowrite32_copy(void __iomem *to, const void *from, size_t count);
24void __iowrite64_copy(void __iomem *to, const void *from, size_t count);
24 25
25#endif /* _LINUX_IO_H */ 26#endif /* _LINUX_IO_H */
diff --git a/include/linux/ioc4.h b/include/linux/ioc4.h
index 3dd18b785ebd..de73a3289cc2 100644
--- a/include/linux/ioc4.h
+++ b/include/linux/ioc4.h
@@ -147,6 +147,10 @@ struct ioc4_misc_regs {
147#define IOC4_GPCR_EDGE_6 0x40 147#define IOC4_GPCR_EDGE_6 0x40
148#define IOC4_GPCR_EDGE_7 0x80 148#define IOC4_GPCR_EDGE_7 0x80
149 149
150#define IOC4_VARIANT_IO9 0x0900
151#define IOC4_VARIANT_PCI_RT 0x0901
152#define IOC4_VARIANT_IO10 0x1000
153
150/* One of these per IOC4 */ 154/* One of these per IOC4 */
151struct ioc4_driver_data { 155struct ioc4_driver_data {
152 struct list_head idd_list; 156 struct list_head idd_list;
@@ -156,6 +160,7 @@ struct ioc4_driver_data {
156 struct __iomem ioc4_misc_regs *idd_misc_regs; 160 struct __iomem ioc4_misc_regs *idd_misc_regs;
157 unsigned long count_period; 161 unsigned long count_period;
158 void *idd_serial_data; 162 void *idd_serial_data;
163 unsigned int idd_variant;
159}; 164};
160 165
161/* One per submodule */ 166/* One per submodule */
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 0a84b56935c2..5653b2f23b6a 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -36,7 +36,6 @@
36 36
37#include <linux/ipmi_msgdefs.h> 37#include <linux/ipmi_msgdefs.h>
38#include <linux/compiler.h> 38#include <linux/compiler.h>
39#include <linux/device.h>
40 39
41/* 40/*
42 * This file describes an interface to an IPMI driver. You have to 41 * This file describes an interface to an IPMI driver. You have to
@@ -210,6 +209,7 @@ struct kernel_ipmi_msg
210 */ 209 */
211#include <linux/list.h> 210#include <linux/list.h>
212#include <linux/module.h> 211#include <linux/module.h>
212#include <linux/device.h>
213 213
214#ifdef CONFIG_PROC_FS 214#ifdef CONFIG_PROC_FS
215#include <linux/proc_fs.h> 215#include <linux/proc_fs.h>
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 1263d8cb3c18..297853c841b4 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -1,7 +1,6 @@
1#ifndef _IPV6_H 1#ifndef _IPV6_H
2#define _IPV6_H 2#define _IPV6_H
3 3
4#include <linux/config.h>
5#include <linux/in6.h> 4#include <linux/in6.h>
6#include <asm/byteorder.h> 5#include <asm/byteorder.h>
7 6
diff --git a/include/linux/irq.h b/include/linux/irq.h
index ee2a82a572f7..676e00dfb21a 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -9,7 +9,6 @@
9 * Thanks. --rmk 9 * Thanks. --rmk
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/smp.h> 12#include <linux/smp.h>
14 13
15#if !defined(CONFIG_S390) 14#if !defined(CONFIG_S390)
@@ -18,6 +17,7 @@
18#include <linux/cache.h> 17#include <linux/cache.h>
19#include <linux/spinlock.h> 18#include <linux/spinlock.h>
20#include <linux/cpumask.h> 19#include <linux/cpumask.h>
20#include <linux/irqreturn.h>
21 21
22#include <asm/irq.h> 22#include <asm/irq.h>
23#include <asm/ptrace.h> 23#include <asm/ptrace.h>
@@ -165,10 +165,18 @@ static inline void set_irq_info(int irq, cpumask_t mask)
165 165
166#endif // CONFIG_SMP 166#endif // CONFIG_SMP
167 167
168#ifdef CONFIG_IRQBALANCE
169extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask);
170#else
171static inline void set_balance_irq_affinity(unsigned int irq, cpumask_t mask)
172{
173}
174#endif
175
168extern int no_irq_affinity; 176extern int no_irq_affinity;
169extern int noirqdebug_setup(char *str); 177extern int noirqdebug_setup(char *str);
170 178
171extern fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs, 179extern fastcall irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
172 struct irqaction *action); 180 struct irqaction *action);
173extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); 181extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
174extern void note_interrupt(unsigned int irq, irq_desc_t *desc, 182extern void note_interrupt(unsigned int irq, irq_desc_t *desc,
diff --git a/include/linux/irq_cpustat.h b/include/linux/irq_cpustat.h
index af93505ec2ec..77e4bac29287 100644
--- a/include/linux/irq_cpustat.h
+++ b/include/linux/irq_cpustat.h
@@ -9,7 +9,6 @@
9 * Keith Owens <kaos@ocs.com.au> July 2000. 9 * Keith Owens <kaos@ocs.com.au> July 2000.
10 */ 10 */
11 11
12#include <linux/config.h>
13 12
14/* 13/*
15 * Simple wrappers reducing source bloat. Define all irq_stat fields 14 * Simple wrappers reducing source bloat. Define all irq_stat fields
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h
new file mode 100644
index 000000000000..881883c2009d
--- /dev/null
+++ b/include/linux/irqreturn.h
@@ -0,0 +1,25 @@
1/* irqreturn.h */
2#ifndef _LINUX_IRQRETURN_H
3#define _LINUX_IRQRETURN_H
4
5/*
6 * For 2.4.x compatibility, 2.4.x can use
7 *
8 * typedef void irqreturn_t;
9 * #define IRQ_NONE
10 * #define IRQ_HANDLED
11 * #define IRQ_RETVAL(x)
12 *
13 * To mix old-style and new-style irq handler returns.
14 *
15 * IRQ_NONE means we didn't handle it.
16 * IRQ_HANDLED means that we did have a valid interrupt and handled it.
17 * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled)
18 */
19typedef int irqreturn_t;
20
21#define IRQ_NONE (0)
22#define IRQ_HANDLED (1)
23#define IRQ_RETVAL(x) ((x) != 0)
24
25#endif
diff --git a/include/linux/isa.h b/include/linux/isa.h
new file mode 100644
index 000000000000..1b855335cb11
--- /dev/null
+++ b/include/linux/isa.h
@@ -0,0 +1,28 @@
1/*
2 * ISA bus.
3 */
4
5#ifndef __LINUX_ISA_H
6#define __LINUX_ISA_H
7
8#include <linux/device.h>
9#include <linux/kernel.h>
10
11struct isa_driver {
12 int (*match)(struct device *, unsigned int);
13 int (*probe)(struct device *, unsigned int);
14 int (*remove)(struct device *, unsigned int);
15 void (*shutdown)(struct device *, unsigned int);
16 int (*suspend)(struct device *, unsigned int, pm_message_t);
17 int (*resume)(struct device *, unsigned int);
18
19 struct device_driver driver;
20 struct device *devices;
21};
22
23#define to_isa_driver(x) container_of((x), struct isa_driver, driver)
24
25int isa_register_driver(struct isa_driver *, unsigned int);
26void isa_unregister_driver(struct isa_driver *);
27
28#endif /* __LINUX_ISA_H */
diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h
index 26c64c286f42..1e8728a9ee8a 100644
--- a/include/linux/isapnp.h
+++ b/include/linux/isapnp.h
@@ -22,7 +22,6 @@
22#ifndef LINUX_ISAPNP_H 22#ifndef LINUX_ISAPNP_H
23#define LINUX_ISAPNP_H 23#define LINUX_ISAPNP_H
24 24
25#include <linux/config.h>
26#include <linux/errno.h> 25#include <linux/errno.h>
27#include <linux/pnp.h> 26#include <linux/pnp.h>
28 27
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 53eaee96065b..62991148d5a5 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -146,7 +146,6 @@ typedef struct {
146 146
147#ifdef __KERNEL__ 147#ifdef __KERNEL__
148 148
149#include <linux/config.h>
150#include <linux/errno.h> 149#include <linux/errno.h>
151#include <linux/fs.h> 150#include <linux/fs.h>
152#include <linux/major.h> 151#include <linux/major.h>
diff --git a/include/linux/isdn/tpam.h b/include/linux/isdn/tpam.h
index 9f65bea49d11..d18dd0dc570d 100644
--- a/include/linux/isdn/tpam.h
+++ b/include/linux/isdn/tpam.h
@@ -26,7 +26,6 @@
26#define _TPAM_H_ 26#define _TPAM_H_
27 27
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/pci.h>
30 29
31/* IOCTL commands */ 30/* IOCTL commands */
32#define TPAM_CMD_DSPLOAD 0x0001 31#define TPAM_CMD_DSPLOAD 0x0001
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h
index 26b00a76e135..8687a7dc0632 100644
--- a/include/linux/isdn_ppp.h
+++ b/include/linux/isdn_ppp.h
@@ -67,7 +67,6 @@ struct isdn_ppp_comp_data {
67#ifdef __KERNEL__ 67#ifdef __KERNEL__
68 68
69 69
70#include <linux/config.h>
71 70
72#ifdef CONFIG_IPPP_FILTER 71#ifdef CONFIG_IPPP_FILTER
73#include <linux/filter.h> 72#include <linux/filter.h>
diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h
index 04e10f9f14f8..b9b5a684ed69 100644
--- a/include/linux/isdnif.h
+++ b/include/linux/isdnif.h
@@ -54,7 +54,6 @@
54 54
55#ifdef __KERNEL__ 55#ifdef __KERNEL__
56 56
57#include <linux/config.h>
58#include <linux/skbuff.h> 57#include <linux/skbuff.h>
59 58
60/***************************************************************************/ 59/***************************************************************************/
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 6a425e370cb3..20eb34403d0c 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -501,6 +501,12 @@ struct transaction_s
501 struct journal_head *t_checkpoint_list; 501 struct journal_head *t_checkpoint_list;
502 502
503 /* 503 /*
504 * Doubly-linked circular list of all buffers submitted for IO while
505 * checkpointing. [j_list_lock]
506 */
507 struct journal_head *t_checkpoint_io_list;
508
509 /*
504 * Doubly-linked circular list of temporary buffers currently undergoing 510 * Doubly-linked circular list of temporary buffers currently undergoing
505 * IO in the log [j_list_lock] 511 * IO in the log [j_list_lock]
506 */ 512 */
@@ -849,7 +855,7 @@ extern void journal_commit_transaction(journal_t *);
849 855
850/* Checkpoint list management */ 856/* Checkpoint list management */
851int __journal_clean_checkpoint_list(journal_t *journal); 857int __journal_clean_checkpoint_list(journal_t *journal);
852void __journal_remove_checkpoint(struct journal_head *); 858int __journal_remove_checkpoint(struct journal_head *);
853void __journal_insert_checkpoint(struct journal_head *, transaction_t *); 859void __journal_insert_checkpoint(struct journal_head *, transaction_t *);
854 860
855/* Buffer IO */ 861/* Buffer IO */
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
index cf792bb3c726..c6f70660b371 100644
--- a/include/linux/jffs2.h
+++ b/include/linux/jffs2.h
@@ -65,6 +65,18 @@
65 65
66#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6) 66#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
67 67
68#define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8)
69#define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9)
70
71/* XATTR Related */
72#define JFFS2_XPREFIX_USER 1 /* for "user." */
73#define JFFS2_XPREFIX_SECURITY 2 /* for "security." */
74#define JFFS2_XPREFIX_ACL_ACCESS 3 /* for "system.posix_acl_access" */
75#define JFFS2_XPREFIX_ACL_DEFAULT 4 /* for "system.posix_acl_default" */
76#define JFFS2_XPREFIX_TRUSTED 5 /* for "trusted.*" */
77
78#define JFFS2_ACL_VERSION 0x0001
79
68// Maybe later... 80// Maybe later...
69//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) 81//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
70//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) 82//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
@@ -82,11 +94,11 @@
82 94
83typedef struct { 95typedef struct {
84 uint32_t v32; 96 uint32_t v32;
85} __attribute__((packed)) jint32_t; 97} __attribute__((packed)) jint32_t;
86 98
87typedef struct { 99typedef struct {
88 uint32_t m; 100 uint32_t m;
89} __attribute__((packed)) jmode_t; 101} __attribute__((packed)) jmode_t;
90 102
91typedef struct { 103typedef struct {
92 uint16_t v16; 104 uint16_t v16;
@@ -99,7 +111,7 @@ struct jffs2_unknown_node
99 jint16_t nodetype; 111 jint16_t nodetype;
100 jint32_t totlen; /* So we can skip over nodes we don't grok */ 112 jint32_t totlen; /* So we can skip over nodes we don't grok */
101 jint32_t hdr_crc; 113 jint32_t hdr_crc;
102} __attribute__((packed)); 114};
103 115
104struct jffs2_raw_dirent 116struct jffs2_raw_dirent
105{ 117{
@@ -117,7 +129,7 @@ struct jffs2_raw_dirent
117 jint32_t node_crc; 129 jint32_t node_crc;
118 jint32_t name_crc; 130 jint32_t name_crc;
119 uint8_t name[0]; 131 uint8_t name[0];
120} __attribute__((packed)); 132};
121 133
122/* The JFFS2 raw inode structure: Used for storage on physical media. */ 134/* The JFFS2 raw inode structure: Used for storage on physical media. */
123/* The uid, gid, atime, mtime and ctime members could be longer, but 135/* The uid, gid, atime, mtime and ctime members could be longer, but
@@ -149,6 +161,32 @@ struct jffs2_raw_inode
149 jint32_t data_crc; /* CRC for the (compressed) data. */ 161 jint32_t data_crc; /* CRC for the (compressed) data. */
150 jint32_t node_crc; /* CRC for the raw inode (excluding data) */ 162 jint32_t node_crc; /* CRC for the raw inode (excluding data) */
151 uint8_t data[0]; 163 uint8_t data[0];
164};
165
166struct jffs2_raw_xattr {
167 jint16_t magic;
168 jint16_t nodetype; /* = JFFS2_NODETYPE_XATTR */
169 jint32_t totlen;
170 jint32_t hdr_crc;
171 jint32_t xid; /* XATTR identifier number */
172 jint32_t version;
173 uint8_t xprefix;
174 uint8_t name_len;
175 jint16_t value_len;
176 jint32_t data_crc;
177 jint32_t node_crc;
178 uint8_t data[0];
179} __attribute__((packed));
180
181struct jffs2_raw_xref
182{
183 jint16_t magic;
184 jint16_t nodetype; /* = JFFS2_NODETYPE_XREF */
185 jint32_t totlen;
186 jint32_t hdr_crc;
187 jint32_t ino; /* inode number */
188 jint32_t xid; /* XATTR identifier number */
189 jint32_t node_crc;
152} __attribute__((packed)); 190} __attribute__((packed));
153 191
154struct jffs2_raw_summary 192struct jffs2_raw_summary
@@ -163,14 +201,22 @@ struct jffs2_raw_summary
163 jint32_t sum_crc; /* summary information crc */ 201 jint32_t sum_crc; /* summary information crc */
164 jint32_t node_crc; /* node crc */ 202 jint32_t node_crc; /* node crc */
165 jint32_t sum[0]; /* inode summary info */ 203 jint32_t sum[0]; /* inode summary info */
166} __attribute__((packed)); 204};
167 205
168union jffs2_node_union 206union jffs2_node_union
169{ 207{
170 struct jffs2_raw_inode i; 208 struct jffs2_raw_inode i;
171 struct jffs2_raw_dirent d; 209 struct jffs2_raw_dirent d;
210 struct jffs2_raw_xattr x;
211 struct jffs2_raw_xref r;
172 struct jffs2_raw_summary s; 212 struct jffs2_raw_summary s;
173 struct jffs2_unknown_node u; 213 struct jffs2_unknown_node u;
174}; 214};
175 215
216/* Data payload for device nodes. */
217union jffs2_device_node {
218 jint16_t old;
219 jint32_t new;
220};
221
176#endif /* __LINUX_JFFS2_H__ */ 222#endif /* __LINUX_JFFS2_H__ */
diff --git a/include/linux/jffs2_fs_i.h b/include/linux/jffs2_fs_i.h
deleted file mode 100644
index ad565bf9dcc1..000000000000
--- a/include/linux/jffs2_fs_i.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/* $Id: jffs2_fs_i.h,v 1.19 2005/11/07 11:14:52 gleixner Exp $ */
2
3#ifndef _JFFS2_FS_I
4#define _JFFS2_FS_I
5
6#include <linux/version.h>
7#include <linux/rbtree.h>
8#include <asm/semaphore.h>
9
10struct jffs2_inode_info {
11 /* We need an internal mutex similar to inode->i_mutex.
12 Unfortunately, we can't used the existing one, because
13 either the GC would deadlock, or we'd have to release it
14 before letting GC proceed. Or we'd have to put ugliness
15 into the GC code so it didn't attempt to obtain the i_mutex
16 for the inode(s) which are already locked */
17 struct semaphore sem;
18
19 /* The highest (datanode) version number used for this ino */
20 uint32_t highest_version;
21
22 /* List of data fragments which make up the file */
23 struct rb_root fragtree;
24
25 /* There may be one datanode which isn't referenced by any of the
26 above fragments, if it contains a metadata update but no actual
27 data - or if this is a directory inode */
28 /* This also holds the _only_ dnode for symlinks/device nodes,
29 etc. */
30 struct jffs2_full_dnode *metadata;
31
32 /* Directory entries */
33 struct jffs2_full_dirent *dents;
34
35 /* The target path if this is the inode of a symlink */
36 unsigned char *target;
37
38 /* Some stuff we just have to keep in-core at all times, for each inode. */
39 struct jffs2_inode_cache *inocache;
40
41 uint16_t flags;
42 uint8_t usercompr;
43#if !defined (__ECOS)
44#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)
45 struct inode vfs_inode;
46#endif
47#endif
48};
49
50#endif /* _JFFS2_FS_I */
diff --git a/include/linux/jffs2_fs_sb.h b/include/linux/jffs2_fs_sb.h
deleted file mode 100644
index 4bcfb5570221..000000000000
--- a/include/linux/jffs2_fs_sb.h
+++ /dev/null
@@ -1,122 +0,0 @@
1/* $Id: jffs2_fs_sb.h,v 1.54 2005/09/21 13:37:34 dedekind Exp $ */
2
3#ifndef _JFFS2_FS_SB
4#define _JFFS2_FS_SB
5
6#include <linux/types.h>
7#include <linux/spinlock.h>
8#include <linux/workqueue.h>
9#include <linux/completion.h>
10#include <asm/semaphore.h>
11#include <linux/timer.h>
12#include <linux/wait.h>
13#include <linux/list.h>
14#include <linux/rwsem.h>
15
16#define JFFS2_SB_FLAG_RO 1
17#define JFFS2_SB_FLAG_SCANNING 2 /* Flash scanning is in progress */
18#define JFFS2_SB_FLAG_BUILDING 4 /* File system building is in progress */
19
20struct jffs2_inodirty;
21
22/* A struct for the overall file system control. Pointers to
23 jffs2_sb_info structs are named `c' in the source code.
24 Nee jffs_control
25*/
26struct jffs2_sb_info {
27 struct mtd_info *mtd;
28
29 uint32_t highest_ino;
30 uint32_t checked_ino;
31
32 unsigned int flags;
33
34 struct task_struct *gc_task; /* GC task struct */
35 struct completion gc_thread_start; /* GC thread start completion */
36 struct completion gc_thread_exit; /* GC thread exit completion port */
37
38 struct semaphore alloc_sem; /* Used to protect all the following
39 fields, and also to protect against
40 out-of-order writing of nodes. And GC. */
41 uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER
42 (i.e. zero for OOB CLEANMARKER */
43
44 uint32_t flash_size;
45 uint32_t used_size;
46 uint32_t dirty_size;
47 uint32_t wasted_size;
48 uint32_t free_size;
49 uint32_t erasing_size;
50 uint32_t bad_size;
51 uint32_t sector_size;
52 uint32_t unchecked_size;
53
54 uint32_t nr_free_blocks;
55 uint32_t nr_erasing_blocks;
56
57 /* Number of free blocks there must be before we... */
58 uint8_t resv_blocks_write; /* ... allow a normal filesystem write */
59 uint8_t resv_blocks_deletion; /* ... allow a normal filesystem deletion */
60 uint8_t resv_blocks_gctrigger; /* ... wake up the GC thread */
61 uint8_t resv_blocks_gcbad; /* ... pick a block from the bad_list to GC */
62 uint8_t resv_blocks_gcmerge; /* ... merge pages when garbage collecting */
63
64 uint32_t nospc_dirty_size;
65
66 uint32_t nr_blocks;
67 struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks
68 * from the offset (blocks[ofs / sector_size]) */
69 struct jffs2_eraseblock *nextblock; /* The block we're currently filling */
70
71 struct jffs2_eraseblock *gcblock; /* The block we're currently garbage-collecting */
72
73 struct list_head clean_list; /* Blocks 100% full of clean data */
74 struct list_head very_dirty_list; /* Blocks with lots of dirty space */
75 struct list_head dirty_list; /* Blocks with some dirty space */
76 struct list_head erasable_list; /* Blocks which are completely dirty, and need erasing */
77 struct list_head erasable_pending_wbuf_list; /* Blocks which need erasing but only after the current wbuf is flushed */
78 struct list_head erasing_list; /* Blocks which are currently erasing */
79 struct list_head erase_pending_list; /* Blocks which need erasing now */
80 struct list_head erase_complete_list; /* Blocks which are erased and need the clean marker written to them */
81 struct list_head free_list; /* Blocks which are free and ready to be used */
82 struct list_head bad_list; /* Bad blocks. */
83 struct list_head bad_used_list; /* Bad blocks with valid data in. */
84
85 spinlock_t erase_completion_lock; /* Protect free_list and erasing_list
86 against erase completion handler */
87 wait_queue_head_t erase_wait; /* For waiting for erases to complete */
88
89 wait_queue_head_t inocache_wq;
90 struct jffs2_inode_cache **inocache_list;
91 spinlock_t inocache_lock;
92
93 /* Sem to allow jffs2_garbage_collect_deletion_dirent to
94 drop the erase_completion_lock while it's holding a pointer
95 to an obsoleted node. I don't like this. Alternatives welcomed. */
96 struct semaphore erase_free_sem;
97
98 uint32_t wbuf_pagesize; /* 0 for NOR and other flashes with no wbuf */
99
100#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
101 /* Write-behind buffer for NAND flash */
102 unsigned char *wbuf;
103 uint32_t wbuf_ofs;
104 uint32_t wbuf_len;
105 struct jffs2_inodirty *wbuf_inodes;
106
107 struct rw_semaphore wbuf_sem; /* Protects the write buffer */
108
109 /* Information about out-of-band area usage... */
110 struct nand_oobinfo *oobinfo;
111 uint32_t badblock_pos;
112 uint32_t fsdata_pos;
113 uint32_t fsdata_len;
114#endif
115
116 struct jffs2_summary *summary; /* Summary information */
117
118 /* OS-private pointer for getting back to master superblock info */
119 void *os_priv;
120};
121
122#endif /* _JFFS2_FB_SB */
diff --git a/include/linux/joystick.h b/include/linux/joystick.h
index 5fd20ddd7ae3..e2d3a18af456 100644
--- a/include/linux/joystick.h
+++ b/include/linux/joystick.h
@@ -111,25 +111,25 @@ struct js_corr {
111#define JS_SET_ALL 8 111#define JS_SET_ALL 8
112 112
113struct JS_DATA_TYPE { 113struct JS_DATA_TYPE {
114 int32_t buttons; 114 __s32 buttons;
115 int32_t x; 115 __s32 x;
116 int32_t y; 116 __s32 y;
117}; 117};
118 118
119struct JS_DATA_SAVE_TYPE_32 { 119struct JS_DATA_SAVE_TYPE_32 {
120 int32_t JS_TIMEOUT; 120 __s32 JS_TIMEOUT;
121 int32_t BUSY; 121 __s32 BUSY;
122 int32_t JS_EXPIRETIME; 122 __s32 JS_EXPIRETIME;
123 int32_t JS_TIMELIMIT; 123 __s32 JS_TIMELIMIT;
124 struct JS_DATA_TYPE JS_SAVE; 124 struct JS_DATA_TYPE JS_SAVE;
125 struct JS_DATA_TYPE JS_CORR; 125 struct JS_DATA_TYPE JS_CORR;
126}; 126};
127 127
128struct JS_DATA_SAVE_TYPE_64 { 128struct JS_DATA_SAVE_TYPE_64 {
129 int32_t JS_TIMEOUT; 129 __s32 JS_TIMEOUT;
130 int32_t BUSY; 130 __s32 BUSY;
131 int64_t JS_EXPIRETIME; 131 __s64 JS_EXPIRETIME;
132 int64_t JS_TIMELIMIT; 132 __s64 JS_TIMELIMIT;
133 struct JS_DATA_TYPE JS_SAVE; 133 struct JS_DATA_TYPE JS_SAVE;
134 struct JS_DATA_TYPE JS_CORR; 134 struct JS_DATA_TYPE JS_CORR;
135}; 135};
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 9bbd04092365..54e2549f96ba 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -5,7 +5,6 @@
5#ifndef _LINUX_KALLSYMS_H 5#ifndef _LINUX_KALLSYMS_H
6#define _LINUX_KALLSYMS_H 6#define _LINUX_KALLSYMS_H
7 7
8#include <linux/config.h>
9 8
10#define KSYM_NAME_LEN 127 9#define KSYM_NAME_LEN 127
11 10
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f4fc576ed4c4..8c21aaa248b4 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -24,6 +24,9 @@ extern const char linux_banner[];
24#define LONG_MAX ((long)(~0UL>>1)) 24#define LONG_MAX ((long)(~0UL>>1))
25#define LONG_MIN (-LONG_MAX - 1) 25#define LONG_MIN (-LONG_MAX - 1)
26#define ULONG_MAX (~0UL) 26#define ULONG_MAX (~0UL)
27#define LLONG_MAX ((long long)(~0ULL>>1))
28#define LLONG_MIN (-LLONG_MAX - 1)
29#define ULLONG_MAX (~0ULL)
27 30
28#define STACK_MAGIC 0xdeadbeef 31#define STACK_MAGIC 0xdeadbeef
29 32
@@ -75,7 +78,7 @@ extern int cond_resched(void);
75# define might_sleep() do { might_resched(); } while (0) 78# define might_sleep() do { might_resched(); } while (0)
76#endif 79#endif
77 80
78#define might_sleep_if(cond) do { if (unlikely(cond)) might_sleep(); } while (0) 81#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
79 82
80#define abs(x) ({ \ 83#define abs(x) ({ \
81 int __x = (x); \ 84 int __x = (x); \
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index b46249082cca..43e895f1cabe 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_KERNEL_STAT_H 1#ifndef _LINUX_KERNEL_STAT_H
2#define _LINUX_KERNEL_STAT_H 2#define _LINUX_KERNEL_STAT_H
3 3
4#include <linux/config.h>
5#include <asm/irq.h> 4#include <asm/irq.h>
6#include <linux/smp.h> 5#include <linux/smp.h>
7#include <linux/threads.h> 6#include <linux/threads.h>
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index cfb3410e32b1..6427949ddf99 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -106,6 +106,7 @@ extern struct page *kimage_alloc_control_pages(struct kimage *image,
106extern void crash_kexec(struct pt_regs *); 106extern void crash_kexec(struct pt_regs *);
107int kexec_should_crash(struct task_struct *); 107int kexec_should_crash(struct task_struct *);
108extern struct kimage *kexec_image; 108extern struct kimage *kexec_image;
109extern struct kimage *kexec_crash_image;
109 110
110#define KEXEC_ON_CRASH 0x00000001 111#define KEXEC_ON_CRASH 0x00000001
111#define KEXEC_ARCH_MASK 0xffff0000 112#define KEXEC_ARCH_MASK 0xffff0000
diff --git a/include/linux/key.h b/include/linux/key.h
index cbf464ad9589..e81ebf910d0b 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -205,6 +205,11 @@ struct key_type {
205 /* match a key against a description */ 205 /* match a key against a description */
206 int (*match)(const struct key *key, const void *desc); 206 int (*match)(const struct key *key, const void *desc);
207 207
208 /* clear some of the data from a key on revokation (optional)
209 * - the key's semaphore will be write-locked by the caller
210 */
211 void (*revoke)(struct key *key);
212
208 /* clear the data from a key (optional) */ 213 /* clear the data from a key (optional) */
209 void (*destroy)(struct key *key); 214 void (*destroy)(struct key *key);
210 215
@@ -241,8 +246,9 @@ extern void unregister_key_type(struct key_type *ktype);
241 246
242extern struct key *key_alloc(struct key_type *type, 247extern struct key *key_alloc(struct key_type *type,
243 const char *desc, 248 const char *desc,
244 uid_t uid, gid_t gid, key_perm_t perm, 249 uid_t uid, gid_t gid,
245 int not_in_quota); 250 struct task_struct *ctx,
251 key_perm_t perm, int not_in_quota);
246extern int key_payload_reserve(struct key *key, size_t datalen); 252extern int key_payload_reserve(struct key *key, size_t datalen);
247extern int key_instantiate_and_link(struct key *key, 253extern int key_instantiate_and_link(struct key *key,
248 const void *data, 254 const void *data,
@@ -292,7 +298,9 @@ extern int key_unlink(struct key *keyring,
292 struct key *key); 298 struct key *key);
293 299
294extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, 300extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
295 int not_in_quota, struct key *dest); 301 struct task_struct *ctx,
302 int not_in_quota,
303 struct key *dest);
296 304
297extern int keyring_clear(struct key *keyring); 305extern int keyring_clear(struct key *keyring);
298 306
@@ -313,7 +321,8 @@ extern void keyring_replace_payload(struct key *key, void *replacement);
313 * the userspace interface 321 * the userspace interface
314 */ 322 */
315extern struct key root_user_keyring, root_session_keyring; 323extern struct key root_user_keyring, root_session_keyring;
316extern int alloc_uid_keyring(struct user_struct *user); 324extern int alloc_uid_keyring(struct user_struct *user,
325 struct task_struct *ctx);
317extern void switch_uid_keyring(struct user_struct *new_user); 326extern void switch_uid_keyring(struct user_struct *new_user);
318extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk); 327extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk);
319extern int copy_thread_group_keys(struct task_struct *tsk); 328extern int copy_thread_group_keys(struct task_struct *tsk);
@@ -342,7 +351,7 @@ extern void key_init(void);
342#define make_key_ref(k) ({ NULL; }) 351#define make_key_ref(k) ({ NULL; })
343#define key_ref_to_ptr(k) ({ NULL; }) 352#define key_ref_to_ptr(k) ({ NULL; })
344#define is_key_possessed(k) 0 353#define is_key_possessed(k) 0
345#define alloc_uid_keyring(u) 0 354#define alloc_uid_keyring(u,c) 0
346#define switch_uid_keyring(u) do { } while(0) 355#define switch_uid_keyring(u) do { } while(0)
347#define __install_session_keyring(t, k) ({ NULL; }) 356#define __install_session_keyring(t, k) ({ NULL; })
348#define copy_keys(f,t) 0 357#define copy_keys(f,t) 0
@@ -355,6 +364,10 @@ extern void key_init(void);
355#define key_fsgid_changed(t) do { } while(0) 364#define key_fsgid_changed(t) do { } while(0)
356#define key_init() do { } while(0) 365#define key_init() do { } while(0)
357 366
367/* Initial keyrings */
368extern struct key root_user_keyring;
369extern struct key root_session_keyring;
370
358#endif /* CONFIG_KEYS */ 371#endif /* CONFIG_KEYS */
359#endif /* __KERNEL__ */ 372#endif /* __KERNEL__ */
360#endif /* _LINUX_KEY_H */ 373#endif /* _LINUX_KEY_H */
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index e4a231549407..0db22a1ab474 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -20,7 +20,6 @@
20 */ 20 */
21 21
22#include <linux/stddef.h> 22#include <linux/stddef.h>
23#include <linux/config.h>
24#include <linux/errno.h> 23#include <linux/errno.h>
25#include <linux/compiler.h> 24#include <linux/compiler.h>
26 25
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index c187c53cecd0..2d229327959e 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -190,6 +190,8 @@ struct subsystem _varname##_subsys = { \
190 190
191/* The global /sys/kernel/ subsystem for people to chain off of */ 191/* The global /sys/kernel/ subsystem for people to chain off of */
192extern struct subsystem kernel_subsys; 192extern struct subsystem kernel_subsys;
193/* The global /sys/hypervisor/ subsystem */
194extern struct subsystem hypervisor_subsys;
193 195
194/** 196/**
195 * Helpers for setting the kset of registered objects. 197 * Helpers for setting the kset of registered objects.
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 778adc0fa640..8bf6702da2a0 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -29,7 +29,6 @@
29 * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi 29 * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi
30 * <prasanna@in.ibm.com> added function-return probes. 30 * <prasanna@in.ibm.com> added function-return probes.
31 */ 31 */
32#include <linux/config.h>
33#include <linux/list.h> 32#include <linux/list.h>
34#include <linux/notifier.h> 33#include <linux/notifier.h>
35#include <linux/smp.h> 34#include <linux/smp.h>
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b80d2e7fa6d2..20b1cf527c60 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -33,6 +33,7 @@
33#include <asm/io.h> 33#include <asm/io.h>
34#include <linux/ata.h> 34#include <linux/ata.h>
35#include <linux/workqueue.h> 35#include <linux/workqueue.h>
36#include <scsi/scsi_host.h>
36 37
37/* 38/*
38 * compile-time options: to be removed as soon as all the drivers are 39 * compile-time options: to be removed as soon as all the drivers are
@@ -44,7 +45,6 @@
44#undef ATA_NDEBUG /* define to disable quick runtime checks */ 45#undef ATA_NDEBUG /* define to disable quick runtime checks */
45#undef ATA_ENABLE_PATA /* define to enable PATA support in some 46#undef ATA_ENABLE_PATA /* define to enable PATA support in some
46 * low-level drivers */ 47 * low-level drivers */
47#undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */
48 48
49 49
50/* note: prints function name for you */ 50/* note: prints function name for you */
@@ -108,8 +108,11 @@ enum {
108 LIBATA_MAX_PRD = ATA_MAX_PRD / 2, 108 LIBATA_MAX_PRD = ATA_MAX_PRD / 2,
109 ATA_MAX_PORTS = 8, 109 ATA_MAX_PORTS = 8,
110 ATA_DEF_QUEUE = 1, 110 ATA_DEF_QUEUE = 1,
111 ATA_MAX_QUEUE = 1, 111 /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */
112 ATA_MAX_QUEUE = 32,
113 ATA_TAG_INTERNAL = ATA_MAX_QUEUE - 1,
112 ATA_MAX_SECTORS = 200, /* FIXME */ 114 ATA_MAX_SECTORS = 200, /* FIXME */
115 ATA_MAX_SECTORS_LBA48 = 65535,
113 ATA_MAX_BUS = 2, 116 ATA_MAX_BUS = 2,
114 ATA_DEF_BUSY_WAIT = 10000, 117 ATA_DEF_BUSY_WAIT = 10000,
115 ATA_SHORT_PAUSE = (HZ >> 6) + 1, 118 ATA_SHORT_PAUSE = (HZ >> 6) + 1,
@@ -120,9 +123,17 @@ enum {
120 ATA_SHT_USE_CLUSTERING = 1, 123 ATA_SHT_USE_CLUSTERING = 1,
121 124
122 /* struct ata_device stuff */ 125 /* struct ata_device stuff */
123 ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ 126 ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */
124 ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ 127 ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */
125 ATA_DFLAG_LBA = (1 << 2), /* device supports LBA */ 128 ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */
129 ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */
130 ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
131
132 ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */
133 ATA_DFLAG_INIT_MASK = (1 << 16) - 1,
134
135 ATA_DFLAG_DETACH = (1 << 16),
136 ATA_DFLAG_DETACHED = (1 << 17),
126 137
127 ATA_DEV_UNKNOWN = 0, /* unknown device */ 138 ATA_DEV_UNKNOWN = 0, /* unknown device */
128 ATA_DEV_ATA = 1, /* ATA device */ 139 ATA_DEV_ATA = 1, /* ATA device */
@@ -132,43 +143,57 @@ enum {
132 ATA_DEV_NONE = 5, /* no device */ 143 ATA_DEV_NONE = 5, /* no device */
133 144
134 /* struct ata_port flags */ 145 /* struct ata_port flags */
135 ATA_FLAG_SLAVE_POSS = (1 << 1), /* host supports slave dev */ 146 ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */
136 /* (doesn't imply presence) */ 147 /* (doesn't imply presence) */
137 ATA_FLAG_PORT_DISABLED = (1 << 2), /* port is disabled, ignore it */ 148 ATA_FLAG_SATA = (1 << 1),
138 ATA_FLAG_SATA = (1 << 3), 149 ATA_FLAG_NO_LEGACY = (1 << 2), /* no legacy mode check */
139 ATA_FLAG_NO_LEGACY = (1 << 4), /* no legacy mode check */ 150 ATA_FLAG_MMIO = (1 << 3), /* use MMIO, not PIO */
140 ATA_FLAG_SRST = (1 << 5), /* (obsolete) use ATA SRST, not E.D.D. */ 151 ATA_FLAG_SRST = (1 << 4), /* (obsolete) use ATA SRST, not E.D.D. */
141 ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */ 152 ATA_FLAG_SATA_RESET = (1 << 5), /* (obsolete) use COMRESET */
142 ATA_FLAG_SATA_RESET = (1 << 7), /* (obsolete) use COMRESET */ 153 ATA_FLAG_NO_ATAPI = (1 << 6), /* No ATAPI support */
143 ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ 154 ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */
144 ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once 155 ATA_FLAG_PIO_LBA48 = (1 << 8), /* Host DMA engine is LBA28 only */
145 * proper HSM is in place. */ 156 ATA_FLAG_PIO_POLLING = (1 << 9), /* use polling PIO if LLD
146 ATA_FLAG_DEBUGMSG = (1 << 10), 157 * doesn't handle PIO interrupts */
147 ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */ 158 ATA_FLAG_NCQ = (1 << 10), /* host supports NCQ */
148 159 ATA_FLAG_HRST_TO_RESUME = (1 << 11), /* hardreset to resume phy */
149 ATA_FLAG_SUSPENDED = (1 << 12), /* port is suspended */ 160 ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H
150 161 * Register FIS clearing BSY */
151 ATA_FLAG_PIO_LBA48 = (1 << 13), /* Host DMA engine is LBA28 only */ 162
152 ATA_FLAG_IRQ_MASK = (1 << 14), /* Mask IRQ in PIO xfers */ 163 ATA_FLAG_DEBUGMSG = (1 << 13),
153 164 ATA_FLAG_FLUSH_PORT_TASK = (1 << 14), /* flush port task */
154 ATA_FLAG_FLUSH_PORT_TASK = (1 << 15), /* Flush port task */ 165
155 ATA_FLAG_IN_EH = (1 << 16), /* EH in progress */ 166 ATA_FLAG_EH_PENDING = (1 << 15), /* EH pending */
156 167 ATA_FLAG_EH_IN_PROGRESS = (1 << 16), /* EH in progress */
157 ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ 168 ATA_FLAG_FROZEN = (1 << 17), /* port is frozen */
158 ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ 169 ATA_FLAG_RECOVERED = (1 << 18), /* recovery action performed */
159 ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */ 170 ATA_FLAG_LOADING = (1 << 19), /* boot/loading probe */
171 ATA_FLAG_UNLOADING = (1 << 20), /* module is unloading */
172 ATA_FLAG_SCSI_HOTPLUG = (1 << 21), /* SCSI hotplug scheduled */
173
174 ATA_FLAG_DISABLED = (1 << 22), /* port is disabled, ignore it */
175 ATA_FLAG_SUSPENDED = (1 << 23), /* port is suspended (power) */
176
177 /* bits 24:31 of ap->flags are reserved for LLDD specific flags */
178
179 /* struct ata_queued_cmd flags */
180 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */
181 ATA_QCFLAG_SG = (1 << 1), /* have s/g table? */
182 ATA_QCFLAG_SINGLE = (1 << 2), /* no s/g, just a single buffer */
160 ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, 183 ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE,
161 ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ 184 ATA_QCFLAG_IO = (1 << 3), /* standard IO command */
185 ATA_QCFLAG_RESULT_TF = (1 << 4), /* result TF requested */
186
187 ATA_QCFLAG_FAILED = (1 << 16), /* cmd failed and is owned by EH */
188 ATA_QCFLAG_SENSE_VALID = (1 << 17), /* sense data valid */
189 ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */
162 190
163 /* host set flags */ 191 /* host set flags */
164 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */ 192 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */
165 193
166 /* various lengths of time */ 194 /* various lengths of time */
167 ATA_TMOUT_PIO = 30 * HZ,
168 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ 195 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */
169 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ 196 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */
170 ATA_TMOUT_CDB = 30 * HZ,
171 ATA_TMOUT_CDB_QUICK = 5 * HZ,
172 ATA_TMOUT_INTERNAL = 30 * HZ, 197 ATA_TMOUT_INTERNAL = 30 * HZ,
173 ATA_TMOUT_INTERNAL_QUICK = 5 * HZ, 198 ATA_TMOUT_INTERNAL_QUICK = 5 * HZ,
174 199
@@ -207,21 +232,56 @@ enum {
207 /* size of buffer to pad xfers ending on unaligned boundaries */ 232 /* size of buffer to pad xfers ending on unaligned boundaries */
208 ATA_DMA_PAD_SZ = 4, 233 ATA_DMA_PAD_SZ = 4,
209 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE, 234 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE,
210 235
211 /* Masks for port functions */ 236 /* masks for port functions */
212 ATA_PORT_PRIMARY = (1 << 0), 237 ATA_PORT_PRIMARY = (1 << 0),
213 ATA_PORT_SECONDARY = (1 << 1), 238 ATA_PORT_SECONDARY = (1 << 1),
239
240 /* ering size */
241 ATA_ERING_SIZE = 32,
242
243 /* desc_len for ata_eh_info and context */
244 ATA_EH_DESC_LEN = 80,
245
246 /* reset / recovery action types */
247 ATA_EH_REVALIDATE = (1 << 0),
248 ATA_EH_SOFTRESET = (1 << 1),
249 ATA_EH_HARDRESET = (1 << 2),
250
251 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
252 ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE,
253
254 /* ata_eh_info->flags */
255 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */
256
257 ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */
258
259 /* max repeat if error condition is still set after ->error_handler */
260 ATA_EH_MAX_REPEAT = 5,
261
262 /* how hard are we gonna try to probe/recover devices */
263 ATA_PROBE_MAX_TRIES = 3,
264 ATA_EH_RESET_TRIES = 3,
265 ATA_EH_DEV_TRIES = 3,
266
267 /* Drive spinup time (time from power-on to the first D2H FIS)
268 * in msecs - 8s currently. Failing to get ready in this time
269 * isn't critical. It will result in reset failure for
270 * controllers which can't wait for the first D2H FIS. libata
271 * will retry, so it just has to be long enough to spin up
272 * most devices.
273 */
274 ATA_SPINUP_WAIT = 8000,
214}; 275};
215 276
216enum hsm_task_states { 277enum hsm_task_states {
217 HSM_ST_UNKNOWN, 278 HSM_ST_UNKNOWN, /* state unknown */
218 HSM_ST_IDLE, 279 HSM_ST_IDLE, /* no command on going */
219 HSM_ST_POLL, 280 HSM_ST, /* (waiting the device to) transfer data */
220 HSM_ST_TMOUT, 281 HSM_ST_LAST, /* (waiting the device to) complete command */
221 HSM_ST, 282 HSM_ST_ERR, /* error */
222 HSM_ST_LAST, 283 HSM_ST_FIRST, /* (waiting the device to)
223 HSM_ST_LAST_POLL, 284 write CDB or first data block */
224 HSM_ST_ERR,
225}; 285};
226 286
227enum ata_completion_errors { 287enum ata_completion_errors {
@@ -244,9 +304,9 @@ struct ata_queued_cmd;
244 304
245/* typedefs */ 305/* typedefs */
246typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc); 306typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc);
247typedef void (*ata_probeinit_fn_t)(struct ata_port *); 307typedef int (*ata_prereset_fn_t)(struct ata_port *ap);
248typedef int (*ata_reset_fn_t)(struct ata_port *, int, unsigned int *); 308typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes);
249typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *); 309typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes);
250 310
251struct ata_ioports { 311struct ata_ioports {
252 unsigned long cmd_addr; 312 unsigned long cmd_addr;
@@ -297,7 +357,8 @@ struct ata_host_set {
297 unsigned long flags; 357 unsigned long flags;
298 int simplex_claimed; /* Keep seperate in case we 358 int simplex_claimed; /* Keep seperate in case we
299 ever need to do this locked */ 359 ever need to do this locked */
300 struct ata_port * ports[0]; 360 struct ata_host_set *next; /* for legacy mode */
361 struct ata_port *ports[0];
301}; 362};
302 363
303struct ata_queued_cmd { 364struct ata_queued_cmd {
@@ -336,7 +397,7 @@ struct ata_queued_cmd {
336 struct scatterlist *__sg; 397 struct scatterlist *__sg;
337 398
338 unsigned int err_mask; 399 unsigned int err_mask;
339 400 struct ata_taskfile result_tf;
340 ata_qc_cb_t complete_fn; 401 ata_qc_cb_t complete_fn;
341 402
342 void *private_data; 403 void *private_data;
@@ -348,12 +409,26 @@ struct ata_host_stats {
348 unsigned long rw_reqbuf; 409 unsigned long rw_reqbuf;
349}; 410};
350 411
412struct ata_ering_entry {
413 int is_io;
414 unsigned int err_mask;
415 u64 timestamp;
416};
417
418struct ata_ering {
419 int cursor;
420 struct ata_ering_entry ring[ATA_ERING_SIZE];
421};
422
351struct ata_device { 423struct ata_device {
352 u64 n_sectors; /* size of device, if ATA */ 424 struct ata_port *ap;
425 unsigned int devno; /* 0 or 1 */
353 unsigned long flags; /* ATA_DFLAG_xxx */ 426 unsigned long flags; /* ATA_DFLAG_xxx */
427 struct scsi_device *sdev; /* attached SCSI device */
428 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
429 u64 n_sectors; /* size of device, if ATA */
354 unsigned int class; /* ATA_DEV_xxx */ 430 unsigned int class; /* ATA_DEV_xxx */
355 unsigned int devno; /* 0 or 1 */ 431 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
356 u16 *id; /* IDENTIFY xxx DEVICE data */
357 u8 pio_mode; 432 u8 pio_mode;
358 u8 dma_mode; 433 u8 dma_mode;
359 u8 xfer_mode; 434 u8 xfer_mode;
@@ -373,11 +448,42 @@ struct ata_device {
373 u16 cylinders; /* Number of cylinders */ 448 u16 cylinders; /* Number of cylinders */
374 u16 heads; /* Number of heads */ 449 u16 heads; /* Number of heads */
375 u16 sectors; /* Number of sectors per track */ 450 u16 sectors; /* Number of sectors per track */
451
452 /* error history */
453 struct ata_ering ering;
454};
455
456/* Offset into struct ata_device. Fields above it are maintained
457 * acress device init. Fields below are zeroed.
458 */
459#define ATA_DEVICE_CLEAR_OFFSET offsetof(struct ata_device, n_sectors)
460
461struct ata_eh_info {
462 struct ata_device *dev; /* offending device */
463 u32 serror; /* SError from LLDD */
464 unsigned int err_mask; /* port-wide err_mask */
465 unsigned int action; /* ATA_EH_* action mask */
466 unsigned int dev_action[ATA_MAX_DEVICES]; /* dev EH action */
467 unsigned int flags; /* ATA_EHI_* flags */
468
469 unsigned long hotplug_timestamp;
470 unsigned int probe_mask;
471
472 char desc[ATA_EH_DESC_LEN];
473 int desc_len;
474};
475
476struct ata_eh_context {
477 struct ata_eh_info i;
478 int tries[ATA_MAX_DEVICES];
479 unsigned int classes[ATA_MAX_DEVICES];
480 unsigned int did_probe_mask;
376}; 481};
377 482
378struct ata_port { 483struct ata_port {
379 struct Scsi_Host *host; /* our co-allocated scsi host */ 484 struct Scsi_Host *host; /* our co-allocated scsi host */
380 const struct ata_port_operations *ops; 485 const struct ata_port_operations *ops;
486 spinlock_t *lock;
381 unsigned long flags; /* ATA_FLAG_xxx */ 487 unsigned long flags; /* ATA_FLAG_xxx */
382 unsigned int id; /* unique id req'd by scsi midlyr */ 488 unsigned int id; /* unique id req'd by scsi midlyr */
383 unsigned int port_no; /* unique port #; from zero */ 489 unsigned int port_no; /* unique port #; from zero */
@@ -397,26 +503,40 @@ struct ata_port {
397 unsigned int mwdma_mask; 503 unsigned int mwdma_mask;
398 unsigned int udma_mask; 504 unsigned int udma_mask;
399 unsigned int cbl; /* cable type; ATA_CBL_xxx */ 505 unsigned int cbl; /* cable type; ATA_CBL_xxx */
506 unsigned int hw_sata_spd_limit;
507 unsigned int sata_spd_limit; /* SATA PHY speed limit */
508
509 /* record runtime error info, protected by host_set lock */
510 struct ata_eh_info eh_info;
511 /* EH context owned by EH */
512 struct ata_eh_context eh_context;
400 513
401 struct ata_device device[ATA_MAX_DEVICES]; 514 struct ata_device device[ATA_MAX_DEVICES];
402 515
403 struct ata_queued_cmd qcmd[ATA_MAX_QUEUE]; 516 struct ata_queued_cmd qcmd[ATA_MAX_QUEUE];
404 unsigned long qactive; 517 unsigned long qc_allocated;
518 unsigned int qc_active;
519
405 unsigned int active_tag; 520 unsigned int active_tag;
521 u32 sactive;
406 522
407 struct ata_host_stats stats; 523 struct ata_host_stats stats;
408 struct ata_host_set *host_set; 524 struct ata_host_set *host_set;
409 struct device *dev; 525 struct device *dev;
410 526
411 struct work_struct port_task; 527 struct work_struct port_task;
528 struct work_struct hotplug_task;
529 struct work_struct scsi_rescan_task;
412 530
413 unsigned int hsm_task_state; 531 unsigned int hsm_task_state;
414 unsigned long pio_task_timeout;
415 532
416 u32 msg_enable; 533 u32 msg_enable;
417 struct list_head eh_done_q; 534 struct list_head eh_done_q;
535 wait_queue_head_t eh_wait_q;
418 536
419 void *private_data; 537 void *private_data;
538
539 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */
420}; 540};
421 541
422struct ata_port_operations { 542struct ata_port_operations {
@@ -438,7 +558,6 @@ struct ata_port_operations {
438 558
439 void (*phy_reset) (struct ata_port *ap); /* obsolete */ 559 void (*phy_reset) (struct ata_port *ap); /* obsolete */
440 void (*set_mode) (struct ata_port *ap); 560 void (*set_mode) (struct ata_port *ap);
441 int (*probe_reset) (struct ata_port *ap, unsigned int *classes);
442 561
443 void (*post_set_mode) (struct ata_port *ap); 562 void (*post_set_mode) (struct ata_port *ap);
444 563
@@ -447,10 +566,20 @@ struct ata_port_operations {
447 void (*bmdma_setup) (struct ata_queued_cmd *qc); 566 void (*bmdma_setup) (struct ata_queued_cmd *qc);
448 void (*bmdma_start) (struct ata_queued_cmd *qc); 567 void (*bmdma_start) (struct ata_queued_cmd *qc);
449 568
569 void (*data_xfer) (struct ata_device *, unsigned char *, unsigned int, int);
570
450 void (*qc_prep) (struct ata_queued_cmd *qc); 571 void (*qc_prep) (struct ata_queued_cmd *qc);
451 unsigned int (*qc_issue) (struct ata_queued_cmd *qc); 572 unsigned int (*qc_issue) (struct ata_queued_cmd *qc);
452 573
453 void (*eng_timeout) (struct ata_port *ap); 574 /* Error handlers. ->error_handler overrides ->eng_timeout and
575 * indicates that new-style EH is in place.
576 */
577 void (*eng_timeout) (struct ata_port *ap); /* obsolete */
578
579 void (*freeze) (struct ata_port *ap);
580 void (*thaw) (struct ata_port *ap);
581 void (*error_handler) (struct ata_port *ap);
582 void (*post_internal_cmd) (struct ata_queued_cmd *qc);
454 583
455 irqreturn_t (*irq_handler)(int, void *, struct pt_regs *); 584 irqreturn_t (*irq_handler)(int, void *, struct pt_regs *);
456 void (*irq_clear) (struct ata_port *); 585 void (*irq_clear) (struct ata_port *);
@@ -492,22 +621,22 @@ struct ata_timing {
492 621
493#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) 622#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin)
494 623
624extern const unsigned long sata_deb_timing_boot[];
625extern const unsigned long sata_deb_timing_eh[];
626extern const unsigned long sata_deb_timing_before_fsrst[];
627
495extern void ata_port_probe(struct ata_port *); 628extern void ata_port_probe(struct ata_port *);
496extern void __sata_phy_reset(struct ata_port *ap); 629extern void __sata_phy_reset(struct ata_port *ap);
497extern void sata_phy_reset(struct ata_port *ap); 630extern void sata_phy_reset(struct ata_port *ap);
498extern void ata_bus_reset(struct ata_port *ap); 631extern void ata_bus_reset(struct ata_port *ap);
499extern int ata_drive_probe_reset(struct ata_port *ap, 632extern int sata_set_spd(struct ata_port *ap);
500 ata_probeinit_fn_t probeinit, 633extern int sata_phy_debounce(struct ata_port *ap, const unsigned long *param);
501 ata_reset_fn_t softreset, ata_reset_fn_t hardreset, 634extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param);
502 ata_postreset_fn_t postreset, unsigned int *classes); 635extern int ata_std_prereset(struct ata_port *ap);
503extern void ata_std_probeinit(struct ata_port *ap); 636extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes);
504extern int ata_std_softreset(struct ata_port *ap, int verbose, 637extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class);
505 unsigned int *classes);
506extern int sata_std_hardreset(struct ata_port *ap, int verbose,
507 unsigned int *class);
508extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); 638extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
509extern int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev, 639extern int ata_dev_revalidate(struct ata_device *dev, int post_reset);
510 int post_reset);
511extern void ata_port_disable(struct ata_port *); 640extern void ata_port_disable(struct ata_port *);
512extern void ata_std_ports(struct ata_ioports *ioaddr); 641extern void ata_std_ports(struct ata_ioports *ioaddr);
513#ifdef CONFIG_PCI 642#ifdef CONFIG_PCI
@@ -519,24 +648,32 @@ extern int ata_pci_device_resume(struct pci_dev *pdev);
519extern int ata_pci_clear_simplex(struct pci_dev *pdev); 648extern int ata_pci_clear_simplex(struct pci_dev *pdev);
520#endif /* CONFIG_PCI */ 649#endif /* CONFIG_PCI */
521extern int ata_device_add(const struct ata_probe_ent *ent); 650extern int ata_device_add(const struct ata_probe_ent *ent);
651extern void ata_port_detach(struct ata_port *ap);
522extern void ata_host_set_remove(struct ata_host_set *host_set); 652extern void ata_host_set_remove(struct ata_host_set *host_set);
523extern int ata_scsi_detect(struct scsi_host_template *sht); 653extern int ata_scsi_detect(struct scsi_host_template *sht);
524extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 654extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
525extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); 655extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
526extern void ata_eh_qc_complete(struct ata_queued_cmd *qc);
527extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);
528extern int ata_scsi_release(struct Scsi_Host *host); 656extern int ata_scsi_release(struct Scsi_Host *host);
529extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 657extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
658extern int sata_scr_valid(struct ata_port *ap);
659extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val);
660extern int sata_scr_write(struct ata_port *ap, int reg, u32 val);
661extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val);
662extern int ata_port_online(struct ata_port *ap);
663extern int ata_port_offline(struct ata_port *ap);
530extern int ata_scsi_device_resume(struct scsi_device *); 664extern int ata_scsi_device_resume(struct scsi_device *);
531extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); 665extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state);
532extern int ata_device_resume(struct ata_port *, struct ata_device *); 666extern int ata_device_resume(struct ata_device *);
533extern int ata_device_suspend(struct ata_port *, struct ata_device *, pm_message_t state); 667extern int ata_device_suspend(struct ata_device *, pm_message_t state);
534extern int ata_ratelimit(void); 668extern int ata_ratelimit(void);
535extern unsigned int ata_busy_sleep(struct ata_port *ap, 669extern unsigned int ata_busy_sleep(struct ata_port *ap,
536 unsigned long timeout_pat, 670 unsigned long timeout_pat,
537 unsigned long timeout); 671 unsigned long timeout);
538extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), 672extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *),
539 void *data, unsigned long delay); 673 void *data, unsigned long delay);
674extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
675 unsigned long interval_msec,
676 unsigned long timeout_msec);
540 677
541/* 678/*
542 * Default driver ops implementations 679 * Default driver ops implementations
@@ -550,11 +687,16 @@ extern void ata_std_dev_select (struct ata_port *ap, unsigned int device);
550extern u8 ata_check_status(struct ata_port *ap); 687extern u8 ata_check_status(struct ata_port *ap);
551extern u8 ata_altstatus(struct ata_port *ap); 688extern u8 ata_altstatus(struct ata_port *ap);
552extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); 689extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf);
553extern int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes);
554extern int ata_port_start (struct ata_port *ap); 690extern int ata_port_start (struct ata_port *ap);
555extern void ata_port_stop (struct ata_port *ap); 691extern void ata_port_stop (struct ata_port *ap);
556extern void ata_host_stop (struct ata_host_set *host_set); 692extern void ata_host_stop (struct ata_host_set *host_set);
557extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); 693extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
694extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf,
695 unsigned int buflen, int write_data);
696extern void ata_pio_data_xfer(struct ata_device *adev, unsigned char *buf,
697 unsigned int buflen, int write_data);
698extern void ata_pio_data_xfer_noirq(struct ata_device *adev, unsigned char *buf,
699 unsigned int buflen, int write_data);
558extern void ata_qc_prep(struct ata_queued_cmd *qc); 700extern void ata_qc_prep(struct ata_queued_cmd *qc);
559extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); 701extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
560extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); 702extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc);
@@ -572,17 +714,29 @@ extern void ata_bmdma_start (struct ata_queued_cmd *qc);
572extern void ata_bmdma_stop(struct ata_queued_cmd *qc); 714extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
573extern u8 ata_bmdma_status(struct ata_port *ap); 715extern u8 ata_bmdma_status(struct ata_port *ap);
574extern void ata_bmdma_irq_clear(struct ata_port *ap); 716extern void ata_bmdma_irq_clear(struct ata_port *ap);
575extern void __ata_qc_complete(struct ata_queued_cmd *qc); 717extern void ata_bmdma_freeze(struct ata_port *ap);
576extern void ata_eng_timeout(struct ata_port *ap); 718extern void ata_bmdma_thaw(struct ata_port *ap);
577extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev, 719extern void ata_bmdma_drive_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
578 struct scsi_cmnd *cmd, 720 ata_reset_fn_t softreset,
721 ata_reset_fn_t hardreset,
722 ata_postreset_fn_t postreset);
723extern void ata_bmdma_error_handler(struct ata_port *ap);
724extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc);
725extern int ata_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
726 u8 status, int in_wq);
727extern void ata_qc_complete(struct ata_queued_cmd *qc);
728extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active,
729 void (*finish_qc)(struct ata_queued_cmd *));
730extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd,
579 void (*done)(struct scsi_cmnd *)); 731 void (*done)(struct scsi_cmnd *));
580extern int ata_std_bios_param(struct scsi_device *sdev, 732extern int ata_std_bios_param(struct scsi_device *sdev,
581 struct block_device *bdev, 733 struct block_device *bdev,
582 sector_t capacity, int geom[]); 734 sector_t capacity, int geom[]);
583extern int ata_scsi_slave_config(struct scsi_device *sdev); 735extern int ata_scsi_slave_config(struct scsi_device *sdev);
584extern struct ata_device *ata_dev_pair(struct ata_port *ap, 736extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
585 struct ata_device *adev); 737extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
738 int queue_depth);
739extern struct ata_device *ata_dev_pair(struct ata_device *adev);
586 740
587/* 741/*
588 * Timing helpers 742 * Timing helpers
@@ -628,7 +782,64 @@ extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bit
628extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_device *, unsigned long); 782extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_device *, unsigned long);
629#endif /* CONFIG_PCI */ 783#endif /* CONFIG_PCI */
630 784
785/*
786 * EH
787 */
788extern void ata_eng_timeout(struct ata_port *ap);
789
790extern void ata_port_schedule_eh(struct ata_port *ap);
791extern int ata_port_abort(struct ata_port *ap);
792extern int ata_port_freeze(struct ata_port *ap);
793
794extern void ata_eh_freeze_port(struct ata_port *ap);
795extern void ata_eh_thaw_port(struct ata_port *ap);
796
797extern void ata_eh_qc_complete(struct ata_queued_cmd *qc);
798extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);
799
800extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
801 ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
802 ata_postreset_fn_t postreset);
803
804/*
805 * printk helpers
806 */
807#define ata_port_printk(ap, lv, fmt, args...) \
808 printk(lv"ata%u: "fmt, (ap)->id , ##args)
809
810#define ata_dev_printk(dev, lv, fmt, args...) \
811 printk(lv"ata%u.%02u: "fmt, (dev)->ap->id, (dev)->devno , ##args)
812
813/*
814 * ata_eh_info helpers
815 */
816#define ata_ehi_push_desc(ehi, fmt, args...) do { \
817 (ehi)->desc_len += scnprintf((ehi)->desc + (ehi)->desc_len, \
818 ATA_EH_DESC_LEN - (ehi)->desc_len, \
819 fmt , ##args); \
820} while (0)
821
822#define ata_ehi_clear_desc(ehi) do { \
823 (ehi)->desc[0] = '\0'; \
824 (ehi)->desc_len = 0; \
825} while (0)
826
827static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
828{
829 if (ehi->flags & ATA_EHI_HOTPLUGGED)
830 return;
831
832 ehi->flags |= ATA_EHI_HOTPLUGGED;
833 ehi->hotplug_timestamp = jiffies;
631 834
835 ehi->err_mask |= AC_ERR_ATA_BUS;
836 ehi->action |= ATA_EH_SOFTRESET;
837 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
838}
839
840/*
841 * qc helpers
842 */
632static inline int 843static inline int
633ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc) 844ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
634{ 845{
@@ -671,14 +882,39 @@ static inline unsigned int ata_tag_valid(unsigned int tag)
671 return (tag < ATA_MAX_QUEUE) ? 1 : 0; 882 return (tag < ATA_MAX_QUEUE) ? 1 : 0;
672} 883}
673 884
674static inline unsigned int ata_class_present(unsigned int class) 885static inline unsigned int ata_tag_internal(unsigned int tag)
886{
887 return tag == ATA_MAX_QUEUE - 1;
888}
889
890static inline unsigned int ata_class_enabled(unsigned int class)
675{ 891{
676 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; 892 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI;
677} 893}
678 894
679static inline unsigned int ata_dev_present(const struct ata_device *dev) 895static inline unsigned int ata_class_disabled(unsigned int class)
680{ 896{
681 return ata_class_present(dev->class); 897 return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP;
898}
899
900static inline unsigned int ata_class_absent(unsigned int class)
901{
902 return !ata_class_enabled(class) && !ata_class_disabled(class);
903}
904
905static inline unsigned int ata_dev_enabled(const struct ata_device *dev)
906{
907 return ata_class_enabled(dev->class);
908}
909
910static inline unsigned int ata_dev_disabled(const struct ata_device *dev)
911{
912 return ata_class_disabled(dev->class);
913}
914
915static inline unsigned int ata_dev_absent(const struct ata_device *dev)
916{
917 return ata_class_absent(dev->class);
682} 918}
683 919
684static inline u8 ata_chk_status(struct ata_port *ap) 920static inline u8 ata_chk_status(struct ata_port *ap)
@@ -759,20 +995,35 @@ static inline void ata_qc_set_polling(struct ata_queued_cmd *qc)
759 qc->tf.ctl |= ATA_NIEN; 995 qc->tf.ctl |= ATA_NIEN;
760} 996}
761 997
762static inline struct ata_queued_cmd *ata_qc_from_tag (struct ata_port *ap, 998static inline struct ata_queued_cmd *__ata_qc_from_tag(struct ata_port *ap,
763 unsigned int tag) 999 unsigned int tag)
764{ 1000{
765 if (likely(ata_tag_valid(tag))) 1001 if (likely(ata_tag_valid(tag)))
766 return &ap->qcmd[tag]; 1002 return &ap->qcmd[tag];
767 return NULL; 1003 return NULL;
768} 1004}
769 1005
770static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, unsigned int device) 1006static inline struct ata_queued_cmd *ata_qc_from_tag(struct ata_port *ap,
1007 unsigned int tag)
1008{
1009 struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
1010
1011 if (unlikely(!qc) || !ap->ops->error_handler)
1012 return qc;
1013
1014 if ((qc->flags & (ATA_QCFLAG_ACTIVE |
1015 ATA_QCFLAG_FAILED)) == ATA_QCFLAG_ACTIVE)
1016 return qc;
1017
1018 return NULL;
1019}
1020
1021static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf)
771{ 1022{
772 memset(tf, 0, sizeof(*tf)); 1023 memset(tf, 0, sizeof(*tf));
773 1024
774 tf->ctl = ap->ctl; 1025 tf->ctl = dev->ap->ctl;
775 if (device == 0) 1026 if (dev->devno == 0)
776 tf->device = ATA_DEVICE_OBS; 1027 tf->device = ATA_DEVICE_OBS;
777 else 1028 else
778 tf->device = ATA_DEVICE_OBS | ATA_DEV1; 1029 tf->device = ATA_DEVICE_OBS | ATA_DEV1;
@@ -787,26 +1038,11 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
787 qc->nbytes = qc->curbytes = 0; 1038 qc->nbytes = qc->curbytes = 0;
788 qc->err_mask = 0; 1039 qc->err_mask = 0;
789 1040
790 ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); 1041 ata_tf_init(qc->dev, &qc->tf);
791}
792
793/**
794 * ata_qc_complete - Complete an active ATA command
795 * @qc: Command to complete
796 * @err_mask: ATA Status register contents
797 *
798 * Indicate to the mid and upper layers that an ATA
799 * command has completed, with either an ok or not-ok status.
800 *
801 * LOCKING:
802 * spin_lock_irqsave(host_set lock)
803 */
804static inline void ata_qc_complete(struct ata_queued_cmd *qc)
805{
806 if (unlikely(qc->flags & ATA_QCFLAG_EH_SCHEDULED))
807 return;
808 1042
809 __ata_qc_complete(qc); 1043 /* init result_tf such that it indicates normal completion */
1044 qc->result_tf.command = ATA_DRDY;
1045 qc->result_tf.feature = 0;
810} 1046}
811 1047
812/** 1048/**
@@ -885,28 +1121,6 @@ static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
885 return status; 1121 return status;
886} 1122}
887 1123
888static inline u32 scr_read(struct ata_port *ap, unsigned int reg)
889{
890 return ap->ops->scr_read(ap, reg);
891}
892
893static inline void scr_write(struct ata_port *ap, unsigned int reg, u32 val)
894{
895 ap->ops->scr_write(ap, reg, val);
896}
897
898static inline void scr_write_flush(struct ata_port *ap, unsigned int reg,
899 u32 val)
900{
901 ap->ops->scr_write(ap, reg, val);
902 (void) ap->ops->scr_read(ap, reg);
903}
904
905static inline unsigned int sata_dev_present(struct ata_port *ap)
906{
907 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0;
908}
909
910static inline int ata_try_flush_cache(const struct ata_device *dev) 1124static inline int ata_try_flush_cache(const struct ata_device *dev)
911{ 1125{
912 return ata_id_wcache_enabled(dev->id) || 1126 return ata_id_wcache_enabled(dev->id) ||
@@ -916,7 +1130,7 @@ static inline int ata_try_flush_cache(const struct ata_device *dev)
916 1130
917static inline unsigned int ac_err_mask(u8 status) 1131static inline unsigned int ac_err_mask(u8 status)
918{ 1132{
919 if (status & ATA_BUSY) 1133 if (status & (ATA_BUSY | ATA_DRQ))
920 return AC_ERR_HSM; 1134 return AC_ERR_HSM;
921 if (status & (ATA_ERR | ATA_DF)) 1135 if (status & (ATA_ERR | ATA_DF))
922 return AC_ERR_DEV; 1136 return AC_ERR_DEV;
@@ -944,4 +1158,9 @@ static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
944 dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma); 1158 dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
945} 1159}
946 1160
1161static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host)
1162{
1163 return (struct ata_port *) &host->hostdata[0];
1164}
1165
947#endif /* __LINUX_LIBATA_H__ */ 1166#endif /* __LINUX_LIBATA_H__ */
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index c08c9983e840..932021f872d5 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_LINKAGE_H 1#ifndef _LINUX_LINKAGE_H
2#define _LINUX_LINKAGE_H 2#define _LINUX_LINKAGE_H
3 3
4#include <linux/config.h>
5#include <asm/linkage.h> 4#include <asm/linkage.h>
6 5
7#ifdef __cplusplus 6#ifdef __cplusplus
diff --git a/include/linux/list.h b/include/linux/list.h
index 76f05718342c..a02642e4710a 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -197,12 +197,35 @@ static inline void list_del_rcu(struct list_head *entry)
197 entry->prev = LIST_POISON2; 197 entry->prev = LIST_POISON2;
198} 198}
199 199
200/**
201 * list_replace - replace old entry by new one
202 * @old : the element to be replaced
203 * @new : the new element to insert
204 * Note: if 'old' was empty, it will be overwritten.
205 */
206static inline void list_replace(struct list_head *old,
207 struct list_head *new)
208{
209 new->next = old->next;
210 new->next->prev = new;
211 new->prev = old->prev;
212 new->prev->next = new;
213}
214
215static inline void list_replace_init(struct list_head *old,
216 struct list_head *new)
217{
218 list_replace(old, new);
219 INIT_LIST_HEAD(old);
220}
221
200/* 222/*
201 * list_replace_rcu - replace old entry by new one 223 * list_replace_rcu - replace old entry by new one
202 * @old : the element to be replaced 224 * @old : the element to be replaced
203 * @new : the new element to insert 225 * @new : the new element to insert
204 * 226 *
205 * The old entry will be replaced with the new entry atomically. 227 * The old entry will be replaced with the new entry atomically.
228 * Note: 'old' should not be empty.
206 */ 229 */
207static inline void list_replace_rcu(struct list_head *old, 230static inline void list_replace_rcu(struct list_head *old,
208 struct list_head *new) 231 struct list_head *new)
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 995f89dc8c04..a8876bc6513b 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -11,7 +11,6 @@
11 11
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13 13
14#include <linux/config.h>
15#include <linux/in.h> 14#include <linux/in.h>
16#include <linux/fs.h> 15#include <linux/fs.h>
17#include <linux/kref.h> 16#include <linux/kref.h>
diff --git a/include/linux/lockd/nlm.h b/include/linux/lockd/nlm.h
index 869b630cba24..d9d46e442538 100644
--- a/include/linux/lockd/nlm.h
+++ b/include/linux/lockd/nlm.h
@@ -9,7 +9,6 @@
9#ifndef LINUX_LOCKD_NLM_H 9#ifndef LINUX_LOCKD_NLM_H
10#define LINUX_LOCKD_NLM_H 10#define LINUX_LOCKD_NLM_H
11 11
12#include <linux/config.h>
13 12
14/* Maximum file offset in file_lock.fl_end */ 13/* Maximum file offset in file_lock.fl_end */
15# define NLM_OFFSET_MAX ((s32) 0x7fffffff) 14# define NLM_OFFSET_MAX ((s32) 0x7fffffff)
diff --git a/include/linux/m41t00.h b/include/linux/m41t00.h
new file mode 100644
index 000000000000..b423360ca38e
--- /dev/null
+++ b/include/linux/m41t00.h
@@ -0,0 +1,50 @@
1/*
2 * Definitions for the ST M41T00 family of i2c rtc chips.
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 *
6 * 2005, 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 _M41T00_H
13#define _M41T00_H
14
15#define M41T00_DRV_NAME "m41t00"
16#define M41T00_I2C_ADDR 0x68
17
18#define M41T00_TYPE_M41T00 0
19#define M41T00_TYPE_M41T81 81
20#define M41T00_TYPE_M41T85 85
21
22struct m41t00_platform_data {
23 u8 type;
24 u8 i2c_addr;
25 u8 sqw_freq;
26};
27
28/* SQW output disabled, this is default value by power on */
29#define M41T00_SQW_DISABLE (0)
30
31#define M41T00_SQW_32KHZ (1<<4) /* 32.768 KHz */
32#define M41T00_SQW_8KHZ (2<<4) /* 8.192 KHz */
33#define M41T00_SQW_4KHZ (3<<4) /* 4.096 KHz */
34#define M41T00_SQW_2KHZ (4<<4) /* 2.048 KHz */
35#define M41T00_SQW_1KHZ (5<<4) /* 1.024 KHz */
36#define M41T00_SQW_512HZ (6<<4) /* 512 Hz */
37#define M41T00_SQW_256HZ (7<<4) /* 256 Hz */
38#define M41T00_SQW_128HZ (8<<4) /* 128 Hz */
39#define M41T00_SQW_64HZ (9<<4) /* 64 Hz */
40#define M41T00_SQW_32HZ (10<<4) /* 32 Hz */
41#define M41T00_SQW_16HZ (11<<4) /* 16 Hz */
42#define M41T00_SQW_8HZ (12<<4) /* 8 Hz */
43#define M41T00_SQW_4HZ (13<<4) /* 4 Hz */
44#define M41T00_SQW_2HZ (14<<4) /* 2 Hz */
45#define M41T00_SQW_1HZ (15<<4) /* 1 Hz */
46
47extern ulong m41t00_get_rtc_time(void);
48extern int m41t00_set_rtc_time(ulong nowtime);
49
50#endif /* _M41T00_H */
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index f5fdca1d67e6..72440f0a443d 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -28,7 +28,6 @@
28 28
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30 30
31#include <linux/config.h>
32#include <linux/mmzone.h> 31#include <linux/mmzone.h>
33#include <linux/slab.h> 32#include <linux/slab.h>
34#include <linux/rbtree.h> 33#include <linux/rbtree.h>
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index ff0a64073ebc..5dba23a1c0d0 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -1,20 +1,19 @@
1#ifndef _LINUX_MIGRATE_H 1#ifndef _LINUX_MIGRATE_H
2#define _LINUX_MIGRATE_H 2#define _LINUX_MIGRATE_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h> 4#include <linux/mm.h>
6 5
6typedef struct page *new_page_t(struct page *, unsigned long private, int **);
7
7#ifdef CONFIG_MIGRATION 8#ifdef CONFIG_MIGRATION
8extern int isolate_lru_page(struct page *p, struct list_head *pagelist); 9extern int isolate_lru_page(struct page *p, struct list_head *pagelist);
9extern int putback_lru_pages(struct list_head *l); 10extern int putback_lru_pages(struct list_head *l);
10extern int migrate_page(struct page *, struct page *); 11extern int migrate_page(struct address_space *,
11extern void migrate_page_copy(struct page *, struct page *); 12 struct page *, struct page *);
12extern int migrate_page_remove_references(struct page *, struct page *, int); 13extern int migrate_pages(struct list_head *l, new_page_t x, unsigned long);
13extern int migrate_pages(struct list_head *l, struct list_head *t, 14
14 struct list_head *moved, struct list_head *failed); 15extern int fail_migrate_page(struct address_space *,
15extern int migrate_pages_to(struct list_head *pagelist, 16 struct page *, struct page *);
16 struct vm_area_struct *vma, int dest);
17extern int fail_migrate_page(struct page *, struct page *);
18 17
19extern int migrate_prep(void); 18extern int migrate_prep(void);
20 19
@@ -23,8 +22,8 @@ extern int migrate_prep(void);
23static inline int isolate_lru_page(struct page *p, struct list_head *list) 22static inline int isolate_lru_page(struct page *p, struct list_head *list)
24 { return -ENOSYS; } 23 { return -ENOSYS; }
25static inline int putback_lru_pages(struct list_head *l) { return 0; } 24static inline int putback_lru_pages(struct list_head *l) { return 0; }
26static inline int migrate_pages(struct list_head *l, struct list_head *t, 25static inline int migrate_pages(struct list_head *l, new_page_t x,
27 struct list_head *moved, struct list_head *failed) { return -ENOSYS; } 26 unsigned long private) { return -ENOSYS; }
28 27
29static inline int migrate_pages_to(struct list_head *pagelist, 28static inline int migrate_pages_to(struct list_head *pagelist,
30 struct vm_area_struct *vma, int dest) { return 0; } 29 struct vm_area_struct *vma, int dest) { return 0; }
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 68f5a0f392dd..beddc6d3b0f6 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -9,7 +9,6 @@
9#define __LINUX_MII_H__ 9#define __LINUX_MII_H__
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/if.h>
13 12
14/* Generic MII registers. */ 13/* Generic MII registers. */
15 14
@@ -136,6 +135,20 @@
136#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */ 135#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */
137#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */ 136#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */
138 137
138/* This structure is used in all SIOCxMIIxxx ioctl calls */
139struct mii_ioctl_data {
140 __u16 phy_id;
141 __u16 reg_num;
142 __u16 val_in;
143 __u16 val_out;
144};
145
146#ifdef __KERNEL__
147
148#include <linux/if.h>
149
150struct ethtool_cmd;
151
139struct mii_if_info { 152struct mii_if_info {
140 int phy_id; 153 int phy_id;
141 int advertising; 154 int advertising;
@@ -151,9 +164,6 @@ struct mii_if_info {
151 void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val); 164 void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val);
152}; 165};
153 166
154struct ethtool_cmd;
155struct mii_ioctl_data;
156
157extern int mii_link_ok (struct mii_if_info *mii); 167extern int mii_link_ok (struct mii_if_info *mii);
158extern int mii_nway_restart (struct mii_if_info *mii); 168extern int mii_nway_restart (struct mii_if_info *mii);
159extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); 169extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
@@ -168,16 +178,6 @@ extern int generic_mii_ioctl(struct mii_if_info *mii_if,
168 unsigned int *duplex_changed); 178 unsigned int *duplex_changed);
169 179
170 180
171
172/* This structure is used in all SIOCxMIIxxx ioctl calls */
173struct mii_ioctl_data {
174 u16 phy_id;
175 u16 reg_num;
176 u16 val_in;
177 u16 val_out;
178};
179
180
181static inline struct mii_ioctl_data *if_mii(struct ifreq *rq) 181static inline struct mii_ioctl_data *if_mii(struct ifreq *rq)
182{ 182{
183 return (struct mii_ioctl_data *) &rq->ifr_ifru; 183 return (struct mii_ioctl_data *) &rq->ifr_ifru;
@@ -235,5 +235,5 @@ static inline unsigned int mii_duplex (unsigned int duplex_lock,
235 return 0; 235 return 0;
236} 236}
237 237
238 238#endif /* __KERNEL__ */
239#endif /* __LINUX_MII_H__ */ 239#endif /* __LINUX_MII_H__ */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1154684209a4..3b09444121d9 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -7,7 +7,6 @@
7 7
8#ifdef __KERNEL__ 8#ifdef __KERNEL__
9 9
10#include <linux/config.h>
11#include <linux/gfp.h> 10#include <linux/gfp.h>
12#include <linux/list.h> 11#include <linux/list.h>
13#include <linux/mmzone.h> 12#include <linux/mmzone.h>
@@ -200,6 +199,10 @@ struct vm_operations_struct {
200 void (*close)(struct vm_area_struct * area); 199 void (*close)(struct vm_area_struct * area);
201 struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); 200 struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type);
202 int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); 201 int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock);
202
203 /* notification that a previously read-only page is about to become
204 * writable, if an error is returned it will cause a SIGBUS */
205 int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page);
203#ifdef CONFIG_NUMA 206#ifdef CONFIG_NUMA
204 int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); 207 int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new);
205 struct mempolicy *(*get_policy)(struct vm_area_struct *vma, 208 struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
@@ -466,10 +469,13 @@ static inline unsigned long page_zonenum(struct page *page)
466struct zone; 469struct zone;
467extern struct zone *zone_table[]; 470extern struct zone *zone_table[];
468 471
472static inline int page_zone_id(struct page *page)
473{
474 return (page->flags >> ZONETABLE_PGSHIFT) & ZONETABLE_MASK;
475}
469static inline struct zone *page_zone(struct page *page) 476static inline struct zone *page_zone(struct page *page)
470{ 477{
471 return zone_table[(page->flags >> ZONETABLE_PGSHIFT) & 478 return zone_table[page_zone_id(page)];
472 ZONETABLE_MASK];
473} 479}
474 480
475static inline unsigned long page_to_nid(struct page *page) 481static inline unsigned long page_to_nid(struct page *page)
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 18a5689ef748..87920a0852a3 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -1,10 +1,6 @@
1#ifndef _LINUX_MMAN_H 1#ifndef _LINUX_MMAN_H
2#define _LINUX_MMAN_H 2#define _LINUX_MMAN_H
3 3
4#include <linux/config.h>
5#include <linux/mm.h>
6
7#include <asm/atomic.h>
8#include <asm/mman.h> 4#include <asm/mman.h>
9 5
10#define MREMAP_MAYMOVE 1 6#define MREMAP_MAYMOVE 1
@@ -13,6 +9,12 @@
13#define OVERCOMMIT_GUESS 0 9#define OVERCOMMIT_GUESS 0
14#define OVERCOMMIT_ALWAYS 1 10#define OVERCOMMIT_ALWAYS 1
15#define OVERCOMMIT_NEVER 2 11#define OVERCOMMIT_NEVER 2
12
13#ifdef __KERNEL__
14#include <linux/mm.h>
15
16#include <asm/atomic.h>
17
16extern int sysctl_overcommit_memory; 18extern int sysctl_overcommit_memory;
17extern int sysctl_overcommit_ratio; 19extern int sysctl_overcommit_ratio;
18extern atomic_t vm_committed_space; 20extern atomic_t vm_committed_space;
@@ -63,5 +65,5 @@ calc_vm_flag_bits(unsigned long flags)
63 _calc_vm_trans(flags, MAP_EXECUTABLE, VM_EXECUTABLE) | 65 _calc_vm_trans(flags, MAP_EXECUTABLE, VM_EXECUTABLE) |
64 _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); 66 _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED );
65} 67}
66 68#endif /* __KERNEL__ */
67#endif /* _LINUX_MMAN_H */ 69#endif /* _LINUX_MMAN_H */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 2d8337150493..d6120fa69116 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -4,7 +4,6 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5#ifndef __ASSEMBLY__ 5#ifndef __ASSEMBLY__
6 6
7#include <linux/config.h>
8#include <linux/spinlock.h> 7#include <linux/spinlock.h>
9#include <linux/list.h> 8#include <linux/list.h>
10#include <linux/wait.h> 9#include <linux/wait.h>
@@ -198,7 +197,7 @@ struct zone {
198 197
199 /* 198 /*
200 * wait_table -- the array holding the hash table 199 * wait_table -- the array holding the hash table
201 * wait_table_size -- the size of the hash table array 200 * wait_table_hash_nr_entries -- the size of the hash table array
202 * wait_table_bits -- wait_table_size == (1 << wait_table_bits) 201 * wait_table_bits -- wait_table_size == (1 << wait_table_bits)
203 * 202 *
204 * The purpose of all these is to keep track of the people 203 * The purpose of all these is to keep track of the people
@@ -221,7 +220,7 @@ struct zone {
221 * free_area_init_core() performs the initialization of them. 220 * free_area_init_core() performs the initialization of them.
222 */ 221 */
223 wait_queue_head_t * wait_table; 222 wait_queue_head_t * wait_table;
224 unsigned long wait_table_size; 223 unsigned long wait_table_hash_nr_entries;
225 unsigned long wait_table_bits; 224 unsigned long wait_table_bits;
226 225
227 /* 226 /*
@@ -334,6 +333,9 @@ void wakeup_kswapd(struct zone *zone, int order);
334int zone_watermark_ok(struct zone *z, int order, unsigned long mark, 333int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
335 int classzone_idx, int alloc_flags); 334 int classzone_idx, int alloc_flags);
336 335
336extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
337 unsigned long size);
338
337#ifdef CONFIG_HAVE_MEMORY_PRESENT 339#ifdef CONFIG_HAVE_MEMORY_PRESENT
338void memory_present(int nid, unsigned long start, unsigned long end); 340void memory_present(int nid, unsigned long start, unsigned long end);
339#else 341#else
@@ -507,6 +509,10 @@ struct mem_section {
507 * pages. However, it is stored with some other magic. 509 * pages. However, it is stored with some other magic.
508 * (see sparse.c::sparse_init_one_section()) 510 * (see sparse.c::sparse_init_one_section())
509 * 511 *
512 * Additionally during early boot we encode node id of
513 * the location of the section here to guide allocation.
514 * (see sparse.c::memory_present())
515 *
510 * Making it a UL at least makes someone do a cast 516 * Making it a UL at least makes someone do a cast
511 * before using it wrong. 517 * before using it wrong.
512 */ 518 */
@@ -546,6 +552,7 @@ extern int __section_nr(struct mem_section* ms);
546#define SECTION_HAS_MEM_MAP (1UL<<1) 552#define SECTION_HAS_MEM_MAP (1UL<<1)
547#define SECTION_MAP_LAST_BIT (1UL<<2) 553#define SECTION_MAP_LAST_BIT (1UL<<2)
548#define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1)) 554#define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1))
555#define SECTION_NID_SHIFT 2
549 556
550static inline struct page *__section_mem_map_addr(struct mem_section *section) 557static inline struct page *__section_mem_map_addr(struct mem_section *section)
551{ 558{
diff --git a/include/linux/module.h b/include/linux/module.h
index eaec13ddd667..2d366098eab5 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -6,7 +6,6 @@
6 * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996 6 * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
7 * Rewritten again by Rusty Russell, 2002 7 * Rewritten again by Rusty Russell, 2002
8 */ 8 */
9#include <linux/config.h>
10#include <linux/sched.h> 9#include <linux/sched.h>
11#include <linux/spinlock.h> 10#include <linux/spinlock.h>
12#include <linux/list.h> 11#include <linux/list.h>
@@ -106,6 +105,8 @@ extern struct module __this_module;
106 * "GPL and additional rights" [GNU Public License v2 rights and more] 105 * "GPL and additional rights" [GNU Public License v2 rights and more]
107 * "Dual BSD/GPL" [GNU Public License v2 106 * "Dual BSD/GPL" [GNU Public License v2
108 * or BSD license choice] 107 * or BSD license choice]
108 * "Dual MIT/GPL" [GNU Public License v2
109 * or MIT license choice]
109 * "Dual MPL/GPL" [GNU Public License v2 110 * "Dual MPL/GPL" [GNU Public License v2
110 * or Mozilla license choice] 111 * or Mozilla license choice]
111 * 112 *
@@ -557,13 +558,4 @@ static inline void module_remove_driver(struct device_driver *driver)
557 558
558#define __MODULE_STRING(x) __stringify(x) 559#define __MODULE_STRING(x) __stringify(x)
559 560
560/* Use symbol_get and symbol_put instead. You'll thank me. */
561#define HAVE_INTER_MODULE
562extern void __deprecated inter_module_register(const char *,
563 struct module *, const void *);
564extern void __deprecated inter_module_unregister(const char *);
565extern const void * __deprecated inter_module_get_request(const char *,
566 const char *);
567extern void __deprecated inter_module_put(const char *);
568
569#endif /* _LINUX_MODULE_H */ 561#endif /* _LINUX_MODULE_H */
diff --git a/include/linux/mount.h b/include/linux/mount.h
index b7472ae91fa4..60718f12caa9 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -17,6 +17,11 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19 19
20struct super_block;
21struct vfsmount;
22struct dentry;
23struct namespace;
24
20#define MNT_NOSUID 0x01 25#define MNT_NOSUID 0x01
21#define MNT_NODEV 0x02 26#define MNT_NODEV 0x02
22#define MNT_NOEXEC 0x04 27#define MNT_NOEXEC 0x04
diff --git a/include/linux/msg.h b/include/linux/msg.h
index 903e0ab8101f..acc7c174ff00 100644
--- a/include/linux/msg.h
+++ b/include/linux/msg.h
@@ -2,7 +2,6 @@
2#define _LINUX_MSG_H 2#define _LINUX_MSG_H
3 3
4#include <linux/ipc.h> 4#include <linux/ipc.h>
5#include <linux/list.h>
6 5
7/* ipcs ctl commands */ 6/* ipcs ctl commands */
8#define MSG_STAT 11 7#define MSG_STAT 11
@@ -63,6 +62,7 @@ struct msginfo {
63#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff) 62#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
64 63
65#ifdef __KERNEL__ 64#ifdef __KERNEL__
65#include <linux/list.h>
66 66
67/* one msg_msg structure for each message */ 67/* one msg_msg structure for each message */
68struct msg_msg { 68struct msg_msg {
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index 23a568910341..09bfae6938b3 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -7,7 +7,6 @@
7#ifndef __MTD_CFI_H__ 7#ifndef __MTD_CFI_H__
8#define __MTD_CFI_H__ 8#define __MTD_CFI_H__
9 9
10#include <linux/config.h>
11#include <linux/delay.h> 10#include <linux/delay.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/interrupt.h> 12#include <linux/interrupt.h>
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h
index d7eaa40e5ab0..6977780e548f 100644
--- a/include/linux/mtd/inftl.h
+++ b/include/linux/mtd/inftl.h
@@ -46,7 +46,7 @@ struct INFTLrecord {
46 unsigned int nb_blocks; /* number of physical blocks */ 46 unsigned int nb_blocks; /* number of physical blocks */
47 unsigned int nb_boot_blocks; /* number of blocks used by the bios */ 47 unsigned int nb_boot_blocks; /* number of blocks used by the bios */
48 struct erase_info instr; 48 struct erase_info instr;
49 struct nand_oobinfo oobinfo; 49 struct nand_ecclayout oobinfo;
50}; 50};
51 51
52int INFTL_mount(struct INFTLrecord *s); 52int INFTL_mount(struct INFTLrecord *s);
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 7dfd6e1fcde7..28d461d862bd 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -5,7 +5,6 @@
5#ifndef __LINUX_MTD_MAP_H__ 5#ifndef __LINUX_MTD_MAP_H__
6#define __LINUX_MTD_MAP_H__ 6#define __LINUX_MTD_MAP_H__
7 7
8#include <linux/config.h>
9#include <linux/types.h> 8#include <linux/types.h>
10#include <linux/list.h> 9#include <linux/list.h>
11#include <linux/string.h> 10#include <linux/string.h>
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index b6f2fdae65c6..9b7a2b525d63 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -13,7 +13,6 @@
13#error This is a kernel header. Perhaps include mtd-user.h instead? 13#error This is a kernel header. Perhaps include mtd-user.h instead?
14#endif 14#endif
15 15
16#include <linux/config.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/uio.h> 18#include <linux/uio.h>
@@ -56,18 +55,69 @@ struct mtd_erase_region_info {
56 u_int32_t numblocks; /* Number of blocks of erasesize in this region */ 55 u_int32_t numblocks; /* Number of blocks of erasesize in this region */
57}; 56};
58 57
58/*
59 * oob operation modes
60 *
61 * MTD_OOB_PLACE: oob data are placed at the given offset
62 * MTD_OOB_AUTO: oob data are automatically placed at the free areas
63 * which are defined by the ecclayout
64 * MTD_OOB_RAW: mode to read raw data+oob in one chunk. The oob data
65 * is inserted into the data. Thats a raw image of the
66 * flash contents.
67 */
68typedef enum {
69 MTD_OOB_PLACE,
70 MTD_OOB_AUTO,
71 MTD_OOB_RAW,
72} mtd_oob_mode_t;
73
74/**
75 * struct mtd_oob_ops - oob operation operands
76 * @mode: operation mode
77 *
78 * @len: number of bytes to write/read. When a data buffer is given
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 *
82 * @retlen: number of bytes written/read. When a data buffer is given
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 *
86 * @ooblen: number of oob bytes per page
87 * @ooboffs: offset of oob data in the oob area (only relevant when
88 * mode = MTD_OOB_PLACE)
89 * @datbuf: data buffer - if NULL only oob data are read/written
90 * @oobbuf: oob data buffer
91 */
92struct mtd_oob_ops {
93 mtd_oob_mode_t mode;
94 size_t len;
95 size_t retlen;
96 size_t ooblen;
97 uint32_t ooboffs;
98 uint8_t *datbuf;
99 uint8_t *oobbuf;
100};
101
59struct mtd_info { 102struct mtd_info {
60 u_char type; 103 u_char type;
61 u_int32_t flags; 104 u_int32_t flags;
62 u_int32_t size; // Total size of the MTD 105 u_int32_t size; // Total size of the MTD
63 106
64 /* "Major" erase size for the device. Naïve users may take this 107 /* "Major" erase size for the device. Naïve users may take this
65 * to be the only erase size available, or may use the more detailed 108 * to be the only erase size available, or may use the more detailed
66 * information below if they desire 109 * information below if they desire
67 */ 110 */
68 u_int32_t erasesize; 111 u_int32_t erasesize;
112 /* Minimal writable flash unit size. In case of NOR flash it is 1 (even
113 * though individual bits can be cleared), in case of NAND flash it is
114 * one NAND page (or half, or one-fourths of it), in case of ECC-ed NOR
115 * it is of ECC block size, etc. It is illegal to have writesize = 0.
116 * Any driver registering a struct mtd_info must ensure a writesize of
117 * 1 or larger.
118 */
119 u_int32_t writesize;
69 120
70 u_int32_t oobblock; // Size of OOB blocks (e.g. 512)
71 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) 121 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16)
72 u_int32_t ecctype; 122 u_int32_t ecctype;
73 u_int32_t eccsize; 123 u_int32_t eccsize;
@@ -79,7 +129,6 @@ struct mtd_info {
79 * MTD_PROGRAM_REGIONS flag is set. 129 * MTD_PROGRAM_REGIONS flag is set.
80 * (Maybe we should have an union for those?) 130 * (Maybe we should have an union for those?)
81 */ 131 */
82#define MTD_PROGREGION_SIZE(mtd) (mtd)->oobblock
83#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize 132#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize
84#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype 133#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype
85 134
@@ -87,9 +136,8 @@ struct mtd_info {
87 char *name; 136 char *name;
88 int index; 137 int index;
89 138
90 // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) 139 /* ecc layout structure pointer - read only ! */
91 struct nand_oobinfo oobinfo; 140 struct nand_ecclayout *ecclayout;
92 u_int32_t oobavail; // Number of bytes in OOB area available for fs
93 141
94 /* Data for variable erase regions. If numeraseregions is zero, 142 /* Data for variable erase regions. If numeraseregions is zero,
95 * it means that the whole device has erasesize as given above. 143 * it means that the whole device has erasesize as given above.
@@ -112,11 +160,10 @@ struct mtd_info {
112 int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 160 int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
113 int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); 161 int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
114 162
115 int (*read_ecc) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); 163 int (*read_oob) (struct mtd_info *mtd, loff_t from,
116 int (*write_ecc) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); 164 struct mtd_oob_ops *ops);
117 165 int (*write_oob) (struct mtd_info *mtd, loff_t to,
118 int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 166 struct mtd_oob_ops *ops);
119 int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
120 167
121 /* 168 /*
122 * Methods to access the protection register area, present in some 169 * Methods to access the protection register area, present in some
@@ -130,17 +177,11 @@ struct mtd_info {
130 int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 177 int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
131 int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len); 178 int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len);
132 179
133 /* kvec-based read/write methods. We need these especially for NAND flash, 180 /* kvec-based read/write methods.
134 with its limited number of write cycles per erase.
135 NB: The 'count' parameter is the number of _vectors_, each of 181 NB: The 'count' parameter is the number of _vectors_, each of
136 which contains an (ofs, len) tuple. 182 which contains an (ofs, len) tuple.
137 */ 183 */
138 int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen);
139 int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from,
140 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
141 int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); 184 int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen);
142 int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to,
143 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
144 185
145 /* Sync */ 186 /* Sync */
146 void (*sync) (struct mtd_info *mtd); 187 void (*sync) (struct mtd_info *mtd);
@@ -159,6 +200,9 @@ struct mtd_info {
159 200
160 struct notifier_block reboot_notifier; /* default mode before reboot */ 201 struct notifier_block reboot_notifier; /* default mode before reboot */
161 202
203 /* ECC status information */
204 struct mtd_ecc_stats ecc_stats;
205
162 void *priv; 206 void *priv;
163 207
164 struct module *owner; 208 struct module *owner;
@@ -192,20 +236,6 @@ int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
192int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, 236int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs,
193 unsigned long count, loff_t from, size_t *retlen); 237 unsigned long count, loff_t from, size_t *retlen);
194 238
195#define MTD_ERASE(mtd, args...) (*(mtd->erase))(mtd, args)
196#define MTD_POINT(mtd, a,b,c,d) (*(mtd->point))(mtd, a,b,c, (u_char **)(d))
197#define MTD_UNPOINT(mtd, arg) (*(mtd->unpoint))(mtd, (u_char *)arg)
198#define MTD_READ(mtd, args...) (*(mtd->read))(mtd, args)
199#define MTD_WRITE(mtd, args...) (*(mtd->write))(mtd, args)
200#define MTD_READV(mtd, args...) (*(mtd->readv))(mtd, args)
201#define MTD_WRITEV(mtd, args...) (*(mtd->writev))(mtd, args)
202#define MTD_READECC(mtd, args...) (*(mtd->read_ecc))(mtd, args)
203#define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args)
204#define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args)
205#define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args)
206#define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0)
207
208
209#ifdef CONFIG_MTD_PARTITIONS 239#ifdef CONFIG_MTD_PARTITIONS
210void mtd_erase_callback(struct erase_info *instr); 240void mtd_erase_callback(struct erase_info *instr);
211#else 241#else
@@ -226,7 +256,7 @@ static inline void mtd_erase_callback(struct erase_info *instr)
226 256
227#ifdef CONFIG_MTD_DEBUG 257#ifdef CONFIG_MTD_DEBUG
228#define DEBUG(n, args...) \ 258#define DEBUG(n, args...) \
229 do { \ 259 do { \
230 if (n <= CONFIG_MTD_DEBUG_VERBOSE) \ 260 if (n <= CONFIG_MTD_DEBUG_VERBOSE) \
231 printk(KERN_INFO args); \ 261 printk(KERN_INFO args); \
232 } while(0) 262 } while(0)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index da5e67b3fc70..66559272ebcb 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -11,52 +11,15 @@
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 * 13 *
14 * Info: 14 * Info:
15 * Contains standard defines and IDs for NAND flash devices 15 * Contains standard defines and IDs for NAND flash devices
16 * 16 *
17 * Changelog: 17 * Changelog:
18 * 01-31-2000 DMW Created 18 * See git changelog.
19 * 09-18-2000 SJH Moved structure out of the Disk-On-Chip drivers
20 * so it can be used by other NAND flash device
21 * drivers. I also changed the copyright since none
22 * of the original contents of this file are specific
23 * to DoC devices. David can whack me with a baseball
24 * bat later if I did something naughty.
25 * 10-11-2000 SJH Added private NAND flash structure for driver
26 * 10-24-2000 SJH Added prototype for 'nand_scan' function
27 * 10-29-2001 TG changed nand_chip structure to support
28 * hardwarespecific function for accessing control lines
29 * 02-21-2002 TG added support for different read/write adress and
30 * ready/busy line access function
31 * 02-26-2002 TG added chip_delay to nand_chip structure to optimize
32 * command delay times for different chips
33 * 04-28-2002 TG OOB config defines moved from nand.c to avoid duplicate
34 * defines in jffs2/wbuf.c
35 * 08-07-2002 TG forced bad block location to byte 5 of OOB, even if
36 * CONFIG_MTD_NAND_ECC_JFFS2 is not set
37 * 08-10-2002 TG extensions to nand_chip structure to support HW-ECC
38 *
39 * 08-29-2002 tglx nand_chip structure: data_poi for selecting
40 * internal / fs-driver buffer
41 * support for 6byte/512byte hardware ECC
42 * read_ecc, write_ecc extended for different oob-layout
43 * oob layout selections: NAND_NONE_OOB, NAND_JFFS2_OOB,
44 * NAND_YAFFS_OOB
45 * 11-25-2002 tglx Added Manufacturer code FUJITSU, NATIONAL
46 * Split manufacturer and device ID structures
47 *
48 * 02-08-2004 tglx added option field to nand structure for chip anomalities
49 * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id
50 * update of nand_chip structure description
51 * 01-17-2005 dmarlin added extended commands for AG-AND device and added option
52 * for BBT_AUTO_REFRESH.
53 * 01-20-2005 dmarlin added optional pointer to hardware specific callback for
54 * extra error status checks.
55 */ 19 */
56#ifndef __LINUX_MTD_NAND_H 20#ifndef __LINUX_MTD_NAND_H
57#define __LINUX_MTD_NAND_H 21#define __LINUX_MTD_NAND_H
58 22
59#include <linux/config.h>
60#include <linux/wait.h> 23#include <linux/wait.h>
61#include <linux/spinlock.h> 24#include <linux/spinlock.h>
62#include <linux/mtd/mtd.h> 25#include <linux/mtd/mtd.h>
@@ -67,10 +30,6 @@ extern int nand_scan (struct mtd_info *mtd, int max_chips);
67/* Free resources held by the NAND device */ 30/* Free resources held by the NAND device */
68extern void nand_release (struct mtd_info *mtd); 31extern void nand_release (struct mtd_info *mtd);
69 32
70/* Read raw data from the device without ECC */
71extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_t len, size_t ooblen);
72
73
74/* The maximum number of NAND chips in an array */ 33/* The maximum number of NAND chips in an array */
75#define NAND_MAX_CHIPS 8 34#define NAND_MAX_CHIPS 8
76 35
@@ -79,44 +38,45 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
79 * adjust this accordingly. 38 * adjust this accordingly.
80 */ 39 */
81#define NAND_MAX_OOBSIZE 64 40#define NAND_MAX_OOBSIZE 64
41#define NAND_MAX_PAGESIZE 2048
82 42
83/* 43/*
84 * Constants for hardware specific CLE/ALE/NCE function 44 * Constants for hardware specific CLE/ALE/NCE function
85*/ 45 *
46 * These are bits which can be or'ed to set/clear multiple
47 * bits in one go.
48 */
86/* Select the chip by setting nCE to low */ 49/* Select the chip by setting nCE to low */
87#define NAND_CTL_SETNCE 1 50#define NAND_NCE 0x01
88/* Deselect the chip by setting nCE to high */
89#define NAND_CTL_CLRNCE 2
90/* Select the command latch by setting CLE to high */ 51/* Select the command latch by setting CLE to high */
91#define NAND_CTL_SETCLE 3 52#define NAND_CLE 0x02
92/* Deselect the command latch by setting CLE to low */
93#define NAND_CTL_CLRCLE 4
94/* Select the address latch by setting ALE to high */ 53/* Select the address latch by setting ALE to high */
95#define NAND_CTL_SETALE 5 54#define NAND_ALE 0x04
96/* Deselect the address latch by setting ALE to low */ 55
97#define NAND_CTL_CLRALE 6 56#define NAND_CTRL_CLE (NAND_NCE | NAND_CLE)
98/* Set write protection by setting WP to high. Not used! */ 57#define NAND_CTRL_ALE (NAND_NCE | NAND_ALE)
99#define NAND_CTL_SETWP 7 58#define NAND_CTRL_CHANGE 0x80
100/* Clear write protection by setting WP to low. Not used! */
101#define NAND_CTL_CLRWP 8
102 59
103/* 60/*
104 * Standard NAND flash commands 61 * Standard NAND flash commands
105 */ 62 */
106#define NAND_CMD_READ0 0 63#define NAND_CMD_READ0 0
107#define NAND_CMD_READ1 1 64#define NAND_CMD_READ1 1
65#define NAND_CMD_RNDOUT 5
108#define NAND_CMD_PAGEPROG 0x10 66#define NAND_CMD_PAGEPROG 0x10
109#define NAND_CMD_READOOB 0x50 67#define NAND_CMD_READOOB 0x50
110#define NAND_CMD_ERASE1 0x60 68#define NAND_CMD_ERASE1 0x60
111#define NAND_CMD_STATUS 0x70 69#define NAND_CMD_STATUS 0x70
112#define NAND_CMD_STATUS_MULTI 0x71 70#define NAND_CMD_STATUS_MULTI 0x71
113#define NAND_CMD_SEQIN 0x80 71#define NAND_CMD_SEQIN 0x80
72#define NAND_CMD_RNDIN 0x85
114#define NAND_CMD_READID 0x90 73#define NAND_CMD_READID 0x90
115#define NAND_CMD_ERASE2 0xd0 74#define NAND_CMD_ERASE2 0xd0
116#define NAND_CMD_RESET 0xff 75#define NAND_CMD_RESET 0xff
117 76
118/* Extended commands for large page devices */ 77/* Extended commands for large page devices */
119#define NAND_CMD_READSTART 0x30 78#define NAND_CMD_READSTART 0x30
79#define NAND_CMD_RNDOUTSTART 0xE0
120#define NAND_CMD_CACHEDPROG 0x15 80#define NAND_CMD_CACHEDPROG 0x15
121 81
122/* Extended commands for AG-AND device */ 82/* Extended commands for AG-AND device */
@@ -138,6 +98,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
138#define NAND_CMD_STATUS_RESET 0x7f 98#define NAND_CMD_STATUS_RESET 0x7f
139#define NAND_CMD_STATUS_CLEAR 0xff 99#define NAND_CMD_STATUS_CLEAR 0xff
140 100
101#define NAND_CMD_NONE -1
102
141/* Status bits */ 103/* Status bits */
142#define NAND_STATUS_FAIL 0x01 104#define NAND_STATUS_FAIL 0x01
143#define NAND_STATUS_FAIL_N1 0x02 105#define NAND_STATUS_FAIL_N1 0x02
@@ -148,21 +110,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
148/* 110/*
149 * Constants for ECC_MODES 111 * Constants for ECC_MODES
150 */ 112 */
151 113typedef enum {
152/* No ECC. Usage is not recommended ! */ 114 NAND_ECC_NONE,
153#define NAND_ECC_NONE 0 115 NAND_ECC_SOFT,
154/* Software ECC 3 byte ECC per 256 Byte data */ 116 NAND_ECC_HW,
155#define NAND_ECC_SOFT 1 117 NAND_ECC_HW_SYNDROME,
156/* Hardware ECC 3 byte ECC per 256 Byte data */ 118} nand_ecc_modes_t;
157#define NAND_ECC_HW3_256 2
158/* Hardware ECC 3 byte ECC per 512 Byte data */
159#define NAND_ECC_HW3_512 3
160/* Hardware ECC 3 byte ECC per 512 Byte data */
161#define NAND_ECC_HW6_512 4
162/* Hardware ECC 8 byte ECC per 512 Byte data */
163#define NAND_ECC_HW8_512 6
164/* Hardware ECC 12 byte ECC per 2048 Byte data */
165#define NAND_ECC_HW12_2048 7
166 119
167/* 120/*
168 * Constants for Hardware ECC 121 * Constants for Hardware ECC
@@ -201,6 +154,10 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
201 * bits from adjacent blocks from 'leaking' in altering data. 154 * bits from adjacent blocks from 'leaking' in altering data.
202 * This happens with the Renesas AG-AND chips, possibly others. */ 155 * This happens with the Renesas AG-AND chips, possibly others. */
203#define BBT_AUTO_REFRESH 0x00000080 156#define BBT_AUTO_REFRESH 0x00000080
157/* Chip does not require ready check on read. True
158 * for all large page devices, as they do not support
159 * autoincrement.*/
160#define NAND_NO_READRDY 0x00000100
204 161
205/* Options valid for Samsung large page devices */ 162/* Options valid for Samsung large page devices */
206#define NAND_SAMSUNG_LP_OPTIONS \ 163#define NAND_SAMSUNG_LP_OPTIONS \
@@ -219,18 +176,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
219/* Use a flash based bad block table. This option is passed to the 176/* Use a flash based bad block table. This option is passed to the
220 * default bad block table function. */ 177 * default bad block table function. */
221#define NAND_USE_FLASH_BBT 0x00010000 178#define NAND_USE_FLASH_BBT 0x00010000
222/* The hw ecc generator provides a syndrome instead a ecc value on read
223 * This can only work if we have the ecc bytes directly behind the
224 * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */
225#define NAND_HWECC_SYNDROME 0x00020000
226/* This option skips the bbt scan during initialization. */ 179/* This option skips the bbt scan during initialization. */
227#define NAND_SKIP_BBTSCAN 0x00040000 180#define NAND_SKIP_BBTSCAN 0x00020000
228 181
229/* Options set by nand scan */ 182/* Options set by nand scan */
230/* Nand scan has allocated oob_buf */ 183/* Nand scan has allocated controller struct */
231#define NAND_OOBBUF_ALLOC 0x40000000 184#define NAND_CONTROLLER_ALLOC 0x80000000
232/* Nand scan has allocated data_buf */
233#define NAND_DATABUF_ALLOC 0x80000000
234 185
235 186
236/* 187/*
@@ -264,45 +215,102 @@ struct nand_hw_control {
264}; 215};
265 216
266/** 217/**
218 * struct nand_ecc_ctrl - Control structure for ecc
219 * @mode: ecc mode
220 * @steps: number of ecc steps per page
221 * @size: data bytes per ecc step
222 * @bytes: ecc bytes per step
223 * @total: total number of ecc bytes per page
224 * @prepad: padding information for syndrome based ecc generators
225 * @postpad: padding information for syndrome based ecc generators
226 * @hwctl: function to control hardware ecc generator. Must only
227 * be provided if an hardware ECC is available
228 * @calculate: function for ecc calculation or readback from ecc hardware
229 * @correct: function for ecc correction, matching to ecc generator (sw/hw)
230 * @read_page: function to read a page according to the ecc generator requirements
231 * @write_page: function to write a page according to the ecc generator requirements
232 */
233struct nand_ecc_ctrl {
234 nand_ecc_modes_t mode;
235 int steps;
236 int size;
237 int bytes;
238 int total;
239 int prepad;
240 int postpad;
241 struct nand_ecclayout *layout;
242 void (*hwctl)(struct mtd_info *mtd, int mode);
243 int (*calculate)(struct mtd_info *mtd,
244 const uint8_t *dat,
245 uint8_t *ecc_code);
246 int (*correct)(struct mtd_info *mtd, uint8_t *dat,
247 uint8_t *read_ecc,
248 uint8_t *calc_ecc);
249 int (*read_page)(struct mtd_info *mtd,
250 struct nand_chip *chip,
251 uint8_t *buf);
252 void (*write_page)(struct mtd_info *mtd,
253 struct nand_chip *chip,
254 const uint8_t *buf);
255 int (*read_oob)(struct mtd_info *mtd,
256 struct nand_chip *chip,
257 int page,
258 int sndcmd);
259 int (*write_oob)(struct mtd_info *mtd,
260 struct nand_chip *chip,
261 int page);
262};
263
264/**
265 * struct nand_buffers - buffer structure for read/write
266 * @ecccalc: buffer for calculated ecc
267 * @ecccode: buffer for ecc read from flash
268 * @oobwbuf: buffer for write oob data
269 * @databuf: buffer for data - dynamically sized
270 * @oobrbuf: buffer to read oob data
271 *
272 * Do not change the order of buffers. databuf and oobrbuf must be in
273 * consecutive order.
274 */
275struct nand_buffers {
276 uint8_t ecccalc[NAND_MAX_OOBSIZE];
277 uint8_t ecccode[NAND_MAX_OOBSIZE];
278 uint8_t oobwbuf[NAND_MAX_OOBSIZE];
279 uint8_t databuf[NAND_MAX_PAGESIZE];
280 uint8_t oobrbuf[NAND_MAX_OOBSIZE];
281};
282
283/**
267 * struct nand_chip - NAND Private Flash Chip Data 284 * struct nand_chip - NAND Private Flash Chip Data
268 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device 285 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device
269 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device 286 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device
270 * @read_byte: [REPLACEABLE] read one byte from the chip 287 * @read_byte: [REPLACEABLE] read one byte from the chip
271 * @write_byte: [REPLACEABLE] write one byte to the chip
272 * @read_word: [REPLACEABLE] read one word from the chip 288 * @read_word: [REPLACEABLE] read one word from the chip
273 * @write_word: [REPLACEABLE] write one word to the chip
274 * @write_buf: [REPLACEABLE] write data from the buffer to the chip 289 * @write_buf: [REPLACEABLE] write data from the buffer to the chip
275 * @read_buf: [REPLACEABLE] read data from the chip into the buffer 290 * @read_buf: [REPLACEABLE] read data from the chip into the buffer
276 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data 291 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data
277 * @select_chip: [REPLACEABLE] select chip nr 292 * @select_chip: [REPLACEABLE] select chip nr
278 * @block_bad: [REPLACEABLE] check, if the block is bad 293 * @block_bad: [REPLACEABLE] check, if the block is bad
279 * @block_markbad: [REPLACEABLE] mark the block bad 294 * @block_markbad: [REPLACEABLE] mark the block bad
280 * @hwcontrol: [BOARDSPECIFIC] hardwarespecific function for accesing control-lines 295 * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling
296 * ALE/CLE/nCE. Also used to write command and address
281 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line 297 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line
282 * If set to NULL no access to ready/busy is available and the ready/busy information 298 * If set to NULL no access to ready/busy is available and the ready/busy information
283 * is read from the chip status register 299 * is read from the chip status register
284 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip 300 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip
285 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready 301 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready
286 * @calculate_ecc: [REPLACEABLE] function for ecc calculation or readback from ecc hardware 302 * @ecc: [BOARDSPECIFIC] ecc control ctructure
287 * @correct_data: [REPLACEABLE] function for ecc correction, matching to ecc generator (sw/hw)
288 * @enable_hwecc: [BOARDSPECIFIC] function to enable (reset) hardware ecc generator. Must only
289 * be provided if a hardware ECC is available
290 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support 303 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support
291 * @scan_bbt: [REPLACEABLE] function to scan bad block table 304 * @scan_bbt: [REPLACEABLE] function to scan bad block table
292 * @eccmode: [BOARDSPECIFIC] mode of ecc, see defines
293 * @eccsize: [INTERN] databytes used per ecc-calculation
294 * @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step
295 * @eccsteps: [INTERN] number of ecc calculation steps per page
296 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) 305 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR)
297 * @chip_lock: [INTERN] spinlock used to protect access to this structure and the chip
298 * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress 306 * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress
299 * @state: [INTERN] the current state of the NAND device 307 * @state: [INTERN] the current state of the NAND device
300 * @page_shift: [INTERN] number of address bits in a page (column address bits) 308 * @page_shift: [INTERN] number of address bits in a page (column address bits)
301 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock 309 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock
302 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry 310 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry
303 * @chip_shift: [INTERN] number of address bits in one chip 311 * @chip_shift: [INTERN] number of address bits in one chip
304 * @data_buf: [INTERN] internal buffer for one page + oob 312 * @datbuf: [INTERN] internal buffer for one page + oob
305 * @oob_buf: [INTERN] oob buffer for one eraseblock 313 * @oobbuf: [INTERN] oob buffer for one eraseblock
306 * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized 314 * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized
307 * @data_poi: [INTERN] pointer to a data buffer 315 * @data_poi: [INTERN] pointer to a data buffer
308 * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about 316 * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about
@@ -312,12 +320,13 @@ struct nand_hw_control {
312 * @chipsize: [INTERN] the size of one chip for multichip arrays 320 * @chipsize: [INTERN] the size of one chip for multichip arrays
313 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 321 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
314 * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf 322 * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf
315 * @autooob: [REPLACEABLE] the default (auto)placement scheme 323 * @ecclayout: [REPLACEABLE] the default ecc placement scheme
316 * @bbt: [INTERN] bad block table pointer 324 * @bbt: [INTERN] bad block table pointer
317 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup 325 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup
318 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor 326 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor
319 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan 327 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan
320 * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices 328 * @controller: [REPLACEABLE] a pointer to a hardware controller structure
329 * which is shared among multiple independend devices
321 * @priv: [OPTIONAL] pointer to private chip date 330 * @priv: [OPTIONAL] pointer to private chip date
322 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks 331 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
323 * (determine if errors are correctable) 332 * (determine if errors are correctable)
@@ -325,58 +334,57 @@ struct nand_hw_control {
325 334
326struct nand_chip { 335struct nand_chip {
327 void __iomem *IO_ADDR_R; 336 void __iomem *IO_ADDR_R;
328 void __iomem *IO_ADDR_W; 337 void __iomem *IO_ADDR_W;
329 338
330 u_char (*read_byte)(struct mtd_info *mtd); 339 uint8_t (*read_byte)(struct mtd_info *mtd);
331 void (*write_byte)(struct mtd_info *mtd, u_char byte);
332 u16 (*read_word)(struct mtd_info *mtd); 340 u16 (*read_word)(struct mtd_info *mtd);
333 void (*write_word)(struct mtd_info *mtd, u16 word); 341 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
334 342 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
335 void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len); 343 int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
336 void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len);
337 int (*verify_buf)(struct mtd_info *mtd, const u_char *buf, int len);
338 void (*select_chip)(struct mtd_info *mtd, int chip); 344 void (*select_chip)(struct mtd_info *mtd, int chip);
339 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); 345 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
340 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); 346 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
341 void (*hwcontrol)(struct mtd_info *mtd, int cmd); 347 void (*cmd_ctrl)(struct mtd_info *mtd, int dat,
342 int (*dev_ready)(struct mtd_info *mtd); 348 unsigned int ctrl);
343 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); 349 int (*dev_ready)(struct mtd_info *mtd);
344 int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this, int state); 350 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr);
345 int (*calculate_ecc)(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); 351 int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
346 int (*correct_data)(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc);
347 void (*enable_hwecc)(struct mtd_info *mtd, int mode);
348 void (*erase_cmd)(struct mtd_info *mtd, int page); 352 void (*erase_cmd)(struct mtd_info *mtd, int page);
349 int (*scan_bbt)(struct mtd_info *mtd); 353 int (*scan_bbt)(struct mtd_info *mtd);
350 int eccmode; 354 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
351 int eccsize; 355
352 int eccbytes; 356 int chip_delay;
353 int eccsteps; 357 unsigned int options;
354 int chip_delay; 358
355 spinlock_t chip_lock; 359 int page_shift;
356 wait_queue_head_t wq;
357 nand_state_t state;
358 int page_shift;
359 int phys_erase_shift; 360 int phys_erase_shift;
360 int bbt_erase_shift; 361 int bbt_erase_shift;
361 int chip_shift; 362 int chip_shift;
362 u_char *data_buf;
363 u_char *oob_buf;
364 int oobdirty;
365 u_char *data_poi;
366 unsigned int options;
367 int badblockpos;
368 int numchips; 363 int numchips;
369 unsigned long chipsize; 364 unsigned long chipsize;
370 int pagemask; 365 int pagemask;
371 int pagebuf; 366 int pagebuf;
372 struct nand_oobinfo *autooob; 367 int badblockpos;
368
369 nand_state_t state;
370
371 uint8_t *oob_poi;
372 struct nand_hw_control *controller;
373 struct nand_ecclayout *ecclayout;
374
375 struct nand_ecc_ctrl ecc;
376 struct nand_buffers buffers;
377 struct nand_hw_control hwcontrol;
378
379 struct mtd_oob_ops ops;
380
373 uint8_t *bbt; 381 uint8_t *bbt;
374 struct nand_bbt_descr *bbt_td; 382 struct nand_bbt_descr *bbt_td;
375 struct nand_bbt_descr *bbt_md; 383 struct nand_bbt_descr *bbt_md;
384
376 struct nand_bbt_descr *badblock_pattern; 385 struct nand_bbt_descr *badblock_pattern;
377 struct nand_hw_control *controller; 386
378 void *priv; 387 void *priv;
379 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
380}; 388};
381 389
382/* 390/*
@@ -388,19 +396,19 @@ struct nand_chip {
388#define NAND_MFR_NATIONAL 0x8f 396#define NAND_MFR_NATIONAL 0x8f
389#define NAND_MFR_RENESAS 0x07 397#define NAND_MFR_RENESAS 0x07
390#define NAND_MFR_STMICRO 0x20 398#define NAND_MFR_STMICRO 0x20
391#define NAND_MFR_HYNIX 0xad 399#define NAND_MFR_HYNIX 0xad
392 400
393/** 401/**
394 * struct nand_flash_dev - NAND Flash Device ID Structure 402 * struct nand_flash_dev - NAND Flash Device ID Structure
395 * 403 *
396 * @name: Identify the device type 404 * @name: Identify the device type
397 * @id: device ID code 405 * @id: device ID code
398 * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 406 * @pagesize: Pagesize in bytes. Either 256 or 512 or 0
399 * If the pagesize is 0, then the real pagesize 407 * If the pagesize is 0, then the real pagesize
400 * and the eraseize are determined from the 408 * and the eraseize are determined from the
401 * extended id bytes in the chip 409 * extended id bytes in the chip
402 * @erasesize: Size of an erase block in the flash device. 410 * @erasesize: Size of an erase block in the flash device.
403 * @chipsize: Total chipsize in Mega Bytes 411 * @chipsize: Total chipsize in Mega Bytes
404 * @options: Bitfield to store chip relevant options 412 * @options: Bitfield to store chip relevant options
405 */ 413 */
406struct nand_flash_dev { 414struct nand_flash_dev {
@@ -415,7 +423,7 @@ struct nand_flash_dev {
415/** 423/**
416 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure 424 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure
417 * @name: Manufacturer name 425 * @name: Manufacturer name
418 * @id: manufacturer ID code of device. 426 * @id: manufacturer ID code of device.
419*/ 427*/
420struct nand_manufacturers { 428struct nand_manufacturers {
421 int id; 429 int id;
@@ -455,7 +463,7 @@ struct nand_bbt_descr {
455 int veroffs; 463 int veroffs;
456 uint8_t version[NAND_MAX_CHIPS]; 464 uint8_t version[NAND_MAX_CHIPS];
457 int len; 465 int len;
458 int maxblocks; 466 int maxblocks;
459 int reserved_block_code; 467 int reserved_block_code;
460 uint8_t *pattern; 468 uint8_t *pattern;
461}; 469};
@@ -494,14 +502,14 @@ struct nand_bbt_descr {
494/* The maximum number of blocks to scan for a bbt */ 502/* The maximum number of blocks to scan for a bbt */
495#define NAND_BBT_SCAN_MAXBLOCKS 4 503#define NAND_BBT_SCAN_MAXBLOCKS 4
496 504
497extern int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd); 505extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
498extern int nand_update_bbt (struct mtd_info *mtd, loff_t offs); 506extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs);
499extern int nand_default_bbt (struct mtd_info *mtd); 507extern int nand_default_bbt(struct mtd_info *mtd);
500extern int nand_isbad_bbt (struct mtd_info *mtd, loff_t offs, int allowbbt); 508extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt);
501extern int nand_erase_nand (struct mtd_info *mtd, struct erase_info *instr, int allowbbt); 509extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
502extern int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, 510 int allowbbt);
503 size_t * retlen, u_char * buf, u_char * oob_buf, 511extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
504 struct nand_oobinfo *oobsel, int flags); 512 size_t * retlen, uint8_t * buf);
505 513
506/* 514/*
507* Constants for oob configuration 515* Constants for oob configuration
@@ -509,4 +517,53 @@ extern int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
509#define NAND_SMALL_BADBLOCK_POS 5 517#define NAND_SMALL_BADBLOCK_POS 5
510#define NAND_LARGE_BADBLOCK_POS 0 518#define NAND_LARGE_BADBLOCK_POS 0
511 519
520/**
521 * struct platform_nand_chip - chip level device structure
522 *
523 * @nr_chips: max. number of chips to scan for
524 * @chip_offs: chip number offset
525 * @nr_partitions: number of partitions pointed to by partitions (or zero)
526 * @partitions: mtd partition list
527 * @chip_delay: R/B delay value in us
528 * @options: Option flags, e.g. 16bit buswidth
529 * @ecclayout: ecc layout info structure
530 * @priv: hardware controller specific settings
531 */
532struct platform_nand_chip {
533 int nr_chips;
534 int chip_offset;
535 int nr_partitions;
536 struct mtd_partition *partitions;
537 struct nand_ecclayout *ecclayout;
538 int chip_delay;
539 unsigned int options;
540 void *priv;
541};
542
543/**
544 * struct platform_nand_ctrl - controller level device structure
545 *
546 * @hwcontrol: platform specific hardware control structure
547 * @dev_ready: platform specific function to read ready/busy pin
548 * @select_chip: platform specific chip select function
549 * @priv_data: private data to transport driver specific settings
550 *
551 * All fields are optional and depend on the hardware driver requirements
552 */
553struct platform_nand_ctrl {
554 void (*hwcontrol)(struct mtd_info *mtd, int cmd);
555 int (*dev_ready)(struct mtd_info *mtd);
556 void (*select_chip)(struct mtd_info *mtd, int chip);
557 void *priv;
558};
559
560/* Some helpers to access the data structures */
561static inline
562struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd)
563{
564 struct nand_chip *chip = mtd->priv;
565
566 return chip->priv;
567}
568
512#endif /* __LINUX_MTD_NAND_H */ 569#endif /* __LINUX_MTD_NAND_H */
diff --git a/include/linux/mtd/ndfc.h b/include/linux/mtd/ndfc.h
new file mode 100644
index 000000000000..d0558a982628
--- /dev/null
+++ b/include/linux/mtd/ndfc.h
@@ -0,0 +1,67 @@
1/*
2 * linux/include/linux/mtd/ndfc.h
3 *
4 * Copyright (c) 2006 Thomas Gleixner <tglx@linutronix.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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Info:
11 * Contains defines, datastructures for ndfc nand controller
12 *
13 */
14#ifndef __LINUX_MTD_NDFC_H
15#define __LINUX_MTD_NDFC_H
16
17/* NDFC Register definitions */
18#define NDFC_CMD 0x00
19#define NDFC_ALE 0x04
20#define NDFC_DATA 0x08
21#define NDFC_ECC 0x10
22#define NDFC_BCFG0 0x30
23#define NDFC_BCFG1 0x34
24#define NDFC_BCFG2 0x38
25#define NDFC_BCFG3 0x3c
26#define NDFC_CCR 0x40
27#define NDFC_STAT 0x44
28#define NDFC_HWCTL 0x48
29#define NDFC_REVID 0x50
30
31#define NDFC_STAT_IS_READY 0x01000000
32
33#define NDFC_CCR_RESET_CE 0x80000000 /* CE Reset */
34#define NDFC_CCR_RESET_ECC 0x40000000 /* ECC Reset */
35#define NDFC_CCR_RIE 0x20000000 /* Interrupt Enable on Device Rdy */
36#define NDFC_CCR_REN 0x10000000 /* Enable wait for Rdy in LinearR */
37#define NDFC_CCR_ROMEN 0x08000000 /* Enable ROM In LinearR */
38#define NDFC_CCR_ARE 0x04000000 /* Auto-Read Enable */
39#define NDFC_CCR_BS(x) (((x) & 0x3) << 24) /* Select Bank on CE[x] */
40#define NDFC_CCR_BS_MASK 0x03000000 /* Select Bank */
41#define NDFC_CCR_ARAC0 0x00000000 /* 3 Addr, 1 Col 2 Row 512b page */
42#define NDFC_CCR_ARAC1 0x00001000 /* 4 Addr, 1 Col 3 Row 512b page */
43#define NDFC_CCR_ARAC2 0x00002000 /* 4 Addr, 2 Col 2 Row 2K page */
44#define NDFC_CCR_ARAC3 0x00003000 /* 5 Addr, 2 Col 3 Row 2K page */
45#define NDFC_CCR_ARAC_MASK 0x00003000 /* Auto-Read mode Addr Cycles */
46#define NDFC_CCR_RPG 0x0000C000 /* Auto-Read Page */
47#define NDFC_CCR_EBCC 0x00000004 /* EBC Configuration Completed */
48#define NDFC_CCR_DHC 0x00000002 /* Direct Hardware Control Enable */
49
50#define NDFC_BxCFG_EN 0x80000000 /* Bank Enable */
51#define NDFC_BxCFG_CED 0x40000000 /* nCE Style */
52#define NDFC_BxCFG_SZ_MASK 0x08000000 /* Bank Size */
53#define NDFC_BxCFG_SZ_8BIT 0x00000000 /* 8bit */
54#define NDFC_BxCFG_SZ_16BIT 0x08000000 /* 16bit */
55
56#define NDFC_MAX_BANKS 4
57
58struct ndfc_controller_settings {
59 uint32_t ccr_settings;
60 uint64_t ndfc_erpn;
61};
62
63struct ndfc_chip_settings {
64 uint32_t bank_settings;
65};
66
67#endif
diff --git a/include/linux/mtd/nftl.h b/include/linux/mtd/nftl.h
index d35d2c21ff3e..bcf2fb3fa4a7 100644
--- a/include/linux/mtd/nftl.h
+++ b/include/linux/mtd/nftl.h
@@ -37,7 +37,7 @@ struct NFTLrecord {
37 unsigned int nb_blocks; /* number of physical blocks */ 37 unsigned int nb_blocks; /* number of physical blocks */
38 unsigned int nb_boot_blocks; /* number of blocks used by the bios */ 38 unsigned int nb_boot_blocks; /* number of blocks used by the bios */
39 struct erase_info instr; 39 struct erase_info instr;
40 struct nand_oobinfo oobinfo; 40 struct nand_ecclayout oobinfo;
41}; 41};
42 42
43int NFTL_mount(struct NFTLrecord *s); 43int NFTL_mount(struct NFTLrecord *s);
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 7419b5fab133..9ce9a48db444 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -35,6 +35,8 @@ typedef enum {
35 FL_SYNCING, 35 FL_SYNCING,
36 FL_UNLOCKING, 36 FL_UNLOCKING,
37 FL_LOCKING, 37 FL_LOCKING,
38 FL_RESETING,
39 FL_OTPING,
38 FL_PM_SUSPENDED, 40 FL_PM_SUSPENDED,
39} onenand_state_t; 41} onenand_state_t;
40 42
@@ -75,7 +77,7 @@ struct onenand_bufferram {
75 * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip 77 * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip
76 * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress 78 * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress
77 * @param state [INTERN] the current state of the OneNAND device 79 * @param state [INTERN] the current state of the OneNAND device
78 * @param autooob [REPLACEABLE] the default (auto)placement scheme 80 * @param ecclayout [REPLACEABLE] the default ecc placement scheme
79 * @param bbm [REPLACEABLE] pointer to Bad Block Management 81 * @param bbm [REPLACEABLE] pointer to Bad Block Management
80 * @param priv [OPTIONAL] pointer to private chip date 82 * @param priv [OPTIONAL] pointer to private chip date
81 */ 83 */
@@ -111,9 +113,9 @@ struct onenand_chip {
111 onenand_state_t state; 113 onenand_state_t state;
112 unsigned char *page_buf; 114 unsigned char *page_buf;
113 115
114 struct nand_oobinfo *autooob; 116 struct nand_ecclayout *ecclayout;
115 117
116 void *bbm; 118 void *bbm;
117 119
118 void *priv; 120 void *priv;
119}; 121};
@@ -130,6 +132,9 @@ struct onenand_chip {
130#define ONENAND_SET_SYS_CFG1(v, this) \ 132#define ONENAND_SET_SYS_CFG1(v, this) \
131 (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1)) 133 (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1))
132 134
135/* Check byte access in OneNAND */
136#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
137
133/* 138/*
134 * Options bits 139 * Options bits
135 */ 140 */
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index d7832ef8ed63..4a72818d2545 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -112,6 +112,7 @@
112#define ONENAND_CMD_LOCK_TIGHT (0x2C) 112#define ONENAND_CMD_LOCK_TIGHT (0x2C)
113#define ONENAND_CMD_ERASE (0x94) 113#define ONENAND_CMD_ERASE (0x94)
114#define ONENAND_CMD_RESET (0xF0) 114#define ONENAND_CMD_RESET (0xF0)
115#define ONENAND_CMD_OTP_ACCESS (0x65)
115#define ONENAND_CMD_READID (0x90) 116#define ONENAND_CMD_READID (0x90)
116 117
117/* NOTE: Those are not *REAL* commands */ 118/* NOTE: Those are not *REAL* commands */
@@ -152,6 +153,8 @@
152#define ONENAND_CTRL_ERASE (1 << 11) 153#define ONENAND_CTRL_ERASE (1 << 11)
153#define ONENAND_CTRL_ERROR (1 << 10) 154#define ONENAND_CTRL_ERROR (1 << 10)
154#define ONENAND_CTRL_RSTB (1 << 7) 155#define ONENAND_CTRL_RSTB (1 << 7)
156#define ONENAND_CTRL_OTP_L (1 << 6)
157#define ONENAND_CTRL_OTP_BL (1 << 5)
155 158
156/* 159/*
157 * Interrupt Status Register F241h (R) 160 * Interrupt Status Register F241h (R)
@@ -177,4 +180,9 @@
177#define ONENAND_ECC_2BIT (1 << 1) 180#define ONENAND_ECC_2BIT (1 << 1)
178#define ONENAND_ECC_2BIT_ALL (0xAAAA) 181#define ONENAND_ECC_2BIT_ALL (0xAAAA)
179 182
183/*
184 * One-Time Programmable (OTP)
185 */
186#define ONENAND_OTP_LOCK_OFFSET (14)
187
180#endif /* __ONENAND_REG_H */ 188#endif /* __ONENAND_REG_H */
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index b03f512d51b9..da6b3d6f12a7 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -41,7 +41,7 @@ struct mtd_partition {
41 u_int32_t size; /* partition size */ 41 u_int32_t size; /* partition size */
42 u_int32_t offset; /* offset within the master MTD space */ 42 u_int32_t offset; /* offset within the master MTD space */
43 u_int32_t mask_flags; /* master MTD flags to mask out for this partition */ 43 u_int32_t mask_flags; /* master MTD flags to mask out for this partition */
44 struct nand_oobinfo *oobsel; /* out of band layout for this partition (NAND only)*/ 44 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/
45 struct mtd_info **mtdp; /* pointer to store the MTD object */ 45 struct mtd_info **mtdp; /* pointer to store the MTD object */
46}; 46};
47 47
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index c7b8bcdef013..86831e3594f6 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -15,33 +15,26 @@
15 */ 15 */
16 16
17#ifndef __LINUX_MTD_PHYSMAP__ 17#ifndef __LINUX_MTD_PHYSMAP__
18 18#define __LINUX_MTD_PHYSMAP__
19#include <linux/config.h>
20
21#if defined(CONFIG_MTD_PHYSMAP)
22 19
23#include <linux/mtd/mtd.h> 20#include <linux/mtd/mtd.h>
24#include <linux/mtd/map.h> 21#include <linux/mtd/map.h>
25#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
26 23
27/* 24struct physmap_flash_data {
28 * The map_info for physmap. Board can override size, buswidth, phys, 25 unsigned int width;
29 * (*set_vpp)(), etc in their initial setup routine. 26 void (*set_vpp)(struct map_info *, int);
30 */ 27 unsigned int nr_parts;
31extern struct map_info physmap_map; 28 struct mtd_partition *parts;
29};
32 30
33/* 31/*
34 * Board needs to specify the exact mapping during their setup time. 32 * Board needs to specify the exact mapping during their setup time.
35 */ 33 */
36static inline void physmap_configure(unsigned long addr, unsigned long size, int bankwidth, void (*set_vpp)(struct map_info *, int) ) 34void physmap_configure(unsigned long addr, unsigned long size,
37{ 35 int bankwidth, void (*set_vpp)(struct map_info *, int) );
38 physmap_map.phys = addr;
39 physmap_map.size = size;
40 physmap_map.bankwidth = bankwidth;
41 physmap_map.set_vpp = set_vpp;
42}
43 36
44#if defined(CONFIG_MTD_PARTITIONS) 37#ifdef CONFIG_MTD_PARTITIONS
45 38
46/* 39/*
47 * Machines that wish to do flash partition may want to call this function in 40 * Machines that wish to do flash partition may want to call this function in
@@ -55,7 +48,5 @@ static inline void physmap_configure(unsigned long addr, unsigned long size, int
55void physmap_set_partitions(struct mtd_partition *parts, int num_parts); 48void physmap_set_partitions(struct mtd_partition *parts, int num_parts);
56 49
57#endif /* defined(CONFIG_MTD_PARTITIONS) */ 50#endif /* defined(CONFIG_MTD_PARTITIONS) */
58#endif /* defined(CONFIG_MTD) */
59 51
60#endif /* __LINUX_MTD_PHYSMAP__ */ 52#endif /* __LINUX_MTD_PHYSMAP__ */
61
diff --git a/include/linux/mtd/xip.h b/include/linux/mtd/xip.h
index 220d50bb71cd..e9d40bdde48c 100644
--- a/include/linux/mtd/xip.h
+++ b/include/linux/mtd/xip.h
@@ -18,7 +18,6 @@
18#ifndef __LINUX_MTD_XIP_H__ 18#ifndef __LINUX_MTD_XIP_H__
19#define __LINUX_MTD_XIP_H__ 19#define __LINUX_MTD_XIP_H__
20 20
21#include <linux/config.h>
22 21
23#ifdef CONFIG_MTD_XIP 22#ifdef CONFIG_MTD_XIP
24 23
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index a6ce409ec6fc..1d7cdd20b553 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -77,11 +77,11 @@ struct nbd_device {
77 * server. All data are in network byte order. 77 * server. All data are in network byte order.
78 */ 78 */
79struct nbd_request { 79struct nbd_request {
80 u32 magic; 80 __u32 magic;
81 u32 type; /* == READ || == WRITE */ 81 __u32 type; /* == READ || == WRITE */
82 char handle[8]; 82 char handle[8];
83 u64 from; 83 __u64 from;
84 u32 len; 84 __u32 len;
85} 85}
86#ifdef __GNUC__ 86#ifdef __GNUC__
87 __attribute__ ((packed)) 87 __attribute__ ((packed))
@@ -93,8 +93,8 @@ struct nbd_request {
93 * it has completed an I/O request (or an error occurs). 93 * it has completed an I/O request (or an error occurs).
94 */ 94 */
95struct nbd_reply { 95struct nbd_reply {
96 u32 magic; 96 __u32 magic;
97 u32 error; /* 0 = ok, else error */ 97 __u32 error; /* 0 = ok, else error */
98 char handle[8]; /* handle you got from request */ 98 char handle[8]; /* handle you got from request */
99}; 99};
100#endif 100#endif
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 96dc237b8f03..b208f0cd556b 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -12,8 +12,6 @@
12#include <linux/in.h> 12#include <linux/in.h>
13#include <linux/types.h> 13#include <linux/types.h>
14 14
15#include <linux/ncp_fs_i.h>
16#include <linux/ncp_fs_sb.h>
17#include <linux/ipx.h> 15#include <linux/ipx.h>
18#include <linux/ncp_no.h> 16#include <linux/ncp_no.h>
19 17
@@ -146,7 +144,8 @@ struct ncp_nls_ioctl
146 144
147#ifdef __KERNEL__ 145#ifdef __KERNEL__
148 146
149#include <linux/config.h> 147#include <linux/ncp_fs_i.h>
148#include <linux/ncp_fs_sb.h>
150 149
151/* undef because public define in umsdos_fs.h (ncp_fs.h isn't public) */ 150/* undef because public define in umsdos_fs.h (ncp_fs.h isn't public) */
152#undef PRINTK 151#undef PRINTK
diff --git a/include/linux/net.h b/include/linux/net.h
index 84a490e5f0a1..385e68f5bd93 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -18,9 +18,7 @@
18#ifndef _LINUX_NET_H 18#ifndef _LINUX_NET_H
19#define _LINUX_NET_H 19#define _LINUX_NET_H
20 20
21#include <linux/config.h>
22#include <linux/wait.h> 21#include <linux/wait.h>
23#include <linux/stringify.h>
24#include <asm/socket.h> 22#include <asm/socket.h>
25 23
26struct poll_table_struct; 24struct poll_table_struct;
@@ -57,6 +55,7 @@ typedef enum {
57#define __SO_ACCEPTCON (1 << 16) /* performed a listen */ 55#define __SO_ACCEPTCON (1 << 16) /* performed a listen */
58 56
59#ifdef __KERNEL__ 57#ifdef __KERNEL__
58#include <linux/stringify.h>
60 59
61#define SOCK_ASYNC_NOSPACE 0 60#define SOCK_ASYNC_NOSPACE 0
62#define SOCK_ASYNC_WAITDATA 1 61#define SOCK_ASYNC_WAITDATA 1
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index e432b743dda2..bc747e5d7138 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -34,7 +34,6 @@
34#include <asm/cache.h> 34#include <asm/cache.h>
35#include <asm/byteorder.h> 35#include <asm/byteorder.h>
36 36
37#include <linux/config.h>
38#include <linux/device.h> 37#include <linux/device.h>
39#include <linux/percpu.h> 38#include <linux/percpu.h>
40#include <linux/dmaengine.h> 39#include <linux/dmaengine.h>
@@ -233,6 +232,7 @@ enum netdev_state_t
233 __LINK_STATE_RX_SCHED, 232 __LINK_STATE_RX_SCHED,
234 __LINK_STATE_LINKWATCH_PENDING, 233 __LINK_STATE_LINKWATCH_PENDING,
235 __LINK_STATE_DORMANT, 234 __LINK_STATE_DORMANT,
235 __LINK_STATE_QDISC_RUNNING,
236}; 236};
237 237
238 238
@@ -308,9 +308,13 @@ struct net_device
308#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ 308#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
309#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ 309#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
310#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ 310#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
311#define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ 311#define NETIF_F_GSO 2048 /* Enable software GSO. */
312#define NETIF_F_LLTX 4096 /* LockLess TX */ 312#define NETIF_F_LLTX 4096 /* LockLess TX */
313#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ 313
314 /* Segmentation offload features */
315#define NETIF_F_GSO_SHIFT 16
316#define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT)
317#define NETIF_F_UFO (SKB_GSO_UDPV4 << NETIF_F_GSO_SHIFT)
314 318
315#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) 319#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
316#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) 320#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
@@ -402,6 +406,9 @@ struct net_device
402 struct list_head qdisc_list; 406 struct list_head qdisc_list;
403 unsigned long tx_queue_len; /* Max frames per queue allowed */ 407 unsigned long tx_queue_len; /* Max frames per queue allowed */
404 408
409 /* Partially transmitted GSO packet. */
410 struct sk_buff *gso_skb;
411
405 /* ingress path synchronizer */ 412 /* ingress path synchronizer */
406 spinlock_t ingress_lock; 413 spinlock_t ingress_lock;
407 struct Qdisc *qdisc_ingress; 414 struct Qdisc *qdisc_ingress;
@@ -536,6 +543,7 @@ struct packet_type {
536 struct net_device *, 543 struct net_device *,
537 struct packet_type *, 544 struct packet_type *,
538 struct net_device *); 545 struct net_device *);
546 struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg);
539 void *af_packet_priv; 547 void *af_packet_priv;
540 struct list_head list; 548 struct list_head list;
541}; 549};
@@ -686,7 +694,8 @@ extern int dev_change_name(struct net_device *, char *);
686extern int dev_set_mtu(struct net_device *, int); 694extern int dev_set_mtu(struct net_device *, int);
687extern int dev_set_mac_address(struct net_device *, 695extern int dev_set_mac_address(struct net_device *,
688 struct sockaddr *); 696 struct sockaddr *);
689extern void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev); 697extern int dev_hard_start_xmit(struct sk_buff *skb,
698 struct net_device *dev);
690 699
691extern void dev_init(void); 700extern void dev_init(void);
692 701
@@ -960,6 +969,7 @@ extern int netdev_max_backlog;
960extern int weight_p; 969extern int weight_p;
961extern int netdev_set_master(struct net_device *dev, struct net_device *master); 970extern int netdev_set_master(struct net_device *dev, struct net_device *master);
962extern int skb_checksum_help(struct sk_buff *skb, int inward); 971extern int skb_checksum_help(struct sk_buff *skb, int inward);
972extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int sg);
963#ifdef CONFIG_BUG 973#ifdef CONFIG_BUG
964extern void netdev_rx_csum_fault(struct net_device *dev); 974extern void netdev_rx_csum_fault(struct net_device *dev);
965#else 975#else
@@ -979,6 +989,13 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
979 989
980extern void linkwatch_run_queue(void); 990extern void linkwatch_run_queue(void);
981 991
992static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
993{
994 int feature = skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT;
995 return skb_shinfo(skb)->gso_size &&
996 (dev->features & feature) != feature;
997}
998
982#endif /* __KERNEL__ */ 999#endif /* __KERNEL__ */
983 1000
984#endif /* _LINUX_DEV_H */ 1001#endif /* _LINUX_DEV_H */
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index b31a9bca9361..10168e26a846 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -40,7 +40,6 @@
40#endif 40#endif
41 41
42#ifdef __KERNEL__ 42#ifdef __KERNEL__
43#include <linux/config.h>
44#ifdef CONFIG_NETFILTER 43#ifdef CONFIG_NETFILTER
45 44
46extern void netfilter_init(void); 45extern void netfilter_init(void);
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h
index 34f63cf2e293..4c2d9945ca54 100644
--- a/include/linux/netfilter/xt_conntrack.h
+++ b/include/linux/netfilter/xt_conntrack.h
@@ -42,7 +42,7 @@ struct ip_conntrack_old_tuple
42 } u; 42 } u;
43 43
44 /* The protocol. */ 44 /* The protocol. */
45 u16 protonum; 45 __u16 protonum;
46 } dst; 46 } dst;
47}; 47};
48 48
diff --git a/include/linux/netfilter_arp.h b/include/linux/netfilter_arp.h
index a3f8977f7f12..92bc6ddcbf73 100644
--- a/include/linux/netfilter_arp.h
+++ b/include/linux/netfilter_arp.h
@@ -5,7 +5,6 @@
5 * (C)2002 Rusty Russell IBM -- This code is GPL. 5 * (C)2002 Rusty Russell IBM -- This code is GPL.
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/netfilter.h> 8#include <linux/netfilter.h>
10 9
11/* There is no PF_ARP. */ 10/* There is no PF_ARP. */
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index a75b84bb9a88..87764022cc67 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -4,7 +4,6 @@
4/* bridge-specific defines for netfilter. 4/* bridge-specific defines for netfilter.
5 */ 5 */
6 6
7#include <linux/config.h>
8#include <linux/netfilter.h> 7#include <linux/netfilter.h>
9#if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER) 8#if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER)
10#include <asm/atomic.h> 9#include <asm/atomic.h>
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index 85301c5e8d24..ce02c984f3ba 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -5,7 +5,6 @@
5 * (C)1998 Rusty Russell -- This code is GPL. 5 * (C)1998 Rusty Russell -- This code is GPL.
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/netfilter.h> 8#include <linux/netfilter.h>
10 9
11/* only for userspace compatibility */ 10/* only for userspace compatibility */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index e0e9951eb8c3..51dbec1892c8 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -4,7 +4,6 @@
4#include <linux/netfilter/nf_conntrack_common.h> 4#include <linux/netfilter/nf_conntrack_common.h>
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7#include <linux/config.h>
8#include <linux/netfilter_ipv4/ip_conntrack_tuple.h> 7#include <linux/netfilter_ipv4/ip_conntrack_tuple.h>
9#include <linux/bitops.h> 8#include <linux/bitops.h>
10#include <linux/compiler.h> 9#include <linux/compiler.h>
diff --git a/include/linux/netfilter_ipv4/listhelp.h b/include/linux/netfilter_ipv4/listhelp.h
index 360429f48737..5d92cf044d91 100644
--- a/include/linux/netfilter_ipv4/listhelp.h
+++ b/include/linux/netfilter_ipv4/listhelp.h
@@ -1,6 +1,5 @@
1#ifndef _LISTHELP_H 1#ifndef _LISTHELP_H
2#define _LISTHELP_H 2#define _LISTHELP_H
3#include <linux/config.h>
4#include <linux/list.h> 3#include <linux/list.h>
5 4
6/* Header to do more comprehensive job than linux/list.h; assume list 5/* Header to do more comprehensive job than linux/list.h; assume list
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 87b8a5703ebc..855b44668caa 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -5,7 +5,7 @@
5#include <linux/types.h> 5#include <linux/types.h>
6 6
7#define NETLINK_ROUTE 0 /* Routing/device hook */ 7#define NETLINK_ROUTE 0 /* Routing/device hook */
8#define NETLINK_W1 1 /* 1-wire subsystem */ 8#define NETLINK_UNUSED 1 /* Unused number */
9#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ 9#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
10#define NETLINK_FIREWALL 3 /* Firewalling hook */ 10#define NETLINK_FIREWALL 3 /* Firewalling hook */
11#define NETLINK_INET_DIAG 4 /* INET socket monitoring */ 11#define NETLINK_INET_DIAG 4 /* INET socket monitoring */
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index ca2ffa6ae1d5..54af92c1c70b 100644
--- a/include/linux/nfs.h
+++ b/include/linux/nfs.h
@@ -7,9 +7,6 @@
7#ifndef _LINUX_NFS_H 7#ifndef _LINUX_NFS_H
8#define _LINUX_NFS_H 8#define _LINUX_NFS_H
9 9
10#include <linux/sunrpc/msg_prot.h>
11#include <linux/string.h>
12
13#define NFS_PROGRAM 100003 10#define NFS_PROGRAM 100003
14#define NFS_PORT 2049 11#define NFS_PORT 2049
15#define NFS_MAXDATA 8192 12#define NFS_MAXDATA 8192
@@ -129,7 +126,10 @@ enum nfs_ftype {
129 NFFIFO = 8 126 NFFIFO = 8
130}; 127};
131 128
132#if defined(__KERNEL__) 129#ifdef __KERNEL__
130#include <linux/sunrpc/msg_prot.h>
131#include <linux/string.h>
132
133/* 133/*
134 * This is the kernel NFS client file handle representation 134 * This is the kernel NFS client file handle representation
135 */ 135 */
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 0c1c306cdaec..1059e6d69d3b 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -14,7 +14,6 @@
14#define _LINUX_NFS4_H 14#define _LINUX_NFS4_H
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/list.h>
18 17
19#define NFS4_VERIFIER_SIZE 8 18#define NFS4_VERIFIER_SIZE 8
20#define NFS4_FHSIZE 128 19#define NFS4_FHSIZE 128
@@ -97,6 +96,9 @@ enum nfs4_acl_whotype {
97 NFS4_ACL_WHO_EVERYONE, 96 NFS4_ACL_WHO_EVERYONE,
98}; 97};
99 98
99#ifdef __KERNEL__
100#include <linux/list.h>
101
100struct nfs4_ace { 102struct nfs4_ace {
101 uint32_t type; 103 uint32_t type;
102 uint32_t flag; 104 uint32_t flag;
@@ -345,8 +347,6 @@ enum lock_type4 {
345#define NFS4_MINOR_VERSION 0 347#define NFS4_MINOR_VERSION 0
346#define NFS4_DEBUG 1 348#define NFS4_DEBUG 1
347 349
348#ifdef __KERNEL__
349
350/* Index of predefined Linux client operations */ 350/* Index of predefined Linux client operations */
351 351
352enum { 352enum {
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index c71227dd4389..7e079f8ce18b 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -9,26 +9,6 @@
9#ifndef _LINUX_NFS_FS_H 9#ifndef _LINUX_NFS_FS_H
10#define _LINUX_NFS_FS_H 10#define _LINUX_NFS_FS_H
11 11
12#include <linux/config.h>
13#include <linux/in.h>
14#include <linux/mm.h>
15#include <linux/pagemap.h>
16#include <linux/rwsem.h>
17#include <linux/wait.h>
18
19#include <linux/nfs_fs_sb.h>
20
21#include <linux/sunrpc/debug.h>
22#include <linux/sunrpc/auth.h>
23#include <linux/sunrpc/clnt.h>
24
25#include <linux/nfs.h>
26#include <linux/nfs2.h>
27#include <linux/nfs3.h>
28#include <linux/nfs4.h>
29#include <linux/nfs_xdr.h>
30#include <linux/rwsem.h>
31#include <linux/mempool.h>
32 12
33/* 13/*
34 * Enable debugging support for nfs client. 14 * Enable debugging support for nfs client.
@@ -63,6 +43,25 @@
63#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */ 43#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */
64 44
65#ifdef __KERNEL__ 45#ifdef __KERNEL__
46#include <linux/in.h>
47#include <linux/mm.h>
48#include <linux/pagemap.h>
49#include <linux/rwsem.h>
50#include <linux/wait.h>
51
52#include <linux/nfs_fs_sb.h>
53
54#include <linux/sunrpc/debug.h>
55#include <linux/sunrpc/auth.h>
56#include <linux/sunrpc/clnt.h>
57
58#include <linux/nfs.h>
59#include <linux/nfs2.h>
60#include <linux/nfs3.h>
61#include <linux/nfs4.h>
62#include <linux/nfs_xdr.h>
63#include <linux/rwsem.h>
64#include <linux/mempool.h>
66 65
67/* 66/*
68 * NFSv3/v4 Access mode cache entry 67 * NFSv3/v4 Access mode cache entry
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index ec7c2e872d72..2dcad295fece 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -10,7 +10,6 @@
10#ifndef LINUX_NFSD_NFSD_H 10#ifndef LINUX_NFSD_NFSD_H
11#define LINUX_NFSD_NFSD_H 11#define LINUX_NFSD_NFSD_H
12 12
13#include <linux/config.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/unistd.h> 14#include <linux/unistd.h>
16#include <linux/dirent.h> 15#include <linux/dirent.h>
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 0798b7781a6e..f9edcd2ff3c8 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -16,7 +16,6 @@
16 16
17#include <asm/types.h> 17#include <asm/types.h>
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19# include <linux/config.h>
20# include <linux/types.h> 19# include <linux/types.h>
21# include <linux/string.h> 20# include <linux/string.h>
22# include <linux/fs.h> 21# include <linux/fs.h>
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
index 781efbf94ed3..dae0faea2807 100644
--- a/include/linux/nfsd/syscall.h
+++ b/include/linux/nfsd/syscall.h
@@ -11,7 +11,6 @@
11 11
12#include <asm/types.h> 12#include <asm/types.h>
13#ifdef __KERNEL__ 13#ifdef __KERNEL__
14# include <linux/config.h>
15# include <linux/types.h> 14# include <linux/types.h>
16# include <linux/in.h> 15# include <linux/in.h>
17#endif 16#endif
diff --git a/include/linux/numa.h b/include/linux/numa.h
index e481feb1bfd8..a31a7301b159 100644
--- a/include/linux/numa.h
+++ b/include/linux/numa.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_NUMA_H 1#ifndef _LINUX_NUMA_H
2#define _LINUX_NUMA_H 2#define _LINUX_NUMA_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_NODES_SHIFT 5#ifdef CONFIG_NODES_SHIFT
7#define NODES_SHIFT CONFIG_NODES_SHIFT 6#define NODES_SHIFT CONFIG_NODES_SHIFT
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index d276a4e2f825..0c076d58c676 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -7,6 +7,8 @@
7 7
8#include <linux/percpu.h> 8#include <linux/percpu.h>
9#include <linux/cache.h> 9#include <linux/cache.h>
10#include <linux/types.h>
11
10#include <asm/pgtable.h> 12#include <asm/pgtable.h>
11 13
12/* 14/*
@@ -88,7 +90,17 @@
88#define PG_nosave_free 18 /* Free, should not be written */ 90#define PG_nosave_free 18 /* Free, should not be written */
89#define PG_buddy 19 /* Page is free, on buddy lists */ 91#define PG_buddy 19 /* Page is free, on buddy lists */
90 92
91#define PG_uncached 20 /* Page has been mapped as uncached */ 93
94#if (BITS_PER_LONG > 32)
95/*
96 * 64-bit-only flags build down from bit 31
97 *
98 * 32 bit -------------------------------| FIELDS | FLAGS |
99 * 64 bit | FIELDS | ?????? FLAGS |
100 * 63 32 0
101 */
102#define PG_uncached 31 /* Page has been mapped as uncached */
103#endif
92 104
93/* 105/*
94 * Global page accounting. One instance per CPU. Only unsigned longs are 106 * Global page accounting. One instance per CPU. Only unsigned longs are
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 7a1af574dedf..1245df7141aa 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -99,6 +99,13 @@ extern struct page * read_cache_page(struct address_space *mapping,
99extern int read_cache_pages(struct address_space *mapping, 99extern int read_cache_pages(struct address_space *mapping,
100 struct list_head *pages, filler_t *filler, void *data); 100 struct list_head *pages, filler_t *filler, void *data);
101 101
102static inline struct page *read_mapping_page(struct address_space *mapping,
103 unsigned long index, void *data)
104{
105 filler_t *filler = (filler_t *)mapping->a_ops->readpage;
106 return read_cache_page(mapping, index, filler, data);
107}
108
102int add_to_page_cache(struct page *page, struct address_space *mapping, 109int add_to_page_cache(struct page *page, struct address_space *mapping,
103 unsigned long index, gfp_t gfp_mask); 110 unsigned long index, gfp_t gfp_mask);
104int add_to_page_cache_lru(struct page *page, struct address_space *mapping, 111int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
diff --git a/include/linux/parport.h b/include/linux/parport.h
index 008d736a6c9a..d42737eeee06 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -96,7 +96,6 @@ typedef enum {
96/* The rest is for the kernel only */ 96/* The rest is for the kernel only */
97#ifdef __KERNEL__ 97#ifdef __KERNEL__
98 98
99#include <linux/config.h>
100#include <linux/jiffies.h> 99#include <linux/jiffies.h>
101#include <linux/proc_fs.h> 100#include <linux/proc_fs.h>
102#include <linux/spinlock.h> 101#include <linux/spinlock.h>
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 6fd36cb09160..62a8c22f5f60 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -17,8 +17,6 @@
17#ifndef LINUX_PCI_H 17#ifndef LINUX_PCI_H
18#define LINUX_PCI_H 18#define LINUX_PCI_H
19 19
20#include <linux/mod_devicetable.h>
21
22/* Include the pci register defines */ 20/* Include the pci register defines */
23#include <linux/pci_regs.h> 21#include <linux/pci_regs.h>
24 22
@@ -46,8 +44,9 @@
46 44
47#ifdef __KERNEL__ 45#ifdef __KERNEL__
48 46
47#include <linux/mod_devicetable.h>
48
49#include <linux/types.h> 49#include <linux/types.h>
50#include <linux/config.h>
51#include <linux/ioport.h> 50#include <linux/ioport.h>
52#include <linux/list.h> 51#include <linux/list.h>
53#include <linux/errno.h> 52#include <linux/errno.h>
@@ -163,6 +162,9 @@ struct pci_dev {
163 unsigned int is_busmaster:1; /* device is busmaster */ 162 unsigned int is_busmaster:1; /* device is busmaster */
164 unsigned int no_msi:1; /* device may not use msi */ 163 unsigned int no_msi:1; /* device may not use msi */
165 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ 164 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */
165 unsigned int broken_parity_status:1; /* Device generates false positive parity */
166 unsigned int msi_enabled:1;
167 unsigned int msix_enabled:1;
166 168
167 u32 saved_config_space[16]; /* config space saved at suspend time */ 169 u32 saved_config_space[16]; /* config space saved at suspend time */
168 struct hlist_head saved_cap_space; 170 struct hlist_head saved_cap_space;
@@ -497,6 +499,7 @@ int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
497int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); 499int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
498void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); 500void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
499int pci_assign_resource(struct pci_dev *dev, int i); 501int pci_assign_resource(struct pci_dev *dev, int i);
502int pci_assign_resource_fixed(struct pci_dev *dev, int i);
500void pci_restore_bars(struct pci_dev *dev); 503void pci_restore_bars(struct pci_dev *dev);
501 504
502/* ROM control related routines */ 505/* ROM control related routines */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index bcfe9d4f56ae..c2fd2d19938b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -352,8 +352,11 @@
352#define PCI_DEVICE_ID_ATI_RS480 0x5950 352#define PCI_DEVICE_ID_ATI_RS480 0x5950
353/* ATI IXP Chipset */ 353/* ATI IXP Chipset */
354#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349 354#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349
355#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353
356#define PCI_DEVICE_ID_ATI_IXP300_SMBUS 0x4363
355#define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369 357#define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369
356#define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e 358#define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e
359#define PCI_DEVICE_ID_ATI_IXP400_SMBUS 0x4372
357#define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 360#define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376
358#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 361#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379
359#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a 362#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a
@@ -848,7 +851,12 @@
848 851
849 852
850#define PCI_VENDOR_ID_QLOGIC 0x1077 853#define PCI_VENDOR_ID_QLOGIC 0x1077
854#define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016
851#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 855#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020
856#define PCI_DEVICE_ID_QLOGIC_ISP1080 0x1080
857#define PCI_DEVICE_ID_QLOGIC_ISP12160 0x1216
858#define PCI_DEVICE_ID_QLOGIC_ISP1240 0x1240
859#define PCI_DEVICE_ID_QLOGIC_ISP1280 0x1280
852#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 860#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100
853#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 861#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200
854#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 862#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300
@@ -1018,6 +1026,7 @@
1018#define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056 1026#define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056
1019#define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057 1027#define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057
1020#define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059 1028#define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059
1029#define PCI_DEVICE_ID_NVIDIA_CK804_PCIE 0x005d
1021#define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064 1030#define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064
1022#define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065 1031#define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065
1023#define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066 1032#define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066
@@ -1127,9 +1136,11 @@
1127#define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258 1136#define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258
1128#define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259 1137#define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259
1129#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B 1138#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B
1139#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SMBUS 0x0264
1130#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265 1140#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265
1131#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 1141#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266
1132#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 1142#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267
1143#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SMBUS 0x0368
1133#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E 1144#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E
1134#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E 1145#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E
1135#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F 1146#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F
@@ -1185,8 +1196,12 @@
1185#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 1196#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
1186#define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5 1197#define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5
1187#define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6 1198#define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6
1199#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7
1200#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE 0x03EC
1188#define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE 1201#define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE
1189#define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF 1202#define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF
1203#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6
1204#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7
1190#define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450 1205#define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450
1191#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 1206#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451
1192#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 1207#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452
@@ -1244,6 +1259,7 @@
1244#define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 1259#define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259
1245#define PCI_DEVICE_ID_VIA_3269_0 0x0269 1260#define PCI_DEVICE_ID_VIA_3269_0 0x0269
1246#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 1261#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282
1262#define PCI_DEVICE_ID_VIA_3296_0 0x0296
1247#define PCI_DEVICE_ID_VIA_8363_0 0x0305 1263#define PCI_DEVICE_ID_VIA_8363_0 0x0305
1248#define PCI_DEVICE_ID_VIA_P4M800CE 0x0314 1264#define PCI_DEVICE_ID_VIA_P4M800CE 0x0314
1249#define PCI_DEVICE_ID_VIA_8371_0 0x0391 1265#define PCI_DEVICE_ID_VIA_8371_0 0x0391
@@ -1251,6 +1267,7 @@
1251#define PCI_DEVICE_ID_VIA_82C561 0x0561 1267#define PCI_DEVICE_ID_VIA_82C561 0x0561
1252#define PCI_DEVICE_ID_VIA_82C586_1 0x0571 1268#define PCI_DEVICE_ID_VIA_82C586_1 0x0571
1253#define PCI_DEVICE_ID_VIA_82C576 0x0576 1269#define PCI_DEVICE_ID_VIA_82C576 0x0576
1270#define PCI_DEVICE_ID_VIA_SATA_EIDE 0x0581
1254#define PCI_DEVICE_ID_VIA_82C586_0 0x0586 1271#define PCI_DEVICE_ID_VIA_82C586_0 0x0586
1255#define PCI_DEVICE_ID_VIA_82C596 0x0596 1272#define PCI_DEVICE_ID_VIA_82C596 0x0596
1256#define PCI_DEVICE_ID_VIA_82C597_0 0x0597 1273#define PCI_DEVICE_ID_VIA_82C597_0 0x0597
@@ -1291,10 +1308,11 @@
1291#define PCI_DEVICE_ID_VIA_8783_0 0x3208 1308#define PCI_DEVICE_ID_VIA_8783_0 0x3208
1292#define PCI_DEVICE_ID_VIA_8237 0x3227 1309#define PCI_DEVICE_ID_VIA_8237 0x3227
1293#define PCI_DEVICE_ID_VIA_8251 0x3287 1310#define PCI_DEVICE_ID_VIA_8251 0x3287
1294#define PCI_DEVICE_ID_VIA_3296_0 0x0296 1311#define PCI_DEVICE_ID_VIA_8237A 0x3337
1295#define PCI_DEVICE_ID_VIA_8231 0x8231 1312#define PCI_DEVICE_ID_VIA_8231 0x8231
1296#define PCI_DEVICE_ID_VIA_8231_4 0x8235 1313#define PCI_DEVICE_ID_VIA_8231_4 0x8235
1297#define PCI_DEVICE_ID_VIA_8365_1 0x8305 1314#define PCI_DEVICE_ID_VIA_8365_1 0x8305
1315#define PCI_DEVICE_ID_VIA_CX700 0x8324
1298#define PCI_DEVICE_ID_VIA_8371_1 0x8391 1316#define PCI_DEVICE_ID_VIA_8371_1 0x8391
1299#define PCI_DEVICE_ID_VIA_82C598_1 0x8598 1317#define PCI_DEVICE_ID_VIA_82C598_1 0x8598
1300#define PCI_DEVICE_ID_VIA_838X_1 0xB188 1318#define PCI_DEVICE_ID_VIA_838X_1 0xB188
@@ -1946,6 +1964,7 @@
1946 1964
1947#define PCI_VENDOR_ID_MELLANOX 0x15b3 1965#define PCI_VENDOR_ID_MELLANOX 0x15b3
1948#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 1966#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44
1967#define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46
1949#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 1968#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278
1950#define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282 1969#define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282
1951#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c 1970#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c
@@ -1969,6 +1988,9 @@
1969#define PCI_VENDOR_ID_NETCELL 0x169c 1988#define PCI_VENDOR_ID_NETCELL 0x169c
1970#define PCI_DEVICE_ID_REVOLUTION 0x0044 1989#define PCI_DEVICE_ID_REVOLUTION 0x0044
1971 1990
1991#define PCI_VENDOR_ID_VITESSE 0x1725
1992#define PCI_DEVICE_ID_VITESSE_VSC7174 0x7174
1993
1972#define PCI_VENDOR_ID_LINKSYS 0x1737 1994#define PCI_VENDOR_ID_LINKSYS 0x1737
1973#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 1995#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064
1974 1996
@@ -2148,6 +2170,7 @@
2148#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 2170#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815
2149#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e 2171#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e
2150#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 2172#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850
2173#define PCI_DEVICE_ID_INTEL_GD31244 0x3200
2151#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 2174#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
2152#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 2175#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
2153#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 2176#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index d27a78b71297..6bce4a240364 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -197,6 +197,7 @@
197#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ 197#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
198#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ 198#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
199#define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */ 199#define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */
200#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */
200#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ 201#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
201#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ 202#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
202#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ 203#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 682525511c9e..f5aa593ccf32 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -6,18 +6,18 @@
6 * WARNING: these things are HUGE. 4 kbytes per counter on 32-way P4. 6 * WARNING: these things are HUGE. 4 kbytes per counter on 32-way P4.
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/spinlock.h> 9#include <linux/spinlock.h>
11#include <linux/smp.h> 10#include <linux/smp.h>
12#include <linux/threads.h> 11#include <linux/threads.h>
13#include <linux/percpu.h> 12#include <linux/percpu.h>
13#include <linux/types.h>
14 14
15#ifdef CONFIG_SMP 15#ifdef CONFIG_SMP
16 16
17struct percpu_counter { 17struct percpu_counter {
18 spinlock_t lock; 18 spinlock_t lock;
19 long count; 19 s64 count;
20 long *counters; 20 s32 *counters;
21}; 21};
22 22
23#if NR_CPUS >= 16 23#if NR_CPUS >= 16
@@ -26,11 +26,11 @@ struct percpu_counter {
26#define FBC_BATCH (NR_CPUS*4) 26#define FBC_BATCH (NR_CPUS*4)
27#endif 27#endif
28 28
29static inline void percpu_counter_init(struct percpu_counter *fbc) 29static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount)
30{ 30{
31 spin_lock_init(&fbc->lock); 31 spin_lock_init(&fbc->lock);
32 fbc->count = 0; 32 fbc->count = amount;
33 fbc->counters = alloc_percpu(long); 33 fbc->counters = alloc_percpu(s32);
34} 34}
35 35
36static inline void percpu_counter_destroy(struct percpu_counter *fbc) 36static inline void percpu_counter_destroy(struct percpu_counter *fbc)
@@ -38,10 +38,10 @@ static inline void percpu_counter_destroy(struct percpu_counter *fbc)
38 free_percpu(fbc->counters); 38 free_percpu(fbc->counters);
39} 39}
40 40
41void percpu_counter_mod(struct percpu_counter *fbc, long amount); 41void percpu_counter_mod(struct percpu_counter *fbc, s32 amount);
42long percpu_counter_sum(struct percpu_counter *fbc); 42s64 percpu_counter_sum(struct percpu_counter *fbc);
43 43
44static inline long percpu_counter_read(struct percpu_counter *fbc) 44static inline s64 percpu_counter_read(struct percpu_counter *fbc)
45{ 45{
46 return fbc->count; 46 return fbc->count;
47} 47}
@@ -49,13 +49,14 @@ static inline long percpu_counter_read(struct percpu_counter *fbc)
49/* 49/*
50 * It is possible for the percpu_counter_read() to return a small negative 50 * It is possible for the percpu_counter_read() to return a small negative
51 * number for some counter which should never be negative. 51 * number for some counter which should never be negative.
52 *
52 */ 53 */
53static inline long percpu_counter_read_positive(struct percpu_counter *fbc) 54static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
54{ 55{
55 long ret = fbc->count; 56 s64 ret = fbc->count;
56 57
57 barrier(); /* Prevent reloads of fbc->count */ 58 barrier(); /* Prevent reloads of fbc->count */
58 if (ret > 0) 59 if (ret >= 0)
59 return ret; 60 return ret;
60 return 1; 61 return 1;
61} 62}
@@ -63,12 +64,12 @@ static inline long percpu_counter_read_positive(struct percpu_counter *fbc)
63#else 64#else
64 65
65struct percpu_counter { 66struct percpu_counter {
66 long count; 67 s64 count;
67}; 68};
68 69
69static inline void percpu_counter_init(struct percpu_counter *fbc) 70static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount)
70{ 71{
71 fbc->count = 0; 72 fbc->count = amount;
72} 73}
73 74
74static inline void percpu_counter_destroy(struct percpu_counter *fbc) 75static inline void percpu_counter_destroy(struct percpu_counter *fbc)
@@ -76,24 +77,24 @@ static inline void percpu_counter_destroy(struct percpu_counter *fbc)
76} 77}
77 78
78static inline void 79static inline void
79percpu_counter_mod(struct percpu_counter *fbc, long amount) 80percpu_counter_mod(struct percpu_counter *fbc, s32 amount)
80{ 81{
81 preempt_disable(); 82 preempt_disable();
82 fbc->count += amount; 83 fbc->count += amount;
83 preempt_enable(); 84 preempt_enable();
84} 85}
85 86
86static inline long percpu_counter_read(struct percpu_counter *fbc) 87static inline s64 percpu_counter_read(struct percpu_counter *fbc)
87{ 88{
88 return fbc->count; 89 return fbc->count;
89} 90}
90 91
91static inline long percpu_counter_read_positive(struct percpu_counter *fbc) 92static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
92{ 93{
93 return fbc->count; 94 return fbc->count;
94} 95}
95 96
96static inline long percpu_counter_sum(struct percpu_counter *fbc) 97static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
97{ 98{
98 return percpu_counter_read_positive(fbc); 99 return percpu_counter_read_positive(fbc);
99} 100}
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 66be58902b17..658c1b93d5bb 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -23,7 +23,6 @@
23 23
24#ifdef __KERNEL__ 24#ifdef __KERNEL__
25 25
26#include <linux/config.h>
27#include <linux/list.h> 26#include <linux/list.h>
28#include <asm/atomic.h> 27#include <asm/atomic.h>
29 28
diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h
index 008932d73c35..78027c533b94 100644
--- a/include/linux/pm_legacy.h
+++ b/include/linux/pm_legacy.h
@@ -1,7 +1,6 @@
1#ifndef __LINUX_PM_LEGACY_H__ 1#ifndef __LINUX_PM_LEGACY_H__
2#define __LINUX_PM_LEGACY_H__ 2#define __LINUX_PM_LEGACY_H__
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_PM_LEGACY 5#ifdef CONFIG_PM_LEGACY
7 6
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index 217d3daf7336..ecce5912f4d6 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -6,7 +6,6 @@
6 * Copyright (C) 1998 Paul Mackerras. 6 * Copyright (C) 1998 Paul Mackerras.
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11#define PMU_DRIVER_VERSION 2 10#define PMU_DRIVER_VERSION 2
12 11
diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h
index 402056cd049d..c6b13ff85028 100644
--- a/include/linux/ppp_defs.h
+++ b/include/linux/ppp_defs.h
@@ -42,8 +42,6 @@
42#ifndef _PPP_DEFS_H_ 42#ifndef _PPP_DEFS_H_
43#define _PPP_DEFS_H_ 43#define _PPP_DEFS_H_
44 44
45#include <linux/crc-ccitt.h>
46
47/* 45/*
48 * The basic PPP frame. 46 * The basic PPP frame.
49 */ 47 */
@@ -97,7 +95,11 @@
97 95
98#define PPP_INITFCS 0xffff /* Initial FCS value */ 96#define PPP_INITFCS 0xffff /* Initial FCS value */
99#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */ 97#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */
98
99#ifdef __KERNEL__
100#include <linux/crc-ccitt.h>
100#define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c) 101#define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c)
102#endif
101 103
102/* 104/*
103 * Extended asyncmap - allows any character to be escaped. 105 * Extended asyncmap - allows any character to be escaped.
@@ -179,12 +181,4 @@ struct ppp_idle {
179 time_t recv_idle; /* time since last NP packet received */ 181 time_t recv_idle; /* time since last NP packet received */
180}; 182};
181 183
182#ifndef __P
183#ifdef __STDC__
184#define __P(x) x
185#else
186#define __P(x) ()
187#endif
188#endif
189
190#endif /* _PPP_DEFS_H_ */ 184#endif /* _PPP_DEFS_H_ */
diff --git a/include/linux/prctl.h b/include/linux/prctl.h
index bf022c43a18e..52a9be41250d 100644
--- a/include/linux/prctl.h
+++ b/include/linux/prctl.h
@@ -52,4 +52,11 @@
52#define PR_SET_NAME 15 /* Set process name */ 52#define PR_SET_NAME 15 /* Set process name */
53#define PR_GET_NAME 16 /* Get process name */ 53#define PR_GET_NAME 16 /* Get process name */
54 54
55/* Get/set process endian */
56#define PR_GET_ENDIAN 19
57#define PR_SET_ENDIAN 20
58# define PR_ENDIAN_BIG 0
59# define PR_ENDIAN_LITTLE 1 /* True little endian mode */
60# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */
61
55#endif /* _LINUX_PRCTL_H */ 62#endif /* _LINUX_PRCTL_H */
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 5769d14d1e6a..d0926d63406c 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -6,7 +6,6 @@
6 * preempt_count (used for kernel preemption, interrupt count, etc.) 6 * preempt_count (used for kernel preemption, interrupt count, etc.)
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/thread_info.h> 9#include <linux/thread_info.h>
11#include <linux/linkage.h> 10#include <linux/linkage.h>
12 11
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 4b47a0253425..5810d28fbed9 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_PROC_FS_H 1#ifndef _LINUX_PROC_FS_H
2#define _LINUX_PROC_FS_H 2#define _LINUX_PROC_FS_H
3 3
4#include <linux/config.h>
5#include <linux/slab.h> 4#include <linux/slab.h>
6#include <linux/fs.h> 5#include <linux/fs.h>
7#include <linux/spinlock.h> 6#include <linux/spinlock.h>
diff --git a/include/linux/profile.h b/include/linux/profile.h
index 1f2fea6640a4..e633004ae052 100644
--- a/include/linux/profile.h
+++ b/include/linux/profile.h
@@ -4,7 +4,6 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/config.h>
8#include <linux/init.h> 7#include <linux/init.h>
9#include <linux/cpumask.h> 8#include <linux/cpumask.h>
10#include <asm/errno.h> 9#include <asm/errno.h>
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 0d36750fc0f1..ee918bc6e18c 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -51,6 +51,10 @@
51#ifdef __KERNEL__ 51#ifdef __KERNEL__
52/* 52/*
53 * Ptrace flags 53 * Ptrace flags
54 *
55 * The owner ship rules for task->ptrace which holds the ptrace
56 * flags is simple. When a task is running it owns it's task->ptrace
57 * flags. When the a task is stopped the ptracer owns task->ptrace.
54 */ 58 */
55 59
56#define PT_PTRACED 0x00000001 60#define PT_PTRACED 0x00000001
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 2dab71e1c3d1..b8fbf26eb885 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -37,8 +37,6 @@
37 37
38#include <linux/errno.h> 38#include <linux/errno.h>
39#include <linux/types.h> 39#include <linux/types.h>
40#include <linux/spinlock.h>
41#include <linux/mutex.h>
42 40
43#define __DQUOT_VERSION__ "dquot_6.5.1" 41#define __DQUOT_VERSION__ "dquot_6.5.1"
44#define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 42#define __DQUOT_NUM_VERSION__ 6*10000+5*100+1
@@ -133,6 +131,8 @@ struct if_dqinfo {
133}; 131};
134 132
135#ifdef __KERNEL__ 133#ifdef __KERNEL__
134#include <linux/spinlock.h>
135#include <linux/mutex.h>
136 136
137#include <linux/dqblk_xfs.h> 137#include <linux/dqblk_xfs.h>
138#include <linux/dqblk_v1.h> 138#include <linux/dqblk_v1.h>
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 21e5a9124856..5110201a4159 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -10,7 +10,6 @@
10#ifndef _LINUX_QUOTAOPS_ 10#ifndef _LINUX_QUOTAOPS_
11#define _LINUX_QUOTAOPS_ 11#define _LINUX_QUOTAOPS_
12 12
13#include <linux/config.h>
14#include <linux/smp_lock.h> 13#include <linux/smp_lock.h>
15 14
16#include <linux/fs.h> 15#include <linux/fs.h>
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index dd83cca28001..9158a68140c9 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -23,6 +23,9 @@
23#include <linux/preempt.h> 23#include <linux/preempt.h>
24#include <linux/types.h> 24#include <linux/types.h>
25 25
26#define RADIX_TREE_MAX_TAGS 2
27
28/* root tags are stored in gfp_mask, shifted by __GFP_BITS_SHIFT */
26struct radix_tree_root { 29struct radix_tree_root {
27 unsigned int height; 30 unsigned int height;
28 gfp_t gfp_mask; 31 gfp_t gfp_mask;
@@ -45,8 +48,6 @@ do { \
45 (root)->rnode = NULL; \ 48 (root)->rnode = NULL; \
46} while (0) 49} while (0)
47 50
48#define RADIX_TREE_MAX_TAGS 2
49
50int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); 51int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
51void *radix_tree_lookup(struct radix_tree_root *, unsigned long); 52void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
52void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); 53void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long);
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 78ecfa28b1c2..00b340ba6612 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -2,8 +2,8 @@
2#define _LINUX_RAMFS_H 2#define _LINUX_RAMFS_H
3 3
4struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev); 4struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev);
5struct super_block *ramfs_get_sb(struct file_system_type *fs_type, 5extern int ramfs_get_sb(struct file_system_type *fs_type,
6 int flags, const char *dev_name, void *data); 6 int flags, const char *dev_name, void *data, struct vfsmount *mnt);
7 7
8#ifndef CONFIG_MMU 8#ifndef CONFIG_MMU
9extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, 9extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index 4b7cc4fe366d..8d5382e62c08 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -99,22 +99,43 @@ static inline struct page * rb_insert_page_cache(struct inode * inode,
99 99
100struct rb_node 100struct rb_node
101{ 101{
102 struct rb_node *rb_parent; 102 unsigned long rb_parent_color;
103 int rb_color;
104#define RB_RED 0 103#define RB_RED 0
105#define RB_BLACK 1 104#define RB_BLACK 1
106 struct rb_node *rb_right; 105 struct rb_node *rb_right;
107 struct rb_node *rb_left; 106 struct rb_node *rb_left;
108}; 107} __attribute__((aligned(sizeof(long))));
108 /* The alignment might seem pointless, but allegedly CRIS needs it */
109 109
110struct rb_root 110struct rb_root
111{ 111{
112 struct rb_node *rb_node; 112 struct rb_node *rb_node;
113}; 113};
114 114
115
116#define rb_parent(r) ((struct rb_node *)((r)->rb_parent_color & ~3))
117#define rb_color(r) ((r)->rb_parent_color & 1)
118#define rb_is_red(r) (!rb_color(r))
119#define rb_is_black(r) rb_color(r)
120#define rb_set_red(r) do { (r)->rb_parent_color &= ~1; } while (0)
121#define rb_set_black(r) do { (r)->rb_parent_color |= 1; } while (0)
122
123static inline void rb_set_parent(struct rb_node *rb, struct rb_node *p)
124{
125 rb->rb_parent_color = (rb->rb_parent_color & 3) | (unsigned long)p;
126}
127static inline void rb_set_color(struct rb_node *rb, int color)
128{
129 rb->rb_parent_color = (rb->rb_parent_color & ~1) | color;
130}
131
115#define RB_ROOT (struct rb_root) { NULL, } 132#define RB_ROOT (struct rb_root) { NULL, }
116#define rb_entry(ptr, type, member) container_of(ptr, type, member) 133#define rb_entry(ptr, type, member) container_of(ptr, type, member)
117 134
135#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
136#define RB_EMPTY_NODE(node) (rb_parent(node) != node)
137#define RB_CLEAR_NODE(node) (rb_set_parent(node, node))
138
118extern void rb_insert_color(struct rb_node *, struct rb_root *); 139extern void rb_insert_color(struct rb_node *, struct rb_root *);
119extern void rb_erase(struct rb_node *, struct rb_root *); 140extern void rb_erase(struct rb_node *, struct rb_root *);
120 141
@@ -131,8 +152,7 @@ extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
131static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, 152static inline void rb_link_node(struct rb_node * node, struct rb_node * parent,
132 struct rb_node ** rb_link) 153 struct rb_node ** rb_link)
133{ 154{
134 node->rb_parent = parent; 155 node->rb_parent_color = (unsigned long )parent;
135 node->rb_color = RB_RED;
136 node->rb_left = node->rb_right = NULL; 156 node->rb_left = node->rb_right = NULL;
137 157
138 *rb_link = node; 158 *rb_link = node;
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 970284f571a6..6312758393b6 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -246,7 +246,7 @@ extern int rcu_needs_cpu(int cpu);
246 * softirq handlers will have completed, since in some kernels, these 246 * softirq handlers will have completed, since in some kernels, these
247 * handlers can run in process context, and can block. 247 * handlers can run in process context, and can block.
248 * 248 *
249 * This primitive provides the guarantees made by the (deprecated) 249 * This primitive provides the guarantees made by the (now removed)
250 * synchronize_kernel() API. In contrast, synchronize_rcu() only 250 * synchronize_kernel() API. In contrast, synchronize_rcu() only
251 * guarantees that rcu_read_lock() sections will have completed. 251 * guarantees that rcu_read_lock() sections will have completed.
252 * In "classic RCU", these two guarantees happen to be one and 252 * In "classic RCU", these two guarantees happen to be one and
@@ -264,7 +264,6 @@ extern void FASTCALL(call_rcu(struct rcu_head *head,
264 void (*func)(struct rcu_head *head))); 264 void (*func)(struct rcu_head *head)));
265extern void FASTCALL(call_rcu_bh(struct rcu_head *head, 265extern void FASTCALL(call_rcu_bh(struct rcu_head *head,
266 void (*func)(struct rcu_head *head))); 266 void (*func)(struct rcu_head *head)));
267extern __deprecated_for_modules void synchronize_kernel(void);
268extern void synchronize_rcu(void); 267extern void synchronize_rcu(void);
269void synchronize_idle(void); 268void synchronize_idle(void);
270extern void rcu_barrier(void); 269extern void rcu_barrier(void);
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 5353afb11db3..5e961035c725 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -2,8 +2,6 @@
2 File: linux/reiserfs_xattr.h 2 File: linux/reiserfs_xattr.h
3*/ 3*/
4 4
5#include <linux/config.h>
6#include <linux/init.h>
7#include <linux/xattr.h> 5#include <linux/xattr.h>
8 6
9/* Magic value in header */ 7/* Magic value in header */
@@ -15,6 +13,7 @@ struct reiserfs_xattr_header {
15}; 13};
16 14
17#ifdef __KERNEL__ 15#ifdef __KERNEL__
16#include <linux/init.h>
18 17
19struct reiserfs_xattr_handler { 18struct reiserfs_xattr_handler {
20 char *prefix; 19 char *prefix;
diff --git a/include/linux/relay.h b/include/linux/relay.h
index 4bcc1531d6a9..24accb483849 100644
--- a/include/linux/relay.h
+++ b/include/linux/relay.h
@@ -10,7 +10,6 @@
10#ifndef _LINUX_RELAY_H 10#ifndef _LINUX_RELAY_H
11#define _LINUX_RELAY_H 11#define _LINUX_RELAY_H
12 12
13#include <linux/config.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/sched.h> 14#include <linux/sched.h>
16#include <linux/wait.h> 15#include <linux/wait.h>
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h
new file mode 100644
index 000000000000..a376bd4ade39
--- /dev/null
+++ b/include/linux/resume-trace.h
@@ -0,0 +1,30 @@
1#ifndef RESUME_TRACE_H
2#define RESUME_TRACE_H
3
4#ifdef CONFIG_PM_TRACE
5
6struct device;
7extern void set_trace_device(struct device *);
8extern void generate_resume_trace(void *tracedata, unsigned int user);
9
10#define TRACE_DEVICE(dev) set_trace_device(dev)
11#define TRACE_RESUME(user) do { \
12 void *tracedata; \
13 asm volatile("movl $1f,%0\n" \
14 ".section .tracedata,\"a\"\n" \
15 "1:\t.word %c1\n" \
16 "\t.long %c2\n" \
17 ".previous" \
18 :"=r" (tracedata) \
19 : "i" (__LINE__), "i" (__FILE__)); \
20 generate_resume_trace(tracedata, user); \
21} while (0)
22
23#else
24
25#define TRACE_DEVICE(dev) do { } while (0)
26#define TRACE_RESUME(dev) do { } while (0)
27
28#endif
29
30#endif
diff --git a/include/linux/rio.h b/include/linux/rio.h
index c7e907faae9c..d93857056cb9 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -17,7 +17,6 @@
17#ifdef __KERNEL__ 17#ifdef __KERNEL__
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/config.h>
21#include <linux/ioport.h> 20#include <linux/ioport.h>
22#include <linux/list.h> 21#include <linux/list.h>
23#include <linux/errno.h> 22#include <linux/errno.h>
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h
index f54772d0e7f8..7adb2a1aac92 100644
--- a/include/linux/rio_drv.h
+++ b/include/linux/rio_drv.h
@@ -16,7 +16,6 @@
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/config.h>
20#include <linux/ioport.h> 19#include <linux/ioport.h>
21#include <linux/list.h> 20#include <linux/list.h>
22#include <linux/errno.h> 21#include <linux/errno.h>
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index d6b9bcd1384c..bf97b0900014 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -4,7 +4,6 @@
4 * Declarations for Reverse Mapping functions in mm/rmap.c 4 * Declarations for Reverse Mapping functions in mm/rmap.c
5 */ 5 */
6 6
7#include <linux/config.h>
8#include <linux/list.h> 7#include <linux/list.h>
9#include <linux/slab.h> 8#include <linux/slab.h>
10#include <linux/mm.h> 9#include <linux/mm.h>
@@ -92,7 +91,6 @@ static inline void page_dup_rmap(struct page *page)
92 */ 91 */
93int page_referenced(struct page *, int is_locked); 92int page_referenced(struct page *, int is_locked);
94int try_to_unmap(struct page *, int ignore_refs); 93int try_to_unmap(struct page *, int ignore_refs);
95void remove_from_swap(struct page *page);
96 94
97/* 95/*
98 * Called from mm/filemap_xip.c to unmap empty zero page 96 * Called from mm/filemap_xip.c to unmap empty zero page
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index df0cdd41085c..facd9ee37b76 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -909,7 +909,6 @@ struct tcamsg
909 909
910#ifdef __KERNEL__ 910#ifdef __KERNEL__
911 911
912#include <linux/config.h>
913#include <linux/mutex.h> 912#include <linux/mutex.h>
914 913
915extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); 914extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size);
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index bfb988885002..f99fe90732ab 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -13,7 +13,6 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <linux/config.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <asm/system.h> 18#include <asm/system.h>
diff --git a/include/linux/scc.h b/include/linux/scc.h
index 885a4a02b23c..3495bd953cc6 100644
--- a/include/linux/scc.h
+++ b/include/linux/scc.h
@@ -3,7 +3,6 @@
3#ifndef _SCC_H 3#ifndef _SCC_H
4#define _SCC_H 4#define _SCC_H
5 5
6#include <linux/config.h>
7 6
8/* selection of hardware types */ 7/* selection of hardware types */
9 8
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 29b7d4f87d20..38b4791e6a5d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1,9 +1,46 @@
1#ifndef _LINUX_SCHED_H 1#ifndef _LINUX_SCHED_H
2#define _LINUX_SCHED_H 2#define _LINUX_SCHED_H
3 3
4#include <linux/auxvec.h> /* For AT_VECTOR_SIZE */
5
6/*
7 * cloning flags:
8 */
9#define CSIGNAL 0x000000ff /* signal mask to be sent at exit */
10#define CLONE_VM 0x00000100 /* set if VM shared between processes */
11#define CLONE_FS 0x00000200 /* set if fs info shared between processes */
12#define CLONE_FILES 0x00000400 /* set if open files shared between processes */
13#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */
14#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
15#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
16#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
17#define CLONE_THREAD 0x00010000 /* Same thread group? */
18#define CLONE_NEWNS 0x00020000 /* New namespace group? */
19#define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */
20#define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
21#define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */
22#define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */
23#define CLONE_DETACHED 0x00400000 /* Unused, ignored */
24#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
25#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
26#define CLONE_STOPPED 0x02000000 /* Start in stopped state */
27
28/*
29 * Scheduling policies
30 */
31#define SCHED_NORMAL 0
32#define SCHED_FIFO 1
33#define SCHED_RR 2
34#define SCHED_BATCH 3
35
36#ifdef __KERNEL__
37
38struct sched_param {
39 int sched_priority;
40};
41
4#include <asm/param.h> /* for HZ */ 42#include <asm/param.h> /* for HZ */
5 43
6#include <linux/config.h>
7#include <linux/capability.h> 44#include <linux/capability.h>
8#include <linux/threads.h> 45#include <linux/threads.h>
9#include <linux/kernel.h> 46#include <linux/kernel.h>
@@ -37,31 +74,15 @@
37#include <linux/rcupdate.h> 74#include <linux/rcupdate.h>
38#include <linux/futex.h> 75#include <linux/futex.h>
39 76
40#include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ 77#include <linux/time.h>
78#include <linux/param.h>
79#include <linux/resource.h>
80#include <linux/timer.h>
81#include <linux/hrtimer.h>
41 82
42struct exec_domain; 83#include <asm/processor.h>
43 84
44/* 85struct exec_domain;
45 * cloning flags:
46 */
47#define CSIGNAL 0x000000ff /* signal mask to be sent at exit */
48#define CLONE_VM 0x00000100 /* set if VM shared between processes */
49#define CLONE_FS 0x00000200 /* set if fs info shared between processes */
50#define CLONE_FILES 0x00000400 /* set if open files shared between processes */
51#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */
52#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
53#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
54#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
55#define CLONE_THREAD 0x00010000 /* Same thread group? */
56#define CLONE_NEWNS 0x00020000 /* New namespace group? */
57#define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */
58#define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
59#define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */
60#define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */
61#define CLONE_DETACHED 0x00400000 /* Unused, ignored */
62#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
63#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
64#define CLONE_STOPPED 0x02000000 /* Start in stopped state */
65 86
66/* 87/*
67 * List of flags we want to share for kernel threads, 88 * List of flags we want to share for kernel threads,
@@ -103,13 +124,6 @@ extern unsigned long nr_uninterruptible(void);
103extern unsigned long nr_active(void); 124extern unsigned long nr_active(void);
104extern unsigned long nr_iowait(void); 125extern unsigned long nr_iowait(void);
105 126
106#include <linux/time.h>
107#include <linux/param.h>
108#include <linux/resource.h>
109#include <linux/timer.h>
110#include <linux/hrtimer.h>
111
112#include <asm/processor.h>
113 127
114/* 128/*
115 * Task state bitmask. NOTE! These bits are also 129 * Task state bitmask. NOTE! These bits are also
@@ -156,20 +170,6 @@ extern unsigned long nr_iowait(void);
156/* Task command name length */ 170/* Task command name length */
157#define TASK_COMM_LEN 16 171#define TASK_COMM_LEN 16
158 172
159/*
160 * Scheduling policies
161 */
162#define SCHED_NORMAL 0
163#define SCHED_FIFO 1
164#define SCHED_RR 2
165#define SCHED_BATCH 3
166
167struct sched_param {
168 int sched_priority;
169};
170
171#ifdef __KERNEL__
172
173#include <linux/spinlock.h> 173#include <linux/spinlock.h>
174 174
175/* 175/*
@@ -494,7 +494,7 @@ struct user_struct {
494 atomic_t processes; /* How many processes does this user have? */ 494 atomic_t processes; /* How many processes does this user have? */
495 atomic_t files; /* How many open files does this user have? */ 495 atomic_t files; /* How many open files does this user have? */
496 atomic_t sigpending; /* How many pending signals does this user have? */ 496 atomic_t sigpending; /* How many pending signals does this user have? */
497#ifdef CONFIG_INOTIFY 497#ifdef CONFIG_INOTIFY_USER
498 atomic_t inotify_watches; /* How many inotify watches does this user have? */ 498 atomic_t inotify_watches; /* How many inotify watches does this user have? */
499 atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ 499 atomic_t inotify_devs; /* How many inotify devs does this user have opened? */
500#endif 500#endif
@@ -941,12 +941,11 @@ static inline void put_task_struct(struct task_struct *t)
941#define PF_KSWAPD 0x00040000 /* I am kswapd */ 941#define PF_KSWAPD 0x00040000 /* I am kswapd */
942#define PF_SWAPOFF 0x00080000 /* I am in swapoff */ 942#define PF_SWAPOFF 0x00080000 /* I am in swapoff */
943#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ 943#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */
944#define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */ 944#define PF_BORROWED_MM 0x00200000 /* I am a kthread doing use_mm */
945#define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ 945#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */
946#define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ 946#define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */
947#define PF_SWAPWRITE 0x01000000 /* Allowed to write to swap */ 947#define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */
948#define PF_SPREAD_PAGE 0x04000000 /* Spread page cache over cpuset */ 948#define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */
949#define PF_SPREAD_SLAB 0x08000000 /* Spread some slab caches over cpuset */
950#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ 949#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */
951 950
952/* 951/*
@@ -1225,7 +1224,7 @@ static inline int thread_group_empty(task_t *p)
1225 (thread_group_leader(p) && !thread_group_empty(p)) 1224 (thread_group_leader(p) && !thread_group_empty(p))
1226 1225
1227/* 1226/*
1228 * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring 1227 * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
1229 * subscriptions and synchronises with wait4(). Also used in procfs. Also 1228 * subscriptions and synchronises with wait4(). Also used in procfs. Also
1230 * pins the final release of task.io_context. Also protects ->cpuset. 1229 * pins the final release of task.io_context. Also protects ->cpuset.
1231 * 1230 *
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index cd2773b29a64..3e8b1cf54303 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_SECCOMP_H 1#ifndef _LINUX_SECCOMP_H
2#define _LINUX_SECCOMP_H 2#define _LINUX_SECCOMP_H
3 3
4#include <linux/config.h>
5 4
6#ifdef CONFIG_SECCOMP 5#ifdef CONFIG_SECCOMP
7 6
diff --git a/include/linux/security.h b/include/linux/security.h
index 4dfb1b84a9b3..d2c17bd91a29 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -171,9 +171,9 @@ struct swap_info_struct;
171 * Deallocate and clear the sb->s_security field. 171 * Deallocate and clear the sb->s_security field.
172 * @sb contains the super_block structure to be modified. 172 * @sb contains the super_block structure to be modified.
173 * @sb_statfs: 173 * @sb_statfs:
174 * Check permission before obtaining filesystem statistics for the @sb 174 * Check permission before obtaining filesystem statistics for the @mnt
175 * filesystem. 175 * mountpoint.
176 * @sb contains the super_block structure for the filesystem. 176 * @dentry is a handle on the superblock for the filesystem.
177 * Return 0 if permission is granted. 177 * Return 0 if permission is granted.
178 * @sb_mount: 178 * @sb_mount:
179 * Check permission before an object specified by @dev_name is mounted on 179 * Check permission before an object specified by @dev_name is mounted on
@@ -577,6 +577,11 @@ struct swap_info_struct;
577 * @p contains the task_struct of process. 577 * @p contains the task_struct of process.
578 * @nice contains the new nice value. 578 * @nice contains the new nice value.
579 * Return 0 if permission is granted. 579 * Return 0 if permission is granted.
580 * @task_setioprio
581 * Check permission before setting the ioprio value of @p to @ioprio.
582 * @p contains the task_struct of process.
583 * @ioprio contains the new ioprio value
584 * Return 0 if permission is granted.
580 * @task_setrlimit: 585 * @task_setrlimit:
581 * Check permission before setting the resource limits of the current 586 * Check permission before setting the resource limits of the current
582 * process for @resource to @new_rlim. The old resource limit values can 587 * process for @resource to @new_rlim. The old resource limit values can
@@ -596,6 +601,10 @@ struct swap_info_struct;
596 * @p. 601 * @p.
597 * @p contains the task_struct for process. 602 * @p contains the task_struct for process.
598 * Return 0 if permission is granted. 603 * Return 0 if permission is granted.
604 * @task_movememory
605 * Check permission before moving memory owned by process @p.
606 * @p contains the task_struct for process.
607 * Return 0 if permission is granted.
599 * @task_kill: 608 * @task_kill:
600 * Check permission before sending signal @sig to @p. @info can be NULL, 609 * Check permission before sending signal @sig to @p. @info can be NULL,
601 * the constant 1, or a pointer to a siginfo structure. If @info is 1 or 610 * the constant 1, or a pointer to a siginfo structure. If @info is 1 or
@@ -1127,7 +1136,7 @@ struct security_operations {
1127 int (*sb_copy_data)(struct file_system_type *type, 1136 int (*sb_copy_data)(struct file_system_type *type,
1128 void *orig, void *copy); 1137 void *orig, void *copy);
1129 int (*sb_kern_mount) (struct super_block *sb, void *data); 1138 int (*sb_kern_mount) (struct super_block *sb, void *data);
1130 int (*sb_statfs) (struct super_block * sb); 1139 int (*sb_statfs) (struct dentry *dentry);
1131 int (*sb_mount) (char *dev_name, struct nameidata * nd, 1140 int (*sb_mount) (char *dev_name, struct nameidata * nd,
1132 char *type, unsigned long flags, void *data); 1141 char *type, unsigned long flags, void *data);
1133 int (*sb_check_sb) (struct vfsmount * mnt, struct nameidata * nd); 1142 int (*sb_check_sb) (struct vfsmount * mnt, struct nameidata * nd);
@@ -1210,10 +1219,12 @@ struct security_operations {
1210 int (*task_getsid) (struct task_struct * p); 1219 int (*task_getsid) (struct task_struct * p);
1211 int (*task_setgroups) (struct group_info *group_info); 1220 int (*task_setgroups) (struct group_info *group_info);
1212 int (*task_setnice) (struct task_struct * p, int nice); 1221 int (*task_setnice) (struct task_struct * p, int nice);
1222 int (*task_setioprio) (struct task_struct * p, int ioprio);
1213 int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim); 1223 int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim);
1214 int (*task_setscheduler) (struct task_struct * p, int policy, 1224 int (*task_setscheduler) (struct task_struct * p, int policy,
1215 struct sched_param * lp); 1225 struct sched_param * lp);
1216 int (*task_getscheduler) (struct task_struct * p); 1226 int (*task_getscheduler) (struct task_struct * p);
1227 int (*task_movememory) (struct task_struct * p);
1217 int (*task_kill) (struct task_struct * p, 1228 int (*task_kill) (struct task_struct * p,
1218 struct siginfo * info, int sig); 1229 struct siginfo * info, int sig);
1219 int (*task_wait) (struct task_struct * p); 1230 int (*task_wait) (struct task_struct * p);
@@ -1313,7 +1324,7 @@ struct security_operations {
1313 1324
1314 /* key management security hooks */ 1325 /* key management security hooks */
1315#ifdef CONFIG_KEYS 1326#ifdef CONFIG_KEYS
1316 int (*key_alloc)(struct key *key); 1327 int (*key_alloc)(struct key *key, struct task_struct *tsk);
1317 void (*key_free)(struct key *key); 1328 void (*key_free)(struct key *key);
1318 int (*key_permission)(key_ref_t key_ref, 1329 int (*key_permission)(key_ref_t key_ref,
1319 struct task_struct *context, 1330 struct task_struct *context,
@@ -1450,9 +1461,9 @@ static inline int security_sb_kern_mount (struct super_block *sb, void *data)
1450 return security_ops->sb_kern_mount (sb, data); 1461 return security_ops->sb_kern_mount (sb, data);
1451} 1462}
1452 1463
1453static inline int security_sb_statfs (struct super_block *sb) 1464static inline int security_sb_statfs (struct dentry *dentry)
1454{ 1465{
1455 return security_ops->sb_statfs (sb); 1466 return security_ops->sb_statfs (dentry);
1456} 1467}
1457 1468
1458static inline int security_sb_mount (char *dev_name, struct nameidata *nd, 1469static inline int security_sb_mount (char *dev_name, struct nameidata *nd,
@@ -1836,6 +1847,11 @@ static inline int security_task_setnice (struct task_struct *p, int nice)
1836 return security_ops->task_setnice (p, nice); 1847 return security_ops->task_setnice (p, nice);
1837} 1848}
1838 1849
1850static inline int security_task_setioprio (struct task_struct *p, int ioprio)
1851{
1852 return security_ops->task_setioprio (p, ioprio);
1853}
1854
1839static inline int security_task_setrlimit (unsigned int resource, 1855static inline int security_task_setrlimit (unsigned int resource,
1840 struct rlimit *new_rlim) 1856 struct rlimit *new_rlim)
1841{ 1857{
@@ -1854,6 +1870,11 @@ static inline int security_task_getscheduler (struct task_struct *p)
1854 return security_ops->task_getscheduler (p); 1870 return security_ops->task_getscheduler (p);
1855} 1871}
1856 1872
1873static inline int security_task_movememory (struct task_struct *p)
1874{
1875 return security_ops->task_movememory (p);
1876}
1877
1857static inline int security_task_kill (struct task_struct *p, 1878static inline int security_task_kill (struct task_struct *p,
1858 struct siginfo *info, int sig) 1879 struct siginfo *info, int sig)
1859{ 1880{
@@ -2162,7 +2183,7 @@ static inline int security_sb_kern_mount (struct super_block *sb, void *data)
2162 return 0; 2183 return 0;
2163} 2184}
2164 2185
2165static inline int security_sb_statfs (struct super_block *sb) 2186static inline int security_sb_statfs (struct dentry *dentry)
2166{ 2187{
2167 return 0; 2188 return 0;
2168} 2189}
@@ -2478,6 +2499,11 @@ static inline int security_task_setnice (struct task_struct *p, int nice)
2478 return 0; 2499 return 0;
2479} 2500}
2480 2501
2502static inline int security_task_setioprio (struct task_struct *p, int ioprio)
2503{
2504 return 0;
2505}
2506
2481static inline int security_task_setrlimit (unsigned int resource, 2507static inline int security_task_setrlimit (unsigned int resource,
2482 struct rlimit *new_rlim) 2508 struct rlimit *new_rlim)
2483{ 2509{
@@ -2496,6 +2522,11 @@ static inline int security_task_getscheduler (struct task_struct *p)
2496 return 0; 2522 return 0;
2497} 2523}
2498 2524
2525static inline int security_task_movememory (struct task_struct *p)
2526{
2527 return 0;
2528}
2529
2499static inline int security_task_kill (struct task_struct *p, 2530static inline int security_task_kill (struct task_struct *p,
2500 struct siginfo *info, int sig) 2531 struct siginfo *info, int sig)
2501{ 2532{
@@ -3008,9 +3039,10 @@ static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid
3008 3039
3009#ifdef CONFIG_KEYS 3040#ifdef CONFIG_KEYS
3010#ifdef CONFIG_SECURITY 3041#ifdef CONFIG_SECURITY
3011static inline int security_key_alloc(struct key *key) 3042static inline int security_key_alloc(struct key *key,
3043 struct task_struct *tsk)
3012{ 3044{
3013 return security_ops->key_alloc(key); 3045 return security_ops->key_alloc(key, tsk);
3014} 3046}
3015 3047
3016static inline void security_key_free(struct key *key) 3048static inline void security_key_free(struct key *key)
@@ -3027,7 +3059,8 @@ static inline int security_key_permission(key_ref_t key_ref,
3027 3059
3028#else 3060#else
3029 3061
3030static inline int security_key_alloc(struct key *key) 3062static inline int security_key_alloc(struct key *key,
3063 struct task_struct *tsk)
3031{ 3064{
3032 return 0; 3065 return 0;
3033} 3066}
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 3c1f1120fe88..9aaffb0b1d81 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -2,7 +2,6 @@
2#define _LINUX_SEM_H 2#define _LINUX_SEM_H
3 3
4#include <linux/ipc.h> 4#include <linux/ipc.h>
5#include <asm/atomic.h>
6 5
7/* semop flags */ 6/* semop flags */
8#define SEM_UNDO 0x1000 /* undo the operation on exit */ 7#define SEM_UNDO 0x1000 /* undo the operation on exit */
@@ -78,6 +77,7 @@ struct seminfo {
78#define SEMUSZ 20 /* sizeof struct sem_undo */ 77#define SEMUSZ 20 /* sizeof struct sem_undo */
79 78
80#ifdef __KERNEL__ 79#ifdef __KERNEL__
80#include <asm/atomic.h>
81 81
82struct task_struct; 82struct task_struct;
83 83
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index 5a095572881d..7bc5c7c12b54 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -26,7 +26,6 @@
26 * by Keith Owens and Andrea Arcangeli 26 * by Keith Owens and Andrea Arcangeli
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/spinlock.h> 29#include <linux/spinlock.h>
31#include <linux/preempt.h> 30#include <linux/preempt.h>
32 31
diff --git a/include/linux/serialP.h b/include/linux/serialP.h
index 2b9e6b9554d5..e811a615f696 100644
--- a/include/linux/serialP.h
+++ b/include/linux/serialP.h
@@ -19,7 +19,6 @@
19 * For definitions of the flags field, see tty.h 19 * For definitions of the flags field, see tty.h
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/termios.h> 22#include <linux/termios.h>
24#include <linux/workqueue.h> 23#include <linux/workqueue.h>
25#include <linux/interrupt.h> 24#include <linux/interrupt.h>
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index bd14858121ea..951c4e858274 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -67,8 +67,8 @@
67/* Parisc type numbers. */ 67/* Parisc type numbers. */
68#define PORT_MUX 48 68#define PORT_MUX 48
69 69
70/* Atmel AT91RM9200 SoC */ 70/* Atmel AT91xxx SoC */
71#define PORT_AT91RM9200 49 71#define PORT_AT91 49
72 72
73/* Macintosh Zilog type numbers */ 73/* Macintosh Zilog type numbers */
74#define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */ 74#define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */
@@ -130,9 +130,11 @@
130/* SUN4V Hypervisor Console */ 130/* SUN4V Hypervisor Console */
131#define PORT_SUNHV 72 131#define PORT_SUNHV 72
132 132
133#define PORT_S3C2412 73
134
135
133#ifdef __KERNEL__ 136#ifdef __KERNEL__
134 137
135#include <linux/config.h>
136#include <linux/compiler.h> 138#include <linux/compiler.h>
137#include <linux/interrupt.h> 139#include <linux/interrupt.h>
138#include <linux/circ_buf.h> 140#include <linux/circ_buf.h>
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 70739f51a09f..1e4ce7225eee 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -1,12 +1,12 @@
1#ifndef _LINUX_SIGNAL_H 1#ifndef _LINUX_SIGNAL_H
2#define _LINUX_SIGNAL_H 2#define _LINUX_SIGNAL_H
3 3
4#include <linux/list.h>
5#include <linux/spinlock.h>
6#include <asm/signal.h> 4#include <asm/signal.h>
7#include <asm/siginfo.h> 5#include <asm/siginfo.h>
8 6
9#ifdef __KERNEL__ 7#ifdef __KERNEL__
8#include <linux/list.h>
9#include <linux/spinlock.h>
10 10
11/* 11/*
12 * These values of sa_flags are used only by the kernel as part of the 12 * These values of sa_flags are used only by the kernel as part of the
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 93e4db221585..16eef03ce0eb 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -14,7 +14,6 @@
14#ifndef _LINUX_SKBUFF_H 14#ifndef _LINUX_SKBUFF_H
15#define _LINUX_SKBUFF_H 15#define _LINUX_SKBUFF_H
16 16
17#include <linux/config.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/compiler.h> 18#include <linux/compiler.h>
20#include <linux/time.h> 19#include <linux/time.h>
@@ -135,9 +134,10 @@ struct skb_frag_struct {
135struct skb_shared_info { 134struct skb_shared_info {
136 atomic_t dataref; 135 atomic_t dataref;
137 unsigned short nr_frags; 136 unsigned short nr_frags;
138 unsigned short tso_size; 137 unsigned short gso_size;
139 unsigned short tso_segs; 138 /* Warning: this field is not always filled in (UFO)! */
140 unsigned short ufo_size; 139 unsigned short gso_segs;
140 unsigned short gso_type;
141 unsigned int ip6_frag_id; 141 unsigned int ip6_frag_id;
142 struct sk_buff *frag_list; 142 struct sk_buff *frag_list;
143 skb_frag_t frags[MAX_SKB_FRAGS]; 143 skb_frag_t frags[MAX_SKB_FRAGS];
@@ -169,6 +169,11 @@ enum {
169 SKB_FCLONE_CLONE, 169 SKB_FCLONE_CLONE,
170}; 170};
171 171
172enum {
173 SKB_GSO_TCPV4 = 1 << 0,
174 SKB_GSO_UDPV4 = 1 << 1,
175};
176
172/** 177/**
173 * struct sk_buff - socket buffer 178 * struct sk_buff - socket buffer
174 * @next: Next buffer in list 179 * @next: Next buffer in list
@@ -210,6 +215,8 @@ enum {
210 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 215 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
211 * @tc_index: Traffic control index 216 * @tc_index: Traffic control index
212 * @tc_verd: traffic control verdict 217 * @tc_verd: traffic control verdict
218 * @dma_cookie: a cookie to one of several possible DMA operations
219 * done by skb DMA functions
213 * @secmark: security marking 220 * @secmark: security marking
214 */ 221 */
215 222
@@ -346,7 +353,7 @@ extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
346extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, 353extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
347 int newheadroom, int newtailroom, 354 int newheadroom, int newtailroom,
348 gfp_t priority); 355 gfp_t priority);
349extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); 356extern int skb_pad(struct sk_buff *skb, int pad);
350#define dev_kfree_skb(a) kfree_skb(a) 357#define dev_kfree_skb(a) kfree_skb(a)
351extern void skb_over_panic(struct sk_buff *skb, int len, 358extern void skb_over_panic(struct sk_buff *skb, int len,
352 void *here); 359 void *here);
@@ -1123,16 +1130,15 @@ static inline int skb_cow(struct sk_buff *skb, unsigned int headroom)
1123 * 1130 *
1124 * Pads up a buffer to ensure the trailing bytes exist and are 1131 * Pads up a buffer to ensure the trailing bytes exist and are
1125 * blanked. If the buffer already contains sufficient data it 1132 * blanked. If the buffer already contains sufficient data it
1126 * is untouched. Returns the buffer, which may be a replacement 1133 * is untouched. Otherwise it is extended. Returns zero on
1127 * for the original, or NULL for out of memory - in which case 1134 * success. The skb is freed on error.
1128 * the original buffer is still freed.
1129 */ 1135 */
1130 1136
1131static inline struct sk_buff *skb_padto(struct sk_buff *skb, unsigned int len) 1137static inline int skb_padto(struct sk_buff *skb, unsigned int len)
1132{ 1138{
1133 unsigned int size = skb->len; 1139 unsigned int size = skb->len;
1134 if (likely(size >= len)) 1140 if (likely(size >= len))
1135 return skb; 1141 return 0;
1136 return skb_pad(skb, len-size); 1142 return skb_pad(skb, len-size);
1137} 1143}
1138 1144
@@ -1293,6 +1299,7 @@ extern void skb_split(struct sk_buff *skb,
1293 struct sk_buff *skb1, const u32 len); 1299 struct sk_buff *skb1, const u32 len);
1294 1300
1295extern void skb_release_data(struct sk_buff *skb); 1301extern void skb_release_data(struct sk_buff *skb);
1302extern struct sk_buff *skb_segment(struct sk_buff *skb, int sg);
1296 1303
1297static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, 1304static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
1298 int len, void *buffer) 1305 int len, void *buffer)
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 2d985d59c7b8..45ad55b70d1c 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -11,7 +11,6 @@
11 11
12typedef struct kmem_cache kmem_cache_t; 12typedef struct kmem_cache kmem_cache_t;
13 13
14#include <linux/config.h> /* kmalloc_sizes.h needs CONFIG_ options */
15#include <linux/gfp.h> 14#include <linux/gfp.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/types.h> 16#include <linux/types.h>
@@ -87,6 +86,51 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, void*);
87 __kmalloc_track_caller(size, flags, __builtin_return_address(0)) 86 __kmalloc_track_caller(size, flags, __builtin_return_address(0))
88#endif 87#endif
89 88
89/**
90 * kmalloc - allocate memory
91 * @size: how many bytes of memory are required.
92 * @flags: the type of memory to allocate.
93 *
94 * kmalloc is the normal method of allocating memory
95 * in the kernel.
96 *
97 * The @flags argument may be one of:
98 *
99 * %GFP_USER - Allocate memory on behalf of user. May sleep.
100 *
101 * %GFP_KERNEL - Allocate normal kernel ram. May sleep.
102 *
103 * %GFP_ATOMIC - Allocation will not sleep.
104 * For example, use this inside interrupt handlers.
105 *
106 * %GFP_HIGHUSER - Allocate pages from high memory.
107 *
108 * %GFP_NOIO - Do not do any I/O at all while trying to get memory.
109 *
110 * %GFP_NOFS - Do not make any fs calls while trying to get memory.
111 *
112 * Also it is possible to set different flags by OR'ing
113 * in one or more of the following additional @flags:
114 *
115 * %__GFP_COLD - Request cache-cold pages instead of
116 * trying to return cache-warm pages.
117 *
118 * %__GFP_DMA - Request memory from the DMA-capable zone.
119 *
120 * %__GFP_HIGH - This allocation has high priority and may use emergency pools.
121 *
122 * %__GFP_HIGHMEM - Allocated memory may be from highmem.
123 *
124 * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail
125 * (think twice before using).
126 *
127 * %__GFP_NORETRY - If memory is not immediately available,
128 * then give up at once.
129 *
130 * %__GFP_NOWARN - If allocation fails, don't issue any warnings.
131 *
132 * %__GFP_REPEAT - If allocation fails initially, try once more before failing.
133 */
90static inline void *kmalloc(size_t size, gfp_t flags) 134static inline void *kmalloc(size_t size, gfp_t flags)
91{ 135{
92 if (__builtin_constant_p(size)) { 136 if (__builtin_constant_p(size)) {
@@ -112,6 +156,11 @@ found:
112 156
113extern void *__kzalloc(size_t, gfp_t); 157extern void *__kzalloc(size_t, gfp_t);
114 158
159/**
160 * kzalloc - allocate memory. The memory is set to zero.
161 * @size: how many bytes of memory are required.
162 * @flags: the type of memory to allocate (see kmalloc).
163 */
115static inline void *kzalloc(size_t size, gfp_t flags) 164static inline void *kzalloc(size_t size, gfp_t flags)
116{ 165{
117 if (__builtin_constant_p(size)) { 166 if (__builtin_constant_p(size)) {
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h
index 621a3d3662f3..367d6c3e8ed4 100644
--- a/include/linux/smb_fs.h
+++ b/include/linux/smb_fs.h
@@ -10,8 +10,6 @@
10#define _LINUX_SMB_FS_H 10#define _LINUX_SMB_FS_H
11 11
12#include <linux/smb.h> 12#include <linux/smb.h>
13#include <linux/smb_fs_i.h>
14#include <linux/smb_fs_sb.h>
15 13
16/* 14/*
17 * ioctl commands 15 * ioctl commands
@@ -24,6 +22,8 @@
24 22
25 23
26#ifdef __KERNEL__ 24#ifdef __KERNEL__
25#include <linux/smb_fs_i.h>
26#include <linux/smb_fs_sb.h>
27 27
28#include <linux/fs.h> 28#include <linux/fs.h>
29#include <linux/pagemap.h> 29#include <linux/pagemap.h>
diff --git a/include/linux/smp.h b/include/linux/smp.h
index e2fa3ab4afc5..c93c3fe4308c 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -6,7 +6,6 @@
6 * Alan Cox. <alan@redhat.com> 6 * Alan Cox. <alan@redhat.com>
7 */ 7 */
8 8
9#include <linux/config.h>
10 9
11extern void cpu_idle(void); 10extern void cpu_idle(void);
12 11
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h
index fa1ff3b165fe..cf715a40d833 100644
--- a/include/linux/smp_lock.h
+++ b/include/linux/smp_lock.h
@@ -1,7 +1,6 @@
1#ifndef __LINUX_SMPLOCK_H 1#ifndef __LINUX_SMPLOCK_H
2#define __LINUX_SMPLOCK_H 2#define __LINUX_SMPLOCK_H
3 3
4#include <linux/config.h>
5#ifdef CONFIG_LOCK_KERNEL 4#ifdef CONFIG_LOCK_KERNEL
6#include <linux/sched.h> 5#include <linux/sched.h>
7#include <linux/spinlock.h> 6#include <linux/spinlock.h>
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 9ab2ddd80221..361409094649 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -18,8 +18,6 @@ struct __kernel_sockaddr_storage {
18 18
19#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) 19#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
20 20
21#include <linux/config.h> /* for CONFIG_COMPAT */
22#include <linux/linkage.h>
23#include <asm/socket.h> /* arch-dependent defines */ 21#include <asm/socket.h> /* arch-dependent defines */
24#include <linux/sockios.h> /* the SIOCxxx I/O controls */ 22#include <linux/sockios.h> /* the SIOCxxx I/O controls */
25#include <linux/uio.h> /* iovec support */ 23#include <linux/uio.h> /* iovec support */
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 799be6747944..ae23beef9cc9 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -46,7 +46,6 @@
46 * linux/spinlock.h: builds the final spin_*() APIs. 46 * linux/spinlock.h: builds the final spin_*() APIs.
47 */ 47 */
48 48
49#include <linux/config.h>
50#include <linux/preempt.h> 49#include <linux/preempt.h>
51#include <linux/linkage.h> 50#include <linux/linkage.h>
52#include <linux/compiler.h> 51#include <linux/compiler.h>
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index 151a803ed0ed..5bfc553bdb21 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -4,7 +4,6 @@
4 very heavy lock, which is equivalent to grabbing every spinlock 4 very heavy lock, which is equivalent to grabbing every spinlock
5 (and more). So the "read" side to such a lock is anything which 5 (and more). So the "read" side to such a lock is anything which
6 diables preeempt. */ 6 diables preeempt. */
7#include <linux/config.h>
8#include <linux/cpu.h> 7#include <linux/cpu.h>
9#include <asm/system.h> 8#include <asm/system.h>
10 9
diff --git a/include/linux/string.h b/include/linux/string.h
index c61306da8c52..e4c755860316 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -56,6 +56,7 @@ extern char * strnchr(const char *, size_t, int);
56#ifndef __HAVE_ARCH_STRRCHR 56#ifndef __HAVE_ARCH_STRRCHR
57extern char * strrchr(const char *,int); 57extern char * strrchr(const char *,int);
58#endif 58#endif
59extern char * strstrip(char *);
59#ifndef __HAVE_ARCH_STRSTR 60#ifndef __HAVE_ARCH_STRSTR
60extern char * strstr(const char *,const char *); 61extern char * strstr(const char *,const char *);
61#endif 62#endif
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index be4772ed43c0..a6de332e57d4 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -11,7 +11,6 @@
11 11
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13 13
14#include <linux/config.h>
15#include <linux/sunrpc/sched.h> 14#include <linux/sunrpc/sched.h>
16#include <linux/sunrpc/msg_prot.h> 15#include <linux/sunrpc/msg_prot.h>
17#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index 1a42d902bc11..e4729aa67654 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -9,19 +9,6 @@
9#ifndef _LINUX_SUNRPC_DEBUG_H_ 9#ifndef _LINUX_SUNRPC_DEBUG_H_
10#define _LINUX_SUNRPC_DEBUG_H_ 10#define _LINUX_SUNRPC_DEBUG_H_
11 11
12#include <linux/config.h>
13
14#include <linux/timer.h>
15#include <linux/workqueue.h>
16
17/*
18 * Enable RPC debugging/profiling.
19 */
20#ifdef CONFIG_SYSCTL
21#define RPC_DEBUG
22#endif
23/* #define RPC_PROFILE */
24
25/* 12/*
26 * RPC debug facilities 13 * RPC debug facilities
27 */ 14 */
@@ -41,6 +28,17 @@
41 28
42#ifdef __KERNEL__ 29#ifdef __KERNEL__
43 30
31#include <linux/timer.h>
32#include <linux/workqueue.h>
33
34/*
35 * Enable RPC debugging/profiling.
36 */
37#ifdef CONFIG_SYSCTL
38#define RPC_DEBUG
39#endif
40/* #define RPC_PROFILE */
41
44/* 42/*
45 * Debugging macros etc 43 * Debugging macros etc
46 */ 44 */
diff --git a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h
index d93c24b47f3f..5fa0f2084307 100644
--- a/include/linux/sunrpc/stats.h
+++ b/include/linux/sunrpc/stats.h
@@ -9,7 +9,6 @@
9#ifndef _LINUX_SUNRPC_STATS_H 9#ifndef _LINUX_SUNRPC_STATS_H
10#define _LINUX_SUNRPC_STATS_H 10#define _LINUX_SUNRPC_STATS_H
11 11
12#include <linux/config.h>
13#include <linux/proc_fs.h> 12#include <linux/proc_fs.h>
14 13
15struct rpc_stat { 14struct rpc_stat {
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 37c1c76fd547..e82cb10fb3ea 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -6,7 +6,6 @@
6#endif 6#endif
7#include <linux/swap.h> 7#include <linux/swap.h>
8#include <linux/notifier.h> 8#include <linux/notifier.h>
9#include <linux/config.h>
10#include <linux/init.h> 9#include <linux/init.h>
11#include <linux/pm.h> 10#include <linux/pm.h>
12 11
@@ -72,6 +71,7 @@ struct saved_context;
72void __save_processor_state(struct saved_context *ctxt); 71void __save_processor_state(struct saved_context *ctxt);
73void __restore_processor_state(struct saved_context *ctxt); 72void __restore_processor_state(struct saved_context *ctxt);
74unsigned long get_safe_page(gfp_t gfp_mask); 73unsigned long get_safe_page(gfp_t gfp_mask);
74int swsusp_add_arch_pages(unsigned long start, unsigned long end);
75 75
76/* 76/*
77 * XXX: We try to keep some more pages free so that I/O operations succeed 77 * XXX: We try to keep some more pages free so that I/O operations succeed
diff --git a/include/linux/swap.h b/include/linux/swap.h
index f03c24719302..dc3f3aa0c83e 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_SWAP_H 1#ifndef _LINUX_SWAP_H
2#define _LINUX_SWAP_H 2#define _LINUX_SWAP_H
3 3
4#include <linux/config.h>
5#include <linux/spinlock.h> 4#include <linux/spinlock.h>
6#include <linux/linkage.h> 5#include <linux/linkage.h>
7#include <linux/mmzone.h> 6#include <linux/mmzone.h>
@@ -29,7 +28,14 @@ static inline int current_is_kswapd(void)
29 * the type/offset into the pte as 5/27 as well. 28 * the type/offset into the pte as 5/27 as well.
30 */ 29 */
31#define MAX_SWAPFILES_SHIFT 5 30#define MAX_SWAPFILES_SHIFT 5
31#ifndef CONFIG_MIGRATION
32#define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT) 32#define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT)
33#else
34/* Use last two entries for page migration swap entries */
35#define MAX_SWAPFILES ((1 << MAX_SWAPFILES_SHIFT)-2)
36#define SWP_MIGRATION_READ MAX_SWAPFILES
37#define SWP_MIGRATION_WRITE (MAX_SWAPFILES + 1)
38#endif
33 39
34/* 40/*
35 * Magic header for a swap area. The first part of the union is 41 * Magic header for a swap area. The first part of the union is
@@ -49,12 +55,14 @@ union swap_header {
49 char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */ 55 char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */
50 } magic; 56 } magic;
51 struct { 57 struct {
52 char bootbits[1024]; /* Space for disklabel etc. */ 58 char bootbits[1024]; /* Space for disklabel etc. */
53 unsigned int version; 59 __u32 version;
54 unsigned int last_page; 60 __u32 last_page;
55 unsigned int nr_badpages; 61 __u32 nr_badpages;
56 unsigned int padding[125]; 62 unsigned char sws_uuid[16];
57 unsigned int badpages[1]; 63 unsigned char sws_volume[16];
64 __u32 padding[117];
65 __u32 badpages[1];
58 } info; 66 } info;
59}; 67};
60 68
@@ -177,20 +185,7 @@ extern unsigned long try_to_free_pages(struct zone **, gfp_t);
177extern unsigned long shrink_all_memory(unsigned long nr_pages); 185extern unsigned long shrink_all_memory(unsigned long nr_pages);
178extern int vm_swappiness; 186extern int vm_swappiness;
179extern int remove_mapping(struct address_space *mapping, struct page *page); 187extern int remove_mapping(struct address_space *mapping, struct page *page);
180 188extern long vm_total_pages;
181/* possible outcome of pageout() */
182typedef enum {
183 /* failed to write page out, page is locked */
184 PAGE_KEEP,
185 /* move page to the active list, page is locked */
186 PAGE_ACTIVATE,
187 /* page has been sent to the disk successfully, page is unlocked */
188 PAGE_SUCCESS,
189 /* page is clean and locked */
190 PAGE_CLEAN,
191} pageout_t;
192
193extern pageout_t pageout(struct page *page, struct address_space *mapping);
194 189
195#ifdef CONFIG_NUMA 190#ifdef CONFIG_NUMA
196extern int zone_reclaim_mode; 191extern int zone_reclaim_mode;
@@ -251,7 +246,6 @@ extern int remove_exclusive_swap_page(struct page *);
251struct backing_dev_info; 246struct backing_dev_info;
252 247
253extern spinlock_t swap_lock; 248extern spinlock_t swap_lock;
254extern int remove_vma_swap(struct vm_area_struct *vma, struct page *page);
255 249
256/* linux/mm/thrash.c */ 250/* linux/mm/thrash.c */
257extern struct mm_struct * swap_token_mm; 251extern struct mm_struct * swap_token_mm;
@@ -289,18 +283,60 @@ static inline void disable_swap_token(void)
289#define free_pages_and_swap_cache(pages, nr) \ 283#define free_pages_and_swap_cache(pages, nr) \
290 release_pages((pages), (nr), 0); 284 release_pages((pages), (nr), 0);
291 285
292#define show_swap_cache_info() /*NOTHING*/ 286static inline void show_swap_cache_info(void)
293#define free_swap_and_cache(swp) /*NOTHING*/ 287{
294#define swap_duplicate(swp) /*NOTHING*/ 288}
295#define swap_free(swp) /*NOTHING*/ 289
296#define read_swap_cache_async(swp,vma,addr) NULL 290static inline void free_swap_and_cache(swp_entry_t swp)
297#define lookup_swap_cache(swp) NULL 291{
298#define valid_swaphandles(swp, off) 0 292}
293
294static inline int swap_duplicate(swp_entry_t swp)
295{
296 return 0;
297}
298
299static inline void swap_free(swp_entry_t swp)
300{
301}
302
303static inline struct page *read_swap_cache_async(swp_entry_t swp,
304 struct vm_area_struct *vma, unsigned long addr)
305{
306 return NULL;
307}
308
309static inline struct page *lookup_swap_cache(swp_entry_t swp)
310{
311 return NULL;
312}
313
314static inline int valid_swaphandles(swp_entry_t entry, unsigned long *offset)
315{
316 return 0;
317}
318
299#define can_share_swap_page(p) (page_mapcount(p) == 1) 319#define can_share_swap_page(p) (page_mapcount(p) == 1)
300#define move_to_swap_cache(p, swp) 1 320
301#define move_from_swap_cache(p, i, m) 1 321static inline int move_to_swap_cache(struct page *page, swp_entry_t entry)
302#define __delete_from_swap_cache(p) /*NOTHING*/ 322{
303#define delete_from_swap_cache(p) /*NOTHING*/ 323 return 1;
324}
325
326static inline int move_from_swap_cache(struct page *page, unsigned long index,
327 struct address_space *mapping)
328{
329 return 1;
330}
331
332static inline void __delete_from_swap_cache(struct page *page)
333{
334}
335
336static inline void delete_from_swap_cache(struct page *page)
337{
338}
339
304#define swap_token_default_timeout 0 340#define swap_token_default_timeout 0
305 341
306static inline int remove_exclusive_swap_page(struct page *p) 342static inline int remove_exclusive_swap_page(struct page *p)
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index 87b9d14c710d..ec639aa3a1d3 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -67,3 +67,56 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry)
67 BUG_ON(pte_file(__swp_entry_to_pte(arch_entry))); 67 BUG_ON(pte_file(__swp_entry_to_pte(arch_entry)));
68 return __swp_entry_to_pte(arch_entry); 68 return __swp_entry_to_pte(arch_entry);
69} 69}
70
71#ifdef CONFIG_MIGRATION
72static inline swp_entry_t make_migration_entry(struct page *page, int write)
73{
74 BUG_ON(!PageLocked(page));
75 return swp_entry(write ? SWP_MIGRATION_WRITE : SWP_MIGRATION_READ,
76 page_to_pfn(page));
77}
78
79static inline int is_migration_entry(swp_entry_t entry)
80{
81 return unlikely(swp_type(entry) == SWP_MIGRATION_READ ||
82 swp_type(entry) == SWP_MIGRATION_WRITE);
83}
84
85static inline int is_write_migration_entry(swp_entry_t entry)
86{
87 return unlikely(swp_type(entry) == SWP_MIGRATION_WRITE);
88}
89
90static inline struct page *migration_entry_to_page(swp_entry_t entry)
91{
92 struct page *p = pfn_to_page(swp_offset(entry));
93 /*
94 * Any use of migration entries may only occur while the
95 * corresponding page is locked
96 */
97 BUG_ON(!PageLocked(p));
98 return p;
99}
100
101static inline void make_migration_entry_read(swp_entry_t *entry)
102{
103 *entry = swp_entry(SWP_MIGRATION_READ, swp_offset(*entry));
104}
105
106extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd,
107 unsigned long address);
108#else
109
110#define make_migration_entry(page, write) swp_entry(0, 0)
111#define is_migration_entry(swp) 0
112#define migration_entry_to_page(swp) NULL
113static inline void make_migration_entry_read(swp_entry_t *entryp) { }
114static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd,
115 unsigned long address) { }
116static inline int is_write_migration_entry(swp_entry_t entry)
117{
118 return 0;
119}
120
121#endif
122
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 60d49e5456e7..33785b79d548 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -54,7 +54,6 @@ struct compat_stat;
54struct compat_timeval; 54struct compat_timeval;
55struct robust_list_head; 55struct robust_list_head;
56 56
57#include <linux/config.h>
58#include <linux/types.h> 57#include <linux/types.h>
59#include <linux/aio_abi.h> 58#include <linux/aio_abi.h>
60#include <linux/capability.h> 59#include <linux/capability.h>
@@ -517,6 +516,16 @@ asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask,
517asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode, 516asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode,
518 const unsigned long __user *from, 517 const unsigned long __user *from,
519 const unsigned long __user *to); 518 const unsigned long __user *to);
519asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages,
520 const void __user * __user *pages,
521 const int __user *nodes,
522 int __user *status,
523 int flags);
524asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page,
525 __u32 __user *pages,
526 const int __user *nodes,
527 int __user *status,
528 int flags);
520asmlinkage long sys_mbind(unsigned long start, unsigned long len, 529asmlinkage long sys_mbind(unsigned long start, unsigned long len,
521 unsigned long mode, 530 unsigned long mode,
522 unsigned long __user *nmask, 531 unsigned long __user *nmask,
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index cee944dbdcd4..c7132029af0f 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -186,6 +186,7 @@ enum
186 VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ 186 VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */
187 VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ 187 VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
188 VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */ 188 VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */
189 VM_PANIC_ON_OOM=33, /* panic at out-of-memory */
189}; 190};
190 191
191 192
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index 2a4b432e1176..166a2e58c287 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -37,11 +37,27 @@ struct sysdev_class {
37 struct kset kset; 37 struct kset kset;
38}; 38};
39 39
40struct sysdev_class_attribute {
41 struct attribute attr;
42 ssize_t (*show)(struct sysdev_class *, char *);
43 ssize_t (*store)(struct sysdev_class *, const char *, size_t);
44};
45
46#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
47struct sysdev_class_attribute attr_##_name = { \
48 .attr = {.name = __stringify(_name), .mode = _mode }, \
49 .show = _show, \
50 .store = _store, \
51};
52
40 53
41extern int sysdev_class_register(struct sysdev_class *); 54extern int sysdev_class_register(struct sysdev_class *);
42extern void sysdev_class_unregister(struct sysdev_class *); 55extern void sysdev_class_unregister(struct sysdev_class *);
43 56
44 57extern int sysdev_class_create_file(struct sysdev_class *,
58 struct sysdev_class_attribute *);
59extern void sysdev_class_remove_file(struct sysdev_class *,
60 struct sysdev_class_attribute *);
45/** 61/**
46 * Auxillary system device drivers. 62 * Auxillary system device drivers.
47 */ 63 */
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h
index ea819b89c235..4812ff60561c 100644
--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -11,7 +11,6 @@
11 * based upon discusions in irc://irc.openprojects.net/#kernelnewbies 11 * based upon discusions in irc://irc.openprojects.net/#kernelnewbies
12 */ 12 */
13 13
14#include <linux/config.h>
15 14
16struct pt_regs; 15struct pt_regs;
17struct tty_struct; 16struct tty_struct;
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index c90daa5da6c3..8ebf497907f8 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -18,7 +18,6 @@
18#define _LINUX_TCP_H 18#define _LINUX_TCP_H
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/dmaengine.h>
22#include <asm/byteorder.h> 21#include <asm/byteorder.h>
23 22
24struct tcphdr { 23struct tcphdr {
@@ -160,8 +159,8 @@ struct tcp_info
160 159
161#ifdef __KERNEL__ 160#ifdef __KERNEL__
162 161
163#include <linux/config.h>
164#include <linux/skbuff.h> 162#include <linux/skbuff.h>
163#include <linux/dmaengine.h>
165#include <net/sock.h> 164#include <net/sock.h>
166#include <net/inet_connection_sock.h> 165#include <net/inet_connection_sock.h>
167#include <net/inet_timewait_sock.h> 166#include <net/inet_timewait_sock.h>
diff --git a/include/linux/threads.h b/include/linux/threads.h
index e646bcdf2614..38d1a5d6568e 100644
--- a/include/linux/threads.h
+++ b/include/linux/threads.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_THREADS_H 1#ifndef _LINUX_THREADS_H
2#define _LINUX_THREADS_H 2#define _LINUX_THREADS_H
3 3
4#include <linux/config.h>
5 4
6/* 5/*
7 * The default limit for the nr of threads is now in 6 * The default limit for the nr of threads is now in
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 0a485beba9f5..c982304dbafd 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_TIMER_H 1#ifndef _LINUX_TIMER_H
2#define _LINUX_TIMER_H 2#define _LINUX_TIMER_H
3 3
4#include <linux/config.h>
5#include <linux/list.h> 4#include <linux/list.h>
6#include <linux/spinlock.h> 5#include <linux/spinlock.h>
7#include <linux/stddef.h> 6#include <linux/stddef.h>
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 03914b7e41b1..34d3ccff7bbb 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -53,7 +53,6 @@
53#ifndef _LINUX_TIMEX_H 53#ifndef _LINUX_TIMEX_H
54#define _LINUX_TIMEX_H 54#define _LINUX_TIMEX_H
55 55
56#include <linux/config.h>
57#include <linux/compiler.h> 56#include <linux/compiler.h>
58#include <linux/time.h> 57#include <linux/time.h>
59 58
diff --git a/include/linux/tty.h b/include/linux/tty.h
index f13f49afe198..cb35ca50a0a6 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -16,7 +16,6 @@
16 consoles 16 and higher (since it returns a short) */ 16 consoles 16 and higher (since it returns a short) */
17 17
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19#include <linux/config.h>
20#include <linux/fs.h> 19#include <linux/fs.h>
21#include <linux/major.h> 20#include <linux/major.h>
22#include <linux/termios.h> 21#include <linux/termios.h>
@@ -291,7 +290,9 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc);
291extern int tty_unregister_ldisc(int disc); 290extern int tty_unregister_ldisc(int disc);
292extern int tty_register_driver(struct tty_driver *driver); 291extern int tty_register_driver(struct tty_driver *driver);
293extern int tty_unregister_driver(struct tty_driver *driver); 292extern int tty_unregister_driver(struct tty_driver *driver);
294extern void tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev); 293extern struct class_device *tty_register_device(struct tty_driver *driver,
294 unsigned index,
295 struct device *dev);
295extern void tty_unregister_device(struct tty_driver *driver, unsigned index); 296extern void tty_unregister_device(struct tty_driver *driver, unsigned index);
296extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, 297extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
297 int buflen); 298 int buflen);
diff --git a/include/linux/types.h b/include/linux/types.h
index 1046c7ad86d9..a5e46e783ffa 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -2,7 +2,6 @@
2#define _LINUX_TYPES_H 2#define _LINUX_TYPES_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5#include <linux/config.h>
6 5
7#define BITS_TO_LONGS(bits) \ 6#define BITS_TO_LONGS(bits) \
8 (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) 7 (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
new file mode 100644
index 000000000000..391e7ed1eb3f
--- /dev/null
+++ b/include/linux/uaccess.h
@@ -0,0 +1,22 @@
1#ifndef __LINUX_UACCESS_H__
2#define __LINUX_UACCESS_H__
3
4#include <asm/uaccess.h>
5
6#ifndef ARCH_HAS_NOCACHE_UACCESS
7
8static inline unsigned long __copy_from_user_inatomic_nocache(void *to,
9 const void __user *from, unsigned long n)
10{
11 return __copy_from_user_inatomic(to, from, n);
12}
13
14static inline unsigned long __copy_from_user_nocache(void *to,
15 const void __user *from, unsigned long n)
16{
17 return __copy_from_user(to, from, n);
18}
19
20#endif /* ARCH_HAS_NOCACHE_UACCESS */
21
22#endif /* __LINUX_UACCESS_H__ */
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 85a55658831c..bdd39be09406 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -35,7 +35,6 @@ struct udphdr {
35#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ 35#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
36 36
37#ifdef __KERNEL__ 37#ifdef __KERNEL__
38#include <linux/config.h>
39#include <linux/types.h> 38#include <linux/types.h>
40 39
41#include <net/inet_sock.h> 40#include <net/inet_sock.h>
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 843aeaaa79d4..86b5b4271b5a 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -32,7 +32,6 @@
32 32
33#include <linux/types.h> 33#include <linux/types.h>
34#include <linux/kernel.h> 34#include <linux/kernel.h>
35#include <linux/time.h>
36#include <linux/stat.h> 35#include <linux/stat.h>
37#include <linux/fs.h> 36#include <linux/fs.h>
38 37
diff --git a/include/linux/unistd.h b/include/linux/unistd.h
index 10ed9834b822..c18c60f3254e 100644
--- a/include/linux/unistd.h
+++ b/include/linux/unistd.h
@@ -1,7 +1,9 @@
1#ifndef _LINUX_UNISTD_H_ 1#ifndef _LINUX_UNISTD_H_
2#define _LINUX_UNISTD_H_ 2#define _LINUX_UNISTD_H_
3 3
4#ifdef __KERNEL__
4extern int errno; 5extern int errno;
6#endif
5 7
6/* 8/*
7 * Include machine specific syscallX macros 9 * Include machine specific syscallX macros
diff --git a/include/linux/usb.h b/include/linux/usb.h
index e34e5e3dce52..8dead32e7ebf 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -10,7 +10,6 @@
10 10
11#ifdef __KERNEL__ 11#ifdef __KERNEL__
12 12
13#include <linux/config.h>
14#include <linux/errno.h> /* for -ENODEV */ 13#include <linux/errno.h> /* for -ENODEV */
15#include <linux/delay.h> /* for mdelay() */ 14#include <linux/delay.h> /* for mdelay() */
16#include <linux/interrupt.h> /* for in_interrupt() */ 15#include <linux/interrupt.h> /* for in_interrupt() */
@@ -41,6 +40,8 @@ struct usb_driver;
41 * Devices may also have class-specific or vendor-specific descriptors. 40 * Devices may also have class-specific or vendor-specific descriptors.
42 */ 41 */
43 42
43struct ep_device;
44
44/** 45/**
45 * struct usb_host_endpoint - host-side endpoint descriptor and queue 46 * struct usb_host_endpoint - host-side endpoint descriptor and queue
46 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder 47 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder
@@ -58,7 +59,7 @@ struct usb_host_endpoint {
58 struct usb_endpoint_descriptor desc; 59 struct usb_endpoint_descriptor desc;
59 struct list_head urb_list; 60 struct list_head urb_list;
60 void *hcpriv; 61 void *hcpriv;
61 struct kobject *kobj; /* For sysfs info */ 62 struct ep_device *ep_dev; /* For sysfs info */
62 63
63 unsigned char *extra; /* Extra descriptors */ 64 unsigned char *extra; /* Extra descriptors */
64 int extralen; 65 int extralen;
@@ -102,7 +103,8 @@ enum usb_interface_condition {
102 * @condition: binding state of the interface: not bound, binding 103 * @condition: binding state of the interface: not bound, binding
103 * (in probe()), bound to a driver, or unbinding (in disconnect()) 104 * (in probe()), bound to a driver, or unbinding (in disconnect())
104 * @dev: driver model's view of this device 105 * @dev: driver model's view of this device
105 * @class_dev: driver model's class view of this device. 106 * @usb_dev: if an interface is bound to the USB major, this will point
107 * to the sysfs representation for that device.
106 * 108 *
107 * USB device drivers attach to interfaces on a physical device. Each 109 * USB device drivers attach to interfaces on a physical device. Each
108 * interface encapsulates a single high level function, such as feeding 110 * interface encapsulates a single high level function, such as feeding
@@ -142,7 +144,7 @@ struct usb_interface {
142 * bound to */ 144 * bound to */
143 enum usb_interface_condition condition; /* state of binding */ 145 enum usb_interface_condition condition; /* state of binding */
144 struct device dev; /* interface specific device info */ 146 struct device dev; /* interface specific device info */
145 struct class_device *class_dev; 147 struct device *usb_dev; /* pointer to the usb class's device, if any */
146}; 148};
147#define to_usb_interface(d) container_of(d, struct usb_interface, dev) 149#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
148#define interface_to_usbdev(intf) \ 150#define interface_to_usbdev(intf) \
@@ -359,7 +361,7 @@ struct usb_device {
359 char *serial; /* iSerialNumber string, if present */ 361 char *serial; /* iSerialNumber string, if present */
360 362
361 struct list_head filelist; 363 struct list_head filelist;
362 struct class_device *class_dev; 364 struct device *usbfs_dev;
363 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 365 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
364 366
365 /* 367 /*
@@ -387,6 +389,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,
387 389
388/* USB port reset for device reinitialization */ 390/* USB port reset for device reinitialization */
389extern int usb_reset_device(struct usb_device *dev); 391extern int usb_reset_device(struct usb_device *dev);
392extern int usb_reset_composite_device(struct usb_device *dev,
393 struct usb_interface *iface);
390 394
391extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); 395extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
392 396
@@ -555,6 +559,10 @@ struct usb_dynids {
555 * do (or don't) show up otherwise in the filesystem. 559 * do (or don't) show up otherwise in the filesystem.
556 * @suspend: Called when the device is going to be suspended by the system. 560 * @suspend: Called when the device is going to be suspended by the system.
557 * @resume: Called when the device is being resumed by the system. 561 * @resume: Called when the device is being resumed by the system.
562 * @pre_reset: Called by usb_reset_composite_device() when the device
563 * is about to be reset.
564 * @post_reset: Called by usb_reset_composite_device() after the device
565 * has been reset.
558 * @id_table: USB drivers use ID table to support hotplugging. 566 * @id_table: USB drivers use ID table to support hotplugging.
559 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set 567 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
560 * or your driver's probe function will never get called. 568 * or your driver's probe function will never get called.
@@ -593,6 +601,9 @@ struct usb_driver {
593 int (*suspend) (struct usb_interface *intf, pm_message_t message); 601 int (*suspend) (struct usb_interface *intf, pm_message_t message);
594 int (*resume) (struct usb_interface *intf); 602 int (*resume) (struct usb_interface *intf);
595 603
604 void (*pre_reset) (struct usb_interface *intf);
605 void (*post_reset) (struct usb_interface *intf);
606
596 const struct usb_device_id *id_table; 607 const struct usb_device_id *id_table;
597 608
598 struct usb_dynids dynids; 609 struct usb_dynids dynids;
@@ -1009,6 +1020,8 @@ void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe,
1009extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, 1020extern int usb_control_msg(struct usb_device *dev, unsigned int pipe,
1010 __u8 request, __u8 requesttype, __u16 value, __u16 index, 1021 __u8 request, __u8 requesttype, __u16 value, __u16 index,
1011 void *data, __u16 size, int timeout); 1022 void *data, __u16 size, int timeout);
1023extern int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe,
1024 void *data, int len, int *actual_length, int timeout);
1012extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, 1025extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
1013 void *data, int len, int *actual_length, 1026 void *data, int len, int *actual_length,
1014 int timeout); 1027 int timeout);
diff --git a/include/linux/usb_cdc.h b/include/linux/usb/cdc.h
index ba617c372455..ba617c372455 100644
--- a/include/linux/usb_cdc.h
+++ b/include/linux/usb/cdc.h
diff --git a/include/linux/usb_input.h b/include/linux/usb/input.h
index 716e0cc16043..716e0cc16043 100644
--- a/include/linux/usb_input.h
+++ b/include/linux/usb/input.h
diff --git a/include/linux/usb_isp116x.h b/include/linux/usb/isp116x.h
index 436dd8a2b64a..436dd8a2b64a 100644
--- a/include/linux/usb_isp116x.h
+++ b/include/linux/usb/isp116x.h
diff --git a/include/linux/usb_sl811.h b/include/linux/usb/sl811.h
index 4f2d012d7309..397ee3b3d7f3 100644
--- a/include/linux/usb_sl811.h
+++ b/include/linux/usb/sl811.h
@@ -14,13 +14,13 @@ struct sl811_platform_data {
14 u8 power; 14 u8 power;
15 15
16 /* sl811 relies on an external source of VBUS current */ 16 /* sl811 relies on an external source of VBUS current */
17 void (*port_power)(struct device *dev, int is_on); 17 void (*port_power)(struct device *dev, int is_on);
18 18
19 /* pulse sl811 nRST (probably with a GPIO) */ 19 /* pulse sl811 nRST (probably with a GPIO) */
20 void (*reset)(struct device *dev); 20 void (*reset)(struct device *dev);
21 21
22 // some boards need something like these: 22 // some boards need something like these:
23 // int (*check_overcurrent)(struct device *dev); 23 // int (*check_overcurrent)(struct device *dev);
24 // void (*clock_enable)(struct device *dev, int is_on); 24 // void (*clock_enable)(struct device *dev, int is_on);
25}; 25};
26 26
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index b2d08984a9f7..608487a62c98 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -9,7 +9,6 @@
9#ifndef __LINUX_USB_USUAL_H 9#ifndef __LINUX_USB_USUAL_H
10#define __LINUX_USB_USUAL_H 10#define __LINUX_USB_USUAL_H
11 11
12#include <linux/config.h>
13 12
14/* We should do this for cleanliness... But other usb_foo.h do not do this. */ 13/* We should do this for cleanliness... But other usb_foo.h do not do this. */
15/* #include <linux/usb.h> */ 14/* #include <linux/usb.h> */
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 8859f0b41543..7b7aadb69092 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -123,6 +123,7 @@ struct usbdevfs_hub_portinfo {
123 char port [127]; /* e.g. port 3 connects to device 27 */ 123 char port [127]; /* e.g. port 3 connects to device 27 */
124}; 124};
125 125
126#ifdef __KERNEL__
126#ifdef CONFIG_COMPAT 127#ifdef CONFIG_COMPAT
127#include <linux/compat.h> 128#include <linux/compat.h>
128struct usbdevfs_urb32 { 129struct usbdevfs_urb32 {
@@ -147,6 +148,7 @@ struct usbdevfs_ioctl32 {
147 compat_caddr_t data; 148 compat_caddr_t data;
148}; 149};
149#endif 150#endif
151#endif /* __KERNEL__ */
150 152
151#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) 153#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
152#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) 154#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer)
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 1d5577b2b752..f6024ab4eff0 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -4,10 +4,13 @@
4#include <linux/spinlock.h> 4#include <linux/spinlock.h>
5#include <asm/page.h> /* pgprot_t */ 5#include <asm/page.h> /* pgprot_t */
6 6
7struct vm_area_struct;
8
7/* bits in vm_struct->flags */ 9/* bits in vm_struct->flags */
8#define VM_IOREMAP 0x00000001 /* ioremap() and friends */ 10#define VM_IOREMAP 0x00000001 /* ioremap() and friends */
9#define VM_ALLOC 0x00000002 /* vmalloc() */ 11#define VM_ALLOC 0x00000002 /* vmalloc() */
10#define VM_MAP 0x00000004 /* vmap()ed pages */ 12#define VM_MAP 0x00000004 /* vmap()ed pages */
13#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */
11/* bits [20..32] reserved for arch specific ioremap internals */ 14/* bits [20..32] reserved for arch specific ioremap internals */
12 15
13/* 16/*
@@ -32,9 +35,11 @@ struct vm_struct {
32 * Highlevel APIs for driver use 35 * Highlevel APIs for driver use
33 */ 36 */
34extern void *vmalloc(unsigned long size); 37extern void *vmalloc(unsigned long size);
38extern void *vmalloc_user(unsigned long size);
35extern void *vmalloc_node(unsigned long size, int node); 39extern void *vmalloc_node(unsigned long size, int node);
36extern void *vmalloc_exec(unsigned long size); 40extern void *vmalloc_exec(unsigned long size);
37extern void *vmalloc_32(unsigned long size); 41extern void *vmalloc_32(unsigned long size);
42extern void *vmalloc_32_user(unsigned long size);
38extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); 43extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
39extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, 44extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask,
40 pgprot_t prot); 45 pgprot_t prot);
@@ -45,6 +50,9 @@ extern void vfree(void *addr);
45extern void *vmap(struct page **pages, unsigned int count, 50extern void *vmap(struct page **pages, unsigned int count,
46 unsigned long flags, pgprot_t prot); 51 unsigned long flags, pgprot_t prot);
47extern void vunmap(void *addr); 52extern void vunmap(void *addr);
53
54extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
55 unsigned long pgoff);
48 56
49/* 57/*
50 * Lowlevel-APIs (not for driver use!) 58 * Lowlevel-APIs (not for driver use!)
diff --git a/include/linux/vt_buffer.h b/include/linux/vt_buffer.h
index 1f7ba3629053..057db7d2f448 100644
--- a/include/linux/vt_buffer.h
+++ b/include/linux/vt_buffer.h
@@ -13,7 +13,6 @@
13#ifndef _LINUX_VT_BUFFER_H_ 13#ifndef _LINUX_VT_BUFFER_H_
14#define _LINUX_VT_BUFFER_H_ 14#define _LINUX_VT_BUFFER_H_
15 15
16#include <linux/config.h>
17 16
18#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE) 17#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE)
19#include <asm/vga.h> 18#include <asm/vga.h>
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index fab5aed8ca31..940d0261a545 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -6,7 +6,6 @@
6 * with information needed by the vt package 6 * with information needed by the vt package
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/vt.h> 9#include <linux/vt.h>
11#include <linux/kd.h> 10#include <linux/kd.h>
12#include <linux/tty.h> 11#include <linux/tty.h>
diff --git a/include/linux/wait.h b/include/linux/wait.h
index d28518236b62..544e855c7c02 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -19,7 +19,6 @@
19 19
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#include <linux/config.h>
23#include <linux/list.h> 22#include <linux/list.h>
24#include <linux/stddef.h> 23#include <linux/stddef.h>
25#include <linux/spinlock.h> 24#include <linux/spinlock.h>
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index 1b6b76a4eb54..2cd05013edfc 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -44,8 +44,6 @@
44* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h). 44* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h).
45*****************************************************************************/ 45*****************************************************************************/
46 46
47#include <linux/spinlock.h> /* Support for SMP Locking */
48
49#ifndef _ROUTER_H 47#ifndef _ROUTER_H
50#define _ROUTER_H 48#define _ROUTER_H
51 49
@@ -457,6 +455,8 @@ typedef struct wanif_conf
457#include <linux/fs.h> /* support for device drivers */ 455#include <linux/fs.h> /* support for device drivers */
458#include <linux/proc_fs.h> /* proc filesystem pragmatics */ 456#include <linux/proc_fs.h> /* proc filesystem pragmatics */
459#include <linux/netdevice.h> /* support for network drivers */ 457#include <linux/netdevice.h> /* support for network drivers */
458#include <linux/spinlock.h> /* Support for SMP Locking */
459
460/*---------------------------------------------------------------------------- 460/*----------------------------------------------------------------------------
461 * WAN device data space. 461 * WAN device data space.
462 */ 462 */
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 56f92fcbe94a..9e38b566d0e7 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -50,14 +50,15 @@ struct writeback_control {
50 * a hint that the filesystem need only write out the pages inside that 50 * a hint that the filesystem need only write out the pages inside that
51 * byterange. The byte at `end' is included in the writeout request. 51 * byterange. The byte at `end' is included in the writeout request.
52 */ 52 */
53 loff_t start; 53 loff_t range_start;
54 loff_t end; 54 loff_t range_end;
55 55
56 unsigned nonblocking:1; /* Don't get stuck on request queues */ 56 unsigned nonblocking:1; /* Don't get stuck on request queues */
57 unsigned encountered_congestion:1; /* An output: a queue is full */ 57 unsigned encountered_congestion:1; /* An output: a queue is full */
58 unsigned for_kupdate:1; /* A kupdate writeback */ 58 unsigned for_kupdate:1; /* A kupdate writeback */
59 unsigned for_reclaim:1; /* Invoked from the page allocator */ 59 unsigned for_reclaim:1; /* Invoked from the page allocator */
60 unsigned for_writepages:1; /* This is a writepages() call */ 60 unsigned for_writepages:1; /* This is a writepages() call */
61 unsigned range_cyclic:1; /* range_start is cyclic */
61}; 62};
62 63
63/* 64/*
diff --git a/include/linux/zconf.h b/include/linux/zconf.h
index f1cfd66b9554..0beb75e38caa 100644
--- a/include/linux/zconf.h
+++ b/include/linux/zconf.h
@@ -35,6 +35,18 @@
35# define MAX_WBITS 15 /* 32K LZ77 window */ 35# define MAX_WBITS 15 /* 32K LZ77 window */
36#endif 36#endif
37 37
38/* default windowBits for decompression. MAX_WBITS is for compression only */
39#ifndef DEF_WBITS
40# define DEF_WBITS MAX_WBITS
41#endif
42
43/* default memLevel */
44#if MAX_MEM_LEVEL >= 8
45# define DEF_MEM_LEVEL 8
46#else
47# define DEF_MEM_LEVEL MAX_MEM_LEVEL
48#endif
49
38 /* Type declarations */ 50 /* Type declarations */
39 51
40typedef unsigned char Byte; /* 8 bits */ 52typedef unsigned char Byte; /* 8 bits */
diff --git a/include/linux/zlib.h b/include/linux/zlib.h
index 4fa32f0d4df8..9e3192a7dc6f 100644
--- a/include/linux/zlib.h
+++ b/include/linux/zlib.h
@@ -1,7 +1,6 @@
1/* zlib.h -- interface of the 'zlib' general purpose compression library 1/* zlib.h -- interface of the 'zlib' general purpose compression library
2 version 1.1.3, July 9th, 1998
3 2
4 Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler 3 Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
5 4
6 This software is provided 'as-is', without any express or implied 5 This software is provided 'as-is', without any express or implied
7 warranty. In no event will the authors be held liable for any damages 6 warranty. In no event will the authors be held liable for any damages
@@ -24,7 +23,7 @@
24 23
25 24
26 The data format used by the zlib library is described by RFCs (Request for 25 The data format used by the zlib library is described by RFCs (Request for
27 Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt 26 Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
28 (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). 27 (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
29*/ 28*/
30 29
@@ -33,7 +32,22 @@
33 32
34#include <linux/zconf.h> 33#include <linux/zconf.h>
35 34
36#define ZLIB_VERSION "1.1.3" 35/* zlib deflate based on ZLIB_VERSION "1.1.3" */
36/* zlib inflate based on ZLIB_VERSION "1.2.3" */
37
38/*
39 This is a modified version of zlib for use inside the Linux kernel.
40 The main changes are to perform all memory allocation in advance.
41
42 Inflation Changes:
43 * Z_PACKET_FLUSH is added and used by ppp_deflate. Before returning
44 this checks there is no more input data available and the next data
45 is a STORED block. It also resets the mode to be read for the next
46 data, all as per PPP requirements.
47 * Addition of zlib_inflateIncomp which copies incompressible data into
48 the history window and adjusts the accoutning without calling
49 zlib_inflate itself to inflate the data.
50*/
37 51
38/* 52/*
39 The 'zlib' compression library provides in-memory compression and 53 The 'zlib' compression library provides in-memory compression and
@@ -48,9 +62,18 @@
48 application must provide more input and/or consume the output 62 application must provide more input and/or consume the output
49 (providing more output space) before each call. 63 (providing more output space) before each call.
50 64
65 The compressed data format used by default by the in-memory functions is
66 the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
67 around a deflate stream, which is itself documented in RFC 1951.
68
51 The library also supports reading and writing files in gzip (.gz) format 69 The library also supports reading and writing files in gzip (.gz) format
52 with an interface similar to that of stdio. 70 with an interface similar to that of stdio.
53 71
72 The zlib format was designed to be compact and fast for use in memory
73 and on communications channels. The gzip format was designed for single-
74 file compression on file systems, has a larger header than zlib to maintain
75 directory information, and uses a different, slower check method than zlib.
76
54 The library does not install any signal handler. The decoder checks 77 The library does not install any signal handler. The decoder checks
55 the consistency of the compressed data, so the library should never 78 the consistency of the compressed data, so the library should never
56 crash even in case of corrupted input. 79 crash even in case of corrupted input.
@@ -119,7 +142,8 @@ typedef z_stream *z_streamp;
119#define Z_SYNC_FLUSH 3 142#define Z_SYNC_FLUSH 3
120#define Z_FULL_FLUSH 4 143#define Z_FULL_FLUSH 4
121#define Z_FINISH 5 144#define Z_FINISH 5
122/* Allowed flush values; see deflate() below for details */ 145#define Z_BLOCK 6 /* Only for inflate at present */
146/* Allowed flush values; see deflate() and inflate() below for details */
123 147
124#define Z_OK 0 148#define Z_OK 0
125#define Z_STREAM_END 1 149#define Z_STREAM_END 1
@@ -155,13 +179,6 @@ typedef z_stream *z_streamp;
155 179
156 /* basic functions */ 180 /* basic functions */
157 181
158extern const char * zlib_zlibVersion (void);
159/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
160 If the first character differs, the library code actually used is
161 not compatible with the zlib.h header file used by the application.
162 This check is automatically made by deflateInit and inflateInit.
163 */
164
165extern int zlib_deflate_workspacesize (void); 182extern int zlib_deflate_workspacesize (void);
166/* 183/*
167 Returns the number of bytes that needs to be allocated for a per- 184 Returns the number of bytes that needs to be allocated for a per-
@@ -315,9 +332,9 @@ extern int zlib_inflateInit (z_streamp strm);
315extern int zlib_inflate (z_streamp strm, int flush); 332extern int zlib_inflate (z_streamp strm, int flush);
316/* 333/*
317 inflate decompresses as much data as possible, and stops when the input 334 inflate decompresses as much data as possible, and stops when the input
318 buffer becomes empty or the output buffer becomes full. It may some 335 buffer becomes empty or the output buffer becomes full. It may introduce
319 introduce some output latency (reading input without producing any output) 336 some output latency (reading input without producing any output) except when
320 except when forced to flush. 337 forced to flush.
321 338
322 The detailed semantics are as follows. inflate performs one or both of the 339 The detailed semantics are as follows. inflate performs one or both of the
323 following actions: 340 following actions:
@@ -341,11 +358,26 @@ extern int zlib_inflate (z_streamp strm, int flush);
341 must be called again after making room in the output buffer because there 358 must be called again after making room in the output buffer because there
342 might be more output pending. 359 might be more output pending.
343 360
344 If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much 361 The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
345 output as possible to the output buffer. The flushing behavior of inflate is 362 Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
346 not specified for values of the flush parameter other than Z_SYNC_FLUSH 363 output as possible to the output buffer. Z_BLOCK requests that inflate() stop
347 and Z_FINISH, but the current implementation actually flushes as much output 364 if and when it gets to the next deflate block boundary. When decoding the
348 as possible anyway. 365 zlib or gzip format, this will cause inflate() to return immediately after
366 the header and before the first block. When doing a raw inflate, inflate()
367 will go ahead and process the first block, and will return when it gets to
368 the end of that block, or when it runs out of data.
369
370 The Z_BLOCK option assists in appending to or combining deflate streams.
371 Also to assist in this, on return inflate() will set strm->data_type to the
372 number of unused bits in the last byte taken from strm->next_in, plus 64
373 if inflate() is currently decoding the last block in the deflate stream,
374 plus 128 if inflate() returned immediately after decoding an end-of-block
375 code or decoding the complete header up to just before the first byte of the
376 deflate stream. The end-of-block will not be indicated until all of the
377 uncompressed data from that block has been written to strm->next_out. The
378 number of unused bits may in general be greater than seven, except when
379 bit 7 of data_type is set, in which case the number of unused bits will be
380 less than eight.
349 381
350 inflate() should normally be called until it returns Z_STREAM_END or an 382 inflate() should normally be called until it returns Z_STREAM_END or an
351 error. However if all decompression is to be performed in a single step 383 error. However if all decompression is to be performed in a single step
@@ -355,29 +387,44 @@ extern int zlib_inflate (z_streamp strm, int flush);
355 uncompressed data. (The size of the uncompressed data may have been saved 387 uncompressed data. (The size of the uncompressed data may have been saved
356 by the compressor for this purpose.) The next operation on this stream must 388 by the compressor for this purpose.) The next operation on this stream must
357 be inflateEnd to deallocate the decompression state. The use of Z_FINISH 389 be inflateEnd to deallocate the decompression state. The use of Z_FINISH
358 is never required, but can be used to inform inflate that a faster routine 390 is never required, but can be used to inform inflate that a faster approach
359 may be used for the single inflate() call. 391 may be used for the single inflate() call.
360 392
361 If a preset dictionary is needed at this point (see inflateSetDictionary 393 In this implementation, inflate() always flushes as much output as
362 below), inflate sets strm-adler to the adler32 checksum of the 394 possible to the output buffer, and always uses the faster approach on the
363 dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise 395 first call. So the only effect of the flush parameter in this implementation
364 it sets strm->adler to the adler32 checksum of all output produced 396 is on the return value of inflate(), as noted below, or when it returns early
365 so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or 397 because Z_BLOCK is used.
366 an error code as described below. At the end of the stream, inflate() 398
367 checks that its computed adler32 checksum is equal to that saved by the 399 If a preset dictionary is needed after this call (see inflateSetDictionary
368 compressor and returns Z_STREAM_END only if the checksum is correct. 400 below), inflate sets strm->adler to the adler32 checksum of the dictionary
401 chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
402 strm->adler to the adler32 checksum of all output produced so far (that is,
403 total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
404 below. At the end of the stream, inflate() checks that its computed adler32
405 checksum is equal to that saved by the compressor and returns Z_STREAM_END
406 only if the checksum is correct.
407
408 inflate() will decompress and check either zlib-wrapped or gzip-wrapped
409 deflate data. The header type is detected automatically. Any information
410 contained in the gzip header is not retained, so applications that need that
411 information should instead use raw inflate, see inflateInit2() below, or
412 inflateBack() and perform their own processing of the gzip header and
413 trailer.
369 414
370 inflate() returns Z_OK if some progress has been made (more input processed 415 inflate() returns Z_OK if some progress has been made (more input processed
371 or more output produced), Z_STREAM_END if the end of the compressed data has 416 or more output produced), Z_STREAM_END if the end of the compressed data has
372 been reached and all uncompressed output has been produced, Z_NEED_DICT if a 417 been reached and all uncompressed output has been produced, Z_NEED_DICT if a
373 preset dictionary is needed at this point, Z_DATA_ERROR if the input data was 418 preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
374 corrupted (input stream not conforming to the zlib format or incorrect 419 corrupted (input stream not conforming to the zlib format or incorrect check
375 adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent 420 value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
376 (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not 421 if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
377 enough memory, Z_BUF_ERROR if no progress is possible or if there was not 422 Z_BUF_ERROR if no progress is possible or if there was not enough room in the
378 enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR 423 output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
379 case, the application may then call inflateSync to look for a good 424 inflate() can be called again with more input and more output space to
380 compression block. 425 continue decompressing. If Z_DATA_ERROR is returned, the application may then
426 call inflateSync() to look for a good compression block if a partial recovery
427 of the data is desired.
381*/ 428*/
382 429
383 430
@@ -547,16 +594,36 @@ extern int inflateInit2 (z_streamp strm, int windowBits);
547 The windowBits parameter is the base two logarithm of the maximum window 594 The windowBits parameter is the base two logarithm of the maximum window
548 size (the size of the history buffer). It should be in the range 8..15 for 595 size (the size of the history buffer). It should be in the range 8..15 for
549 this version of the library. The default value is 15 if inflateInit is used 596 this version of the library. The default value is 15 if inflateInit is used
550 instead. If a compressed stream with a larger window size is given as 597 instead. windowBits must be greater than or equal to the windowBits value
551 input, inflate() will return with the error code Z_DATA_ERROR instead of 598 provided to deflateInit2() while compressing, or it must be equal to 15 if
552 trying to allocate a larger window. 599 deflateInit2() was not used. If a compressed stream with a larger window
553 600 size is given as input, inflate() will return with the error code
554 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 601 Z_DATA_ERROR instead of trying to allocate a larger window.
555 memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative 602
556 memLevel). msg is set to null if there is no error message. inflateInit2 603 windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
557 does not perform any decompression apart from reading the zlib header if 604 determines the window size. inflate() will then process raw deflate data,
558 present: this will be done by inflate(). (So next_in and avail_in may be 605 not looking for a zlib or gzip header, not generating a check value, and not
559 modified, but next_out and avail_out are unchanged.) 606 looking for any check values for comparison at the end of the stream. This
607 is for use with other formats that use the deflate compressed data format
608 such as zip. Those formats provide their own check values. If a custom
609 format is developed using the raw deflate format for compressed data, it is
610 recommended that a check value such as an adler32 or a crc32 be applied to
611 the uncompressed data as is done in the zlib, gzip, and zip formats. For
612 most applications, the zlib format should be used as is. Note that comments
613 above on the use in deflateInit2() applies to the magnitude of windowBits.
614
615 windowBits can also be greater than 15 for optional gzip decoding. Add
616 32 to windowBits to enable zlib and gzip decoding with automatic header
617 detection, or add 16 to decode only the gzip format (the zlib format will
618 return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is
619 a crc32 instead of an adler32.
620
621 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
622 memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
623 is set to null if there is no error message. inflateInit2 does not perform
624 any decompression apart from reading the zlib header if present: this will
625 be done by inflate(). (So next_in and avail_in may be modified, but next_out
626 and avail_out are unchanged.)
560*/ 627*/
561 628
562extern int zlib_inflateSetDictionary (z_streamp strm, 629extern int zlib_inflateSetDictionary (z_streamp strm,
@@ -564,16 +631,19 @@ extern int zlib_inflateSetDictionary (z_streamp strm,
564 uInt dictLength); 631 uInt dictLength);
565/* 632/*
566 Initializes the decompression dictionary from the given uncompressed byte 633 Initializes the decompression dictionary from the given uncompressed byte
567 sequence. This function must be called immediately after a call of inflate 634 sequence. This function must be called immediately after a call of inflate,
568 if this call returned Z_NEED_DICT. The dictionary chosen by the compressor 635 if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
569 can be determined from the Adler32 value returned by this call of 636 can be determined from the adler32 value returned by that call of inflate.
570 inflate. The compressor and decompressor must use exactly the same 637 The compressor and decompressor must use exactly the same dictionary (see
571 dictionary (see deflateSetDictionary). 638 deflateSetDictionary). For raw inflate, this function can be called
639 immediately after inflateInit2() or inflateReset() and before any call of
640 inflate() to set the dictionary. The application must insure that the
641 dictionary that was used for compression is provided.
572 642
573 inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a 643 inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
574 parameter is invalid (such as NULL dictionary) or the stream state is 644 parameter is invalid (such as NULL dictionary) or the stream state is
575 inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the 645 inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
576 expected one (incorrect Adler32 value). inflateSetDictionary does not 646 expected one (incorrect adler32 value). inflateSetDictionary does not
577 perform any decompression: this will be done by subsequent calls of 647 perform any decompression: this will be done by subsequent calls of
578 inflate(). 648 inflate().
579*/ 649*/
@@ -614,40 +684,19 @@ extern int zlib_inflateIncomp (z_stream *strm);
614 containing the data at next_in (except that the data is not output). 684 containing the data at next_in (except that the data is not output).
615*/ 685*/
616 686
617 /* various hacks, don't look :) */
618
619/* deflateInit and inflateInit are macros to allow checking the zlib version
620 * and the compiler's view of z_stream:
621 */
622extern int zlib_deflateInit_ (z_streamp strm, int level,
623 const char *version, int stream_size);
624extern int zlib_inflateInit_ (z_streamp strm,
625 const char *version, int stream_size);
626extern int zlib_deflateInit2_ (z_streamp strm, int level, int method,
627 int windowBits, int memLevel,
628 int strategy, const char *version,
629 int stream_size);
630extern int zlib_inflateInit2_ (z_streamp strm, int windowBits,
631 const char *version, int stream_size);
632#define zlib_deflateInit(strm, level) \ 687#define zlib_deflateInit(strm, level) \
633 zlib_deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 688 zlib_deflateInit2((strm), (level), Z_DEFLATED, MAX_WBITS, \
689 DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY)
634#define zlib_inflateInit(strm) \ 690#define zlib_inflateInit(strm) \
635 zlib_inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 691 zlib_inflateInit2((strm), DEF_WBITS)
636#define zlib_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
637 zlib_deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
638 (strategy), ZLIB_VERSION, sizeof(z_stream))
639#define zlib_inflateInit2(strm, windowBits) \
640 zlib_inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
641 692
693extern int zlib_deflateInit2(z_streamp strm, int level, int method,
694 int windowBits, int memLevel,
695 int strategy);
696extern int zlib_inflateInit2(z_streamp strm, int windowBits);
642 697
643#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) 698#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
644 struct internal_state {int dummy;}; /* hack for buggy compilers */ 699 struct internal_state {int dummy;}; /* hack for buggy compilers */
645#endif 700#endif
646 701
647extern const char * zlib_zError (int err);
648#if 0
649extern int zlib_inflateSyncPoint (z_streamp z);
650#endif
651extern const uLong * zlib_get_crc_table (void);
652
653#endif /* _ZLIB_H */ 702#endif /* _ZLIB_H */
diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index 2f135cf6eef1..913bfc226dda 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -11,8 +11,6 @@
11#ifndef _LINUX_ZORRO_H 11#ifndef _LINUX_ZORRO_H
12#define _LINUX_ZORRO_H 12#define _LINUX_ZORRO_H
13 13
14#ifndef __ASSEMBLY__
15
16#include <linux/device.h> 14#include <linux/device.h>
17 15
18 16
@@ -112,45 +110,6 @@ struct ConfigDev {
112 __u32 cd_Unused[4]; /* for whatever the driver wants */ 110 __u32 cd_Unused[4]; /* for whatever the driver wants */
113} __attribute__ ((packed)); 111} __attribute__ ((packed));
114 112
115#else /* __ASSEMBLY__ */
116
117LN_Succ = 0
118LN_Pred = LN_Succ+4
119LN_Type = LN_Pred+4
120LN_Pri = LN_Type+1
121LN_Name = LN_Pri+1
122LN_sizeof = LN_Name+4
123
124ER_Type = 0
125ER_Product = ER_Type+1
126ER_Flags = ER_Product+1
127ER_Reserved03 = ER_Flags+1
128ER_Manufacturer = ER_Reserved03+1
129ER_SerialNumber = ER_Manufacturer+2
130ER_InitDiagVec = ER_SerialNumber+4
131ER_Reserved0c = ER_InitDiagVec+2
132ER_Reserved0d = ER_Reserved0c+1
133ER_Reserved0e = ER_Reserved0d+1
134ER_Reserved0f = ER_Reserved0e+1
135ER_sizeof = ER_Reserved0f+1
136
137CD_Node = 0
138CD_Flags = CD_Node+LN_sizeof
139CD_Pad = CD_Flags+1
140CD_Rom = CD_Pad+1
141CD_BoardAddr = CD_Rom+ER_sizeof
142CD_BoardSize = CD_BoardAddr+4
143CD_SlotAddr = CD_BoardSize+4
144CD_SlotSize = CD_SlotAddr+2
145CD_Driver = CD_SlotSize+2
146CD_NextCD = CD_Driver+4
147CD_Unused = CD_NextCD+4
148CD_sizeof = CD_Unused+(4*4)
149
150#endif /* __ASSEMBLY__ */
151
152#ifndef __ASSEMBLY__
153
154#define ZORRO_NUM_AUTO 16 113#define ZORRO_NUM_AUTO 16
155 114
156#ifdef __KERNEL__ 115#ifdef __KERNEL__
@@ -290,7 +249,6 @@ extern DECLARE_BITMAP(zorro_unused_z2ram, 128);
290#define Z2RAM_CHUNKSHIFT (16) 249#define Z2RAM_CHUNKSHIFT (16)
291 250
292 251
293#endif /* !__ASSEMBLY__ */
294#endif /* __KERNEL__ */ 252#endif /* __KERNEL__ */
295 253
296#endif /* _LINUX_ZORRO_H */ 254#endif /* _LINUX_ZORRO_H */
diff --git a/include/linux/zutil.h b/include/linux/zutil.h
index ee0c59cf2136..6adfa9a6ffe9 100644
--- a/include/linux/zutil.h
+++ b/include/linux/zutil.h
@@ -23,18 +23,6 @@ typedef unsigned long ulg;
23 23
24 /* common constants */ 24 /* common constants */
25 25
26#ifndef DEF_WBITS
27# define DEF_WBITS MAX_WBITS
28#endif
29/* default windowBits for decompression. MAX_WBITS is for compression only */
30
31#if MAX_MEM_LEVEL >= 8
32# define DEF_MEM_LEVEL 8
33#else
34# define DEF_MEM_LEVEL MAX_MEM_LEVEL
35#endif
36/* default memLevel */
37
38#define STORED_BLOCK 0 26#define STORED_BLOCK 0
39#define STATIC_TREES 1 27#define STATIC_TREES 1
40#define DYN_TREES 2 28#define DYN_TREES 2
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index b5994ea56a5a..31329fce1ff5 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -7,8 +7,9 @@
7#ifndef __MTD_ABI_H__ 7#ifndef __MTD_ABI_H__
8#define __MTD_ABI_H__ 8#define __MTD_ABI_H__
9 9
10#ifndef __KERNEL__ /* Urgh. The whole point of splitting this out into 10#ifndef __KERNEL__
11 separate files was to avoid #ifdef __KERNEL__ */ 11/* Urgh. The whole point of splitting this out into
12 separate files was to avoid #ifdef __KERNEL__ */
12#define __user 13#define __user
13#endif 14#endif
14 15
@@ -28,28 +29,17 @@ struct mtd_oob_buf {
28#define MTD_ROM 2 29#define MTD_ROM 2
29#define MTD_NORFLASH 3 30#define MTD_NORFLASH 3
30#define MTD_NANDFLASH 4 31#define MTD_NANDFLASH 4
31#define MTD_PEROM 5
32#define MTD_DATAFLASH 6 32#define MTD_DATAFLASH 6
33#define MTD_OTHER 14 33
34#define MTD_UNKNOWN 15 34#define MTD_WRITEABLE 0x400 /* Device is writeable */
35 35#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */
36#define MTD_CLEAR_BITS 1 // Bits can be cleared (flash) 36#define MTD_NO_ERASE 0x1000 /* No erase necessary */
37#define MTD_SET_BITS 2 // Bits can be set
38#define MTD_ERASEABLE 4 // Has an erase function
39#define MTD_WRITEB_WRITEABLE 8 // Direct IO is possible
40#define MTD_VOLATILE 16 // Set for RAMs
41#define MTD_XIP 32 // eXecute-In-Place possible
42#define MTD_OOB 64 // Out-of-band data (NAND flash)
43#define MTD_ECC 128 // Device capable of automatic ECC
44#define MTD_NO_VIRTBLOCKS 256 // Virtual blocks not allowed
45#define MTD_PROGRAM_REGIONS 512 // Configurable Programming Regions
46 37
47// Some common devices / combinations of capabilities 38// Some common devices / combinations of capabilities
48#define MTD_CAP_ROM 0 39#define MTD_CAP_ROM 0
49#define MTD_CAP_RAM (MTD_CLEAR_BITS|MTD_SET_BITS|MTD_WRITEB_WRITEABLE) 40#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
50#define MTD_CAP_NORFLASH (MTD_CLEAR_BITS|MTD_ERASEABLE) 41#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
51#define MTD_CAP_NANDFLASH (MTD_CLEAR_BITS|MTD_ERASEABLE|MTD_OOB) 42#define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
52#define MTD_WRITEABLE (MTD_CLEAR_BITS|MTD_SET_BITS)
53 43
54 44
55// Types of automatic ECC/Checksum available 45// Types of automatic ECC/Checksum available
@@ -74,7 +64,7 @@ struct mtd_info_user {
74 uint32_t flags; 64 uint32_t flags;
75 uint32_t size; // Total size of the MTD 65 uint32_t size; // Total size of the MTD
76 uint32_t erasesize; 66 uint32_t erasesize;
77 uint32_t oobblock; // Size of OOB blocks (e.g. 512) 67 uint32_t writesize;
78 uint32_t oobsize; // Amount of OOB data per block (e.g. 16) 68 uint32_t oobsize; // Amount of OOB data per block (e.g. 16)
79 uint32_t ecctype; 69 uint32_t ecctype;
80 uint32_t eccsize; 70 uint32_t eccsize;
@@ -94,12 +84,12 @@ struct otp_info {
94 uint32_t locked; 84 uint32_t locked;
95}; 85};
96 86
97#define MEMGETINFO _IOR('M', 1, struct mtd_info_user) 87#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
98#define MEMERASE _IOW('M', 2, struct erase_info_user) 88#define MEMERASE _IOW('M', 2, struct erase_info_user)
99#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf) 89#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
100#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf) 90#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
101#define MEMLOCK _IOW('M', 5, struct erase_info_user) 91#define MEMLOCK _IOW('M', 5, struct erase_info_user)
102#define MEMUNLOCK _IOW('M', 6, struct erase_info_user) 92#define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
103#define MEMGETREGIONCOUNT _IOR('M', 7, int) 93#define MEMGETREGIONCOUNT _IOR('M', 7, int)
104#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user) 94#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
105#define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo) 95#define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)
@@ -109,8 +99,15 @@ struct otp_info {
109#define OTPSELECT _IOR('M', 13, int) 99#define OTPSELECT _IOR('M', 13, int)
110#define OTPGETREGIONCOUNT _IOW('M', 14, int) 100#define OTPGETREGIONCOUNT _IOW('M', 14, int)
111#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) 101#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
112#define OTPLOCK _IOR('M', 16, struct otp_info) 102#define OTPLOCK _IOR('M', 16, struct otp_info)
103#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout)
104#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
105#define MTDFILEMODE _IO('M', 19)
113 106
107/*
108 * Obsolete legacy interface. Keep it in order not to break userspace
109 * interfaces
110 */
114struct nand_oobinfo { 111struct nand_oobinfo {
115 uint32_t useecc; 112 uint32_t useecc;
116 uint32_t eccbytes; 113 uint32_t eccbytes;
@@ -118,4 +115,46 @@ struct nand_oobinfo {
118 uint32_t eccpos[32]; 115 uint32_t eccpos[32];
119}; 116};
120 117
118struct nand_oobfree {
119 uint32_t offset;
120 uint32_t length;
121};
122
123#define MTD_MAX_OOBFREE_ENTRIES 8
124/*
125 * ECC layout control structure. Exported to userspace for
126 * diagnosis and to allow creation of raw images
127 */
128struct nand_ecclayout {
129 uint32_t eccbytes;
130 uint32_t eccpos[64];
131 uint32_t oobavail;
132 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
133};
134
135/**
136 * struct mtd_ecc_stats - error correction status
137 *
138 * @corrected: number of corrected bits
139 * @failed: number of uncorrectable errors
140 * @badblocks: number of bad blocks in this partition
141 * @bbtblocks: number of blocks reserved for bad block tables
142 */
143struct mtd_ecc_stats {
144 uint32_t corrected;
145 uint32_t failed;
146 uint32_t badblocks;
147 uint32_t bbtblocks;
148};
149
150/*
151 * Read/write file modes for access to MTD
152 */
153enum mtd_file_modes {
154 MTD_MODE_NORMAL = MTD_OTP_OFF,
155 MTD_MODE_OTP_FACTORY = MTD_OTP_FACTORY,
156 MTD_MODE_OTP_USER = MTD_OTP_USER,
157 MTD_MODE_RAW,
158};
159
121#endif /* __MTD_ABI_H__ */ 160#endif /* __MTD_ABI_H__ */
diff --git a/include/mtd/mtd-user.h b/include/mtd/mtd-user.h
index 1c13fc7161fe..713f34d3e62e 100644
--- a/include/mtd/mtd-user.h
+++ b/include/mtd/mtd-user.h
@@ -16,5 +16,6 @@ typedef struct mtd_info_user mtd_info_t;
16typedef struct erase_info_user erase_info_t; 16typedef struct erase_info_user erase_info_t;
17typedef struct region_info_user region_info_t; 17typedef struct region_info_user region_info_t;
18typedef struct nand_oobinfo nand_oobinfo_t; 18typedef struct nand_oobinfo nand_oobinfo_t;
19typedef struct nand_ecclayout nand_ecclayout_t;
19 20
20#endif /* __MTD_USER_H__ */ 21#endif /* __MTD_USER_H__ */
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 750e2508dd90..3d71251b3eca 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -45,7 +45,6 @@ struct prefix_info {
45 45
46#ifdef __KERNEL__ 46#ifdef __KERNEL__
47 47
48#include <linux/config.h>
49#include <linux/netdevice.h> 48#include <linux/netdevice.h>
50#include <net/if_inet6.h> 49#include <net/if_inet6.h>
51#include <net/ipv6.h> 50#include <net/ipv6.h>
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index 427dac94bc7e..795f81f9ec7f 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -1,7 +1,6 @@
1#ifndef __LINUX_NET_AFUNIX_H 1#ifndef __LINUX_NET_AFUNIX_H
2#define __LINUX_NET_AFUNIX_H 2#define __LINUX_NET_AFUNIX_H
3 3
4#include <linux/config.h>
5#include <linux/socket.h> 4#include <linux/socket.h>
6#include <linux/un.h> 5#include <linux/un.h>
7#include <linux/mutex.h> 6#include <linux/mutex.h>
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 5bd997487054..7cd528e9d668 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -6,7 +6,6 @@
6#ifndef _AX25_H 6#ifndef _AX25_H
7#define _AX25_H 7#define _AX25_H
8 8
9#include <linux/config.h>
10#include <linux/ax25.h> 9#include <linux/ax25.h>
11#include <linux/spinlock.h> 10#include <linux/spinlock.h>
12#include <linux/timer.h> 11#include <linux/timer.h>
diff --git a/include/net/compat.h b/include/net/compat.h
index e65cbedb6abc..9859b60280d5 100644
--- a/include/net/compat.h
+++ b/include/net/compat.h
@@ -1,7 +1,6 @@
1#ifndef NET_COMPAT_H 1#ifndef NET_COMPAT_H
2#define NET_COMPAT_H 2#define NET_COMPAT_H
3 3
4#include <linux/config.h>
5 4
6struct sock; 5struct sock;
7 6
diff --git a/include/net/dst.h b/include/net/dst.h
index 5161e89017f9..36d54fc248b0 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -8,7 +8,6 @@
8#ifndef _NET_DST_H 8#ifndef _NET_DST_H
9#define _NET_DST_H 9#define _NET_DST_H
10 10
11#include <linux/config.h>
12#include <linux/netdevice.h> 11#include <linux/netdevice.h>
13#include <linux/rtnetlink.h> 12#include <linux/rtnetlink.h>
14#include <linux/rcupdate.h> 13#include <linux/rcupdate.h>
diff --git a/include/net/icmp.h b/include/net/icmp.h
index e7c3f20fbafc..05f8ff7d9316 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -18,7 +18,6 @@
18#ifndef _ICMP_H 18#ifndef _ICMP_H
19#define _ICMP_H 19#define _ICMP_H
20 20
21#include <linux/config.h>
22#include <linux/icmp.h> 21#include <linux/icmp.h>
23 22
24#include <net/inet_sock.h> 23#include <net/inet_sock.h>
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index d5147770ad47..ecc42864b001 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -968,6 +968,7 @@ enum ieee80211_state {
968 968
969enum { 969enum {
970 IEEE80211_CH_PASSIVE_ONLY = (1 << 0), 970 IEEE80211_CH_PASSIVE_ONLY = (1 << 0),
971 IEEE80211_CH_80211H_RULES = (1 << 1),
971 IEEE80211_CH_B_ONLY = (1 << 2), 972 IEEE80211_CH_B_ONLY = (1 << 2),
972 IEEE80211_CH_NO_IBSS = (1 << 3), 973 IEEE80211_CH_NO_IBSS = (1 << 3),
973 IEEE80211_CH_UNIFORM_SPREADING = (1 << 4), 974 IEEE80211_CH_UNIFORM_SPREADING = (1 << 4),
@@ -976,10 +977,10 @@ enum {
976}; 977};
977 978
978struct ieee80211_channel { 979struct ieee80211_channel {
979 u32 freq; 980 u32 freq; /* in MHz */
980 u8 channel; 981 u8 channel;
981 u8 flags; 982 u8 flags;
982 u8 max_power; 983 u8 max_power; /* in dBm */
983}; 984};
984 985
985struct ieee80211_geo { 986struct ieee80211_geo {
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
index 59f0c83d55a2..bc6a71dce984 100644
--- a/include/net/inet6_hashtables.h
+++ b/include/net/inet6_hashtables.h
@@ -14,7 +14,6 @@
14#ifndef _INET6_HASHTABLES_H 14#ifndef _INET6_HASHTABLES_H
15#define _INET6_HASHTABLES_H 15#define _INET6_HASHTABLES_H
16 16
17#include <linux/config.h>
18 17
19#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 18#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
20#include <linux/in6.h> 19#include <linux/in6.h>
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 135d80fd658e..98e0bb3014fe 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -14,7 +14,6 @@
14#ifndef _INET_HASHTABLES_H 14#ifndef _INET_HASHTABLES_H
15#define _INET_HASHTABLES_H 15#define _INET_HASHTABLES_H
16 16
17#include <linux/config.h>
18 17
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20#include <linux/ipv6.h> 19#include <linux/ipv6.h>
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 883eb529ef8e..1f4a9a60d4cc 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -16,7 +16,6 @@
16#ifndef _INET_SOCK_H 16#ifndef _INET_SOCK_H
17#define _INET_SOCK_H 17#define _INET_SOCK_H
18 18
19#include <linux/config.h>
20 19
21#include <linux/string.h> 20#include <linux/string.h>
22#include <linux/types.h> 21#include <linux/types.h>
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index e837f98fdb50..600cb543550d 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -15,7 +15,6 @@
15#ifndef _INET_TIMEWAIT_SOCK_ 15#ifndef _INET_TIMEWAIT_SOCK_
16#define _INET_TIMEWAIT_SOCK_ 16#define _INET_TIMEWAIT_SOCK_
17 17
18#include <linux/config.h>
19 18
20#include <linux/list.h> 19#include <linux/list.h>
21#include <linux/module.h> 20#include <linux/module.h>
diff --git a/include/net/ip.h b/include/net/ip.h
index ead233c9540d..98f908400771 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -22,7 +22,6 @@
22#ifndef _IP_H 22#ifndef _IP_H
23#define _IP_H 23#define _IP_H
24 24
25#include <linux/config.h>
26#include <linux/types.h> 25#include <linux/types.h>
27#include <linux/ip.h> 26#include <linux/ip.h>
28#include <linux/in.h> 27#include <linux/in.h>
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index e000fa2cd5f6..a095d1dec7a4 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -16,7 +16,6 @@
16#ifndef _NET_IP_FIB_H 16#ifndef _NET_IP_FIB_H
17#define _NET_IP_FIB_H 17#define _NET_IP_FIB_H
18 18
19#include <linux/config.h>
20#include <net/flow.h> 19#include <net/flow.h>
21#include <linux/seq_file.h> 20#include <linux/seq_file.h>
22 21
diff --git a/include/net/ip_mp_alg.h b/include/net/ip_mp_alg.h
index 77225735cbd4..ac747b64734c 100644
--- a/include/net/ip_mp_alg.h
+++ b/include/net/ip_mp_alg.h
@@ -7,7 +7,6 @@
7#ifndef _NET_IP_MP_ALG_H 7#ifndef _NET_IP_MP_ALG_H
8#define _NET_IP_MP_ALG_H 8#define _NET_IP_MP_ALG_H
9 9
10#include <linux/config.h>
11#include <linux/ip_mp_alg.h> 10#include <linux/ip_mp_alg.h>
12#include <net/flow.h> 11#include <net/flow.h>
13#include <net/route.h> 12#include <net/route.h>
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 7d2674fde19a..3b57b159b653 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -248,7 +248,6 @@ struct ip_vs_daemon_user {
248 248
249#ifdef __KERNEL__ 249#ifdef __KERNEL__
250 250
251#include <linux/config.h>
252#include <linux/list.h> /* for struct list_head */ 251#include <linux/list.h> /* for struct list_head */
253#include <linux/spinlock.h> /* for struct rwlock_t */ 252#include <linux/spinlock.h> /* for struct rwlock_t */
254#include <asm/atomic.h> /* for struct atomic_t */ 253#include <asm/atomic.h> /* for struct atomic_t */
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 4abedb8eaece..a8fdf7970b37 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -104,7 +104,6 @@ struct frag_hdr {
104 104
105#ifdef __KERNEL__ 105#ifdef __KERNEL__
106 106
107#include <linux/config.h>
108#include <net/sock.h> 107#include <net/sock.h>
109 108
110/* sysctls */ 109/* sysctls */
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h
index 1880e46ecc9b..1cb0607fcbb9 100644
--- a/include/net/irda/irda.h
+++ b/include/net/irda/irda.h
@@ -26,7 +26,6 @@
26#ifndef NET_IRDA_H 26#ifndef NET_IRDA_H
27#define NET_IRDA_H 27#define NET_IRDA_H
28 28
29#include <linux/config.h>
30#include <linux/skbuff.h> /* struct sk_buff */ 29#include <linux/skbuff.h> /* struct sk_buff */
31#include <linux/kernel.h> 30#include <linux/kernel.h>
32#include <linux/if.h> /* sa_family_t in <linux/irda.h> */ 31#include <linux/if.h> /* sa_family_t in <linux/irda.h> */
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index 92c828029cd8..0575c59a5c96 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -39,7 +39,6 @@
39#ifndef IRDA_DEVICE_H 39#ifndef IRDA_DEVICE_H
40#define IRDA_DEVICE_H 40#define IRDA_DEVICE_H
41 41
42#include <linux/config.h>
43#include <linux/tty.h> 42#include <linux/tty.h>
44#include <linux/netdevice.h> 43#include <linux/netdevice.h>
45#include <linux/spinlock.h> 44#include <linux/spinlock.h>
diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h
index 2127cae1e0a6..e77eb88d9226 100644
--- a/include/net/irda/irlap.h
+++ b/include/net/irda/irlap.h
@@ -27,7 +27,6 @@
27#ifndef IRLAP_H 27#ifndef IRLAP_H
28#define IRLAP_H 28#define IRLAP_H
29 29
30#include <linux/config.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/skbuff.h> 31#include <linux/skbuff.h>
33#include <linux/netdevice.h> 32#include <linux/netdevice.h>
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index c0c895d379ba..11ecfa58a648 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -29,7 +29,6 @@
29 29
30#include <asm/param.h> /* for HZ */ 30#include <asm/param.h> /* for HZ */
31 31
32#include <linux/config.h>
33#include <linux/types.h> 32#include <linux/types.h>
34 33
35#include <net/irda/irda.h> 34#include <net/irda/irda.h>
diff --git a/include/net/irda/irlmp_frame.h b/include/net/irda/irlmp_frame.h
index eb3ad158c023..c463f8bca856 100644
--- a/include/net/irda/irlmp_frame.h
+++ b/include/net/irda/irlmp_frame.h
@@ -26,7 +26,6 @@
26#ifndef IRMLP_FRAME_H 26#ifndef IRMLP_FRAME_H
27#define IRMLP_FRAME_H 27#define IRMLP_FRAME_H
28 28
29#include <linux/config.h>
30#include <linux/skbuff.h> 29#include <linux/skbuff.h>
31 30
32#include <net/irda/discovery.h> 31#include <net/irda/discovery.h>
diff --git a/include/net/irda/qos.h b/include/net/irda/qos.h
index 9ae3d6bc2423..cc577dc0a0ef 100644
--- a/include/net/irda/qos.h
+++ b/include/net/irda/qos.h
@@ -31,7 +31,6 @@
31#ifndef IRDA_QOS_H 31#ifndef IRDA_QOS_H
32#define IRDA_QOS_H 32#define IRDA_QOS_H
33 33
34#include <linux/config.h>
35#include <linux/skbuff.h> 34#include <linux/skbuff.h>
36 35
37#include <net/irda/parameters.h> 36#include <net/irda/parameters.h>
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 91fa271a0064..d3915dabe6de 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -37,7 +37,6 @@ enum {
37 37
38#ifdef __KERNEL__ 38#ifdef __KERNEL__
39 39
40#include <linux/config.h>
41#include <linux/compiler.h> 40#include <linux/compiler.h>
42#include <linux/icmpv6.h> 41#include <linux/icmpv6.h>
43#include <linux/in6.h> 42#include <linux/in6.h>
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 411117815807..1fbd8193d5f1 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -15,7 +15,6 @@
15#include <linux/netfilter/nf_conntrack_common.h> 15#include <linux/netfilter/nf_conntrack_common.h>
16 16
17#ifdef __KERNEL__ 17#ifdef __KERNEL__
18#include <linux/config.h>
19#include <linux/bitops.h> 18#include <linux/bitops.h>
20#include <linux/compiler.h> 19#include <linux/compiler.h>
21#include <asm/atomic.h> 20#include <asm/atomic.h>
diff --git a/include/net/pkt_act.h b/include/net/pkt_act.h
index b225d8472b7e..cf5e4d2e4c21 100644
--- a/include/net/pkt_act.h
+++ b/include/net/pkt_act.h
@@ -4,7 +4,6 @@
4#include <asm/uaccess.h> 4#include <asm/uaccess.h>
5#include <asm/system.h> 5#include <asm/system.h>
6#include <linux/bitops.h> 6#include <linux/bitops.h>
7#include <linux/config.h>
8#include <linux/types.h> 7#include <linux/types.h>
9#include <linux/kernel.h> 8#include <linux/kernel.h>
10#include <linux/sched.h> 9#include <linux/sched.h>
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index b94d1ad92c4d..75b5b9333fc7 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -218,12 +218,13 @@ extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
218 struct rtattr *tab); 218 struct rtattr *tab);
219extern void qdisc_put_rtab(struct qdisc_rate_table *tab); 219extern void qdisc_put_rtab(struct qdisc_rate_table *tab);
220 220
221extern int qdisc_restart(struct net_device *dev); 221extern void __qdisc_run(struct net_device *dev);
222 222
223static inline void qdisc_run(struct net_device *dev) 223static inline void qdisc_run(struct net_device *dev)
224{ 224{
225 while (!netif_queue_stopped(dev) && qdisc_restart(dev) < 0) 225 if (!netif_queue_stopped(dev) &&
226 /* NOTHING */; 226 !test_and_set_bit(__LINK_STATE_QDISC_RUNNING, &dev->state))
227 __qdisc_run(dev);
227} 228}
228 229
229extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, 230extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp,
diff --git a/include/net/protocol.h b/include/net/protocol.h
index 6dc5970612d7..3b6dc15c68a5 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -24,7 +24,6 @@
24#ifndef _PROTOCOL_H 24#ifndef _PROTOCOL_H
25#define _PROTOCOL_H 25#define _PROTOCOL_H
26 26
27#include <linux/config.h>
28#include <linux/in6.h> 27#include <linux/in6.h>
29#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 28#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
30#include <linux/ipv6.h> 29#include <linux/ipv6.h>
@@ -37,6 +36,7 @@
37struct net_protocol { 36struct net_protocol {
38 int (*handler)(struct sk_buff *skb); 37 int (*handler)(struct sk_buff *skb);
39 void (*err_handler)(struct sk_buff *skb, u32 info); 38 void (*err_handler)(struct sk_buff *skb, u32 info);
39 struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg);
40 int no_policy; 40 int no_policy;
41}; 41};
42 42
diff --git a/include/net/raw.h b/include/net/raw.h
index d83571fe4c69..e4af59781949 100644
--- a/include/net/raw.h
+++ b/include/net/raw.h
@@ -17,7 +17,6 @@
17#ifndef _RAW_H 17#ifndef _RAW_H
18#define _RAW_H 18#define _RAW_H
19 19
20#include <linux/config.h>
21 20
22#include <net/protocol.h> 21#include <net/protocol.h>
23 22
diff --git a/include/net/red.h b/include/net/red.h
index 2ed4358e3295..5ccdbb3d4722 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -1,7 +1,6 @@
1#ifndef __NET_SCHED_RED_H 1#ifndef __NET_SCHED_RED_H
2#define __NET_SCHED_RED_H 2#define __NET_SCHED_RED_H
3 3
4#include <linux/config.h>
5#include <linux/types.h> 4#include <linux/types.h>
6#include <net/pkt_sched.h> 5#include <net/pkt_sched.h>
7#include <net/inet_ecn.h> 6#include <net/inet_ecn.h>
diff --git a/include/net/route.h b/include/net/route.h
index 98c915abdec8..c4a068692dcc 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -24,7 +24,6 @@
24#ifndef _ROUTE_H 24#ifndef _ROUTE_H
25#define _ROUTE_H 25#define _ROUTE_H
26 26
27#include <linux/config.h>
28#include <net/dst.h> 27#include <net/dst.h>
29#include <net/inetpeer.h> 28#include <net/inetpeer.h>
30#include <net/flow.h> 29#include <net/flow.h>
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 7b6ec9986715..b0e9108a4e18 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -1,7 +1,6 @@
1#ifndef __NET_SCHED_GENERIC_H 1#ifndef __NET_SCHED_GENERIC_H
2#define __NET_SCHED_GENERIC_H 2#define __NET_SCHED_GENERIC_H
3 3
4#include <linux/config.h>
5#include <linux/netdevice.h> 4#include <linux/netdevice.h>
6#include <linux/types.h> 5#include <linux/types.h>
7#include <linux/rcupdate.h> 6#include <linux/rcupdate.h>
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index b2b40f951ae6..a9663b49ea54 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -63,7 +63,6 @@
63 */ 63 */
64 64
65 65
66#include <linux/config.h>
67 66
68#ifdef TEST_FRAME 67#ifdef TEST_FRAME
69#undef CONFIG_PROC_FS 68#undef CONFIG_PROC_FS
@@ -255,7 +254,7 @@ extern int sctp_debug_flag;
255#define SCTP_DEBUG_PRINTK_IPADDR(whatever...) 254#define SCTP_DEBUG_PRINTK_IPADDR(whatever...)
256#define SCTP_ENABLE_DEBUG 255#define SCTP_ENABLE_DEBUG
257#define SCTP_DISABLE_DEBUG 256#define SCTP_DISABLE_DEBUG
258#define SCTP_ASSERT(expr, str, func) BUG_ON(!(expr)) 257#define SCTP_ASSERT(expr, str, func)
259 258
260#endif /* SCTP_DEBUG */ 259#endif /* SCTP_DEBUG */
261 260
diff --git a/include/net/sock.h b/include/net/sock.h
index 96565ff0de6a..2d8d6adf1616 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -40,7 +40,6 @@
40#ifndef _SOCK_H 40#ifndef _SOCK_H
41#define _SOCK_H 41#define _SOCK_H
42 42
43#include <linux/config.h>
44#include <linux/list.h> 43#include <linux/list.h>
45#include <linux/timer.h> 44#include <linux/timer.h>
46#include <linux/cache.h> 45#include <linux/cache.h>
@@ -1031,9 +1030,13 @@ static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
1031{ 1030{
1032 __sk_dst_set(sk, dst); 1031 __sk_dst_set(sk, dst);
1033 sk->sk_route_caps = dst->dev->features; 1032 sk->sk_route_caps = dst->dev->features;
1033 if (sk->sk_route_caps & NETIF_F_GSO)
1034 sk->sk_route_caps |= NETIF_F_TSO;
1034 if (sk->sk_route_caps & NETIF_F_TSO) { 1035 if (sk->sk_route_caps & NETIF_F_TSO) {
1035 if (sock_flag(sk, SOCK_NO_LARGESEND) || dst->header_len) 1036 if (sock_flag(sk, SOCK_NO_LARGESEND) || dst->header_len)
1036 sk->sk_route_caps &= ~NETIF_F_TSO; 1037 sk->sk_route_caps &= ~NETIF_F_TSO;
1038 else
1039 sk->sk_route_caps |= NETIF_F_SG | NETIF_F_HW_CSUM;
1037 } 1040 }
1038} 1041}
1039 1042
@@ -1266,6 +1269,7 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
1266 * sk_eat_skb - Release a skb if it is no longer needed 1269 * sk_eat_skb - Release a skb if it is no longer needed
1267 * @sk: socket to eat this skb from 1270 * @sk: socket to eat this skb from
1268 * @skb: socket buffer to eat 1271 * @skb: socket buffer to eat
1272 * @copied_early: flag indicating whether DMA operations copied this data early
1269 * 1273 *
1270 * This routine must be called with interrupts disabled or with the socket 1274 * This routine must be called with interrupts disabled or with the socket
1271 * locked so that the sk_buff queue operation is ok. 1275 * locked so that the sk_buff queue operation is ok.
diff --git a/include/net/tcp.h b/include/net/tcp.h
index bfc71f954bbe..ca3d38dfc00b 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -21,7 +21,6 @@
21#define TCP_DEBUG 1 21#define TCP_DEBUG 1
22#define FASTRETRANS_DEBUG 1 22#define FASTRETRANS_DEBUG 1
23 23
24#include <linux/config.h>
25#include <linux/list.h> 24#include <linux/list.h>
26#include <linux/tcp.h> 25#include <linux/tcp.h>
27#include <linux/slab.h> 26#include <linux/slab.h>
@@ -570,13 +569,13 @@ struct tcp_skb_cb {
570 */ 569 */
571static inline int tcp_skb_pcount(const struct sk_buff *skb) 570static inline int tcp_skb_pcount(const struct sk_buff *skb)
572{ 571{
573 return skb_shinfo(skb)->tso_segs; 572 return skb_shinfo(skb)->gso_segs;
574} 573}
575 574
576/* This is valid iff tcp_skb_pcount() > 1. */ 575/* This is valid iff tcp_skb_pcount() > 1. */
577static inline int tcp_skb_mss(const struct sk_buff *skb) 576static inline int tcp_skb_mss(const struct sk_buff *skb)
578{ 577{
579 return skb_shinfo(skb)->tso_size; 578 return skb_shinfo(skb)->gso_size;
580} 579}
581 580
582static inline void tcp_dec_pcount_approx(__u32 *count, 581static inline void tcp_dec_pcount_approx(__u32 *count,
@@ -1087,6 +1086,8 @@ extern struct request_sock_ops tcp_request_sock_ops;
1087 1086
1088extern int tcp_v4_destroy_sock(struct sock *sk); 1087extern int tcp_v4_destroy_sock(struct sock *sk);
1089 1088
1089extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg);
1090
1090#ifdef CONFIG_PROC_FS 1091#ifdef CONFIG_PROC_FS
1091extern int tcp4_proc_init(void); 1092extern int tcp4_proc_init(void);
1092extern void tcp4_proc_exit(void); 1093extern void tcp4_proc_exit(void);
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 5e0a01ab2216..ede639812f8a 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -15,7 +15,6 @@
15#ifndef _LINUX_SS_H 15#ifndef _LINUX_SS_H
16#define _LINUX_SS_H 16#define _LINUX_SS_H
17 17
18#include <linux/config.h>
19#include <linux/device.h> 18#include <linux/device.h>
20#include <linux/sched.h> /* task_struct, completion */ 19#include <linux/sched.h> /* task_struct, completion */
21#include <linux/mutex.h> 20#include <linux/mutex.h>
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index e5618b90996e..253797c60095 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -43,6 +43,10 @@ enum iscsi_uevent_e {
43 ISCSI_UEVENT_GET_STATS = UEVENT_BASE + 10, 43 ISCSI_UEVENT_GET_STATS = UEVENT_BASE + 10,
44 ISCSI_UEVENT_GET_PARAM = UEVENT_BASE + 11, 44 ISCSI_UEVENT_GET_PARAM = UEVENT_BASE + 11,
45 45
46 ISCSI_UEVENT_TRANSPORT_EP_CONNECT = UEVENT_BASE + 12,
47 ISCSI_UEVENT_TRANSPORT_EP_POLL = UEVENT_BASE + 13,
48 ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT = UEVENT_BASE + 14,
49
46 /* up events */ 50 /* up events */
47 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, 51 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1,
48 ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2, 52 ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2,
@@ -60,61 +64,83 @@ struct iscsi_uevent {
60 uint32_t initial_cmdsn; 64 uint32_t initial_cmdsn;
61 } c_session; 65 } c_session;
62 struct msg_destroy_session { 66 struct msg_destroy_session {
63 uint64_t session_handle;
64 uint32_t sid; 67 uint32_t sid;
65 } d_session; 68 } d_session;
66 struct msg_create_conn { 69 struct msg_create_conn {
67 uint64_t session_handle;
68 uint32_t cid;
69 uint32_t sid; 70 uint32_t sid;
71 uint32_t cid;
70 } c_conn; 72 } c_conn;
71 struct msg_bind_conn { 73 struct msg_bind_conn {
72 uint64_t session_handle; 74 uint32_t sid;
73 uint64_t conn_handle; 75 uint32_t cid;
74 uint32_t transport_fd; 76 uint64_t transport_eph;
75 uint32_t is_leading; 77 uint32_t is_leading;
76 } b_conn; 78 } b_conn;
77 struct msg_destroy_conn { 79 struct msg_destroy_conn {
78 uint64_t conn_handle; 80 uint32_t sid;
79 uint32_t cid; 81 uint32_t cid;
80 } d_conn; 82 } d_conn;
81 struct msg_send_pdu { 83 struct msg_send_pdu {
84 uint32_t sid;
85 uint32_t cid;
82 uint32_t hdr_size; 86 uint32_t hdr_size;
83 uint32_t data_size; 87 uint32_t data_size;
84 uint64_t conn_handle;
85 } send_pdu; 88 } send_pdu;
86 struct msg_set_param { 89 struct msg_set_param {
87 uint64_t conn_handle; 90 uint32_t sid;
91 uint32_t cid;
88 uint32_t param; /* enum iscsi_param */ 92 uint32_t param; /* enum iscsi_param */
89 uint32_t value; 93 uint32_t len;
90 } set_param; 94 } set_param;
91 struct msg_start_conn { 95 struct msg_start_conn {
92 uint64_t conn_handle; 96 uint32_t sid;
97 uint32_t cid;
93 } start_conn; 98 } start_conn;
94 struct msg_stop_conn { 99 struct msg_stop_conn {
100 uint32_t sid;
101 uint32_t cid;
95 uint64_t conn_handle; 102 uint64_t conn_handle;
96 uint32_t flag; 103 uint32_t flag;
97 } stop_conn; 104 } stop_conn;
98 struct msg_get_stats { 105 struct msg_get_stats {
99 uint64_t conn_handle; 106 uint32_t sid;
107 uint32_t cid;
100 } get_stats; 108 } get_stats;
109 struct msg_transport_connect {
110 uint32_t non_blocking;
111 } ep_connect;
112 struct msg_transport_poll {
113 uint64_t ep_handle;
114 uint32_t timeout_ms;
115 } ep_poll;
116 struct msg_transport_disconnect {
117 uint64_t ep_handle;
118 } ep_disconnect;
101 } u; 119 } u;
102 union { 120 union {
103 /* messages k -> u */ 121 /* messages k -> u */
104 uint64_t handle;
105 int retcode; 122 int retcode;
106 struct msg_create_session_ret { 123 struct msg_create_session_ret {
107 uint64_t session_handle;
108 uint32_t sid; 124 uint32_t sid;
125 uint32_t host_no;
109 } c_session_ret; 126 } c_session_ret;
127 struct msg_create_conn_ret {
128 uint32_t sid;
129 uint32_t cid;
130 } c_conn_ret;
110 struct msg_recv_req { 131 struct msg_recv_req {
132 uint32_t sid;
133 uint32_t cid;
111 uint64_t recv_handle; 134 uint64_t recv_handle;
112 uint64_t conn_handle;
113 } recv_req; 135 } recv_req;
114 struct msg_conn_error { 136 struct msg_conn_error {
115 uint64_t conn_handle; 137 uint32_t sid;
138 uint32_t cid;
116 uint32_t error; /* enum iscsi_err */ 139 uint32_t error; /* enum iscsi_err */
117 } connerror; 140 } connerror;
141 struct msg_transport_connect_ret {
142 uint64_t handle;
143 } ep_connect_ret;
118 } r; 144 } r;
119} __attribute__ ((aligned (sizeof(uint64_t)))); 145} __attribute__ ((aligned (sizeof(uint64_t))));
120 146
@@ -139,29 +165,66 @@ enum iscsi_err {
139 ISCSI_ERR_SESSION_FAILED = ISCSI_ERR_BASE + 13, 165 ISCSI_ERR_SESSION_FAILED = ISCSI_ERR_BASE + 13,
140 ISCSI_ERR_HDR_DGST = ISCSI_ERR_BASE + 14, 166 ISCSI_ERR_HDR_DGST = ISCSI_ERR_BASE + 14,
141 ISCSI_ERR_DATA_DGST = ISCSI_ERR_BASE + 15, 167 ISCSI_ERR_DATA_DGST = ISCSI_ERR_BASE + 15,
142 ISCSI_ERR_PARAM_NOT_FOUND = ISCSI_ERR_BASE + 16 168 ISCSI_ERR_PARAM_NOT_FOUND = ISCSI_ERR_BASE + 16,
169 ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17,
143}; 170};
144 171
145/* 172/*
146 * iSCSI Parameters (RFC3720) 173 * iSCSI Parameters (RFC3720)
147 */ 174 */
148enum iscsi_param { 175enum iscsi_param {
149 ISCSI_PARAM_MAX_RECV_DLENGTH = 0, 176 /* passed in using netlink set param */
150 ISCSI_PARAM_MAX_XMIT_DLENGTH = 1, 177 ISCSI_PARAM_MAX_RECV_DLENGTH,
151 ISCSI_PARAM_HDRDGST_EN = 2, 178 ISCSI_PARAM_MAX_XMIT_DLENGTH,
152 ISCSI_PARAM_DATADGST_EN = 3, 179 ISCSI_PARAM_HDRDGST_EN,
153 ISCSI_PARAM_INITIAL_R2T_EN = 4, 180 ISCSI_PARAM_DATADGST_EN,
154 ISCSI_PARAM_MAX_R2T = 5, 181 ISCSI_PARAM_INITIAL_R2T_EN,
155 ISCSI_PARAM_IMM_DATA_EN = 6, 182 ISCSI_PARAM_MAX_R2T,
156 ISCSI_PARAM_FIRST_BURST = 7, 183 ISCSI_PARAM_IMM_DATA_EN,
157 ISCSI_PARAM_MAX_BURST = 8, 184 ISCSI_PARAM_FIRST_BURST,
158 ISCSI_PARAM_PDU_INORDER_EN = 9, 185 ISCSI_PARAM_MAX_BURST,
159 ISCSI_PARAM_DATASEQ_INORDER_EN = 10, 186 ISCSI_PARAM_PDU_INORDER_EN,
160 ISCSI_PARAM_ERL = 11, 187 ISCSI_PARAM_DATASEQ_INORDER_EN,
161 ISCSI_PARAM_IFMARKER_EN = 12, 188 ISCSI_PARAM_ERL,
162 ISCSI_PARAM_OFMARKER_EN = 13, 189 ISCSI_PARAM_IFMARKER_EN,
190 ISCSI_PARAM_OFMARKER_EN,
191 ISCSI_PARAM_EXP_STATSN,
192 ISCSI_PARAM_TARGET_NAME,
193 ISCSI_PARAM_TPGT,
194 ISCSI_PARAM_PERSISTENT_ADDRESS,
195 ISCSI_PARAM_PERSISTENT_PORT,
196 ISCSI_PARAM_SESS_RECOVERY_TMO,
197
198 /* pased in through bind conn using transport_fd */
199 ISCSI_PARAM_CONN_PORT,
200 ISCSI_PARAM_CONN_ADDRESS,
201
202 /* must always be last */
203 ISCSI_PARAM_MAX,
163}; 204};
164#define ISCSI_PARAM_MAX 14 205
206#define ISCSI_MAX_RECV_DLENGTH (1 << ISCSI_PARAM_MAX_RECV_DLENGTH)
207#define ISCSI_MAX_XMIT_DLENGTH (1 << ISCSI_PARAM_MAX_XMIT_DLENGTH)
208#define ISCSI_HDRDGST_EN (1 << ISCSI_PARAM_HDRDGST_EN)
209#define ISCSI_DATADGST_EN (1 << ISCSI_PARAM_DATADGST_EN)
210#define ISCSI_INITIAL_R2T_EN (1 << ISCSI_PARAM_INITIAL_R2T_EN)
211#define ISCSI_MAX_R2T (1 << ISCSI_PARAM_MAX_R2T)
212#define ISCSI_IMM_DATA_EN (1 << ISCSI_PARAM_IMM_DATA_EN)
213#define ISCSI_FIRST_BURST (1 << ISCSI_PARAM_FIRST_BURST)
214#define ISCSI_MAX_BURST (1 << ISCSI_PARAM_MAX_BURST)
215#define ISCSI_PDU_INORDER_EN (1 << ISCSI_PARAM_PDU_INORDER_EN)
216#define ISCSI_DATASEQ_INORDER_EN (1 << ISCSI_PARAM_DATASEQ_INORDER_EN)
217#define ISCSI_ERL (1 << ISCSI_PARAM_ERL)
218#define ISCSI_IFMARKER_EN (1 << ISCSI_PARAM_IFMARKER_EN)
219#define ISCSI_OFMARKER_EN (1 << ISCSI_PARAM_OFMARKER_EN)
220#define ISCSI_EXP_STATSN (1 << ISCSI_PARAM_EXP_STATSN)
221#define ISCSI_TARGET_NAME (1 << ISCSI_PARAM_TARGET_NAME)
222#define ISCSI_TPGT (1 << ISCSI_PARAM_TPGT)
223#define ISCSI_PERSISTENT_ADDRESS (1 << ISCSI_PARAM_PERSISTENT_ADDRESS)
224#define ISCSI_PERSISTENT_PORT (1 << ISCSI_PARAM_PERSISTENT_PORT)
225#define ISCSI_SESS_RECOVERY_TMO (1 << ISCSI_PARAM_SESS_RECOVERY_TMO)
226#define ISCSI_CONN_PORT (1 << ISCSI_PARAM_CONN_PORT)
227#define ISCSI_CONN_ADDRESS (1 << ISCSI_PARAM_CONN_ADDRESS)
165 228
166#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) 229#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle)
167#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) 230#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr)
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index 4feda05fdf25..02f6e4b9e693 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -21,8 +21,6 @@
21#ifndef ISCSI_PROTO_H 21#ifndef ISCSI_PROTO_H
22#define ISCSI_PROTO_H 22#define ISCSI_PROTO_H
23 23
24#define ISCSI_VERSION_STR "0.3"
25#define ISCSI_DATE_STR "22-Apr-2005"
26#define ISCSI_DRAFT20_VERSION 0x00 24#define ISCSI_DRAFT20_VERSION 0x00
27 25
28/* default iSCSI listen port for incoming connections */ 26/* default iSCSI listen port for incoming connections */
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
new file mode 100644
index 000000000000..cbf7e58bd6f9
--- /dev/null
+++ b/include/scsi/libiscsi.h
@@ -0,0 +1,282 @@
1/*
2 * iSCSI lib definitions
3 *
4 * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
5 * Copyright (C) 2004 - 2006 Mike Christie
6 * Copyright (C) 2004 - 2005 Dmitry Yusupov
7 * Copyright (C) 2004 - 2005 Alex Aizman
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#ifndef LIBISCSI_H
24#define LIBISCSI_H
25
26#include <linux/types.h>
27#include <linux/mutex.h>
28#include <scsi/iscsi_proto.h>
29#include <scsi/iscsi_if.h>
30
31struct scsi_transport_template;
32struct scsi_device;
33struct Scsi_Host;
34struct scsi_cmnd;
35struct socket;
36struct iscsi_transport;
37struct iscsi_cls_session;
38struct iscsi_cls_conn;
39struct iscsi_session;
40struct iscsi_nopin;
41
42/* #define DEBUG_SCSI */
43#ifdef DEBUG_SCSI
44#define debug_scsi(fmt...) printk(KERN_INFO "iscsi: " fmt)
45#else
46#define debug_scsi(fmt...)
47#endif
48
49#define ISCSI_XMIT_CMDS_MAX 128 /* must be power of 2 */
50#define ISCSI_MGMT_CMDS_MAX 32 /* must be power of 2 */
51#define ISCSI_CONN_MAX 1
52
53#define ISCSI_MGMT_ITT_OFFSET 0xa00
54
55#define ISCSI_DEF_CMD_PER_LUN 32
56#define ISCSI_MAX_CMD_PER_LUN 128
57
58/* Task Mgmt states */
59#define TMABORT_INITIAL 0x0
60#define TMABORT_SUCCESS 0x1
61#define TMABORT_FAILED 0x2
62#define TMABORT_TIMEDOUT 0x3
63
64/* Connection suspend "bit" */
65#define ISCSI_SUSPEND_BIT 1
66
67#define ISCSI_ITT_MASK (0xfff)
68#define ISCSI_CID_SHIFT 12
69#define ISCSI_CID_MASK (0xffff << ISCSI_CID_SHIFT)
70#define ISCSI_AGE_SHIFT 28
71#define ISCSI_AGE_MASK (0xf << ISCSI_AGE_SHIFT)
72
73struct iscsi_mgmt_task {
74 /*
75 * Becuae LLDs allocate their hdr differently, this is a pointer to
76 * that storage. It must be setup at session creation time.
77 */
78 struct iscsi_hdr *hdr;
79 char *data; /* mgmt payload */
80 int data_count; /* counts data to be sent */
81 uint32_t itt; /* this ITT */
82 void *dd_data; /* driver/transport data */
83 struct list_head running;
84};
85
86struct iscsi_cmd_task {
87 /*
88 * Becuae LLDs allocate their hdr differently, this is a pointer to
89 * that storage. It must be setup at session creation time.
90 */
91 struct iscsi_cmd *hdr;
92 int itt; /* this ITT */
93 int datasn; /* DataSN */
94
95 uint32_t unsol_datasn;
96 int imm_count; /* imm-data (bytes) */
97 int unsol_count; /* unsolicited (bytes)*/
98 int data_count; /* remaining Data-Out */
99 struct scsi_cmnd *sc; /* associated SCSI cmd*/
100 int total_length;
101 struct iscsi_conn *conn; /* used connection */
102 struct iscsi_mgmt_task *mtask; /* tmf mtask in progr */
103
104 struct list_head running; /* running cmd list */
105 void *dd_data; /* driver/transport data */
106};
107
108struct iscsi_conn {
109 struct iscsi_cls_conn *cls_conn; /* ptr to class connection */
110 void *dd_data; /* iscsi_transport data */
111 struct iscsi_session *session; /* parent session */
112 /*
113 * LLDs should set this lock. It protects the transport recv
114 * code
115 */
116 rwlock_t *recv_lock;
117 /*
118 * conn_stop() flag: stop to recover, stop to terminate
119 */
120 int stop_stage;
121
122 /* iSCSI connection-wide sequencing */
123 uint32_t exp_statsn;
124
125 /* control data */
126 int id; /* CID */
127 struct list_head item; /* maintains list of conns */
128 int c_stage; /* connection state */
129 struct iscsi_mgmt_task *login_mtask; /* mtask used for login/text */
130 struct iscsi_mgmt_task *mtask; /* xmit mtask in progress */
131 struct iscsi_cmd_task *ctask; /* xmit ctask in progress */
132
133 /* xmit */
134 struct kfifo *immqueue; /* immediate xmit queue */
135 struct kfifo *mgmtqueue; /* mgmt (control) xmit queue */
136 struct list_head mgmt_run_list; /* list of control tasks */
137 struct kfifo *xmitqueue; /* data-path cmd queue */
138 struct list_head run_list; /* list of cmds in progress */
139 struct work_struct xmitwork; /* per-conn. xmit workqueue */
140 /*
141 * serializes connection xmit, access to kfifos:
142 * xmitqueue, immqueue, mgmtqueue
143 */
144 struct mutex xmitmutex;
145
146 unsigned long suspend_tx; /* suspend Tx */
147 unsigned long suspend_rx; /* suspend Rx */
148
149 /* abort */
150 wait_queue_head_t ehwait; /* used in eh_abort() */
151 struct iscsi_tm tmhdr;
152 struct timer_list tmabort_timer;
153 int tmabort_state; /* see TMABORT_INITIAL, etc.*/
154
155 /* negotiated params */
156 int max_recv_dlength; /* initiator_max_recv_dsl*/
157 int max_xmit_dlength; /* target_max_recv_dsl */
158 int hdrdgst_en;
159 int datadgst_en;
160
161 /* MIB-statistics */
162 uint64_t txdata_octets;
163 uint64_t rxdata_octets;
164 uint32_t scsicmd_pdus_cnt;
165 uint32_t dataout_pdus_cnt;
166 uint32_t scsirsp_pdus_cnt;
167 uint32_t datain_pdus_cnt;
168 uint32_t r2t_pdus_cnt;
169 uint32_t tmfcmd_pdus_cnt;
170 int32_t tmfrsp_pdus_cnt;
171
172 /* custom statistics */
173 uint32_t eh_abort_cnt;
174};
175
176struct iscsi_queue {
177 struct kfifo *queue; /* FIFO Queue */
178 void **pool; /* Pool of elements */
179 int max; /* Max number of elements */
180};
181
182struct iscsi_session {
183 /* iSCSI session-wide sequencing */
184 uint32_t cmdsn;
185 uint32_t exp_cmdsn;
186 uint32_t max_cmdsn;
187
188 /* configuration */
189 int initial_r2t_en;
190 int max_r2t;
191 int imm_data_en;
192 int first_burst;
193 int max_burst;
194 int time2wait;
195 int time2retain;
196 int pdu_inorder_en;
197 int dataseq_inorder_en;
198 int erl;
199 int ifmarker_en;
200 int ofmarker_en;
201
202 /* control data */
203 struct iscsi_transport *tt;
204 struct Scsi_Host *host;
205 struct iscsi_conn *leadconn; /* leading connection */
206 spinlock_t lock; /* protects session state, *
207 * sequence numbers, *
208 * session resources: *
209 * - cmdpool, *
210 * - mgmtpool, *
211 * - r2tpool */
212 int state; /* session state */
213 struct list_head item;
214 int age; /* counts session re-opens */
215
216 struct list_head connections; /* list of connections */
217 int cmds_max; /* size of cmds array */
218 struct iscsi_cmd_task **cmds; /* Original Cmds arr */
219 struct iscsi_queue cmdpool; /* PDU's pool */
220 int mgmtpool_max; /* size of mgmt array */
221 struct iscsi_mgmt_task **mgmt_cmds; /* Original mgmt arr */
222 struct iscsi_queue mgmtpool; /* Mgmt PDU's pool */
223};
224
225/*
226 * scsi host template
227 */
228extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth);
229extern int iscsi_eh_abort(struct scsi_cmnd *sc);
230extern int iscsi_eh_host_reset(struct scsi_cmnd *sc);
231extern int iscsi_queuecommand(struct scsi_cmnd *sc,
232 void (*done)(struct scsi_cmnd *));
233
234/*
235 * session management
236 */
237extern struct iscsi_cls_session *
238iscsi_session_setup(struct iscsi_transport *, struct scsi_transport_template *,
239 int, int, uint32_t, uint32_t *);
240extern void iscsi_session_teardown(struct iscsi_cls_session *);
241extern struct iscsi_session *class_to_transport_session(struct iscsi_cls_session *);
242extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *);
243
244#define session_to_cls(_sess) \
245 hostdata_session(_sess->host->hostdata)
246
247/*
248 * connection management
249 */
250extern struct iscsi_cls_conn *iscsi_conn_setup(struct iscsi_cls_session *,
251 uint32_t);
252extern void iscsi_conn_teardown(struct iscsi_cls_conn *);
253extern int iscsi_conn_start(struct iscsi_cls_conn *);
254extern void iscsi_conn_stop(struct iscsi_cls_conn *, int);
255extern int iscsi_conn_bind(struct iscsi_cls_session *, struct iscsi_cls_conn *,
256 int);
257extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err);
258
259/*
260 * pdu and task processing
261 */
262extern int iscsi_check_assign_cmdsn(struct iscsi_session *,
263 struct iscsi_nopin *);
264extern void iscsi_prep_unsolicit_data_pdu(struct iscsi_cmd_task *,
265 struct iscsi_data *hdr,
266 int transport_data_cnt);
267extern int iscsi_conn_send_pdu(struct iscsi_cls_conn *, struct iscsi_hdr *,
268 char *, uint32_t);
269extern int iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *,
270 char *, int);
271extern int __iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *,
272 char *, int);
273extern int iscsi_verify_itt(struct iscsi_conn *, struct iscsi_hdr *,
274 uint32_t *);
275
276/*
277 * generic helpers
278 */
279extern void iscsi_pool_free(struct iscsi_queue *, void **);
280extern int iscsi_pool_init(struct iscsi_queue *, int, void ***, int);
281
282#endif
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 1ace1b9fe537..e46cd404bd7d 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -9,7 +9,6 @@
9struct request; 9struct request;
10struct scatterlist; 10struct scatterlist;
11struct scsi_device; 11struct scsi_device;
12struct scsi_request;
13 12
14 13
15/* embedded in scsi_cmnd */ 14/* embedded in scsi_cmnd */
@@ -29,13 +28,8 @@ struct scsi_pointer {
29}; 28};
30 29
31struct scsi_cmnd { 30struct scsi_cmnd {
32 int sc_magic;
33
34 struct scsi_device *device; 31 struct scsi_device *device;
35 struct scsi_request *sc_request;
36
37 struct list_head list; /* scsi_cmnd participates in queue lists */ 32 struct list_head list; /* scsi_cmnd participates in queue lists */
38
39 struct list_head eh_entry; /* entry for the host eh_cmd_q */ 33 struct list_head eh_entry; /* entry for the host eh_cmd_q */
40 int eh_eflags; /* Used by error handlr */ 34 int eh_eflags; /* Used by error handlr */
41 void (*done) (struct scsi_cmnd *); /* Mid-level done function */ 35 void (*done) (struct scsi_cmnd *); /* Mid-level done function */
@@ -151,5 +145,10 @@ extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t);
151extern void scsi_put_command(struct scsi_cmnd *); 145extern void scsi_put_command(struct scsi_cmnd *);
152extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); 146extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int);
153extern void scsi_finish_command(struct scsi_cmnd *cmd); 147extern void scsi_finish_command(struct scsi_cmnd *cmd);
148extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd);
149
150extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count,
151 size_t *offset, size_t *len);
152extern void scsi_kunmap_atomic_sg(void *virt);
154 153
155#endif /* _SCSI_SCSI_CMND_H */ 154#endif /* _SCSI_SCSI_CMND_H */
diff --git a/include/scsi/scsi_dbg.h b/include/scsi/scsi_dbg.h
index 4d69dee66d4d..3bbbfbe8cbfc 100644
--- a/include/scsi/scsi_dbg.h
+++ b/include/scsi/scsi_dbg.h
@@ -2,14 +2,12 @@
2#define _SCSI_SCSI_DBG_H 2#define _SCSI_SCSI_DBG_H
3 3
4struct scsi_cmnd; 4struct scsi_cmnd;
5struct scsi_request;
6struct scsi_sense_hdr; 5struct scsi_sense_hdr;
7 6
8extern void scsi_print_command(struct scsi_cmnd *); 7extern void scsi_print_command(struct scsi_cmnd *);
9extern void scsi_print_sense_hdr(const char *, struct scsi_sense_hdr *); 8extern void scsi_print_sense_hdr(const char *, struct scsi_sense_hdr *);
10extern void __scsi_print_command(unsigned char *); 9extern void __scsi_print_command(unsigned char *);
11extern void scsi_print_sense(const char *, struct scsi_cmnd *); 10extern void scsi_print_sense(const char *, struct scsi_cmnd *);
12extern void scsi_print_req_sense(const char *, struct scsi_request *);
13extern void __scsi_print_sense(const char *name, 11extern void __scsi_print_sense(const char *name,
14 const unsigned char *sense_buffer, 12 const unsigned char *sense_buffer,
15 int sense_len); 13 int sense_len);
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h
index d31b16d25a09..b4ddd3b18b4c 100644
--- a/include/scsi/scsi_devinfo.h
+++ b/include/scsi/scsi_devinfo.h
@@ -29,4 +29,5 @@
29#define BLIST_SELECT_NO_ATN 0x200000 /* select without ATN */ 29#define BLIST_SELECT_NO_ATN 0x200000 /* select without ATN */
30#define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */ 30#define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */
31#define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */ 31#define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */
32#define BLIST_ATTACH_PQ3 0x1000000 /* Scan: Attach to PQ3 devices */
32#endif 33#endif
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
index d160880b2a87..c5c0f6762a01 100644
--- a/include/scsi/scsi_eh.h
+++ b/include/scsi/scsi_eh.h
@@ -3,7 +3,6 @@
3 3
4struct scsi_cmnd; 4struct scsi_cmnd;
5struct scsi_device; 5struct scsi_device;
6struct scsi_request;
7struct Scsi_Host; 6struct Scsi_Host;
8 7
9/* 8/*
@@ -43,8 +42,6 @@ extern void scsi_report_device_reset(struct Scsi_Host *, int, int);
43extern int scsi_block_when_processing_errors(struct scsi_device *); 42extern int scsi_block_when_processing_errors(struct scsi_device *);
44extern int scsi_normalize_sense(const u8 *sense_buffer, int sb_len, 43extern int scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
45 struct scsi_sense_hdr *sshdr); 44 struct scsi_sense_hdr *sshdr);
46extern int scsi_request_normalize_sense(struct scsi_request *sreq,
47 struct scsi_sense_hdr *sshdr);
48extern int scsi_command_normalize_sense(struct scsi_cmnd *cmd, 45extern int scsi_command_normalize_sense(struct scsi_cmnd *cmd,
49 struct scsi_sense_hdr *sshdr); 46 struct scsi_sense_hdr *sshdr);
50 47
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index de6ce541a046..a42efd6e4be8 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -472,6 +472,7 @@ struct Scsi_Host {
472 */ 472 */
473 unsigned int host_busy; /* commands actually active on low-level */ 473 unsigned int host_busy; /* commands actually active on low-level */
474 unsigned int host_failed; /* commands that failed. */ 474 unsigned int host_failed; /* commands that failed. */
475 unsigned int host_eh_scheduled; /* EH scheduled without command */
475 476
476 unsigned short host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */ 477 unsigned short host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */
477 int resetting; /* if set, it means that last_reset is a valid value */ 478 int resetting; /* if set, it means that last_reset is a valid value */
diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h
deleted file mode 100644
index 98d69fdb851c..000000000000
--- a/include/scsi/scsi_request.h
+++ /dev/null
@@ -1,54 +0,0 @@
1#ifndef _SCSI_SCSI_REQUEST_H
2#define _SCSI_SCSI_REQUEST_H
3
4#include <scsi/scsi_cmnd.h>
5
6struct request;
7struct scsi_cmnd;
8struct scsi_device;
9struct Scsi_Host;
10
11
12/*
13 * This is essentially a slimmed down version of Scsi_Cmnd. The point of
14 * having this is that requests that are injected into the queue as result
15 * of things like ioctls and character devices shouldn't be using a
16 * Scsi_Cmnd until such a time that the command is actually at the head
17 * of the queue and being sent to the driver.
18 */
19struct scsi_request {
20 int sr_magic;
21 int sr_result; /* Status code from lower level driver */
22 unsigned char sr_sense_buffer[SCSI_SENSE_BUFFERSIZE]; /* obtained by REQUEST SENSE
23 * when CHECK CONDITION is
24 * received on original command
25 * (auto-sense) */
26
27 struct Scsi_Host *sr_host;
28 struct scsi_device *sr_device;
29 struct scsi_cmnd *sr_command;
30 struct request *sr_request; /* A copy of the command we are
31 working on */
32 unsigned sr_bufflen; /* Size of data buffer */
33 void *sr_buffer; /* Data buffer */
34 int sr_allowed;
35 enum dma_data_direction sr_data_direction;
36 unsigned char sr_cmd_len;
37 unsigned char sr_cmnd[MAX_COMMAND_SIZE];
38 void (*sr_done) (struct scsi_cmnd *); /* Mid-level done function */
39 int sr_timeout_per_command;
40 unsigned short sr_use_sg; /* Number of pieces of scatter-gather */
41 unsigned short sr_sglist_len; /* size of malloc'd scatter-gather list */
42 unsigned sr_underflow; /* Return error if less than
43 this amount is transferred */
44 void *upper_private_data; /* reserved for owner (usually upper
45 level driver) of this request */
46};
47
48extern struct scsi_request *scsi_allocate_request(struct scsi_device *, gfp_t);
49extern void scsi_release_request(struct scsi_request *);
50extern void scsi_do_req(struct scsi_request *, const void *cmnd,
51 void *buffer, unsigned bufflen,
52 void (*done) (struct scsi_cmnd *),
53 int timeout, int retries);
54#endif /* _SCSI_SCSI_REQUEST_H */
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 5626225bd3ae..6d28b0317657 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -27,7 +27,6 @@
27#ifndef SCSI_TRANSPORT_FC_H 27#ifndef SCSI_TRANSPORT_FC_H
28#define SCSI_TRANSPORT_FC_H 28#define SCSI_TRANSPORT_FC_H
29 29
30#include <linux/config.h>
31#include <linux/sched.h> 30#include <linux/sched.h>
32#include <scsi/scsi.h> 31#include <scsi/scsi.h>
33 32
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index b41cf077e54b..b684426a5900 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -2,7 +2,7 @@
2 * iSCSI transport class definitions 2 * iSCSI transport class definitions
3 * 3 *
4 * Copyright (C) IBM Corporation, 2004 4 * Copyright (C) IBM Corporation, 2004
5 * Copyright (C) Mike Christie, 2004 - 2005 5 * Copyright (C) Mike Christie, 2004 - 2006
6 * Copyright (C) Dmitry Yusupov, 2004 - 2005 6 * Copyright (C) Dmitry Yusupov, 2004 - 2005
7 * Copyright (C) Alex Aizman, 2004 - 2005 7 * Copyright (C) Alex Aizman, 2004 - 2005
8 * 8 *
@@ -27,9 +27,13 @@
27#include <scsi/iscsi_if.h> 27#include <scsi/iscsi_if.h>
28 28
29struct scsi_transport_template; 29struct scsi_transport_template;
30struct iscsi_transport;
30struct Scsi_Host; 31struct Scsi_Host;
31struct mempool_zone; 32struct mempool_zone;
32struct iscsi_cls_conn; 33struct iscsi_cls_conn;
34struct iscsi_conn;
35struct iscsi_cmd_task;
36struct iscsi_mgmt_task;
33 37
34/** 38/**
35 * struct iscsi_transport - iSCSI Transport template 39 * struct iscsi_transport - iSCSI Transport template
@@ -46,6 +50,24 @@ struct iscsi_cls_conn;
46 * @start_conn: set connection to be operational 50 * @start_conn: set connection to be operational
47 * @stop_conn: suspend/recover/terminate connection 51 * @stop_conn: suspend/recover/terminate connection
48 * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text. 52 * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text.
53 * @session_recovery_timedout: notify LLD a block during recovery timed out
54 * @suspend_conn_recv: susepend the recv side of the connection
55 * @termincate_conn: destroy socket connection. Called with mutex lock.
56 * @init_cmd_task: Initialize a iscsi_cmd_task and any internal structs.
57 * Called from queuecommand with session lock held.
58 * @init_mgmt_task: Initialize a iscsi_mgmt_task and any internal structs.
59 * Called from iscsi_conn_send_generic with xmitmutex.
60 * @xmit_cmd_task: Requests LLD to transfer cmd task. Returns 0 or the
61 * the number of bytes transferred on success, and -Exyz
62 * value on error.
63 * @xmit_mgmt_task: Requests LLD to transfer mgmt task. Returns 0 or the
64 * the number of bytes transferred on success, and -Exyz
65 * value on error.
66 * @cleanup_cmd_task: requests LLD to fail cmd task. Called with xmitmutex
67 * and session->lock after the connection has been
68 * suspended and terminated during recovery. If called
69 * from abort task then connection is not suspended
70 * or terminated but sk_callback_lock is held
49 * 71 *
50 * Template API provided by iSCSI Transport 72 * Template API provided by iSCSI Transport
51 */ 73 */
@@ -53,38 +75,58 @@ struct iscsi_transport {
53 struct module *owner; 75 struct module *owner;
54 char *name; 76 char *name;
55 unsigned int caps; 77 unsigned int caps;
78 /* LLD sets this to indicate what values it can export to sysfs */
79 unsigned int param_mask;
56 struct scsi_host_template *host_template; 80 struct scsi_host_template *host_template;
57 /* LLD session/scsi_host data size */
58 int hostdata_size;
59 /* LLD iscsi_host data size */
60 int ihostdata_size;
61 /* LLD connection data size */ 81 /* LLD connection data size */
62 int conndata_size; 82 int conndata_size;
83 /* LLD session data size */
84 int sessiondata_size;
63 int max_lun; 85 int max_lun;
64 unsigned int max_conn; 86 unsigned int max_conn;
65 unsigned int max_cmd_len; 87 unsigned int max_cmd_len;
66 struct iscsi_cls_session *(*create_session) 88 struct iscsi_cls_session *(*create_session) (struct iscsi_transport *it,
67 (struct scsi_transport_template *t, uint32_t sn, uint32_t *sid); 89 struct scsi_transport_template *t, uint32_t sn, uint32_t *hn);
68 void (*destroy_session) (struct iscsi_cls_session *session); 90 void (*destroy_session) (struct iscsi_cls_session *session);
69 struct iscsi_cls_conn *(*create_conn) (struct iscsi_cls_session *sess, 91 struct iscsi_cls_conn *(*create_conn) (struct iscsi_cls_session *sess,
70 uint32_t cid); 92 uint32_t cid);
71 int (*bind_conn) (struct iscsi_cls_session *session, 93 int (*bind_conn) (struct iscsi_cls_session *session,
72 struct iscsi_cls_conn *cls_conn, 94 struct iscsi_cls_conn *cls_conn,
73 uint32_t transport_fd, int is_leading); 95 uint64_t transport_eph, int is_leading);
74 int (*start_conn) (struct iscsi_cls_conn *conn); 96 int (*start_conn) (struct iscsi_cls_conn *conn);
75 void (*stop_conn) (struct iscsi_cls_conn *conn, int flag); 97 void (*stop_conn) (struct iscsi_cls_conn *conn, int flag);
76 void (*destroy_conn) (struct iscsi_cls_conn *conn); 98 void (*destroy_conn) (struct iscsi_cls_conn *conn);
77 int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param, 99 int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param,
78 uint32_t value); 100 uint32_t value);
79 int (*get_conn_param) (struct iscsi_cls_conn *conn, 101 int (*get_conn_param) (struct iscsi_cls_conn *conn,
80 enum iscsi_param param, 102 enum iscsi_param param, uint32_t *value);
81 uint32_t *value);
82 int (*get_session_param) (struct iscsi_cls_session *session, 103 int (*get_session_param) (struct iscsi_cls_session *session,
83 enum iscsi_param param, uint32_t *value); 104 enum iscsi_param param, uint32_t *value);
105 int (*get_conn_str_param) (struct iscsi_cls_conn *conn,
106 enum iscsi_param param, char *buf);
107 int (*get_session_str_param) (struct iscsi_cls_session *session,
108 enum iscsi_param param, char *buf);
84 int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, 109 int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
85 char *data, uint32_t data_size); 110 char *data, uint32_t data_size);
86 void (*get_stats) (struct iscsi_cls_conn *conn, 111 void (*get_stats) (struct iscsi_cls_conn *conn,
87 struct iscsi_stats *stats); 112 struct iscsi_stats *stats);
113 void (*suspend_conn_recv) (struct iscsi_conn *conn);
114 void (*terminate_conn) (struct iscsi_conn *conn);
115 void (*init_cmd_task) (struct iscsi_cmd_task *ctask);
116 void (*init_mgmt_task) (struct iscsi_conn *conn,
117 struct iscsi_mgmt_task *mtask,
118 char *data, uint32_t data_size);
119 int (*xmit_cmd_task) (struct iscsi_conn *conn,
120 struct iscsi_cmd_task *ctask);
121 void (*cleanup_cmd_task) (struct iscsi_conn *conn,
122 struct iscsi_cmd_task *ctask);
123 int (*xmit_mgmt_task) (struct iscsi_conn *conn,
124 struct iscsi_mgmt_task *mtask);
125 void (*session_recovery_timedout) (struct iscsi_cls_session *session);
126 int (*ep_connect) (struct sockaddr *dst_addr, int non_blocking,
127 uint64_t *ep_handle);
128 int (*ep_poll) (uint64_t ep_handle, int timeout_ms);
129 void (*ep_disconnect) (uint64_t ep_handle);
88}; 130};
89 131
90/* 132/*
@@ -100,10 +142,26 @@ extern void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error);
100extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, 142extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
101 char *data, uint32_t data_size); 143 char *data, uint32_t data_size);
102 144
145
146/* Connection's states */
147#define ISCSI_CONN_INITIAL_STAGE 0
148#define ISCSI_CONN_STARTED 1
149#define ISCSI_CONN_STOPPED 2
150#define ISCSI_CONN_CLEANUP_WAIT 3
151
103struct iscsi_cls_conn { 152struct iscsi_cls_conn {
104 struct list_head conn_list; /* item in connlist */ 153 struct list_head conn_list; /* item in connlist */
105 void *dd_data; /* LLD private data */ 154 void *dd_data; /* LLD private data */
106 struct iscsi_transport *transport; 155 struct iscsi_transport *transport;
156 uint32_t cid; /* connection id */
157
158 /* portal/group values we got during discovery */
159 char *persistent_address;
160 int persistent_port;
161 /* portal/group values we are currently using */
162 char *address;
163 int port;
164
107 int active; /* must be accessed with the connlock */ 165 int active; /* must be accessed with the connlock */
108 struct device dev; /* sysfs transport/container device */ 166 struct device dev; /* sysfs transport/container device */
109 struct mempool_zone *z_error; 167 struct mempool_zone *z_error;
@@ -114,9 +172,32 @@ struct iscsi_cls_conn {
114#define iscsi_dev_to_conn(_dev) \ 172#define iscsi_dev_to_conn(_dev) \
115 container_of(_dev, struct iscsi_cls_conn, dev) 173 container_of(_dev, struct iscsi_cls_conn, dev)
116 174
175/* Session's states */
176#define ISCSI_STATE_FREE 1
177#define ISCSI_STATE_LOGGED_IN 2
178#define ISCSI_STATE_FAILED 3
179#define ISCSI_STATE_TERMINATE 4
180#define ISCSI_STATE_IN_RECOVERY 5
181#define ISCSI_STATE_RECOVERY_FAILED 6
182
117struct iscsi_cls_session { 183struct iscsi_cls_session {
118 struct list_head sess_list; /* item in session_list */ 184 struct list_head sess_list; /* item in session_list */
185 struct list_head host_list;
119 struct iscsi_transport *transport; 186 struct iscsi_transport *transport;
187
188 /* iSCSI values used as unique id by userspace. */
189 char *targetname;
190 int tpgt;
191
192 /* recovery fields */
193 int recovery_tmo;
194 struct work_struct recovery_work;
195
196 int target_id;
197 int channel;
198
199 int sid; /* session id */
200 void *dd_data; /* LLD private data */
120 struct device dev; /* sysfs transport/container device */ 201 struct device dev; /* sysfs transport/container device */
121}; 202};
122 203
@@ -126,22 +207,22 @@ struct iscsi_cls_session {
126#define iscsi_session_to_shost(_session) \ 207#define iscsi_session_to_shost(_session) \
127 dev_to_shost(_session->dev.parent) 208 dev_to_shost(_session->dev.parent)
128 209
210struct iscsi_host {
211 int next_target_id;
212 struct list_head sessions;
213 struct mutex mutex;
214};
215
129/* 216/*
130 * session and connection functions that can be used by HW iSCSI LLDs 217 * session and connection functions that can be used by HW iSCSI LLDs
131 */ 218 */
132extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, 219extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost,
133 struct iscsi_transport *t); 220 struct iscsi_transport *t, int channel);
134extern int iscsi_destroy_session(struct iscsi_cls_session *session); 221extern int iscsi_destroy_session(struct iscsi_cls_session *session);
135extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, 222extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess,
136 uint32_t cid); 223 uint32_t cid);
137extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn); 224extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn);
138 225extern void iscsi_unblock_session(struct iscsi_cls_session *session);
139/* 226extern void iscsi_block_session(struct iscsi_cls_session *session);
140 * session functions used by software iscsi
141 */
142extern struct Scsi_Host *
143iscsi_transport_create_session(struct scsi_transport_template *scsit,
144 struct iscsi_transport *transport);
145extern int iscsi_transport_destroy_session(struct Scsi_Host *shost);
146 227
147#endif 228#endif
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h
index 5e1d61913d4e..302680c0c0de 100644
--- a/include/scsi/scsi_transport_spi.h
+++ b/include/scsi/scsi_transport_spi.h
@@ -20,7 +20,6 @@
20#ifndef SCSI_TRANSPORT_SPI_H 20#ifndef SCSI_TRANSPORT_SPI_H
21#define SCSI_TRANSPORT_SPI_H 21#define SCSI_TRANSPORT_SPI_H
22 22
23#include <linux/config.h>
24#include <linux/transport_class.h> 23#include <linux/transport_class.h>
25#include <linux/mutex.h> 24#include <linux/mutex.h>
26 25
diff --git a/include/scsi/sg_request.h b/include/scsi/sg_request.h
deleted file mode 100644
index 57ff525bdd3b..000000000000
--- a/include/scsi/sg_request.h
+++ /dev/null
@@ -1,26 +0,0 @@
1typedef struct scsi_request Scsi_Request;
2
3static Scsi_Request *dummy_cmdp; /* only used for sizeof */
4
5typedef struct sg_scatter_hold { /* holding area for scsi scatter gather info */
6 unsigned short k_use_sg; /* Count of kernel scatter-gather pieces */
7 unsigned short sglist_len; /* size of malloc'd scatter-gather list ++ */
8 unsigned bufflen; /* Size of (aggregate) data buffer */
9 unsigned b_malloc_len; /* actual len malloc'ed in buffer */
10 void *buffer; /* Data buffer or scatter list (k_use_sg>0) */
11 char dio_in_use; /* 0->indirect IO (or mmap), 1->dio */
12 unsigned char cmd_opcode; /* first byte of command */
13} Sg_scatter_hold;
14
15typedef struct sg_request { /* SG_MAX_QUEUE requests outstanding per file */
16 Scsi_Request *my_cmdp; /* != 0 when request with lower levels */
17 struct sg_request *nextrp; /* NULL -> tail request (slist) */
18 struct sg_fd *parentfp; /* NULL -> not in use */
19 Sg_scatter_hold data; /* hold buffer, perhaps scatter list */
20 sg_io_hdr_t header; /* scsi command+info, see <scsi/sg.h> */
21 unsigned char sense_b[sizeof (dummy_cmdp->sr_sense_buffer)];
22 char res_used; /* 1 -> using reserve buffer, 0 -> not ... */
23 char orphan; /* 1 -> drop on sight, 0 -> normal */
24 char sg_io_owned; /* 1 -> packet belongs to SG_IO */
25 volatile char done; /* 0->before bh, 1->before read, 2->read */
26} Sg_request;
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index b45a73712748..446afc3ea27f 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -378,6 +378,7 @@
378#define AC97_HAS_NO_MIC (1<<15) /* no MIC volume */ 378#define AC97_HAS_NO_MIC (1<<15) /* no MIC volume */
379#define AC97_HAS_NO_TONE (1<<16) /* no Tone volume */ 379#define AC97_HAS_NO_TONE (1<<16) /* no Tone volume */
380#define AC97_HAS_NO_STD_PCM (1<<17) /* no standard AC97 PCM volume and mute */ 380#define AC97_HAS_NO_STD_PCM (1<<17) /* no standard AC97 PCM volume and mute */
381#define AC97_HAS_NO_AUX (1<<18) /* no standard AC97 AUX volume and mute */
381 382
382/* rates indexes */ 383/* rates indexes */
383#define AC97_RATES_FRONT_DAC 0 384#define AC97_RATES_FRONT_DAC 0
diff --git a/include/sound/asequencer.h b/include/sound/asequencer.h
index 6691e4aa4ea7..3f2f4042a20d 100644
--- a/include/sound/asequencer.h
+++ b/include/sound/asequencer.h
@@ -605,6 +605,10 @@ struct snd_seq_remove_events {
605#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */ 605#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
606#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */ 606#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
607/*...*/ 607/*...*/
608#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
609#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
610#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
611#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
608#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */ 612#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
609 613
610/* misc. conditioning flags */ 614/* misc. conditioning flags */
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 9cc021c7ee11..41885f48ad91 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -137,7 +137,7 @@ enum {
137 * * 137 * *
138 *****************************************************************************/ 138 *****************************************************************************/
139 139
140#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) 140#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8)
141 141
142typedef unsigned long snd_pcm_uframes_t; 142typedef unsigned long snd_pcm_uframes_t;
143typedef signed long snd_pcm_sframes_t; 143typedef signed long snd_pcm_sframes_t;
diff --git a/include/sound/core.h b/include/sound/core.h
index 5135147f20e8..5d184be0ff72 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -233,9 +233,8 @@ int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size
233 233
234/* init.c */ 234/* init.c */
235 235
236extern unsigned int snd_cards_lock;
237extern struct snd_card *snd_cards[SNDRV_CARDS]; 236extern struct snd_card *snd_cards[SNDRV_CARDS];
238extern rwlock_t snd_card_rwlock; 237int snd_card_locked(int card);
239#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) 238#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
240#define SND_MIXER_OSS_NOTIFY_REGISTER 0 239#define SND_MIXER_OSS_NOTIFY_REGISTER 0
241#define SND_MIXER_OSS_NOTIFY_DISCONNECT 1 240#define SND_MIXER_OSS_NOTIFY_DISCONNECT 1
diff --git a/include/sound/driver.h b/include/sound/driver.h
index 89c6a73f3920..3c522e59a33c 100644
--- a/include/sound/driver.h
+++ b/include/sound/driver.h
@@ -26,7 +26,6 @@
26#include "config.h" 26#include "config.h"
27#endif 27#endif
28 28
29#include <linux/config.h>
30 29
31/* number of supported soundcards */ 30/* number of supported soundcards */
32#ifdef CONFIG_SND_DYNAMIC_MINORS 31#ifdef CONFIG_SND_DYNAMIC_MINORS
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 186e00ad9e79..884bbf54cd36 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -245,6 +245,7 @@
245#define A_IOCFG_GPOUT0 0x0044 /* analog/digital */ 245#define A_IOCFG_GPOUT0 0x0044 /* analog/digital */
246#define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */ 246#define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */
247#define A_IOCFG_ENABLE_DIGITAL 0x0004 247#define A_IOCFG_ENABLE_DIGITAL 0x0004
248#define A_IOCFG_ENABLE_DIGITAL_AUDIGY4 0x0080
248#define A_IOCFG_UNKNOWN_20 0x0020 249#define A_IOCFG_UNKNOWN_20 0x0020
249#define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */ 250#define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */
250#define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?) */ 251#define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?) */
@@ -1065,6 +1066,7 @@ struct snd_emu_chip_details {
1065 unsigned char emu1212m; /* EMU 1212m card */ 1066 unsigned char emu1212m; /* EMU 1212m card */
1066 unsigned char spi_dac; /* SPI interface for DAC */ 1067 unsigned char spi_dac; /* SPI interface for DAC */
1067 unsigned char i2c_adc; /* I2C interface for ADC */ 1068 unsigned char i2c_adc; /* I2C interface for ADC */
1069 unsigned char adc_1361t; /* Use Philips 1361T ADC */
1068 const char *driver; 1070 const char *driver;
1069 const char *name; 1071 const char *name;
1070 const char *id; /* for backward compatibility - can be NULL if not needed */ 1072 const char *id; /* for backward compatibility - can be NULL if not needed */
diff --git a/include/sound/hdsp.h b/include/sound/hdsp.h
index 25e1951a9955..dec6b1dc37ea 100644
--- a/include/sound/hdsp.h
+++ b/include/sound/hdsp.h
@@ -30,13 +30,13 @@ enum HDSP_IO_Type {
30}; 30};
31 31
32struct hdsp_peak_rms { 32struct hdsp_peak_rms {
33 u32 input_peaks[26]; 33 __u32 input_peaks[26];
34 u32 playback_peaks[26]; 34 __u32 playback_peaks[26];
35 u32 output_peaks[28]; 35 __u32 output_peaks[28];
36 u64 input_rms[26]; 36 __u64 input_rms[26];
37 u64 playback_rms[26]; 37 __u64 playback_rms[26];
38 /* These are only used for H96xx cards */ 38 /* These are only used for H96xx cards */
39 u64 output_rms[26]; 39 __u64 output_rms[26];
40}; 40};
41 41
42#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms) 42#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms)
diff --git a/include/sound/info.h b/include/sound/info.h
index f23d8381c216..74f6996769c7 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -27,9 +27,9 @@
27/* buffer for information */ 27/* buffer for information */
28struct snd_info_buffer { 28struct snd_info_buffer {
29 char *buffer; /* pointer to begin of buffer */ 29 char *buffer; /* pointer to begin of buffer */
30 char *curr; /* current position in buffer */ 30 unsigned int curr; /* current position in buffer */
31 unsigned long size; /* current size */ 31 unsigned int size; /* current size */
32 unsigned long len; /* total length of buffer */ 32 unsigned int len; /* total length of buffer */
33 int stop; /* stop flag */ 33 int stop; /* stop flag */
34 int error; /* error code */ 34 int error; /* error code */
35}; 35};
@@ -40,8 +40,6 @@ struct snd_info_buffer {
40struct snd_info_entry; 40struct snd_info_entry;
41 41
42struct snd_info_entry_text { 42struct snd_info_entry_text {
43 unsigned long read_size;
44 unsigned long write_size;
45 void (*read) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); 43 void (*read) (struct snd_info_entry *entry, struct snd_info_buffer *buffer);
46 void (*write) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); 44 void (*write) (struct snd_info_entry *entry, struct snd_info_buffer *buffer);
47}; 45};
@@ -132,11 +130,9 @@ int snd_card_proc_new(struct snd_card *card, const char *name, struct snd_info_e
132 130
133static inline void snd_info_set_text_ops(struct snd_info_entry *entry, 131static inline void snd_info_set_text_ops(struct snd_info_entry *entry,
134 void *private_data, 132 void *private_data,
135 long read_size,
136 void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) 133 void (*read)(struct snd_info_entry *, struct snd_info_buffer *))
137{ 134{
138 entry->private_data = private_data; 135 entry->private_data = private_data;
139 entry->c.text.read_size = read_size;
140 entry->c.text.read = read; 136 entry->c.text.read = read;
141} 137}
142 138
@@ -167,7 +163,6 @@ static inline int snd_card_proc_new(struct snd_card *card, const char *name,
167 struct snd_info_entry **entryp) { return -EINVAL; } 163 struct snd_info_entry **entryp) { return -EINVAL; }
168static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)), 164static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)),
169 void *private_data, 165 void *private_data,
170 long read_size,
171 void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {} 166 void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {}
172 167
173static inline int snd_info_check_reserved_words(const char *str) { return 1; } 168static inline int snd_info_check_reserved_words(const char *str) { return 1; }
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h
index 8e97ace78f16..ac504321ea56 100644
--- a/include/sound/mpu401.h
+++ b/include/sound/mpu401.h
@@ -45,6 +45,12 @@
45#define MPU401_HW_PC98II 18 /* Roland PC98II */ 45#define MPU401_HW_PC98II 18 /* Roland PC98II */
46#define MPU401_HW_AUREAL 19 /* Aureal Vortex */ 46#define MPU401_HW_AUREAL 19 /* Aureal Vortex */
47 47
48#define MPU401_INFO_INPUT (1 << 0) /* input stream */
49#define MPU401_INFO_OUTPUT (1 << 1) /* output stream */
50#define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */
51#define MPU401_INFO_MMIO (1 << 3) /* MMIO access */
52#define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */
53
48#define MPU401_MODE_BIT_INPUT 0 54#define MPU401_MODE_BIT_INPUT 0
49#define MPU401_MODE_BIT_OUTPUT 1 55#define MPU401_MODE_BIT_OUTPUT 1
50#define MPU401_MODE_BIT_INPUT_TRIGGER 2 56#define MPU401_MODE_BIT_INPUT_TRIGGER 2
@@ -62,6 +68,7 @@ struct snd_mpu401 {
62 struct snd_rawmidi *rmidi; 68 struct snd_rawmidi *rmidi;
63 69
64 unsigned short hardware; /* MPU401_HW_XXXX */ 70 unsigned short hardware; /* MPU401_HW_XXXX */
71 unsigned int info_flags; /* MPU401_INFO_XXX */
65 unsigned long port; /* base port of MPU-401 chip */ 72 unsigned long port; /* base port of MPU-401 chip */
66 unsigned long cport; /* port + 1 (usually) */ 73 unsigned long cport; /* port + 1 (usually) */
67 struct resource *res; /* port resource */ 74 struct resource *res; /* port resource */
@@ -99,13 +106,16 @@ struct snd_mpu401 {
99 106
100 */ 107 */
101 108
102irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs); 109irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id,
110 struct pt_regs *regs);
111irqreturn_t snd_mpu401_uart_interrupt_tx(int irq, void *dev_id,
112 struct pt_regs *regs);
103 113
104int snd_mpu401_uart_new(struct snd_card *card, 114int snd_mpu401_uart_new(struct snd_card *card,
105 int device, 115 int device,
106 unsigned short hardware, 116 unsigned short hardware,
107 unsigned long port, 117 unsigned long port,
108 int integrated, 118 unsigned int info_flags,
109 int irq, 119 int irq,
110 int irq_flags, 120 int irq_flags,
111 struct snd_rawmidi ** rrawmidi); 121 struct snd_rawmidi ** rrawmidi);
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 373425895faa..f84d84993a31 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -300,7 +300,6 @@ struct snd_pcm_runtime {
300 /* -- mmap -- */ 300 /* -- mmap -- */
301 volatile struct snd_pcm_mmap_status *status; 301 volatile struct snd_pcm_mmap_status *status;
302 volatile struct snd_pcm_mmap_control *control; 302 volatile struct snd_pcm_mmap_control *control;
303 atomic_t mmap_count;
304 303
305 /* -- locking / scheduling -- */ 304 /* -- locking / scheduling -- */
306 wait_queue_head_t sleep; 305 wait_queue_head_t sleep;
@@ -368,7 +367,9 @@ struct snd_pcm_substream {
368 struct snd_pcm_group *group; /* pointer to current group */ 367 struct snd_pcm_group *group; /* pointer to current group */
369 /* -- assigned files -- */ 368 /* -- assigned files -- */
370 void *file; 369 void *file;
371 struct file *ffile; 370 int ref_count;
371 atomic_t mmap_count;
372 unsigned int f_flags;
372 void (*pcm_release)(struct snd_pcm_substream *); 373 void (*pcm_release)(struct snd_pcm_substream *);
373#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 374#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
374 /* -- OSS things -- */ 375 /* -- OSS things -- */
@@ -387,7 +388,7 @@ struct snd_pcm_substream {
387 unsigned int hw_opened: 1; 388 unsigned int hw_opened: 1;
388}; 389};
389 390
390#define SUBSTREAM_BUSY(substream) ((substream)->file != NULL) 391#define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0)
391 392
392 393
393struct snd_pcm_str { 394struct snd_pcm_str {
@@ -825,14 +826,6 @@ int snd_interval_ratnum(struct snd_interval *i,
825 826
826void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params); 827void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params);
827void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var); 828void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var);
828int snd_pcm_hw_param_near(struct snd_pcm_substream *substream,
829 struct snd_pcm_hw_params *params,
830 snd_pcm_hw_param_t var,
831 unsigned int val, int *dir);
832int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm,
833 struct snd_pcm_hw_params *params,
834 snd_pcm_hw_param_t var,
835 unsigned int val, int dir);
836int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); 829int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
837 830
838int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); 831int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
@@ -979,13 +972,13 @@ struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigne
979static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) 972static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area)
980{ 973{
981 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; 974 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
982 atomic_inc(&substream->runtime->mmap_count); 975 atomic_inc(&substream->mmap_count);
983} 976}
984 977
985static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) 978static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area)
986{ 979{
987 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; 980 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
988 atomic_dec(&substream->runtime->mmap_count); 981 atomic_dec(&substream->mmap_count);
989} 982}
990 983
991/* mmap for io-memory area */ 984/* mmap for io-memory area */
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h
index fb18aef77341..85cf1cf4f31a 100644
--- a/include/sound/pcm_params.h
+++ b/include/sound/pcm_params.h
@@ -22,29 +22,21 @@
22 * 22 *
23 */ 23 */
24 24
25extern int snd_pcm_hw_param_mask(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params, 25int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm,
26 snd_pcm_hw_param_t var, const struct snd_mask *val); 26 struct snd_pcm_hw_params *params,
27extern unsigned int snd_pcm_hw_param_value_min(const struct snd_pcm_hw_params *params, 27 snd_pcm_hw_param_t var, int *dir);
28 snd_pcm_hw_param_t var, int *dir); 28int snd_pcm_hw_param_last(struct snd_pcm_substream *pcm,
29extern unsigned int snd_pcm_hw_param_value_max(const struct snd_pcm_hw_params *params, 29 struct snd_pcm_hw_params *params,
30 snd_pcm_hw_param_t var, int *dir); 30 snd_pcm_hw_param_t var, int *dir);
31extern int _snd_pcm_hw_param_min(struct snd_pcm_hw_params *params, 31int snd_pcm_hw_param_value(const struct snd_pcm_hw_params *params,
32 snd_pcm_hw_param_t var, unsigned int val, int dir); 32 snd_pcm_hw_param_t var, int *dir);
33extern int _snd_pcm_hw_param_setinteger(struct snd_pcm_hw_params *params,
34 snd_pcm_hw_param_t var);
35extern int _snd_pcm_hw_param_set(struct snd_pcm_hw_params *params,
36 snd_pcm_hw_param_t var, unsigned int val, int dir);
37
38/* To share the same code we have alsa-lib */
39#define INLINE static inline
40#define assert(a) (void)(a)
41 33
42#define SNDRV_MASK_BITS 64 /* we use so far 64bits only */ 34#define SNDRV_MASK_BITS 64 /* we use so far 64bits only */
43#define SNDRV_MASK_SIZE (SNDRV_MASK_BITS / 32) 35#define SNDRV_MASK_SIZE (SNDRV_MASK_BITS / 32)
44#define MASK_OFS(i) ((i) >> 5) 36#define MASK_OFS(i) ((i) >> 5)
45#define MASK_BIT(i) (1U << ((i) & 31)) 37#define MASK_BIT(i) (1U << ((i) & 31))
46 38
47INLINE unsigned int ld2(u_int32_t v) 39static inline unsigned int ld2(u_int32_t v)
48{ 40{
49 unsigned r = 0; 41 unsigned r = 0;
50 42
@@ -69,22 +61,22 @@ INLINE unsigned int ld2(u_int32_t v)
69 return r; 61 return r;
70} 62}
71 63
72INLINE size_t snd_mask_sizeof(void) 64static inline size_t snd_mask_sizeof(void)
73{ 65{
74 return sizeof(struct snd_mask); 66 return sizeof(struct snd_mask);
75} 67}
76 68
77INLINE void snd_mask_none(struct snd_mask *mask) 69static inline void snd_mask_none(struct snd_mask *mask)
78{ 70{
79 memset(mask, 0, sizeof(*mask)); 71 memset(mask, 0, sizeof(*mask));
80} 72}
81 73
82INLINE void snd_mask_any(struct snd_mask *mask) 74static inline void snd_mask_any(struct snd_mask *mask)
83{ 75{
84 memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t)); 76 memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t));
85} 77}
86 78
87INLINE int snd_mask_empty(const struct snd_mask *mask) 79static inline int snd_mask_empty(const struct snd_mask *mask)
88{ 80{
89 int i; 81 int i;
90 for (i = 0; i < SNDRV_MASK_SIZE; i++) 82 for (i = 0; i < SNDRV_MASK_SIZE; i++)
@@ -93,10 +85,9 @@ INLINE int snd_mask_empty(const struct snd_mask *mask)
93 return 1; 85 return 1;
94} 86}
95 87
96INLINE unsigned int snd_mask_min(const struct snd_mask *mask) 88static inline unsigned int snd_mask_min(const struct snd_mask *mask)
97{ 89{
98 int i; 90 int i;
99 assert(!snd_mask_empty(mask));
100 for (i = 0; i < SNDRV_MASK_SIZE; i++) { 91 for (i = 0; i < SNDRV_MASK_SIZE; i++) {
101 if (mask->bits[i]) 92 if (mask->bits[i])
102 return ffs(mask->bits[i]) - 1 + (i << 5); 93 return ffs(mask->bits[i]) - 1 + (i << 5);
@@ -104,10 +95,9 @@ INLINE unsigned int snd_mask_min(const struct snd_mask *mask)
104 return 0; 95 return 0;
105} 96}
106 97
107INLINE unsigned int snd_mask_max(const struct snd_mask *mask) 98static inline unsigned int snd_mask_max(const struct snd_mask *mask)
108{ 99{
109 int i; 100 int i;
110 assert(!snd_mask_empty(mask));
111 for (i = SNDRV_MASK_SIZE - 1; i >= 0; i--) { 101 for (i = SNDRV_MASK_SIZE - 1; i >= 0; i--) {
112 if (mask->bits[i]) 102 if (mask->bits[i])
113 return ld2(mask->bits[i]) + (i << 5); 103 return ld2(mask->bits[i]) + (i << 5);
@@ -115,70 +105,68 @@ INLINE unsigned int snd_mask_max(const struct snd_mask *mask)
115 return 0; 105 return 0;
116} 106}
117 107
118INLINE void snd_mask_set(struct snd_mask *mask, unsigned int val) 108static inline void snd_mask_set(struct snd_mask *mask, unsigned int val)
119{ 109{
120 assert(val <= SNDRV_MASK_BITS);
121 mask->bits[MASK_OFS(val)] |= MASK_BIT(val); 110 mask->bits[MASK_OFS(val)] |= MASK_BIT(val);
122} 111}
123 112
124INLINE void snd_mask_reset(struct snd_mask *mask, unsigned int val) 113static inline void snd_mask_reset(struct snd_mask *mask, unsigned int val)
125{ 114{
126 assert(val <= SNDRV_MASK_BITS);
127 mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val); 115 mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val);
128} 116}
129 117
130INLINE void snd_mask_set_range(struct snd_mask *mask, unsigned int from, unsigned int to) 118static inline void snd_mask_set_range(struct snd_mask *mask,
119 unsigned int from, unsigned int to)
131{ 120{
132 unsigned int i; 121 unsigned int i;
133 assert(to <= SNDRV_MASK_BITS && from <= to);
134 for (i = from; i <= to; i++) 122 for (i = from; i <= to; i++)
135 mask->bits[MASK_OFS(i)] |= MASK_BIT(i); 123 mask->bits[MASK_OFS(i)] |= MASK_BIT(i);
136} 124}
137 125
138INLINE void snd_mask_reset_range(struct snd_mask *mask, unsigned int from, unsigned int to) 126static inline void snd_mask_reset_range(struct snd_mask *mask,
127 unsigned int from, unsigned int to)
139{ 128{
140 unsigned int i; 129 unsigned int i;
141 assert(to <= SNDRV_MASK_BITS && from <= to);
142 for (i = from; i <= to; i++) 130 for (i = from; i <= to; i++)
143 mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i); 131 mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i);
144} 132}
145 133
146INLINE void snd_mask_leave(struct snd_mask *mask, unsigned int val) 134static inline void snd_mask_leave(struct snd_mask *mask, unsigned int val)
147{ 135{
148 unsigned int v; 136 unsigned int v;
149 assert(val <= SNDRV_MASK_BITS);
150 v = mask->bits[MASK_OFS(val)] & MASK_BIT(val); 137 v = mask->bits[MASK_OFS(val)] & MASK_BIT(val);
151 snd_mask_none(mask); 138 snd_mask_none(mask);
152 mask->bits[MASK_OFS(val)] = v; 139 mask->bits[MASK_OFS(val)] = v;
153} 140}
154 141
155INLINE void snd_mask_intersect(struct snd_mask *mask, const struct snd_mask *v) 142static inline void snd_mask_intersect(struct snd_mask *mask,
143 const struct snd_mask *v)
156{ 144{
157 int i; 145 int i;
158 for (i = 0; i < SNDRV_MASK_SIZE; i++) 146 for (i = 0; i < SNDRV_MASK_SIZE; i++)
159 mask->bits[i] &= v->bits[i]; 147 mask->bits[i] &= v->bits[i];
160} 148}
161 149
162INLINE int snd_mask_eq(const struct snd_mask *mask, const struct snd_mask *v) 150static inline int snd_mask_eq(const struct snd_mask *mask,
151 const struct snd_mask *v)
163{ 152{
164 return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t)); 153 return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t));
165} 154}
166 155
167INLINE void snd_mask_copy(struct snd_mask *mask, const struct snd_mask *v) 156static inline void snd_mask_copy(struct snd_mask *mask,
157 const struct snd_mask *v)
168{ 158{
169 *mask = *v; 159 *mask = *v;
170} 160}
171 161
172INLINE int snd_mask_test(const struct snd_mask *mask, unsigned int val) 162static inline int snd_mask_test(const struct snd_mask *mask, unsigned int val)
173{ 163{
174 assert(val <= SNDRV_MASK_BITS);
175 return mask->bits[MASK_OFS(val)] & MASK_BIT(val); 164 return mask->bits[MASK_OFS(val)] & MASK_BIT(val);
176} 165}
177 166
178INLINE int snd_mask_single(const struct snd_mask *mask) 167static inline int snd_mask_single(const struct snd_mask *mask)
179{ 168{
180 int i, c = 0; 169 int i, c = 0;
181 assert(!snd_mask_empty(mask));
182 for (i = 0; i < SNDRV_MASK_SIZE; i++) { 170 for (i = 0; i < SNDRV_MASK_SIZE; i++) {
183 if (! mask->bits[i]) 171 if (! mask->bits[i])
184 continue; 172 continue;
@@ -191,10 +179,10 @@ INLINE int snd_mask_single(const struct snd_mask *mask)
191 return 1; 179 return 1;
192} 180}
193 181
194INLINE int snd_mask_refine(struct snd_mask *mask, const struct snd_mask *v) 182static inline int snd_mask_refine(struct snd_mask *mask,
183 const struct snd_mask *v)
195{ 184{
196 struct snd_mask old; 185 struct snd_mask old;
197 assert(!snd_mask_empty(mask));
198 snd_mask_copy(&old, mask); 186 snd_mask_copy(&old, mask);
199 snd_mask_intersect(mask, v); 187 snd_mask_intersect(mask, v);
200 if (snd_mask_empty(mask)) 188 if (snd_mask_empty(mask))
@@ -202,27 +190,24 @@ INLINE int snd_mask_refine(struct snd_mask *mask, const struct snd_mask *v)
202 return !snd_mask_eq(mask, &old); 190 return !snd_mask_eq(mask, &old);
203} 191}
204 192
205INLINE int snd_mask_refine_first(struct snd_mask *mask) 193static inline int snd_mask_refine_first(struct snd_mask *mask)
206{ 194{
207 assert(!snd_mask_empty(mask));
208 if (snd_mask_single(mask)) 195 if (snd_mask_single(mask))
209 return 0; 196 return 0;
210 snd_mask_leave(mask, snd_mask_min(mask)); 197 snd_mask_leave(mask, snd_mask_min(mask));
211 return 1; 198 return 1;
212} 199}
213 200
214INLINE int snd_mask_refine_last(struct snd_mask *mask) 201static inline int snd_mask_refine_last(struct snd_mask *mask)
215{ 202{
216 assert(!snd_mask_empty(mask));
217 if (snd_mask_single(mask)) 203 if (snd_mask_single(mask))
218 return 0; 204 return 0;
219 snd_mask_leave(mask, snd_mask_max(mask)); 205 snd_mask_leave(mask, snd_mask_max(mask));
220 return 1; 206 return 1;
221} 207}
222 208
223INLINE int snd_mask_refine_min(struct snd_mask *mask, unsigned int val) 209static inline int snd_mask_refine_min(struct snd_mask *mask, unsigned int val)
224{ 210{
225 assert(!snd_mask_empty(mask));
226 if (snd_mask_min(mask) >= val) 211 if (snd_mask_min(mask) >= val)
227 return 0; 212 return 0;
228 snd_mask_reset_range(mask, 0, val - 1); 213 snd_mask_reset_range(mask, 0, val - 1);
@@ -231,9 +216,8 @@ INLINE int snd_mask_refine_min(struct snd_mask *mask, unsigned int val)
231 return 1; 216 return 1;
232} 217}
233 218
234INLINE int snd_mask_refine_max(struct snd_mask *mask, unsigned int val) 219static inline int snd_mask_refine_max(struct snd_mask *mask, unsigned int val)
235{ 220{
236 assert(!snd_mask_empty(mask));
237 if (snd_mask_max(mask) <= val) 221 if (snd_mask_max(mask) <= val)
238 return 0; 222 return 0;
239 snd_mask_reset_range(mask, val + 1, SNDRV_MASK_BITS); 223 snd_mask_reset_range(mask, val + 1, SNDRV_MASK_BITS);
@@ -242,10 +226,9 @@ INLINE int snd_mask_refine_max(struct snd_mask *mask, unsigned int val)
242 return 1; 226 return 1;
243} 227}
244 228
245INLINE int snd_mask_refine_set(struct snd_mask *mask, unsigned int val) 229static inline int snd_mask_refine_set(struct snd_mask *mask, unsigned int val)
246{ 230{
247 int changed; 231 int changed;
248 assert(!snd_mask_empty(mask));
249 changed = !snd_mask_single(mask); 232 changed = !snd_mask_single(mask);
250 snd_mask_leave(mask, val); 233 snd_mask_leave(mask, val);
251 if (snd_mask_empty(mask)) 234 if (snd_mask_empty(mask))
@@ -253,13 +236,12 @@ INLINE int snd_mask_refine_set(struct snd_mask *mask, unsigned int val)
253 return changed; 236 return changed;
254} 237}
255 238
256INLINE int snd_mask_value(const struct snd_mask *mask) 239static inline int snd_mask_value(const struct snd_mask *mask)
257{ 240{
258 assert(!snd_mask_empty(mask));
259 return snd_mask_min(mask); 241 return snd_mask_min(mask);
260} 242}
261 243
262INLINE void snd_interval_any(struct snd_interval *i) 244static inline void snd_interval_any(struct snd_interval *i)
263{ 245{
264 i->min = 0; 246 i->min = 0;
265 i->openmin = 0; 247 i->openmin = 0;
@@ -269,63 +251,59 @@ INLINE void snd_interval_any(struct snd_interval *i)
269 i->empty = 0; 251 i->empty = 0;
270} 252}
271 253
272INLINE void snd_interval_none(struct snd_interval *i) 254static inline void snd_interval_none(struct snd_interval *i)
273{ 255{
274 i->empty = 1; 256 i->empty = 1;
275} 257}
276 258
277INLINE int snd_interval_checkempty(const struct snd_interval *i) 259static inline int snd_interval_checkempty(const struct snd_interval *i)
278{ 260{
279 return (i->min > i->max || 261 return (i->min > i->max ||
280 (i->min == i->max && (i->openmin || i->openmax))); 262 (i->min == i->max && (i->openmin || i->openmax)));
281} 263}
282 264
283INLINE int snd_interval_empty(const struct snd_interval *i) 265static inline int snd_interval_empty(const struct snd_interval *i)
284{ 266{
285 return i->empty; 267 return i->empty;
286} 268}
287 269
288INLINE int snd_interval_single(const struct snd_interval *i) 270static inline int snd_interval_single(const struct snd_interval *i)
289{ 271{
290 assert(!snd_interval_empty(i));
291 return (i->min == i->max || 272 return (i->min == i->max ||
292 (i->min + 1 == i->max && i->openmax)); 273 (i->min + 1 == i->max && i->openmax));
293} 274}
294 275
295INLINE int snd_interval_value(const struct snd_interval *i) 276static inline int snd_interval_value(const struct snd_interval *i)
296{ 277{
297 assert(snd_interval_single(i));
298 return i->min; 278 return i->min;
299} 279}
300 280
301INLINE int snd_interval_min(const struct snd_interval *i) 281static inline int snd_interval_min(const struct snd_interval *i)
302{ 282{
303 assert(!snd_interval_empty(i));
304 return i->min; 283 return i->min;
305} 284}
306 285
307INLINE int snd_interval_max(const struct snd_interval *i) 286static inline int snd_interval_max(const struct snd_interval *i)
308{ 287{
309 unsigned int v; 288 unsigned int v;
310 assert(!snd_interval_empty(i));
311 v = i->max; 289 v = i->max;
312 if (i->openmax) 290 if (i->openmax)
313 v--; 291 v--;
314 return v; 292 return v;
315} 293}
316 294
317INLINE int snd_interval_test(const struct snd_interval *i, unsigned int val) 295static inline int snd_interval_test(const struct snd_interval *i, unsigned int val)
318{ 296{
319 return !((i->min > val || (i->min == val && i->openmin) || 297 return !((i->min > val || (i->min == val && i->openmin) ||
320 i->max < val || (i->max == val && i->openmax))); 298 i->max < val || (i->max == val && i->openmax)));
321} 299}
322 300
323INLINE void snd_interval_copy(struct snd_interval *d, const struct snd_interval *s) 301static inline void snd_interval_copy(struct snd_interval *d, const struct snd_interval *s)
324{ 302{
325 *d = *s; 303 *d = *s;
326} 304}
327 305
328INLINE int snd_interval_setinteger(struct snd_interval *i) 306static inline int snd_interval_setinteger(struct snd_interval *i)
329{ 307{
330 if (i->integer) 308 if (i->integer)
331 return 0; 309 return 0;
@@ -335,7 +313,7 @@ INLINE int snd_interval_setinteger(struct snd_interval *i)
335 return 1; 313 return 1;
336} 314}
337 315
338INLINE int snd_interval_eq(const struct snd_interval *i1, const struct snd_interval *i2) 316static inline int snd_interval_eq(const struct snd_interval *i1, const struct snd_interval *i2)
339{ 317{
340 if (i1->empty) 318 if (i1->empty)
341 return i2->empty; 319 return i2->empty;
@@ -359,8 +337,5 @@ static inline unsigned int sub(unsigned int a, unsigned int b)
359 return 0; 337 return 0;
360} 338}
361 339
362#undef INLINE
363#undef assert
364
365#endif /* __SOUND_PCM_PARAMS_H */ 340#endif /* __SOUND_PCM_PARAMS_H */
366 341
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
index 584e73dd4793..7dbcd10fa215 100644
--- a/include/sound/rawmidi.h
+++ b/include/sound/rawmidi.h
@@ -46,6 +46,7 @@
46 46
47struct snd_rawmidi; 47struct snd_rawmidi;
48struct snd_rawmidi_substream; 48struct snd_rawmidi_substream;
49struct snd_seq_port_info;
49 50
50struct snd_rawmidi_ops { 51struct snd_rawmidi_ops {
51 int (*open) (struct snd_rawmidi_substream * substream); 52 int (*open) (struct snd_rawmidi_substream * substream);
@@ -57,6 +58,8 @@ struct snd_rawmidi_ops {
57struct snd_rawmidi_global_ops { 58struct snd_rawmidi_global_ops {
58 int (*dev_register) (struct snd_rawmidi * rmidi); 59 int (*dev_register) (struct snd_rawmidi * rmidi);
59 int (*dev_unregister) (struct snd_rawmidi * rmidi); 60 int (*dev_unregister) (struct snd_rawmidi * rmidi);
61 void (*get_port_info)(struct snd_rawmidi *rmidi, int number,
62 struct snd_seq_port_info *info);
60}; 63};
61 64
62struct snd_rawmidi_runtime { 65struct snd_rawmidi_runtime {
diff --git a/include/sound/version.h b/include/sound/version.h
index 4f0e65808cf1..2ee849d0e198 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h. Generated by configure. */ 1/* include/version.h. Generated by configure. */
2#define CONFIG_SND_VERSION "1.0.11rc4" 2#define CONFIG_SND_VERSION "1.0.12rc1"
3#define CONFIG_SND_DATE " (Wed Mar 22 10:27:24 2006 UTC)" 3#define CONFIG_SND_DATE " (Thu Jun 22 13:55:50 2006 UTC)"
diff --git a/include/video/edid.h b/include/video/edid.h
index b913f196131d..f6a42d6c2e2d 100644
--- a/include/video/edid.h
+++ b/include/video/edid.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7 6
8#ifdef CONFIG_X86 7#ifdef CONFIG_X86
9struct edid_info { 8struct edid_info {
diff --git a/include/video/vga.h b/include/video/vga.h
index 700d6c8eb736..b49a5120ca2d 100644
--- a/include/video/vga.h
+++ b/include/video/vga.h
@@ -17,7 +17,6 @@
17#ifndef __linux_video_vga_h__ 17#ifndef __linux_video_vga_h__
18#define __linux_video_vga_h__ 18#define __linux_video_vga_h__
19 19
20#include <linux/config.h>
21#include <linux/types.h> 20#include <linux/types.h>
22#include <asm/io.h> 21#include <asm/io.h>
23#ifndef CONFIG_AMIGA 22#ifndef CONFIG_AMIGA