aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acmacros.h63
-rw-r--r--include/acpi/acoutput.h4
-rw-r--r--include/acpi/acpi_bus.h25
-rw-r--r--include/acpi/acpi_drivers.h23
-rw-r--r--include/acpi/acpi_numa.h1
-rw-r--r--include/acpi/acpixf.h2
-rw-r--r--include/acpi/acstruct.h2
-rw-r--r--include/acpi/actypes.h6
-rw-r--r--include/acpi/acutils.h4
-rw-r--r--include/acpi/platform/acenv.h2
-rw-r--r--include/acpi/platform/aclinux.h3
-rw-r--r--include/acpi/processor.h49
-rw-r--r--include/asm-alpha/a.out.h2
-rw-r--r--include/asm-alpha/bitops.h2
-rw-r--r--include/asm-alpha/fcntl.h1
-rw-r--r--include/asm-alpha/irq.h4
-rw-r--r--include/asm-alpha/system.h10
-rw-r--r--include/asm-alpha/thread_info.h24
-rw-r--r--include/asm-arm/a.out.h1
-rw-r--r--include/asm-arm/arch-at91/at91_mci.h3
-rw-r--r--include/asm-arm/arch-at91/irqs.h3
-rw-r--r--include/asm-arm/arch-iop13xx/iop13xx.h43
-rw-r--r--include/asm-arm/arch-iop13xx/system.h34
-rw-r--r--include/asm-arm/arch-iop13xx/uncompress.h3
-rw-r--r--include/asm-arm/arch-iop32x/uncompress.h2
-rw-r--r--include/asm-arm/arch-mxc/board-mx31ads.h142
-rw-r--r--include/asm-arm/arch-mxc/common.h20
-rw-r--r--include/asm-arm/arch-mxc/dma.h21
-rw-r--r--include/asm-arm/arch-mxc/entry-macro.S39
-rw-r--r--include/asm-arm/arch-mxc/hardware.h52
-rw-r--r--include/asm-arm/arch-mxc/io.h33
-rw-r--r--include/asm-arm/arch-mxc/irqs.h38
-rw-r--r--include/asm-arm/arch-mxc/memory.h36
-rw-r--r--include/asm-arm/arch-mxc/mx31.h335
-rw-r--r--include/asm-arm/arch-mxc/mxc.h149
-rw-r--r--include/asm-arm/arch-mxc/system.h50
-rw-r--r--include/asm-arm/arch-mxc/timex.h25
-rw-r--r--include/asm-arm/arch-mxc/uncompress.h78
-rw-r--r--include/asm-arm/arch-mxc/vmalloc.h36
-rw-r--r--include/asm-arm/arch-ns9xxx/regs-bbu.h28
-rw-r--r--include/asm-arm/arch-ns9xxx/regs-mem.h6
-rw-r--r--include/asm-arm/arch-ns9xxx/regs-sys.h2
-rw-r--r--include/asm-arm/arch-omap/irda.h1
-rw-r--r--include/asm-arm/arch-omap/mailbox.h2
-rw-r--r--include/asm-arm/arch-pxa/pm.h16
-rw-r--r--include/asm-arm/arch-s3c2400/map.h66
-rw-r--r--include/asm-arm/arch-s3c2400/memory.h23
-rw-r--r--include/asm-arm/arch-s3c2410/debug-macro.S84
-rw-r--r--include/asm-arm/arch-s3c2410/map.h85
-rw-r--r--include/asm-arm/arch-s3c2410/memory.h13
-rw-r--r--include/asm-arm/arch-s3c2410/regs-lcd.h2
-rw-r--r--include/asm-arm/arch-s3c2410/system.h2
-rw-r--r--include/asm-arm/arch-s3c2410/uncompress.h145
-rw-r--r--include/asm-arm/arch-sa1100/jornada720.h27
-rw-r--r--include/asm-arm/cacheflush.h7
-rw-r--r--include/asm-arm/elf.h3
-rw-r--r--include/asm-arm/floppy.h18
-rw-r--r--include/asm-arm/hardware/iop3xx.h33
-rw-r--r--include/asm-arm/pgtable-nommu.h4
-rw-r--r--include/asm-arm/plat-s3c/debug-macro.S75
-rw-r--r--include/asm-arm/plat-s3c/iic.h (renamed from include/asm-arm/arch-s3c2410/iic.h)0
-rw-r--r--include/asm-arm/plat-s3c/map.h40
-rw-r--r--include/asm-arm/plat-s3c/nand.h (renamed from include/asm-arm/arch-s3c2410/nand.h)0
-rw-r--r--include/asm-arm/plat-s3c/regs-ac97.h (renamed from include/asm-arm/arch-s3c2410/regs-ac97.h)0
-rw-r--r--include/asm-arm/plat-s3c/regs-adc.h (renamed from include/asm-arm/arch-s3c2410/regs-adc.h)0
-rw-r--r--include/asm-arm/plat-s3c/regs-iic.h (renamed from include/asm-arm/arch-s3c2410/regs-iic.h)0
-rw-r--r--include/asm-arm/plat-s3c/regs-nand.h (renamed from include/asm-arm/arch-s3c2410/regs-nand.h)0
-rw-r--r--include/asm-arm/plat-s3c/regs-rtc.h (renamed from include/asm-arm/arch-s3c2410/regs-rtc.h)0
-rw-r--r--include/asm-arm/plat-s3c/regs-serial.h (renamed from include/asm-arm/arch-s3c2410/regs-serial.h)8
-rw-r--r--include/asm-arm/plat-s3c/regs-timer.h (renamed from include/asm-arm/arch-s3c2410/regs-timer.h)16
-rw-r--r--include/asm-arm/plat-s3c/regs-watchdog.h (renamed from include/asm-arm/arch-s3c2410/regs-watchdog.h)8
-rw-r--r--include/asm-arm/plat-s3c/uncompress.h155
-rw-r--r--include/asm-arm/plat-s3c24xx/regs-iis.h (renamed from include/asm-arm/arch-s3c2410/regs-iis.h)0
-rw-r--r--include/asm-arm/plat-s3c24xx/regs-spi.h (renamed from include/asm-arm/arch-s3c2410/regs-spi.h)0
-rw-r--r--include/asm-arm/plat-s3c24xx/regs-udc.h (renamed from include/asm-arm/arch-s3c2410/regs-udc.h)0
-rw-r--r--include/asm-arm/plat-s3c24xx/udc.h (renamed from include/asm-arm/arch-s3c2410/udc.h)0
-rw-r--r--include/asm-arm/system.h10
-rw-r--r--include/asm-arm/thread_info.h8
-rw-r--r--include/asm-arm/unaligned.h22
-rw-r--r--include/asm-arm/unistd.h1
-rw-r--r--include/asm-arm/vfp.h4
-rw-r--r--include/asm-arm26/a.out.h38
-rw-r--r--include/asm-arm26/assembler.h106
-rw-r--r--include/asm-arm26/atomic.h123
-rw-r--r--include/asm-arm26/auxvec.h4
-rw-r--r--include/asm-arm26/bitops.h207
-rw-r--r--include/asm-arm26/bug.h19
-rw-r--r--include/asm-arm26/bugs.h15
-rw-r--r--include/asm-arm26/byteorder.h24
-rw-r--r--include/asm-arm26/cache.h12
-rw-r--r--include/asm-arm26/cacheflush.h53
-rw-r--r--include/asm-arm26/checksum.h151
-rw-r--r--include/asm-arm26/constants.h28
-rw-r--r--include/asm-arm26/cputime.h6
-rw-r--r--include/asm-arm26/current.h15
-rw-r--r--include/asm-arm26/delay.h34
-rw-r--r--include/asm-arm26/device.h7
-rw-r--r--include/asm-arm26/div64.h1
-rw-r--r--include/asm-arm26/dma.h183
-rw-r--r--include/asm-arm26/ecard.h294
-rw-r--r--include/asm-arm26/elf.h77
-rw-r--r--include/asm-arm26/emergency-restart.h6
-rw-r--r--include/asm-arm26/errno.h6
-rw-r--r--include/asm-arm26/fb.h12
-rw-r--r--include/asm-arm26/fcntl.h13
-rw-r--r--include/asm-arm26/fiq.h37
-rw-r--r--include/asm-arm26/floppy.h141
-rw-r--r--include/asm-arm26/fpstate.h29
-rw-r--r--include/asm-arm26/futex.h6
-rw-r--r--include/asm-arm26/hardirq.h32
-rw-r--r--include/asm-arm26/hardware.h109
-rw-r--r--include/asm-arm26/ide.h34
-rw-r--r--include/asm-arm26/io.h434
-rw-r--r--include/asm-arm26/ioc.h72
-rw-r--r--include/asm-arm26/ioctl.h1
-rw-r--r--include/asm-arm26/ioctls.h85
-rw-r--r--include/asm-arm26/ipc.h1
-rw-r--r--include/asm-arm26/ipcbuf.h29
-rw-r--r--include/asm-arm26/irq.h48
-rw-r--r--include/asm-arm26/irqchip.h101
-rw-r--r--include/asm-arm26/kdebug.h1
-rw-r--r--include/asm-arm26/kmap_types.h12
-rw-r--r--include/asm-arm26/leds.h50
-rw-r--r--include/asm-arm26/limits.h11
-rw-r--r--include/asm-arm26/linkage.h7
-rw-r--r--include/asm-arm26/local.h2
-rw-r--r--include/asm-arm26/locks.h161
-rw-r--r--include/asm-arm26/mach-types.h36
-rw-r--r--include/asm-arm26/map.h24
-rw-r--r--include/asm-arm26/mc146818rtc.h28
-rw-r--r--include/asm-arm26/memory.h101
-rw-r--r--include/asm-arm26/mman.h17
-rw-r--r--include/asm-arm26/mmu.h9
-rw-r--r--include/asm-arm26/mmu_context.h53
-rw-r--r--include/asm-arm26/module.h7
-rw-r--r--include/asm-arm26/msgbuf.h31
-rw-r--r--include/asm-arm26/namei.h25
-rw-r--r--include/asm-arm26/oldlatches.h37
-rw-r--r--include/asm-arm26/page.h102
-rw-r--r--include/asm-arm26/param.h33
-rw-r--r--include/asm-arm26/parport.h18
-rw-r--r--include/asm-arm26/pci.h6
-rw-r--r--include/asm-arm26/percpu.h6
-rw-r--r--include/asm-arm26/pgalloc.h70
-rw-r--r--include/asm-arm26/pgtable.h298
-rw-r--r--include/asm-arm26/poll.h8
-rw-r--r--include/asm-arm26/posix_types.h81
-rw-r--r--include/asm-arm26/proc-fns.h49
-rw-r--r--include/asm-arm26/processor.h113
-rw-r--r--include/asm-arm26/procinfo.h56
-rw-r--r--include/asm-arm26/ptrace.h104
-rw-r--r--include/asm-arm26/resource.h6
-rw-r--r--include/asm-arm26/scatterlist.h26
-rw-r--r--include/asm-arm26/sections.h2
-rw-r--r--include/asm-arm26/segment.h11
-rw-r--r--include/asm-arm26/semaphore-helper.h84
-rw-r--r--include/asm-arm26/semaphore.h100
-rw-r--r--include/asm-arm26/sembuf.h25
-rw-r--r--include/asm-arm26/serial.h44
-rw-r--r--include/asm-arm26/setup.h209
-rw-r--r--include/asm-arm26/shmbuf.h42
-rw-r--r--include/asm-arm26/shmparam.h15
-rw-r--r--include/asm-arm26/sigcontext.h33
-rw-r--r--include/asm-arm26/siginfo.h6
-rw-r--r--include/asm-arm26/signal.h176
-rw-r--r--include/asm-arm26/sizes.h52
-rw-r--r--include/asm-arm26/smp.h9
-rw-r--r--include/asm-arm26/socket.h55
-rw-r--r--include/asm-arm26/sockios.h13
-rw-r--r--include/asm-arm26/spinlock.h6
-rw-r--r--include/asm-arm26/stat.h77
-rw-r--r--include/asm-arm26/statfs.h8
-rw-r--r--include/asm-arm26/string.h43
-rw-r--r--include/asm-arm26/suspend.h4
-rw-r--r--include/asm-arm26/sysirq.h60
-rw-r--r--include/asm-arm26/system.h257
-rw-r--r--include/asm-arm26/termbits.h196
-rw-r--r--include/asm-arm26/termios.h92
-rw-r--r--include/asm-arm26/thread_info.h140
-rw-r--r--include/asm-arm26/timex.h29
-rw-r--r--include/asm-arm26/tlb.h63
-rw-r--r--include/asm-arm26/tlbflush.h70
-rw-r--r--include/asm-arm26/topology.h6
-rw-r--r--include/asm-arm26/types.h59
-rw-r--r--include/asm-arm26/uaccess-asm.h153
-rw-r--r--include/asm-arm26/uaccess.h293
-rw-r--r--include/asm-arm26/ucontext.h12
-rw-r--r--include/asm-arm26/unaligned.h118
-rw-r--r--include/asm-arm26/uncompress.h111
-rw-r--r--include/asm-arm26/unistd.h343
-rw-r--r--include/asm-arm26/user.h84
-rw-r--r--include/asm-arm26/xor.h141
-rw-r--r--include/asm-avr32/a.out.h1
-rw-r--r--include/asm-avr32/arch-at32ap/board.h14
-rw-r--r--include/asm-avr32/arch-at32ap/sm.h27
-rw-r--r--include/asm-avr32/atomic.h4
-rw-r--r--include/asm-avr32/bug.h2
-rw-r--r--include/asm-avr32/io.h2
-rw-r--r--include/asm-avr32/pgalloc.h30
-rw-r--r--include/asm-avr32/pgtable.h4
-rw-r--r--include/asm-avr32/thread_info.h18
-rw-r--r--include/asm-avr32/unaligned.h15
-rw-r--r--include/asm-blackfin/bfin-global.h1
-rw-r--r--include/asm-blackfin/mach-bf548/cdefBF54x_base.h33
-rw-r--r--include/asm-blackfin/mach-bf548/irq.h1
-rw-r--r--include/asm-blackfin/mach-bf561/cdefBF561.h6
-rw-r--r--include/asm-blackfin/mach-bf561/defBF561.h4
-rw-r--r--include/asm-blackfin/thread_info.h26
-rw-r--r--include/asm-cris/a.out.h1
-rw-r--r--include/asm-cris/thread_info.h6
-rw-r--r--include/asm-frv/mb86943a.h3
-rw-r--r--include/asm-frv/mem-layout.h1
-rw-r--r--include/asm-frv/thread_info.h12
-rw-r--r--include/asm-frv/unistd.h3
-rw-r--r--include/asm-generic/bug.h6
-rw-r--r--include/asm-generic/percpu.h8
-rw-r--r--include/asm-generic/pgtable.h73
-rw-r--r--include/asm-generic/unaligned.h12
-rw-r--r--include/asm-generic/vmlinux.lds.h14
-rw-r--r--include/asm-h8300/a.out.h1
-rw-r--r--include/asm-h8300/irq.h3
-rw-r--r--include/asm-h8300/thread_info.h12
-rw-r--r--include/asm-i386/a.out.h1
-rw-r--r--include/asm-i386/acpi.h23
-rw-r--r--include/asm-i386/alternative.h2
-rw-r--r--include/asm-i386/apic.h2
-rw-r--r--include/asm-i386/bootparam.h9
-rw-r--r--include/asm-i386/cmpxchg.h16
-rw-r--r--include/asm-i386/cpufeature.h2
-rw-r--r--include/asm-i386/e820.h8
-rw-r--r--include/asm-i386/geode.h159
-rw-r--r--include/asm-i386/hpet.h126
-rw-r--r--include/asm-i386/i8253.h16
-rw-r--r--include/asm-i386/io.h3
-rw-r--r--include/asm-i386/io_apic.h1
-rw-r--r--include/asm-i386/irq.h1
-rw-r--r--include/asm-i386/ist.h10
-rw-r--r--include/asm-i386/kprobes.h1
-rw-r--r--include/asm-i386/mach-default/do_timer.h2
-rw-r--r--include/asm-i386/mach-default/io_ports.h5
-rw-r--r--include/asm-i386/mach-default/irq_vectors_limits.h2
-rw-r--r--include/asm-i386/mach-default/mach_reboot.h25
-rw-r--r--include/asm-i386/mach-default/mach_wakecpu.h3
-rw-r--r--include/asm-i386/mach-es7000/mach_wakecpu.h3
-rw-r--r--include/asm-i386/mach-voyager/do_timer.h2
-rw-r--r--include/asm-i386/mc146818rtc.h5
-rw-r--r--include/asm-i386/mce.h4
-rw-r--r--include/asm-i386/mmu_context.h2
-rw-r--r--include/asm-i386/nmi.h5
-rw-r--r--include/asm-i386/page.h1
-rw-r--r--include/asm-i386/paravirt.h38
-rw-r--r--include/asm-i386/pci.h8
-rw-r--r--include/asm-i386/percpu.h5
-rw-r--r--include/asm-i386/pgalloc.h6
-rw-r--r--include/asm-i386/processor-cyrix.h30
-rw-r--r--include/asm-i386/processor.h12
-rw-r--r--include/asm-i386/required-features.h2
-rw-r--r--include/asm-i386/resume-trace.h13
-rw-r--r--include/asm-i386/serial.h16
-rw-r--r--include/asm-i386/setup.h4
-rw-r--r--include/asm-i386/smp.h5
-rw-r--r--include/asm-i386/string.h243
-rw-r--r--include/asm-i386/suspend.h2
-rw-r--r--include/asm-i386/system.h9
-rw-r--r--include/asm-i386/thread_info.h18
-rw-r--r--include/asm-i386/timer.h34
-rw-r--r--include/asm-i386/tlbflush.h6
-rw-r--r--include/asm-i386/topology.h2
-rw-r--r--include/asm-i386/tsc.h1
-rw-r--r--include/asm-i386/uaccess.h2
-rw-r--r--include/asm-i386/unistd.h3
-rw-r--r--include/asm-i386/vmi_time.h2
-rw-r--r--include/asm-i386/xen/hypercall.h413
-rw-r--r--include/asm-i386/xen/hypervisor.h73
-rw-r--r--include/asm-i386/xen/interface.h188
-rw-r--r--include/asm-ia64/acpi.h5
-rw-r--r--include/asm-ia64/atomic.h4
-rw-r--r--include/asm-ia64/hpsim.h16
-rw-r--r--include/asm-ia64/hw_irq.h23
-rw-r--r--include/asm-ia64/ia32.h9
-rw-r--r--include/asm-ia64/iosapic.h6
-rw-r--r--include/asm-ia64/irq.h12
-rw-r--r--include/asm-ia64/kprobes.h2
-rw-r--r--include/asm-ia64/machvec.h8
-rw-r--r--include/asm-ia64/machvec_init.h1
-rw-r--r--include/asm-ia64/machvec_sn2.h2
-rw-r--r--include/asm-ia64/percpu.h10
-rw-r--r--include/asm-ia64/processor.h8
-rw-r--r--include/asm-ia64/rwsem.h4
-rw-r--r--include/asm-ia64/smp.h1
-rw-r--r--include/asm-ia64/sn/arch.h1
-rw-r--r--include/asm-ia64/sn/intr.h1
-rw-r--r--include/asm-ia64/sn/sn_feature_sets.h1
-rw-r--r--include/asm-ia64/system.h1
-rw-r--r--include/asm-ia64/thread_info.h20
-rw-r--r--include/asm-ia64/unistd.h2
-rw-r--r--include/asm-ia64/ustack.h1
-rw-r--r--include/asm-m32r/a.out.h1
-rw-r--r--include/asm-m32r/assembler.h16
-rw-r--r--include/asm-m32r/m32r.h20
-rw-r--r--include/asm-m32r/system.h10
-rw-r--r--include/asm-m32r/thread_info.h10
-rw-r--r--include/asm-m68k/a.out.h1
-rw-r--r--include/asm-m68k/io.h75
-rw-r--r--include/asm-m68k/ioctls.h4
-rw-r--r--include/asm-m68k/irq.h3
-rw-r--r--include/asm-m68k/page.h10
-rw-r--r--include/asm-m68k/processor.h4
-rw-r--r--include/asm-m68k/raw_io.h16
-rw-r--r--include/asm-m68k/system.h33
-rw-r--r--include/asm-m68k/termbits.h5
-rw-r--r--include/asm-m68k/termios.h6
-rw-r--r--include/asm-m68k/unistd.h12
-rw-r--r--include/asm-m68knommu/hardirq.h2
-rw-r--r--include/asm-m68knommu/hw_irq.h4
-rw-r--r--include/asm-m68knommu/irq.h75
-rw-r--r--include/asm-m68knommu/irqnode.h36
-rw-r--r--include/asm-m68knommu/m68360.h8
-rw-r--r--include/asm-m68knommu/machdep.h38
-rw-r--r--include/asm-m68knommu/mcfdma.h2
-rw-r--r--include/asm-m68knommu/pgtable.h3
-rw-r--r--include/asm-m68knommu/system.h4
-rw-r--r--include/asm-m68knommu/thread_info.h10
-rw-r--r--include/asm-m68knommu/timex.h24
-rw-r--r--include/asm-m68knommu/traps.h4
-rw-r--r--include/asm-m68knommu/uaccess.h11
-rw-r--r--include/asm-m68knommu/unistd.h12
-rw-r--r--include/asm-mips/a.out.h4
-rw-r--r--include/asm-mips/atomic.h33
-rw-r--r--include/asm-mips/barrier.h9
-rw-r--r--include/asm-mips/bcache.h1
-rw-r--r--include/asm-mips/bitops.h10
-rw-r--r--include/asm-mips/bootinfo.h13
-rw-r--r--include/asm-mips/ddb5xxx/ddb5477.h342
-rw-r--r--include/asm-mips/ddb5xxx/ddb5xxx.h263
-rw-r--r--include/asm-mips/dec/serial.h36
-rw-r--r--include/asm-mips/ds1216.h31
-rw-r--r--include/asm-mips/edac.h34
-rw-r--r--include/asm-mips/elf.h13
-rw-r--r--include/asm-mips/futex.h8
-rw-r--r--include/asm-mips/gfx.h55
-rw-r--r--include/asm-mips/gt64240.h1235
-rw-r--r--include/asm-mips/hazards.h8
-rw-r--r--include/asm-mips/ioctls.h4
-rw-r--r--include/asm-mips/jmr3927/jmr3927.h3
-rw-r--r--include/asm-mips/jmr3927/tx3927.h36
-rw-r--r--include/asm-mips/mach-cobalt/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-excite/cpu-feature-overrides.h3
-rw-r--r--include/asm-mips/mach-generic/ide.h76
-rw-r--r--include/asm-mips/mach-ip22/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-ip27/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-ip32/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-ocelot/mach-gt64120.h30
-rw-r--r--include/asm-mips/mach-qemu/cpu-feature-overrides.h3
-rw-r--r--include/asm-mips/mach-rm/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-sibyte/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-tx49xx/cpu-feature-overrides.h23
-rw-r--r--include/asm-mips/mach-tx49xx/kmalloc.h8
-rw-r--r--include/asm-mips/mach-yosemite/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/marvell.h59
-rw-r--r--include/asm-mips/mips-boards/generic.h1
-rw-r--r--include/asm-mips/mips_mt.h6
-rw-r--r--include/asm-mips/pgtable-32.h16
-rw-r--r--include/asm-mips/pgtable.h12
-rw-r--r--include/asm-mips/pmon.h2
-rw-r--r--include/asm-mips/processor.h20
-rw-r--r--include/asm-mips/seccomp.h37
-rw-r--r--include/asm-mips/sibyte/bcm1480_regs.h5
-rw-r--r--include/asm-mips/smtc.h10
-rw-r--r--include/asm-mips/spinlock.h18
-rw-r--r--include/asm-mips/stacktrace.h6
-rw-r--r--include/asm-mips/system.h28
-rw-r--r--include/asm-mips/termbits.h7
-rw-r--r--include/asm-mips/termios.h6
-rw-r--r--include/asm-mips/thread_info.h27
-rw-r--r--include/asm-mips/tx3912.h361
-rw-r--r--include/asm-mips/tx4927/toshiba_rbtx4927.h4
-rw-r--r--include/asm-mips/tx4927/tx4927.h49
-rw-r--r--include/asm-mips/tx4927/tx4927_pci.h23
-rw-r--r--include/asm-mips/tx4938/rbtx4938.h25
-rw-r--r--include/asm-mips/tx4938/tx4938.h41
-rw-r--r--include/asm-mips/txx9irq.h30
-rw-r--r--include/asm-mips/unistd.h15
-rw-r--r--include/asm-mips/war.h6
-rw-r--r--include/asm-parisc/a.out.h1
-rw-r--r--include/asm-parisc/bug.h2
-rw-r--r--include/asm-parisc/io.h10
-rw-r--r--include/asm-parisc/system.h11
-rw-r--r--include/asm-parisc/thread_info.h16
-rw-r--r--include/asm-parisc/vga.h6
-rw-r--r--include/asm-powerpc/a.out.h3
-rw-r--r--include/asm-powerpc/bug.h4
-rw-r--r--include/asm-powerpc/dma-mapping.h2
-rw-r--r--include/asm-powerpc/kprobes.h2
-rw-r--r--include/asm-powerpc/mmu-hash64.h1
-rw-r--r--include/asm-powerpc/mpic.h3
-rw-r--r--include/asm-powerpc/of_device.h22
-rw-r--r--include/asm-powerpc/of_platform.h38
-rw-r--r--include/asm-powerpc/oprofile_impl.h10
-rw-r--r--include/asm-powerpc/page.h1
-rw-r--r--include/asm-powerpc/pci-bridge.h36
-rw-r--r--include/asm-powerpc/percpu.h7
-rw-r--r--include/asm-powerpc/pgtable-64k.h8
-rw-r--r--include/asm-powerpc/pmi.h8
-rw-r--r--include/asm-powerpc/ppc_asm.h12
-rw-r--r--include/asm-powerpc/prom.h52
-rw-r--r--include/asm-powerpc/reg_booke.h12
-rw-r--r--include/asm-powerpc/spu.h64
-rw-r--r--include/asm-powerpc/spu_csa.h8
-rw-r--r--include/asm-powerpc/spu_priv1.h7
-rw-r--r--include/asm-powerpc/systbl.h1
-rw-r--r--include/asm-powerpc/system.h10
-rw-r--r--include/asm-powerpc/thread_info.h36
-rw-r--r--include/asm-powerpc/unistd.h3
-rw-r--r--include/asm-powerpc/vio.h5
-rw-r--r--include/asm-ppc/mv64x60.h8
-rw-r--r--include/asm-ppc/system.h11
-rw-r--r--include/asm-s390/a.out.h1
-rw-r--r--include/asm-s390/atomic.h26
-rw-r--r--include/asm-s390/bug.h2
-rw-r--r--include/asm-s390/ccwdev.h5
-rw-r--r--include/asm-s390/cio.h15
-rw-r--r--include/asm-s390/diag.h39
-rw-r--r--include/asm-s390/kprobes.h2
-rw-r--r--include/asm-s390/percpu.h7
-rw-r--r--include/asm-s390/pgalloc.h2
-rw-r--r--include/asm-s390/s390_ext.h2
-rw-r--r--include/asm-s390/smp.h11
-rw-r--r--include/asm-s390/system.h10
-rw-r--r--include/asm-s390/unistd.h2
-rw-r--r--include/asm-sh/a.out.h1
-rw-r--r--include/asm-sh/bug.h2
-rw-r--r--include/asm-sh/bugs.h4
-rw-r--r--include/asm-sh/clock.h1
-rw-r--r--include/asm-sh/cpu-sh3/freq.h4
-rw-r--r--include/asm-sh/cpu-sh3/mmu_context.h1
-rw-r--r--include/asm-sh/cpu-sh3/timer.h3
-rw-r--r--include/asm-sh/cpu-sh4/freq.h2
-rw-r--r--include/asm-sh/dma-mapping.h27
-rw-r--r--include/asm-sh/dma.h1
-rw-r--r--include/asm-sh/fixmap.h8
-rw-r--r--include/asm-sh/floppy.h4
-rw-r--r--include/asm-sh/hw_irq.h77
-rw-r--r--include/asm-sh/io.h4
-rw-r--r--include/asm-sh/pgtable.h6
-rw-r--r--include/asm-sh/processor.h4
-rw-r--r--include/asm-sh/rts7751r2d.h2
-rw-r--r--include/asm-sh/se7300.h64
-rw-r--r--include/asm-sh/se73180.h66
-rw-r--r--include/asm-sh/se7722.h40
-rw-r--r--include/asm-sh/system.h10
-rw-r--r--include/asm-sh/thread_info.h10
-rw-r--r--include/asm-sh/ubc.h3
-rw-r--r--include/asm-sh/unistd.h3
-rw-r--r--include/asm-sh64/a.out.h1
-rw-r--r--include/asm-sh64/dma-mapping.h26
-rw-r--r--include/asm-sh64/io.h4
-rw-r--r--include/asm-sh64/irq.h4
-rw-r--r--include/asm-sh64/unistd.h3
-rw-r--r--include/asm-sparc/a.out.h1
-rw-r--r--include/asm-sparc/device.h18
-rw-r--r--include/asm-sparc/fb.h9
-rw-r--r--include/asm-sparc/fcntl.h1
-rw-r--r--include/asm-sparc/floppy.h100
-rw-r--r--include/asm-sparc/irq.h173
-rw-r--r--include/asm-sparc/of_device.h49
-rw-r--r--include/asm-sparc/of_platform.h32
-rw-r--r--include/asm-sparc/oplib.h26
-rw-r--r--include/asm-sparc/pgtable.h3
-rw-r--r--include/asm-sparc/prom.h67
-rw-r--r--include/asm-sparc/sbus.h1
-rw-r--r--include/asm-sparc/sfp-machine.h6
-rw-r--r--include/asm-sparc/system.h10
-rw-r--r--include/asm-sparc/tlbflush.h6
-rw-r--r--include/asm-sparc/unistd.h6
-rw-r--r--include/asm-sparc64/a.out.h2
-rw-r--r--include/asm-sparc64/device.h2
-rw-r--r--include/asm-sparc64/dma-mapping.h347
-rw-r--r--include/asm-sparc64/elf.h10
-rw-r--r--include/asm-sparc64/fb.h9
-rw-r--r--include/asm-sparc64/fbio.h28
-rw-r--r--include/asm-sparc64/fcntl.h2
-rw-r--r--include/asm-sparc64/floppy.h6
-rw-r--r--include/asm-sparc64/io.h5
-rw-r--r--include/asm-sparc64/iommu.h11
-rw-r--r--include/asm-sparc64/irq.h25
-rw-r--r--include/asm-sparc64/kprobes.h1
-rw-r--r--include/asm-sparc64/mdesc.h10
-rw-r--r--include/asm-sparc64/of_device.h50
-rw-r--r--include/asm-sparc64/of_platform.h33
-rw-r--r--include/asm-sparc64/oplib.h35
-rw-r--r--include/asm-sparc64/parport.h233
-rw-r--r--include/asm-sparc64/pci.h152
-rw-r--r--include/asm-sparc64/percpu.h9
-rw-r--r--include/asm-sparc64/power.h7
-rw-r--r--include/asm-sparc64/prom.h67
-rw-r--r--include/asm-sparc64/sbus.h86
-rw-r--r--include/asm-sparc64/sfp-machine.h2
-rw-r--r--include/asm-sparc64/spitfire.h7
-rw-r--r--include/asm-sparc64/system.h42
-rw-r--r--include/asm-sparc64/unistd.h6
-rw-r--r--include/asm-sparc64/vio.h4
-rw-r--r--include/asm-sparc64/xor.h6
-rw-r--r--include/asm-um/a.out.h2
-rw-r--r--include/asm-um/common.lds.S124
-rw-r--r--include/asm-um/elf-x86_64.h40
-rw-r--r--include/asm-v850/irq.h10
-rw-r--r--include/asm-v850/thread_info.h10
-rw-r--r--include/asm-x86_64/a.out.h3
-rw-r--r--include/asm-x86_64/acpi.h33
-rw-r--r--include/asm-x86_64/alternative.h2
-rw-r--r--include/asm-x86_64/apic.h6
-rw-r--r--include/asm-x86_64/auxvec.h2
-rw-r--r--include/asm-x86_64/calgary.h9
-rw-r--r--include/asm-x86_64/cmpxchg.h2
-rw-r--r--include/asm-x86_64/dmi.h5
-rw-r--r--include/asm-x86_64/elf.h13
-rw-r--r--include/asm-x86_64/fixmap.h6
-rw-r--r--include/asm-x86_64/hpet.h62
-rw-r--r--include/asm-x86_64/hw_irq.h20
-rw-r--r--include/asm-x86_64/hypertransport.h43
-rw-r--r--include/asm-x86_64/i8253.h6
-rw-r--r--include/asm-x86_64/io_apic.h6
-rw-r--r--include/asm-x86_64/iommu.h29
-rw-r--r--include/asm-x86_64/ist.h1
-rw-r--r--include/asm-x86_64/kprobes.h1
-rw-r--r--include/asm-x86_64/mce.h5
-rw-r--r--include/asm-x86_64/mmu.h1
-rw-r--r--include/asm-x86_64/msidef.h48
-rw-r--r--include/asm-x86_64/nmi.h5
-rw-r--r--include/asm-x86_64/pci.h21
-rw-r--r--include/asm-x86_64/percpu.h7
-rw-r--r--include/asm-x86_64/pgalloc.h73
-rw-r--r--include/asm-x86_64/pgtable.h3
-rw-r--r--include/asm-x86_64/processor.h12
-rw-r--r--include/asm-x86_64/proto.h20
-rw-r--r--include/asm-x86_64/ptrace.h1
-rw-r--r--include/asm-x86_64/resume-trace.h13
-rw-r--r--include/asm-x86_64/serial.h16
-rw-r--r--include/asm-x86_64/string.h5
-rw-r--r--include/asm-x86_64/suspend.h2
-rw-r--r--include/asm-x86_64/system.h45
-rw-r--r--include/asm-x86_64/tce.h6
-rw-r--r--include/asm-x86_64/thread_info.h4
-rw-r--r--include/asm-x86_64/timex.h1
-rw-r--r--include/asm-x86_64/tlbflush.h6
-rw-r--r--include/asm-x86_64/topology.h2
-rw-r--r--include/asm-x86_64/uaccess.h4
-rw-r--r--include/asm-x86_64/unistd.h2
-rw-r--r--include/asm-x86_64/vgtod.h29
-rw-r--r--include/asm-x86_64/vsyscall.h3
-rw-r--r--include/asm-xtensa/a.out.h1
-rw-r--r--include/asm-xtensa/io.h1
-rw-r--r--include/asm-xtensa/thread_info.h14
-rw-r--r--include/linux/Kbuild2
-rw-r--r--include/linux/acpi.h8
-rw-r--r--include/linux/aer.h25
-rw-r--r--include/linux/aio.h2
-rw-r--r--include/linux/apm_bios.h20
-rw-r--r--include/linux/async_tx.h6
-rw-r--r--include/linux/ata.h22
-rw-r--r--include/linux/audit.h36
-rw-r--r--include/linux/backlight.h11
-rw-r--r--include/linux/binfmts.h19
-rw-r--r--include/linux/bio.h3
-rw-r--r--include/linux/blkdev.h150
-rw-r--r--include/linux/blktrace_api.h5
-rw-r--r--include/linux/bsg.h25
-rw-r--r--include/linux/buffer_head.h2
-rw-r--r--include/linux/clockchips.h6
-rw-r--r--include/linux/clocksource.h6
-rw-r--r--include/linux/coda_linux.h4
-rw-r--r--include/linux/coda_proc.h76
-rw-r--r--include/linux/coda_psdev.h15
-rw-r--r--include/linux/compiler-gcc4.h18
-rw-r--r--include/linux/compiler.h13
-rw-r--r--include/linux/cpu.h8
-rw-r--r--include/linux/dcookies.h1
-rw-r--r--include/linux/device.h13
-rw-r--r--include/linux/dvb/video.h1
-rw-r--r--include/linux/edac.h29
-rw-r--r--include/linux/elevator.h76
-rw-r--r--include/linux/elf-em.h3
-rw-r--r--include/linux/elfnote.h22
-rw-r--r--include/linux/ethtool.h4
-rw-r--r--include/linux/ext4_fs.h104
-rw-r--r--include/linux/ext4_fs_extents.h43
-rw-r--r--include/linux/ext4_fs_i.h5
-rw-r--r--include/linux/ext4_fs_sb.h3
-rw-r--r--include/linux/falloc.h6
-rw-r--r--include/linux/freezer.h15
-rw-r--r--include/linux/fs.h35
-rw-r--r--include/linux/fsl_devices.h1
-rw-r--r--include/linux/genetlink.h13
-rw-r--r--include/linux/genhd.h2
-rw-r--r--include/linux/highmem.h15
-rw-r--r--include/linux/hugetlb.h12
-rw-r--r--include/linux/i2c-id.h7
-rw-r--r--include/linux/i2c-isa.h36
-rw-r--r--include/linux/i2c.h5
-rw-r--r--include/linux/i2o.h3
-rw-r--r--include/linux/ide.h52
-rw-r--r--include/linux/if_pppol2tp.h4
-rw-r--r--include/linux/init.h8
-rw-r--r--include/linux/input.h6
-rw-r--r--include/linux/interrupt.h6
-rw-r--r--include/linux/ioprio.h8
-rw-r--r--include/linux/ipv6.h5
-rw-r--r--include/linux/irda.h1
-rw-r--r--include/linux/irq.h1
-rw-r--r--include/linux/jbd2.h6
-rw-r--r--include/linux/kbd_kern.h3
-rw-r--r--include/linux/kdebug.h2
-rw-r--r--include/linux/kernel.h13
-rw-r--r--include/linux/kmod.h52
-rw-r--r--include/linux/kobject.h51
-rw-r--r--include/linux/kprobes.h6
-rw-r--r--include/linux/lcd.h14
-rw-r--r--include/linux/leds.h17
-rw-r--r--include/linux/lguest.h116
-rw-r--r--include/linux/lguest_bus.h51
-rw-r--r--include/linux/lguest_launcher.h127
-rw-r--r--include/linux/libata.h39
-rw-r--r--include/linux/lockdep.h71
-rw-r--r--include/linux/loop.h2
-rw-r--r--include/linux/major.h2
-rw-r--r--include/linux/mempolicy.h2
-rw-r--r--include/linux/mm.h143
-rw-r--r--include/linux/mmc/core.h2
-rw-r--r--include/linux/mmzone.h19
-rw-r--r--include/linux/mod_devicetable.h7
-rw-r--r--include/linux/mv643xx.h8
-rw-r--r--include/linux/namei.h4
-rw-r--r--include/linux/netdevice.h6
-rw-r--r--include/linux/netfilter.h5
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/linux/netfilter/xt_connlimit.h4
-rw-r--r--include/linux/netfilter_ipv4/ipt_iprange.h2
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/nfs_fs.h7
-rw-r--r--include/linux/nfs_xdr.h32
-rw-r--r--include/linux/nfsd/export.h13
-rw-r--r--include/linux/notifier.h19
-rw-r--r--include/linux/of.h61
-rw-r--r--include/linux/of_device.h26
-rw-r--r--include/linux/of_platform.h57
-rw-r--r--include/linux/oprofile.h35
-rw-r--r--include/linux/page-flags.h50
-rw-r--r--include/linux/pci.h5
-rw-r--r--include/linux/pci_ids.h43
-rw-r--r--include/linux/pm.h28
-rw-r--r--include/linux/pmu.h2
-rw-r--r--include/linux/pnp.h191
-rw-r--r--include/linux/pnpbios.h60
-rw-r--r--include/linux/poll.h2
-rw-r--r--include/linux/preempt.h44
-rw-r--r--include/linux/proc_fs.h1
-rw-r--r--include/linux/raid/md_k.h4
-rw-r--r--include/linux/rcupdate.h1
-rw-r--r--include/linux/reboot.h5
-rw-r--r--include/linux/reiserfs_fs.h8
-rw-r--r--include/linux/resume-trace.h19
-rw-r--r--include/linux/rtnetlink.h2
-rw-r--r--include/linux/sched.h100
-rw-r--r--include/linux/security.h20
-rw-r--r--include/linux/selection.h2
-rw-r--r--include/linux/serial_8250.h4
-rw-r--r--include/linux/serial_core.h7
-rw-r--r--include/linux/serial_reg.h1
-rw-r--r--include/linux/signal.h3
-rw-r--r--include/linux/skbuff.h4
-rw-r--r--include/linux/slab.h5
-rw-r--r--include/linux/slub_def.h10
-rw-r--r--include/linux/spi/spi.h59
-rw-r--r--include/linux/spi/spidev.h4
-rw-r--r--include/linux/spinlock_types.h4
-rw-r--r--include/linux/spinlock_types_up.h9
-rw-r--r--include/linux/stacktrace.h2
-rw-r--r--include/linux/string.h4
-rw-r--r--include/linux/sunrpc/xdr.h16
-rw-r--r--include/linux/suspend.h57
-rw-r--r--include/linux/syscalls.h3
-rw-r--r--include/linux/sysctl.h2
-rw-r--r--include/linux/time.h11
-rw-r--r--include/linux/timex.h60
-rw-r--r--include/linux/topology.h1
-rw-r--r--include/linux/tty.h2
-rw-r--r--include/linux/uio_driver.h91
-rw-r--r--include/linux/usb.h2
-rw-r--r--include/linux/user_namespace.h2
-rw-r--r--include/linux/videodev2.h3
-rw-r--r--include/linux/vmalloc.h11
-rw-r--r--include/math-emu/op-common.h5
-rw-r--r--include/math-emu/soft-fp.h7
-rw-r--r--include/media/saa7146.h6
-rw-r--r--include/media/tuner.h71
-rw-r--r--include/mtd/ubi-header.h101
-rw-r--r--include/net/af_unix.h29
-rw-r--r--include/net/bluetooth/l2cap.h50
-rw-r--r--include/net/genetlink.h22
-rw-r--r--include/net/ipv6.h1
-rw-r--r--include/net/netfilter/ipv4/nf_conntrack_ipv4.h2
-rw-r--r--include/net/netfilter/ipv6/nf_conntrack_ipv6.h3
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h4
-rw-r--r--include/net/netlabel.h64
-rw-r--r--include/net/sctp/sctp.h10
-rw-r--r--include/net/sctp/sm.h2
-rw-r--r--include/net/sctp/structs.h1
-rw-r--r--include/net/sctp/ulpqueue.h1
-rw-r--r--include/net/tcp.h10
-rw-r--r--include/net/xfrm.h1
-rw-r--r--include/rdma/ib_mad.h2
-rw-r--r--include/rdma/ib_verbs.h7
-rw-r--r--include/scsi/libiscsi.h10
-rw-r--r--include/scsi/libsas.h17
-rw-r--r--include/scsi/sas_ata.h60
-rw-r--r--include/scsi/scsi_driver.h2
-rw-r--r--include/scsi/scsi_host.h2
-rw-r--r--include/scsi/scsi_transport_sas.h11
-rw-r--r--include/scsi/sd.h2
-rw-r--r--include/sound/ak4xxx-adda.h1
-rw-r--r--include/sound/cs46xx.h4
-rw-r--r--include/sound/cs46xx_dsp_spos.h2
-rw-r--r--include/sound/emu10k1.h16
-rw-r--r--include/sound/sb.h1
-rw-r--r--include/sound/version.h2
-rw-r--r--include/sound/wavefront_fx.h9
-rw-r--r--include/video/tx3912.h62
-rw-r--r--include/xen/events.h48
-rw-r--r--include/xen/features.h23
-rw-r--r--include/xen/grant_table.h107
-rw-r--r--include/xen/hvc-console.h6
-rw-r--r--include/xen/interface/elfnote.h133
-rw-r--r--include/xen/interface/event_channel.h195
-rw-r--r--include/xen/interface/features.h43
-rw-r--r--include/xen/interface/grant_table.h375
-rw-r--r--include/xen/interface/io/blkif.h94
-rw-r--r--include/xen/interface/io/console.h23
-rw-r--r--include/xen/interface/io/netif.h158
-rw-r--r--include/xen/interface/io/ring.h260
-rw-r--r--include/xen/interface/io/xenbus.h44
-rw-r--r--include/xen/interface/io/xs_wire.h87
-rw-r--r--include/xen/interface/memory.h145
-rw-r--r--include/xen/interface/physdev.h145
-rw-r--r--include/xen/interface/sched.h77
-rw-r--r--include/xen/interface/vcpu.h167
-rw-r--r--include/xen/interface/version.h60
-rw-r--r--include/xen/interface/xen.h447
-rw-r--r--include/xen/page.h180
-rw-r--r--include/xen/xenbus.h234
750 files changed, 10926 insertions, 14505 deletions
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 8948a6461834..45662f6dbdb6 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -486,6 +486,8 @@
486#define ACPI_FUNCTION_NAME(name) 486#define ACPI_FUNCTION_NAME(name)
487#endif 487#endif
488 488
489#ifdef DEBUG_FUNC_TRACE
490
489#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ 491#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
490 acpi_ut_trace(ACPI_DEBUG_PARAMETERS) 492 acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
491#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ 493#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \
@@ -563,6 +565,27 @@
563 565
564#endif /* ACPI_SIMPLE_RETURN_MACROS */ 566#endif /* ACPI_SIMPLE_RETURN_MACROS */
565 567
568#else /* !DEBUG_FUNC_TRACE */
569
570#define ACPI_FUNCTION_TRACE(a)
571#define ACPI_FUNCTION_TRACE_PTR(a,b)
572#define ACPI_FUNCTION_TRACE_U32(a,b)
573#define ACPI_FUNCTION_TRACE_STR(a,b)
574#define ACPI_FUNCTION_EXIT
575#define ACPI_FUNCTION_STATUS_EXIT(s)
576#define ACPI_FUNCTION_VALUE_EXIT(s)
577#define ACPI_FUNCTION_TRACE(a)
578#define ACPI_FUNCTION_ENTRY()
579
580#define return_VOID return
581#define return_ACPI_STATUS(s) return(s)
582#define return_VALUE(s) return(s)
583#define return_UINT8(s) return(s)
584#define return_UINT32(s) return(s)
585#define return_PTR(s) return(s)
586
587#endif /* DEBUG_FUNC_TRACE */
588
566/* Conditional execution */ 589/* Conditional execution */
567 590
568#define ACPI_DEBUG_EXEC(a) a 591#define ACPI_DEBUG_EXEC(a) a
@@ -599,26 +622,26 @@
599#define ACPI_DEBUG_EXEC(a) 622#define ACPI_DEBUG_EXEC(a)
600#define ACPI_NORMAL_EXEC(a) a; 623#define ACPI_NORMAL_EXEC(a) a;
601 624
602#define ACPI_DEBUG_DEFINE(a) 625#define ACPI_DEBUG_DEFINE(a) do { } while(0)
603#define ACPI_DEBUG_ONLY_MEMBERS(a) 626#define ACPI_DEBUG_ONLY_MEMBERS(a) do { } while(0)
604#define ACPI_FUNCTION_NAME(a) 627#define ACPI_FUNCTION_NAME(a) do { } while(0)
605#define ACPI_FUNCTION_TRACE(a) 628#define ACPI_FUNCTION_TRACE(a) do { } while(0)
606#define ACPI_FUNCTION_TRACE_PTR(a,b) 629#define ACPI_FUNCTION_TRACE_PTR(a,b) do { } while(0)
607#define ACPI_FUNCTION_TRACE_U32(a,b) 630#define ACPI_FUNCTION_TRACE_U32(a,b) do { } while(0)
608#define ACPI_FUNCTION_TRACE_STR(a,b) 631#define ACPI_FUNCTION_TRACE_STR(a,b) do { } while(0)
609#define ACPI_FUNCTION_EXIT 632#define ACPI_FUNCTION_EXIT do { } while(0)
610#define ACPI_FUNCTION_STATUS_EXIT(s) 633#define ACPI_FUNCTION_STATUS_EXIT(s) do { } while(0)
611#define ACPI_FUNCTION_VALUE_EXIT(s) 634#define ACPI_FUNCTION_VALUE_EXIT(s) do { } while(0)
612#define ACPI_FUNCTION_ENTRY() 635#define ACPI_FUNCTION_ENTRY() do { } while(0)
613#define ACPI_DUMP_STACK_ENTRY(a) 636#define ACPI_DUMP_STACK_ENTRY(a) do { } while(0)
614#define ACPI_DUMP_OPERANDS(a,b,c,d,e) 637#define ACPI_DUMP_OPERANDS(a,b,c,d,e) do { } while(0)
615#define ACPI_DUMP_ENTRY(a,b) 638#define ACPI_DUMP_ENTRY(a,b) do { } while(0)
616#define ACPI_DUMP_TABLES(a,b) 639#define ACPI_DUMP_TABLES(a,b) do { } while(0)
617#define ACPI_DUMP_PATHNAME(a,b,c,d) 640#define ACPI_DUMP_PATHNAME(a,b,c,d) do { } while(0)
618#define ACPI_DUMP_RESOURCE_LIST(a) 641#define ACPI_DUMP_RESOURCE_LIST(a) do { } while(0)
619#define ACPI_DUMP_BUFFER(a,b) 642#define ACPI_DUMP_BUFFER(a,b) do { } while(0)
620#define ACPI_DEBUG_PRINT(pl) 643#define ACPI_DEBUG_PRINT(pl) do { } while(0)
621#define ACPI_DEBUG_PRINT_RAW(pl) 644#define ACPI_DEBUG_PRINT_RAW(pl) do { } while(0)
622 645
623#define return_VOID return 646#define return_VOID return
624#define return_ACPI_STATUS(s) return(s) 647#define return_ACPI_STATUS(s) return(s)
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 7812267b577f..c090a8b0bc99 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -178,8 +178,8 @@
178 178
179/* Defaults for debug_level, debug and normal */ 179/* Defaults for debug_level, debug and normal */
180 180
181#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) 181#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR)
182#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) 182#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR)
183#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) 183#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
184 184
185#endif /* __ACOUTPUT_H__ */ 185#endif /* __ACOUTPUT_H__ */
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index c6fa5e023bc7..86aea44ce6d4 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -131,7 +131,7 @@ struct acpi_device_ops {
131struct acpi_driver { 131struct acpi_driver {
132 char name[80]; 132 char name[80];
133 char class[80]; 133 char class[80];
134 char *ids; /* Supported Hardware IDs */ 134 const struct acpi_device_id *ids; /* Supported Hardware IDs */
135 struct acpi_device_ops ops; 135 struct acpi_device_ops ops;
136 struct device_driver drv; 136 struct device_driver drv;
137 struct module *owner; 137 struct module *owner;
@@ -321,7 +321,7 @@ struct acpi_bus_event {
321}; 321};
322 322
323extern struct kset acpi_subsys; 323extern struct kset acpi_subsys;
324 324extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
325/* 325/*
326 * External Functions 326 * External Functions
327 */ 327 */
@@ -331,8 +331,13 @@ void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context);
331int acpi_bus_get_status(struct acpi_device *device); 331int acpi_bus_get_status(struct acpi_device *device);
332int acpi_bus_get_power(acpi_handle handle, int *state); 332int acpi_bus_get_power(acpi_handle handle, int *state);
333int acpi_bus_set_power(acpi_handle handle, int state); 333int acpi_bus_set_power(acpi_handle handle, int state);
334int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data); 334#ifdef CONFIG_ACPI_PROC_EVENT
335int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);
335int acpi_bus_receive_event(struct acpi_bus_event *event); 336int acpi_bus_receive_event(struct acpi_bus_event *event);
337#else
338static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
339 { return 0; }
340#endif
336int acpi_bus_register_driver(struct acpi_driver *driver); 341int acpi_bus_register_driver(struct acpi_driver *driver);
337void acpi_bus_unregister_driver(struct acpi_driver *driver); 342void acpi_bus_unregister_driver(struct acpi_driver *driver);
338int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, 343int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
@@ -340,7 +345,8 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
340int acpi_bus_trim(struct acpi_device *start, int rmdevice); 345int acpi_bus_trim(struct acpi_device *start, int rmdevice);
341int acpi_bus_start(struct acpi_device *device); 346int acpi_bus_start(struct acpi_device *device);
342acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); 347acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
343int acpi_match_ids(struct acpi_device *device, char *ids); 348int acpi_match_device_ids(struct acpi_device *device,
349 const struct acpi_device_id *ids);
344int acpi_create_dir(struct acpi_device *); 350int acpi_create_dir(struct acpi_device *);
345void acpi_remove_dir(struct acpi_device *); 351void acpi_remove_dir(struct acpi_device *);
346 352
@@ -364,6 +370,17 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer);
364acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); 370acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
365#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) 371#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
366 372
373#ifdef CONFIG_PM_SLEEP
374int acpi_pm_device_sleep_state(struct device *, int, int *);
375#else /* !CONFIG_PM_SLEEP */
376static inline int acpi_pm_device_sleep_state(struct device *d, int w, int *p)
377{
378 if (p)
379 *p = ACPI_STATE_D0;
380 return ACPI_STATE_D3;
381}
382#endif /* !CONFIG_PM_SLEEP */
383
367#endif /* CONFIG_ACPI */ 384#endif /* CONFIG_ACPI */
368 385
369#endif /*__ACPI_BUS_H__*/ 386#endif /*__ACPI_BUS_H__*/
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 553515912c0b..202acb9ff4d0 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -34,16 +34,21 @@
34#define ACPI_BUS_COMPONENT 0x00010000 34#define ACPI_BUS_COMPONENT 0x00010000
35#define ACPI_SYSTEM_COMPONENT 0x02000000 35#define ACPI_SYSTEM_COMPONENT 0x02000000
36 36
37/* _HID definitions */ 37/*
38 * _HID definitions
39 * HIDs must conform to ACPI spec(6.1.4)
40 * Linux specific HIDs do not apply to this and begin with LNX:
41 */
38 42
39#define ACPI_POWER_HID "power_resource" 43#define ACPI_POWER_HID "LNXPOWER"
40#define ACPI_PROCESSOR_HID "ACPI0007" 44#define ACPI_PROCESSOR_HID "ACPI0007"
41#define ACPI_SYSTEM_HID "acpi_system" 45#define ACPI_SYSTEM_HID "LNXSYSTM"
42#define ACPI_THERMAL_HID "thermal" 46#define ACPI_THERMAL_HID "LNXTHERM"
43#define ACPI_BUTTON_HID_POWERF "button_power" 47#define ACPI_BUTTON_HID_POWERF "LNXPWRBN"
44#define ACPI_BUTTON_HID_SLEEPF "button_sleep" 48#define ACPI_BUTTON_HID_SLEEPF "LNXSLPBN"
45#define ACPI_VIDEO_HID "video" 49#define ACPI_VIDEO_HID "LNXVIDEO"
46#define ACPI_BAY_HID "bay" 50#define ACPI_BAY_HID "LNXIOBAY"
51
47/* -------------------------------------------------------------------------- 52/* --------------------------------------------------------------------------
48 PCI 53 PCI
49 -------------------------------------------------------------------------- */ 54 -------------------------------------------------------------------------- */
@@ -145,7 +150,7 @@ static inline void unregister_hotplug_dock_device(acpi_handle handle)
145#ifdef CONFIG_ACPI_SLEEP 150#ifdef CONFIG_ACPI_SLEEP
146extern int acpi_sleep_init(void); 151extern int acpi_sleep_init(void);
147#else 152#else
148#define acpi_sleep_init() do {} while (0) 153static inline int acpi_sleep_init(void) { return 0; }
149#endif 154#endif
150 155
151#endif /*__ACPI_DRIVERS_H__*/ 156#endif /*__ACPI_DRIVERS_H__*/
diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h
index e2fcee2b340d..62c5ee4311da 100644
--- a/include/acpi/acpi_numa.h
+++ b/include/acpi/acpi_numa.h
@@ -13,6 +13,7 @@
13 13
14extern int pxm_to_node(int); 14extern int pxm_to_node(int);
15extern int node_to_pxm(int); 15extern int node_to_pxm(int);
16extern void __acpi_map_pxm_to_node(int, int);
16extern int acpi_map_pxm_to_node(int); 17extern int acpi_map_pxm_to_node(int);
17extern void __cpuinit acpi_unmap_pxm_to_node(int); 18extern void __cpuinit acpi_unmap_pxm_to_node(int);
18 19
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index b5cca5daa348..3d7ab9e0c9fe 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -130,7 +130,7 @@ acpi_walk_namespace(acpi_object_type type,
130 void *context, void **return_value); 130 void *context, void **return_value);
131 131
132acpi_status 132acpi_status
133acpi_get_devices(char *HID, 133acpi_get_devices(const char *HID,
134 acpi_walk_callback user_function, 134 acpi_walk_callback user_function,
135 void *context, void **return_value); 135 void *context, void **return_value);
136 136
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index aeb4498e5e06..88482655407f 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -146,7 +146,7 @@ struct acpi_init_walk_info {
146struct acpi_get_devices_info { 146struct acpi_get_devices_info {
147 acpi_walk_callback user_function; 147 acpi_walk_callback user_function;
148 void *context; 148 void *context;
149 char *hid; 149 const char *hid;
150}; 150};
151 151
152union acpi_aml_operands { 152union acpi_aml_operands {
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index fe8abc276437..e73a38939120 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -809,7 +809,7 @@ acpi_status(*acpi_walk_callback) (acpi_handle obj_handle,
809 809
810/* Common string version of device HIDs and UIDs */ 810/* Common string version of device HIDs and UIDs */
811 811
812struct acpi_device_id { 812struct acpica_device_id {
813 char value[ACPI_DEVICE_ID_LENGTH]; 813 char value[ACPI_DEVICE_ID_LENGTH];
814}; 814};
815 815
@@ -859,8 +859,8 @@ struct acpi_device_info {
859 u32 valid; /* Indicates which fields below are valid */ 859 u32 valid; /* Indicates which fields below are valid */
860 u32 current_status; /* _STA value */ 860 u32 current_status; /* _STA value */
861 acpi_integer address; /* _ADR value if any */ 861 acpi_integer address; /* _ADR value if any */
862 struct acpi_device_id hardware_id; /* _HID value if any */ 862 struct acpica_device_id hardware_id; /* _HID value if any */
863 struct acpi_device_id unique_id; /* _UID value if any */ 863 struct acpica_device_id unique_id; /* _UID value if any */
864 u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ 864 u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */
865 struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */ 865 struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */
866}; 866};
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index a87ef1c8d46b..a2918547c73f 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -354,7 +354,7 @@ acpi_ut_evaluate_numeric_object(char *object_name,
354 354
355acpi_status 355acpi_status
356acpi_ut_execute_HID(struct acpi_namespace_node *device_node, 356acpi_ut_execute_HID(struct acpi_namespace_node *device_node,
357 struct acpi_device_id *hid); 357 struct acpica_device_id *hid);
358 358
359acpi_status 359acpi_status
360acpi_ut_execute_CID(struct acpi_namespace_node *device_node, 360acpi_ut_execute_CID(struct acpi_namespace_node *device_node,
@@ -366,7 +366,7 @@ acpi_ut_execute_STA(struct acpi_namespace_node *device_node,
366 366
367acpi_status 367acpi_status
368acpi_ut_execute_UID(struct acpi_namespace_node *device_node, 368acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
369 struct acpi_device_id *uid); 369 struct acpica_device_id *uid);
370 370
371acpi_status 371acpi_status
372acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest); 372acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest);
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index dab2ec59a3b0..c785485e62a6 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -136,7 +136,7 @@
136 136
137/*! [Begin] no source code translation */ 137/*! [Begin] no source code translation */
138 138
139#if defined(__linux__) 139#if defined(_LINUX) || defined(__linux__)
140#include "aclinux.h" 140#include "aclinux.h"
141 141
142#elif defined(_AED_EFI) 142#elif defined(_AED_EFI)
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index a568717f98c6..6ed15a0978eb 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -91,7 +91,10 @@
91#define ACPI_USE_NATIVE_DIVIDE 91#define ACPI_USE_NATIVE_DIVIDE
92#endif 92#endif
93 93
94#ifndef __cdecl
94#define __cdecl 95#define __cdecl
96#endif
97
95#define ACPI_FLUSH_CPU_CACHE() 98#define ACPI_FLUSH_CPU_CACHE()
96#endif /* __KERNEL__ */ 99#endif /* __KERNEL__ */
97 100
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index b4b0ffdab098..ec3ffdadb4d2 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -21,6 +21,8 @@
21#define ACPI_PSD_REV0_REVISION 0 /* Support for _PSD as in ACPI 3.0 */ 21#define ACPI_PSD_REV0_REVISION 0 /* Support for _PSD as in ACPI 3.0 */
22#define ACPI_PSD_REV0_ENTRIES 5 22#define ACPI_PSD_REV0_ENTRIES 5
23 23
24#define ACPI_TSD_REV0_REVISION 0 /* Support for _PSD as in ACPI 3.0 */
25#define ACPI_TSD_REV0_ENTRIES 5
24/* 26/*
25 * Types of coordination defined in ACPI 3.0. Same macros can be used across 27 * Types of coordination defined in ACPI 3.0. Same macros can be used across
26 * P, C and T states 28 * P, C and T states
@@ -125,17 +127,53 @@ struct acpi_processor_performance {
125 127
126/* Throttling Control */ 128/* Throttling Control */
127 129
130struct acpi_tsd_package {
131 acpi_integer num_entries;
132 acpi_integer revision;
133 acpi_integer domain;
134 acpi_integer coord_type;
135 acpi_integer num_processors;
136} __attribute__ ((packed));
137
138struct acpi_ptc_register {
139 u8 descriptor;
140 u16 length;
141 u8 space_id;
142 u8 bit_width;
143 u8 bit_offset;
144 u8 reserved;
145 u64 address;
146} __attribute__ ((packed));
147
148struct acpi_processor_tx_tss {
149 acpi_integer freqpercentage; /* */
150 acpi_integer power; /* milliWatts */
151 acpi_integer transition_latency; /* microseconds */
152 acpi_integer control; /* control value */
153 acpi_integer status; /* success indicator */
154};
128struct acpi_processor_tx { 155struct acpi_processor_tx {
129 u16 power; 156 u16 power;
130 u16 performance; 157 u16 performance;
131}; 158};
132 159
160struct acpi_processor;
133struct acpi_processor_throttling { 161struct acpi_processor_throttling {
134 int state; 162 unsigned int state;
163 unsigned int platform_limit;
164 struct acpi_pct_register control_register;
165 struct acpi_pct_register status_register;
166 unsigned int state_count;
167 struct acpi_processor_tx_tss *states_tss;
168 struct acpi_tsd_package domain_info;
169 cpumask_t shared_cpu_map;
170 int (*acpi_processor_get_throttling) (struct acpi_processor * pr);
171 int (*acpi_processor_set_throttling) (struct acpi_processor * pr,
172 int state);
173
135 u32 address; 174 u32 address;
136 u8 duty_offset; 175 u8 duty_offset;
137 u8 duty_width; 176 u8 duty_width;
138 int state_count;
139 struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING]; 177 struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING];
140}; 178};
141 179
@@ -169,6 +207,9 @@ struct acpi_processor {
169 u32 id; 207 u32 id;
170 u32 pblk; 208 u32 pblk;
171 int performance_platform_limit; 209 int performance_platform_limit;
210 int throttling_platform_limit;
211 /* 0 - states 0..n-th state available */
212
172 struct acpi_processor_flags flags; 213 struct acpi_processor_flags flags;
173 struct acpi_processor_power power; 214 struct acpi_processor_power power;
174 struct acpi_processor_performance *performance; 215 struct acpi_processor_performance *performance;
@@ -191,7 +232,7 @@ struct acpi_processor_errata {
191 232
192extern int acpi_processor_preregister_performance(struct 233extern int acpi_processor_preregister_performance(struct
193 acpi_processor_performance 234 acpi_processor_performance
194 **performance); 235 *performance);
195 236
196extern int acpi_processor_register_performance(struct acpi_processor_performance 237extern int acpi_processor_register_performance(struct acpi_processor_performance
197 *performance, unsigned int cpu); 238 *performance, unsigned int cpu);
@@ -270,7 +311,7 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
270 311
271/* in processor_throttling.c */ 312/* in processor_throttling.c */
272int acpi_processor_get_throttling_info(struct acpi_processor *pr); 313int acpi_processor_get_throttling_info(struct acpi_processor *pr);
273int acpi_processor_set_throttling(struct acpi_processor *pr, int state); 314extern int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
274extern struct file_operations acpi_processor_throttling_fops; 315extern struct file_operations acpi_processor_throttling_fops;
275 316
276/* in processor_idle.c */ 317/* in processor_idle.c */
diff --git a/include/asm-alpha/a.out.h b/include/asm-alpha/a.out.h
index d97daf42753d..e43cf61649a9 100644
--- a/include/asm-alpha/a.out.h
+++ b/include/asm-alpha/a.out.h
@@ -101,6 +101,8 @@ struct exec
101#define STACK_TOP \ 101#define STACK_TOP \
102 (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL) 102 (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
103 103
104#define STACK_TOP_MAX 0x00120000000UL
105
104#endif 106#endif
105 107
106#endif /* __A_OUT_GNU_H__ */ 108#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h
index 3a0cbeb03fa1..9e71201000d5 100644
--- a/include/asm-alpha/bitops.h
+++ b/include/asm-alpha/bitops.h
@@ -324,7 +324,7 @@ static inline int fls64(unsigned long x)
324{ 324{
325 unsigned long t, a, r; 325 unsigned long t, a, r;
326 326
327 t = __kernel_cmpbge (x, 0x0101010101010101); 327 t = __kernel_cmpbge (x, 0x0101010101010101UL);
328 a = __flsm1_tab[t]; 328 a = __flsm1_tab[t];
329 t = __kernel_extbl (x, a); 329 t = __kernel_extbl (x, a);
330 r = a*8 + __flsm1_tab[t] + (x != 0); 330 r = a*8 + __flsm1_tab[t] + (x != 0);
diff --git a/include/asm-alpha/fcntl.h b/include/asm-alpha/fcntl.h
index 87f2cf459e26..25da0017ec87 100644
--- a/include/asm-alpha/fcntl.h
+++ b/include/asm-alpha/fcntl.h
@@ -16,6 +16,7 @@
16#define O_LARGEFILE 0400000 /* will be set by the kernel on every open */ 16#define O_LARGEFILE 0400000 /* will be set by the kernel on every open */
17#define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */ 17#define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */
18#define O_NOATIME 04000000 18#define O_NOATIME 04000000
19#define O_CLOEXEC 010000000 /* set close_on_exec */
19 20
20#define F_GETLK 7 21#define F_GETLK 7
21#define F_SETLK 8 22#define F_SETLK 8
diff --git a/include/asm-alpha/irq.h b/include/asm-alpha/irq.h
index 917b9fe372cf..06377400dc09 100644
--- a/include/asm-alpha/irq.h
+++ b/include/asm-alpha/irq.h
@@ -85,10 +85,6 @@ static __inline__ int irq_canonicalize(int irq)
85 return ((irq == 2) ? 9 : irq); 85 return ((irq == 2) ? 9 : irq);
86} 86}
87 87
88extern void disable_irq(unsigned int);
89extern void disable_irq_nosync(unsigned int);
90extern void enable_irq(unsigned int);
91
92struct pt_regs; 88struct pt_regs;
93extern void (*perf_irq)(unsigned long, struct pt_regs *); 89extern void (*perf_irq)(unsigned long, struct pt_regs *);
94 90
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
index cf1021a97b2e..620c4d86cbf4 100644
--- a/include/asm-alpha/system.h
+++ b/include/asm-alpha/system.h
@@ -139,16 +139,6 @@ extern void halt(void) __attribute__((noreturn));
139struct task_struct; 139struct task_struct;
140extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); 140extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*);
141 141
142/*
143 * On SMP systems, when the scheduler does migration-cost autodetection,
144 * it needs a way to flush as much of the CPU's caches as possible.
145 *
146 * TODO: fill this in!
147 */
148static inline void sched_cacheflush(void)
149{
150}
151
152#define imb() \ 142#define imb() \
153__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") 143__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory")
154 144
diff --git a/include/asm-alpha/thread_info.h b/include/asm-alpha/thread_info.h
index 48a22e3e6f32..fb3185196298 100644
--- a/include/asm-alpha/thread_info.h
+++ b/include/asm-alpha/thread_info.h
@@ -67,28 +67,24 @@ register struct thread_info *__current_thread_info __asm__("$8");
67 * TIF_SYSCALL_TRACE is known to be 0 via blbs. 67 * TIF_SYSCALL_TRACE is known to be 0 via blbs.
68 */ 68 */
69#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 69#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
70#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 70#define TIF_SIGPENDING 1 /* signal pending */
71#define TIF_SIGPENDING 2 /* signal pending */ 71#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
72#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 72#define TIF_POLLING_NRFLAG 3 /* poll_idle is polling NEED_RESCHED */
73#define TIF_POLLING_NRFLAG 4 /* poll_idle is polling NEED_RESCHED */ 73#define TIF_DIE_IF_KERNEL 4 /* dik recursion lock */
74#define TIF_DIE_IF_KERNEL 5 /* dik recursion lock */ 74#define TIF_UAC_NOPRINT 5 /* see sysinfo.h */
75#define TIF_UAC_NOPRINT 6 /* see sysinfo.h */ 75#define TIF_UAC_NOFIX 6
76#define TIF_UAC_NOFIX 7 76#define TIF_UAC_SIGBUS 7
77#define TIF_UAC_SIGBUS 8 77#define TIF_MEMDIE 8
78#define TIF_MEMDIE 9 78#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */
79#define TIF_RESTORE_SIGMASK 10 /* restore signal mask in do_signal */
80 79
81#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 80#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
82#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
83#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 81#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
84#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 82#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
85#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 83#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
86#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 84#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
87 85
88/* Work to do on interrupt/exception return. */ 86/* Work to do on interrupt/exception return. */
89#define _TIF_WORK_MASK (_TIF_NOTIFY_RESUME \ 87#define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
90 | _TIF_SIGPENDING \
91 | _TIF_NEED_RESCHED)
92 88
93/* Work to do on any return to userspace. */ 89/* Work to do on any return to userspace. */
94#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \ 90#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \
diff --git a/include/asm-arm/a.out.h b/include/asm-arm/a.out.h
index 3e5fe64c4394..d7165e86df25 100644
--- a/include/asm-arm/a.out.h
+++ b/include/asm-arm/a.out.h
@@ -30,6 +30,7 @@ struct exec
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \ 31#define STACK_TOP ((current->personality == PER_LINUX_32BIT) ? \
32 TASK_SIZE : TASK_SIZE_26) 32 TASK_SIZE : TASK_SIZE_26)
33#define STACK_TOP_MAX TASK_SIZE
33#endif 34#endif
34 35
35#ifndef LIBRARY_START_TEXT 36#ifndef LIBRARY_START_TEXT
diff --git a/include/asm-arm/arch-at91/at91_mci.h b/include/asm-arm/arch-at91/at91_mci.h
index 40a9876b661a..c2e11cc374ba 100644
--- a/include/asm-arm/arch-at91/at91_mci.h
+++ b/include/asm-arm/arch-at91/at91_mci.h
@@ -26,6 +26,9 @@
26#define AT91_MCI_MR 0x04 /* Mode Register */ 26#define AT91_MCI_MR 0x04 /* Mode Register */
27#define AT91_MCI_CLKDIV (0xff << 0) /* Clock Divider */ 27#define AT91_MCI_CLKDIV (0xff << 0) /* Clock Divider */
28#define AT91_MCI_PWSDIV (7 << 8) /* Power Saving Divider */ 28#define AT91_MCI_PWSDIV (7 << 8) /* Power Saving Divider */
29#define AT91_MCI_RDPROOF (1 << 11) /* Read Proof Enable [SAM926[03] only] */
30#define AT91_MCI_WRPROOF (1 << 12) /* Write Proof Enable [SAM926[03] only] */
31#define AT91_MCI_PDCFBYTE (1 << 13) /* PDC Force Byte Transfer [SAM926[03] only] */
29#define AT91_MCI_PDCPADV (1 << 14) /* PDC Padding Value */ 32#define AT91_MCI_PDCPADV (1 << 14) /* PDC Padding Value */
30#define AT91_MCI_PDCMODE (1 << 15) /* PDC-orientated Mode */ 33#define AT91_MCI_PDCMODE (1 << 15) /* PDC-orientated Mode */
31#define AT91_MCI_BLKLEN (0xfff << 18) /* Data Block Length */ 34#define AT91_MCI_BLKLEN (0xfff << 18) /* Data Block Length */
diff --git a/include/asm-arm/arch-at91/irqs.h b/include/asm-arm/arch-at91/irqs.h
index 1127a3b5e928..70b1216dce5d 100644
--- a/include/asm-arm/arch-at91/irqs.h
+++ b/include/asm-arm/arch-at91/irqs.h
@@ -42,4 +42,7 @@
42 */ 42 */
43#define NR_IRQS (NR_AIC_IRQS + (5 * 32)) 43#define NR_IRQS (NR_AIC_IRQS + (5 * 32))
44 44
45/* FIQ is AIC source 0. */
46#define FIQ_START AT91_ID_FIQ
47
45#endif 48#endif
diff --git a/include/asm-arm/arch-iop13xx/iop13xx.h b/include/asm-arm/arch-iop13xx/iop13xx.h
index d4e4f828577c..52b7fab7ef60 100644
--- a/include/asm-arm/arch-iop13xx/iop13xx.h
+++ b/include/asm-arm/arch-iop13xx/iop13xx.h
@@ -19,6 +19,39 @@ static inline int iop13xx_cpu_id(void)
19 return id; 19 return id;
20} 20}
21 21
22/* WDTCR CP6 R7 Page 9 */
23static inline u32 read_wdtcr(void)
24{
25 u32 val;
26 asm volatile("mrc p6, 0, %0, c7, c9, 0":"=r" (val));
27 return val;
28}
29static inline void write_wdtcr(u32 val)
30{
31 asm volatile("mcr p6, 0, %0, c7, c9, 0"::"r" (val));
32}
33
34/* WDTSR CP6 R8 Page 9 */
35static inline u32 read_wdtsr(void)
36{
37 u32 val;
38 asm volatile("mrc p6, 0, %0, c8, c9, 0":"=r" (val));
39 return val;
40}
41static inline void write_wdtsr(u32 val)
42{
43 asm volatile("mcr p6, 0, %0, c8, c9, 0"::"r" (val));
44}
45
46/* RCSR - Reset Cause Status Register */
47static inline u32 read_rcsr(void)
48{
49 u32 val;
50 asm volatile("mrc p6, 0, %0, c0, c1, 0":"=r" (val));
51 return val;
52}
53
54extern unsigned long get_iop_tick_rate(void);
22#endif 55#endif
23 56
24/* 57/*
@@ -480,4 +513,14 @@ static inline int iop13xx_cpu_id(void)
480#define IOP13XX_PBI_LR1 IOP13XX_PBI_OFFSET(0x14) 513#define IOP13XX_PBI_LR1 IOP13XX_PBI_OFFSET(0x14)
481 514
482#define IOP13XX_PROCESSOR_FREQ IOP13XX_REG_ADDR32(0x2180) 515#define IOP13XX_PROCESSOR_FREQ IOP13XX_REG_ADDR32(0x2180)
516
517/* Watchdog timer definitions */
518#define IOP_WDTCR_EN_ARM 0x1e1e1e1e
519#define IOP_WDTCR_EN 0xe1e1e1e1
520#define IOP_WDTCR_DIS_ARM 0x1f1f1f1f
521#define IOP_WDTCR_DIS 0xf1f1f1f1
522#define IOP_RCSR_WDT (1 << 5) /* reset caused by watchdog timer */
523#define IOP13XX_WDTSR_WRITE_EN (1 << 31) /* used to speed up reset requests */
524#define IOP13XX_WDTCR_IB_RESET (1 << 0)
525
483#endif /* _IOP13XX_HW_H_ */ 526#endif /* _IOP13XX_HW_H_ */
diff --git a/include/asm-arm/arch-iop13xx/system.h b/include/asm-arm/arch-iop13xx/system.h
index 127827058e1f..8575af8db78c 100644
--- a/include/asm-arm/arch-iop13xx/system.h
+++ b/include/asm-arm/arch-iop13xx/system.h
@@ -13,43 +13,13 @@ static inline void arch_idle(void)
13 cpu_do_idle(); 13 cpu_do_idle();
14} 14}
15 15
16/* WDTCR CP6 R7 Page 9 */
17static inline u32 read_wdtcr(void)
18{
19 u32 val;
20 asm volatile("mrc p6, 0, %0, c7, c9, 0":"=r" (val));
21 return val;
22}
23static inline void write_wdtcr(u32 val)
24{
25 asm volatile("mcr p6, 0, %0, c7, c9, 0"::"r" (val));
26}
27
28/* WDTSR CP6 R8 Page 9 */
29static inline u32 read_wdtsr(void)
30{
31 u32 val;
32 asm volatile("mrc p6, 0, %0, c8, c9, 0":"=r" (val));
33 return val;
34}
35static inline void write_wdtsr(u32 val)
36{
37 asm volatile("mcr p6, 0, %0, c8, c9, 0"::"r" (val));
38}
39
40#define IOP13XX_WDTCR_EN_ARM 0x1e1e1e1e
41#define IOP13XX_WDTCR_EN 0xe1e1e1e1
42#define IOP13XX_WDTCR_DIS_ARM 0x1f1f1f1f
43#define IOP13XX_WDTCR_DIS 0xf1f1f1f1
44#define IOP13XX_WDTSR_WRITE_EN (1 << 31)
45#define IOP13XX_WDTCR_IB_RESET (1 << 0)
46static inline void arch_reset(char mode) 16static inline void arch_reset(char mode)
47{ 17{
48 /* 18 /*
49 * Reset the internal bus (warning both cores are reset) 19 * Reset the internal bus (warning both cores are reset)
50 */ 20 */
51 write_wdtcr(IOP13XX_WDTCR_EN_ARM); 21 write_wdtcr(IOP_WDTCR_EN_ARM);
52 write_wdtcr(IOP13XX_WDTCR_EN); 22 write_wdtcr(IOP_WDTCR_EN);
53 write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET); 23 write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET);
54 write_wdtcr(0x1000); 24 write_wdtcr(0x1000);
55 25
diff --git a/include/asm-arm/arch-iop13xx/uncompress.h b/include/asm-arm/arch-iop13xx/uncompress.h
index b9525d59b7ad..dd9c2934190e 100644
--- a/include/asm-arm/arch-iop13xx/uncompress.h
+++ b/include/asm-arm/arch-iop13xx/uncompress.h
@@ -1,7 +1,6 @@
1#include <asm/types.h> 1#include <asm/types.h>
2#include <linux/serial_reg.h> 2#include <linux/serial_reg.h>
3#include <asm/hardware.h> 3#include <asm/hardware.h>
4#include <asm/processor.h>
5 4
6#define UART_BASE ((volatile u32 *)IOP13XX_UART1_PHYS) 5#define UART_BASE ((volatile u32 *)IOP13XX_UART1_PHYS)
7#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE) 6#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
@@ -9,7 +8,7 @@
9static inline void putc(char c) 8static inline void putc(char c)
10{ 9{
11 while ((UART_BASE[UART_LSR] & TX_DONE) != TX_DONE) 10 while ((UART_BASE[UART_LSR] & TX_DONE) != TX_DONE)
12 cpu_relax(); 11 barrier();
13 UART_BASE[UART_TX] = c; 12 UART_BASE[UART_TX] = c;
14} 13}
15 14
diff --git a/include/asm-arm/arch-iop32x/uncompress.h b/include/asm-arm/arch-iop32x/uncompress.h
index e64f52bf2bce..070f15818fe7 100644
--- a/include/asm-arm/arch-iop32x/uncompress.h
+++ b/include/asm-arm/arch-iop32x/uncompress.h
@@ -26,7 +26,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
26{ 26{
27 if (machine_is_iq80321()) 27 if (machine_is_iq80321())
28 uart_base = (volatile u8 *)IQ80321_UART; 28 uart_base = (volatile u8 *)IQ80321_UART;
29 else if (machine_is_iq31244()) 29 else if (machine_is_iq31244() || machine_is_em7210())
30 uart_base = (volatile u8 *)IQ31244_UART; 30 uart_base = (volatile u8 *)IQ31244_UART;
31 else 31 else
32 uart_base = (volatile u8 *)0xfe800000; 32 uart_base = (volatile u8 *)0xfe800000;
diff --git a/include/asm-arm/arch-mxc/board-mx31ads.h b/include/asm-arm/arch-mxc/board-mx31ads.h
new file mode 100644
index 000000000000..be29b83ad4ae
--- /dev/null
+++ b/include/asm-arm/arch-mxc/board-mx31ads.h
@@ -0,0 +1,142 @@
1/*
2 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_BOARD_MX31ADS_H__
12#define __ASM_ARCH_MXC_BOARD_MX31ADS_H__
13
14/*!
15 * @name PBC Controller parameters
16 */
17/*! @{ */
18/*!
19 * Base address of PBC controller
20 */
21#define PBC_BASE_ADDRESS IO_ADDRESS(CS4_BASE_ADDR)
22/* Offsets for the PBC Controller register */
23/*!
24 * PBC Board status register offset
25 */
26#define PBC_BSTAT 0x000002
27/*!
28 * PBC Board control register 1 set address.
29 */
30#define PBC_BCTRL1_SET 0x000004
31/*!
32 * PBC Board control register 1 clear address.
33 */
34#define PBC_BCTRL1_CLEAR 0x000006
35/*!
36 * PBC Board control register 2 set address.
37 */
38#define PBC_BCTRL2_SET 0x000008
39/*!
40 * PBC Board control register 2 clear address.
41 */
42#define PBC_BCTRL2_CLEAR 0x00000A
43/*!
44 * PBC Board control register 3 set address.
45 */
46#define PBC_BCTRL3_SET 0x00000C
47/*!
48 * PBC Board control register 3 clear address.
49 */
50#define PBC_BCTRL3_CLEAR 0x00000E
51/*!
52 * PBC Board control register 4 set address.
53 */
54#define PBC_BCTRL4_SET 0x000010
55/*!
56 * PBC Board control register 4 clear address.
57 */
58#define PBC_BCTRL4_CLEAR 0x000012
59/*!
60 * PBC Board status register 1.
61 */
62#define PBC_BSTAT1 0x000014
63/*!
64 * PBC Board interrupt status register.
65 */
66#define PBC_INTSTATUS 0x000016
67/*!
68 * PBC Board interrupt current status register.
69 */
70#define PBC_INTCURR_STATUS 0x000018
71/*!
72 * PBC Interrupt mask register set address.
73 */
74#define PBC_INTMASK_SET 0x00001A
75/*!
76 * PBC Interrupt mask register clear address.
77 */
78#define PBC_INTMASK_CLEAR 0x00001C
79
80/*!
81 * External UART A.
82 */
83#define PBC_SC16C652_UARTA 0x010000
84/*!
85 * External UART B.
86 */
87#define PBC_SC16C652_UARTB 0x010010
88/*!
89 * Ethernet Controller IO base address.
90 */
91#define PBC_CS8900A_IOBASE 0x020000
92/*!
93 * Ethernet Controller Memory base address.
94 */
95#define PBC_CS8900A_MEMBASE 0x021000
96/*!
97 * Ethernet Controller DMA base address.
98 */
99#define PBC_CS8900A_DMABASE 0x022000
100/*!
101 * External chip select 0.
102 */
103#define PBC_XCS0 0x040000
104/*!
105 * LCD Display enable.
106 */
107#define PBC_LCD_EN_B 0x060000
108/*!
109 * Code test debug enable.
110 */
111#define PBC_CODE_B 0x070000
112/*!
113 * PSRAM memory select.
114 */
115#define PBC_PSRAM_B 0x5000000
116
117#define PBC_INTSTATUS_REG (PBC_INTSTATUS + PBC_BASE_ADDRESS)
118#define PBC_INTCURR_STATUS_REG (PBC_INTCURR_STATUS + PBC_BASE_ADDRESS)
119#define PBC_INTMASK_SET_REG (PBC_INTMASK_SET + PBC_BASE_ADDRESS)
120#define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS)
121#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_4)
122
123#define EXPIO_INT_LOW_BAT (MXC_EXP_IO_BASE + 0)
124#define EXPIO_INT_PB_IRQ (MXC_EXP_IO_BASE + 1)
125#define EXPIO_INT_OTG_FS_OVR (MXC_EXP_IO_BASE + 2)
126#define EXPIO_INT_FSH_OVR (MXC_EXP_IO_BASE + 3)
127#define EXPIO_INT_RES4 (MXC_EXP_IO_BASE + 4)
128#define EXPIO_INT_RES5 (MXC_EXP_IO_BASE + 5)
129#define EXPIO_INT_RES6 (MXC_EXP_IO_BASE + 6)
130#define EXPIO_INT_RES7 (MXC_EXP_IO_BASE + 7)
131#define EXPIO_INT_ENET_INT (MXC_EXP_IO_BASE + 8)
132#define EXPIO_INT_OTG_FS_INT (MXC_EXP_IO_BASE + 9)
133#define EXPIO_INT_XUART_INTA (MXC_EXP_IO_BASE + 10)
134#define EXPIO_INT_XUART_INTB (MXC_EXP_IO_BASE + 11)
135#define EXPIO_INT_SYNTH_IRQ (MXC_EXP_IO_BASE + 12)
136#define EXPIO_INT_CE_INT1 (MXC_EXP_IO_BASE + 13)
137#define EXPIO_INT_CE_INT2 (MXC_EXP_IO_BASE + 14)
138#define EXPIO_INT_RES15 (MXC_EXP_IO_BASE + 15)
139
140#define MXC_MAX_EXP_IO_LINES 16
141
142#endif /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */
diff --git a/include/asm-arm/arch-mxc/common.h b/include/asm-arm/arch-mxc/common.h
new file mode 100644
index 000000000000..23b4350edbd6
--- /dev/null
+++ b/include/asm-arm/arch-mxc/common.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_COMMON_H__
12#define __ASM_ARCH_MXC_COMMON_H__
13
14struct sys_timer;
15
16extern void mxc_map_io(void);
17extern void mxc_init_irq(void);
18extern struct sys_timer mxc_timer;
19
20#endif
diff --git a/include/asm-arm/arch-mxc/dma.h b/include/asm-arm/arch-mxc/dma.h
new file mode 100644
index 000000000000..65e639d51d2b
--- /dev/null
+++ b/include/asm-arm/arch-mxc/dma.h
@@ -0,0 +1,21 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_DMA_H__
12#define __ASM_ARCH_MXC_DMA_H__
13
14/*!
15 * @file dma.h
16 * @brief This file contains Unified DMA API for all MXC platforms.
17 * The API is platform independent.
18 *
19 * @ingroup SDMA
20 */
21#endif
diff --git a/include/asm-arm/arch-mxc/entry-macro.S b/include/asm-arm/arch-mxc/entry-macro.S
new file mode 100644
index 000000000000..b542433afb1b
--- /dev/null
+++ b/include/asm-arm/arch-mxc/entry-macro.S
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2007 Lennert Buytenhek <buytenh@wantstofly.org>
3 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
4 */
5
6/*
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12 @ this macro disables fast irq (not implemented)
13 .macro disable_fiq
14 .endm
15
16 .macro get_irqnr_preamble, base, tmp
17 .endm
18
19 .macro arch_ret_to_user, tmp1, tmp2
20 .endm
21
22 @ this macro checks which interrupt occured
23 @ and returns its number in irqnr
24 @ and returns if an interrupt occured in irqstat
25 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
26 ldr \base, =AVIC_IO_ADDRESS(AVIC_BASE_ADDR)
27 @ Load offset & priority of the highest priority
28 @ interrupt pending from AVIC_NIVECSR
29 ldr \irqstat, [\base, #0x40]
30 @ Shift to get the decoded IRQ number, using ASR so
31 @ 'no interrupt pending' becomes 0xffffffff
32 mov \irqnr, \irqstat, asr #16
33 @ set zero flag if IRQ + 1 == 0
34 adds \tmp, \irqnr, #1
35 .endm
36
37 @ irq priority table (not used)
38 .macro irq_prio_table
39 .endm
diff --git a/include/asm-arm/arch-mxc/hardware.h b/include/asm-arm/arch-mxc/hardware.h
new file mode 100644
index 000000000000..3c09b92fef0d
--- /dev/null
+++ b/include/asm-arm/arch-mxc/hardware.h
@@ -0,0 +1,52 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/*!
12 * @file hardware.h
13 * @brief This file contains the hardware definitions of the board.
14 *
15 * @ingroup System
16 */
17#ifndef __ASM_ARCH_MXC_HARDWARE_H__
18#define __ASM_ARCH_MXC_HARDWARE_H__
19
20#include <asm/sizes.h>
21
22#include <asm/arch/mx31.h>
23
24#include <asm/arch/mxc.h>
25
26#define MXC_MAX_GPIO_LINES (GPIO_NUM_PIN * GPIO_PORT_NUM)
27
28/*
29 * ---------------------------------------------------------------------------
30 * Board specific defines
31 * ---------------------------------------------------------------------------
32 */
33#define MXC_EXP_IO_BASE (MXC_GPIO_INT_BASE + MXC_MAX_GPIO_LINES)
34
35#include <asm/arch/board-mx31ads.h>
36
37#ifndef MXC_MAX_EXP_IO_LINES
38#define MXC_MAX_EXP_IO_LINES 0
39#endif
40
41#define MXC_MAX_VIRTUAL_INTS 16
42#define MXC_VIRTUAL_INTS_BASE (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES)
43#define MXC_SDIO1_CARD_IRQ MXC_VIRTUAL_INTS_BASE
44#define MXC_SDIO2_CARD_IRQ (MXC_VIRTUAL_INTS_BASE + 1)
45#define MXC_SDIO3_CARD_IRQ (MXC_VIRTUAL_INTS_BASE + 2)
46
47#define MXC_MAX_INTS (MXC_MAX_INT_LINES + \
48 MXC_MAX_GPIO_LINES + \
49 MXC_MAX_EXP_IO_LINES + \
50 MXC_MAX_VIRTUAL_INTS)
51
52#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */
diff --git a/include/asm-arm/arch-mxc/io.h b/include/asm-arm/arch-mxc/io.h
new file mode 100644
index 000000000000..cf6c83a4b9f7
--- /dev/null
+++ b/include/asm-arm/arch-mxc/io.h
@@ -0,0 +1,33 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/*!
12 * @file io.h
13 * @brief This file contains some memory mapping macros.
14 * @note There is no real ISA or PCI buses. But have to define these macros
15 * for some drivers to compile.
16 *
17 * @ingroup System
18 */
19
20#ifndef __ASM_ARCH_MXC_IO_H__
21#define __ASM_ARCH_MXC_IO_H__
22
23/*! Allow IO space to be anywhere in the memory */
24#define IO_SPACE_LIMIT 0xffffffff
25
26/*!
27 * io address mapping macro
28 */
29#define __io(a) ((void __iomem *)(a))
30
31#define __mem_pci(a) (a)
32
33#endif
diff --git a/include/asm-arm/arch-mxc/irqs.h b/include/asm-arm/arch-mxc/irqs.h
new file mode 100644
index 000000000000..e4686c6bc4bf
--- /dev/null
+++ b/include/asm-arm/arch-mxc/irqs.h
@@ -0,0 +1,38 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_IRQS_H__
12#define __ASM_ARCH_MXC_IRQS_H__
13
14#include <asm/hardware.h>
15
16/*!
17 * @file irqs.h
18 * @brief This file defines the number of normal interrupts and fast interrupts
19 *
20 * @ingroup Interrupt
21 */
22
23#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE)
24
25#define MXC_IRQ_TO_GPIO(irq) ((irq) - MXC_GPIO_INT_BASE)
26#define MXC_GPIO_TO_IRQ(x) (MXC_GPIO_INT_BASE + x)
27
28/*!
29 * Number of normal interrupts
30 */
31#define NR_IRQS MXC_MAX_INTS
32
33/*!
34 * Number of fast interrupts
35 */
36#define NR_FIQS MXC_MAX_INTS
37
38#endif /* __ASM_ARCH_MXC_IRQS_H__ */
diff --git a/include/asm-arm/arch-mxc/memory.h b/include/asm-arm/arch-mxc/memory.h
new file mode 100644
index 000000000000..c89aac83a407
--- /dev/null
+++ b/include/asm-arm/arch-mxc/memory.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_MEMORY_H__
12#define __ASM_ARCH_MXC_MEMORY_H__
13
14#include <asm/hardware.h>
15
16/*!
17 * @file memory.h
18 * @brief This file contains macros needed by the Linux kernel and drivers.
19 *
20 * @ingroup Memory
21 */
22
23/*!
24 * Virtual view <-> DMA view memory address translations
25 * This macro is used to translate the virtual address to an address
26 * suitable to be passed to set_dma_addr()
27 */
28#define __virt_to_bus(a) __virt_to_phys(a)
29
30/*!
31 * Used to convert an address for DMA operations to an address that the
32 * kernel can use.
33 */
34#define __bus_to_virt(a) __phys_to_virt(a)
35
36#endif /* __ASM_ARCH_MXC_MEMORY_H__ */
diff --git a/include/asm-arm/arch-mxc/mx31.h b/include/asm-arm/arch-mxc/mx31.h
new file mode 100644
index 000000000000..85c49c9e5d15
--- /dev/null
+++ b/include/asm-arm/arch-mxc/mx31.h
@@ -0,0 +1,335 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_MX31_H__
12#define __ASM_ARCH_MXC_MX31_H__
13
14#ifndef __ASM_ARCH_MXC_HARDWARE_H__
15#error "Do not include directly."
16#endif
17
18/*!
19 * defines the hardware clock tick rate
20 */
21#define CLOCK_TICK_RATE 16625000
22
23/*
24 * MX31 memory map:
25 *
26 * Virt Phys Size What
27 * ---------------------------------------------------------------------------
28 * F8000000 1FFC0000 16K IRAM
29 * F9000000 30000000 256M L2CC
30 * FC000000 43F00000 1M AIPS 1
31 * FC100000 50000000 1M SPBA
32 * FC200000 53F00000 1M AIPS 2
33 * FC500000 60000000 128M ROMPATCH
34 * FC400000 68000000 128M AVIC
35 * 70000000 256M IPU (MAX M2)
36 * 80000000 256M CSD0 SDRAM/DDR
37 * 90000000 256M CSD1 SDRAM/DDR
38 * A0000000 128M CS0 Flash
39 * A8000000 128M CS1 Flash
40 * B0000000 32M CS2
41 * B2000000 32M CS3
42 * F4000000 B4000000 32M CS4
43 * B6000000 32M CS5
44 * FC320000 B8000000 64K NAND, SDRAM, WEIM, M3IF, EMI controllers
45 * C0000000 64M PCMCIA/CF
46 */
47
48#define CS0_BASE_ADDR 0xA0000000
49#define CS1_BASE_ADDR 0xA8000000
50#define CS2_BASE_ADDR 0xB0000000
51#define CS3_BASE_ADDR 0xB2000000
52
53#define CS4_BASE_ADDR 0xB4000000
54#define CS4_BASE_ADDR_VIRT 0xF4000000
55#define CS4_SIZE SZ_32M
56
57#define CS5_BASE_ADDR 0xB6000000
58#define PCMCIA_MEM_BASE_ADDR 0xBC000000
59
60/*
61 * IRAM
62 */
63#define IRAM_BASE_ADDR 0x1FFC0000 /* internal ram */
64#define IRAM_BASE_ADDR_VIRT 0xF8000000
65#define IRAM_SIZE SZ_16K
66
67/*
68 * L2CC
69 */
70#define L2CC_BASE_ADDR 0x30000000
71#define L2CC_BASE_ADDR_VIRT 0xF9000000
72#define L2CC_SIZE SZ_1M
73
74/*
75 * AIPS 1
76 */
77#define AIPS1_BASE_ADDR 0x43F00000
78#define AIPS1_BASE_ADDR_VIRT 0xFC000000
79#define AIPS1_SIZE SZ_1M
80
81#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000)
82#define EVTMON_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000)
83#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000)
84#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000)
85#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000)
86#define ECT_CTIO_BASE_ADDR (AIPS1_BASE_ADDR + 0x00018000)
87#define I2C_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000)
88#define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000)
89#define OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000)
90#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000)
91#define UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000)
92#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000)
93#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000)
94#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000)
95#define SSI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000)
96#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000)
97#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000)
98#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000)
99#define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000)
100#define UART5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000)
101#define ECT_IP1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000)
102#define ECT_IP2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000)
103
104/*
105 * SPBA global module enabled #0
106 */
107#define SPBA0_BASE_ADDR 0x50000000
108#define SPBA0_BASE_ADDR_VIRT 0xFC100000
109#define SPBA0_SIZE SZ_1M
110
111#define MMC_SDHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000)
112#define MMC_SDHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000)
113#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000)
114#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000)
115#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000)
116#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000)
117#define IIM_BASE_ADDR (SPBA0_BASE_ADDR + 0x0001C000)
118#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000)
119#define MSHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000)
120#define MSHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000)
121#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000)
122
123/*
124 * AIPS 2
125 */
126#define AIPS2_BASE_ADDR 0x53F00000
127#define AIPS2_BASE_ADDR_VIRT 0xFC200000
128#define AIPS2_SIZE SZ_1M
129#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000)
130#define CSPI3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000)
131#define FIRI_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000)
132#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000)
133#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000)
134#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000)
135#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000)
136#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000)
137#define SCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AE000)
138#define SMN_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AF000)
139#define RNGA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000)
140#define IPU_CTRL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000)
141#define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000)
142#define MPEG4_ENC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000)
143#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000)
144#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000)
145#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000)
146#define RTC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000)
147#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000)
148#define PWM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000)
149#define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000)
150
151/*
152 * ROMP and AVIC
153 */
154#define ROMP_BASE_ADDR 0x60000000
155#define ROMP_BASE_ADDR_VIRT 0xFC500000
156#define ROMP_SIZE SZ_1M
157
158#define AVIC_BASE_ADDR 0x68000000
159#define AVIC_BASE_ADDR_VIRT 0xFC400000
160#define AVIC_SIZE SZ_1M
161
162/*
163 * NAND, SDRAM, WEIM, M3IF, EMI controllers
164 */
165#define X_MEMC_BASE_ADDR 0xB8000000
166#define X_MEMC_BASE_ADDR_VIRT 0xFC320000
167#define X_MEMC_SIZE SZ_64K
168
169#define NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000)
170#define ESDCTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000)
171#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000)
172#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000)
173#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000)
174#define PCMCIA_CTL_BASE_ADDR EMI_CTL_BASE_ADDR
175
176/*
177 * Memory regions and CS
178 */
179#define IPU_MEM_BASE_ADDR 0x70000000
180#define CSD0_BASE_ADDR 0x80000000
181#define CSD1_BASE_ADDR 0x90000000
182#define CS0_BASE_ADDR 0xA0000000
183#define CS1_BASE_ADDR 0xA8000000
184#define CS2_BASE_ADDR 0xB0000000
185#define CS3_BASE_ADDR 0xB2000000
186
187#define CS4_BASE_ADDR 0xB4000000
188#define CS4_BASE_ADDR_VIRT 0xF4000000
189#define CS4_SIZE SZ_32M
190
191#define CS5_BASE_ADDR 0xB6000000
192#define PCMCIA_MEM_BASE_ADDR 0xBC000000
193
194/*!
195 * This macro defines the physical to virtual address mapping for all the
196 * peripheral modules. It is used by passing in the physical address as x
197 * and returning the virtual address. If the physical address is not mapped,
198 * it returns 0xDEADBEEF
199 */
200#define IO_ADDRESS(x) \
201 (((x >= IRAM_BASE_ADDR) && (x < (IRAM_BASE_ADDR + IRAM_SIZE))) ? IRAM_IO_ADDRESS(x):\
202 ((x >= L2CC_BASE_ADDR) && (x < (L2CC_BASE_ADDR + L2CC_SIZE))) ? L2CC_IO_ADDRESS(x):\
203 ((x >= AIPS1_BASE_ADDR) && (x < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x):\
204 ((x >= SPBA0_BASE_ADDR) && (x < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x):\
205 ((x >= AIPS2_BASE_ADDR) && (x < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x):\
206 ((x >= ROMP_BASE_ADDR) && (x < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x):\
207 ((x >= AVIC_BASE_ADDR) && (x < (AVIC_BASE_ADDR + AVIC_SIZE))) ? AVIC_IO_ADDRESS(x):\
208 ((x >= CS4_BASE_ADDR) && (x < (CS4_BASE_ADDR + CS4_SIZE))) ? CS4_IO_ADDRESS(x):\
209 ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x):\
210 0xDEADBEEF)
211
212/*
213 * define the address mapping macros: in physical address order
214 */
215
216#define IRAM_IO_ADDRESS(x) \
217 (((x) - IRAM_BASE_ADDR) + IRAM_BASE_ADDR_VIRT)
218
219#define L2CC_IO_ADDRESS(x) \
220 (((x) - L2CC_BASE_ADDR) + L2CC_BASE_ADDR_VIRT)
221
222#define AIPS1_IO_ADDRESS(x) \
223 (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT)
224
225#define SPBA0_IO_ADDRESS(x) \
226 (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT)
227
228#define AIPS2_IO_ADDRESS(x) \
229 (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT)
230
231#define ROMP_IO_ADDRESS(x) \
232 (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT)
233
234#define AVIC_IO_ADDRESS(x) \
235 (((x) - AVIC_BASE_ADDR) + AVIC_BASE_ADDR_VIRT)
236
237#define CS4_IO_ADDRESS(x) \
238 (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT)
239
240#define X_MEMC_IO_ADDRESS(x) \
241 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
242
243#define PCMCIA_IO_ADDRESS(x) \
244 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
245
246/* Start of physical RAM - On many MX31 platforms, this is the first SDRAM bank (CSD0) */
247#define PHYS_OFFSET CSD0_BASE_ADDR
248
249/*
250 * Interrupt numbers
251 */
252#define MXC_INT_PEN_ADS7843 0
253#define MXC_INT_RESV1 1
254#define MXC_INT_CS8900A 2
255#define MXC_INT_I2C3 3
256#define MXC_INT_I2C2 4
257#define MXC_INT_MPEG4_ENCODER 5
258#define MXC_INT_RTIC 6
259#define MXC_INT_FIRI 7
260#define MXC_INT_MMC_SDHC2 8
261#define MXC_INT_MMC_SDHC1 9
262#define MXC_INT_I2C 10
263#define MXC_INT_SSI2 11
264#define MXC_INT_SSI1 12
265#define MXC_INT_CSPI2 13
266#define MXC_INT_CSPI1 14
267#define MXC_INT_ATA 15
268#define MXC_INT_MBX 16
269#define MXC_INT_CSPI3 17
270#define MXC_INT_UART3 18
271#define MXC_INT_IIM 19
272#define MXC_INT_SIM2 20
273#define MXC_INT_SIM1 21
274#define MXC_INT_RNGA 22
275#define MXC_INT_EVTMON 23
276#define MXC_INT_KPP 24
277#define MXC_INT_RTC 25
278#define MXC_INT_PWM 26
279#define MXC_INT_EPIT2 27
280#define MXC_INT_EPIT1 28
281#define MXC_INT_GPT 29
282#define MXC_INT_RESV30 30
283#define MXC_INT_RESV31 31
284#define MXC_INT_UART2 32
285#define MXC_INT_NANDFC 33
286#define MXC_INT_SDMA 34
287#define MXC_INT_USB1 35
288#define MXC_INT_USB2 36
289#define MXC_INT_USB3 37
290#define MXC_INT_USB4 38
291#define MXC_INT_MSHC1 39
292#define MXC_INT_MSHC2 40
293#define MXC_INT_IPU_ERR 41
294#define MXC_INT_IPU_SYN 42
295#define MXC_INT_RESV43 43
296#define MXC_INT_RESV44 44
297#define MXC_INT_UART1 45
298#define MXC_INT_UART4 46
299#define MXC_INT_UART5 47
300#define MXC_INT_ECT 48
301#define MXC_INT_SCC_SCM 49
302#define MXC_INT_SCC_SMN 50
303#define MXC_INT_GPIO2 51
304#define MXC_INT_GPIO1 52
305#define MXC_INT_CCM 53
306#define MXC_INT_PCMCIA 54
307#define MXC_INT_WDOG 55
308#define MXC_INT_GPIO3 56
309#define MXC_INT_RESV57 57
310#define MXC_INT_EXT_POWER 58
311#define MXC_INT_EXT_TEMPER 59
312#define MXC_INT_EXT_SENSOR60 60
313#define MXC_INT_EXT_SENSOR61 61
314#define MXC_INT_EXT_WDOG 62
315#define MXC_INT_EXT_TV 63
316
317#define MXC_MAX_INT_LINES 64
318
319#define MXC_GPIO_INT_BASE MXC_MAX_INT_LINES
320
321/*!
322 * Number of GPIO port as defined in the IC Spec
323 */
324#define GPIO_PORT_NUM 3
325/*!
326 * Number of GPIO pins per port
327 */
328#define GPIO_NUM_PIN 32
329
330#define PROD_SIGNATURE 0x1 /* For MX31 */
331
332#define SYSTEM_REV_MIN CHIP_REV_1_0
333#define SYSTEM_REV_NUM 3
334
335#endif /* __ASM_ARCH_MXC_MX31_H__ */
diff --git a/include/asm-arm/arch-mxc/mxc.h b/include/asm-arm/arch-mxc/mxc.h
new file mode 100644
index 000000000000..0837f1f9ca31
--- /dev/null
+++ b/include/asm-arm/arch-mxc/mxc.h
@@ -0,0 +1,149 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_H__
12#define __ASM_ARCH_MXC_H__
13
14#ifndef __ASM_ARCH_MXC_HARDWARE_H__
15#error "Do not include directly."
16#endif
17
18/*
19 *****************************************
20 * GPT Register definitions *
21 *****************************************
22 */
23#define MXC_GPT_GPTCR IO_ADDRESS(GPT1_BASE_ADDR + 0x00)
24#define MXC_GPT_GPTPR IO_ADDRESS(GPT1_BASE_ADDR + 0x04)
25#define MXC_GPT_GPTSR IO_ADDRESS(GPT1_BASE_ADDR + 0x08)
26#define MXC_GPT_GPTIR IO_ADDRESS(GPT1_BASE_ADDR + 0x0C)
27#define MXC_GPT_GPTOCR1 IO_ADDRESS(GPT1_BASE_ADDR + 0x10)
28#define MXC_GPT_GPTOCR2 IO_ADDRESS(GPT1_BASE_ADDR + 0x14)
29#define MXC_GPT_GPTOCR3 IO_ADDRESS(GPT1_BASE_ADDR + 0x18)
30#define MXC_GPT_GPTICR1 IO_ADDRESS(GPT1_BASE_ADDR + 0x1C)
31#define MXC_GPT_GPTICR2 IO_ADDRESS(GPT1_BASE_ADDR + 0x20)
32#define MXC_GPT_GPTCNT IO_ADDRESS(GPT1_BASE_ADDR + 0x24)
33
34/*!
35 * GPT Control register bit definitions
36 */
37#define GPTCR_FO3 (1 << 31)
38#define GPTCR_FO2 (1 << 30)
39#define GPTCR_FO1 (1 << 29)
40
41#define GPTCR_OM3_SHIFT 26
42#define GPTCR_OM3_MASK (7 << GPTCR_OM3_SHIFT)
43#define GPTCR_OM3_DISCONNECTED (0 << GPTCR_OM3_SHIFT)
44#define GPTCR_OM3_TOGGLE (1 << GPTCR_OM3_SHIFT)
45#define GPTCR_OM3_CLEAR (2 << GPTCR_OM3_SHIFT)
46#define GPTCR_OM3_SET (3 << GPTCR_OM3_SHIFT)
47#define GPTCR_OM3_GENERATE_LOW (7 << GPTCR_OM3_SHIFT)
48
49#define GPTCR_OM2_SHIFT 23
50#define GPTCR_OM2_MASK (7 << GPTCR_OM2_SHIFT)
51#define GPTCR_OM2_DISCONNECTED (0 << GPTCR_OM2_SHIFT)
52#define GPTCR_OM2_TOGGLE (1 << GPTCR_OM2_SHIFT)
53#define GPTCR_OM2_CLEAR (2 << GPTCR_OM2_SHIFT)
54#define GPTCR_OM2_SET (3 << GPTCR_OM2_SHIFT)
55#define GPTCR_OM2_GENERATE_LOW (7 << GPTCR_OM2_SHIFT)
56
57#define GPTCR_OM1_SHIFT 20
58#define GPTCR_OM1_MASK (7 << GPTCR_OM1_SHIFT)
59#define GPTCR_OM1_DISCONNECTED (0 << GPTCR_OM1_SHIFT)
60#define GPTCR_OM1_TOGGLE (1 << GPTCR_OM1_SHIFT)
61#define GPTCR_OM1_CLEAR (2 << GPTCR_OM1_SHIFT)
62#define GPTCR_OM1_SET (3 << GPTCR_OM1_SHIFT)
63#define GPTCR_OM1_GENERATE_LOW (7 << GPTCR_OM1_SHIFT)
64
65#define GPTCR_IM2_SHIFT 18
66#define GPTCR_IM2_MASK (3 << GPTCR_IM2_SHIFT)
67#define GPTCR_IM2_CAPTURE_DISABLE (0 << GPTCR_IM2_SHIFT)
68#define GPTCR_IM2_CAPTURE_RISING (1 << GPTCR_IM2_SHIFT)
69#define GPTCR_IM2_CAPTURE_FALLING (2 << GPTCR_IM2_SHIFT)
70#define GPTCR_IM2_CAPTURE_BOTH (3 << GPTCR_IM2_SHIFT)
71
72#define GPTCR_IM1_SHIFT 16
73#define GPTCR_IM1_MASK (3 << GPTCR_IM1_SHIFT)
74#define GPTCR_IM1_CAPTURE_DISABLE (0 << GPTCR_IM1_SHIFT)
75#define GPTCR_IM1_CAPTURE_RISING (1 << GPTCR_IM1_SHIFT)
76#define GPTCR_IM1_CAPTURE_FALLING (2 << GPTCR_IM1_SHIFT)
77#define GPTCR_IM1_CAPTURE_BOTH (3 << GPTCR_IM1_SHIFT)
78
79#define GPTCR_SWR (1 << 15)
80#define GPTCR_FRR (1 << 9)
81
82#define GPTCR_CLKSRC_SHIFT 6
83#define GPTCR_CLKSRC_MASK (7 << GPTCR_CLKSRC_SHIFT)
84#define GPTCR_CLKSRC_NOCLOCK (0 << GPTCR_CLKSRC_SHIFT)
85#define GPTCR_CLKSRC_HIGHFREQ (2 << GPTCR_CLKSRC_SHIFT)
86#define GPTCR_CLKSRC_CLKIN (3 << GPTCR_CLKSRC_SHIFT)
87#define GPTCR_CLKSRC_CLK32K (7 << GPTCR_CLKSRC_SHIFT)
88
89#define GPTCR_STOPEN (1 << 5)
90#define GPTCR_DOZEN (1 << 4)
91#define GPTCR_WAITEN (1 << 3)
92#define GPTCR_DBGEN (1 << 2)
93
94#define GPTCR_ENMOD (1 << 1)
95#define GPTCR_ENABLE (1 << 0)
96
97#define GPTSR_OF1 (1 << 0)
98#define GPTSR_OF2 (1 << 1)
99#define GPTSR_OF3 (1 << 2)
100#define GPTSR_IF1 (1 << 3)
101#define GPTSR_IF2 (1 << 4)
102#define GPTSR_ROV (1 << 5)
103
104#define GPTIR_OF1IE GPTSR_OF1
105#define GPTIR_OF2IE GPTSR_OF2
106#define GPTIR_OF3IE GPTSR_OF3
107#define GPTIR_IF1IE GPTSR_IF1
108#define GPTIR_IF2IE GPTSR_IF2
109#define GPTIR_ROVIE GPTSR_ROV
110
111/*
112 *****************************************
113 * AVIC Registers *
114 *****************************************
115 */
116#define AVIC_BASE IO_ADDRESS(AVIC_BASE_ADDR)
117#define AVIC_INTCNTL (AVIC_BASE + 0x00) /* int control reg */
118#define AVIC_NIMASK (AVIC_BASE + 0x04) /* int mask reg */
119#define AVIC_INTENNUM (AVIC_BASE + 0x08) /* int enable number reg */
120#define AVIC_INTDISNUM (AVIC_BASE + 0x0C) /* int disable number reg */
121#define AVIC_INTENABLEH (AVIC_BASE + 0x10) /* int enable reg high */
122#define AVIC_INTENABLEL (AVIC_BASE + 0x14) /* int enable reg low */
123#define AVIC_INTTYPEH (AVIC_BASE + 0x18) /* int type reg high */
124#define AVIC_INTTYPEL (AVIC_BASE + 0x1C) /* int type reg low */
125#define AVIC_NIPRIORITY7 (AVIC_BASE + 0x20) /* norm int priority lvl7 */
126#define AVIC_NIPRIORITY6 (AVIC_BASE + 0x24) /* norm int priority lvl6 */
127#define AVIC_NIPRIORITY5 (AVIC_BASE + 0x28) /* norm int priority lvl5 */
128#define AVIC_NIPRIORITY4 (AVIC_BASE + 0x2C) /* norm int priority lvl4 */
129#define AVIC_NIPRIORITY3 (AVIC_BASE + 0x30) /* norm int priority lvl3 */
130#define AVIC_NIPRIORITY2 (AVIC_BASE + 0x34) /* norm int priority lvl2 */
131#define AVIC_NIPRIORITY1 (AVIC_BASE + 0x38) /* norm int priority lvl1 */
132#define AVIC_NIPRIORITY0 (AVIC_BASE + 0x3C) /* norm int priority lvl0 */
133#define AVIC_NIVECSR (AVIC_BASE + 0x40) /* norm int vector/status */
134#define AVIC_FIVECSR (AVIC_BASE + 0x44) /* fast int vector/status */
135#define AVIC_INTSRCH (AVIC_BASE + 0x48) /* int source reg high */
136#define AVIC_INTSRCL (AVIC_BASE + 0x4C) /* int source reg low */
137#define AVIC_INTFRCH (AVIC_BASE + 0x50) /* int force reg high */
138#define AVIC_INTFRCL (AVIC_BASE + 0x54) /* int force reg low */
139#define AVIC_NIPNDH (AVIC_BASE + 0x58) /* norm int pending high */
140#define AVIC_NIPNDL (AVIC_BASE + 0x5C) /* norm int pending low */
141#define AVIC_FIPNDH (AVIC_BASE + 0x60) /* fast int pending high */
142#define AVIC_FIPNDL (AVIC_BASE + 0x64) /* fast int pending low */
143
144#define SYSTEM_PREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x20)
145#define SYSTEM_SREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x24)
146#define IIM_PROD_REV_SH 3
147#define IIM_PROD_REV_LEN 5
148
149#endif /* __ASM_ARCH_MXC_H__ */
diff --git a/include/asm-arm/arch-mxc/system.h b/include/asm-arm/arch-mxc/system.h
new file mode 100644
index 000000000000..109956b41aca
--- /dev/null
+++ b/include/asm-arm/arch-mxc/system.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (C) 1999 ARM Limited
3 * Copyright (C) 2000 Deep Blue Solutions Ltd
4 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
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#ifndef __ASM_ARCH_MXC_SYSTEM_H__
22#define __ASM_ARCH_MXC_SYSTEM_H__
23
24/*!
25 * @file system.h
26 * @brief This file contains idle and reset functions.
27 *
28 * @ingroup System
29 */
30
31/*!
32 * This function puts the CPU into idle mode. It is called by default_idle()
33 * in process.c file.
34 */
35static inline void arch_idle(void)
36{
37 cpu_do_idle();
38}
39
40/*
41 * This function resets the system. It is called by machine_restart().
42 *
43 * @param mode indicates different kinds of resets
44 */
45static inline void arch_reset(char mode)
46{
47 cpu_reset(0);
48}
49
50#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */
diff --git a/include/asm-arm/arch-mxc/timex.h b/include/asm-arm/arch-mxc/timex.h
new file mode 100644
index 000000000000..59019fa58f82
--- /dev/null
+++ b/include/asm-arm/arch-mxc/timex.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 1999 ARM Limited
3 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
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_MXC_TIMEX_H__
21#define __ASM_ARCH_MXC_TIMEX_H__
22
23#include <asm/hardware.h> /* for CLOCK_TICK_RATE */
24
25#endif /* __ASM_ARCH_MXC_TIMEX_H__ */
diff --git a/include/asm-arm/arch-mxc/uncompress.h b/include/asm-arm/arch-mxc/uncompress.h
new file mode 100644
index 000000000000..42cc0cb3fefd
--- /dev/null
+++ b/include/asm-arm/arch-mxc/uncompress.h
@@ -0,0 +1,78 @@
1/*
2 * include/asm-arm/arch-mxc/uncompress.h
3 *
4 *
5 *
6 * Copyright (C) 1999 ARM Limited
7 * Copyright (C) Shane Nay (shane@minirl.com)
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 __ASM_ARCH_MXC_UNCOMPRESS_H__
24#define __ASM_ARCH_MXC_UNCOMPRESS_H__
25
26#define __MXC_BOOT_UNCOMPRESS
27
28#include <asm/hardware.h>
29
30#define UART(x) (*(volatile unsigned long *)(serial_port + (x)))
31
32#define USR2 0x98
33#define USR2_TXFE (1<<14)
34#define TXR 0x40
35#define UCR1 0x80
36#define UCR1_UARTEN 1
37
38/*
39 * The following code assumes the serial port has already been
40 * initialized by the bootloader. We search for the first enabled
41 * port in the most probable order. If you didn't setup a port in
42 * your bootloader then nothing will appear (which might be desired).
43 *
44 * This does not append a newline
45 */
46
47static void putc(int ch)
48{
49 static unsigned long serial_port = 0;
50
51 if (unlikely(serial_port == 0)) {
52 do {
53 serial_port = UART1_BASE_ADDR;
54 if (UART(UCR1) & UCR1_UARTEN)
55 break;
56 serial_port = UART2_BASE_ADDR;
57 if (UART(UCR1) & UCR1_UARTEN)
58 break;
59 return;
60 } while (0);
61 }
62
63 while (!(UART(USR2) & USR2_TXFE))
64 barrier();
65
66 UART(TXR) = ch;
67}
68
69#define flush() do { } while (0)
70
71/*
72 * nothing to do
73 */
74#define arch_decomp_setup()
75
76#define arch_decomp_wdog()
77
78#endif /* __ASM_ARCH_MXC_UNCOMPRESS_H__ */
diff --git a/include/asm-arm/arch-mxc/vmalloc.h b/include/asm-arm/arch-mxc/vmalloc.h
new file mode 100644
index 000000000000..83a73da895eb
--- /dev/null
+++ b/include/asm-arm/arch-mxc/vmalloc.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright (C) 2000 Russell King.
3 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
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_MXC_VMALLOC_H__
21#define __ASM_ARCH_MXC_VMALLOC_H__
22
23/*!
24 * @file vmalloc.h
25 *
26 * @brief This file contains platform specific macros for vmalloc.
27 *
28 * @ingroup System
29 */
30
31/*!
32 * vmalloc ending address
33 */
34#define VMALLOC_END 0xF4000000
35
36#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */
diff --git a/include/asm-arm/arch-ns9xxx/regs-bbu.h b/include/asm-arm/arch-ns9xxx/regs-bbu.h
index e26269546240..7ee194dc6354 100644
--- a/include/asm-arm/arch-ns9xxx/regs-bbu.h
+++ b/include/asm-arm/arch-ns9xxx/regs-bbu.h
@@ -15,7 +15,31 @@
15 15
16/* BBus Utility */ 16/* BBus Utility */
17 17
18/* GPIO Configuration Register */ 18/* GPIO Configuration Registers block 1 */
19#define BBU_GC(x) __REG2(0x9060000c, (x)) 19/* NOTE: the HRM starts counting at 1 for the GPIO registers, here the start is
20 * at 0 for each block. That is, BBU_GCONFb1(0) is GPIO Configuration Register
21 * #1, BBU_GCONFb2(0) is GPIO Configuration Register #8. */
22#define BBU_GCONFb1(x) __REG2(0x90600010, (x))
23#define BBU_GCONFb2(x) __REG2(0x90600100, (x))
24
25#define BBU_GCONFx_DIR(m) __REGBIT(3 + (((m) & 7) << 2))
26#define BBU_GCONFx_DIR_INPUT(m) __REGVAL(BBU_GCONFx_DIR(m), 0)
27#define BBU_GCONFx_DIR_OUTPUT(m) __REGVAL(BBU_GCONFx_DIR(m), 1)
28#define BBU_GCONFx_INV(m) __REGBIT(2 + (((m) & 7) << 2))
29#define BBU_GCONFx_INV_NO(m) __REGVAL(BBU_GCONFx_INV(m), 0)
30#define BBU_GCONFx_INV_YES(m) __REGVAL(BBU_GCONFx_INV(m), 1)
31#define BBU_GCONFx_FUNC(m) __REGBITS(1 + (((m) & 7) << 2), ((m) & 7) << 2)
32#define BBU_GCONFx_FUNC_0(m) __REGVAL(BBU_GCONFx_FUNC(m), 0)
33#define BBU_GCONFx_FUNC_1(m) __REGVAL(BBU_GCONFx_FUNC(m), 1)
34#define BBU_GCONFx_FUNC_2(m) __REGVAL(BBU_GCONFx_FUNC(m), 2)
35#define BBU_GCONFx_FUNC_3(m) __REGVAL(BBU_GCONFx_FUNC(m), 3)
36
37#define BBU_GCTRL1 __REG(0x90600030)
38#define BBU_GCTRL2 __REG(0x90600034)
39#define BBU_GCTRL3 __REG(0x90600120)
40
41#define BBU_GSTAT1 __REG(0x90600040)
42#define BBU_GSTAT2 __REG(0x90600044)
43#define BBU_GSTAT3 __REG(0x90600130)
20 44
21#endif /* ifndef __ASM_ARCH_REGSBBU_H */ 45#endif /* ifndef __ASM_ARCH_REGSBBU_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-mem.h b/include/asm-arm/arch-ns9xxx/regs-mem.h
index 8ed8448767b9..fb455a0ed845 100644
--- a/include/asm-arm/arch-ns9xxx/regs-mem.h
+++ b/include/asm-arm/arch-ns9xxx/regs-mem.h
@@ -79,9 +79,9 @@
79#define MEM_SMC(x) __REG2(0xa0700200, (x) << 3) 79#define MEM_SMC(x) __REG2(0xa0700200, (x) << 3)
80 80
81/* Static Memory Configuration Register x: Write protect */ 81/* Static Memory Configuration Register x: Write protect */
82#define MEM_SMC_WSMC __REGBIT(20) 82#define MEM_SMC_PSMC __REGBIT(20)
83#define MEM_SMC_WSMC_OFF __REGVAL(MEM_SMC_WSMC, 0) 83#define MEM_SMC_PSMC_OFF __REGVAL(MEM_SMC_PSMC, 0)
84#define MEM_SMC_WSMC_ON __REGVAL(MEM_SMC_WSMC, 1) 84#define MEM_SMC_PSMC_ON __REGVAL(MEM_SMC_PSMC, 1)
85 85
86/* Static Memory Configuration Register x: Buffer enable */ 86/* Static Memory Configuration Register x: Buffer enable */
87#define MEM_SMC_BSMC __REGBIT(19) 87#define MEM_SMC_BSMC __REGBIT(19)
diff --git a/include/asm-arm/arch-ns9xxx/regs-sys.h b/include/asm-arm/arch-ns9xxx/regs-sys.h
index a42546aeb92a..749262f86204 100644
--- a/include/asm-arm/arch-ns9xxx/regs-sys.h
+++ b/include/asm-arm/arch-ns9xxx/regs-sys.h
@@ -64,7 +64,7 @@
64 64
65/* Timer x Control register: Timer enable */ 65/* Timer x Control register: Timer enable */
66#define SYS_TCx_TEN __REGBIT(15) 66#define SYS_TCx_TEN __REGBIT(15)
67#define SYS_TCx_TEN_DIS __REGVAL(SYS_TCx_TEN, 1) 67#define SYS_TCx_TEN_DIS __REGVAL(SYS_TCx_TEN, 0)
68#define SYS_TCx_TEN_EN __REGVAL(SYS_TCx_TEN, 1) 68#define SYS_TCx_TEN_EN __REGVAL(SYS_TCx_TEN, 1)
69 69
70/* Timer x Control register: CPU debug mode */ 70/* Timer x Control register: CPU debug mode */
diff --git a/include/asm-arm/arch-omap/irda.h b/include/asm-arm/arch-omap/irda.h
index 345a649ec838..96bb12fab438 100644
--- a/include/asm-arm/arch-omap/irda.h
+++ b/include/asm-arm/arch-omap/irda.h
@@ -31,6 +31,7 @@ struct omap_irda_config {
31 unsigned long src_start; 31 unsigned long src_start;
32 int tx_trigger; 32 int tx_trigger;
33 int rx_trigger; 33 int rx_trigger;
34 int mode;
34}; 35};
35 36
36#endif 37#endif
diff --git a/include/asm-arm/arch-omap/mailbox.h b/include/asm-arm/arch-omap/mailbox.h
index 4bf0909461f2..7cbed9332e16 100644
--- a/include/asm-arm/arch-omap/mailbox.h
+++ b/include/asm-arm/arch-omap/mailbox.h
@@ -37,7 +37,7 @@ struct omap_mbox_ops {
37 37
38struct omap_mbox_queue { 38struct omap_mbox_queue {
39 spinlock_t lock; 39 spinlock_t lock;
40 request_queue_t *queue; 40 struct request_queue *queue;
41 struct work_struct work; 41 struct work_struct work;
42 int (*callback)(void *); 42 int (*callback)(void *);
43 struct omap_mbox *mbox; 43 struct omap_mbox *mbox;
diff --git a/include/asm-arm/arch-pxa/pm.h b/include/asm-arm/arch-pxa/pm.h
index 52243a62c4e7..6903db7fae15 100644
--- a/include/asm-arm/arch-pxa/pm.h
+++ b/include/asm-arm/arch-pxa/pm.h
@@ -7,5 +7,19 @@
7 * 7 *
8 */ 8 */
9 9
10extern int pxa_pm_prepare(suspend_state_t state); 10struct pxa_cpu_pm_fns {
11 int save_size;
12 void (*save)(unsigned long *);
13 void (*restore)(unsigned long *);
14 int (*valid)(suspend_state_t state);
15 void (*enter)(suspend_state_t state);
16};
17
18extern struct pxa_cpu_pm_fns *pxa_cpu_pm_fns;
19
20/* sleep.S */
21extern void pxa25x_cpu_suspend(unsigned int);
22extern void pxa27x_cpu_suspend(unsigned int);
23extern void pxa_cpu_resume(void);
24
11extern int pxa_pm_enter(suspend_state_t state); 25extern int pxa_pm_enter(suspend_state_t state);
diff --git a/include/asm-arm/arch-s3c2400/map.h b/include/asm-arm/arch-s3c2400/map.h
new file mode 100644
index 000000000000..1184d907b31e
--- /dev/null
+++ b/include/asm-arm/arch-s3c2400/map.h
@@ -0,0 +1,66 @@
1/* linux/include/asm-arm/arch-s3c2400/map.h
2 *
3 * Copyright 2003,2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * Copyright 2003, Lucas Correia Villa Real
8 *
9 * S3C2400 - Memory map definitions
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#define S3C2400_PA_MEMCTRL (0x14000000)
17#define S3C2400_PA_USBHOST (0x14200000)
18#define S3C2400_PA_IRQ (0x14400000)
19#define S3C2400_PA_DMA (0x14600000)
20#define S3C2400_PA_CLKPWR (0x14800000)
21#define S3C2400_PA_LCD (0x14A00000)
22#define S3C2400_PA_UART (0x15000000)
23#define S3C2400_PA_TIMER (0x15100000)
24#define S3C2400_PA_USBDEV (0x15200140)
25#define S3C2400_PA_WATCHDOG (0x15300000)
26#define S3C2400_PA_IIC (0x15400000)
27#define S3C2400_PA_IIS (0x15508000)
28#define S3C2400_PA_GPIO (0x15600000)
29#define S3C2400_PA_RTC (0x15700040)
30#define S3C2400_PA_ADC (0x15800000)
31#define S3C2400_PA_SPI (0x15900000)
32
33#define S3C2400_PA_MMC (0x15A00000)
34#define S3C2400_SZ_MMC SZ_1M
35
36/* physical addresses of all the chip-select areas */
37
38#define S3C2400_CS0 (0x00000000)
39#define S3C2400_CS1 (0x02000000)
40#define S3C2400_CS2 (0x04000000)
41#define S3C2400_CS3 (0x06000000)
42#define S3C2400_CS4 (0x08000000)
43#define S3C2400_CS5 (0x0A000000)
44#define S3C2400_CS6 (0x0C000000)
45#define S3C2400_CS7 (0x0E000000)
46
47#define S3C2400_SDRAM_PA (S3C2400_CS6)
48
49/* Use a single interface for common resources between S3C24XX cpus */
50
51#define S3C24XX_PA_IRQ S3C2400_PA_IRQ
52#define S3C24XX_PA_MEMCTRL S3C2400_PA_MEMCTRL
53#define S3C24XX_PA_USBHOST S3C2400_PA_USBHOST
54#define S3C24XX_PA_DMA S3C2400_PA_DMA
55#define S3C24XX_PA_CLKPWR S3C2400_PA_CLKPWR
56#define S3C24XX_PA_LCD S3C2400_PA_LCD
57#define S3C24XX_PA_UART S3C2400_PA_UART
58#define S3C24XX_PA_TIMER S3C2400_PA_TIMER
59#define S3C24XX_PA_USBDEV S3C2400_PA_USBDEV
60#define S3C24XX_PA_WATCHDOG S3C2400_PA_WATCHDOG
61#define S3C24XX_PA_IIC S3C2400_PA_IIC
62#define S3C24XX_PA_IIS S3C2400_PA_IIS
63#define S3C24XX_PA_GPIO S3C2400_PA_GPIO
64#define S3C24XX_PA_RTC S3C2400_PA_RTC
65#define S3C24XX_PA_ADC S3C2400_PA_ADC
66#define S3C24XX_PA_SPI S3C2400_PA_SPI
diff --git a/include/asm-arm/arch-s3c2400/memory.h b/include/asm-arm/arch-s3c2400/memory.h
new file mode 100644
index 000000000000..fb0381dde704
--- /dev/null
+++ b/include/asm-arm/arch-s3c2400/memory.h
@@ -0,0 +1,23 @@
1/* linux/include/asm-arm/arch-s3c2400/memory.h
2 * from linux/include/asm-arm/arch-rpc/memory.h
3 *
4 * Copyright 2007 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * Copyright (C) 1996,1997,1998 Russell King.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __ASM_ARCH_MEMORY_H
16#define __ASM_ARCH_MEMORY_H
17
18#define PHYS_OFFSET UL(0x0C000000)
19
20#define __virt_to_bus(x) __virt_to_phys(x)
21#define __bus_to_virt(x) __phys_to_virt(x)
22
23#endif
diff --git a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S
index 93064860e0e5..9c8cd9abb82b 100644
--- a/include/asm-arm/arch-s3c2410/debug-macro.S
+++ b/include/asm-arm/arch-s3c2410/debug-macro.S
@@ -13,32 +13,23 @@
13*/ 13*/
14 14
15#include <asm/arch/map.h> 15#include <asm/arch/map.h>
16#include <asm/arch/regs-serial.h>
17#include <asm/arch/regs-gpio.h> 16#include <asm/arch/regs-gpio.h>
17#include <asm/plat-s3c/regs-serial.h>
18 18
19#define S3C2410_UART1_OFF (0x4000) 19#define S3C2410_UART1_OFF (0x4000)
20#define SHIFT_2440TXF (14-9) 20#define SHIFT_2440TXF (14-9)
21 21
22 .macro addruart, rx 22 .macro addruart, rx
23 mrc p15, 0, \rx, c1, c0 23 mrc p15, 0, \rx, c1, c0
24 tst \rx, #1 24 tst \rx, #1
25 ldreq \rx, = S3C24XX_PA_UART 25 ldreq \rx, = S3C24XX_PA_UART
26 ldrne \rx, = S3C24XX_VA_UART 26 ldrne \rx, = S3C24XX_VA_UART
27#if CONFIG_DEBUG_S3C2410_UART != 0 27#if CONFIG_DEBUG_S3C_UART != 0
28 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART) 28 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART)
29#endif 29#endif
30 .endm 30 .endm
31 31
32 .macro senduart,rd,rx 32 .macro fifo_full_s3c24xx rd, rx
33 strb \rd, [\rx, # S3C2410_UTXH ]
34 .endm
35
36 .macro busyuart, rd, rx
37 ldr \rd, [ \rx, # S3C2410_UFCON ]
38 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
39 beq 1001f @
40 @ FIFO enabled...
411003:
42 @ check for arm920 vs arm926. currently assume all arm926 33 @ check for arm920 vs arm926. currently assume all arm926
43 @ devices have an 64 byte FIFO identical to the s3c2440 34 @ devices have an 64 byte FIFO identical to the s3c2440
44 mrc p15, 0, \rd, c0, c0 35 mrc p15, 0, \rd, c0, c0
@@ -57,25 +48,22 @@
57 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 48 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
58 moveq \rd, \rd, lsr #SHIFT_2440TXF 49 moveq \rd, \rd, lsr #SHIFT_2440TXF
59 tst \rd, #S3C2410_UFSTAT_TXFULL 50 tst \rd, #S3C2410_UFSTAT_TXFULL
60 bne 1003b 51 .endm
61 b 1002f
62
631001:
64 @ busy waiting for non fifo
65 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
66 tst \rd, #S3C2410_UTRSTAT_TXFE
67 beq 1001b
68 52
691002: @ exit busyuart 53 .macro fifo_full_s3c2410 rd, rx
70 .endm 54 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
55 tst \rd, #S3C2410_UFSTAT_TXFULL
56 .endm
71 57
72 .macro waituart,rd,rx 58/* fifo level reading */
73 59
74 ldr \rd, [ \rx, # S3C2410_UFCON ] 60 .macro fifo_level_s3c24xx rd, rx
75 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? 61 @ check for arm920 vs arm926. currently assume all arm926
76 beq 1001f @ 62 @ devices have an 64 byte FIFO identical to the s3c2440
77 @ FIFO enabled... 63 mrc p15, 0, \rd, c0, c0
781003: 64 and \rd, \rd, #0xff0
65 teq \rd, #0x260
66 beq 10000f
79 mrc p15, 0, \rd, c1, c0 67 mrc p15, 0, \rd, c1, c0
80 tst \rd, #1 68 tst \rd, #1
81 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) 69 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
@@ -85,18 +73,32 @@
85 and \rd, \rd, #0x00ff0000 73 and \rd, \rd, #0x00ff0000
86 teq \rd, #0x00440000 @ is it 2440? 74 teq \rd, #0x00440000 @ is it 2440?
87 75
7610000:
88 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 77 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
89 andne \rd, \rd, #S3C2410_UFSTAT_TXMASK 78 andne \rd, \rd, #S3C2410_UFSTAT_TXMASK
90 andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK 79 andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK
91 teq \rd, #0 80 .endm
92 bne 1003b 81
93 b 1002f 82 .macro fifo_level_s3c2410 rd, rx
83 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
84 and \rd, \rd, #S3C2410_UFSTAT_TXMASK
85 .endm
86
87/* Select the correct implementation depending on the configuration. The
88 * S3C2440 will get selected by default, as these are the most widely
89 * used variants of these
90*/
91
92#if defined(CONFIG_CPU_LLSERIAL_S3C2410_ONLY)
93#define fifo_full fifo_full_s3c2410
94#define fifo_level fifo_level_s3c2410
95#warning 2410only
96#elif !defined(CONFIG_CPU_LLSERIAL_S3C2440_ONLY)
97#define fifo_full fifo_full_s3c24xx
98#define fifo_level fifo_level_s3c24xx
99#warning generic
100#endif
94 101
951001: 102/* include the reset of the code which will do the work */
96 @ idle waiting for non fifo
97 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
98 tst \rd, #S3C2410_UTRSTAT_TXFE
99 beq 1001b
100 103
1011002: @ exit busyuart 104#include <asm/plat-s3c/debug-macro.S>
102 .endm
diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h
index 19e77f038042..b33ed3b05ef5 100644
--- a/include/asm-arm/arch-s3c2410/map.h
+++ b/include/asm-arm/arch-s3c2410/map.h
@@ -13,58 +13,36 @@
13#ifndef __ASM_ARCH_MAP_H 13#ifndef __ASM_ARCH_MAP_H
14#define __ASM_ARCH_MAP_H 14#define __ASM_ARCH_MAP_H
15 15
16/* we have a bit of a tight squeeze to fit all our registers from 16#include <asm/plat-s3c/map.h>
17 * 0xF00000000 upwards, since we use all of the nGCS space in some
18 * capacity, and also need to fit the S3C2410 registers in as well...
19 *
20 * we try to ensure stuff like the IRQ registers are available for
21 * an single MOVS instruction (ie, only 8 bits of set data)
22 *
23 * Note, we are trying to remove some of these from the implementation
24 * as they are only useful to certain drivers...
25 */
26
27#ifndef __ASSEMBLY__
28#define S3C2410_ADDR(x) ((void __iomem __force *)0xF0000000 + (x))
29#else
30#define S3C2410_ADDR(x) (0xF0000000 + (x))
31#endif
32 17
33#define S3C2400_ADDR(x) S3C2410_ADDR(x) 18#define S3C2410_ADDR(x) S3C_ADDR(x)
34 19
35/* interrupt controller is the first thing we put in, to make 20/* interrupt controller is the first thing we put in, to make
36 * the assembly code for the irq detection easier 21 * the assembly code for the irq detection easier
37 */ 22 */
38#define S3C24XX_VA_IRQ S3C2410_ADDR(0x00000000) 23#define S3C24XX_VA_IRQ S3C_VA_IRQ
39#define S3C2400_PA_IRQ (0x14400000)
40#define S3C2410_PA_IRQ (0x4A000000) 24#define S3C2410_PA_IRQ (0x4A000000)
41#define S3C24XX_SZ_IRQ SZ_1M 25#define S3C24XX_SZ_IRQ SZ_1M
42 26
43/* memory controller registers */ 27/* memory controller registers */
44#define S3C24XX_VA_MEMCTRL S3C2410_ADDR(0x00100000) 28#define S3C24XX_VA_MEMCTRL S3C_VA_MEM
45#define S3C2400_PA_MEMCTRL (0x14000000)
46#define S3C2410_PA_MEMCTRL (0x48000000) 29#define S3C2410_PA_MEMCTRL (0x48000000)
47#define S3C24XX_SZ_MEMCTRL SZ_1M 30#define S3C24XX_SZ_MEMCTRL SZ_1M
48 31
49/* USB host controller */ 32/* USB host controller */
50#define S3C2400_PA_USBHOST (0x14200000)
51#define S3C2410_PA_USBHOST (0x49000000) 33#define S3C2410_PA_USBHOST (0x49000000)
52#define S3C24XX_SZ_USBHOST SZ_1M 34#define S3C24XX_SZ_USBHOST SZ_1M
53 35
54/* DMA controller */ 36/* DMA controller */
55#define S3C2400_PA_DMA (0x14600000)
56#define S3C2410_PA_DMA (0x4B000000) 37#define S3C2410_PA_DMA (0x4B000000)
57#define S3C24XX_SZ_DMA SZ_1M 38#define S3C24XX_SZ_DMA SZ_1M
58 39
59/* Clock and Power management */ 40/* Clock and Power management */
60#define S3C24XX_VA_CLKPWR S3C2410_ADDR(0x00200000) 41#define S3C24XX_VA_CLKPWR S3C_VA_SYS
61#define S3C2400_PA_CLKPWR (0x14800000)
62#define S3C2410_PA_CLKPWR (0x4C000000) 42#define S3C2410_PA_CLKPWR (0x4C000000)
63#define S3C24XX_SZ_CLKPWR SZ_1M 43#define S3C24XX_SZ_CLKPWR SZ_1M
64 44
65/* LCD controller */ 45/* LCD controller */
66#define S3C24XX_VA_LCD S3C2410_ADDR(0x00300000)
67#define S3C2400_PA_LCD (0x14A00000)
68#define S3C2410_PA_LCD (0x4D000000) 46#define S3C2410_PA_LCD (0x4D000000)
69#define S3C24XX_SZ_LCD SZ_1M 47#define S3C24XX_SZ_LCD SZ_1M
70 48
@@ -72,41 +50,30 @@
72#define S3C2410_PA_NAND (0x4E000000) 50#define S3C2410_PA_NAND (0x4E000000)
73#define S3C24XX_SZ_NAND SZ_1M 51#define S3C24XX_SZ_NAND SZ_1M
74 52
75/* MMC controller - available on the S3C2400 */
76#define S3C2400_PA_MMC (0x15A00000)
77#define S3C2400_SZ_MMC SZ_1M
78
79/* UARTs */ 53/* UARTs */
80#define S3C24XX_VA_UART S3C2410_ADDR(0x00400000) 54#define S3C24XX_VA_UART S3C_VA_UART
81#define S3C2400_PA_UART (0x15000000)
82#define S3C2410_PA_UART (0x50000000) 55#define S3C2410_PA_UART (0x50000000)
83#define S3C24XX_SZ_UART SZ_1M 56#define S3C24XX_SZ_UART SZ_1M
84 57
85/* Timers */ 58/* Timers */
86#define S3C24XX_VA_TIMER S3C2410_ADDR(0x00500000) 59#define S3C24XX_VA_TIMER S3C_VA_TIMER
87#define S3C2400_PA_TIMER (0x15100000)
88#define S3C2410_PA_TIMER (0x51000000) 60#define S3C2410_PA_TIMER (0x51000000)
89#define S3C24XX_SZ_TIMER SZ_1M 61#define S3C24XX_SZ_TIMER SZ_1M
90 62
91/* USB Device port */ 63/* USB Device port */
92#define S3C24XX_VA_USBDEV S3C2410_ADDR(0x00600000)
93#define S3C2400_PA_USBDEV (0x15200140)
94#define S3C2410_PA_USBDEV (0x52000000) 64#define S3C2410_PA_USBDEV (0x52000000)
95#define S3C24XX_SZ_USBDEV SZ_1M 65#define S3C24XX_SZ_USBDEV SZ_1M
96 66
97/* Watchdog */ 67/* Watchdog */
98#define S3C24XX_VA_WATCHDOG S3C2410_ADDR(0x00700000) 68#define S3C24XX_VA_WATCHDOG S3C_VA_WATCHDOG
99#define S3C2400_PA_WATCHDOG (0x15300000)
100#define S3C2410_PA_WATCHDOG (0x53000000) 69#define S3C2410_PA_WATCHDOG (0x53000000)
101#define S3C24XX_SZ_WATCHDOG SZ_1M 70#define S3C24XX_SZ_WATCHDOG SZ_1M
102 71
103/* IIC hardware controller */ 72/* IIC hardware controller */
104#define S3C2400_PA_IIC (0x15400000)
105#define S3C2410_PA_IIC (0x54000000) 73#define S3C2410_PA_IIC (0x54000000)
106#define S3C24XX_SZ_IIC SZ_1M 74#define S3C24XX_SZ_IIC SZ_1M
107 75
108/* IIS controller */ 76/* IIS controller */
109#define S3C2400_PA_IIS (0x15508000)
110#define S3C2410_PA_IIS (0x55000000) 77#define S3C2410_PA_IIS (0x55000000)
111#define S3C24XX_SZ_IIS SZ_1M 78#define S3C24XX_SZ_IIS SZ_1M
112 79
@@ -116,27 +83,23 @@
116 * it is the same distance apart from the UART in the 83 * it is the same distance apart from the UART in the
117 * phsyical address space, as the initial mapping for the IO 84 * phsyical address space, as the initial mapping for the IO
118 * is done as a 1:1 maping. This puts it (currently) at 85 * is done as a 1:1 maping. This puts it (currently) at
119 * 0xF6800000, which is not in the way of any current mapping 86 * 0xFA800000, which is not in the way of any current mapping
120 * by the base system. 87 * by the base system.
121*/ 88*/
122 89
123#define S3C2400_PA_GPIO (0x15600000)
124#define S3C2410_PA_GPIO (0x56000000) 90#define S3C2410_PA_GPIO (0x56000000)
125#define S3C24XX_VA_GPIO ((S3C2410_PA_GPIO - S3C24XX_PA_UART) + S3C24XX_VA_UART) 91#define S3C24XX_VA_GPIO ((S3C2410_PA_GPIO - S3C24XX_PA_UART) + S3C24XX_VA_UART)
126#define S3C24XX_SZ_GPIO SZ_1M 92#define S3C24XX_SZ_GPIO SZ_1M
127 93
128/* RTC */ 94/* RTC */
129#define S3C2400_PA_RTC (0x15700040)
130#define S3C2410_PA_RTC (0x57000000) 95#define S3C2410_PA_RTC (0x57000000)
131#define S3C24XX_SZ_RTC SZ_1M 96#define S3C24XX_SZ_RTC SZ_1M
132 97
133/* ADC */ 98/* ADC */
134#define S3C2400_PA_ADC (0x15800000)
135#define S3C2410_PA_ADC (0x58000000) 99#define S3C2410_PA_ADC (0x58000000)
136#define S3C24XX_SZ_ADC SZ_1M 100#define S3C24XX_SZ_ADC SZ_1M
137 101
138/* SPI */ 102/* SPI */
139#define S3C2400_PA_SPI (0x15900000)
140#define S3C2410_PA_SPI (0x59000000) 103#define S3C2410_PA_SPI (0x59000000)
141#define S3C24XX_SZ_SPI SZ_1M 104#define S3C24XX_SZ_SPI SZ_1M
142 105
@@ -177,37 +140,8 @@
177 140
178#define S3C2410_SDRAM_PA (S3C2410_CS6) 141#define S3C2410_SDRAM_PA (S3C2410_CS6)
179 142
180#define S3C2400_CS0 (0x00000000)
181#define S3C2400_CS1 (0x02000000)
182#define S3C2400_CS2 (0x04000000)
183#define S3C2400_CS3 (0x06000000)
184#define S3C2400_CS4 (0x08000000)
185#define S3C2400_CS5 (0x0A000000)
186#define S3C2400_CS6 (0x0C000000)
187#define S3C2400_CS7 (0x0E000000)
188
189#define S3C2400_SDRAM_PA (S3C2400_CS6)
190
191/* Use a single interface for common resources between S3C24XX cpus */ 143/* Use a single interface for common resources between S3C24XX cpus */
192 144
193#ifdef CONFIG_CPU_S3C2400
194#define S3C24XX_PA_IRQ S3C2400_PA_IRQ
195#define S3C24XX_PA_MEMCTRL S3C2400_PA_MEMCTRL
196#define S3C24XX_PA_USBHOST S3C2400_PA_USBHOST
197#define S3C24XX_PA_DMA S3C2400_PA_DMA
198#define S3C24XX_PA_CLKPWR S3C2400_PA_CLKPWR
199#define S3C24XX_PA_LCD S3C2400_PA_LCD
200#define S3C24XX_PA_UART S3C2400_PA_UART
201#define S3C24XX_PA_TIMER S3C2400_PA_TIMER
202#define S3C24XX_PA_USBDEV S3C2400_PA_USBDEV
203#define S3C24XX_PA_WATCHDOG S3C2400_PA_WATCHDOG
204#define S3C24XX_PA_IIC S3C2400_PA_IIC
205#define S3C24XX_PA_IIS S3C2400_PA_IIS
206#define S3C24XX_PA_GPIO S3C2400_PA_GPIO
207#define S3C24XX_PA_RTC S3C2400_PA_RTC
208#define S3C24XX_PA_ADC S3C2400_PA_ADC
209#define S3C24XX_PA_SPI S3C2400_PA_SPI
210#else
211#define S3C24XX_PA_IRQ S3C2410_PA_IRQ 145#define S3C24XX_PA_IRQ S3C2410_PA_IRQ
212#define S3C24XX_PA_MEMCTRL S3C2410_PA_MEMCTRL 146#define S3C24XX_PA_MEMCTRL S3C2410_PA_MEMCTRL
213#define S3C24XX_PA_USBHOST S3C2410_PA_USBHOST 147#define S3C24XX_PA_USBHOST S3C2410_PA_USBHOST
@@ -224,7 +158,6 @@
224#define S3C24XX_PA_RTC S3C2410_PA_RTC 158#define S3C24XX_PA_RTC S3C2410_PA_RTC
225#define S3C24XX_PA_ADC S3C2410_PA_ADC 159#define S3C24XX_PA_ADC S3C2410_PA_ADC
226#define S3C24XX_PA_SPI S3C2410_PA_SPI 160#define S3C24XX_PA_SPI S3C2410_PA_SPI
227#endif
228 161
229/* deal with the registers that move under the 2412/2413 */ 162/* deal with the registers that move under the 2412/2413 */
230 163
diff --git a/include/asm-arm/arch-s3c2410/memory.h b/include/asm-arm/arch-s3c2410/memory.h
index 4be6a74c4303..533e2436e707 100644
--- a/include/asm-arm/arch-s3c2410/memory.h
+++ b/include/asm-arm/arch-s3c2410/memory.h
@@ -11,20 +11,7 @@
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/*
15 * DRAM starts at 0x30000000 for S3C2410/S3C2440
16 * and at 0x0C000000 for S3C2400
17 */
18#ifdef CONFIG_CPU_S3C2400
19#define PHYS_OFFSET UL(0x0C000000)
20#else
21#define PHYS_OFFSET UL(0x30000000) 14#define PHYS_OFFSET UL(0x30000000)
22#endif
23
24/*
25 * These are exactly the same on the S3C2410 as the
26 * physical memory view.
27*/
28 15
29#define __virt_to_bus(x) __virt_to_phys(x) 16#define __virt_to_bus(x) __virt_to_phys(x)
30#define __bus_to_virt(x) __phys_to_virt(x) 17#define __bus_to_virt(x) __phys_to_virt(x)
diff --git a/include/asm-arm/arch-s3c2410/regs-lcd.h b/include/asm-arm/arch-s3c2410/regs-lcd.h
index b7faeb04c0ff..76fe5f693426 100644
--- a/include/asm-arm/arch-s3c2410/regs-lcd.h
+++ b/include/asm-arm/arch-s3c2410/regs-lcd.h
@@ -12,7 +12,7 @@
12#ifndef ___ASM_ARCH_REGS_LCD_H 12#ifndef ___ASM_ARCH_REGS_LCD_H
13#define ___ASM_ARCH_REGS_LCD_H "$Id: lcd.h,v 1.3 2003/06/26 13:25:06 ben Exp $" 13#define ___ASM_ARCH_REGS_LCD_H "$Id: lcd.h,v 1.3 2003/06/26 13:25:06 ben Exp $"
14 14
15#define S3C2410_LCDREG(x) ((x) + S3C24XX_VA_LCD) 15#define S3C2410_LCDREG(x) (x)
16 16
17/* LCD control registers */ 17/* LCD control registers */
18#define S3C2410_LCDCON1 S3C2410_LCDREG(0x00) 18#define S3C2410_LCDCON1 S3C2410_LCDREG(0x00)
diff --git a/include/asm-arm/arch-s3c2410/system.h b/include/asm-arm/arch-s3c2410/system.h
index 1c74ef17da33..63891786dfa0 100644
--- a/include/asm-arm/arch-s3c2410/system.h
+++ b/include/asm-arm/arch-s3c2410/system.h
@@ -17,7 +17,7 @@
17#include <asm/arch/idle.h> 17#include <asm/arch/idle.h>
18#include <asm/arch/reset.h> 18#include <asm/arch/reset.h>
19 19
20#include <asm/arch/regs-watchdog.h> 20#include <asm/plat-s3c/regs-watchdog.h>
21#include <asm/arch/regs-clock.h> 21#include <asm/arch/regs-clock.h>
22 22
23void (*s3c24xx_idle)(void); 23void (*s3c24xx_idle)(void);
diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h
index dcb2cef38f50..48a5731ee988 100644
--- a/include/asm-arm/arch-s3c2410/uncompress.h
+++ b/include/asm-arm/arch-s3c2410/uncompress.h
@@ -1,6 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/uncompress.h 1/* linux/include/asm-arm/arch-s3c2410/uncompress.h
2 * 2 *
3 * Copyright (c) 2003 Simtec Electronics 3 * Copyright (c) 2003, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
4 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
5 * 6 *
6 * S3C2410 - uncompress code 7 * S3C2410 - uncompress code
@@ -13,153 +14,39 @@
13#ifndef __ASM_ARCH_UNCOMPRESS_H 14#ifndef __ASM_ARCH_UNCOMPRESS_H
14#define __ASM_ARCH_UNCOMPRESS_H 15#define __ASM_ARCH_UNCOMPRESS_H
15 16
16typedef unsigned int upf_t; /* cannot include linux/serial_core.h */ 17#include <asm/arch/regs-gpio.h>
17
18/* defines for UART registers */
19#include "asm/arch/regs-serial.h"
20#include "asm/arch/regs-gpio.h"
21#include "asm/arch/regs-watchdog.h"
22
23#include <asm/arch/map.h> 18#include <asm/arch/map.h>
24 19
25/* working in physical space... */ 20/* working in physical space... */
26#undef S3C2410_GPIOREG 21#undef S3C2410_GPIOREG
27#undef S3C2410_WDOGREG
28
29#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x))) 22#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x)))
30#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x)))
31 23
32/* how many bytes we allow into the FIFO at a time in FIFO mode */ 24#include <asm/plat-s3c/uncompress.h>
33#define FIFO_MAX (14)
34 25
35#define uart_base S3C24XX_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT) 26static inline int is_arm926(void)
36
37static __inline__ void
38uart_wr(unsigned int reg, unsigned int val)
39{ 27{
40 volatile unsigned int *ptr; 28 unsigned int cpuid;
41
42 ptr = (volatile unsigned int *)(reg + uart_base);
43 *ptr = val;
44}
45 29
46static __inline__ unsigned int 30 asm volatile ("mrc p15, 0, %0, c1, c0, 0" : "=r" (cpuid));
47uart_rd(unsigned int reg)
48{
49 volatile unsigned int *ptr;
50 31
51 ptr = (volatile unsigned int *)(reg + uart_base); 32 return ((cpuid & 0xff0) == 0x260);
52 return *ptr;
53} 33}
54 34
55 35static void arch_detect_cpu(void)
56/* we can deal with the case the UARTs are being run
57 * in FIFO mode, so that we don't hold up our execution
58 * waiting for tx to happen...
59*/
60
61static void putc(int ch)
62{ 36{
63 int cpuid = S3C2410_GSTATUS1_2410; 37 unsigned int cpuid;
64 38
65#ifndef CONFIG_CPU_S3C2400
66 cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1); 39 cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1);
67 cpuid &= S3C2410_GSTATUS1_IDMASK; 40 cpuid &= S3C2410_GSTATUS1_IDMASK;
68#endif
69
70 if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
71 int level;
72
73 while (1) {
74 level = uart_rd(S3C2410_UFSTAT);
75
76 if (cpuid == S3C2410_GSTATUS1_2440 ||
77 cpuid == S3C2410_GSTATUS1_2442) {
78 level &= S3C2440_UFSTAT_TXMASK;
79 level >>= S3C2440_UFSTAT_TXSHIFT;
80 } else {
81 level &= S3C2410_UFSTAT_TXMASK;
82 level >>= S3C2410_UFSTAT_TXSHIFT;
83 }
84
85 if (level < FIFO_MAX)
86 break;
87 }
88 41
42 if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 ||
43 cpuid == S3C2410_GSTATUS1_2442) {
44 fifo_mask = S3C2440_UFSTAT_TXMASK;
45 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
89 } else { 46 } else {
90 /* not using fifos */ 47 fifo_mask = S3C2410_UFSTAT_TXMASK;
91 48 fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT;
92 while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE)
93 barrier();
94 } 49 }
95
96 /* write byte to transmission register */
97 uart_wr(S3C2410_UTXH, ch);
98} 50}
99 51
100static inline void flush(void)
101{
102}
103
104#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0)
105
106/* CONFIG_S3C2410_BOOT_WATCHDOG
107 *
108 * Simple boot-time watchdog setup, to reboot the system if there is
109 * any problem with the boot process
110*/
111
112#ifdef CONFIG_S3C2410_BOOT_WATCHDOG
113
114#define WDOG_COUNT (0xff00)
115
116static inline void arch_decomp_wdog(void)
117{
118 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
119}
120
121static void arch_decomp_wdog_start(void)
122{
123 __raw_writel(WDOG_COUNT, S3C2410_WTDAT);
124 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
125 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
126}
127
128#else
129#define arch_decomp_wdog_start()
130#define arch_decomp_wdog()
131#endif
132
133#ifdef CONFIG_S3C2410_BOOT_ERROR_RESET
134
135static void arch_decomp_error(const char *x)
136{
137 putstr("\n\n");
138 putstr(x);
139 putstr("\n\n -- System resetting\n");
140
141 __raw_writel(0x4000, S3C2410_WTDAT);
142 __raw_writel(0x4000, S3C2410_WTCNT);
143 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON);
144
145 while(1);
146}
147
148#define arch_error arch_decomp_error
149#endif
150
151static void error(char *err);
152
153static void
154arch_decomp_setup(void)
155{
156 /* we may need to setup the uart(s) here if we are not running
157 * on an BAST... the BAST will have left the uarts configured
158 * after calling linux.
159 */
160
161 arch_decomp_wdog_start();
162}
163
164
165#endif /* __ASM_ARCH_UNCOMPRESS_H */ 52#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/include/asm-arm/arch-sa1100/jornada720.h b/include/asm-arm/arch-sa1100/jornada720.h
new file mode 100644
index 000000000000..45d2bb59f9d0
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/jornada720.h
@@ -0,0 +1,27 @@
1/*
2 * include/asm-arm/arch-sa1100/jornada720.h
3 *
4 * This file contains SSP/MCU communication definitions for HP Jornada 710/720/728
5 *
6 * Copyright (C) 2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
7 * Copyright (C) 2000 John Ankcorn <jca@lcs.mit.edu>
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
15 /* HP Jornada 7xx microprocessor commands */
16#define GETBATTERYDATA 0xc0
17#define GETSCANKEYCODE 0x90
18#define GETTOUCHSAMPLES 0xa0
19#define GETCONTRAST 0xD0
20#define SETCONTRAST 0xD1
21#define GETBRIGHTNESS 0xD2
22#define SETBRIGHTNESS 0xD3
23#define CONTRASTOFF 0xD8
24#define BRIGHTNESSOFF 0xD9
25#define PWMOFF 0xDF
26#define TXDUMMY 0x11
27#define ERRORCODE 0x00
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
index d1294a46c70c..6c1c968b2987 100644
--- a/include/asm-arm/cacheflush.h
+++ b/include/asm-arm/cacheflush.h
@@ -426,6 +426,13 @@ static inline void flush_anon_page(struct vm_area_struct *vma,
426 */ 426 */
427#define flush_icache_page(vma,page) do { } while (0) 427#define flush_icache_page(vma,page) do { } while (0)
428 428
429static inline void flush_ioremap_region(unsigned long phys, void __iomem *virt,
430 unsigned offset, size_t size)
431{
432 const void *start = (void __force *)virt + offset;
433 dmac_inv_range(start, start + size);
434}
435
429#define __cacheid_present(val) (val != read_cpuid(CPUID_ID)) 436#define __cacheid_present(val) (val != read_cpuid(CPUID_ID))
430#define __cacheid_type_v7(val) ((val & (7 << 29)) == (4 << 29)) 437#define __cacheid_type_v7(val) ((val & (7 << 29)) == (4 << 29))
431 438
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h
index d7a777f05088..ec1c685562ce 100644
--- a/include/asm-arm/elf.h
+++ b/include/asm-arm/elf.h
@@ -1,13 +1,14 @@
1#ifndef __ASMARM_ELF_H 1#ifndef __ASMARM_ELF_H
2#define __ASMARM_ELF_H 2#define __ASMARM_ELF_H
3 3
4#include <asm/hwcap.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5/* 7/*
6 * ELF register definitions.. 8 * ELF register definitions..
7 */ 9 */
8#include <asm/ptrace.h> 10#include <asm/ptrace.h>
9#include <asm/user.h> 11#include <asm/user.h>
10#include <asm/hwcap.h>
11 12
12typedef unsigned long elf_greg_t; 13typedef unsigned long elf_greg_t;
13typedef unsigned long elf_freg_t[3]; 14typedef unsigned long elf_freg_t[3];
diff --git a/include/asm-arm/floppy.h b/include/asm-arm/floppy.h
index 54b5ae44ed94..d595c15166a4 100644
--- a/include/asm-arm/floppy.h
+++ b/include/asm-arm/floppy.h
@@ -30,15 +30,21 @@
30#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) 30#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK)
31#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) 31#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK)
32 32
33static inline int fd_dma_setup(void *data, unsigned int length,
34 unsigned int mode, unsigned long addr)
35{
36 set_dma_mode(DMA_FLOPPY, mode);
37 __set_dma_addr(DMA_FLOPPY, data);
38 set_dma_count(DMA_FLOPPY, length);
39 virtual_dma_port = addr;
40 enable_dma(DMA_FLOPPY);
41 return 0;
42}
43#define fd_dma_setup fd_dma_setup
44
33#define fd_request_dma() request_dma(DMA_FLOPPY,"floppy") 45#define fd_request_dma() request_dma(DMA_FLOPPY,"floppy")
34#define fd_free_dma() free_dma(DMA_FLOPPY) 46#define fd_free_dma() free_dma(DMA_FLOPPY)
35#define fd_disable_dma() disable_dma(DMA_FLOPPY) 47#define fd_disable_dma() disable_dma(DMA_FLOPPY)
36#define fd_enable_dma() enable_dma(DMA_FLOPPY)
37#define fd_clear_dma_ff() clear_dma_ff(DMA_FLOPPY)
38#define fd_set_dma_mode(mode) set_dma_mode(DMA_FLOPPY, (mode))
39#define fd_set_dma_addr(addr) set_dma_addr(DMA_FLOPPY, virt_to_bus((addr)))
40#define fd_set_dma_count(len) set_dma_count(DMA_FLOPPY, (len))
41#define fd_cacheflush(addr,sz)
42 48
43/* need to clean up dma.h */ 49/* need to clean up dma.h */
44#define DMA_FLOPPYDISK DMA_FLOPPY 50#define DMA_FLOPPYDISK DMA_FLOPPY
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h
index 81ca5d3e2bff..fb90b421f31c 100644
--- a/include/asm-arm/hardware/iop3xx.h
+++ b/include/asm-arm/hardware/iop3xx.h
@@ -194,6 +194,13 @@ extern int init_atu;
194#define IOP_TMR_PRIVILEGED 0x08 194#define IOP_TMR_PRIVILEGED 0x08
195#define IOP_TMR_RATIO_1_1 0x00 195#define IOP_TMR_RATIO_1_1 0x00
196 196
197/* Watchdog timer definitions */
198#define IOP_WDTCR_EN_ARM 0x1e1e1e1e
199#define IOP_WDTCR_EN 0xe1e1e1e1
200/* iop3xx does not support stopping the watchdog, so we just re-arm */
201#define IOP_WDTCR_DIS_ARM (IOP_WDTCR_EN_ARM)
202#define IOP_WDTCR_DIS (IOP_WDTCR_EN)
203
197/* Application accelerator unit */ 204/* Application accelerator unit */
198#define IOP3XX_AAU_PHYS_BASE (IOP3XX_PERIPHERAL_PHYS_BASE + 0x800) 205#define IOP3XX_AAU_PHYS_BASE (IOP3XX_PERIPHERAL_PHYS_BASE + 0x800)
199#define IOP3XX_AAU_UPPER_PA (IOP3XX_AAU_PHYS_BASE + 0xa7) 206#define IOP3XX_AAU_UPPER_PA (IOP3XX_AAU_PHYS_BASE + 0xa7)
@@ -274,6 +281,32 @@ static inline void write_tisr(u32 val)
274 asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (val)); 281 asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (val));
275} 282}
276 283
284static inline u32 read_wdtcr(void)
285{
286 u32 val;
287 asm volatile("mrc p6, 0, %0, c7, c1, 0":"=r" (val));
288 return val;
289}
290static inline void write_wdtcr(u32 val)
291{
292 asm volatile("mcr p6, 0, %0, c7, c1, 0"::"r" (val));
293}
294
295extern unsigned long get_iop_tick_rate(void);
296
297/* only iop13xx has these registers, we define these to present a
298 * common register interface for the iop_wdt driver.
299 */
300#define IOP_RCSR_WDT (0)
301static inline u32 read_rcsr(void)
302{
303 return 0;
304}
305static inline void write_wdtsr(u32 val)
306{
307 do { } while (0);
308}
309
277extern struct platform_device iop3xx_dma_0_channel; 310extern struct platform_device iop3xx_dma_0_channel;
278extern struct platform_device iop3xx_dma_1_channel; 311extern struct platform_device iop3xx_dma_1_channel;
279extern struct platform_device iop3xx_aau_channel; 312extern struct platform_device iop3xx_aau_channel;
diff --git a/include/asm-arm/pgtable-nommu.h b/include/asm-arm/pgtable-nommu.h
index 0c8be19fd66b..33c83dd87965 100644
--- a/include/asm-arm/pgtable-nommu.h
+++ b/include/asm-arm/pgtable-nommu.h
@@ -74,7 +74,6 @@ static inline int pte_file(pte_t pte) { return 0; }
74 * These would be in other places but having them here reduces the diffs. 74 * These would be in other places but having them here reduces the diffs.
75 */ 75 */
76extern unsigned int kobjsize(const void *objp); 76extern unsigned int kobjsize(const void *objp);
77extern int is_in_rom(unsigned long);
78 77
79/* 78/*
80 * No page table caches to initialise. 79 * No page table caches to initialise.
@@ -102,7 +101,8 @@ extern int is_in_rom(unsigned long);
102#define v4_tlb_fns (0) 101#define v4_tlb_fns (0)
103#define v4wb_tlb_fns (0) 102#define v4wb_tlb_fns (0)
104#define v4wbi_tlb_fns (0) 103#define v4wbi_tlb_fns (0)
105#define v6_tlb_fns (0) 104#define v6wbi_tlb_fns (0)
105#define v7wbi_tlb_fns (0)
106 106
107#define v3_user_fns (0) 107#define v3_user_fns (0)
108#define v4_user_fns (0) 108#define v4_user_fns (0)
diff --git a/include/asm-arm/plat-s3c/debug-macro.S b/include/asm-arm/plat-s3c/debug-macro.S
new file mode 100644
index 000000000000..84c40b847da8
--- /dev/null
+++ b/include/asm-arm/plat-s3c/debug-macro.S
@@ -0,0 +1,75 @@
1/* linux/include/asm-arm/plat-s3c/debug-macro.S
2 *
3 * Copyright 2005, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <asm/plat-s3c/regs-serial.h>
13
14/* The S3C2440 implementations are used by default as they are the
15 * most widely re-used */
16
17 .macro fifo_level_s3c2440 rd, rx
18 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
19 and \rd, \rd, #S3C2440_UFSTAT_TXMASK
20 .endm
21
22#ifndef fifo_level
23#define fifo_level fifo_level_s3c2410
24#endif
25
26 .macro fifo_full_s3c2440 rd, rx
27 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
28 tst \rd, #S3C2440_UFSTAT_TXFULL
29 .endm
30
31#ifndef fifo_full
32#define fifo_full fifo_full_s3c2440
33#endif
34
35 .macro senduart,rd,rx
36 strb \rd, [\rx, # S3C2410_UTXH ]
37 .endm
38
39 .macro busyuart, rd, rx
40 ldr \rd, [ \rx, # S3C2410_UFCON ]
41 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
42 beq 1001f @
43 @ FIFO enabled...
441003:
45 fifo_full \rd, \rx
46 bne 1003b
47 b 1002f
48
491001:
50 @ busy waiting for non fifo
51 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
52 tst \rd, #S3C2410_UTRSTAT_TXFE
53 beq 1001b
54
551002: @ exit busyuart
56 .endm
57
58 .macro waituart,rd,rx
59 ldr \rd, [ \rx, # S3C2410_UFCON ]
60 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
61 beq 1001f @
62 @ FIFO enabled...
631003:
64 fifo_level \rd, \rx
65 teq \rd, #0
66 bne 1003b
67 b 1002f
681001:
69 @ idle waiting for non fifo
70 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
71 tst \rd, #S3C2410_UTRSTAT_TXFE
72 beq 1001b
73
741002: @ exit busyuart
75 .endm
diff --git a/include/asm-arm/arch-s3c2410/iic.h b/include/asm-arm/plat-s3c/iic.h
index 71211c8b5384..71211c8b5384 100644
--- a/include/asm-arm/arch-s3c2410/iic.h
+++ b/include/asm-arm/plat-s3c/iic.h
diff --git a/include/asm-arm/plat-s3c/map.h b/include/asm-arm/plat-s3c/map.h
new file mode 100644
index 000000000000..b84289d32a54
--- /dev/null
+++ b/include/asm-arm/plat-s3c/map.h
@@ -0,0 +1,40 @@
1/* linux/include/asm-arm/plat-s3c/map.h
2 *
3 * Copyright 2003, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C - Memory map definitions (virtual addresses)
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_PLAT_MAP_H
15#define __ASM_PLAT_MAP_H __FILE__
16
17/* Fit all our registers in at 0xF4000000 upwards, trying to use as
18 * little of the VA space as possible so vmalloc and friends have a
19 * better chance of getting memory.
20 *
21 * we try to ensure stuff like the IRQ registers are available for
22 * an single MOVS instruction (ie, only 8 bits of set data)
23 */
24
25#define S3C_ADDR_BASE (0xF4000000)
26
27#ifndef __ASSEMBLY__
28#define S3C_ADDR(x) ((void __iomem __force *)S3C_ADDR_BASE + (x))
29#else
30#define S3C_ADDR(x) (S3C_ADDR_BASE + (x))
31#endif
32
33#define S3C_VA_IRQ S3C_ADDR(0x00000000) /* irq controller(s) */
34#define S3C_VA_SYS S3C_ADDR(0x00100000) /* system control */
35#define S3C_VA_MEM S3C_ADDR(0x00200000) /* system control */
36#define S3C_VA_TIMER S3C_ADDR(0x00300000) /* timer block */
37#define S3C_VA_WATCHDOG S3C_ADDR(0x00400000) /* watchdog */
38#define S3C_VA_UART S3C_ADDR(0x01000000) /* UART */
39
40#endif /* __ASM_PLAT_MAP_H */
diff --git a/include/asm-arm/arch-s3c2410/nand.h b/include/asm-arm/plat-s3c/nand.h
index 8816f7f9cee1..8816f7f9cee1 100644
--- a/include/asm-arm/arch-s3c2410/nand.h
+++ b/include/asm-arm/plat-s3c/nand.h
diff --git a/include/asm-arm/arch-s3c2410/regs-ac97.h b/include/asm-arm/plat-s3c/regs-ac97.h
index b004dee6bcaf..b004dee6bcaf 100644
--- a/include/asm-arm/arch-s3c2410/regs-ac97.h
+++ b/include/asm-arm/plat-s3c/regs-ac97.h
diff --git a/include/asm-arm/arch-s3c2410/regs-adc.h b/include/asm-arm/plat-s3c/regs-adc.h
index c7f231963e76..c7f231963e76 100644
--- a/include/asm-arm/arch-s3c2410/regs-adc.h
+++ b/include/asm-arm/plat-s3c/regs-adc.h
diff --git a/include/asm-arm/arch-s3c2410/regs-iic.h b/include/asm-arm/plat-s3c/regs-iic.h
index 2ae29522f253..2ae29522f253 100644
--- a/include/asm-arm/arch-s3c2410/regs-iic.h
+++ b/include/asm-arm/plat-s3c/regs-iic.h
diff --git a/include/asm-arm/arch-s3c2410/regs-nand.h b/include/asm-arm/plat-s3c/regs-nand.h
index b824d371ae0b..b824d371ae0b 100644
--- a/include/asm-arm/arch-s3c2410/regs-nand.h
+++ b/include/asm-arm/plat-s3c/regs-nand.h
diff --git a/include/asm-arm/arch-s3c2410/regs-rtc.h b/include/asm-arm/plat-s3c/regs-rtc.h
index 93b03c49710a..93b03c49710a 100644
--- a/include/asm-arm/arch-s3c2410/regs-rtc.h
+++ b/include/asm-arm/plat-s3c/regs-rtc.h
diff --git a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/plat-s3c/regs-serial.h
index 8946702a87f5..923e114db663 100644
--- a/include/asm-arm/arch-s3c2410/regs-serial.h
+++ b/include/asm-arm/plat-s3c/regs-serial.h
@@ -32,10 +32,10 @@
32#ifndef __ASM_ARM_REGS_SERIAL_H 32#ifndef __ASM_ARM_REGS_SERIAL_H
33#define __ASM_ARM_REGS_SERIAL_H 33#define __ASM_ARM_REGS_SERIAL_H
34 34
35#define S3C24XX_VA_UART0 (S3C24XX_VA_UART) 35#define S3C24XX_VA_UART0 (S3C_VA_UART)
36#define S3C24XX_VA_UART1 (S3C24XX_VA_UART + 0x4000 ) 36#define S3C24XX_VA_UART1 (S3C_VA_UART + 0x4000 )
37#define S3C24XX_VA_UART2 (S3C24XX_VA_UART + 0x8000 ) 37#define S3C24XX_VA_UART2 (S3C_VA_UART + 0x8000 )
38#define S3C24XX_VA_UART3 (S3C24XX_VA_UART + 0xC000 ) 38#define S3C24XX_VA_UART3 (S3C_VA_UART + 0xC000 )
39 39
40#define S3C2410_PA_UART0 (S3C24XX_PA_UART) 40#define S3C2410_PA_UART0 (S3C24XX_PA_UART)
41#define S3C2410_PA_UART1 (S3C24XX_PA_UART + 0x4000 ) 41#define S3C2410_PA_UART1 (S3C24XX_PA_UART + 0x4000 )
diff --git a/include/asm-arm/arch-s3c2410/regs-timer.h b/include/asm-arm/plat-s3c/regs-timer.h
index 6f8fe432fe3a..8b0d594397b1 100644
--- a/include/asm-arm/arch-s3c2410/regs-timer.h
+++ b/include/asm-arm/plat-s3c/regs-timer.h
@@ -14,12 +14,12 @@
14#ifndef __ASM_ARCH_REGS_TIMER_H 14#ifndef __ASM_ARCH_REGS_TIMER_H
15#define __ASM_ARCH_REGS_TIMER_H "$Id: timer.h,v 1.4 2003/05/06 19:30:50 ben Exp $" 15#define __ASM_ARCH_REGS_TIMER_H "$Id: timer.h,v 1.4 2003/05/06 19:30:50 ben Exp $"
16 16
17#define S3C2410_TIMERREG(x) (S3C24XX_VA_TIMER + (x)) 17#define S3C_TIMERREG(x) (S3C_VA_TIMER + (x))
18#define S3C2410_TIMERREG2(tmr,reg) S3C2410_TIMERREG((reg)+0x0c+((tmr)*0x0c)) 18#define S3C_TIMERREG2(tmr,reg) S3C_TIMERREG((reg)+0x0c+((tmr)*0x0c))
19 19
20#define S3C2410_TCFG0 S3C2410_TIMERREG(0x00) 20#define S3C2410_TCFG0 S3C_TIMERREG(0x00)
21#define S3C2410_TCFG1 S3C2410_TIMERREG(0x04) 21#define S3C2410_TCFG1 S3C_TIMERREG(0x04)
22#define S3C2410_TCON S3C2410_TIMERREG(0x08) 22#define S3C2410_TCON S3C_TIMERREG(0x08)
23 23
24#define S3C2410_TCFG_PRESCALER0_MASK (255<<0) 24#define S3C2410_TCFG_PRESCALER0_MASK (255<<0)
25#define S3C2410_TCFG_PRESCALER1_MASK (255<<8) 25#define S3C2410_TCFG_PRESCALER1_MASK (255<<8)
@@ -71,9 +71,9 @@
71 71
72/* WARNING - timer 4 has no buffer reg, and it's observation is at +4 */ 72/* WARNING - timer 4 has no buffer reg, and it's observation is at +4 */
73 73
74#define S3C2410_TCNTB(tmr) S3C2410_TIMERREG2(tmr, 0x00) 74#define S3C2410_TCNTB(tmr) S3C_TIMERREG2(tmr, 0x00)
75#define S3C2410_TCMPB(tmr) S3C2410_TIMERREG2(tmr, 0x04) 75#define S3C2410_TCMPB(tmr) S3C_TIMERREG2(tmr, 0x04)
76#define S3C2410_TCNTO(tmr) S3C2410_TIMERREG2(tmr, (((tmr) == 4) ? 0x04 : 0x08)) 76#define S3C2410_TCNTO(tmr) S3C_TIMERREG2(tmr, (((tmr) == 4) ? 0x04 : 0x08))
77 77
78#define S3C2410_TCON_T4RELOAD (1<<22) 78#define S3C2410_TCON_T4RELOAD (1<<22)
79#define S3C2410_TCON_T4MANUALUPD (1<<21) 79#define S3C2410_TCON_T4MANUALUPD (1<<21)
diff --git a/include/asm-arm/arch-s3c2410/regs-watchdog.h b/include/asm-arm/plat-s3c/regs-watchdog.h
index a9c5d491bdb6..56c4193b7a46 100644
--- a/include/asm-arm/arch-s3c2410/regs-watchdog.h
+++ b/include/asm-arm/plat-s3c/regs-watchdog.h
@@ -14,11 +14,11 @@
14#ifndef __ASM_ARCH_REGS_WATCHDOG_H 14#ifndef __ASM_ARCH_REGS_WATCHDOG_H
15#define __ASM_ARCH_REGS_WATCHDOG_H "$Id: watchdog.h,v 1.2 2003/04/29 13:31:09 ben Exp $" 15#define __ASM_ARCH_REGS_WATCHDOG_H "$Id: watchdog.h,v 1.2 2003/04/29 13:31:09 ben Exp $"
16 16
17#define S3C2410_WDOGREG(x) ((x) + S3C24XX_VA_WATCHDOG) 17#define S3C_WDOGREG(x) ((x) + S3C_VA_WATCHDOG)
18 18
19#define S3C2410_WTCON S3C2410_WDOGREG(0x00) 19#define S3C2410_WTCON S3C_WDOGREG(0x00)
20#define S3C2410_WTDAT S3C2410_WDOGREG(0x04) 20#define S3C2410_WTDAT S3C_WDOGREG(0x04)
21#define S3C2410_WTCNT S3C2410_WDOGREG(0x08) 21#define S3C2410_WTCNT S3C_WDOGREG(0x08)
22 22
23/* the watchdog can either generate a reset pulse, or an 23/* the watchdog can either generate a reset pulse, or an
24 * interrupt. 24 * interrupt.
diff --git a/include/asm-arm/plat-s3c/uncompress.h b/include/asm-arm/plat-s3c/uncompress.h
new file mode 100644
index 000000000000..b5e6208175d1
--- /dev/null
+++ b/include/asm-arm/plat-s3c/uncompress.h
@@ -0,0 +1,155 @@
1/* linux/include/asm-arm/plat-s3c/uncompress.h
2 *
3 * Copyright 2003, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C - uncompress code
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_PLAT_UNCOMPRESS_H
15#define __ASM_PLAT_UNCOMPRESS_H
16
17typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
18
19/* uart setup */
20
21static unsigned int fifo_mask;
22static unsigned int fifo_max;
23
24/* forward declerations */
25
26static void arch_detect_cpu(void);
27
28/* defines for UART registers */
29
30#include "asm/plat-s3c/regs-serial.h"
31#include "asm/plat-s3c/regs-watchdog.h"
32
33/* working in physical space... */
34#undef S3C2410_WDOGREG
35#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x)))
36
37/* how many bytes we allow into the FIFO at a time in FIFO mode */
38#define FIFO_MAX (14)
39
40#define uart_base S3C24XX_PA_UART + (0x4000*CONFIG_S3C_LOWLEVEL_UART_PORT)
41
42static __inline__ void
43uart_wr(unsigned int reg, unsigned int val)
44{
45 volatile unsigned int *ptr;
46
47 ptr = (volatile unsigned int *)(reg + uart_base);
48 *ptr = val;
49}
50
51static __inline__ unsigned int
52uart_rd(unsigned int reg)
53{
54 volatile unsigned int *ptr;
55
56 ptr = (volatile unsigned int *)(reg + uart_base);
57 return *ptr;
58}
59
60/* we can deal with the case the UARTs are being run
61 * in FIFO mode, so that we don't hold up our execution
62 * waiting for tx to happen...
63*/
64
65static void putc(int ch)
66{
67 if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
68 int level;
69
70 while (1) {
71 level = uart_rd(S3C2410_UFSTAT);
72 level &= fifo_mask;
73
74 if (level < fifo_max)
75 break;
76 }
77
78 } else {
79 /* not using fifos */
80
81 while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE)
82 barrier();
83 }
84
85 /* write byte to transmission register */
86 uart_wr(S3C2410_UTXH, ch);
87}
88
89static inline void flush(void)
90{
91}
92
93#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0)
94
95/* CONFIG_S3C_BOOT_WATCHDOG
96 *
97 * Simple boot-time watchdog setup, to reboot the system if there is
98 * any problem with the boot process
99*/
100
101#ifdef CONFIG_S3C_BOOT_WATCHDOG
102
103#define WDOG_COUNT (0xff00)
104
105static inline void arch_decomp_wdog(void)
106{
107 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
108}
109
110static void arch_decomp_wdog_start(void)
111{
112 __raw_writel(WDOG_COUNT, S3C2410_WTDAT);
113 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
114 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
115}
116
117#else
118#define arch_decomp_wdog_start()
119#define arch_decomp_wdog()
120#endif
121
122#ifdef CONFIG_S3C_BOOT_ERROR_RESET
123
124static void arch_decomp_error(const char *x)
125{
126 putstr("\n\n");
127 putstr(x);
128 putstr("\n\n -- System resetting\n");
129
130 __raw_writel(0x4000, S3C2410_WTDAT);
131 __raw_writel(0x4000, S3C2410_WTCNT);
132 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON);
133
134 while(1);
135}
136
137#define arch_error arch_decomp_error
138#endif
139
140static void error(char *err);
141
142static void
143arch_decomp_setup(void)
144{
145 /* we may need to setup the uart(s) here if we are not running
146 * on an BAST... the BAST will have left the uarts configured
147 * after calling linux.
148 */
149
150 arch_detect_cpu();
151 arch_decomp_wdog_start();
152}
153
154
155#endif /* __ASM_PLAT_UNCOMPRESS_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-iis.h b/include/asm-arm/plat-s3c24xx/regs-iis.h
index eaf77916a602..eaf77916a602 100644
--- a/include/asm-arm/arch-s3c2410/regs-iis.h
+++ b/include/asm-arm/plat-s3c24xx/regs-iis.h
diff --git a/include/asm-arm/arch-s3c2410/regs-spi.h b/include/asm-arm/plat-s3c24xx/regs-spi.h
index 4a499a138256..4a499a138256 100644
--- a/include/asm-arm/arch-s3c2410/regs-spi.h
+++ b/include/asm-arm/plat-s3c24xx/regs-spi.h
diff --git a/include/asm-arm/arch-s3c2410/regs-udc.h b/include/asm-arm/plat-s3c24xx/regs-udc.h
index e1e9805d2d9a..e1e9805d2d9a 100644
--- a/include/asm-arm/arch-s3c2410/regs-udc.h
+++ b/include/asm-arm/plat-s3c24xx/regs-udc.h
diff --git a/include/asm-arm/arch-s3c2410/udc.h b/include/asm-arm/plat-s3c24xx/udc.h
index b8aa6cb69b58..b8aa6cb69b58 100644
--- a/include/asm-arm/arch-s3c2410/udc.h
+++ b/include/asm-arm/plat-s3c24xx/udc.h
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 6f8e6a69dc5f..94ea8c6dc1a4 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -254,16 +254,6 @@ do { \
254 last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \ 254 last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \
255} while (0) 255} while (0)
256 256
257/*
258 * On SMP systems, when the scheduler does migration-cost autodetection,
259 * it needs a way to flush as much of the CPU's caches as possible.
260 *
261 * TODO: fill this in!
262 */
263static inline void sched_cacheflush(void)
264{
265}
266
267#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110) 257#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
268/* 258/*
269 * On the StrongARM, "swp" is terminally broken since it bypasses the 259 * On the StrongARM, "swp" is terminally broken since it bypasses the
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index eae85b09db2e..41784357a204 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -24,7 +24,6 @@
24struct task_struct; 24struct task_struct;
25struct exec_domain; 25struct exec_domain;
26 26
27#include <asm/ptrace.h>
28#include <asm/types.h> 27#include <asm/types.h>
29#include <asm/domain.h> 28#include <asm/domain.h>
30 29
@@ -135,22 +134,19 @@ extern void iwmmxt_task_switch(struct thread_info *);
135/* 134/*
136 * thread information flags: 135 * thread information flags:
137 * TIF_SYSCALL_TRACE - syscall trace active 136 * TIF_SYSCALL_TRACE - syscall trace active
138 * TIF_NOTIFY_RESUME - resumption notification requested
139 * TIF_SIGPENDING - signal pending 137 * TIF_SIGPENDING - signal pending
140 * TIF_NEED_RESCHED - rescheduling necessary 138 * TIF_NEED_RESCHED - rescheduling necessary
141 * TIF_USEDFPU - FPU was used by this task this quantum (SMP) 139 * TIF_USEDFPU - FPU was used by this task this quantum (SMP)
142 * TIF_POLLING_NRFLAG - true if poll_idle() is polling TIF_NEED_RESCHED 140 * TIF_POLLING_NRFLAG - true if poll_idle() is polling TIF_NEED_RESCHED
143 */ 141 */
144#define TIF_NOTIFY_RESUME 0 142#define TIF_SIGPENDING 0
145#define TIF_SIGPENDING 1 143#define TIF_NEED_RESCHED 1
146#define TIF_NEED_RESCHED 2
147#define TIF_SYSCALL_TRACE 8 144#define TIF_SYSCALL_TRACE 8
148#define TIF_POLLING_NRFLAG 16 145#define TIF_POLLING_NRFLAG 16
149#define TIF_USING_IWMMXT 17 146#define TIF_USING_IWMMXT 17
150#define TIF_MEMDIE 18 147#define TIF_MEMDIE 18
151#define TIF_FREEZE 19 148#define TIF_FREEZE 19
152 149
153#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
154#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 150#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
155#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 151#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
156#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 152#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
diff --git a/include/asm-arm/unaligned.h b/include/asm-arm/unaligned.h
index 795b9e5b9e6a..8431f6eed5c6 100644
--- a/include/asm-arm/unaligned.h
+++ b/include/asm-arm/unaligned.h
@@ -60,24 +60,24 @@ extern int __bug_unaligned_x(const void *ptr);
60 __get_unaligned_4_be((__p+4))) 60 __get_unaligned_4_be((__p+4)))
61 61
62#define __get_unaligned_le(ptr) \ 62#define __get_unaligned_le(ptr) \
63 ({ \ 63 ((__force typeof(*(ptr)))({ \
64 const __u8 *__p = (const __u8 *)(ptr); \ 64 const __u8 *__p = (const __u8 *)(ptr); \
65 __builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \ 65 __builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \
66 __builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_le(__p), \ 66 __builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_le(__p), \
67 __builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_le(__p), \ 67 __builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_le(__p), \
68 __builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_le(__p), \ 68 __builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_le(__p), \
69 (void)__bug_unaligned_x(__p))))); \ 69 (void)__bug_unaligned_x(__p))))); \
70 }) 70 }))
71 71
72#define __get_unaligned_be(ptr) \ 72#define __get_unaligned_be(ptr) \
73 ({ \ 73 ((__force typeof(*(ptr)))({ \
74 const __u8 *__p = (const __u8 *)(ptr); \ 74 const __u8 *__p = (const __u8 *)(ptr); \
75 __builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \ 75 __builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \
76 __builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_be(__p), \ 76 __builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_be(__p), \
77 __builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_be(__p), \ 77 __builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_be(__p), \
78 __builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_be(__p), \ 78 __builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_be(__p), \
79 (void)__bug_unaligned_x(__p))))); \ 79 (void)__bug_unaligned_x(__p))))); \
80 }) 80 }))
81 81
82 82
83static inline void __put_unaligned_2_le(__u32 __v, register __u8 *__p) 83static inline void __put_unaligned_2_le(__u32 __v, register __u8 *__p)
@@ -131,15 +131,16 @@ static inline void __put_unaligned_8_be(const unsigned long long __v, register _
131 */ 131 */
132#define __put_unaligned_le(val,ptr) \ 132#define __put_unaligned_le(val,ptr) \
133 ({ \ 133 ({ \
134 (void)sizeof(*(ptr) = (val)); \
134 switch (sizeof(*(ptr))) { \ 135 switch (sizeof(*(ptr))) { \
135 case 1: \ 136 case 1: \
136 *(ptr) = (val); \ 137 *(ptr) = (val); \
137 break; \ 138 break; \
138 case 2: __put_unaligned_2_le((val),(__u8 *)(ptr)); \ 139 case 2: __put_unaligned_2_le((__force u16)(val),(__u8 *)(ptr)); \
139 break; \ 140 break; \
140 case 4: __put_unaligned_4_le((val),(__u8 *)(ptr)); \ 141 case 4: __put_unaligned_4_le((__force u32)(val),(__u8 *)(ptr)); \
141 break; \ 142 break; \
142 case 8: __put_unaligned_8_le((val),(__u8 *)(ptr)); \ 143 case 8: __put_unaligned_8_le((__force u64)(val),(__u8 *)(ptr)); \
143 break; \ 144 break; \
144 default: __bug_unaligned_x(ptr); \ 145 default: __bug_unaligned_x(ptr); \
145 break; \ 146 break; \
@@ -149,15 +150,16 @@ static inline void __put_unaligned_8_be(const unsigned long long __v, register _
149 150
150#define __put_unaligned_be(val,ptr) \ 151#define __put_unaligned_be(val,ptr) \
151 ({ \ 152 ({ \
153 (void)sizeof(*(ptr) = (val)); \
152 switch (sizeof(*(ptr))) { \ 154 switch (sizeof(*(ptr))) { \
153 case 1: \ 155 case 1: \
154 *(ptr) = (val); \ 156 *(ptr) = (val); \
155 break; \ 157 break; \
156 case 2: __put_unaligned_2_be((val),(__u8 *)(ptr)); \ 158 case 2: __put_unaligned_2_be((__force u16)(val),(__u8 *)(ptr)); \
157 break; \ 159 break; \
158 case 4: __put_unaligned_4_be((val),(__u8 *)(ptr)); \ 160 case 4: __put_unaligned_4_be((__force u32)(val),(__u8 *)(ptr)); \
159 break; \ 161 break; \
160 case 8: __put_unaligned_8_be((val),(__u8 *)(ptr)); \ 162 case 8: __put_unaligned_8_be((__force u64)(val),(__u8 *)(ptr)); \
161 break; \ 163 break; \
162 default: __bug_unaligned_x(ptr); \ 164 default: __bug_unaligned_x(ptr); \
163 break; \ 165 break; \
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index bfdbebebdc1b..d327b25c986c 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -441,7 +441,6 @@
441/* 441/*
442 * Unimplemented (or alternatively implemented) syscalls 442 * Unimplemented (or alternatively implemented) syscalls
443 */ 443 */
444#define __IGNORE_sync_file_range 1
445#define __IGNORE_fadvise64_64 1 444#define __IGNORE_fadvise64_64 1
446 445
447#endif /* __KERNEL__ */ 446#endif /* __KERNEL__ */
diff --git a/include/asm-arm/vfp.h b/include/asm-arm/vfp.h
index 14c5e0946c47..bd6be9d7f772 100644
--- a/include/asm-arm/vfp.h
+++ b/include/asm-arm/vfp.h
@@ -26,8 +26,8 @@
26#define FPSID_REV_MASK (0xF << FPSID_REV_BIT) 26#define FPSID_REV_MASK (0xF << FPSID_REV_BIT)
27 27
28/* FPEXC bits */ 28/* FPEXC bits */
29#define FPEXC_EXCEPTION (1<<31) 29#define FPEXC_EX (1 << 31)
30#define FPEXC_ENABLE (1<<30) 30#define FPEXC_EN (1 << 30)
31 31
32/* FPSCR bits */ 32/* FPSCR bits */
33#define FPSCR_DEFAULT_NAN (1<<25) 33#define FPSCR_DEFAULT_NAN (1<<25)
diff --git a/include/asm-arm26/a.out.h b/include/asm-arm26/a.out.h
deleted file mode 100644
index 9b2702c42c87..000000000000
--- a/include/asm-arm26/a.out.h
+++ /dev/null
@@ -1,38 +0,0 @@
1#ifndef __ARM_A_OUT_H__
2#define __ARM_A_OUT_H__
3
4#include <linux/personality.h>
5#include <asm/types.h>
6
7struct exec
8{
9 __u32 a_info; /* Use macros N_MAGIC, etc for access */
10 __u32 a_text; /* length of text, in bytes */
11 __u32 a_data; /* length of data, in bytes */
12 __u32 a_bss; /* length of uninitialized data area for file, in bytes */
13 __u32 a_syms; /* length of symbol table data in file, in bytes */
14 __u32 a_entry; /* start address */
15 __u32 a_trsize; /* length of relocation info for text, in bytes */
16 __u32 a_drsize; /* length of relocation info for data, in bytes */
17};
18
19/*
20 * This is always the same
21 */
22#define N_TXTADDR(a) (0x00008000)
23
24#define N_TRSIZE(a) ((a).a_trsize)
25#define N_DRSIZE(a) ((a).a_drsize)
26#define N_SYMSIZE(a) ((a).a_syms)
27
28#define M_ARM 103
29
30#ifdef __KERNEL__
31#define STACK_TOP TASK_SIZE
32#endif
33
34#ifndef LIBRARY_START_TEXT
35#define LIBRARY_START_TEXT (0x00c00000)
36#endif
37
38#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-arm26/assembler.h b/include/asm-arm26/assembler.h
deleted file mode 100644
index bb507a9a4a55..000000000000
--- a/include/asm-arm26/assembler.h
+++ /dev/null
@@ -1,106 +0,0 @@
1/*
2 * linux/include/asm-arm26/assembler.h
3 *
4 * This file contains arm architecture specific defines
5 * for the different processors.
6 *
7 * Do not include any C declarations in this file - it is included by
8 * assembler source.
9 */
10#ifndef __ASSEMBLY__
11#error "Only include this from assembly code"
12#endif
13
14/*
15 * Endian independent macros for shifting bytes within registers.
16 */
17#define pull lsr
18#define push lsl
19#define byte(x) (x*8)
20
21#ifdef __STDC__
22#define LOADREGS(cond, base, reglist...)\
23 ldm##cond base,reglist^
24
25#define RETINSTR(instr, regs...)\
26 instr##s regs
27#else
28#define LOADREGS(cond, base, reglist...)\
29 ldm/**/cond base,reglist^
30
31#define RETINSTR(instr, regs...)\
32 instr/**/s regs
33#endif
34
35#define MODENOP\
36 mov r0, r0
37
38#define MODE(savereg,tmpreg,mode) \
39 mov savereg, pc; \
40 bic tmpreg, savereg, $0x0c000003; \
41 orr tmpreg, tmpreg, $mode; \
42 teqp tmpreg, $0
43
44#define RESTOREMODE(savereg) \
45 teqp savereg, $0
46
47#define SAVEIRQS(tmpreg)
48
49#define RESTOREIRQS(tmpreg)
50
51#define DISABLEIRQS(tmpreg)\
52 teqp pc, $0x08000003
53
54#define ENABLEIRQS(tmpreg)\
55 teqp pc, $0x00000003
56
57#define USERMODE(tmpreg)\
58 teqp pc, $0x00000000;\
59 mov r0, r0
60
61#define SVCMODE(tmpreg)\
62 teqp pc, $0x00000003;\
63 mov r0, r0
64
65
66/*
67 * Save the current IRQ state and disable IRQs
68 * Note that this macro assumes FIQs are enabled, and
69 * that the processor is in SVC mode.
70 */
71 .macro save_and_disable_irqs, oldcpsr, temp
72 mov \oldcpsr, pc
73 orr \temp, \oldcpsr, #0x08000000
74 teqp \temp, #0
75 .endm
76
77/*
78 * Restore interrupt state previously stored in
79 * a register
80 * ** Actually do nothing on Arc - hope that the caller uses a MOVS PC soon
81 * after!
82 */
83 .macro restore_irqs, oldcpsr
84 @ This be restore_irqs
85 .endm
86
87/*
88 * These two are used to save LR/restore PC over a user-based access.
89 * The old 26-bit architecture requires that we save lr (R14)
90 */
91 .macro save_lr
92 str lr, [sp, #-4]!
93 .endm
94
95 .macro restore_pc
96 ldmfd sp!, {pc}^
97 .endm
98
99#define USER(x...) \
1009999: x; \
101 .section __ex_table,"a"; \
102 .align 3; \
103 .long 9999b,9001f; \
104 .previous
105
106
diff --git a/include/asm-arm26/atomic.h b/include/asm-arm26/atomic.h
deleted file mode 100644
index d6dd42374cf3..000000000000
--- a/include/asm-arm26/atomic.h
+++ /dev/null
@@ -1,123 +0,0 @@
1/*
2 * linux/include/asm-arm26/atomic.h
3 *
4 * Copyright (c) 1996 Russell King.
5 * Modified for arm26 by Ian Molton
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Changelog:
12 * 25-11-2004 IM Updated for 2.6.9
13 * 27-06-1996 RMK Created
14 * 13-04-1997 RMK Made functions atomic!
15 * 07-12-1997 RMK Upgraded for v2.1.
16 * 26-08-1998 PJB Added #ifdef __KERNEL__
17 *
18 * FIXME - its probably worth seeing what these compile into...
19 */
20#ifndef __ASM_ARM_ATOMIC_H
21#define __ASM_ARM_ATOMIC_H
22
23#ifdef CONFIG_SMP
24#error SMP is NOT supported
25#endif
26
27typedef struct { volatile int counter; } atomic_t;
28
29#define ATOMIC_INIT(i) { (i) }
30
31#ifdef __KERNEL__
32#include <asm/system.h>
33
34#define atomic_read(v) ((v)->counter)
35#define atomic_set(v,i) (((v)->counter) = (i))
36
37static inline int atomic_add_return(int i, atomic_t *v)
38{
39 unsigned long flags;
40 int val;
41
42 local_irq_save(flags);
43 val = v->counter;
44 v->counter = val += i;
45 local_irq_restore(flags);
46
47 return val;
48}
49
50static inline int atomic_sub_return(int i, atomic_t *v)
51{
52 unsigned long flags;
53 int val;
54
55 local_irq_save(flags);
56 val = v->counter;
57 v->counter = val -= i;
58 local_irq_restore(flags);
59
60 return val;
61}
62
63static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
64{
65 int ret;
66 unsigned long flags;
67
68 local_irq_save(flags);
69 ret = v->counter;
70 if (likely(ret == old))
71 v->counter = new;
72 local_irq_restore(flags);
73
74 return ret;
75}
76
77#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
78
79static inline int atomic_add_unless(atomic_t *v, int a, int u)
80{
81 int ret;
82 unsigned long flags;
83
84 local_irq_save(flags);
85 ret = v->counter;
86 if (ret != u)
87 v->counter += a;
88 local_irq_restore(flags);
89
90 return ret != u;
91}
92#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
93
94static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
95{
96 unsigned long flags;
97
98 local_irq_save(flags);
99 *addr &= ~mask;
100 local_irq_restore(flags);
101}
102
103#define atomic_add(i, v) (void) atomic_add_return(i, v)
104#define atomic_inc(v) (void) atomic_add_return(1, v)
105#define atomic_sub(i, v) (void) atomic_sub_return(i, v)
106#define atomic_dec(v) (void) atomic_sub_return(1, v)
107
108#define atomic_inc_and_test(v) (atomic_add_return(1, v) == 0)
109#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
110#define atomic_inc_return(v) (atomic_add_return(1, v))
111#define atomic_dec_return(v) (atomic_sub_return(1, v))
112
113#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0)
114
115/* Atomic operations are already serializing on ARM26 */
116#define smp_mb__before_atomic_dec() barrier()
117#define smp_mb__after_atomic_dec() barrier()
118#define smp_mb__before_atomic_inc() barrier()
119#define smp_mb__after_atomic_inc() barrier()
120
121#include <asm-generic/atomic.h>
122#endif
123#endif
diff --git a/include/asm-arm26/auxvec.h b/include/asm-arm26/auxvec.h
deleted file mode 100644
index c0536f6b29a7..000000000000
--- a/include/asm-arm26/auxvec.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef __ASMARM_AUXVEC_H
2#define __ASMARM_AUXVEC_H
3
4#endif
diff --git a/include/asm-arm26/bitops.h b/include/asm-arm26/bitops.h
deleted file mode 100644
index 19a69573a654..000000000000
--- a/include/asm-arm26/bitops.h
+++ /dev/null
@@ -1,207 +0,0 @@
1/*
2 * Copyright 1995, Russell King.
3 *
4 * Based on the arm32 version by RMK (and others). Their copyrights apply to
5 * Those parts.
6 * Modified for arm26 by Ian Molton on 25/11/04
7 *
8 * bit 0 is the LSB of an "unsigned long" quantity.
9 *
10 * Please note that the code in this file should never be included
11 * from user space. Many of these are not implemented in assembler
12 * since they would be too costly. Also, they require privileged
13 * instructions (which are not available from user mode) to ensure
14 * that they are atomic.
15 */
16
17#ifndef __ASM_ARM_BITOPS_H
18#define __ASM_ARM_BITOPS_H
19
20#ifdef __KERNEL__
21
22#include <linux/compiler.h>
23#include <asm/system.h>
24
25#define smp_mb__before_clear_bit() do { } while (0)
26#define smp_mb__after_clear_bit() do { } while (0)
27
28/*
29 * These functions are the basis of our bit ops.
30 *
31 * First, the atomic bitops. These use native endian.
32 */
33static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long *p)
34{
35 unsigned long flags;
36 unsigned long mask = 1UL << (bit & 31);
37
38 p += bit >> 5;
39
40 local_irq_save(flags);
41 *p |= mask;
42 local_irq_restore(flags);
43}
44
45static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p)
46{
47 unsigned long flags;
48 unsigned long mask = 1UL << (bit & 31);
49
50 p += bit >> 5;
51
52 local_irq_save(flags);
53 *p &= ~mask;
54 local_irq_restore(flags);
55}
56
57static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p)
58{
59 unsigned long flags;
60 unsigned long mask = 1UL << (bit & 31);
61
62 p += bit >> 5;
63
64 local_irq_save(flags);
65 *p ^= mask;
66 local_irq_restore(flags);
67}
68
69static inline int
70____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
71{
72 unsigned long flags;
73 unsigned int res;
74 unsigned long mask = 1UL << (bit & 31);
75
76 p += bit >> 5;
77
78 local_irq_save(flags);
79 res = *p;
80 *p = res | mask;
81 local_irq_restore(flags);
82
83 return res & mask;
84}
85
86static inline int
87____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
88{
89 unsigned long flags;
90 unsigned int res;
91 unsigned long mask = 1UL << (bit & 31);
92
93 p += bit >> 5;
94
95 local_irq_save(flags);
96 res = *p;
97 *p = res & ~mask;
98 local_irq_restore(flags);
99
100 return res & mask;
101}
102
103static inline int
104____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
105{
106 unsigned long flags;
107 unsigned int res;
108 unsigned long mask = 1UL << (bit & 31);
109
110 p += bit >> 5;
111
112 local_irq_save(flags);
113 res = *p;
114 *p = res ^ mask;
115 local_irq_restore(flags);
116
117 return res & mask;
118}
119
120#include <asm-generic/bitops/non-atomic.h>
121
122/*
123 * Little endian assembly bitops. nr = 0 -> byte 0 bit 0.
124 */
125extern void _set_bit_le(int nr, volatile unsigned long * p);
126extern void _clear_bit_le(int nr, volatile unsigned long * p);
127extern void _change_bit_le(int nr, volatile unsigned long * p);
128extern int _test_and_set_bit_le(int nr, volatile unsigned long * p);
129extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p);
130extern int _test_and_change_bit_le(int nr, volatile unsigned long * p);
131extern int _find_first_zero_bit_le(const unsigned long * p, unsigned size);
132extern int _find_next_zero_bit_le(void * p, int size, int offset);
133extern int _find_first_bit_le(const unsigned long *p, unsigned size);
134extern int _find_next_bit_le(const unsigned long *p, int size, int offset);
135
136/*
137 * The __* form of bitops are non-atomic and may be reordered.
138 */
139#define ATOMIC_BITOP_LE(name,nr,p) \
140 (__builtin_constant_p(nr) ? \
141 ____atomic_##name(nr, p) : \
142 _##name##_le(nr,p))
143
144#define NONATOMIC_BITOP(name,nr,p) \
145 (____nonatomic_##name(nr, p))
146
147/*
148 * These are the little endian, atomic definitions.
149 */
150#define set_bit(nr,p) ATOMIC_BITOP_LE(set_bit,nr,p)
151#define clear_bit(nr,p) ATOMIC_BITOP_LE(clear_bit,nr,p)
152#define change_bit(nr,p) ATOMIC_BITOP_LE(change_bit,nr,p)
153#define test_and_set_bit(nr,p) ATOMIC_BITOP_LE(test_and_set_bit,nr,p)
154#define test_and_clear_bit(nr,p) ATOMIC_BITOP_LE(test_and_clear_bit,nr,p)
155#define test_and_change_bit(nr,p) ATOMIC_BITOP_LE(test_and_change_bit,nr,p)
156#define find_first_zero_bit(p,sz) _find_first_zero_bit_le(p,sz)
157#define find_next_zero_bit(p,sz,off) _find_next_zero_bit_le(p,sz,off)
158#define find_first_bit(p,sz) _find_first_bit_le(p,sz)
159#define find_next_bit(p,sz,off) _find_next_bit_le(p,sz,off)
160
161#define WORD_BITOFF_TO_LE(x) ((x))
162
163#include <asm-generic/bitops/ffz.h>
164#include <asm-generic/bitops/__ffs.h>
165#include <asm-generic/bitops/fls.h>
166#include <asm-generic/bitops/fls64.h>
167#include <asm-generic/bitops/ffs.h>
168#include <asm-generic/bitops/sched.h>
169#include <asm-generic/bitops/hweight.h>
170
171/*
172 * Ext2 is defined to use little-endian byte ordering.
173 * These do not need to be atomic.
174 */
175#define ext2_set_bit(nr,p) \
176 __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
177#define ext2_set_bit_atomic(lock,nr,p) \
178 test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
179#define ext2_clear_bit(nr,p) \
180 __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
181#define ext2_clear_bit_atomic(lock,nr,p) \
182 test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
183#define ext2_test_bit(nr,p) \
184 test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
185#define ext2_find_first_zero_bit(p,sz) \
186 _find_first_zero_bit_le(p,sz)
187#define ext2_find_next_zero_bit(p,sz,off) \
188 _find_next_zero_bit_le(p,sz,off)
189
190/*
191 * Minix is defined to use little-endian byte ordering.
192 * These do not need to be atomic.
193 */
194#define minix_set_bit(nr,p) \
195 __set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
196#define minix_test_bit(nr,p) \
197 test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
198#define minix_test_and_set_bit(nr,p) \
199 __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
200#define minix_test_and_clear_bit(nr,p) \
201 __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
202#define minix_find_first_zero_bit(p,sz) \
203 _find_first_zero_bit_le((unsigned long *)(p),sz)
204
205#endif /* __KERNEL__ */
206
207#endif /* _ARM_BITOPS_H */
diff --git a/include/asm-arm26/bug.h b/include/asm-arm26/bug.h
deleted file mode 100644
index 8545d58b0475..000000000000
--- a/include/asm-arm26/bug.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef _ASMARM_BUG_H
2#define _ASMARM_BUG_H
3
4
5#ifdef CONFIG_BUG
6#ifdef CONFIG_DEBUG_BUGVERBOSE
7extern volatile void __bug(const char *file, int line, void *data);
8/* give file/line information */
9#define BUG() __bug(__FILE__, __LINE__, NULL)
10#else
11#define BUG() (*(int *)0 = 0)
12#endif
13
14#define HAVE_ARCH_BUG
15#endif
16
17#include <asm-generic/bug.h>
18
19#endif
diff --git a/include/asm-arm26/bugs.h b/include/asm-arm26/bugs.h
deleted file mode 100644
index e99ac2e46d7f..000000000000
--- a/include/asm-arm26/bugs.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/*
2 * linux/include/asm-arm26/bugs.h
3 *
4 * Copyright (C) 1995 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 __ASM_BUGS_H
11#define __ASM_BUGS_H
12
13#define check_bugs() cpu_check_bugs()
14
15#endif
diff --git a/include/asm-arm26/byteorder.h b/include/asm-arm26/byteorder.h
deleted file mode 100644
index 0b4af9ac76e9..000000000000
--- a/include/asm-arm26/byteorder.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * linux/include/asm-arm/byteorder.h
3 *
4 * ARM Endian-ness. In little endian mode, the data bus is connected such
5 * that byte accesses appear as:
6 * 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
7 * and word accesses (data or instruction) appear as:
8 * d0...d31
9 *
10 */
11#ifndef __ASM_ARM_BYTEORDER_H
12#define __ASM_ARM_BYTEORDER_H
13
14#include <asm/types.h>
15
16#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
17# define __BYTEORDER_HAS_U64__
18# define __SWAB_64_THRU_32__
19#endif
20
21#include <linux/byteorder/little_endian.h>
22
23#endif
24
diff --git a/include/asm-arm26/cache.h b/include/asm-arm26/cache.h
deleted file mode 100644
index 8c3abcf728fe..000000000000
--- a/include/asm-arm26/cache.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 * linux/include/asm-arm26/cache.h
3 */
4#ifndef __ASMARM_CACHE_H
5#define __ASMARM_CACHE_H
6
7#define L1_CACHE_SHIFT 5
8#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
9#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
10#define SMP_CACHE_BYTES L1_CACHE_BYTES
11
12#endif
diff --git a/include/asm-arm26/cacheflush.h b/include/asm-arm26/cacheflush.h
deleted file mode 100644
index 14ae15b6faab..000000000000
--- a/include/asm-arm26/cacheflush.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * linux/include/asm-arm/cacheflush.h
3 *
4 * Copyright (C) 2000-2002 Russell King
5 * Copyright (C) 2003 Ian Molton
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * ARM26 cache 'functions'
12 *
13 */
14
15#ifndef _ASMARM_CACHEFLUSH_H
16#define _ASMARM_CACHEFLUSH_H
17
18#if 1 //FIXME - BAD INCLUDES!!!
19#include <linux/sched.h>
20#include <linux/mm.h>
21#endif
22
23#define flush_cache_all() do { } while (0)
24#define flush_cache_mm(mm) do { } while (0)
25#define flush_cache_dup_mm(mm) do { } while (0)
26#define flush_cache_range(vma,start,end) do { } while (0)
27#define flush_cache_page(vma,vmaddr,pfn) do { } while (0)
28#define flush_cache_vmap(start, end) do { } while (0)
29#define flush_cache_vunmap(start, end) do { } while (0)
30
31#define invalidate_dcache_range(start,end) do { } while (0)
32#define clean_dcache_range(start,end) do { } while (0)
33#define flush_dcache_range(start,end) do { } while (0)
34#define flush_dcache_page(page) do { } while (0)
35#define flush_dcache_mmap_lock(mapping) do { } while (0)
36#define flush_dcache_mmap_unlock(mapping) do { } while (0)
37#define clean_dcache_entry(_s) do { } while (0)
38#define clean_cache_entry(_start) do { } while (0)
39
40#define flush_icache_user_range(start,end, bob, fred) do { } while (0)
41#define flush_icache_range(start,end) do { } while (0)
42#define flush_icache_page(vma,page) do { } while (0)
43
44#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
45 memcpy(dst, src, len)
46#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
47 memcpy(dst, src, len)
48
49/* DAG: ARM3 will flush cache on MEMC updates anyway? so don't bother */
50/* IM : Yes, it will, but only if setup to do so (we do this). */
51#define clean_cache_area(_start,_size) do { } while (0)
52
53#endif
diff --git a/include/asm-arm26/checksum.h b/include/asm-arm26/checksum.h
deleted file mode 100644
index f2b4b0a403bd..000000000000
--- a/include/asm-arm26/checksum.h
+++ /dev/null
@@ -1,151 +0,0 @@
1/*
2 * linux/include/asm-arm/checksum.h
3 *
4 * IP checksum routines
5 *
6 * Copyright (C) Original authors of ../asm-i386/checksum.h
7 * Copyright (C) 1996-1999 Russell King
8 */
9#ifndef __ASM_ARM_CHECKSUM_H
10#define __ASM_ARM_CHECKSUM_H
11
12#include <linux/in6.h>
13
14/*
15 * computes the checksum of a memory block at buff, length len,
16 * and adds in "sum" (32-bit)
17 *
18 * returns a 32-bit number suitable for feeding into itself
19 * or csum_tcpudp_magic
20 *
21 * this function must be called with even lengths, except
22 * for the last fragment, which may be odd
23 *
24 * it's best to have buff aligned on a 32-bit boundary
25 */
26__wsum csum_partial(const void *buff, int len, __wsum sum);
27
28/*
29 * the same as csum_partial, but copies from src while it
30 * checksums, and handles user-space pointer exceptions correctly, when needed.
31 *
32 * here even more important to align src and dst on a 32-bit (or even
33 * better 64-bit) boundary
34 */
35
36__wsum
37csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
38
39__wsum
40csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr);
41
42/*
43 * This is a version of ip_compute_csum() optimized for IP headers,
44 * which always checksum on 4 octet boundaries.
45 */
46static inline __sum16
47ip_fast_csum(const void *iph, unsigned int ihl)
48{
49 unsigned int sum, tmp1;
50
51 __asm__ __volatile__(
52 "ldr %0, [%1], #4 @ ip_fast_csum \n\
53 ldr %3, [%1], #4 \n\
54 sub %2, %2, #5 \n\
55 adds %0, %0, %3 \n\
56 ldr %3, [%1], #4 \n\
57 adcs %0, %0, %3 \n\
58 ldr %3, [%1], #4 \n\
591: adcs %0, %0, %3 \n\
60 ldr %3, [%1], #4 \n\
61 tst %2, #15 @ do this carefully \n\
62 subne %2, %2, #1 @ without destroying \n\
63 bne 1b @ the carry flag \n\
64 adcs %0, %0, %3 \n\
65 adc %0, %0, #0 \n\
66 adds %0, %0, %0, lsl #16 \n\
67 addcs %0, %0, #0x10000 \n\
68 mvn %0, %0 \n\
69 mov %0, %0, lsr #16"
70 : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1)
71 : "1" (iph), "2" (ihl)
72 : "cc");
73 return (__force __sum16)sum;
74}
75
76/*
77 * Fold a partial checksum without adding pseudo headers
78 */
79static inline __sum16 csum_fold(__wsum sum)
80{
81 __asm__(
82 "adds %0, %1, %1, lsl #16 @ csum_fold \n\
83 addcs %0, %0, #0x10000"
84 : "=r" (sum)
85 : "r" (sum)
86 : "cc");
87 return (__force __sum16)(~(__force u32)sum >> 16);
88}
89
90static inline __wsum
91csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
92 unsigned short proto, __wsum sum)
93{
94 __asm__(
95 "adds %0, %1, %2 @ csum_tcpudp_nofold \n\
96 adcs %0, %0, %3 \n\
97 adcs %0, %0, %4 \n\
98 adcs %0, %0, %5 \n\
99 adc %0, %0, #0"
100 : "=&r"(sum)
101 : "r" (sum), "r" (daddr), "r" (saddr), "r" (htons(len)), "Ir" (htons(proto))
102 : "cc");
103 return sum;
104}
105/*
106 * computes the checksum of the TCP/UDP pseudo-header
107 * returns a 16-bit checksum, already complemented
108 */
109static inline __sum16
110csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
111 unsigned short proto, __wsum sum)
112{
113 __asm__(
114 "adds %0, %1, %2 @ csum_tcpudp_magic \n\
115 adcs %0, %0, %3 \n\
116 adcs %0, %0, %4 \n\
117 adcs %0, %0, %5 \n\
118 adc %0, %0, #0 \n\
119 adds %0, %0, %0, lsl #16 \n\
120 addcs %0, %0, #0x10000 \n\
121 mvn %0, %0"
122 : "=&r"(sum)
123 : "r" (sum), "r" (daddr), "r" (saddr), "r" (htons(len)), "Ir" (htons(proto))
124 : "cc");
125 return (__force __sum16)((__force u32)sum >> 16);
126}
127
128
129/*
130 * this routine is used for miscellaneous IP-like checksums, mainly
131 * in icmp.c
132 */
133static inline __sum16
134ip_compute_csum(const void *buff, int len)
135{
136 return csum_fold(csum_partial(buff, len, 0));
137}
138
139#define _HAVE_ARCH_IPV6_CSUM
140extern __wsum
141__csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __be32 len,
142 __be32 proto, __wsum sum);
143
144static inline __sum16
145csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __u32 len,
146 unsigned short proto, __wsum sum)
147{
148 return csum_fold(__csum_ipv6_magic(saddr, daddr, htonl(len),
149 htonl(proto), sum));
150}
151#endif
diff --git a/include/asm-arm26/constants.h b/include/asm-arm26/constants.h
deleted file mode 100644
index 0d0b14415563..000000000000
--- a/include/asm-arm26/constants.h
+++ /dev/null
@@ -1,28 +0,0 @@
1#ifndef __ASM_OFFSETS_H__
2#define __ASM_OFFSETS_H__
3/*
4 * DO NOT MODIFY.
5 *
6 * This file was generated by arch/arm26/Makefile
7 *
8 */
9
10#define TSK_ACTIVE_MM 96 /* offsetof(struct task_struct, active_mm) */
11
12#define VMA_VM_MM 0 /* offsetof(struct vm_area_struct, vm_mm) */
13#define VMA_VM_FLAGS 20 /* offsetof(struct vm_area_struct, vm_flags) */
14
15#define VM_EXEC 4 /* VM_EXEC */
16
17
18#define PAGE_PRESENT 1 /* L_PTE_PRESENT */
19#define PAGE_READONLY 95 /* PAGE_READONLY */
20#define PAGE_NOT_USER 3 /* PAGE_NONE */
21#define PAGE_OLD 3 /* PAGE_NONE */
22#define PAGE_CLEAN 128 /* L_PTE_DIRTY */
23
24#define PAGE_SZ 32768 /* PAGE_SIZE */
25
26#define SYS_ERROR0 10420224 /* 0x9f0000 */
27
28#endif
diff --git a/include/asm-arm26/cputime.h b/include/asm-arm26/cputime.h
deleted file mode 100644
index d2783a9e47b3..000000000000
--- a/include/asm-arm26/cputime.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ARM26_CPUTIME_H
2#define __ARM26_CPUTIME_H
3
4#include <asm-generic/cputime.h>
5
6#endif /* __ARM26_CPUTIME_H */
diff --git a/include/asm-arm26/current.h b/include/asm-arm26/current.h
deleted file mode 100644
index 75d21e2a3ff7..000000000000
--- a/include/asm-arm26/current.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef _ASMARM_CURRENT_H
2#define _ASMARM_CURRENT_H
3
4#include <linux/thread_info.h>
5
6static inline struct task_struct *get_current(void) __attribute_const__;
7
8static inline struct task_struct *get_current(void)
9{
10 return current_thread_info()->task;
11}
12
13#define current (get_current())
14
15#endif /* _ASMARM_CURRENT_H */
diff --git a/include/asm-arm26/delay.h b/include/asm-arm26/delay.h
deleted file mode 100644
index 40fbf7bbe6c2..000000000000
--- a/include/asm-arm26/delay.h
+++ /dev/null
@@ -1,34 +0,0 @@
1#ifndef __ASM_ARM_DELAY_H
2#define __ASM_ARM_DELAY_H
3
4/*
5 * Copyright (C) 1995 Russell King
6 *
7 * Delay routines, using a pre-computed "loops_per_second" value.
8 */
9
10extern void __delay(int loops);
11
12/*
13 * division by multiplication: you don't have to worry about
14 * loss of precision.
15 *
16 * Use only for very small delays ( < 1 msec). Should probably use a
17 * lookup table, really, as the multiplications take much too long with
18 * short delays. This is a "reasonable" implementation, though (and the
19 * first constant multiplications gets optimized away if the delay is
20 * a constant)
21 *
22 * FIXME - lets improve it then...
23 */
24extern void udelay(unsigned long usecs);
25
26static inline unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
27{
28 return a * b / c;
29}
30
31
32
33#endif /* defined(_ARM_DELAY_H) */
34
diff --git a/include/asm-arm26/device.h b/include/asm-arm26/device.h
deleted file mode 100644
index d8f9872b0e2d..000000000000
--- a/include/asm-arm26/device.h
+++ /dev/null
@@ -1,7 +0,0 @@
1/*
2 * Arch specific extensions to struct device
3 *
4 * This file is released under the GPLv2
5 */
6#include <asm-generic/device.h>
7
diff --git a/include/asm-arm26/div64.h b/include/asm-arm26/div64.h
deleted file mode 100644
index 6cd978cefb28..000000000000
--- a/include/asm-arm26/div64.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/div64.h>
diff --git a/include/asm-arm26/dma.h b/include/asm-arm26/dma.h
deleted file mode 100644
index 4326ba85eb72..000000000000
--- a/include/asm-arm26/dma.h
+++ /dev/null
@@ -1,183 +0,0 @@
1#ifndef __ASM_ARM_DMA_H
2#define __ASM_ARM_DMA_H
3
4typedef unsigned int dmach_t;
5
6#include <linux/spinlock.h>
7#include <asm/system.h>
8#include <asm/memory.h>
9#include <asm/scatterlist.h>
10
11// FIXME - do we really need this? arm26 cant do 'proper' DMA
12
13typedef struct dma_struct dma_t;
14typedef unsigned int dmamode_t;
15
16struct dma_ops {
17 int (*request)(dmach_t, dma_t *); /* optional */
18 void (*free)(dmach_t, dma_t *); /* optional */
19 void (*enable)(dmach_t, dma_t *); /* mandatory */
20 void (*disable)(dmach_t, dma_t *); /* mandatory */
21 int (*residue)(dmach_t, dma_t *); /* optional */
22 int (*setspeed)(dmach_t, dma_t *, int); /* optional */
23 char *type;
24};
25
26struct dma_struct {
27 struct scatterlist buf; /* single DMA */
28 int sgcount; /* number of DMA SG */
29 struct scatterlist *sg; /* DMA Scatter-Gather List */
30
31 unsigned int active:1; /* Transfer active */
32 unsigned int invalid:1; /* Address/Count changed */
33 unsigned int using_sg:1; /* using scatter list? */
34 dmamode_t dma_mode; /* DMA mode */
35 int speed; /* DMA speed */
36
37 unsigned int lock; /* Device is allocated */
38 const char *device_id; /* Device name */
39
40 unsigned int dma_base; /* Controller base address */
41 int dma_irq; /* Controller IRQ */
42 int state; /* Controller state */
43 struct scatterlist cur_sg; /* Current controller buffer */
44
45 struct dma_ops *d_ops;
46};
47
48/* Prototype: void arch_dma_init(dma)
49 * Purpose : Initialise architecture specific DMA
50 * Params : dma - pointer to array of DMA structures
51 */
52extern void arch_dma_init(dma_t *dma);
53
54extern void isa_init_dma(dma_t *dma);
55
56
57#define MAX_DMA_ADDRESS 0x03000000
58#define MAX_DMA_CHANNELS 3
59
60/* ARC */
61#define DMA_VIRTUAL_FLOPPY0 0
62#define DMA_VIRTUAL_FLOPPY1 1
63#define DMA_VIRTUAL_SOUND 2
64
65/* A5K */
66#define DMA_FLOPPY 0
67
68/*
69 * DMA modes
70 */
71#define DMA_MODE_MASK 3
72
73#define DMA_MODE_READ 0
74#define DMA_MODE_WRITE 1
75#define DMA_MODE_CASCADE 2
76#define DMA_AUTOINIT 4
77
78extern spinlock_t dma_spin_lock;
79
80static inline unsigned long claim_dma_lock(void)
81{
82 unsigned long flags;
83 spin_lock_irqsave(&dma_spin_lock, flags);
84 return flags;
85}
86
87static inline void release_dma_lock(unsigned long flags)
88{
89 spin_unlock_irqrestore(&dma_spin_lock, flags);
90}
91
92/* Clear the 'DMA Pointer Flip Flop'.
93 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
94 */
95#define clear_dma_ff(channel)
96
97/* Set only the page register bits of the transfer address.
98 *
99 * NOTE: This is an architecture specific function, and should
100 * be hidden from the drivers
101 */
102extern void set_dma_page(dmach_t channel, char pagenr);
103
104/* Request a DMA channel
105 *
106 * Some architectures may need to do allocate an interrupt
107 */
108extern int request_dma(dmach_t channel, const char * device_id);
109
110/* Free a DMA channel
111 *
112 * Some architectures may need to do free an interrupt
113 */
114extern void free_dma(dmach_t channel);
115
116/* Enable DMA for this channel
117 *
118 * On some architectures, this may have other side effects like
119 * enabling an interrupt and setting the DMA registers.
120 */
121extern void enable_dma(dmach_t channel);
122
123/* Disable DMA for this channel
124 *
125 * On some architectures, this may have other side effects like
126 * disabling an interrupt or whatever.
127 */
128extern void disable_dma(dmach_t channel);
129
130/* Test whether the specified channel has an active DMA transfer
131 */
132extern int dma_channel_active(dmach_t channel);
133
134/* Set the DMA scatter gather list for this channel
135 *
136 * This should not be called if a DMA channel is enabled,
137 * especially since some DMA architectures don't update the
138 * DMA address immediately, but defer it to the enable_dma().
139 */
140extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg);
141
142/* Set the DMA address for this channel
143 *
144 * This should not be called if a DMA channel is enabled,
145 * especially since some DMA architectures don't update the
146 * DMA address immediately, but defer it to the enable_dma().
147 */
148extern void set_dma_addr(dmach_t channel, unsigned long physaddr);
149
150/* Set the DMA byte count for this channel
151 *
152 * This should not be called if a DMA channel is enabled,
153 * especially since some DMA architectures don't update the
154 * DMA count immediately, but defer it to the enable_dma().
155 */
156extern void set_dma_count(dmach_t channel, unsigned long count);
157
158/* Set the transfer direction for this channel
159 *
160 * This should not be called if a DMA channel is enabled,
161 * especially since some DMA architectures don't update the
162 * DMA transfer direction immediately, but defer it to the
163 * enable_dma().
164 */
165extern void set_dma_mode(dmach_t channel, dmamode_t mode);
166
167/* Set the transfer speed for this channel
168 */
169extern void set_dma_speed(dmach_t channel, int cycle_ns);
170
171/* Get DMA residue count. After a DMA transfer, this
172 * should return zero. Reading this while a DMA transfer is
173 * still in progress will return unpredictable results.
174 * If called before the channel has been used, it may return 1.
175 * Otherwise, it returns the number of _bytes_ left to transfer.
176 */
177extern int get_dma_residue(dmach_t channel);
178
179#ifndef NO_DMA
180#define NO_DMA 255
181#endif
182
183#endif /* _ARM_DMA_H */
diff --git a/include/asm-arm26/ecard.h b/include/asm-arm26/ecard.h
deleted file mode 100644
index 66691939c3c1..000000000000
--- a/include/asm-arm26/ecard.h
+++ /dev/null
@@ -1,294 +0,0 @@
1/*
2 * linux/include/asm-arm26/ecard.h
3 *
4 * definitions for expansion cards
5 *
6 * This is a new system as from Linux 1.2.3
7 *
8 * Changelog:
9 * 11-12-1996 RMK Further minor improvements
10 * 12-09-1997 RMK Added interrupt enable/disable for card level
11 * 18-05-2003 IM Adjusted for ARM26
12 *
13 * Reference: Acorns Risc OS 3 Programmers Reference Manuals.
14 */
15
16#ifndef __ASM_ECARD_H
17#define __ASM_ECARD_H
18
19/*
20 * Currently understood cards (but not necessarily
21 * supported):
22 * Manufacturer Product ID
23 */
24#define MANU_ACORN 0x0000
25#define PROD_ACORN_SCSI 0x0002
26#define PROD_ACORN_ETHER1 0x0003
27#define PROD_ACORN_MFM 0x000b
28
29#define MANU_CCONCEPTS 0x0009
30#define PROD_CCONCEPTS_COLOURCARD 0x0050
31
32#define MANU_ANT2 0x0011
33#define PROD_ANT_ETHER3 0x00a4
34
35#define MANU_ATOMWIDE 0x0017
36#define PROD_ATOMWIDE_3PSERIAL 0x0090
37
38#define MANU_IRLAM_INSTRUMENTS 0x001f
39#define MANU_IRLAM_INSTRUMENTS_ETHERN 0x5678
40
41#define MANU_OAK 0x0021
42#define PROD_OAK_SCSI 0x0058
43
44#define MANU_MORLEY 0x002b
45#define PROD_MORLEY_SCSI_UNCACHED 0x0067
46
47#define MANU_CUMANA 0x003a
48#define PROD_CUMANA_SCSI_2 0x003a
49#define PROD_CUMANA_SCSI_1 0x00a0
50
51#define MANU_ICS 0x003c
52#define PROD_ICS_IDE 0x00ae
53
54#define MANU_ICS2 0x003d
55#define PROD_ICS2_IDE 0x00ae
56
57#define MANU_SERPORT 0x003f
58#define PROD_SERPORT_DSPORT 0x00b9
59
60#define MANU_ARXE 0x0041
61#define PROD_ARXE_SCSI 0x00be
62
63#define MANU_I3 0x0046
64#define PROD_I3_ETHERLAN500 0x00d4
65#define PROD_I3_ETHERLAN600 0x00ec
66#define PROD_I3_ETHERLAN600A 0x011e
67
68#define MANU_ANT 0x0053
69#define PROD_ANT_ETHERM 0x00d8
70#define PROD_ANT_ETHERB 0x00e4
71
72#define MANU_ALSYSTEMS 0x005b
73#define PROD_ALSYS_SCSIATAPI 0x0107
74
75#define MANU_MCS 0x0063
76#define PROD_MCS_CONNECT32 0x0125
77
78#define MANU_EESOX 0x0064
79#define PROD_EESOX_SCSI2 0x008c
80
81#define MANU_YELLOWSTONE 0x0096
82#define PROD_YELLOWSTONE_RAPIDE32 0x0120
83
84#define MANU_SIMTEC 0x005f
85#define PROD_SIMTEC_IDE8 0x0130
86#define PROD_SIMTEC_IDE16 0x0131
87
88
89#ifdef ECARD_C
90#define CONST
91#else
92#define CONST const
93#endif
94
95#define MAX_ECARDS 4
96
97typedef enum { /* Cards address space */
98 ECARD_IOC,
99 ECARD_MEMC,
100 ECARD_EASI
101} card_type_t;
102
103typedef enum { /* Speed for ECARD_IOC space */
104 ECARD_SLOW = 0,
105 ECARD_MEDIUM = 1,
106 ECARD_FAST = 2,
107 ECARD_SYNC = 3
108} card_speed_t;
109
110struct ecard_id { /* Card ID structure */
111 unsigned short manufacturer;
112 unsigned short product;
113 void *data;
114};
115
116struct in_ecid { /* Packed card ID information */
117 unsigned short product; /* Product code */
118 unsigned short manufacturer; /* Manufacturer code */
119 unsigned char id:4; /* Simple ID */
120 unsigned char cd:1; /* Chunk dir present */
121 unsigned char is:1; /* Interrupt status pointers */
122 unsigned char w:2; /* Width */
123 unsigned char country; /* Country */
124 unsigned char irqmask; /* IRQ mask */
125 unsigned char fiqmask; /* FIQ mask */
126 unsigned long irqoff; /* IRQ offset */
127 unsigned long fiqoff; /* FIQ offset */
128};
129
130typedef struct expansion_card ecard_t;
131typedef unsigned long *loader_t;
132
133typedef struct { /* Card handler routines */
134 void (*irqenable)(ecard_t *ec, int irqnr);
135 void (*irqdisable)(ecard_t *ec, int irqnr);
136 int (*irqpending)(ecard_t *ec);
137 void (*fiqenable)(ecard_t *ec, int fiqnr);
138 void (*fiqdisable)(ecard_t *ec, int fiqnr);
139 int (*fiqpending)(ecard_t *ec);
140} expansioncard_ops_t;
141
142#define ECARD_NUM_RESOURCES (6)
143
144#define ECARD_RES_IOCSLOW (0)
145#define ECARD_RES_IOCMEDIUM (1)
146#define ECARD_RES_IOCFAST (2)
147#define ECARD_RES_IOCSYNC (3)
148#define ECARD_RES_MEMC (4)
149#define ECARD_RES_EASI (5)
150
151#define ecard_resource_start(ec,nr) ((ec)->resource[nr].start)
152#define ecard_resource_end(ec,nr) ((ec)->resource[nr].end)
153#define ecard_resource_len(ec,nr) ((ec)->resource[nr].end - \
154 (ec)->resource[nr].start + 1)
155
156/*
157 * This contains all the info needed on an expansion card
158 */
159struct expansion_card {
160 struct expansion_card *next;
161
162 struct device dev;
163 struct resource resource[ECARD_NUM_RESOURCES];
164
165 /* Public data */
166 volatile unsigned char *irqaddr; /* address of IRQ register */
167 volatile unsigned char *fiqaddr; /* address of FIQ register */
168 unsigned char irqmask; /* IRQ mask */
169 unsigned char fiqmask; /* FIQ mask */
170 unsigned char claimed; /* Card claimed? */
171
172 void *irq_data; /* Data for use for IRQ by card */
173 void *fiq_data; /* Data for use for FIQ by card */
174 const expansioncard_ops_t *ops; /* Enable/Disable Ops for card */
175
176 CONST unsigned int slot_no; /* Slot number */
177 CONST unsigned int dma; /* DMA number (for request_dma) */
178 CONST unsigned int irq; /* IRQ number (for request_irq) */
179 CONST unsigned int fiq; /* FIQ number (for request_irq) */
180 CONST card_type_t type; /* Type of card */
181 CONST struct in_ecid cid; /* Card Identification */
182
183 /* Private internal data */
184 const char *card_desc; /* Card description */
185 CONST unsigned int podaddr; /* Base Linux address for card */
186 CONST loader_t loader; /* loader program */
187 u64 dma_mask;
188};
189
190struct in_chunk_dir {
191 unsigned int start_offset;
192 union {
193 unsigned char string[256];
194 unsigned char data[1];
195 } d;
196};
197
198/*
199 * ecard_claim: claim an expansion card entry
200 * FIXME - are these atomic / called with interrupts off ?
201 */
202#define ecard_claim(ec) ((ec)->claimed = 1)
203
204/*
205 * ecard_release: release an expansion card entry
206 */
207#define ecard_release(ec) ((ec)->claimed = 0)
208
209/*
210 * Read a chunk from an expansion card
211 * cd : where to put read data
212 * ec : expansion card info struct
213 * id : id number to find
214 * num: (n+1)'th id to find.
215 */
216extern int ecard_readchunk (struct in_chunk_dir *cd, struct expansion_card *ec, int id, int num);
217
218/*
219 * Obtain the address of a card
220 */
221extern unsigned int ecard_address (struct expansion_card *ec, card_type_t card_type, card_speed_t speed);
222
223#ifdef ECARD_C
224/* Definitions internal to ecard.c - for it's use only!!
225 *
226 * External expansion card header as read from the card
227 */
228struct ex_ecid {
229 unsigned char r_irq:1;
230 unsigned char r_zero:1;
231 unsigned char r_fiq:1;
232 unsigned char r_id:4;
233 unsigned char r_a:1;
234
235 unsigned char r_cd:1;
236 unsigned char r_is:1;
237 unsigned char r_w:2;
238 unsigned char r_r1:4;
239
240 unsigned char r_r2:8;
241
242 unsigned char r_prod[2];
243
244 unsigned char r_manu[2];
245
246 unsigned char r_country;
247
248 unsigned char r_irqmask;
249 unsigned char r_irqoff[3];
250
251 unsigned char r_fiqmask;
252 unsigned char r_fiqoff[3];
253};
254
255/*
256 * Chunk directory entry as read from the card
257 */
258struct ex_chunk_dir {
259 unsigned char r_id;
260 unsigned char r_len[3];
261 unsigned long r_start;
262 union {
263 char string[256];
264 char data[1];
265 } d;
266#define c_id(x) ((x)->r_id)
267#define c_len(x) ((x)->r_len[0]|((x)->r_len[1]<<8)|((x)->r_len[2]<<16))
268#define c_start(x) ((x)->r_start)
269};
270
271#endif
272
273extern struct bus_type ecard_bus_type;
274
275#define ECARD_DEV(_d) container_of((_d), struct expansion_card, dev)
276
277struct ecard_driver {
278 int (*probe)(struct expansion_card *, const struct ecard_id *id);
279 void (*remove)(struct expansion_card *);
280 void (*shutdown)(struct expansion_card *);
281 const struct ecard_id *id_table;
282 unsigned int id;
283 struct device_driver drv;
284};
285
286#define ECARD_DRV(_d) container_of((_d), struct ecard_driver, drv)
287
288#define ecard_set_drvdata(ec,data) dev_set_drvdata(&(ec)->dev, (data))
289#define ecard_get_drvdata(ec) dev_get_drvdata(&(ec)->dev)
290
291int ecard_register_driver(struct ecard_driver *);
292void ecard_remove_driver(struct ecard_driver *);
293
294#endif
diff --git a/include/asm-arm26/elf.h b/include/asm-arm26/elf.h
deleted file mode 100644
index 5a47fdb3015d..000000000000
--- a/include/asm-arm26/elf.h
+++ /dev/null
@@ -1,77 +0,0 @@
1#ifndef __ASMARM_ELF_H
2#define __ASMARM_ELF_H
3
4/*
5 * ELF register definitions..
6 */
7
8#include <asm/ptrace.h>
9#include <asm/procinfo.h>
10
11//FIXME - is it always 32K ?
12
13#define ELF_EXEC_PAGESIZE 32768
14#define SET_PERSONALITY(ex,ibcs2) set_personality(PER_LINUX)
15
16typedef unsigned long elf_greg_t;
17typedef unsigned long elf_freg_t[3];
18
19#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
20typedef elf_greg_t elf_gregset_t[ELF_NGREG];
21
22typedef struct { void *null; } elf_fpregset_t;
23
24/*
25 * This is used to ensure we don't load something for the wrong architecture.
26 * We can only execute 26-bit code.
27 */
28
29#define EM_ARM 40
30#define EF_ARM_APCS26 0x08
31
32//#define elf_check_arch(x) ( ((x)->e_machine == EM_ARM) && ((x)->e_flags & EF_ARM_APCS26) ) FIXME!!!!! - this looks OK, but the flags seem to be wrong.
33#define elf_check_arch(x) (1)
34
35/*
36 * These are used to set parameters in the core dumps.
37 */
38#define ELF_CLASS ELFCLASS32
39#define ELF_DATA ELFDATA2LSB
40#define ELF_ARCH EM_ARM
41
42#define USE_ELF_CORE_DUMP
43
44/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
45 use of this is to invoke "./ld.so someprog" to test out a new version of
46 the loader. We need to make sure that it is out of the way of the program
47 that it will "exec", and that there is sufficient room for the brk. */
48
49#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
50
51/* When the program starts, a1 contains a pointer to a function to be
52 registered with atexit, as per the SVR4 ABI. A value of 0 means we
53 have no such handler. */
54#define ELF_PLAT_INIT(_r, load_addr) (_r)->ARM_r0 = 0
55
56/* This yields a mask that user programs can use to figure out what
57 instruction set this cpu supports. */
58
59extern unsigned int elf_hwcap;
60#define ELF_HWCAP (elf_hwcap)
61
62/* This yields a string that ld.so will use to load implementation
63 specific libraries for optimization. This is more specific in
64 intent than poking at uname or /proc/cpuinfo. */
65
66/* For now we just provide a fairly general string that describes the
67 processor family. This could be made more specific later if someone
68 implemented optimisations that require it. 26-bit CPUs give you
69 "v1l" for ARM2 (no SWP) and "v2l" for anything else (ARM1 isn't
70 supported).
71 */
72
73#define ELF_PLATFORM_SIZE 8
74extern char elf_platform[];
75#define ELF_PLATFORM (elf_platform)
76
77#endif
diff --git a/include/asm-arm26/emergency-restart.h b/include/asm-arm26/emergency-restart.h
deleted file mode 100644
index 108d8c48e42e..000000000000
--- a/include/asm-arm26/emergency-restart.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-arm26/errno.h b/include/asm-arm26/errno.h
deleted file mode 100644
index 6e60f0612bb6..000000000000
--- a/include/asm-arm26/errno.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _ARM_ERRNO_H
2#define _ARM_ERRNO_H
3
4#include <asm-generic/errno.h>
5
6#endif
diff --git a/include/asm-arm26/fb.h b/include/asm-arm26/fb.h
deleted file mode 100644
index c7df38030992..000000000000
--- a/include/asm-arm26/fb.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/include/asm-arm26/fcntl.h b/include/asm-arm26/fcntl.h
deleted file mode 100644
index d85995e7459e..000000000000
--- a/include/asm-arm26/fcntl.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef _ARM_FCNTL_H
2#define _ARM_FCNTL_H
3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_DIRECTORY 040000 /* must be a directory */
7#define O_NOFOLLOW 0100000 /* don't follow links */
8#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
9#define O_LARGEFILE 0400000
10
11#include <asm-generic/fcntl.h>
12
13#endif
diff --git a/include/asm-arm26/fiq.h b/include/asm-arm26/fiq.h
deleted file mode 100644
index a3bad09e825c..000000000000
--- a/include/asm-arm26/fiq.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * linux/include/asm-arm/fiq.h
3 *
4 * Support for FIQ on ARM architectures.
5 * Written by Philip Blundell <philb@gnu.org>, 1998
6 * Re-written by Russell King
7 */
8
9#ifndef __ASM_FIQ_H
10#define __ASM_FIQ_H
11
12#include <asm/ptrace.h>
13
14struct fiq_handler {
15 struct fiq_handler *next;
16 /* Name
17 */
18 const char *name;
19 /* Called to ask driver to relinquish/
20 * reacquire FIQ
21 * return zero to accept, or -<errno>
22 */
23 int (*fiq_op)(void *, int relinquish);
24 /* data for the relinquish/reacquire functions
25 */
26 void *dev_id;
27};
28
29extern int claim_fiq(struct fiq_handler *f);
30extern void release_fiq(struct fiq_handler *f);
31extern void set_fiq_handler(void *start, unsigned int length);
32extern void set_fiq_regs(struct pt_regs *regs);
33extern void get_fiq_regs(struct pt_regs *regs);
34extern void enable_fiq(int fiq);
35extern void disable_fiq(int fiq);
36
37#endif
diff --git a/include/asm-arm26/floppy.h b/include/asm-arm26/floppy.h
deleted file mode 100644
index efb732165a4f..000000000000
--- a/include/asm-arm26/floppy.h
+++ /dev/null
@@ -1,141 +0,0 @@
1/*
2 * linux/include/asm-arm/floppy.h
3 *
4 * Copyright (C) 1996-2000 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 * Note that we don't touch FLOPPY_DMA nor FLOPPY_IRQ here
11 */
12#ifndef __ASM_ARM_FLOPPY_H
13#define __ASM_ARM_FLOPPY_H
14
15#define fd_outb(val,port) \
16 do { \
17 if ((port) == FD_DOR) \
18 fd_setdor((val)); \
19 else \
20 outb((val),(port)); \
21 } while(0)
22
23#define fd_inb(port) inb((port))
24#define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
25 IRQF_DISABLED,"floppy",NULL)
26#define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL)
27#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK)
28#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK)
29
30#define fd_request_dma() request_dma(DMA_FLOPPY,"floppy")
31#define fd_free_dma() free_dma(DMA_FLOPPY)
32#define fd_disable_dma() disable_dma(DMA_FLOPPY)
33#define fd_enable_dma() enable_dma(DMA_FLOPPY)
34#define fd_clear_dma_ff() clear_dma_ff(DMA_FLOPPY)
35#define fd_set_dma_mode(mode) set_dma_mode(DMA_FLOPPY, (mode))
36#define fd_set_dma_addr(addr) set_dma_addr(DMA_FLOPPY, virt_to_bus((addr)))
37#define fd_set_dma_count(len) set_dma_count(DMA_FLOPPY, (len))
38#define fd_cacheflush(addr,sz)
39
40/* need to clean up dma.h */
41#define DMA_FLOPPYDISK DMA_FLOPPY
42
43/* Floppy_selects is the list of DOR's to select drive fd
44 *
45 * On initialisation, the floppy list is scanned, and the drives allocated
46 * in the order that they are found. This is done by seeking the drive
47 * to a non-zero track, and then restoring it to track 0. If an error occurs,
48 * then there is no floppy drive present. [to be put back in again]
49 */
50static unsigned char floppy_selects[2][4] =
51{
52 { 0x10, 0x21, 0x23, 0x33 },
53 { 0x10, 0x21, 0x23, 0x33 }
54};
55
56#define fd_setdor(dor) \
57do { \
58 int new_dor = (dor); \
59 if (new_dor & 0xf0) \
60 new_dor = (new_dor & 0x0c) | floppy_selects[fdc][new_dor & 3]; \
61 else \
62 new_dor &= 0x0c; \
63 outb(new_dor, FD_DOR); \
64} while (0)
65
66/*
67 * Someday, we'll automatically detect which drives are present...
68 */
69static inline void fd_scandrives (void)
70{
71#if 0
72 int floppy, drive_count;
73
74 fd_disable_irq();
75 raw_cmd = &default_raw_cmd;
76 raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_SEEK;
77 raw_cmd->track = 0;
78 raw_cmd->rate = ?;
79 drive_count = 0;
80 for (floppy = 0; floppy < 4; floppy ++) {
81 current_drive = drive_count;
82 /*
83 * Turn on floppy motor
84 */
85 if (start_motor(redo_fd_request))
86 continue;
87 /*
88 * Set up FDC
89 */
90 fdc_specify();
91 /*
92 * Tell FDC to recalibrate
93 */
94 output_byte(FD_RECALIBRATE);
95 LAST_OUT(UNIT(floppy));
96 /* wait for command to complete */
97 if (!successful) {
98 int i;
99 for (i = drive_count; i < 3; i--)
100 floppy_selects[fdc][i] = floppy_selects[fdc][i + 1];
101 floppy_selects[fdc][3] = 0;
102 floppy -= 1;
103 } else
104 drive_count++;
105 }
106#else
107 floppy_selects[0][0] = 0x10;
108 floppy_selects[0][1] = 0x21;
109 floppy_selects[0][2] = 0x23;
110 floppy_selects[0][3] = 0x33;
111#endif
112}
113
114#define FDC1 (0x3f0)
115
116#define FLOPPY0_TYPE 4
117#define FLOPPY1_TYPE 4
118
119#define N_FDC 1
120#define N_DRIVE 4
121
122#define FLOPPY_MOTOR_MASK 0xf0
123
124#define CROSS_64KB(a,s) (0)
125
126/*
127 * This allows people to reverse the order of
128 * fd0 and fd1, in case their hardware is
129 * strangely connected (as some RiscPCs
130 * and A5000s seem to be).
131 */
132static void driveswap(int *ints, int dummy, int dummy2)
133{
134 floppy_selects[0][0] ^= floppy_selects[0][1];
135 floppy_selects[0][1] ^= floppy_selects[0][0];
136 floppy_selects[0][0] ^= floppy_selects[0][1];
137}
138
139#define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 }
140
141#endif
diff --git a/include/asm-arm26/fpstate.h b/include/asm-arm26/fpstate.h
deleted file mode 100644
index 785749b3c5ab..000000000000
--- a/include/asm-arm26/fpstate.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * linux/include/asm-arm/fpstate.h
3 *
4 * Copyright (C) 1995 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
11#ifndef __ASM_ARM_FPSTATE_H
12#define __ASM_ARM_FPSTATE_H
13
14#define FP_SIZE 35
15
16struct fp_hard_struct {
17 unsigned int save[FP_SIZE]; /* as yet undefined */
18};
19
20struct fp_soft_struct {
21 unsigned int save[FP_SIZE]; /* undefined information */
22};
23
24union fp_state {
25 struct fp_hard_struct hard;
26 struct fp_soft_struct soft;
27};
28
29#endif
diff --git a/include/asm-arm26/futex.h b/include/asm-arm26/futex.h
deleted file mode 100644
index 6a332a9f099c..000000000000
--- a/include/asm-arm26/futex.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#include <asm-generic/futex.h>
5
6#endif
diff --git a/include/asm-arm26/hardirq.h b/include/asm-arm26/hardirq.h
deleted file mode 100644
index e717742ffce0..000000000000
--- a/include/asm-arm26/hardirq.h
+++ /dev/null
@@ -1,32 +0,0 @@
1#ifndef __ASM_HARDIRQ_H
2#define __ASM_HARDIRQ_H
3
4#include <linux/cache.h>
5#include <linux/threads.h>
6#include <asm/irq.h>
7
8typedef struct {
9 unsigned int __softirq_pending;
10} ____cacheline_aligned irq_cpustat_t;
11
12#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
13
14#define HARDIRQ_BITS 8
15
16/*
17 * The hardirq mask has to be large enough to have space
18 * for potentially all IRQ sources in the system nesting
19 * on a single CPU:
20 */
21#if (1 << HARDIRQ_BITS) < NR_IRQS
22# error HARDIRQ_BITS is too low!
23#endif
24
25#ifndef CONFIG_SMP
26
27extern asmlinkage void __do_softirq(void);
28
29#endif
30
31
32#endif /* __ASM_HARDIRQ_H */
diff --git a/include/asm-arm26/hardware.h b/include/asm-arm26/hardware.h
deleted file mode 100644
index 801df0bde8b7..000000000000
--- a/include/asm-arm26/hardware.h
+++ /dev/null
@@ -1,109 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-arc/hardware.h
3 *
4 * Copyright (C) 1996-1999 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 * This file contains the hardware definitions of the
11 * Acorn Archimedes/A5000 machines.
12 *
13 * Modifications:
14 * 04-04-1998 PJB/RMK Merged arc and a5k versions
15 */
16#ifndef __ASM_HARDWARE_H
17#define __ASM_HARDWARE_H
18
19
20
21/*
22 * What hardware must be present - these can be tested by the kernel
23 * source.
24 */
25#define HAS_IOC
26#define HAS_MEMC
27#define HAS_VIDC
28
29#define VDMA_ALIGNMENT PAGE_SIZE
30#define VDMA_XFERSIZE 16
31#define VDMA_INIT 0
32#define VDMA_START 1
33#define VDMA_END 2
34
35#ifndef __ASSEMBLY__
36extern void memc_write(unsigned int reg, unsigned long val);
37
38#define video_set_dma(start,end,offset) \
39do { \
40 memc_write (VDMA_START, (start >> 2)); \
41 memc_write (VDMA_END, (end - VDMA_XFERSIZE) >> 2); \
42 memc_write (VDMA_INIT, (offset >> 2)); \
43} while (0)
44#endif
45
46
47/* Hardware addresses of major areas.
48 * *_START is the physical address
49 * *_SIZE is the size of the region
50 * *_BASE is the virtual address
51 */
52#define IO_START 0x03000000
53#define IO_SIZE 0x01000000
54#define IO_BASE 0x03000000
55
56/*
57 * Screen mapping information
58 */
59#define SCREEN_START 0x02000000
60#define SCREEN_END 0x02078000
61#define SCREEN_SIZE 0x00078000
62#define SCREEN_BASE 0x02000000
63
64
65#define EXPMASK_BASE 0x03360000
66#define IOEB_BASE 0x03350000
67#define VIDC_BASE 0x03400000
68#define LATCHA_BASE 0x03250040
69#define LATCHB_BASE 0x03250018
70#define IOC_BASE 0x03200000
71#define FLOPPYDMA_BASE 0x0302a000
72#define PCIO_BASE 0x03010000
73
74// FIXME - are the below correct?
75#define PODSLOT_IOC0_BASE 0x03240000
76#define PODSLOT_IOC_SIZE (1 << 14)
77#define PODSLOT_MEMC_BASE 0x03000000
78#define PODSLOT_MEMC_SIZE (1 << 14)
79
80#define vidc_writel(val) __raw_writel(val, VIDC_BASE)
81
82#ifndef __ASSEMBLY__
83
84/*
85 * for use with inb/outb
86 */
87#define IOEB_VID_CTL (IOEB_BASE + 0x48)
88#define IOEB_PRESENT (IOEB_BASE + 0x50)
89#define IOEB_PSCLR (IOEB_BASE + 0x58)
90#define IOEB_MONTYPE (IOEB_BASE + 0x70)
91
92//FIXME - These adresses are weird - ISTR some weirdo address shifting stuff was going on here...
93#define IO_EC_IOC_BASE 0x80090000
94#define IO_EC_MEMC_BASE 0x80000000
95
96#ifdef CONFIG_ARCH_ARC
97/* A680 hardware */
98#define WD1973_BASE 0x03290000
99#define WD1973_LATCH 0x03350000
100#define Z8530_BASE 0x032b0008
101#define SCSI_BASE 0x03100000
102#endif
103
104#endif
105
106#define EXPMASK_STATUS (EXPMASK_BASE + 0x00)
107#define EXPMASK_ENABLE (EXPMASK_BASE + 0x04)
108
109#endif
diff --git a/include/asm-arm26/ide.h b/include/asm-arm26/ide.h
deleted file mode 100644
index db804d751df9..000000000000
--- a/include/asm-arm26/ide.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * linux/include/asm-arm/ide.h
3 *
4 * Copyright (C) 1994-1996 Linus Torvalds & authors
5 */
6
7/*
8 * This file contains the i386 architecture specific IDE code.
9 */
10
11#ifndef __ASMARM_IDE_H
12#define __ASMARM_IDE_H
13
14#ifdef __KERNEL__
15
16#ifndef MAX_HWIFS
17#define MAX_HWIFS 4
18#endif
19
20#include <asm/irq.h>
21#include <asm/mach-types.h>
22
23/* JMA 18.05.03 these will never be needed, but the kernel needs them to compile */
24#define __ide_mm_insw(port,addr,len) readsw(port,addr,len)
25#define __ide_mm_insl(port,addr,len) readsl(port,addr,len)
26#define __ide_mm_outsw(port,addr,len) writesw(port,addr,len)
27#define __ide_mm_outsl(port,addr,len) writesl(port,addr,len)
28
29#define IDE_ARCH_OBSOLETE_INIT
30#define ide_default_io_ctl(base) (0)
31
32#endif /* __KERNEL__ */
33
34#endif /* __ASMARM_IDE_H */
diff --git a/include/asm-arm26/io.h b/include/asm-arm26/io.h
deleted file mode 100644
index a5a7a4d5e09c..000000000000
--- a/include/asm-arm26/io.h
+++ /dev/null
@@ -1,434 +0,0 @@
1/*
2 * linux/include/asm-arm/io.h
3 *
4 * Copyright (C) 1996-2000 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 * Modifications:
11 * 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both
12 * constant addresses and variable addresses.
13 * 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture
14 * specific IO header files.
15 * 27-Mar-1999 PJB Second parameter of memcpy_toio is const..
16 * 04-Apr-1999 PJB Added check_signature.
17 * 12-Dec-1999 RMK More cleanups
18 * 18-Jun-2000 RMK Removed virt_to_* and friends definitions
19 */
20#ifndef __ASM_ARM_IO_H
21#define __ASM_ARM_IO_H
22
23#ifdef __KERNEL__
24
25#include <linux/types.h>
26#include <asm/byteorder.h>
27#include <asm/memory.h>
28#include <asm/hardware.h>
29
30/*
31 * Generic IO read/write. These perform native-endian accesses. Note
32 * that some architectures will want to re-define __raw_{read,write}w.
33 */
34extern void __raw_writesb(unsigned int addr, const void *data, int bytelen);
35extern void __raw_writesw(unsigned int addr, const void *data, int wordlen);
36extern void __raw_writesl(unsigned int addr, const void *data, int longlen);
37
38extern void __raw_readsb(unsigned int addr, void *data, int bytelen);
39extern void __raw_readsw(unsigned int addr, void *data, int wordlen);
40extern void __raw_readsl(unsigned int addr, void *data, int longlen);
41
42#define __raw_writeb(v,a) (*(volatile unsigned char *)(a) = (v))
43#define __raw_writew(v,a) (*(volatile unsigned short *)(a) = (v))
44#define __raw_writel(v,a) (*(volatile unsigned int *)(a) = (v))
45
46#define __raw_readb(a) (*(volatile unsigned char *)(a))
47#define __raw_readw(a) (*(volatile unsigned short *)(a))
48#define __raw_readl(a) (*(volatile unsigned int *)(a))
49
50
51/*
52 * Bad read/write accesses...
53 */
54extern void __readwrite_bug(const char *fn);
55
56/*
57 * Now, pick up the machine-defined IO definitions
58 */
59
60#define IO_SPACE_LIMIT 0xffffffff
61
62/*
63 * GCC is totally crap at loading/storing data. We try to persuade it
64 * to do the right thing by using these whereever possible instead of
65 * the above.
66 */
67#define __arch_base_getb(b,o) \
68 ({ \
69 unsigned int v, r = (b); \
70 __asm__ __volatile__( \
71 "ldrb %0, [%1, %2]" \
72 : "=r" (v) \
73 : "r" (r), "Ir" (o)); \
74 v; \
75 })
76
77#define __arch_base_getl(b,o) \
78 ({ \
79 unsigned int v, r = (b); \
80 __asm__ __volatile__( \
81 "ldr %0, [%1, %2]" \
82 : "=r" (v) \
83 : "r" (r), "Ir" (o)); \
84 v; \
85 })
86
87#define __arch_base_putb(v,b,o) \
88 ({ \
89 unsigned int r = (b); \
90 __asm__ __volatile__( \
91 "strb %0, [%1, %2]" \
92 : \
93 : "r" (v), "r" (r), "Ir" (o)); \
94 })
95
96#define __arch_base_putl(v,b,o) \
97 ({ \
98 unsigned int r = (b); \
99 __asm__ __volatile__( \
100 "str %0, [%1, %2]" \
101 : \
102 : "r" (v), "r" (r), "Ir" (o)); \
103 })
104
105/*
106 * We use two different types of addressing - PC style addresses, and ARM
107 * addresses. PC style accesses the PC hardware with the normal PC IO
108 * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
109 * and are translated to the start of IO. Note that all addresses are
110 * shifted left!
111 */
112#define __PORT_PCIO(x) (!((x) & 0x80000000))
113
114/*
115 * Dynamic IO functions - let the compiler
116 * optimize the expressions
117 */
118static inline void __outb (unsigned int value, unsigned int port)
119{
120 unsigned long temp;
121 __asm__ __volatile__(
122 "tst %2, #0x80000000\n\t"
123 "mov %0, %4\n\t"
124 "addeq %0, %0, %3\n\t"
125 "strb %1, [%0, %2, lsl #2] @ outb"
126 : "=&r" (temp)
127 : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
128 : "cc");
129}
130
131static inline void __outw (unsigned int value, unsigned int port)
132{
133 unsigned long temp;
134 __asm__ __volatile__(
135 "tst %2, #0x80000000\n\t"
136 "mov %0, %4\n\t"
137 "addeq %0, %0, %3\n\t"
138 "str %1, [%0, %2, lsl #2] @ outw"
139 : "=&r" (temp)
140 : "r" (value|value<<16), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
141 : "cc");
142}
143
144static inline void __outl (unsigned int value, unsigned int port)
145{
146 unsigned long temp;
147 __asm__ __volatile__(
148 "tst %2, #0x80000000\n\t"
149 "mov %0, %4\n\t"
150 "addeq %0, %0, %3\n\t"
151 "str %1, [%0, %2, lsl #2] @ outl"
152 : "=&r" (temp)
153 : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
154 : "cc");
155}
156
157#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
158static inline unsigned sz __in##fnsuffix (unsigned int port) \
159{ \
160 unsigned long temp, value; \
161 __asm__ __volatile__( \
162 "tst %2, #0x80000000\n\t" \
163 "mov %0, %4\n\t" \
164 "addeq %0, %0, %3\n\t" \
165 "ldr" instr " %1, [%0, %2, lsl #2] @ in" #fnsuffix \
166 : "=&r" (temp), "=r" (value) \
167 : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
168 : "cc"); \
169 return (unsigned sz)value; \
170}
171
172static inline unsigned int __ioaddr (unsigned int port) \
173{ \
174 if (__PORT_PCIO(port)) \
175 return (unsigned int)(PCIO_BASE + (port << 2)); \
176 else \
177 return (unsigned int)(IO_BASE + (port << 2)); \
178}
179
180#define DECLARE_IO(sz,fnsuffix,instr) \
181 DECLARE_DYN_IN(sz,fnsuffix,instr)
182
183DECLARE_IO(char,b,"b")
184DECLARE_IO(short,w,"")
185DECLARE_IO(int,l,"")
186
187#undef DECLARE_IO
188#undef DECLARE_DYN_IN
189
190/*
191 * Constant address IO functions
192 *
193 * These have to be macros for the 'J' constraint to work -
194 * +/-4096 immediate operand.
195 */
196#define __outbc(value,port) \
197({ \
198 if (__PORT_PCIO((port))) \
199 __asm__ __volatile__( \
200 "strb %0, [%1, %2] @ outbc" \
201 : : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
202 else \
203 __asm__ __volatile__( \
204 "strb %0, [%1, %2] @ outbc" \
205 : : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
206})
207
208#define __inbc(port) \
209({ \
210 unsigned char result; \
211 if (__PORT_PCIO((port))) \
212 __asm__ __volatile__( \
213 "ldrb %0, [%1, %2] @ inbc" \
214 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
215 else \
216 __asm__ __volatile__( \
217 "ldrb %0, [%1, %2] @ inbc" \
218 : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
219 result; \
220})
221
222#define __outwc(value,port) \
223({ \
224 unsigned long v = value; \
225 if (__PORT_PCIO((port))) \
226 __asm__ __volatile__( \
227 "str %0, [%1, %2] @ outwc" \
228 : : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
229 else \
230 __asm__ __volatile__( \
231 "str %0, [%1, %2] @ outwc" \
232 : : "r" (v|v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
233})
234
235#define __inwc(port) \
236({ \
237 unsigned short result; \
238 if (__PORT_PCIO((port))) \
239 __asm__ __volatile__( \
240 "ldr %0, [%1, %2] @ inwc" \
241 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
242 else \
243 __asm__ __volatile__( \
244 "ldr %0, [%1, %2] @ inwc" \
245 : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
246 result & 0xffff; \
247})
248
249#define __outlc(value,port) \
250({ \
251 unsigned long v = value; \
252 if (__PORT_PCIO((port))) \
253 __asm__ __volatile__( \
254 "str %0, [%1, %2] @ outlc" \
255 : : "r" (v), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
256 else \
257 __asm__ __volatile__( \
258 "str %0, [%1, %2] @ outlc" \
259 : : "r" (v), "r" (IO_BASE), "r" ((port) << 2)); \
260})
261
262#define __inlc(port) \
263({ \
264 unsigned long result; \
265 if (__PORT_PCIO((port))) \
266 __asm__ __volatile__( \
267 "ldr %0, [%1, %2] @ inlc" \
268 : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
269 else \
270 __asm__ __volatile__( \
271 "ldr %0, [%1, %2] @ inlc" \
272 : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
273 result; \
274})
275
276#define __ioaddrc(port) \
277({ \
278 unsigned long addr; \
279 if (__PORT_PCIO((port))) \
280 addr = PCIO_BASE + ((port) << 2); \
281 else \
282 addr = IO_BASE + ((port) << 2); \
283 addr; \
284})
285
286#define inb(p) (__builtin_constant_p((p)) ? __inbc(p) : __inb(p))
287#define inw(p) (__builtin_constant_p((p)) ? __inwc(p) : __inw(p))
288#define inl(p) (__builtin_constant_p((p)) ? __inlc(p) : __inl(p))
289#define outb(v,p) (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p))
290#define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))
291#define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))
292#define __ioaddr(p) (__builtin_constant_p((p)) ? __ioaddr(p) : __ioaddrc(p))
293
294/* JMA 18.02.03 added sb,sl from arm/io.h, changing io to ioaddr */
295
296#define outsb(p,d,l) __raw_writesb(__ioaddr(p),d,l)
297#define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l)
298#define outsl(p,d,l) __raw_writesl(__ioaddr(p),d,l)
299
300#define insb(p,d,l) __raw_readsb(__ioaddr(p),d,l)
301#define insw(p,d,l) __raw_readsw(__ioaddr(p),d,l)
302#define insl(p,d,l) __raw_readsl(__ioaddr(p),d,l)
303
304#define insw(p,d,l) __raw_readsw(__ioaddr(p),d,l)
305#define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l)
306
307#define readb(c) (__readwrite_bug("readb"),0)
308#define readw(c) (__readwrite_bug("readw"),0)
309#define readl(c) (__readwrite_bug("readl"),0)
310#define readb_relaxed(addr) readb(addr)
311#define readw_relaxed(addr) readw(addr)
312#define readl_relaxed(addr) readl(addr)
313#define writeb(v,c) __readwrite_bug("writeb")
314#define writew(v,c) __readwrite_bug("writew")
315#define writel(v,c) __readwrite_bug("writel")
316
317#define readsw(p,d,l) (__readwrite_bug("readsw"),0)
318#define readsl(p,d,l) (__readwrite_bug("readsl"),0)
319#define writesw(p,d,l) __readwrite_bug("writesw")
320#define writesl(p,d,l) __readwrite_bug("writesl")
321
322#define mmiowb()
323
324/* the following macro is deprecated */
325#define ioaddr(port) __ioaddr((port))
326
327/*
328 * No ioremap support here.
329 */
330#define __arch_ioremap(c,s,f,a) ((void *)(c))
331#define __arch_iounmap(c) do { } while (0)
332
333
334#if defined(__arch_putb) || defined(__arch_putw) || defined(__arch_putl) || \
335 defined(__arch_getb) || defined(__arch_getw) || defined(__arch_getl)
336#warning machine class uses old __arch_putw or __arch_getw
337#endif
338
339/*
340 * IO port access primitives
341 * -------------------------
342 *
343 * The ARM doesn't have special IO access instructions; all IO is memory
344 * mapped. Note that these are defined to perform little endian accesses
345 * only. Their primary purpose is to access PCI and ISA peripherals.
346 *
347 * Note that for a big endian machine, this implies that the following
348 * big endian mode connectivity is in place, as described by numerious
349 * ARM documents:
350 *
351 * PCI: D0-D7 D8-D15 D16-D23 D24-D31
352 * ARM: D24-D31 D16-D23 D8-D15 D0-D7
353 *
354 * The machine specific io.h include defines __io to translate an "IO"
355 * address to a memory address.
356 *
357 * Note that we prevent GCC re-ordering or caching values in expressions
358 * by introducing sequence points into the in*() definitions. Note that
359 * __raw_* do not guarantee this behaviour.
360 */
361/*
362#define outsb(p,d,l) __raw_writesb(__io(p),d,l)
363#define outsw(p,d,l) __raw_writesw(__io(p),d,l)
364
365#define insb(p,d,l) __raw_readsb(__io(p),d,l)
366#define insw(p,d,l) __raw_readsw(__io(p),d,l)
367*/
368#define outb_p(val,port) outb((val),(port))
369#define outw_p(val,port) outw((val),(port))
370#define inb_p(port) inb((port))
371#define inw_p(port) inw((port))
372#define inl_p(port) inl((port))
373
374#define outsb_p(port,from,len) outsb(port,from,len)
375#define outsw_p(port,from,len) outsw(port,from,len)
376#define insb_p(port,to,len) insb(port,to,len)
377#define insw_p(port,to,len) insw(port,to,len)
378
379/*
380 * String version of IO memory access ops:
381 */
382extern void _memcpy_fromio(void *, unsigned long, size_t);
383extern void _memcpy_toio(unsigned long, const void *, size_t);
384extern void _memset_io(unsigned long, int, size_t);
385
386/*
387 * ioremap and friends.
388 *
389 * ioremap takes a PCI memory address, as specified in
390 * Documentation/IO-mapping.txt.
391 */
392extern void * __ioremap(unsigned long, size_t, unsigned long, unsigned long);
393extern void __iounmap(void *addr);
394
395#ifndef __arch_ioremap
396#define ioremap(cookie,size) __ioremap(cookie,size,0,1)
397#define ioremap_nocache(cookie,size) __ioremap(cookie,size,0,1)
398#define iounmap(cookie) __iounmap(cookie)
399#else
400#define ioremap(cookie,size) __arch_ioremap((cookie),(size),0,1)
401#define ioremap_nocache(cookie,size) __arch_ioremap((cookie),(size),0,1)
402#define iounmap(cookie) __arch_iounmap(cookie)
403#endif
404
405/*
406 * DMA-consistent mapping functions. These allocate/free a region of
407 * uncached, unwrite-buffered mapped memory space for use with DMA
408 * devices. This is the "generic" version. The PCI specific version
409 * is in pci.h
410 */
411extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle);
412extern void consistent_free(void *vaddr, size_t size, dma_addr_t handle);
413extern void consistent_sync(void *vaddr, size_t size, int rw);
414
415/*
416 * can the hardware map this into one segment or not, given no other
417 * constraints.
418 */
419#define BIOVEC_MERGEABLE(vec1, vec2) \
420 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
421
422/*
423 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
424 * access
425 */
426#define xlate_dev_mem_ptr(p) __va(p)
427
428/*
429 * Convert a virtual cached pointer to an uncached pointer
430 */
431#define xlate_dev_kmem_ptr(p) p
432
433#endif /* __KERNEL__ */
434#endif /* __ASM_ARM_IO_H */
diff --git a/include/asm-arm26/ioc.h b/include/asm-arm26/ioc.h
deleted file mode 100644
index b3b46ef65943..000000000000
--- a/include/asm-arm26/ioc.h
+++ /dev/null
@@ -1,72 +0,0 @@
1/*
2 * linux/include/asm-arm/hardware/ioc.h
3 *
4 * Copyright (C) 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 * Use these macros to read/write the IOC. All it does is perform the actual
11 * read/write.
12 */
13#ifndef __ASMARM_HARDWARE_IOC_H
14#define __ASMARM_HARDWARE_IOC_H
15
16#ifndef __ASSEMBLY__
17
18/*
19 * We use __raw_base variants here so that we give the compiler the
20 * chance to keep IOC_BASE in a register.
21 */
22#define ioc_readb(off) __raw_readb(IOC_BASE + (off))
23#define ioc_writeb(val,off) __raw_writeb(val, IOC_BASE + (off))
24
25#endif
26
27#define IOC_CONTROL (0x00)
28#define IOC_KARTTX (0x04)
29#define IOC_KARTRX (0x04)
30
31#define IOC_IRQSTATA (0x10)
32#define IOC_IRQREQA (0x14)
33#define IOC_IRQCLRA (0x14)
34#define IOC_IRQMASKA (0x18)
35
36#define IOC_IRQSTATB (0x20)
37#define IOC_IRQREQB (0x24)
38#define IOC_IRQMASKB (0x28)
39
40#define IOC_FIQSTAT (0x30)
41#define IOC_FIQREQ (0x34)
42#define IOC_FIQMASK (0x38)
43
44#define IOC_T0CNTL (0x40)
45#define IOC_T0LTCHL (0x40)
46#define IOC_T0CNTH (0x44)
47#define IOC_T0LTCHH (0x44)
48#define IOC_T0GO (0x48)
49#define IOC_T0LATCH (0x4c)
50
51#define IOC_T1CNTL (0x50)
52#define IOC_T1LTCHL (0x50)
53#define IOC_T1CNTH (0x54)
54#define IOC_T1LTCHH (0x54)
55#define IOC_T1GO (0x58)
56#define IOC_T1LATCH (0x5c)
57
58#define IOC_T2CNTL (0x60)
59#define IOC_T2LTCHL (0x60)
60#define IOC_T2CNTH (0x64)
61#define IOC_T2LTCHH (0x64)
62#define IOC_T2GO (0x68)
63#define IOC_T2LATCH (0x6c)
64
65#define IOC_T3CNTL (0x70)
66#define IOC_T3LTCHL (0x70)
67#define IOC_T3CNTH (0x74)
68#define IOC_T3LTCHH (0x74)
69#define IOC_T3GO (0x78)
70#define IOC_T3LATCH (0x7c)
71
72#endif
diff --git a/include/asm-arm26/ioctl.h b/include/asm-arm26/ioctl.h
deleted file mode 100644
index b279fe06dfe5..000000000000
--- a/include/asm-arm26/ioctl.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ioctl.h>
diff --git a/include/asm-arm26/ioctls.h b/include/asm-arm26/ioctls.h
deleted file mode 100644
index 8a3296200be1..000000000000
--- a/include/asm-arm26/ioctls.h
+++ /dev/null
@@ -1,85 +0,0 @@
1#ifndef __ASM_ARM_IOCTLS_H
2#define __ASM_ARM_IOCTLS_H
3
4#include <asm/ioctl.h>
5
6/* 0x54 is just a magic number to make these relatively unique ('T') */
7
8#define TCGETS 0x5401
9#define TCSETS 0x5402
10#define TCSETSW 0x5403
11#define TCSETSF 0x5404
12#define TCGETA 0x5405
13#define TCSETA 0x5406
14#define TCSETAW 0x5407
15#define TCSETAF 0x5408
16#define TCSBRK 0x5409
17#define TCXONC 0x540A
18#define TCFLSH 0x540B
19#define TIOCEXCL 0x540C
20#define TIOCNXCL 0x540D
21#define TIOCSCTTY 0x540E
22#define TIOCGPGRP 0x540F
23#define TIOCSPGRP 0x5410
24#define TIOCOUTQ 0x5411
25#define TIOCSTI 0x5412
26#define TIOCGWINSZ 0x5413
27#define TIOCSWINSZ 0x5414
28#define TIOCMGET 0x5415
29#define TIOCMBIS 0x5416
30#define TIOCMBIC 0x5417
31#define TIOCMSET 0x5418
32#define TIOCGSOFTCAR 0x5419
33#define TIOCSSOFTCAR 0x541A
34#define FIONREAD 0x541B
35#define TIOCINQ FIONREAD
36#define TIOCLINUX 0x541C
37#define TIOCCONS 0x541D
38#define TIOCGSERIAL 0x541E
39#define TIOCSSERIAL 0x541F
40#define TIOCPKT 0x5420
41#define FIONBIO 0x5421
42#define TIOCNOTTY 0x5422
43#define TIOCSETD 0x5423
44#define TIOCGETD 0x5424
45#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
46#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
47#define TIOCSBRK 0x5427 /* BSD compatibility */
48#define TIOCCBRK 0x5428 /* BSD compatibility */
49#define TIOCGSID 0x5429 /* Return the session ID of FD */
50#define TCGETS2 _IOR('T',0x2A, struct termios2)
51#define TCSETS2 _IOW('T',0x2B, struct termios2)
52#define TCSETSW2 _IOW('T',0x2C, struct termios2)
53#define TCSETSF2 _IOW('T',0x2D, struct termios2)
54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
56
57#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
58#define FIOCLEX 0x5451
59#define FIOASYNC 0x5452
60#define TIOCSERCONFIG 0x5453
61#define TIOCSERGWILD 0x5454
62#define TIOCSERSWILD 0x5455
63#define TIOCGLCKTRMIOS 0x5456
64#define TIOCSLCKTRMIOS 0x5457
65#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
66#define TIOCSERGETLSR 0x5459 /* Get line status register */
67#define TIOCSERGETMULTI 0x545A /* Get multiport config */
68#define TIOCSERSETMULTI 0x545B /* Set multiport config */
69
70#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
71#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
72#define FIOQSIZE 0x545E
73
74/* Used for packet mode */
75#define TIOCPKT_DATA 0
76#define TIOCPKT_FLUSHREAD 1
77#define TIOCPKT_FLUSHWRITE 2
78#define TIOCPKT_STOP 4
79#define TIOCPKT_START 8
80#define TIOCPKT_NOSTOP 16
81#define TIOCPKT_DOSTOP 32
82
83#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
84
85#endif
diff --git a/include/asm-arm26/ipc.h b/include/asm-arm26/ipc.h
deleted file mode 100644
index a46e3d9c2a3f..000000000000
--- a/include/asm-arm26/ipc.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/ipc.h>
diff --git a/include/asm-arm26/ipcbuf.h b/include/asm-arm26/ipcbuf.h
deleted file mode 100644
index 97683975f7df..000000000000
--- a/include/asm-arm26/ipcbuf.h
+++ /dev/null
@@ -1,29 +0,0 @@
1#ifndef __ASMARM_IPCBUF_H
2#define __ASMARM_IPCBUF_H
3
4/*
5 * The ipc64_perm structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit mode_t and seq
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid32_t uid;
18 __kernel_gid32_t gid;
19 __kernel_uid32_t cuid;
20 __kernel_gid32_t cgid;
21 __kernel_mode_t mode;
22 unsigned short __pad1;
23 unsigned short seq;
24 unsigned short __pad2;
25 unsigned long __unused1;
26 unsigned long __unused2;
27};
28
29#endif /* __ASMARM_IPCBUF_H */
diff --git a/include/asm-arm26/irq.h b/include/asm-arm26/irq.h
deleted file mode 100644
index 9aaac87efba9..000000000000
--- a/include/asm-arm26/irq.h
+++ /dev/null
@@ -1,48 +0,0 @@
1#ifndef __ASM_ARM_IRQ_H
2#define __ASM_ARM_IRQ_H
3
4#include <asm/sysirq.h>
5
6#ifndef NR_IRQS
7#define NR_IRQS 128
8#endif
9
10
11/* JMA 18.05.02 Copied off arch/arm/irq.h */
12#ifndef irq_canonicalize
13#define irq_canonicalize(i) (i)
14#endif
15
16
17/*
18 * Use this value to indicate lack of interrupt
19 * capability
20 */
21#ifndef NO_IRQ
22#define NO_IRQ ((unsigned int)(-1))
23#endif
24
25struct irqaction;
26
27#define disable_irq_nosync(i) disable_irq(i)
28
29extern void disable_irq(unsigned int);
30extern void enable_irq(unsigned int);
31
32#define __IRQT_FALEDGE (1 << 0)
33#define __IRQT_RISEDGE (1 << 1)
34#define __IRQT_LOWLVL (1 << 2)
35#define __IRQT_HIGHLVL (1 << 3)
36
37#define IRQT_NOEDGE (0)
38#define IRQT_RISING (__IRQT_RISEDGE)
39#define IRQT_FALLING (__IRQT_FALEDGE)
40#define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE)
41#define IRQT_LOW (__IRQT_LOWLVL)
42#define IRQT_HIGH (__IRQT_HIGHLVL)
43#define IRQT_PROBE (1 << 4)
44
45int set_irq_type(unsigned int irq, unsigned int type);
46
47#endif
48
diff --git a/include/asm-arm26/irqchip.h b/include/asm-arm26/irqchip.h
deleted file mode 100644
index 6a007a954098..000000000000
--- a/include/asm-arm26/irqchip.h
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * linux/include/asm-arm/mach/irq.h
3 *
4 * Copyright (C) 1995-2000 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 __ASM_ARM_MACH_IRQ_H
11#define __ASM_ARM_MACH_IRQ_H
12
13struct irqdesc;
14struct pt_regs;
15struct seq_file;
16
17typedef void (*irq_handler_t)(unsigned int, struct irqdesc *, struct pt_regs *);
18typedef void (*irq_control_t)(unsigned int);
19
20struct irqchip {
21 /*
22 * Acknowledge the IRQ.
23 * If this is a level-based IRQ, then it is expected to mask the IRQ
24 * as well.
25 */
26 void (*ack)(unsigned int);
27 /*
28 * Mask the IRQ in hardware.
29 */
30 void (*mask)(unsigned int);
31 /*
32 * Unmask the IRQ in hardware.
33 */
34 void (*unmask)(unsigned int);
35 /*
36 * Re-run the IRQ
37 */
38 void (*rerun)(unsigned int);
39 /*
40 * Set the type of the IRQ.
41 */
42 int (*type)(unsigned int, unsigned int);
43};
44
45struct irqdesc {
46 irq_handler_t handle;
47 struct irqchip *chip;
48 struct irqaction *action;
49
50 unsigned int enabled : 1; /* IRQ is currently enabled */
51 unsigned int triggered: 1; /* IRQ has occurred */
52 unsigned int running : 1; /* IRQ is running */
53 unsigned int pending : 1; /* IRQ is pending */
54 unsigned int probing : 1; /* IRQ in use for a probe */
55 unsigned int probe_ok : 1; /* IRQ can be used for probe */
56 unsigned int valid : 1; /* IRQ claimable */
57 unsigned int noautoenable : 1; /* don't automatically enable IRQ */
58 unsigned int unused :23;
59 unsigned int depth; /* disable depth */
60
61 /*
62 * IRQ lock detection
63 */
64 unsigned int lck_cnt;
65 unsigned int lck_pc;
66 unsigned int lck_jif;
67};
68
69extern struct irqdesc irq_desc[];
70
71/*
72 * This is internal. Do not use it.
73 */
74extern void (*init_arch_irq)(void);
75extern void init_FIQ(void);
76extern int show_fiq_list(struct seq_file *, void *);
77void __set_irq_handler(unsigned int irq, irq_handler_t, int);
78
79/*
80 * External stuff.
81 */
82#define set_irq_handler(irq,handler) __set_irq_handler(irq,handler,0)
83#define set_irq_chained_handler(irq,handler) __set_irq_handler(irq,handler,1)
84
85void set_irq_chip(unsigned int irq, struct irqchip *);
86void set_irq_flags(unsigned int irq, unsigned int flags);
87
88#define IRQF_VALID (1 << 0)
89#define IRQF_PROBE (1 << 1)
90#define IRQF_NOAUTOEN (1 << 2)
91
92/*
93 * Built-in IRQ handlers.
94 */
95void do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
96void do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
97void do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
98void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs);
99void dummy_mask_unmask_irq(unsigned int irq);
100
101#endif
diff --git a/include/asm-arm26/kdebug.h b/include/asm-arm26/kdebug.h
deleted file mode 100644
index 6ece1b037665..000000000000
--- a/include/asm-arm26/kdebug.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/kdebug.h>
diff --git a/include/asm-arm26/kmap_types.h b/include/asm-arm26/kmap_types.h
deleted file mode 100644
index d5da712b723c..000000000000
--- a/include/asm-arm26/kmap_types.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef __ARM_KMAP_TYPES_H
2#define __ARM_KMAP_TYPES_H
3
4/*
5 * This is the "bare minimum". AIO seems to require this.
6 */
7enum km_type {
8 KM_IRQ0,
9 KM_USER1
10};
11
12#endif
diff --git a/include/asm-arm26/leds.h b/include/asm-arm26/leds.h
deleted file mode 100644
index 12290ea55801..000000000000
--- a/include/asm-arm26/leds.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * linux/include/asm-arm/leds.h
3 *
4 * Copyright (C) 1998 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 * Event-driven interface for LEDs on machines
11 * Added led_start and led_stop- Alex Holden, 28th Dec 1998.
12 */
13#ifndef ASM_ARM_LEDS_H
14#define ASM_ARM_LEDS_H
15
16
17typedef enum {
18 led_idle_start,
19 led_idle_end,
20 led_timer,
21 led_start,
22 led_stop,
23 led_claim, /* override idle & timer leds */
24 led_release, /* restore idle & timer leds */
25 led_start_timer_mode,
26 led_stop_timer_mode,
27 led_green_on,
28 led_green_off,
29 led_amber_on,
30 led_amber_off,
31 led_red_on,
32 led_red_off,
33 led_blue_on,
34 led_blue_off,
35 /*
36 * I want this between led_timer and led_start, but
37 * someone has decided to export this to user space
38 */
39 led_halted
40} led_event_t;
41
42/* Use this routine to handle LEDs */
43
44#ifdef CONFIG_LEDS
45extern void (*leds_event)(led_event_t);
46#else
47#define leds_event(e)
48#endif
49
50#endif
diff --git a/include/asm-arm26/limits.h b/include/asm-arm26/limits.h
deleted file mode 100644
index 08d8c6600804..000000000000
--- a/include/asm-arm26/limits.h
+++ /dev/null
@@ -1,11 +0,0 @@
1#ifndef __ASM_PIPE_H
2#define __ASM_PIPE_H
3
4#ifndef PAGE_SIZE
5#include <asm/page.h>
6#endif
7
8#define PIPE_BUF PAGE_SIZE
9
10#endif
11
diff --git a/include/asm-arm26/linkage.h b/include/asm-arm26/linkage.h
deleted file mode 100644
index dbe4b4e31a5b..000000000000
--- a/include/asm-arm26/linkage.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __ASM_LINKAGE_H
2#define __ASM_LINKAGE_H
3
4#define __ALIGN .align 0
5#define __ALIGN_STR ".align 0"
6
7#endif
diff --git a/include/asm-arm26/local.h b/include/asm-arm26/local.h
deleted file mode 100644
index 6759e9183cef..000000000000
--- a/include/asm-arm26/local.h
+++ /dev/null
@@ -1,2 +0,0 @@
1//FIXME - nicked from arm32 - check it is correct...
2#include <asm-generic/local.h>
diff --git a/include/asm-arm26/locks.h b/include/asm-arm26/locks.h
deleted file mode 100644
index 81b3bda2ed00..000000000000
--- a/include/asm-arm26/locks.h
+++ /dev/null
@@ -1,161 +0,0 @@
1/*
2 * linux/include/asm-arm/proc-armo/locks.h
3 *
4 * Copyright (C) 2000 Russell King
5 * Fixes for 26 bit machines, (C) 2000 Dave Gilbert
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Interrupt safe locking assembler.
12 */
13#ifndef __ASM_PROC_LOCKS_H
14#define __ASM_PROC_LOCKS_H
15
16/* Decrements by 1, fails if value < 0 */
17#define __down_op(ptr,fail) \
18 ({ \
19 __asm__ __volatile__ ( \
20 "@ atomic down operation\n" \
21" mov ip, pc\n" \
22" orr lr, ip, #0x08000000\n" \
23" teqp lr, #0\n" \
24" ldr lr, [%0]\n" \
25" and ip, ip, #0x0c000003\n" \
26" subs lr, lr, #1\n" \
27" str lr, [%0]\n" \
28" orrmi ip, ip, #0x80000000 @ set N\n" \
29" teqp ip, #0\n" \
30" movmi ip, %0\n" \
31" blmi " #fail \
32 : \
33 : "r" (ptr) \
34 : "ip", "lr", "cc"); \
35 })
36
37#define __down_op_ret(ptr,fail) \
38 ({ \
39 unsigned int result; \
40 __asm__ __volatile__ ( \
41" @ down_op_ret\n" \
42" mov ip, pc\n" \
43" orr lr, ip, #0x08000000\n" \
44" teqp lr, #0\n" \
45" ldr lr, [%1]\n" \
46" and ip, ip, #0x0c000003\n" \
47" subs lr, lr, #1\n" \
48" str lr, [%1]\n" \
49" orrmi ip, ip, #0x80000000 @ set N\n" \
50" teqp ip, #0\n" \
51" movmi ip, %1\n" \
52" movpl ip, #0\n" \
53" blmi " #fail "\n" \
54" mov %0, ip" \
55 : "=&r" (result) \
56 : "r" (ptr) \
57 : "ip", "lr", "cc"); \
58 result; \
59 })
60
61#define __up_op(ptr,wake) \
62 ({ \
63 __asm__ __volatile__ ( \
64 "@ up_op\n" \
65" mov ip, pc\n" \
66" orr lr, ip, #0x08000000\n" \
67" teqp lr, #0\n" \
68" ldr lr, [%0]\n" \
69" and ip, ip, #0x0c000003\n" \
70" adds lr, lr, #1\n" \
71" str lr, [%0]\n" \
72" orrle ip, ip, #0x80000000 @ set N - should this be mi ??? DAG ! \n" \
73" teqp ip, #0\n" \
74" movmi ip, %0\n" \
75" blmi " #wake \
76 : \
77 : "r" (ptr) \
78 : "ip", "lr", "cc"); \
79 })
80
81/*
82 * The value 0x01000000 supports up to 128 processors and
83 * lots of processes. BIAS must be chosen such that sub'ing
84 * BIAS once per CPU will result in the long remaining
85 * negative.
86 */
87#define RW_LOCK_BIAS 0x01000000
88#define RW_LOCK_BIAS_STR "0x01000000"
89
90/* Decrements by RW_LOCK_BIAS rather than 1, fails if value != 0 */
91#define __down_op_write(ptr,fail) \
92 ({ \
93 __asm__ __volatile__( \
94 "@ down_op_write\n" \
95" mov ip, pc\n" \
96" orr lr, ip, #0x08000000\n" \
97" teqp lr, #0\n" \
98" and ip, ip, #0x0c000003\n" \
99\
100" ldr lr, [%0]\n" \
101" subs lr, lr, %1\n" \
102" str lr, [%0]\n" \
103\
104" orreq ip, ip, #0x40000000 @ set Z \n"\
105" teqp ip, #0\n" \
106" movne ip, %0\n" \
107" blne " #fail \
108 : \
109 : "r" (ptr), "I" (RW_LOCK_BIAS) \
110 : "ip", "lr", "cc"); \
111 })
112
113/* Increments by RW_LOCK_BIAS, wakes if value >= 0 */
114#define __up_op_write(ptr,wake) \
115 ({ \
116 __asm__ __volatile__( \
117 "@ up_op_read\n" \
118" mov ip, pc\n" \
119" orr lr, ip, #0x08000000\n" \
120" teqp lr, #0\n" \
121\
122" ldr lr, [%0]\n" \
123" and ip, ip, #0x0c000003\n" \
124" adds lr, lr, %1\n" \
125" str lr, [%0]\n" \
126\
127" orrcs ip, ip, #0x20000000 @ set C\n" \
128" teqp ip, #0\n" \
129" movcs ip, %0\n" \
130" blcs " #wake \
131 : \
132 : "r" (ptr), "I" (RW_LOCK_BIAS) \
133 : "ip", "lr", "cc"); \
134 })
135
136#define __down_op_read(ptr,fail) \
137 __down_op(ptr, fail)
138
139#define __up_op_read(ptr,wake) \
140 ({ \
141 __asm__ __volatile__( \
142 "@ up_op_read\n" \
143" mov ip, pc\n" \
144" orr lr, ip, #0x08000000\n" \
145" teqp lr, #0\n" \
146\
147" ldr lr, [%0]\n" \
148" and ip, ip, #0x0c000003\n" \
149" adds lr, lr, %1\n" \
150" str lr, [%0]\n" \
151\
152" orreq ip, ip, #0x40000000 @ Set Z \n" \
153" teqp ip, #0\n" \
154" moveq ip, %0\n" \
155" bleq " #wake \
156 : \
157 : "r" (ptr), "I" (1) \
158 : "ip", "lr", "cc"); \
159 })
160
161#endif
diff --git a/include/asm-arm26/mach-types.h b/include/asm-arm26/mach-types.h
deleted file mode 100644
index 0aeaedcbac96..000000000000
--- a/include/asm-arm26/mach-types.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * Unlike ARM32 this is NOT automatically generated. DONT delete it
3 * Instead, consider FIXME-ing it so its auto-detected.
4 */
5
6#ifndef __ASM_ARM_MACH_TYPE_H
7#define __ASM_ARM_MACH_TYPE_H
8
9
10#ifndef __ASSEMBLY__
11extern unsigned int __machine_arch_type;
12#endif
13
14#define MACH_TYPE_ARCHIMEDES 10
15#define MACH_TYPE_A5K 11
16
17#ifdef CONFIG_ARCH_ARC
18# define machine_arch_type MACH_TYPE_ARCHIMEDES
19# define machine_is_archimedes() (machine_arch_type == MACH_TYPE_ARCHIMEDES)
20#else
21# define machine_is_archimedes() (0)
22#endif
23
24#ifdef CONFIG_ARCH_A5K
25# define machine_arch_type MACH_TYPE_A5K
26# define machine_is_a5k() (machine_arch_type == MACH_TYPE_A5K)
27#else
28# define machine_is_a5k() (0)
29#endif
30
31#ifndef machine_arch_type
32#error Unknown machine type
33#define machine_arch_type __machine_arch_type
34#endif
35
36#endif
diff --git a/include/asm-arm26/map.h b/include/asm-arm26/map.h
deleted file mode 100644
index 6e12a7fa5c5d..000000000000
--- a/include/asm-arm26/map.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * linux/include/asm-arm/map.h
3 *
4 * Copyright (C) 1999-2000 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 * Page table mapping constructs and function prototypes
11 */
12struct map_desc {
13 unsigned long virtual;
14 unsigned long physical;
15 unsigned long length;
16 unsigned int type;
17};
18
19struct meminfo;
20
21extern void create_memmap_holes(struct meminfo *);
22extern void memtable_init(struct meminfo *);
23extern void iotable_init(struct map_desc *);
24extern void setup_io_desc(void);
diff --git a/include/asm-arm26/mc146818rtc.h b/include/asm-arm26/mc146818rtc.h
deleted file mode 100644
index a234130db8f1..000000000000
--- a/include/asm-arm26/mc146818rtc.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * Machine dependent access functions for RTC registers.
3 */
4#ifndef _ASM_MC146818RTC_H
5#define _ASM_MC146818RTC_H
6
7#include <asm/irq.h>
8#include <asm/io.h>
9
10#ifndef RTC_PORT
11#define RTC_PORT(x) (0x70 + (x))
12#define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */
13#endif
14
15/*
16 * The yet supported machines all access the RTC index register via
17 * an ISA port access but the way to access the date register differs ...
18 */
19#define CMOS_READ(addr) ({ \
20outb_p((addr),RTC_PORT(0)); \
21inb_p(RTC_PORT(1)); \
22})
23#define CMOS_WRITE(val, addr) ({ \
24outb_p((addr),RTC_PORT(0)); \
25outb_p((val),RTC_PORT(1)); \
26})
27
28#endif /* _ASM_MC146818RTC_H */
diff --git a/include/asm-arm26/memory.h b/include/asm-arm26/memory.h
deleted file mode 100644
index 7c1e5be39060..000000000000
--- a/include/asm-arm26/memory.h
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * linux/include/asm-arm26/memory.h
3 *
4 * Copyright (C) 2000-2002 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 * Note: this file should not be included by non-asm/.h files
11 */
12#ifndef __ASM_ARM_MEMORY_H
13#define __ASM_ARM_MEMORY_H
14
15/*
16 * User space: 26MB
17 */
18#define TASK_SIZE (0x01a00000UL)
19
20/*
21 * This decides where the kernel will search for a free chunk of vm
22 * space during mmap's.
23 */
24#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
25
26/*
27 * Page offset: 32MB
28 */
29#define PAGE_OFFSET (0x02000000UL)
30#define PHYS_OFFSET (0x02000000UL)
31
32#define PHYS_TO_NID(addr) (0)
33
34/*
35 * PFNs are used to describe any physical page; this means
36 * PFN 0 == physical address 0.
37 *
38 * This is the PFN of the first RAM page in the kernel
39 * direct-mapped view. We assume this is the first page
40 * of RAM in the mem_map as well.
41 */
42#define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT)
43
44/*
45 * These are *only* valid on the kernel direct mapped RAM memory.
46 */
47static inline unsigned long virt_to_phys(void *x)
48{
49 return (unsigned long)x;
50}
51
52static inline void *phys_to_virt(unsigned long x)
53{
54 return (void *)((unsigned long)x);
55}
56
57#define __pa(x) (unsigned long)(x)
58#define __va(x) ((void *)(unsigned long)(x))
59
60/*
61 * Virtual <-> DMA view memory address translations
62 * Again, these are *only* valid on the kernel direct mapped RAM
63 * memory. Use of these is *deprecated*.
64 */
65#define virt_to_bus(x) ((unsigned long)(x))
66#define bus_to_virt(x) ((void *)((unsigned long)(x)))
67
68/*
69 * Conversion between a struct page and a physical address.
70 *
71 * Note: when converting an unknown physical address to a
72 * struct page, the resulting pointer must be validated
73 * using VALID_PAGE(). It must return an invalid struct page
74 * for any physical address not corresponding to a system
75 * RAM address.
76 *
77 * page_to_pfn(page) convert a struct page * to a PFN number
78 * pfn_to_page(pfn) convert a _valid_ PFN number to struct page *
79 * pfn_valid(pfn) indicates whether a PFN number is valid
80 *
81 * virt_to_page(k) convert a _valid_ virtual address to struct page *
82 * virt_addr_valid(k) indicates whether a virtual address is valid
83 */
84#define ARCH_PFN_OFFSET (PHYS_PFN_OFFSET)
85#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
86
87#define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT))
88#define virt_addr_valid(kaddr) ((int)(kaddr) >= PAGE_OFFSET && (int)(kaddr) < (unsigned long)high_memory)
89
90/*
91 * For BIO. "will die". Kill me when bio_to_phys() and bvec_to_phys() die.
92 */
93#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
94
95/*
96 * We should really eliminate virt_to_bus() here - it's deprecated.
97 */
98#define page_to_bus(page) (page_address(page))
99
100#include <asm-generic/memory_model.h>
101#endif
diff --git a/include/asm-arm26/mman.h b/include/asm-arm26/mman.h
deleted file mode 100644
index 4000a6c1b76b..000000000000
--- a/include/asm-arm26/mman.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef __ARM_MMAN_H__
2#define __ARM_MMAN_H__
3
4#include <asm-generic/mman.h>
5
6#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
7#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
8#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
9#define MAP_LOCKED 0x2000 /* pages are locked */
10#define MAP_NORESERVE 0x4000 /* don't check for reservations */
11#define MAP_POPULATE 0x8000 /* populate (prefault) page tables */
12#define MAP_NONBLOCK 0x10000 /* do not block on IO */
13
14#define MCL_CURRENT 1 /* lock all current mappings */
15#define MCL_FUTURE 2 /* lock all future mappings */
16
17#endif /* __ARM_MMAN_H__ */
diff --git a/include/asm-arm26/mmu.h b/include/asm-arm26/mmu.h
deleted file mode 100644
index 9b8d3d781a1e..000000000000
--- a/include/asm-arm26/mmu.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef __ARM_MMU_H
2#define __ARM_MMU_H
3
4/*
5 * The ARM doesn't have a mmu context
6 */
7typedef struct { } mm_context_t;
8
9#endif
diff --git a/include/asm-arm26/mmu_context.h b/include/asm-arm26/mmu_context.h
deleted file mode 100644
index 16c821f81b8d..000000000000
--- a/include/asm-arm26/mmu_context.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * linux/include/asm-arm/mmu_context.h
3 *
4 * Copyright (C) 1996 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 * Changelog:
11 * 27-06-1996 RMK Created
12 */
13#ifndef __ASM_ARM_MMU_CONTEXT_H
14#define __ASM_ARM_MMU_CONTEXT_H
15
16#include <asm-generic/mm_hooks.h>
17
18#define init_new_context(tsk,mm) 0
19#define destroy_context(mm) do { } while(0)
20
21/*
22 * This is called when "tsk" is about to enter lazy TLB mode.
23 *
24 * mm: describes the currently active mm context
25 * tsk: task which is entering lazy tlb
26 * cpu: cpu number which is entering lazy tlb
27 *
28 * tsk->mm will be NULL
29 */
30static inline void
31enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
32{
33}
34
35/*
36 * This is the actual mm switch as far as the scheduler
37 * is concerned. No registers are touched.
38 */
39static inline void
40switch_mm(struct mm_struct *prev, struct mm_struct *next,
41 struct task_struct *tsk)
42{
43 cpu_switch_mm(next->pgd, next);
44}
45
46#define deactivate_mm(tsk,mm) do { } while (0)
47
48static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
49{
50 cpu_switch_mm(next->pgd, next);
51}
52
53#endif
diff --git a/include/asm-arm26/module.h b/include/asm-arm26/module.h
deleted file mode 100644
index 1157f178daec..000000000000
--- a/include/asm-arm26/module.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _ASM_ARM_MODULE_H
2#define _ASM_ARM_MODULE_H
3/*
4 * This file contains the arm architecture specific module code.
5 */
6
7#endif /* _ASM_ARM_MODULE_H */
diff --git a/include/asm-arm26/msgbuf.h b/include/asm-arm26/msgbuf.h
deleted file mode 100644
index 33b35b946eaa..000000000000
--- a/include/asm-arm26/msgbuf.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef _ASMARM_MSGBUF_H
2#define _ASMARM_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct msqid64_ds {
15 struct ipc64_perm msg_perm;
16 __kernel_time_t msg_stime; /* last msgsnd time */
17 unsigned long __unused1;
18 __kernel_time_t msg_rtime; /* last msgrcv time */
19 unsigned long __unused2;
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long __unused3;
22 unsigned long msg_cbytes; /* current number of bytes on queue */
23 unsigned long msg_qnum; /* number of messages in queue */
24 unsigned long msg_qbytes; /* max number of bytes on queue */
25 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
26 __kernel_pid_t msg_lrpid; /* last receive pid */
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31#endif /* _ASMARM_MSGBUF_H */
diff --git a/include/asm-arm26/namei.h b/include/asm-arm26/namei.h
deleted file mode 100644
index 3f5d340110eb..000000000000
--- a/include/asm-arm26/namei.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * linux/include/asm-arm26/namei.h
3 *
4 * Routines to handle famous /usr/gnemul
5 * Derived from the Sparc version of this file
6 *
7 * Included from linux/fs/namei.c
8 */
9
10#ifndef __ASMARM_NAMEI_H
11#define __ASMARM_NAMEI_H
12
13#define ARM_BSD_EMUL "usr/gnemul/bsd/"
14
15static inline char *__emul_prefix(void)
16{
17 switch (current->personality) {
18 case PER_BSD:
19 return ARM_BSD_EMUL;
20 default:
21 return NULL;
22 }
23}
24
25#endif /* __ASMARM_NAMEI_H */
diff --git a/include/asm-arm26/oldlatches.h b/include/asm-arm26/oldlatches.h
deleted file mode 100644
index bc87089b2152..000000000000
--- a/include/asm-arm26/oldlatches.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-arc/oldlatches.h
3 *
4 * Copyright (C) 1996 Russell King, Dave Gilbert
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 * Modifications:
11 * 04-04-1998 PJB/RMK Merged arc and a5k versions
12 */
13#ifndef _ASM_ARCH_OLDLATCH_H
14#define _ASM_ARCH_OLDLATCH_H
15
16#define LATCHA_FDSEL0 (1<<0)
17#define LATCHA_FDSEL1 (1<<1)
18#define LATCHA_FDSEL2 (1<<2)
19#define LATCHA_FDSEL3 (1<<3)
20#define LATCHA_FDSELALL (0xf)
21#define LATCHA_SIDESEL (1<<4)
22#define LATCHA_MOTOR (1<<5)
23#define LATCHA_INUSE (1<<6)
24#define LATCHA_CHANGERST (1<<7)
25
26#define LATCHB_FDCDENSITY (1<<1)
27#define LATCHB_FDCRESET (1<<3)
28#define LATCHB_PRINTSTROBE (1<<4)
29
30/* newval=(oldval & mask)|newdata */
31void oldlatch_bupdate(unsigned char mask,unsigned char newdata);
32
33/* newval=(oldval & mask)|newdata */
34void oldlatch_aupdate(unsigned char mask,unsigned char newdata);
35
36#endif
37
diff --git a/include/asm-arm26/page.h b/include/asm-arm26/page.h
deleted file mode 100644
index fa19de28fda0..000000000000
--- a/include/asm-arm26/page.h
+++ /dev/null
@@ -1,102 +0,0 @@
1#ifndef _ASMARM_PAGE_H
2#define _ASMARM_PAGE_H
3
4
5#ifdef __KERNEL__
6#ifndef __ASSEMBLY__
7
8extern void __clear_user_page(void *p, unsigned long user);
9extern void __copy_user_page(void *to, const void *from, unsigned long user);
10extern void copy_page(void *to, const void *from);
11
12//FIXME these may be wrong on ARM26
13#define clear_user_page(addr,vaddr,pg) \
14 do { \
15 preempt_disable(); \
16 __clear_user_page(addr, vaddr); \
17 preempt_enable(); \
18 } while (0)
19
20#define copy_user_page(to,from,vaddr,pg) \
21 do { \
22 preempt_disable(); \
23 __copy_user_page(to, from, vaddr); \
24 preempt_enable(); \
25 } while (0)
26
27#define clear_page(page) memzero((void *)(page), PAGE_SIZE)
28#define copy_page(to, from) __copy_user_page(to, from, 0);
29
30#undef STRICT_MM_TYPECHECKS
31
32#ifdef STRICT_MM_TYPECHECKS
33/*
34 * These are used to make use of C type-checking..
35 */
36typedef struct { unsigned long pgd; } pgd_t;
37typedef struct { unsigned long pte; } pte_t;
38typedef struct { unsigned long pmd; } pmd_t;
39typedef struct { unsigned long pgprot; } pgprot_t;
40
41#define pgd_val(x) ((x).pgd)
42#define pte_val(x) ((x).pte)
43#define pmd_val(x) ((x).pmd)
44#define pgprot_val(x) ((x).pgprot)
45
46#define __pte(x) ((pte_t) { (x) } )
47#define __pmd(x) ((pmd_t) { (x) } )
48#define __pgprot(x) ((pgprot_t) { (x) } )
49
50#else
51/*
52 * .. while these make it easier on the compiler
53 */
54typedef unsigned long pgd_t;
55typedef unsigned long pte_t;
56typedef unsigned long pmd_t;
57typedef unsigned long pgprot_t;
58
59//FIXME - should these cast to unsigned long?
60#define pgd_val(x) (x)
61#define pte_val(x) (x)
62#define pmd_val(x) (x)
63#define pgprot_val(x) (x)
64
65#define __pte(x) (x)
66#define __pmd(x) (x)
67#define __pgprot(x) (x)
68
69#endif /* STRICT_MM_TYPECHECKS */
70#endif /* !__ASSEMBLY__ */
71#endif /* __KERNEL__ */
72
73/* PAGE_SHIFT determines the page size. This is configurable. */
74#if defined(CONFIG_PAGESIZE_16)
75#define PAGE_SHIFT 14 /* 16K */
76#else /* default */
77#define PAGE_SHIFT 15 /* 32K */
78#endif
79
80#define EXEC_PAGESIZE 32768
81
82#define PAGE_SIZE (1UL << PAGE_SHIFT)
83#define PAGE_MASK (~(PAGE_SIZE-1))
84
85/* to align the pointer to the (next) page boundary */
86#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
87
88#ifdef __KERNEL__
89#ifndef __ASSEMBLY__
90
91#include <asm/memory.h>
92
93#endif /* !__ASSEMBLY__ */
94
95#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
96 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
97
98#endif /* __KERNEL__ */
99
100#include <asm-generic/page.h>
101
102#endif
diff --git a/include/asm-arm26/param.h b/include/asm-arm26/param.h
deleted file mode 100644
index 6b1e52df542e..000000000000
--- a/include/asm-arm26/param.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * linux/include/asm-arm/param.h
3 *
4 * Copyright (C) 1995-1999 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 __ASM_PARAM_H
11#define __ASM_PARAM_H
12
13#ifndef __KERNEL_HZ
14#define __KERNEL_HZ 100
15#endif
16
17#ifdef __KERNEL__
18# define HZ __KERNEL_HZ /* Internal kernel timer frequency */
19# define USER_HZ 100 /* User interfaces are in "ticks" */
20# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
21#else
22# define HZ 100
23#endif
24
25#ifndef NOGROUP
26#define NOGROUP (-1)
27#endif
28
29/* max length of hostname */
30#define MAXHOSTNAMELEN 64
31
32#endif
33
diff --git a/include/asm-arm26/parport.h b/include/asm-arm26/parport.h
deleted file mode 100644
index f2f90c76ddd1..000000000000
--- a/include/asm-arm26/parport.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * linux/include/asm-arm/parport.h: ARM-specific parport initialisation
3 *
4 * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
5 *
6 * This file should only be included by drivers/parport/parport_pc.c.
7 */
8
9#ifndef __ASMARM_PARPORT_H
10#define __ASMARM_PARPORT_H
11
12static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
13static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
14{
15 return parport_pc_find_isa_ports (autoirq, autodma);
16}
17
18#endif /* !(_ASMARM_PARPORT_H) */
diff --git a/include/asm-arm26/pci.h b/include/asm-arm26/pci.h
deleted file mode 100644
index 6ac67ed7718c..000000000000
--- a/include/asm-arm26/pci.h
+++ /dev/null
@@ -1,6 +0,0 @@
1/* Should not be needed. IDE stupidity */
2/* JMA 18.05.03 - is kinda needed, if only to tell it we don't have a PCI bus */
3
4#define PCI_DMA_BUS_IS_PHYS 0
5#define pcibios_scan_all_fns(a, b) 0
6
diff --git a/include/asm-arm26/percpu.h b/include/asm-arm26/percpu.h
deleted file mode 100644
index b4e32d8ec072..000000000000
--- a/include/asm-arm26/percpu.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ARM_PERCPU
2#define __ARM_PERCPU
3
4#include <asm-generic/percpu.h>
5
6#endif
diff --git a/include/asm-arm26/pgalloc.h b/include/asm-arm26/pgalloc.h
deleted file mode 100644
index 7725af3ddb4d..000000000000
--- a/include/asm-arm26/pgalloc.h
+++ /dev/null
@@ -1,70 +0,0 @@
1/*
2 * linux/include/asm-arm/pgalloc.h
3 *
4 * Copyright (C) 2000-2001 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_PGALLOC_H
11#define _ASMARM_PGALLOC_H
12
13#include <asm/processor.h>
14#include <asm/cacheflush.h>
15#include <asm/tlbflush.h>
16#include <linux/slab.h>
17
18extern struct kmem_cache *pte_cache;
19
20static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr){
21 return kmem_cache_alloc(pte_cache, GFP_KERNEL);
22}
23
24static inline void pte_free_kernel(pte_t *pte){
25 if (pte)
26 kmem_cache_free(pte_cache, pte);
27}
28
29/*
30 * Populate the pmdp entry with a pointer to the pte. This pmd is part
31 * of the mm address space.
32 *
33 * If 'mm' is the init tasks mm, then we are doing a vmalloc, and we
34 * need to set stuff up correctly for it.
35 */
36static inline void
37pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
38{
39//FIXME - is this doing the right thing?
40 set_pmd(pmdp, (unsigned long)ptep | 1/*FIXME _PMD_PRESENT*/);
41}
42
43/*
44 * FIXME - We use the old 2.5.5-rmk1 hack for this.
45 * This is not truly correct, but should be functional.
46 */
47#define pte_alloc_one(mm,addr) ((struct page *)pte_alloc_one_kernel(mm,addr))
48#define pte_free(pte) pte_free_kernel((pte_t *)pte)
49#define pmd_populate(mm,pmdp,ptep) pmd_populate_kernel(mm,pmdp,(pte_t *)ptep)
50
51/*
52 * Since we have only two-level page tables, these are trivial
53 *
54 * trick __pmd_alloc into optimising away. The actual value is irrelevant though as it
55 * is thrown away. It just cant be zero. -IM
56 */
57
58#define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); })
59#define pmd_free(pmd) do { } while (0)
60#define pgd_populate(mm,pmd,pte) BUG()
61
62extern pgd_t *get_pgd_slow(struct mm_struct *mm);
63extern void free_pgd_slow(pgd_t *pgd);
64
65#define pgd_alloc(mm) get_pgd_slow(mm)
66#define pgd_free(pgd) free_pgd_slow(pgd)
67
68#define check_pgt_cache() do { } while (0)
69
70#endif
diff --git a/include/asm-arm26/pgtable.h b/include/asm-arm26/pgtable.h
deleted file mode 100644
index 55a1a697d12b..000000000000
--- a/include/asm-arm26/pgtable.h
+++ /dev/null
@@ -1,298 +0,0 @@
1/*
2 * linux/include/asm-arm26/pgtable.h
3 *
4 * Copyright (C) 2000-2002 Russell King
5 * Copyright (C) 2003 Ian Molton
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef _ASMARM_PGTABLE_H
12#define _ASMARM_PGTABLE_H
13
14#include <asm-generic/4level-fixup.h>
15
16#include <asm/memory.h>
17
18/*
19 * The table below defines the page protection levels that we insert into our
20 * Linux page table version. These get translated into the best that the
21 * architecture can perform. Note that on most ARM hardware:
22 * 1) We cannot do execute protection
23 * 2) If we could do execute protection, then read is implied
24 * 3) write implies read permissions
25 */
26#define __P000 PAGE_NONE
27#define __P001 PAGE_READONLY
28#define __P010 PAGE_COPY
29#define __P011 PAGE_COPY
30#define __P100 PAGE_READONLY
31#define __P101 PAGE_READONLY
32#define __P110 PAGE_COPY
33#define __P111 PAGE_COPY
34
35#define __S000 PAGE_NONE
36#define __S001 PAGE_READONLY
37#define __S010 PAGE_SHARED
38#define __S011 PAGE_SHARED
39#define __S100 PAGE_READONLY
40#define __S101 PAGE_READONLY
41#define __S110 PAGE_SHARED
42#define __S111 PAGE_SHARED
43
44/*
45 * PMD_SHIFT determines the size of the area a second-level page table can map
46 * PGDIR_SHIFT determines what a third-level page table entry can map
47 */
48#define PGD_SHIFT 25
49#define PMD_SHIFT 20
50
51#define PGD_SIZE (1UL << PGD_SHIFT)
52#define PGD_MASK (~(PGD_SIZE-1))
53#define PMD_SIZE (1UL << PMD_SHIFT)
54#define PMD_MASK (~(PMD_SIZE-1))
55
56/* The kernel likes to use these names for the above (ick) */
57#define PGDIR_SIZE PGD_SIZE
58#define PGDIR_MASK PGD_MASK
59
60#define PTRS_PER_PGD 32
61#define PTRS_PER_PMD 1
62#define PTRS_PER_PTE 32
63
64/*
65 * This is the lowest virtual address we can permit any user space
66 * mapping to be mapped at. This is particularly important for
67 * non-high vector CPUs.
68 */
69#define FIRST_USER_ADDRESS PAGE_SIZE
70
71#define FIRST_USER_PGD_NR 1
72#define USER_PTRS_PER_PGD ((TASK_SIZE/PGD_SIZE) - FIRST_USER_PGD_NR)
73
74// FIXME - WTF?
75#define LIBRARY_TEXT_START 0x0c000000
76
77
78
79#ifndef __ASSEMBLY__
80extern void __pte_error(const char *file, int line, unsigned long val);
81extern void __pmd_error(const char *file, int line, unsigned long val);
82extern void __pgd_error(const char *file, int line, unsigned long val);
83
84#define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte_val(pte))
85#define pmd_ERROR(pmd) __pmd_error(__FILE__, __LINE__, pmd_val(pmd))
86#define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd_val(pgd))
87
88/*
89 * ZERO_PAGE is a global shared page that is always zero: used
90 * for zero-mapped memory areas etc..
91 */
92extern struct page *empty_zero_page;
93#define ZERO_PAGE(vaddr) (empty_zero_page)
94
95#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
96#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))
97#define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))
98#define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT))
99#define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot)
100
101/*
102 * Terminology: PGD = Page Directory, PMD = Page Middle Directory,
103 * PTE = Page Table Entry
104 *
105 * on arm26 we have no 2nd level page table. we simulate this by removing the
106 * PMD.
107 *
108 * pgd_none is 0 to prevernt pmd_alloc() calling __pmd_alloc(). This causes it
109 * to return pmd_offset(pgd,addr) which is a pointer to the pgd (IOW, a no-op).
110 *
111 * however, to work this way, whilst we are allocating 32 pgds, containing 32
112 * PTEs, the actual work is done on the PMDs, thus:
113 *
114 * instead of mm->pgd->pmd->pte
115 * we have mm->pgdpmd->pte
116 *
117 * IOW, think of PGD operations and PMD ones as being the same thing, just
118 * that PGD stuff deals with the mm_struct side of things, wheras PMD stuff
119 * deals with the pte side of things.
120 *
121 * additionally, we store some bits in the PGD and PTE pointers:
122 * PGDs:
123 * o The lowest (1) bit of the PGD is to determine if it is present or swap.
124 * o The 2nd bit of the PGD is unused and must be zero.
125 * o The top 6 bits of the PGD must be zero.
126 * PTEs:
127 * o The lower 5 bits of a pte are flags. bit 1 is the 'present' flag. The
128 * others determine the pages attributes.
129 *
130 * the pgd_val, pmd_val, and pte_val macros seem to be private to our code.
131 * They get the RAW value of the PGD/PMD/PTE entry, including our flags
132 * encoded into the pointers.
133 *
134 * The pgd_offset, pmd_offset, and pte_offset macros are used by the kernel,
135 * so they shouldnt have our flags attached.
136 *
137 * If you understood that, feel free to explain it to me...
138 *
139 */
140
141#define _PMD_PRESENT (0x01)
142
143/* These definitions allow us to optimise out stuff like pmd_alloc() */
144#define pgd_none(pgd) (0)
145#define pgd_bad(pgd) (0)
146#define pgd_present(pgd) (1)
147#define pgd_clear(pgdp) do { } while (0)
148
149/* Whilst these handle our actual 'page directory' (the agglomeration of pgd and pmd)
150 */
151#define pmd_none(pmd) (!pmd_val(pmd))
152#define pmd_bad(pmd) ((pmd_val(pmd) & 0xfc000002))
153#define pmd_present(pmd) (pmd_val(pmd) & _PMD_PRESENT)
154#define set_pmd(pmd_ptr, pmd) ((*(pmd_ptr)) = (pmd))
155#define pmd_clear(pmdp) set_pmd(pmdp, __pmd(0))
156
157/* and these handle our pte tables */
158#define pte_none(pte) (!pte_val(pte))
159#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
160#define set_pte(pte_ptr, pte) ((*(pte_ptr)) = (pte))
161#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
162#define pte_clear(mm,addr,ptep) set_pte_at((mm),(addr),(ptep), __pte(0))
163
164/* macros to ease the getting of pointers to stuff... */
165#define pgd_offset(mm, addr) ((pgd_t *)(mm)->pgd + __pgd_index(addr))
166#define pmd_offset(pgd, addr) ((pmd_t *)(pgd))
167#define pte_offset(pmd, addr) ((pte_t *)pmd_page(*(pmd)) + __pte_index(addr))
168
169/* there is no __pmd_index as we dont use pmds */
170#define __pgd_index(addr) ((addr) >> PGD_SHIFT)
171#define __pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
172
173
174/* Keep the kernel happy */
175#define pgd_index(addr) __pgd_index(addr)
176#define pgd_offset_k(addr) (pgd_offset(&init_mm, addr))
177
178/*
179 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
180 * area for the same reason. ;) FIXME: surely 1 page not 4k ?
181 */
182#define VMALLOC_START 0x01a00000
183#define VMALLOC_END 0x01c00000
184
185/* Is pmd_page supposed to return a pointer to a page in some arches? ours seems to
186 * return a pointer to memory (no special alignment)
187 */
188#define pmd_page(pmd) ((struct page *)(pmd_val((pmd)) & ~_PMD_PRESENT))
189#define pmd_page_vaddr(pmd) ((pte_t *)(pmd_val((pmd)) & ~_PMD_PRESENT))
190
191#define pte_offset_kernel(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr))
192
193#define pte_offset_map(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr))
194#define pte_offset_map_nested(dir,addr) (pmd_page_vaddr(*(dir)) + __pte_index(addr))
195#define pte_unmap(pte) do { } while (0)
196#define pte_unmap_nested(pte) do { } while (0)
197
198
199#define _PAGE_PRESENT 0x01
200#define _PAGE_READONLY 0x02
201#define _PAGE_NOT_USER 0x04
202#define _PAGE_OLD 0x08
203#define _PAGE_CLEAN 0x10
204
205// an old page has never been read.
206// a clean page has never been written.
207
208/* -- present -- -- !dirty -- --- !write --- ---- !user --- */
209#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_CLEAN | _PAGE_READONLY | _PAGE_NOT_USER)
210#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_CLEAN )
211#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_CLEAN | _PAGE_READONLY )
212#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_CLEAN | _PAGE_READONLY )
213#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_NOT_USER)
214
215#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_OLD | _PAGE_CLEAN)
216
217/*
218 * The following only work if pte_present() is true.
219 * Undefined behaviour if not..
220 */
221#define pte_write(pte) (!(pte_val(pte) & _PAGE_READONLY))
222#define pte_dirty(pte) (!(pte_val(pte) & _PAGE_CLEAN))
223#define pte_young(pte) (!(pte_val(pte) & _PAGE_OLD))
224//ONLY when !pte_present() I think. nicked from arm32 (FIXME!)
225#define pte_file(pte) (!(pte_val(pte) & _PAGE_OLD))
226
227#define PTE_BIT_FUNC(fn,op) \
228static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
229
230PTE_BIT_FUNC(wrprotect, |= _PAGE_READONLY);
231PTE_BIT_FUNC(mkwrite, &= ~_PAGE_READONLY);
232PTE_BIT_FUNC(mkclean, |= _PAGE_CLEAN);
233PTE_BIT_FUNC(mkdirty, &= ~_PAGE_CLEAN);
234PTE_BIT_FUNC(mkold, |= _PAGE_OLD);
235PTE_BIT_FUNC(mkyoung, &= ~_PAGE_OLD);
236
237/*
238 * We don't store cache state bits in the page table here. FIXME - or do we?
239 */
240#define pgprot_noncached(prot) (prot)
241#define pgprot_writecombine(prot) (prot) //FIXME - is a no-op?
242
243extern void pgtable_cache_init(void);
244
245//FIXME - nicked from arm32 and brutally hacked. probably wrong.
246#define pte_to_pgoff(x) (pte_val(x) >> 2)
247#define pgoff_to_pte(x) __pte(((x) << 2) & ~_PAGE_OLD)
248
249//FIXME - next line borrowed from arm32. is it right?
250#define PTE_FILE_MAX_BITS 30
251
252
253static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
254{
255 pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot);
256 return pte;
257}
258
259extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
260
261/* Encode and decode a swap entry.
262 *
263 * We support up to 32GB of swap on 4k machines
264 */
265#define __swp_type(x) (((x).val >> 2) & 0x7f)
266#define __swp_offset(x) ((x).val >> 9)
267#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 2) | ((offset) << 9) })
268#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
269#define __swp_entry_to_pte(swp) ((pte_t) { (swp).val })
270
271/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
272/* FIXME: this is not correct */
273#define kern_addr_valid(addr) (1)
274
275/*
276 * Conversion functions: convert a page and protection to a page entry,
277 * and a page entry and page directory to the page they refer to.
278 */
279static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
280{
281 pte_t pte;
282 pte_val(pte) = physpage | pgprot_val(pgprot);
283 return pte;
284}
285
286
287#include <asm-generic/pgtable.h>
288
289/*
290 * remap a physical page `pfn' of size `size' with page protection `prot'
291 * into virtual address `from'
292 */
293#define io_remap_pfn_range(vma,from,pfn,size,prot) \
294 remap_pfn_range(vma, from, pfn, size, prot)
295
296#endif /* !__ASSEMBLY__ */
297
298#endif /* _ASMARM_PGTABLE_H */
diff --git a/include/asm-arm26/poll.h b/include/asm-arm26/poll.h
deleted file mode 100644
index 1170e7065f6a..000000000000
--- a/include/asm-arm26/poll.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef __ASMARM_POLL_H
2#define __ASMARM_POLL_H
3
4#include <asm-generic/poll.h>
5
6#undef POLLREMOVE
7
8#endif
diff --git a/include/asm-arm26/posix_types.h b/include/asm-arm26/posix_types.h
deleted file mode 100644
index f8d1eb4f4cb1..000000000000
--- a/include/asm-arm26/posix_types.h
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * linux/include/asm-arm/posix_types.h
3 *
4 * Copyright (C) 1996-1998 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 * Changelog:
11 * 27-06-1996 RMK Created
12 */
13#ifndef __ARCH_ARM_POSIX_TYPES_H
14#define __ARCH_ARM_POSIX_TYPES_H
15
16/*
17 * This file is generally used by user-level software, so you need to
18 * be a little careful about namespace pollution etc. Also, we cannot
19 * assume GCC is being used.
20 */
21
22typedef unsigned long __kernel_ino_t;
23typedef unsigned short __kernel_mode_t;
24typedef unsigned short __kernel_nlink_t;
25typedef long __kernel_off_t;
26typedef int __kernel_pid_t;
27typedef unsigned short __kernel_ipc_pid_t;
28typedef unsigned short __kernel_uid_t;
29typedef unsigned short __kernel_gid_t;
30typedef unsigned int __kernel_size_t;
31typedef int __kernel_ssize_t;
32typedef int __kernel_ptrdiff_t;
33typedef long __kernel_time_t;
34typedef long __kernel_suseconds_t;
35typedef long __kernel_clock_t;
36typedef int __kernel_timer_t;
37typedef int __kernel_clockid_t;
38typedef int __kernel_daddr_t;
39typedef char * __kernel_caddr_t;
40typedef unsigned short __kernel_uid16_t;
41typedef unsigned short __kernel_gid16_t;
42typedef unsigned int __kernel_uid32_t;
43typedef unsigned int __kernel_gid32_t;
44
45typedef unsigned short __kernel_old_uid_t;
46typedef unsigned short __kernel_old_gid_t;
47typedef unsigned short __kernel_old_dev_t;
48
49#ifdef __GNUC__
50typedef long long __kernel_loff_t;
51#endif
52
53typedef struct {
54#if defined(__KERNEL__) || defined(__USE_ALL)
55 int val[2];
56#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
57 int __val[2];
58#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
59} __kernel_fsid_t;
60
61#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
62
63#undef __FD_SET
64#define __FD_SET(fd, fdsetp) \
65 (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] |= (1<<((fd) & 31)))
66
67#undef __FD_CLR
68#define __FD_CLR(fd, fdsetp) \
69 (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] &= ~(1<<((fd) & 31)))
70
71#undef __FD_ISSET
72#define __FD_ISSET(fd, fdsetp) \
73 ((((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] & (1<<((fd) & 31))) != 0)
74
75#undef __FD_ZERO
76#define __FD_ZERO(fdsetp) \
77 (memset ((fdsetp), 0, sizeof (*(fd_set *)(fdsetp))))
78
79#endif
80
81#endif
diff --git a/include/asm-arm26/proc-fns.h b/include/asm-arm26/proc-fns.h
deleted file mode 100644
index a83100454055..000000000000
--- a/include/asm-arm26/proc-fns.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * linux/include/asm-arm26/proc-fns.h
3 *
4 * Copyright (C) 2000 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 __ASSEMBLY__
11
12#include <asm/page.h>
13
14/*
15 * Don't change this structure - ASM code
16 * relies on it.
17 */
18extern struct processor {
19 /* check for any bugs */
20 void (*_check_bugs)(void);
21 /* Set up any processor specifics */
22 void (*_proc_init)(void);
23 /* Disable any processor specifics */
24 void (*_proc_fin)(void);
25 /* set the MEMC hardware mappings */
26 void (*_set_pgd)(pgd_t *pgd);
27 /* XCHG */
28 unsigned long (*_xchg_1)(unsigned long x, volatile void *ptr);
29 unsigned long (*_xchg_4)(unsigned long x, volatile void *ptr);
30} processor;
31
32extern const struct processor arm2_processor_functions;
33extern const struct processor arm250_processor_functions;
34extern const struct processor arm3_processor_functions;
35
36#define cpu_check_bugs() processor._check_bugs()
37#define cpu_proc_init() processor._proc_init()
38#define cpu_proc_fin() processor._proc_fin()
39#define cpu_do_idle() do { } while (0)
40#define cpu_switch_mm(pgd,mm) processor._set_pgd(pgd)
41#define cpu_xchg_1(x,ptr) processor._xchg_1(x,ptr)
42#define cpu_xchg_4(x,ptr) processor._xchg_4(x,ptr)
43
44
45//FIXME - these shouldnt be in proc-fn.h
46extern void cpu_memc_update_all(pgd_t *pgd);
47extern void cpu_memc_update_entry(pgd_t *pgd, unsigned long phys_pte, unsigned long log_addr);
48
49#endif
diff --git a/include/asm-arm26/processor.h b/include/asm-arm26/processor.h
deleted file mode 100644
index 1d2d5f7b467b..000000000000
--- a/include/asm-arm26/processor.h
+++ /dev/null
@@ -1,113 +0,0 @@
1/*
2 * linux/include/asm-arm26/processor.h
3 *
4 * Copyright (C) 1995 Russell King
5 * Copyright (C) 2003 Ian Molton
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __ASM_ARM_PROCESSOR_H
13#define __ASM_ARM_PROCESSOR_H
14
15/*
16 * Default implementation of macro that returns current
17 * instruction pointer ("program counter").
18 */
19#define current_text_addr() ({ __label__ _l; _l: &&_l;})
20
21#ifdef __KERNEL__
22
23#include <asm/atomic.h>
24#include <asm/ptrace.h>
25#include <linux/string.h>
26
27#define KERNEL_STACK_SIZE 4096
28
29typedef struct {
30 void (*put_byte)(void); /* Special calling convention */
31 void (*get_byte)(void); /* Special calling convention */
32 void (*put_half)(void); /* Special calling convention */
33 void (*get_half)(void); /* Special calling convention */
34 void (*put_word)(void); /* Special calling convention */
35 void (*get_word)(void); /* Special calling convention */
36 void (*put_dword)(void); /* Special calling convention */
37 unsigned long (*copy_from_user)(void *to, const void *from, unsigned long sz);
38 unsigned long (*copy_to_user)(void *to, const void *from, unsigned long sz);
39 unsigned long (*clear_user)(void *addr, unsigned long sz);
40 unsigned long (*strncpy_from_user)(char *to, const char *from, unsigned long sz);
41 unsigned long (*strnlen_user)(const char *s, long n);
42} uaccess_t;
43
44extern uaccess_t uaccess_user, uaccess_kernel;
45
46#define EXTRA_THREAD_STRUCT \
47 uaccess_t *uaccess; /* User access functions*/
48
49#define EXTRA_THREAD_STRUCT_INIT \
50 .uaccess = &uaccess_kernel,
51
52// FIXME?!!
53
54#define start_thread(regs,pc,sp) \
55({ \
56 unsigned long *stack = (unsigned long *)sp; \
57 set_fs(USER_DS); \
58 memzero(regs->uregs, sizeof (regs->uregs)); \
59 regs->ARM_pc = pc | ~0xfc000003; /* pc */ \
60 regs->ARM_sp = sp; /* sp */ \
61 regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
62 regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
63 regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
64})
65
66#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1020])
67#define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1018])
68
69struct debug_entry {
70 u32 address;
71 u32 insn;
72};
73
74struct debug_info {
75 int nsaved;
76 struct debug_entry bp[2];
77};
78
79struct thread_struct {
80 /* fault info */
81 unsigned long address;
82 unsigned long trap_no;
83 unsigned long error_code;
84 /* debugging */
85 struct debug_info debug;
86 EXTRA_THREAD_STRUCT
87};
88
89#define INIT_THREAD { \
90EXTRA_THREAD_STRUCT_INIT \
91}
92
93/* Forward declaration, a strange C thing */
94struct task_struct;
95
96/* Free all resources held by a thread. */
97extern void release_thread(struct task_struct *);
98
99unsigned long get_wchan(struct task_struct *p);
100
101#define cpu_relax() barrier()
102
103/* Prepare to copy thread state - unlazy all lazy status */
104#define prepare_to_copy(tsk) do { } while (0)
105
106/*
107 * Create a new kernel thread
108 */
109extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
110
111#endif
112
113#endif /* __ASM_ARM_PROCESSOR_H */
diff --git a/include/asm-arm26/procinfo.h b/include/asm-arm26/procinfo.h
deleted file mode 100644
index b28624db69ff..000000000000
--- a/include/asm-arm26/procinfo.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * linux/include/asm-arm/procinfo.h
3 *
4 * Copyright (C) 1996-1999 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 __ASM_PROCINFO_H
11#define __ASM_PROCINFO_H
12
13#ifndef __ASSEMBLY__
14
15//struct processor;
16//struct cpu_user_fns;
17
18struct proc_info_item {
19 const char *manufacturer;
20 const char *cpu_name;
21};
22
23/*
24 * Note! struct processor is always defined if we're
25 * using MULTI_CPU, otherwise this entry is unused,
26 * but still exists.
27 *
28 * NOTE! The following structure is defined by assembly
29 * language, NOT C code. For more information, check:
30 * arch/arm/mm/proc-*.S and arch/arm/kernel/head-armv.S
31 */
32struct proc_info_list {
33 unsigned int cpu_val;
34 unsigned int cpu_mask;
35 const char *arch_name;
36 const char *elf_name;
37 unsigned int elf_hwcap;
38 struct proc_info_item *info;
39 struct processor *proc;
40};
41
42#endif /* __ASSEMBLY__ */
43
44#define PROC_INFO_SZ 48
45
46#define HWCAP_SWP 1
47#define HWCAP_HALF 2
48#define HWCAP_THUMB 4
49#define HWCAP_26BIT 8 /* Play it safe */
50#define HWCAP_FAST_MULT 16
51#define HWCAP_FPA 32
52#define HWCAP_VFP 64
53#define HWCAP_EDSP 128
54#define HWCAP_JAVA 256
55
56#endif
diff --git a/include/asm-arm26/ptrace.h b/include/asm-arm26/ptrace.h
deleted file mode 100644
index 6a46b5ae1156..000000000000
--- a/include/asm-arm26/ptrace.h
+++ /dev/null
@@ -1,104 +0,0 @@
1#ifndef __ASM_ARM_PTRACE_H
2#define __ASM_ARM_PTRACE_H
3
4#define PTRACE_GETREGS 12
5#define PTRACE_SETREGS 13
6#define PTRACE_GETFPREGS 14
7#define PTRACE_SETFPREGS 15
8#define PTRACE_OLDSETOPTIONS 21
9
10/* options set using PTRACE_SETOPTIONS */
11#define PTRACE_O_TRACESYSGOOD 0x00000001
12
13#define MODE_USR26 0x00000000
14#define MODE_FIQ26 0x00000001
15#define MODE_IRQ26 0x00000002
16#define MODE_SVC26 0x00000003
17#define MODE_MASK 0x00000003
18
19#define PSR_F_BIT 0x04000000
20#define PSR_I_BIT 0x08000000
21#define PSR_V_BIT 0x10000000
22#define PSR_C_BIT 0x20000000
23#define PSR_Z_BIT 0x40000000
24#define PSR_N_BIT 0x80000000
25
26#define PCMASK 0xfc000003
27
28
29#ifndef __ASSEMBLY__
30
31#define pc_pointer(v) ((v) & ~PCMASK) /* convert v to pc type address */
32#define instruction_pointer(regs) (pc_pointer((regs)->ARM_pc)) /* get pc */
33#define profile_pc(regs) instruction_pointer(regs)
34
35/* this struct defines the way the registers are stored on the
36 stack during a system call. */
37
38struct pt_regs {
39 long uregs[17];
40};
41
42#define ARM_pc uregs[15]
43#define ARM_lr uregs[14]
44#define ARM_sp uregs[13]
45#define ARM_ip uregs[12]
46#define ARM_fp uregs[11]
47#define ARM_r10 uregs[10]
48#define ARM_r9 uregs[9]
49#define ARM_r8 uregs[8]
50#define ARM_r7 uregs[7]
51#define ARM_r6 uregs[6]
52#define ARM_r5 uregs[5]
53#define ARM_r4 uregs[4]
54#define ARM_r3 uregs[3]
55#define ARM_r2 uregs[2]
56#define ARM_r1 uregs[1]
57#define ARM_r0 uregs[0]
58#define ARM_ORIG_r0 uregs[16]
59
60#ifdef __KERNEL__
61
62#define processor_mode(regs) \
63 ((regs)->ARM_pc & MODE_MASK)
64
65#define user_mode(regs) \
66 (processor_mode(regs) == MODE_USR26)
67
68#define interrupts_enabled(regs) \
69 (!((regs)->ARM_pc & PSR_I_BIT))
70
71#define fast_interrupts_enabled(regs) \
72 (!((regs)->ARM_pc & PSR_F_BIT))
73
74#define condition_codes(regs) \
75 ((regs)->ARM_pc & (PSR_V_BIT|PSR_C_BIT|PSR_Z_BIT|PSR_N_BIT))
76
77/* Are the current registers suitable for user mode?
78 * (used to maintain security in signal handlers)
79 */
80static inline int valid_user_regs(struct pt_regs *regs)
81{
82 if (user_mode(regs) &&
83 (regs->ARM_pc & (PSR_F_BIT | PSR_I_BIT)) == 0)
84 return 1;
85
86 /*
87 * force it to be something sensible
88 */
89 regs->ARM_pc &= ~(MODE_MASK | PSR_F_BIT | PSR_I_BIT);
90
91 return 0;
92}
93
94extern void show_regs(struct pt_regs *);
95
96#define predicate(x) (x & 0xf0000000)
97#define PREDICATE_ALWAYS 0xe0000000
98
99#endif /* __KERNEL__ */
100
101#endif /* __ASSEMBLY__ */
102
103#endif
104
diff --git a/include/asm-arm26/resource.h b/include/asm-arm26/resource.h
deleted file mode 100644
index 734b581b5b6a..000000000000
--- a/include/asm-arm26/resource.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _ARM_RESOURCE_H
2#define _ARM_RESOURCE_H
3
4#include <asm-generic/resource.h>
5
6#endif
diff --git a/include/asm-arm26/scatterlist.h b/include/asm-arm26/scatterlist.h
deleted file mode 100644
index d9c056c7784e..000000000000
--- a/include/asm-arm26/scatterlist.h
+++ /dev/null
@@ -1,26 +0,0 @@
1#ifndef _ASMARM_SCATTERLIST_H
2#define _ASMARM_SCATTERLIST_H
3
4#include <asm/types.h>
5
6struct scatterlist {
7 struct page *page; /* buffer page */
8 unsigned int offset; /* buffer offset */
9 dma_addr_t dma_address; /* dma address */
10 unsigned int length; /* length */
11 char *__address; /* for set_dma_addr */
12};
13
14/*
15 * These macros should be used after a pci_map_sg call has been done
16 * to get bus addresses of each of the SG entries and their lengths.
17 * You should only work with the number of sg entries pci_map_sg
18 * returns, or alternatively stop on the first sg_dma_len(sg) which
19 * is 0.
20 */
21#define sg_dma_address(sg) ((sg)->dma_address)
22#define sg_dma_len(sg) ((sg)->length)
23
24#define ISA_DMA_THRESHOLD (0xffffffff)
25
26#endif /* _ASMARM_SCATTERLIST_H */
diff --git a/include/asm-arm26/sections.h b/include/asm-arm26/sections.h
deleted file mode 100644
index 10b6370efad0..000000000000
--- a/include/asm-arm26/sections.h
+++ /dev/null
@@ -1,2 +0,0 @@
1//FIXME - nicked from arm32 - check its correct.
2#include <asm-generic/sections.h>
diff --git a/include/asm-arm26/segment.h b/include/asm-arm26/segment.h
deleted file mode 100644
index 9e24c21f6304..000000000000
--- a/include/asm-arm26/segment.h
+++ /dev/null
@@ -1,11 +0,0 @@
1#ifndef __ASM_ARM_SEGMENT_H
2#define __ASM_ARM_SEGMENT_H
3
4#define __KERNEL_CS 0x0
5#define __KERNEL_DS 0x0
6
7#define __USER_CS 0x1
8#define __USER_DS 0x1
9
10#endif /* __ASM_ARM_SEGMENT_H */
11
diff --git a/include/asm-arm26/semaphore-helper.h b/include/asm-arm26/semaphore-helper.h
deleted file mode 100644
index 1d7f1987edb9..000000000000
--- a/include/asm-arm26/semaphore-helper.h
+++ /dev/null
@@ -1,84 +0,0 @@
1#ifndef ASMARM_SEMAPHORE_HELPER_H
2#define ASMARM_SEMAPHORE_HELPER_H
3
4/*
5 * These two _must_ execute atomically wrt each other.
6 */
7static inline void wake_one_more(struct semaphore * sem)
8{
9 unsigned long flags;
10
11 spin_lock_irqsave(&semaphore_wake_lock, flags);
12 if (atomic_read(&sem->count) <= 0)
13 sem->waking++;
14 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
15}
16
17static inline int waking_non_zero(struct semaphore *sem)
18{
19 unsigned long flags;
20 int ret = 0;
21
22 spin_lock_irqsave(&semaphore_wake_lock, flags);
23 if (sem->waking > 0) {
24 sem->waking--;
25 ret = 1;
26 }
27 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
28 return ret;
29}
30
31/*
32 * waking non zero interruptible
33 * 1 got the lock
34 * 0 go to sleep
35 * -EINTR interrupted
36 *
37 * We must undo the sem->count down_interruptible() increment while we are
38 * protected by the spinlock in order to make this atomic_inc() with the
39 * atomic_read() in wake_one_more(), otherwise we can race. -arca
40 */
41static inline int waking_non_zero_interruptible(struct semaphore *sem,
42 struct task_struct *tsk)
43{
44 unsigned long flags;
45 int ret = 0;
46
47 spin_lock_irqsave(&semaphore_wake_lock, flags);
48 if (sem->waking > 0) {
49 sem->waking--;
50 ret = 1;
51 } else if (signal_pending(tsk)) {
52 atomic_inc(&sem->count);
53 ret = -EINTR;
54 }
55 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
56 return ret;
57}
58
59/*
60 * waking_non_zero_try_lock:
61 * 1 failed to lock
62 * 0 got the lock
63 *
64 * We must undo the sem->count down_interruptible() increment while we are
65 * protected by the spinlock in order to make this atomic_inc() with the
66 * atomic_read() in wake_one_more(), otherwise we can race. -arca
67 */
68static inline int waking_non_zero_trylock(struct semaphore *sem)
69{
70 unsigned long flags;
71 int ret = 1;
72
73 spin_lock_irqsave(&semaphore_wake_lock, flags);
74 if (sem->waking <= 0)
75 atomic_inc(&sem->count);
76 else {
77 sem->waking--;
78 ret = 0;
79 }
80 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
81 return ret;
82}
83
84#endif
diff --git a/include/asm-arm26/semaphore.h b/include/asm-arm26/semaphore.h
deleted file mode 100644
index 1fda54375ed8..000000000000
--- a/include/asm-arm26/semaphore.h
+++ /dev/null
@@ -1,100 +0,0 @@
1/*
2 * linux/include/asm-arm26/semaphore.h
3 */
4#ifndef __ASM_ARM_SEMAPHORE_H
5#define __ASM_ARM_SEMAPHORE_H
6
7#include <linux/linkage.h>
8#include <linux/spinlock.h>
9#include <linux/wait.h>
10#include <linux/rwsem.h>
11
12#include <asm/atomic.h>
13#include <asm/locks.h>
14
15struct semaphore {
16 atomic_t count;
17 int sleepers;
18 wait_queue_head_t wait;
19};
20
21#define __SEMAPHORE_INIT(name, n) \
22{ \
23 .count = ATOMIC_INIT(n), \
24 .sleepers = 0, \
25 .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \
26}
27
28#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
29 struct semaphore name = __SEMAPHORE_INIT(name,count)
30
31#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
32#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
33
34static inline void sema_init(struct semaphore *sem, int val)
35{
36 atomic_set(&sem->count, val);
37 sem->sleepers = 0;
38 init_waitqueue_head(&sem->wait);
39}
40
41static inline void init_MUTEX(struct semaphore *sem)
42{
43 sema_init(sem, 1);
44}
45
46static inline void init_MUTEX_LOCKED(struct semaphore *sem)
47{
48 sema_init(sem, 0);
49}
50
51/*
52 * special register calling convention
53 */
54asmlinkage void __down_failed(void);
55asmlinkage int __down_interruptible_failed(void);
56asmlinkage int __down_trylock_failed(void);
57asmlinkage void __up_wakeup(void);
58
59extern void __down(struct semaphore * sem);
60extern int __down_interruptible(struct semaphore * sem);
61extern int __down_trylock(struct semaphore * sem);
62extern void __up(struct semaphore * sem);
63
64/*
65 * This is ugly, but we want the default case to fall through.
66 * "__down" is the actual routine that waits...
67 */
68static inline void down(struct semaphore * sem)
69{
70 might_sleep();
71 __down_op(sem, __down_failed);
72}
73
74/*
75 * This is ugly, but we want the default case to fall through.
76 * "__down_interruptible" is the actual routine that waits...
77 */
78static inline int down_interruptible (struct semaphore * sem)
79{
80 might_sleep();
81 return __down_op_ret(sem, __down_interruptible_failed);
82}
83
84static inline int down_trylock(struct semaphore *sem)
85{
86 return __down_op_ret(sem, __down_trylock_failed);
87}
88
89/*
90 * Note! This is subtle. We jump to wake people up only if
91 * the semaphore was negative (== somebody was waiting on it).
92 * The default case (no contention) will result in NO
93 * jumps for both down() and up().
94 */
95static inline void up(struct semaphore * sem)
96{
97 __up_op(sem, __up_wakeup);
98}
99
100#endif
diff --git a/include/asm-arm26/sembuf.h b/include/asm-arm26/sembuf.h
deleted file mode 100644
index 1c0283954289..000000000000
--- a/include/asm-arm26/sembuf.h
+++ /dev/null
@@ -1,25 +0,0 @@
1#ifndef _ASMARM_SEMBUF_H
2#define _ASMARM_SEMBUF_H
3
4/*
5 * The semid64_ds structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct semid64_ds {
15 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
16 __kernel_time_t sem_otime; /* last semop time */
17 unsigned long __unused1;
18 __kernel_time_t sem_ctime; /* last change time */
19 unsigned long __unused2;
20 unsigned long sem_nsems; /* no. of semaphores in array */
21 unsigned long __unused3;
22 unsigned long __unused4;
23};
24
25#endif /* _ASMARM_SEMBUF_H */
diff --git a/include/asm-arm26/serial.h b/include/asm-arm26/serial.h
deleted file mode 100644
index dd86a716cb0b..000000000000
--- a/include/asm-arm26/serial.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * linux/include/asm-arm/serial.h
3 *
4 * Copyright (C) 1996 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 * Changelog:
11 * 15-10-1996 RMK Created
12 */
13
14#ifndef __ASM_SERIAL_H
15#define __ASM_SERIAL_H
16
17
18/*
19 * This assumes you have a 1.8432 MHz clock for your UART.
20 *
21 * It'd be nice if someone built a serial card with a 24.576 MHz
22 * clock, since the 16550A is capable of handling a top speed of 1.5
23 * megabits/second; but this requires the faster clock.
24 */
25#define BASE_BAUD (1843200 / 16)
26
27#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
28
29#if defined(CONFIG_ARCH_A5K)
30 /* UART CLK PORT IRQ FLAGS */
31
32#define SERIAL_PORT_DFNS \
33 { 0, BASE_BAUD, 0x3F8, 10, STD_COM_FLAGS }, /* ttyS0 */ \
34 { 0, BASE_BAUD, 0x2F8, 10, STD_COM_FLAGS }, /* ttyS1 */
35
36#else
37
38#define SERIAL_PORT_DFNS \
39 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS0 */ \
40 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS1 */
41
42#endif
43
44#endif
diff --git a/include/asm-arm26/setup.h b/include/asm-arm26/setup.h
deleted file mode 100644
index e82562306475..000000000000
--- a/include/asm-arm26/setup.h
+++ /dev/null
@@ -1,209 +0,0 @@
1/*
2 * linux/include/asm/setup.h
3 *
4 * Copyright (C) 1997-1999 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 * Structure passed to kernel to tell it about the
11 * hardware it's running on. See Documentation/arm/Setup
12 * for more info.
13 */
14#ifndef __ASMARM_SETUP_H
15#define __ASMARM_SETUP_H
16
17#define COMMAND_LINE_SIZE 1024
18
19#ifdef __KERNEL__
20
21/* The list ends with an ATAG_NONE node. */
22#define ATAG_NONE 0x00000000
23
24struct tag_header {
25 u32 size;
26 u32 tag;
27};
28
29/* The list must start with an ATAG_CORE node */
30#define ATAG_CORE 0x54410001
31
32struct tag_core {
33 u32 flags; /* bit 0 = read-only */
34 u32 pagesize;
35 u32 rootdev;
36};
37
38/* it is allowed to have multiple ATAG_MEM nodes */
39#define ATAG_MEM 0x54410002
40
41struct tag_mem32 {
42 u32 size;
43 u32 start; /* physical start address */
44};
45
46/* VGA text type displays */
47#define ATAG_VIDEOTEXT 0x54410003
48
49struct tag_videotext {
50 u8 x;
51 u8 y;
52 u16 video_page;
53 u8 video_mode;
54 u8 video_cols;
55 u16 video_ega_bx;
56 u8 video_lines;
57 u8 video_isvga;
58 u16 video_points;
59};
60
61/* describes how the ramdisk will be used in kernel */
62#define ATAG_RAMDISK 0x54410004
63
64struct tag_ramdisk {
65 u32 flags; /* bit 0 = load, bit 1 = prompt */
66 u32 size; /* decompressed ramdisk size in _kilo_ bytes */
67 u32 start; /* starting block of floppy-based RAM disk image */
68};
69
70/* describes where the compressed ramdisk image lives */
71/*
72 * this one accidentally used virtual addresses - as such,
73 * it's deprecated.
74 */
75#define ATAG_INITRD 0x54410005
76
77/* describes where the compressed ramdisk image lives */
78#define ATAG_INITRD2 0x54420005
79
80struct tag_initrd {
81 u32 start; /* physical start address */
82 u32 size; /* size of compressed ramdisk image in bytes */
83};
84
85/* board serial number. "64 bits should be enough for everybody" */
86#define ATAG_SERIAL 0x54410006
87
88struct tag_serialnr {
89 u32 low;
90 u32 high;
91};
92
93/* board revision */
94#define ATAG_REVISION 0x54410007
95
96struct tag_revision {
97 u32 rev;
98};
99
100/* initial values for vesafb-type framebuffers. see struct screen_info
101 * in include/linux/tty.h
102 */
103#define ATAG_VIDEOLFB 0x54410008
104
105struct tag_videolfb {
106 u16 lfb_width;
107 u16 lfb_height;
108 u16 lfb_depth;
109 u16 lfb_linelength;
110 u32 lfb_base;
111 u32 lfb_size;
112 u8 red_size;
113 u8 red_pos;
114 u8 green_size;
115 u8 green_pos;
116 u8 blue_size;
117 u8 blue_pos;
118 u8 rsvd_size;
119 u8 rsvd_pos;
120};
121
122/* command line: \0 terminated string */
123#define ATAG_CMDLINE 0x54410009
124
125struct tag_cmdline {
126 char cmdline[1]; /* this is the minimum size */
127};
128
129/* acorn RiscPC specific information */
130#define ATAG_ACORN 0x41000101
131
132struct tag_acorn {
133 u32 memc_control_reg;
134 u32 vram_pages;
135 u8 sounddefault;
136 u8 adfsdrives;
137};
138
139/* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
140#define ATAG_MEMCLK 0x41000402
141
142struct tag_memclk {
143 u32 fmemclk;
144};
145
146struct tag {
147 struct tag_header hdr;
148 union {
149 struct tag_core core;
150 struct tag_mem32 mem;
151 struct tag_videotext videotext;
152 struct tag_ramdisk ramdisk;
153 struct tag_initrd initrd;
154 struct tag_serialnr serialnr;
155 struct tag_revision revision;
156 struct tag_videolfb videolfb;
157 struct tag_cmdline cmdline;
158
159 /*
160 * Acorn specific
161 */
162 struct tag_acorn acorn;
163
164 /*
165 * DC21285 specific
166 */
167 struct tag_memclk memclk;
168 } u;
169};
170
171struct tagtable {
172 u32 tag;
173 int (*parse)(const struct tag *);
174};
175
176#define __tag __used __attribute__((__section__(".taglist")))
177#define __tagtable(tag, fn) \
178static struct tagtable __tagtable_##fn __tag = { tag, fn }
179
180#define tag_member_present(tag,member) \
181 ((unsigned long)(&((struct tag *)0L)->member + 1) \
182 <= (tag)->hdr.size * 4)
183
184#define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size))
185#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
186
187#define for_each_tag(t,base) \
188 for (t = base; t->hdr.size; t = tag_next(t))
189
190/*
191 * Memory map description
192 */
193#define NR_BANKS 8
194
195struct meminfo {
196 int nr_banks;
197 unsigned long end;
198 struct {
199 unsigned long start;
200 unsigned long size;
201 int node;
202 } bank[NR_BANKS];
203};
204
205extern struct meminfo meminfo;
206
207#endif /* __KERNEL__ */
208
209#endif
diff --git a/include/asm-arm26/shmbuf.h b/include/asm-arm26/shmbuf.h
deleted file mode 100644
index 2e5c67ba1c97..000000000000
--- a/include/asm-arm26/shmbuf.h
+++ /dev/null
@@ -1,42 +0,0 @@
1#ifndef _ASMARM_SHMBUF_H
2#define _ASMARM_SHMBUF_H
3
4/*
5 * The shmid64_ds structure for arm architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct shmid64_ds {
15 struct ipc64_perm shm_perm; /* operation perms */
16 size_t shm_segsz; /* size of segment (bytes) */
17 __kernel_time_t shm_atime; /* last attach time */
18 unsigned long __unused1;
19 __kernel_time_t shm_dtime; /* last detach time */
20 unsigned long __unused2;
21 __kernel_time_t shm_ctime; /* last change time */
22 unsigned long __unused3;
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29
30struct shminfo64 {
31 unsigned long shmmax;
32 unsigned long shmmin;
33 unsigned long shmmni;
34 unsigned long shmseg;
35 unsigned long shmall;
36 unsigned long __unused1;
37 unsigned long __unused2;
38 unsigned long __unused3;
39 unsigned long __unused4;
40};
41
42#endif /* _ASMARM_SHMBUF_H */
diff --git a/include/asm-arm26/shmparam.h b/include/asm-arm26/shmparam.h
deleted file mode 100644
index d3748686631e..000000000000
--- a/include/asm-arm26/shmparam.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef _ASMARM_SHMPARAM_H
2#define _ASMARM_SHMPARAM_H
3
4#ifndef SHMMAX
5#define SHMMAX 0x003fa000
6#endif
7
8/*
9 * This should be the size of the virtually indexed cache/ways,
10 * or page size, whichever is greater since the cache aliases
11 * every size/ways bytes.
12 */
13#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
14
15#endif /* _ASMARM_SHMPARAM_H */
diff --git a/include/asm-arm26/sigcontext.h b/include/asm-arm26/sigcontext.h
deleted file mode 100644
index 013ad2074fc7..000000000000
--- a/include/asm-arm26/sigcontext.h
+++ /dev/null
@@ -1,33 +0,0 @@
1#ifndef _ASMARM_SIGCONTEXT_H
2#define _ASMARM_SIGCONTEXT_H
3
4/*
5 * Signal context structure - contains all info to do with the state
6 * before the signal handler was invoked. Note: only add new entries
7 * to the end of the structure.
8 */
9struct sigcontext {
10 unsigned long trap_no;
11 unsigned long error_code;
12 unsigned long oldmask;
13 unsigned long arm_r0;
14 unsigned long arm_r1;
15 unsigned long arm_r2;
16 unsigned long arm_r3;
17 unsigned long arm_r4;
18 unsigned long arm_r5;
19 unsigned long arm_r6;
20 unsigned long arm_r7;
21 unsigned long arm_r8;
22 unsigned long arm_r9;
23 unsigned long arm_r10;
24 unsigned long arm_fp;
25 unsigned long arm_ip;
26 unsigned long arm_sp;
27 unsigned long arm_lr;
28 unsigned long arm_pc;
29 unsigned long fault_address;
30};
31
32
33#endif
diff --git a/include/asm-arm26/siginfo.h b/include/asm-arm26/siginfo.h
deleted file mode 100644
index 5e21852e6039..000000000000
--- a/include/asm-arm26/siginfo.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _ASMARM_SIGINFO_H
2#define _ASMARM_SIGINFO_H
3
4#include <asm-generic/siginfo.h>
5
6#endif
diff --git a/include/asm-arm26/signal.h b/include/asm-arm26/signal.h
deleted file mode 100644
index 967ba4947e40..000000000000
--- a/include/asm-arm26/signal.h
+++ /dev/null
@@ -1,176 +0,0 @@
1#ifndef _ASMARM_SIGNAL_H
2#define _ASMARM_SIGNAL_H
3
4#include <linux/types.h>
5
6/* Avoid too many header ordering problems. */
7struct siginfo;
8
9#ifdef __KERNEL__
10/* Most things should be clean enough to redefine this at will, if care
11 is taken to make libc match. */
12
13#define _NSIG 64
14#define _NSIG_BPW 32
15#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
16
17typedef unsigned long old_sigset_t; /* at least 32 bits */
18
19typedef struct {
20 unsigned long sig[_NSIG_WORDS];
21} sigset_t;
22
23#else
24/* Here we must cater to libcs that poke about in kernel headers. */
25
26#define NSIG 32
27typedef unsigned long sigset_t;
28
29#endif /* __KERNEL__ */
30
31#define SIGHUP 1
32#define SIGINT 2
33#define SIGQUIT 3
34#define SIGILL 4
35#define SIGTRAP 5
36#define SIGABRT 6
37#define SIGIOT 6
38#define SIGBUS 7
39#define SIGFPE 8
40#define SIGKILL 9
41#define SIGUSR1 10
42#define SIGSEGV 11
43#define SIGUSR2 12
44#define SIGPIPE 13
45#define SIGALRM 14
46#define SIGTERM 15
47#define SIGSTKFLT 16
48#define SIGCHLD 17
49#define SIGCONT 18
50#define SIGSTOP 19
51#define SIGTSTP 20
52#define SIGTTIN 21
53#define SIGTTOU 22
54#define SIGURG 23
55#define SIGXCPU 24
56#define SIGXFSZ 25
57#define SIGVTALRM 26
58#define SIGPROF 27
59#define SIGWINCH 28
60#define SIGIO 29
61#define SIGPOLL SIGIO
62/*
63#define SIGLOST 29
64*/
65#define SIGPWR 30
66#define SIGSYS 31
67#define SIGUNUSED 31
68
69/* These should not be considered constants from userland. */
70#define SIGRTMIN 32
71#define SIGRTMAX _NSIG
72
73#define SIGSWI 32
74
75/*
76 * SA_FLAGS values:
77 *
78 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
79 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
80 * SA_SIGINFO deliver the signal with SIGINFO structs
81 * SA_THIRTYTWO delivers the signal in 32-bit mode, even if the task
82 * is running in 26-bit.
83 * SA_ONSTACK allows alternate signal stacks (see sigaltstack(2)).
84 * SA_RESTART flag to get restarting signals (which were the default long ago)
85 * SA_NODEFER prevents the current signal from being masked in the handler.
86 * SA_RESETHAND clears the handler when the signal is delivered.
87 *
88 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
89 * Unix names RESETHAND and NODEFER respectively.
90 */
91#define SA_NOCLDSTOP 0x00000001
92#define SA_NOCLDWAIT 0x00000002 /* not supported yet */
93#define SA_SIGINFO 0x00000004
94#define SA_THIRTYTWO 0x02000000
95#define SA_RESTORER 0x04000000
96#define SA_ONSTACK 0x08000000
97#define SA_RESTART 0x10000000
98#define SA_NODEFER 0x40000000
99#define SA_RESETHAND 0x80000000
100
101#define SA_NOMASK SA_NODEFER
102#define SA_ONESHOT SA_RESETHAND
103
104
105/*
106 * sigaltstack controls
107 */
108#define SS_ONSTACK 1
109#define SS_DISABLE 2
110
111#define MINSIGSTKSZ 2048
112#define SIGSTKSZ 8192
113
114#ifdef __KERNEL__
115#define SA_IRQNOMASK 0x08000000
116#endif
117
118#include <asm-generic/signal.h>
119
120#ifdef __KERNEL__
121struct old_sigaction {
122 __sighandler_t sa_handler;
123 old_sigset_t sa_mask;
124 unsigned long sa_flags;
125 void (*sa_restorer)(void);
126};
127
128struct sigaction {
129 __sighandler_t sa_handler;
130 unsigned long sa_flags;
131 void (*sa_restorer)(void);
132 sigset_t sa_mask; /* mask last for extensibility */
133};
134
135struct k_sigaction {
136 struct sigaction sa;
137};
138
139#else
140/* Here we must cater to libcs that poke about in kernel headers. */
141
142struct sigaction {
143 union {
144 __sighandler_t _sa_handler;
145 void (*_sa_sigaction)(int, struct siginfo *, void *);
146 } _u;
147 sigset_t sa_mask;
148 unsigned long sa_flags;
149 void (*sa_restorer)(void);
150};
151
152#define sa_handler _u._sa_handler
153#define sa_sigaction _u._sa_sigaction
154
155#endif /* __KERNEL__ */
156
157typedef struct sigaltstack {
158 void *ss_sp;
159 int ss_flags;
160 size_t ss_size;
161} stack_t;
162
163#ifdef __KERNEL__
164#include <asm/sigcontext.h>
165
166#define sigmask(sig) (1UL << ((sig) - 1))
167#endif
168
169
170#ifdef __KERNEL__
171#include <asm/sigcontext.h>
172#define ptrace_signal_deliver(regs, cookie) do { } while (0)
173#endif
174
175
176#endif
diff --git a/include/asm-arm26/sizes.h b/include/asm-arm26/sizes.h
deleted file mode 100644
index f8d92ca12040..000000000000
--- a/include/asm-arm26/sizes.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 */
16/* DO NOT EDIT!! - this file automatically generated
17 * from .s file by awk -f s2h.awk
18 */
19/* Size defintions
20 * Copyright (C) ARM Limited 1998. All rights reserved.
21 */
22
23#ifndef __sizes_h
24#define __sizes_h 1
25
26/* handy sizes */
27#define SZ_1K 0x00000400
28#define SZ_4K 0x00001000
29#define SZ_8K 0x00002000
30#define SZ_16K 0x00004000
31#define SZ_64K 0x00010000
32#define SZ_128K 0x00020000
33#define SZ_256K 0x00040000
34#define SZ_512K 0x00080000
35
36#define SZ_1M 0x00100000
37#define SZ_2M 0x00200000
38#define SZ_4M 0x00400000
39#define SZ_8M 0x00800000
40#define SZ_16M 0x01000000
41#define SZ_32M 0x02000000
42#define SZ_64M 0x04000000
43#define SZ_128M 0x08000000
44#define SZ_256M 0x10000000
45#define SZ_512M 0x20000000
46
47#define SZ_1G 0x40000000
48#define SZ_2G 0x80000000
49
50#endif
51
52/* END */
diff --git a/include/asm-arm26/smp.h b/include/asm-arm26/smp.h
deleted file mode 100644
index 38349ec8b61b..000000000000
--- a/include/asm-arm26/smp.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef __ASM_SMP_H
2#define __ASM_SMP_H
3
4
5#ifdef CONFIG_SMP
6#error SMP not supported
7#endif
8
9#endif
diff --git a/include/asm-arm26/socket.h b/include/asm-arm26/socket.h
deleted file mode 100644
index 65a1a64bf934..000000000000
--- a/include/asm-arm26/socket.h
+++ /dev/null
@@ -1,55 +0,0 @@
1#ifndef _ASMARM_SOCKET_H
2#define _ASMARM_SOCKET_H
3
4#include <asm/sockios.h>
5
6/* For setsockopt(2) */
7#define SOL_SOCKET 1
8
9#define SO_DEBUG 1
10#define SO_REUSEADDR 2
11#define SO_TYPE 3
12#define SO_ERROR 4
13#define SO_DONTROUTE 5
14#define SO_BROADCAST 6
15#define SO_SNDBUF 7
16#define SO_RCVBUF 8
17#define SO_SNDBUFFORCE 32
18#define SO_RCVBUFFORCE 33
19#define SO_KEEPALIVE 9
20#define SO_OOBINLINE 10
21#define SO_NO_CHECK 11
22#define SO_PRIORITY 12
23#define SO_LINGER 13
24#define SO_BSDCOMPAT 14
25/* To add :#define SO_REUSEPORT 15 */
26#define SO_PASSCRED 16
27#define SO_PEERCRED 17
28#define SO_RCVLOWAT 18
29#define SO_SNDLOWAT 19
30#define SO_RCVTIMEO 20
31#define SO_SNDTIMEO 21
32
33/* Security levels - as per NRL IPv6 - don't actually do anything */
34#define SO_SECURITY_AUTHENTICATION 22
35#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
36#define SO_SECURITY_ENCRYPTION_NETWORK 24
37
38#define SO_BINDTODEVICE 25
39
40/* Socket filtering */
41#define SO_ATTACH_FILTER 26
42#define SO_DETACH_FILTER 27
43
44#define SO_PEERNAME 28
45#define SO_TIMESTAMP 29
46#define SCM_TIMESTAMP SO_TIMESTAMP
47
48#define SO_ACCEPTCONN 30
49
50#define SO_PEERSEC 31
51#define SO_PASSSEC 34
52#define SO_TIMESTAMPNS 35
53#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
54
55#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-arm26/sockios.h b/include/asm-arm26/sockios.h
deleted file mode 100644
index a2588a2512df..000000000000
--- a/include/asm-arm26/sockios.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef __ARCH_ARM_SOCKIOS_H
2#define __ARCH_ARM_SOCKIOS_H
3
4/* Socket-level I/O control calls. */
5#define FIOSETOWN 0x8901
6#define SIOCSPGRP 0x8902
7#define FIOGETOWN 0x8903
8#define SIOCGPGRP 0x8904
9#define SIOCATMARK 0x8905
10#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
11#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
12
13#endif
diff --git a/include/asm-arm26/spinlock.h b/include/asm-arm26/spinlock.h
deleted file mode 100644
index e92e81deb4fd..000000000000
--- a/include/asm-arm26/spinlock.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_SPINLOCK_H
2#define __ASM_SPINLOCK_H
3
4#error ARM architecture does not support SMP spin locks
5
6#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-arm26/stat.h b/include/asm-arm26/stat.h
deleted file mode 100644
index e4abc4fa0850..000000000000
--- a/include/asm-arm26/stat.h
+++ /dev/null
@@ -1,77 +0,0 @@
1#ifndef _ASMARM_STAT_H
2#define _ASMARM_STAT_H
3
4struct __old_kernel_stat {
5 unsigned short st_dev;
6 unsigned short st_ino;
7 unsigned short st_mode;
8 unsigned short st_nlink;
9 unsigned short st_uid;
10 unsigned short st_gid;
11 unsigned short st_rdev;
12 unsigned long st_size;
13 unsigned long st_atime;
14 unsigned long st_mtime;
15 unsigned long st_ctime;
16};
17
18struct stat {
19 unsigned short st_dev;
20 unsigned short __pad1;
21 unsigned long st_ino;
22 unsigned short st_mode;
23 unsigned short st_nlink;
24 unsigned short st_uid;
25 unsigned short st_gid;
26 unsigned short st_rdev;
27 unsigned short __pad2;
28 unsigned long st_size;
29 unsigned long st_blksize;
30 unsigned long st_blocks;
31 unsigned long st_atime;
32 unsigned long st_atime_nsec;
33 unsigned long st_mtime;
34 unsigned long st_mtime_nsec;
35 unsigned long st_ctime;
36 unsigned long st_ctime_nsec;
37 unsigned long __unused4;
38 unsigned long __unused5;
39};
40
41/* This matches struct stat64 in glibc2.1, hence the absolutely
42 * insane amounts of padding around dev_t's.
43 */
44struct stat64 {
45 unsigned long long st_dev;
46 unsigned char __pad0[4];
47
48#define STAT64_HAS_BROKEN_ST_INO 1
49 unsigned long __st_ino;
50 unsigned int st_mode;
51 unsigned int st_nlink;
52
53 unsigned long st_uid;
54 unsigned long st_gid;
55
56 unsigned long long st_rdev;
57 unsigned char __pad3[4];
58
59 long long st_size;
60 unsigned long st_blksize;
61
62 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
63 unsigned long __pad4; /* Future possible st_blocks hi bits */
64
65 unsigned long st_atime;
66 unsigned long st_atime_nsec;
67
68 unsigned long st_mtime;
69 unsigned long st_mtime_nsec;
70
71 unsigned long st_ctime;
72 unsigned long st_ctime_nsec;
73
74 unsigned long long st_ino;
75};
76
77#endif
diff --git a/include/asm-arm26/statfs.h b/include/asm-arm26/statfs.h
deleted file mode 100644
index 776dbc8f7623..000000000000
--- a/include/asm-arm26/statfs.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _ASMARM_STATFS_H
2#define _ASMARM_STATFS_H
3
4//FIXME - this may not be appropriate for arm26. check it out.
5
6#include <asm-generic/statfs.h>
7
8#endif
diff --git a/include/asm-arm26/string.h b/include/asm-arm26/string.h
deleted file mode 100644
index 2a8ab162412f..000000000000
--- a/include/asm-arm26/string.h
+++ /dev/null
@@ -1,43 +0,0 @@
1#ifndef __ASM_ARM_STRING_H
2#define __ASM_ARM_STRING_H
3
4/*
5 * We don't do inline string functions, since the
6 * optimised inline asm versions are not small.
7 */
8
9#define __HAVE_ARCH_STRRCHR
10extern char * strrchr(const char * s, int c);
11
12#define __HAVE_ARCH_STRCHR
13extern char * strchr(const char * s, int c);
14
15#define __HAVE_ARCH_MEMCPY
16extern void * memcpy(void *, const void *, __kernel_size_t);
17
18#define __HAVE_ARCH_MEMMOVE
19extern void * memmove(void *, const void *, __kernel_size_t);
20
21#define __HAVE_ARCH_MEMCHR
22extern void * memchr(const void *, int, __kernel_size_t);
23
24#define __HAVE_ARCH_MEMZERO
25#define __HAVE_ARCH_MEMSET
26extern void * memset(void *, int, __kernel_size_t);
27
28extern void __memzero(void *ptr, __kernel_size_t n);
29
30#define memset(p,v,n) \
31 ({ \
32 if ((n) != 0) { \
33 if (__builtin_constant_p((v)) && (v) == 0) \
34 __memzero((p),(n)); \
35 else \
36 memset((p),(v),(n)); \
37 } \
38 (p); \
39 })
40
41#define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); })
42
43#endif
diff --git a/include/asm-arm26/suspend.h b/include/asm-arm26/suspend.h
deleted file mode 100644
index 5e4c1cc0c19d..000000000000
--- a/include/asm-arm26/suspend.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifdef _ASMARM_SUSPEND_H
2#define _ASMARM_SUSPEND_H
3
4#endif
diff --git a/include/asm-arm26/sysirq.h b/include/asm-arm26/sysirq.h
deleted file mode 100644
index 81dca90d9a3f..000000000000
--- a/include/asm-arm26/sysirq.h
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-arc/irqs.h
3 *
4 * Copyright (C) 1996 Russell King, Dave Gilbert
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 * Modifications:
11 * 04-04-1998 PJB Merged arc and a5k versions
12 */
13
14
15#if defined(CONFIG_ARCH_A5K)
16#define IRQ_PRINTER 0
17#define IRQ_BATLOW 1
18#define IRQ_FLOPPYINDEX 2
19#define IRQ_FLOPPYDISK 12
20#elif defined(CONFIG_ARCH_ARC)
21#define IRQ_PRINTERBUSY 0
22#define IRQ_SERIALRING 1
23#define IRQ_PRINTERACK 2
24#define IRQ_FLOPPYCHANGED 12
25#endif
26
27#define IRQ_VSYNCPULSE 3
28#define IRQ_POWERON 4
29#define IRQ_TIMER0 5
30#define IRQ_TIMER1 6
31#define IRQ_IMMEDIATE 7
32#define IRQ_EXPCARDFIQ 8
33#define IRQ_SOUNDCHANGE 9
34#define IRQ_SERIALPORT 10
35#define IRQ_HARDDISK 11
36#define IRQ_EXPANSIONCARD 13
37#define IRQ_KEYBOARDTX 14
38#define IRQ_KEYBOARDRX 15
39
40#if defined(CONFIG_ARCH_A5K)
41#define FIQ_SERIALPORT 4
42#elif defined(CONFIG_ARCH_ARC)
43#define FIQ_FLOPPYIRQ 1
44#define FIQ_FD1772 FIQ_FLOPPYIRQ
45#endif
46
47#define FIQ_FLOPPYDATA 0
48#define FIQ_ECONET 2
49#define FIQ_EXPANSIONCARD 6
50#define FIQ_FORCE 7
51
52#define IRQ_TIMER IRQ_TIMER0
53
54/*
55 * This is the offset of the FIQ "IRQ" numbers
56 */
57#define FIQ_START 64
58
59#define irq_cannonicalize(i) (i)
60
diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h
deleted file mode 100644
index 4703593b3bb5..000000000000
--- a/include/asm-arm26/system.h
+++ /dev/null
@@ -1,257 +0,0 @@
1#ifndef __ASM_ARM_SYSTEM_H
2#define __ASM_ARM_SYSTEM_H
3
4#ifdef __KERNEL__
5
6
7/*
8 * This is used to ensure the compiler did actually allocate the register we
9 * asked it for some inline assembly sequences. Apparently we can't trust
10 * the compiler from one version to another so a bit of paranoia won't hurt.
11 * This string is meant to be concatenated with the inline asm string and
12 * will cause compilation to stop on mismatch. (From ARM32 - may come in handy)
13 */
14#define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t"
15
16#ifndef __ASSEMBLY__
17
18#include <linux/linkage.h>
19
20struct thread_info;
21struct task_struct;
22
23#if 0
24/* information about the system we're running on */
25extern unsigned int system_rev;
26extern unsigned int system_serial_low;
27extern unsigned int system_serial_high;
28extern unsigned int mem_fclk_21285;
29
30FIXME - sort this
31/*
32 * We need to turn the caches off before calling the reset vector - RiscOS
33 * messes up if we don't
34 */
35#define proc_hard_reset() cpu_proc_fin()
36
37#endif
38
39struct pt_regs;
40
41void die(const char *msg, struct pt_regs *regs, int err)
42 __attribute__((noreturn));
43
44void die_if_kernel(const char *str, struct pt_regs *regs, int err);
45
46void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
47 struct pt_regs *),
48 int sig, const char *name);
49
50#include <asm/proc-fns.h>
51
52#define xchg(ptr,x) \
53 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
54
55extern asmlinkage void __backtrace(void);
56
57#define set_cr(x) \
58 __asm__ __volatile__( \
59 "mcr p15, 0, %0, c1, c0, 0 @ set CR" \
60 : : "r" (x) : "cc")
61
62#define get_cr() \
63 ({ \
64 unsigned int __val; \
65 __asm__ __volatile__( \
66 "mrc p15, 0, %0, c1, c0, 0 @ get CR" \
67 : "=r" (__val) : : "cc"); \
68 __val; \
69 })
70
71extern unsigned long cr_no_alignment; /* defined in entry-armv.S */
72extern unsigned long cr_alignment; /* defined in entry-armv.S */
73
74#define UDBG_UNDEFINED (1 << 0)
75#define UDBG_SYSCALL (1 << 1)
76#define UDBG_BADABORT (1 << 2)
77#define UDBG_SEGV (1 << 3)
78#define UDBG_BUS (1 << 4)
79
80extern unsigned int user_debug;
81
82#define vectors_base() (0)
83
84#define mb() __asm__ __volatile__ ("" : : : "memory")
85#define rmb() mb()
86#define wmb() mb()
87#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
88
89#define read_barrier_depends() do { } while(0)
90#define set_mb(var, value) do { var = value; mb(); } while (0)
91
92/*
93 * We assume knowledge of how
94 * spin_unlock_irq() and friends are implemented. This avoids
95 * us needlessly decrementing and incrementing the preempt count.
96 */
97#define prepare_arch_switch(next) local_irq_enable()
98#define finish_arch_switch(prev) spin_unlock(&(rq)->lock)
99
100/*
101 * switch_to(prev, next) should switch from task `prev' to `next'
102 * `prev' will never be the same as `next'. schedule() itself
103 * contains the memory barrier to tell GCC not to cache `current'.
104 */
105extern struct task_struct *__switch_to(struct task_struct *, struct thread_info *, struct thread_info *);
106
107#define switch_to(prev,next,last) \
108do { \
109 last = __switch_to(prev,task_thread_info(prev),task_thread_info(next)); \
110} while (0)
111
112/*
113 * On SMP systems, when the scheduler does migration-cost autodetection,
114 * it needs a way to flush as much of the CPU's caches as possible.
115 *
116 * TODO: fill this in!
117 */
118static inline void sched_cacheflush(void)
119{
120}
121
122/*
123 * Save the current interrupt enable state & disable IRQs
124 */
125#define local_irq_save(x) \
126 do { \
127 unsigned long temp; \
128 __asm__ __volatile__( \
129" mov %0, pc @ save_flags_cli\n" \
130" orr %1, %0, #0x08000000\n" \
131" and %0, %0, #0x0c000000\n" \
132" teqp %1, #0\n" \
133 : "=r" (x), "=r" (temp) \
134 : \
135 : "memory"); \
136 } while (0)
137
138/*
139 * Enable IRQs (sti)
140 */
141#define local_irq_enable() \
142 do { \
143 unsigned long temp; \
144 __asm__ __volatile__( \
145" mov %0, pc @ sti\n" \
146" bic %0, %0, #0x08000000\n" \
147" teqp %0, #0\n" \
148 : "=r" (temp) \
149 : \
150 : "memory"); \
151 } while(0)
152
153/*
154 * Disable IRQs (cli)
155 */
156#define local_irq_disable() \
157 do { \
158 unsigned long temp; \
159 __asm__ __volatile__( \
160" mov %0, pc @ cli\n" \
161" orr %0, %0, #0x08000000\n" \
162" teqp %0, #0\n" \
163 : "=r" (temp) \
164 : \
165 : "memory"); \
166 } while(0)
167
168/* Enable FIQs (stf) */
169
170#define __stf() do { \
171 unsigned long temp; \
172 __asm__ __volatile__( \
173" mov %0, pc @ stf\n" \
174" bic %0, %0, #0x04000000\n" \
175" teqp %0, #0\n" \
176 : "=r" (temp)); \
177 } while(0)
178
179/* Disable FIQs (clf) */
180
181#define __clf() do { \
182 unsigned long temp; \
183 __asm__ __volatile__( \
184" mov %0, pc @ clf\n" \
185" orr %0, %0, #0x04000000\n" \
186" teqp %0, #0\n" \
187 : "=r" (temp)); \
188 } while(0)
189
190
191/*
192 * Save the current interrupt enable state.
193 */
194#define local_save_flags(x) \
195 do { \
196 __asm__ __volatile__( \
197" mov %0, pc @ save_flags\n" \
198" and %0, %0, #0x0c000000\n" \
199 : "=r" (x)); \
200 } while (0)
201
202
203/*
204 * restore saved IRQ & FIQ state
205 */
206#define local_irq_restore(x) \
207 do { \
208 unsigned long temp; \
209 __asm__ __volatile__( \
210" mov %0, pc @ restore_flags\n" \
211" bic %0, %0, #0x0c000000\n" \
212" orr %0, %0, %1\n" \
213" teqp %0, #0\n" \
214 : "=&r" (temp) \
215 : "r" (x) \
216 : "memory"); \
217 } while (0)
218
219
220#ifdef CONFIG_SMP
221#error SMP not supported
222#endif
223
224#define smp_mb() barrier()
225#define smp_rmb() barrier()
226#define smp_wmb() barrier()
227#define smp_read_barrier_depends() do { } while(0)
228
229#define clf() __clf()
230#define stf() __stf()
231
232#define irqs_disabled() \
233({ \
234 unsigned long flags; \
235 local_save_flags(flags); \
236 flags & PSR_I_BIT; \
237})
238
239static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
240{
241 extern void __bad_xchg(volatile void *, int);
242
243 switch (size) {
244 case 1: return cpu_xchg_1(x, ptr);
245 case 4: return cpu_xchg_4(x, ptr);
246 default: __bad_xchg(ptr, size);
247 }
248 return 0;
249}
250
251#endif /* __ASSEMBLY__ */
252
253#define arch_align_stack(x) (x)
254
255#endif /* __KERNEL__ */
256
257#endif
diff --git a/include/asm-arm26/termbits.h b/include/asm-arm26/termbits.h
deleted file mode 100644
index 48d2f5c7bcb8..000000000000
--- a/include/asm-arm26/termbits.h
+++ /dev/null
@@ -1,196 +0,0 @@
1#ifndef __ASM_ARM_TERMBITS_H
2#define __ASM_ARM_TERMBITS_H
3
4typedef unsigned char cc_t;
5typedef unsigned int speed_t;
6typedef unsigned int tcflag_t;
7
8#define NCCS 19
9struct termios {
10 tcflag_t c_iflag; /* input mode flags */
11 tcflag_t c_oflag; /* output mode flags */
12 tcflag_t c_cflag; /* control mode flags */
13 tcflag_t c_lflag; /* local mode flags */
14 cc_t c_line; /* line discipline */
15 cc_t c_cc[NCCS]; /* control characters */
16};
17
18struct termios2 {
19 tcflag_t c_iflag; /* input mode flags */
20 tcflag_t c_oflag; /* output mode flags */
21 tcflag_t c_cflag; /* control mode flags */
22 tcflag_t c_lflag; /* local mode flags */
23 cc_t c_line; /* line discipline */
24 cc_t c_cc[NCCS]; /* control characters */
25 speed_t c_ispeed; /* input speed */
26 speed_t c_ospeed; /* output speed */
27};
28
29struct ktermios {
30 tcflag_t c_iflag; /* input mode flags */
31 tcflag_t c_oflag; /* output mode flags */
32 tcflag_t c_cflag; /* control mode flags */
33 tcflag_t c_lflag; /* local mode flags */
34 cc_t c_line; /* line discipline */
35 cc_t c_cc[NCCS]; /* control characters */
36 speed_t c_ispeed; /* input speed */
37 speed_t c_ospeed; /* output speed */
38};
39
40/* c_cc characters */
41#define VINTR 0
42#define VQUIT 1
43#define VERASE 2
44#define VKILL 3
45#define VEOF 4
46#define VTIME 5
47#define VMIN 6
48#define VSWTC 7
49#define VSTART 8
50#define VSTOP 9
51#define VSUSP 10
52#define VEOL 11
53#define VREPRINT 12
54#define VDISCARD 13
55#define VWERASE 14
56#define VLNEXT 15
57#define VEOL2 16
58
59/* c_iflag bits */
60#define IGNBRK 0000001
61#define BRKINT 0000002
62#define IGNPAR 0000004
63#define PARMRK 0000010
64#define INPCK 0000020
65#define ISTRIP 0000040
66#define INLCR 0000100
67#define IGNCR 0000200
68#define ICRNL 0000400
69#define IUCLC 0001000
70#define IXON 0002000
71#define IXANY 0004000
72#define IXOFF 0010000
73#define IMAXBEL 0020000
74#define IUTF8 0040000
75
76/* c_oflag bits */
77#define OPOST 0000001
78#define OLCUC 0000002
79#define ONLCR 0000004
80#define OCRNL 0000010
81#define ONOCR 0000020
82#define ONLRET 0000040
83#define OFILL 0000100
84#define OFDEL 0000200
85#define NLDLY 0000400
86#define NL0 0000000
87#define NL1 0000400
88#define CRDLY 0003000
89#define CR0 0000000
90#define CR1 0001000
91#define CR2 0002000
92#define CR3 0003000
93#define TABDLY 0014000
94#define TAB0 0000000
95#define TAB1 0004000
96#define TAB2 0010000
97#define TAB3 0014000
98#define XTABS 0014000
99#define BSDLY 0020000
100#define BS0 0000000
101#define BS1 0020000
102#define VTDLY 0040000
103#define VT0 0000000
104#define VT1 0040000
105#define FFDLY 0100000
106#define FF0 0000000
107#define FF1 0100000
108
109/* c_cflag bit meaning */
110#define CBAUD 0010017
111#define B0 0000000 /* hang up */
112#define B50 0000001
113#define B75 0000002
114#define B110 0000003
115#define B134 0000004
116#define B150 0000005
117#define B200 0000006
118#define B300 0000007
119#define B600 0000010
120#define B1200 0000011
121#define B1800 0000012
122#define B2400 0000013
123#define B4800 0000014
124#define B9600 0000015
125#define B19200 0000016
126#define B38400 0000017
127#define EXTA B19200
128#define EXTB B38400
129#define CSIZE 0000060
130#define CS5 0000000
131#define CS6 0000020
132#define CS7 0000040
133#define CS8 0000060
134#define CSTOPB 0000100
135#define CREAD 0000200
136#define PARENB 0000400
137#define PARODD 0001000
138#define HUPCL 0002000
139#define CLOCAL 0004000
140#define CBAUDEX 0010000
141#define BOTHER 0010000
142#define B57600 0010001
143#define B115200 0010002
144#define B230400 0010003
145#define B460800 0010004
146#define B500000 0010005
147#define B576000 0010006
148#define B921600 0010007
149#define B1000000 0010010
150#define B1152000 0010011
151#define B1500000 0010012
152#define B2000000 0010013
153#define B2500000 0010014
154#define B3000000 0010015
155#define B3500000 0010016
156#define B4000000 0010017
157#define CIBAUD 002003600000 /* input baud rate */
158#define CMSPAR 010000000000 /* mark or space (stick) parity */
159#define CRTSCTS 020000000000 /* flow control */
160
161#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
162
163/* c_lflag bits */
164#define ISIG 0000001
165#define ICANON 0000002
166#define XCASE 0000004
167#define ECHO 0000010
168#define ECHOE 0000020
169#define ECHOK 0000040
170#define ECHONL 0000100
171#define NOFLSH 0000200
172#define TOSTOP 0000400
173#define ECHOCTL 0001000
174#define ECHOPRT 0002000
175#define ECHOKE 0004000
176#define FLUSHO 0010000
177#define PENDIN 0040000
178#define IEXTEN 0100000
179
180/* tcflow() and TCXONC use these */
181#define TCOOFF 0
182#define TCOON 1
183#define TCIOFF 2
184#define TCION 3
185
186/* tcflush() and TCFLSH use these */
187#define TCIFLUSH 0
188#define TCOFLUSH 1
189#define TCIOFLUSH 2
190
191/* tcsetattr uses these */
192#define TCSANOW 0
193#define TCSADRAIN 1
194#define TCSAFLUSH 2
195
196#endif /* __ASM_ARM_TERMBITS_H */
diff --git a/include/asm-arm26/termios.h b/include/asm-arm26/termios.h
deleted file mode 100644
index 293e3f1bc3f2..000000000000
--- a/include/asm-arm26/termios.h
+++ /dev/null
@@ -1,92 +0,0 @@
1#ifndef __ASM_ARM_TERMIOS_H
2#define __ASM_ARM_TERMIOS_H
3
4#include <asm/termbits.h>
5#include <asm/ioctls.h>
6
7struct winsize {
8 unsigned short ws_row;
9 unsigned short ws_col;
10 unsigned short ws_xpixel;
11 unsigned short ws_ypixel;
12};
13
14#define NCC 8
15struct termio {
16 unsigned short c_iflag; /* input mode flags */
17 unsigned short c_oflag; /* output mode flags */
18 unsigned short c_cflag; /* control mode flags */
19 unsigned short c_lflag; /* local mode flags */
20 unsigned char c_line; /* line discipline */
21 unsigned char c_cc[NCC]; /* control characters */
22};
23
24#ifdef __KERNEL__
25/* intr=^C quit=^| erase=del kill=^U
26 eof=^D vtime=\0 vmin=\1 sxtc=\0
27 start=^Q stop=^S susp=^Z eol=\0
28 reprint=^R discard=^U werase=^W lnext=^V
29 eol2=\0
30*/
31#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
32#endif
33
34/* modem lines */
35#define TIOCM_LE 0x001
36#define TIOCM_DTR 0x002
37#define TIOCM_RTS 0x004
38#define TIOCM_ST 0x008
39#define TIOCM_SR 0x010
40#define TIOCM_CTS 0x020
41#define TIOCM_CAR 0x040
42#define TIOCM_RNG 0x080
43#define TIOCM_DSR 0x100
44#define TIOCM_CD TIOCM_CAR
45#define TIOCM_RI TIOCM_RNG
46#define TIOCM_OUT1 0x2000
47#define TIOCM_OUT2 0x4000
48#define TIOCM_LOOP 0x8000
49
50/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
51
52#ifdef __KERNEL__
53
54/*
55 * Translate a "termio" structure into a "termios". Ugh.
56 */
57#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
58 unsigned short __tmp; \
59 get_user(__tmp,&(termio)->x); \
60 *(unsigned short *) &(termios)->x = __tmp; \
61}
62
63#define user_termio_to_kernel_termios(termios, termio) \
64({ \
65 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
66 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
67 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
68 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
69 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
70})
71
72/*
73 * Translate a "termios" structure into a "termio". Ugh.
74 */
75#define kernel_termios_to_user_termio(termio, termios) \
76({ \
77 put_user((termios)->c_iflag, &(termio)->c_iflag); \
78 put_user((termios)->c_oflag, &(termio)->c_oflag); \
79 put_user((termios)->c_cflag, &(termio)->c_cflag); \
80 put_user((termios)->c_lflag, &(termio)->c_lflag); \
81 put_user((termios)->c_line, &(termio)->c_line); \
82 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
83})
84
85#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
86#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
87#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
88#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
89
90#endif /* __KERNEL__ */
91
92#endif /* __ASM_ARM_TERMIOS_H */
diff --git a/include/asm-arm26/thread_info.h b/include/asm-arm26/thread_info.h
deleted file mode 100644
index 9b367ebe515d..000000000000
--- a/include/asm-arm26/thread_info.h
+++ /dev/null
@@ -1,140 +0,0 @@
1/*
2 * linux/include/asm-arm26/thread_info.h
3 *
4 * Copyright (C) 2002 Russell King.
5 * Copyright (C) 2003 Ian Molton.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef __ASM_ARM_THREAD_INFO_H
12#define __ASM_ARM_THREAD_INFO_H
13
14#ifdef __KERNEL__
15
16#ifndef __ASSEMBLY__
17
18struct task_struct;
19struct exec_domain;
20
21#include <linux/compiler.h>
22#include <asm/fpstate.h>
23#include <asm/ptrace.h>
24#include <asm/types.h>
25
26typedef unsigned long mm_segment_t;
27
28struct cpu_context_save {
29 __u32 r4;
30 __u32 r5;
31 __u32 r6;
32 __u32 r7;
33 __u32 r8;
34 __u32 r9;
35 __u32 sl;
36 __u32 fp;
37 __u32 sp;
38 __u32 pc;
39};
40
41/*
42 * low level task data that entry.S needs immediate access to.
43 * We assume cpu_context follows immedately after cpu_domain.
44 */
45struct thread_info {
46 unsigned long flags; /* low level flags */
47 int preempt_count; /* 0 => preemptable, <0 => bug */
48 mm_segment_t addr_limit; /* address limit */
49 struct task_struct *task; /* main task structure */
50 struct exec_domain *exec_domain; /* execution domain */
51 __u32 cpu; /* cpu */
52 struct cpu_context_save cpu_context; /* cpu context */
53 struct restart_block restart_block;
54 union fp_state fpstate;
55};
56
57#define INIT_THREAD_INFO(tsk) \
58{ \
59 .task &tsk, \
60 .exec_domain &default_exec_domain, \
61 .flags 0, \
62 .preempt_count 0, \
63 .addr_limit KERNEL_DS, \
64 .restart_block = { \
65 .fn = do_no_restart_syscall, \
66 }, \
67}
68
69#define init_thread_info (init_thread_union.thread_info)
70#define init_stack (init_thread_union.stack)
71
72/*
73 * how to get the thread information struct from C
74 */
75static inline struct thread_info *current_thread_info(void) __attribute_const__;
76
77static inline struct thread_info *current_thread_info(void)
78{
79 register unsigned long sp asm ("sp");
80 return (struct thread_info *)(sp & ~0x1fff);
81}
82
83#define THREAD_SIZE PAGE_SIZE
84#define task_pt_regs(task) ((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE - 8) - 1)
85
86extern struct thread_info *alloc_thread_info(struct task_struct *task);
87extern void free_thread_info(struct thread_info *);
88
89#define thread_saved_pc(tsk) \
90 ((unsigned long)(pc_pointer(task_thread_info(tsk)->cpu_context.pc)))
91#define thread_saved_fp(tsk) \
92 ((unsigned long)(task_thread_info(tsk)->cpu_context.fp))
93
94#else /* !__ASSEMBLY__ */
95
96#define TI_FLAGS 0
97#define TI_PREEMPT 4
98#define TI_ADDR_LIMIT 8
99#define TI_TASK 12
100#define TI_EXEC_DOMAIN 16
101#define TI_CPU 20
102#define TI_CPU_SAVE 24
103#define TI_RESTART_BLOCK 28
104#define TI_FPSTATE 68
105
106#endif
107
108#define PREEMPT_ACTIVE 0x04000000
109
110/*
111 * thread information flags:
112 * TIF_SYSCALL_TRACE - syscall trace active
113 * TIF_NOTIFY_RESUME - resumption notification requested
114 * TIF_SIGPENDING - signal pending
115 * TIF_NEED_RESCHED - rescheduling necessary
116 * TIF_USEDFPU - FPU was used by this task this quantum (SMP)
117 * TIF_POLLING_NRFLAG - true if poll_idle() is polling TIF_NEED_RESCHED
118 */
119#define TIF_NOTIFY_RESUME 0
120#define TIF_SIGPENDING 1
121#define TIF_NEED_RESCHED 2
122#define TIF_SYSCALL_TRACE 8
123#define TIF_USED_FPU 16
124#define TIF_POLLING_NRFLAG 17
125#define TIF_MEMDIE 18
126
127#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
128#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
129#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
130#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
131#define _TIF_USED_FPU (1 << TIF_USED_FPU)
132#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
133
134/*
135 * Change these and you break ASM code in entry-common.S
136 */
137#define _TIF_WORK_MASK 0x000000ff
138
139#endif /* __KERNEL__ */
140#endif /* __ASM_ARM_THREAD_INFO_H */
diff --git a/include/asm-arm26/timex.h b/include/asm-arm26/timex.h
deleted file mode 100644
index 68322fbc1aed..000000000000
--- a/include/asm-arm26/timex.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * linux/include/asm-arm/timex.h
3 *
4 * Copyright (C) 1997,1998 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 * Architecture Specific TIME specifications
11 */
12#ifndef _ASMARM_TIMEX_H
13#define _ASMARM_TIMEX_H
14
15/*
16 * On the RiscPC, the clock ticks at 2MHz.
17 */
18#define CLOCK_TICK_RATE 2000000
19
20/* IS THAT RIGHT ON A5000? FIXME */
21
22typedef unsigned long cycles_t;
23
24static inline cycles_t get_cycles (void)
25{
26 return 0;
27}
28
29#endif
diff --git a/include/asm-arm26/tlb.h b/include/asm-arm26/tlb.h
deleted file mode 100644
index 08ddd85b8d35..000000000000
--- a/include/asm-arm26/tlb.h
+++ /dev/null
@@ -1,63 +0,0 @@
1#ifndef __ASMARM_TLB_H
2#define __ASMARM_TLB_H
3
4#include <asm/pgalloc.h>
5#include <asm/tlbflush.h>
6
7/*
8 * TLB handling. This allows us to remove pages from the page
9 * tables, and efficiently handle the TLB issues.
10 */
11struct mmu_gather {
12 struct mm_struct *mm;
13 unsigned int need_flush;
14 unsigned int fullmm;
15};
16
17DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
18
19static inline struct mmu_gather *
20tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
21{
22 struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
23
24 tlb->mm = mm;
25 tlb->need_flush = 0;
26 tlb->fullmm = full_mm_flush;
27
28 return tlb;
29}
30
31static inline void
32tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
33{
34 if (tlb->need_flush)
35 flush_tlb_mm(tlb->mm);
36
37 /* keep the page table cache within bounds */
38 check_pgt_cache();
39
40 put_cpu_var(mmu_gathers);
41}
42
43#define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0)
44//#define tlb_start_vma(tlb,vma) do { } while (0)
45//FIXME - ARM32 uses this now that things changed in the kernel. seems like it may be pointless on arm26, however to get things compiling...
46#define tlb_start_vma(tlb,vma) \
47 do { \
48 if (!tlb->fullmm) \
49 flush_cache_range(vma, vma->vm_start, vma->vm_end); \
50 } while (0)
51#define tlb_end_vma(tlb,vma) do { } while (0)
52
53static inline void
54tlb_remove_page(struct mmu_gather *tlb, struct page *page)
55{
56 tlb->need_flush = 1;
57 free_page_and_swap_cache(page);
58}
59
60#define pte_free_tlb(tlb,ptep) pte_free(ptep)
61#define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp)
62
63#endif
diff --git a/include/asm-arm26/tlbflush.h b/include/asm-arm26/tlbflush.h
deleted file mode 100644
index f79c1cbf4f69..000000000000
--- a/include/asm-arm26/tlbflush.h
+++ /dev/null
@@ -1,70 +0,0 @@
1#ifndef __ASMARM_TLBFLUSH_H
2#define __ASMARM_TLBFLUSH_H
3
4/*
5 * TLB flushing:
6 *
7 * - flush_tlb_all() flushes all processes TLBs
8 * - flush_tlb_mm(mm) flushes the specified mm context TLB's
9 * - flush_tlb_page(vma, vmaddr) flushes one page
10 * - flush_tlb_range(vma, start, end) flushes a range of pages
11 */
12
13#define flush_tlb_all() memc_update_all()
14#define flush_tlb_mm(mm) memc_update_mm(mm)
15#define flush_tlb_page(vma, vmaddr) do { printk("flush_tlb_page\n");} while (0) // IS THIS RIGHT?
16#define flush_tlb_range(vma,start,end) \
17 do { memc_update_mm(vma->vm_mm); (void)(start); (void)(end); } while (0)
18#define flush_tlb_pgtables(mm,start,end) do { printk("flush_tlb_pgtables\n");} while (0)
19#define flush_tlb_kernel_range(s,e) do { printk("flush_tlb_range\n");} while (0)
20
21/*
22 * The following handle the weird MEMC chip
23 */
24static inline void memc_update_all(void)
25{
26 struct task_struct *p;
27 cpu_memc_update_all(init_mm.pgd);
28 for_each_process(p) {
29 if (!p->mm)
30 continue;
31 cpu_memc_update_all(p->mm->pgd);
32 }
33 processor._set_pgd(current->active_mm->pgd);
34}
35
36static inline void memc_update_mm(struct mm_struct *mm)
37{
38 cpu_memc_update_all(mm->pgd);
39
40 if (mm == current->active_mm)
41 processor._set_pgd(mm->pgd);
42}
43
44static inline void
45memc_clear(struct mm_struct *mm, struct page *page)
46{
47 cpu_memc_update_entry(mm->pgd, (unsigned long) page_address(page), 0);
48
49 if (mm == current->active_mm)
50 processor._set_pgd(mm->pgd);
51}
52
53static inline void
54memc_update_addr(struct mm_struct *mm, pte_t pte, unsigned long vaddr)
55{
56 cpu_memc_update_entry(mm->pgd, pte_val(pte), vaddr);
57
58 if (mm == current->active_mm)
59 processor._set_pgd(mm->pgd);
60}
61
62static inline void
63update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
64{
65 struct mm_struct *mm = vma->vm_mm;
66printk("update_mmu_cache\n");
67 memc_update_addr(mm, pte, addr);
68}
69
70#endif
diff --git a/include/asm-arm26/topology.h b/include/asm-arm26/topology.h
deleted file mode 100644
index accbd7cad9b5..000000000000
--- a/include/asm-arm26/topology.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _ASM_ARM_TOPOLOGY_H
2#define _ASM_ARM_TOPOLOGY_H
3
4#include <asm-generic/topology.h>
5
6#endif /* _ASM_ARM_TOPOLOGY_H */
diff --git a/include/asm-arm26/types.h b/include/asm-arm26/types.h
deleted file mode 100644
index 81bd357ada02..000000000000
--- a/include/asm-arm26/types.h
+++ /dev/null
@@ -1,59 +0,0 @@
1#ifndef __ASM_ARM_TYPES_H
2#define __ASM_ARM_TYPES_H
3
4#ifndef __ASSEMBLY__
5
6typedef unsigned short umode_t;
7
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
23typedef __signed__ long long __s64;
24typedef unsigned long long __u64;
25#endif
26
27#endif /* __ASSEMBLY__ */
28
29/*
30 * These aren't exported outside the kernel to avoid name space clashes
31 */
32#ifdef __KERNEL__
33
34#define BITS_PER_LONG 32
35
36#ifndef __ASSEMBLY__
37
38typedef signed char s8;
39typedef unsigned char u8;
40
41typedef signed short s16;
42typedef unsigned short u16;
43
44typedef signed int s32;
45typedef unsigned int u32;
46
47typedef signed long long s64;
48typedef unsigned long long u64;
49
50/* Dma addresses are 32-bits wide. */
51
52typedef u32 dma_addr_t;
53typedef u32 dma64_addr_t;
54
55#endif /* __ASSEMBLY__ */
56
57#endif /* __KERNEL__ */
58
59#endif
diff --git a/include/asm-arm26/uaccess-asm.h b/include/asm-arm26/uaccess-asm.h
deleted file mode 100644
index ade76ec02995..000000000000
--- a/include/asm-arm26/uaccess-asm.h
+++ /dev/null
@@ -1,153 +0,0 @@
1/*
2 * linux/include/asm-arm/proc-armo/uaccess.h
3 *
4 * Copyright (C) 1996 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
11/*
12 * The fs functions are implemented on the ARM2 and ARM3 architectures
13 * manually.
14 * Use *_user functions to access user memory with faulting behaving
15 * as though the user is accessing the memory.
16 * Use set_fs(get_ds()) and then the *_user functions to allow them to
17 * access kernel memory.
18 */
19
20/*
21 * These are the values used to represent the user `fs' and the kernel `ds'
22 * FIXME - the KERNEL_DS should end at 0x03000000 but we want to access ROM at
23 * 0x03400000. ideally we want to forbid access to the IO space inbetween.
24 */
25#define KERNEL_DS 0x03FFFFFF
26#define USER_DS 0x02000000
27
28extern uaccess_t uaccess_user, uaccess_kernel;
29
30static inline void set_fs (mm_segment_t fs)
31{
32 current_thread_info()->addr_limit = fs;
33 current->thread.uaccess = (fs == USER_DS ? &uaccess_user : &uaccess_kernel);
34}
35
36#define __range_ok(addr,size) ({ \
37 unsigned long flag, roksum; \
38 __asm__ __volatile__("subs %1, %0, %3; cmpcs %1, %2; movcs %0, #0" \
39 : "=&r" (flag), "=&r" (roksum) \
40 : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \
41 : "cc"); \
42 flag; })
43
44#define __addr_ok(addr) ({ \
45 unsigned long flag; \
46 __asm__ __volatile__("cmp %2, %0; movlo %0, #0" \
47 : "=&r" (flag) \
48 : "0" (current_thread_info()->addr_limit), "r" (addr) \
49 : "cc"); \
50 (flag == 0); })
51
52#define __put_user_asm_byte(x,addr,err) \
53 __asm__ __volatile__( \
54 " mov r0, %1\n" \
55 " mov r1, %2\n" \
56 " mov r2, %0\n" \
57 " mov lr, pc\n" \
58 " mov pc, %3\n" \
59 " mov %0, r2\n" \
60 : "=r" (err) \
61 : "r" (x), "r" (addr), "r" (current->thread.uaccess->put_byte), \
62 "0" (err) \
63 : "r0", "r1", "r2", "lr")
64
65#define __put_user_asm_half(x,addr,err) \
66 __asm__ __volatile__( \
67 " mov r0, %1\n" \
68 " mov r1, %2\n" \
69 " mov r2, %0\n" \
70 " mov lr, pc\n" \
71 " mov pc, %3\n" \
72 " mov %0, r2\n" \
73 : "=r" (err) \
74 : "r" (x), "r" (addr), "r" (current->thread.uaccess->put_half), \
75 "0" (err) \
76 : "r0", "r1", "r2", "lr")
77
78#define __put_user_asm_word(x,addr,err) \
79 __asm__ __volatile__( \
80 " mov r0, %1\n" \
81 " mov r1, %2\n" \
82 " mov r2, %0\n" \
83 " mov lr, pc\n" \
84 " mov pc, %3\n" \
85 " mov %0, r2\n" \
86 : "=r" (err) \
87 : "r" (x), "r" (addr), "r" (current->thread.uaccess->put_word), \
88 "0" (err) \
89 : "r0", "r1", "r2", "lr")
90
91#define __put_user_asm_dword(x,addr,err) \
92 __asm__ __volatile__( \
93 " mov r0, %1\n" \
94 " mov r1, %2\n" \
95 " mov r2, %0\n" \
96 " mov lr, pc\n" \
97 " mov pc, %3\n" \
98 " mov %0, r2\n" \
99 : "=r" (err) \
100 : "r" (x), "r" (addr), "r" (current->thread.uaccess->put_dword), \
101 "0" (err) \
102 : "r0", "r1", "r2", "lr")
103
104#define __get_user_asm_byte(x,addr,err) \
105 __asm__ __volatile__( \
106 " mov r0, %2\n" \
107 " mov r1, %0\n" \
108 " mov lr, pc\n" \
109 " mov pc, %3\n" \
110 " mov %0, r1\n" \
111 " mov %1, r0\n" \
112 : "=r" (err), "=r" (x) \
113 : "r" (addr), "r" (current->thread.uaccess->get_byte), "0" (err) \
114 : "r0", "r1", "r2", "lr")
115
116#define __get_user_asm_half(x,addr,err) \
117 __asm__ __volatile__( \
118 " mov r0, %2\n" \
119 " mov r1, %0\n" \
120 " mov lr, pc\n" \
121 " mov pc, %3\n" \
122 " mov %0, r1\n" \
123 " mov %1, r0\n" \
124 : "=r" (err), "=r" (x) \
125 : "r" (addr), "r" (current->thread.uaccess->get_half), "0" (err) \
126 : "r0", "r1", "r2", "lr")
127
128#define __get_user_asm_word(x,addr,err) \
129 __asm__ __volatile__( \
130 " mov r0, %2\n" \
131 " mov r1, %0\n" \
132 " mov lr, pc\n" \
133 " mov pc, %3\n" \
134 " mov %0, r1\n" \
135 " mov %1, r0\n" \
136 : "=r" (err), "=r" (x) \
137 : "r" (addr), "r" (current->thread.uaccess->get_word), "0" (err) \
138 : "r0", "r1", "r2", "lr")
139
140#define __do_copy_from_user(to,from,n) \
141 (n) = current->thread.uaccess->copy_from_user((to),(from),(n))
142
143#define __do_copy_to_user(to,from,n) \
144 (n) = current->thread.uaccess->copy_to_user((to),(from),(n))
145
146#define __do_clear_user(addr,sz) \
147 (sz) = current->thread.uaccess->clear_user((addr),(sz))
148
149#define __do_strncpy_from_user(dst,src,count,res) \
150 (res) = current->thread.uaccess->strncpy_from_user(dst,src,count)
151
152#define __do_strnlen_user(s,n,res) \
153 (res) = current->thread.uaccess->strnlen_user(s,n)
diff --git a/include/asm-arm26/uaccess.h b/include/asm-arm26/uaccess.h
deleted file mode 100644
index d64ed84cb2d3..000000000000
--- a/include/asm-arm26/uaccess.h
+++ /dev/null
@@ -1,293 +0,0 @@
1#ifndef _ASMARM_UACCESS_H
2#define _ASMARM_UACCESS_H
3
4/*
5 * User space memory access functions
6 */
7#include <linux/sched.h>
8#include <asm/errno.h>
9
10#define VERIFY_READ 0
11#define VERIFY_WRITE 1
12
13/*
14 * The exception table consists of pairs of addresses: the first is the
15 * address of an instruction that is allowed to fault, and the second is
16 * the address at which the program should continue. No registers are
17 * modified, so it is entirely up to the continuation code to figure out
18 * what to do.
19 *
20 * All the routines below use bits of fixup code that are out of line
21 * with the main instruction path. This means when everything is well,
22 * we don't even have to jump over them. Further, they do not intrude
23 * on our cache or tlb entries.
24 */
25
26struct exception_table_entry
27{
28 unsigned long insn, fixup;
29};
30
31/* Returns 0 if exception not found and fixup otherwise. */
32extern unsigned long search_exception_table(unsigned long);
33extern int fixup_exception(struct pt_regs *regs);
34
35#define get_ds() (KERNEL_DS)
36#define get_fs() (current_thread_info()->addr_limit)
37#define segment_eq(a,b) ((a) == (b))
38
39#include <asm/uaccess-asm.h>
40
41#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
42
43/*
44 * Single-value transfer routines. They automatically use the right
45 * size if we just have the right pointer type. Note that the functions
46 * which read from user space (*get_*) need to take care not to leak
47 * kernel data even if the calling code is buggy and fails to check
48 * the return value. This means zeroing out the destination variable
49 * or buffer on error. Normally this is done out of line by the
50 * fixup code, but there are a few places where it intrudes on the
51 * main code path. When we only write to user space, there is no
52 * problem.
53 *
54 * The "__xxx" versions of the user access functions do not verify the
55 * address space - it must have been done previously with a separate
56 * "access_ok()" call.
57 *
58 * The "xxx_error" versions set the third argument to EFAULT if an
59 * error occurs, and leave it unchanged on success. Note that these
60 * versions are void (ie, don't return a value as such).
61 */
62
63extern int __get_user_1(void *);
64extern int __get_user_2(void *);
65extern int __get_user_4(void *);
66extern int __get_user_8(void *);
67extern int __get_user_bad(void);
68
69#define __get_user_x(__r1,__p,__e,__s,__i...) \
70 __asm__ __volatile__ ("bl __get_user_" #__s \
71 : "=&r" (__e), "=r" (__r1) \
72 : "0" (__p) \
73 : __i)
74
75#define get_user(x,p) \
76 ({ \
77 register const typeof(*(p)) *__p asm("r0") = (p); \
78 register typeof(*(p)) __r1 asm("r1"); \
79 register int __e asm("r0"); \
80 switch (sizeof(*(p))) { \
81 case 1: \
82 __get_user_x(__r1, __p, __e, 1, "lr"); \
83 break; \
84 case 2: \
85 __get_user_x(__r1, __p, __e, 2, "r2", "lr"); \
86 break; \
87 case 4: \
88 __get_user_x(__r1, __p, __e, 4, "lr"); \
89 break; \
90 case 8: \
91 __get_user_x(__r1, __p, __e, 8, "lr"); \
92 break; \
93 default: __e = __get_user_bad(); break; \
94 } \
95 x = __r1; \
96 __e; \
97 })
98
99
100#define __get_user(x,ptr) \
101({ \
102 long __gu_err = 0; \
103 __get_user_err((x),(ptr),__gu_err); \
104 __gu_err; \
105})
106
107#define __get_user_error(x,ptr,err) \
108({ \
109 __get_user_err((x),(ptr),err); \
110 (void) 0; \
111})
112
113#define __get_user_err(x,ptr,err) \
114do { \
115 unsigned long __gu_addr = (unsigned long)(ptr); \
116 unsigned long __gu_val; \
117 switch (sizeof(*(ptr))) { \
118 case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \
119 case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \
120 case 4: __get_user_asm_word(__gu_val,__gu_addr,err); break; \
121 default: (__gu_val) = __get_user_bad(); \
122 } \
123 (x) = (__typeof__(*(ptr)))__gu_val; \
124} while (0)
125
126extern int __put_user_1(void *, unsigned int);
127extern int __put_user_2(void *, unsigned int);
128extern int __put_user_4(void *, unsigned int);
129extern int __put_user_8(void *, unsigned long long);
130extern int __put_user_bad(void);
131
132#define __put_user_x(__r1,__p,__e,__s) \
133 __asm__ __volatile__ ( \
134 __asmeq("%0", "r0") __asmeq("%2", "r1") \
135 "bl __put_user_" #__s \
136 : "=&r" (__e) \
137 : "0" (__p), "r" (__r1) \
138 : "ip", "lr", "cc")
139
140#define put_user(x,p) \
141 ({ \
142 register const typeof(*(p)) __r1 asm("r1") = (x); \
143 register const typeof(*(p)) *__p asm("r0") = (p); \
144 register int __e asm("r0"); \
145 switch (sizeof(*(__p))) { \
146 case 1: \
147 __put_user_x(__r1, __p, __e, 1); \
148 break; \
149 case 2: \
150 __put_user_x(__r1, __p, __e, 2); \
151 break; \
152 case 4: \
153 __put_user_x(__r1, __p, __e, 4); \
154 break; \
155 case 8: \
156 __put_user_x(__r1, __p, __e, 8); \
157 break; \
158 default: __e = __put_user_bad(); break; \
159 } \
160 __e; \
161 })
162
163#if 0
164/********************* OLD METHOD *******************/
165#define __put_user_x(__r1,__p,__e,__s,__i...) \
166 __asm__ __volatile__ ("bl __put_user_" #__s \
167 : "=&r" (__e) \
168 : "0" (__p), "r" (__r1) \
169 : __i)
170
171#define put_user(x,p) \
172 ({ \
173 register const typeof(*(p)) __r1 asm("r1") = (x); \
174 register const typeof(*(p)) *__p asm("r0") = (p); \
175 register int __e asm("r0"); \
176 switch (sizeof(*(p))) { \
177 case 1: \
178 __put_user_x(__r1, __p, __e, 1, "r2", "lr"); \
179 break; \
180 case 2: \
181 __put_user_x(__r1, __p, __e, 2, "r2", "lr"); \
182 break; \
183 case 4: \
184 __put_user_x(__r1, __p, __e, 4, "r2", "lr"); \
185 break; \
186 case 8: \
187 __put_user_x(__r1, __p, __e, 8, "r2", "ip", "lr"); \
188 break; \
189 default: __e = __put_user_bad(); break; \
190 } \
191 __e; \
192 })
193/*************************************************/
194#endif
195
196#define __put_user(x,ptr) \
197({ \
198 long __pu_err = 0; \
199 __put_user_err((x),(ptr),__pu_err); \
200 __pu_err; \
201})
202
203#define __put_user_error(x,ptr,err) \
204({ \
205 __put_user_err((x),(ptr),err); \
206 (void) 0; \
207})
208
209#define __put_user_err(x,ptr,err) \
210do { \
211 unsigned long __pu_addr = (unsigned long)(ptr); \
212 __typeof__(*(ptr)) __pu_val = (x); \
213 switch (sizeof(*(ptr))) { \
214 case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \
215 case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \
216 case 4: __put_user_asm_word(__pu_val,__pu_addr,err); break; \
217 case 8: __put_user_asm_dword(__pu_val,__pu_addr,err); break; \
218 default: __put_user_bad(); \
219 } \
220} while (0)
221
222static __inline__ unsigned long copy_from_user(void *to, const void *from, unsigned long n)
223{
224 if (access_ok(VERIFY_READ, from, n))
225 __do_copy_from_user(to, from, n);
226 else /* security hole - plug it */
227 memzero(to, n);
228 return n;
229}
230
231static __inline__ unsigned long __copy_from_user(void *to, const void *from, unsigned long n)
232{
233 __do_copy_from_user(to, from, n);
234 return n;
235}
236
237static __inline__ unsigned long copy_to_user(void *to, const void *from, unsigned long n)
238{
239 if (access_ok(VERIFY_WRITE, to, n))
240 __do_copy_to_user(to, from, n);
241 return n;
242}
243
244static __inline__ unsigned long __copy_to_user(void *to, const void *from, unsigned long n)
245{
246 __do_copy_to_user(to, from, n);
247 return n;
248}
249
250#define __copy_to_user_inatomic __copy_to_user
251#define __copy_from_user_inatomic __copy_from_user
252
253static __inline__ unsigned long clear_user (void *to, unsigned long n)
254{
255 if (access_ok(VERIFY_WRITE, to, n))
256 __do_clear_user(to, n);
257 return n;
258}
259
260static __inline__ unsigned long __clear_user (void *to, unsigned long n)
261{
262 __do_clear_user(to, n);
263 return n;
264}
265
266static __inline__ long strncpy_from_user (char *dst, const char *src, long count)
267{
268 long res = -EFAULT;
269 if (access_ok(VERIFY_READ, src, 1))
270 __do_strncpy_from_user(dst, src, count, res);
271 return res;
272}
273
274static __inline__ long __strncpy_from_user (char *dst, const char *src, long count)
275{
276 long res;
277 __do_strncpy_from_user(dst, src, count, res);
278 return res;
279}
280
281#define strlen_user(s) strnlen_user(s, ~0UL >> 1)
282
283static inline long strnlen_user(const char *s, long n)
284{
285 unsigned long res = 0;
286
287 if (__addr_ok(s))
288 __do_strnlen_user(s, n, res);
289
290 return res;
291}
292
293#endif /* _ASMARM_UACCESS_H */
diff --git a/include/asm-arm26/ucontext.h b/include/asm-arm26/ucontext.h
deleted file mode 100644
index f853130137cc..000000000000
--- a/include/asm-arm26/ucontext.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _ASMARM_UCONTEXT_H
2#define _ASMARM_UCONTEXT_H
3
4struct ucontext {
5 unsigned long uc_flags;
6 struct ucontext *uc_link;
7 stack_t uc_stack;
8 struct sigcontext uc_mcontext;
9 sigset_t uc_sigmask; /* mask last for extensibility */
10};
11
12#endif /* !_ASMARM_UCONTEXT_H */
diff --git a/include/asm-arm26/unaligned.h b/include/asm-arm26/unaligned.h
deleted file mode 100644
index d992782089fd..000000000000
--- a/include/asm-arm26/unaligned.h
+++ /dev/null
@@ -1,118 +0,0 @@
1#ifndef __ASM_ARM_UNALIGNED_H
2#define __ASM_ARM_UNALIGNED_H
3
4#include <asm/types.h>
5
6extern int __bug_unaligned_x(void *ptr);
7
8/*
9 * What is the most efficient way of loading/storing an unaligned value?
10 *
11 * That is the subject of this file. Efficiency here is defined as
12 * minimum code size with minimum register usage for the common cases.
13 * It is currently not believed that long longs are common, so we
14 * trade efficiency for the chars, shorts and longs against the long
15 * longs.
16 *
17 * Current stats with gcc 2.7.2.2 for these functions:
18 *
19 * ptrsize get: code regs put: code regs
20 * 1 1 1 1 2
21 * 2 3 2 3 2
22 * 4 7 3 7 3
23 * 8 20 6 16 6
24 *
25 * gcc 2.95.1 seems to code differently:
26 *
27 * ptrsize get: code regs put: code regs
28 * 1 1 1 1 2
29 * 2 3 2 3 2
30 * 4 7 4 7 4
31 * 8 19 8 15 6
32 *
33 * which may or may not be more efficient (depending upon whether
34 * you can afford the extra registers). Hopefully the gcc 2.95
35 * is inteligent enough to decide if it is better to use the
36 * extra register, but evidence so far seems to suggest otherwise.
37 *
38 * Unfortunately, gcc is not able to optimise the high word
39 * out of long long >> 32, or the low word from long long << 32
40 */
41
42#define __get_unaligned_2_le(__p) \
43 (__p[0] | __p[1] << 8)
44
45#define __get_unaligned_4_le(__p) \
46 (__p[0] | __p[1] << 8 | __p[2] << 16 | __p[3] << 24)
47
48#define __get_unaligned_le(ptr) \
49 ({ \
50 __typeof__(*(ptr)) __v; \
51 __u8 *__p = (__u8 *)(ptr); \
52 switch (sizeof(*(ptr))) { \
53 case 1: __v = *(ptr); break; \
54 case 2: __v = __get_unaligned_2_le(__p); break; \
55 case 4: __v = __get_unaligned_4_le(__p); break; \
56 case 8: { \
57 unsigned int __v1, __v2; \
58 __v2 = __get_unaligned_4_le((__p+4)); \
59 __v1 = __get_unaligned_4_le(__p); \
60 __v = ((unsigned long long)__v2 << 32 | __v1); \
61 } \
62 break; \
63 default: __v = __bug_unaligned_x(__p); break; \
64 } \
65 __v; \
66 })
67
68static inline void __put_unaligned_2_le(__u32 __v, register __u8 *__p)
69{
70 *__p++ = __v;
71 *__p++ = __v >> 8;
72}
73
74static inline void __put_unaligned_4_le(__u32 __v, register __u8 *__p)
75{
76 __put_unaligned_2_le(__v >> 16, __p + 2);
77 __put_unaligned_2_le(__v, __p);
78}
79
80static inline void __put_unaligned_8_le(const unsigned long long __v, register __u8 *__p)
81{
82 /*
83 * tradeoff: 8 bytes of stack for all unaligned puts (2
84 * instructions), or an extra register in the long long
85 * case - go for the extra register.
86 */
87 __put_unaligned_4_le(__v >> 32, __p+4);
88 __put_unaligned_4_le(__v, __p);
89}
90
91/*
92 * Try to store an unaligned value as efficiently as possible.
93 */
94#define __put_unaligned_le(val,ptr) \
95 ({ \
96 switch (sizeof(*(ptr))) { \
97 case 1: \
98 *(ptr) = (val); \
99 break; \
100 case 2: __put_unaligned_2_le((val),(__u8 *)(ptr)); \
101 break; \
102 case 4: __put_unaligned_4_le((val),(__u8 *)(ptr)); \
103 break; \
104 case 8: __put_unaligned_8_le((val),(__u8 *)(ptr)); \
105 break; \
106 default: __bug_unaligned_x(ptr); \
107 break; \
108 } \
109 (void) 0; \
110 })
111
112/*
113 * Select endianness
114 */
115#define get_unaligned __get_unaligned_le
116#define put_unaligned __put_unaligned_le
117
118#endif
diff --git a/include/asm-arm26/uncompress.h b/include/asm-arm26/uncompress.h
deleted file mode 100644
index df2cba816a4e..000000000000
--- a/include/asm-arm26/uncompress.h
+++ /dev/null
@@ -1,111 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-arc/uncompress.h
3 *
4 * Copyright (C) 1996 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#define VIDMEM ((char *)0x02000000)
11
12int video_num_columns, video_num_lines, video_size_row;
13int white, bytes_per_char_h;
14extern unsigned long con_charconvtable[256];
15
16struct param_struct {
17 unsigned long page_size;
18 unsigned long nr_pages;
19 unsigned long ramdisk_size;
20 unsigned long mountrootrdonly;
21 unsigned long rootdev;
22 unsigned long video_num_cols;
23 unsigned long video_num_rows;
24 unsigned long video_x;
25 unsigned long video_y;
26 unsigned long memc_control_reg;
27 unsigned char sounddefault;
28 unsigned char adfsdrives;
29 unsigned char bytes_per_char_h;
30 unsigned char bytes_per_char_v;
31 unsigned long unused[256/4-11];
32};
33
34static struct param_struct *params = (struct param_struct *)0x0207c000;
35
36/*
37 * This does not append a newline
38 */
39static void puts(const char *s)
40{
41 extern void ll_write_char(char *, unsigned long);
42 int x,y;
43 unsigned char c;
44 char *ptr;
45
46 x = params->video_x;
47 y = params->video_y;
48
49 while ( ( c = *(unsigned char *)s++ ) != '\0' ) {
50 if ( c == '\n' ) {
51 x = 0;
52 if ( ++y >= video_num_lines ) {
53 y--;
54 }
55 } else {
56 ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
57 ll_write_char(ptr, c|(white<<16));
58 if ( ++x >= video_num_columns ) {
59 x = 0;
60 if ( ++y >= video_num_lines ) {
61 y--;
62 }
63 }
64 }
65 }
66
67 params->video_x = x;
68 params->video_y = y;
69}
70
71static void error(char *x);
72
73/*
74 * Setup for decompression
75 */
76static void arch_decomp_setup(void)
77{
78 int i;
79
80 video_num_lines = params->video_num_rows;
81 video_num_columns = params->video_num_cols;
82 bytes_per_char_h = params->bytes_per_char_h;
83 video_size_row = video_num_columns * bytes_per_char_h;
84 if (bytes_per_char_h == 4)
85 for (i = 0; i < 256; i++)
86 con_charconvtable[i] =
87 (i & 128 ? 1 << 0 : 0) |
88 (i & 64 ? 1 << 4 : 0) |
89 (i & 32 ? 1 << 8 : 0) |
90 (i & 16 ? 1 << 12 : 0) |
91 (i & 8 ? 1 << 16 : 0) |
92 (i & 4 ? 1 << 20 : 0) |
93 (i & 2 ? 1 << 24 : 0) |
94 (i & 1 ? 1 << 28 : 0);
95 else
96 for (i = 0; i < 16; i++)
97 con_charconvtable[i] =
98 (i & 8 ? 1 << 0 : 0) |
99 (i & 4 ? 1 << 8 : 0) |
100 (i & 2 ? 1 << 16 : 0) |
101 (i & 1 ? 1 << 24 : 0);
102
103 white = bytes_per_char_h == 8 ? 0xfc : 7;
104
105 if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n");
106}
107
108/*
109 * nothing to do
110 */
111#define arch_decomp_wdog()
diff --git a/include/asm-arm26/unistd.h b/include/asm-arm26/unistd.h
deleted file mode 100644
index 4c3b919177e5..000000000000
--- a/include/asm-arm26/unistd.h
+++ /dev/null
@@ -1,343 +0,0 @@
1/*
2 * linux/include/asm-arm/unistd.h
3 *
4 * Copyright (C) 2001-2003 Russell King
5 * Modified 25/11/04 Ian Molton for arm26.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Please forward _all_ changes to this file to spyro@f2s.com
12 * no matter what the change is. Thanks!
13 */
14#ifndef __ASM_ARM_UNISTD_H
15#define __ASM_ARM_UNISTD_H
16
17#define __NR_SYSCALL_BASE 0x900000
18
19/*
20 * This file contains the system call numbers.
21 */
22
23#define __NR_restart_syscall (__NR_SYSCALL_BASE+ 0)
24#define __NR_exit (__NR_SYSCALL_BASE+ 1)
25#define __NR_fork (__NR_SYSCALL_BASE+ 2)
26#define __NR_read (__NR_SYSCALL_BASE+ 3)
27#define __NR_write (__NR_SYSCALL_BASE+ 4)
28#define __NR_open (__NR_SYSCALL_BASE+ 5)
29#define __NR_close (__NR_SYSCALL_BASE+ 6)
30 /* 7 was sys_waitpid */
31#define __NR_creat (__NR_SYSCALL_BASE+ 8)
32#define __NR_link (__NR_SYSCALL_BASE+ 9)
33#define __NR_unlink (__NR_SYSCALL_BASE+ 10)
34#define __NR_execve (__NR_SYSCALL_BASE+ 11)
35#define __NR_chdir (__NR_SYSCALL_BASE+ 12)
36#define __NR_time (__NR_SYSCALL_BASE+ 13)
37#define __NR_mknod (__NR_SYSCALL_BASE+ 14)
38#define __NR_chmod (__NR_SYSCALL_BASE+ 15)
39#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
40 /* 17 was sys_break */
41 /* 18 was sys_stat */
42#define __NR_lseek (__NR_SYSCALL_BASE+ 19)
43#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
44#define __NR_mount (__NR_SYSCALL_BASE+ 21)
45#define __NR_umount (__NR_SYSCALL_BASE+ 22)
46#define __NR_setuid (__NR_SYSCALL_BASE+ 23)
47#define __NR_getuid (__NR_SYSCALL_BASE+ 24)
48#define __NR_stime (__NR_SYSCALL_BASE+ 25)
49#define __NR_ptrace (__NR_SYSCALL_BASE+ 26)
50#define __NR_alarm (__NR_SYSCALL_BASE+ 27)
51 /* 28 was sys_fstat */
52#define __NR_pause (__NR_SYSCALL_BASE+ 29)
53#define __NR_utime (__NR_SYSCALL_BASE+ 30)
54 /* 31 was sys_stty */
55 /* 32 was sys_gtty */
56#define __NR_access (__NR_SYSCALL_BASE+ 33)
57#define __NR_nice (__NR_SYSCALL_BASE+ 34)
58 /* 35 was sys_ftime */
59#define __NR_sync (__NR_SYSCALL_BASE+ 36)
60#define __NR_kill (__NR_SYSCALL_BASE+ 37)
61#define __NR_rename (__NR_SYSCALL_BASE+ 38)
62#define __NR_mkdir (__NR_SYSCALL_BASE+ 39)
63#define __NR_rmdir (__NR_SYSCALL_BASE+ 40)
64#define __NR_dup (__NR_SYSCALL_BASE+ 41)
65#define __NR_pipe (__NR_SYSCALL_BASE+ 42)
66#define __NR_times (__NR_SYSCALL_BASE+ 43)
67 /* 44 was sys_prof */
68#define __NR_brk (__NR_SYSCALL_BASE+ 45)
69#define __NR_setgid (__NR_SYSCALL_BASE+ 46)
70#define __NR_getgid (__NR_SYSCALL_BASE+ 47)
71 /* 48 was sys_signal */
72#define __NR_geteuid (__NR_SYSCALL_BASE+ 49)
73#define __NR_getegid (__NR_SYSCALL_BASE+ 50)
74#define __NR_acct (__NR_SYSCALL_BASE+ 51)
75#define __NR_umount2 (__NR_SYSCALL_BASE+ 52)
76 /* 53 was sys_lock */
77#define __NR_ioctl (__NR_SYSCALL_BASE+ 54)
78#define __NR_fcntl (__NR_SYSCALL_BASE+ 55)
79 /* 56 was sys_mpx */
80#define __NR_setpgid (__NR_SYSCALL_BASE+ 57)
81 /* 58 was sys_ulimit */
82 /* 59 was sys_olduname */
83#define __NR_umask (__NR_SYSCALL_BASE+ 60)
84#define __NR_chroot (__NR_SYSCALL_BASE+ 61)
85#define __NR_ustat (__NR_SYSCALL_BASE+ 62)
86#define __NR_dup2 (__NR_SYSCALL_BASE+ 63)
87#define __NR_getppid (__NR_SYSCALL_BASE+ 64)
88#define __NR_getpgrp (__NR_SYSCALL_BASE+ 65)
89#define __NR_setsid (__NR_SYSCALL_BASE+ 66)
90#define __NR_sigaction (__NR_SYSCALL_BASE+ 67)
91 /* 68 was sys_sgetmask */
92 /* 69 was sys_ssetmask */
93#define __NR_setreuid (__NR_SYSCALL_BASE+ 70)
94#define __NR_setregid (__NR_SYSCALL_BASE+ 71)
95#define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72)
96#define __NR_sigpending (__NR_SYSCALL_BASE+ 73)
97#define __NR_sethostname (__NR_SYSCALL_BASE+ 74)
98#define __NR_setrlimit (__NR_SYSCALL_BASE+ 75)
99#define __NR_getrlimit (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limited rlimit */
100#define __NR_getrusage (__NR_SYSCALL_BASE+ 77)
101#define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78)
102#define __NR_settimeofday (__NR_SYSCALL_BASE+ 79)
103#define __NR_getgroups (__NR_SYSCALL_BASE+ 80)
104#define __NR_setgroups (__NR_SYSCALL_BASE+ 81)
105#define __NR_select (__NR_SYSCALL_BASE+ 82)
106#define __NR_symlink (__NR_SYSCALL_BASE+ 83)
107 /* 84 was sys_lstat */
108#define __NR_readlink (__NR_SYSCALL_BASE+ 85)
109#define __NR_uselib (__NR_SYSCALL_BASE+ 86)
110#define __NR_swapon (__NR_SYSCALL_BASE+ 87)
111#define __NR_reboot (__NR_SYSCALL_BASE+ 88)
112#define __NR_readdir (__NR_SYSCALL_BASE+ 89)
113#define __NR_mmap (__NR_SYSCALL_BASE+ 90)
114#define __NR_munmap (__NR_SYSCALL_BASE+ 91)
115#define __NR_truncate (__NR_SYSCALL_BASE+ 92)
116#define __NR_ftruncate (__NR_SYSCALL_BASE+ 93)
117#define __NR_fchmod (__NR_SYSCALL_BASE+ 94)
118#define __NR_fchown (__NR_SYSCALL_BASE+ 95)
119#define __NR_getpriority (__NR_SYSCALL_BASE+ 96)
120#define __NR_setpriority (__NR_SYSCALL_BASE+ 97)
121 /* 98 was sys_profil */
122#define __NR_statfs (__NR_SYSCALL_BASE+ 99)
123#define __NR_fstatfs (__NR_SYSCALL_BASE+100)
124 /* 101 was sys_ioperm */
125#define __NR_socketcall (__NR_SYSCALL_BASE+102)
126#define __NR_syslog (__NR_SYSCALL_BASE+103)
127#define __NR_setitimer (__NR_SYSCALL_BASE+104)
128#define __NR_getitimer (__NR_SYSCALL_BASE+105)
129#define __NR_stat (__NR_SYSCALL_BASE+106)
130#define __NR_lstat (__NR_SYSCALL_BASE+107)
131#define __NR_fstat (__NR_SYSCALL_BASE+108)
132 /* 109 was sys_uname */
133 /* 110 was sys_iopl */
134#define __NR_vhangup (__NR_SYSCALL_BASE+111)
135 /* 112 was sys_idle */
136#define __NR_syscall (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
137#define __NR_wait4 (__NR_SYSCALL_BASE+114)
138#define __NR_swapoff (__NR_SYSCALL_BASE+115)
139#define __NR_sysinfo (__NR_SYSCALL_BASE+116)
140#define __NR_ipc (__NR_SYSCALL_BASE+117)
141#define __NR_fsync (__NR_SYSCALL_BASE+118)
142#define __NR_sigreturn (__NR_SYSCALL_BASE+119)
143#define __NR_clone (__NR_SYSCALL_BASE+120)
144#define __NR_setdomainname (__NR_SYSCALL_BASE+121)
145#define __NR_uname (__NR_SYSCALL_BASE+122)
146 /* 123 was sys_modify_ldt */
147#define __NR_adjtimex (__NR_SYSCALL_BASE+124)
148#define __NR_mprotect (__NR_SYSCALL_BASE+125)
149#define __NR_sigprocmask (__NR_SYSCALL_BASE+126)
150 /* 127 was sys_create_module */
151#define __NR_init_module (__NR_SYSCALL_BASE+128)
152#define __NR_delete_module (__NR_SYSCALL_BASE+129)
153 /* 130 was sys_get_kernel_syms */
154#define __NR_quotactl (__NR_SYSCALL_BASE+131)
155#define __NR_getpgid (__NR_SYSCALL_BASE+132)
156#define __NR_fchdir (__NR_SYSCALL_BASE+133)
157#define __NR_bdflush (__NR_SYSCALL_BASE+134)
158#define __NR_sysfs (__NR_SYSCALL_BASE+135)
159#define __NR_personality (__NR_SYSCALL_BASE+136)
160 /* 137 was sys_afs_syscall */
161#define __NR_setfsuid (__NR_SYSCALL_BASE+138)
162#define __NR_setfsgid (__NR_SYSCALL_BASE+139)
163#define __NR__llseek (__NR_SYSCALL_BASE+140)
164#define __NR_getdents (__NR_SYSCALL_BASE+141)
165#define __NR__newselect (__NR_SYSCALL_BASE+142)
166#define __NR_flock (__NR_SYSCALL_BASE+143)
167#define __NR_msync (__NR_SYSCALL_BASE+144)
168#define __NR_readv (__NR_SYSCALL_BASE+145)
169#define __NR_writev (__NR_SYSCALL_BASE+146)
170#define __NR_getsid (__NR_SYSCALL_BASE+147)
171#define __NR_fdatasync (__NR_SYSCALL_BASE+148)
172#define __NR__sysctl (__NR_SYSCALL_BASE+149)
173#define __NR_mlock (__NR_SYSCALL_BASE+150)
174#define __NR_munlock (__NR_SYSCALL_BASE+151)
175#define __NR_mlockall (__NR_SYSCALL_BASE+152)
176#define __NR_munlockall (__NR_SYSCALL_BASE+153)
177#define __NR_sched_setparam (__NR_SYSCALL_BASE+154)
178#define __NR_sched_getparam (__NR_SYSCALL_BASE+155)
179#define __NR_sched_setscheduler (__NR_SYSCALL_BASE+156)
180#define __NR_sched_getscheduler (__NR_SYSCALL_BASE+157)
181#define __NR_sched_yield (__NR_SYSCALL_BASE+158)
182#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE+159)
183#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE+160)
184#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE+161)
185#define __NR_nanosleep (__NR_SYSCALL_BASE+162)
186#define __NR_mremap (__NR_SYSCALL_BASE+163)
187#define __NR_setresuid (__NR_SYSCALL_BASE+164)
188#define __NR_getresuid (__NR_SYSCALL_BASE+165)
189 /* 166 was sys_vm86 */
190 /* 167 was sys_query_module */
191#define __NR_poll (__NR_SYSCALL_BASE+168)
192#define __NR_nfsservctl (__NR_SYSCALL_BASE+169)
193#define __NR_setresgid (__NR_SYSCALL_BASE+170)
194#define __NR_getresgid (__NR_SYSCALL_BASE+171)
195#define __NR_prctl (__NR_SYSCALL_BASE+172)
196#define __NR_rt_sigreturn (__NR_SYSCALL_BASE+173)
197#define __NR_rt_sigaction (__NR_SYSCALL_BASE+174)
198#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE+175)
199#define __NR_rt_sigpending (__NR_SYSCALL_BASE+176)
200#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)
201#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)
202#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
203#define __NR_pread64 (__NR_SYSCALL_BASE+180)
204#define __NR_pwrite64 (__NR_SYSCALL_BASE+181)
205#define __NR_chown (__NR_SYSCALL_BASE+182)
206#define __NR_getcwd (__NR_SYSCALL_BASE+183)
207#define __NR_capget (__NR_SYSCALL_BASE+184)
208#define __NR_capset (__NR_SYSCALL_BASE+185)
209#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)
210#define __NR_sendfile (__NR_SYSCALL_BASE+187)
211 /* 188 reserved */
212 /* 189 reserved */
213#define __NR_vfork (__NR_SYSCALL_BASE+190)
214#define __NR_ugetrlimit (__NR_SYSCALL_BASE+191) /* SuS compliant getrlimit */
215#define __NR_mmap2 (__NR_SYSCALL_BASE+192)
216#define __NR_truncate64 (__NR_SYSCALL_BASE+193)
217#define __NR_ftruncate64 (__NR_SYSCALL_BASE+194)
218#define __NR_stat64 (__NR_SYSCALL_BASE+195)
219#define __NR_lstat64 (__NR_SYSCALL_BASE+196)
220#define __NR_fstat64 (__NR_SYSCALL_BASE+197)
221#define __NR_lchown32 (__NR_SYSCALL_BASE+198)
222#define __NR_getuid32 (__NR_SYSCALL_BASE+199)
223#define __NR_getgid32 (__NR_SYSCALL_BASE+200)
224#define __NR_geteuid32 (__NR_SYSCALL_BASE+201)
225#define __NR_getegid32 (__NR_SYSCALL_BASE+202)
226#define __NR_setreuid32 (__NR_SYSCALL_BASE+203)
227#define __NR_setregid32 (__NR_SYSCALL_BASE+204)
228#define __NR_getgroups32 (__NR_SYSCALL_BASE+205)
229#define __NR_setgroups32 (__NR_SYSCALL_BASE+206)
230#define __NR_fchown32 (__NR_SYSCALL_BASE+207)
231#define __NR_setresuid32 (__NR_SYSCALL_BASE+208)
232#define __NR_getresuid32 (__NR_SYSCALL_BASE+209)
233#define __NR_setresgid32 (__NR_SYSCALL_BASE+210)
234#define __NR_getresgid32 (__NR_SYSCALL_BASE+211)
235#define __NR_chown32 (__NR_SYSCALL_BASE+212)
236#define __NR_setuid32 (__NR_SYSCALL_BASE+213)
237#define __NR_setgid32 (__NR_SYSCALL_BASE+214)
238#define __NR_setfsuid32 (__NR_SYSCALL_BASE+215)
239#define __NR_setfsgid32 (__NR_SYSCALL_BASE+216)
240#define __NR_getdents64 (__NR_SYSCALL_BASE+217)
241#define __NR_pivot_root (__NR_SYSCALL_BASE+218)
242#define __NR_mincore (__NR_SYSCALL_BASE+219)
243#define __NR_madvise (__NR_SYSCALL_BASE+220)
244#define __NR_fcntl64 (__NR_SYSCALL_BASE+221)
245 /* 222 for tux */
246 /* 223 is unused */
247#define __NR_gettid (__NR_SYSCALL_BASE+224)
248#define __NR_readahead (__NR_SYSCALL_BASE+225)
249#define __NR_setxattr (__NR_SYSCALL_BASE+226)
250#define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
251#define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
252#define __NR_getxattr (__NR_SYSCALL_BASE+229)
253#define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
254#define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
255#define __NR_listxattr (__NR_SYSCALL_BASE+232)
256#define __NR_llistxattr (__NR_SYSCALL_BASE+233)
257#define __NR_flistxattr (__NR_SYSCALL_BASE+234)
258#define __NR_removexattr (__NR_SYSCALL_BASE+235)
259#define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
260#define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
261#define __NR_tkill (__NR_SYSCALL_BASE+238)
262#define __NR_sendfile64 (__NR_SYSCALL_BASE+239)
263#define __NR_futex (__NR_SYSCALL_BASE+240)
264#define __NR_sched_setaffinity (__NR_SYSCALL_BASE+241)
265#define __NR_sched_getaffinity (__NR_SYSCALL_BASE+242)
266#define __NR_io_setup (__NR_SYSCALL_BASE+243)
267#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
268#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
269#define __NR_io_submit (__NR_SYSCALL_BASE+246)
270#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
271#define __NR_exit_group (__NR_SYSCALL_BASE+248)
272#define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249)
273#define __NR_epoll_create (__NR_SYSCALL_BASE+250)
274#define __NR_epoll_ctl (__NR_SYSCALL_BASE+251)
275#define __NR_epoll_wait (__NR_SYSCALL_BASE+252)
276#define __NR_remap_file_pages (__NR_SYSCALL_BASE+253)
277 /* 254 for set_thread_area */
278 /* 255 for get_thread_area */
279 /* 256 for set_tid_address */
280#define __NR_timer_create (__NR_SYSCALL_BASE+257)
281#define __NR_timer_settime (__NR_SYSCALL_BASE+258)
282#define __NR_timer_gettime (__NR_SYSCALL_BASE+259)
283#define __NR_timer_getoverrun (__NR_SYSCALL_BASE+260)
284#define __NR_timer_delete (__NR_SYSCALL_BASE+261)
285#define __NR_clock_settime (__NR_SYSCALL_BASE+262)
286#define __NR_clock_gettime (__NR_SYSCALL_BASE+263)
287#define __NR_clock_getres (__NR_SYSCALL_BASE+264)
288#define __NR_clock_nanosleep (__NR_SYSCALL_BASE+265)
289#define __NR_statfs64 (__NR_SYSCALL_BASE+266)
290#define __NR_fstatfs64 (__NR_SYSCALL_BASE+267)
291#define __NR_tgkill (__NR_SYSCALL_BASE+268)
292#define __NR_utimes (__NR_SYSCALL_BASE+269)
293#define __NR_fadvise64_64 (__NR_SYSCALL_BASE+270)
294#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271)
295#define __NR_pciconfig_read (__NR_SYSCALL_BASE+272)
296#define __NR_pciconfig_write (__NR_SYSCALL_BASE+273)
297#define __NR_mq_open (__NR_SYSCALL_BASE+274)
298#define __NR_mq_unlink (__NR_SYSCALL_BASE+275)
299#define __NR_mq_timedsend (__NR_SYSCALL_BASE+276)
300#define __NR_mq_timedreceive (__NR_SYSCALL_BASE+277)
301#define __NR_mq_notify (__NR_SYSCALL_BASE+278)
302#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
303#define __NR_waitid (__NR_SYSCALL_BASE+280)
304
305/*
306 * The following SWIs are ARM private. FIXME - make appropriate for arm26
307 */
308#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
309#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
310#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
311#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
312
313#ifdef __KERNEL__
314
315#define __ARCH_WANT_IPC_PARSE_VERSION
316#define __ARCH_WANT_OLD_READDIR
317#define __ARCH_WANT_STAT64
318#define __ARCH_WANT_SYS_ALARM
319#define __ARCH_WANT_SYS_GETHOSTNAME
320#define __ARCH_WANT_SYS_PAUSE
321#define __ARCH_WANT_SYS_TIME
322#define __ARCH_WANT_SYS_UTIME
323#define __ARCH_WANT_SYS_SOCKETCALL
324#define __ARCH_WANT_SYS_FADVISE64
325#define __ARCH_WANT_SYS_GETPGRP
326#define __ARCH_WANT_SYS_LLSEEK
327#define __ARCH_WANT_SYS_NICE
328#define __ARCH_WANT_SYS_OLD_GETRLIMIT
329#define __ARCH_WANT_SYS_OLDUMOUNT
330#define __ARCH_WANT_SYS_SIGPENDING
331#define __ARCH_WANT_SYS_SIGPROCMASK
332#define __ARCH_WANT_SYS_RT_SIGACTION
333
334/*
335 * "Conditional" syscalls
336 *
337 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
338 * but it doesn't work on all toolchains, so we just do it by hand
339 */
340#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
341
342#endif /* __KERNEL__ */
343#endif /* __ASM_ARM_UNISTD_H */
diff --git a/include/asm-arm26/user.h b/include/asm-arm26/user.h
deleted file mode 100644
index 3e8b0f879159..000000000000
--- a/include/asm-arm26/user.h
+++ /dev/null
@@ -1,84 +0,0 @@
1#ifndef _ARM_USER_H
2#define _ARM_USER_H
3
4#include <asm/page.h>
5#include <asm/ptrace.h>
6/* Core file format: The core file is written in such a way that gdb
7 can understand it and provide useful information to the user (under
8 linux we use the 'trad-core' bfd). There are quite a number of
9 obstacles to being able to view the contents of the floating point
10 registers, and until these are solved you will not be able to view the
11 contents of them. Actually, you can read in the core file and look at
12 the contents of the user struct to find out what the floating point
13 registers contain.
14 The actual file contents are as follows:
15 UPAGE: 1 page consisting of a user struct that tells gdb what is present
16 in the file. Directly after this is a copy of the task_struct, which
17 is currently not used by gdb, but it may come in useful at some point.
18 All of the registers are stored as part of the upage. The upage should
19 always be only one page.
20 DATA: The data area is stored. We use current->end_text to
21 current->brk to pick up all of the user variables, plus any memory
22 that may have been malloced. No attempt is made to determine if a page
23 is demand-zero or if a page is totally unused, we just cover the entire
24 range. All of the addresses are rounded in such a way that an integral
25 number of pages is written.
26 STACK: We need the stack information in order to get a meaningful
27 backtrace. We need to write the data from (esp) to
28 current->start_stack, so we round each of these off in order to be able
29 to write an integer number of pages.
30 The minimum core file size is 3 pages, or 12288 bytes.
31*/
32
33struct user_fp {
34 struct fp_reg {
35 unsigned int sign1:1;
36 unsigned int unused:15;
37 unsigned int sign2:1;
38 unsigned int exponent:14;
39 unsigned int j:1;
40 unsigned int mantissa1:31;
41 unsigned int mantissa0:32;
42 } fpregs[8];
43 unsigned int fpsr:32;
44 unsigned int fpcr:32;
45 unsigned char ftype[8];
46 unsigned int init_flag;
47};
48
49/* When the kernel dumps core, it starts by dumping the user struct -
50 this will be used by gdb to figure out where the data and stack segments
51 are within the file, and what virtual addresses to use. */
52struct user{
53/* We start with the registers, to mimic the way that "memory" is returned
54 from the ptrace(3,...) function. */
55 struct pt_regs regs; /* Where the registers are actually stored */
56/* ptrace does not yet supply these. Someday.... */
57 int u_fpvalid; /* True if math co-processor being used. */
58 /* for this mess. Not yet used. */
59/* The rest of this junk is to help gdb figure out what goes where */
60 unsigned long int u_tsize; /* Text segment size (pages). */
61 unsigned long int u_dsize; /* Data segment size (pages). */
62 unsigned long int u_ssize; /* Stack segment size (pages). */
63 unsigned long start_code; /* Starting virtual address of text. */
64 unsigned long start_stack; /* Starting virtual address of stack area.
65 This is actually the bottom of the stack,
66 the top of the stack is always found in the
67 esp register. */
68 long int signal; /* Signal that caused the core dump. */
69 int reserved; /* No longer used */
70 struct pt_regs * u_ar0; /* Used by gdb to help find the values for */
71 /* the registers. */
72 unsigned long magic; /* To uniquely identify a core file */
73 char u_comm[32]; /* User command that was responsible */
74 int u_debugreg[8];
75 struct user_fp u_fp; /* FP state */
76 struct user_fp_struct * u_fp0;/* Used by gdb to help find the values for */
77 /* the FP registers. */
78};
79#define NBPG PAGE_SIZE
80#define UPAGES 1
81#define HOST_TEXT_START_ADDR (u.start_code)
82#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
83
84#endif /* _ARM_USER_H */
diff --git a/include/asm-arm26/xor.h b/include/asm-arm26/xor.h
deleted file mode 100644
index e7c4cf58bed1..000000000000
--- a/include/asm-arm26/xor.h
+++ /dev/null
@@ -1,141 +0,0 @@
1/*
2 * linux/include/asm-arm/xor.h
3 *
4 * Copyright (C) 2001 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#include <asm-generic/xor.h>
11
12#define __XOR(a1, a2) a1 ^= a2
13
14#define GET_BLOCK_2(dst) \
15 __asm__("ldmia %0, {%1, %2}" \
16 : "=r" (dst), "=r" (a1), "=r" (a2) \
17 : "0" (dst))
18
19#define GET_BLOCK_4(dst) \
20 __asm__("ldmia %0, {%1, %2, %3, %4}" \
21 : "=r" (dst), "=r" (a1), "=r" (a2), "=r" (a3), "=r" (a4) \
22 : "0" (dst))
23
24#define XOR_BLOCK_2(src) \
25 __asm__("ldmia %0!, {%1, %2}" \
26 : "=r" (src), "=r" (b1), "=r" (b2) \
27 : "0" (src)); \
28 __XOR(a1, b1); __XOR(a2, b2);
29
30#define XOR_BLOCK_4(src) \
31 __asm__("ldmia %0!, {%1, %2, %3, %4}" \
32 : "=r" (src), "=r" (b1), "=r" (b2), "=r" (b3), "=r" (b4) \
33 : "0" (src)); \
34 __XOR(a1, b1); __XOR(a2, b2); __XOR(a3, b3); __XOR(a4, b4)
35
36#define PUT_BLOCK_2(dst) \
37 __asm__ __volatile__("stmia %0!, {%2, %3}" \
38 : "=r" (dst) \
39 : "0" (dst), "r" (a1), "r" (a2))
40
41#define PUT_BLOCK_4(dst) \
42 __asm__ __volatile__("stmia %0!, {%2, %3, %4, %5}" \
43 : "=r" (dst) \
44 : "0" (dst), "r" (a1), "r" (a2), "r" (a3), "r" (a4))
45
46static void
47xor_arm4regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
48{
49 unsigned int lines = bytes / sizeof(unsigned long) / 4;
50 register unsigned int a1 __asm__("r4");
51 register unsigned int a2 __asm__("r5");
52 register unsigned int a3 __asm__("r6");
53 register unsigned int a4 __asm__("r7");
54 register unsigned int b1 __asm__("r8");
55 register unsigned int b2 __asm__("r9");
56 register unsigned int b3 __asm__("ip");
57 register unsigned int b4 __asm__("lr");
58
59 do {
60 GET_BLOCK_4(p1);
61 XOR_BLOCK_4(p2);
62 PUT_BLOCK_4(p1);
63 } while (--lines);
64}
65
66static void
67xor_arm4regs_3(unsigned long bytes, unsigned long *p1, unsigned long *p2,
68 unsigned long *p3)
69{
70 unsigned int lines = bytes / sizeof(unsigned long) / 4;
71 register unsigned int a1 __asm__("r4");
72 register unsigned int a2 __asm__("r5");
73 register unsigned int a3 __asm__("r6");
74 register unsigned int a4 __asm__("r7");
75 register unsigned int b1 __asm__("r8");
76 register unsigned int b2 __asm__("r9");
77 register unsigned int b3 __asm__("ip");
78 register unsigned int b4 __asm__("lr");
79
80 do {
81 GET_BLOCK_4(p1);
82 XOR_BLOCK_4(p2);
83 XOR_BLOCK_4(p3);
84 PUT_BLOCK_4(p1);
85 } while (--lines);
86}
87
88static void
89xor_arm4regs_4(unsigned long bytes, unsigned long *p1, unsigned long *p2,
90 unsigned long *p3, unsigned long *p4)
91{
92 unsigned int lines = bytes / sizeof(unsigned long) / 2;
93 register unsigned int a1 __asm__("r8");
94 register unsigned int a2 __asm__("r9");
95 register unsigned int b1 __asm__("ip");
96 register unsigned int b2 __asm__("lr");
97
98 do {
99 GET_BLOCK_2(p1);
100 XOR_BLOCK_2(p2);
101 XOR_BLOCK_2(p3);
102 XOR_BLOCK_2(p4);
103 PUT_BLOCK_2(p1);
104 } while (--lines);
105}
106
107static void
108xor_arm4regs_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
109 unsigned long *p3, unsigned long *p4, unsigned long *p5)
110{
111 unsigned int lines = bytes / sizeof(unsigned long) / 2;
112 register unsigned int a1 __asm__("r8");
113 register unsigned int a2 __asm__("r9");
114 register unsigned int b1 __asm__("ip");
115 register unsigned int b2 __asm__("lr");
116
117 do {
118 GET_BLOCK_2(p1);
119 XOR_BLOCK_2(p2);
120 XOR_BLOCK_2(p3);
121 XOR_BLOCK_2(p4);
122 XOR_BLOCK_2(p5);
123 PUT_BLOCK_2(p1);
124 } while (--lines);
125}
126
127static struct xor_block_template xor_block_arm4regs = {
128 .name = "arm4regs",
129 .do_2 = xor_arm4regs_2,
130 .do_3 = xor_arm4regs_3,
131 .do_4 = xor_arm4regs_4,
132 .do_5 = xor_arm4regs_5,
133};
134
135#undef XOR_TRY_TEMPLATES
136#define XOR_TRY_TEMPLATES \
137 do { \
138 xor_speed(&xor_block_arm4regs); \
139 xor_speed(&xor_block_8regs); \
140 xor_speed(&xor_block_32regs); \
141 } while (0)
diff --git a/include/asm-avr32/a.out.h b/include/asm-avr32/a.out.h
index 50bf6e31a143..9f398ab28ed0 100644
--- a/include/asm-avr32/a.out.h
+++ b/include/asm-avr32/a.out.h
@@ -20,6 +20,7 @@ struct exec
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#define STACK_TOP TASK_SIZE 22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
23 24
24#endif 25#endif
25 26
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h
index 974480438849..0215965dc586 100644
--- a/include/asm-avr32/arch-at32ap/board.h
+++ b/include/asm-avr32/arch-at32ap/board.h
@@ -36,4 +36,18 @@ struct platform_device *
36at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, 36at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,
37 unsigned long fbmem_start, unsigned long fbmem_len); 37 unsigned long fbmem_start, unsigned long fbmem_len);
38 38
39/* depending on what's hooked up, not all SSC pins will be used */
40#define ATMEL_SSC_TK 0x01
41#define ATMEL_SSC_TF 0x02
42#define ATMEL_SSC_TD 0x04
43#define ATMEL_SSC_TX (ATMEL_SSC_TK | ATMEL_SSC_TF | ATMEL_SSC_TD)
44
45#define ATMEL_SSC_RK 0x10
46#define ATMEL_SSC_RF 0x20
47#define ATMEL_SSC_RD 0x40
48#define ATMEL_SSC_RX (ATMEL_SSC_RK | ATMEL_SSC_RF | ATMEL_SSC_RD)
49
50struct platform_device *
51at32_add_device_ssc(unsigned int id, unsigned int flags);
52
39#endif /* __ASM_ARCH_BOARD_H */ 53#endif /* __ASM_ARCH_BOARD_H */
diff --git a/include/asm-avr32/arch-at32ap/sm.h b/include/asm-avr32/arch-at32ap/sm.h
deleted file mode 100644
index 265a9ead20bf..000000000000
--- a/include/asm-avr32/arch-at32ap/sm.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * AT32 System Manager interface.
3 *
4 * Copyright (C) 2006 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef __ASM_AVR32_AT32_SM_H__
11#define __ASM_AVR32_AT32_SM_H__
12
13struct irq_chip;
14struct platform_device;
15
16struct at32_sm {
17 spinlock_t lock;
18 void __iomem *regs;
19 struct irq_chip *eim_chip;
20 unsigned int eim_first_irq;
21 struct platform_device *pdev;
22};
23
24extern struct platform_device at32_sm_device;
25extern struct at32_sm system_manager;
26
27#endif /* __ASM_AVR32_AT32_SM_H__ */
diff --git a/include/asm-avr32/atomic.h b/include/asm-avr32/atomic.h
index b9c2548a52f3..7ef3862a73d0 100644
--- a/include/asm-avr32/atomic.h
+++ b/include/asm-avr32/atomic.h
@@ -101,7 +101,7 @@ static inline int atomic_sub_unless(atomic_t *v, int a, int u)
101 " mov %1, 1\n" 101 " mov %1, 1\n"
102 "1:" 102 "1:"
103 : "=&r"(tmp), "=&r"(result), "=o"(v->counter) 103 : "=&r"(tmp), "=&r"(result), "=o"(v->counter)
104 : "m"(v->counter), "rKs21"(a), "rKs21"(u) 104 : "m"(v->counter), "rKs21"(a), "rKs21"(u), "1"(result)
105 : "cc", "memory"); 105 : "cc", "memory");
106 106
107 return result; 107 return result;
@@ -137,7 +137,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
137 " mov %1, 1\n" 137 " mov %1, 1\n"
138 "1:" 138 "1:"
139 : "=&r"(tmp), "=&r"(result), "=o"(v->counter) 139 : "=&r"(tmp), "=&r"(result), "=o"(v->counter)
140 : "m"(v->counter), "r"(a), "ir"(u) 140 : "m"(v->counter), "r"(a), "ir"(u), "1"(result)
141 : "cc", "memory"); 141 : "cc", "memory");
142 } 142 }
143 143
diff --git a/include/asm-avr32/bug.h b/include/asm-avr32/bug.h
index afdcd79a2966..331d45bab18f 100644
--- a/include/asm-avr32/bug.h
+++ b/include/asm-avr32/bug.h
@@ -57,7 +57,7 @@
57 57
58#define WARN_ON(condition) \ 58#define WARN_ON(condition) \
59 ({ \ 59 ({ \
60 typeof(condition) __ret_warn_on = (condition); \ 60 int __ret_warn_on = !!(condition); \
61 if (unlikely(__ret_warn_on)) \ 61 if (unlikely(__ret_warn_on)) \
62 _BUG_OR_WARN(BUGFLAG_WARNING); \ 62 _BUG_OR_WARN(BUGFLAG_WARNING); \
63 unlikely(__ret_warn_on); \ 63 unlikely(__ret_warn_on); \
diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h
index e30d4b3bd836..64bb92bb6773 100644
--- a/include/asm-avr32/io.h
+++ b/include/asm-avr32/io.h
@@ -255,6 +255,8 @@ static inline void memset_io(volatile void __iomem *addr, unsigned char val,
255 memset((void __force *)addr, val, count); 255 memset((void __force *)addr, val, count);
256} 256}
257 257
258#define mmiowb()
259
258#define IO_SPACE_LIMIT 0xffffffff 260#define IO_SPACE_LIMIT 0xffffffff
259 261
260extern void __iomem *__ioremap(unsigned long offset, size_t size, 262extern void __iomem *__ioremap(unsigned long offset, size_t size,
diff --git a/include/asm-avr32/pgalloc.h b/include/asm-avr32/pgalloc.h
index bb82e70cde8d..0e680f47209f 100644
--- a/include/asm-avr32/pgalloc.h
+++ b/include/asm-avr32/pgalloc.h
@@ -27,13 +27,7 @@ static __inline__ void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
27 */ 27 */
28static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm) 28static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm)
29{ 29{
30 unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t)); 30 return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL);
31 pgd_t *pgd = kmalloc(pgd_size, GFP_KERNEL);
32
33 if (pgd)
34 memset(pgd, 0, pgd_size);
35
36 return pgd;
37} 31}
38 32
39static inline void pgd_free(pgd_t *pgd) 33static inline void pgd_free(pgd_t *pgd)
@@ -44,18 +38,9 @@ static inline void pgd_free(pgd_t *pgd)
44static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 38static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
45 unsigned long address) 39 unsigned long address)
46{ 40{
47 int count = 0;
48 pte_t *pte; 41 pte_t *pte;
49 42
50 do { 43 pte = (pte_t *)get_zeroed_page(GFP_KERNEL | __GFP_REPEAT);
51 pte = (pte_t *) __get_free_page(GFP_KERNEL | __GFP_REPEAT);
52 if (pte)
53 clear_page(pte);
54 else {
55 current->state = TASK_UNINTERRUPTIBLE;
56 schedule_timeout(HZ);
57 }
58 } while (!pte && (count++ < 10));
59 44
60 return pte; 45 return pte;
61} 46}
@@ -63,18 +48,9 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
63static inline struct page *pte_alloc_one(struct mm_struct *mm, 48static inline struct page *pte_alloc_one(struct mm_struct *mm,
64 unsigned long address) 49 unsigned long address)
65{ 50{
66 int count = 0;
67 struct page *pte; 51 struct page *pte;
68 52
69 do { 53 pte = alloc_page(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO);
70 pte = alloc_pages(GFP_KERNEL, 0);
71 if (pte)
72 clear_page(page_address(pte));
73 else {
74 current->state = TASK_UNINTERRUPTIBLE;
75 schedule_timeout(HZ);
76 }
77 } while (!pte && (count++ < 10));
78 54
79 return pte; 55 return pte;
80} 56}
diff --git a/include/asm-avr32/pgtable.h b/include/asm-avr32/pgtable.h
index c07bdd10b891..018f6e2a0242 100644
--- a/include/asm-avr32/pgtable.h
+++ b/include/asm-avr32/pgtable.h
@@ -32,8 +32,6 @@
32#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 32#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
33#define FIRST_USER_ADDRESS 0 33#define FIRST_USER_ADDRESS 0
34 34
35#define PTE_PHYS_MASK 0x1ffff000
36
37#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
38extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 36extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
39extern void paging_init(void); 37extern void paging_init(void);
@@ -265,7 +263,7 @@ static inline pte_t pte_mkyoung(pte_t pte)
265 * trivial. 263 * trivial.
266 */ 264 */
267#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) 265#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
268#define pte_page(x) phys_to_page(pte_val(x) & PTE_PHYS_MASK) 266#define pte_page(x) (pfn_to_page(pte_pfn(x)))
269 267
270/* 268/*
271 * Mark the prot value as uncacheable and unbufferable 269 * Mark the prot value as uncacheable and unbufferable
diff --git a/include/asm-avr32/thread_info.h b/include/asm-avr32/thread_info.h
index a2e606dd4f4a..17dacf3f36d3 100644
--- a/include/asm-avr32/thread_info.h
+++ b/include/asm-avr32/thread_info.h
@@ -74,20 +74,18 @@ static inline struct thread_info *current_thread_info(void)
74 * - other flags in MSW 74 * - other flags in MSW
75 */ 75 */
76#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 76#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
77#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 77#define TIF_SIGPENDING 1 /* signal pending */
78#define TIF_SIGPENDING 2 /* signal pending */ 78#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
79#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 79#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
80#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
81 TIF_NEED_RESCHED */ 80 TIF_NEED_RESCHED */
82#define TIF_BREAKPOINT 5 /* true if we should break after return */ 81#define TIF_BREAKPOINT 4 /* true if we should break after return */
83#define TIF_SINGLE_STEP 6 /* single step after next break */ 82#define TIF_SINGLE_STEP 5 /* single step after next break */
84#define TIF_MEMDIE 7 83#define TIF_MEMDIE 6
85#define TIF_RESTORE_SIGMASK 8 /* restore signal mask in do_signal */ 84#define TIF_RESTORE_SIGMASK 7 /* restore signal mask in do_signal */
86#define TIF_CPU_GOING_TO_SLEEP 9 /* CPU is entering sleep 0 mode */ 85#define TIF_CPU_GOING_TO_SLEEP 8 /* CPU is entering sleep 0 mode */
87#define TIF_USERSPACE 31 /* true if FS sets userspace */ 86#define TIF_USERSPACE 31 /* true if FS sets userspace */
88 87
89#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 88#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
90#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
91#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 89#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
92#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 90#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
93#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 91#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
diff --git a/include/asm-avr32/unaligned.h b/include/asm-avr32/unaligned.h
index 3042723fcbfd..36f5fd430543 100644
--- a/include/asm-avr32/unaligned.h
+++ b/include/asm-avr32/unaligned.h
@@ -7,19 +7,10 @@
7 * words, but halfwords must be halfword-aligned, and doublewords must 7 * words, but halfwords must be halfword-aligned, and doublewords must
8 * be word-aligned. 8 * be word-aligned.
9 * 9 *
10 * TODO: Make all this CPU-specific and optimize. 10 * However, swapped word loads must be word-aligned so we can't
11 * optimize word loads in general.
11 */ 12 */
12 13
13#include <linux/string.h> 14#include <asm-generic/unaligned.h>
14
15/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
16
17#define get_unaligned(ptr) \
18 ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
19
20#define put_unaligned(val, ptr) \
21 ({ __typeof__(*(ptr)) __tmp = (val); \
22 memmove((ptr), &__tmp, sizeof(*(ptr))); \
23 (void)0; })
24 15
25#endif /* __ASM_AVR32_UNALIGNED_H */ 16#endif /* __ASM_AVR32_UNALIGNED_H */
diff --git a/include/asm-blackfin/bfin-global.h b/include/asm-blackfin/bfin-global.h
index c4d6cbbf96d4..a970781a0f98 100644
--- a/include/asm-blackfin/bfin-global.h
+++ b/include/asm-blackfin/bfin-global.h
@@ -61,6 +61,7 @@ extern void bfin_dcache_init(void);
61extern int read_iloc(void); 61extern int read_iloc(void);
62extern int bfin_console_init(void); 62extern int bfin_console_init(void);
63extern asmlinkage void lower_to_irq14(void); 63extern asmlinkage void lower_to_irq14(void);
64extern void init_exception_vectors(void);
64extern void init_dma(void); 65extern void init_dma(void);
65extern void program_IAR(void); 66extern void program_IAR(void);
66extern void evt14_softirq(void); 67extern void evt14_softirq(void);
diff --git a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
index 98d35a929116..cdf29e75ea59 100644
--- a/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
+++ b/include/asm-blackfin/mach-bf548/cdefBF54x_base.h
@@ -242,6 +242,39 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
242#define bfin_read_TWI0_RCV_DATA16() bfin_read16(TWI0_RCV_DATA16) 242#define bfin_read_TWI0_RCV_DATA16() bfin_read16(TWI0_RCV_DATA16)
243#define bfin_write_TWI0_RCV_DATA16(val) bfin_write16(TWI0_RCV_DATA16, val) 243#define bfin_write_TWI0_RCV_DATA16(val) bfin_write16(TWI0_RCV_DATA16, val)
244 244
245#define bfin_read_TWI_CLKDIV() bfin_read16(TWI0_CLKDIV)
246#define bfin_write_TWI_CLKDIV(val) bfin_write16(TWI0_CLKDIV, val)
247#define bfin_read_TWI_CONTROL() bfin_read16(TWI0_CONTROL)
248#define bfin_write_TWI_CONTROL(val) bfin_write16(TWI0_CONTROL, val)
249#define bfin_read_TWI_SLAVE_CTRL() bfin_read16(TWI0_SLAVE_CTRL)
250#define bfin_write_TWI_SLAVE_CTRL(val) bfin_write16(TWI0_SLAVE_CTRL, val)
251#define bfin_read_TWI_SLAVE_STAT() bfin_read16(TWI0_SLAVE_STAT)
252#define bfin_write_TWI_SLAVE_STAT(val) bfin_write16(TWI0_SLAVE_STAT, val)
253#define bfin_read_TWI_SLAVE_ADDR() bfin_read16(TWI0_SLAVE_ADDR)
254#define bfin_write_TWI_SLAVE_ADDR(val) bfin_write16(TWI0_SLAVE_ADDR, val)
255#define bfin_read_TWI_MASTER_CTL() bfin_read16(TWI0_MASTER_CTRL)
256#define bfin_write_TWI_MASTER_CTL(val) bfin_write16(TWI0_MASTER_CTRL, val)
257#define bfin_read_TWI_MASTER_STAT() bfin_read16(TWI0_MASTER_STAT)
258#define bfin_write_TWI_MASTER_STAT(val) bfin_write16(TWI0_MASTER_STAT, val)
259#define bfin_read_TWI_MASTER_ADDR() bfin_read16(TWI0_MASTER_ADDR)
260#define bfin_write_TWI_MASTER_ADDR(val) bfin_write16(TWI0_MASTER_ADDR, val)
261#define bfin_read_TWI_INT_STAT() bfin_read16(TWI0_INT_STAT)
262#define bfin_write_TWI_INT_STAT(val) bfin_write16(TWI0_INT_STAT, val)
263#define bfin_read_TWI_INT_MASK() bfin_read16(TWI0_INT_MASK)
264#define bfin_write_TWI_INT_MASK(val) bfin_write16(TWI0_INT_MASK, val)
265#define bfin_read_TWI_FIFO_CTL() bfin_read16(TWI0_FIFO_CTRL)
266#define bfin_write_TWI_FIFO_CTL(val) bfin_write16(TWI0_FIFO_CTRL, val)
267#define bfin_read_TWI_FIFO_STAT() bfin_read16(TWI0_FIFO_STAT)
268#define bfin_write_TWI_FIFO_STAT(val) bfin_write16(TWI0_FIFO_STAT, val)
269#define bfin_read_TWI_XMT_DATA8() bfin_read16(TWI0_XMT_DATA8)
270#define bfin_write_TWI_XMT_DATA8(val) bfin_write16(TWI0_XMT_DATA8, val)
271#define bfin_read_TWI_XMT_DATA16() bfin_read16(TWI0_XMT_DATA16)
272#define bfin_write_TWI_XMT_DATA16(val) bfin_write16(TWI0_XMT_DATA16, val)
273#define bfin_read_TWI_RCV_DATA8() bfin_read16(TWI0_RCV_DATA8)
274#define bfin_write_TWI_RCV_DATA8(val) bfin_write16(TWI0_RCV_DATA8, val)
275#define bfin_read_TWI_RCV_DATA16() bfin_read16(TWI0_RCV_DATA16)
276#define bfin_write_TWI_RCV_DATA16(val) bfin_write16(TWI0_RCV_DATA16, val)
277
245/* SPORT0 is not defined in the shared file because it is not available on the ADSP-BF542 and ADSP-BF544 bfin_read_()rocessors */ 278/* SPORT0 is not defined in the shared file because it is not available on the ADSP-BF542 and ADSP-BF544 bfin_read_()rocessors */
246 279
247/* SPORT1 Registers */ 280/* SPORT1 Registers */
diff --git a/include/asm-blackfin/mach-bf548/irq.h b/include/asm-blackfin/mach-bf548/irq.h
index 0b3325bb1fff..e548d3cd81e3 100644
--- a/include/asm-blackfin/mach-bf548/irq.h
+++ b/include/asm-blackfin/mach-bf548/irq.h
@@ -112,6 +112,7 @@ Events (highest priority) EMU 0
112#define IRQ_ATAPI_TX BFIN_IRQ(44) /* ATAPI TX (DMA11) Interrupt */ 112#define IRQ_ATAPI_TX BFIN_IRQ(44) /* ATAPI TX (DMA11) Interrupt */
113#define IRQ_TWI0 BFIN_IRQ(45) /* TWI0 Interrupt */ 113#define IRQ_TWI0 BFIN_IRQ(45) /* TWI0 Interrupt */
114#define IRQ_TWI1 BFIN_IRQ(46) /* TWI1 Interrupt */ 114#define IRQ_TWI1 BFIN_IRQ(46) /* TWI1 Interrupt */
115#define IRQ_TWI IRQ_TWI0 /* TWI Interrupt */
115#define IRQ_CAN0_RX BFIN_IRQ(47) /* CAN0 Receive Interrupt */ 116#define IRQ_CAN0_RX BFIN_IRQ(47) /* CAN0 Receive Interrupt */
116#define IRQ_CAN0_TX BFIN_IRQ(48) /* CAN0 Transmit Interrupt */ 117#define IRQ_CAN0_TX BFIN_IRQ(48) /* CAN0 Transmit Interrupt */
117#define IRQ_MDMAS2 BFIN_IRQ(49) /* MDMA Stream 2 Interrupt */ 118#define IRQ_MDMAS2 BFIN_IRQ(49) /* MDMA Stream 2 Interrupt */
diff --git a/include/asm-blackfin/mach-bf561/cdefBF561.h b/include/asm-blackfin/mach-bf561/cdefBF561.h
index 1a8ec9e46922..6e87ab269ffe 100644
--- a/include/asm-blackfin/mach-bf561/cdefBF561.h
+++ b/include/asm-blackfin/mach-bf561/cdefBF561.h
@@ -81,6 +81,12 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
81#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val) 81#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val)
82#define bfin_read_CHIPID() bfin_read32(CHIPID) 82#define bfin_read_CHIPID() bfin_read32(CHIPID)
83 83
84/* For MMR's that are reserved on Core B, set up defines to better integrate with other ports */
85#define bfin_read_SWRST() bfin_read_SICA_SWRST()
86#define bfin_write_SWRST() bfin_write_SICA_SWRST()
87#define bfin_read_SYSCR() bfin_read_SICA_SYSCR()
88#define bfin_write_SYSCR() bfin_write_SICA_SYSCR()
89
84/* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */ 90/* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */
85#define bfin_read_SICA_SWRST() bfin_read16(SICA_SWRST) 91#define bfin_read_SICA_SWRST() bfin_read16(SICA_SWRST)
86#define bfin_write_SICA_SWRST(val) bfin_write16(SICA_SWRST,val) 92#define bfin_write_SICA_SWRST(val) bfin_write16(SICA_SWRST,val)
diff --git a/include/asm-blackfin/mach-bf561/defBF561.h b/include/asm-blackfin/mach-bf561/defBF561.h
index 89150ecb909d..0f2dc6e6335b 100644
--- a/include/asm-blackfin/mach-bf561/defBF561.h
+++ b/include/asm-blackfin/mach-bf561/defBF561.h
@@ -52,6 +52,10 @@
52#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count register (16-bit) */ 52#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count register (16-bit) */
53#define CHIPID 0xFFC00014 /* Chip ID Register */ 53#define CHIPID 0xFFC00014 /* Chip ID Register */
54 54
55/* For MMR's that are reserved on Core B, set up defines to better integrate with other ports */
56#define SWRST SICA_SWRST
57#define SYSCR SICA_SYSCR
58
55/* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */ 59/* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */
56#define SICA_SWRST 0xFFC00100 /* Software Reset register */ 60#define SICA_SWRST 0xFFC00100 /* Software Reset register */
57#define SICA_SYSCR 0xFFC00104 /* System Reset Configuration register */ 61#define SICA_SYSCR 0xFFC00104 /* System Reset Configuration register */
diff --git a/include/asm-blackfin/thread_info.h b/include/asm-blackfin/thread_info.h
index fa8f08cf283e..15b99cf4f50b 100644
--- a/include/asm-blackfin/thread_info.h
+++ b/include/asm-blackfin/thread_info.h
@@ -39,6 +39,11 @@
39 */ 39 */
40#define ALIGN_PAGE_MASK 0xffffe000 40#define ALIGN_PAGE_MASK 0xffffe000
41 41
42/*
43 * Size of kernel stack for each process. This must be a power of 2...
44 */
45#define THREAD_SIZE 8192 /* 2 pages */
46
42#ifndef __ASSEMBLY__ 47#ifndef __ASSEMBLY__
43 48
44typedef unsigned long mm_segment_t; 49typedef unsigned long mm_segment_t;
@@ -76,11 +81,6 @@ struct thread_info {
76#define init_thread_info (init_thread_union.thread_info) 81#define init_thread_info (init_thread_union.thread_info)
77#define init_stack (init_thread_union.stack) 82#define init_stack (init_thread_union.stack)
78 83
79/*
80 * Size of kernel stack for each process. This must be a power of 2...
81 */
82#define THREAD_SIZE 8192 /* 2 pages */
83
84/* How to get the thread information struct from C */ 84/* How to get the thread information struct from C */
85 85
86static inline struct thread_info *current_thread_info(void) 86static inline struct thread_info *current_thread_info(void)
@@ -94,7 +94,7 @@ static inline struct thread_info *current_thread_info(void)
94 struct thread_info *ti; 94 struct thread_info *ti;
95 __asm__("%0 = sp;": "=&d"(ti): 95 __asm__("%0 = sp;": "=&d"(ti):
96 ); 96 );
97 return (struct thread_info *)((long)ti & ~8191UL); 97 return (struct thread_info *)((long)ti & ~((long)THREAD_SIZE-1));
98} 98}
99 99
100/* thread information allocation */ 100/* thread information allocation */
@@ -118,18 +118,16 @@ static inline struct thread_info *current_thread_info(void)
118 * thread information flag bit numbers 118 * thread information flag bit numbers
119 */ 119 */
120#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 120#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
121#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 121#define TIF_SIGPENDING 1 /* signal pending */
122#define TIF_SIGPENDING 2 /* signal pending */ 122#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
123#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 123#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
124#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
125 TIF_NEED_RESCHED */ 124 TIF_NEED_RESCHED */
126#define TIF_MEMDIE 5 125#define TIF_MEMDIE 4
127#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */ 126#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
128#define TIF_FREEZE 7 /* is freezing for suspend */ 127#define TIF_FREEZE 6 /* is freezing for suspend */
129 128
130/* as above, but as bit values */ 129/* as above, but as bit values */
131#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 130#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
132#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
133#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 131#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
134#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 132#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
135#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 133#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
diff --git a/include/asm-cris/a.out.h b/include/asm-cris/a.out.h
index 770734ce54a6..919b34a084f8 100644
--- a/include/asm-cris/a.out.h
+++ b/include/asm-cris/a.out.h
@@ -8,6 +8,7 @@
8 8
9/* grabbed from the intel stuff */ 9/* grabbed from the intel stuff */
10#define STACK_TOP TASK_SIZE 10#define STACK_TOP TASK_SIZE
11#define STACK_TOP_MAX STACK_TOP
11 12
12 13
13struct exec 14struct exec
diff --git a/include/asm-cris/thread_info.h b/include/asm-cris/thread_info.h
index 7ad853c3f74e..fde39f6c49c7 100644
--- a/include/asm-cris/thread_info.h
+++ b/include/asm-cris/thread_info.h
@@ -79,14 +79,12 @@ struct thread_info {
79 * - other flags in MSW 79 * - other flags in MSW
80 */ 80 */
81#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 81#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
82#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 82#define TIF_SIGPENDING 1 /* signal pending */
83#define TIF_SIGPENDING 2 /* signal pending */ 83#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
84#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
85#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 84#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
86#define TIF_MEMDIE 17 85#define TIF_MEMDIE 17
87 86
88#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 87#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
89#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
90#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 88#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
91#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 89#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
92#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 90#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
diff --git a/include/asm-frv/mb86943a.h b/include/asm-frv/mb86943a.h
index b89fd0b56bb3..e87ef924bfb4 100644
--- a/include/asm-frv/mb86943a.h
+++ b/include/asm-frv/mb86943a.h
@@ -36,4 +36,7 @@
36#define __reg_MB86943_pci_sl_io_base *(volatile uint32_t *) (__region_CS1 + 0x70) 36#define __reg_MB86943_pci_sl_io_base *(volatile uint32_t *) (__region_CS1 + 0x70)
37#define __reg_MB86943_pci_sl_mem_base *(volatile uint32_t *) (__region_CS1 + 0x78) 37#define __reg_MB86943_pci_sl_mem_base *(volatile uint32_t *) (__region_CS1 + 0x78)
38 38
39#define __reg_MB86943_pci_arbiter *(volatile uint32_t *) (__region_CS2 + 0x01300014)
40#define MB86943_PCIARB_EN 0x00000001
41
39#endif /* _ASM_MB86943A_H */ 42#endif /* _ASM_MB86943A_H */
diff --git a/include/asm-frv/mem-layout.h b/include/asm-frv/mem-layout.h
index a025dd4514e7..aaf2a773d9d3 100644
--- a/include/asm-frv/mem-layout.h
+++ b/include/asm-frv/mem-layout.h
@@ -60,6 +60,7 @@
60 */ 60 */
61#define BRK_BASE __UL(2 * 1024 * 1024 + PAGE_SIZE) 61#define BRK_BASE __UL(2 * 1024 * 1024 + PAGE_SIZE)
62#define STACK_TOP __UL(2 * 1024 * 1024) 62#define STACK_TOP __UL(2 * 1024 * 1024)
63#define STACK_TOP_MAX STACK_TOP
63 64
64/* userspace process size */ 65/* userspace process size */
65#ifdef CONFIG_MMU 66#ifdef CONFIG_MMU
diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h
index d881f518e6a9..cc5433e78b52 100644
--- a/include/asm-frv/thread_info.h
+++ b/include/asm-frv/thread_info.h
@@ -108,18 +108,16 @@ register struct thread_info *__current_thread_info asm("gr15");
108 * - other flags in MSW 108 * - other flags in MSW
109 */ 109 */
110#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 110#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
111#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 111#define TIF_SIGPENDING 1 /* signal pending */
112#define TIF_SIGPENDING 2 /* signal pending */ 112#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
113#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 113#define TIF_SINGLESTEP 3 /* restore singlestep on return to user mode */
114#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ 114#define TIF_IRET 4 /* return with iret */
115#define TIF_IRET 5 /* return with iret */ 115#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
116#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
117#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 116#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
118#define TIF_MEMDIE 17 /* OOM killer killed process */ 117#define TIF_MEMDIE 17 /* OOM killer killed process */
119#define TIF_FREEZE 18 /* freezing for suspend */ 118#define TIF_FREEZE 18 /* freezing for suspend */
120 119
121#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 120#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
122#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
123#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 121#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
124#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 122#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
125#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) 123#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h
index 7306c71a8926..cd84f1771e34 100644
--- a/include/asm-frv/unistd.h
+++ b/include/asm-frv/unistd.h
@@ -330,10 +330,11 @@
330#define __NR_signalfd 321 330#define __NR_signalfd 321
331#define __NR_timerfd 322 331#define __NR_timerfd 322
332#define __NR_eventfd 323 332#define __NR_eventfd 323
333#define __NR_fallocate 324
333 334
334#ifdef __KERNEL__ 335#ifdef __KERNEL__
335 336
336#define NR_syscalls 324 337#define NR_syscalls 325
337 338
338#define __ARCH_WANT_IPC_PARSE_VERSION 339#define __ARCH_WANT_IPC_PARSE_VERSION
339/* #define __ARCH_WANT_OLD_READDIR */ 340/* #define __ARCH_WANT_OLD_READDIR */
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 344e3091af24..d56fedbb457a 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -33,7 +33,7 @@ struct bug_entry {
33 33
34#ifndef HAVE_ARCH_WARN_ON 34#ifndef HAVE_ARCH_WARN_ON
35#define WARN_ON(condition) ({ \ 35#define WARN_ON(condition) ({ \
36 typeof(condition) __ret_warn_on = (condition); \ 36 int __ret_warn_on = !!(condition); \
37 if (unlikely(__ret_warn_on)) { \ 37 if (unlikely(__ret_warn_on)) { \
38 printk("WARNING: at %s:%d %s()\n", __FILE__, \ 38 printk("WARNING: at %s:%d %s()\n", __FILE__, \
39 __LINE__, __FUNCTION__); \ 39 __LINE__, __FUNCTION__); \
@@ -54,7 +54,7 @@ struct bug_entry {
54 54
55#ifndef HAVE_ARCH_WARN_ON 55#ifndef HAVE_ARCH_WARN_ON
56#define WARN_ON(condition) ({ \ 56#define WARN_ON(condition) ({ \
57 typeof(condition) __ret_warn_on = (condition); \ 57 int __ret_warn_on = !!(condition); \
58 unlikely(__ret_warn_on); \ 58 unlikely(__ret_warn_on); \
59}) 59})
60#endif 60#endif
@@ -62,7 +62,7 @@ struct bug_entry {
62 62
63#define WARN_ON_ONCE(condition) ({ \ 63#define WARN_ON_ONCE(condition) ({ \
64 static int __warned; \ 64 static int __warned; \
65 typeof(condition) __ret_warn_once = (condition); \ 65 int __ret_warn_once = !!(condition); \
66 \ 66 \
67 if (unlikely(__ret_warn_once)) \ 67 if (unlikely(__ret_warn_once)) \
68 if (WARN_ON(!__warned)) \ 68 if (WARN_ON(!__warned)) \
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index d984a9041436..d85172e9ed45 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -14,6 +14,11 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
14#define DEFINE_PER_CPU(type, name) \ 14#define DEFINE_PER_CPU(type, name) \
15 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name 15 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
16 16
17#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
18 __attribute__((__section__(".data.percpu.shared_aligned"))) \
19 __typeof__(type) per_cpu__##name \
20 ____cacheline_aligned_in_smp
21
17/* var is in discarded region: offset to particular copy we want */ 22/* var is in discarded region: offset to particular copy we want */
18#define per_cpu(var, cpu) (*({ \ 23#define per_cpu(var, cpu) (*({ \
19 extern int simple_identifier_##var(void); \ 24 extern int simple_identifier_##var(void); \
@@ -34,6 +39,9 @@ do { \
34#define DEFINE_PER_CPU(type, name) \ 39#define DEFINE_PER_CPU(type, name) \
35 __typeof__(type) per_cpu__##name 40 __typeof__(type) per_cpu__##name
36 41
42#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
43 DEFINE_PER_CPU(type, name)
44
37#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 45#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
38#define __get_cpu_var(var) per_cpu__##var 46#define __get_cpu_var(var) per_cpu__##var
39#define __raw_get_cpu_var(var) per_cpu__##var 47#define __raw_get_cpu_var(var) per_cpu__##var
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index f605e8d0eed3..5f0d797d33fd 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -2,6 +2,7 @@
2#define _ASM_GENERIC_PGTABLE_H 2#define _ASM_GENERIC_PGTABLE_H
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5#ifdef CONFIG_MMU
5 6
6#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 7#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
7/* 8/*
@@ -133,41 +134,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
133#endif 134#endif
134 135
135/* 136/*
136 * A facility to provide lazy MMU batching. This allows PTE updates and
137 * page invalidations to be delayed until a call to leave lazy MMU mode
138 * is issued. Some architectures may benefit from doing this, and it is
139 * beneficial for both shadow and direct mode hypervisors, which may batch
140 * the PTE updates which happen during this window. Note that using this
141 * interface requires that read hazards be removed from the code. A read
142 * hazard could result in the direct mode hypervisor case, since the actual
143 * write to the page tables may not yet have taken place, so reads though
144 * a raw PTE pointer after it has been modified are not guaranteed to be
145 * up to date. This mode can only be entered and left under the protection of
146 * the page table locks for all page tables which may be modified. In the UP
147 * case, this is required so that preemption is disabled, and in the SMP case,
148 * it must synchronize the delayed page table writes properly on other CPUs.
149 */
150#ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE
151#define arch_enter_lazy_mmu_mode() do {} while (0)
152#define arch_leave_lazy_mmu_mode() do {} while (0)
153#define arch_flush_lazy_mmu_mode() do {} while (0)
154#endif
155
156/*
157 * A facility to provide batching of the reload of page tables with the
158 * actual context switch code for paravirtualized guests. By convention,
159 * only one of the lazy modes (CPU, MMU) should be active at any given
160 * time, entry should never be nested, and entry and exits should always
161 * be paired. This is for sanity of maintaining and reasoning about the
162 * kernel code.
163 */
164#ifndef __HAVE_ARCH_ENTER_LAZY_CPU_MODE
165#define arch_enter_lazy_cpu_mode() do {} while (0)
166#define arch_leave_lazy_cpu_mode() do {} while (0)
167#define arch_flush_lazy_cpu_mode() do {} while (0)
168#endif
169
170/*
171 * When walking page tables, get the address of the next boundary, 137 * When walking page tables, get the address of the next boundary,
172 * or the end address of the range if that comes earlier. Although no 138 * or the end address of the range if that comes earlier. Although no
173 * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout. 139 * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout.
@@ -233,6 +199,43 @@ static inline int pmd_none_or_clear_bad(pmd_t *pmd)
233 } 199 }
234 return 0; 200 return 0;
235} 201}
202#endif /* CONFIG_MMU */
203
204/*
205 * A facility to provide lazy MMU batching. This allows PTE updates and
206 * page invalidations to be delayed until a call to leave lazy MMU mode
207 * is issued. Some architectures may benefit from doing this, and it is
208 * beneficial for both shadow and direct mode hypervisors, which may batch
209 * the PTE updates which happen during this window. Note that using this
210 * interface requires that read hazards be removed from the code. A read
211 * hazard could result in the direct mode hypervisor case, since the actual
212 * write to the page tables may not yet have taken place, so reads though
213 * a raw PTE pointer after it has been modified are not guaranteed to be
214 * up to date. This mode can only be entered and left under the protection of
215 * the page table locks for all page tables which may be modified. In the UP
216 * case, this is required so that preemption is disabled, and in the SMP case,
217 * it must synchronize the delayed page table writes properly on other CPUs.
218 */
219#ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE
220#define arch_enter_lazy_mmu_mode() do {} while (0)
221#define arch_leave_lazy_mmu_mode() do {} while (0)
222#define arch_flush_lazy_mmu_mode() do {} while (0)
223#endif
224
225/*
226 * A facility to provide batching of the reload of page tables with the
227 * actual context switch code for paravirtualized guests. By convention,
228 * only one of the lazy modes (CPU, MMU) should be active at any given
229 * time, entry should never be nested, and entry and exits should always
230 * be paired. This is for sanity of maintaining and reasoning about the
231 * kernel code.
232 */
233#ifndef __HAVE_ARCH_ENTER_LAZY_CPU_MODE
234#define arch_enter_lazy_cpu_mode() do {} while (0)
235#define arch_leave_lazy_cpu_mode() do {} while (0)
236#define arch_flush_lazy_cpu_mode() do {} while (0)
237#endif
238
236#endif /* !__ASSEMBLY__ */ 239#endif /* !__ASSEMBLY__ */
237 240
238#endif /* _ASM_GENERIC_PGTABLE_H */ 241#endif /* _ASM_GENERIC_PGTABLE_H */
diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h
index 16a466e50681..2fe1b2e67f01 100644
--- a/include/asm-generic/unaligned.h
+++ b/include/asm-generic/unaligned.h
@@ -79,24 +79,24 @@ static inline void __ustw(__u16 val, __u16 *addr)
79 79
80#define __get_unaligned(ptr, size) ({ \ 80#define __get_unaligned(ptr, size) ({ \
81 const void *__gu_p = ptr; \ 81 const void *__gu_p = ptr; \
82 __u64 val; \ 82 __u64 __val; \
83 switch (size) { \ 83 switch (size) { \
84 case 1: \ 84 case 1: \
85 val = *(const __u8 *)__gu_p; \ 85 __val = *(const __u8 *)__gu_p; \
86 break; \ 86 break; \
87 case 2: \ 87 case 2: \
88 val = __uldw(__gu_p); \ 88 __val = __uldw(__gu_p); \
89 break; \ 89 break; \
90 case 4: \ 90 case 4: \
91 val = __uldl(__gu_p); \ 91 __val = __uldl(__gu_p); \
92 break; \ 92 break; \
93 case 8: \ 93 case 8: \
94 val = __uldq(__gu_p); \ 94 __val = __uldq(__gu_p); \
95 break; \ 95 break; \
96 default: \ 96 default: \
97 bad_unaligned_access_length(); \ 97 bad_unaligned_access_length(); \
98 }; \ 98 }; \
99 (__force __typeof__(*(ptr)))val; \ 99 (__force __typeof__(*(ptr)))__val; \
100}) 100})
101 101
102#define __put_unaligned(val, ptr, size) \ 102#define __put_unaligned(val, ptr, size) \
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 84155eb67f1d..0240e0506a07 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -224,7 +224,11 @@
224 } 224 }
225 225
226#define NOTES \ 226#define NOTES \
227 .notes : { *(.note.*) } :note 227 .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
228 VMLINUX_SYMBOL(__start_notes) = .; \
229 *(.note.*) \
230 VMLINUX_SYMBOL(__stop_notes) = .; \
231 }
228 232
229#define INITCALLS \ 233#define INITCALLS \
230 *(.initcall0.init) \ 234 *(.initcall0.init) \
@@ -245,3 +249,11 @@
245 *(.initcall7.init) \ 249 *(.initcall7.init) \
246 *(.initcall7s.init) 250 *(.initcall7s.init)
247 251
252#define PERCPU(align) \
253 . = ALIGN(align); \
254 __per_cpu_start = .; \
255 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \
256 *(.data.percpu) \
257 *(.data.percpu.shared_aligned) \
258 } \
259 __per_cpu_end = .;
diff --git a/include/asm-h8300/a.out.h b/include/asm-h8300/a.out.h
index 3c70939f9f00..aa5d22778235 100644
--- a/include/asm-h8300/a.out.h
+++ b/include/asm-h8300/a.out.h
@@ -20,6 +20,7 @@ struct exec
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#define STACK_TOP TASK_SIZE 22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
23 24
24#endif 25#endif
25 26
diff --git a/include/asm-h8300/irq.h b/include/asm-h8300/irq.h
index 41be646c3514..56eec28cc2c4 100644
--- a/include/asm-h8300/irq.h
+++ b/include/asm-h8300/irq.h
@@ -59,7 +59,4 @@ static __inline__ int irq_canonicalize(int irq)
59 return irq; 59 return irq;
60} 60}
61 61
62extern void enable_irq(unsigned int);
63extern void disable_irq(unsigned int);
64
65#endif /* _H8300_IRQ_H_ */ 62#endif /* _H8300_IRQ_H_ */
diff --git a/include/asm-h8300/thread_info.h b/include/asm-h8300/thread_info.h
index aee4009a498e..27bb95e2944c 100644
--- a/include/asm-h8300/thread_info.h
+++ b/include/asm-h8300/thread_info.h
@@ -86,17 +86,15 @@ static inline struct thread_info *current_thread_info(void)
86 * thread information flag bit numbers 86 * thread information flag bit numbers
87 */ 87 */
88#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 88#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
89#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 89#define TIF_SIGPENDING 1 /* signal pending */
90#define TIF_SIGPENDING 2 /* signal pending */ 90#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
91#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 91#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
92#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
93 TIF_NEED_RESCHED */ 92 TIF_NEED_RESCHED */
94#define TIF_MEMDIE 5 93#define TIF_MEMDIE 4
95#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */ 94#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
96 95
97/* as above, but as bit values */ 96/* as above, but as bit values */
98#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 97#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
99#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
100#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 98#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
101#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 99#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
102#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 100#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
diff --git a/include/asm-i386/a.out.h b/include/asm-i386/a.out.h
index ab17bb8e5465..851a60f8258c 100644
--- a/include/asm-i386/a.out.h
+++ b/include/asm-i386/a.out.h
@@ -20,6 +20,7 @@ struct exec
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#define STACK_TOP TASK_SIZE 22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
23 24
24#endif 25#endif
25 26
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
index 449f3f272e07..125179adf044 100644
--- a/include/asm-i386/acpi.h
+++ b/include/asm-i386/acpi.h
@@ -121,19 +121,6 @@ static inline void acpi_disable_pci(void)
121} 121}
122extern int acpi_irq_balance_set(char *str); 122extern int acpi_irq_balance_set(char *str);
123 123
124#else /* !CONFIG_ACPI */
125
126#define acpi_lapic 0
127#define acpi_ioapic 0
128static inline void acpi_noirq_set(void) { }
129static inline void acpi_disable_pci(void) { }
130static inline void disable_acpi(void) { }
131
132#endif /* !CONFIG_ACPI */
133
134
135#ifdef CONFIG_ACPI_SLEEP
136
137/* routines for saving/restoring kernel state */ 124/* routines for saving/restoring kernel state */
138extern int acpi_save_state_mem(void); 125extern int acpi_save_state_mem(void);
139extern void acpi_restore_state_mem(void); 126extern void acpi_restore_state_mem(void);
@@ -143,7 +130,15 @@ extern unsigned long acpi_wakeup_address;
143/* early initialization routine */ 130/* early initialization routine */
144extern void acpi_reserve_bootmem(void); 131extern void acpi_reserve_bootmem(void);
145 132
146#endif /*CONFIG_ACPI_SLEEP*/ 133#else /* !CONFIG_ACPI */
134
135#define acpi_lapic 0
136#define acpi_ioapic 0
137static inline void acpi_noirq_set(void) { }
138static inline void acpi_disable_pci(void) { }
139static inline void disable_acpi(void) { }
140
141#endif /* !CONFIG_ACPI */
147 142
148#define ARCH_HAS_POWER_INIT 1 143#define ARCH_HAS_POWER_INIT 1
149 144
diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h
index eb7da5402bfa..bda6c810c0f4 100644
--- a/include/asm-i386/alternative.h
+++ b/include/asm-i386/alternative.h
@@ -149,4 +149,6 @@ apply_paravirt(struct paravirt_patch_site *start,
149#define __parainstructions_end NULL 149#define __parainstructions_end NULL
150#endif 150#endif
151 151
152extern void text_poke(void *addr, unsigned char *opcode, int len);
153
152#endif /* _I386_ALTERNATIVE_H */ 154#endif /* _I386_ALTERNATIVE_H */
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h
index 1e8f6f252dd3..4091b33dcb10 100644
--- a/include/asm-i386/apic.h
+++ b/include/asm-i386/apic.h
@@ -116,6 +116,8 @@ extern void enable_NMI_through_LVT0 (void * dummy);
116extern int timer_over_8254; 116extern int timer_over_8254;
117extern int local_apic_timer_c2_ok; 117extern int local_apic_timer_c2_ok;
118 118
119extern int local_apic_timer_disabled;
120
119#else /* !CONFIG_X86_LOCAL_APIC */ 121#else /* !CONFIG_X86_LOCAL_APIC */
120static inline void lapic_shutdown(void) { } 122static inline void lapic_shutdown(void) { }
121 123
diff --git a/include/asm-i386/bootparam.h b/include/asm-i386/bootparam.h
index 427d8652bfde..b91b01783e4b 100644
--- a/include/asm-i386/bootparam.h
+++ b/include/asm-i386/bootparam.h
@@ -4,8 +4,9 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/screen_info.h> 5#include <linux/screen_info.h>
6#include <linux/apm_bios.h> 6#include <linux/apm_bios.h>
7#include <asm/e820.h>
8#include <linux/edd.h> 7#include <linux/edd.h>
8#include <asm/e820.h>
9#include <asm/ist.h>
9#include <video/edid.h> 10#include <video/edid.h>
10 11
11struct setup_header { 12struct setup_header {
@@ -48,9 +49,9 @@ struct efi_info {
48 u32 _pad1; 49 u32 _pad1;
49 u32 efi_systab; 50 u32 efi_systab;
50 u32 efi_memdesc_size; 51 u32 efi_memdesc_size;
51 u32 efi_memdec_version; 52 u32 efi_memdesc_version;
52 u32 efi_memmap; 53 u32 efi_memmap;
53 u32 fi_memmap_size; 54 u32 efi_memmap_size;
54 u32 _pad2[2]; 55 u32 _pad2[2];
55}; 56};
56 57
@@ -59,7 +60,7 @@ struct boot_params {
59 struct screen_info screen_info; /* 0x000 */ 60 struct screen_info screen_info; /* 0x000 */
60 struct apm_bios_info apm_bios_info; /* 0x040 */ 61 struct apm_bios_info apm_bios_info; /* 0x040 */
61 u8 _pad2[12]; /* 0x054 */ 62 u8 _pad2[12]; /* 0x054 */
62 u32 speedstep_info[4]; /* 0x060 */ 63 struct ist_info ist_info; /* 0x060 */
63 u8 _pad3[16]; /* 0x070 */ 64 u8 _pad3[16]; /* 0x070 */
64 u8 hd0_info[16]; /* obsolete! */ /* 0x080 */ 65 u8 hd0_info[16]; /* obsolete! */ /* 0x080 */
65 u8 hd1_info[16]; /* obsolete! */ /* 0x090 */ 66 u8 hd1_info[16]; /* obsolete! */ /* 0x090 */
diff --git a/include/asm-i386/cmpxchg.h b/include/asm-i386/cmpxchg.h
index 7adcef0cd53b..f86ede28f6dc 100644
--- a/include/asm-i386/cmpxchg.h
+++ b/include/asm-i386/cmpxchg.h
@@ -3,14 +3,16 @@
3 3
4#include <linux/bitops.h> /* for LOCK_PREFIX */ 4#include <linux/bitops.h> /* for LOCK_PREFIX */
5 5
6/*
7 * Note: if you use set64_bit(), __cmpxchg64(), or their variants, you
8 * you need to test for the feature in boot_cpu_data.
9 */
10
6#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr)))) 11#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
7 12
8struct __xchg_dummy { unsigned long a[100]; }; 13struct __xchg_dummy { unsigned long a[100]; };
9#define __xg(x) ((struct __xchg_dummy *)(x)) 14#define __xg(x) ((struct __xchg_dummy *)(x))
10 15
11
12#ifdef CONFIG_X86_CMPXCHG64
13
14/* 16/*
15 * The semantics of XCHGCMP8B are a bit strange, this is why 17 * The semantics of XCHGCMP8B are a bit strange, this is why
16 * there is a loop and the loading of %%eax and %%edx has to 18 * there is a loop and the loading of %%eax and %%edx has to
@@ -32,7 +34,7 @@ static inline void __set_64bit (unsigned long long * ptr,
32 "\n1:\t" 34 "\n1:\t"
33 "movl (%0), %%eax\n\t" 35 "movl (%0), %%eax\n\t"
34 "movl 4(%0), %%edx\n\t" 36 "movl 4(%0), %%edx\n\t"
35 "lock cmpxchg8b (%0)\n\t" 37 LOCK_PREFIX "cmpxchg8b (%0)\n\t"
36 "jnz 1b" 38 "jnz 1b"
37 : /* no outputs */ 39 : /* no outputs */
38 : "D"(ptr), 40 : "D"(ptr),
@@ -65,8 +67,6 @@ static inline void __set_64bit_var (unsigned long long *ptr,
65 __set_64bit(ptr, (unsigned int)(value), (unsigned int)((value)>>32ULL) ) : \ 67 __set_64bit(ptr, (unsigned int)(value), (unsigned int)((value)>>32ULL) ) : \
66 __set_64bit(ptr, ll_low(value), ll_high(value)) ) 68 __set_64bit(ptr, ll_low(value), ll_high(value)) )
67 69
68#endif
69
70/* 70/*
71 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway 71 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
72 * Note 2: xchg has side effect, so that attribute volatile is necessary, 72 * Note 2: xchg has side effect, so that attribute volatile is necessary,
@@ -252,8 +252,6 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
252}) 252})
253#endif 253#endif
254 254
255#ifdef CONFIG_X86_CMPXCHG64
256
257static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long long old, 255static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long long old,
258 unsigned long long new) 256 unsigned long long new)
259{ 257{
@@ -289,5 +287,3 @@ static inline unsigned long long __cmpxchg64_local(volatile void *ptr,
289 ((__typeof__(*(ptr)))__cmpxchg64_local((ptr),(unsigned long long)(o),\ 287 ((__typeof__(*(ptr)))__cmpxchg64_local((ptr),(unsigned long long)(o),\
290 (unsigned long long)(n))) 288 (unsigned long long)(n)))
291#endif 289#endif
292
293#endif
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h
index c961c03cf1e2..7b3aa28ebc6e 100644
--- a/include/asm-i386/cpufeature.h
+++ b/include/asm-i386/cpufeature.h
@@ -79,7 +79,7 @@
79#define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */ 79#define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */
80#define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */ 80#define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */
81#define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */ 81#define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */
82#define X86_FEATURE_LAPIC_TIMER_BROKEN (3*32+ 14) /* lapic timer broken in C1 */ 82/* 14 free */
83#define X86_FEATURE_SYNC_RDTSC (3*32+15) /* RDTSC synchronizes the CPU */ 83#define X86_FEATURE_SYNC_RDTSC (3*32+15) /* RDTSC synchronizes the CPU */
84#define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */ 84#define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */
85 85
diff --git a/include/asm-i386/e820.h b/include/asm-i386/e820.h
index c03290ccecb2..cf67dbb1db79 100644
--- a/include/asm-i386/e820.h
+++ b/include/asm-i386/e820.h
@@ -47,6 +47,14 @@ extern void e820_register_memory(void);
47extern void limit_regions(unsigned long long size); 47extern void limit_regions(unsigned long long size);
48extern void print_memory_map(char *who); 48extern void print_memory_map(char *who);
49 49
50#if defined(CONFIG_PM) && defined(CONFIG_HIBERNATION)
51extern void e820_mark_nosave_regions(void);
52#else
53static inline void e820_mark_nosave_regions(void)
54{
55}
56#endif
57
50#endif/*!__ASSEMBLY__*/ 58#endif/*!__ASSEMBLY__*/
51 59
52#endif/*__E820_HEADER*/ 60#endif/*__E820_HEADER*/
diff --git a/include/asm-i386/geode.h b/include/asm-i386/geode.h
new file mode 100644
index 000000000000..6da4bbbea3dc
--- /dev/null
+++ b/include/asm-i386/geode.h
@@ -0,0 +1,159 @@
1/*
2 * AMD Geode definitions
3 * Copyright (C) 2006, Advanced Micro Devices, Inc.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public License
7 * as published by the Free Software Foundation.
8 */
9
10#ifndef _ASM_GEODE_H_
11#define _ASM_GEODE_H_
12
13#include <asm/processor.h>
14#include <linux/io.h>
15
16/* Generic southbridge functions */
17
18#define GEODE_DEV_PMS 0
19#define GEODE_DEV_ACPI 1
20#define GEODE_DEV_GPIO 2
21#define GEODE_DEV_MFGPT 3
22
23extern int geode_get_dev_base(unsigned int dev);
24
25/* Useful macros */
26#define geode_pms_base() geode_get_dev_base(GEODE_DEV_PMS)
27#define geode_acpi_base() geode_get_dev_base(GEODE_DEV_ACPI)
28#define geode_gpio_base() geode_get_dev_base(GEODE_DEV_GPIO)
29#define geode_mfgpt_base() geode_get_dev_base(GEODE_DEV_MFGPT)
30
31/* MSRS */
32
33#define GX_GLCP_SYS_RSTPLL 0x4C000014
34
35#define MSR_LBAR_SMB 0x5140000B
36#define MSR_LBAR_GPIO 0x5140000C
37#define MSR_LBAR_MFGPT 0x5140000D
38#define MSR_LBAR_ACPI 0x5140000E
39#define MSR_LBAR_PMS 0x5140000F
40
41#define MSR_PIC_YSEL_LOW 0x51400020
42#define MSR_PIC_YSEL_HIGH 0x51400021
43#define MSR_PIC_ZSEL_LOW 0x51400022
44#define MSR_PIC_ZSEL_HIGH 0x51400023
45
46#define MFGPT_IRQ_MSR 0x51400028
47#define MFGPT_NR_MSR 0x51400029
48
49/* Resource Sizes */
50
51#define LBAR_GPIO_SIZE 0xFF
52#define LBAR_MFGPT_SIZE 0x40
53#define LBAR_ACPI_SIZE 0x40
54#define LBAR_PMS_SIZE 0x80
55
56/* ACPI registers (PMS block) */
57
58/*
59 * PM1_EN is only valid when VSA is enabled for 16 bit reads.
60 * When VSA is not enabled, *always* read both PM1_STS and PM1_EN
61 * with a 32 bit read at offset 0x0
62 */
63
64#define PM1_STS 0x00
65#define PM1_EN 0x02
66#define PM1_CNT 0x08
67#define PM2_CNT 0x0C
68#define PM_TMR 0x10
69#define PM_GPE0_STS 0x18
70#define PM_GPE0_EN 0x1C
71
72/* PMC registers (PMS block) */
73
74#define PM_SSD 0x00
75#define PM_SCXA 0x04
76#define PM_SCYA 0x08
77#define PM_OUT_SLPCTL 0x0C
78#define PM_SCLK 0x10
79#define PM_SED 0x1
80#define PM_SCXD 0x18
81#define PM_SCYD 0x1C
82#define PM_IN_SLPCTL 0x20
83#define PM_WKD 0x30
84#define PM_WKXD 0x34
85#define PM_RD 0x38
86#define PM_WKXA 0x3C
87#define PM_FSD 0x40
88#define PM_TSD 0x44
89#define PM_PSD 0x48
90#define PM_NWKD 0x4C
91#define PM_AWKD 0x50
92#define PM_SSC 0x54
93
94/* GPIO */
95
96#define GPIO_OUTPUT_VAL 0x00
97#define GPIO_OUTPUT_ENABLE 0x04
98#define GPIO_OUTPUT_OPEN_DRAIN 0x08
99#define GPIO_OUTPUT_INVERT 0x0C
100#define GPIO_OUTPUT_AUX1 0x10
101#define GPIO_OUTPUT_AUX2 0x14
102#define GPIO_PULL_UP 0x18
103#define GPIO_PULL_DOWN 0x1C
104#define GPIO_INPUT_ENABLE 0x20
105#define GPIO_INPUT_INVERT 0x24
106#define GPIO_INPUT_FILTER 0x28
107#define GPIO_INPUT_EVENT_COUNT 0x2C
108#define GPIO_READ_BACK 0x30
109#define GPIO_INPUT_AUX1 0x34
110#define GPIO_EVENTS_ENABLE 0x38
111#define GPIO_LOCK_ENABLE 0x3C
112#define GPIO_POSITIVE_EDGE_EN 0x40
113#define GPIO_NEGATIVE_EDGE_EN 0x44
114#define GPIO_POSITIVE_EDGE_STS 0x48
115#define GPIO_NEGATIVE_EDGE_STS 0x4C
116
117#define GPIO_MAP_X 0xE0
118#define GPIO_MAP_Y 0xE4
119#define GPIO_MAP_Z 0xE8
120#define GPIO_MAP_W 0xEC
121
122extern void geode_gpio_set(unsigned int, unsigned int);
123extern void geode_gpio_clear(unsigned int, unsigned int);
124extern int geode_gpio_isset(unsigned int, unsigned int);
125extern void geode_gpio_setup_event(unsigned int, int, int);
126extern void geode_gpio_set_irq(unsigned int, unsigned int);
127
128static inline void geode_gpio_event_irq(unsigned int gpio, int pair)
129{
130 geode_gpio_setup_event(gpio, pair, 0);
131}
132
133static inline void geode_gpio_event_pme(unsigned int gpio, int pair)
134{
135 geode_gpio_setup_event(gpio, pair, 1);
136}
137
138/* Specific geode tests */
139
140static inline int is_geode_gx(void)
141{
142 return ((boot_cpu_data.x86_vendor == X86_VENDOR_NSC) &&
143 (boot_cpu_data.x86 == 5) &&
144 (boot_cpu_data.x86_model == 5));
145}
146
147static inline int is_geode_lx(void)
148{
149 return ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
150 (boot_cpu_data.x86 == 5) &&
151 (boot_cpu_data.x86_model == 10));
152}
153
154static inline int is_geode(void)
155{
156 return (is_geode_gx() || is_geode_lx());
157}
158
159#endif
diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h
index dddeedf504b7..c82dc7ed96b3 100644
--- a/include/asm-i386/hpet.h
+++ b/include/asm-i386/hpet.h
@@ -4,112 +4,82 @@
4 4
5#ifdef CONFIG_HPET_TIMER 5#ifdef CONFIG_HPET_TIMER
6 6
7#include <linux/errno.h>
8#include <linux/module.h>
9#include <linux/sched.h>
10#include <linux/kernel.h>
11#include <linux/param.h>
12#include <linux/string.h>
13#include <linux/mm.h>
14#include <linux/interrupt.h>
15#include <linux/time.h>
16#include <linux/delay.h>
17#include <linux/init.h>
18#include <linux/smp.h>
19
20#include <asm/io.h>
21#include <asm/smp.h>
22#include <asm/irq.h>
23#include <asm/msr.h>
24#include <asm/delay.h>
25#include <asm/mpspec.h>
26#include <asm/uaccess.h>
27#include <asm/processor.h>
28
29#include <linux/timex.h>
30
31/* 7/*
32 * Documentation on HPET can be found at: 8 * Documentation on HPET can be found at:
33 * http://www.intel.com/ial/home/sp/pcmmspec.htm 9 * http://www.intel.com/ial/home/sp/pcmmspec.htm
34 * ftp://download.intel.com/ial/home/sp/mmts098.pdf 10 * ftp://download.intel.com/ial/home/sp/mmts098.pdf
35 */ 11 */
36 12
37#define HPET_MMAP_SIZE 1024 13#define HPET_MMAP_SIZE 1024
38 14
39#define HPET_ID 0x000 15#define HPET_ID 0x000
40#define HPET_PERIOD 0x004 16#define HPET_PERIOD 0x004
41#define HPET_CFG 0x010 17#define HPET_CFG 0x010
42#define HPET_STATUS 0x020 18#define HPET_STATUS 0x020
43#define HPET_COUNTER 0x0f0 19#define HPET_COUNTER 0x0f0
44#define HPET_T0_CFG 0x100 20#define HPET_T0_CFG 0x100
45#define HPET_T0_CMP 0x108 21#define HPET_T0_CMP 0x108
46#define HPET_T0_ROUTE 0x110 22#define HPET_T0_ROUTE 0x110
47#define HPET_T1_CFG 0x120 23#define HPET_T1_CFG 0x120
48#define HPET_T1_CMP 0x128 24#define HPET_T1_CMP 0x128
49#define HPET_T1_ROUTE 0x130 25#define HPET_T1_ROUTE 0x130
50#define HPET_T2_CFG 0x140 26#define HPET_T2_CFG 0x140
51#define HPET_T2_CMP 0x148 27#define HPET_T2_CMP 0x148
52#define HPET_T2_ROUTE 0x150 28#define HPET_T2_ROUTE 0x150
53 29
54#define HPET_ID_LEGSUP 0x00008000 30#define HPET_ID_REV 0x000000ff
55#define HPET_ID_NUMBER 0x00001f00 31#define HPET_ID_NUMBER 0x00001f00
56#define HPET_ID_REV 0x000000ff 32#define HPET_ID_64BIT 0x00002000
33#define HPET_ID_LEGSUP 0x00008000
34#define HPET_ID_VENDOR 0xffff0000
57#define HPET_ID_NUMBER_SHIFT 8 35#define HPET_ID_NUMBER_SHIFT 8
36#define HPET_ID_VENDOR_SHIFT 16
58 37
59#define HPET_CFG_ENABLE 0x001 38#define HPET_ID_VENDOR_8086 0x8086
60#define HPET_CFG_LEGACY 0x002 39
40#define HPET_CFG_ENABLE 0x001
41#define HPET_CFG_LEGACY 0x002
61#define HPET_LEGACY_8254 2 42#define HPET_LEGACY_8254 2
62#define HPET_LEGACY_RTC 8 43#define HPET_LEGACY_RTC 8
63 44
64#define HPET_TN_ENABLE 0x004 45#define HPET_TN_LEVEL 0x0002
65#define HPET_TN_PERIODIC 0x008 46#define HPET_TN_ENABLE 0x0004
66#define HPET_TN_PERIODIC_CAP 0x010 47#define HPET_TN_PERIODIC 0x0008
67#define HPET_TN_SETVAL 0x040 48#define HPET_TN_PERIODIC_CAP 0x0010
68#define HPET_TN_32BIT 0x100 49#define HPET_TN_64BIT_CAP 0x0020
69 50#define HPET_TN_SETVAL 0x0040
70/* Use our own asm for 64 bit multiply/divide */ 51#define HPET_TN_32BIT 0x0100
71#define ASM_MUL64_REG(eax_out,edx_out,reg_in,eax_in) \ 52#define HPET_TN_ROUTE 0x3e00
72 __asm__ __volatile__("mull %2" \ 53#define HPET_TN_FSB 0x4000
73 :"=a" (eax_out), "=d" (edx_out) \ 54#define HPET_TN_FSB_CAP 0x8000
74 :"r" (reg_in), "0" (eax_in)) 55#define HPET_TN_ROUTE_SHIFT 9
75 56
76#define ASM_DIV64_REG(eax_out,edx_out,reg_in,eax_in,edx_in) \
77 __asm__ __volatile__("divl %2" \
78 :"=a" (eax_out), "=d" (edx_out) \
79 :"r" (reg_in), "0" (eax_in), "1" (edx_in))
80
81#define KERNEL_TICK_USEC (1000000UL/HZ) /* tick value in microsec */
82/* Max HPET Period is 10^8 femto sec as in HPET spec */ 57/* Max HPET Period is 10^8 femto sec as in HPET spec */
83#define HPET_MAX_PERIOD (100000000UL) 58#define HPET_MAX_PERIOD 100000000UL
84/* 59/*
85 * Min HPET period is 10^5 femto sec just for safety. If it is less than this, 60 * Min HPET period is 10^5 femto sec just for safety. If it is less than this,
86 * then 32 bit HPET counter wrapsaround in less than 0.5 sec. 61 * then 32 bit HPET counter wrapsaround in less than 0.5 sec.
87 */ 62 */
88#define HPET_MIN_PERIOD (100000UL) 63#define HPET_MIN_PERIOD 100000UL
89#define HPET_TICK_RATE (HZ * 100000UL)
90 64
91extern unsigned long hpet_address; /* hpet memory map physical address */ 65/* hpet memory map physical address */
66extern unsigned long hpet_address;
92extern int is_hpet_enabled(void); 67extern int is_hpet_enabled(void);
93
94#ifdef CONFIG_X86_64
95extern unsigned long hpet_tick; /* hpet clks count per tick */
96extern int hpet_use_timer;
97extern int hpet_rtc_timer_init(void);
98extern int hpet_enable(void); 68extern int hpet_enable(void);
99extern int is_hpet_capable(void);
100extern int hpet_readl(unsigned long a);
101#else
102extern int hpet_enable(void);
103#endif
104 69
105#ifdef CONFIG_HPET_EMULATE_RTC 70#ifdef CONFIG_HPET_EMULATE_RTC
71
72#include <linux/interrupt.h>
73
106extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask); 74extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask);
107extern int hpet_set_rtc_irq_bit(unsigned long bit_mask); 75extern int hpet_set_rtc_irq_bit(unsigned long bit_mask);
108extern int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec); 76extern int hpet_set_alarm_time(unsigned char hrs, unsigned char min,
77 unsigned char sec);
109extern int hpet_set_periodic_freq(unsigned long freq); 78extern int hpet_set_periodic_freq(unsigned long freq);
110extern int hpet_rtc_dropped_irq(void); 79extern int hpet_rtc_dropped_irq(void);
111extern int hpet_rtc_timer_init(void); 80extern int hpet_rtc_timer_init(void);
112extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id); 81extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id);
82
113#endif /* CONFIG_HPET_EMULATE_RTC */ 83#endif /* CONFIG_HPET_EMULATE_RTC */
114 84
115#else 85#else
diff --git a/include/asm-i386/i8253.h b/include/asm-i386/i8253.h
index 6cb0dd4dcdde..7577d058d86e 100644
--- a/include/asm-i386/i8253.h
+++ b/include/asm-i386/i8253.h
@@ -3,19 +3,15 @@
3 3
4#include <linux/clockchips.h> 4#include <linux/clockchips.h>
5 5
6/* i8253A PIT registers */
7#define PIT_MODE 0x43
8#define PIT_CH0 0x40
9#define PIT_CH2 0x42
10
6extern spinlock_t i8253_lock; 11extern spinlock_t i8253_lock;
7 12
8extern struct clock_event_device *global_clock_event; 13extern struct clock_event_device *global_clock_event;
9 14
10/** 15extern void setup_pit_timer(void);
11 * pit_interrupt_hook - hook into timer tick
12 * @regs: standard registers from interrupt
13 *
14 * Call the global clock event handler.
15 **/
16static inline void pit_interrupt_hook(void)
17{
18 global_clock_event->event_handler(global_clock_event);
19}
20 16
21#endif /* __ASM_I8253_H__ */ 17#endif /* __ASM_I8253_H__ */
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h
index 7b65b5b00034..e8e0bd641120 100644
--- a/include/asm-i386/io.h
+++ b/include/asm-i386/io.h
@@ -112,6 +112,9 @@ extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsign
112 * writew/writel functions and the other mmio helpers. The returned 112 * writew/writel functions and the other mmio helpers. The returned
113 * address is not guaranteed to be usable directly as a virtual 113 * address is not guaranteed to be usable directly as a virtual
114 * address. 114 * address.
115 *
116 * If the area you are trying to map is a PCI BAR you should have a
117 * look at pci_iomap().
115 */ 118 */
116 119
117static inline void __iomem * ioremap(unsigned long offset, unsigned long size) 120static inline void __iomem * ioremap(unsigned long offset, unsigned long size)
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h
index 340764076d5f..dbe734ddf2af 100644
--- a/include/asm-i386/io_apic.h
+++ b/include/asm-i386/io_apic.h
@@ -150,7 +150,6 @@ extern int (*ioapic_renumber_irq)(int ioapic, int irq);
150 150
151#else /* !CONFIG_X86_IO_APIC */ 151#else /* !CONFIG_X86_IO_APIC */
152#define io_apic_assign_pci_irqs 0 152#define io_apic_assign_pci_irqs 0
153static inline void disable_ioapic_setup(void) { }
154#endif 153#endif
155 154
156#endif 155#endif
diff --git a/include/asm-i386/irq.h b/include/asm-i386/irq.h
index 9e15ce0006eb..36f310632c49 100644
--- a/include/asm-i386/irq.h
+++ b/include/asm-i386/irq.h
@@ -41,6 +41,7 @@ extern int irqbalance_disable(char *str);
41extern void fixup_irqs(cpumask_t map); 41extern void fixup_irqs(cpumask_t map);
42#endif 42#endif
43 43
44unsigned int do_IRQ(struct pt_regs *regs);
44void init_IRQ(void); 45void init_IRQ(void);
45void __init native_init_IRQ(void); 46void __init native_init_IRQ(void);
46 47
diff --git a/include/asm-i386/ist.h b/include/asm-i386/ist.h
index d13d1e68afa9..ef2003ebc6f9 100644
--- a/include/asm-i386/ist.h
+++ b/include/asm-i386/ist.h
@@ -19,11 +19,13 @@
19 19
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#include <linux/types.h>
23
22struct ist_info { 24struct ist_info {
23 unsigned long signature; 25 u32 signature;
24 unsigned long command; 26 u32 command;
25 unsigned long event; 27 u32 event;
26 unsigned long perf_level; 28 u32 perf_level;
27}; 29};
28 30
29extern struct ist_info ist_info; 31extern struct ist_info ist_info;
diff --git a/include/asm-i386/kprobes.h b/include/asm-i386/kprobes.h
index 8774d06689da..06f7303c30ca 100644
--- a/include/asm-i386/kprobes.h
+++ b/include/asm-i386/kprobes.h
@@ -42,7 +42,6 @@ typedef u8 kprobe_opcode_t;
42 ? (MAX_STACK_SIZE) \ 42 ? (MAX_STACK_SIZE) \
43 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 43 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
44 44
45#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
46#define ARCH_SUPPORTS_KRETPROBES 45#define ARCH_SUPPORTS_KRETPROBES
47#define ARCH_INACTIVE_KPROBE_COUNT 0 46#define ARCH_INACTIVE_KPROBE_COUNT 0
48#define flush_insn_slot(p) do { } while (0) 47#define flush_insn_slot(p) do { } while (0)
diff --git a/include/asm-i386/mach-default/do_timer.h b/include/asm-i386/mach-default/do_timer.h
index 56e5689863ae..23ecda0b28a0 100644
--- a/include/asm-i386/mach-default/do_timer.h
+++ b/include/asm-i386/mach-default/do_timer.h
@@ -12,5 +12,5 @@
12 12
13static inline void do_timer_interrupt_hook(void) 13static inline void do_timer_interrupt_hook(void)
14{ 14{
15 pit_interrupt_hook(); 15 global_clock_event->event_handler(global_clock_event);
16} 16}
diff --git a/include/asm-i386/mach-default/io_ports.h b/include/asm-i386/mach-default/io_ports.h
index a96d9f6604ee..48540ba97166 100644
--- a/include/asm-i386/mach-default/io_ports.h
+++ b/include/asm-i386/mach-default/io_ports.h
@@ -7,11 +7,6 @@
7#ifndef _MACH_IO_PORTS_H 7#ifndef _MACH_IO_PORTS_H
8#define _MACH_IO_PORTS_H 8#define _MACH_IO_PORTS_H
9 9
10/* i8253A PIT registers */
11#define PIT_MODE 0x43
12#define PIT_CH0 0x40
13#define PIT_CH2 0x42
14
15/* i8259A PIC registers */ 10/* i8259A PIC registers */
16#define PIC_MASTER_CMD 0x20 11#define PIC_MASTER_CMD 0x20
17#define PIC_MASTER_IMR 0x21 12#define PIC_MASTER_IMR 0x21
diff --git a/include/asm-i386/mach-default/irq_vectors_limits.h b/include/asm-i386/mach-default/irq_vectors_limits.h
index 7f161e760be6..a90c7a60109f 100644
--- a/include/asm-i386/mach-default/irq_vectors_limits.h
+++ b/include/asm-i386/mach-default/irq_vectors_limits.h
@@ -1,7 +1,7 @@
1#ifndef _ASM_IRQ_VECTORS_LIMITS_H 1#ifndef _ASM_IRQ_VECTORS_LIMITS_H
2#define _ASM_IRQ_VECTORS_LIMITS_H 2#define _ASM_IRQ_VECTORS_LIMITS_H
3 3
4#ifdef CONFIG_X86_IO_APIC 4#if defined(CONFIG_X86_IO_APIC) || defined(CONFIG_PARAVIRT)
5#define NR_IRQS 224 5#define NR_IRQS 224
6# if (224 >= 32 * NR_CPUS) 6# if (224 >= 32 * NR_CPUS)
7# define NR_IRQ_VECTORS NR_IRQS 7# define NR_IRQ_VECTORS NR_IRQS
diff --git a/include/asm-i386/mach-default/mach_reboot.h b/include/asm-i386/mach-default/mach_reboot.h
index a955e57ad016..e23fd9fbebb3 100644
--- a/include/asm-i386/mach-default/mach_reboot.h
+++ b/include/asm-i386/mach-default/mach_reboot.h
@@ -19,14 +19,37 @@ static inline void kb_wait(void)
19static inline void mach_reboot(void) 19static inline void mach_reboot(void)
20{ 20{
21 int i; 21 int i;
22
23 /* old method, works on most machines */
22 for (i = 0; i < 10; i++) { 24 for (i = 0; i < 10; i++) {
23 kb_wait(); 25 kb_wait();
24 udelay(50); 26 udelay(50);
27 outb(0xfe, 0x64); /* pulse reset low */
28 udelay(50);
29 }
30
31 /* New method: sets the "System flag" which, when set, indicates
32 * successful completion of the keyboard controller self-test (Basic
33 * Assurance Test, BAT). This is needed for some machines with no
34 * keyboard plugged in. This read-modify-write sequence sets only the
35 * system flag
36 */
37 for (i = 0; i < 10; i++) {
38 int cmd;
39
40 outb(0x20, 0x64); /* read Controller Command Byte */
41 udelay(50);
42 kb_wait();
43 udelay(50);
44 cmd = inb(0x60);
45 udelay(50);
46 kb_wait();
47 udelay(50);
25 outb(0x60, 0x64); /* write Controller Command Byte */ 48 outb(0x60, 0x64); /* write Controller Command Byte */
26 udelay(50); 49 udelay(50);
27 kb_wait(); 50 kb_wait();
28 udelay(50); 51 udelay(50);
29 outb(0x14, 0x60); /* set "System flag" */ 52 outb(cmd | 0x04, 0x60); /* set "System flag" */
30 udelay(50); 53 udelay(50);
31 kb_wait(); 54 kb_wait();
32 udelay(50); 55 udelay(50);
diff --git a/include/asm-i386/mach-default/mach_wakecpu.h b/include/asm-i386/mach-default/mach_wakecpu.h
index 673b85c9b273..3ebb17893aa5 100644
--- a/include/asm-i386/mach-default/mach_wakecpu.h
+++ b/include/asm-i386/mach-default/mach_wakecpu.h
@@ -15,7 +15,8 @@
15 15
16static inline void wait_for_init_deassert(atomic_t *deassert) 16static inline void wait_for_init_deassert(atomic_t *deassert)
17{ 17{
18 while (!atomic_read(deassert)); 18 while (!atomic_read(deassert))
19 cpu_relax();
19 return; 20 return;
20} 21}
21 22
diff --git a/include/asm-i386/mach-es7000/mach_wakecpu.h b/include/asm-i386/mach-es7000/mach_wakecpu.h
index efc903b73486..84ff58314501 100644
--- a/include/asm-i386/mach-es7000/mach_wakecpu.h
+++ b/include/asm-i386/mach-es7000/mach_wakecpu.h
@@ -31,7 +31,8 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
31static inline void wait_for_init_deassert(atomic_t *deassert) 31static inline void wait_for_init_deassert(atomic_t *deassert)
32{ 32{
33#ifdef WAKE_SECONDARY_VIA_INIT 33#ifdef WAKE_SECONDARY_VIA_INIT
34 while (!atomic_read(deassert)); 34 while (!atomic_read(deassert))
35 cpu_relax();
35#endif 36#endif
36 return; 37 return;
37} 38}
diff --git a/include/asm-i386/mach-voyager/do_timer.h b/include/asm-i386/mach-voyager/do_timer.h
index 60f9dcc15d54..bc2b58926308 100644
--- a/include/asm-i386/mach-voyager/do_timer.h
+++ b/include/asm-i386/mach-voyager/do_timer.h
@@ -12,7 +12,7 @@
12 **/ 12 **/
13static inline void do_timer_interrupt_hook(void) 13static inline void do_timer_interrupt_hook(void)
14{ 14{
15 pit_interrupt_hook(); 15 global_clock_event->event_handler(global_clock_event);
16 voyager_timer_interrupt(); 16 voyager_timer_interrupt();
17} 17}
18 18
diff --git a/include/asm-i386/mc146818rtc.h b/include/asm-i386/mc146818rtc.h
index 99a890047023..1613b42eaf58 100644
--- a/include/asm-i386/mc146818rtc.h
+++ b/include/asm-i386/mc146818rtc.h
@@ -6,6 +6,7 @@
6 6
7#include <asm/io.h> 7#include <asm/io.h>
8#include <asm/system.h> 8#include <asm/system.h>
9#include <asm/processor.h>
9#include <linux/mc146818rtc.h> 10#include <linux/mc146818rtc.h>
10 11
11#ifndef RTC_PORT 12#ifndef RTC_PORT
@@ -43,8 +44,10 @@ static inline void lock_cmos(unsigned char reg)
43 unsigned long new; 44 unsigned long new;
44 new = ((smp_processor_id()+1) << 8) | reg; 45 new = ((smp_processor_id()+1) << 8) | reg;
45 for (;;) { 46 for (;;) {
46 if (cmos_lock) 47 if (cmos_lock) {
48 cpu_relax();
47 continue; 49 continue;
50 }
48 if (__cmpxchg(&cmos_lock, 0, new, sizeof(cmos_lock)) == 0) 51 if (__cmpxchg(&cmos_lock, 0, new, sizeof(cmos_lock)) == 0)
49 return; 52 return;
50 } 53 }
diff --git a/include/asm-i386/mce.h b/include/asm-i386/mce.h
index b0a02ee34ffd..d56d89742e8f 100644
--- a/include/asm-i386/mce.h
+++ b/include/asm-i386/mce.h
@@ -5,3 +5,7 @@ extern void mcheck_init(struct cpuinfo_x86 *c);
5#endif 5#endif
6 6
7extern int mce_disabled; 7extern int mce_disabled;
8
9extern void stop_mce(void);
10extern void restart_mce(void);
11
diff --git a/include/asm-i386/mmu_context.h b/include/asm-i386/mmu_context.h
index 8198d1cca1f3..7eb0b0b1fb3c 100644
--- a/include/asm-i386/mmu_context.h
+++ b/include/asm-i386/mmu_context.h
@@ -32,6 +32,8 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
32#endif 32#endif
33} 33}
34 34
35void leave_mm(unsigned long cpu);
36
35static inline void switch_mm(struct mm_struct *prev, 37static inline void switch_mm(struct mm_struct *prev,
36 struct mm_struct *next, 38 struct mm_struct *next,
37 struct task_struct *tsk) 39 struct task_struct *tsk)
diff --git a/include/asm-i386/nmi.h b/include/asm-i386/nmi.h
index fb1e133efd9f..70a958a8e381 100644
--- a/include/asm-i386/nmi.h
+++ b/include/asm-i386/nmi.h
@@ -33,11 +33,12 @@ extern int nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
33 33
34extern atomic_t nmi_active; 34extern atomic_t nmi_active;
35extern unsigned int nmi_watchdog; 35extern unsigned int nmi_watchdog;
36#define NMI_DEFAULT -1 36#define NMI_DISABLED -1
37#define NMI_NONE 0 37#define NMI_NONE 0
38#define NMI_IO_APIC 1 38#define NMI_IO_APIC 1
39#define NMI_LOCAL_APIC 2 39#define NMI_LOCAL_APIC 2
40#define NMI_INVALID 3 40#define NMI_INVALID 3
41#define NMI_DEFAULT NMI_DISABLED
41 42
42struct ctl_table; 43struct ctl_table;
43struct file; 44struct file;
@@ -57,5 +58,7 @@ unsigned lapic_adjust_nmi_hz(unsigned hz);
57int lapic_watchdog_ok(void); 58int lapic_watchdog_ok(void);
58void disable_lapic_nmi_watchdog(void); 59void disable_lapic_nmi_watchdog(void);
59void enable_lapic_nmi_watchdog(void); 60void enable_lapic_nmi_watchdog(void);
61void stop_nmi(void);
62void restart_nmi(void);
60 63
61#endif /* ASM_NMI_H */ 64#endif /* ASM_NMI_H */
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index 99cf5d3692a9..80ecc66b6d86 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -44,7 +44,6 @@
44extern int nx_enabled; 44extern int nx_enabled;
45 45
46#ifdef CONFIG_X86_PAE 46#ifdef CONFIG_X86_PAE
47extern unsigned long long __supported_pte_mask;
48typedef struct { unsigned long pte_low, pte_high; } pte_t; 47typedef struct { unsigned long pte_low, pte_high; } pte_t;
49typedef struct { unsigned long long pmd; } pmd_t; 48typedef struct { unsigned long long pmd; } pmd_t;
50typedef struct { unsigned long long pgd; } pgd_t; 49typedef struct { unsigned long long pgd; } pgd_t;
diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h
index 7f846a7d6bcc..9fa3fa9e62d1 100644
--- a/include/asm-i386/paravirt.h
+++ b/include/asm-i386/paravirt.h
@@ -47,11 +47,14 @@ struct paravirt_ops
47 * The patch function should return the number of bytes of code 47 * The patch function should return the number of bytes of code
48 * generated, as we nop pad the rest in generic code. 48 * generated, as we nop pad the rest in generic code.
49 */ 49 */
50 unsigned (*patch)(u8 type, u16 clobber, void *firstinsn, unsigned len); 50 unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
51 unsigned long addr, unsigned len);
51 52
52 /* Basic arch-specific setup */ 53 /* Basic arch-specific setup */
53 void (*arch_setup)(void); 54 void (*arch_setup)(void);
54 char *(*memory_setup)(void); 55 char *(*memory_setup)(void);
56 void (*post_allocator_init)(void);
57
55 void (*init_IRQ)(void); 58 void (*init_IRQ)(void);
56 void (*time_init)(void); 59 void (*time_init)(void);
57 60
@@ -116,7 +119,7 @@ struct paravirt_ops
116 119
117 u64 (*read_tsc)(void); 120 u64 (*read_tsc)(void);
118 u64 (*read_pmc)(void); 121 u64 (*read_pmc)(void);
119 u64 (*get_scheduled_cycles)(void); 122 unsigned long long (*sched_clock)(void);
120 unsigned long (*get_cpu_khz)(void); 123 unsigned long (*get_cpu_khz)(void);
121 124
122 /* Segment descriptor handling */ 125 /* Segment descriptor handling */
@@ -173,7 +176,7 @@ struct paravirt_ops
173 unsigned long va); 176 unsigned long va);
174 177
175 /* Hooks for allocating/releasing pagetable pages */ 178 /* Hooks for allocating/releasing pagetable pages */
176 void (*alloc_pt)(u32 pfn); 179 void (*alloc_pt)(struct mm_struct *mm, u32 pfn);
177 void (*alloc_pd)(u32 pfn); 180 void (*alloc_pd)(u32 pfn);
178 void (*alloc_pd_clone)(u32 pfn, u32 clonepfn, u32 start, u32 count); 181 void (*alloc_pd_clone)(u32 pfn, u32 clonepfn, u32 start, u32 count);
179 void (*release_pt)(u32 pfn); 182 void (*release_pt)(u32 pfn);
@@ -251,15 +254,19 @@ extern struct paravirt_ops paravirt_ops;
251 254
252unsigned paravirt_patch_nop(void); 255unsigned paravirt_patch_nop(void);
253unsigned paravirt_patch_ignore(unsigned len); 256unsigned paravirt_patch_ignore(unsigned len);
254unsigned paravirt_patch_call(void *target, u16 tgt_clobbers, 257unsigned paravirt_patch_call(void *insnbuf,
255 void *site, u16 site_clobbers, 258 const void *target, u16 tgt_clobbers,
259 unsigned long addr, u16 site_clobbers,
256 unsigned len); 260 unsigned len);
257unsigned paravirt_patch_jmp(void *target, void *site, unsigned len); 261unsigned paravirt_patch_jmp(const void *target, void *insnbuf,
258unsigned paravirt_patch_default(u8 type, u16 clobbers, void *site, unsigned len); 262 unsigned long addr, unsigned len);
263unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
264 unsigned long addr, unsigned len);
259 265
260unsigned paravirt_patch_insns(void *site, unsigned len, 266unsigned paravirt_patch_insns(void *insnbuf, unsigned len,
261 const char *start, const char *end); 267 const char *start, const char *end);
262 268
269int paravirt_disable_iospace(void);
263 270
264/* 271/*
265 * This generates an indirect call based on the operation type number. 272 * This generates an indirect call based on the operation type number.
@@ -563,7 +570,10 @@ static inline u64 paravirt_read_tsc(void)
563 570
564#define rdtscll(val) (val = paravirt_read_tsc()) 571#define rdtscll(val) (val = paravirt_read_tsc())
565 572
566#define get_scheduled_cycles(val) (val = paravirt_ops.get_scheduled_cycles()) 573static inline unsigned long long paravirt_sched_clock(void)
574{
575 return PVOP_CALL0(unsigned long long, sched_clock);
576}
567#define calculate_cpu_khz() (paravirt_ops.get_cpu_khz()) 577#define calculate_cpu_khz() (paravirt_ops.get_cpu_khz())
568 578
569#define write_tsc(val1,val2) wrmsr(0x10, val1, val2) 579#define write_tsc(val1,val2) wrmsr(0x10, val1, val2)
@@ -669,6 +679,12 @@ static inline void setup_secondary_clock(void)
669} 679}
670#endif 680#endif
671 681
682static inline void paravirt_post_allocator_init(void)
683{
684 if (paravirt_ops.post_allocator_init)
685 (*paravirt_ops.post_allocator_init)();
686}
687
672static inline void paravirt_pagetable_setup_start(pgd_t *base) 688static inline void paravirt_pagetable_setup_start(pgd_t *base)
673{ 689{
674 if (paravirt_ops.pagetable_setup_start) 690 if (paravirt_ops.pagetable_setup_start)
@@ -725,9 +741,9 @@ static inline void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm,
725 PVOP_VCALL3(flush_tlb_others, &cpumask, mm, va); 741 PVOP_VCALL3(flush_tlb_others, &cpumask, mm, va);
726} 742}
727 743
728static inline void paravirt_alloc_pt(unsigned pfn) 744static inline void paravirt_alloc_pt(struct mm_struct *mm, unsigned pfn)
729{ 745{
730 PVOP_VCALL1(alloc_pt, pfn); 746 PVOP_VCALL2(alloc_pt, mm, pfn);
731} 747}
732static inline void paravirt_release_pt(unsigned pfn) 748static inline void paravirt_release_pt(unsigned pfn)
733{ 749{
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index 392d3fe5d45e..4fcacc711385 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -3,6 +3,14 @@
3 3
4 4
5#ifdef __KERNEL__ 5#ifdef __KERNEL__
6
7struct pci_sysdata {
8 int node; /* NUMA node */
9};
10
11/* scan a bus after allocating a pci_sysdata for it */
12extern struct pci_bus *pci_scan_bus_with_sysdata(int busno);
13
6#include <linux/mm.h> /* for struct page */ 14#include <linux/mm.h> /* for struct page */
7 15
8/* Can be used to override the logic in pci_scan_bus for skipping 16/* Can be used to override the logic in pci_scan_bus for skipping
diff --git a/include/asm-i386/percpu.h b/include/asm-i386/percpu.h
index f54830b5d5ac..a7ebd436f3cc 100644
--- a/include/asm-i386/percpu.h
+++ b/include/asm-i386/percpu.h
@@ -54,6 +54,11 @@ extern unsigned long __per_cpu_offset[];
54#define DEFINE_PER_CPU(type, name) \ 54#define DEFINE_PER_CPU(type, name) \
55 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name 55 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
56 56
57#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
58 __attribute__((__section__(".data.percpu.shared_aligned"))) \
59 __typeof__(type) per_cpu__##name \
60 ____cacheline_aligned_in_smp
61
57/* We can use this directly for local CPU (faster). */ 62/* We can use this directly for local CPU (faster). */
58DECLARE_PER_CPU(unsigned long, this_cpu_off); 63DECLARE_PER_CPU(unsigned long, this_cpu_off);
59 64
diff --git a/include/asm-i386/pgalloc.h b/include/asm-i386/pgalloc.h
index d07b7afc2692..f2fc33ceb9f2 100644
--- a/include/asm-i386/pgalloc.h
+++ b/include/asm-i386/pgalloc.h
@@ -7,7 +7,7 @@
7#ifdef CONFIG_PARAVIRT 7#ifdef CONFIG_PARAVIRT
8#include <asm/paravirt.h> 8#include <asm/paravirt.h>
9#else 9#else
10#define paravirt_alloc_pt(pfn) do { } while (0) 10#define paravirt_alloc_pt(mm, pfn) do { } while (0)
11#define paravirt_alloc_pd(pfn) do { } while (0) 11#define paravirt_alloc_pd(pfn) do { } while (0)
12#define paravirt_alloc_pd(pfn) do { } while (0) 12#define paravirt_alloc_pd(pfn) do { } while (0)
13#define paravirt_alloc_pd_clone(pfn, clonepfn, start, count) do { } while (0) 13#define paravirt_alloc_pd_clone(pfn, clonepfn, start, count) do { } while (0)
@@ -17,13 +17,13 @@
17 17
18#define pmd_populate_kernel(mm, pmd, pte) \ 18#define pmd_populate_kernel(mm, pmd, pte) \
19do { \ 19do { \
20 paravirt_alloc_pt(__pa(pte) >> PAGE_SHIFT); \ 20 paravirt_alloc_pt(mm, __pa(pte) >> PAGE_SHIFT); \
21 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))); \ 21 set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))); \
22} while (0) 22} while (0)
23 23
24#define pmd_populate(mm, pmd, pte) \ 24#define pmd_populate(mm, pmd, pte) \
25do { \ 25do { \
26 paravirt_alloc_pt(page_to_pfn(pte)); \ 26 paravirt_alloc_pt(mm, page_to_pfn(pte)); \
27 set_pmd(pmd, __pmd(_PAGE_TABLE + \ 27 set_pmd(pmd, __pmd(_PAGE_TABLE + \
28 ((unsigned long long)page_to_pfn(pte) << \ 28 ((unsigned long long)page_to_pfn(pte) << \
29 (unsigned long long) PAGE_SHIFT))); \ 29 (unsigned long long) PAGE_SHIFT))); \
diff --git a/include/asm-i386/processor-cyrix.h b/include/asm-i386/processor-cyrix.h
new file mode 100644
index 000000000000..97568ada1f97
--- /dev/null
+++ b/include/asm-i386/processor-cyrix.h
@@ -0,0 +1,30 @@
1/*
2 * NSC/Cyrix CPU indexed register access. Must be inlined instead of
3 * macros to ensure correct access ordering
4 * Access order is always 0x22 (=offset), 0x23 (=value)
5 *
6 * When using the old macros a line like
7 * setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
8 * gets expanded to:
9 * do {
10 * outb((CX86_CCR2), 0x22);
11 * outb((({
12 * outb((CX86_CCR2), 0x22);
13 * inb(0x23);
14 * }) | 0x88), 0x23);
15 * } while (0);
16 *
17 * which in fact violates the access order (= 0x22, 0x22, 0x23, 0x23).
18 */
19
20static inline u8 getCx86(u8 reg)
21{
22 outb(reg, 0x22);
23 return inb(0x23);
24}
25
26static inline void setCx86(u8 reg, u8 data)
27{
28 outb(reg, 0x22);
29 outb(data, 0x23);
30}
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 422cffef00c9..3845fe72383e 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -88,7 +88,6 @@ struct cpuinfo_x86 {
88#define X86_VENDOR_UMC 3 88#define X86_VENDOR_UMC 3
89#define X86_VENDOR_NEXGEN 4 89#define X86_VENDOR_NEXGEN 4
90#define X86_VENDOR_CENTAUR 5 90#define X86_VENDOR_CENTAUR 5
91#define X86_VENDOR_RISE 6
92#define X86_VENDOR_TRANSMETA 7 91#define X86_VENDOR_TRANSMETA 7
93#define X86_VENDOR_NSC 8 92#define X86_VENDOR_NSC 8
94#define X86_VENDOR_NUM 9 93#define X86_VENDOR_NUM 9
@@ -169,17 +168,6 @@ static inline void clear_in_cr4 (unsigned long mask)
169 write_cr4(cr4); 168 write_cr4(cr4);
170} 169}
171 170
172/*
173 * NSC/Cyrix CPU indexed register access macros
174 */
175
176#define getCx86(reg) ({ outb((reg), 0x22); inb(0x23); })
177
178#define setCx86(reg, data) do { \
179 outb((reg), 0x22); \
180 outb((data), 0x23); \
181} while (0)
182
183/* Stop speculative execution */ 171/* Stop speculative execution */
184static inline void sync_core(void) 172static inline void sync_core(void)
185{ 173{
diff --git a/include/asm-i386/required-features.h b/include/asm-i386/required-features.h
index 65848a007050..618feb98f9f5 100644
--- a/include/asm-i386/required-features.h
+++ b/include/asm-i386/required-features.h
@@ -29,7 +29,7 @@
29# define NEED_CMOV 0 29# define NEED_CMOV 0
30#endif 30#endif
31 31
32#ifdef CONFIG_X86_CMPXCHG64 32#ifdef CONFIG_X86_PAE
33# define NEED_CX8 (1<<(X86_FEATURE_CX8 & 31)) 33# define NEED_CX8 (1<<(X86_FEATURE_CX8 & 31))
34#else 34#else
35# define NEED_CX8 0 35# define NEED_CX8 0
diff --git a/include/asm-i386/resume-trace.h b/include/asm-i386/resume-trace.h
new file mode 100644
index 000000000000..ec9cfd656230
--- /dev/null
+++ b/include/asm-i386/resume-trace.h
@@ -0,0 +1,13 @@
1#define TRACE_RESUME(user) do { \
2 if (pm_trace_enabled) { \
3 void *tracedata; \
4 asm volatile("movl $1f,%0\n" \
5 ".section .tracedata,\"a\"\n" \
6 "1:\t.word %c1\n" \
7 "\t.long %c2\n" \
8 ".previous" \
9 :"=r" (tracedata) \
10 : "i" (__LINE__), "i" (__FILE__)); \
11 generate_resume_trace(tracedata, user); \
12 } \
13} while (0)
diff --git a/include/asm-i386/serial.h b/include/asm-i386/serial.h
index 57a4306cdf63..bd67480ca109 100644
--- a/include/asm-i386/serial.h
+++ b/include/asm-i386/serial.h
@@ -11,3 +11,19 @@
11 * megabits/second; but this requires the faster clock. 11 * megabits/second; but this requires the faster clock.
12 */ 12 */
13#define BASE_BAUD ( 1843200 / 16 ) 13#define BASE_BAUD ( 1843200 / 16 )
14
15/* Standard COM flags (except for COM4, because of the 8514 problem) */
16#ifdef CONFIG_SERIAL_DETECT_IRQ
17#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
18#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
19#else
20#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
21#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
22#endif
23
24#define SERIAL_PORT_DFNS \
25 /* UART CLK PORT IRQ FLAGS */ \
26 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
27 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
28 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
29 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h
index 0d5bff9dc4a5..7862fe858a9e 100644
--- a/include/asm-i386/setup.h
+++ b/include/asm-i386/setup.h
@@ -81,6 +81,10 @@ void __init add_memory_region(unsigned long long start,
81 81
82extern unsigned long init_pg_tables_end; 82extern unsigned long init_pg_tables_end;
83 83
84#ifndef CONFIG_PARAVIRT
85#define paravirt_post_allocator_init() do {} while (0)
86#endif
87
84#endif /* __ASSEMBLY__ */ 88#endif /* __ASSEMBLY__ */
85 89
86#endif /* __KERNEL__ */ 90#endif /* __KERNEL__ */
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index 0c7132787062..1f73bde165b1 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -43,9 +43,12 @@ extern u8 x86_cpu_to_apicid[];
43 43
44#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu] 44#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
45 45
46extern void set_cpu_sibling_map(int cpu);
47
46#ifdef CONFIG_HOTPLUG_CPU 48#ifdef CONFIG_HOTPLUG_CPU
47extern void cpu_exit_clear(void); 49extern void cpu_exit_clear(void);
48extern void cpu_uninit(void); 50extern void cpu_uninit(void);
51extern void remove_siblinginfo(int cpu);
49#endif 52#endif
50 53
51struct smp_ops 54struct smp_ops
@@ -129,6 +132,8 @@ extern int __cpu_disable(void);
129extern void __cpu_die(unsigned int cpu); 132extern void __cpu_die(unsigned int cpu);
130extern unsigned int num_processors; 133extern unsigned int num_processors;
131 134
135void __cpuinit smp_store_cpu_info(int id);
136
132#endif /* !__ASSEMBLY__ */ 137#endif /* !__ASSEMBLY__ */
133 138
134#else /* CONFIG_SMP */ 139#else /* CONFIG_SMP */
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index b9277361954b..a9b64453bdf5 100644
--- a/include/asm-i386/string.h
+++ b/include/asm-i386/string.h
@@ -2,203 +2,35 @@
2#define _I386_STRING_H_ 2#define _I386_STRING_H_
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5/*
6 * On a 486 or Pentium, we are better off not using the
7 * byte string operations. But on a 386 or a PPro the
8 * byte string ops are faster than doing it by hand
9 * (MUCH faster on a Pentium).
10 */
11
12/*
13 * This string-include defines all string functions as inline
14 * functions. Use gcc. It also assumes ds=es=data space, this should be
15 * normal. Most of the string-functions are rather heavily hand-optimized,
16 * see especially strsep,strstr,str[c]spn. They should work, but are not
17 * very easy to understand. Everything is done entirely within the register
18 * set, making the functions fast and clean. String instructions have been
19 * used through-out, making for "slightly" unclear code :-)
20 *
21 * NO Copyright (C) 1991, 1992 Linus Torvalds,
22 * consider these trivial functions to be PD.
23 */
24 5
25/* AK: in fact I bet it would be better to move this stuff all out of line. 6/* Let gcc decide wether to inline or use the out of line functions */
26 */
27 7
28#define __HAVE_ARCH_STRCPY 8#define __HAVE_ARCH_STRCPY
29static inline char * strcpy(char * dest,const char *src) 9extern char *strcpy(char *dest, const char *src);
30{
31int d0, d1, d2;
32__asm__ __volatile__(
33 "1:\tlodsb\n\t"
34 "stosb\n\t"
35 "testb %%al,%%al\n\t"
36 "jne 1b"
37 : "=&S" (d0), "=&D" (d1), "=&a" (d2)
38 :"0" (src),"1" (dest) : "memory");
39return dest;
40}
41 10
42#define __HAVE_ARCH_STRNCPY 11#define __HAVE_ARCH_STRNCPY
43static inline char * strncpy(char * dest,const char *src,size_t count) 12extern char *strncpy(char *dest, const char *src, size_t count);
44{
45int d0, d1, d2, d3;
46__asm__ __volatile__(
47 "1:\tdecl %2\n\t"
48 "js 2f\n\t"
49 "lodsb\n\t"
50 "stosb\n\t"
51 "testb %%al,%%al\n\t"
52 "jne 1b\n\t"
53 "rep\n\t"
54 "stosb\n"
55 "2:"
56 : "=&S" (d0), "=&D" (d1), "=&c" (d2), "=&a" (d3)
57 :"0" (src),"1" (dest),"2" (count) : "memory");
58return dest;
59}
60 13
61#define __HAVE_ARCH_STRCAT 14#define __HAVE_ARCH_STRCAT
62static inline char * strcat(char * dest,const char * src) 15extern char *strcat(char *dest, const char *src);
63{
64int d0, d1, d2, d3;
65__asm__ __volatile__(
66 "repne\n\t"
67 "scasb\n\t"
68 "decl %1\n"
69 "1:\tlodsb\n\t"
70 "stosb\n\t"
71 "testb %%al,%%al\n\t"
72 "jne 1b"
73 : "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
74 : "0" (src), "1" (dest), "2" (0), "3" (0xffffffffu):"memory");
75return dest;
76}
77 16
78#define __HAVE_ARCH_STRNCAT 17#define __HAVE_ARCH_STRNCAT
79static inline char * strncat(char * dest,const char * src,size_t count) 18extern char *strncat(char *dest, const char *src, size_t count);
80{
81int d0, d1, d2, d3;
82__asm__ __volatile__(
83 "repne\n\t"
84 "scasb\n\t"
85 "decl %1\n\t"
86 "movl %8,%3\n"
87 "1:\tdecl %3\n\t"
88 "js 2f\n\t"
89 "lodsb\n\t"
90 "stosb\n\t"
91 "testb %%al,%%al\n\t"
92 "jne 1b\n"
93 "2:\txorl %2,%2\n\t"
94 "stosb"
95 : "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
96 : "0" (src),"1" (dest),"2" (0),"3" (0xffffffffu), "g" (count)
97 : "memory");
98return dest;
99}
100 19
101#define __HAVE_ARCH_STRCMP 20#define __HAVE_ARCH_STRCMP
102static inline int strcmp(const char * cs,const char * ct) 21extern int strcmp(const char *cs, const char *ct);
103{
104int d0, d1;
105register int __res;
106__asm__ __volatile__(
107 "1:\tlodsb\n\t"
108 "scasb\n\t"
109 "jne 2f\n\t"
110 "testb %%al,%%al\n\t"
111 "jne 1b\n\t"
112 "xorl %%eax,%%eax\n\t"
113 "jmp 3f\n"
114 "2:\tsbbl %%eax,%%eax\n\t"
115 "orb $1,%%al\n"
116 "3:"
117 :"=a" (__res), "=&S" (d0), "=&D" (d1)
118 :"1" (cs),"2" (ct)
119 :"memory");
120return __res;
121}
122 22
123#define __HAVE_ARCH_STRNCMP 23#define __HAVE_ARCH_STRNCMP
124static inline int strncmp(const char * cs,const char * ct,size_t count) 24extern int strncmp(const char *cs, const char *ct, size_t count);
125{
126register int __res;
127int d0, d1, d2;
128__asm__ __volatile__(
129 "1:\tdecl %3\n\t"
130 "js 2f\n\t"
131 "lodsb\n\t"
132 "scasb\n\t"
133 "jne 3f\n\t"
134 "testb %%al,%%al\n\t"
135 "jne 1b\n"
136 "2:\txorl %%eax,%%eax\n\t"
137 "jmp 4f\n"
138 "3:\tsbbl %%eax,%%eax\n\t"
139 "orb $1,%%al\n"
140 "4:"
141 :"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
142 :"1" (cs),"2" (ct),"3" (count)
143 :"memory");
144return __res;
145}
146 25
147#define __HAVE_ARCH_STRCHR 26#define __HAVE_ARCH_STRCHR
148static inline char * strchr(const char * s, int c) 27extern char *strchr(const char *s, int c);
149{
150int d0;
151register char * __res;
152__asm__ __volatile__(
153 "movb %%al,%%ah\n"
154 "1:\tlodsb\n\t"
155 "cmpb %%ah,%%al\n\t"
156 "je 2f\n\t"
157 "testb %%al,%%al\n\t"
158 "jne 1b\n\t"
159 "movl $1,%1\n"
160 "2:\tmovl %1,%0\n\t"
161 "decl %0"
162 :"=a" (__res), "=&S" (d0)
163 :"1" (s),"0" (c)
164 :"memory");
165return __res;
166}
167 28
168#define __HAVE_ARCH_STRRCHR 29#define __HAVE_ARCH_STRRCHR
169static inline char * strrchr(const char * s, int c) 30extern char *strrchr(const char *s, int c);
170{
171int d0, d1;
172register char * __res;
173__asm__ __volatile__(
174 "movb %%al,%%ah\n"
175 "1:\tlodsb\n\t"
176 "cmpb %%ah,%%al\n\t"
177 "jne 2f\n\t"
178 "leal -1(%%esi),%0\n"
179 "2:\ttestb %%al,%%al\n\t"
180 "jne 1b"
181 :"=g" (__res), "=&S" (d0), "=&a" (d1)
182 :"0" (0),"1" (s),"2" (c)
183 :"memory");
184return __res;
185}
186 31
187#define __HAVE_ARCH_STRLEN 32#define __HAVE_ARCH_STRLEN
188static inline size_t strlen(const char * s) 33extern size_t strlen(const char *s);
189{
190int d0;
191register int __res;
192__asm__ __volatile__(
193 "repne\n\t"
194 "scasb\n\t"
195 "notl %0\n\t"
196 "decl %0"
197 :"=c" (__res), "=&D" (d0)
198 :"1" (s),"a" (0), "0" (0xffffffffu)
199 :"memory");
200return __res;
201}
202 34
203static __always_inline void * __memcpy(void * to, const void * from, size_t n) 35static __always_inline void * __memcpy(void * to, const void * from, size_t n)
204{ 36{
@@ -207,9 +39,7 @@ __asm__ __volatile__(
207 "rep ; movsl\n\t" 39 "rep ; movsl\n\t"
208 "movl %4,%%ecx\n\t" 40 "movl %4,%%ecx\n\t"
209 "andl $3,%%ecx\n\t" 41 "andl $3,%%ecx\n\t"
210#if 1 /* want to pay 2 byte penalty for a chance to skip microcoded rep? */
211 "jz 1f\n\t" 42 "jz 1f\n\t"
212#endif
213 "rep ; movsb\n\t" 43 "rep ; movsb\n\t"
214 "1:" 44 "1:"
215 : "=&c" (d0), "=&D" (d1), "=&S" (d2) 45 : "=&c" (d0), "=&D" (d1), "=&S" (d2)
@@ -328,23 +158,7 @@ void *memmove(void * dest,const void * src, size_t n);
328#define memcmp __builtin_memcmp 158#define memcmp __builtin_memcmp
329 159
330#define __HAVE_ARCH_MEMCHR 160#define __HAVE_ARCH_MEMCHR
331static inline void * memchr(const void * cs,int c,size_t count) 161extern void *memchr(const void * cs,int c,size_t count);
332{
333int d0;
334register void * __res;
335if (!count)
336 return NULL;
337__asm__ __volatile__(
338 "repne\n\t"
339 "scasb\n\t"
340 "je 1f\n\t"
341 "movl $1,%0\n"
342 "1:\tdecl %0"
343 :"=D" (__res), "=&c" (d0)
344 :"a" (c),"0" (cs),"1" (count)
345 :"memory");
346return __res;
347}
348 162
349static inline void * __memset_generic(void * s, char c,size_t count) 163static inline void * __memset_generic(void * s, char c,size_t count)
350{ 164{
@@ -386,29 +200,10 @@ return (s);
386 200
387/* Added by Gertjan van Wingerde to make minix and sysv module work */ 201/* Added by Gertjan van Wingerde to make minix and sysv module work */
388#define __HAVE_ARCH_STRNLEN 202#define __HAVE_ARCH_STRNLEN
389static inline size_t strnlen(const char * s, size_t count) 203extern size_t strnlen(const char * s, size_t count);
390{
391int d0;
392register int __res;
393__asm__ __volatile__(
394 "movl %2,%0\n\t"
395 "jmp 2f\n"
396 "1:\tcmpb $0,(%0)\n\t"
397 "je 3f\n\t"
398 "incl %0\n"
399 "2:\tdecl %1\n\t"
400 "cmpl $-1,%1\n\t"
401 "jne 1b\n"
402 "3:\tsubl %2,%0"
403 :"=a" (__res), "=&d" (d0)
404 :"c" (s),"1" (count)
405 :"memory");
406return __res;
407}
408/* end of additional stuff */ 204/* end of additional stuff */
409 205
410#define __HAVE_ARCH_STRSTR 206#define __HAVE_ARCH_STRSTR
411
412extern char *strstr(const char *cs, const char *ct); 207extern char *strstr(const char *cs, const char *ct);
413 208
414/* 209/*
@@ -474,19 +269,7 @@ __asm__ __volatile__( \
474 * find the first occurrence of byte 'c', or 1 past the area if none 269 * find the first occurrence of byte 'c', or 1 past the area if none
475 */ 270 */
476#define __HAVE_ARCH_MEMSCAN 271#define __HAVE_ARCH_MEMSCAN
477static inline void * memscan(void * addr, int c, size_t size) 272extern void *memscan(void * addr, int c, size_t size);
478{
479 if (!size)
480 return addr;
481 __asm__("repnz; scasb\n\t"
482 "jnz 1f\n\t"
483 "dec %%edi\n"
484 "1:"
485 : "=D" (addr), "=c" (size)
486 : "0" (addr), "1" (size), "a" (c)
487 : "memory");
488 return addr;
489}
490 273
491#endif /* __KERNEL__ */ 274#endif /* __KERNEL__ */
492 275
diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h
index 8dbaafe611ff..a2520732ffd6 100644
--- a/include/asm-i386/suspend.h
+++ b/include/asm-i386/suspend.h
@@ -21,7 +21,7 @@ struct saved_context {
21 unsigned long return_address; 21 unsigned long return_address;
22} __attribute__((packed)); 22} __attribute__((packed));
23 23
24#ifdef CONFIG_ACPI_SLEEP 24#ifdef CONFIG_ACPI
25extern unsigned long saved_eip; 25extern unsigned long saved_eip;
26extern unsigned long saved_esp; 26extern unsigned long saved_esp;
27extern unsigned long saved_ebp; 27extern unsigned long saved_ebp;
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 94ed3686a5f3..609756c61676 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -310,15 +310,6 @@ void enable_hlt(void);
310extern int es7000_plat; 310extern int es7000_plat;
311void cpu_idle_wait(void); 311void cpu_idle_wait(void);
312 312
313/*
314 * On SMP systems, when the scheduler does migration-cost autodetection,
315 * it needs a way to flush as much of the CPU's caches as possible:
316 */
317static inline void sched_cacheflush(void)
318{
319 wbinvd();
320}
321
322extern unsigned long arch_align_stack(unsigned long sp); 313extern unsigned long arch_align_stack(unsigned long sp);
323extern void free_init_pages(char *what, unsigned long begin, unsigned long end); 314extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
324 315
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 54424e045e01..22a8cbcd35e2 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -124,15 +124,14 @@ static inline struct thread_info *current_thread_info(void)
124 * - other flags in MSW 124 * - other flags in MSW
125 */ 125 */
126#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 126#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
127#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 127#define TIF_SIGPENDING 1 /* signal pending */
128#define TIF_SIGPENDING 2 /* signal pending */ 128#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
129#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 129#define TIF_SINGLESTEP 3 /* restore singlestep on return to user mode */
130#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ 130#define TIF_IRET 4 /* return with iret */
131#define TIF_IRET 5 /* return with iret */ 131#define TIF_SYSCALL_EMU 5 /* syscall emulation active */
132#define TIF_SYSCALL_EMU 6 /* syscall emulation active */ 132#define TIF_SYSCALL_AUDIT 6 /* syscall auditing active */
133#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ 133#define TIF_SECCOMP 7 /* secure computing */
134#define TIF_SECCOMP 8 /* secure computing */ 134#define TIF_RESTORE_SIGMASK 8 /* restore signal mask in do_signal() */
135#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
136#define TIF_MEMDIE 16 135#define TIF_MEMDIE 16
137#define TIF_DEBUG 17 /* uses debug registers */ 136#define TIF_DEBUG 17 /* uses debug registers */
138#define TIF_IO_BITMAP 18 /* uses I/O bitmap */ 137#define TIF_IO_BITMAP 18 /* uses I/O bitmap */
@@ -140,7 +139,6 @@ static inline struct thread_info *current_thread_info(void)
140#define TIF_NOTSC 20 /* TSC is not accessible in userland */ 139#define TIF_NOTSC 20 /* TSC is not accessible in userland */
141 140
142#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 141#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
143#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
144#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 142#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
145#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 143#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
146#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) 144#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
diff --git a/include/asm-i386/timer.h b/include/asm-i386/timer.h
index 153770e25faa..0db7e994fb8b 100644
--- a/include/asm-i386/timer.h
+++ b/include/asm-i386/timer.h
@@ -5,18 +5,46 @@
5 5
6#define TICK_SIZE (tick_nsec / 1000) 6#define TICK_SIZE (tick_nsec / 1000)
7 7
8void setup_pit_timer(void);
9unsigned long long native_sched_clock(void); 8unsigned long long native_sched_clock(void);
10unsigned long native_calculate_cpu_khz(void); 9unsigned long native_calculate_cpu_khz(void);
11 10
12extern int timer_ack; 11extern int timer_ack;
13extern int no_timer_check; 12extern int no_timer_check;
14extern int no_sync_cmos_clock;
15extern int recalibrate_cpu_khz(void); 13extern int recalibrate_cpu_khz(void);
16 14
17#ifndef CONFIG_PARAVIRT 15#ifndef CONFIG_PARAVIRT
18#define get_scheduled_cycles(val) rdtscll(val)
19#define calculate_cpu_khz() native_calculate_cpu_khz() 16#define calculate_cpu_khz() native_calculate_cpu_khz()
20#endif 17#endif
21 18
19/* Accellerators for sched_clock()
20 * convert from cycles(64bits) => nanoseconds (64bits)
21 * basic equation:
22 * ns = cycles / (freq / ns_per_sec)
23 * ns = cycles * (ns_per_sec / freq)
24 * ns = cycles * (10^9 / (cpu_khz * 10^3))
25 * ns = cycles * (10^6 / cpu_khz)
26 *
27 * Then we use scaling math (suggested by george@mvista.com) to get:
28 * ns = cycles * (10^6 * SC / cpu_khz) / SC
29 * ns = cycles * cyc2ns_scale / SC
30 *
31 * And since SC is a constant power of two, we can convert the div
32 * into a shift.
33 *
34 * We can use khz divisor instead of mhz to keep a better percision, since
35 * cyc2ns_scale is limited to 10^6 * 2^10, which fits in 32 bits.
36 * (mathieu.desnoyers@polymtl.ca)
37 *
38 * -johnstul@us.ibm.com "math is hard, lets go shopping!"
39 */
40extern unsigned long cyc2ns_scale __read_mostly;
41
42#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
43
44static inline unsigned long long cycles_2_ns(unsigned long long cyc)
45{
46 return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
47}
48
49
22#endif 50#endif
diff --git a/include/asm-i386/tlbflush.h b/include/asm-i386/tlbflush.h
index fc525c5cd5a9..a50fa6741486 100644
--- a/include/asm-i386/tlbflush.h
+++ b/include/asm-i386/tlbflush.h
@@ -160,7 +160,11 @@ DECLARE_PER_CPU(struct tlb_state, cpu_tlbstate);
160 native_flush_tlb_others(&mask, mm, va) 160 native_flush_tlb_others(&mask, mm, va)
161#endif 161#endif
162 162
163#define flush_tlb_kernel_range(start, end) flush_tlb_all() 163static inline void flush_tlb_kernel_range(unsigned long start,
164 unsigned long end)
165{
166 flush_tlb_all();
167}
164 168
165static inline void flush_tlb_pgtables(struct mm_struct *mm, 169static inline void flush_tlb_pgtables(struct mm_struct *mm,
166 unsigned long start, unsigned long end) 170 unsigned long start, unsigned long end)
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h
index 7fc512d90ea8..19b2dafd0c81 100644
--- a/include/asm-i386/topology.h
+++ b/include/asm-i386/topology.h
@@ -67,7 +67,7 @@ static inline int node_to_first_cpu(int node)
67 return first_cpu(mask); 67 return first_cpu(mask);
68} 68}
69 69
70#define pcibus_to_node(bus) ((long) (bus)->sysdata) 70#define pcibus_to_node(bus) ((struct pci_sysdata *)((bus)->sysdata))->node
71#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus)) 71#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus))
72 72
73/* sched_domains SD_NODE_INIT for NUMAQ machines */ 73/* sched_domains SD_NODE_INIT for NUMAQ machines */
diff --git a/include/asm-i386/tsc.h b/include/asm-i386/tsc.h
index 62c091ffcccc..a4d806610b7f 100644
--- a/include/asm-i386/tsc.h
+++ b/include/asm-i386/tsc.h
@@ -63,6 +63,7 @@ extern void tsc_init(void);
63extern void mark_tsc_unstable(char *reason); 63extern void mark_tsc_unstable(char *reason);
64extern int unsynchronized_tsc(void); 64extern int unsynchronized_tsc(void);
65extern void init_tsc_clocksource(void); 65extern void init_tsc_clocksource(void);
66int check_tsc_unstable(void);
66 67
67/* 68/*
68 * Boot-time check whether the TSCs are synchronized across 69 * Boot-time check whether the TSCs are synchronized across
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index e2aa5e0d0cc7..d2a4f7be9c2c 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -581,7 +581,7 @@ long __must_check __strncpy_from_user(char *dst,
581 * If there is a limit on the length of a valid string, you may wish to 581 * If there is a limit on the length of a valid string, you may wish to
582 * consider using strnlen_user() instead. 582 * consider using strnlen_user() instead.
583 */ 583 */
584#define strlen_user(str) strnlen_user(str, ~0UL >> 1) 584#define strlen_user(str) strnlen_user(str, LONG_MAX)
585 585
586long strnlen_user(const char __user *str, long n); 586long strnlen_user(const char __user *str, long n);
587unsigned long __must_check clear_user(void __user *mem, unsigned long len); 587unsigned long __must_check clear_user(void __user *mem, unsigned long len);
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index e84ace1ec8bf..9b15545eb9b5 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -329,10 +329,11 @@
329#define __NR_signalfd 321 329#define __NR_signalfd 321
330#define __NR_timerfd 322 330#define __NR_timerfd 322
331#define __NR_eventfd 323 331#define __NR_eventfd 323
332#define __NR_fallocate 324
332 333
333#ifdef __KERNEL__ 334#ifdef __KERNEL__
334 335
335#define NR_syscalls 324 336#define NR_syscalls 325
336 337
337#define __ARCH_WANT_IPC_PARSE_VERSION 338#define __ARCH_WANT_IPC_PARSE_VERSION
338#define __ARCH_WANT_OLD_READDIR 339#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-i386/vmi_time.h b/include/asm-i386/vmi_time.h
index 213930b995cb..478188130328 100644
--- a/include/asm-i386/vmi_time.h
+++ b/include/asm-i386/vmi_time.h
@@ -49,7 +49,7 @@ extern struct vmi_timer_ops {
49extern void __init vmi_time_init(void); 49extern void __init vmi_time_init(void);
50extern unsigned long vmi_get_wallclock(void); 50extern unsigned long vmi_get_wallclock(void);
51extern int vmi_set_wallclock(unsigned long now); 51extern int vmi_set_wallclock(unsigned long now);
52extern unsigned long long vmi_get_sched_cycles(void); 52extern unsigned long long vmi_sched_clock(void);
53extern unsigned long vmi_cpu_khz(void); 53extern unsigned long vmi_cpu_khz(void);
54 54
55#ifdef CONFIG_X86_LOCAL_APIC 55#ifdef CONFIG_X86_LOCAL_APIC
diff --git a/include/asm-i386/xen/hypercall.h b/include/asm-i386/xen/hypercall.h
new file mode 100644
index 000000000000..bc0ee7d961ca
--- /dev/null
+++ b/include/asm-i386/xen/hypercall.h
@@ -0,0 +1,413 @@
1/******************************************************************************
2 * hypercall.h
3 *
4 * Linux-specific hypervisor handling.
5 *
6 * Copyright (c) 2002-2004, K A Fraser
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation; or, when distributed
11 * separately from the Linux kernel or incorporated into other
12 * software packages, subject to the following license:
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining a copy
15 * of this source file (the "Software"), to deal in the Software without
16 * restriction, including without limitation the rights to use, copy, modify,
17 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
18 * and to permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be included in
22 * all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30 * IN THE SOFTWARE.
31 */
32
33#ifndef __HYPERCALL_H__
34#define __HYPERCALL_H__
35
36#include <linux/errno.h>
37#include <linux/string.h>
38
39#include <xen/interface/xen.h>
40#include <xen/interface/sched.h>
41#include <xen/interface/physdev.h>
42
43extern struct { char _entry[32]; } hypercall_page[];
44
45#define _hypercall0(type, name) \
46({ \
47 long __res; \
48 asm volatile ( \
49 "call %[call]" \
50 : "=a" (__res) \
51 : [call] "m" (hypercall_page[__HYPERVISOR_##name]) \
52 : "memory" ); \
53 (type)__res; \
54})
55
56#define _hypercall1(type, name, a1) \
57({ \
58 long __res, __ign1; \
59 asm volatile ( \
60 "call %[call]" \
61 : "=a" (__res), "=b" (__ign1) \
62 : "1" ((long)(a1)), \
63 [call] "m" (hypercall_page[__HYPERVISOR_##name]) \
64 : "memory" ); \
65 (type)__res; \
66})
67
68#define _hypercall2(type, name, a1, a2) \
69({ \
70 long __res, __ign1, __ign2; \
71 asm volatile ( \
72 "call %[call]" \
73 : "=a" (__res), "=b" (__ign1), "=c" (__ign2) \
74 : "1" ((long)(a1)), "2" ((long)(a2)), \
75 [call] "m" (hypercall_page[__HYPERVISOR_##name]) \
76 : "memory" ); \
77 (type)__res; \
78})
79
80#define _hypercall3(type, name, a1, a2, a3) \
81({ \
82 long __res, __ign1, __ign2, __ign3; \
83 asm volatile ( \
84 "call %[call]" \
85 : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
86 "=d" (__ign3) \
87 : "1" ((long)(a1)), "2" ((long)(a2)), \
88 "3" ((long)(a3)), \
89 [call] "m" (hypercall_page[__HYPERVISOR_##name]) \
90 : "memory" ); \
91 (type)__res; \
92})
93
94#define _hypercall4(type, name, a1, a2, a3, a4) \
95({ \
96 long __res, __ign1, __ign2, __ign3, __ign4; \
97 asm volatile ( \
98 "call %[call]" \
99 : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
100 "=d" (__ign3), "=S" (__ign4) \
101 : "1" ((long)(a1)), "2" ((long)(a2)), \
102 "3" ((long)(a3)), "4" ((long)(a4)), \
103 [call] "m" (hypercall_page[__HYPERVISOR_##name]) \
104 : "memory" ); \
105 (type)__res; \
106})
107
108#define _hypercall5(type, name, a1, a2, a3, a4, a5) \
109({ \
110 long __res, __ign1, __ign2, __ign3, __ign4, __ign5; \
111 asm volatile ( \
112 "call %[call]" \
113 : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
114 "=d" (__ign3), "=S" (__ign4), "=D" (__ign5) \
115 : "1" ((long)(a1)), "2" ((long)(a2)), \
116 "3" ((long)(a3)), "4" ((long)(a4)), \
117 "5" ((long)(a5)), \
118 [call] "m" (hypercall_page[__HYPERVISOR_##name]) \
119 : "memory" ); \
120 (type)__res; \
121})
122
123static inline int
124HYPERVISOR_set_trap_table(struct trap_info *table)
125{
126 return _hypercall1(int, set_trap_table, table);
127}
128
129static inline int
130HYPERVISOR_mmu_update(struct mmu_update *req, int count,
131 int *success_count, domid_t domid)
132{
133 return _hypercall4(int, mmu_update, req, count, success_count, domid);
134}
135
136static inline int
137HYPERVISOR_mmuext_op(struct mmuext_op *op, int count,
138 int *success_count, domid_t domid)
139{
140 return _hypercall4(int, mmuext_op, op, count, success_count, domid);
141}
142
143static inline int
144HYPERVISOR_set_gdt(unsigned long *frame_list, int entries)
145{
146 return _hypercall2(int, set_gdt, frame_list, entries);
147}
148
149static inline int
150HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp)
151{
152 return _hypercall2(int, stack_switch, ss, esp);
153}
154
155static inline int
156HYPERVISOR_set_callbacks(unsigned long event_selector,
157 unsigned long event_address,
158 unsigned long failsafe_selector,
159 unsigned long failsafe_address)
160{
161 return _hypercall4(int, set_callbacks,
162 event_selector, event_address,
163 failsafe_selector, failsafe_address);
164}
165
166static inline int
167HYPERVISOR_fpu_taskswitch(int set)
168{
169 return _hypercall1(int, fpu_taskswitch, set);
170}
171
172static inline int
173HYPERVISOR_sched_op(int cmd, unsigned long arg)
174{
175 return _hypercall2(int, sched_op, cmd, arg);
176}
177
178static inline long
179HYPERVISOR_set_timer_op(u64 timeout)
180{
181 unsigned long timeout_hi = (unsigned long)(timeout>>32);
182 unsigned long timeout_lo = (unsigned long)timeout;
183 return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi);
184}
185
186static inline int
187HYPERVISOR_set_debugreg(int reg, unsigned long value)
188{
189 return _hypercall2(int, set_debugreg, reg, value);
190}
191
192static inline unsigned long
193HYPERVISOR_get_debugreg(int reg)
194{
195 return _hypercall1(unsigned long, get_debugreg, reg);
196}
197
198static inline int
199HYPERVISOR_update_descriptor(u64 ma, u64 desc)
200{
201 return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32);
202}
203
204static inline int
205HYPERVISOR_memory_op(unsigned int cmd, void *arg)
206{
207 return _hypercall2(int, memory_op, cmd, arg);
208}
209
210static inline int
211HYPERVISOR_multicall(void *call_list, int nr_calls)
212{
213 return _hypercall2(int, multicall, call_list, nr_calls);
214}
215
216static inline int
217HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
218 unsigned long flags)
219{
220 unsigned long pte_hi = 0;
221#ifdef CONFIG_X86_PAE
222 pte_hi = new_val.pte_high;
223#endif
224 return _hypercall4(int, update_va_mapping, va,
225 new_val.pte_low, pte_hi, flags);
226}
227
228static inline int
229HYPERVISOR_event_channel_op(int cmd, void *arg)
230{
231 int rc = _hypercall2(int, event_channel_op, cmd, arg);
232 if (unlikely(rc == -ENOSYS)) {
233 struct evtchn_op op;
234 op.cmd = cmd;
235 memcpy(&op.u, arg, sizeof(op.u));
236 rc = _hypercall1(int, event_channel_op_compat, &op);
237 memcpy(arg, &op.u, sizeof(op.u));
238 }
239 return rc;
240}
241
242static inline int
243HYPERVISOR_xen_version(int cmd, void *arg)
244{
245 return _hypercall2(int, xen_version, cmd, arg);
246}
247
248static inline int
249HYPERVISOR_console_io(int cmd, int count, char *str)
250{
251 return _hypercall3(int, console_io, cmd, count, str);
252}
253
254static inline int
255HYPERVISOR_physdev_op(int cmd, void *arg)
256{
257 int rc = _hypercall2(int, physdev_op, cmd, arg);
258 if (unlikely(rc == -ENOSYS)) {
259 struct physdev_op op;
260 op.cmd = cmd;
261 memcpy(&op.u, arg, sizeof(op.u));
262 rc = _hypercall1(int, physdev_op_compat, &op);
263 memcpy(arg, &op.u, sizeof(op.u));
264 }
265 return rc;
266}
267
268static inline int
269HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
270{
271 return _hypercall3(int, grant_table_op, cmd, uop, count);
272}
273
274static inline int
275HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, pte_t new_val,
276 unsigned long flags, domid_t domid)
277{
278 unsigned long pte_hi = 0;
279#ifdef CONFIG_X86_PAE
280 pte_hi = new_val.pte_high;
281#endif
282 return _hypercall5(int, update_va_mapping_otherdomain, va,
283 new_val.pte_low, pte_hi, flags, domid);
284}
285
286static inline int
287HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type)
288{
289 return _hypercall2(int, vm_assist, cmd, type);
290}
291
292static inline int
293HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args)
294{
295 return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
296}
297
298static inline int
299HYPERVISOR_suspend(unsigned long srec)
300{
301 return _hypercall3(int, sched_op, SCHEDOP_shutdown,
302 SHUTDOWN_suspend, srec);
303}
304
305static inline int
306HYPERVISOR_nmi_op(unsigned long op, unsigned long arg)
307{
308 return _hypercall2(int, nmi_op, op, arg);
309}
310
311static inline void
312MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
313 pte_t new_val, unsigned long flags)
314{
315 mcl->op = __HYPERVISOR_update_va_mapping;
316 mcl->args[0] = va;
317#ifdef CONFIG_X86_PAE
318 mcl->args[1] = new_val.pte_low;
319 mcl->args[2] = new_val.pte_high;
320#else
321 mcl->args[1] = new_val.pte_low;
322 mcl->args[2] = 0;
323#endif
324 mcl->args[3] = flags;
325}
326
327static inline void
328MULTI_grant_table_op(struct multicall_entry *mcl, unsigned int cmd,
329 void *uop, unsigned int count)
330{
331 mcl->op = __HYPERVISOR_grant_table_op;
332 mcl->args[0] = cmd;
333 mcl->args[1] = (unsigned long)uop;
334 mcl->args[2] = count;
335}
336
337static inline void
338MULTI_update_va_mapping_otherdomain(struct multicall_entry *mcl, unsigned long va,
339 pte_t new_val, unsigned long flags,
340 domid_t domid)
341{
342 mcl->op = __HYPERVISOR_update_va_mapping_otherdomain;
343 mcl->args[0] = va;
344#ifdef CONFIG_X86_PAE
345 mcl->args[1] = new_val.pte_low;
346 mcl->args[2] = new_val.pte_high;
347#else
348 mcl->args[1] = new_val.pte_low;
349 mcl->args[2] = 0;
350#endif
351 mcl->args[3] = flags;
352 mcl->args[4] = domid;
353}
354
355static inline void
356MULTI_update_descriptor(struct multicall_entry *mcl, u64 maddr,
357 struct desc_struct desc)
358{
359 mcl->op = __HYPERVISOR_update_descriptor;
360 mcl->args[0] = maddr;
361 mcl->args[1] = maddr >> 32;
362 mcl->args[2] = desc.a;
363 mcl->args[3] = desc.b;
364}
365
366static inline void
367MULTI_memory_op(struct multicall_entry *mcl, unsigned int cmd, void *arg)
368{
369 mcl->op = __HYPERVISOR_memory_op;
370 mcl->args[0] = cmd;
371 mcl->args[1] = (unsigned long)arg;
372}
373
374static inline void
375MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
376 int count, int *success_count, domid_t domid)
377{
378 mcl->op = __HYPERVISOR_mmu_update;
379 mcl->args[0] = (unsigned long)req;
380 mcl->args[1] = count;
381 mcl->args[2] = (unsigned long)success_count;
382 mcl->args[3] = domid;
383}
384
385static inline void
386MULTI_mmuext_op(struct multicall_entry *mcl, struct mmuext_op *op, int count,
387 int *success_count, domid_t domid)
388{
389 mcl->op = __HYPERVISOR_mmuext_op;
390 mcl->args[0] = (unsigned long)op;
391 mcl->args[1] = count;
392 mcl->args[2] = (unsigned long)success_count;
393 mcl->args[3] = domid;
394}
395
396static inline void
397MULTI_set_gdt(struct multicall_entry *mcl, unsigned long *frames, int entries)
398{
399 mcl->op = __HYPERVISOR_set_gdt;
400 mcl->args[0] = (unsigned long)frames;
401 mcl->args[1] = entries;
402}
403
404static inline void
405MULTI_stack_switch(struct multicall_entry *mcl,
406 unsigned long ss, unsigned long esp)
407{
408 mcl->op = __HYPERVISOR_stack_switch;
409 mcl->args[0] = ss;
410 mcl->args[1] = esp;
411}
412
413#endif /* __HYPERCALL_H__ */
diff --git a/include/asm-i386/xen/hypervisor.h b/include/asm-i386/xen/hypervisor.h
new file mode 100644
index 000000000000..8e15dd28c91f
--- /dev/null
+++ b/include/asm-i386/xen/hypervisor.h
@@ -0,0 +1,73 @@
1/******************************************************************************
2 * hypervisor.h
3 *
4 * Linux-specific hypervisor handling.
5 *
6 * Copyright (c) 2002-2004, K A Fraser
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation; or, when distributed
11 * separately from the Linux kernel or incorporated into other
12 * software packages, subject to the following license:
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining a copy
15 * of this source file (the "Software"), to deal in the Software without
16 * restriction, including without limitation the rights to use, copy, modify,
17 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
18 * and to permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be included in
22 * all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30 * IN THE SOFTWARE.
31 */
32
33#ifndef __HYPERVISOR_H__
34#define __HYPERVISOR_H__
35
36#include <linux/types.h>
37#include <linux/kernel.h>
38#include <linux/version.h>
39
40#include <xen/interface/xen.h>
41#include <xen/interface/version.h>
42
43#include <asm/ptrace.h>
44#include <asm/page.h>
45#include <asm/desc.h>
46#if defined(__i386__)
47# ifdef CONFIG_X86_PAE
48# include <asm-generic/pgtable-nopud.h>
49# else
50# include <asm-generic/pgtable-nopmd.h>
51# endif
52#endif
53#include <asm/xen/hypercall.h>
54
55/* arch/i386/kernel/setup.c */
56extern struct shared_info *HYPERVISOR_shared_info;
57extern struct start_info *xen_start_info;
58#define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN)
59
60/* arch/i386/mach-xen/evtchn.c */
61/* Force a proper event-channel callback from Xen. */
62extern void force_evtchn_callback(void);
63
64/* Turn jiffies into Xen system time. */
65u64 jiffies_to_st(unsigned long jiffies);
66
67
68#define MULTI_UVMFLAGS_INDEX 3
69#define MULTI_UVMDOMID_INDEX 4
70
71#define is_running_on_xen() (xen_start_info ? 1 : 0)
72
73#endif /* __HYPERVISOR_H__ */
diff --git a/include/asm-i386/xen/interface.h b/include/asm-i386/xen/interface.h
new file mode 100644
index 000000000000..165c3968e138
--- /dev/null
+++ b/include/asm-i386/xen/interface.h
@@ -0,0 +1,188 @@
1/******************************************************************************
2 * arch-x86_32.h
3 *
4 * Guest OS interface to x86 32-bit Xen.
5 *
6 * Copyright (c) 2004, K A Fraser
7 */
8
9#ifndef __XEN_PUBLIC_ARCH_X86_32_H__
10#define __XEN_PUBLIC_ARCH_X86_32_H__
11
12#ifdef __XEN__
13#define __DEFINE_GUEST_HANDLE(name, type) \
14 typedef struct { type *p; } __guest_handle_ ## name
15#else
16#define __DEFINE_GUEST_HANDLE(name, type) \
17 typedef type * __guest_handle_ ## name
18#endif
19
20#define DEFINE_GUEST_HANDLE_STRUCT(name) \
21 __DEFINE_GUEST_HANDLE(name, struct name)
22#define DEFINE_GUEST_HANDLE(name) __DEFINE_GUEST_HANDLE(name, name)
23#define GUEST_HANDLE(name) __guest_handle_ ## name
24
25#ifndef __ASSEMBLY__
26/* Guest handles for primitive C types. */
27__DEFINE_GUEST_HANDLE(uchar, unsigned char);
28__DEFINE_GUEST_HANDLE(uint, unsigned int);
29__DEFINE_GUEST_HANDLE(ulong, unsigned long);
30DEFINE_GUEST_HANDLE(char);
31DEFINE_GUEST_HANDLE(int);
32DEFINE_GUEST_HANDLE(long);
33DEFINE_GUEST_HANDLE(void);
34#endif
35
36/*
37 * SEGMENT DESCRIPTOR TABLES
38 */
39/*
40 * A number of GDT entries are reserved by Xen. These are not situated at the
41 * start of the GDT because some stupid OSes export hard-coded selector values
42 * in their ABI. These hard-coded values are always near the start of the GDT,
43 * so Xen places itself out of the way, at the far end of the GDT.
44 */
45#define FIRST_RESERVED_GDT_PAGE 14
46#define FIRST_RESERVED_GDT_BYTE (FIRST_RESERVED_GDT_PAGE * 4096)
47#define FIRST_RESERVED_GDT_ENTRY (FIRST_RESERVED_GDT_BYTE / 8)
48
49/*
50 * These flat segments are in the Xen-private section of every GDT. Since these
51 * are also present in the initial GDT, many OSes will be able to avoid
52 * installing their own GDT.
53 */
54#define FLAT_RING1_CS 0xe019 /* GDT index 259 */
55#define FLAT_RING1_DS 0xe021 /* GDT index 260 */
56#define FLAT_RING1_SS 0xe021 /* GDT index 260 */
57#define FLAT_RING3_CS 0xe02b /* GDT index 261 */
58#define FLAT_RING3_DS 0xe033 /* GDT index 262 */
59#define FLAT_RING3_SS 0xe033 /* GDT index 262 */
60
61#define FLAT_KERNEL_CS FLAT_RING1_CS
62#define FLAT_KERNEL_DS FLAT_RING1_DS
63#define FLAT_KERNEL_SS FLAT_RING1_SS
64#define FLAT_USER_CS FLAT_RING3_CS
65#define FLAT_USER_DS FLAT_RING3_DS
66#define FLAT_USER_SS FLAT_RING3_SS
67
68/* And the trap vector is... */
69#define TRAP_INSTR "int $0x82"
70
71/*
72 * Virtual addresses beyond this are not modifiable by guest OSes. The
73 * machine->physical mapping table starts at this address, read-only.
74 */
75#ifdef CONFIG_X86_PAE
76#define __HYPERVISOR_VIRT_START 0xF5800000
77#else
78#define __HYPERVISOR_VIRT_START 0xFC000000
79#endif
80
81#ifndef HYPERVISOR_VIRT_START
82#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START)
83#endif
84
85#ifndef machine_to_phys_mapping
86#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
87#endif
88
89/* Maximum number of virtual CPUs in multi-processor guests. */
90#define MAX_VIRT_CPUS 32
91
92#ifndef __ASSEMBLY__
93
94/*
95 * Send an array of these to HYPERVISOR_set_trap_table()
96 */
97#define TI_GET_DPL(_ti) ((_ti)->flags & 3)
98#define TI_GET_IF(_ti) ((_ti)->flags & 4)
99#define TI_SET_DPL(_ti, _dpl) ((_ti)->flags |= (_dpl))
100#define TI_SET_IF(_ti, _if) ((_ti)->flags |= ((!!(_if))<<2))
101
102struct trap_info {
103 uint8_t vector; /* exception vector */
104 uint8_t flags; /* 0-3: privilege level; 4: clear event enable? */
105 uint16_t cs; /* code selector */
106 unsigned long address; /* code offset */
107};
108DEFINE_GUEST_HANDLE_STRUCT(trap_info);
109
110struct cpu_user_regs {
111 uint32_t ebx;
112 uint32_t ecx;
113 uint32_t edx;
114 uint32_t esi;
115 uint32_t edi;
116 uint32_t ebp;
117 uint32_t eax;
118 uint16_t error_code; /* private */
119 uint16_t entry_vector; /* private */
120 uint32_t eip;
121 uint16_t cs;
122 uint8_t saved_upcall_mask;
123 uint8_t _pad0;
124 uint32_t eflags; /* eflags.IF == !saved_upcall_mask */
125 uint32_t esp;
126 uint16_t ss, _pad1;
127 uint16_t es, _pad2;
128 uint16_t ds, _pad3;
129 uint16_t fs, _pad4;
130 uint16_t gs, _pad5;
131};
132DEFINE_GUEST_HANDLE_STRUCT(cpu_user_regs);
133
134typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */
135
136/*
137 * The following is all CPU context. Note that the fpu_ctxt block is filled
138 * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
139 */
140struct vcpu_guest_context {
141 /* FPU registers come first so they can be aligned for FXSAVE/FXRSTOR. */
142 struct { char x[512]; } fpu_ctxt; /* User-level FPU registers */
143#define VGCF_I387_VALID (1<<0)
144#define VGCF_HVM_GUEST (1<<1)
145#define VGCF_IN_KERNEL (1<<2)
146 unsigned long flags; /* VGCF_* flags */
147 struct cpu_user_regs user_regs; /* User-level CPU registers */
148 struct trap_info trap_ctxt[256]; /* Virtual IDT */
149 unsigned long ldt_base, ldt_ents; /* LDT (linear address, # ents) */
150 unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
151 unsigned long kernel_ss, kernel_sp; /* Virtual TSS (only SS1/SP1) */
152 unsigned long ctrlreg[8]; /* CR0-CR7 (control registers) */
153 unsigned long debugreg[8]; /* DB0-DB7 (debug registers) */
154 unsigned long event_callback_cs; /* CS:EIP of event callback */
155 unsigned long event_callback_eip;
156 unsigned long failsafe_callback_cs; /* CS:EIP of failsafe callback */
157 unsigned long failsafe_callback_eip;
158 unsigned long vm_assist; /* VMASST_TYPE_* bitmap */
159};
160DEFINE_GUEST_HANDLE_STRUCT(vcpu_guest_context);
161
162struct arch_shared_info {
163 unsigned long max_pfn; /* max pfn that appears in table */
164 /* Frame containing list of mfns containing list of mfns containing p2m. */
165 unsigned long pfn_to_mfn_frame_list_list;
166 unsigned long nmi_reason;
167};
168
169struct arch_vcpu_info {
170 unsigned long cr2;
171 unsigned long pad[5]; /* sizeof(struct vcpu_info) == 64 */
172};
173
174#endif /* !__ASSEMBLY__ */
175
176/*
177 * Prefix forces emulation of some non-trapping instructions.
178 * Currently only CPUID.
179 */
180#ifdef __ASSEMBLY__
181#define XEN_EMULATE_PREFIX .byte 0x0f,0x0b,0x78,0x65,0x6e ;
182#define XEN_CPUID XEN_EMULATE_PREFIX cpuid
183#else
184#define XEN_EMULATE_PREFIX ".byte 0x0f,0x0b,0x78,0x65,0x6e ; "
185#define XEN_CPUID XEN_EMULATE_PREFIX "cpuid"
186#endif
187
188#endif
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
index 5b526357d178..49730ffbbae4 100644
--- a/include/asm-ia64/acpi.h
+++ b/include/asm-ia64/acpi.h
@@ -100,6 +100,11 @@ const char *acpi_get_sysname (void);
100int acpi_request_vector (u32 int_type); 100int acpi_request_vector (u32 int_type);
101int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 101int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
102 102
103/* routines for saving/restoring kernel state */
104extern int acpi_save_state_mem(void);
105extern void acpi_restore_state_mem(void);
106extern unsigned long acpi_wakeup_address;
107
103/* 108/*
104 * Record the cpei override flag and current logical cpu. This is 109 * Record the cpei override flag and current logical cpu. This is
105 * useful for CPU removal. 110 * useful for CPU removal.
diff --git a/include/asm-ia64/atomic.h b/include/asm-ia64/atomic.h
index 1fc3b83325da..50c2b83fd5a0 100644
--- a/include/asm-ia64/atomic.h
+++ b/include/asm-ia64/atomic.h
@@ -55,7 +55,7 @@ ia64_atomic64_add (__s64 i, atomic64_t *v)
55 55
56 do { 56 do {
57 CMPXCHG_BUGCHECK(v); 57 CMPXCHG_BUGCHECK(v);
58 old = atomic_read(v); 58 old = atomic64_read(v);
59 new = old + i; 59 new = old + i;
60 } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old); 60 } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old);
61 return new; 61 return new;
@@ -83,7 +83,7 @@ ia64_atomic64_sub (__s64 i, atomic64_t *v)
83 83
84 do { 84 do {
85 CMPXCHG_BUGCHECK(v); 85 CMPXCHG_BUGCHECK(v);
86 old = atomic_read(v); 86 old = atomic64_read(v);
87 new = old - i; 87 new = old - i;
88 } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old); 88 } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old);
89 return new; 89 return new;
diff --git a/include/asm-ia64/hpsim.h b/include/asm-ia64/hpsim.h
new file mode 100644
index 000000000000..892ab198a9da
--- /dev/null
+++ b/include/asm-ia64/hpsim.h
@@ -0,0 +1,16 @@
1#ifndef _ASMIA64_HPSIM_H
2#define _ASMIA64_HPSIM_H
3
4#ifndef CONFIG_HP_SIMSERIAL_CONSOLE
5static inline int simcons_register(void) { return 1; }
6#else
7int simcons_register(void);
8#endif
9
10struct tty_driver;
11extern struct tty_driver *hp_simserial_driver;
12
13void ia64_ssc_connect_irq(long intr, long irq);
14void ia64_ctl_trace(long on);
15
16#endif
diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h
index c054d7a9aaa7..bba5baa3c7fc 100644
--- a/include/asm-ia64/hw_irq.h
+++ b/include/asm-ia64/hw_irq.h
@@ -90,13 +90,27 @@ enum {
90extern __u8 isa_irq_to_vector_map[16]; 90extern __u8 isa_irq_to_vector_map[16];
91#define isa_irq_to_vector(x) isa_irq_to_vector_map[(x)] 91#define isa_irq_to_vector(x) isa_irq_to_vector_map[(x)]
92 92
93struct irq_cfg {
94 ia64_vector vector;
95 cpumask_t domain;
96};
97extern spinlock_t vector_lock;
98extern struct irq_cfg irq_cfg[NR_IRQS];
99#define irq_to_domain(x) irq_cfg[(x)].domain
100DECLARE_PER_CPU(int[IA64_NUM_VECTORS], vector_irq);
101
93extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */ 102extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */
94 103
104extern int bind_irq_vector(int irq, int vector, cpumask_t domain);
95extern int assign_irq_vector (int irq); /* allocate a free vector */ 105extern int assign_irq_vector (int irq); /* allocate a free vector */
96extern void free_irq_vector (int vector); 106extern void free_irq_vector (int vector);
97extern int reserve_irq_vector (int vector); 107extern int reserve_irq_vector (int vector);
108extern void __setup_vector_irq(int cpu);
109extern int reassign_irq_vector(int irq, int cpu);
98extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); 110extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
99extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); 111extern void register_percpu_irq (ia64_vector vec, struct irqaction *action);
112extern int check_irq_used (int irq);
113extern void destroy_and_reserve_irq (unsigned int irq);
100 114
101static inline void ia64_resend_irq(unsigned int vector) 115static inline void ia64_resend_irq(unsigned int vector)
102{ 116{
@@ -110,10 +124,15 @@ static inline void ia64_resend_irq(unsigned int vector)
110extern irq_desc_t irq_desc[NR_IRQS]; 124extern irq_desc_t irq_desc[NR_IRQS];
111 125
112#ifndef CONFIG_IA64_GENERIC 126#ifndef CONFIG_IA64_GENERIC
127static inline ia64_vector __ia64_irq_to_vector(int irq)
128{
129 return irq_cfg[irq].vector;
130}
131
113static inline unsigned int 132static inline unsigned int
114__ia64_local_vector_to_irq (ia64_vector vec) 133__ia64_local_vector_to_irq (ia64_vector vec)
115{ 134{
116 return (unsigned int) vec; 135 return __get_cpu_var(vector_irq)[vec];
117} 136}
118#endif 137#endif
119 138
@@ -131,7 +150,7 @@ __ia64_local_vector_to_irq (ia64_vector vec)
131static inline ia64_vector 150static inline ia64_vector
132irq_to_vector (int irq) 151irq_to_vector (int irq)
133{ 152{
134 return (ia64_vector) irq; 153 return platform_irq_to_vector(irq);
135} 154}
136 155
137/* 156/*
diff --git a/include/asm-ia64/ia32.h b/include/asm-ia64/ia32.h
index 5ff8d74c3e00..2390ee145aa1 100644
--- a/include/asm-ia64/ia32.h
+++ b/include/asm-ia64/ia32.h
@@ -27,11 +27,12 @@ extern int ia32_clone_tls (struct task_struct *child, struct pt_regs *childregs)
27extern int ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info, 27extern int ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info,
28 sigset_t *set, struct pt_regs *regs); 28 sigset_t *set, struct pt_regs *regs);
29#if PAGE_SHIFT > IA32_PAGE_SHIFT 29#if PAGE_SHIFT > IA32_PAGE_SHIFT
30extern int ia32_copy_partial_page_list (struct task_struct *, unsigned long); 30extern int ia32_copy_ia64_partial_page_list(struct task_struct *,
31extern void ia32_drop_partial_page_list (struct task_struct *); 31 unsigned long);
32extern void ia32_drop_ia64_partial_page_list(struct task_struct *);
32#else 33#else
33# define ia32_copy_partial_page_list(a1, a2) 0 34# define ia32_copy_ia64_partial_page_list(a1, a2) 0
34# define ia32_drop_partial_page_list(a1) do { ; } while (0) 35# define ia32_drop_ia64_partial_page_list(a1) do { ; } while (0)
35#endif 36#endif
36 37
37#endif /* !__ASSEMBLY__ */ 38#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h
index 421cb6b62a7c..b8f712859140 100644
--- a/include/asm-ia64/iosapic.h
+++ b/include/asm-ia64/iosapic.h
@@ -47,19 +47,21 @@
47#define IOSAPIC_MASK_SHIFT 16 47#define IOSAPIC_MASK_SHIFT 16
48#define IOSAPIC_MASK (1<<IOSAPIC_MASK_SHIFT) 48#define IOSAPIC_MASK (1<<IOSAPIC_MASK_SHIFT)
49 49
50#define IOSAPIC_VECTOR_MASK 0xffffff00
51
50#ifndef __ASSEMBLY__ 52#ifndef __ASSEMBLY__
51 53
52#ifdef CONFIG_IOSAPIC 54#ifdef CONFIG_IOSAPIC
53 55
54#define NR_IOSAPICS 256 56#define NR_IOSAPICS 256
55 57
56static inline unsigned int iosapic_read(char __iomem *iosapic, unsigned int reg) 58static inline unsigned int __iosapic_read(char __iomem *iosapic, unsigned int reg)
57{ 59{
58 writel(reg, iosapic + IOSAPIC_REG_SELECT); 60 writel(reg, iosapic + IOSAPIC_REG_SELECT);
59 return readl(iosapic + IOSAPIC_WINDOW); 61 return readl(iosapic + IOSAPIC_WINDOW);
60} 62}
61 63
62static inline void iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val) 64static inline void __iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val)
63{ 65{
64 writel(reg, iosapic + IOSAPIC_REG_SELECT); 66 writel(reg, iosapic + IOSAPIC_REG_SELECT);
65 writel(val, iosapic + IOSAPIC_WINDOW); 67 writel(val, iosapic + IOSAPIC_WINDOW);
diff --git a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h
index 67221615e317..a66d26827cbb 100644
--- a/include/asm-ia64/irq.h
+++ b/include/asm-ia64/irq.h
@@ -14,8 +14,13 @@
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/cpumask.h> 15#include <linux/cpumask.h>
16 16
17#define NR_IRQS 256 17#define NR_VECTORS 256
18#define NR_IRQ_VECTORS NR_IRQS 18
19#if (NR_VECTORS + 32 * NR_CPUS) < 1024
20#define NR_IRQS (NR_VECTORS + 32 * NR_CPUS)
21#else
22#define NR_IRQS 1024
23#endif
19 24
20static __inline__ int 25static __inline__ int
21irq_canonicalize (int irq) 26irq_canonicalize (int irq)
@@ -28,9 +33,6 @@ irq_canonicalize (int irq)
28 return ((irq == 2) ? 9 : irq); 33 return ((irq == 2) ? 9 : irq);
29} 34}
30 35
31extern void disable_irq (unsigned int);
32extern void disable_irq_nosync (unsigned int);
33extern void enable_irq (unsigned int);
34extern void set_irq_affinity_info (unsigned int irq, int dest, int redir); 36extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
35bool is_affinity_mask_valid(cpumask_t cpumask); 37bool is_affinity_mask_valid(cpumask_t cpumask);
36 38
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index 6382e52ec227..067d9dea68f9 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -82,8 +82,6 @@ struct kprobe_ctlblk {
82 struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ]; 82 struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ];
83}; 83};
84 84
85#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
86
87#define ARCH_SUPPORTS_KRETPROBES 85#define ARCH_SUPPORTS_KRETPROBES
88#define ARCH_INACTIVE_KPROBE_COUNT 1 86#define ARCH_INACTIVE_KPROBE_COUNT 1
89 87
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
index ca33eb181ff2..c201a2020aa4 100644
--- a/include/asm-ia64/machvec.h
+++ b/include/asm-ia64/machvec.h
@@ -30,6 +30,7 @@ typedef void ia64_mv_send_ipi_t (int, int, int, int);
30typedef void ia64_mv_timer_interrupt_t (int, void *); 30typedef void ia64_mv_timer_interrupt_t (int, void *);
31typedef void ia64_mv_global_tlb_purge_t (struct mm_struct *, unsigned long, unsigned long, unsigned long); 31typedef void ia64_mv_global_tlb_purge_t (struct mm_struct *, unsigned long, unsigned long, unsigned long);
32typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *); 32typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *);
33typedef u8 ia64_mv_irq_to_vector (int);
33typedef unsigned int ia64_mv_local_vector_to_irq (u8); 34typedef unsigned int ia64_mv_local_vector_to_irq (u8);
34typedef char *ia64_mv_pci_get_legacy_mem_t (struct pci_bus *); 35typedef char *ia64_mv_pci_get_legacy_mem_t (struct pci_bus *);
35typedef int ia64_mv_pci_legacy_read_t (struct pci_bus *, u16 port, u32 *val, 36typedef int ia64_mv_pci_legacy_read_t (struct pci_bus *, u16 port, u32 *val,
@@ -145,6 +146,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *);
145# define platform_dma_sync_sg_for_device ia64_mv.dma_sync_sg_for_device 146# define platform_dma_sync_sg_for_device ia64_mv.dma_sync_sg_for_device
146# define platform_dma_mapping_error ia64_mv.dma_mapping_error 147# define platform_dma_mapping_error ia64_mv.dma_mapping_error
147# define platform_dma_supported ia64_mv.dma_supported 148# define platform_dma_supported ia64_mv.dma_supported
149# define platform_irq_to_vector ia64_mv.irq_to_vector
148# define platform_local_vector_to_irq ia64_mv.local_vector_to_irq 150# define platform_local_vector_to_irq ia64_mv.local_vector_to_irq
149# define platform_pci_get_legacy_mem ia64_mv.pci_get_legacy_mem 151# define platform_pci_get_legacy_mem ia64_mv.pci_get_legacy_mem
150# define platform_pci_legacy_read ia64_mv.pci_legacy_read 152# define platform_pci_legacy_read ia64_mv.pci_legacy_read
@@ -198,6 +200,7 @@ struct ia64_machine_vector {
198 ia64_mv_dma_sync_sg_for_device *dma_sync_sg_for_device; 200 ia64_mv_dma_sync_sg_for_device *dma_sync_sg_for_device;
199 ia64_mv_dma_mapping_error *dma_mapping_error; 201 ia64_mv_dma_mapping_error *dma_mapping_error;
200 ia64_mv_dma_supported *dma_supported; 202 ia64_mv_dma_supported *dma_supported;
203 ia64_mv_irq_to_vector *irq_to_vector;
201 ia64_mv_local_vector_to_irq *local_vector_to_irq; 204 ia64_mv_local_vector_to_irq *local_vector_to_irq;
202 ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem; 205 ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem;
203 ia64_mv_pci_legacy_read_t *pci_legacy_read; 206 ia64_mv_pci_legacy_read_t *pci_legacy_read;
@@ -247,6 +250,7 @@ struct ia64_machine_vector {
247 platform_dma_sync_sg_for_device, \ 250 platform_dma_sync_sg_for_device, \
248 platform_dma_mapping_error, \ 251 platform_dma_mapping_error, \
249 platform_dma_supported, \ 252 platform_dma_supported, \
253 platform_irq_to_vector, \
250 platform_local_vector_to_irq, \ 254 platform_local_vector_to_irq, \
251 platform_pci_get_legacy_mem, \ 255 platform_pci_get_legacy_mem, \
252 platform_pci_legacy_read, \ 256 platform_pci_legacy_read, \
@@ -275,6 +279,7 @@ struct ia64_machine_vector {
275 279
276extern struct ia64_machine_vector ia64_mv; 280extern struct ia64_machine_vector ia64_mv;
277extern void machvec_init (const char *name); 281extern void machvec_init (const char *name);
282extern void machvec_init_from_cmdline(const char *cmdline);
278 283
279# else 284# else
280# error Unknown configuration. Update asm-ia64/machvec.h. 285# error Unknown configuration. Update asm-ia64/machvec.h.
@@ -365,6 +370,9 @@ extern ia64_mv_dma_supported swiotlb_dma_supported;
365#ifndef platform_dma_supported 370#ifndef platform_dma_supported
366# define platform_dma_supported swiotlb_dma_supported 371# define platform_dma_supported swiotlb_dma_supported
367#endif 372#endif
373#ifndef platform_irq_to_vector
374# define platform_irq_to_vector __ia64_irq_to_vector
375#endif
368#ifndef platform_local_vector_to_irq 376#ifndef platform_local_vector_to_irq
369# define platform_local_vector_to_irq __ia64_local_vector_to_irq 377# define platform_local_vector_to_irq __ia64_local_vector_to_irq
370#endif 378#endif
diff --git a/include/asm-ia64/machvec_init.h b/include/asm-ia64/machvec_init.h
index 2d36f6840f0b..7f21249fba3f 100644
--- a/include/asm-ia64/machvec_init.h
+++ b/include/asm-ia64/machvec_init.h
@@ -2,6 +2,7 @@
2 2
3extern ia64_mv_send_ipi_t ia64_send_ipi; 3extern ia64_mv_send_ipi_t ia64_send_ipi;
4extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge; 4extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge;
5extern ia64_mv_irq_to_vector __ia64_irq_to_vector;
5extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq; 6extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq;
6extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem; 7extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem;
7extern ia64_mv_pci_legacy_read_t ia64_pci_legacy_read; 8extern ia64_mv_pci_legacy_read_t ia64_pci_legacy_read;
diff --git a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h
index eaa2fce0fecd..61439a7f5b08 100644
--- a/include/asm-ia64/machvec_sn2.h
+++ b/include/asm-ia64/machvec_sn2.h
@@ -35,6 +35,7 @@ extern ia64_mv_send_ipi_t sn2_send_IPI;
35extern ia64_mv_timer_interrupt_t sn_timer_interrupt; 35extern ia64_mv_timer_interrupt_t sn_timer_interrupt;
36extern ia64_mv_global_tlb_purge_t sn2_global_tlb_purge; 36extern ia64_mv_global_tlb_purge_t sn2_global_tlb_purge;
37extern ia64_mv_tlb_migrate_finish_t sn_tlb_migrate_finish; 37extern ia64_mv_tlb_migrate_finish_t sn_tlb_migrate_finish;
38extern ia64_mv_irq_to_vector sn_irq_to_vector;
38extern ia64_mv_local_vector_to_irq sn_local_vector_to_irq; 39extern ia64_mv_local_vector_to_irq sn_local_vector_to_irq;
39extern ia64_mv_pci_get_legacy_mem_t sn_pci_get_legacy_mem; 40extern ia64_mv_pci_get_legacy_mem_t sn_pci_get_legacy_mem;
40extern ia64_mv_pci_legacy_read_t sn_pci_legacy_read; 41extern ia64_mv_pci_legacy_read_t sn_pci_legacy_read;
@@ -104,6 +105,7 @@ extern ia64_mv_pci_fixup_bus_t sn_pci_fixup_bus;
104#define platform_readw_relaxed __sn_readw_relaxed 105#define platform_readw_relaxed __sn_readw_relaxed
105#define platform_readl_relaxed __sn_readl_relaxed 106#define platform_readl_relaxed __sn_readl_relaxed
106#define platform_readq_relaxed __sn_readq_relaxed 107#define platform_readq_relaxed __sn_readq_relaxed
108#define platform_irq_to_vector sn_irq_to_vector
107#define platform_local_vector_to_irq sn_local_vector_to_irq 109#define platform_local_vector_to_irq sn_local_vector_to_irq
108#define platform_pci_get_legacy_mem sn_pci_get_legacy_mem 110#define platform_pci_get_legacy_mem sn_pci_get_legacy_mem
109#define platform_pci_legacy_read sn_pci_legacy_read 111#define platform_pci_legacy_read sn_pci_legacy_read
diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h
index fbe5cf3ab8dc..43a7aac414e0 100644
--- a/include/asm-ia64/percpu.h
+++ b/include/asm-ia64/percpu.h
@@ -29,6 +29,16 @@
29 __attribute__((__section__(".data.percpu"))) \ 29 __attribute__((__section__(".data.percpu"))) \
30 __SMALL_ADDR_AREA __typeof__(type) per_cpu__##name 30 __SMALL_ADDR_AREA __typeof__(type) per_cpu__##name
31 31
32#ifdef CONFIG_SMP
33#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
34 __attribute__((__section__(".data.percpu.shared_aligned"))) \
35 __SMALL_ADDR_AREA __typeof__(type) per_cpu__##name \
36 ____cacheline_aligned_in_smp
37#else
38#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
39 DEFINE_PER_CPU(type, name)
40#endif
41
32/* 42/*
33 * Pretty much a literal copy of asm-generic/percpu.h, except that percpu_modcopy() is an 43 * Pretty much a literal copy of asm-generic/percpu.h, except that percpu_modcopy() is an
34 * external routine, to avoid include-hell. 44 * external routine, to avoid include-hell.
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index db81ba406cef..be3b0ae43270 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -220,7 +220,7 @@ struct desc_struct {
220 220
221#define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8) 221#define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8)
222 222
223struct partial_page_list; 223struct ia64_partial_page_list;
224#endif 224#endif
225 225
226struct thread_struct { 226struct thread_struct {
@@ -242,7 +242,7 @@ struct thread_struct {
242 __u64 fdr; /* IA32 fp except. data reg */ 242 __u64 fdr; /* IA32 fp except. data reg */
243 __u64 old_k1; /* old value of ar.k1 */ 243 __u64 old_k1; /* old value of ar.k1 */
244 __u64 old_iob; /* old IOBase value */ 244 __u64 old_iob; /* old IOBase value */
245 struct partial_page_list *ppl; /* partial page list for 4K page size issue */ 245 struct ia64_partial_page_list *ppl; /* partial page list for 4K page size issue */
246 /* cached TLS descriptors. */ 246 /* cached TLS descriptors. */
247 struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; 247 struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
248 248
@@ -295,9 +295,9 @@ struct thread_struct {
295 regs->ar_bspstore = current->thread.rbs_bot; \ 295 regs->ar_bspstore = current->thread.rbs_bot; \
296 regs->ar_fpsr = FPSR_DEFAULT; \ 296 regs->ar_fpsr = FPSR_DEFAULT; \
297 regs->loadrs = 0; \ 297 regs->loadrs = 0; \
298 regs->r8 = current->mm->dumpable; /* set "don't zap registers" flag */ \ 298 regs->r8 = get_dumpable(current->mm); /* set "don't zap registers" flag */ \
299 regs->r12 = new_sp - 16; /* allocate 16 byte scratch area */ \ 299 regs->r12 = new_sp - 16; /* allocate 16 byte scratch area */ \
300 if (unlikely(!current->mm->dumpable)) { \ 300 if (unlikely(!get_dumpable(current->mm))) { \
301 /* \ 301 /* \
302 * Zap scratch regs to avoid leaking bits between processes with different \ 302 * Zap scratch regs to avoid leaking bits between processes with different \
303 * uid/privileges. \ 303 * uid/privileges. \
diff --git a/include/asm-ia64/rwsem.h b/include/asm-ia64/rwsem.h
index 2d1640cc240a..8aba06a7b038 100644
--- a/include/asm-ia64/rwsem.h
+++ b/include/asm-ia64/rwsem.h
@@ -21,6 +21,10 @@
21#ifndef _ASM_IA64_RWSEM_H 21#ifndef _ASM_IA64_RWSEM_H
22#define _ASM_IA64_RWSEM_H 22#define _ASM_IA64_RWSEM_H
23 23
24#ifndef _LINUX_RWSEM_H
25#error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead."
26#endif
27
24#include <linux/list.h> 28#include <linux/list.h>
25#include <linux/spinlock.h> 29#include <linux/spinlock.h>
26 30
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h
index c60024989ebd..6314b29e8c4d 100644
--- a/include/asm-ia64/smp.h
+++ b/include/asm-ia64/smp.h
@@ -116,7 +116,6 @@ max_xtp (void)
116extern int __cpu_disable (void); 116extern int __cpu_disable (void);
117extern void __cpu_die (unsigned int cpu); 117extern void __cpu_die (unsigned int cpu);
118extern void cpu_die (void) __attribute__ ((noreturn)); 118extern void cpu_die (void) __attribute__ ((noreturn));
119extern int __cpu_up (unsigned int cpu);
120extern void __init smp_build_cpu_map(void); 119extern void __init smp_build_cpu_map(void);
121 120
122extern void __init init_smp_config (void); 121extern void __init init_smp_config (void);
diff --git a/include/asm-ia64/sn/arch.h b/include/asm-ia64/sn/arch.h
index 16adc93d7a72..7caa1f44cd95 100644
--- a/include/asm-ia64/sn/arch.h
+++ b/include/asm-ia64/sn/arch.h
@@ -81,5 +81,6 @@ extern u8 sn_sharing_domain_size;
81extern u8 sn_region_size; 81extern u8 sn_region_size;
82 82
83extern void sn_flush_all_caches(long addr, long bytes); 83extern void sn_flush_all_caches(long addr, long bytes);
84extern bool sn_cpu_disable_allowed(int cpu);
84 85
85#endif /* _ASM_IA64_SN_ARCH_H */ 86#endif /* _ASM_IA64_SN_ARCH_H */
diff --git a/include/asm-ia64/sn/intr.h b/include/asm-ia64/sn/intr.h
index 12b54ddb06be..e0487aa97418 100644
--- a/include/asm-ia64/sn/intr.h
+++ b/include/asm-ia64/sn/intr.h
@@ -60,6 +60,7 @@ extern u64 sn_intr_alloc(nasid_t, int,
60 int, nasid_t, int); 60 int, nasid_t, int);
61extern void sn_intr_free(nasid_t, int, struct sn_irq_info *); 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); 62extern struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *, nasid_t, int);
63extern void sn_set_err_irq_affinity(unsigned int);
63extern struct list_head **sn_irq_lh; 64extern struct list_head **sn_irq_lh;
64 65
65#define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector) 66#define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector)
diff --git a/include/asm-ia64/sn/sn_feature_sets.h b/include/asm-ia64/sn/sn_feature_sets.h
index bfdc36273ed4..8e83ac117ace 100644
--- a/include/asm-ia64/sn/sn_feature_sets.h
+++ b/include/asm-ia64/sn/sn_feature_sets.h
@@ -31,6 +31,7 @@ extern int sn_prom_feature_available(int id);
31#define PRF_PAL_CACHE_FLUSH_SAFE 0 31#define PRF_PAL_CACHE_FLUSH_SAFE 0
32#define PRF_DEVICE_FLUSH_LIST 1 32#define PRF_DEVICE_FLUSH_LIST 1
33#define PRF_HOTPLUG_SUPPORT 2 33#define PRF_HOTPLUG_SUPPORT 2
34#define PRF_CPU_DISABLE_SUPPORT 3
34 35
35/* --------------------- OS Features -------------------------------*/ 36/* --------------------- OS Features -------------------------------*/
36 37
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index 384fbf7f2a0f..91bb8e00066c 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -259,7 +259,6 @@ extern void ia64_load_extra (struct task_struct *task);
259#define ia64_platform_is(x) (strcmp(x, platform_name) == 0) 259#define ia64_platform_is(x) (strcmp(x, platform_name) == 0)
260 260
261void cpu_idle_wait(void); 261void cpu_idle_wait(void);
262void sched_cacheflush(void);
263 262
264#define arch_align_stack(x) (x) 263#define arch_align_stack(x) (x)
265 264
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h
index 7d0241db622b..d16031e72efa 100644
--- a/include/asm-ia64/thread_info.h
+++ b/include/asm-ia64/thread_info.h
@@ -79,13 +79,13 @@ struct thread_info {
79 * - pending work-to-be-done flags are in least-significant 16 bits, other flags 79 * - pending work-to-be-done flags are in least-significant 16 bits, other flags
80 * in top 16 bits 80 * in top 16 bits
81 */ 81 */
82#define TIF_NOTIFY_RESUME 0 /* resumption notification requested */ 82#define TIF_SIGPENDING 0 /* signal pending */
83#define TIF_SIGPENDING 1 /* signal pending */ 83#define TIF_NEED_RESCHED 1 /* rescheduling necessary */
84#define TIF_NEED_RESCHED 2 /* rescheduling necessary */ 84#define TIF_SYSCALL_TRACE 2 /* syscall trace active */
85#define TIF_SYSCALL_TRACE 3 /* syscall trace active */ 85#define TIF_SYSCALL_AUDIT 3 /* syscall auditing active */
86#define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ 86#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */
87#define TIF_SINGLESTEP 5 /* restore singlestep on return to user mode */ 87#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
88#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */ 88#define TIF_PERFMON_WORK 6 /* work for pfm_handle_work() */
89#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 89#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
90#define TIF_MEMDIE 17 90#define TIF_MEMDIE 17
91#define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */ 91#define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */
@@ -96,8 +96,8 @@ struct thread_info {
96#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 96#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
97#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) 97#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
98#define _TIF_SYSCALL_TRACEAUDIT (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP) 98#define _TIF_SYSCALL_TRACEAUDIT (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
99#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
100#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 99#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
100#define _TIF_PERFMON_WORK (1 << TIF_PERFMON_WORK)
101#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 101#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
102#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 102#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
103#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 103#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
@@ -106,7 +106,9 @@ struct thread_info {
106#define _TIF_FREEZE (1 << TIF_FREEZE) 106#define _TIF_FREEZE (1 << TIF_FREEZE)
107 107
108/* "work to do on user-return" bits */ 108/* "work to do on user-return" bits */
109#define TIF_ALLWORK_MASK (_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_RESTORE_SIGMASK) 109#define TIF_ALLWORK_MASK (_TIF_SIGPENDING|_TIF_PERFMON_WORK|_TIF_SYSCALL_AUDIT|\
110 _TIF_NEED_RESCHED| _TIF_SYSCALL_TRACE|\
111 _TIF_RESTORE_SIGMASK)
110/* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */ 112/* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */
111#define TIF_WORK_MASK (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)) 113#define TIF_WORK_MASK (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT))
112 114
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index 441c9e001776..315f8de950a2 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -292,7 +292,7 @@
292#define __NR_sync_file_range 1300 292#define __NR_sync_file_range 1300
293#define __NR_tee 1301 293#define __NR_tee 1301
294#define __NR_vmsplice 1302 294#define __NR_vmsplice 1302
295/* 1303 reserved for move_pages */ 295#define __NR_fallocate 1303
296#define __NR_getcpu 1304 296#define __NR_getcpu 1304
297#define __NR_epoll_pwait 1305 297#define __NR_epoll_pwait 1305
298#define __NR_utimensat 1306 298#define __NR_utimensat 1306
diff --git a/include/asm-ia64/ustack.h b/include/asm-ia64/ustack.h
index a349467913ea..504167c35b8b 100644
--- a/include/asm-ia64/ustack.h
+++ b/include/asm-ia64/ustack.h
@@ -11,6 +11,7 @@
11/* The absolute hard limit for stack size is 1/2 of the mappable space in the region */ 11/* The absolute hard limit for stack size is 1/2 of the mappable space in the region */
12#define MAX_USER_STACK_SIZE (RGN_MAP_LIMIT/2) 12#define MAX_USER_STACK_SIZE (RGN_MAP_LIMIT/2)
13#define STACK_TOP (0x6000000000000000UL + RGN_MAP_LIMIT) 13#define STACK_TOP (0x6000000000000000UL + RGN_MAP_LIMIT)
14#define STACK_TOP_MAX STACK_TOP
14#endif 15#endif
15 16
16/* Make a default stack size of 2GiB */ 17/* Make a default stack size of 2GiB */
diff --git a/include/asm-m32r/a.out.h b/include/asm-m32r/a.out.h
index 9a4a5d20160a..6a1b5d42f328 100644
--- a/include/asm-m32r/a.out.h
+++ b/include/asm-m32r/a.out.h
@@ -20,6 +20,7 @@ struct exec
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#define STACK_TOP TASK_SIZE 22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
23 24
24#endif 25#endif
25 26
diff --git a/include/asm-m32r/assembler.h b/include/asm-m32r/assembler.h
index 47041d19d4a8..26351539b5ff 100644
--- a/include/asm-m32r/assembler.h
+++ b/include/asm-m32r/assembler.h
@@ -52,27 +52,27 @@
52 .endm 52 .endm
53 53
54#if !(defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_M32104)) 54#if !(defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_M32104))
55#define STI(reg) STI_M reg 55#define ENABLE_INTERRUPTS(reg) ENABLE_INTERRUPTS reg
56 .macro STI_M reg 56 .macro ENABLE_INTERRUPTS reg
57 setpsw #0x40 -> nop 57 setpsw #0x40 -> nop
58 ; WORKAROUND: "-> nop" is a workaround for the M32700(TS1). 58 ; WORKAROUND: "-> nop" is a workaround for the M32700(TS1).
59 .endm 59 .endm
60 60
61#define CLI(reg) CLI_M reg 61#define DISABLE_INTERRUPTS(reg) DISABLE_INTERRUPTS reg
62 .macro CLI_M reg 62 .macro DISABLE_INTERRUPTS reg
63 clrpsw #0x40 -> nop 63 clrpsw #0x40 -> nop
64 ; WORKAROUND: "-> nop" is a workaround for the M32700(TS1). 64 ; WORKAROUND: "-> nop" is a workaround for the M32700(TS1).
65 .endm 65 .endm
66#else /* CONFIG_CHIP_M32102 || CONFIG_CHIP_M32104 */ 66#else /* CONFIG_CHIP_M32102 || CONFIG_CHIP_M32104 */
67#define STI(reg) STI_M reg 67#define ENABLE_INTERRUPTS(reg) ENABLE_INTERRUPTS reg
68 .macro STI_M reg 68 .macro ENABLE_INTERRUPTS reg
69 mvfc \reg, psw 69 mvfc \reg, psw
70 or3 \reg, \reg, #0x0040 70 or3 \reg, \reg, #0x0040
71 mvtc \reg, psw 71 mvtc \reg, psw
72 .endm 72 .endm
73 73
74#define CLI(reg) CLI_M reg 74#define DISABLE_INTERRUPTS(reg) DISABLE_INTERRUPTS reg
75 .macro CLI_M reg 75 .macro DISABLE_INTERRUPTS reg
76 mvfc \reg, psw 76 mvfc \reg, psw
77 and3 \reg, \reg, #0xffbf 77 and3 \reg, \reg, #0xffbf
78 mvtc \reg, psw 78 mvtc \reg, psw
diff --git a/include/asm-m32r/m32r.h b/include/asm-m32r/m32r.h
index decfc59907c7..214b44b40757 100644
--- a/include/asm-m32r/m32r.h
+++ b/include/asm-m32r/m32r.h
@@ -22,12 +22,26 @@
22#include <asm/m32700ut/m32700ut_pld.h> 22#include <asm/m32700ut/m32700ut_pld.h>
23#include <asm/m32700ut/m32700ut_lan.h> 23#include <asm/m32700ut/m32700ut_lan.h>
24#include <asm/m32700ut/m32700ut_lcd.h> 24#include <asm/m32700ut/m32700ut_lcd.h>
25/* for ei_handler:linux/arch/m32r/kernel/entry.S */
26#define M32R_INT1ICU_ISTS PLD_ICUISTS
27#define M32R_INT1ICU_IRQ_BASE M32700UT_PLD_IRQ_BASE
28#define M32R_INT0ICU_ISTS M32700UT_LAN_ICUISTS
29#define M32R_INT0ICU_IRQ_BASE M32700UT_LAN_PLD_IRQ_BASE
30#define M32R_INT2ICU_ISTS M32700UT_LCD_ICUISTS
31#define M32R_INT2ICU_IRQ_BASE M32700UT_LCD_PLD_IRQ_BASE
25#endif /* CONFIG_PLAT_M32700UT */ 32#endif /* CONFIG_PLAT_M32700UT */
26 33
27#if defined(CONFIG_PLAT_OPSPUT) 34#if defined(CONFIG_PLAT_OPSPUT)
28#include <asm/opsput/opsput_pld.h> 35#include <asm/opsput/opsput_pld.h>
29#include <asm/opsput/opsput_lan.h> 36#include <asm/opsput/opsput_lan.h>
30#include <asm/opsput/opsput_lcd.h> 37#include <asm/opsput/opsput_lcd.h>
38/* for ei_handler:linux/arch/m32r/kernel/entry.S */
39#define M32R_INT1ICU_ISTS PLD_ICUISTS
40#define M32R_INT1ICU_IRQ_BASE OPSPUT_PLD_IRQ_BASE
41#define M32R_INT0ICU_ISTS OPSPUT_LAN_ICUISTS
42#define M32R_INT0ICU_IRQ_BASE OPSPUT_LAN_PLD_IRQ_BASE
43#define M32R_INT2ICU_ISTS OPSPUT_LCD_ICUISTS
44#define M32R_INT2ICU_IRQ_BASE OPSPUT_LCD_PLD_IRQ_BASE
31#endif /* CONFIG_PLAT_OPSPUT */ 45#endif /* CONFIG_PLAT_OPSPUT */
32 46
33#if defined(CONFIG_PLAT_MAPPI2) 47#if defined(CONFIG_PLAT_MAPPI2)
@@ -40,10 +54,16 @@
40 54
41#if defined(CONFIG_PLAT_USRV) 55#if defined(CONFIG_PLAT_USRV)
42#include <asm/m32700ut/m32700ut_pld.h> 56#include <asm/m32700ut/m32700ut_pld.h>
57/* for ei_handler:linux/arch/m32r/kernel/entry.S */
58#define M32R_INT1ICU_ISTS PLD_ICUISTS
59#define M32R_INT1ICU_IRQ_BASE M32700UT_PLD_IRQ_BASE
43#endif 60#endif
44 61
45#if defined(CONFIG_PLAT_M32104UT) 62#if defined(CONFIG_PLAT_M32104UT)
46#include <asm/m32104ut/m32104ut_pld.h> 63#include <asm/m32104ut/m32104ut_pld.h>
64/* for ei_handler:linux/arch/m32r/kernel/entry.S */
65#define M32R_INT1ICU_ISTS PLD_ICUISTS
66#define M32R_INT1ICU_IRQ_BASE M32104UT_PLD_IRQ_BASE
47#endif /* CONFIG_PLAT_M32104 */ 67#endif /* CONFIG_PLAT_M32104 */
48 68
49/* 69/*
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h
index 8ee73d3f316d..2365de5c2955 100644
--- a/include/asm-m32r/system.h
+++ b/include/asm-m32r/system.h
@@ -54,16 +54,6 @@
54 ); \ 54 ); \
55} while(0) 55} while(0)
56 56
57/*
58 * On SMP systems, when the scheduler does migration-cost autodetection,
59 * it needs a way to flush as much of the CPU's caches as possible.
60 *
61 * TODO: fill this in!
62 */
63static inline void sched_cacheflush(void)
64{
65}
66
67/* Interrupt Control */ 57/* Interrupt Control */
68#if !defined(CONFIG_CHIP_M32102) && !defined(CONFIG_CHIP_M32104) 58#if !defined(CONFIG_CHIP_M32102) && !defined(CONFIG_CHIP_M32104)
69#define local_irq_enable() \ 59#define local_irq_enable() \
diff --git a/include/asm-m32r/thread_info.h b/include/asm-m32r/thread_info.h
index 22aff3222d22..b7ccc3e68604 100644
--- a/include/asm-m32r/thread_info.h
+++ b/include/asm-m32r/thread_info.h
@@ -146,17 +146,15 @@ static inline unsigned int get_thread_fault_code(void)
146 * - other flags in MSW 146 * - other flags in MSW
147 */ 147 */
148#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 148#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
149#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 149#define TIF_SIGPENDING 1 /* signal pending */
150#define TIF_SIGPENDING 2 /* signal pending */ 150#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
151#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 151#define TIF_SINGLESTEP 3 /* restore singlestep on return to user mode */
152#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ 152#define TIF_IRET 4 /* return with iret */
153#define TIF_IRET 5 /* return with iret */
154#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 153#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
155 /* 31..28 fault code */ 154 /* 31..28 fault code */
156#define TIF_MEMDIE 17 155#define TIF_MEMDIE 17
157 156
158#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 157#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
159#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
160#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 158#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
161#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 159#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
162#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) 160#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
diff --git a/include/asm-m68k/a.out.h b/include/asm-m68k/a.out.h
index eda1662773b8..6fc86a221a94 100644
--- a/include/asm-m68k/a.out.h
+++ b/include/asm-m68k/a.out.h
@@ -20,6 +20,7 @@ struct exec
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#define STACK_TOP TASK_SIZE 22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
23 24
24#endif 25#endif
25 26
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h
index 5e0fcf41804d..47bb9cf107b7 100644
--- a/include/asm-m68k/io.h
+++ b/include/asm-m68k/io.h
@@ -27,6 +27,7 @@
27#include <asm/raw_io.h> 27#include <asm/raw_io.h>
28#include <asm/virtconvert.h> 28#include <asm/virtconvert.h>
29 29
30#include <asm-generic/iomap.h>
30 31
31#ifdef CONFIG_ATARI 32#ifdef CONFIG_ATARI
32#include <asm/atarihw.h> 33#include <asm/atarihw.h>
@@ -152,6 +153,16 @@ static inline u16 __iomem *isa_itw(unsigned long addr)
152 default: return NULL; /* avoid warnings, just in case */ 153 default: return NULL; /* avoid warnings, just in case */
153 } 154 }
154} 155}
156static inline u32 __iomem *isa_itl(unsigned long addr)
157{
158 switch(ISA_TYPE)
159 {
160#ifdef CONFIG_AMIGA_PCMCIA
161 case AG_ISA: return (u32 __iomem *)AG_ISA_IO_W(addr);
162#endif
163 default: return 0; /* avoid warnings, just in case */
164 }
165}
155static inline u8 __iomem *isa_mtb(unsigned long addr) 166static inline u8 __iomem *isa_mtb(unsigned long addr)
156{ 167{
157 switch(ISA_TYPE) 168 switch(ISA_TYPE)
@@ -188,8 +199,10 @@ static inline u16 __iomem *isa_mtw(unsigned long addr)
188 199
189#define isa_inb(port) in_8(isa_itb(port)) 200#define isa_inb(port) in_8(isa_itb(port))
190#define isa_inw(port) (ISA_SEX ? in_be16(isa_itw(port)) : in_le16(isa_itw(port))) 201#define isa_inw(port) (ISA_SEX ? in_be16(isa_itw(port)) : in_le16(isa_itw(port)))
202#define isa_inl(port) (ISA_SEX ? in_be32(isa_itl(port)) : in_le32(isa_itl(port)))
191#define isa_outb(val,port) out_8(isa_itb(port),(val)) 203#define isa_outb(val,port) out_8(isa_itb(port),(val))
192#define isa_outw(val,port) (ISA_SEX ? out_be16(isa_itw(port),(val)) : out_le16(isa_itw(port),(val))) 204#define isa_outw(val,port) (ISA_SEX ? out_be16(isa_itw(port),(val)) : out_le16(isa_itw(port),(val)))
205#define isa_outl(val,port) (ISA_SEX ? out_be32(isa_itl(port),(val)) : out_le32(isa_itl(port),(val)))
193 206
194#define isa_readb(p) in_8(isa_mtb((unsigned long)(p))) 207#define isa_readb(p) in_8(isa_mtb((unsigned long)(p)))
195#define isa_readw(p) \ 208#define isa_readw(p) \
@@ -234,6 +247,15 @@ static inline void isa_delay(void)
234#define isa_outsw(port, buf, nr) \ 247#define isa_outsw(port, buf, nr) \
235 (ISA_SEX ? raw_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \ 248 (ISA_SEX ? raw_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \
236 raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr))) 249 raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
250
251#define isa_insl(port, buf, nr) \
252 (ISA_SEX ? raw_insl(isa_itl(port), (u32 *)(buf), (nr)) : \
253 raw_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
254
255#define isa_outsl(port, buf, nr) \
256 (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) : \
257 raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
258
237#endif /* CONFIG_ISA */ 259#endif /* CONFIG_ISA */
238 260
239 261
@@ -246,14 +268,16 @@ static inline void isa_delay(void)
246#define inw_p isa_inw_p 268#define inw_p isa_inw_p
247#define outw isa_outw 269#define outw isa_outw
248#define outw_p isa_outw_p 270#define outw_p isa_outw_p
249#define inl isa_inw 271#define inl isa_inl
250#define inl_p isa_inw_p 272#define inl_p isa_inl_p
251#define outl isa_outw 273#define outl isa_outl
252#define outl_p isa_outw_p 274#define outl_p isa_outl_p
253#define insb isa_insb 275#define insb isa_insb
254#define insw isa_insw 276#define insw isa_insw
277#define insl isa_insl
255#define outsb isa_outsb 278#define outsb isa_outsb
256#define outsw isa_outsw 279#define outsw isa_outsw
280#define outsl isa_outsl
257#define readb isa_readb 281#define readb isa_readb
258#define readw isa_readw 282#define readw isa_readw
259#define writeb isa_writeb 283#define writeb isa_writeb
@@ -262,8 +286,6 @@ static inline void isa_delay(void)
262 286
263#if defined(CONFIG_PCI) 287#if defined(CONFIG_PCI)
264 288
265#define inl(port) in_le32(port)
266#define outl(val,port) out_le32((port),(val))
267#define readl(addr) in_le32(addr) 289#define readl(addr) in_le32(addr)
268#define writel(val,addr) out_le32((addr),(val)) 290#define writel(val,addr) out_le32((addr),(val))
269 291
@@ -282,6 +304,8 @@ static inline void isa_delay(void)
282#define outb(val,port) out_8((port),(val)) 304#define outb(val,port) out_8((port),(val))
283#define inw(port) in_le16(port) 305#define inw(port) in_le16(port)
284#define outw(val,port) out_le16((port),(val)) 306#define outw(val,port) out_le16((port),(val))
307#define inl(port) in_le32(port)
308#define outl(val,port) out_le32((port),(val))
285 309
286#else 310#else
287/* 311/*
@@ -306,20 +330,35 @@ static inline void isa_delay(void)
306#endif 330#endif
307#endif /* CONFIG_PCI */ 331#endif /* CONFIG_PCI */
308 332
309#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI) && defined(CONFIG_HP300) 333#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI)
310/* 334/*
311 * We need to define dummy functions otherwise drivers/serial/8250.c doesn't link 335 * We need to define dummy functions for GENERIC_IOMAP support.
312 */ 336 */
313#define inb(port) 0xff 337#define inb(port) 0xff
314#define inb_p(port) 0xff 338#define inb_p(port) 0xff
315#define outb(val,port) do { } while (0) 339#define outb(val,port) ((void)0)
316#define outb_p(val,port) do { } while (0) 340#define outb_p(val,port) ((void)0)
341#define inw(port) 0xffff
342#define outw(val,port) ((void)0)
343#define inl(port) 0xffffffffUL
344#define outl(val,port) ((void)0)
345
346#define insb(port,buf,nr) ((void)0)
347#define outsb(port,buf,nr) ((void)0)
348#define insw(port,buf,nr) ((void)0)
349#define outsw(port,buf,nr) ((void)0)
350#define insl(port,buf,nr) ((void)0)
351#define outsl(port,buf,nr) ((void)0)
317 352
318/* 353/*
319 * These should be valid on any ioremap()ed region 354 * These should be valid on any ioremap()ed region
320 */ 355 */
321#define readb(addr) in_8(addr) 356#define readb(addr) in_8(addr)
322#define writeb(val,addr) out_8((addr),(val)) 357#define writeb(val,addr) out_8((addr),(val))
358#define readw(addr) in_le16(addr)
359#define writew(val,addr) out_le16((addr),(val))
360#endif
361#if !defined(CONFIG_PCI)
323#define readl(addr) in_le32(addr) 362#define readl(addr) in_le32(addr)
324#define writel(val,addr) out_le32((addr),(val)) 363#define writel(val,addr) out_le32((addr),(val))
325#endif 364#endif
@@ -351,6 +390,18 @@ extern void dma_cache_wback_inv(unsigned long start, unsigned long size);
351extern void dma_cache_wback(unsigned long start, unsigned long size); 390extern void dma_cache_wback(unsigned long start, unsigned long size);
352extern void dma_cache_inv(unsigned long start, unsigned long size); 391extern void dma_cache_inv(unsigned long start, unsigned long size);
353 392
393static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count)
394{
395 __builtin_memset((void __force *) addr, val, count);
396}
397static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
398{
399 __builtin_memcpy(dst, (void __force *) src, count);
400}
401static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count)
402{
403 __builtin_memcpy((void __force *) dst, src, count);
404}
354 405
355#ifndef CONFIG_SUN3 406#ifndef CONFIG_SUN3
356#define IO_SPACE_LIMIT 0xffff 407#define IO_SPACE_LIMIT 0xffff
diff --git a/include/asm-m68k/ioctls.h b/include/asm-m68k/ioctls.h
index 0c48929ab444..b8d2f4be7fd7 100644
--- a/include/asm-m68k/ioctls.h
+++ b/include/asm-m68k/ioctls.h
@@ -46,6 +46,10 @@
46#define TIOCSBRK 0x5427 /* BSD compatibility */ 46#define TIOCSBRK 0x5427 /* BSD compatibility */
47#define TIOCCBRK 0x5428 /* BSD compatibility */ 47#define TIOCCBRK 0x5428 /* BSD compatibility */
48#define TIOCGSID 0x5429 /* Return the session ID of FD */ 48#define TIOCGSID 0x5429 /* Return the session ID of FD */
49#define TCGETS2 _IOR('T',0x2A, struct termios2)
50#define TCSETS2 _IOW('T',0x2B, struct termios2)
51#define TCSETSW2 _IOW('T',0x2C, struct termios2)
52#define TCSETSF2 _IOW('T',0x2D, struct termios2)
49#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 53#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
50#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 54#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
51 55
diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h
index 4901cb105e2f..eb29a5260591 100644
--- a/include/asm-m68k/irq.h
+++ b/include/asm-m68k/irq.h
@@ -59,9 +59,6 @@
59#define IRQ_USER 8 59#define IRQ_USER 8
60 60
61extern unsigned int irq_canonicalize(unsigned int irq); 61extern unsigned int irq_canonicalize(unsigned int irq);
62extern void enable_irq(unsigned int);
63extern void disable_irq(unsigned int);
64#define disable_irq_nosync disable_irq
65 62
66struct pt_regs; 63struct pt_regs;
67 64
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h
index 9e6d0d6debdb..1431ea0b59e0 100644
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -4,17 +4,15 @@
4 4
5#ifdef __KERNEL__ 5#ifdef __KERNEL__
6 6
7#include <linux/const.h>
8
7/* PAGE_SHIFT determines the page size */ 9/* PAGE_SHIFT determines the page size */
8#ifndef CONFIG_SUN3 10#ifndef CONFIG_SUN3
9#define PAGE_SHIFT (12) 11#define PAGE_SHIFT (12)
10#else 12#else
11#define PAGE_SHIFT (13) 13#define PAGE_SHIFT (13)
12#endif 14#endif
13#ifdef __ASSEMBLY__ 15#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
14#define PAGE_SIZE (1 << PAGE_SHIFT)
15#else
16#define PAGE_SIZE (1UL << PAGE_SHIFT)
17#endif
18#define PAGE_MASK (~(PAGE_SIZE-1)) 16#define PAGE_MASK (~(PAGE_SIZE-1))
19 17
20#include <asm/setup.h> 18#include <asm/setup.h>
@@ -27,6 +25,8 @@
27 25
28#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
29 27
28#include <linux/compiler.h>
29
30#include <asm/module.h> 30#include <asm/module.h>
31 31
32#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) 32#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
diff --git a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h
index 8455f778b601..4453ec379c5d 100644
--- a/include/asm-m68k/processor.h
+++ b/include/asm-m68k/processor.h
@@ -38,12 +38,8 @@ static inline void wrusp(unsigned long usp)
38#ifndef CONFIG_SUN3 38#ifndef CONFIG_SUN3
39#define TASK_SIZE (0xF0000000UL) 39#define TASK_SIZE (0xF0000000UL)
40#else 40#else
41#ifdef __ASSEMBLY__
42#define TASK_SIZE (0x0E000000)
43#else
44#define TASK_SIZE (0x0E000000UL) 41#define TASK_SIZE (0x0E000000UL)
45#endif 42#endif
46#endif
47 43
48/* This decides where the kernel will search for a free chunk of vm 44/* This decides where the kernel will search for a free chunk of vm
49 * space during mmap's. 45 * space during mmap's.
diff --git a/include/asm-m68k/raw_io.h b/include/asm-m68k/raw_io.h
index 811ccd25d4a6..d9eb9834ccc8 100644
--- a/include/asm-m68k/raw_io.h
+++ b/include/asm-m68k/raw_io.h
@@ -36,23 +36,29 @@ extern void __iounmap(void *addr, unsigned long size);
36#define in_be32(addr) \ 36#define in_be32(addr) \
37 ({ u32 __v = (*(__force volatile u32 *) (addr)); __v; }) 37 ({ u32 __v = (*(__force volatile u32 *) (addr)); __v; })
38#define in_le16(addr) \ 38#define in_le16(addr) \
39 ({ u16 __v = le16_to_cpu(*(__force volatile u16 *) (addr)); __v; }) 39 ({ u16 __v = le16_to_cpu(*(__force volatile __le16 *) (addr)); __v; })
40#define in_le32(addr) \ 40#define in_le32(addr) \
41 ({ u32 __v = le32_to_cpu(*(__force volatile u32 *) (addr)); __v; }) 41 ({ u32 __v = le32_to_cpu(*(__force volatile __le32 *) (addr)); __v; })
42 42
43#define out_8(addr,b) (void)((*(__force volatile u8 *) (addr)) = (b)) 43#define out_8(addr,b) (void)((*(__force volatile u8 *) (addr)) = (b))
44#define out_be16(addr,w) (void)((*(__force volatile u16 *) (addr)) = (w)) 44#define out_be16(addr,w) (void)((*(__force volatile u16 *) (addr)) = (w))
45#define out_be32(addr,l) (void)((*(__force volatile u32 *) (addr)) = (l)) 45#define out_be32(addr,l) (void)((*(__force volatile u32 *) (addr)) = (l))
46#define out_le16(addr,w) (void)((*(__force volatile u16 *) (addr)) = cpu_to_le16(w)) 46#define out_le16(addr,w) (void)((*(__force volatile __le16 *) (addr)) = cpu_to_le16(w))
47#define out_le32(addr,l) (void)((*(__force volatile u32 *) (addr)) = cpu_to_le32(l)) 47#define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
48 48
49#define raw_inb in_8 49#define raw_inb in_8
50#define raw_inw in_be16 50#define raw_inw in_be16
51#define raw_inl in_be32 51#define raw_inl in_be32
52#define __raw_readb in_8
53#define __raw_readw in_be16
54#define __raw_readl in_be32
52 55
53#define raw_outb(val,port) out_8((port),(val)) 56#define raw_outb(val,port) out_8((port),(val))
54#define raw_outw(val,port) out_be16((port),(val)) 57#define raw_outw(val,port) out_be16((port),(val))
55#define raw_outl(val,port) out_be32((port),(val)) 58#define raw_outl(val,port) out_be32((port),(val))
59#define __raw_writeb(val,addr) out_8((addr),(val))
60#define __raw_writew(val,addr) out_be16((addr),(val))
61#define __raw_writel(val,addr) out_be32((addr),(val))
56 62
57static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) 63static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len)
58{ 64{
@@ -336,8 +342,6 @@ static inline void raw_outsw_swapw(volatile u16 __iomem *port, const u16 *buf,
336 : "d0", "a0", "a1", "d6"); 342 : "d0", "a0", "a1", "d6");
337} 343}
338 344
339#define __raw_writel raw_outl
340
341#endif /* __KERNEL__ */ 345#endif /* __KERNEL__ */
342 346
343#endif /* _RAW_IO_H */ 347#endif /* _RAW_IO_H */
diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h
index 198878b53a61..caa9b1663e45 100644
--- a/include/asm-m68k/system.h
+++ b/include/asm-m68k/system.h
@@ -46,6 +46,22 @@ asmlinkage void resume(void);
46} while (0) 46} while (0)
47 47
48 48
49/*
50 * Force strict CPU ordering.
51 * Not really required on m68k...
52 */
53#define nop() do { asm volatile ("nop"); barrier(); } while (0)
54#define mb() barrier()
55#define rmb() barrier()
56#define wmb() barrier()
57#define read_barrier_depends() ((void)0)
58#define set_mb(var, value) ({ (var) = (value); wmb(); })
59
60#define smp_mb() barrier()
61#define smp_rmb() barrier()
62#define smp_wmb() barrier()
63#define smp_read_barrier_depends() ((void)0)
64
49/* interrupt control.. */ 65/* interrupt control.. */
50#if 0 66#if 0
51#define local_irq_enable() asm volatile ("andiw %0,%%sr": : "i" (ALLOWINT) : "memory") 67#define local_irq_enable() asm volatile ("andiw %0,%%sr": : "i" (ALLOWINT) : "memory")
@@ -70,23 +86,6 @@ static inline int irqs_disabled(void)
70/* For spinlocks etc */ 86/* For spinlocks etc */
71#define local_irq_save(x) ({ local_save_flags(x); local_irq_disable(); }) 87#define local_irq_save(x) ({ local_save_flags(x); local_irq_disable(); })
72 88
73/*
74 * Force strict CPU ordering.
75 * Not really required on m68k...
76 */
77#define nop() do { asm volatile ("nop"); barrier(); } while (0)
78#define mb() barrier()
79#define rmb() barrier()
80#define wmb() barrier()
81#define read_barrier_depends() ((void)0)
82#define set_mb(var, value) ({ (var) = (value); wmb(); })
83
84#define smp_mb() barrier()
85#define smp_rmb() barrier()
86#define smp_wmb() barrier()
87#define smp_read_barrier_depends() ((void)0)
88
89
90#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 89#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
91 90
92struct __xchg_dummy { unsigned long a[100]; }; 91struct __xchg_dummy { unsigned long a[100]; };
diff --git a/include/asm-m68k/termbits.h b/include/asm-m68k/termbits.h
index 0e520f328f53..8c14170996bb 100644
--- a/include/asm-m68k/termbits.h
+++ b/include/asm-m68k/termbits.h
@@ -141,6 +141,7 @@ struct ktermios {
141#define HUPCL 0002000 141#define HUPCL 0002000
142#define CLOCAL 0004000 142#define CLOCAL 0004000
143#define CBAUDEX 0010000 143#define CBAUDEX 0010000
144#define BOTHER 0010000
144#define B57600 0010001 145#define B57600 0010001
145#define B115200 0010002 146#define B115200 0010002
146#define B230400 0010003 147#define B230400 0010003
@@ -156,10 +157,12 @@ struct ktermios {
156#define B3000000 0010015 157#define B3000000 0010015
157#define B3500000 0010016 158#define B3500000 0010016
158#define B4000000 0010017 159#define B4000000 0010017
159#define CIBAUD 002003600000 /* input baud rate (not used) */ 160#define CIBAUD 002003600000 /* input baud rate */
160#define CMSPAR 010000000000 /* mark or space (stick) parity */ 161#define CMSPAR 010000000000 /* mark or space (stick) parity */
161#define CRTSCTS 020000000000 /* flow control */ 162#define CRTSCTS 020000000000 /* flow control */
162 163
164#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
165
163/* c_lflag bits */ 166/* c_lflag bits */
164#define ISIG 0000001 167#define ISIG 0000001
165#define ICANON 0000002 168#define ICANON 0000002
diff --git a/include/asm-m68k/termios.h b/include/asm-m68k/termios.h
index 00edabd76168..0823032e4045 100644
--- a/include/asm-m68k/termios.h
+++ b/include/asm-m68k/termios.h
@@ -82,8 +82,10 @@ struct termio {
82 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 82 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
83}) 83})
84 84
85#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) 85#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
86#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) 86#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
87#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
88#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
87 89
88#endif /* __KERNEL__ */ 90#endif /* __KERNEL__ */
89 91
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h
index fdbb60e6a0d4..a30fe9c64143 100644
--- a/include/asm-m68k/unistd.h
+++ b/include/asm-m68k/unistd.h
@@ -313,10 +313,20 @@
313#define __NR_tee 308 313#define __NR_tee 308
314#define __NR_vmsplice 309 314#define __NR_vmsplice 309
315#define __NR_move_pages 310 315#define __NR_move_pages 310
316#define __NR_sched_setaffinity 311
317#define __NR_sched_getaffinity 312
318#define __NR_kexec_load 313
319#define __NR_getcpu 314
320#define __NR_epoll_pwait 315
321#define __NR_utimensat 316
322#define __NR_signalfd 317
323#define __NR_timerfd 318
324#define __NR_eventfd 319
325#define __NR_fallocate 320
316 326
317#ifdef __KERNEL__ 327#ifdef __KERNEL__
318 328
319#define NR_syscalls 311 329#define NR_syscalls 321
320 330
321#define __ARCH_WANT_IPC_PARSE_VERSION 331#define __ARCH_WANT_IPC_PARSE_VERSION
322#define __ARCH_WANT_OLD_READDIR 332#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-m68knommu/hardirq.h b/include/asm-m68knommu/hardirq.h
index 980075bab792..bfad28149a49 100644
--- a/include/asm-m68knommu/hardirq.h
+++ b/include/asm-m68knommu/hardirq.h
@@ -22,4 +22,6 @@ typedef struct {
22# error HARDIRQ_BITS is too low! 22# error HARDIRQ_BITS is too low!
23#endif 23#endif
24 24
25void ack_bad_irq(unsigned int irq);
26
25#endif /* __M68K_HARDIRQ_H */ 27#endif /* __M68K_HARDIRQ_H */
diff --git a/include/asm-m68knommu/hw_irq.h b/include/asm-m68knommu/hw_irq.h
new file mode 100644
index 000000000000..f3ec9e5ae049
--- /dev/null
+++ b/include/asm-m68knommu/hw_irq.h
@@ -0,0 +1,4 @@
1#ifndef __M68KNOMMU_HW_IRQ_H__
2#define __M68KNOMMU_HW_IRQ_H__
3
4#endif /* __M68KNOMMU_HW_IRQ_H__ */
diff --git a/include/asm-m68knommu/irq.h b/include/asm-m68knommu/irq.h
index 7b8f874f8429..9373c31ac87d 100644
--- a/include/asm-m68knommu/irq.h
+++ b/include/asm-m68knommu/irq.h
@@ -1,7 +1,5 @@
1#ifndef _M68K_IRQ_H_ 1#ifndef _M68KNOMMU_IRQ_H_
2#define _M68K_IRQ_H_ 2#define _M68KNOMMU_IRQ_H_
3
4#include <asm/ptrace.h>
5 3
6#ifdef CONFIG_COLDFIRE 4#ifdef CONFIG_COLDFIRE
7/* 5/*
@@ -17,75 +15,12 @@
17/* 15/*
18 * # of m68k interrupts 16 * # of m68k interrupts
19 */ 17 */
20#define SYS_IRQS 8 18#define SYS_IRQS 8
21#define NR_IRQS (24+SYS_IRQS) 19#define NR_IRQS (24 + SYS_IRQS)
22 20
23#endif /* CONFIG_COLDFIRE */ 21#endif /* CONFIG_COLDFIRE */
24 22
25/*
26 * Interrupt source definitions
27 * General interrupt sources are the level 1-7.
28 * Adding an interrupt service routine for one of these sources
29 * results in the addition of that routine to a chain of routines.
30 * Each one is called in succession. Each individual interrupt
31 * service routine should determine if the device associated with
32 * that routine requires service.
33 */
34 23
35#define IRQ1 (1) /* level 1 interrupt */
36#define IRQ2 (2) /* level 2 interrupt */
37#define IRQ3 (3) /* level 3 interrupt */
38#define IRQ4 (4) /* level 4 interrupt */
39#define IRQ5 (5) /* level 5 interrupt */
40#define IRQ6 (6) /* level 6 interrupt */
41#define IRQ7 (7) /* level 7 interrupt (non-maskable) */
42
43/*
44 * Machine specific interrupt sources.
45 *
46 * Adding an interrupt service routine for a source with this bit
47 * set indicates a special machine specific interrupt source.
48 * The machine specific files define these sources.
49 *
50 * The IRQ_MACHSPEC bit is now gone - the only thing it did was to
51 * introduce unnecessary overhead.
52 *
53 * All interrupt handling is actually machine specific so it is better
54 * to use function pointers, as used by the Sparc port, and select the
55 * interrupt handling functions when initializing the kernel. This way
56 * we save some unnecessary overhead at run-time.
57 * 01/11/97 - Jes
58 */
59
60extern void (*mach_enable_irq)(unsigned int);
61extern void (*mach_disable_irq)(unsigned int);
62
63/*
64 * various flags for request_irq() - the Amiga now uses the standard
65 * mechanism like all other architectures - IRQF_DISABLED and
66 * IRQF_SHARED are your friends.
67 */
68#define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */
69#define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */
70#define IRQ_FLG_FAST (0x0004)
71#define IRQ_FLG_SLOW (0x0008)
72#define IRQ_FLG_STD (0x8000) /* internally used */
73
74#ifdef CONFIG_M68360
75
76#define CPM_INTERRUPT IRQ4
77
78/* see MC68360 User's Manual, p. 7-377 */
79#define CPM_VECTOR_BASE 0x04 /* 3 MSbits of CPM vector */
80
81#endif /* CONFIG_M68360 */
82
83/*
84 * Some drivers want these entry points
85 */
86#define enable_irq(x) do { } while (0)
87#define disable_irq(x) do { } while (0)
88#define disable_irq_nosync(x) disable_irq(x)
89#define irq_canonicalize(irq) (irq) 24#define irq_canonicalize(irq) (irq)
90 25
91#endif /* _M68K_IRQ_H_ */ 26#endif /* _M68KNOMMU_IRQ_H_ */
diff --git a/include/asm-m68knommu/irqnode.h b/include/asm-m68knommu/irqnode.h
deleted file mode 100644
index 6132a9858b52..000000000000
--- a/include/asm-m68knommu/irqnode.h
+++ /dev/null
@@ -1,36 +0,0 @@
1#ifndef _M68K_IRQNODE_H_
2#define _M68K_IRQNODE_H_
3
4#include <linux/interrupt.h>
5
6/*
7 * This structure is used to chain together the ISRs for a particular
8 * interrupt source (if it supports chaining).
9 */
10typedef struct irq_node {
11 irq_handler_t handler;
12 unsigned long flags;
13 void *dev_id;
14 const char *devname;
15 struct irq_node *next;
16} irq_node_t;
17
18/*
19 * This structure has only 4 elements for speed reasons
20 */
21struct irq_entry {
22 irq_handler_t handler;
23 unsigned long flags;
24 void *dev_id;
25 const char *devname;
26};
27
28/* count of spurious interrupts */
29extern volatile unsigned int num_spurious;
30
31/*
32 * This function returns a new irq_node_t
33 */
34extern irq_node_t *new_irq_node(void);
35
36#endif /* _M68K_IRQNODE_H_ */
diff --git a/include/asm-m68knommu/m68360.h b/include/asm-m68knommu/m68360.h
index dd11b070884b..eb7d39ef2855 100644
--- a/include/asm-m68knommu/m68360.h
+++ b/include/asm-m68knommu/m68360.h
@@ -3,3 +3,11 @@
3#include "m68360_quicc.h" 3#include "m68360_quicc.h"
4#include "m68360_enet.h" 4#include "m68360_enet.h"
5 5
6#ifdef CONFIG_M68360
7
8#define CPM_INTERRUPT 4
9
10/* see MC68360 User's Manual, p. 7-377 */
11#define CPM_VECTOR_BASE 0x04 /* 3 MSbits of CPM vector */
12
13#endif /* CONFIG_M68360 */
diff --git a/include/asm-m68knommu/machdep.h b/include/asm-m68knommu/machdep.h
index 6ce28f8e0ead..708d7863ba68 100644
--- a/include/asm-m68knommu/machdep.h
+++ b/include/asm-m68knommu/machdep.h
@@ -1,53 +1,21 @@
1#ifndef _M68KNOMMU_MACHDEP_H 1#ifndef _M68KNOMMU_MACHDEP_H
2#define _M68KNOMMU_MACHDEP_H 2#define _M68KNOMMU_MACHDEP_H
3 3
4#include <linux/seq_file.h>
5#include <linux/interrupt.h> 4#include <linux/interrupt.h>
6 5
7struct pt_regs; 6extern void (*mach_sched_init) (irq_handler_t handler);
8struct kbd_repeat;
9struct mktime;
10struct hwclk_time;
11struct gendisk;
12struct buffer_head;
13
14extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *));
15/* machine dependent keyboard functions */
16extern int (*mach_keyb_init) (void);
17extern int (*mach_kbdrate) (struct kbd_repeat *);
18extern void (*mach_kbd_leds) (unsigned int);
19/* machine dependent irq functions */
20extern void (*mach_init_IRQ) (void);
21extern irq_handler_t mach_default_handler;
22extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
23 unsigned long flags, const char *devname, void *dev_id);
24extern void (*mach_free_irq) (unsigned int irq, void *dev_id);
25extern void (*mach_get_model) (char *model);
26extern int (*mach_get_hardware_list) (char *buffer);
27extern int (*mach_get_irq_list) (struct seq_file *p, void *v);
28extern void (*mach_process_int) (int irq, struct pt_regs *fp);
29/* machine dependent timer functions */ 7/* machine dependent timer functions */
30extern unsigned long (*mach_gettimeoffset)(void); 8extern unsigned long (*mach_gettimeoffset)(void);
31extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour, 9extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour,
32 int *min, int *sec); 10 int *min, int *sec);
33extern int (*mach_hwclk)(int, struct hwclk_time*);
34extern int (*mach_set_clock_mmss)(unsigned long); 11extern int (*mach_set_clock_mmss)(unsigned long);
12
13/* machine dependent power off functions */
35extern void (*mach_reset)( void ); 14extern void (*mach_reset)( void );
36extern void (*mach_halt)( void ); 15extern void (*mach_halt)( void );
37extern void (*mach_power_off)( void ); 16extern void (*mach_power_off)( void );
38extern unsigned long (*mach_hd_init) (unsigned long, unsigned long);
39extern void (*mach_hd_setup)(char *, int *);
40extern long mach_max_dma_address;
41extern void (*mach_floppy_eject)(void);
42extern void (*mach_heartbeat) (int);
43extern void (*mach_l2_flush) (int);
44extern int mach_sysrq_key;
45extern int mach_sysrq_shift_state;
46extern int mach_sysrq_shift_mask;
47extern char *mach_sysrq_xlate;
48 17
49extern void config_BSP(char *command, int len); 18extern void config_BSP(char *command, int len);
50extern void (*mach_tick)(void); 19extern void (*mach_tick)(void);
51extern void (*mach_trap_init)(void);
52 20
53#endif /* _M68KNOMMU_MACHDEP_H */ 21#endif /* _M68KNOMMU_MACHDEP_H */
diff --git a/include/asm-m68knommu/mcfdma.h b/include/asm-m68knommu/mcfdma.h
index ea729e81a6be..705c52c79cd8 100644
--- a/include/asm-m68knommu/mcfdma.h
+++ b/include/asm-m68knommu/mcfdma.h
@@ -133,7 +133,7 @@
133#define MCFDMA_DIR_ASCEN 0x0800 /* Address Sequence Complete (Completion) interrupt enable */ 133#define MCFDMA_DIR_ASCEN 0x0800 /* Address Sequence Complete (Completion) interrupt enable */
134#define MCFDMA_DIR_TEEN 0x0200 /* Transfer Error interrupt enable */ 134#define MCFDMA_DIR_TEEN 0x0200 /* Transfer Error interrupt enable */
135#define MCFDMA_DIR_TCEN 0x0100 /* Transfer Complete (a bus transfer, that is) interrupt enable */ 135#define MCFDMA_DIR_TCEN 0x0100 /* Transfer Complete (a bus transfer, that is) interrupt enable */
136#define MCFDMA_DIR_INV 0x1000 /* Invalid Combination */ 136#define MCFDMA_DIR_INV 0x0010 /* Invalid Combination */
137#define MCFDMA_DIR_ASC 0x0008 /* Address Sequence Complete (DMA Completion) */ 137#define MCFDMA_DIR_ASC 0x0008 /* Address Sequence Complete (DMA Completion) */
138#define MCFDMA_DIR_TE 0x0002 /* Transfer Error */ 138#define MCFDMA_DIR_TE 0x0002 /* Transfer Error */
139#define MCFDMA_DIR_TC 0x0001 /* Transfer Complete */ 139#define MCFDMA_DIR_TC 0x0001 /* Transfer Complete */
diff --git a/include/asm-m68knommu/pgtable.h b/include/asm-m68knommu/pgtable.h
index 9dfbbc24aa71..46251016e821 100644
--- a/include/asm-m68knommu/pgtable.h
+++ b/include/asm-m68knommu/pgtable.h
@@ -49,7 +49,6 @@ static inline int pte_file(pte_t pte) { return 0; }
49 * These would be in other places but having them here reduces the diffs. 49 * These would be in other places but having them here reduces the diffs.
50 */ 50 */
51extern unsigned int kobjsize(const void *objp); 51extern unsigned int kobjsize(const void *objp);
52extern int is_in_rom(unsigned long);
53 52
54/* 53/*
55 * No page table caches to initialise. 54 * No page table caches to initialise.
@@ -66,4 +65,6 @@ extern int is_in_rom(unsigned long);
66#define VMALLOC_START 0 65#define VMALLOC_START 0
67#define VMALLOC_END 0xffffffff 66#define VMALLOC_END 0xffffffff
68 67
68#include <asm-generic/pgtable.h>
69
69#endif /* _M68KNOMMU_PGTABLE_H */ 70#endif /* _M68KNOMMU_PGTABLE_H */
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h
index 5e5ed18bb78f..5da43a5d12a3 100644
--- a/include/asm-m68knommu/system.h
+++ b/include/asm-m68knommu/system.h
@@ -296,7 +296,7 @@ cmpxchg(volatile int *p, int old, int new)
296({ \ 296({ \
297 unsigned char volatile *reset; \ 297 unsigned char volatile *reset; \
298 asm("move.w #0x2700, %sr"); \ 298 asm("move.w #0x2700, %sr"); \
299 reset = ((volatile unsigned short *)(MCF_IPSBAR + 0x110000)); \ 299 reset = ((volatile unsigned char *)(MCF_IPSBAR + 0x110000)); \
300 while(1) \ 300 while(1) \
301 *reset |= (0x01 << 7);\ 301 *reset |= (0x01 << 7);\
302}) 302})
@@ -318,7 +318,7 @@ cmpxchg(volatile int *p, int old, int new)
318({ \ 318({ \
319 unsigned char volatile *reset; \ 319 unsigned char volatile *reset; \
320 asm("move.w #0x2700, %sr"); \ 320 asm("move.w #0x2700, %sr"); \
321 reset = ((volatile unsigned short *)(MCF_IPSBAR + 0xA0000)); \ 321 reset = ((volatile unsigned char *)(MCF_IPSBAR + 0xA0000)); \
322 while(1) \ 322 while(1) \
323 *reset |= 0x80; \ 323 *reset |= 0x80; \
324}) 324})
diff --git a/include/asm-m68knommu/thread_info.h b/include/asm-m68knommu/thread_info.h
index b8f009edf2b2..95996d978bed 100644
--- a/include/asm-m68knommu/thread_info.h
+++ b/include/asm-m68knommu/thread_info.h
@@ -83,16 +83,14 @@ static inline struct thread_info *current_thread_info(void)
83 * thread information flag bit numbers 83 * thread information flag bit numbers
84 */ 84 */
85#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 85#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
86#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 86#define TIF_SIGPENDING 1 /* signal pending */
87#define TIF_SIGPENDING 2 /* signal pending */ 87#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
88#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 88#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
89#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
90 TIF_NEED_RESCHED */ 89 TIF_NEED_RESCHED */
91#define TIF_MEMDIE 5 90#define TIF_MEMDIE 4
92 91
93/* as above, but as bit values */ 92/* as above, but as bit values */
94#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 93#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
95#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
96#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 94#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
97#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 95#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
98#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 96#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
diff --git a/include/asm-m68knommu/timex.h b/include/asm-m68knommu/timex.h
index 85069998db52..109050f3fe91 100644
--- a/include/asm-m68knommu/timex.h
+++ b/include/asm-m68knommu/timex.h
@@ -1 +1,23 @@
1#include <asm-m68k/timex.h> 1/*
2 * linux/include/asm-m68knommu/timex.h
3 *
4 * m68knommu architecture timex specifications
5 */
6#ifndef _ASM_M68KNOMMU_TIMEX_H
7#define _ASM_M68KNOMMU_TIMEX_H
8
9#ifdef CONFIG_COLDFIRE
10#include <asm/coldfire.h>
11#define CLOCK_TICK_RATE MCF_CLK
12#else
13#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
14#endif
15
16typedef unsigned long cycles_t;
17
18static inline cycles_t get_cycles(void)
19{
20 return 0;
21}
22
23#endif
diff --git a/include/asm-m68knommu/traps.h b/include/asm-m68knommu/traps.h
index f2a81317cc10..d0671e5f8e29 100644
--- a/include/asm-m68knommu/traps.h
+++ b/include/asm-m68knommu/traps.h
@@ -16,6 +16,10 @@
16typedef void (*e_vector)(void); 16typedef void (*e_vector)(void);
17 17
18extern e_vector vectors[]; 18extern e_vector vectors[];
19extern void init_vectors(void);
20extern void enable_vector(unsigned int irq);
21extern void disable_vector(unsigned int irq);
22extern void ack_vector(unsigned int irq);
19 23
20#endif 24#endif
21 25
diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h
index 62b29b10bc6d..9ed9169a8849 100644
--- a/include/asm-m68knommu/uaccess.h
+++ b/include/asm-m68knommu/uaccess.h
@@ -15,12 +15,15 @@
15 15
16#define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size)) 16#define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size))
17 17
18/*
19 * It is not enough to just have access_ok check for a real RAM address.
20 * This would disallow the case of code/ro-data running XIP in flash/rom.
21 * Ideally we would check the possible flash ranges too, but that is
22 * currently not so easy.
23 */
18static inline int _access_ok(unsigned long addr, unsigned long size) 24static inline int _access_ok(unsigned long addr, unsigned long size)
19{ 25{
20 extern unsigned long memory_start, memory_end; 26 return 1;
21
22 return (((addr >= memory_start) && (addr+size < memory_end)) ||
23 (is_in_rom(addr) && is_in_rom(addr+size)));
24} 27}
25 28
26/* 29/*
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h
index 82e03195f325..eb1b566793fe 100644
--- a/include/asm-m68knommu/unistd.h
+++ b/include/asm-m68knommu/unistd.h
@@ -314,10 +314,20 @@
314#define __NR_tee 308 314#define __NR_tee 308
315#define __NR_vmsplice 309 315#define __NR_vmsplice 309
316#define __NR_move_pages 310 316#define __NR_move_pages 310
317#define __NR_sched_setaffinity 311
318#define __NR_sched_getaffinity 312
319#define __NR_kexec_load 313
320#define __NR_getcpu 314
321#define __NR_epoll_pwait 315
322#define __NR_utimensat 316
323#define __NR_signalfd 317
324#define __NR_timerfd 318
325#define __NR_eventfd 319
326#define __NR_fallocate 320
317 327
318#ifdef __KERNEL__ 328#ifdef __KERNEL__
319 329
320#define NR_syscalls 311 330#define NR_syscalls 321
321 331
322#define __ARCH_WANT_IPC_PARSE_VERSION 332#define __ARCH_WANT_IPC_PARSE_VERSION
323#define __ARCH_WANT_OLD_READDIR 333#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-mips/a.out.h b/include/asm-mips/a.out.h
index ef33c3f13484..bf55a5b34bef 100644
--- a/include/asm-mips/a.out.h
+++ b/include/asm-mips/a.out.h
@@ -38,8 +38,10 @@ struct exec
38#define STACK_TOP TASK_SIZE 38#define STACK_TOP TASK_SIZE
39#endif 39#endif
40#ifdef CONFIG_64BIT 40#ifdef CONFIG_64BIT
41#define STACK_TOP (current->thread.mflags & MF_32BIT_ADDR ? TASK_SIZE32 : TASK_SIZE) 41#define STACK_TOP \
42 (test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE)
42#endif 43#endif
44#define STACK_TOP_MAX TASK_SIZE
43 45
44#endif 46#endif
45 47
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index 1b60624dab7e..7d8003769a44 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -138,7 +138,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
138{ 138{
139 unsigned long result; 139 unsigned long result;
140 140
141 smp_mb(); 141 smp_llsc_mb();
142 142
143 if (cpu_has_llsc && R10000_LLSC_WAR) { 143 if (cpu_has_llsc && R10000_LLSC_WAR) {
144 unsigned long temp; 144 unsigned long temp;
@@ -181,7 +181,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
181 raw_local_irq_restore(flags); 181 raw_local_irq_restore(flags);
182 } 182 }
183 183
184 smp_mb(); 184 smp_llsc_mb();
185 185
186 return result; 186 return result;
187} 187}
@@ -190,7 +190,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
190{ 190{
191 unsigned long result; 191 unsigned long result;
192 192
193 smp_mb(); 193 smp_llsc_mb();
194 194
195 if (cpu_has_llsc && R10000_LLSC_WAR) { 195 if (cpu_has_llsc && R10000_LLSC_WAR) {
196 unsigned long temp; 196 unsigned long temp;
@@ -233,7 +233,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
233 raw_local_irq_restore(flags); 233 raw_local_irq_restore(flags);
234 } 234 }
235 235
236 smp_mb(); 236 smp_llsc_mb();
237 237
238 return result; 238 return result;
239} 239}
@@ -250,7 +250,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
250{ 250{
251 unsigned long result; 251 unsigned long result;
252 252
253 smp_mb(); 253 smp_llsc_mb();
254 254
255 if (cpu_has_llsc && R10000_LLSC_WAR) { 255 if (cpu_has_llsc && R10000_LLSC_WAR) {
256 unsigned long temp; 256 unsigned long temp;
@@ -302,7 +302,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
302 raw_local_irq_restore(flags); 302 raw_local_irq_restore(flags);
303 } 303 }
304 304
305 smp_mb(); 305 smp_llsc_mb();
306 306
307 return result; 307 return result;
308} 308}
@@ -519,7 +519,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
519{ 519{
520 unsigned long result; 520 unsigned long result;
521 521
522 smp_mb(); 522 smp_llsc_mb();
523 523
524 if (cpu_has_llsc && R10000_LLSC_WAR) { 524 if (cpu_has_llsc && R10000_LLSC_WAR) {
525 unsigned long temp; 525 unsigned long temp;
@@ -562,7 +562,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
562 raw_local_irq_restore(flags); 562 raw_local_irq_restore(flags);
563 } 563 }
564 564
565 smp_mb(); 565 smp_llsc_mb();
566 566
567 return result; 567 return result;
568} 568}
@@ -571,7 +571,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
571{ 571{
572 unsigned long result; 572 unsigned long result;
573 573
574 smp_mb(); 574 smp_llsc_mb();
575 575
576 if (cpu_has_llsc && R10000_LLSC_WAR) { 576 if (cpu_has_llsc && R10000_LLSC_WAR) {
577 unsigned long temp; 577 unsigned long temp;
@@ -614,7 +614,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
614 raw_local_irq_restore(flags); 614 raw_local_irq_restore(flags);
615 } 615 }
616 616
617 smp_mb(); 617 smp_llsc_mb();
618 618
619 return result; 619 return result;
620} 620}
@@ -631,7 +631,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
631{ 631{
632 unsigned long result; 632 unsigned long result;
633 633
634 smp_mb(); 634 smp_llsc_mb();
635 635
636 if (cpu_has_llsc && R10000_LLSC_WAR) { 636 if (cpu_has_llsc && R10000_LLSC_WAR) {
637 unsigned long temp; 637 unsigned long temp;
@@ -683,7 +683,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
683 raw_local_irq_restore(flags); 683 raw_local_irq_restore(flags);
684 } 684 }
685 685
686 smp_mb(); 686 smp_llsc_mb();
687 687
688 return result; 688 return result;
689} 689}
@@ -791,10 +791,11 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
791 * atomic*_return operations are serializing but not the non-*_return 791 * atomic*_return operations are serializing but not the non-*_return
792 * versions. 792 * versions.
793 */ 793 */
794#define smp_mb__before_atomic_dec() smp_mb() 794#define smp_mb__before_atomic_dec() smp_llsc_mb()
795#define smp_mb__after_atomic_dec() smp_mb() 795#define smp_mb__after_atomic_dec() smp_llsc_mb()
796#define smp_mb__before_atomic_inc() smp_mb() 796#define smp_mb__before_atomic_inc() smp_llsc_mb()
797#define smp_mb__after_atomic_inc() smp_mb() 797#define smp_mb__after_atomic_inc() smp_llsc_mb()
798 798
799#include <asm-generic/atomic.h> 799#include <asm-generic/atomic.h>
800
800#endif /* _ASM_ATOMIC_H */ 801#endif /* _ASM_ATOMIC_H */
diff --git a/include/asm-mips/barrier.h b/include/asm-mips/barrier.h
index ed82631b0017..9d8cfbb5e796 100644
--- a/include/asm-mips/barrier.h
+++ b/include/asm-mips/barrier.h
@@ -121,6 +121,11 @@
121#else 121#else
122#define __WEAK_ORDERING_MB " \n" 122#define __WEAK_ORDERING_MB " \n"
123#endif 123#endif
124#if defined(CONFIG_WEAK_REORDERING_BEYOND_LLSC) && defined(CONFIG_SMP)
125#define __WEAK_LLSC_MB " sync \n"
126#else
127#define __WEAK_LLSC_MB " \n"
128#endif
124 129
125#define smp_mb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory") 130#define smp_mb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory")
126#define smp_rmb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory") 131#define smp_rmb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory")
@@ -129,4 +134,8 @@
129#define set_mb(var, value) \ 134#define set_mb(var, value) \
130 do { var = value; smp_mb(); } while (0) 135 do { var = value; smp_mb(); } while (0)
131 136
137#define smp_llsc_mb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
138#define smp_llsc_rmb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
139#define smp_llsc_wmb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
140
132#endif /* __ASM_BARRIER_H */ 141#endif /* __ASM_BARRIER_H */
diff --git a/include/asm-mips/bcache.h b/include/asm-mips/bcache.h
index 3646a3f2ed38..0ba9d6ef76a7 100644
--- a/include/asm-mips/bcache.h
+++ b/include/asm-mips/bcache.h
@@ -21,7 +21,6 @@ struct bcache_ops {
21}; 21};
22 22
23extern void indy_sc_init(void); 23extern void indy_sc_init(void);
24extern void sni_pcimt_sc_init(void);
25 24
26#ifdef CONFIG_BOARD_SCACHE 25#ifdef CONFIG_BOARD_SCACHE
27 26
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index d9e81af53f78..148bc79557f1 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -38,8 +38,8 @@
38/* 38/*
39 * clear_bit() doesn't provide any barrier for the compiler. 39 * clear_bit() doesn't provide any barrier for the compiler.
40 */ 40 */
41#define smp_mb__before_clear_bit() smp_mb() 41#define smp_mb__before_clear_bit() smp_llsc_mb()
42#define smp_mb__after_clear_bit() smp_mb() 42#define smp_mb__after_clear_bit() smp_llsc_mb()
43 43
44/* 44/*
45 * set_bit - Atomically set a bit in memory 45 * set_bit - Atomically set a bit in memory
@@ -289,7 +289,7 @@ static inline int test_and_set_bit(unsigned long nr,
289 raw_local_irq_restore(flags); 289 raw_local_irq_restore(flags);
290 } 290 }
291 291
292 smp_mb(); 292 smp_llsc_mb();
293 293
294 return res != 0; 294 return res != 0;
295} 295}
@@ -377,7 +377,7 @@ static inline int test_and_clear_bit(unsigned long nr,
377 raw_local_irq_restore(flags); 377 raw_local_irq_restore(flags);
378 } 378 }
379 379
380 smp_mb(); 380 smp_llsc_mb();
381 381
382 return res != 0; 382 return res != 0;
383} 383}
@@ -445,7 +445,7 @@ static inline int test_and_change_bit(unsigned long nr,
445 raw_local_irq_restore(flags); 445 raw_local_irq_restore(flags);
446 } 446 }
447 447
448 smp_mb(); 448 smp_llsc_mb();
449 449
450 return res != 0; 450 return res != 0;
451} 451}
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h
index 087126a5faf9..c0f052b37b9e 100644
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -86,16 +86,6 @@
86#define MACH_COBALT_27 0 /* Proto "27" hardware */ 86#define MACH_COBALT_27 0 /* Proto "27" hardware */
87 87
88/* 88/*
89 * Valid machtype for group NEC DDB
90 */
91#define MACH_GROUP_NEC_DDB 8 /* NEC DDB */
92#define MACH_NEC_DDB5074 0 /* NEC DDB Vrc-5074 */
93#define MACH_NEC_DDB5476 1 /* NEC DDB Vrc-5476 */
94#define MACH_NEC_DDB5477 2 /* NEC DDB Vrc-5477 */
95#define MACH_NEC_ROCKHOPPER 3 /* Rockhopper base board */
96#define MACH_NEC_ROCKHOPPERII 4 /* Rockhopper II base board */
97
98/*
99 * Valid machtype for group BAGET 89 * Valid machtype for group BAGET
100 */ 90 */
101#define MACH_GROUP_BAGET 9 /* Baget */ 91#define MACH_GROUP_BAGET 9 /* Baget */
@@ -145,9 +135,6 @@
145#define MACH_TOSHIBA_RBTX4937 5 135#define MACH_TOSHIBA_RBTX4937 5
146#define MACH_TOSHIBA_RBTX4938 6 136#define MACH_TOSHIBA_RBTX4938 6
147 137
148#define GROUP_TOSHIBA_NAMES { "Pallas", "TopasCE", "JMR", "JMR TX3927", \
149 "RBTX4927", "RBTX4937" }
150
151/* 138/*
152 * Valid machtype for group Alchemy 139 * Valid machtype for group Alchemy
153 */ 140 */
diff --git a/include/asm-mips/ddb5xxx/ddb5477.h b/include/asm-mips/ddb5xxx/ddb5477.h
deleted file mode 100644
index 6cf177caf6d5..000000000000
--- a/include/asm-mips/ddb5xxx/ddb5477.h
+++ /dev/null
@@ -1,342 +0,0 @@
1/***********************************************************************
2 *
3 * Copyright 2001 MontaVista Software Inc.
4 * Author: jsun@mvista.com or jsun@junsun.net
5 *
6 * include/asm-mips/ddb5xxx/ddb5477.h
7 * DDB 5477 specific definitions and macros.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 ***********************************************************************
15 */
16
17#ifndef __ASM_DDB5XXX_DDB5477_H
18#define __ASM_DDB5XXX_DDB5477_H
19
20#include <irq.h>
21
22/*
23 * This contains macros that are specific to DDB5477 or renamed from
24 * DDB5476.
25 */
26
27/*
28 * renamed PADRs
29 */
30#define DDB_LCS0 DDB_DCS2
31#define DDB_LCS1 DDB_DCS3
32#define DDB_LCS2 DDB_DCS4
33#define DDB_VRC5477 DDB_INTCS
34
35/*
36 * New CPU interface registers
37 */
38#define DDB_INTCTRL0 0x0400 /* Interrupt Control 0 */
39#define DDB_INTCTRL1 0x0404 /* Interrupt Control 1 */
40#define DDB_INTCTRL2 0x0408 /* Interrupt Control 2 */
41#define DDB_INTCTRL3 0x040c /* Interrupt Control 3 */
42
43#define DDB_INT0STAT 0x0420 /* INT0 Status [R] */
44#define DDB_INT1STAT 0x0428 /* INT1 Status [R] */
45#define DDB_INT2STAT 0x0430 /* INT2 Status [R] */
46#define DDB_INT3STAT 0x0438 /* INT3 Status [R] */
47#define DDB_INT4STAT 0x0440 /* INT4 Status [R] */
48#define DDB_NMISTAT 0x0450 /* NMI Status [R] */
49
50#define DDB_INTCLR32 0x0468 /* Interrupt Clear */
51
52#define DDB_INTPPES0 0x0470 /* PCI0 Interrupt Control */
53#define DDB_INTPPES1 0x0478 /* PCI1 Interrupt Control */
54
55#undef DDB_CPUSTAT /* duplicate in Vrc-5477 */
56#define DDB_CPUSTAT 0x0480 /* CPU Status [R] */
57#define DDB_BUSCTRL 0x0488 /* Internal Bus Control */
58
59
60/*
61 * Timer registers
62 */
63#define DDB_REFCTRL_L DDB_T0CTRL
64#define DDB_REFCTRL_H (DDB_T0CTRL+4)
65#define DDB_REFCNTR DDB_T0CNTR
66#define DDB_SPT0CTRL_L DDB_T1CTRL
67#define DDB_SPT0CTRL_H (DDB_T1CTRL+4)
68#define DDB_SPT1CTRL_L DDB_T2CTRL
69#define DDB_SPT1CTRL_H (DDB_T2CTRL+4)
70#define DDB_SPT1CNTR DDB_T1CTRL
71#define DDB_WDTCTRL_L DDB_T3CTRL
72#define DDB_WDTCTRL_H (DDB_T3CTRL+4)
73#define DDB_WDTCNTR DDB_T3CNTR
74
75/*
76 * DMA registers are moved. We don't care about it for now. TODO.
77 */
78
79/*
80 * BARs for ext PCI (PCI0)
81 */
82#undef DDB_BARC
83#undef DDB_BARB
84
85#define DDB_BARC0 0x0210 /* PCI0 Control */
86#define DDB_BARM010 0x0218 /* PCI0 SDRAM bank01 */
87#define DDB_BARM230 0x0220 /* PCI0 SDRAM bank23 */
88#define DDB_BAR00 0x0240 /* PCI0 LDCS0 */
89#define DDB_BAR10 0x0248 /* PCI0 LDCS1 */
90#define DDB_BAR20 0x0250 /* PCI0 LDCS2 */
91#define DDB_BAR30 0x0258 /* PCI0 LDCS3 */
92#define DDB_BAR40 0x0260 /* PCI0 LDCS4 */
93#define DDB_BAR50 0x0268 /* PCI0 LDCS5 */
94#define DDB_BARB0 0x0280 /* PCI0 BOOT */
95#define DDB_BARP00 0x0290 /* PCI0 for IOPCI Window0 */
96#define DDB_BARP10 0x0298 /* PCI0 for IOPCI Window1 */
97
98/*
99 * BARs for IOPIC (PCI1)
100 */
101#define DDB_BARC1 0x0610 /* PCI1 Control */
102#define DDB_BARM011 0x0618 /* PCI1 SDRAM bank01 */
103#define DDB_BARM231 0x0620 /* PCI1 SDRAM bank23 */
104#define DDB_BAR01 0x0640 /* PCI1 LDCS0 */
105#define DDB_BAR11 0x0648 /* PCI1 LDCS1 */
106#define DDB_BAR21 0x0650 /* PCI1 LDCS2 */
107#define DDB_BAR31 0x0658 /* PCI1 LDCS3 */
108#define DDB_BAR41 0x0660 /* PCI1 LDCS4 */
109#define DDB_BAR51 0x0668 /* PCI1 LDCS5 */
110#define DDB_BARB1 0x0680 /* PCI1 BOOT */
111#define DDB_BARP01 0x0690 /* PCI1 for ext PCI Window0 */
112#define DDB_BARP11 0x0698 /* PCI1 for ext PCI Window1 */
113
114/*
115 * Other registers for ext PCI (PCI0)
116 */
117#define DDB_PCIINIT00 0x02f0 /* PCI0 Initiator 0 */
118#define DDB_PCIINIT10 0x02f8 /* PCI0 Initiator 1 */
119
120#define DDB_PCISWP0 0x02b0 /* PCI0 Swap */
121#define DDB_PCIERR0 0x02b8 /* PCI0 Error */
122
123#define DDB_PCICTL0_L 0x02e0 /* PCI0 Control-L */
124#define DDB_PCICTL0_H 0x02e4 /* PCI0 Control-H */
125#define DDB_PCIARB0_L 0x02e8 /* PCI0 Arbitration-L */
126#define DDB_PCIARB0_H 0x02ec /* PCI0 Arbitration-H */
127
128/*
129 * Other registers for IOPCI (PCI1)
130 */
131#define DDB_IOPCIW0 0x00d0 /* PCI Address Window 0 [R/W] */
132#define DDB_IOPCIW1 0x00d8 /* PCI Address Window 1 [R/W] */
133
134#define DDB_PCIINIT01 0x06f0 /* PCI1 Initiator 0 */
135#define DDB_PCIINIT11 0x06f8 /* PCI1 Initiator 1 */
136
137#define DDB_PCISWP1 0x06b0 /* PCI1 Swap */
138#define DDB_PCIERR1 0x06b8 /* PCI1 Error */
139
140#define DDB_PCICTL1_L 0x06e0 /* PCI1 Control-L */
141#define DDB_PCICTL1_H 0x06e4 /* PCI1 Control-H */
142#define DDB_PCIARB1_L 0x06e8 /* PCI1 Arbitration-L */
143#define DDB_PCIARB1_H 0x06ec /* PCI1 Arbitration-H */
144
145/*
146 * Local Bus
147 */
148#define DDB_LCST0 0x0110 /* LB Chip Select Timing 0 */
149#define DDB_LCST1 0x0118 /* LB Chip Select Timing 1 */
150#undef DDB_LCST2
151#define DDB_LCST2 0x0120 /* LB Chip Select Timing 2 */
152#undef DDB_LCST3
153#undef DDB_LCST4
154#undef DDB_LCST5
155#undef DDB_LCST6
156#undef DDB_LCST7
157#undef DDB_LCST8
158#define DDB_ERRADR 0x0150 /* Error Address Register */
159#define DDB_ERRCS 0x0160
160#define DDB_BTM 0x0170 /* Boot Time Mode value */
161
162/*
163 * MISC registers
164 */
165#define DDB_GIUFUNSEL 0x4040 /* select dual-func pins */
166#define DDB_PIBMISC 0x0750 /* USB buffer enable / power saving */
167
168/*
169 * Memory map (physical address)
170 *
171 * Note most of the following address must be properly aligned by the
172 * corresponding size. For example, if PCI_IO_SIZE is 16MB, then
173 * PCI_IO_BASE must be aligned along 16MB boundary.
174 */
175
176/* the actual ram size is detected at run-time */
177#define DDB_SDRAM_BASE 0x00000000
178#define DDB_MAX_SDRAM_SIZE 0x08000000 /* less than 128MB */
179
180#define DDB_PCI0_MEM_BASE 0x08000000
181#define DDB_PCI0_MEM_SIZE 0x08000000 /* 128 MB */
182
183#define DDB_PCI1_MEM_BASE 0x10000000
184#define DDB_PCI1_MEM_SIZE 0x08000000 /* 128 MB */
185
186#define DDB_PCI0_CONFIG_BASE 0x18000000
187#define DDB_PCI0_CONFIG_SIZE 0x01000000 /* 16 MB */
188
189#define DDB_PCI1_CONFIG_BASE 0x19000000
190#define DDB_PCI1_CONFIG_SIZE 0x01000000 /* 16 MB */
191
192#define DDB_PCI_IO_BASE 0x1a000000 /* we concatenate two IOs */
193#define DDB_PCI0_IO_BASE 0x1a000000
194#define DDB_PCI0_IO_SIZE 0x01000000 /* 16 MB */
195#define DDB_PCI1_IO_BASE 0x1b000000
196#define DDB_PCI1_IO_SIZE 0x01000000 /* 16 MB */
197
198#define DDB_LCS0_BASE 0x1c000000 /* flash memory */
199#define DDB_LCS0_SIZE 0x01000000 /* 16 MB */
200
201#define DDB_LCS1_BASE 0x1d000000 /* misc */
202#define DDB_LCS1_SIZE 0x01000000 /* 16 MB */
203
204#define DDB_LCS2_BASE 0x1e000000 /* Mezzanine */
205#define DDB_LCS2_SIZE 0x01000000 /* 16 MB */
206
207#define DDB_VRC5477_BASE 0x1fa00000 /* VRC5477 control regs */
208#define DDB_VRC5477_SIZE 0x00200000 /* 2MB */
209
210#define DDB_BOOTCS_BASE 0x1fc00000 /* Boot ROM / EPROM /Flash */
211#define DDB_BOOTCS_SIZE 0x00200000 /* 2 MB - doc says 4MB */
212
213#define DDB_LED DDB_LCS1_BASE + 0x10000
214
215
216/*
217 * DDB5477 specific functions
218 */
219#ifndef __ASSEMBLY__
220extern void ddb5477_irq_setup(void);
221
222/* route irq to cpu int pin */
223extern void ll_vrc5477_irq_route(int vrc5477_irq, int ip);
224
225/* low-level routine for enabling vrc5477 irq, bypassing high-level */
226extern void ll_vrc5477_irq_enable(int vrc5477_irq);
227extern void ll_vrc5477_irq_disable(int vrc5477_irq);
228#endif /* !__ASSEMBLY__ */
229
230/* PCI intr ack share PCIW0 with PCI IO */
231#define DDB_PCI_IACK_BASE DDB_PCI_IO_BASE
232
233/*
234 * Interrupt mapping
235 *
236 * We have three interrupt controllers:
237 *
238 * . CPU itself - 8 sources
239 * . i8259 - 16 sources
240 * . vrc5477 - 32 sources
241 *
242 * They connected as follows:
243 * all vrc5477 interrupts are routed to cpu IP2 (by software setting)
244 * all i8359 are routed to INTC in vrc5477 (by hardware connection)
245 *
246 * All VRC5477 PCI interrupts are level-triggered (no ack needed).
247 * All PCI irq but INTC are active low.
248 */
249
250/*
251 * irq number block assignment
252 */
253
254#define NUM_CPU_IRQ 8
255#define NUM_VRC5477_IRQ 32
256
257#define CPU_IRQ_BASE MIPS_CPU_IRQ_BASE
258#define VRC5477_IRQ_BASE (CPU_IRQ_BASE + NUM_CPU_IRQ)
259
260/*
261 * vrc5477 irq defs
262 */
263
264#define VRC5477_IRQ_CPCE (0 + VRC5477_IRQ_BASE) /* cpu parity error */
265#define VRC5477_IRQ_CNTD (1 + VRC5477_IRQ_BASE) /* cpu no target */
266#define VRC5477_IRQ_I2C (2 + VRC5477_IRQ_BASE) /* I2C */
267#define VRC5477_IRQ_DMA (3 + VRC5477_IRQ_BASE) /* DMA */
268#define VRC5477_IRQ_UART0 (4 + VRC5477_IRQ_BASE)
269#define VRC5477_IRQ_WDOG (5 + VRC5477_IRQ_BASE) /* watchdog timer */
270#define VRC5477_IRQ_SPT1 (6 + VRC5477_IRQ_BASE) /* special purpose timer 1 */
271#define VRC5477_IRQ_LBRT (7 + VRC5477_IRQ_BASE) /* local bus read timeout */
272#define VRC5477_IRQ_INTA (8 + VRC5477_IRQ_BASE) /* PCI INT #A */
273#define VRC5477_IRQ_INTB (9 + VRC5477_IRQ_BASE) /* PCI INT #B */
274#define VRC5477_IRQ_INTC (10 + VRC5477_IRQ_BASE) /* PCI INT #C */
275#define VRC5477_IRQ_INTD (11 + VRC5477_IRQ_BASE) /* PCI INT #D */
276#define VRC5477_IRQ_INTE (12 + VRC5477_IRQ_BASE) /* PCI INT #E */
277#define VRC5477_IRQ_RESERVED_13 (13 + VRC5477_IRQ_BASE) /* reserved */
278#define VRC5477_IRQ_PCIS (14 + VRC5477_IRQ_BASE) /* PCI SERR # */
279#define VRC5477_IRQ_PCI (15 + VRC5477_IRQ_BASE) /* PCI internal error */
280#define VRC5477_IRQ_IOPCI_INTA (16 + VRC5477_IRQ_BASE) /* USB-H */
281#define VRC5477_IRQ_IOPCI_INTB (17 + VRC5477_IRQ_BASE) /* USB-P */
282#define VRC5477_IRQ_IOPCI_INTC (18 + VRC5477_IRQ_BASE) /* AC97 */
283#define VRC5477_IRQ_IOPCI_INTD (19 + VRC5477_IRQ_BASE) /* Reserved */
284#define VRC5477_IRQ_UART1 (20 + VRC5477_IRQ_BASE)
285#define VRC5477_IRQ_SPT0 (21 + VRC5477_IRQ_BASE) /* special purpose timer 0 */
286#define VRC5477_IRQ_GPT0 (22 + VRC5477_IRQ_BASE) /* general purpose timer 0 */
287#define VRC5477_IRQ_GPT1 (23 + VRC5477_IRQ_BASE) /* general purpose timer 1 */
288#define VRC5477_IRQ_GPT2 (24 + VRC5477_IRQ_BASE) /* general purpose timer 2 */
289#define VRC5477_IRQ_GPT3 (25 + VRC5477_IRQ_BASE) /* general purpose timer 3 */
290#define VRC5477_IRQ_GPIO (26 + VRC5477_IRQ_BASE)
291#define VRC5477_IRQ_SIO0 (27 + VRC5477_IRQ_BASE)
292#define VRC5477_IRQ_SIO1 (28 + VRC5477_IRQ_BASE)
293#define VRC5477_IRQ_RESERVED_29 (29 + VRC5477_IRQ_BASE) /* reserved */
294#define VRC5477_IRQ_IOPCISERR (30 + VRC5477_IRQ_BASE) /* IO PCI SERR # */
295#define VRC5477_IRQ_IOPCI (31 + VRC5477_IRQ_BASE)
296
297/*
298 * i2859 irq assignment
299 */
300#define I8259_IRQ_RESERVED_0 (0 + I8259A_IRQ_BASE)
301#define I8259_IRQ_KEYBOARD (1 + I8259A_IRQ_BASE) /* M1543 default */
302#define I8259_IRQ_CASCADE (2 + I8259A_IRQ_BASE)
303#define I8259_IRQ_UART_B (3 + I8259A_IRQ_BASE) /* M1543 default, may conflict with RTC according to schematic diagram */
304#define I8259_IRQ_UART_A (4 + I8259A_IRQ_BASE) /* M1543 default */
305#define I8259_IRQ_PARALLEL (5 + I8259A_IRQ_BASE) /* M1543 default */
306#define I8259_IRQ_RESERVED_6 (6 + I8259A_IRQ_BASE)
307#define I8259_IRQ_RESERVED_7 (7 + I8259A_IRQ_BASE)
308#define I8259_IRQ_RTC (8 + I8259A_IRQ_BASE) /* who set this? */
309#define I8259_IRQ_USB (9 + I8259A_IRQ_BASE) /* ddb_setup */
310#define I8259_IRQ_PMU (10 + I8259A_IRQ_BASE) /* ddb_setup */
311#define I8259_IRQ_RESERVED_11 (11 + I8259A_IRQ_BASE)
312#define I8259_IRQ_RESERVED_12 (12 + I8259A_IRQ_BASE) /* m1543_irq_setup */
313#define I8259_IRQ_RESERVED_13 (13 + I8259A_IRQ_BASE)
314#define I8259_IRQ_HDC1 (14 + I8259A_IRQ_BASE) /* default and ddb_setup */
315#define I8259_IRQ_HDC2 (15 + I8259A_IRQ_BASE) /* default */
316
317
318/*
319 * misc
320 */
321#define VRC5477_I8259_CASCADE (VRC5477_IRQ_INTC - VRC5477_IRQ_BASE)
322#define CPU_VRC5477_CASCADE 2
323
324/*
325 * debug routines
326 */
327#ifndef __ASSEMBLY__
328#if defined(CONFIG_RUNTIME_DEBUG)
329extern void vrc5477_show_pdar_regs(void);
330extern void vrc5477_show_pci_regs(void);
331extern void vrc5477_show_bar_regs(void);
332extern void vrc5477_show_int_regs(void);
333extern void vrc5477_show_all_regs(void);
334#endif
335
336/*
337 * RAM size
338 */
339extern int board_ram_size;
340#endif /* !__ASSEMBLY__ */
341
342#endif /* __ASM_DDB5XXX_DDB5477_H */
diff --git a/include/asm-mips/ddb5xxx/ddb5xxx.h b/include/asm-mips/ddb5xxx/ddb5xxx.h
deleted file mode 100644
index e97fcc8d548b..000000000000
--- a/include/asm-mips/ddb5xxx/ddb5xxx.h
+++ /dev/null
@@ -1,263 +0,0 @@
1/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: jsun@mvista.com or jsun@junsun.net
4 *
5 * Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
6 * Sony Software Development Center Europe (SDCE), Brussels
7 *
8 * include/asm-mips/ddb5xxx/ddb5xxx.h
9 * Common header for all NEC DDB 5xxx boards, including 5074, 5476, 5477.
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 */
17
18#ifndef __ASM_DDB5XXX_DDB5XXX_H
19#define __ASM_DDB5XXX_DDB5XXX_H
20
21#include <linux/types.h>
22
23/*
24 * This file is based on the following documentation:
25 *
26 * NEC Vrc 5074 System Controller Data Sheet, June 1998
27 *
28 * [jsun] It is modified so that this file only contains the macros
29 * that are true for all DDB 5xxx boards. The modification is based on
30 *
31 * uPD31577(VRC5477) VR5432-SDRAM/PCI Bridge (Luke)
32 * Preliminary Specification Decoment, Rev 1.1, 27 Dec, 2000
33 *
34 */
35
36
37#define DDB_BASE 0xbfa00000
38#define DDB_SIZE 0x00200000 /* 2 MB */
39
40
41/*
42 * Physical Device Address Registers (PDARs)
43 */
44
45#define DDB_SDRAM0 0x0000 /* SDRAM Bank 0 [R/W] */
46#define DDB_SDRAM1 0x0008 /* SDRAM Bank 1 [R/W] */
47#define DDB_DCS2 0x0010 /* Device Chip-Select 2 [R/W] */
48#define DDB_DCS3 0x0018 /* Device Chip-Select 3 [R/W] */
49#define DDB_DCS4 0x0020 /* Device Chip-Select 4 [R/W] */
50#define DDB_DCS5 0x0028 /* Device Chip-Select 5 [R/W] */
51#define DDB_DCS6 0x0030 /* Device Chip-Select 6 [R/W] */
52#define DDB_DCS7 0x0038 /* Device Chip-Select 7 [R/W] */
53#define DDB_DCS8 0x0040 /* Device Chip-Select 8 [R/W] */
54#define DDB_PCIW0 0x0060 /* PCI Address Window 0 [R/W] */
55#define DDB_PCIW1 0x0068 /* PCI Address Window 1 [R/W] */
56#define DDB_INTCS 0x0070 /* Controller Internal Registers and Devices */
57 /* [R/W] */
58#define DDB_BOOTCS 0x0078 /* Boot ROM Chip-Select [R/W] */
59/* Vrc5477 has two more, IOPCIW0, IOPCIW1 */
60
61/*
62 * CPU Interface Registers
63 */
64#define DDB_CPUSTAT 0x0080 /* CPU Status [R/W] */
65#define DDB_INTCTRL 0x0088 /* Interrupt Control [R/W] */
66#define DDB_INTSTAT0 0x0090 /* Interrupt Status 0 [R] */
67#define DDB_INTSTAT1 0x0098 /* Interrupt Status 1 and CPU Interrupt */
68 /* Enable [R/W] */
69#define DDB_INTCLR 0x00A0 /* Interrupt Clear [R/W] */
70#define DDB_INTPPES 0x00A8 /* PCI Interrupt Control [R/W] */
71
72
73/*
74 * Memory-Interface Registers
75 */
76#define DDB_MEMCTRL 0x00C0 /* Memory Control */
77#define DDB_ACSTIME 0x00C8 /* Memory Access Timing [R/W] */
78#define DDB_CHKERR 0x00D0 /* Memory Check Error Status [R] */
79
80
81/*
82 * PCI-Bus Registers
83 */
84#define DDB_PCICTRL 0x00E0 /* PCI Control [R/W] */
85#define DDB_PCIARB 0x00E8 /* PCI Arbiter [R/W] */
86#define DDB_PCIINIT0 0x00F0 /* PCI Master (Initiator) 0 [R/W] */
87#define DDB_PCIINIT1 0x00F8 /* PCI Master (Initiator) 1 [R/W] */
88#define DDB_PCIERR 0x00B8 /* PCI Error [R/W] */
89
90
91/*
92 * Local-Bus Registers
93 */
94#define DDB_LCNFG 0x0100 /* Local Bus Configuration [R/W] */
95#define DDB_LCST2 0x0110 /* Local Bus Chip-Select Timing 2 [R/W] */
96#define DDB_LCST3 0x0118 /* Local Bus Chip-Select Timing 3 [R/W] */
97#define DDB_LCST4 0x0120 /* Local Bus Chip-Select Timing 4 [R/W] */
98#define DDB_LCST5 0x0128 /* Local Bus Chip-Select Timing 5 [R/W] */
99#define DDB_LCST6 0x0130 /* Local Bus Chip-Select Timing 6 [R/W] */
100#define DDB_LCST7 0x0138 /* Local Bus Chip-Select Timing 7 [R/W] */
101#define DDB_LCST8 0x0140 /* Local Bus Chip-Select Timing 8 [R/W] */
102#define DDB_DCSFN 0x0150 /* Device Chip-Select Muxing and Output */
103 /* Enables [R/W] */
104#define DDB_DCSIO 0x0158 /* Device Chip-Selects As I/O Bits [R/W] */
105#define DDB_BCST 0x0178 /* Local Boot Chip-Select Timing [R/W] */
106
107
108/*
109 * DMA Registers
110 */
111#define DDB_DMACTRL0 0x0180 /* DMA Control 0 [R/W] */
112#define DDB_DMASRCA0 0x0188 /* DMA Source Address 0 [R/W] */
113#define DDB_DMADESA0 0x0190 /* DMA Destination Address 0 [R/W] */
114#define DDB_DMACTRL1 0x0198 /* DMA Control 1 [R/W] */
115#define DDB_DMASRCA1 0x01A0 /* DMA Source Address 1 [R/W] */
116#define DDB_DMADESA1 0x01A8 /* DMA Destination Address 1 [R/W] */
117
118
119/*
120 * Timer Registers
121 */
122#define DDB_T0CTRL 0x01C0 /* SDRAM Refresh Control [R/W] */
123#define DDB_T0CNTR 0x01C8 /* SDRAM Refresh Counter [R/W] */
124#define DDB_T1CTRL 0x01D0 /* CPU-Bus Read Time-Out Control [R/W] */
125#define DDB_T1CNTR 0x01D8 /* CPU-Bus Read Time-Out Counter [R/W] */
126#define DDB_T2CTRL 0x01E0 /* General-Purpose Timer Control [R/W] */
127#define DDB_T2CNTR 0x01E8 /* General-Purpose Timer Counter [R/W] */
128#define DDB_T3CTRL 0x01F0 /* Watchdog Timer Control [R/W] */
129#define DDB_T3CNTR 0x01F8 /* Watchdog Timer Counter [R/W] */
130
131
132/*
133 * PCI Configuration Space Registers
134 */
135#define DDB_PCI_BASE 0x0200
136
137#define DDB_VID 0x0200 /* PCI Vendor ID [R] */
138#define DDB_DID 0x0202 /* PCI Device ID [R] */
139#define DDB_PCICMD 0x0204 /* PCI Command [R/W] */
140#define DDB_PCISTS 0x0206 /* PCI Status [R/W] */
141#define DDB_REVID 0x0208 /* PCI Revision ID [R] */
142#define DDB_CLASS 0x0209 /* PCI Class Code [R] */
143#define DDB_CLSIZ 0x020C /* PCI Cache Line Size [R/W] */
144#define DDB_MLTIM 0x020D /* PCI Latency Timer [R/W] */
145#define DDB_HTYPE 0x020E /* PCI Header Type [R] */
146#define DDB_BIST 0x020F /* BIST [R] (unimplemented) */
147#define DDB_BARC 0x0210 /* PCI Base Address Register Control [R/W] */
148#define DDB_BAR0 0x0218 /* PCI Base Address Register 0 [R/W] */
149#define DDB_BAR1 0x0220 /* PCI Base Address Register 1 [R/W] */
150#define DDB_CIS 0x0228 /* PCI Cardbus CIS Pointer [R] */
151 /* (unimplemented) */
152#define DDB_SSVID 0x022C /* PCI Sub-System Vendor ID [R/W] */
153#define DDB_SSID 0x022E /* PCI Sub-System ID [R/W] */
154#define DDB_ROM 0x0230 /* Expansion ROM Base Address [R] */
155 /* (unimplemented) */
156#define DDB_INTLIN 0x023C /* PCI Interrupt Line [R/W] */
157#define DDB_INTPIN 0x023D /* PCI Interrupt Pin [R] */
158#define DDB_MINGNT 0x023E /* PCI Min_Gnt [R] (unimplemented) */
159#define DDB_MAXLAT 0x023F /* PCI Max_Lat [R] (unimplemented) */
160#define DDB_BAR2 0x0240 /* PCI Base Address Register 2 [R/W] */
161#define DDB_BAR3 0x0248 /* PCI Base Address Register 3 [R/W] */
162#define DDB_BAR4 0x0250 /* PCI Base Address Register 4 [R/W] */
163#define DDB_BAR5 0x0258 /* PCI Base Address Register 5 [R/W] */
164#define DDB_BAR6 0x0260 /* PCI Base Address Register 6 [R/W] */
165#define DDB_BAR7 0x0268 /* PCI Base Address Register 7 [R/W] */
166#define DDB_BAR8 0x0270 /* PCI Base Address Register 8 [R/W] */
167#define DDB_BARB 0x0278 /* PCI Base Address Register BOOT [R/W] */
168
169
170/*
171 * Nile 4 Register Access
172 */
173
174static inline void ddb_sync(void)
175{
176 volatile u32 *p = (volatile u32 *)0xbfc00000;
177 (void)(*p);
178}
179
180static inline void ddb_out32(u32 offset, u32 val)
181{
182 *(volatile u32 *)(DDB_BASE+offset) = val;
183 ddb_sync();
184}
185
186static inline u32 ddb_in32(u32 offset)
187{
188 u32 val = *(volatile u32 *)(DDB_BASE+offset);
189 ddb_sync();
190 return val;
191}
192
193static inline void ddb_out16(u32 offset, u16 val)
194{
195 *(volatile u16 *)(DDB_BASE+offset) = val;
196 ddb_sync();
197}
198
199static inline u16 ddb_in16(u32 offset)
200{
201 u16 val = *(volatile u16 *)(DDB_BASE+offset);
202 ddb_sync();
203 return val;
204}
205
206static inline void ddb_out8(u32 offset, u8 val)
207{
208 *(volatile u8 *)(DDB_BASE+offset) = val;
209 ddb_sync();
210}
211
212static inline u8 ddb_in8(u32 offset)
213{
214 u8 val = *(volatile u8 *)(DDB_BASE+offset);
215 ddb_sync();
216 return val;
217}
218
219
220/*
221 * Physical Device Address Registers
222 */
223
224extern u32
225ddb_calc_pdar(u32 phys, u32 size, int width, int on_memory_bus, int pci_visible);
226extern void
227ddb_set_pdar(u32 pdar, u32 phys, u32 size, int width,
228 int on_memory_bus, int pci_visible);
229
230/*
231 * PCI Master Registers
232 */
233
234#define DDB_PCICMD_IACK 0 /* PCI Interrupt Acknowledge */
235#define DDB_PCICMD_IO 1 /* PCI I/O Space */
236#define DDB_PCICMD_MEM 3 /* PCI Memory Space */
237#define DDB_PCICMD_CFG 5 /* PCI Configuration Space */
238
239/*
240 * additional options for pci init reg (no shifting needed)
241 */
242#define DDB_PCI_CFGTYPE1 0x200 /* for pci init0/1 regs */
243#define DDB_PCI_ACCESS_32 0x10 /* for pci init0/1 regs */
244
245
246extern void ddb_set_pmr(u32 pmr, u32 type, u32 addr, u32 options);
247
248/*
249 * we need to reset pci bus when we start up and shutdown
250 */
251extern void ddb_pci_reset_bus(void);
252
253
254/*
255 * include the board dependent part
256 */
257#if defined(CONFIG_DDB5477)
258#include <asm/ddb5xxx/ddb5477.h>
259#else
260#error "Unknown DDB board!"
261#endif
262
263#endif /* __ASM_DDB5XXX_DDB5XXX_H */
diff --git a/include/asm-mips/dec/serial.h b/include/asm-mips/dec/serial.h
deleted file mode 100644
index acad75890a05..000000000000
--- a/include/asm-mips/dec/serial.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * include/asm-mips/dec/serial.h
3 *
4 * Definitions common to all DECstation serial devices.
5 *
6 * Copyright (C) 2004 Maciej W. Rozycki
7 *
8 * Based on bits extracted from drivers/tc/zs.h for which
9 * the following copyrights apply:
10 *
11 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
12 * Copyright (C) 1996 Paul Mackerras (Paul.Mackerras@cs.anu.edu.au)
13 * Copyright (C) Harald Koerfgen
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#ifndef __ASM_MIPS_DEC_SERIAL_H
21#define __ASM_MIPS_DEC_SERIAL_H
22
23struct dec_serial_hook {
24 int (*init_channel)(void *handle);
25 void (*init_info)(void *handle);
26 void (*rx_char)(unsigned char ch, unsigned char fl);
27 int (*poll_rx_char)(void *handle);
28 int (*poll_tx_char)(void *handle, unsigned char ch);
29 unsigned int cflags;
30};
31
32extern int register_dec_serial_hook(unsigned int channel,
33 struct dec_serial_hook *hook);
34extern int unregister_dec_serial_hook(unsigned int channel);
35
36#endif /* __ASM_MIPS_DEC_SERIAL_H */
diff --git a/include/asm-mips/ds1216.h b/include/asm-mips/ds1216.h
deleted file mode 100644
index 1ff8b73f7a6a..000000000000
--- a/include/asm-mips/ds1216.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef _DS1216_H
2#define _DS1216_H
3
4extern volatile unsigned char *ds1216_base;
5unsigned long ds1216_get_cmos_time(void);
6int ds1216_set_rtc_mmss(unsigned long nowtime);
7
8#define DS1216_SEC_BYTE 1
9#define DS1216_MIN_BYTE 2
10#define DS1216_HOUR_BYTE 3
11#define DS1216_HOUR_MASK (0x1f)
12#define DS1216_AMPM_MASK (1<<5)
13#define DS1216_1224_MASK (1<<7)
14#define DS1216_DAY_BYTE 4
15#define DS1216_DAY_MASK (0x7)
16#define DS1216_DATE_BYTE 5
17#define DS1216_DATE_MASK (0x3f)
18#define DS1216_MONTH_BYTE 6
19#define DS1216_MONTH_MASK (0x1f)
20#define DS1216_YEAR_BYTE 7
21
22#define DS1216_SEC(buf) (buf[DS1216_SEC_BYTE])
23#define DS1216_MIN(buf) (buf[DS1216_MIN_BYTE])
24#define DS1216_HOUR(buf) (buf[DS1216_HOUR_BYTE] & DS1216_HOUR_MASK)
25#define DS1216_AMPM(buf) (buf[DS1216_HOUR_BYTE] & DS1216_AMPM_MASK)
26#define DS1216_1224(buf) (buf[DS1216_HOUR_BYTE] & DS1216_1224_MASK)
27#define DS1216_DATE(buf) (buf[DS1216_DATE_BYTE] & DS1216_DATE_MASK)
28#define DS1216_MONTH(buf) (buf[DS1216_MONTH_BYTE] & DS1216_MONTH_MASK)
29#define DS1216_YEAR(buf) (buf[DS1216_YEAR_BYTE])
30
31#endif
diff --git a/include/asm-mips/edac.h b/include/asm-mips/edac.h
new file mode 100644
index 000000000000..4da0c1fe30d9
--- /dev/null
+++ b/include/asm-mips/edac.h
@@ -0,0 +1,34 @@
1#ifndef ASM_EDAC_H
2#define ASM_EDAC_H
3
4/* ECC atomic, DMA, SMP and interrupt safe scrub function */
5
6static inline void atomic_scrub(void *va, u32 size)
7{
8 unsigned long *virt_addr = va;
9 unsigned long temp;
10 u32 i;
11
12 for (i = 0; i < size / sizeof(unsigned long); i++) {
13 /*
14 * Very carefully read and write to memory atomically
15 * so we are interrupt, DMA and SMP safe.
16 *
17 * Intel: asm("lock; addl $0, %0"::"m"(*virt_addr));
18 */
19
20 __asm__ __volatile__ (
21 " .set mips2 \n"
22 "1: ll %0, %1 # atomic_scrub \n"
23 " addu %0, $0 \n"
24 " sc %0, %1 \n"
25 " beqz %0, 1b \n"
26 " .set mips0 \n"
27 : "=&r" (temp), "=m" (*virt_addr)
28 : "m" (*virt_addr));
29
30 virt_addr++;
31 }
32}
33
34#endif
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h
index ebd6bfb19d66..e7d95d48177d 100644
--- a/include/asm-mips/elf.h
+++ b/include/asm-mips/elf.h
@@ -265,7 +265,7 @@ do { \
265#ifdef CONFIG_MIPS32_N32 265#ifdef CONFIG_MIPS32_N32
266#define __SET_PERSONALITY32_N32() \ 266#define __SET_PERSONALITY32_N32() \
267 do { \ 267 do { \
268 current->thread.mflags |= MF_N32; \ 268 set_thread_flag(TIF_32BIT_ADDR); \
269 current->thread.abi = &mips_abi_n32; \ 269 current->thread.abi = &mips_abi_n32; \
270 } while (0) 270 } while (0)
271#else 271#else
@@ -276,7 +276,8 @@ do { \
276#ifdef CONFIG_MIPS32_O32 276#ifdef CONFIG_MIPS32_O32
277#define __SET_PERSONALITY32_O32() \ 277#define __SET_PERSONALITY32_O32() \
278 do { \ 278 do { \
279 current->thread.mflags |= MF_O32; \ 279 set_thread_flag(TIF_32BIT_REGS); \
280 set_thread_flag(TIF_32BIT_ADDR); \
280 current->thread.abi = &mips_abi_32; \ 281 current->thread.abi = &mips_abi_32; \
281 } while (0) 282 } while (0)
282#else 283#else
@@ -299,13 +300,13 @@ do { \
299 300
300#define SET_PERSONALITY(ex, ibcs2) \ 301#define SET_PERSONALITY(ex, ibcs2) \
301do { \ 302do { \
302 current->thread.mflags &= ~MF_ABI_MASK; \ 303 clear_thread_flag(TIF_32BIT_REGS); \
304 clear_thread_flag(TIF_32BIT_ADDR); \
305 \
303 if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ 306 if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \
304 __SET_PERSONALITY32(ex); \ 307 __SET_PERSONALITY32(ex); \
305 else { \ 308 else \
306 current->thread.mflags |= MF_N64; \
307 current->thread.abi = &mips_abi; \ 309 current->thread.abi = &mips_abi; \
308 } \
309 \ 310 \
310 if (ibcs2) \ 311 if (ibcs2) \
311 set_personality(PER_SVR4); \ 312 set_personality(PER_SVR4); \
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h
index 47e5679c2353..b623882bce19 100644
--- a/include/asm-mips/futex.h
+++ b/include/asm-mips/futex.h
@@ -29,7 +29,7 @@
29 " .set mips3 \n" \ 29 " .set mips3 \n" \
30 "2: sc $1, %2 \n" \ 30 "2: sc $1, %2 \n" \
31 " beqzl $1, 1b \n" \ 31 " beqzl $1, 1b \n" \
32 __WEAK_ORDERING_MB \ 32 __WEAK_LLSC_MB \
33 "3: \n" \ 33 "3: \n" \
34 " .set pop \n" \ 34 " .set pop \n" \
35 " .set mips0 \n" \ 35 " .set mips0 \n" \
@@ -55,7 +55,7 @@
55 " .set mips3 \n" \ 55 " .set mips3 \n" \
56 "2: sc $1, %2 \n" \ 56 "2: sc $1, %2 \n" \
57 " beqz $1, 1b \n" \ 57 " beqz $1, 1b \n" \
58 __WEAK_ORDERING_MB \ 58 __WEAK_LLSC_MB \
59 "3: \n" \ 59 "3: \n" \
60 " .set pop \n" \ 60 " .set pop \n" \
61 " .set mips0 \n" \ 61 " .set mips0 \n" \
@@ -152,7 +152,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
152 " .set mips3 \n" 152 " .set mips3 \n"
153 "2: sc $1, %1 \n" 153 "2: sc $1, %1 \n"
154 " beqzl $1, 1b \n" 154 " beqzl $1, 1b \n"
155 __WEAK_ORDERING_MB 155 __WEAK_LLSC_MB
156 "3: \n" 156 "3: \n"
157 " .set pop \n" 157 " .set pop \n"
158 " .section .fixup,\"ax\" \n" 158 " .section .fixup,\"ax\" \n"
@@ -179,7 +179,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
179 " .set mips3 \n" 179 " .set mips3 \n"
180 "2: sc $1, %1 \n" 180 "2: sc $1, %1 \n"
181 " beqz $1, 1b \n" 181 " beqz $1, 1b \n"
182 __WEAK_ORDERING_MB 182 __WEAK_LLSC_MB
183 "3: \n" 183 "3: \n"
184 " .set pop \n" 184 " .set pop \n"
185 " .section .fixup,\"ax\" \n" 185 " .section .fixup,\"ax\" \n"
diff --git a/include/asm-mips/gfx.h b/include/asm-mips/gfx.h
deleted file mode 100644
index 37235e41a6fd..000000000000
--- a/include/asm-mips/gfx.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * This is the user-visible SGI GFX interface.
7 *
8 * This must be used verbatim into the GNU libc. It does not include
9 * any kernel-only bits on it.
10 *
11 * miguel@nuclecu.unam.mx
12 */
13#ifndef _ASM_GFX_H
14#define _ASM_GFX_H
15
16/* The iocls, yes, they do not make sense, but such is life */
17#define GFX_BASE 100
18#define GFX_GETNUM_BOARDS (GFX_BASE + 1)
19#define GFX_GETBOARD_INFO (GFX_BASE + 2)
20#define GFX_ATTACH_BOARD (GFX_BASE + 3)
21#define GFX_DETACH_BOARD (GFX_BASE + 4)
22#define GFX_IS_MANAGED (GFX_BASE + 5)
23
24#define GFX_MAPALL (GFX_BASE + 10)
25#define GFX_LABEL (GFX_BASE + 11)
26
27#define GFX_INFO_NAME_SIZE 16
28#define GFX_INFO_LABEL_SIZE 16
29
30struct gfx_info {
31 char name [GFX_INFO_NAME_SIZE]; /* board name */
32 char label [GFX_INFO_LABEL_SIZE]; /* label name */
33 unsigned short int xpmax, ypmax; /* screen resolution */
34 unsigned int lenght; /* size of a complete gfx_info for this board */
35};
36
37struct gfx_getboardinfo_args {
38 unsigned int board; /* board number. starting from zero */
39 void *buf; /* pointer to gfx_info */
40 unsigned int len; /* buffer size of buf */
41};
42
43struct gfx_attach_board_args {
44 unsigned int board; /* board number, starting from zero */
45 void *vaddr; /* address where the board registers should be mapped */
46};
47
48#ifdef __KERNEL__
49/* umap.c */
50extern void remove_mapping (struct vm_area_struct *vma, struct task_struct *, unsigned long, unsigned long);
51extern void *vmalloc_uncached (unsigned long size);
52extern int vmap_page_range (struct vm_area_struct *vma, unsigned long from, unsigned long size, unsigned long vaddr);
53#endif
54
55#endif /* _ASM_GFX_H */
diff --git a/include/asm-mips/gt64240.h b/include/asm-mips/gt64240.h
deleted file mode 100644
index 8f9bd341ed49..000000000000
--- a/include/asm-mips/gt64240.h
+++ /dev/null
@@ -1,1235 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright - Galileo technology.
7 * Copyright (C) 2004 by Ralf Baechle
8 */
9#ifndef __ASM_MIPS_MV64240_H
10#define __ASM_MIPS_MV64240_H
11
12#include <asm/addrspace.h>
13#include <asm/marvell.h>
14
15/*
16 * CPU Control Registers
17 */
18
19#define CPU_CONFIGURATION 0x000
20#define CPU_MODE 0x120
21#define CPU_READ_RESPONSE_CROSSBAR_LOW 0x170
22#define CPU_READ_RESPONSE_CROSSBAR_HIGH 0x178
23
24/*
25 * Processor Address Space
26 */
27
28/* Sdram's BAR'S */
29#define SCS_0_LOW_DECODE_ADDRESS 0x008
30#define SCS_0_HIGH_DECODE_ADDRESS 0x010
31#define SCS_1_LOW_DECODE_ADDRESS 0x208
32#define SCS_1_HIGH_DECODE_ADDRESS 0x210
33#define SCS_2_LOW_DECODE_ADDRESS 0x018
34#define SCS_2_HIGH_DECODE_ADDRESS 0x020
35#define SCS_3_LOW_DECODE_ADDRESS 0x218
36#define SCS_3_HIGH_DECODE_ADDRESS 0x220
37/* Devices BAR'S */
38#define CS_0_LOW_DECODE_ADDRESS 0x028
39#define CS_0_HIGH_DECODE_ADDRESS 0x030
40#define CS_1_LOW_DECODE_ADDRESS 0x228
41#define CS_1_HIGH_DECODE_ADDRESS 0x230
42#define CS_2_LOW_DECODE_ADDRESS 0x248
43#define CS_2_HIGH_DECODE_ADDRESS 0x250
44#define CS_3_LOW_DECODE_ADDRESS 0x038
45#define CS_3_HIGH_DECODE_ADDRESS 0x040
46#define BOOTCS_LOW_DECODE_ADDRESS 0x238
47#define BOOTCS_HIGH_DECODE_ADDRESS 0x240
48
49#define PCI_0I_O_LOW_DECODE_ADDRESS 0x048
50#define PCI_0I_O_HIGH_DECODE_ADDRESS 0x050
51#define PCI_0MEMORY0_LOW_DECODE_ADDRESS 0x058
52#define PCI_0MEMORY0_HIGH_DECODE_ADDRESS 0x060
53#define PCI_0MEMORY1_LOW_DECODE_ADDRESS 0x080
54#define PCI_0MEMORY1_HIGH_DECODE_ADDRESS 0x088
55#define PCI_0MEMORY2_LOW_DECODE_ADDRESS 0x258
56#define PCI_0MEMORY2_HIGH_DECODE_ADDRESS 0x260
57#define PCI_0MEMORY3_LOW_DECODE_ADDRESS 0x280
58#define PCI_0MEMORY3_HIGH_DECODE_ADDRESS 0x288
59
60#define PCI_1I_O_LOW_DECODE_ADDRESS 0x090
61#define PCI_1I_O_HIGH_DECODE_ADDRESS 0x098
62#define PCI_1MEMORY0_LOW_DECODE_ADDRESS 0x0a0
63#define PCI_1MEMORY0_HIGH_DECODE_ADDRESS 0x0a8
64#define PCI_1MEMORY1_LOW_DECODE_ADDRESS 0x0b0
65#define PCI_1MEMORY1_HIGH_DECODE_ADDRESS 0x0b8
66#define PCI_1MEMORY2_LOW_DECODE_ADDRESS 0x2a0
67#define PCI_1MEMORY2_HIGH_DECODE_ADDRESS 0x2a8
68#define PCI_1MEMORY3_LOW_DECODE_ADDRESS 0x2b0
69#define PCI_1MEMORY3_HIGH_DECODE_ADDRESS 0x2b8
70
71#define INTERNAL_SPACE_DECODE 0x068
72
73#define CPU_0_LOW_DECODE_ADDRESS 0x290
74#define CPU_0_HIGH_DECODE_ADDRESS 0x298
75#define CPU_1_LOW_DECODE_ADDRESS 0x2c0
76#define CPU_1_HIGH_DECODE_ADDRESS 0x2c8
77
78#define PCI_0I_O_ADDRESS_REMAP 0x0f0
79#define PCI_0MEMORY0_ADDRESS_REMAP 0x0f8
80#define PCI_0MEMORY0_HIGH_ADDRESS_REMAP 0x320
81#define PCI_0MEMORY1_ADDRESS_REMAP 0x100
82#define PCI_0MEMORY1_HIGH_ADDRESS_REMAP 0x328
83#define PCI_0MEMORY2_ADDRESS_REMAP 0x2f8
84#define PCI_0MEMORY2_HIGH_ADDRESS_REMAP 0x330
85#define PCI_0MEMORY3_ADDRESS_REMAP 0x300
86#define PCI_0MEMORY3_HIGH_ADDRESS_REMAP 0x338
87
88#define PCI_1I_O_ADDRESS_REMAP 0x108
89#define PCI_1MEMORY0_ADDRESS_REMAP 0x110
90#define PCI_1MEMORY0_HIGH_ADDRESS_REMAP 0x340
91#define PCI_1MEMORY1_ADDRESS_REMAP 0x118
92#define PCI_1MEMORY1_HIGH_ADDRESS_REMAP 0x348
93#define PCI_1MEMORY2_ADDRESS_REMAP 0x310
94#define PCI_1MEMORY2_HIGH_ADDRESS_REMAP 0x350
95#define PCI_1MEMORY3_ADDRESS_REMAP 0x318
96#define PCI_1MEMORY3_HIGH_ADDRESS_REMAP 0x358
97
98/*
99 * CPU Sync Barrier
100 */
101
102#define PCI_0SYNC_BARIER_VIRTUAL_REGISTER 0x0c0
103#define PCI_1SYNC_BARIER_VIRTUAL_REGISTER 0x0c8
104
105
106/*
107 * CPU Access Protect
108 */
109
110#define CPU_LOW_PROTECT_ADDRESS_0 0X180
111#define CPU_HIGH_PROTECT_ADDRESS_0 0X188
112#define CPU_LOW_PROTECT_ADDRESS_1 0X190
113#define CPU_HIGH_PROTECT_ADDRESS_1 0X198
114#define CPU_LOW_PROTECT_ADDRESS_2 0X1a0
115#define CPU_HIGH_PROTECT_ADDRESS_2 0X1a8
116#define CPU_LOW_PROTECT_ADDRESS_3 0X1b0
117#define CPU_HIGH_PROTECT_ADDRESS_3 0X1b8
118#define CPU_LOW_PROTECT_ADDRESS_4 0X1c0
119#define CPU_HIGH_PROTECT_ADDRESS_4 0X1c8
120#define CPU_LOW_PROTECT_ADDRESS_5 0X1d0
121#define CPU_HIGH_PROTECT_ADDRESS_5 0X1d8
122#define CPU_LOW_PROTECT_ADDRESS_6 0X1e0
123#define CPU_HIGH_PROTECT_ADDRESS_6 0X1e8
124#define CPU_LOW_PROTECT_ADDRESS_7 0X1f0
125#define CPU_HIGH_PROTECT_ADDRESS_7 0X1f8
126
127
128/*
129 * Snoop Control
130 */
131
132#define SNOOP_BASE_ADDRESS_0 0x380
133#define SNOOP_TOP_ADDRESS_0 0x388
134#define SNOOP_BASE_ADDRESS_1 0x390
135#define SNOOP_TOP_ADDRESS_1 0x398
136#define SNOOP_BASE_ADDRESS_2 0x3a0
137#define SNOOP_TOP_ADDRESS_2 0x3a8
138#define SNOOP_BASE_ADDRESS_3 0x3b0
139#define SNOOP_TOP_ADDRESS_3 0x3b8
140
141/*
142 * CPU Error Report
143 */
144
145#define CPU_ERROR_ADDRESS_LOW 0x070
146#define CPU_ERROR_ADDRESS_HIGH 0x078
147#define CPU_ERROR_DATA_LOW 0x128
148#define CPU_ERROR_DATA_HIGH 0x130
149#define CPU_ERROR_PARITY 0x138
150#define CPU_ERROR_CAUSE 0x140
151#define CPU_ERROR_MASK 0x148
152
153/*
154 * Pslave Debug
155 */
156
157#define X_0_ADDRESS 0x360
158#define X_0_COMMAND_ID 0x368
159#define X_1_ADDRESS 0x370
160#define X_1_COMMAND_ID 0x378
161#define WRITE_DATA_LOW 0x3c0
162#define WRITE_DATA_HIGH 0x3c8
163#define WRITE_BYTE_ENABLE 0X3e0
164#define READ_DATA_LOW 0x3d0
165#define READ_DATA_HIGH 0x3d8
166#define READ_ID 0x3e8
167
168
169/*
170 * SDRAM and Device Address Space
171 */
172
173
174/*
175 * SDRAM Configuration
176 */
177
178#define SDRAM_CONFIGURATION 0x448
179#define SDRAM_OPERATION_MODE 0x474
180#define SDRAM_ADDRESS_DECODE 0x47C
181#define SDRAM_TIMING_PARAMETERS 0x4b4
182#define SDRAM_UMA_CONTROL 0x4a4
183#define SDRAM_CROSS_BAR_CONTROL_LOW 0x4a8
184#define SDRAM_CROSS_BAR_CONTROL_HIGH 0x4ac
185#define SDRAM_CROSS_BAR_TIMEOUT 0x4b0
186
187
188/*
189 * SDRAM Parameters
190 */
191
192#define SDRAM_BANK0PARAMETERS 0x44C
193#define SDRAM_BANK1PARAMETERS 0x450
194#define SDRAM_BANK2PARAMETERS 0x454
195#define SDRAM_BANK3PARAMETERS 0x458
196
197
198/*
199 * SDRAM Error Report
200 */
201
202#define SDRAM_ERROR_DATA_LOW 0x484
203#define SDRAM_ERROR_DATA_HIGH 0x480
204#define SDRAM_AND_DEVICE_ERROR_ADDRESS 0x490
205#define SDRAM_RECEIVED_ECC 0x488
206#define SDRAM_CALCULATED_ECC 0x48c
207#define SDRAM_ECC_CONTROL 0x494
208#define SDRAM_ECC_ERROR_COUNTER 0x498
209
210
211/*
212 * SDunit Debug (for internal use)
213 */
214
215#define X0_ADDRESS 0x500
216#define X0_COMMAND_AND_ID 0x504
217#define X0_WRITE_DATA_LOW 0x508
218#define X0_WRITE_DATA_HIGH 0x50c
219#define X0_WRITE_BYTE_ENABLE 0x518
220#define X0_READ_DATA_LOW 0x510
221#define X0_READ_DATA_HIGH 0x514
222#define X0_READ_ID 0x51c
223#define X1_ADDRESS 0x520
224#define X1_COMMAND_AND_ID 0x524
225#define X1_WRITE_DATA_LOW 0x528
226#define X1_WRITE_DATA_HIGH 0x52c
227#define X1_WRITE_BYTE_ENABLE 0x538
228#define X1_READ_DATA_LOW 0x530
229#define X1_READ_DATA_HIGH 0x534
230#define X1_READ_ID 0x53c
231#define X0_SNOOP_ADDRESS 0x540
232#define X0_SNOOP_COMMAND 0x544
233#define X1_SNOOP_ADDRESS 0x548
234#define X1_SNOOP_COMMAND 0x54c
235
236
237/*
238 * Device Parameters
239 */
240
241#define DEVICE_BANK0PARAMETERS 0x45c
242#define DEVICE_BANK1PARAMETERS 0x460
243#define DEVICE_BANK2PARAMETERS 0x464
244#define DEVICE_BANK3PARAMETERS 0x468
245#define DEVICE_BOOT_BANK_PARAMETERS 0x46c
246#define DEVICE_CONTROL 0x4c0
247#define DEVICE_CROSS_BAR_CONTROL_LOW 0x4c8
248#define DEVICE_CROSS_BAR_CONTROL_HIGH 0x4cc
249#define DEVICE_CROSS_BAR_TIMEOUT 0x4c4
250
251
252/*
253 * Device Interrupt
254 */
255
256#define DEVICE_INTERRUPT_CAUSE 0x4d0
257#define DEVICE_INTERRUPT_MASK 0x4d4
258#define DEVICE_ERROR_ADDRESS 0x4d8
259
260/*
261 * DMA Record
262 */
263
264#define CHANNEL0_DMA_BYTE_COUNT 0x800
265#define CHANNEL1_DMA_BYTE_COUNT 0x804
266#define CHANNEL2_DMA_BYTE_COUNT 0x808
267#define CHANNEL3_DMA_BYTE_COUNT 0x80C
268#define CHANNEL4_DMA_BYTE_COUNT 0x900
269#define CHANNEL5_DMA_BYTE_COUNT 0x904
270#define CHANNEL6_DMA_BYTE_COUNT 0x908
271#define CHANNEL7_DMA_BYTE_COUNT 0x90C
272#define CHANNEL0_DMA_SOURCE_ADDRESS 0x810
273#define CHANNEL1_DMA_SOURCE_ADDRESS 0x814
274#define CHANNEL2_DMA_SOURCE_ADDRESS 0x818
275#define CHANNEL3_DMA_SOURCE_ADDRESS 0x81C
276#define CHANNEL4_DMA_SOURCE_ADDRESS 0x910
277#define CHANNEL5_DMA_SOURCE_ADDRESS 0x914
278#define CHANNEL6_DMA_SOURCE_ADDRESS 0x918
279#define CHANNEL7_DMA_SOURCE_ADDRESS 0x91C
280#define CHANNEL0_DMA_DESTINATION_ADDRESS 0x820
281#define CHANNEL1_DMA_DESTINATION_ADDRESS 0x824
282#define CHANNEL2_DMA_DESTINATION_ADDRESS 0x828
283#define CHANNEL3_DMA_DESTINATION_ADDRESS 0x82C
284#define CHANNEL4_DMA_DESTINATION_ADDRESS 0x920
285#define CHANNEL5_DMA_DESTINATION_ADDRESS 0x924
286#define CHANNEL6_DMA_DESTINATION_ADDRESS 0x928
287#define CHANNEL7_DMA_DESTINATION_ADDRESS 0x92C
288#define CHANNEL0NEXT_RECORD_POINTER 0x830
289#define CHANNEL1NEXT_RECORD_POINTER 0x834
290#define CHANNEL2NEXT_RECORD_POINTER 0x838
291#define CHANNEL3NEXT_RECORD_POINTER 0x83C
292#define CHANNEL4NEXT_RECORD_POINTER 0x930
293#define CHANNEL5NEXT_RECORD_POINTER 0x934
294#define CHANNEL6NEXT_RECORD_POINTER 0x938
295#define CHANNEL7NEXT_RECORD_POINTER 0x93C
296#define CHANNEL0CURRENT_DESCRIPTOR_POINTER 0x870
297#define CHANNEL1CURRENT_DESCRIPTOR_POINTER 0x874
298#define CHANNEL2CURRENT_DESCRIPTOR_POINTER 0x878
299#define CHANNEL3CURRENT_DESCRIPTOR_POINTER 0x87C
300#define CHANNEL4CURRENT_DESCRIPTOR_POINTER 0x970
301#define CHANNEL5CURRENT_DESCRIPTOR_POINTER 0x974
302#define CHANNEL6CURRENT_DESCRIPTOR_POINTER 0x978
303#define CHANNEL7CURRENT_DESCRIPTOR_POINTER 0x97C
304#define CHANNEL0_DMA_SOURCE_HIGH_PCI_ADDRESS 0x890
305#define CHANNEL1_DMA_SOURCE_HIGH_PCI_ADDRESS 0x894
306#define CHANNEL2_DMA_SOURCE_HIGH_PCI_ADDRESS 0x898
307#define CHANNEL3_DMA_SOURCE_HIGH_PCI_ADDRESS 0x89c
308#define CHANNEL4_DMA_SOURCE_HIGH_PCI_ADDRESS 0x990
309#define CHANNEL5_DMA_SOURCE_HIGH_PCI_ADDRESS 0x994
310#define CHANNEL6_DMA_SOURCE_HIGH_PCI_ADDRESS 0x998
311#define CHANNEL7_DMA_SOURCE_HIGH_PCI_ADDRESS 0x99c
312#define CHANNEL0_DMA_DESTINATION_HIGH_PCI_ADDRESS 0x8a0
313#define CHANNEL1_DMA_DESTINATION_HIGH_PCI_ADDRESS 0x8a4
314#define CHANNEL2_DMA_DESTINATION_HIGH_PCI_ADDRESS 0x8a8
315#define CHANNEL3_DMA_DESTINATION_HIGH_PCI_ADDRESS 0x8ac
316#define CHANNEL4_DMA_DESTINATION_HIGH_PCI_ADDRESS 0x9a0
317#define CHANNEL5_DMA_DESTINATION_HIGH_PCI_ADDRESS 0x9a4
318#define CHANNEL6_DMA_DESTINATION_HIGH_PCI_ADDRESS 0x9a8
319#define CHANNEL7_DMA_DESTINATION_HIGH_PCI_ADDRESS 0x9ac
320#define CHANNEL0_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS 0x8b0
321#define CHANNEL1_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS 0x8b4
322#define CHANNEL2_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS 0x8b8
323#define CHANNEL3_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS 0x8bc
324#define CHANNEL4_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS 0x9b0
325#define CHANNEL5_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS 0x9b4
326#define CHANNEL6_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS 0x9b8
327#define CHANNEL7_DMA_NEXT_RECORD_POINTER_HIGH_PCI_ADDRESS 0x9bc
328
329/*
330 * DMA Channel Control
331 */
332
333#define CHANNEL0CONTROL 0x840
334#define CHANNEL0CONTROL_HIGH 0x880
335
336#define CHANNEL1CONTROL 0x844
337#define CHANNEL1CONTROL_HIGH 0x884
338
339#define CHANNEL2CONTROL 0x848
340#define CHANNEL2CONTROL_HIGH 0x888
341
342#define CHANNEL3CONTROL 0x84C
343#define CHANNEL3CONTROL_HIGH 0x88C
344
345#define CHANNEL4CONTROL 0x940
346#define CHANNEL4CONTROL_HIGH 0x980
347
348#define CHANNEL5CONTROL 0x944
349#define CHANNEL5CONTROL_HIGH 0x984
350
351#define CHANNEL6CONTROL 0x948
352#define CHANNEL6CONTROL_HIGH 0x988
353
354#define CHANNEL7CONTROL 0x94C
355#define CHANNEL7CONTROL_HIGH 0x98C
356
357
358/*
359 * DMA Arbiter
360 */
361
362#define ARBITER_CONTROL_0_3 0x860
363#define ARBITER_CONTROL_4_7 0x960
364
365
366/*
367 * DMA Interrupt
368 */
369
370#define CHANELS0_3_INTERRUPT_CAUSE 0x8c0
371#define CHANELS0_3_INTERRUPT_MASK 0x8c4
372#define CHANELS0_3_ERROR_ADDRESS 0x8c8
373#define CHANELS0_3_ERROR_SELECT 0x8cc
374#define CHANELS4_7_INTERRUPT_CAUSE 0x9c0
375#define CHANELS4_7_INTERRUPT_MASK 0x9c4
376#define CHANELS4_7_ERROR_ADDRESS 0x9c8
377#define CHANELS4_7_ERROR_SELECT 0x9cc
378
379
380/*
381 * DMA Debug (for internal use)
382 */
383
384#define DMA_X0_ADDRESS 0x8e0
385#define DMA_X0_COMMAND_AND_ID 0x8e4
386#define DMA_X0_WRITE_DATA_LOW 0x8e8
387#define DMA_X0_WRITE_DATA_HIGH 0x8ec
388#define DMA_X0_WRITE_BYTE_ENABLE 0x8f8
389#define DMA_X0_READ_DATA_LOW 0x8f0
390#define DMA_X0_READ_DATA_HIGH 0x8f4
391#define DMA_X0_READ_ID 0x8fc
392#define DMA_X1_ADDRESS 0x9e0
393#define DMA_X1_COMMAND_AND_ID 0x9e4
394#define DMA_X1_WRITE_DATA_LOW 0x9e8
395#define DMA_X1_WRITE_DATA_HIGH 0x9ec
396#define DMA_X1_WRITE_BYTE_ENABLE 0x9f8
397#define DMA_X1_READ_DATA_LOW 0x9f0
398#define DMA_X1_READ_DATA_HIGH 0x9f4
399#define DMA_X1_READ_ID 0x9fc
400
401/*
402 * Timer_Counter
403 */
404
405#define TIMER_COUNTER0 0x850
406#define TIMER_COUNTER1 0x854
407#define TIMER_COUNTER2 0x858
408#define TIMER_COUNTER3 0x85C
409#define TIMER_COUNTER_0_3_CONTROL 0x864
410#define TIMER_COUNTER_0_3_INTERRUPT_CAUSE 0x868
411#define TIMER_COUNTER_0_3_INTERRUPT_MASK 0x86c
412#define TIMER_COUNTER4 0x950
413#define TIMER_COUNTER5 0x954
414#define TIMER_COUNTER6 0x958
415#define TIMER_COUNTER7 0x95C
416#define TIMER_COUNTER_4_7_CONTROL 0x964
417#define TIMER_COUNTER_4_7_INTERRUPT_CAUSE 0x968
418#define TIMER_COUNTER_4_7_INTERRUPT_MASK 0x96c
419
420/*
421 * PCI Slave Address Decoding
422 */
423
424#define PCI_0SCS_0_BANK_SIZE 0xc08
425#define PCI_1SCS_0_BANK_SIZE 0xc88
426#define PCI_0SCS_1_BANK_SIZE 0xd08
427#define PCI_1SCS_1_BANK_SIZE 0xd88
428#define PCI_0SCS_2_BANK_SIZE 0xc0c
429#define PCI_1SCS_2_BANK_SIZE 0xc8c
430#define PCI_0SCS_3_BANK_SIZE 0xd0c
431#define PCI_1SCS_3_BANK_SIZE 0xd8c
432#define PCI_0CS_0_BANK_SIZE 0xc10
433#define PCI_1CS_0_BANK_SIZE 0xc90
434#define PCI_0CS_1_BANK_SIZE 0xd10
435#define PCI_1CS_1_BANK_SIZE 0xd90
436#define PCI_0CS_2_BANK_SIZE 0xd18
437#define PCI_1CS_2_BANK_SIZE 0xd98
438#define PCI_0CS_3_BANK_SIZE 0xc14
439#define PCI_1CS_3_BANK_SIZE 0xc94
440#define PCI_0CS_BOOT_BANK_SIZE 0xd14
441#define PCI_1CS_BOOT_BANK_SIZE 0xd94
442#define PCI_0P2P_MEM0_BAR_SIZE 0xd1c
443#define PCI_1P2P_MEM0_BAR_SIZE 0xd9c
444#define PCI_0P2P_MEM1_BAR_SIZE 0xd20
445#define PCI_1P2P_MEM1_BAR_SIZE 0xda0
446#define PCI_0P2P_I_O_BAR_SIZE 0xd24
447#define PCI_1P2P_I_O_BAR_SIZE 0xda4
448#define PCI_0CPU_BAR_SIZE 0xd28
449#define PCI_1CPU_BAR_SIZE 0xda8
450#define PCI_0DAC_SCS_0_BANK_SIZE 0xe00
451#define PCI_1DAC_SCS_0_BANK_SIZE 0xe80
452#define PCI_0DAC_SCS_1_BANK_SIZE 0xe04
453#define PCI_1DAC_SCS_1_BANK_SIZE 0xe84
454#define PCI_0DAC_SCS_2_BANK_SIZE 0xe08
455#define PCI_1DAC_SCS_2_BANK_SIZE 0xe88
456#define PCI_0DAC_SCS_3_BANK_SIZE 0xe0c
457#define PCI_1DAC_SCS_3_BANK_SIZE 0xe8c
458#define PCI_0DAC_CS_0_BANK_SIZE 0xe10
459#define PCI_1DAC_CS_0_BANK_SIZE 0xe90
460#define PCI_0DAC_CS_1_BANK_SIZE 0xe14
461#define PCI_1DAC_CS_1_BANK_SIZE 0xe94
462#define PCI_0DAC_CS_2_BANK_SIZE 0xe18
463#define PCI_1DAC_CS_2_BANK_SIZE 0xe98
464#define PCI_0DAC_CS_3_BANK_SIZE 0xe1c
465#define PCI_1DAC_CS_3_BANK_SIZE 0xe9c
466#define PCI_0DAC_BOOTCS_BANK_SIZE 0xe20
467#define PCI_1DAC_BOOTCS_BANK_SIZE 0xea0
468#define PCI_0DAC_P2P_MEM0_BAR_SIZE 0xe24
469#define PCI_1DAC_P2P_MEM0_BAR_SIZE 0xea4
470#define PCI_0DAC_P2P_MEM1_BAR_SIZE 0xe28
471#define PCI_1DAC_P2P_MEM1_BAR_SIZE 0xea8
472#define PCI_0DAC_CPU_BAR_SIZE 0xe2c
473#define PCI_1DAC_CPU_BAR_SIZE 0xeac
474#define PCI_0EXPANSION_ROM_BAR_SIZE 0xd2c
475#define PCI_1EXPANSION_ROM_BAR_SIZE 0xdac
476#define PCI_0BASE_ADDRESS_REGISTERS_ENABLE 0xc3c
477#define PCI_1BASE_ADDRESS_REGISTERS_ENABLE 0xcbc
478#define PCI_0SCS_0_BASE_ADDRESS_REMAP 0xc48
479#define PCI_1SCS_0_BASE_ADDRESS_REMAP 0xcc8
480#define PCI_0SCS_1_BASE_ADDRESS_REMAP 0xd48
481#define PCI_1SCS_1_BASE_ADDRESS_REMAP 0xdc8
482#define PCI_0SCS_2_BASE_ADDRESS_REMAP 0xc4c
483#define PCI_1SCS_2_BASE_ADDRESS_REMAP 0xccc
484#define PCI_0SCS_3_BASE_ADDRESS_REMAP 0xd4c
485#define PCI_1SCS_3_BASE_ADDRESS_REMAP 0xdcc
486#define PCI_0CS_0_BASE_ADDRESS_REMAP 0xc50
487#define PCI_1CS_0_BASE_ADDRESS_REMAP 0xcd0
488#define PCI_0CS_1_BASE_ADDRESS_REMAP 0xd50
489#define PCI_1CS_1_BASE_ADDRESS_REMAP 0xdd0
490#define PCI_0CS_2_BASE_ADDRESS_REMAP 0xd58
491#define PCI_1CS_2_BASE_ADDRESS_REMAP 0xdd8
492#define PCI_0CS_3_BASE_ADDRESS_REMAP 0xc54
493#define PCI_1CS_3_BASE_ADDRESS_REMAP 0xcd4
494#define PCI_0CS_BOOTCS_BASE_ADDRESS_REMAP 0xd54
495#define PCI_1CS_BOOTCS_BASE_ADDRESS_REMAP 0xdd4
496#define PCI_0P2P_MEM0_BASE_ADDRESS_REMAP_LOW 0xd5c
497#define PCI_1P2P_MEM0_BASE_ADDRESS_REMAP_LOW 0xddc
498#define PCI_0P2P_MEM0_BASE_ADDRESS_REMAP_HIGH 0xd60
499#define PCI_1P2P_MEM0_BASE_ADDRESS_REMAP_HIGH 0xde0
500#define PCI_0P2P_MEM1_BASE_ADDRESS_REMAP_LOW 0xd64
501#define PCI_1P2P_MEM1_BASE_ADDRESS_REMAP_LOW 0xde4
502#define PCI_0P2P_MEM1_BASE_ADDRESS_REMAP_HIGH 0xd68
503#define PCI_1P2P_MEM1_BASE_ADDRESS_REMAP_HIGH 0xde8
504#define PCI_0P2P_I_O_BASE_ADDRESS_REMAP 0xd6c
505#define PCI_1P2P_I_O_BASE_ADDRESS_REMAP 0xdec
506#define PCI_0CPU_BASE_ADDRESS_REMAP 0xd70
507#define PCI_1CPU_BASE_ADDRESS_REMAP 0xdf0
508#define PCI_0DAC_SCS_0_BASE_ADDRESS_REMAP 0xf00
509#define PCI_1DAC_SCS_0_BASE_ADDRESS_REMAP 0xff0
510#define PCI_0DAC_SCS_1_BASE_ADDRESS_REMAP 0xf04
511#define PCI_1DAC_SCS_1_BASE_ADDRESS_REMAP 0xf84
512#define PCI_0DAC_SCS_2_BASE_ADDRESS_REMAP 0xf08
513#define PCI_1DAC_SCS_2_BASE_ADDRESS_REMAP 0xf88
514#define PCI_0DAC_SCS_3_BASE_ADDRESS_REMAP 0xf0c
515#define PCI_1DAC_SCS_3_BASE_ADDRESS_REMAP 0xf8c
516#define PCI_0DAC_CS_0_BASE_ADDRESS_REMAP 0xf10
517#define PCI_1DAC_CS_0_BASE_ADDRESS_REMAP 0xf90
518#define PCI_0DAC_CS_1_BASE_ADDRESS_REMAP 0xf14
519#define PCI_1DAC_CS_1_BASE_ADDRESS_REMAP 0xf94
520#define PCI_0DAC_CS_2_BASE_ADDRESS_REMAP 0xf18
521#define PCI_1DAC_CS_2_BASE_ADDRESS_REMAP 0xf98
522#define PCI_0DAC_CS_3_BASE_ADDRESS_REMAP 0xf1c
523#define PCI_1DAC_CS_3_BASE_ADDRESS_REMAP 0xf9c
524#define PCI_0DAC_BOOTCS_BASE_ADDRESS_REMAP 0xf20
525#define PCI_1DAC_BOOTCS_BASE_ADDRESS_REMAP 0xfa0
526#define PCI_0DAC_P2P_MEM0_BASE_ADDRESS_REMAP_LOW 0xf24
527#define PCI_1DAC_P2P_MEM0_BASE_ADDRESS_REMAP_LOW 0xfa4
528#define PCI_0DAC_P2P_MEM0_BASE_ADDRESS_REMAP_HIGH 0xf28
529#define PCI_1DAC_P2P_MEM0_BASE_ADDRESS_REMAP_HIGH 0xfa8
530#define PCI_0DAC_P2P_MEM1_BASE_ADDRESS_REMAP_LOW 0xf2c
531#define PCI_1DAC_P2P_MEM1_BASE_ADDRESS_REMAP_LOW 0xfac
532#define PCI_0DAC_P2P_MEM1_BASE_ADDRESS_REMAP_HIGH 0xf30
533#define PCI_1DAC_P2P_MEM1_BASE_ADDRESS_REMAP_HIGH 0xfb0
534#define PCI_0DAC_CPU_BASE_ADDRESS_REMAP 0xf34
535#define PCI_1DAC_CPU_BASE_ADDRESS_REMAP 0xfb4
536#define PCI_0EXPANSION_ROM_BASE_ADDRESS_REMAP 0xf38
537#define PCI_1EXPANSION_ROM_BASE_ADDRESS_REMAP 0xfb8
538#define PCI_0ADDRESS_DECODE_CONTROL 0xd3c
539#define PCI_1ADDRESS_DECODE_CONTROL 0xdbc
540
541/*
542 * PCI Control
543 */
544
545#define PCI_0COMMAND 0xc00
546#define PCI_1COMMAND 0xc80
547#define PCI_0MODE 0xd00
548#define PCI_1MODE 0xd80
549#define PCI_0TIMEOUT_RETRY 0xc04
550#define PCI_1TIMEOUT_RETRY 0xc84
551#define PCI_0READ_BUFFER_DISCARD_TIMER 0xd04
552#define PCI_1READ_BUFFER_DISCARD_TIMER 0xd84
553#define MSI_0TRIGGER_TIMER 0xc38
554#define MSI_1TRIGGER_TIMER 0xcb8
555#define PCI_0ARBITER_CONTROL 0x1d00
556#define PCI_1ARBITER_CONTROL 0x1d80
557/* changing untill here */
558#define PCI_0CROSS_BAR_CONTROL_LOW 0x1d08
559#define PCI_0CROSS_BAR_CONTROL_HIGH 0x1d0c
560#define PCI_0CROSS_BAR_TIMEOUT 0x1d04
561#define PCI_0READ_RESPONSE_CROSS_BAR_CONTROL_LOW 0x1d18
562#define PCI_0READ_RESPONSE_CROSS_BAR_CONTROL_HIGH 0x1d1c
563#define PCI_0SYNC_BARRIER_VIRTUAL_REGISTER 0x1d10
564#define PCI_0P2P_CONFIGURATION 0x1d14
565#define PCI_0ACCESS_CONTROL_BASE_0_LOW 0x1e00
566#define PCI_0ACCESS_CONTROL_BASE_0_HIGH 0x1e04
567#define PCI_0ACCESS_CONTROL_TOP_0 0x1e08
568#define PCI_0ACCESS_CONTROL_BASE_1_LOW 0c1e10
569#define PCI_0ACCESS_CONTROL_BASE_1_HIGH 0x1e14
570#define PCI_0ACCESS_CONTROL_TOP_1 0x1e18
571#define PCI_0ACCESS_CONTROL_BASE_2_LOW 0c1e20
572#define PCI_0ACCESS_CONTROL_BASE_2_HIGH 0x1e24
573#define PCI_0ACCESS_CONTROL_TOP_2 0x1e28
574#define PCI_0ACCESS_CONTROL_BASE_3_LOW 0c1e30
575#define PCI_0ACCESS_CONTROL_BASE_3_HIGH 0x1e34
576#define PCI_0ACCESS_CONTROL_TOP_3 0x1e38
577#define PCI_0ACCESS_CONTROL_BASE_4_LOW 0c1e40
578#define PCI_0ACCESS_CONTROL_BASE_4_HIGH 0x1e44
579#define PCI_0ACCESS_CONTROL_TOP_4 0x1e48
580#define PCI_0ACCESS_CONTROL_BASE_5_LOW 0c1e50
581#define PCI_0ACCESS_CONTROL_BASE_5_HIGH 0x1e54
582#define PCI_0ACCESS_CONTROL_TOP_5 0x1e58
583#define PCI_0ACCESS_CONTROL_BASE_6_LOW 0c1e60
584#define PCI_0ACCESS_CONTROL_BASE_6_HIGH 0x1e64
585#define PCI_0ACCESS_CONTROL_TOP_6 0x1e68
586#define PCI_0ACCESS_CONTROL_BASE_7_LOW 0c1e70
587#define PCI_0ACCESS_CONTROL_BASE_7_HIGH 0x1e74
588#define PCI_0ACCESS_CONTROL_TOP_7 0x1e78
589#define PCI_1CROSS_BAR_CONTROL_LOW 0x1d88
590#define PCI_1CROSS_BAR_CONTROL_HIGH 0x1d8c
591#define PCI_1CROSS_BAR_TIMEOUT 0x1d84
592#define PCI_1READ_RESPONSE_CROSS_BAR_CONTROL_LOW 0x1d98
593#define PCI_1READ_RESPONSE_CROSS_BAR_CONTROL_HIGH 0x1d9c
594#define PCI_1SYNC_BARRIER_VIRTUAL_REGISTER 0x1d90
595#define PCI_1P2P_CONFIGURATION 0x1d94
596#define PCI_1ACCESS_CONTROL_BASE_0_LOW 0x1e80
597#define PCI_1ACCESS_CONTROL_BASE_0_HIGH 0x1e84
598#define PCI_1ACCESS_CONTROL_TOP_0 0x1e88
599#define PCI_1ACCESS_CONTROL_BASE_1_LOW 0c1e90
600#define PCI_1ACCESS_CONTROL_BASE_1_HIGH 0x1e94
601#define PCI_1ACCESS_CONTROL_TOP_1 0x1e98
602#define PCI_1ACCESS_CONTROL_BASE_2_LOW 0c1ea0
603#define PCI_1ACCESS_CONTROL_BASE_2_HIGH 0x1ea4
604#define PCI_1ACCESS_CONTROL_TOP_2 0x1ea8
605#define PCI_1ACCESS_CONTROL_BASE_3_LOW 0c1eb0
606#define PCI_1ACCESS_CONTROL_BASE_3_HIGH 0x1eb4
607#define PCI_1ACCESS_CONTROL_TOP_3 0x1eb8
608#define PCI_1ACCESS_CONTROL_BASE_4_LOW 0c1ec0
609#define PCI_1ACCESS_CONTROL_BASE_4_HIGH 0x1ec4
610#define PCI_1ACCESS_CONTROL_TOP_4 0x1ec8
611#define PCI_1ACCESS_CONTROL_BASE_5_LOW 0c1ed0
612#define PCI_1ACCESS_CONTROL_BASE_5_HIGH 0x1ed4
613#define PCI_1ACCESS_CONTROL_TOP_5 0x1ed8
614#define PCI_1ACCESS_CONTROL_BASE_6_LOW 0c1ee0
615#define PCI_1ACCESS_CONTROL_BASE_6_HIGH 0x1ee4
616#define PCI_1ACCESS_CONTROL_TOP_6 0x1ee8
617#define PCI_1ACCESS_CONTROL_BASE_7_LOW 0c1ef0
618#define PCI_1ACCESS_CONTROL_BASE_7_HIGH 0x1ef4
619#define PCI_1ACCESS_CONTROL_TOP_7 0x1ef8
620
621/*
622 * PCI Snoop Control
623 */
624
625#define PCI_0SNOOP_CONTROL_BASE_0_LOW 0x1f00
626#define PCI_0SNOOP_CONTROL_BASE_0_HIGH 0x1f04
627#define PCI_0SNOOP_CONTROL_TOP_0 0x1f08
628#define PCI_0SNOOP_CONTROL_BASE_1_0_LOW 0x1f10
629#define PCI_0SNOOP_CONTROL_BASE_1_0_HIGH 0x1f14
630#define PCI_0SNOOP_CONTROL_TOP_1 0x1f18
631#define PCI_0SNOOP_CONTROL_BASE_2_0_LOW 0x1f20
632#define PCI_0SNOOP_CONTROL_BASE_2_0_HIGH 0x1f24
633#define PCI_0SNOOP_CONTROL_TOP_2 0x1f28
634#define PCI_0SNOOP_CONTROL_BASE_3_0_LOW 0x1f30
635#define PCI_0SNOOP_CONTROL_BASE_3_0_HIGH 0x1f34
636#define PCI_0SNOOP_CONTROL_TOP_3 0x1f38
637#define PCI_1SNOOP_CONTROL_BASE_0_LOW 0x1f80
638#define PCI_1SNOOP_CONTROL_BASE_0_HIGH 0x1f84
639#define PCI_1SNOOP_CONTROL_TOP_0 0x1f88
640#define PCI_1SNOOP_CONTROL_BASE_1_0_LOW 0x1f90
641#define PCI_1SNOOP_CONTROL_BASE_1_0_HIGH 0x1f94
642#define PCI_1SNOOP_CONTROL_TOP_1 0x1f98
643#define PCI_1SNOOP_CONTROL_BASE_2_0_LOW 0x1fa0
644#define PCI_1SNOOP_CONTROL_BASE_2_0_HIGH 0x1fa4
645#define PCI_1SNOOP_CONTROL_TOP_2 0x1fa8
646#define PCI_1SNOOP_CONTROL_BASE_3_0_LOW 0x1fb0
647#define PCI_1SNOOP_CONTROL_BASE_3_0_HIGH 0x1fb4
648#define PCI_1SNOOP_CONTROL_TOP_3 0x1fb8
649
650/*
651 * PCI Configuration Address
652 */
653
654#define PCI_0CONFIGURATION_ADDRESS 0xcf8
655#define PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER 0xcfc
656#define PCI_1CONFIGURATION_ADDRESS 0xc78
657#define PCI_1CONFIGURATION_DATA_VIRTUAL_REGISTER 0xc7c
658#define PCI_0INTERRUPT_ACKNOWLEDGE_VIRTUAL_REGISTER 0xc34
659#define PCI_1INTERRUPT_ACKNOWLEDGE_VIRTUAL_REGISTER 0xcb4
660
661/*
662 * PCI Error Report
663 */
664
665#define PCI_0SERR_MASK 0xc28
666#define PCI_0ERROR_ADDRESS_LOW 0x1d40
667#define PCI_0ERROR_ADDRESS_HIGH 0x1d44
668#define PCI_0ERROR_DATA_LOW 0x1d48
669#define PCI_0ERROR_DATA_HIGH 0x1d4c
670#define PCI_0ERROR_COMMAND 0x1d50
671#define PCI_0ERROR_CAUSE 0x1d58
672#define PCI_0ERROR_MASK 0x1d5c
673
674#define PCI_1SERR_MASK 0xca8
675#define PCI_1ERROR_ADDRESS_LOW 0x1dc0
676#define PCI_1ERROR_ADDRESS_HIGH 0x1dc4
677#define PCI_1ERROR_DATA_LOW 0x1dc8
678#define PCI_1ERROR_DATA_HIGH 0x1dcc
679#define PCI_1ERROR_COMMAND 0x1dd0
680#define PCI_1ERROR_CAUSE 0x1dd8
681#define PCI_1ERROR_MASK 0x1ddc
682
683
684/*
685 * Lslave Debug (for internal use)
686 */
687
688#define L_SLAVE_X0_ADDRESS 0x1d20
689#define L_SLAVE_X0_COMMAND_AND_ID 0x1d24
690#define L_SLAVE_X1_ADDRESS 0x1d28
691#define L_SLAVE_X1_COMMAND_AND_ID 0x1d2c
692#define L_SLAVE_WRITE_DATA_LOW 0x1d30
693#define L_SLAVE_WRITE_DATA_HIGH 0x1d34
694#define L_SLAVE_WRITE_BYTE_ENABLE 0x1d60
695#define L_SLAVE_READ_DATA_LOW 0x1d38
696#define L_SLAVE_READ_DATA_HIGH 0x1d3c
697#define L_SLAVE_READ_ID 0x1d64
698
699#if 0 /* Disabled because PCI_* namespace belongs to PCI subsystem ... */
700
701/*
702 * PCI Configuration Function 0
703 */
704
705#define PCI_DEVICE_AND_VENDOR_ID 0x000
706#define PCI_STATUS_AND_COMMAND 0x004
707#define PCI_CLASS_CODE_AND_REVISION_ID 0x008
708#define PCI_BIST_HEADER_TYPE_LATENCY_TIMER_CACHE_LINE 0x00C
709#define PCI_SCS_0_BASE_ADDRESS 0x010
710#define PCI_SCS_1_BASE_ADDRESS 0x014
711#define PCI_SCS_2_BASE_ADDRESS 0x018
712#define PCI_SCS_3_BASE_ADDRESS 0x01C
713#define PCI_INTERNAL_REGISTERS_MEMORY_MAPPED_BASE_ADDRESS 0x020
714#define PCI_INTERNAL_REGISTERS_I_OMAPPED_BASE_ADDRESS 0x024
715#define PCI_SUBSYSTEM_ID_AND_SUBSYSTEM_VENDOR_ID 0x02C
716#define PCI_EXPANSION_ROM_BASE_ADDRESS_REGISTER 0x030
717#define PCI_CAPABILTY_LIST_POINTER 0x034
718#define PCI_INTERRUPT_PIN_AND_LINE 0x03C
719#define PCI_POWER_MANAGEMENT_CAPABILITY 0x040
720#define PCI_POWER_MANAGEMENT_STATUS_AND_CONTROL 0x044
721#define PCI_VPD_ADDRESS 0x048
722#define PCI_VPD_DATA 0X04c
723#define PCI_MSI_MESSAGE_CONTROL 0x050
724#define PCI_MSI_MESSAGE_ADDRESS 0x054
725#define PCI_MSI_MESSAGE_UPPER_ADDRESS 0x058
726#define PCI_MSI_MESSAGE_DATA 0x05c
727#define PCI_COMPACT_PCI_HOT_SWAP_CAPABILITY 0x058
728
729/*
730 * PCI Configuration Function 1
731 */
732
733#define PCI_CS_0_BASE_ADDRESS 0x110
734#define PCI_CS_1_BASE_ADDRESS 0x114
735#define PCI_CS_2_BASE_ADDRESS 0x118
736#define PCI_CS_3_BASE_ADDRESS 0x11c
737#define PCI_BOOTCS_BASE_ADDRESS 0x120
738
739/*
740 * PCI Configuration Function 2
741 */
742
743#define PCI_P2P_MEM0_BASE_ADDRESS 0x210
744#define PCI_P2P_MEM1_BASE_ADDRESS 0x214
745#define PCI_P2P_I_O_BASE_ADDRESS 0x218
746#define PCI_CPU_BASE_ADDRESS 0x21c
747
748/*
749 * PCI Configuration Function 4
750 */
751
752#define PCI_DAC_SCS_0_BASE_ADDRESS_LOW 0x410
753#define PCI_DAC_SCS_0_BASE_ADDRESS_HIGH 0x414
754#define PCI_DAC_SCS_1_BASE_ADDRESS_LOW 0x418
755#define PCI_DAC_SCS_1_BASE_ADDRESS_HIGH 0x41c
756#define PCI_DAC_P2P_MEM0_BASE_ADDRESS_LOW 0x420
757#define PCI_DAC_P2P_MEM0_BASE_ADDRESS_HIGH 0x424
758
759
760/*
761 * PCI Configuration Function 5
762 */
763
764#define PCI_DAC_SCS_2_BASE_ADDRESS_LOW 0x510
765#define PCI_DAC_SCS_2_BASE_ADDRESS_HIGH 0x514
766#define PCI_DAC_SCS_3_BASE_ADDRESS_LOW 0x518
767#define PCI_DAC_SCS_3_BASE_ADDRESS_HIGH 0x51c
768#define PCI_DAC_P2P_MEM1_BASE_ADDRESS_LOW 0x520
769#define PCI_DAC_P2P_MEM1_BASE_ADDRESS_HIGH 0x524
770
771
772/*
773 * PCI Configuration Function 6
774 */
775
776#define PCI_DAC_CS_0_BASE_ADDRESS_LOW 0x610
777#define PCI_DAC_CS_0_BASE_ADDRESS_HIGH 0x614
778#define PCI_DAC_CS_1_BASE_ADDRESS_LOW 0x618
779#define PCI_DAC_CS_1_BASE_ADDRESS_HIGH 0x61c
780#define PCI_DAC_CS_2_BASE_ADDRESS_LOW 0x620
781#define PCI_DAC_CS_2_BASE_ADDRESS_HIGH 0x624
782
783/*
784 * PCI Configuration Function 7
785 */
786
787#define PCI_DAC_CS_3_BASE_ADDRESS_LOW 0x710
788#define PCI_DAC_CS_3_BASE_ADDRESS_HIGH 0x714
789#define PCI_DAC_BOOTCS_BASE_ADDRESS_LOW 0x718
790#define PCI_DAC_BOOTCS_BASE_ADDRESS_HIGH 0x71c
791#define PCI_DAC_CPU_BASE_ADDRESS_LOW 0x720
792#define PCI_DAC_CPU_BASE_ADDRESS_HIGH 0x724
793#endif
794
795/*
796 * Interrupts
797 */
798
799#define LOW_INTERRUPT_CAUSE_REGISTER 0xc18
800#define HIGH_INTERRUPT_CAUSE_REGISTER 0xc68
801#define CPU_INTERRUPT_MASK_REGISTER_LOW 0xc1c
802#define CPU_INTERRUPT_MASK_REGISTER_HIGH 0xc6c
803#define CPU_SELECT_CAUSE_REGISTER 0xc70
804#define PCI_0INTERRUPT_CAUSE_MASK_REGISTER_LOW 0xc24
805#define PCI_0INTERRUPT_CAUSE_MASK_REGISTER_HIGH 0xc64
806#define PCI_0SELECT_CAUSE 0xc74
807#define PCI_1INTERRUPT_CAUSE_MASK_REGISTER_LOW 0xca4
808#define PCI_1INTERRUPT_CAUSE_MASK_REGISTER_HIGH 0xce4
809#define PCI_1SELECT_CAUSE 0xcf4
810#define CPU_INT_0_MASK 0xe60
811#define CPU_INT_1_MASK 0xe64
812#define CPU_INT_2_MASK 0xe68
813#define CPU_INT_3_MASK 0xe6c
814
815/*
816 * I20 Support registers
817 */
818
819#define INBOUND_MESSAGE_REGISTER0_PCI0_SIDE 0x010
820#define INBOUND_MESSAGE_REGISTER1_PCI0_SIDE 0x014
821#define OUTBOUND_MESSAGE_REGISTER0_PCI0_SIDE 0x018
822#define OUTBOUND_MESSAGE_REGISTER1_PCI0_SIDE 0x01C
823#define INBOUND_DOORBELL_REGISTER_PCI0_SIDE 0x020
824#define INBOUND_INTERRUPT_CAUSE_REGISTER_PCI0_SIDE 0x024
825#define INBOUND_INTERRUPT_MASK_REGISTER_PCI0_SIDE 0x028
826#define OUTBOUND_DOORBELL_REGISTER_PCI0_SIDE 0x02C
827#define OUTBOUND_INTERRUPT_CAUSE_REGISTER_PCI0_SIDE 0x030
828#define OUTBOUND_INTERRUPT_MASK_REGISTER_PCI0_SIDE 0x034
829#define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI0_SIDE 0x040
830#define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI0_SIDE 0x044
831#define QUEUE_CONTROL_REGISTER_PCI0_SIDE 0x050
832#define QUEUE_BASE_ADDRESS_REGISTER_PCI0_SIDE 0x054
833#define INBOUND_FREE_HEAD_POINTER_REGISTER_PCI0_SIDE 0x060
834#define INBOUND_FREE_TAIL_POINTER_REGISTER_PCI0_SIDE 0x064
835#define INBOUND_POST_HEAD_POINTER_REGISTER_PCI0_SIDE 0x068
836#define INBOUND_POST_TAIL_POINTER_REGISTER_PCI0_SIDE 0x06C
837#define OUTBOUND_FREE_HEAD_POINTER_REGISTER_PCI0_SIDE 0x070
838#define OUTBOUND_FREE_TAIL_POINTER_REGISTER_PCI0_SIDE 0x074
839#define OUTBOUND_POST_HEAD_POINTER_REGISTER_PCI0_SIDE 0x0F8
840#define OUTBOUND_POST_TAIL_POINTER_REGISTER_PCI0_SIDE 0x0FC
841
842#define INBOUND_MESSAGE_REGISTER0_PCI1_SIDE 0x090
843#define INBOUND_MESSAGE_REGISTER1_PCI1_SIDE 0x094
844#define OUTBOUND_MESSAGE_REGISTER0_PCI1_SIDE 0x098
845#define OUTBOUND_MESSAGE_REGISTER1_PCI1_SIDE 0x09C
846#define INBOUND_DOORBELL_REGISTER_PCI1_SIDE 0x0A0
847#define INBOUND_INTERRUPT_CAUSE_REGISTER_PCI1_SIDE 0x0A4
848#define INBOUND_INTERRUPT_MASK_REGISTER_PCI1_SIDE 0x0A8
849#define OUTBOUND_DOORBELL_REGISTER_PCI1_SIDE 0x0AC
850#define OUTBOUND_INTERRUPT_CAUSE_REGISTER_PCI1_SIDE 0x0B0
851#define OUTBOUND_INTERRUPT_MASK_REGISTER_PCI1_SIDE 0x0B4
852#define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI1_SIDE 0x0C0
853#define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_PCI1_SIDE 0x0C4
854#define QUEUE_CONTROL_REGISTER_PCI1_SIDE 0x0D0
855#define QUEUE_BASE_ADDRESS_REGISTER_PCI1_SIDE 0x0D4
856#define INBOUND_FREE_HEAD_POINTER_REGISTER_PCI1_SIDE 0x0E0
857#define INBOUND_FREE_TAIL_POINTER_REGISTER_PCI1_SIDE 0x0E4
858#define INBOUND_POST_HEAD_POINTER_REGISTER_PCI1_SIDE 0x0E8
859#define INBOUND_POST_TAIL_POINTER_REGISTER_PCI1_SIDE 0x0EC
860#define OUTBOUND_FREE_HEAD_POINTER_REGISTER_PCI1_SIDE 0x0F0
861#define OUTBOUND_FREE_TAIL_POINTER_REGISTER_PCI1_SIDE 0x0F4
862#define OUTBOUND_POST_HEAD_POINTER_REGISTER_PCI1_SIDE 0x078
863#define OUTBOUND_POST_TAIL_POINTER_REGISTER_PCI1_SIDE 0x07C
864
865#define INBOUND_MESSAGE_REGISTER0_CPU0_SIDE 0X1C10
866#define INBOUND_MESSAGE_REGISTER1_CPU0_SIDE 0X1C14
867#define OUTBOUND_MESSAGE_REGISTER0_CPU0_SIDE 0X1C18
868#define OUTBOUND_MESSAGE_REGISTER1_CPU0_SIDE 0X1C1C
869#define INBOUND_DOORBELL_REGISTER_CPU0_SIDE 0X1C20
870#define INBOUND_INTERRUPT_CAUSE_REGISTER_CPU0_SIDE 0X1C24
871#define INBOUND_INTERRUPT_MASK_REGISTER_CPU0_SIDE 0X1C28
872#define OUTBOUND_DOORBELL_REGISTER_CPU0_SIDE 0X1C2C
873#define OUTBOUND_INTERRUPT_CAUSE_REGISTER_CPU0_SIDE 0X1C30
874#define OUTBOUND_INTERRUPT_MASK_REGISTER_CPU0_SIDE 0X1C34
875#define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU0_SIDE 0X1C40
876#define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU0_SIDE 0X1C44
877#define QUEUE_CONTROL_REGISTER_CPU0_SIDE 0X1C50
878#define QUEUE_BASE_ADDRESS_REGISTER_CPU0_SIDE 0X1C54
879#define INBOUND_FREE_HEAD_POINTER_REGISTER_CPU0_SIDE 0X1C60
880#define INBOUND_FREE_TAIL_POINTER_REGISTER_CPU0_SIDE 0X1C64
881#define INBOUND_POST_HEAD_POINTER_REGISTER_CPU0_SIDE 0X1C68
882#define INBOUND_POST_TAIL_POINTER_REGISTER_CPU0_SIDE 0X1C6C
883#define OUTBOUND_FREE_HEAD_POINTER_REGISTER_CPU0_SIDE 0X1C70
884#define OUTBOUND_FREE_TAIL_POINTER_REGISTER_CPU0_SIDE 0X1C74
885#define OUTBOUND_POST_HEAD_POINTER_REGISTER_CPU0_SIDE 0X1CF8
886#define OUTBOUND_POST_TAIL_POINTER_REGISTER_CPU0_SIDE 0X1CFC
887
888#define INBOUND_MESSAGE_REGISTER0_CPU1_SIDE 0X1C90
889#define INBOUND_MESSAGE_REGISTER1_CPU1_SIDE 0X1C94
890#define OUTBOUND_MESSAGE_REGISTER0_CPU1_SIDE 0X1C98
891#define OUTBOUND_MESSAGE_REGISTER1_CPU1_SIDE 0X1C9C
892#define INBOUND_DOORBELL_REGISTER_CPU1_SIDE 0X1CA0
893#define INBOUND_INTERRUPT_CAUSE_REGISTER_CPU1_SIDE 0X1CA4
894#define INBOUND_INTERRUPT_MASK_REGISTER_CPU1_SIDE 0X1CA8
895#define OUTBOUND_DOORBELL_REGISTER_CPU1_SIDE 0X1CAC
896#define OUTBOUND_INTERRUPT_CAUSE_REGISTER_CPU1_SIDE 0X1CB0
897#define OUTBOUND_INTERRUPT_MASK_REGISTER_CPU1_SIDE 0X1CB4
898#define INBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU1_SIDE 0X1CC0
899#define OUTBOUND_QUEUE_PORT_VIRTUAL_REGISTER_CPU1_SIDE 0X1CC4
900#define QUEUE_CONTROL_REGISTER_CPU1_SIDE 0X1CD0
901#define QUEUE_BASE_ADDRESS_REGISTER_CPU1_SIDE 0X1CD4
902#define INBOUND_FREE_HEAD_POINTER_REGISTER_CPU1_SIDE 0X1CE0
903#define INBOUND_FREE_TAIL_POINTER_REGISTER_CPU1_SIDE 0X1CE4
904#define INBOUND_POST_HEAD_POINTER_REGISTER_CPU1_SIDE 0X1CE8
905#define INBOUND_POST_TAIL_POINTER_REGISTER_CPU1_SIDE 0X1CEC
906#define OUTBOUND_FREE_HEAD_POINTER_REGISTER_CPU1_SIDE 0X1CF0
907#define OUTBOUND_FREE_TAIL_POINTER_REGISTER_CPU1_SIDE 0X1CF4
908#define OUTBOUND_POST_HEAD_POINTER_REGISTER_CPU1_SIDE 0X1C78
909#define OUTBOUND_POST_TAIL_POINTER_REGISTER_CPU1_SIDE 0X1C7C
910
911/*
912 * Communication Unit Registers
913 */
914
915#define ETHERNET_0_ADDRESS_CONTROL_LOW
916#define ETHERNET_0_ADDRESS_CONTROL_HIGH 0xf204
917#define ETHERNET_0_RECEIVE_BUFFER_PCI_HIGH_ADDRESS 0xf208
918#define ETHERNET_0_TRANSMIT_BUFFER_PCI_HIGH_ADDRESS 0xf20c
919#define ETHERNET_0_RECEIVE_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf210
920#define ETHERNET_0_TRANSMIT_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf214
921#define ETHERNET_0_HASH_TABLE_PCI_HIGH_ADDRESS 0xf218
922#define ETHERNET_1_ADDRESS_CONTROL_LOW 0xf220
923#define ETHERNET_1_ADDRESS_CONTROL_HIGH 0xf224
924#define ETHERNET_1_RECEIVE_BUFFER_PCI_HIGH_ADDRESS 0xf228
925#define ETHERNET_1_TRANSMIT_BUFFER_PCI_HIGH_ADDRESS 0xf22c
926#define ETHERNET_1_RECEIVE_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf230
927#define ETHERNET_1_TRANSMIT_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf234
928#define ETHERNET_1_HASH_TABLE_PCI_HIGH_ADDRESS 0xf238
929#define ETHERNET_2_ADDRESS_CONTROL_LOW 0xf240
930#define ETHERNET_2_ADDRESS_CONTROL_HIGH 0xf244
931#define ETHERNET_2_RECEIVE_BUFFER_PCI_HIGH_ADDRESS 0xf248
932#define ETHERNET_2_TRANSMIT_BUFFER_PCI_HIGH_ADDRESS 0xf24c
933#define ETHERNET_2_RECEIVE_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf250
934#define ETHERNET_2_TRANSMIT_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf254
935#define ETHERNET_2_HASH_TABLE_PCI_HIGH_ADDRESS 0xf258
936#define MPSC_0_ADDRESS_CONTROL_LOW 0xf280
937#define MPSC_0_ADDRESS_CONTROL_HIGH 0xf284
938#define MPSC_0_RECEIVE_BUFFER_PCI_HIGH_ADDRESS 0xf288
939#define MPSC_0_TRANSMIT_BUFFER_PCI_HIGH_ADDRESS 0xf28c
940#define MPSC_0_RECEIVE_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf290
941#define MPSC_0_TRANSMIT_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf294
942#define MPSC_1_ADDRESS_CONTROL_LOW 0xf2a0
943#define MPSC_1_ADDRESS_CONTROL_HIGH 0xf2a4
944#define MPSC_1_RECEIVE_BUFFER_PCI_HIGH_ADDRESS 0xf2a8
945#define MPSC_1_TRANSMIT_BUFFER_PCI_HIGH_ADDRESS 0xf2ac
946#define MPSC_1_RECEIVE_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf2b0
947#define MPSC_1_TRANSMIT_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf2b4
948#define MPSC_2_ADDRESS_CONTROL_LOW 0xf2c0
949#define MPSC_2_ADDRESS_CONTROL_HIGH 0xf2c4
950#define MPSC_2_RECEIVE_BUFFER_PCI_HIGH_ADDRESS 0xf2c8
951#define MPSC_2_TRANSMIT_BUFFER_PCI_HIGH_ADDRESS 0xf2cc
952#define MPSC_2_RECEIVE_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf2d0
953#define MPSC_2_TRANSMIT_DESCRIPTOR_PCI_HIGH_ADDRESS 0xf2d4
954#define SERIAL_INIT_PCI_HIGH_ADDRESS 0xf320
955#define SERIAL_INIT_LAST_DATA 0xf324
956#define SERIAL_INIT_STATUS_AND_CONTROL 0xf328
957#define COMM_UNIT_ARBITER_CONTROL 0xf300
958#define COMM_UNIT_CROSS_BAR_TIMEOUT 0xf304
959#define COMM_UNIT_INTERRUPT_CAUSE 0xf310
960#define COMM_UNIT_INTERRUPT_MASK 0xf314
961#define COMM_UNIT_ERROR_ADDRESS 0xf314
962
963/*
964 * Cunit Debug (for internal use)
965 */
966
967#define CUNIT_ADDRESS 0xf340
968#define CUNIT_COMMAND_AND_ID 0xf344
969#define CUNIT_WRITE_DATA_LOW 0xf348
970#define CUNIT_WRITE_DATA_HIGH 0xf34c
971#define CUNIT_WRITE_BYTE_ENABLE 0xf358
972#define CUNIT_READ_DATA_LOW 0xf350
973#define CUNIT_READ_DATA_HIGH 0xf354
974#define CUNIT_READ_ID 0xf35c
975
976/*
977 * Fast Ethernet Unit Registers
978 */
979
980/* Ethernet */
981
982#define ETHERNET_PHY_ADDRESS_REGISTER 0x2000
983#define ETHERNET_SMI_REGISTER 0x2010
984
985/* Ethernet 0 */
986
987#define ETHERNET0_PORT_CONFIGURATION_REGISTER 0x2400
988#define ETHERNET0_PORT_CONFIGURATION_EXTEND_REGISTER 0x2408
989#define ETHERNET0_PORT_COMMAND_REGISTER 0x2410
990#define ETHERNET0_PORT_STATUS_REGISTER 0x2418
991#define ETHERNET0_SERIAL_PARAMETRS_REGISTER 0x2420
992#define ETHERNET0_HASH_TABLE_POINTER_REGISTER 0x2428
993#define ETHERNET0_FLOW_CONTROL_SOURCE_ADDRESS_LOW 0x2430
994#define ETHERNET0_FLOW_CONTROL_SOURCE_ADDRESS_HIGH 0x2438
995#define ETHERNET0_SDMA_CONFIGURATION_REGISTER 0x2440
996#define ETHERNET0_SDMA_COMMAND_REGISTER 0x2448
997#define ETHERNET0_INTERRUPT_CAUSE_REGISTER 0x2450
998#define ETHERNET0_INTERRUPT_MASK_REGISTER 0x2458
999#define ETHERNET0_FIRST_RX_DESCRIPTOR_POINTER0 0x2480
1000#define ETHERNET0_FIRST_RX_DESCRIPTOR_POINTER1 0x2484
1001#define ETHERNET0_FIRST_RX_DESCRIPTOR_POINTER2 0x2488
1002#define ETHERNET0_FIRST_RX_DESCRIPTOR_POINTER3 0x248c
1003#define ETHERNET0_CURRENT_RX_DESCRIPTOR_POINTER0 0x24a0
1004#define ETHERNET0_CURRENT_RX_DESCRIPTOR_POINTER1 0x24a4
1005#define ETHERNET0_CURRENT_RX_DESCRIPTOR_POINTER2 0x24a8
1006#define ETHERNET0_CURRENT_RX_DESCRIPTOR_POINTER3 0x24ac
1007#define ETHERNET0_CURRENT_TX_DESCRIPTOR_POINTER0 0x24e0
1008#define ETHERNET0_CURRENT_TX_DESCRIPTOR_POINTER1 0x24e4
1009#define ETHERNET0_MIB_COUNTER_BASE 0x2500
1010
1011/* Ethernet 1 */
1012
1013#define ETHERNET1_PORT_CONFIGURATION_REGISTER 0x2800
1014#define ETHERNET1_PORT_CONFIGURATION_EXTEND_REGISTER 0x2808
1015#define ETHERNET1_PORT_COMMAND_REGISTER 0x2810
1016#define ETHERNET1_PORT_STATUS_REGISTER 0x2818
1017#define ETHERNET1_SERIAL_PARAMETRS_REGISTER 0x2820
1018#define ETHERNET1_HASH_TABLE_POINTER_REGISTER 0x2828
1019#define ETHERNET1_FLOW_CONTROL_SOURCE_ADDRESS_LOW 0x2830
1020#define ETHERNET1_FLOW_CONTROL_SOURCE_ADDRESS_HIGH 0x2838
1021#define ETHERNET1_SDMA_CONFIGURATION_REGISTER 0x2840
1022#define ETHERNET1_SDMA_COMMAND_REGISTER 0x2848
1023#define ETHERNET1_INTERRUPT_CAUSE_REGISTER 0x2850
1024#define ETHERNET1_INTERRUPT_MASK_REGISTER 0x2858
1025#define ETHERNET1_FIRST_RX_DESCRIPTOR_POINTER0 0x2880
1026#define ETHERNET1_FIRST_RX_DESCRIPTOR_POINTER1 0x2884
1027#define ETHERNET1_FIRST_RX_DESCRIPTOR_POINTER2 0x2888
1028#define ETHERNET1_FIRST_RX_DESCRIPTOR_POINTER3 0x288c
1029#define ETHERNET1_CURRENT_RX_DESCRIPTOR_POINTER0 0x28a0
1030#define ETHERNET1_CURRENT_RX_DESCRIPTOR_POINTER1 0x28a4
1031#define ETHERNET1_CURRENT_RX_DESCRIPTOR_POINTER2 0x28a8
1032#define ETHERNET1_CURRENT_RX_DESCRIPTOR_POINTER3 0x28ac
1033#define ETHERNET1_CURRENT_TX_DESCRIPTOR_POINTER0 0x28e0
1034#define ETHERNET1_CURRENT_TX_DESCRIPTOR_POINTER1 0x28e4
1035#define ETHERNET1_MIB_COUNTER_BASE 0x2900
1036
1037/* Ethernet 2 */
1038
1039#define ETHERNET2_PORT_CONFIGURATION_REGISTER 0x2c00
1040#define ETHERNET2_PORT_CONFIGURATION_EXTEND_REGISTER 0x2c08
1041#define ETHERNET2_PORT_COMMAND_REGISTER 0x2c10
1042#define ETHERNET2_PORT_STATUS_REGISTER 0x2c18
1043#define ETHERNET2_SERIAL_PARAMETRS_REGISTER 0x2c20
1044#define ETHERNET2_HASH_TABLE_POINTER_REGISTER 0x2c28
1045#define ETHERNET2_FLOW_CONTROL_SOURCE_ADDRESS_LOW 0x2c30
1046#define ETHERNET2_FLOW_CONTROL_SOURCE_ADDRESS_HIGH 0x2c38
1047#define ETHERNET2_SDMA_CONFIGURATION_REGISTER 0x2c40
1048#define ETHERNET2_SDMA_COMMAND_REGISTER 0x2c48
1049#define ETHERNET2_INTERRUPT_CAUSE_REGISTER 0x2c50
1050#define ETHERNET2_INTERRUPT_MASK_REGISTER 0x2c58
1051#define ETHERNET2_FIRST_RX_DESCRIPTOR_POINTER0 0x2c80
1052#define ETHERNET2_FIRST_RX_DESCRIPTOR_POINTER1 0x2c84
1053#define ETHERNET2_FIRST_RX_DESCRIPTOR_POINTER2 0x2c88
1054#define ETHERNET2_FIRST_RX_DESCRIPTOR_POINTER3 0x2c8c
1055#define ETHERNET2_CURRENT_RX_DESCRIPTOR_POINTER0 0x2ca0
1056#define ETHERNET2_CURRENT_RX_DESCRIPTOR_POINTER1 0x2ca4
1057#define ETHERNET2_CURRENT_RX_DESCRIPTOR_POINTER2 0x2ca8
1058#define ETHERNET2_CURRENT_RX_DESCRIPTOR_POINTER3 0x2cac
1059#define ETHERNET2_CURRENT_TX_DESCRIPTOR_POINTER0 0x2ce0
1060#define ETHERNET2_CURRENT_TX_DESCRIPTOR_POINTER1 0x2ce4
1061#define ETHERNET2_MIB_COUNTER_BASE 0x2d00
1062
1063/*
1064 * SDMA Registers
1065 */
1066
1067#define SDMA_GROUP_CONFIGURATION_REGISTER 0xb1f0
1068#define CHANNEL0_CONFIGURATION_REGISTER 0x4000
1069#define CHANNEL0_COMMAND_REGISTER 0x4008
1070#define CHANNEL0_RX_CMD_STATUS 0x4800
1071#define CHANNEL0_RX_PACKET_AND_BUFFER_SIZES 0x4804
1072#define CHANNEL0_RX_BUFFER_POINTER 0x4808
1073#define CHANNEL0_RX_NEXT_POINTER 0x480c
1074#define CHANNEL0_CURRENT_RX_DESCRIPTOR_POINTER 0x4810
1075#define CHANNEL0_TX_CMD_STATUS 0x4C00
1076#define CHANNEL0_TX_PACKET_SIZE 0x4C04
1077#define CHANNEL0_TX_BUFFER_POINTER 0x4C08
1078#define CHANNEL0_TX_NEXT_POINTER 0x4C0c
1079#define CHANNEL0_CURRENT_TX_DESCRIPTOR_POINTER 0x4c10
1080#define CHANNEL0_FIRST_TX_DESCRIPTOR_POINTER 0x4c14
1081#define CHANNEL1_CONFIGURATION_REGISTER 0x6000
1082#define CHANNEL1_COMMAND_REGISTER 0x6008
1083#define CHANNEL1_RX_CMD_STATUS 0x6800
1084#define CHANNEL1_RX_PACKET_AND_BUFFER_SIZES 0x6804
1085#define CHANNEL1_RX_BUFFER_POINTER 0x6808
1086#define CHANNEL1_RX_NEXT_POINTER 0x680c
1087#define CHANNEL1_CURRENT_RX_DESCRIPTOR_POINTER 0x6810
1088#define CHANNEL1_TX_CMD_STATUS 0x6C00
1089#define CHANNEL1_TX_PACKET_SIZE 0x6C04
1090#define CHANNEL1_TX_BUFFER_POINTER 0x6C08
1091#define CHANNEL1_TX_NEXT_POINTER 0x6C0c
1092#define CHANNEL1_CURRENT_RX_DESCRIPTOR_POINTER 0x6810
1093#define CHANNEL1_CURRENT_TX_DESCRIPTOR_POINTER 0x6c10
1094#define CHANNEL1_FIRST_TX_DESCRIPTOR_POINTER 0x6c14
1095
1096/* SDMA Interrupt */
1097
1098#define SDMA_CAUSE 0xb820
1099#define SDMA_MASK 0xb8a0
1100
1101
1102/*
1103 * Baude Rate Generators Registers
1104 */
1105
1106/* BRG 0 */
1107
1108#define BRG0_CONFIGURATION_REGISTER 0xb200
1109#define BRG0_BAUDE_TUNING_REGISTER 0xb204
1110
1111/* BRG 1 */
1112
1113#define BRG1_CONFIGURATION_REGISTER 0xb208
1114#define BRG1_BAUDE_TUNING_REGISTER 0xb20c
1115
1116/* BRG 2 */
1117
1118#define BRG2_CONFIGURATION_REGISTER 0xb210
1119#define BRG2_BAUDE_TUNING_REGISTER 0xb214
1120
1121/* BRG Interrupts */
1122
1123#define BRG_CAUSE_REGISTER 0xb834
1124#define BRG_MASK_REGISTER 0xb8b4
1125
1126/* MISC */
1127
1128#define MAIN_ROUTING_REGISTER 0xb400
1129#define RECEIVE_CLOCK_ROUTING_REGISTER 0xb404
1130#define TRANSMIT_CLOCK_ROUTING_REGISTER 0xb408
1131#define COMM_UNIT_ARBITER_CONFIGURATION_REGISTER 0xb40c
1132#define WATCHDOG_CONFIGURATION_REGISTER 0xb410
1133#define WATCHDOG_VALUE_REGISTER 0xb414
1134
1135
1136/*
1137 * Flex TDM Registers
1138 */
1139
1140/* FTDM Port */
1141
1142#define FLEXTDM_TRANSMIT_READ_POINTER 0xa800
1143#define FLEXTDM_RECEIVE_READ_POINTER 0xa804
1144#define FLEXTDM_CONFIGURATION_REGISTER 0xa808
1145#define FLEXTDM_AUX_CHANNELA_TX_REGISTER 0xa80c
1146#define FLEXTDM_AUX_CHANNELA_RX_REGISTER 0xa810
1147#define FLEXTDM_AUX_CHANNELB_TX_REGISTER 0xa814
1148#define FLEXTDM_AUX_CHANNELB_RX_REGISTER 0xa818
1149
1150/* FTDM Interrupts */
1151
1152#define FTDM_CAUSE_REGISTER 0xb830
1153#define FTDM_MASK_REGISTER 0xb8b0
1154
1155
1156/*
1157 * GPP Interface Registers
1158 */
1159
1160#define GPP_IO_CONTROL 0xf100
1161#define GPP_LEVEL_CONTROL 0xf110
1162#define GPP_VALUE 0xf104
1163#define GPP_INTERRUPT_CAUSE 0xf108
1164#define GPP_INTERRUPT_MASK 0xf10c
1165
1166#define MPP_CONTROL0 0xf000
1167#define MPP_CONTROL1 0xf004
1168#define MPP_CONTROL2 0xf008
1169#define MPP_CONTROL3 0xf00c
1170#define DEBUG_PORT_MULTIPLEX 0xf014
1171#define SERIAL_PORT_MULTIPLEX 0xf010
1172
1173/*
1174 * I2C Registers
1175 */
1176
1177#define I2C_SLAVE_ADDRESS 0xc000
1178#define I2C_EXTENDED_SLAVE_ADDRESS 0xc040
1179#define I2C_DATA 0xc004
1180#define I2C_CONTROL 0xc008
1181#define I2C_STATUS_BAUDE_RATE 0xc00C
1182#define I2C_SOFT_RESET 0xc01c
1183
1184/*
1185 * MPSC Registers
1186 */
1187
1188/*
1189 * MPSC0
1190 */
1191
1192#define MPSC0_MAIN_CONFIGURATION_LOW 0x8000
1193#define MPSC0_MAIN_CONFIGURATION_HIGH 0x8004
1194#define MPSC0_PROTOCOL_CONFIGURATION 0x8008
1195#define CHANNEL0_REGISTER1 0x800c
1196#define CHANNEL0_REGISTER2 0x8010
1197#define CHANNEL0_REGISTER3 0x8014
1198#define CHANNEL0_REGISTER4 0x8018
1199#define CHANNEL0_REGISTER5 0x801c
1200#define CHANNEL0_REGISTER6 0x8020
1201#define CHANNEL0_REGISTER7 0x8024
1202#define CHANNEL0_REGISTER8 0x8028
1203#define CHANNEL0_REGISTER9 0x802c
1204#define CHANNEL0_REGISTER10 0x8030
1205#define CHANNEL0_REGISTER11 0x8034
1206
1207/*
1208 * MPSC1
1209 */
1210
1211#define MPSC1_MAIN_CONFIGURATION_LOW 0x9000
1212#define MPSC1_MAIN_CONFIGURATION_HIGH 0x9004
1213#define MPSC1_PROTOCOL_CONFIGURATION 0x9008
1214#define CHANNEL1_REGISTER1 0x900c
1215#define CHANNEL1_REGISTER2 0x9010
1216#define CHANNEL1_REGISTER3 0x9014
1217#define CHANNEL1_REGISTER4 0x9018
1218#define CHANNEL1_REGISTER5 0x901c
1219#define CHANNEL1_REGISTER6 0x9020
1220#define CHANNEL1_REGISTER7 0x9024
1221#define CHANNEL1_REGISTER8 0x9028
1222#define CHANNEL1_REGISTER9 0x902c
1223#define CHANNEL1_REGISTER10 0x9030
1224#define CHANNEL1_REGISTER11 0x9034
1225
1226/*
1227 * MPSCs Interupts
1228 */
1229
1230#define MPSC0_CAUSE 0xb804
1231#define MPSC0_MASK 0xb884
1232#define MPSC1_CAUSE 0xb80c
1233#define MPSC1_MASK 0xb88c
1234
1235#endif /* __ASM_MIPS_MV64240_H */
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h
index d9119f43f9aa..6a5fa32f615b 100644
--- a/include/asm-mips/hazards.h
+++ b/include/asm-mips/hazards.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) 2003, 2004 Ralf Baechle <ralf@linux-mips.org> 6 * Copyright (C) 2003, 04, 07 Ralf Baechle <ralf@linux-mips.org>
7 * Copyright (C) MIPS Technologies, Inc. 7 * Copyright (C) MIPS Technologies, Inc.
8 * written by Ralf Baechle <ralf@linux-mips.org> 8 * written by Ralf Baechle <ralf@linux-mips.org>
9 */ 9 */
@@ -23,6 +23,11 @@ static inline void name(void) \
23 __asm__ __volatile__ (#name); \ 23 __asm__ __volatile__ (#name); \
24} 24}
25 25
26/*
27 * MIPS R2 instruction hazard barrier. Needs to be called as a subroutine.
28 */
29extern void mips_ihb(void);
30
26#endif 31#endif
27 32
28ASMMACRO(_ssnop, 33ASMMACRO(_ssnop,
@@ -167,6 +172,7 @@ ASMMACRO(tlb_probe_hazard,
167 nop; nop; nop 172 nop; nop; nop
168 ) 173 )
169ASMMACRO(irq_enable_hazard, 174ASMMACRO(irq_enable_hazard,
175 _ssnop; _ssnop; _ssnop;
170 ) 176 )
171ASMMACRO(irq_disable_hazard, 177ASMMACRO(irq_disable_hazard,
172 nop; nop; nop 178 nop; nop; nop
diff --git a/include/asm-mips/ioctls.h b/include/asm-mips/ioctls.h
index 92f6c36aac4d..5097cbf183a9 100644
--- a/include/asm-mips/ioctls.h
+++ b/include/asm-mips/ioctls.h
@@ -77,6 +77,10 @@
77#define TIOCSBRK 0x5427 /* BSD compatibility */ 77#define TIOCSBRK 0x5427 /* BSD compatibility */
78#define TIOCCBRK 0x5428 /* BSD compatibility */ 78#define TIOCCBRK 0x5428 /* BSD compatibility */
79#define TIOCGSID 0x7416 /* Return the session ID of FD */ 79#define TIOCGSID 0x7416 /* Return the session ID of FD */
80#define TCGETS2 _IOR('T',0x2A, struct termios2)
81#define TCSETS2 _IOW('T',0x2B, struct termios2)
82#define TCSETSW2 _IOW('T',0x2C, struct termios2)
83#define TCSETSF2 _IOW('T',0x2D, struct termios2)
80#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 84#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
81#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 85#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
82 86
diff --git a/include/asm-mips/jmr3927/jmr3927.h b/include/asm-mips/jmr3927/jmr3927.h
index 958e29706e2d..b2dc35f56181 100644
--- a/include/asm-mips/jmr3927/jmr3927.h
+++ b/include/asm-mips/jmr3927/jmr3927.h
@@ -13,6 +13,7 @@
13#include <asm/jmr3927/tx3927.h> 13#include <asm/jmr3927/tx3927.h>
14#include <asm/addrspace.h> 14#include <asm/addrspace.h>
15#include <asm/system.h> 15#include <asm/system.h>
16#include <asm/txx9irq.h>
16 17
17/* CS */ 18/* CS */
18#define JMR3927_ROMCE0 0x1fc00000 /* 4M */ 19#define JMR3927_ROMCE0 0x1fc00000 /* 4M */
@@ -115,7 +116,7 @@
115#define JMR3927_NR_IRQ_IRC 16 /* On-Chip IRC */ 116#define JMR3927_NR_IRQ_IRC 16 /* On-Chip IRC */
116#define JMR3927_NR_IRQ_IOC 8 /* PCI/MODEM/INT[6:7] */ 117#define JMR3927_NR_IRQ_IOC 8 /* PCI/MODEM/INT[6:7] */
117 118
118#define JMR3927_IRQ_IRC 16 119#define JMR3927_IRQ_IRC TXX9_IRQ_BASE
119#define JMR3927_IRQ_IOC (JMR3927_IRQ_IRC + JMR3927_NR_IRQ_IRC) 120#define JMR3927_IRQ_IOC (JMR3927_IRQ_IRC + JMR3927_NR_IRQ_IRC)
120#define JMR3927_IRQ_END (JMR3927_IRQ_IOC + JMR3927_NR_IRQ_IOC) 121#define JMR3927_IRQ_END (JMR3927_IRQ_IOC + JMR3927_NR_IRQ_IOC)
121 122
diff --git a/include/asm-mips/jmr3927/tx3927.h b/include/asm-mips/jmr3927/tx3927.h
index 0b9073bfb759..4be2f25f70dd 100644
--- a/include/asm-mips/jmr3927/tx3927.h
+++ b/include/asm-mips/jmr3927/tx3927.h
@@ -50,21 +50,6 @@ struct tx3927_dma_reg {
50 volatile unsigned long unused0; 50 volatile unsigned long unused0;
51}; 51};
52 52
53struct tx3927_irc_reg {
54 volatile unsigned long cer;
55 volatile unsigned long cr[2];
56 volatile unsigned long unused0;
57 volatile unsigned long ilr[8];
58 volatile unsigned long unused1[4];
59 volatile unsigned long imr;
60 volatile unsigned long unused2[7];
61 volatile unsigned long scr;
62 volatile unsigned long unused3[7];
63 volatile unsigned long ssr;
64 volatile unsigned long unused4[7];
65 volatile unsigned long csr;
66};
67
68#include <asm/byteorder.h> 53#include <asm/byteorder.h>
69 54
70#ifdef __BIG_ENDIAN 55#ifdef __BIG_ENDIAN
@@ -225,26 +210,6 @@ struct tx3927_ccfg_reg {
225/* 210/*
226 * IRC 211 * IRC
227 */ 212 */
228#define TX3927_IR_MAX_LEVEL 7
229
230/* IRCER : Int. Control Enable */
231#define TX3927_IRCER_ICE 0x00000001
232
233/* IRCR : Int. Control */
234#define TX3927_IRCR_LOW 0x00000000
235#define TX3927_IRCR_HIGH 0x00000001
236#define TX3927_IRCR_DOWN 0x00000002
237#define TX3927_IRCR_UP 0x00000003
238
239/* IRSCR : Int. Status Control */
240#define TX3927_IRSCR_EIClrE 0x00000100
241#define TX3927_IRSCR_EIClr_MASK 0x0000000f
242
243/* IRCSR : Int. Current Status */
244#define TX3927_IRCSR_IF 0x00010000
245#define TX3927_IRCSR_ILV_MASK 0x00000700
246#define TX3927_IRCSR_IVL_MASK 0x0000001f
247
248#define TX3927_IR_INT0 0 213#define TX3927_IR_INT0 0
249#define TX3927_IR_INT1 1 214#define TX3927_IR_INT1 1
250#define TX3927_IR_INT2 2 215#define TX3927_IR_INT2 2
@@ -347,7 +312,6 @@ struct tx3927_ccfg_reg {
347#define tx3927_sdramcptr ((struct tx3927_sdramc_reg *)TX3927_SDRAMC_REG) 312#define tx3927_sdramcptr ((struct tx3927_sdramc_reg *)TX3927_SDRAMC_REG)
348#define tx3927_romcptr ((struct tx3927_romc_reg *)TX3927_ROMC_REG) 313#define tx3927_romcptr ((struct tx3927_romc_reg *)TX3927_ROMC_REG)
349#define tx3927_dmaptr ((struct tx3927_dma_reg *)TX3927_DMA_REG) 314#define tx3927_dmaptr ((struct tx3927_dma_reg *)TX3927_DMA_REG)
350#define tx3927_ircptr ((struct tx3927_irc_reg *)TX3927_IRC_REG)
351#define tx3927_pcicptr ((struct tx3927_pcic_reg *)TX3927_PCIC_REG) 315#define tx3927_pcicptr ((struct tx3927_pcic_reg *)TX3927_PCIC_REG)
352#define tx3927_ccfgptr ((struct tx3927_ccfg_reg *)TX3927_CCFG_REG) 316#define tx3927_ccfgptr ((struct tx3927_ccfg_reg *)TX3927_CCFG_REG)
353#define tx3927_tmrptr(ch) ((struct txx927_tmr_reg *)TX3927_TMR_REG(ch)) 317#define tx3927_tmrptr(ch) ((struct txx927_tmr_reg *)TX3927_TMR_REG(ch))
diff --git a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
index c6dfa59d1986..d38f069d9e95 100644
--- a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-cobalt/cpu-feature-overrides.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) 2006 Ralf Baechle (ralf@linux-mips.org) 6 * Copyright (C) 2006, 07 Ralf Baechle (ralf@linux-mips.org)
7 */ 7 */
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
@@ -46,6 +46,8 @@
46#define cpu_has_ic_fills_f_dc 0 46#define cpu_has_ic_fills_f_dc 0
47#define cpu_icache_snoops_remote_store 0 47#define cpu_icache_snoops_remote_store 0
48#define cpu_has_dsp 0 48#define cpu_has_dsp 0
49#define cpu_has_mipsmt 0
50#define cpu_has_userlocal 0
49 51
50#define cpu_has_mips32r1 0 52#define cpu_has_mips32r1 0
51#define cpu_has_mips32r2 0 53#define cpu_has_mips32r2 0
diff --git a/include/asm-mips/mach-excite/cpu-feature-overrides.h b/include/asm-mips/mach-excite/cpu-feature-overrides.h
index 0d31854222f9..07f4322c235d 100644
--- a/include/asm-mips/mach-excite/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-excite/cpu-feature-overrides.h
@@ -4,6 +4,7 @@
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2004 Thomas Koeller <thomas.koeller@baslerweb.com> 6 * Copyright (C) 2004 Thomas Koeller <thomas.koeller@baslerweb.com>
7 * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
7 */ 8 */
8#ifndef __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H 9#ifndef __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H 10#define __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H
@@ -27,6 +28,8 @@
27#define cpu_has_ic_fills_f_dc 0 28#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0 29#define cpu_has_dsp 0
29#define cpu_icache_snoops_remote_store 0 30#define cpu_icache_snoops_remote_store 0
31#define cpu_has_mipsmt 0
32#define cpu_has_userlocal 0
30 33
31#define cpu_has_nofpuex 0 34#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 35#define cpu_has_64bits 1
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h
index 6eba2e576aaa..2b928577be5d 100644
--- a/include/asm-mips/mach-generic/ide.h
+++ b/include/asm-mips/mach-generic/ide.h
@@ -29,68 +29,42 @@
29 29
30#define IDE_ARCH_OBSOLETE_DEFAULTS 30#define IDE_ARCH_OBSOLETE_DEFAULTS
31 31
32static __inline__ int ide_probe_legacy(void)
33{
34#ifdef CONFIG_PCI
35 struct pci_dev *dev;
36 if ((dev = pci_get_class(PCI_CLASS_BRIDGE_EISA << 8, NULL)) != NULL ||
37 (dev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL)) != NULL) {
38 pci_dev_put(dev);
39
40 return 1;
41 }
42 return 0;
43#elif defined(CONFIG_EISA) || defined(CONFIG_ISA)
44 return 1;
45#else
46 return 0;
47#endif
48}
49
50static __inline__ int ide_default_irq(unsigned long base) 32static __inline__ int ide_default_irq(unsigned long base)
51{ 33{
52 if (ide_probe_legacy()) 34 switch (base) {
53 switch (base) { 35 case 0x1f0: return 14;
54 case 0x1f0: 36 case 0x170: return 15;
55 return 14; 37 case 0x1e8: return 11;
56 case 0x170: 38 case 0x168: return 10;
57 return 15; 39 case 0x1e0: return 8;
58 case 0x1e8: 40 case 0x160: return 12;
59 return 11;
60 case 0x168:
61 return 10;
62 case 0x1e0:
63 return 8;
64 case 0x160:
65 return 12;
66 default: 41 default:
67 return 0; 42 return 0;
68 } 43 }
69 else
70 return 0;
71} 44}
72 45
73static __inline__ unsigned long ide_default_io_base(int index) 46static __inline__ unsigned long ide_default_io_base(int index)
74{ 47{
75 if (ide_probe_legacy()) 48 /*
49 * If PCI is present then it is not safe to poke around
50 * the other legacy IDE ports. Only 0x1f0 and 0x170 are
51 * defined compatibility mode ports for PCI. A user can
52 * override this using ide= but we must default safe.
53 */
54 if (no_pci_devices()) {
76 switch (index) { 55 switch (index) {
77 case 0: 56 case 2: return 0x1e8;
78 return 0x1f0; 57 case 3: return 0x168;
79 case 1: 58 case 4: return 0x1e0;
80 return 0x170; 59 case 5: return 0x160;
81 case 2:
82 return 0x1e8;
83 case 3:
84 return 0x168;
85 case 4:
86 return 0x1e0;
87 case 5:
88 return 0x160;
89 default:
90 return 0;
91 } 60 }
92 else 61 }
62 switch (index) {
63 case 0: return 0x1f0;
64 case 1: return 0x170;
65 default:
93 return 0; 66 return 0;
67 }
94} 68}
95 69
96#define IDE_ARCH_OBSOLETE_INIT 70#define IDE_ARCH_OBSOLETE_INIT
diff --git a/include/asm-mips/mach-ip22/cpu-feature-overrides.h b/include/asm-mips/mach-ip22/cpu-feature-overrides.h
index f7c5dc8a5336..9c8735158da1 100644
--- a/include/asm-mips/mach-ip22/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip22/cpu-feature-overrides.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) 2003 Ralf Baechle 6 * Copyright (C) 2003, 07 Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
@@ -30,6 +30,8 @@
30#define cpu_has_ic_fills_f_dc 0 30#define cpu_has_ic_fills_f_dc 0
31 31
32#define cpu_has_dsp 0 32#define cpu_has_dsp 0
33#define cpu_has_mipsmt 0
34#define cpu_has_userlocal 0
33 35
34#define cpu_has_nofpuex 0 36#define cpu_has_nofpuex 0
35#define cpu_has_64bits 1 37#define cpu_has_64bits 1
diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
index a071974b67bb..fe076380c189 100644
--- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip27/cpu-feature-overrides.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) 2003 Ralf Baechle 6 * Copyright (C) 2003, 07 Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
@@ -27,6 +27,8 @@
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0 28#define cpu_has_dsp 0
29#define cpu_icache_snoops_remote_store 1 29#define cpu_icache_snoops_remote_store 1
30#define cpu_has_mipsmt 0
31#define cpu_has_userlocal 0
30 32
31#define cpu_has_nofpuex 0 33#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 34#define cpu_has_64bits 1
diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
index 2a3de092bf13..6782fccebe8d 100644
--- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
@@ -4,7 +4,7 @@
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2005 Ilya A. Volynets-Evenbakh 6 * Copyright (C) 2005 Ilya A. Volynets-Evenbakh
7 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) 7 * Copyright (C) 2005, 07 Ralf Baechle (ralf@linux-mips.org)
8 */ 8 */
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
@@ -38,6 +38,8 @@
38#define cpu_has_ic_fills_f_dc 0 38#define cpu_has_ic_fills_f_dc 0
39#define cpu_has_dsp 0 39#define cpu_has_dsp 0
40#define cpu_has_4k_cache 1 40#define cpu_has_4k_cache 1
41#define cpu_has_mipsmt 0
42#define cpu_has_userlocal 0
41 43
42 44
43#define cpu_has_mips32r1 0 45#define cpu_has_mips32r1 0
diff --git a/include/asm-mips/mach-ocelot/mach-gt64120.h b/include/asm-mips/mach-ocelot/mach-gt64120.h
deleted file mode 100644
index a62ecb53c751..000000000000
--- a/include/asm-mips/mach-ocelot/mach-gt64120.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10#ifndef _ASM_GT64120_MOMENCO_OCELOT_GT64120_DEP_H
11#define _ASM_GT64120_MOMENCO_OCELOT_GT64120_DEP_H
12
13/*
14 * PCI address allocation
15 */
16#define GT_PCI_MEM_BASE (0x22000000UL)
17#define GT_PCI_MEM_SIZE GT_DEF_PCI0_MEM0_SIZE
18#define GT_PCI_IO_BASE (0x20000000UL)
19#define GT_PCI_IO_SIZE GT_DEF_PCI0_IO_SIZE
20
21extern unsigned long gt64120_base;
22
23#define GT64120_BASE (gt64120_base)
24
25/*
26 * GT timer irq
27 */
28#define GT_TIMER 6
29
30#endif /* _ASM_GT64120_MOMENCO_OCELOT_GT64120_DEP_H */
diff --git a/include/asm-mips/mach-qemu/cpu-feature-overrides.h b/include/asm-mips/mach-qemu/cpu-feature-overrides.h
index 529445dacedb..d2daaed235d5 100644
--- a/include/asm-mips/mach-qemu/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-qemu/cpu-feature-overrides.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) 2003 Ralf Baechle 6 * Copyright (C) 2003, 07 Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H
@@ -24,6 +24,7 @@
24#define cpu_has_ic_fills_f_dc 0 24#define cpu_has_ic_fills_f_dc 0
25 25
26#define cpu_has_dsp 0 26#define cpu_has_dsp 0
27#define cpu_has_mipsmt 0
27 28
28#define cpu_has_nofpuex 0 29#define cpu_has_nofpuex 0
29#define cpu_has_64bits 0 30#define cpu_has_64bits 0
diff --git a/include/asm-mips/mach-rm/cpu-feature-overrides.h b/include/asm-mips/mach-rm/cpu-feature-overrides.h
index 7e07283140a3..ccf543363537 100644
--- a/include/asm-mips/mach-rm/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-rm/cpu-feature-overrides.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) 2003, 2004 Ralf Baechle 6 * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)
7 * 7 *
8 * SNI RM200 C apparently was only shipped with R4600 V2.0 and R5000 processors. 8 * SNI RM200 C apparently was only shipped with R4600 V2.0 and R5000 processors.
9 */ 9 */
@@ -32,6 +32,8 @@
32#define cpu_has_dsp 0 32#define cpu_has_dsp 0
33#define cpu_has_nofpuex 0 33#define cpu_has_nofpuex 0
34#define cpu_has_64bits 1 34#define cpu_has_64bits 1
35#define cpu_has_mipsmt 0
36#define cpu_has_userlocal 0
35 37
36#define cpu_has_mips32r1 0 38#define cpu_has_mips32r1 0
37#define cpu_has_mips32r2 0 39#define cpu_has_mips32r2 0
diff --git a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
index a25968f277a2..63d5bf649af1 100644
--- a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-sibyte/cpu-feature-overrides.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) 2003, 2004 Ralf Baechle 6 * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)
7 */ 7 */
8#ifndef __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H
@@ -26,6 +26,8 @@
26#define cpu_has_dc_aliases 0 26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0 28#define cpu_has_dsp 0
29#define cpu_has_mipsmt 0
30#define cpu_has_userlocal 0
29#define cpu_icache_snoops_remote_store 0 31#define cpu_icache_snoops_remote_store 0
30 32
31#define cpu_has_nofpuex 0 33#define cpu_has_nofpuex 0
diff --git a/include/asm-mips/mach-tx49xx/cpu-feature-overrides.h b/include/asm-mips/mach-tx49xx/cpu-feature-overrides.h
new file mode 100644
index 000000000000..275eaf92c748
--- /dev/null
+++ b/include/asm-mips/mach-tx49xx/cpu-feature-overrides.h
@@ -0,0 +1,23 @@
1#ifndef __ASM_MACH_TX49XX_CPU_FEATURE_OVERRIDES_H
2#define __ASM_MACH_TX49XX_CPU_FEATURE_OVERRIDES_H
3
4#define cpu_has_llsc 1
5#define cpu_has_64bits 1
6#define cpu_has_inclusive_pcaches 0
7
8#define cpu_has_mips16 0
9#define cpu_has_mdmx 0
10#define cpu_has_mips3d 0
11#define cpu_has_smartmips 0
12#define cpu_has_vtag_icache 0
13#define cpu_has_ic_fills_f_dc 0
14#define cpu_has_dsp 0
15#define cpu_has_mipsmt 0
16#define cpu_has_userlocal 0
17
18#define cpu_has_mips32r1 0
19#define cpu_has_mips32r2 0
20#define cpu_has_mips64r1 0
21#define cpu_has_mips64r2 0
22
23#endif /* __ASM_MACH_TX49XX_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-tx49xx/kmalloc.h b/include/asm-mips/mach-tx49xx/kmalloc.h
new file mode 100644
index 000000000000..913ff196259d
--- /dev/null
+++ b/include/asm-mips/mach-tx49xx/kmalloc.h
@@ -0,0 +1,8 @@
1#ifndef __ASM_MACH_TX49XX_KMALLOC_H
2#define __ASM_MACH_TX49XX_KMALLOC_H
3
4/*
5 * All happy, no need to define ARCH_KMALLOC_MINALIGN
6 */
7
8#endif /* __ASM_MACH_TX49XX_KMALLOC_H */
diff --git a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
index 42cebb7ce7a6..470e5e9e10d6 100644
--- a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-yosemite/cpu-feature-overrides.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) 2003, 2004 Ralf Baechle 6 * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)
7 */ 7 */
8#ifndef __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H
@@ -26,6 +26,8 @@
26#define cpu_has_dc_aliases 0 26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0 28#define cpu_has_dsp 0
29#define cpu_has_mipsmt 0
30#define cpu_has_userlocal 0
29#define cpu_icache_snoops_remote_store 0 31#define cpu_icache_snoops_remote_store 0
30 32
31#define cpu_has_nofpuex 0 33#define cpu_has_nofpuex 0
diff --git a/include/asm-mips/marvell.h b/include/asm-mips/marvell.h
deleted file mode 100644
index b6144bafc565..000000000000
--- a/include/asm-mips/marvell.h
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2004 by Ralf Baechle
7 */
8#ifndef __ASM_MIPS_MARVELL_H
9#define __ASM_MIPS_MARVELL_H
10
11#include <linux/pci.h>
12
13#include <asm/byteorder.h>
14
15extern unsigned long marvell_base;
16
17/*
18 * Because of an error/peculiarity in the Galileo chip, we need to swap the
19 * bytes when running bigendian.
20 */
21#define __MV_READ(ofs) \
22 (*(volatile u32 *)(marvell_base+(ofs)))
23#define __MV_WRITE(ofs, data) \
24 do { *(volatile u32 *)(marvell_base+(ofs)) = (data); } while (0)
25
26#define MV_READ(ofs) le32_to_cpu(__MV_READ(ofs))
27#define MV_WRITE(ofs, data) __MV_WRITE(ofs, cpu_to_le32(data))
28
29#define MV_READ_16(ofs) \
30 le16_to_cpu(*(volatile u16 *)(marvell_base+(ofs)))
31#define MV_WRITE_16(ofs, data) \
32 *(volatile u16 *)(marvell_base+(ofs)) = cpu_to_le16(data)
33
34#define MV_READ_8(ofs) \
35 *(volatile u8 *)(marvell_base+(ofs))
36#define MV_WRITE_8(ofs, data) \
37 *(volatile u8 *)(marvell_base+(ofs)) = data
38
39#define MV_SET_REG_BITS(ofs, bits) \
40 (*((volatile u32 *)(marvell_base + (ofs)))) |= ((u32)cpu_to_le32(bits))
41#define MV_RESET_REG_BITS(ofs, bits) \
42 (*((volatile u32 *)(marvell_base + (ofs)))) &= ~((u32)cpu_to_le32(bits))
43
44extern struct pci_ops mv_pci_ops;
45
46struct mv_pci_controller {
47 struct pci_controller pcic;
48
49 /*
50 * GT-64240/MV-64340 specific, per host bus information
51 */
52 unsigned long config_addr;
53 unsigned long config_vreg;
54};
55
56extern void ll_mv64340_irq(void);
57extern void mv64340_irq_init(unsigned int base);
58
59#endif /* __ASM_MIPS_MARVELL_H */
diff --git a/include/asm-mips/mips-boards/generic.h b/include/asm-mips/mips-boards/generic.h
index c8ebcc3e1267..d58977483534 100644
--- a/include/asm-mips/mips-boards/generic.h
+++ b/include/asm-mips/mips-boards/generic.h
@@ -67,6 +67,7 @@
67#define MIPS_REVISION_CORID_CORE_FPGAR2 8 67#define MIPS_REVISION_CORID_CORE_FPGAR2 8
68#define MIPS_REVISION_CORID_CORE_FPGA3 9 68#define MIPS_REVISION_CORID_CORE_FPGA3 9
69#define MIPS_REVISION_CORID_CORE_24K 10 69#define MIPS_REVISION_CORID_CORE_24K 10
70#define MIPS_REVISION_CORID_CORE_FPGA4 11
70 71
71/**** Artificial corid defines ****/ 72/**** Artificial corid defines ****/
72/* 73/*
diff --git a/include/asm-mips/mips_mt.h b/include/asm-mips/mips_mt.h
index 8045abc78d0f..ac7935203f89 100644
--- a/include/asm-mips/mips_mt.h
+++ b/include/asm-mips/mips_mt.h
@@ -8,6 +8,12 @@
8 8
9#include <linux/cpumask.h> 9#include <linux/cpumask.h>
10 10
11/*
12 * How many VPEs and TCs is Linux allowed to use? 0 means no limit.
13 */
14extern int tclimit;
15extern int vpelimit;
16
11extern cpumask_t mt_fpu_cpumask; 17extern cpumask_t mt_fpu_cpumask;
12extern unsigned long mt_fpemul_threshold; 18extern unsigned long mt_fpemul_threshold;
13 19
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
index 2fbd47eba32d..59c865deb0c7 100644
--- a/include/asm-mips/pgtable-32.h
+++ b/include/asm-mips/pgtable-32.h
@@ -43,11 +43,7 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
43 */ 43 */
44 44
45/* PGDIR_SHIFT determines what a third-level page table entry can map */ 45/* PGDIR_SHIFT determines what a third-level page table entry can map */
46#ifdef CONFIG_64BIT_PHYS_ADDR 46#define PGDIR_SHIFT (2 * PAGE_SHIFT + PTE_ORDER - PTE_T_LOG2)
47#define PGDIR_SHIFT 21
48#else
49#define PGDIR_SHIFT 22
50#endif
51#define PGDIR_SIZE (1UL << PGDIR_SHIFT) 47#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
52#define PGDIR_MASK (~(PGDIR_SIZE-1)) 48#define PGDIR_MASK (~(PGDIR_SIZE-1))
53 49
@@ -55,17 +51,11 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
55 * Entries per page directory level: we use two-level, so 51 * Entries per page directory level: we use two-level, so
56 * we don't really have any PUD/PMD directory physically. 52 * we don't really have any PUD/PMD directory physically.
57 */ 53 */
58#ifdef CONFIG_64BIT_PHYS_ADDR 54#define __PGD_ORDER (32 - 3 * PAGE_SHIFT + PGD_T_LOG2 + PTE_T_LOG2)
59#define PGD_ORDER 1 55#define PGD_ORDER (__PGD_ORDER >= 0 ? __PGD_ORDER : 0)
60#define PUD_ORDER aieeee_attempt_to_allocate_pud 56#define PUD_ORDER aieeee_attempt_to_allocate_pud
61#define PMD_ORDER 1 57#define PMD_ORDER 1
62#define PTE_ORDER 0 58#define PTE_ORDER 0
63#else
64#define PGD_ORDER 0
65#define PUD_ORDER aieeee_attempt_to_allocate_pud
66#define PMD_ORDER 1
67#define PTE_ORDER 0
68#endif
69 59
70#define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t)) 60#define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t))
71#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) 61#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 2e2d70d13ff6..d2ee28156743 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -168,11 +168,15 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt
168#define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0) 168#define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0)
169#endif 169#endif
170 170
171#define PGD_T_LOG2 ffz(~sizeof(pgd_t)) 171#define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
172#define PMD_T_LOG2 ffz(~sizeof(pmd_t)) 172#define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1)
173#define PTE_T_LOG2 ffz(~sizeof(pte_t)) 173#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
174 174
175extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 175/*
176 * We used to declare this array with size but gcc 3.3 and older are not able
177 * to find that this expression is a constant, so the size is dropped.
178 */
179extern pgd_t swapper_pg_dir[];
176 180
177/* 181/*
178 * The following only work if pte_present() is true. 182 * The following only work if pte_present() is true.
diff --git a/include/asm-mips/pmon.h b/include/asm-mips/pmon.h
index 260f3448ccf1..6ad519189ce2 100644
--- a/include/asm-mips/pmon.h
+++ b/include/asm-mips/pmon.h
@@ -22,7 +22,7 @@ struct callvectors {
22 char* (*gets) (char*); 22 char* (*gets) (char*);
23 union { 23 union {
24 int (*smpfork) (unsigned long cp, char *sp); 24 int (*smpfork) (unsigned long cp, char *sp);
25 int (*cpustart) (long, long, long, long); 25 int (*cpustart) (long, void (*)(void), void *, long);
26 } _s; 26 } _s;
27 int (*semlock) (int sem); 27 int (*semlock) (int sem);
28 void (*semunlock) (int sem); 28 void (*semunlock) (int sem);
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index 1d8b9a8ae324..83bc94534084 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -62,8 +62,9 @@ extern unsigned int vced_count, vcei_count;
62 * This decides where the kernel will search for a free chunk of vm 62 * This decides where the kernel will search for a free chunk of vm
63 * space during mmap's. 63 * space during mmap's.
64 */ 64 */
65#define TASK_UNMAPPED_BASE ((current->thread.mflags & MF_32BIT_ADDR) ? \ 65#define TASK_UNMAPPED_BASE \
66 PAGE_ALIGN(TASK_SIZE32 / 3) : PAGE_ALIGN(TASK_SIZE / 3)) 66 (test_thread_flag(TIF_32BIT_ADDR) ? \
67 PAGE_ALIGN(TASK_SIZE32 / 3) : PAGE_ALIGN(TASK_SIZE / 3))
67#endif 68#endif
68 69
69#define NUM_FPU_REGS 32 70#define NUM_FPU_REGS 32
@@ -132,22 +133,11 @@ struct thread_struct {
132 unsigned long cp0_baduaddr; /* Last kernel fault accessing USEG */ 133 unsigned long cp0_baduaddr; /* Last kernel fault accessing USEG */
133 unsigned long error_code; 134 unsigned long error_code;
134 unsigned long trap_no; 135 unsigned long trap_no;
135#define MF_FIXADE 1 /* Fix address errors in software */
136#define MF_LOGADE 2 /* Log address errors to syslog */
137#define MF_32BIT_REGS 4 /* also implies 16/32 fprs */
138#define MF_32BIT_ADDR 8 /* 32-bit address space (o32/n32) */
139#define MF_FPUBOUND 0x10 /* thread bound to FPU-full CPU set */
140 unsigned long mflags;
141 unsigned long irix_trampoline; /* Wheee... */ 136 unsigned long irix_trampoline; /* Wheee... */
142 unsigned long irix_oldctx; 137 unsigned long irix_oldctx;
143 struct mips_abi *abi; 138 struct mips_abi *abi;
144}; 139};
145 140
146#define MF_ABI_MASK (MF_32BIT_REGS | MF_32BIT_ADDR)
147#define MF_O32 (MF_32BIT_REGS | MF_32BIT_ADDR)
148#define MF_N32 MF_32BIT_ADDR
149#define MF_N64 0
150
151#ifdef CONFIG_MIPS_MT_FPAFF 141#ifdef CONFIG_MIPS_MT_FPAFF
152#define FPAFF_INIT \ 142#define FPAFF_INIT \
153 .emulated_fp = 0, \ 143 .emulated_fp = 0, \
@@ -200,10 +190,6 @@ struct thread_struct {
200 .cp0_baduaddr = 0, \ 190 .cp0_baduaddr = 0, \
201 .error_code = 0, \ 191 .error_code = 0, \
202 .trap_no = 0, \ 192 .trap_no = 0, \
203 /* \
204 * For now the default is to fix address errors \
205 */ \
206 .mflags = MF_FIXADE, \
207 .irix_trampoline = 0, \ 193 .irix_trampoline = 0, \
208 .irix_oldctx = 0, \ 194 .irix_oldctx = 0, \
209} 195}
diff --git a/include/asm-mips/seccomp.h b/include/asm-mips/seccomp.h
new file mode 100644
index 000000000000..36ed44070256
--- /dev/null
+++ b/include/asm-mips/seccomp.h
@@ -0,0 +1,37 @@
1#ifndef __ASM_SECCOMP_H
2
3#include <linux/thread_info.h>
4#include <linux/unistd.h>
5
6#define __NR_seccomp_read __NR_read
7#define __NR_seccomp_write __NR_write
8#define __NR_seccomp_exit __NR_exit
9#define __NR_seccomp_sigreturn __NR_rt_sigreturn
10
11/*
12 * Kludge alert:
13 *
14 * The generic seccomp code currently allows only a single compat ABI. Until
15 * this is fixed we priorize O32 as the compat ABI over N32.
16 */
17#ifdef CONFIG_MIPS32_O32
18
19#define TIF_32BIT TIF_32BIT_REGS
20
21#define __NR_seccomp_read_32 4003
22#define __NR_seccomp_write_32 4004
23#define __NR_seccomp_exit_32 4001
24#define __NR_seccomp_sigreturn_32 4193 /* rt_sigreturn */
25
26#elif defined(CONFIG_MIPS32_N32)
27
28#define TIF_32BIT _TIF_32BIT_ADDR
29
30#define __NR_seccomp_read_32 6000
31#define __NR_seccomp_write_32 6001
32#define __NR_seccomp_exit_32 6058
33#define __NR_seccomp_sigreturn_32 6211 /* rt_sigreturn */
34
35#endif /* CONFIG_MIPS32_O32 */
36
37#endif /* __ASM_SECCOMP_H */
diff --git a/include/asm-mips/sibyte/bcm1480_regs.h b/include/asm-mips/sibyte/bcm1480_regs.h
index 2738c1366f66..c34d36b6b8c2 100644
--- a/include/asm-mips/sibyte/bcm1480_regs.h
+++ b/include/asm-mips/sibyte/bcm1480_regs.h
@@ -227,10 +227,15 @@
227 (A_BCM1480_DUART(chan) + \ 227 (A_BCM1480_DUART(chan) + \
228 BCM1480_DUART_CHANREG_SPACING * 3 + (reg)) 228 BCM1480_DUART_CHANREG_SPACING * 3 + (reg))
229 229
230#define DUART_IMRISR_SPACING 0x20
231#define DUART_INCHNG_SPACING 0x10
232
230#define R_BCM1480_DUART_IMRREG(chan) \ 233#define R_BCM1480_DUART_IMRREG(chan) \
231 (R_DUART_IMR_A + ((chan) & 1) * DUART_IMRISR_SPACING) 234 (R_DUART_IMR_A + ((chan) & 1) * DUART_IMRISR_SPACING)
232#define R_BCM1480_DUART_ISRREG(chan) \ 235#define R_BCM1480_DUART_ISRREG(chan) \
233 (R_DUART_ISR_A + ((chan) & 1) * DUART_IMRISR_SPACING) 236 (R_DUART_ISR_A + ((chan) & 1) * DUART_IMRISR_SPACING)
237#define R_BCM1480_DUART_INCHREG(chan) \
238 (R_DUART_IN_CHNG_A + ((chan) & 1) * DUART_INCHNG_SPACING)
234 239
235#define A_BCM1480_DUART_IMRREG(chan) \ 240#define A_BCM1480_DUART_IMRREG(chan) \
236 (A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_IMRREG(chan))) 241 (A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_IMRREG(chan)))
diff --git a/include/asm-mips/smtc.h b/include/asm-mips/smtc.h
index 44dfa4adecf3..ff3e8936b493 100644
--- a/include/asm-mips/smtc.h
+++ b/include/asm-mips/smtc.h
@@ -55,4 +55,14 @@ extern void smtc_boot_secondary(int cpu, struct task_struct *t);
55 55
56#define PARKED_INDEX ((unsigned int)0x80000000) 56#define PARKED_INDEX ((unsigned int)0x80000000)
57 57
58/*
59 * Define low-level interrupt mask for IPIs, if necessary.
60 * By default, use SW interrupt 1, which requires no external
61 * hardware support, but which works only for single-core
62 * MIPS MT systems.
63 */
64#ifndef MIPS_CPU_IPI_IRQ
65#define MIPS_CPU_IPI_IRQ 1
66#endif
67
58#endif /* _ASM_SMTC_MT_H */ 68#endif /* _ASM_SMTC_MT_H */
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h
index 35e431cd796b..bb897016c491 100644
--- a/include/asm-mips/spinlock.h
+++ b/include/asm-mips/spinlock.h
@@ -67,7 +67,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
67 : "memory"); 67 : "memory");
68 } 68 }
69 69
70 smp_mb(); 70 smp_llsc_mb();
71} 71}
72 72
73static inline void __raw_spin_unlock(raw_spinlock_t *lock) 73static inline void __raw_spin_unlock(raw_spinlock_t *lock)
@@ -118,7 +118,7 @@ static inline unsigned int __raw_spin_trylock(raw_spinlock_t *lock)
118 : "memory"); 118 : "memory");
119 } 119 }
120 120
121 smp_mb(); 121 smp_llsc_mb();
122 122
123 return res == 0; 123 return res == 0;
124} 124}
@@ -183,7 +183,7 @@ static inline void __raw_read_lock(raw_rwlock_t *rw)
183 : "memory"); 183 : "memory");
184 } 184 }
185 185
186 smp_mb(); 186 smp_llsc_mb();
187} 187}
188 188
189/* Note the use of sub, not subu which will make the kernel die with an 189/* Note the use of sub, not subu which will make the kernel die with an
@@ -193,7 +193,7 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw)
193{ 193{
194 unsigned int tmp; 194 unsigned int tmp;
195 195
196 smp_mb(); 196 smp_llsc_mb();
197 197
198 if (R10000_LLSC_WAR) { 198 if (R10000_LLSC_WAR) {
199 __asm__ __volatile__( 199 __asm__ __volatile__(
@@ -262,7 +262,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw)
262 : "memory"); 262 : "memory");
263 } 263 }
264 264
265 smp_mb(); 265 smp_llsc_mb();
266} 266}
267 267
268static inline void __raw_write_unlock(raw_rwlock_t *rw) 268static inline void __raw_write_unlock(raw_rwlock_t *rw)
@@ -293,7 +293,7 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw)
293 " .set reorder \n" 293 " .set reorder \n"
294 " beqzl %1, 1b \n" 294 " beqzl %1, 1b \n"
295 " nop \n" 295 " nop \n"
296 __WEAK_ORDERING_MB 296 __WEAK_LLSC_MB
297 " li %2, 1 \n" 297 " li %2, 1 \n"
298 "2: \n" 298 "2: \n"
299 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret) 299 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret)
@@ -310,7 +310,7 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw)
310 " beqz %1, 1b \n" 310 " beqz %1, 1b \n"
311 " nop \n" 311 " nop \n"
312 " .set reorder \n" 312 " .set reorder \n"
313 __WEAK_ORDERING_MB 313 __WEAK_LLSC_MB
314 " li %2, 1 \n" 314 " li %2, 1 \n"
315 "2: \n" 315 "2: \n"
316 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret) 316 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret)
@@ -336,7 +336,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
336 " sc %1, %0 \n" 336 " sc %1, %0 \n"
337 " beqzl %1, 1b \n" 337 " beqzl %1, 1b \n"
338 " nop \n" 338 " nop \n"
339 __WEAK_ORDERING_MB 339 __WEAK_LLSC_MB
340 " li %2, 1 \n" 340 " li %2, 1 \n"
341 " .set reorder \n" 341 " .set reorder \n"
342 "2: \n" 342 "2: \n"
@@ -354,7 +354,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
354 " beqz %1, 3f \n" 354 " beqz %1, 3f \n"
355 " li %2, 1 \n" 355 " li %2, 1 \n"
356 "2: \n" 356 "2: \n"
357 __WEAK_ORDERING_MB 357 __WEAK_LLSC_MB
358 " .subsection 2 \n" 358 " .subsection 2 \n"
359 "3: b 1b \n" 359 "3: b 1b \n"
360 " li %2, 0 \n" 360 " li %2, 0 \n"
diff --git a/include/asm-mips/stacktrace.h b/include/asm-mips/stacktrace.h
index 07f873351a86..0bf82818aa53 100644
--- a/include/asm-mips/stacktrace.h
+++ b/include/asm-mips/stacktrace.h
@@ -9,7 +9,11 @@ extern unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
9 unsigned long pc, unsigned long *ra); 9 unsigned long pc, unsigned long *ra);
10#else 10#else
11#define raw_show_trace 1 11#define raw_show_trace 1
12#define unwind_stack(task, sp, pc, ra) 0 12static inline unsigned long unwind_stack(struct task_struct *task,
13 unsigned long *sp, unsigned long pc, unsigned long *ra)
14{
15 return 0;
16}
13#endif 17#endif
14 18
15static __always_inline void prepare_frametrace(struct pt_regs *regs) 19static __always_inline void prepare_frametrace(struct pt_regs *regs)
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 46bdb3f566f9..357251f42518 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -46,10 +46,12 @@ struct task_struct;
46 46
47#define __mips_mt_fpaff_switch_to(prev) \ 47#define __mips_mt_fpaff_switch_to(prev) \
48do { \ 48do { \
49 struct thread_info *__prev_ti = task_thread_info(prev); \
50 \
49 if (cpu_has_fpu && \ 51 if (cpu_has_fpu && \
50 (prev->thread.mflags & MF_FPUBOUND) && \ 52 test_ti_thread_flag(__prev_ti, TIF_FPUBOUND) && \
51 (!(KSTK_STATUS(prev) & ST0_CU1))) { \ 53 (!(KSTK_STATUS(prev) & ST0_CU1))) { \
52 prev->thread.mflags &= ~MF_FPUBOUND; \ 54 clear_ti_thread_flag(__prev_ti, TIF_FPUBOUND); \
53 prev->cpus_allowed = prev->thread.user_cpus_allowed; \ 55 prev->cpus_allowed = prev->thread.user_cpus_allowed; \
54 } \ 56 } \
55 next->thread.emulated_fp = 0; \ 57 next->thread.emulated_fp = 0; \
@@ -71,16 +73,6 @@ do { \
71 write_c0_userlocal(task_thread_info(current)->tp_value);\ 73 write_c0_userlocal(task_thread_info(current)->tp_value);\
72} while(0) 74} while(0)
73 75
74/*
75 * On SMP systems, when the scheduler does migration-cost autodetection,
76 * it needs a way to flush as much of the CPU's caches as possible.
77 *
78 * TODO: fill this in!
79 */
80static inline void sched_cacheflush(void)
81{
82}
83
84static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) 76static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
85{ 77{
86 __u32 retval; 78 __u32 retval;
@@ -127,7 +119,7 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
127 raw_local_irq_restore(flags); /* implies memory barrier */ 119 raw_local_irq_restore(flags); /* implies memory barrier */
128 } 120 }
129 121
130 smp_mb(); 122 smp_llsc_mb();
131 123
132 return retval; 124 return retval;
133} 125}
@@ -175,7 +167,7 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
175 raw_local_irq_restore(flags); /* implies memory barrier */ 167 raw_local_irq_restore(flags); /* implies memory barrier */
176 } 168 }
177 169
178 smp_mb(); 170 smp_llsc_mb();
179 171
180 return retval; 172 return retval;
181} 173}
@@ -256,7 +248,7 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old,
256 raw_local_irq_restore(flags); /* implies memory barrier */ 248 raw_local_irq_restore(flags); /* implies memory barrier */
257 } 249 }
258 250
259 smp_mb(); 251 smp_llsc_mb();
260 252
261 return retval; 253 return retval;
262} 254}
@@ -362,7 +354,7 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
362 raw_local_irq_restore(flags); /* implies memory barrier */ 354 raw_local_irq_restore(flags); /* implies memory barrier */
363 } 355 }
364 356
365 smp_mb(); 357 smp_llsc_mb();
366 358
367 return retval; 359 return retval;
368} 360}
@@ -480,6 +472,6 @@ extern int stop_a_enabled;
480 */ 472 */
481#define __ARCH_WANT_UNLOCKED_CTXSW 473#define __ARCH_WANT_UNLOCKED_CTXSW
482 474
483#define arch_align_stack(x) (x) 475extern unsigned long arch_align_stack(unsigned long sp);
484 476
485#endif /* _ASM_SYSTEM_H */ 477#endif /* _ASM_SYSTEM_H */
diff --git a/include/asm-mips/termbits.h b/include/asm-mips/termbits.h
index 5bfdc3b64510..c83c68444e86 100644
--- a/include/asm-mips/termbits.h
+++ b/include/asm-mips/termbits.h
@@ -164,6 +164,7 @@ struct ktermios {
164#define HUPCL 0002000 /* Hang up on last close. */ 164#define HUPCL 0002000 /* Hang up on last close. */
165#define CLOCAL 0004000 /* Ignore modem status lines. */ 165#define CLOCAL 0004000 /* Ignore modem status lines. */
166#define CBAUDEX 0010000 166#define CBAUDEX 0010000
167#define BOTHER 0010000
167#define B57600 0010001 168#define B57600 0010001
168#define B115200 0010002 169#define B115200 0010002
169#define B230400 0010003 170#define B230400 0010003
@@ -179,9 +180,11 @@ struct ktermios {
179#define B3000000 0010015 180#define B3000000 0010015
180#define B3500000 0010016 181#define B3500000 0010016
181#define B4000000 0010017 182#define B4000000 0010017
182#define CIBAUD 002003600000 /* input baud rate (not used) */ 183#define CIBAUD 002003600000 /* input baud rate */
183#define CMSPAR 010000000000 /* mark or space (stick) parity */ 184#define CMSPAR 010000000000 /* mark or space (stick) parity */
184#define CRTSCTS 020000000000 /* flow control */ 185#define CRTSCTS 020000000000 /* flow control */
186
187#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
185 188
186/* c_lflag bits */ 189/* c_lflag bits */
187#define ISIG 0000001 /* Enable signals. */ 190#define ISIG 0000001 /* Enable signals. */
diff --git a/include/asm-mips/termios.h b/include/asm-mips/termios.h
index 2ce07f4be369..a275661fa7e1 100644
--- a/include/asm-mips/termios.h
+++ b/include/asm-mips/termios.h
@@ -122,8 +122,10 @@ struct termio {
122 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 122 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
123}) 123})
124 124
125#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) 125#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
126#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) 126#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
127#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
128#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
127 129
128#endif /* defined(__KERNEL__) */ 130#endif /* defined(__KERNEL__) */
129 131
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h
index fbcda8204473..b2772df1a1bd 100644
--- a/include/asm-mips/thread_info.h
+++ b/include/asm-mips/thread_info.h
@@ -46,7 +46,7 @@ struct thread_info {
46{ \ 46{ \
47 .task = &tsk, \ 47 .task = &tsk, \
48 .exec_domain = &default_exec_domain, \ 48 .exec_domain = &default_exec_domain, \
49 .flags = 0, \ 49 .flags = _TIF_FIXADE, \
50 .cpu = 0, \ 50 .cpu = 0, \
51 .preempt_count = 1, \ 51 .preempt_count = 1, \
52 .addr_limit = KERNEL_DS, \ 52 .addr_limit = KERNEL_DS, \
@@ -87,9 +87,8 @@ register struct thread_info *__current_thread_info __asm__("$28");
87({ \ 87({ \
88 struct thread_info *ret; \ 88 struct thread_info *ret; \
89 \ 89 \
90 ret = kmalloc(THREAD_SIZE, GFP_KERNEL); \ 90 ret = kzalloc(THREAD_SIZE, GFP_KERNEL); \
91 if (ret) \ 91 \
92 memset(ret, 0, THREAD_SIZE); \
93 ret; \ 92 ret; \
94}) 93})
95#else 94#else
@@ -109,20 +108,23 @@ register struct thread_info *__current_thread_info __asm__("$28");
109 * - pending work-to-be-done flags are in LSW 108 * - pending work-to-be-done flags are in LSW
110 * - other flags in MSW 109 * - other flags in MSW
111 */ 110 */
112#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 111#define TIF_SIGPENDING 1 /* signal pending */
113#define TIF_SIGPENDING 2 /* signal pending */ 112#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
114#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 113#define TIF_SYSCALL_AUDIT 3 /* syscall auditing active */
115#define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ 114#define TIF_SECCOMP 4 /* secure computing */
116#define TIF_SECCOMP 5 /* secure computing */
117#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */ 115#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
118#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 116#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
119#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 117#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */
120#define TIF_MEMDIE 18 118#define TIF_MEMDIE 18
121#define TIF_FREEZE 19 119#define TIF_FREEZE 19
120#define TIF_FIXADE 20 /* Fix address errors in software */
121#define TIF_LOGADE 21 /* Log address errors to syslog */
122#define TIF_32BIT_REGS 22 /* also implies 16/32 fprs */
123#define TIF_32BIT_ADDR 23 /* 32-bit address space (o32/n32) */
124#define TIF_FPUBOUND 24 /* thread bound to FPU-full CPU set */
122#define TIF_SYSCALL_TRACE 31 /* syscall trace active */ 125#define TIF_SYSCALL_TRACE 31 /* syscall trace active */
123 126
124#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 127#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
125#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
126#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 128#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
127#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 129#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
128#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 130#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
@@ -131,6 +133,11 @@ register struct thread_info *__current_thread_info __asm__("$28");
131#define _TIF_USEDFPU (1<<TIF_USEDFPU) 133#define _TIF_USEDFPU (1<<TIF_USEDFPU)
132#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 134#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
133#define _TIF_FREEZE (1<<TIF_FREEZE) 135#define _TIF_FREEZE (1<<TIF_FREEZE)
136#define _TIF_FIXADE (1<<TIF_FIXADE)
137#define _TIF_LOGADE (1<<TIF_LOGADE)
138#define _TIF_32BIT_REGS (1<<TIF_32BIT_REGS)
139#define _TIF_32BIT_ADDR (1<<TIF_32BIT_ADDR)
140#define _TIF_FPUBOUND (1<<TIF_FPUBOUND)
134 141
135/* work to do on interrupt/exception return */ 142/* work to do on interrupt/exception return */
136#define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP) 143#define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP)
diff --git a/include/asm-mips/tx3912.h b/include/asm-mips/tx3912.h
deleted file mode 100644
index d709d87363d0..000000000000
--- a/include/asm-mips/tx3912.h
+++ /dev/null
@@ -1,361 +0,0 @@
1/*
2 * include/asm-mips/tx3912.h
3 *
4 * Copyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Registers for TMPR3912/05 and PR31700 processors
11 */
12#ifndef _TX3912_H_
13#define _TX3912_H_
14
15/*****************************************************************************
16 * Clock Subsystem *
17 * --------------- *
18 * Chapter 6 in Philips PR31700 and Toshiba TMPR3905/12 User Manuals *
19 *****************************************************************************/
20#define TX3912_CLK_CTRL 0x01c0
21
22/*
23 * Clock control register values
24 */
25#define TX3912_CLK_CTRL_CHICLKDIV_MASK 0xff000000
26#define TX3912_CLK_CTRL_ENCLKTEST 0x00800000
27#define TX3912_CLK_CTRL_CLKTESTSELSIB 0x00400000
28#define TX3912_CLK_CTRL_CHIMCLKSEL 0x00200000
29#define TX3912_CLK_CTRL_CHICLKDIR 0x00100000
30#define TX3912_CLK_CTRL_ENCHIMCLK 0x00080000
31#define TX3912_CLK_CTRL_ENVIDCLK 0x00040000
32#define TX3912_CLK_CTRL_ENMBUSCLK 0x00020000
33#define TX3912_CLK_CTRL_ENSPICLK 0x00010000
34#define TX3912_CLK_CTRL_ENTIMERCLK 0x00008000
35#define TX3912_CLK_CTRL_ENFASTTIMERCLK 0x00004000
36#define TX3912_CLK_CTRL_SIBMCLKDIR 0x00002000
37#define TX3912_CLK_CTRL_reserved1 0x00001000
38#define TX3912_CLK_CTRL_ENSIBMCLK 0x00000800
39#define TX3912_CLK_CTRL_SIBMCLKDIV_6 0x00000600
40#define TX3912_CLK_CTRL_SIBMCLKDIV_5 0x00000500
41#define TX3912_CLK_CTRL_SIBMCLKDIV_4 0x00000400
42#define TX3912_CLK_CTRL_SIBMCLKDIV_3 0x00000300
43#define TX3912_CLK_CTRL_SIBMCLKDIV_2 0x00000200
44#define TX3912_CLK_CTRL_SIBMCLKDIV_1 0x00000100
45#define TX3912_CLK_CTRL_CSERSEL 0x00000080
46#define TX3912_CLK_CTRL_CSERDIV_6 0x00000060
47#define TX3912_CLK_CTRL_CSERDIV_5 0x00000050
48#define TX3912_CLK_CTRL_CSERDIV_4 0x00000040
49#define TX3912_CLK_CTRL_CSERDIV_3 0x00000030
50#define TX3912_CLK_CTRL_CSERDIV_2 0x00000020
51#define TX3912_CLK_CTRL_CSERDIV_1 0x00000010
52#define TX3912_CLK_CTRL_ENCSERCLK 0x00000008
53#define TX3912_CLK_CTRL_ENIRCLK 0x00000004
54#define TX3912_CLK_CTRL_ENUARTACLK 0x00000002
55#define TX3912_CLK_CTRL_ENUARTBCLK 0x00000001
56
57
58/*****************************************************************************
59 * Interrupt Subsystem *
60 * ------------------- *
61 * Chapter 8 in Philips PR31700 and Toshiba TMPR3905/12 User Manuals *
62 *****************************************************************************/
63#define TX3912_INT1_CLEAR 0x0100
64#define TX3912_INT2_CLEAR 0x0104
65#define TX3912_INT3_CLEAR 0x0108
66#define TX3912_INT4_CLEAR 0x010c
67#define TX3912_INT5_CLEAR 0x0110
68#define TX3912_INT1_ENABLE 0x0118
69#define TX3912_INT2_ENABLE 0x011c
70#define TX3912_INT3_ENABLE 0x0120
71#define TX3912_INT4_ENABLE 0x0124
72#define TX3912_INT5_ENABLE 0x0128
73#define TX3912_INT6_ENABLE 0x012c
74#define TX3912_INT1_STATUS 0x0100
75#define TX3912_INT2_STATUS 0x0104
76#define TX3912_INT3_STATUS 0x0108
77#define TX3912_INT4_STATUS 0x010c
78#define TX3912_INT5_STATUS 0x0110
79#define TX3912_INT6_STATUS 0x0114
80
81/*
82 * Interrupt 2 register values
83 */
84#define TX3912_INT2_UARTARXINT 0x80000000
85#define TX3912_INT2_UARTARXOVERRUNINT 0x40000000
86#define TX3912_INT2_UARTAFRAMEERRINT 0x20000000
87#define TX3912_INT2_UARTABREAKINT 0x10000000
88#define TX3912_INT2_UARTAPARITYINT 0x08000000
89#define TX3912_INT2_UARTATXINT 0x04000000
90#define TX3912_INT2_UARTATXOVERRUNINT 0x02000000
91#define TX3912_INT2_UARTAEMPTYINT 0x01000000
92#define TX3912_INT2_UARTADMAFULLINT 0x00800000
93#define TX3912_INT2_UARTADMAHALFINT 0x00400000
94#define TX3912_INT2_UARTBRXINT 0x00200000
95#define TX3912_INT2_UARTBRXOVERRUNINT 0x00100000
96#define TX3912_INT2_UARTBFRAMEERRINT 0x00080000
97#define TX3912_INT2_UARTBBREAKINT 0x00040000
98#define TX3912_INT2_UARTBPARITYINT 0x00020000
99#define TX3912_INT2_UARTBTXINT 0x00010000
100#define TX3912_INT2_UARTBTXOVERRUNINT 0x00008000
101#define TX3912_INT2_UARTBEMPTYINT 0x00004000
102#define TX3912_INT2_UARTBDMAFULLINT 0x00002000
103#define TX3912_INT2_UARTBDMAHALFINT 0x00001000
104#define TX3912_INT2_UARTA_RX_BITS 0xf8000000
105#define TX3912_INT2_UARTA_TX_BITS 0x07c00000
106#define TX3912_INT2_UARTB_RX_BITS 0x003e0000
107#define TX3912_INT2_UARTB_TX_BITS 0x0001f000
108
109/*
110 * Interrupt 5 register values
111 */
112#define TX3912_INT5_RTCINT 0x80000000
113#define TX3912_INT5_ALARMINT 0x40000000
114#define TX3912_INT5_PERINT 0x20000000
115#define TX3912_INT5_STPTIMERINT 0x10000000
116#define TX3912_INT5_POSPWRINT 0x08000000
117#define TX3912_INT5_NEGPWRINT 0x04000000
118#define TX3912_INT5_POSPWROKINT 0x02000000
119#define TX3912_INT5_NEGPWROKINT 0x01000000
120#define TX3912_INT5_POSONBUTINT 0x00800000
121#define TX3912_INT5_NEGONBUTINT 0x00400000
122#define TX3912_INT5_SPIBUFAVAILINT 0x00200000
123#define TX3912_INT5_SPIERRINT 0x00100000
124#define TX3912_INT5_SPIRCVINT 0x00080000
125#define TX3912_INT5_SPIEMPTYINT 0x00040000
126#define TX3912_INT5_IRCONSMINT 0x00020000
127#define TX3912_INT5_CARSTINT 0x00010000
128#define TX3912_INT5_POSCARINT 0x00008000
129#define TX3912_INT5_NEGCARINT 0x00004000
130#define TX3912_INT5_IOPOSINT6 0x00002000
131#define TX3912_INT5_IOPOSINT5 0x00001000
132#define TX3912_INT5_IOPOSINT4 0x00000800
133#define TX3912_INT5_IOPOSINT3 0x00000400
134#define TX3912_INT5_IOPOSINT2 0x00000200
135#define TX3912_INT5_IOPOSINT1 0x00000100
136#define TX3912_INT5_IOPOSINT0 0x00000080
137#define TX3912_INT5_IONEGINT6 0x00000040
138#define TX3912_INT5_IONEGINT5 0x00000020
139#define TX3912_INT5_IONEGINT4 0x00000010
140#define TX3912_INT5_IONEGINT3 0x00000008
141#define TX3912_INT5_IONEGINT2 0x00000004
142#define TX3912_INT5_IONEGINT1 0x00000002
143#define TX3912_INT5_IONEGINT0 0x00000001
144
145/*
146 * Interrupt 6 status register values
147 */
148#define TX3912_INT6_STATUS_IRQHIGH 0x80000000
149#define TX3912_INT6_STATUS_IRQLOW 0x40000000
150#define TX3912_INT6_STATUS_reserved6 0x3fffffc0
151#define TX3912_INT6_STATUS_INTVEC_POSNEGPWROKINT 0x0000003c
152#define TX3912_INT6_STATUS_INTVEC_ALARMINT 0x00000038
153#define TX3912_INT6_STATUS_INTVEC_PERINT 0x00000034
154#define TX3912_INT6_STATUS_INTVEC_reserved5 0x00000030
155#define TX3912_INT6_STATUS_INTVEC_UARTARXINT 0x0000002c
156#define TX3912_INT6_STATUS_INTVEC_UARTBRXINT 0x00000028
157#define TX3912_INT6_STATUS_INTVEC_reserved4 0x00000024
158#define TX3912_INT6_STATUS_INTVEC_IOPOSINT65 0x00000020
159#define TX3912_INT6_STATUS_INTVEC_reserved3 0x0000001c
160#define TX3912_INT6_STATUS_INTVEC_IONEGINT65 0x00000018
161#define TX3912_INT6_STATUS_INTVEC_reserved2 0x00000014
162#define TX3912_INT6_STATUS_INTVEC_SNDDMACNTINT 0x00000010
163#define TX3912_INT6_STATUS_INTVEC_TELDMACNTINT 0x0000000c
164#define TX3912_INT6_STATUS_INTVEC_CHIDMACNTINT 0x00000008
165#define TX3912_INT6_STATUS_INTVEC_IOPOSNEGINT0 0x00000004
166#define TX3912_INT6_STATUS_INTVEC_STDHANDLER 0x00000000
167#define TX3912_INT6_STATUS_reserved1 0x00000003
168
169/*
170 * Interrupt 6 enable register values
171 */
172#define TX3912_INT6_ENABLE_reserved5 0xfff80000
173#define TX3912_INT6_ENABLE_GLOBALEN 0x00040000
174#define TX3912_INT6_ENABLE_IRQPRITEST 0x00020000
175#define TX3912_INT6_ENABLE_IRQTEST 0x00010000
176#define TX3912_INT6_ENABLE_PRIORITYMASK_POSNEGPWROKINT 0x00008000
177#define TX3912_INT6_ENABLE_PRIORITYMASK_ALARMINT 0x00004000
178#define TX3912_INT6_ENABLE_PRIORITYMASK_PERINT 0x00002000
179#define TX3912_INT6_ENABLE_PRIORITYMASK_reserved4 0x00001000
180#define TX3912_INT6_ENABLE_PRIORITYMASK_UARTARXINT 0x00000800
181#define TX3912_INT6_ENABLE_PRIORITYMASK_UARTBRXINT 0x00000400
182#define TX3912_INT6_ENABLE_PRIORITYMASK_reserved3 0x00000200
183#define TX3912_INT6_ENABLE_PRIORITYMASK_IOPOSINT65 0x00000100
184#define TX3912_INT6_ENABLE_PRIORITYMASK_reserved2 0x00000080
185#define TX3912_INT6_ENABLE_PRIORITYMASK_IONEGINT65 0x00000040
186#define TX3912_INT6_ENABLE_PRIORITYMASK_reserved1 0x00000020
187#define TX3912_INT6_ENABLE_PRIORITYMASK_SNDDMACNTINT 0x00000010
188#define TX3912_INT6_ENABLE_PRIORITYMASK_TELDMACNTINT 0x00000008
189#define TX3912_INT6_ENABLE_PRIORITYMASK_CHIDMACNTINT 0x00000004
190#define TX3912_INT6_ENABLE_PRIORITYMASK_IOPOSNEGINT0 0x00000002
191#define TX3912_INT6_ENABLE_PRIORITYMASK_STDHANDLER 0x00000001
192#define TX3912_INT6_ENABLE_HIGH_PRIORITY 0x0000ffff
193
194
195/*****************************************************************************
196 * Power Subsystem *
197 * --------------- *
198 * Chapter 11 in Philips PR31700 User Manual *
199 * Chapter 12 in Toshiba TMPR3905/12 User Manual *
200 *****************************************************************************/
201#define TX3912_POWER_CTRL 0x01c4
202
203/*
204 * Power control register values
205 */
206#define TX3912_POWER_CTRL_ONBUTN 0x80000000
207#define TX3912_POWER_CTRL_PWRINT 0x40000000
208#define TX3912_POWER_CTRL_PWROK 0x20000000
209#define TX3912_POWER_CTRL_VIDRF_MASK 0x18000000
210#define TX3912_POWER_CTRL_SLOWBUS 0x04000000
211#define TX3912_POWER_CTRL_DIVMOD 0x02000000
212#define TX3912_POWER_CTRL_reserved2 0x01ff0000
213#define TX3912_POWER_CTRL_STPTIMERVAL_MASK 0x0000f000
214#define TX3912_POWER_CTRL_ENSTPTIMER 0x00000800
215#define TX3912_POWER_CTRL_ENFORCESHUTDWN 0x00000400
216#define TX3912_POWER_CTRL_FORCESHUTDWN 0x00000200
217#define TX3912_POWER_CTRL_FORCESHUTDWNOCC 0x00000100
218#define TX3912_POWER_CTRL_SELC2MS 0x00000080
219#define TX3912_POWER_CTRL_reserved1 0x00000040
220#define TX3912_POWER_CTRL_BPDBVCC3 0x00000020
221#define TX3912_POWER_CTRL_STOPCPU 0x00000010
222#define TX3912_POWER_CTRL_DBNCONBUTN 0x00000008
223#define TX3912_POWER_CTRL_COLDSTART 0x00000004
224#define TX3912_POWER_CTRL_PWRCS 0x00000002
225#define TX3912_POWER_CTRL_VCCON 0x00000001
226
227
228/*****************************************************************************
229 * Timer Subsystem *
230 * --------------- *
231 * Chapter 14 in Philips PR31700 User Manual *
232 * Chapter 15 in Toshiba TMPR3905/12 User Manual *
233 *****************************************************************************/
234#define TX3912_RTC_HIGH 0x0140
235#define TX3912_RTC_LOW 0x0144
236#define TX3912_RTC_ALARM_HIGH 0x0148
237#define TX3912_RTC_ALARM_LOW 0x014c
238#define TX3912_TIMER_CTRL 0x0150
239#define TX3912_TIMER_PERIOD 0x0154
240
241/*
242 * Timer control register values
243 */
244#define TX3912_TIMER_CTRL_FREEZEPRE 0x00000080
245#define TX3912_TIMER_CTRL_FREEZERTC 0x00000040
246#define TX3912_TIMER_CTRL_FREEZETIMER 0x00000020
247#define TX3912_TIMER_CTRL_ENPERTIMER 0x00000010
248#define TX3912_TIMER_CTRL_RTCCLEAR 0x00000008
249#define TX3912_TIMER_CTRL_TESTC8MS 0x00000004
250#define TX3912_TIMER_CTRL_ENTESTCLK 0x00000002
251#define TX3912_TIMER_CTRL_ENRTCTST 0x00000001
252
253/*
254 * The periodic timer has granularity of 868 nanoseconds which
255 * results in a count of (1.152 x 10^6 / 100) in order to achieve
256 * a 10 millisecond periodic system clock.
257 */
258#define TX3912_SYS_TIMER_VALUE (1152000/HZ)
259
260
261/*****************************************************************************
262 * UART Subsystem *
263 * -------------- *
264 * Chapter 15 in Philips PR31700 User Manual *
265 * Chapter 16 in Toshiba TMPR3905/12 User Manual *
266 *****************************************************************************/
267#define TX3912_UARTA_CTRL1 0x00b0
268#define TX3912_UARTA_CTRL2 0x00b4
269#define TX3912_UARTA_DMA_CTRL1 0x00b8
270#define TX3912_UARTA_DMA_CTRL2 0x00bc
271#define TX3912_UARTA_DMA_CNT 0x00c0
272#define TX3912_UARTA_DATA 0x00c4
273#define TX3912_UARTB_CTRL1 0x00c8
274#define TX3912_UARTB_CTRL2 0x00cc
275#define TX3912_UARTB_DMA_CTRL1 0x00d0
276#define TX3912_UARTB_DMA_CTRL2 0x00d4
277#define TX3912_UARTB_DMA_CNT 0x00d8
278#define TX3912_UARTB_DATA 0x00dc
279
280/*
281 * UART Control Register 1 values
282 */
283#define TX3912_UART_CTRL1_UARTON 0x80000000
284#define TX3912_UART_CTRL1_EMPTY 0x40000000
285#define TX3912_UART_CTRL1_PRXHOLDFULL 0x20000000
286#define TX3912_UART_CTRL1_RXHOLDFULL 0x10000000
287#define TX3912_UART_CTRL1_reserved1 0x0fff0000
288#define TX3912_UART_CTRL1_ENDMARX 0x00008000
289#define TX3912_UART_CTRL1_ENDMATX 0x00004000
290#define TX3912_UART_CTRL1_TESTMODE 0x00002000
291#define TX3912_UART_CTRL1_ENBREAKHALT 0x00001000
292#define TX3912_UART_CTRL1_ENDMATEST 0x00000800
293#define TX3912_UART_CTRL1_ENDMALOOP 0x00000400
294#define TX3912_UART_CTRL1_PULSEOPT1 0x00000200
295#define TX3912_UART_CTRL1_PULSEOPT1 0x00000100
296#define TX3912_UART_CTRL1_DTINVERT 0x00000080
297#define TX3912_UART_CTRL1_DISTXD 0x00000040
298#define TX3912_UART_CTRL1_TWOSTOP 0x00000020
299#define TX3912_UART_CTRL1_LOOPBACK 0x00000010
300#define TX3912_UART_CTRL1_BIT_7 0x00000008
301#define TX3912_UART_CTRL1_EVENPARITY 0x00000004
302#define TX3912_UART_CTRL1_ENPARITY 0x00000002
303#define TX3912_UART_CTRL1_ENUART 0x00000001
304
305/*
306 * UART Control Register 2 values
307 */
308#define TX3912_UART_CTRL2_B230400 0x0000 /* 0 */
309#define TX3912_UART_CTRL2_B115200 0x0001 /* 1 */
310#define TX3912_UART_CTRL2_B76800 0x0002 /* 2 */
311#define TX3912_UART_CTRL2_B57600 0x0003 /* 3 */
312#define TX3912_UART_CTRL2_B38400 0x0005 /* 5 */
313#define TX3912_UART_CTRL2_B19200 0x000b /* 11 */
314#define TX3912_UART_CTRL2_B9600 0x0016 /* 22 */
315#define TX3912_UART_CTRL2_B4800 0x002f /* 47 */
316#define TX3912_UART_CTRL2_B2400 0x005f /* 95 */
317#define TX3912_UART_CTRL2_B1200 0x00bf /* 191 */
318#define TX3912_UART_CTRL2_B600 0x017f /* 383 */
319#define TX3912_UART_CTRL2_B300 0x02ff /* 767 */
320
321/*****************************************************************************
322 * Video Subsystem *
323 * --------------- *
324 * Chapter 16 in Philips PR31700 User Manual *
325 * Chapter 17 in Toshiba TMPR3905/12 User Manual *
326 *****************************************************************************/
327#define TX3912_VIDEO_CTRL1 0x0028
328#define TX3912_VIDEO_CTRL2 0x002c
329#define TX3912_VIDEO_CTRL3 0x0030
330#define TX3912_VIDEO_CTRL4 0x0034
331#define TX3912_VIDEO_CTRL5 0x0038
332#define TX3912_VIDEO_CTRL6 0x003c
333#define TX3912_VIDEO_CTRL7 0x0040
334#define TX3912_VIDEO_CTRL8 0x0044
335#define TX3912_VIDEO_CTRL9 0x0048
336#define TX3912_VIDEO_CTRL10 0x004c
337#define TX3912_VIDEO_CTRL11 0x0050
338#define TX3912_VIDEO_CTRL12 0x0054
339#define TX3912_VIDEO_CTRL13 0x0058
340#define TX3912_VIDEO_CTRL14 0x005c
341
342/*
343 * Video Control Register 1 values
344 */
345#define TX3912_VIDEO_CTRL1_LINECNT 0xffc00000
346#define TX3912_VIDEO_CTRL1_LOADDLY 0x00200000
347#define TX3912_VIDEO_CTRL1_BAUDVAL 0x001f0000
348#define TX3912_VIDEO_CTRL1_VIDDONEVAL 0x0000fe00
349#define TX3912_VIDEO_CTRL1_ENFREEZEFRAME 0x00000100
350#define TX3912_VIDEO_CTRL1_BITSEL_MASK 0x000000c0
351#define TX3912_VIDEO_CTRL1_BITSEL_8BIT_COLOR 0x000000c0
352#define TX3912_VIDEO_CTRL1_BITSEL_4BIT_GRAY 0x00000080
353#define TX3912_VIDEO_CTRL1_BITSEL_2BIT_GRAY 0x00000040
354#define TX3912_VIDEO_CTRL1_DISPSPLIT 0x00000020
355#define TX3912_VIDEO_CTRL1_DISP8 0x00000010
356#define TX3912_VIDEO_CTRL1_DFMODE 0x00000008
357#define TX3912_VIDEO_CTRL1_INVVID 0x00000004
358#define TX3912_VIDEO_CTRL1_DISPON 0x00000002
359#define TX3912_VIDEO_CTRL1_ENVID 0x00000001
360
361#endif /* _TX3912_H_ */
diff --git a/include/asm-mips/tx4927/toshiba_rbtx4927.h b/include/asm-mips/tx4927/toshiba_rbtx4927.h
index 94bef03d9635..a60649569c2c 100644
--- a/include/asm-mips/tx4927/toshiba_rbtx4927.h
+++ b/include/asm-mips/tx4927/toshiba_rbtx4927.h
@@ -50,6 +50,8 @@
50 50
51 51
52#define RBTX4927_RTL_8019_BASE (0x1c020280-TBTX4927_ISA_IO_OFFSET) 52#define RBTX4927_RTL_8019_BASE (0x1c020280-TBTX4927_ISA_IO_OFFSET)
53#define RBTX4927_RTL_8019_IRQ (29) 53#define RBTX4927_RTL_8019_IRQ (TX4927_IRQ_PIC_BEG + 5)
54
55int toshiba_rbtx4927_irq_nested(int sw_irq);
54 56
55#endif /* __ASM_TX4927_TOSHIBA_RBTX4927_H */ 57#endif /* __ASM_TX4927_TOSHIBA_RBTX4927_H */
diff --git a/include/asm-mips/tx4927/tx4927.h b/include/asm-mips/tx4927/tx4927.h
index de85bd2245f7..4bd4368e188c 100644
--- a/include/asm-mips/tx4927/tx4927.h
+++ b/include/asm-mips/tx4927/tx4927.h
@@ -28,6 +28,7 @@
28#define __ASM_TX4927_TX4927_H 28#define __ASM_TX4927_TX4927_H
29 29
30#include <asm/tx4927/tx4927_mips.h> 30#include <asm/tx4927/tx4927_mips.h>
31#include <asm/txx9irq.h>
31 32
32/* 33/*
33 This register naming came from the integrated CPU/controller name TX4927 34 This register naming came from the integrated CPU/controller name TX4927
@@ -421,32 +422,6 @@
421#define TX4927_PIO_LIMIT 0xf50f 422#define TX4927_PIO_LIMIT 0xf50f
422 423
423 424
424/* TX4927 Interrupt Controller (32-bit registers) */
425#define TX4927_IRC_BASE 0xf510
426#define TX4927_IRC_IRFLAG0 0xf510
427#define TX4927_IRC_IRFLAG1 0xf514
428#define TX4927_IRC_IRPOL 0xf518
429#define TX4927_IRC_IRRCNT 0xf51c
430#define TX4927_IRC_IRMASKINT 0xf520
431#define TX4927_IRC_IRMASKEXT 0xf524
432#define TX4927_IRC_IRDEN 0xf600
433#define TX4927_IRC_IRDM0 0xf604
434#define TX4927_IRC_IRDM1 0xf608
435#define TX4927_IRC_IRLVL0 0xf610
436#define TX4927_IRC_IRLVL1 0xf614
437#define TX4927_IRC_IRLVL2 0xf618
438#define TX4927_IRC_IRLVL3 0xf61c
439#define TX4927_IRC_IRLVL4 0xf620
440#define TX4927_IRC_IRLVL5 0xf624
441#define TX4927_IRC_IRLVL6 0xf628
442#define TX4927_IRC_IRLVL7 0xf62c
443#define TX4927_IRC_IRMSK 0xf640
444#define TX4927_IRC_IREDC 0xf660
445#define TX4927_IRC_IRPND 0xf680
446#define TX4927_IRC_IRCS 0xf6a0
447#define TX4927_IRC_LIMIT 0xf6ff
448
449
450/* TX4927 AC-link controller (32-bit registers) */ 425/* TX4927 AC-link controller (32-bit registers) */
451#define TX4927_ACLC_BASE 0xf700 426#define TX4927_ACLC_BASE 0xf700
452#define TX4927_ACLC_ACCTLEN 0xf700 427#define TX4927_ACLC_ACCTLEN 0xf700
@@ -493,25 +468,11 @@
493#define TX4927_WR( reg, val ) TX4927_WR32( reg, val ) 468#define TX4927_WR( reg, val ) TX4927_WR32( reg, val )
494 469
495 470
471#define TX4927_IRQ_CP0_BEG MIPS_CPU_IRQ_BASE
472#define TX4927_IRQ_CP0_END (MIPS_CPU_IRQ_BASE + 8 - 1)
496 473
497 474#define TX4927_IRQ_PIC_BEG TXX9_IRQ_BASE
498 475#define TX4927_IRQ_PIC_END (TXX9_IRQ_BASE + TXx9_MAX_IR - 1)
499#define MI8259_IRQ_ISA_RAW_BEG 0 /* optional backplane i8259 */
500#define MI8259_IRQ_ISA_RAW_END 15
501#define TX4927_IRQ_CP0_RAW_BEG 0 /* tx4927 cpu built-in cp0 */
502#define TX4927_IRQ_CP0_RAW_END 7
503#define TX4927_IRQ_PIC_RAW_BEG 0 /* tx4927 cpu build-in pic */
504#define TX4927_IRQ_PIC_RAW_END 31
505
506
507#define MI8259_IRQ_ISA_BEG MI8259_IRQ_ISA_RAW_BEG /* 0 */
508#define MI8259_IRQ_ISA_END MI8259_IRQ_ISA_RAW_END /* 15 */
509
510#define TX4927_IRQ_CP0_BEG ((MI8259_IRQ_ISA_END+1)+TX4927_IRQ_CP0_RAW_BEG) /* 16 */
511#define TX4927_IRQ_CP0_END ((MI8259_IRQ_ISA_END+1)+TX4927_IRQ_CP0_RAW_END) /* 23 */
512
513#define TX4927_IRQ_PIC_BEG ((TX4927_IRQ_CP0_END+1)+TX4927_IRQ_PIC_RAW_BEG) /* 24 */
514#define TX4927_IRQ_PIC_END ((TX4927_IRQ_CP0_END+1)+TX4927_IRQ_PIC_RAW_END) /* 55 */
515 476
516 477
517#define TX4927_IRQ_USER0 (TX4927_IRQ_CP0_BEG+0) 478#define TX4927_IRQ_USER0 (TX4927_IRQ_CP0_BEG+0)
diff --git a/include/asm-mips/tx4927/tx4927_pci.h b/include/asm-mips/tx4927/tx4927_pci.h
index 66c064690f41..f98b2bb719d5 100644
--- a/include/asm-mips/tx4927/tx4927_pci.h
+++ b/include/asm-mips/tx4927/tx4927_pci.h
@@ -48,7 +48,7 @@
48#define TX4927_PCI_CLK_ACK 0x04 48#define TX4927_PCI_CLK_ACK 0x04
49#define TX4927_PCI_CLK_ACE 0x02 49#define TX4927_PCI_CLK_ACE 0x02
50#define TX4927_PCI_CLK_ENDIAN 0x01 50#define TX4927_PCI_CLK_ENDIAN 0x01
51#define TX4927_NR_IRQ_LOCAL (8+16) 51#define TX4927_NR_IRQ_LOCAL TX4927_IRQ_PIC_BEG
52#define TX4927_NR_IRQ_IRC 32 /* On-Chip IRC */ 52#define TX4927_NR_IRQ_IRC 32 /* On-Chip IRC */
53 53
54#define TX4927_IR_PCIC 16 54#define TX4927_IR_PCIC 16
@@ -99,21 +99,6 @@ struct tx4927_ccfg_reg {
99 volatile unsigned long long ramp; 99 volatile unsigned long long ramp;
100}; 100};
101 101
102struct tx4927_irc_reg {
103 volatile unsigned long cer;
104 volatile unsigned long cr[2];
105 volatile unsigned long unused0;
106 volatile unsigned long ilr[8];
107 volatile unsigned long unused1[4];
108 volatile unsigned long imr;
109 volatile unsigned long unused2[7];
110 volatile unsigned long scr;
111 volatile unsigned long unused3[7];
112 volatile unsigned long ssr;
113 volatile unsigned long unused4[7];
114 volatile unsigned long csr;
115};
116
117struct tx4927_pcic_reg { 102struct tx4927_pcic_reg {
118 volatile unsigned long pciid; 103 volatile unsigned long pciid;
119 volatile unsigned long pcistatus; 104 volatile unsigned long pcistatus;
@@ -182,11 +167,6 @@ struct tx4927_pcic_reg {
182 167
183#endif /* _LANGUAGE_ASSEMBLY */ 168#endif /* _LANGUAGE_ASSEMBLY */
184 169
185/* IRCSR : Int. Current Status */
186#define TX4927_IRCSR_IF 0x00010000
187#define TX4927_IRCSR_ILV_MASK 0x00000700
188#define TX4927_IRCSR_IVL_MASK 0x0000001f
189
190/* 170/*
191 * PCIC 171 * PCIC
192 */ 172 */
@@ -278,7 +258,6 @@ struct tx4927_pcic_reg {
278#define tx4927_pcicptr ((struct tx4927_pcic_reg *)TX4927_PCIC_REG) 258#define tx4927_pcicptr ((struct tx4927_pcic_reg *)TX4927_PCIC_REG)
279#define tx4927_ccfgptr ((struct tx4927_ccfg_reg *)TX4927_CCFG_REG) 259#define tx4927_ccfgptr ((struct tx4927_ccfg_reg *)TX4927_CCFG_REG)
280#define tx4927_ebuscptr ((struct tx4927_ebusc_reg *)TX4927_EBUSC_REG) 260#define tx4927_ebuscptr ((struct tx4927_ebusc_reg *)TX4927_EBUSC_REG)
281#define tx4927_ircptr ((struct tx4927_irc_reg *)TX4927_IRC_REG)
282 261
283#endif /* _LANGUAGE_ASSEMBLY */ 262#endif /* _LANGUAGE_ASSEMBLY */
284 263
diff --git a/include/asm-mips/tx4938/rbtx4938.h b/include/asm-mips/tx4938/rbtx4938.h
index 74e7d8061e58..b14acb575be2 100644
--- a/include/asm-mips/tx4938/rbtx4938.h
+++ b/include/asm-mips/tx4938/rbtx4938.h
@@ -14,6 +14,7 @@
14 14
15#include <asm/addrspace.h> 15#include <asm/addrspace.h>
16#include <asm/tx4938/tx4938.h> 16#include <asm/tx4938/tx4938.h>
17#include <asm/txx9irq.h>
17 18
18/* CS */ 19/* CS */
19#define RBTX4938_CE0 0x1c000000 /* 64M */ 20#define RBTX4938_CE0 0x1c000000 /* 64M */
@@ -123,21 +124,11 @@
123#define RBTX4938_NR_IRQ_IRC 32 /* On-Chip IRC */ 124#define RBTX4938_NR_IRQ_IRC 32 /* On-Chip IRC */
124#define RBTX4938_NR_IRQ_IOC 8 125#define RBTX4938_NR_IRQ_IOC 8
125 126
126#define MI8259_IRQ_ISA_RAW_BEG 0 /* optional backplane i8259 */ 127#define TX4938_IRQ_CP0_BEG MIPS_CPU_IRQ_BASE
127#define MI8259_IRQ_ISA_RAW_END 15 128#define TX4938_IRQ_CP0_END (MIPS_CPU_IRQ_BASE + 8 - 1)
128#define TX4938_IRQ_CP0_RAW_BEG 0 /* tx4938 cpu built-in cp0 */
129#define TX4938_IRQ_CP0_RAW_END 7
130#define TX4938_IRQ_PIC_RAW_BEG 0 /* tx4938 cpu build-in pic */
131#define TX4938_IRQ_PIC_RAW_END 31
132 129
133#define MI8259_IRQ_ISA_BEG MI8259_IRQ_ISA_RAW_BEG /* 0 */ 130#define TX4938_IRQ_PIC_BEG TXX9_IRQ_BASE
134#define MI8259_IRQ_ISA_END MI8259_IRQ_ISA_RAW_END /* 15 */ 131#define TX4938_IRQ_PIC_END (TXX9_IRQ_BASE + TXx9_MAX_IR - 1)
135
136#define TX4938_IRQ_CP0_BEG ((MI8259_IRQ_ISA_END+1)+TX4938_IRQ_CP0_RAW_BEG) /* 16 */
137#define TX4938_IRQ_CP0_END ((MI8259_IRQ_ISA_END+1)+TX4938_IRQ_CP0_RAW_END) /* 23 */
138
139#define TX4938_IRQ_PIC_BEG ((TX4938_IRQ_CP0_END+1)+TX4938_IRQ_PIC_RAW_BEG) /* 24 */
140#define TX4938_IRQ_PIC_END ((TX4938_IRQ_CP0_END+1)+TX4938_IRQ_PIC_RAW_END) /* 55 */
141#define TX4938_IRQ_NEST_EXT_ON_PIC (TX4938_IRQ_PIC_BEG+2) 132#define TX4938_IRQ_NEST_EXT_ON_PIC (TX4938_IRQ_PIC_BEG+2)
142#define TX4938_IRQ_NEST_PIC_ON_CP0 (TX4938_IRQ_CP0_BEG+2) 133#define TX4938_IRQ_NEST_PIC_ON_CP0 (TX4938_IRQ_CP0_BEG+2)
143#define TX4938_IRQ_USER0 (TX4938_IRQ_CP0_BEG+0) 134#define TX4938_IRQ_USER0 (TX4938_IRQ_CP0_BEG+0)
@@ -192,10 +183,4 @@
192#define RBTX4938_RTL_8019_BASE (RBTX4938_ETHER_ADDR - mips_io_port_base) 183#define RBTX4938_RTL_8019_BASE (RBTX4938_ETHER_ADDR - mips_io_port_base)
193#define RBTX4938_RTL_8019_IRQ (RBTX4938_IRQ_ETHER) 184#define RBTX4938_RTL_8019_IRQ (RBTX4938_IRQ_ETHER)
194 185
195/* IRCR : Int. Control */
196#define TX4938_IRCR_LOW 0x00000000
197#define TX4938_IRCR_HIGH 0x00000001
198#define TX4938_IRCR_DOWN 0x00000002
199#define TX4938_IRCR_UP 0x00000003
200
201#endif /* __ASM_TX_BOARDS_RBTX4938_H */ 186#endif /* __ASM_TX_BOARDS_RBTX4938_H */
diff --git a/include/asm-mips/tx4938/tx4938.h b/include/asm-mips/tx4938/tx4938.h
index e25b1a0975cb..afdb19813ca1 100644
--- a/include/asm-mips/tx4938/tx4938.h
+++ b/include/asm-mips/tx4938/tx4938.h
@@ -272,20 +272,6 @@ struct tx4938_pio_reg {
272 volatile unsigned long maskcpu; 272 volatile unsigned long maskcpu;
273 volatile unsigned long maskext; 273 volatile unsigned long maskext;
274}; 274};
275struct tx4938_irc_reg {
276 volatile unsigned long cer;
277 volatile unsigned long cr[2];
278 volatile unsigned long unused0;
279 volatile unsigned long ilr[8];
280 volatile unsigned long unused1[4];
281 volatile unsigned long imr;
282 volatile unsigned long unused2[7];
283 volatile unsigned long scr;
284 volatile unsigned long unused3[7];
285 volatile unsigned long ssr;
286 volatile unsigned long unused4[7];
287 volatile unsigned long csr;
288};
289 275
290struct tx4938_ndfmc_reg { 276struct tx4938_ndfmc_reg {
291 endian_def_l2(unused0, dtr); 277 endian_def_l2(unused0, dtr);
@@ -646,39 +632,12 @@ struct tx4938_ccfg_reg {
646#define TX4938_DMA_CSR_DESERR 0x00000002 632#define TX4938_DMA_CSR_DESERR 0x00000002
647#define TX4938_DMA_CSR_SORERR 0x00000001 633#define TX4938_DMA_CSR_SORERR 0x00000001
648 634
649/* TX4938 Interrupt Controller (32-bit registers) */
650#define TX4938_IRC_BASE 0xf510
651#define TX4938_IRC_IRFLAG0 0xf510
652#define TX4938_IRC_IRFLAG1 0xf514
653#define TX4938_IRC_IRPOL 0xf518
654#define TX4938_IRC_IRRCNT 0xf51c
655#define TX4938_IRC_IRMASKINT 0xf520
656#define TX4938_IRC_IRMASKEXT 0xf524
657#define TX4938_IRC_IRDEN 0xf600
658#define TX4938_IRC_IRDM0 0xf604
659#define TX4938_IRC_IRDM1 0xf608
660#define TX4938_IRC_IRLVL0 0xf610
661#define TX4938_IRC_IRLVL1 0xf614
662#define TX4938_IRC_IRLVL2 0xf618
663#define TX4938_IRC_IRLVL3 0xf61c
664#define TX4938_IRC_IRLVL4 0xf620
665#define TX4938_IRC_IRLVL5 0xf624
666#define TX4938_IRC_IRLVL6 0xf628
667#define TX4938_IRC_IRLVL7 0xf62c
668#define TX4938_IRC_IRMSK 0xf640
669#define TX4938_IRC_IREDC 0xf660
670#define TX4938_IRC_IRPND 0xf680
671#define TX4938_IRC_IRCS 0xf6a0
672#define TX4938_IRC_LIMIT 0xf6ff
673
674
675#ifndef __ASSEMBLY__ 635#ifndef __ASSEMBLY__
676 636
677#define tx4938_sdramcptr ((struct tx4938_sdramc_reg *)TX4938_SDRAMC_REG) 637#define tx4938_sdramcptr ((struct tx4938_sdramc_reg *)TX4938_SDRAMC_REG)
678#define tx4938_ebuscptr ((struct tx4938_ebusc_reg *)TX4938_EBUSC_REG) 638#define tx4938_ebuscptr ((struct tx4938_ebusc_reg *)TX4938_EBUSC_REG)
679#define tx4938_dmaptr(ch) ((struct tx4938_dma_reg *)TX4938_DMA_REG(ch)) 639#define tx4938_dmaptr(ch) ((struct tx4938_dma_reg *)TX4938_DMA_REG(ch))
680#define tx4938_ndfmcptr ((struct tx4938_ndfmc_reg *)TX4938_NDFMC_REG) 640#define tx4938_ndfmcptr ((struct tx4938_ndfmc_reg *)TX4938_NDFMC_REG)
681#define tx4938_ircptr ((struct tx4938_irc_reg *)TX4938_IRC_REG)
682#define tx4938_pcicptr ((struct tx4938_pcic_reg *)TX4938_PCIC_REG) 641#define tx4938_pcicptr ((struct tx4938_pcic_reg *)TX4938_PCIC_REG)
683#define tx4938_pcic1ptr ((struct tx4938_pcic_reg *)TX4938_PCIC1_REG) 642#define tx4938_pcic1ptr ((struct tx4938_pcic_reg *)TX4938_PCIC1_REG)
684#define tx4938_ccfgptr ((struct tx4938_ccfg_reg *)TX4938_CCFG_REG) 643#define tx4938_ccfgptr ((struct tx4938_ccfg_reg *)TX4938_CCFG_REG)
diff --git a/include/asm-mips/txx9irq.h b/include/asm-mips/txx9irq.h
new file mode 100644
index 000000000000..1c439e51b875
--- /dev/null
+++ b/include/asm-mips/txx9irq.h
@@ -0,0 +1,30 @@
1/*
2 * include/asm-mips/txx9irq.h
3 * TX39/TX49 interrupt controller definitions.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9#ifndef __ASM_TXX9IRQ_H
10#define __ASM_TXX9IRQ_H
11
12#include <irq.h>
13
14#ifdef CONFIG_IRQ_CPU
15#define TXX9_IRQ_BASE (MIPS_CPU_IRQ_BASE + 8)
16#else
17#define TXX9_IRQ_BASE 0
18#endif
19
20#ifdef CONFIG_CPU_TX39XX
21#define TXx9_MAX_IR 16
22#else
23#define TXx9_MAX_IR 32
24#endif
25
26void txx9_irq_init(unsigned long baseaddr);
27int txx9_irq(void);
28int txx9_irq_set_pri(int irc_irq, int new_pri);
29
30#endif /* __ASM_TXX9IRQ_H */
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index ed16de0a6398..fa9a587b3bf1 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -340,16 +340,17 @@
340#define __NR_signalfd (__NR_Linux + 317) 340#define __NR_signalfd (__NR_Linux + 317)
341#define __NR_timerfd (__NR_Linux + 318) 341#define __NR_timerfd (__NR_Linux + 318)
342#define __NR_eventfd (__NR_Linux + 319) 342#define __NR_eventfd (__NR_Linux + 319)
343#define __NR_fallocate (__NR_Linux + 320)
343 344
344/* 345/*
345 * Offset of the last Linux o32 flavoured syscall 346 * Offset of the last Linux o32 flavoured syscall
346 */ 347 */
347#define __NR_Linux_syscalls 319 348#define __NR_Linux_syscalls 320
348 349
349#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 350#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
350 351
351#define __NR_O32_Linux 4000 352#define __NR_O32_Linux 4000
352#define __NR_O32_Linux_syscalls 319 353#define __NR_O32_Linux_syscalls 320
353 354
354#if _MIPS_SIM == _MIPS_SIM_ABI64 355#if _MIPS_SIM == _MIPS_SIM_ABI64
355 356
@@ -636,16 +637,17 @@
636#define __NR_signalfd (__NR_Linux + 276) 637#define __NR_signalfd (__NR_Linux + 276)
637#define __NR_timerfd (__NR_Linux + 277) 638#define __NR_timerfd (__NR_Linux + 277)
638#define __NR_eventfd (__NR_Linux + 278) 639#define __NR_eventfd (__NR_Linux + 278)
640#define __NR_fallocate (__NR_Linux + 279)
639 641
640/* 642/*
641 * Offset of the last Linux 64-bit flavoured syscall 643 * Offset of the last Linux 64-bit flavoured syscall
642 */ 644 */
643#define __NR_Linux_syscalls 278 645#define __NR_Linux_syscalls 279
644 646
645#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 647#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
646 648
647#define __NR_64_Linux 5000 649#define __NR_64_Linux 5000
648#define __NR_64_Linux_syscalls 278 650#define __NR_64_Linux_syscalls 279
649 651
650#if _MIPS_SIM == _MIPS_SIM_NABI32 652#if _MIPS_SIM == _MIPS_SIM_NABI32
651 653
@@ -936,16 +938,17 @@
936#define __NR_signalfd (__NR_Linux + 280) 938#define __NR_signalfd (__NR_Linux + 280)
937#define __NR_timerfd (__NR_Linux + 281) 939#define __NR_timerfd (__NR_Linux + 281)
938#define __NR_eventfd (__NR_Linux + 282) 940#define __NR_eventfd (__NR_Linux + 282)
941#define __NR_fallocate (__NR_Linux + 283)
939 942
940/* 943/*
941 * Offset of the last N32 flavoured syscall 944 * Offset of the last N32 flavoured syscall
942 */ 945 */
943#define __NR_Linux_syscalls 282 946#define __NR_Linux_syscalls 283
944 947
945#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 948#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
946 949
947#define __NR_N32_Linux 6000 950#define __NR_N32_Linux 6000
948#define __NR_N32_Linux_syscalls 282 951#define __NR_N32_Linux_syscalls 283
949 952
950#ifdef __KERNEL__ 953#ifdef __KERNEL__
951 954
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h
index 9de52a5b0f3d..c0715d0a6b28 100644
--- a/include/asm-mips/war.h
+++ b/include/asm-mips/war.h
@@ -182,13 +182,11 @@
182 * exceptions. 182 * exceptions.
183 */ 183 */
184#if defined(CONFIG_BASLER_EXCITE) || defined(CONFIG_MIPS_ATLAS) || \ 184#if defined(CONFIG_BASLER_EXCITE) || defined(CONFIG_MIPS_ATLAS) || \
185 defined(CONFIG_MIPS_MALTA) || defined(CONFIG_MOMENCO_OCELOT) || \ 185 defined(CONFIG_MIPS_MALTA) || defined(CONFIG_PMC_YOSEMITE) || \
186 defined(CONFIG_PMC_YOSEMITE) || defined(CONFIG_SGI_IP32) || \ 186 defined(CONFIG_SGI_IP32) || defined(CONFIG_WR_PPMC)
187 defined(CONFIG_WR_PPMC)
188#define ICACHE_REFILLS_WORKAROUND_WAR 1 187#define ICACHE_REFILLS_WORKAROUND_WAR 1
189#endif 188#endif
190 189
191
192/* 190/*
193 * On the R10000 upto version 2.6 (not sure about 2.7) there is a bug that 191 * On the R10000 upto version 2.6 (not sure about 2.7) there is a bug that
194 * may cause ll / sc and lld / scd sequences to execute non-atomically. 192 * may cause ll / sc and lld / scd sequences to execute non-atomically.
diff --git a/include/asm-parisc/a.out.h b/include/asm-parisc/a.out.h
index 2a490cc9ec91..23e2c90943e5 100644
--- a/include/asm-parisc/a.out.h
+++ b/include/asm-parisc/a.out.h
@@ -23,6 +23,7 @@ struct exec
23 * prumpf */ 23 * prumpf */
24 24
25#define STACK_TOP TASK_SIZE 25#define STACK_TOP TASK_SIZE
26#define STACK_TOP_MAX DEFAULT_TASK_SIZE
26 27
27#endif 28#endif
28 29
diff --git a/include/asm-parisc/bug.h b/include/asm-parisc/bug.h
index 83ba510ed5d8..8cfc553fc837 100644
--- a/include/asm-parisc/bug.h
+++ b/include/asm-parisc/bug.h
@@ -74,7 +74,7 @@
74 74
75 75
76#define WARN_ON(x) ({ \ 76#define WARN_ON(x) ({ \
77 typeof(x) __ret_warn_on = (x); \ 77 int __ret_warn_on = !!(x); \
78 if (__builtin_constant_p(__ret_warn_on)) { \ 78 if (__builtin_constant_p(__ret_warn_on)) { \
79 if (__ret_warn_on) \ 79 if (__ret_warn_on) \
80 __WARN(); \ 80 __WARN(); \
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h
index c0fed91da3a2..4cc9bcec0564 100644
--- a/include/asm-parisc/io.h
+++ b/include/asm-parisc/io.h
@@ -15,6 +15,16 @@ extern unsigned long parisc_vmerge_max_size;
15#define virt_to_bus virt_to_phys 15#define virt_to_bus virt_to_phys
16#define bus_to_virt phys_to_virt 16#define bus_to_virt phys_to_virt
17 17
18static inline unsigned long isa_bus_to_virt(unsigned long addr) {
19 BUG();
20 return 0;
21}
22
23static inline unsigned long isa_virt_to_bus(void *addr) {
24 BUG();
25 return 0;
26}
27
18/* 28/*
19 * Memory mapped I/O 29 * Memory mapped I/O
20 * 30 *
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h
index 21fbfc5afd02..ee80c920b464 100644
--- a/include/asm-parisc/system.h
+++ b/include/asm-parisc/system.h
@@ -48,17 +48,6 @@ extern struct task_struct *_switch_to(struct task_struct *, struct task_struct *
48 (last) = _switch_to(prev, next); \ 48 (last) = _switch_to(prev, next); \
49} while(0) 49} while(0)
50 50
51/*
52 * On SMP systems, when the scheduler does migration-cost autodetection,
53 * it needs a way to flush as much of the CPU's caches as possible.
54 *
55 * TODO: fill this in!
56 */
57static inline void sched_cacheflush(void)
58{
59}
60
61
62/* interrupt control */ 51/* interrupt control */
63#define local_save_flags(x) __asm__ __volatile__("ssm 0, %0" : "=r" (x) : : "memory") 52#define local_save_flags(x) __asm__ __volatile__("ssm 0, %0" : "=r" (x) : : "memory")
64#define local_irq_disable() __asm__ __volatile__("rsm %0,%%r0\n" : : "i" (PSW_I) : "memory" ) 53#define local_irq_disable() __asm__ __volatile__("rsm %0,%%r0\n" : : "i" (PSW_I) : "memory" )
diff --git a/include/asm-parisc/thread_info.h b/include/asm-parisc/thread_info.h
index 949314cf6188..2d9c7500867b 100644
--- a/include/asm-parisc/thread_info.h
+++ b/include/asm-parisc/thread_info.h
@@ -56,23 +56,21 @@ struct thread_info {
56 * thread information flags 56 * thread information flags
57 */ 57 */
58#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 58#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
59#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 59#define TIF_SIGPENDING 1 /* signal pending */
60#define TIF_SIGPENDING 2 /* signal pending */ 60#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
61#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 61#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */
62#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 62#define TIF_32BIT 4 /* 32 bit binary */
63#define TIF_32BIT 5 /* 32 bit binary */ 63#define TIF_MEMDIE 5
64#define TIF_MEMDIE 6 64#define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */
65#define TIF_RESTORE_SIGMASK 7 /* restore saved signal mask */
66 65
67#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 66#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
68#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
69#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 67#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
70#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 68#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
71#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 69#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
72#define _TIF_32BIT (1 << TIF_32BIT) 70#define _TIF_32BIT (1 << TIF_32BIT)
73#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 71#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
74 72
75#define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ 73#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | \
76 _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK) 74 _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK)
77 75
78#endif /* __KERNEL__ */ 76#endif /* __KERNEL__ */
diff --git a/include/asm-parisc/vga.h b/include/asm-parisc/vga.h
new file mode 100644
index 000000000000..154a84c843a7
--- /dev/null
+++ b/include/asm-parisc/vga.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_PARISC_VGA_H__
2#define __ASM_PARISC_VGA_H__
3
4/* nothing */
5
6#endif __ASM_PARISC_VGA_H__
diff --git a/include/asm-powerpc/a.out.h b/include/asm-powerpc/a.out.h
index c7393a977364..5c5ea83f9349 100644
--- a/include/asm-powerpc/a.out.h
+++ b/include/asm-powerpc/a.out.h
@@ -26,9 +26,12 @@ struct exec
26#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ 26#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \
27 STACK_TOP_USER32 : STACK_TOP_USER64) 27 STACK_TOP_USER32 : STACK_TOP_USER64)
28 28
29#define STACK_TOP_MAX STACK_TOP_USER64
30
29#else /* __powerpc64__ */ 31#else /* __powerpc64__ */
30 32
31#define STACK_TOP TASK_SIZE 33#define STACK_TOP TASK_SIZE
34#define STACK_TOP_MAX STACK_TOP
32 35
33#endif /* __powerpc64__ */ 36#endif /* __powerpc64__ */
34#endif /* __KERNEL__ */ 37#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h
index f6fa39474846..e55d1f66b86f 100644
--- a/include/asm-powerpc/bug.h
+++ b/include/asm-powerpc/bug.h
@@ -79,7 +79,7 @@
79 _EMIT_BUG_ENTRY \ 79 _EMIT_BUG_ENTRY \
80 : : "i" (__FILE__), "i" (__LINE__), "i" (0), \ 80 : : "i" (__FILE__), "i" (__LINE__), "i" (0), \
81 "i" (sizeof(struct bug_entry)), \ 81 "i" (sizeof(struct bug_entry)), \
82 "r" ((long)(x))); \ 82 "r" ((__force long)(x))); \
83 } \ 83 } \
84} while (0) 84} while (0)
85 85
@@ -93,7 +93,7 @@
93} while (0) 93} while (0)
94 94
95#define WARN_ON(x) ({ \ 95#define WARN_ON(x) ({ \
96 typeof(x) __ret_warn_on = (x); \ 96 int __ret_warn_on = !!(x); \
97 if (__builtin_constant_p(__ret_warn_on)) { \ 97 if (__builtin_constant_p(__ret_warn_on)) { \
98 if (__ret_warn_on) \ 98 if (__ret_warn_on) \
99 __WARN(); \ 99 __WARN(); \
diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h
index f6bd804d9090..744d6bb24116 100644
--- a/include/asm-powerpc/dma-mapping.h
+++ b/include/asm-powerpc/dma-mapping.h
@@ -95,7 +95,7 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
95 return -EIO; 95 return -EIO;
96 if (dma_ops->set_dma_mask != NULL) 96 if (dma_ops->set_dma_mask != NULL)
97 return dma_ops->set_dma_mask(dev, dma_mask); 97 return dma_ops->set_dma_mask(dev, dma_mask);
98 if (!dev->dma_mask || !dma_supported(dev, *dev->dma_mask)) 98 if (!dev->dma_mask || !dma_supported(dev, dma_mask))
99 return -EIO; 99 return -EIO;
100 *dev->dma_mask = dma_mask; 100 *dev->dma_mask = dma_mask;
101 return 0; 101 return 0;
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index 9537fda238b8..8b08b447d6f3 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -73,12 +73,10 @@ typedef unsigned int kprobe_opcode_t;
73 } \ 73 } \
74} 74}
75 75
76#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry)
77#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ 76#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \
78 IS_TWI(instr) || IS_TDI(instr)) 77 IS_TWI(instr) || IS_TDI(instr))
79#else 78#else
80/* Use stock kprobe_lookup_name since ppc32 doesn't use function descriptors */ 79/* Use stock kprobe_lookup_name since ppc32 doesn't use function descriptors */
81#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)(pentry)
82#define is_trap(instr) (IS_TW(instr) || IS_TWI(instr)) 80#define is_trap(instr) (IS_TW(instr) || IS_TWI(instr))
83#endif 81#endif
84 82
diff --git a/include/asm-powerpc/mmu-hash64.h b/include/asm-powerpc/mmu-hash64.h
index 695962f02059..3112ad14ad95 100644
--- a/include/asm-powerpc/mmu-hash64.h
+++ b/include/asm-powerpc/mmu-hash64.h
@@ -262,6 +262,7 @@ extern void slb_initialize(void);
262extern void slb_flush_and_rebolt(void); 262extern void slb_flush_and_rebolt(void);
263extern void stab_initialize(unsigned long stab); 263extern void stab_initialize(unsigned long stab);
264 264
265extern void slb_vmalloc_update(void);
265#endif /* __ASSEMBLY__ */ 266#endif /* __ASSEMBLY__ */
266 267
267/* 268/*
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index 2ffb06abe881..262db6b8da73 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -296,6 +296,9 @@ struct mpic
296 unsigned int dcr_base; 296 unsigned int dcr_base;
297#endif 297#endif
298 298
299 /* Protected sources */
300 unsigned long *protected;
301
299#ifdef CONFIG_MPIC_WEIRD 302#ifdef CONFIG_MPIC_WEIRD
300 /* Pointer to HW info array */ 303 /* Pointer to HW info array */
301 u32 *hw_set; 304 u32 *hw_set;
diff --git a/include/asm-powerpc/of_device.h b/include/asm-powerpc/of_device.h
index e9af49eb1aa8..ec2a8a2c737c 100644
--- a/include/asm-powerpc/of_device.h
+++ b/include/asm-powerpc/of_device.h
@@ -3,14 +3,12 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/mod_devicetable.h> 6#include <linux/of.h>
7#include <asm/prom.h>
8
9 7
10/* 8/*
11 * The of_device is a kind of "base class" that is a superset of 9 * The of_device is a kind of "base class" that is a superset of
12 * struct device for use by devices attached to an OF node and 10 * struct device for use by devices attached to an OF node and
13 * probed using OF properties 11 * probed using OF properties.
14 */ 12 */
15struct of_device 13struct of_device
16{ 14{
@@ -18,24 +16,14 @@ struct of_device
18 u64 dma_mask; /* DMA mask */ 16 u64 dma_mask; /* DMA mask */
19 struct device dev; /* Generic device interface */ 17 struct device dev; /* Generic device interface */
20}; 18};
21#define to_of_device(d) container_of(d, struct of_device, dev)
22
23extern const struct of_device_id *of_match_node(
24 const struct of_device_id *matches, const struct device_node *node);
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
31extern int of_device_register(struct of_device *ofdev);
32extern void of_device_unregister(struct of_device *ofdev);
33extern void of_release_dev(struct device *dev);
34 19
35extern ssize_t of_device_get_modalias(struct of_device *ofdev, 20extern ssize_t of_device_get_modalias(struct of_device *ofdev,
36 char *str, ssize_t len); 21 char *str, ssize_t len);
37extern int of_device_uevent(struct device *dev, 22extern int of_device_uevent(struct device *dev,
38 char **envp, int num_envp, char *buffer, int buffer_size); 23 char **envp, int num_envp, char *buffer, int buffer_size);
39 24
25/* This is just here during the transition */
26#include <linux/of_device.h>
27
40#endif /* __KERNEL__ */ 28#endif /* __KERNEL__ */
41#endif /* _ASM_POWERPC_OF_DEVICE_H */ 29#endif /* _ASM_POWERPC_OF_DEVICE_H */
diff --git a/include/asm-powerpc/of_platform.h b/include/asm-powerpc/of_platform.h
index 217eafb167e9..80e6fad28b4f 100644
--- a/include/asm-powerpc/of_platform.h
+++ b/include/asm-powerpc/of_platform.h
@@ -1,3 +1,5 @@
1#ifndef _ASM_POWERPC_OF_PLATFORM_H
2#define _ASM_POWERPC_OF_PLATFORM_H
1/* 3/*
2 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. 4 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
3 * <benh@kernel.crashing.org> 5 * <benh@kernel.crashing.org>
@@ -9,37 +11,8 @@
9 * 11 *
10 */ 12 */
11 13
12#include <asm/of_device.h> 14/* This is just here during the transition */
13 15#include <linux/of_platform.h>
14/*
15 * The of_platform_bus_type is a bus type used by drivers that do not
16 * attach to a macio or similar bus but still use OF probing
17 * mechanism
18 */
19extern struct bus_type of_platform_bus_type;
20
21/*
22 * An of_platform_driver driver is attached to a basic of_device on
23 * the "platform bus" (of_platform_bus_type)
24 */
25struct of_platform_driver
26{
27 char *name;
28 struct of_device_id *match_table;
29 struct module *owner;
30
31 int (*probe)(struct of_device* dev,
32 const struct of_device_id *match);
33 int (*remove)(struct of_device* dev);
34
35 int (*suspend)(struct of_device* dev, pm_message_t state);
36 int (*resume)(struct of_device* dev);
37 int (*shutdown)(struct of_device* dev);
38
39 struct device_driver driver;
40};
41#define to_of_platform_driver(drv) \
42 container_of(drv,struct of_platform_driver, driver)
43 16
44/* Platform drivers register/unregister */ 17/* Platform drivers register/unregister */
45extern int of_register_platform_driver(struct of_platform_driver *drv); 18extern int of_register_platform_driver(struct of_platform_driver *drv);
@@ -56,5 +29,6 @@ extern int of_platform_bus_probe(struct device_node *root,
56 struct of_device_id *matches, 29 struct of_device_id *matches,
57 struct device *parent); 30 struct device *parent);
58 31
59extern struct of_device *of_find_device_by_node(struct device_node *np);
60extern struct of_device *of_find_device_by_phandle(phandle ph); 32extern struct of_device *of_find_device_by_phandle(phandle ph);
33
34#endif /* _ASM_POWERPC_OF_PLATFORM_H */
diff --git a/include/asm-powerpc/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h
index 8d6b47f7b300..938fefb4c4bc 100644
--- a/include/asm-powerpc/oprofile_impl.h
+++ b/include/asm-powerpc/oprofile_impl.h
@@ -39,14 +39,16 @@ struct op_system_config {
39 39
40/* Per-arch configuration */ 40/* Per-arch configuration */
41struct op_powerpc_model { 41struct op_powerpc_model {
42 void (*reg_setup) (struct op_counter_config *, 42 int (*reg_setup) (struct op_counter_config *,
43 struct op_system_config *, 43 struct op_system_config *,
44 int num_counters); 44 int num_counters);
45 void (*cpu_setup) (struct op_counter_config *); 45 int (*cpu_setup) (struct op_counter_config *);
46 void (*start) (struct op_counter_config *); 46 int (*start) (struct op_counter_config *);
47 void (*global_start) (struct op_counter_config *); 47 int (*global_start) (struct op_counter_config *);
48 void (*stop) (void); 48 void (*stop) (void);
49 void (*global_stop) (void); 49 void (*global_stop) (void);
50 int (*sync_start)(void);
51 int (*sync_stop)(void);
50 void (*handle_interrupt) (struct pt_regs *, 52 void (*handle_interrupt) (struct pt_regs *,
51 struct op_counter_config *); 53 struct op_counter_config *);
52 int num_counters; 54 int num_counters;
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h
index 10c51f457d48..236a9210e5fc 100644
--- a/include/asm-powerpc/page.h
+++ b/include/asm-powerpc/page.h
@@ -190,7 +190,6 @@ extern void copy_user_page(void *to, void *from, unsigned long vaddr,
190extern int page_is_ram(unsigned long pfn); 190extern int page_is_ram(unsigned long pfn);
191 191
192struct vm_area_struct; 192struct vm_area_struct;
193extern const char *arch_vma_name(struct vm_area_struct *vma);
194 193
195#include <asm-generic/memory_model.h> 194#include <asm-generic/memory_model.h>
196#endif /* __ASSEMBLY__ */ 195#endif /* __ASSEMBLY__ */
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index e72c2a60853c..e909769b6410 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -45,10 +45,17 @@ struct pci_controller {
45 * on Freescale PCI-e controllers since they used the PCI_PRIMARY_BUS 45 * on Freescale PCI-e controllers since they used the PCI_PRIMARY_BUS
46 * to determine which bus number to match on when generating type0 46 * to determine which bus number to match on when generating type0
47 * config cycles 47 * config cycles
48 * NO_PCIE_LINK - the Freescale PCI-e controllers have issues with
49 * hanging if we don't have link and try to do config cycles to
50 * anything but the PHB. Only allow talking to the PHB if this is
51 * set.
52 * BIG_ENDIAN - cfg_addr is a big endian register
48 */ 53 */
49#define PPC_INDIRECT_TYPE_SET_CFG_TYPE (0x00000001) 54#define PPC_INDIRECT_TYPE_SET_CFG_TYPE (0x00000001)
50#define PPC_INDIRECT_TYPE_EXT_REG (0x00000002) 55#define PPC_INDIRECT_TYPE_EXT_REG (0x00000002)
51#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS (0x00000004) 56#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS (0x00000004)
57#define PPC_INDIRECT_TYPE_NO_PCIE_LINK (0x00000008)
58#define PPC_INDIRECT_TYPE_BIG_ENDIAN (0x00000010)
52 u32 indirect_type; 59 u32 indirect_type;
53 60
54 /* Currently, we limit ourselves to 1 IO range and 3 mem 61 /* Currently, we limit ourselves to 1 IO range and 3 mem
@@ -64,6 +71,14 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
64 return bus->sysdata; 71 return bus->sysdata;
65} 72}
66 73
74static inline int isa_vaddr_is_ioport(void __iomem *address)
75{
76 /* No specific ISA handling on ppc32 at this stage, it
77 * all goes through PCI
78 */
79 return 0;
80}
81
67/* These are used for config access before all the PCI probing 82/* These are used for config access before all the PCI probing
68 has been done. */ 83 has been done. */
69int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn, 84int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn,
@@ -79,11 +94,14 @@ int early_write_config_word(struct pci_controller *hose, int bus, int dev_fn,
79int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn, 94int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn,
80 int where, u32 val); 95 int where, u32 val);
81 96
82extern void setup_indirect_pci_nomap(struct pci_controller* hose, 97extern int early_find_capability(struct pci_controller *hose, int bus,
83 void __iomem *cfg_addr, void __iomem *cfg_data); 98 int dev_fn, int cap);
99
84extern void setup_indirect_pci(struct pci_controller* hose, 100extern void setup_indirect_pci(struct pci_controller* hose,
85 u32 cfg_addr, u32 cfg_data); 101 u32 cfg_addr, u32 cfg_data, u32 flags);
86extern void setup_grackle(struct pci_controller *hose); 102extern void setup_grackle(struct pci_controller *hose);
103extern void __init update_bridge_resource(struct pci_dev *dev,
104 struct resource *res);
87 105
88#else 106#else
89 107
@@ -231,6 +249,13 @@ extern void pcibios_free_controller(struct pci_controller *phb);
231 249
232extern void isa_bridge_find_early(struct pci_controller *hose); 250extern void isa_bridge_find_early(struct pci_controller *hose);
233 251
252static inline int isa_vaddr_is_ioport(void __iomem *address)
253{
254 /* Check if address hits the reserved legacy IO range */
255 unsigned long ea = (unsigned long)address;
256 return ea >= ISA_IO_BASE && ea < ISA_IO_END;
257}
258
234extern int pcibios_unmap_io_space(struct pci_bus *bus); 259extern int pcibios_unmap_io_space(struct pci_bus *bus);
235extern int pcibios_map_io_space(struct pci_bus *bus); 260extern int pcibios_map_io_space(struct pci_bus *bus);
236 261
@@ -261,11 +286,16 @@ extern struct pci_controller *
261pcibios_alloc_controller(struct device_node *dev); 286pcibios_alloc_controller(struct device_node *dev);
262#ifdef CONFIG_PCI 287#ifdef CONFIG_PCI
263extern unsigned long pci_address_to_pio(phys_addr_t address); 288extern unsigned long pci_address_to_pio(phys_addr_t address);
289extern int pcibios_vaddr_is_ioport(void __iomem *address);
264#else 290#else
265static inline unsigned long pci_address_to_pio(phys_addr_t address) 291static inline unsigned long pci_address_to_pio(phys_addr_t address)
266{ 292{
267 return (unsigned long)-1; 293 return (unsigned long)-1;
268} 294}
295static inline int pcibios_vaddr_is_ioport(void __iomem *address)
296{
297 return 0;
298}
269#endif 299#endif
270 300
271 301
diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h
index 2f2e3024fa61..73dc8ba4010d 100644
--- a/include/asm-powerpc/percpu.h
+++ b/include/asm-powerpc/percpu.h
@@ -20,6 +20,11 @@
20#define DEFINE_PER_CPU(type, name) \ 20#define DEFINE_PER_CPU(type, name) \
21 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name 21 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
22 22
23#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
24 __attribute__((__section__(".data.percpu.shared_aligned"))) \
25 __typeof__(type) per_cpu__##name \
26 ____cacheline_aligned_in_smp
27
23/* var is in discarded region: offset to particular copy we want */ 28/* var is in discarded region: offset to particular copy we want */
24#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) 29#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
25#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) 30#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
@@ -40,6 +45,8 @@ extern void setup_per_cpu_areas(void);
40 45
41#define DEFINE_PER_CPU(type, name) \ 46#define DEFINE_PER_CPU(type, name) \
42 __typeof__(type) per_cpu__##name 47 __typeof__(type) per_cpu__##name
48#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
49 DEFINE_PER_CPU(type, name)
43 50
44#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 51#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
45#define __get_cpu_var(var) per_cpu__##var 52#define __get_cpu_var(var) per_cpu__##var
diff --git a/include/asm-powerpc/pgtable-64k.h b/include/asm-powerpc/pgtable-64k.h
index 31cbd3d7fce8..33ae9018fe72 100644
--- a/include/asm-powerpc/pgtable-64k.h
+++ b/include/asm-powerpc/pgtable-64k.h
@@ -49,12 +49,10 @@
49 49
50/* Shift to put page number into pte. 50/* Shift to put page number into pte.
51 * 51 *
52 * That gives us a max RPN of 32 bits, which means a max of 48 bits 52 * That gives us a max RPN of 34 bits, which means a max of 50 bits
53 * of addressable physical space. 53 * of addressable physical space, or 46 bits for the special 4k PFNs.
54 * We could get 3 more bits here by setting PTE_RPN_SHIFT to 29 but
55 * 32 makes PTEs more readable for debugging for now :)
56 */ 54 */
57#define PTE_RPN_SHIFT (32) 55#define PTE_RPN_SHIFT (30)
58#define PTE_RPN_MAX (1UL << (64 - PTE_RPN_SHIFT)) 56#define PTE_RPN_MAX (1UL << (64 - PTE_RPN_SHIFT))
59#define PTE_RPN_MASK (~((1UL<<PTE_RPN_SHIFT)-1)) 57#define PTE_RPN_MASK (~((1UL<<PTE_RPN_SHIFT)-1))
60 58
diff --git a/include/asm-powerpc/pmi.h b/include/asm-powerpc/pmi.h
index cb0f8aa43088..2259d4ce3846 100644
--- a/include/asm-powerpc/pmi.h
+++ b/include/asm-powerpc/pmi.h
@@ -55,13 +55,13 @@ typedef struct {
55struct pmi_handler { 55struct pmi_handler {
56 struct list_head node; 56 struct list_head node;
57 u8 type; 57 u8 type;
58 void (*handle_pmi_message) (struct of_device *, pmi_message_t); 58 void (*handle_pmi_message) (pmi_message_t);
59}; 59};
60 60
61void pmi_register_handler(struct of_device *, struct pmi_handler *); 61int pmi_register_handler(struct pmi_handler *);
62void pmi_unregister_handler(struct of_device *, struct pmi_handler *); 62void pmi_unregister_handler(struct pmi_handler *);
63 63
64void pmi_send_message(struct of_device *, pmi_message_t); 64int pmi_send_message(pmi_message_t);
65 65
66#endif /* __KERNEL__ */ 66#endif /* __KERNEL__ */
67#endif /* _POWERPC_PMI_H */ 67#endif /* _POWERPC_PMI_H */
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h
index fa083d8e4663..65325721446d 100644
--- a/include/asm-powerpc/ppc_asm.h
+++ b/include/asm-powerpc/ppc_asm.h
@@ -181,6 +181,18 @@ name: \
181 .type GLUE(.,name),@function; \ 181 .type GLUE(.,name),@function; \
182GLUE(.,name): 182GLUE(.,name):
183 183
184#define _INIT_STATIC(name) \
185 .section ".text.init.refok"; \
186 .align 2 ; \
187 .section ".opd","aw"; \
188name: \
189 .quad GLUE(.,name); \
190 .quad .TOC.@tocbase; \
191 .quad 0; \
192 .previous; \
193 .type GLUE(.,name),@function; \
194GLUE(.,name):
195
184#else /* 32-bit */ 196#else /* 32-bit */
185 197
186#define _GLOBAL(n) \ 198#define _GLOBAL(n) \
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 1632baa17dc6..672083787a1d 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -21,6 +21,13 @@
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/atomic.h> 22#include <asm/atomic.h>
23 23
24#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
25#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
26
27#define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l))
28#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
29#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
30
24/* Definitions used by the flattened device tree */ 31/* Definitions used by the flattened device tree */
25#define OF_DT_HEADER 0xd00dfeed /* marker */ 32#define OF_DT_HEADER 0xd00dfeed /* marker */
26#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */ 33#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
@@ -97,10 +104,6 @@ struct device_node {
97 104
98extern struct device_node *of_chosen; 105extern struct device_node *of_chosen;
99 106
100/* flag descriptions */
101#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
102#define OF_DETACHED 2 /* node has been detached from the device tree */
103
104static inline int of_node_check_flag(struct device_node *n, unsigned long flag) 107static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
105{ 108{
106 return test_bit(flag, &n->_flags); 109 return test_bit(flag, &n->_flags);
@@ -120,31 +123,7 @@ static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_e
120} 123}
121 124
122 125
123/* New style node lookup */
124extern struct device_node *of_find_node_by_name(struct device_node *from,
125 const char *name);
126#define for_each_node_by_name(dn, name) \
127 for (dn = of_find_node_by_name(NULL, name); dn; \
128 dn = of_find_node_by_name(dn, name))
129extern struct device_node *of_find_node_by_type(struct device_node *from,
130 const char *type);
131#define for_each_node_by_type(dn, type) \
132 for (dn = of_find_node_by_type(NULL, type); dn; \
133 dn = of_find_node_by_type(dn, type))
134extern struct device_node *of_find_compatible_node(struct device_node *from,
135 const char *type, const char *compat);
136#define for_each_compatible_node(dn, type, compatible) \
137 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
138 dn = of_find_compatible_node(dn, type, compatible))
139extern struct device_node *of_find_node_by_path(const char *path);
140extern struct device_node *of_find_node_by_phandle(phandle handle);
141extern struct device_node *of_find_all_nodes(struct device_node *prev); 126extern struct device_node *of_find_all_nodes(struct device_node *prev);
142extern struct device_node *of_get_parent(const struct device_node *node);
143extern struct device_node *of_get_next_child(const struct device_node *node,
144 struct device_node *prev);
145extern struct property *of_find_property(const struct device_node *np,
146 const char *name,
147 int *lenp);
148extern struct device_node *of_node_get(struct device_node *node); 127extern struct device_node *of_node_get(struct device_node *node);
149extern void of_node_put(struct device_node *node); 128extern void of_node_put(struct device_node *node);
150 129
@@ -160,23 +139,15 @@ extern unsigned long __init of_get_flat_dt_root(void);
160 139
161/* For updating the device tree at runtime */ 140/* For updating the device tree at runtime */
162extern void of_attach_node(struct device_node *); 141extern void of_attach_node(struct device_node *);
163extern void of_detach_node(const struct device_node *); 142extern void of_detach_node(struct device_node *);
164 143
165/* Other Prototypes */ 144/* Other Prototypes */
166extern void finish_device_tree(void); 145extern void finish_device_tree(void);
167extern void unflatten_device_tree(void); 146extern void unflatten_device_tree(void);
168extern void early_init_devtree(void *); 147extern void early_init_devtree(void *);
169extern int of_device_is_compatible(const struct device_node *device,
170 const char *);
171#define device_is_compatible(d, c) of_device_is_compatible((d), (c)) 148#define device_is_compatible(d, c) of_device_is_compatible((d), (c))
172extern int machine_is_compatible(const char *compat); 149extern int machine_is_compatible(const char *compat);
173extern const void *of_get_property(const struct device_node *node,
174 const char *name,
175 int *lenp);
176#define get_property(a, b, c) of_get_property((a), (b), (c))
177extern void print_properties(struct device_node *node); 150extern void print_properties(struct device_node *node);
178extern int of_n_addr_cells(struct device_node* np);
179extern int of_n_size_cells(struct device_node* np);
180extern int prom_n_intr_cells(struct device_node* np); 151extern int prom_n_intr_cells(struct device_node* np);
181extern void prom_get_irq_senses(unsigned char *senses, int off, int max); 152extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
182extern int prom_add_property(struct device_node* np, struct property* prop); 153extern int prom_add_property(struct device_node* np, struct property* prop);
@@ -230,7 +201,6 @@ static inline unsigned long of_read_ulong(const u32 *cell, int size)
230 201
231/* Translate an OF address block into a CPU physical address 202/* Translate an OF address block into a CPU physical address
232 */ 203 */
233#define OF_BAD_ADDR ((u64)-1)
234extern u64 of_translate_address(struct device_node *np, const u32 *addr); 204extern u64 of_translate_address(struct device_node *np, const u32 *addr);
235 205
236/* Extract an address from a device, returns the region size and 206/* Extract an address from a device, returns the region size and
@@ -357,5 +327,11 @@ extern int of_irq_to_resource(struct device_node *dev, int index,
357 */ 327 */
358extern void __iomem *of_iomap(struct device_node *device, int index); 328extern void __iomem *of_iomap(struct device_node *device, int index);
359 329
330/*
331 * NB: This is here while we transition from using asm/prom.h
332 * to linux/of.h
333 */
334#include <linux/of.h>
335
360#endif /* __KERNEL__ */ 336#endif /* __KERNEL__ */
361#endif /* _POWERPC_PROM_H */ 337#endif /* _POWERPC_PROM_H */
diff --git a/include/asm-powerpc/reg_booke.h b/include/asm-powerpc/reg_booke.h
index 064405c207bf..8fdc2b47afb9 100644
--- a/include/asm-powerpc/reg_booke.h
+++ b/include/asm-powerpc/reg_booke.h
@@ -223,7 +223,6 @@
223#define MCSR_ICPERR 0x40000000UL /* I-Cache Parity Error */ 223#define MCSR_ICPERR 0x40000000UL /* I-Cache Parity Error */
224#define MCSR_DCP_PERR 0x20000000UL /* D-Cache Push Parity Error */ 224#define MCSR_DCP_PERR 0x20000000UL /* D-Cache Push Parity Error */
225#define MCSR_DCPERR 0x10000000UL /* D-Cache Parity Error */ 225#define MCSR_DCPERR 0x10000000UL /* D-Cache Parity Error */
226#define MCSR_GL_CI 0x00010000UL /* Guarded Load or Cache-Inhibited stwcx. */
227#define MCSR_BUS_IAERR 0x00000080UL /* Instruction Address Error */ 226#define MCSR_BUS_IAERR 0x00000080UL /* Instruction Address Error */
228#define MCSR_BUS_RAERR 0x00000040UL /* Read Address Error */ 227#define MCSR_BUS_RAERR 0x00000040UL /* Read Address Error */
229#define MCSR_BUS_WAERR 0x00000020UL /* Write Address Error */ 228#define MCSR_BUS_WAERR 0x00000020UL /* Write Address Error */
@@ -232,6 +231,12 @@
232#define MCSR_BUS_WBERR 0x00000004UL /* Write Data Bus Error */ 231#define MCSR_BUS_WBERR 0x00000004UL /* Write Data Bus Error */
233#define MCSR_BUS_IPERR 0x00000002UL /* Instruction parity Error */ 232#define MCSR_BUS_IPERR 0x00000002UL /* Instruction parity Error */
234#define MCSR_BUS_RPERR 0x00000001UL /* Read parity Error */ 233#define MCSR_BUS_RPERR 0x00000001UL /* Read parity Error */
234
235/* e500 parts may set unused bits in MCSR; mask these off */
236#define MCSR_MASK (MCSR_MCP | MCSR_ICPERR | MCSR_DCP_PERR | \
237 MCSR_DCPERR | MCSR_BUS_IAERR | MCSR_BUS_RAERR | \
238 MCSR_BUS_WAERR | MCSR_BUS_IBERR | MCSR_BUS_RBERR | \
239 MCSR_BUS_WBERR | MCSR_BUS_IPERR | MCSR_BUS_RPERR)
235#endif 240#endif
236#ifdef CONFIG_E200 241#ifdef CONFIG_E200
237#define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */ 242#define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */
@@ -243,6 +248,11 @@
243#define MCSR_BUS_DRERR 0x00000008UL /* Read Bus Error on data load */ 248#define MCSR_BUS_DRERR 0x00000008UL /* Read Bus Error on data load */
244#define MCSR_BUS_WRERR 0x00000004UL /* Write Bus Error on buffered 249#define MCSR_BUS_WRERR 0x00000004UL /* Write Bus Error on buffered
245 store or cache line push */ 250 store or cache line push */
251
252/* e200 parts may set unused bits in MCSR; mask these off */
253#define MCSR_MASK (MCSR_MCP | MCSR_CP_PERR | MCSR_CPERR | \
254 MCSR_EXCP_ERR | MCSR_BUS_IRERR | MCSR_BUS_DRERR | \
255 MCSR_BUS_WRERR)
246#endif 256#endif
247 257
248/* Bit definitions for the DBSR. */ 258/* Bit definitions for the DBSR. */
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index eedc828cef2d..5bde3980bf49 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -107,10 +107,10 @@ struct spu_runqueue;
107struct device_node; 107struct device_node;
108 108
109enum spu_utilization_state { 109enum spu_utilization_state {
110 SPU_UTIL_SYSTEM,
111 SPU_UTIL_USER, 110 SPU_UTIL_USER,
111 SPU_UTIL_SYSTEM,
112 SPU_UTIL_IOWAIT, 112 SPU_UTIL_IOWAIT,
113 SPU_UTIL_IDLE, 113 SPU_UTIL_IDLE_LOADED,
114 SPU_UTIL_MAX 114 SPU_UTIL_MAX
115}; 115};
116 116
@@ -121,15 +121,16 @@ struct spu {
121 unsigned long problem_phys; 121 unsigned long problem_phys;
122 struct spu_problem __iomem *problem; 122 struct spu_problem __iomem *problem;
123 struct spu_priv2 __iomem *priv2; 123 struct spu_priv2 __iomem *priv2;
124 struct list_head list; 124 struct list_head cbe_list;
125 struct list_head sched_list;
126 struct list_head full_list; 125 struct list_head full_list;
126 enum { SPU_FREE, SPU_USED } alloc_state;
127 int number; 127 int number;
128 unsigned int irqs[3]; 128 unsigned int irqs[3];
129 u32 node; 129 u32 node;
130 u64 flags; 130 u64 flags;
131 u64 dar; 131 u64 dar;
132 u64 dsisr; 132 u64 dsisr;
133 u64 class_0_pending;
133 size_t ls_size; 134 size_t ls_size;
134 unsigned int slb_replace; 135 unsigned int slb_replace;
135 struct mm_struct *mm; 136 struct mm_struct *mm;
@@ -137,7 +138,7 @@ struct spu {
137 struct spu_runqueue *rq; 138 struct spu_runqueue *rq;
138 unsigned long long timestamp; 139 unsigned long long timestamp;
139 pid_t pid; 140 pid_t pid;
140 int class_0_pending; 141 pid_t tgid;
141 spinlock_t register_lock; 142 spinlock_t register_lock;
142 143
143 void (* wbox_callback)(struct spu *spu); 144 void (* wbox_callback)(struct spu *spu);
@@ -165,11 +166,14 @@ struct spu {
165 166
166 struct sys_device sysdev; 167 struct sys_device sysdev;
167 168
169 int has_mem_affinity;
170 struct list_head aff_list;
171
168 struct { 172 struct {
169 /* protected by interrupt reentrancy */ 173 /* protected by interrupt reentrancy */
170 enum spu_utilization_state utilization_state; 174 enum spu_utilization_state util_state;
171 unsigned long tstamp; /* time of last ctx switch */ 175 unsigned long long tstamp;
172 unsigned long times[SPU_UTIL_MAX]; 176 unsigned long long times[SPU_UTIL_MAX];
173 unsigned long long vol_ctx_switch; 177 unsigned long long vol_ctx_switch;
174 unsigned long long invol_ctx_switch; 178 unsigned long long invol_ctx_switch;
175 unsigned long long min_flt; 179 unsigned long long min_flt;
@@ -181,13 +185,29 @@ struct spu {
181 } stats; 185 } stats;
182}; 186};
183 187
184struct spu *spu_alloc(void); 188struct cbe_spu_info {
185struct spu *spu_alloc_node(int node); 189 struct mutex list_mutex;
186void spu_free(struct spu *spu); 190 struct list_head spus;
191 int n_spus;
192 int nr_active;
193 atomic_t reserved_spus;
194};
195
196extern struct cbe_spu_info cbe_spu_info[];
197
198void spu_init_channels(struct spu *spu);
187int spu_irq_class_0_bottom(struct spu *spu); 199int spu_irq_class_0_bottom(struct spu *spu);
188int spu_irq_class_1_bottom(struct spu *spu); 200int spu_irq_class_1_bottom(struct spu *spu);
189void spu_irq_setaffinity(struct spu *spu, int cpu); 201void spu_irq_setaffinity(struct spu *spu, int cpu);
190 202
203#ifdef CONFIG_KEXEC
204void crash_register_spus(struct list_head *list);
205#else
206static inline void crash_register_spus(struct list_head *list)
207{
208}
209#endif
210
191extern void spu_invalidate_slbs(struct spu *spu); 211extern void spu_invalidate_slbs(struct spu *spu);
192extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm); 212extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
193 213
@@ -195,6 +215,20 @@ extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
195struct mm_struct; 215struct mm_struct;
196extern void spu_flush_all_slbs(struct mm_struct *mm); 216extern void spu_flush_all_slbs(struct mm_struct *mm);
197 217
218/* This interface allows a profiler (e.g., OProfile) to store a ref
219 * to spu context information that it creates. This caching technique
220 * avoids the need to recreate this information after a save/restore operation.
221 *
222 * Assumes the caller has already incremented the ref count to
223 * profile_info; then spu_context_destroy must call kref_put
224 * on prof_info_kref.
225 */
226void spu_set_profile_private_kref(struct spu_context *ctx,
227 struct kref *prof_info_kref,
228 void ( * prof_info_release) (struct kref *kref));
229
230void *spu_get_profile_private_kref(struct spu_context *ctx);
231
198/* system callbacks from the SPU */ 232/* system callbacks from the SPU */
199struct spu_syscall_block { 233struct spu_syscall_block {
200 u64 nr_ret; 234 u64 nr_ret;
@@ -206,7 +240,8 @@ extern long spu_sys_callback(struct spu_syscall_block *s);
206struct file; 240struct file;
207extern struct spufs_calls { 241extern struct spufs_calls {
208 asmlinkage long (*create_thread)(const char __user *name, 242 asmlinkage long (*create_thread)(const char __user *name,
209 unsigned int flags, mode_t mode); 243 unsigned int flags, mode_t mode,
244 struct file *neighbor);
210 asmlinkage long (*spu_run)(struct file *filp, __u32 __user *unpc, 245 asmlinkage long (*spu_run)(struct file *filp, __u32 __user *unpc,
211 __u32 __user *ustatus); 246 __u32 __user *ustatus);
212 struct module *owner; 247 struct module *owner;
@@ -233,8 +268,10 @@ struct spu_coredump_calls {
233#define SPU_CREATE_GANG 0x0002 268#define SPU_CREATE_GANG 0x0002
234#define SPU_CREATE_NOSCHED 0x0004 269#define SPU_CREATE_NOSCHED 0x0004
235#define SPU_CREATE_ISOLATE 0x0008 270#define SPU_CREATE_ISOLATE 0x0008
271#define SPU_CREATE_AFFINITY_SPU 0x0010
272#define SPU_CREATE_AFFINITY_MEM 0x0020
236 273
237#define SPU_CREATE_FLAG_ALL 0x000f /* mask of all valid flags */ 274#define SPU_CREATE_FLAG_ALL 0x003f /* mask of all valid flags */
238 275
239 276
240#ifdef CONFIG_SPU_FS_MODULE 277#ifdef CONFIG_SPU_FS_MODULE
@@ -403,6 +440,7 @@ struct spu_priv2 {
403#define MFC_CNTL_RESUME_DMA_QUEUE (0ull << 0) 440#define MFC_CNTL_RESUME_DMA_QUEUE (0ull << 0)
404#define MFC_CNTL_SUSPEND_DMA_QUEUE (1ull << 0) 441#define MFC_CNTL_SUSPEND_DMA_QUEUE (1ull << 0)
405#define MFC_CNTL_SUSPEND_DMA_QUEUE_MASK (1ull << 0) 442#define MFC_CNTL_SUSPEND_DMA_QUEUE_MASK (1ull << 0)
443#define MFC_CNTL_SUSPEND_MASK (1ull << 4)
406#define MFC_CNTL_NORMAL_DMA_QUEUE_OPERATION (0ull << 8) 444#define MFC_CNTL_NORMAL_DMA_QUEUE_OPERATION (0ull << 8)
407#define MFC_CNTL_SUSPEND_IN_PROGRESS (1ull << 8) 445#define MFC_CNTL_SUSPEND_IN_PROGRESS (1ull << 8)
408#define MFC_CNTL_SUSPEND_COMPLETE (3ull << 8) 446#define MFC_CNTL_SUSPEND_COMPLETE (3ull << 8)
diff --git a/include/asm-powerpc/spu_csa.h b/include/asm-powerpc/spu_csa.h
index c48ae185c874..e87794d5d4ea 100644
--- a/include/asm-powerpc/spu_csa.h
+++ b/include/asm-powerpc/spu_csa.h
@@ -50,6 +50,12 @@
50#define SPU_STOPPED_STATUS_P_I 8 50#define SPU_STOPPED_STATUS_P_I 8
51#define SPU_STOPPED_STATUS_R 9 51#define SPU_STOPPED_STATUS_R 9
52 52
53/*
54 * Definitions for software decrementer status flag.
55 */
56#define SPU_DECR_STATUS_RUNNING 0x1
57#define SPU_DECR_STATUS_WRAPPED 0x2
58
53#ifndef __ASSEMBLY__ 59#ifndef __ASSEMBLY__
54/** 60/**
55 * spu_reg128 - generic 128-bit register definition. 61 * spu_reg128 - generic 128-bit register definition.
@@ -63,7 +69,7 @@ struct spu_reg128 {
63 * @gprs: Array of saved registers. 69 * @gprs: Array of saved registers.
64 * @fpcr: Saved floating point status control register. 70 * @fpcr: Saved floating point status control register.
65 * @decr: Saved decrementer value. 71 * @decr: Saved decrementer value.
66 * @decr_status: Indicates decrementer run status. 72 * @decr_status: Indicates software decrementer status flags.
67 * @ppu_mb: Saved PPU mailbox data. 73 * @ppu_mb: Saved PPU mailbox data.
68 * @ppuint_mb: Saved PPU interrupting mailbox data. 74 * @ppuint_mb: Saved PPU interrupting mailbox data.
69 * @tag_mask: Saved tag group mask. 75 * @tag_mask: Saved tag group mask.
diff --git a/include/asm-powerpc/spu_priv1.h b/include/asm-powerpc/spu_priv1.h
index 7e78f6a1ab8b..0f37c7c90820 100644
--- a/include/asm-powerpc/spu_priv1.h
+++ b/include/asm-powerpc/spu_priv1.h
@@ -178,6 +178,7 @@ struct spu_management_ops {
178 int (*enumerate_spus)(int (*fn)(void *data)); 178 int (*enumerate_spus)(int (*fn)(void *data));
179 int (*create_spu)(struct spu *spu, void *data); 179 int (*create_spu)(struct spu *spu, void *data);
180 int (*destroy_spu)(struct spu *spu); 180 int (*destroy_spu)(struct spu *spu);
181 int (*init_affinity)(void);
181}; 182};
182 183
183extern const struct spu_management_ops* spu_management_ops; 184extern const struct spu_management_ops* spu_management_ops;
@@ -200,6 +201,12 @@ spu_destroy_spu (struct spu *spu)
200 return spu_management_ops->destroy_spu(spu); 201 return spu_management_ops->destroy_spu(spu);
201} 202}
202 203
204static inline int
205spu_init_affinity (void)
206{
207 return spu_management_ops->init_affinity();
208}
209
203/* 210/*
204 * The declarations folowing are put here for convenience 211 * The declarations folowing are put here for convenience
205 * and only intended to be used by the platform setup code. 212 * and only intended to be used by the platform setup code.
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h
index 1cc3f9cb6f4e..cc6d87228258 100644
--- a/include/asm-powerpc/systbl.h
+++ b/include/asm-powerpc/systbl.h
@@ -308,6 +308,7 @@ COMPAT_SYS_SPU(move_pages)
308SYSCALL_SPU(getcpu) 308SYSCALL_SPU(getcpu)
309COMPAT_SYS(epoll_pwait) 309COMPAT_SYS(epoll_pwait)
310COMPAT_SYS_SPU(utimensat) 310COMPAT_SYS_SPU(utimensat)
311COMPAT_SYS(fallocate)
311COMPAT_SYS_SPU(signalfd) 312COMPAT_SYS_SPU(signalfd)
312COMPAT_SYS_SPU(timerfd) 313COMPAT_SYS_SPU(timerfd)
313SYSCALL_SPU(eventfd) 314SYSCALL_SPU(eventfd)
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 32aa42b748be..41520b7a7b76 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -184,16 +184,6 @@ struct thread_struct;
184extern struct task_struct *_switch(struct thread_struct *prev, 184extern struct task_struct *_switch(struct thread_struct *prev,
185 struct thread_struct *next); 185 struct thread_struct *next);
186 186
187/*
188 * On SMP systems, when the scheduler does migration-cost autodetection,
189 * it needs a way to flush as much of the CPU's caches as possible.
190 *
191 * TODO: fill this in!
192 */
193static inline void sched_cacheflush(void)
194{
195}
196
197extern unsigned int rtas_data; 187extern unsigned int rtas_data;
198extern int mem_init_done; /* set on boot once kmalloc can be called */ 188extern int mem_init_done; /* set on boot once kmalloc can be called */
199extern unsigned long memory_limit; 189extern unsigned long memory_limit;
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h
index 9d9aeca8ad22..40d5f98c44fc 100644
--- a/include/asm-powerpc/thread_info.h
+++ b/include/asm-powerpc/thread_info.h
@@ -107,28 +107,26 @@ static inline struct thread_info *current_thread_info(void)
107 * thread information flag bit numbers 107 * thread information flag bit numbers
108 */ 108 */
109#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 109#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
110#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 110#define TIF_SIGPENDING 1 /* signal pending */
111#define TIF_SIGPENDING 2 /* signal pending */ 111#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
112#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 112#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
113#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
114 TIF_NEED_RESCHED */ 113 TIF_NEED_RESCHED */
115#define TIF_32BIT 5 /* 32 bit binary */ 114#define TIF_32BIT 4 /* 32 bit binary */
116#define TIF_PERFMON_WORK 6 /* work for pfm_handle_work() */ 115#define TIF_PERFMON_WORK 5 /* work for pfm_handle_work() */
117#define TIF_PERFMON_CTXSW 7 /* perfmon needs ctxsw calls */ 116#define TIF_PERFMON_CTXSW 6 /* perfmon needs ctxsw calls */
118#define TIF_SYSCALL_AUDIT 8 /* syscall auditing active */ 117#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
119#define TIF_SINGLESTEP 9 /* singlestepping active */ 118#define TIF_SINGLESTEP 8 /* singlestepping active */
120#define TIF_MEMDIE 10 119#define TIF_MEMDIE 9
121#define TIF_SECCOMP 11 /* secure computing */ 120#define TIF_SECCOMP 10 /* secure computing */
122#define TIF_RESTOREALL 12 /* Restore all regs (implies NOERROR) */ 121#define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */
123#define TIF_NOERROR 14 /* Force successful syscall return */ 122#define TIF_NOERROR 12 /* Force successful syscall return */
124#define TIF_RESTORE_SIGMASK 15 /* Restore signal mask in do_signal */ 123#define TIF_RESTORE_SIGMASK 13 /* Restore signal mask in do_signal */
125#define TIF_FREEZE 16 /* Freezing for suspend */ 124#define TIF_FREEZE 14 /* Freezing for suspend */
126#define TIF_RUNLATCH 17 /* Is the runlatch enabled? */ 125#define TIF_RUNLATCH 15 /* Is the runlatch enabled? */
127#define TIF_ABI_PENDING 18 /* 32/64 bit switch needed */ 126#define TIF_ABI_PENDING 16 /* 32/64 bit switch needed */
128 127
129/* as above, but as bit values */ 128/* as above, but as bit values */
130#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 129#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
131#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
132#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 130#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
133#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 131#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
134#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 132#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
@@ -146,7 +144,7 @@ static inline struct thread_info *current_thread_info(void)
146#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) 144#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
147#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) 145#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP)
148 146
149#define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ 147#define _TIF_USER_WORK_MASK ( _TIF_SIGPENDING | \
150 _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK) 148 _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK)
151#define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR) 149#define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR)
152 150
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index f71c6061f1ec..97d82b6a9406 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -331,10 +331,11 @@
331#define __NR_timerfd 306 331#define __NR_timerfd 306
332#define __NR_eventfd 307 332#define __NR_eventfd 307
333#define __NR_sync_file_range2 308 333#define __NR_sync_file_range2 308
334#define __NR_fallocate 309
334 335
335#ifdef __KERNEL__ 336#ifdef __KERNEL__
336 337
337#define __NR_syscalls 309 338#define __NR_syscalls 310
338 339
339#define __NR__exit __NR_exit 340#define __NR__exit __NR_exit
340#define NR_syscalls __NR_syscalls 341#define NR_syscalls __NR_syscalls
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h
index 0117b544ecbc..3a0975e2adad 100644
--- a/include/asm-powerpc/vio.h
+++ b/include/asm-powerpc/vio.h
@@ -80,6 +80,11 @@ extern const void *vio_get_attribute(struct vio_dev *vdev, char *which,
80extern struct vio_dev *vio_find_node(struct device_node *vnode); 80extern struct vio_dev *vio_find_node(struct device_node *vnode);
81extern int vio_enable_interrupts(struct vio_dev *dev); 81extern int vio_enable_interrupts(struct vio_dev *dev);
82extern int vio_disable_interrupts(struct vio_dev *dev); 82extern int vio_disable_interrupts(struct vio_dev *dev);
83#else
84static inline int vio_enable_interrupts(struct vio_dev *dev)
85{
86 return 0;
87}
83#endif 88#endif
84 89
85static inline struct vio_driver *to_vio_driver(struct device_driver *drv) 90static inline struct vio_driver *to_vio_driver(struct device_driver *drv)
diff --git a/include/asm-ppc/mv64x60.h b/include/asm-ppc/mv64x60.h
index db3776f18198..2963d6aa3ea5 100644
--- a/include/asm-ppc/mv64x60.h
+++ b/include/asm-ppc/mv64x60.h
@@ -120,14 +120,6 @@ extern spinlock_t mv64x60_lock;
120 120
121#define MV64x60_64BIT_WIN_COUNT 24 121#define MV64x60_64BIT_WIN_COUNT 24
122 122
123/* Watchdog Platform Device, Driver Data */
124#define MV64x60_WDT_NAME "wdt"
125
126struct mv64x60_wdt_pdata {
127 int timeout; /* watchdog expiry in seconds, default 10 */
128 int bus_clk; /* bus clock in MHz, default 133 */
129};
130
131/* 123/*
132 * Define a structure that's used to pass in config information to the 124 * Define a structure that's used to pass in config information to the
133 * core routines. 125 * core routines.
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index d84a3cf4d033..cc45780421ca 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -54,6 +54,7 @@ extern void show_regs(struct pt_regs * regs);
54extern void flush_instruction_cache(void); 54extern void flush_instruction_cache(void);
55extern void hard_reset_now(void); 55extern void hard_reset_now(void);
56extern void poweroff_now(void); 56extern void poweroff_now(void);
57extern int set_dabr(unsigned long dabr);
57#ifdef CONFIG_6xx 58#ifdef CONFIG_6xx
58extern long _get_L2CR(void); 59extern long _get_L2CR(void);
59extern long _get_L3CR(void); 60extern long _get_L3CR(void);
@@ -129,16 +130,6 @@ extern struct task_struct *__switch_to(struct task_struct *,
129 struct task_struct *); 130 struct task_struct *);
130#define switch_to(prev, next, last) ((last) = __switch_to((prev), (next))) 131#define switch_to(prev, next, last) ((last) = __switch_to((prev), (next)))
131 132
132/*
133 * On SMP systems, when the scheduler does migration-cost autodetection,
134 * it needs a way to flush as much of the CPU's caches as possible.
135 *
136 * TODO: fill this in!
137 */
138static inline void sched_cacheflush(void)
139{
140}
141
142struct thread_struct; 133struct thread_struct;
143extern struct task_struct *_switch(struct thread_struct *prev, 134extern struct task_struct *_switch(struct thread_struct *prev,
144 struct thread_struct *next); 135 struct thread_struct *next);
diff --git a/include/asm-s390/a.out.h b/include/asm-s390/a.out.h
index 72adee6ef338..46158dcaf517 100644
--- a/include/asm-s390/a.out.h
+++ b/include/asm-s390/a.out.h
@@ -32,6 +32,7 @@ struct exec
32#ifdef __KERNEL__ 32#ifdef __KERNEL__
33 33
34#define STACK_TOP TASK_SIZE 34#define STACK_TOP TASK_SIZE
35#define STACK_TOP_MAX DEFAULT_TASK_SIZE
35 36
36#endif 37#endif
37 38
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h
index ea486952f778..2d184655bc5d 100644
--- a/include/asm-s390/atomic.h
+++ b/include/asm-s390/atomic.h
@@ -67,8 +67,17 @@ typedef struct {
67 67
68#endif /* __GNUC__ */ 68#endif /* __GNUC__ */
69 69
70#define atomic_read(v) ((v)->counter) 70static inline int atomic_read(const atomic_t *v)
71#define atomic_set(v,i) (((v)->counter) = (i)) 71{
72 barrier();
73 return v->counter;
74}
75
76static inline void atomic_set(atomic_t *v, int i)
77{
78 v->counter = i;
79 barrier();
80}
72 81
73static __inline__ int atomic_add_return(int i, atomic_t * v) 82static __inline__ int atomic_add_return(int i, atomic_t * v)
74{ 83{
@@ -182,8 +191,17 @@ typedef struct {
182 191
183#endif /* __GNUC__ */ 192#endif /* __GNUC__ */
184 193
185#define atomic64_read(v) ((v)->counter) 194static inline long long atomic64_read(const atomic64_t *v)
186#define atomic64_set(v,i) (((v)->counter) = (i)) 195{
196 barrier();
197 return v->counter;
198}
199
200static inline void atomic64_set(atomic64_t *v, long long i)
201{
202 v->counter = i;
203 barrier();
204}
187 205
188static __inline__ long long atomic64_add_return(long long i, atomic64_t * v) 206static __inline__ long long atomic64_add_return(long long i, atomic64_t * v)
189{ 207{
diff --git a/include/asm-s390/bug.h b/include/asm-s390/bug.h
index 838684dc6d35..384e3621e341 100644
--- a/include/asm-s390/bug.h
+++ b/include/asm-s390/bug.h
@@ -50,7 +50,7 @@
50#define BUG() __EMIT_BUG(0) 50#define BUG() __EMIT_BUG(0)
51 51
52#define WARN_ON(x) ({ \ 52#define WARN_ON(x) ({ \
53 typeof(x) __ret_warn_on = (x); \ 53 int __ret_warn_on = !!(x); \
54 if (__builtin_constant_p(__ret_warn_on)) { \ 54 if (__builtin_constant_p(__ret_warn_on)) { \
55 if (__ret_warn_on) \ 55 if (__ret_warn_on) \
56 __EMIT_BUG(BUGFLAG_WARNING); \ 56 __EMIT_BUG(BUGFLAG_WARNING); \
diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h
index 4c2e1710f157..1aeda27d5a8b 100644
--- a/include/asm-s390/ccwdev.h
+++ b/include/asm-s390/ccwdev.h
@@ -165,11 +165,6 @@ extern int ccw_device_resume(struct ccw_device *);
165extern int ccw_device_halt(struct ccw_device *, unsigned long); 165extern int ccw_device_halt(struct ccw_device *, unsigned long);
166extern int ccw_device_clear(struct ccw_device *, unsigned long); 166extern int ccw_device_clear(struct ccw_device *, unsigned long);
167 167
168extern int __deprecated read_dev_chars(struct ccw_device *cdev, void **buffer, int length);
169extern int __deprecated read_conf_data(struct ccw_device *cdev, void **buffer, int *length);
170extern int __deprecated read_conf_data_lpm(struct ccw_device *cdev, void **buffer,
171 int *length, __u8 lpm);
172
173extern int ccw_device_set_online(struct ccw_device *cdev); 168extern int ccw_device_set_online(struct ccw_device *cdev);
174extern int ccw_device_set_offline(struct ccw_device *cdev); 169extern int ccw_device_set_offline(struct ccw_device *cdev);
175 170
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h
index f738d2827582..1982fb344164 100644
--- a/include/asm-s390/cio.h
+++ b/include/asm-s390/cio.h
@@ -258,19 +258,6 @@ struct ciw {
258/* Sick revalidation of device. */ 258/* Sick revalidation of device. */
259#define CIO_REVALIDATE 0x0008 259#define CIO_REVALIDATE 0x0008
260 260
261struct diag210 {
262 __u16 vrdcdvno : 16; /* device number (input) */
263 __u16 vrdclen : 16; /* data block length (input) */
264 __u32 vrdcvcla : 8; /* virtual device class (output) */
265 __u32 vrdcvtyp : 8; /* virtual device type (output) */
266 __u32 vrdcvsta : 8; /* virtual device status (output) */
267 __u32 vrdcvfla : 8; /* virtual device flags (output) */
268 __u32 vrdcrccl : 8; /* real device class (output) */
269 __u32 vrdccrty : 8; /* real device type (output) */
270 __u32 vrdccrmd : 8; /* real device model (output) */
271 __u32 vrdccrft : 8; /* real device feature (output) */
272} __attribute__ ((packed,aligned(4)));
273
274struct ccw_dev_id { 261struct ccw_dev_id {
275 u8 ssid; 262 u8 ssid;
276 u16 devno; 263 u16 devno;
@@ -285,8 +272,6 @@ static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1,
285 return 0; 272 return 0;
286} 273}
287 274
288extern int diag210(struct diag210 *addr);
289
290extern void wait_cons_dev(void); 275extern void wait_cons_dev(void);
291 276
292extern void css_schedule_reprobe(void); 277extern void css_schedule_reprobe(void);
diff --git a/include/asm-s390/diag.h b/include/asm-s390/diag.h
new file mode 100644
index 000000000000..72b2e2f2d32d
--- /dev/null
+++ b/include/asm-s390/diag.h
@@ -0,0 +1,39 @@
1/*
2 * s390 diagnose functions
3 *
4 * Copyright IBM Corp. 2007
5 * Author(s): Michael Holzheu <holzheu@de.ibm.com>
6 */
7
8#ifndef _ASM_S390_DIAG_H
9#define _ASM_S390_DIAG_H
10
11/*
12 * Diagnose 10: Release pages
13 */
14extern void diag10(unsigned long addr);
15
16/*
17 * Diagnose 14: Input spool file manipulation
18 */
19extern int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode);
20
21/*
22 * Diagnose 210: Get information about a virtual device
23 */
24struct diag210 {
25 u16 vrdcdvno; /* device number (input) */
26 u16 vrdclen; /* data block length (input) */
27 u8 vrdcvcla; /* virtual device class (output) */
28 u8 vrdcvtyp; /* virtual device type (output) */
29 u8 vrdcvsta; /* virtual device status (output) */
30 u8 vrdcvfla; /* virtual device flags (output) */
31 u8 vrdcrccl; /* real device class (output) */
32 u8 vrdccrty; /* real device type (output) */
33 u8 vrdccrmd; /* real device model (output) */
34 u8 vrdccrft; /* real device feature (output) */
35} __attribute__((packed, aligned(4)));
36
37extern int diag210(struct diag210 *addr);
38
39#endif /* _ASM_S390_DIAG_H */
diff --git a/include/asm-s390/kprobes.h b/include/asm-s390/kprobes.h
index 830fe4c4eea6..340ba10446ea 100644
--- a/include/asm-s390/kprobes.h
+++ b/include/asm-s390/kprobes.h
@@ -46,8 +46,6 @@ typedef u16 kprobe_opcode_t;
46 ? (MAX_STACK_SIZE) \ 46 ? (MAX_STACK_SIZE) \
47 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 47 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
48 48
49#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)(pentry)
50
51#define ARCH_SUPPORTS_KRETPROBES 49#define ARCH_SUPPORTS_KRETPROBES
52#define ARCH_INACTIVE_KPROBE_COUNT 0 50#define ARCH_INACTIVE_KPROBE_COUNT 0
53 51
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h
index 9ea7f1023e57..545857e64443 100644
--- a/include/asm-s390/percpu.h
+++ b/include/asm-s390/percpu.h
@@ -41,6 +41,11 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
41 __attribute__((__section__(".data.percpu"))) \ 41 __attribute__((__section__(".data.percpu"))) \
42 __typeof__(type) per_cpu__##name 42 __typeof__(type) per_cpu__##name
43 43
44#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
45 __attribute__((__section__(".data.percpu.shared_aligned"))) \
46 __typeof__(type) per_cpu__##name \
47 ____cacheline_aligned_in_smp
48
44#define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) 49#define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
45#define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) 50#define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
46#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) 51#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu])
@@ -59,6 +64,8 @@ do { \
59 64
60#define DEFINE_PER_CPU(type, name) \ 65#define DEFINE_PER_CPU(type, name) \
61 __typeof__(type) per_cpu__##name 66 __typeof__(type) per_cpu__##name
67#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
68 DEFINE_PER_CPU(type, name)
62 69
63#define __get_cpu_var(var) __reloc_hide(var,0) 70#define __get_cpu_var(var) __reloc_hide(var,0)
64#define __raw_get_cpu_var(var) __reloc_hide(var,0) 71#define __raw_get_cpu_var(var) __reloc_hide(var,0)
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
index 56c8a6c80e2e..e45d3c9a4b7e 100644
--- a/include/asm-s390/pgalloc.h
+++ b/include/asm-s390/pgalloc.h
@@ -19,8 +19,6 @@
19 19
20#define check_pgt_cache() do {} while (0) 20#define check_pgt_cache() do {} while (0)
21 21
22extern void diag10(unsigned long addr);
23
24/* 22/*
25 * Page allocation orders. 23 * Page allocation orders.
26 */ 24 */
diff --git a/include/asm-s390/s390_ext.h b/include/asm-s390/s390_ext.h
index df9b1017b703..1e72362cad78 100644
--- a/include/asm-s390/s390_ext.h
+++ b/include/asm-s390/s390_ext.h
@@ -10,6 +10,8 @@
10 * Martin Schwidefsky (schwidefsky@de.ibm.com) 10 * Martin Schwidefsky (schwidefsky@de.ibm.com)
11 */ 11 */
12 12
13#include <linux/types.h>
14
13typedef void (*ext_int_handler_t)(__u16 code); 15typedef void (*ext_int_handler_t)(__u16 code);
14 16
15/* 17/*
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h
index 76e424f718c6..07708c07701e 100644
--- a/include/asm-s390/smp.h
+++ b/include/asm-s390/smp.h
@@ -36,8 +36,7 @@ extern void machine_halt_smp(void);
36extern void machine_power_off_smp(void); 36extern void machine_power_off_smp(void);
37 37
38extern void smp_setup_cpu_possible_map(void); 38extern void smp_setup_cpu_possible_map(void);
39extern int smp_call_function_on(void (*func) (void *info), void *info, 39
40 int nonatomic, int wait, int cpu);
41#define NO_PROC_ID 0xFF /* No processor magic marker */ 40#define NO_PROC_ID 0xFF /* No processor magic marker */
42 41
43/* 42/*
@@ -96,14 +95,6 @@ extern int __cpu_up (unsigned int cpu);
96#endif 95#endif
97 96
98#ifndef CONFIG_SMP 97#ifndef CONFIG_SMP
99static inline int
100smp_call_function_on(void (*func) (void *info), void *info,
101 int nonatomic, int wait, int cpu)
102{
103 func(info);
104 return 0;
105}
106
107static inline void smp_send_stop(void) 98static inline void smp_send_stop(void)
108{ 99{
109 /* Disable all interrupts/machine checks */ 100 /* Disable all interrupts/machine checks */
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index bbe137c3ed69..64a3cd05cae1 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -97,16 +97,6 @@ static inline void restore_access_regs(unsigned int *acrs)
97 prev = __switch_to(prev,next); \ 97 prev = __switch_to(prev,next); \
98} while (0) 98} while (0)
99 99
100/*
101 * On SMP systems, when the scheduler does migration-cost autodetection,
102 * it needs a way to flush as much of the CPU's caches as possible.
103 *
104 * TODO: fill this in!
105 */
106static inline void sched_cacheflush(void)
107{
108}
109
110#ifdef CONFIG_VIRT_CPU_ACCOUNTING 100#ifdef CONFIG_VIRT_CPU_ACCOUNTING
111extern void account_vtime(struct task_struct *); 101extern void account_vtime(struct task_struct *);
112extern void account_tick_vtime(struct task_struct *); 102extern void account_tick_vtime(struct task_struct *);
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 790c1c557417..f04acb2670a8 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -251,7 +251,7 @@
251#define __NR_getcpu 311 251#define __NR_getcpu 311
252#define __NR_epoll_pwait 312 252#define __NR_epoll_pwait 312
253#define __NR_utimes 313 253#define __NR_utimes 313
254/* Number 314 is reserved for new sys_fallocate */ 254#define __NR_fallocate 314
255#define __NR_utimensat 315 255#define __NR_utimensat 315
256#define __NR_signalfd 316 256#define __NR_signalfd 316
257#define __NR_timerfd 317 257#define __NR_timerfd 317
diff --git a/include/asm-sh/a.out.h b/include/asm-sh/a.out.h
index 6e9fca9ee333..685d0f6125fa 100644
--- a/include/asm-sh/a.out.h
+++ b/include/asm-sh/a.out.h
@@ -20,6 +20,7 @@ struct exec
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22#define STACK_TOP TASK_SIZE 22#define STACK_TOP TASK_SIZE
23#define STACK_TOP_MAX STACK_TOP
23 24
24#endif 25#endif
25 26
diff --git a/include/asm-sh/bug.h b/include/asm-sh/bug.h
index 46f925c815ac..a78d482e8b2f 100644
--- a/include/asm-sh/bug.h
+++ b/include/asm-sh/bug.h
@@ -61,7 +61,7 @@ do { \
61} while (0) 61} while (0)
62 62
63#define WARN_ON(x) ({ \ 63#define WARN_ON(x) ({ \
64 typeof(x) __ret_warn_on = (x); \ 64 int __ret_warn_on = !!(x); \
65 if (__builtin_constant_p(__ret_warn_on)) { \ 65 if (__builtin_constant_p(__ret_warn_on)) { \
66 if (__ret_warn_on) \ 66 if (__ret_warn_on) \
67 __WARN(); \ 67 __WARN(); \
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h
index aeee8da9c54f..b66139ff73fc 100644
--- a/include/asm-sh/bugs.h
+++ b/include/asm-sh/bugs.h
@@ -29,7 +29,7 @@ static void __init check_bugs(void)
29 *p++ = '2'; 29 *p++ = '2';
30 *p++ = 'a'; 30 *p++ = 'a';
31 break; 31 break;
32 case CPU_SH7705 ... CPU_SH7300: 32 case CPU_SH7705 ... CPU_SH7729:
33 *p++ = '3'; 33 *p++ = '3';
34 break; 34 break;
35 case CPU_SH7750 ... CPU_SH4_501: 35 case CPU_SH7750 ... CPU_SH4_501:
@@ -39,7 +39,7 @@ static void __init check_bugs(void)
39 *p++ = '4'; 39 *p++ = '4';
40 *p++ = 'a'; 40 *p++ = 'a';
41 break; 41 break;
42 case CPU_SH73180 ... CPU_SH7722: 42 case CPU_SH7343 ... CPU_SH7722:
43 *p++ = '4'; 43 *p++ = '4';
44 *p++ = 'a'; 44 *p++ = 'a';
45 *p++ = 'l'; 45 *p++ = 'l';
diff --git a/include/asm-sh/clock.h b/include/asm-sh/clock.h
index 386d797d86b7..b550a27a7042 100644
--- a/include/asm-sh/clock.h
+++ b/include/asm-sh/clock.h
@@ -14,6 +14,7 @@ struct clk_ops {
14 void (*disable)(struct clk *clk); 14 void (*disable)(struct clk *clk);
15 void (*recalc)(struct clk *clk); 15 void (*recalc)(struct clk *clk);
16 int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id); 16 int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id);
17 long (*round_rate)(struct clk *clk, unsigned long rate);
17}; 18};
18 19
19struct clk { 20struct clk {
diff --git a/include/asm-sh/cpu-sh3/freq.h b/include/asm-sh/cpu-sh3/freq.h
index 273f3229785c..0a054b53b9de 100644
--- a/include/asm-sh/cpu-sh3/freq.h
+++ b/include/asm-sh/cpu-sh3/freq.h
@@ -10,11 +10,7 @@
10#ifndef __ASM_CPU_SH3_FREQ_H 10#ifndef __ASM_CPU_SH3_FREQ_H
11#define __ASM_CPU_SH3_FREQ_H 11#define __ASM_CPU_SH3_FREQ_H
12 12
13#if defined(CONFIG_CPU_SUBTYPE_SH7300)
14#define FRQCR 0xa415ff80
15#else
16#define FRQCR 0xffffff80 13#define FRQCR 0xffffff80
17#endif
18#define MIN_DIVISOR_NR 0 14#define MIN_DIVISOR_NR 0
19#define MAX_DIVISOR_NR 4 15#define MAX_DIVISOR_NR 4
20 16
diff --git a/include/asm-sh/cpu-sh3/mmu_context.h b/include/asm-sh/cpu-sh3/mmu_context.h
index 4704e86dff5b..b20786d42d09 100644
--- a/include/asm-sh/cpu-sh3/mmu_context.h
+++ b/include/asm-sh/cpu-sh3/mmu_context.h
@@ -30,7 +30,6 @@
30#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ 30#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \
31 defined(CONFIG_CPU_SUBTYPE_SH7709) || \ 31 defined(CONFIG_CPU_SUBTYPE_SH7709) || \
32 defined(CONFIG_CPU_SUBTYPE_SH7706) || \ 32 defined(CONFIG_CPU_SUBTYPE_SH7706) || \
33 defined(CONFIG_CPU_SUBTYPE_SH7300) || \
34 defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 33 defined(CONFIG_CPU_SUBTYPE_SH7705) || \
35 defined(CONFIG_CPU_SUBTYPE_SH7712) || \ 34 defined(CONFIG_CPU_SUBTYPE_SH7712) || \
36 defined(CONFIG_CPU_SUBTYPE_SH7710) 35 defined(CONFIG_CPU_SUBTYPE_SH7710)
diff --git a/include/asm-sh/cpu-sh3/timer.h b/include/asm-sh/cpu-sh3/timer.h
index 4928b08f9d19..b6c2020a2ad3 100644
--- a/include/asm-sh/cpu-sh3/timer.h
+++ b/include/asm-sh/cpu-sh3/timer.h
@@ -19,7 +19,6 @@
19 * SH7729R 19 * SH7729R
20 * SH7710 20 * SH7710
21 * SH7720 21 * SH7720
22 * SH7300
23 * SH7710 22 * SH7710
24 * --------------------------------------------------------------------------- 23 * ---------------------------------------------------------------------------
25 */ 24 */
@@ -28,7 +27,7 @@
28#define TMU_TOCR 0xfffffe90 /* Byte access */ 27#define TMU_TOCR 0xfffffe90 /* Byte access */
29#endif 28#endif
30 29
31#if defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7710) 30#if defined(CONFIG_CPU_SUBTYPE_SH7710)
32#define TMU_012_TSTR 0xa412fe92 /* Byte access */ 31#define TMU_012_TSTR 0xa412fe92 /* Byte access */
33 32
34#define TMU0_TCOR 0xa412fe94 /* Long access */ 33#define TMU0_TCOR 0xa412fe94 /* Long access */
diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h
index 026025b51cea..dc1d32a86374 100644
--- a/include/asm-sh/cpu-sh4/freq.h
+++ b/include/asm-sh/cpu-sh4/freq.h
@@ -10,7 +10,7 @@
10#ifndef __ASM_CPU_SH4_FREQ_H 10#ifndef __ASM_CPU_SH4_FREQ_H
11#define __ASM_CPU_SH4_FREQ_H 11#define __ASM_CPU_SH4_FREQ_H
12 12
13#if defined(CONFIG_CPU_SUBTYPE_SH73180) || defined(CONFIG_CPU_SUBTYPE_SH7722) 13#if defined(CONFIG_CPU_SUBTYPE_SH7722)
14#define FRQCR 0xa4150000 14#define FRQCR 0xa4150000
15#define VCLKCR 0xa4150004 15#define VCLKCR 0xa4150004
16#define SCLKACR 0xa4150008 16#define SCLKACR 0xa4150008
diff --git a/include/asm-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h
index d3bc7818bbbe..84fefdaa01a5 100644
--- a/include/asm-sh/dma-mapping.h
+++ b/include/asm-sh/dma-mapping.h
@@ -69,11 +69,11 @@ static inline dma_addr_t dma_map_single(struct device *dev,
69{ 69{
70#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT) 70#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
71 if (dev->bus == &pci_bus_type) 71 if (dev->bus == &pci_bus_type)
72 return virt_to_bus(ptr); 72 return virt_to_phys(ptr);
73#endif 73#endif
74 dma_cache_sync(dev, ptr, size, dir); 74 dma_cache_sync(dev, ptr, size, dir);
75 75
76 return virt_to_bus(ptr); 76 return virt_to_phys(ptr);
77} 77}
78 78
79#define dma_unmap_single(dev, addr, size, dir) do { } while (0) 79#define dma_unmap_single(dev, addr, size, dir) do { } while (0)
@@ -116,7 +116,7 @@ static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle,
116 if (dev->bus == &pci_bus_type) 116 if (dev->bus == &pci_bus_type)
117 return; 117 return;
118#endif 118#endif
119 dma_cache_sync(dev, bus_to_virt(dma_handle), size, dir); 119 dma_cache_sync(dev, phys_to_virt(dma_handle), size, dir);
120} 120}
121 121
122static inline void dma_sync_single_range(struct device *dev, 122static inline void dma_sync_single_range(struct device *dev,
@@ -128,7 +128,7 @@ static inline void dma_sync_single_range(struct device *dev,
128 if (dev->bus == &pci_bus_type) 128 if (dev->bus == &pci_bus_type)
129 return; 129 return;
130#endif 130#endif
131 dma_cache_sync(dev, bus_to_virt(dma_handle) + offset, size, dir); 131 dma_cache_sync(dev, phys_to_virt(dma_handle) + offset, size, dir);
132} 132}
133 133
134static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, 134static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
@@ -160,6 +160,25 @@ static inline void dma_sync_single_for_device(struct device *dev,
160 dma_sync_single(dev, dma_handle, size, dir); 160 dma_sync_single(dev, dma_handle, size, dir);
161} 161}
162 162
163static inline void dma_sync_single_range_for_cpu(struct device *dev,
164 dma_addr_t dma_handle,
165 unsigned long offset,
166 size_t size,
167 enum dma_data_direction direction)
168{
169 dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction);
170}
171
172static inline void dma_sync_single_range_for_device(struct device *dev,
173 dma_addr_t dma_handle,
174 unsigned long offset,
175 size_t size,
176 enum dma_data_direction direction)
177{
178 dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
179}
180
181
163static inline void dma_sync_sg_for_cpu(struct device *dev, 182static inline void dma_sync_sg_for_cpu(struct device *dev,
164 struct scatterlist *sg, int nelems, 183 struct scatterlist *sg, int nelems,
165 enum dma_data_direction dir) 184 enum dma_data_direction dir)
diff --git a/include/asm-sh/dma.h b/include/asm-sh/dma.h
index 6034d4a29e73..4c75b70b6414 100644
--- a/include/asm-sh/dma.h
+++ b/include/asm-sh/dma.h
@@ -111,6 +111,7 @@ struct dma_info {
111 111
112 struct list_head list; 112 struct list_head list;
113 int first_channel_nr; 113 int first_channel_nr;
114 int first_vchannel_nr;
114}; 115};
115 116
116struct dma_chan_caps { 117struct dma_chan_caps {
diff --git a/include/asm-sh/fixmap.h b/include/asm-sh/fixmap.h
index 458e9fa59545..8a566177ad96 100644
--- a/include/asm-sh/fixmap.h
+++ b/include/asm-sh/fixmap.h
@@ -46,6 +46,9 @@
46 * fix-mapped? 46 * fix-mapped?
47 */ 47 */
48enum fixed_addresses { 48enum fixed_addresses {
49#define FIX_N_COLOURS 16
50 FIX_CMAP_BEGIN,
51 FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS,
49#ifdef CONFIG_HIGHMEM 52#ifdef CONFIG_HIGHMEM
50 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ 53 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
51 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, 54 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
@@ -53,8 +56,8 @@ enum fixed_addresses {
53 __end_of_fixed_addresses 56 __end_of_fixed_addresses
54}; 57};
55 58
56extern void __set_fixmap (enum fixed_addresses idx, 59extern void __set_fixmap(enum fixed_addresses idx,
57 unsigned long phys, pgprot_t flags); 60 unsigned long phys, pgprot_t flags);
58 61
59#define set_fixmap(idx, phys) \ 62#define set_fixmap(idx, phys) \
60 __set_fixmap(idx, phys, PAGE_KERNEL) 63 __set_fixmap(idx, phys, PAGE_KERNEL)
@@ -106,5 +109,4 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr)
106 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); 109 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
107 return __virt_to_fix(vaddr); 110 return __virt_to_fix(vaddr);
108} 111}
109
110#endif 112#endif
diff --git a/include/asm-sh/floppy.h b/include/asm-sh/floppy.h
index dc1ad464fa32..3b59b3af777b 100644
--- a/include/asm-sh/floppy.h
+++ b/include/asm-sh/floppy.h
@@ -181,7 +181,7 @@ static void _fd_chose_dma_mode(char *addr, unsigned long size)
181{ 181{
182 if(can_use_virtual_dma == 2) { 182 if(can_use_virtual_dma == 2) {
183 if((unsigned int) addr >= (unsigned int) high_memory || 183 if((unsigned int) addr >= (unsigned int) high_memory ||
184 virt_to_bus(addr) >= 0x10000000) 184 virt_to_phys(addr) >= 0x10000000)
185 use_virtual_dma = 1; 185 use_virtual_dma = 1;
186 else 186 else
187 use_virtual_dma = 0; 187 use_virtual_dma = 0;
@@ -219,7 +219,7 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
219 doing_pdma = 0; 219 doing_pdma = 0;
220 clear_dma_ff(FLOPPY_DMA); 220 clear_dma_ff(FLOPPY_DMA);
221 set_dma_mode(FLOPPY_DMA,mode); 221 set_dma_mode(FLOPPY_DMA,mode);
222 set_dma_addr(FLOPPY_DMA,virt_to_bus(addr)); 222 set_dma_addr(FLOPPY_DMA,virt_to_phys(addr));
223 set_dma_count(FLOPPY_DMA,size); 223 set_dma_count(FLOPPY_DMA,size);
224 enable_dma(FLOPPY_DMA); 224 enable_dma(FLOPPY_DMA);
225 return 0; 225 return 0;
diff --git a/include/asm-sh/hw_irq.h b/include/asm-sh/hw_irq.h
index 4ca3f765bacc..20d42959f52a 100644
--- a/include/asm-sh/hw_irq.h
+++ b/include/asm-sh/hw_irq.h
@@ -1,6 +1,7 @@
1#ifndef __ASM_SH_HW_IRQ_H 1#ifndef __ASM_SH_HW_IRQ_H
2#define __ASM_SH_HW_IRQ_H 2#define __ASM_SH_HW_IRQ_H
3 3
4#include <linux/init.h>
4#include <asm/atomic.h> 5#include <asm/atomic.h>
5 6
6extern atomic_t irq_err_count; 7extern atomic_t irq_err_count;
@@ -22,7 +23,6 @@ struct intc2_desc {
22}; 23};
23 24
24void register_intc2_controller(struct intc2_desc *); 25void register_intc2_controller(struct intc2_desc *);
25void init_IRQ_intc2(void);
26 26
27struct ipr_data { 27struct ipr_data {
28 unsigned char irq; 28 unsigned char irq;
@@ -40,11 +40,82 @@ struct ipr_desc {
40}; 40};
41 41
42void register_ipr_controller(struct ipr_desc *); 42void register_ipr_controller(struct ipr_desc *);
43void init_IRQ_ipr(void);
44 43
45/* 44/*
46 * Enable individual interrupt mode for external IPR IRQs. 45 * Enable individual interrupt mode for external IPR IRQs.
47 */ 46 */
48void ipr_irq_enable_irlm(void); 47void __init ipr_irq_enable_irlm(void);
48
49typedef unsigned char intc_enum;
50
51struct intc_vect {
52 intc_enum enum_id;
53 unsigned short vect;
54};
55
56#define INTC_VECT(enum_id, vect) { enum_id, vect }
57
58struct intc_prio {
59 intc_enum enum_id;
60 unsigned char priority;
61};
62
63#define INTC_PRIO(enum_id, prio) { enum_id, prio }
64
65struct intc_group {
66 intc_enum enum_id;
67 intc_enum *enum_ids;
68};
69
70#define INTC_GROUP(enum_id, ids...) { enum_id, (intc_enum []) { ids, 0 } }
71
72struct intc_mask_reg {
73 unsigned long set_reg, clr_reg, reg_width;
74 intc_enum enum_ids[32];
75};
76
77struct intc_prio_reg {
78 unsigned long reg, reg_width, field_width;
79 intc_enum enum_ids[16];
80};
81
82struct intc_sense_reg {
83 unsigned long reg, reg_width, field_width;
84 intc_enum enum_ids[16];
85};
86
87struct intc_desc {
88 struct intc_vect *vectors;
89 unsigned int nr_vectors;
90 struct intc_group *groups;
91 unsigned int nr_groups;
92 struct intc_prio *priorities;
93 unsigned int nr_priorities;
94 struct intc_mask_reg *mask_regs;
95 unsigned int nr_mask_regs;
96 struct intc_prio_reg *prio_regs;
97 unsigned int nr_prio_regs;
98 struct intc_sense_reg *sense_regs;
99 unsigned int nr_sense_regs;
100 struct irq_chip chip;
101};
102
103#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a)
104#define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, \
105 priorities, mask_regs, prio_regs, sense_regs) \
106struct intc_desc symbol = { \
107 _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \
108 _INTC_ARRAY(priorities), \
109 _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \
110 _INTC_ARRAY(sense_regs), \
111 .chip.name = chipname, \
112}
113
114void __init register_intc_controller(struct intc_desc *desc);
115
116void __init plat_irq_setup(void);
117
118enum { IRQ_MODE_IRQ, IRQ_MODE_IRL7654, IRQ_MODE_IRL3210 };
119void __init plat_irq_setup_pins(int mode);
49 120
50#endif /* __ASM_SH_HW_IRQ_H */ 121#endif /* __ASM_SH_HW_IRQ_H */
diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h
index aa80930ce8e4..e6a1877dcb20 100644
--- a/include/asm-sh/io.h
+++ b/include/asm-sh/io.h
@@ -241,10 +241,6 @@ static inline void *phys_to_virt(unsigned long address)
241#define virt_to_phys(address) ((unsigned long)(address)) 241#define virt_to_phys(address) ((unsigned long)(address))
242#endif 242#endif
243 243
244#define virt_to_bus virt_to_phys
245#define bus_to_virt phys_to_virt
246#define page_to_bus page_to_phys
247
248/* 244/*
249 * readX/writeX() are used to access memory mapped devices. On some 245 * readX/writeX() are used to access memory mapped devices. On some
250 * architectures the memory mapped IO stuff needs to be accessed 246 * architectures the memory mapped IO stuff needs to be accessed
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index 22efffe45019..e3fae12c0e49 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -55,11 +55,7 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
55 55
56#define PTE_PHYS_MASK (0x20000000 - PAGE_SIZE) 56#define PTE_PHYS_MASK (0x20000000 - PAGE_SIZE)
57 57
58/* 58#define VMALLOC_START (P3SEG)
59 * First 1MB map is used by fixed purpose.
60 * Currently only 4-entry (16kB) is used (see arch/sh/mm/cache.c)
61 */
62#define VMALLOC_START (P3SEG+0x00100000)
63#define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE) 59#define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
64 60
65/* 61/*
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index 2252e75daa26..26d52174f4b4 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -45,7 +45,7 @@ enum cpu_type {
45 CPU_SH7705, CPU_SH7706, CPU_SH7707, 45 CPU_SH7705, CPU_SH7706, CPU_SH7707,
46 CPU_SH7708, CPU_SH7708S, CPU_SH7708R, 46 CPU_SH7708, CPU_SH7708S, CPU_SH7708R,
47 CPU_SH7709, CPU_SH7709A, CPU_SH7710, CPU_SH7712, 47 CPU_SH7709, CPU_SH7709A, CPU_SH7710, CPU_SH7712,
48 CPU_SH7729, CPU_SH7300, 48 CPU_SH7729,
49 49
50 /* SH-4 types */ 50 /* SH-4 types */
51 CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R, 51 CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
@@ -55,7 +55,7 @@ enum cpu_type {
55 CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3, 55 CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3,
56 56
57 /* SH4AL-DSP types */ 57 /* SH4AL-DSP types */
58 CPU_SH73180, CPU_SH7343, CPU_SH7722, 58 CPU_SH7343, CPU_SH7722,
59 59
60 /* Unknown subtype */ 60 /* Unknown subtype */
61 CPU_SH_NONE 61 CPU_SH_NONE
diff --git a/include/asm-sh/rts7751r2d.h b/include/asm-sh/rts7751r2d.h
index 10565ac7966a..5d7800aa31b5 100644
--- a/include/asm-sh/rts7751r2d.h
+++ b/include/asm-sh/rts7751r2d.h
@@ -37,7 +37,7 @@
37#define PA_VERREG 0xa4000032 /* FPGA Version Register */ 37#define PA_VERREG 0xa4000032 /* FPGA Version Register */
38#define PA_INPORT 0xa4000034 /* KEY Input Port control */ 38#define PA_INPORT 0xa4000034 /* KEY Input Port control */
39#define PA_OUTPORT 0xa4000036 /* LED control */ 39#define PA_OUTPORT 0xa4000036 /* LED control */
40#define PA_DMPORT 0xa4000038 /* DM270 Output Port control */ 40#define PA_BVERREG 0xa4000038 /* Board Revision Register */
41 41
42#define PA_AX88796L 0xaa000400 /* AX88796L Area */ 42#define PA_AX88796L 0xaa000400 /* AX88796L Area */
43#define PA_VOYAGER 0xab000000 /* VOYAGER GX Area */ 43#define PA_VOYAGER 0xab000000 /* VOYAGER GX Area */
diff --git a/include/asm-sh/se7300.h b/include/asm-sh/se7300.h
deleted file mode 100644
index 4e24edccb30d..000000000000
--- a/include/asm-sh/se7300.h
+++ /dev/null
@@ -1,64 +0,0 @@
1#ifndef __ASM_SH_HITACHI_SE7300_H
2#define __ASM_SH_HITACHI_SE7300_H
3
4/*
5 * linux/include/asm-sh/se/se7300.h
6 *
7 * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp>
8 *
9 * SH-Mobile SolutionEngine 7300 support
10 */
11
12/* Box specific addresses. */
13
14/* Area 0 */
15#define PA_ROM 0x00000000 /* EPROM */
16#define PA_ROM_SIZE 0x00400000 /* EPROM size 4M byte(Actually 2MB) */
17#define PA_FROM 0x00400000 /* Flash ROM */
18#define PA_FROM_SIZE 0x00400000 /* Flash size 4M byte */
19#define PA_SRAM 0x00800000 /* SRAM */
20#define PA_FROM_SIZE 0x00400000 /* SRAM size 4M byte */
21/* Area 1 */
22#define PA_EXT1 0x04000000
23#define PA_EXT1_SIZE 0x04000000
24/* Area 2 */
25#define PA_EXT2 0x08000000
26#define PA_EXT2_SIZE 0x04000000
27/* Area 3 */
28#define PA_SDRAM 0x0c000000
29#define PA_SDRAM_SIZE 0x04000000
30/* Area 4 */
31#define PA_PCIC 0x10000000 /* MR-SHPC-01 PCMCIA */
32#define PA_MRSHPC 0xb03fffe0 /* MR-SHPC-01 PCMCIA controller */
33#define PA_MRSHPC_MW1 0xb0400000 /* MR-SHPC-01 memory window base */
34#define PA_MRSHPC_MW2 0xb0500000 /* MR-SHPC-01 attribute window base */
35#define PA_MRSHPC_IO 0xb0600000 /* MR-SHPC-01 I/O window base */
36#define MRSHPC_OPTION (PA_MRSHPC + 6)
37#define MRSHPC_CSR (PA_MRSHPC + 8)
38#define MRSHPC_ISR (PA_MRSHPC + 10)
39#define MRSHPC_ICR (PA_MRSHPC + 12)
40#define MRSHPC_CPWCR (PA_MRSHPC + 14)
41#define MRSHPC_MW0CR1 (PA_MRSHPC + 16)
42#define MRSHPC_MW1CR1 (PA_MRSHPC + 18)
43#define MRSHPC_IOWCR1 (PA_MRSHPC + 20)
44#define MRSHPC_MW0CR2 (PA_MRSHPC + 22)
45#define MRSHPC_MW1CR2 (PA_MRSHPC + 24)
46#define MRSHPC_IOWCR2 (PA_MRSHPC + 26)
47#define MRSHPC_CDCR (PA_MRSHPC + 28)
48#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
49#define PA_LED 0xb0800000 /* LED */
50#define PA_DIPSW 0xb0900000 /* Dip switch 31 */
51#define PA_EPLD_MODESET 0xb0a00000 /* FPGA Mode set register */
52#define PA_EPLD_ST1 0xb0a80000 /* FPGA Interrupt status register1 */
53#define PA_EPLD_ST2 0xb0ac0000 /* FPGA Interrupt status register2 */
54/* Area 5 */
55#define PA_EXT5 0x14000000
56#define PA_EXT5_SIZE 0x04000000
57/* Area 6 */
58#define PA_LCD1 0xb8000000
59#define PA_LCD2 0xb8800000
60
61#define __IO_PREFIX sh7300se
62#include <asm/io_generic.h>
63
64#endif /* __ASM_SH_HITACHI_SE7300_H */
diff --git a/include/asm-sh/se73180.h b/include/asm-sh/se73180.h
deleted file mode 100644
index 907c062b4c9a..000000000000
--- a/include/asm-sh/se73180.h
+++ /dev/null
@@ -1,66 +0,0 @@
1#ifndef __ASM_SH_SE73180_H
2#define __ASM_SH_SE73180_H
3
4/*
5 * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp>
6 *
7 * SH-Mobile SolutionEngine 73180 support
8 */
9
10/* Box specific addresses. */
11
12/* Area 0 */
13#define PA_ROM 0x00000000 /* EPROM */
14#define PA_ROM_SIZE 0x00400000 /* EPROM size 4M byte(Actually 2MB) */
15#define PA_FROM 0x00400000 /* Flash ROM */
16#define PA_FROM_SIZE 0x00400000 /* Flash size 4M byte */
17#define PA_SRAM 0x00800000 /* SRAM */
18#define PA_FROM_SIZE 0x00400000 /* SRAM size 4M byte */
19/* Area 1 */
20#define PA_EXT1 0x04000000
21#define PA_EXT1_SIZE 0x04000000
22/* Area 2 */
23#define PA_EXT2 0x08000000
24#define PA_EXT2_SIZE 0x04000000
25/* Area 3 */
26#define PA_SDRAM 0x0c000000
27#define PA_SDRAM_SIZE 0x04000000
28/* Area 4 */
29#define PA_PCIC 0x10000000 /* MR-SHPC-01 PCMCIA */
30#define PA_MRSHPC 0xb03fffe0 /* MR-SHPC-01 PCMCIA controller */
31#define PA_MRSHPC_MW1 0xb0400000 /* MR-SHPC-01 memory window base */
32#define PA_MRSHPC_MW2 0xb0500000 /* MR-SHPC-01 attribute window base */
33#define PA_MRSHPC_IO 0xb0600000 /* MR-SHPC-01 I/O window base */
34#define MRSHPC_OPTION (PA_MRSHPC + 6)
35#define MRSHPC_CSR (PA_MRSHPC + 8)
36#define MRSHPC_ISR (PA_MRSHPC + 10)
37#define MRSHPC_ICR (PA_MRSHPC + 12)
38#define MRSHPC_CPWCR (PA_MRSHPC + 14)
39#define MRSHPC_MW0CR1 (PA_MRSHPC + 16)
40#define MRSHPC_MW1CR1 (PA_MRSHPC + 18)
41#define MRSHPC_IOWCR1 (PA_MRSHPC + 20)
42#define MRSHPC_MW0CR2 (PA_MRSHPC + 22)
43#define MRSHPC_MW1CR2 (PA_MRSHPC + 24)
44#define MRSHPC_IOWCR2 (PA_MRSHPC + 26)
45#define MRSHPC_CDCR (PA_MRSHPC + 28)
46#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
47#define PA_LED 0xb0C00000 /* LED */
48#define LED_SHIFT 0
49#define PA_DIPSW 0xb0900000 /* Dip switch 31 */
50#define PA_EPLD_MODESET 0xb0a00000 /* FPGA Mode set register */
51#define PA_EPLD_ST1 0xb0a80000 /* FPGA Interrupt status register1 */
52#define PA_EPLD_ST2 0xb0ac0000 /* FPGA Interrupt status register2 */
53/* Area 5 */
54#define PA_EXT5 0x14000000
55#define PA_EXT5_SIZE 0x04000000
56/* Area 6 */
57#define PA_LCD1 0xb8000000
58#define PA_LCD2 0xb8800000
59
60#define __IO_PREFIX sh73180se
61#include <asm/io_generic.h>
62
63/* arch/sh/boards/se/73180/irq.c */
64int shmse_irq_demux(int irq);
65
66#endif /* __ASM_SH_SE73180_H */
diff --git a/include/asm-sh/se7722.h b/include/asm-sh/se7722.h
index b3b31e4725c6..e0e89fcb8388 100644
--- a/include/asm-sh/se7722.h
+++ b/include/asm-sh/se7722.h
@@ -81,36 +81,32 @@
81/* IRQ */ 81/* IRQ */
82#define IRQ0_IRQ 32 82#define IRQ0_IRQ 32
83#define IRQ1_IRQ 33 83#define IRQ1_IRQ 33
84#define INTC_ICR0 0xA4140000UL
85#define INTC_ICR1 0xA414001CUL
86
87#define INTMSK0 0xa4140044
88#define INTMSKCLR0 0xa4140064
89#define INTC_INTPRI0 0xa4140010
90 84
91#define IRQ01_MODE 0xb1800000 85#define IRQ01_MODE 0xb1800000
92#define IRQ01_STS 0xb1800004 86#define IRQ01_STS 0xb1800004
93#define IRQ01_MASK 0xb1800008 87#define IRQ01_MASK 0xb1800008
94#define EXT_BIT (0x3fc0) /* SH IRQ1 */
95#define MRSHPC_BIT0 (0x0004) /* SH IRQ1 */
96#define MRSHPC_BIT1 (0x0008) /* SH IRQ1 */
97#define MRSHPC_BIT2 (0x0010) /* SH IRQ1 */
98#define MRSHPC_BIT3 (0x0020) /* SH IRQ1 */
99#define SMC_BIT (0x0002) /* SH IRQ0 */
100#define USB_BIT (0x0001) /* SH IRQ0 */
101
102#define MRSHPC_IRQ3 11
103#define MRSHPC_IRQ2 12
104#define MRSHPC_IRQ1 13
105#define MRSHPC_IRQ0 14
106#define SMC_IRQ 10
107#define EXT_IRQ 5
108#define USB_IRQ 6
109 88
89/* Bits in IRQ01_* registers */
90
91#define SE7722_FPGA_IRQ_USB 0 /* IRQ0 */
92#define SE7722_FPGA_IRQ_SMC 1 /* IRQ0 */
93#define SE7722_FPGA_IRQ_MRSHPC0 2 /* IRQ1 */
94#define SE7722_FPGA_IRQ_MRSHPC1 3 /* IRQ1 */
95#define SE7722_FPGA_IRQ_MRSHPC2 4 /* IRQ1 */
96#define SE7722_FPGA_IRQ_MRSHPC3 5 /* IRQ1 */
97
98#define SE7722_FPGA_IRQ_NR 6
99#define SE7722_FPGA_IRQ_BASE 110
100
101#define MRSHPC_IRQ3 (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC3)
102#define MRSHPC_IRQ2 (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC2)
103#define MRSHPC_IRQ1 (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC1)
104#define MRSHPC_IRQ0 (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_MRSHPC0)
105#define SMC_IRQ (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_SMC)
106#define USB_IRQ (SE7722_FPGA_IRQ_BASE + SE7722_FPGA_IRQ_USB)
110 107
111/* arch/sh/boards/se/7722/irq.c */ 108/* arch/sh/boards/se/7722/irq.c */
112void init_se7722_IRQ(void); 109void init_se7722_IRQ(void);
113int se7722_irq_demux(int);
114 110
115#define __IO_PREFIX se7722 111#define __IO_PREFIX se7722
116#include <asm/io_generic.h> 112#include <asm/io_generic.h>
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index 7c75045ae22b..245042537205 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -64,16 +64,6 @@ struct task_struct *__switch_to(struct task_struct *prev,
64 last = __last; \ 64 last = __last; \
65} while (0) 65} while (0)
66 66
67/*
68 * On SMP systems, when the scheduler does migration-cost autodetection,
69 * it needs a way to flush as much of the CPU's caches as possible.
70 *
71 * TODO: fill this in!
72 */
73static inline void sched_cacheflush(void)
74{
75}
76
77#ifdef CONFIG_CPU_SH4A 67#ifdef CONFIG_CPU_SH4A
78#define __icbi() \ 68#define __icbi() \
79{ \ 69{ \
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h
index 31d55e3782d5..1f7e1deb8d92 100644
--- a/include/asm-sh/thread_info.h
+++ b/include/asm-sh/thread_info.h
@@ -107,18 +107,16 @@ static inline struct thread_info *current_thread_info(void)
107 * - other flags in MSW 107 * - other flags in MSW
108 */ 108 */
109#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 109#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
110#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 110#define TIF_SIGPENDING 1 /* signal pending */
111#define TIF_SIGPENDING 2 /* signal pending */ 111#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
112#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 112#define TIF_RESTORE_SIGMASK 3 /* restore signal mask in do_signal() */
113#define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */ 113#define TIF_SINGLESTEP 4 /* singlestepping active */
114#define TIF_SINGLESTEP 5 /* singlestepping active */
115#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 114#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
116#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 115#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */
117#define TIF_MEMDIE 18 116#define TIF_MEMDIE 18
118#define TIF_FREEZE 19 117#define TIF_FREEZE 19
119 118
120#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 119#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
121#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
122#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 120#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
123#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 121#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
124#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 122#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
diff --git a/include/asm-sh/ubc.h b/include/asm-sh/ubc.h
index 38d46e01b846..56f4e30dc49c 100644
--- a/include/asm-sh/ubc.h
+++ b/include/asm-sh/ubc.h
@@ -15,8 +15,7 @@
15#include <asm/cpu/ubc.h> 15#include <asm/cpu/ubc.h>
16 16
17/* User Break Controller */ 17/* User Break Controller */
18#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \ 18#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
19 defined(CONFIG_CPU_SUBTYPE_SH7300)
20#define UBC_TYPE_SH7729 (current_cpu_data.type == CPU_SH7729) 19#define UBC_TYPE_SH7729 (current_cpu_data.type == CPU_SH7729)
21#else 20#else
22#define UBC_TYPE_SH7729 0 21#define UBC_TYPE_SH7729 0
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index 77bcb09d6ac8..b182b1cb05fd 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -332,8 +332,9 @@
332#define __NR_signalfd 321 332#define __NR_signalfd 321
333#define __NR_timerfd 322 333#define __NR_timerfd 322
334#define __NR_eventfd 323 334#define __NR_eventfd 323
335#define __NR_fallocate 324
335 336
336#define NR_syscalls 324 337#define NR_syscalls 325
337 338
338#ifdef __KERNEL__ 339#ifdef __KERNEL__
339 340
diff --git a/include/asm-sh64/a.out.h b/include/asm-sh64/a.out.h
index e1995e86b663..237ee4e5b72a 100644
--- a/include/asm-sh64/a.out.h
+++ b/include/asm-sh64/a.out.h
@@ -31,6 +31,7 @@ struct exec
31#ifdef __KERNEL__ 31#ifdef __KERNEL__
32 32
33#define STACK_TOP TASK_SIZE 33#define STACK_TOP TASK_SIZE
34#define STACK_TOP_MAX STACK_TOP
34 35
35#endif 36#endif
36 37
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h
index c7c0f059cdc4..de4309960207 100644
--- a/include/asm-sh64/dma-mapping.h
+++ b/include/asm-sh64/dma-mapping.h
@@ -51,11 +51,11 @@ static inline dma_addr_t dma_map_single(struct device *dev,
51{ 51{
52#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT) 52#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
53 if (dev->bus == &pci_bus_type) 53 if (dev->bus == &pci_bus_type)
54 return virt_to_bus(ptr); 54 return virt_to_phys(ptr);
55#endif 55#endif
56 dma_cache_sync(dev, ptr, size, dir); 56 dma_cache_sync(dev, ptr, size, dir);
57 57
58 return virt_to_bus(ptr); 58 return virt_to_phys(ptr);
59} 59}
60 60
61#define dma_unmap_single(dev, addr, size, dir) do { } while (0) 61#define dma_unmap_single(dev, addr, size, dir) do { } while (0)
@@ -98,7 +98,7 @@ static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle,
98 if (dev->bus == &pci_bus_type) 98 if (dev->bus == &pci_bus_type)
99 return; 99 return;
100#endif 100#endif
101 dma_cache_sync(dev, bus_to_virt(dma_handle), size, dir); 101 dma_cache_sync(dev, phys_to_virt(dma_handle), size, dir);
102} 102}
103 103
104static inline void dma_sync_single_range(struct device *dev, 104static inline void dma_sync_single_range(struct device *dev,
@@ -110,7 +110,7 @@ static inline void dma_sync_single_range(struct device *dev,
110 if (dev->bus == &pci_bus_type) 110 if (dev->bus == &pci_bus_type)
111 return; 111 return;
112#endif 112#endif
113 dma_cache_sync(dev, bus_to_virt(dma_handle) + offset, size, dir); 113 dma_cache_sync(dev, phys_to_virt(dma_handle) + offset, size, dir);
114} 114}
115 115
116static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, 116static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
@@ -141,6 +141,24 @@ static inline void dma_sync_single_for_device(struct device *dev,
141 dma_sync_single(dev, dma_handle, size, dir); 141 dma_sync_single(dev, dma_handle, size, dir);
142} 142}
143 143
144static inline void dma_sync_single_range_for_cpu(struct device *dev,
145 dma_addr_t dma_handle,
146 unsigned long offset,
147 size_t size,
148 enum dma_data_direction direction)
149{
150 dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction);
151}
152
153static inline void dma_sync_single_range_for_device(struct device *dev,
154 dma_addr_t dma_handle,
155 unsigned long offset,
156 size_t size,
157 enum dma_data_direction direction)
158{
159 dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
160}
161
144static inline void dma_sync_sg_for_cpu(struct device *dev, 162static inline void dma_sync_sg_for_cpu(struct device *dev,
145 struct scatterlist *sg, int nelems, 163 struct scatterlist *sg, int nelems,
146 enum dma_data_direction dir) 164 enum dma_data_direction dir)
diff --git a/include/asm-sh64/io.h b/include/asm-sh64/io.h
index 14d8e7b4bf4b..1f37b6931922 100644
--- a/include/asm-sh64/io.h
+++ b/include/asm-sh64/io.h
@@ -31,10 +31,6 @@
31#include <asm/page.h> 31#include <asm/page.h>
32#include <asm-generic/iomap.h> 32#include <asm-generic/iomap.h>
33 33
34#define virt_to_bus virt_to_phys
35#define bus_to_virt phys_to_virt
36#define page_to_bus page_to_phys
37
38/* 34/*
39 * Nothing overly special here.. instead of doing the same thing 35 * Nothing overly special here.. instead of doing the same thing
40 * over and over again, we just define a set of sh64_in/out functions 36 * over and over again, we just define a set of sh64_in/out functions
diff --git a/include/asm-sh64/irq.h b/include/asm-sh64/irq.h
index 1ca49e29288a..5c9e6a873aeb 100644
--- a/include/asm-sh64/irq.h
+++ b/include/asm-sh64/irq.h
@@ -114,10 +114,6 @@
114#define IRL0_PRIORITY 13 114#define IRL0_PRIORITY 13
115#define TOP_PRIORITY 15 115#define TOP_PRIORITY 15
116 116
117extern void disable_irq(unsigned int);
118extern void disable_irq_nosync(unsigned int);
119extern void enable_irq(unsigned int);
120
121extern int intc_evt_to_irq[(0xE20/0x20)+1]; 117extern int intc_evt_to_irq[(0xE20/0x20)+1];
122int intc_irq_describe(char* p, int irq); 118int intc_irq_describe(char* p, int irq);
123 119
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h
index ea3adc600b41..1a5197f369b2 100644
--- a/include/asm-sh64/unistd.h
+++ b/include/asm-sh64/unistd.h
@@ -374,10 +374,11 @@
374#define __NR_signalfd 349 374#define __NR_signalfd 349
375#define __NR_timerfd 350 375#define __NR_timerfd 350
376#define __NR_eventfd 351 376#define __NR_eventfd 351
377#define __NR_fallocate 352
377 378
378#ifdef __KERNEL__ 379#ifdef __KERNEL__
379 380
380#define NR_syscalls 352 381#define NR_syscalls 353
381 382
382#define __ARCH_WANT_IPC_PARSE_VERSION 383#define __ARCH_WANT_IPC_PARSE_VERSION
383#define __ARCH_WANT_OLD_READDIR 384#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-sparc/a.out.h b/include/asm-sparc/a.out.h
index 9090060a23e6..917e04250696 100644
--- a/include/asm-sparc/a.out.h
+++ b/include/asm-sparc/a.out.h
@@ -92,6 +92,7 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */
92#include <asm/page.h> 92#include <asm/page.h>
93 93
94#define STACK_TOP (PAGE_OFFSET - PAGE_SIZE) 94#define STACK_TOP (PAGE_OFFSET - PAGE_SIZE)
95#define STACK_TOP_MAX STACK_TOP
95 96
96#endif /* __KERNEL__ */ 97#endif /* __KERNEL__ */
97 98
diff --git a/include/asm-sparc/device.h b/include/asm-sparc/device.h
index d8f9872b0e2d..c0a7786d65f7 100644
--- a/include/asm-sparc/device.h
+++ b/include/asm-sparc/device.h
@@ -3,5 +3,21 @@
3 * 3 *
4 * This file is released under the GPLv2 4 * This file is released under the GPLv2
5 */ 5 */
6#include <asm-generic/device.h> 6#ifndef _ASM_SPARC_DEVICE_H
7#define _ASM_SPARC_DEVICE_H
8
9struct device_node;
10struct of_device;
11
12struct dev_archdata {
13 void *iommu;
14 void *stc;
15 void *host_controller;
16
17 struct device_node *prom_node;
18 struct of_device *op;
19};
20
21#endif /* _ASM_SPARC_DEVICE_H */
22
7 23
diff --git a/include/asm-sparc/fb.h b/include/asm-sparc/fb.h
index c7df38030992..c73ca081e1f5 100644
--- a/include/asm-sparc/fb.h
+++ b/include/asm-sparc/fb.h
@@ -1,11 +1,20 @@
1#ifndef _ASM_FB_H_ 1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_ 2#define _ASM_FB_H_
3#include <linux/fb.h> 3#include <linux/fb.h>
4#include <asm/prom.h>
4 5
5#define fb_pgprotect(...) do {} while (0) 6#define fb_pgprotect(...) do {} while (0)
6 7
7static inline int fb_is_primary_device(struct fb_info *info) 8static inline int fb_is_primary_device(struct fb_info *info)
8{ 9{
10 struct device *dev = info->device;
11 struct device_node *node;
12
13 node = dev->archdata.prom_node;
14 if (node &&
15 node == of_console_device)
16 return 1;
17
9 return 0; 18 return 0;
10} 19}
11 20
diff --git a/include/asm-sparc/fcntl.h b/include/asm-sparc/fcntl.h
index 5db60b5ae7b0..5ec546349fc8 100644
--- a/include/asm-sparc/fcntl.h
+++ b/include/asm-sparc/fcntl.h
@@ -16,6 +16,7 @@
16#define O_LARGEFILE 0x40000 16#define O_LARGEFILE 0x40000
17#define O_DIRECT 0x100000 /* direct disk access hint */ 17#define O_DIRECT 0x100000 /* direct disk access hint */
18#define O_NOATIME 0x200000 18#define O_NOATIME 0x200000
19#define O_CLOEXEC 0x400000
19 20
20#define F_GETOWN 5 /* for sockets. */ 21#define F_GETOWN 5 /* for sockets. */
21#define F_SETOWN 6 /* for sockets. */ 22#define F_SETOWN 6 /* for sockets. */
diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h
index 9073c84218ce..acd06d8ff70a 100644
--- a/include/asm-sparc/floppy.h
+++ b/include/asm-sparc/floppy.h
@@ -48,7 +48,7 @@ struct sun_flpy_controller {
48 48
49/* You'll only ever find one controller on a SparcStation anyways. */ 49/* You'll only ever find one controller on a SparcStation anyways. */
50static struct sun_flpy_controller *sun_fdc = NULL; 50static struct sun_flpy_controller *sun_fdc = NULL;
51volatile unsigned char *fdc_status; 51extern volatile unsigned char *fdc_status;
52 52
53struct sun_floppy_ops { 53struct sun_floppy_ops {
54 unsigned char (*fd_inb)(int port); 54 unsigned char (*fd_inb)(int port);
@@ -101,6 +101,29 @@ static struct sun_floppy_ops sun_fdops;
101#define CROSS_64KB(a,s) (0) 101#define CROSS_64KB(a,s) (0)
102 102
103/* Routines unique to each controller type on a Sun. */ 103/* Routines unique to each controller type on a Sun. */
104static void sun_set_dor(unsigned char value, int fdc_82077)
105{
106 if (sparc_cpu_model == sun4c) {
107 unsigned int bits = 0;
108 if (value & 0x10)
109 bits |= AUXIO_FLPY_DSEL;
110 if ((value & 0x80) == 0)
111 bits |= AUXIO_FLPY_EJCT;
112 set_auxio(bits, (~bits) & (AUXIO_FLPY_DSEL|AUXIO_FLPY_EJCT));
113 }
114 if (fdc_82077) {
115 sun_fdc->dor_82077 = value;
116 }
117}
118
119static unsigned char sun_read_dir(void)
120{
121 if (sparc_cpu_model == sun4c)
122 return (get_auxio() & AUXIO_FLPY_DCHG) ? 0x80 : 0;
123 else
124 return sun_fdc->dir_82077;
125}
126
104static unsigned char sun_82072_fd_inb(int port) 127static unsigned char sun_82072_fd_inb(int port)
105{ 128{
106 udelay(5); 129 udelay(5);
@@ -113,7 +136,7 @@ static unsigned char sun_82072_fd_inb(int port)
113 case 5: /* FD_DATA */ 136 case 5: /* FD_DATA */
114 return sun_fdc->data_82072; 137 return sun_fdc->data_82072;
115 case 7: /* FD_DIR */ 138 case 7: /* FD_DIR */
116 return (get_auxio() & AUXIO_FLPY_DCHG)? 0x80: 0; 139 return sun_read_dir();
117 }; 140 };
118 panic("sun_82072_fd_inb: How did I get here?"); 141 panic("sun_82072_fd_inb: How did I get here?");
119} 142}
@@ -126,20 +149,7 @@ static void sun_82072_fd_outb(unsigned char value, int port)
126 printk("floppy: Asked to write to unknown port %d\n", port); 149 printk("floppy: Asked to write to unknown port %d\n", port);
127 panic("floppy: Port bolixed."); 150 panic("floppy: Port bolixed.");
128 case 2: /* FD_DOR */ 151 case 2: /* FD_DOR */
129 /* Oh geese, 82072 on the Sun has no DOR register, 152 sun_set_dor(value, 0);
130 * the functionality is implemented via the AUXIO
131 * I/O register. So we must emulate the behavior.
132 *
133 * ASSUMPTIONS: There will only ever be one floppy
134 * drive attached to a Sun controller
135 * and it will be at drive zero.
136 */
137 {
138 unsigned bits = 0;
139 if (value & 0x10) bits |= AUXIO_FLPY_DSEL;
140 if ((value & 0x80) == 0) bits |= AUXIO_FLPY_EJCT;
141 set_auxio(bits, (~bits) & (AUXIO_FLPY_DSEL|AUXIO_FLPY_EJCT));
142 }
143 break; 153 break;
144 case 5: /* FD_DATA */ 154 case 5: /* FD_DATA */
145 sun_fdc->data_82072 = value; 155 sun_fdc->data_82072 = value;
@@ -161,15 +171,22 @@ static unsigned char sun_82077_fd_inb(int port)
161 default: 171 default:
162 printk("floppy: Asked to read unknown port %d\n", port); 172 printk("floppy: Asked to read unknown port %d\n", port);
163 panic("floppy: Port bolixed."); 173 panic("floppy: Port bolixed.");
174 case 0: /* FD_STATUS_0 */
175 return sun_fdc->status1_82077;
176 case 1: /* FD_STATUS_1 */
177 return sun_fdc->status2_82077;
178 case 2: /* FD_DOR */
179 return sun_fdc->dor_82077;
180 case 3: /* FD_TDR */
181 return sun_fdc->tapectl_82077;
164 case 4: /* FD_STATUS */ 182 case 4: /* FD_STATUS */
165 return sun_fdc->status_82077 & ~STATUS_DMA; 183 return sun_fdc->status_82077 & ~STATUS_DMA;
166 case 5: /* FD_DATA */ 184 case 5: /* FD_DATA */
167 return sun_fdc->data_82077; 185 return sun_fdc->data_82077;
168 case 7: /* FD_DIR */ 186 case 7: /* FD_DIR */
169 /* XXX: Is DCL on 0x80 in sun4m? */ 187 return sun_read_dir();
170 return sun_fdc->dir_82077;
171 }; 188 };
172 panic("sun_82072_fd_inb: How did I get here?"); 189 panic("sun_82077_fd_inb: How did I get here?");
173} 190}
174 191
175static void sun_82077_fd_outb(unsigned char value, int port) 192static void sun_82077_fd_outb(unsigned char value, int port)
@@ -180,8 +197,7 @@ static void sun_82077_fd_outb(unsigned char value, int port)
180 printk("floppy: Asked to write to unknown port %d\n", port); 197 printk("floppy: Asked to write to unknown port %d\n", port);
181 panic("floppy: Port bolixed."); 198 panic("floppy: Port bolixed.");
182 case 2: /* FD_DOR */ 199 case 2: /* FD_DOR */
183 /* Happily, the 82077 has a real DOR register. */ 200 sun_set_dor(value, 1);
184 sun_fdc->dor_82077 = value;
185 break; 201 break;
186 case 5: /* FD_DATA */ 202 case 5: /* FD_DATA */
187 sun_fdc->data_82077 = value; 203 sun_fdc->data_82077 = value;
@@ -192,6 +208,9 @@ static void sun_82077_fd_outb(unsigned char value, int port)
192 case 4: /* FD_STATUS */ 208 case 4: /* FD_STATUS */
193 sun_fdc->status_82077 = value; 209 sun_fdc->status_82077 = value;
194 break; 210 break;
211 case 3: /* FD_TDR */
212 sun_fdc->tapectl_82077 = value;
213 break;
195 }; 214 };
196 return; 215 return;
197} 216}
@@ -206,13 +225,13 @@ static void sun_82077_fd_outb(unsigned char value, int port)
206 * underruns. If non-zero, doing_pdma encodes the direction of 225 * underruns. If non-zero, doing_pdma encodes the direction of
207 * the transfer for debugging. 1=read 2=write 226 * the transfer for debugging. 1=read 2=write
208 */ 227 */
209char *pdma_vaddr; 228extern char *pdma_vaddr;
210unsigned long pdma_size; 229extern unsigned long pdma_size;
211volatile int doing_pdma = 0; 230extern volatile int doing_pdma;
212 231
213/* This is software state */ 232/* This is software state */
214char *pdma_base = NULL; 233extern char *pdma_base;
215unsigned long pdma_areasize; 234extern unsigned long pdma_areasize;
216 235
217/* Common routines to all controller types on the Sparc. */ 236/* Common routines to all controller types on the Sparc. */
218static __inline__ void virtual_dma_init(void) 237static __inline__ void virtual_dma_init(void)
@@ -262,7 +281,8 @@ static __inline__ void sun_fd_enable_dma(void)
262} 281}
263 282
264/* Our low-level entry point in arch/sparc/kernel/entry.S */ 283/* Our low-level entry point in arch/sparc/kernel/entry.S */
265irqreturn_t floppy_hardint(int irq, void *unused); 284extern int sparc_floppy_request_irq(int irq, unsigned long flags,
285 irqreturn_t (*irq_handler)(int irq, void *));
266 286
267static int sun_fd_request_irq(void) 287static int sun_fd_request_irq(void)
268{ 288{
@@ -271,8 +291,9 @@ static int sun_fd_request_irq(void)
271 291
272 if(!once) { 292 if(!once) {
273 once = 1; 293 once = 1;
274 error = request_fast_irq(FLOPPY_IRQ, floppy_hardint, 294 error = sparc_floppy_request_irq(FLOPPY_IRQ,
275 IRQF_DISABLED, "floppy"); 295 IRQF_DISABLED,
296 floppy_interrupt);
276 return ((error == 0) ? 0 : -1); 297 return ((error == 0) ? 0 : -1);
277 } else return 0; 298 } else return 0;
278} 299}
@@ -332,16 +353,17 @@ static int sun_floppy_init(void)
332 goto no_sun_fdc; 353 goto no_sun_fdc;
333 } 354 }
334 355
335 if(sparc_cpu_model == sun4c) { 356 sun_fdops.fd_inb = sun_82077_fd_inb;
336 sun_fdops.fd_inb = sun_82072_fd_inb; 357 sun_fdops.fd_outb = sun_82077_fd_outb;
337 sun_fdops.fd_outb = sun_82072_fd_outb; 358 fdc_status = &sun_fdc->status_82077;
338 fdc_status = &sun_fdc->status_82072; 359
339 /* printk("AUXIO @0x%lx\n", auxio_register); */ /* P3 */ 360 if (sun_fdc->dor_82077 == 0x80) {
340 } else { 361 sun_fdc->dor_82077 = 0x02;
341 sun_fdops.fd_inb = sun_82077_fd_inb; 362 if (sun_fdc->dor_82077 == 0x80) {
342 sun_fdops.fd_outb = sun_82077_fd_outb; 363 sun_fdops.fd_inb = sun_82072_fd_inb;
343 fdc_status = &sun_fdc->status_82077; 364 sun_fdops.fd_outb = sun_82072_fd_outb;
344 /* printk("DOR @0x%p\n", &sun_fdc->dor_82077); */ /* P3 */ 365 fdc_status = &sun_fdc->status_82072;
366 }
345 } 367 }
346 368
347 /* Success... */ 369 /* Success... */
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h
index ff520ea97473..fe205cc444b8 100644
--- a/include/asm-sparc/irq.h
+++ b/include/asm-sparc/irq.h
@@ -1,184 +1,15 @@
1/* $Id: irq.h,v 1.32 2000/08/26 02:42:28 anton Exp $ 1/* irq.h: IRQ registers on the Sparc.
2 * irq.h: IRQ registers on the Sparc.
3 * 2 *
4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
5 */ 4 */
6 5
7#ifndef _SPARC_IRQ_H 6#ifndef _SPARC_IRQ_H
8#define _SPARC_IRQ_H 7#define _SPARC_IRQ_H
9 8
10#include <linux/linkage.h>
11#include <linux/threads.h> /* For NR_CPUS */
12#include <linux/interrupt.h> 9#include <linux/interrupt.h>
13 10
14#include <asm/system.h> /* For SUN4M_NCPUS */
15#include <asm/btfixup.h>
16
17#define __irq_ino(irq) irq
18#define __irq_pil(irq) irq
19
20#define NR_IRQS 16 11#define NR_IRQS 16
21 12
22#define irq_canonicalize(irq) (irq) 13#define irq_canonicalize(irq) (irq)
23 14
24/* Dave Redman (djhr@tadpole.co.uk)
25 * changed these to function pointers.. it saves cycles and will allow
26 * the irq dependencies to be split into different files at a later date
27 * sun4c_irq.c, sun4m_irq.c etc so we could reduce the kernel size.
28 * Jakub Jelinek (jj@sunsite.mff.cuni.cz)
29 * Changed these to btfixup entities... It saves cycles :)
30 */
31BTFIXUPDEF_CALL(void, disable_irq, unsigned int)
32BTFIXUPDEF_CALL(void, enable_irq, unsigned int)
33BTFIXUPDEF_CALL(void, disable_pil_irq, unsigned int)
34BTFIXUPDEF_CALL(void, enable_pil_irq, unsigned int)
35BTFIXUPDEF_CALL(void, clear_clock_irq, void)
36BTFIXUPDEF_CALL(void, clear_profile_irq, int)
37BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int)
38
39static inline void disable_irq_nosync(unsigned int irq)
40{
41 BTFIXUP_CALL(disable_irq)(irq);
42}
43
44static inline void disable_irq(unsigned int irq)
45{
46 BTFIXUP_CALL(disable_irq)(irq);
47}
48
49static inline void enable_irq(unsigned int irq)
50{
51 BTFIXUP_CALL(enable_irq)(irq);
52}
53
54static inline void disable_pil_irq(unsigned int irq)
55{
56 BTFIXUP_CALL(disable_pil_irq)(irq);
57}
58
59static inline void enable_pil_irq(unsigned int irq)
60{
61 BTFIXUP_CALL(enable_pil_irq)(irq);
62}
63
64static inline void clear_clock_irq(void)
65{
66 BTFIXUP_CALL(clear_clock_irq)();
67}
68
69static inline void clear_profile_irq(int irq)
70{
71 BTFIXUP_CALL(clear_profile_irq)(irq);
72}
73
74static inline void load_profile_irq(int cpu, int limit)
75{
76 BTFIXUP_CALL(load_profile_irq)(cpu, limit);
77}
78
79extern void (*sparc_init_timers)(irq_handler_t lvl10_irq);
80extern void claim_ticker14(irq_handler_t irq_handler,
81 int irq,
82 unsigned int timeout);
83
84#ifdef CONFIG_SMP
85BTFIXUPDEF_CALL(void, set_cpu_int, int, int)
86BTFIXUPDEF_CALL(void, clear_cpu_int, int, int)
87BTFIXUPDEF_CALL(void, set_irq_udt, int)
88
89#define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level)
90#define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level)
91#define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu)
92#endif
93
94extern int request_fast_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, __const__ char *devname);
95
96/* On the sun4m, just like the timers, we have both per-cpu and master
97 * interrupt registers.
98 */
99
100/* These registers are used for sending/receiving irqs from/to
101 * different cpu's.
102 */
103struct sun4m_intreg_percpu {
104 unsigned int tbt; /* Interrupts still pending for this cpu. */
105
106 /* These next two registers are WRITE-ONLY and are only
107 * "on bit" sensitive, "off bits" written have NO affect.
108 */
109 unsigned int clear; /* Clear this cpus irqs here. */
110 unsigned int set; /* Set this cpus irqs here. */
111 unsigned char space[PAGE_SIZE - 12];
112};
113
114/*
115 * djhr
116 * Actually the clear and set fields in this struct are misleading..
117 * according to the SLAVIO manual (and the same applies for the SEC)
118 * the clear field clears bits in the mask which will ENABLE that IRQ
119 * the set field sets bits in the mask to DISABLE the IRQ.
120 *
121 * Also the undirected_xx address in the SLAVIO is defined as
122 * RESERVED and write only..
123 *
124 * DAVEM_NOTE: The SLAVIO only specifies behavior on uniprocessor
125 * sun4m machines, for MP the layout makes more sense.
126 */
127struct sun4m_intregs {
128 struct sun4m_intreg_percpu cpu_intregs[SUN4M_NCPUS];
129 unsigned int tbt; /* IRQ's that are still pending. */
130 unsigned int irqs; /* Master IRQ bits. */
131
132 /* Again, like the above, two these registers are WRITE-ONLY. */
133 unsigned int clear; /* Clear master IRQ's by setting bits here. */
134 unsigned int set; /* Set master IRQ's by setting bits here. */
135
136 /* This register is both READ and WRITE. */
137 unsigned int undirected_target; /* Which cpu gets undirected irqs. */
138};
139
140extern struct sun4m_intregs *sun4m_interrupts;
141
142/*
143 * Bit field defines for the interrupt registers on various
144 * Sparc machines.
145 */
146
147/* The sun4c interrupt register. */
148#define SUN4C_INT_ENABLE 0x01 /* Allow interrupts. */
149#define SUN4C_INT_E14 0x80 /* Enable level 14 IRQ. */
150#define SUN4C_INT_E10 0x20 /* Enable level 10 IRQ. */
151#define SUN4C_INT_E8 0x10 /* Enable level 8 IRQ. */
152#define SUN4C_INT_E6 0x08 /* Enable level 6 IRQ. */
153#define SUN4C_INT_E4 0x04 /* Enable level 4 IRQ. */
154#define SUN4C_INT_E1 0x02 /* Enable level 1 IRQ. */
155
156/* Dave Redman (djhr@tadpole.co.uk)
157 * The sun4m interrupt registers.
158 */
159#define SUN4M_INT_ENABLE 0x80000000
160#define SUN4M_INT_E14 0x00000080
161#define SUN4M_INT_E10 0x00080000
162
163#define SUN4M_HARD_INT(x) (0x000000001 << (x))
164#define SUN4M_SOFT_INT(x) (0x000010000 << (x))
165
166#define SUN4M_INT_MASKALL 0x80000000 /* mask all interrupts */
167#define SUN4M_INT_MODULE_ERR 0x40000000 /* module error */
168#define SUN4M_INT_M2S_WRITE 0x20000000 /* write buffer error */
169#define SUN4M_INT_ECC 0x10000000 /* ecc memory error */
170#define SUN4M_INT_FLOPPY 0x00400000 /* floppy disk */
171#define SUN4M_INT_MODULE 0x00200000 /* module interrupt */
172#define SUN4M_INT_VIDEO 0x00100000 /* onboard video */
173#define SUN4M_INT_REALTIME 0x00080000 /* system timer */
174#define SUN4M_INT_SCSI 0x00040000 /* onboard scsi */
175#define SUN4M_INT_AUDIO 0x00020000 /* audio/isdn */
176#define SUN4M_INT_ETHERNET 0x00010000 /* onboard ethernet */
177#define SUN4M_INT_SERIAL 0x00008000 /* serial ports */
178#define SUN4M_INT_KBDMS 0x00004000 /* keyboard/mouse */
179#define SUN4M_INT_SBUSBITS 0x00003F80 /* sbus int bits */
180
181#define SUN4M_INT_SBUS(x) (1 << (x+7))
182#define SUN4M_INT_VME(x) (1 << (x))
183
184#endif 15#endif
diff --git a/include/asm-sparc/of_device.h b/include/asm-sparc/of_device.h
index 7cb00c1b09c6..e5f5aedc2293 100644
--- a/include/asm-sparc/of_device.h
+++ b/include/asm-sparc/of_device.h
@@ -3,13 +3,9 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/of.h>
6#include <linux/mod_devicetable.h> 7#include <linux/mod_devicetable.h>
7#include <asm/openprom.h> 8#include <asm/openprom.h>
8#include <asm/prom.h>
9
10extern struct bus_type ebus_bus_type;
11extern struct bus_type sbus_bus_type;
12extern struct bus_type of_bus_type;
13 9
14/* 10/*
15 * The of_device is a kind of "base class" that is a superset of 11 * The of_device is a kind of "base class" that is a superset of
@@ -30,50 +26,13 @@ struct of_device
30 int portid; 26 int portid;
31 int clock_freq; 27 int clock_freq;
32}; 28};
33#define to_of_device(d) container_of(d, struct of_device, dev)
34 29
35extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 30extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
36extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 31extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
37 32
38extern struct of_device *of_find_device_by_node(struct device_node *); 33/* These are just here during the transition */
39 34#include <linux/of_device.h>
40extern const struct of_device_id *of_match_device( 35#include <linux/of_platform.h>
41 const struct of_device_id *matches, const struct of_device *dev);
42
43extern struct of_device *of_dev_get(struct of_device *dev);
44extern void of_dev_put(struct of_device *dev);
45
46/*
47 * An of_platform_driver driver is attached to a basic of_device on
48 * the ISA, EBUS, and SBUS busses on sparc64.
49 */
50struct of_platform_driver
51{
52 char *name;
53 struct of_device_id *match_table;
54 struct module *owner;
55
56 int (*probe)(struct of_device* dev, const struct of_device_id *match);
57 int (*remove)(struct of_device* dev);
58
59 int (*suspend)(struct of_device* dev, pm_message_t state);
60 int (*resume)(struct of_device* dev);
61 int (*shutdown)(struct of_device* dev);
62
63 struct device_driver driver;
64};
65#define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver)
66
67extern int of_register_driver(struct of_platform_driver *drv,
68 struct bus_type *bus);
69extern void of_unregister_driver(struct of_platform_driver *drv);
70extern int of_device_register(struct of_device *ofdev);
71extern void of_device_unregister(struct of_device *ofdev);
72extern struct of_device *of_platform_device_create(struct device_node *np,
73 const char *bus_id,
74 struct device *parent,
75 struct bus_type *bus);
76extern void of_release_dev(struct device *dev);
77 36
78#endif /* __KERNEL__ */ 37#endif /* __KERNEL__ */
79#endif /* _ASM_SPARC_OF_DEVICE_H */ 38#endif /* _ASM_SPARC_OF_DEVICE_H */
diff --git a/include/asm-sparc/of_platform.h b/include/asm-sparc/of_platform.h
new file mode 100644
index 000000000000..64a230064ef2
--- /dev/null
+++ b/include/asm-sparc/of_platform.h
@@ -0,0 +1,32 @@
1#ifndef _ASM_SPARC_OF_PLATFORM_H
2#define _ASM_SPARC_OF_PLATFORM_H
3/*
4 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
5 * <benh@kernel.crashing.org>
6 * Modified for Sparc by merging parts of asm-sparc/of_device.h
7 * by Stephen Rothwell
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 *
14 */
15
16/* This is just here during the transition */
17#include <linux/of_platform.h>
18
19extern struct bus_type ebus_bus_type;
20extern struct bus_type sbus_bus_type;
21extern struct bus_type of_platform_bus_type;
22#define of_bus_type of_platform_bus_type /* for compatibility */
23
24extern int of_register_driver(struct of_platform_driver *drv,
25 struct bus_type *bus);
26extern void of_unregister_driver(struct of_platform_driver *drv);
27extern struct of_device *of_platform_device_create(struct device_node *np,
28 const char *bus_id,
29 struct device *parent,
30 struct bus_type *bus);
31
32#endif /* _ASM_SPARC_OF_PLATFORM_H */
diff --git a/include/asm-sparc/oplib.h b/include/asm-sparc/oplib.h
index 91691e52c058..17ba82ee220a 100644
--- a/include/asm-sparc/oplib.h
+++ b/include/asm-sparc/oplib.h
@@ -158,32 +158,6 @@ extern void prom_putchar(char character);
158extern void prom_printf(char *fmt, ...); 158extern void prom_printf(char *fmt, ...);
159extern void prom_write(const char *buf, unsigned int len); 159extern void prom_write(const char *buf, unsigned int len);
160 160
161/* Query for input device type */
162
163enum prom_input_device {
164 PROMDEV_IKBD, /* input from keyboard */
165 PROMDEV_ITTYA, /* input from ttya */
166 PROMDEV_ITTYB, /* input from ttyb */
167 PROMDEV_IRSC, /* input from rsc */
168 PROMDEV_IVCONS, /* input from virtual-console */
169 PROMDEV_I_UNK,
170};
171
172extern enum prom_input_device prom_query_input_device(void);
173
174/* Query for output device type */
175
176enum prom_output_device {
177 PROMDEV_OSCREEN, /* to screen */
178 PROMDEV_OTTYA, /* to ttya */
179 PROMDEV_OTTYB, /* to ttyb */
180 PROMDEV_ORSC, /* to rsc */
181 PROMDEV_OVCONS, /* to virtual-console */
182 PROMDEV_O_UNK,
183};
184
185extern enum prom_output_device prom_query_output_device(void);
186
187/* Multiprocessor operations... */ 161/* Multiprocessor operations... */
188 162
189/* Start the CPU with the given device tree node, context table, and context 163/* Start the CPU with the given device tree node, context table, and context
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index a55f4c3488b0..2cc235b74d94 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -46,7 +46,6 @@ BTFIXUPDEF_SIMM13(user_ptrs_per_pgd)
46#define pgd_ERROR(e) __builtin_trap() 46#define pgd_ERROR(e) __builtin_trap()
47 47
48BTFIXUPDEF_INT(page_none) 48BTFIXUPDEF_INT(page_none)
49BTFIXUPDEF_INT(page_shared)
50BTFIXUPDEF_INT(page_copy) 49BTFIXUPDEF_INT(page_copy)
51BTFIXUPDEF_INT(page_readonly) 50BTFIXUPDEF_INT(page_readonly)
52BTFIXUPDEF_INT(page_kernel) 51BTFIXUPDEF_INT(page_kernel)
@@ -66,7 +65,7 @@ BTFIXUPDEF_INT(page_kernel)
66#define PTE_SIZE (PTRS_PER_PTE*4) 65#define PTE_SIZE (PTRS_PER_PTE*4)
67 66
68#define PAGE_NONE __pgprot(BTFIXUP_INT(page_none)) 67#define PAGE_NONE __pgprot(BTFIXUP_INT(page_none))
69#define PAGE_SHARED __pgprot(BTFIXUP_INT(page_shared)) 68extern pgprot_t PAGE_SHARED;
70#define PAGE_COPY __pgprot(BTFIXUP_INT(page_copy)) 69#define PAGE_COPY __pgprot(BTFIXUP_INT(page_copy))
71#define PAGE_READONLY __pgprot(BTFIXUP_INT(page_readonly)) 70#define PAGE_READONLY __pgprot(BTFIXUP_INT(page_readonly))
72 71
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index 9ea105ebe2ff..71f2a1998324 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -2,7 +2,6 @@
2#define _SPARC_PROM_H 2#define _SPARC_PROM_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5
6/* 5/*
7 * Definitions for talking to the Open Firmware PROM on 6 * Definitions for talking to the Open Firmware PROM on
8 * Power Macintosh computers. 7 * Power Macintosh computers.
@@ -17,11 +16,17 @@
17 * as published by the Free Software Foundation; either version 16 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version. 17 * 2 of the License, or (at your option) any later version.
19 */ 18 */
20
21#include <linux/types.h> 19#include <linux/types.h>
22#include <linux/proc_fs.h> 20#include <linux/proc_fs.h>
23#include <asm/atomic.h> 21#include <asm/atomic.h>
24 22
23#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
24#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
25
26#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
27#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
28#define of_node_cmp(s1, s2) strcmp((s1), (s2))
29
25typedef u32 phandle; 30typedef u32 phandle;
26typedef u32 ihandle; 31typedef u32 ihandle;
27 32
@@ -55,53 +60,35 @@ struct device_node {
55 unsigned int unique_id; 60 unsigned int unique_id;
56}; 61};
57 62
58/* flag descriptions */
59#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
60
61#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) 63#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
62#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) 64#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
63 65
64#define OF_BAD_ADDR ((u64)-1)
65
66static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
67{
68 dn->pde = de;
69}
70
71extern struct device_node *of_find_node_by_name(struct device_node *from,
72 const char *name);
73#define for_each_node_by_name(dn, name) \
74 for (dn = of_find_node_by_name(NULL, name); dn; \
75 dn = of_find_node_by_name(dn, name))
76extern struct device_node *of_find_node_by_type(struct device_node *from,
77 const char *type);
78#define for_each_node_by_type(dn, type) \
79 for (dn = of_find_node_by_type(NULL, type); dn; \
80 dn = of_find_node_by_type(dn, type))
81extern struct device_node *of_find_compatible_node(struct device_node *from,
82 const char *type, const char *compat);
83extern struct device_node *of_find_node_by_path(const char *path);
84extern struct device_node *of_find_node_by_phandle(phandle handle);
85extern struct device_node *of_get_parent(const struct device_node *node);
86extern struct device_node *of_get_next_child(const struct device_node *node,
87 struct device_node *prev);
88extern struct property *of_find_property(const struct device_node *np,
89 const char *name,
90 int *lenp);
91extern int of_device_is_compatible(const struct device_node *device,
92 const char *);
93extern const void *of_get_property(const struct device_node *node,
94 const char *name,
95 int *lenp);
96#define get_property(node,name,lenp) of_get_property(node,name,lenp)
97extern int of_set_property(struct device_node *node, const char *name, void *val, int len); 66extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
98extern int of_getintprop_default(struct device_node *np, 67extern int of_getintprop_default(struct device_node *np,
99 const char *name, 68 const char *name,
100 int def); 69 int def);
101extern int of_n_addr_cells(struct device_node *np); 70extern int of_find_in_proplist(const char *list, const char *match, int len);
102extern int of_n_size_cells(struct device_node *np);
103 71
104extern void prom_build_devicetree(void); 72extern void prom_build_devicetree(void);
105 73
74/* Dummy ref counting routines - to be implemented later */
75static inline struct device_node *of_node_get(struct device_node *node)
76{
77 return node;
78}
79static inline void of_node_put(struct device_node *node)
80{
81}
82
83/*
84 * NB: This is here while we transition from using asm/prom.h
85 * to linux/of.h
86 */
87#include <linux/of.h>
88
89extern struct device_node *of_console_device;
90extern char *of_console_path;
91extern char *of_console_options;
92
106#endif /* __KERNEL__ */ 93#endif /* __KERNEL__ */
107#endif /* _SPARC_PROM_H */ 94#endif /* _SPARC_PROM_H */
diff --git a/include/asm-sparc/sbus.h b/include/asm-sparc/sbus.h
index d036e4419d79..27d076c46964 100644
--- a/include/asm-sparc/sbus.h
+++ b/include/asm-sparc/sbus.h
@@ -68,7 +68,6 @@ struct sbus_dev {
68/* This struct describes the SBus(s) found on this machine. */ 68/* This struct describes the SBus(s) found on this machine. */
69struct sbus_bus { 69struct sbus_bus {
70 struct of_device ofdev; 70 struct of_device ofdev;
71 void *iommu; /* Opaque IOMMU cookie */
72 struct sbus_dev *devices; /* Link to devices on this SBus */ 71 struct sbus_dev *devices; /* Link to devices on this SBus */
73 struct sbus_bus *next; /* next SBus, if more than one SBus */ 72 struct sbus_bus *next; /* next SBus, if more than one SBus */
74 int prom_node; /* PROM device tree node for this SBus */ 73 int prom_node; /* PROM device tree node for this SBus */
diff --git a/include/asm-sparc/sfp-machine.h b/include/asm-sparc/sfp-machine.h
index ecfc86a4a725..266a42b8f99f 100644
--- a/include/asm-sparc/sfp-machine.h
+++ b/include/asm-sparc/sfp-machine.h
@@ -203,4 +203,10 @@ extern struct task_struct *last_task_used_math;
203#define FP_INHIBIT_RESULTS ((last_task_used_math->thread.fsr >> 23) & _fex) 203#define FP_INHIBIT_RESULTS ((last_task_used_math->thread.fsr >> 23) & _fex)
204#endif 204#endif
205 205
206#ifdef CONFIG_SMP
207#define FP_TRAPPING_EXCEPTIONS ((current->thread.fsr >> 23) & 0x1f)
208#else
209#define FP_TRAPPING_EXCEPTIONS ((last_task_used_math->thread.fsr >> 23) & 0x1f)
210#endif
211
206#endif 212#endif
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index 8b4e23b3bb38..d1a2572e3f55 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -165,16 +165,6 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
165 } while(0) 165 } while(0)
166 166
167/* 167/*
168 * On SMP systems, when the scheduler does migration-cost autodetection,
169 * it needs a way to flush as much of the CPU's caches as possible.
170 *
171 * TODO: fill this in!
172 */
173static inline void sched_cacheflush(void)
174{
175}
176
177/*
178 * Changing the IRQ level on the Sparc. 168 * Changing the IRQ level on the Sparc.
179 */ 169 */
180extern void local_irq_restore(unsigned long); 170extern void local_irq_restore(unsigned long);
diff --git a/include/asm-sparc/tlbflush.h b/include/asm-sparc/tlbflush.h
index 4a3b66618e75..a619da5cfaa9 100644
--- a/include/asm-sparc/tlbflush.h
+++ b/include/asm-sparc/tlbflush.h
@@ -57,6 +57,10 @@ BTFIXUPDEF_CALL(void, flush_tlb_page, struct vm_area_struct *, unsigned long)
57/* 57/*
58 * This is a kludge, until I know better. --zaitcev XXX 58 * This is a kludge, until I know better. --zaitcev XXX
59 */ 59 */
60#define flush_tlb_kernel_range(start, end) flush_tlb_all() 60static inline void flush_tlb_kernel_range(unsigned long start,
61 unsigned long end)
62{
63 flush_tlb_all();
64}
61 65
62#endif /* _SPARC_TLBFLUSH_H */ 66#endif /* _SPARC_TLBFLUSH_H */
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 64471bcd96f9..029b3e0d5e4c 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -1,4 +1,3 @@
1/* $Id: unistd.h,v 1.74 2002/02/08 03:57:18 davem Exp $ */
2#ifndef _SPARC_UNISTD_H 1#ifndef _SPARC_UNISTD_H
3#define _SPARC_UNISTD_H 2#define _SPARC_UNISTD_H
4 3
@@ -9,7 +8,7 @@
9 * think of right now to force the arguments into fixed registers 8 * think of right now to force the arguments into fixed registers
10 * before the trap into the system call with gcc 'asm' statements. 9 * before the trap into the system call with gcc 'asm' statements.
11 * 10 *
12 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 11 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
13 * 12 *
14 * SunOS compatibility based upon preliminary work which is: 13 * SunOS compatibility based upon preliminary work which is:
15 * 14 *
@@ -330,8 +329,9 @@
330#define __NR_signalfd 311 329#define __NR_signalfd 311
331#define __NR_timerfd 312 330#define __NR_timerfd 312
332#define __NR_eventfd 313 331#define __NR_eventfd 313
332#define __NR_fallocate 314
333 333
334#define NR_SYSCALLS 314 334#define NR_SYSCALLS 315
335 335
336#ifdef __KERNEL__ 336#ifdef __KERNEL__
337#define __ARCH_WANT_IPC_PARSE_VERSION 337#define __ARCH_WANT_IPC_PARSE_VERSION
diff --git a/include/asm-sparc64/a.out.h b/include/asm-sparc64/a.out.h
index eb3b8e90b279..902e07f89a42 100644
--- a/include/asm-sparc64/a.out.h
+++ b/include/asm-sparc64/a.out.h
@@ -101,6 +101,8 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */
101#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ 101#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \
102 STACK_TOP32 : STACK_TOP64) 102 STACK_TOP32 : STACK_TOP64)
103 103
104#define STACK_TOP_MAX STACK_TOP64
105
104#endif 106#endif
105 107
106#endif /* !(__ASSEMBLY__) */ 108#endif /* !(__ASSEMBLY__) */
diff --git a/include/asm-sparc64/device.h b/include/asm-sparc64/device.h
index d5a4559b9555..5111e8717be3 100644
--- a/include/asm-sparc64/device.h
+++ b/include/asm-sparc64/device.h
@@ -16,8 +16,6 @@ struct dev_archdata {
16 16
17 struct device_node *prom_node; 17 struct device_node *prom_node;
18 struct of_device *op; 18 struct of_device *op;
19
20 unsigned int msi_num;
21}; 19};
22 20
23#endif /* _ASM_SPARC64_DEVICE_H */ 21#endif /* _ASM_SPARC64_DEVICE_H */
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h
index c58ec1661df8..1fc655452b81 100644
--- a/include/asm-sparc64/dma-mapping.h
+++ b/include/asm-sparc64/dma-mapping.h
@@ -1,307 +1,160 @@
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 4#include <linux/scatterlist.h>
5#ifdef CONFIG_PCI
6
7/* we implement the API below in terms of the existing PCI one,
8 * so include it */
9#include <linux/pci.h>
10/* need struct page definitions */
11#include <linux/mm.h> 5#include <linux/mm.h>
12 6
13#include <asm/of_device.h> 7#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
14 8
15static inline int 9struct dma_ops {
16dma_supported(struct device *dev, u64 mask) 10 void *(*alloc_coherent)(struct device *dev, size_t size,
17{ 11 dma_addr_t *dma_handle, gfp_t flag);
18 BUG_ON(dev->bus != &pci_bus_type); 12 void (*free_coherent)(struct device *dev, size_t size,
19 13 void *cpu_addr, dma_addr_t dma_handle);
20 return pci_dma_supported(to_pci_dev(dev), mask); 14 dma_addr_t (*map_single)(struct device *dev, void *cpu_addr,
21} 15 size_t size,
22 16 enum dma_data_direction direction);
23static inline int 17 void (*unmap_single)(struct device *dev, dma_addr_t dma_addr,
24dma_set_mask(struct device *dev, u64 dma_mask) 18 size_t size,
25{ 19 enum dma_data_direction direction);
26 BUG_ON(dev->bus != &pci_bus_type); 20 int (*map_sg)(struct device *dev, struct scatterlist *sg, int nents,
27 21 enum dma_data_direction direction);
28 return pci_set_dma_mask(to_pci_dev(dev), dma_mask); 22 void (*unmap_sg)(struct device *dev, struct scatterlist *sg,
29} 23 int nhwentries,
30 24 enum dma_data_direction direction);
31static inline void * 25 void (*sync_single_for_cpu)(struct device *dev,
32dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 26 dma_addr_t dma_handle, size_t size,
33 gfp_t flag) 27 enum dma_data_direction direction);
34{ 28 void (*sync_single_for_device)(struct device *dev,
35 BUG_ON(dev->bus != &pci_bus_type); 29 dma_addr_t dma_handle, size_t size,
36 30 enum dma_data_direction direction);
37 return pci_iommu_ops->alloc_consistent(to_pci_dev(dev), size, dma_handle, flag); 31 void (*sync_sg_for_cpu)(struct device *dev, struct scatterlist *sg,
38} 32 int nelems,
39 33 enum dma_data_direction direction);
40static inline void 34 void (*sync_sg_for_device)(struct device *dev, struct scatterlist *sg,
41dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, 35 int nelems,
42 dma_addr_t dma_handle) 36 enum dma_data_direction direction);
43{ 37};
44 BUG_ON(dev->bus != &pci_bus_type); 38extern const struct dma_ops *dma_ops;
45 39
46 pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); 40extern int dma_supported(struct device *dev, u64 mask);
47} 41extern int dma_set_mask(struct device *dev, u64 dma_mask);
48
49static inline dma_addr_t
50dma_map_single(struct device *dev, void *cpu_addr, size_t size,
51 enum dma_data_direction direction)
52{
53 BUG_ON(dev->bus != &pci_bus_type);
54
55 return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction);
56}
57
58static inline void
59dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
60 enum dma_data_direction direction)
61{
62 BUG_ON(dev->bus != &pci_bus_type);
63
64 pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction);
65}
66
67static inline dma_addr_t
68dma_map_page(struct device *dev, struct page *page,
69 unsigned long offset, size_t size,
70 enum dma_data_direction direction)
71{
72 BUG_ON(dev->bus != &pci_bus_type);
73
74 return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction);
75}
76
77static inline void
78dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
79 enum dma_data_direction direction)
80{
81 BUG_ON(dev->bus != &pci_bus_type);
82
83 pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction);
84}
85
86static inline int
87dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
88 enum dma_data_direction direction)
89{
90 BUG_ON(dev->bus != &pci_bus_type);
91
92 return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction);
93}
94
95static inline void
96dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
97 enum dma_data_direction direction)
98{
99 BUG_ON(dev->bus != &pci_bus_type);
100
101 pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction);
102}
103
104static inline void
105dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
106 enum dma_data_direction direction)
107{
108 BUG_ON(dev->bus != &pci_bus_type);
109
110 pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle,
111 size, (int)direction);
112}
113
114static inline void
115dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
116 enum dma_data_direction direction)
117{
118 BUG_ON(dev->bus != &pci_bus_type);
119 42
120 pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle, 43static inline void *dma_alloc_coherent(struct device *dev, size_t size,
121 size, (int)direction); 44 dma_addr_t *dma_handle, gfp_t flag)
122}
123
124static inline void
125dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
126 enum dma_data_direction direction)
127{
128 BUG_ON(dev->bus != &pci_bus_type);
129
130 pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction);
131}
132
133static inline void
134dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
135 enum dma_data_direction direction)
136{
137 BUG_ON(dev->bus != &pci_bus_type);
138
139 pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction);
140}
141
142static inline int
143dma_mapping_error(dma_addr_t dma_addr)
144{ 45{
145 return pci_dma_mapping_error(dma_addr); 46 return dma_ops->alloc_coherent(dev, size, dma_handle, flag);
146} 47}
147 48
148#else 49static inline void dma_free_coherent(struct device *dev, size_t size,
149 50 void *cpu_addr, dma_addr_t dma_handle)
150struct device;
151struct page;
152struct scatterlist;
153
154static inline int
155dma_supported(struct device *dev, u64 mask)
156{ 51{
157 BUG(); 52 dma_ops->free_coherent(dev, size, cpu_addr, dma_handle);
158 return 0;
159} 53}
160 54
161static inline int 55static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
162dma_set_mask(struct device *dev, u64 dma_mask) 56 size_t size,
57 enum dma_data_direction direction)
163{ 58{
164 BUG(); 59 return dma_ops->map_single(dev, cpu_addr, size, direction);
165 return 0;
166} 60}
167 61
168static inline void *dma_alloc_coherent(struct device *dev, size_t size, 62static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
169 dma_addr_t *dma_handle, gfp_t flag) 63 size_t size,
64 enum dma_data_direction direction)
170{ 65{
171 BUG(); 66 dma_ops->unmap_single(dev, dma_addr, size, direction);
172 return NULL;
173} 67}
174 68
175static inline void dma_free_coherent(struct device *dev, size_t size, 69static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
176 void *vaddr, dma_addr_t dma_handle) 70 unsigned long offset, size_t size,
71 enum dma_data_direction direction)
177{ 72{
178 BUG(); 73 return dma_ops->map_single(dev, page_address(page) + offset,
74 size, direction);
179} 75}
180 76
181static inline dma_addr_t 77static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
182dma_map_single(struct device *dev, void *cpu_addr, size_t size, 78 size_t size,
183 enum dma_data_direction direction) 79 enum dma_data_direction direction)
184{ 80{
185 BUG(); 81 dma_ops->unmap_single(dev, dma_address, size, direction);
186 return 0;
187} 82}
188 83
189static inline void 84static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
190dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, 85 int nents, enum dma_data_direction direction)
191 enum dma_data_direction direction)
192{ 86{
193 BUG(); 87 return dma_ops->map_sg(dev, sg, nents, direction);
194} 88}
195 89
196static inline dma_addr_t 90static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
197dma_map_page(struct device *dev, struct page *page, 91 int nents, enum dma_data_direction direction)
198 unsigned long offset, size_t size,
199 enum dma_data_direction direction)
200{ 92{
201 BUG(); 93 dma_ops->unmap_sg(dev, sg, nents, direction);
202 return 0;
203} 94}
204 95
205static inline void 96static inline void dma_sync_single_for_cpu(struct device *dev,
206dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, 97 dma_addr_t dma_handle, size_t size,
207 enum dma_data_direction direction) 98 enum dma_data_direction direction)
208{ 99{
209 BUG(); 100 dma_ops->sync_single_for_cpu(dev, dma_handle, size, direction);
210} 101}
211 102
212static inline int 103static inline void dma_sync_single_for_device(struct device *dev,
213dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 104 dma_addr_t dma_handle,
214 enum dma_data_direction direction) 105 size_t size,
106 enum dma_data_direction direction)
215{ 107{
216 BUG(); 108 dma_ops->sync_single_for_device(dev, dma_handle, size, direction);
217 return 0;
218} 109}
219 110
220static inline void 111static inline void dma_sync_single_range_for_cpu(struct device *dev,
221dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, 112 dma_addr_t dma_handle,
222 enum dma_data_direction direction) 113 unsigned long offset,
114 size_t size,
115 enum dma_data_direction direction)
223{ 116{
224 BUG(); 117 dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction);
225} 118}
226 119
227static inline void 120static inline void dma_sync_single_range_for_device(struct device *dev,
228dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, 121 dma_addr_t dma_handle,
229 enum dma_data_direction direction) 122 unsigned long offset,
123 size_t size,
124 enum dma_data_direction direction)
230{ 125{
231 BUG(); 126 dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
232} 127}
233 128
234static inline void
235dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
236 enum dma_data_direction direction)
237{
238 BUG();
239}
240 129
241static inline void 130static inline void dma_sync_sg_for_cpu(struct device *dev,
242dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, 131 struct scatterlist *sg, int nelems,
243 enum dma_data_direction direction) 132 enum dma_data_direction direction)
244{ 133{
245 BUG(); 134 dma_ops->sync_sg_for_cpu(dev, sg, nelems, direction);
246} 135}
247 136
248static inline void 137static inline void dma_sync_sg_for_device(struct device *dev,
249dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, 138 struct scatterlist *sg, int nelems,
250 enum dma_data_direction direction) 139 enum dma_data_direction direction)
251{ 140{
252 BUG(); 141 dma_ops->sync_sg_for_device(dev, sg, nelems, direction);
253} 142}
254 143
255static inline int 144static inline int dma_mapping_error(dma_addr_t dma_addr)
256dma_mapping_error(dma_addr_t dma_addr)
257{ 145{
258 BUG(); 146 return (dma_addr == DMA_ERROR_CODE);
259 return 0;
260} 147}
261 148
262#endif /* PCI */ 149static inline int dma_get_cache_alignment(void)
263
264
265/* Now for the API extensions over the pci_ one */
266
267#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
268#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
269#define dma_is_consistent(d, h) (1)
270
271static inline int
272dma_get_cache_alignment(void)
273{ 150{
274 /* no easy way to get cache size on all processors, so return 151 /* no easy way to get cache size on all processors, so return
275 * the maximum possible, to be safe */ 152 * the maximum possible, to be safe */
276 return (1 << INTERNODE_CACHE_SHIFT); 153 return (1 << INTERNODE_CACHE_SHIFT);
277} 154}
278 155
279static inline void 156#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
280dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, 157#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
281 unsigned long offset, size_t size, 158#define dma_is_consistent(d, h) (1)
282 enum dma_data_direction direction)
283{
284 /* just sync everything, that's all the pci API can do */
285 dma_sync_single_for_cpu(dev, dma_handle, offset+size, direction);
286}
287
288static inline void
289dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
290 unsigned long offset, size_t size,
291 enum dma_data_direction direction)
292{
293 /* just sync everything, that's all the pci API can do */
294 dma_sync_single_for_device(dev, dma_handle, offset+size, direction);
295}
296
297static inline void
298dma_cache_sync(struct device *dev, void *vaddr, size_t size,
299 enum dma_data_direction direction)
300{
301 /* could define this in terms of the dma_cache ... operations,
302 * but if you get this on a platform, you should convert the platform
303 * to using the generic device DMA API */
304 BUG();
305}
306 159
307#endif /* _ASM_SPARC64_DMA_MAPPING_H */ 160#endif /* _ASM_SPARC64_DMA_MAPPING_H */
diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h
index 303d85e2f82e..8653e8665009 100644
--- a/include/asm-sparc64/elf.h
+++ b/include/asm-sparc64/elf.h
@@ -70,6 +70,7 @@
70#define HWCAP_SPARC_V9 16 70#define HWCAP_SPARC_V9 16
71#define HWCAP_SPARC_ULTRA3 32 71#define HWCAP_SPARC_ULTRA3 32
72#define HWCAP_SPARC_BLKINIT 64 72#define HWCAP_SPARC_BLKINIT 64
73#define HWCAP_SPARC_N2 128
73 74
74/* 75/*
75 * These are used to set parameters in the core dumps. 76 * These are used to set parameters in the core dumps.
@@ -155,8 +156,13 @@ static inline unsigned int sparc64_elf_hwcap(void)
155 156
156 if (tlb_type == cheetah || tlb_type == cheetah_plus) 157 if (tlb_type == cheetah || tlb_type == cheetah_plus)
157 cap |= HWCAP_SPARC_ULTRA3; 158 cap |= HWCAP_SPARC_ULTRA3;
158 else if (tlb_type == hypervisor) 159 else if (tlb_type == hypervisor) {
159 cap |= HWCAP_SPARC_BLKINIT; 160 if (sun4v_chip_type == SUN4V_CHIP_NIAGARA1 ||
161 sun4v_chip_type == SUN4V_CHIP_NIAGARA2)
162 cap |= HWCAP_SPARC_BLKINIT;
163 if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2)
164 cap |= HWCAP_SPARC_N2;
165 }
160 166
161 return cap; 167 return cap;
162} 168}
diff --git a/include/asm-sparc64/fb.h b/include/asm-sparc64/fb.h
index d6cd3a175fc3..389012e5fbad 100644
--- a/include/asm-sparc64/fb.h
+++ b/include/asm-sparc64/fb.h
@@ -3,6 +3,7 @@
3#include <linux/fb.h> 3#include <linux/fb.h>
4#include <linux/fs.h> 4#include <linux/fs.h>
5#include <asm/page.h> 5#include <asm/page.h>
6#include <asm/prom.h>
6 7
7static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, 8static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
8 unsigned long off) 9 unsigned long off)
@@ -12,6 +13,14 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
12 13
13static inline int fb_is_primary_device(struct fb_info *info) 14static inline int fb_is_primary_device(struct fb_info *info)
14{ 15{
16 struct device *dev = info->device;
17 struct device_node *node;
18
19 node = dev->archdata.prom_node;
20 if (node &&
21 node == of_console_device)
22 return 1;
23
15 return 0; 24 return 0;
16} 25}
17 26
diff --git a/include/asm-sparc64/fbio.h b/include/asm-sparc64/fbio.h
index 500026d9f6e1..b9215a0907d3 100644
--- a/include/asm-sparc64/fbio.h
+++ b/include/asm-sparc64/fbio.h
@@ -2,6 +2,7 @@
2#define __LINUX_FBIO_H 2#define __LINUX_FBIO_H
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <linux/types.h>
5 6
6/* Constants used for fbio SunOS compatibility */ 7/* Constants used for fbio SunOS compatibility */
7/* (C) 1996 Miguel de Icaza */ 8/* (C) 1996 Miguel de Icaza */
@@ -299,4 +300,31 @@ struct fb_clut32 {
299#define LEO_LD_GBL_MAP 0x01009000 300#define LEO_LD_GBL_MAP 0x01009000
300#define LEO_UNK2_MAP 0x0100a000 301#define LEO_UNK2_MAP 0x0100a000
301 302
303#ifdef __KERNEL__
304struct fbcmap32 {
305 int index; /* first element (0 origin) */
306 int count;
307 u32 red;
308 u32 green;
309 u32 blue;
310};
311
312#define FBIOPUTCMAP32 _IOW('F', 3, struct fbcmap32)
313#define FBIOGETCMAP32 _IOW('F', 4, struct fbcmap32)
314
315struct fbcursor32 {
316 short set; /* what to set, choose from the list above */
317 short enable; /* cursor on/off */
318 struct fbcurpos pos; /* cursor position */
319 struct fbcurpos hot; /* cursor hot spot */
320 struct fbcmap32 cmap; /* color map info */
321 struct fbcurpos size; /* cursor bit map size */
322 u32 image; /* cursor image bits */
323 u32 mask; /* cursor mask bits */
324};
325
326#define FBIOSCURSOR32 _IOW('F', 24, struct fbcursor32)
327#define FBIOGCURSOR32 _IOW('F', 25, struct fbcursor32)
328#endif
329
302#endif /* __LINUX_FBIO_H */ 330#endif /* __LINUX_FBIO_H */
diff --git a/include/asm-sparc64/fcntl.h b/include/asm-sparc64/fcntl.h
index b2aecf0054bd..111f6b3b8925 100644
--- a/include/asm-sparc64/fcntl.h
+++ b/include/asm-sparc64/fcntl.h
@@ -16,7 +16,7 @@
16#define O_LARGEFILE 0x40000 16#define O_LARGEFILE 0x40000
17#define O_DIRECT 0x100000 /* direct disk access hint */ 17#define O_DIRECT 0x100000 /* direct disk access hint */
18#define O_NOATIME 0x200000 18#define O_NOATIME 0x200000
19 19#define O_CLOEXEC 0x400000
20 20
21#define F_GETOWN 5 /* for sockets. */ 21#define F_GETOWN 5 /* for sockets. */
22#define F_SETOWN 6 /* for sockets. */ 22#define F_SETOWN 6 /* for sockets. */
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index 4aa0925e1b1b..1783239c7b40 100644
--- a/include/asm-sparc64/floppy.h
+++ b/include/asm-sparc64/floppy.h
@@ -1,7 +1,6 @@
1/* $Id: floppy.h,v 1.32 2001/10/26 17:59:36 davem Exp $ 1/* floppy.h: Sparc specific parts of the Floppy driver.
2 * asm-sparc64/floppy.h: Sparc specific parts of the Floppy driver.
3 * 2 *
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1996, 2007 David S. Miller (davem@davemloft.net)
5 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 4 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
6 * 5 *
7 * Ultra/PCI support added: Sep 1997 Eddie C. Dost (ecd@skynet.be) 6 * Ultra/PCI support added: Sep 1997 Eddie C. Dost (ecd@skynet.be)
@@ -11,6 +10,7 @@
11#define __ASM_SPARC64_FLOPPY_H 10#define __ASM_SPARC64_FLOPPY_H
12 11
13#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/pci.h>
14 14
15#include <asm/page.h> 15#include <asm/page.h>
16#include <asm/pgtable.h> 16#include <asm/pgtable.h>
diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h
index ad595b679842..9565a892801e 100644
--- a/include/asm-sparc64/io.h
+++ b/include/asm-sparc64/io.h
@@ -14,11 +14,6 @@
14#define __SLOW_DOWN_IO do { } while (0) 14#define __SLOW_DOWN_IO do { } while (0)
15#define SLOW_DOWN_IO do { } while (0) 15#define SLOW_DOWN_IO do { } while (0)
16 16
17extern unsigned long virt_to_bus_not_defined_use_pci_map(volatile void *addr);
18#define virt_to_bus virt_to_bus_not_defined_use_pci_map
19extern unsigned long bus_to_virt_not_defined_use_pci_map(volatile void *addr);
20#define bus_to_virt bus_to_virt_not_defined_use_pci_map
21
22/* BIO layer definitions. */ 17/* BIO layer definitions. */
23extern unsigned long kern_base, kern_size; 18extern unsigned long kern_base, kern_size;
24#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) 19#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
diff --git a/include/asm-sparc64/iommu.h b/include/asm-sparc64/iommu.h
index 0b1813f41045..9eac6676caf1 100644
--- a/include/asm-sparc64/iommu.h
+++ b/include/asm-sparc64/iommu.h
@@ -1,7 +1,6 @@
1/* $Id: iommu.h,v 1.10 2001/03/08 09:55:56 davem Exp $ 1/* iommu.h: Definitions for the sun5 IOMMU.
2 * iommu.h: Definitions for the sun5 IOMMU.
3 * 2 *
4 * Copyright (C) 1996, 1999 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1996, 1999, 2007 David S. Miller (davem@davemloft.net)
5 */ 4 */
6#ifndef _SPARC64_IOMMU_H 5#ifndef _SPARC64_IOMMU_H
7#define _SPARC64_IOMMU_H 6#define _SPARC64_IOMMU_H
@@ -33,6 +32,7 @@ struct iommu {
33 unsigned long iommu_tsbbase; 32 unsigned long iommu_tsbbase;
34 unsigned long iommu_flush; 33 unsigned long iommu_flush;
35 unsigned long iommu_flushinv; 34 unsigned long iommu_flushinv;
35 unsigned long iommu_tags;
36 unsigned long iommu_ctxflush; 36 unsigned long iommu_ctxflush;
37 unsigned long write_complete_reg; 37 unsigned long write_complete_reg;
38 unsigned long dummy_page; 38 unsigned long dummy_page;
@@ -54,4 +54,7 @@ struct strbuf {
54 volatile unsigned long __flushflag_buf[(64+(64-1)) / sizeof(long)]; 54 volatile unsigned long __flushflag_buf[(64+(64-1)) / sizeof(long)];
55}; 55};
56 56
57#endif /* !(_SPARC_IOMMU_H) */ 57extern int iommu_table_init(struct iommu *iommu, int tsbsize,
58 u32 dma_offset, u32 dma_addr_mask);
59
60#endif /* !(_SPARC64_IOMMU_H) */
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
index e6c436ef9356..c00ad152771b 100644
--- a/include/asm-sparc64/irq.h
+++ b/include/asm-sparc64/irq.h
@@ -16,21 +16,21 @@
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17 17
18/* IMAP/ICLR register defines */ 18/* IMAP/ICLR register defines */
19#define IMAP_VALID 0x80000000 /* IRQ Enabled */ 19#define IMAP_VALID 0x80000000UL /* IRQ Enabled */
20#define IMAP_TID_UPA 0x7c000000 /* UPA TargetID */ 20#define IMAP_TID_UPA 0x7c000000UL /* UPA TargetID */
21#define IMAP_TID_JBUS 0x7c000000 /* JBUS TargetID */ 21#define IMAP_TID_JBUS 0x7c000000UL /* JBUS TargetID */
22#define IMAP_TID_SHIFT 26 22#define IMAP_TID_SHIFT 26
23#define IMAP_AID_SAFARI 0x7c000000 /* Safari AgentID */ 23#define IMAP_AID_SAFARI 0x7c000000UL /* Safari AgentID */
24#define IMAP_AID_SHIFT 26 24#define IMAP_AID_SHIFT 26
25#define IMAP_NID_SAFARI 0x03e00000 /* Safari NodeID */ 25#define IMAP_NID_SAFARI 0x03e00000UL /* Safari NodeID */
26#define IMAP_NID_SHIFT 21 26#define IMAP_NID_SHIFT 21
27#define IMAP_IGN 0x000007c0 /* IRQ Group Number */ 27#define IMAP_IGN 0x000007c0UL /* IRQ Group Number */
28#define IMAP_INO 0x0000003f /* IRQ Number */ 28#define IMAP_INO 0x0000003fUL /* IRQ Number */
29#define IMAP_INR 0x000007ff /* Full interrupt number*/ 29#define IMAP_INR 0x000007ffUL /* Full interrupt number*/
30 30
31#define ICLR_IDLE 0x00000000 /* Idle state */ 31#define ICLR_IDLE 0x00000000UL /* Idle state */
32#define ICLR_TRANSMIT 0x00000001 /* Transmit state */ 32#define ICLR_TRANSMIT 0x00000001UL /* Transmit state */
33#define ICLR_PENDING 0x00000003 /* Pending state */ 33#define ICLR_PENDING 0x00000003UL /* Pending state */
34 34
35/* The largest number of unique interrupt sources we support. 35/* The largest number of unique interrupt sources we support.
36 * If this needs to ever be larger than 255, you need to change 36 * If this needs to ever be larger than 255, you need to change
@@ -53,6 +53,9 @@ extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p,
53extern void sun4v_destroy_msi(unsigned int virt_irq); 53extern void sun4v_destroy_msi(unsigned int virt_irq);
54extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); 54extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
55 55
56extern void sparc64_set_msi(unsigned int virt_irq, u32 msi);
57extern u32 sparc64_get_msi(unsigned int virt_irq);
58
56extern void fixup_irqs(void); 59extern void fixup_irqs(void);
57 60
58static __inline__ void set_softint(unsigned long bits) 61static __inline__ void set_softint(unsigned long bits)
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h
index a331b7b0dff2..7f6774dca5f4 100644
--- a/include/asm-sparc64/kprobes.h
+++ b/include/asm-sparc64/kprobes.h
@@ -10,7 +10,6 @@ typedef u32 kprobe_opcode_t;
10#define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */ 10#define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */
11#define MAX_INSN_SIZE 2 11#define MAX_INSN_SIZE 2
12 12
13#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
14#define arch_remove_kprobe(p) do {} while (0) 13#define arch_remove_kprobe(p) do {} while (0)
15#define ARCH_INACTIVE_KPROBE_COUNT 0 14#define ARCH_INACTIVE_KPROBE_COUNT 0
16 15
diff --git a/include/asm-sparc64/mdesc.h b/include/asm-sparc64/mdesc.h
index e97c43133752..1acc7272e537 100644
--- a/include/asm-sparc64/mdesc.h
+++ b/include/asm-sparc64/mdesc.h
@@ -61,6 +61,16 @@ extern u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc);
61 61
62extern void mdesc_update(void); 62extern void mdesc_update(void);
63 63
64struct mdesc_notifier_client {
65 void (*add)(struct mdesc_handle *handle, u64 node);
66 void (*remove)(struct mdesc_handle *handle, u64 node);
67
68 const char *node_name;
69 struct mdesc_notifier_client *next;
70};
71
72extern void mdesc_register_notifier(struct mdesc_notifier_client *client);
73
64extern void mdesc_fill_in_cpu_data(cpumask_t mask); 74extern void mdesc_fill_in_cpu_data(cpumask_t mask);
65 75
66extern void sun4v_mdesc_init(void); 76extern void sun4v_mdesc_init(void);
diff --git a/include/asm-sparc64/of_device.h b/include/asm-sparc64/of_device.h
index 60e9173c9acb..46d69b3223c5 100644
--- a/include/asm-sparc64/of_device.h
+++ b/include/asm-sparc64/of_device.h
@@ -3,14 +3,9 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/of.h>
6#include <linux/mod_devicetable.h> 7#include <linux/mod_devicetable.h>
7#include <asm/openprom.h> 8#include <asm/openprom.h>
8#include <asm/prom.h>
9
10extern struct bus_type isa_bus_type;
11extern struct bus_type ebus_bus_type;
12extern struct bus_type sbus_bus_type;
13extern struct bus_type of_bus_type;
14 9
15/* 10/*
16 * The of_device is a kind of "base class" that is a superset of 11 * The of_device is a kind of "base class" that is a superset of
@@ -31,50 +26,13 @@ struct of_device
31 int portid; 26 int portid;
32 int clock_freq; 27 int clock_freq;
33}; 28};
34#define to_of_device(d) container_of(d, struct of_device, dev)
35 29
36extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 30extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
37extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 31extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
38 32
39extern struct of_device *of_find_device_by_node(struct device_node *); 33/* These are just here during the transition */
40 34#include <linux/of_device.h>
41extern const struct of_device_id *of_match_device( 35#include <linux/of_platform.h>
42 const struct of_device_id *matches, const struct of_device *dev);
43
44extern struct of_device *of_dev_get(struct of_device *dev);
45extern void of_dev_put(struct of_device *dev);
46
47/*
48 * An of_platform_driver driver is attached to a basic of_device on
49 * the ISA, EBUS, and SBUS busses on sparc64.
50 */
51struct of_platform_driver
52{
53 char *name;
54 struct of_device_id *match_table;
55 struct module *owner;
56
57 int (*probe)(struct of_device* dev, const struct of_device_id *match);
58 int (*remove)(struct of_device* dev);
59
60 int (*suspend)(struct of_device* dev, pm_message_t state);
61 int (*resume)(struct of_device* dev);
62 int (*shutdown)(struct of_device* dev);
63
64 struct device_driver driver;
65};
66#define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver)
67
68extern int of_register_driver(struct of_platform_driver *drv,
69 struct bus_type *bus);
70extern void of_unregister_driver(struct of_platform_driver *drv);
71extern int of_device_register(struct of_device *ofdev);
72extern void of_device_unregister(struct of_device *ofdev);
73extern struct of_device *of_platform_device_create(struct device_node *np,
74 const char *bus_id,
75 struct device *parent,
76 struct bus_type *bus);
77extern void of_release_dev(struct device *dev);
78 36
79#endif /* __KERNEL__ */ 37#endif /* __KERNEL__ */
80#endif /* _ASM_SPARC64_OF_DEVICE_H */ 38#endif /* _ASM_SPARC64_OF_DEVICE_H */
diff --git a/include/asm-sparc64/of_platform.h b/include/asm-sparc64/of_platform.h
new file mode 100644
index 000000000000..f7c1f17c7d52
--- /dev/null
+++ b/include/asm-sparc64/of_platform.h
@@ -0,0 +1,33 @@
1#ifndef _ASM_SPARC64_OF_PLATFORM_H
2#define _ASM_SPARC64_OF_PLATFORM_H
3/*
4 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
5 * <benh@kernel.crashing.org>
6 * Modified for Sparc by merging parts of asm-sparc/of_device.h
7 * by Stephen Rothwell
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 *
14 */
15
16/* This is just here during the transition */
17#include <linux/of_platform.h>
18
19extern struct bus_type isa_bus_type;
20extern struct bus_type ebus_bus_type;
21extern struct bus_type sbus_bus_type;
22extern struct bus_type of_platform_bus_type;
23#define of_bus_type of_platform_bus_type /* for compatibility */
24
25extern int of_register_driver(struct of_platform_driver *drv,
26 struct bus_type *bus);
27extern void of_unregister_driver(struct of_platform_driver *drv);
28extern struct of_device *of_platform_device_create(struct device_node *np,
29 const char *bus_id,
30 struct device *parent,
31 struct bus_type *bus);
32
33#endif /* _ASM_SPARC64_OF_PLATFORM_H */
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h
index 992f9f7a476c..86dc5c018a19 100644
--- a/include/asm-sparc64/oplib.h
+++ b/include/asm-sparc64/oplib.h
@@ -1,8 +1,7 @@
1/* $Id: oplib.h,v 1.14 2001/12/19 00:29:51 davem Exp $ 1/* oplib.h: Describes the interface and available routines in the
2 * oplib.h: Describes the interface and available routines in the
3 * Linux Prom library. 2 * Linux Prom library.
4 * 3 *
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
6 * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 5 * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
7 */ 6 */
8 7
@@ -31,8 +30,10 @@ extern int prom_chosen_node;
31extern const char prom_peer_name[]; 30extern const char prom_peer_name[];
32extern const char prom_compatible_name[]; 31extern const char prom_compatible_name[];
33extern const char prom_root_compatible[]; 32extern const char prom_root_compatible[];
33extern const char prom_cpu_compatible[];
34extern const char prom_finddev_name[]; 34extern const char prom_finddev_name[];
35extern const char prom_chosen_path[]; 35extern const char prom_chosen_path[];
36extern const char prom_cpu_path[];
36extern const char prom_getprop_name[]; 37extern const char prom_getprop_name[];
37extern const char prom_mmu_name[]; 38extern const char prom_mmu_name[];
38extern const char prom_callmethod_name[]; 39extern const char prom_callmethod_name[];
@@ -140,32 +141,6 @@ extern void prom_putchar(char character);
140extern void prom_printf(const char *fmt, ...); 141extern void prom_printf(const char *fmt, ...);
141extern void prom_write(const char *buf, unsigned int len); 142extern void prom_write(const char *buf, unsigned int len);
142 143
143/* Query for input device type */
144
145enum prom_input_device {
146 PROMDEV_IKBD, /* input from keyboard */
147 PROMDEV_ITTYA, /* input from ttya */
148 PROMDEV_ITTYB, /* input from ttyb */
149 PROMDEV_IRSC, /* input from rsc */
150 PROMDEV_IVCONS, /* input from virtual-console */
151 PROMDEV_I_UNK,
152};
153
154extern enum prom_input_device prom_query_input_device(void);
155
156/* Query for output device type */
157
158enum prom_output_device {
159 PROMDEV_OSCREEN, /* to screen */
160 PROMDEV_OTTYA, /* to ttya */
161 PROMDEV_OTTYB, /* to ttyb */
162 PROMDEV_ORSC, /* to rsc */
163 PROMDEV_OVCONS, /* to virtual-console */
164 PROMDEV_O_UNK,
165};
166
167extern enum prom_output_device prom_query_output_device(void);
168
169/* Multiprocessor operations... */ 144/* Multiprocessor operations... */
170#ifdef CONFIG_SMP 145#ifdef CONFIG_SMP
171/* Start the CPU with the given device tree node at the passed program 146/* Start the CPU with the given device tree node at the passed program
@@ -319,6 +294,8 @@ extern int prom_inst2pkg(int);
319extern int prom_service_exists(const char *service_name); 294extern int prom_service_exists(const char *service_name);
320extern void prom_sun4v_guest_soft_state(void); 295extern void prom_sun4v_guest_soft_state(void);
321 296
297extern int prom_ihandle2path(int handle, char *buffer, int bufsize);
298
322/* Client interface level routines. */ 299/* Client interface level routines. */
323extern void prom_set_trap_table(unsigned long tba); 300extern void prom_set_trap_table(unsigned long tba);
324extern void prom_set_trap_table_sun4v(unsigned long tba, unsigned long mmfsa); 301extern void prom_set_trap_table_sun4v(unsigned long tba, unsigned long mmfsa);
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h
index 23cc63f049a8..8116e8f6062c 100644
--- a/include/asm-sparc64/parport.h
+++ b/include/asm-sparc64/parport.h
@@ -8,8 +8,9 @@
8#define _ASM_SPARC64_PARPORT_H 1 8#define _ASM_SPARC64_PARPORT_H 1
9 9
10#include <asm/ebus.h> 10#include <asm/ebus.h>
11#include <asm/isa.h>
12#include <asm/ns87303.h> 11#include <asm/ns87303.h>
12#include <asm/of_device.h>
13#include <asm/prom.h>
13 14
14#define PARPORT_PC_MAX_PORTS PARPORT_MAX 15#define PARPORT_PC_MAX_PORTS PARPORT_MAX
15 16
@@ -35,8 +36,12 @@ static struct sparc_ebus_info {
35 unsigned int addr; 36 unsigned int addr;
36 unsigned int count; 37 unsigned int count;
37 int lock; 38 int lock;
39
40 struct parport *port;
38} sparc_ebus_dmas[PARPORT_PC_MAX_PORTS]; 41} sparc_ebus_dmas[PARPORT_PC_MAX_PORTS];
39 42
43static DECLARE_BITMAP(dma_slot_map, PARPORT_PC_MAX_PORTS);
44
40static __inline__ int request_dma(unsigned int dmanr, const char *device_id) 45static __inline__ int request_dma(unsigned int dmanr, const char *device_id)
41{ 46{
42 if (dmanr >= PARPORT_PC_MAX_PORTS) 47 if (dmanr >= PARPORT_PC_MAX_PORTS)
@@ -98,117 +103,145 @@ static __inline__ unsigned int get_dma_residue(unsigned int dmanr)
98 return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info); 103 return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info);
99} 104}
100 105
101static int ebus_ecpp_p(struct linux_ebus_device *edev) 106static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id *match)
102{ 107{
103 if (!strcmp(edev->prom_node->name, "ecpp")) 108 unsigned long base = op->resource[0].start;
104 return 1; 109 unsigned long config = op->resource[1].start;
105 if (!strcmp(edev->prom_node->name, "parallel")) { 110 unsigned long d_base = op->resource[2].start;
106 const char *compat; 111 unsigned long d_len;
107 112 struct device_node *parent;
108 compat = of_get_property(edev->prom_node, 113 struct parport *p;
109 "compatible", NULL); 114 int slot, err;
110 if (compat && 115
111 (!strcmp(compat, "ecpp") || 116 parent = op->node->parent;
112 !strcmp(compat, "ns87317-ecpp") || 117 if (!strcmp(parent->name, "dma")) {
113 !strcmp(compat + 13, "ecpp"))) 118 p = parport_pc_probe_port(base, base + 0x400,
114 return 1; 119 op->irqs[0], PARPORT_DMA_NOFIFO,
120 op->dev.parent->parent);
121 if (!p)
122 return -ENOMEM;
123 dev_set_drvdata(&op->dev, p);
124 return 0;
115 } 125 }
126
127 for (slot = 0; slot < PARPORT_PC_MAX_PORTS; slot++) {
128 if (!test_and_set_bit(slot, dma_slot_map))
129 break;
130 }
131 err = -ENODEV;
132 if (slot >= PARPORT_PC_MAX_PORTS)
133 goto out_err;
134
135 spin_lock_init(&sparc_ebus_dmas[slot].info.lock);
136
137 d_len = (op->resource[2].end - d_base) + 1UL;
138 sparc_ebus_dmas[slot].info.regs =
139 of_ioremap(&op->resource[2], 0, d_len, "ECPP DMA");
140
141 if (!sparc_ebus_dmas[slot].info.regs)
142 goto out_clear_map;
143
144 sparc_ebus_dmas[slot].info.flags = 0;
145 sparc_ebus_dmas[slot].info.callback = NULL;
146 sparc_ebus_dmas[slot].info.client_cookie = NULL;
147 sparc_ebus_dmas[slot].info.irq = 0xdeadbeef;
148 strcpy(sparc_ebus_dmas[slot].info.name, "parport");
149 if (ebus_dma_register(&sparc_ebus_dmas[slot].info))
150 goto out_unmap_regs;
151
152 ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 1);
153
154 /* Configure IRQ to Push Pull, Level Low */
155 /* Enable ECP, set bit 2 of the CTR first */
156 outb(0x04, base + 0x02);
157 ns87303_modify(config, PCR,
158 PCR_EPP_ENABLE |
159 PCR_IRQ_ODRAIN,
160 PCR_ECP_ENABLE |
161 PCR_ECP_CLK_ENA |
162 PCR_IRQ_POLAR);
163
164 /* CTR bit 5 controls direction of port */
165 ns87303_modify(config, PTR,
166 0, PTR_LPT_REG_DIR);
167
168 p = parport_pc_probe_port(base, base + 0x400,
169 op->irqs[0],
170 slot,
171 op->dev.parent);
172 err = -ENOMEM;
173 if (!p)
174 goto out_disable_irq;
175
176 dev_set_drvdata(&op->dev, p);
177
116 return 0; 178 return 0;
179
180out_disable_irq:
181 ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 0);
182 ebus_dma_unregister(&sparc_ebus_dmas[slot].info);
183
184out_unmap_regs:
185 of_iounmap(&op->resource[2], sparc_ebus_dmas[slot].info.regs, d_len);
186
187out_clear_map:
188 clear_bit(slot, dma_slot_map);
189
190out_err:
191 return err;
117} 192}
118 193
119static int parport_isa_probe(int count) 194static int __devexit ecpp_remove(struct of_device *op)
120{ 195{
121 struct sparc_isa_bridge *isa_br; 196 struct parport *p = dev_get_drvdata(&op->dev);
122 struct sparc_isa_device *isa_dev; 197 int slot = p->dma;
123 198
124 for_each_isa(isa_br) { 199 parport_pc_unregister_port(p);
125 for_each_isadev(isa_dev, isa_br) { 200
126 struct sparc_isa_device *child; 201 if (slot != PARPORT_DMA_NOFIFO) {
127 unsigned long base; 202 unsigned long d_base = op->resource[2].start;
128 203 unsigned long d_len;
129 if (strcmp(isa_dev->prom_node->name, "dma")) 204
130 continue; 205 d_len = (op->resource[2].end - d_base) + 1UL;
131 206
132 child = isa_dev->child; 207 ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 0);
133 while (child) { 208 ebus_dma_unregister(&sparc_ebus_dmas[slot].info);
134 if (!strcmp(child->prom_node->name, "parallel")) 209 of_iounmap(&op->resource[2],
135 break; 210 sparc_ebus_dmas[slot].info.regs,
136 child = child->next; 211 d_len);
137 } 212 clear_bit(slot, dma_slot_map);
138 if (!child)
139 continue;
140
141 base = child->resource.start;
142
143 /* No DMA, see commentary in
144 * asm-sparc64/floppy.h:isa_floppy_init()
145 */
146 if (parport_pc_probe_port(base, base + 0x400,
147 child->irq, PARPORT_DMA_NOFIFO,
148 &child->bus->self->dev))
149 count++;
150 }
151 } 213 }
152 214
153 return count; 215 return 0;
154} 216}
155 217
156static int parport_pc_find_nonpci_ports (int autoirq, int autodma) 218static struct of_device_id ecpp_match[] = {
219 {
220 .name = "ecpp",
221 },
222 {
223 .name = "parallel",
224 .compatible = "ecpp",
225 },
226 {
227 .name = "parallel",
228 .compatible = "ns87317-ecpp",
229 },
230 {},
231};
232
233static struct of_platform_driver ecpp_driver = {
234 .name = "ecpp",
235 .match_table = ecpp_match,
236 .probe = ecpp_probe,
237 .remove = __devexit_p(ecpp_remove),
238};
239
240static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
157{ 241{
158 struct linux_ebus *ebus; 242 of_register_driver(&ecpp_driver, &of_bus_type);
159 struct linux_ebus_device *edev;
160 int count = 0;
161
162 for_each_ebus(ebus) {
163 for_each_ebusdev(edev, ebus) {
164 if (ebus_ecpp_p(edev)) {
165 unsigned long base = edev->resource[0].start;
166 unsigned long config = edev->resource[1].start;
167 unsigned long d_base = edev->resource[2].start;
168 unsigned long d_len;
169
170 spin_lock_init(&sparc_ebus_dmas[count].info.lock);
171 d_len = (edev->resource[2].end -
172 d_base) + 1;
173 sparc_ebus_dmas[count].info.regs =
174 ioremap(d_base, d_len);
175 if (!sparc_ebus_dmas[count].info.regs)
176 continue;
177 sparc_ebus_dmas[count].info.flags = 0;
178 sparc_ebus_dmas[count].info.callback = NULL;
179 sparc_ebus_dmas[count].info.client_cookie = NULL;
180 sparc_ebus_dmas[count].info.irq = 0xdeadbeef;
181 strcpy(sparc_ebus_dmas[count].info.name, "parport");
182 if (ebus_dma_register(&sparc_ebus_dmas[count].info))
183 continue;
184 ebus_dma_irq_enable(&sparc_ebus_dmas[count].info, 1);
185
186 /* Configure IRQ to Push Pull, Level Low */
187 /* Enable ECP, set bit 2 of the CTR first */
188 outb(0x04, base + 0x02);
189 ns87303_modify(config, PCR,
190 PCR_EPP_ENABLE |
191 PCR_IRQ_ODRAIN,
192 PCR_ECP_ENABLE |
193 PCR_ECP_CLK_ENA |
194 PCR_IRQ_POLAR);
195
196 /* CTR bit 5 controls direction of port */
197 ns87303_modify(config, PTR,
198 0, PTR_LPT_REG_DIR);
199
200 if (parport_pc_probe_port(base, base + 0x400,
201 edev->irqs[0],
202 count,
203 &ebus->self->dev))
204 count++;
205 }
206 }
207 }
208 243
209 count = parport_isa_probe(count); 244 return 0;
210
211 return count;
212} 245}
213 246
214#endif /* !(_ASM_SPARC64_PARPORT_H */ 247#endif /* !(_ASM_SPARC64_PARPORT_H */
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
index e11ac100f043..1393e57d50fb 100644
--- a/include/asm-sparc64/pci.h
+++ b/include/asm-sparc64/pci.h
@@ -3,8 +3,7 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/fs.h> 6#include <linux/dma-mapping.h>
7#include <linux/mm.h>
8 7
9/* Can be used to override the logic in pci_scan_bus for skipping 8/* Can be used to override the logic in pci_scan_bus for skipping
10 * already-configured bus numbers - to be used for buggy BIOSes 9 * already-configured bus numbers - to be used for buggy BIOSes
@@ -30,80 +29,42 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
30 /* We don't do dynamic PCI IRQ allocation */ 29 /* We don't do dynamic PCI IRQ allocation */
31} 30}
32 31
33/* Dynamic DMA mapping stuff.
34 */
35
36/* The PCI address space does not equal the physical memory 32/* The PCI address space does not equal the physical memory
37 * address space. The networking and block device layers use 33 * address space. The networking and block device layers use
38 * this boolean for bounce buffer decisions. 34 * this boolean for bounce buffer decisions.
39 */ 35 */
40#define PCI_DMA_BUS_IS_PHYS (0) 36#define PCI_DMA_BUS_IS_PHYS (0)
41 37
42#include <asm/scatterlist.h> 38static inline void *pci_alloc_consistent(struct pci_dev *pdev, size_t size,
43 39 dma_addr_t *dma_handle)
44struct pci_dev;
45
46struct pci_iommu_ops {
47 void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *, gfp_t);
48 void (*free_consistent)(struct pci_dev *, size_t, void *, dma_addr_t);
49 dma_addr_t (*map_single)(struct pci_dev *, void *, size_t, int);
50 void (*unmap_single)(struct pci_dev *, dma_addr_t, size_t, int);
51 int (*map_sg)(struct pci_dev *, struct scatterlist *, int, int);
52 void (*unmap_sg)(struct pci_dev *, struct scatterlist *, int, int);
53 void (*dma_sync_single_for_cpu)(struct pci_dev *, dma_addr_t, size_t, int);
54 void (*dma_sync_sg_for_cpu)(struct pci_dev *, struct scatterlist *, int, int);
55};
56
57extern const struct pci_iommu_ops *pci_iommu_ops;
58
59/* Allocate and map kernel buffer using consistent mode DMA for a device.
60 * hwdev should be valid struct pci_dev pointer for PCI devices.
61 */
62static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle)
63{ 40{
64 return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle, GFP_ATOMIC); 41 return dma_alloc_coherent(&pdev->dev, size, dma_handle, GFP_ATOMIC);
65} 42}
66 43
67/* Free and unmap a consistent DMA buffer. 44static inline void pci_free_consistent(struct pci_dev *pdev, size_t size,
68 * cpu_addr is what was returned from pci_alloc_consistent, 45 void *vaddr, dma_addr_t dma_handle)
69 * size must be the same as what as passed into pci_alloc_consistent,
70 * and likewise dma_addr must be the same as what *dma_addrp was set to.
71 *
72 * References to the memory and mappings associated with cpu_addr/dma_addr
73 * past this call are illegal.
74 */
75static inline void pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle)
76{ 46{
77 return pci_iommu_ops->free_consistent(hwdev, size, vaddr, dma_handle); 47 return dma_free_coherent(&pdev->dev, size, vaddr, dma_handle);
78} 48}
79 49
80/* Map a single buffer of the indicated size for DMA in streaming mode. 50static inline dma_addr_t pci_map_single(struct pci_dev *pdev, void *ptr,
81 * The 32-bit bus address to use is returned. 51 size_t size, int direction)
82 *
83 * Once the device is given the dma address, the device owns this memory
84 * until either pci_unmap_single or pci_dma_sync_single_for_cpu is performed.
85 */
86static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
87{ 52{
88 return pci_iommu_ops->map_single(hwdev, ptr, size, direction); 53 return dma_map_single(&pdev->dev, ptr, size,
54 (enum dma_data_direction) direction);
89} 55}
90 56
91/* Unmap a single streaming mode DMA translation. The dma_addr and size 57static inline void pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr,
92 * must match what was provided for in a previous pci_map_single call. All 58 size_t size, int direction)
93 * other usages are undefined.
94 *
95 * After this call, reads by the cpu to the buffer are guaranteed to see
96 * whatever the device wrote there.
97 */
98static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction)
99{ 59{
100 pci_iommu_ops->unmap_single(hwdev, dma_addr, size, direction); 60 dma_unmap_single(&pdev->dev, dma_addr, size,
61 (enum dma_data_direction) direction);
101} 62}
102 63
103/* No highmem on sparc64, plus we have an IOMMU, so mapping pages is easy. */
104#define pci_map_page(dev, page, off, size, dir) \ 64#define pci_map_page(dev, page, off, size, dir) \
105 pci_map_single(dev, (page_address(page) + (off)), size, dir) 65 pci_map_single(dev, (page_address(page) + (off)), size, dir)
106#define pci_unmap_page(dev,addr,sz,dir) pci_unmap_single(dev,addr,sz,dir) 66#define pci_unmap_page(dev,addr,sz,dir) \
67 pci_unmap_single(dev,addr,sz,dir)
107 68
108/* pci_unmap_{single,page} is not a nop, thus... */ 69/* pci_unmap_{single,page} is not a nop, thus... */
109#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ 70#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
@@ -119,75 +80,48 @@ static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
119#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ 80#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
120 (((PTR)->LEN_NAME) = (VAL)) 81 (((PTR)->LEN_NAME) = (VAL))
121 82
122/* Map a set of buffers described by scatterlist in streaming 83static inline int pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg,
123 * mode for DMA. This is the scatter-gather version of the 84 int nents, int direction)
124 * above pci_map_single interface. Here the scatter gather list
125 * elements are each tagged with the appropriate dma address
126 * and length. They are obtained via sg_dma_{address,length}(SG).
127 *
128 * NOTE: An implementation may be able to use a smaller number of
129 * DMA address/length pairs than there are SG table elements.
130 * (for example via virtual mapping capabilities)
131 * The routine returns the number of addr/length pairs actually
132 * used, at most nents.
133 *
134 * Device ownership issues as mentioned above for pci_map_single are
135 * the same here.
136 */
137static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction)
138{ 85{
139 return pci_iommu_ops->map_sg(hwdev, sg, nents, direction); 86 return dma_map_sg(&pdev->dev, sg, nents,
87 (enum dma_data_direction) direction);
140} 88}
141 89
142/* Unmap a set of streaming mode DMA translations. 90static inline void pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg,
143 * Again, cpu read rules concerning calls here are the same as for 91 int nents, int direction)
144 * pci_unmap_single() above.
145 */
146static inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nhwents, int direction)
147{ 92{
148 pci_iommu_ops->unmap_sg(hwdev, sg, nhwents, direction); 93 dma_unmap_sg(&pdev->dev, sg, nents,
94 (enum dma_data_direction) direction);
149} 95}
150 96
151/* Make physical memory consistent for a single 97static inline void pci_dma_sync_single_for_cpu(struct pci_dev *pdev,
152 * streaming mode DMA translation after a transfer. 98 dma_addr_t dma_handle,
153 * 99 size_t size, int direction)
154 * If you perform a pci_map_single() but wish to interrogate the
155 * buffer using the cpu, yet do not wish to teardown the PCI dma
156 * mapping, you must call this function before doing so. At the
157 * next point you give the PCI dma address back to the card, you
158 * must first perform a pci_dma_sync_for_device, and then the
159 * device again owns the buffer.
160 */
161static inline void pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction)
162{ 100{
163 pci_iommu_ops->dma_sync_single_for_cpu(hwdev, dma_handle, size, direction); 101 dma_sync_single_for_cpu(&pdev->dev, dma_handle, size,
102 (enum dma_data_direction) direction);
164} 103}
165 104
166static inline void 105static inline void pci_dma_sync_single_for_device(struct pci_dev *pdev,
167pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t dma_handle, 106 dma_addr_t dma_handle,
168 size_t size, int direction) 107 size_t size, int direction)
169{ 108{
170 /* No flushing needed to sync cpu writes to the device. */ 109 /* No flushing needed to sync cpu writes to the device. */
171 BUG_ON(direction == PCI_DMA_NONE);
172} 110}
173 111
174/* Make physical memory consistent for a set of streaming 112static inline void pci_dma_sync_sg_for_cpu(struct pci_dev *pdev,
175 * mode DMA translations after a transfer. 113 struct scatterlist *sg,
176 * 114 int nents, int direction)
177 * The same as pci_dma_sync_single_* but for a scatter-gather list,
178 * same rules and usage.
179 */
180static inline void pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction)
181{ 115{
182 pci_iommu_ops->dma_sync_sg_for_cpu(hwdev, sg, nelems, direction); 116 dma_sync_sg_for_cpu(&pdev->dev, sg, nents,
117 (enum dma_data_direction) direction);
183} 118}
184 119
185static inline void 120static inline void pci_dma_sync_sg_for_device(struct pci_dev *pdev,
186pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sg, 121 struct scatterlist *sg,
187 int nelems, int direction) 122 int nelems, int direction)
188{ 123{
189 /* No flushing needed to sync cpu writes to the device. */ 124 /* No flushing needed to sync cpu writes to the device. */
190 BUG_ON(direction == PCI_DMA_NONE);
191} 125}
192 126
193/* Return whether the given PCI device DMA address mask can 127/* Return whether the given PCI device DMA address mask can
@@ -206,11 +140,9 @@ extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask);
206#define PCI64_REQUIRED_MASK (~(dma64_addr_t)0) 140#define PCI64_REQUIRED_MASK (~(dma64_addr_t)0)
207#define PCI64_ADDR_BASE 0xfffc000000000000UL 141#define PCI64_ADDR_BASE 0xfffc000000000000UL
208 142
209#define PCI_DMA_ERROR_CODE (~(dma_addr_t)0x0)
210
211static inline int pci_dma_mapping_error(dma_addr_t dma_addr) 143static inline int pci_dma_mapping_error(dma_addr_t dma_addr)
212{ 144{
213 return (dma_addr == PCI_DMA_ERROR_CODE); 145 return dma_mapping_error(dma_addr);
214} 146}
215 147
216#ifdef CONFIG_PCI 148#ifdef CONFIG_PCI
diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h
index 88db872ce2f8..a1f53a4da405 100644
--- a/include/asm-sparc64/percpu.h
+++ b/include/asm-sparc64/percpu.h
@@ -3,6 +3,8 @@
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5 5
6register unsigned long __local_per_cpu_offset asm("g5");
7
6#ifdef CONFIG_SMP 8#ifdef CONFIG_SMP
7 9
8#define setup_per_cpu_areas() do { } while (0) 10#define setup_per_cpu_areas() do { } while (0)
@@ -18,7 +20,10 @@ extern unsigned long __per_cpu_shift;
18#define DEFINE_PER_CPU(type, name) \ 20#define DEFINE_PER_CPU(type, name) \
19 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name 21 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
20 22
21register unsigned long __local_per_cpu_offset asm("g5"); 23#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
24 __attribute__((__section__(".data.percpu.shared_aligned"))) \
25 __typeof__(type) per_cpu__##name \
26 ____cacheline_aligned_in_smp
22 27
23/* var is in discarded region: offset to particular copy we want */ 28/* var is in discarded region: offset to particular copy we want */
24#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) 29#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
@@ -38,6 +43,8 @@ do { \
38#define real_setup_per_cpu_areas() do { } while (0) 43#define real_setup_per_cpu_areas() do { } while (0)
39#define DEFINE_PER_CPU(type, name) \ 44#define DEFINE_PER_CPU(type, name) \
40 __typeof__(type) per_cpu__##name 45 __typeof__(type) per_cpu__##name
46#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
47 DEFINE_PER_CPU(type, name)
41 48
42#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) 49#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var))
43#define __get_cpu_var(var) per_cpu__##var 50#define __get_cpu_var(var) per_cpu__##var
diff --git a/include/asm-sparc64/power.h b/include/asm-sparc64/power.h
deleted file mode 100644
index 94495c1ac4f6..000000000000
--- a/include/asm-sparc64/power.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _SPARC64_POWER_H
2#define _SPARC64_POWER_H
3
4extern void wake_up_powerd(void);
5extern int start_powerd(void);
6
7#endif /* !(_SPARC64_POWER_H) */
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index b4df3042add0..07843f9f05df 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -2,7 +2,6 @@
2#define _SPARC64_PROM_H 2#define _SPARC64_PROM_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5
6/* 5/*
7 * Definitions for talking to the Open Firmware PROM on 6 * Definitions for talking to the Open Firmware PROM on
8 * Power Macintosh computers. 7 * Power Macintosh computers.
@@ -17,11 +16,17 @@
17 * as published by the Free Software Foundation; either version 16 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version. 17 * 2 of the License, or (at your option) any later version.
19 */ 18 */
20
21#include <linux/types.h> 19#include <linux/types.h>
22#include <linux/proc_fs.h> 20#include <linux/proc_fs.h>
23#include <asm/atomic.h> 21#include <asm/atomic.h>
24 22
23#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
24#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
25
26#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l))
27#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
28#define of_node_cmp(s1, s2) strcmp((s1), (s2))
29
25typedef u32 phandle; 30typedef u32 phandle;
26typedef u32 ihandle; 31typedef u32 ihandle;
27 32
@@ -63,54 +68,36 @@ struct of_irq_controller {
63 void *data; 68 void *data;
64}; 69};
65 70
66/* flag descriptions */
67#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
68
69#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) 71#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
70#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) 72#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
71 73
72#define OF_BAD_ADDR ((u64)-1)
73
74static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
75{
76 dn->pde = de;
77}
78
79extern struct device_node *of_find_node_by_name(struct device_node *from,
80 const char *name);
81#define for_each_node_by_name(dn, name) \
82 for (dn = of_find_node_by_name(NULL, name); dn; \
83 dn = of_find_node_by_name(dn, name))
84extern struct device_node *of_find_node_by_type(struct device_node *from,
85 const char *type);
86#define for_each_node_by_type(dn, type) \
87 for (dn = of_find_node_by_type(NULL, type); dn; \
88 dn = of_find_node_by_type(dn, type))
89extern struct device_node *of_find_compatible_node(struct device_node *from,
90 const char *type, const char *compat);
91extern struct device_node *of_find_node_by_path(const char *path);
92extern struct device_node *of_find_node_by_phandle(phandle handle);
93extern struct device_node *of_find_node_by_cpuid(int cpuid); 74extern struct device_node *of_find_node_by_cpuid(int cpuid);
94extern struct device_node *of_get_parent(const struct device_node *node);
95extern struct device_node *of_get_next_child(const struct device_node *node,
96 struct device_node *prev);
97extern struct property *of_find_property(const struct device_node *np,
98 const char *name,
99 int *lenp);
100extern int of_device_is_compatible(const struct device_node *device,
101 const char *);
102extern const void *of_get_property(const struct device_node *node,
103 const char *name,
104 int *lenp);
105#define get_property(node,name,lenp) of_get_property(node,name,lenp)
106extern int of_set_property(struct device_node *node, const char *name, void *val, int len); 75extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
107extern int of_getintprop_default(struct device_node *np, 76extern int of_getintprop_default(struct device_node *np,
108 const char *name, 77 const char *name,
109 int def); 78 int def);
110extern int of_n_addr_cells(struct device_node *np); 79extern int of_find_in_proplist(const char *list, const char *match, int len);
111extern int of_n_size_cells(struct device_node *np);
112 80
113extern void prom_build_devicetree(void); 81extern void prom_build_devicetree(void);
114 82
83/* Dummy ref counting routines - to be implemented later */
84static inline struct device_node *of_node_get(struct device_node *node)
85{
86 return node;
87}
88static inline void of_node_put(struct device_node *node)
89{
90}
91
92/*
93 * NB: This is here while we transition from using asm/prom.h
94 * to linux/of.h
95 */
96#include <linux/of.h>
97
98extern struct device_node *of_console_device;
99extern char *of_console_path;
100extern char *of_console_options;
101
115#endif /* __KERNEL__ */ 102#endif /* __KERNEL__ */
116#endif /* _SPARC64_PROM_H */ 103#endif /* _SPARC64_PROM_H */
diff --git a/include/asm-sparc64/sbus.h b/include/asm-sparc64/sbus.h
index 7efd49d31bb8..0151cad486f3 100644
--- a/include/asm-sparc64/sbus.h
+++ b/include/asm-sparc64/sbus.h
@@ -1,7 +1,6 @@
1/* $Id: sbus.h,v 1.14 2000/02/18 13:50:55 davem Exp $ 1/* sbus.h: Defines for the Sun SBus.
2 * sbus.h: Defines for the Sun SBus.
3 * 2 *
4 * Copyright (C) 1996, 1999 David S. Miller (davem@redhat.com) 3 * Copyright (C) 1996, 1999, 2007 David S. Miller (davem@davemloft.net)
5 */ 4 */
6 5
7#ifndef _SPARC64_SBUS_H 6#ifndef _SPARC64_SBUS_H
@@ -69,7 +68,6 @@ struct sbus_dev {
69/* This struct describes the SBus(s) found on this machine. */ 68/* This struct describes the SBus(s) found on this machine. */
70struct sbus_bus { 69struct sbus_bus {
71 struct of_device ofdev; 70 struct of_device ofdev;
72 void *iommu; /* Opaque IOMMU cookie */
73 struct sbus_dev *devices; /* Tree of SBUS devices */ 71 struct sbus_dev *devices; /* Tree of SBUS devices */
74 struct sbus_bus *next; /* Next SBUS in system */ 72 struct sbus_bus *next; /* Next SBUS in system */
75 int prom_node; /* OBP node of SBUS */ 73 int prom_node; /* OBP node of SBUS */
@@ -102,9 +100,18 @@ extern struct sbus_bus *sbus_root;
102extern void sbus_set_sbus64(struct sbus_dev *, int); 100extern void sbus_set_sbus64(struct sbus_dev *, int);
103extern void sbus_fill_device_irq(struct sbus_dev *); 101extern void sbus_fill_device_irq(struct sbus_dev *);
104 102
105/* These yield IOMMU mappings in consistent mode. */ 103static inline void *sbus_alloc_consistent(struct sbus_dev *sdev , size_t size,
106extern void *sbus_alloc_consistent(struct sbus_dev *, size_t, dma_addr_t *dma_addrp); 104 dma_addr_t *dma_handle)
107extern void sbus_free_consistent(struct sbus_dev *, size_t, void *, dma_addr_t); 105{
106 return dma_alloc_coherent(&sdev->ofdev.dev, size,
107 dma_handle, GFP_ATOMIC);
108}
109
110static inline void sbus_free_consistent(struct sbus_dev *sdev, size_t size,
111 void *vaddr, dma_addr_t dma_handle)
112{
113 return dma_free_coherent(&sdev->ofdev.dev, size, vaddr, dma_handle);
114}
108 115
109#define SBUS_DMA_BIDIRECTIONAL DMA_BIDIRECTIONAL 116#define SBUS_DMA_BIDIRECTIONAL DMA_BIDIRECTIONAL
110#define SBUS_DMA_TODEVICE DMA_TO_DEVICE 117#define SBUS_DMA_TODEVICE DMA_TO_DEVICE
@@ -112,18 +119,67 @@ extern void sbus_free_consistent(struct sbus_dev *, size_t, void *, dma_addr_t);
112#define SBUS_DMA_NONE DMA_NONE 119#define SBUS_DMA_NONE DMA_NONE
113 120
114/* All the rest use streaming mode mappings. */ 121/* All the rest use streaming mode mappings. */
115extern dma_addr_t sbus_map_single(struct sbus_dev *, void *, size_t, int); 122static inline dma_addr_t sbus_map_single(struct sbus_dev *sdev, void *ptr,
116extern void sbus_unmap_single(struct sbus_dev *, dma_addr_t, size_t, int); 123 size_t size, int direction)
117extern int sbus_map_sg(struct sbus_dev *, struct scatterlist *, int, int); 124{
118extern void sbus_unmap_sg(struct sbus_dev *, struct scatterlist *, int, int); 125 return dma_map_single(&sdev->ofdev.dev, ptr, size,
126 (enum dma_data_direction) direction);
127}
128
129static inline void sbus_unmap_single(struct sbus_dev *sdev,
130 dma_addr_t dma_addr, size_t size,
131 int direction)
132{
133 dma_unmap_single(&sdev->ofdev.dev, dma_addr, size,
134 (enum dma_data_direction) direction);
135}
136
137static inline int sbus_map_sg(struct sbus_dev *sdev, struct scatterlist *sg,
138 int nents, int direction)
139{
140 return dma_map_sg(&sdev->ofdev.dev, sg, nents,
141 (enum dma_data_direction) direction);
142}
143
144static inline void sbus_unmap_sg(struct sbus_dev *sdev, struct scatterlist *sg,
145 int nents, int direction)
146{
147 dma_unmap_sg(&sdev->ofdev.dev, sg, nents,
148 (enum dma_data_direction) direction);
149}
119 150
120/* Finally, allow explicit synchronization of streamable mappings. */ 151/* Finally, allow explicit synchronization of streamable mappings. */
121extern void sbus_dma_sync_single_for_cpu(struct sbus_dev *, dma_addr_t, size_t, int); 152static inline void sbus_dma_sync_single_for_cpu(struct sbus_dev *sdev,
153 dma_addr_t dma_handle,
154 size_t size, int direction)
155{
156 dma_sync_single_for_cpu(&sdev->ofdev.dev, dma_handle, size,
157 (enum dma_data_direction) direction);
158}
122#define sbus_dma_sync_single sbus_dma_sync_single_for_cpu 159#define sbus_dma_sync_single sbus_dma_sync_single_for_cpu
123extern void sbus_dma_sync_single_for_device(struct sbus_dev *, dma_addr_t, size_t, int); 160
124extern void sbus_dma_sync_sg_for_cpu(struct sbus_dev *, struct scatterlist *, int, int); 161static inline void sbus_dma_sync_single_for_device(struct sbus_dev *sdev,
162 dma_addr_t dma_handle,
163 size_t size, int direction)
164{
165 /* No flushing needed to sync cpu writes to the device. */
166}
167
168static inline void sbus_dma_sync_sg_for_cpu(struct sbus_dev *sdev,
169 struct scatterlist *sg,
170 int nents, int direction)
171{
172 dma_sync_sg_for_cpu(&sdev->ofdev.dev, sg, nents,
173 (enum dma_data_direction) direction);
174}
125#define sbus_dma_sync_sg sbus_dma_sync_sg_for_cpu 175#define sbus_dma_sync_sg sbus_dma_sync_sg_for_cpu
126extern void sbus_dma_sync_sg_for_device(struct sbus_dev *, struct scatterlist *, int, int); 176
177static inline void sbus_dma_sync_sg_for_device(struct sbus_dev *sdev,
178 struct scatterlist *sg,
179 int nents, int direction)
180{
181 /* No flushing needed to sync cpu writes to the device. */
182}
127 183
128extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *); 184extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *);
129extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *); 185extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *);
diff --git a/include/asm-sparc64/sfp-machine.h b/include/asm-sparc64/sfp-machine.h
index 89d42431efb5..c9331b02d9c8 100644
--- a/include/asm-sparc64/sfp-machine.h
+++ b/include/asm-sparc64/sfp-machine.h
@@ -88,4 +88,6 @@
88 88
89#define FP_INHIBIT_RESULTS ((current_thread_info()->xfsr[0] >> 23) & _fex) 89#define FP_INHIBIT_RESULTS ((current_thread_info()->xfsr[0] >> 23) & _fex)
90 90
91#define FP_TRAPPING_EXCEPTIONS ((current_thread_info()->xfsr[0] >> 23) & 0x1f)
92
91#endif 93#endif
diff --git a/include/asm-sparc64/spitfire.h b/include/asm-sparc64/spitfire.h
index 23ad8a7987ad..cf7807813e85 100644
--- a/include/asm-sparc64/spitfire.h
+++ b/include/asm-sparc64/spitfire.h
@@ -38,6 +38,11 @@
38 38
39#define L1DCACHE_SIZE 0x4000 39#define L1DCACHE_SIZE 0x4000
40 40
41#define SUN4V_CHIP_INVALID 0x00
42#define SUN4V_CHIP_NIAGARA1 0x01
43#define SUN4V_CHIP_NIAGARA2 0x02
44#define SUN4V_CHIP_UNKNOWN 0xff
45
41#ifndef __ASSEMBLY__ 46#ifndef __ASSEMBLY__
42 47
43enum ultra_tlb_layout { 48enum ultra_tlb_layout {
@@ -49,6 +54,8 @@ enum ultra_tlb_layout {
49 54
50extern enum ultra_tlb_layout tlb_type; 55extern enum ultra_tlb_layout tlb_type;
51 56
57extern int sun4v_chip_type;
58
52extern int cheetah_pcache_forced_on; 59extern int cheetah_pcache_forced_on;
53extern void cheetah_enable_pcache(void); 60extern void cheetah_enable_pcache(void);
54 61
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 8ba380ec6daa..3f175fa7e6d2 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -115,14 +115,8 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
115#ifndef __ASSEMBLY__ 115#ifndef __ASSEMBLY__
116 116
117extern void sun_do_break(void); 117extern void sun_do_break(void);
118extern int serial_console;
119extern int stop_a_enabled; 118extern int stop_a_enabled;
120 119
121static __inline__ int con_is_present(void)
122{
123 return serial_console ? 0 : 1;
124}
125
126extern void synchronize_user_stack(void); 120extern void synchronize_user_stack(void);
127 121
128extern void __flushw_user(void); 122extern void __flushw_user(void);
@@ -147,7 +141,6 @@ do { \
147 * not preserve it's value. Hairy, but it lets us remove 2 loads 141 * not preserve it's value. Hairy, but it lets us remove 2 loads
148 * and 2 stores in this critical code path. -DaveM 142 * and 2 stores in this critical code path. -DaveM
149 */ 143 */
150#define EXTRA_CLOBBER ,"%l1"
151#define switch_to(prev, next, last) \ 144#define switch_to(prev, next, last) \
152do { if (test_thread_flag(TIF_PERFCTR)) { \ 145do { if (test_thread_flag(TIF_PERFCTR)) { \
153 unsigned long __tmp; \ 146 unsigned long __tmp; \
@@ -170,33 +163,34 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \
170 "stx %%i6, [%%sp + 2047 + 0x70]\n\t" \ 163 "stx %%i6, [%%sp + 2047 + 0x70]\n\t" \
171 "stx %%i7, [%%sp + 2047 + 0x78]\n\t" \ 164 "stx %%i7, [%%sp + 2047 + 0x78]\n\t" \
172 "rdpr %%wstate, %%o5\n\t" \ 165 "rdpr %%wstate, %%o5\n\t" \
173 "stx %%o6, [%%g6 + %3]\n\t" \ 166 "stx %%o6, [%%g6 + %6]\n\t" \
174 "stb %%o5, [%%g6 + %2]\n\t" \
175 "rdpr %%cwp, %%o5\n\t" \
176 "stb %%o5, [%%g6 + %5]\n\t" \ 167 "stb %%o5, [%%g6 + %5]\n\t" \
177 "mov %1, %%g6\n\t" \ 168 "rdpr %%cwp, %%o5\n\t" \
178 "ldub [%1 + %5], %%g1\n\t" \ 169 "stb %%o5, [%%g6 + %8]\n\t" \
170 "mov %4, %%g6\n\t" \
171 "ldub [%4 + %8], %%g1\n\t" \
179 "wrpr %%g1, %%cwp\n\t" \ 172 "wrpr %%g1, %%cwp\n\t" \
180 "ldx [%%g6 + %3], %%o6\n\t" \ 173 "ldx [%%g6 + %6], %%o6\n\t" \
181 "ldub [%%g6 + %2], %%o5\n\t" \ 174 "ldub [%%g6 + %5], %%o5\n\t" \
182 "ldub [%%g6 + %4], %%o7\n\t" \ 175 "ldub [%%g6 + %7], %%o7\n\t" \
183 "wrpr %%o5, 0x0, %%wstate\n\t" \ 176 "wrpr %%o5, 0x0, %%wstate\n\t" \
184 "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \ 177 "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \
185 "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \ 178 "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \
186 "ldx [%%g6 + %6], %%g4\n\t" \ 179 "ldx [%%g6 + %9], %%g4\n\t" \
187 "brz,pt %%o7, 1f\n\t" \ 180 "brz,pt %%o7, 1f\n\t" \
188 " mov %%g7, %0\n\t" \ 181 " mov %%g7, %0\n\t" \
189 "b,a ret_from_syscall\n\t" \ 182 "b,a ret_from_syscall\n\t" \
190 "1:\n\t" \ 183 "1:\n\t" \
191 : "=&r" (last) \ 184 : "=&r" (last), "=r" (current), "=r" (current_thread_info_reg), \
185 "=r" (__local_per_cpu_offset) \
192 : "0" (task_thread_info(next)), \ 186 : "0" (task_thread_info(next)), \
193 "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \ 187 "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \
194 "i" (TI_CWP), "i" (TI_TASK) \ 188 "i" (TI_CWP), "i" (TI_TASK) \
195 : "cc", \ 189 : "cc", \
196 "g1", "g2", "g3", "g7", \ 190 "g1", "g2", "g3", "g7", \
197 "l2", "l3", "l4", "l5", "l6", "l7", \ 191 "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
198 "i0", "i1", "i2", "i3", "i4", "i5", \ 192 "i0", "i1", "i2", "i3", "i4", "i5", \
199 "o0", "o1", "o2", "o3", "o4", "o5", "o7" EXTRA_CLOBBER);\ 193 "o0", "o1", "o2", "o3", "o4", "o5", "o7"); \
200 /* If you fuck with this, update ret_from_syscall code too. */ \ 194 /* If you fuck with this, update ret_from_syscall code too. */ \
201 if (test_thread_flag(TIF_PERFCTR)) { \ 195 if (test_thread_flag(TIF_PERFCTR)) { \
202 write_pcr(current_thread_info()->pcr_reg); \ 196 write_pcr(current_thread_info()->pcr_reg); \
@@ -204,16 +198,6 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \
204 } \ 198 } \
205} while(0) 199} while(0)
206 200
207/*
208 * On SMP systems, when the scheduler does migration-cost autodetection,
209 * it needs a way to flush as much of the CPU's caches as possible.
210 *
211 * TODO: fill this in!
212 */
213static inline void sched_cacheflush(void)
214{
215}
216
217static inline unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val) 201static inline unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val)
218{ 202{
219 unsigned long tmp1, tmp2; 203 unsigned long tmp1, tmp2;
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 53e96ed9c024..cb751b4d0f56 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -1,4 +1,3 @@
1/* $Id: unistd.h,v 1.50 2002/02/08 03:57:18 davem Exp $ */
2#ifndef _SPARC64_UNISTD_H 1#ifndef _SPARC64_UNISTD_H
3#define _SPARC64_UNISTD_H 2#define _SPARC64_UNISTD_H
4 3
@@ -9,7 +8,7 @@
9 * think of right now to force the arguments into fixed registers 8 * think of right now to force the arguments into fixed registers
10 * before the trap into the system call with gcc 'asm' statements. 9 * before the trap into the system call with gcc 'asm' statements.
11 * 10 *
12 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 11 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
13 * 12 *
14 * SunOS compatibility based upon preliminary work which is: 13 * SunOS compatibility based upon preliminary work which is:
15 * 14 *
@@ -332,8 +331,9 @@
332#define __NR_signalfd 311 331#define __NR_signalfd 311
333#define __NR_timerfd 312 332#define __NR_timerfd 312
334#define __NR_eventfd 313 333#define __NR_eventfd 313
334#define __NR_fallocate 314
335 335
336#define NR_SYSCALLS 314 336#define NR_SYSCALLS 315
337 337
338#ifdef __KERNEL__ 338#ifdef __KERNEL__
339/* sysconf options, for SunOS compatibility */ 339/* sysconf options, for SunOS compatibility */
diff --git a/include/asm-sparc64/vio.h b/include/asm-sparc64/vio.h
index 83c96422e9d6..f7417e91b170 100644
--- a/include/asm-sparc64/vio.h
+++ b/include/asm-sparc64/vio.h
@@ -264,7 +264,7 @@ static inline u32 vio_dring_avail(struct vio_dring_state *dr,
264 ((dr->prod - dr->cons) & (ring_size - 1))); 264 ((dr->prod - dr->cons) & (ring_size - 1)));
265} 265}
266 266
267#define VIO_MAX_TYPE_LEN 64 267#define VIO_MAX_TYPE_LEN 32
268#define VIO_MAX_COMPAT_LEN 64 268#define VIO_MAX_COMPAT_LEN 64
269 269
270struct vio_dev { 270struct vio_dev {
@@ -275,6 +275,8 @@ struct vio_dev {
275 char compat[VIO_MAX_COMPAT_LEN]; 275 char compat[VIO_MAX_COMPAT_LEN];
276 int compat_len; 276 int compat_len;
277 277
278 u64 dev_no;
279
278 unsigned long channel_id; 280 unsigned long channel_id;
279 281
280 unsigned int tx_irq; 282 unsigned int tx_irq;
diff --git a/include/asm-sparc64/xor.h b/include/asm-sparc64/xor.h
index 8ce3f1813e28..a0233884fc94 100644
--- a/include/asm-sparc64/xor.h
+++ b/include/asm-sparc64/xor.h
@@ -63,4 +63,8 @@ static struct xor_block_template xor_block_niagara = {
63 63
64/* For VIS for everything except Niagara. */ 64/* For VIS for everything except Niagara. */
65#define XOR_SELECT_TEMPLATE(FASTEST) \ 65#define XOR_SELECT_TEMPLATE(FASTEST) \
66 (tlb_type == hypervisor ? &xor_block_niagara : &xor_block_VIS) 66 ((tlb_type == hypervisor && \
67 (sun4v_chip_type == SUN4V_CHIP_NIAGARA1 || \
68 sun4v_chip_type == SUN4V_CHIP_NIAGARA2)) ? \
69 &xor_block_niagara : \
70 &xor_block_VIS)
diff --git a/include/asm-um/a.out.h b/include/asm-um/a.out.h
index 7016b893ac9d..78bc9eed26b2 100644
--- a/include/asm-um/a.out.h
+++ b/include/asm-um/a.out.h
@@ -17,4 +17,6 @@ extern int honeypot;
17#define STACK_TOP \ 17#define STACK_TOP \
18 CHOOSE_MODE((honeypot ? host_task_size : task_size), task_size) 18 CHOOSE_MODE((honeypot ? host_task_size : task_size), task_size)
19 19
20#define STACK_TOP_MAX STACK_TOP
21
20#endif 22#endif
diff --git a/include/asm-um/common.lds.S b/include/asm-um/common.lds.S
index e3f010bd12b3..cb0248616d49 100644
--- a/include/asm-um/common.lds.S
+++ b/include/asm-um/common.lds.S
@@ -16,82 +16,112 @@
16 16
17 . = ALIGN(4096); 17 . = ALIGN(4096);
18 .note : { *(.note.*) } 18 .note : { *(.note.*) }
19 __start___ex_table = .; 19 __ex_table : {
20 __ex_table : { *(__ex_table) } 20 __start___ex_table = .;
21 __stop___ex_table = .; 21 *(__ex_table)
22 __stop___ex_table = .;
23 }
22 24
23 BUG_TABLE 25 BUG_TABLE
24 26
25 __uml_setup_start = .; 27 .uml.setup.init : {
26 .uml.setup.init : { *(.uml.setup.init) } 28 __uml_setup_start = .;
27 __uml_setup_end = .; 29 *(.uml.setup.init)
30 __uml_setup_end = .;
31 }
28 32
29 __uml_help_start = .; 33 .uml.help.init : {
30 .uml.help.init : { *(.uml.help.init) } 34 __uml_help_start = .;
31 __uml_help_end = .; 35 *(.uml.help.init)
36 __uml_help_end = .;
37 }
32 38
33 __uml_postsetup_start = .; 39 .uml.postsetup.init : {
34 .uml.postsetup.init : { *(.uml.postsetup.init) } 40 __uml_postsetup_start = .;
35 __uml_postsetup_end = .; 41 *(.uml.postsetup.init)
42 __uml_postsetup_end = .;
43 }
36 44
37 __setup_start = .; 45 .init.setup : {
38 .init.setup : { *(.init.setup) } 46 __setup_start = .;
39 __setup_end = .; 47 *(.init.setup)
48 __setup_end = .;
49 }
40 50
41 . = ALIGN(32); 51 . = ALIGN(32);
42 __per_cpu_start = . ; 52 .data.percpu : {
43 .data.percpu : { *(.data.percpu) } 53 __per_cpu_start = . ;
44 __per_cpu_end = . ; 54 *(.data.percpu)
55 __per_cpu_end = . ;
56 }
45 57
46 __initcall_start = .;
47 .initcall.init : { 58 .initcall.init : {
59 __initcall_start = .;
48 INITCALLS 60 INITCALLS
61 __initcall_end = .;
49 } 62 }
50 __initcall_end = .;
51 63
52 __con_initcall_start = .; 64 .con_initcall.init : {
53 .con_initcall.init : { *(.con_initcall.init) } 65 __con_initcall_start = .;
54 __con_initcall_end = .; 66 *(.con_initcall.init)
67 __con_initcall_end = .;
68 }
55 69
56 __uml_initcall_start = .; 70 .uml.initcall.init : {
57 .uml.initcall.init : { *(.uml.initcall.init) } 71 __uml_initcall_start = .;
58 __uml_initcall_end = .; 72 *(.uml.initcall.init)
73 __uml_initcall_end = .;
74 }
59 __init_end = .; 75 __init_end = .;
60 76
61 SECURITY_INIT 77 SECURITY_INIT
62 78
63 __exitcall_begin = .; 79 .exitcall : {
64 .exitcall : { *(.exitcall.exit) } 80 __exitcall_begin = .;
65 __exitcall_end = .; 81 *(.exitcall.exit)
82 __exitcall_end = .;
83 }
66 84
67 __uml_exitcall_begin = .; 85 .uml.exitcall : {
68 .uml.exitcall : { *(.uml.exitcall.exit) } 86 __uml_exitcall_begin = .;
69 __uml_exitcall_end = .; 87 *(.uml.exitcall.exit)
88 __uml_exitcall_end = .;
89 }
70 90
71 . = ALIGN(4); 91 . = ALIGN(4);
72 __alt_instructions = .; 92 .altinstructions : {
73 .altinstructions : { *(.altinstructions) } 93 __alt_instructions = .;
74 __alt_instructions_end = .; 94 *(.altinstructions)
95 __alt_instructions_end = .;
96 }
75 .altinstr_replacement : { *(.altinstr_replacement) } 97 .altinstr_replacement : { *(.altinstr_replacement) }
76 /* .exit.text is discard at runtime, not link time, to deal with references 98 /* .exit.text is discard at runtime, not link time, to deal with references
77 from .altinstructions and .eh_frame */ 99 from .altinstructions and .eh_frame */
78 .exit.text : { *(.exit.text) } 100 .exit.text : { *(.exit.text) }
79 .exit.data : { *(.exit.data) } 101 .exit.data : { *(.exit.data) }
80 102
81 __preinit_array_start = .; 103 .preinit_array : {
82 .preinit_array : { *(.preinit_array) } 104 __preinit_array_start = .;
83 __preinit_array_end = .; 105 *(.preinit_array)
84 __init_array_start = .; 106 __preinit_array_end = .;
85 .init_array : { *(.init_array) } 107 }
86 __init_array_end = .; 108 .init_array : {
87 __fini_array_start = .; 109 __init_array_start = .;
88 .fini_array : { *(.fini_array) } 110 *(.init_array)
89 __fini_array_end = .; 111 __init_array_end = .;
112 }
113 .fini_array : {
114 __fini_array_start = .;
115 *(.fini_array)
116 __fini_array_end = .;
117 }
90 118
91 . = ALIGN(4096); 119 . = ALIGN(4096);
92 __initramfs_start = .; 120 .init.ramfs : {
93 .init.ramfs : { *(.init.ramfs) } 121 __initramfs_start = .;
94 __initramfs_end = .; 122 *(.init.ramfs)
123 __initramfs_end = .;
124 }
95 125
96 /* Sections to be discarded */ 126 /* Sections to be discarded */
97 /DISCARD/ : { 127 /DISCARD/ : {
diff --git a/include/asm-um/elf-x86_64.h b/include/asm-um/elf-x86_64.h
index 8a8246d03936..857471c49dac 100644
--- a/include/asm-um/elf-x86_64.h
+++ b/include/asm-um/elf-x86_64.h
@@ -6,7 +6,9 @@
6#ifndef __UM_ELF_X86_64_H 6#ifndef __UM_ELF_X86_64_H
7#define __UM_ELF_X86_64_H 7#define __UM_ELF_X86_64_H
8 8
9#include <linux/sched.h>
9#include <asm/user.h> 10#include <asm/user.h>
11#include "skas.h"
10 12
11/* x86-64 relocation types, taken from asm-x86_64/elf.h */ 13/* x86-64 relocation types, taken from asm-x86_64/elf.h */
12#define R_X86_64_NONE 0 /* No reloc */ 14#define R_X86_64_NONE 0 /* No reloc */
@@ -64,6 +66,44 @@ typedef struct { } elf_fpregset_t;
64 PT_REGS_R15(regs) = 0; \ 66 PT_REGS_R15(regs) = 0; \
65} while (0) 67} while (0)
66 68
69#define ELF_CORE_COPY_REGS(pr_reg, regs) \
70 (pr_reg)[0] = (regs)->regs.skas.regs[0]; \
71 (pr_reg)[1] = (regs)->regs.skas.regs[1]; \
72 (pr_reg)[2] = (regs)->regs.skas.regs[2]; \
73 (pr_reg)[3] = (regs)->regs.skas.regs[3]; \
74 (pr_reg)[4] = (regs)->regs.skas.regs[4]; \
75 (pr_reg)[5] = (regs)->regs.skas.regs[5]; \
76 (pr_reg)[6] = (regs)->regs.skas.regs[6]; \
77 (pr_reg)[7] = (regs)->regs.skas.regs[7]; \
78 (pr_reg)[8] = (regs)->regs.skas.regs[8]; \
79 (pr_reg)[9] = (regs)->regs.skas.regs[9]; \
80 (pr_reg)[10] = (regs)->regs.skas.regs[10]; \
81 (pr_reg)[11] = (regs)->regs.skas.regs[11]; \
82 (pr_reg)[12] = (regs)->regs.skas.regs[12]; \
83 (pr_reg)[13] = (regs)->regs.skas.regs[13]; \
84 (pr_reg)[14] = (regs)->regs.skas.regs[14]; \
85 (pr_reg)[15] = (regs)->regs.skas.regs[15]; \
86 (pr_reg)[16] = (regs)->regs.skas.regs[16]; \
87 (pr_reg)[17] = (regs)->regs.skas.regs[17]; \
88 (pr_reg)[18] = (regs)->regs.skas.regs[18]; \
89 (pr_reg)[19] = (regs)->regs.skas.regs[19]; \
90 (pr_reg)[20] = (regs)->regs.skas.regs[20]; \
91 (pr_reg)[21] = current->thread.arch.fs; \
92 (pr_reg)[22] = 0; \
93 (pr_reg)[23] = 0; \
94 (pr_reg)[24] = 0; \
95 (pr_reg)[25] = 0; \
96 (pr_reg)[26] = 0;
97
98static inline int elf_core_copy_fpregs(struct task_struct *t,
99 elf_fpregset_t *fpu)
100{
101 int cpu = current_thread->cpu;
102 return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu);
103}
104
105#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu)
106
67#ifdef TIF_IA32 /* XXX */ 107#ifdef TIF_IA32 /* XXX */
68#error XXX, indeed 108#error XXX, indeed
69 clear_thread_flag(TIF_IA32); 109 clear_thread_flag(TIF_IA32);
diff --git a/include/asm-v850/irq.h b/include/asm-v850/irq.h
index 88687c181f01..7d0d4cd1ce54 100644
--- a/include/asm-v850/irq.h
+++ b/include/asm-v850/irq.h
@@ -50,16 +50,6 @@ init_irq_handlers (int base_irq, int num, int interval,
50 interrupt. */ 50 interrupt. */
51extern unsigned int handle_irq (int irq, struct pt_regs *regs); 51extern unsigned int handle_irq (int irq, struct pt_regs *regs);
52 52
53
54/* Enable interrupt handling on an irq. */
55extern void enable_irq(unsigned int irq);
56
57/* Disable an irq and wait for completion. */
58extern void disable_irq (unsigned int irq);
59
60/* Disable an irq without waiting. */
61extern void disable_irq_nosync (unsigned int irq);
62
63#endif /* !__ASSEMBLY__ */ 53#endif /* !__ASSEMBLY__ */
64 54
65#endif /* __V850_IRQ_H__ */ 55#endif /* __V850_IRQ_H__ */
diff --git a/include/asm-v850/thread_info.h b/include/asm-v850/thread_info.h
index 82b8f2846207..1a9e6ae0c5fd 100644
--- a/include/asm-v850/thread_info.h
+++ b/include/asm-v850/thread_info.h
@@ -77,16 +77,14 @@ struct thread_info {
77 * thread information flag bit numbers 77 * thread information flag bit numbers
78 */ 78 */
79#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 79#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
80#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 80#define TIF_SIGPENDING 1 /* signal pending */
81#define TIF_SIGPENDING 2 /* signal pending */ 81#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
82#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 82#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
83#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
84 TIF_NEED_RESCHED */ 83 TIF_NEED_RESCHED */
85#define TIF_MEMDIE 5 84#define TIF_MEMDIE 4
86 85
87/* as above, but as bit values */ 86/* as above, but as bit values */
88#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 87#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
89#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
90#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 88#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
91#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 89#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
92#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 90#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
diff --git a/include/asm-x86_64/a.out.h b/include/asm-x86_64/a.out.h
index 7255cde06538..e789300e41a5 100644
--- a/include/asm-x86_64/a.out.h
+++ b/include/asm-x86_64/a.out.h
@@ -21,7 +21,8 @@ struct exec
21 21
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23#include <linux/thread_info.h> 23#include <linux/thread_info.h>
24#define STACK_TOP TASK_SIZE 24#define STACK_TOP TASK_SIZE
25#define STACK_TOP_MAX TASK_SIZE64
25#endif 26#endif
26 27
27#endif /* __A_OUT_GNU_H__ */ 28#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index a29f05087a31..98173357dd89 100644
--- a/include/asm-x86_64/acpi.h
+++ b/include/asm-x86_64/acpi.h
@@ -29,6 +29,7 @@
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30 30
31#include <acpi/pdc_intel.h> 31#include <acpi/pdc_intel.h>
32#include <asm/numa.h>
32 33
33#define COMPILER_DEPENDENT_INT64 long long 34#define COMPILER_DEPENDENT_INT64 long long
34#define COMPILER_DEPENDENT_UINT64 unsigned long long 35#define COMPILER_DEPENDENT_UINT64 unsigned long long
@@ -107,6 +108,15 @@ static inline void acpi_disable_pci(void)
107} 108}
108extern int acpi_irq_balance_set(char *str); 109extern int acpi_irq_balance_set(char *str);
109 110
111/* routines for saving/restoring kernel state */
112extern int acpi_save_state_mem(void);
113extern void acpi_restore_state_mem(void);
114
115extern unsigned long acpi_wakeup_address;
116
117/* early initialization routine */
118extern void acpi_reserve_bootmem(void);
119
110#else /* !CONFIG_ACPI */ 120#else /* !CONFIG_ACPI */
111 121
112#define acpi_lapic 0 122#define acpi_lapic 0
@@ -120,19 +130,6 @@ extern int acpi_numa;
120extern int acpi_scan_nodes(unsigned long start, unsigned long end); 130extern int acpi_scan_nodes(unsigned long start, unsigned long end);
121#define NR_NODE_MEMBLKS (MAX_NUMNODES*2) 131#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
122 132
123#ifdef CONFIG_ACPI_SLEEP
124
125/* routines for saving/restoring kernel state */
126extern int acpi_save_state_mem(void);
127extern void acpi_restore_state_mem(void);
128
129extern unsigned long acpi_wakeup_address;
130
131/* early initialization routine */
132extern void acpi_reserve_bootmem(void);
133
134#endif /*CONFIG_ACPI_SLEEP*/
135
136extern int acpi_disabled; 133extern int acpi_disabled;
137extern int acpi_pci_disabled; 134extern int acpi_pci_disabled;
138 135
@@ -141,6 +138,16 @@ extern int acpi_pci_disabled;
141extern int acpi_skip_timer_override; 138extern int acpi_skip_timer_override;
142extern int acpi_use_timer_override; 139extern int acpi_use_timer_override;
143 140
141#ifdef CONFIG_ACPI_NUMA
142extern void __init acpi_fake_nodes(const struct bootnode *fake_nodes,
143 int num_nodes);
144#else
145static inline void acpi_fake_nodes(const struct bootnode *fake_nodes,
146 int num_nodes)
147{
148}
149#endif
150
144#endif /*__KERNEL__*/ 151#endif /*__KERNEL__*/
145 152
146#endif /*_ASM_ACPI_H*/ 153#endif /*_ASM_ACPI_H*/
diff --git a/include/asm-x86_64/alternative.h b/include/asm-x86_64/alternative.h
index eea7aecfac78..ab161e810151 100644
--- a/include/asm-x86_64/alternative.h
+++ b/include/asm-x86_64/alternative.h
@@ -154,4 +154,6 @@ apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end)
154#define __parainstructions_end NULL 154#define __parainstructions_end NULL
155#endif 155#endif
156 156
157extern void text_poke(void *addr, unsigned char *opcode, int len);
158
157#endif /* _X86_64_ALTERNATIVE_H */ 159#endif /* _X86_64_ALTERNATIVE_H */
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h
index 45e9fca1febc..85125ef3c414 100644
--- a/include/asm-x86_64/apic.h
+++ b/include/asm-x86_64/apic.h
@@ -83,8 +83,10 @@ extern void disable_APIC_timer(void);
83extern void enable_APIC_timer(void); 83extern void enable_APIC_timer(void);
84extern void setup_apic_routing(void); 84extern void setup_apic_routing(void);
85 85
86extern void setup_APIC_extened_lvt(unsigned char lvt_off, unsigned char vector, 86extern void setup_APIC_extended_lvt(unsigned char lvt_off, unsigned char vector,
87 unsigned char msg_type, unsigned char mask); 87 unsigned char msg_type, unsigned char mask);
88
89extern int apic_is_clustered_box(void);
88 90
89#define K8_APIC_EXT_LVT_BASE 0x500 91#define K8_APIC_EXT_LVT_BASE 0x500
90#define K8_APIC_EXT_INT_MSG_FIX 0x0 92#define K8_APIC_EXT_INT_MSG_FIX 0x0
diff --git a/include/asm-x86_64/auxvec.h b/include/asm-x86_64/auxvec.h
index 2403c4cfced2..1d5ab0d03950 100644
--- a/include/asm-x86_64/auxvec.h
+++ b/include/asm-x86_64/auxvec.h
@@ -1,4 +1,6 @@
1#ifndef __ASM_X86_64_AUXVEC_H 1#ifndef __ASM_X86_64_AUXVEC_H
2#define __ASM_X86_64_AUXVEC_H 2#define __ASM_X86_64_AUXVEC_H
3 3
4#define AT_SYSINFO_EHDR 33
5
4#endif 6#endif
diff --git a/include/asm-x86_64/calgary.h b/include/asm-x86_64/calgary.h
index 4d5747a0923c..67f60406e2d8 100644
--- a/include/asm-x86_64/calgary.h
+++ b/include/asm-x86_64/calgary.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Derived from include/asm-powerpc/iommu.h 2 * Derived from include/asm-powerpc/iommu.h
3 * 3 *
4 * Copyright (C) IBM Corporation, 2006 4 * Copyright IBM Corporation, 2006-2007
5 * 5 *
6 * Author: Jon Mason <jdmason@us.ibm.com> 6 * Author: Jon Mason <jdmason@us.ibm.com>
7 * Author: Muli Ben-Yehuda <muli@il.ibm.com> 7 * Author: Muli Ben-Yehuda <muli@il.ibm.com>
@@ -31,6 +31,7 @@
31#include <asm/types.h> 31#include <asm/types.h>
32 32
33struct iommu_table { 33struct iommu_table {
34 struct cal_chipset_ops *chip_ops; /* chipset specific funcs */
34 unsigned long it_base; /* mapped address of tce table */ 35 unsigned long it_base; /* mapped address of tce table */
35 unsigned long it_hint; /* Hint for next alloc */ 36 unsigned long it_hint; /* Hint for next alloc */
36 unsigned long *it_map; /* A simple allocation bitmap for now */ 37 unsigned long *it_map; /* A simple allocation bitmap for now */
@@ -42,6 +43,12 @@ struct iommu_table {
42 unsigned char it_busno; /* Bus number this table belongs to */ 43 unsigned char it_busno; /* Bus number this table belongs to */
43}; 44};
44 45
46struct cal_chipset_ops {
47 void (*handle_quirks)(struct iommu_table *tbl, struct pci_dev *dev);
48 void (*tce_cache_blast)(struct iommu_table *tbl);
49 void (*dump_error_regs)(struct iommu_table *tbl);
50};
51
45#define TCE_TABLE_SIZE_UNSPECIFIED ~0 52#define TCE_TABLE_SIZE_UNSPECIFIED ~0
46#define TCE_TABLE_SIZE_64K 0 53#define TCE_TABLE_SIZE_64K 0
47#define TCE_TABLE_SIZE_128K 1 54#define TCE_TABLE_SIZE_128K 1
diff --git a/include/asm-x86_64/cmpxchg.h b/include/asm-x86_64/cmpxchg.h
index 09a6b6b6b74d..5e182062e6ec 100644
--- a/include/asm-x86_64/cmpxchg.h
+++ b/include/asm-x86_64/cmpxchg.h
@@ -128,7 +128,7 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
128 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ 128 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
129 (unsigned long)(n),sizeof(*(ptr)))) 129 (unsigned long)(n),sizeof(*(ptr))))
130#define cmpxchg_local(ptr,o,n)\ 130#define cmpxchg_local(ptr,o,n)\
131 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ 131 ((__typeof__(*(ptr)))__cmpxchg_local((ptr),(unsigned long)(o),\
132 (unsigned long)(n),sizeof(*(ptr)))) 132 (unsigned long)(n),sizeof(*(ptr))))
133 133
134#endif 134#endif
diff --git a/include/asm-x86_64/dmi.h b/include/asm-x86_64/dmi.h
index 93b2b15d4325..d02e32e3c3f0 100644
--- a/include/asm-x86_64/dmi.h
+++ b/include/asm-x86_64/dmi.h
@@ -3,15 +3,12 @@
3 3
4#include <asm/io.h> 4#include <asm/io.h>
5 5
6extern void *dmi_ioremap(unsigned long addr, unsigned long size);
7extern void dmi_iounmap(void *addr, unsigned long size);
8
9#define DMI_MAX_DATA 2048 6#define DMI_MAX_DATA 2048
10 7
11extern int dmi_alloc_index; 8extern int dmi_alloc_index;
12extern char dmi_alloc_data[DMI_MAX_DATA]; 9extern char dmi_alloc_data[DMI_MAX_DATA];
13 10
14/* This is so early that there is no good way to allocate dynamic memory. 11/* This is so early that there is no good way to allocate dynamic memory.
15 Allocate data in an BSS array. */ 12 Allocate data in an BSS array. */
16static inline void *dmi_alloc(unsigned len) 13static inline void *dmi_alloc(unsigned len)
17{ 14{
diff --git a/include/asm-x86_64/elf.h b/include/asm-x86_64/elf.h
index 6d24ea7c4d9d..b4fbe47f6ccd 100644
--- a/include/asm-x86_64/elf.h
+++ b/include/asm-x86_64/elf.h
@@ -162,6 +162,19 @@ extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
162/* 1GB for 64bit, 8MB for 32bit */ 162/* 1GB for 64bit, 8MB for 32bit */
163#define STACK_RND_MASK (test_thread_flag(TIF_IA32) ? 0x7ff : 0x3fffff) 163#define STACK_RND_MASK (test_thread_flag(TIF_IA32) ? 0x7ff : 0x3fffff)
164 164
165
166#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
167struct linux_binprm;
168extern int arch_setup_additional_pages(struct linux_binprm *bprm,
169 int executable_stack);
170
171extern int vdso_enabled;
172
173#define ARCH_DLINFO \
174do if (vdso_enabled) { \
175 NEW_AUX_ENT(AT_SYSINFO_EHDR,(unsigned long)current->mm->context.vdso);\
176} while (0)
177
165#endif 178#endif
166 179
167#endif 180#endif
diff --git a/include/asm-x86_64/fixmap.h b/include/asm-x86_64/fixmap.h
index 2acb9b7f6418..cdfbe4a6ae6f 100644
--- a/include/asm-x86_64/fixmap.h
+++ b/include/asm-x86_64/fixmap.h
@@ -22,9 +22,9 @@
22 * compile time, but to set the physical address only 22 * compile time, but to set the physical address only
23 * in the boot process. 23 * in the boot process.
24 * 24 *
25 * these 'compile-time allocated' memory buffers are 25 * These 'compile-time allocated' memory buffers are
26 * fixed-size 4k pages. (or larger if used with an increment 26 * fixed-size 4k pages (or larger if used with an increment
27 * highger than 1) use fixmap_set(idx,phys) to associate 27 * higher than 1). Use set_fixmap(idx,phys) to associate
28 * physical memory with fixmap indices. 28 * physical memory with fixmap indices.
29 * 29 *
30 * TLB entries of such buffers will not be flushed across 30 * TLB entries of such buffers will not be flushed across
diff --git a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h
index 59a66f084611..79bb950f82c5 100644
--- a/include/asm-x86_64/hpet.h
+++ b/include/asm-x86_64/hpet.h
@@ -1,78 +1,18 @@
1#ifndef _ASM_X8664_HPET_H 1#ifndef _ASM_X8664_HPET_H
2#define _ASM_X8664_HPET_H 1 2#define _ASM_X8664_HPET_H 1
3 3
4/* 4#include <asm-i386/hpet.h>
5 * Documentation on HPET can be found at:
6 * http://www.intel.com/ial/home/sp/pcmmspec.htm
7 * ftp://download.intel.com/ial/home/sp/mmts098.pdf
8 */
9
10#define HPET_MMAP_SIZE 1024
11
12#define HPET_ID 0x000
13#define HPET_PERIOD 0x004
14#define HPET_CFG 0x010
15#define HPET_STATUS 0x020
16#define HPET_COUNTER 0x0f0
17#define HPET_Tn_OFFSET 0x20
18#define HPET_Tn_CFG(n) (0x100 + (n) * HPET_Tn_OFFSET)
19#define HPET_Tn_ROUTE(n) (0x104 + (n) * HPET_Tn_OFFSET)
20#define HPET_Tn_CMP(n) (0x108 + (n) * HPET_Tn_OFFSET)
21#define HPET_T0_CFG HPET_Tn_CFG(0)
22#define HPET_T0_CMP HPET_Tn_CMP(0)
23#define HPET_T1_CFG HPET_Tn_CFG(1)
24#define HPET_T1_CMP HPET_Tn_CMP(1)
25
26#define HPET_ID_VENDOR 0xffff0000
27#define HPET_ID_LEGSUP 0x00008000
28#define HPET_ID_64BIT 0x00002000
29#define HPET_ID_NUMBER 0x00001f00
30#define HPET_ID_REV 0x000000ff
31#define HPET_ID_NUMBER_SHIFT 8
32
33#define HPET_ID_VENDOR_SHIFT 16
34#define HPET_ID_VENDOR_8086 0x8086
35
36#define HPET_CFG_ENABLE 0x001
37#define HPET_CFG_LEGACY 0x002
38#define HPET_LEGACY_8254 2
39#define HPET_LEGACY_RTC 8
40
41#define HPET_TN_LEVEL 0x0002
42#define HPET_TN_ENABLE 0x0004
43#define HPET_TN_PERIODIC 0x0008
44#define HPET_TN_PERIODIC_CAP 0x0010
45#define HPET_TN_64BIT_CAP 0x0020
46#define HPET_TN_SETVAL 0x0040
47#define HPET_TN_32BIT 0x0100
48#define HPET_TN_ROUTE 0x3e00
49#define HPET_TN_FSB 0x4000
50#define HPET_TN_FSB_CAP 0x8000
51
52#define HPET_TN_ROUTE_SHIFT 9
53 5
54#define HPET_TICK_RATE (HZ * 100000UL) 6#define HPET_TICK_RATE (HZ * 100000UL)
55 7
56extern int is_hpet_enabled(void);
57extern int hpet_rtc_timer_init(void); 8extern int hpet_rtc_timer_init(void);
58extern int apic_is_clustered_box(void);
59extern int hpet_arch_init(void); 9extern int hpet_arch_init(void);
60extern int hpet_timer_stop_set_go(unsigned long tick); 10extern int hpet_timer_stop_set_go(unsigned long tick);
61extern int hpet_reenable(void); 11extern int hpet_reenable(void);
62extern unsigned int hpet_calibrate_tsc(void); 12extern unsigned int hpet_calibrate_tsc(void);
63 13
64extern int hpet_use_timer; 14extern int hpet_use_timer;
65extern unsigned long hpet_address;
66extern unsigned long hpet_period; 15extern unsigned long hpet_period;
67extern unsigned long hpet_tick; 16extern unsigned long hpet_tick;
68 17
69#ifdef CONFIG_HPET_EMULATE_RTC
70extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask);
71extern int hpet_set_rtc_irq_bit(unsigned long bit_mask);
72extern int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec);
73extern int hpet_set_periodic_freq(unsigned long freq);
74extern int hpet_rtc_dropped_irq(void);
75extern int hpet_rtc_timer_init(void);
76#endif /* CONFIG_HPET_EMULATE_RTC */
77
78#endif 18#endif
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
index 6153ae5df2e8..09dfc18a6dd0 100644
--- a/include/asm-x86_64/hw_irq.h
+++ b/include/asm-x86_64/hw_irq.h
@@ -95,6 +95,26 @@
95 95
96 96
97#ifndef __ASSEMBLY__ 97#ifndef __ASSEMBLY__
98
99/* Interrupt handlers registered during init_IRQ */
100void apic_timer_interrupt(void);
101void spurious_interrupt(void);
102void error_interrupt(void);
103void reschedule_interrupt(void);
104void call_function_interrupt(void);
105void irq_move_cleanup_interrupt(void);
106void invalidate_interrupt0(void);
107void invalidate_interrupt1(void);
108void invalidate_interrupt2(void);
109void invalidate_interrupt3(void);
110void invalidate_interrupt4(void);
111void invalidate_interrupt5(void);
112void invalidate_interrupt6(void);
113void invalidate_interrupt7(void);
114void thermal_interrupt(void);
115void threshold_interrupt(void);
116void i8254_timer_resume(void);
117
98typedef int vector_irq_t[NR_VECTORS]; 118typedef int vector_irq_t[NR_VECTORS];
99DECLARE_PER_CPU(vector_irq_t, vector_irq); 119DECLARE_PER_CPU(vector_irq_t, vector_irq);
100extern void __setup_vector_irq(int cpu); 120extern void __setup_vector_irq(int cpu);
diff --git a/include/asm-x86_64/hypertransport.h b/include/asm-x86_64/hypertransport.h
index c16c6ff4bdd7..5cbf9fa5e0b5 100644
--- a/include/asm-x86_64/hypertransport.h
+++ b/include/asm-x86_64/hypertransport.h
@@ -1,42 +1 @@
1#ifndef ASM_HYPERTRANSPORT_H #include <asm-i386/hypertransport.h>
2#define ASM_HYPERTRANSPORT_H
3
4/*
5 * Constants for x86 Hypertransport Interrupts.
6 */
7
8#define HT_IRQ_LOW_BASE 0xf8000000
9
10#define HT_IRQ_LOW_VECTOR_SHIFT 16
11#define HT_IRQ_LOW_VECTOR_MASK 0x00ff0000
12#define HT_IRQ_LOW_VECTOR(v) (((v) << HT_IRQ_LOW_VECTOR_SHIFT) & HT_IRQ_LOW_VECTOR_MASK)
13
14#define HT_IRQ_LOW_DEST_ID_SHIFT 8
15#define HT_IRQ_LOW_DEST_ID_MASK 0x0000ff00
16#define HT_IRQ_LOW_DEST_ID(v) (((v) << HT_IRQ_LOW_DEST_ID_SHIFT) & HT_IRQ_LOW_DEST_ID_MASK)
17
18#define HT_IRQ_LOW_DM_PHYSICAL 0x0000000
19#define HT_IRQ_LOW_DM_LOGICAL 0x0000040
20
21#define HT_IRQ_LOW_RQEOI_EDGE 0x0000000
22#define HT_IRQ_LOW_RQEOI_LEVEL 0x0000020
23
24
25#define HT_IRQ_LOW_MT_FIXED 0x0000000
26#define HT_IRQ_LOW_MT_ARBITRATED 0x0000004
27#define HT_IRQ_LOW_MT_SMI 0x0000008
28#define HT_IRQ_LOW_MT_NMI 0x000000c
29#define HT_IRQ_LOW_MT_INIT 0x0000010
30#define HT_IRQ_LOW_MT_STARTUP 0x0000014
31#define HT_IRQ_LOW_MT_EXTINT 0x0000018
32#define HT_IRQ_LOW_MT_LINT1 0x000008c
33#define HT_IRQ_LOW_MT_LINT0 0x0000098
34
35#define HT_IRQ_LOW_IRQ_MASKED 0x0000001
36
37
38#define HT_IRQ_HIGH_DEST_ID_SHIFT 0
39#define HT_IRQ_HIGH_DEST_ID_MASK 0x00ffffff
40#define HT_IRQ_HIGH_DEST_ID(v) ((((v) >> 8) << HT_IRQ_HIGH_DEST_ID_SHIFT) & HT_IRQ_HIGH_DEST_ID_MASK)
41
42#endif /* ASM_HYPERTRANSPORT_H */
diff --git a/include/asm-x86_64/i8253.h b/include/asm-x86_64/i8253.h
new file mode 100644
index 000000000000..015d8df07690
--- /dev/null
+++ b/include/asm-x86_64/i8253.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_I8253_H__
2#define __ASM_I8253_H__
3
4extern spinlock_t i8253_lock;
5
6#endif /* __ASM_I8253_H__ */
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h
index 969d225a9350..d9f2e54324d5 100644
--- a/include/asm-x86_64/io_apic.h
+++ b/include/asm-x86_64/io_apic.h
@@ -109,6 +109,12 @@ extern int mpc_default_type;
109/* 1 if "noapic" boot option passed */ 109/* 1 if "noapic" boot option passed */
110extern int skip_ioapic_setup; 110extern int skip_ioapic_setup;
111 111
112static inline void disable_ioapic_setup(void)
113{
114 skip_ioapic_setup = 1;
115}
116
117
112/* 118/*
113 * If we use the IO-APIC for IRQ routing, disable automatic 119 * If we use the IO-APIC for IRQ routing, disable automatic
114 * assignment of PCI IRQ's. 120 * assignment of PCI IRQ's.
diff --git a/include/asm-x86_64/iommu.h b/include/asm-x86_64/iommu.h
new file mode 100644
index 000000000000..5af471f228ee
--- /dev/null
+++ b/include/asm-x86_64/iommu.h
@@ -0,0 +1,29 @@
1#ifndef _ASM_X8664_IOMMU_H
2#define _ASM_X8664_IOMMU_H 1
3
4extern void pci_iommu_shutdown(void);
5extern void no_iommu_init(void);
6extern int force_iommu, no_iommu;
7extern int iommu_detected;
8#ifdef CONFIG_IOMMU
9extern void gart_iommu_init(void);
10extern void gart_iommu_shutdown(void);
11extern void __init gart_parse_options(char *);
12extern void iommu_hole_init(void);
13extern int fallback_aper_order;
14extern int fallback_aper_force;
15extern int iommu_aperture;
16extern int iommu_aperture_allowed;
17extern int iommu_aperture_disabled;
18extern int fix_aperture;
19#else
20#define iommu_aperture 0
21#define iommu_aperture_allowed 0
22
23static inline void gart_iommu_shutdown(void)
24{
25}
26
27#endif
28
29#endif
diff --git a/include/asm-x86_64/ist.h b/include/asm-x86_64/ist.h
new file mode 100644
index 000000000000..338857ecbc68
--- /dev/null
+++ b/include/asm-x86_64/ist.h
@@ -0,0 +1 @@
#include <asm-i386/ist.h>
diff --git a/include/asm-x86_64/kprobes.h b/include/asm-x86_64/kprobes.h
index cf5317898fb0..7db825403e01 100644
--- a/include/asm-x86_64/kprobes.h
+++ b/include/asm-x86_64/kprobes.h
@@ -41,7 +41,6 @@ typedef u8 kprobe_opcode_t;
41 ? (MAX_STACK_SIZE) \ 41 ? (MAX_STACK_SIZE) \
42 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 42 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
43 43
44#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
45#define ARCH_SUPPORTS_KRETPROBES 44#define ARCH_SUPPORTS_KRETPROBES
46#define ARCH_INACTIVE_KPROBE_COUNT 1 45#define ARCH_INACTIVE_KPROBE_COUNT 1
47 46
diff --git a/include/asm-x86_64/mce.h b/include/asm-x86_64/mce.h
index 177e92b4019b..7bc030a1996d 100644
--- a/include/asm-x86_64/mce.h
+++ b/include/asm-x86_64/mce.h
@@ -105,6 +105,11 @@ extern atomic_t mce_entry;
105 105
106extern void do_machine_check(struct pt_regs *, long); 106extern void do_machine_check(struct pt_regs *, long);
107 107
108extern int mce_notify_user(void);
109
110extern void stop_mce(void);
111extern void restart_mce(void);
112
108#endif 113#endif
109 114
110#endif 115#endif
diff --git a/include/asm-x86_64/mmu.h b/include/asm-x86_64/mmu.h
index 5dc6ed79859a..d2cd4a9d984d 100644
--- a/include/asm-x86_64/mmu.h
+++ b/include/asm-x86_64/mmu.h
@@ -15,6 +15,7 @@ typedef struct {
15 rwlock_t ldtlock; 15 rwlock_t ldtlock;
16 int size; 16 int size;
17 struct semaphore sem; 17 struct semaphore sem;
18 void *vdso;
18} mm_context_t; 19} mm_context_t;
19 20
20#endif 21#endif
diff --git a/include/asm-x86_64/msidef.h b/include/asm-x86_64/msidef.h
index 5b8acddb70fb..083ad5827e48 100644
--- a/include/asm-x86_64/msidef.h
+++ b/include/asm-x86_64/msidef.h
@@ -1,47 +1 @@
1#ifndef ASM_MSIDEF_H #include <asm-i386/msidef.h>
2#define ASM_MSIDEF_H
3
4/*
5 * Constants for Intel APIC based MSI messages.
6 */
7
8/*
9 * Shifts for MSI data
10 */
11
12#define MSI_DATA_VECTOR_SHIFT 0
13#define MSI_DATA_VECTOR_MASK 0x000000ff
14#define MSI_DATA_VECTOR(v) (((v) << MSI_DATA_VECTOR_SHIFT) & MSI_DATA_VECTOR_MASK)
15
16#define MSI_DATA_DELIVERY_MODE_SHIFT 8
17#define MSI_DATA_DELIVERY_FIXED (0 << MSI_DATA_DELIVERY_MODE_SHIFT)
18#define MSI_DATA_DELIVERY_LOWPRI (1 << MSI_DATA_DELIVERY_MODE_SHIFT)
19
20#define MSI_DATA_LEVEL_SHIFT 14
21#define MSI_DATA_LEVEL_DEASSERT (0 << MSI_DATA_LEVEL_SHIFT)
22#define MSI_DATA_LEVEL_ASSERT (1 << MSI_DATA_LEVEL_SHIFT)
23
24#define MSI_DATA_TRIGGER_SHIFT 15
25#define MSI_DATA_TRIGGER_EDGE (0 << MSI_DATA_TRIGGER_SHIFT)
26#define MSI_DATA_TRIGGER_LEVEL (1 << MSI_DATA_TRIGGER_SHIFT)
27
28/*
29 * Shift/mask fields for msi address
30 */
31
32#define MSI_ADDR_BASE_HI 0
33#define MSI_ADDR_BASE_LO 0xfee00000
34
35#define MSI_ADDR_DEST_MODE_SHIFT 2
36#define MSI_ADDR_DEST_MODE_PHYSICAL (0 << MSI_ADDR_DEST_MODE_SHIFT)
37#define MSI_ADDR_DEST_MODE_LOGICAL (1 << MSI_ADDR_DEST_MODE_SHIFT)
38
39#define MSI_ADDR_REDIRECTION_SHIFT 3
40#define MSI_ADDR_REDIRECTION_CPU (0 << MSI_ADDR_REDIRECTION_SHIFT) /* dedicated cpu */
41#define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT) /* lowest priority */
42
43#define MSI_ADDR_DEST_ID_SHIFT 12
44#define MSI_ADDR_DEST_ID_MASK 0x00ffff0
45#define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & MSI_ADDR_DEST_ID_MASK)
46
47#endif /* ASM_MSIDEF_H */
diff --git a/include/asm-x86_64/nmi.h b/include/asm-x86_64/nmi.h
index d0a7f53b1497..65b6acf3bb59 100644
--- a/include/asm-x86_64/nmi.h
+++ b/include/asm-x86_64/nmi.h
@@ -64,11 +64,12 @@ extern int setup_nmi_watchdog(char *);
64 64
65extern atomic_t nmi_active; 65extern atomic_t nmi_active;
66extern unsigned int nmi_watchdog; 66extern unsigned int nmi_watchdog;
67#define NMI_DEFAULT -1 67#define NMI_DISABLED -1
68#define NMI_NONE 0 68#define NMI_NONE 0
69#define NMI_IO_APIC 1 69#define NMI_IO_APIC 1
70#define NMI_LOCAL_APIC 2 70#define NMI_LOCAL_APIC 2
71#define NMI_INVALID 3 71#define NMI_INVALID 3
72#define NMI_DEFAULT NMI_DISABLED
72 73
73struct ctl_table; 74struct ctl_table;
74struct file; 75struct file;
@@ -88,5 +89,7 @@ unsigned lapic_adjust_nmi_hz(unsigned hz);
88int lapic_watchdog_ok(void); 89int lapic_watchdog_ok(void);
89void disable_lapic_nmi_watchdog(void); 90void disable_lapic_nmi_watchdog(void);
90void enable_lapic_nmi_watchdog(void); 91void enable_lapic_nmi_watchdog(void);
92void stop_nmi(void);
93void restart_nmi(void);
91 94
92#endif /* ASM_NMI_H */ 95#endif /* ASM_NMI_H */
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h
index bda94fd5176f..5da8cb0c0599 100644
--- a/include/asm-x86_64/pci.h
+++ b/include/asm-x86_64/pci.h
@@ -5,6 +5,27 @@
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7 7
8struct pci_sysdata {
9 int node; /* NUMA node */
10 void* iommu; /* IOMMU private data */
11};
12
13extern struct pci_bus *pci_scan_bus_with_sysdata(int busno);
14
15#ifdef CONFIG_CALGARY_IOMMU
16static inline void* pci_iommu(struct pci_bus *bus)
17{
18 struct pci_sysdata *sd = bus->sysdata;
19 return sd->iommu;
20}
21
22static inline void set_pci_iommu(struct pci_bus *bus, void *val)
23{
24 struct pci_sysdata *sd = bus->sysdata;
25 sd->iommu = val;
26}
27#endif /* CONFIG_CALGARY_IOMMU */
28
8#include <linux/mm.h> /* for struct page */ 29#include <linux/mm.h> /* for struct page */
9 30
10/* Can be used to override the logic in pci_scan_bus for skipping 31/* Can be used to override the logic in pci_scan_bus for skipping
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h
index c6fbb67eac90..5abd48270101 100644
--- a/include/asm-x86_64/percpu.h
+++ b/include/asm-x86_64/percpu.h
@@ -20,6 +20,11 @@
20#define DEFINE_PER_CPU(type, name) \ 20#define DEFINE_PER_CPU(type, name) \
21 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name 21 __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
22 22
23#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
24 __attribute__((__section__(".data.percpu.shared_aligned"))) \
25 __typeof__(type) per_cpu__##name \
26 ____cacheline_internodealigned_in_smp
27
23/* var is in discarded region: offset to particular copy we want */ 28/* var is in discarded region: offset to particular copy we want */
24#define per_cpu(var, cpu) (*({ \ 29#define per_cpu(var, cpu) (*({ \
25 extern int simple_identifier_##var(void); \ 30 extern int simple_identifier_##var(void); \
@@ -46,6 +51,8 @@ extern void setup_per_cpu_areas(void);
46 51
47#define DEFINE_PER_CPU(type, name) \ 52#define DEFINE_PER_CPU(type, name) \
48 __typeof__(type) per_cpu__##name 53 __typeof__(type) per_cpu__##name
54#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
55 DEFINE_PER_CPU(type, name)
49 56
50#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 57#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
51#define __get_cpu_var(var) per_cpu__##var 58#define __get_cpu_var(var) per_cpu__##var
diff --git a/include/asm-x86_64/pgalloc.h b/include/asm-x86_64/pgalloc.h
index 8bb564687860..b467be6d367f 100644
--- a/include/asm-x86_64/pgalloc.h
+++ b/include/asm-x86_64/pgalloc.h
@@ -4,6 +4,10 @@
4#include <asm/pda.h> 4#include <asm/pda.h>
5#include <linux/threads.h> 5#include <linux/threads.h>
6#include <linux/mm.h> 6#include <linux/mm.h>
7#include <linux/quicklist.h>
8
9#define QUICK_PGD 0 /* We preserve special mappings over free */
10#define QUICK_PT 1 /* Other page table pages that are zero on free */
7 11
8#define pmd_populate_kernel(mm, pmd, pte) \ 12#define pmd_populate_kernel(mm, pmd, pte) \
9 set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte))) 13 set_pmd(pmd, __pmd(_PAGE_TABLE | __pa(pte)))
@@ -20,23 +24,23 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p
20static inline void pmd_free(pmd_t *pmd) 24static inline void pmd_free(pmd_t *pmd)
21{ 25{
22 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); 26 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
23 free_page((unsigned long)pmd); 27 quicklist_free(QUICK_PT, NULL, pmd);
24} 28}
25 29
26static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr) 30static inline pmd_t *pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
27{ 31{
28 return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 32 return (pmd_t *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, NULL);
29} 33}
30 34
31static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) 35static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
32{ 36{
33 return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 37 return (pud_t *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, NULL);
34} 38}
35 39
36static inline void pud_free (pud_t *pud) 40static inline void pud_free (pud_t *pud)
37{ 41{
38 BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); 42 BUG_ON((unsigned long)pud & (PAGE_SIZE-1));
39 free_page((unsigned long)pud); 43 quicklist_free(QUICK_PT, NULL, pud);
40} 44}
41 45
42static inline void pgd_list_add(pgd_t *pgd) 46static inline void pgd_list_add(pgd_t *pgd)
@@ -57,41 +61,57 @@ static inline void pgd_list_del(pgd_t *pgd)
57 spin_unlock(&pgd_lock); 61 spin_unlock(&pgd_lock);
58} 62}
59 63
60static inline pgd_t *pgd_alloc(struct mm_struct *mm) 64static inline void pgd_ctor(void *x)
61{ 65{
62 unsigned boundary; 66 unsigned boundary;
63 pgd_t *pgd = (pgd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); 67 pgd_t *pgd = x;
64 if (!pgd) 68 struct page *page = virt_to_page(pgd);
65 return NULL; 69
66 pgd_list_add(pgd);
67 /* 70 /*
68 * Copy kernel pointers in from init. 71 * Copy kernel pointers in from init.
69 * Could keep a freelist or slab cache of those because the kernel
70 * part never changes.
71 */ 72 */
72 boundary = pgd_index(__PAGE_OFFSET); 73 boundary = pgd_index(__PAGE_OFFSET);
73 memset(pgd, 0, boundary * sizeof(pgd_t));
74 memcpy(pgd + boundary, 74 memcpy(pgd + boundary,
75 init_level4_pgt + boundary, 75 init_level4_pgt + boundary,
76 (PTRS_PER_PGD - boundary) * sizeof(pgd_t)); 76 (PTRS_PER_PGD - boundary) * sizeof(pgd_t));
77
78 spin_lock(&pgd_lock);
79 list_add(&page->lru, &pgd_list);
80 spin_unlock(&pgd_lock);
81}
82
83static inline void pgd_dtor(void *x)
84{
85 pgd_t *pgd = x;
86 struct page *page = virt_to_page(pgd);
87
88 spin_lock(&pgd_lock);
89 list_del(&page->lru);
90 spin_unlock(&pgd_lock);
91}
92
93static inline pgd_t *pgd_alloc(struct mm_struct *mm)
94{
95 pgd_t *pgd = (pgd_t *)quicklist_alloc(QUICK_PGD,
96 GFP_KERNEL|__GFP_REPEAT, pgd_ctor);
77 return pgd; 97 return pgd;
78} 98}
79 99
80static inline void pgd_free(pgd_t *pgd) 100static inline void pgd_free(pgd_t *pgd)
81{ 101{
82 BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); 102 BUG_ON((unsigned long)pgd & (PAGE_SIZE-1));
83 pgd_list_del(pgd); 103 quicklist_free(QUICK_PGD, pgd_dtor, pgd);
84 free_page((unsigned long)pgd);
85} 104}
86 105
87static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) 106static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
88{ 107{
89 return (pte_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 108 return (pte_t *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, NULL);
90} 109}
91 110
92static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) 111static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
93{ 112{
94 void *p = (void *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 113 void *p = (void *)quicklist_alloc(QUICK_PT, GFP_KERNEL|__GFP_REPEAT, NULL);
114
95 if (!p) 115 if (!p)
96 return NULL; 116 return NULL;
97 return virt_to_page(p); 117 return virt_to_page(p);
@@ -103,17 +123,22 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add
103static inline void pte_free_kernel(pte_t *pte) 123static inline void pte_free_kernel(pte_t *pte)
104{ 124{
105 BUG_ON((unsigned long)pte & (PAGE_SIZE-1)); 125 BUG_ON((unsigned long)pte & (PAGE_SIZE-1));
106 free_page((unsigned long)pte); 126 quicklist_free(QUICK_PT, NULL, pte);
107} 127}
108 128
109static inline void pte_free(struct page *pte) 129static inline void pte_free(struct page *pte)
110{ 130{
111 __free_page(pte); 131 quicklist_free_page(QUICK_PT, NULL, pte);
112} 132}
113 133
114#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) 134#define __pte_free_tlb(tlb,pte) quicklist_free_page(QUICK_PT, NULL,(pte))
115 135
116#define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) 136#define __pmd_free_tlb(tlb,x) quicklist_free(QUICK_PT, NULL, (x))
117#define __pud_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) 137#define __pud_free_tlb(tlb,x) quicklist_free(QUICK_PT, NULL, (x))
118 138
139static inline void check_pgt_cache(void)
140{
141 quicklist_trim(QUICK_PGD, pgd_dtor, 25, 16);
142 quicklist_trim(QUICK_PT, NULL, 25, 16);
143}
119#endif /* _X86_64_PGALLOC_H */ 144#endif /* _X86_64_PGALLOC_H */
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 3ba53099297d..c9d8764c89d1 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -403,13 +403,14 @@ extern struct list_head pgd_list;
403 403
404extern int kern_addr_valid(unsigned long addr); 404extern int kern_addr_valid(unsigned long addr);
405 405
406pte_t *lookup_address(unsigned long addr);
407
406#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 408#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
407 remap_pfn_range(vma, vaddr, pfn, size, prot) 409 remap_pfn_range(vma, vaddr, pfn, size, prot)
408 410
409#define HAVE_ARCH_UNMAPPED_AREA 411#define HAVE_ARCH_UNMAPPED_AREA
410 412
411#define pgtable_cache_init() do { } while (0) 413#define pgtable_cache_init() do { } while (0)
412#define check_pgt_cache() do { } while (0)
413 414
414#define PAGE_AGP PAGE_KERNEL_NOCACHE 415#define PAGE_AGP PAGE_KERNEL_NOCACHE
415#define HAVE_PAGE_AGP 1 416#define HAVE_PAGE_AGP 1
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index efc87a5aff7f..19525175b91c 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -83,7 +83,6 @@ struct cpuinfo_x86 {
83#define X86_VENDOR_UMC 3 83#define X86_VENDOR_UMC 3
84#define X86_VENDOR_NEXGEN 4 84#define X86_VENDOR_NEXGEN 4
85#define X86_VENDOR_CENTAUR 5 85#define X86_VENDOR_CENTAUR 5
86#define X86_VENDOR_RISE 6
87#define X86_VENDOR_TRANSMETA 7 86#define X86_VENDOR_TRANSMETA 7
88#define X86_VENDOR_NUM 8 87#define X86_VENDOR_NUM 8
89#define X86_VENDOR_UNKNOWN 0xff 88#define X86_VENDOR_UNKNOWN 0xff
@@ -390,17 +389,6 @@ static inline void prefetchw(void *x)
390 389
391#define cpu_relax() rep_nop() 390#define cpu_relax() rep_nop()
392 391
393/*
394 * NSC/Cyrix CPU indexed register access macros
395 */
396
397#define getCx86(reg) ({ outb((reg), 0x22); inb(0x23); })
398
399#define setCx86(reg, data) do { \
400 outb((reg), 0x22); \
401 outb((data), 0x23); \
402} while (0)
403
404static inline void serialize_cpu(void) 392static inline void serialize_cpu(void)
405{ 393{
406 __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx"); 394 __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx");
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h
index 85255db1e82d..31f20ad65876 100644
--- a/include/asm-x86_64/proto.h
+++ b/include/asm-x86_64/proto.h
@@ -75,8 +75,6 @@ extern void setup_node_bootmem(int nodeid, unsigned long start, unsigned long en
75extern void early_quirks(void); 75extern void early_quirks(void);
76extern void check_efer(void); 76extern void check_efer(void);
77 77
78extern int unhandled_signal(struct task_struct *tsk, int sig);
79
80extern void select_idle_routine(const struct cpuinfo_x86 *c); 78extern void select_idle_routine(const struct cpuinfo_x86 *c);
81 79
82extern unsigned long table_start, table_end; 80extern unsigned long table_start, table_end;
@@ -85,24 +83,6 @@ extern int exception_trace;
85extern unsigned cpu_khz; 83extern unsigned cpu_khz;
86extern unsigned tsc_khz; 84extern unsigned tsc_khz;
87 85
88extern void no_iommu_init(void);
89extern int force_iommu, no_iommu;
90extern int iommu_detected;
91#ifdef CONFIG_IOMMU
92extern void gart_iommu_init(void);
93extern void __init gart_parse_options(char *);
94extern void iommu_hole_init(void);
95extern int fallback_aper_order;
96extern int fallback_aper_force;
97extern int iommu_aperture;
98extern int iommu_aperture_allowed;
99extern int iommu_aperture_disabled;
100extern int fix_aperture;
101#else
102#define iommu_aperture 0
103#define iommu_aperture_allowed 0
104#endif
105
106extern int reboot_force; 86extern int reboot_force;
107extern int notsc_setup(char *); 87extern int notsc_setup(char *);
108 88
diff --git a/include/asm-x86_64/ptrace.h b/include/asm-x86_64/ptrace.h
index 5ea84dbb1e9c..7f166ccb0606 100644
--- a/include/asm-x86_64/ptrace.h
+++ b/include/asm-x86_64/ptrace.h
@@ -1,6 +1,7 @@
1#ifndef _X86_64_PTRACE_H 1#ifndef _X86_64_PTRACE_H
2#define _X86_64_PTRACE_H 2#define _X86_64_PTRACE_H
3 3
4#include <linux/compiler.h> /* For __user */
4#include <asm/ptrace-abi.h> 5#include <asm/ptrace-abi.h>
5 6
6#ifndef __ASSEMBLY__ 7#ifndef __ASSEMBLY__
diff --git a/include/asm-x86_64/resume-trace.h b/include/asm-x86_64/resume-trace.h
new file mode 100644
index 000000000000..34bf998fdf62
--- /dev/null
+++ b/include/asm-x86_64/resume-trace.h
@@ -0,0 +1,13 @@
1#define TRACE_RESUME(user) do { \
2 if (pm_trace_enabled) { \
3 void *tracedata; \
4 asm volatile("movq $1f,%0\n" \
5 ".section .tracedata,\"a\"\n" \
6 "1:\t.word %c1\n" \
7 "\t.quad %c2\n" \
8 ".previous" \
9 :"=r" (tracedata) \
10 : "i" (__LINE__), "i" (__FILE__)); \
11 generate_resume_trace(tracedata, user); \
12 } \
13} while (0)
diff --git a/include/asm-x86_64/serial.h b/include/asm-x86_64/serial.h
index 8ebd765c674a..b0496e0d72a6 100644
--- a/include/asm-x86_64/serial.h
+++ b/include/asm-x86_64/serial.h
@@ -11,3 +11,19 @@
11 * megabits/second; but this requires the faster clock. 11 * megabits/second; but this requires the faster clock.
12 */ 12 */
13#define BASE_BAUD ( 1843200 / 16 ) 13#define BASE_BAUD ( 1843200 / 16 )
14
15/* Standard COM flags (except for COM4, because of the 8514 problem) */
16#ifdef CONFIG_SERIAL_DETECT_IRQ
17#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
18#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
19#else
20#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
21#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
22#endif
23
24#define SERIAL_PORT_DFNS \
25 /* UART CLK PORT IRQ FLAGS */ \
26 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
27 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
28 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
29 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
diff --git a/include/asm-x86_64/string.h b/include/asm-x86_64/string.h
index 9505d9f4bead..e583da7918fb 100644
--- a/include/asm-x86_64/string.h
+++ b/include/asm-x86_64/string.h
@@ -29,6 +29,9 @@ return (to);
29 function. */ 29 function. */
30 30
31#define __HAVE_ARCH_MEMCPY 1 31#define __HAVE_ARCH_MEMCPY 1
32#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
33extern void *memcpy(void *to, const void *from, size_t len);
34#else
32extern void *__memcpy(void *to, const void *from, size_t len); 35extern void *__memcpy(void *to, const void *from, size_t len);
33#define memcpy(dst,src,len) \ 36#define memcpy(dst,src,len) \
34 ({ size_t __len = (len); \ 37 ({ size_t __len = (len); \
@@ -38,7 +41,7 @@ extern void *__memcpy(void *to, const void *from, size_t len);
38 else \ 41 else \
39 __ret = __builtin_memcpy((dst),(src),__len); \ 42 __ret = __builtin_memcpy((dst),(src),__len); \
40 __ret; }) 43 __ret; })
41 44#endif
42 45
43#define __HAVE_ARCH_MEMSET 46#define __HAVE_ARCH_MEMSET
44void *memset(void *s, int c, size_t n); 47void *memset(void *s, int c, size_t n);
diff --git a/include/asm-x86_64/suspend.h b/include/asm-x86_64/suspend.h
index 9c3f8de90d2d..b897e8cb55fb 100644
--- a/include/asm-x86_64/suspend.h
+++ b/include/asm-x86_64/suspend.h
@@ -44,7 +44,6 @@ extern unsigned long saved_context_eflags;
44 44
45extern void fix_processor_context(void); 45extern void fix_processor_context(void);
46 46
47#ifdef CONFIG_ACPI_SLEEP
48extern unsigned long saved_rip; 47extern unsigned long saved_rip;
49extern unsigned long saved_rsp; 48extern unsigned long saved_rsp;
50extern unsigned long saved_rbp; 49extern unsigned long saved_rbp;
@@ -54,4 +53,3 @@ extern unsigned long saved_rdi;
54 53
55/* routines for saving/restoring kernel state */ 54/* routines for saving/restoring kernel state */
56extern int acpi_save_state_mem(void); 55extern int acpi_save_state_mem(void);
57#endif
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h
index ead9f9a56234..02175aa1d16a 100644
--- a/include/asm-x86_64/system.h
+++ b/include/asm-x86_64/system.h
@@ -75,19 +75,31 @@ static inline unsigned long read_cr0(void)
75 unsigned long cr0; 75 unsigned long cr0;
76 asm volatile("movq %%cr0,%0" : "=r" (cr0)); 76 asm volatile("movq %%cr0,%0" : "=r" (cr0));
77 return cr0; 77 return cr0;
78} 78}
79 79
80static inline void write_cr0(unsigned long val) 80static inline void write_cr0(unsigned long val)
81{ 81{
82 asm volatile("movq %0,%%cr0" :: "r" (val)); 82 asm volatile("movq %0,%%cr0" :: "r" (val));
83} 83}
84
85static inline unsigned long read_cr2(void)
86{
87 unsigned long cr2;
88 asm("movq %%cr2,%0" : "=r" (cr2));
89 return cr2;
90}
91
92static inline void write_cr2(unsigned long val)
93{
94 asm volatile("movq %0,%%cr2" :: "r" (val));
95}
84 96
85static inline unsigned long read_cr3(void) 97static inline unsigned long read_cr3(void)
86{ 98{
87 unsigned long cr3; 99 unsigned long cr3;
88 asm("movq %%cr3,%0" : "=r" (cr3)); 100 asm("movq %%cr3,%0" : "=r" (cr3));
89 return cr3; 101 return cr3;
90} 102}
91 103
92static inline void write_cr3(unsigned long val) 104static inline void write_cr3(unsigned long val)
93{ 105{
@@ -99,27 +111,30 @@ static inline unsigned long read_cr4(void)
99 unsigned long cr4; 111 unsigned long cr4;
100 asm("movq %%cr4,%0" : "=r" (cr4)); 112 asm("movq %%cr4,%0" : "=r" (cr4));
101 return cr4; 113 return cr4;
102} 114}
103 115
104static inline void write_cr4(unsigned long val) 116static inline void write_cr4(unsigned long val)
105{ 117{
106 asm volatile("movq %0,%%cr4" :: "r" (val) : "memory"); 118 asm volatile("movq %0,%%cr4" :: "r" (val) : "memory");
107} 119}
108
109#define stts() write_cr0(8 | read_cr0())
110 120
111#define wbinvd() \ 121static inline unsigned long read_cr8(void)
112 __asm__ __volatile__ ("wbinvd": : :"memory"); 122{
123 unsigned long cr8;
124 asm("movq %%cr8,%0" : "=r" (cr8));
125 return cr8;
126}
113 127
114/* 128static inline void write_cr8(unsigned long val)
115 * On SMP systems, when the scheduler does migration-cost autodetection,
116 * it needs a way to flush as much of the CPU's caches as possible.
117 */
118static inline void sched_cacheflush(void)
119{ 129{
120 wbinvd(); 130 asm volatile("movq %0,%%cr8" :: "r" (val) : "memory");
121} 131}
122 132
133#define stts() write_cr0(8 | read_cr0())
134
135#define wbinvd() \
136 __asm__ __volatile__ ("wbinvd": : :"memory")
137
123#endif /* __KERNEL__ */ 138#endif /* __KERNEL__ */
124 139
125#define nop() __asm__ __volatile__ ("nop") 140#define nop() __asm__ __volatile__ ("nop")
diff --git a/include/asm-x86_64/tce.h b/include/asm-x86_64/tce.h
index dbb047febc5e..cd955d3d112f 100644
--- a/include/asm-x86_64/tce.h
+++ b/include/asm-x86_64/tce.h
@@ -41,8 +41,8 @@ struct iommu_table;
41extern void tce_build(struct iommu_table *tbl, unsigned long index, 41extern void tce_build(struct iommu_table *tbl, unsigned long index,
42 unsigned int npages, unsigned long uaddr, int direction); 42 unsigned int npages, unsigned long uaddr, int direction);
43extern void tce_free(struct iommu_table *tbl, long index, unsigned int npages); 43extern void tce_free(struct iommu_table *tbl, long index, unsigned int npages);
44extern void* alloc_tce_table(void); 44extern void * __init alloc_tce_table(void);
45extern void free_tce_table(void *tbl); 45extern void __init free_tce_table(void *tbl);
46extern int build_tce_table(struct pci_dev *dev, void __iomem *bbar); 46extern int __init build_tce_table(struct pci_dev *dev, void __iomem *bbar);
47 47
48#endif /* _ASM_X86_64_TCE_H */ 48#endif /* _ASM_X86_64_TCE_H */
diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h
index 10bb5a8ed688..beae2bfb62ca 100644
--- a/include/asm-x86_64/thread_info.h
+++ b/include/asm-x86_64/thread_info.h
@@ -107,7 +107,6 @@ static inline struct thread_info *stack_thread_info(void)
107 * Warning: layout of LSW is hardcoded in entry.S 107 * Warning: layout of LSW is hardcoded in entry.S
108 */ 108 */
109#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 109#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
110#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
111#define TIF_SIGPENDING 2 /* signal pending */ 110#define TIF_SIGPENDING 2 /* signal pending */
112#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 111#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
113#define TIF_SINGLESTEP 4 /* reenable singlestep on user return*/ 112#define TIF_SINGLESTEP 4 /* reenable singlestep on user return*/
@@ -115,6 +114,7 @@ static inline struct thread_info *stack_thread_info(void)
115#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ 114#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
116#define TIF_SECCOMP 8 /* secure computing */ 115#define TIF_SECCOMP 8 /* secure computing */
117#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */ 116#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */
117#define TIF_MCE_NOTIFY 10 /* notify userspace of an MCE */
118/* 16 free */ 118/* 16 free */
119#define TIF_IA32 17 /* 32bit process */ 119#define TIF_IA32 17 /* 32bit process */
120#define TIF_FORK 18 /* ret_from_fork */ 120#define TIF_FORK 18 /* ret_from_fork */
@@ -125,7 +125,6 @@ static inline struct thread_info *stack_thread_info(void)
125#define TIF_FREEZE 23 /* is freezing for suspend */ 125#define TIF_FREEZE 23 /* is freezing for suspend */
126 126
127#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 127#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
128#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
129#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 128#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
130#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) 129#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
131#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 130#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
@@ -133,6 +132,7 @@ static inline struct thread_info *stack_thread_info(void)
133#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 132#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
134#define _TIF_SECCOMP (1<<TIF_SECCOMP) 133#define _TIF_SECCOMP (1<<TIF_SECCOMP)
135#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 134#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
135#define _TIF_MCE_NOTIFY (1<<TIF_MCE_NOTIFY)
136#define _TIF_IA32 (1<<TIF_IA32) 136#define _TIF_IA32 (1<<TIF_IA32)
137#define _TIF_FORK (1<<TIF_FORK) 137#define _TIF_FORK (1<<TIF_FORK)
138#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) 138#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
diff --git a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h
index f6527e1b6c1c..6ed21f44d308 100644
--- a/include/asm-x86_64/timex.h
+++ b/include/asm-x86_64/timex.h
@@ -9,7 +9,6 @@
9#include <asm/8253pit.h> 9#include <asm/8253pit.h>
10#include <asm/msr.h> 10#include <asm/msr.h>
11#include <asm/vsyscall.h> 11#include <asm/vsyscall.h>
12#include <asm/hpet.h>
13#include <asm/system.h> 12#include <asm/system.h>
14#include <asm/processor.h> 13#include <asm/processor.h>
15#include <asm/tsc.h> 14#include <asm/tsc.h>
diff --git a/include/asm-x86_64/tlbflush.h b/include/asm-x86_64/tlbflush.h
index 8516225a8389..888eb4abdd07 100644
--- a/include/asm-x86_64/tlbflush.h
+++ b/include/asm-x86_64/tlbflush.h
@@ -92,7 +92,11 @@ static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long st
92 92
93#endif 93#endif
94 94
95#define flush_tlb_kernel_range(start, end) flush_tlb_all() 95static inline void flush_tlb_kernel_range(unsigned long start,
96 unsigned long end)
97{
98 flush_tlb_all();
99}
96 100
97static inline void flush_tlb_pgtables(struct mm_struct *mm, 101static inline void flush_tlb_pgtables(struct mm_struct *mm,
98 unsigned long start, unsigned long end) 102 unsigned long start, unsigned long end)
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index 4fd6fb23953e..36e52fba7960 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -22,7 +22,7 @@ extern int __node_distance(int, int);
22#define parent_node(node) (node) 22#define parent_node(node) (node)
23#define node_to_first_cpu(node) (first_cpu(node_to_cpumask[node])) 23#define node_to_first_cpu(node) (first_cpu(node_to_cpumask[node]))
24#define node_to_cpumask(node) (node_to_cpumask[node]) 24#define node_to_cpumask(node) (node_to_cpumask[node])
25#define pcibus_to_node(bus) ((long)(bus->sysdata)) 25#define pcibus_to_node(bus) ((struct pci_sysdata *)((bus)->sysdata))->node
26#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus)); 26#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus));
27 27
28#define numa_node_id() read_pda(nodenumber) 28#define numa_node_id() read_pda(nodenumber)
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index 9df30b939c4e..f4ce8768ad44 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -100,7 +100,7 @@ struct exception_table_entry
100 case 8: __get_user_x(8,__ret_gu,__val_gu,ptr); break; \ 100 case 8: __get_user_x(8,__ret_gu,__val_gu,ptr); break; \
101 default: __get_user_bad(); break; \ 101 default: __get_user_bad(); break; \
102 } \ 102 } \
103 (x) = (typeof(*(ptr)))__val_gu; \ 103 (x) = (__force typeof(*(ptr)))__val_gu; \
104 __ret_gu; \ 104 __ret_gu; \
105}) 105})
106 106
@@ -192,7 +192,7 @@ struct __large_struct { unsigned long buf[100]; };
192 int __gu_err; \ 192 int __gu_err; \
193 unsigned long __gu_val; \ 193 unsigned long __gu_val; \
194 __get_user_size(__gu_val,(ptr),(size),__gu_err); \ 194 __get_user_size(__gu_val,(ptr),(size),__gu_err); \
195 (x) = (typeof(*(ptr)))__gu_val; \ 195 (x) = (__force typeof(*(ptr)))__gu_val; \
196 __gu_err; \ 196 __gu_err; \
197}) 197})
198 198
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index 8696f8ad401e..fc4e73f5f1fa 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -630,6 +630,8 @@ __SYSCALL(__NR_signalfd, sys_signalfd)
630__SYSCALL(__NR_timerfd, sys_timerfd) 630__SYSCALL(__NR_timerfd, sys_timerfd)
631#define __NR_eventfd 284 631#define __NR_eventfd 284
632__SYSCALL(__NR_eventfd, sys_eventfd) 632__SYSCALL(__NR_eventfd, sys_eventfd)
633#define __NR_fallocate 285
634__SYSCALL(__NR_fallocate, sys_fallocate)
633 635
634#ifndef __NO_STUBS 636#ifndef __NO_STUBS
635#define __ARCH_WANT_OLD_READDIR 637#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-x86_64/vgtod.h b/include/asm-x86_64/vgtod.h
new file mode 100644
index 000000000000..3301f0929342
--- /dev/null
+++ b/include/asm-x86_64/vgtod.h
@@ -0,0 +1,29 @@
1#ifndef _ASM_VGTOD_H
2#define _ASM_VGTOD_H 1
3
4#include <asm/vsyscall.h>
5#include <linux/clocksource.h>
6
7struct vsyscall_gtod_data {
8 seqlock_t lock;
9
10 /* open coded 'struct timespec' */
11 time_t wall_time_sec;
12 u32 wall_time_nsec;
13
14 int sysctl_enabled;
15 struct timezone sys_tz;
16 struct { /* extract of a clocksource struct */
17 cycle_t (*vread)(void);
18 cycle_t cycle_last;
19 cycle_t mask;
20 u32 mult;
21 u32 shift;
22 } clock;
23 struct timespec wall_to_monotonic;
24};
25extern struct vsyscall_gtod_data __vsyscall_gtod_data
26__section_vsyscall_gtod_data;
27extern struct vsyscall_gtod_data vsyscall_gtod_data;
28
29#endif
diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h
index 82b4afe65c91..3b8ceb4af2cf 100644
--- a/include/asm-x86_64/vsyscall.h
+++ b/include/asm-x86_64/vsyscall.h
@@ -22,6 +22,8 @@ enum vsyscall_num {
22/* Definitions for CONFIG_GENERIC_TIME definitions */ 22/* Definitions for CONFIG_GENERIC_TIME definitions */
23#define __section_vsyscall_gtod_data __attribute__ \ 23#define __section_vsyscall_gtod_data __attribute__ \
24 ((unused, __section__ (".vsyscall_gtod_data"),aligned(16))) 24 ((unused, __section__ (".vsyscall_gtod_data"),aligned(16)))
25#define __section_vsyscall_clock __attribute__ \
26 ((unused, __section__ (".vsyscall_clock"),aligned(16)))
25#define __vsyscall_fn __attribute__ ((unused,__section__(".vsyscall_fn"))) 27#define __vsyscall_fn __attribute__ ((unused,__section__(".vsyscall_fn")))
26 28
27#define VGETCPU_RDTSCP 1 29#define VGETCPU_RDTSCP 1
@@ -36,7 +38,6 @@ extern volatile unsigned long __jiffies;
36/* kernel space (writeable) */ 38/* kernel space (writeable) */
37extern int vgetcpu_mode; 39extern int vgetcpu_mode;
38extern struct timezone sys_tz; 40extern struct timezone sys_tz;
39extern struct vsyscall_gtod_data_t vsyscall_gtod_data;
40 41
41#endif /* __KERNEL__ */ 42#endif /* __KERNEL__ */
42 43
diff --git a/include/asm-xtensa/a.out.h b/include/asm-xtensa/a.out.h
index ffc4dcfd6ac1..05a2f67c6768 100644
--- a/include/asm-xtensa/a.out.h
+++ b/include/asm-xtensa/a.out.h
@@ -17,6 +17,7 @@
17/* Note: the kernel needs the a.out definitions, even if only ELF is used. */ 17/* Note: the kernel needs the a.out definitions, even if only ELF is used. */
18 18
19#define STACK_TOP TASK_SIZE 19#define STACK_TOP TASK_SIZE
20#define STACK_TOP_MAX STACK_TOP
20 21
21struct exec 22struct exec
22{ 23{
diff --git a/include/asm-xtensa/io.h b/include/asm-xtensa/io.h
index 31ffc3f119c1..0faa614d9696 100644
--- a/include/asm-xtensa/io.h
+++ b/include/asm-xtensa/io.h
@@ -13,6 +13,7 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15#include <asm/byteorder.h> 15#include <asm/byteorder.h>
16#include <asm/page.h>
16 17
17#include <linux/types.h> 18#include <linux/types.h>
18 19
diff --git a/include/asm-xtensa/thread_info.h b/include/asm-xtensa/thread_info.h
index 3fa29799b435..52c958285bcb 100644
--- a/include/asm-xtensa/thread_info.h
+++ b/include/asm-xtensa/thread_info.h
@@ -110,17 +110,15 @@ static inline struct thread_info *current_thread_info(void)
110 * - other flags in MSW 110 * - other flags in MSW
111 */ 111 */
112#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 112#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
113#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ 113#define TIF_SIGPENDING 1 /* signal pending */
114#define TIF_SIGPENDING 2 /* signal pending */ 114#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
115#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 115#define TIF_SINGLESTEP 3 /* restore singlestep on return to user mode */
116#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ 116#define TIF_IRET 4 /* return with iret */
117#define TIF_IRET 5 /* return with iret */ 117#define TIF_MEMDIE 5
118#define TIF_MEMDIE 6 118#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
119#define TIF_RESTORE_SIGMASK 7 /* restore signal mask in do_signal() */
120#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 119#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
121 120
122#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 121#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
123#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
124#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 122#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
125#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 123#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
126#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) 124#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index bcf875e844fe..818cc3a50e6b 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -7,6 +7,7 @@ header-y += raid/
7header-y += spi/ 7header-y += spi/
8header-y += sunrpc/ 8header-y += sunrpc/
9header-y += tc_act/ 9header-y += tc_act/
10header-y += tc_ematch/
10header-y += netfilter/ 11header-y += netfilter/
11header-y += netfilter_arp/ 12header-y += netfilter_arp/
12header-y += netfilter_bridge/ 13header-y += netfilter_bridge/
@@ -137,6 +138,7 @@ header-y += radeonfb.h
137header-y += raw.h 138header-y += raw.h
138header-y += resource.h 139header-y += resource.h
139header-y += rose.h 140header-y += rose.h
141header-y += serial_reg.h
140header-y += smbno.h 142header-y += smbno.h
141header-y += snmp.h 143header-y += snmp.h
142header-y += sockios.h 144header-y += sockios.h
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index fccd8b548d93..bf5e0009de75 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -33,6 +33,7 @@
33#endif 33#endif
34 34
35#include <linux/list.h> 35#include <linux/list.h>
36#include <linux/mod_devicetable.h>
36 37
37#include <acpi/acpi.h> 38#include <acpi/acpi.h>
38#include <acpi/acpi_bus.h> 39#include <acpi/acpi_bus.h>
@@ -88,10 +89,8 @@ int acpi_table_parse (char *id, acpi_table_handler handler);
88int __init acpi_table_parse_entries(char *id, unsigned long table_size, 89int __init acpi_table_parse_entries(char *id, unsigned long table_size,
89 int entry_id, acpi_table_entry_handler handler, unsigned int max_entries); 90 int entry_id, acpi_table_entry_handler handler, unsigned int max_entries);
90int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries); 91int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries);
91int acpi_table_parse_srat (enum acpi_srat_type id, acpi_table_entry_handler handler, unsigned int max_entries);
92int acpi_parse_mcfg (struct acpi_table_header *header); 92int acpi_parse_mcfg (struct acpi_table_header *header);
93void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); 93void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
94void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
95 94
96/* the following four functions are architecture-dependent */ 95/* the following four functions are architecture-dependent */
97#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT 96#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
@@ -122,7 +121,7 @@ extern struct acpi_mcfg_allocation *pci_mmcfg_config;
122extern int pci_mmcfg_config_num; 121extern int pci_mmcfg_config_num;
123 122
124extern int sbf_port; 123extern int sbf_port;
125extern unsigned long acpi_video_flags; 124extern unsigned long acpi_realmode_flags;
126 125
127#else /* !CONFIG_ACPI */ 126#else /* !CONFIG_ACPI */
128 127
@@ -233,6 +232,9 @@ extern int acpi_paddr_to_node(u64 start_addr, u64 size);
233 232
234extern int pnpacpi_disabled; 233extern int pnpacpi_disabled;
235 234
235#define PXM_INVAL (-1)
236#define NID_INVAL (-1)
237
236#else /* CONFIG_ACPI */ 238#else /* CONFIG_ACPI */
237 239
238static inline int acpi_boot_init(void) 240static inline int acpi_boot_init(void)
diff --git a/include/linux/aer.h b/include/linux/aer.h
index 509656286e53..bcf236d825e8 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -15,11 +15,26 @@ extern int pci_disable_pcie_error_reporting(struct pci_dev *dev);
15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); 15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
16extern int pci_cleanup_aer_correct_error_status(struct pci_dev *dev); 16extern int pci_cleanup_aer_correct_error_status(struct pci_dev *dev);
17#else 17#else
18#define pci_enable_pcie_error_reporting(dev) (-EINVAL) 18static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
19#define pci_find_aer_capability(dev) (0) 19{
20#define pci_disable_pcie_error_reporting(dev) (-EINVAL) 20 return -EINVAL;
21#define pci_cleanup_aer_uncorrect_error_status(dev) (-EINVAL) 21}
22#define pci_cleanup_aer_correct_error_status(dev) (-EINVAL) 22static inline int pci_find_aer_capability(struct pci_dev *dev)
23{
24 return 0;
25}
26static inline int pci_disable_pcie_error_reporting(struct pci_dev *dev)
27{
28 return -EINVAL;
29}
30static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
31{
32 return -EINVAL;
33}
34static inline int pci_cleanup_aer_correct_error_status(struct pci_dev *dev)
35{
36 return -EINVAL;
37}
23#endif 38#endif
24 39
25#endif //_AER_H_ 40#endif //_AER_H_
diff --git a/include/linux/aio.h b/include/linux/aio.h
index b903fc02bdb7..d10e608f232d 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -86,7 +86,7 @@ struct kioctx;
86 */ 86 */
87struct kiocb { 87struct kiocb {
88 struct list_head ki_run_list; 88 struct list_head ki_run_list;
89 long ki_flags; 89 unsigned long ki_flags;
90 int ki_users; 90 int ki_users;
91 unsigned ki_key; /* id of this request */ 91 unsigned ki_key; /* id of this request */
92 92
diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h
index 290aef326812..5f921c84827a 100644
--- a/include/linux/apm_bios.h
+++ b/include/linux/apm_bios.h
@@ -21,20 +21,22 @@ typedef unsigned short apm_eventinfo_t;
21 21
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23 23
24#include <linux/types.h>
25
24#define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8) 26#define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8)
25#define APM_CS_16 (APM_CS + 8) 27#define APM_CS_16 (APM_CS + 8)
26#define APM_DS (APM_CS_16 + 8) 28#define APM_DS (APM_CS_16 + 8)
27 29
28struct apm_bios_info { 30struct apm_bios_info {
29 unsigned short version; 31 u16 version;
30 unsigned short cseg; 32 u16 cseg;
31 unsigned long offset; 33 u32 offset;
32 unsigned short cseg_16; 34 u16 cseg_16;
33 unsigned short dseg; 35 u16 dseg;
34 unsigned short flags; 36 u16 flags;
35 unsigned short cseg_len; 37 u16 cseg_len;
36 unsigned short cseg_16_len; 38 u16 cseg_16_len;
37 unsigned short dseg_len; 39 u16 dseg_len;
38}; 40};
39 41
40/* Results of APM Installation Check */ 42/* Results of APM Installation Check */
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h
index ff1255079fa1..bdca3f1b3213 100644
--- a/include/linux/async_tx.h
+++ b/include/linux/async_tx.h
@@ -51,10 +51,6 @@ struct dma_chan_ref {
51 * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a 51 * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a
52 * dependency chain 52 * dependency chain
53 * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. 53 * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining.
54 * @ASYNC_TX_KMAP_SRC: if the transaction is to be performed synchronously
55 * take an atomic mapping (KM_USER0) on the source page(s)
56 * @ASYNC_TX_KMAP_DST: if the transaction is to be performed synchronously
57 * take an atomic mapping (KM_USER0) on the dest page(s)
58 */ 54 */
59enum async_tx_flags { 55enum async_tx_flags {
60 ASYNC_TX_XOR_ZERO_DST = (1 << 0), 56 ASYNC_TX_XOR_ZERO_DST = (1 << 0),
@@ -62,8 +58,6 @@ enum async_tx_flags {
62 ASYNC_TX_ASSUME_COHERENT = (1 << 2), 58 ASYNC_TX_ASSUME_COHERENT = (1 << 2),
63 ASYNC_TX_ACK = (1 << 3), 59 ASYNC_TX_ACK = (1 << 3),
64 ASYNC_TX_DEP_ACK = (1 << 4), 60 ASYNC_TX_DEP_ACK = (1 << 4),
65 ASYNC_TX_KMAP_SRC = (1 << 5),
66 ASYNC_TX_KMAP_DST = (1 << 6),
67}; 61};
68 62
69#ifdef CONFIG_DMA_ENGINE 63#ifdef CONFIG_DMA_ENGINE
diff --git a/include/linux/ata.h b/include/linux/ata.h
index b5a20162af32..c043c1ccf1c5 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -64,6 +64,28 @@ enum {
64 ATA_ID_PROD_LEN = 40, 64 ATA_ID_PROD_LEN = 40,
65 65
66 ATA_PCI_CTL_OFS = 2, 66 ATA_PCI_CTL_OFS = 2,
67
68 ATA_PIO0 = (1 << 0),
69 ATA_PIO1 = ATA_PIO0 | (1 << 1),
70 ATA_PIO2 = ATA_PIO1 | (1 << 2),
71 ATA_PIO3 = ATA_PIO2 | (1 << 3),
72 ATA_PIO4 = ATA_PIO3 | (1 << 4),
73 ATA_PIO5 = ATA_PIO4 | (1 << 5),
74 ATA_PIO6 = ATA_PIO5 | (1 << 6),
75
76 ATA_SWDMA0 = (1 << 0),
77 ATA_SWDMA1 = ATA_SWDMA0 | (1 << 1),
78 ATA_SWDMA2 = ATA_SWDMA1 | (1 << 2),
79
80 ATA_SWDMA2_ONLY = (1 << 2),
81
82 ATA_MWDMA0 = (1 << 0),
83 ATA_MWDMA1 = ATA_MWDMA0 | (1 << 1),
84 ATA_MWDMA2 = ATA_MWDMA1 | (1 << 2),
85
86 ATA_MWDMA12_ONLY = (1 << 1) | (1 << 2),
87 ATA_MWDMA2_ONLY = (1 << 2),
88
67 ATA_UDMA0 = (1 << 0), 89 ATA_UDMA0 = (1 << 0),
68 ATA_UDMA1 = ATA_UDMA0 | (1 << 1), 90 ATA_UDMA1 = ATA_UDMA0 | (1 << 1),
69 ATA_UDMA2 = ATA_UDMA1 | (1 << 2), 91 ATA_UDMA2 = ATA_UDMA1 | (1 << 2),
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 8ca7ca0b47f0..d6579df8dadf 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -63,8 +63,8 @@
63#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */ 63#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */
64#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */ 64#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */
65#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */ 65#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */
66#define AUDIT_TTY_GET 1014 /* Get TTY auditing status */ 66#define AUDIT_TTY_GET 1016 /* Get TTY auditing status */
67#define AUDIT_TTY_SET 1015 /* Set TTY auditing status */ 67#define AUDIT_TTY_SET 1017 /* Set TTY auditing status */
68 68
69#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */ 69#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */
70#define AUDIT_USER_AVC 1107 /* We filter this differently */ 70#define AUDIT_USER_AVC 1107 /* We filter this differently */
@@ -161,7 +161,7 @@
161 * are currently used in an audit field constant understood by the kernel. 161 * are currently used in an audit field constant understood by the kernel.
162 * If you are adding a new #define AUDIT_<whatever>, please ensure that 162 * If you are adding a new #define AUDIT_<whatever>, please ensure that
163 * AUDIT_UNUSED_BITS is updated if need be. */ 163 * AUDIT_UNUSED_BITS is updated if need be. */
164#define AUDIT_UNUSED_BITS 0x0FFFFC00 164#define AUDIT_UNUSED_BITS 0x07FFFC00
165 165
166 166
167/* Rule fields */ 167/* Rule fields */
@@ -213,25 +213,29 @@
213#define AUDIT_NEGATE 0x80000000 213#define AUDIT_NEGATE 0x80000000
214 214
215/* These are the supported operators. 215/* These are the supported operators.
216 * 4 2 1 216 * 4 2 1 8
217 * = > < 217 * = > < ?
218 * ------- 218 * ----------
219 * 0 0 0 0 nonsense 219 * 0 0 0 0 00 nonsense
220 * 0 0 1 1 < 220 * 0 0 0 1 08 & bit mask
221 * 0 1 0 2 > 221 * 0 0 1 0 10 <
222 * 0 1 1 3 != 222 * 0 1 0 0 20 >
223 * 1 0 0 4 = 223 * 0 1 1 0 30 !=
224 * 1 0 1 5 <= 224 * 1 0 0 0 40 =
225 * 1 1 0 6 >= 225 * 1 0 0 1 48 &= bit test
226 * 1 1 1 7 all operators 226 * 1 0 1 0 50 <=
227 * 1 1 0 0 60 >=
228 * 1 1 1 1 78 all operators
227 */ 229 */
230#define AUDIT_BIT_MASK 0x08000000
228#define AUDIT_LESS_THAN 0x10000000 231#define AUDIT_LESS_THAN 0x10000000
229#define AUDIT_GREATER_THAN 0x20000000 232#define AUDIT_GREATER_THAN 0x20000000
230#define AUDIT_NOT_EQUAL 0x30000000 233#define AUDIT_NOT_EQUAL 0x30000000
231#define AUDIT_EQUAL 0x40000000 234#define AUDIT_EQUAL 0x40000000
235#define AUDIT_BIT_TEST (AUDIT_BIT_MASK|AUDIT_EQUAL)
232#define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL) 236#define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL)
233#define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL) 237#define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL)
234#define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL) 238#define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK)
235 239
236/* Status symbols */ 240/* Status symbols */
237 /* Mask values */ 241 /* Mask values */
@@ -407,7 +411,6 @@ extern int audit_bprm(struct linux_binprm *bprm);
407extern int audit_socketcall(int nargs, unsigned long *args); 411extern int audit_socketcall(int nargs, unsigned long *args);
408extern int audit_sockaddr(int len, void *addr); 412extern int audit_sockaddr(int len, void *addr);
409extern int __audit_fd_pair(int fd1, int fd2); 413extern int __audit_fd_pair(int fd1, int fd2);
410extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt);
411extern int audit_set_macxattr(const char *name); 414extern int audit_set_macxattr(const char *name);
412extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); 415extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr);
413extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout); 416extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout);
@@ -487,7 +490,6 @@ extern int audit_signals;
487#define audit_socketcall(n,a) ({ 0; }) 490#define audit_socketcall(n,a) ({ 0; })
488#define audit_fd_pair(n,a) ({ 0; }) 491#define audit_fd_pair(n,a) ({ 0; })
489#define audit_sockaddr(len, addr) ({ 0; }) 492#define audit_sockaddr(len, addr) ({ 0; })
490#define audit_avc_path(dentry, mnt) ({ 0; })
491#define audit_set_macxattr(n) do { ; } while (0) 493#define audit_set_macxattr(n) do { ; } while (0)
492#define audit_mq_open(o,m,a) ({ 0; }) 494#define audit_mq_open(o,m,a) ({ 0; })
493#define audit_mq_timedsend(d,l,p,t) ({ 0; }) 495#define audit_mq_timedsend(d,l,p,t) ({ 0; })
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index 1023ba0d6e55..c897c7b03858 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -69,8 +69,8 @@ struct backlight_device {
69 69
70 /* The framebuffer notifier block */ 70 /* The framebuffer notifier block */
71 struct notifier_block fb_notif; 71 struct notifier_block fb_notif;
72 /* The class device structure */ 72
73 struct class_device class_dev; 73 struct device dev;
74}; 74};
75 75
76static inline void backlight_update_status(struct backlight_device *bd) 76static inline void backlight_update_status(struct backlight_device *bd)
@@ -85,6 +85,11 @@ extern struct backlight_device *backlight_device_register(const char *name,
85 struct device *dev, void *devdata, struct backlight_ops *ops); 85 struct device *dev, void *devdata, struct backlight_ops *ops);
86extern void backlight_device_unregister(struct backlight_device *bd); 86extern void backlight_device_unregister(struct backlight_device *bd);
87 87
88#define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev) 88#define to_backlight_device(obj) container_of(obj, struct backlight_device, dev)
89
90static inline void * bl_get_data(struct backlight_device *bl_dev)
91{
92 return dev_get_drvdata(&bl_dev->dev);
93}
89 94
90#endif 95#endif
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index e1a708337be3..91c8c07fe8b7 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -6,11 +6,13 @@
6struct pt_regs; 6struct pt_regs;
7 7
8/* 8/*
9 * MAX_ARG_PAGES defines the number of pages allocated for arguments 9 * These are the maximum length and maximum number of strings passed to the
10 * and envelope for the new program. 32 should suffice, this gives 10 * execve() system call. MAX_ARG_STRLEN is essentially random but serves to
11 * a maximum env+arg of 128kB w/4KB pages! 11 * prevent the kernel from being unduly impacted by misaddressed pointers.
12 * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
12 */ 13 */
13#define MAX_ARG_PAGES 32 14#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
15#define MAX_ARG_STRINGS 0x7FFFFFFF
14 16
15/* sizeof(linux_binprm->buf) */ 17/* sizeof(linux_binprm->buf) */
16#define BINPRM_BUF_SIZE 128 18#define BINPRM_BUF_SIZE 128
@@ -24,7 +26,12 @@ struct pt_regs;
24 */ 26 */
25struct linux_binprm{ 27struct linux_binprm{
26 char buf[BINPRM_BUF_SIZE]; 28 char buf[BINPRM_BUF_SIZE];
29#ifdef CONFIG_MMU
30 struct vm_area_struct *vma;
31#else
32# define MAX_ARG_PAGES 32
27 struct page *page[MAX_ARG_PAGES]; 33 struct page *page[MAX_ARG_PAGES];
34#endif
28 struct mm_struct *mm; 35 struct mm_struct *mm;
29 unsigned long p; /* current top of mem */ 36 unsigned long p; /* current top of mem */
30 int sh_bang; 37 int sh_bang;
@@ -40,6 +47,7 @@ struct linux_binprm{
40 unsigned interp_flags; 47 unsigned interp_flags;
41 unsigned interp_data; 48 unsigned interp_data;
42 unsigned long loader, exec; 49 unsigned long loader, exec;
50 unsigned long argv_len;
43}; 51};
44 52
45#define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0 53#define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0
@@ -68,7 +76,7 @@ extern int register_binfmt(struct linux_binfmt *);
68extern int unregister_binfmt(struct linux_binfmt *); 76extern int unregister_binfmt(struct linux_binfmt *);
69 77
70extern int prepare_binprm(struct linux_binprm *); 78extern int prepare_binprm(struct linux_binprm *);
71extern void remove_arg_zero(struct linux_binprm *); 79extern int __must_check remove_arg_zero(struct linux_binprm *);
72extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); 80extern int search_binary_handler(struct linux_binprm *,struct pt_regs *);
73extern int flush_old_exec(struct linux_binprm * bprm); 81extern int flush_old_exec(struct linux_binprm * bprm);
74 82
@@ -85,6 +93,7 @@ extern int suid_dumpable;
85extern int setup_arg_pages(struct linux_binprm * bprm, 93extern int setup_arg_pages(struct linux_binprm * bprm,
86 unsigned long stack_top, 94 unsigned long stack_top,
87 int executable_stack); 95 int executable_stack);
96extern int bprm_mm_init(struct linux_binprm *bprm);
88extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); 97extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
89extern void compute_creds(struct linux_binprm *binprm); 98extern void compute_creds(struct linux_binprm *binprm);
90extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); 99extern int do_coredump(long signr, int exit_code, struct pt_regs * regs);
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 4d85262b4fa4..1ddef34f43c3 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -24,6 +24,8 @@
24#include <linux/mempool.h> 24#include <linux/mempool.h>
25#include <linux/ioprio.h> 25#include <linux/ioprio.h>
26 26
27#ifdef CONFIG_BLOCK
28
27/* Platforms may set this to teach the BIO layer about IOMMU hardware. */ 29/* Platforms may set this to teach the BIO layer about IOMMU hardware. */
28#include <asm/io.h> 30#include <asm/io.h>
29 31
@@ -361,4 +363,5 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,
361 __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) 363 __bio_kmap_irq((bio), (bio)->bi_idx, (flags))
362#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) 364#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags)
363 365
366#endif /* CONFIG_BLOCK */
364#endif /* __LINUX_BIO_H */ 367#endif /* __LINUX_BIO_H */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f78965fc6426..b126c6f68e27 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -37,7 +37,7 @@
37struct scsi_ioctl_command; 37struct scsi_ioctl_command;
38 38
39struct request_queue; 39struct request_queue;
40typedef struct request_queue request_queue_t; 40typedef struct request_queue request_queue_t __deprecated;
41struct elevator_queue; 41struct elevator_queue;
42typedef struct elevator_queue elevator_t; 42typedef struct elevator_queue elevator_t;
43struct request_pm_state; 43struct request_pm_state;
@@ -233,7 +233,7 @@ struct request {
233 struct list_head queuelist; 233 struct list_head queuelist;
234 struct list_head donelist; 234 struct list_head donelist;
235 235
236 request_queue_t *q; 236 struct request_queue *q;
237 237
238 unsigned int cmd_flags; 238 unsigned int cmd_flags;
239 enum rq_cmd_type_bits cmd_type; 239 enum rq_cmd_type_bits cmd_type;
@@ -337,15 +337,15 @@ struct request_pm_state
337 337
338#include <linux/elevator.h> 338#include <linux/elevator.h>
339 339
340typedef void (request_fn_proc) (request_queue_t *q); 340typedef void (request_fn_proc) (struct request_queue *q);
341typedef int (make_request_fn) (request_queue_t *q, struct bio *bio); 341typedef int (make_request_fn) (struct request_queue *q, struct bio *bio);
342typedef int (prep_rq_fn) (request_queue_t *, struct request *); 342typedef int (prep_rq_fn) (struct request_queue *, struct request *);
343typedef void (unplug_fn) (request_queue_t *); 343typedef void (unplug_fn) (struct request_queue *);
344 344
345struct bio_vec; 345struct bio_vec;
346typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *); 346typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *);
347typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *); 347typedef int (issue_flush_fn) (struct request_queue *, struct gendisk *, sector_t *);
348typedef void (prepare_flush_fn) (request_queue_t *, struct request *); 348typedef void (prepare_flush_fn) (struct request_queue *, struct request *);
349typedef void (softirq_done_fn)(struct request *); 349typedef void (softirq_done_fn)(struct request *);
350 350
351enum blk_queue_state { 351enum blk_queue_state {
@@ -483,8 +483,8 @@ struct request_queue
483#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 483#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
484#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ 484#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
485#define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ 485#define QUEUE_FLAG_STOPPED 2 /* queue is stopped */
486#define QUEUE_FLAG_READFULL 3 /* write queue has been filled */ 486#define QUEUE_FLAG_READFULL 3 /* read queue has been filled */
487#define QUEUE_FLAG_WRITEFULL 4 /* read queue has been filled */ 487#define QUEUE_FLAG_WRITEFULL 4 /* write queue has been filled */
488#define QUEUE_FLAG_DEAD 5 /* queue being torn down */ 488#define QUEUE_FLAG_DEAD 5 /* queue being torn down */
489#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ 489#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */
490#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ 490#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */
@@ -626,13 +626,13 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn;
626 626
627#ifdef CONFIG_BOUNCE 627#ifdef CONFIG_BOUNCE
628extern int init_emergency_isa_pool(void); 628extern int init_emergency_isa_pool(void);
629extern void blk_queue_bounce(request_queue_t *q, struct bio **bio); 629extern void blk_queue_bounce(struct request_queue *q, struct bio **bio);
630#else 630#else
631static inline int init_emergency_isa_pool(void) 631static inline int init_emergency_isa_pool(void)
632{ 632{
633 return 0; 633 return 0;
634} 634}
635static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio) 635static inline void blk_queue_bounce(struct request_queue *q, struct bio **bio)
636{ 636{
637} 637}
638#endif /* CONFIG_MMU */ 638#endif /* CONFIG_MMU */
@@ -646,14 +646,14 @@ extern void blk_unregister_queue(struct gendisk *disk);
646extern void register_disk(struct gendisk *dev); 646extern void register_disk(struct gendisk *dev);
647extern void generic_make_request(struct bio *bio); 647extern void generic_make_request(struct bio *bio);
648extern void blk_put_request(struct request *); 648extern void blk_put_request(struct request *);
649extern void __blk_put_request(request_queue_t *, struct request *); 649extern void __blk_put_request(struct request_queue *, struct request *);
650extern void blk_end_sync_rq(struct request *rq, int error); 650extern void blk_end_sync_rq(struct request *rq, int error);
651extern struct request *blk_get_request(request_queue_t *, int, gfp_t); 651extern struct request *blk_get_request(struct request_queue *, int, gfp_t);
652extern void blk_insert_request(request_queue_t *, struct request *, int, void *); 652extern void blk_insert_request(struct request_queue *, struct request *, int, void *);
653extern void blk_requeue_request(request_queue_t *, struct request *); 653extern void blk_requeue_request(struct request_queue *, struct request *);
654extern void blk_plug_device(request_queue_t *); 654extern void blk_plug_device(struct request_queue *);
655extern int blk_remove_plug(request_queue_t *); 655extern int blk_remove_plug(struct request_queue *);
656extern void blk_recount_segments(request_queue_t *, struct bio *); 656extern void blk_recount_segments(struct request_queue *, struct bio *);
657extern int scsi_cmd_ioctl(struct file *, struct request_queue *, 657extern int scsi_cmd_ioctl(struct file *, struct request_queue *,
658 struct gendisk *, unsigned int, void __user *); 658 struct gendisk *, unsigned int, void __user *);
659extern int sg_scsi_ioctl(struct file *, struct request_queue *, 659extern int sg_scsi_ioctl(struct file *, struct request_queue *,
@@ -662,14 +662,15 @@ extern int sg_scsi_ioctl(struct file *, struct request_queue *,
662/* 662/*
663 * Temporary export, until SCSI gets fixed up. 663 * Temporary export, until SCSI gets fixed up.
664 */ 664 */
665extern int ll_back_merge_fn(request_queue_t *, struct request *, struct bio *); 665extern int ll_back_merge_fn(struct request_queue *, struct request *,
666 struct bio *);
666 667
667/* 668/*
668 * A queue has just exitted congestion. Note this in the global counter of 669 * A queue has just exitted congestion. Note this in the global counter of
669 * congested queues, and wake up anyone who was waiting for requests to be 670 * congested queues, and wake up anyone who was waiting for requests to be
670 * put back. 671 * put back.
671 */ 672 */
672static inline void blk_clear_queue_congested(request_queue_t *q, int rw) 673static inline void blk_clear_queue_congested(struct request_queue *q, int rw)
673{ 674{
674 clear_bdi_congested(&q->backing_dev_info, rw); 675 clear_bdi_congested(&q->backing_dev_info, rw);
675} 676}
@@ -678,34 +679,29 @@ static inline void blk_clear_queue_congested(request_queue_t *q, int rw)
678 * A queue has just entered congestion. Flag that in the queue's VM-visible 679 * A queue has just entered congestion. Flag that in the queue's VM-visible
679 * state flags and increment the global gounter of congested queues. 680 * state flags and increment the global gounter of congested queues.
680 */ 681 */
681static inline void blk_set_queue_congested(request_queue_t *q, int rw) 682static inline void blk_set_queue_congested(struct request_queue *q, int rw)
682{ 683{
683 set_bdi_congested(&q->backing_dev_info, rw); 684 set_bdi_congested(&q->backing_dev_info, rw);
684} 685}
685 686
686extern void blk_start_queue(request_queue_t *q); 687extern void blk_start_queue(struct request_queue *q);
687extern void blk_stop_queue(request_queue_t *q); 688extern void blk_stop_queue(struct request_queue *q);
688extern void blk_sync_queue(struct request_queue *q); 689extern void blk_sync_queue(struct request_queue *q);
689extern void __blk_stop_queue(request_queue_t *q); 690extern void __blk_stop_queue(struct request_queue *q);
690extern void blk_run_queue(request_queue_t *); 691extern void blk_run_queue(struct request_queue *);
691extern void blk_start_queueing(request_queue_t *); 692extern void blk_start_queueing(struct request_queue *);
692extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long); 693extern int blk_rq_map_user(struct request_queue *, struct request *, void __user *, unsigned long);
693extern int blk_rq_unmap_user(struct bio *); 694extern int blk_rq_unmap_user(struct bio *);
694extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); 695extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t);
695extern int blk_rq_map_user_iov(request_queue_t *, struct request *, 696extern int blk_rq_map_user_iov(struct request_queue *, struct request *,
696 struct sg_iovec *, int, unsigned int); 697 struct sg_iovec *, int, unsigned int);
697extern int blk_execute_rq(request_queue_t *, struct gendisk *, 698extern int blk_execute_rq(struct request_queue *, struct gendisk *,
698 struct request *, int); 699 struct request *, int);
699extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, 700extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *,
700 struct request *, int, rq_end_io_fn *); 701 struct request *, int, rq_end_io_fn *);
701extern int blk_fill_sghdr_rq(request_queue_t *, struct request *,
702 struct sg_io_hdr *, int);
703extern int blk_unmap_sghdr_rq(struct request *, struct sg_io_hdr *);
704extern int blk_complete_sghdr_rq(struct request *, struct sg_io_hdr *,
705 struct bio *);
706extern int blk_verify_command(unsigned char *, int); 702extern int blk_verify_command(unsigned char *, int);
707 703
708static inline request_queue_t *bdev_get_queue(struct block_device *bdev) 704static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
709{ 705{
710 return bdev->bd_disk->queue; 706 return bdev->bd_disk->queue;
711} 707}
@@ -754,41 +750,41 @@ static inline void blkdev_dequeue_request(struct request *req)
754/* 750/*
755 * Access functions for manipulating queue properties 751 * Access functions for manipulating queue properties
756 */ 752 */
757extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, 753extern struct request_queue *blk_init_queue_node(request_fn_proc *rfn,
758 spinlock_t *lock, int node_id); 754 spinlock_t *lock, int node_id);
759extern request_queue_t *blk_init_queue(request_fn_proc *, spinlock_t *); 755extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *);
760extern void blk_cleanup_queue(request_queue_t *); 756extern void blk_cleanup_queue(struct request_queue *);
761extern void blk_queue_make_request(request_queue_t *, make_request_fn *); 757extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
762extern void blk_queue_bounce_limit(request_queue_t *, u64); 758extern void blk_queue_bounce_limit(struct request_queue *, u64);
763extern void blk_queue_max_sectors(request_queue_t *, unsigned int); 759extern void blk_queue_max_sectors(struct request_queue *, unsigned int);
764extern void blk_queue_max_phys_segments(request_queue_t *, unsigned short); 760extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short);
765extern void blk_queue_max_hw_segments(request_queue_t *, unsigned short); 761extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short);
766extern void blk_queue_max_segment_size(request_queue_t *, unsigned int); 762extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
767extern void blk_queue_hardsect_size(request_queue_t *, unsigned short); 763extern void blk_queue_hardsect_size(struct request_queue *, unsigned short);
768extern void blk_queue_stack_limits(request_queue_t *t, request_queue_t *b); 764extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b);
769extern void blk_queue_segment_boundary(request_queue_t *, unsigned long); 765extern void blk_queue_segment_boundary(struct request_queue *, unsigned long);
770extern void blk_queue_prep_rq(request_queue_t *, prep_rq_fn *pfn); 766extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn);
771extern void blk_queue_merge_bvec(request_queue_t *, merge_bvec_fn *); 767extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *);
772extern void blk_queue_dma_alignment(request_queue_t *, int); 768extern void blk_queue_dma_alignment(struct request_queue *, int);
773extern void blk_queue_softirq_done(request_queue_t *, softirq_done_fn *); 769extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *);
774extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); 770extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
775extern int blk_queue_ordered(request_queue_t *, unsigned, prepare_flush_fn *); 771extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *);
776extern void blk_queue_issue_flush_fn(request_queue_t *, issue_flush_fn *); 772extern void blk_queue_issue_flush_fn(struct request_queue *, issue_flush_fn *);
777extern int blk_do_ordered(request_queue_t *, struct request **); 773extern int blk_do_ordered(struct request_queue *, struct request **);
778extern unsigned blk_ordered_cur_seq(request_queue_t *); 774extern unsigned blk_ordered_cur_seq(struct request_queue *);
779extern unsigned blk_ordered_req_seq(struct request *); 775extern unsigned blk_ordered_req_seq(struct request *);
780extern void blk_ordered_complete_seq(request_queue_t *, unsigned, int); 776extern void blk_ordered_complete_seq(struct request_queue *, unsigned, int);
781 777
782extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *); 778extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
783extern void blk_dump_rq_flags(struct request *, char *); 779extern void blk_dump_rq_flags(struct request *, char *);
784extern void generic_unplug_device(request_queue_t *); 780extern void generic_unplug_device(struct request_queue *);
785extern void __generic_unplug_device(request_queue_t *); 781extern void __generic_unplug_device(struct request_queue *);
786extern long nr_blockdev_pages(void); 782extern long nr_blockdev_pages(void);
787 783
788int blk_get_queue(request_queue_t *); 784int blk_get_queue(struct request_queue *);
789request_queue_t *blk_alloc_queue(gfp_t); 785struct request_queue *blk_alloc_queue(gfp_t);
790request_queue_t *blk_alloc_queue_node(gfp_t, int); 786struct request_queue *blk_alloc_queue_node(gfp_t, int);
791extern void blk_put_queue(request_queue_t *); 787extern void blk_put_queue(struct request_queue *);
792 788
793/* 789/*
794 * tag stuff 790 * tag stuff
@@ -796,13 +792,13 @@ extern void blk_put_queue(request_queue_t *);
796#define blk_queue_tag_depth(q) ((q)->queue_tags->busy) 792#define blk_queue_tag_depth(q) ((q)->queue_tags->busy)
797#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) 793#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth)
798#define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) 794#define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED)
799extern int blk_queue_start_tag(request_queue_t *, struct request *); 795extern int blk_queue_start_tag(struct request_queue *, struct request *);
800extern struct request *blk_queue_find_tag(request_queue_t *, int); 796extern struct request *blk_queue_find_tag(struct request_queue *, int);
801extern void blk_queue_end_tag(request_queue_t *, struct request *); 797extern void blk_queue_end_tag(struct request_queue *, struct request *);
802extern int blk_queue_init_tags(request_queue_t *, int, struct blk_queue_tag *); 798extern int blk_queue_init_tags(struct request_queue *, int, struct blk_queue_tag *);
803extern void blk_queue_free_tags(request_queue_t *); 799extern void blk_queue_free_tags(struct request_queue *);
804extern int blk_queue_resize_tags(request_queue_t *, int); 800extern int blk_queue_resize_tags(struct request_queue *, int);
805extern void blk_queue_invalidate_tags(request_queue_t *); 801extern void blk_queue_invalidate_tags(struct request_queue *);
806extern struct blk_queue_tag *blk_init_tags(int); 802extern struct blk_queue_tag *blk_init_tags(int);
807extern void blk_free_tags(struct blk_queue_tag *); 803extern void blk_free_tags(struct blk_queue_tag *);
808 804
@@ -814,7 +810,7 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
814 return bqt->tag_index[tag]; 810 return bqt->tag_index[tag];
815} 811}
816 812
817extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); 813extern void blk_rq_bio_prep(struct request_queue *, struct request *, struct bio *);
818extern int blkdev_issue_flush(struct block_device *, sector_t *); 814extern int blkdev_issue_flush(struct block_device *, sector_t *);
819 815
820#define MAX_PHYS_SEGMENTS 128 816#define MAX_PHYS_SEGMENTS 128
@@ -826,7 +822,7 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *);
826 822
827#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) 823#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
828 824
829static inline int queue_hardsect_size(request_queue_t *q) 825static inline int queue_hardsect_size(struct request_queue *q)
830{ 826{
831 int retval = 512; 827 int retval = 512;
832 828
@@ -841,7 +837,7 @@ static inline int bdev_hardsect_size(struct block_device *bdev)
841 return queue_hardsect_size(bdev_get_queue(bdev)); 837 return queue_hardsect_size(bdev_get_queue(bdev));
842} 838}
843 839
844static inline int queue_dma_alignment(request_queue_t *q) 840static inline int queue_dma_alignment(struct request_queue *q)
845{ 841{
846 int retval = 511; 842 int retval = 511;
847 843
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 3680ff9a30ed..7b5d56b82b59 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -105,7 +105,7 @@ struct blk_io_trace {
105 */ 105 */
106struct blk_io_trace_remap { 106struct blk_io_trace_remap {
107 __be32 device; 107 __be32 device;
108 u32 __pad; 108 __be32 device_from;
109 __be64 sector; 109 __be64 sector;
110}; 110};
111 111
@@ -144,7 +144,7 @@ struct blk_user_trace_setup {
144 144
145#if defined(CONFIG_BLK_DEV_IO_TRACE) 145#if defined(CONFIG_BLK_DEV_IO_TRACE)
146extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); 146extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
147extern void blk_trace_shutdown(request_queue_t *); 147extern void blk_trace_shutdown(struct request_queue *);
148extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); 148extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *);
149 149
150/** 150/**
@@ -272,6 +272,7 @@ static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
272 return; 272 return;
273 273
274 r.device = cpu_to_be32(dev); 274 r.device = cpu_to_be32(dev);
275 r.device_from = cpu_to_be32(bio->bi_bdev->bd_dev);
275 r.sector = cpu_to_be64(to); 276 r.sector = cpu_to_be64(to);
276 277
277 __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); 278 __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r);
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index 8547b10c388b..60e377b520f8 100644
--- a/include/linux/bsg.h
+++ b/include/linux/bsg.h
@@ -15,14 +15,18 @@ struct sg_io_v4 {
15 15
16 __u32 request_len; /* [i] in bytes */ 16 __u32 request_len; /* [i] in bytes */
17 __u64 request; /* [i], [*i] {SCSI: cdb} */ 17 __u64 request; /* [i], [*i] {SCSI: cdb} */
18 __u64 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
18 __u32 request_attr; /* [i] {SCSI: task attribute} */ 19 __u32 request_attr; /* [i] {SCSI: task attribute} */
19 __u32 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
20 __u32 request_priority; /* [i] {SCSI: task priority} */ 20 __u32 request_priority; /* [i] {SCSI: task priority} */
21 __u32 request_extra; /* [i] {spare, for padding} */
21 __u32 max_response_len; /* [i] in bytes */ 22 __u32 max_response_len; /* [i] in bytes */
22 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */ 23 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */
23 24
24 /* "din_" for data in (from device); "dout_" for data out (to device) */ 25 /* "dout_": data out (to device); "din_": data in (from device) */
26 __u32 dout_iovec_count; /* [i] 0 -> "flat" dout transfer else
27 dout_xfer points to array of iovec */
25 __u32 dout_xfer_len; /* [i] bytes to be transferred to device */ 28 __u32 dout_xfer_len; /* [i] bytes to be transferred to device */
29 __u32 din_iovec_count; /* [i] 0 -> "flat" din transfer */
26 __u32 din_xfer_len; /* [i] bytes to be transferred from device */ 30 __u32 din_xfer_len; /* [i] bytes to be transferred from device */
27 __u64 dout_xferp; /* [i], [*i] */ 31 __u64 dout_xferp; /* [i], [*i] */
28 __u64 din_xferp; /* [i], [*o] */ 32 __u64 din_xferp; /* [i], [*o] */
@@ -39,8 +43,9 @@ struct sg_io_v4 {
39 __u32 info; /* [o] additional information */ 43 __u32 info; /* [o] additional information */
40 __u32 duration; /* [o] time to complete, in milliseconds */ 44 __u32 duration; /* [o] time to complete, in milliseconds */
41 __u32 response_len; /* [o] bytes of response actually written */ 45 __u32 response_len; /* [o] bytes of response actually written */
42 __s32 din_resid; /* [o] actual_din_xfer_len - din_xfer_len */ 46 __s32 din_resid; /* [o] din_xfer_len - actual_din_xfer_len */
43 __u32 generated_tag; /* [o] {SCSI: task tag that transport chose} */ 47 __s32 dout_resid; /* [o] dout_xfer_len - actual_dout_xfer_len */
48 __u64 generated_tag; /* [o] {SCSI: transport generated task tag} */
44 __u32 spare_out; /* [o] */ 49 __u32 spare_out; /* [o] */
45 50
46 __u32 padding; 51 __u32 padding;
@@ -53,15 +58,19 @@ struct bsg_class_device {
53 struct class_device *class_dev; 58 struct class_device *class_dev;
54 struct device *dev; 59 struct device *dev;
55 int minor; 60 int minor;
56 struct list_head list;
57 struct request_queue *queue; 61 struct request_queue *queue;
58}; 62};
59 63
60extern int bsg_register_queue(struct request_queue *, const char *); 64extern int bsg_register_queue(struct request_queue *, struct device *, const char *);
61extern void bsg_unregister_queue(struct request_queue *); 65extern void bsg_unregister_queue(struct request_queue *);
62#else 66#else
63#define bsg_register_queue(disk, name) (0) 67static inline int bsg_register_queue(struct request_queue * rq, struct device *dev, const char *name)
64#define bsg_unregister_queue(disk) do { } while (0) 68{
69 return 0;
70}
71static inline void bsg_unregister_queue(struct request_queue *rq)
72{
73}
65#endif 74#endif
66 75
67#endif /* __KERNEL__ */ 76#endif /* __KERNEL__ */
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 5c6e12853a9b..35cadad84b14 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -209,6 +209,8 @@ int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*,
209int generic_cont_expand(struct inode *inode, loff_t size); 209int generic_cont_expand(struct inode *inode, loff_t size);
210int generic_cont_expand_simple(struct inode *inode, loff_t size); 210int generic_cont_expand_simple(struct inode *inode, loff_t size);
211int block_commit_write(struct page *page, unsigned from, unsigned to); 211int block_commit_write(struct page *page, unsigned from, unsigned to);
212int block_page_mkwrite(struct vm_area_struct *vma, struct page *page,
213 get_block_t get_block);
212void block_sync_page(struct page *); 214void block_sync_page(struct page *);
213sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); 215sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *);
214int generic_commit_write(struct file *, struct page *, unsigned, unsigned); 216int generic_commit_write(struct file *, struct page *, unsigned, unsigned);
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 8486e78f7335..def5a659b8a5 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -23,6 +23,7 @@ enum clock_event_mode {
23 CLOCK_EVT_MODE_SHUTDOWN, 23 CLOCK_EVT_MODE_SHUTDOWN,
24 CLOCK_EVT_MODE_PERIODIC, 24 CLOCK_EVT_MODE_PERIODIC,
25 CLOCK_EVT_MODE_ONESHOT, 25 CLOCK_EVT_MODE_ONESHOT,
26 CLOCK_EVT_MODE_RESUME,
26}; 27};
27 28
28/* Clock event notification values */ 29/* Clock event notification values */
@@ -119,14 +120,9 @@ extern void clockevents_register_device(struct clock_event_device *dev);
119 120
120extern void clockevents_exchange_device(struct clock_event_device *old, 121extern void clockevents_exchange_device(struct clock_event_device *old,
121 struct clock_event_device *new); 122 struct clock_event_device *new);
122extern
123struct clock_event_device *clockevents_request_device(unsigned int features,
124 cpumask_t cpumask);
125extern void clockevents_release_device(struct clock_event_device *dev);
126extern void clockevents_set_mode(struct clock_event_device *dev, 123extern void clockevents_set_mode(struct clock_event_device *dev,
127 enum clock_event_mode mode); 124 enum clock_event_mode mode);
128extern int clockevents_register_notifier(struct notifier_block *nb); 125extern int clockevents_register_notifier(struct notifier_block *nb);
129extern void clockevents_unregister_notifier(struct notifier_block *nb);
130extern int clockevents_program_event(struct clock_event_device *dev, 126extern int clockevents_program_event(struct clock_event_device *dev,
131 ktime_t expires, ktime_t now); 127 ktime_t expires, ktime_t now);
132 128
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index bf297b03a4e4..16ea3374dddf 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -67,6 +67,12 @@ struct clocksource {
67 unsigned long flags; 67 unsigned long flags;
68 cycle_t (*vread)(void); 68 cycle_t (*vread)(void);
69 void (*resume)(void); 69 void (*resume)(void);
70#ifdef CONFIG_IA64
71 void *fsys_mmio; /* used by fsyscall asm code */
72#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr))
73#else
74#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0)
75#endif
70 76
71 /* timekeeping specific data, ignore */ 77 /* timekeeping specific data, ignore */
72 cycle_t cycle_interval; 78 cycle_t cycle_interval;
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index e4ac016ad272..1c47a34aa794 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -36,16 +36,12 @@ 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, fl_owner_t id);
40int coda_release(struct inode *i, struct file *f); 39int coda_release(struct inode *i, struct file *f);
41int coda_permission(struct inode *inode, int mask, struct nameidata *nd); 40int coda_permission(struct inode *inode, int mask, struct nameidata *nd);
42int coda_revalidate_inode(struct dentry *); 41int coda_revalidate_inode(struct dentry *);
43int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); 42int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *);
44int coda_setattr(struct dentry *, struct iattr *); 43int coda_setattr(struct dentry *, struct iattr *);
45 44
46/* global variables */
47extern int coda_fake_statfs;
48
49/* this file: heloers */ 45/* this file: heloers */
50static __inline__ struct CodaFid *coda_i2f(struct inode *); 46static __inline__ struct CodaFid *coda_i2f(struct inode *);
51static __inline__ char *coda_i2s(struct inode *); 47static __inline__ char *coda_i2s(struct inode *);
diff --git a/include/linux/coda_proc.h b/include/linux/coda_proc.h
deleted file mode 100644
index 0dc1b0458e75..000000000000
--- a/include/linux/coda_proc.h
+++ /dev/null
@@ -1,76 +0,0 @@
1/*
2 * coda_statis.h
3 *
4 * CODA operation statistics
5 *
6 * (c) March, 1998
7 * by Michihiro Kuramochi, Zhenyu Xia and Zhanyong Wan
8 * zhanyong.wan@yale.edu
9 *
10 */
11
12#ifndef _CODA_PROC_H
13#define _CODA_PROC_H
14
15void coda_sysctl_init(void);
16void coda_sysctl_clean(void);
17
18#include <linux/sysctl.h>
19#include <linux/coda_fs_i.h>
20#include <linux/coda.h>
21
22/* these four files are presented to show the result of the statistics:
23 *
24 * /proc/fs/coda/vfs_stats
25 * cache_inv_stats
26 *
27 * these four files are presented to reset the statistics to 0:
28 *
29 * /proc/sys/coda/vfs_stats
30 * cache_inv_stats
31 */
32
33/* VFS operation statistics */
34struct coda_vfs_stats
35{
36 /* file operations */
37 int open;
38 int flush;
39 int release;
40 int fsync;
41
42 /* dir operations */
43 int readdir;
44
45 /* inode operations */
46 int create;
47 int lookup;
48 int link;
49 int unlink;
50 int symlink;
51 int mkdir;
52 int rmdir;
53 int rename;
54 int permission;
55
56 /* symlink operatoins*/
57 int follow_link;
58 int readlink;
59};
60
61/* cache invalidation statistics */
62struct coda_cache_inv_stats
63{
64 int flush;
65 int purge_user;
66 int zap_dir;
67 int zap_file;
68 int zap_vnode;
69 int purge_fid;
70 int replace;
71};
72
73/* these global variables hold the actual statistics data */
74extern struct coda_vfs_stats coda_vfs_stat;
75
76#endif /* _CODA_PROC_H */
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index b541bb3d1f4b..07ae8f846055 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -8,11 +8,6 @@
8 8
9struct kstatfs; 9struct kstatfs;
10 10
11struct coda_sb_info
12{
13 struct venus_comm *sbi_vcomm;
14};
15
16/* communication pending/processing queues */ 11/* communication pending/processing queues */
17struct venus_comm { 12struct venus_comm {
18 u_long vc_seq; 13 u_long vc_seq;
@@ -24,9 +19,9 @@ struct venus_comm {
24}; 19};
25 20
26 21
27static inline struct coda_sb_info *coda_sbp(struct super_block *sb) 22static inline struct venus_comm *coda_vcp(struct super_block *sb)
28{ 23{
29 return ((struct coda_sb_info *)((sb)->s_fs_info)); 24 return (struct venus_comm *)((sb)->s_fs_info);
30} 25}
31 26
32 27
@@ -38,9 +33,6 @@ int venus_setattr(struct super_block *, struct CodaFid *, struct coda_vattr *);
38int venus_lookup(struct super_block *sb, struct CodaFid *fid, 33int venus_lookup(struct super_block *sb, struct CodaFid *fid,
39 const char *name, int length, int *type, 34 const char *name, int length, int *type,
40 struct CodaFid *resfid); 35 struct CodaFid *resfid);
41int venus_store(struct super_block *sb, struct CodaFid *fid, int flags,
42 vuid_t uid);
43int venus_release(struct super_block *sb, struct CodaFid *fid, int flags);
44int venus_close(struct super_block *sb, struct CodaFid *fid, int flags, 36int venus_close(struct super_block *sb, struct CodaFid *fid, int flags,
45 vuid_t uid); 37 vuid_t uid);
46int venus_open(struct super_block *sb, struct CodaFid *fid, int flags, 38int venus_open(struct super_block *sb, struct CodaFid *fid, int flags,
@@ -74,8 +66,6 @@ int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
74 66
75 67
76/* messages between coda filesystem in kernel and Venus */ 68/* messages between coda filesystem in kernel and Venus */
77extern int coda_hard;
78extern unsigned long coda_timeout;
79struct upc_req { 69struct upc_req {
80 struct list_head uc_chain; 70 struct list_head uc_chain;
81 caddr_t uc_data; 71 caddr_t uc_data;
@@ -85,7 +75,6 @@ struct upc_req {
85 u_short uc_opcode; /* copied from data to save lookup */ 75 u_short uc_opcode; /* copied from data to save lookup */
86 int uc_unique; 76 int uc_unique;
87 wait_queue_head_t uc_sleep; /* process' wait queue */ 77 wait_queue_head_t uc_sleep; /* process' wait queue */
88 unsigned long uc_posttime;
89}; 78};
90 79
91#define REQ_ASYNC 0x1 80#define REQ_ASYNC 0x1
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index a03e9398a6c2..14f7494280f0 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -23,3 +23,21 @@
23 * code 23 * code
24 */ 24 */
25#define uninitialized_var(x) x = x 25#define uninitialized_var(x) x = x
26
27#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 3)
28/* Mark functions as cold. gcc will assume any path leading to a call
29 to them will be unlikely. This means a lot of manual unlikely()s
30 are unnecessary now for any paths leading to the usual suspects
31 like BUG(), printk(), panic() etc. [but let's keep them for now for
32 older compilers]
33
34 Early snapshots of gcc 4.3 don't support this and we can't detect this
35 in the preprocessor, but we can live with this because they're unreleased.
36 Maketime probing would be overkill here.
37
38 gcc also has a __attribute__((__hot__)) to move hot functions into
39 a special section, but I don't see any sense in this right now in
40 the kernel context */
41#define __cold __attribute__((__cold__))
42
43#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 8287a72bb6a9..86f9a3a6137d 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -15,8 +15,8 @@
15# define __acquire(x) __context__(x,1) 15# define __acquire(x) __context__(x,1)
16# define __release(x) __context__(x,-1) 16# define __release(x) __context__(x,-1)
17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) 17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
18extern void __chk_user_ptr(const void __user *); 18extern void __chk_user_ptr(const volatile void __user *);
19extern void __chk_io_ptr(const void __iomem *); 19extern void __chk_io_ptr(const volatile void __iomem *);
20#else 20#else
21# define __user 21# define __user
22# define __kernel 22# define __kernel
@@ -174,4 +174,13 @@ extern void __chk_io_ptr(const void __iomem *);
174# define __attribute_const__ /* unimplemented */ 174# define __attribute_const__ /* unimplemented */
175#endif 175#endif
176 176
177/*
178 * Tell gcc if a function is cold. The compiler will assume any path
179 * directly leading to the call is unlikely.
180 */
181
182#ifndef __cold
183#define __cold
184#endif
185
177#endif /* __LINUX_COMPILER_H */ 186#endif /* __LINUX_COMPILER_H */
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index c2236bbff412..0ad72c4cf312 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -41,8 +41,6 @@ extern void cpu_remove_sysdev_attr(struct sysdev_attribute *attr);
41extern int cpu_add_sysdev_attr_group(struct attribute_group *attrs); 41extern int cpu_add_sysdev_attr_group(struct attribute_group *attrs);
42extern void cpu_remove_sysdev_attr_group(struct attribute_group *attrs); 42extern void cpu_remove_sysdev_attr_group(struct attribute_group *attrs);
43 43
44extern struct sysdev_attribute attr_sched_mc_power_savings;
45extern struct sysdev_attribute attr_sched_smt_power_savings;
46extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls); 44extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls);
47 45
48#ifdef CONFIG_HOTPLUG_CPU 46#ifdef CONFIG_HOTPLUG_CPU
@@ -128,16 +126,16 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
128static inline int cpu_is_offline(int cpu) { return 0; } 126static inline int cpu_is_offline(int cpu) { return 0; }
129#endif /* CONFIG_HOTPLUG_CPU */ 127#endif /* CONFIG_HOTPLUG_CPU */
130 128
131#ifdef CONFIG_SUSPEND_SMP 129#ifdef CONFIG_PM_SLEEP_SMP
132extern int suspend_cpu_hotplug; 130extern int suspend_cpu_hotplug;
133 131
134extern int disable_nonboot_cpus(void); 132extern int disable_nonboot_cpus(void);
135extern void enable_nonboot_cpus(void); 133extern void enable_nonboot_cpus(void);
136#else 134#else /* !CONFIG_PM_SLEEP_SMP */
137#define suspend_cpu_hotplug 0 135#define suspend_cpu_hotplug 0
138 136
139static inline int disable_nonboot_cpus(void) { return 0; } 137static inline int disable_nonboot_cpus(void) { return 0; }
140static inline void enable_nonboot_cpus(void) {} 138static inline void enable_nonboot_cpus(void) {}
141#endif 139#endif /* !CONFIG_PM_SLEEP_SMP */
142 140
143#endif /* _LINUX_CPU_H_ */ 141#endif /* _LINUX_CPU_H_ */
diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h
index 0fe7cdf326f7..98c69ab80c84 100644
--- a/include/linux/dcookies.h
+++ b/include/linux/dcookies.h
@@ -12,6 +12,7 @@
12 12
13#ifdef CONFIG_PROFILING 13#ifdef CONFIG_PROFILING
14 14
15#include <linux/dcache.h>
15#include <linux/types.h> 16#include <linux/types.h>
16 17
17struct dcookie_user; 18struct dcookie_user;
diff --git a/include/linux/device.h b/include/linux/device.h
index be2debed70d2..3a38d1f70cb7 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -551,6 +551,9 @@ extern void put_device(struct device * dev);
551/* drivers/base/power/shutdown.c */ 551/* drivers/base/power/shutdown.c */
552extern void device_shutdown(void); 552extern void device_shutdown(void);
553 553
554/* drivers/base/sys.c */
555extern void sysdev_shutdown(void);
556
554 557
555/* drivers/base/firmware.c */ 558/* drivers/base/firmware.c */
556extern int __must_check firmware_register(struct kset *); 559extern int __must_check firmware_register(struct kset *);
@@ -572,6 +575,16 @@ dev_dbg(struct device * dev, const char * fmt, ...)
572} 575}
573#endif 576#endif
574 577
578#ifdef VERBOSE_DEBUG
579#define dev_vdbg dev_dbg
580#else
581static inline int __attribute__ ((format (printf, 2, 3)))
582dev_vdbg(struct device * dev, const char * fmt, ...)
583{
584 return 0;
585}
586#endif
587
575#define dev_err(dev, format, arg...) \ 588#define dev_err(dev, format, arg...) \
576 dev_printk(KERN_ERR , dev , format , ## arg) 589 dev_printk(KERN_ERR , dev , format , ## arg)
577#define dev_info(dev, format, arg...) \ 590#define dev_info(dev, format, arg...) \
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h
index 93e4c3a6d190..50839fe9e39e 100644
--- a/include/linux/dvb/video.h
+++ b/include/linux/dvb/video.h
@@ -29,6 +29,7 @@
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30#include <linux/types.h> 30#include <linux/types.h>
31#else 31#else
32#include <asm/types.h>
32#include <stdint.h> 33#include <stdint.h>
33#include <time.h> 34#include <time.h>
34#endif 35#endif
diff --git a/include/linux/edac.h b/include/linux/edac.h
new file mode 100644
index 000000000000..eab451e69a91
--- /dev/null
+++ b/include/linux/edac.h
@@ -0,0 +1,29 @@
1/*
2 * Generic EDAC defs
3 *
4 * Author: Dave Jiang <djiang@mvista.com>
5 *
6 * 2006-2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 *
11 */
12#ifndef _LINUX_EDAC_H_
13#define _LINUX_EDAC_H_
14
15#include <asm/atomic.h>
16
17#define EDAC_OPSTATE_INVAL -1
18#define EDAC_OPSTATE_POLL 0
19#define EDAC_OPSTATE_NMI 1
20#define EDAC_OPSTATE_INT 2
21
22extern int edac_op_state;
23extern int edac_err_assert;
24extern atomic_t edac_handlers;
25
26extern int edac_handler_set(void);
27extern void edac_atomic_assert_error(void);
28
29#endif
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index e88fcbc77f8f..e8f42133a616 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -5,29 +5,29 @@
5 5
6#ifdef CONFIG_BLOCK 6#ifdef CONFIG_BLOCK
7 7
8typedef int (elevator_merge_fn) (request_queue_t *, struct request **, 8typedef int (elevator_merge_fn) (struct request_queue *, struct request **,
9 struct bio *); 9 struct bio *);
10 10
11typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); 11typedef void (elevator_merge_req_fn) (struct request_queue *, struct request *, struct request *);
12 12
13typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int); 13typedef void (elevator_merged_fn) (struct request_queue *, struct request *, int);
14 14
15typedef int (elevator_allow_merge_fn) (request_queue_t *, struct request *, struct bio *); 15typedef int (elevator_allow_merge_fn) (struct request_queue *, struct request *, struct bio *);
16 16
17typedef int (elevator_dispatch_fn) (request_queue_t *, int); 17typedef int (elevator_dispatch_fn) (struct request_queue *, int);
18 18
19typedef void (elevator_add_req_fn) (request_queue_t *, struct request *); 19typedef void (elevator_add_req_fn) (struct request_queue *, struct request *);
20typedef int (elevator_queue_empty_fn) (request_queue_t *); 20typedef int (elevator_queue_empty_fn) (struct request_queue *);
21typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); 21typedef struct request *(elevator_request_list_fn) (struct request_queue *, struct request *);
22typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); 22typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *);
23typedef int (elevator_may_queue_fn) (request_queue_t *, int); 23typedef int (elevator_may_queue_fn) (struct request_queue *, int);
24 24
25typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t); 25typedef int (elevator_set_req_fn) (struct request_queue *, struct request *, gfp_t);
26typedef void (elevator_put_req_fn) (struct request *); 26typedef void (elevator_put_req_fn) (struct request *);
27typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); 27typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *);
28typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 28typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *);
29 29
30typedef void *(elevator_init_fn) (request_queue_t *); 30typedef void *(elevator_init_fn) (struct request_queue *);
31typedef void (elevator_exit_fn) (elevator_t *); 31typedef void (elevator_exit_fn) (elevator_t *);
32 32
33struct elevator_ops 33struct elevator_ops
@@ -94,27 +94,27 @@ struct elevator_queue
94/* 94/*
95 * block elevator interface 95 * block elevator interface
96 */ 96 */
97extern void elv_dispatch_sort(request_queue_t *, struct request *); 97extern void elv_dispatch_sort(struct request_queue *, struct request *);
98extern void elv_dispatch_add_tail(request_queue_t *, struct request *); 98extern void elv_dispatch_add_tail(struct request_queue *, struct request *);
99extern void elv_add_request(request_queue_t *, struct request *, int, int); 99extern void elv_add_request(struct request_queue *, struct request *, int, int);
100extern void __elv_add_request(request_queue_t *, struct request *, int, int); 100extern void __elv_add_request(struct request_queue *, struct request *, int, int);
101extern void elv_insert(request_queue_t *, struct request *, int); 101extern void elv_insert(struct request_queue *, struct request *, int);
102extern int elv_merge(request_queue_t *, struct request **, struct bio *); 102extern int elv_merge(struct request_queue *, struct request **, struct bio *);
103extern void elv_merge_requests(request_queue_t *, struct request *, 103extern void elv_merge_requests(struct request_queue *, struct request *,
104 struct request *); 104 struct request *);
105extern void elv_merged_request(request_queue_t *, struct request *, int); 105extern void elv_merged_request(struct request_queue *, struct request *, int);
106extern void elv_dequeue_request(request_queue_t *, struct request *); 106extern void elv_dequeue_request(struct request_queue *, struct request *);
107extern void elv_requeue_request(request_queue_t *, struct request *); 107extern void elv_requeue_request(struct request_queue *, struct request *);
108extern int elv_queue_empty(request_queue_t *); 108extern int elv_queue_empty(struct request_queue *);
109extern struct request *elv_next_request(struct request_queue *q); 109extern struct request *elv_next_request(struct request_queue *q);
110extern struct request *elv_former_request(request_queue_t *, struct request *); 110extern struct request *elv_former_request(struct request_queue *, struct request *);
111extern struct request *elv_latter_request(request_queue_t *, struct request *); 111extern struct request *elv_latter_request(struct request_queue *, struct request *);
112extern int elv_register_queue(request_queue_t *q); 112extern int elv_register_queue(struct request_queue *q);
113extern void elv_unregister_queue(request_queue_t *q); 113extern void elv_unregister_queue(struct request_queue *q);
114extern int elv_may_queue(request_queue_t *, int); 114extern int elv_may_queue(struct request_queue *, int);
115extern void elv_completed_request(request_queue_t *, struct request *); 115extern void elv_completed_request(struct request_queue *, struct request *);
116extern int elv_set_request(request_queue_t *, struct request *, gfp_t); 116extern int elv_set_request(struct request_queue *, struct request *, gfp_t);
117extern void elv_put_request(request_queue_t *, struct request *); 117extern void elv_put_request(struct request_queue *, struct request *);
118 118
119/* 119/*
120 * io scheduler registration 120 * io scheduler registration
@@ -125,18 +125,18 @@ extern void elv_unregister(struct elevator_type *);
125/* 125/*
126 * io scheduler sysfs switching 126 * io scheduler sysfs switching
127 */ 127 */
128extern ssize_t elv_iosched_show(request_queue_t *, char *); 128extern ssize_t elv_iosched_show(struct request_queue *, char *);
129extern ssize_t elv_iosched_store(request_queue_t *, const char *, size_t); 129extern ssize_t elv_iosched_store(struct request_queue *, const char *, size_t);
130 130
131extern int elevator_init(request_queue_t *, char *); 131extern int elevator_init(struct request_queue *, char *);
132extern void elevator_exit(elevator_t *); 132extern void elevator_exit(elevator_t *);
133extern int elv_rq_merge_ok(struct request *, struct bio *); 133extern int elv_rq_merge_ok(struct request *, struct bio *);
134 134
135/* 135/*
136 * Helper functions. 136 * Helper functions.
137 */ 137 */
138extern struct request *elv_rb_former_request(request_queue_t *, struct request *); 138extern struct request *elv_rb_former_request(struct request_queue *, struct request *);
139extern struct request *elv_rb_latter_request(request_queue_t *, struct request *); 139extern struct request *elv_rb_latter_request(struct request_queue *, struct request *);
140 140
141/* 141/*
142 * rb support functions. 142 * rb support functions.
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h
index 0311bad838b1..5834e843a946 100644
--- a/include/linux/elf-em.h
+++ b/include/linux/elf-em.h
@@ -20,7 +20,8 @@
20#define EM_PARISC 15 /* HPPA */ 20#define EM_PARISC 15 /* HPPA */
21#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ 21#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
22#define EM_PPC 20 /* PowerPC */ 22#define EM_PPC 20 /* PowerPC */
23#define EM_PPC64 21 /* PowerPC64 */ 23#define EM_PPC64 21 /* PowerPC64 */
24#define EM_SPU 23 /* Cell BE SPU */
24#define EM_SH 42 /* SuperH */ 25#define EM_SH 42 /* SuperH */
25#define EM_SPARCV9 43 /* SPARC v9 64-bit */ 26#define EM_SPARCV9 43 /* SPARC v9 64-bit */
26#define EM_IA_64 50 /* HP/Intel IA-64 */ 27#define EM_IA_64 50 /* HP/Intel IA-64 */
diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h
index 9a1e0674e56c..e831759b2fb5 100644
--- a/include/linux/elfnote.h
+++ b/include/linux/elfnote.h
@@ -38,17 +38,25 @@
38 * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two") 38 * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two")
39 * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef) 39 * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef)
40 */ 40 */
41#define ELFNOTE(name, type, desctype, descdata) \ 41#define ELFNOTE_START(name, type, flags) \
42.pushsection .note.name, "",@note ; \ 42.pushsection .note.name, flags,@note ; \
43 .align 4 ; \ 43 .balign 4 ; \
44 .long 2f - 1f /* namesz */ ; \ 44 .long 2f - 1f /* namesz */ ; \
45 .long 4f - 3f /* descsz */ ; \ 45 .long 4484f - 3f /* descsz */ ; \
46 .long type ; \ 46 .long type ; \
471:.asciz #name ; \ 471:.asciz #name ; \
482:.align 4 ; \ 482:.balign 4 ; \
493:desctype descdata ; \ 493:
504:.align 4 ; \ 50
51#define ELFNOTE_END \
524484:.balign 4 ; \
51.popsection ; 53.popsection ;
54
55#define ELFNOTE(name, type, desc) \
56 ELFNOTE_START(name, type, "") \
57 desc ; \
58 ELFNOTE_END
59
52#else /* !__ASSEMBLER__ */ 60#else /* !__ASSEMBLER__ */
53#include <linux/elf.h> 61#include <linux/elf.h>
54/* 62/*
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 3a632244f31b..23ccea811297 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -270,8 +270,6 @@ u32 ethtool_op_get_sg(struct net_device *dev);
270int ethtool_op_set_sg(struct net_device *dev, u32 data); 270int ethtool_op_set_sg(struct net_device *dev, u32 data);
271u32 ethtool_op_get_tso(struct net_device *dev); 271u32 ethtool_op_get_tso(struct net_device *dev);
272int ethtool_op_set_tso(struct net_device *dev, u32 data); 272int ethtool_op_set_tso(struct net_device *dev, u32 data);
273int ethtool_op_get_perm_addr(struct net_device *dev,
274 struct ethtool_perm_addr *addr, u8 *data);
275u32 ethtool_op_get_ufo(struct net_device *dev); 273u32 ethtool_op_get_ufo(struct net_device *dev);
276int ethtool_op_set_ufo(struct net_device *dev, u32 data); 274int ethtool_op_set_ufo(struct net_device *dev, u32 data);
277 275
@@ -309,7 +307,6 @@ int ethtool_op_set_ufo(struct net_device *dev, u32 data);
309 * get_strings: Return a set of strings that describe the requested objects 307 * get_strings: Return a set of strings that describe the requested objects
310 * phys_id: Identify the device 308 * phys_id: Identify the device
311 * get_stats: Return statistics about the device 309 * get_stats: Return statistics about the device
312 * get_perm_addr: Gets the permanent hardware address
313 * 310 *
314 * Description: 311 * Description:
315 * 312 *
@@ -368,7 +365,6 @@ struct ethtool_ops {
368 int (*phys_id)(struct net_device *, u32); 365 int (*phys_id)(struct net_device *, u32);
369 int (*get_stats_count)(struct net_device *); 366 int (*get_stats_count)(struct net_device *);
370 void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *); 367 void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *);
371 int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *);
372 int (*begin)(struct net_device *); 368 int (*begin)(struct net_device *);
373 void (*complete)(struct net_device *); 369 void (*complete)(struct net_device *);
374 u32 (*get_ufo)(struct net_device *); 370 u32 (*get_ufo)(struct net_device *);
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index de1f9f78625a..cdee7aaa57aa 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -71,7 +71,7 @@
71/* 71/*
72 * Maximal count of links to a file 72 * Maximal count of links to a file
73 */ 73 */
74#define EXT4_LINK_MAX 32000 74#define EXT4_LINK_MAX 65000
75 75
76/* 76/*
77 * Macro-instructions used to manage several block sizes 77 * Macro-instructions used to manage several block sizes
@@ -102,6 +102,7 @@
102 EXT4_GOOD_OLD_FIRST_INO : \ 102 EXT4_GOOD_OLD_FIRST_INO : \
103 (s)->s_first_ino) 103 (s)->s_first_ino)
104#endif 104#endif
105#define EXT4_BLOCK_ALIGN(size, blkbits) ALIGN((size), (1 << (blkbits)))
105 106
106/* 107/*
107 * Macro-instructions used to manage fragments 108 * Macro-instructions used to manage fragments
@@ -201,6 +202,7 @@ struct ext4_group_desc
201#define EXT4_STATE_JDATA 0x00000001 /* journaled data exists */ 202#define EXT4_STATE_JDATA 0x00000001 /* journaled data exists */
202#define EXT4_STATE_NEW 0x00000002 /* inode is newly created */ 203#define EXT4_STATE_NEW 0x00000002 /* inode is newly created */
203#define EXT4_STATE_XATTR 0x00000004 /* has in-inode xattrs */ 204#define EXT4_STATE_XATTR 0x00000004 /* has in-inode xattrs */
205#define EXT4_STATE_NO_EXPAND 0x00000008 /* No space for expansion */
204 206
205/* Used to pass group descriptor data when online resize is done */ 207/* Used to pass group descriptor data when online resize is done */
206struct ext4_new_group_input { 208struct ext4_new_group_input {
@@ -225,6 +227,11 @@ struct ext4_new_group_data {
225 __u32 free_blocks_count; 227 __u32 free_blocks_count;
226}; 228};
227 229
230/*
231 * Following is used by preallocation code to tell get_blocks() that we
232 * want uninitialzed extents.
233 */
234#define EXT4_CREATE_UNINITIALIZED_EXT 2
228 235
229/* 236/*
230 * ioctl commands 237 * ioctl commands
@@ -237,7 +244,7 @@ struct ext4_new_group_data {
237#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input) 244#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input)
238#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION 245#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION
239#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION 246#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION
240#ifdef CONFIG_JBD_DEBUG 247#ifdef CONFIG_JBD2_DEBUG
241#define EXT4_IOC_WAIT_FOR_READONLY _IOR('f', 99, long) 248#define EXT4_IOC_WAIT_FOR_READONLY _IOR('f', 99, long)
242#endif 249#endif
243#define EXT4_IOC_GETRSVSZ _IOR('f', 5, long) 250#define EXT4_IOC_GETRSVSZ _IOR('f', 5, long)
@@ -253,7 +260,7 @@ struct ext4_new_group_data {
253#define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int) 260#define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int)
254#define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int) 261#define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int)
255#define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int) 262#define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
256#ifdef CONFIG_JBD_DEBUG 263#ifdef CONFIG_JBD2_DEBUG
257#define EXT4_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int) 264#define EXT4_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int)
258#endif 265#endif
259#define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION 266#define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
@@ -282,7 +289,7 @@ struct ext4_inode {
282 __le16 i_uid; /* Low 16 bits of Owner Uid */ 289 __le16 i_uid; /* Low 16 bits of Owner Uid */
283 __le32 i_size; /* Size in bytes */ 290 __le32 i_size; /* Size in bytes */
284 __le32 i_atime; /* Access time */ 291 __le32 i_atime; /* Access time */
285 __le32 i_ctime; /* Creation time */ 292 __le32 i_ctime; /* Inode Change time */
286 __le32 i_mtime; /* Modification time */ 293 __le32 i_mtime; /* Modification time */
287 __le32 i_dtime; /* Deletion Time */ 294 __le32 i_dtime; /* Deletion Time */
288 __le16 i_gid; /* Low 16 bits of Group Id */ 295 __le16 i_gid; /* Low 16 bits of Group Id */
@@ -331,10 +338,85 @@ struct ext4_inode {
331 } osd2; /* OS dependent 2 */ 338 } osd2; /* OS dependent 2 */
332 __le16 i_extra_isize; 339 __le16 i_extra_isize;
333 __le16 i_pad1; 340 __le16 i_pad1;
341 __le32 i_ctime_extra; /* extra Change time (nsec << 2 | epoch) */
342 __le32 i_mtime_extra; /* extra Modification time(nsec << 2 | epoch) */
343 __le32 i_atime_extra; /* extra Access time (nsec << 2 | epoch) */
344 __le32 i_crtime; /* File Creation time */
345 __le32 i_crtime_extra; /* extra FileCreationtime (nsec << 2 | epoch) */
334}; 346};
335 347
336#define i_size_high i_dir_acl 348#define i_size_high i_dir_acl
337 349
350#define EXT4_EPOCH_BITS 2
351#define EXT4_EPOCH_MASK ((1 << EXT4_EPOCH_BITS) - 1)
352#define EXT4_NSEC_MASK (~0UL << EXT4_EPOCH_BITS)
353
354/*
355 * Extended fields will fit into an inode if the filesystem was formatted
356 * with large inodes (-I 256 or larger) and there are not currently any EAs
357 * consuming all of the available space. For new inodes we always reserve
358 * enough space for the kernel's known extended fields, but for inodes
359 * created with an old kernel this might not have been the case. None of
360 * the extended inode fields is critical for correct filesystem operation.
361 * This macro checks if a certain field fits in the inode. Note that
362 * inode-size = GOOD_OLD_INODE_SIZE + i_extra_isize
363 */
364#define EXT4_FITS_IN_INODE(ext4_inode, einode, field) \
365 ((offsetof(typeof(*ext4_inode), field) + \
366 sizeof((ext4_inode)->field)) \
367 <= (EXT4_GOOD_OLD_INODE_SIZE + \
368 (einode)->i_extra_isize)) \
369
370static inline __le32 ext4_encode_extra_time(struct timespec *time)
371{
372 return cpu_to_le32((sizeof(time->tv_sec) > 4 ?
373 time->tv_sec >> 32 : 0) |
374 ((time->tv_nsec << 2) & EXT4_NSEC_MASK));
375}
376
377static inline void ext4_decode_extra_time(struct timespec *time, __le32 extra)
378{
379 if (sizeof(time->tv_sec) > 4)
380 time->tv_sec |= (__u64)(le32_to_cpu(extra) & EXT4_EPOCH_MASK)
381 << 32;
382 time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> 2;
383}
384
385#define EXT4_INODE_SET_XTIME(xtime, inode, raw_inode) \
386do { \
387 (raw_inode)->xtime = cpu_to_le32((inode)->xtime.tv_sec); \
388 if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \
389 (raw_inode)->xtime ## _extra = \
390 ext4_encode_extra_time(&(inode)->xtime); \
391} while (0)
392
393#define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode) \
394do { \
395 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
396 (raw_inode)->xtime = cpu_to_le32((einode)->xtime.tv_sec); \
397 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \
398 (raw_inode)->xtime ## _extra = \
399 ext4_encode_extra_time(&(einode)->xtime); \
400} while (0)
401
402#define EXT4_INODE_GET_XTIME(xtime, inode, raw_inode) \
403do { \
404 (inode)->xtime.tv_sec = (signed)le32_to_cpu((raw_inode)->xtime); \
405 if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \
406 ext4_decode_extra_time(&(inode)->xtime, \
407 raw_inode->xtime ## _extra); \
408} while (0)
409
410#define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \
411do { \
412 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
413 (einode)->xtime.tv_sec = \
414 (signed)le32_to_cpu((raw_inode)->xtime); \
415 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \
416 ext4_decode_extra_time(&(einode)->xtime, \
417 raw_inode->xtime ## _extra); \
418} while (0)
419
338#if defined(__KERNEL__) || defined(__linux__) 420#if defined(__KERNEL__) || defined(__linux__)
339#define i_reserved1 osd1.linux1.l_i_reserved1 421#define i_reserved1 osd1.linux1.l_i_reserved1
340#define i_frag osd2.linux2.l_i_frag 422#define i_frag osd2.linux2.l_i_frag
@@ -533,6 +615,13 @@ static inline struct ext4_inode_info *EXT4_I(struct inode *inode)
533 return container_of(inode, struct ext4_inode_info, vfs_inode); 615 return container_of(inode, struct ext4_inode_info, vfs_inode);
534} 616}
535 617
618static inline struct timespec ext4_current_time(struct inode *inode)
619{
620 return (inode->i_sb->s_time_gran < NSEC_PER_SEC) ?
621 current_fs_time(inode->i_sb) : CURRENT_TIME_SEC;
622}
623
624
536static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) 625static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
537{ 626{
538 return ino == EXT4_ROOT_INO || 627 return ino == EXT4_ROOT_INO ||
@@ -603,6 +692,8 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
603#define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 692#define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
604#define EXT4_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 693#define EXT4_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
605#define EXT4_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 694#define EXT4_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
695#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020
696#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040
606 697
607#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001 698#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001
608#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002 699#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002
@@ -620,6 +711,8 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
620 EXT4_FEATURE_INCOMPAT_64BIT) 711 EXT4_FEATURE_INCOMPAT_64BIT)
621#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ 712#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
622 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ 713 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
714 EXT4_FEATURE_RO_COMPAT_DIR_NLINK | \
715 EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE | \
623 EXT4_FEATURE_RO_COMPAT_BTREE_DIR) 716 EXT4_FEATURE_RO_COMPAT_BTREE_DIR)
624 717
625/* 718/*
@@ -862,6 +955,7 @@ extern int ext4_change_inode_journal_flag(struct inode *, int);
862extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); 955extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *);
863extern void ext4_truncate (struct inode *); 956extern void ext4_truncate (struct inode *);
864extern void ext4_set_inode_flags(struct inode *); 957extern void ext4_set_inode_flags(struct inode *);
958extern void ext4_get_inode_flags(struct ext4_inode_info *);
865extern void ext4_set_aops(struct inode *inode); 959extern void ext4_set_aops(struct inode *inode);
866extern int ext4_writepage_trans_blocks(struct inode *); 960extern int ext4_writepage_trans_blocks(struct inode *);
867extern int ext4_block_truncate_page(handle_t *handle, struct page *page, 961extern int ext4_block_truncate_page(handle_t *handle, struct page *page,
@@ -983,6 +1077,8 @@ extern int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
983extern void ext4_ext_truncate(struct inode *, struct page *); 1077extern void ext4_ext_truncate(struct inode *, struct page *);
984extern void ext4_ext_init(struct super_block *); 1078extern void ext4_ext_init(struct super_block *);
985extern void ext4_ext_release(struct super_block *); 1079extern void ext4_ext_release(struct super_block *);
1080extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset,
1081 loff_t len);
986static inline int 1082static inline int
987ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block, 1083ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block,
988 unsigned long max_blocks, struct buffer_head *bh, 1084 unsigned long max_blocks, struct buffer_head *bh,
diff --git a/include/linux/ext4_fs_extents.h b/include/linux/ext4_fs_extents.h
index acfe59740b03..81406f3655d4 100644
--- a/include/linux/ext4_fs_extents.h
+++ b/include/linux/ext4_fs_extents.h
@@ -141,7 +141,25 @@ typedef int (*ext_prepare_callback)(struct inode *, struct ext4_ext_path *,
141 141
142#define EXT_MAX_BLOCK 0xffffffff 142#define EXT_MAX_BLOCK 0xffffffff
143 143
144#define EXT_MAX_LEN ((1UL << 15) - 1) 144/*
145 * EXT_INIT_MAX_LEN is the maximum number of blocks we can have in an
146 * initialized extent. This is 2^15 and not (2^16 - 1), since we use the
147 * MSB of ee_len field in the extent datastructure to signify if this
148 * particular extent is an initialized extent or an uninitialized (i.e.
149 * preallocated).
150 * EXT_UNINIT_MAX_LEN is the maximum number of blocks we can have in an
151 * uninitialized extent.
152 * If ee_len is <= 0x8000, it is an initialized extent. Otherwise, it is an
153 * uninitialized one. In other words, if MSB of ee_len is set, it is an
154 * uninitialized extent with only one special scenario when ee_len = 0x8000.
155 * In this case we can not have an uninitialized extent of zero length and
156 * thus we make it as a special case of initialized extent with 0x8000 length.
157 * This way we get better extent-to-group alignment for initialized extents.
158 * Hence, the maximum number of blocks we can have in an *initialized*
159 * extent is 2^15 (32768) and in an *uninitialized* extent is 2^15-1 (32767).
160 */
161#define EXT_INIT_MAX_LEN (1UL << 15)
162#define EXT_UNINIT_MAX_LEN (EXT_INIT_MAX_LEN - 1)
145 163
146 164
147#define EXT_FIRST_EXTENT(__hdr__) \ 165#define EXT_FIRST_EXTENT(__hdr__) \
@@ -188,8 +206,31 @@ ext4_ext_invalidate_cache(struct inode *inode)
188 EXT4_I(inode)->i_cached_extent.ec_type = EXT4_EXT_CACHE_NO; 206 EXT4_I(inode)->i_cached_extent.ec_type = EXT4_EXT_CACHE_NO;
189} 207}
190 208
209static inline void ext4_ext_mark_uninitialized(struct ext4_extent *ext)
210{
211 /* We can not have an uninitialized extent of zero length! */
212 BUG_ON((le16_to_cpu(ext->ee_len) & ~EXT_INIT_MAX_LEN) == 0);
213 ext->ee_len |= cpu_to_le16(EXT_INIT_MAX_LEN);
214}
215
216static inline int ext4_ext_is_uninitialized(struct ext4_extent *ext)
217{
218 /* Extent with ee_len of 0x8000 is treated as an initialized extent */
219 return (le16_to_cpu(ext->ee_len) > EXT_INIT_MAX_LEN);
220}
221
222static inline int ext4_ext_get_actual_len(struct ext4_extent *ext)
223{
224 return (le16_to_cpu(ext->ee_len) <= EXT_INIT_MAX_LEN ?
225 le16_to_cpu(ext->ee_len) :
226 (le16_to_cpu(ext->ee_len) - EXT_INIT_MAX_LEN));
227}
228
191extern int ext4_extent_tree_init(handle_t *, struct inode *); 229extern int ext4_extent_tree_init(handle_t *, struct inode *);
192extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *); 230extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *);
231extern int ext4_ext_try_to_merge(struct inode *inode,
232 struct ext4_ext_path *path,
233 struct ext4_extent *);
193extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *); 234extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *);
194extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *); 235extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *);
195extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *); 236extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *);
diff --git a/include/linux/ext4_fs_i.h b/include/linux/ext4_fs_i.h
index 9de494406995..1a511e9905aa 100644
--- a/include/linux/ext4_fs_i.h
+++ b/include/linux/ext4_fs_i.h
@@ -153,6 +153,11 @@ struct ext4_inode_info {
153 153
154 unsigned long i_ext_generation; 154 unsigned long i_ext_generation;
155 struct ext4_ext_cache i_cached_extent; 155 struct ext4_ext_cache i_cached_extent;
156 /*
157 * File creation time. Its function is same as that of
158 * struct timespec i_{a,c,m}time in the generic inode.
159 */
160 struct timespec i_crtime;
156}; 161};
157 162
158#endif /* _LINUX_EXT4_FS_I */ 163#endif /* _LINUX_EXT4_FS_I */
diff --git a/include/linux/ext4_fs_sb.h b/include/linux/ext4_fs_sb.h
index 2347557a327a..1b2ffee12be9 100644
--- a/include/linux/ext4_fs_sb.h
+++ b/include/linux/ext4_fs_sb.h
@@ -73,7 +73,7 @@ struct ext4_sb_info {
73 struct list_head s_orphan; 73 struct list_head s_orphan;
74 unsigned long s_commit_interval; 74 unsigned long s_commit_interval;
75 struct block_device *journal_bdev; 75 struct block_device *journal_bdev;
76#ifdef CONFIG_JBD_DEBUG 76#ifdef CONFIG_JBD2_DEBUG
77 struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */ 77 struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */
78 wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */ 78 wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */
79#endif 79#endif
@@ -81,6 +81,7 @@ struct ext4_sb_info {
81 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */ 81 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */
82 int s_jquota_fmt; /* Format of quota to use */ 82 int s_jquota_fmt; /* Format of quota to use */
83#endif 83#endif
84 unsigned int s_want_extra_isize; /* New inodes should reserve # bytes */
84 85
85#ifdef EXTENTS_STATS 86#ifdef EXTENTS_STATS
86 /* ext4 extents stats */ 87 /* ext4 extents stats */
diff --git a/include/linux/falloc.h b/include/linux/falloc.h
new file mode 100644
index 000000000000..8e912ab6a072
--- /dev/null
+++ b/include/linux/falloc.h
@@ -0,0 +1,6 @@
1#ifndef _FALLOC_H_
2#define _FALLOC_H_
3
4#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
5
6#endif /* _FALLOC_H_ */
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 2d38b1a74662..efded00ad08c 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -5,7 +5,7 @@
5 5
6#include <linux/sched.h> 6#include <linux/sched.h>
7 7
8#ifdef CONFIG_PM 8#ifdef CONFIG_PM_SLEEP
9/* 9/*
10 * Check if a process has been frozen 10 * Check if a process has been frozen
11 */ 11 */
@@ -25,7 +25,7 @@ static inline int freezing(struct task_struct *p)
25/* 25/*
26 * Request that a process be frozen 26 * Request that a process be frozen
27 */ 27 */
28static inline void freeze(struct task_struct *p) 28static inline void set_freeze_flag(struct task_struct *p)
29{ 29{
30 set_tsk_thread_flag(p, TIF_FREEZE); 30 set_tsk_thread_flag(p, TIF_FREEZE);
31} 31}
@@ -33,7 +33,7 @@ static inline void freeze(struct task_struct *p)
33/* 33/*
34 * Sometimes we may need to cancel the previous 'freeze' request 34 * Sometimes we may need to cancel the previous 'freeze' request
35 */ 35 */
36static inline void do_not_freeze(struct task_struct *p) 36static inline void clear_freeze_flag(struct task_struct *p)
37{ 37{
38 clear_tsk_thread_flag(p, TIF_FREEZE); 38 clear_tsk_thread_flag(p, TIF_FREEZE);
39} 39}
@@ -56,7 +56,7 @@ static inline int thaw_process(struct task_struct *p)
56 wake_up_process(p); 56 wake_up_process(p);
57 return 1; 57 return 1;
58 } 58 }
59 clear_tsk_thread_flag(p, TIF_FREEZE); 59 clear_freeze_flag(p);
60 task_unlock(p); 60 task_unlock(p);
61 return 0; 61 return 0;
62} 62}
@@ -126,10 +126,11 @@ static inline void set_freezable(void)
126 current->flags &= ~PF_NOFREEZE; 126 current->flags &= ~PF_NOFREEZE;
127} 127}
128 128
129#else 129#else /* !CONFIG_PM_SLEEP */
130static inline int frozen(struct task_struct *p) { return 0; } 130static inline int frozen(struct task_struct *p) { return 0; }
131static inline int freezing(struct task_struct *p) { return 0; } 131static inline int freezing(struct task_struct *p) { return 0; }
132static inline void freeze(struct task_struct *p) { BUG(); } 132static inline void set_freeze_flag(struct task_struct *p) {}
133static inline void clear_freeze_flag(struct task_struct *p) {}
133static inline int thaw_process(struct task_struct *p) { return 1; } 134static inline int thaw_process(struct task_struct *p) { return 1; }
134 135
135static inline void refrigerator(void) {} 136static inline void refrigerator(void) {}
@@ -142,6 +143,6 @@ static inline void freezer_do_not_count(void) {}
142static inline void freezer_count(void) {} 143static inline void freezer_count(void) {}
143static inline int freezer_should_skip(struct task_struct *p) { return 0; } 144static inline int freezer_should_skip(struct task_struct *p) { return 0; }
144static inline void set_freezable(void) {} 145static inline void set_freezable(void) {}
145#endif 146#endif /* !CONFIG_PM_SLEEP */
146 147
147#endif /* FREEZER_H_INCLUDED */ 148#endif /* FREEZER_H_INCLUDED */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 98205f680476..16421f662a7a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -697,20 +697,26 @@ struct fown_struct {
697 * Track a single file's readahead state 697 * Track a single file's readahead state
698 */ 698 */
699struct file_ra_state { 699struct file_ra_state {
700 unsigned long start; /* Current window */ 700 pgoff_t start; /* where readahead started */
701 unsigned long size; 701 unsigned long size; /* # of readahead pages */
702 unsigned long flags; /* ra flags RA_FLAG_xxx*/ 702 unsigned long async_size; /* do asynchronous readahead when
703 unsigned long cache_hit; /* cache hit count*/ 703 there are only # of pages ahead */
704 unsigned long prev_index; /* Cache last read() position */ 704
705 unsigned long ahead_start; /* Ahead window */
706 unsigned long ahead_size;
707 unsigned long ra_pages; /* Maximum readahead window */ 705 unsigned long ra_pages; /* Maximum readahead window */
708 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */ 706 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */
709 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */ 707 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */
708 unsigned long prev_index; /* Cache last read() position */
710 unsigned int prev_offset; /* Offset where last read() ended in a page */ 709 unsigned int prev_offset; /* Offset where last read() ended in a page */
711}; 710};
712#define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */ 711
713#define RA_FLAG_INCACHE 0x02 /* file is already in cache */ 712/*
713 * Check if @index falls in the readahead windows.
714 */
715static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index)
716{
717 return (index >= ra->start &&
718 index < ra->start + ra->size);
719}
714 720
715struct file { 721struct file {
716 /* 722 /*
@@ -862,7 +868,7 @@ extern void locks_init_lock(struct file_lock *);
862extern void locks_copy_lock(struct file_lock *, struct file_lock *); 868extern void locks_copy_lock(struct file_lock *, struct file_lock *);
863extern void locks_remove_posix(struct file *, fl_owner_t); 869extern void locks_remove_posix(struct file *, fl_owner_t);
864extern void locks_remove_flock(struct file *); 870extern void locks_remove_flock(struct file *);
865extern int posix_test_lock(struct file *, struct file_lock *); 871extern void posix_test_lock(struct file *, struct file_lock *);
866extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); 872extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
867extern int posix_lock_file_wait(struct file *, struct file_lock *); 873extern int posix_lock_file_wait(struct file *, struct file_lock *);
868extern int posix_unblock_lock(struct file *, struct file_lock *); 874extern int posix_unblock_lock(struct file *, struct file_lock *);
@@ -872,7 +878,8 @@ extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
872extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); 878extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
873extern int __break_lease(struct inode *inode, unsigned int flags); 879extern int __break_lease(struct inode *inode, unsigned int flags);
874extern void lease_get_mtime(struct inode *, struct timespec *time); 880extern void lease_get_mtime(struct inode *, struct timespec *time);
875extern int setlease(struct file *, long, struct file_lock **); 881extern int generic_setlease(struct file *, long, struct file_lock **);
882extern int vfs_setlease(struct file *, long, struct file_lock **);
876extern int lease_modify(struct file_lock **, int); 883extern int lease_modify(struct file_lock **, int);
877extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 884extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
878extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 885extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
@@ -1122,6 +1129,7 @@ struct file_operations {
1122 int (*flock) (struct file *, int, struct file_lock *); 1129 int (*flock) (struct file *, int, struct file_lock *);
1123 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); 1130 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1124 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); 1131 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
1132 int (*setlease)(struct file *, long, struct file_lock **);
1125}; 1133};
1126 1134
1127struct inode_operations { 1135struct inode_operations {
@@ -1147,6 +1155,8 @@ struct inode_operations {
1147 ssize_t (*listxattr) (struct dentry *, char *, size_t); 1155 ssize_t (*listxattr) (struct dentry *, char *, size_t);
1148 int (*removexattr) (struct dentry *, const char *); 1156 int (*removexattr) (struct dentry *, const char *);
1149 void (*truncate_range)(struct inode *, loff_t, loff_t); 1157 void (*truncate_range)(struct inode *, loff_t, loff_t);
1158 long (*fallocate)(struct inode *inode, int mode, loff_t offset,
1159 loff_t len);
1150}; 1160};
1151 1161
1152struct seq_file; 1162struct seq_file;
@@ -1459,7 +1469,7 @@ extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
1459extern int register_chrdev_region(dev_t, unsigned, const char *); 1469extern int register_chrdev_region(dev_t, unsigned, const char *);
1460extern int register_chrdev(unsigned int, const char *, 1470extern int register_chrdev(unsigned int, const char *,
1461 const struct file_operations *); 1471 const struct file_operations *);
1462extern int unregister_chrdev(unsigned int, const char *); 1472extern void unregister_chrdev(unsigned int, const char *);
1463extern void unregister_chrdev_region(dev_t, unsigned); 1473extern void unregister_chrdev_region(dev_t, unsigned);
1464extern int chrdev_open(struct inode *, struct file *); 1474extern int chrdev_open(struct inode *, struct file *);
1465extern void chrdev_show(struct seq_file *,off_t); 1475extern void chrdev_show(struct seq_file *,off_t);
@@ -1649,7 +1659,6 @@ extern int sb_min_blocksize(struct super_block *, int);
1649extern int generic_file_mmap(struct file *, struct vm_area_struct *); 1659extern int generic_file_mmap(struct file *, struct vm_area_struct *);
1650extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); 1660extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
1651extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); 1661extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
1652extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
1653int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); 1662int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
1654extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); 1663extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t);
1655extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); 1664extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t);
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 695741b0e420..1831b196c70a 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -53,6 +53,7 @@ struct gianfar_platform_data {
53 u32 bus_id; 53 u32 bus_id;
54 u32 phy_id; 54 u32 phy_id;
55 u8 mac_addr[6]; 55 u8 mac_addr[6];
56 phy_interface_t interface;
56}; 57};
57 58
58struct gianfar_mdio_data { 59struct gianfar_mdio_data {
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
index f7a93770e1be..7da02c93002b 100644
--- a/include/linux/genetlink.h
+++ b/include/linux/genetlink.h
@@ -39,6 +39,9 @@ enum {
39 CTRL_CMD_NEWOPS, 39 CTRL_CMD_NEWOPS,
40 CTRL_CMD_DELOPS, 40 CTRL_CMD_DELOPS,
41 CTRL_CMD_GETOPS, 41 CTRL_CMD_GETOPS,
42 CTRL_CMD_NEWMCAST_GRP,
43 CTRL_CMD_DELMCAST_GRP,
44 CTRL_CMD_GETMCAST_GRP, /* unused */
42 __CTRL_CMD_MAX, 45 __CTRL_CMD_MAX,
43}; 46};
44 47
@@ -52,6 +55,7 @@ enum {
52 CTRL_ATTR_HDRSIZE, 55 CTRL_ATTR_HDRSIZE,
53 CTRL_ATTR_MAXATTR, 56 CTRL_ATTR_MAXATTR,
54 CTRL_ATTR_OPS, 57 CTRL_ATTR_OPS,
58 CTRL_ATTR_MCAST_GROUPS,
55 __CTRL_ATTR_MAX, 59 __CTRL_ATTR_MAX,
56}; 60};
57 61
@@ -66,4 +70,13 @@ enum {
66 70
67#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1) 71#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
68 72
73enum {
74 CTRL_ATTR_MCAST_GRP_UNSPEC,
75 CTRL_ATTR_MCAST_GRP_NAME,
76 CTRL_ATTR_MCAST_GRP_ID,
77 __CTRL_ATTR_MCAST_GRP_MAX,
78};
79
80#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
81
69#endif /* __LINUX_GENERIC_NETLINK_H */ 82#endif /* __LINUX_GENERIC_NETLINK_H */
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 9756fc102a83..a47b8025d399 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -264,7 +264,7 @@ static inline void set_capacity(struct gendisk *disk, sector_t size)
264 264
265#ifdef CONFIG_SOLARIS_X86_PARTITION 265#ifdef CONFIG_SOLARIS_X86_PARTITION
266 266
267#define SOLARIS_X86_NUMSLICE 8 267#define SOLARIS_X86_NUMSLICE 16
268#define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL) 268#define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL)
269 269
270struct solaris_x86_slice { 270struct solaris_x86_slice {
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 12c5e4e3135a..1fcb0033179e 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -103,21 +103,6 @@ __alloc_zeroed_user_highpage(gfp_t movableflags,
103#endif 103#endif
104 104
105/** 105/**
106 * alloc_zeroed_user_highpage - Allocate a zeroed HIGHMEM page for a VMA
107 * @vma: The VMA the page is to be allocated for
108 * @vaddr: The virtual address the page will be inserted into
109 *
110 * This function will allocate a page for a VMA that the caller knows will
111 * not be able to move in the future using move_pages() or reclaim. If it
112 * is known that the page can move, use alloc_zeroed_user_highpage_movable
113 */
114static inline struct page *
115alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr)
116{
117 return __alloc_zeroed_user_highpage(0, vma, vaddr);
118}
119
120/**
121 * alloc_zeroed_user_highpage_movable - Allocate a zeroed HIGHMEM page for a VMA that the caller knows can move 106 * alloc_zeroed_user_highpage_movable - Allocate a zeroed HIGHMEM page for a VMA that the caller knows can move
122 * @vma: The VMA the page is to be allocated for 107 * @vma: The VMA the page is to be allocated for
123 * @vaddr: The virtual address the page will be inserted into 108 * @vaddr: The virtual address the page will be inserted into
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 49b7053043ad..3a19b032c0eb 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_HUGETLB_H 1#ifndef _LINUX_HUGETLB_H
2#define _LINUX_HUGETLB_H 2#define _LINUX_HUGETLB_H
3 3
4#include <linux/fs.h>
5
4#ifdef CONFIG_HUGETLB_PAGE 6#ifdef CONFIG_HUGETLB_PAGE
5 7
6#include <linux/mempolicy.h> 8#include <linux/mempolicy.h>
@@ -64,11 +66,8 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr,
64 * If the arch doesn't supply something else, assume that hugepage 66 * If the arch doesn't supply something else, assume that hugepage
65 * size aligned regions are ok without further preparation. 67 * size aligned regions are ok without further preparation.
66 */ 68 */
67static inline int prepare_hugepage_range(unsigned long addr, unsigned long len, 69static inline int prepare_hugepage_range(unsigned long addr, unsigned long len)
68 pgoff_t pgoff)
69{ 70{
70 if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT))
71 return -EINVAL;
72 if (len & ~HPAGE_MASK) 71 if (len & ~HPAGE_MASK)
73 return -EINVAL; 72 return -EINVAL;
74 if (addr & ~HPAGE_MASK) 73 if (addr & ~HPAGE_MASK)
@@ -76,8 +75,7 @@ static inline int prepare_hugepage_range(unsigned long addr, unsigned long len,
76 return 0; 75 return 0;
77} 76}
78#else 77#else
79int prepare_hugepage_range(unsigned long addr, unsigned long len, 78int prepare_hugepage_range(unsigned long addr, unsigned long len);
80 pgoff_t pgoff);
81#endif 79#endif
82 80
83#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE 81#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE
@@ -115,7 +113,7 @@ static inline unsigned long hugetlb_total_pages(void)
115#define hugetlb_report_meminfo(buf) 0 113#define hugetlb_report_meminfo(buf) 0
116#define hugetlb_report_node_meminfo(n, buf) 0 114#define hugetlb_report_node_meminfo(n, buf) 0
117#define follow_huge_pmd(mm, addr, pmd, write) NULL 115#define follow_huge_pmd(mm, addr, pmd, write) NULL
118#define prepare_hugepage_range(addr,len,pgoff) (-EINVAL) 116#define prepare_hugepage_range(addr,len) (-EINVAL)
119#define pmd_huge(x) 0 117#define pmd_huge(x) 0
120#define is_hugepage_only_range(mm, addr, len) 0 118#define is_hugepage_only_range(mm, addr, len) 0
121#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) 119#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index aa83d4163096..b69014865714 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -115,9 +115,10 @@
115#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ 115#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */
116#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ 116#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
117#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */ 117#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */
118#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */ 118#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */
119#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */ 119#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */
120#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */ 120#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */
121#define I2C_DRIVERID_LM4857 92 /* LM4857 Audio Amplifier */
121 122
122#define I2C_DRIVERID_I2CDEV 900 123#define I2C_DRIVERID_I2CDEV 900
123#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ 124#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
diff --git a/include/linux/i2c-isa.h b/include/linux/i2c-isa.h
deleted file mode 100644
index 67e3598c4cec..000000000000
--- a/include/linux/i2c-isa.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * i2c-isa.h - definitions for the i2c-isa pseudo-i2c-adapter interface
3 *
4 * Copyright (C) 2005 Jean Delvare <khali@linux-fr.org>
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., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef _LINUX_I2C_ISA_H
22#define _LINUX_I2C_ISA_H
23
24#include <linux/i2c.h>
25
26extern int i2c_isa_add_driver(struct i2c_driver *driver);
27extern int i2c_isa_del_driver(struct i2c_driver *driver);
28
29/* Detect whether we are on the isa bus. This is only useful to hybrid
30 (i2c+isa) drivers. */
31#define i2c_is_isa_adapter(adapptr) \
32 ((adapptr)->id == I2C_HW_ISA)
33#define i2c_is_isa_client(clientptr) \
34 i2c_is_isa_adapter((clientptr)->adapter)
35
36#endif /* _LINUX_I2C_ISA_H */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 2eaba21b9b1a..2a32f2fd940d 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -156,10 +156,14 @@ struct i2c_driver {
156 * @name: Indicates the type of the device, usually a chip name that's 156 * @name: Indicates the type of the device, usually a chip name that's
157 * generic enough to hide second-sourcing and compatible revisions. 157 * generic enough to hide second-sourcing and compatible revisions.
158 * @adapter: manages the bus segment hosting this I2C device 158 * @adapter: manages the bus segment hosting this I2C device
159 * @driver: device's driver, hence pointer to access routines
160 * @usage_count: counts current number of users of this client
159 * @dev: Driver model device node for the slave. 161 * @dev: Driver model device node for the slave.
160 * @irq: indicates the IRQ generated by this device (if any) 162 * @irq: indicates the IRQ generated by this device (if any)
161 * @driver_name: Identifies new-style driver used with this device; also 163 * @driver_name: Identifies new-style driver used with this device; also
162 * used as the module name for hotplug/coldplug modprobe support. 164 * used as the module name for hotplug/coldplug modprobe support.
165 * @list: list of active/busy clients
166 * @released: used to synchronize client releases & detaches and references
163 * 167 *
164 * An i2c_client identifies a single device (i.e. chip) connected to an 168 * An i2c_client identifies a single device (i.e. chip) connected to an
165 * i2c bus. The behaviour exposed to Linux is defined by the driver 169 * i2c bus. The behaviour exposed to Linux is defined by the driver
@@ -368,7 +372,6 @@ struct i2c_client_address_data {
368 372
369/* The numbers to use to set I2C bus address */ 373/* The numbers to use to set I2C bus address */
370#define ANY_I2C_BUS 0xffff 374#define ANY_I2C_BUS 0xffff
371#define ANY_I2C_ISA_BUS 9191
372 375
373 376
374/* ----- functions exported by i2c.o */ 377/* ----- functions exported by i2c.o */
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 333a370a3bdc..9752307d16ba 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -946,8 +946,7 @@ static inline int i2o_pool_alloc(struct i2o_pool *pool, const char *name,
946 strcpy(pool->name, name); 946 strcpy(pool->name, name);
947 947
948 pool->slab = 948 pool->slab =
949 kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL, 949 kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL);
950 NULL);
951 if (!pool->slab) 950 if (!pool->slab)
952 goto free_name; 951 goto free_name;
953 952
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 19ab25804056..b9f66c10caa0 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -555,7 +555,7 @@ typedef struct ide_drive_s {
555 char name[4]; /* drive name, such as "hda" */ 555 char name[4]; /* drive name, such as "hda" */
556 char driver_req[10]; /* requests specific driver */ 556 char driver_req[10]; /* requests specific driver */
557 557
558 request_queue_t *queue; /* request queue */ 558 struct request_queue *queue; /* request queue */
559 559
560 struct request *rq; /* current request */ 560 struct request *rq; /* current request */
561 struct ide_drive_s *next; /* circular list of hwgroup drives */ 561 struct ide_drive_s *next; /* circular list of hwgroup drives */
@@ -681,6 +681,10 @@ typedef struct hwif_s {
681 u8 straight8; /* Alan's straight 8 check */ 681 u8 straight8; /* Alan's straight 8 check */
682 u8 bus_state; /* power state of the IDE bus */ 682 u8 bus_state; /* power state of the IDE bus */
683 683
684 u8 host_flags;
685
686 u8 pio_mask;
687
684 u8 atapi_dma; /* host supports atapi_dma */ 688 u8 atapi_dma; /* host supports atapi_dma */
685 u8 ultra_mask; 689 u8 ultra_mask;
686 u8 mwdma_mask; 690 u8 mwdma_mask;
@@ -1202,7 +1206,7 @@ extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout);
1202extern int ide_spin_wait_hwgroup(ide_drive_t *); 1206extern int ide_spin_wait_hwgroup(ide_drive_t *);
1203extern void ide_timer_expiry(unsigned long); 1207extern void ide_timer_expiry(unsigned long);
1204extern irqreturn_t ide_intr(int irq, void *dev_id); 1208extern irqreturn_t ide_intr(int irq, void *dev_id);
1205extern void do_ide_request(request_queue_t *); 1209extern void do_ide_request(struct request_queue *);
1206 1210
1207void ide_init_disk(struct gendisk *, ide_drive_t *); 1211void ide_init_disk(struct gendisk *, ide_drive_t *);
1208 1212
@@ -1244,7 +1248,13 @@ typedef struct ide_pci_enablebit_s {
1244 1248
1245enum { 1249enum {
1246 /* Uses ISA control ports not PCI ones. */ 1250 /* Uses ISA control ports not PCI ones. */
1247 IDEPCI_FLAG_ISA_PORTS = (1 << 0), 1251 IDE_HFLAG_ISA_PORTS = (1 << 0),
1252 /* single port device */
1253 IDE_HFLAG_SINGLE = (1 << 1),
1254 /* don't use legacy PIO blacklist */
1255 IDE_HFLAG_PIO_NO_BLACKLIST = (1 << 2),
1256 /* don't use conservative PIO "downgrade" */
1257 IDE_HFLAG_PIO_NO_DOWNGRADE = (1 << 3),
1248}; 1258};
1249 1259
1250typedef struct ide_pci_device_s { 1260typedef struct ide_pci_device_s {
@@ -1256,13 +1266,13 @@ typedef struct ide_pci_device_s {
1256 void (*init_hwif)(ide_hwif_t *); 1266 void (*init_hwif)(ide_hwif_t *);
1257 void (*init_dma)(ide_hwif_t *, unsigned long); 1267 void (*init_dma)(ide_hwif_t *, unsigned long);
1258 void (*fixup)(ide_hwif_t *); 1268 void (*fixup)(ide_hwif_t *);
1259 u8 channels;
1260 u8 autodma; 1269 u8 autodma;
1261 ide_pci_enablebit_t enablebits[2]; 1270 ide_pci_enablebit_t enablebits[2];
1262 u8 bootable; 1271 u8 bootable;
1263 unsigned int extra; 1272 unsigned int extra;
1264 struct ide_pci_device_s *next; 1273 struct ide_pci_device_s *next;
1265 u8 flags; 1274 u8 host_flags;
1275 u8 pio_mask;
1266 u8 udma_mask; 1276 u8 udma_mask;
1267} ide_pci_device_t; 1277} ide_pci_device_t;
1268 1278
@@ -1275,13 +1285,14 @@ void ide_init_sg_cmd(ide_drive_t *, struct request *);
1275#define BAD_DMA_DRIVE 0 1285#define BAD_DMA_DRIVE 0
1276#define GOOD_DMA_DRIVE 1 1286#define GOOD_DMA_DRIVE 1
1277 1287
1278#ifdef CONFIG_BLK_DEV_IDEDMA
1279struct drive_list_entry { 1288struct drive_list_entry {
1280 const char *id_model; 1289 const char *id_model;
1281 const char *id_firmware; 1290 const char *id_firmware;
1282}; 1291};
1283 1292
1284int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); 1293int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);
1294
1295#ifdef CONFIG_BLK_DEV_IDEDMA
1285int __ide_dma_bad_drive(ide_drive_t *); 1296int __ide_dma_bad_drive(ide_drive_t *);
1286int __ide_dma_good_drive(ide_drive_t *); 1297int __ide_dma_good_drive(ide_drive_t *);
1287u8 ide_max_dma_mode(ide_drive_t *); 1298u8 ide_max_dma_mode(ide_drive_t *);
@@ -1302,7 +1313,6 @@ void ide_dma_host_off(ide_drive_t *);
1302void ide_dma_off_quietly(ide_drive_t *); 1313void ide_dma_off_quietly(ide_drive_t *);
1303void ide_dma_host_on(ide_drive_t *); 1314void ide_dma_host_on(ide_drive_t *);
1304extern int __ide_dma_on(ide_drive_t *); 1315extern int __ide_dma_on(ide_drive_t *);
1305extern int __ide_dma_check(ide_drive_t *);
1306extern int ide_dma_setup(ide_drive_t *); 1316extern int ide_dma_setup(ide_drive_t *);
1307extern void ide_dma_start(ide_drive_t *); 1317extern void ide_dma_start(ide_drive_t *);
1308extern int __ide_dma_end(ide_drive_t *); 1318extern int __ide_dma_end(ide_drive_t *);
@@ -1363,6 +1373,24 @@ extern void ide_toggle_bounce(ide_drive_t *drive, int on);
1363extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); 1373extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
1364int ide_use_fast_pio(ide_drive_t *); 1374int ide_use_fast_pio(ide_drive_t *);
1365 1375
1376static inline int ide_dev_has_iordy(struct hd_driveid *id)
1377{
1378 return ((id->field_valid & 2) && (id->capability & 8)) ? 1 : 0;
1379}
1380
1381static inline int ide_dev_is_sata(struct hd_driveid *id)
1382{
1383 /*
1384 * See if word 93 is 0 AND drive is at least ATA-5 compatible
1385 * verifying that word 80 by casting it to a signed type --
1386 * this trick allows us to filter out the reserved values of
1387 * 0x0000 and 0xffff along with the earlier ATA revisions...
1388 */
1389 if (id->hw_config == 0 && (short)id->major_rev_num >= 0x0020)
1390 return 1;
1391 return 0;
1392}
1393
1366u8 ide_dump_status(ide_drive_t *, const char *, u8); 1394u8 ide_dump_status(ide_drive_t *, const char *, u8);
1367 1395
1368typedef struct ide_pio_timings_s { 1396typedef struct ide_pio_timings_s {
@@ -1372,14 +1400,8 @@ typedef struct ide_pio_timings_s {
1372 /* active + recovery (+ setup for some chips) */ 1400 /* active + recovery (+ setup for some chips) */
1373} ide_pio_timings_t; 1401} ide_pio_timings_t;
1374 1402
1375typedef struct ide_pio_data_s { 1403unsigned int ide_pio_cycle_time(ide_drive_t *, u8);
1376 u8 pio_mode; 1404u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8);
1377 u8 use_iordy;
1378 u8 overridden;
1379 unsigned int cycle_time;
1380} ide_pio_data_t;
1381
1382extern u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d);
1383extern const ide_pio_timings_t ide_pio_timings[6]; 1405extern const ide_pio_timings_t ide_pio_timings[6];
1384 1406
1385 1407
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
index 516203b6fdeb..a7d6a2234b31 100644
--- a/include/linux/if_pppol2tp.h
+++ b/include/linux/if_pppol2tp.h
@@ -32,8 +32,8 @@ struct pppol2tp_addr
32 32
33 struct sockaddr_in addr; /* IP address and port to send to */ 33 struct sockaddr_in addr; /* IP address and port to send to */
34 34
35 __be16 s_tunnel, s_session; /* For matching incoming packets */ 35 __u16 s_tunnel, s_session; /* For matching incoming packets */
36 __be16 d_tunnel, d_session; /* For sending outgoing packets */ 36 __u16 d_tunnel, d_session; /* For sending outgoing packets */
37}; 37};
38 38
39/* Socket options: 39/* Socket options:
diff --git a/include/linux/init.h b/include/linux/init.h
index 5b5285316339..74b1f43bf982 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -40,7 +40,7 @@
40 40
41/* These are for everybody (although not all archs will actually 41/* These are for everybody (although not all archs will actually
42 discard it in modules) */ 42 discard it in modules) */
43#define __init __attribute__ ((__section__ (".init.text"))) 43#define __init __attribute__ ((__section__ (".init.text"))) __cold
44#define __initdata __attribute__ ((__section__ (".init.data"))) 44#define __initdata __attribute__ ((__section__ (".init.data")))
45#define __exitdata __attribute__ ((__section__(".exit.data"))) 45#define __exitdata __attribute__ ((__section__(".exit.data")))
46#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) 46#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
@@ -59,9 +59,9 @@
59#define __initdata_refok __attribute__ ((__section__ (".data.init.refok"))) 59#define __initdata_refok __attribute__ ((__section__ (".data.init.refok")))
60 60
61#ifdef MODULE 61#ifdef MODULE
62#define __exit __attribute__ ((__section__(".exit.text"))) 62#define __exit __attribute__ ((__section__(".exit.text"))) __cold
63#else 63#else
64#define __exit __attribute_used__ __attribute__ ((__section__(".exit.text"))) 64#define __exit __attribute_used__ __attribute__ ((__section__(".exit.text"))) __cold
65#endif 65#endif
66 66
67/* For assembly routines */ 67/* For assembly routines */
@@ -114,7 +114,7 @@ void prepare_namespace(void);
114 * 114 *
115 * This only exists for built-in code, not for modules. 115 * This only exists for built-in code, not for modules.
116 */ 116 */
117#define pure_initcall(fn) __define_initcall("0",fn,1) 117#define pure_initcall(fn) __define_initcall("0",fn,0)
118 118
119#define core_initcall(fn) __define_initcall("1",fn,1) 119#define core_initcall(fn) __define_initcall("1",fn,1)
120#define core_initcall_sync(fn) __define_initcall("1s",fn,1s) 120#define core_initcall_sync(fn) __define_initcall("1s",fn,1s)
diff --git a/include/linux/input.h b/include/linux/input.h
index 17df5a7331c7..36e00aa6f03b 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -363,6 +363,12 @@ struct input_absinfo {
363 363
364#define KEY_UNKNOWN 240 364#define KEY_UNKNOWN 240
365 365
366#define KEY_VIDEO_NEXT 241 /* drive next video source */
367#define KEY_VIDEO_PREV 242 /* drive previous video source */
368#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */
369#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */
370#define KEY_DISPLAY_OFF 245 /* display device to off state */
371
366#define BTN_MISC 0x100 372#define BTN_MISC 0x100
367#define BTN_0 0x100 373#define BTN_0 0x100
368#define BTN_1 0x101 374#define BTN_1 0x101
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 5323f6275854..5523f19d88d2 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -11,8 +11,6 @@
11#include <linux/hardirq.h> 11#include <linux/hardirq.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/irqflags.h> 13#include <linux/irqflags.h>
14#include <linux/bottom_half.h>
15#include <linux/device.h>
16#include <asm/atomic.h> 14#include <asm/atomic.h>
17#include <asm/ptrace.h> 15#include <asm/ptrace.h>
18#include <asm/system.h> 16#include <asm/system.h>
@@ -97,6 +95,8 @@ extern int __must_check request_irq(unsigned int, irq_handler_t handler,
97 unsigned long, const char *, void *); 95 unsigned long, const char *, void *);
98extern void free_irq(unsigned int, void *); 96extern void free_irq(unsigned int, void *);
99 97
98struct device;
99
100extern int __must_check devm_request_irq(struct device *dev, unsigned int irq, 100extern int __must_check devm_request_irq(struct device *dev, unsigned int irq,
101 irq_handler_t handler, unsigned long irqflags, 101 irq_handler_t handler, unsigned long irqflags,
102 const char *devname, void *dev_id); 102 const char *devname, void *dev_id);
@@ -120,11 +120,11 @@ extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
120# define local_irq_enable_in_hardirq() local_irq_enable() 120# define local_irq_enable_in_hardirq() local_irq_enable()
121#endif 121#endif
122 122
123#ifdef CONFIG_GENERIC_HARDIRQS
124extern void disable_irq_nosync(unsigned int irq); 123extern void disable_irq_nosync(unsigned int irq);
125extern void disable_irq(unsigned int irq); 124extern void disable_irq(unsigned int irq);
126extern void enable_irq(unsigned int irq); 125extern void enable_irq(unsigned int irq);
127 126
127#ifdef CONFIG_GENERIC_HARDIRQS
128/* 128/*
129 * Special lockdep variants of irq disabling/enabling. 129 * Special lockdep variants of irq disabling/enabling.
130 * These should be used for locking constructs that 130 * These should be used for locking constructs that
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
index 2eaa142cd061..baf29387cab4 100644
--- a/include/linux/ioprio.h
+++ b/include/linux/ioprio.h
@@ -53,6 +53,14 @@ static inline int task_ioprio(struct task_struct *task)
53 return IOPRIO_NORM; 53 return IOPRIO_NORM;
54} 54}
55 55
56static inline int task_ioprio_class(struct task_struct *task)
57{
58 if (ioprio_valid(task->ioprio))
59 return IOPRIO_PRIO_CLASS(task->ioprio);
60
61 return IOPRIO_CLASS_BE;
62}
63
56static inline int task_nice_ioprio(struct task_struct *task) 64static inline int task_nice_ioprio(struct task_struct *task)
57{ 65{
58 return (task_nice(task) + 20) / 5; 66 return (task_nice(task) + 20) / 5;
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 97983dc9df13..4ca60c3320fb 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -219,7 +219,6 @@ enum {
219#include <linux/tcp.h> 219#include <linux/tcp.h>
220#include <linux/udp.h> 220#include <linux/udp.h>
221 221
222#include <net/if_inet6.h> /* struct ipv6_mc_socklist */
223#include <net/inet_sock.h> 222#include <net/inet_sock.h>
224 223
225static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb) 224static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb)
@@ -273,6 +272,10 @@ struct tcp6_request_sock {
273 struct inet6_request_sock tcp6rsk_inet6; 272 struct inet6_request_sock tcp6rsk_inet6;
274}; 273};
275 274
275struct ipv6_mc_socklist;
276struct ipv6_ac_socklist;
277struct ipv6_fl_socklist;
278
276/** 279/**
277 * struct ipv6_pinfo - ipv6 private area 280 * struct ipv6_pinfo - ipv6 private area
278 * 281 *
diff --git a/include/linux/irda.h b/include/linux/irda.h
index 8e3735714c1c..28f88ecba344 100644
--- a/include/linux/irda.h
+++ b/include/linux/irda.h
@@ -77,6 +77,7 @@ typedef enum {
77 IRDA_ACT200L_DONGLE = 10, 77 IRDA_ACT200L_DONGLE = 10,
78 IRDA_MA600_DONGLE = 11, 78 IRDA_MA600_DONGLE = 11,
79 IRDA_TOIM3232_DONGLE = 12, 79 IRDA_TOIM3232_DONGLE = 12,
80 IRDA_EP7211_DONGLE = 13,
80} IRDA_DONGLE; 81} IRDA_DONGLE;
81 82
82/* Protocol types to be used for SOCK_DGRAM */ 83/* Protocol types to be used for SOCK_DGRAM */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 44657197fcb0..efc88538b2ba 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -140,6 +140,7 @@ struct irq_chip {
140 * @wake_depth: enable depth, for multiple set_irq_wake() callers 140 * @wake_depth: enable depth, for multiple set_irq_wake() callers
141 * @irq_count: stats field to detect stalled irqs 141 * @irq_count: stats field to detect stalled irqs
142 * @irqs_unhandled: stats field for spurious unhandled interrupts 142 * @irqs_unhandled: stats field for spurious unhandled interrupts
143 * @last_unhandled: aging timer for unhandled count
143 * @lock: locking for SMP 144 * @lock: locking for SMP
144 * @affinity: IRQ affinity on SMP 145 * @affinity: IRQ affinity on SMP
145 * @cpu: cpu index useful for balancing 146 * @cpu: cpu index useful for balancing
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 0e0fedd2039a..260d6d76c5f3 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -50,14 +50,14 @@
50 */ 50 */
51#define JBD_DEFAULT_MAX_COMMIT_AGE 5 51#define JBD_DEFAULT_MAX_COMMIT_AGE 5
52 52
53#ifdef CONFIG_JBD_DEBUG 53#ifdef CONFIG_JBD2_DEBUG
54/* 54/*
55 * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal 55 * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal
56 * consistency checks. By default we don't do this unless 56 * consistency checks. By default we don't do this unless
57 * CONFIG_JBD_DEBUG is on. 57 * CONFIG_JBD2_DEBUG is on.
58 */ 58 */
59#define JBD_EXPENSIVE_CHECKING 59#define JBD_EXPENSIVE_CHECKING
60extern int jbd2_journal_enable_debug; 60extern u8 jbd2_journal_enable_debug;
61 61
62#define jbd_debug(n, f, a...) \ 62#define jbd_debug(n, f, a...) \
63 do { \ 63 do { \
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index 506ad20c18f8..8bdb16bfe5fb 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -161,4 +161,7 @@ static inline void con_schedule_flip(struct tty_struct *t)
161 schedule_delayed_work(&t->buf.work, 0); 161 schedule_delayed_work(&t->buf.work, 0);
162} 162}
163 163
164/* mac_hid.c */
165extern int mac_hid_mouse_emulate_buttons(int, unsigned int, int);
166
164#endif 167#endif
diff --git a/include/linux/kdebug.h b/include/linux/kdebug.h
index 5db38d6d8b92..ed815090b3bc 100644
--- a/include/linux/kdebug.h
+++ b/include/linux/kdebug.h
@@ -3,6 +3,8 @@
3 3
4#include <asm/kdebug.h> 4#include <asm/kdebug.h>
5 5
6struct notifier_block;
7
6struct die_args { 8struct die_args {
7 struct pt_regs *regs; 9 struct pt_regs *regs;
8 const char *str; 10 const char *str;
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 1eb9cde550c4..47160fe378c9 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -34,6 +34,7 @@ extern const char linux_proc_banner[];
34 34
35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) 35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) 36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
37#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
37 38
38#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) 39#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
39 40
@@ -106,7 +107,7 @@ extern int cond_resched(void);
106extern struct atomic_notifier_head panic_notifier_list; 107extern struct atomic_notifier_head panic_notifier_list;
107extern long (*panic_blink)(long time); 108extern long (*panic_blink)(long time);
108NORET_TYPE void panic(const char * fmt, ...) 109NORET_TYPE void panic(const char * fmt, ...)
109 __attribute__ ((NORET_AND format (printf, 1, 2))); 110 __attribute__ ((NORET_AND format (printf, 1, 2))) __cold;
110extern void oops_enter(void); 111extern void oops_enter(void);
111extern void oops_exit(void); 112extern void oops_exit(void);
112extern int oops_may_print(void); 113extern int oops_may_print(void);
@@ -155,14 +156,14 @@ extern void dump_thread(struct pt_regs *regs, struct user *dump);
155asmlinkage int vprintk(const char *fmt, va_list args) 156asmlinkage int vprintk(const char *fmt, va_list args)
156 __attribute__ ((format (printf, 1, 0))); 157 __attribute__ ((format (printf, 1, 0)));
157asmlinkage int printk(const char * fmt, ...) 158asmlinkage int printk(const char * fmt, ...)
158 __attribute__ ((format (printf, 1, 2))); 159 __attribute__ ((format (printf, 1, 2))) __cold;
159#else 160#else
160static inline int vprintk(const char *s, va_list args) 161static inline int vprintk(const char *s, va_list args)
161 __attribute__ ((format (printf, 1, 0))); 162 __attribute__ ((format (printf, 1, 0)));
162static inline int vprintk(const char *s, va_list args) { return 0; } 163static inline int vprintk(const char *s, va_list args) { return 0; }
163static inline int printk(const char *s, ...) 164static inline int printk(const char *s, ...)
164 __attribute__ ((format (printf, 1, 2))); 165 __attribute__ ((format (printf, 1, 2)));
165static inline int printk(const char *s, ...) { return 0; } 166static inline int __cold printk(const char *s, ...) { return 0; }
166#endif 167#endif
167 168
168unsigned long int_sqrt(unsigned long); 169unsigned long int_sqrt(unsigned long);
@@ -212,7 +213,7 @@ extern enum system_states {
212#define TAINT_USER (1<<6) 213#define TAINT_USER (1<<6)
213#define TAINT_DIE (1<<7) 214#define TAINT_DIE (1<<7)
214 215
215extern void dump_stack(void); 216extern void dump_stack(void) __cold;
216 217
217enum { 218enum {
218 DUMP_PREFIX_NONE, 219 DUMP_PREFIX_NONE,
@@ -224,9 +225,9 @@ extern void hex_dump_to_buffer(const void *buf, size_t len,
224 char *linebuf, size_t linebuflen, bool ascii); 225 char *linebuf, size_t linebuflen, bool ascii);
225extern void print_hex_dump(const char *level, const char *prefix_str, 226extern void print_hex_dump(const char *level, const char *prefix_str,
226 int prefix_type, int rowsize, int groupsize, 227 int prefix_type, int rowsize, int groupsize,
227 void *buf, size_t len, bool ascii); 228 const void *buf, size_t len, bool ascii);
228extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, 229extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
229 void *buf, size_t len); 230 const void *buf, size_t len);
230#define hex_asc(x) "0123456789abcdef"[x] 231#define hex_asc(x) "0123456789abcdef"[x]
231 232
232#ifdef DEBUG 233#ifdef DEBUG
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 10f505c8431d..5dc13848891b 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -36,13 +36,57 @@ static inline int request_module(const char * name, ...) { return -ENOSYS; }
36#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x))) 36#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
37 37
38struct key; 38struct key;
39extern int call_usermodehelper_keys(char *path, char *argv[], char *envp[], 39struct file;
40 struct key *session_keyring, int wait); 40struct subprocess_info;
41
42/* Allocate a subprocess_info structure */
43struct subprocess_info *call_usermodehelper_setup(char *path,
44 char **argv, char **envp);
45
46/* Set various pieces of state into the subprocess_info structure */
47void call_usermodehelper_setkeys(struct subprocess_info *info,
48 struct key *session_keyring);
49int call_usermodehelper_stdinpipe(struct subprocess_info *sub_info,
50 struct file **filp);
51void call_usermodehelper_setcleanup(struct subprocess_info *info,
52 void (*cleanup)(char **argv, char **envp));
53
54enum umh_wait {
55 UMH_NO_WAIT = -1, /* don't wait at all */
56 UMH_WAIT_EXEC = 0, /* wait for the exec, but not the process */
57 UMH_WAIT_PROC = 1, /* wait for the process to complete */
58};
59
60/* Actually execute the sub-process */
61int call_usermodehelper_exec(struct subprocess_info *info, enum umh_wait wait);
62
63/* Free the subprocess_info. This is only needed if you're not going
64 to call call_usermodehelper_exec */
65void call_usermodehelper_freeinfo(struct subprocess_info *info);
41 66
42static inline int 67static inline int
43call_usermodehelper(char *path, char **argv, char **envp, int wait) 68call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait)
44{ 69{
45 return call_usermodehelper_keys(path, argv, envp, NULL, wait); 70 struct subprocess_info *info;
71
72 info = call_usermodehelper_setup(path, argv, envp);
73 if (info == NULL)
74 return -ENOMEM;
75 return call_usermodehelper_exec(info, wait);
76}
77
78static inline int
79call_usermodehelper_keys(char *path, char **argv, char **envp,
80 struct key *session_keyring, enum umh_wait wait)
81{
82 struct subprocess_info *info;
83
84 info = call_usermodehelper_setup(path, argv, envp);
85 if (info == NULL)
86 return -ENOMEM;
87
88 call_usermodehelper_setkeys(info, session_keyring);
89 return call_usermodehelper_exec(info, wait);
46} 90}
47 91
48extern void usermodehelper_init(void); 92extern void usermodehelper_init(void);
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 06cbf41d32d2..949706c33622 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -36,17 +36,29 @@ extern char uevent_helper[];
36/* counter to tag the uevent, read only except for the kobject core */ 36/* counter to tag the uevent, read only except for the kobject core */
37extern u64 uevent_seqnum; 37extern u64 uevent_seqnum;
38 38
39/* the actions here must match the proper string in lib/kobject_uevent.c */ 39/*
40typedef int __bitwise kobject_action_t; 40 * The actions here must match the index to the string array
41 * in lib/kobject_uevent.c
42 *
43 * Do not add new actions here without checking with the driver-core
44 * maintainers. Action strings are not meant to express subsystem
45 * or device specific properties. In most cases you want to send a
46 * kobject_uevent_env(kobj, KOBJ_CHANGE, env) with additional event
47 * specific variables added to the event environment.
48 */
41enum kobject_action { 49enum kobject_action {
42 KOBJ_ADD = (__force kobject_action_t) 0x01, /* exclusive to core */ 50 KOBJ_ADD,
43 KOBJ_REMOVE = (__force kobject_action_t) 0x02, /* exclusive to core */ 51 KOBJ_REMOVE,
44 KOBJ_CHANGE = (__force kobject_action_t) 0x03, /* device state change */ 52 KOBJ_CHANGE,
45 KOBJ_OFFLINE = (__force kobject_action_t) 0x04, /* device offline */ 53 KOBJ_MOVE,
46 KOBJ_ONLINE = (__force kobject_action_t) 0x05, /* device online */ 54 KOBJ_ONLINE,
47 KOBJ_MOVE = (__force kobject_action_t) 0x06, /* device move */ 55 KOBJ_OFFLINE,
56 KOBJ_MAX
48}; 57};
49 58
59/* The list of strings defining the valid kobject actions as specified above */
60extern const char *kobject_actions[];
61
50struct kobject { 62struct kobject {
51 const char * k_name; 63 const char * k_name;
52 char name[KOBJ_NAME_LEN]; 64 char name[KOBJ_NAME_LEN];
@@ -99,9 +111,15 @@ struct kobj_type {
99 struct attribute ** default_attrs; 111 struct attribute ** default_attrs;
100}; 112};
101 113
114struct kset_uevent_ops {
115 int (*filter)(struct kset *kset, struct kobject *kobj);
116 const char *(*name)(struct kset *kset, struct kobject *kobj);
117 int (*uevent)(struct kset *kset, struct kobject *kobj, char **envp,
118 int num_envp, char *buffer, int buffer_size);
119};
102 120
103/** 121/*
104 * kset - a set of kobjects of a specific type, belonging 122 * struct kset - a set of kobjects of a specific type, belonging
105 * to a specific subsystem. 123 * to a specific subsystem.
106 * 124 *
107 * All kobjects of a kset should be embedded in an identical 125 * All kobjects of a kset should be embedded in an identical
@@ -117,13 +135,6 @@ struct kobj_type {
117 * supress the event generation or add subsystem specific 135 * supress the event generation or add subsystem specific
118 * variables carried with the event. 136 * variables carried with the event.
119 */ 137 */
120struct kset_uevent_ops {
121 int (*filter)(struct kset *kset, struct kobject *kobj);
122 const char *(*name)(struct kset *kset, struct kobject *kobj);
123 int (*uevent)(struct kset *kset, struct kobject *kobj, char **envp,
124 int num_envp, char *buffer, int buffer_size);
125};
126
127struct kset { 138struct kset {
128 struct kobj_type * ktype; 139 struct kobj_type * ktype;
129 struct list_head list; 140 struct list_head list;
@@ -164,7 +175,7 @@ static inline struct kobj_type * get_ktype(struct kobject * k)
164extern struct kobject * kset_find_obj(struct kset *, const char *); 175extern struct kobject * kset_find_obj(struct kset *, const char *);
165 176
166 177
167/** 178/*
168 * Use this when initializing an embedded kset with no other 179 * Use this when initializing an embedded kset with no other
169 * fields to initialize. 180 * fields to initialize.
170 */ 181 */
@@ -189,7 +200,7 @@ extern struct kset kernel_subsys;
189/* The global /sys/hypervisor/ subsystem */ 200/* The global /sys/hypervisor/ subsystem */
190extern struct kset hypervisor_subsys; 201extern struct kset hypervisor_subsys;
191 202
192/** 203/*
193 * Helpers for setting the kset of registered objects. 204 * Helpers for setting the kset of registered objects.
194 * Often, a registered object belongs to a kset embedded in a 205 * Often, a registered object belongs to a kset embedded in a
195 * subsystem. These do no magic, just make the resulting code 206 * subsystem. These do no magic, just make the resulting code
@@ -224,7 +235,7 @@ extern struct kset hypervisor_subsys;
224/** 235/**
225 * subsys_set_kset(obj,subsys) - set kset for subsystem 236 * subsys_set_kset(obj,subsys) - set kset for subsystem
226 * @obj: ptr to some object type. 237 * @obj: ptr to some object type.
227 * @subsys: a subsystem object (not a ptr). 238 * @_subsys: a subsystem object (not a ptr).
228 * 239 *
229 * Can be used for any object type with an embedded ->subsys. 240 * Can be used for any object type with an embedded ->subsys.
230 * Sets the kset of @obj's kobject to @subsys.kset. This makes 241 * Sets the kset of @obj's kobject to @subsys.kset. This makes
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 23adf6075ae4..51464d12a4e5 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -116,9 +116,12 @@ struct kprobe {
116 */ 116 */
117struct jprobe { 117struct jprobe {
118 struct kprobe kp; 118 struct kprobe kp;
119 kprobe_opcode_t *entry; /* probe handling code to jump to */ 119 void *entry; /* probe handling code to jump to */
120}; 120};
121 121
122/* For backward compatibility with old code using JPROBE_ENTRY() */
123#define JPROBE_ENTRY(handler) (handler)
124
122DECLARE_PER_CPU(struct kprobe *, current_kprobe); 125DECLARE_PER_CPU(struct kprobe *, current_kprobe);
123DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 126DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
124 127
@@ -211,6 +214,7 @@ int longjmp_break_handler(struct kprobe *, struct pt_regs *);
211int register_jprobe(struct jprobe *p); 214int register_jprobe(struct jprobe *p);
212void unregister_jprobe(struct jprobe *p); 215void unregister_jprobe(struct jprobe *p);
213void jprobe_return(void); 216void jprobe_return(void);
217unsigned long arch_deref_entry_point(void *);
214 218
215int register_kretprobe(struct kretprobe *rp); 219int register_kretprobe(struct kretprobe *rp);
216void unregister_kretprobe(struct kretprobe *rp); 220void unregister_kretprobe(struct kretprobe *rp);
diff --git a/include/linux/lcd.h b/include/linux/lcd.h
index 598793c0745b..1d379787f2e7 100644
--- a/include/linux/lcd.h
+++ b/include/linux/lcd.h
@@ -62,8 +62,8 @@ struct lcd_device {
62 struct mutex update_lock; 62 struct mutex update_lock;
63 /* The framebuffer notifier block */ 63 /* The framebuffer notifier block */
64 struct notifier_block fb_notif; 64 struct notifier_block fb_notif;
65 /* The class device structure */ 65
66 struct class_device class_dev; 66 struct device dev;
67}; 67};
68 68
69static inline void lcd_set_power(struct lcd_device *ld, int power) 69static inline void lcd_set_power(struct lcd_device *ld, int power)
@@ -75,9 +75,15 @@ static inline void lcd_set_power(struct lcd_device *ld, int power)
75} 75}
76 76
77extern struct lcd_device *lcd_device_register(const char *name, 77extern struct lcd_device *lcd_device_register(const char *name,
78 void *devdata, struct lcd_ops *ops); 78 struct device *parent, void *devdata, struct lcd_ops *ops);
79extern void lcd_device_unregister(struct lcd_device *ld); 79extern void lcd_device_unregister(struct lcd_device *ld);
80 80
81#define to_lcd_device(obj) container_of(obj, struct lcd_device, class_dev) 81#define to_lcd_device(obj) container_of(obj, struct lcd_device, dev)
82
83static inline void * lcd_get_data(struct lcd_device *ld_dev)
84{
85 return dev_get_drvdata(&ld_dev->dev);
86}
87
82 88
83#endif 89#endif
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 494bed7c2fc1..421175092ee2 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -15,7 +15,6 @@
15#include <linux/list.h> 15#include <linux/list.h>
16 16
17struct device; 17struct device;
18struct class_device;
19/* 18/*
20 * LED Core 19 * LED Core
21 */ 20 */
@@ -37,7 +36,7 @@ struct led_classdev {
37 void (*brightness_set)(struct led_classdev *led_cdev, 36 void (*brightness_set)(struct led_classdev *led_cdev,
38 enum led_brightness brightness); 37 enum led_brightness brightness);
39 38
40 struct class_device *class_dev; 39 struct device *dev;
41 struct list_head node; /* LED Device list */ 40 struct list_head node; /* LED Device list */
42 char *default_trigger; /* Trigger to use */ 41 char *default_trigger; /* Trigger to use */
43 42
@@ -109,4 +108,18 @@ extern void ledtrig_ide_activity(void);
109#define ledtrig_ide_activity() do {} while(0) 108#define ledtrig_ide_activity() do {} while(0)
110#endif 109#endif
111 110
111/* For the leds-gpio driver */
112struct gpio_led {
113 const char *name;
114 char *default_trigger;
115 unsigned gpio;
116 u8 active_low;
117};
118
119struct gpio_led_platform_data {
120 int num_leds;
121 struct gpio_led *leds;
122};
123
124
112#endif /* __LINUX_LEDS_H_INCLUDED */ 125#endif /* __LINUX_LEDS_H_INCLUDED */
diff --git a/include/linux/lguest.h b/include/linux/lguest.h
new file mode 100644
index 000000000000..157ad64aa7ce
--- /dev/null
+++ b/include/linux/lguest.h
@@ -0,0 +1,116 @@
1/* Things the lguest guest needs to know. Note: like all lguest interfaces,
2 * this is subject to wild and random change between versions. */
3#ifndef _ASM_LGUEST_H
4#define _ASM_LGUEST_H
5
6#ifndef __ASSEMBLY__
7#include <asm/irq.h>
8
9#define LHCALL_FLUSH_ASYNC 0
10#define LHCALL_LGUEST_INIT 1
11#define LHCALL_CRASH 2
12#define LHCALL_LOAD_GDT 3
13#define LHCALL_NEW_PGTABLE 4
14#define LHCALL_FLUSH_TLB 5
15#define LHCALL_LOAD_IDT_ENTRY 6
16#define LHCALL_SET_STACK 7
17#define LHCALL_TS 8
18#define LHCALL_SET_CLOCKEVENT 9
19#define LHCALL_HALT 10
20#define LHCALL_BIND_DMA 12
21#define LHCALL_SEND_DMA 13
22#define LHCALL_SET_PTE 14
23#define LHCALL_SET_PMD 15
24#define LHCALL_LOAD_TLS 16
25
26#define LG_CLOCK_MIN_DELTA 100UL
27#define LG_CLOCK_MAX_DELTA ULONG_MAX
28
29/*G:031 First, how does our Guest contact the Host to ask for privileged
30 * operations? There are two ways: the direct way is to make a "hypercall",
31 * to make requests of the Host Itself.
32 *
33 * Our hypercall mechanism uses the highest unused trap code (traps 32 and
34 * above are used by real hardware interrupts). Seventeen hypercalls are
35 * available: the hypercall number is put in the %eax register, and the
36 * arguments (when required) are placed in %edx, %ebx and %ecx. If a return
37 * value makes sense, it's returned in %eax.
38 *
39 * Grossly invalid calls result in Sudden Death at the hands of the vengeful
40 * Host, rather than returning failure. This reflects Winston Churchill's
41 * definition of a gentleman: "someone who is only rude intentionally". */
42#define LGUEST_TRAP_ENTRY 0x1F
43
44static inline unsigned long
45hcall(unsigned long call,
46 unsigned long arg1, unsigned long arg2, unsigned long arg3)
47{
48 /* "int" is the Intel instruction to trigger a trap. */
49 asm volatile("int $" __stringify(LGUEST_TRAP_ENTRY)
50 /* The call is in %eax (aka "a"), and can be replaced */
51 : "=a"(call)
52 /* The other arguments are in %eax, %edx, %ebx & %ecx */
53 : "a"(call), "d"(arg1), "b"(arg2), "c"(arg3)
54 /* "memory" means this might write somewhere in memory.
55 * This isn't true for all calls, but it's safe to tell
56 * gcc that it might happen so it doesn't get clever. */
57 : "memory");
58 return call;
59}
60/*:*/
61
62void async_hcall(unsigned long call,
63 unsigned long arg1, unsigned long arg2, unsigned long arg3);
64
65/* Can't use our min() macro here: needs to be a constant */
66#define LGUEST_IRQS (NR_IRQS < 32 ? NR_IRQS: 32)
67
68#define LHCALL_RING_SIZE 64
69struct hcall_ring
70{
71 u32 eax, edx, ebx, ecx;
72};
73
74/*G:032 The second method of communicating with the Host is to via "struct
75 * lguest_data". The Guest's very first hypercall is to tell the Host where
76 * this is, and then the Guest and Host both publish information in it. :*/
77struct lguest_data
78{
79 /* 512 == enabled (same as eflags in normal hardware). The Guest
80 * changes interrupts so often that a hypercall is too slow. */
81 unsigned int irq_enabled;
82 /* Fine-grained interrupt disabling by the Guest */
83 DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS);
84
85 /* The Host writes the virtual address of the last page fault here,
86 * which saves the Guest a hypercall. CR2 is the native register where
87 * this address would normally be found. */
88 unsigned long cr2;
89
90 /* Wallclock time set by the Host. */
91 struct timespec time;
92
93 /* Async hypercall ring. Instead of directly making hypercalls, we can
94 * place them in here for processing the next time the Host wants.
95 * This batching can be quite efficient. */
96
97 /* 0xFF == done (set by Host), 0 == pending (set by Guest). */
98 u8 hcall_status[LHCALL_RING_SIZE];
99 /* The actual registers for the hypercalls. */
100 struct hcall_ring hcalls[LHCALL_RING_SIZE];
101
102/* Fields initialized by the Host at boot: */
103 /* Memory not to try to access */
104 unsigned long reserve_mem;
105 /* ID of this Guest (used by network driver to set ethernet address) */
106 u16 guestid;
107 /* KHz for the TSC clock. */
108 u32 tsc_khz;
109
110/* Fields initialized by the Guest at boot: */
111 /* Instruction range to suppress interrupts even if enabled */
112 unsigned long noirq_start, noirq_end;
113};
114extern struct lguest_data lguest_data;
115#endif /* __ASSEMBLY__ */
116#endif /* _ASM_LGUEST_H */
diff --git a/include/linux/lguest_bus.h b/include/linux/lguest_bus.h
new file mode 100644
index 000000000000..d27853ddc644
--- /dev/null
+++ b/include/linux/lguest_bus.h
@@ -0,0 +1,51 @@
1#ifndef _ASM_LGUEST_DEVICE_H
2#define _ASM_LGUEST_DEVICE_H
3/* Everything you need to know about lguest devices. */
4#include <linux/device.h>
5#include <linux/lguest.h>
6#include <linux/lguest_launcher.h>
7
8struct lguest_device {
9 /* Unique busid, and index into lguest_page->devices[] */
10 unsigned int index;
11
12 struct device dev;
13
14 /* Driver can hang data off here. */
15 void *private;
16};
17
18/*D:380 Since interrupt numbers are arbitrary, we use a convention: each device
19 * can use the interrupt number corresponding to its index. The +1 is because
20 * interrupt 0 is not usable (it's actually the timer interrupt). */
21static inline int lgdev_irq(const struct lguest_device *dev)
22{
23 return dev->index + 1;
24}
25/*:*/
26
27/* dma args must not be vmalloced! */
28void lguest_send_dma(unsigned long key, struct lguest_dma *dma);
29int lguest_bind_dma(unsigned long key, struct lguest_dma *dmas,
30 unsigned int num, u8 irq);
31void lguest_unbind_dma(unsigned long key, struct lguest_dma *dmas);
32
33/* Map the virtual device space */
34void *lguest_map(unsigned long phys_addr, unsigned long pages);
35void lguest_unmap(void *);
36
37struct lguest_driver {
38 const char *name;
39 struct module *owner;
40 u16 device_type;
41 int (*probe)(struct lguest_device *dev);
42 void (*remove)(struct lguest_device *dev);
43
44 struct device_driver drv;
45};
46
47extern int register_lguest_driver(struct lguest_driver *drv);
48extern void unregister_lguest_driver(struct lguest_driver *drv);
49
50extern struct lguest_device_desc *lguest_devices; /* Just past max_pfn */
51#endif /* _ASM_LGUEST_DEVICE_H */
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h
new file mode 100644
index 000000000000..641670579446
--- /dev/null
+++ b/include/linux/lguest_launcher.h
@@ -0,0 +1,127 @@
1#ifndef _ASM_LGUEST_USER
2#define _ASM_LGUEST_USER
3/* Everything the "lguest" userspace program needs to know. */
4/* They can register up to 32 arrays of lguest_dma. */
5#define LGUEST_MAX_DMA 32
6/* At most we can dma 16 lguest_dma in one op. */
7#define LGUEST_MAX_DMA_SECTIONS 16
8
9/* How many devices? Assume each one wants up to two dma arrays per device. */
10#define LGUEST_MAX_DEVICES (LGUEST_MAX_DMA/2)
11
12/*D:200
13 * Lguest I/O
14 *
15 * The lguest I/O mechanism is the only way Guests can talk to devices. There
16 * are two hypercalls involved: SEND_DMA for output and BIND_DMA for input. In
17 * each case, "struct lguest_dma" describes the buffer: this contains 16
18 * addr/len pairs, and if there are fewer buffer elements the len array is
19 * terminated with a 0.
20 *
21 * I/O is organized by keys: BIND_DMA attaches buffers to a particular key, and
22 * SEND_DMA transfers to buffers bound to particular key. By convention, keys
23 * correspond to a physical address within the device's page. This means that
24 * devices will never accidentally end up with the same keys, and allows the
25 * Host use The Futex Trick (as we'll see later in our journey).
26 *
27 * SEND_DMA simply indicates a key to send to, and the physical address of the
28 * "struct lguest_dma" to send. The Host will write the number of bytes
29 * transferred into the "struct lguest_dma"'s used_len member.
30 *
31 * BIND_DMA indicates a key to bind to, a pointer to an array of "struct
32 * lguest_dma"s ready for receiving, the size of that array, and an interrupt
33 * to trigger when data is received. The Host will only allow transfers into
34 * buffers with a used_len of zero: it then sets used_len to the number of
35 * bytes transferred and triggers the interrupt for the Guest to process the
36 * new input. */
37struct lguest_dma
38{
39 /* 0 if free to be used, filled by the Host. */
40 u32 used_len;
41 unsigned long addr[LGUEST_MAX_DMA_SECTIONS];
42 u16 len[LGUEST_MAX_DMA_SECTIONS];
43};
44/*:*/
45
46/*D:460 This is the layout of a block device memory page. The Launcher sets up
47 * the num_sectors initially to tell the Guest the size of the disk. The Guest
48 * puts the type, sector and length of the request in the first three fields,
49 * then DMAs to the Host. The Host processes the request, sets up the result,
50 * then DMAs back to the Guest. */
51struct lguest_block_page
52{
53 /* 0 is a read, 1 is a write. */
54 int type;
55 u32 sector; /* Offset in device = sector * 512. */
56 u32 bytes; /* Length expected to be read/written in bytes */
57 /* 0 = pending, 1 = done, 2 = done, error */
58 int result;
59 u32 num_sectors; /* Disk length = num_sectors * 512 */
60};
61
62/*D:520 The network device is basically a memory page where all the Guests on
63 * the network publish their MAC (ethernet) addresses: it's an array of "struct
64 * lguest_net": */
65struct lguest_net
66{
67 /* Simply the mac address (with multicast bit meaning promisc). */
68 unsigned char mac[6];
69};
70/*:*/
71
72/* Where the Host expects the Guest to SEND_DMA console output to. */
73#define LGUEST_CONSOLE_DMA_KEY 0
74
75/*D:010
76 * Drivers
77 *
78 * The Guest needs devices to do anything useful. Since we don't let it touch
79 * real devices (think of the damage it could do!) we provide virtual devices.
80 * We could emulate a PCI bus with various devices on it, but that is a fairly
81 * complex burden for the Host and suboptimal for the Guest, so we have our own
82 * "lguest" bus and simple drivers.
83 *
84 * Devices are described by an array of LGUEST_MAX_DEVICES of these structs,
85 * placed by the Launcher just above the top of physical memory:
86 */
87struct lguest_device_desc {
88 /* The device type: console, network, disk etc. */
89 u16 type;
90#define LGUEST_DEVICE_T_CONSOLE 1
91#define LGUEST_DEVICE_T_NET 2
92#define LGUEST_DEVICE_T_BLOCK 3
93
94 /* The specific features of this device: these depends on device type
95 * except for LGUEST_DEVICE_F_RANDOMNESS. */
96 u16 features;
97#define LGUEST_NET_F_NOCSUM 0x4000 /* Don't bother checksumming */
98#define LGUEST_DEVICE_F_RANDOMNESS 0x8000 /* IRQ is fairly random */
99
100 /* This is how the Guest reports status of the device: the Host can set
101 * LGUEST_DEVICE_S_REMOVED to indicate removal, but the rest are only
102 * ever manipulated by the Guest, and only ever set. */
103 u16 status;
104/* 256 and above are device specific. */
105#define LGUEST_DEVICE_S_ACKNOWLEDGE 1 /* We have seen device. */
106#define LGUEST_DEVICE_S_DRIVER 2 /* We have found a driver */
107#define LGUEST_DEVICE_S_DRIVER_OK 4 /* Driver says OK! */
108#define LGUEST_DEVICE_S_REMOVED 8 /* Device has gone away. */
109#define LGUEST_DEVICE_S_REMOVED_ACK 16 /* Driver has been told. */
110#define LGUEST_DEVICE_S_FAILED 128 /* Something actually failed */
111
112 /* Each device exists somewhere in Guest physical memory, over some
113 * number of pages. */
114 u16 num_pages;
115 u32 pfn;
116};
117/*:*/
118
119/* Write command first word is a request. */
120enum lguest_req
121{
122 LHREQ_INITIALIZE, /* + pfnlimit, pgdir, start, pageoffset */
123 LHREQ_GETDMA, /* + addr (returns &lguest_dma, irq in ->used_len) */
124 LHREQ_IRQ, /* + irq */
125 LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */
126};
127#endif /* _ASM_LGUEST_USER */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 47cd2a1c5544..a67bb9075e9b 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -216,6 +216,8 @@ enum {
216 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ 216 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */
217 ATA_HOST_STARTED = (1 << 1), /* Host started */ 217 ATA_HOST_STARTED = (1 << 1), /* Host started */
218 218
219 /* bits 24:31 of host->flags are reserved for LLD specific flags */
220
219 /* various lengths of time */ 221 /* various lengths of time */
220 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ 222 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */
221 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ 223 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */
@@ -301,6 +303,7 @@ enum {
301 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ 303 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */
302 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ 304 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */
303 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ 305 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */
306 ATA_HORKAGE_BROKEN_HPA = (1 << 4), /* Broken HPA */
304}; 307};
305 308
306enum hsm_task_states { 309enum hsm_task_states {
@@ -323,6 +326,7 @@ enum ata_completion_errors {
323 AC_ERR_INVALID = (1 << 7), /* invalid argument */ 326 AC_ERR_INVALID = (1 << 7), /* invalid argument */
324 AC_ERR_OTHER = (1 << 8), /* unknown */ 327 AC_ERR_OTHER = (1 << 8), /* unknown */
325 AC_ERR_NODEV_HINT = (1 << 9), /* polling device detection hint */ 328 AC_ERR_NODEV_HINT = (1 << 9), /* polling device detection hint */
329 AC_ERR_NCQ = (1 << 10), /* marker for offending NCQ qc */
326}; 330};
327 331
328/* forward declarations */ 332/* forward declarations */
@@ -411,6 +415,7 @@ struct ata_queued_cmd {
411 ata_qc_cb_t complete_fn; 415 ata_qc_cb_t complete_fn;
412 416
413 void *private_data; 417 void *private_data;
418 void *lldd_task;
414}; 419};
415 420
416struct ata_port_stats { 421struct ata_port_stats {
@@ -530,6 +535,7 @@ struct ata_port {
530 unsigned int cbl; /* cable type; ATA_CBL_xxx */ 535 unsigned int cbl; /* cable type; ATA_CBL_xxx */
531 unsigned int hw_sata_spd_limit; 536 unsigned int hw_sata_spd_limit;
532 unsigned int sata_spd_limit; /* SATA PHY speed limit */ 537 unsigned int sata_spd_limit; /* SATA PHY speed limit */
538 unsigned int sata_spd; /* current SATA PHY speed */
533 539
534 /* record runtime error info, protected by host lock */ 540 /* record runtime error info, protected by host lock */
535 struct ata_eh_info eh_info; 541 struct ata_eh_info eh_info;
@@ -563,6 +569,9 @@ struct ata_port {
563 pm_message_t pm_mesg; 569 pm_message_t pm_mesg;
564 int *pm_result; 570 int *pm_result;
565 571
572 struct timer_list fastdrain_timer;
573 unsigned long fastdrain_cnt;
574
566 void *private_data; 575 void *private_data;
567 576
568#ifdef CONFIG_ATA_ACPI 577#ifdef CONFIG_ATA_ACPI
@@ -619,9 +628,8 @@ struct ata_port_operations {
619 u8 (*irq_on) (struct ata_port *); 628 u8 (*irq_on) (struct ata_port *);
620 u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq); 629 u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq);
621 630
622 u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); 631 int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, u32 *val);
623 void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 632 int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, u32 val);
624 u32 val);
625 633
626 int (*port_suspend) (struct ata_port *ap, pm_message_t mesg); 634 int (*port_suspend) (struct ata_port *ap, pm_message_t mesg);
627 int (*port_resume) (struct ata_port *ap); 635 int (*port_resume) (struct ata_port *ap);
@@ -764,7 +772,8 @@ extern unsigned int ata_dev_try_classify(struct ata_port *, unsigned int, u8 *);
764 */ 772 */
765extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); 773extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
766extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); 774extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
767extern void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp); 775extern void ata_tf_to_fis(const struct ata_taskfile *tf,
776 u8 pmp, int is_cmd, u8 *fis);
768extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); 777extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf);
769extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); 778extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device);
770extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); 779extern void ata_std_dev_select (struct ata_port *ap, unsigned int device);
@@ -909,27 +918,21 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
909/* 918/*
910 * ata_eh_info helpers 919 * ata_eh_info helpers
911 */ 920 */
912#define ata_ehi_push_desc(ehi, fmt, args...) do { \ 921extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
913 (ehi)->desc_len += scnprintf((ehi)->desc + (ehi)->desc_len, \ 922extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
914 ATA_EH_DESC_LEN - (ehi)->desc_len, \ 923extern void ata_ehi_clear_desc(struct ata_eh_info *ehi);
915 fmt , ##args); \ 924
916} while (0) 925static inline void ata_ehi_schedule_probe(struct ata_eh_info *ehi)
917
918#define ata_ehi_clear_desc(ehi) do { \
919 (ehi)->desc[0] = '\0'; \
920 (ehi)->desc_len = 0; \
921} while (0)
922
923static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi)
924{ 926{
925 ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK; 927 ehi->flags |= ATA_EHI_RESUME_LINK;
926 ehi->action |= ATA_EH_SOFTRESET; 928 ehi->action |= ATA_EH_SOFTRESET;
927 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; 929 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
928} 930}
929 931
930static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) 932static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
931{ 933{
932 __ata_ehi_hotplugged(ehi); 934 ata_ehi_schedule_probe(ehi);
935 ehi->flags |= ATA_EHI_HOTPLUGGED;
933 ehi->err_mask |= AC_ERR_ATA_BUS; 936 ehi->err_mask |= AC_ERR_ATA_BUS;
934} 937}
935 938
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 14c937d345cb..0e843bf65877 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -1,7 +1,8 @@
1/* 1/*
2 * Runtime locking correctness validator 2 * Runtime locking correctness validator
3 * 3 *
4 * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> 4 * Copyright (C) 2006,2007 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
5 * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com>
5 * 6 *
6 * see Documentation/lockdep-design.txt for more details. 7 * see Documentation/lockdep-design.txt for more details.
7 */ 8 */
@@ -9,6 +10,7 @@
9#define __LINUX_LOCKDEP_H 10#define __LINUX_LOCKDEP_H
10 11
11struct task_struct; 12struct task_struct;
13struct lockdep_map;
12 14
13#ifdef CONFIG_LOCKDEP 15#ifdef CONFIG_LOCKDEP
14 16
@@ -114,8 +116,44 @@ struct lock_class {
114 116
115 const char *name; 117 const char *name;
116 int name_version; 118 int name_version;
119
120#ifdef CONFIG_LOCK_STAT
121 unsigned long contention_point[4];
122#endif
123};
124
125#ifdef CONFIG_LOCK_STAT
126struct lock_time {
127 s64 min;
128 s64 max;
129 s64 total;
130 unsigned long nr;
131};
132
133enum bounce_type {
134 bounce_acquired_write,
135 bounce_acquired_read,
136 bounce_contended_write,
137 bounce_contended_read,
138 nr_bounce_types,
139
140 bounce_acquired = bounce_acquired_write,
141 bounce_contended = bounce_contended_write,
117}; 142};
118 143
144struct lock_class_stats {
145 unsigned long contention_point[4];
146 struct lock_time read_waittime;
147 struct lock_time write_waittime;
148 struct lock_time read_holdtime;
149 struct lock_time write_holdtime;
150 unsigned long bounces[nr_bounce_types];
151};
152
153struct lock_class_stats lock_stats(struct lock_class *class);
154void clear_lock_stats(struct lock_class *class);
155#endif
156
119/* 157/*
120 * Map the lock object (the lock instance) to the lock-class object. 158 * Map the lock object (the lock instance) to the lock-class object.
121 * This is embedded into specific lock instances: 159 * This is embedded into specific lock instances:
@@ -124,6 +162,9 @@ struct lockdep_map {
124 struct lock_class_key *key; 162 struct lock_class_key *key;
125 struct lock_class *class_cache; 163 struct lock_class *class_cache;
126 const char *name; 164 const char *name;
165#ifdef CONFIG_LOCK_STAT
166 int cpu;
167#endif
127}; 168};
128 169
129/* 170/*
@@ -165,6 +206,10 @@ struct held_lock {
165 unsigned long acquire_ip; 206 unsigned long acquire_ip;
166 struct lockdep_map *instance; 207 struct lockdep_map *instance;
167 208
209#ifdef CONFIG_LOCK_STAT
210 u64 waittime_stamp;
211 u64 holdtime_stamp;
212#endif
168 /* 213 /*
169 * The lock-stack is unified in that the lock chains of interrupt 214 * The lock-stack is unified in that the lock chains of interrupt
170 * contexts nest ontop of process context chains, but we 'separate' 215 * contexts nest ontop of process context chains, but we 'separate'
@@ -281,6 +326,30 @@ struct lock_class_key { };
281 326
282#endif /* !LOCKDEP */ 327#endif /* !LOCKDEP */
283 328
329#ifdef CONFIG_LOCK_STAT
330
331extern void lock_contended(struct lockdep_map *lock, unsigned long ip);
332extern void lock_acquired(struct lockdep_map *lock);
333
334#define LOCK_CONTENDED(_lock, try, lock) \
335do { \
336 if (!try(_lock)) { \
337 lock_contended(&(_lock)->dep_map, _RET_IP_); \
338 lock(_lock); \
339 } \
340 lock_acquired(&(_lock)->dep_map); \
341} while (0)
342
343#else /* CONFIG_LOCK_STAT */
344
345#define lock_contended(lockdep_map, ip) do {} while (0)
346#define lock_acquired(lockdep_map) do {} while (0)
347
348#define LOCK_CONTENDED(_lock, try, lock) \
349 lock(_lock)
350
351#endif /* CONFIG_LOCK_STAT */
352
284#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS) 353#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS)
285extern void early_init_irq_lock_class(void); 354extern void early_init_irq_lock_class(void);
286#else 355#else
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 0b99b31f017b..26a0a103898f 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -63,7 +63,7 @@ struct loop_device {
63 struct task_struct *lo_thread; 63 struct task_struct *lo_thread;
64 wait_queue_head_t lo_event; 64 wait_queue_head_t lo_event;
65 65
66 request_queue_t *lo_queue; 66 struct request_queue *lo_queue;
67 struct gendisk *lo_disk; 67 struct gendisk *lo_disk;
68 struct list_head lo_list; 68 struct list_head lo_list;
69}; 69};
diff --git a/include/linux/major.h b/include/linux/major.h
index 7e7c9093919a..0cb98053537a 100644
--- a/include/linux/major.h
+++ b/include/linux/major.h
@@ -158,6 +158,8 @@
158#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */ 158#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */
159#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */ 159#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */
160 160
161#define XENVBD_MAJOR 202 /* Xen virtual block device */
162
161#define MSR_MAJOR 202 163#define MSR_MAJOR 202
162#define CPUID_MAJOR 203 164#define CPUID_MAJOR 203
163 165
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index e147cf50529f..5bdd656e88cf 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -166,7 +166,7 @@ extern enum zone_type policy_zone;
166 166
167static inline void check_highest_zone(enum zone_type k) 167static inline void check_highest_zone(enum zone_type k)
168{ 168{
169 if (k > policy_zone) 169 if (k > policy_zone && k != ZONE_MOVABLE)
170 policy_zone = k; 170 policy_zone = k;
171} 171}
172 172
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a5c451816fdc..1692dd6cb915 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -10,7 +10,6 @@
10#include <linux/mmzone.h> 10#include <linux/mmzone.h>
11#include <linux/rbtree.h> 11#include <linux/rbtree.h>
12#include <linux/prio_tree.h> 12#include <linux/prio_tree.h>
13#include <linux/fs.h>
14#include <linux/mutex.h> 13#include <linux/mutex.h>
15#include <linux/debug_locks.h> 14#include <linux/debug_locks.h>
16#include <linux/backing-dev.h> 15#include <linux/backing-dev.h>
@@ -18,7 +17,9 @@
18 17
19struct mempolicy; 18struct mempolicy;
20struct anon_vma; 19struct anon_vma;
20struct file_ra_state;
21struct user_struct; 21struct user_struct;
22struct writeback_control;
22 23
23#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ 24#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */
24extern unsigned long max_mapnr; 25extern unsigned long max_mapnr;
@@ -168,6 +169,8 @@ extern unsigned int kobjsize(const void *objp);
168#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */ 169#define VM_INSERTPAGE 0x02000000 /* The vma has had "vm_insert_page()" done on it */
169#define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */ 170#define VM_ALWAYSDUMP 0x04000000 /* Always include in core dumps */
170 171
172#define VM_CAN_NONLINEAR 0x08000000 /* Has ->fault & does nonlinear pages */
173
171#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ 174#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
172#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS 175#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
173#endif 176#endif
@@ -190,6 +193,30 @@ extern unsigned int kobjsize(const void *objp);
190 */ 193 */
191extern pgprot_t protection_map[16]; 194extern pgprot_t protection_map[16];
192 195
196#define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */
197#define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */
198
199
200/*
201 * vm_fault is filled by the the pagefault handler and passed to the vma's
202 * ->fault function. The vma's ->fault is responsible for returning a bitmask
203 * of VM_FAULT_xxx flags that give details about how the fault was handled.
204 *
205 * pgoff should be used in favour of virtual_address, if possible. If pgoff
206 * is used, one may set VM_CAN_NONLINEAR in the vma->vm_flags to get nonlinear
207 * mapping support.
208 */
209struct vm_fault {
210 unsigned int flags; /* FAULT_FLAG_xxx flags */
211 pgoff_t pgoff; /* Logical page offset based on vma */
212 void __user *virtual_address; /* Faulting virtual address */
213
214 struct page *page; /* ->fault handlers should return a
215 * page here, unless VM_FAULT_NOPAGE
216 * is set (which is also implied by
217 * VM_FAULT_ERROR).
218 */
219};
193 220
194/* 221/*
195 * These are the virtual MM functions - opening of an area, closing and 222 * These are the virtual MM functions - opening of an area, closing and
@@ -199,9 +226,11 @@ extern pgprot_t protection_map[16];
199struct vm_operations_struct { 226struct vm_operations_struct {
200 void (*open)(struct vm_area_struct * area); 227 void (*open)(struct vm_area_struct * area);
201 void (*close)(struct vm_area_struct * area); 228 void (*close)(struct vm_area_struct * area);
202 struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); 229 int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);
203 unsigned long (*nopfn)(struct vm_area_struct * area, unsigned long address); 230 struct page *(*nopage)(struct vm_area_struct *area,
204 int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); 231 unsigned long address, int *type);
232 unsigned long (*nopfn)(struct vm_area_struct *area,
233 unsigned long address);
205 234
206 /* notification that a previously read-only page is about to become 235 /* notification that a previously read-only page is about to become
207 * writable, if an error is returned it will cause a SIGBUS */ 236 * writable, if an error is returned it will cause a SIGBUS */
@@ -655,7 +684,6 @@ static inline int page_mapped(struct page *page)
655 */ 684 */
656#define NOPAGE_SIGBUS (NULL) 685#define NOPAGE_SIGBUS (NULL)
657#define NOPAGE_OOM ((struct page *) (-1)) 686#define NOPAGE_OOM ((struct page *) (-1))
658#define NOPAGE_REFAULT ((struct page *) (-2)) /* Return to userspace, rerun */
659 687
660/* 688/*
661 * Error return values for the *_nopfn functions 689 * Error return values for the *_nopfn functions
@@ -669,16 +697,18 @@ static inline int page_mapped(struct page *page)
669 * Used to decide whether a process gets delivered SIGBUS or 697 * Used to decide whether a process gets delivered SIGBUS or
670 * just gets major/minor fault counters bumped up. 698 * just gets major/minor fault counters bumped up.
671 */ 699 */
672#define VM_FAULT_OOM 0x00 700
673#define VM_FAULT_SIGBUS 0x01 701#define VM_FAULT_MINOR 0 /* For backwards compat. Remove me quickly. */
674#define VM_FAULT_MINOR 0x02 702
675#define VM_FAULT_MAJOR 0x03 703#define VM_FAULT_OOM 0x0001
676 704#define VM_FAULT_SIGBUS 0x0002
677/* 705#define VM_FAULT_MAJOR 0x0004
678 * Special case for get_user_pages. 706#define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */
679 * Must be in a distinct bit from the above VM_FAULT_ flags. 707
680 */ 708#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */
681#define VM_FAULT_WRITE 0x10 709#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */
710
711#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS)
682 712
683#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) 713#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
684 714
@@ -762,20 +792,10 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
762 792
763extern int vmtruncate(struct inode * inode, loff_t offset); 793extern int vmtruncate(struct inode * inode, loff_t offset);
764extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); 794extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end);
765extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot);
766extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot);
767 795
768#ifdef CONFIG_MMU 796#ifdef CONFIG_MMU
769extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, 797extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
770 unsigned long address, int write_access); 798 unsigned long address, int write_access);
771
772static inline int handle_mm_fault(struct mm_struct *mm,
773 struct vm_area_struct *vma, unsigned long address,
774 int write_access)
775{
776 return __handle_mm_fault(mm, vma, address, write_access) &
777 (~VM_FAULT_WRITE);
778}
779#else 799#else
780static inline int handle_mm_fault(struct mm_struct *mm, 800static inline int handle_mm_fault(struct mm_struct *mm,
781 struct vm_area_struct *vma, unsigned long address, 801 struct vm_area_struct *vma, unsigned long address,
@@ -789,7 +809,6 @@ static inline int handle_mm_fault(struct mm_struct *mm,
789 809
790extern int make_pages_present(unsigned long addr, unsigned long end); 810extern int make_pages_present(unsigned long addr, unsigned long end);
791extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); 811extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
792void install_arg_page(struct vm_area_struct *, struct page *, unsigned long);
793 812
794int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, 813int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start,
795 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); 814 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas);
@@ -806,9 +825,15 @@ int FASTCALL(set_page_dirty(struct page *page));
806int set_page_dirty_lock(struct page *page); 825int set_page_dirty_lock(struct page *page);
807int clear_page_dirty_for_io(struct page *page); 826int clear_page_dirty_for_io(struct page *page);
808 827
828extern unsigned long move_page_tables(struct vm_area_struct *vma,
829 unsigned long old_addr, struct vm_area_struct *new_vma,
830 unsigned long new_addr, unsigned long len);
809extern unsigned long do_mremap(unsigned long addr, 831extern unsigned long do_mremap(unsigned long addr,
810 unsigned long old_len, unsigned long new_len, 832 unsigned long old_len, unsigned long new_len,
811 unsigned long flags, unsigned long new_addr); 833 unsigned long flags, unsigned long new_addr);
834extern int mprotect_fixup(struct vm_area_struct *vma,
835 struct vm_area_struct **pprev, unsigned long start,
836 unsigned long end, unsigned long newflags);
812 837
813/* 838/*
814 * A callback you can register to apply pressure to ageable caches. 839 * A callback you can register to apply pressure to ageable caches.
@@ -837,38 +862,7 @@ struct shrinker {
837extern void register_shrinker(struct shrinker *); 862extern void register_shrinker(struct shrinker *);
838extern void unregister_shrinker(struct shrinker *); 863extern void unregister_shrinker(struct shrinker *);
839 864
840/* 865int vma_wants_writenotify(struct vm_area_struct *vma);
841 * Some shared mappigns will want the pages marked read-only
842 * to track write events. If so, we'll downgrade vm_page_prot
843 * to the private version (using protection_map[] without the
844 * VM_SHARED bit).
845 */
846static inline int vma_wants_writenotify(struct vm_area_struct *vma)
847{
848 unsigned int vm_flags = vma->vm_flags;
849
850 /* If it was private or non-writable, the write bit is already clear */
851 if ((vm_flags & (VM_WRITE|VM_SHARED)) != ((VM_WRITE|VM_SHARED)))
852 return 0;
853
854 /* The backer wishes to know when pages are first written to? */
855 if (vma->vm_ops && vma->vm_ops->page_mkwrite)
856 return 1;
857
858 /* The open routine did something to the protections already? */
859 if (pgprot_val(vma->vm_page_prot) !=
860 pgprot_val(protection_map[vm_flags &
861 (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)]))
862 return 0;
863
864 /* Specialty mapping? */
865 if (vm_flags & (VM_PFNMAP|VM_INSERTPAGE))
866 return 0;
867
868 /* Can the mapping track the dirty pages? */
869 return vma->vm_file && vma->vm_file->f_mapping &&
870 mapping_cap_account_dirty(vma->vm_file->f_mapping);
871}
872 866
873extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); 867extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl));
874 868
@@ -1048,7 +1042,7 @@ static inline void vma_nonlinear_insert(struct vm_area_struct *vma,
1048} 1042}
1049 1043
1050/* mmap.c */ 1044/* mmap.c */
1051extern int __vm_enough_memory(long pages, int cap_sys_admin); 1045extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin);
1052extern void vma_adjust(struct vm_area_struct *vma, unsigned long start, 1046extern void vma_adjust(struct vm_area_struct *vma, unsigned long start,
1053 unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert); 1047 unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert);
1054extern struct vm_area_struct *vma_merge(struct mm_struct *, 1048extern struct vm_area_struct *vma_merge(struct mm_struct *,
@@ -1104,9 +1098,7 @@ extern void truncate_inode_pages_range(struct address_space *,
1104 loff_t lstart, loff_t lend); 1098 loff_t lstart, loff_t lend);
1105 1099
1106/* generic vm_area_ops exported for stackable file systems */ 1100/* generic vm_area_ops exported for stackable file systems */
1107extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *); 1101extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
1108extern int filemap_populate(struct vm_area_struct *, unsigned long,
1109 unsigned long, pgprot_t, unsigned long, int);
1110 1102
1111/* mm/page-writeback.c */ 1103/* mm/page-writeback.c */
1112int write_one_page(struct page *page, int wait); 1104int write_one_page(struct page *page, int wait);
@@ -1121,13 +1113,20 @@ int do_page_cache_readahead(struct address_space *mapping, struct file *filp,
1121 pgoff_t offset, unsigned long nr_to_read); 1113 pgoff_t offset, unsigned long nr_to_read);
1122int force_page_cache_readahead(struct address_space *mapping, struct file *filp, 1114int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
1123 pgoff_t offset, unsigned long nr_to_read); 1115 pgoff_t offset, unsigned long nr_to_read);
1124unsigned long page_cache_readahead(struct address_space *mapping, 1116
1125 struct file_ra_state *ra, 1117void page_cache_sync_readahead(struct address_space *mapping,
1126 struct file *filp, 1118 struct file_ra_state *ra,
1127 pgoff_t offset, 1119 struct file *filp,
1128 unsigned long size); 1120 pgoff_t offset,
1129void handle_ra_miss(struct address_space *mapping, 1121 unsigned long size);
1130 struct file_ra_state *ra, pgoff_t offset); 1122
1123void page_cache_async_readahead(struct address_space *mapping,
1124 struct file_ra_state *ra,
1125 struct file *filp,
1126 struct page *pg,
1127 pgoff_t offset,
1128 unsigned long size);
1129
1131unsigned long max_sane_readahead(unsigned long nr); 1130unsigned long max_sane_readahead(unsigned long nr);
1132 1131
1133/* Do stack extension */ 1132/* Do stack extension */
@@ -1135,6 +1134,8 @@ extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
1135#ifdef CONFIG_IA64 1134#ifdef CONFIG_IA64
1136extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); 1135extern int expand_upwards(struct vm_area_struct *vma, unsigned long address);
1137#endif 1136#endif
1137extern int expand_stack_downwards(struct vm_area_struct *vma,
1138 unsigned long address);
1138 1139
1139/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ 1140/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */
1140extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); 1141extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr);
@@ -1215,7 +1216,7 @@ void drop_slab(void);
1215extern int randomize_va_space; 1216extern int randomize_va_space;
1216#endif 1217#endif
1217 1218
1218__attribute__((weak)) const char *arch_vma_name(struct vm_area_struct *vma); 1219const char * arch_vma_name(struct vm_area_struct *vma);
1219 1220
1220#endif /* __KERNEL__ */ 1221#endif /* __KERNEL__ */
1221#endif /* _LINUX_MM_H */ 1222#endif /* _LINUX_MM_H */
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 04bbe12fae8d..63a80ea61124 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -99,7 +99,7 @@ struct mmc_request {
99struct mmc_host; 99struct mmc_host;
100struct mmc_card; 100struct mmc_card;
101 101
102extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *); 102extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
103extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); 103extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
104extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, 104extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
105 struct mmc_command *, int); 105 struct mmc_command *, int);
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index da8eb8ad9e9b..4e5627379b09 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -120,7 +120,6 @@ enum zone_type {
120 * --------------------------- 120 * ---------------------------
121 * parisc, ia64, sparc <4G 121 * parisc, ia64, sparc <4G
122 * s390 <2G 122 * s390 <2G
123 * arm26 <48M
124 * arm Various 123 * arm Various
125 * alpha Unlimited or 0-16MB. 124 * alpha Unlimited or 0-16MB.
126 * 125 *
@@ -411,6 +410,24 @@ struct zonelist {
411#endif 410#endif
412}; 411};
413 412
413#ifdef CONFIG_NUMA
414/*
415 * Only custom zonelists like MPOL_BIND need to be filtered as part of
416 * policies. As described in the comment for struct zonelist_cache, these
417 * zonelists will not have a zlcache so zlcache_ptr will not be set. Use
418 * that to determine if the zonelists needs to be filtered or not.
419 */
420static inline int alloc_should_filter_zonelist(struct zonelist *zonelist)
421{
422 return !zonelist->zlcache_ptr;
423}
424#else
425static inline int alloc_should_filter_zonelist(struct zonelist *zonelist)
426{
427 return 0;
428}
429#endif /* CONFIG_NUMA */
430
414#ifdef CONFIG_ARCH_POPULATES_NODE_MAP 431#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
415struct node_active_region { 432struct node_active_region {
416 unsigned long start_pfn; 433 unsigned long start_pfn;
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index af04a555b52c..4dc5fa8be781 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -159,6 +159,13 @@ struct ap_device_id {
159 159
160#define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01 160#define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01
161 161
162#define ACPI_ID_LEN 16 /* only 9 bytes needed here, 16 bytes are used */
163 /* to workaround crosscompile issues */
164
165struct acpi_device_id {
166 __u8 id[ACPI_ID_LEN];
167 kernel_ulong_t driver_data;
168};
162 169
163#define PNP_ID_LEN 8 170#define PNP_ID_LEN 8
164#define PNP_MAX_DEVICES 8 171#define PNP_MAX_DEVICES 8
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h
index b021b3a2b65a..9c8049005052 100644
--- a/include/linux/mv643xx.h
+++ b/include/linux/mv643xx.h
@@ -1302,4 +1302,12 @@ struct mv643xx_eth_platform_data {
1302 u8 mac_addr[6]; /* mac address if non-zero*/ 1302 u8 mac_addr[6]; /* mac address if non-zero*/
1303}; 1303};
1304 1304
1305/* Watchdog Platform Device, Driver Data */
1306#define MV64x60_WDT_NAME "mv64x60_wdt"
1307
1308struct mv64x60_wdt_pdata {
1309 int timeout; /* watchdog expiry in seconds, default 10 */
1310 int bus_clk; /* bus clock in MHz, default 133 */
1311};
1312
1305#endif /* __ASM_MV643XX_H */ 1313#endif /* __ASM_MV643XX_H */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index b7dd24917f0d..6c38efbd810f 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -69,8 +69,8 @@ extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struc
69#define user_path_walk_link(name,nd) \ 69#define user_path_walk_link(name,nd) \
70 __user_walk_fd(AT_FDCWD, name, 0, nd) 70 __user_walk_fd(AT_FDCWD, name, 0, nd)
71extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *)); 71extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
72extern int FASTCALL(path_walk(const char *, struct nameidata *)); 72extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
73extern int FASTCALL(link_path_walk(const char *, struct nameidata *)); 73 const char *, unsigned int, struct nameidata *);
74extern void path_release(struct nameidata *); 74extern void path_release(struct nameidata *);
75extern void path_release_on_umount(struct nameidata *); 75extern void path_release_on_umount(struct nameidata *);
76 76
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index da7a13c97eb8..e679b2751665 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -575,7 +575,7 @@ struct net_device
575 575
576 /* The TX queue control structures */ 576 /* The TX queue control structures */
577 unsigned int egress_subqueue_count; 577 unsigned int egress_subqueue_count;
578 struct net_device_subqueue egress_subqueue[0]; 578 struct net_device_subqueue egress_subqueue[1];
579}; 579};
580#define to_net_dev(d) container_of(d, struct net_device, dev) 580#define to_net_dev(d) container_of(d, struct net_device, dev)
581 581
@@ -1098,10 +1098,8 @@ extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all
1098extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); 1098extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly);
1099extern int dev_mc_sync(struct net_device *to, struct net_device *from); 1099extern int dev_mc_sync(struct net_device *to, struct net_device *from);
1100extern void dev_mc_unsync(struct net_device *to, struct net_device *from); 1100extern void dev_mc_unsync(struct net_device *to, struct net_device *from);
1101extern void dev_mc_discard(struct net_device *dev);
1102extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all); 1101extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all);
1103extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); 1102extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly);
1104extern void __dev_addr_discard(struct dev_addr_list **list);
1105extern void dev_set_promiscuity(struct net_device *dev, int inc); 1103extern void dev_set_promiscuity(struct net_device *dev, int inc);
1106extern void dev_set_allmulti(struct net_device *dev, int inc); 1104extern void dev_set_allmulti(struct net_device *dev, int inc);
1107extern void netdev_state_change(struct net_device *dev); 1105extern void netdev_state_change(struct net_device *dev);
@@ -1133,6 +1131,8 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
1133 1131
1134extern void linkwatch_run_queue(void); 1132extern void linkwatch_run_queue(void);
1135 1133
1134extern int netdev_compute_features(unsigned long all, unsigned long one);
1135
1136static inline int net_gso_ok(int features, int gso_type) 1136static inline int net_gso_ok(int features, int gso_type)
1137{ 1137{
1138 int feature = gso_type << NETIF_F_GSO_SHIFT; 1138 int feature = gso_type << NETIF_F_GSO_SHIFT;
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 0eed0b7ab2df..1dd075eda595 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -88,9 +88,8 @@ struct nf_sockopt_ops
88 int (*compat_get)(struct sock *sk, int optval, 88 int (*compat_get)(struct sock *sk, int optval,
89 void __user *user, int *len); 89 void __user *user, int *len);
90 90
91 /* Number of users inside set() or get(). */ 91 /* Use the module struct to lock set/get code in place */
92 unsigned int use; 92 struct module *owner;
93 struct task_struct *cleanup_task;
94}; 93};
95 94
96/* Each queued (to userspace) skbuff has one of these. */ 95/* Each queued (to userspace) skbuff has one of these. */
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 43397a414cd6..ab57cb7d7c61 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -28,6 +28,7 @@ header-y += xt_policy.h
28header-y += xt_realm.h 28header-y += xt_realm.h
29header-y += xt_sctp.h 29header-y += xt_sctp.h
30header-y += xt_state.h 30header-y += xt_state.h
31header-y += xt_statistic.h
31header-y += xt_string.h 32header-y += xt_string.h
32header-y += xt_tcpmss.h 33header-y += xt_tcpmss.h
33header-y += xt_tcpudp.h 34header-y += xt_tcpudp.h
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h
index 90ae8b474cb8..37e933c9987d 100644
--- a/include/linux/netfilter/xt_connlimit.h
+++ b/include/linux/netfilter/xt_connlimit.h
@@ -5,8 +5,8 @@ struct xt_connlimit_data;
5 5
6struct xt_connlimit_info { 6struct xt_connlimit_info {
7 union { 7 union {
8 u_int32_t v4_mask; 8 __be32 v4_mask;
9 u_int32_t v6_mask[4]; 9 __be32 v6_mask[4];
10 }; 10 };
11 unsigned int limit, inverse; 11 unsigned int limit, inverse;
12 12
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h
index 34ab0fb736e2..a92fefc3c7ec 100644
--- a/include/linux/netfilter_ipv4/ipt_iprange.h
+++ b/include/linux/netfilter_ipv4/ipt_iprange.h
@@ -1,6 +1,8 @@
1#ifndef _IPT_IPRANGE_H 1#ifndef _IPT_IPRANGE_H
2#define _IPT_IPRANGE_H 2#define _IPT_IPRANGE_H
3 3
4#include <linux/types.h>
5
4#define IPRANGE_SRC 0x01 /* Match source IP address */ 6#define IPRANGE_SRC 0x01 /* Match source IP address */
5#define IPRANGE_DST 0x02 /* Match destination IP address */ 7#define IPRANGE_DST 0x02 /* Match destination IP address */
6#define IPRANGE_SRC_INV 0x10 /* Negate the condition */ 8#define IPRANGE_SRC_INV 0x10 /* Negate the condition */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 2e23353c28a5..83d8239f0cce 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -161,6 +161,8 @@ extern struct sock *netlink_kernel_create(int unit, unsigned int groups,
161 void (*input)(struct sock *sk, int len), 161 void (*input)(struct sock *sk, int len),
162 struct mutex *cb_mutex, 162 struct mutex *cb_mutex,
163 struct module *module); 163 struct module *module);
164extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
165extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group);
164extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 166extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
165extern int netlink_has_listeners(struct sock *sk, unsigned int group); 167extern int netlink_has_listeners(struct sock *sk, unsigned int group);
166extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); 168extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock);
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index c098ae194f79..7250eeadd7b5 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -71,7 +71,7 @@ struct nfs_access_entry {
71 71
72struct nfs4_state; 72struct nfs4_state;
73struct nfs_open_context { 73struct nfs_open_context {
74 struct kref kref; 74 atomic_t count;
75 struct path path; 75 struct path path;
76 struct rpc_cred *cred; 76 struct rpc_cred *cred;
77 struct nfs4_state *state; 77 struct nfs4_state *state;
@@ -407,8 +407,8 @@ extern void nfs_release_automount_timer(void);
407/* 407/*
408 * linux/fs/nfs/unlink.c 408 * linux/fs/nfs/unlink.c
409 */ 409 */
410extern int nfs_async_unlink(struct dentry *); 410extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry);
411extern void nfs_complete_unlink(struct dentry *); 411extern void nfs_complete_unlink(struct dentry *dentry, struct inode *);
412 412
413/* 413/*
414 * linux/fs/nfs/write.c 414 * linux/fs/nfs/write.c
@@ -431,6 +431,7 @@ extern int nfs_sync_mapping_range(struct address_space *, loff_t, loff_t, int);
431extern int nfs_wb_all(struct inode *inode); 431extern int nfs_wb_all(struct inode *inode);
432extern int nfs_wb_page(struct inode *inode, struct page* page); 432extern int nfs_wb_page(struct inode *inode, struct page* page);
433extern int nfs_wb_page_priority(struct inode *inode, struct page* page, int how); 433extern int nfs_wb_page_priority(struct inode *inode, struct page* page, int how);
434extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
434#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 435#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
435extern int nfs_commit_inode(struct inode *, int); 436extern int nfs_commit_inode(struct inode *, int);
436extern struct nfs_write_data *nfs_commit_alloc(void); 437extern struct nfs_write_data *nfs_commit_alloc(void);
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 38d77681cf27..cf74a4db84a5 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -278,6 +278,21 @@ struct nfs_writeres {
278}; 278};
279 279
280/* 280/*
281 * Common arguments to the unlink call
282 */
283struct nfs_removeargs {
284 const struct nfs_fh *fh;
285 struct qstr name;
286 const u32 * bitmask;
287};
288
289struct nfs_removeres {
290 const struct nfs_server *server;
291 struct nfs4_change_info cinfo;
292 struct nfs_fattr dir_attr;
293};
294
295/*
281 * Argument struct for decode_entry function 296 * Argument struct for decode_entry function
282 */ 297 */
283struct nfs_entry { 298struct nfs_entry {
@@ -631,18 +646,6 @@ struct nfs4_readlink {
631 struct page ** pages; /* zero-copy data */ 646 struct page ** pages; /* zero-copy data */
632}; 647};
633 648
634struct nfs4_remove_arg {
635 const struct nfs_fh * fh;
636 const struct qstr * name;
637 const u32 * bitmask;
638};
639
640struct nfs4_remove_res {
641 const struct nfs_server * server;
642 struct nfs4_change_info cinfo;
643 struct nfs_fattr * dir_attr;
644};
645
646struct nfs4_rename_arg { 649struct nfs4_rename_arg {
647 const struct nfs_fh * old_dir; 650 const struct nfs_fh * old_dir;
648 const struct nfs_fh * new_dir; 651 const struct nfs_fh * new_dir;
@@ -788,9 +791,8 @@ struct nfs_rpc_ops {
788 int (*create) (struct inode *, struct dentry *, 791 int (*create) (struct inode *, struct dentry *,
789 struct iattr *, int, struct nameidata *); 792 struct iattr *, int, struct nameidata *);
790 int (*remove) (struct inode *, struct qstr *); 793 int (*remove) (struct inode *, struct qstr *);
791 int (*unlink_setup) (struct rpc_message *, 794 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
792 struct dentry *, struct qstr *); 795 int (*unlink_done) (struct rpc_task *, struct inode *);
793 int (*unlink_done) (struct dentry *, struct rpc_task *);
794 int (*rename) (struct inode *, struct qstr *, 796 int (*rename) (struct inode *, struct qstr *,
795 struct inode *, struct qstr *); 797 struct inode *, struct qstr *);
796 int (*link) (struct inode *, struct inode *, struct qstr *); 798 int (*link) (struct inode *, struct inode *, struct qstr *);
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 78feb7beff75..5cd192469096 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -116,18 +116,7 @@ struct svc_expkey {
116#define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) 116#define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE)
117#define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) 117#define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
118 118
119static inline int EX_RDONLY(struct svc_export *exp, struct svc_rqst *rqstp) 119int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp);
120{
121 struct exp_flavor_info *f;
122 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors;
123
124 for (f = exp->ex_flavors; f < end; f++) {
125 if (f->pseudoflavor == rqstp->rq_flavor)
126 return f->flags & NFSEXP_READONLY;
127 }
128 return exp->ex_flags & NFSEXP_READONLY;
129}
130
131__be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp); 120__be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp);
132 121
133/* 122/*
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 576f2bb34cc8..fad7ff17e468 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -157,6 +157,19 @@ extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
157 */ 157 */
158#define NOTIFY_STOP (NOTIFY_OK|NOTIFY_STOP_MASK) 158#define NOTIFY_STOP (NOTIFY_OK|NOTIFY_STOP_MASK)
159 159
160/* Encapsulate (negative) errno value (in particular, NOTIFY_BAD <=> EPERM). */
161static inline int notifier_from_errno(int err)
162{
163 return NOTIFY_STOP_MASK | (NOTIFY_OK - err);
164}
165
166/* Restore (negative) errno value from notify return value. */
167static inline int notifier_to_errno(int ret)
168{
169 ret &= ~NOTIFY_STOP_MASK;
170 return ret > NOTIFY_OK ? NOTIFY_OK - ret : 0;
171}
172
160/* 173/*
161 * Declared notifiers so far. I can imagine quite a few more chains 174 * Declared notifiers so far. I can imagine quite a few more chains
162 * over time (eg laptop power reset chains, reboot chain (to clean 175 * over time (eg laptop power reset chains, reboot chain (to clean
@@ -212,5 +225,11 @@ extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
212#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) 225#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
213#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) 226#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
214 227
228/* Hibernation and suspend events */
229#define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */
230#define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */
231#define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
232#define PM_POST_SUSPEND 0x0004 /* Suspend finished */
233
215#endif /* __KERNEL__ */ 234#endif /* __KERNEL__ */
216#endif /* _LINUX_NOTIFIER_H */ 235#endif /* _LINUX_NOTIFIER_H */
diff --git a/include/linux/of.h b/include/linux/of.h
new file mode 100644
index 000000000000..47734ffd9745
--- /dev/null
+++ b/include/linux/of.h
@@ -0,0 +1,61 @@
1#ifndef _LINUX_OF_H
2#define _LINUX_OF_H
3/*
4 * Definitions for talking to the Open Firmware PROM on
5 * Power Macintosh and other computers.
6 *
7 * Copyright (C) 1996-2005 Paul Mackerras.
8 *
9 * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
10 * Updates for SPARC64 by David S. Miller
11 * Derived from PowerPC and Sparc prom.h files by Stephen Rothwell, IBM Corp.
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version.
17 */
18#include <linux/types.h>
19
20#include <asm/bitops.h>
21#include <asm/prom.h>
22
23/* flag descriptions */
24#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
25#define OF_DETACHED 2 /* node has been detached from the device tree */
26
27#define OF_BAD_ADDR ((u64)-1)
28
29extern struct device_node *of_find_node_by_name(struct device_node *from,
30 const char *name);
31#define for_each_node_by_name(dn, name) \
32 for (dn = of_find_node_by_name(NULL, name); dn; \
33 dn = of_find_node_by_name(dn, name))
34extern struct device_node *of_find_node_by_type(struct device_node *from,
35 const char *type);
36#define for_each_node_by_type(dn, type) \
37 for (dn = of_find_node_by_type(NULL, type); dn; \
38 dn = of_find_node_by_type(dn, type))
39extern struct device_node *of_find_compatible_node(struct device_node *from,
40 const char *type, const char *compat);
41#define for_each_compatible_node(dn, type, compatible) \
42 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
43 dn = of_find_compatible_node(dn, type, compatible))
44extern struct device_node *of_find_node_by_path(const char *path);
45extern struct device_node *of_find_node_by_phandle(phandle handle);
46extern struct device_node *of_get_parent(const struct device_node *node);
47extern struct device_node *of_get_next_child(const struct device_node *node,
48 struct device_node *prev);
49extern struct property *of_find_property(const struct device_node *np,
50 const char *name,
51 int *lenp);
52extern int of_device_is_compatible(const struct device_node *device,
53 const char *);
54extern const void *of_get_property(const struct device_node *node,
55 const char *name,
56 int *lenp);
57#define get_property(a, b, c) of_get_property((a), (b), (c))
58extern int of_n_addr_cells(struct device_node *np);
59extern int of_n_size_cells(struct device_node *np);
60
61#endif /* _LINUX_OF_H */
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
new file mode 100644
index 000000000000..91bf84b9d144
--- /dev/null
+++ b/include/linux/of_device.h
@@ -0,0 +1,26 @@
1#ifndef _LINUX_OF_DEVICE_H
2#define _LINUX_OF_DEVICE_H
3#ifdef __KERNEL__
4
5#include <linux/device.h>
6#include <linux/of.h>
7#include <linux/mod_devicetable.h>
8
9#include <asm/of_device.h>
10
11#define to_of_device(d) container_of(d, struct of_device, dev)
12
13extern const struct of_device_id *of_match_node(
14 const struct of_device_id *matches, const struct device_node *node);
15extern const struct of_device_id *of_match_device(
16 const struct of_device_id *matches, const struct of_device *dev);
17
18extern struct of_device *of_dev_get(struct of_device *dev);
19extern void of_dev_put(struct of_device *dev);
20
21extern int of_device_register(struct of_device *ofdev);
22extern void of_device_unregister(struct of_device *ofdev);
23extern void of_release_dev(struct device *dev);
24
25#endif /* __KERNEL__ */
26#endif /* _LINUX_OF_DEVICE_H */
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
new file mode 100644
index 000000000000..448f70b30a0c
--- /dev/null
+++ b/include/linux/of_platform.h
@@ -0,0 +1,57 @@
1#ifndef _LINUX_OF_PLATFORM_H
2#define _LINUX_OF_PLATFORM_H
3/*
4 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
5 * <benh@kernel.crashing.org>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 *
12 */
13
14#include <linux/module.h>
15#include <linux/device.h>
16#include <linux/mod_devicetable.h>
17#include <linux/pm.h>
18#include <linux/of_device.h>
19
20/*
21 * The of_platform_bus_type is a bus type used by drivers that do not
22 * attach to a macio or similar bus but still use OF probing
23 * mechanism
24 */
25extern struct bus_type of_platform_bus_type;
26
27/*
28 * An of_platform_driver driver is attached to a basic of_device on
29 * the "platform bus" (of_platform_bus_type) (or ISA, EBUS and SBUS
30 * busses on sparc).
31 */
32struct of_platform_driver
33{
34 const char *name;
35 const struct of_device_id *match_table;
36 struct module *owner;
37
38 int (*probe)(struct of_device* dev,
39 const struct of_device_id *match);
40 int (*remove)(struct of_device* dev);
41
42 int (*suspend)(struct of_device* dev, pm_message_t state);
43 int (*resume)(struct of_device* dev);
44 int (*shutdown)(struct of_device* dev);
45
46 struct device_driver driver;
47};
48#define to_of_platform_driver(drv) \
49 container_of(drv,struct of_platform_driver, driver)
50
51#include <asm/of_platform.h>
52
53extern struct of_device *of_find_device_by_node(struct device_node *np);
54
55extern int of_bus_type_init(struct bus_type *bus, const char *name);
56
57#endif /* _LINUX_OF_PLATFORM_H */
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 0d514b252454..041bb31100f4 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -17,6 +17,26 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19 19
20/* Each escaped entry is prefixed by ESCAPE_CODE
21 * then one of the following codes, then the
22 * relevant data.
23 * These #defines live in this file so that arch-specific
24 * buffer sync'ing code can access them.
25 */
26#define ESCAPE_CODE ~0UL
27#define CTX_SWITCH_CODE 1
28#define CPU_SWITCH_CODE 2
29#define COOKIE_SWITCH_CODE 3
30#define KERNEL_ENTER_SWITCH_CODE 4
31#define KERNEL_EXIT_SWITCH_CODE 5
32#define MODULE_LOADED_CODE 6
33#define CTX_TGID_CODE 7
34#define TRACE_BEGIN_CODE 8
35#define TRACE_END_CODE 9
36#define XEN_ENTER_SWITCH_CODE 10
37#define SPU_PROFILING_CODE 11
38#define SPU_CTX_SWITCH_CODE 12
39
20struct super_block; 40struct super_block;
21struct dentry; 41struct dentry;
22struct file_operations; 42struct file_operations;
@@ -35,6 +55,14 @@ struct oprofile_operations {
35 int (*start)(void); 55 int (*start)(void);
36 /* Stop delivering interrupts. */ 56 /* Stop delivering interrupts. */
37 void (*stop)(void); 57 void (*stop)(void);
58 /* Arch-specific buffer sync functions.
59 * Return value = 0: Success
60 * Return value = -1: Failure
61 * Return value = 1: Run generic sync function
62 */
63 int (*sync_start)(void);
64 int (*sync_stop)(void);
65
38 /* Initiate a stack backtrace. Optional. */ 66 /* Initiate a stack backtrace. Optional. */
39 void (*backtrace)(struct pt_regs * const regs, unsigned int depth); 67 void (*backtrace)(struct pt_regs * const regs, unsigned int depth);
40 /* CPU identification string. */ 68 /* CPU identification string. */
@@ -56,6 +84,13 @@ int oprofile_arch_init(struct oprofile_operations * ops);
56void oprofile_arch_exit(void); 84void oprofile_arch_exit(void);
57 85
58/** 86/**
87 * Add data to the event buffer.
88 * The data passed is free-form, but typically consists of
89 * file offsets, dcookies, context information, and ESCAPE codes.
90 */
91void add_event_entry(unsigned long data);
92
93/**
59 * Add a sample. This may be called from any context. Pass 94 * Add a sample. This may be called from any context. Pass
60 * smp_processor_id() as cpu. 95 * smp_processor_id() as cpu.
61 */ 96 */
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index ae2d79f2107e..209d3a47f50f 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -90,8 +90,12 @@
90#define PG_reclaim 17 /* To be reclaimed asap */ 90#define PG_reclaim 17 /* To be reclaimed asap */
91#define PG_buddy 19 /* Page is free, on buddy lists */ 91#define PG_buddy 19 /* Page is free, on buddy lists */
92 92
93/* PG_readahead is only used for file reads; PG_reclaim is only for writes */
94#define PG_readahead PG_reclaim /* Reminder to do async read-ahead */
95
93/* PG_owner_priv_1 users should have descriptive aliases */ 96/* PG_owner_priv_1 users should have descriptive aliases */
94#define PG_checked PG_owner_priv_1 /* Used by some filesystems */ 97#define PG_checked PG_owner_priv_1 /* Used by some filesystems */
98#define PG_pinned PG_owner_priv_1 /* Xen pinned pagetable */
95 99
96#if (BITS_PER_LONG > 32) 100#if (BITS_PER_LONG > 32)
97/* 101/*
@@ -170,6 +174,10 @@ static inline void SetPageUptodate(struct page *page)
170#define SetPageChecked(page) set_bit(PG_checked, &(page)->flags) 174#define SetPageChecked(page) set_bit(PG_checked, &(page)->flags)
171#define ClearPageChecked(page) clear_bit(PG_checked, &(page)->flags) 175#define ClearPageChecked(page) clear_bit(PG_checked, &(page)->flags)
172 176
177#define PagePinned(page) test_bit(PG_pinned, &(page)->flags)
178#define SetPagePinned(page) set_bit(PG_pinned, &(page)->flags)
179#define ClearPagePinned(page) clear_bit(PG_pinned, &(page)->flags)
180
173#define PageReserved(page) test_bit(PG_reserved, &(page)->flags) 181#define PageReserved(page) test_bit(PG_reserved, &(page)->flags)
174#define SetPageReserved(page) set_bit(PG_reserved, &(page)->flags) 182#define SetPageReserved(page) set_bit(PG_reserved, &(page)->flags)
175#define ClearPageReserved(page) clear_bit(PG_reserved, &(page)->flags) 183#define ClearPageReserved(page) clear_bit(PG_reserved, &(page)->flags)
@@ -181,37 +189,15 @@ static inline void SetPageUptodate(struct page *page)
181#define __SetPagePrivate(page) __set_bit(PG_private, &(page)->flags) 189#define __SetPagePrivate(page) __set_bit(PG_private, &(page)->flags)
182#define __ClearPagePrivate(page) __clear_bit(PG_private, &(page)->flags) 190#define __ClearPagePrivate(page) __clear_bit(PG_private, &(page)->flags)
183 191
192/*
193 * Only test-and-set exist for PG_writeback. The unconditional operators are
194 * risky: they bypass page accounting.
195 */
184#define PageWriteback(page) test_bit(PG_writeback, &(page)->flags) 196#define PageWriteback(page) test_bit(PG_writeback, &(page)->flags)
185#define SetPageWriteback(page) \ 197#define TestSetPageWriteback(page) test_and_set_bit(PG_writeback, \
186 do { \ 198 &(page)->flags)
187 if (!test_and_set_bit(PG_writeback, \ 199#define TestClearPageWriteback(page) test_and_clear_bit(PG_writeback, \
188 &(page)->flags)) \ 200 &(page)->flags)
189 inc_zone_page_state(page, NR_WRITEBACK); \
190 } while (0)
191#define TestSetPageWriteback(page) \
192 ({ \
193 int ret; \
194 ret = test_and_set_bit(PG_writeback, \
195 &(page)->flags); \
196 if (!ret) \
197 inc_zone_page_state(page, NR_WRITEBACK); \
198 ret; \
199 })
200#define ClearPageWriteback(page) \
201 do { \
202 if (test_and_clear_bit(PG_writeback, \
203 &(page)->flags)) \
204 dec_zone_page_state(page, NR_WRITEBACK); \
205 } while (0)
206#define TestClearPageWriteback(page) \
207 ({ \
208 int ret; \
209 ret = test_and_clear_bit(PG_writeback, \
210 &(page)->flags); \
211 if (ret) \
212 dec_zone_page_state(page, NR_WRITEBACK); \
213 ret; \
214 })
215 201
216#define PageBuddy(page) test_bit(PG_buddy, &(page)->flags) 202#define PageBuddy(page) test_bit(PG_buddy, &(page)->flags)
217#define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags) 203#define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags)
@@ -221,6 +207,10 @@ static inline void SetPageUptodate(struct page *page)
221#define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags) 207#define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags)
222#define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags) 208#define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags)
223 209
210#define PageReadahead(page) test_bit(PG_readahead, &(page)->flags)
211#define SetPageReadahead(page) set_bit(PG_readahead, &(page)->flags)
212#define ClearPageReadahead(page) clear_bit(PG_readahead, &(page)->flags)
213
224#define PageReclaim(page) test_bit(PG_reclaim, &(page)->flags) 214#define PageReclaim(page) test_bit(PG_reclaim, &(page)->flags)
225#define SetPageReclaim(page) set_bit(PG_reclaim, &(page)->flags) 215#define SetPageReclaim(page) set_bit(PG_reclaim, &(page)->flags)
226#define ClearPageReclaim(page) clear_bit(PG_reclaim, &(page)->flags) 216#define ClearPageReclaim(page) clear_bit(PG_reclaim, &(page)->flags)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5e84f2e8d54c..038a0dc7273a 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -534,6 +534,7 @@ static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val
534 534
535int __must_check pci_enable_device(struct pci_dev *dev); 535int __must_check pci_enable_device(struct pci_dev *dev);
536int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); 536int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask);
537int __must_check pci_reenable_device(struct pci_dev *);
537int __must_check pcim_enable_device(struct pci_dev *pdev); 538int __must_check pcim_enable_device(struct pci_dev *pdev);
538void pcim_pin_device(struct pci_dev *pdev); 539void pcim_pin_device(struct pci_dev *pdev);
539 540
@@ -556,6 +557,7 @@ int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
556int pcix_get_max_mmrbc(struct pci_dev *dev); 557int pcix_get_max_mmrbc(struct pci_dev *dev);
557int pcix_get_mmrbc(struct pci_dev *dev); 558int pcix_get_mmrbc(struct pci_dev *dev);
558int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); 559int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
560int pcie_get_readrq(struct pci_dev *dev);
559int pcie_set_readrq(struct pci_dev *dev, int rq); 561int pcie_set_readrq(struct pci_dev *dev, int rq);
560void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); 562void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
561int __must_check pci_assign_resource(struct pci_dev *dev, int i); 563int __must_check pci_assign_resource(struct pci_dev *dev, int i);
@@ -577,6 +579,9 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
577pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); 579pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
578int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); 580int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable);
579 581
582/* Functions for PCI Hotplug drivers to use */
583int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);
584
580/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ 585/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
581void pci_bus_assign_resources(struct pci_bus *bus); 586void pci_bus_assign_resources(struct pci_bus *bus);
582void pci_bus_size_bridges(struct pci_bus *bus); 587void pci_bus_size_bridges(struct pci_bus *bus);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 2c7add169539..55f307ffbf96 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -360,6 +360,9 @@
360#define PCI_DEVICE_ID_ATI_RS400_166 0x5a32 360#define PCI_DEVICE_ID_ATI_RS400_166 0x5a32
361#define PCI_DEVICE_ID_ATI_RS400_200 0x5a33 361#define PCI_DEVICE_ID_ATI_RS400_200 0x5a33
362#define PCI_DEVICE_ID_ATI_RS480 0x5950 362#define PCI_DEVICE_ID_ATI_RS480 0x5950
363#define PCI_DEVICE_ID_ATI_RD580 0x5952
364#define PCI_DEVICE_ID_ATI_RX790 0x5957
365#define PCI_DEVICE_ID_ATI_RS690 0x7910
363/* ATI IXP Chipset */ 366/* ATI IXP Chipset */
364#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349 367#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349
365#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353 368#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353
@@ -371,10 +374,9 @@
371#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 374#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379
372#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a 375#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a
373#define PCI_DEVICE_ID_ATI_IXP600_SATA 0x4380 376#define PCI_DEVICE_ID_ATI_IXP600_SATA 0x4380
374#define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385 377#define PCI_DEVICE_ID_ATI_SBX00_SMBUS 0x4385
375#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c 378#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c
376#define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 379#define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390
377#define PCI_DEVICE_ID_ATI_IXP700_SMBUS 0x4395
378#define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c 380#define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c
379 381
380#define PCI_VENDOR_ID_VLSI 0x1004 382#define PCI_VENDOR_ID_VLSI 0x1004
@@ -495,6 +497,8 @@
495 497
496#define PCI_VENDOR_ID_AMD 0x1022 498#define PCI_VENDOR_ID_AMD 0x1022
497#define PCI_DEVICE_ID_AMD_K8_NB 0x1100 499#define PCI_DEVICE_ID_AMD_K8_NB 0x1100
500#define PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP 0x1101
501#define PCI_DEVICE_ID_AMD_K8_NB_MEMCTL 0x1102
498#define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 502#define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103
499#define PCI_DEVICE_ID_AMD_LANCE 0x2000 503#define PCI_DEVICE_ID_AMD_LANCE 0x2000
500#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 504#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001
@@ -609,7 +613,6 @@
609#define PCI_DEVICE_ID_NEC_CBUS_3 0x003b 613#define PCI_DEVICE_ID_NEC_CBUS_3 0x003b
610#define PCI_DEVICE_ID_NEC_NAPCCARD 0x003e 614#define PCI_DEVICE_ID_NEC_NAPCCARD 0x003e
611#define PCI_DEVICE_ID_NEC_PCX2 0x0046 /* PowerVR */ 615#define PCI_DEVICE_ID_NEC_PCX2 0x0046 /* PowerVR */
612#define PCI_DEVICE_ID_NEC_NILE4 0x005a
613#define PCI_DEVICE_ID_NEC_VRC5476 0x009b 616#define PCI_DEVICE_ID_NEC_VRC5476 0x009b
614#define PCI_DEVICE_ID_NEC_VRC4173 0x00a5 617#define PCI_DEVICE_ID_NEC_VRC4173 0x00a5
615#define PCI_DEVICE_ID_NEC_VRC5477_AC97 0x00a6 618#define PCI_DEVICE_ID_NEC_VRC5477_AC97 0x00a6
@@ -1223,6 +1226,10 @@
1223#define PCI_DEVICE_ID_NVIDIA_NVENET_25 0x054D 1226#define PCI_DEVICE_ID_NVIDIA_NVENET_25 0x054D
1224#define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E 1227#define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E
1225#define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F 1228#define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F
1229#define PCI_DEVICE_ID_NVIDIA_NVENET_28 0x07DC
1230#define PCI_DEVICE_ID_NVIDIA_NVENET_29 0x07DD
1231#define PCI_DEVICE_ID_NVIDIA_NVENET_30 0x07DE
1232#define PCI_DEVICE_ID_NVIDIA_NVENET_31 0x07DF
1226#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 1233#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560
1227#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE 0x056C 1234#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE 0x056C
1228#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759 1235#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759
@@ -1282,6 +1289,7 @@
1282#define PCI_DEVICE_ID_VIA_VT3324 0x0324 1289#define PCI_DEVICE_ID_VIA_VT3324 0x0324
1283#define PCI_DEVICE_ID_VIA_VT3336 0x0336 1290#define PCI_DEVICE_ID_VIA_VT3336 0x0336
1284#define PCI_DEVICE_ID_VIA_VT3351 0x0351 1291#define PCI_DEVICE_ID_VIA_VT3351 0x0351
1292#define PCI_DEVICE_ID_VIA_VT3364 0x0364
1285#define PCI_DEVICE_ID_VIA_8371_0 0x0391 1293#define PCI_DEVICE_ID_VIA_8371_0 0x0391
1286#define PCI_DEVICE_ID_VIA_8501_0 0x0501 1294#define PCI_DEVICE_ID_VIA_8501_0 0x0501
1287#define PCI_DEVICE_ID_VIA_82C561 0x0561 1295#define PCI_DEVICE_ID_VIA_82C561 0x0561
@@ -1335,6 +1343,7 @@
1335#define PCI_DEVICE_ID_VIA_8231_4 0x8235 1343#define PCI_DEVICE_ID_VIA_8231_4 0x8235
1336#define PCI_DEVICE_ID_VIA_8365_1 0x8305 1344#define PCI_DEVICE_ID_VIA_8365_1 0x8305
1337#define PCI_DEVICE_ID_VIA_CX700 0x8324 1345#define PCI_DEVICE_ID_VIA_CX700 0x8324
1346#define PCI_DEVICE_ID_VIA_VX800 0x8353
1338#define PCI_DEVICE_ID_VIA_8371_1 0x8391 1347#define PCI_DEVICE_ID_VIA_8371_1 0x8391
1339#define PCI_DEVICE_ID_VIA_82C598_1 0x8598 1348#define PCI_DEVICE_ID_VIA_82C598_1 0x8598
1340#define PCI_DEVICE_ID_VIA_838X_1 0xB188 1349#define PCI_DEVICE_ID_VIA_838X_1 0xB188
@@ -1970,6 +1979,8 @@
1970#define PCI_VENDOR_ID_ENE 0x1524 1979#define PCI_VENDOR_ID_ENE 0x1524
1971#define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 1980#define PCI_DEVICE_ID_ENE_CB712_SD 0x0550
1972#define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551 1981#define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551
1982#define PCI_DEVICE_ID_ENE_CB714_SD 0x0750
1983#define PCI_DEVICE_ID_ENE_CB714_SD_2 0x0751
1973#define PCI_DEVICE_ID_ENE_1211 0x1211 1984#define PCI_DEVICE_ID_ENE_1211 0x1211
1974#define PCI_DEVICE_ID_ENE_1225 0x1225 1985#define PCI_DEVICE_ID_ENE_1225 0x1225
1975#define PCI_DEVICE_ID_ENE_1410 0x1410 1986#define PCI_DEVICE_ID_ENE_1410 0x1410
@@ -2017,6 +2028,8 @@
2017 2028
2018#define PCI_VENDOR_ID_ARIMA 0x161f 2029#define PCI_VENDOR_ID_ARIMA 0x161f
2019 2030
2031#define PCI_VENDOR_ID_BROCADE 0x1657
2032
2020#define PCI_VENDOR_ID_SIBYTE 0x166d 2033#define PCI_VENDOR_ID_SIBYTE 0x166d
2021#define PCI_DEVICE_ID_BCM1250_PCI 0x0001 2034#define PCI_DEVICE_ID_BCM1250_PCI 0x0001
2022#define PCI_DEVICE_ID_BCM1250_HT 0x0002 2035#define PCI_DEVICE_ID_BCM1250_HT 0x0002
@@ -2038,6 +2051,8 @@
2038#define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea 2051#define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea
2039#define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb 2052#define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb
2040 2053
2054#define PCI_VENDOR_ID_LENOVO 0x17aa
2055
2041#define PCI_VENDOR_ID_ARECA 0x17d3 2056#define PCI_VENDOR_ID_ARECA 0x17d3
2042#define PCI_DEVICE_ID_ARECA_1110 0x1110 2057#define PCI_DEVICE_ID_ARECA_1110 0x1110
2043#define PCI_DEVICE_ID_ARECA_1120 0x1120 2058#define PCI_DEVICE_ID_ARECA_1120 0x1120
@@ -2069,6 +2084,25 @@
2069#define PCI_VENDOR_ID_TDI 0x192E 2084#define PCI_VENDOR_ID_TDI 0x192E
2070#define PCI_DEVICE_ID_TDI_EHCI 0x0101 2085#define PCI_DEVICE_ID_TDI_EHCI 0x0101
2071 2086
2087#define PCI_VENDOR_ID_FREESCALE 0x1957
2088#define PCI_DEVICE_ID_MPC8548E 0x0012
2089#define PCI_DEVICE_ID_MPC8548 0x0013
2090#define PCI_DEVICE_ID_MPC8543E 0x0014
2091#define PCI_DEVICE_ID_MPC8543 0x0015
2092#define PCI_DEVICE_ID_MPC8547E 0x0018
2093#define PCI_DEVICE_ID_MPC8545E 0x0019
2094#define PCI_DEVICE_ID_MPC8545 0x001a
2095#define PCI_DEVICE_ID_MPC8568E 0x0020
2096#define PCI_DEVICE_ID_MPC8568 0x0021
2097#define PCI_DEVICE_ID_MPC8567E 0x0022
2098#define PCI_DEVICE_ID_MPC8567 0x0023
2099#define PCI_DEVICE_ID_MPC8533E 0x0030
2100#define PCI_DEVICE_ID_MPC8533 0x0031
2101#define PCI_DEVICE_ID_MPC8544E 0x0032
2102#define PCI_DEVICE_ID_MPC8544 0x0033
2103#define PCI_DEVICE_ID_MPC8641 0x7010
2104#define PCI_DEVICE_ID_MPC8641D 0x7011
2105
2072#define PCI_VENDOR_ID_PASEMI 0x1959 2106#define PCI_VENDOR_ID_PASEMI 0x1959
2073 2107
2074#define PCI_VENDOR_ID_ATTANSIC 0x1969 2108#define PCI_VENDOR_ID_ATTANSIC 0x1969
@@ -2209,6 +2243,7 @@
2209#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 2243#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592
2210#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 2244#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770
2211#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772 2245#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772
2246#define PCI_DEVICE_ID_INTEL_3000_HB 0x2778
2212#define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0 2247#define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0
2213#define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2 2248#define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2
2214#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 2249#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640
@@ -2258,6 +2293,8 @@
2258#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 2293#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599
2259#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a 2294#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a
2260#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e 2295#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e
2296#define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031
2297#define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032
2261#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 2298#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000
2262#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 2299#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010
2263#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 2300#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 273781c82e4d..48b71badfb4c 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -25,6 +25,7 @@
25 25
26#include <linux/list.h> 26#include <linux/list.h>
27#include <asm/atomic.h> 27#include <asm/atomic.h>
28#include <asm/errno.h>
28 29
29/* 30/*
30 * Power management requests... these are passed to pm_send_all() and friends. 31 * Power management requests... these are passed to pm_send_all() and friends.
@@ -101,6 +102,7 @@ struct pm_dev
101 */ 102 */
102extern void (*pm_idle)(void); 103extern void (*pm_idle)(void);
103extern void (*pm_power_off)(void); 104extern void (*pm_power_off)(void);
105extern void (*pm_power_off_prepare)(void);
104 106
105typedef int __bitwise suspend_state_t; 107typedef int __bitwise suspend_state_t;
106 108
@@ -164,6 +166,7 @@ struct pm_ops {
164 int (*finish)(suspend_state_t state); 166 int (*finish)(suspend_state_t state);
165}; 167};
166 168
169#ifdef CONFIG_SUSPEND
167extern struct pm_ops *pm_ops; 170extern struct pm_ops *pm_ops;
168 171
169/** 172/**
@@ -192,6 +195,12 @@ extern void arch_suspend_disable_irqs(void);
192extern void arch_suspend_enable_irqs(void); 195extern void arch_suspend_enable_irqs(void);
193 196
194extern int pm_suspend(suspend_state_t state); 197extern int pm_suspend(suspend_state_t state);
198#else /* !CONFIG_SUSPEND */
199#define suspend_valid_only_mem NULL
200
201static inline void pm_set_ops(struct pm_ops *pm_ops) {}
202static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; }
203#endif /* !CONFIG_SUSPEND */
195 204
196/* 205/*
197 * Device power management 206 * Device power management
@@ -265,7 +274,7 @@ typedef struct pm_message {
265struct dev_pm_info { 274struct dev_pm_info {
266 pm_message_t power_state; 275 pm_message_t power_state;
267 unsigned can_wakeup:1; 276 unsigned can_wakeup:1;
268#ifdef CONFIG_PM 277#ifdef CONFIG_PM_SLEEP
269 unsigned should_wakeup:1; 278 unsigned should_wakeup:1;
270 struct list_head entry; 279 struct list_head entry;
271#endif 280#endif
@@ -275,7 +284,7 @@ extern int device_power_down(pm_message_t state);
275extern void device_power_up(void); 284extern void device_power_up(void);
276extern void device_resume(void); 285extern void device_resume(void);
277 286
278#ifdef CONFIG_PM 287#ifdef CONFIG_PM_SLEEP
279extern int device_suspend(pm_message_t state); 288extern int device_suspend(pm_message_t state);
280extern int device_prepare_suspend(pm_message_t state); 289extern int device_prepare_suspend(pm_message_t state);
281 290
@@ -284,8 +293,6 @@ extern int device_prepare_suspend(pm_message_t state);
284#define device_may_wakeup(dev) \ 293#define device_may_wakeup(dev) \
285 (device_can_wakeup(dev) && (dev)->power.should_wakeup) 294 (device_can_wakeup(dev) && (dev)->power.should_wakeup)
286 295
287extern int dpm_runtime_suspend(struct device *, pm_message_t);
288extern void dpm_runtime_resume(struct device *);
289extern void __suspend_report_result(const char *function, void *fn, int ret); 296extern void __suspend_report_result(const char *function, void *fn, int ret);
290 297
291#define suspend_report_result(fn, ret) \ 298#define suspend_report_result(fn, ret) \
@@ -307,7 +314,7 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
307 return 0; 314 return 0;
308} 315}
309 316
310#else /* !CONFIG_PM */ 317#else /* !CONFIG_PM_SLEEP */
311 318
312static inline int device_suspend(pm_message_t state) 319static inline int device_suspend(pm_message_t state)
313{ 320{
@@ -317,15 +324,6 @@ static inline int device_suspend(pm_message_t state)
317#define device_set_wakeup_enable(dev,val) do{}while(0) 324#define device_set_wakeup_enable(dev,val) do{}while(0)
318#define device_may_wakeup(dev) (0) 325#define device_may_wakeup(dev) (0)
319 326
320static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state)
321{
322 return 0;
323}
324
325static inline void dpm_runtime_resume(struct device * dev)
326{
327}
328
329#define suspend_report_result(fn, ret) do { } while (0) 327#define suspend_report_result(fn, ret) do { } while (0)
330 328
331static inline int call_platform_enable_wakeup(struct device *dev, int is_on) 329static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
@@ -333,7 +331,7 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
333 return 0; 331 return 0;
334} 332}
335 333
336#endif 334#endif /* !CONFIG_PM_SLEEP */
337 335
338/* changes to device_may_wakeup take effect on the next pm state change. 336/* changes to device_may_wakeup take effect on the next pm state change.
339 * by default, devices should wakeup if they can. 337 * by default, devices should wakeup if they can.
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index 5ad913ff02b2..b7824c215354 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -226,7 +226,7 @@ extern unsigned int pmu_power_flags;
226extern void pmu_backlight_init(void); 226extern void pmu_backlight_init(void);
227 227
228/* some code needs to know if the PMU was suspended for hibernation */ 228/* some code needs to know if the PMU was suspended for hibernation */
229#if defined(CONFIG_PM) && defined(CONFIG_PPC32) 229#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
230extern int pmu_sys_suspended; 230extern int pmu_sys_suspended;
231#else 231#else
232/* if power management is not configured it can't be suspended */ 232/* if power management is not configured it can't be suspended */
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 2a1897e6f937..16b46aace349 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -1,7 +1,6 @@
1/* 1/*
2 * Linux Plug and Play Support 2 * Linux Plug and Play Support
3 * Copyright by Adam Belay <ambx1@neo.rr.com> 3 * Copyright by Adam Belay <ambx1@neo.rr.com>
4 *
5 */ 4 */
6 5
7#ifndef _LINUX_PNP_H 6#ifndef _LINUX_PNP_H
@@ -23,7 +22,6 @@
23struct pnp_protocol; 22struct pnp_protocol;
24struct pnp_dev; 23struct pnp_dev;
25 24
26
27/* 25/*
28 * Resource Management 26 * Resource Management
29 */ 27 */
@@ -73,37 +71,37 @@ struct pnp_dev;
73#define PNP_PORT_FLAG_FIXED (1<<1) 71#define PNP_PORT_FLAG_FIXED (1<<1)
74 72
75struct pnp_port { 73struct pnp_port {
76 unsigned short min; /* min base number */ 74 unsigned short min; /* min base number */
77 unsigned short max; /* max base number */ 75 unsigned short max; /* max base number */
78 unsigned char align; /* align boundary */ 76 unsigned char align; /* align boundary */
79 unsigned char size; /* size of range */ 77 unsigned char size; /* size of range */
80 unsigned char flags; /* port flags */ 78 unsigned char flags; /* port flags */
81 unsigned char pad; /* pad */ 79 unsigned char pad; /* pad */
82 struct pnp_port *next; /* next port */ 80 struct pnp_port *next; /* next port */
83}; 81};
84 82
85#define PNP_IRQ_NR 256 83#define PNP_IRQ_NR 256
86struct pnp_irq { 84struct pnp_irq {
87 DECLARE_BITMAP(map, PNP_IRQ_NR); /* bitmaks for IRQ lines */ 85 DECLARE_BITMAP(map, PNP_IRQ_NR); /* bitmask for IRQ lines */
88 unsigned char flags; /* IRQ flags */ 86 unsigned char flags; /* IRQ flags */
89 unsigned char pad; /* pad */ 87 unsigned char pad; /* pad */
90 struct pnp_irq *next; /* next IRQ */ 88 struct pnp_irq *next; /* next IRQ */
91}; 89};
92 90
93struct pnp_dma { 91struct pnp_dma {
94 unsigned char map; /* bitmask for DMA channels */ 92 unsigned char map; /* bitmask for DMA channels */
95 unsigned char flags; /* DMA flags */ 93 unsigned char flags; /* DMA flags */
96 struct pnp_dma *next; /* next port */ 94 struct pnp_dma *next; /* next port */
97}; 95};
98 96
99struct pnp_mem { 97struct pnp_mem {
100 unsigned int min; /* min base number */ 98 unsigned int min; /* min base number */
101 unsigned int max; /* max base number */ 99 unsigned int max; /* max base number */
102 unsigned int align; /* align boundary */ 100 unsigned int align; /* align boundary */
103 unsigned int size; /* size of range */ 101 unsigned int size; /* size of range */
104 unsigned char flags; /* memory flags */ 102 unsigned char flags; /* memory flags */
105 unsigned char pad; /* pad */ 103 unsigned char pad; /* pad */
106 struct pnp_mem *next; /* next memory resource */ 104 struct pnp_mem *next; /* next memory resource */
107}; 105};
108 106
109#define PNP_RES_PRIORITY_PREFERRED 0 107#define PNP_RES_PRIORITY_PREFERRED 0
@@ -127,7 +125,6 @@ struct pnp_resource_table {
127 struct resource irq_resource[PNP_MAX_IRQ]; 125 struct resource irq_resource[PNP_MAX_IRQ];
128}; 126};
129 127
130
131/* 128/*
132 * Device Managemnt 129 * Device Managemnt
133 */ 130 */
@@ -139,14 +136,14 @@ struct pnp_card {
139 struct list_head protocol_list; /* node in protocol's list of cards */ 136 struct list_head protocol_list; /* node in protocol's list of cards */
140 struct list_head devices; /* devices attached to the card */ 137 struct list_head devices; /* devices attached to the card */
141 138
142 struct pnp_protocol * protocol; 139 struct pnp_protocol *protocol;
143 struct pnp_id * id; /* contains supported EISA IDs*/ 140 struct pnp_id *id; /* contains supported EISA IDs */
144 141
145 char name[PNP_NAME_LEN]; /* contains a human-readable name */ 142 char name[PNP_NAME_LEN]; /* contains a human-readable name */
146 unsigned char pnpver; /* Plug & Play version */ 143 unsigned char pnpver; /* Plug & Play version */
147 unsigned char productver; /* product version */ 144 unsigned char productver; /* product version */
148 unsigned int serial; /* serial number */ 145 unsigned int serial; /* serial number */
149 unsigned char checksum; /* if zero - checksum passed */ 146 unsigned char checksum; /* if zero - checksum passed */
150 struct proc_dir_entry *procdir; /* directory entry in /proc/bus/isapnp */ 147 struct proc_dir_entry *procdir; /* directory entry in /proc/bus/isapnp */
151}; 148};
152 149
@@ -159,18 +156,18 @@ struct pnp_card {
159 (card) = global_to_pnp_card((card)->global_list.next)) 156 (card) = global_to_pnp_card((card)->global_list.next))
160 157
161struct pnp_card_link { 158struct pnp_card_link {
162 struct pnp_card * card; 159 struct pnp_card *card;
163 struct pnp_card_driver * driver; 160 struct pnp_card_driver *driver;
164 void * driver_data; 161 void *driver_data;
165 pm_message_t pm_state; 162 pm_message_t pm_state;
166}; 163};
167 164
168static inline void *pnp_get_card_drvdata (struct pnp_card_link *pcard) 165static inline void *pnp_get_card_drvdata(struct pnp_card_link *pcard)
169{ 166{
170 return pcard->driver_data; 167 return pcard->driver_data;
171} 168}
172 169
173static inline void pnp_set_card_drvdata (struct pnp_card_link *pcard, void *data) 170static inline void pnp_set_card_drvdata(struct pnp_card_link *pcard, void *data)
174{ 171{
175 pcard->driver_data = data; 172 pcard->driver_data = data;
176} 173}
@@ -186,22 +183,22 @@ struct pnp_dev {
186 struct list_head card_list; /* node in card's list of devices */ 183 struct list_head card_list; /* node in card's list of devices */
187 struct list_head rdev_list; /* node in cards list of requested devices */ 184 struct list_head rdev_list; /* node in cards list of requested devices */
188 185
189 struct pnp_protocol * protocol; 186 struct pnp_protocol *protocol;
190 struct pnp_card * card; /* card the device is attached to, none if NULL */ 187 struct pnp_card *card; /* card the device is attached to, none if NULL */
191 struct pnp_driver * driver; 188 struct pnp_driver *driver;
192 struct pnp_card_link * card_link; 189 struct pnp_card_link *card_link;
193 190
194 struct pnp_id * id; /* supported EISA IDs*/ 191 struct pnp_id *id; /* supported EISA IDs */
195 192
196 int active; 193 int active;
197 int capabilities; 194 int capabilities;
198 struct pnp_option * independent; 195 struct pnp_option *independent;
199 struct pnp_option * dependent; 196 struct pnp_option *dependent;
200 struct pnp_resource_table res; 197 struct pnp_resource_table res;
201 198
202 char name[PNP_NAME_LEN]; /* contains a human-readable name */ 199 char name[PNP_NAME_LEN]; /* contains a human-readable name */
203 unsigned short regs; /* ISAPnP: supported registers */ 200 unsigned short regs; /* ISAPnP: supported registers */
204 int flags; /* used by protocols */ 201 int flags; /* used by protocols */
205 struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */ 202 struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */
206 void *data; 203 void *data;
207}; 204};
@@ -220,19 +217,19 @@ struct pnp_dev {
220 (dev) = card_to_pnp_dev((dev)->card_list.next)) 217 (dev) = card_to_pnp_dev((dev)->card_list.next))
221#define pnp_dev_name(dev) (dev)->name 218#define pnp_dev_name(dev) (dev)->name
222 219
223static inline void *pnp_get_drvdata (struct pnp_dev *pdev) 220static inline void *pnp_get_drvdata(struct pnp_dev *pdev)
224{ 221{
225 return dev_get_drvdata(&pdev->dev); 222 return dev_get_drvdata(&pdev->dev);
226} 223}
227 224
228static inline void pnp_set_drvdata (struct pnp_dev *pdev, void *data) 225static inline void pnp_set_drvdata(struct pnp_dev *pdev, void *data)
229{ 226{
230 dev_set_drvdata(&pdev->dev, data); 227 dev_set_drvdata(&pdev->dev, data);
231} 228}
232 229
233struct pnp_fixup { 230struct pnp_fixup {
234 char id[7]; 231 char id[7];
235 void (*quirk_function)(struct pnp_dev *dev); /* fixup function */ 232 void (*quirk_function) (struct pnp_dev * dev); /* fixup function */
236}; 233};
237 234
238/* config parameters */ 235/* config parameters */
@@ -269,7 +266,6 @@ extern struct pnp_protocol pnpbios_protocol;
269#define pnp_device_is_pnpbios(dev) 0 266#define pnp_device_is_pnpbios(dev) 0
270#endif 267#endif
271 268
272
273/* status */ 269/* status */
274#define PNP_READY 0x0000 270#define PNP_READY 0x0000
275#define PNP_ATTACHED 0x0001 271#define PNP_ATTACHED 0x0001
@@ -287,17 +283,17 @@ extern struct pnp_protocol pnpbios_protocol;
287 283
288struct pnp_id { 284struct pnp_id {
289 char id[PNP_ID_LEN]; 285 char id[PNP_ID_LEN];
290 struct pnp_id * next; 286 struct pnp_id *next;
291}; 287};
292 288
293struct pnp_driver { 289struct pnp_driver {
294 char * name; 290 char *name;
295 const struct pnp_device_id *id_table; 291 const struct pnp_device_id *id_table;
296 unsigned int flags; 292 unsigned int flags;
297 int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); 293 int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id);
298 void (*remove) (struct pnp_dev *dev); 294 void (*remove) (struct pnp_dev *dev);
299 int (*suspend) (struct pnp_dev *dev, pm_message_t state); 295 int (*suspend) (struct pnp_dev *dev, pm_message_t state);
300 int (*resume) (struct pnp_dev *dev); 296 int (*resume) (struct pnp_dev *dev);
301 struct device_driver driver; 297 struct device_driver driver;
302}; 298};
303 299
@@ -305,13 +301,14 @@ struct pnp_driver {
305 301
306struct pnp_card_driver { 302struct pnp_card_driver {
307 struct list_head global_list; 303 struct list_head global_list;
308 char * name; 304 char *name;
309 const struct pnp_card_device_id *id_table; 305 const struct pnp_card_device_id *id_table;
310 unsigned int flags; 306 unsigned int flags;
311 int (*probe) (struct pnp_card_link *card, const struct pnp_card_device_id *card_id); 307 int (*probe) (struct pnp_card_link *card,
308 const struct pnp_card_device_id *card_id);
312 void (*remove) (struct pnp_card_link *card); 309 void (*remove) (struct pnp_card_link *card);
313 int (*suspend) (struct pnp_card_link *card, pm_message_t state); 310 int (*suspend) (struct pnp_card_link *card, pm_message_t state);
314 int (*resume) (struct pnp_card_link *card); 311 int (*resume) (struct pnp_card_link *card);
315 struct pnp_driver link; 312 struct pnp_driver link;
316}; 313};
317 314
@@ -321,25 +318,28 @@ struct pnp_card_driver {
321#define PNP_DRIVER_RES_DO_NOT_CHANGE 0x0001 /* do not change the state of the device */ 318#define PNP_DRIVER_RES_DO_NOT_CHANGE 0x0001 /* do not change the state of the device */
322#define PNP_DRIVER_RES_DISABLE 0x0003 /* ensure the device is disabled */ 319#define PNP_DRIVER_RES_DISABLE 0x0003 /* ensure the device is disabled */
323 320
324
325/* 321/*
326 * Protocol Management 322 * Protocol Management
327 */ 323 */
328 324
329struct pnp_protocol { 325struct pnp_protocol {
330 struct list_head protocol_list; 326 struct list_head protocol_list;
331 char * name; 327 char *name;
332 328
333 /* resource control functions */ 329 /* resource control functions */
334 int (*get)(struct pnp_dev *dev, struct pnp_resource_table *res); 330 int (*get) (struct pnp_dev *dev, struct pnp_resource_table *res);
335 int (*set)(struct pnp_dev *dev, struct pnp_resource_table *res); 331 int (*set) (struct pnp_dev *dev, struct pnp_resource_table *res);
336 int (*disable)(struct pnp_dev *dev); 332 int (*disable) (struct pnp_dev *dev);
333
334 /* protocol specific suspend/resume */
335 int (*suspend) (struct pnp_dev * dev, pm_message_t state);
336 int (*resume) (struct pnp_dev * dev);
337 337
338 /* used by pnp layer only (look but don't touch) */ 338 /* used by pnp layer only (look but don't touch) */
339 unsigned char number; /* protocol number*/ 339 unsigned char number; /* protocol number */
340 struct device dev; /* link to driver model */ 340 struct device dev; /* link to driver model */
341 struct list_head cards; 341 struct list_head cards;
342 struct list_head devices; 342 struct list_head devices;
343}; 343};
344 344
345#define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list) 345#define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list)
@@ -352,7 +352,6 @@ struct pnp_protocol {
352 (dev) != protocol_to_pnp_dev(&(protocol)->devices); \ 352 (dev) != protocol_to_pnp_dev(&(protocol)->devices); \
353 (dev) = protocol_to_pnp_dev((dev)->protocol_list.next)) 353 (dev) = protocol_to_pnp_dev((dev)->protocol_list.next))
354 354
355
356extern struct bus_type pnp_bus_type; 355extern struct bus_type pnp_bus_type;
357 356
358#if defined(CONFIG_PNP) 357#if defined(CONFIG_PNP)
@@ -372,21 +371,25 @@ void pnp_remove_card(struct pnp_card *card);
372int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev); 371int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev);
373void pnp_remove_card_device(struct pnp_dev *dev); 372void pnp_remove_card_device(struct pnp_dev *dev);
374int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card); 373int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card);
375struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char * id, struct pnp_dev * from); 374struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink,
376void pnp_release_card_device(struct pnp_dev * dev); 375 const char *id, struct pnp_dev *from);
377int pnp_register_card_driver(struct pnp_card_driver * drv); 376void pnp_release_card_device(struct pnp_dev *dev);
378void pnp_unregister_card_driver(struct pnp_card_driver * drv); 377int pnp_register_card_driver(struct pnp_card_driver *drv);
378void pnp_unregister_card_driver(struct pnp_card_driver *drv);
379extern struct list_head pnp_cards; 379extern struct list_head pnp_cards;
380 380
381/* resource management */ 381/* resource management */
382struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev); 382struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev);
383struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority); 383struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev,
384 int priority);
384int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data); 385int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data);
385int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data); 386int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data);
386int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data); 387int pnp_register_port_resource(struct pnp_option *option,
388 struct pnp_port *data);
387int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data); 389int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data);
388void pnp_init_resource_table(struct pnp_resource_table *table); 390void pnp_init_resource_table(struct pnp_resource_table *table);
389int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode); 391int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res,
392 int mode);
390int pnp_auto_config_dev(struct pnp_dev *dev); 393int pnp_auto_config_dev(struct pnp_dev *dev);
391int pnp_validate_config(struct pnp_dev *dev); 394int pnp_validate_config(struct pnp_dev *dev);
392int pnp_start_dev(struct pnp_dev *dev); 395int pnp_start_dev(struct pnp_dev *dev);
@@ -394,11 +397,11 @@ int pnp_stop_dev(struct pnp_dev *dev);
394int pnp_activate_dev(struct pnp_dev *dev); 397int pnp_activate_dev(struct pnp_dev *dev);
395int pnp_disable_dev(struct pnp_dev *dev); 398int pnp_disable_dev(struct pnp_dev *dev);
396void pnp_resource_change(struct resource *resource, resource_size_t start, 399void pnp_resource_change(struct resource *resource, resource_size_t start,
397 resource_size_t size); 400 resource_size_t size);
398 401
399/* protocol helpers */ 402/* protocol helpers */
400int pnp_is_active(struct pnp_dev * dev); 403int pnp_is_active(struct pnp_dev *dev);
401int compare_pnp_id(struct pnp_id * pos, const char * id); 404int compare_pnp_id(struct pnp_id *pos, const char *id);
402int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev); 405int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev);
403int pnp_register_driver(struct pnp_driver *drv); 406int pnp_register_driver(struct pnp_driver *drv);
404void pnp_unregister_driver(struct pnp_driver *drv); 407void pnp_unregister_driver(struct pnp_driver *drv);
@@ -411,23 +414,24 @@ static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { }
411static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } 414static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; }
412static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } 415static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; }
413static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } 416static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; }
414static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } 417static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { }
418
415#define pnp_platform_devices 0 419#define pnp_platform_devices 0
416 420
417/* multidevice card support */ 421/* multidevice card support */
418static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; } 422static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; }
419static inline void pnp_remove_card(struct pnp_card *card) { ; } 423static inline void pnp_remove_card(struct pnp_card *card) { }
420static inline int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) { return -ENODEV; } 424static inline int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) { return -ENODEV; }
421static inline void pnp_remove_card_device(struct pnp_dev *dev) { ; } 425static inline void pnp_remove_card_device(struct pnp_dev *dev) { }
422static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card) { return -ENODEV; } 426static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card) { return -ENODEV; }
423static inline struct pnp_dev * pnp_request_card_device(struct pnp_card_link *clink, const char * id, struct pnp_dev * from) { return NULL; } 427static inline struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, const char *id, struct pnp_dev *from) { return NULL; }
424static inline void pnp_release_card_device(struct pnp_dev * dev) { ; } 428static inline void pnp_release_card_device(struct pnp_dev *dev) { }
425static inline int pnp_register_card_driver(struct pnp_card_driver * drv) { return -ENODEV; } 429static inline int pnp_register_card_driver(struct pnp_card_driver *drv) { return -ENODEV; }
426static inline void pnp_unregister_card_driver(struct pnp_card_driver * drv) { ; } 430static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv) { }
427 431
428/* resource management */ 432/* resource management */
429static inline struct pnp_option * pnp_register_independent_option(struct pnp_dev *dev) { return NULL; } 433static inline struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev) { return NULL; }
430static inline struct pnp_option * pnp_register_dependent_option(struct pnp_dev *dev, int priority) { return NULL; } 434static inline struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev, int priority) { return NULL; }
431static inline int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) { return -ENODEV; } 435static inline int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) { return -ENODEV; }
432static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; } 436static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; }
433static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; } 437static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; }
@@ -440,20 +444,17 @@ static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
440static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } 444static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
441static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } 445static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
442static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } 446static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
443static inline void pnp_resource_change(struct resource *resource, 447static inline void pnp_resource_change(struct resource *resource, resource_size_t start, resource_size_t size) { }
444 resource_size_t start,
445 resource_size_t size) { }
446 448
447/* protocol helpers */ 449/* protocol helpers */
448static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } 450static inline int pnp_is_active(struct pnp_dev *dev) { return 0; }
449static inline int compare_pnp_id(struct pnp_id * pos, const char * id) { return -ENODEV; } 451static inline int compare_pnp_id(struct pnp_id *pos, const char *id) { return -ENODEV; }
450static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; } 452static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; }
451static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; } 453static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; }
452static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; } 454static inline void pnp_unregister_driver(struct pnp_driver *drv) { }
453 455
454#endif /* CONFIG_PNP */ 456#endif /* CONFIG_PNP */
455 457
456
457#define pnp_err(format, arg...) printk(KERN_ERR "pnp: " format "\n" , ## arg) 458#define pnp_err(format, arg...) printk(KERN_ERR "pnp: " format "\n" , ## arg)
458#define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg) 459#define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg)
459#define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg) 460#define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg)
diff --git a/include/linux/pnpbios.h b/include/linux/pnpbios.h
index 0a282ac1f6b2..329192adc9dd 100644
--- a/include/linux/pnpbios.h
+++ b/include/linux/pnpbios.h
@@ -99,32 +99,32 @@
99 99
100#pragma pack(1) 100#pragma pack(1)
101struct pnp_dev_node_info { 101struct pnp_dev_node_info {
102 __u16 no_nodes; 102 __u16 no_nodes;
103 __u16 max_node_size; 103 __u16 max_node_size;
104}; 104};
105struct pnp_docking_station_info { 105struct pnp_docking_station_info {
106 __u32 location_id; 106 __u32 location_id;
107 __u32 serial; 107 __u32 serial;
108 __u16 capabilities; 108 __u16 capabilities;
109}; 109};
110struct pnp_isa_config_struc { 110struct pnp_isa_config_struc {
111 __u8 revision; 111 __u8 revision;
112 __u8 no_csns; 112 __u8 no_csns;
113 __u16 isa_rd_data_port; 113 __u16 isa_rd_data_port;
114 __u16 reserved; 114 __u16 reserved;
115}; 115};
116struct escd_info_struc { 116struct escd_info_struc {
117 __u16 min_escd_write_size; 117 __u16 min_escd_write_size;
118 __u16 escd_size; 118 __u16 escd_size;
119 __u32 nv_storage_base; 119 __u32 nv_storage_base;
120}; 120};
121struct pnp_bios_node { 121struct pnp_bios_node {
122 __u16 size; 122 __u16 size;
123 __u8 handle; 123 __u8 handle;
124 __u32 eisa_id; 124 __u32 eisa_id;
125 __u8 type_code[3]; 125 __u8 type_code[3];
126 __u16 flags; 126 __u16 flags;
127 __u8 data[0]; 127 __u8 data[0];
128}; 128};
129#pragma pack() 129#pragma pack()
130 130
@@ -133,22 +133,16 @@ struct pnp_bios_node {
133/* non-exported */ 133/* non-exported */
134extern struct pnp_dev_node_info node_info; 134extern struct pnp_dev_node_info node_info;
135 135
136extern int pnp_bios_dev_node_info (struct pnp_dev_node_info *data); 136extern int pnp_bios_dev_node_info(struct pnp_dev_node_info *data);
137extern int pnp_bios_get_dev_node (u8 *nodenum, char config, struct pnp_bios_node *data); 137extern int pnp_bios_get_dev_node(u8 *nodenum, char config,
138extern int pnp_bios_set_dev_node (u8 nodenum, char config, struct pnp_bios_node *data); 138 struct pnp_bios_node *data);
139extern int pnp_bios_get_stat_res (char *info); 139extern int pnp_bios_set_dev_node(u8 nodenum, char config,
140extern int pnp_bios_isapnp_config (struct pnp_isa_config_struc *data); 140 struct pnp_bios_node *data);
141extern int pnp_bios_escd_info (struct escd_info_struc *data); 141extern int pnp_bios_get_stat_res(char *info);
142extern int pnp_bios_read_escd (char *data, u32 nvram_base); 142extern int pnp_bios_isapnp_config(struct pnp_isa_config_struc *data);
143extern int pnp_bios_escd_info(struct escd_info_struc *data);
144extern int pnp_bios_read_escd(char *data, u32 nvram_base);
143extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data); 145extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data);
144#define needed 0
145#if needed
146extern int pnp_bios_get_event (u16 *message);
147extern int pnp_bios_send_message (u16 message);
148extern int pnp_bios_set_stat_res (char *info);
149extern int pnp_bios_apm_id_table (char *table, u16 *size);
150extern int pnp_bios_write_escd (char *data, u32 nvram_base);
151#endif
152 146
153#endif /* CONFIG_PNPBIOS */ 147#endif /* CONFIG_PNPBIOS */
154 148
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 27690798623f..16d813b364ef 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -21,6 +21,8 @@
21#define WQUEUES_STACK_ALLOC (MAX_STACK_ALLOC - FRONTEND_STACK_ALLOC) 21#define WQUEUES_STACK_ALLOC (MAX_STACK_ALLOC - FRONTEND_STACK_ALLOC)
22#define N_INLINE_POLL_ENTRIES (WQUEUES_STACK_ALLOC / sizeof(struct poll_table_entry)) 22#define N_INLINE_POLL_ENTRIES (WQUEUES_STACK_ALLOC / sizeof(struct poll_table_entry))
23 23
24#define DEFAULT_POLLMASK (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
25
24struct poll_table_struct; 26struct poll_table_struct;
25 27
26/* 28/*
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index d0926d63406c..484988ed301e 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -8,6 +8,7 @@
8 8
9#include <linux/thread_info.h> 9#include <linux/thread_info.h>
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <linux/list.h>
11 12
12#ifdef CONFIG_DEBUG_PREEMPT 13#ifdef CONFIG_DEBUG_PREEMPT
13 extern void fastcall add_preempt_count(int val); 14 extern void fastcall add_preempt_count(int val);
@@ -60,4 +61,47 @@ do { \
60 61
61#endif 62#endif
62 63
64#ifdef CONFIG_PREEMPT_NOTIFIERS
65
66struct preempt_notifier;
67
68/**
69 * preempt_ops - notifiers called when a task is preempted and rescheduled
70 * @sched_in: we're about to be rescheduled:
71 * notifier: struct preempt_notifier for the task being scheduled
72 * cpu: cpu we're scheduled on
73 * @sched_out: we've just been preempted
74 * notifier: struct preempt_notifier for the task being preempted
75 * next: the task that's kicking us out
76 */
77struct preempt_ops {
78 void (*sched_in)(struct preempt_notifier *notifier, int cpu);
79 void (*sched_out)(struct preempt_notifier *notifier,
80 struct task_struct *next);
81};
82
83/**
84 * preempt_notifier - key for installing preemption notifiers
85 * @link: internal use
86 * @ops: defines the notifier functions to be called
87 *
88 * Usually used in conjunction with container_of().
89 */
90struct preempt_notifier {
91 struct hlist_node link;
92 struct preempt_ops *ops;
93};
94
95void preempt_notifier_register(struct preempt_notifier *notifier);
96void preempt_notifier_unregister(struct preempt_notifier *notifier);
97
98static inline void preempt_notifier_init(struct preempt_notifier *notifier,
99 struct preempt_ops *ops)
100{
101 INIT_HLIST_NODE(&notifier->link);
102 notifier->ops = ops;
103}
104
105#endif
106
63#endif /* __LINUX_PREEMPT_H */ 107#endif /* __LINUX_PREEMPT_H */
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 28e3664fdf1b..cd13a78c5db8 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -75,7 +75,6 @@ struct proc_dir_entry {
75 write_proc_t *write_proc; 75 write_proc_t *write_proc;
76 atomic_t count; /* use count */ 76 atomic_t count; /* use count */
77 int deleted; /* delete flag */ 77 int deleted; /* delete flag */
78 void *set;
79 int pde_users; /* number of callers into module in progress */ 78 int pde_users; /* number of callers into module in progress */
80 spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ 79 spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
81 struct completion *pde_unload_completion; 80 struct completion *pde_unload_completion;
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 28ac632b42dd..dcb729244f47 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -227,7 +227,7 @@ struct mddev_s
227 unsigned int safemode_delay; 227 unsigned int safemode_delay;
228 struct timer_list safemode_timer; 228 struct timer_list safemode_timer;
229 atomic_t writes_pending; 229 atomic_t writes_pending;
230 request_queue_t *queue; /* for plugging ... */ 230 struct request_queue *queue; /* for plugging ... */
231 231
232 atomic_t write_behind; /* outstanding async IO */ 232 atomic_t write_behind; /* outstanding async IO */
233 unsigned int max_write_behind; /* 0 = sync */ 233 unsigned int max_write_behind; /* 0 = sync */
@@ -265,7 +265,7 @@ struct mdk_personality
265 int level; 265 int level;
266 struct list_head list; 266 struct list_head list;
267 struct module *owner; 267 struct module *owner;
268 int (*make_request)(request_queue_t *q, struct bio *bio); 268 int (*make_request)(struct request_queue *q, struct bio *bio);
269 int (*run)(mddev_t *mddev); 269 int (*run)(mddev_t *mddev);
270 int (*stop)(mddev_t *mddev); 270 int (*stop)(mddev_t *mddev);
271 void (*status)(struct seq_file *seq, mddev_t *mddev); 271 void (*status)(struct seq_file *seq, mddev_t *mddev);
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index c6b7485eac7c..fe17d7d750c2 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -281,7 +281,6 @@ extern void FASTCALL(call_rcu(struct rcu_head *head,
281extern void FASTCALL(call_rcu_bh(struct rcu_head *head, 281extern void FASTCALL(call_rcu_bh(struct rcu_head *head,
282 void (*func)(struct rcu_head *head))); 282 void (*func)(struct rcu_head *head)));
283extern void synchronize_rcu(void); 283extern void synchronize_rcu(void);
284void synchronize_idle(void);
285extern void rcu_barrier(void); 284extern void rcu_barrier(void);
286 285
287#endif /* __KERNEL__ */ 286#endif /* __KERNEL__ */
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 1dd1c707311f..85ea63f462af 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -67,6 +67,11 @@ extern void kernel_power_off(void);
67 67
68void ctrl_alt_del(void); 68void ctrl_alt_del(void);
69 69
70#define POWEROFF_CMD_PATH_LEN 256
71extern char poweroff_cmd[POWEROFF_CMD_PATH_LEN];
72
73extern int orderly_poweroff(bool force);
74
70/* 75/*
71 * Emergency restart, callable from an interrupt handler. 76 * Emergency restart, callable from an interrupt handler.
72 */ 77 */
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 965d5b3ea9eb..180a9d832dde 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -81,14 +81,16 @@ void reiserfs_warning(struct super_block *s, const char *fmt, ...);
81/* assertions handling */ 81/* assertions handling */
82 82
83/** always check a condition and panic if it's false. */ 83/** always check a condition and panic if it's false. */
84#define RASSERT( cond, format, args... ) \ 84#define __RASSERT( cond, scond, format, args... ) \
85if( !( cond ) ) \ 85if( !( cond ) ) \
86 reiserfs_panic( NULL, "reiserfs[%i]: assertion " #cond " failed at " \ 86 reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \
87 __FILE__ ":%i:%s: " format "\n", \ 87 __FILE__ ":%i:%s: " format "\n", \
88 in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args ) 88 in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args )
89 89
90#define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args)
91
90#if defined( CONFIG_REISERFS_CHECK ) 92#if defined( CONFIG_REISERFS_CHECK )
91#define RFALSE( cond, format, args... ) RASSERT( !( cond ), format, ##args ) 93#define RFALSE(cond, format, args...) __RASSERT(!(cond), "!(" #cond ")", format, ##args)
92#else 94#else
93#define RFALSE( cond, format, args... ) do {;} while( 0 ) 95#define RFALSE( cond, format, args... ) do {;} while( 0 )
94#endif 96#endif
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h
index 81e9299ca148..f3f4f28c6960 100644
--- a/include/linux/resume-trace.h
+++ b/include/linux/resume-trace.h
@@ -2,6 +2,7 @@
2#define RESUME_TRACE_H 2#define RESUME_TRACE_H
3 3
4#ifdef CONFIG_PM_TRACE 4#ifdef CONFIG_PM_TRACE
5#include <asm/resume-trace.h>
5 6
6extern int pm_trace_enabled; 7extern int pm_trace_enabled;
7 8
@@ -9,20 +10,10 @@ struct device;
9extern void set_trace_device(struct device *); 10extern void set_trace_device(struct device *);
10extern void generate_resume_trace(void *tracedata, unsigned int user); 11extern void generate_resume_trace(void *tracedata, unsigned int user);
11 12
12#define TRACE_DEVICE(dev) set_trace_device(dev) 13#define TRACE_DEVICE(dev) do { \
13#define TRACE_RESUME(user) do { \ 14 if (pm_trace_enabled) \
14 if (pm_trace_enabled) { \ 15 set_trace_device(dev); \
15 void *tracedata; \ 16 } while(0)
16 asm volatile("movl $1f,%0\n" \
17 ".section .tracedata,\"a\"\n" \
18 "1:\t.word %c1\n" \
19 "\t.long %c2\n" \
20 ".previous" \
21 :"=r" (tracedata) \
22 : "i" (__LINE__), "i" (__FILE__)); \
23 generate_resume_trace(tracedata, user); \
24 } \
25} while (0)
26 17
27#else 18#else
28 19
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index c91476ce314a..dff3192374f8 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -351,6 +351,8 @@ enum
351#define RTAX_INITCWND RTAX_INITCWND 351#define RTAX_INITCWND RTAX_INITCWND
352 RTAX_FEATURES, 352 RTAX_FEATURES,
353#define RTAX_FEATURES RTAX_FEATURES 353#define RTAX_FEATURES RTAX_FEATURES
354 RTAX_RTO_MIN,
355#define RTAX_RTO_MIN RTAX_RTO_MIN
354 __RTAX_MAX 356 __RTAX_MAX
355}; 357};
356 358
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 731edaca8ffd..f4e324ed2e44 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -139,7 +139,7 @@ struct cfs_rq;
139extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m); 139extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m);
140extern void proc_sched_set_task(struct task_struct *p); 140extern void proc_sched_set_task(struct task_struct *p);
141extern void 141extern void
142print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq, u64 now); 142print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq);
143#else 143#else
144static inline void 144static inline void
145proc_sched_show_task(struct task_struct *p, struct seq_file *m) 145proc_sched_show_task(struct task_struct *p, struct seq_file *m)
@@ -149,7 +149,7 @@ static inline void proc_sched_set_task(struct task_struct *p)
149{ 149{
150} 150}
151static inline void 151static inline void
152print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq, u64 now) 152print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
153{ 153{
154} 154}
155#endif 155#endif
@@ -345,6 +345,27 @@ typedef unsigned long mm_counter_t;
345 (mm)->hiwater_vm = (mm)->total_vm; \ 345 (mm)->hiwater_vm = (mm)->total_vm; \
346} while (0) 346} while (0)
347 347
348extern void set_dumpable(struct mm_struct *mm, int value);
349extern int get_dumpable(struct mm_struct *mm);
350
351/* mm flags */
352/* dumpable bits */
353#define MMF_DUMPABLE 0 /* core dump is permitted */
354#define MMF_DUMP_SECURELY 1 /* core file is readable only by root */
355#define MMF_DUMPABLE_BITS 2
356
357/* coredump filter bits */
358#define MMF_DUMP_ANON_PRIVATE 2
359#define MMF_DUMP_ANON_SHARED 3
360#define MMF_DUMP_MAPPED_PRIVATE 4
361#define MMF_DUMP_MAPPED_SHARED 5
362#define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS
363#define MMF_DUMP_FILTER_BITS 4
364#define MMF_DUMP_FILTER_MASK \
365 (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT)
366#define MMF_DUMP_FILTER_DEFAULT \
367 ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED))
368
348struct mm_struct { 369struct mm_struct {
349 struct vm_area_struct * mmap; /* list of VMAs */ 370 struct vm_area_struct * mmap; /* list of VMAs */
350 struct rb_root mm_rb; 371 struct rb_root mm_rb;
@@ -402,7 +423,7 @@ struct mm_struct {
402 unsigned int token_priority; 423 unsigned int token_priority;
403 unsigned int last_interval; 424 unsigned int last_interval;
404 425
405 unsigned char dumpable:2; 426 unsigned long flags; /* Must use atomic bitops to access the bits */
406 427
407 /* coredumping support */ 428 /* coredumping support */
408 int core_waiters; 429 int core_waiters;
@@ -660,7 +681,7 @@ enum cpu_idle_type {
660#define SCHED_LOAD_SHIFT 10 681#define SCHED_LOAD_SHIFT 10
661#define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT) 682#define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT)
662 683
663#define SCHED_LOAD_SCALE_FUZZ (SCHED_LOAD_SCALE >> 5) 684#define SCHED_LOAD_SCALE_FUZZ SCHED_LOAD_SCALE
664 685
665#ifdef CONFIG_SMP 686#ifdef CONFIG_SMP
666#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ 687#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */
@@ -713,7 +734,6 @@ struct sched_domain {
713 unsigned long max_interval; /* Maximum balance interval ms */ 734 unsigned long max_interval; /* Maximum balance interval ms */
714 unsigned int busy_factor; /* less balancing by factor if busy */ 735 unsigned int busy_factor; /* less balancing by factor if busy */
715 unsigned int imbalance_pct; /* No balance until over watermark */ 736 unsigned int imbalance_pct; /* No balance until over watermark */
716 unsigned long long cache_hot_time; /* Task considered cache hot (ns) */
717 unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */ 737 unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */
718 unsigned int busy_idx; 738 unsigned int busy_idx;
719 unsigned int idle_idx; 739 unsigned int idle_idx;
@@ -765,6 +785,22 @@ extern int partition_sched_domains(cpumask_t *partition1,
765 785
766#endif /* CONFIG_SMP */ 786#endif /* CONFIG_SMP */
767 787
788/*
789 * A runqueue laden with a single nice 0 task scores a weighted_cpuload of
790 * SCHED_LOAD_SCALE. This function returns 1 if any cpu is laden with a
791 * task of nice 0 or enough lower priority tasks to bring up the
792 * weighted_cpuload
793 */
794static inline int above_background_load(void)
795{
796 unsigned long cpu;
797
798 for_each_online_cpu(cpu) {
799 if (weighted_cpuload(cpu) >= SCHED_LOAD_SCALE)
800 return 1;
801 }
802 return 0;
803}
768 804
769struct io_context; /* See blkdev.h */ 805struct io_context; /* See blkdev.h */
770struct cpuset; 806struct cpuset;
@@ -819,22 +855,20 @@ struct sched_domain;
819struct sched_class { 855struct sched_class {
820 struct sched_class *next; 856 struct sched_class *next;
821 857
822 void (*enqueue_task) (struct rq *rq, struct task_struct *p, 858 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup);
823 int wakeup, u64 now); 859 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
824 void (*dequeue_task) (struct rq *rq, struct task_struct *p,
825 int sleep, u64 now);
826 void (*yield_task) (struct rq *rq, struct task_struct *p); 860 void (*yield_task) (struct rq *rq, struct task_struct *p);
827 861
828 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p); 862 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p);
829 863
830 struct task_struct * (*pick_next_task) (struct rq *rq, u64 now); 864 struct task_struct * (*pick_next_task) (struct rq *rq);
831 void (*put_prev_task) (struct rq *rq, struct task_struct *p, u64 now); 865 void (*put_prev_task) (struct rq *rq, struct task_struct *p);
832 866
833 int (*load_balance) (struct rq *this_rq, int this_cpu, 867 unsigned long (*load_balance) (struct rq *this_rq, int this_cpu,
834 struct rq *busiest, 868 struct rq *busiest,
835 unsigned long max_nr_move, unsigned long max_load_move, 869 unsigned long max_nr_move, unsigned long max_load_move,
836 struct sched_domain *sd, enum cpu_idle_type idle, 870 struct sched_domain *sd, enum cpu_idle_type idle,
837 int *all_pinned, unsigned long *total_load_moved); 871 int *all_pinned, int *this_best_prio);
838 872
839 void (*set_curr_task) (struct rq *rq); 873 void (*set_curr_task) (struct rq *rq);
840 void (*task_tick) (struct rq *rq, struct task_struct *p); 874 void (*task_tick) (struct rq *rq, struct task_struct *p);
@@ -868,23 +902,29 @@ struct sched_entity {
868 struct rb_node run_node; 902 struct rb_node run_node;
869 unsigned int on_rq; 903 unsigned int on_rq;
870 904
905 u64 exec_start;
906 u64 sum_exec_runtime;
907 u64 prev_sum_exec_runtime;
871 u64 wait_start_fair; 908 u64 wait_start_fair;
909 u64 sleep_start_fair;
910
911#ifdef CONFIG_SCHEDSTATS
872 u64 wait_start; 912 u64 wait_start;
873 u64 exec_start; 913 u64 wait_max;
914 s64 sum_wait_runtime;
915
874 u64 sleep_start; 916 u64 sleep_start;
875 u64 sleep_start_fair;
876 u64 block_start;
877 u64 sleep_max; 917 u64 sleep_max;
918 s64 sum_sleep_runtime;
919
920 u64 block_start;
878 u64 block_max; 921 u64 block_max;
879 u64 exec_max; 922 u64 exec_max;
880 u64 wait_max;
881 u64 last_ran;
882 923
883 u64 sum_exec_runtime;
884 s64 sum_wait_runtime;
885 s64 sum_sleep_runtime;
886 unsigned long wait_runtime_overruns; 924 unsigned long wait_runtime_overruns;
887 unsigned long wait_runtime_underruns; 925 unsigned long wait_runtime_underruns;
926#endif
927
888#ifdef CONFIG_FAIR_GROUP_SCHED 928#ifdef CONFIG_FAIR_GROUP_SCHED
889 struct sched_entity *parent; 929 struct sched_entity *parent;
890 /* rq on which this entity is (to be) queued: */ 930 /* rq on which this entity is (to be) queued: */
@@ -914,6 +954,11 @@ struct task_struct {
914 struct sched_class *sched_class; 954 struct sched_class *sched_class;
915 struct sched_entity se; 955 struct sched_entity se;
916 956
957#ifdef CONFIG_PREEMPT_NOTIFIERS
958 /* list of struct preempt_notifier: */
959 struct hlist_head preempt_notifiers;
960#endif
961
917 unsigned short ioprio; 962 unsigned short ioprio;
918#ifdef CONFIG_BLK_DEV_IO_TRACE 963#ifdef CONFIG_BLK_DEV_IO_TRACE
919 unsigned int btrace_seq; 964 unsigned int btrace_seq;
@@ -1327,6 +1372,13 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1327#endif 1372#endif
1328 1373
1329extern unsigned long long sched_clock(void); 1374extern unsigned long long sched_clock(void);
1375
1376/*
1377 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
1378 * clock constructed from sched_clock():
1379 */
1380extern unsigned long long cpu_clock(int cpu);
1381
1330extern unsigned long long 1382extern unsigned long long
1331task_sched_runtime(struct task_struct *task); 1383task_sched_runtime(struct task_struct *task);
1332 1384
@@ -1337,7 +1389,8 @@ extern void sched_exec(void);
1337#define sched_exec() {} 1389#define sched_exec() {}
1338#endif 1390#endif
1339 1391
1340extern void sched_clock_unstable_event(void); 1392extern void sched_clock_idle_sleep_event(void);
1393extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1341 1394
1342#ifdef CONFIG_HOTPLUG_CPU 1395#ifdef CONFIG_HOTPLUG_CPU
1343extern void idle_task_exit(void); 1396extern void idle_task_exit(void);
@@ -1347,7 +1400,8 @@ static inline void idle_task_exit(void) {}
1347 1400
1348extern void sched_idle_next(void); 1401extern void sched_idle_next(void);
1349 1402
1350extern unsigned int sysctl_sched_granularity; 1403extern unsigned int sysctl_sched_latency;
1404extern unsigned int sysctl_sched_min_granularity;
1351extern unsigned int sysctl_sched_wakeup_granularity; 1405extern unsigned int sysctl_sched_wakeup_granularity;
1352extern unsigned int sysctl_sched_batch_wakeup_granularity; 1406extern unsigned int sysctl_sched_batch_wakeup_granularity;
1353extern unsigned int sysctl_sched_stat_granularity; 1407extern unsigned int sysctl_sched_stat_granularity;
diff --git a/include/linux/security.h b/include/linux/security.h
index c11dc8aa0351..1a15526e9f67 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -54,7 +54,7 @@ extern int cap_inode_removexattr(struct dentry *dentry, char *name);
54extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags); 54extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags);
55extern void cap_task_reparent_to_init (struct task_struct *p); 55extern void cap_task_reparent_to_init (struct task_struct *p);
56extern int cap_syslog (int type); 56extern int cap_syslog (int type);
57extern int cap_vm_enough_memory (long pages); 57extern int cap_vm_enough_memory (struct mm_struct *mm, long pages);
58 58
59struct msghdr; 59struct msghdr;
60struct sk_buff; 60struct sk_buff;
@@ -1125,6 +1125,7 @@ struct request_sock;
1125 * Return 0 if permission is granted. 1125 * Return 0 if permission is granted.
1126 * @vm_enough_memory: 1126 * @vm_enough_memory:
1127 * Check permissions for allocating a new virtual mapping. 1127 * Check permissions for allocating a new virtual mapping.
1128 * @mm contains the mm struct it is being added to.
1128 * @pages contains the number of pages. 1129 * @pages contains the number of pages.
1129 * Return 0 if permission is granted. 1130 * Return 0 if permission is granted.
1130 * 1131 *
@@ -1169,7 +1170,7 @@ struct security_operations {
1169 int (*quota_on) (struct dentry * dentry); 1170 int (*quota_on) (struct dentry * dentry);
1170 int (*syslog) (int type); 1171 int (*syslog) (int type);
1171 int (*settime) (struct timespec *ts, struct timezone *tz); 1172 int (*settime) (struct timespec *ts, struct timezone *tz);
1172 int (*vm_enough_memory) (long pages); 1173 int (*vm_enough_memory) (struct mm_struct *mm, long pages);
1173 1174
1174 int (*bprm_alloc_security) (struct linux_binprm * bprm); 1175 int (*bprm_alloc_security) (struct linux_binprm * bprm);
1175 void (*bprm_free_security) (struct linux_binprm * bprm); 1176 void (*bprm_free_security) (struct linux_binprm * bprm);
@@ -1469,10 +1470,14 @@ static inline int security_settime(struct timespec *ts, struct timezone *tz)
1469 return security_ops->settime(ts, tz); 1470 return security_ops->settime(ts, tz);
1470} 1471}
1471 1472
1472
1473static inline int security_vm_enough_memory(long pages) 1473static inline int security_vm_enough_memory(long pages)
1474{ 1474{
1475 return security_ops->vm_enough_memory(pages); 1475 return security_ops->vm_enough_memory(current->mm, pages);
1476}
1477
1478static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
1479{
1480 return security_ops->vm_enough_memory(mm, pages);
1476} 1481}
1477 1482
1478static inline int security_bprm_alloc (struct linux_binprm *bprm) 1483static inline int security_bprm_alloc (struct linux_binprm *bprm)
@@ -2219,7 +2224,12 @@ static inline int security_settime(struct timespec *ts, struct timezone *tz)
2219 2224
2220static inline int security_vm_enough_memory(long pages) 2225static inline int security_vm_enough_memory(long pages)
2221{ 2226{
2222 return cap_vm_enough_memory(pages); 2227 return cap_vm_enough_memory(current->mm, pages);
2228}
2229
2230static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
2231{
2232 return cap_vm_enough_memory(mm, pages);
2223} 2233}
2224 2234
2225static inline int security_bprm_alloc (struct linux_binprm *bprm) 2235static inline int security_bprm_alloc (struct linux_binprm *bprm)
diff --git a/include/linux/selection.h b/include/linux/selection.h
index ed3408b400f1..f9457861937c 100644
--- a/include/linux/selection.h
+++ b/include/linux/selection.h
@@ -10,6 +10,8 @@
10#include <linux/tiocl.h> 10#include <linux/tiocl.h>
11#include <linux/vt_buffer.h> 11#include <linux/vt_buffer.h>
12 12
13struct tty_struct;
14
13extern struct vc_data *sel_cons; 15extern struct vc_data *sel_cons;
14 16
15extern void clear_selection(void); 17extern void clear_selection(void);
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 706ee9a4c80c..afe0f6d9b9bc 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -20,7 +20,7 @@
20struct plat_serial8250_port { 20struct plat_serial8250_port {
21 unsigned long iobase; /* io base address */ 21 unsigned long iobase; /* io base address */
22 void __iomem *membase; /* ioremap cookie or NULL */ 22 void __iomem *membase; /* ioremap cookie or NULL */
23 unsigned long mapbase; /* resource base */ 23 resource_size_t mapbase; /* resource base */
24 unsigned int irq; /* interrupt number */ 24 unsigned int irq; /* interrupt number */
25 unsigned int uartclk; /* UART clock rate */ 25 unsigned int uartclk; /* UART clock rate */
26 unsigned char regshift; /* register shift */ 26 unsigned char regshift; /* register shift */
@@ -60,6 +60,8 @@ void serial8250_unregister_port(int line);
60void serial8250_suspend_port(int line); 60void serial8250_suspend_port(int line);
61void serial8250_resume_port(int line); 61void serial8250_resume_port(int line);
62 62
63extern int early_serial_setup(struct uart_port *port);
64
63extern int serial8250_find_port(struct uart_port *p); 65extern int serial8250_find_port(struct uart_port *p);
64extern int serial8250_find_port_for_earlycon(void); 66extern int serial8250_find_port_for_earlycon(void);
65extern int setup_early_serial8250_console(char *cmdline); 67extern int setup_early_serial8250_console(char *cmdline);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 9c721cd2c9d6..09d17b06bf02 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -62,8 +62,9 @@
62/* NEC v850. */ 62/* NEC v850. */
63#define PORT_V850E_UART 40 63#define PORT_V850E_UART 40
64 64
65/* DZ */ 65/* DEC */
66#define PORT_DZ 47 66#define PORT_DZ 46
67#define PORT_ZS 47
67 68
68/* Parisc type numbers. */ 69/* Parisc type numbers. */
69#define PORT_MUX 48 70#define PORT_MUX 48
@@ -287,7 +288,7 @@ struct uart_port {
287 const struct uart_ops *ops; 288 const struct uart_ops *ops;
288 unsigned int custom_divisor; 289 unsigned int custom_divisor;
289 unsigned int line; /* port index */ 290 unsigned int line; /* port index */
290 unsigned long mapbase; /* for ioremap */ 291 resource_size_t mapbase; /* for ioremap */
291 struct device *dev; /* parent device */ 292 struct device *dev; /* parent device */
292 unsigned char hub6; /* this should be in the 8250 driver */ 293 unsigned char hub6; /* this should be in the 8250 driver */
293 unsigned char unused[3]; 294 unsigned char unused[3];
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
index 1c5ed7d92b0f..96c0d93fc2ca 100644
--- a/include/linux/serial_reg.h
+++ b/include/linux/serial_reg.h
@@ -118,6 +118,7 @@
118#define UART_LSR_PE 0x04 /* Parity error indicator */ 118#define UART_LSR_PE 0x04 /* Parity error indicator */
119#define UART_LSR_OE 0x02 /* Overrun error indicator */ 119#define UART_LSR_OE 0x02 /* Overrun error indicator */
120#define UART_LSR_DR 0x01 /* Receiver data ready */ 120#define UART_LSR_DR 0x01 /* Receiver data ready */
121#define UART_LSR_BRK_ERROR_BITS 0x1E /* BI, FE, PE, OE bits */
121 122
122#define UART_MSR 6 /* In: Modem Status Register */ 123#define UART_MSR 6 /* In: Modem Status Register */
123#define UART_MSR_DCD 0x80 /* Data Carrier Detect */ 124#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
diff --git a/include/linux/signal.h b/include/linux/signal.h
index ea91abe740da..0ae338866240 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -237,12 +237,15 @@ extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct
237extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); 237extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *);
238extern long do_sigpending(void __user *, unsigned long); 238extern long do_sigpending(void __user *, unsigned long);
239extern int sigprocmask(int, sigset_t *, sigset_t *); 239extern int sigprocmask(int, sigset_t *, sigset_t *);
240extern int show_unhandled_signals;
240 241
241struct pt_regs; 242struct pt_regs;
242extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); 243extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
243 244
244extern struct kmem_cache *sighand_cachep; 245extern struct kmem_cache *sighand_cachep;
245 246
247int unhandled_signal(struct task_struct *tsk, int sig);
248
246/* 249/*
247 * In POSIX a signal is sent either to a specific thread (Linux task) 250 * In POSIX a signal is sent either to a specific thread (Linux task)
248 * or to the process as a whole (Linux thread group). How the signal 251 * or to the process as a whole (Linux thread group). How the signal
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ce256438e619..93c27f71122a 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -134,8 +134,8 @@ typedef struct skb_frag_struct skb_frag_t;
134 134
135struct skb_frag_struct { 135struct skb_frag_struct {
136 struct page *page; 136 struct page *page;
137 __u16 page_offset; 137 __u32 page_offset;
138 __u16 size; 138 __u32 size;
139}; 139};
140 140
141/* This data is invariant across clones and lives at 141/* This data is invariant across clones and lives at
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 0e1d0daef6a2..d859354b9e51 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -40,7 +40,7 @@
40 */ 40 */
41#define ZERO_SIZE_PTR ((void *)16) 41#define ZERO_SIZE_PTR ((void *)16)
42 42
43#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) < \ 43#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= \
44 (unsigned long)ZERO_SIZE_PTR) 44 (unsigned long)ZERO_SIZE_PTR)
45 45
46/* 46/*
@@ -51,7 +51,6 @@ int slab_is_available(void);
51 51
52struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, 52struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
53 unsigned long, 53 unsigned long,
54 void (*)(void *, struct kmem_cache *, unsigned long),
55 void (*)(void *, struct kmem_cache *, unsigned long)); 54 void (*)(void *, struct kmem_cache *, unsigned long));
56void kmem_cache_destroy(struct kmem_cache *); 55void kmem_cache_destroy(struct kmem_cache *);
57int kmem_cache_shrink(struct kmem_cache *); 56int kmem_cache_shrink(struct kmem_cache *);
@@ -70,7 +69,7 @@ int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
70 */ 69 */
71#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\ 70#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\
72 sizeof(struct __struct), __alignof__(struct __struct),\ 71 sizeof(struct __struct), __alignof__(struct __struct),\
73 (__flags), NULL, NULL) 72 (__flags), NULL)
74 73
75/* 74/*
76 * The largest kmalloc size supported by the slab allocators is 75 * The largest kmalloc size supported by the slab allocators is
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 07f7e4cbcee3..74962077f632 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -78,7 +78,7 @@ extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
78 * Sorry that the following has to be that ugly but some versions of GCC 78 * Sorry that the following has to be that ugly but some versions of GCC
79 * have trouble with constant propagation and loops. 79 * have trouble with constant propagation and loops.
80 */ 80 */
81static inline int kmalloc_index(size_t size) 81static __always_inline int kmalloc_index(size_t size)
82{ 82{
83 if (!size) 83 if (!size)
84 return 0; 84 return 0;
@@ -133,7 +133,7 @@ static inline int kmalloc_index(size_t size)
133 * This ought to end up with a global pointer to the right cache 133 * This ought to end up with a global pointer to the right cache
134 * in kmalloc_caches. 134 * in kmalloc_caches.
135 */ 135 */
136static inline struct kmem_cache *kmalloc_slab(size_t size) 136static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
137{ 137{
138 int index = kmalloc_index(size); 138 int index = kmalloc_index(size);
139 139
@@ -160,13 +160,13 @@ static inline struct kmem_cache *kmalloc_slab(size_t size)
160#define SLUB_DMA __GFP_DMA 160#define SLUB_DMA __GFP_DMA
161#else 161#else
162/* Disable DMA functionality */ 162/* Disable DMA functionality */
163#define SLUB_DMA 0 163#define SLUB_DMA (__force gfp_t)0
164#endif 164#endif
165 165
166void *kmem_cache_alloc(struct kmem_cache *, gfp_t); 166void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
167void *__kmalloc(size_t size, gfp_t flags); 167void *__kmalloc(size_t size, gfp_t flags);
168 168
169static inline void *kmalloc(size_t size, gfp_t flags) 169static __always_inline void *kmalloc(size_t size, gfp_t flags)
170{ 170{
171 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { 171 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
172 struct kmem_cache *s = kmalloc_slab(size); 172 struct kmem_cache *s = kmalloc_slab(size);
@@ -183,7 +183,7 @@ static inline void *kmalloc(size_t size, gfp_t flags)
183void *__kmalloc_node(size_t size, gfp_t flags, int node); 183void *__kmalloc_node(size_t size, gfp_t flags, int node);
184void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 184void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
185 185
186static inline void *kmalloc_node(size_t size, gfp_t flags, int node) 186static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
187{ 187{
188 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { 188 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
189 struct kmem_cache *s = kmalloc_slab(size); 189 struct kmem_cache *s = kmalloc_slab(size);
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 302b81d1d117..002a3cddbdd5 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -77,6 +77,7 @@ struct spi_device {
77#define SPI_CS_HIGH 0x04 /* chipselect active high? */ 77#define SPI_CS_HIGH 0x04 /* chipselect active high? */
78#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ 78#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */
79#define SPI_3WIRE 0x10 /* SI/SO signals shared */ 79#define SPI_3WIRE 0x10 /* SI/SO signals shared */
80#define SPI_LOOP 0x20 /* loopback mode */
80 u8 bits_per_word; 81 u8 bits_per_word;
81 int irq; 82 int irq;
82 void *controller_state; 83 void *controller_state;
@@ -138,6 +139,32 @@ struct spi_message;
138 139
139 140
140 141
142/**
143 * struct spi_driver - Host side "protocol" driver
144 * @probe: Binds this driver to the spi device. Drivers can verify
145 * that the device is actually present, and may need to configure
146 * characteristics (such as bits_per_word) which weren't needed for
147 * the initial configuration done during system setup.
148 * @remove: Unbinds this driver from the spi device
149 * @shutdown: Standard shutdown callback used during system state
150 * transitions such as powerdown/halt and kexec
151 * @suspend: Standard suspend callback used during system state transitions
152 * @resume: Standard resume callback used during system state transitions
153 * @driver: SPI device drivers should initialize the name and owner
154 * field of this structure.
155 *
156 * This represents the kind of device driver that uses SPI messages to
157 * interact with the hardware at the other end of a SPI link. It's called
158 * a "protocol" driver because it works through messages rather than talking
159 * directly to SPI hardware (which is what the underlying SPI controller
160 * driver does to pass those messages). These protocols are defined in the
161 * specification for the device(s) supported by the driver.
162 *
163 * As a rule, those device protocols represent the lowest level interface
164 * supported by a driver, and it will support upper level interfaces too.
165 * Examples of such upper levels include frameworks like MTD, networking,
166 * MMC, RTC, filesystem character device nodes, and hardware monitoring.
167 */
141struct spi_driver { 168struct spi_driver {
142 int (*probe)(struct spi_device *spi); 169 int (*probe)(struct spi_device *spi);
143 int (*remove)(struct spi_device *spi); 170 int (*remove)(struct spi_device *spi);
@@ -667,7 +694,37 @@ static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd)
667 * parport adapters, or microcontrollers acting as USB-to-SPI bridges. 694 * parport adapters, or microcontrollers acting as USB-to-SPI bridges.
668 */ 695 */
669 696
670/* board-specific information about each SPI device */ 697/**
698 * struct spi_board_info - board-specific template for a SPI device
699 * @modalias: Initializes spi_device.modalias; identifies the driver.
700 * @platform_data: Initializes spi_device.platform_data; the particular
701 * data stored there is driver-specific.
702 * @controller_data: Initializes spi_device.controller_data; some
703 * controllers need hints about hardware setup, e.g. for DMA.
704 * @irq: Initializes spi_device.irq; depends on how the board is wired.
705 * @max_speed_hz: Initializes spi_device.max_speed_hz; based on limits
706 * from the chip datasheet and board-specific signal quality issues.
707 * @bus_num: Identifies which spi_master parents the spi_device; unused
708 * by spi_new_device(), and otherwise depends on board wiring.
709 * @chip_select: Initializes spi_device.chip_select; depends on how
710 * the board is wired.
711 * @mode: Initializes spi_device.mode; based on the chip datasheet, board
712 * wiring (some devices support both 3WIRE and standard modes), and
713 * possibly presence of an inverter in the chipselect path.
714 *
715 * When adding new SPI devices to the device tree, these structures serve
716 * as a partial device template. They hold information which can't always
717 * be determined by drivers. Information that probe() can establish (such
718 * as the default transfer wordsize) is not included here.
719 *
720 * These structures are used in two places. Their primary role is to
721 * be stored in tables of board-specific device descriptors, which are
722 * declared early in board initialization and then used (much later) to
723 * populate a controller's device tree after the that controller's driver
724 * initializes. A secondary (and atypical) role is as a parameter to
725 * spi_new_device() call, which happens after those controller drivers
726 * are active in some dynamic board configuration models.
727 */
671struct spi_board_info { 728struct spi_board_info {
672 /* the device name and module name are coupled, like platform_bus; 729 /* the device name and module name are coupled, like platform_bus;
673 * "modalias" is normally the driver name. 730 * "modalias" is normally the driver name.
diff --git a/include/linux/spi/spidev.h b/include/linux/spi/spidev.h
index 7d700be57490..c93ef9d42a01 100644
--- a/include/linux/spi/spidev.h
+++ b/include/linux/spi/spidev.h
@@ -35,6 +35,10 @@
35#define SPI_MODE_2 (SPI_CPOL|0) 35#define SPI_MODE_2 (SPI_CPOL|0)
36#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) 36#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
37 37
38#define SPI_CS_HIGH 0x04
39#define SPI_LSB_FIRST 0x08
40#define SPI_3WIRE 0x10
41#define SPI_LOOP 0x20
38 42
39/*---------------------------------------------------------------------------*/ 43/*---------------------------------------------------------------------------*/
40 44
diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h
index 210549ba4ef4..f6a3a951b79e 100644
--- a/include/linux/spinlock_types.h
+++ b/include/linux/spinlock_types.h
@@ -9,14 +9,14 @@
9 * Released under the General Public License (GPL). 9 * Released under the General Public License (GPL).
10 */ 10 */
11 11
12#include <linux/lockdep.h>
13
14#if defined(CONFIG_SMP) 12#if defined(CONFIG_SMP)
15# include <asm/spinlock_types.h> 13# include <asm/spinlock_types.h>
16#else 14#else
17# include <linux/spinlock_types_up.h> 15# include <linux/spinlock_types_up.h>
18#endif 16#endif
19 17
18#include <linux/lockdep.h>
19
20typedef struct { 20typedef struct {
21 raw_spinlock_t raw_lock; 21 raw_spinlock_t raw_lock;
22#if defined(CONFIG_PREEMPT) && defined(CONFIG_SMP) 22#if defined(CONFIG_PREEMPT) && defined(CONFIG_SMP)
diff --git a/include/linux/spinlock_types_up.h b/include/linux/spinlock_types_up.h
index 27644af20b7c..04135b0e198e 100644
--- a/include/linux/spinlock_types_up.h
+++ b/include/linux/spinlock_types_up.h
@@ -12,14 +12,10 @@
12 * Released under the General Public License (GPL). 12 * Released under the General Public License (GPL).
13 */ 13 */
14 14
15#if defined(CONFIG_DEBUG_SPINLOCK) || \ 15#ifdef CONFIG_DEBUG_SPINLOCK
16 defined(CONFIG_DEBUG_LOCK_ALLOC)
17 16
18typedef struct { 17typedef struct {
19 volatile unsigned int slock; 18 volatile unsigned int slock;
20#ifdef CONFIG_DEBUG_LOCK_ALLOC
21 struct lockdep_map dep_map;
22#endif
23} raw_spinlock_t; 19} raw_spinlock_t;
24 20
25#define __RAW_SPIN_LOCK_UNLOCKED { 1 } 21#define __RAW_SPIN_LOCK_UNLOCKED { 1 }
@@ -34,9 +30,6 @@ typedef struct { } raw_spinlock_t;
34 30
35typedef struct { 31typedef struct {
36 /* no debug version on UP */ 32 /* no debug version on UP */
37#ifdef CONFIG_DEBUG_LOCK_ALLOC
38 struct lockdep_map dep_map;
39#endif
40} raw_rwlock_t; 33} raw_rwlock_t;
41 34
42#define __RAW_RW_LOCK_UNLOCKED { } 35#define __RAW_RW_LOCK_UNLOCKED { }
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index 1d2b084c0185..e7fa657d0c49 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -13,7 +13,7 @@ extern void save_stack_trace(struct stack_trace *trace);
13extern void print_stack_trace(struct stack_trace *trace, int spaces); 13extern void print_stack_trace(struct stack_trace *trace, int spaces);
14#else 14#else
15# define save_stack_trace(trace) do { } while (0) 15# define save_stack_trace(trace) do { } while (0)
16# define print_stack_trace(trace) do { } while (0) 16# define print_stack_trace(trace, spaces) do { } while (0)
17#endif 17#endif
18 18
19#endif 19#endif
diff --git a/include/linux/string.h b/include/linux/string.h
index 7f2eb6a477f9..836062b7582a 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -105,8 +105,12 @@ extern void * memchr(const void *,int,__kernel_size_t);
105#endif 105#endif
106 106
107extern char *kstrdup(const char *s, gfp_t gfp); 107extern char *kstrdup(const char *s, gfp_t gfp);
108extern char *kstrndup(const char *s, size_t len, gfp_t gfp);
108extern void *kmemdup(const void *src, size_t len, gfp_t gfp); 109extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
109 110
111extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
112extern void argv_free(char **argv);
113
110#ifdef __cplusplus 114#ifdef __cplusplus
111} 115}
112#endif 116#endif
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 9e340fa23c06..c6b53d181bfa 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -12,6 +12,7 @@
12#include <linux/uio.h> 12#include <linux/uio.h>
13#include <asm/byteorder.h> 13#include <asm/byteorder.h>
14#include <linux/scatterlist.h> 14#include <linux/scatterlist.h>
15#include <linux/smp_lock.h>
15 16
16/* 17/*
17 * Buffer adjustment 18 * Buffer adjustment
@@ -36,6 +37,21 @@ struct xdr_netobj {
36typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); 37typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj);
37 38
38/* 39/*
40 * We're still requiring the BKL in the xdr code until it's been
41 * more carefully audited, at which point this wrapper will become
42 * unnecessary.
43 */
44static inline int rpc_call_xdrproc(kxdrproc_t xdrproc, void *rqstp, __be32 *data, void *obj)
45{
46 int ret;
47
48 lock_kernel();
49 ret = xdrproc(rqstp, data, obj);
50 unlock_kernel();
51 return ret;
52}
53
54/*
39 * Basic structure for transmission/reception of a client XDR message. 55 * Basic structure for transmission/reception of a client XDR message.
40 * Features a header (for a linear buffer containing RPC headers 56 * Features a header (for a linear buffer containing RPC headers
41 * and the data payload for short messages), and then an array of 57 * and the data payload for short messages), and then an array of
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 9c7cb6430666..388cace9751f 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -24,7 +24,7 @@ struct pbe {
24extern void drain_local_pages(void); 24extern void drain_local_pages(void);
25extern void mark_free_pages(struct zone *zone); 25extern void mark_free_pages(struct zone *zone);
26 26
27#if defined(CONFIG_PM) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) 27#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
28extern int pm_prepare_console(void); 28extern int pm_prepare_console(void);
29extern void pm_restore_console(void); 29extern void pm_restore_console(void);
30#else 30#else
@@ -43,14 +43,18 @@ static inline void pm_restore_console(void) {}
43 * @prepare: prepare system for hibernation 43 * @prepare: prepare system for hibernation
44 * @enter: shut down system after state has been saved to disk 44 * @enter: shut down system after state has been saved to disk
45 * @finish: finish/clean up after state has been reloaded 45 * @finish: finish/clean up after state has been reloaded
46 * @pre_restore: prepare system for the restoration from a hibernation image
47 * @restore_cleanup: clean up after a failing image restoration
46 */ 48 */
47struct hibernation_ops { 49struct hibernation_ops {
48 int (*prepare)(void); 50 int (*prepare)(void);
49 int (*enter)(void); 51 int (*enter)(void);
50 void (*finish)(void); 52 void (*finish)(void);
53 int (*pre_restore)(void);
54 void (*restore_cleanup)(void);
51}; 55};
52 56
53#if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) 57#ifdef CONFIG_HIBERNATION
54/* kernel/power/snapshot.c */ 58/* kernel/power/snapshot.c */
55extern void __register_nosave_region(unsigned long b, unsigned long e, int km); 59extern void __register_nosave_region(unsigned long b, unsigned long e, int km);
56static inline void register_nosave_region(unsigned long b, unsigned long e) 60static inline void register_nosave_region(unsigned long b, unsigned long e)
@@ -68,21 +72,62 @@ extern unsigned long get_safe_page(gfp_t gfp_mask);
68 72
69extern void hibernation_set_ops(struct hibernation_ops *ops); 73extern void hibernation_set_ops(struct hibernation_ops *ops);
70extern int hibernate(void); 74extern int hibernate(void);
71#else 75#else /* CONFIG_HIBERNATION */
72static inline void register_nosave_region(unsigned long b, unsigned long e) {}
73static inline void register_nosave_region_late(unsigned long b, unsigned long e) {}
74static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } 76static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
75static inline void swsusp_set_page_free(struct page *p) {} 77static inline void swsusp_set_page_free(struct page *p) {}
76static inline void swsusp_unset_page_free(struct page *p) {} 78static inline void swsusp_unset_page_free(struct page *p) {}
77 79
78static inline void hibernation_set_ops(struct hibernation_ops *ops) {} 80static inline void hibernation_set_ops(struct hibernation_ops *ops) {}
79static inline int hibernate(void) { return -ENOSYS; } 81static inline int hibernate(void) { return -ENOSYS; }
80#endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */ 82#endif /* CONFIG_HIBERNATION */
81 83
84#ifdef CONFIG_PM_SLEEP
82void save_processor_state(void); 85void save_processor_state(void);
83void restore_processor_state(void); 86void restore_processor_state(void);
84struct saved_context; 87struct saved_context;
85void __save_processor_state(struct saved_context *ctxt); 88void __save_processor_state(struct saved_context *ctxt);
86void __restore_processor_state(struct saved_context *ctxt); 89void __restore_processor_state(struct saved_context *ctxt);
87 90
91/* kernel/power/main.c */
92extern struct blocking_notifier_head pm_chain_head;
93
94static inline int register_pm_notifier(struct notifier_block *nb)
95{
96 return blocking_notifier_chain_register(&pm_chain_head, nb);
97}
98
99static inline int unregister_pm_notifier(struct notifier_block *nb)
100{
101 return blocking_notifier_chain_unregister(&pm_chain_head, nb);
102}
103
104#define pm_notifier(fn, pri) { \
105 static struct notifier_block fn##_nb = \
106 { .notifier_call = fn, .priority = pri }; \
107 register_pm_notifier(&fn##_nb); \
108}
109#else /* !CONFIG_PM_SLEEP */
110
111static inline int register_pm_notifier(struct notifier_block *nb)
112{
113 return 0;
114}
115
116static inline int unregister_pm_notifier(struct notifier_block *nb)
117{
118 return 0;
119}
120
121#define pm_notifier(fn, pri) do { (void)(fn); } while (0)
122#endif /* !CONFIG_PM_SLEEP */
123
124#ifndef CONFIG_HIBERNATION
125static inline void register_nosave_region(unsigned long b, unsigned long e)
126{
127}
128static inline void register_nosave_region_late(unsigned long b, unsigned long e)
129{
130}
131#endif
132
88#endif /* _LINUX_SWSUSP_H */ 133#endif /* _LINUX_SWSUSP_H */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 83d0ec11235e..61def7c8fbb3 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -549,7 +549,7 @@ asmlinkage long sys_inotify_rm_watch(int fd, u32 wd);
549asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, 549asmlinkage long sys_spu_run(int fd, __u32 __user *unpc,
550 __u32 __user *ustatus); 550 __u32 __user *ustatus);
551asmlinkage long sys_spu_create(const char __user *name, 551asmlinkage long sys_spu_create(const char __user *name,
552 unsigned int flags, mode_t mode); 552 unsigned int flags, mode_t mode, int fd);
553 553
554asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode, 554asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode,
555 unsigned dev); 555 unsigned dev);
@@ -610,6 +610,7 @@ asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemas
610asmlinkage long sys_timerfd(int ufd, int clockid, int flags, 610asmlinkage long sys_timerfd(int ufd, int clockid, int flags,
611 const struct itimerspec __user *utmr); 611 const struct itimerspec __user *utmr);
612asmlinkage long sys_eventfd(unsigned int count); 612asmlinkage long sys_eventfd(unsigned int count);
613asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
613 614
614int kernel_execve(const char *filename, char *const argv[], char *const envp[]); 615int kernel_execve(const char *filename, char *const argv[], char *const envp[]);
615 616
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 47f1c53332ce..483050c924c3 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -62,7 +62,7 @@ enum
62 CTL_KERN=1, /* General kernel info and control */ 62 CTL_KERN=1, /* General kernel info and control */
63 CTL_VM=2, /* VM management */ 63 CTL_VM=2, /* VM management */
64 CTL_NET=3, /* Networking */ 64 CTL_NET=3, /* Networking */
65 /* was CTL_PROC */ 65 CTL_PROC=4, /* removal breaks strace(1) compilation */
66 CTL_FS=5, /* Filesystems */ 66 CTL_FS=5, /* Filesystems */
67 CTL_DEBUG=6, /* Debugging */ 67 CTL_DEBUG=6, /* Debugging */
68 CTL_DEV=7, /* Devices */ 68 CTL_DEV=7, /* Devices */
diff --git a/include/linux/time.h b/include/linux/time.h
index ec3b0ced0afe..6a5f503b4f1d 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -4,6 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7# include <linux/cache.h>
7# include <linux/seqlock.h> 8# include <linux/seqlock.h>
8#endif 9#endif
9 10
@@ -94,17 +95,15 @@ extern struct timespec wall_to_monotonic;
94extern seqlock_t xtime_lock __attribute__((weak)); 95extern seqlock_t xtime_lock __attribute__((weak));
95 96
96extern unsigned long read_persistent_clock(void); 97extern unsigned long read_persistent_clock(void);
98extern int update_persistent_clock(struct timespec now);
99extern int no_sync_cmos_clock __read_mostly;
97void timekeeping_init(void); 100void timekeeping_init(void);
98 101
99static inline unsigned long get_seconds(void) 102unsigned long get_seconds(void);
100{
101 return xtime.tv_sec;
102}
103
104struct timespec current_kernel_time(void); 103struct timespec current_kernel_time(void);
105 104
106#define CURRENT_TIME (current_kernel_time()) 105#define CURRENT_TIME (current_kernel_time())
107#define CURRENT_TIME_SEC ((struct timespec) { xtime.tv_sec, 0 }) 106#define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 })
108 107
109extern void do_gettimeofday(struct timeval *tv); 108extern void do_gettimeofday(struct timeval *tv);
110extern int do_settimeofday(struct timespec *tv); 109extern int do_settimeofday(struct timespec *tv);
diff --git a/include/linux/timex.h b/include/linux/timex.h
index da929dbbea2a..37ac3ff90faf 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -224,66 +224,6 @@ static inline int ntp_synced(void)
224 __x < 0 ? -(-__x >> __s) : __x >> __s; \ 224 __x < 0 ? -(-__x >> __s) : __x >> __s; \
225}) 225})
226 226
227
228#ifdef CONFIG_TIME_INTERPOLATION
229
230#define TIME_SOURCE_CPU 0
231#define TIME_SOURCE_MMIO64 1
232#define TIME_SOURCE_MMIO32 2
233#define TIME_SOURCE_FUNCTION 3
234
235/* For proper operations time_interpolator clocks must run slightly slower
236 * than the standard clock since the interpolator may only correct by having
237 * time jump forward during a tick. A slower clock is usually a side effect
238 * of the integer divide of the nanoseconds in a second by the frequency.
239 * The accuracy of the division can be increased by specifying a shift.
240 * However, this may cause the clock not to be slow enough.
241 * The interpolator will self-tune the clock by slowing down if no
242 * resets occur or speeding up if the time jumps per analysis cycle
243 * become too high.
244 *
245 * Setting jitter compensates for a fluctuating timesource by comparing
246 * to the last value read from the timesource to insure that an earlier value
247 * is not returned by a later call. The price to pay
248 * for the compensation is that the timer routines are not as scalable anymore.
249 */
250
251struct time_interpolator {
252 u16 source; /* time source flags */
253 u8 shift; /* increases accuracy of multiply by shifting. */
254 /* Note that bits may be lost if shift is set too high */
255 u8 jitter; /* if set compensate for fluctuations */
256 u32 nsec_per_cyc; /* set by register_time_interpolator() */
257 void *addr; /* address of counter or function */
258 cycles_t mask; /* mask the valid bits of the counter */
259 unsigned long offset; /* nsec offset at last update of interpolator */
260 u64 last_counter; /* counter value in units of the counter at last update */
261 cycles_t last_cycle; /* Last timer value if TIME_SOURCE_JITTER is set */
262 u64 frequency; /* frequency in counts/second */
263 long drift; /* drift in parts-per-million (or -1) */
264 unsigned long skips; /* skips forward */
265 unsigned long ns_skipped; /* nanoseconds skipped */
266 struct time_interpolator *next;
267};
268
269extern void register_time_interpolator(struct time_interpolator *);
270extern void unregister_time_interpolator(struct time_interpolator *);
271extern void time_interpolator_reset(void);
272extern unsigned long time_interpolator_get_offset(void);
273extern void time_interpolator_update(long delta_nsec);
274
275#else /* !CONFIG_TIME_INTERPOLATION */
276
277static inline void time_interpolator_reset(void)
278{
279}
280
281static inline void time_interpolator_update(long delta_nsec)
282{
283}
284
285#endif /* !CONFIG_TIME_INTERPOLATION */
286
287#define TICK_LENGTH_SHIFT 32 227#define TICK_LENGTH_SHIFT 32
288 228
289#ifdef CONFIG_NO_HZ 229#ifdef CONFIG_NO_HZ
diff --git a/include/linux/topology.h b/include/linux/topology.h
index d0890a7e5bab..525d437b1253 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -185,7 +185,6 @@
185 .max_interval = 64*num_online_cpus(), \ 185 .max_interval = 64*num_online_cpus(), \
186 .busy_factor = 128, \ 186 .busy_factor = 128, \
187 .imbalance_pct = 133, \ 187 .imbalance_pct = 133, \
188 .cache_hot_time = (10*1000000), \
189 .cache_nice_tries = 1, \ 188 .cache_nice_tries = 1, \
190 .busy_idx = 3, \ 189 .busy_idx = 3, \
191 .idle_idx = 3, \ 190 .idle_idx = 3, \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 691a1748d9d2..6570719eafdf 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -274,6 +274,8 @@ struct tty_struct {
274#define TTY_PTY_LOCK 16 /* pty private */ 274#define TTY_PTY_LOCK 16 /* pty private */
275#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ 275#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */
276#define TTY_HUPPED 18 /* Post driver->hangup() */ 276#define TTY_HUPPED 18 /* Post driver->hangup() */
277#define TTY_FLUSHING 19 /* Flushing to ldisc in progress */
278#define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */
277 279
278#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) 280#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
279 281
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
new file mode 100644
index 000000000000..44c28e94df50
--- /dev/null
+++ b/include/linux/uio_driver.h
@@ -0,0 +1,91 @@
1/*
2 * include/linux/uio_driver.h
3 *
4 * Copyright(C) 2005, Benedikt Spranger <b.spranger@linutronix.de>
5 * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de>
6 * Copyright(C) 2006, Hans J. Koch <hjk@linutronix.de>
7 * Copyright(C) 2006, Greg Kroah-Hartman <greg@kroah.com>
8 *
9 * Userspace IO driver.
10 *
11 * Licensed under the GPLv2 only.
12 */
13
14#ifndef _UIO_DRIVER_H_
15#define _UIO_DRIVER_H_
16
17#include <linux/module.h>
18#include <linux/fs.h>
19#include <linux/interrupt.h>
20
21/**
22 * struct uio_mem - description of a UIO memory region
23 * @kobj: kobject for this mapping
24 * @addr: address of the device's memory
25 * @size: size of IO
26 * @memtype: type of memory addr points to
27 * @internal_addr: ioremap-ped version of addr, for driver internal use
28 */
29struct uio_mem {
30 struct kobject kobj;
31 unsigned long addr;
32 unsigned long size;
33 int memtype;
34 void __iomem *internal_addr;
35};
36
37#define MAX_UIO_MAPS 5
38
39struct uio_device;
40
41/**
42 * struct uio_info - UIO device capabilities
43 * @uio_dev: the UIO device this info belongs to
44 * @name: device name
45 * @version: device driver version
46 * @mem: list of mappable memory regions, size==0 for end of list
47 * @irq: interrupt number or UIO_IRQ_CUSTOM
48 * @irq_flags: flags for request_irq()
49 * @priv: optional private data
50 * @handler: the device's irq handler
51 * @mmap: mmap operation for this uio device
52 * @open: open operation for this uio device
53 * @release: release operation for this uio device
54 */
55struct uio_info {
56 struct uio_device *uio_dev;
57 char *name;
58 char *version;
59 struct uio_mem mem[MAX_UIO_MAPS];
60 long irq;
61 unsigned long irq_flags;
62 void *priv;
63 irqreturn_t (*handler)(int irq, struct uio_info *dev_info);
64 int (*mmap)(struct uio_info *info, struct vm_area_struct *vma);
65 int (*open)(struct uio_info *info, struct inode *inode);
66 int (*release)(struct uio_info *info, struct inode *inode);
67};
68
69extern int __must_check
70 __uio_register_device(struct module *owner,
71 struct device *parent,
72 struct uio_info *info);
73static inline int __must_check
74 uio_register_device(struct device *parent, struct uio_info *info)
75{
76 return __uio_register_device(THIS_MODULE, parent, info);
77}
78extern void uio_unregister_device(struct uio_info *info);
79extern void uio_event_notify(struct uio_info *info);
80
81/* defines for uio_device->irq */
82#define UIO_IRQ_CUSTOM -1
83#define UIO_IRQ_NONE -2
84
85/* defines for uio_device->memtype */
86#define UIO_MEM_NONE 0
87#define UIO_MEM_PHYS 1
88#define UIO_MEM_LOGICAL 2
89#define UIO_MEM_VIRTUAL 3
90
91#endif /* _LINUX_UIO_DRIVER_H_ */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 7a60946df3b6..4f33a58fa9d1 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -94,6 +94,7 @@ enum usb_interface_condition {
94 * endpoint configurations. They will be in no particular order. 94 * endpoint configurations. They will be in no particular order.
95 * @num_altsetting: number of altsettings defined. 95 * @num_altsetting: number of altsettings defined.
96 * @cur_altsetting: the current altsetting. 96 * @cur_altsetting: the current altsetting.
97 * @intf_assoc: interface association descriptor
97 * @driver: the USB driver that is bound to this interface. 98 * @driver: the USB driver that is bound to this interface.
98 * @minor: the minor number assigned to this interface, if this 99 * @minor: the minor number assigned to this interface, if this
99 * interface is bound to a driver that uses the USB major number. 100 * interface is bound to a driver that uses the USB major number.
@@ -213,6 +214,7 @@ struct usb_interface_cache {
213 * @desc: the device's configuration descriptor. 214 * @desc: the device's configuration descriptor.
214 * @string: pointer to the cached version of the iConfiguration string, if 215 * @string: pointer to the cached version of the iConfiguration string, if
215 * present for this configuration. 216 * present for this configuration.
217 * @intf_assoc: list of any interface association descriptors in this config
216 * @interface: array of pointers to usb_interface structures, one for each 218 * @interface: array of pointers to usb_interface structures, one for each
217 * interface in the configuration. The number of interfaces is stored 219 * interface in the configuration. The number of interfaces is stored
218 * in desc.bNumInterfaces. These pointers are valid only while the 220 * in desc.bNumInterfaces. These pointers are valid only while the
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index bb320573bb9e..1101b0ce878f 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -49,7 +49,7 @@ static inline struct user_namespace *copy_user_ns(int flags,
49 if (flags & CLONE_NEWUSER) 49 if (flags & CLONE_NEWUSER)
50 return ERR_PTR(-EINVAL); 50 return ERR_PTR(-EINVAL);
51 51
52 return NULL; 52 return old_ns;
53} 53}
54 54
55static inline void put_user_ns(struct user_namespace *ns) 55static inline void put_user_ns(struct user_namespace *ns)
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index d16a2b57dc81..ae9b24c12f6a 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -60,6 +60,7 @@
60#include <linux/compiler.h> /* need __user */ 60#include <linux/compiler.h> /* need __user */
61#else 61#else
62#define __user 62#define __user
63#include <sys/time.h>
63#endif 64#endif
64#include <linux/types.h> 65#include <linux/types.h>
65 66
@@ -616,7 +617,6 @@ struct v4l2_framebuffer
616#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 617#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
617#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 618#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
618#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040 619#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
619#define V4L2_FBUF_CAP_GLOBAL_INV_ALPHA 0x0080
620/* Flags for the 'flags' field. */ 620/* Flags for the 'flags' field. */
621#define V4L2_FBUF_FLAG_PRIMARY 0x0001 621#define V4L2_FBUF_FLAG_PRIMARY 0x0001
622#define V4L2_FBUF_FLAG_OVERLAY 0x0002 622#define V4L2_FBUF_FLAG_OVERLAY 0x0002
@@ -624,7 +624,6 @@ struct v4l2_framebuffer
624#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 624#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
625#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 625#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
626#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 626#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
627#define V4L2_FBUF_FLAG_GLOBAL_INV_ALPHA 0x0040
628 627
629struct v4l2_clip 628struct v4l2_clip
630{ 629{
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 132b260aef1e..89338b468d0d 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -58,6 +58,13 @@ void vmalloc_sync_all(void);
58/* 58/*
59 * Lowlevel-APIs (not for driver use!) 59 * Lowlevel-APIs (not for driver use!)
60 */ 60 */
61
62static inline size_t get_vm_area_size(const struct vm_struct *area)
63{
64 /* return actual size without guard page */
65 return area->size - PAGE_SIZE;
66}
67
61extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); 68extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
62extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, 69extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
63 unsigned long start, unsigned long end); 70 unsigned long start, unsigned long end);
@@ -70,6 +77,10 @@ extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
70 struct page ***pages); 77 struct page ***pages);
71extern void unmap_kernel_range(unsigned long addr, unsigned long size); 78extern void unmap_kernel_range(unsigned long addr, unsigned long size);
72 79
80/* Allocate/destroy a 'vmalloc' VM area. */
81extern struct vm_struct *alloc_vm_area(size_t size);
82extern void free_vm_area(struct vm_struct *area);
83
73/* 84/*
74 * Internals. Dont't use.. 85 * Internals. Dont't use..
75 */ 86 */
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index 93780abd01bc..bb46e7645d53 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -145,13 +145,16 @@ do { \
145 { \ 145 { \
146 X##_e = 1; \ 146 X##_e = 1; \
147 _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ 147 _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \
148 FP_SET_EXCEPTION(FP_EX_INEXACT); \
148 } \ 149 } \
149 else \ 150 else \
150 { \ 151 { \
151 X##_e = 0; \ 152 X##_e = 0; \
152 _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ 153 _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \
153 FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \
154 } \ 154 } \
155 if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) || \
156 (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)) \
157 FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \
155 } \ 158 } \
156 else \ 159 else \
157 { \ 160 { \
diff --git a/include/math-emu/soft-fp.h b/include/math-emu/soft-fp.h
index d02eb64a865b..a6f873b45f98 100644
--- a/include/math-emu/soft-fp.h
+++ b/include/math-emu/soft-fp.h
@@ -97,12 +97,19 @@
97#define FP_INHIBIT_RESULTS 0 97#define FP_INHIBIT_RESULTS 0
98#endif 98#endif
99 99
100#ifndef FP_TRAPPING_EXCEPTIONS
101#define FP_TRAPPING_EXCEPTIONS 0
102#endif
103
100#define FP_SET_EXCEPTION(ex) \ 104#define FP_SET_EXCEPTION(ex) \
101 _fex |= (ex) 105 _fex |= (ex)
102 106
103#define FP_UNSET_EXCEPTION(ex) \ 107#define FP_UNSET_EXCEPTION(ex) \
104 _fex &= ~(ex) 108 _fex &= ~(ex)
105 109
110#define FP_CUR_EXCEPTIONS \
111 (_fex)
112
106#define FP_CLEAR_EXCEPTIONS \ 113#define FP_CLEAR_EXCEPTIONS \
107 _fex = 0 114 _fex = 0
108 115
diff --git a/include/media/saa7146.h b/include/media/saa7146.h
index d3f4f5a38214..67703249b245 100644
--- a/include/media/saa7146.h
+++ b/include/media/saa7146.h
@@ -114,7 +114,7 @@ struct saa7146_dev
114 struct mutex lock; 114 struct mutex lock;
115 115
116 unsigned char __iomem *mem; /* pointer to mapped IO memory */ 116 unsigned char __iomem *mem; /* pointer to mapped IO memory */
117 int revision; /* chip revision; needed for bug-workarounds*/ 117 u32 revision; /* chip revision; needed for bug-workarounds*/
118 118
119 /* pci-device & irq stuff*/ 119 /* pci-device & irq stuff*/
120 char name[32]; 120 char name[32];
@@ -157,8 +157,8 @@ struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc);
157int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt); 157int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt);
158void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt); 158void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt);
159int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, struct scatterlist *list, int length ); 159int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, struct scatterlist *list, int length );
160char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt); 160void *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt);
161void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, char *mem, struct saa7146_pgtable *pt); 161void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, void *mem, struct saa7146_pgtable *pt);
162void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data); 162void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data);
163int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); 163int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop);
164 164
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 6dcf3c45707d..160381c72e4b 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -23,8 +23,6 @@
23#define _TUNER_H 23#define _TUNER_H
24 24
25#include <linux/videodev2.h> 25#include <linux/videodev2.h>
26#include <linux/i2c.h>
27#include <media/tuner-types.h>
28 26
29extern int tuner_debug; 27extern int tuner_debug;
30 28
@@ -124,6 +122,7 @@ extern int tuner_debug;
124#define TUNER_THOMSON_FE6600 72 /* DViCO FusionHDTV DVB-T Hybrid */ 122#define TUNER_THOMSON_FE6600 72 /* DViCO FusionHDTV DVB-T Hybrid */
125#define TUNER_SAMSUNG_TCPG_6121P30A 73 /* Hauppauge PVR-500 PAL */ 123#define TUNER_SAMSUNG_TCPG_6121P30A 73 /* Hauppauge PVR-500 PAL */
126#define TUNER_TDA9887 74 /* This tuner should be used only internally */ 124#define TUNER_TDA9887 74 /* This tuner should be used only internally */
125#define TUNER_TEA5761 75 /* Only FM Radio Tuner */
127 126
128/* tv card specific */ 127/* tv card specific */
129#define TDA9887_PRESENT (1<<0) 128#define TDA9887_PRESENT (1<<0)
@@ -182,74 +181,6 @@ struct tuner_setup {
182 int (*tuner_callback) (void *dev, int command,int arg); 181 int (*tuner_callback) (void *dev, int command,int arg);
183}; 182};
184 183
185struct tuner {
186 /* device */
187 struct i2c_client i2c;
188
189 unsigned int type; /* chip type */
190
191 unsigned int mode;
192 unsigned int mode_mask; /* Combination of allowable modes */
193
194 unsigned int tv_freq; /* keep track of the current settings */
195 unsigned int radio_freq;
196 u16 last_div;
197 unsigned int audmode;
198 v4l2_std_id std;
199
200 int using_v4l2;
201
202 /* used by tda9887 */
203 unsigned int tda9887_config;
204 unsigned char tda9887_data[4];
205
206 /* used by MT2032 */
207 unsigned int xogc;
208 unsigned int radio_if2;
209
210 /* used by tda8290 */
211 unsigned char tda8290_easy_mode;
212 unsigned char tda827x_lpsel;
213 unsigned char tda827x_addr;
214 unsigned char tda827x_ver;
215 unsigned int sgIF;
216
217 unsigned int config;
218 int (*tuner_callback) (void *dev, int command,int arg);
219
220 /* function ptrs */
221 void (*set_tv_freq)(struct i2c_client *c, unsigned int freq);
222 void (*set_radio_freq)(struct i2c_client *c, unsigned int freq);
223 int (*has_signal)(struct i2c_client *c);
224 int (*is_stereo)(struct i2c_client *c);
225 int (*get_afc)(struct i2c_client *c);
226 void (*tuner_status)(struct i2c_client *c);
227 void (*standby)(struct i2c_client *c);
228};
229
230extern unsigned const int tuner_count;
231
232extern int microtune_init(struct i2c_client *c);
233extern int xc3028_init(struct i2c_client *c);
234extern int tda8290_init(struct i2c_client *c);
235extern int tda8290_probe(struct i2c_client *c);
236extern int tea5767_tuner_init(struct i2c_client *c);
237extern int default_tuner_init(struct i2c_client *c);
238extern int tea5767_autodetection(struct i2c_client *c);
239extern int tda9887_tuner_init(struct i2c_client *c);
240
241#define tuner_warn(fmt, arg...) do {\
242 printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
243 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
244#define tuner_info(fmt, arg...) do {\
245 printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
246 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
247#define tuner_dbg(fmt, arg...) do {\
248 extern int tuner_debug; \
249 if (tuner_debug) \
250 printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
251 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
252
253#endif /* __KERNEL__ */ 184#endif /* __KERNEL__ */
254 185
255#endif /* _TUNER_H */ 186#endif /* _TUNER_H */
diff --git a/include/mtd/ubi-header.h b/include/mtd/ubi-header.h
index fa479c71aa34..74efa7763479 100644
--- a/include/mtd/ubi-header.h
+++ b/include/mtd/ubi-header.h
@@ -74,42 +74,13 @@ enum {
74 UBI_COMPAT_REJECT = 5 74 UBI_COMPAT_REJECT = 5
75}; 75};
76 76
77/*
78 * ubi16_t/ubi32_t/ubi64_t - 16, 32, and 64-bit integers used in UBI on-flash
79 * data structures.
80 */
81typedef struct {
82 uint16_t int16;
83} __attribute__ ((packed)) ubi16_t;
84
85typedef struct {
86 uint32_t int32;
87} __attribute__ ((packed)) ubi32_t;
88
89typedef struct {
90 uint64_t int64;
91} __attribute__ ((packed)) ubi64_t;
92
93/*
94 * In this implementation of UBI uses the big-endian format for on-flash
95 * integers. The below are the corresponding conversion macros.
96 */
97#define cpu_to_ubi16(x) ((ubi16_t){__cpu_to_be16(x)})
98#define ubi16_to_cpu(x) ((uint16_t)__be16_to_cpu((x).int16))
99
100#define cpu_to_ubi32(x) ((ubi32_t){__cpu_to_be32(x)})
101#define ubi32_to_cpu(x) ((uint32_t)__be32_to_cpu((x).int32))
102
103#define cpu_to_ubi64(x) ((ubi64_t){__cpu_to_be64(x)})
104#define ubi64_to_cpu(x) ((uint64_t)__be64_to_cpu((x).int64))
105
106/* Sizes of UBI headers */ 77/* Sizes of UBI headers */
107#define UBI_EC_HDR_SIZE sizeof(struct ubi_ec_hdr) 78#define UBI_EC_HDR_SIZE sizeof(struct ubi_ec_hdr)
108#define UBI_VID_HDR_SIZE sizeof(struct ubi_vid_hdr) 79#define UBI_VID_HDR_SIZE sizeof(struct ubi_vid_hdr)
109 80
110/* Sizes of UBI headers without the ending CRC */ 81/* Sizes of UBI headers without the ending CRC */
111#define UBI_EC_HDR_SIZE_CRC (UBI_EC_HDR_SIZE - sizeof(ubi32_t)) 82#define UBI_EC_HDR_SIZE_CRC (UBI_EC_HDR_SIZE - sizeof(__be32))
112#define UBI_VID_HDR_SIZE_CRC (UBI_VID_HDR_SIZE - sizeof(ubi32_t)) 83#define UBI_VID_HDR_SIZE_CRC (UBI_VID_HDR_SIZE - sizeof(__be32))
113 84
114/** 85/**
115 * struct ubi_ec_hdr - UBI erase counter header. 86 * struct ubi_ec_hdr - UBI erase counter header.
@@ -137,14 +108,14 @@ typedef struct {
137 * eraseblocks. 108 * eraseblocks.
138 */ 109 */
139struct ubi_ec_hdr { 110struct ubi_ec_hdr {
140 ubi32_t magic; 111 __be32 magic;
141 uint8_t version; 112 __u8 version;
142 uint8_t padding1[3]; 113 __u8 padding1[3];
143 ubi64_t ec; /* Warning: the current limit is 31-bit anyway! */ 114 __be64 ec; /* Warning: the current limit is 31-bit anyway! */
144 ubi32_t vid_hdr_offset; 115 __be32 vid_hdr_offset;
145 ubi32_t data_offset; 116 __be32 data_offset;
146 uint8_t padding2[36]; 117 __u8 padding2[36];
147 ubi32_t hdr_crc; 118 __be32 hdr_crc;
148} __attribute__ ((packed)); 119} __attribute__ ((packed));
149 120
150/** 121/**
@@ -262,22 +233,22 @@ struct ubi_ec_hdr {
262 * software (say, cramfs) on top of the UBI volume. 233 * software (say, cramfs) on top of the UBI volume.
263 */ 234 */
264struct ubi_vid_hdr { 235struct ubi_vid_hdr {
265 ubi32_t magic; 236 __be32 magic;
266 uint8_t version; 237 __u8 version;
267 uint8_t vol_type; 238 __u8 vol_type;
268 uint8_t copy_flag; 239 __u8 copy_flag;
269 uint8_t compat; 240 __u8 compat;
270 ubi32_t vol_id; 241 __be32 vol_id;
271 ubi32_t lnum; 242 __be32 lnum;
272 ubi32_t leb_ver; /* obsolete, to be removed, don't use */ 243 __be32 leb_ver; /* obsolete, to be removed, don't use */
273 ubi32_t data_size; 244 __be32 data_size;
274 ubi32_t used_ebs; 245 __be32 used_ebs;
275 ubi32_t data_pad; 246 __be32 data_pad;
276 ubi32_t data_crc; 247 __be32 data_crc;
277 uint8_t padding1[4]; 248 __u8 padding1[4];
278 ubi64_t sqnum; 249 __be64 sqnum;
279 uint8_t padding2[12]; 250 __u8 padding2[12];
280 ubi32_t hdr_crc; 251 __be32 hdr_crc;
281} __attribute__ ((packed)); 252} __attribute__ ((packed));
282 253
283/* Internal UBI volumes count */ 254/* Internal UBI volumes count */
@@ -306,7 +277,7 @@ struct ubi_vid_hdr {
306#define UBI_VTBL_RECORD_SIZE sizeof(struct ubi_vtbl_record) 277#define UBI_VTBL_RECORD_SIZE sizeof(struct ubi_vtbl_record)
307 278
308/* Size of the volume table record without the ending CRC */ 279/* Size of the volume table record without the ending CRC */
309#define UBI_VTBL_RECORD_SIZE_CRC (UBI_VTBL_RECORD_SIZE - sizeof(ubi32_t)) 280#define UBI_VTBL_RECORD_SIZE_CRC (UBI_VTBL_RECORD_SIZE - sizeof(__be32))
310 281
311/** 282/**
312 * struct ubi_vtbl_record - a record in the volume table. 283 * struct ubi_vtbl_record - a record in the volume table.
@@ -346,15 +317,15 @@ struct ubi_vid_hdr {
346 * Empty records contain all zeroes and the CRC checksum of those zeroes. 317 * Empty records contain all zeroes and the CRC checksum of those zeroes.
347 */ 318 */
348struct ubi_vtbl_record { 319struct ubi_vtbl_record {
349 ubi32_t reserved_pebs; 320 __be32 reserved_pebs;
350 ubi32_t alignment; 321 __be32 alignment;
351 ubi32_t data_pad; 322 __be32 data_pad;
352 uint8_t vol_type; 323 __u8 vol_type;
353 uint8_t upd_marker; 324 __u8 upd_marker;
354 ubi16_t name_len; 325 __be16 name_len;
355 uint8_t name[UBI_VOL_NAME_MAX+1]; 326 __u8 name[UBI_VOL_NAME_MAX+1];
356 uint8_t padding2[24]; 327 __u8 padding2[24];
357 ubi32_t crc; 328 __be32 crc;
358} __attribute__ ((packed)); 329} __attribute__ ((packed));
359 330
360#endif /* !__UBI_HEADER_H__ */ 331#endif /* !__UBI_HEADER_H__ */
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index 6de1e9e35c73..0864a775de24 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -12,37 +12,8 @@ extern void unix_gc(void);
12 12
13#define UNIX_HASH_SIZE 256 13#define UNIX_HASH_SIZE 256
14 14
15extern struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1];
16extern spinlock_t unix_table_lock;
17
18extern atomic_t unix_tot_inflight; 15extern atomic_t unix_tot_inflight;
19 16
20static inline struct sock *first_unix_socket(int *i)
21{
22 for (*i = 0; *i <= UNIX_HASH_SIZE; (*i)++) {
23 if (!hlist_empty(&unix_socket_table[*i]))
24 return __sk_head(&unix_socket_table[*i]);
25 }
26 return NULL;
27}
28
29static inline struct sock *next_unix_socket(int *i, struct sock *s)
30{
31 struct sock *next = sk_next(s);
32 /* More in this chain? */
33 if (next)
34 return next;
35 /* Look for next non-empty chain. */
36 for ((*i)++; *i <= UNIX_HASH_SIZE; (*i)++) {
37 if (!hlist_empty(&unix_socket_table[*i]))
38 return __sk_head(&unix_socket_table[*i]);
39 }
40 return NULL;
41}
42
43#define forall_unix_sockets(i, s) \
44 for (s = first_unix_socket(&(i)); s; s = next_unix_socket(&(i),(s)))
45
46struct unix_address { 17struct unix_address {
47 atomic_t refcnt; 18 atomic_t refcnt;
48 int len; 19 int len;
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 87df4e87622d..70e70f5d3dd6 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -34,7 +34,7 @@
34/* L2CAP socket address */ 34/* L2CAP socket address */
35struct sockaddr_l2 { 35struct sockaddr_l2 {
36 sa_family_t l2_family; 36 sa_family_t l2_family;
37 unsigned short l2_psm; 37 __le16 l2_psm;
38 bdaddr_t l2_bdaddr; 38 bdaddr_t l2_bdaddr;
39}; 39};
40 40
@@ -76,32 +76,32 @@ struct l2cap_conninfo {
76 76
77/* L2CAP structures */ 77/* L2CAP structures */
78struct l2cap_hdr { 78struct l2cap_hdr {
79 __u16 len; 79 __le16 len;
80 __u16 cid; 80 __le16 cid;
81} __attribute__ ((packed)); 81} __attribute__ ((packed));
82#define L2CAP_HDR_SIZE 4 82#define L2CAP_HDR_SIZE 4
83 83
84struct l2cap_cmd_hdr { 84struct l2cap_cmd_hdr {
85 __u8 code; 85 __u8 code;
86 __u8 ident; 86 __u8 ident;
87 __u16 len; 87 __le16 len;
88} __attribute__ ((packed)); 88} __attribute__ ((packed));
89#define L2CAP_CMD_HDR_SIZE 4 89#define L2CAP_CMD_HDR_SIZE 4
90 90
91struct l2cap_cmd_rej { 91struct l2cap_cmd_rej {
92 __u16 reason; 92 __le16 reason;
93} __attribute__ ((packed)); 93} __attribute__ ((packed));
94 94
95struct l2cap_conn_req { 95struct l2cap_conn_req {
96 __u16 psm; 96 __le16 psm;
97 __u16 scid; 97 __le16 scid;
98} __attribute__ ((packed)); 98} __attribute__ ((packed));
99 99
100struct l2cap_conn_rsp { 100struct l2cap_conn_rsp {
101 __u16 dcid; 101 __le16 dcid;
102 __u16 scid; 102 __le16 scid;
103 __u16 result; 103 __le16 result;
104 __u16 status; 104 __le16 status;
105} __attribute__ ((packed)); 105} __attribute__ ((packed));
106 106
107/* connect result */ 107/* connect result */
@@ -117,15 +117,15 @@ struct l2cap_conn_rsp {
117#define L2CAP_CS_AUTHOR_PEND 0x0002 117#define L2CAP_CS_AUTHOR_PEND 0x0002
118 118
119struct l2cap_conf_req { 119struct l2cap_conf_req {
120 __u16 dcid; 120 __le16 dcid;
121 __u16 flags; 121 __le16 flags;
122 __u8 data[0]; 122 __u8 data[0];
123} __attribute__ ((packed)); 123} __attribute__ ((packed));
124 124
125struct l2cap_conf_rsp { 125struct l2cap_conf_rsp {
126 __u16 scid; 126 __le16 scid;
127 __u16 flags; 127 __le16 flags;
128 __u16 result; 128 __le16 result;
129 __u8 data[0]; 129 __u8 data[0];
130} __attribute__ ((packed)); 130} __attribute__ ((packed));
131 131
@@ -149,23 +149,23 @@ struct l2cap_conf_opt {
149#define L2CAP_CONF_MAX_SIZE 22 149#define L2CAP_CONF_MAX_SIZE 22
150 150
151struct l2cap_disconn_req { 151struct l2cap_disconn_req {
152 __u16 dcid; 152 __le16 dcid;
153 __u16 scid; 153 __le16 scid;
154} __attribute__ ((packed)); 154} __attribute__ ((packed));
155 155
156struct l2cap_disconn_rsp { 156struct l2cap_disconn_rsp {
157 __u16 dcid; 157 __le16 dcid;
158 __u16 scid; 158 __le16 scid;
159} __attribute__ ((packed)); 159} __attribute__ ((packed));
160 160
161struct l2cap_info_req { 161struct l2cap_info_req {
162 __u16 type; 162 __le16 type;
163 __u8 data[0]; 163 __u8 data[0];
164} __attribute__ ((packed)); 164} __attribute__ ((packed));
165 165
166struct l2cap_info_rsp { 166struct l2cap_info_rsp {
167 __u16 type; 167 __le16 type;
168 __u16 result; 168 __le16 result;
169 __u8 data[0]; 169 __u8 data[0];
170} __attribute__ ((packed)); 170} __attribute__ ((packed));
171 171
@@ -207,7 +207,7 @@ struct l2cap_conn {
207 207
208struct l2cap_pinfo { 208struct l2cap_pinfo {
209 struct bt_sock bt; 209 struct bt_sock bt;
210 __u16 psm; 210 __le16 psm;
211 __u16 dcid; 211 __u16 dcid;
212 __u16 scid; 212 __u16 scid;
213 213
@@ -225,7 +225,7 @@ struct l2cap_pinfo {
225 225
226 __u8 ident; 226 __u8 ident;
227 227
228 __u16 sport; 228 __le16 sport;
229 229
230 struct l2cap_conn *conn; 230 struct l2cap_conn *conn;
231 struct sock *next_c; 231 struct sock *next_c;
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index b6eaca122db8..decdda546829 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -5,6 +5,22 @@
5#include <net/netlink.h> 5#include <net/netlink.h>
6 6
7/** 7/**
8 * struct genl_multicast_group - generic netlink multicast group
9 * @name: name of the multicast group, names are per-family
10 * @id: multicast group ID, assigned by the core, to use with
11 * genlmsg_multicast().
12 * @list: list entry for linking
13 * @family: pointer to family, need not be set before registering
14 */
15struct genl_multicast_group
16{
17 struct genl_family *family; /* private */
18 struct list_head list; /* private */
19 char name[GENL_NAMSIZ];
20 u32 id;
21};
22
23/**
8 * struct genl_family - generic netlink family 24 * struct genl_family - generic netlink family
9 * @id: protocol family idenfitier 25 * @id: protocol family idenfitier
10 * @hdrsize: length of user specific header in bytes 26 * @hdrsize: length of user specific header in bytes
@@ -14,6 +30,7 @@
14 * @attrbuf: buffer to store parsed attributes 30 * @attrbuf: buffer to store parsed attributes
15 * @ops_list: list of all assigned operations 31 * @ops_list: list of all assigned operations
16 * @family_list: family list 32 * @family_list: family list
33 * @mcast_groups: multicast groups list
17 */ 34 */
18struct genl_family 35struct genl_family
19{ 36{
@@ -25,6 +42,7 @@ struct genl_family
25 struct nlattr ** attrbuf; /* private */ 42 struct nlattr ** attrbuf; /* private */
26 struct list_head ops_list; /* private */ 43 struct list_head ops_list; /* private */
27 struct list_head family_list; /* private */ 44 struct list_head family_list; /* private */
45 struct list_head mcast_groups; /* private */
28}; 46};
29 47
30/** 48/**
@@ -73,6 +91,10 @@ extern int genl_register_family(struct genl_family *family);
73extern int genl_unregister_family(struct genl_family *family); 91extern int genl_unregister_family(struct genl_family *family);
74extern int genl_register_ops(struct genl_family *, struct genl_ops *ops); 92extern int genl_register_ops(struct genl_family *, struct genl_ops *ops);
75extern int genl_unregister_ops(struct genl_family *, struct genl_ops *ops); 93extern int genl_unregister_ops(struct genl_family *, struct genl_ops *ops);
94extern int genl_register_mc_group(struct genl_family *family,
95 struct genl_multicast_group *grp);
96extern void genl_unregister_mc_group(struct genl_family *family,
97 struct genl_multicast_group *grp);
76 98
77extern struct sock *genl_sock; 99extern struct sock *genl_sock;
78 100
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 46b9dce82f6e..9059e0ed7fe3 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -17,6 +17,7 @@
17 17
18#include <linux/ipv6.h> 18#include <linux/ipv6.h>
19#include <linux/hardirq.h> 19#include <linux/hardirq.h>
20#include <net/if_inet6.h>
20#include <net/ndisc.h> 21#include <net/ndisc.h>
21#include <net/flow.h> 22#include <net/flow.h>
22#include <net/snmp.h> 23#include <net/snmp.h>
diff --git a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
index 7a671603fca6..9bf059817aec 100644
--- a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
+++ b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
@@ -21,4 +21,6 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp;
21extern int nf_conntrack_ipv4_compat_init(void); 21extern int nf_conntrack_ipv4_compat_init(void);
22extern void nf_conntrack_ipv4_compat_fini(void); 22extern void nf_conntrack_ipv4_compat_fini(void);
23 23
24extern void need_ipv4_conntrack(void);
25
24#endif /*_NF_CONNTRACK_IPV4_H*/ 26#endif /*_NF_CONNTRACK_IPV4_H*/
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
index 5a8965904377..070d12cb4634 100644
--- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
+++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
@@ -7,9 +7,6 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6;
7extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; 7extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6;
8extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; 8extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6;
9 9
10extern int nf_ct_ipv6_skip_exthdr(const struct sk_buff *skb, int start,
11 u8 *nexthdrp, int len);
12
13extern int nf_ct_frag6_init(void); 10extern int nf_ct_frag6_init(void);
14extern void nf_ct_frag6_cleanup(void); 11extern void nf_ct_frag6_cleanup(void);
15extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb); 12extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb);
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index 040dae5f0c9e..c48e390f4b0f 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -35,7 +35,7 @@ union nf_conntrack_address {
35union nf_conntrack_man_proto 35union nf_conntrack_man_proto
36{ 36{
37 /* Add other protocols here. */ 37 /* Add other protocols here. */
38 u_int16_t all; 38 __be16 all;
39 39
40 struct { 40 struct {
41 __be16 port; 41 __be16 port;
@@ -73,7 +73,7 @@ struct nf_conntrack_tuple
73 union nf_conntrack_address u3; 73 union nf_conntrack_address u3;
74 union { 74 union {
75 /* Add other protocols here. */ 75 /* Add other protocols here. */
76 u_int16_t all; 76 __be16 all;
77 77
78 struct { 78 struct {
79 __be16 port; 79 __be16 port;
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 9b7d6f2ac9a3..2e5b2f6f9fa0 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -132,6 +132,8 @@ struct netlbl_lsm_secattr_catmap {
132#define NETLBL_SECATTR_CACHE 0x00000002 132#define NETLBL_SECATTR_CACHE 0x00000002
133#define NETLBL_SECATTR_MLS_LVL 0x00000004 133#define NETLBL_SECATTR_MLS_LVL 0x00000004
134#define NETLBL_SECATTR_MLS_CAT 0x00000008 134#define NETLBL_SECATTR_MLS_CAT 0x00000008
135#define NETLBL_SECATTR_CACHEABLE (NETLBL_SECATTR_MLS_LVL | \
136 NETLBL_SECATTR_MLS_CAT)
135struct netlbl_lsm_secattr { 137struct netlbl_lsm_secattr {
136 u32 flags; 138 u32 flags;
137 139
@@ -144,10 +146,9 @@ struct netlbl_lsm_secattr {
144}; 146};
145 147
146/* 148/*
147 * LSM security attribute operations 149 * LSM security attribute operations (inline)
148 */ 150 */
149 151
150
151/** 152/**
152 * netlbl_secattr_cache_alloc - Allocate and initialize a secattr cache 153 * netlbl_secattr_cache_alloc - Allocate and initialize a secattr cache
153 * @flags: the memory allocation flags 154 * @flags: the memory allocation flags
@@ -283,6 +284,9 @@ static inline void netlbl_secattr_free(struct netlbl_lsm_secattr *secattr)
283} 284}
284 285
285#ifdef CONFIG_NETLABEL 286#ifdef CONFIG_NETLABEL
287/*
288 * LSM security attribute operations
289 */
286int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap, 290int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap,
287 u32 offset); 291 u32 offset);
288int netlbl_secattr_catmap_walk_rng(struct netlbl_lsm_secattr_catmap *catmap, 292int netlbl_secattr_catmap_walk_rng(struct netlbl_lsm_secattr_catmap *catmap,
@@ -294,6 +298,25 @@ int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap *catmap,
294 u32 start, 298 u32 start,
295 u32 end, 299 u32 end,
296 gfp_t flags); 300 gfp_t flags);
301
302/*
303 * LSM protocol operations
304 */
305int netlbl_enabled(void);
306int netlbl_sock_setattr(struct sock *sk,
307 const struct netlbl_lsm_secattr *secattr);
308int netlbl_sock_getattr(struct sock *sk,
309 struct netlbl_lsm_secattr *secattr);
310int netlbl_skbuff_getattr(const struct sk_buff *skb,
311 struct netlbl_lsm_secattr *secattr);
312void netlbl_skbuff_err(struct sk_buff *skb, int error);
313
314/*
315 * LSM label mapping cache operations
316 */
317void netlbl_cache_invalidate(void);
318int netlbl_cache_add(const struct sk_buff *skb,
319 const struct netlbl_lsm_secattr *secattr);
297#else 320#else
298static inline int netlbl_secattr_catmap_walk( 321static inline int netlbl_secattr_catmap_walk(
299 struct netlbl_lsm_secattr_catmap *catmap, 322 struct netlbl_lsm_secattr_catmap *catmap,
@@ -301,14 +324,12 @@ static inline int netlbl_secattr_catmap_walk(
301{ 324{
302 return -ENOENT; 325 return -ENOENT;
303} 326}
304
305static inline int netlbl_secattr_catmap_walk_rng( 327static inline int netlbl_secattr_catmap_walk_rng(
306 struct netlbl_lsm_secattr_catmap *catmap, 328 struct netlbl_lsm_secattr_catmap *catmap,
307 u32 offset) 329 u32 offset)
308{ 330{
309 return -ENOENT; 331 return -ENOENT;
310} 332}
311
312static inline int netlbl_secattr_catmap_setbit( 333static inline int netlbl_secattr_catmap_setbit(
313 struct netlbl_lsm_secattr_catmap *catmap, 334 struct netlbl_lsm_secattr_catmap *catmap,
314 u32 bit, 335 u32 bit,
@@ -316,7 +337,6 @@ static inline int netlbl_secattr_catmap_setbit(
316{ 337{
317 return 0; 338 return 0;
318} 339}
319
320static inline int netlbl_secattr_catmap_setrng( 340static inline int netlbl_secattr_catmap_setrng(
321 struct netlbl_lsm_secattr_catmap *catmap, 341 struct netlbl_lsm_secattr_catmap *catmap,
322 u32 start, 342 u32 start,
@@ -325,59 +345,33 @@ static inline int netlbl_secattr_catmap_setrng(
325{ 345{
326 return 0; 346 return 0;
327} 347}
328#endif 348static inline int netlbl_enabled(void)
329 349{
330/* 350 return 0;
331 * LSM protocol operations 351}
332 */
333
334#ifdef CONFIG_NETLABEL
335int netlbl_sock_setattr(struct sock *sk,
336 const struct netlbl_lsm_secattr *secattr);
337int netlbl_sock_getattr(struct sock *sk,
338 struct netlbl_lsm_secattr *secattr);
339int netlbl_skbuff_getattr(const struct sk_buff *skb,
340 struct netlbl_lsm_secattr *secattr);
341void netlbl_skbuff_err(struct sk_buff *skb, int error);
342#else
343static inline int netlbl_sock_setattr(struct sock *sk, 352static inline int netlbl_sock_setattr(struct sock *sk,
344 const struct netlbl_lsm_secattr *secattr) 353 const struct netlbl_lsm_secattr *secattr)
345{ 354{
346 return -ENOSYS; 355 return -ENOSYS;
347} 356}
348
349static inline int netlbl_sock_getattr(struct sock *sk, 357static inline int netlbl_sock_getattr(struct sock *sk,
350 struct netlbl_lsm_secattr *secattr) 358 struct netlbl_lsm_secattr *secattr)
351{ 359{
352 return -ENOSYS; 360 return -ENOSYS;
353} 361}
354
355static inline int netlbl_skbuff_getattr(const struct sk_buff *skb, 362static inline int netlbl_skbuff_getattr(const struct sk_buff *skb,
356 struct netlbl_lsm_secattr *secattr) 363 struct netlbl_lsm_secattr *secattr)
357{ 364{
358 return -ENOSYS; 365 return -ENOSYS;
359} 366}
360
361static inline void netlbl_skbuff_err(struct sk_buff *skb, int error) 367static inline void netlbl_skbuff_err(struct sk_buff *skb, int error)
362{ 368{
363 return; 369 return;
364} 370}
365#endif /* CONFIG_NETLABEL */
366
367/*
368 * LSM label mapping cache operations
369 */
370
371#ifdef CONFIG_NETLABEL
372void netlbl_cache_invalidate(void);
373int netlbl_cache_add(const struct sk_buff *skb,
374 const struct netlbl_lsm_secattr *secattr);
375#else
376static inline void netlbl_cache_invalidate(void) 371static inline void netlbl_cache_invalidate(void)
377{ 372{
378 return; 373 return;
379} 374}
380
381static inline int netlbl_cache_add(const struct sk_buff *skb, 375static inline int netlbl_cache_add(const struct sk_buff *skb,
382 const struct netlbl_lsm_secattr *secattr) 376 const struct netlbl_lsm_secattr *secattr)
383{ 377{
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 16baef4dab7e..d529045c1679 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -190,6 +190,16 @@ void sctp_assocs_proc_exit(void);
190 190
191 191
192/* 192/*
193 * Module global variables
194 */
195
196 /*
197 * sctp/protocol.c
198 */
199extern struct kmem_cache *sctp_chunk_cachep __read_mostly;
200extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
201
202/*
193 * Section: Macros, externs, and inlines 203 * Section: Macros, externs, and inlines
194 */ 204 */
195 205
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 73cb9943c8a8..991c85bb9e36 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -214,7 +214,7 @@ struct sctp_chunk *sctp_make_shutdown_ack(const struct sctp_association *asoc,
214 const struct sctp_chunk *); 214 const struct sctp_chunk *);
215struct sctp_chunk *sctp_make_shutdown_complete(const struct sctp_association *, 215struct sctp_chunk *sctp_make_shutdown_complete(const struct sctp_association *,
216 const struct sctp_chunk *); 216 const struct sctp_chunk *);
217void sctp_init_cause(struct sctp_chunk *, __be16 cause, const void *, size_t); 217void sctp_init_cause(struct sctp_chunk *, __be16 cause, size_t);
218struct sctp_chunk *sctp_make_abort(const struct sctp_association *, 218struct sctp_chunk *sctp_make_abort(const struct sctp_association *,
219 const struct sctp_chunk *, 219 const struct sctp_chunk *,
220 const size_t hint); 220 const size_t hint);
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index ee4559b11302..c0d5848c33dc 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -726,6 +726,7 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
726 struct iovec *data); 726 struct iovec *data);
727void sctp_chunk_free(struct sctp_chunk *); 727void sctp_chunk_free(struct sctp_chunk *);
728void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); 728void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data);
729void *sctp_addto_param(struct sctp_chunk *, int len, const void *data);
729struct sctp_chunk *sctp_chunkify(struct sk_buff *, 730struct sctp_chunk *sctp_chunkify(struct sk_buff *,
730 const struct sctp_association *, 731 const struct sctp_association *,
731 struct sock *); 732 struct sock *);
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index 39ea3f442b47..cd33270e86dd 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -83,6 +83,7 @@ int sctp_clear_pd(struct sock *sk, struct sctp_association *asoc);
83/* Skip over an SSN. */ 83/* Skip over an SSN. */
84void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn); 84void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn);
85 85
86void sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *, __u32);
86#endif /* __sctp_ulpqueue_h__ */ 87#endif /* __sctp_ulpqueue_h__ */
87 88
88 89
diff --git a/include/net/tcp.h b/include/net/tcp.h
index a8af9ae00177..185c7ecce4cc 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -281,7 +281,7 @@ extern int tcp_v4_remember_stamp(struct sock *sk);
281 281
282extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); 282extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw);
283 283
284extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, 284extern int tcp_sendmsg(struct kiocb *iocb, struct socket *sock,
285 struct msghdr *msg, size_t size); 285 struct msghdr *msg, size_t size);
286extern ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags); 286extern ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags);
287 287
@@ -652,8 +652,7 @@ struct tcp_congestion_ops {
652 /* lower bound for congestion window (optional) */ 652 /* lower bound for congestion window (optional) */
653 u32 (*min_cwnd)(const struct sock *sk); 653 u32 (*min_cwnd)(const struct sock *sk);
654 /* do new cwnd calculation (required) */ 654 /* do new cwnd calculation (required) */
655 void (*cong_avoid)(struct sock *sk, u32 ack, 655 void (*cong_avoid)(struct sock *sk, u32 ack, u32 in_flight, int good_ack);
656 u32 rtt, u32 in_flight, int good_ack);
657 /* call before changing ca_state (optional) */ 656 /* call before changing ca_state (optional) */
658 void (*set_state)(struct sock *sk, u8 new_state); 657 void (*set_state)(struct sock *sk, u8 new_state);
659 /* call when cwnd event occurs (optional) */ 658 /* call when cwnd event occurs (optional) */
@@ -661,7 +660,7 @@ struct tcp_congestion_ops {
661 /* new value of cwnd after loss (optional) */ 660 /* new value of cwnd after loss (optional) */
662 u32 (*undo_cwnd)(struct sock *sk); 661 u32 (*undo_cwnd)(struct sock *sk);
663 /* hook for packet ack accounting (optional) */ 662 /* hook for packet ack accounting (optional) */
664 void (*pkts_acked)(struct sock *sk, u32 num_acked, ktime_t last); 663 void (*pkts_acked)(struct sock *sk, u32 num_acked, s32 rtt_us);
665 /* get info for inet_diag (optional) */ 664 /* get info for inet_diag (optional) */
666 void (*get_info)(struct sock *sk, u32 ext, struct sk_buff *skb); 665 void (*get_info)(struct sock *sk, u32 ext, struct sk_buff *skb);
667 666
@@ -684,8 +683,7 @@ extern void tcp_slow_start(struct tcp_sock *tp);
684 683
685extern struct tcp_congestion_ops tcp_init_congestion_ops; 684extern struct tcp_congestion_ops tcp_init_congestion_ops;
686extern u32 tcp_reno_ssthresh(struct sock *sk); 685extern u32 tcp_reno_ssthresh(struct sock *sk);
687extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, 686extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight, int flag);
688 u32 rtt, u32 in_flight, int flag);
689extern u32 tcp_reno_min_cwnd(const struct sock *sk); 687extern u32 tcp_reno_min_cwnd(const struct sock *sk);
690extern struct tcp_congestion_ops tcp_reno; 688extern struct tcp_congestion_ops tcp_reno;
691 689
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index ae959e950174..a5f80bfbaaa4 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -585,7 +585,6 @@ static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ct
585struct xfrm_dst 585struct xfrm_dst
586{ 586{
587 union { 587 union {
588 struct xfrm_dst *next;
589 struct dst_entry dst; 588 struct dst_entry dst;
590 struct rtable rt; 589 struct rtable rt;
591 struct rt6_info rt6; 590 struct rt6_info rt6;
diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h
index 30712ddd8a5e..8ec3799e42e1 100644
--- a/include/rdma/ib_mad.h
+++ b/include/rdma/ib_mad.h
@@ -39,6 +39,8 @@
39#if !defined( IB_MAD_H ) 39#if !defined( IB_MAD_H )
40#define IB_MAD_H 40#define IB_MAD_H
41 41
42#include <linux/list.h>
43
42#include <rdma/ib_verbs.h> 44#include <rdma/ib_verbs.h>
43 45
44/* Management base version */ 46/* Management base version */
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 0627a6aa282a..4bea182d7116 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -46,6 +46,8 @@
46#include <linux/mm.h> 46#include <linux/mm.h>
47#include <linux/dma-mapping.h> 47#include <linux/dma-mapping.h>
48#include <linux/kref.h> 48#include <linux/kref.h>
49#include <linux/list.h>
50#include <linux/rwsem.h>
49 51
50#include <asm/atomic.h> 52#include <asm/atomic.h>
51#include <asm/scatterlist.h> 53#include <asm/scatterlist.h>
@@ -731,11 +733,6 @@ struct ib_udata {
731 size_t outlen; 733 size_t outlen;
732}; 734};
733 735
734#define IB_UMEM_MAX_PAGE_CHUNK \
735 ((PAGE_SIZE - offsetof(struct ib_umem_chunk, page_list)) / \
736 ((void *) &((struct ib_umem_chunk *) 0)->page_list[1] - \
737 (void *) &((struct ib_umem_chunk *) 0)->page_list[0]))
738
739struct ib_pd { 736struct ib_pd {
740 struct ib_device *device; 737 struct ib_device *device;
741 struct ib_uobject *uobject; 738 struct ib_uobject *uobject;
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 3f631b08a1ab..b4b31132618b 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -205,11 +205,21 @@ struct iscsi_queue {
205}; 205};
206 206
207struct iscsi_session { 207struct iscsi_session {
208 /*
209 * Syncs up the scsi eh thread with the iscsi eh thread when sending
210 * task management functions. This must be taken before the session
211 * and recv lock.
212 */
213 struct mutex eh_mutex;
214
208 /* iSCSI session-wide sequencing */ 215 /* iSCSI session-wide sequencing */
209 uint32_t cmdsn; 216 uint32_t cmdsn;
210 uint32_t exp_cmdsn; 217 uint32_t exp_cmdsn;
211 uint32_t max_cmdsn; 218 uint32_t max_cmdsn;
212 219
220 /* This tracks the reqs queued into the initiator */
221 uint32_t queued_cmdsn;
222
213 /* configuration */ 223 /* configuration */
214 int initial_r2t_en; 224 int initial_r2t_en;
215 unsigned max_r2t; 225 unsigned max_r2t;
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 2e6bdc4e7a0a..8dda2d66b5b9 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -30,6 +30,7 @@
30#include <linux/timer.h> 30#include <linux/timer.h>
31#include <linux/pci.h> 31#include <linux/pci.h>
32#include <scsi/sas.h> 32#include <scsi/sas.h>
33#include <linux/libata.h>
33#include <linux/list.h> 34#include <linux/list.h>
34#include <asm/semaphore.h> 35#include <asm/semaphore.h>
35#include <scsi/scsi_device.h> 36#include <scsi/scsi_device.h>
@@ -165,6 +166,13 @@ struct sata_device {
165 166
166 u8 port_no; /* port number, if this is a PM (Port) */ 167 u8 port_no; /* port number, if this is a PM (Port) */
167 struct list_head children; /* PM Ports if this is a PM */ 168 struct list_head children; /* PM Ports if this is a PM */
169
170 struct ata_port *ap;
171 struct ata_host ata_host;
172 struct ata_taskfile tf;
173 u32 sstatus;
174 u32 serror;
175 u32 scontrol;
168}; 176};
169 177
170/* ---------- Domain device ---------- */ 178/* ---------- Domain device ---------- */
@@ -340,7 +348,7 @@ struct sas_ha_struct {
340 348
341/* public: */ 349/* public: */
342 char *sas_ha_name; 350 char *sas_ha_name;
343 struct pci_dev *pcidev; /* should be set */ 351 struct device *dev; /* should be set */
344 struct module *lldd_module; /* should be set */ 352 struct module *lldd_module; /* should be set */
345 353
346 u8 *sas_addr; /* must be set */ 354 u8 *sas_addr; /* must be set */
@@ -624,6 +632,7 @@ int sas_set_phy_speed(struct sas_phy *phy,
624 struct sas_phy_linkrates *rates); 632 struct sas_phy_linkrates *rates);
625int sas_phy_enable(struct sas_phy *phy, int enabled); 633int sas_phy_enable(struct sas_phy *phy, int enabled);
626int sas_phy_reset(struct sas_phy *phy, int hard_reset); 634int sas_phy_reset(struct sas_phy *phy, int hard_reset);
635int sas_queue_up(struct sas_task *task);
627extern int sas_queuecommand(struct scsi_cmnd *, 636extern int sas_queuecommand(struct scsi_cmnd *,
628 void (*scsi_done)(struct scsi_cmnd *)); 637 void (*scsi_done)(struct scsi_cmnd *));
629extern int sas_target_alloc(struct scsi_target *); 638extern int sas_target_alloc(struct scsi_target *);
@@ -661,4 +670,10 @@ int __sas_task_abort(struct sas_task *);
661int sas_eh_device_reset_handler(struct scsi_cmnd *cmd); 670int sas_eh_device_reset_handler(struct scsi_cmnd *cmd);
662int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd); 671int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd);
663 672
673extern void sas_target_destroy(struct scsi_target *);
674extern int sas_slave_alloc(struct scsi_device *);
675extern int sas_ioctl(struct scsi_device *sdev, int cmd, void __user *arg);
676
677extern int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
678 struct request *req);
664#endif /* _SASLIB_H_ */ 679#endif /* _SASLIB_H_ */
diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h
new file mode 100644
index 000000000000..dd5edc915417
--- /dev/null
+++ b/include/scsi/sas_ata.h
@@ -0,0 +1,60 @@
1/*
2 * Support for SATA devices on Serial Attached SCSI (SAS) controllers
3 *
4 * Copyright (C) 2006 IBM Corporation
5 *
6 * Written by: Darrick J. Wong <djwong@us.ibm.com>, IBM Corporation
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
22 *
23 */
24
25#ifndef _SAS_ATA_H_
26#define _SAS_ATA_H_
27
28#include <linux/libata.h>
29#include <scsi/libsas.h>
30
31#ifdef CONFIG_SCSI_SAS_ATA
32
33static inline int dev_is_sata(struct domain_device *dev)
34{
35 return (dev->rphy->identify.target_port_protocols & SAS_PROTOCOL_SATA);
36}
37
38int sas_ata_init_host_and_port(struct domain_device *found_dev,
39 struct scsi_target *starget);
40
41void sas_ata_task_abort(struct sas_task *task);
42
43#else
44
45
46static inline int dev_is_sata(struct domain_device *dev)
47{
48 return 0;
49}
50int sas_ata_init_host_and_port(struct domain_device *found_dev,
51 struct scsi_target *starget)
52{
53 return 0;
54}
55void sas_ata_task_abort(struct sas_task *task)
56{
57}
58#endif
59
60#endif /* _SAS_ATA_H_ */
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h
index 02e26c1672bf..3465f31a21c4 100644
--- a/include/scsi/scsi_driver.h
+++ b/include/scsi/scsi_driver.h
@@ -13,8 +13,6 @@ struct scsi_driver {
13 13
14 int (*init_command)(struct scsi_cmnd *); 14 int (*init_command)(struct scsi_cmnd *);
15 void (*rescan)(struct device *); 15 void (*rescan)(struct device *);
16 int (*issue_flush)(struct device *, sector_t *);
17 int (*prepare_flush)(struct request_queue *, struct request *);
18}; 16};
19#define to_scsi_driver(drv) \ 17#define to_scsi_driver(drv) \
20 container_of((drv), struct scsi_driver, gendrv) 18 container_of((drv), struct scsi_driver, gendrv)
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index ba07cf7c04ba..3b8a6a85c2f8 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -341,7 +341,7 @@ struct scsi_host_template {
341 /* 341 /*
342 * Name of proc directory 342 * Name of proc directory
343 */ 343 */
344 char *proc_name; 344 const char *proc_name;
345 345
346 /* 346 /*
347 * Used to store the procfs directory if a driver implements the 347 * Used to store the procfs directory if a driver implements the
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 9aedc19820b0..abdfd2e27dd7 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -7,7 +7,7 @@
7 7
8struct scsi_transport_template; 8struct scsi_transport_template;
9struct sas_rphy; 9struct sas_rphy;
10 10struct request;
11 11
12enum sas_device_type { 12enum sas_device_type {
13 SAS_PHY_UNUSED, 13 SAS_PHY_UNUSED,
@@ -23,6 +23,12 @@ enum sas_protocol {
23 SAS_PROTOCOL_SSP = 0x08, 23 SAS_PROTOCOL_SSP = 0x08,
24}; 24};
25 25
26static inline int sas_protocol_ata(enum sas_protocol proto)
27{
28 return ((proto & SAS_PROTOCOL_SATA) ||
29 (proto & SAS_PROTOCOL_STP))? 1 : 0;
30}
31
26enum sas_linkrate { 32enum sas_linkrate {
27 /* These Values are defined in the SAS standard */ 33 /* These Values are defined in the SAS standard */
28 SAS_LINK_RATE_UNKNOWN = 0, 34 SAS_LINK_RATE_UNKNOWN = 0,
@@ -85,10 +91,12 @@ struct sas_phy {
85#define phy_to_shost(phy) \ 91#define phy_to_shost(phy) \
86 dev_to_shost((phy)->dev.parent) 92 dev_to_shost((phy)->dev.parent)
87 93
94struct request_queue;
88struct sas_rphy { 95struct sas_rphy {
89 struct device dev; 96 struct device dev;
90 struct sas_identify identify; 97 struct sas_identify identify;
91 struct list_head list; 98 struct list_head list;
99 struct request_queue *q;
92 u32 scsi_target_id; 100 u32 scsi_target_id;
93}; 101};
94 102
@@ -166,6 +174,7 @@ struct sas_function_template {
166 int (*phy_reset)(struct sas_phy *, int); 174 int (*phy_reset)(struct sas_phy *, int);
167 int (*phy_enable)(struct sas_phy *, int); 175 int (*phy_enable)(struct sas_phy *, int);
168 int (*set_phy_speed)(struct sas_phy *, struct sas_phy_linkrates *); 176 int (*set_phy_speed)(struct sas_phy *, struct sas_phy_linkrates *);
177 int (*smp_handler)(struct Scsi_Host *, struct sas_rphy *, struct request *);
169}; 178};
170 179
171 180
diff --git a/include/scsi/sd.h b/include/scsi/sd.h
index 5261488e1108..ce02ad1f5185 100644
--- a/include/scsi/sd.h
+++ b/include/scsi/sd.h
@@ -56,8 +56,6 @@ static int sd_suspend(struct device *dev, pm_message_t state);
56static int sd_resume(struct device *dev); 56static int sd_resume(struct device *dev);
57static void sd_rescan(struct device *); 57static void sd_rescan(struct device *);
58static int sd_init_command(struct scsi_cmnd *); 58static int sd_init_command(struct scsi_cmnd *);
59static int sd_issue_flush(struct device *, sector_t *);
60static void sd_prepare_flush(request_queue_t *, struct request *);
61static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer); 59static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer);
62static void scsi_disk_release(struct class_device *cdev); 60static void scsi_disk_release(struct class_device *cdev);
63static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *); 61static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *);
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h
index aa49dda4f410..fd0a6c46f497 100644
--- a/include/sound/ak4xxx-adda.h
+++ b/include/sound/ak4xxx-adda.h
@@ -43,6 +43,7 @@ struct snd_ak4xxx_ops {
43struct snd_akm4xxx_dac_channel { 43struct snd_akm4xxx_dac_channel {
44 char *name; /* mixer volume name */ 44 char *name; /* mixer volume name */
45 unsigned int num_channels; 45 unsigned int num_channels;
46 char *switch_name; /* mixer switch*/
46}; 47};
47 48
48/* ADC labels and channels */ 49/* ADC labels and channels */
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
index 685928e6f65a..353910ce9755 100644
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -1723,6 +1723,10 @@ struct snd_cs46xx {
1723 struct snd_cs46xx_pcm *playback_pcm; 1723 struct snd_cs46xx_pcm *playback_pcm;
1724 unsigned int play_ctl; 1724 unsigned int play_ctl;
1725#endif 1725#endif
1726
1727#ifdef CONFIG_PM
1728 u32 *saved_regs;
1729#endif
1726}; 1730};
1727 1731
1728int snd_cs46xx_create(struct snd_card *card, 1732int snd_cs46xx_create(struct snd_card *card,
diff --git a/include/sound/cs46xx_dsp_spos.h b/include/sound/cs46xx_dsp_spos.h
index da934def31e9..d9da9e59cf37 100644
--- a/include/sound/cs46xx_dsp_spos.h
+++ b/include/sound/cs46xx_dsp_spos.h
@@ -107,6 +107,7 @@ struct dsp_scb_descriptor {
107 char scb_name[DSP_MAX_SCB_NAME]; 107 char scb_name[DSP_MAX_SCB_NAME];
108 u32 address; 108 u32 address;
109 int index; 109 int index;
110 u32 *data;
110 111
111 struct dsp_scb_descriptor * sub_list_ptr; 112 struct dsp_scb_descriptor * sub_list_ptr;
112 struct dsp_scb_descriptor * next_scb_ptr; 113 struct dsp_scb_descriptor * next_scb_ptr;
@@ -127,6 +128,7 @@ struct dsp_task_descriptor {
127 int size; 128 int size;
128 u32 address; 129 u32 address;
129 int index; 130 int index;
131 u32 *data;
130}; 132};
131 133
132struct dsp_pcm_channel_descriptor { 134struct dsp_pcm_channel_descriptor {
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 23e45a4cf0e4..529d0a564367 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -1120,6 +1120,16 @@
1120/************************************************************************************************/ 1120/************************************************************************************************/
1121/* EMU1010m HANA Destinations */ 1121/* EMU1010m HANA Destinations */
1122/************************************************************************************************/ 1122/************************************************************************************************/
1123/* 32-bit destinations of signal in the Hana FPGA. Destinations are either
1124 * physical outputs of Hana, or outputs going to Alice2 (audigy) for capture
1125 * - 16 x EMU_DST_ALICE2_EMU32_X.
1126 */
1127/* EMU32 = 32-bit serial channel between Alice2 (audigy) and Hana (FPGA) */
1128/* EMU_DST_ALICE2_EMU32_X - data channels from Hana to Alice2 used for capture.
1129 * Which data is fed into a EMU_DST_ALICE2_EMU32_X channel in Hana depends on
1130 * setup of mixer control for each destination - see emumixer.c -
1131 * snd_emu1010_output_enum_ctls[], snd_emu1010_input_enum_ctls[]
1132 */
1123#define EMU_DST_ALICE2_EMU32_0 0x000f /* 16 EMU32 channels to Alice2 +0 to +0xf */ 1133#define EMU_DST_ALICE2_EMU32_0 0x000f /* 16 EMU32 channels to Alice2 +0 to +0xf */
1124#define EMU_DST_ALICE2_EMU32_1 0x0000 /* 16 EMU32 channels to Alice2 +0 to +0xf */ 1134#define EMU_DST_ALICE2_EMU32_1 0x0000 /* 16 EMU32 channels to Alice2 +0 to +0xf */
1125#define EMU_DST_ALICE2_EMU32_2 0x0001 /* 16 EMU32 channels to Alice2 +0 to +0xf */ 1135#define EMU_DST_ALICE2_EMU32_2 0x0001 /* 16 EMU32 channels to Alice2 +0 to +0xf */
@@ -1199,6 +1209,12 @@
1199/************************************************************************************************/ 1209/************************************************************************************************/
1200/* EMU1010m HANA Sources */ 1210/* EMU1010m HANA Sources */
1201/************************************************************************************************/ 1211/************************************************************************************************/
1212/* 32-bit sources of signal in the Hana FPGA. The sources are routed to
1213 * destinations using mixer control for each destination - see emumixer.c
1214 * Sources are either physical inputs of FPGA,
1215 * or outputs from Alice (audigy) - 16 x EMU_SRC_ALICE_EMU32A +
1216 * 16 x EMU_SRC_ALICE_EMU32B
1217 */
1202#define EMU_SRC_SILENCE 0x0000 /* Silence */ 1218#define EMU_SRC_SILENCE 0x0000 /* Silence */
1203#define EMU_SRC_DOCK_MIC_A1 0x0100 /* Audio Dock Mic A, 1st or 48kHz only */ 1219#define EMU_SRC_DOCK_MIC_A1 0x0100 /* Audio Dock Mic A, 1st or 48kHz only */
1204#define EMU_SRC_DOCK_MIC_A2 0x0101 /* Audio Dock Mic A, 2nd or 96kHz */ 1220#define EMU_SRC_DOCK_MIC_A2 0x0101 /* Audio Dock Mic A, 2nd or 96kHz */
diff --git a/include/sound/sb.h b/include/sound/sb.h
index 2dd5c8e5b4fe..3ad854b397d2 100644
--- a/include/sound/sb.h
+++ b/include/sound/sb.h
@@ -38,6 +38,7 @@ enum sb_hw_type {
38 SB_HW_ALS100, /* Avance Logic ALS100 chip */ 38 SB_HW_ALS100, /* Avance Logic ALS100 chip */
39 SB_HW_ALS4000, /* Avance Logic ALS4000 chip */ 39 SB_HW_ALS4000, /* Avance Logic ALS4000 chip */
40 SB_HW_DT019X, /* Diamond Tech. DT-019X / Avance Logic ALS-007 */ 40 SB_HW_DT019X, /* Diamond Tech. DT-019X / Avance Logic ALS-007 */
41 SB_HW_CS5530, /* Cyrix/NatSemi 5530 VSA1 */
41}; 42};
42 43
43#define SB_OPEN_PCM 0x01 44#define SB_OPEN_PCM 0x01
diff --git a/include/sound/version.h b/include/sound/version.h
index 8e5b2f0f5946..6bbcfefd2c38 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h. Generated by alsa/ksync script. */ 1/* include/version.h. Generated by alsa/ksync script. */
2#define CONFIG_SND_VERSION "1.0.14" 2#define CONFIG_SND_VERSION "1.0.14"
3#define CONFIG_SND_DATE " (Thu May 31 09:03:25 2007 UTC)" 3#define CONFIG_SND_DATE " (Fri Jul 20 09:12:58 2007 UTC)"
diff --git a/include/sound/wavefront_fx.h b/include/sound/wavefront_fx.h
deleted file mode 100644
index cec92b141796..000000000000
--- a/include/sound/wavefront_fx.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef __SOUND_WAVEFRONT_FX_H
2#define __SOUND_WAVEFRONT_FX_H
3
4extern int snd_wavefront_fx_detect (snd_wavefront_t *);
5extern void snd_wavefront_fx_ioctl (snd_synth_t *sdev,
6 unsigned int cmd,
7 unsigned long arg);
8
9#endif __SOUND_WAVEFRONT_FX_H
diff --git a/include/video/tx3912.h b/include/video/tx3912.h
deleted file mode 100644
index 6b6d006038c2..000000000000
--- a/include/video/tx3912.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * linux/include/video/tx3912.h
3 *
4 * Copyright (C) 2001 Steven Hill (sjhill@realitydiluted.com)
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive for
8 * more details.
9 *
10 * Includes for TMPR3912/05 and PR31700 LCD controller registers
11 */
12#include <asm/tx3912.h>
13
14#define VidCtrl1 REG_AT(0x028)
15#define VidCtrl2 REG_AT(0x02C)
16#define VidCtrl3 REG_AT(0x030)
17#define VidCtrl4 REG_AT(0x034)
18#define VidCtrl5 REG_AT(0x038)
19#define VidCtrl6 REG_AT(0x03C)
20#define VidCtrl7 REG_AT(0x040)
21#define VidCtrl8 REG_AT(0x044)
22#define VidCtrl9 REG_AT(0x048)
23#define VidCtrl10 REG_AT(0x04C)
24#define VidCtrl11 REG_AT(0x050)
25#define VidCtrl12 REG_AT(0x054)
26#define VidCtrl13 REG_AT(0x058)
27#define VidCtrl14 REG_AT(0x05C)
28
29/* Video Control 1 Register */
30#define LINECNT 0xffc00000
31#define LINECNT_SHIFT 22
32#define LOADDLY BIT(21)
33#define BAUDVAL (BIT(20) | BIT(19) | BIT(18) | BIT(17) | BIT(16))
34#define BAUDVAL_SHIFT 16
35#define VIDDONEVAL (BIT(15) | BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10) | BIT(9))
36#define VIDDONEVAL_SHIFT 9
37#define ENFREEZEFRAME BIT(8)
38#define TX3912_VIDCTRL1_BITSEL_MASK 0x000000c0
39#define TX3912_VIDCTRL1_2BIT_GRAY 0x00000040
40#define TX3912_VIDCTRL1_4BIT_GRAY 0x00000080
41#define TX3912_VIDCTRL1_8BIT_COLOR 0x000000c0
42#define BITSEL_SHIFT 6
43#define DISPSPLIT BIT(5)
44#define DISP8 BIT(4)
45#define DFMODE BIT(3)
46#define INVVID BIT(2)
47#define DISPON BIT(1)
48#define ENVID BIT(0)
49
50/* Video Control 2 Register */
51#define VIDRATE_MASK 0xffc00000
52#define VIDRATE_SHIFT 22
53#define HORZVAL_MASK 0x001ff000
54#define HORZVAL_SHIFT 12
55#define LINEVAL_MASK 0x000001ff
56
57/* Video Control 3 Register */
58#define TX3912_VIDCTRL3_VIDBANK_MASK 0xfff00000
59#define TX3912_VIDCTRL3_VIDBASEHI_MASK 0x000ffff0
60
61/* Video Control 4 Register */
62#define TX3912_VIDCTRL4_VIDBASELO_MASK 0x000ffff0
diff --git a/include/xen/events.h b/include/xen/events.h
new file mode 100644
index 000000000000..2bde54d29be5
--- /dev/null
+++ b/include/xen/events.h
@@ -0,0 +1,48 @@
1#ifndef _XEN_EVENTS_H
2#define _XEN_EVENTS_H
3
4#include <linux/interrupt.h>
5
6#include <xen/interface/event_channel.h>
7#include <asm/xen/hypercall.h>
8
9enum ipi_vector {
10 XEN_RESCHEDULE_VECTOR,
11 XEN_CALL_FUNCTION_VECTOR,
12
13 XEN_NR_IPIS,
14};
15
16int bind_evtchn_to_irq(unsigned int evtchn);
17int bind_evtchn_to_irqhandler(unsigned int evtchn,
18 irq_handler_t handler,
19 unsigned long irqflags, const char *devname,
20 void *dev_id);
21int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
22 irq_handler_t handler,
23 unsigned long irqflags, const char *devname,
24 void *dev_id);
25int bind_ipi_to_irqhandler(enum ipi_vector ipi,
26 unsigned int cpu,
27 irq_handler_t handler,
28 unsigned long irqflags,
29 const char *devname,
30 void *dev_id);
31
32/*
33 * Common unbind function for all event sources. Takes IRQ to unbind from.
34 * Automatically closes the underlying event channel (even for bindings
35 * made with bind_evtchn_to_irqhandler()).
36 */
37void unbind_from_irqhandler(unsigned int irq, void *dev_id);
38
39void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector);
40
41static inline void notify_remote_via_evtchn(int port)
42{
43 struct evtchn_send send = { .port = port };
44 (void)HYPERVISOR_event_channel_op(EVTCHNOP_send, &send);
45}
46
47extern void notify_remote_via_irq(int irq);
48#endif /* _XEN_EVENTS_H */
diff --git a/include/xen/features.h b/include/xen/features.h
new file mode 100644
index 000000000000..27292d4d2a6a
--- /dev/null
+++ b/include/xen/features.h
@@ -0,0 +1,23 @@
1/******************************************************************************
2 * features.h
3 *
4 * Query the features reported by Xen.
5 *
6 * Copyright (c) 2006, Ian Campbell
7 */
8
9#ifndef __XEN_FEATURES_H__
10#define __XEN_FEATURES_H__
11
12#include <xen/interface/features.h>
13
14void xen_setup_features(void);
15
16extern u8 xen_features[XENFEAT_NR_SUBMAPS * 32];
17
18static inline int xen_feature(int flag)
19{
20 return xen_features[flag];
21}
22
23#endif /* __ASM_XEN_FEATURES_H__ */
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
new file mode 100644
index 000000000000..761c83498e03
--- /dev/null
+++ b/include/xen/grant_table.h
@@ -0,0 +1,107 @@
1/******************************************************************************
2 * grant_table.h
3 *
4 * Two sets of functionality:
5 * 1. Granting foreign access to our memory reservation.
6 * 2. Accessing others' memory reservations via grant references.
7 * (i.e., mechanisms for both sender and recipient of grant references)
8 *
9 * Copyright (c) 2004-2005, K A Fraser
10 * Copyright (c) 2005, Christopher Clark
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License version 2
14 * as published by the Free Software Foundation; or, when distributed
15 * separately from the Linux kernel or incorporated into other
16 * software packages, subject to the following license:
17 *
18 * Permission is hereby granted, free of charge, to any person obtaining a copy
19 * of this source file (the "Software"), to deal in the Software without
20 * restriction, including without limitation the rights to use, copy, modify,
21 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
22 * and to permit persons to whom the Software is furnished to do so, subject to
23 * the following conditions:
24 *
25 * The above copyright notice and this permission notice shall be included in
26 * all copies or substantial portions of the Software.
27 *
28 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
33 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
34 * IN THE SOFTWARE.
35 */
36
37#ifndef __ASM_GNTTAB_H__
38#define __ASM_GNTTAB_H__
39
40#include <asm/xen/hypervisor.h>
41#include <xen/interface/grant_table.h>
42
43/* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */
44#define NR_GRANT_FRAMES 4
45
46struct gnttab_free_callback {
47 struct gnttab_free_callback *next;
48 void (*fn)(void *);
49 void *arg;
50 u16 count;
51};
52
53int gnttab_grant_foreign_access(domid_t domid, unsigned long frame,
54 int readonly);
55
56/*
57 * End access through the given grant reference, iff the grant entry is no
58 * longer in use. Return 1 if the grant entry was freed, 0 if it is still in
59 * use.
60 */
61int gnttab_end_foreign_access_ref(grant_ref_t ref, int readonly);
62
63/*
64 * Eventually end access through the given grant reference, and once that
65 * access has been ended, free the given page too. Access will be ended
66 * immediately iff the grant entry is not in use, otherwise it will happen
67 * some time later. page may be 0, in which case no freeing will occur.
68 */
69void gnttab_end_foreign_access(grant_ref_t ref, int readonly,
70 unsigned long page);
71
72int gnttab_grant_foreign_transfer(domid_t domid, unsigned long pfn);
73
74unsigned long gnttab_end_foreign_transfer_ref(grant_ref_t ref);
75unsigned long gnttab_end_foreign_transfer(grant_ref_t ref);
76
77int gnttab_query_foreign_access(grant_ref_t ref);
78
79/*
80 * operations on reserved batches of grant references
81 */
82int gnttab_alloc_grant_references(u16 count, grant_ref_t *pprivate_head);
83
84void gnttab_free_grant_reference(grant_ref_t ref);
85
86void gnttab_free_grant_references(grant_ref_t head);
87
88int gnttab_empty_grant_references(const grant_ref_t *pprivate_head);
89
90int gnttab_claim_grant_reference(grant_ref_t *pprivate_head);
91
92void gnttab_release_grant_reference(grant_ref_t *private_head,
93 grant_ref_t release);
94
95void gnttab_request_free_callback(struct gnttab_free_callback *callback,
96 void (*fn)(void *), void *arg, u16 count);
97void gnttab_cancel_free_callback(struct gnttab_free_callback *callback);
98
99void gnttab_grant_foreign_access_ref(grant_ref_t ref, domid_t domid,
100 unsigned long frame, int readonly);
101
102void gnttab_grant_foreign_transfer_ref(grant_ref_t, domid_t domid,
103 unsigned long pfn);
104
105#define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr))
106
107#endif /* __ASM_GNTTAB_H__ */
diff --git a/include/xen/hvc-console.h b/include/xen/hvc-console.h
new file mode 100644
index 000000000000..21c0ecfd786d
--- /dev/null
+++ b/include/xen/hvc-console.h
@@ -0,0 +1,6 @@
1#ifndef XEN_HVC_CONSOLE_H
2#define XEN_HVC_CONSOLE_H
3
4extern struct console xenboot_console;
5
6#endif /* XEN_HVC_CONSOLE_H */
diff --git a/include/xen/interface/elfnote.h b/include/xen/interface/elfnote.h
new file mode 100644
index 000000000000..a64d3df5bd95
--- /dev/null
+++ b/include/xen/interface/elfnote.h
@@ -0,0 +1,133 @@
1/******************************************************************************
2 * elfnote.h
3 *
4 * Definitions used for the Xen ELF notes.
5 *
6 * Copyright (c) 2006, Ian Campbell, XenSource Ltd.
7 */
8
9#ifndef __XEN_PUBLIC_ELFNOTE_H__
10#define __XEN_PUBLIC_ELFNOTE_H__
11
12/*
13 * The notes should live in a SHT_NOTE segment and have "Xen" in the
14 * name field.
15 *
16 * Numeric types are either 4 or 8 bytes depending on the content of
17 * the desc field.
18 *
19 * LEGACY indicated the fields in the legacy __xen_guest string which
20 * this a note type replaces.
21 */
22
23/*
24 * NAME=VALUE pair (string).
25 *
26 * LEGACY: FEATURES and PAE
27 */
28#define XEN_ELFNOTE_INFO 0
29
30/*
31 * The virtual address of the entry point (numeric).
32 *
33 * LEGACY: VIRT_ENTRY
34 */
35#define XEN_ELFNOTE_ENTRY 1
36
37/* The virtual address of the hypercall transfer page (numeric).
38 *
39 * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page
40 * number not a virtual address)
41 */
42#define XEN_ELFNOTE_HYPERCALL_PAGE 2
43
44/* The virtual address where the kernel image should be mapped (numeric).
45 *
46 * Defaults to 0.
47 *
48 * LEGACY: VIRT_BASE
49 */
50#define XEN_ELFNOTE_VIRT_BASE 3
51
52/*
53 * The offset of the ELF paddr field from the acutal required
54 * psuedo-physical address (numeric).
55 *
56 * This is used to maintain backwards compatibility with older kernels
57 * which wrote __PAGE_OFFSET into that field. This field defaults to 0
58 * if not present.
59 *
60 * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE)
61 */
62#define XEN_ELFNOTE_PADDR_OFFSET 4
63
64/*
65 * The version of Xen that we work with (string).
66 *
67 * LEGACY: XEN_VER
68 */
69#define XEN_ELFNOTE_XEN_VERSION 5
70
71/*
72 * The name of the guest operating system (string).
73 *
74 * LEGACY: GUEST_OS
75 */
76#define XEN_ELFNOTE_GUEST_OS 6
77
78/*
79 * The version of the guest operating system (string).
80 *
81 * LEGACY: GUEST_VER
82 */
83#define XEN_ELFNOTE_GUEST_VERSION 7
84
85/*
86 * The loader type (string).
87 *
88 * LEGACY: LOADER
89 */
90#define XEN_ELFNOTE_LOADER 8
91
92/*
93 * The kernel supports PAE (x86/32 only, string = "yes" or "no").
94 *
95 * LEGACY: PAE (n.b. The legacy interface included a provision to
96 * indicate 'extended-cr3' support allowing L3 page tables to be
97 * placed above 4G. It is assumed that any kernel new enough to use
98 * these ELF notes will include this and therefore "yes" here is
99 * equivalent to "yes[entended-cr3]" in the __xen_guest interface.
100 */
101#define XEN_ELFNOTE_PAE_MODE 9
102
103/*
104 * The features supported/required by this kernel (string).
105 *
106 * The string must consist of a list of feature names (as given in
107 * features.h, without the "XENFEAT_" prefix) separated by '|'
108 * characters. If a feature is required for the kernel to function
109 * then the feature name must be preceded by a '!' character.
110 *
111 * LEGACY: FEATURES
112 */
113#define XEN_ELFNOTE_FEATURES 10
114
115/*
116 * The kernel requires the symbol table to be loaded (string = "yes" or "no")
117 * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence
118 * of this string as a boolean flag rather than requiring "yes" or
119 * "no".
120 */
121#define XEN_ELFNOTE_BSD_SYMTAB 11
122
123#endif /* __XEN_PUBLIC_ELFNOTE_H__ */
124
125/*
126 * Local variables:
127 * mode: C
128 * c-set-style: "BSD"
129 * c-basic-offset: 4
130 * tab-width: 4
131 * indent-tabs-mode: nil
132 * End:
133 */
diff --git a/include/xen/interface/event_channel.h b/include/xen/interface/event_channel.h
new file mode 100644
index 000000000000..919b5bdcb2bd
--- /dev/null
+++ b/include/xen/interface/event_channel.h
@@ -0,0 +1,195 @@
1/******************************************************************************
2 * event_channel.h
3 *
4 * Event channels between domains.
5 *
6 * Copyright (c) 2003-2004, K A Fraser.
7 */
8
9#ifndef __XEN_PUBLIC_EVENT_CHANNEL_H__
10#define __XEN_PUBLIC_EVENT_CHANNEL_H__
11
12typedef uint32_t evtchn_port_t;
13DEFINE_GUEST_HANDLE(evtchn_port_t);
14
15/*
16 * EVTCHNOP_alloc_unbound: Allocate a port in domain <dom> and mark as
17 * accepting interdomain bindings from domain <remote_dom>. A fresh port
18 * is allocated in <dom> and returned as <port>.
19 * NOTES:
20 * 1. If the caller is unprivileged then <dom> must be DOMID_SELF.
21 * 2. <rdom> may be DOMID_SELF, allowing loopback connections.
22 */
23#define EVTCHNOP_alloc_unbound 6
24struct evtchn_alloc_unbound {
25 /* IN parameters */
26 domid_t dom, remote_dom;
27 /* OUT parameters */
28 evtchn_port_t port;
29};
30
31/*
32 * EVTCHNOP_bind_interdomain: Construct an interdomain event channel between
33 * the calling domain and <remote_dom>. <remote_dom,remote_port> must identify
34 * a port that is unbound and marked as accepting bindings from the calling
35 * domain. A fresh port is allocated in the calling domain and returned as
36 * <local_port>.
37 * NOTES:
38 * 2. <remote_dom> may be DOMID_SELF, allowing loopback connections.
39 */
40#define EVTCHNOP_bind_interdomain 0
41struct evtchn_bind_interdomain {
42 /* IN parameters. */
43 domid_t remote_dom;
44 evtchn_port_t remote_port;
45 /* OUT parameters. */
46 evtchn_port_t local_port;
47};
48
49/*
50 * EVTCHNOP_bind_virq: Bind a local event channel to VIRQ <irq> on specified
51 * vcpu.
52 * NOTES:
53 * 1. A virtual IRQ may be bound to at most one event channel per vcpu.
54 * 2. The allocated event channel is bound to the specified vcpu. The binding
55 * may not be changed.
56 */
57#define EVTCHNOP_bind_virq 1
58struct evtchn_bind_virq {
59 /* IN parameters. */
60 uint32_t virq;
61 uint32_t vcpu;
62 /* OUT parameters. */
63 evtchn_port_t port;
64};
65
66/*
67 * EVTCHNOP_bind_pirq: Bind a local event channel to PIRQ <irq>.
68 * NOTES:
69 * 1. A physical IRQ may be bound to at most one event channel per domain.
70 * 2. Only a sufficiently-privileged domain may bind to a physical IRQ.
71 */
72#define EVTCHNOP_bind_pirq 2
73struct evtchn_bind_pirq {
74 /* IN parameters. */
75 uint32_t pirq;
76#define BIND_PIRQ__WILL_SHARE 1
77 uint32_t flags; /* BIND_PIRQ__* */
78 /* OUT parameters. */
79 evtchn_port_t port;
80};
81
82/*
83 * EVTCHNOP_bind_ipi: Bind a local event channel to receive events.
84 * NOTES:
85 * 1. The allocated event channel is bound to the specified vcpu. The binding
86 * may not be changed.
87 */
88#define EVTCHNOP_bind_ipi 7
89struct evtchn_bind_ipi {
90 uint32_t vcpu;
91 /* OUT parameters. */
92 evtchn_port_t port;
93};
94
95/*
96 * EVTCHNOP_close: Close a local event channel <port>. If the channel is
97 * interdomain then the remote end is placed in the unbound state
98 * (EVTCHNSTAT_unbound), awaiting a new connection.
99 */
100#define EVTCHNOP_close 3
101struct evtchn_close {
102 /* IN parameters. */
103 evtchn_port_t port;
104};
105
106/*
107 * EVTCHNOP_send: Send an event to the remote end of the channel whose local
108 * endpoint is <port>.
109 */
110#define EVTCHNOP_send 4
111struct evtchn_send {
112 /* IN parameters. */
113 evtchn_port_t port;
114};
115
116/*
117 * EVTCHNOP_status: Get the current status of the communication channel which
118 * has an endpoint at <dom, port>.
119 * NOTES:
120 * 1. <dom> may be specified as DOMID_SELF.
121 * 2. Only a sufficiently-privileged domain may obtain the status of an event
122 * channel for which <dom> is not DOMID_SELF.
123 */
124#define EVTCHNOP_status 5
125struct evtchn_status {
126 /* IN parameters */
127 domid_t dom;
128 evtchn_port_t port;
129 /* OUT parameters */
130#define EVTCHNSTAT_closed 0 /* Channel is not in use. */
131#define EVTCHNSTAT_unbound 1 /* Channel is waiting interdom connection.*/
132#define EVTCHNSTAT_interdomain 2 /* Channel is connected to remote domain. */
133#define EVTCHNSTAT_pirq 3 /* Channel is bound to a phys IRQ line. */
134#define EVTCHNSTAT_virq 4 /* Channel is bound to a virtual IRQ line */
135#define EVTCHNSTAT_ipi 5 /* Channel is bound to a virtual IPI line */
136 uint32_t status;
137 uint32_t vcpu; /* VCPU to which this channel is bound. */
138 union {
139 struct {
140 domid_t dom;
141 } unbound; /* EVTCHNSTAT_unbound */
142 struct {
143 domid_t dom;
144 evtchn_port_t port;
145 } interdomain; /* EVTCHNSTAT_interdomain */
146 uint32_t pirq; /* EVTCHNSTAT_pirq */
147 uint32_t virq; /* EVTCHNSTAT_virq */
148 } u;
149};
150
151/*
152 * EVTCHNOP_bind_vcpu: Specify which vcpu a channel should notify when an
153 * event is pending.
154 * NOTES:
155 * 1. IPI- and VIRQ-bound channels always notify the vcpu that initialised
156 * the binding. This binding cannot be changed.
157 * 2. All other channels notify vcpu0 by default. This default is set when
158 * the channel is allocated (a port that is freed and subsequently reused
159 * has its binding reset to vcpu0).
160 */
161#define EVTCHNOP_bind_vcpu 8
162struct evtchn_bind_vcpu {
163 /* IN parameters. */
164 evtchn_port_t port;
165 uint32_t vcpu;
166};
167
168/*
169 * EVTCHNOP_unmask: Unmask the specified local event-channel port and deliver
170 * a notification to the appropriate VCPU if an event is pending.
171 */
172#define EVTCHNOP_unmask 9
173struct evtchn_unmask {
174 /* IN parameters. */
175 evtchn_port_t port;
176};
177
178struct evtchn_op {
179 uint32_t cmd; /* EVTCHNOP_* */
180 union {
181 struct evtchn_alloc_unbound alloc_unbound;
182 struct evtchn_bind_interdomain bind_interdomain;
183 struct evtchn_bind_virq bind_virq;
184 struct evtchn_bind_pirq bind_pirq;
185 struct evtchn_bind_ipi bind_ipi;
186 struct evtchn_close close;
187 struct evtchn_send send;
188 struct evtchn_status status;
189 struct evtchn_bind_vcpu bind_vcpu;
190 struct evtchn_unmask unmask;
191 } u;
192};
193DEFINE_GUEST_HANDLE_STRUCT(evtchn_op);
194
195#endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h
new file mode 100644
index 000000000000..d73228d16488
--- /dev/null
+++ b/include/xen/interface/features.h
@@ -0,0 +1,43 @@
1/******************************************************************************
2 * features.h
3 *
4 * Feature flags, reported by XENVER_get_features.
5 *
6 * Copyright (c) 2006, Keir Fraser <keir@xensource.com>
7 */
8
9#ifndef __XEN_PUBLIC_FEATURES_H__
10#define __XEN_PUBLIC_FEATURES_H__
11
12/*
13 * If set, the guest does not need to write-protect its pagetables, and can
14 * update them via direct writes.
15 */
16#define XENFEAT_writable_page_tables 0
17
18/*
19 * If set, the guest does not need to write-protect its segment descriptor
20 * tables, and can update them via direct writes.
21 */
22#define XENFEAT_writable_descriptor_tables 1
23
24/*
25 * If set, translation between the guest's 'pseudo-physical' address space
26 * and the host's machine address space are handled by the hypervisor. In this
27 * mode the guest does not need to perform phys-to/from-machine translations
28 * when performing page table operations.
29 */
30#define XENFEAT_auto_translated_physmap 2
31
32/* If set, the guest is running in supervisor mode (e.g., x86 ring 0). */
33#define XENFEAT_supervisor_mode_kernel 3
34
35/*
36 * If set, the guest does not need to allocate x86 PAE page directories
37 * below 4GB. This flag is usually implied by auto_translated_physmap.
38 */
39#define XENFEAT_pae_pgdir_above_4gb 4
40
41#define XENFEAT_NR_SUBMAPS 1
42
43#endif /* __XEN_PUBLIC_FEATURES_H__ */
diff --git a/include/xen/interface/grant_table.h b/include/xen/interface/grant_table.h
new file mode 100644
index 000000000000..219049802cf2
--- /dev/null
+++ b/include/xen/interface/grant_table.h
@@ -0,0 +1,375 @@
1/******************************************************************************
2 * grant_table.h
3 *
4 * Interface for granting foreign access to page frames, and receiving
5 * page-ownership transfers.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to
9 * deal in the Software without restriction, including without limitation the
10 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
24 *
25 * Copyright (c) 2004, K A Fraser
26 */
27
28#ifndef __XEN_PUBLIC_GRANT_TABLE_H__
29#define __XEN_PUBLIC_GRANT_TABLE_H__
30
31
32/***********************************
33 * GRANT TABLE REPRESENTATION
34 */
35
36/* Some rough guidelines on accessing and updating grant-table entries
37 * in a concurrency-safe manner. For more information, Linux contains a
38 * reference implementation for guest OSes (arch/xen/kernel/grant_table.c).
39 *
40 * NB. WMB is a no-op on current-generation x86 processors. However, a
41 * compiler barrier will still be required.
42 *
43 * Introducing a valid entry into the grant table:
44 * 1. Write ent->domid.
45 * 2. Write ent->frame:
46 * GTF_permit_access: Frame to which access is permitted.
47 * GTF_accept_transfer: Pseudo-phys frame slot being filled by new
48 * frame, or zero if none.
49 * 3. Write memory barrier (WMB).
50 * 4. Write ent->flags, inc. valid type.
51 *
52 * Invalidating an unused GTF_permit_access entry:
53 * 1. flags = ent->flags.
54 * 2. Observe that !(flags & (GTF_reading|GTF_writing)).
55 * 3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
56 * NB. No need for WMB as reuse of entry is control-dependent on success of
57 * step 3, and all architectures guarantee ordering of ctrl-dep writes.
58 *
59 * Invalidating an in-use GTF_permit_access entry:
60 * This cannot be done directly. Request assistance from the domain controller
61 * which can set a timeout on the use of a grant entry and take necessary
62 * action. (NB. This is not yet implemented!).
63 *
64 * Invalidating an unused GTF_accept_transfer entry:
65 * 1. flags = ent->flags.
66 * 2. Observe that !(flags & GTF_transfer_committed). [*]
67 * 3. Check result of SMP-safe CMPXCHG(&ent->flags, flags, 0).
68 * NB. No need for WMB as reuse of entry is control-dependent on success of
69 * step 3, and all architectures guarantee ordering of ctrl-dep writes.
70 * [*] If GTF_transfer_committed is set then the grant entry is 'committed'.
71 * The guest must /not/ modify the grant entry until the address of the
72 * transferred frame is written. It is safe for the guest to spin waiting
73 * for this to occur (detect by observing GTF_transfer_completed in
74 * ent->flags).
75 *
76 * Invalidating a committed GTF_accept_transfer entry:
77 * 1. Wait for (ent->flags & GTF_transfer_completed).
78 *
79 * Changing a GTF_permit_access from writable to read-only:
80 * Use SMP-safe CMPXCHG to set GTF_readonly, while checking !GTF_writing.
81 *
82 * Changing a GTF_permit_access from read-only to writable:
83 * Use SMP-safe bit-setting instruction.
84 */
85
86/*
87 * A grant table comprises a packed array of grant entries in one or more
88 * page frames shared between Xen and a guest.
89 * [XEN]: This field is written by Xen and read by the sharing guest.
90 * [GST]: This field is written by the guest and read by Xen.
91 */
92struct grant_entry {
93 /* GTF_xxx: various type and flag information. [XEN,GST] */
94 uint16_t flags;
95 /* The domain being granted foreign privileges. [GST] */
96 domid_t domid;
97 /*
98 * GTF_permit_access: Frame that @domid is allowed to map and access. [GST]
99 * GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN]
100 */
101 uint32_t frame;
102};
103
104/*
105 * Type of grant entry.
106 * GTF_invalid: This grant entry grants no privileges.
107 * GTF_permit_access: Allow @domid to map/access @frame.
108 * GTF_accept_transfer: Allow @domid to transfer ownership of one page frame
109 * to this guest. Xen writes the page number to @frame.
110 */
111#define GTF_invalid (0U<<0)
112#define GTF_permit_access (1U<<0)
113#define GTF_accept_transfer (2U<<0)
114#define GTF_type_mask (3U<<0)
115
116/*
117 * Subflags for GTF_permit_access.
118 * GTF_readonly: Restrict @domid to read-only mappings and accesses. [GST]
119 * GTF_reading: Grant entry is currently mapped for reading by @domid. [XEN]
120 * GTF_writing: Grant entry is currently mapped for writing by @domid. [XEN]
121 */
122#define _GTF_readonly (2)
123#define GTF_readonly (1U<<_GTF_readonly)
124#define _GTF_reading (3)
125#define GTF_reading (1U<<_GTF_reading)
126#define _GTF_writing (4)
127#define GTF_writing (1U<<_GTF_writing)
128
129/*
130 * Subflags for GTF_accept_transfer:
131 * GTF_transfer_committed: Xen sets this flag to indicate that it is committed
132 * to transferring ownership of a page frame. When a guest sees this flag
133 * it must /not/ modify the grant entry until GTF_transfer_completed is
134 * set by Xen.
135 * GTF_transfer_completed: It is safe for the guest to spin-wait on this flag
136 * after reading GTF_transfer_committed. Xen will always write the frame
137 * address, followed by ORing this flag, in a timely manner.
138 */
139#define _GTF_transfer_committed (2)
140#define GTF_transfer_committed (1U<<_GTF_transfer_committed)
141#define _GTF_transfer_completed (3)
142#define GTF_transfer_completed (1U<<_GTF_transfer_completed)
143
144
145/***********************************
146 * GRANT TABLE QUERIES AND USES
147 */
148
149/*
150 * Reference to a grant entry in a specified domain's grant table.
151 */
152typedef uint32_t grant_ref_t;
153
154/*
155 * Handle to track a mapping created via a grant reference.
156 */
157typedef uint32_t grant_handle_t;
158
159/*
160 * GNTTABOP_map_grant_ref: Map the grant entry (<dom>,<ref>) for access
161 * by devices and/or host CPUs. If successful, <handle> is a tracking number
162 * that must be presented later to destroy the mapping(s). On error, <handle>
163 * is a negative status code.
164 * NOTES:
165 * 1. If GNTMAP_device_map is specified then <dev_bus_addr> is the address
166 * via which I/O devices may access the granted frame.
167 * 2. If GNTMAP_host_map is specified then a mapping will be added at
168 * either a host virtual address in the current address space, or at
169 * a PTE at the specified machine address. The type of mapping to
170 * perform is selected through the GNTMAP_contains_pte flag, and the
171 * address is specified in <host_addr>.
172 * 3. Mappings should only be destroyed via GNTTABOP_unmap_grant_ref. If a
173 * host mapping is destroyed by other means then it is *NOT* guaranteed
174 * to be accounted to the correct grant reference!
175 */
176#define GNTTABOP_map_grant_ref 0
177struct gnttab_map_grant_ref {
178 /* IN parameters. */
179 uint64_t host_addr;
180 uint32_t flags; /* GNTMAP_* */
181 grant_ref_t ref;
182 domid_t dom;
183 /* OUT parameters. */
184 int16_t status; /* GNTST_* */
185 grant_handle_t handle;
186 uint64_t dev_bus_addr;
187};
188
189/*
190 * GNTTABOP_unmap_grant_ref: Destroy one or more grant-reference mappings
191 * tracked by <handle>. If <host_addr> or <dev_bus_addr> is zero, that
192 * field is ignored. If non-zero, they must refer to a device/host mapping
193 * that is tracked by <handle>
194 * NOTES:
195 * 1. The call may fail in an undefined manner if either mapping is not
196 * tracked by <handle>.
197 * 3. After executing a batch of unmaps, it is guaranteed that no stale
198 * mappings will remain in the device or host TLBs.
199 */
200#define GNTTABOP_unmap_grant_ref 1
201struct gnttab_unmap_grant_ref {
202 /* IN parameters. */
203 uint64_t host_addr;
204 uint64_t dev_bus_addr;
205 grant_handle_t handle;
206 /* OUT parameters. */
207 int16_t status; /* GNTST_* */
208};
209
210/*
211 * GNTTABOP_setup_table: Set up a grant table for <dom> comprising at least
212 * <nr_frames> pages. The frame addresses are written to the <frame_list>.
213 * Only <nr_frames> addresses are written, even if the table is larger.
214 * NOTES:
215 * 1. <dom> may be specified as DOMID_SELF.
216 * 2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
217 * 3. Xen may not support more than a single grant-table page per domain.
218 */
219#define GNTTABOP_setup_table 2
220struct gnttab_setup_table {
221 /* IN parameters. */
222 domid_t dom;
223 uint32_t nr_frames;
224 /* OUT parameters. */
225 int16_t status; /* GNTST_* */
226 ulong *frame_list;
227};
228
229/*
230 * GNTTABOP_dump_table: Dump the contents of the grant table to the
231 * xen console. Debugging use only.
232 */
233#define GNTTABOP_dump_table 3
234struct gnttab_dump_table {
235 /* IN parameters. */
236 domid_t dom;
237 /* OUT parameters. */
238 int16_t status; /* GNTST_* */
239};
240
241/*
242 * GNTTABOP_transfer_grant_ref: Transfer <frame> to a foreign domain. The
243 * foreign domain has previously registered its interest in the transfer via
244 * <domid, ref>.
245 *
246 * Note that, even if the transfer fails, the specified page no longer belongs
247 * to the calling domain *unless* the error is GNTST_bad_page.
248 */
249#define GNTTABOP_transfer 4
250struct gnttab_transfer {
251 /* IN parameters. */
252 unsigned long mfn;
253 domid_t domid;
254 grant_ref_t ref;
255 /* OUT parameters. */
256 int16_t status;
257};
258
259
260/*
261 * GNTTABOP_copy: Hypervisor based copy
262 * source and destinations can be eithers MFNs or, for foreign domains,
263 * grant references. the foreign domain has to grant read/write access
264 * in its grant table.
265 *
266 * The flags specify what type source and destinations are (either MFN
267 * or grant reference).
268 *
269 * Note that this can also be used to copy data between two domains
270 * via a third party if the source and destination domains had previously
271 * grant appropriate access to their pages to the third party.
272 *
273 * source_offset specifies an offset in the source frame, dest_offset
274 * the offset in the target frame and len specifies the number of
275 * bytes to be copied.
276 */
277
278#define _GNTCOPY_source_gref (0)
279#define GNTCOPY_source_gref (1<<_GNTCOPY_source_gref)
280#define _GNTCOPY_dest_gref (1)
281#define GNTCOPY_dest_gref (1<<_GNTCOPY_dest_gref)
282
283#define GNTTABOP_copy 5
284struct gnttab_copy {
285 /* IN parameters. */
286 struct {
287 union {
288 grant_ref_t ref;
289 unsigned long gmfn;
290 } u;
291 domid_t domid;
292 uint16_t offset;
293 } source, dest;
294 uint16_t len;
295 uint16_t flags; /* GNTCOPY_* */
296 /* OUT parameters. */
297 int16_t status;
298};
299
300/*
301 * GNTTABOP_query_size: Query the current and maximum sizes of the shared
302 * grant table.
303 * NOTES:
304 * 1. <dom> may be specified as DOMID_SELF.
305 * 2. Only a sufficiently-privileged domain may specify <dom> != DOMID_SELF.
306 */
307#define GNTTABOP_query_size 6
308struct gnttab_query_size {
309 /* IN parameters. */
310 domid_t dom;
311 /* OUT parameters. */
312 uint32_t nr_frames;
313 uint32_t max_nr_frames;
314 int16_t status; /* GNTST_* */
315};
316
317
318/*
319 * Bitfield values for update_pin_status.flags.
320 */
321 /* Map the grant entry for access by I/O devices. */
322#define _GNTMAP_device_map (0)
323#define GNTMAP_device_map (1<<_GNTMAP_device_map)
324 /* Map the grant entry for access by host CPUs. */
325#define _GNTMAP_host_map (1)
326#define GNTMAP_host_map (1<<_GNTMAP_host_map)
327 /* Accesses to the granted frame will be restricted to read-only access. */
328#define _GNTMAP_readonly (2)
329#define GNTMAP_readonly (1<<_GNTMAP_readonly)
330 /*
331 * GNTMAP_host_map subflag:
332 * 0 => The host mapping is usable only by the guest OS.
333 * 1 => The host mapping is usable by guest OS + current application.
334 */
335#define _GNTMAP_application_map (3)
336#define GNTMAP_application_map (1<<_GNTMAP_application_map)
337
338 /*
339 * GNTMAP_contains_pte subflag:
340 * 0 => This map request contains a host virtual address.
341 * 1 => This map request contains the machine addess of the PTE to update.
342 */
343#define _GNTMAP_contains_pte (4)
344#define GNTMAP_contains_pte (1<<_GNTMAP_contains_pte)
345
346/*
347 * Values for error status returns. All errors are -ve.
348 */
349#define GNTST_okay (0) /* Normal return. */
350#define GNTST_general_error (-1) /* General undefined error. */
351#define GNTST_bad_domain (-2) /* Unrecognsed domain id. */
352#define GNTST_bad_gntref (-3) /* Unrecognised or inappropriate gntref. */
353#define GNTST_bad_handle (-4) /* Unrecognised or inappropriate handle. */
354#define GNTST_bad_virt_addr (-5) /* Inappropriate virtual address to map. */
355#define GNTST_bad_dev_addr (-6) /* Inappropriate device address to unmap.*/
356#define GNTST_no_device_space (-7) /* Out of space in I/O MMU. */
357#define GNTST_permission_denied (-8) /* Not enough privilege for operation. */
358#define GNTST_bad_page (-9) /* Specified page was invalid for op. */
359#define GNTST_bad_copy_arg (-10) /* copy arguments cross page boundary */
360
361#define GNTTABOP_error_msgs { \
362 "okay", \
363 "undefined error", \
364 "unrecognised domain id", \
365 "invalid grant reference", \
366 "invalid mapping handle", \
367 "invalid virtual address", \
368 "invalid device address", \
369 "no spare translation slot in the I/O MMU", \
370 "permission denied", \
371 "bad page", \
372 "copy arguments cross page boundary" \
373}
374
375#endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h
new file mode 100644
index 000000000000..c2d1fa4dc1ee
--- /dev/null
+++ b/include/xen/interface/io/blkif.h
@@ -0,0 +1,94 @@
1/******************************************************************************
2 * blkif.h
3 *
4 * Unified block-device I/O interface for Xen guest OSes.
5 *
6 * Copyright (c) 2003-2004, Keir Fraser
7 */
8
9#ifndef __XEN_PUBLIC_IO_BLKIF_H__
10#define __XEN_PUBLIC_IO_BLKIF_H__
11
12#include "ring.h"
13#include "../grant_table.h"
14
15/*
16 * Front->back notifications: When enqueuing a new request, sending a
17 * notification can be made conditional on req_event (i.e., the generic
18 * hold-off mechanism provided by the ring macros). Backends must set
19 * req_event appropriately (e.g., using RING_FINAL_CHECK_FOR_REQUESTS()).
20 *
21 * Back->front notifications: When enqueuing a new response, sending a
22 * notification can be made conditional on rsp_event (i.e., the generic
23 * hold-off mechanism provided by the ring macros). Frontends must set
24 * rsp_event appropriately (e.g., using RING_FINAL_CHECK_FOR_RESPONSES()).
25 */
26
27typedef uint16_t blkif_vdev_t;
28typedef uint64_t blkif_sector_t;
29
30/*
31 * REQUEST CODES.
32 */
33#define BLKIF_OP_READ 0
34#define BLKIF_OP_WRITE 1
35/*
36 * Recognised only if "feature-barrier" is present in backend xenbus info.
37 * The "feature_barrier" node contains a boolean indicating whether barrier
38 * requests are likely to succeed or fail. Either way, a barrier request
39 * may fail at any time with BLKIF_RSP_EOPNOTSUPP if it is unsupported by
40 * the underlying block-device hardware. The boolean simply indicates whether
41 * or not it is worthwhile for the frontend to attempt barrier requests.
42 * If a backend does not recognise BLKIF_OP_WRITE_BARRIER, it should *not*
43 * create the "feature-barrier" node!
44 */
45#define BLKIF_OP_WRITE_BARRIER 2
46
47/*
48 * Maximum scatter/gather segments per request.
49 * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE.
50 * NB. This could be 12 if the ring indexes weren't stored in the same page.
51 */
52#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
53
54struct blkif_request {
55 uint8_t operation; /* BLKIF_OP_??? */
56 uint8_t nr_segments; /* number of segments */
57 blkif_vdev_t handle; /* only for read/write requests */
58 uint64_t id; /* private guest value, echoed in resp */
59 blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
60 struct blkif_request_segment {
61 grant_ref_t gref; /* reference to I/O buffer frame */
62 /* @first_sect: first sector in frame to transfer (inclusive). */
63 /* @last_sect: last sector in frame to transfer (inclusive). */
64 uint8_t first_sect, last_sect;
65 } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
66};
67
68struct blkif_response {
69 uint64_t id; /* copied from request */
70 uint8_t operation; /* copied from request */
71 int16_t status; /* BLKIF_RSP_??? */
72};
73
74/*
75 * STATUS RETURN CODES.
76 */
77 /* Operation not supported (only happens on barrier writes). */
78#define BLKIF_RSP_EOPNOTSUPP -2
79 /* Operation failed for some unspecified reason (-EIO). */
80#define BLKIF_RSP_ERROR -1
81 /* Operation completed successfully. */
82#define BLKIF_RSP_OKAY 0
83
84/*
85 * Generate blkif ring structures and types.
86 */
87
88DEFINE_RING_TYPES(blkif, struct blkif_request, struct blkif_response);
89
90#define VDISK_CDROM 0x1
91#define VDISK_REMOVABLE 0x2
92#define VDISK_READONLY 0x4
93
94#endif /* __XEN_PUBLIC_IO_BLKIF_H__ */
diff --git a/include/xen/interface/io/console.h b/include/xen/interface/io/console.h
new file mode 100644
index 000000000000..e563de70f784
--- /dev/null
+++ b/include/xen/interface/io/console.h
@@ -0,0 +1,23 @@
1/******************************************************************************
2 * console.h
3 *
4 * Console I/O interface for Xen guest OSes.
5 *
6 * Copyright (c) 2005, Keir Fraser
7 */
8
9#ifndef __XEN_PUBLIC_IO_CONSOLE_H__
10#define __XEN_PUBLIC_IO_CONSOLE_H__
11
12typedef uint32_t XENCONS_RING_IDX;
13
14#define MASK_XENCONS_IDX(idx, ring) ((idx) & (sizeof(ring)-1))
15
16struct xencons_interface {
17 char in[1024];
18 char out[2048];
19 XENCONS_RING_IDX in_cons, in_prod;
20 XENCONS_RING_IDX out_cons, out_prod;
21};
22
23#endif /* __XEN_PUBLIC_IO_CONSOLE_H__ */
diff --git a/include/xen/interface/io/netif.h b/include/xen/interface/io/netif.h
new file mode 100644
index 000000000000..518481c95f18
--- /dev/null
+++ b/include/xen/interface/io/netif.h
@@ -0,0 +1,158 @@
1/******************************************************************************
2 * netif.h
3 *
4 * Unified network-device I/O interface for Xen guest OSes.
5 *
6 * Copyright (c) 2003-2004, Keir Fraser
7 */
8
9#ifndef __XEN_PUBLIC_IO_NETIF_H__
10#define __XEN_PUBLIC_IO_NETIF_H__
11
12#include "ring.h"
13#include "../grant_table.h"
14
15/*
16 * Notifications after enqueuing any type of message should be conditional on
17 * the appropriate req_event or rsp_event field in the shared ring.
18 * If the client sends notification for rx requests then it should specify
19 * feature 'feature-rx-notify' via xenbus. Otherwise the backend will assume
20 * that it cannot safely queue packets (as it may not be kicked to send them).
21 */
22
23/*
24 * This is the 'wire' format for packets:
25 * Request 1: netif_tx_request -- NETTXF_* (any flags)
26 * [Request 2: netif_tx_extra] (only if request 1 has NETTXF_extra_info)
27 * [Request 3: netif_tx_extra] (only if request 2 has XEN_NETIF_EXTRA_MORE)
28 * Request 4: netif_tx_request -- NETTXF_more_data
29 * Request 5: netif_tx_request -- NETTXF_more_data
30 * ...
31 * Request N: netif_tx_request -- 0
32 */
33
34/* Protocol checksum field is blank in the packet (hardware offload)? */
35#define _NETTXF_csum_blank (0)
36#define NETTXF_csum_blank (1U<<_NETTXF_csum_blank)
37
38/* Packet data has been validated against protocol checksum. */
39#define _NETTXF_data_validated (1)
40#define NETTXF_data_validated (1U<<_NETTXF_data_validated)
41
42/* Packet continues in the next request descriptor. */
43#define _NETTXF_more_data (2)
44#define NETTXF_more_data (1U<<_NETTXF_more_data)
45
46/* Packet to be followed by extra descriptor(s). */
47#define _NETTXF_extra_info (3)
48#define NETTXF_extra_info (1U<<_NETTXF_extra_info)
49
50struct xen_netif_tx_request {
51 grant_ref_t gref; /* Reference to buffer page */
52 uint16_t offset; /* Offset within buffer page */
53 uint16_t flags; /* NETTXF_* */
54 uint16_t id; /* Echoed in response message. */
55 uint16_t size; /* Packet size in bytes. */
56};
57
58/* Types of netif_extra_info descriptors. */
59#define XEN_NETIF_EXTRA_TYPE_NONE (0) /* Never used - invalid */
60#define XEN_NETIF_EXTRA_TYPE_GSO (1) /* u.gso */
61#define XEN_NETIF_EXTRA_TYPE_MAX (2)
62
63/* netif_extra_info flags. */
64#define _XEN_NETIF_EXTRA_FLAG_MORE (0)
65#define XEN_NETIF_EXTRA_FLAG_MORE (1U<<_XEN_NETIF_EXTRA_FLAG_MORE)
66
67/* GSO types - only TCPv4 currently supported. */
68#define XEN_NETIF_GSO_TYPE_TCPV4 (1)
69
70/*
71 * This structure needs to fit within both netif_tx_request and
72 * netif_rx_response for compatibility.
73 */
74struct xen_netif_extra_info {
75 uint8_t type; /* XEN_NETIF_EXTRA_TYPE_* */
76 uint8_t flags; /* XEN_NETIF_EXTRA_FLAG_* */
77
78 union {
79 struct {
80 /*
81 * Maximum payload size of each segment. For
82 * example, for TCP this is just the path MSS.
83 */
84 uint16_t size;
85
86 /*
87 * GSO type. This determines the protocol of
88 * the packet and any extra features required
89 * to segment the packet properly.
90 */
91 uint8_t type; /* XEN_NETIF_GSO_TYPE_* */
92
93 /* Future expansion. */
94 uint8_t pad;
95
96 /*
97 * GSO features. This specifies any extra GSO
98 * features required to process this packet,
99 * such as ECN support for TCPv4.
100 */
101 uint16_t features; /* XEN_NETIF_GSO_FEAT_* */
102 } gso;
103
104 uint16_t pad[3];
105 } u;
106};
107
108struct xen_netif_tx_response {
109 uint16_t id;
110 int16_t status; /* NETIF_RSP_* */
111};
112
113struct xen_netif_rx_request {
114 uint16_t id; /* Echoed in response message. */
115 grant_ref_t gref; /* Reference to incoming granted frame */
116};
117
118/* Packet data has been validated against protocol checksum. */
119#define _NETRXF_data_validated (0)
120#define NETRXF_data_validated (1U<<_NETRXF_data_validated)
121
122/* Protocol checksum field is blank in the packet (hardware offload)? */
123#define _NETRXF_csum_blank (1)
124#define NETRXF_csum_blank (1U<<_NETRXF_csum_blank)
125
126/* Packet continues in the next request descriptor. */
127#define _NETRXF_more_data (2)
128#define NETRXF_more_data (1U<<_NETRXF_more_data)
129
130/* Packet to be followed by extra descriptor(s). */
131#define _NETRXF_extra_info (3)
132#define NETRXF_extra_info (1U<<_NETRXF_extra_info)
133
134struct xen_netif_rx_response {
135 uint16_t id;
136 uint16_t offset; /* Offset in page of start of received packet */
137 uint16_t flags; /* NETRXF_* */
138 int16_t status; /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
139};
140
141/*
142 * Generate netif ring structures and types.
143 */
144
145DEFINE_RING_TYPES(xen_netif_tx,
146 struct xen_netif_tx_request,
147 struct xen_netif_tx_response);
148DEFINE_RING_TYPES(xen_netif_rx,
149 struct xen_netif_rx_request,
150 struct xen_netif_rx_response);
151
152#define NETIF_RSP_DROPPED -2
153#define NETIF_RSP_ERROR -1
154#define NETIF_RSP_OKAY 0
155/* No response: used for auxiliary requests (e.g., netif_tx_extra). */
156#define NETIF_RSP_NULL 1
157
158#endif
diff --git a/include/xen/interface/io/ring.h b/include/xen/interface/io/ring.h
new file mode 100644
index 000000000000..e8cbf431c8cc
--- /dev/null
+++ b/include/xen/interface/io/ring.h
@@ -0,0 +1,260 @@
1/******************************************************************************
2 * ring.h
3 *
4 * Shared producer-consumer ring macros.
5 *
6 * Tim Deegan and Andrew Warfield November 2004.
7 */
8
9#ifndef __XEN_PUBLIC_IO_RING_H__
10#define __XEN_PUBLIC_IO_RING_H__
11
12typedef unsigned int RING_IDX;
13
14/* Round a 32-bit unsigned constant down to the nearest power of two. */
15#define __RD2(_x) (((_x) & 0x00000002) ? 0x2 : ((_x) & 0x1))
16#define __RD4(_x) (((_x) & 0x0000000c) ? __RD2((_x)>>2)<<2 : __RD2(_x))
17#define __RD8(_x) (((_x) & 0x000000f0) ? __RD4((_x)>>4)<<4 : __RD4(_x))
18#define __RD16(_x) (((_x) & 0x0000ff00) ? __RD8((_x)>>8)<<8 : __RD8(_x))
19#define __RD32(_x) (((_x) & 0xffff0000) ? __RD16((_x)>>16)<<16 : __RD16(_x))
20
21/*
22 * Calculate size of a shared ring, given the total available space for the
23 * ring and indexes (_sz), and the name tag of the request/response structure.
24 * A ring contains as many entries as will fit, rounded down to the nearest
25 * power of two (so we can mask with (size-1) to loop around).
26 */
27#define __RING_SIZE(_s, _sz) \
28 (__RD32(((_sz) - (long)&(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0])))
29
30/*
31 * Macros to make the correct C datatypes for a new kind of ring.
32 *
33 * To make a new ring datatype, you need to have two message structures,
34 * let's say struct request, and struct response already defined.
35 *
36 * In a header where you want the ring datatype declared, you then do:
37 *
38 * DEFINE_RING_TYPES(mytag, struct request, struct response);
39 *
40 * These expand out to give you a set of types, as you can see below.
41 * The most important of these are:
42 *
43 * struct mytag_sring - The shared ring.
44 * struct mytag_front_ring - The 'front' half of the ring.
45 * struct mytag_back_ring - The 'back' half of the ring.
46 *
47 * To initialize a ring in your code you need to know the location and size
48 * of the shared memory area (PAGE_SIZE, for instance). To initialise
49 * the front half:
50 *
51 * struct mytag_front_ring front_ring;
52 * SHARED_RING_INIT((struct mytag_sring *)shared_page);
53 * FRONT_RING_INIT(&front_ring, (struct mytag_sring *)shared_page,
54 * PAGE_SIZE);
55 *
56 * Initializing the back follows similarly (note that only the front
57 * initializes the shared ring):
58 *
59 * struct mytag_back_ring back_ring;
60 * BACK_RING_INIT(&back_ring, (struct mytag_sring *)shared_page,
61 * PAGE_SIZE);
62 */
63
64#define DEFINE_RING_TYPES(__name, __req_t, __rsp_t) \
65 \
66/* Shared ring entry */ \
67union __name##_sring_entry { \
68 __req_t req; \
69 __rsp_t rsp; \
70}; \
71 \
72/* Shared ring page */ \
73struct __name##_sring { \
74 RING_IDX req_prod, req_event; \
75 RING_IDX rsp_prod, rsp_event; \
76 uint8_t pad[48]; \
77 union __name##_sring_entry ring[1]; /* variable-length */ \
78}; \
79 \
80/* "Front" end's private variables */ \
81struct __name##_front_ring { \
82 RING_IDX req_prod_pvt; \
83 RING_IDX rsp_cons; \
84 unsigned int nr_ents; \
85 struct __name##_sring *sring; \
86}; \
87 \
88/* "Back" end's private variables */ \
89struct __name##_back_ring { \
90 RING_IDX rsp_prod_pvt; \
91 RING_IDX req_cons; \
92 unsigned int nr_ents; \
93 struct __name##_sring *sring; \
94};
95
96/*
97 * Macros for manipulating rings.
98 *
99 * FRONT_RING_whatever works on the "front end" of a ring: here
100 * requests are pushed on to the ring and responses taken off it.
101 *
102 * BACK_RING_whatever works on the "back end" of a ring: here
103 * requests are taken off the ring and responses put on.
104 *
105 * N.B. these macros do NO INTERLOCKS OR FLOW CONTROL.
106 * This is OK in 1-for-1 request-response situations where the
107 * requestor (front end) never has more than RING_SIZE()-1
108 * outstanding requests.
109 */
110
111/* Initialising empty rings */
112#define SHARED_RING_INIT(_s) do { \
113 (_s)->req_prod = (_s)->rsp_prod = 0; \
114 (_s)->req_event = (_s)->rsp_event = 1; \
115 memset((_s)->pad, 0, sizeof((_s)->pad)); \
116} while(0)
117
118#define FRONT_RING_INIT(_r, _s, __size) do { \
119 (_r)->req_prod_pvt = 0; \
120 (_r)->rsp_cons = 0; \
121 (_r)->nr_ents = __RING_SIZE(_s, __size); \
122 (_r)->sring = (_s); \
123} while (0)
124
125#define BACK_RING_INIT(_r, _s, __size) do { \
126 (_r)->rsp_prod_pvt = 0; \
127 (_r)->req_cons = 0; \
128 (_r)->nr_ents = __RING_SIZE(_s, __size); \
129 (_r)->sring = (_s); \
130} while (0)
131
132/* Initialize to existing shared indexes -- for recovery */
133#define FRONT_RING_ATTACH(_r, _s, __size) do { \
134 (_r)->sring = (_s); \
135 (_r)->req_prod_pvt = (_s)->req_prod; \
136 (_r)->rsp_cons = (_s)->rsp_prod; \
137 (_r)->nr_ents = __RING_SIZE(_s, __size); \
138} while (0)
139
140#define BACK_RING_ATTACH(_r, _s, __size) do { \
141 (_r)->sring = (_s); \
142 (_r)->rsp_prod_pvt = (_s)->rsp_prod; \
143 (_r)->req_cons = (_s)->req_prod; \
144 (_r)->nr_ents = __RING_SIZE(_s, __size); \
145} while (0)
146
147/* How big is this ring? */
148#define RING_SIZE(_r) \
149 ((_r)->nr_ents)
150
151/* Number of free requests (for use on front side only). */
152#define RING_FREE_REQUESTS(_r) \
153 (RING_SIZE(_r) - ((_r)->req_prod_pvt - (_r)->rsp_cons))
154
155/* Test if there is an empty slot available on the front ring.
156 * (This is only meaningful from the front. )
157 */
158#define RING_FULL(_r) \
159 (RING_FREE_REQUESTS(_r) == 0)
160
161/* Test if there are outstanding messages to be processed on a ring. */
162#define RING_HAS_UNCONSUMED_RESPONSES(_r) \
163 ((_r)->sring->rsp_prod - (_r)->rsp_cons)
164
165#define RING_HAS_UNCONSUMED_REQUESTS(_r) \
166 ({ \
167 unsigned int req = (_r)->sring->req_prod - (_r)->req_cons; \
168 unsigned int rsp = RING_SIZE(_r) - \
169 ((_r)->req_cons - (_r)->rsp_prod_pvt); \
170 req < rsp ? req : rsp; \
171 })
172
173/* Direct access to individual ring elements, by index. */
174#define RING_GET_REQUEST(_r, _idx) \
175 (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].req))
176
177#define RING_GET_RESPONSE(_r, _idx) \
178 (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].rsp))
179
180/* Loop termination condition: Would the specified index overflow the ring? */
181#define RING_REQUEST_CONS_OVERFLOW(_r, _cons) \
182 (((_cons) - (_r)->rsp_prod_pvt) >= RING_SIZE(_r))
183
184#define RING_PUSH_REQUESTS(_r) do { \
185 wmb(); /* back sees requests /before/ updated producer index */ \
186 (_r)->sring->req_prod = (_r)->req_prod_pvt; \
187} while (0)
188
189#define RING_PUSH_RESPONSES(_r) do { \
190 wmb(); /* front sees responses /before/ updated producer index */ \
191 (_r)->sring->rsp_prod = (_r)->rsp_prod_pvt; \
192} while (0)
193
194/*
195 * Notification hold-off (req_event and rsp_event):
196 *
197 * When queueing requests or responses on a shared ring, it may not always be
198 * necessary to notify the remote end. For example, if requests are in flight
199 * in a backend, the front may be able to queue further requests without
200 * notifying the back (if the back checks for new requests when it queues
201 * responses).
202 *
203 * When enqueuing requests or responses:
204 *
205 * Use RING_PUSH_{REQUESTS,RESPONSES}_AND_CHECK_NOTIFY(). The second argument
206 * is a boolean return value. True indicates that the receiver requires an
207 * asynchronous notification.
208 *
209 * After dequeuing requests or responses (before sleeping the connection):
210 *
211 * Use RING_FINAL_CHECK_FOR_REQUESTS() or RING_FINAL_CHECK_FOR_RESPONSES().
212 * The second argument is a boolean return value. True indicates that there
213 * are pending messages on the ring (i.e., the connection should not be put
214 * to sleep).
215 *
216 * These macros will set the req_event/rsp_event field to trigger a
217 * notification on the very next message that is enqueued. If you want to
218 * create batches of work (i.e., only receive a notification after several
219 * messages have been enqueued) then you will need to create a customised
220 * version of the FINAL_CHECK macro in your own code, which sets the event
221 * field appropriately.
222 */
223
224#define RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(_r, _notify) do { \
225 RING_IDX __old = (_r)->sring->req_prod; \
226 RING_IDX __new = (_r)->req_prod_pvt; \
227 wmb(); /* back sees requests /before/ updated producer index */ \
228 (_r)->sring->req_prod = __new; \
229 mb(); /* back sees new requests /before/ we check req_event */ \
230 (_notify) = ((RING_IDX)(__new - (_r)->sring->req_event) < \
231 (RING_IDX)(__new - __old)); \
232} while (0)
233
234#define RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(_r, _notify) do { \
235 RING_IDX __old = (_r)->sring->rsp_prod; \
236 RING_IDX __new = (_r)->rsp_prod_pvt; \
237 wmb(); /* front sees responses /before/ updated producer index */ \
238 (_r)->sring->rsp_prod = __new; \
239 mb(); /* front sees new responses /before/ we check rsp_event */ \
240 (_notify) = ((RING_IDX)(__new - (_r)->sring->rsp_event) < \
241 (RING_IDX)(__new - __old)); \
242} while (0)
243
244#define RING_FINAL_CHECK_FOR_REQUESTS(_r, _work_to_do) do { \
245 (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \
246 if (_work_to_do) break; \
247 (_r)->sring->req_event = (_r)->req_cons + 1; \
248 mb(); \
249 (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \
250} while (0)
251
252#define RING_FINAL_CHECK_FOR_RESPONSES(_r, _work_to_do) do { \
253 (_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \
254 if (_work_to_do) break; \
255 (_r)->sring->rsp_event = (_r)->rsp_cons + 1; \
256 mb(); \
257 (_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \
258} while (0)
259
260#endif /* __XEN_PUBLIC_IO_RING_H__ */
diff --git a/include/xen/interface/io/xenbus.h b/include/xen/interface/io/xenbus.h
new file mode 100644
index 000000000000..46508c7fa399
--- /dev/null
+++ b/include/xen/interface/io/xenbus.h
@@ -0,0 +1,44 @@
1/*****************************************************************************
2 * xenbus.h
3 *
4 * Xenbus protocol details.
5 *
6 * Copyright (C) 2005 XenSource Ltd.
7 */
8
9#ifndef _XEN_PUBLIC_IO_XENBUS_H
10#define _XEN_PUBLIC_IO_XENBUS_H
11
12/* The state of either end of the Xenbus, i.e. the current communication
13 status of initialisation across the bus. States here imply nothing about
14 the state of the connection between the driver and the kernel's device
15 layers. */
16enum xenbus_state
17{
18 XenbusStateUnknown = 0,
19 XenbusStateInitialising = 1,
20 XenbusStateInitWait = 2, /* Finished early
21 initialisation, but waiting
22 for information from the peer
23 or hotplug scripts. */
24 XenbusStateInitialised = 3, /* Initialised and waiting for a
25 connection from the peer. */
26 XenbusStateConnected = 4,
27 XenbusStateClosing = 5, /* The device is being closed
28 due to an error or an unplug
29 event. */
30 XenbusStateClosed = 6
31
32};
33
34#endif /* _XEN_PUBLIC_IO_XENBUS_H */
35
36/*
37 * Local variables:
38 * c-file-style: "linux"
39 * indent-tabs-mode: t
40 * c-indent-level: 8
41 * c-basic-offset: 8
42 * tab-width: 8
43 * End:
44 */
diff --git a/include/xen/interface/io/xs_wire.h b/include/xen/interface/io/xs_wire.h
new file mode 100644
index 000000000000..99fcffb372d1
--- /dev/null
+++ b/include/xen/interface/io/xs_wire.h
@@ -0,0 +1,87 @@
1/*
2 * Details of the "wire" protocol between Xen Store Daemon and client
3 * library or guest kernel.
4 * Copyright (C) 2005 Rusty Russell IBM Corporation
5 */
6
7#ifndef _XS_WIRE_H
8#define _XS_WIRE_H
9
10enum xsd_sockmsg_type
11{
12 XS_DEBUG,
13 XS_DIRECTORY,
14 XS_READ,
15 XS_GET_PERMS,
16 XS_WATCH,
17 XS_UNWATCH,
18 XS_TRANSACTION_START,
19 XS_TRANSACTION_END,
20 XS_INTRODUCE,
21 XS_RELEASE,
22 XS_GET_DOMAIN_PATH,
23 XS_WRITE,
24 XS_MKDIR,
25 XS_RM,
26 XS_SET_PERMS,
27 XS_WATCH_EVENT,
28 XS_ERROR,
29 XS_IS_DOMAIN_INTRODUCED
30};
31
32#define XS_WRITE_NONE "NONE"
33#define XS_WRITE_CREATE "CREATE"
34#define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
35
36/* We hand errors as strings, for portability. */
37struct xsd_errors
38{
39 int errnum;
40 const char *errstring;
41};
42#define XSD_ERROR(x) { x, #x }
43static struct xsd_errors xsd_errors[] __attribute__((unused)) = {
44 XSD_ERROR(EINVAL),
45 XSD_ERROR(EACCES),
46 XSD_ERROR(EEXIST),
47 XSD_ERROR(EISDIR),
48 XSD_ERROR(ENOENT),
49 XSD_ERROR(ENOMEM),
50 XSD_ERROR(ENOSPC),
51 XSD_ERROR(EIO),
52 XSD_ERROR(ENOTEMPTY),
53 XSD_ERROR(ENOSYS),
54 XSD_ERROR(EROFS),
55 XSD_ERROR(EBUSY),
56 XSD_ERROR(EAGAIN),
57 XSD_ERROR(EISCONN)
58};
59
60struct xsd_sockmsg
61{
62 uint32_t type; /* XS_??? */
63 uint32_t req_id;/* Request identifier, echoed in daemon's response. */
64 uint32_t tx_id; /* Transaction id (0 if not related to a transaction). */
65 uint32_t len; /* Length of data following this. */
66
67 /* Generally followed by nul-terminated string(s). */
68};
69
70enum xs_watch_type
71{
72 XS_WATCH_PATH = 0,
73 XS_WATCH_TOKEN
74};
75
76/* Inter-domain shared memory communications. */
77#define XENSTORE_RING_SIZE 1024
78typedef uint32_t XENSTORE_RING_IDX;
79#define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
80struct xenstore_domain_interface {
81 char req[XENSTORE_RING_SIZE]; /* Requests to xenstore daemon. */
82 char rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
83 XENSTORE_RING_IDX req_cons, req_prod;
84 XENSTORE_RING_IDX rsp_cons, rsp_prod;
85};
86
87#endif /* _XS_WIRE_H */
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h
new file mode 100644
index 000000000000..af36ead16817
--- /dev/null
+++ b/include/xen/interface/memory.h
@@ -0,0 +1,145 @@
1/******************************************************************************
2 * memory.h
3 *
4 * Memory reservation and information.
5 *
6 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
7 */
8
9#ifndef __XEN_PUBLIC_MEMORY_H__
10#define __XEN_PUBLIC_MEMORY_H__
11
12/*
13 * Increase or decrease the specified domain's memory reservation. Returns a
14 * -ve errcode on failure, or the # extents successfully allocated or freed.
15 * arg == addr of struct xen_memory_reservation.
16 */
17#define XENMEM_increase_reservation 0
18#define XENMEM_decrease_reservation 1
19#define XENMEM_populate_physmap 6
20struct xen_memory_reservation {
21
22 /*
23 * XENMEM_increase_reservation:
24 * OUT: MFN (*not* GMFN) bases of extents that were allocated
25 * XENMEM_decrease_reservation:
26 * IN: GMFN bases of extents to free
27 * XENMEM_populate_physmap:
28 * IN: GPFN bases of extents to populate with memory
29 * OUT: GMFN bases of extents that were allocated
30 * (NB. This command also updates the mach_to_phys translation table)
31 */
32 GUEST_HANDLE(ulong) extent_start;
33
34 /* Number of extents, and size/alignment of each (2^extent_order pages). */
35 unsigned long nr_extents;
36 unsigned int extent_order;
37
38 /*
39 * Maximum # bits addressable by the user of the allocated region (e.g.,
40 * I/O devices often have a 32-bit limitation even in 64-bit systems). If
41 * zero then the user has no addressing restriction.
42 * This field is not used by XENMEM_decrease_reservation.
43 */
44 unsigned int address_bits;
45
46 /*
47 * Domain whose reservation is being changed.
48 * Unprivileged domains can specify only DOMID_SELF.
49 */
50 domid_t domid;
51
52};
53DEFINE_GUEST_HANDLE_STRUCT(xen_memory_reservation);
54
55/*
56 * Returns the maximum machine frame number of mapped RAM in this system.
57 * This command always succeeds (it never returns an error code).
58 * arg == NULL.
59 */
60#define XENMEM_maximum_ram_page 2
61
62/*
63 * Returns the current or maximum memory reservation, in pages, of the
64 * specified domain (may be DOMID_SELF). Returns -ve errcode on failure.
65 * arg == addr of domid_t.
66 */
67#define XENMEM_current_reservation 3
68#define XENMEM_maximum_reservation 4
69
70/*
71 * Returns a list of MFN bases of 2MB extents comprising the machine_to_phys
72 * mapping table. Architectures which do not have a m2p table do not implement
73 * this command.
74 * arg == addr of xen_machphys_mfn_list_t.
75 */
76#define XENMEM_machphys_mfn_list 5
77struct xen_machphys_mfn_list {
78 /*
79 * Size of the 'extent_start' array. Fewer entries will be filled if the
80 * machphys table is smaller than max_extents * 2MB.
81 */
82 unsigned int max_extents;
83
84 /*
85 * Pointer to buffer to fill with list of extent starts. If there are
86 * any large discontiguities in the machine address space, 2MB gaps in
87 * the machphys table will be represented by an MFN base of zero.
88 */
89 GUEST_HANDLE(ulong) extent_start;
90
91 /*
92 * Number of extents written to the above array. This will be smaller
93 * than 'max_extents' if the machphys table is smaller than max_e * 2MB.
94 */
95 unsigned int nr_extents;
96};
97DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mfn_list);
98
99/*
100 * Sets the GPFN at which a particular page appears in the specified guest's
101 * pseudophysical address space.
102 * arg == addr of xen_add_to_physmap_t.
103 */
104#define XENMEM_add_to_physmap 7
105struct xen_add_to_physmap {
106 /* Which domain to change the mapping for. */
107 domid_t domid;
108
109 /* Source mapping space. */
110#define XENMAPSPACE_shared_info 0 /* shared info page */
111#define XENMAPSPACE_grant_table 1 /* grant table page */
112 unsigned int space;
113
114 /* Index into source mapping space. */
115 unsigned long idx;
116
117 /* GPFN where the source mapping page should appear. */
118 unsigned long gpfn;
119};
120DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap);
121
122/*
123 * Translates a list of domain-specific GPFNs into MFNs. Returns a -ve error
124 * code on failure. This call only works for auto-translated guests.
125 */
126#define XENMEM_translate_gpfn_list 8
127struct xen_translate_gpfn_list {
128 /* Which domain to translate for? */
129 domid_t domid;
130
131 /* Length of list. */
132 unsigned long nr_gpfns;
133
134 /* List of GPFNs to translate. */
135 GUEST_HANDLE(ulong) gpfn_list;
136
137 /*
138 * Output list to contain MFN translations. May be the same as the input
139 * list (in which case each input GPFN is overwritten with the output MFN).
140 */
141 GUEST_HANDLE(ulong) mfn_list;
142};
143DEFINE_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list);
144
145#endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h
new file mode 100644
index 000000000000..cd6939147cb6
--- /dev/null
+++ b/include/xen/interface/physdev.h
@@ -0,0 +1,145 @@
1/*
2 * Permission is hereby granted, free of charge, to any person obtaining a copy
3 * of this software and associated documentation files (the "Software"), to
4 * deal in the Software without restriction, including without limitation the
5 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6 * sell copies of the Software, and to permit persons to whom the Software is
7 * furnished to do so, subject to the following conditions:
8 *
9 * The above copyright notice and this permission notice shall be included in
10 * all copies or substantial portions of the Software.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18 * DEALINGS IN THE SOFTWARE.
19 */
20
21#ifndef __XEN_PUBLIC_PHYSDEV_H__
22#define __XEN_PUBLIC_PHYSDEV_H__
23
24/*
25 * Prototype for this hypercall is:
26 * int physdev_op(int cmd, void *args)
27 * @cmd == PHYSDEVOP_??? (physdev operation).
28 * @args == Operation-specific extra arguments (NULL if none).
29 */
30
31/*
32 * Notify end-of-interrupt (EOI) for the specified IRQ.
33 * @arg == pointer to physdev_eoi structure.
34 */
35#define PHYSDEVOP_eoi 12
36struct physdev_eoi {
37 /* IN */
38 uint32_t irq;
39};
40
41/*
42 * Query the status of an IRQ line.
43 * @arg == pointer to physdev_irq_status_query structure.
44 */
45#define PHYSDEVOP_irq_status_query 5
46struct physdev_irq_status_query {
47 /* IN */
48 uint32_t irq;
49 /* OUT */
50 uint32_t flags; /* XENIRQSTAT_* */
51};
52
53/* Need to call PHYSDEVOP_eoi when the IRQ has been serviced? */
54#define _XENIRQSTAT_needs_eoi (0)
55#define XENIRQSTAT_needs_eoi (1U<<_XENIRQSTAT_needs_eoi)
56
57/* IRQ shared by multiple guests? */
58#define _XENIRQSTAT_shared (1)
59#define XENIRQSTAT_shared (1U<<_XENIRQSTAT_shared)
60
61/*
62 * Set the current VCPU's I/O privilege level.
63 * @arg == pointer to physdev_set_iopl structure.
64 */
65#define PHYSDEVOP_set_iopl 6
66struct physdev_set_iopl {
67 /* IN */
68 uint32_t iopl;
69};
70
71/*
72 * Set the current VCPU's I/O-port permissions bitmap.
73 * @arg == pointer to physdev_set_iobitmap structure.
74 */
75#define PHYSDEVOP_set_iobitmap 7
76struct physdev_set_iobitmap {
77 /* IN */
78 uint8_t * bitmap;
79 uint32_t nr_ports;
80};
81
82/*
83 * Read or write an IO-APIC register.
84 * @arg == pointer to physdev_apic structure.
85 */
86#define PHYSDEVOP_apic_read 8
87#define PHYSDEVOP_apic_write 9
88struct physdev_apic {
89 /* IN */
90 unsigned long apic_physbase;
91 uint32_t reg;
92 /* IN or OUT */
93 uint32_t value;
94};
95
96/*
97 * Allocate or free a physical upcall vector for the specified IRQ line.
98 * @arg == pointer to physdev_irq structure.
99 */
100#define PHYSDEVOP_alloc_irq_vector 10
101#define PHYSDEVOP_free_irq_vector 11
102struct physdev_irq {
103 /* IN */
104 uint32_t irq;
105 /* IN or OUT */
106 uint32_t vector;
107};
108
109/*
110 * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op()
111 * hypercall since 0x00030202.
112 */
113struct physdev_op {
114 uint32_t cmd;
115 union {
116 struct physdev_irq_status_query irq_status_query;
117 struct physdev_set_iopl set_iopl;
118 struct physdev_set_iobitmap set_iobitmap;
119 struct physdev_apic apic_op;
120 struct physdev_irq irq_op;
121 } u;
122};
123
124/*
125 * Notify that some PIRQ-bound event channels have been unmasked.
126 * ** This command is obsolete since interface version 0x00030202 and is **
127 * ** unsupported by newer versions of Xen. **
128 */
129#define PHYSDEVOP_IRQ_UNMASK_NOTIFY 4
130
131/*
132 * These all-capitals physdev operation names are superceded by the new names
133 * (defined above) since interface version 0x00030202.
134 */
135#define PHYSDEVOP_IRQ_STATUS_QUERY PHYSDEVOP_irq_status_query
136#define PHYSDEVOP_SET_IOPL PHYSDEVOP_set_iopl
137#define PHYSDEVOP_SET_IOBITMAP PHYSDEVOP_set_iobitmap
138#define PHYSDEVOP_APIC_READ PHYSDEVOP_apic_read
139#define PHYSDEVOP_APIC_WRITE PHYSDEVOP_apic_write
140#define PHYSDEVOP_ASSIGN_VECTOR PHYSDEVOP_alloc_irq_vector
141#define PHYSDEVOP_FREE_VECTOR PHYSDEVOP_free_irq_vector
142#define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi
143#define PHYSDEVOP_IRQ_SHARED XENIRQSTAT_shared
144
145#endif /* __XEN_PUBLIC_PHYSDEV_H__ */
diff --git a/include/xen/interface/sched.h b/include/xen/interface/sched.h
new file mode 100644
index 000000000000..5fec575a800a
--- /dev/null
+++ b/include/xen/interface/sched.h
@@ -0,0 +1,77 @@
1/******************************************************************************
2 * sched.h
3 *
4 * Scheduler state interactions
5 *
6 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
7 */
8
9#ifndef __XEN_PUBLIC_SCHED_H__
10#define __XEN_PUBLIC_SCHED_H__
11
12#include "event_channel.h"
13
14/*
15 * The prototype for this hypercall is:
16 * long sched_op_new(int cmd, void *arg)
17 * @cmd == SCHEDOP_??? (scheduler operation).
18 * @arg == Operation-specific extra argument(s), as described below.
19 *
20 * **NOTE**:
21 * Versions of Xen prior to 3.0.2 provide only the following legacy version
22 * of this hypercall, supporting only the commands yield, block and shutdown:
23 * long sched_op(int cmd, unsigned long arg)
24 * @cmd == SCHEDOP_??? (scheduler operation).
25 * @arg == 0 (SCHEDOP_yield and SCHEDOP_block)
26 * == SHUTDOWN_* code (SCHEDOP_shutdown)
27 */
28
29/*
30 * Voluntarily yield the CPU.
31 * @arg == NULL.
32 */
33#define SCHEDOP_yield 0
34
35/*
36 * Block execution of this VCPU until an event is received for processing.
37 * If called with event upcalls masked, this operation will atomically
38 * reenable event delivery and check for pending events before blocking the
39 * VCPU. This avoids a "wakeup waiting" race.
40 * @arg == NULL.
41 */
42#define SCHEDOP_block 1
43
44/*
45 * Halt execution of this domain (all VCPUs) and notify the system controller.
46 * @arg == pointer to sched_shutdown structure.
47 */
48#define SCHEDOP_shutdown 2
49struct sched_shutdown {
50 unsigned int reason; /* SHUTDOWN_* */
51};
52DEFINE_GUEST_HANDLE_STRUCT(sched_shutdown);
53
54/*
55 * Poll a set of event-channel ports. Return when one or more are pending. An
56 * optional timeout may be specified.
57 * @arg == pointer to sched_poll structure.
58 */
59#define SCHEDOP_poll 3
60struct sched_poll {
61 GUEST_HANDLE(evtchn_port_t) ports;
62 unsigned int nr_ports;
63 uint64_t timeout;
64};
65DEFINE_GUEST_HANDLE_STRUCT(sched_poll);
66
67/*
68 * Reason codes for SCHEDOP_shutdown. These may be interpreted by control
69 * software to determine the appropriate action. For the most part, Xen does
70 * not care about the shutdown code.
71 */
72#define SHUTDOWN_poweroff 0 /* Domain exited normally. Clean up and kill. */
73#define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */
74#define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */
75#define SHUTDOWN_crash 3 /* Tell controller we've crashed. */
76
77#endif /* __XEN_PUBLIC_SCHED_H__ */
diff --git a/include/xen/interface/vcpu.h b/include/xen/interface/vcpu.h
new file mode 100644
index 000000000000..ff61ea365997
--- /dev/null
+++ b/include/xen/interface/vcpu.h
@@ -0,0 +1,167 @@
1/******************************************************************************
2 * vcpu.h
3 *
4 * VCPU initialisation, query, and hotplug.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
25 */
26
27#ifndef __XEN_PUBLIC_VCPU_H__
28#define __XEN_PUBLIC_VCPU_H__
29
30/*
31 * Prototype for this hypercall is:
32 * int vcpu_op(int cmd, int vcpuid, void *extra_args)
33 * @cmd == VCPUOP_??? (VCPU operation).
34 * @vcpuid == VCPU to operate on.
35 * @extra_args == Operation-specific extra arguments (NULL if none).
36 */
37
38/*
39 * Initialise a VCPU. Each VCPU can be initialised only once. A
40 * newly-initialised VCPU will not run until it is brought up by VCPUOP_up.
41 *
42 * @extra_arg == pointer to vcpu_guest_context structure containing initial
43 * state for the VCPU.
44 */
45#define VCPUOP_initialise 0
46
47/*
48 * Bring up a VCPU. This makes the VCPU runnable. This operation will fail
49 * if the VCPU has not been initialised (VCPUOP_initialise).
50 */
51#define VCPUOP_up 1
52
53/*
54 * Bring down a VCPU (i.e., make it non-runnable).
55 * There are a few caveats that callers should observe:
56 * 1. This operation may return, and VCPU_is_up may return false, before the
57 * VCPU stops running (i.e., the command is asynchronous). It is a good
58 * idea to ensure that the VCPU has entered a non-critical loop before
59 * bringing it down. Alternatively, this operation is guaranteed
60 * synchronous if invoked by the VCPU itself.
61 * 2. After a VCPU is initialised, there is currently no way to drop all its
62 * references to domain memory. Even a VCPU that is down still holds
63 * memory references via its pagetable base pointer and GDT. It is good
64 * practise to move a VCPU onto an 'idle' or default page table, LDT and
65 * GDT before bringing it down.
66 */
67#define VCPUOP_down 2
68
69/* Returns 1 if the given VCPU is up. */
70#define VCPUOP_is_up 3
71
72/*
73 * Return information about the state and running time of a VCPU.
74 * @extra_arg == pointer to vcpu_runstate_info structure.
75 */
76#define VCPUOP_get_runstate_info 4
77struct vcpu_runstate_info {
78 /* VCPU's current state (RUNSTATE_*). */
79 int state;
80 /* When was current state entered (system time, ns)? */
81 uint64_t state_entry_time;
82 /*
83 * Time spent in each RUNSTATE_* (ns). The sum of these times is
84 * guaranteed not to drift from system time.
85 */
86 uint64_t time[4];
87};
88
89/* VCPU is currently running on a physical CPU. */
90#define RUNSTATE_running 0
91
92/* VCPU is runnable, but not currently scheduled on any physical CPU. */
93#define RUNSTATE_runnable 1
94
95/* VCPU is blocked (a.k.a. idle). It is therefore not runnable. */
96#define RUNSTATE_blocked 2
97
98/*
99 * VCPU is not runnable, but it is not blocked.
100 * This is a 'catch all' state for things like hotplug and pauses by the
101 * system administrator (or for critical sections in the hypervisor).
102 * RUNSTATE_blocked dominates this state (it is the preferred state).
103 */
104#define RUNSTATE_offline 3
105
106/*
107 * Register a shared memory area from which the guest may obtain its own
108 * runstate information without needing to execute a hypercall.
109 * Notes:
110 * 1. The registered address may be virtual or physical, depending on the
111 * platform. The virtual address should be registered on x86 systems.
112 * 2. Only one shared area may be registered per VCPU. The shared area is
113 * updated by the hypervisor each time the VCPU is scheduled. Thus
114 * runstate.state will always be RUNSTATE_running and
115 * runstate.state_entry_time will indicate the system time at which the
116 * VCPU was last scheduled to run.
117 * @extra_arg == pointer to vcpu_register_runstate_memory_area structure.
118 */
119#define VCPUOP_register_runstate_memory_area 5
120struct vcpu_register_runstate_memory_area {
121 union {
122 struct vcpu_runstate_info *v;
123 uint64_t p;
124 } addr;
125};
126
127/*
128 * Set or stop a VCPU's periodic timer. Every VCPU has one periodic timer
129 * which can be set via these commands. Periods smaller than one millisecond
130 * may not be supported.
131 */
132#define VCPUOP_set_periodic_timer 6 /* arg == vcpu_set_periodic_timer_t */
133#define VCPUOP_stop_periodic_timer 7 /* arg == NULL */
134struct vcpu_set_periodic_timer {
135 uint64_t period_ns;
136};
137
138/*
139 * Set or stop a VCPU's single-shot timer. Every VCPU has one single-shot
140 * timer which can be set via these commands.
141 */
142#define VCPUOP_set_singleshot_timer 8 /* arg == vcpu_set_singleshot_timer_t */
143#define VCPUOP_stop_singleshot_timer 9 /* arg == NULL */
144struct vcpu_set_singleshot_timer {
145 uint64_t timeout_abs_ns;
146 uint32_t flags; /* VCPU_SSHOTTMR_??? */
147};
148
149/* Flags to VCPUOP_set_singleshot_timer. */
150 /* Require the timeout to be in the future (return -ETIME if it's passed). */
151#define _VCPU_SSHOTTMR_future (0)
152#define VCPU_SSHOTTMR_future (1U << _VCPU_SSHOTTMR_future)
153
154/*
155 * Register a memory location in the guest address space for the
156 * vcpu_info structure. This allows the guest to place the vcpu_info
157 * structure in a convenient place, such as in a per-cpu data area.
158 * The pointer need not be page aligned, but the structure must not
159 * cross a page boundary.
160 */
161#define VCPUOP_register_vcpu_info 10 /* arg == struct vcpu_info */
162struct vcpu_register_vcpu_info {
163 uint32_t mfn; /* mfn of page to place vcpu_info */
164 uint32_t offset; /* offset within page */
165};
166
167#endif /* __XEN_PUBLIC_VCPU_H__ */
diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h
new file mode 100644
index 000000000000..453235e923f0
--- /dev/null
+++ b/include/xen/interface/version.h
@@ -0,0 +1,60 @@
1/******************************************************************************
2 * version.h
3 *
4 * Xen version, type, and compile information.
5 *
6 * Copyright (c) 2005, Nguyen Anh Quynh <aquynh@gmail.com>
7 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
8 */
9
10#ifndef __XEN_PUBLIC_VERSION_H__
11#define __XEN_PUBLIC_VERSION_H__
12
13/* NB. All ops return zero on success, except XENVER_version. */
14
15/* arg == NULL; returns major:minor (16:16). */
16#define XENVER_version 0
17
18/* arg == xen_extraversion_t. */
19#define XENVER_extraversion 1
20struct xen_extraversion {
21 char extraversion[16];
22};
23#define XEN_EXTRAVERSION_LEN (sizeof(struct xen_extraversion))
24
25/* arg == xen_compile_info_t. */
26#define XENVER_compile_info 2
27struct xen_compile_info {
28 char compiler[64];
29 char compile_by[16];
30 char compile_domain[32];
31 char compile_date[32];
32};
33
34#define XENVER_capabilities 3
35struct xen_capabilities_info {
36 char info[1024];
37};
38#define XEN_CAPABILITIES_INFO_LEN (sizeof(struct xen_capabilities_info))
39
40#define XENVER_changeset 4
41struct xen_changeset_info {
42 char info[64];
43};
44#define XEN_CHANGESET_INFO_LEN (sizeof(struct xen_changeset_info))
45
46#define XENVER_platform_parameters 5
47struct xen_platform_parameters {
48 unsigned long virt_start;
49};
50
51#define XENVER_get_features 6
52struct xen_feature_info {
53 unsigned int submap_idx; /* IN: which 32-bit submap to return */
54 uint32_t submap; /* OUT: 32-bit submap */
55};
56
57/* Declares the features reported by XENVER_get_features. */
58#include "features.h"
59
60#endif /* __XEN_PUBLIC_VERSION_H__ */
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
new file mode 100644
index 000000000000..518a5bf79ed3
--- /dev/null
+++ b/include/xen/interface/xen.h
@@ -0,0 +1,447 @@
1/******************************************************************************
2 * xen.h
3 *
4 * Guest OS interface to Xen.
5 *
6 * Copyright (c) 2004, K A Fraser
7 */
8
9#ifndef __XEN_PUBLIC_XEN_H__
10#define __XEN_PUBLIC_XEN_H__
11
12#include <asm/xen/interface.h>
13
14/*
15 * XEN "SYSTEM CALLS" (a.k.a. HYPERCALLS).
16 */
17
18/*
19 * x86_32: EAX = vector; EBX, ECX, EDX, ESI, EDI = args 1, 2, 3, 4, 5.
20 * EAX = return value
21 * (argument registers may be clobbered on return)
22 * x86_64: RAX = vector; RDI, RSI, RDX, R10, R8, R9 = args 1, 2, 3, 4, 5, 6.
23 * RAX = return value
24 * (argument registers not clobbered on return; RCX, R11 are)
25 */
26#define __HYPERVISOR_set_trap_table 0
27#define __HYPERVISOR_mmu_update 1
28#define __HYPERVISOR_set_gdt 2
29#define __HYPERVISOR_stack_switch 3
30#define __HYPERVISOR_set_callbacks 4
31#define __HYPERVISOR_fpu_taskswitch 5
32#define __HYPERVISOR_sched_op 6
33#define __HYPERVISOR_dom0_op 7
34#define __HYPERVISOR_set_debugreg 8
35#define __HYPERVISOR_get_debugreg 9
36#define __HYPERVISOR_update_descriptor 10
37#define __HYPERVISOR_memory_op 12
38#define __HYPERVISOR_multicall 13
39#define __HYPERVISOR_update_va_mapping 14
40#define __HYPERVISOR_set_timer_op 15
41#define __HYPERVISOR_event_channel_op_compat 16
42#define __HYPERVISOR_xen_version 17
43#define __HYPERVISOR_console_io 18
44#define __HYPERVISOR_physdev_op_compat 19
45#define __HYPERVISOR_grant_table_op 20
46#define __HYPERVISOR_vm_assist 21
47#define __HYPERVISOR_update_va_mapping_otherdomain 22
48#define __HYPERVISOR_iret 23 /* x86 only */
49#define __HYPERVISOR_vcpu_op 24
50#define __HYPERVISOR_set_segment_base 25 /* x86/64 only */
51#define __HYPERVISOR_mmuext_op 26
52#define __HYPERVISOR_acm_op 27
53#define __HYPERVISOR_nmi_op 28
54#define __HYPERVISOR_sched_op_new 29
55#define __HYPERVISOR_callback_op 30
56#define __HYPERVISOR_xenoprof_op 31
57#define __HYPERVISOR_event_channel_op 32
58#define __HYPERVISOR_physdev_op 33
59#define __HYPERVISOR_hvm_op 34
60
61/*
62 * VIRTUAL INTERRUPTS
63 *
64 * Virtual interrupts that a guest OS may receive from Xen.
65 */
66#define VIRQ_TIMER 0 /* Timebase update, and/or requested timeout. */
67#define VIRQ_DEBUG 1 /* Request guest to dump debug info. */
68#define VIRQ_CONSOLE 2 /* (DOM0) Bytes received on emergency console. */
69#define VIRQ_DOM_EXC 3 /* (DOM0) Exceptional event for some domain. */
70#define VIRQ_DEBUGGER 6 /* (DOM0) A domain has paused for debugging. */
71#define NR_VIRQS 8
72
73/*
74 * MMU-UPDATE REQUESTS
75 *
76 * HYPERVISOR_mmu_update() accepts a list of (ptr, val) pairs.
77 * A foreigndom (FD) can be specified (or DOMID_SELF for none).
78 * Where the FD has some effect, it is described below.
79 * ptr[1:0] specifies the appropriate MMU_* command.
80 *
81 * ptr[1:0] == MMU_NORMAL_PT_UPDATE:
82 * Updates an entry in a page table. If updating an L1 table, and the new
83 * table entry is valid/present, the mapped frame must belong to the FD, if
84 * an FD has been specified. If attempting to map an I/O page then the
85 * caller assumes the privilege of the FD.
86 * FD == DOMID_IO: Permit /only/ I/O mappings, at the priv level of the caller.
87 * FD == DOMID_XEN: Map restricted areas of Xen's heap space.
88 * ptr[:2] -- Machine address of the page-table entry to modify.
89 * val -- Value to write.
90 *
91 * ptr[1:0] == MMU_MACHPHYS_UPDATE:
92 * Updates an entry in the machine->pseudo-physical mapping table.
93 * ptr[:2] -- Machine address within the frame whose mapping to modify.
94 * The frame must belong to the FD, if one is specified.
95 * val -- Value to write into the mapping entry.
96 */
97#define MMU_NORMAL_PT_UPDATE 0 /* checked '*ptr = val'. ptr is MA. */
98#define MMU_MACHPHYS_UPDATE 1 /* ptr = MA of frame to modify entry for */
99
100/*
101 * MMU EXTENDED OPERATIONS
102 *
103 * HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
104 * A foreigndom (FD) can be specified (or DOMID_SELF for none).
105 * Where the FD has some effect, it is described below.
106 *
107 * cmd: MMUEXT_(UN)PIN_*_TABLE
108 * mfn: Machine frame number to be (un)pinned as a p.t. page.
109 * The frame must belong to the FD, if one is specified.
110 *
111 * cmd: MMUEXT_NEW_BASEPTR
112 * mfn: Machine frame number of new page-table base to install in MMU.
113 *
114 * cmd: MMUEXT_NEW_USER_BASEPTR [x86/64 only]
115 * mfn: Machine frame number of new page-table base to install in MMU
116 * when in user space.
117 *
118 * cmd: MMUEXT_TLB_FLUSH_LOCAL
119 * No additional arguments. Flushes local TLB.
120 *
121 * cmd: MMUEXT_INVLPG_LOCAL
122 * linear_addr: Linear address to be flushed from the local TLB.
123 *
124 * cmd: MMUEXT_TLB_FLUSH_MULTI
125 * vcpumask: Pointer to bitmap of VCPUs to be flushed.
126 *
127 * cmd: MMUEXT_INVLPG_MULTI
128 * linear_addr: Linear address to be flushed.
129 * vcpumask: Pointer to bitmap of VCPUs to be flushed.
130 *
131 * cmd: MMUEXT_TLB_FLUSH_ALL
132 * No additional arguments. Flushes all VCPUs' TLBs.
133 *
134 * cmd: MMUEXT_INVLPG_ALL
135 * linear_addr: Linear address to be flushed from all VCPUs' TLBs.
136 *
137 * cmd: MMUEXT_FLUSH_CACHE
138 * No additional arguments. Writes back and flushes cache contents.
139 *
140 * cmd: MMUEXT_SET_LDT
141 * linear_addr: Linear address of LDT base (NB. must be page-aligned).
142 * nr_ents: Number of entries in LDT.
143 */
144#define MMUEXT_PIN_L1_TABLE 0
145#define MMUEXT_PIN_L2_TABLE 1
146#define MMUEXT_PIN_L3_TABLE 2
147#define MMUEXT_PIN_L4_TABLE 3
148#define MMUEXT_UNPIN_TABLE 4
149#define MMUEXT_NEW_BASEPTR 5
150#define MMUEXT_TLB_FLUSH_LOCAL 6
151#define MMUEXT_INVLPG_LOCAL 7
152#define MMUEXT_TLB_FLUSH_MULTI 8
153#define MMUEXT_INVLPG_MULTI 9
154#define MMUEXT_TLB_FLUSH_ALL 10
155#define MMUEXT_INVLPG_ALL 11
156#define MMUEXT_FLUSH_CACHE 12
157#define MMUEXT_SET_LDT 13
158#define MMUEXT_NEW_USER_BASEPTR 15
159
160#ifndef __ASSEMBLY__
161struct mmuext_op {
162 unsigned int cmd;
163 union {
164 /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */
165 unsigned long mfn;
166 /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
167 unsigned long linear_addr;
168 } arg1;
169 union {
170 /* SET_LDT */
171 unsigned int nr_ents;
172 /* TLB_FLUSH_MULTI, INVLPG_MULTI */
173 void *vcpumask;
174 } arg2;
175};
176DEFINE_GUEST_HANDLE_STRUCT(mmuext_op);
177#endif
178
179/* These are passed as 'flags' to update_va_mapping. They can be ORed. */
180/* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap. */
181/* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer. */
182#define UVMF_NONE (0UL<<0) /* No flushing at all. */
183#define UVMF_TLB_FLUSH (1UL<<0) /* Flush entire TLB(s). */
184#define UVMF_INVLPG (2UL<<0) /* Flush only one entry. */
185#define UVMF_FLUSHTYPE_MASK (3UL<<0)
186#define UVMF_MULTI (0UL<<2) /* Flush subset of TLBs. */
187#define UVMF_LOCAL (0UL<<2) /* Flush local TLB. */
188#define UVMF_ALL (1UL<<2) /* Flush all TLBs. */
189
190/*
191 * Commands to HYPERVISOR_console_io().
192 */
193#define CONSOLEIO_write 0
194#define CONSOLEIO_read 1
195
196/*
197 * Commands to HYPERVISOR_vm_assist().
198 */
199#define VMASST_CMD_enable 0
200#define VMASST_CMD_disable 1
201#define VMASST_TYPE_4gb_segments 0
202#define VMASST_TYPE_4gb_segments_notify 1
203#define VMASST_TYPE_writable_pagetables 2
204#define VMASST_TYPE_pae_extended_cr3 3
205#define MAX_VMASST_TYPE 3
206
207#ifndef __ASSEMBLY__
208
209typedef uint16_t domid_t;
210
211/* Domain ids >= DOMID_FIRST_RESERVED cannot be used for ordinary domains. */
212#define DOMID_FIRST_RESERVED (0x7FF0U)
213
214/* DOMID_SELF is used in certain contexts to refer to oneself. */
215#define DOMID_SELF (0x7FF0U)
216
217/*
218 * DOMID_IO is used to restrict page-table updates to mapping I/O memory.
219 * Although no Foreign Domain need be specified to map I/O pages, DOMID_IO
220 * is useful to ensure that no mappings to the OS's own heap are accidentally
221 * installed. (e.g., in Linux this could cause havoc as reference counts
222 * aren't adjusted on the I/O-mapping code path).
223 * This only makes sense in MMUEXT_SET_FOREIGNDOM, but in that context can
224 * be specified by any calling domain.
225 */
226#define DOMID_IO (0x7FF1U)
227
228/*
229 * DOMID_XEN is used to allow privileged domains to map restricted parts of
230 * Xen's heap space (e.g., the machine_to_phys table).
231 * This only makes sense in MMUEXT_SET_FOREIGNDOM, and is only permitted if
232 * the caller is privileged.
233 */
234#define DOMID_XEN (0x7FF2U)
235
236/*
237 * Send an array of these to HYPERVISOR_mmu_update().
238 * NB. The fields are natural pointer/address size for this architecture.
239 */
240struct mmu_update {
241 uint64_t ptr; /* Machine address of PTE. */
242 uint64_t val; /* New contents of PTE. */
243};
244DEFINE_GUEST_HANDLE_STRUCT(mmu_update);
245
246/*
247 * Send an array of these to HYPERVISOR_multicall().
248 * NB. The fields are natural register size for this architecture.
249 */
250struct multicall_entry {
251 unsigned long op;
252 long result;
253 unsigned long args[6];
254};
255DEFINE_GUEST_HANDLE_STRUCT(multicall_entry);
256
257/*
258 * Event channel endpoints per domain:
259 * 1024 if a long is 32 bits; 4096 if a long is 64 bits.
260 */
261#define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64)
262
263struct vcpu_time_info {
264 /*
265 * Updates to the following values are preceded and followed
266 * by an increment of 'version'. The guest can therefore
267 * detect updates by looking for changes to 'version'. If the
268 * least-significant bit of the version number is set then an
269 * update is in progress and the guest must wait to read a
270 * consistent set of values. The correct way to interact with
271 * the version number is similar to Linux's seqlock: see the
272 * implementations of read_seqbegin/read_seqretry.
273 */
274 uint32_t version;
275 uint32_t pad0;
276 uint64_t tsc_timestamp; /* TSC at last update of time vals. */
277 uint64_t system_time; /* Time, in nanosecs, since boot. */
278 /*
279 * Current system time:
280 * system_time + ((tsc - tsc_timestamp) << tsc_shift) * tsc_to_system_mul
281 * CPU frequency (Hz):
282 * ((10^9 << 32) / tsc_to_system_mul) >> tsc_shift
283 */
284 uint32_t tsc_to_system_mul;
285 int8_t tsc_shift;
286 int8_t pad1[3];
287}; /* 32 bytes */
288
289struct vcpu_info {
290 /*
291 * 'evtchn_upcall_pending' is written non-zero by Xen to indicate
292 * a pending notification for a particular VCPU. It is then cleared
293 * by the guest OS /before/ checking for pending work, thus avoiding
294 * a set-and-check race. Note that the mask is only accessed by Xen
295 * on the CPU that is currently hosting the VCPU. This means that the
296 * pending and mask flags can be updated by the guest without special
297 * synchronisation (i.e., no need for the x86 LOCK prefix).
298 * This may seem suboptimal because if the pending flag is set by
299 * a different CPU then an IPI may be scheduled even when the mask
300 * is set. However, note:
301 * 1. The task of 'interrupt holdoff' is covered by the per-event-
302 * channel mask bits. A 'noisy' event that is continually being
303 * triggered can be masked at source at this very precise
304 * granularity.
305 * 2. The main purpose of the per-VCPU mask is therefore to restrict
306 * reentrant execution: whether for concurrency control, or to
307 * prevent unbounded stack usage. Whatever the purpose, we expect
308 * that the mask will be asserted only for short periods at a time,
309 * and so the likelihood of a 'spurious' IPI is suitably small.
310 * The mask is read before making an event upcall to the guest: a
311 * non-zero mask therefore guarantees that the VCPU will not receive
312 * an upcall activation. The mask is cleared when the VCPU requests
313 * to block: this avoids wakeup-waiting races.
314 */
315 uint8_t evtchn_upcall_pending;
316 uint8_t evtchn_upcall_mask;
317 unsigned long evtchn_pending_sel;
318 struct arch_vcpu_info arch;
319 struct vcpu_time_info time;
320}; /* 64 bytes (x86) */
321
322/*
323 * Xen/kernel shared data -- pointer provided in start_info.
324 * NB. We expect that this struct is smaller than a page.
325 */
326struct shared_info {
327 struct vcpu_info vcpu_info[MAX_VIRT_CPUS];
328
329 /*
330 * A domain can create "event channels" on which it can send and receive
331 * asynchronous event notifications. There are three classes of event that
332 * are delivered by this mechanism:
333 * 1. Bi-directional inter- and intra-domain connections. Domains must
334 * arrange out-of-band to set up a connection (usually by allocating
335 * an unbound 'listener' port and avertising that via a storage service
336 * such as xenstore).
337 * 2. Physical interrupts. A domain with suitable hardware-access
338 * privileges can bind an event-channel port to a physical interrupt
339 * source.
340 * 3. Virtual interrupts ('events'). A domain can bind an event-channel
341 * port to a virtual interrupt source, such as the virtual-timer
342 * device or the emergency console.
343 *
344 * Event channels are addressed by a "port index". Each channel is
345 * associated with two bits of information:
346 * 1. PENDING -- notifies the domain that there is a pending notification
347 * to be processed. This bit is cleared by the guest.
348 * 2. MASK -- if this bit is clear then a 0->1 transition of PENDING
349 * will cause an asynchronous upcall to be scheduled. This bit is only
350 * updated by the guest. It is read-only within Xen. If a channel
351 * becomes pending while the channel is masked then the 'edge' is lost
352 * (i.e., when the channel is unmasked, the guest must manually handle
353 * pending notifications as no upcall will be scheduled by Xen).
354 *
355 * To expedite scanning of pending notifications, any 0->1 pending
356 * transition on an unmasked channel causes a corresponding bit in a
357 * per-vcpu selector word to be set. Each bit in the selector covers a
358 * 'C long' in the PENDING bitfield array.
359 */
360 unsigned long evtchn_pending[sizeof(unsigned long) * 8];
361 unsigned long evtchn_mask[sizeof(unsigned long) * 8];
362
363 /*
364 * Wallclock time: updated only by control software. Guests should base
365 * their gettimeofday() syscall on this wallclock-base value.
366 */
367 uint32_t wc_version; /* Version counter: see vcpu_time_info_t. */
368 uint32_t wc_sec; /* Secs 00:00:00 UTC, Jan 1, 1970. */
369 uint32_t wc_nsec; /* Nsecs 00:00:00 UTC, Jan 1, 1970. */
370
371 struct arch_shared_info arch;
372
373};
374
375/*
376 * Start-of-day memory layout for the initial domain (DOM0):
377 * 1. The domain is started within contiguous virtual-memory region.
378 * 2. The contiguous region begins and ends on an aligned 4MB boundary.
379 * 3. The region start corresponds to the load address of the OS image.
380 * If the load address is not 4MB aligned then the address is rounded down.
381 * 4. This the order of bootstrap elements in the initial virtual region:
382 * a. relocated kernel image
383 * b. initial ram disk [mod_start, mod_len]
384 * c. list of allocated page frames [mfn_list, nr_pages]
385 * d. start_info_t structure [register ESI (x86)]
386 * e. bootstrap page tables [pt_base, CR3 (x86)]
387 * f. bootstrap stack [register ESP (x86)]
388 * 5. Bootstrap elements are packed together, but each is 4kB-aligned.
389 * 6. The initial ram disk may be omitted.
390 * 7. The list of page frames forms a contiguous 'pseudo-physical' memory
391 * layout for the domain. In particular, the bootstrap virtual-memory
392 * region is a 1:1 mapping to the first section of the pseudo-physical map.
393 * 8. All bootstrap elements are mapped read-writable for the guest OS. The
394 * only exception is the bootstrap page table, which is mapped read-only.
395 * 9. There is guaranteed to be at least 512kB padding after the final
396 * bootstrap element. If necessary, the bootstrap virtual region is
397 * extended by an extra 4MB to ensure this.
398 */
399
400#define MAX_GUEST_CMDLINE 1024
401struct start_info {
402 /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME. */
403 char magic[32]; /* "xen-<version>-<platform>". */
404 unsigned long nr_pages; /* Total pages allocated to this domain. */
405 unsigned long shared_info; /* MACHINE address of shared info struct. */
406 uint32_t flags; /* SIF_xxx flags. */
407 unsigned long store_mfn; /* MACHINE page number of shared page. */
408 uint32_t store_evtchn; /* Event channel for store communication. */
409 union {
410 struct {
411 unsigned long mfn; /* MACHINE page number of console page. */
412 uint32_t evtchn; /* Event channel for console page. */
413 } domU;
414 struct {
415 uint32_t info_off; /* Offset of console_info struct. */
416 uint32_t info_size; /* Size of console_info struct from start.*/
417 } dom0;
418 } console;
419 /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME). */
420 unsigned long pt_base; /* VIRTUAL address of page directory. */
421 unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames. */
422 unsigned long mfn_list; /* VIRTUAL address of page-frame list. */
423 unsigned long mod_start; /* VIRTUAL address of pre-loaded module. */
424 unsigned long mod_len; /* Size (bytes) of pre-loaded module. */
425 int8_t cmd_line[MAX_GUEST_CMDLINE];
426};
427
428/* These flags are passed in the 'flags' field of start_info_t. */
429#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
430#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */
431
432typedef uint64_t cpumap_t;
433
434typedef uint8_t xen_domain_handle_t[16];
435
436/* Turn a plain number into a C unsigned long constant. */
437#define __mk_unsigned_long(x) x ## UL
438#define mk_unsigned_long(x) __mk_unsigned_long(x)
439
440#else /* __ASSEMBLY__ */
441
442/* In assembly code we cannot use C numeric constant suffixes. */
443#define mk_unsigned_long(x) x
444
445#endif /* !__ASSEMBLY__ */
446
447#endif /* __XEN_PUBLIC_XEN_H__ */
diff --git a/include/xen/page.h b/include/xen/page.h
new file mode 100644
index 000000000000..c0c8fcb27899
--- /dev/null
+++ b/include/xen/page.h
@@ -0,0 +1,180 @@
1#ifndef __XEN_PAGE_H
2#define __XEN_PAGE_H
3
4#include <linux/pfn.h>
5
6#include <asm/uaccess.h>
7#include <asm/pgtable.h>
8
9#include <xen/features.h>
10
11#ifdef CONFIG_X86_PAE
12/* Xen machine address */
13typedef struct xmaddr {
14 unsigned long long maddr;
15} xmaddr_t;
16
17/* Xen pseudo-physical address */
18typedef struct xpaddr {
19 unsigned long long paddr;
20} xpaddr_t;
21#else
22/* Xen machine address */
23typedef struct xmaddr {
24 unsigned long maddr;
25} xmaddr_t;
26
27/* Xen pseudo-physical address */
28typedef struct xpaddr {
29 unsigned long paddr;
30} xpaddr_t;
31#endif
32
33#define XMADDR(x) ((xmaddr_t) { .maddr = (x) })
34#define XPADDR(x) ((xpaddr_t) { .paddr = (x) })
35
36/**** MACHINE <-> PHYSICAL CONVERSION MACROS ****/
37#define INVALID_P2M_ENTRY (~0UL)
38#define FOREIGN_FRAME_BIT (1UL<<31)
39#define FOREIGN_FRAME(m) ((m) | FOREIGN_FRAME_BIT)
40
41extern unsigned long *phys_to_machine_mapping;
42
43static inline unsigned long pfn_to_mfn(unsigned long pfn)
44{
45 if (xen_feature(XENFEAT_auto_translated_physmap))
46 return pfn;
47
48 return phys_to_machine_mapping[(unsigned int)(pfn)] &
49 ~FOREIGN_FRAME_BIT;
50}
51
52static inline int phys_to_machine_mapping_valid(unsigned long pfn)
53{
54 if (xen_feature(XENFEAT_auto_translated_physmap))
55 return 1;
56
57 return (phys_to_machine_mapping[pfn] != INVALID_P2M_ENTRY);
58}
59
60static inline unsigned long mfn_to_pfn(unsigned long mfn)
61{
62 unsigned long pfn;
63
64 if (xen_feature(XENFEAT_auto_translated_physmap))
65 return mfn;
66
67#if 0
68 if (unlikely((mfn >> machine_to_phys_order) != 0))
69 return max_mapnr;
70#endif
71
72 pfn = 0;
73 /*
74 * The array access can fail (e.g., device space beyond end of RAM).
75 * In such cases it doesn't matter what we return (we return garbage),
76 * but we must handle the fault without crashing!
77 */
78 __get_user(pfn, &machine_to_phys_mapping[mfn]);
79
80 return pfn;
81}
82
83static inline xmaddr_t phys_to_machine(xpaddr_t phys)
84{
85 unsigned offset = phys.paddr & ~PAGE_MASK;
86 return XMADDR(PFN_PHYS((u64)pfn_to_mfn(PFN_DOWN(phys.paddr))) | offset);
87}
88
89static inline xpaddr_t machine_to_phys(xmaddr_t machine)
90{
91 unsigned offset = machine.maddr & ~PAGE_MASK;
92 return XPADDR(PFN_PHYS((u64)mfn_to_pfn(PFN_DOWN(machine.maddr))) | offset);
93}
94
95/*
96 * We detect special mappings in one of two ways:
97 * 1. If the MFN is an I/O page then Xen will set the m2p entry
98 * to be outside our maximum possible pseudophys range.
99 * 2. If the MFN belongs to a different domain then we will certainly
100 * not have MFN in our p2m table. Conversely, if the page is ours,
101 * then we'll have p2m(m2p(MFN))==MFN.
102 * If we detect a special mapping then it doesn't have a 'struct page'.
103 * We force !pfn_valid() by returning an out-of-range pointer.
104 *
105 * NB. These checks require that, for any MFN that is not in our reservation,
106 * there is no PFN such that p2m(PFN) == MFN. Otherwise we can get confused if
107 * we are foreign-mapping the MFN, and the other domain as m2p(MFN) == PFN.
108 * Yikes! Various places must poke in INVALID_P2M_ENTRY for safety.
109 *
110 * NB2. When deliberately mapping foreign pages into the p2m table, you *must*
111 * use FOREIGN_FRAME(). This will cause pte_pfn() to choke on it, as we
112 * require. In all the cases we care about, the FOREIGN_FRAME bit is
113 * masked (e.g., pfn_to_mfn()) so behaviour there is correct.
114 */
115static inline unsigned long mfn_to_local_pfn(unsigned long mfn)
116{
117 extern unsigned long max_mapnr;
118 unsigned long pfn = mfn_to_pfn(mfn);
119 if ((pfn < max_mapnr)
120 && !xen_feature(XENFEAT_auto_translated_physmap)
121 && (phys_to_machine_mapping[pfn] != mfn))
122 return max_mapnr; /* force !pfn_valid() */
123 return pfn;
124}
125
126static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn)
127{
128 if (xen_feature(XENFEAT_auto_translated_physmap)) {
129 BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY);
130 return;
131 }
132 phys_to_machine_mapping[pfn] = mfn;
133}
134
135/* VIRT <-> MACHINE conversion */
136#define virt_to_machine(v) (phys_to_machine(XPADDR(__pa(v))))
137#define virt_to_mfn(v) (pfn_to_mfn(PFN_DOWN(__pa(v))))
138#define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT))
139
140#ifdef CONFIG_X86_PAE
141#define pte_mfn(_pte) (((_pte).pte_low >> PAGE_SHIFT) | \
142 (((_pte).pte_high & 0xfff) << (32-PAGE_SHIFT)))
143
144static inline pte_t mfn_pte(unsigned long page_nr, pgprot_t pgprot)
145{
146 pte_t pte;
147
148 pte.pte_high = (page_nr >> (32 - PAGE_SHIFT)) |
149 (pgprot_val(pgprot) >> 32);
150 pte.pte_high &= (__supported_pte_mask >> 32);
151 pte.pte_low = ((page_nr << PAGE_SHIFT) | pgprot_val(pgprot));
152 pte.pte_low &= __supported_pte_mask;
153
154 return pte;
155}
156
157static inline unsigned long long pte_val_ma(pte_t x)
158{
159 return ((unsigned long long)x.pte_high << 32) | x.pte_low;
160}
161#define pmd_val_ma(v) ((v).pmd)
162#define pud_val_ma(v) ((v).pgd.pgd)
163#define __pte_ma(x) ((pte_t) { .pte_low = (x), .pte_high = (x)>>32 } )
164#define __pmd_ma(x) ((pmd_t) { (x) } )
165#else /* !X86_PAE */
166#define pte_mfn(_pte) ((_pte).pte_low >> PAGE_SHIFT)
167#define mfn_pte(pfn, prot) __pte_ma(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
168#define pte_val_ma(x) ((x).pte_low)
169#define pmd_val_ma(v) ((v).pud.pgd.pgd)
170#define __pte_ma(x) ((pte_t) { (x) } )
171#endif /* CONFIG_X86_PAE */
172
173#define pgd_val_ma(x) ((x).pgd)
174
175
176xmaddr_t arbitrary_virt_to_machine(unsigned long address);
177void make_lowmem_page_readonly(void *vaddr);
178void make_lowmem_page_readwrite(void *vaddr);
179
180#endif /* __XEN_PAGE_H */
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
new file mode 100644
index 000000000000..6f7c290651ae
--- /dev/null
+++ b/include/xen/xenbus.h
@@ -0,0 +1,234 @@
1/******************************************************************************
2 * xenbus.h
3 *
4 * Talks to Xen Store to figure out what devices we have.
5 *
6 * Copyright (C) 2005 Rusty Russell, IBM Corporation
7 * Copyright (C) 2005 XenSource Ltd.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation; or, when distributed
12 * separately from the Linux kernel or incorporated into other
13 * software packages, subject to the following license:
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * of this source file (the "Software"), to deal in the Software without
17 * restriction, including without limitation the rights to use, copy, modify,
18 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
19 * and to permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be included in
23 * all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
31 * IN THE SOFTWARE.
32 */
33
34#ifndef _XEN_XENBUS_H
35#define _XEN_XENBUS_H
36
37#include <linux/device.h>
38#include <linux/notifier.h>
39#include <linux/mutex.h>
40#include <linux/completion.h>
41#include <linux/init.h>
42#include <xen/interface/xen.h>
43#include <xen/interface/grant_table.h>
44#include <xen/interface/io/xenbus.h>
45#include <xen/interface/io/xs_wire.h>
46
47/* Register callback to watch this node. */
48struct xenbus_watch
49{
50 struct list_head list;
51
52 /* Path being watched. */
53 const char *node;
54
55 /* Callback (executed in a process context with no locks held). */
56 void (*callback)(struct xenbus_watch *,
57 const char **vec, unsigned int len);
58};
59
60
61/* A xenbus device. */
62struct xenbus_device {
63 const char *devicetype;
64 const char *nodename;
65 const char *otherend;
66 int otherend_id;
67 struct xenbus_watch otherend_watch;
68 struct device dev;
69 enum xenbus_state state;
70 struct completion down;
71};
72
73static inline struct xenbus_device *to_xenbus_device(struct device *dev)
74{
75 return container_of(dev, struct xenbus_device, dev);
76}
77
78struct xenbus_device_id
79{
80 /* .../device/<device_type>/<identifier> */
81 char devicetype[32]; /* General class of device. */
82};
83
84/* A xenbus driver. */
85struct xenbus_driver {
86 char *name;
87 struct module *owner;
88 const struct xenbus_device_id *ids;
89 int (*probe)(struct xenbus_device *dev,
90 const struct xenbus_device_id *id);
91 void (*otherend_changed)(struct xenbus_device *dev,
92 enum xenbus_state backend_state);
93 int (*remove)(struct xenbus_device *dev);
94 int (*suspend)(struct xenbus_device *dev);
95 int (*suspend_cancel)(struct xenbus_device *dev);
96 int (*resume)(struct xenbus_device *dev);
97 int (*uevent)(struct xenbus_device *, char **, int, char *, int);
98 struct device_driver driver;
99 int (*read_otherend_details)(struct xenbus_device *dev);
100};
101
102static inline struct xenbus_driver *to_xenbus_driver(struct device_driver *drv)
103{
104 return container_of(drv, struct xenbus_driver, driver);
105}
106
107int __must_check __xenbus_register_frontend(struct xenbus_driver *drv,
108 struct module *owner,
109 const char *mod_name);
110
111static inline int __must_check
112xenbus_register_frontend(struct xenbus_driver *drv)
113{
114 WARN_ON(drv->owner != THIS_MODULE);
115 return __xenbus_register_frontend(drv, THIS_MODULE, KBUILD_MODNAME);
116}
117
118int __must_check __xenbus_register_backend(struct xenbus_driver *drv,
119 struct module *owner,
120 const char *mod_name);
121static inline int __must_check
122xenbus_register_backend(struct xenbus_driver *drv)
123{
124 WARN_ON(drv->owner != THIS_MODULE);
125 return __xenbus_register_backend(drv, THIS_MODULE, KBUILD_MODNAME);
126}
127
128void xenbus_unregister_driver(struct xenbus_driver *drv);
129
130struct xenbus_transaction
131{
132 u32 id;
133};
134
135/* Nil transaction ID. */
136#define XBT_NIL ((struct xenbus_transaction) { 0 })
137
138int __init xenbus_dev_init(void);
139
140char **xenbus_directory(struct xenbus_transaction t,
141 const char *dir, const char *node, unsigned int *num);
142void *xenbus_read(struct xenbus_transaction t,
143 const char *dir, const char *node, unsigned int *len);
144int xenbus_write(struct xenbus_transaction t,
145 const char *dir, const char *node, const char *string);
146int xenbus_mkdir(struct xenbus_transaction t,
147 const char *dir, const char *node);
148int xenbus_exists(struct xenbus_transaction t,
149 const char *dir, const char *node);
150int xenbus_rm(struct xenbus_transaction t, const char *dir, const char *node);
151int xenbus_transaction_start(struct xenbus_transaction *t);
152int xenbus_transaction_end(struct xenbus_transaction t, int abort);
153
154/* Single read and scanf: returns -errno or num scanned if > 0. */
155int xenbus_scanf(struct xenbus_transaction t,
156 const char *dir, const char *node, const char *fmt, ...)
157 __attribute__((format(scanf, 4, 5)));
158
159/* Single printf and write: returns -errno or 0. */
160int xenbus_printf(struct xenbus_transaction t,
161 const char *dir, const char *node, const char *fmt, ...)
162 __attribute__((format(printf, 4, 5)));
163
164/* Generic read function: NULL-terminated triples of name,
165 * sprintf-style type string, and pointer. Returns 0 or errno.*/
166int xenbus_gather(struct xenbus_transaction t, const char *dir, ...);
167
168/* notifer routines for when the xenstore comes up */
169extern int xenstored_ready;
170int register_xenstore_notifier(struct notifier_block *nb);
171void unregister_xenstore_notifier(struct notifier_block *nb);
172
173int register_xenbus_watch(struct xenbus_watch *watch);
174void unregister_xenbus_watch(struct xenbus_watch *watch);
175void xs_suspend(void);
176void xs_resume(void);
177void xs_suspend_cancel(void);
178
179/* Used by xenbus_dev to borrow kernel's store connection. */
180void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg);
181
182struct work_struct;
183
184/* Prepare for domain suspend: then resume or cancel the suspend. */
185void xenbus_suspend(void);
186void xenbus_resume(void);
187void xenbus_probe(struct work_struct *);
188void xenbus_suspend_cancel(void);
189
190#define XENBUS_IS_ERR_READ(str) ({ \
191 if (!IS_ERR(str) && strlen(str) == 0) { \
192 kfree(str); \
193 str = ERR_PTR(-ERANGE); \
194 } \
195 IS_ERR(str); \
196})
197
198#define XENBUS_EXIST_ERR(err) ((err) == -ENOENT || (err) == -ERANGE)
199
200int xenbus_watch_path(struct xenbus_device *dev, const char *path,
201 struct xenbus_watch *watch,
202 void (*callback)(struct xenbus_watch *,
203 const char **, unsigned int));
204int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch,
205 void (*callback)(struct xenbus_watch *,
206 const char **, unsigned int),
207 const char *pathfmt, ...)
208 __attribute__ ((format (printf, 4, 5)));
209
210int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state);
211int xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn);
212int xenbus_map_ring_valloc(struct xenbus_device *dev,
213 int gnt_ref, void **vaddr);
214int xenbus_map_ring(struct xenbus_device *dev, int gnt_ref,
215 grant_handle_t *handle, void *vaddr);
216
217int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr);
218int xenbus_unmap_ring(struct xenbus_device *dev,
219 grant_handle_t handle, void *vaddr);
220
221int xenbus_alloc_evtchn(struct xenbus_device *dev, int *port);
222int xenbus_bind_evtchn(struct xenbus_device *dev, int remote_port, int *port);
223int xenbus_free_evtchn(struct xenbus_device *dev, int port);
224
225enum xenbus_state xenbus_read_driver_state(const char *path);
226
227void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...);
228void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...);
229
230const char *xenbus_strstate(enum xenbus_state state);
231int xenbus_dev_is_online(struct xenbus_device *dev);
232int xenbus_frontend_closed(struct xenbus_device *dev);
233
234#endif /* _XEN_XENBUS_H */