aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-28 18:58:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-28 18:58:21 -0400
commit0195c00244dc2e9f522475868fa278c473ba7339 (patch)
treef97ca98ae64ede2c33ad3de05ed7bbfa4f4495ed
parentf21ce8f8447c8be8847dadcfdbcc76b0d7365fa5 (diff)
parent141124c02059eee9dbc5c86ea797b1ca888e77f7 (diff)
Merge tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system
Pull "Disintegrate and delete asm/system.h" from David Howells: "Here are a bunch of patches to disintegrate asm/system.h into a set of separate bits to relieve the problem of circular inclusion dependencies. I've built all the working defconfigs from all the arches that I can and made sure that they don't break. The reason for these patches is that I recently encountered a circular dependency problem that came about when I produced some patches to optimise get_order() by rewriting it to use ilog2(). This uses bitops - and on the SH arch asm/bitops.h drags in asm-generic/get_order.h by a circuituous route involving asm/system.h. The main difficulty seems to be asm/system.h. It holds a number of low level bits with no/few dependencies that are commonly used (eg. memory barriers) and a number of bits with more dependencies that aren't used in many places (eg. switch_to()). These patches break asm/system.h up into the following core pieces: (1) asm/barrier.h Move memory barriers here. This already done for MIPS and Alpha. (2) asm/switch_to.h Move switch_to() and related stuff here. (3) asm/exec.h Move arch_align_stack() here. Other process execution related bits could perhaps go here from asm/processor.h. (4) asm/cmpxchg.h Move xchg() and cmpxchg() here as they're full word atomic ops and frequently used by atomic_xchg() and atomic_cmpxchg(). (5) asm/bug.h Move die() and related bits. (6) asm/auxvec.h Move AT_VECTOR_SIZE_ARCH here. Other arch headers are created as needed on a per-arch basis." Fixed up some conflicts from other header file cleanups and moving code around that has happened in the meantime, so David's testing is somewhat weakened by that. We'll find out anything that got broken and fix it.. * tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system: (38 commits) Delete all instances of asm/system.h Remove all #inclusions of asm/system.h Add #includes needed to permit the removal of asm/system.h Move all declarations of free_initmem() to linux/mm.h Disintegrate asm/system.h for OpenRISC Split arch_align_stack() out from asm-generic/system.h Split the switch_to() wrapper out of asm-generic/system.h Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h Create asm-generic/barrier.h Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h Disintegrate asm/system.h for Xtensa Disintegrate asm/system.h for Unicore32 [based on ver #3, changed by gxt] Disintegrate asm/system.h for Tile Disintegrate asm/system.h for Sparc Disintegrate asm/system.h for SH Disintegrate asm/system.h for Score Disintegrate asm/system.h for S390 Disintegrate asm/system.h for PowerPC Disintegrate asm/system.h for PA-RISC Disintegrate asm/system.h for MN10300 ...
-rw-r--r--arch/alpha/boot/bootp.c1
-rw-r--r--arch/alpha/boot/bootpz.c1
-rw-r--r--arch/alpha/boot/head.S1
-rw-r--r--arch/alpha/boot/main.c1
-rw-r--r--arch/alpha/include/asm/atomic.h68
-rw-r--r--arch/alpha/include/asm/auxvec.h2
-rw-r--r--arch/alpha/include/asm/core_lca.h2
-rw-r--r--arch/alpha/include/asm/core_mcpcia.h1
-rw-r--r--arch/alpha/include/asm/core_t2.h1
-rw-r--r--arch/alpha/include/asm/elf.h1
-rw-r--r--arch/alpha/include/asm/exec.h6
-rw-r--r--arch/alpha/include/asm/fpu.h2
-rw-r--r--arch/alpha/include/asm/io.h1
-rw-r--r--arch/alpha/include/asm/irqflags.h2
-rw-r--r--arch/alpha/include/asm/mce.h83
-rw-r--r--arch/alpha/include/asm/mmu_context.h1
-rw-r--r--arch/alpha/include/asm/pal.h112
-rw-r--r--arch/alpha/include/asm/pgtable.h1
-rw-r--r--arch/alpha/include/asm/setup.h36
-rw-r--r--arch/alpha/include/asm/special_insns.h41
-rw-r--r--arch/alpha/include/asm/spinlock.h1
-rw-r--r--arch/alpha/include/asm/switch_to.h14
-rw-r--r--arch/alpha/include/asm/system.h354
-rw-r--r--arch/alpha/include/asm/xchg.h2
-rw-r--r--arch/alpha/kernel/core_apecs.c1
-rw-r--r--arch/alpha/kernel/core_cia.c1
-rw-r--r--arch/alpha/kernel/core_t2.c1
-rw-r--r--arch/alpha/kernel/err_impl.h2
-rw-r--r--arch/alpha/kernel/head.S6
-rw-r--r--arch/alpha/kernel/irq.c1
-rw-r--r--arch/alpha/kernel/irq_alpha.c1
-rw-r--r--arch/alpha/kernel/osf_sys.c1
-rw-r--r--arch/alpha/kernel/process.c1
-rw-r--r--arch/alpha/kernel/ptrace.c1
-rw-r--r--arch/alpha/kernel/setup.c1
-rw-r--r--arch/alpha/kernel/sys_alcor.c1
-rw-r--r--arch/alpha/kernel/sys_cabriolet.c1
-rw-r--r--arch/alpha/kernel/sys_dp264.c1
-rw-r--r--arch/alpha/kernel/sys_eb64p.c1
-rw-r--r--arch/alpha/kernel/sys_eiger.c1
-rw-r--r--arch/alpha/kernel/sys_jensen.c1
-rw-r--r--arch/alpha/kernel/sys_marvel.c1
-rw-r--r--arch/alpha/kernel/sys_miata.c1
-rw-r--r--arch/alpha/kernel/sys_mikasa.c2
-rw-r--r--arch/alpha/kernel/sys_nautilus.c1
-rw-r--r--arch/alpha/kernel/sys_noritake.c2
-rw-r--r--arch/alpha/kernel/sys_rawhide.c1
-rw-r--r--arch/alpha/kernel/sys_ruffian.c1
-rw-r--r--arch/alpha/kernel/sys_rx164.c1
-rw-r--r--arch/alpha/kernel/sys_sable.c1
-rw-r--r--arch/alpha/kernel/sys_sio.c1
-rw-r--r--arch/alpha/kernel/sys_sx164.c2
-rw-r--r--arch/alpha/kernel/sys_takara.c1
-rw-r--r--arch/alpha/kernel/sys_titan.c1
-rw-r--r--arch/alpha/kernel/sys_wildfire.c1
-rw-r--r--arch/alpha/kernel/traps.c1
-rw-r--r--arch/alpha/kernel/vmlinux.lds.S2
-rw-r--r--arch/alpha/lib/stacktrace.c1
-rw-r--r--arch/alpha/mm/fault.c1
-rw-r--r--arch/alpha/mm/init.c2
-rw-r--r--arch/alpha/oprofile/common.c1
-rw-r--r--arch/alpha/oprofile/op_model_ev4.c1
-rw-r--r--arch/alpha/oprofile/op_model_ev5.c1
-rw-r--r--arch/alpha/oprofile/op_model_ev6.c1
-rw-r--r--arch/alpha/oprofile/op_model_ev67.c1
-rw-r--r--arch/arm/common/via82c505.c1
-rw-r--r--arch/arm/include/asm/atomic.h4
-rw-r--r--arch/arm/include/asm/barrier.h69
-rw-r--r--arch/arm/include/asm/bitops.h2
-rw-r--r--arch/arm/include/asm/bug.h30
-rw-r--r--arch/arm/include/asm/cmpxchg.h295
-rw-r--r--arch/arm/include/asm/compiler.h15
-rw-r--r--arch/arm/include/asm/cp15.h87
-rw-r--r--arch/arm/include/asm/div64.h2
-rw-r--r--arch/arm/include/asm/dma.h1
-rw-r--r--arch/arm/include/asm/domain.h4
-rw-r--r--arch/arm/include/asm/exec.h6
-rw-r--r--arch/arm/include/asm/hardware/iop3xx.h3
-rw-r--r--arch/arm/include/asm/io.h2
-rw-r--r--arch/arm/include/asm/mmu.h7
-rw-r--r--arch/arm/include/asm/processor.h3
-rw-r--r--arch/arm/include/asm/switch_to.h18
-rw-r--r--arch/arm/include/asm/system.h552
-rw-r--r--arch/arm/include/asm/system_info.h27
-rw-r--r--arch/arm/include/asm/system_misc.h29
-rw-r--r--arch/arm/include/asm/uaccess.h2
-rw-r--r--arch/arm/kernel/armksyms.c1
-rw-r--r--arch/arm/kernel/elf.c1
-rw-r--r--arch/arm/kernel/entry-armv.S2
-rw-r--r--arch/arm/kernel/fiq.c2
-rw-r--r--arch/arm/kernel/head-nommu.S2
-rw-r--r--arch/arm/kernel/head.S2
-rw-r--r--arch/arm/kernel/hw_breakpoint.c1
-rw-r--r--arch/arm/kernel/irq.c1
-rw-r--r--arch/arm/kernel/kprobes-common.c1
-rw-r--r--arch/arm/kernel/machine_kexec.c2
-rw-r--r--arch/arm/kernel/process.c1
-rw-r--r--arch/arm/kernel/ptrace.c1
-rw-r--r--arch/arm/kernel/setup.c4
-rw-r--r--arch/arm/kernel/sleep.S1
-rw-r--r--arch/arm/kernel/tcm.c1
-rw-r--r--arch/arm/kernel/thumbee.c1
-rw-r--r--arch/arm/kernel/traps.c2
-rw-r--r--arch/arm/mach-at91/at91rm9200.c1
-rw-r--r--arch/arm/mach-at91/at91sam9260.c1
-rw-r--r--arch/arm/mach-at91/at91sam9261.c1
-rw-r--r--arch/arm/mach-at91/at91sam9263.c1
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c1
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c1
-rw-r--r--arch/arm/mach-at91/include/mach/system_rev.h2
-rw-r--r--arch/arm/mach-clps711x/common.c1
-rw-r--r--arch/arm/mach-clps711x/p720t-leds.c1
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c1
-rw-r--r--arch/arm/mach-ebsa110/core.c2
-rw-r--r--arch/arm/mach-ebsa110/leds.c1
-rw-r--r--arch/arm/mach-exynos/hotplug.c1
-rw-r--r--arch/arm/mach-footbridge/common.c1
-rw-r--r--arch/arm/mach-footbridge/dc21285-timer.c1
-rw-r--r--arch/arm/mach-footbridge/dc21285.c1
-rw-r--r--arch/arm/mach-footbridge/ebsa285-leds.c1
-rw-r--r--arch/arm/mach-footbridge/netwinder-hw.c1
-rw-r--r--arch/arm/mach-footbridge/netwinder-leds.c1
-rw-r--r--arch/arm/mach-imx/dma-v1.c1
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c1
-rw-r--r--arch/arm/mach-imx/mach-mx51_efikamx.c1
-rw-r--r--arch/arm/mach-imx/mach-mx51_efikasb.c1
-rw-r--r--arch/arm/mach-integrator/core.c1
-rw-r--r--arch/arm/mach-integrator/leds.c1
-rw-r--r--arch/arm/mach-integrator/pci.c1
-rw-r--r--arch/arm/mach-integrator/pci_v3.c1
-rw-r--r--arch/arm/mach-iop33x/uart.c1
-rw-r--r--arch/arm/mach-ixp2000/core.c1
-rw-r--r--arch/arm/mach-ixp2000/enp2611.c1
-rw-r--r--arch/arm/mach-ixp2000/ixdp2400.c1
-rw-r--r--arch/arm/mach-ixp2000/ixdp2800.c1
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x00.c1
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x01.c1
-rw-r--r--arch/arm/mach-ixp2000/pci.c1
-rw-r--r--arch/arm/mach-ixp23xx/core.c1
-rw-r--r--arch/arm/mach-ixp23xx/espresso.c1
-rw-r--r--arch/arm/mach-ixp23xx/ixdp2351.c1
-rw-r--r--arch/arm/mach-ixp23xx/pci.c1
-rw-r--r--arch/arm/mach-ixp23xx/roadrunner.c1
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c1
-rw-r--r--arch/arm/mach-ixp4xx/goramo_mlr.c1
-rw-r--r--arch/arm/mach-ks8695/time.c1
-rw-r--r--arch/arm/mach-mmp/common.c1
-rw-r--r--arch/arm/mach-mmp/pxa168.c1
-rw-r--r--arch/arm/mach-msm/board-sapphire.c1
-rw-r--r--arch/arm/mach-mxs/system.c2
-rw-r--r--arch/arm/mach-omap1/id.c1
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c1
-rw-r--r--arch/arm/mach-omap1/leds-innovator.c1
-rw-r--r--arch/arm/mach-omap1/leds-osk.c1
-rw-r--r--arch/arm/mach-omap1/mux.c1
-rw-r--r--arch/arm/mach-omap1/time.c1
-rw-r--r--arch/arm/mach-omap1/timer32k.c1
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c1
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c1
-rw-r--r--arch/arm/mach-omap2/mux.c1
-rw-r--r--arch/arm/mach-omap2/omap-mpuss-lowpower.c1
-rw-r--r--arch/arm/mach-omap2/pm24xx.c1
-rw-r--r--arch/arm/mach-omap2/pm34xx.c1
-rw-r--r--arch/arm/mach-omap2/pm44xx.c1
-rw-r--r--arch/arm/mach-omap2/sleep44xx.S1
-rw-r--r--arch/arm/mach-orion5x/common.c1
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c1
-rw-r--r--arch/arm/mach-orion5x/ls-chl-setup.c1
-rw-r--r--arch/arm/mach-orion5x/ls_hgl-setup.c1
-rw-r--r--arch/arm/mach-orion5x/lsmini-setup.c1
-rw-r--r--arch/arm/mach-pnx4008/core.c2
-rw-r--r--arch/arm/mach-pnx4008/dma.c1
-rw-r--r--arch/arm/mach-pnx4008/irq.c1
-rw-r--r--arch/arm/mach-pnx4008/time.c1
-rw-r--r--arch/arm/mach-pxa/cm-x300.c1
-rw-r--r--arch/arm/mach-pxa/colibri-pxa3xx.c1
-rw-r--r--arch/arm/mach-pxa/corgi.c1
-rw-r--r--arch/arm/mach-pxa/generic.c1
-rw-r--r--arch/arm/mach-pxa/leds-idp.c1
-rw-r--r--arch/arm/mach-pxa/leds-lubbock.c1
-rw-r--r--arch/arm/mach-pxa/leds-mainstone.c1
-rw-r--r--arch/arm/mach-pxa/magician.c1
-rw-r--r--arch/arm/mach-pxa/poodle.c1
-rw-r--r--arch/arm/mach-pxa/reset.c1
-rw-r--r--arch/arm/mach-pxa/viper.c1
-rw-r--r--arch/arm/mach-pxa/zeus.c1
-rw-r--r--arch/arm/mach-realview/core.c1
-rw-r--r--arch/arm/mach-realview/hotplug.c1
-rw-r--r--arch/arm/mach-rpc/riscpc.c1
-rw-r--r--arch/arm/mach-s3c24xx/s3c2410.c1
-rw-r--r--arch/arm/mach-s3c24xx/s3c2412.c1
-rw-r--r--arch/arm/mach-s3c24xx/s3c2416.c1
-rw-r--r--arch/arm/mach-s3c24xx/s3c2443.c1
-rw-r--r--arch/arm/mach-s3c24xx/s3c244x.c1
-rw-r--r--arch/arm/mach-s3c64xx/common.c1
-rw-r--r--arch/arm/mach-s5p64x0/common.c1
-rw-r--r--arch/arm/mach-s5pc100/common.c1
-rw-r--r--arch/arm/mach-sa1100/generic.c2
-rw-r--r--arch/arm/mach-sa1100/leds-assabet.c1
-rw-r--r--arch/arm/mach-sa1100/leds-badge4.c1
-rw-r--r--arch/arm/mach-sa1100/leds-cerf.c1
-rw-r--r--arch/arm/mach-sa1100/leds-hackkit.c1
-rw-r--r--arch/arm/mach-sa1100/leds-lart.c1
-rw-r--r--arch/arm/mach-sa1100/pm.c1
-rw-r--r--arch/arm/mach-shark/leds.c1
-rw-r--r--arch/arm/mach-shmobile/cpuidle.c1
-rw-r--r--arch/arm/mach-shmobile/include/mach/system.h2
-rw-r--r--arch/arm/mach-shmobile/pm-r8a7779.c1
-rw-r--r--arch/arm/mach-shmobile/pm-sh7372.c1
-rw-r--r--arch/arm/mach-shmobile/suspend.c2
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.c1
-rw-r--r--arch/arm/mach-tegra/hotplug.c1
-rw-r--r--arch/arm/mach-versatile/core.c1
-rw-r--r--arch/arm/mach-versatile/pci.c1
-rw-r--r--arch/arm/mach-vexpress/hotplug.c2
-rw-r--r--arch/arm/mach-w90x900/cpu.c1
-rw-r--r--arch/arm/mm/alignment.c3
-rw-r--r--arch/arm/mm/cache-feroceon-l2.c1
-rw-r--r--arch/arm/mm/cache-tauros2.c1
-rw-r--r--arch/arm/mm/cache-xsc3l2.c2
-rw-r--r--arch/arm/mm/fault.c3
-rw-r--r--arch/arm/mm/flush.c1
-rw-r--r--arch/arm/mm/idmap.c1
-rw-r--r--arch/arm/mm/ioremap.c2
-rw-r--r--arch/arm/mm/mmu.c2
-rw-r--r--arch/arm/mm/pgd.c1
-rw-r--r--arch/arm/mm/proc-fa526.S1
-rw-r--r--arch/arm/nwfpe/fpa11.c1
-rw-r--r--arch/arm/plat-iop/i2c.c1
-rw-r--r--arch/arm/plat-iop/pci.c1
-rw-r--r--arch/arm/plat-iop/restart.c1
-rw-r--r--arch/arm/plat-mxc/system.c2
-rw-r--r--arch/arm/plat-omap/debug-leds.c1
-rw-r--r--arch/arm/plat-omap/dma.c1
-rw-r--r--arch/arm/plat-pxa/dma.c1
-rw-r--r--arch/arm/plat-s3c24xx/cpu.c1
-rw-r--r--arch/arm/plat-s3c24xx/dma.c1
-rw-r--r--arch/arm/plat-samsung/cpu.c1
-rw-r--r--arch/arm/plat-samsung/time.c1
-rw-r--r--arch/arm/plat-spear/restart.c1
-rw-r--r--arch/arm/vfp/vfpmodule.c2
-rw-r--r--arch/avr32/include/asm/atomic.h2
-rw-r--r--arch/avr32/include/asm/barrier.h27
-rw-r--r--arch/avr32/include/asm/bitops.h1
-rw-r--r--arch/avr32/include/asm/bug.h5
-rw-r--r--arch/avr32/include/asm/cmpxchg.h (renamed from arch/avr32/include/asm/system.h)79
-rw-r--r--arch/avr32/include/asm/exec.h13
-rw-r--r--arch/avr32/include/asm/special_insns.h13
-rw-r--r--arch/avr32/include/asm/switch_to.h46
-rw-r--r--arch/avr32/mach-at32ap/cpufreq.c1
-rw-r--r--arch/avr32/oprofile/op_model_avr32.c1
-rw-r--r--arch/blackfin/include/asm/system.h5
-rw-r--r--arch/c6x/include/asm/Kbuild1
-rw-r--r--arch/c6x/include/asm/barrier.h27
-rw-r--r--arch/c6x/include/asm/bitops.h1
-rw-r--r--arch/c6x/include/asm/bug.h23
-rw-r--r--arch/c6x/include/asm/cmpxchg.h68
-rw-r--r--arch/c6x/include/asm/exec.h6
-rw-r--r--arch/c6x/include/asm/processor.h9
-rw-r--r--arch/c6x/include/asm/setup.h1
-rw-r--r--arch/c6x/include/asm/special_insns.h63
-rw-r--r--arch/c6x/include/asm/switch_to.h33
-rw-r--r--arch/c6x/include/asm/system.h168
-rw-r--r--arch/c6x/kernel/irq.c1
-rw-r--r--arch/c6x/kernel/setup.c1
-rw-r--r--arch/c6x/kernel/soc.c1
-rw-r--r--arch/c6x/kernel/time.c1
-rw-r--r--arch/c6x/kernel/traps.c1
-rw-r--r--arch/c6x/platforms/timer64.c1
-rw-r--r--arch/cris/arch-v10/drivers/ds1302.c1
-rw-r--r--arch/cris/arch-v10/drivers/gpio.c1
-rw-r--r--arch/cris/arch-v10/drivers/i2c.c1
-rw-r--r--arch/cris/arch-v10/drivers/pcf8563.c1
-rw-r--r--arch/cris/arch-v10/drivers/sync_serial.c1
-rw-r--r--arch/cris/arch-v10/kernel/debugport.c1
-rw-r--r--arch/cris/arch-v10/kernel/dma.c1
-rw-r--r--arch/cris/arch-v10/kernel/io_interface_mux.c1
-rw-r--r--arch/cris/arch-v10/kernel/process.c1
-rw-r--r--arch/cris/arch-v10/kernel/ptrace.c1
-rw-r--r--arch/cris/arch-v10/kernel/setup.c1
-rw-r--r--arch/cris/arch-v10/kernel/signal.c1
-rw-r--r--arch/cris/arch-v10/kernel/traps.c1
-rw-r--r--arch/cris/arch-v32/drivers/i2c.c1
-rw-r--r--arch/cris/arch-v32/drivers/mach-a3/gpio.c1
-rw-r--r--arch/cris/arch-v32/drivers/mach-fs/gpio.c1
-rw-r--r--arch/cris/arch-v32/kernel/debugport.c1
-rw-r--r--arch/cris/arch-v32/kernel/fasttimer.c1
-rw-r--r--arch/cris/arch-v32/kernel/ptrace.c1
-rw-r--r--arch/cris/arch-v32/mach-a3/dma.c1
-rw-r--r--arch/cris/arch-v32/mach-fs/dma.c1
-rw-r--r--arch/cris/include/arch-v10/arch/elf.h2
-rw-r--r--arch/cris/include/arch-v32/arch/elf.h2
-rw-r--r--arch/cris/include/arch-v32/arch/system.h10
-rw-r--r--arch/cris/include/asm/atomic.h2
-rw-r--r--arch/cris/include/asm/barrier.h25
-rw-r--r--arch/cris/include/asm/bitops.h1
-rw-r--r--arch/cris/include/asm/cmpxchg.h (renamed from arch/cris/include/asm/system.h)52
-rw-r--r--arch/cris/include/asm/exec.h6
-rw-r--r--arch/cris/include/asm/processor.h11
-rw-r--r--arch/cris/include/asm/switch_to.h12
-rw-r--r--arch/cris/kernel/irq.c1
-rw-r--r--arch/cris/kernel/process.c1
-rw-r--r--arch/cris/kernel/ptrace.c1
-rw-r--r--arch/cris/kernel/setup.c1
-rw-r--r--arch/cris/kernel/traps.c1
-rw-r--r--arch/cris/mm/fault.c1
-rw-r--r--arch/frv/include/asm/atomic.h57
-rw-r--r--arch/frv/include/asm/barrier.h29
-rw-r--r--arch/frv/include/asm/bug.h2
-rw-r--r--arch/frv/include/asm/cmpxchg.h (renamed from arch/frv/include/asm/system.h)98
-rw-r--r--arch/frv/include/asm/exec.h17
-rw-r--r--arch/frv/include/asm/switch_to.h35
-rw-r--r--arch/frv/kernel/debug-stub.c1
-rw-r--r--arch/frv/kernel/gdb-io.c1
-rw-r--r--arch/frv/kernel/gdb-stub.c1
-rw-r--r--arch/frv/kernel/irq-mb93091.c1
-rw-r--r--arch/frv/kernel/irq-mb93093.c1
-rw-r--r--arch/frv/kernel/irq-mb93493.c1
-rw-r--r--arch/frv/kernel/irq.c1
-rw-r--r--arch/frv/kernel/process.c1
-rw-r--r--arch/frv/kernel/ptrace.c1
-rw-r--r--arch/frv/kernel/traps.c1
-rw-r--r--arch/frv/mm/fault.c1
-rw-r--r--arch/frv/mm/init.c1
-rw-r--r--arch/frv/mm/kmap.c1
-rw-r--r--arch/h8300/include/asm/atomic.h4
-rw-r--r--arch/h8300/include/asm/barrier.h27
-rw-r--r--arch/h8300/include/asm/bitops.h1
-rw-r--r--arch/h8300/include/asm/bug.h4
-rw-r--r--arch/h8300/include/asm/cmpxchg.h60
-rw-r--r--arch/h8300/include/asm/exec.h6
-rw-r--r--arch/h8300/include/asm/processor.h5
-rw-r--r--arch/h8300/include/asm/switch_to.h50
-rw-r--r--arch/h8300/include/asm/system.h140
-rw-r--r--arch/h8300/kernel/irq.c1
-rw-r--r--arch/h8300/kernel/process.c1
-rw-r--r--arch/h8300/kernel/ptrace.c1
-rw-r--r--arch/h8300/kernel/traps.c1
-rw-r--r--arch/h8300/mm/fault.c1
-rw-r--r--arch/h8300/mm/init.c1
-rw-r--r--arch/h8300/mm/kmap.c1
-rw-r--r--arch/h8300/mm/memory.c1
-rw-r--r--arch/hexagon/include/asm/atomic.h1
-rw-r--r--arch/hexagon/include/asm/barrier.h41
-rw-r--r--arch/hexagon/include/asm/bitops.h1
-rw-r--r--arch/hexagon/include/asm/cmpxchg.h (renamed from arch/hexagon/include/asm/system.h)46
-rw-r--r--arch/hexagon/include/asm/exec.h28
-rw-r--r--arch/hexagon/include/asm/switch_to.h34
-rw-r--r--arch/hexagon/kernel/ptrace.c1
-rw-r--r--arch/hexagon/kernel/smp.c1
-rw-r--r--arch/hexagon/kernel/vm_events.c1
-rw-r--r--arch/ia64/dig/setup.c2
-rw-r--r--arch/ia64/hp/common/sba_iommu.c1
-rw-r--r--arch/ia64/hp/sim/boot/bootloader.c1
-rw-r--r--arch/ia64/hp/sim/boot/fw-emu.c1
-rw-r--r--arch/ia64/hp/sim/simeth.c1
-rw-r--r--arch/ia64/include/asm/acpi.h1
-rw-r--r--arch/ia64/include/asm/atomic.h1
-rw-r--r--arch/ia64/include/asm/auxvec.h2
-rw-r--r--arch/ia64/include/asm/barrier.h68
-rw-r--r--arch/ia64/include/asm/exec.h14
-rw-r--r--arch/ia64/include/asm/futex.h1
-rw-r--r--arch/ia64/include/asm/io.h1
-rw-r--r--arch/ia64/include/asm/irqflags.h2
-rw-r--r--arch/ia64/include/asm/kexec.h1
-rw-r--r--arch/ia64/include/asm/mca_asm.h2
-rw-r--r--arch/ia64/include/asm/page.h10
-rw-r--r--arch/ia64/include/asm/pci.h8
-rw-r--r--arch/ia64/include/asm/pgtable.h1
-rw-r--r--arch/ia64/include/asm/processor.h8
-rw-r--r--arch/ia64/include/asm/sal.h1
-rw-r--r--arch/ia64/include/asm/setup.h18
-rw-r--r--arch/ia64/include/asm/sn/pda.h1
-rw-r--r--arch/ia64/include/asm/spinlock.h1
-rw-r--r--arch/ia64/include/asm/switch_to.h87
-rw-r--r--arch/ia64/include/asm/system.h203
-rw-r--r--arch/ia64/include/asm/uv/uv.h1
-rw-r--r--arch/ia64/kernel/acpi.c1
-rw-r--r--arch/ia64/kernel/efi.c1
-rw-r--r--arch/ia64/kernel/fsys.S1
-rw-r--r--arch/ia64/kernel/gate.S3
-rw-r--r--arch/ia64/kernel/gate.lds.S3
-rw-r--r--arch/ia64/kernel/head.S1
-rw-r--r--arch/ia64/kernel/iosapic.c1
-rw-r--r--arch/ia64/kernel/irq_ia64.c1
-rw-r--r--arch/ia64/kernel/ivt.S1
-rw-r--r--arch/ia64/kernel/machvec.c1
-rw-r--r--arch/ia64/kernel/mca.c1
-rw-r--r--arch/ia64/kernel/mca_drv.c1
-rw-r--r--arch/ia64/kernel/patch.c1
-rw-r--r--arch/ia64/kernel/pci-dma.c1
-rw-r--r--arch/ia64/kernel/perfmon.c1
-rw-r--r--arch/ia64/kernel/ptrace.c1
-rw-r--r--arch/ia64/kernel/setup.c1
-rw-r--r--arch/ia64/kernel/smp.c1
-rw-r--r--arch/ia64/kernel/smpboot.c1
-rw-r--r--arch/ia64/kernel/time.c1
-rw-r--r--arch/ia64/kernel/traps.c1
-rw-r--r--arch/ia64/kernel/uncached.c1
-rw-r--r--arch/ia64/kernel/unwind.c1
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S1
-rw-r--r--arch/ia64/mm/fault.c1
-rw-r--r--arch/ia64/mm/init.c1
-rw-r--r--arch/ia64/oprofile/backtrace.c1
-rw-r--r--arch/ia64/pci/pci.c1
-rw-r--r--arch/ia64/sn/kernel/setup.c2
-rw-r--r--arch/ia64/sn/kernel/sn2/prominfo_proc.c1
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c1
-rw-r--r--arch/ia64/sn/kernel/sn2/timer.c1
-rw-r--r--arch/ia64/sn/kernel/tiocx.c1
-rw-r--r--arch/ia64/xen/xensetup.S1
-rw-r--r--arch/m32r/include/asm/atomic.h3
-rw-r--r--arch/m32r/include/asm/barrier.h94
-rw-r--r--arch/m32r/include/asm/bitops.h3
-rw-r--r--arch/m32r/include/asm/cmpxchg.h221
-rw-r--r--arch/m32r/include/asm/dcache_clear.h29
-rw-r--r--arch/m32r/include/asm/exec.h14
-rw-r--r--arch/m32r/include/asm/local.h1
-rw-r--r--arch/m32r/include/asm/spinlock.h1
-rw-r--r--arch/m32r/include/asm/switch_to.h51
-rw-r--r--arch/m32r/include/asm/system.h367
-rw-r--r--arch/m32r/kernel/ptrace.c1
-rw-r--r--arch/m32r/kernel/traps.c1
-rw-r--r--arch/m32r/mm/fault-nommu.c1
-rw-r--r--arch/m32r/mm/fault.c1
-rw-r--r--arch/m32r/platforms/m32104ut/setup.c1
-rw-r--r--arch/m32r/platforms/m32700ut/setup.c1
-rw-r--r--arch/m32r/platforms/mappi/setup.c1
-rw-r--r--arch/m32r/platforms/mappi2/setup.c1
-rw-r--r--arch/m32r/platforms/mappi3/setup.c1
-rw-r--r--arch/m32r/platforms/oaks32r/setup.c1
-rw-r--r--arch/m32r/platforms/opsput/setup.c1
-rw-r--r--arch/m32r/platforms/usrv/setup.c1
-rw-r--r--arch/m68k/amiga/amisound.c1
-rw-r--r--arch/m68k/amiga/config.c1
-rw-r--r--arch/m68k/apollo/config.c1
-rw-r--r--arch/m68k/atari/ataints.c1
-rw-r--r--arch/m68k/atari/atasound.c1
-rw-r--r--arch/m68k/atari/config.c1
-rw-r--r--arch/m68k/bvme6000/config.c1
-rw-r--r--arch/m68k/bvme6000/rtc.c1
-rw-r--r--arch/m68k/hp300/time.c1
-rw-r--r--arch/m68k/include/asm/atomic.h2
-rw-r--r--arch/m68k/include/asm/barrier.h20
-rw-r--r--arch/m68k/include/asm/cmpxchg.h (renamed from arch/m68k/include/asm/system.h)95
-rw-r--r--arch/m68k/include/asm/exec.h6
-rw-r--r--arch/m68k/include/asm/sun3xflop.h1
-rw-r--r--arch/m68k/include/asm/switch_to.h41
-rw-r--r--arch/m68k/kernel/ints.c1
-rw-r--r--arch/m68k/kernel/irq.c1
-rw-r--r--arch/m68k/kernel/process.c1
-rw-r--r--arch/m68k/kernel/ptrace.c1
-rw-r--r--arch/m68k/kernel/traps.c1
-rw-r--r--arch/m68k/kernel/vectors.c1
-rw-r--r--arch/m68k/mac/config.c1
-rw-r--r--arch/m68k/mac/misc.c1
-rw-r--r--arch/m68k/mm/fault.c1
-rw-r--r--arch/m68k/mm/init_mm.c1
-rw-r--r--arch/m68k/mm/init_no.c1
-rw-r--r--arch/m68k/mm/kmap.c1
-rw-r--r--arch/m68k/mm/memory.c1
-rw-r--r--arch/m68k/mm/motorola.c1
-rw-r--r--arch/m68k/mm/sun3mmu.c1
-rw-r--r--arch/m68k/mvme147/config.c1
-rw-r--r--arch/m68k/mvme16x/config.c1
-rw-r--r--arch/m68k/mvme16x/rtc.c1
-rw-r--r--arch/m68k/platform/68328/config.c1
-rw-r--r--arch/m68k/platform/68328/timers.c1
-rw-r--r--arch/m68k/platform/68360/config.c1
-rw-r--r--arch/m68k/platform/68EZ328/config.c1
-rw-r--r--arch/m68k/platform/68VZ328/config.c1
-rw-r--r--arch/m68k/q40/config.c1
-rw-r--r--arch/m68k/q40/q40ints.c1
-rw-r--r--arch/m68k/sun3/intersil.c1
-rw-r--r--arch/m68k/sun3/mmu_emu.c1
-rw-r--r--arch/m68k/sun3/prom/console.c1
-rw-r--r--arch/m68k/sun3x/config.c1
-rw-r--r--arch/m68k/sun3x/time.c1
-rw-r--r--arch/microblaze/include/asm/atomic.h1
-rw-r--r--arch/microblaze/include/asm/barrier.h27
-rw-r--r--arch/microblaze/include/asm/cmpxchg.h40
-rw-r--r--arch/microblaze/include/asm/exec.h14
-rw-r--r--arch/microblaze/include/asm/page.h2
-rw-r--r--arch/microblaze/include/asm/processor.h11
-rw-r--r--arch/microblaze/include/asm/setup.h6
-rw-r--r--arch/microblaze/include/asm/switch_to.h24
-rw-r--r--arch/microblaze/include/asm/system.h98
-rw-r--r--arch/microblaze/kernel/cpu/pvr.c1
-rw-r--r--arch/microblaze/kernel/microblaze_ksyms.c1
-rw-r--r--arch/microblaze/kernel/process.c1
-rw-r--r--arch/microblaze/kernel/prom.c1
-rw-r--r--arch/microblaze/kernel/setup.c1
-rw-r--r--arch/microblaze/kernel/timer.c1
-rw-r--r--arch/microblaze/kernel/traps.c1
-rw-r--r--arch/microblaze/lib/memcpy.c1
-rw-r--r--arch/microblaze/mm/fault.c1
-rw-r--r--arch/mips/cavium-octeon/setup.c1
-rw-r--r--arch/mips/cavium-octeon/smp.c2
-rw-r--r--arch/mips/dec/ecc-berr.c1
-rw-r--r--arch/mips/dec/kn01-berr.c1
-rw-r--r--arch/mips/dec/kn02xa-berr.c1
-rw-r--r--arch/mips/dec/wbflush.c2
-rw-r--r--arch/mips/emma/markeins/irq.c1
-rw-r--r--arch/mips/fw/arc/misc.c1
-rw-r--r--arch/mips/include/asm/atomic.h2
-rw-r--r--arch/mips/include/asm/barrier.h2
-rw-r--r--arch/mips/include/asm/cmpxchg.h124
-rw-r--r--arch/mips/include/asm/dma.h1
-rw-r--r--arch/mips/include/asm/exec.h17
-rw-r--r--arch/mips/include/asm/mach-au1x00/au1000_dma.h1
-rw-r--r--arch/mips/include/asm/processor.h7
-rw-r--r--arch/mips/include/asm/setup.h11
-rw-r--r--arch/mips/include/asm/switch_to.h85
-rw-r--r--arch/mips/include/asm/system.h235
-rw-r--r--arch/mips/include/asm/txx9/jmr3927.h1
-rw-r--r--arch/mips/kernel/cpu-bugs64.c2
-rw-r--r--arch/mips/kernel/cpu-probe.c1
-rw-r--r--arch/mips/kernel/irq-rm7000.c1
-rw-r--r--arch/mips/kernel/irq-rm9000.c1
-rw-r--r--arch/mips/kernel/irq.c1
-rw-r--r--arch/mips/kernel/irq_cpu.c1
-rw-r--r--arch/mips/kernel/mips-mt.c1
-rw-r--r--arch/mips/kernel/process.c1
-rw-r--r--arch/mips/kernel/ptrace.c1
-rw-r--r--arch/mips/kernel/ptrace32.c1
-rw-r--r--arch/mips/kernel/rtlx.c1
-rw-r--r--arch/mips/kernel/setup.c1
-rw-r--r--arch/mips/kernel/signal.c1
-rw-r--r--arch/mips/kernel/signal32.c2
-rw-r--r--arch/mips/kernel/signal_n32.c1
-rw-r--r--arch/mips/kernel/smp-bmips.c1
-rw-r--r--arch/mips/kernel/smp-cmp.c1
-rw-r--r--arch/mips/kernel/smp-mt.c1
-rw-r--r--arch/mips/kernel/smp.c2
-rw-r--r--arch/mips/kernel/smtc-proc.c1
-rw-r--r--arch/mips/kernel/smtc.c1
-rw-r--r--arch/mips/kernel/spram.c1
-rw-r--r--arch/mips/kernel/syscall.c1
-rw-r--r--arch/mips/kernel/traps.c1
-rw-r--r--arch/mips/kernel/unaligned.c1
-rw-r--r--arch/mips/kernel/vpe.c1
-rw-r--r--arch/mips/lasat/reset.c1
-rw-r--r--arch/mips/math-emu/dsemul.c1
-rw-r--r--arch/mips/mipssim/sim_smtc.c1
-rw-r--r--arch/mips/mipssim/sim_time.c1
-rw-r--r--arch/mips/mm/c-octeon.c1
-rw-r--r--arch/mips/mm/c-r3k.c1
-rw-r--r--arch/mips/mm/c-r4k.c1
-rw-r--r--arch/mips/mm/c-tx39.c1
-rw-r--r--arch/mips/mm/fault.c1
-rw-r--r--arch/mips/mm/page.c1
-rw-r--r--arch/mips/mm/sc-ip22.c1
-rw-r--r--arch/mips/mm/sc-mips.c1
-rw-r--r--arch/mips/mm/sc-r5k.c1
-rw-r--r--arch/mips/mm/tlb-r3k.c1
-rw-r--r--arch/mips/mm/tlb-r4k.c1
-rw-r--r--arch/mips/mm/tlb-r8k.c1
-rw-r--r--arch/mips/mm/tlbex.c1
-rw-r--r--arch/mips/mti-malta/malta-init.c1
-rw-r--r--arch/mips/mti-malta/malta-int.c1
-rw-r--r--arch/mips/mti-malta/malta-time.c1
-rw-r--r--arch/mips/netlogic/common/irq.c1
-rw-r--r--arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c1
-rw-r--r--arch/mips/pmc-sierra/msp71xx/msp_irq_per.c1
-rw-r--r--arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c1
-rw-r--r--arch/mips/pmc-sierra/yosemite/irq.c1
-rw-r--r--arch/mips/pmc-sierra/yosemite/prom.c1
-rw-r--r--arch/mips/pnx833x/common/interrupts.c1
-rw-r--r--arch/mips/powertv/asic/asic_int.c1
-rw-r--r--arch/mips/powertv/asic/irq_asic.c1
-rw-r--r--arch/mips/powertv/init.c1
-rw-r--r--arch/mips/rb532/irq.c1
-rw-r--r--arch/mips/sgi-ip22/ip22-berr.c1
-rw-r--r--arch/mips/sgi-ip22/ip22-reset.c1
-rw-r--r--arch/mips/sgi-ip22/ip28-berr.c1
-rw-r--r--arch/mips/sgi-ip27/ip27-irq.c1
-rw-r--r--arch/mips/sgi-ip27/ip27-reset.c1
-rw-r--r--arch/mips/sgi-ip32/ip32-irq.c1
-rw-r--r--arch/mips/sgi-ip32/ip32-reset.c1
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c1
-rw-r--r--arch/mips/sibyte/common/sb_tbprof.c1
-rw-r--r--arch/mips/sibyte/sb1250/bus_watcher.c1
-rw-r--r--arch/mips/sibyte/sb1250/irq.c1
-rw-r--r--arch/mips/sni/reset.c1
-rw-r--r--arch/mips/vr41xx/common/irq.c1
-rw-r--r--arch/mips/vr41xx/common/pmu.c1
-rw-r--r--arch/mn10300/include/asm/atomic.h109
-rw-r--r--arch/mn10300/include/asm/barrier.h37
-rw-r--r--arch/mn10300/include/asm/cmpxchg.h115
-rw-r--r--arch/mn10300/include/asm/dma.h1
-rw-r--r--arch/mn10300/include/asm/exec.h16
-rw-r--r--arch/mn10300/include/asm/switch_to.h49
-rw-r--r--arch/mn10300/include/asm/system.h102
-rw-r--r--arch/mn10300/kernel/entry.S1
-rw-r--r--arch/mn10300/kernel/fpu.c1
-rw-r--r--arch/mn10300/kernel/gdb-io-serial.c1
-rw-r--r--arch/mn10300/kernel/gdb-io-ttysm.c1
-rw-r--r--arch/mn10300/kernel/gdb-stub.c1
-rw-r--r--arch/mn10300/kernel/mn10300-serial.c1
-rw-r--r--arch/mn10300/kernel/mn10300-watchdog.c1
-rw-r--r--arch/mn10300/kernel/process.c1
-rw-r--r--arch/mn10300/kernel/ptrace.c1
-rw-r--r--arch/mn10300/kernel/setup.c1
-rw-r--r--arch/mn10300/kernel/smp-low.S2
-rw-r--r--arch/mn10300/kernel/smp.c1
-rw-r--r--arch/mn10300/kernel/traps.c1
-rw-r--r--arch/mn10300/lib/bitops.c1
-rw-r--r--arch/mn10300/mm/fault.c1
-rw-r--r--arch/mn10300/mm/init.c1
-rw-r--r--arch/mn10300/mm/misalignment.c1
-rw-r--r--arch/mn10300/mm/pgtable.c1
-rw-r--r--arch/mn10300/mm/tlb-smp.c1
-rw-r--r--arch/mn10300/proc-mn2ws0050/proc-init.c1
-rw-r--r--arch/openrisc/include/asm/Kbuild3
-rw-r--r--arch/openrisc/include/asm/system.h35
-rw-r--r--arch/openrisc/kernel/idle.c1
-rw-r--r--arch/openrisc/kernel/process.c1
-rw-r--r--arch/openrisc/kernel/prom.c1
-rw-r--r--arch/openrisc/kernel/ptrace.c1
-rw-r--r--arch/openrisc/kernel/setup.c1
-rw-r--r--arch/openrisc/kernel/traps.c1
-rw-r--r--arch/openrisc/mm/init.c1
-rw-r--r--arch/openrisc/mm/tlb.c1
-rw-r--r--arch/parisc/include/asm/atomic.h1
-rw-r--r--arch/parisc/include/asm/barrier.h35
-rw-r--r--arch/parisc/include/asm/delay.h2
-rw-r--r--arch/parisc/include/asm/dma.h1
-rw-r--r--arch/parisc/include/asm/exec.h6
-rw-r--r--arch/parisc/include/asm/ldcw.h48
-rw-r--r--arch/parisc/include/asm/processor.h2
-rw-r--r--arch/parisc/include/asm/psw.h41
-rw-r--r--arch/parisc/include/asm/special_insns.h40
-rw-r--r--arch/parisc/include/asm/spinlock.h1
-rw-r--r--arch/parisc/include/asm/switch_to.h12
-rw-r--r--arch/parisc/include/asm/system.h165
-rw-r--r--arch/parisc/include/asm/thread_info.h1
-rw-r--r--arch/parisc/include/asm/timex.h1
-rw-r--r--arch/parisc/include/asm/uaccess.h1
-rw-r--r--arch/parisc/kernel/cache.c1
-rw-r--r--arch/parisc/kernel/firmware.c1
-rw-r--r--arch/parisc/kernel/pci.c1
-rw-r--r--arch/parisc/kernel/ptrace.c1
-rw-r--r--arch/parisc/kernel/smp.c1
-rw-r--r--arch/parisc/kernel/traps.c1
-rw-r--r--arch/parisc/lib/bitops.c1
-rw-r--r--arch/powerpc/include/asm/atomic.h8
-rw-r--r--arch/powerpc/include/asm/auxvec.h2
-rw-r--r--arch/powerpc/include/asm/barrier.h68
-rw-r--r--arch/powerpc/include/asm/bug.h11
-rw-r--r--arch/powerpc/include/asm/cache.h16
-rw-r--r--arch/powerpc/include/asm/cmpxchg.h309
-rw-r--r--arch/powerpc/include/asm/debug.h56
-rw-r--r--arch/powerpc/include/asm/dma.h1
-rw-r--r--arch/powerpc/include/asm/exec.h9
-rw-r--r--arch/powerpc/include/asm/hw_breakpoint.h2
-rw-r--r--arch/powerpc/include/asm/processor.h30
-rw-r--r--arch/powerpc/include/asm/reg_booke.h5
-rw-r--r--arch/powerpc/include/asm/rtas.h2
-rw-r--r--arch/powerpc/include/asm/runlatch.h45
-rw-r--r--arch/powerpc/include/asm/setup.h24
-rw-r--r--arch/powerpc/include/asm/switch_to.h65
-rw-r--r--arch/powerpc/include/asm/system.h592
-rw-r--r--arch/powerpc/kernel/align.c2
-rw-r--r--arch/powerpc/kernel/cputable.c1
-rw-r--r--arch/powerpc/kernel/crash.c2
-rw-r--r--arch/powerpc/kernel/idle.c2
-rw-r--r--arch/powerpc/kernel/irq.c2
-rw-r--r--arch/powerpc/kernel/kprobes.c1
-rw-r--r--arch/powerpc/kernel/lparcfg.c1
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c2
-rw-r--r--arch/powerpc/kernel/process.c4
-rw-r--r--arch/powerpc/kernel/prom.c1
-rw-r--r--arch/powerpc/kernel/prom_init.c1
-rw-r--r--arch/powerpc/kernel/ptrace.c2
-rw-r--r--arch/powerpc/kernel/ptrace32.c2
-rw-r--r--arch/powerpc/kernel/rtas.c1
-rw-r--r--arch/powerpc/kernel/setup-common.c1
-rw-r--r--arch/powerpc/kernel/setup_32.c1
-rw-r--r--arch/powerpc/kernel/setup_64.c1
-rw-r--r--arch/powerpc/kernel/signal.c1
-rw-r--r--arch/powerpc/kernel/signal_32.c1
-rw-r--r--arch/powerpc/kernel/signal_64.c1
-rw-r--r--arch/powerpc/kernel/smp.c2
-rw-r--r--arch/powerpc/kernel/softemu8xx.c1
-rw-r--r--arch/powerpc/kernel/swsusp.c2
-rw-r--r--arch/powerpc/kernel/swsusp_64.c1
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c1
-rw-r--r--arch/powerpc/kernel/sysfs.c1
-rw-r--r--arch/powerpc/kernel/traps.c3
-rw-r--r--arch/powerpc/kernel/vdso.c1
-rw-r--r--arch/powerpc/kvm/book3s_hv.c1
-rw-r--r--arch/powerpc/lib/alloc.c2
-rw-r--r--arch/powerpc/lib/copyuser_power7_vmx.c1
-rw-r--r--arch/powerpc/mm/44x_mmu.c1
-rw-r--r--arch/powerpc/mm/fault.c2
-rw-r--r--arch/powerpc/mm/hash_utils_64.c1
-rw-r--r--arch/powerpc/mm/init_32.c1
-rw-r--r--arch/powerpc/mm/init_64.c1
-rw-r--r--arch/powerpc/mm/numa.c2
-rw-r--r--arch/powerpc/mm/pgtable_32.c1
-rw-r--r--arch/powerpc/mm/pgtable_64.c1
-rw-r--r--arch/powerpc/oprofile/common.c1
-rw-r--r--arch/powerpc/oprofile/op_model_7450.c1
-rw-r--r--arch/powerpc/oprofile/op_model_cell.c1
-rw-r--r--arch/powerpc/oprofile/op_model_fsl_emb.c1
-rw-r--r--arch/powerpc/oprofile/op_model_power4.c1
-rw-r--r--arch/powerpc/oprofile/op_model_rs64.c1
-rw-r--r--arch/powerpc/platforms/52xx/lite5200_pm.c1
-rw-r--r--arch/powerpc/platforms/82xx/pq2.c1
-rw-r--r--arch/powerpc/platforms/83xx/km83xx.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_mds.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_itx.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_mds.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_mds.c1
-rw-r--r--arch/powerpc/platforms/83xx/sbc834x.c1
-rw-r--r--arch/powerpc/platforms/83xx/suspend.c1
-rw-r--r--arch/powerpc/platforms/85xx/corenet_ds.c1
-rw-r--r--arch/powerpc/platforms/85xx/ge_imp3a.c1
-rw-r--r--arch/powerpc/platforms/85xx/ksi8560.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc8536_ds.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ads.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_rdb.c1
-rw-r--r--arch/powerpc/platforms/85xx/p1010rdb.c1
-rw-r--r--arch/powerpc/platforms/85xx/p1023_rds.c1
-rw-r--r--arch/powerpc/platforms/85xx/p2041_rdb.c1
-rw-r--r--arch/powerpc/platforms/85xx/p3041_ds.c1
-rw-r--r--arch/powerpc/platforms/85xx/p4080_ds.c1
-rw-r--r--arch/powerpc/platforms/85xx/p5020_ds.c1
-rw-r--r--arch/powerpc/platforms/85xx/sbc8548.c1
-rw-r--r--arch/powerpc/platforms/85xx/sbc8560.c1
-rw-r--r--arch/powerpc/platforms/85xx/socrates.c1
-rw-r--r--arch/powerpc/platforms/85xx/stx_gp3.c1
-rw-r--r--arch/powerpc/platforms/85xx/tqm85xx.c1
-rw-r--r--arch/powerpc/platforms/85xx/xes_mpc85xx.c1
-rw-r--r--arch/powerpc/platforms/86xx/gef_ppc9a.c1
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc310.c1
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc610.c1
-rw-r--r--arch/powerpc/platforms/86xx/mpc8610_hpcd.c1
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c1
-rw-r--r--arch/powerpc/platforms/86xx/pic.c1
-rw-r--r--arch/powerpc/platforms/86xx/sbc8641d.c1
-rw-r--r--arch/powerpc/platforms/8xx/mpc86xads_setup.c1
-rw-r--r--arch/powerpc/platforms/8xx/mpc885ads_setup.c1
-rw-r--r--arch/powerpc/platforms/8xx/tqm8xx_setup.c1
-rw-r--r--arch/powerpc/platforms/cell/smp.c1
-rw-r--r--arch/powerpc/platforms/embedded6xx/c2k.c1
-rw-r--r--arch/powerpc/platforms/embedded6xx/holly.c1
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c1
-rw-r--r--arch/powerpc/platforms/embedded6xx/prpmc2800.c1
-rw-r--r--arch/powerpc/platforms/embedded6xx/storcenter.c1
-rw-r--r--arch/powerpc/platforms/fsl_uli1575.c1
-rw-r--r--arch/powerpc/platforms/maple/setup.c1
-rw-r--r--arch/powerpc/platforms/maple/time.c1
-rw-r--r--arch/powerpc/platforms/pasemi/setup.c2
-rw-r--r--arch/powerpc/platforms/powermac/bootx_init.c1
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_32.c2
-rw-r--r--arch/powerpc/platforms/powermac/nvram.c1
-rw-r--r--arch/powerpc/platforms/powermac/setup.c1
-rw-r--r--arch/powerpc/platforms/powermac/time.c1
-rw-r--r--arch/powerpc/platforms/powernv/smp.c1
-rw-r--r--arch/powerpc/platforms/ps3/mm.c1
-rw-r--r--arch/powerpc/platforms/pseries/dtl.c2
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c1
-rw-r--r--arch/powerpc/platforms/pseries/processor_idle.c2
-rw-r--r--arch/powerpc/platforms/pseries/smp.c1
-rw-r--r--arch/powerpc/platforms/wsp/chroma.c1
-rw-r--r--arch/powerpc/platforms/wsp/psr2.c1
-rw-r--r--arch/powerpc/platforms/wsp/wsp_pci.c1
-rw-r--r--arch/powerpc/sysdev/cpm_common.c1
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c1
-rw-r--r--arch/powerpc/sysdev/msi_bitmap.c1
-rw-r--r--arch/powerpc/sysdev/tsi108_dev.c1
-rw-r--r--arch/powerpc/xmon/xmon.c1
-rw-r--r--arch/s390/crypto/crypt_s390.h1
-rw-r--r--arch/s390/include/asm/atomic.h2
-rw-r--r--arch/s390/include/asm/barrier.h35
-rw-r--r--arch/s390/include/asm/ctl_reg.h76
-rw-r--r--arch/s390/include/asm/elf.h1
-rw-r--r--arch/s390/include/asm/exec.h12
-rw-r--r--arch/s390/include/asm/facility.h63
-rw-r--r--arch/s390/include/asm/mmu.h14
-rw-r--r--arch/s390/include/asm/mmu_context.h1
-rw-r--r--arch/s390/include/asm/processor.h24
-rw-r--r--arch/s390/include/asm/setup.h14
-rw-r--r--arch/s390/include/asm/smp.h2
-rw-r--r--arch/s390/include/asm/switch_to.h100
-rw-r--r--arch/s390/include/asm/system.h315
-rw-r--r--arch/s390/include/asm/uaccess.h6
-rw-r--r--arch/s390/kernel/asm-offsets.c1
-rw-r--r--arch/s390/kernel/compat_signal.c1
-rw-r--r--arch/s390/kernel/cpcmd.c1
-rw-r--r--arch/s390/kernel/dis.c1
-rw-r--r--arch/s390/kernel/early.c2
-rw-r--r--arch/s390/kernel/lgr.c1
-rw-r--r--arch/s390/kernel/machine_kexec.c1
-rw-r--r--arch/s390/kernel/os_info.c1
-rw-r--r--arch/s390/kernel/process.c2
-rw-r--r--arch/s390/kernel/ptrace.c2
-rw-r--r--arch/s390/kernel/setup.c1
-rw-r--r--arch/s390/kernel/signal.c1
-rw-r--r--arch/s390/kernel/suspend.c2
-rw-r--r--arch/s390/kernel/traps.c1
-rw-r--r--arch/s390/kernel/vdso.c2
-rw-r--r--arch/s390/kvm/kvm-s390.c2
-rw-r--r--arch/s390/mm/fault.c2
-rw-r--r--arch/s390/mm/init.c2
-rw-r--r--arch/s390/mm/maccess.c2
-rw-r--r--arch/s390/mm/pgtable.c1
-rw-r--r--arch/s390/oprofile/hwsampler.c2
-rw-r--r--arch/score/include/asm/atomic.h1
-rw-r--r--arch/score/include/asm/barrier.h16
-rw-r--r--arch/score/include/asm/bitops.h1
-rw-r--r--arch/score/include/asm/bug.h11
-rw-r--r--arch/score/include/asm/cmpxchg.h49
-rw-r--r--arch/score/include/asm/exec.h6
-rw-r--r--arch/score/include/asm/switch_to.h13
-rw-r--r--arch/score/include/asm/system.h90
-rw-r--r--arch/sh/boards/mach-microdev/irq.c1
-rw-r--r--arch/sh/include/asm/atomic-irq.h2
-rw-r--r--arch/sh/include/asm/atomic.h2
-rw-r--r--arch/sh/include/asm/auxvec.h2
-rw-r--r--arch/sh/include/asm/barrier.h54
-rw-r--r--arch/sh/include/asm/bitops.h1
-rw-r--r--arch/sh/include/asm/bl_bit.h10
-rw-r--r--arch/sh/include/asm/bl_bit_32.h33
-rw-r--r--arch/sh/include/asm/bl_bit_64.h40
-rw-r--r--arch/sh/include/asm/bug.h5
-rw-r--r--arch/sh/include/asm/cache_insns.h11
-rw-r--r--arch/sh/include/asm/cache_insns_32.h21
-rw-r--r--arch/sh/include/asm/cache_insns_64.h23
-rw-r--r--arch/sh/include/asm/cmpxchg-irq.h2
-rw-r--r--arch/sh/include/asm/cmpxchg.h70
-rw-r--r--arch/sh/include/asm/exec.h10
-rw-r--r--arch/sh/include/asm/futex-irq.h1
-rw-r--r--arch/sh/include/asm/io.h1
-rw-r--r--arch/sh/include/asm/processor.h15
-rw-r--r--arch/sh/include/asm/ptrace.h1
-rw-r--r--arch/sh/include/asm/setup.h1
-rw-r--r--arch/sh/include/asm/switch_to.h19
-rw-r--r--arch/sh/include/asm/switch_to_32.h (renamed from arch/sh/include/asm/system_32.h)108
-rw-r--r--arch/sh/include/asm/switch_to_64.h35
-rw-r--r--arch/sh/include/asm/system.h184
-rw-r--r--arch/sh/include/asm/system_64.h79
-rw-r--r--arch/sh/include/asm/traps.h21
-rw-r--r--arch/sh/include/asm/traps_32.h68
-rw-r--r--arch/sh/include/asm/traps_64.h24
-rw-r--r--arch/sh/include/asm/uaccess.h14
-rw-r--r--arch/sh/kernel/cpu/init.c2
-rw-r--r--arch/sh/kernel/cpu/irq/imask.c1
-rw-r--r--arch/sh/kernel/cpu/sh2a/opcode_helper.c1
-rw-r--r--arch/sh/kernel/cpu/sh4/fpu.c1
-rw-r--r--arch/sh/kernel/hw_breakpoint.c1
-rw-r--r--arch/sh/kernel/idle.c2
-rw-r--r--arch/sh/kernel/io_trapped.c1
-rw-r--r--arch/sh/kernel/process_32.c1
-rw-r--r--arch/sh/kernel/process_64.c1
-rw-r--r--arch/sh/kernel/ptrace_32.c1
-rw-r--r--arch/sh/kernel/ptrace_64.c2
-rw-r--r--arch/sh/kernel/reboot.c2
-rw-r--r--arch/sh/kernel/signal_32.c1
-rw-r--r--arch/sh/kernel/smp.c1
-rw-r--r--arch/sh/kernel/traps.c2
-rw-r--r--arch/sh/kernel/traps_32.c3
-rw-r--r--arch/sh/kernel/traps_64.c1
-rw-r--r--arch/sh/math-emu/math.c1
-rw-r--r--arch/sh/mm/fault_32.c2
-rw-r--r--arch/sh/mm/fault_64.c1
-rw-r--r--arch/sh/mm/flush-sh4.c1
-rw-r--r--arch/sh/mm/pmb.c1
-rw-r--r--arch/sh/mm/tlb-pteaex.c1
-rw-r--r--arch/sh/mm/tlb-sh3.c1
-rw-r--r--arch/sh/mm/tlb-sh4.c1
-rw-r--r--arch/sh/mm/tlbflush_64.c1
-rw-r--r--arch/sparc/include/asm/atomic_32.h2
-rw-r--r--arch/sparc/include/asm/atomic_64.h3
-rw-r--r--arch/sparc/include/asm/auxio_32.h1
-rw-r--r--arch/sparc/include/asm/barrier.h8
-rw-r--r--arch/sparc/include/asm/barrier_32.h15
-rw-r--r--arch/sparc/include/asm/barrier_64.h56
-rw-r--r--arch/sparc/include/asm/bug.h3
-rw-r--r--arch/sparc/include/asm/cacheflush_32.h9
-rw-r--r--arch/sparc/include/asm/cacheflush_64.h10
-rw-r--r--arch/sparc/include/asm/cmpxchg.h8
-rw-r--r--arch/sparc/include/asm/cmpxchg_32.h112
-rw-r--r--arch/sparc/include/asm/cmpxchg_64.h145
-rw-r--r--arch/sparc/include/asm/cpu_type.h34
-rw-r--r--arch/sparc/include/asm/exec.h6
-rw-r--r--arch/sparc/include/asm/floppy_32.h1
-rw-r--r--arch/sparc/include/asm/futex_64.h1
-rw-r--r--arch/sparc/include/asm/io_32.h1
-rw-r--r--arch/sparc/include/asm/io_64.h1
-rw-r--r--arch/sparc/include/asm/irqflags_32.h1
-rw-r--r--arch/sparc/include/asm/mmu_context_64.h1
-rw-r--r--arch/sparc/include/asm/ns87303.h1
-rw-r--r--arch/sparc/include/asm/perfctr.h23
-rw-r--r--arch/sparc/include/asm/pgtable_32.h2
-rw-r--r--arch/sparc/include/asm/pgtable_64.h1
-rw-r--r--arch/sparc/include/asm/processor.h3
-rw-r--r--arch/sparc/include/asm/processor_64.h3
-rw-r--r--arch/sparc/include/asm/ptrace.h5
-rw-r--r--arch/sparc/include/asm/setup.h16
-rw-r--r--arch/sparc/include/asm/switch_to.h8
-rw-r--r--arch/sparc/include/asm/switch_to_32.h106
-rw-r--r--arch/sparc/include/asm/switch_to_64.h72
-rw-r--r--arch/sparc/include/asm/system.h8
-rw-r--r--arch/sparc/include/asm/system_32.h284
-rw-r--r--arch/sparc/include/asm/system_64.h331
-rw-r--r--arch/sparc/include/asm/timer_32.h3
-rw-r--r--arch/sparc/include/asm/uaccess_64.h1
-rw-r--r--arch/sparc/kernel/auxio_32.c1
-rw-r--r--arch/sparc/kernel/devices.c2
-rw-r--r--arch/sparc/kernel/irq.h1
-rw-r--r--arch/sparc/kernel/irq_64.c1
-rw-r--r--arch/sparc/kernel/kgdb_32.c1
-rw-r--r--arch/sparc/kernel/module.c1
-rw-r--r--arch/sparc/kernel/muldiv.c1
-rw-r--r--arch/sparc/kernel/nmi.c1
-rw-r--r--arch/sparc/kernel/pcr.c1
-rw-r--r--arch/sparc/kernel/perf_event.c2
-rw-r--r--arch/sparc/kernel/process_32.c2
-rw-r--r--arch/sparc/kernel/process_64.c1
-rw-r--r--arch/sparc/kernel/ptrace_32.c2
-rw-r--r--arch/sparc/kernel/ptrace_64.c1
-rw-r--r--arch/sparc/kernel/reboot.c2
-rw-r--r--arch/sparc/kernel/setup_32.c2
-rw-r--r--arch/sparc/kernel/setup_64.c2
-rw-r--r--arch/sparc/kernel/signal32.c1
-rw-r--r--arch/sparc/kernel/signal_32.c1
-rw-r--r--arch/sparc/kernel/signal_64.c2
-rw-r--r--arch/sparc/kernel/sigutil_32.c1
-rw-r--r--arch/sparc/kernel/sigutil_64.c1
-rw-r--r--arch/sparc/kernel/sparc_ksyms_64.c2
-rw-r--r--arch/sparc/kernel/time_32.c1
-rw-r--r--arch/sparc/kernel/traps_32.c1
-rw-r--r--arch/sparc/kernel/traps_64.c2
-rw-r--r--arch/sparc/kernel/unaligned_32.c1
-rw-r--r--arch/sparc/kernel/unaligned_64.c2
-rw-r--r--arch/sparc/kernel/visemul.c2
-rw-r--r--arch/sparc/math-emu/math_64.c1
-rw-r--r--arch/sparc/mm/btfixup.c1
-rw-r--r--arch/sparc/mm/fault_32.c1
-rw-r--r--arch/sparc/mm/init_32.c1
-rw-r--r--arch/sparc/mm/init_64.c1
-rw-r--r--arch/sparc/mm/init_64.h2
-rw-r--r--arch/sparc/mm/loadmmu.c1
-rw-r--r--arch/sparc/mm/tsb.c1
-rw-r--r--arch/sparc/prom/console_32.c1
-rw-r--r--arch/sparc/prom/console_64.c1
-rw-r--r--arch/sparc/prom/misc_32.c1
-rw-r--r--arch/sparc/prom/misc_64.c1
-rw-r--r--arch/sparc/prom/p1275.c1
-rw-r--r--arch/sparc/prom/ranges.c1
-rw-r--r--arch/tile/include/asm/atomic.h2
-rw-r--r--arch/tile/include/asm/atomic_32.h1
-rw-r--r--arch/tile/include/asm/atomic_64.h1
-rw-r--r--arch/tile/include/asm/barrier.h (renamed from arch/tile/include/asm/system.h)121
-rw-r--r--arch/tile/include/asm/bitops_32.h1
-rw-r--r--arch/tile/include/asm/bitops_64.h1
-rw-r--r--arch/tile/include/asm/cacheflush.h11
-rw-r--r--arch/tile/include/asm/exec.h20
-rw-r--r--arch/tile/include/asm/pgtable.h1
-rw-r--r--arch/tile/include/asm/setup.h22
-rw-r--r--arch/tile/include/asm/spinlock_32.h1
-rw-r--r--arch/tile/include/asm/switch_to.h76
-rw-r--r--arch/tile/include/asm/timex.h2
-rw-r--r--arch/tile/include/asm/unaligned.h15
-rw-r--r--arch/tile/kernel/early_printk.c1
-rw-r--r--arch/tile/kernel/proc.c1
-rw-r--r--arch/tile/kernel/process.c3
-rw-r--r--arch/tile/kernel/regs_32.S2
-rw-r--r--arch/tile/kernel/regs_64.S2
-rw-r--r--arch/tile/kernel/single_step.c1
-rw-r--r--arch/tile/kernel/traps.c1
-rw-r--r--arch/tile/mm/elf.c1
-rw-r--r--arch/tile/mm/fault.c1
-rw-r--r--arch/tile/mm/init.c1
-rw-r--r--arch/tile/mm/pgtable.c1
-rw-r--r--arch/um/include/asm/fixmap.h1
-rw-r--r--arch/unicore32/include/asm/Kbuild1
-rw-r--r--arch/unicore32/include/asm/barrier.h28
-rw-r--r--arch/unicore32/include/asm/bug.h27
-rw-r--r--arch/unicore32/include/asm/cmpxchg.h61
-rw-r--r--arch/unicore32/include/asm/exec.h15
-rw-r--r--arch/unicore32/include/asm/hwdef-copro.h48
-rw-r--r--arch/unicore32/include/asm/io.h1
-rw-r--r--arch/unicore32/include/asm/switch_to.h30
-rw-r--r--arch/unicore32/include/asm/system.h161
-rw-r--r--arch/unicore32/include/asm/uaccess.h1
-rw-r--r--arch/unicore32/kernel/dma.c1
-rw-r--r--arch/unicore32/kernel/head.S2
-rw-r--r--arch/unicore32/kernel/hibernate.c1
-rw-r--r--arch/unicore32/kernel/irq.c1
-rw-r--r--arch/unicore32/kernel/ksyms.c1
-rw-r--r--arch/unicore32/kernel/process.c1
-rw-r--r--arch/unicore32/kernel/setup.h3
-rw-r--r--arch/unicore32/kernel/traps.c1
-rw-r--r--arch/unicore32/mm/alignment.c2
-rw-r--r--arch/unicore32/mm/fault.c1
-rw-r--r--arch/unicore32/mm/flush.c1
-rw-r--r--arch/unicore32/mm/mm.h5
-rw-r--r--arch/x86/ia32/ia32_aout.c1
-rw-r--r--arch/x86/include/asm/apic.h1
-rw-r--r--arch/x86/include/asm/auxvec.h7
-rw-r--r--arch/x86/include/asm/barrier.h116
-rw-r--r--arch/x86/include/asm/bug.h4
-rw-r--r--arch/x86/include/asm/cacheflush.h1
-rw-r--r--arch/x86/include/asm/elf.h1
-rw-r--r--arch/x86/include/asm/exec.h1
-rw-r--r--arch/x86/include/asm/futex.h1
-rw-r--r--arch/x86/include/asm/i387.h1
-rw-r--r--arch/x86/include/asm/local.h1
-rw-r--r--arch/x86/include/asm/mc146818rtc.h1
-rw-r--r--arch/x86/include/asm/page_types.h1
-rw-r--r--arch/x86/include/asm/processor.h31
-rw-r--r--arch/x86/include/asm/segment.h58
-rw-r--r--arch/x86/include/asm/special_insns.h199
-rw-r--r--arch/x86/include/asm/stackprotector.h1
-rw-r--r--arch/x86/include/asm/switch_to.h129
-rw-r--r--arch/x86/include/asm/system.h523
-rw-r--r--arch/x86/include/asm/tlbflush.h2
-rw-r--r--arch/x86/include/asm/virtext.h1
-rw-r--r--arch/x86/kernel/acpi/cstate.c1
-rw-r--r--arch/x86/kernel/apm_32.c1
-rw-r--r--arch/x86/kernel/cpu/mcheck/p5.c1
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c1
-rw-r--r--arch/x86/kernel/cpu/mcheck/winchip.c1
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c1
-rw-r--r--arch/x86/kernel/cpuid.c1
-rw-r--r--arch/x86/kernel/i8259.c1
-rw-r--r--arch/x86/kernel/irqinit.c1
-rw-r--r--arch/x86/kernel/kgdb.c1
-rw-r--r--arch/x86/kernel/ldt.c1
-rw-r--r--arch/x86/kernel/machine_kexec_32.c1
-rw-r--r--arch/x86/kernel/mca_32.c1
-rw-r--r--arch/x86/kernel/module.c1
-rw-r--r--arch/x86/kernel/msr.c1
-rw-r--r--arch/x86/kernel/paravirt.c1
-rw-r--r--arch/x86/kernel/pci-calgary_64.c1
-rw-r--r--arch/x86/kernel/process.c1
-rw-r--r--arch/x86/kernel/process_32.c2
-rw-r--r--arch/x86/kernel/process_64.c2
-rw-r--r--arch/x86/kernel/ptrace.c1
-rw-r--r--arch/x86/kernel/setup.c1
-rw-r--r--arch/x86/kernel/tce_64.c1
-rw-r--r--arch/x86/kernel/tls.c1
-rw-r--r--arch/x86/kernel/traps.c1
-rw-r--r--arch/x86/mm/init.c1
-rw-r--r--arch/x86/mm/init_32.c1
-rw-r--r--arch/x86/mm/init_64.c1
-rw-r--r--arch/x86/mm/pgtable_32.c1
-rw-r--r--arch/x86/power/hibernate_32.c1
-rw-r--r--arch/xtensa/include/asm/atomic.h2
-rw-r--r--arch/xtensa/include/asm/barrier.h29
-rw-r--r--arch/xtensa/include/asm/bitops.h1
-rw-r--r--arch/xtensa/include/asm/cmpxchg.h (renamed from arch/xtensa/include/asm/system.h)67
-rw-r--r--arch/xtensa/include/asm/exec.h14
-rw-r--r--arch/xtensa/include/asm/setup.h2
-rw-r--r--arch/xtensa/include/asm/switch_to.h22
-rw-r--r--arch/xtensa/include/asm/uaccess.h2
-rw-r--r--arch/xtensa/kernel/process.c1
-rw-r--r--arch/xtensa/kernel/ptrace.c1
-rw-r--r--arch/xtensa/kernel/setup.c1
-rw-r--r--arch/xtensa/kernel/traps.c19
-rw-r--r--arch/xtensa/mm/fault.c1
-rw-r--r--arch/xtensa/mm/tlb.c1
-rw-r--r--drivers/acpi/processor_driver.c1
-rw-r--r--drivers/atm/eni.c1
-rw-r--r--drivers/atm/firestream.c1
-rw-r--r--drivers/atm/horizon.c1
-rw-r--r--drivers/atm/idt77105.c1
-rw-r--r--drivers/atm/iphase.c1
-rw-r--r--drivers/atm/suni.c1
-rw-r--r--drivers/atm/zatm.c1
-rw-r--r--drivers/block/floppy.c1
-rw-r--r--drivers/block/hd.c1
-rw-r--r--drivers/block/nbd.c1
-rw-r--r--drivers/block/xd.c1
-rw-r--r--drivers/bluetooth/bt3c_cs.c1
-rw-r--r--drivers/bluetooth/btuart_cs.c1
-rw-r--r--drivers/bluetooth/dtl1_cs.c1
-rw-r--r--drivers/char/apm-emulation.c1
-rw-r--r--drivers/char/ds1302.c1
-rw-r--r--drivers/char/efirtc.c1
-rw-r--r--drivers/char/genrtc.c1
-rw-r--r--drivers/char/hpet.c1
-rw-r--r--drivers/char/ipmi/ipmi_devintf.c1
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c1
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c1
-rw-r--r--drivers/char/lp.c1
-rw-r--r--drivers/char/mbcs.c1
-rw-r--r--drivers/char/mspec.c1
-rw-r--r--drivers/char/mwave/3780i.c1
-rw-r--r--drivers/char/nvram.c1
-rw-r--r--drivers/char/nwflash.c1
-rw-r--r--drivers/char/pcmcia/synclink_cs.c1
-rw-r--r--drivers/char/rtc.c1
-rw-r--r--drivers/char/sonypi.c1
-rw-r--r--drivers/char/xilinx_hwicap/xilinx_hwicap.c1
-rw-r--r--drivers/cpufreq/omap-cpufreq.c1
-rw-r--r--drivers/cpufreq/powernow-k7.c1
-rw-r--r--drivers/firewire/core-cdev.c1
-rw-r--r--drivers/firewire/core-device.c1
-rw-r--r--drivers/firewire/core-topology.c1
-rw-r--r--drivers/firewire/ohci.c1
-rw-r--r--drivers/firewire/sbp2.c1
-rw-r--r--drivers/i2c/busses/i2c-acorn.c1
-rw-r--r--drivers/ide/ide-cs.c1
-rw-r--r--drivers/ide/qd65xx.c1
-rw-r--r--drivers/infiniband/hw/ehca/ehca_reqs.c1
-rw-r--r--drivers/input/joydev.c1
-rw-r--r--drivers/input/joystick/amijoy.c1
-rw-r--r--drivers/input/mouse/amimouse.c1
-rw-r--r--drivers/input/mouse/atarimouse.c1
-rw-r--r--drivers/input/serio/hp_sdc.c1
-rw-r--r--drivers/input/serio/maceps2.c1
-rw-r--r--drivers/input/serio/rpckbd.c1
-rw-r--r--drivers/input/serio/sa1111ps2.c1
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c1
-rw-r--r--drivers/isdn/hisax/avma1_cs.c1
-rw-r--r--drivers/isdn/hisax/elsa_cs.c1
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c1
-rw-r--r--drivers/isdn/hisax/teles_cs.c1
-rw-r--r--drivers/isdn/i4l/isdn_bsdcomp.c1
-rw-r--r--drivers/isdn/pcbit/layer2.c1
-rw-r--r--drivers/macintosh/macio-adb.c1
-rw-r--r--drivers/macintosh/therm_adt746x.c1
-rw-r--r--drivers/macintosh/therm_pm72.c1
-rw-r--r--drivers/macintosh/therm_windtunnel.c1
-rw-r--r--drivers/macintosh/via-cuda.c1
-rw-r--r--drivers/macintosh/via-macii.c1
-rw-r--r--drivers/macintosh/via-pmu.c1
-rw-r--r--drivers/macintosh/via-pmu68k.c1
-rw-r--r--drivers/macintosh/windfarm_lm75_sensor.c1
-rw-r--r--drivers/macintosh/windfarm_pm121.c1
-rw-r--r--drivers/macintosh/windfarm_pm81.c1
-rw-r--r--drivers/macintosh/windfarm_pm91.c1
-rw-r--r--drivers/macintosh/windfarm_smu_controls.c1
-rw-r--r--drivers/macintosh/windfarm_smu_sensors.c1
-rw-r--r--drivers/media/dvb/dvb-core/dmxdev.c1
-rw-r--r--drivers/media/dvb/firewire/firedtv-fw.c1
-rw-r--r--drivers/media/dvb/ttpci/av7110.c1
-rw-r--r--drivers/media/media-devnode.c1
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.h1
-rw-r--r--drivers/media/video/v4l2-common.c1
-rw-r--r--drivers/media/video/v4l2-dev.c1
-rw-r--r--drivers/message/i2o/i2o_scsi.c1
-rw-r--r--drivers/mfd/mcp-core.c2
-rw-r--r--drivers/mfd/mcp-sa11x0.c1
-rw-r--r--drivers/misc/sgi-gru/gru_instructions.h1
-rw-r--r--drivers/misc/sgi-xp/xp.h1
-rw-r--r--drivers/mmc/card/block.c1
-rw-r--r--drivers/mtd/devices/pmc551.c1
-rw-r--r--drivers/mtd/devices/slram.c1
-rw-r--r--drivers/mtd/maps/pcmciamtd.c1
-rw-r--r--drivers/mtd/nand/bcm_umi_nand.c1
-rw-r--r--drivers/net/appletalk/cops.c1
-rw-r--r--drivers/net/appletalk/ltpc.c1
-rw-r--r--drivers/net/arcnet/com20020_cs.c1
-rw-r--r--drivers/net/bonding/bond_main.c1
-rw-r--r--drivers/net/can/slcan.c1
-rw-r--r--drivers/net/cris/eth_v10.c1
-rw-r--r--drivers/net/ethernet/3com/3c574_cs.c1
-rw-r--r--drivers/net/ethernet/3com/3c589_cs.c1
-rw-r--r--drivers/net/ethernet/8390/3c503.c1
-rw-r--r--drivers/net/ethernet/8390/ac3200.c1
-rw-r--r--drivers/net/ethernet/8390/apne.c1
-rw-r--r--drivers/net/ethernet/8390/ax88796.c1
-rw-r--r--drivers/net/ethernet/8390/axnet_cs.c1
-rw-r--r--drivers/net/ethernet/8390/e2100.c1
-rw-r--r--drivers/net/ethernet/8390/es3210.c1
-rw-r--r--drivers/net/ethernet/8390/etherh.c2
-rw-r--r--drivers/net/ethernet/8390/hp-plus.c1
-rw-r--r--drivers/net/ethernet/8390/hp.c1
-rw-r--r--drivers/net/ethernet/8390/lib8390.c1
-rw-r--r--drivers/net/ethernet/8390/lne390.c1
-rw-r--r--drivers/net/ethernet/8390/mac8390.c1
-rw-r--r--drivers/net/ethernet/8390/ne-h8300.c1
-rw-r--r--drivers/net/ethernet/8390/ne.c1
-rw-r--r--drivers/net/ethernet/8390/ne2.c1
-rw-r--r--drivers/net/ethernet/8390/ne2k-pci.c1
-rw-r--r--drivers/net/ethernet/8390/ne3210.c1
-rw-r--r--drivers/net/ethernet/8390/pcnet_cs.c1
-rw-r--r--drivers/net/ethernet/8390/smc-mca.c1
-rw-r--r--drivers/net/ethernet/8390/smc-ultra.c1
-rw-r--r--drivers/net/ethernet/8390/smc-ultra32.c1
-rw-r--r--drivers/net/ethernet/8390/stnic.c1
-rw-r--r--drivers/net/ethernet/8390/wd.c1
-rw-r--r--drivers/net/ethernet/8390/zorro8390.c1
-rw-r--r--drivers/net/ethernet/alteon/acenic.c1
-rw-r--r--drivers/net/ethernet/amd/7990.c1
-rw-r--r--drivers/net/ethernet/amd/am79c961a.c1
-rw-r--r--drivers/net/ethernet/amd/amd8111e.c1
-rw-r--r--drivers/net/ethernet/amd/declance.c1
-rw-r--r--drivers/net/ethernet/amd/hplance.c1
-rw-r--r--drivers/net/ethernet/amd/mvme147.c1
-rw-r--r--drivers/net/ethernet/amd/nmclan_cs.c1
-rw-r--r--drivers/net/ethernet/amd/sunlance.c1
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c1
-rw-r--r--drivers/net/ethernet/cirrus/cs89x0.c1
-rw-r--r--drivers/net/ethernet/cirrus/mac89x0.c1
-rw-r--r--drivers/net/ethernet/dlink/de600.c1
-rw-r--r--drivers/net/ethernet/dlink/de620.c1
-rw-r--r--drivers/net/ethernet/fujitsu/at1700.c1
-rw-r--r--drivers/net/ethernet/fujitsu/eth16i.c1
-rw-r--r--drivers/net/ethernet/fujitsu/fmvj18x_cs.c1
-rw-r--r--drivers/net/ethernet/i825xx/3c507.c1
-rw-r--r--drivers/net/ethernet/i825xx/3c527.c1
-rw-r--r--drivers/net/ethernet/i825xx/eepro.c1
-rw-r--r--drivers/net/ethernet/i825xx/eexpress.c1
-rw-r--r--drivers/net/ethernet/i825xx/ether1.c1
-rw-r--r--drivers/net/ethernet/i825xx/znet.c1
-rw-r--r--drivers/net/ethernet/korina.c1
-rw-r--r--drivers/net/ethernet/marvell/mv643xx_eth.c1
-rw-r--r--drivers/net/ethernet/marvell/pxa168_eth.c1
-rw-r--r--drivers/net/ethernet/natsemi/jazzsonic.c1
-rw-r--r--drivers/net/ethernet/natsemi/macsonic.c1
-rw-r--r--drivers/net/ethernet/natsemi/ns83820.c1
-rw-r--r--drivers/net/ethernet/neterion/s2io.c1
-rw-r--r--drivers/net/ethernet/nvidia/forcedeth.c1
-rw-r--r--drivers/net/ethernet/realtek/atp.c1
-rw-r--r--drivers/net/ethernet/realtek/r8169.c1
-rw-r--r--drivers/net/ethernet/seeq/ether3.c1
-rw-r--r--drivers/net/ethernet/seeq/seeq8005.c1
-rw-r--r--drivers/net/ethernet/smsc/smc91c92_cs.c1
-rw-r--r--drivers/net/ethernet/sun/cassini.c1
-rw-r--r--drivers/net/ethernet/sun/sunbmac.c1
-rw-r--r--drivers/net/ethernet/sun/sungem.c1
-rw-r--r--drivers/net/ethernet/sun/sunhme.c1
-rw-r--r--drivers/net/ethernet/sun/sunqe.c1
-rw-r--r--drivers/net/ethernet/tundra/tsi108_eth.c1
-rw-r--r--drivers/net/ethernet/xircom/xirc2ps_cs.c1
-rw-r--r--drivers/net/hamradio/6pack.c1
-rw-r--r--drivers/net/hamradio/baycom_par.c1
-rw-r--r--drivers/net/hamradio/bpqether.c1
-rw-r--r--drivers/net/hamradio/mkiss.c1
-rw-r--r--drivers/net/hamradio/scc.c1
-rw-r--r--drivers/net/hamradio/yam.c1
-rw-r--r--drivers/net/hippi/rrunner.c1
-rw-r--r--drivers/net/irda/donauboe.c1
-rw-r--r--drivers/net/loopback.c1
-rw-r--r--drivers/net/plip/plip.c1
-rw-r--r--drivers/net/slip/slhc.c1
-rw-r--r--drivers/net/slip/slip.c1
-rw-r--r--drivers/net/tokenring/3c359.c1
-rw-r--r--drivers/net/tokenring/abyss.c1
-rw-r--r--drivers/net/tokenring/ibmtr_cs.c1
-rw-r--r--drivers/net/tokenring/lanstreamer.c1
-rw-r--r--drivers/net/tokenring/madgemc.c1
-rw-r--r--drivers/net/tokenring/olympic.c1
-rw-r--r--drivers/net/tokenring/proteon.c1
-rw-r--r--drivers/net/tokenring/skisa.c1
-rw-r--r--drivers/net/tokenring/smctr.c1
-rw-r--r--drivers/net/tokenring/tms380tr.c1
-rw-r--r--drivers/net/tokenring/tmspci.c1
-rw-r--r--drivers/net/tun.c1
-rw-r--r--drivers/net/wan/dlci.c1
-rw-r--r--drivers/net/wan/dscc4.c1
-rw-r--r--drivers/net/wan/hd64570.c1
-rw-r--r--drivers/net/wan/hd64572.c1
-rw-r--r--drivers/net/wan/lapbether.c1
-rw-r--r--drivers/net/wan/sdla.c1
-rw-r--r--drivers/net/wan/x25_asy.c1
-rw-r--r--drivers/net/wireless/airo.c1
-rw-r--r--drivers/net/wireless/airo_cs.c1
-rw-r--r--drivers/net/wireless/atmel.c1
-rw-r--r--drivers/net/wireless/atmel_cs.c1
-rw-r--r--drivers/net/wireless/prism54/islpci_mgt.c1
-rw-r--r--drivers/net/wireless/ray_cs.c1
-rw-r--r--drivers/net/wireless/wl3501_cs.c1
-rw-r--r--drivers/nubus/nubus.c1
-rw-r--r--drivers/parisc/dino.c1
-rw-r--r--drivers/parisc/iosapic.c1
-rw-r--r--drivers/parisc/lba_pci.c1
-rw-r--r--drivers/pcmcia/cs.c1
-rw-r--r--drivers/pcmcia/i82092.c1
-rw-r--r--drivers/pcmcia/i82365.c1
-rw-r--r--drivers/pcmcia/m32r_cfc.c1
-rw-r--r--drivers/pcmcia/m32r_pcc.c1
-rw-r--r--drivers/pcmcia/m8xx_pcmcia.c1
-rw-r--r--drivers/pcmcia/pd6729.c1
-rw-r--r--drivers/pcmcia/pxa2xx_base.c1
-rw-r--r--drivers/pcmcia/sa11xx_base.c1
-rw-r--r--drivers/pcmcia/soc_common.c1
-rw-r--r--drivers/pcmcia/socket_sysfs.c1
-rw-r--r--drivers/pcmcia/tcic.c1
-rw-r--r--drivers/pcmcia/xxs1500_ss.c1
-rw-r--r--drivers/pnp/pnpbios/bioscalls.c1
-rw-r--r--drivers/pnp/pnpbios/core.c1
-rw-r--r--drivers/s390/char/sclp_cmd.c1
-rw-r--r--drivers/s390/cio/crw.c1
-rw-r--r--drivers/s390/crypto/ap_bus.c2
-rw-r--r--drivers/sbus/char/flash.c1
-rw-r--r--drivers/sbus/char/openprom.c1
-rw-r--r--drivers/sbus/char/uctrl.c1
-rw-r--r--drivers/scsi/53c700.c1
-rw-r--r--drivers/scsi/BusLogic.c1
-rw-r--r--drivers/scsi/advansys.c1
-rw-r--r--drivers/scsi/aha152x.c1
-rw-r--r--drivers/scsi/aha1542.c1
-rw-r--r--drivers/scsi/aha1740.c1
-rw-r--r--drivers/scsi/arcmsr/arcmsr_hba.c1
-rw-r--r--drivers/scsi/arm/acornscsi.c1
-rw-r--r--drivers/scsi/arm/cumana_1.c1
-rw-r--r--drivers/scsi/arm/oak.c1
-rw-r--r--drivers/scsi/atp870u.c1
-rw-r--r--drivers/scsi/dtc.c1
-rw-r--r--drivers/scsi/fd_mcs.c1
-rw-r--r--drivers/scsi/fdomain.c1
-rw-r--r--drivers/scsi/g_NCR5380.c1
-rw-r--r--drivers/scsi/gdth.c1
-rw-r--r--drivers/scsi/ibmmca.c1
-rw-r--r--drivers/scsi/in2000.c1
-rw-r--r--drivers/scsi/mac53c94.c1
-rw-r--r--drivers/scsi/mac_scsi.c1
-rw-r--r--drivers/scsi/mesh.c1
-rw-r--r--drivers/scsi/ncr53c8xx.c1
-rw-r--r--drivers/scsi/nsp32.c1
-rw-r--r--drivers/scsi/osst.c1
-rw-r--r--drivers/scsi/pas16.c1
-rw-r--r--drivers/scsi/qla1280.c1
-rw-r--r--drivers/scsi/qlogicpti.c1
-rw-r--r--drivers/scsi/st.c1
-rw-r--r--drivers/scsi/sun3_scsi.c1
-rw-r--r--drivers/scsi/sun3_scsi_vme.c1
-rw-r--r--drivers/scsi/sym53c416.c1
-rw-r--r--drivers/scsi/t128.c1
-rw-r--r--drivers/scsi/u14-34f.c1
-rw-r--r--drivers/scsi/ultrastor.c1
-rw-r--r--drivers/scsi/wd7000.c1
-rw-r--r--drivers/spi/spi-omap-uwire.c1
-rw-r--r--drivers/staging/comedi/drivers.c1
-rw-r--r--drivers/staging/comedi/drivers/cb_pcidas64.c1
-rw-r--r--drivers/staging/comedi/drivers/mite.c1
-rw-r--r--drivers/staging/crystalhd/bc_dts_defs.h2
-rw-r--r--drivers/staging/crystalhd/crystalhd.h1
-rw-r--r--drivers/staging/crystalhd/crystalhd_lnx.h1
-rw-r--r--drivers/staging/crystalhd/crystalhd_misc.h1
-rw-r--r--drivers/staging/et131x/et131x.c1
-rw-r--r--drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c1
-rw-r--r--drivers/staging/media/go7007/go7007-driver.c1
-rw-r--r--drivers/staging/media/go7007/go7007-i2c.c1
-rw-r--r--drivers/staging/media/go7007/go7007-v4l2.c1
-rw-r--r--drivers/staging/media/go7007/snd-go7007.c1
-rw-r--r--drivers/staging/media/lirc/lirc_serial.c1
-rw-r--r--drivers/staging/media/lirc/lirc_sir.c1
-rw-r--r--drivers/staging/panel/panel.c1
-rw-r--r--drivers/staging/sbe-2t3e3/io.c1
-rw-r--r--drivers/staging/telephony/phonedev.c1
-rw-r--r--drivers/staging/tidspbridge/include/dspbridge/host_os.h1
-rw-r--r--drivers/staging/wlags49_h2/wl_cs.c1
-rw-r--r--drivers/staging/wlags49_h2/wl_main.c3
-rw-r--r--drivers/staging/wlags49_h2/wl_netdev.c3
-rw-r--r--drivers/staging/wlags49_h2/wl_pci.c1
-rw-r--r--drivers/staging/wlags49_h2/wl_util.c3
-rw-r--r--drivers/tty/amiserial.c1
-rw-r--r--drivers/tty/isicom.c1
-rw-r--r--drivers/tty/moxa.c1
-rw-r--r--drivers/tty/mxser.c1
-rw-r--r--drivers/tty/n_hdlc.c1
-rw-r--r--drivers/tty/n_tty.c1
-rw-r--r--drivers/tty/pty.c1
-rw-r--r--drivers/tty/serial/21285.c1
-rw-r--r--drivers/tty/serial/68328serial.c1
-rw-r--r--drivers/tty/serial/8250/serial_cs.c1
-rw-r--r--drivers/tty/serial/crisv10.c2
-rw-r--r--drivers/tty/serial/dz.c1
-rw-r--r--drivers/tty/serial/icom.c1
-rw-r--r--drivers/tty/serial/msm_serial_hs.c1
-rw-r--r--drivers/tty/serial/sunhv.c1
-rw-r--r--drivers/tty/serial/sunsab.c1
-rw-r--r--drivers/tty/serial/sunsu.c1
-rw-r--r--drivers/tty/serial/sunzilog.c1
-rw-r--r--drivers/tty/serial/zs.c1
-rw-r--r--drivers/tty/synclink.c1
-rw-r--r--drivers/tty/synclink_gt.c1
-rw-r--r--drivers/tty/synclinkmp.c1
-rw-r--r--drivers/tty/tty_io.c1
-rw-r--r--drivers/tty/tty_ioctl.c1
-rw-r--r--drivers/tty/vt/vt.c1
-rw-r--r--drivers/usb/gadget/amd5536udc.c1
-rw-r--r--drivers/usb/gadget/at91_udc.c1
-rw-r--r--drivers/usb/gadget/dummy_hcd.c1
-rw-r--r--drivers/usb/gadget/fsl_udc_core.c1
-rw-r--r--drivers/usb/gadget/goku_udc.c1
-rw-r--r--drivers/usb/gadget/langwell_udc.c1
-rw-r--r--drivers/usb/gadget/mv_udc_core.c1
-rw-r--r--drivers/usb/gadget/net2272.c1
-rw-r--r--drivers/usb/gadget/net2280.c1
-rw-r--r--drivers/usb/gadget/omap_udc.c1
-rw-r--r--drivers/usb/gadget/printer.c1
-rw-r--r--drivers/usb/gadget/pxa25x_udc.c1
-rw-r--r--drivers/usb/gadget/rndis.c1
-rw-r--r--drivers/usb/gadget/s3c2410_udc.c1
-rw-r--r--drivers/usb/host/ehci-hcd.c1
-rw-r--r--drivers/usb/host/isp116x-hcd.c1
-rw-r--r--drivers/usb/host/isp1362-hcd.c1
-rw-r--r--drivers/usb/host/ohci-hcd.c1
-rw-r--r--drivers/usb/host/oxu210hp-hcd.c1
-rw-r--r--drivers/usb/host/sl811-hcd.c1
-rw-r--r--drivers/usb/host/u132-hcd.c1
-rw-r--r--drivers/usb/host/uhci-hcd.c1
-rw-r--r--drivers/video/amifb.c1
-rw-r--r--drivers/video/bt431.h1
-rw-r--r--drivers/video/bt455.h1
-rw-r--r--drivers/video/console/fbcon.c1
-rw-r--r--drivers/video/console/newport_con.c1
-rw-r--r--drivers/video/cyber2000fb.c1
-rw-r--r--drivers/video/dnfb.c1
-rw-r--r--drivers/video/neofb.c1
-rw-r--r--drivers/video/pmag-ba-fb.c1
-rw-r--r--drivers/video/pmagb-b-fb.c1
-rw-r--r--drivers/video/q40fb.c1
-rw-r--r--drivers/video/savage/savagefb_driver.c1
-rw-r--r--drivers/virtio/config.c1
-rw-r--r--drivers/watchdog/advantechwdt.c1
-rw-r--r--drivers/watchdog/alim7101_wdt.c1
-rw-r--r--drivers/watchdog/booke_wdt.c1
-rw-r--r--drivers/watchdog/eurotechwdt.c1
-rw-r--r--drivers/watchdog/ib700wdt.c1
-rw-r--r--drivers/watchdog/it87_wdt.c1
-rw-r--r--drivers/watchdog/machzwd.c1
-rw-r--r--drivers/watchdog/pc87413_wdt.c1
-rw-r--r--drivers/watchdog/sbc60xxwdt.c1
-rw-r--r--drivers/watchdog/sbc7240_wdt.c1
-rw-r--r--drivers/watchdog/sbc8360.c1
-rw-r--r--drivers/watchdog/sbc_fitpc2_wdt.c1
-rw-r--r--drivers/watchdog/sc520_wdt.c1
-rw-r--r--drivers/watchdog/smsc37b787_wdt.c1
-rw-r--r--drivers/watchdog/w83627hf_wdt.c1
-rw-r--r--drivers/watchdog/w83697hf_wdt.c1
-rw-r--r--drivers/watchdog/w83697ug_wdt.c1
-rw-r--r--drivers/watchdog/w83877f_wdt.c1
-rw-r--r--drivers/watchdog/w83977f_wdt.c1
-rw-r--r--drivers/watchdog/wdt.c1
-rw-r--r--drivers/watchdog/wdt285.c1
-rw-r--r--drivers/watchdog/wdt977.c1
-rw-r--r--drivers/watchdog/wdt_pci.c1
-rw-r--r--fs/binfmt_aout.c1
-rw-r--r--fs/binfmt_elf.c1
-rw-r--r--fs/binfmt_elf_fdpic.c1
-rw-r--r--fs/binfmt_flat.c1
-rw-r--r--fs/coda/inode.c1
-rw-r--r--fs/coda/psdev.c1
-rw-r--r--fs/coda/upcall.c1
-rw-r--r--fs/eventpoll.c1
-rw-r--r--fs/exec.c1
-rw-r--r--fs/jbd2/commit.c1
-rw-r--r--fs/jbd2/journal.c1
-rw-r--r--fs/ncpfs/file.c1
-rw-r--r--fs/ncpfs/inode.c1
-rw-r--r--fs/ncpfs/mmap.c1
-rw-r--r--fs/nfs/client.c1
-rw-r--r--fs/nfs/direct.c1
-rw-r--r--fs/nfs/file.c1
-rw-r--r--fs/nfs/getroot.c1
-rw-r--r--fs/nfs/inode.c1
-rw-r--r--fs/nfs/read.c1
-rw-r--r--fs/nfs/super.c1
-rw-r--r--fs/proc/inode.c1
-rw-r--r--fs/reiserfs/journal.c1
-rw-r--r--fs/ufs/inode.c1
-rw-r--r--fs/ufs/super.c1
-rw-r--r--fs/xfs/xfs_buf.h1
-rw-r--r--include/acpi/platform/aclinux.h1
-rw-r--r--include/asm-generic/atomic.h3
-rw-r--r--include/asm-generic/barrier.h50
-rw-r--r--include/asm-generic/bitops/atomic.h2
-rw-r--r--include/asm-generic/cmpxchg.h87
-rw-r--r--include/asm-generic/exec.h19
-rw-r--r--include/asm-generic/switch_to.h30
-rw-r--r--include/asm-generic/system.h141
-rw-r--r--include/linux/cnt32_to_63.h1
-rw-r--r--include/linux/debug_locks.h1
-rw-r--r--include/linux/efi.h1
-rw-r--r--include/linux/ide.h1
-rw-r--r--include/linux/interrupt.h1
-rw-r--r--include/linux/llist.h3
-rw-r--r--include/linux/lsm_audit.h1
-rw-r--r--include/linux/mm.h2
-rw-r--r--include/linux/mtd/map.h2
-rw-r--r--include/linux/parport.h1
-rw-r--r--include/linux/rwsem.h1
-rw-r--r--include/linux/sched.h1
-rw-r--r--include/linux/skbuff.h1
-rw-r--r--include/linux/spinlock.h2
-rw-r--r--include/linux/stop_machine.h1
-rw-r--r--include/linux/tty.h1
-rw-r--r--include/linux/wait.h1
-rw-r--r--include/xen/xen-ops.h1
-rw-r--r--init/main.c1
-rw-r--r--kernel/debug/debug_core.c1
-rw-r--r--kernel/debug/kdb/kdb_bt.c1
-rw-r--r--kernel/dma.c1
-rw-r--r--kernel/kexec.c1
-rw-r--r--kernel/rwsem.c1
-rw-r--r--kernel/sched/core.c1
-rw-r--r--kernel/signal.c1
-rw-r--r--kernel/sysctl.c4
-rw-r--r--lib/llist.c1
-rw-r--r--lib/raid6/altivec.uc2
-rw-r--r--net/802/fc.c1
-rw-r--r--net/802/fddi.c1
-rw-r--r--net/802/hippi.c1
-rw-r--r--net/802/tr.c1
-rw-r--r--net/atm/clip.c1
-rw-r--r--net/ax25/af_ax25.c1
-rw-r--r--net/ax25/ax25_addr.c1
-rw-r--r--net/ax25/ax25_dev.c1
-rw-r--r--net/ax25/ax25_ds_in.c1
-rw-r--r--net/ax25/ax25_ds_subr.c1
-rw-r--r--net/ax25/ax25_ds_timer.c1
-rw-r--r--net/ax25/ax25_iface.c1
-rw-r--r--net/ax25/ax25_in.c1
-rw-r--r--net/ax25/ax25_ip.c1
-rw-r--r--net/ax25/ax25_out.c1
-rw-r--r--net/ax25/ax25_route.c1
-rw-r--r--net/ax25/ax25_std_in.c1
-rw-r--r--net/ax25/ax25_std_subr.c1
-rw-r--r--net/ax25/ax25_std_timer.c1
-rw-r--r--net/ax25/ax25_subr.c1
-rw-r--r--net/ax25/ax25_timer.c1
-rw-r--r--net/ax25/ax25_uid.c1
-rw-r--r--net/bluetooth/bnep/sock.c1
-rw-r--r--net/bluetooth/cmtp/sock.c1
-rw-r--r--net/bluetooth/hci_conn.c1
-rw-r--r--net/bluetooth/hci_core.c1
-rw-r--r--net/bluetooth/hci_event.c1
-rw-r--r--net/bluetooth/hci_sock.c1
-rw-r--r--net/bluetooth/l2cap_core.c1
-rw-r--r--net/bluetooth/rfcomm/sock.c1
-rw-r--r--net/bluetooth/sco.c1
-rw-r--r--net/core/datagram.c1
-rw-r--r--net/core/dev.c1
-rw-r--r--net/core/filter.c1
-rw-r--r--net/core/gen_estimator.c1
-rw-r--r--net/core/rtnetlink.c1
-rw-r--r--net/core/scm.c1
-rw-r--r--net/core/skbuff.c1
-rw-r--r--net/core/sock.c1
-rw-r--r--net/core/utils.c1
-rw-r--r--net/decnet/af_decnet.c1
-rw-r--r--net/decnet/dn_dev.c1
-rw-r--r--net/decnet/dn_nsp_in.c1
-rw-r--r--net/decnet/dn_nsp_out.c1
-rw-r--r--net/econet/af_econet.c1
-rw-r--r--net/ethernet/eth.c1
-rw-r--r--net/ipv4/af_inet.c1
-rw-r--r--net/ipv4/arp.c1
-rw-r--r--net/ipv4/devinet.c1
-rw-r--r--net/ipv4/fib_frontend.c1
-rw-r--r--net/ipv4/fib_semantics.c1
-rw-r--r--net/ipv4/fib_trie.c1
-rw-r--r--net/ipv4/icmp.c1
-rw-r--r--net/ipv4/igmp.c1
-rw-r--r--net/ipv4/ip_input.c1
-rw-r--r--net/ipv4/ip_output.c1
-rw-r--r--net/ipv4/ipmr.c1
-rw-r--r--net/ipv4/ping.c1
-rw-r--r--net/ipv4/route.c1
-rw-r--r--net/ipv4/udp.c1
-rw-r--r--net/ipv6/af_inet6.c1
-rw-r--r--net/ipv6/icmp.c1
-rw-r--r--net/ipv6/ip6mr.c1
-rw-r--r--net/irda/irlan/irlan_client.c1
-rw-r--r--net/irda/irlan/irlan_common.c1
-rw-r--r--net/irda/irlan/irlan_provider.c1
-rw-r--r--net/irda/timer.c1
-rw-r--r--net/lapb/lapb_iface.c1
-rw-r--r--net/lapb/lapb_in.c1
-rw-r--r--net/lapb/lapb_out.c1
-rw-r--r--net/lapb/lapb_subr.c1
-rw-r--r--net/lapb/lapb_timer.c1
-rw-r--r--net/netfilter/ipvs/ip_vs_app.c1
-rw-r--r--net/netfilter/ipvs/ip_vs_proto.c1
-rw-r--r--net/netfilter/nfnetlink.c1
-rw-r--r--net/netrom/af_netrom.c1
-rw-r--r--net/netrom/nr_dev.c1
-rw-r--r--net/netrom/nr_in.c1
-rw-r--r--net/netrom/nr_out.c1
-rw-r--r--net/netrom/nr_route.c1
-rw-r--r--net/netrom/nr_subr.c1
-rw-r--r--net/netrom/nr_timer.c1
-rw-r--r--net/openvswitch/datapath.c1
-rw-r--r--net/packet/af_packet.c1
-rw-r--r--net/rose/af_rose.c1
-rw-r--r--net/rose/rose_dev.c1
-rw-r--r--net/rose/rose_in.c1
-rw-r--r--net/rose/rose_link.c1
-rw-r--r--net/rose/rose_out.c1
-rw-r--r--net/rose/rose_route.c1
-rw-r--r--net/rose/rose_subr.c1
-rw-r--r--net/rose/rose_timer.c1
-rw-r--r--net/sunrpc/clnt.c1
-rw-r--r--security/selinux/include/avc.h1
-rw-r--r--security/selinux/include/xfrm.h2
-rw-r--r--sound/oss/os.h1
-rw-r--r--sound/oss/vidc.c1
-rw-r--r--sound/oss/waveartist.c1
-rw-r--r--sound/pci/asihpi/hpios.h1
-rw-r--r--sound/pci/aw2/aw2-saa7146.c1
1603 files changed, 6973 insertions, 7090 deletions
diff --git a/arch/alpha/boot/bootp.c b/arch/alpha/boot/bootp.c
index be61670d409..2a542a50655 100644
--- a/arch/alpha/boot/bootp.c
+++ b/arch/alpha/boot/bootp.c
@@ -13,7 +13,6 @@
13#include <generated/utsrelease.h> 13#include <generated/utsrelease.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15 15
16#include <asm/system.h>
17#include <asm/console.h> 16#include <asm/console.h>
18#include <asm/hwrpb.h> 17#include <asm/hwrpb.h>
19#include <asm/pgtable.h> 18#include <asm/pgtable.h>
diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c
index c98865f2142..d6ad191698d 100644
--- a/arch/alpha/boot/bootpz.c
+++ b/arch/alpha/boot/bootpz.c
@@ -15,7 +15,6 @@
15#include <generated/utsrelease.h> 15#include <generated/utsrelease.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17 17
18#include <asm/system.h>
19#include <asm/console.h> 18#include <asm/console.h>
20#include <asm/hwrpb.h> 19#include <asm/hwrpb.h>
21#include <asm/pgtable.h> 20#include <asm/pgtable.h>
diff --git a/arch/alpha/boot/head.S b/arch/alpha/boot/head.S
index f3d98089b3d..b06812bcac8 100644
--- a/arch/alpha/boot/head.S
+++ b/arch/alpha/boot/head.S
@@ -4,7 +4,6 @@
4 * initial bootloader stuff.. 4 * initial bootloader stuff..
5 */ 5 */
6 6
7#include <asm/system.h>
8 7
9 .set noreorder 8 .set noreorder
10 .globl __start 9 .globl __start
diff --git a/arch/alpha/boot/main.c b/arch/alpha/boot/main.c
index ded57d9a80e..3baf2d1e908 100644
--- a/arch/alpha/boot/main.c
+++ b/arch/alpha/boot/main.c
@@ -11,7 +11,6 @@
11#include <generated/utsrelease.h> 11#include <generated/utsrelease.h>
12#include <linux/mm.h> 12#include <linux/mm.h>
13 13
14#include <asm/system.h>
15#include <asm/console.h> 14#include <asm/console.h>
16#include <asm/hwrpb.h> 15#include <asm/hwrpb.h>
17#include <asm/pgtable.h> 16#include <asm/pgtable.h>
diff --git a/arch/alpha/include/asm/atomic.h b/arch/alpha/include/asm/atomic.h
index 640f909ddd4..f62251e82ff 100644
--- a/arch/alpha/include/asm/atomic.h
+++ b/arch/alpha/include/asm/atomic.h
@@ -3,7 +3,6 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/barrier.h> 5#include <asm/barrier.h>
6#include <asm/system.h>
7 6
8/* 7/*
9 * Atomic operations that C can't guarantee us. Useful for 8 * Atomic operations that C can't guarantee us. Useful for
@@ -169,6 +168,73 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
169 return result; 168 return result;
170} 169}
171 170
171/*
172 * Atomic exchange routines.
173 */
174
175#define __ASM__MB
176#define ____xchg(type, args...) __xchg ## type ## _local(args)
177#define ____cmpxchg(type, args...) __cmpxchg ## type ## _local(args)
178#include <asm/xchg.h>
179
180#define xchg_local(ptr,x) \
181 ({ \
182 __typeof__(*(ptr)) _x_ = (x); \
183 (__typeof__(*(ptr))) __xchg_local((ptr), (unsigned long)_x_, \
184 sizeof(*(ptr))); \
185 })
186
187#define cmpxchg_local(ptr, o, n) \
188 ({ \
189 __typeof__(*(ptr)) _o_ = (o); \
190 __typeof__(*(ptr)) _n_ = (n); \
191 (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \
192 (unsigned long)_n_, \
193 sizeof(*(ptr))); \
194 })
195
196#define cmpxchg64_local(ptr, o, n) \
197 ({ \
198 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
199 cmpxchg_local((ptr), (o), (n)); \
200 })
201
202#ifdef CONFIG_SMP
203#undef __ASM__MB
204#define __ASM__MB "\tmb\n"
205#endif
206#undef ____xchg
207#undef ____cmpxchg
208#define ____xchg(type, args...) __xchg ##type(args)
209#define ____cmpxchg(type, args...) __cmpxchg ##type(args)
210#include <asm/xchg.h>
211
212#define xchg(ptr,x) \
213 ({ \
214 __typeof__(*(ptr)) _x_ = (x); \
215 (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, \
216 sizeof(*(ptr))); \
217 })
218
219#define cmpxchg(ptr, o, n) \
220 ({ \
221 __typeof__(*(ptr)) _o_ = (o); \
222 __typeof__(*(ptr)) _n_ = (n); \
223 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
224 (unsigned long)_n_, sizeof(*(ptr)));\
225 })
226
227#define cmpxchg64(ptr, o, n) \
228 ({ \
229 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
230 cmpxchg((ptr), (o), (n)); \
231 })
232
233#undef __ASM__MB
234#undef ____cmpxchg
235
236#define __HAVE_ARCH_CMPXCHG 1
237
172#define atomic64_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new)) 238#define atomic64_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
173#define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) 239#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
174 240
diff --git a/arch/alpha/include/asm/auxvec.h b/arch/alpha/include/asm/auxvec.h
index e96fe880e31..a3a579dfdb4 100644
--- a/arch/alpha/include/asm/auxvec.h
+++ b/arch/alpha/include/asm/auxvec.h
@@ -21,4 +21,6 @@
21#define AT_L2_CACHESHAPE 36 21#define AT_L2_CACHESHAPE 36
22#define AT_L3_CACHESHAPE 37 22#define AT_L3_CACHESHAPE 37
23 23
24#define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */
25
24#endif /* __ASM_ALPHA_AUXVEC_H */ 26#endif /* __ASM_ALPHA_AUXVEC_H */
diff --git a/arch/alpha/include/asm/core_lca.h b/arch/alpha/include/asm/core_lca.h
index f7cb4b46095..8ee6c516279 100644
--- a/arch/alpha/include/asm/core_lca.h
+++ b/arch/alpha/include/asm/core_lca.h
@@ -1,8 +1,8 @@
1#ifndef __ALPHA_LCA__H__ 1#ifndef __ALPHA_LCA__H__
2#define __ALPHA_LCA__H__ 2#define __ALPHA_LCA__H__
3 3
4#include <asm/system.h>
5#include <asm/compiler.h> 4#include <asm/compiler.h>
5#include <asm/mce.h>
6 6
7/* 7/*
8 * Low Cost Alpha (LCA) definitions (these apply to 21066 and 21068, 8 * Low Cost Alpha (LCA) definitions (these apply to 21066 and 21068,
diff --git a/arch/alpha/include/asm/core_mcpcia.h b/arch/alpha/include/asm/core_mcpcia.h
index 9f67a056b46..ad44bef29fb 100644
--- a/arch/alpha/include/asm/core_mcpcia.h
+++ b/arch/alpha/include/asm/core_mcpcia.h
@@ -7,6 +7,7 @@
7 7
8#include <linux/types.h> 8#include <linux/types.h>
9#include <asm/compiler.h> 9#include <asm/compiler.h>
10#include <asm/mce.h>
10 11
11/* 12/*
12 * MCPCIA is the internal name for a core logic chipset which provides 13 * MCPCIA is the internal name for a core logic chipset which provides
diff --git a/arch/alpha/include/asm/core_t2.h b/arch/alpha/include/asm/core_t2.h
index 91b46801b29..ade9d92e68b 100644
--- a/arch/alpha/include/asm/core_t2.h
+++ b/arch/alpha/include/asm/core_t2.h
@@ -7,7 +7,6 @@
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/spinlock.h> 8#include <linux/spinlock.h>
9#include <asm/compiler.h> 9#include <asm/compiler.h>
10#include <asm/system.h>
11 10
12/* 11/*
13 * T2 is the internal name for the core logic chipset which provides 12 * T2 is the internal name for the core logic chipset which provides
diff --git a/arch/alpha/include/asm/elf.h b/arch/alpha/include/asm/elf.h
index da5449e2217..968d9991f5e 100644
--- a/arch/alpha/include/asm/elf.h
+++ b/arch/alpha/include/asm/elf.h
@@ -2,6 +2,7 @@
2#define __ASM_ALPHA_ELF_H 2#define __ASM_ALPHA_ELF_H
3 3
4#include <asm/auxvec.h> 4#include <asm/auxvec.h>
5#include <asm/special_insns.h>
5 6
6/* Special values for the st_other field in the symbol table. */ 7/* Special values for the st_other field in the symbol table. */
7 8
diff --git a/arch/alpha/include/asm/exec.h b/arch/alpha/include/asm/exec.h
new file mode 100644
index 00000000000..4a5a41f3077
--- /dev/null
+++ b/arch/alpha/include/asm/exec.h
@@ -0,0 +1,6 @@
1#ifndef __ALPHA_EXEC_H
2#define __ALPHA_EXEC_H
3
4#define arch_align_stack(x) (x)
5
6#endif /* __ALPHA_EXEC_H */
diff --git a/arch/alpha/include/asm/fpu.h b/arch/alpha/include/asm/fpu.h
index ecb17a72acc..db00f7885fa 100644
--- a/arch/alpha/include/asm/fpu.h
+++ b/arch/alpha/include/asm/fpu.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_ALPHA_FPU_H 1#ifndef __ASM_ALPHA_FPU_H
2#define __ASM_ALPHA_FPU_H 2#define __ASM_ALPHA_FPU_H
3 3
4#include <asm/special_insns.h>
5
4/* 6/*
5 * Alpha floating-point control register defines: 7 * Alpha floating-point control register defines:
6 */ 8 */
diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h
index 56ff9650135..7a3d38d5ed6 100644
--- a/arch/alpha/include/asm/io.h
+++ b/arch/alpha/include/asm/io.h
@@ -6,7 +6,6 @@
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/mm.h> 7#include <linux/mm.h>
8#include <asm/compiler.h> 8#include <asm/compiler.h>
9#include <asm/system.h>
10#include <asm/pgtable.h> 9#include <asm/pgtable.h>
11#include <asm/machvec.h> 10#include <asm/machvec.h>
12#include <asm/hwrpb.h> 11#include <asm/hwrpb.h>
diff --git a/arch/alpha/include/asm/irqflags.h b/arch/alpha/include/asm/irqflags.h
index 299bbc7e9d7..ffb1726484a 100644
--- a/arch/alpha/include/asm/irqflags.h
+++ b/arch/alpha/include/asm/irqflags.h
@@ -1,7 +1,7 @@
1#ifndef __ALPHA_IRQFLAGS_H 1#ifndef __ALPHA_IRQFLAGS_H
2#define __ALPHA_IRQFLAGS_H 2#define __ALPHA_IRQFLAGS_H
3 3
4#include <asm/system.h> 4#include <asm/pal.h>
5 5
6#define IPL_MIN 0 6#define IPL_MIN 0
7#define IPL_SW0 1 7#define IPL_SW0 1
diff --git a/arch/alpha/include/asm/mce.h b/arch/alpha/include/asm/mce.h
new file mode 100644
index 00000000000..660285b9aca
--- /dev/null
+++ b/arch/alpha/include/asm/mce.h
@@ -0,0 +1,83 @@
1#ifndef __ALPHA_MCE_H
2#define __ALPHA_MCE_H
3
4/*
5 * This is the logout header that should be common to all platforms
6 * (assuming they are running OSF/1 PALcode, I guess).
7 */
8struct el_common {
9 unsigned int size; /* size in bytes of logout area */
10 unsigned int sbz1 : 30; /* should be zero */
11 unsigned int err2 : 1; /* second error */
12 unsigned int retry : 1; /* retry flag */
13 unsigned int proc_offset; /* processor-specific offset */
14 unsigned int sys_offset; /* system-specific offset */
15 unsigned int code; /* machine check code */
16 unsigned int frame_rev; /* frame revision */
17};
18
19/* Machine Check Frame for uncorrectable errors (Large format)
20 * --- This is used to log uncorrectable errors such as
21 * double bit ECC errors.
22 * --- These errors are detected by both processor and systems.
23 */
24struct el_common_EV5_uncorrectable_mcheck {
25 unsigned long shadow[8]; /* Shadow reg. 8-14, 25 */
26 unsigned long paltemp[24]; /* PAL TEMP REGS. */
27 unsigned long exc_addr; /* Address of excepting instruction*/
28 unsigned long exc_sum; /* Summary of arithmetic traps. */
29 unsigned long exc_mask; /* Exception mask (from exc_sum). */
30 unsigned long pal_base; /* Base address for PALcode. */
31 unsigned long isr; /* Interrupt Status Reg. */
32 unsigned long icsr; /* CURRENT SETUP OF EV5 IBOX */
33 unsigned long ic_perr_stat; /* I-CACHE Reg. <11> set Data parity
34 <12> set TAG parity*/
35 unsigned long dc_perr_stat; /* D-CACHE error Reg. Bits set to 1:
36 <2> Data error in bank 0
37 <3> Data error in bank 1
38 <4> Tag error in bank 0
39 <5> Tag error in bank 1 */
40 unsigned long va; /* Effective VA of fault or miss. */
41 unsigned long mm_stat; /* Holds the reason for D-stream
42 fault or D-cache parity errors */
43 unsigned long sc_addr; /* Address that was being accessed
44 when EV5 detected Secondary cache
45 failure. */
46 unsigned long sc_stat; /* Helps determine if the error was
47 TAG/Data parity(Secondary Cache)*/
48 unsigned long bc_tag_addr; /* Contents of EV5 BC_TAG_ADDR */
49 unsigned long ei_addr; /* Physical address of any transfer
50 that is logged in EV5 EI_STAT */
51 unsigned long fill_syndrome; /* For correcting ECC errors. */
52 unsigned long ei_stat; /* Helps identify reason of any
53 processor uncorrectable error
54 at its external interface. */
55 unsigned long ld_lock; /* Contents of EV5 LD_LOCK register*/
56};
57
58struct el_common_EV6_mcheck {
59 unsigned int FrameSize; /* Bytes, including this field */
60 unsigned int FrameFlags; /* <31> = Retry, <30> = Second Error */
61 unsigned int CpuOffset; /* Offset to CPU-specific info */
62 unsigned int SystemOffset; /* Offset to system-specific info */
63 unsigned int MCHK_Code;
64 unsigned int MCHK_Frame_Rev;
65 unsigned long I_STAT; /* EV6 Internal Processor Registers */
66 unsigned long DC_STAT; /* (See the 21264 Spec) */
67 unsigned long C_ADDR;
68 unsigned long DC1_SYNDROME;
69 unsigned long DC0_SYNDROME;
70 unsigned long C_STAT;
71 unsigned long C_STS;
72 unsigned long MM_STAT;
73 unsigned long EXC_ADDR;
74 unsigned long IER_CM;
75 unsigned long ISUM;
76 unsigned long RESERVED0;
77 unsigned long PAL_BASE;
78 unsigned long I_CTL;
79 unsigned long PCTX;
80};
81
82
83#endif /* __ALPHA_MCE_H */
diff --git a/arch/alpha/include/asm/mmu_context.h b/arch/alpha/include/asm/mmu_context.h
index 86c08a02d23..4c51c05333c 100644
--- a/arch/alpha/include/asm/mmu_context.h
+++ b/arch/alpha/include/asm/mmu_context.h
@@ -7,7 +7,6 @@
7 * Copyright (C) 1996, Linus Torvalds 7 * Copyright (C) 1996, Linus Torvalds
8 */ 8 */
9 9
10#include <asm/system.h>
11#include <asm/machvec.h> 10#include <asm/machvec.h>
12#include <asm/compiler.h> 11#include <asm/compiler.h>
13#include <asm-generic/mm_hooks.h> 12#include <asm-generic/mm_hooks.h>
diff --git a/arch/alpha/include/asm/pal.h b/arch/alpha/include/asm/pal.h
index 9b4ba0d6f00..6699ee58342 100644
--- a/arch/alpha/include/asm/pal.h
+++ b/arch/alpha/include/asm/pal.h
@@ -48,4 +48,116 @@
48#define PAL_retsys 61 48#define PAL_retsys 61
49#define PAL_rti 63 49#define PAL_rti 63
50 50
51#ifdef __KERNEL__
52#ifndef __ASSEMBLY__
53
54extern void halt(void) __attribute__((noreturn));
55#define __halt() __asm__ __volatile__ ("call_pal %0 #halt" : : "i" (PAL_halt))
56
57#define imb() \
58__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory")
59
60#define draina() \
61__asm__ __volatile__ ("call_pal %0 #draina" : : "i" (PAL_draina) : "memory")
62
63#define __CALL_PAL_R0(NAME, TYPE) \
64extern inline TYPE NAME(void) \
65{ \
66 register TYPE __r0 __asm__("$0"); \
67 __asm__ __volatile__( \
68 "call_pal %1 # " #NAME \
69 :"=r" (__r0) \
70 :"i" (PAL_ ## NAME) \
71 :"$1", "$16", "$22", "$23", "$24", "$25"); \
72 return __r0; \
73}
74
75#define __CALL_PAL_W1(NAME, TYPE0) \
76extern inline void NAME(TYPE0 arg0) \
77{ \
78 register TYPE0 __r16 __asm__("$16") = arg0; \
79 __asm__ __volatile__( \
80 "call_pal %1 # "#NAME \
81 : "=r"(__r16) \
82 : "i"(PAL_ ## NAME), "0"(__r16) \
83 : "$1", "$22", "$23", "$24", "$25"); \
84}
85
86#define __CALL_PAL_W2(NAME, TYPE0, TYPE1) \
87extern inline void NAME(TYPE0 arg0, TYPE1 arg1) \
88{ \
89 register TYPE0 __r16 __asm__("$16") = arg0; \
90 register TYPE1 __r17 __asm__("$17") = arg1; \
91 __asm__ __volatile__( \
92 "call_pal %2 # "#NAME \
93 : "=r"(__r16), "=r"(__r17) \
94 : "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17) \
95 : "$1", "$22", "$23", "$24", "$25"); \
96}
97
98#define __CALL_PAL_RW1(NAME, RTYPE, TYPE0) \
99extern inline RTYPE NAME(TYPE0 arg0) \
100{ \
101 register RTYPE __r0 __asm__("$0"); \
102 register TYPE0 __r16 __asm__("$16") = arg0; \
103 __asm__ __volatile__( \
104 "call_pal %2 # "#NAME \
105 : "=r"(__r16), "=r"(__r0) \
106 : "i"(PAL_ ## NAME), "0"(__r16) \
107 : "$1", "$22", "$23", "$24", "$25"); \
108 return __r0; \
109}
110
111#define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1) \
112extern inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1) \
113{ \
114 register RTYPE __r0 __asm__("$0"); \
115 register TYPE0 __r16 __asm__("$16") = arg0; \
116 register TYPE1 __r17 __asm__("$17") = arg1; \
117 __asm__ __volatile__( \
118 "call_pal %3 # "#NAME \
119 : "=r"(__r16), "=r"(__r17), "=r"(__r0) \
120 : "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17) \
121 : "$1", "$22", "$23", "$24", "$25"); \
122 return __r0; \
123}
124
125__CALL_PAL_W1(cflush, unsigned long);
126__CALL_PAL_R0(rdmces, unsigned long);
127__CALL_PAL_R0(rdps, unsigned long);
128__CALL_PAL_R0(rdusp, unsigned long);
129__CALL_PAL_RW1(swpipl, unsigned long, unsigned long);
130__CALL_PAL_R0(whami, unsigned long);
131__CALL_PAL_W2(wrent, void*, unsigned long);
132__CALL_PAL_W1(wripir, unsigned long);
133__CALL_PAL_W1(wrkgp, unsigned long);
134__CALL_PAL_W1(wrmces, unsigned long);
135__CALL_PAL_RW2(wrperfmon, unsigned long, unsigned long, unsigned long);
136__CALL_PAL_W1(wrusp, unsigned long);
137__CALL_PAL_W1(wrvptptr, unsigned long);
138
139/*
140 * TB routines..
141 */
142#define __tbi(nr,arg,arg1...) \
143({ \
144 register unsigned long __r16 __asm__("$16") = (nr); \
145 register unsigned long __r17 __asm__("$17"); arg; \
146 __asm__ __volatile__( \
147 "call_pal %3 #__tbi" \
148 :"=r" (__r16),"=r" (__r17) \
149 :"0" (__r16),"i" (PAL_tbi) ,##arg1 \
150 :"$0", "$1", "$22", "$23", "$24", "$25"); \
151})
152
153#define tbi(x,y) __tbi(x,__r17=(y),"1" (__r17))
154#define tbisi(x) __tbi(1,__r17=(x),"1" (__r17))
155#define tbisd(x) __tbi(2,__r17=(x),"1" (__r17))
156#define tbis(x) __tbi(3,__r17=(x),"1" (__r17))
157#define tbiap() __tbi(-1, /* no second argument */)
158#define tbia() __tbi(-2, /* no second argument */)
159
160#endif /* !__ASSEMBLY__ */
161#endif /* __KERNEL__ */
162
51#endif /* __ALPHA_PAL_H */ 163#endif /* __ALPHA_PAL_H */
diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h
index de98a732683..81a4342d5a3 100644
--- a/arch/alpha/include/asm/pgtable.h
+++ b/arch/alpha/include/asm/pgtable.h
@@ -15,6 +15,7 @@
15#include <asm/page.h> 15#include <asm/page.h>
16#include <asm/processor.h> /* For TASK_SIZE */ 16#include <asm/processor.h> /* For TASK_SIZE */
17#include <asm/machvec.h> 17#include <asm/machvec.h>
18#include <asm/setup.h>
18 19
19struct mm_struct; 20struct mm_struct;
20struct vm_area_struct; 21struct vm_area_struct;
diff --git a/arch/alpha/include/asm/setup.h b/arch/alpha/include/asm/setup.h
index 2e023a4aa31..b50014b3090 100644
--- a/arch/alpha/include/asm/setup.h
+++ b/arch/alpha/include/asm/setup.h
@@ -3,4 +3,40 @@
3 3
4#define COMMAND_LINE_SIZE 256 4#define COMMAND_LINE_SIZE 256
5 5
6/*
7 * We leave one page for the initial stack page, and one page for
8 * the initial process structure. Also, the console eats 3 MB for
9 * the initial bootloader (one of which we can reclaim later).
10 */
11#define BOOT_PCB 0x20000000
12#define BOOT_ADDR 0x20000000
13/* Remove when official MILO sources have ELF support: */
14#define BOOT_SIZE (16*1024)
15
16#ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS
17#define KERNEL_START_PHYS 0x300000 /* Old bootloaders hardcoded this. */
18#else
19#define KERNEL_START_PHYS 0x1000000 /* required: Wildfire/Titan/Marvel */
20#endif
21
22#define KERNEL_START (PAGE_OFFSET+KERNEL_START_PHYS)
23#define SWAPPER_PGD KERNEL_START
24#define INIT_STACK (PAGE_OFFSET+KERNEL_START_PHYS+0x02000)
25#define EMPTY_PGT (PAGE_OFFSET+KERNEL_START_PHYS+0x04000)
26#define EMPTY_PGE (PAGE_OFFSET+KERNEL_START_PHYS+0x08000)
27#define ZERO_PGE (PAGE_OFFSET+KERNEL_START_PHYS+0x0A000)
28
29#define START_ADDR (PAGE_OFFSET+KERNEL_START_PHYS+0x10000)
30
31/*
32 * This is setup by the secondary bootstrap loader. Because
33 * the zero page is zeroed out as soon as the vm system is
34 * initialized, we need to copy things out into a more permanent
35 * place.
36 */
37#define PARAM ZERO_PGE
38#define COMMAND_LINE ((char*)(PARAM + 0x0000))
39#define INITRD_START (*(unsigned long *) (PARAM+0x100))
40#define INITRD_SIZE (*(unsigned long *) (PARAM+0x108))
41
6#endif 42#endif
diff --git a/arch/alpha/include/asm/special_insns.h b/arch/alpha/include/asm/special_insns.h
new file mode 100644
index 00000000000..88d3452b21f
--- /dev/null
+++ b/arch/alpha/include/asm/special_insns.h
@@ -0,0 +1,41 @@
1#ifndef __ALPHA_SPECIAL_INSNS_H
2#define __ALPHA_SPECIAL_INSNS_H
3
4enum implver_enum {
5 IMPLVER_EV4,
6 IMPLVER_EV5,
7 IMPLVER_EV6
8};
9
10#ifdef CONFIG_ALPHA_GENERIC
11#define implver() \
12({ unsigned long __implver; \
13 __asm__ ("implver %0" : "=r"(__implver)); \
14 (enum implver_enum) __implver; })
15#else
16/* Try to eliminate some dead code. */
17#ifdef CONFIG_ALPHA_EV4
18#define implver() IMPLVER_EV4
19#endif
20#ifdef CONFIG_ALPHA_EV5
21#define implver() IMPLVER_EV5
22#endif
23#if defined(CONFIG_ALPHA_EV6)
24#define implver() IMPLVER_EV6
25#endif
26#endif
27
28enum amask_enum {
29 AMASK_BWX = (1UL << 0),
30 AMASK_FIX = (1UL << 1),
31 AMASK_CIX = (1UL << 2),
32 AMASK_MAX = (1UL << 8),
33 AMASK_PRECISE_TRAP = (1UL << 9),
34};
35
36#define amask(mask) \
37({ unsigned long __amask, __input = (mask); \
38 __asm__ ("amask %1,%0" : "=r"(__amask) : "rI"(__input)); \
39 __amask; })
40
41#endif /* __ALPHA_SPECIAL_INSNS_H */
diff --git a/arch/alpha/include/asm/spinlock.h b/arch/alpha/include/asm/spinlock.h
index d0faca1e992..3bba21e41b8 100644
--- a/arch/alpha/include/asm/spinlock.h
+++ b/arch/alpha/include/asm/spinlock.h
@@ -1,7 +1,6 @@
1#ifndef _ALPHA_SPINLOCK_H 1#ifndef _ALPHA_SPINLOCK_H
2#define _ALPHA_SPINLOCK_H 2#define _ALPHA_SPINLOCK_H
3 3
4#include <asm/system.h>
5#include <linux/kernel.h> 4#include <linux/kernel.h>
6#include <asm/current.h> 5#include <asm/current.h>
7 6
diff --git a/arch/alpha/include/asm/switch_to.h b/arch/alpha/include/asm/switch_to.h
new file mode 100644
index 00000000000..44c0d4f2c0b
--- /dev/null
+++ b/arch/alpha/include/asm/switch_to.h
@@ -0,0 +1,14 @@
1#ifndef __ALPHA_SWITCH_TO_H
2#define __ALPHA_SWITCH_TO_H
3
4
5struct task_struct;
6extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct *);
7
8#define switch_to(P,N,L) \
9 do { \
10 (L) = alpha_switch_to(virt_to_phys(&task_thread_info(N)->pcb), (P)); \
11 check_mmu_context(); \
12 } while (0)
13
14#endif /* __ALPHA_SWITCH_TO_H */
diff --git a/arch/alpha/include/asm/system.h b/arch/alpha/include/asm/system.h
deleted file mode 100644
index 9f78e693463..00000000000
--- a/arch/alpha/include/asm/system.h
+++ /dev/null
@@ -1,354 +0,0 @@
1#ifndef __ALPHA_SYSTEM_H
2#define __ALPHA_SYSTEM_H
3
4#include <asm/pal.h>
5#include <asm/page.h>
6#include <asm/barrier.h>
7
8/*
9 * System defines.. Note that this is included both from .c and .S
10 * files, so it does only defines, not any C code.
11 */
12
13/*
14 * We leave one page for the initial stack page, and one page for
15 * the initial process structure. Also, the console eats 3 MB for
16 * the initial bootloader (one of which we can reclaim later).
17 */
18#define BOOT_PCB 0x20000000
19#define BOOT_ADDR 0x20000000
20/* Remove when official MILO sources have ELF support: */
21#define BOOT_SIZE (16*1024)
22
23#ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS
24#define KERNEL_START_PHYS 0x300000 /* Old bootloaders hardcoded this. */
25#else
26#define KERNEL_START_PHYS 0x1000000 /* required: Wildfire/Titan/Marvel */
27#endif
28
29#define KERNEL_START (PAGE_OFFSET+KERNEL_START_PHYS)
30#define SWAPPER_PGD KERNEL_START
31#define INIT_STACK (PAGE_OFFSET+KERNEL_START_PHYS+0x02000)
32#define EMPTY_PGT (PAGE_OFFSET+KERNEL_START_PHYS+0x04000)
33#define EMPTY_PGE (PAGE_OFFSET+KERNEL_START_PHYS+0x08000)
34#define ZERO_PGE (PAGE_OFFSET+KERNEL_START_PHYS+0x0A000)
35
36#define START_ADDR (PAGE_OFFSET+KERNEL_START_PHYS+0x10000)
37
38/*
39 * This is setup by the secondary bootstrap loader. Because
40 * the zero page is zeroed out as soon as the vm system is
41 * initialized, we need to copy things out into a more permanent
42 * place.
43 */
44#define PARAM ZERO_PGE
45#define COMMAND_LINE ((char*)(PARAM + 0x0000))
46#define INITRD_START (*(unsigned long *) (PARAM+0x100))
47#define INITRD_SIZE (*(unsigned long *) (PARAM+0x108))
48
49#ifndef __ASSEMBLY__
50#include <linux/kernel.h>
51#define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */
52
53/*
54 * This is the logout header that should be common to all platforms
55 * (assuming they are running OSF/1 PALcode, I guess).
56 */
57struct el_common {
58 unsigned int size; /* size in bytes of logout area */
59 unsigned int sbz1 : 30; /* should be zero */
60 unsigned int err2 : 1; /* second error */
61 unsigned int retry : 1; /* retry flag */
62 unsigned int proc_offset; /* processor-specific offset */
63 unsigned int sys_offset; /* system-specific offset */
64 unsigned int code; /* machine check code */
65 unsigned int frame_rev; /* frame revision */
66};
67
68/* Machine Check Frame for uncorrectable errors (Large format)
69 * --- This is used to log uncorrectable errors such as
70 * double bit ECC errors.
71 * --- These errors are detected by both processor and systems.
72 */
73struct el_common_EV5_uncorrectable_mcheck {
74 unsigned long shadow[8]; /* Shadow reg. 8-14, 25 */
75 unsigned long paltemp[24]; /* PAL TEMP REGS. */
76 unsigned long exc_addr; /* Address of excepting instruction*/
77 unsigned long exc_sum; /* Summary of arithmetic traps. */
78 unsigned long exc_mask; /* Exception mask (from exc_sum). */
79 unsigned long pal_base; /* Base address for PALcode. */
80 unsigned long isr; /* Interrupt Status Reg. */
81 unsigned long icsr; /* CURRENT SETUP OF EV5 IBOX */
82 unsigned long ic_perr_stat; /* I-CACHE Reg. <11> set Data parity
83 <12> set TAG parity*/
84 unsigned long dc_perr_stat; /* D-CACHE error Reg. Bits set to 1:
85 <2> Data error in bank 0
86 <3> Data error in bank 1
87 <4> Tag error in bank 0
88 <5> Tag error in bank 1 */
89 unsigned long va; /* Effective VA of fault or miss. */
90 unsigned long mm_stat; /* Holds the reason for D-stream
91 fault or D-cache parity errors */
92 unsigned long sc_addr; /* Address that was being accessed
93 when EV5 detected Secondary cache
94 failure. */
95 unsigned long sc_stat; /* Helps determine if the error was
96 TAG/Data parity(Secondary Cache)*/
97 unsigned long bc_tag_addr; /* Contents of EV5 BC_TAG_ADDR */
98 unsigned long ei_addr; /* Physical address of any transfer
99 that is logged in EV5 EI_STAT */
100 unsigned long fill_syndrome; /* For correcting ECC errors. */
101 unsigned long ei_stat; /* Helps identify reason of any
102 processor uncorrectable error
103 at its external interface. */
104 unsigned long ld_lock; /* Contents of EV5 LD_LOCK register*/
105};
106
107struct el_common_EV6_mcheck {
108 unsigned int FrameSize; /* Bytes, including this field */
109 unsigned int FrameFlags; /* <31> = Retry, <30> = Second Error */
110 unsigned int CpuOffset; /* Offset to CPU-specific info */
111 unsigned int SystemOffset; /* Offset to system-specific info */
112 unsigned int MCHK_Code;
113 unsigned int MCHK_Frame_Rev;
114 unsigned long I_STAT; /* EV6 Internal Processor Registers */
115 unsigned long DC_STAT; /* (See the 21264 Spec) */
116 unsigned long C_ADDR;
117 unsigned long DC1_SYNDROME;
118 unsigned long DC0_SYNDROME;
119 unsigned long C_STAT;
120 unsigned long C_STS;
121 unsigned long MM_STAT;
122 unsigned long EXC_ADDR;
123 unsigned long IER_CM;
124 unsigned long ISUM;
125 unsigned long RESERVED0;
126 unsigned long PAL_BASE;
127 unsigned long I_CTL;
128 unsigned long PCTX;
129};
130
131extern void halt(void) __attribute__((noreturn));
132#define __halt() __asm__ __volatile__ ("call_pal %0 #halt" : : "i" (PAL_halt))
133
134#define switch_to(P,N,L) \
135 do { \
136 (L) = alpha_switch_to(virt_to_phys(&task_thread_info(N)->pcb), (P)); \
137 check_mmu_context(); \
138 } while (0)
139
140struct task_struct;
141extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*);
142
143#define imb() \
144__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory")
145
146#define draina() \
147__asm__ __volatile__ ("call_pal %0 #draina" : : "i" (PAL_draina) : "memory")
148
149enum implver_enum {
150 IMPLVER_EV4,
151 IMPLVER_EV5,
152 IMPLVER_EV6
153};
154
155#ifdef CONFIG_ALPHA_GENERIC
156#define implver() \
157({ unsigned long __implver; \
158 __asm__ ("implver %0" : "=r"(__implver)); \
159 (enum implver_enum) __implver; })
160#else
161/* Try to eliminate some dead code. */
162#ifdef CONFIG_ALPHA_EV4
163#define implver() IMPLVER_EV4
164#endif
165#ifdef CONFIG_ALPHA_EV5
166#define implver() IMPLVER_EV5
167#endif
168#if defined(CONFIG_ALPHA_EV6)
169#define implver() IMPLVER_EV6
170#endif
171#endif
172
173enum amask_enum {
174 AMASK_BWX = (1UL << 0),
175 AMASK_FIX = (1UL << 1),
176 AMASK_CIX = (1UL << 2),
177 AMASK_MAX = (1UL << 8),
178 AMASK_PRECISE_TRAP = (1UL << 9),
179};
180
181#define amask(mask) \
182({ unsigned long __amask, __input = (mask); \
183 __asm__ ("amask %1,%0" : "=r"(__amask) : "rI"(__input)); \
184 __amask; })
185
186#define __CALL_PAL_R0(NAME, TYPE) \
187extern inline TYPE NAME(void) \
188{ \
189 register TYPE __r0 __asm__("$0"); \
190 __asm__ __volatile__( \
191 "call_pal %1 # " #NAME \
192 :"=r" (__r0) \
193 :"i" (PAL_ ## NAME) \
194 :"$1", "$16", "$22", "$23", "$24", "$25"); \
195 return __r0; \
196}
197
198#define __CALL_PAL_W1(NAME, TYPE0) \
199extern inline void NAME(TYPE0 arg0) \
200{ \
201 register TYPE0 __r16 __asm__("$16") = arg0; \
202 __asm__ __volatile__( \
203 "call_pal %1 # "#NAME \
204 : "=r"(__r16) \
205 : "i"(PAL_ ## NAME), "0"(__r16) \
206 : "$1", "$22", "$23", "$24", "$25"); \
207}
208
209#define __CALL_PAL_W2(NAME, TYPE0, TYPE1) \
210extern inline void NAME(TYPE0 arg0, TYPE1 arg1) \
211{ \
212 register TYPE0 __r16 __asm__("$16") = arg0; \
213 register TYPE1 __r17 __asm__("$17") = arg1; \
214 __asm__ __volatile__( \
215 "call_pal %2 # "#NAME \
216 : "=r"(__r16), "=r"(__r17) \
217 : "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17) \
218 : "$1", "$22", "$23", "$24", "$25"); \
219}
220
221#define __CALL_PAL_RW1(NAME, RTYPE, TYPE0) \
222extern inline RTYPE NAME(TYPE0 arg0) \
223{ \
224 register RTYPE __r0 __asm__("$0"); \
225 register TYPE0 __r16 __asm__("$16") = arg0; \
226 __asm__ __volatile__( \
227 "call_pal %2 # "#NAME \
228 : "=r"(__r16), "=r"(__r0) \
229 : "i"(PAL_ ## NAME), "0"(__r16) \
230 : "$1", "$22", "$23", "$24", "$25"); \
231 return __r0; \
232}
233
234#define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1) \
235extern inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1) \
236{ \
237 register RTYPE __r0 __asm__("$0"); \
238 register TYPE0 __r16 __asm__("$16") = arg0; \
239 register TYPE1 __r17 __asm__("$17") = arg1; \
240 __asm__ __volatile__( \
241 "call_pal %3 # "#NAME \
242 : "=r"(__r16), "=r"(__r17), "=r"(__r0) \
243 : "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17) \
244 : "$1", "$22", "$23", "$24", "$25"); \
245 return __r0; \
246}
247
248__CALL_PAL_W1(cflush, unsigned long);
249__CALL_PAL_R0(rdmces, unsigned long);
250__CALL_PAL_R0(rdps, unsigned long);
251__CALL_PAL_R0(rdusp, unsigned long);
252__CALL_PAL_RW1(swpipl, unsigned long, unsigned long);
253__CALL_PAL_R0(whami, unsigned long);
254__CALL_PAL_W2(wrent, void*, unsigned long);
255__CALL_PAL_W1(wripir, unsigned long);
256__CALL_PAL_W1(wrkgp, unsigned long);
257__CALL_PAL_W1(wrmces, unsigned long);
258__CALL_PAL_RW2(wrperfmon, unsigned long, unsigned long, unsigned long);
259__CALL_PAL_W1(wrusp, unsigned long);
260__CALL_PAL_W1(wrvptptr, unsigned long);
261
262/*
263 * TB routines..
264 */
265#define __tbi(nr,arg,arg1...) \
266({ \
267 register unsigned long __r16 __asm__("$16") = (nr); \
268 register unsigned long __r17 __asm__("$17"); arg; \
269 __asm__ __volatile__( \
270 "call_pal %3 #__tbi" \
271 :"=r" (__r16),"=r" (__r17) \
272 :"0" (__r16),"i" (PAL_tbi) ,##arg1 \
273 :"$0", "$1", "$22", "$23", "$24", "$25"); \
274})
275
276#define tbi(x,y) __tbi(x,__r17=(y),"1" (__r17))
277#define tbisi(x) __tbi(1,__r17=(x),"1" (__r17))
278#define tbisd(x) __tbi(2,__r17=(x),"1" (__r17))
279#define tbis(x) __tbi(3,__r17=(x),"1" (__r17))
280#define tbiap() __tbi(-1, /* no second argument */)
281#define tbia() __tbi(-2, /* no second argument */)
282
283/*
284 * Atomic exchange routines.
285 */
286
287#define __ASM__MB
288#define ____xchg(type, args...) __xchg ## type ## _local(args)
289#define ____cmpxchg(type, args...) __cmpxchg ## type ## _local(args)
290#include <asm/xchg.h>
291
292#define xchg_local(ptr,x) \
293 ({ \
294 __typeof__(*(ptr)) _x_ = (x); \
295 (__typeof__(*(ptr))) __xchg_local((ptr), (unsigned long)_x_, \
296 sizeof(*(ptr))); \
297 })
298
299#define cmpxchg_local(ptr, o, n) \
300 ({ \
301 __typeof__(*(ptr)) _o_ = (o); \
302 __typeof__(*(ptr)) _n_ = (n); \
303 (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \
304 (unsigned long)_n_, \
305 sizeof(*(ptr))); \
306 })
307
308#define cmpxchg64_local(ptr, o, n) \
309 ({ \
310 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
311 cmpxchg_local((ptr), (o), (n)); \
312 })
313
314#ifdef CONFIG_SMP
315#undef __ASM__MB
316#define __ASM__MB "\tmb\n"
317#endif
318#undef ____xchg
319#undef ____cmpxchg
320#define ____xchg(type, args...) __xchg ##type(args)
321#define ____cmpxchg(type, args...) __cmpxchg ##type(args)
322#include <asm/xchg.h>
323
324#define xchg(ptr,x) \
325 ({ \
326 __typeof__(*(ptr)) _x_ = (x); \
327 (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, \
328 sizeof(*(ptr))); \
329 })
330
331#define cmpxchg(ptr, o, n) \
332 ({ \
333 __typeof__(*(ptr)) _o_ = (o); \
334 __typeof__(*(ptr)) _n_ = (n); \
335 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
336 (unsigned long)_n_, sizeof(*(ptr)));\
337 })
338
339#define cmpxchg64(ptr, o, n) \
340 ({ \
341 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
342 cmpxchg((ptr), (o), (n)); \
343 })
344
345#undef __ASM__MB
346#undef ____cmpxchg
347
348#define __HAVE_ARCH_CMPXCHG 1
349
350#endif /* __ASSEMBLY__ */
351
352#define arch_align_stack(x) (x)
353
354#endif
diff --git a/arch/alpha/include/asm/xchg.h b/arch/alpha/include/asm/xchg.h
index beba1b803e0..1d1b436fbff 100644
--- a/arch/alpha/include/asm/xchg.h
+++ b/arch/alpha/include/asm/xchg.h
@@ -1,4 +1,4 @@
1#ifndef __ALPHA_SYSTEM_H 1#ifndef _ALPHA_ATOMIC_H
2#error Do not include xchg.h directly! 2#error Do not include xchg.h directly!
3#else 3#else
4/* 4/*
diff --git a/arch/alpha/kernel/core_apecs.c b/arch/alpha/kernel/core_apecs.c
index ca46b2c2445..708c831efa7 100644
--- a/arch/alpha/kernel/core_apecs.c
+++ b/arch/alpha/kernel/core_apecs.c
@@ -21,6 +21,7 @@
21 21
22#include <asm/ptrace.h> 22#include <asm/ptrace.h>
23#include <asm/smp.h> 23#include <asm/smp.h>
24#include <asm/mce.h>
24 25
25#include "proto.h" 26#include "proto.h"
26#include "pci_impl.h" 27#include "pci_impl.h"
diff --git a/arch/alpha/kernel/core_cia.c b/arch/alpha/kernel/core_cia.c
index 1d6ee6c985f..c44339e176c 100644
--- a/arch/alpha/kernel/core_cia.c
+++ b/arch/alpha/kernel/core_cia.c
@@ -23,6 +23,7 @@
23#include <linux/bootmem.h> 23#include <linux/bootmem.h>
24 24
25#include <asm/ptrace.h> 25#include <asm/ptrace.h>
26#include <asm/mce.h>
26 27
27#include "proto.h" 28#include "proto.h"
28#include "pci_impl.h" 29#include "pci_impl.h"
diff --git a/arch/alpha/kernel/core_t2.c b/arch/alpha/kernel/core_t2.c
index 2f770e99428..3ada4f7b085 100644
--- a/arch/alpha/kernel/core_t2.c
+++ b/arch/alpha/kernel/core_t2.c
@@ -21,6 +21,7 @@
21 21
22#include <asm/ptrace.h> 22#include <asm/ptrace.h>
23#include <asm/delay.h> 23#include <asm/delay.h>
24#include <asm/mce.h>
24 25
25#include "proto.h" 26#include "proto.h"
26#include "pci_impl.h" 27#include "pci_impl.h"
diff --git a/arch/alpha/kernel/err_impl.h b/arch/alpha/kernel/err_impl.h
index 0c010ca4611..ae529c41603 100644
--- a/arch/alpha/kernel/err_impl.h
+++ b/arch/alpha/kernel/err_impl.h
@@ -7,6 +7,8 @@
7 * implementations. 7 * implementations.
8 */ 8 */
9 9
10#include <asm/mce.h>
11
10union el_timestamp; 12union el_timestamp;
11struct el_subpacket; 13struct el_subpacket;
12struct ev7_lf_subpackets; 14struct ev7_lf_subpackets;
diff --git a/arch/alpha/kernel/head.S b/arch/alpha/kernel/head.S
index 4bdd1d2ff35..c352499ab9f 100644
--- a/arch/alpha/kernel/head.S
+++ b/arch/alpha/kernel/head.S
@@ -8,14 +8,12 @@
8 */ 8 */
9 9
10#include <linux/init.h> 10#include <linux/init.h>
11#include <asm/system.h>
12#include <asm/asm-offsets.h> 11#include <asm/asm-offsets.h>
12#include <asm/pal.h>
13#include <asm/setup.h>
13 14
14__HEAD 15__HEAD
15.globl swapper_pg_dir
16.globl _stext 16.globl _stext
17swapper_pg_dir=SWAPPER_PGD
18
19 .set noreorder 17 .set noreorder
20 .globl __start 18 .globl __start
21 .ent __start 19 .ent __start
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index 381431a2d6d..2872accd221 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -26,7 +26,6 @@
26#include <linux/profile.h> 26#include <linux/profile.h>
27#include <linux/bitops.h> 27#include <linux/bitops.h>
28 28
29#include <asm/system.h>
30#include <asm/io.h> 29#include <asm/io.h>
31#include <asm/uaccess.h> 30#include <asm/uaccess.h>
32 31
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index 51b7fbd9e4c..772ddfdb71a 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -11,6 +11,7 @@
11#include <asm/machvec.h> 11#include <asm/machvec.h>
12#include <asm/dma.h> 12#include <asm/dma.h>
13#include <asm/perf_event.h> 13#include <asm/perf_event.h>
14#include <asm/mce.h>
14 15
15#include "proto.h" 16#include "proto.h"
16#include "irq_impl.h" 17#include "irq_impl.h"
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 01e8715e26d..49ee3193477 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -40,7 +40,6 @@
40#include <asm/fpu.h> 40#include <asm/fpu.h>
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/uaccess.h> 42#include <asm/uaccess.h>
43#include <asm/system.h>
44#include <asm/sysinfo.h> 43#include <asm/sysinfo.h>
45#include <asm/thread_info.h> 44#include <asm/thread_info.h>
46#include <asm/hwrpb.h> 45#include <asm/hwrpb.h>
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 89bbe5b4114..153d3fce3e8 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -31,7 +31,6 @@
31 31
32#include <asm/reg.h> 32#include <asm/reg.h>
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34#include <asm/system.h>
35#include <asm/io.h> 34#include <asm/io.h>
36#include <asm/pgtable.h> 35#include <asm/pgtable.h>
37#include <asm/hwrpb.h> 36#include <asm/hwrpb.h>
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
index e2af5eb59bb..54616f496ae 100644
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -16,7 +16,6 @@
16 16
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <asm/pgtable.h> 18#include <asm/pgtable.h>
19#include <asm/system.h>
20#include <asm/fpu.h> 19#include <asm/fpu.h>
21 20
22#include "proto.h" 21#include "proto.h"
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index 32de56067e6..9e3107cc5eb 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -55,7 +55,6 @@ static struct notifier_block alpha_panic_block = {
55 55
56#include <asm/uaccess.h> 56#include <asm/uaccess.h>
57#include <asm/pgtable.h> 57#include <asm/pgtable.h>
58#include <asm/system.h>
59#include <asm/hwrpb.h> 58#include <asm/hwrpb.h>
60#include <asm/dma.h> 59#include <asm/dma.h>
61#include <asm/mmu_context.h> 60#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c
index 8606d77e516..118dc6af180 100644
--- a/arch/alpha/kernel/sys_alcor.c
+++ b/arch/alpha/kernel/sys_alcor.c
@@ -18,7 +18,6 @@
18#include <linux/bitops.h> 18#include <linux/bitops.h>
19 19
20#include <asm/ptrace.h> 20#include <asm/ptrace.h>
21#include <asm/system.h>
22#include <asm/io.h> 21#include <asm/io.h>
23#include <asm/dma.h> 22#include <asm/dma.h>
24#include <asm/mmu_context.h> 23#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_cabriolet.c b/arch/alpha/kernel/sys_cabriolet.c
index 1029619fb6c..4c50f8f40cb 100644
--- a/arch/alpha/kernel/sys_cabriolet.c
+++ b/arch/alpha/kernel/sys_cabriolet.c
@@ -18,7 +18,6 @@
18#include <linux/bitops.h> 18#include <linux/bitops.h>
19 19
20#include <asm/ptrace.h> 20#include <asm/ptrace.h>
21#include <asm/system.h>
22#include <asm/dma.h> 21#include <asm/dma.h>
23#include <asm/irq.h> 22#include <asm/irq.h>
24#include <asm/mmu_context.h> 23#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c
index 13f0717fc7f..5bf401f7ea9 100644
--- a/arch/alpha/kernel/sys_dp264.c
+++ b/arch/alpha/kernel/sys_dp264.c
@@ -21,7 +21,6 @@
21#include <linux/bitops.h> 21#include <linux/bitops.h>
22 22
23#include <asm/ptrace.h> 23#include <asm/ptrace.h>
24#include <asm/system.h>
25#include <asm/dma.h> 24#include <asm/dma.h>
26#include <asm/irq.h> 25#include <asm/irq.h>
27#include <asm/mmu_context.h> 26#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_eb64p.c b/arch/alpha/kernel/sys_eb64p.c
index 3c6c13cd8b1..ad40a425e84 100644
--- a/arch/alpha/kernel/sys_eb64p.c
+++ b/arch/alpha/kernel/sys_eb64p.c
@@ -17,7 +17,6 @@
17#include <linux/bitops.h> 17#include <linux/bitops.h>
18 18
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/system.h>
21#include <asm/dma.h> 20#include <asm/dma.h>
22#include <asm/irq.h> 21#include <asm/irq.h>
23#include <asm/mmu_context.h> 22#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_eiger.c b/arch/alpha/kernel/sys_eiger.c
index 35f480db771..79d69d7f63f 100644
--- a/arch/alpha/kernel/sys_eiger.c
+++ b/arch/alpha/kernel/sys_eiger.c
@@ -18,7 +18,6 @@
18#include <linux/bitops.h> 18#include <linux/bitops.h>
19 19
20#include <asm/ptrace.h> 20#include <asm/ptrace.h>
21#include <asm/system.h>
22#include <asm/dma.h> 21#include <asm/dma.h>
23#include <asm/irq.h> 22#include <asm/irq.h>
24#include <asm/mmu_context.h> 23#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c
index 7f1a87f176e..5a0af11b3a6 100644
--- a/arch/alpha/kernel/sys_jensen.c
+++ b/arch/alpha/kernel/sys_jensen.c
@@ -15,7 +15,6 @@
15#include <linux/init.h> 15#include <linux/init.h>
16 16
17#include <asm/ptrace.h> 17#include <asm/ptrace.h>
18#include <asm/system.h>
19 18
20#define __EXTERN_INLINE inline 19#define __EXTERN_INLINE inline
21#include <asm/io.h> 20#include <asm/io.h>
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index fc8b1250861..14a4b6a7cf5 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -13,7 +13,6 @@
13#include <linux/bitops.h> 13#include <linux/bitops.h>
14 14
15#include <asm/ptrace.h> 15#include <asm/ptrace.h>
16#include <asm/system.h>
17#include <asm/dma.h> 16#include <asm/dma.h>
18#include <asm/irq.h> 17#include <asm/irq.h>
19#include <asm/mmu_context.h> 18#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_miata.c b/arch/alpha/kernel/sys_miata.c
index 258da684670..d5b9776a608 100644
--- a/arch/alpha/kernel/sys_miata.c
+++ b/arch/alpha/kernel/sys_miata.c
@@ -17,7 +17,6 @@
17#include <linux/reboot.h> 17#include <linux/reboot.h>
18 18
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/system.h>
21#include <asm/dma.h> 20#include <asm/dma.h>
22#include <asm/irq.h> 21#include <asm/irq.h>
23#include <asm/mmu_context.h> 22#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_mikasa.c b/arch/alpha/kernel/sys_mikasa.c
index c0fd7284dec..5e82dc1ad6f 100644
--- a/arch/alpha/kernel/sys_mikasa.c
+++ b/arch/alpha/kernel/sys_mikasa.c
@@ -17,7 +17,7 @@
17#include <linux/bitops.h> 17#include <linux/bitops.h>
18 18
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/system.h> 20#include <asm/mce.h>
21#include <asm/dma.h> 21#include <asm/dma.h>
22#include <asm/irq.h> 22#include <asm/irq.h>
23#include <asm/mmu_context.h> 23#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c
index 4112200307c..4d4c046f708 100644
--- a/arch/alpha/kernel/sys_nautilus.c
+++ b/arch/alpha/kernel/sys_nautilus.c
@@ -35,7 +35,6 @@
35#include <linux/bitops.h> 35#include <linux/bitops.h>
36 36
37#include <asm/ptrace.h> 37#include <asm/ptrace.h>
38#include <asm/system.h>
39#include <asm/dma.h> 38#include <asm/dma.h>
40#include <asm/irq.h> 39#include <asm/irq.h>
41#include <asm/mmu_context.h> 40#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c
index 21725283cdd..063e594fd96 100644
--- a/arch/alpha/kernel/sys_noritake.c
+++ b/arch/alpha/kernel/sys_noritake.c
@@ -18,7 +18,7 @@
18#include <linux/bitops.h> 18#include <linux/bitops.h>
19 19
20#include <asm/ptrace.h> 20#include <asm/ptrace.h>
21#include <asm/system.h> 21#include <asm/mce.h>
22#include <asm/dma.h> 22#include <asm/dma.h>
23#include <asm/irq.h> 23#include <asm/irq.h>
24#include <asm/mmu_context.h> 24#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_rawhide.c b/arch/alpha/kernel/sys_rawhide.c
index a125d6bea7e..dfd510ae5d8 100644
--- a/arch/alpha/kernel/sys_rawhide.c
+++ b/arch/alpha/kernel/sys_rawhide.c
@@ -16,7 +16,6 @@
16#include <linux/init.h> 16#include <linux/init.h>
17 17
18#include <asm/ptrace.h> 18#include <asm/ptrace.h>
19#include <asm/system.h>
20#include <asm/dma.h> 19#include <asm/dma.h>
21#include <asm/irq.h> 20#include <asm/irq.h>
22#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c
index 2581cbec6fc..a3f48525717 100644
--- a/arch/alpha/kernel/sys_ruffian.c
+++ b/arch/alpha/kernel/sys_ruffian.c
@@ -18,7 +18,6 @@
18#include <linux/init.h> 18#include <linux/init.h>
19 19
20#include <asm/ptrace.h> 20#include <asm/ptrace.h>
21#include <asm/system.h>
22#include <asm/dma.h> 21#include <asm/dma.h>
23#include <asm/irq.h> 22#include <asm/irq.h>
24#include <asm/mmu_context.h> 23#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_rx164.c b/arch/alpha/kernel/sys_rx164.c
index b172b27555a..08ee737d4fb 100644
--- a/arch/alpha/kernel/sys_rx164.c
+++ b/arch/alpha/kernel/sys_rx164.c
@@ -17,7 +17,6 @@
17#include <linux/bitops.h> 17#include <linux/bitops.h>
18 18
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/system.h>
21#include <asm/dma.h> 20#include <asm/dma.h>
22#include <asm/irq.h> 21#include <asm/irq.h>
23#include <asm/mmu_context.h> 22#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_sable.c b/arch/alpha/kernel/sys_sable.c
index 98d1dbffe98..8a0aa6d67b5 100644
--- a/arch/alpha/kernel/sys_sable.c
+++ b/arch/alpha/kernel/sys_sable.c
@@ -16,7 +16,6 @@
16#include <linux/init.h> 16#include <linux/init.h>
17 17
18#include <asm/ptrace.h> 18#include <asm/ptrace.h>
19#include <asm/system.h>
20#include <asm/dma.h> 19#include <asm/dma.h>
21#include <asm/irq.h> 20#include <asm/irq.h>
22#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_sio.c b/arch/alpha/kernel/sys_sio.c
index 47bec1e97d1..febd24eba7a 100644
--- a/arch/alpha/kernel/sys_sio.c
+++ b/arch/alpha/kernel/sys_sio.c
@@ -20,7 +20,6 @@
20 20
21#include <asm/compiler.h> 21#include <asm/compiler.h>
22#include <asm/ptrace.h> 22#include <asm/ptrace.h>
23#include <asm/system.h>
24#include <asm/dma.h> 23#include <asm/dma.h>
25#include <asm/irq.h> 24#include <asm/irq.h>
26#include <asm/mmu_context.h> 25#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_sx164.c b/arch/alpha/kernel/sys_sx164.c
index 73e1c317afc..d063b360efe 100644
--- a/arch/alpha/kernel/sys_sx164.c
+++ b/arch/alpha/kernel/sys_sx164.c
@@ -17,7 +17,6 @@
17#include <linux/bitops.h> 17#include <linux/bitops.h>
18 18
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/system.h>
21#include <asm/dma.h> 20#include <asm/dma.h>
22#include <asm/irq.h> 21#include <asm/irq.h>
23#include <asm/mmu_context.h> 22#include <asm/mmu_context.h>
@@ -26,6 +25,7 @@
26#include <asm/core_cia.h> 25#include <asm/core_cia.h>
27#include <asm/hwrpb.h> 26#include <asm/hwrpb.h>
28#include <asm/tlbflush.h> 27#include <asm/tlbflush.h>
28#include <asm/special_insns.h>
29 29
30#include "proto.h" 30#include "proto.h"
31#include "irq_impl.h" 31#include "irq_impl.h"
diff --git a/arch/alpha/kernel/sys_takara.c b/arch/alpha/kernel/sys_takara.c
index 2ae99ad6975..dd0f1eae3c6 100644
--- a/arch/alpha/kernel/sys_takara.c
+++ b/arch/alpha/kernel/sys_takara.c
@@ -16,7 +16,6 @@
16#include <linux/init.h> 16#include <linux/init.h>
17 17
18#include <asm/ptrace.h> 18#include <asm/ptrace.h>
19#include <asm/system.h>
20#include <asm/dma.h> 19#include <asm/dma.h>
21#include <asm/irq.h> 20#include <asm/irq.h>
22#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
index b8eafa05353..2533db280d9 100644
--- a/arch/alpha/kernel/sys_titan.c
+++ b/arch/alpha/kernel/sys_titan.c
@@ -21,7 +21,6 @@
21#include <linux/bitops.h> 21#include <linux/bitops.h>
22 22
23#include <asm/ptrace.h> 23#include <asm/ptrace.h>
24#include <asm/system.h>
25#include <asm/dma.h> 24#include <asm/dma.h>
26#include <asm/irq.h> 25#include <asm/irq.h>
27#include <asm/mmu_context.h> 26#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/sys_wildfire.c b/arch/alpha/kernel/sys_wildfire.c
index 17c85a65e7b..ee187488777 100644
--- a/arch/alpha/kernel/sys_wildfire.c
+++ b/arch/alpha/kernel/sys_wildfire.c
@@ -15,7 +15,6 @@
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16 16
17#include <asm/ptrace.h> 17#include <asm/ptrace.h>
18#include <asm/system.h>
19#include <asm/dma.h> 18#include <asm/dma.h>
20#include <asm/irq.h> 19#include <asm/irq.h>
21#include <asm/mmu_context.h> 20#include <asm/mmu_context.h>
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c
index 0414e021a91..80d987c0e9a 100644
--- a/arch/alpha/kernel/traps.c
+++ b/arch/alpha/kernel/traps.c
@@ -24,6 +24,7 @@
24#include <asm/sysinfo.h> 24#include <asm/sysinfo.h>
25#include <asm/hwrpb.h> 25#include <asm/hwrpb.h>
26#include <asm/mmu_context.h> 26#include <asm/mmu_context.h>
27#include <asm/special_insns.h>
27 28
28#include "proto.h" 29#include "proto.h"
29 30
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index f937ad12385..647b84c1538 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -2,6 +2,7 @@
2#include <asm/thread_info.h> 2#include <asm/thread_info.h>
3#include <asm/cache.h> 3#include <asm/cache.h>
4#include <asm/page.h> 4#include <asm/page.h>
5#include <asm/setup.h>
5 6
6OUTPUT_FORMAT("elf64-alpha") 7OUTPUT_FORMAT("elf64-alpha")
7OUTPUT_ARCH(alpha) 8OUTPUT_ARCH(alpha)
@@ -25,6 +26,7 @@ SECTIONS
25 *(.fixup) 26 *(.fixup)
26 *(.gnu.warning) 27 *(.gnu.warning)
27 } :kernel 28 } :kernel
29 swapper_pg_dir = SWAPPER_PGD;
28 _etext = .; /* End of text section */ 30 _etext = .; /* End of text section */
29 31
30 NOTES :kernel :note 32 NOTES :kernel :note
diff --git a/arch/alpha/lib/stacktrace.c b/arch/alpha/lib/stacktrace.c
index 6d432e42aed..5e832161e6d 100644
--- a/arch/alpha/lib/stacktrace.c
+++ b/arch/alpha/lib/stacktrace.c
@@ -1,5 +1,4 @@
1#include <linux/kernel.h> 1#include <linux/kernel.h>
2#include <asm/system.h>
3 2
4typedef unsigned int instr; 3typedef unsigned int instr;
5 4
diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
index fadd5f882ff..5eecab1a84e 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -24,7 +24,6 @@
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/module.h> 25#include <linux/module.h>
26 26
27#include <asm/system.h>
28#include <asm/uaccess.h> 27#include <asm/uaccess.h>
29 28
30extern void die_if_kernel(char *,struct pt_regs *,long, unsigned long *); 29extern void die_if_kernel(char *,struct pt_regs *,long, unsigned long *);
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 69d0c5761e2..1ad6ca74bed 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -22,7 +22,6 @@
22#include <linux/vmalloc.h> 22#include <linux/vmalloc.h>
23#include <linux/gfp.h> 23#include <linux/gfp.h>
24 24
25#include <asm/system.h>
26#include <asm/uaccess.h> 25#include <asm/uaccess.h>
27#include <asm/pgtable.h> 26#include <asm/pgtable.h>
28#include <asm/pgalloc.h> 27#include <asm/pgalloc.h>
@@ -31,6 +30,7 @@
31#include <asm/mmu_context.h> 30#include <asm/mmu_context.h>
32#include <asm/console.h> 31#include <asm/console.h>
33#include <asm/tlb.h> 32#include <asm/tlb.h>
33#include <asm/setup.h>
34 34
35extern void die_if_kernel(char *,struct pt_regs *,long); 35extern void die_if_kernel(char *,struct pt_regs *,long);
36 36
diff --git a/arch/alpha/oprofile/common.c b/arch/alpha/oprofile/common.c
index bd8ac533a50..a0a5d27aa21 100644
--- a/arch/alpha/oprofile/common.c
+++ b/arch/alpha/oprofile/common.c
@@ -12,7 +12,6 @@
12#include <linux/smp.h> 12#include <linux/smp.h>
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <asm/ptrace.h> 14#include <asm/ptrace.h>
15#include <asm/system.h>
16 15
17#include "op_impl.h" 16#include "op_impl.h"
18 17
diff --git a/arch/alpha/oprofile/op_model_ev4.c b/arch/alpha/oprofile/op_model_ev4.c
index 80d764dbf22..18aa9b4f94f 100644
--- a/arch/alpha/oprofile/op_model_ev4.c
+++ b/arch/alpha/oprofile/op_model_ev4.c
@@ -11,7 +11,6 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/smp.h> 12#include <linux/smp.h>
13#include <asm/ptrace.h> 13#include <asm/ptrace.h>
14#include <asm/system.h>
15 14
16#include "op_impl.h" 15#include "op_impl.h"
17 16
diff --git a/arch/alpha/oprofile/op_model_ev5.c b/arch/alpha/oprofile/op_model_ev5.c
index ceea6e1ad79..c32f8a0ad92 100644
--- a/arch/alpha/oprofile/op_model_ev5.c
+++ b/arch/alpha/oprofile/op_model_ev5.c
@@ -11,7 +11,6 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/smp.h> 12#include <linux/smp.h>
13#include <asm/ptrace.h> 13#include <asm/ptrace.h>
14#include <asm/system.h>
15 14
16#include "op_impl.h" 15#include "op_impl.h"
17 16
diff --git a/arch/alpha/oprofile/op_model_ev6.c b/arch/alpha/oprofile/op_model_ev6.c
index 0869f85f574..1c84cc257fc 100644
--- a/arch/alpha/oprofile/op_model_ev6.c
+++ b/arch/alpha/oprofile/op_model_ev6.c
@@ -11,7 +11,6 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/smp.h> 12#include <linux/smp.h>
13#include <asm/ptrace.h> 13#include <asm/ptrace.h>
14#include <asm/system.h>
15 14
16#include "op_impl.h" 15#include "op_impl.h"
17 16
diff --git a/arch/alpha/oprofile/op_model_ev67.c b/arch/alpha/oprofile/op_model_ev67.c
index 5b9d178e022..34a57a12655 100644
--- a/arch/alpha/oprofile/op_model_ev67.c
+++ b/arch/alpha/oprofile/op_model_ev67.c
@@ -12,7 +12,6 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/smp.h> 13#include <linux/smp.h>
14#include <asm/ptrace.h> 14#include <asm/ptrace.h>
15#include <asm/system.h>
16 15
17#include "op_impl.h" 16#include "op_impl.h"
18 17
diff --git a/arch/arm/common/via82c505.c b/arch/arm/common/via82c505.c
index 67dd2affc57..1171a5010ae 100644
--- a/arch/arm/common/via82c505.c
+++ b/arch/arm/common/via82c505.c
@@ -6,7 +6,6 @@
6#include <linux/ioport.h> 6#include <linux/ioport.h>
7#include <linux/io.h> 7#include <linux/io.h>
8 8
9#include <asm/system.h>
10 9
11#include <asm/mach/pci.h> 10#include <asm/mach/pci.h>
12 11
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
index 86976d03438..68374ba6a94 100644
--- a/arch/arm/include/asm/atomic.h
+++ b/arch/arm/include/asm/atomic.h
@@ -13,7 +13,9 @@
13 13
14#include <linux/compiler.h> 14#include <linux/compiler.h>
15#include <linux/types.h> 15#include <linux/types.h>
16#include <asm/system.h> 16#include <linux/irqflags.h>
17#include <asm/barrier.h>
18#include <asm/cmpxchg.h>
17 19
18#define ATOMIC_INIT(i) { (i) } 20#define ATOMIC_INIT(i) { (i) }
19 21
diff --git a/arch/arm/include/asm/barrier.h b/arch/arm/include/asm/barrier.h
new file mode 100644
index 00000000000..44f4a09ff37
--- /dev/null
+++ b/arch/arm/include/asm/barrier.h
@@ -0,0 +1,69 @@
1#ifndef __ASM_BARRIER_H
2#define __ASM_BARRIER_H
3
4#ifndef __ASSEMBLY__
5
6#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
7
8#if __LINUX_ARM_ARCH__ >= 7 || \
9 (__LINUX_ARM_ARCH__ == 6 && defined(CONFIG_CPU_32v6K))
10#define sev() __asm__ __volatile__ ("sev" : : : "memory")
11#define wfe() __asm__ __volatile__ ("wfe" : : : "memory")
12#define wfi() __asm__ __volatile__ ("wfi" : : : "memory")
13#endif
14
15#if __LINUX_ARM_ARCH__ >= 7
16#define isb() __asm__ __volatile__ ("isb" : : : "memory")
17#define dsb() __asm__ __volatile__ ("dsb" : : : "memory")
18#define dmb() __asm__ __volatile__ ("dmb" : : : "memory")
19#elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6
20#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
21 : : "r" (0) : "memory")
22#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
23 : : "r" (0) : "memory")
24#define dmb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \
25 : : "r" (0) : "memory")
26#elif defined(CONFIG_CPU_FA526)
27#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
28 : : "r" (0) : "memory")
29#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
30 : : "r" (0) : "memory")
31#define dmb() __asm__ __volatile__ ("" : : : "memory")
32#else
33#define isb() __asm__ __volatile__ ("" : : : "memory")
34#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
35 : : "r" (0) : "memory")
36#define dmb() __asm__ __volatile__ ("" : : : "memory")
37#endif
38
39#ifdef CONFIG_ARCH_HAS_BARRIERS
40#include <mach/barriers.h>
41#elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP)
42#include <asm/outercache.h>
43#define mb() do { dsb(); outer_sync(); } while (0)
44#define rmb() dsb()
45#define wmb() mb()
46#else
47#include <asm/memory.h>
48#define mb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
49#define rmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
50#define wmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
51#endif
52
53#ifndef CONFIG_SMP
54#define smp_mb() barrier()
55#define smp_rmb() barrier()
56#define smp_wmb() barrier()
57#else
58#define smp_mb() dmb()
59#define smp_rmb() dmb()
60#define smp_wmb() dmb()
61#endif
62
63#define read_barrier_depends() do { } while(0)
64#define smp_read_barrier_depends() do { } while(0)
65
66#define set_mb(var, value) do { var = value; smp_mb(); } while (0)
67
68#endif /* !__ASSEMBLY__ */
69#endif /* __ASM_BARRIER_H */
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index f7419ef9c8f..e691ec91e4d 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -24,7 +24,7 @@
24#endif 24#endif
25 25
26#include <linux/compiler.h> 26#include <linux/compiler.h>
27#include <asm/system.h> 27#include <linux/irqflags.h>
28 28
29#define smp_mb__before_clear_bit() smp_mb() 29#define smp_mb__before_clear_bit() smp_mb()
30#define smp_mb__after_clear_bit() smp_mb() 30#define smp_mb__after_clear_bit() smp_mb()
diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
index fac79dceb73..7af5c6c3653 100644
--- a/arch/arm/include/asm/bug.h
+++ b/arch/arm/include/asm/bug.h
@@ -1,6 +1,7 @@
1#ifndef _ASMARM_BUG_H 1#ifndef _ASMARM_BUG_H
2#define _ASMARM_BUG_H 2#define _ASMARM_BUG_H
3 3
4#include <linux/linkage.h>
4 5
5#ifdef CONFIG_BUG 6#ifdef CONFIG_BUG
6 7
@@ -57,4 +58,33 @@ do { \
57 58
58#include <asm-generic/bug.h> 59#include <asm-generic/bug.h>
59 60
61struct pt_regs;
62void die(const char *msg, struct pt_regs *regs, int err);
63
64struct siginfo;
65void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
66 unsigned long err, unsigned long trap);
67
68#ifdef CONFIG_ARM_LPAE
69#define FAULT_CODE_ALIGNMENT 33
70#define FAULT_CODE_DEBUG 34
71#else
72#define FAULT_CODE_ALIGNMENT 1
73#define FAULT_CODE_DEBUG 2
74#endif
75
76void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
77 struct pt_regs *),
78 int sig, int code, const char *name);
79
80void hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int,
81 struct pt_regs *),
82 int sig, int code, const char *name);
83
84extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
85
86struct mm_struct;
87extern void show_pte(struct mm_struct *mm, unsigned long addr);
88extern void __show_regs(struct pt_regs *);
89
60#endif 90#endif
diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h
new file mode 100644
index 00000000000..d41d7cbf0ad
--- /dev/null
+++ b/arch/arm/include/asm/cmpxchg.h
@@ -0,0 +1,295 @@
1#ifndef __ASM_ARM_CMPXCHG_H
2#define __ASM_ARM_CMPXCHG_H
3
4#include <linux/irqflags.h>
5#include <asm/barrier.h>
6
7#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
8/*
9 * On the StrongARM, "swp" is terminally broken since it bypasses the
10 * cache totally. This means that the cache becomes inconsistent, and,
11 * since we use normal loads/stores as well, this is really bad.
12 * Typically, this causes oopsen in filp_close, but could have other,
13 * more disastrous effects. There are two work-arounds:
14 * 1. Disable interrupts and emulate the atomic swap
15 * 2. Clean the cache, perform atomic swap, flush the cache
16 *
17 * We choose (1) since its the "easiest" to achieve here and is not
18 * dependent on the processor type.
19 *
20 * NOTE that this solution won't work on an SMP system, so explcitly
21 * forbid it here.
22 */
23#define swp_is_buggy
24#endif
25
26static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
27{
28 extern void __bad_xchg(volatile void *, int);
29 unsigned long ret;
30#ifdef swp_is_buggy
31 unsigned long flags;
32#endif
33#if __LINUX_ARM_ARCH__ >= 6
34 unsigned int tmp;
35#endif
36
37 smp_mb();
38
39 switch (size) {
40#if __LINUX_ARM_ARCH__ >= 6
41 case 1:
42 asm volatile("@ __xchg1\n"
43 "1: ldrexb %0, [%3]\n"
44 " strexb %1, %2, [%3]\n"
45 " teq %1, #0\n"
46 " bne 1b"
47 : "=&r" (ret), "=&r" (tmp)
48 : "r" (x), "r" (ptr)
49 : "memory", "cc");
50 break;
51 case 4:
52 asm volatile("@ __xchg4\n"
53 "1: ldrex %0, [%3]\n"
54 " strex %1, %2, [%3]\n"
55 " teq %1, #0\n"
56 " bne 1b"
57 : "=&r" (ret), "=&r" (tmp)
58 : "r" (x), "r" (ptr)
59 : "memory", "cc");
60 break;
61#elif defined(swp_is_buggy)
62#ifdef CONFIG_SMP
63#error SMP is not supported on this platform
64#endif
65 case 1:
66 raw_local_irq_save(flags);
67 ret = *(volatile unsigned char *)ptr;
68 *(volatile unsigned char *)ptr = x;
69 raw_local_irq_restore(flags);
70 break;
71
72 case 4:
73 raw_local_irq_save(flags);
74 ret = *(volatile unsigned long *)ptr;
75 *(volatile unsigned long *)ptr = x;
76 raw_local_irq_restore(flags);
77 break;
78#else
79 case 1:
80 asm volatile("@ __xchg1\n"
81 " swpb %0, %1, [%2]"
82 : "=&r" (ret)
83 : "r" (x), "r" (ptr)
84 : "memory", "cc");
85 break;
86 case 4:
87 asm volatile("@ __xchg4\n"
88 " swp %0, %1, [%2]"
89 : "=&r" (ret)
90 : "r" (x), "r" (ptr)
91 : "memory", "cc");
92 break;
93#endif
94 default:
95 __bad_xchg(ptr, size), ret = 0;
96 break;
97 }
98 smp_mb();
99
100 return ret;
101}
102
103#define xchg(ptr,x) \
104 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
105
106#include <asm-generic/cmpxchg-local.h>
107
108#if __LINUX_ARM_ARCH__ < 6
109/* min ARCH < ARMv6 */
110
111#ifdef CONFIG_SMP
112#error "SMP is not supported on this platform"
113#endif
114
115/*
116 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
117 * them available.
118 */
119#define cmpxchg_local(ptr, o, n) \
120 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
121 (unsigned long)(n), sizeof(*(ptr))))
122#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
123
124#ifndef CONFIG_SMP
125#include <asm-generic/cmpxchg.h>
126#endif
127
128#else /* min ARCH >= ARMv6 */
129
130extern void __bad_cmpxchg(volatile void *ptr, int size);
131
132/*
133 * cmpxchg only support 32-bits operands on ARMv6.
134 */
135
136static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
137 unsigned long new, int size)
138{
139 unsigned long oldval, res;
140
141 switch (size) {
142#ifndef CONFIG_CPU_V6 /* min ARCH >= ARMv6K */
143 case 1:
144 do {
145 asm volatile("@ __cmpxchg1\n"
146 " ldrexb %1, [%2]\n"
147 " mov %0, #0\n"
148 " teq %1, %3\n"
149 " strexbeq %0, %4, [%2]\n"
150 : "=&r" (res), "=&r" (oldval)
151 : "r" (ptr), "Ir" (old), "r" (new)
152 : "memory", "cc");
153 } while (res);
154 break;
155 case 2:
156 do {
157 asm volatile("@ __cmpxchg1\n"
158 " ldrexh %1, [%2]\n"
159 " mov %0, #0\n"
160 " teq %1, %3\n"
161 " strexheq %0, %4, [%2]\n"
162 : "=&r" (res), "=&r" (oldval)
163 : "r" (ptr), "Ir" (old), "r" (new)
164 : "memory", "cc");
165 } while (res);
166 break;
167#endif
168 case 4:
169 do {
170 asm volatile("@ __cmpxchg4\n"
171 " ldrex %1, [%2]\n"
172 " mov %0, #0\n"
173 " teq %1, %3\n"
174 " strexeq %0, %4, [%2]\n"
175 : "=&r" (res), "=&r" (oldval)
176 : "r" (ptr), "Ir" (old), "r" (new)
177 : "memory", "cc");
178 } while (res);
179 break;
180 default:
181 __bad_cmpxchg(ptr, size);
182 oldval = 0;
183 }
184
185 return oldval;
186}
187
188static inline unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old,
189 unsigned long new, int size)
190{
191 unsigned long ret;
192
193 smp_mb();
194 ret = __cmpxchg(ptr, old, new, size);
195 smp_mb();
196
197 return ret;
198}
199
200#define cmpxchg(ptr,o,n) \
201 ((__typeof__(*(ptr)))__cmpxchg_mb((ptr), \
202 (unsigned long)(o), \
203 (unsigned long)(n), \
204 sizeof(*(ptr))))
205
206static inline unsigned long __cmpxchg_local(volatile void *ptr,
207 unsigned long old,
208 unsigned long new, int size)
209{
210 unsigned long ret;
211
212 switch (size) {
213#ifdef CONFIG_CPU_V6 /* min ARCH == ARMv6 */
214 case 1:
215 case 2:
216 ret = __cmpxchg_local_generic(ptr, old, new, size);
217 break;
218#endif
219 default:
220 ret = __cmpxchg(ptr, old, new, size);
221 }
222
223 return ret;
224}
225
226#define cmpxchg_local(ptr,o,n) \
227 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), \
228 (unsigned long)(o), \
229 (unsigned long)(n), \
230 sizeof(*(ptr))))
231
232#ifndef CONFIG_CPU_V6 /* min ARCH >= ARMv6K */
233
234/*
235 * Note : ARMv7-M (currently unsupported by Linux) does not support
236 * ldrexd/strexd. If ARMv7-M is ever supported by the Linux kernel, it should
237 * not be allowed to use __cmpxchg64.
238 */
239static inline unsigned long long __cmpxchg64(volatile void *ptr,
240 unsigned long long old,
241 unsigned long long new)
242{
243 register unsigned long long oldval asm("r0");
244 register unsigned long long __old asm("r2") = old;
245 register unsigned long long __new asm("r4") = new;
246 unsigned long res;
247
248 do {
249 asm volatile(
250 " @ __cmpxchg8\n"
251 " ldrexd %1, %H1, [%2]\n"
252 " mov %0, #0\n"
253 " teq %1, %3\n"
254 " teqeq %H1, %H3\n"
255 " strexdeq %0, %4, %H4, [%2]\n"
256 : "=&r" (res), "=&r" (oldval)
257 : "r" (ptr), "Ir" (__old), "r" (__new)
258 : "memory", "cc");
259 } while (res);
260
261 return oldval;
262}
263
264static inline unsigned long long __cmpxchg64_mb(volatile void *ptr,
265 unsigned long long old,
266 unsigned long long new)
267{
268 unsigned long long ret;
269
270 smp_mb();
271 ret = __cmpxchg64(ptr, old, new);
272 smp_mb();
273
274 return ret;
275}
276
277#define cmpxchg64(ptr,o,n) \
278 ((__typeof__(*(ptr)))__cmpxchg64_mb((ptr), \
279 (unsigned long long)(o), \
280 (unsigned long long)(n)))
281
282#define cmpxchg64_local(ptr,o,n) \
283 ((__typeof__(*(ptr)))__cmpxchg64((ptr), \
284 (unsigned long long)(o), \
285 (unsigned long long)(n)))
286
287#else /* min ARCH = ARMv6 */
288
289#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
290
291#endif
292
293#endif /* __LINUX_ARM_ARCH__ >= 6 */
294
295#endif /* __ASM_ARM_CMPXCHG_H */
diff --git a/arch/arm/include/asm/compiler.h b/arch/arm/include/asm/compiler.h
new file mode 100644
index 00000000000..8155db2f7fa
--- /dev/null
+++ b/arch/arm/include/asm/compiler.h
@@ -0,0 +1,15 @@
1#ifndef __ASM_ARM_COMPILER_H
2#define __ASM_ARM_COMPILER_H
3
4/*
5 * This is used to ensure the compiler did actually allocate the register we
6 * asked it for some inline assembly sequences. Apparently we can't trust
7 * the compiler from one version to another so a bit of paranoia won't hurt.
8 * This string is meant to be concatenated with the inline asm string and
9 * will cause compilation to stop on mismatch.
10 * (for details, see gcc PR 15089)
11 */
12#define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t"
13
14
15#endif /* __ASM_ARM_COMPILER_H */
diff --git a/arch/arm/include/asm/cp15.h b/arch/arm/include/asm/cp15.h
new file mode 100644
index 00000000000..5ef4d8015a6
--- /dev/null
+++ b/arch/arm/include/asm/cp15.h
@@ -0,0 +1,87 @@
1#ifndef __ASM_ARM_CP15_H
2#define __ASM_ARM_CP15_H
3
4#include <asm/barrier.h>
5
6/*
7 * CR1 bits (CP#15 CR1)
8 */
9#define CR_M (1 << 0) /* MMU enable */
10#define CR_A (1 << 1) /* Alignment abort enable */
11#define CR_C (1 << 2) /* Dcache enable */
12#define CR_W (1 << 3) /* Write buffer enable */
13#define CR_P (1 << 4) /* 32-bit exception handler */
14#define CR_D (1 << 5) /* 32-bit data address range */
15#define CR_L (1 << 6) /* Implementation defined */
16#define CR_B (1 << 7) /* Big endian */
17#define CR_S (1 << 8) /* System MMU protection */
18#define CR_R (1 << 9) /* ROM MMU protection */
19#define CR_F (1 << 10) /* Implementation defined */
20#define CR_Z (1 << 11) /* Implementation defined */
21#define CR_I (1 << 12) /* Icache enable */
22#define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */
23#define CR_RR (1 << 14) /* Round Robin cache replacement */
24#define CR_L4 (1 << 15) /* LDR pc can set T bit */
25#define CR_DT (1 << 16)
26#define CR_IT (1 << 18)
27#define CR_ST (1 << 19)
28#define CR_FI (1 << 21) /* Fast interrupt (lower latency mode) */
29#define CR_U (1 << 22) /* Unaligned access operation */
30#define CR_XP (1 << 23) /* Extended page tables */
31#define CR_VE (1 << 24) /* Vectored interrupts */
32#define CR_EE (1 << 25) /* Exception (Big) Endian */
33#define CR_TRE (1 << 28) /* TEX remap enable */
34#define CR_AFE (1 << 29) /* Access flag enable */
35#define CR_TE (1 << 30) /* Thumb exception enable */
36
37#ifndef __ASSEMBLY__
38
39#if __LINUX_ARM_ARCH__ >= 4
40#define vectors_high() (cr_alignment & CR_V)
41#else
42#define vectors_high() (0)
43#endif
44
45extern unsigned long cr_no_alignment; /* defined in entry-armv.S */
46extern unsigned long cr_alignment; /* defined in entry-armv.S */
47
48static inline unsigned int get_cr(void)
49{
50 unsigned int val;
51 asm("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc");
52 return val;
53}
54
55static inline void set_cr(unsigned int val)
56{
57 asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR"
58 : : "r" (val) : "cc");
59 isb();
60}
61
62#ifndef CONFIG_SMP
63extern void adjust_cr(unsigned long mask, unsigned long set);
64#endif
65
66#define CPACC_FULL(n) (3 << (n * 2))
67#define CPACC_SVC(n) (1 << (n * 2))
68#define CPACC_DISABLE(n) (0 << (n * 2))
69
70static inline unsigned int get_copro_access(void)
71{
72 unsigned int val;
73 asm("mrc p15, 0, %0, c1, c0, 2 @ get copro access"
74 : "=r" (val) : : "cc");
75 return val;
76}
77
78static inline void set_copro_access(unsigned int val)
79{
80 asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access"
81 : : "r" (val) : "cc");
82 isb();
83}
84
85#endif
86
87#endif
diff --git a/arch/arm/include/asm/div64.h b/arch/arm/include/asm/div64.h
index d3f0a9eee9f..fe92ccf1d0b 100644
--- a/arch/arm/include/asm/div64.h
+++ b/arch/arm/include/asm/div64.h
@@ -1,8 +1,8 @@
1#ifndef __ASM_ARM_DIV64 1#ifndef __ASM_ARM_DIV64
2#define __ASM_ARM_DIV64 2#define __ASM_ARM_DIV64
3 3
4#include <asm/system.h>
5#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/compiler.h>
6 6
7/* 7/*
8 * The semantics of do_div() are: 8 * The semantics of do_div() are:
diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h
index 69a5b0b6455..5694a0d6576 100644
--- a/arch/arm/include/asm/dma.h
+++ b/arch/arm/include/asm/dma.h
@@ -19,7 +19,6 @@
19 * It should not be re-used except for that purpose. 19 * It should not be re-used except for that purpose.
20 */ 20 */
21#include <linux/spinlock.h> 21#include <linux/spinlock.h>
22#include <asm/system.h>
23#include <asm/scatterlist.h> 22#include <asm/scatterlist.h>
24 23
25#include <mach/isa-dma.h> 24#include <mach/isa-dma.h>
diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h
index b5dc173d336..3d2220498ab 100644
--- a/arch/arm/include/asm/domain.h
+++ b/arch/arm/include/asm/domain.h
@@ -10,6 +10,10 @@
10#ifndef __ASM_PROC_DOMAIN_H 10#ifndef __ASM_PROC_DOMAIN_H
11#define __ASM_PROC_DOMAIN_H 11#define __ASM_PROC_DOMAIN_H
12 12
13#ifndef __ASSEMBLY__
14#include <asm/barrier.h>
15#endif
16
13/* 17/*
14 * Domain numbers 18 * Domain numbers
15 * 19 *
diff --git a/arch/arm/include/asm/exec.h b/arch/arm/include/asm/exec.h
new file mode 100644
index 00000000000..7c4fbef72b3
--- /dev/null
+++ b/arch/arm/include/asm/exec.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_ARM_EXEC_H
2#define __ASM_ARM_EXEC_H
3
4#define arch_align_stack(x) (x)
5
6#endif /* __ASM_ARM_EXEC_H */
diff --git a/arch/arm/include/asm/hardware/iop3xx.h b/arch/arm/include/asm/hardware/iop3xx.h
index 077c32326c6..2ff2c75a463 100644
--- a/arch/arm/include/asm/hardware/iop3xx.h
+++ b/arch/arm/include/asm/hardware/iop3xx.h
@@ -231,6 +231,9 @@ extern int iop3xx_get_init_atu(void);
231 231
232 232
233#ifndef __ASSEMBLY__ 233#ifndef __ASSEMBLY__
234
235#include <linux/types.h>
236
234void iop3xx_map_io(void); 237void iop3xx_map_io(void);
235void iop_init_cp6_handler(void); 238void iop_init_cp6_handler(void);
236void iop_init_time(unsigned long tickrate); 239void iop_init_time(unsigned long tickrate);
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 9275828feb3..bae7eb6011d 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -26,7 +26,6 @@
26#include <linux/types.h> 26#include <linux/types.h>
27#include <asm/byteorder.h> 27#include <asm/byteorder.h>
28#include <asm/memory.h> 28#include <asm/memory.h>
29#include <asm/system.h>
30#include <asm-generic/pci_iomap.h> 29#include <asm-generic/pci_iomap.h>
31 30
32/* 31/*
@@ -99,6 +98,7 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
99 98
100/* IO barriers */ 99/* IO barriers */
101#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE 100#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
101#include <asm/barrier.h>
102#define __iormb() rmb() 102#define __iormb() rmb()
103#define __iowmb() wmb() 103#define __iowmb() wmb()
104#else 104#else
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
index 14965658a92..b8e580a297e 100644
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -34,4 +34,11 @@ typedef struct {
34 34
35#endif 35#endif
36 36
37/*
38 * switch_mm() may do a full cache flush over the context switch,
39 * so enable interrupts over the context switch to avoid high
40 * latency.
41 */
42#define __ARCH_WANT_INTERRUPTS_ON_CTXSW
43
37#endif 44#endif
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
index cb8d638924f..f4d7f56ee51 100644
--- a/arch/arm/include/asm/processor.h
+++ b/arch/arm/include/asm/processor.h
@@ -22,7 +22,6 @@
22#include <asm/hw_breakpoint.h> 22#include <asm/hw_breakpoint.h>
23#include <asm/ptrace.h> 23#include <asm/ptrace.h>
24#include <asm/types.h> 24#include <asm/types.h>
25#include <asm/system.h>
26 25
27#ifdef __KERNEL__ 26#ifdef __KERNEL__
28#define STACK_TOP ((current->personality & ADDR_LIMIT_32BIT) ? \ 27#define STACK_TOP ((current->personality & ADDR_LIMIT_32BIT) ? \
@@ -90,6 +89,8 @@ unsigned long get_wchan(struct task_struct *p);
90#define cpu_relax() barrier() 89#define cpu_relax() barrier()
91#endif 90#endif
92 91
92void cpu_idle_wait(void);
93
93/* 94/*
94 * Create a new kernel thread 95 * Create a new kernel thread
95 */ 96 */
diff --git a/arch/arm/include/asm/switch_to.h b/arch/arm/include/asm/switch_to.h
new file mode 100644
index 00000000000..fa09e6b49bf
--- /dev/null
+++ b/arch/arm/include/asm/switch_to.h
@@ -0,0 +1,18 @@
1#ifndef __ASM_ARM_SWITCH_TO_H
2#define __ASM_ARM_SWITCH_TO_H
3
4#include <linux/thread_info.h>
5
6/*
7 * switch_to(prev, next) should switch from task `prev' to `next'
8 * `prev' will never be the same as `next'. schedule() itself
9 * contains the memory barrier to tell GCC not to cache `current'.
10 */
11extern struct task_struct *__switch_to(struct task_struct *, struct thread_info *, struct thread_info *);
12
13#define switch_to(prev,next,last) \
14do { \
15 last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \
16} while (0)
17
18#endif /* __ASM_ARM_SWITCH_TO_H */
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 424aa458c48..74542c52f9b 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -1,544 +1,8 @@
1#ifndef __ASM_ARM_SYSTEM_H 1/* FILE TO BE DELETED. DO NOT ADD STUFF HERE! */
2#define __ASM_ARM_SYSTEM_H 2#include <asm/barrier.h>
3 3#include <asm/compiler.h>
4#ifdef __KERNEL__ 4#include <asm/cmpxchg.h>
5 5#include <asm/exec.h>
6#define CPU_ARCH_UNKNOWN 0 6#include <asm/switch_to.h>
7#define CPU_ARCH_ARMv3 1 7#include <asm/system_info.h>
8#define CPU_ARCH_ARMv4 2 8#include <asm/system_misc.h>
9#define CPU_ARCH_ARMv4T 3
10#define CPU_ARCH_ARMv5 4
11#define CPU_ARCH_ARMv5T 5
12#define CPU_ARCH_ARMv5TE 6
13#define CPU_ARCH_ARMv5TEJ 7
14#define CPU_ARCH_ARMv6 8
15#define CPU_ARCH_ARMv7 9
16
17/*
18 * CR1 bits (CP#15 CR1)
19 */
20#define CR_M (1 << 0) /* MMU enable */
21#define CR_A (1 << 1) /* Alignment abort enable */
22#define CR_C (1 << 2) /* Dcache enable */
23#define CR_W (1 << 3) /* Write buffer enable */
24#define CR_P (1 << 4) /* 32-bit exception handler */
25#define CR_D (1 << 5) /* 32-bit data address range */
26#define CR_L (1 << 6) /* Implementation defined */
27#define CR_B (1 << 7) /* Big endian */
28#define CR_S (1 << 8) /* System MMU protection */
29#define CR_R (1 << 9) /* ROM MMU protection */
30#define CR_F (1 << 10) /* Implementation defined */
31#define CR_Z (1 << 11) /* Implementation defined */
32#define CR_I (1 << 12) /* Icache enable */
33#define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */
34#define CR_RR (1 << 14) /* Round Robin cache replacement */
35#define CR_L4 (1 << 15) /* LDR pc can set T bit */
36#define CR_DT (1 << 16)
37#define CR_IT (1 << 18)
38#define CR_ST (1 << 19)
39#define CR_FI (1 << 21) /* Fast interrupt (lower latency mode) */
40#define CR_U (1 << 22) /* Unaligned access operation */
41#define CR_XP (1 << 23) /* Extended page tables */
42#define CR_VE (1 << 24) /* Vectored interrupts */
43#define CR_EE (1 << 25) /* Exception (Big) Endian */
44#define CR_TRE (1 << 28) /* TEX remap enable */
45#define CR_AFE (1 << 29) /* Access flag enable */
46#define CR_TE (1 << 30) /* Thumb exception enable */
47
48/*
49 * This is used to ensure the compiler did actually allocate the register we
50 * asked it for some inline assembly sequences. Apparently we can't trust
51 * the compiler from one version to another so a bit of paranoia won't hurt.
52 * This string is meant to be concatenated with the inline asm string and
53 * will cause compilation to stop on mismatch.
54 * (for details, see gcc PR 15089)
55 */
56#define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t"
57
58#ifndef __ASSEMBLY__
59
60#include <linux/compiler.h>
61#include <linux/linkage.h>
62#include <linux/irqflags.h>
63
64#include <asm/outercache.h>
65
66struct thread_info;
67struct task_struct;
68
69/* information about the system we're running on */
70extern unsigned int system_rev;
71extern unsigned int system_serial_low;
72extern unsigned int system_serial_high;
73extern unsigned int mem_fclk_21285;
74
75struct pt_regs;
76
77void die(const char *msg, struct pt_regs *regs, int err);
78
79struct siginfo;
80void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
81 unsigned long err, unsigned long trap);
82
83#ifdef CONFIG_ARM_LPAE
84#define FAULT_CODE_ALIGNMENT 33
85#define FAULT_CODE_DEBUG 34
86#else
87#define FAULT_CODE_ALIGNMENT 1
88#define FAULT_CODE_DEBUG 2
89#endif
90
91void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
92 struct pt_regs *),
93 int sig, int code, const char *name);
94
95void hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int,
96 struct pt_regs *),
97 int sig, int code, const char *name);
98
99#define xchg(ptr,x) \
100 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
101
102extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
103
104struct mm_struct;
105extern void show_pte(struct mm_struct *mm, unsigned long addr);
106extern void __show_regs(struct pt_regs *);
107
108extern int __pure cpu_architecture(void);
109extern void cpu_init(void);
110
111void soft_restart(unsigned long);
112extern void (*arm_pm_restart)(char str, const char *cmd);
113extern void (*arm_pm_idle)(void);
114
115#define UDBG_UNDEFINED (1 << 0)
116#define UDBG_SYSCALL (1 << 1)
117#define UDBG_BADABORT (1 << 2)
118#define UDBG_SEGV (1 << 3)
119#define UDBG_BUS (1 << 4)
120
121extern unsigned int user_debug;
122
123#if __LINUX_ARM_ARCH__ >= 4
124#define vectors_high() (cr_alignment & CR_V)
125#else
126#define vectors_high() (0)
127#endif
128
129#if __LINUX_ARM_ARCH__ >= 7 || \
130 (__LINUX_ARM_ARCH__ == 6 && defined(CONFIG_CPU_32v6K))
131#define sev() __asm__ __volatile__ ("sev" : : : "memory")
132#define wfe() __asm__ __volatile__ ("wfe" : : : "memory")
133#define wfi() __asm__ __volatile__ ("wfi" : : : "memory")
134#endif
135
136#if __LINUX_ARM_ARCH__ >= 7
137#define isb() __asm__ __volatile__ ("isb" : : : "memory")
138#define dsb() __asm__ __volatile__ ("dsb" : : : "memory")
139#define dmb() __asm__ __volatile__ ("dmb" : : : "memory")
140#elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6
141#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
142 : : "r" (0) : "memory")
143#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
144 : : "r" (0) : "memory")
145#define dmb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \
146 : : "r" (0) : "memory")
147#elif defined(CONFIG_CPU_FA526)
148#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
149 : : "r" (0) : "memory")
150#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
151 : : "r" (0) : "memory")
152#define dmb() __asm__ __volatile__ ("" : : : "memory")
153#else
154#define isb() __asm__ __volatile__ ("" : : : "memory")
155#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
156 : : "r" (0) : "memory")
157#define dmb() __asm__ __volatile__ ("" : : : "memory")
158#endif
159
160#ifdef CONFIG_ARCH_HAS_BARRIERS
161#include <mach/barriers.h>
162#elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP)
163#define mb() do { dsb(); outer_sync(); } while (0)
164#define rmb() dsb()
165#define wmb() mb()
166#else
167#include <asm/memory.h>
168#define mb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
169#define rmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
170#define wmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
171#endif
172
173#ifndef CONFIG_SMP
174#define smp_mb() barrier()
175#define smp_rmb() barrier()
176#define smp_wmb() barrier()
177#else
178#define smp_mb() dmb()
179#define smp_rmb() dmb()
180#define smp_wmb() dmb()
181#endif
182
183#define read_barrier_depends() do { } while(0)
184#define smp_read_barrier_depends() do { } while(0)
185
186#define set_mb(var, value) do { var = value; smp_mb(); } while (0)
187#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
188
189extern unsigned long cr_no_alignment; /* defined in entry-armv.S */
190extern unsigned long cr_alignment; /* defined in entry-armv.S */
191
192static inline unsigned int get_cr(void)
193{
194 unsigned int val;
195 asm("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc");
196 return val;
197}
198
199static inline void set_cr(unsigned int val)
200{
201 asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR"
202 : : "r" (val) : "cc");
203 isb();
204}
205
206#ifndef CONFIG_SMP
207extern void adjust_cr(unsigned long mask, unsigned long set);
208#endif
209
210#define CPACC_FULL(n) (3 << (n * 2))
211#define CPACC_SVC(n) (1 << (n * 2))
212#define CPACC_DISABLE(n) (0 << (n * 2))
213
214static inline unsigned int get_copro_access(void)
215{
216 unsigned int val;
217 asm("mrc p15, 0, %0, c1, c0, 2 @ get copro access"
218 : "=r" (val) : : "cc");
219 return val;
220}
221
222static inline void set_copro_access(unsigned int val)
223{
224 asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access"
225 : : "r" (val) : "cc");
226 isb();
227}
228
229/*
230 * switch_mm() may do a full cache flush over the context switch,
231 * so enable interrupts over the context switch to avoid high
232 * latency.
233 */
234#define __ARCH_WANT_INTERRUPTS_ON_CTXSW
235
236/*
237 * switch_to(prev, next) should switch from task `prev' to `next'
238 * `prev' will never be the same as `next'. schedule() itself
239 * contains the memory barrier to tell GCC not to cache `current'.
240 */
241extern struct task_struct *__switch_to(struct task_struct *, struct thread_info *, struct thread_info *);
242
243#define switch_to(prev,next,last) \
244do { \
245 last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \
246} while (0)
247
248#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
249/*
250 * On the StrongARM, "swp" is terminally broken since it bypasses the
251 * cache totally. This means that the cache becomes inconsistent, and,
252 * since we use normal loads/stores as well, this is really bad.
253 * Typically, this causes oopsen in filp_close, but could have other,
254 * more disastrous effects. There are two work-arounds:
255 * 1. Disable interrupts and emulate the atomic swap
256 * 2. Clean the cache, perform atomic swap, flush the cache
257 *
258 * We choose (1) since its the "easiest" to achieve here and is not
259 * dependent on the processor type.
260 *
261 * NOTE that this solution won't work on an SMP system, so explcitly
262 * forbid it here.
263 */
264#define swp_is_buggy
265#endif
266
267static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
268{
269 extern void __bad_xchg(volatile void *, int);
270 unsigned long ret;
271#ifdef swp_is_buggy
272 unsigned long flags;
273#endif
274#if __LINUX_ARM_ARCH__ >= 6
275 unsigned int tmp;
276#endif
277
278 smp_mb();
279
280 switch (size) {
281#if __LINUX_ARM_ARCH__ >= 6
282 case 1:
283 asm volatile("@ __xchg1\n"
284 "1: ldrexb %0, [%3]\n"
285 " strexb %1, %2, [%3]\n"
286 " teq %1, #0\n"
287 " bne 1b"
288 : "=&r" (ret), "=&r" (tmp)
289 : "r" (x), "r" (ptr)
290 : "memory", "cc");
291 break;
292 case 4:
293 asm volatile("@ __xchg4\n"
294 "1: ldrex %0, [%3]\n"
295 " strex %1, %2, [%3]\n"
296 " teq %1, #0\n"
297 " bne 1b"
298 : "=&r" (ret), "=&r" (tmp)
299 : "r" (x), "r" (ptr)
300 : "memory", "cc");
301 break;
302#elif defined(swp_is_buggy)
303#ifdef CONFIG_SMP
304#error SMP is not supported on this platform
305#endif
306 case 1:
307 raw_local_irq_save(flags);
308 ret = *(volatile unsigned char *)ptr;
309 *(volatile unsigned char *)ptr = x;
310 raw_local_irq_restore(flags);
311 break;
312
313 case 4:
314 raw_local_irq_save(flags);
315 ret = *(volatile unsigned long *)ptr;
316 *(volatile unsigned long *)ptr = x;
317 raw_local_irq_restore(flags);
318 break;
319#else
320 case 1:
321 asm volatile("@ __xchg1\n"
322 " swpb %0, %1, [%2]"
323 : "=&r" (ret)
324 : "r" (x), "r" (ptr)
325 : "memory", "cc");
326 break;
327 case 4:
328 asm volatile("@ __xchg4\n"
329 " swp %0, %1, [%2]"
330 : "=&r" (ret)
331 : "r" (x), "r" (ptr)
332 : "memory", "cc");
333 break;
334#endif
335 default:
336 __bad_xchg(ptr, size), ret = 0;
337 break;
338 }
339 smp_mb();
340
341 return ret;
342}
343
344extern void disable_hlt(void);
345extern void enable_hlt(void);
346
347void cpu_idle_wait(void);
348
349#include <asm-generic/cmpxchg-local.h>
350
351#if __LINUX_ARM_ARCH__ < 6
352/* min ARCH < ARMv6 */
353
354#ifdef CONFIG_SMP
355#error "SMP is not supported on this platform"
356#endif
357
358/*
359 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
360 * them available.
361 */
362#define cmpxchg_local(ptr, o, n) \
363 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
364 (unsigned long)(n), sizeof(*(ptr))))
365#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
366
367#ifndef CONFIG_SMP
368#include <asm-generic/cmpxchg.h>
369#endif
370
371#else /* min ARCH >= ARMv6 */
372
373extern void __bad_cmpxchg(volatile void *ptr, int size);
374
375/*
376 * cmpxchg only support 32-bits operands on ARMv6.
377 */
378
379static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
380 unsigned long new, int size)
381{
382 unsigned long oldval, res;
383
384 switch (size) {
385#ifndef CONFIG_CPU_V6 /* min ARCH >= ARMv6K */
386 case 1:
387 do {
388 asm volatile("@ __cmpxchg1\n"
389 " ldrexb %1, [%2]\n"
390 " mov %0, #0\n"
391 " teq %1, %3\n"
392 " strexbeq %0, %4, [%2]\n"
393 : "=&r" (res), "=&r" (oldval)
394 : "r" (ptr), "Ir" (old), "r" (new)
395 : "memory", "cc");
396 } while (res);
397 break;
398 case 2:
399 do {
400 asm volatile("@ __cmpxchg1\n"
401 " ldrexh %1, [%2]\n"
402 " mov %0, #0\n"
403 " teq %1, %3\n"
404 " strexheq %0, %4, [%2]\n"
405 : "=&r" (res), "=&r" (oldval)
406 : "r" (ptr), "Ir" (old), "r" (new)
407 : "memory", "cc");
408 } while (res);
409 break;
410#endif
411 case 4:
412 do {
413 asm volatile("@ __cmpxchg4\n"
414 " ldrex %1, [%2]\n"
415 " mov %0, #0\n"
416 " teq %1, %3\n"
417 " strexeq %0, %4, [%2]\n"
418 : "=&r" (res), "=&r" (oldval)
419 : "r" (ptr), "Ir" (old), "r" (new)
420 : "memory", "cc");
421 } while (res);
422 break;
423 default:
424 __bad_cmpxchg(ptr, size);
425 oldval = 0;
426 }
427
428 return oldval;
429}
430
431static inline unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old,
432 unsigned long new, int size)
433{
434 unsigned long ret;
435
436 smp_mb();
437 ret = __cmpxchg(ptr, old, new, size);
438 smp_mb();
439
440 return ret;
441}
442
443#define cmpxchg(ptr,o,n) \
444 ((__typeof__(*(ptr)))__cmpxchg_mb((ptr), \
445 (unsigned long)(o), \
446 (unsigned long)(n), \
447 sizeof(*(ptr))))
448
449static inline unsigned long __cmpxchg_local(volatile void *ptr,
450 unsigned long old,
451 unsigned long new, int size)
452{
453 unsigned long ret;
454
455 switch (size) {
456#ifdef CONFIG_CPU_V6 /* min ARCH == ARMv6 */
457 case 1:
458 case 2:
459 ret = __cmpxchg_local_generic(ptr, old, new, size);
460 break;
461#endif
462 default:
463 ret = __cmpxchg(ptr, old, new, size);
464 }
465
466 return ret;
467}
468
469#define cmpxchg_local(ptr,o,n) \
470 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), \
471 (unsigned long)(o), \
472 (unsigned long)(n), \
473 sizeof(*(ptr))))
474
475#ifndef CONFIG_CPU_V6 /* min ARCH >= ARMv6K */
476
477/*
478 * Note : ARMv7-M (currently unsupported by Linux) does not support
479 * ldrexd/strexd. If ARMv7-M is ever supported by the Linux kernel, it should
480 * not be allowed to use __cmpxchg64.
481 */
482static inline unsigned long long __cmpxchg64(volatile void *ptr,
483 unsigned long long old,
484 unsigned long long new)
485{
486 register unsigned long long oldval asm("r0");
487 register unsigned long long __old asm("r2") = old;
488 register unsigned long long __new asm("r4") = new;
489 unsigned long res;
490
491 do {
492 asm volatile(
493 " @ __cmpxchg8\n"
494 " ldrexd %1, %H1, [%2]\n"
495 " mov %0, #0\n"
496 " teq %1, %3\n"
497 " teqeq %H1, %H3\n"
498 " strexdeq %0, %4, %H4, [%2]\n"
499 : "=&r" (res), "=&r" (oldval)
500 : "r" (ptr), "Ir" (__old), "r" (__new)
501 : "memory", "cc");
502 } while (res);
503
504 return oldval;
505}
506
507static inline unsigned long long __cmpxchg64_mb(volatile void *ptr,
508 unsigned long long old,
509 unsigned long long new)
510{
511 unsigned long long ret;
512
513 smp_mb();
514 ret = __cmpxchg64(ptr, old, new);
515 smp_mb();
516
517 return ret;
518}
519
520#define cmpxchg64(ptr,o,n) \
521 ((__typeof__(*(ptr)))__cmpxchg64_mb((ptr), \
522 (unsigned long long)(o), \
523 (unsigned long long)(n)))
524
525#define cmpxchg64_local(ptr,o,n) \
526 ((__typeof__(*(ptr)))__cmpxchg64((ptr), \
527 (unsigned long long)(o), \
528 (unsigned long long)(n)))
529
530#else /* min ARCH = ARMv6 */
531
532#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
533
534#endif
535
536#endif /* __LINUX_ARM_ARCH__ >= 6 */
537
538#endif /* __ASSEMBLY__ */
539
540#define arch_align_stack(x) (x)
541
542#endif /* __KERNEL__ */
543
544#endif
diff --git a/arch/arm/include/asm/system_info.h b/arch/arm/include/asm/system_info.h
new file mode 100644
index 00000000000..dfd386d0c02
--- /dev/null
+++ b/arch/arm/include/asm/system_info.h
@@ -0,0 +1,27 @@
1#ifndef __ASM_ARM_SYSTEM_INFO_H
2#define __ASM_ARM_SYSTEM_INFO_H
3
4#define CPU_ARCH_UNKNOWN 0
5#define CPU_ARCH_ARMv3 1
6#define CPU_ARCH_ARMv4 2
7#define CPU_ARCH_ARMv4T 3
8#define CPU_ARCH_ARMv5 4
9#define CPU_ARCH_ARMv5T 5
10#define CPU_ARCH_ARMv5TE 6
11#define CPU_ARCH_ARMv5TEJ 7
12#define CPU_ARCH_ARMv6 8
13#define CPU_ARCH_ARMv7 9
14
15#ifndef __ASSEMBLY__
16
17/* information about the system we're running on */
18extern unsigned int system_rev;
19extern unsigned int system_serial_low;
20extern unsigned int system_serial_high;
21extern unsigned int mem_fclk_21285;
22
23extern int __pure cpu_architecture(void);
24
25#endif /* !__ASSEMBLY__ */
26
27#endif /* __ASM_ARM_SYSTEM_INFO_H */
diff --git a/arch/arm/include/asm/system_misc.h b/arch/arm/include/asm/system_misc.h
new file mode 100644
index 00000000000..5a85f148b60
--- /dev/null
+++ b/arch/arm/include/asm/system_misc.h
@@ -0,0 +1,29 @@
1#ifndef __ASM_ARM_SYSTEM_MISC_H
2#define __ASM_ARM_SYSTEM_MISC_H
3
4#ifndef __ASSEMBLY__
5
6#include <linux/compiler.h>
7#include <linux/linkage.h>
8#include <linux/irqflags.h>
9
10extern void cpu_init(void);
11
12void soft_restart(unsigned long);
13extern void (*arm_pm_restart)(char str, const char *cmd);
14extern void (*arm_pm_idle)(void);
15
16#define UDBG_UNDEFINED (1 << 0)
17#define UDBG_SYSCALL (1 << 1)
18#define UDBG_BADABORT (1 << 2)
19#define UDBG_SEGV (1 << 3)
20#define UDBG_BUS (1 << 4)
21
22extern unsigned int user_debug;
23
24extern void disable_hlt(void);
25extern void enable_hlt(void);
26
27#endif /* !__ASSEMBLY__ */
28
29#endif /* __ASM_ARM_SYSTEM_MISC_H */
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 2958976d867..71f6536d17a 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -16,8 +16,8 @@
16#include <asm/errno.h> 16#include <asm/errno.h>
17#include <asm/memory.h> 17#include <asm/memory.h>
18#include <asm/domain.h> 18#include <asm/domain.h>
19#include <asm/system.h>
20#include <asm/unified.h> 19#include <asm/unified.h>
20#include <asm/compiler.h>
21 21
22#define VERIFY_READ 0 22#define VERIFY_READ 0
23#define VERIFY_WRITE 1 23#define VERIFY_WRITE 1
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 5b0bce61eb6..b57c75e0b01 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -18,7 +18,6 @@
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <asm/checksum.h> 20#include <asm/checksum.h>
21#include <asm/system.h>
22#include <asm/ftrace.h> 21#include <asm/ftrace.h>
23 22
24/* 23/*
diff --git a/arch/arm/kernel/elf.c b/arch/arm/kernel/elf.c
index ddba41d1fcf..d0d1e83150c 100644
--- a/arch/arm/kernel/elf.c
+++ b/arch/arm/kernel/elf.c
@@ -3,6 +3,7 @@
3#include <linux/personality.h> 3#include <linux/personality.h>
4#include <linux/binfmts.h> 4#include <linux/binfmts.h>
5#include <linux/elf.h> 5#include <linux/elf.h>
6#include <asm/system_info.h>
6 7
7int elf_check_arch(const struct elf32_hdr *x) 8int elf_check_arch(const struct elf32_hdr *x)
8{ 9{
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 22f0ed324f3..8ec5eed55e3 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -26,7 +26,7 @@
26#include <asm/unwind.h> 26#include <asm/unwind.h>
27#include <asm/unistd.h> 27#include <asm/unistd.h>
28#include <asm/tls.h> 28#include <asm/tls.h>
29#include <asm/system.h> 29#include <asm/system_info.h>
30 30
31#include "entry-header.S" 31#include "entry-header.S"
32#include <asm/entry-macro-multi.S> 32#include <asm/entry-macro-multi.S>
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
index 4c164ece589..c32f8456aa0 100644
--- a/arch/arm/kernel/fiq.c
+++ b/arch/arm/kernel/fiq.c
@@ -42,9 +42,9 @@
42#include <linux/seq_file.h> 42#include <linux/seq_file.h>
43 43
44#include <asm/cacheflush.h> 44#include <asm/cacheflush.h>
45#include <asm/cp15.h>
45#include <asm/fiq.h> 46#include <asm/fiq.h>
46#include <asm/irq.h> 47#include <asm/irq.h>
47#include <asm/system.h>
48#include <asm/traps.h> 48#include <asm/traps.h>
49 49
50static unsigned long no_fiq_insn; 50static unsigned long no_fiq_insn;
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index d46f25968be..278cfc144f4 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -17,8 +17,8 @@
17#include <asm/assembler.h> 17#include <asm/assembler.h>
18#include <asm/ptrace.h> 18#include <asm/ptrace.h>
19#include <asm/asm-offsets.h> 19#include <asm/asm-offsets.h>
20#include <asm/cp15.h>
20#include <asm/thread_info.h> 21#include <asm/thread_info.h>
21#include <asm/system.h>
22 22
23/* 23/*
24 * Kernel startup entry point. 24 * Kernel startup entry point.
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 6d579114406..a2e9694a68e 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -15,12 +15,12 @@
15#include <linux/init.h> 15#include <linux/init.h>
16 16
17#include <asm/assembler.h> 17#include <asm/assembler.h>
18#include <asm/cp15.h>
18#include <asm/domain.h> 19#include <asm/domain.h>
19#include <asm/ptrace.h> 20#include <asm/ptrace.h>
20#include <asm/asm-offsets.h> 21#include <asm/asm-offsets.h>
21#include <asm/memory.h> 22#include <asm/memory.h>
22#include <asm/thread_info.h> 23#include <asm/thread_info.h>
23#include <asm/system.h>
24#include <asm/pgtable.h> 24#include <asm/pgtable.h>
25 25
26#ifdef CONFIG_DEBUG_LL 26#ifdef CONFIG_DEBUG_LL
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index d6a95ef9131..ba386bd9410 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -34,7 +34,6 @@
34#include <asm/current.h> 34#include <asm/current.h>
35#include <asm/hw_breakpoint.h> 35#include <asm/hw_breakpoint.h>
36#include <asm/kdebug.h> 36#include <asm/kdebug.h>
37#include <asm/system.h>
38#include <asm/traps.h> 37#include <asm/traps.h>
39 38
40/* Breakpoint currently in use for each BRP. */ 39/* Breakpoint currently in use for each BRP. */
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 3efd82cc95f..6a6a097edd6 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -36,7 +36,6 @@
36#include <linux/proc_fs.h> 36#include <linux/proc_fs.h>
37 37
38#include <asm/exception.h> 38#include <asm/exception.h>
39#include <asm/system.h>
40#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
41#include <asm/mach/irq.h> 40#include <asm/mach/irq.h>
42#include <asm/mach/time.h> 41#include <asm/mach/time.h>
diff --git a/arch/arm/kernel/kprobes-common.c b/arch/arm/kernel/kprobes-common.c
index a5394fb4e4e..18a76282970 100644
--- a/arch/arm/kernel/kprobes-common.c
+++ b/arch/arm/kernel/kprobes-common.c
@@ -13,6 +13,7 @@
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/kprobes.h> 15#include <linux/kprobes.h>
16#include <asm/system_info.h>
16 17
17#include "kprobes.h" 18#include "kprobes.h"
18 19
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index 764bd456d84..56995983eed 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -12,7 +12,7 @@
12#include <asm/mmu_context.h> 12#include <asm/mmu_context.h>
13#include <asm/cacheflush.h> 13#include <asm/cacheflush.h>
14#include <asm/mach-types.h> 14#include <asm/mach-types.h>
15#include <asm/system.h> 15#include <asm/system_misc.h>
16 16
17extern const unsigned char relocate_new_kernel[]; 17extern const unsigned char relocate_new_kernel[];
18extern const unsigned int relocate_new_kernel_size; 18extern const unsigned int relocate_new_kernel_size;
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index d3eca452453..7b9cddef6e5 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -35,7 +35,6 @@
35#include <asm/cacheflush.h> 35#include <asm/cacheflush.h>
36#include <asm/leds.h> 36#include <asm/leds.h>
37#include <asm/processor.h> 37#include <asm/processor.h>
38#include <asm/system.h>
39#include <asm/thread_notify.h> 38#include <asm/thread_notify.h>
40#include <asm/stacktrace.h> 39#include <asm/stacktrace.h>
41#include <asm/mach/time.h> 40#include <asm/mach/time.h>
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index ede6443c34d..45956c9d0ef 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -26,7 +26,6 @@
26#include <linux/audit.h> 26#include <linux/audit.h>
27 27
28#include <asm/pgtable.h> 28#include <asm/pgtable.h>
29#include <asm/system.h>
30#include <asm/traps.h> 29#include <asm/traps.h>
31 30
32#define REG_PC 15 31#define REG_PC 15
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index a255c39612c..9e0fdb3a198 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -33,6 +33,7 @@
33#include <linux/sort.h> 33#include <linux/sort.h>
34 34
35#include <asm/unified.h> 35#include <asm/unified.h>
36#include <asm/cp15.h>
36#include <asm/cpu.h> 37#include <asm/cpu.h>
37#include <asm/cputype.h> 38#include <asm/cputype.h>
38#include <asm/elf.h> 39#include <asm/elf.h>
@@ -44,12 +45,13 @@
44#include <asm/cacheflush.h> 45#include <asm/cacheflush.h>
45#include <asm/cachetype.h> 46#include <asm/cachetype.h>
46#include <asm/tlbflush.h> 47#include <asm/tlbflush.h>
47#include <asm/system.h>
48 48
49#include <asm/prom.h> 49#include <asm/prom.h>
50#include <asm/mach/arch.h> 50#include <asm/mach/arch.h>
51#include <asm/mach/irq.h> 51#include <asm/mach/irq.h>
52#include <asm/mach/time.h> 52#include <asm/mach/time.h>
53#include <asm/system_info.h>
54#include <asm/system_misc.h>
53#include <asm/traps.h> 55#include <asm/traps.h>
54#include <asm/unwind.h> 56#include <asm/unwind.h>
55#include <asm/memblock.h> 57#include <asm/memblock.h>
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
index 1f268bda455..987dcf33415 100644
--- a/arch/arm/kernel/sleep.S
+++ b/arch/arm/kernel/sleep.S
@@ -4,7 +4,6 @@
4#include <asm/assembler.h> 4#include <asm/assembler.h>
5#include <asm/glue-cache.h> 5#include <asm/glue-cache.h>
6#include <asm/glue-proc.h> 6#include <asm/glue-proc.h>
7#include <asm/system.h>
8 .text 7 .text
9 8
10/* 9/*
diff --git a/arch/arm/kernel/tcm.c b/arch/arm/kernel/tcm.c
index 01ec453bb92..30ae6bb4a31 100644
--- a/arch/arm/kernel/tcm.c
+++ b/arch/arm/kernel/tcm.c
@@ -16,6 +16,7 @@
16#include <asm/cputype.h> 16#include <asm/cputype.h>
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18#include <asm/memory.h> 18#include <asm/memory.h>
19#include <asm/system_info.h>
19#include "tcm.h" 20#include "tcm.h"
20 21
21static struct gen_pool *tcm_pool; 22static struct gen_pool *tcm_pool;
diff --git a/arch/arm/kernel/thumbee.c b/arch/arm/kernel/thumbee.c
index 9cb7aaca159..aab89976405 100644
--- a/arch/arm/kernel/thumbee.c
+++ b/arch/arm/kernel/thumbee.c
@@ -20,6 +20,7 @@
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/init.h> 21#include <linux/init.h>
22 22
23#include <asm/system_info.h>
23#include <asm/thread_notify.h> 24#include <asm/thread_notify.h>
24 25
25/* 26/*
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index f84dfe67724..cd77743472a 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -29,11 +29,11 @@
29#include <linux/atomic.h> 29#include <linux/atomic.h>
30#include <asm/cacheflush.h> 30#include <asm/cacheflush.h>
31#include <asm/exception.h> 31#include <asm/exception.h>
32#include <asm/system.h>
33#include <asm/unistd.h> 32#include <asm/unistd.h>
34#include <asm/traps.h> 33#include <asm/traps.h>
35#include <asm/unwind.h> 34#include <asm/unwind.h>
36#include <asm/tls.h> 35#include <asm/tls.h>
36#include <asm/system_misc.h>
37 37
38#include "signal.h" 38#include "signal.h"
39 39
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 0df1045311e..364c19357e6 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -15,6 +15,7 @@
15#include <asm/irq.h> 15#include <asm/irq.h>
16#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18#include <asm/system_misc.h>
18#include <mach/at91rm9200.h> 19#include <mach/at91rm9200.h>
19#include <mach/at91_pmc.h> 20#include <mach/at91_pmc.h>
20#include <mach/at91_st.h> 21#include <mach/at91_st.h>
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index d1e5750a6a0..46f77423329 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -16,6 +16,7 @@
16#include <asm/irq.h> 16#include <asm/irq.h>
17#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
18#include <asm/mach/map.h> 18#include <asm/mach/map.h>
19#include <asm/system_misc.h>
19#include <mach/cpu.h> 20#include <mach/cpu.h>
20#include <mach/at91_dbgu.h> 21#include <mach/at91_dbgu.h>
21#include <mach/at91sam9260.h> 22#include <mach/at91sam9260.h>
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 684c5dfd92a..7de81e6222f 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -16,6 +16,7 @@
16#include <asm/irq.h> 16#include <asm/irq.h>
17#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
18#include <asm/mach/map.h> 18#include <asm/mach/map.h>
19#include <asm/system_misc.h>
19#include <mach/cpu.h> 20#include <mach/cpu.h>
20#include <mach/at91sam9261.h> 21#include <mach/at91sam9261.h>
21#include <mach/at91_pmc.h> 22#include <mach/at91_pmc.h>
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 0b4fa5a7f68..ef301be6657 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -16,6 +16,7 @@
16#include <asm/irq.h> 16#include <asm/irq.h>
17#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
18#include <asm/mach/map.h> 18#include <asm/mach/map.h>
19#include <asm/system_misc.h>
19#include <mach/at91sam9263.h> 20#include <mach/at91sam9263.h>
20#include <mach/at91_pmc.h> 21#include <mach/at91_pmc.h>
21#include <mach/at91_rstc.h> 22#include <mach/at91_rstc.h>
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index df3bceacc86..d222f8333da 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -16,6 +16,7 @@
16#include <asm/irq.h> 16#include <asm/irq.h>
17#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
18#include <asm/mach/map.h> 18#include <asm/mach/map.h>
19#include <asm/system_misc.h>
19#include <mach/at91sam9g45.h> 20#include <mach/at91sam9g45.h>
20#include <mach/at91_pmc.h> 21#include <mach/at91_pmc.h>
21#include <mach/cpu.h> 22#include <mach/cpu.h>
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 63d9372eb18..d9f2774f385 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -15,6 +15,7 @@
15#include <asm/irq.h> 15#include <asm/irq.h>
16#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18#include <asm/system_misc.h>
18#include <mach/cpu.h> 19#include <mach/cpu.h>
19#include <mach/at91_dbgu.h> 20#include <mach/at91_dbgu.h>
20#include <mach/at91sam9rl.h> 21#include <mach/at91sam9rl.h>
diff --git a/arch/arm/mach-at91/include/mach/system_rev.h b/arch/arm/mach-at91/include/mach/system_rev.h
index ec164a4124c..ef79a9aafc0 100644
--- a/arch/arm/mach-at91/include/mach/system_rev.h
+++ b/arch/arm/mach-at91/include/mach/system_rev.h
@@ -7,6 +7,8 @@
7#ifndef __ARCH_SYSTEM_REV_H__ 7#ifndef __ARCH_SYSTEM_REV_H__
8#define __ARCH_SYSTEM_REV_H__ 8#define __ARCH_SYSTEM_REV_H__
9 9
10#include <asm/system_info.h>
11
10/* 12/*
11 * board revision encoding 13 * board revision encoding
12 * mach specific 14 * mach specific
diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c
index 8736c1acc16..3c5b5bbf24e 100644
--- a/arch/arm/mach-clps711x/common.c
+++ b/arch/arm/mach-clps711x/common.c
@@ -37,6 +37,7 @@
37#include <asm/mach/map.h> 37#include <asm/mach/map.h>
38#include <asm/mach/time.h> 38#include <asm/mach/time.h>
39#include <asm/hardware/clps7111.h> 39#include <asm/hardware/clps7111.h>
40#include <asm/system_misc.h>
40 41
41/* 42/*
42 * This maps the generic CLPS711x registers 43 * This maps the generic CLPS711x registers
diff --git a/arch/arm/mach-clps711x/p720t-leds.c b/arch/arm/mach-clps711x/p720t-leds.c
index 15121446efc..dd9a6cdbeb0 100644
--- a/arch/arm/mach-clps711x/p720t-leds.c
+++ b/arch/arm/mach-clps711x/p720t-leds.c
@@ -25,7 +25,6 @@
25 25
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <asm/leds.h> 27#include <asm/leds.h>
28#include <asm/system.h>
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30 29
31#include <asm/hardware/clps7111.h> 30#include <asm/hardware/clps7111.h>
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index d5088900af6..a70de24d1cb 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -36,6 +36,7 @@
36 36
37#include <asm/mach-types.h> 37#include <asm/mach-types.h>
38#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
39#include <asm/system_info.h>
39 40
40#include <mach/cp_intc.h> 41#include <mach/cp_intc.h>
41#include <mach/da8xx.h> 42#include <mach/da8xx.h>
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c
index e400d75d11a..8c9f56a3e8e 100644
--- a/arch/arm/mach-ebsa110/core.c
+++ b/arch/arm/mach-ebsa110/core.c
@@ -22,7 +22,7 @@
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/page.h> 24#include <asm/page.h>
25#include <asm/system.h> 25#include <asm/system_misc.h>
26 26
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/mach/irq.h> 28#include <asm/mach/irq.h>
diff --git a/arch/arm/mach-ebsa110/leds.c b/arch/arm/mach-ebsa110/leds.c
index d43121a30aa..99e14e36250 100644
--- a/arch/arm/mach-ebsa110/leds.c
+++ b/arch/arm/mach-ebsa110/leds.c
@@ -17,7 +17,6 @@
17 17
18#include <mach/hardware.h> 18#include <mach/hardware.h>
19#include <asm/leds.h> 19#include <asm/leds.h>
20#include <asm/system.h>
21#include <asm/mach-types.h> 20#include <asm/mach-types.h>
22 21
23#include "core.h" 22#include "core.h"
diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c
index dd1ad55524c..9c17a0a4385 100644
--- a/arch/arm/mach-exynos/hotplug.c
+++ b/arch/arm/mach-exynos/hotplug.c
@@ -16,6 +16,7 @@
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
19#include <asm/cp15.h>
19#include <asm/smp_plat.h> 20#include <asm/smp_plat.h>
20 21
21#include <mach/regs-pmu.h> 22#include <mach/regs-pmu.h>
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c
index 41978ee4f9d..3e6aaa6361d 100644
--- a/arch/arm/mach-footbridge/common.c
+++ b/arch/arm/mach-footbridge/common.c
@@ -21,6 +21,7 @@
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/setup.h> 23#include <asm/setup.h>
24#include <asm/system_misc.h>
24#include <asm/hardware/dec21285.h> 25#include <asm/hardware/dec21285.h>
25 26
26#include <asm/mach/irq.h> 27#include <asm/mach/irq.h>
diff --git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c
index 121ad1d4fa3..3b54196447c 100644
--- a/arch/arm/mach-footbridge/dc21285-timer.c
+++ b/arch/arm/mach-footbridge/dc21285-timer.c
@@ -14,6 +14,7 @@
14 14
15#include <asm/hardware/dec21285.h> 15#include <asm/hardware/dec21285.h>
16#include <asm/mach/time.h> 16#include <asm/mach/time.h>
17#include <asm/system_info.h>
17 18
18#include "common.h" 19#include "common.h"
19 20
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
index 3194d3f7350..e17e11de4f5 100644
--- a/arch/arm/mach-footbridge/dc21285.c
+++ b/arch/arm/mach-footbridge/dc21285.c
@@ -21,7 +21,6 @@
21#include <video/vga.h> 21#include <video/vga.h>
22 22
23#include <asm/irq.h> 23#include <asm/irq.h>
24#include <asm/system.h>
25#include <asm/mach/pci.h> 24#include <asm/mach/pci.h>
26#include <asm/hardware/dec21285.h> 25#include <asm/hardware/dec21285.h>
27 26
diff --git a/arch/arm/mach-footbridge/ebsa285-leds.c b/arch/arm/mach-footbridge/ebsa285-leds.c
index 4e10090cd87..5bd266754b9 100644
--- a/arch/arm/mach-footbridge/ebsa285-leds.c
+++ b/arch/arm/mach-footbridge/ebsa285-leds.c
@@ -24,7 +24,6 @@
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <asm/leds.h> 25#include <asm/leds.h>
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <asm/system.h>
28 27
29#define LED_STATE_ENABLED 1 28#define LED_STATE_ENABLED 1
30#define LED_STATE_CLAIMED 2 29#define LED_STATE_CLAIMED 2
diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c
index 80a1c5cc907..cac9f67e7da 100644
--- a/arch/arm/mach-footbridge/netwinder-hw.c
+++ b/arch/arm/mach-footbridge/netwinder-hw.c
@@ -17,6 +17,7 @@
17#include <asm/leds.h> 17#include <asm/leds.h>
18#include <asm/mach-types.h> 18#include <asm/mach-types.h>
19#include <asm/setup.h> 19#include <asm/setup.h>
20#include <asm/system_misc.h>
20 21
21#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
22 23
diff --git a/arch/arm/mach-footbridge/netwinder-leds.c b/arch/arm/mach-footbridge/netwinder-leds.c
index e57102e871f..5a2bd89cbdc 100644
--- a/arch/arm/mach-footbridge/netwinder-leds.c
+++ b/arch/arm/mach-footbridge/netwinder-leds.c
@@ -24,7 +24,6 @@
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <asm/leds.h> 25#include <asm/leds.h>
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <asm/system.h>
28 27
29#define LED_STATE_ENABLED 1 28#define LED_STATE_ENABLED 1
30#define LED_STATE_CLAIMED 2 29#define LED_STATE_CLAIMED 2
diff --git a/arch/arm/mach-imx/dma-v1.c b/arch/arm/mach-imx/dma-v1.c
index 42afc29a7da..3189a6004cf 100644
--- a/arch/arm/mach-imx/dma-v1.c
+++ b/arch/arm/mach-imx/dma-v1.c
@@ -32,7 +32,6 @@
32#include <linux/scatterlist.h> 32#include <linux/scatterlist.h>
33#include <linux/io.h> 33#include <linux/io.h>
34 34
35#include <asm/system.h>
36#include <asm/irq.h> 35#include <asm/irq.h>
37#include <mach/hardware.h> 36#include <mach/hardware.h>
38#include <mach/dma-v1.h> 37#include <mach/dma-v1.h>
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 7696dfa2bdb..da6c1d9af76 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -26,6 +26,7 @@
26#include <asm/hardware/gic.h> 26#include <asm/hardware/gic.h>
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/mach/time.h> 28#include <asm/mach/time.h>
29#include <asm/system_misc.h>
29#include <mach/common.h> 30#include <mach/common.h>
30#include <mach/hardware.h> 31#include <mach/hardware.h>
31 32
diff --git a/arch/arm/mach-imx/mach-mx51_efikamx.c b/arch/arm/mach-imx/mach-mx51_efikamx.c
index 3a5ed2dd885..586e9f82212 100644
--- a/arch/arm/mach-imx/mach-mx51_efikamx.c
+++ b/arch/arm/mach-imx/mach-mx51_efikamx.c
@@ -33,6 +33,7 @@
33#include <mach/iomux-mx51.h> 33#include <mach/iomux-mx51.h>
34 34
35#include <asm/setup.h> 35#include <asm/setup.h>
36#include <asm/system_info.h>
36#include <asm/mach-types.h> 37#include <asm/mach-types.h>
37#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
38#include <asm/mach/time.h> 39#include <asm/mach/time.h>
diff --git a/arch/arm/mach-imx/mach-mx51_efikasb.c b/arch/arm/mach-imx/mach-mx51_efikasb.c
index ea5f65b0381..24aded9e109 100644
--- a/arch/arm/mach-imx/mach-mx51_efikasb.c
+++ b/arch/arm/mach-imx/mach-mx51_efikasb.c
@@ -36,6 +36,7 @@
36#include <mach/iomux-mx51.h> 36#include <mach/iomux-mx51.h>
37 37
38#include <asm/setup.h> 38#include <asm/setup.h>
39#include <asm/system_info.h>
39#include <asm/mach-types.h> 40#include <asm/mach-types.h>
40#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
41#include <asm/mach/time.h> 42#include <asm/mach/time.h>
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 15b87f26ac9..1a65d77bd55 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -27,7 +27,6 @@
27#include <mach/platform.h> 27#include <mach/platform.h>
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <mach/cm.h> 29#include <mach/cm.h>
30#include <asm/system.h>
31#include <asm/leds.h> 30#include <asm/leds.h>
32#include <asm/mach-types.h> 31#include <asm/mach-types.h>
33#include <asm/mach/time.h> 32#include <asm/mach/time.h>
diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c
index 28be186adb8..466defa9784 100644
--- a/arch/arm/mach-integrator/leds.c
+++ b/arch/arm/mach-integrator/leds.c
@@ -29,7 +29,6 @@
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/platform.h> 30#include <mach/platform.h>
31#include <asm/leds.h> 31#include <asm/leds.h>
32#include <asm/system.h>
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34#include <mach/cm.h> 33#include <mach/cm.h>
35 34
diff --git a/arch/arm/mach-integrator/pci.c b/arch/arm/mach-integrator/pci.c
index 520b6bf81bb..36068f438f2 100644
--- a/arch/arm/mach-integrator/pci.c
+++ b/arch/arm/mach-integrator/pci.c
@@ -27,7 +27,6 @@
27#include <linux/init.h> 27#include <linux/init.h>
28 28
29#include <asm/irq.h> 29#include <asm/irq.h>
30#include <asm/system.h>
31#include <asm/mach/pci.h> 30#include <asm/mach/pci.h>
32#include <asm/mach-types.h> 31#include <asm/mach-types.h>
33 32
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
index 015be770c1d..4be172c3cbe 100644
--- a/arch/arm/mach-integrator/pci_v3.c
+++ b/arch/arm/mach-integrator/pci_v3.c
@@ -32,7 +32,6 @@
32#include <mach/platform.h> 32#include <mach/platform.h>
33#include <asm/irq.h> 33#include <asm/irq.h>
34#include <asm/signal.h> 34#include <asm/signal.h>
35#include <asm/system.h>
36#include <asm/mach/pci.h> 35#include <asm/mach/pci.h>
37#include <asm/irq_regs.h> 36#include <asm/irq_regs.h>
38 37
diff --git a/arch/arm/mach-iop33x/uart.c b/arch/arm/mach-iop33x/uart.c
index cdae24e46ee..bbf54d794ce 100644
--- a/arch/arm/mach-iop33x/uart.c
+++ b/arch/arm/mach-iop33x/uart.c
@@ -22,7 +22,6 @@
22#include <asm/page.h> 22#include <asm/page.h>
23#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24#include <asm/setup.h> 24#include <asm/setup.h>
25#include <asm/system.h>
26#include <asm/memory.h> 25#include <asm/memory.h>
27#include <mach/hardware.h> 26#include <mach/hardware.h>
28#include <asm/hardware/iop3xx.h> 27#include <asm/hardware/iop3xx.h>
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index 81c45370a4e..f214cdff01c 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -32,7 +32,6 @@
32#include <asm/memory.h> 32#include <asm/memory.h>
33#include <mach/hardware.h> 33#include <mach/hardware.h>
34#include <asm/irq.h> 34#include <asm/irq.h>
35#include <asm/system.h>
36#include <asm/tlbflush.h> 35#include <asm/tlbflush.h>
37#include <asm/pgtable.h> 36#include <asm/pgtable.h>
38 37
diff --git a/arch/arm/mach-ixp2000/enp2611.c b/arch/arm/mach-ixp2000/enp2611.c
index e872d238cd0..4867f408617 100644
--- a/arch/arm/mach-ixp2000/enp2611.c
+++ b/arch/arm/mach-ixp2000/enp2611.c
@@ -36,7 +36,6 @@
36#include <asm/irq.h> 36#include <asm/irq.h>
37#include <asm/pgtable.h> 37#include <asm/pgtable.h>
38#include <asm/page.h> 38#include <asm/page.h>
39#include <asm/system.h>
40#include <mach/hardware.h> 39#include <mach/hardware.h>
41#include <asm/mach-types.h> 40#include <asm/mach-types.h>
42 41
diff --git a/arch/arm/mach-ixp2000/ixdp2400.c b/arch/arm/mach-ixp2000/ixdp2400.c
index d519944653a..915ad49e3b8 100644
--- a/arch/arm/mach-ixp2000/ixdp2400.c
+++ b/arch/arm/mach-ixp2000/ixdp2400.c
@@ -29,7 +29,6 @@
29#include <asm/irq.h> 29#include <asm/irq.h>
30#include <asm/pgtable.h> 30#include <asm/pgtable.h>
31#include <asm/page.h> 31#include <asm/page.h>
32#include <asm/system.h>
33#include <mach/hardware.h> 32#include <mach/hardware.h>
34#include <asm/mach-types.h> 33#include <asm/mach-types.h>
35 34
diff --git a/arch/arm/mach-ixp2000/ixdp2800.c b/arch/arm/mach-ixp2000/ixdp2800.c
index b415febd202..a9f1819ea04 100644
--- a/arch/arm/mach-ixp2000/ixdp2800.c
+++ b/arch/arm/mach-ixp2000/ixdp2800.c
@@ -29,7 +29,6 @@
29#include <asm/irq.h> 29#include <asm/irq.h>
30#include <asm/pgtable.h> 30#include <asm/pgtable.h>
31#include <asm/page.h> 31#include <asm/page.h>
32#include <asm/system.h>
33#include <mach/hardware.h> 32#include <mach/hardware.h>
34#include <asm/mach-types.h> 33#include <asm/mach-types.h>
35 34
diff --git a/arch/arm/mach-ixp2000/ixdp2x00.c b/arch/arm/mach-ixp2000/ixdp2x00.c
index dd983829906..421e38dc0fa 100644
--- a/arch/arm/mach-ixp2000/ixdp2x00.c
+++ b/arch/arm/mach-ixp2000/ixdp2x00.c
@@ -30,7 +30,6 @@
30#include <asm/irq.h> 30#include <asm/irq.h>
31#include <asm/pgtable.h> 31#include <asm/pgtable.h>
32#include <asm/page.h> 32#include <asm/page.h>
33#include <asm/system.h>
34#include <mach/hardware.h> 33#include <mach/hardware.h>
35#include <asm/mach-types.h> 34#include <asm/mach-types.h>
36 35
diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c
index 7632beadabf..5196c39cdba 100644
--- a/arch/arm/mach-ixp2000/ixdp2x01.c
+++ b/arch/arm/mach-ixp2000/ixdp2x01.c
@@ -34,7 +34,6 @@
34#include <asm/irq.h> 34#include <asm/irq.h>
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/page.h> 36#include <asm/page.h>
37#include <asm/system.h>
38#include <mach/hardware.h> 37#include <mach/hardware.h>
39#include <asm/mach-types.h> 38#include <asm/mach-types.h>
40 39
diff --git a/arch/arm/mach-ixp2000/pci.c b/arch/arm/mach-ixp2000/pci.c
index 49c36f3cd60..9c02de932fa 100644
--- a/arch/arm/mach-ixp2000/pci.c
+++ b/arch/arm/mach-ixp2000/pci.c
@@ -26,7 +26,6 @@
26#include <linux/io.h> 26#include <linux/io.h>
27 27
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/system.h>
30#include <mach/hardware.h> 29#include <mach/hardware.h>
31 30
32#include <asm/mach/pci.h> 31#include <asm/mach/pci.h>
diff --git a/arch/arm/mach-ixp23xx/core.c b/arch/arm/mach-ixp23xx/core.c
index 7c1495e4fe7..d2c2dc35cbd 100644
--- a/arch/arm/mach-ixp23xx/core.c
+++ b/arch/arm/mach-ixp23xx/core.c
@@ -34,7 +34,6 @@
34#include <asm/memory.h> 34#include <asm/memory.h>
35#include <mach/hardware.h> 35#include <mach/hardware.h>
36#include <asm/irq.h> 36#include <asm/irq.h>
37#include <asm/system.h>
38#include <asm/tlbflush.h> 37#include <asm/tlbflush.h>
39#include <asm/pgtable.h> 38#include <asm/pgtable.h>
40 39
diff --git a/arch/arm/mach-ixp23xx/espresso.c b/arch/arm/mach-ixp23xx/espresso.c
index 8f2487e1fc4..d142d45dea1 100644
--- a/arch/arm/mach-ixp23xx/espresso.c
+++ b/arch/arm/mach-ixp23xx/espresso.c
@@ -32,7 +32,6 @@
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/irq.h> 34#include <asm/irq.h>
35#include <asm/system.h>
36#include <asm/tlbflush.h> 35#include <asm/tlbflush.h>
37#include <asm/pgtable.h> 36#include <asm/pgtable.h>
38 37
diff --git a/arch/arm/mach-ixp23xx/ixdp2351.c b/arch/arm/mach-ixp23xx/ixdp2351.c
index 5d5dd3e8d06..b0e07db5cea 100644
--- a/arch/arm/mach-ixp23xx/ixdp2351.c
+++ b/arch/arm/mach-ixp23xx/ixdp2351.c
@@ -36,7 +36,6 @@
36#include <asm/memory.h> 36#include <asm/memory.h>
37#include <mach/hardware.h> 37#include <mach/hardware.h>
38#include <asm/mach-types.h> 38#include <asm/mach-types.h>
39#include <asm/system.h>
40#include <asm/tlbflush.h> 39#include <asm/tlbflush.h>
41#include <asm/pgtable.h> 40#include <asm/pgtable.h>
42 41
diff --git a/arch/arm/mach-ixp23xx/pci.c b/arch/arm/mach-ixp23xx/pci.c
index 3cbbd3208fa..911f5a58e00 100644
--- a/arch/arm/mach-ixp23xx/pci.c
+++ b/arch/arm/mach-ixp23xx/pci.c
@@ -28,7 +28,6 @@
28 28
29#include <asm/irq.h> 29#include <asm/irq.h>
30#include <asm/sizes.h> 30#include <asm/sizes.h>
31#include <asm/system.h>
32#include <asm/mach/pci.h> 31#include <asm/mach/pci.h>
33#include <mach/hardware.h> 32#include <mach/hardware.h>
34 33
diff --git a/arch/arm/mach-ixp23xx/roadrunner.c b/arch/arm/mach-ixp23xx/roadrunner.c
index 377283fc658..eaaa3fa9fd0 100644
--- a/arch/arm/mach-ixp23xx/roadrunner.c
+++ b/arch/arm/mach-ixp23xx/roadrunner.c
@@ -36,7 +36,6 @@
36#include <mach/hardware.h> 36#include <mach/hardware.h>
37#include <asm/mach-types.h> 37#include <asm/mach-types.h>
38#include <asm/irq.h> 38#include <asm/irq.h>
39#include <asm/system.h>
40#include <asm/tlbflush.h> 39#include <asm/tlbflush.h>
41#include <asm/pgtable.h> 40#include <asm/pgtable.h>
42 41
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index 8508882b13f..d5719eb4259 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -32,7 +32,6 @@
32#include <asm/cputype.h> 32#include <asm/cputype.h>
33#include <asm/irq.h> 33#include <asm/irq.h>
34#include <asm/sizes.h> 34#include <asm/sizes.h>
35#include <asm/system.h>
36#include <asm/mach/pci.h> 35#include <asm/mach/pci.h>
37#include <mach/hardware.h> 36#include <mach/hardware.h>
38 37
diff --git a/arch/arm/mach-ixp4xx/goramo_mlr.c b/arch/arm/mach-ixp4xx/goramo_mlr.c
index c0e3d69a8ae..78ae12c4626 100644
--- a/arch/arm/mach-ixp4xx/goramo_mlr.c
+++ b/arch/arm/mach-ixp4xx/goramo_mlr.c
@@ -12,7 +12,6 @@
12#include <linux/pci.h> 12#include <linux/pci.h>
13#include <linux/serial_8250.h> 13#include <linux/serial_8250.h>
14#include <asm/mach-types.h> 14#include <asm/mach-types.h>
15#include <asm/system.h>
16#include <asm/mach/arch.h> 15#include <asm/mach/arch.h>
17#include <asm/mach/flash.h> 16#include <asm/mach/flash.h>
18#include <asm/mach/pci.h> 17#include <asm/mach/pci.h>
diff --git a/arch/arm/mach-ks8695/time.c b/arch/arm/mach-ks8695/time.c
index 37dfcd5bd2a..ec783a3070a 100644
--- a/arch/arm/mach-ks8695/time.c
+++ b/arch/arm/mach-ks8695/time.c
@@ -27,6 +27,7 @@
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <asm/mach/time.h> 29#include <asm/mach/time.h>
30#include <asm/system_misc.h>
30 31
31#include <mach/regs-timer.h> 32#include <mach/regs-timer.h>
32#include <mach/regs-irq.h> 33#include <mach/regs-irq.h>
diff --git a/arch/arm/mach-mmp/common.c b/arch/arm/mach-mmp/common.c
index 062b5b93c50..9292b7966e3 100644
--- a/arch/arm/mach-mmp/common.c
+++ b/arch/arm/mach-mmp/common.c
@@ -14,6 +14,7 @@
14 14
15#include <asm/page.h> 15#include <asm/page.h>
16#include <asm/mach/map.h> 16#include <asm/mach/map.h>
17#include <asm/system_misc.h>
17#include <mach/addr-map.h> 18#include <mach/addr-map.h>
18#include <mach/cputype.h> 19#include <mach/cputype.h>
19 20
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index f7d59c03fc6..b24d2c32cba 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -16,6 +16,7 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17 17
18#include <asm/mach/time.h> 18#include <asm/mach/time.h>
19#include <asm/system_misc.h>
19#include <mach/addr-map.h> 20#include <mach/addr-map.h>
20#include <mach/cputype.h> 21#include <mach/cputype.h>
21#include <mach/regs-apbc.h> 22#include <mach/regs-apbc.h>
diff --git a/arch/arm/mach-msm/board-sapphire.c b/arch/arm/mach-msm/board-sapphire.c
index 97b8191d9d3..4a8ea0d40b6 100644
--- a/arch/arm/mach-msm/board-sapphire.c
+++ b/arch/arm/mach-msm/board-sapphire.c
@@ -27,7 +27,6 @@
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <asm/mach/flash.h> 29#include <asm/mach/flash.h>
30#include <asm/system.h>
31#include <mach/system.h> 30#include <mach/system.h>
32#include <mach/vreg.h> 31#include <mach/vreg.h>
33#include <mach/board.h> 32#include <mach/board.h>
diff --git a/arch/arm/mach-mxs/system.c b/arch/arm/mach-mxs/system.c
index 7aa5ac5d78b..80ac1fca8a0 100644
--- a/arch/arm/mach-mxs/system.c
+++ b/arch/arm/mach-mxs/system.c
@@ -25,7 +25,7 @@
25#include <linux/module.h> 25#include <linux/module.h>
26 26
27#include <asm/proc-fns.h> 27#include <asm/proc-fns.h>
28#include <asm/system.h> 28#include <asm/system_misc.h>
29 29
30#include <mach/mxs.h> 30#include <mach/mxs.h>
31#include <mach/common.h> 31#include <mach/common.h>
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index f24c1e2c504..2b28e1da14b 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -15,6 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <asm/system_info.h>
18 19
19#include <plat/cpu.h> 20#include <plat/cpu.h>
20 21
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c
index 4b818eb9f91..f6b14a14a95 100644
--- a/arch/arm/mach-omap1/leds-h2p2-debug.c
+++ b/arch/arm/mach-omap1/leds-h2p2-debug.c
@@ -17,7 +17,6 @@
17 17
18#include <mach/hardware.h> 18#include <mach/hardware.h>
19#include <asm/leds.h> 19#include <asm/leds.h>
20#include <asm/system.h>
21#include <asm/mach-types.h> 20#include <asm/mach-types.h>
22 21
23#include <plat/fpga.h> 22#include <plat/fpga.h>
diff --git a/arch/arm/mach-omap1/leds-innovator.c b/arch/arm/mach-omap1/leds-innovator.c
index 9b99c289462..3a066ee8d02 100644
--- a/arch/arm/mach-omap1/leds-innovator.c
+++ b/arch/arm/mach-omap1/leds-innovator.c
@@ -5,7 +5,6 @@
5 5
6#include <mach/hardware.h> 6#include <mach/hardware.h>
7#include <asm/leds.h> 7#include <asm/leds.h>
8#include <asm/system.h>
9 8
10#include "leds.h" 9#include "leds.h"
11 10
diff --git a/arch/arm/mach-omap1/leds-osk.c b/arch/arm/mach-omap1/leds-osk.c
index da09f436497..936ed426b84 100644
--- a/arch/arm/mach-omap1/leds-osk.c
+++ b/arch/arm/mach-omap1/leds-osk.c
@@ -8,7 +8,6 @@
8 8
9#include <mach/hardware.h> 9#include <mach/hardware.h>
10#include <asm/leds.h> 10#include <asm/leds.h>
11#include <asm/system.h>
12 11
13#include "leds.h" 12#include "leds.h"
14 13
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c
index 5fdef7a3482..087dba0df47 100644
--- a/arch/arm/mach-omap1/mux.c
+++ b/arch/arm/mach-omap1/mux.c
@@ -27,7 +27,6 @@
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29 29
30#include <asm/system.h>
31 30
32#include <plat/mux.h> 31#include <plat/mux.h>
33 32
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 2fae6a2740f..4d8dd9a1b04 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -44,7 +44,6 @@
44#include <linux/clockchips.h> 44#include <linux/clockchips.h>
45#include <linux/io.h> 45#include <linux/io.h>
46 46
47#include <asm/system.h>
48#include <asm/leds.h> 47#include <asm/leds.h>
49#include <asm/irq.h> 48#include <asm/irq.h>
50#include <asm/sched_clock.h> 49#include <asm/sched_clock.h>
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index a2e6d0709df..325b9a0aa4a 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -46,7 +46,6 @@
46#include <linux/clockchips.h> 46#include <linux/clockchips.h>
47#include <linux/io.h> 47#include <linux/io.h>
48 48
49#include <asm/system.h>
50#include <asm/leds.h> 49#include <asm/leds.h>
51#include <asm/irq.h> 50#include <asm/irq.h>
52#include <asm/mach/irq.h> 51#include <asm/mach/irq.h>
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 8842e04aef0..ae2251fa4a6 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -42,6 +42,7 @@
42#include <asm/mach/arch.h> 42#include <asm/mach/arch.h>
43#include <asm/mach/map.h> 43#include <asm/mach/map.h>
44#include <asm/mach/flash.h> 44#include <asm/mach/flash.h>
45#include <asm/system_info.h>
45 46
46#include <plat/board.h> 47#include <plat/board.h>
47#include "common.h" 48#include "common.h"
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 16aebfb8a7e..f120997309a 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -25,6 +25,7 @@
25#include <linux/gpio_keys.h> 25#include <linux/gpio_keys.h>
26#include <linux/mmc/host.h> 26#include <linux/mmc/host.h>
27#include <linux/power/isp1704_charger.h> 27#include <linux/power/isp1704_charger.h>
28#include <asm/system_info.h>
28 29
29#include <plat/mcspi.h> 30#include <plat/mcspi.h>
30#include <plat/board.h> 31#include <plat/board.h>
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index f26b2faa169..65c33911341 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -35,7 +35,6 @@
35#include <linux/irq.h> 35#include <linux/irq.h>
36#include <linux/interrupt.h> 36#include <linux/interrupt.h>
37 37
38#include <asm/system.h>
39 38
40#include <plat/omap_hwmod.h> 39#include <plat/omap_hwmod.h>
41 40
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
index 63ab686834c..13670aa84e5 100644
--- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c
+++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
@@ -46,7 +46,6 @@
46#include <asm/cacheflush.h> 46#include <asm/cacheflush.h>
47#include <asm/tlbflush.h> 47#include <asm/tlbflush.h>
48#include <asm/smp_scu.h> 48#include <asm/smp_scu.h>
49#include <asm/system.h>
50#include <asm/pgalloc.h> 49#include <asm/pgalloc.h>
51#include <asm/suspend.h> 50#include <asm/suspend.h>
52#include <asm/hardware/cache-l2x0.h> 51#include <asm/hardware/cache-l2x0.h>
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index 5ca45ca7694..95442b69ae2 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -33,6 +33,7 @@
33#include <asm/mach/time.h> 33#include <asm/mach/time.h>
34#include <asm/mach/irq.h> 34#include <asm/mach/irq.h>
35#include <asm/mach-types.h> 35#include <asm/mach-types.h>
36#include <asm/system_misc.h>
36 37
37#include <plat/clock.h> 38#include <plat/clock.h>
38#include <plat/sram.h> 39#include <plat/sram.h>
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 027a537d72b..238defc6f6d 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -31,6 +31,7 @@
31#include <trace/events/power.h> 31#include <trace/events/power.h>
32 32
33#include <asm/suspend.h> 33#include <asm/suspend.h>
34#include <asm/system_misc.h>
34 35
35#include <plat/sram.h> 36#include <plat/sram.h>
36#include "clockdomain.h" 37#include "clockdomain.h"
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index 91e0b1c9b76..9ccaadc2cf0 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -16,6 +16,7 @@
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <asm/system_misc.h>
19 20
20#include "common.h" 21#include "common.h"
21#include "clockdomain.h" 22#include "clockdomain.h"
diff --git a/arch/arm/mach-omap2/sleep44xx.S b/arch/arm/mach-omap2/sleep44xx.S
index abd28340049..9f6b83d1b19 100644
--- a/arch/arm/mach-omap2/sleep44xx.S
+++ b/arch/arm/mach-omap2/sleep44xx.S
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <asm/system.h>
14#include <asm/smp_scu.h> 13#include <asm/smp_scu.h>
15#include <asm/memory.h> 14#include <asm/memory.h>
16#include <asm/hardware/cache-l2x0.h> 15#include <asm/hardware/cache-l2x0.h>
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 5dad38ec00e..24481666d2c 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -21,6 +21,7 @@
21#include <net/dsa.h> 21#include <net/dsa.h>
22#include <asm/page.h> 22#include <asm/page.h>
23#include <asm/setup.h> 23#include <asm/setup.h>
24#include <asm/system_misc.h>
24#include <asm/timex.h> 25#include <asm/timex.h>
25#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 27#include <asm/mach/map.h>
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 91b0f478859..c3ed15b8ea2 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -32,6 +32,7 @@
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
34#include <asm/mach/pci.h> 34#include <asm/mach/pci.h>
35#include <asm/system_info.h>
35#include <mach/orion5x.h> 36#include <mach/orion5x.h>
36#include "common.h" 37#include "common.h"
37#include "mpp.h" 38#include "mpp.h"
diff --git a/arch/arm/mach-orion5x/ls-chl-setup.c b/arch/arm/mach-orion5x/ls-chl-setup.c
index 527213169db..0c9e413b580 100644
--- a/arch/arm/mach-orion5x/ls-chl-setup.c
+++ b/arch/arm/mach-orion5x/ls-chl-setup.c
@@ -22,7 +22,6 @@
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <asm/system.h>
26#include <mach/orion5x.h> 25#include <mach/orion5x.h>
27#include "common.h" 26#include "common.h"
28#include "mpp.h" 27#include "mpp.h"
diff --git a/arch/arm/mach-orion5x/ls_hgl-setup.c b/arch/arm/mach-orion5x/ls_hgl-setup.c
index 9a8697b97dd..c1b5d8a5803 100644
--- a/arch/arm/mach-orion5x/ls_hgl-setup.c
+++ b/arch/arm/mach-orion5x/ls_hgl-setup.c
@@ -21,7 +21,6 @@
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/system.h>
25#include <mach/orion5x.h> 24#include <mach/orion5x.h>
26#include "common.h" 25#include "common.h"
27#include "mpp.h" 26#include "mpp.h"
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c
index 09c73659f46..949eaa8f12e 100644
--- a/arch/arm/mach-orion5x/lsmini-setup.c
+++ b/arch/arm/mach-orion5x/lsmini-setup.c
@@ -21,7 +21,6 @@
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/system.h>
25#include <mach/orion5x.h> 24#include <mach/orion5x.h>
26#include "common.h" 25#include "common.h"
27#include "mpp.h" 26#include "mpp.h"
diff --git a/arch/arm/mach-pnx4008/core.c b/arch/arm/mach-pnx4008/core.c
index 4cfb40b2ec1..be4c9285850 100644
--- a/arch/arm/mach-pnx4008/core.c
+++ b/arch/arm/mach-pnx4008/core.c
@@ -32,7 +32,7 @@
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33#include <asm/pgtable.h> 33#include <asm/pgtable.h>
34#include <asm/page.h> 34#include <asm/page.h>
35#include <asm/system.h> 35#include <asm/system_misc.h>
36 36
37#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
38#include <asm/mach/map.h> 38#include <asm/mach/map.h>
diff --git a/arch/arm/mach-pnx4008/dma.c b/arch/arm/mach-pnx4008/dma.c
index 7fa4bf2e212..a4739e9fb2f 100644
--- a/arch/arm/mach-pnx4008/dma.c
+++ b/arch/arm/mach-pnx4008/dma.c
@@ -24,7 +24,6 @@
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/gfp.h> 25#include <linux/gfp.h>
26 26
27#include <asm/system.h>
28#include <mach/hardware.h> 27#include <mach/hardware.h>
29#include <mach/dma.h> 28#include <mach/dma.h>
30#include <asm/dma-mapping.h> 29#include <asm/dma-mapping.h>
diff --git a/arch/arm/mach-pnx4008/irq.c b/arch/arm/mach-pnx4008/irq.c
index 7608c7a288c..41e4201972d 100644
--- a/arch/arm/mach-pnx4008/irq.c
+++ b/arch/arm/mach-pnx4008/irq.c
@@ -28,7 +28,6 @@
28#include <asm/setup.h> 28#include <asm/setup.h>
29#include <asm/pgtable.h> 29#include <asm/pgtable.h>
30#include <asm/page.h> 30#include <asm/page.h>
31#include <asm/system.h>
32#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
33#include <asm/mach/irq.h> 32#include <asm/mach/irq.h>
34#include <asm/mach/map.h> 33#include <asm/mach/map.h>
diff --git a/arch/arm/mach-pnx4008/time.c b/arch/arm/mach-pnx4008/time.c
index 0c8aad4bb0d..0cfe8af3d3b 100644
--- a/arch/arm/mach-pnx4008/time.c
+++ b/arch/arm/mach-pnx4008/time.c
@@ -24,7 +24,6 @@
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include <asm/system.h>
28#include <mach/hardware.h> 27#include <mach/hardware.h>
29#include <asm/leds.h> 28#include <asm/leds.h>
30#include <asm/mach/time.h> 29#include <asm/mach/time.h>
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 4b981b82d2a..895ee8c4500 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -44,6 +44,7 @@
44#include <asm/mach-types.h> 44#include <asm/mach-types.h>
45#include <asm/mach/arch.h> 45#include <asm/mach/arch.h>
46#include <asm/setup.h> 46#include <asm/setup.h>
47#include <asm/system_info.h>
47 48
48#include <mach/pxa300.h> 49#include <mach/pxa300.h>
49#include <mach/pxa27x-udc.h> 50#include <mach/pxa27x-udc.h>
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c
index 2b8ca0de8a3..68cc75fac21 100644
--- a/arch/arm/mach-pxa/colibri-pxa3xx.c
+++ b/arch/arm/mach-pxa/colibri-pxa3xx.c
@@ -18,6 +18,7 @@
18#include <asm/mach-types.h> 18#include <asm/mach-types.h>
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20#include <asm/sizes.h> 20#include <asm/sizes.h>
21#include <asm/system_info.h>
21#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
22#include <asm/mach/irq.h> 23#include <asm/mach/irq.h>
23#include <mach/pxa3xx-regs.h> 24#include <mach/pxa3xx-regs.h>
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 11f1e735966..de9d45e673f 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -40,7 +40,6 @@
40#include <asm/mach-types.h> 40#include <asm/mach-types.h>
41#include <mach/hardware.h> 41#include <mach/hardware.h>
42#include <asm/irq.h> 42#include <asm/irq.h>
43#include <asm/system.h>
44 43
45#include <asm/mach/arch.h> 44#include <asm/mach/arch.h>
46#include <asm/mach/map.h> 45#include <asm/mach/map.h>
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 5432ecb15de..42254175fcf 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -22,7 +22,6 @@
22#include <linux/init.h> 22#include <linux/init.h>
23 23
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <asm/system.h>
26#include <asm/mach/map.h> 25#include <asm/mach/map.h>
27#include <asm/mach-types.h> 26#include <asm/mach-types.h>
28 27
diff --git a/arch/arm/mach-pxa/leds-idp.c b/arch/arm/mach-pxa/leds-idp.c
index 8b9c17142d5..06b060025d1 100644
--- a/arch/arm/mach-pxa/leds-idp.c
+++ b/arch/arm/mach-pxa/leds-idp.c
@@ -16,7 +16,6 @@
16 16
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <asm/leds.h> 18#include <asm/leds.h>
19#include <asm/system.h>
20 19
21#include <mach/pxa25x.h> 20#include <mach/pxa25x.h>
22#include <mach/idp.h> 21#include <mach/idp.h>
diff --git a/arch/arm/mach-pxa/leds-lubbock.c b/arch/arm/mach-pxa/leds-lubbock.c
index e26d5efe196..0bd85c884a7 100644
--- a/arch/arm/mach-pxa/leds-lubbock.c
+++ b/arch/arm/mach-pxa/leds-lubbock.c
@@ -15,7 +15,6 @@
15 15
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17#include <asm/leds.h> 17#include <asm/leds.h>
18#include <asm/system.h>
19#include <mach/pxa25x.h> 18#include <mach/pxa25x.h>
20#include <mach/lubbock.h> 19#include <mach/lubbock.h>
21 20
diff --git a/arch/arm/mach-pxa/leds-mainstone.c b/arch/arm/mach-pxa/leds-mainstone.c
index db4af5eee8b..4058ab340fe 100644
--- a/arch/arm/mach-pxa/leds-mainstone.c
+++ b/arch/arm/mach-pxa/leds-mainstone.c
@@ -14,7 +14,6 @@
14 14
15#include <mach/hardware.h> 15#include <mach/hardware.h>
16#include <asm/leds.h> 16#include <asm/leds.h>
17#include <asm/system.h>
18 17
19#include <mach/pxa27x.h> 18#include <mach/pxa27x.h>
20#include <mach/mainstone.h> 19#include <mach/mainstone.h>
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 5e26f3e93fd..6f4785b347c 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -34,6 +34,7 @@
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35#include <asm/mach-types.h> 35#include <asm/mach-types.h>
36#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
37#include <asm/system_info.h>
37 38
38#include <mach/pxa27x.h> 39#include <mach/pxa27x.h>
39#include <mach/magician.h> 40#include <mach/magician.h>
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 744baee12c0..89d98c83218 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -34,7 +34,6 @@
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35#include <asm/irq.h> 35#include <asm/irq.h>
36#include <asm/setup.h> 36#include <asm/setup.h>
37#include <asm/system.h>
38 37
39#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
40#include <asm/mach/map.h> 39#include <asm/mach/map.h>
diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c
index c8497b00cdf..b4528899ef0 100644
--- a/arch/arm/mach-pxa/reset.c
+++ b/arch/arm/mach-pxa/reset.c
@@ -9,6 +9,7 @@
9#include <linux/gpio.h> 9#include <linux/gpio.h>
10#include <linux/io.h> 10#include <linux/io.h>
11#include <asm/proc-fns.h> 11#include <asm/proc-fns.h>
12#include <asm/system_misc.h>
12 13
13#include <mach/regs-ost.h> 14#include <mach/regs-ost.h>
14#include <mach/reset.h> 15#include <mach/reset.h>
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 023d6ca789d..7a3d342a773 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -57,6 +57,7 @@
57#include <asm/mach-types.h> 57#include <asm/mach-types.h>
58#include <asm/irq.h> 58#include <asm/irq.h>
59#include <asm/sizes.h> 59#include <asm/sizes.h>
60#include <asm/system_info.h>
60 61
61#include <asm/mach/arch.h> 62#include <asm/mach/arch.h>
62#include <asm/mach/map.h> 63#include <asm/mach/map.h>
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index a4dd1c34705..af3d4f7646d 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -32,6 +32,7 @@
32 32
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/suspend.h> 34#include <asm/suspend.h>
35#include <asm/system_info.h>
35#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
36#include <asm/mach/map.h> 37#include <asm/mach/map.h>
37 38
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index acd329afc3a..45868bb43cb 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -33,7 +33,6 @@
33#include <linux/clkdev.h> 33#include <linux/clkdev.h>
34#include <linux/mtd/physmap.h> 34#include <linux/mtd/physmap.h>
35 35
36#include <asm/system.h>
37#include <mach/hardware.h> 36#include <mach/hardware.h>
38#include <asm/irq.h> 37#include <asm/irq.h>
39#include <asm/leds.h> 38#include <asm/leds.h>
diff --git a/arch/arm/mach-realview/hotplug.c b/arch/arm/mach-realview/hotplug.c
index eb55f05bef3..57d9efba295 100644
--- a/arch/arm/mach-realview/hotplug.c
+++ b/arch/arm/mach-realview/hotplug.c
@@ -13,6 +13,7 @@
13#include <linux/smp.h> 13#include <linux/smp.h>
14 14
15#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
16#include <asm/cp15.h>
16#include <asm/smp_plat.h> 17#include <asm/smp_plat.h>
17 18
18extern volatile int pen_release; 19extern volatile int pen_release;
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index 731552d68ad..f3fa259ce01 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -28,6 +28,7 @@
28#include <asm/page.h> 28#include <asm/page.h>
29#include <asm/domain.h> 29#include <asm/domain.h>
30#include <asm/setup.h> 30#include <asm/setup.h>
31#include <asm/system_misc.h>
31 32
32#include <asm/mach/map.h> 33#include <asm/mach/map.h>
33#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
diff --git a/arch/arm/mach-s3c24xx/s3c2410.c b/arch/arm/mach-s3c24xx/s3c2410.c
index 061b6bb1a55..a3c5cb086ee 100644
--- a/arch/arm/mach-s3c24xx/s3c2410.c
+++ b/arch/arm/mach-s3c24xx/s3c2410.c
@@ -30,6 +30,7 @@
30 30
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <asm/irq.h> 32#include <asm/irq.h>
33#include <asm/system_misc.h>
33 34
34#include <plat/cpu-freq.h> 35#include <plat/cpu-freq.h>
35 36
diff --git a/arch/arm/mach-s3c24xx/s3c2412.c b/arch/arm/mach-s3c24xx/s3c2412.c
index c6eac987109..d4bc7f960bb 100644
--- a/arch/arm/mach-s3c24xx/s3c2412.c
+++ b/arch/arm/mach-s3c24xx/s3c2412.c
@@ -31,6 +31,7 @@
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <asm/proc-fns.h> 32#include <asm/proc-fns.h>
33#include <asm/irq.h> 33#include <asm/irq.h>
34#include <asm/system_misc.h>
34 35
35#include <plat/cpu-freq.h> 36#include <plat/cpu-freq.h>
36 37
diff --git a/arch/arm/mach-s3c24xx/s3c2416.c b/arch/arm/mach-s3c24xx/s3c2416.c
index 0e9a71c90ed..7743fade50d 100644
--- a/arch/arm/mach-s3c24xx/s3c2416.c
+++ b/arch/arm/mach-s3c24xx/s3c2416.c
@@ -43,6 +43,7 @@
43#include <mach/hardware.h> 43#include <mach/hardware.h>
44#include <asm/proc-fns.h> 44#include <asm/proc-fns.h>
45#include <asm/irq.h> 45#include <asm/irq.h>
46#include <asm/system_misc.h>
46 47
47#include <mach/regs-s3c2443-clock.h> 48#include <mach/regs-s3c2443-clock.h>
48 49
diff --git a/arch/arm/mach-s3c24xx/s3c2443.c b/arch/arm/mach-s3c24xx/s3c2443.c
index b7778a9dafa..ab648ad8fa5 100644
--- a/arch/arm/mach-s3c24xx/s3c2443.c
+++ b/arch/arm/mach-s3c24xx/s3c2443.c
@@ -29,6 +29,7 @@
29 29
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/system_misc.h>
32 33
33#include <mach/regs-s3c2443-clock.h> 34#include <mach/regs-s3c2443-clock.h>
34 35
diff --git a/arch/arm/mach-s3c24xx/s3c244x.c b/arch/arm/mach-s3c24xx/s3c244x.c
index d15852f642b..6f74118f60c 100644
--- a/arch/arm/mach-s3c24xx/s3c244x.c
+++ b/arch/arm/mach-s3c24xx/s3c244x.c
@@ -23,6 +23,7 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/io.h> 24#include <linux/io.h>
25 25
26#include <asm/system_misc.h>
26#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
28#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
index bee7dcd4df7..b313380342a 100644
--- a/arch/arm/mach-s3c64xx/common.c
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -29,6 +29,7 @@
29#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 30#include <asm/mach/map.h>
31#include <asm/hardware/vic.h> 31#include <asm/hardware/vic.h>
32#include <asm/system_misc.h>
32 33
33#include <mach/map.h> 34#include <mach/map.h>
34#include <mach/hardware.h> 35#include <mach/hardware.h>
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c
index 9143f8b1996..6e6a0a9d677 100644
--- a/arch/arm/mach-s5p64x0/common.c
+++ b/arch/arm/mach-s5p64x0/common.c
@@ -27,6 +27,7 @@
27 27
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/proc-fns.h> 29#include <asm/proc-fns.h>
30#include <asm/system_misc.h>
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 32#include <asm/mach/map.h>
32#include <asm/mach/irq.h> 33#include <asm/mach/irq.h>
diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c
index ff71e2d467c..62190865886 100644
--- a/arch/arm/mach-s5pc100/common.c
+++ b/arch/arm/mach-s5pc100/common.c
@@ -27,6 +27,7 @@
27 27
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/proc-fns.h> 29#include <asm/proc-fns.h>
30#include <asm/system_misc.h>
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 32#include <asm/mach/map.h>
32#include <asm/mach/irq.h> 33#include <asm/mach/irq.h>
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 1d0f71b17a2..7c524b4e415 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -23,10 +23,10 @@
23#include <video/sa1100fb.h> 23#include <video/sa1100fb.h>
24 24
25#include <asm/div64.h> 25#include <asm/div64.h>
26#include <asm/system.h>
27#include <asm/mach/map.h> 26#include <asm/mach/map.h>
28#include <asm/mach/flash.h> 27#include <asm/mach/flash.h>
29#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/system_misc.h>
30 30
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <mach/irqs.h> 32#include <mach/irqs.h>
diff --git a/arch/arm/mach-sa1100/leds-assabet.c b/arch/arm/mach-sa1100/leds-assabet.c
index 64e9b4b11b5..3699176bca9 100644
--- a/arch/arm/mach-sa1100/leds-assabet.c
+++ b/arch/arm/mach-sa1100/leds-assabet.c
@@ -13,7 +13,6 @@
13 13
14#include <mach/hardware.h> 14#include <mach/hardware.h>
15#include <asm/leds.h> 15#include <asm/leds.h>
16#include <asm/system.h>
17#include <mach/assabet.h> 16#include <mach/assabet.h>
18 17
19#include "leds.h" 18#include "leds.h"
diff --git a/arch/arm/mach-sa1100/leds-badge4.c b/arch/arm/mach-sa1100/leds-badge4.c
index cf1e38458b8..f99fac3eedb 100644
--- a/arch/arm/mach-sa1100/leds-badge4.c
+++ b/arch/arm/mach-sa1100/leds-badge4.c
@@ -14,7 +14,6 @@
14 14
15#include <mach/hardware.h> 15#include <mach/hardware.h>
16#include <asm/leds.h> 16#include <asm/leds.h>
17#include <asm/system.h>
18 17
19#include "leds.h" 18#include "leds.h"
20 19
diff --git a/arch/arm/mach-sa1100/leds-cerf.c b/arch/arm/mach-sa1100/leds-cerf.c
index 259b48e0be8..040540fb7d8 100644
--- a/arch/arm/mach-sa1100/leds-cerf.c
+++ b/arch/arm/mach-sa1100/leds-cerf.c
@@ -7,7 +7,6 @@
7 7
8#include <mach/hardware.h> 8#include <mach/hardware.h>
9#include <asm/leds.h> 9#include <asm/leds.h>
10#include <asm/system.h>
11 10
12#include "leds.h" 11#include "leds.h"
13 12
diff --git a/arch/arm/mach-sa1100/leds-hackkit.c b/arch/arm/mach-sa1100/leds-hackkit.c
index 2bce137462e..6a2352436e6 100644
--- a/arch/arm/mach-sa1100/leds-hackkit.c
+++ b/arch/arm/mach-sa1100/leds-hackkit.c
@@ -13,7 +13,6 @@
13 13
14#include <mach/hardware.h> 14#include <mach/hardware.h>
15#include <asm/leds.h> 15#include <asm/leds.h>
16#include <asm/system.h>
17 16
18#include "leds.h" 17#include "leds.h"
19 18
diff --git a/arch/arm/mach-sa1100/leds-lart.c b/arch/arm/mach-sa1100/leds-lart.c
index 0505a1fdcdb..a51830c60e5 100644
--- a/arch/arm/mach-sa1100/leds-lart.c
+++ b/arch/arm/mach-sa1100/leds-lart.c
@@ -13,7 +13,6 @@
13 13
14#include <mach/hardware.h> 14#include <mach/hardware.h>
15#include <asm/leds.h> 15#include <asm/leds.h>
16#include <asm/system.h>
17 16
18#include "leds.h" 17#include "leds.h"
19 18
diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c
index bf85b8b259d..2fa499ec6af 100644
--- a/arch/arm/mach-sa1100/pm.c
+++ b/arch/arm/mach-sa1100/pm.c
@@ -30,7 +30,6 @@
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <asm/memory.h> 31#include <asm/memory.h>
32#include <asm/suspend.h> 32#include <asm/suspend.h>
33#include <asm/system.h>
34#include <asm/mach/time.h> 33#include <asm/mach/time.h>
35 34
36extern int sa1100_finish_suspend(unsigned long); 35extern int sa1100_finish_suspend(unsigned long);
diff --git a/arch/arm/mach-shark/leds.c b/arch/arm/mach-shark/leds.c
index ccd49189bbd..25609076921 100644
--- a/arch/arm/mach-shark/leds.c
+++ b/arch/arm/mach-shark/leds.c
@@ -23,7 +23,6 @@
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <asm/leds.h> 25#include <asm/leds.h>
26#include <asm/system.h>
27 26
28#define LED_STATE_ENABLED 1 27#define LED_STATE_ENABLED 1
29#define LED_STATE_CLAIMED 2 28#define LED_STATE_CLAIMED 2
diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c
index 1b2334277e8..21b09b6455e 100644
--- a/arch/arm/mach-shmobile/cpuidle.c
+++ b/arch/arm/mach-shmobile/cpuidle.c
@@ -13,7 +13,6 @@
13#include <linux/suspend.h> 13#include <linux/suspend.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/err.h> 15#include <linux/err.h>
16#include <asm/system.h>
17#include <asm/io.h> 16#include <asm/io.h>
18 17
19static void shmobile_enter_wfi(void) 18static void shmobile_enter_wfi(void)
diff --git a/arch/arm/mach-shmobile/include/mach/system.h b/arch/arm/mach-shmobile/include/mach/system.h
index 3bbcb3fa077..540eaff08f3 100644
--- a/arch/arm/mach-shmobile/include/mach/system.h
+++ b/arch/arm/mach-shmobile/include/mach/system.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_ARCH_SYSTEM_H 1#ifndef __ASM_ARCH_SYSTEM_H
2#define __ASM_ARCH_SYSTEM_H 2#define __ASM_ARCH_SYSTEM_H
3 3
4#include <asm/system_misc.h>
5
4static inline void arch_reset(char mode, const char *cmd) 6static inline void arch_reset(char mode, const char *cmd)
5{ 7{
6 soft_restart(0); 8 soft_restart(0);
diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c
index c38ba7b43ef..a18a4ae16d2 100644
--- a/arch/arm/mach-shmobile/pm-r8a7779.c
+++ b/arch/arm/mach-shmobile/pm-r8a7779.c
@@ -18,7 +18,6 @@
18#include <linux/irq.h> 18#include <linux/irq.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/console.h> 20#include <linux/console.h>
21#include <asm/system.h>
22#include <asm/io.h> 21#include <asm/io.h>
23#include <mach/common.h> 22#include <mach/common.h>
24#include <mach/r8a7779.h> 23#include <mach/r8a7779.h>
diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c
index fcf8b1761ae..a3bdb12acde 100644
--- a/arch/arm/mach-shmobile/pm-sh7372.c
+++ b/arch/arm/mach-shmobile/pm-sh7372.c
@@ -21,7 +21,6 @@
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/bitrev.h> 22#include <linux/bitrev.h>
23#include <linux/console.h> 23#include <linux/console.h>
24#include <asm/system.h>
25#include <asm/io.h> 24#include <asm/io.h>
26#include <asm/tlbflush.h> 25#include <asm/tlbflush.h>
27#include <asm/suspend.h> 26#include <asm/suspend.h>
diff --git a/arch/arm/mach-shmobile/suspend.c b/arch/arm/mach-shmobile/suspend.c
index c1febe13f70..4d1b86a4992 100644
--- a/arch/arm/mach-shmobile/suspend.c
+++ b/arch/arm/mach-shmobile/suspend.c
@@ -12,8 +12,8 @@
12#include <linux/suspend.h> 12#include <linux/suspend.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/err.h> 14#include <linux/err.h>
15#include <asm/system.h>
16#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/system_misc.h>
17 17
18static int shmobile_suspend_default_enter(suspend_state_t suspend_state) 18static int shmobile_suspend_default_enter(suspend_state_t suspend_state)
19{ 19{
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c
index bb5ce39b733..7a065f0cf63 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -30,7 +30,6 @@
30#include <linux/io.h> 30#include <linux/io.h>
31#include <linux/suspend.h> 31#include <linux/suspend.h>
32 32
33#include <asm/system.h>
34 33
35#include <mach/clk.h> 34#include <mach/clk.h>
36 35
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
index f3294040d35..d8dc9ddd6d1 100644
--- a/arch/arm/mach-tegra/hotplug.c
+++ b/arch/arm/mach-tegra/hotplug.c
@@ -13,6 +13,7 @@
13#include <linux/smp.h> 13#include <linux/smp.h>
14 14
15#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
16#include <asm/cp15.h>
16 17
17static inline void cpu_enter_lowpower(void) 18static inline void cpu_enter_lowpower(void)
18{ 19{
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 0968772aedb..6bbd74e950a 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -36,7 +36,6 @@
36#include <linux/clkdev.h> 36#include <linux/clkdev.h>
37#include <linux/mtd/physmap.h> 37#include <linux/mtd/physmap.h>
38 38
39#include <asm/system.h>
40#include <asm/irq.h> 39#include <asm/irq.h>
41#include <asm/leds.h> 40#include <asm/leds.h>
42#include <asm/hardware/arm_timer.h> 41#include <asm/hardware/arm_timer.h>
diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c
index 51733b022d0..a6e23f46452 100644
--- a/arch/arm/mach-versatile/pci.c
+++ b/arch/arm/mach-versatile/pci.c
@@ -24,7 +24,6 @@
24 24
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <asm/irq.h> 26#include <asm/irq.h>
27#include <asm/system.h>
28#include <asm/mach/pci.h> 27#include <asm/mach/pci.h>
29 28
30/* 29/*
diff --git a/arch/arm/mach-vexpress/hotplug.c b/arch/arm/mach-vexpress/hotplug.c
index 3034a4dab4a..c504a72b94d 100644
--- a/arch/arm/mach-vexpress/hotplug.c
+++ b/arch/arm/mach-vexpress/hotplug.c
@@ -14,7 +14,7 @@
14 14
15#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
16#include <asm/smp_plat.h> 16#include <asm/smp_plat.h>
17#include <asm/system.h> 17#include <asm/cp15.h>
18 18
19extern volatile int pen_release; 19extern volatile int pen_release;
20 20
diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c
index 9a066199290..9e4dd8b63c4 100644
--- a/arch/arm/mach-w90x900/cpu.c
+++ b/arch/arm/mach-w90x900/cpu.c
@@ -28,6 +28,7 @@
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
30#include <asm/irq.h> 30#include <asm/irq.h>
31#include <asm/system_misc.h>
31 32
32#include <mach/hardware.h> 33#include <mach/hardware.h>
33#include <mach/regs-serial.h> 34#include <mach/regs-serial.h>
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index caf14dc059e..9107231aacc 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -22,7 +22,8 @@
22#include <linux/sched.h> 22#include <linux/sched.h>
23#include <linux/uaccess.h> 23#include <linux/uaccess.h>
24 24
25#include <asm/system.h> 25#include <asm/cp15.h>
26#include <asm/system_info.h>
26#include <asm/unaligned.h> 27#include <asm/unaligned.h>
27 28
28#include "fault.h" 29#include "fault.h"
diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c
index e0b0e7a4ec6..dd3d59122cc 100644
--- a/arch/arm/mm/cache-feroceon-l2.c
+++ b/arch/arm/mm/cache-feroceon-l2.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/highmem.h> 16#include <linux/highmem.h>
17#include <asm/cacheflush.h> 17#include <asm/cacheflush.h>
18#include <asm/cp15.h>
18#include <plat/cache-feroceon-l2.h> 19#include <plat/cache-feroceon-l2.h>
19 20
20/* 21/*
diff --git a/arch/arm/mm/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c
index 50868651890..1fbca05fe90 100644
--- a/arch/arm/mm/cache-tauros2.c
+++ b/arch/arm/mm/cache-tauros2.c
@@ -16,6 +16,7 @@
16 16
17#include <linux/init.h> 17#include <linux/init.h>
18#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
19#include <asm/cp15.h>
19#include <asm/hardware/cache-tauros2.h> 20#include <asm/hardware/cache-tauros2.h>
20 21
21 22
diff --git a/arch/arm/mm/cache-xsc3l2.c b/arch/arm/mm/cache-xsc3l2.c
index 5a32020471e..6c3edeb66e7 100644
--- a/arch/arm/mm/cache-xsc3l2.c
+++ b/arch/arm/mm/cache-xsc3l2.c
@@ -18,7 +18,7 @@
18 */ 18 */
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/highmem.h> 20#include <linux/highmem.h>
21#include <asm/system.h> 21#include <asm/cp15.h>
22#include <asm/cputype.h> 22#include <asm/cputype.h>
23#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
24 24
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index bb7eac381a8..5bdff5c3e6c 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -21,8 +21,9 @@
21#include <linux/perf_event.h> 21#include <linux/perf_event.h>
22 22
23#include <asm/exception.h> 23#include <asm/exception.h>
24#include <asm/system.h>
25#include <asm/pgtable.h> 24#include <asm/pgtable.h>
25#include <asm/system_misc.h>
26#include <asm/system_info.h>
26#include <asm/tlbflush.h> 27#include <asm/tlbflush.h>
27 28
28#include "fault.h" 29#include "fault.h"
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 1a8d4aa821b..062d61a1f87 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -16,7 +16,6 @@
16#include <asm/cachetype.h> 16#include <asm/cachetype.h>
17#include <asm/highmem.h> 17#include <asm/highmem.h>
18#include <asm/smp_plat.h> 18#include <asm/smp_plat.h>
19#include <asm/system.h>
20#include <asm/tlbflush.h> 19#include <asm/tlbflush.h>
21 20
22#include "mm.h" 21#include "mm.h"
diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c
index feacf4c7671..ab88ed4f8e0 100644
--- a/arch/arm/mm/idmap.c
+++ b/arch/arm/mm/idmap.c
@@ -5,6 +5,7 @@
5#include <asm/pgalloc.h> 5#include <asm/pgalloc.h>
6#include <asm/pgtable.h> 6#include <asm/pgtable.h>
7#include <asm/sections.h> 7#include <asm/sections.h>
8#include <asm/system_info.h>
8 9
9pgd_t *idmap_pgd; 10pgd_t *idmap_pgd;
10 11
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 80632e8d753..6780b49f2c6 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -26,12 +26,14 @@
26#include <linux/vmalloc.h> 26#include <linux/vmalloc.h>
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <asm/cp15.h>
29#include <asm/cputype.h> 30#include <asm/cputype.h>
30#include <asm/cacheflush.h> 31#include <asm/cacheflush.h>
31#include <asm/mmu_context.h> 32#include <asm/mmu_context.h>
32#include <asm/pgalloc.h> 33#include <asm/pgalloc.h>
33#include <asm/tlbflush.h> 34#include <asm/tlbflush.h>
34#include <asm/sizes.h> 35#include <asm/sizes.h>
36#include <asm/system_info.h>
35 37
36#include <asm/mach/map.h> 38#include <asm/mach/map.h>
37#include "mm.h" 39#include "mm.h"
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 94c5a0c94f5..cd439c1dd50 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -17,6 +17,7 @@
17#include <linux/fs.h> 17#include <linux/fs.h>
18#include <linux/vmalloc.h> 18#include <linux/vmalloc.h>
19 19
20#include <asm/cp15.h>
20#include <asm/cputype.h> 21#include <asm/cputype.h>
21#include <asm/sections.h> 22#include <asm/sections.h>
22#include <asm/cachetype.h> 23#include <asm/cachetype.h>
@@ -25,6 +26,7 @@
25#include <asm/smp_plat.h> 26#include <asm/smp_plat.h>
26#include <asm/tlb.h> 27#include <asm/tlb.h>
27#include <asm/highmem.h> 28#include <asm/highmem.h>
29#include <asm/system_info.h>
28#include <asm/traps.h> 30#include <asm/traps.h>
29 31
30#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c
index a3e78ccabd6..0acb089d0f7 100644
--- a/arch/arm/mm/pgd.c
+++ b/arch/arm/mm/pgd.c
@@ -12,6 +12,7 @@
12#include <linux/highmem.h> 12#include <linux/highmem.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14 14
15#include <asm/cp15.h>
15#include <asm/pgalloc.h> 16#include <asm/pgalloc.h>
16#include <asm/page.h> 17#include <asm/page.h>
17#include <asm/tlbflush.h> 18#include <asm/tlbflush.h>
diff --git a/arch/arm/mm/proc-fa526.S b/arch/arm/mm/proc-fa526.S
index 272558a133a..d217e9795d7 100644
--- a/arch/arm/mm/proc-fa526.S
+++ b/arch/arm/mm/proc-fa526.S
@@ -22,7 +22,6 @@
22#include <asm/pgtable.h> 22#include <asm/pgtable.h>
23#include <asm/page.h> 23#include <asm/page.h>
24#include <asm/ptrace.h> 24#include <asm/ptrace.h>
25#include <asm/system.h>
26 25
27#include "proc-macros.S" 26#include "proc-macros.S"
28 27
diff --git a/arch/arm/nwfpe/fpa11.c b/arch/arm/nwfpe/fpa11.c
index cc60acde84d..2782ebcc2ed 100644
--- a/arch/arm/nwfpe/fpa11.c
+++ b/arch/arm/nwfpe/fpa11.c
@@ -28,7 +28,6 @@
28 28
29#include <linux/compiler.h> 29#include <linux/compiler.h>
30#include <linux/string.h> 30#include <linux/string.h>
31#include <asm/system.h>
32 31
33/* Reset the FPA11 chip. Called to initialize and reset the emulator. */ 32/* Reset the FPA11 chip. Called to initialize and reset the emulator. */
34static void resetFPA11(void) 33static void resetFPA11(void)
diff --git a/arch/arm/plat-iop/i2c.c b/arch/arm/plat-iop/i2c.c
index 4efe392859e..88215ad031a 100644
--- a/arch/arm/plat-iop/i2c.c
+++ b/arch/arm/plat-iop/i2c.c
@@ -23,7 +23,6 @@
23#include <asm/page.h> 23#include <asm/page.h>
24#include <asm/mach/map.h> 24#include <asm/mach/map.h>
25#include <asm/setup.h> 25#include <asm/setup.h>
26#include <asm/system.h>
27#include <asm/memory.h> 26#include <asm/memory.h>
28#include <mach/hardware.h> 27#include <mach/hardware.h>
29#include <asm/hardware/iop3xx.h> 28#include <asm/hardware/iop3xx.h>
diff --git a/arch/arm/plat-iop/pci.c b/arch/arm/plat-iop/pci.c
index 72768356447..0da42058a20 100644
--- a/arch/arm/plat-iop/pci.c
+++ b/arch/arm/plat-iop/pci.c
@@ -20,7 +20,6 @@
20#include <linux/io.h> 20#include <linux/io.h>
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/signal.h> 22#include <asm/signal.h>
23#include <asm/system.h>
24#include <mach/hardware.h> 23#include <mach/hardware.h>
25#include <asm/mach/pci.h> 24#include <asm/mach/pci.h>
26#include <asm/hardware/iop3xx.h> 25#include <asm/hardware/iop3xx.h>
diff --git a/arch/arm/plat-iop/restart.c b/arch/arm/plat-iop/restart.c
index 6a85a0c502e..33fa699a4d2 100644
--- a/arch/arm/plat-iop/restart.c
+++ b/arch/arm/plat-iop/restart.c
@@ -8,6 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <asm/hardware/iop3xx.h> 10#include <asm/hardware/iop3xx.h>
11#include <asm/system_misc.h>
11#include <mach/hardware.h> 12#include <mach/hardware.h>
12 13
13void iop3xx_restart(char mode, const char *cmd) 14void iop3xx_restart(char mode, const char *cmd)
diff --git a/arch/arm/plat-mxc/system.c b/arch/arm/plat-mxc/system.c
index f30dcacbbd0..1996c3e3b8f 100644
--- a/arch/arm/plat-mxc/system.c
+++ b/arch/arm/plat-mxc/system.c
@@ -25,8 +25,8 @@
25 25
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/common.h> 27#include <mach/common.h>
28#include <asm/system_misc.h>
28#include <asm/proc-fns.h> 29#include <asm/proc-fns.h>
29#include <asm/system.h>
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
31 31
32void __iomem *(*imx_ioremap)(unsigned long, size_t, unsigned int) = NULL; 32void __iomem *(*imx_ioremap)(unsigned long, size_t, unsigned int) = NULL;
diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c
index 61a1ec2a6af..39407cbe34c 100644
--- a/arch/arm/plat-omap/debug-leds.c
+++ b/arch/arm/plat-omap/debug-leds.c
@@ -15,7 +15,6 @@
15 15
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17#include <asm/leds.h> 17#include <asm/leds.h>
18#include <asm/system.h>
19#include <asm/mach-types.h> 18#include <asm/mach-types.h>
20 19
21#include <plat/fpga.h> 20#include <plat/fpga.h>
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 74300ae29b7..ecdb3da0dea 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -36,7 +36,6 @@
36#include <linux/slab.h> 36#include <linux/slab.h>
37#include <linux/delay.h> 37#include <linux/delay.h>
38 38
39#include <asm/system.h>
40#include <mach/hardware.h> 39#include <mach/hardware.h>
41#include <plat/dma.h> 40#include <plat/dma.h>
42 41
diff --git a/arch/arm/plat-pxa/dma.c b/arch/arm/plat-pxa/dma.c
index 2d3c19d7c7b..79ef102e3b2 100644
--- a/arch/arm/plat-pxa/dma.c
+++ b/arch/arm/plat-pxa/dma.c
@@ -20,7 +20,6 @@
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/dma-mapping.h> 21#include <linux/dma-mapping.h>
22 22
23#include <asm/system.h>
24#include <asm/irq.h> 23#include <asm/irq.h>
25#include <asm/memory.h> 24#include <asm/memory.h>
26#include <mach/hardware.h> 25#include <mach/hardware.h>
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index 32a09931350..0db73ae646b 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -35,6 +35,7 @@
35#include <mach/regs-clock.h> 35#include <mach/regs-clock.h>
36#include <asm/irq.h> 36#include <asm/irq.h>
37#include <asm/cacheflush.h> 37#include <asm/cacheflush.h>
38#include <asm/system_info.h>
38 39
39#include <asm/mach/arch.h> 40#include <asm/mach/arch.h>
40#include <asm/mach/map.h> 41#include <asm/mach/map.h>
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
index 2bab4c99a23..28f898f7538 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -27,7 +27,6 @@
27#include <linux/errno.h> 27#include <linux/errno.h>
28#include <linux/io.h> 28#include <linux/io.h>
29 29
30#include <asm/system.h>
31#include <asm/irq.h> 30#include <asm/irq.h>
32#include <mach/hardware.h> 31#include <mach/hardware.h>
33#include <mach/dma.h> 32#include <mach/dma.h>
diff --git a/arch/arm/plat-samsung/cpu.c b/arch/arm/plat-samsung/cpu.c
index 81c06d44c11..46b426e8aff 100644
--- a/arch/arm/plat-samsung/cpu.c
+++ b/arch/arm/plat-samsung/cpu.c
@@ -15,7 +15,6 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#include <asm/system.h>
19 18
20#include <mach/map.h> 19#include <mach/map.h>
21#include <plat/cpu.h> 20#include <plat/cpu.h>
diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c
index e3bb806bbaf..4dcb11c3d89 100644
--- a/arch/arm/plat-samsung/time.c
+++ b/arch/arm/plat-samsung/time.c
@@ -28,7 +28,6 @@
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30 30
31#include <asm/system.h>
32#include <asm/leds.h> 31#include <asm/leds.h>
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34 33
diff --git a/arch/arm/plat-spear/restart.c b/arch/arm/plat-spear/restart.c
index 2b4e3d82957..16f203e78d8 100644
--- a/arch/arm/plat-spear/restart.c
+++ b/arch/arm/plat-spear/restart.c
@@ -11,6 +11,7 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13#include <linux/io.h> 13#include <linux/io.h>
14#include <asm/system_misc.h>
14#include <asm/hardware/sp810.h> 15#include <asm/hardware/sp810.h>
15#include <mach/hardware.h> 16#include <mach/hardware.h>
16#include <mach/generic.h> 17#include <mach/generic.h>
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 8f3ccddbdaf..858748eaa14 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -18,7 +18,9 @@
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/init.h> 19#include <linux/init.h>
20 20
21#include <asm/cp15.h>
21#include <asm/cputype.h> 22#include <asm/cputype.h>
23#include <asm/system_info.h>
22#include <asm/thread_notify.h> 24#include <asm/thread_notify.h>
23#include <asm/vfp.h> 25#include <asm/vfp.h>
24 26
diff --git a/arch/avr32/include/asm/atomic.h b/arch/avr32/include/asm/atomic.h
index e0ac2631c87..61407279208 100644
--- a/arch/avr32/include/asm/atomic.h
+++ b/arch/avr32/include/asm/atomic.h
@@ -15,7 +15,7 @@
15#define __ASM_AVR32_ATOMIC_H 15#define __ASM_AVR32_ATOMIC_H
16 16
17#include <linux/types.h> 17#include <linux/types.h>
18#include <asm/system.h> 18#include <asm/cmpxchg.h>
19 19
20#define ATOMIC_INIT(i) { (i) } 20#define ATOMIC_INIT(i) { (i) }
21 21
diff --git a/arch/avr32/include/asm/barrier.h b/arch/avr32/include/asm/barrier.h
new file mode 100644
index 00000000000..808001c9cf8
--- /dev/null
+++ b/arch/avr32/include/asm/barrier.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2004-2006 Atmel Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#ifndef __ASM_AVR32_BARRIER_H
9#define __ASM_AVR32_BARRIER_H
10
11#define mb() asm volatile("" : : : "memory")
12#define rmb() mb()
13#define wmb() asm volatile("sync 0" : : : "memory")
14#define read_barrier_depends() do { } while(0)
15#define set_mb(var, value) do { var = value; mb(); } while(0)
16
17#ifdef CONFIG_SMP
18# error "The AVR32 port does not support SMP"
19#else
20# define smp_mb() barrier()
21# define smp_rmb() barrier()
22# define smp_wmb() barrier()
23# define smp_read_barrier_depends() do { } while(0)
24#endif
25
26
27#endif /* __ASM_AVR32_BARRIER_H */
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index b70c19bab63..ebe7ad3f490 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -13,7 +13,6 @@
13#endif 13#endif
14 14
15#include <asm/byteorder.h> 15#include <asm/byteorder.h>
16#include <asm/system.h>
17 16
18/* 17/*
19 * clear_bit() doesn't provide any barrier for the compiler 18 * clear_bit() doesn't provide any barrier for the compiler
diff --git a/arch/avr32/include/asm/bug.h b/arch/avr32/include/asm/bug.h
index 2aa373cc61b..85a92d099ad 100644
--- a/arch/avr32/include/asm/bug.h
+++ b/arch/avr32/include/asm/bug.h
@@ -70,4 +70,9 @@
70 70
71#include <asm-generic/bug.h> 71#include <asm-generic/bug.h>
72 72
73struct pt_regs;
74void die(const char *str, struct pt_regs *regs, long err);
75void _exception(long signr, struct pt_regs *regs, int code,
76 unsigned long addr);
77
73#endif /* __ASM_AVR32_BUG_H */ 78#endif /* __ASM_AVR32_BUG_H */
diff --git a/arch/avr32/include/asm/system.h b/arch/avr32/include/asm/cmpxchg.h
index 62d9ded0163..962a6aeab78 100644
--- a/arch/avr32/include/asm/system.h
+++ b/arch/avr32/include/asm/cmpxchg.h
@@ -1,76 +1,22 @@
1/* 1/*
2 * Atomic operations that C can't guarantee us. Useful for
3 * resource counting etc.
4 *
5 * But use these as seldom as possible since they are slower than
6 * regular operations.
7 *
2 * Copyright (C) 2004-2006 Atmel Corporation 8 * Copyright (C) 2004-2006 Atmel Corporation
3 * 9 *
4 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
7 */ 13 */
8#ifndef __ASM_AVR32_SYSTEM_H 14#ifndef __ASM_AVR32_CMPXCHG_H
9#define __ASM_AVR32_SYSTEM_H 15#define __ASM_AVR32_CMPXCHG_H
10
11#include <linux/compiler.h>
12#include <linux/linkage.h>
13#include <linux/types.h>
14
15#include <asm/ptrace.h>
16#include <asm/sysreg.h>
17 16
18#define xchg(ptr,x) \ 17#define xchg(ptr,x) \
19 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 18 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
20 19
21#define nop() asm volatile("nop")
22
23#define mb() asm volatile("" : : : "memory")
24#define rmb() mb()
25#define wmb() asm volatile("sync 0" : : : "memory")
26#define read_barrier_depends() do { } while(0)
27#define set_mb(var, value) do { var = value; mb(); } while(0)
28
29/*
30 * Help PathFinder and other Nexus-compliant debuggers keep track of
31 * the current PID by emitting an Ownership Trace Message each time we
32 * switch task.
33 */
34#ifdef CONFIG_OWNERSHIP_TRACE
35#include <asm/ocd.h>
36#define finish_arch_switch(prev) \
37 do { \
38 ocd_write(PID, prev->pid); \
39 ocd_write(PID, current->pid); \
40 } while(0)
41#endif
42
43/*
44 * switch_to(prev, next, last) should switch from task `prev' to task
45 * `next'. `prev' will never be the same as `next'.
46 *
47 * We just delegate everything to the __switch_to assembly function,
48 * which is implemented in arch/avr32/kernel/switch_to.S
49 *
50 * mb() tells GCC not to cache `current' across this call.
51 */
52struct cpu_context;
53struct task_struct;
54extern struct task_struct *__switch_to(struct task_struct *,
55 struct cpu_context *,
56 struct cpu_context *);
57#define switch_to(prev, next, last) \
58 do { \
59 last = __switch_to(prev, &prev->thread.cpu_context + 1, \
60 &next->thread.cpu_context); \
61 } while (0)
62
63#ifdef CONFIG_SMP
64# error "The AVR32 port does not support SMP"
65#else
66# define smp_mb() barrier()
67# define smp_rmb() barrier()
68# define smp_wmb() barrier()
69# define smp_read_barrier_depends() do { } while(0)
70#endif
71
72#include <linux/irqflags.h>
73
74extern void __xchg_called_with_bad_pointer(void); 20extern void __xchg_called_with_bad_pointer(void);
75 21
76static inline unsigned long xchg_u32(u32 val, volatile u32 *m) 22static inline unsigned long xchg_u32(u32 val, volatile u32 *m)
@@ -168,11 +114,4 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
168 114
169#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 115#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
170 116
171struct pt_regs; 117#endif /* __ASM_AVR32_CMPXCHG_H */
172void die(const char *str, struct pt_regs *regs, long err);
173void _exception(long signr, struct pt_regs *regs, int code,
174 unsigned long addr);
175
176#define arch_align_stack(x) (x)
177
178#endif /* __ASM_AVR32_SYSTEM_H */
diff --git a/arch/avr32/include/asm/exec.h b/arch/avr32/include/asm/exec.h
new file mode 100644
index 00000000000..f467be8bf82
--- /dev/null
+++ b/arch/avr32/include/asm/exec.h
@@ -0,0 +1,13 @@
1/*
2 * Copyright (C) 2004-2006 Atmel Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#ifndef __ASM_AVR32_EXEC_H
9#define __ASM_AVR32_EXEC_H
10
11#define arch_align_stack(x) (x)
12
13#endif /* __ASM_AVR32_EXEC_H */
diff --git a/arch/avr32/include/asm/special_insns.h b/arch/avr32/include/asm/special_insns.h
new file mode 100644
index 00000000000..f922218dfaa
--- /dev/null
+++ b/arch/avr32/include/asm/special_insns.h
@@ -0,0 +1,13 @@
1/*
2 * Copyright (C) 2004-2006 Atmel Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#ifndef __ASM_AVR32_SPECIAL_INSNS_H
9#define __ASM_AVR32_SPECIAL_INSNS_H
10
11#define nop() asm volatile("nop")
12
13#endif /* __ASM_AVR32_SPECIAL_INSNS_H */
diff --git a/arch/avr32/include/asm/switch_to.h b/arch/avr32/include/asm/switch_to.h
new file mode 100644
index 00000000000..9a8e9d5208d
--- /dev/null
+++ b/arch/avr32/include/asm/switch_to.h
@@ -0,0 +1,46 @@
1/*
2 * Copyright (C) 2004-2006 Atmel Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#ifndef __ASM_AVR32_SWITCH_TO_H
9#define __ASM_AVR32_SWITCH_TO_H
10
11/*
12 * Help PathFinder and other Nexus-compliant debuggers keep track of
13 * the current PID by emitting an Ownership Trace Message each time we
14 * switch task.
15 */
16#ifdef CONFIG_OWNERSHIP_TRACE
17#include <asm/ocd.h>
18#define finish_arch_switch(prev) \
19 do { \
20 ocd_write(PID, prev->pid); \
21 ocd_write(PID, current->pid); \
22 } while(0)
23#endif
24
25/*
26 * switch_to(prev, next, last) should switch from task `prev' to task
27 * `next'. `prev' will never be the same as `next'.
28 *
29 * We just delegate everything to the __switch_to assembly function,
30 * which is implemented in arch/avr32/kernel/switch_to.S
31 *
32 * mb() tells GCC not to cache `current' across this call.
33 */
34struct cpu_context;
35struct task_struct;
36extern struct task_struct *__switch_to(struct task_struct *,
37 struct cpu_context *,
38 struct cpu_context *);
39#define switch_to(prev, next, last) \
40 do { \
41 last = __switch_to(prev, &prev->thread.cpu_context + 1, \
42 &next->thread.cpu_context); \
43 } while (0)
44
45
46#endif /* __ASM_AVR32_SWITCH_TO_H */
diff --git a/arch/avr32/mach-at32ap/cpufreq.c b/arch/avr32/mach-at32ap/cpufreq.c
index 62774332625..18b765629a0 100644
--- a/arch/avr32/mach-at32ap/cpufreq.c
+++ b/arch/avr32/mach-at32ap/cpufreq.c
@@ -19,7 +19,6 @@
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/err.h> 20#include <linux/err.h>
21#include <linux/export.h> 21#include <linux/export.h>
22#include <asm/system.h>
23 22
24static struct clk *cpuclk; 23static struct clk *cpuclk;
25 24
diff --git a/arch/avr32/oprofile/op_model_avr32.c b/arch/avr32/oprofile/op_model_avr32.c
index a3e9b3c4845..f74b7809e08 100644
--- a/arch/avr32/oprofile/op_model_avr32.c
+++ b/arch/avr32/oprofile/op_model_avr32.c
@@ -17,7 +17,6 @@
17#include <linux/types.h> 17#include <linux/types.h>
18 18
19#include <asm/sysreg.h> 19#include <asm/sysreg.h>
20#include <asm/system.h>
21 20
22#define AVR32_PERFCTR_IRQ_GROUP 0 21#define AVR32_PERFCTR_IRQ_GROUP 0
23#define AVR32_PERFCTR_IRQ_LINE 1 22#define AVR32_PERFCTR_IRQ_LINE 1
diff --git a/arch/blackfin/include/asm/system.h b/arch/blackfin/include/asm/system.h
deleted file mode 100644
index a7f40578587..00000000000
--- a/arch/blackfin/include/asm/system.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/* FILE TO BE DELETED. DO NOT ADD STUFF HERE! */
2#include <asm/barrier.h>
3#include <asm/cmpxchg.h>
4#include <asm/exec.h>
5#include <asm/switch_to.h>
diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild
index 13dcf78adf9..3af601e31e6 100644
--- a/arch/c6x/include/asm/Kbuild
+++ b/arch/c6x/include/asm/Kbuild
@@ -3,7 +3,6 @@ include include/asm-generic/Kbuild.asm
3generic-y += atomic.h 3generic-y += atomic.h
4generic-y += auxvec.h 4generic-y += auxvec.h
5generic-y += bitsperlong.h 5generic-y += bitsperlong.h
6generic-y += bug.h
7generic-y += bugs.h 6generic-y += bugs.h
8generic-y += cputime.h 7generic-y += cputime.h
9generic-y += current.h 8generic-y += current.h
diff --git a/arch/c6x/include/asm/barrier.h b/arch/c6x/include/asm/barrier.h
new file mode 100644
index 00000000000..538240e8590
--- /dev/null
+++ b/arch/c6x/include/asm/barrier.h
@@ -0,0 +1,27 @@
1/*
2 * Port on Texas Instruments TMS320C6x architecture
3 *
4 * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
5 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
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_C6X_BARRIER_H
12#define _ASM_C6X_BARRIER_H
13
14#define nop() asm("NOP\n");
15
16#define mb() barrier()
17#define rmb() barrier()
18#define wmb() barrier()
19#define set_mb(var, value) do { var = value; mb(); } while (0)
20#define set_wmb(var, value) do { var = value; wmb(); } while (0)
21
22#define smp_mb() barrier()
23#define smp_rmb() barrier()
24#define smp_wmb() barrier()
25#define smp_read_barrier_depends() do { } while (0)
26
27#endif /* _ASM_C6X_BARRIER_H */
diff --git a/arch/c6x/include/asm/bitops.h b/arch/c6x/include/asm/bitops.h
index 39ab7e874d9..0bec7e5036a 100644
--- a/arch/c6x/include/asm/bitops.h
+++ b/arch/c6x/include/asm/bitops.h
@@ -15,7 +15,6 @@
15 15
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17 17
18#include <asm/system.h>
19#include <asm/byteorder.h> 18#include <asm/byteorder.h>
20 19
21/* 20/*
diff --git a/arch/c6x/include/asm/bug.h b/arch/c6x/include/asm/bug.h
new file mode 100644
index 00000000000..8d59933dd6f
--- /dev/null
+++ b/arch/c6x/include/asm/bug.h
@@ -0,0 +1,23 @@
1/*
2 * Port on Texas Instruments TMS320C6x architecture
3 *
4 * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
5 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
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_C6X_BUG_H
12#define _ASM_C6X_BUG_H
13
14#include <linux/linkage.h>
15#include <asm-generic/bug.h>
16
17struct pt_regs;
18
19extern void die(char *str, struct pt_regs *fp, int nr);
20extern asmlinkage int process_exception(struct pt_regs *regs);
21extern asmlinkage void enable_exception(void);
22
23#endif /* _ASM_C6X_BUG_H */
diff --git a/arch/c6x/include/asm/cmpxchg.h b/arch/c6x/include/asm/cmpxchg.h
new file mode 100644
index 00000000000..b27c8cefb8c
--- /dev/null
+++ b/arch/c6x/include/asm/cmpxchg.h
@@ -0,0 +1,68 @@
1/*
2 * Port on Texas Instruments TMS320C6x architecture
3 *
4 * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
5 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
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_C6X_CMPXCHG_H
12#define _ASM_C6X_CMPXCHG_H
13
14#include <linux/irqflags.h>
15
16/*
17 * Misc. functions
18 */
19static inline unsigned int __xchg(unsigned int x, volatile void *ptr, int size)
20{
21 unsigned int tmp;
22 unsigned long flags;
23
24 local_irq_save(flags);
25
26 switch (size) {
27 case 1:
28 tmp = 0;
29 tmp = *((unsigned char *) ptr);
30 *((unsigned char *) ptr) = (unsigned char) x;
31 break;
32 case 2:
33 tmp = 0;
34 tmp = *((unsigned short *) ptr);
35 *((unsigned short *) ptr) = x;
36 break;
37 case 4:
38 tmp = 0;
39 tmp = *((unsigned int *) ptr);
40 *((unsigned int *) ptr) = x;
41 break;
42 }
43 local_irq_restore(flags);
44 return tmp;
45}
46
47#define xchg(ptr, x) \
48 ((__typeof__(*(ptr)))__xchg((unsigned int)(x), (void *) (ptr), \
49 sizeof(*(ptr))))
50#define tas(ptr) xchg((ptr), 1)
51
52
53#include <asm-generic/cmpxchg-local.h>
54
55/*
56 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
57 * them available.
58 */
59#define cmpxchg_local(ptr, o, n) \
60 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), \
61 (unsigned long)(o), \
62 (unsigned long)(n), \
63 sizeof(*(ptr))))
64#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
65
66#include <asm-generic/cmpxchg.h>
67
68#endif /* _ASM_C6X_CMPXCHG_H */
diff --git a/arch/c6x/include/asm/exec.h b/arch/c6x/include/asm/exec.h
new file mode 100644
index 00000000000..0fea482cdc8
--- /dev/null
+++ b/arch/c6x/include/asm/exec.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_C6X_EXEC_H
2#define _ASM_C6X_EXEC_H
3
4#define arch_align_stack(x) (x)
5
6#endif /* _ASM_C6X_EXEC_H */
diff --git a/arch/c6x/include/asm/processor.h b/arch/c6x/include/asm/processor.h
index 77ecbded1f3..3ff7fab956b 100644
--- a/arch/c6x/include/asm/processor.h
+++ b/arch/c6x/include/asm/processor.h
@@ -129,4 +129,13 @@ extern unsigned long get_wchan(struct task_struct *p);
129 129
130extern const struct seq_operations cpuinfo_op; 130extern const struct seq_operations cpuinfo_op;
131 131
132/* Reset the board */
133#define HARD_RESET_NOW()
134
135extern unsigned int c6x_core_freq;
136
137
138extern void (*c6x_restart)(void);
139extern void (*c6x_halt)(void);
140
132#endif /* ASM_C6X_PROCESSOR_H */ 141#endif /* ASM_C6X_PROCESSOR_H */
diff --git a/arch/c6x/include/asm/setup.h b/arch/c6x/include/asm/setup.h
index 1808f279f82..a01e31896fa 100644
--- a/arch/c6x/include/asm/setup.h
+++ b/arch/c6x/include/asm/setup.h
@@ -27,6 +27,7 @@ extern unsigned int c6x_devstat;
27extern unsigned char c6x_fuse_mac[6]; 27extern unsigned char c6x_fuse_mac[6];
28 28
29extern void machine_init(unsigned long dt_ptr); 29extern void machine_init(unsigned long dt_ptr);
30extern void time_init(void);
30 31
31#endif /* !__ASSEMBLY__ */ 32#endif /* !__ASSEMBLY__ */
32#endif /* _ASM_C6X_SETUP_H */ 33#endif /* _ASM_C6X_SETUP_H */
diff --git a/arch/c6x/include/asm/special_insns.h b/arch/c6x/include/asm/special_insns.h
new file mode 100644
index 00000000000..59672bca841
--- /dev/null
+++ b/arch/c6x/include/asm/special_insns.h
@@ -0,0 +1,63 @@
1/*
2 * Port on Texas Instruments TMS320C6x architecture
3 *
4 * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
5 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
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_C6X_SPECIAL_INSNS_H
12#define _ASM_C6X_SPECIAL_INSNS_H
13
14
15#define get_creg(reg) \
16 ({ unsigned int __x; \
17 asm volatile ("mvc .s2 " #reg ",%0\n" : "=b"(__x)); __x; })
18
19#define set_creg(reg, v) \
20 do { unsigned int __x = (unsigned int)(v); \
21 asm volatile ("mvc .s2 %0," #reg "\n" : : "b"(__x)); \
22 } while (0)
23
24#define or_creg(reg, n) \
25 do { unsigned __x, __n = (unsigned)(n); \
26 asm volatile ("mvc .s2 " #reg ",%0\n" \
27 "or .l2 %1,%0,%0\n" \
28 "mvc .s2 %0," #reg "\n" \
29 "nop\n" \
30 : "=&b"(__x) : "b"(__n)); \
31 } while (0)
32
33#define and_creg(reg, n) \
34 do { unsigned __x, __n = (unsigned)(n); \
35 asm volatile ("mvc .s2 " #reg ",%0\n" \
36 "and .l2 %1,%0,%0\n" \
37 "mvc .s2 %0," #reg "\n" \
38 "nop\n" \
39 : "=&b"(__x) : "b"(__n)); \
40 } while (0)
41
42#define get_coreid() (get_creg(DNUM) & 0xff)
43
44/* Set/get IST */
45#define set_ist(x) set_creg(ISTP, x)
46#define get_ist() get_creg(ISTP)
47
48/*
49 * Exception management
50 */
51#define disable_exception()
52#define get_except_type() get_creg(EFR)
53#define ack_exception(type) set_creg(ECR, 1 << (type))
54#define get_iexcept() get_creg(IERR)
55#define set_iexcept(mask) set_creg(IERR, (mask))
56
57#define _extu(x, s, e) \
58 ({ unsigned int __x; \
59 asm volatile ("extu .S2 %3,%1,%2,%0\n" : \
60 "=b"(__x) : "n"(s), "n"(e), "b"(x)); \
61 __x; })
62
63#endif /* _ASM_C6X_SPECIAL_INSNS_H */
diff --git a/arch/c6x/include/asm/switch_to.h b/arch/c6x/include/asm/switch_to.h
new file mode 100644
index 00000000000..af6c71fe75e
--- /dev/null
+++ b/arch/c6x/include/asm/switch_to.h
@@ -0,0 +1,33 @@
1/*
2 * Port on Texas Instruments TMS320C6x architecture
3 *
4 * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
5 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
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_C6X_SWITCH_TO_H
12#define _ASM_C6X_SWITCH_TO_H
13
14#include <linux/linkage.h>
15
16#define prepare_to_switch() do { } while (0)
17
18struct task_struct;
19struct thread_struct;
20asmlinkage void *__switch_to(struct thread_struct *prev,
21 struct thread_struct *next,
22 struct task_struct *tsk);
23
24#define switch_to(prev, next, last) \
25 do { \
26 current->thread.wchan = (u_long) __builtin_return_address(0); \
27 (last) = __switch_to(&(prev)->thread, \
28 &(next)->thread, (prev)); \
29 mb(); \
30 current->thread.wchan = 0; \
31 } while (0)
32
33#endif /* _ASM_C6X_SWITCH_TO_H */
diff --git a/arch/c6x/include/asm/system.h b/arch/c6x/include/asm/system.h
deleted file mode 100644
index e076dc0eacc..00000000000
--- a/arch/c6x/include/asm/system.h
+++ /dev/null
@@ -1,168 +0,0 @@
1/*
2 * Port on Texas Instruments TMS320C6x architecture
3 *
4 * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
5 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
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_C6X_SYSTEM_H
12#define _ASM_C6X_SYSTEM_H
13
14#include <linux/linkage.h>
15#include <linux/irqflags.h>
16
17#define prepare_to_switch() do { } while (0)
18
19struct task_struct;
20struct thread_struct;
21asmlinkage void *__switch_to(struct thread_struct *prev,
22 struct thread_struct *next,
23 struct task_struct *tsk);
24
25#define switch_to(prev, next, last) \
26 do { \
27 current->thread.wchan = (u_long) __builtin_return_address(0); \
28 (last) = __switch_to(&(prev)->thread, \
29 &(next)->thread, (prev)); \
30 mb(); \
31 current->thread.wchan = 0; \
32 } while (0)
33
34/* Reset the board */
35#define HARD_RESET_NOW()
36
37#define get_creg(reg) \
38 ({ unsigned int __x; \
39 asm volatile ("mvc .s2 " #reg ",%0\n" : "=b"(__x)); __x; })
40
41#define set_creg(reg, v) \
42 do { unsigned int __x = (unsigned int)(v); \
43 asm volatile ("mvc .s2 %0," #reg "\n" : : "b"(__x)); \
44 } while (0)
45
46#define or_creg(reg, n) \
47 do { unsigned __x, __n = (unsigned)(n); \
48 asm volatile ("mvc .s2 " #reg ",%0\n" \
49 "or .l2 %1,%0,%0\n" \
50 "mvc .s2 %0," #reg "\n" \
51 "nop\n" \
52 : "=&b"(__x) : "b"(__n)); \
53 } while (0)
54
55#define and_creg(reg, n) \
56 do { unsigned __x, __n = (unsigned)(n); \
57 asm volatile ("mvc .s2 " #reg ",%0\n" \
58 "and .l2 %1,%0,%0\n" \
59 "mvc .s2 %0," #reg "\n" \
60 "nop\n" \
61 : "=&b"(__x) : "b"(__n)); \
62 } while (0)
63
64#define get_coreid() (get_creg(DNUM) & 0xff)
65
66/* Set/get IST */
67#define set_ist(x) set_creg(ISTP, x)
68#define get_ist() get_creg(ISTP)
69
70/*
71 * Exception management
72 */
73asmlinkage void enable_exception(void);
74#define disable_exception()
75#define get_except_type() get_creg(EFR)
76#define ack_exception(type) set_creg(ECR, 1 << (type))
77#define get_iexcept() get_creg(IERR)
78#define set_iexcept(mask) set_creg(IERR, (mask))
79
80/*
81 * Misc. functions
82 */
83#define nop() asm("NOP\n");
84#define mb() barrier()
85#define rmb() barrier()
86#define wmb() barrier()
87#define set_mb(var, value) do { var = value; mb(); } while (0)
88#define set_wmb(var, value) do { var = value; wmb(); } while (0)
89
90#define smp_mb() barrier()
91#define smp_rmb() barrier()
92#define smp_wmb() barrier()
93#define smp_read_barrier_depends() do { } while (0)
94
95#define xchg(ptr, x) \
96 ((__typeof__(*(ptr)))__xchg((unsigned int)(x), (void *) (ptr), \
97 sizeof(*(ptr))))
98#define tas(ptr) xchg((ptr), 1)
99
100unsigned int _lmbd(unsigned int, unsigned int);
101unsigned int _bitr(unsigned int);
102
103struct __xchg_dummy { unsigned int a[100]; };
104#define __xg(x) ((volatile struct __xchg_dummy *)(x))
105
106static inline unsigned int __xchg(unsigned int x, volatile void *ptr, int size)
107{
108 unsigned int tmp;
109 unsigned long flags;
110
111 local_irq_save(flags);
112
113 switch (size) {
114 case 1:
115 tmp = 0;
116 tmp = *((unsigned char *) ptr);
117 *((unsigned char *) ptr) = (unsigned char) x;
118 break;
119 case 2:
120 tmp = 0;
121 tmp = *((unsigned short *) ptr);
122 *((unsigned short *) ptr) = x;
123 break;
124 case 4:
125 tmp = 0;
126 tmp = *((unsigned int *) ptr);
127 *((unsigned int *) ptr) = x;
128 break;
129 }
130 local_irq_restore(flags);
131 return tmp;
132}
133
134#include <asm-generic/cmpxchg-local.h>
135
136/*
137 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
138 * them available.
139 */
140#define cmpxchg_local(ptr, o, n) \
141 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), \
142 (unsigned long)(o), \
143 (unsigned long)(n), \
144 sizeof(*(ptr))))
145#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
146
147#include <asm-generic/cmpxchg.h>
148
149#define _extu(x, s, e) \
150 ({ unsigned int __x; \
151 asm volatile ("extu .S2 %3,%1,%2,%0\n" : \
152 "=b"(__x) : "n"(s), "n"(e), "b"(x)); \
153 __x; })
154
155
156extern unsigned int c6x_core_freq;
157
158struct pt_regs;
159
160extern void die(char *str, struct pt_regs *fp, int nr);
161extern asmlinkage int process_exception(struct pt_regs *regs);
162extern void time_init(void);
163extern void free_initmem(void);
164
165extern void (*c6x_restart)(void);
166extern void (*c6x_halt)(void);
167
168#endif /* _ASM_C6X_SYSTEM_H */
diff --git a/arch/c6x/kernel/irq.c b/arch/c6x/kernel/irq.c
index d77bcfdf0d8..65b8ddf54b4 100644
--- a/arch/c6x/kernel/irq.c
+++ b/arch/c6x/kernel/irq.c
@@ -27,6 +27,7 @@
27#include <linux/kernel_stat.h> 27#include <linux/kernel_stat.h>
28 28
29#include <asm/megamod-pic.h> 29#include <asm/megamod-pic.h>
30#include <asm/special_insns.h>
30 31
31unsigned long irq_err_count; 32unsigned long irq_err_count;
32 33
diff --git a/arch/c6x/kernel/setup.c b/arch/c6x/kernel/setup.c
index 0c07921747f..ce46186600c 100644
--- a/arch/c6x/kernel/setup.c
+++ b/arch/c6x/kernel/setup.c
@@ -34,6 +34,7 @@
34#include <asm/dscr.h> 34#include <asm/dscr.h>
35#include <asm/clock.h> 35#include <asm/clock.h>
36#include <asm/soc.h> 36#include <asm/soc.h>
37#include <asm/special_insns.h>
37 38
38static const char *c6x_soc_name; 39static const char *c6x_soc_name;
39 40
diff --git a/arch/c6x/kernel/soc.c b/arch/c6x/kernel/soc.c
index dd45bc39af0..0748c94ebef 100644
--- a/arch/c6x/kernel/soc.c
+++ b/arch/c6x/kernel/soc.c
@@ -11,7 +11,6 @@
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/ctype.h> 12#include <linux/ctype.h>
13#include <linux/etherdevice.h> 13#include <linux/etherdevice.h>
14#include <asm/system.h>
15#include <asm/setup.h> 14#include <asm/setup.h>
16#include <asm/soc.h> 15#include <asm/soc.h>
17 16
diff --git a/arch/c6x/kernel/time.c b/arch/c6x/kernel/time.c
index 4c9f136165f..356ee84cad9 100644
--- a/arch/c6x/kernel/time.c
+++ b/arch/c6x/kernel/time.c
@@ -20,6 +20,7 @@
20#include <linux/timex.h> 20#include <linux/timex.h>
21#include <linux/profile.h> 21#include <linux/profile.h>
22 22
23#include <asm/special_insns.h>
23#include <asm/timer64.h> 24#include <asm/timer64.h>
24 25
25static u32 sched_clock_multiplier; 26static u32 sched_clock_multiplier;
diff --git a/arch/c6x/kernel/traps.c b/arch/c6x/kernel/traps.c
index f50e3edd6da..1be74e5b478 100644
--- a/arch/c6x/kernel/traps.c
+++ b/arch/c6x/kernel/traps.c
@@ -14,6 +14,7 @@
14#include <linux/bug.h> 14#include <linux/bug.h>
15 15
16#include <asm/soc.h> 16#include <asm/soc.h>
17#include <asm/special_insns.h>
17#include <asm/traps.h> 18#include <asm/traps.h>
18 19
19int (*c6x_nmi_handler)(struct pt_regs *regs); 20int (*c6x_nmi_handler)(struct pt_regs *regs);
diff --git a/arch/c6x/platforms/timer64.c b/arch/c6x/platforms/timer64.c
index 03c03c24919..3c73d74a467 100644
--- a/arch/c6x/platforms/timer64.c
+++ b/arch/c6x/platforms/timer64.c
@@ -15,6 +15,7 @@
15#include <linux/of_address.h> 15#include <linux/of_address.h>
16#include <asm/soc.h> 16#include <asm/soc.h>
17#include <asm/dscr.h> 17#include <asm/dscr.h>
18#include <asm/special_insns.h>
18#include <asm/timer64.h> 19#include <asm/timer64.h>
19 20
20struct timer_regs { 21struct timer_regs {
diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c
index 3d655dcc65d..74f99c688c8 100644
--- a/arch/cris/arch-v10/drivers/ds1302.c
+++ b/arch/cris/arch-v10/drivers/ds1302.c
@@ -24,7 +24,6 @@
24#include <linux/capability.h> 24#include <linux/capability.h>
25 25
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/system.h>
28#include <arch/svinto.h> 27#include <arch/svinto.h>
29#include <asm/io.h> 28#include <asm/io.h>
30#include <asm/rtc.h> 29#include <asm/rtc.h>
diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c
index a276f081173..609d5510410 100644
--- a/arch/cris/arch-v10/drivers/gpio.c
+++ b/arch/cris/arch-v10/drivers/gpio.c
@@ -24,7 +24,6 @@
24#include <asm/etraxgpio.h> 24#include <asm/etraxgpio.h>
25#include <arch/svinto.h> 25#include <arch/svinto.h>
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/system.h>
28#include <asm/irq.h> 27#include <asm/irq.h>
29#include <arch/io_interface_mux.h> 28#include <arch/io_interface_mux.h>
30 29
diff --git a/arch/cris/arch-v10/drivers/i2c.c b/arch/cris/arch-v10/drivers/i2c.c
index c413539d420..b3d1f9ed1b9 100644
--- a/arch/cris/arch-v10/drivers/i2c.c
+++ b/arch/cris/arch-v10/drivers/i2c.c
@@ -22,7 +22,6 @@
22 22
23#include <asm/etraxi2c.h> 23#include <asm/etraxi2c.h>
24 24
25#include <asm/system.h>
26#include <arch/svinto.h> 25#include <arch/svinto.h>
27#include <asm/io.h> 26#include <asm/io.h>
28#include <asm/delay.h> 27#include <asm/delay.h>
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c
index 1391b731ad1..9da056860c9 100644
--- a/arch/cris/arch-v10/drivers/pcf8563.c
+++ b/arch/cris/arch-v10/drivers/pcf8563.c
@@ -29,7 +29,6 @@
29#include <linux/mutex.h> 29#include <linux/mutex.h>
30 30
31#include <asm/uaccess.h> 31#include <asm/uaccess.h>
32#include <asm/system.h>
33#include <asm/io.h> 32#include <asm/io.h>
34#include <asm/rtc.h> 33#include <asm/rtc.h>
35 34
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c
index 466af40c582..c4b71710fb0 100644
--- a/arch/cris/arch-v10/drivers/sync_serial.c
+++ b/arch/cris/arch-v10/drivers/sync_serial.c
@@ -27,7 +27,6 @@
27#include <asm/io.h> 27#include <asm/io.h>
28#include <arch/svinto.h> 28#include <arch/svinto.h>
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <asm/system.h>
31#include <asm/sync_serial.h> 30#include <asm/sync_serial.h>
32#include <arch/io_interface_mux.h> 31#include <arch/io_interface_mux.h>
33 32
diff --git a/arch/cris/arch-v10/kernel/debugport.c b/arch/cris/arch-v10/kernel/debugport.c
index 99851ba8e5f..f932c85fbde 100644
--- a/arch/cris/arch-v10/kernel/debugport.c
+++ b/arch/cris/arch-v10/kernel/debugport.c
@@ -18,7 +18,6 @@
18#include <linux/major.h> 18#include <linux/major.h>
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/tty.h> 20#include <linux/tty.h>
21#include <asm/system.h>
22#include <arch/svinto.h> 21#include <arch/svinto.h>
23#include <asm/io.h> /* Get SIMCOUT. */ 22#include <asm/io.h> /* Get SIMCOUT. */
24 23
diff --git a/arch/cris/arch-v10/kernel/dma.c b/arch/cris/arch-v10/kernel/dma.c
index d31504b4a19..5795047359b 100644
--- a/arch/cris/arch-v10/kernel/dma.c
+++ b/arch/cris/arch-v10/kernel/dma.c
@@ -8,6 +8,7 @@
8 8
9#include <asm/dma.h> 9#include <asm/dma.h>
10#include <arch/svinto.h> 10#include <arch/svinto.h>
11#include <arch/system.h>
11 12
12/* Macro to access ETRAX 100 registers */ 13/* Macro to access ETRAX 100 registers */
13#define SETS(var, reg, field, val) var = (var & ~IO_MASK_(reg##_, field##_)) | \ 14#define SETS(var, reg, field, val) var = (var & ~IO_MASK_(reg##_, field##_)) | \
diff --git a/arch/cris/arch-v10/kernel/io_interface_mux.c b/arch/cris/arch-v10/kernel/io_interface_mux.c
index 29f97e96279..ad64cd1c861 100644
--- a/arch/cris/arch-v10/kernel/io_interface_mux.c
+++ b/arch/cris/arch-v10/kernel/io_interface_mux.c
@@ -14,6 +14,7 @@
14#include <arch/svinto.h> 14#include <arch/svinto.h>
15#include <asm/io.h> 15#include <asm/io.h>
16#include <arch/io_interface_mux.h> 16#include <arch/io_interface_mux.h>
17#include <arch/system.h>
17 18
18 19
19#define DBG(s) 20#define DBG(s)
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c
index 9a57db6907f..bee8df43c20 100644
--- a/arch/cris/arch-v10/kernel/process.c
+++ b/arch/cris/arch-v10/kernel/process.c
@@ -16,6 +16,7 @@
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <arch/svinto.h> 17#include <arch/svinto.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <arch/system.h>
19 20
20#ifdef CONFIG_ETRAX_GPIO 21#ifdef CONFIG_ETRAX_GPIO
21void etrax_gpio_wake_up_check(void); /* drivers/gpio.c */ 22void etrax_gpio_wake_up_check(void); /* drivers/gpio.c */
diff --git a/arch/cris/arch-v10/kernel/ptrace.c b/arch/cris/arch-v10/kernel/ptrace.c
index 320065f3cbe..bfddfb99401 100644
--- a/arch/cris/arch-v10/kernel/ptrace.c
+++ b/arch/cris/arch-v10/kernel/ptrace.c
@@ -15,7 +15,6 @@
15#include <asm/uaccess.h> 15#include <asm/uaccess.h>
16#include <asm/page.h> 16#include <asm/page.h>
17#include <asm/pgtable.h> 17#include <asm/pgtable.h>
18#include <asm/system.h>
19#include <asm/processor.h> 18#include <asm/processor.h>
20 19
21/* 20/*
diff --git a/arch/cris/arch-v10/kernel/setup.c b/arch/cris/arch-v10/kernel/setup.c
index de27b50b72a..4f96d71b515 100644
--- a/arch/cris/arch-v10/kernel/setup.c
+++ b/arch/cris/arch-v10/kernel/setup.c
@@ -14,6 +14,7 @@
14#include <linux/proc_fs.h> 14#include <linux/proc_fs.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/param.h> 16#include <linux/param.h>
17#include <arch/system.h>
17 18
18#ifdef CONFIG_PROC_FS 19#ifdef CONFIG_PROC_FS
19#define HAS_FPU 0x0001 20#define HAS_FPU 0x0001
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index e78fe49a984..289c584ba49 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -27,6 +27,7 @@
27#include <asm/processor.h> 27#include <asm/processor.h>
28#include <asm/ucontext.h> 28#include <asm/ucontext.h>
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <arch/system.h>
30 31
31#define DEBUG_SIG 0 32#define DEBUG_SIG 0
32 33
diff --git a/arch/cris/arch-v10/kernel/traps.c b/arch/cris/arch-v10/kernel/traps.c
index 8bebb96bbca..7001beda716 100644
--- a/arch/cris/arch-v10/kernel/traps.c
+++ b/arch/cris/arch-v10/kernel/traps.c
@@ -11,6 +11,7 @@
11#include <linux/ptrace.h> 11#include <linux/ptrace.h>
12#include <asm/uaccess.h> 12#include <asm/uaccess.h>
13#include <arch/sv_addr_ag.h> 13#include <arch/sv_addr_ag.h>
14#include <arch/system.h>
14 15
15void 16void
16show_registers(struct pt_regs *regs) 17show_registers(struct pt_regs *regs)
diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c
index ddb23996f11..3b2c82ce814 100644
--- a/arch/cris/arch-v32/drivers/i2c.c
+++ b/arch/cris/arch-v32/drivers/i2c.c
@@ -36,7 +36,6 @@
36 36
37#include <asm/etraxi2c.h> 37#include <asm/etraxi2c.h>
38 38
39#include <asm/system.h>
40#include <asm/io.h> 39#include <asm/io.h>
41#include <asm/delay.h> 40#include <asm/delay.h>
42 41
diff --git a/arch/cris/arch-v32/drivers/mach-a3/gpio.c b/arch/cris/arch-v32/drivers/mach-a3/gpio.c
index c845831e222..0b86deedacb 100644
--- a/arch/cris/arch-v32/drivers/mach-a3/gpio.c
+++ b/arch/cris/arch-v32/drivers/mach-a3/gpio.c
@@ -31,7 +31,6 @@
31#include <hwregs/gio_defs.h> 31#include <hwregs/gio_defs.h>
32#include <hwregs/intr_vect_defs.h> 32#include <hwregs/intr_vect_defs.h>
33#include <asm/io.h> 33#include <asm/io.h>
34#include <asm/system.h>
35#include <asm/irq.h> 34#include <asm/irq.h>
36#include <mach/pinmux.h> 35#include <mach/pinmux.h>
37 36
diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c
index ee90d2659be..a2ac0917f1a 100644
--- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c
+++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c
@@ -30,7 +30,6 @@
30#include <hwregs/gio_defs.h> 30#include <hwregs/gio_defs.h>
31#include <hwregs/intr_vect_defs.h> 31#include <hwregs/intr_vect_defs.h>
32#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/system.h>
34#include <asm/irq.h> 33#include <asm/irq.h>
35 34
36#ifdef CONFIG_ETRAX_VIRTUAL_GPIO 35#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
diff --git a/arch/cris/arch-v32/kernel/debugport.c b/arch/cris/arch-v32/kernel/debugport.c
index 794b364d9f7..610909b003f 100644
--- a/arch/cris/arch-v32/kernel/debugport.c
+++ b/arch/cris/arch-v32/kernel/debugport.c
@@ -4,7 +4,6 @@
4 4
5#include <linux/console.h> 5#include <linux/console.h>
6#include <linux/init.h> 6#include <linux/init.h>
7#include <asm/system.h>
8#include <hwregs/reg_rdwr.h> 7#include <hwregs/reg_rdwr.h>
9#include <hwregs/reg_map.h> 8#include <hwregs/reg_map.h>
10#include <hwregs/ser_defs.h> 9#include <hwregs/ser_defs.h>
diff --git a/arch/cris/arch-v32/kernel/fasttimer.c b/arch/cris/arch-v32/kernel/fasttimer.c
index 111caa1a2ef..ab1551ee43c 100644
--- a/arch/cris/arch-v32/kernel/fasttimer.c
+++ b/arch/cris/arch-v32/kernel/fasttimer.c
@@ -17,7 +17,6 @@
17#include <linux/delay.h> 17#include <linux/delay.h>
18 18
19#include <asm/irq.h> 19#include <asm/irq.h>
20#include <asm/system.h>
21 20
22#include <hwregs/reg_map.h> 21#include <hwregs/reg_map.h>
23#include <hwregs/reg_rdwr.h> 22#include <hwregs/reg_rdwr.h>
diff --git a/arch/cris/arch-v32/kernel/ptrace.c b/arch/cris/arch-v32/kernel/ptrace.c
index 511ece94a57..f7ad9e8637d 100644
--- a/arch/cris/arch-v32/kernel/ptrace.c
+++ b/arch/cris/arch-v32/kernel/ptrace.c
@@ -15,7 +15,6 @@
15#include <asm/uaccess.h> 15#include <asm/uaccess.h>
16#include <asm/page.h> 16#include <asm/page.h>
17#include <asm/pgtable.h> 17#include <asm/pgtable.h>
18#include <asm/system.h>
19#include <asm/processor.h> 18#include <asm/processor.h>
20#include <arch/hwregs/supp_reg.h> 19#include <arch/hwregs/supp_reg.h>
21 20
diff --git a/arch/cris/arch-v32/mach-a3/dma.c b/arch/cris/arch-v32/mach-a3/dma.c
index f35e4f65f4e..47c64bf40ea 100644
--- a/arch/cris/arch-v32/mach-a3/dma.c
+++ b/arch/cris/arch-v32/mach-a3/dma.c
@@ -9,7 +9,6 @@
9#include <hwregs/clkgen_defs.h> 9#include <hwregs/clkgen_defs.h>
10#include <hwregs/strmux_defs.h> 10#include <hwregs/strmux_defs.h>
11#include <linux/errno.h> 11#include <linux/errno.h>
12#include <asm/system.h>
13#include <arbiter.h> 12#include <arbiter.h>
14 13
15static char used_dma_channels[MAX_DMA_CHANNELS]; 14static char used_dma_channels[MAX_DMA_CHANNELS];
diff --git a/arch/cris/arch-v32/mach-fs/dma.c b/arch/cris/arch-v32/mach-fs/dma.c
index 2d970d7505c..fc6416a671e 100644
--- a/arch/cris/arch-v32/mach-fs/dma.c
+++ b/arch/cris/arch-v32/mach-fs/dma.c
@@ -9,7 +9,6 @@
9#include <hwregs/config_defs.h> 9#include <hwregs/config_defs.h>
10#include <hwregs/strmux_defs.h> 10#include <hwregs/strmux_defs.h>
11#include <linux/errno.h> 11#include <linux/errno.h>
12#include <asm/system.h>
13#include <mach/arbiter.h> 12#include <mach/arbiter.h>
14 13
15static char used_dma_channels[MAX_DMA_CHANNELS]; 14static char used_dma_channels[MAX_DMA_CHANNELS];
diff --git a/arch/cris/include/arch-v10/arch/elf.h b/arch/cris/include/arch-v10/arch/elf.h
index 1c38ee728b1..1eb638aeddb 100644
--- a/arch/cris/include/arch-v10/arch/elf.h
+++ b/arch/cris/include/arch-v10/arch/elf.h
@@ -1,6 +1,8 @@
1#ifndef __ASMCRIS_ARCH_ELF_H 1#ifndef __ASMCRIS_ARCH_ELF_H
2#define __ASMCRIS_ARCH_ELF_H 2#define __ASMCRIS_ARCH_ELF_H
3 3
4#include <arch/system.h>
5
4#define ELF_MACH EF_CRIS_VARIANT_ANY_V0_V10 6#define ELF_MACH EF_CRIS_VARIANT_ANY_V0_V10
5 7
6/* 8/*
diff --git a/arch/cris/include/arch-v32/arch/elf.h b/arch/cris/include/arch-v32/arch/elf.h
index 1324e505a4d..c46d5829116 100644
--- a/arch/cris/include/arch-v32/arch/elf.h
+++ b/arch/cris/include/arch-v32/arch/elf.h
@@ -1,6 +1,8 @@
1#ifndef _ASM_CRIS_ELF_H 1#ifndef _ASM_CRIS_ELF_H
2#define _ASM_CRIS_ELF_H 2#define _ASM_CRIS_ELF_H
3 3
4#include <arch/system.h>
5
4#define ELF_CORE_EFLAGS EF_CRIS_VARIANT_V32 6#define ELF_CORE_EFLAGS EF_CRIS_VARIANT_V32
5 7
6/* 8/*
diff --git a/arch/cris/include/arch-v32/arch/system.h b/arch/cris/include/arch-v32/arch/system.h
index 76cea99eaa6..db853fb3a45 100644
--- a/arch/cris/include/arch-v32/arch/system.h
+++ b/arch/cris/include/arch-v32/arch/system.h
@@ -34,14 +34,4 @@ static inline unsigned long rdsp(void)
34/* Write the user-mode stack pointer. */ 34/* Write the user-mode stack pointer. */
35#define wrusp(usp) __asm__ __volatile__ ("move %0, $usp" : : "rm" (usp)) 35#define wrusp(usp) __asm__ __volatile__ ("move %0, $usp" : : "rm" (usp))
36 36
37#define nop() __asm__ __volatile__ ("nop");
38
39#define xchg(ptr,x) \
40 ((__typeof__(*(ptr)))__xchg((unsigned long) (x),(ptr),sizeof(*(ptr))))
41
42#define tas(ptr) (xchg((ptr),1))
43
44struct __xchg_dummy { unsigned long a[100]; };
45#define __xg(x) ((struct __xchg_dummy *)(x))
46
47#endif /* _ASM_CRIS_ARCH_SYSTEM_H */ 37#endif /* _ASM_CRIS_ARCH_SYSTEM_H */
diff --git a/arch/cris/include/asm/atomic.h b/arch/cris/include/asm/atomic.h
index bbf093814db..1056a5dfe04 100644
--- a/arch/cris/include/asm/atomic.h
+++ b/arch/cris/include/asm/atomic.h
@@ -5,7 +5,7 @@
5 5
6#include <linux/compiler.h> 6#include <linux/compiler.h>
7#include <linux/types.h> 7#include <linux/types.h>
8#include <asm/system.h> 8#include <asm/cmpxchg.h>
9#include <arch/atomic.h> 9#include <arch/atomic.h>
10 10
11/* 11/*
diff --git a/arch/cris/include/asm/barrier.h b/arch/cris/include/asm/barrier.h
new file mode 100644
index 00000000000..198ad7fa6b2
--- /dev/null
+++ b/arch/cris/include/asm/barrier.h
@@ -0,0 +1,25 @@
1#ifndef __ASM_CRIS_BARRIER_H
2#define __ASM_CRIS_BARRIER_H
3
4#define nop() __asm__ __volatile__ ("nop");
5
6#define barrier() __asm__ __volatile__("": : :"memory")
7#define mb() barrier()
8#define rmb() mb()
9#define wmb() mb()
10#define read_barrier_depends() do { } while(0)
11#define set_mb(var, value) do { var = value; mb(); } while (0)
12
13#ifdef CONFIG_SMP
14#define smp_mb() mb()
15#define smp_rmb() rmb()
16#define smp_wmb() wmb()
17#define smp_read_barrier_depends() read_barrier_depends()
18#else
19#define smp_mb() barrier()
20#define smp_rmb() barrier()
21#define smp_wmb() barrier()
22#define smp_read_barrier_depends() do { } while(0)
23#endif
24
25#endif /* __ASM_CRIS_BARRIER_H */
diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h
index a78a2d70cd8..184066ceb1f 100644
--- a/arch/cris/include/asm/bitops.h
+++ b/arch/cris/include/asm/bitops.h
@@ -19,7 +19,6 @@
19#endif 19#endif
20 20
21#include <arch/bitops.h> 21#include <arch/bitops.h>
22#include <asm/system.h>
23#include <linux/atomic.h> 22#include <linux/atomic.h>
24#include <linux/compiler.h> 23#include <linux/compiler.h>
25 24
diff --git a/arch/cris/include/asm/system.h b/arch/cris/include/asm/cmpxchg.h
index ea10592f7d7..b756dac8aa3 100644
--- a/arch/cris/include/asm/system.h
+++ b/arch/cris/include/asm/cmpxchg.h
@@ -1,44 +1,7 @@
1#ifndef __ASM_CRIS_SYSTEM_H 1#ifndef __ASM_CRIS_CMPXCHG__
2#define __ASM_CRIS_SYSTEM_H 2#define __ASM_CRIS_CMPXCHG__
3 3
4#include <linux/irqflags.h> 4#include <linux/irqflags.h>
5#include <arch/system.h>
6
7/* the switch_to macro calls resume, an asm function in entry.S which does the actual
8 * task switching.
9 */
10
11extern struct task_struct *resume(struct task_struct *prev, struct task_struct *next, int);
12#define switch_to(prev,next,last) last = resume(prev,next, \
13 (int)&((struct task_struct *)0)->thread)
14
15#define barrier() __asm__ __volatile__("": : :"memory")
16#define mb() barrier()
17#define rmb() mb()
18#define wmb() mb()
19#define read_barrier_depends() do { } while(0)
20#define set_mb(var, value) do { var = value; mb(); } while (0)
21
22#ifdef CONFIG_SMP
23#define smp_mb() mb()
24#define smp_rmb() rmb()
25#define smp_wmb() wmb()
26#define smp_read_barrier_depends() read_barrier_depends()
27#else
28#define smp_mb() barrier()
29#define smp_rmb() barrier()
30#define smp_wmb() barrier()
31#define smp_read_barrier_depends() do { } while(0)
32#endif
33
34#define iret()
35
36/*
37 * disable hlt during certain critical i/o operations
38 */
39#define HAVE_DISABLE_HLT
40void disable_hlt(void);
41void enable_hlt(void);
42 5
43static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) 6static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
44{ 7{
@@ -67,6 +30,11 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
67 return x; 30 return x;
68} 31}
69 32
33#define xchg(ptr,x) \
34 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
35
36#define tas(ptr) (xchg((ptr),1))
37
70#include <asm-generic/cmpxchg-local.h> 38#include <asm-generic/cmpxchg-local.h>
71 39
72/* 40/*
@@ -82,8 +50,4 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
82#include <asm-generic/cmpxchg.h> 50#include <asm-generic/cmpxchg.h>
83#endif 51#endif
84 52
85#define arch_align_stack(x) (x) 53#endif /* __ASM_CRIS_CMPXCHG__ */
86
87void default_idle(void);
88
89#endif
diff --git a/arch/cris/include/asm/exec.h b/arch/cris/include/asm/exec.h
new file mode 100644
index 00000000000..9665dab7e25
--- /dev/null
+++ b/arch/cris/include/asm/exec.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_CRIS_EXEC_H
2#define __ASM_CRIS_EXEC_H
3
4#define arch_align_stack(x) (x)
5
6#endif /* __ASM_CRIS_EXEC_H */
diff --git a/arch/cris/include/asm/processor.h b/arch/cris/include/asm/processor.h
index 3f7248f7a1c..4210d72a666 100644
--- a/arch/cris/include/asm/processor.h
+++ b/arch/cris/include/asm/processor.h
@@ -10,10 +10,10 @@
10#ifndef __ASM_CRIS_PROCESSOR_H 10#ifndef __ASM_CRIS_PROCESSOR_H
11#define __ASM_CRIS_PROCESSOR_H 11#define __ASM_CRIS_PROCESSOR_H
12 12
13#include <asm/system.h>
14#include <asm/page.h> 13#include <asm/page.h>
15#include <asm/ptrace.h> 14#include <asm/ptrace.h>
16#include <arch/processor.h> 15#include <arch/processor.h>
16#include <arch/system.h>
17 17
18struct task_struct; 18struct task_struct;
19 19
@@ -72,4 +72,13 @@ static inline void release_thread(struct task_struct *dead_task)
72 72
73#define cpu_relax() barrier() 73#define cpu_relax() barrier()
74 74
75/*
76 * disable hlt during certain critical i/o operations
77 */
78#define HAVE_DISABLE_HLT
79void disable_hlt(void);
80void enable_hlt(void);
81
82void default_idle(void);
83
75#endif /* __ASM_CRIS_PROCESSOR_H */ 84#endif /* __ASM_CRIS_PROCESSOR_H */
diff --git a/arch/cris/include/asm/switch_to.h b/arch/cris/include/asm/switch_to.h
new file mode 100644
index 00000000000..d842e1163ba
--- /dev/null
+++ b/arch/cris/include/asm/switch_to.h
@@ -0,0 +1,12 @@
1#ifndef __ASM_CRIS_SWITCH_TO_H
2#define __ASM_CRIS_SWITCH_TO_H
3
4/* the switch_to macro calls resume, an asm function in entry.S which does the actual
5 * task switching.
6 */
7
8extern struct task_struct *resume(struct task_struct *prev, struct task_struct *next, int);
9#define switch_to(prev,next,last) last = resume(prev,next, \
10 (int)&((struct task_struct *)0)->thread)
11
12#endif /* __ASM_CRIS_SWITCH_TO_H */
diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c
index 788eb224891..d36836dbbc0 100644
--- a/arch/cris/kernel/irq.c
+++ b/arch/cris/kernel/irq.c
@@ -36,6 +36,7 @@
36#include <linux/spinlock.h> 36#include <linux/spinlock.h>
37 37
38#include <asm/io.h> 38#include <asm/io.h>
39#include <arch/system.h>
39 40
40/* called by the assembler IRQ entry functions defined in irq.h 41/* called by the assembler IRQ entry functions defined in irq.h
41 * to dispatch the interrupts to registered handlers 42 * to dispatch the interrupts to registered handlers
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index d8f50ff6fad..891dad85e8b 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -16,7 +16,6 @@
16#include <asm/pgtable.h> 16#include <asm/pgtable.h>
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <asm/irq.h> 18#include <asm/irq.h>
19#include <asm/system.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/spinlock.h> 20#include <linux/spinlock.h>
22#include <linux/init_task.h> 21#include <linux/init_task.h>
diff --git a/arch/cris/kernel/ptrace.c b/arch/cris/kernel/ptrace.c
index 48b0f391263..d114ad3da9b 100644
--- a/arch/cris/kernel/ptrace.c
+++ b/arch/cris/kernel/ptrace.c
@@ -21,7 +21,6 @@
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/page.h> 22#include <asm/page.h>
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/system.h>
25#include <asm/processor.h> 24#include <asm/processor.h>
26 25
27 26
diff --git a/arch/cris/kernel/setup.c b/arch/cris/kernel/setup.c
index b712f4934c4..32c3d248868 100644
--- a/arch/cris/kernel/setup.c
+++ b/arch/cris/kernel/setup.c
@@ -20,6 +20,7 @@
20#include <linux/pfn.h> 20#include <linux/pfn.h>
21#include <linux/cpu.h> 21#include <linux/cpu.h>
22#include <asm/setup.h> 22#include <asm/setup.h>
23#include <arch/system.h>
23 24
24/* 25/*
25 * Setup options 26 * Setup options
diff --git a/arch/cris/kernel/traps.c b/arch/cris/kernel/traps.c
index 8da53f34c7a..a11ad3229f8 100644
--- a/arch/cris/kernel/traps.c
+++ b/arch/cris/kernel/traps.c
@@ -17,6 +17,7 @@
17 17
18#include <asm/pgtable.h> 18#include <asm/pgtable.h>
19#include <asm/uaccess.h> 19#include <asm/uaccess.h>
20#include <arch/system.h>
20 21
21extern void arch_enable_nmi(void); 22extern void arch_enable_nmi(void);
22extern void stop_watchdog(void); 23extern void stop_watchdog(void);
diff --git a/arch/cris/mm/fault.c b/arch/cris/mm/fault.c
index 9dcac8ec8fa..b4760d86e1b 100644
--- a/arch/cris/mm/fault.c
+++ b/arch/cris/mm/fault.c
@@ -9,6 +9,7 @@
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/wait.h> 10#include <linux/wait.h>
11#include <asm/uaccess.h> 11#include <asm/uaccess.h>
12#include <arch/system.h>
12 13
13extern int find_fixup_code(struct pt_regs *); 14extern int find_fixup_code(struct pt_regs *);
14extern void die_if_kernel(const char *, struct pt_regs *, long); 15extern void die_if_kernel(const char *, struct pt_regs *, long);
diff --git a/arch/frv/include/asm/atomic.h b/arch/frv/include/asm/atomic.h
index 0d8a7d66174..b86329d0e31 100644
--- a/arch/frv/include/asm/atomic.h
+++ b/arch/frv/include/asm/atomic.h
@@ -16,7 +16,7 @@
16 16
17#include <linux/types.h> 17#include <linux/types.h>
18#include <asm/spr-regs.h> 18#include <asm/spr-regs.h>
19#include <asm/system.h> 19#include <asm/cmpxchg.h>
20 20
21#ifdef CONFIG_SMP 21#ifdef CONFIG_SMP
22#error not SMP safe 22#error not SMP safe
@@ -181,61 +181,6 @@ static inline void atomic64_dec(atomic64_t *v)
181#define atomic64_dec_and_test(v) (atomic64_dec_return((v)) == 0) 181#define atomic64_dec_and_test(v) (atomic64_dec_return((v)) == 0)
182#define atomic64_inc_and_test(v) (atomic64_inc_return((v)) == 0) 182#define atomic64_inc_and_test(v) (atomic64_inc_return((v)) == 0)
183 183
184/*****************************************************************************/
185/*
186 * exchange value with memory
187 */
188extern uint64_t __xchg_64(uint64_t i, volatile void *v);
189
190#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
191
192#define xchg(ptr, x) \
193({ \
194 __typeof__(ptr) __xg_ptr = (ptr); \
195 __typeof__(*(ptr)) __xg_orig; \
196 \
197 switch (sizeof(__xg_orig)) { \
198 case 4: \
199 asm volatile( \
200 "swap%I0 %M0,%1" \
201 : "+m"(*__xg_ptr), "=r"(__xg_orig) \
202 : "1"(x) \
203 : "memory" \
204 ); \
205 break; \
206 \
207 default: \
208 __xg_orig = (__typeof__(__xg_orig))0; \
209 asm volatile("break"); \
210 break; \
211 } \
212 \
213 __xg_orig; \
214})
215
216#else
217
218extern uint32_t __xchg_32(uint32_t i, volatile void *v);
219
220#define xchg(ptr, x) \
221({ \
222 __typeof__(ptr) __xg_ptr = (ptr); \
223 __typeof__(*(ptr)) __xg_orig; \
224 \
225 switch (sizeof(__xg_orig)) { \
226 case 4: __xg_orig = (__typeof__(*(ptr))) __xchg_32((uint32_t) x, __xg_ptr); break; \
227 default: \
228 __xg_orig = (__typeof__(__xg_orig))0; \
229 asm volatile("break"); \
230 break; \
231 } \
232 __xg_orig; \
233})
234
235#endif
236
237#define tas(ptr) (xchg((ptr), 1))
238
239#define atomic_cmpxchg(v, old, new) (cmpxchg(&(v)->counter, old, new)) 184#define atomic_cmpxchg(v, old, new) (cmpxchg(&(v)->counter, old, new))
240#define atomic_xchg(v, new) (xchg(&(v)->counter, new)) 185#define atomic_xchg(v, new) (xchg(&(v)->counter, new))
241#define atomic64_cmpxchg(v, old, new) (__cmpxchg_64(old, new, &(v)->counter)) 186#define atomic64_cmpxchg(v, old, new) (__cmpxchg_64(old, new, &(v)->counter))
diff --git a/arch/frv/include/asm/barrier.h b/arch/frv/include/asm/barrier.h
new file mode 100644
index 00000000000..06776ad9f5e
--- /dev/null
+++ b/arch/frv/include/asm/barrier.h
@@ -0,0 +1,29 @@
1/* FR-V CPU memory barrier definitions
2 *
3 * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef _ASM_BARRIER_H
13#define _ASM_BARRIER_H
14
15#define nop() asm volatile ("nop"::)
16
17#define mb() asm volatile ("membar" : : :"memory")
18#define rmb() asm volatile ("membar" : : :"memory")
19#define wmb() asm volatile ("membar" : : :"memory")
20#define read_barrier_depends() do { } while (0)
21
22#define smp_mb() barrier()
23#define smp_rmb() barrier()
24#define smp_wmb() barrier()
25#define smp_read_barrier_depends() do {} while(0)
26#define set_mb(var, value) \
27 do { var = (value); barrier(); } while (0)
28
29#endif /* _ASM_BARRIER_H */
diff --git a/arch/frv/include/asm/bug.h b/arch/frv/include/asm/bug.h
index 2e054508a2f..dd01bcf42ee 100644
--- a/arch/frv/include/asm/bug.h
+++ b/arch/frv/include/asm/bug.h
@@ -51,4 +51,6 @@ do { \
51 51
52#include <asm-generic/bug.h> 52#include <asm-generic/bug.h>
53 53
54extern void die_if_kernel(const char *, ...) __attribute__((format(printf, 1, 2)));
55
54#endif 56#endif
diff --git a/arch/frv/include/asm/system.h b/arch/frv/include/asm/cmpxchg.h
index 6c10fd2c626..5b04dd0aeca 100644
--- a/arch/frv/include/asm/system.h
+++ b/arch/frv/include/asm/cmpxchg.h
@@ -1,6 +1,9 @@
1/* system.h: FR-V CPU control definitions 1/* xchg and cmpxchg operation emulation for FR-V
2 * 2 *
3 * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. 3 * For an explanation of how atomic ops work in this arch, see:
4 * Documentation/frv/atomic-ops.txt
5 *
6 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 7 * Written by David Howells (dhowells@redhat.com)
5 * 8 *
6 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
@@ -8,54 +11,65 @@
8 * as published by the Free Software Foundation; either version 11 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version. 12 * 2 of the License, or (at your option) any later version.
10 */ 13 */
11 14#ifndef _ASM_CMPXCHG_H
12#ifndef _ASM_SYSTEM_H 15#define _ASM_CMPXCHG_H
13#define _ASM_SYSTEM_H
14 16
15#include <linux/types.h> 17#include <linux/types.h>
16#include <linux/linkage.h>
17#include <linux/kernel.h>
18
19struct thread_struct;
20 18
19/*****************************************************************************/
21/* 20/*
22 * switch_to(prev, next) should switch from task `prev' to `next' 21 * exchange value with memory
23 * `prev' will never be the same as `next'.
24 * The `mb' is to tell GCC not to cache `current' across this call.
25 */ 22 */
26extern asmlinkage 23extern uint64_t __xchg_64(uint64_t i, volatile void *v);
27struct task_struct *__switch_to(struct thread_struct *prev_thread,
28 struct thread_struct *next_thread,
29 struct task_struct *prev);
30
31#define switch_to(prev, next, last) \
32do { \
33 (prev)->thread.sched_lr = \
34 (unsigned long) __builtin_return_address(0); \
35 (last) = __switch_to(&(prev)->thread, &(next)->thread, (prev)); \
36 mb(); \
37} while(0)
38 24
39/* 25#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
40 * Force strict CPU ordering. 26
41 */ 27#define xchg(ptr, x) \
42#define nop() asm volatile ("nop"::) 28({ \
43#define mb() asm volatile ("membar" : : :"memory") 29 __typeof__(ptr) __xg_ptr = (ptr); \
44#define rmb() asm volatile ("membar" : : :"memory") 30 __typeof__(*(ptr)) __xg_orig; \
45#define wmb() asm volatile ("membar" : : :"memory") 31 \
46#define read_barrier_depends() do { } while (0) 32 switch (sizeof(__xg_orig)) { \
33 case 4: \
34 asm volatile( \
35 "swap%I0 %M0,%1" \
36 : "+m"(*__xg_ptr), "=r"(__xg_orig) \
37 : "1"(x) \
38 : "memory" \
39 ); \
40 break; \
41 \
42 default: \
43 __xg_orig = (__typeof__(__xg_orig))0; \
44 asm volatile("break"); \
45 break; \
46 } \
47 \
48 __xg_orig; \
49})
47 50
48#define smp_mb() barrier() 51#else
49#define smp_rmb() barrier()
50#define smp_wmb() barrier()
51#define smp_read_barrier_depends() do {} while(0)
52#define set_mb(var, value) \
53 do { var = (value); barrier(); } while (0)
54 52
55extern void die_if_kernel(const char *, ...) __attribute__((format(printf, 1, 2))); 53extern uint32_t __xchg_32(uint32_t i, volatile void *v);
56extern void free_initmem(void); 54
55#define xchg(ptr, x) \
56({ \
57 __typeof__(ptr) __xg_ptr = (ptr); \
58 __typeof__(*(ptr)) __xg_orig; \
59 \
60 switch (sizeof(__xg_orig)) { \
61 case 4: __xg_orig = (__typeof__(*(ptr))) __xchg_32((uint32_t) x, __xg_ptr); break; \
62 default: \
63 __xg_orig = (__typeof__(__xg_orig))0; \
64 asm volatile("break"); \
65 break; \
66 } \
67 __xg_orig; \
68})
69
70#endif
57 71
58#define arch_align_stack(x) (x) 72#define tas(ptr) (xchg((ptr), 1))
59 73
60/*****************************************************************************/ 74/*****************************************************************************/
61/* 75/*
@@ -155,4 +169,4 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
155 (unsigned long)(n), sizeof(*(ptr)))) 169 (unsigned long)(n), sizeof(*(ptr))))
156#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 170#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
157 171
158#endif /* _ASM_SYSTEM_H */ 172#endif /* _ASM_CMPXCHG_H */
diff --git a/arch/frv/include/asm/exec.h b/arch/frv/include/asm/exec.h
new file mode 100644
index 00000000000..65c91305d4a
--- /dev/null
+++ b/arch/frv/include/asm/exec.h
@@ -0,0 +1,17 @@
1/* FR-V CPU executable handling
2 *
3 * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef _ASM_EXEC_H
13#define _ASM_EXEC_H
14
15#define arch_align_stack(x) (x)
16
17#endif /* _ASM_EXEC_H */
diff --git a/arch/frv/include/asm/switch_to.h b/arch/frv/include/asm/switch_to.h
new file mode 100644
index 00000000000..2cf0f6a7fbb
--- /dev/null
+++ b/arch/frv/include/asm/switch_to.h
@@ -0,0 +1,35 @@
1/* FR-V CPU basic task switching
2 *
3 * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef _ASM_SWITCH_TO_H
13#define _ASM_SWITCH_TO_H
14
15#include <linux/thread_info.h>
16
17/*
18 * switch_to(prev, next) should switch from task `prev' to `next'
19 * `prev' will never be the same as `next'.
20 * The `mb' is to tell GCC not to cache `current' across this call.
21 */
22extern asmlinkage
23struct task_struct *__switch_to(struct thread_struct *prev_thread,
24 struct thread_struct *next_thread,
25 struct task_struct *prev);
26
27#define switch_to(prev, next, last) \
28do { \
29 (prev)->thread.sched_lr = \
30 (unsigned long) __builtin_return_address(0); \
31 (last) = __switch_to(&(prev)->thread, &(next)->thread, (prev)); \
32 mb(); \
33} while(0)
34
35#endif /* _ASM_SWITCH_TO_H */
diff --git a/arch/frv/kernel/debug-stub.c b/arch/frv/kernel/debug-stub.c
index 2845139c807..a0228f717ef 100644
--- a/arch/frv/kernel/debug-stub.c
+++ b/arch/frv/kernel/debug-stub.c
@@ -17,7 +17,6 @@
17#include <linux/serial_reg.h> 17#include <linux/serial_reg.h>
18#include <linux/start_kernel.h> 18#include <linux/start_kernel.h>
19 19
20#include <asm/system.h>
21#include <asm/serial-regs.h> 20#include <asm/serial-regs.h>
22#include <asm/timer-regs.h> 21#include <asm/timer-regs.h>
23#include <asm/irc-regs.h> 22#include <asm/irc-regs.h>
diff --git a/arch/frv/kernel/gdb-io.c b/arch/frv/kernel/gdb-io.c
index 2ca641d199f..0707d35079b 100644
--- a/arch/frv/kernel/gdb-io.c
+++ b/arch/frv/kernel/gdb-io.c
@@ -19,7 +19,6 @@
19#include <linux/serial_reg.h> 19#include <linux/serial_reg.h>
20 20
21#include <asm/pgtable.h> 21#include <asm/pgtable.h>
22#include <asm/system.h>
23#include <asm/irc-regs.h> 22#include <asm/irc-regs.h>
24#include <asm/timer-regs.h> 23#include <asm/timer-regs.h>
25#include <asm/gdb-stub.h> 24#include <asm/gdb-stub.h>
diff --git a/arch/frv/kernel/gdb-stub.c b/arch/frv/kernel/gdb-stub.c
index a6d5381c94f..bbe78b0bffe 100644
--- a/arch/frv/kernel/gdb-stub.c
+++ b/arch/frv/kernel/gdb-stub.c
@@ -126,7 +126,6 @@
126 126
127#include <asm/asm-offsets.h> 127#include <asm/asm-offsets.h>
128#include <asm/pgtable.h> 128#include <asm/pgtable.h>
129#include <asm/system.h>
130#include <asm/gdb-stub.h> 129#include <asm/gdb-stub.h>
131 130
132#define LEDS(x) do { /* *(u32*)0xe1200004 = ~(x); mb(); */ } while(0) 131#define LEDS(x) do { /* *(u32*)0xe1200004 = ~(x); mb(); */ } while(0)
diff --git a/arch/frv/kernel/irq-mb93091.c b/arch/frv/kernel/irq-mb93091.c
index 9afc2ea400d..2cc327a1ca4 100644
--- a/arch/frv/kernel/irq-mb93091.c
+++ b/arch/frv/kernel/irq-mb93091.c
@@ -20,7 +20,6 @@
20#include <linux/bitops.h> 20#include <linux/bitops.h>
21 21
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/system.h>
24#include <asm/delay.h> 23#include <asm/delay.h>
25#include <asm/irq.h> 24#include <asm/irq.h>
26#include <asm/irc-regs.h> 25#include <asm/irc-regs.h>
diff --git a/arch/frv/kernel/irq-mb93093.c b/arch/frv/kernel/irq-mb93093.c
index 4d4ad09d3c9..95e4eb4f1f3 100644
--- a/arch/frv/kernel/irq-mb93093.c
+++ b/arch/frv/kernel/irq-mb93093.c
@@ -20,7 +20,6 @@
20#include <linux/bitops.h> 20#include <linux/bitops.h>
21 21
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/system.h>
24#include <asm/delay.h> 23#include <asm/delay.h>
25#include <asm/irq.h> 24#include <asm/irq.h>
26#include <asm/irc-regs.h> 25#include <asm/irc-regs.h>
diff --git a/arch/frv/kernel/irq-mb93493.c b/arch/frv/kernel/irq-mb93493.c
index 4d034c7840c..ba648da0932 100644
--- a/arch/frv/kernel/irq-mb93493.c
+++ b/arch/frv/kernel/irq-mb93493.c
@@ -20,7 +20,6 @@
20#include <linux/bitops.h> 20#include <linux/bitops.h>
21 21
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/system.h>
24#include <asm/delay.h> 23#include <asm/delay.h>
25#include <asm/irq.h> 24#include <asm/irq.h>
26#include <asm/irc-regs.h> 25#include <asm/irc-regs.h>
diff --git a/arch/frv/kernel/irq.c b/arch/frv/kernel/irq.c
index 3facbc28cbb..2239346fa3d 100644
--- a/arch/frv/kernel/irq.c
+++ b/arch/frv/kernel/irq.c
@@ -28,7 +28,6 @@
28#include <linux/atomic.h> 28#include <linux/atomic.h>
29#include <asm/io.h> 29#include <asm/io.h>
30#include <asm/smp.h> 30#include <asm/smp.h>
31#include <asm/system.h>
32#include <asm/uaccess.h> 31#include <asm/uaccess.h>
33#include <asm/pgalloc.h> 32#include <asm/pgalloc.h>
34#include <asm/delay.h> 33#include <asm/delay.h>
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c
index 29cc4978378..d4de48bd5ef 100644
--- a/arch/frv/kernel/process.c
+++ b/arch/frv/kernel/process.c
@@ -28,7 +28,6 @@
28 28
29#include <asm/asm-offsets.h> 29#include <asm/asm-offsets.h>
30#include <asm/uaccess.h> 30#include <asm/uaccess.h>
31#include <asm/system.h>
32#include <asm/setup.h> 31#include <asm/setup.h>
33#include <asm/pgtable.h> 32#include <asm/pgtable.h>
34#include <asm/tlb.h> 33#include <asm/tlb.h>
diff --git a/arch/frv/kernel/ptrace.c b/arch/frv/kernel/ptrace.c
index 9d68f7fac73..3987ff88dab 100644
--- a/arch/frv/kernel/ptrace.c
+++ b/arch/frv/kernel/ptrace.c
@@ -26,7 +26,6 @@
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/page.h> 27#include <asm/page.h>
28#include <asm/pgtable.h> 28#include <asm/pgtable.h>
29#include <asm/system.h>
30#include <asm/processor.h> 29#include <asm/processor.h>
31#include <asm/unistd.h> 30#include <asm/unistd.h>
32 31
diff --git a/arch/frv/kernel/traps.c b/arch/frv/kernel/traps.c
index 1d2dfe67d44..5cfd1420b09 100644
--- a/arch/frv/kernel/traps.c
+++ b/arch/frv/kernel/traps.c
@@ -23,7 +23,6 @@
23#include <asm/asm-offsets.h> 23#include <asm/asm-offsets.h>
24#include <asm/setup.h> 24#include <asm/setup.h>
25#include <asm/fpu.h> 25#include <asm/fpu.h>
26#include <asm/system.h>
27#include <asm/uaccess.h> 26#include <asm/uaccess.h>
28#include <asm/pgtable.h> 27#include <asm/pgtable.h>
29#include <asm/siginfo.h> 28#include <asm/siginfo.h>
diff --git a/arch/frv/mm/fault.c b/arch/frv/mm/fault.c
index a325d57a83d..331c1e2cfb6 100644
--- a/arch/frv/mm/fault.c
+++ b/arch/frv/mm/fault.c
@@ -20,7 +20,6 @@
20#include <linux/ptrace.h> 20#include <linux/ptrace.h>
21#include <linux/hardirq.h> 21#include <linux/hardirq.h>
22 22
23#include <asm/system.h>
24#include <asm/pgtable.h> 23#include <asm/pgtable.h>
25#include <asm/uaccess.h> 24#include <asm/uaccess.h>
26#include <asm/gdb-stub.h> 25#include <asm/gdb-stub.h>
diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c
index fbe5f0dbae0..a19effcccb3 100644
--- a/arch/frv/mm/init.c
+++ b/arch/frv/mm/init.c
@@ -33,7 +33,6 @@
33#include <asm/segment.h> 33#include <asm/segment.h>
34#include <asm/page.h> 34#include <asm/page.h>
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/system.h>
37#include <asm/mmu_context.h> 36#include <asm/mmu_context.h>
38#include <asm/virtconvert.h> 37#include <asm/virtconvert.h>
39#include <asm/sections.h> 38#include <asm/sections.h>
diff --git a/arch/frv/mm/kmap.c b/arch/frv/mm/kmap.c
index fb78be38ea0..e9217e605aa 100644
--- a/arch/frv/mm/kmap.c
+++ b/arch/frv/mm/kmap.c
@@ -21,7 +21,6 @@
21#include <asm/page.h> 21#include <asm/page.h>
22#include <asm/pgalloc.h> 22#include <asm/pgalloc.h>
23#include <asm/io.h> 23#include <asm/io.h>
24#include <asm/system.h>
25 24
26#undef DEBUG 25#undef DEBUG
27 26
diff --git a/arch/h8300/include/asm/atomic.h b/arch/h8300/include/asm/atomic.h
index f5a38c1f548..40901e353c2 100644
--- a/arch/h8300/include/asm/atomic.h
+++ b/arch/h8300/include/asm/atomic.h
@@ -2,6 +2,7 @@
2#define __ARCH_H8300_ATOMIC__ 2#define __ARCH_H8300_ATOMIC__
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/cmpxchg.h>
5 6
6/* 7/*
7 * Atomic operations that C can't guarantee us. Useful for 8 * Atomic operations that C can't guarantee us. Useful for
@@ -13,7 +14,6 @@
13#define atomic_read(v) (*(volatile int *)&(v)->counter) 14#define atomic_read(v) (*(volatile int *)&(v)->counter)
14#define atomic_set(v, i) (((v)->counter) = i) 15#define atomic_set(v, i) (((v)->counter) = i)
15 16
16#include <asm/system.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18 18
19static __inline__ int atomic_add_return(int i, atomic_t *v) 19static __inline__ int atomic_add_return(int i, atomic_t *v)
@@ -102,8 +102,6 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
102 return ret; 102 return ret;
103} 103}
104 104
105#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
106
107static inline int __atomic_add_unless(atomic_t *v, int a, int u) 105static inline int __atomic_add_unless(atomic_t *v, int a, int u)
108{ 106{
109 int ret; 107 int ret;
diff --git a/arch/h8300/include/asm/barrier.h b/arch/h8300/include/asm/barrier.h
new file mode 100644
index 00000000000..c7283c343c5
--- /dev/null
+++ b/arch/h8300/include/asm/barrier.h
@@ -0,0 +1,27 @@
1#ifndef _H8300_BARRIER_H
2#define _H8300_BARRIER_H
3
4#define nop() asm volatile ("nop"::)
5
6/*
7 * Force strict CPU ordering.
8 * Not really required on H8...
9 */
10#define mb() asm volatile ("" : : :"memory")
11#define rmb() asm volatile ("" : : :"memory")
12#define wmb() asm volatile ("" : : :"memory")
13#define set_mb(var, value) do { xchg(&var, value); } while (0)
14
15#ifdef CONFIG_SMP
16#define smp_mb() mb()
17#define smp_rmb() rmb()
18#define smp_wmb() wmb()
19#define smp_read_barrier_depends() read_barrier_depends()
20#else
21#define smp_mb() barrier()
22#define smp_rmb() barrier()
23#define smp_wmb() barrier()
24#define smp_read_barrier_depends() do { } while(0)
25#endif
26
27#endif /* _H8300_BARRIER_H */
diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h
index e856c1bb341..eb34e0cd33d 100644
--- a/arch/h8300/include/asm/bitops.h
+++ b/arch/h8300/include/asm/bitops.h
@@ -7,7 +7,6 @@
7 */ 7 */
8 8
9#include <linux/compiler.h> 9#include <linux/compiler.h>
10#include <asm/system.h>
11 10
12#ifdef __KERNEL__ 11#ifdef __KERNEL__
13 12
diff --git a/arch/h8300/include/asm/bug.h b/arch/h8300/include/asm/bug.h
index 887c1977318..1e1be811993 100644
--- a/arch/h8300/include/asm/bug.h
+++ b/arch/h8300/include/asm/bug.h
@@ -5,4 +5,8 @@
5#define is_valid_bugaddr(addr) (1) 5#define is_valid_bugaddr(addr) (1)
6 6
7#include <asm-generic/bug.h> 7#include <asm-generic/bug.h>
8
9struct pt_regs;
10extern void die(const char *str, struct pt_regs *fp, unsigned long err);
11
8#endif 12#endif
diff --git a/arch/h8300/include/asm/cmpxchg.h b/arch/h8300/include/asm/cmpxchg.h
new file mode 100644
index 00000000000..cdb203ef681
--- /dev/null
+++ b/arch/h8300/include/asm/cmpxchg.h
@@ -0,0 +1,60 @@
1#ifndef __ARCH_H8300_CMPXCHG__
2#define __ARCH_H8300_CMPXCHG__
3
4#include <linux/irqflags.h>
5
6#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
7
8struct __xchg_dummy { unsigned long a[100]; };
9#define __xg(x) ((volatile struct __xchg_dummy *)(x))
10
11static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
12{
13 unsigned long tmp, flags;
14
15 local_irq_save(flags);
16
17 switch (size) {
18 case 1:
19 __asm__ __volatile__
20 ("mov.b %2,%0\n\t"
21 "mov.b %1,%2"
22 : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory");
23 break;
24 case 2:
25 __asm__ __volatile__
26 ("mov.w %2,%0\n\t"
27 "mov.w %1,%2"
28 : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory");
29 break;
30 case 4:
31 __asm__ __volatile__
32 ("mov.l %2,%0\n\t"
33 "mov.l %1,%2"
34 : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory");
35 break;
36 default:
37 tmp = 0;
38 }
39 local_irq_restore(flags);
40 return tmp;
41}
42
43#include <asm-generic/cmpxchg-local.h>
44
45/*
46 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
47 * them available.
48 */
49#define cmpxchg_local(ptr, o, n) \
50 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
51 (unsigned long)(n), sizeof(*(ptr))))
52#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
53
54#ifndef CONFIG_SMP
55#include <asm-generic/cmpxchg.h>
56#endif
57
58#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
59
60#endif /* __ARCH_H8300_CMPXCHG__ */
diff --git a/arch/h8300/include/asm/exec.h b/arch/h8300/include/asm/exec.h
new file mode 100644
index 00000000000..c01c45ccadf
--- /dev/null
+++ b/arch/h8300/include/asm/exec.h
@@ -0,0 +1,6 @@
1#ifndef _H8300_EXEC_H
2#define _H8300_EXEC_H
3
4#define arch_align_stack(x) (x)
5
6#endif /* _H8300_EXEC_H */
diff --git a/arch/h8300/include/asm/processor.h b/arch/h8300/include/asm/processor.h
index e834b601889..61fabf1788c 100644
--- a/arch/h8300/include/asm/processor.h
+++ b/arch/h8300/include/asm/processor.h
@@ -135,4 +135,9 @@ unsigned long get_wchan(struct task_struct *p);
135 135
136#define cpu_relax() barrier() 136#define cpu_relax() barrier()
137 137
138#define HARD_RESET_NOW() ({ \
139 local_irq_disable(); \
140 asm("jmp @@0"); \
141})
142
138#endif 143#endif
diff --git a/arch/h8300/include/asm/switch_to.h b/arch/h8300/include/asm/switch_to.h
new file mode 100644
index 00000000000..cdd8731ce48
--- /dev/null
+++ b/arch/h8300/include/asm/switch_to.h
@@ -0,0 +1,50 @@
1#ifndef _H8300_SWITCH_TO_H
2#define _H8300_SWITCH_TO_H
3
4/*
5 * switch_to(n) should switch tasks to task ptr, first checking that
6 * ptr isn't the current task, in which case it does nothing. This
7 * also clears the TS-flag if the task we switched to has used the
8 * math co-processor latest.
9 */
10/*
11 * switch_to() saves the extra registers, that are not saved
12 * automatically by SAVE_SWITCH_STACK in resume(), ie. d0-d5 and
13 * a0-a1. Some of these are used by schedule() and its predecessors
14 * and so we might get see unexpected behaviors when a task returns
15 * with unexpected register values.
16 *
17 * syscall stores these registers itself and none of them are used
18 * by syscall after the function in the syscall has been called.
19 *
20 * Beware that resume now expects *next to be in d1 and the offset of
21 * tss to be in a1. This saves a few instructions as we no longer have
22 * to push them onto the stack and read them back right after.
23 *
24 * 02/17/96 - Jes Sorensen (jds@kom.auc.dk)
25 *
26 * Changed 96/09/19 by Andreas Schwab
27 * pass prev in a0, next in a1, offset of tss in d1, and whether
28 * the mm structures are shared in d2 (to avoid atc flushing).
29 *
30 * H8/300 Porting 2002/09/04 Yoshinori Sato
31 */
32
33asmlinkage void resume(void);
34#define switch_to(prev,next,last) { \
35 void *_last; \
36 __asm__ __volatile__( \
37 "mov.l %1, er0\n\t" \
38 "mov.l %2, er1\n\t" \
39 "mov.l %3, er2\n\t" \
40 "jsr @_resume\n\t" \
41 "mov.l er2,%0\n\t" \
42 : "=r" (_last) \
43 : "r" (&(prev->thread)), \
44 "r" (&(next->thread)), \
45 "g" (prev) \
46 : "cc", "er0", "er1", "er2", "er3"); \
47 (last) = _last; \
48}
49
50#endif /* _H8300_SWITCH_TO_H */
diff --git a/arch/h8300/include/asm/system.h b/arch/h8300/include/asm/system.h
deleted file mode 100644
index 2c2382e50d9..00000000000
--- a/arch/h8300/include/asm/system.h
+++ /dev/null
@@ -1,140 +0,0 @@
1#ifndef _H8300_SYSTEM_H
2#define _H8300_SYSTEM_H
3
4#include <linux/linkage.h>
5#include <linux/irqflags.h>
6
7struct pt_regs;
8
9/*
10 * switch_to(n) should switch tasks to task ptr, first checking that
11 * ptr isn't the current task, in which case it does nothing. This
12 * also clears the TS-flag if the task we switched to has used the
13 * math co-processor latest.
14 */
15/*
16 * switch_to() saves the extra registers, that are not saved
17 * automatically by SAVE_SWITCH_STACK in resume(), ie. d0-d5 and
18 * a0-a1. Some of these are used by schedule() and its predecessors
19 * and so we might get see unexpected behaviors when a task returns
20 * with unexpected register values.
21 *
22 * syscall stores these registers itself and none of them are used
23 * by syscall after the function in the syscall has been called.
24 *
25 * Beware that resume now expects *next to be in d1 and the offset of
26 * tss to be in a1. This saves a few instructions as we no longer have
27 * to push them onto the stack and read them back right after.
28 *
29 * 02/17/96 - Jes Sorensen (jds@kom.auc.dk)
30 *
31 * Changed 96/09/19 by Andreas Schwab
32 * pass prev in a0, next in a1, offset of tss in d1, and whether
33 * the mm structures are shared in d2 (to avoid atc flushing).
34 *
35 * H8/300 Porting 2002/09/04 Yoshinori Sato
36 */
37
38asmlinkage void resume(void);
39#define switch_to(prev,next,last) { \
40 void *_last; \
41 __asm__ __volatile__( \
42 "mov.l %1, er0\n\t" \
43 "mov.l %2, er1\n\t" \
44 "mov.l %3, er2\n\t" \
45 "jsr @_resume\n\t" \
46 "mov.l er2,%0\n\t" \
47 : "=r" (_last) \
48 : "r" (&(prev->thread)), \
49 "r" (&(next->thread)), \
50 "g" (prev) \
51 : "cc", "er0", "er1", "er2", "er3"); \
52 (last) = _last; \
53}
54
55#define iret() __asm__ __volatile__ ("rte": : :"memory", "sp", "cc")
56
57/*
58 * Force strict CPU ordering.
59 * Not really required on H8...
60 */
61#define nop() asm volatile ("nop"::)
62#define mb() asm volatile ("" : : :"memory")
63#define rmb() asm volatile ("" : : :"memory")
64#define wmb() asm volatile ("" : : :"memory")
65#define set_mb(var, value) do { xchg(&var, value); } while (0)
66
67#ifdef CONFIG_SMP
68#define smp_mb() mb()
69#define smp_rmb() rmb()
70#define smp_wmb() wmb()
71#define smp_read_barrier_depends() read_barrier_depends()
72#else
73#define smp_mb() barrier()
74#define smp_rmb() barrier()
75#define smp_wmb() barrier()
76#define smp_read_barrier_depends() do { } while(0)
77#endif
78
79#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
80
81struct __xchg_dummy { unsigned long a[100]; };
82#define __xg(x) ((volatile struct __xchg_dummy *)(x))
83
84static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
85{
86 unsigned long tmp, flags;
87
88 local_irq_save(flags);
89
90 switch (size) {
91 case 1:
92 __asm__ __volatile__
93 ("mov.b %2,%0\n\t"
94 "mov.b %1,%2"
95 : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory");
96 break;
97 case 2:
98 __asm__ __volatile__
99 ("mov.w %2,%0\n\t"
100 "mov.w %1,%2"
101 : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory");
102 break;
103 case 4:
104 __asm__ __volatile__
105 ("mov.l %2,%0\n\t"
106 "mov.l %1,%2"
107 : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory");
108 break;
109 default:
110 tmp = 0;
111 }
112 local_irq_restore(flags);
113 return tmp;
114}
115
116#define HARD_RESET_NOW() ({ \
117 local_irq_disable(); \
118 asm("jmp @@0"); \
119})
120
121#include <asm-generic/cmpxchg-local.h>
122
123/*
124 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
125 * them available.
126 */
127#define cmpxchg_local(ptr, o, n) \
128 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
129 (unsigned long)(n), sizeof(*(ptr))))
130#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
131
132#ifndef CONFIG_SMP
133#include <asm-generic/cmpxchg.h>
134#endif
135
136#define arch_align_stack(x) (x)
137
138extern void die(const char *str, struct pt_regs *fp, unsigned long err);
139
140#endif /* _H8300_SYSTEM_H */
diff --git a/arch/h8300/kernel/irq.c b/arch/h8300/kernel/irq.c
index 1f67fed476a..2fa8ac7b79b 100644
--- a/arch/h8300/kernel/irq.c
+++ b/arch/h8300/kernel/irq.c
@@ -16,7 +16,6 @@
16#include <linux/irq.h> 16#include <linux/irq.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18 18
19#include <asm/system.h>
20#include <asm/traps.h> 19#include <asm/traps.h>
21#include <asm/io.h> 20#include <asm/io.h>
22#include <asm/setup.h> 21#include <asm/setup.h>
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index 1a173b35f47..0e9c315be10 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -38,7 +38,6 @@
38#include <linux/slab.h> 38#include <linux/slab.h>
39 39
40#include <asm/uaccess.h> 40#include <asm/uaccess.h>
41#include <asm/system.h>
42#include <asm/traps.h> 41#include <asm/traps.h>
43#include <asm/setup.h> 42#include <asm/setup.h>
44#include <asm/pgtable.h> 43#include <asm/pgtable.h>
diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c
index 497fa89b5df..748cf6585aa 100644
--- a/arch/h8300/kernel/ptrace.c
+++ b/arch/h8300/kernel/ptrace.c
@@ -27,7 +27,6 @@
27#include <asm/uaccess.h> 27#include <asm/uaccess.h>
28#include <asm/page.h> 28#include <asm/page.h>
29#include <asm/pgtable.h> 29#include <asm/pgtable.h>
30#include <asm/system.h>
31#include <asm/processor.h> 30#include <asm/processor.h>
32#include <asm/signal.h> 31#include <asm/signal.h>
33 32
diff --git a/arch/h8300/kernel/traps.c b/arch/h8300/kernel/traps.c
index dfa05bd908b..7833aa3e7c7 100644
--- a/arch/h8300/kernel/traps.c
+++ b/arch/h8300/kernel/traps.c
@@ -22,7 +22,6 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/bug.h> 23#include <linux/bug.h>
24 24
25#include <asm/system.h>
26#include <asm/irq.h> 25#include <asm/irq.h>
27#include <asm/traps.h> 26#include <asm/traps.h>
28#include <asm/page.h> 27#include <asm/page.h>
diff --git a/arch/h8300/mm/fault.c b/arch/h8300/mm/fault.c
index 1d092abebf0..47253597700 100644
--- a/arch/h8300/mm/fault.c
+++ b/arch/h8300/mm/fault.c
@@ -17,7 +17,6 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/ptrace.h> 18#include <linux/ptrace.h>
19 19
20#include <asm/system.h>
21#include <asm/pgtable.h> 20#include <asm/pgtable.h>
22 21
23/* 22/*
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 7cc3380f250..973369c32a9 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -36,7 +36,6 @@
36#include <asm/segment.h> 36#include <asm/segment.h>
37#include <asm/page.h> 37#include <asm/page.h>
38#include <asm/pgtable.h> 38#include <asm/pgtable.h>
39#include <asm/system.h>
40 39
41#undef DEBUG 40#undef DEBUG
42 41
diff --git a/arch/h8300/mm/kmap.c b/arch/h8300/mm/kmap.c
index 944a502c2e5..f79edcdadf3 100644
--- a/arch/h8300/mm/kmap.c
+++ b/arch/h8300/mm/kmap.c
@@ -19,7 +19,6 @@
19#include <asm/page.h> 19#include <asm/page.h>
20#include <asm/pgalloc.h> 20#include <asm/pgalloc.h>
21#include <asm/io.h> 21#include <asm/io.h>
22#include <asm/system.h>
23 22
24#undef DEBUG 23#undef DEBUG
25 24
diff --git a/arch/h8300/mm/memory.c b/arch/h8300/mm/memory.c
index 5552ddfaab5..06e36464139 100644
--- a/arch/h8300/mm/memory.c
+++ b/arch/h8300/mm/memory.c
@@ -26,7 +26,6 @@
26#include <asm/segment.h> 26#include <asm/segment.h>
27#include <asm/page.h> 27#include <asm/page.h>
28#include <asm/pgtable.h> 28#include <asm/pgtable.h>
29#include <asm/system.h>
30#include <asm/traps.h> 29#include <asm/traps.h>
31#include <asm/io.h> 30#include <asm/io.h>
32 31
diff --git a/arch/hexagon/include/asm/atomic.h b/arch/hexagon/include/asm/atomic.h
index e220f905303..3e258043337 100644
--- a/arch/hexagon/include/asm/atomic.h
+++ b/arch/hexagon/include/asm/atomic.h
@@ -23,6 +23,7 @@
23#define _ASM_ATOMIC_H 23#define _ASM_ATOMIC_H
24 24
25#include <linux/types.h> 25#include <linux/types.h>
26#include <asm/cmpxchg.h>
26 27
27#define ATOMIC_INIT(i) { (i) } 28#define ATOMIC_INIT(i) { (i) }
28#define atomic_set(v, i) ((v)->counter = (i)) 29#define atomic_set(v, i) ((v)->counter = (i))
diff --git a/arch/hexagon/include/asm/barrier.h b/arch/hexagon/include/asm/barrier.h
new file mode 100644
index 00000000000..a4ed6e26cb1
--- /dev/null
+++ b/arch/hexagon/include/asm/barrier.h
@@ -0,0 +1,41 @@
1/*
2 * Memory barrier definitions for the Hexagon architecture
3 *
4 * Copyright (c) 2010-2011, Code Aurora Forum. 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 version 2 and
8 * only version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA.
19 */
20
21#ifndef _ASM_BARRIER_H
22#define _ASM_BARRIER_H
23
24#define rmb() barrier()
25#define read_barrier_depends() barrier()
26#define wmb() barrier()
27#define mb() barrier()
28#define smp_rmb() barrier()
29#define smp_read_barrier_depends() barrier()
30#define smp_wmb() barrier()
31#define smp_mb() barrier()
32#define smp_mb__before_atomic_dec() barrier()
33#define smp_mb__after_atomic_dec() barrier()
34#define smp_mb__before_atomic_inc() barrier()
35#define smp_mb__after_atomic_inc() barrier()
36
37/* Set a value and use a memory barrier. Used by the scheduler somewhere. */
38#define set_mb(var, value) \
39 do { var = value; mb(); } while (0)
40
41#endif /* _ASM_BARRIER_H */
diff --git a/arch/hexagon/include/asm/bitops.h b/arch/hexagon/include/asm/bitops.h
index d23461e080f..4caa649ad78 100644
--- a/arch/hexagon/include/asm/bitops.h
+++ b/arch/hexagon/include/asm/bitops.h
@@ -24,7 +24,6 @@
24 24
25#include <linux/compiler.h> 25#include <linux/compiler.h>
26#include <asm/byteorder.h> 26#include <asm/byteorder.h>
27#include <asm/system.h>
28#include <asm/atomic.h> 27#include <asm/atomic.h>
29 28
30#ifdef __KERNEL__ 29#ifdef __KERNEL__
diff --git a/arch/hexagon/include/asm/system.h b/arch/hexagon/include/asm/cmpxchg.h
index 323ed1dd65e..c5f9527e1df 100644
--- a/arch/hexagon/include/asm/system.h
+++ b/arch/hexagon/include/asm/cmpxchg.h
@@ -1,8 +1,9 @@
1/* 1/*
2 * System level definitions for the Hexagon architecture 2 * xchg/cmpxchg operations for the Hexagon architecture
3 * 3 *
4 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. 4 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
5 * 5 *
6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and 8 * it under the terms of the GNU General Public License version 2 and
8 * only version 2 as published by the Free Software Foundation. 9 * only version 2 as published by the Free Software Foundation.
@@ -18,37 +19,8 @@
18 * 02110-1301, USA. 19 * 02110-1301, USA.
19 */ 20 */
20 21
21#ifndef _ASM_SYSTEM_H 22#ifndef _ASM_CMPXCHG_H
22#define _ASM_SYSTEM_H 23#define _ASM_CMPXCHG_H
23
24#include <linux/linkage.h>
25#include <linux/irqflags.h>
26#include <asm/atomic.h>
27#include <asm/hexagon_vm.h>
28
29struct thread_struct;
30
31extern struct task_struct *__switch_to(struct task_struct *,
32 struct task_struct *,
33 struct task_struct *);
34
35#define switch_to(p, n, r) do {\
36 r = __switch_to((p), (n), (r));\
37} while (0)
38
39
40#define rmb() barrier()
41#define read_barrier_depends() barrier()
42#define wmb() barrier()
43#define mb() barrier()
44#define smp_rmb() barrier()
45#define smp_read_barrier_depends() barrier()
46#define smp_wmb() barrier()
47#define smp_mb() barrier()
48#define smp_mb__before_atomic_dec() barrier()
49#define smp_mb__after_atomic_dec() barrier()
50#define smp_mb__before_atomic_inc() barrier()
51#define smp_mb__after_atomic_inc() barrier()
52 24
53/* 25/*
54 * __xchg - atomically exchange a register and a memory location 26 * __xchg - atomically exchange a register and a memory location
@@ -87,10 +59,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
87#define xchg(ptr, v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v), (ptr), \ 59#define xchg(ptr, v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v), (ptr), \
88 sizeof(*(ptr)))) 60 sizeof(*(ptr))))
89 61
90/* Set a value and use a memory barrier. Used by the scheduler somewhere. */
91#define set_mb(var, value) \
92 do { var = value; mb(); } while (0)
93
94/* 62/*
95 * see rt-mutex-design.txt; cmpxchg supposedly checks if *ptr == A and swaps. 63 * see rt-mutex-design.txt; cmpxchg supposedly checks if *ptr == A and swaps.
96 * looks just like atomic_cmpxchg on our arch currently with a bunch of 64 * looks just like atomic_cmpxchg on our arch currently with a bunch of
@@ -119,8 +87,4 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
119 __oldval; \ 87 __oldval; \
120}) 88})
121 89
122/* Should probably shoot for an 8-byte aligned stack pointer */ 90#endif /* _ASM_CMPXCHG_H */
123#define STACK_MASK (~7)
124#define arch_align_stack(x) (x & STACK_MASK)
125
126#endif
diff --git a/arch/hexagon/include/asm/exec.h b/arch/hexagon/include/asm/exec.h
new file mode 100644
index 00000000000..350e6d497d4
--- /dev/null
+++ b/arch/hexagon/include/asm/exec.h
@@ -0,0 +1,28 @@
1/*
2 * Process execution related definitions for the Hexagon architecture
3 *
4 * Copyright (c) 2010-2011, Code Aurora Forum. 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 version 2 and
8 * only version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA.
19 */
20
21#ifndef _ASM_EXEC_H
22#define _ASM_EXEC_H
23
24/* Should probably shoot for an 8-byte aligned stack pointer */
25#define STACK_MASK (~7)
26#define arch_align_stack(x) (x & STACK_MASK)
27
28#endif /* _ASM_EXEC_H */
diff --git a/arch/hexagon/include/asm/switch_to.h b/arch/hexagon/include/asm/switch_to.h
new file mode 100644
index 00000000000..28ca0dfb606
--- /dev/null
+++ b/arch/hexagon/include/asm/switch_to.h
@@ -0,0 +1,34 @@
1/*
2 * Task switching definitions for the Hexagon architecture
3 *
4 * Copyright (c) 2010-2011, Code Aurora Forum. 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 version 2 and
8 * only version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA.
19 */
20
21#ifndef _ASM_SWITCH_TO_H
22#define _ASM_SWITCH_TO_H
23
24struct thread_struct;
25
26extern struct task_struct *__switch_to(struct task_struct *,
27 struct task_struct *,
28 struct task_struct *);
29
30#define switch_to(p, n, r) do {\
31 r = __switch_to((p), (n), (r));\
32} while (0)
33
34#endif /* _ASM_SWITCH_TO_H */
diff --git a/arch/hexagon/kernel/ptrace.c b/arch/hexagon/kernel/ptrace.c
index bea3f08470f..32342de1a79 100644
--- a/arch/hexagon/kernel/ptrace.c
+++ b/arch/hexagon/kernel/ptrace.c
@@ -29,7 +29,6 @@
29#include <linux/regset.h> 29#include <linux/regset.h>
30#include <linux/user.h> 30#include <linux/user.h>
31 31
32#include <asm/system.h>
33#include <asm/user.h> 32#include <asm/user.h>
34 33
35static int genregs_get(struct task_struct *target, 34static int genregs_get(struct task_struct *target,
diff --git a/arch/hexagon/kernel/smp.c b/arch/hexagon/kernel/smp.c
index 0123c63e9a3..15d1fd22bbc 100644
--- a/arch/hexagon/kernel/smp.c
+++ b/arch/hexagon/kernel/smp.c
@@ -29,7 +29,6 @@
29#include <linux/smp.h> 29#include <linux/smp.h>
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31 31
32#include <asm/system.h> /* xchg */
33#include <asm/time.h> /* timer_interrupt */ 32#include <asm/time.h> /* timer_interrupt */
34#include <asm/hexagon_vm.h> 33#include <asm/hexagon_vm.h>
35 34
diff --git a/arch/hexagon/kernel/vm_events.c b/arch/hexagon/kernel/vm_events.c
index 986a081e32e..591fc1b6863 100644
--- a/arch/hexagon/kernel/vm_events.c
+++ b/arch/hexagon/kernel/vm_events.c
@@ -22,7 +22,6 @@
22#include <asm/registers.h> 22#include <asm/registers.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/hardirq.h> 24#include <linux/hardirq.h>
25#include <asm/system.h>
26 25
27/* 26/*
28 * show_regs - print pt_regs structure 27 * show_regs - print pt_regs structure
diff --git a/arch/ia64/dig/setup.c b/arch/ia64/dig/setup.c
index 9196b330ff7..98131e1db7a 100644
--- a/arch/ia64/dig/setup.c
+++ b/arch/ia64/dig/setup.c
@@ -22,7 +22,7 @@
22 22
23#include <asm/io.h> 23#include <asm/io.h>
24#include <asm/machvec.h> 24#include <asm/machvec.h>
25#include <asm/system.h> 25#include <asm/setup.h>
26 26
27void __init 27void __init
28dig_setup (char **cmdline_p) 28dig_setup (char **cmdline_p)
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index f5f4ef149aa..f6ea3a3b4a8 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -43,7 +43,6 @@
43#include <asm/io.h> 43#include <asm/io.h>
44#include <asm/page.h> /* PAGE_OFFSET */ 44#include <asm/page.h> /* PAGE_OFFSET */
45#include <asm/dma.h> 45#include <asm/dma.h>
46#include <asm/system.h> /* wmb() */
47 46
48#include <asm/acpi-ext.h> 47#include <asm/acpi-ext.h>
49 48
diff --git a/arch/ia64/hp/sim/boot/bootloader.c b/arch/ia64/hp/sim/boot/bootloader.c
index c5e9baafafe..28f4b230b8c 100644
--- a/arch/ia64/hp/sim/boot/bootloader.c
+++ b/arch/ia64/hp/sim/boot/bootloader.c
@@ -20,7 +20,6 @@ struct task_struct; /* forward declaration for elf.h */
20#include <asm/pal.h> 20#include <asm/pal.h>
21#include <asm/pgtable.h> 21#include <asm/pgtable.h>
22#include <asm/sal.h> 22#include <asm/sal.h>
23#include <asm/system.h>
24 23
25#include "ssc.h" 24#include "ssc.h"
26 25
diff --git a/arch/ia64/hp/sim/boot/fw-emu.c b/arch/ia64/hp/sim/boot/fw-emu.c
index 0216e28300f..271f412bda1 100644
--- a/arch/ia64/hp/sim/boot/fw-emu.c
+++ b/arch/ia64/hp/sim/boot/fw-emu.c
@@ -13,6 +13,7 @@
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/pal.h> 14#include <asm/pal.h>
15#include <asm/sal.h> 15#include <asm/sal.h>
16#include <asm/setup.h>
16 17
17#include "ssc.h" 18#include "ssc.h"
18 19
diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c
index a63218e1f6c..c13064e422d 100644
--- a/arch/ia64/hp/sim/simeth.c
+++ b/arch/ia64/hp/sim/simeth.c
@@ -20,7 +20,6 @@
20#include <linux/skbuff.h> 20#include <linux/skbuff.h>
21#include <linux/notifier.h> 21#include <linux/notifier.h>
22#include <linux/bitops.h> 22#include <linux/bitops.h>
23#include <asm/system.h>
24#include <asm/irq.h> 23#include <asm/irq.h>
25#include <asm/hpsim.h> 24#include <asm/hpsim.h>
26 25
diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h
index a06dfb13d51..301609c3fce 100644
--- a/arch/ia64/include/asm/acpi.h
+++ b/arch/ia64/include/asm/acpi.h
@@ -32,7 +32,6 @@
32 32
33#include <linux/init.h> 33#include <linux/init.h>
34#include <linux/numa.h> 34#include <linux/numa.h>
35#include <asm/system.h>
36#include <asm/numa.h> 35#include <asm/numa.h>
37 36
38#define COMPILER_DEPENDENT_INT64 long 37#define COMPILER_DEPENDENT_INT64 long
diff --git a/arch/ia64/include/asm/atomic.h b/arch/ia64/include/asm/atomic.h
index 3fad89ee01c..7d9116600a3 100644
--- a/arch/ia64/include/asm/atomic.h
+++ b/arch/ia64/include/asm/atomic.h
@@ -15,7 +15,6 @@
15#include <linux/types.h> 15#include <linux/types.h>
16 16
17#include <asm/intrinsics.h> 17#include <asm/intrinsics.h>
18#include <asm/system.h>
19 18
20 19
21#define ATOMIC_INIT(i) ((atomic_t) { (i) }) 20#define ATOMIC_INIT(i) ((atomic_t) { (i) })
diff --git a/arch/ia64/include/asm/auxvec.h b/arch/ia64/include/asm/auxvec.h
index 23cebe5685b..58277fc650e 100644
--- a/arch/ia64/include/asm/auxvec.h
+++ b/arch/ia64/include/asm/auxvec.h
@@ -8,4 +8,6 @@
8#define AT_SYSINFO 32 8#define AT_SYSINFO 32
9#define AT_SYSINFO_EHDR 33 9#define AT_SYSINFO_EHDR 33
10 10
11#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */
12
11#endif /* _ASM_IA64_AUXVEC_H */ 13#endif /* _ASM_IA64_AUXVEC_H */
diff --git a/arch/ia64/include/asm/barrier.h b/arch/ia64/include/asm/barrier.h
new file mode 100644
index 00000000000..60576e06b6f
--- /dev/null
+++ b/arch/ia64/include/asm/barrier.h
@@ -0,0 +1,68 @@
1/*
2 * Memory barrier definitions. This is based on information published
3 * in the Processor Abstraction Layer and the System Abstraction Layer
4 * manual.
5 *
6 * Copyright (C) 1998-2003 Hewlett-Packard Co
7 * David Mosberger-Tang <davidm@hpl.hp.com>
8 * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
9 * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
10 */
11#ifndef _ASM_IA64_BARRIER_H
12#define _ASM_IA64_BARRIER_H
13
14#include <linux/compiler.h>
15
16/*
17 * Macros to force memory ordering. In these descriptions, "previous"
18 * and "subsequent" refer to program order; "visible" means that all
19 * architecturally visible effects of a memory access have occurred
20 * (at a minimum, this means the memory has been read or written).
21 *
22 * wmb(): Guarantees that all preceding stores to memory-
23 * like regions are visible before any subsequent
24 * stores and that all following stores will be
25 * visible only after all previous stores.
26 * rmb(): Like wmb(), but for reads.
27 * mb(): wmb()/rmb() combo, i.e., all previous memory
28 * accesses are visible before all subsequent
29 * accesses and vice versa. This is also known as
30 * a "fence."
31 *
32 * Note: "mb()" and its variants cannot be used as a fence to order
33 * accesses to memory mapped I/O registers. For that, mf.a needs to
34 * be used. However, we don't want to always use mf.a because (a)
35 * it's (presumably) much slower than mf and (b) mf.a is supported for
36 * sequential memory pages only.
37 */
38#define mb() ia64_mf()
39#define rmb() mb()
40#define wmb() mb()
41#define read_barrier_depends() do { } while(0)
42
43#ifdef CONFIG_SMP
44# define smp_mb() mb()
45# define smp_rmb() rmb()
46# define smp_wmb() wmb()
47# define smp_read_barrier_depends() read_barrier_depends()
48#else
49# define smp_mb() barrier()
50# define smp_rmb() barrier()
51# define smp_wmb() barrier()
52# define smp_read_barrier_depends() do { } while(0)
53#endif
54
55/*
56 * XXX check on this ---I suspect what Linus really wants here is
57 * acquire vs release semantics but we can't discuss this stuff with
58 * Linus just yet. Grrr...
59 */
60#define set_mb(var, value) do { (var) = (value); mb(); } while (0)
61
62/*
63 * The group barrier in front of the rsm & ssm are necessary to ensure
64 * that none of the previous instructions in the same group are
65 * affected by the rsm/ssm.
66 */
67
68#endif /* _ASM_IA64_BARRIER_H */
diff --git a/arch/ia64/include/asm/exec.h b/arch/ia64/include/asm/exec.h
new file mode 100644
index 00000000000..b26242490e3
--- /dev/null
+++ b/arch/ia64/include/asm/exec.h
@@ -0,0 +1,14 @@
1/*
2 * Process execution defines.
3 *
4 * Copyright (C) 1998-2003 Hewlett-Packard Co
5 * David Mosberger-Tang <davidm@hpl.hp.com>
6 * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
7 * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
8 */
9#ifndef _ASM_IA64_EXEC_H
10#define _ASM_IA64_EXEC_H
11
12#define arch_align_stack(x) (x)
13
14#endif /* _ASM_IA64_EXEC_H */
diff --git a/arch/ia64/include/asm/futex.h b/arch/ia64/include/asm/futex.h
index 8428525ddb2..0ab82cc2dc8 100644
--- a/arch/ia64/include/asm/futex.h
+++ b/arch/ia64/include/asm/futex.h
@@ -4,7 +4,6 @@
4#include <linux/futex.h> 4#include <linux/futex.h>
5#include <linux/uaccess.h> 5#include <linux/uaccess.h>
6#include <asm/errno.h> 6#include <asm/errno.h>
7#include <asm/system.h>
8 7
9#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \ 8#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \
10do { \ 9do { \
diff --git a/arch/ia64/include/asm/io.h b/arch/ia64/include/asm/io.h
index e5a6c3530c6..2c26321c28c 100644
--- a/arch/ia64/include/asm/io.h
+++ b/arch/ia64/include/asm/io.h
@@ -71,7 +71,6 @@ extern unsigned int num_io_spaces;
71#include <asm/intrinsics.h> 71#include <asm/intrinsics.h>
72#include <asm/machvec.h> 72#include <asm/machvec.h>
73#include <asm/page.h> 73#include <asm/page.h>
74#include <asm/system.h>
75#include <asm-generic/iomap.h> 74#include <asm-generic/iomap.h>
76 75
77/* 76/*
diff --git a/arch/ia64/include/asm/irqflags.h b/arch/ia64/include/asm/irqflags.h
index f82d6be2ecd..2b68d856dc7 100644
--- a/arch/ia64/include/asm/irqflags.h
+++ b/arch/ia64/include/asm/irqflags.h
@@ -10,6 +10,8 @@
10#ifndef _ASM_IA64_IRQFLAGS_H 10#ifndef _ASM_IA64_IRQFLAGS_H
11#define _ASM_IA64_IRQFLAGS_H 11#define _ASM_IA64_IRQFLAGS_H
12 12
13#include <asm/pal.h>
14
13#ifdef CONFIG_IA64_DEBUG_IRQ 15#ifdef CONFIG_IA64_DEBUG_IRQ
14extern unsigned long last_cli_ip; 16extern unsigned long last_cli_ip;
15static inline void arch_maybe_save_ip(unsigned long flags) 17static inline void arch_maybe_save_ip(unsigned long flags)
diff --git a/arch/ia64/include/asm/kexec.h b/arch/ia64/include/asm/kexec.h
index e1d58f819d7..aea2b81b03a 100644
--- a/arch/ia64/include/asm/kexec.h
+++ b/arch/ia64/include/asm/kexec.h
@@ -1,6 +1,7 @@
1#ifndef _ASM_IA64_KEXEC_H 1#ifndef _ASM_IA64_KEXEC_H
2#define _ASM_IA64_KEXEC_H 2#define _ASM_IA64_KEXEC_H
3 3
4#include <asm/setup.h>
4 5
5/* Maximum physical address we can use pages from */ 6/* Maximum physical address we can use pages from */
6#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL) 7#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
diff --git a/arch/ia64/include/asm/mca_asm.h b/arch/ia64/include/asm/mca_asm.h
index dd2a5b13439..13c1d4994d4 100644
--- a/arch/ia64/include/asm/mca_asm.h
+++ b/arch/ia64/include/asm/mca_asm.h
@@ -15,6 +15,8 @@
15#ifndef _ASM_IA64_MCA_ASM_H 15#ifndef _ASM_IA64_MCA_ASM_H
16#define _ASM_IA64_MCA_ASM_H 16#define _ASM_IA64_MCA_ASM_H
17 17
18#include <asm/percpu.h>
19
18#define PSR_IC 13 20#define PSR_IC 13
19#define PSR_I 14 21#define PSR_I 14
20#define PSR_DT 17 22#define PSR_DT 17
diff --git a/arch/ia64/include/asm/page.h b/arch/ia64/include/asm/page.h
index 961a16f43e6..f1e1b2e3cdb 100644
--- a/arch/ia64/include/asm/page.h
+++ b/arch/ia64/include/asm/page.h
@@ -221,4 +221,14 @@ get_order (unsigned long size)
221 (((current->personality & READ_IMPLIES_EXEC) != 0) \ 221 (((current->personality & READ_IMPLIES_EXEC) != 0) \
222 ? VM_EXEC : 0)) 222 ? VM_EXEC : 0))
223 223
224#define GATE_ADDR RGN_BASE(RGN_GATE)
225
226/*
227 * 0xa000000000000000+2*PERCPU_PAGE_SIZE
228 * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page)
229 */
230#define KERNEL_START (GATE_ADDR+__IA64_UL_CONST(0x100000000))
231#define PERCPU_ADDR (-PERCPU_PAGE_SIZE)
232#define LOAD_OFFSET (KERNEL_START - KERNEL_TR_PAGE_SIZE)
233
224#endif /* _ASM_IA64_PAGE_H */ 234#endif /* _ASM_IA64_PAGE_H */
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
index b22e5f5fa59..5e04b591e42 100644
--- a/arch/ia64/include/asm/pci.h
+++ b/arch/ia64/include/asm/pci.h
@@ -11,6 +11,14 @@
11#include <asm/scatterlist.h> 11#include <asm/scatterlist.h>
12#include <asm/hw_irq.h> 12#include <asm/hw_irq.h>
13 13
14struct pci_vector_struct {
15 __u16 segment; /* PCI Segment number */
16 __u16 bus; /* PCI Bus number */
17 __u32 pci_id; /* ACPI split 16 bits device, 16 bits function (see section 6.1.1) */
18 __u8 pin; /* PCI PIN (0 = A, 1 = B, 2 = C, 3 = D) */
19 __u32 irq; /* IRQ assigned */
20};
21
14/* 22/*
15 * Can be used to override the logic in pci_scan_bus for skipping already-configured bus 23 * Can be used to override the logic in pci_scan_bus for skipping already-configured bus
16 * numbers - to be used for buggy BIOSes or architectures with incomplete PCI setup by the 24 * numbers - to be used for buggy BIOSes or architectures with incomplete PCI setup by the
diff --git a/arch/ia64/include/asm/pgtable.h b/arch/ia64/include/asm/pgtable.h
index 1a97af31ef1..815810cbbed 100644
--- a/arch/ia64/include/asm/pgtable.h
+++ b/arch/ia64/include/asm/pgtable.h
@@ -16,7 +16,6 @@
16#include <asm/mman.h> 16#include <asm/mman.h>
17#include <asm/page.h> 17#include <asm/page.h>
18#include <asm/processor.h> 18#include <asm/processor.h>
19#include <asm/system.h>
20#include <asm/types.h> 19#include <asm/types.h>
21 20
22#define IA64_MAX_PHYS_BITS 50 /* max. number of physical address bits (architected) */ 21#define IA64_MAX_PHYS_BITS 50 /* max. number of physical address bits (architected) */
diff --git a/arch/ia64/include/asm/processor.h b/arch/ia64/include/asm/processor.h
index 691be0b95c1..483f6c6a423 100644
--- a/arch/ia64/include/asm/processor.h
+++ b/arch/ia64/include/asm/processor.h
@@ -19,6 +19,9 @@
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/ustack.h> 20#include <asm/ustack.h>
21 21
22#define __ARCH_WANT_UNLOCKED_CTXSW
23#define ARCH_HAS_PREFETCH_SWITCH_STACK
24
22#define IA64_NUM_PHYS_STACK_REG 96 25#define IA64_NUM_PHYS_STACK_REG 96
23#define IA64_NUM_DBG_REGS 8 26#define IA64_NUM_DBG_REGS 8
24 27
@@ -720,6 +723,11 @@ extern unsigned long boot_option_idle_override;
720enum idle_boot_override {IDLE_NO_OVERRIDE=0, IDLE_HALT, IDLE_FORCE_MWAIT, 723enum idle_boot_override {IDLE_NO_OVERRIDE=0, IDLE_HALT, IDLE_FORCE_MWAIT,
721 IDLE_NOMWAIT, IDLE_POLL}; 724 IDLE_NOMWAIT, IDLE_POLL};
722 725
726void cpu_idle_wait(void);
727void default_idle(void);
728
729#define ia64_platform_is(x) (strcmp(x, platform_name) == 0)
730
723#endif /* !__ASSEMBLY__ */ 731#endif /* !__ASSEMBLY__ */
724 732
725#endif /* _ASM_IA64_PROCESSOR_H */ 733#endif /* _ASM_IA64_PROCESSOR_H */
diff --git a/arch/ia64/include/asm/sal.h b/arch/ia64/include/asm/sal.h
index d19ddba4e32..e504f382115 100644
--- a/arch/ia64/include/asm/sal.h
+++ b/arch/ia64/include/asm/sal.h
@@ -40,7 +40,6 @@
40#include <linux/efi.h> 40#include <linux/efi.h>
41 41
42#include <asm/pal.h> 42#include <asm/pal.h>
43#include <asm/system.h>
44#include <asm/fpu.h> 43#include <asm/fpu.h>
45 44
46extern spinlock_t sal_lock; 45extern spinlock_t sal_lock;
diff --git a/arch/ia64/include/asm/setup.h b/arch/ia64/include/asm/setup.h
index 4399a44355b..8d56458310b 100644
--- a/arch/ia64/include/asm/setup.h
+++ b/arch/ia64/include/asm/setup.h
@@ -3,4 +3,22 @@
3 3
4#define COMMAND_LINE_SIZE 2048 4#define COMMAND_LINE_SIZE 2048
5 5
6extern struct ia64_boot_param {
7 __u64 command_line; /* physical address of command line arguments */
8 __u64 efi_systab; /* physical address of EFI system table */
9 __u64 efi_memmap; /* physical address of EFI memory map */
10 __u64 efi_memmap_size; /* size of EFI memory map */
11 __u64 efi_memdesc_size; /* size of an EFI memory map descriptor */
12 __u32 efi_memdesc_version; /* memory descriptor version */
13 struct {
14 __u16 num_cols; /* number of columns on console output device */
15 __u16 num_rows; /* number of rows on console output device */
16 __u16 orig_x; /* cursor's x position */
17 __u16 orig_y; /* cursor's y position */
18 } console_info;
19 __u64 fpswa; /* physical address of the fpswa interface */
20 __u64 initrd_start;
21 __u64 initrd_size;
22} *ia64_boot_param;
23
6#endif 24#endif
diff --git a/arch/ia64/include/asm/sn/pda.h b/arch/ia64/include/asm/sn/pda.h
index 1c5108d44d8..22ae358c8d1 100644
--- a/arch/ia64/include/asm/sn/pda.h
+++ b/arch/ia64/include/asm/sn/pda.h
@@ -10,7 +10,6 @@
10 10
11#include <linux/cache.h> 11#include <linux/cache.h>
12#include <asm/percpu.h> 12#include <asm/percpu.h>
13#include <asm/system.h>
14 13
15 14
16/* 15/*
diff --git a/arch/ia64/include/asm/spinlock.h b/arch/ia64/include/asm/spinlock.h
index b77768d35f9..54ff557d474 100644
--- a/arch/ia64/include/asm/spinlock.h
+++ b/arch/ia64/include/asm/spinlock.h
@@ -15,7 +15,6 @@
15 15
16#include <linux/atomic.h> 16#include <linux/atomic.h>
17#include <asm/intrinsics.h> 17#include <asm/intrinsics.h>
18#include <asm/system.h>
19 18
20#define arch_spin_lock_init(x) ((x)->lock = 0) 19#define arch_spin_lock_init(x) ((x)->lock = 0)
21 20
diff --git a/arch/ia64/include/asm/switch_to.h b/arch/ia64/include/asm/switch_to.h
new file mode 100644
index 00000000000..cb2412fcd17
--- /dev/null
+++ b/arch/ia64/include/asm/switch_to.h
@@ -0,0 +1,87 @@
1/*
2 * Low-level task switching. This is based on information published in
3 * the Processor Abstraction Layer and the System Abstraction Layer
4 * manual.
5 *
6 * Copyright (C) 1998-2003 Hewlett-Packard Co
7 * David Mosberger-Tang <davidm@hpl.hp.com>
8 * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
9 * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
10 */
11#ifndef _ASM_IA64_SWITCH_TO_H
12#define _ASM_IA64_SWITCH_TO_H
13
14#include <linux/percpu.h>
15
16struct task_struct;
17
18/*
19 * Context switch from one thread to another. If the two threads have
20 * different address spaces, schedule() has already taken care of
21 * switching to the new address space by calling switch_mm().
22 *
23 * Disabling access to the fph partition and the debug-register
24 * context switch MUST be done before calling ia64_switch_to() since a
25 * newly created thread returns directly to
26 * ia64_ret_from_syscall_clear_r8.
27 */
28extern struct task_struct *ia64_switch_to (void *next_task);
29
30extern void ia64_save_extra (struct task_struct *task);
31extern void ia64_load_extra (struct task_struct *task);
32
33#ifdef CONFIG_VIRT_CPU_ACCOUNTING
34extern void ia64_account_on_switch (struct task_struct *prev, struct task_struct *next);
35# define IA64_ACCOUNT_ON_SWITCH(p,n) ia64_account_on_switch(p,n)
36#else
37# define IA64_ACCOUNT_ON_SWITCH(p,n)
38#endif
39
40#ifdef CONFIG_PERFMON
41 DECLARE_PER_CPU(unsigned long, pfm_syst_info);
42# define PERFMON_IS_SYSWIDE() (__get_cpu_var(pfm_syst_info) & 0x1)
43#else
44# define PERFMON_IS_SYSWIDE() (0)
45#endif
46
47#define IA64_HAS_EXTRA_STATE(t) \
48 ((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID) \
49 || PERFMON_IS_SYSWIDE())
50
51#define __switch_to(prev,next,last) do { \
52 IA64_ACCOUNT_ON_SWITCH(prev, next); \
53 if (IA64_HAS_EXTRA_STATE(prev)) \
54 ia64_save_extra(prev); \
55 if (IA64_HAS_EXTRA_STATE(next)) \
56 ia64_load_extra(next); \
57 ia64_psr(task_pt_regs(next))->dfh = !ia64_is_local_fpu_owner(next); \
58 (last) = ia64_switch_to((next)); \
59} while (0)
60
61#ifdef CONFIG_SMP
62/*
63 * In the SMP case, we save the fph state when context-switching away from a thread that
64 * modified fph. This way, when the thread gets scheduled on another CPU, the CPU can
65 * pick up the state from task->thread.fph, avoiding the complication of having to fetch
66 * the latest fph state from another CPU. In other words: eager save, lazy restore.
67 */
68# define switch_to(prev,next,last) do { \
69 if (ia64_psr(task_pt_regs(prev))->mfh && ia64_is_local_fpu_owner(prev)) { \
70 ia64_psr(task_pt_regs(prev))->mfh = 0; \
71 (prev)->thread.flags |= IA64_THREAD_FPH_VALID; \
72 __ia64_save_fpu((prev)->thread.fph); \
73 } \
74 __switch_to(prev, next, last); \
75 /* "next" in old context is "current" in new context */ \
76 if (unlikely((current->thread.flags & IA64_THREAD_MIGRATION) && \
77 (task_cpu(current) != \
78 task_thread_info(current)->last_cpu))) { \
79 platform_migrate(current); \
80 task_thread_info(current)->last_cpu = task_cpu(current); \
81 } \
82} while (0)
83#else
84# define switch_to(prev,next,last) __switch_to(prev, next, last)
85#endif
86
87#endif /* _ASM_IA64_SWITCH_TO_H */
diff --git a/arch/ia64/include/asm/system.h b/arch/ia64/include/asm/system.h
deleted file mode 100644
index 6cca30705d5..00000000000
--- a/arch/ia64/include/asm/system.h
+++ /dev/null
@@ -1,203 +0,0 @@
1#ifndef _ASM_IA64_SYSTEM_H
2#define _ASM_IA64_SYSTEM_H
3
4/*
5 * System defines. Note that this is included both from .c and .S
6 * files, so it does only defines, not any C code. This is based
7 * on information published in the Processor Abstraction Layer
8 * and the System Abstraction Layer manual.
9 *
10 * Copyright (C) 1998-2003 Hewlett-Packard Co
11 * David Mosberger-Tang <davidm@hpl.hp.com>
12 * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
13 * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
14 */
15
16#include <asm/kregs.h>
17#include <asm/page.h>
18#include <asm/pal.h>
19#include <asm/percpu.h>
20
21#define GATE_ADDR RGN_BASE(RGN_GATE)
22
23/*
24 * 0xa000000000000000+2*PERCPU_PAGE_SIZE
25 * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page)
26 */
27#define KERNEL_START (GATE_ADDR+__IA64_UL_CONST(0x100000000))
28#define PERCPU_ADDR (-PERCPU_PAGE_SIZE)
29#define LOAD_OFFSET (KERNEL_START - KERNEL_TR_PAGE_SIZE)
30
31#ifndef __ASSEMBLY__
32
33#include <linux/kernel.h>
34#include <linux/types.h>
35
36#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */
37
38struct pci_vector_struct {
39 __u16 segment; /* PCI Segment number */
40 __u16 bus; /* PCI Bus number */
41 __u32 pci_id; /* ACPI split 16 bits device, 16 bits function (see section 6.1.1) */
42 __u8 pin; /* PCI PIN (0 = A, 1 = B, 2 = C, 3 = D) */
43 __u32 irq; /* IRQ assigned */
44};
45
46extern struct ia64_boot_param {
47 __u64 command_line; /* physical address of command line arguments */
48 __u64 efi_systab; /* physical address of EFI system table */
49 __u64 efi_memmap; /* physical address of EFI memory map */
50 __u64 efi_memmap_size; /* size of EFI memory map */
51 __u64 efi_memdesc_size; /* size of an EFI memory map descriptor */
52 __u32 efi_memdesc_version; /* memory descriptor version */
53 struct {
54 __u16 num_cols; /* number of columns on console output device */
55 __u16 num_rows; /* number of rows on console output device */
56 __u16 orig_x; /* cursor's x position */
57 __u16 orig_y; /* cursor's y position */
58 } console_info;
59 __u64 fpswa; /* physical address of the fpswa interface */
60 __u64 initrd_start;
61 __u64 initrd_size;
62} *ia64_boot_param;
63
64/*
65 * Macros to force memory ordering. In these descriptions, "previous"
66 * and "subsequent" refer to program order; "visible" means that all
67 * architecturally visible effects of a memory access have occurred
68 * (at a minimum, this means the memory has been read or written).
69 *
70 * wmb(): Guarantees that all preceding stores to memory-
71 * like regions are visible before any subsequent
72 * stores and that all following stores will be
73 * visible only after all previous stores.
74 * rmb(): Like wmb(), but for reads.
75 * mb(): wmb()/rmb() combo, i.e., all previous memory
76 * accesses are visible before all subsequent
77 * accesses and vice versa. This is also known as
78 * a "fence."
79 *
80 * Note: "mb()" and its variants cannot be used as a fence to order
81 * accesses to memory mapped I/O registers. For that, mf.a needs to
82 * be used. However, we don't want to always use mf.a because (a)
83 * it's (presumably) much slower than mf and (b) mf.a is supported for
84 * sequential memory pages only.
85 */
86#define mb() ia64_mf()
87#define rmb() mb()
88#define wmb() mb()
89#define read_barrier_depends() do { } while(0)
90
91#ifdef CONFIG_SMP
92# define smp_mb() mb()
93# define smp_rmb() rmb()
94# define smp_wmb() wmb()
95# define smp_read_barrier_depends() read_barrier_depends()
96#else
97# define smp_mb() barrier()
98# define smp_rmb() barrier()
99# define smp_wmb() barrier()
100# define smp_read_barrier_depends() do { } while(0)
101#endif
102
103/*
104 * XXX check on this ---I suspect what Linus really wants here is
105 * acquire vs release semantics but we can't discuss this stuff with
106 * Linus just yet. Grrr...
107 */
108#define set_mb(var, value) do { (var) = (value); mb(); } while (0)
109
110/*
111 * The group barrier in front of the rsm & ssm are necessary to ensure
112 * that none of the previous instructions in the same group are
113 * affected by the rsm/ssm.
114 */
115
116#ifdef __KERNEL__
117
118/*
119 * Context switch from one thread to another. If the two threads have
120 * different address spaces, schedule() has already taken care of
121 * switching to the new address space by calling switch_mm().
122 *
123 * Disabling access to the fph partition and the debug-register
124 * context switch MUST be done before calling ia64_switch_to() since a
125 * newly created thread returns directly to
126 * ia64_ret_from_syscall_clear_r8.
127 */
128extern struct task_struct *ia64_switch_to (void *next_task);
129
130struct task_struct;
131
132extern void ia64_save_extra (struct task_struct *task);
133extern void ia64_load_extra (struct task_struct *task);
134
135#ifdef CONFIG_VIRT_CPU_ACCOUNTING
136extern void ia64_account_on_switch (struct task_struct *prev, struct task_struct *next);
137# define IA64_ACCOUNT_ON_SWITCH(p,n) ia64_account_on_switch(p,n)
138#else
139# define IA64_ACCOUNT_ON_SWITCH(p,n)
140#endif
141
142#ifdef CONFIG_PERFMON
143 DECLARE_PER_CPU(unsigned long, pfm_syst_info);
144# define PERFMON_IS_SYSWIDE() (__get_cpu_var(pfm_syst_info) & 0x1)
145#else
146# define PERFMON_IS_SYSWIDE() (0)
147#endif
148
149#define IA64_HAS_EXTRA_STATE(t) \
150 ((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID) \
151 || PERFMON_IS_SYSWIDE())
152
153#define __switch_to(prev,next,last) do { \
154 IA64_ACCOUNT_ON_SWITCH(prev, next); \
155 if (IA64_HAS_EXTRA_STATE(prev)) \
156 ia64_save_extra(prev); \
157 if (IA64_HAS_EXTRA_STATE(next)) \
158 ia64_load_extra(next); \
159 ia64_psr(task_pt_regs(next))->dfh = !ia64_is_local_fpu_owner(next); \
160 (last) = ia64_switch_to((next)); \
161} while (0)
162
163#ifdef CONFIG_SMP
164/*
165 * In the SMP case, we save the fph state when context-switching away from a thread that
166 * modified fph. This way, when the thread gets scheduled on another CPU, the CPU can
167 * pick up the state from task->thread.fph, avoiding the complication of having to fetch
168 * the latest fph state from another CPU. In other words: eager save, lazy restore.
169 */
170# define switch_to(prev,next,last) do { \
171 if (ia64_psr(task_pt_regs(prev))->mfh && ia64_is_local_fpu_owner(prev)) { \
172 ia64_psr(task_pt_regs(prev))->mfh = 0; \
173 (prev)->thread.flags |= IA64_THREAD_FPH_VALID; \
174 __ia64_save_fpu((prev)->thread.fph); \
175 } \
176 __switch_to(prev, next, last); \
177 /* "next" in old context is "current" in new context */ \
178 if (unlikely((current->thread.flags & IA64_THREAD_MIGRATION) && \
179 (task_cpu(current) != \
180 task_thread_info(current)->last_cpu))) { \
181 platform_migrate(current); \
182 task_thread_info(current)->last_cpu = task_cpu(current); \
183 } \
184} while (0)
185#else
186# define switch_to(prev,next,last) __switch_to(prev, next, last)
187#endif
188
189#define __ARCH_WANT_UNLOCKED_CTXSW
190#define ARCH_HAS_PREFETCH_SWITCH_STACK
191#define ia64_platform_is(x) (strcmp(x, platform_name) == 0)
192
193void cpu_idle_wait(void);
194
195#define arch_align_stack(x) (x)
196
197void default_idle(void);
198
199#endif /* __KERNEL__ */
200
201#endif /* __ASSEMBLY__ */
202
203#endif /* _ASM_IA64_SYSTEM_H */
diff --git a/arch/ia64/include/asm/uv/uv.h b/arch/ia64/include/asm/uv/uv.h
index 61b5bdfd980..8f6cbaa742e 100644
--- a/arch/ia64/include/asm/uv/uv.h
+++ b/arch/ia64/include/asm/uv/uv.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_IA64_UV_UV_H 1#ifndef _ASM_IA64_UV_UV_H
2#define _ASM_IA64_UV_UV_H 2#define _ASM_IA64_UV_UV_H
3 3
4#include <asm/system.h>
5#include <asm/sn/simulator.h> 4#include <asm/sn/simulator.h>
6 5
7static inline int is_uv_system(void) 6static inline int is_uv_system(void)
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 2d801bfe16a..d1cc81e63ba 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -50,7 +50,6 @@
50#include <asm/iosapic.h> 50#include <asm/iosapic.h>
51#include <asm/machvec.h> 51#include <asm/machvec.h>
52#include <asm/page.h> 52#include <asm/page.h>
53#include <asm/system.h>
54#include <asm/numa.h> 53#include <asm/numa.h>
55#include <asm/sal.h> 54#include <asm/sal.h>
56#include <asm/cyclone.h> 55#include <asm/cyclone.h>
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index c38d22e5e90..d37bbd48637 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -39,6 +39,7 @@
39#include <asm/pgtable.h> 39#include <asm/pgtable.h>
40#include <asm/processor.h> 40#include <asm/processor.h>
41#include <asm/mca.h> 41#include <asm/mca.h>
42#include <asm/setup.h>
42#include <asm/tlbflush.h> 43#include <asm/tlbflush.h>
43 44
44#define EFI_DEBUG 0 45#define EFI_DEBUG 0
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S
index 331d42bda77..f15d8601827 100644
--- a/arch/ia64/kernel/fsys.S
+++ b/arch/ia64/kernel/fsys.S
@@ -21,7 +21,6 @@
21#include <asm/thread_info.h> 21#include <asm/thread_info.h>
22#include <asm/sal.h> 22#include <asm/sal.h>
23#include <asm/signal.h> 23#include <asm/signal.h>
24#include <asm/system.h>
25#include <asm/unistd.h> 24#include <asm/unistd.h>
26 25
27#include "entry.h" 26#include "entry.h"
diff --git a/arch/ia64/kernel/gate.S b/arch/ia64/kernel/gate.S
index 245d3e1ec7e..b5f8bdd8618 100644
--- a/arch/ia64/kernel/gate.S
+++ b/arch/ia64/kernel/gate.S
@@ -11,8 +11,9 @@
11#include <asm/errno.h> 11#include <asm/errno.h>
12#include <asm/asm-offsets.h> 12#include <asm/asm-offsets.h>
13#include <asm/sigcontext.h> 13#include <asm/sigcontext.h>
14#include <asm/system.h>
15#include <asm/unistd.h> 14#include <asm/unistd.h>
15#include <asm/kregs.h>
16#include <asm/page.h>
16#include "paravirt_inst.h" 17#include "paravirt_inst.h"
17 18
18/* 19/*
diff --git a/arch/ia64/kernel/gate.lds.S b/arch/ia64/kernel/gate.lds.S
index d32b0855110..e518f7902af 100644
--- a/arch/ia64/kernel/gate.lds.S
+++ b/arch/ia64/kernel/gate.lds.S
@@ -5,8 +5,7 @@
5 * its layout. 5 * its layout.
6 */ 6 */
7 7
8 8#include <asm/page.h>
9#include <asm/system.h>
10#include "paravirt_patchlist.h" 9#include "paravirt_patchlist.h"
11 10
12SECTIONS 11SECTIONS
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
index 17a9fba3893..629a250f7c1 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -30,7 +30,6 @@
30#include <asm/pgtable.h> 30#include <asm/pgtable.h>
31#include <asm/processor.h> 31#include <asm/processor.h>
32#include <asm/ptrace.h> 32#include <asm/ptrace.h>
33#include <asm/system.h>
34#include <asm/mca_asm.h> 33#include <asm/mca_asm.h>
35#include <linux/init.h> 34#include <linux/init.h>
36#include <linux/linkage.h> 35#include <linux/linkage.h>
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index b0f9afebb14..ef4b5d877cf 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -98,7 +98,6 @@
98#include <asm/machvec.h> 98#include <asm/machvec.h>
99#include <asm/processor.h> 99#include <asm/processor.h>
100#include <asm/ptrace.h> 100#include <asm/ptrace.h>
101#include <asm/system.h>
102 101
103#undef DEBUG_INTERRUPT_ROUTING 102#undef DEBUG_INTERRUPT_ROUTING
104 103
diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c
index 782c3a357f2..08113b1d30f 100644
--- a/arch/ia64/kernel/irq_ia64.c
+++ b/arch/ia64/kernel/irq_ia64.c
@@ -39,7 +39,6 @@
39#include <asm/hw_irq.h> 39#include <asm/hw_irq.h>
40#include <asm/machvec.h> 40#include <asm/machvec.h>
41#include <asm/pgtable.h> 41#include <asm/pgtable.h>
42#include <asm/system.h>
43#include <asm/tlbflush.h> 42#include <asm/tlbflush.h>
44 43
45#ifdef CONFIG_PERFMON 44#ifdef CONFIG_PERFMON
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index d93e396bf59..fa25689fc45 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -54,7 +54,6 @@
54#include <asm/pgtable.h> 54#include <asm/pgtable.h>
55#include <asm/processor.h> 55#include <asm/processor.h>
56#include <asm/ptrace.h> 56#include <asm/ptrace.h>
57#include <asm/system.h>
58#include <asm/thread_info.h> 57#include <asm/thread_info.h>
59#include <asm/unistd.h> 58#include <asm/unistd.h>
60#include <asm/errno.h> 59#include <asm/errno.h>
diff --git a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c
index d41a40ef80c..f5a1e5246b3 100644
--- a/arch/ia64/kernel/machvec.c
+++ b/arch/ia64/kernel/machvec.c
@@ -1,7 +1,6 @@
1#include <linux/module.h> 1#include <linux/module.h>
2#include <linux/dma-mapping.h> 2#include <linux/dma-mapping.h>
3#include <asm/machvec.h> 3#include <asm/machvec.h>
4#include <asm/system.h>
5 4
6#ifdef CONFIG_IA64_GENERIC 5#ifdef CONFIG_IA64_GENERIC
7 6
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 8192009cb92..a39fe098a73 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -92,7 +92,6 @@
92#include <asm/meminit.h> 92#include <asm/meminit.h>
93#include <asm/page.h> 93#include <asm/page.h>
94#include <asm/ptrace.h> 94#include <asm/ptrace.h>
95#include <asm/system.h>
96#include <asm/sal.h> 95#include <asm/sal.h>
97#include <asm/mca.h> 96#include <asm/mca.h>
98#include <asm/kexec.h> 97#include <asm/kexec.h>
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index 09b4d6828c4..1c2e8940672 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -28,7 +28,6 @@
28#include <asm/machvec.h> 28#include <asm/machvec.h>
29#include <asm/page.h> 29#include <asm/page.h>
30#include <asm/ptrace.h> 30#include <asm/ptrace.h>
31#include <asm/system.h>
32#include <asm/sal.h> 31#include <asm/sal.h>
33#include <asm/mca.h> 32#include <asm/mca.h>
34 33
diff --git a/arch/ia64/kernel/patch.c b/arch/ia64/kernel/patch.c
index 68a1311db80..1cf09179371 100644
--- a/arch/ia64/kernel/patch.c
+++ b/arch/ia64/kernel/patch.c
@@ -11,7 +11,6 @@
11#include <asm/patch.h> 11#include <asm/patch.h>
12#include <asm/processor.h> 12#include <asm/processor.h>
13#include <asm/sections.h> 13#include <asm/sections.h>
14#include <asm/system.h>
15#include <asm/unistd.h> 14#include <asm/unistd.h>
16 15
17/* 16/*
diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index eb117572005..7cdc89b2483 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -12,7 +12,6 @@
12#include <asm/machvec.h> 12#include <asm/machvec.h>
13#include <linux/dma-mapping.h> 13#include <linux/dma-mapping.h>
14 14
15#include <asm/system.h>
16 15
17#ifdef CONFIG_INTEL_IOMMU 16#ifdef CONFIG_INTEL_IOMMU
18 17
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index b2c65e034f5..9d0fd7d5bb8 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -49,7 +49,6 @@
49#include <asm/perfmon.h> 49#include <asm/perfmon.h>
50#include <asm/processor.h> 50#include <asm/processor.h>
51#include <asm/signal.h> 51#include <asm/signal.h>
52#include <asm/system.h>
53#include <asm/uaccess.h> 52#include <asm/uaccess.h>
54#include <asm/delay.h> 53#include <asm/delay.h>
55 54
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index dad91661ddf..4265ff64219 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -26,7 +26,6 @@
26#include <asm/processor.h> 26#include <asm/processor.h>
27#include <asm/ptrace_offsets.h> 27#include <asm/ptrace_offsets.h>
28#include <asm/rse.h> 28#include <asm/rse.h>
29#include <asm/system.h>
30#include <asm/uaccess.h> 29#include <asm/uaccess.h>
31#include <asm/unwind.h> 30#include <asm/unwind.h>
32#ifdef CONFIG_PERFMON 31#ifdef CONFIG_PERFMON
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index cd57d7312de..c45e6ddb4dd 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -59,7 +59,6 @@
59#include <asm/sections.h> 59#include <asm/sections.h>
60#include <asm/setup.h> 60#include <asm/setup.h>
61#include <asm/smp.h> 61#include <asm/smp.h>
62#include <asm/system.h>
63#include <asm/tlbflush.h> 62#include <asm/tlbflush.h>
64#include <asm/unistd.h> 63#include <asm/unistd.h>
65#include <asm/hpsim.h> 64#include <asm/hpsim.h>
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
index 0bd537b4ea6..e27f925032a 100644
--- a/arch/ia64/kernel/smp.c
+++ b/arch/ia64/kernel/smp.c
@@ -44,7 +44,6 @@
44#include <asm/processor.h> 44#include <asm/processor.h>
45#include <asm/ptrace.h> 45#include <asm/ptrace.h>
46#include <asm/sal.h> 46#include <asm/sal.h>
47#include <asm/system.h>
48#include <asm/tlbflush.h> 47#include <asm/tlbflush.h>
49#include <asm/unistd.h> 48#include <asm/unistd.h>
50#include <asm/mca.h> 49#include <asm/mca.h>
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 55909798667..fb7927be75c 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -55,7 +55,6 @@
55#include <asm/processor.h> 55#include <asm/processor.h>
56#include <asm/ptrace.h> 56#include <asm/ptrace.h>
57#include <asm/sal.h> 57#include <asm/sal.h>
58#include <asm/system.h>
59#include <asm/tlbflush.h> 58#include <asm/tlbflush.h>
60#include <asm/unistd.h> 59#include <asm/unistd.h>
61#include <asm/sn/arch.h> 60#include <asm/sn/arch.h>
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 43920de425f..aa94bdda9de 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -29,7 +29,6 @@
29#include <asm/ptrace.h> 29#include <asm/ptrace.h>
30#include <asm/sal.h> 30#include <asm/sal.h>
31#include <asm/sections.h> 31#include <asm/sections.h>
32#include <asm/system.h>
33 32
34#include "fsyscall_gtod_data.h" 33#include "fsyscall_gtod_data.h"
35 34
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index fd80e70018a..bd42b76000d 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -22,6 +22,7 @@
22#include <asm/intrinsics.h> 22#include <asm/intrinsics.h>
23#include <asm/processor.h> 23#include <asm/processor.h>
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25#include <asm/setup.h>
25 26
26fpswa_interface_t *fpswa_interface; 27fpswa_interface_t *fpswa_interface;
27EXPORT_SYMBOL(fpswa_interface); 28EXPORT_SYMBOL(fpswa_interface);
diff --git a/arch/ia64/kernel/uncached.c b/arch/ia64/kernel/uncached.c
index 6a867dc45c0..a96bcf83a73 100644
--- a/arch/ia64/kernel/uncached.c
+++ b/arch/ia64/kernel/uncached.c
@@ -23,7 +23,6 @@
23#include <linux/gfp.h> 23#include <linux/gfp.h>
24#include <asm/page.h> 24#include <asm/page.h>
25#include <asm/pal.h> 25#include <asm/pal.h>
26#include <asm/system.h>
27#include <asm/pgtable.h> 26#include <asm/pgtable.h>
28#include <linux/atomic.h> 27#include <linux/atomic.h>
29#include <asm/tlbflush.h> 28#include <asm/tlbflush.h>
diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c
index fed6afa2e8a..8f66195999e 100644
--- a/arch/ia64/kernel/unwind.c
+++ b/arch/ia64/kernel/unwind.c
@@ -41,7 +41,6 @@
41#include <asm/ptrace_offsets.h> 41#include <asm/ptrace_offsets.h>
42#include <asm/rse.h> 42#include <asm/rse.h>
43#include <asm/sections.h> 43#include <asm/sections.h>
44#include <asm/system.h>
45#include <asm/uaccess.h> 44#include <asm/uaccess.h>
46 45
47#include "entry.h" 46#include "entry.h"
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 53c0ba004e9..0ccb28fab27 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -1,7 +1,6 @@
1 1
2#include <asm/cache.h> 2#include <asm/cache.h>
3#include <asm/ptrace.h> 3#include <asm/ptrace.h>
4#include <asm/system.h>
5#include <asm/pgtable.h> 4#include <asm/pgtable.h>
6 5
7#include <asm-generic/vmlinux.lds.h> 6#include <asm-generic/vmlinux.lds.h>
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c
index 20b35937612..02d29c2a132 100644
--- a/arch/ia64/mm/fault.c
+++ b/arch/ia64/mm/fault.c
@@ -14,7 +14,6 @@
14 14
15#include <asm/pgtable.h> 15#include <asm/pgtable.h>
16#include <asm/processor.h> 16#include <asm/processor.h>
17#include <asm/system.h>
18#include <asm/uaccess.h> 17#include <asm/uaccess.h>
19 18
20extern int die(char *, struct pt_regs *, long); 19extern int die(char *, struct pt_regs *, long);
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 13df239dbed..0eab454867a 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -30,7 +30,6 @@
30#include <asm/pgalloc.h> 30#include <asm/pgalloc.h>
31#include <asm/sal.h> 31#include <asm/sal.h>
32#include <asm/sections.h> 32#include <asm/sections.h>
33#include <asm/system.h>
34#include <asm/tlb.h> 33#include <asm/tlb.h>
35#include <asm/uaccess.h> 34#include <asm/uaccess.h>
36#include <asm/unistd.h> 35#include <asm/unistd.h>
diff --git a/arch/ia64/oprofile/backtrace.c b/arch/ia64/oprofile/backtrace.c
index f7b798993ce..6a219a94605 100644
--- a/arch/ia64/oprofile/backtrace.c
+++ b/arch/ia64/oprofile/backtrace.c
@@ -14,7 +14,6 @@
14#include <linux/sched.h> 14#include <linux/sched.h>
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17#include <asm/system.h>
18 17
19/* 18/*
20 * For IA64 we need to perform a complex little dance to get both 19 * For IA64 we need to perform a complex little dance to get both
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index d1ce3200147..524df4295c9 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -24,7 +24,6 @@
24 24
25#include <asm/machvec.h> 25#include <asm/machvec.h>
26#include <asm/page.h> 26#include <asm/page.h>
27#include <asm/system.h>
28#include <asm/io.h> 27#include <asm/io.h>
29#include <asm/sal.h> 28#include <asm/sal.h>
30#include <asm/smp.h> 29#include <asm/smp.h>
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 77db0b514fa..f82e7b462b7 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -33,9 +33,9 @@
33#include <asm/io.h> 33#include <asm/io.h>
34#include <asm/sal.h> 34#include <asm/sal.h>
35#include <asm/machvec.h> 35#include <asm/machvec.h>
36#include <asm/system.h>
37#include <asm/processor.h> 36#include <asm/processor.h>
38#include <asm/vga.h> 37#include <asm/vga.h>
38#include <asm/setup.h>
39#include <asm/sn/arch.h> 39#include <asm/sn/arch.h>
40#include <asm/sn/addrs.h> 40#include <asm/sn/addrs.h>
41#include <asm/sn/pda.h> 41#include <asm/sn/pda.h>
diff --git a/arch/ia64/sn/kernel/sn2/prominfo_proc.c b/arch/ia64/sn/kernel/sn2/prominfo_proc.c
index e6332881864..20b88cb1881 100644
--- a/arch/ia64/sn/kernel/sn2/prominfo_proc.c
+++ b/arch/ia64/sn/kernel/sn2/prominfo_proc.c
@@ -12,7 +12,6 @@
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/proc_fs.h> 13#include <linux/proc_fs.h>
14#include <linux/nodemask.h> 14#include <linux/nodemask.h>
15#include <asm/system.h>
16#include <asm/io.h> 15#include <asm/io.h>
17#include <asm/sn/sn_sal.h> 16#include <asm/sn/sn_sal.h>
18#include <asm/sn/sn_cpuid.h> 17#include <asm/sn/sn_cpuid.h>
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index e884ba4e031..68c84541162 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -26,7 +26,6 @@
26#include <asm/processor.h> 26#include <asm/processor.h>
27#include <asm/irq.h> 27#include <asm/irq.h>
28#include <asm/sal.h> 28#include <asm/sal.h>
29#include <asm/system.h>
30#include <asm/delay.h> 29#include <asm/delay.h>
31#include <asm/io.h> 30#include <asm/io.h>
32#include <asm/smp.h> 31#include <asm/smp.h>
diff --git a/arch/ia64/sn/kernel/sn2/timer.c b/arch/ia64/sn/kernel/sn2/timer.c
index 0f8844e4936..abab8f99e91 100644
--- a/arch/ia64/sn/kernel/sn2/timer.c
+++ b/arch/ia64/sn/kernel/sn2/timer.c
@@ -14,7 +14,6 @@
14#include <linux/clocksource.h> 14#include <linux/clocksource.h>
15 15
16#include <asm/hw_irq.h> 16#include <asm/hw_irq.h>
17#include <asm/system.h>
18#include <asm/timex.h> 17#include <asm/timex.h>
19 18
20#include <asm/sn/leds.h> 19#include <asm/sn/leds.h>
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index 2f406f509d4..14c1711238c 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -14,7 +14,6 @@
14#include <linux/capability.h> 14#include <linux/capability.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/delay.h> 16#include <linux/delay.h>
17#include <asm/system.h>
18#include <asm/uaccess.h> 17#include <asm/uaccess.h>
19#include <asm/sn/sn_sal.h> 18#include <asm/sn/sn_sal.h>
20#include <asm/sn/addrs.h> 19#include <asm/sn/addrs.h>
diff --git a/arch/ia64/xen/xensetup.S b/arch/ia64/xen/xensetup.S
index b820ed02ab9..e29519ebe2d 100644
--- a/arch/ia64/xen/xensetup.S
+++ b/arch/ia64/xen/xensetup.S
@@ -7,7 +7,6 @@
7#include <asm/processor.h> 7#include <asm/processor.h>
8#include <asm/asmmacro.h> 8#include <asm/asmmacro.h>
9#include <asm/pgtable.h> 9#include <asm/pgtable.h>
10#include <asm/system.h>
11#include <asm/paravirt.h> 10#include <asm/paravirt.h>
12#include <asm/xen/privop.h> 11#include <asm/xen/privop.h>
13#include <linux/elfnote.h> 12#include <linux/elfnote.h>
diff --git a/arch/m32r/include/asm/atomic.h b/arch/m32r/include/asm/atomic.h
index 1e7f29fb21f..0d81697c326 100644
--- a/arch/m32r/include/asm/atomic.h
+++ b/arch/m32r/include/asm/atomic.h
@@ -11,7 +11,8 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13#include <asm/assembler.h> 13#include <asm/assembler.h>
14#include <asm/system.h> 14#include <asm/cmpxchg.h>
15#include <asm/dcache_clear.h>
15 16
16/* 17/*
17 * Atomic operations that C can't guarantee us. Useful for 18 * Atomic operations that C can't guarantee us. Useful for
diff --git a/arch/m32r/include/asm/barrier.h b/arch/m32r/include/asm/barrier.h
new file mode 100644
index 00000000000..6976621efd3
--- /dev/null
+++ b/arch/m32r/include/asm/barrier.h
@@ -0,0 +1,94 @@
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) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto
7 * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org>
8 */
9#ifndef _ASM_M32R_BARRIER_H
10#define _ASM_M32R_BARRIER_H
11
12#define nop() __asm__ __volatile__ ("nop" : : )
13
14/*
15 * Memory barrier.
16 *
17 * mb() prevents loads and stores being reordered across this point.
18 * rmb() prevents loads being reordered across this point.
19 * wmb() prevents stores being reordered across this point.
20 */
21#define mb() barrier()
22#define rmb() mb()
23#define wmb() mb()
24
25/**
26 * read_barrier_depends - Flush all pending reads that subsequents reads
27 * depend on.
28 *
29 * No data-dependent reads from memory-like regions are ever reordered
30 * over this barrier. All reads preceding this primitive are guaranteed
31 * to access memory (but not necessarily other CPUs' caches) before any
32 * reads following this primitive that depend on the data return by
33 * any of the preceding reads. This primitive is much lighter weight than
34 * rmb() on most CPUs, and is never heavier weight than is
35 * rmb().
36 *
37 * These ordering constraints are respected by both the local CPU
38 * and the compiler.
39 *
40 * Ordering is not guaranteed by anything other than these primitives,
41 * not even by data dependencies. See the documentation for
42 * memory_barrier() for examples and URLs to more information.
43 *
44 * For example, the following code would force ordering (the initial
45 * value of "a" is zero, "b" is one, and "p" is "&a"):
46 *
47 * <programlisting>
48 * CPU 0 CPU 1
49 *
50 * b = 2;
51 * memory_barrier();
52 * p = &b; q = p;
53 * read_barrier_depends();
54 * d = *q;
55 * </programlisting>
56 *
57 *
58 * because the read of "*q" depends on the read of "p" and these
59 * two reads are separated by a read_barrier_depends(). However,
60 * the following code, with the same initial values for "a" and "b":
61 *
62 * <programlisting>
63 * CPU 0 CPU 1
64 *
65 * a = 2;
66 * memory_barrier();
67 * b = 3; y = b;
68 * read_barrier_depends();
69 * x = a;
70 * </programlisting>
71 *
72 * does not enforce ordering, since there is no data dependency between
73 * the read of "a" and the read of "b". Therefore, on some CPUs, such
74 * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb()
75 * in cases like this where there are no data dependencies.
76 **/
77
78#define read_barrier_depends() do { } while (0)
79
80#ifdef CONFIG_SMP
81#define smp_mb() mb()
82#define smp_rmb() rmb()
83#define smp_wmb() wmb()
84#define smp_read_barrier_depends() read_barrier_depends()
85#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
86#else
87#define smp_mb() barrier()
88#define smp_rmb() barrier()
89#define smp_wmb() barrier()
90#define smp_read_barrier_depends() do { } while (0)
91#define set_mb(var, value) do { var = value; barrier(); } while (0)
92#endif
93
94#endif /* _ASM_M32R_BARRIER_H */
diff --git a/arch/m32r/include/asm/bitops.h b/arch/m32r/include/asm/bitops.h
index 6300f22cdbd..d3dea9ac7d4 100644
--- a/arch/m32r/include/asm/bitops.h
+++ b/arch/m32r/include/asm/bitops.h
@@ -16,9 +16,10 @@
16#endif 16#endif
17 17
18#include <linux/compiler.h> 18#include <linux/compiler.h>
19#include <linux/irqflags.h>
19#include <asm/assembler.h> 20#include <asm/assembler.h>
20#include <asm/system.h>
21#include <asm/byteorder.h> 21#include <asm/byteorder.h>
22#include <asm/dcache_clear.h>
22#include <asm/types.h> 23#include <asm/types.h>
23 24
24/* 25/*
diff --git a/arch/m32r/include/asm/cmpxchg.h b/arch/m32r/include/asm/cmpxchg.h
new file mode 100644
index 00000000000..de651db20b4
--- /dev/null
+++ b/arch/m32r/include/asm/cmpxchg.h
@@ -0,0 +1,221 @@
1#ifndef _ASM_M32R_CMPXCHG_H
2#define _ASM_M32R_CMPXCHG_H
3
4/*
5 * M32R version:
6 * Copyright (C) 2001, 2002 Hitoshi Yamamoto
7 * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org>
8 */
9
10#include <linux/irqflags.h>
11#include <asm/assembler.h>
12#include <asm/dcache_clear.h>
13
14extern void __xchg_called_with_bad_pointer(void);
15
16static __always_inline unsigned long
17__xchg(unsigned long x, volatile void *ptr, int size)
18{
19 unsigned long flags;
20 unsigned long tmp = 0;
21
22 local_irq_save(flags);
23
24 switch (size) {
25#ifndef CONFIG_SMP
26 case 1:
27 __asm__ __volatile__ (
28 "ldb %0, @%2 \n\t"
29 "stb %1, @%2 \n\t"
30 : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory");
31 break;
32 case 2:
33 __asm__ __volatile__ (
34 "ldh %0, @%2 \n\t"
35 "sth %1, @%2 \n\t"
36 : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory");
37 break;
38 case 4:
39 __asm__ __volatile__ (
40 "ld %0, @%2 \n\t"
41 "st %1, @%2 \n\t"
42 : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory");
43 break;
44#else /* CONFIG_SMP */
45 case 4:
46 __asm__ __volatile__ (
47 DCACHE_CLEAR("%0", "r4", "%2")
48 "lock %0, @%2; \n\t"
49 "unlock %1, @%2; \n\t"
50 : "=&r" (tmp) : "r" (x), "r" (ptr)
51 : "memory"
52#ifdef CONFIG_CHIP_M32700_TS1
53 , "r4"
54#endif /* CONFIG_CHIP_M32700_TS1 */
55 );
56 break;
57#endif /* CONFIG_SMP */
58 default:
59 __xchg_called_with_bad_pointer();
60 }
61
62 local_irq_restore(flags);
63
64 return (tmp);
65}
66
67#define xchg(ptr, x) \
68 ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
69
70static __always_inline unsigned long
71__xchg_local(unsigned long x, volatile void *ptr, int size)
72{
73 unsigned long flags;
74 unsigned long tmp = 0;
75
76 local_irq_save(flags);
77
78 switch (size) {
79 case 1:
80 __asm__ __volatile__ (
81 "ldb %0, @%2 \n\t"
82 "stb %1, @%2 \n\t"
83 : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory");
84 break;
85 case 2:
86 __asm__ __volatile__ (
87 "ldh %0, @%2 \n\t"
88 "sth %1, @%2 \n\t"
89 : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory");
90 break;
91 case 4:
92 __asm__ __volatile__ (
93 "ld %0, @%2 \n\t"
94 "st %1, @%2 \n\t"
95 : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory");
96 break;
97 default:
98 __xchg_called_with_bad_pointer();
99 }
100
101 local_irq_restore(flags);
102
103 return (tmp);
104}
105
106#define xchg_local(ptr, x) \
107 ((__typeof__(*(ptr)))__xchg_local((unsigned long)(x), (ptr), \
108 sizeof(*(ptr))))
109
110#define __HAVE_ARCH_CMPXCHG 1
111
112static inline unsigned long
113__cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new)
114{
115 unsigned long flags;
116 unsigned int retval;
117
118 local_irq_save(flags);
119 __asm__ __volatile__ (
120 DCACHE_CLEAR("%0", "r4", "%1")
121 M32R_LOCK" %0, @%1; \n"
122 " bne %0, %2, 1f; \n"
123 M32R_UNLOCK" %3, @%1; \n"
124 " bra 2f; \n"
125 " .fillinsn \n"
126 "1:"
127 M32R_UNLOCK" %0, @%1; \n"
128 " .fillinsn \n"
129 "2:"
130 : "=&r" (retval)
131 : "r" (p), "r" (old), "r" (new)
132 : "cbit", "memory"
133#ifdef CONFIG_CHIP_M32700_TS1
134 , "r4"
135#endif /* CONFIG_CHIP_M32700_TS1 */
136 );
137 local_irq_restore(flags);
138
139 return retval;
140}
141
142static inline unsigned long
143__cmpxchg_local_u32(volatile unsigned int *p, unsigned int old,
144 unsigned int new)
145{
146 unsigned long flags;
147 unsigned int retval;
148
149 local_irq_save(flags);
150 __asm__ __volatile__ (
151 DCACHE_CLEAR("%0", "r4", "%1")
152 "ld %0, @%1; \n"
153 " bne %0, %2, 1f; \n"
154 "st %3, @%1; \n"
155 " bra 2f; \n"
156 " .fillinsn \n"
157 "1:"
158 "st %0, @%1; \n"
159 " .fillinsn \n"
160 "2:"
161 : "=&r" (retval)
162 : "r" (p), "r" (old), "r" (new)
163 : "cbit", "memory"
164#ifdef CONFIG_CHIP_M32700_TS1
165 , "r4"
166#endif /* CONFIG_CHIP_M32700_TS1 */
167 );
168 local_irq_restore(flags);
169
170 return retval;
171}
172
173/* This function doesn't exist, so you'll get a linker error
174 if something tries to do an invalid cmpxchg(). */
175extern void __cmpxchg_called_with_bad_pointer(void);
176
177static inline unsigned long
178__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
179{
180 switch (size) {
181 case 4:
182 return __cmpxchg_u32(ptr, old, new);
183#if 0 /* we don't have __cmpxchg_u64 */
184 case 8:
185 return __cmpxchg_u64(ptr, old, new);
186#endif /* 0 */
187 }
188 __cmpxchg_called_with_bad_pointer();
189 return old;
190}
191
192#define cmpxchg(ptr, o, n) \
193 ((__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)(o), \
194 (unsigned long)(n), sizeof(*(ptr))))
195
196#include <asm-generic/cmpxchg-local.h>
197
198static inline unsigned long __cmpxchg_local(volatile void *ptr,
199 unsigned long old,
200 unsigned long new, int size)
201{
202 switch (size) {
203 case 4:
204 return __cmpxchg_local_u32(ptr, old, new);
205 default:
206 return __cmpxchg_local_generic(ptr, old, new, size);
207 }
208
209 return old;
210}
211
212/*
213 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
214 * them available.
215 */
216#define cmpxchg_local(ptr, o, n) \
217 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
218 (unsigned long)(n), sizeof(*(ptr))))
219#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
220
221#endif /* _ASM_M32R_CMPXCHG_H */
diff --git a/arch/m32r/include/asm/dcache_clear.h b/arch/m32r/include/asm/dcache_clear.h
new file mode 100644
index 00000000000..a0ae06c2e9e
--- /dev/null
+++ b/arch/m32r/include/asm/dcache_clear.h
@@ -0,0 +1,29 @@
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) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto
7 * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org>
8 */
9#ifndef _ASM_M32R_DCACHE_CLEAR_H
10#define _ASM_M32R_DCACHE_CLEAR_H
11
12#ifdef CONFIG_CHIP_M32700_TS1
13#define DCACHE_CLEAR(reg0, reg1, addr) \
14 "seth "reg1", #high(dcache_dummy); \n\t" \
15 "or3 "reg1", "reg1", #low(dcache_dummy); \n\t" \
16 "lock "reg0", @"reg1"; \n\t" \
17 "add3 "reg0", "addr", #0x1000; \n\t" \
18 "ld "reg0", @"reg0"; \n\t" \
19 "add3 "reg0", "addr", #0x2000; \n\t" \
20 "ld "reg0", @"reg0"; \n\t" \
21 "unlock "reg0", @"reg1"; \n\t"
22 /* FIXME: This workaround code cannot handle kernel modules
23 * correctly under SMP environment.
24 */
25#else /* CONFIG_CHIP_M32700_TS1 */
26#define DCACHE_CLEAR(reg0, reg1, addr)
27#endif /* CONFIG_CHIP_M32700_TS1 */
28
29#endif /* _ASM_M32R_DCACHE_CLEAR_H */
diff --git a/arch/m32r/include/asm/exec.h b/arch/m32r/include/asm/exec.h
new file mode 100644
index 00000000000..c805dbd75b5
--- /dev/null
+++ b/arch/m32r/include/asm/exec.h
@@ -0,0 +1,14 @@
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) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto
7 * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org>
8 */
9#ifndef _ASM_M32R_EXEC_H
10#define _ASM_M32R_EXEC_H
11
12#define arch_align_stack(x) (x)
13
14#endif /* _ASM_M32R_EXEC_H */
diff --git a/arch/m32r/include/asm/local.h b/arch/m32r/include/asm/local.h
index 734bca87018..4045db3e4f6 100644
--- a/arch/m32r/include/asm/local.h
+++ b/arch/m32r/include/asm/local.h
@@ -12,7 +12,6 @@
12 12
13#include <linux/percpu.h> 13#include <linux/percpu.h>
14#include <asm/assembler.h> 14#include <asm/assembler.h>
15#include <asm/system.h>
16#include <asm/local.h> 15#include <asm/local.h>
17 16
18/* 17/*
diff --git a/arch/m32r/include/asm/spinlock.h b/arch/m32r/include/asm/spinlock.h
index b0ea2f26da3..fa13694eaae 100644
--- a/arch/m32r/include/asm/spinlock.h
+++ b/arch/m32r/include/asm/spinlock.h
@@ -11,6 +11,7 @@
11 11
12#include <linux/compiler.h> 12#include <linux/compiler.h>
13#include <linux/atomic.h> 13#include <linux/atomic.h>
14#include <asm/dcache_clear.h>
14#include <asm/page.h> 15#include <asm/page.h>
15 16
16/* 17/*
diff --git a/arch/m32r/include/asm/switch_to.h b/arch/m32r/include/asm/switch_to.h
new file mode 100644
index 00000000000..4b262f7a8fe
--- /dev/null
+++ b/arch/m32r/include/asm/switch_to.h
@@ -0,0 +1,51 @@
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) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto
7 * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org>
8 */
9#ifndef _ASM_M32R_SWITCH_TO_H
10#define _ASM_M32R_SWITCH_TO_H
11
12/*
13 * switch_to(prev, next) should switch from task `prev' to `next'
14 * `prev' will never be the same as `next'.
15 *
16 * `next' and `prev' should be struct task_struct, but it isn't always defined
17 */
18
19#if defined(CONFIG_FRAME_POINTER) || \
20 !defined(CONFIG_SCHED_OMIT_FRAME_POINTER)
21#define M32R_PUSH_FP " push fp\n"
22#define M32R_POP_FP " pop fp\n"
23#else
24#define M32R_PUSH_FP ""
25#define M32R_POP_FP ""
26#endif
27
28#define switch_to(prev, next, last) do { \
29 __asm__ __volatile__ ( \
30 " seth lr, #high(1f) \n" \
31 " or3 lr, lr, #low(1f) \n" \
32 " st lr, @%4 ; store old LR \n" \
33 " ld lr, @%5 ; load new LR \n" \
34 M32R_PUSH_FP \
35 " st sp, @%2 ; store old SP \n" \
36 " ld sp, @%3 ; load new SP \n" \
37 " push %1 ; store `prev' on new stack \n" \
38 " jmp lr \n" \
39 " .fillinsn \n" \
40 "1: \n" \
41 " pop %0 ; restore `__last' from new stack \n" \
42 M32R_POP_FP \
43 : "=r" (last) \
44 : "0" (prev), \
45 "r" (&(prev->thread.sp)), "r" (&(next->thread.sp)), \
46 "r" (&(prev->thread.lr)), "r" (&(next->thread.lr)) \
47 : "memory", "lr" \
48 ); \
49} while(0)
50
51#endif /* _ASM_M32R_SWITCH_TO_H */
diff --git a/arch/m32r/include/asm/system.h b/arch/m32r/include/asm/system.h
deleted file mode 100644
index 13c46794ccb..00000000000
--- a/arch/m32r/include/asm/system.h
+++ /dev/null
@@ -1,367 +0,0 @@
1#ifndef _ASM_M32R_SYSTEM_H
2#define _ASM_M32R_SYSTEM_H
3
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 * Copyright (C) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto
10 * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org>
11 */
12
13#include <linux/compiler.h>
14#include <linux/irqflags.h>
15#include <asm/assembler.h>
16
17#ifdef __KERNEL__
18
19/*
20 * switch_to(prev, next) should switch from task `prev' to `next'
21 * `prev' will never be the same as `next'.
22 *
23 * `next' and `prev' should be struct task_struct, but it isn't always defined
24 */
25
26#if defined(CONFIG_FRAME_POINTER) || \
27 !defined(CONFIG_SCHED_OMIT_FRAME_POINTER)
28#define M32R_PUSH_FP " push fp\n"
29#define M32R_POP_FP " pop fp\n"
30#else
31#define M32R_PUSH_FP ""
32#define M32R_POP_FP ""
33#endif
34
35#define switch_to(prev, next, last) do { \
36 __asm__ __volatile__ ( \
37 " seth lr, #high(1f) \n" \
38 " or3 lr, lr, #low(1f) \n" \
39 " st lr, @%4 ; store old LR \n" \
40 " ld lr, @%5 ; load new LR \n" \
41 M32R_PUSH_FP \
42 " st sp, @%2 ; store old SP \n" \
43 " ld sp, @%3 ; load new SP \n" \
44 " push %1 ; store `prev' on new stack \n" \
45 " jmp lr \n" \
46 " .fillinsn \n" \
47 "1: \n" \
48 " pop %0 ; restore `__last' from new stack \n" \
49 M32R_POP_FP \
50 : "=r" (last) \
51 : "0" (prev), \
52 "r" (&(prev->thread.sp)), "r" (&(next->thread.sp)), \
53 "r" (&(prev->thread.lr)), "r" (&(next->thread.lr)) \
54 : "memory", "lr" \
55 ); \
56} while(0)
57
58#define nop() __asm__ __volatile__ ("nop" : : )
59
60#define xchg(ptr, x) \
61 ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
62#define xchg_local(ptr, x) \
63 ((__typeof__(*(ptr)))__xchg_local((unsigned long)(x), (ptr), \
64 sizeof(*(ptr))))
65
66extern void __xchg_called_with_bad_pointer(void);
67
68#ifdef CONFIG_CHIP_M32700_TS1
69#define DCACHE_CLEAR(reg0, reg1, addr) \
70 "seth "reg1", #high(dcache_dummy); \n\t" \
71 "or3 "reg1", "reg1", #low(dcache_dummy); \n\t" \
72 "lock "reg0", @"reg1"; \n\t" \
73 "add3 "reg0", "addr", #0x1000; \n\t" \
74 "ld "reg0", @"reg0"; \n\t" \
75 "add3 "reg0", "addr", #0x2000; \n\t" \
76 "ld "reg0", @"reg0"; \n\t" \
77 "unlock "reg0", @"reg1"; \n\t"
78 /* FIXME: This workaround code cannot handle kernel modules
79 * correctly under SMP environment.
80 */
81#else /* CONFIG_CHIP_M32700_TS1 */
82#define DCACHE_CLEAR(reg0, reg1, addr)
83#endif /* CONFIG_CHIP_M32700_TS1 */
84
85static __always_inline unsigned long
86__xchg(unsigned long x, volatile void *ptr, int size)
87{
88 unsigned long flags;
89 unsigned long tmp = 0;
90
91 local_irq_save(flags);
92
93 switch (size) {
94#ifndef CONFIG_SMP
95 case 1:
96 __asm__ __volatile__ (
97 "ldb %0, @%2 \n\t"
98 "stb %1, @%2 \n\t"
99 : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory");
100 break;
101 case 2:
102 __asm__ __volatile__ (
103 "ldh %0, @%2 \n\t"
104 "sth %1, @%2 \n\t"
105 : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory");
106 break;
107 case 4:
108 __asm__ __volatile__ (
109 "ld %0, @%2 \n\t"
110 "st %1, @%2 \n\t"
111 : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory");
112 break;
113#else /* CONFIG_SMP */
114 case 4:
115 __asm__ __volatile__ (
116 DCACHE_CLEAR("%0", "r4", "%2")
117 "lock %0, @%2; \n\t"
118 "unlock %1, @%2; \n\t"
119 : "=&r" (tmp) : "r" (x), "r" (ptr)
120 : "memory"
121#ifdef CONFIG_CHIP_M32700_TS1
122 , "r4"
123#endif /* CONFIG_CHIP_M32700_TS1 */
124 );
125 break;
126#endif /* CONFIG_SMP */
127 default:
128 __xchg_called_with_bad_pointer();
129 }
130
131 local_irq_restore(flags);
132
133 return (tmp);
134}
135
136static __always_inline unsigned long
137__xchg_local(unsigned long x, volatile void *ptr, int size)
138{
139 unsigned long flags;
140 unsigned long tmp = 0;
141
142 local_irq_save(flags);
143
144 switch (size) {
145 case 1:
146 __asm__ __volatile__ (
147 "ldb %0, @%2 \n\t"
148 "stb %1, @%2 \n\t"
149 : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory");
150 break;
151 case 2:
152 __asm__ __volatile__ (
153 "ldh %0, @%2 \n\t"
154 "sth %1, @%2 \n\t"
155 : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory");
156 break;
157 case 4:
158 __asm__ __volatile__ (
159 "ld %0, @%2 \n\t"
160 "st %1, @%2 \n\t"
161 : "=&r" (tmp) : "r" (x), "r" (ptr) : "memory");
162 break;
163 default:
164 __xchg_called_with_bad_pointer();
165 }
166
167 local_irq_restore(flags);
168
169 return (tmp);
170}
171
172#define __HAVE_ARCH_CMPXCHG 1
173
174static inline unsigned long
175__cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new)
176{
177 unsigned long flags;
178 unsigned int retval;
179
180 local_irq_save(flags);
181 __asm__ __volatile__ (
182 DCACHE_CLEAR("%0", "r4", "%1")
183 M32R_LOCK" %0, @%1; \n"
184 " bne %0, %2, 1f; \n"
185 M32R_UNLOCK" %3, @%1; \n"
186 " bra 2f; \n"
187 " .fillinsn \n"
188 "1:"
189 M32R_UNLOCK" %0, @%1; \n"
190 " .fillinsn \n"
191 "2:"
192 : "=&r" (retval)
193 : "r" (p), "r" (old), "r" (new)
194 : "cbit", "memory"
195#ifdef CONFIG_CHIP_M32700_TS1
196 , "r4"
197#endif /* CONFIG_CHIP_M32700_TS1 */
198 );
199 local_irq_restore(flags);
200
201 return retval;
202}
203
204static inline unsigned long
205__cmpxchg_local_u32(volatile unsigned int *p, unsigned int old,
206 unsigned int new)
207{
208 unsigned long flags;
209 unsigned int retval;
210
211 local_irq_save(flags);
212 __asm__ __volatile__ (
213 DCACHE_CLEAR("%0", "r4", "%1")
214 "ld %0, @%1; \n"
215 " bne %0, %2, 1f; \n"
216 "st %3, @%1; \n"
217 " bra 2f; \n"
218 " .fillinsn \n"
219 "1:"
220 "st %0, @%1; \n"
221 " .fillinsn \n"
222 "2:"
223 : "=&r" (retval)
224 : "r" (p), "r" (old), "r" (new)
225 : "cbit", "memory"
226#ifdef CONFIG_CHIP_M32700_TS1
227 , "r4"
228#endif /* CONFIG_CHIP_M32700_TS1 */
229 );
230 local_irq_restore(flags);
231
232 return retval;
233}
234
235/* This function doesn't exist, so you'll get a linker error
236 if something tries to do an invalid cmpxchg(). */
237extern void __cmpxchg_called_with_bad_pointer(void);
238
239static inline unsigned long
240__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
241{
242 switch (size) {
243 case 4:
244 return __cmpxchg_u32(ptr, old, new);
245#if 0 /* we don't have __cmpxchg_u64 */
246 case 8:
247 return __cmpxchg_u64(ptr, old, new);
248#endif /* 0 */
249 }
250 __cmpxchg_called_with_bad_pointer();
251 return old;
252}
253
254#define cmpxchg(ptr, o, n) \
255 ((__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)(o), \
256 (unsigned long)(n), sizeof(*(ptr))))
257
258#include <asm-generic/cmpxchg-local.h>
259
260static inline unsigned long __cmpxchg_local(volatile void *ptr,
261 unsigned long old,
262 unsigned long new, int size)
263{
264 switch (size) {
265 case 4:
266 return __cmpxchg_local_u32(ptr, old, new);
267 default:
268 return __cmpxchg_local_generic(ptr, old, new, size);
269 }
270
271 return old;
272}
273
274/*
275 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
276 * them available.
277 */
278#define cmpxchg_local(ptr, o, n) \
279 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
280 (unsigned long)(n), sizeof(*(ptr))))
281#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
282
283#endif /* __KERNEL__ */
284
285/*
286 * Memory barrier.
287 *
288 * mb() prevents loads and stores being reordered across this point.
289 * rmb() prevents loads being reordered across this point.
290 * wmb() prevents stores being reordered across this point.
291 */
292#define mb() barrier()
293#define rmb() mb()
294#define wmb() mb()
295
296/**
297 * read_barrier_depends - Flush all pending reads that subsequents reads
298 * depend on.
299 *
300 * No data-dependent reads from memory-like regions are ever reordered
301 * over this barrier. All reads preceding this primitive are guaranteed
302 * to access memory (but not necessarily other CPUs' caches) before any
303 * reads following this primitive that depend on the data return by
304 * any of the preceding reads. This primitive is much lighter weight than
305 * rmb() on most CPUs, and is never heavier weight than is
306 * rmb().
307 *
308 * These ordering constraints are respected by both the local CPU
309 * and the compiler.
310 *
311 * Ordering is not guaranteed by anything other than these primitives,
312 * not even by data dependencies. See the documentation for
313 * memory_barrier() for examples and URLs to more information.
314 *
315 * For example, the following code would force ordering (the initial
316 * value of "a" is zero, "b" is one, and "p" is "&a"):
317 *
318 * <programlisting>
319 * CPU 0 CPU 1
320 *
321 * b = 2;
322 * memory_barrier();
323 * p = &b; q = p;
324 * read_barrier_depends();
325 * d = *q;
326 * </programlisting>
327 *
328 *
329 * because the read of "*q" depends on the read of "p" and these
330 * two reads are separated by a read_barrier_depends(). However,
331 * the following code, with the same initial values for "a" and "b":
332 *
333 * <programlisting>
334 * CPU 0 CPU 1
335 *
336 * a = 2;
337 * memory_barrier();
338 * b = 3; y = b;
339 * read_barrier_depends();
340 * x = a;
341 * </programlisting>
342 *
343 * does not enforce ordering, since there is no data dependency between
344 * the read of "a" and the read of "b". Therefore, on some CPUs, such
345 * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb()
346 * in cases like this where there are no data dependencies.
347 **/
348
349#define read_barrier_depends() do { } while (0)
350
351#ifdef CONFIG_SMP
352#define smp_mb() mb()
353#define smp_rmb() rmb()
354#define smp_wmb() wmb()
355#define smp_read_barrier_depends() read_barrier_depends()
356#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
357#else
358#define smp_mb() barrier()
359#define smp_rmb() barrier()
360#define smp_wmb() barrier()
361#define smp_read_barrier_depends() do { } while (0)
362#define set_mb(var, value) do { var = value; barrier(); } while (0)
363#endif
364
365#define arch_align_stack(x) (x)
366
367#endif /* _ASM_M32R_SYSTEM_H */
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c
index 20743754f2b..4c03361537a 100644
--- a/arch/m32r/kernel/ptrace.c
+++ b/arch/m32r/kernel/ptrace.c
@@ -29,7 +29,6 @@
29#include <asm/io.h> 29#include <asm/io.h>
30#include <asm/uaccess.h> 30#include <asm/uaccess.h>
31#include <asm/pgtable.h> 31#include <asm/pgtable.h>
32#include <asm/system.h>
33#include <asm/processor.h> 32#include <asm/processor.h>
34#include <asm/mmu_context.h> 33#include <asm/mmu_context.h>
35 34
diff --git a/arch/m32r/kernel/traps.c b/arch/m32r/kernel/traps.c
index ee6a9199561..3bcb207e5b6 100644
--- a/arch/m32r/kernel/traps.c
+++ b/arch/m32r/kernel/traps.c
@@ -18,7 +18,6 @@
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/processor.h> 19#include <asm/processor.h>
20 20
21#include <asm/system.h>
22#include <asm/uaccess.h> 21#include <asm/uaccess.h>
23#include <asm/io.h> 22#include <asm/io.h>
24#include <linux/atomic.h> 23#include <linux/atomic.h>
diff --git a/arch/m32r/mm/fault-nommu.c b/arch/m32r/mm/fault-nommu.c
index 888aab1157e..80f18cc6f54 100644
--- a/arch/m32r/mm/fault-nommu.c
+++ b/arch/m32r/mm/fault-nommu.c
@@ -22,7 +22,6 @@
22#include <linux/vt_kern.h> /* For unblank_screen() */ 22#include <linux/vt_kern.h> /* For unblank_screen() */
23 23
24#include <asm/m32r.h> 24#include <asm/m32r.h>
25#include <asm/system.h>
26#include <asm/uaccess.h> 25#include <asm/uaccess.h>
27#include <asm/pgalloc.h> 26#include <asm/pgalloc.h>
28#include <asm/pgtable.h> 27#include <asm/pgtable.h>
diff --git a/arch/m32r/mm/fault.c b/arch/m32r/mm/fault.c
index 2c9aeb45384..3cdfa9c1d09 100644
--- a/arch/m32r/mm/fault.c
+++ b/arch/m32r/mm/fault.c
@@ -26,7 +26,6 @@
26#include <linux/module.h> 26#include <linux/module.h>
27 27
28#include <asm/m32r.h> 28#include <asm/m32r.h>
29#include <asm/system.h>
30#include <asm/uaccess.h> 29#include <asm/uaccess.h>
31#include <asm/hardirq.h> 30#include <asm/hardirq.h>
32#include <asm/mmu_context.h> 31#include <asm/mmu_context.h>
diff --git a/arch/m32r/platforms/m32104ut/setup.c b/arch/m32r/platforms/m32104ut/setup.c
index 34671d32cef..e2dd778aeac 100644
--- a/arch/m32r/platforms/m32104ut/setup.c
+++ b/arch/m32r/platforms/m32104ut/setup.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/device.h> 14#include <linux/device.h>
15 15
16#include <asm/system.h>
17#include <asm/m32r.h> 16#include <asm/m32r.h>
18#include <asm/io.h> 17#include <asm/io.h>
19 18
diff --git a/arch/m32r/platforms/m32700ut/setup.c b/arch/m32r/platforms/m32700ut/setup.c
index 1053e1cb740..9a4ba8a8589 100644
--- a/arch/m32r/platforms/m32700ut/setup.c
+++ b/arch/m32r/platforms/m32700ut/setup.c
@@ -16,7 +16,6 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18 18
19#include <asm/system.h>
20#include <asm/m32r.h> 19#include <asm/m32r.h>
21#include <asm/io.h> 20#include <asm/io.h>
22 21
diff --git a/arch/m32r/platforms/mappi/setup.c b/arch/m32r/platforms/mappi/setup.c
index 35130ac3f8d..767d2f4d6de 100644
--- a/arch/m32r/platforms/mappi/setup.c
+++ b/arch/m32r/platforms/mappi/setup.c
@@ -12,7 +12,6 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14 14
15#include <asm/system.h>
16#include <asm/m32r.h> 15#include <asm/m32r.h>
17#include <asm/io.h> 16#include <asm/io.h>
18 17
diff --git a/arch/m32r/platforms/mappi2/setup.c b/arch/m32r/platforms/mappi2/setup.c
index f3ed6b60a5f..76d665abf51 100644
--- a/arch/m32r/platforms/mappi2/setup.c
+++ b/arch/m32r/platforms/mappi2/setup.c
@@ -12,7 +12,6 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14 14
15#include <asm/system.h>
16#include <asm/m32r.h> 15#include <asm/m32r.h>
17#include <asm/io.h> 16#include <asm/io.h>
18 17
diff --git a/arch/m32r/platforms/mappi3/setup.c b/arch/m32r/platforms/mappi3/setup.c
index 2408e356ad1..a3646d4b05b 100644
--- a/arch/m32r/platforms/mappi3/setup.c
+++ b/arch/m32r/platforms/mappi3/setup.c
@@ -12,7 +12,6 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14 14
15#include <asm/system.h>
16#include <asm/m32r.h> 15#include <asm/m32r.h>
17#include <asm/io.h> 16#include <asm/io.h>
18 17
diff --git a/arch/m32r/platforms/oaks32r/setup.c b/arch/m32r/platforms/oaks32r/setup.c
index 83b46b067a1..f8373c06952 100644
--- a/arch/m32r/platforms/oaks32r/setup.c
+++ b/arch/m32r/platforms/oaks32r/setup.c
@@ -11,7 +11,6 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13 13
14#include <asm/system.h>
15#include <asm/m32r.h> 14#include <asm/m32r.h>
16#include <asm/io.h> 15#include <asm/io.h>
17 16
diff --git a/arch/m32r/platforms/opsput/setup.c b/arch/m32r/platforms/opsput/setup.c
index 32660705f5f..cd0170483e8 100644
--- a/arch/m32r/platforms/opsput/setup.c
+++ b/arch/m32r/platforms/opsput/setup.c
@@ -17,7 +17,6 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19 19
20#include <asm/system.h>
21#include <asm/m32r.h> 20#include <asm/m32r.h>
22#include <asm/io.h> 21#include <asm/io.h>
23 22
diff --git a/arch/m32r/platforms/usrv/setup.c b/arch/m32r/platforms/usrv/setup.c
index 0c7a1e8c77b..dcde0ec777f 100644
--- a/arch/m32r/platforms/usrv/setup.c
+++ b/arch/m32r/platforms/usrv/setup.c
@@ -11,7 +11,6 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13 13
14#include <asm/system.h>
15#include <asm/m32r.h> 14#include <asm/m32r.h>
16#include <asm/io.h> 15#include <asm/io.h>
17 16
diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c
index 61e5c54625a..2559eefc6af 100644
--- a/arch/m68k/amiga/amisound.c
+++ b/arch/m68k/amiga/amisound.c
@@ -14,7 +14,6 @@
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/module.h> 15#include <linux/module.h>
16 16
17#include <asm/system.h>
18#include <asm/amigahw.h> 17#include <asm/amigahw.h>
19 18
20static unsigned short *snd_data; 19static unsigned short *snd_data;
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index b95a451b1c3..ee01b7a38e5 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -29,7 +29,6 @@
29 29
30#include <asm/bootinfo.h> 30#include <asm/bootinfo.h>
31#include <asm/setup.h> 31#include <asm/setup.h>
32#include <asm/system.h>
33#include <asm/pgtable.h> 32#include <asm/pgtable.h>
34#include <asm/amigahw.h> 33#include <asm/amigahw.h>
35#include <asm/amigaints.h> 34#include <asm/amigaints.h>
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index 8d3eafab1ff..0a30406b944 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -9,7 +9,6 @@
9 9
10#include <asm/setup.h> 10#include <asm/setup.h>
11#include <asm/bootinfo.h> 11#include <asm/bootinfo.h>
12#include <asm/system.h>
13#include <asm/pgtable.h> 12#include <asm/pgtable.h>
14#include <asm/apollohw.h> 13#include <asm/apollohw.h>
15#include <asm/irq.h> 14#include <asm/irq.h>
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c
index 8048e1b7e55..783d8f02360 100644
--- a/arch/m68k/atari/ataints.c
+++ b/arch/m68k/atari/ataints.c
@@ -42,7 +42,6 @@
42#include <linux/seq_file.h> 42#include <linux/seq_file.h>
43#include <linux/module.h> 43#include <linux/module.h>
44 44
45#include <asm/system.h>
46#include <asm/traps.h> 45#include <asm/traps.h>
47 46
48#include <asm/atarihw.h> 47#include <asm/atarihw.h>
diff --git a/arch/m68k/atari/atasound.c b/arch/m68k/atari/atasound.c
index d266fe89c12..1c1181ebb94 100644
--- a/arch/m68k/atari/atasound.c
+++ b/arch/m68k/atari/atasound.c
@@ -25,7 +25,6 @@
25#include <linux/module.h> 25#include <linux/module.h>
26 26
27#include <asm/atarihw.h> 27#include <asm/atarihw.h>
28#include <asm/system.h>
29#include <asm/irq.h> 28#include <asm/irq.h>
30#include <asm/pgtable.h> 29#include <asm/pgtable.h>
31#include <asm/atariints.h> 30#include <asm/atariints.h>
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index c4ac15c4f06..d8eb32747ac 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -39,7 +39,6 @@
39#include <asm/atarihw.h> 39#include <asm/atarihw.h>
40#include <asm/atariints.h> 40#include <asm/atariints.h>
41#include <asm/atari_stram.h> 41#include <asm/atari_stram.h>
42#include <asm/system.h>
43#include <asm/machdep.h> 42#include <asm/machdep.h>
44#include <asm/hwtest.h> 43#include <asm/hwtest.h>
45#include <asm/io.h> 44#include <asm/io.h>
diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c
index 81286476f74..0bf850a20ea 100644
--- a/arch/m68k/bvme6000/config.c
+++ b/arch/m68k/bvme6000/config.c
@@ -28,7 +28,6 @@
28#include <linux/bcd.h> 28#include <linux/bcd.h>
29 29
30#include <asm/bootinfo.h> 30#include <asm/bootinfo.h>
31#include <asm/system.h>
32#include <asm/pgtable.h> 31#include <asm/pgtable.h>
33#include <asm/setup.h> 32#include <asm/setup.h>
34#include <asm/irq.h> 33#include <asm/irq.h>
diff --git a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c
index 1c4d4c7bf4d..cf12a17dc28 100644
--- a/arch/m68k/bvme6000/rtc.c
+++ b/arch/m68k/bvme6000/rtc.c
@@ -21,7 +21,6 @@
21 21
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <asm/system.h>
25#include <asm/setup.h> 24#include <asm/setup.h>
26 25
27/* 26/*
diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c
index c87fe69b072..29a71be9fa5 100644
--- a/arch/m68k/hp300/time.c
+++ b/arch/m68k/hp300/time.c
@@ -15,7 +15,6 @@
15#include <asm/machdep.h> 15#include <asm/machdep.h>
16#include <asm/irq.h> 16#include <asm/irq.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/system.h>
19#include <asm/traps.h> 18#include <asm/traps.h>
20#include <asm/blinken.h> 19#include <asm/blinken.h>
21 20
diff --git a/arch/m68k/include/asm/atomic.h b/arch/m68k/include/asm/atomic.h
index 4eba796c00d..336e6173794 100644
--- a/arch/m68k/include/asm/atomic.h
+++ b/arch/m68k/include/asm/atomic.h
@@ -2,7 +2,7 @@
2#define __ARCH_M68K_ATOMIC__ 2#define __ARCH_M68K_ATOMIC__
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/system.h> 5#include <linux/irqflags.h>
6 6
7/* 7/*
8 * Atomic operations that C can't guarantee us. Useful for 8 * Atomic operations that C can't guarantee us. Useful for
diff --git a/arch/m68k/include/asm/barrier.h b/arch/m68k/include/asm/barrier.h
new file mode 100644
index 00000000000..445ce22c23c
--- /dev/null
+++ b/arch/m68k/include/asm/barrier.h
@@ -0,0 +1,20 @@
1#ifndef _M68K_BARRIER_H
2#define _M68K_BARRIER_H
3
4/*
5 * Force strict CPU ordering.
6 * Not really required on m68k...
7 */
8#define nop() do { asm volatile ("nop"); barrier(); } while (0)
9#define mb() barrier()
10#define rmb() barrier()
11#define wmb() barrier()
12#define read_barrier_depends() ((void)0)
13#define set_mb(var, value) ({ (var) = (value); wmb(); })
14
15#define smp_mb() barrier()
16#define smp_rmb() barrier()
17#define smp_wmb() barrier()
18#define smp_read_barrier_depends() ((void)0)
19
20#endif /* _M68K_BARRIER_H */
diff --git a/arch/m68k/include/asm/system.h b/arch/m68k/include/asm/cmpxchg.h
index 8dc68178716..5c81d0eae5c 100644
--- a/arch/m68k/include/asm/system.h
+++ b/arch/m68k/include/asm/cmpxchg.h
@@ -1,74 +1,13 @@
1#ifndef _M68K_SYSTEM_H 1#ifndef __ARCH_M68K_CMPXCHG__
2#define _M68K_SYSTEM_H 2#define __ARCH_M68K_CMPXCHG__
3 3
4#include <linux/linkage.h>
5#include <linux/kernel.h>
6#include <linux/bug.h>
7#include <linux/irqflags.h> 4#include <linux/irqflags.h>
8#include <asm/segment.h>
9#include <asm/entry.h>
10
11#ifdef __KERNEL__
12
13/*
14 * switch_to(n) should switch tasks to task ptr, first checking that
15 * ptr isn't the current task, in which case it does nothing. This
16 * also clears the TS-flag if the task we switched to has used the
17 * math co-processor latest.
18 */
19/*
20 * switch_to() saves the extra registers, that are not saved
21 * automatically by SAVE_SWITCH_STACK in resume(), ie. d0-d5 and
22 * a0-a1. Some of these are used by schedule() and its predecessors
23 * and so we might get see unexpected behaviors when a task returns
24 * with unexpected register values.
25 *
26 * syscall stores these registers itself and none of them are used
27 * by syscall after the function in the syscall has been called.
28 *
29 * Beware that resume now expects *next to be in d1 and the offset of
30 * tss to be in a1. This saves a few instructions as we no longer have
31 * to push them onto the stack and read them back right after.
32 *
33 * 02/17/96 - Jes Sorensen (jds@kom.auc.dk)
34 *
35 * Changed 96/09/19 by Andreas Schwab
36 * pass prev in a0, next in a1
37 */
38asmlinkage void resume(void);
39#define switch_to(prev,next,last) do { \
40 register void *_prev __asm__ ("a0") = (prev); \
41 register void *_next __asm__ ("a1") = (next); \
42 register void *_last __asm__ ("d1"); \
43 __asm__ __volatile__("jbsr resume" \
44 : "=a" (_prev), "=a" (_next), "=d" (_last) \
45 : "0" (_prev), "1" (_next) \
46 : "d0", "d2", "d3", "d4", "d5"); \
47 (last) = _last; \
48} while (0)
49
50
51/*
52 * Force strict CPU ordering.
53 * Not really required on m68k...
54 */
55#define nop() do { asm volatile ("nop"); barrier(); } while (0)
56#define mb() barrier()
57#define rmb() barrier()
58#define wmb() barrier()
59#define read_barrier_depends() ((void)0)
60#define set_mb(var, value) ({ (var) = (value); wmb(); })
61
62#define smp_mb() barrier()
63#define smp_rmb() barrier()
64#define smp_wmb() barrier()
65#define smp_read_barrier_depends() ((void)0)
66
67#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
68 5
69struct __xchg_dummy { unsigned long a[100]; }; 6struct __xchg_dummy { unsigned long a[100]; };
70#define __xg(x) ((volatile struct __xchg_dummy *)(x)) 7#define __xg(x) ((volatile struct __xchg_dummy *)(x))
71 8
9extern unsigned long __invalid_xchg_size(unsigned long, volatile void *, int);
10
72#ifndef CONFIG_RMW_INSNS 11#ifndef CONFIG_RMW_INSNS
73static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) 12static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
74{ 13{
@@ -93,7 +32,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
93 x = tmp; 32 x = tmp;
94 break; 33 break;
95 default: 34 default:
96 BUG(); 35 tmp = __invalid_xchg_size(x, ptr, size);
36 break;
97 } 37 }
98 38
99 local_irq_restore(flags); 39 local_irq_restore(flags);
@@ -103,7 +43,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
103static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) 43static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
104{ 44{
105 switch (size) { 45 switch (size) {
106 case 1: 46 case 1:
107 __asm__ __volatile__ 47 __asm__ __volatile__
108 ("moveb %2,%0\n\t" 48 ("moveb %2,%0\n\t"
109 "1:\n\t" 49 "1:\n\t"
@@ -111,7 +51,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
111 "jne 1b" 51 "jne 1b"
112 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory"); 52 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory");
113 break; 53 break;
114 case 2: 54 case 2:
115 __asm__ __volatile__ 55 __asm__ __volatile__
116 ("movew %2,%0\n\t" 56 ("movew %2,%0\n\t"
117 "1:\n\t" 57 "1:\n\t"
@@ -119,7 +59,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
119 "jne 1b" 59 "jne 1b"
120 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory"); 60 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory");
121 break; 61 break;
122 case 4: 62 case 4:
123 __asm__ __volatile__ 63 __asm__ __volatile__
124 ("movel %2,%0\n\t" 64 ("movel %2,%0\n\t"
125 "1:\n\t" 65 "1:\n\t"
@@ -127,15 +67,23 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
127 "jne 1b" 67 "jne 1b"
128 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory"); 68 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory");
129 break; 69 break;
70 default:
71 x = __invalid_xchg_size(x, ptr, size);
72 break;
130 } 73 }
131 return x; 74 return x;
132} 75}
133#endif 76#endif
134 77
78#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
79
135#include <asm-generic/cmpxchg-local.h> 80#include <asm-generic/cmpxchg-local.h>
136 81
137#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 82#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
138 83
84extern unsigned long __invalid_cmpxchg_size(volatile void *,
85 unsigned long, unsigned long, int);
86
139/* 87/*
140 * Atomic compare and exchange. Compare OLD with MEM, if identical, 88 * Atomic compare and exchange. Compare OLD with MEM, if identical,
141 * store NEW in MEM. Return the initial value in MEM. Success is 89 * store NEW in MEM. Return the initial value in MEM. Success is
@@ -163,6 +111,9 @@ static inline unsigned long __cmpxchg(volatile void *p, unsigned long old,
163 : "=d" (old), "=m" (*(int *)p) 111 : "=d" (old), "=m" (*(int *)p)
164 : "d" (new), "0" (old), "m" (*(int *)p)); 112 : "d" (new), "0" (old), "m" (*(int *)p));
165 break; 113 break;
114 default:
115 old = __invalid_cmpxchg_size(p, old, new, size);
116 break;
166 } 117 }
167 return old; 118 return old;
168} 119}
@@ -187,8 +138,4 @@ static inline unsigned long __cmpxchg(volatile void *p, unsigned long old,
187 138
188#endif 139#endif
189 140
190#define arch_align_stack(x) (x) 141#endif /* __ARCH_M68K_CMPXCHG__ */
191
192#endif /* __KERNEL__ */
193
194#endif /* _M68K_SYSTEM_H */
diff --git a/arch/m68k/include/asm/exec.h b/arch/m68k/include/asm/exec.h
new file mode 100644
index 00000000000..0499adf9023
--- /dev/null
+++ b/arch/m68k/include/asm/exec.h
@@ -0,0 +1,6 @@
1#ifndef _M68K_EXEC_H
2#define _M68K_EXEC_H
3
4#define arch_align_stack(x) (x)
5
6#endif /* _M68K_EXEC_H */
diff --git a/arch/m68k/include/asm/sun3xflop.h b/arch/m68k/include/asm/sun3xflop.h
index 32c45f84ac6..95231e2f9d6 100644
--- a/arch/m68k/include/asm/sun3xflop.h
+++ b/arch/m68k/include/asm/sun3xflop.h
@@ -11,7 +11,6 @@
11 11
12#include <asm/page.h> 12#include <asm/page.h>
13#include <asm/pgtable.h> 13#include <asm/pgtable.h>
14#include <asm/system.h>
15#include <asm/irq.h> 14#include <asm/irq.h>
16#include <asm/sun3x.h> 15#include <asm/sun3x.h>
17 16
diff --git a/arch/m68k/include/asm/switch_to.h b/arch/m68k/include/asm/switch_to.h
new file mode 100644
index 00000000000..16fd6b63498
--- /dev/null
+++ b/arch/m68k/include/asm/switch_to.h
@@ -0,0 +1,41 @@
1#ifndef _M68K_SWITCH_TO_H
2#define _M68K_SWITCH_TO_H
3
4/*
5 * switch_to(n) should switch tasks to task ptr, first checking that
6 * ptr isn't the current task, in which case it does nothing. This
7 * also clears the TS-flag if the task we switched to has used the
8 * math co-processor latest.
9 */
10/*
11 * switch_to() saves the extra registers, that are not saved
12 * automatically by SAVE_SWITCH_STACK in resume(), ie. d0-d5 and
13 * a0-a1. Some of these are used by schedule() and its predecessors
14 * and so we might get see unexpected behaviors when a task returns
15 * with unexpected register values.
16 *
17 * syscall stores these registers itself and none of them are used
18 * by syscall after the function in the syscall has been called.
19 *
20 * Beware that resume now expects *next to be in d1 and the offset of
21 * tss to be in a1. This saves a few instructions as we no longer have
22 * to push them onto the stack and read them back right after.
23 *
24 * 02/17/96 - Jes Sorensen (jds@kom.auc.dk)
25 *
26 * Changed 96/09/19 by Andreas Schwab
27 * pass prev in a0, next in a1
28 */
29asmlinkage void resume(void);
30#define switch_to(prev,next,last) do { \
31 register void *_prev __asm__ ("a0") = (prev); \
32 register void *_next __asm__ ("a1") = (next); \
33 register void *_last __asm__ ("d1"); \
34 __asm__ __volatile__("jbsr resume" \
35 : "=a" (_prev), "=a" (_next), "=d" (_last) \
36 : "0" (_prev), "1" (_next) \
37 : "d0", "d2", "d3", "d4", "d5"); \
38 (last) = _last; \
39} while (0)
40
41#endif /* _M68K_SWITCH_TO_H */
diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c
index 74fefac0089..6b32b64bac3 100644
--- a/arch/m68k/kernel/ints.c
+++ b/arch/m68k/kernel/ints.c
@@ -15,7 +15,6 @@
15#include <linux/init.h> 15#include <linux/init.h>
16 16
17#include <asm/setup.h> 17#include <asm/setup.h>
18#include <asm/system.h>
19#include <asm/irq.h> 18#include <asm/irq.h>
20#include <asm/traps.h> 19#include <asm/traps.h>
21#include <asm/page.h> 20#include <asm/page.h>
diff --git a/arch/m68k/kernel/irq.c b/arch/m68k/kernel/irq.c
index c73988cfa90..9ab4f550342 100644
--- a/arch/m68k/kernel/irq.c
+++ b/arch/m68k/kernel/irq.c
@@ -15,7 +15,6 @@
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/irq.h> 16#include <linux/irq.h>
17#include <linux/seq_file.h> 17#include <linux/seq_file.h>
18#include <asm/system.h>
19#include <asm/traps.h> 18#include <asm/traps.h>
20 19
21asmlinkage void do_IRQ(int irq, struct pt_regs *regs) 20asmlinkage void do_IRQ(int irq, struct pt_regs *regs)
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index c54ef927e48..c488e3cfab5 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -27,7 +27,6 @@
27#include <linux/mqueue.h> 27#include <linux/mqueue.h>
28 28
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <asm/system.h>
31#include <asm/traps.h> 30#include <asm/traps.h>
32#include <asm/machdep.h> 31#include <asm/machdep.h>
33#include <asm/setup.h> 32#include <asm/setup.h>
diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c
index 149a05f8b9e..8b4a2222e65 100644
--- a/arch/m68k/kernel/ptrace.c
+++ b/arch/m68k/kernel/ptrace.c
@@ -23,7 +23,6 @@
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <asm/page.h> 24#include <asm/page.h>
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/system.h>
27#include <asm/processor.h> 26#include <asm/processor.h>
28 27
29/* 28/*
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index daaa9187654..388e5cc8959 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -32,7 +32,6 @@
32 32
33#include <asm/setup.h> 33#include <asm/setup.h>
34#include <asm/fpu.h> 34#include <asm/fpu.h>
35#include <asm/system.h>
36#include <asm/uaccess.h> 35#include <asm/uaccess.h>
37#include <asm/traps.h> 36#include <asm/traps.h>
38#include <asm/pgalloc.h> 37#include <asm/pgalloc.h>
diff --git a/arch/m68k/kernel/vectors.c b/arch/m68k/kernel/vectors.c
index 147b03fbc71..322c977bb9e 100644
--- a/arch/m68k/kernel/vectors.c
+++ b/arch/m68k/kernel/vectors.c
@@ -25,7 +25,6 @@
25 25
26#include <asm/setup.h> 26#include <asm/setup.h>
27#include <asm/fpu.h> 27#include <asm/fpu.h>
28#include <asm/system.h>
29#include <asm/traps.h> 28#include <asm/traps.h>
30 29
31/* assembler routines */ 30/* assembler routines */
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index f60ff5f5920..96fa6ed7e79 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -30,7 +30,6 @@
30#include <asm/setup.h> 30#include <asm/setup.h>
31#include <asm/bootinfo.h> 31#include <asm/bootinfo.h>
32 32
33#include <asm/system.h>
34#include <asm/io.h> 33#include <asm/io.h>
35#include <asm/irq.h> 34#include <asm/irq.h>
36#include <asm/pgtable.h> 35#include <asm/pgtable.h>
diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
index eb915551de6..5e085554ac7 100644
--- a/arch/m68k/mac/misc.c
+++ b/arch/m68k/mac/misc.c
@@ -19,7 +19,6 @@
19#include <asm/uaccess.h> 19#include <asm/uaccess.h>
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/rtc.h> 21#include <asm/rtc.h>
22#include <asm/system.h>
23#include <asm/segment.h> 22#include <asm/segment.h>
24#include <asm/setup.h> 23#include <asm/setup.h>
25#include <asm/macintosh.h> 24#include <asm/macintosh.h>
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
index 2db6099784b..6b020a8461e 100644
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -13,7 +13,6 @@
13 13
14#include <asm/setup.h> 14#include <asm/setup.h>
15#include <asm/traps.h> 15#include <asm/traps.h>
16#include <asm/system.h>
17#include <asm/uaccess.h> 16#include <asm/uaccess.h>
18#include <asm/pgalloc.h> 17#include <asm/pgalloc.h>
19 18
diff --git a/arch/m68k/mm/init_mm.c b/arch/m68k/mm/init_mm.c
index 89f3b203814..f77f258dce3 100644
--- a/arch/m68k/mm/init_mm.c
+++ b/arch/m68k/mm/init_mm.c
@@ -23,7 +23,6 @@
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <asm/page.h> 24#include <asm/page.h>
25#include <asm/pgalloc.h> 25#include <asm/pgalloc.h>
26#include <asm/system.h>
27#include <asm/traps.h> 26#include <asm/traps.h>
28#include <asm/machdep.h> 27#include <asm/machdep.h>
29#include <asm/io.h> 28#include <asm/io.h>
diff --git a/arch/m68k/mm/init_no.c b/arch/m68k/mm/init_no.c
index 1e33d39ca9a..345ec0d83e3 100644
--- a/arch/m68k/mm/init_no.c
+++ b/arch/m68k/mm/init_no.c
@@ -36,7 +36,6 @@
36#include <asm/segment.h> 36#include <asm/segment.h>
37#include <asm/page.h> 37#include <asm/page.h>
38#include <asm/pgtable.h> 38#include <asm/pgtable.h>
39#include <asm/system.h>
40#include <asm/machdep.h> 39#include <asm/machdep.h>
41 40
42/* 41/*
diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c
index 1cc2bed4c3d..568cfad3ceb 100644
--- a/arch/m68k/mm/kmap.c
+++ b/arch/m68k/mm/kmap.c
@@ -20,7 +20,6 @@
20#include <asm/page.h> 20#include <asm/page.h>
21#include <asm/pgalloc.h> 21#include <asm/pgalloc.h>
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/system.h>
24 23
25#undef DEBUG 24#undef DEBUG
26 25
diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c
index a5dbb74fe1d..250b8b786f4 100644
--- a/arch/m68k/mm/memory.c
+++ b/arch/m68k/mm/memory.c
@@ -17,7 +17,6 @@
17#include <asm/segment.h> 17#include <asm/segment.h>
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/pgalloc.h> 19#include <asm/pgalloc.h>
20#include <asm/system.h>
21#include <asm/traps.h> 20#include <asm/traps.h>
22#include <asm/machdep.h> 21#include <asm/machdep.h>
23 22
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 8b3db1c587f..0dafa693515 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -24,7 +24,6 @@
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25#include <asm/page.h> 25#include <asm/page.h>
26#include <asm/pgalloc.h> 26#include <asm/pgalloc.h>
27#include <asm/system.h>
28#include <asm/machdep.h> 27#include <asm/machdep.h>
29#include <asm/io.h> 28#include <asm/io.h>
30#include <asm/dma.h> 29#include <asm/dma.h>
diff --git a/arch/m68k/mm/sun3mmu.c b/arch/m68k/mm/sun3mmu.c
index 1b902dbd437..e0804060501 100644
--- a/arch/m68k/mm/sun3mmu.c
+++ b/arch/m68k/mm/sun3mmu.c
@@ -21,7 +21,6 @@
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/page.h> 22#include <asm/page.h>
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/system.h>
25#include <asm/machdep.h> 24#include <asm/machdep.h>
26#include <asm/io.h> 25#include <asm/io.h>
27 26
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
index 5de924ef42e..a41c09149e2 100644
--- a/arch/m68k/mvme147/config.c
+++ b/arch/m68k/mvme147/config.c
@@ -26,7 +26,6 @@
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27 27
28#include <asm/bootinfo.h> 28#include <asm/bootinfo.h>
29#include <asm/system.h>
30#include <asm/pgtable.h> 29#include <asm/pgtable.h>
31#include <asm/setup.h> 30#include <asm/setup.h>
32#include <asm/irq.h> 31#include <asm/irq.h>
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index c3fb3bdd7ed..b6d7d8a7a3d 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -29,7 +29,6 @@
29#include <linux/module.h> 29#include <linux/module.h>
30 30
31#include <asm/bootinfo.h> 31#include <asm/bootinfo.h>
32#include <asm/system.h>
33#include <asm/pgtable.h> 32#include <asm/pgtable.h>
34#include <asm/setup.h> 33#include <asm/setup.h>
35#include <asm/irq.h> 34#include <asm/irq.h>
diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c
index 39c79ebcd18..6ef7a81a3b1 100644
--- a/arch/m68k/mvme16x/rtc.c
+++ b/arch/m68k/mvme16x/rtc.c
@@ -20,7 +20,6 @@
20 20
21#include <asm/io.h> 21#include <asm/io.h>
22#include <asm/uaccess.h> 22#include <asm/uaccess.h>
23#include <asm/system.h>
24#include <asm/setup.h> 23#include <asm/setup.h>
25 24
26/* 25/*
diff --git a/arch/m68k/platform/68328/config.c b/arch/m68k/platform/68328/config.c
index 44b86654431..8c20e891e98 100644
--- a/arch/m68k/platform/68328/config.c
+++ b/arch/m68k/platform/68328/config.c
@@ -18,7 +18,6 @@
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/rtc.h> 20#include <linux/rtc.h>
21#include <asm/system.h>
22#include <asm/machdep.h> 21#include <asm/machdep.h>
23#include <asm/MC68328.h> 22#include <asm/MC68328.h>
24#if defined(CONFIG_PILOT) || defined(CONFIG_INIT_LCD) 23#if defined(CONFIG_PILOT) || defined(CONFIG_INIT_LCD)
diff --git a/arch/m68k/platform/68328/timers.c b/arch/m68k/platform/68328/timers.c
index b15ddef1ec7..c801c172b82 100644
--- a/arch/m68k/platform/68328/timers.c
+++ b/arch/m68k/platform/68328/timers.c
@@ -22,7 +22,6 @@
22#include <linux/clocksource.h> 22#include <linux/clocksource.h>
23#include <linux/rtc.h> 23#include <linux/rtc.h>
24#include <asm/setup.h> 24#include <asm/setup.h>
25#include <asm/system.h>
26#include <asm/pgtable.h> 25#include <asm/pgtable.h>
27#include <asm/machdep.h> 26#include <asm/machdep.h>
28#include <asm/MC68VZ328.h> 27#include <asm/MC68VZ328.h>
diff --git a/arch/m68k/platform/68360/config.c b/arch/m68k/platform/68360/config.c
index 599a5949f32..255fc03913e 100644
--- a/arch/m68k/platform/68360/config.c
+++ b/arch/m68k/platform/68360/config.c
@@ -18,7 +18,6 @@
18#include <linux/irq.h> 18#include <linux/irq.h>
19 19
20#include <asm/setup.h> 20#include <asm/setup.h>
21#include <asm/system.h>
22#include <asm/pgtable.h> 21#include <asm/pgtable.h>
23#include <asm/machdep.h> 22#include <asm/machdep.h>
24#include <asm/m68360.h> 23#include <asm/m68360.h>
diff --git a/arch/m68k/platform/68EZ328/config.c b/arch/m68k/platform/68EZ328/config.c
index dd2c5355434..4f158d551f0 100644
--- a/arch/m68k/platform/68EZ328/config.c
+++ b/arch/m68k/platform/68EZ328/config.c
@@ -16,7 +16,6 @@
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/rtc.h> 18#include <linux/rtc.h>
19#include <asm/system.h>
20#include <asm/pgtable.h> 19#include <asm/pgtable.h>
21#include <asm/machdep.h> 20#include <asm/machdep.h>
22#include <asm/MC68EZ328.h> 21#include <asm/MC68EZ328.h>
diff --git a/arch/m68k/platform/68VZ328/config.c b/arch/m68k/platform/68VZ328/config.c
index 25ec673edc2..2ed8dc305e4 100644
--- a/arch/m68k/platform/68VZ328/config.c
+++ b/arch/m68k/platform/68VZ328/config.c
@@ -22,7 +22,6 @@
22#include <linux/irq.h> 22#include <linux/irq.h>
23#include <linux/rtc.h> 23#include <linux/rtc.h>
24 24
25#include <asm/system.h>
26#include <asm/pgtable.h> 25#include <asm/pgtable.h>
27#include <asm/machdep.h> 26#include <asm/machdep.h>
28#include <asm/MC68VZ328.h> 27#include <asm/MC68VZ328.h>
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index be936480b96..512adb64f7d 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -29,7 +29,6 @@
29#include <asm/io.h> 29#include <asm/io.h>
30#include <asm/rtc.h> 30#include <asm/rtc.h>
31#include <asm/bootinfo.h> 31#include <asm/bootinfo.h>
32#include <asm/system.h>
33#include <asm/pgtable.h> 32#include <asm/pgtable.h>
34#include <asm/setup.h> 33#include <asm/setup.h>
35#include <asm/irq.h> 34#include <asm/irq.h>
diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c
index 2b888491f29..513f9bb17b9 100644
--- a/arch/m68k/q40/q40ints.c
+++ b/arch/m68k/q40/q40ints.c
@@ -18,7 +18,6 @@
18#include <linux/irq.h> 18#include <linux/irq.h>
19 19
20#include <asm/ptrace.h> 20#include <asm/ptrace.h>
21#include <asm/system.h>
22#include <asm/traps.h> 21#include <asm/traps.h>
23 22
24#include <asm/q40_master.h> 23#include <asm/q40_master.h>
diff --git a/arch/m68k/sun3/intersil.c b/arch/m68k/sun3/intersil.c
index 0116d208d30..94fe8016f1f 100644
--- a/arch/m68k/sun3/intersil.c
+++ b/arch/m68k/sun3/intersil.c
@@ -14,7 +14,6 @@
14#include <linux/rtc.h> 14#include <linux/rtc.h>
15 15
16#include <asm/errno.h> 16#include <asm/errno.h>
17#include <asm/system.h>
18#include <asm/rtc.h> 17#include <asm/rtc.h>
19#include <asm/intersil.h> 18#include <asm/intersil.h>
20 19
diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c
index 94f81ecfe3f..8edc510a21b 100644
--- a/arch/m68k/sun3/mmu_emu.c
+++ b/arch/m68k/sun3/mmu_emu.c
@@ -17,7 +17,6 @@
17 17
18#include <asm/setup.h> 18#include <asm/setup.h>
19#include <asm/traps.h> 19#include <asm/traps.h>
20#include <asm/system.h>
21#include <asm/uaccess.h> 20#include <asm/uaccess.h>
22#include <asm/page.h> 21#include <asm/page.h>
23#include <asm/pgtable.h> 22#include <asm/pgtable.h>
diff --git a/arch/m68k/sun3/prom/console.c b/arch/m68k/sun3/prom/console.c
index 2bcb6e4bfe5..e92364373b0 100644
--- a/arch/m68k/sun3/prom/console.c
+++ b/arch/m68k/sun3/prom/console.c
@@ -10,7 +10,6 @@
10#include <linux/sched.h> 10#include <linux/sched.h>
11#include <asm/openprom.h> 11#include <asm/openprom.h>
12#include <asm/oplib.h> 12#include <asm/oplib.h>
13#include <asm/system.h>
14#include <linux/string.h> 13#include <linux/string.h>
15 14
16/* Non blocking get character from console input device, returns -1 15/* Non blocking get character from console input device, returns -1
diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c
index fc599fad4a5..dd306c84d36 100644
--- a/arch/m68k/sun3x/config.c
+++ b/arch/m68k/sun3x/config.c
@@ -12,7 +12,6 @@
12#include <linux/console.h> 12#include <linux/console.h>
13#include <linux/init.h> 13#include <linux/init.h>
14 14
15#include <asm/system.h>
16#include <asm/machdep.h> 15#include <asm/machdep.h>
17#include <asm/irq.h> 16#include <asm/irq.h>
18#include <asm/sun3xprom.h> 17#include <asm/sun3xprom.h>
diff --git a/arch/m68k/sun3x/time.c b/arch/m68k/sun3x/time.c
index 536a04aaf22..1d0a7248040 100644
--- a/arch/m68k/sun3x/time.c
+++ b/arch/m68k/sun3x/time.c
@@ -15,7 +15,6 @@
15 15
16#include <asm/irq.h> 16#include <asm/irq.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/system.h>
19#include <asm/traps.h> 18#include <asm/traps.h>
20#include <asm/sun3x.h> 19#include <asm/sun3x.h>
21#include <asm/sun3ints.h> 20#include <asm/sun3ints.h>
diff --git a/arch/microblaze/include/asm/atomic.h b/arch/microblaze/include/asm/atomic.h
index 615f53992c6..472d8bf726d 100644
--- a/arch/microblaze/include/asm/atomic.h
+++ b/arch/microblaze/include/asm/atomic.h
@@ -1,6 +1,7 @@
1#ifndef _ASM_MICROBLAZE_ATOMIC_H 1#ifndef _ASM_MICROBLAZE_ATOMIC_H
2#define _ASM_MICROBLAZE_ATOMIC_H 2#define _ASM_MICROBLAZE_ATOMIC_H
3 3
4#include <asm/cmpxchg.h>
4#include <asm-generic/atomic.h> 5#include <asm-generic/atomic.h>
5#include <asm-generic/atomic64.h> 6#include <asm-generic/atomic64.h>
6 7
diff --git a/arch/microblaze/include/asm/barrier.h b/arch/microblaze/include/asm/barrier.h
new file mode 100644
index 00000000000..df5be3e8704
--- /dev/null
+++ b/arch/microblaze/include/asm/barrier.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_BARRIER_H
10#define _ASM_MICROBLAZE_BARRIER_H
11
12#define nop() asm volatile ("nop")
13
14#define smp_read_barrier_depends() do {} while (0)
15#define read_barrier_depends() do {} while (0)
16
17#define mb() barrier()
18#define rmb() mb()
19#define wmb() mb()
20#define set_mb(var, value) do { var = value; mb(); } while (0)
21#define set_wmb(var, value) do { var = value; wmb(); } while (0)
22
23#define smp_mb() mb()
24#define smp_rmb() rmb()
25#define smp_wmb() wmb()
26
27#endif /* _ASM_MICROBLAZE_BARRIER_H */
diff --git a/arch/microblaze/include/asm/cmpxchg.h b/arch/microblaze/include/asm/cmpxchg.h
new file mode 100644
index 00000000000..0094859abd9
--- /dev/null
+++ b/arch/microblaze/include/asm/cmpxchg.h
@@ -0,0 +1,40 @@
1#ifndef _ASM_MICROBLAZE_CMPXCHG_H
2#define _ASM_MICROBLAZE_CMPXCHG_H
3
4void __bad_xchg(volatile void *ptr, int size);
5
6static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
7 int size)
8{
9 unsigned long ret;
10 unsigned long flags;
11
12 switch (size) {
13 case 1:
14 local_irq_save(flags);
15 ret = *(volatile unsigned char *)ptr;
16 *(volatile unsigned char *)ptr = x;
17 local_irq_restore(flags);
18 break;
19
20 case 4:
21 local_irq_save(flags);
22 ret = *(volatile unsigned long *)ptr;
23 *(volatile unsigned long *)ptr = x;
24 local_irq_restore(flags);
25 break;
26 default:
27 __bad_xchg(ptr, size), ret = 0;
28 break;
29 }
30
31 return ret;
32}
33
34#define xchg(ptr, x) \
35 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
36
37#include <asm-generic/cmpxchg.h>
38#include <asm-generic/cmpxchg-local.h>
39
40#endif /* _ASM_MICROBLAZE_CMPXCHG_H */
diff --git a/arch/microblaze/include/asm/exec.h b/arch/microblaze/include/asm/exec.h
new file mode 100644
index 00000000000..e750de1fe8f
--- /dev/null
+++ b/arch/microblaze/include/asm/exec.h
@@ -0,0 +1,14 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_EXEC_H
10#define _ASM_MICROBLAZE_EXEC_H
11
12#define arch_align_stack(x) (x)
13
14#endif /* _ASM_MICROBLAZE_EXEC_H */
diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h
index 352cc2352bd..287c5485d28 100644
--- a/arch/microblaze/include/asm/page.h
+++ b/arch/microblaze/include/asm/page.h
@@ -138,6 +138,8 @@ extern unsigned long memory_start;
138extern unsigned long memory_size; 138extern unsigned long memory_size;
139extern unsigned long lowmem_size; 139extern unsigned long lowmem_size;
140 140
141extern unsigned long kernel_tlb;
142
141extern int page_is_ram(unsigned long pfn); 143extern int page_is_ram(unsigned long pfn);
142 144
143# define phys_to_pfn(phys) (PFN_DOWN(phys)) 145# define phys_to_pfn(phys) (PFN_DOWN(phys))
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
index 7283bfb2f7e..510a8e1c16b 100644
--- a/arch/microblaze/include/asm/processor.h
+++ b/arch/microblaze/include/asm/processor.h
@@ -125,7 +125,6 @@ struct thread_struct {
125 .pgdir = swapper_pg_dir, \ 125 .pgdir = swapper_pg_dir, \
126} 126}
127 127
128
129/* Free all resources held by a thread. */ 128/* Free all resources held by a thread. */
130extern inline void release_thread(struct task_struct *dead_task) 129extern inline void release_thread(struct task_struct *dead_task)
131{ 130{
@@ -144,6 +143,8 @@ static inline void exit_thread(void)
144 143
145unsigned long get_wchan(struct task_struct *p); 144unsigned long get_wchan(struct task_struct *p);
146 145
146extern void ret_from_fork(void);
147
147/* The size allocated for kernel stacks. This _must_ be a power of two! */ 148/* The size allocated for kernel stacks. This _must_ be a power of two! */
148# define KERNEL_STACK_SIZE 0x2000 149# define KERNEL_STACK_SIZE 0x2000
149 150
@@ -166,6 +167,14 @@ unsigned long get_wchan(struct task_struct *p);
166# define STACK_TOP TASK_SIZE 167# define STACK_TOP TASK_SIZE
167# define STACK_TOP_MAX STACK_TOP 168# define STACK_TOP_MAX STACK_TOP
168 169
170void disable_hlt(void);
171void enable_hlt(void);
172void default_idle(void);
173
174#ifdef CONFIG_DEBUG_FS
175extern struct dentry *of_debugfs_root;
176#endif
177
169# endif /* __ASSEMBLY__ */ 178# endif /* __ASSEMBLY__ */
170# endif /* CONFIG_MMU */ 179# endif /* CONFIG_MMU */
171#endif /* _ASM_MICROBLAZE_PROCESSOR_H */ 180#endif /* _ASM_MICROBLAZE_PROCESSOR_H */
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
index 9f195c09473..0061aa13a34 100644
--- a/arch/microblaze/include/asm/setup.h
+++ b/arch/microblaze/include/asm/setup.h
@@ -20,6 +20,8 @@ extern unsigned int boot_cpuid; /* move to smp.h */
20 20
21extern char cmd_line[COMMAND_LINE_SIZE]; 21extern char cmd_line[COMMAND_LINE_SIZE];
22 22
23extern char *klimit;
24
23void early_printk(const char *fmt, ...); 25void early_printk(const char *fmt, ...);
24 26
25int setup_early_printk(char *opt); 27int setup_early_printk(char *opt);
@@ -47,6 +49,10 @@ void machine_shutdown(void);
47void machine_halt(void); 49void machine_halt(void);
48void machine_power_off(void); 50void machine_power_off(void);
49 51
52void free_init_pages(char *what, unsigned long begin, unsigned long end);
53extern void *alloc_maybe_bootmem(size_t size, gfp_t mask);
54extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
55
50# endif/* __KERNEL__ */ 56# endif/* __KERNEL__ */
51# endif /* __ASSEMBLY__ */ 57# endif /* __ASSEMBLY__ */
52#endif /* _ASM_MICROBLAZE_SETUP_H */ 58#endif /* _ASM_MICROBLAZE_SETUP_H */
diff --git a/arch/microblaze/include/asm/switch_to.h b/arch/microblaze/include/asm/switch_to.h
new file mode 100644
index 00000000000..f45baa2c5e0
--- /dev/null
+++ b/arch/microblaze/include/asm/switch_to.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SWITCH_TO_H
10#define _ASM_MICROBLAZE_SWITCH_TO_H
11
12struct task_struct;
13struct thread_info;
14
15extern struct task_struct *_switch_to(struct thread_info *prev,
16 struct thread_info *next);
17
18#define switch_to(prev, next, last) \
19 do { \
20 (last) = _switch_to(task_thread_info(prev), \
21 task_thread_info(next)); \
22 } while (0)
23
24#endif /* _ASM_MICROBLAZE_SWITCH_TO_H */
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
deleted file mode 100644
index 01228d2b135..00000000000
--- a/arch/microblaze/include/asm/system.h
+++ /dev/null
@@ -1,98 +0,0 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SYSTEM_H
10#define _ASM_MICROBLAZE_SYSTEM_H
11
12#include <asm/registers.h>
13#include <asm/setup.h>
14#include <asm/irqflags.h>
15#include <asm/cache.h>
16
17#include <asm-generic/cmpxchg.h>
18#include <asm-generic/cmpxchg-local.h>
19
20struct task_struct;
21struct thread_info;
22
23extern struct task_struct *_switch_to(struct thread_info *prev,
24 struct thread_info *next);
25
26#define switch_to(prev, next, last) \
27 do { \
28 (last) = _switch_to(task_thread_info(prev), \
29 task_thread_info(next)); \
30 } while (0)
31
32#define smp_read_barrier_depends() do {} while (0)
33#define read_barrier_depends() do {} while (0)
34
35#define nop() asm volatile ("nop")
36#define mb() barrier()
37#define rmb() mb()
38#define wmb() mb()
39#define set_mb(var, value) do { var = value; mb(); } while (0)
40#define set_wmb(var, value) do { var = value; wmb(); } while (0)
41
42#define smp_mb() mb()
43#define smp_rmb() rmb()
44#define smp_wmb() wmb()
45
46void __bad_xchg(volatile void *ptr, int size);
47
48static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
49 int size)
50{
51 unsigned long ret;
52 unsigned long flags;
53
54 switch (size) {
55 case 1:
56 local_irq_save(flags);
57 ret = *(volatile unsigned char *)ptr;
58 *(volatile unsigned char *)ptr = x;
59 local_irq_restore(flags);
60 break;
61
62 case 4:
63 local_irq_save(flags);
64 ret = *(volatile unsigned long *)ptr;
65 *(volatile unsigned long *)ptr = x;
66 local_irq_restore(flags);
67 break;
68 default:
69 __bad_xchg(ptr, size), ret = 0;
70 break;
71 }
72
73 return ret;
74}
75
76void disable_hlt(void);
77void enable_hlt(void);
78void default_idle(void);
79
80#define xchg(ptr, x) \
81 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
82
83void free_init_pages(char *what, unsigned long begin, unsigned long end);
84void free_initmem(void);
85extern char *klimit;
86extern unsigned long kernel_tlb;
87extern void ret_from_fork(void);
88
89extern void *alloc_maybe_bootmem(size_t size, gfp_t mask);
90extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
91
92#ifdef CONFIG_DEBUG_FS
93extern struct dentry *of_debugfs_root;
94#endif
95
96#define arch_align_stack(x) (x)
97
98#endif /* _ASM_MICROBLAZE_SYSTEM_H */
diff --git a/arch/microblaze/kernel/cpu/pvr.c b/arch/microblaze/kernel/cpu/pvr.c
index 488c1ed24e3..3a749d5e71f 100644
--- a/arch/microblaze/kernel/cpu/pvr.c
+++ b/arch/microblaze/kernel/cpu/pvr.c
@@ -12,7 +12,6 @@
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/compiler.h> 14#include <linux/compiler.h>
15#include <asm/system.h>
16#include <asm/exceptions.h> 15#include <asm/exceptions.h>
17#include <asm/pvr.h> 16#include <asm/pvr.h>
18 17
diff --git a/arch/microblaze/kernel/microblaze_ksyms.c b/arch/microblaze/kernel/microblaze_ksyms.c
index 49faeb42959..bb4907c828d 100644
--- a/arch/microblaze/kernel/microblaze_ksyms.c
+++ b/arch/microblaze/kernel/microblaze_ksyms.c
@@ -18,7 +18,6 @@
18#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <asm/page.h> 20#include <asm/page.h>
21#include <asm/system.h>
22#include <linux/ftrace.h> 21#include <linux/ftrace.h>
23#include <linux/uaccess.h> 22#include <linux/uaccess.h>
24 23
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c
index 9155f7d9266..883b92789cd 100644
--- a/arch/microblaze/kernel/process.c
+++ b/arch/microblaze/kernel/process.c
@@ -13,7 +13,6 @@
13#include <linux/pm.h> 13#include <linux/pm.h>
14#include <linux/tick.h> 14#include <linux/tick.h>
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <asm/system.h>
17#include <asm/pgalloc.h> 16#include <asm/pgalloc.h>
18#include <asm/uaccess.h> /* for USER_DS macros */ 17#include <asm/uaccess.h> /* for USER_DS macros */
19#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index 80d314e8190..4a764ccb9f2 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -36,7 +36,6 @@
36#include <asm/processor.h> 36#include <asm/processor.h>
37#include <asm/irq.h> 37#include <asm/irq.h>
38#include <linux/io.h> 38#include <linux/io.h>
39#include <asm/system.h>
40#include <asm/mmu.h> 39#include <asm/mmu.h>
41#include <asm/pgtable.h> 40#include <asm/pgtable.h>
42#include <asm/sections.h> 41#include <asm/sections.h>
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
index 9f79fb3bbfa..71af974aa24 100644
--- a/arch/microblaze/kernel/setup.c
+++ b/arch/microblaze/kernel/setup.c
@@ -30,7 +30,6 @@
30#include <asm/entry.h> 30#include <asm/entry.h>
31#include <asm/cpuinfo.h> 31#include <asm/cpuinfo.h>
32 32
33#include <asm/system.h>
34#include <asm/prom.h> 33#include <asm/prom.h>
35#include <asm/pgtable.h> 34#include <asm/pgtable.h>
36 35
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
index cadfd5608af..522defa7d41 100644
--- a/arch/microblaze/kernel/timer.c
+++ b/arch/microblaze/kernel/timer.c
@@ -27,7 +27,6 @@
27#include <asm/setup.h> 27#include <asm/setup.h>
28#include <asm/prom.h> 28#include <asm/prom.h>
29#include <asm/irq.h> 29#include <asm/irq.h>
30#include <asm/system.h>
31#include <linux/cnt32_to_63.h> 30#include <linux/cnt32_to_63.h>
32 31
33#ifdef CONFIG_SELFMOD_TIMER 32#ifdef CONFIG_SELFMOD_TIMER
diff --git a/arch/microblaze/kernel/traps.c b/arch/microblaze/kernel/traps.c
index ba034d421ec..5541ac55959 100644
--- a/arch/microblaze/kernel/traps.c
+++ b/arch/microblaze/kernel/traps.c
@@ -15,7 +15,6 @@
15#include <linux/debug_locks.h> 15#include <linux/debug_locks.h>
16 16
17#include <asm/exceptions.h> 17#include <asm/exceptions.h>
18#include <asm/system.h>
19#include <asm/unwind.h> 18#include <asm/unwind.h>
20 19
21void trap_init(void) 20void trap_init(void)
diff --git a/arch/microblaze/lib/memcpy.c b/arch/microblaze/lib/memcpy.c
index 52746e718df..fe9c53fafde 100644
--- a/arch/microblaze/lib/memcpy.c
+++ b/arch/microblaze/lib/memcpy.c
@@ -30,7 +30,6 @@
30#include <linux/module.h> 30#include <linux/module.h>
31 31
32#include <linux/string.h> 32#include <linux/string.h>
33#include <asm/system.h>
34 33
35#ifdef __HAVE_ARCH_MEMCPY 34#ifdef __HAVE_ARCH_MEMCPY
36#ifndef CONFIG_OPT_LIB_FUNCTION 35#ifndef CONFIG_OPT_LIB_FUNCTION
diff --git a/arch/microblaze/mm/fault.c b/arch/microblaze/mm/fault.c
index ae97d2ccdc2..c38a265846d 100644
--- a/arch/microblaze/mm/fault.c
+++ b/arch/microblaze/mm/fault.c
@@ -33,7 +33,6 @@
33#include <asm/pgtable.h> 33#include <asm/pgtable.h>
34#include <asm/mmu.h> 34#include <asm/mmu.h>
35#include <asm/mmu_context.h> 35#include <asm/mmu_context.h>
36#include <asm/system.h>
37#include <linux/uaccess.h> 36#include <linux/uaccess.h>
38#include <asm/exceptions.h> 37#include <asm/exceptions.h>
39 38
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c
index 260b2736734..d3a9f012aa0 100644
--- a/arch/mips/cavium-octeon/setup.c
+++ b/arch/mips/cavium-octeon/setup.c
@@ -24,7 +24,6 @@
24#include <asm/processor.h> 24#include <asm/processor.h>
25#include <asm/reboot.h> 25#include <asm/reboot.h>
26#include <asm/smp-ops.h> 26#include <asm/smp-ops.h>
27#include <asm/system.h>
28#include <asm/irq_cpu.h> 27#include <asm/irq_cpu.h>
29#include <asm/mipsregs.h> 28#include <asm/mipsregs.h>
30#include <asm/bootinfo.h> 29#include <asm/bootinfo.h>
diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
index b1535fe409d..c3e2b85c3b0 100644
--- a/arch/mips/cavium-octeon/smp.c
+++ b/arch/mips/cavium-octeon/smp.c
@@ -15,8 +15,8 @@
15#include <linux/module.h> 15#include <linux/module.h>
16 16
17#include <asm/mmu_context.h> 17#include <asm/mmu_context.h>
18#include <asm/system.h>
19#include <asm/time.h> 18#include <asm/time.h>
19#include <asm/setup.h>
20 20
21#include <asm/octeon/octeon.h> 21#include <asm/octeon/octeon.h>
22 22
diff --git a/arch/mips/dec/ecc-berr.c b/arch/mips/dec/ecc-berr.c
index 7abce661b90..5abf4e89421 100644
--- a/arch/mips/dec/ecc-berr.c
+++ b/arch/mips/dec/ecc-berr.c
@@ -24,7 +24,6 @@
24#include <asm/irq_regs.h> 24#include <asm/irq_regs.h>
25#include <asm/processor.h> 25#include <asm/processor.h>
26#include <asm/ptrace.h> 26#include <asm/ptrace.h>
27#include <asm/system.h>
28#include <asm/traps.h> 27#include <asm/traps.h>
29 28
30#include <asm/dec/ecc.h> 29#include <asm/dec/ecc.h>
diff --git a/arch/mips/dec/kn01-berr.c b/arch/mips/dec/kn01-berr.c
index 94d23b4a7dc..44d8a87a8a6 100644
--- a/arch/mips/dec/kn01-berr.c
+++ b/arch/mips/dec/kn01-berr.c
@@ -22,7 +22,6 @@
22#include <asm/mipsregs.h> 22#include <asm/mipsregs.h>
23#include <asm/page.h> 23#include <asm/page.h>
24#include <asm/ptrace.h> 24#include <asm/ptrace.h>
25#include <asm/system.h>
26#include <asm/traps.h> 25#include <asm/traps.h>
27#include <asm/uaccess.h> 26#include <asm/uaccess.h>
28 27
diff --git a/arch/mips/dec/kn02xa-berr.c b/arch/mips/dec/kn02xa-berr.c
index 07ca5405d48..ebb73c51d82 100644
--- a/arch/mips/dec/kn02xa-berr.c
+++ b/arch/mips/dec/kn02xa-berr.c
@@ -21,7 +21,6 @@
21#include <asm/addrspace.h> 21#include <asm/addrspace.h>
22#include <asm/irq_regs.h> 22#include <asm/irq_regs.h>
23#include <asm/ptrace.h> 23#include <asm/ptrace.h>
24#include <asm/system.h>
25#include <asm/traps.h> 24#include <asm/traps.h>
26 25
27#include <asm/dec/kn02ca.h> 26#include <asm/dec/kn02ca.h>
diff --git a/arch/mips/dec/wbflush.c b/arch/mips/dec/wbflush.c
index 925c0525344..43feddd5e19 100644
--- a/arch/mips/dec/wbflush.c
+++ b/arch/mips/dec/wbflush.c
@@ -17,8 +17,8 @@
17#include <linux/init.h> 17#include <linux/init.h>
18 18
19#include <asm/bootinfo.h> 19#include <asm/bootinfo.h>
20#include <asm/system.h>
21#include <asm/wbflush.h> 20#include <asm/wbflush.h>
21#include <asm/barrier.h>
22 22
23static void wbflush_kn01(void); 23static void wbflush_kn01(void);
24static void wbflush_kn210(void); 24static void wbflush_kn210(void);
diff --git a/arch/mips/emma/markeins/irq.c b/arch/mips/emma/markeins/irq.c
index 7798887a128..b5f08255d9c 100644
--- a/arch/mips/emma/markeins/irq.c
+++ b/arch/mips/emma/markeins/irq.c
@@ -27,7 +27,6 @@
27#include <linux/delay.h> 27#include <linux/delay.h>
28 28
29#include <asm/irq_cpu.h> 29#include <asm/irq_cpu.h>
30#include <asm/system.h>
31#include <asm/mipsregs.h> 30#include <asm/mipsregs.h>
32#include <asm/addrspace.h> 31#include <asm/addrspace.h>
33#include <asm/bootinfo.h> 32#include <asm/bootinfo.h>
diff --git a/arch/mips/fw/arc/misc.c b/arch/mips/fw/arc/misc.c
index 29627fbae7a..7cf80ca2c1d 100644
--- a/arch/mips/fw/arc/misc.c
+++ b/arch/mips/fw/arc/misc.c
@@ -17,7 +17,6 @@
17#include <asm/fw/arc/types.h> 17#include <asm/fw/arc/types.h>
18#include <asm/sgialib.h> 18#include <asm/sgialib.h>
19#include <asm/bootinfo.h> 19#include <asm/bootinfo.h>
20#include <asm/system.h>
21 20
22VOID 21VOID
23ArcHalt(VOID) 22ArcHalt(VOID)
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h
index 1d93f81d57e..3f4c5cb6433 100644
--- a/arch/mips/include/asm/atomic.h
+++ b/arch/mips/include/asm/atomic.h
@@ -18,8 +18,8 @@
18#include <linux/types.h> 18#include <linux/types.h>
19#include <asm/barrier.h> 19#include <asm/barrier.h>
20#include <asm/cpu-features.h> 20#include <asm/cpu-features.h>
21#include <asm/cmpxchg.h>
21#include <asm/war.h> 22#include <asm/war.h>
22#include <asm/system.h>
23 23
24#define ATOMIC_INIT(i) { (i) } 24#define ATOMIC_INIT(i) { (i) }
25 25
diff --git a/arch/mips/include/asm/barrier.h b/arch/mips/include/asm/barrier.h
index c0884f02d3a..f7fdc24e972 100644
--- a/arch/mips/include/asm/barrier.h
+++ b/arch/mips/include/asm/barrier.h
@@ -8,6 +8,8 @@
8#ifndef __ASM_BARRIER_H 8#ifndef __ASM_BARRIER_H
9#define __ASM_BARRIER_H 9#define __ASM_BARRIER_H
10 10
11#include <asm/addrspace.h>
12
11/* 13/*
12 * read_barrier_depends - Flush all pending reads that subsequents reads 14 * read_barrier_depends - Flush all pending reads that subsequents reads
13 * depend on. 15 * depend on.
diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h
index d8d1c2805ac..285a41fa0b1 100644
--- a/arch/mips/include/asm/cmpxchg.h
+++ b/arch/mips/include/asm/cmpxchg.h
@@ -9,6 +9,130 @@
9#define __ASM_CMPXCHG_H 9#define __ASM_CMPXCHG_H
10 10
11#include <linux/irqflags.h> 11#include <linux/irqflags.h>
12#include <asm/war.h>
13
14static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
15{
16 __u32 retval;
17
18 smp_mb__before_llsc();
19
20 if (kernel_uses_llsc && R10000_LLSC_WAR) {
21 unsigned long dummy;
22
23 __asm__ __volatile__(
24 " .set mips3 \n"
25 "1: ll %0, %3 # xchg_u32 \n"
26 " .set mips0 \n"
27 " move %2, %z4 \n"
28 " .set mips3 \n"
29 " sc %2, %1 \n"
30 " beqzl %2, 1b \n"
31 " .set mips0 \n"
32 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
33 : "R" (*m), "Jr" (val)
34 : "memory");
35 } else if (kernel_uses_llsc) {
36 unsigned long dummy;
37
38 do {
39 __asm__ __volatile__(
40 " .set mips3 \n"
41 " ll %0, %3 # xchg_u32 \n"
42 " .set mips0 \n"
43 " move %2, %z4 \n"
44 " .set mips3 \n"
45 " sc %2, %1 \n"
46 " .set mips0 \n"
47 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
48 : "R" (*m), "Jr" (val)
49 : "memory");
50 } while (unlikely(!dummy));
51 } else {
52 unsigned long flags;
53
54 raw_local_irq_save(flags);
55 retval = *m;
56 *m = val;
57 raw_local_irq_restore(flags); /* implies memory barrier */
58 }
59
60 smp_llsc_mb();
61
62 return retval;
63}
64
65#ifdef CONFIG_64BIT
66static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
67{
68 __u64 retval;
69
70 smp_mb__before_llsc();
71
72 if (kernel_uses_llsc && R10000_LLSC_WAR) {
73 unsigned long dummy;
74
75 __asm__ __volatile__(
76 " .set mips3 \n"
77 "1: lld %0, %3 # xchg_u64 \n"
78 " move %2, %z4 \n"
79 " scd %2, %1 \n"
80 " beqzl %2, 1b \n"
81 " .set mips0 \n"
82 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
83 : "R" (*m), "Jr" (val)
84 : "memory");
85 } else if (kernel_uses_llsc) {
86 unsigned long dummy;
87
88 do {
89 __asm__ __volatile__(
90 " .set mips3 \n"
91 " lld %0, %3 # xchg_u64 \n"
92 " move %2, %z4 \n"
93 " scd %2, %1 \n"
94 " .set mips0 \n"
95 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
96 : "R" (*m), "Jr" (val)
97 : "memory");
98 } while (unlikely(!dummy));
99 } else {
100 unsigned long flags;
101
102 raw_local_irq_save(flags);
103 retval = *m;
104 *m = val;
105 raw_local_irq_restore(flags); /* implies memory barrier */
106 }
107
108 smp_llsc_mb();
109
110 return retval;
111}
112#else
113extern __u64 __xchg_u64_unsupported_on_32bit_kernels(volatile __u64 * m, __u64 val);
114#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels
115#endif
116
117static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
118{
119 switch (size) {
120 case 4:
121 return __xchg_u32(ptr, x);
122 case 8:
123 return __xchg_u64(ptr, x);
124 }
125
126 return x;
127}
128
129#define xchg(ptr, x) \
130({ \
131 BUILD_BUG_ON(sizeof(*(ptr)) & ~0xc); \
132 \
133 ((__typeof__(*(ptr))) \
134 __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))); \
135})
12 136
13#define __HAVE_ARCH_CMPXCHG 1 137#define __HAVE_ARCH_CMPXCHG 1
14 138
diff --git a/arch/mips/include/asm/dma.h b/arch/mips/include/asm/dma.h
index 2d47da62d5a..f5097f65a8a 100644
--- a/arch/mips/include/asm/dma.h
+++ b/arch/mips/include/asm/dma.h
@@ -15,7 +15,6 @@
15#include <asm/io.h> /* need byte IO */ 15#include <asm/io.h> /* need byte IO */
16#include <linux/spinlock.h> /* And spinlocks */ 16#include <linux/spinlock.h> /* And spinlocks */
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <asm/system.h>
19 18
20 19
21#ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER 20#ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER
diff --git a/arch/mips/include/asm/exec.h b/arch/mips/include/asm/exec.h
new file mode 100644
index 00000000000..c1f6afa4bc4
--- /dev/null
+++ b/arch/mips/include/asm/exec.h
@@ -0,0 +1,17 @@
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) 1994, 95, 96, 97, 98, 99, 2003, 06 by Ralf Baechle
7 * Copyright (C) 1996 by Paul M. Antoine
8 * Copyright (C) 1999 Silicon Graphics
9 * Kevin D. Kissell, kevink@mips.org and Carsten Langgaard, carstenl@mips.com
10 * Copyright (C) 2000 MIPS Technologies, Inc.
11 */
12#ifndef _ASM_EXEC_H
13#define _ASM_EXEC_H
14
15extern unsigned long arch_align_stack(unsigned long sp);
16
17#endif /* _ASM_EXEC_H */
diff --git a/arch/mips/include/asm/mach-au1x00/au1000_dma.h b/arch/mips/include/asm/mach-au1x00/au1000_dma.h
index 59f5b55b220..ba4cf0e91c8 100644
--- a/arch/mips/include/asm/mach-au1x00/au1000_dma.h
+++ b/arch/mips/include/asm/mach-au1x00/au1000_dma.h
@@ -33,7 +33,6 @@
33#include <linux/io.h> /* need byte IO */ 33#include <linux/io.h> /* need byte IO */
34#include <linux/spinlock.h> /* And spinlocks */ 34#include <linux/spinlock.h> /* And spinlocks */
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <asm/system.h>
37 36
38#define NUM_AU1000_DMA_CHANNELS 8 37#define NUM_AU1000_DMA_CHANNELS 8
39 38
diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h
index c104f1039a6..20e9dcf42b2 100644
--- a/arch/mips/include/asm/processor.h
+++ b/arch/mips/include/asm/processor.h
@@ -19,7 +19,6 @@
19#include <asm/cpu-info.h> 19#include <asm/cpu-info.h>
20#include <asm/mipsregs.h> 20#include <asm/mipsregs.h>
21#include <asm/prefetch.h> 21#include <asm/prefetch.h>
22#include <asm/system.h>
23 22
24/* 23/*
25 * Return current * instruction pointer ("program counter"). 24 * Return current * instruction pointer ("program counter").
@@ -356,6 +355,12 @@ unsigned long get_wchan(struct task_struct *p);
356#define ARCH_HAS_PREFETCHW 355#define ARCH_HAS_PREFETCHW
357#define prefetchw(x) __builtin_prefetch((x), 1, 1) 356#define prefetchw(x) __builtin_prefetch((x), 1, 1)
358 357
358/*
359 * See Documentation/scheduler/sched-arch.txt; prevents deadlock on SMP
360 * systems.
361 */
362#define __ARCH_WANT_UNLOCKED_CTXSW
363
359#endif 364#endif
360 365
361#endif /* _ASM_PROCESSOR_H */ 366#endif /* _ASM_PROCESSOR_H */
diff --git a/arch/mips/include/asm/setup.h b/arch/mips/include/asm/setup.h
index 50511aac04e..6dce6d8d09a 100644
--- a/arch/mips/include/asm/setup.h
+++ b/arch/mips/include/asm/setup.h
@@ -5,6 +5,17 @@
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7extern void setup_early_printk(void); 7extern void setup_early_printk(void);
8
9extern void set_handler(unsigned long offset, void *addr, unsigned long len);
10extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len);
11
12typedef void (*vi_handler_t)(void);
13extern void *set_vi_handler(int n, vi_handler_t addr);
14
15extern void *set_except_vector(int n, void *addr);
16extern unsigned long ebase;
17extern void per_cpu_trap_init(void);
18
8#endif /* __KERNEL__ */ 19#endif /* __KERNEL__ */
9 20
10#endif /* __SETUP_H */ 21#endif /* __SETUP_H */
diff --git a/arch/mips/include/asm/switch_to.h b/arch/mips/include/asm/switch_to.h
new file mode 100644
index 00000000000..5d33621b565
--- /dev/null
+++ b/arch/mips/include/asm/switch_to.h
@@ -0,0 +1,85 @@
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) 1994, 95, 96, 97, 98, 99, 2003, 06 by Ralf Baechle
7 * Copyright (C) 1996 by Paul M. Antoine
8 * Copyright (C) 1999 Silicon Graphics
9 * Kevin D. Kissell, kevink@mips.org and Carsten Langgaard, carstenl@mips.com
10 * Copyright (C) 2000 MIPS Technologies, Inc.
11 */
12#ifndef _ASM_SWITCH_TO_H
13#define _ASM_SWITCH_TO_H
14
15#include <asm/cpu-features.h>
16#include <asm/watch.h>
17#include <asm/dsp.h>
18
19struct task_struct;
20
21/*
22 * switch_to(n) should switch tasks to task nr n, first
23 * checking that n isn't the current task, in which case it does nothing.
24 */
25extern asmlinkage void *resume(void *last, void *next, void *next_ti);
26
27extern unsigned int ll_bit;
28extern struct task_struct *ll_task;
29
30#ifdef CONFIG_MIPS_MT_FPAFF
31
32/*
33 * Handle the scheduler resume end of FPU affinity management. We do this
34 * inline to try to keep the overhead down. If we have been forced to run on
35 * a "CPU" with an FPU because of a previous high level of FP computation,
36 * but did not actually use the FPU during the most recent time-slice (CU1
37 * isn't set), we undo the restriction on cpus_allowed.
38 *
39 * We're not calling set_cpus_allowed() here, because we have no need to
40 * force prompt migration - we're already switching the current CPU to a
41 * different thread.
42 */
43
44#define __mips_mt_fpaff_switch_to(prev) \
45do { \
46 struct thread_info *__prev_ti = task_thread_info(prev); \
47 \
48 if (cpu_has_fpu && \
49 test_ti_thread_flag(__prev_ti, TIF_FPUBOUND) && \
50 (!(KSTK_STATUS(prev) & ST0_CU1))) { \
51 clear_ti_thread_flag(__prev_ti, TIF_FPUBOUND); \
52 prev->cpus_allowed = prev->thread.user_cpus_allowed; \
53 } \
54 next->thread.emulated_fp = 0; \
55} while(0)
56
57#else
58#define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0)
59#endif
60
61#define __clear_software_ll_bit() \
62do { \
63 if (!__builtin_constant_p(cpu_has_llsc) || !cpu_has_llsc) \
64 ll_bit = 0; \
65} while (0)
66
67#define switch_to(prev, next, last) \
68do { \
69 __mips_mt_fpaff_switch_to(prev); \
70 if (cpu_has_dsp) \
71 __save_dsp(prev); \
72 __clear_software_ll_bit(); \
73 (last) = resume(prev, next, task_thread_info(next)); \
74} while (0)
75
76#define finish_arch_switch(prev) \
77do { \
78 if (cpu_has_dsp) \
79 __restore_dsp(current); \
80 if (cpu_has_userlocal) \
81 write_c0_userlocal(current_thread_info()->tp_value); \
82 __restore_watch(); \
83} while (0)
84
85#endif /* _ASM_SWITCH_TO_H */
diff --git a/arch/mips/include/asm/system.h b/arch/mips/include/asm/system.h
deleted file mode 100644
index 6018c80ce37..00000000000
--- a/arch/mips/include/asm/system.h
+++ /dev/null
@@ -1,235 +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) 1994, 95, 96, 97, 98, 99, 2003, 06 by Ralf Baechle
7 * Copyright (C) 1996 by Paul M. Antoine
8 * Copyright (C) 1999 Silicon Graphics
9 * Kevin D. Kissell, kevink@mips.org and Carsten Langgaard, carstenl@mips.com
10 * Copyright (C) 2000 MIPS Technologies, Inc.
11 */
12#ifndef _ASM_SYSTEM_H
13#define _ASM_SYSTEM_H
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/irqflags.h>
18
19#include <asm/addrspace.h>
20#include <asm/barrier.h>
21#include <asm/cmpxchg.h>
22#include <asm/cpu-features.h>
23#include <asm/dsp.h>
24#include <asm/watch.h>
25#include <asm/war.h>
26
27
28/*
29 * switch_to(n) should switch tasks to task nr n, first
30 * checking that n isn't the current task, in which case it does nothing.
31 */
32extern asmlinkage void *resume(void *last, void *next, void *next_ti);
33
34struct task_struct;
35
36extern unsigned int ll_bit;
37extern struct task_struct *ll_task;
38
39#ifdef CONFIG_MIPS_MT_FPAFF
40
41/*
42 * Handle the scheduler resume end of FPU affinity management. We do this
43 * inline to try to keep the overhead down. If we have been forced to run on
44 * a "CPU" with an FPU because of a previous high level of FP computation,
45 * but did not actually use the FPU during the most recent time-slice (CU1
46 * isn't set), we undo the restriction on cpus_allowed.
47 *
48 * We're not calling set_cpus_allowed() here, because we have no need to
49 * force prompt migration - we're already switching the current CPU to a
50 * different thread.
51 */
52
53#define __mips_mt_fpaff_switch_to(prev) \
54do { \
55 struct thread_info *__prev_ti = task_thread_info(prev); \
56 \
57 if (cpu_has_fpu && \
58 test_ti_thread_flag(__prev_ti, TIF_FPUBOUND) && \
59 (!(KSTK_STATUS(prev) & ST0_CU1))) { \
60 clear_ti_thread_flag(__prev_ti, TIF_FPUBOUND); \
61 prev->cpus_allowed = prev->thread.user_cpus_allowed; \
62 } \
63 next->thread.emulated_fp = 0; \
64} while(0)
65
66#else
67#define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0)
68#endif
69
70#define __clear_software_ll_bit() \
71do { \
72 if (!__builtin_constant_p(cpu_has_llsc) || !cpu_has_llsc) \
73 ll_bit = 0; \
74} while (0)
75
76#define switch_to(prev, next, last) \
77do { \
78 __mips_mt_fpaff_switch_to(prev); \
79 if (cpu_has_dsp) \
80 __save_dsp(prev); \
81 __clear_software_ll_bit(); \
82 (last) = resume(prev, next, task_thread_info(next)); \
83} while (0)
84
85#define finish_arch_switch(prev) \
86do { \
87 if (cpu_has_dsp) \
88 __restore_dsp(current); \
89 if (cpu_has_userlocal) \
90 write_c0_userlocal(current_thread_info()->tp_value); \
91 __restore_watch(); \
92} while (0)
93
94static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
95{
96 __u32 retval;
97
98 smp_mb__before_llsc();
99
100 if (kernel_uses_llsc && R10000_LLSC_WAR) {
101 unsigned long dummy;
102
103 __asm__ __volatile__(
104 " .set mips3 \n"
105 "1: ll %0, %3 # xchg_u32 \n"
106 " .set mips0 \n"
107 " move %2, %z4 \n"
108 " .set mips3 \n"
109 " sc %2, %1 \n"
110 " beqzl %2, 1b \n"
111 " .set mips0 \n"
112 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
113 : "R" (*m), "Jr" (val)
114 : "memory");
115 } else if (kernel_uses_llsc) {
116 unsigned long dummy;
117
118 do {
119 __asm__ __volatile__(
120 " .set mips3 \n"
121 " ll %0, %3 # xchg_u32 \n"
122 " .set mips0 \n"
123 " move %2, %z4 \n"
124 " .set mips3 \n"
125 " sc %2, %1 \n"
126 " .set mips0 \n"
127 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
128 : "R" (*m), "Jr" (val)
129 : "memory");
130 } while (unlikely(!dummy));
131 } else {
132 unsigned long flags;
133
134 raw_local_irq_save(flags);
135 retval = *m;
136 *m = val;
137 raw_local_irq_restore(flags); /* implies memory barrier */
138 }
139
140 smp_llsc_mb();
141
142 return retval;
143}
144
145#ifdef CONFIG_64BIT
146static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
147{
148 __u64 retval;
149
150 smp_mb__before_llsc();
151
152 if (kernel_uses_llsc && R10000_LLSC_WAR) {
153 unsigned long dummy;
154
155 __asm__ __volatile__(
156 " .set mips3 \n"
157 "1: lld %0, %3 # xchg_u64 \n"
158 " move %2, %z4 \n"
159 " scd %2, %1 \n"
160 " beqzl %2, 1b \n"
161 " .set mips0 \n"
162 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
163 : "R" (*m), "Jr" (val)
164 : "memory");
165 } else if (kernel_uses_llsc) {
166 unsigned long dummy;
167
168 do {
169 __asm__ __volatile__(
170 " .set mips3 \n"
171 " lld %0, %3 # xchg_u64 \n"
172 " move %2, %z4 \n"
173 " scd %2, %1 \n"
174 " .set mips0 \n"
175 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
176 : "R" (*m), "Jr" (val)
177 : "memory");
178 } while (unlikely(!dummy));
179 } else {
180 unsigned long flags;
181
182 raw_local_irq_save(flags);
183 retval = *m;
184 *m = val;
185 raw_local_irq_restore(flags); /* implies memory barrier */
186 }
187
188 smp_llsc_mb();
189
190 return retval;
191}
192#else
193extern __u64 __xchg_u64_unsupported_on_32bit_kernels(volatile __u64 * m, __u64 val);
194#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels
195#endif
196
197static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
198{
199 switch (size) {
200 case 4:
201 return __xchg_u32(ptr, x);
202 case 8:
203 return __xchg_u64(ptr, x);
204 }
205
206 return x;
207}
208
209#define xchg(ptr, x) \
210({ \
211 BUILD_BUG_ON(sizeof(*(ptr)) & ~0xc); \
212 \
213 ((__typeof__(*(ptr))) \
214 __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))); \
215})
216
217extern void set_handler(unsigned long offset, void *addr, unsigned long len);
218extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len);
219
220typedef void (*vi_handler_t)(void);
221extern void *set_vi_handler(int n, vi_handler_t addr);
222
223extern void *set_except_vector(int n, void *addr);
224extern unsigned long ebase;
225extern void per_cpu_trap_init(void);
226
227/*
228 * See include/asm-ia64/system.h; prevents deadlock on SMP
229 * systems.
230 */
231#define __ARCH_WANT_UNLOCKED_CTXSW
232
233extern unsigned long arch_align_stack(unsigned long sp);
234
235#endif /* _ASM_SYSTEM_H */
diff --git a/arch/mips/include/asm/txx9/jmr3927.h b/arch/mips/include/asm/txx9/jmr3927.h
index a409c446bf1..8808d7f82da 100644
--- a/arch/mips/include/asm/txx9/jmr3927.h
+++ b/arch/mips/include/asm/txx9/jmr3927.h
@@ -12,7 +12,6 @@
12 12
13#include <asm/txx9/tx3927.h> 13#include <asm/txx9/tx3927.h>
14#include <asm/addrspace.h> 14#include <asm/addrspace.h>
15#include <asm/system.h>
16#include <asm/txx9irq.h> 15#include <asm/txx9irq.h>
17 16
18/* CS */ 17/* CS */
diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c
index f305ca14351..d6a18644365 100644
--- a/arch/mips/kernel/cpu-bugs64.c
+++ b/arch/mips/kernel/cpu-bugs64.c
@@ -16,7 +16,7 @@
16#include <asm/cpu.h> 16#include <asm/cpu.h>
17#include <asm/fpu.h> 17#include <asm/fpu.h>
18#include <asm/mipsregs.h> 18#include <asm/mipsregs.h>
19#include <asm/system.h> 19#include <asm/setup.h>
20 20
21static char bug64hit[] __initdata = 21static char bug64hit[] __initdata =
22 "reliable operation impossible!\n%s"; 22 "reliable operation impossible!\n%s";
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 0bab464b8e3..5099201fb7b 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -22,7 +22,6 @@
22#include <asm/cpu.h> 22#include <asm/cpu.h>
23#include <asm/fpu.h> 23#include <asm/fpu.h>
24#include <asm/mipsregs.h> 24#include <asm/mipsregs.h>
25#include <asm/system.h>
26#include <asm/watch.h> 25#include <asm/watch.h>
27#include <asm/elf.h> 26#include <asm/elf.h>
28#include <asm/spram.h> 27#include <asm/spram.h>
diff --git a/arch/mips/kernel/irq-rm7000.c b/arch/mips/kernel/irq-rm7000.c
index a8a8977d588..b0662cf97ea 100644
--- a/arch/mips/kernel/irq-rm7000.c
+++ b/arch/mips/kernel/irq-rm7000.c
@@ -16,7 +16,6 @@
16 16
17#include <asm/irq_cpu.h> 17#include <asm/irq_cpu.h>
18#include <asm/mipsregs.h> 18#include <asm/mipsregs.h>
19#include <asm/system.h>
20 19
21static inline void unmask_rm7k_irq(struct irq_data *d) 20static inline void unmask_rm7k_irq(struct irq_data *d)
22{ 21{
diff --git a/arch/mips/kernel/irq-rm9000.c b/arch/mips/kernel/irq-rm9000.c
index 38874a4b925..1282b9ae81c 100644
--- a/arch/mips/kernel/irq-rm9000.c
+++ b/arch/mips/kernel/irq-rm9000.c
@@ -17,7 +17,6 @@
17 17
18#include <asm/irq_cpu.h> 18#include <asm/irq_cpu.h>
19#include <asm/mipsregs.h> 19#include <asm/mipsregs.h>
20#include <asm/system.h>
21 20
22static inline void unmask_rm9k_irq(struct irq_data *d) 21static inline void unmask_rm9k_irq(struct irq_data *d)
23{ 22{
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index 7f50318061b..a5aa43d07c8 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -23,7 +23,6 @@
23#include <linux/ftrace.h> 23#include <linux/ftrace.h>
24 24
25#include <linux/atomic.h> 25#include <linux/atomic.h>
26#include <asm/system.h>
27#include <asm/uaccess.h> 26#include <asm/uaccess.h>
28 27
29#ifdef CONFIG_KGDB 28#ifdef CONFIG_KGDB
diff --git a/arch/mips/kernel/irq_cpu.c b/arch/mips/kernel/irq_cpu.c
index 191eb52228c..972263bcf40 100644
--- a/arch/mips/kernel/irq_cpu.c
+++ b/arch/mips/kernel/irq_cpu.c
@@ -35,7 +35,6 @@
35#include <asm/irq_cpu.h> 35#include <asm/irq_cpu.h>
36#include <asm/mipsregs.h> 36#include <asm/mipsregs.h>
37#include <asm/mipsmtregs.h> 37#include <asm/mipsmtregs.h>
38#include <asm/system.h>
39 38
40static inline void unmask_mips_irq(struct irq_data *d) 39static inline void unmask_mips_irq(struct irq_data *d)
41{ 40{
diff --git a/arch/mips/kernel/mips-mt.c b/arch/mips/kernel/mips-mt.c
index c23d11f6851..7f3376b1c21 100644
--- a/arch/mips/kernel/mips-mt.c
+++ b/arch/mips/kernel/mips-mt.c
@@ -13,7 +13,6 @@
13#include <asm/cpu.h> 13#include <asm/cpu.h>
14#include <asm/processor.h> 14#include <asm/processor.h>
15#include <linux/atomic.h> 15#include <linux/atomic.h>
16#include <asm/system.h>
17#include <asm/hardirq.h> 16#include <asm/hardirq.h>
18#include <asm/mmu_context.h> 17#include <asm/mmu_context.h>
19#include <asm/mipsmtregs.h> 18#include <asm/mipsmtregs.h>
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 61f1cb45a1d..e9a5fd7277f 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -32,7 +32,6 @@
32#include <asm/dsp.h> 32#include <asm/dsp.h>
33#include <asm/fpu.h> 33#include <asm/fpu.h>
34#include <asm/pgtable.h> 34#include <asm/pgtable.h>
35#include <asm/system.h>
36#include <asm/mipsregs.h> 35#include <asm/mipsregs.h>
37#include <asm/processor.h> 36#include <asm/processor.h>
38#include <asm/uaccess.h> 37#include <asm/uaccess.h>
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 7786b608d93..7c24c2973c6 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -34,7 +34,6 @@
34#include <asm/mipsmtregs.h> 34#include <asm/mipsmtregs.h>
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/page.h> 36#include <asm/page.h>
37#include <asm/system.h>
38#include <asm/uaccess.h> 37#include <asm/uaccess.h>
39#include <asm/bootinfo.h> 38#include <asm/bootinfo.h>
40#include <asm/reg.h> 39#include <asm/reg.h>
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c
index 32644b4a071..a3b017815ef 100644
--- a/arch/mips/kernel/ptrace32.c
+++ b/arch/mips/kernel/ptrace32.c
@@ -32,7 +32,6 @@
32#include <asm/mipsmtregs.h> 32#include <asm/mipsmtregs.h>
33#include <asm/pgtable.h> 33#include <asm/pgtable.h>
34#include <asm/page.h> 34#include <asm/page.h>
35#include <asm/system.h>
36#include <asm/uaccess.h> 35#include <asm/uaccess.h>
37#include <asm/bootinfo.h> 36#include <asm/bootinfo.h>
38 37
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index a9d801dec6b..b8c18dcdd2c 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -38,7 +38,6 @@
38#include <linux/atomic.h> 38#include <linux/atomic.h>
39#include <asm/cpu.h> 39#include <asm/cpu.h>
40#include <asm/processor.h> 40#include <asm/processor.h>
41#include <asm/system.h>
42#include <asm/vpe.h> 41#include <asm/vpe.h>
43#include <asm/rtlx.h> 42#include <asm/rtlx.h>
44 43
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 058e964e730..c504b212f8f 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -31,7 +31,6 @@
31#include <asm/sections.h> 31#include <asm/sections.h>
32#include <asm/setup.h> 32#include <asm/setup.h>
33#include <asm/smp-ops.h> 33#include <asm/smp-ops.h>
34#include <asm/system.h>
35#include <asm/prom.h> 34#include <asm/prom.h>
36 35
37struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly; 36struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly;
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index f8524003676..185ca00c4c8 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -34,6 +34,7 @@
34#include <asm/cpu-features.h> 34#include <asm/cpu-features.h>
35#include <asm/war.h> 35#include <asm/war.h>
36#include <asm/vdso.h> 36#include <asm/vdso.h>
37#include <asm/dsp.h>
37 38
38#include "signal-common.h" 39#include "signal-common.h"
39 40
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index aae98661379..06b5da392e2 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -29,10 +29,10 @@
29#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
30#include <asm/sim.h> 30#include <asm/sim.h>
31#include <asm/ucontext.h> 31#include <asm/ucontext.h>
32#include <asm/system.h>
33#include <asm/fpu.h> 32#include <asm/fpu.h>
34#include <asm/war.h> 33#include <asm/war.h>
35#include <asm/vdso.h> 34#include <asm/vdso.h>
35#include <asm/dsp.h>
36 36
37#include "signal-common.h" 37#include "signal-common.h"
38 38
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index ee24d814d5b..ae29e894ab8 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -35,7 +35,6 @@
35#include <asm/sim.h> 35#include <asm/sim.h>
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37#include <asm/ucontext.h> 37#include <asm/ucontext.h>
38#include <asm/system.h>
39#include <asm/fpu.h> 38#include <asm/fpu.h>
40#include <asm/cpu-features.h> 39#include <asm/cpu-features.h>
41#include <asm/war.h> 40#include <asm/war.h>
diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c
index d5e950ab852..ca673569fd2 100644
--- a/arch/mips/kernel/smp-bmips.c
+++ b/arch/mips/kernel/smp-bmips.c
@@ -28,7 +28,6 @@
28#include <asm/time.h> 28#include <asm/time.h>
29#include <asm/pgtable.h> 29#include <asm/pgtable.h>
30#include <asm/processor.h> 30#include <asm/processor.h>
31#include <asm/system.h>
32#include <asm/bootinfo.h> 31#include <asm/bootinfo.h>
33#include <asm/pmon.h> 32#include <asm/pmon.h>
34#include <asm/cacheflush.h> 33#include <asm/cacheflush.h>
diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c
index fe309516065..e7e03ecf549 100644
--- a/arch/mips/kernel/smp-cmp.c
+++ b/arch/mips/kernel/smp-cmp.c
@@ -29,7 +29,6 @@
29#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
30#include <asm/cpu.h> 30#include <asm/cpu.h>
31#include <asm/processor.h> 31#include <asm/processor.h>
32#include <asm/system.h>
33#include <asm/hardirq.h> 32#include <asm/hardirq.h>
34#include <asm/mmu_context.h> 33#include <asm/mmu_context.h>
35#include <asm/smp.h> 34#include <asm/smp.h>
diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c
index ce9e286f0a7..ff17868734c 100644
--- a/arch/mips/kernel/smp-mt.c
+++ b/arch/mips/kernel/smp-mt.c
@@ -28,7 +28,6 @@
28#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
29#include <asm/cpu.h> 29#include <asm/cpu.h>
30#include <asm/processor.h> 30#include <asm/processor.h>
31#include <asm/system.h>
32#include <asm/hardirq.h> 31#include <asm/hardirq.h>
33#include <asm/mmu_context.h> 32#include <asm/mmu_context.h>
34#include <asm/time.h> 33#include <asm/time.h>
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 32c1e954cd3..9c1cce9de35 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -38,9 +38,9 @@
38#include <asm/cpu.h> 38#include <asm/cpu.h>
39#include <asm/processor.h> 39#include <asm/processor.h>
40#include <asm/r4k-timer.h> 40#include <asm/r4k-timer.h>
41#include <asm/system.h>
42#include <asm/mmu_context.h> 41#include <asm/mmu_context.h>
43#include <asm/time.h> 42#include <asm/time.h>
43#include <asm/setup.h>
44 44
45#ifdef CONFIG_MIPS_MT_SMTC 45#ifdef CONFIG_MIPS_MT_SMTC
46#include <asm/mipsmtregs.h> 46#include <asm/mipsmtregs.h>
diff --git a/arch/mips/kernel/smtc-proc.c b/arch/mips/kernel/smtc-proc.c
index 928a5a61e1a..145771c0ed7 100644
--- a/arch/mips/kernel/smtc-proc.c
+++ b/arch/mips/kernel/smtc-proc.c
@@ -11,7 +11,6 @@
11#include <asm/cpu.h> 11#include <asm/cpu.h>
12#include <asm/processor.h> 12#include <asm/processor.h>
13#include <linux/atomic.h> 13#include <linux/atomic.h>
14#include <asm/system.h>
15#include <asm/hardirq.h> 14#include <asm/hardirq.h>
16#include <asm/mmu_context.h> 15#include <asm/mmu_context.h>
17#include <asm/mipsregs.h> 16#include <asm/mipsregs.h>
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index 0a42ff3ff6a..c4f75bbc0bd 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -31,7 +31,6 @@
31#include <asm/cpu.h> 31#include <asm/cpu.h>
32#include <asm/processor.h> 32#include <asm/processor.h>
33#include <linux/atomic.h> 33#include <linux/atomic.h>
34#include <asm/system.h>
35#include <asm/hardirq.h> 34#include <asm/hardirq.h>
36#include <asm/hazards.h> 35#include <asm/hazards.h>
37#include <asm/irq.h> 36#include <asm/irq.h>
diff --git a/arch/mips/kernel/spram.c b/arch/mips/kernel/spram.c
index 1821d12a641..6af08d896e2 100644
--- a/arch/mips/kernel/spram.c
+++ b/arch/mips/kernel/spram.c
@@ -15,7 +15,6 @@
15 15
16#include <asm/fpu.h> 16#include <asm/fpu.h>
17#include <asm/mipsregs.h> 17#include <asm/mipsregs.h>
18#include <asm/system.h>
19#include <asm/r4kcache.h> 18#include <asm/r4kcache.h>
20#include <asm/hazards.h> 19#include <asm/hazards.h>
21 20
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index d02765708dd..b08220c8211 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -37,6 +37,7 @@
37#include <asm/shmparam.h> 37#include <asm/shmparam.h>
38#include <asm/sysmips.h> 38#include <asm/sysmips.h>
39#include <asm/uaccess.h> 39#include <asm/uaccess.h>
40#include <asm/switch_to.h>
40 41
41/* 42/*
42 * For historic reasons the pipe(2) syscall on MIPS has an unusual calling 43 * For historic reasons the pipe(2) syscall on MIPS has an unusual calling
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index d79ae5437b5..cfdaaa4cffc 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -45,7 +45,6 @@
45#include <asm/pgtable.h> 45#include <asm/pgtable.h>
46#include <asm/ptrace.h> 46#include <asm/ptrace.h>
47#include <asm/sections.h> 47#include <asm/sections.h>
48#include <asm/system.h>
49#include <asm/tlbdebug.h> 48#include <asm/tlbdebug.h>
50#include <asm/traps.h> 49#include <asm/traps.h>
51#include <asm/uaccess.h> 50#include <asm/uaccess.h>
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index aedb8941caa..9c58bdf58f2 100644
--- a/arch/mips/kernel/unaligned.c
+++ b/arch/mips/kernel/unaligned.c
@@ -85,7 +85,6 @@
85#include <asm/cop2.h> 85#include <asm/cop2.h>
86#include <asm/inst.h> 86#include <asm/inst.h>
87#include <asm/uaccess.h> 87#include <asm/uaccess.h>
88#include <asm/system.h>
89 88
90#define STR(x) __STR(x) 89#define STR(x) __STR(x)
91#define __STR(x) #x 90#define __STR(x) #x
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index bfa12a4f97b..f6f91523cb1 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -49,7 +49,6 @@
49#include <asm/cpu.h> 49#include <asm/cpu.h>
50#include <asm/mips_mt.h> 50#include <asm/mips_mt.h>
51#include <asm/processor.h> 51#include <asm/processor.h>
52#include <asm/system.h>
53#include <asm/vpe.h> 52#include <asm/vpe.h>
54#include <asm/kspd.h> 53#include <asm/kspd.h>
55 54
diff --git a/arch/mips/lasat/reset.c b/arch/mips/lasat/reset.c
index b1e7a89fb73..e21f0b9a586 100644
--- a/arch/mips/lasat/reset.c
+++ b/arch/mips/lasat/reset.c
@@ -21,7 +21,6 @@
21#include <linux/pm.h> 21#include <linux/pm.h>
22 22
23#include <asm/reboot.h> 23#include <asm/reboot.h>
24#include <asm/system.h>
25#include <asm/lasat/lasat.h> 24#include <asm/lasat/lasat.h>
26 25
27#include "picvue.h" 26#include "picvue.h"
diff --git a/arch/mips/math-emu/dsemul.c b/arch/mips/math-emu/dsemul.c
index 3c4a8c5ba7f..384a3b0091e 100644
--- a/arch/mips/math-emu/dsemul.c
+++ b/arch/mips/math-emu/dsemul.c
@@ -12,7 +12,6 @@
12#include <asm/uaccess.h> 12#include <asm/uaccess.h>
13#include <asm/branch.h> 13#include <asm/branch.h>
14#include <asm/mipsregs.h> 14#include <asm/mipsregs.h>
15#include <asm/system.h>
16#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
17 16
18#include <asm/fpu_emulator.h> 17#include <asm/fpu_emulator.h>
diff --git a/arch/mips/mipssim/sim_smtc.c b/arch/mips/mipssim/sim_smtc.c
index 915063991f6..3c104abd8aa 100644
--- a/arch/mips/mipssim/sim_smtc.c
+++ b/arch/mips/mipssim/sim_smtc.c
@@ -28,7 +28,6 @@
28#include <asm/cpu.h> 28#include <asm/cpu.h>
29#include <asm/processor.h> 29#include <asm/processor.h>
30#include <asm/smtc.h> 30#include <asm/smtc.h>
31#include <asm/system.h>
32#include <asm/mmu_context.h> 31#include <asm/mmu_context.h>
33#include <asm/smtc_ipi.h> 32#include <asm/smtc_ipi.h>
34 33
diff --git a/arch/mips/mipssim/sim_time.c b/arch/mips/mipssim/sim_time.c
index 5492c42f765..77bad3c0428 100644
--- a/arch/mips/mipssim/sim_time.c
+++ b/arch/mips/mipssim/sim_time.c
@@ -11,6 +11,7 @@
11#include <asm/hardirq.h> 11#include <asm/hardirq.h>
12#include <asm/div64.h> 12#include <asm/div64.h>
13#include <asm/cpu.h> 13#include <asm/cpu.h>
14#include <asm/setup.h>
14#include <asm/time.h> 15#include <asm/time.h>
15#include <asm/irq.h> 16#include <asm/irq.h>
16#include <asm/mc146818-time.h> 17#include <asm/mc146818-time.h>
diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c
index cf7895db073..1f9ca07f53c 100644
--- a/arch/mips/mm/c-octeon.c
+++ b/arch/mips/mm/c-octeon.c
@@ -21,7 +21,6 @@
21#include <asm/page.h> 21#include <asm/page.h>
22#include <asm/pgtable.h> 22#include <asm/pgtable.h>
23#include <asm/r4kcache.h> 23#include <asm/r4kcache.h>
24#include <asm/system.h>
25#include <asm/mmu_context.h> 24#include <asm/mmu_context.h>
26#include <asm/war.h> 25#include <asm/war.h>
27 26
diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c
index 0765583d0c9..031c4c2cdf2 100644
--- a/arch/mips/mm/c-r3k.c
+++ b/arch/mips/mm/c-r3k.c
@@ -18,7 +18,6 @@
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/pgtable.h> 19#include <asm/pgtable.h>
20#include <asm/mmu_context.h> 20#include <asm/mmu_context.h>
21#include <asm/system.h>
22#include <asm/isadep.h> 21#include <asm/isadep.h>
23#include <asm/io.h> 22#include <asm/io.h>
24#include <asm/bootinfo.h> 23#include <asm/bootinfo.h>
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index c97087d12d0..bda8eb26ece 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -29,7 +29,6 @@
29#include <asm/pgtable.h> 29#include <asm/pgtable.h>
30#include <asm/r4kcache.h> 30#include <asm/r4kcache.h>
31#include <asm/sections.h> 31#include <asm/sections.h>
32#include <asm/system.h>
33#include <asm/mmu_context.h> 32#include <asm/mmu_context.h>
34#include <asm/war.h> 33#include <asm/war.h>
35#include <asm/cacheflush.h> /* for run_uncached() */ 34#include <asm/cacheflush.h> /* for run_uncached() */
diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c
index a43c197ccf8..87d23cada6d 100644
--- a/arch/mips/mm/c-tx39.c
+++ b/arch/mips/mm/c-tx39.c
@@ -18,7 +18,6 @@
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/pgtable.h> 19#include <asm/pgtable.h>
20#include <asm/mmu_context.h> 20#include <asm/mmu_context.h>
21#include <asm/system.h>
22#include <asm/isadep.h> 21#include <asm/isadep.h>
23#include <asm/io.h> 22#include <asm/io.h>
24#include <asm/bootinfo.h> 23#include <asm/bootinfo.h>
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index 69ebd586d7f..c14f6dfed99 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -22,7 +22,6 @@
22 22
23#include <asm/branch.h> 23#include <asm/branch.h>
24#include <asm/mmu_context.h> 24#include <asm/mmu_context.h>
25#include <asm/system.h>
26#include <asm/uaccess.h> 25#include <asm/uaccess.h>
27#include <asm/ptrace.h> 26#include <asm/ptrace.h>
28#include <asm/highmem.h> /* For VMALLOC_END */ 27#include <asm/highmem.h> /* For VMALLOC_END */
diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c
index 36272f7d374..cc0b626858b 100644
--- a/arch/mips/mm/page.c
+++ b/arch/mips/mm/page.c
@@ -22,7 +22,6 @@
22#include <asm/page.h> 22#include <asm/page.h>
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/prefetch.h> 24#include <asm/prefetch.h>
25#include <asm/system.h>
26#include <asm/bootinfo.h> 25#include <asm/bootinfo.h>
27#include <asm/mipsregs.h> 26#include <asm/mipsregs.h>
28#include <asm/mmu_context.h> 27#include <asm/mmu_context.h>
diff --git a/arch/mips/mm/sc-ip22.c b/arch/mips/mm/sc-ip22.c
index a6bd11fba7b..1eb708ef75f 100644
--- a/arch/mips/mm/sc-ip22.c
+++ b/arch/mips/mm/sc-ip22.c
@@ -12,7 +12,6 @@
12#include <asm/bcache.h> 12#include <asm/bcache.h>
13#include <asm/page.h> 13#include <asm/page.h>
14#include <asm/pgtable.h> 14#include <asm/pgtable.h>
15#include <asm/system.h>
16#include <asm/bootinfo.h> 15#include <asm/bootinfo.h>
17#include <asm/sgi/ip22.h> 16#include <asm/sgi/ip22.h>
18#include <asm/sgi/mc.h> 17#include <asm/sgi/mc.h>
diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c
index 9cca8de0054..93d937b4b1b 100644
--- a/arch/mips/mm/sc-mips.c
+++ b/arch/mips/mm/sc-mips.c
@@ -11,7 +11,6 @@
11#include <asm/cacheops.h> 11#include <asm/cacheops.h>
12#include <asm/page.h> 12#include <asm/page.h>
13#include <asm/pgtable.h> 13#include <asm/pgtable.h>
14#include <asm/system.h>
15#include <asm/mmu_context.h> 14#include <asm/mmu_context.h>
16#include <asm/r4kcache.h> 15#include <asm/r4kcache.h>
17 16
diff --git a/arch/mips/mm/sc-r5k.c b/arch/mips/mm/sc-r5k.c
index ae1e533a096..8d90ff25b12 100644
--- a/arch/mips/mm/sc-r5k.c
+++ b/arch/mips/mm/sc-r5k.c
@@ -12,7 +12,6 @@
12#include <asm/cacheops.h> 12#include <asm/cacheops.h>
13#include <asm/page.h> 13#include <asm/page.h>
14#include <asm/pgtable.h> 14#include <asm/pgtable.h>
15#include <asm/system.h>
16#include <asm/mmu_context.h> 15#include <asm/mmu_context.h>
17#include <asm/r4kcache.h> 16#include <asm/r4kcache.h>
18 17
diff --git a/arch/mips/mm/tlb-r3k.c b/arch/mips/mm/tlb-r3k.c
index ed1fa460f84..a63d1ed0827 100644
--- a/arch/mips/mm/tlb-r3k.c
+++ b/arch/mips/mm/tlb-r3k.c
@@ -19,7 +19,6 @@
19#include <asm/page.h> 19#include <asm/page.h>
20#include <asm/pgtable.h> 20#include <asm/pgtable.h>
21#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
22#include <asm/system.h>
23#include <asm/tlbmisc.h> 22#include <asm/tlbmisc.h>
24#include <asm/isadep.h> 23#include <asm/isadep.h>
25#include <asm/io.h> 24#include <asm/io.h>
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index 2dc625346c4..d2572cb232d 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -18,7 +18,6 @@
18#include <asm/bootinfo.h> 18#include <asm/bootinfo.h>
19#include <asm/mmu_context.h> 19#include <asm/mmu_context.h>
20#include <asm/pgtable.h> 20#include <asm/pgtable.h>
21#include <asm/system.h>
22#include <asm/tlbmisc.h> 21#include <asm/tlbmisc.h>
23 22
24extern void build_tlb_refill_handler(void); 23extern void build_tlb_refill_handler(void);
diff --git a/arch/mips/mm/tlb-r8k.c b/arch/mips/mm/tlb-r8k.c
index 3d95f76c106..91c2499f806 100644
--- a/arch/mips/mm/tlb-r8k.c
+++ b/arch/mips/mm/tlb-r8k.c
@@ -17,7 +17,6 @@
17#include <asm/bootinfo.h> 17#include <asm/bootinfo.h>
18#include <asm/mmu_context.h> 18#include <asm/mmu_context.h>
19#include <asm/pgtable.h> 19#include <asm/pgtable.h>
20#include <asm/system.h>
21 20
22extern void build_tlb_refill_handler(void); 21extern void build_tlb_refill_handler(void);
23 22
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index e06370f58ef..0bc485b3cd6 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -32,6 +32,7 @@
32#include <asm/pgtable.h> 32#include <asm/pgtable.h>
33#include <asm/war.h> 33#include <asm/war.h>
34#include <asm/uasm.h> 34#include <asm/uasm.h>
35#include <asm/setup.h>
35 36
36/* 37/*
37 * TLB load/store/modify handlers. 38 * TLB load/store/modify handlers.
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
index 4b988b9a30d..27a6cdb36e3 100644
--- a/arch/mips/mti-malta/malta-init.c
+++ b/arch/mips/mti-malta/malta-init.c
@@ -26,7 +26,6 @@
26#include <asm/bootinfo.h> 26#include <asm/bootinfo.h>
27#include <asm/gt64120.h> 27#include <asm/gt64120.h>
28#include <asm/io.h> 28#include <asm/io.h>
29#include <asm/system.h>
30#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
31#include <asm/smp-ops.h> 30#include <asm/smp-ops.h>
32#include <asm/traps.h> 31#include <asm/traps.h>
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
index a588b5cef8d..7b13a4caeea 100644
--- a/arch/mips/mti-malta/malta-int.c
+++ b/arch/mips/mti-malta/malta-int.c
@@ -44,6 +44,7 @@
44#include <asm/msc01_ic.h> 44#include <asm/msc01_ic.h>
45#include <asm/gic.h> 45#include <asm/gic.h>
46#include <asm/gcmpregs.h> 46#include <asm/gcmpregs.h>
47#include <asm/setup.h>
47 48
48int gcmp_present = -1; 49int gcmp_present = -1;
49int gic_present; 50int gic_present;
diff --git a/arch/mips/mti-malta/malta-time.c b/arch/mips/mti-malta/malta-time.c
index f8ee945ee41..115f5bc0600 100644
--- a/arch/mips/mti-malta/malta-time.c
+++ b/arch/mips/mti-malta/malta-time.c
@@ -35,6 +35,7 @@
35#include <asm/irq.h> 35#include <asm/irq.h>
36#include <asm/div64.h> 36#include <asm/div64.h>
37#include <asm/cpu.h> 37#include <asm/cpu.h>
38#include <asm/setup.h>
38#include <asm/time.h> 39#include <asm/time.h>
39#include <asm/mc146818-time.h> 40#include <asm/mc146818-time.h>
40#include <asm/msc01_ic.h> 41#include <asm/msc01_ic.h>
diff --git a/arch/mips/netlogic/common/irq.c b/arch/mips/netlogic/common/irq.c
index 49a4f6cf71e..e52bfcbce09 100644
--- a/arch/mips/netlogic/common/irq.c
+++ b/arch/mips/netlogic/common/irq.c
@@ -43,7 +43,6 @@
43 43
44#include <asm/errno.h> 44#include <asm/errno.h>
45#include <asm/signal.h> 45#include <asm/signal.h>
46#include <asm/system.h>
47#include <asm/ptrace.h> 46#include <asm/ptrace.h>
48#include <asm/mipsregs.h> 47#include <asm/mipsregs.h>
49#include <asm/thread_info.h> 48#include <asm/thread_info.h>
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c b/arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c
index c4fa2d775d8..2e6f7cab24c 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_irq_cic.c
@@ -16,7 +16,6 @@
16#include <linux/irq.h> 16#include <linux/irq.h>
17 17
18#include <asm/mipsregs.h> 18#include <asm/mipsregs.h>
19#include <asm/system.h>
20 19
21#include <msp_cic_int.h> 20#include <msp_cic_int.h>
22#include <msp_regs.h> 21#include <msp_regs.h>
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_irq_per.c b/arch/mips/pmc-sierra/msp71xx/msp_irq_per.c
index 98fd0099d96..598b6a66b97 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_irq_per.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_irq_per.c
@@ -16,7 +16,6 @@
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17 17
18#include <asm/mipsregs.h> 18#include <asm/mipsregs.h>
19#include <asm/system.h>
20 19
21#include <msp_cic_int.h> 20#include <msp_cic_int.h>
22#include <msp_regs.h> 21#include <msp_regs.h>
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c b/arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c
index 5bbcc47da6b..83a1c5eae3f 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c
@@ -16,7 +16,6 @@
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17 17
18#include <asm/mipsregs.h> 18#include <asm/mipsregs.h>
19#include <asm/system.h>
20 19
21#include <msp_slp_int.h> 20#include <msp_slp_int.h>
22#include <msp_regs.h> 21#include <msp_regs.h>
diff --git a/arch/mips/pmc-sierra/yosemite/irq.c b/arch/mips/pmc-sierra/yosemite/irq.c
index 25bbbf428be..6590812daa5 100644
--- a/arch/mips/pmc-sierra/yosemite/irq.c
+++ b/arch/mips/pmc-sierra/yosemite/irq.c
@@ -44,7 +44,6 @@
44#include <asm/irq.h> 44#include <asm/irq.h>
45#include <asm/irq_cpu.h> 45#include <asm/irq_cpu.h>
46#include <asm/mipsregs.h> 46#include <asm/mipsregs.h>
47#include <asm/system.h>
48#include <asm/titan_dep.h> 47#include <asm/titan_dep.h>
49 48
50/* Hypertransport specific */ 49/* Hypertransport specific */
diff --git a/arch/mips/pmc-sierra/yosemite/prom.c b/arch/mips/pmc-sierra/yosemite/prom.c
index dcc926e06fc..6a2754c4f10 100644
--- a/arch/mips/pmc-sierra/yosemite/prom.c
+++ b/arch/mips/pmc-sierra/yosemite/prom.c
@@ -20,7 +20,6 @@
20#include <asm/processor.h> 20#include <asm/processor.h>
21#include <asm/reboot.h> 21#include <asm/reboot.h>
22#include <asm/smp-ops.h> 22#include <asm/smp-ops.h>
23#include <asm/system.h>
24#include <asm/bootinfo.h> 23#include <asm/bootinfo.h>
25#include <asm/pmon.h> 24#include <asm/pmon.h>
26 25
diff --git a/arch/mips/pnx833x/common/interrupts.c b/arch/mips/pnx833x/common/interrupts.c
index adc171c8846..a86d5d5fceb 100644
--- a/arch/mips/pnx833x/common/interrupts.c
+++ b/arch/mips/pnx833x/common/interrupts.c
@@ -25,6 +25,7 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <asm/mipsregs.h> 26#include <asm/mipsregs.h>
27#include <asm/irq_cpu.h> 27#include <asm/irq_cpu.h>
28#include <asm/setup.h>
28#include <irq.h> 29#include <irq.h>
29#include <irq-mapping.h> 30#include <irq-mapping.h>
30#include <gpio.h> 31#include <gpio.h>
diff --git a/arch/mips/powertv/asic/asic_int.c b/arch/mips/powertv/asic/asic_int.c
index 529c44a52d6..99d82e10000 100644
--- a/arch/mips/powertv/asic/asic_int.c
+++ b/arch/mips/powertv/asic/asic_int.c
@@ -34,6 +34,7 @@
34#include <asm/irq_cpu.h> 34#include <asm/irq_cpu.h>
35#include <linux/io.h> 35#include <linux/io.h>
36#include <asm/irq_regs.h> 36#include <asm/irq_regs.h>
37#include <asm/setup.h>
37#include <asm/mips-boards/generic.h> 38#include <asm/mips-boards/generic.h>
38 39
39#include <asm/mach-powertv/asic_regs.h> 40#include <asm/mach-powertv/asic_regs.h>
diff --git a/arch/mips/powertv/asic/irq_asic.c b/arch/mips/powertv/asic/irq_asic.c
index 7fb97fb0931..fa9ae958471 100644
--- a/arch/mips/powertv/asic/irq_asic.c
+++ b/arch/mips/powertv/asic/irq_asic.c
@@ -17,7 +17,6 @@
17 17
18#include <asm/irq_cpu.h> 18#include <asm/irq_cpu.h>
19#include <asm/mipsregs.h> 19#include <asm/mipsregs.h>
20#include <asm/system.h>
21 20
22#include <asm/mach-powertv/asic_regs.h> 21#include <asm/mach-powertv/asic_regs.h>
23 22
diff --git a/arch/mips/powertv/init.c b/arch/mips/powertv/init.c
index 83552288e80..1cf5abbef71 100644
--- a/arch/mips/powertv/init.c
+++ b/arch/mips/powertv/init.c
@@ -26,7 +26,6 @@
26 26
27#include <asm/bootinfo.h> 27#include <asm/bootinfo.h>
28#include <linux/io.h> 28#include <linux/io.h>
29#include <asm/system.h>
30#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
31#include <asm/traps.h> 30#include <asm/traps.h>
32 31
diff --git a/arch/mips/rb532/irq.c b/arch/mips/rb532/irq.c
index 7c6db74e3fa..f298430cff0 100644
--- a/arch/mips/rb532/irq.c
+++ b/arch/mips/rb532/irq.c
@@ -42,7 +42,6 @@
42#include <asm/bootinfo.h> 42#include <asm/bootinfo.h>
43#include <asm/time.h> 43#include <asm/time.h>
44#include <asm/mipsregs.h> 44#include <asm/mipsregs.h>
45#include <asm/system.h>
46 45
47#include <asm/mach-rc32434/irq.h> 46#include <asm/mach-rc32434/irq.h>
48#include <asm/mach-rc32434/gpio.h> 47#include <asm/mach-rc32434/gpio.h>
diff --git a/arch/mips/sgi-ip22/ip22-berr.c b/arch/mips/sgi-ip22/ip22-berr.c
index 911d3999c0c..3f6ccd53c15 100644
--- a/arch/mips/sgi-ip22/ip22-berr.c
+++ b/arch/mips/sgi-ip22/ip22-berr.c
@@ -9,7 +9,6 @@
9#include <linux/sched.h> 9#include <linux/sched.h>
10 10
11#include <asm/addrspace.h> 11#include <asm/addrspace.h>
12#include <asm/system.h>
13#include <asm/traps.h> 12#include <asm/traps.h>
14#include <asm/branch.h> 13#include <asm/branch.h>
15#include <asm/irq_regs.h> 14#include <asm/irq_regs.h>
diff --git a/arch/mips/sgi-ip22/ip22-reset.c b/arch/mips/sgi-ip22/ip22-reset.c
index 45b6694c207..20363d29cb5 100644
--- a/arch/mips/sgi-ip22/ip22-reset.c
+++ b/arch/mips/sgi-ip22/ip22-reset.c
@@ -18,7 +18,6 @@
18 18
19#include <asm/io.h> 19#include <asm/io.h>
20#include <asm/irq.h> 20#include <asm/irq.h>
21#include <asm/system.h>
22#include <asm/reboot.h> 21#include <asm/reboot.h>
23#include <asm/sgialib.h> 22#include <asm/sgialib.h>
24#include <asm/sgi/ioc.h> 23#include <asm/sgi/ioc.h>
diff --git a/arch/mips/sgi-ip22/ip28-berr.c b/arch/mips/sgi-ip22/ip28-berr.c
index 88c684e05a3..0626555fd1a 100644
--- a/arch/mips/sgi-ip22/ip28-berr.c
+++ b/arch/mips/sgi-ip22/ip28-berr.c
@@ -11,7 +11,6 @@
11#include <linux/seq_file.h> 11#include <linux/seq_file.h>
12 12
13#include <asm/addrspace.h> 13#include <asm/addrspace.h>
14#include <asm/system.h>
15#include <asm/traps.h> 14#include <asm/traps.h>
16#include <asm/branch.h> 15#include <asm/branch.h>
17#include <asm/irq_regs.h> 16#include <asm/irq_regs.h>
diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c
index 23642238c68..69a939ae65e 100644
--- a/arch/mips/sgi-ip27/ip27-irq.c
+++ b/arch/mips/sgi-ip27/ip27-irq.c
@@ -27,7 +27,6 @@
27#include <asm/bootinfo.h> 27#include <asm/bootinfo.h>
28#include <asm/io.h> 28#include <asm/io.h>
29#include <asm/mipsregs.h> 29#include <asm/mipsregs.h>
30#include <asm/system.h>
31 30
32#include <asm/processor.h> 31#include <asm/processor.h>
33#include <asm/pci/bridge.h> 32#include <asm/pci/bridge.h>
diff --git a/arch/mips/sgi-ip27/ip27-reset.c b/arch/mips/sgi-ip27/ip27-reset.c
index c17076108d4..f347bc6b795 100644
--- a/arch/mips/sgi-ip27/ip27-reset.c
+++ b/arch/mips/sgi-ip27/ip27-reset.c
@@ -19,7 +19,6 @@
19#include <asm/io.h> 19#include <asm/io.h>
20#include <asm/irq.h> 20#include <asm/irq.h>
21#include <asm/reboot.h> 21#include <asm/reboot.h>
22#include <asm/system.h>
23#include <asm/sgialib.h> 22#include <asm/sgialib.h>
24#include <asm/sn/addrs.h> 23#include <asm/sn/addrs.h>
25#include <asm/sn/arch.h> 24#include <asm/sn/arch.h>
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index a092860d519..e7d5054de8c 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -22,7 +22,6 @@
22#include <asm/irq_cpu.h> 22#include <asm/irq_cpu.h>
23#include <asm/mipsregs.h> 23#include <asm/mipsregs.h>
24#include <asm/signal.h> 24#include <asm/signal.h>
25#include <asm/system.h>
26#include <asm/time.h> 25#include <asm/time.h>
27#include <asm/ip32/crime.h> 26#include <asm/ip32/crime.h>
28#include <asm/ip32/mace.h> 27#include <asm/ip32/mace.h>
diff --git a/arch/mips/sgi-ip32/ip32-reset.c b/arch/mips/sgi-ip32/ip32-reset.c
index 9b95d80ebc6..1f823da4c77 100644
--- a/arch/mips/sgi-ip32/ip32-reset.c
+++ b/arch/mips/sgi-ip32/ip32-reset.c
@@ -20,7 +20,6 @@
20#include <asm/addrspace.h> 20#include <asm/addrspace.h>
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/reboot.h> 22#include <asm/reboot.h>
23#include <asm/system.h>
24#include <asm/wbflush.h> 23#include <asm/wbflush.h>
25#include <asm/ip32/mace.h> 24#include <asm/ip32/mace.h>
26#include <asm/ip32/crime.h> 25#include <asm/ip32/crime.h>
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index 09740d60e18..215713e1f3c 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -27,7 +27,6 @@
27#include <asm/errno.h> 27#include <asm/errno.h>
28#include <asm/irq_regs.h> 28#include <asm/irq_regs.h>
29#include <asm/signal.h> 29#include <asm/signal.h>
30#include <asm/system.h>
31#include <asm/io.h> 30#include <asm/io.h>
32 31
33#include <asm/sibyte/bcm1480_regs.h> 32#include <asm/sibyte/bcm1480_regs.h>
diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c
index 48853ab5bcf..e8c4538c5f6 100644
--- a/arch/mips/sibyte/common/sb_tbprof.c
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -53,7 +53,6 @@
53#define K_INT_PERF_CNT K_BCM1480_INT_PERF_CNT 53#define K_INT_PERF_CNT K_BCM1480_INT_PERF_CNT
54#endif 54#endif
55 55
56#include <asm/system.h>
57#include <asm/uaccess.h> 56#include <asm/uaccess.h>
58 57
59#define SBPROF_TB_MAJOR 240 58#define SBPROF_TB_MAJOR 240
diff --git a/arch/mips/sibyte/sb1250/bus_watcher.c b/arch/mips/sibyte/sb1250/bus_watcher.c
index 45274bd3cd8..86e6e54dd15 100644
--- a/arch/mips/sibyte/sb1250/bus_watcher.c
+++ b/arch/mips/sibyte/sb1250/bus_watcher.c
@@ -30,7 +30,6 @@
30#include <linux/interrupt.h> 30#include <linux/interrupt.h>
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
33#include <asm/system.h>
34#include <asm/io.h> 33#include <asm/io.h>
35 34
36#include <asm/sibyte/sb1250.h> 35#include <asm/sibyte/sb1250.h>
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 76ee045e2ce..340aaf62665 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -26,7 +26,6 @@
26 26
27#include <asm/errno.h> 27#include <asm/errno.h>
28#include <asm/signal.h> 28#include <asm/signal.h>
29#include <asm/system.h>
30#include <asm/time.h> 29#include <asm/time.h>
31#include <asm/io.h> 30#include <asm/io.h>
32 31
diff --git a/arch/mips/sni/reset.c b/arch/mips/sni/reset.c
index 79f8d70f48c..244f9427625 100644
--- a/arch/mips/sni/reset.c
+++ b/arch/mips/sni/reset.c
@@ -5,7 +5,6 @@
5 */ 5 */
6#include <asm/io.h> 6#include <asm/io.h>
7#include <asm/reboot.h> 7#include <asm/reboot.h>
8#include <asm/system.h>
9#include <asm/sni.h> 8#include <asm/sni.h>
10 9
11/* 10/*
diff --git a/arch/mips/vr41xx/common/irq.c b/arch/mips/vr41xx/common/irq.c
index fad2bef432c..ae0e4ee6c61 100644
--- a/arch/mips/vr41xx/common/irq.c
+++ b/arch/mips/vr41xx/common/irq.c
@@ -22,7 +22,6 @@
22#include <linux/irq.h> 22#include <linux/irq.h>
23 23
24#include <asm/irq_cpu.h> 24#include <asm/irq_cpu.h>
25#include <asm/system.h>
26#include <asm/vr41xx/irq.h> 25#include <asm/vr41xx/irq.h>
27 26
28typedef struct irq_cascade { 27typedef struct irq_cascade {
diff --git a/arch/mips/vr41xx/common/pmu.c b/arch/mips/vr41xx/common/pmu.c
index 692b4e85b7f..9fbf5f0d1fa 100644
--- a/arch/mips/vr41xx/common/pmu.c
+++ b/arch/mips/vr41xx/common/pmu.c
@@ -30,7 +30,6 @@
30#include <asm/io.h> 30#include <asm/io.h>
31#include <asm/processor.h> 31#include <asm/processor.h>
32#include <asm/reboot.h> 32#include <asm/reboot.h>
33#include <asm/system.h>
34 33
35#define PMU_TYPE1_BASE 0x0b0000a0UL 34#define PMU_TYPE1_BASE 0x0b0000a0UL
36#define PMU_TYPE1_SIZE 0x0eUL 35#define PMU_TYPE1_SIZE 0x0eUL
diff --git a/arch/mn10300/include/asm/atomic.h b/arch/mn10300/include/asm/atomic.h
index b9a8f846126..975e1841ca6 100644
--- a/arch/mn10300/include/asm/atomic.h
+++ b/arch/mn10300/include/asm/atomic.h
@@ -12,112 +12,7 @@
12#define _ASM_ATOMIC_H 12#define _ASM_ATOMIC_H
13 13
14#include <asm/irqflags.h> 14#include <asm/irqflags.h>
15 15#include <asm/cmpxchg.h>
16#ifndef __ASSEMBLY__
17
18#ifdef CONFIG_SMP
19#ifdef CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT
20static inline
21unsigned long __xchg(volatile unsigned long *m, unsigned long val)
22{
23 unsigned long status;
24 unsigned long oldval;
25
26 asm volatile(
27 "1: mov %4,(_AAR,%3) \n"
28 " mov (_ADR,%3),%1 \n"
29 " mov %5,(_ADR,%3) \n"
30 " mov (_ADR,%3),%0 \n" /* flush */
31 " mov (_ASR,%3),%0 \n"
32 " or %0,%0 \n"
33 " bne 1b \n"
34 : "=&r"(status), "=&r"(oldval), "=m"(*m)
35 : "a"(ATOMIC_OPS_BASE_ADDR), "r"(m), "r"(val)
36 : "memory", "cc");
37
38 return oldval;
39}
40
41static inline unsigned long __cmpxchg(volatile unsigned long *m,
42 unsigned long old, unsigned long new)
43{
44 unsigned long status;
45 unsigned long oldval;
46
47 asm volatile(
48 "1: mov %4,(_AAR,%3) \n"
49 " mov (_ADR,%3),%1 \n"
50 " cmp %5,%1 \n"
51 " bne 2f \n"
52 " mov %6,(_ADR,%3) \n"
53 "2: mov (_ADR,%3),%0 \n" /* flush */
54 " mov (_ASR,%3),%0 \n"
55 " or %0,%0 \n"
56 " bne 1b \n"
57 : "=&r"(status), "=&r"(oldval), "=m"(*m)
58 : "a"(ATOMIC_OPS_BASE_ADDR), "r"(m),
59 "r"(old), "r"(new)
60 : "memory", "cc");
61
62 return oldval;
63}
64#else /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */
65#error "No SMP atomic operation support!"
66#endif /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */
67
68#else /* CONFIG_SMP */
69
70/*
71 * Emulate xchg for non-SMP MN10300
72 */
73struct __xchg_dummy { unsigned long a[100]; };
74#define __xg(x) ((struct __xchg_dummy *)(x))
75
76static inline
77unsigned long __xchg(volatile unsigned long *m, unsigned long val)
78{
79 unsigned long oldval;
80 unsigned long flags;
81
82 flags = arch_local_cli_save();
83 oldval = *m;
84 *m = val;
85 arch_local_irq_restore(flags);
86 return oldval;
87}
88
89/*
90 * Emulate cmpxchg for non-SMP MN10300
91 */
92static inline unsigned long __cmpxchg(volatile unsigned long *m,
93 unsigned long old, unsigned long new)
94{
95 unsigned long oldval;
96 unsigned long flags;
97
98 flags = arch_local_cli_save();
99 oldval = *m;
100 if (oldval == old)
101 *m = new;
102 arch_local_irq_restore(flags);
103 return oldval;
104}
105
106#endif /* CONFIG_SMP */
107
108#define xchg(ptr, v) \
109 ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr), \
110 (unsigned long)(v)))
111
112#define cmpxchg(ptr, o, n) \
113 ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
114 (unsigned long)(o), \
115 (unsigned long)(n)))
116
117#define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v)))
118#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
119
120#endif /* !__ASSEMBLY__ */
121 16
122#ifndef CONFIG_SMP 17#ifndef CONFIG_SMP
123#include <asm-generic/atomic.h> 18#include <asm-generic/atomic.h>
@@ -269,6 +164,8 @@ static inline void atomic_dec(atomic_t *v)
269 c; \ 164 c; \
270}) 165})
271 166
167#define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v)))
168#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
272 169
273/** 170/**
274 * atomic_clear_mask - Atomically clear bits in memory 171 * atomic_clear_mask - Atomically clear bits in memory
diff --git a/arch/mn10300/include/asm/barrier.h b/arch/mn10300/include/asm/barrier.h
new file mode 100644
index 00000000000..2bd97a5c8af
--- /dev/null
+++ b/arch/mn10300/include/asm/barrier.h
@@ -0,0 +1,37 @@
1/* MN10300 memory barrier definitions
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11#ifndef _ASM_BARRIER_H
12#define _ASM_BARRIER_H
13
14#define nop() asm volatile ("nop")
15
16#define mb() asm volatile ("": : :"memory")
17#define rmb() mb()
18#define wmb() asm volatile ("": : :"memory")
19
20#ifdef CONFIG_SMP
21#define smp_mb() mb()
22#define smp_rmb() rmb()
23#define smp_wmb() wmb()
24#define set_mb(var, value) do { xchg(&var, value); } while (0)
25#else /* CONFIG_SMP */
26#define smp_mb() barrier()
27#define smp_rmb() barrier()
28#define smp_wmb() barrier()
29#define set_mb(var, value) do { var = value; mb(); } while (0)
30#endif /* CONFIG_SMP */
31
32#define set_wmb(var, value) do { var = value; wmb(); } while (0)
33
34#define read_barrier_depends() do {} while (0)
35#define smp_read_barrier_depends() do {} while (0)
36
37#endif /* _ASM_BARRIER_H */
diff --git a/arch/mn10300/include/asm/cmpxchg.h b/arch/mn10300/include/asm/cmpxchg.h
new file mode 100644
index 00000000000..97a4aaf387a
--- /dev/null
+++ b/arch/mn10300/include/asm/cmpxchg.h
@@ -0,0 +1,115 @@
1/* MN10300 Atomic xchg/cmpxchg operations
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11#ifndef _ASM_CMPXCHG_H
12#define _ASM_CMPXCHG_H
13
14#include <asm/irqflags.h>
15
16#ifdef CONFIG_SMP
17#ifdef CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT
18static inline
19unsigned long __xchg(volatile unsigned long *m, unsigned long val)
20{
21 unsigned long status;
22 unsigned long oldval;
23
24 asm volatile(
25 "1: mov %4,(_AAR,%3) \n"
26 " mov (_ADR,%3),%1 \n"
27 " mov %5,(_ADR,%3) \n"
28 " mov (_ADR,%3),%0 \n" /* flush */
29 " mov (_ASR,%3),%0 \n"
30 " or %0,%0 \n"
31 " bne 1b \n"
32 : "=&r"(status), "=&r"(oldval), "=m"(*m)
33 : "a"(ATOMIC_OPS_BASE_ADDR), "r"(m), "r"(val)
34 : "memory", "cc");
35
36 return oldval;
37}
38
39static inline unsigned long __cmpxchg(volatile unsigned long *m,
40 unsigned long old, unsigned long new)
41{
42 unsigned long status;
43 unsigned long oldval;
44
45 asm volatile(
46 "1: mov %4,(_AAR,%3) \n"
47 " mov (_ADR,%3),%1 \n"
48 " cmp %5,%1 \n"
49 " bne 2f \n"
50 " mov %6,(_ADR,%3) \n"
51 "2: mov (_ADR,%3),%0 \n" /* flush */
52 " mov (_ASR,%3),%0 \n"
53 " or %0,%0 \n"
54 " bne 1b \n"
55 : "=&r"(status), "=&r"(oldval), "=m"(*m)
56 : "a"(ATOMIC_OPS_BASE_ADDR), "r"(m),
57 "r"(old), "r"(new)
58 : "memory", "cc");
59
60 return oldval;
61}
62#else /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */
63#error "No SMP atomic operation support!"
64#endif /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */
65
66#else /* CONFIG_SMP */
67
68/*
69 * Emulate xchg for non-SMP MN10300
70 */
71struct __xchg_dummy { unsigned long a[100]; };
72#define __xg(x) ((struct __xchg_dummy *)(x))
73
74static inline
75unsigned long __xchg(volatile unsigned long *m, unsigned long val)
76{
77 unsigned long oldval;
78 unsigned long flags;
79
80 flags = arch_local_cli_save();
81 oldval = *m;
82 *m = val;
83 arch_local_irq_restore(flags);
84 return oldval;
85}
86
87/*
88 * Emulate cmpxchg for non-SMP MN10300
89 */
90static inline unsigned long __cmpxchg(volatile unsigned long *m,
91 unsigned long old, unsigned long new)
92{
93 unsigned long oldval;
94 unsigned long flags;
95
96 flags = arch_local_cli_save();
97 oldval = *m;
98 if (oldval == old)
99 *m = new;
100 arch_local_irq_restore(flags);
101 return oldval;
102}
103
104#endif /* CONFIG_SMP */
105
106#define xchg(ptr, v) \
107 ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr), \
108 (unsigned long)(v)))
109
110#define cmpxchg(ptr, o, n) \
111 ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
112 (unsigned long)(o), \
113 (unsigned long)(n)))
114
115#endif /* _ASM_CMPXCHG_H */
diff --git a/arch/mn10300/include/asm/dma.h b/arch/mn10300/include/asm/dma.h
index 098df2e617a..10b77d4628c 100644
--- a/arch/mn10300/include/asm/dma.h
+++ b/arch/mn10300/include/asm/dma.h
@@ -11,7 +11,6 @@
11#ifndef _ASM_DMA_H 11#ifndef _ASM_DMA_H
12#define _ASM_DMA_H 12#define _ASM_DMA_H
13 13
14#include <asm/system.h>
15#include <linux/spinlock.h> 14#include <linux/spinlock.h>
16#include <asm/io.h> 15#include <asm/io.h>
17#include <linux/delay.h> 16#include <linux/delay.h>
diff --git a/arch/mn10300/include/asm/exec.h b/arch/mn10300/include/asm/exec.h
new file mode 100644
index 00000000000..c74e367f4b9
--- /dev/null
+++ b/arch/mn10300/include/asm/exec.h
@@ -0,0 +1,16 @@
1/* MN10300 process execution definitions
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11#ifndef _ASM_EXEC_H
12#define _ASM_EXEC_H
13
14#define arch_align_stack(x) (x)
15
16#endif /* _ASM_EXEC_H */
diff --git a/arch/mn10300/include/asm/switch_to.h b/arch/mn10300/include/asm/switch_to.h
new file mode 100644
index 00000000000..393d311735c
--- /dev/null
+++ b/arch/mn10300/include/asm/switch_to.h
@@ -0,0 +1,49 @@
1/* MN10300 task switching definitions
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11#ifndef _ASM_SWITCH_TO_H
12#define _ASM_SWITCH_TO_H
13
14#include <asm/barrier.h>
15
16struct task_struct;
17struct thread_struct;
18
19#if !defined(CONFIG_LAZY_SAVE_FPU)
20struct fpu_state_struct;
21extern asmlinkage void fpu_save(struct fpu_state_struct *);
22#define switch_fpu(prev, next) \
23 do { \
24 if ((prev)->thread.fpu_flags & THREAD_HAS_FPU) { \
25 (prev)->thread.fpu_flags &= ~THREAD_HAS_FPU; \
26 (prev)->thread.uregs->epsw &= ~EPSW_FE; \
27 fpu_save(&(prev)->thread.fpu_state); \
28 } \
29 } while (0)
30#else
31#define switch_fpu(prev, next) do {} while (0)
32#endif
33
34/* context switching is now performed out-of-line in switch_to.S */
35extern asmlinkage
36struct task_struct *__switch_to(struct thread_struct *prev,
37 struct thread_struct *next,
38 struct task_struct *prev_task);
39
40#define switch_to(prev, next, last) \
41do { \
42 switch_fpu(prev, next); \
43 current->thread.wchan = (u_long) __builtin_return_address(0); \
44 (last) = __switch_to(&(prev)->thread, &(next)->thread, (prev)); \
45 mb(); \
46 current->thread.wchan = 0; \
47} while (0)
48
49#endif /* _ASM_SWITCH_TO_H */
diff --git a/arch/mn10300/include/asm/system.h b/arch/mn10300/include/asm/system.h
deleted file mode 100644
index 94b4c5e1491..00000000000
--- a/arch/mn10300/include/asm/system.h
+++ /dev/null
@@ -1,102 +0,0 @@
1/* MN10300 System definitions
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11#ifndef _ASM_SYSTEM_H
12#define _ASM_SYSTEM_H
13
14#include <asm/cpu-regs.h>
15#include <asm/intctl-regs.h>
16
17#ifdef __KERNEL__
18#ifndef __ASSEMBLY__
19
20#include <linux/kernel.h>
21#include <linux/irqflags.h>
22#include <linux/atomic.h>
23
24#if !defined(CONFIG_LAZY_SAVE_FPU)
25struct fpu_state_struct;
26extern asmlinkage void fpu_save(struct fpu_state_struct *);
27#define switch_fpu(prev, next) \
28 do { \
29 if ((prev)->thread.fpu_flags & THREAD_HAS_FPU) { \
30 (prev)->thread.fpu_flags &= ~THREAD_HAS_FPU; \
31 (prev)->thread.uregs->epsw &= ~EPSW_FE; \
32 fpu_save(&(prev)->thread.fpu_state); \
33 } \
34 } while (0)
35#else
36#define switch_fpu(prev, next) do {} while (0)
37#endif
38
39struct task_struct;
40struct thread_struct;
41
42extern asmlinkage
43struct task_struct *__switch_to(struct thread_struct *prev,
44 struct thread_struct *next,
45 struct task_struct *prev_task);
46
47/* context switching is now performed out-of-line in switch_to.S */
48#define switch_to(prev, next, last) \
49do { \
50 switch_fpu(prev, next); \
51 current->thread.wchan = (u_long) __builtin_return_address(0); \
52 (last) = __switch_to(&(prev)->thread, &(next)->thread, (prev)); \
53 mb(); \
54 current->thread.wchan = 0; \
55} while (0)
56
57#define arch_align_stack(x) (x)
58
59#define nop() asm volatile ("nop")
60
61/*
62 * Force strict CPU ordering.
63 * And yes, this is required on UP too when we're talking
64 * to devices.
65 *
66 * For now, "wmb()" doesn't actually do anything, as all
67 * Intel CPU's follow what Intel calls a *Processor Order*,
68 * in which all writes are seen in the program order even
69 * outside the CPU.
70 *
71 * I expect future Intel CPU's to have a weaker ordering,
72 * but I'd also expect them to finally get their act together
73 * and add some real memory barriers if so.
74 *
75 * Some non intel clones support out of order store. wmb() ceases to be a
76 * nop for these.
77 */
78
79#define mb() asm volatile ("": : :"memory")
80#define rmb() mb()
81#define wmb() asm volatile ("": : :"memory")
82
83#ifdef CONFIG_SMP
84#define smp_mb() mb()
85#define smp_rmb() rmb()
86#define smp_wmb() wmb()
87#define set_mb(var, value) do { xchg(&var, value); } while (0)
88#else /* CONFIG_SMP */
89#define smp_mb() barrier()
90#define smp_rmb() barrier()
91#define smp_wmb() barrier()
92#define set_mb(var, value) do { var = value; mb(); } while (0)
93#endif /* CONFIG_SMP */
94
95#define set_wmb(var, value) do { var = value; wmb(); } while (0)
96
97#define read_barrier_depends() do {} while (0)
98#define smp_read_barrier_depends() do {} while (0)
99
100#endif /* !__ASSEMBLY__ */
101#endif /* __KERNEL__ */
102#endif /* _ASM_SYSTEM_H */
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S
index 3e3620d9fc4..8e11f9f4899 100644
--- a/arch/mn10300/kernel/entry.S
+++ b/arch/mn10300/kernel/entry.S
@@ -15,7 +15,6 @@
15#include <linux/sys.h> 15#include <linux/sys.h>
16#include <linux/linkage.h> 16#include <linux/linkage.h>
17#include <asm/smp.h> 17#include <asm/smp.h>
18#include <asm/system.h>
19#include <asm/irqflags.h> 18#include <asm/irqflags.h>
20#include <asm/thread_info.h> 19#include <asm/thread_info.h>
21#include <asm/intctl-regs.h> 20#include <asm/intctl-regs.h>
diff --git a/arch/mn10300/kernel/fpu.c b/arch/mn10300/kernel/fpu.c
index bb5fa7df6c4..064fa194de2 100644
--- a/arch/mn10300/kernel/fpu.c
+++ b/arch/mn10300/kernel/fpu.c
@@ -12,7 +12,6 @@
12#include <asm/fpu.h> 12#include <asm/fpu.h>
13#include <asm/elf.h> 13#include <asm/elf.h>
14#include <asm/exceptions.h> 14#include <asm/exceptions.h>
15#include <asm/system.h>
16 15
17#ifdef CONFIG_LAZY_SAVE_FPU 16#ifdef CONFIG_LAZY_SAVE_FPU
18struct task_struct *fpu_state_owner; 17struct task_struct *fpu_state_owner;
diff --git a/arch/mn10300/kernel/gdb-io-serial.c b/arch/mn10300/kernel/gdb-io-serial.c
index f28dc99c6f7..df51242744c 100644
--- a/arch/mn10300/kernel/gdb-io-serial.c
+++ b/arch/mn10300/kernel/gdb-io-serial.c
@@ -18,7 +18,6 @@
18#include <linux/nmi.h> 18#include <linux/nmi.h>
19 19
20#include <asm/pgtable.h> 20#include <asm/pgtable.h>
21#include <asm/system.h>
22#include <asm/gdb-stub.h> 21#include <asm/gdb-stub.h>
23#include <asm/exceptions.h> 22#include <asm/exceptions.h>
24#include <asm/serial-regs.h> 23#include <asm/serial-regs.h>
diff --git a/arch/mn10300/kernel/gdb-io-ttysm.c b/arch/mn10300/kernel/gdb-io-ttysm.c
index c859cacbb9c..caae8cac9db 100644
--- a/arch/mn10300/kernel/gdb-io-ttysm.c
+++ b/arch/mn10300/kernel/gdb-io-ttysm.c
@@ -17,7 +17,6 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/tty.h> 18#include <linux/tty.h>
19#include <asm/pgtable.h> 19#include <asm/pgtable.h>
20#include <asm/system.h>
21#include <asm/gdb-stub.h> 20#include <asm/gdb-stub.h>
22#include <asm/exceptions.h> 21#include <asm/exceptions.h>
23#include <unit/clock.h> 22#include <unit/clock.h>
diff --git a/arch/mn10300/kernel/gdb-stub.c b/arch/mn10300/kernel/gdb-stub.c
index 522eb8a9b60..a128c57b586 100644
--- a/arch/mn10300/kernel/gdb-stub.c
+++ b/arch/mn10300/kernel/gdb-stub.c
@@ -130,7 +130,6 @@
130#include <linux/bug.h> 130#include <linux/bug.h>
131 131
132#include <asm/pgtable.h> 132#include <asm/pgtable.h>
133#include <asm/system.h>
134#include <asm/gdb-stub.h> 133#include <asm/gdb-stub.h>
135#include <asm/exceptions.h> 134#include <asm/exceptions.h>
136#include <asm/debugger.h> 135#include <asm/debugger.h>
diff --git a/arch/mn10300/kernel/mn10300-serial.c b/arch/mn10300/kernel/mn10300-serial.c
index 94901c56baf..339cef4c825 100644
--- a/arch/mn10300/kernel/mn10300-serial.c
+++ b/arch/mn10300/kernel/mn10300-serial.c
@@ -36,7 +36,6 @@ static const char serial_revdate[] = "2007-11-06";
36#include <linux/console.h> 36#include <linux/console.h>
37#include <linux/sysrq.h> 37#include <linux/sysrq.h>
38 38
39#include <asm/system.h>
40#include <asm/io.h> 39#include <asm/io.h>
41#include <asm/irq.h> 40#include <asm/irq.h>
42#include <asm/bitops.h> 41#include <asm/bitops.h>
diff --git a/arch/mn10300/kernel/mn10300-watchdog.c b/arch/mn10300/kernel/mn10300-watchdog.c
index a45f0c7549a..db64a7166c0 100644
--- a/arch/mn10300/kernel/mn10300-watchdog.c
+++ b/arch/mn10300/kernel/mn10300-watchdog.c
@@ -18,7 +18,6 @@
18#include <linux/kernel_stat.h> 18#include <linux/kernel_stat.h>
19#include <linux/nmi.h> 19#include <linux/nmi.h>
20#include <asm/processor.h> 20#include <asm/processor.h>
21#include <asm/system.h>
22#include <linux/atomic.h> 21#include <linux/atomic.h>
23#include <asm/intctl-regs.h> 22#include <asm/intctl-regs.h>
24#include <asm/rtc-regs.h> 23#include <asm/rtc-regs.h>
diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c
index cac401d37f7..14707f25153 100644
--- a/arch/mn10300/kernel/process.c
+++ b/arch/mn10300/kernel/process.c
@@ -27,7 +27,6 @@
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/pgtable.h> 29#include <asm/pgtable.h>
30#include <asm/system.h>
31#include <asm/io.h> 30#include <asm/io.h>
32#include <asm/processor.h> 31#include <asm/processor.h>
33#include <asm/mmu_context.h> 32#include <asm/mmu_context.h>
diff --git a/arch/mn10300/kernel/ptrace.c b/arch/mn10300/kernel/ptrace.c
index 5c0b07e6100..5bd58514e73 100644
--- a/arch/mn10300/kernel/ptrace.c
+++ b/arch/mn10300/kernel/ptrace.c
@@ -21,7 +21,6 @@
21#include <linux/tracehook.h> 21#include <linux/tracehook.h>
22#include <asm/uaccess.h> 22#include <asm/uaccess.h>
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/system.h>
25#include <asm/processor.h> 24#include <asm/processor.h>
26#include <asm/cacheflush.h> 25#include <asm/cacheflush.h>
27#include <asm/fpu.h> 26#include <asm/fpu.h>
diff --git a/arch/mn10300/kernel/setup.c b/arch/mn10300/kernel/setup.c
index 9e7a3209a3e..33c3bd1e5c6 100644
--- a/arch/mn10300/kernel/setup.c
+++ b/arch/mn10300/kernel/setup.c
@@ -26,7 +26,6 @@
26#include <asm/processor.h> 26#include <asm/processor.h>
27#include <linux/console.h> 27#include <linux/console.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/system.h>
30#include <asm/setup.h> 29#include <asm/setup.h>
31#include <asm/io.h> 30#include <asm/io.h>
32#include <asm/smp.h> 31#include <asm/smp.h>
diff --git a/arch/mn10300/kernel/smp-low.S b/arch/mn10300/kernel/smp-low.S
index 72938cefc05..71f1b2faaa0 100644
--- a/arch/mn10300/kernel/smp-low.S
+++ b/arch/mn10300/kernel/smp-low.S
@@ -13,9 +13,9 @@
13#include <linux/sys.h> 13#include <linux/sys.h>
14#include <linux/linkage.h> 14#include <linux/linkage.h>
15#include <asm/smp.h> 15#include <asm/smp.h>
16#include <asm/system.h>
17#include <asm/thread_info.h> 16#include <asm/thread_info.h>
18#include <asm/cpu-regs.h> 17#include <asm/cpu-regs.h>
18#include <asm/intctl-regs.h>
19#include <proc/smp-regs.h> 19#include <proc/smp-regs.h>
20#include <asm/asm-offsets.h> 20#include <asm/asm-offsets.h>
21#include <asm/frame.inc> 21#include <asm/frame.inc>
diff --git a/arch/mn10300/kernel/smp.c b/arch/mn10300/kernel/smp.c
index 9242e9fcc56..910dddf65e4 100644
--- a/arch/mn10300/kernel/smp.c
+++ b/arch/mn10300/kernel/smp.c
@@ -25,7 +25,6 @@
25#include <linux/profile.h> 25#include <linux/profile.h>
26#include <linux/smp.h> 26#include <linux/smp.h>
27#include <asm/tlbflush.h> 27#include <asm/tlbflush.h>
28#include <asm/system.h>
29#include <asm/bitops.h> 28#include <asm/bitops.h>
30#include <asm/processor.h> 29#include <asm/processor.h>
31#include <asm/bug.h> 30#include <asm/bug.h>
diff --git a/arch/mn10300/kernel/traps.c b/arch/mn10300/kernel/traps.c
index 9220a75a7b4..94a9c6d53e1 100644
--- a/arch/mn10300/kernel/traps.c
+++ b/arch/mn10300/kernel/traps.c
@@ -27,7 +27,6 @@
27#include <linux/bug.h> 27#include <linux/bug.h>
28#include <linux/irq.h> 28#include <linux/irq.h>
29#include <asm/processor.h> 29#include <asm/processor.h>
30#include <asm/system.h>
31#include <linux/uaccess.h> 30#include <linux/uaccess.h>
32#include <asm/io.h> 31#include <asm/io.h>
33#include <linux/atomic.h> 32#include <linux/atomic.h>
diff --git a/arch/mn10300/lib/bitops.c b/arch/mn10300/lib/bitops.c
index a66c6cdaf44..37309cdb758 100644
--- a/arch/mn10300/lib/bitops.c
+++ b/arch/mn10300/lib/bitops.c
@@ -10,7 +10,6 @@
10 */ 10 */
11#include <linux/module.h> 11#include <linux/module.h>
12#include <asm/bitops.h> 12#include <asm/bitops.h>
13#include <asm/system.h>
14 13
15/* 14/*
16 * try flipping a bit using BSET and BCLR 15 * try flipping a bit using BSET and BCLR
diff --git a/arch/mn10300/mm/fault.c b/arch/mn10300/mm/fault.c
index 0945409a802..90f346f7392 100644
--- a/arch/mn10300/mm/fault.c
+++ b/arch/mn10300/mm/fault.c
@@ -24,7 +24,6 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/vt_kern.h> /* For unblank_screen() */ 25#include <linux/vt_kern.h> /* For unblank_screen() */
26 26
27#include <asm/system.h>
28#include <asm/uaccess.h> 27#include <asm/uaccess.h>
29#include <asm/pgalloc.h> 28#include <asm/pgalloc.h>
30#include <asm/hardirq.h> 29#include <asm/hardirq.h>
diff --git a/arch/mn10300/mm/init.c b/arch/mn10300/mm/init.c
index 13801824e3e..e57e5bc2356 100644
--- a/arch/mn10300/mm/init.c
+++ b/arch/mn10300/mm/init.c
@@ -29,7 +29,6 @@
29#include <linux/gfp.h> 29#include <linux/gfp.h>
30 30
31#include <asm/processor.h> 31#include <asm/processor.h>
32#include <asm/system.h>
33#include <asm/uaccess.h> 32#include <asm/uaccess.h>
34#include <asm/pgtable.h> 33#include <asm/pgtable.h>
35#include <asm/pgalloc.h> 34#include <asm/pgalloc.h>
diff --git a/arch/mn10300/mm/misalignment.c b/arch/mn10300/mm/misalignment.c
index f9bb8cb1c14..b9920b1edd5 100644
--- a/arch/mn10300/mm/misalignment.c
+++ b/arch/mn10300/mm/misalignment.c
@@ -23,7 +23,6 @@
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/pci.h> 24#include <linux/pci.h>
25#include <asm/processor.h> 25#include <asm/processor.h>
26#include <asm/system.h>
27#include <asm/uaccess.h> 26#include <asm/uaccess.h>
28#include <asm/io.h> 27#include <asm/io.h>
29#include <linux/atomic.h> 28#include <linux/atomic.h>
diff --git a/arch/mn10300/mm/pgtable.c b/arch/mn10300/mm/pgtable.c
index 450f7ba3f8f..4ebf117c328 100644
--- a/arch/mn10300/mm/pgtable.c
+++ b/arch/mn10300/mm/pgtable.c
@@ -21,7 +21,6 @@
21#include <linux/spinlock.h> 21#include <linux/spinlock.h>
22#include <linux/quicklist.h> 22#include <linux/quicklist.h>
23 23
24#include <asm/system.h>
25#include <asm/pgtable.h> 24#include <asm/pgtable.h>
26#include <asm/pgalloc.h> 25#include <asm/pgalloc.h>
27#include <asm/tlb.h> 26#include <asm/tlb.h>
diff --git a/arch/mn10300/mm/tlb-smp.c b/arch/mn10300/mm/tlb-smp.c
index 9a777498a91..3e57faf0408 100644
--- a/arch/mn10300/mm/tlb-smp.c
+++ b/arch/mn10300/mm/tlb-smp.c
@@ -24,7 +24,6 @@
24#include <linux/profile.h> 24#include <linux/profile.h>
25#include <linux/smp.h> 25#include <linux/smp.h>
26#include <asm/tlbflush.h> 26#include <asm/tlbflush.h>
27#include <asm/system.h>
28#include <asm/bitops.h> 27#include <asm/bitops.h>
29#include <asm/processor.h> 28#include <asm/processor.h>
30#include <asm/bug.h> 29#include <asm/bug.h>
diff --git a/arch/mn10300/proc-mn2ws0050/proc-init.c b/arch/mn10300/proc-mn2ws0050/proc-init.c
index fe6e24906ff..ee6d03dbc8d 100644
--- a/arch/mn10300/proc-mn2ws0050/proc-init.c
+++ b/arch/mn10300/proc-mn2ws0050/proc-init.c
@@ -15,7 +15,6 @@
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16 16
17#include <asm/processor.h> 17#include <asm/processor.h>
18#include <asm/system.h>
19#include <asm/uaccess.h> 18#include <asm/uaccess.h>
20#include <asm/io.h> 19#include <asm/io.h>
21#include <linux/atomic.h> 20#include <linux/atomic.h>
diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild
index 11162e6c878..dcea5a0308a 100644
--- a/arch/openrisc/include/asm/Kbuild
+++ b/arch/openrisc/include/asm/Kbuild
@@ -4,6 +4,7 @@ header-y += spr_defs.h
4 4
5generic-y += atomic.h 5generic-y += atomic.h
6generic-y += auxvec.h 6generic-y += auxvec.h
7generic-y += barrier.h
7generic-y += bitsperlong.h 8generic-y += bitsperlong.h
8generic-y += bug.h 9generic-y += bug.h
9generic-y += bugs.h 10generic-y += bugs.h
@@ -19,6 +20,7 @@ generic-y += div64.h
19generic-y += dma.h 20generic-y += dma.h
20generic-y += emergency-restart.h 21generic-y += emergency-restart.h
21generic-y += errno.h 22generic-y += errno.h
23generic-y += exec.h
22generic-y += fb.h 24generic-y += fb.h
23generic-y += fcntl.h 25generic-y += fcntl.h
24generic-y += ftrace.h 26generic-y += ftrace.h
@@ -55,6 +57,7 @@ generic-y += sockios.h
55generic-y += statfs.h 57generic-y += statfs.h
56generic-y += stat.h 58generic-y += stat.h
57generic-y += string.h 59generic-y += string.h
60generic-y += switch_to.h
58generic-y += swab.h 61generic-y += swab.h
59generic-y += termbits.h 62generic-y += termbits.h
60generic-y += termios.h 63generic-y += termios.h
diff --git a/arch/openrisc/include/asm/system.h b/arch/openrisc/include/asm/system.h
deleted file mode 100644
index cf658882186..00000000000
--- a/arch/openrisc/include/asm/system.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * OpenRISC Linux
3 *
4 * Linux architectural port borrowing liberally from similar works of
5 * others. All original copyrights apply as per the original source
6 * declaration.
7 *
8 * OpenRISC implementation:
9 * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
10 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
11 * et al.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 */
18
19#ifndef __ASM_OPENRISC_SYSTEM_H
20#define __ASM_OPENRISC_SYSTEM_H
21
22#ifdef __KERNEL__
23#ifndef __ASSEMBLY__
24
25#include <asm/spr.h>
26#include <asm-generic/system.h>
27
28/* We probably need this definition, but the generic system.h provides it
29 * and it's not used on our arch anyway...
30 */
31/*#define nop() __asm__ __volatile__ ("l.nop"::)*/
32
33#endif /* __ASSEMBLY__ */
34#endif /* __KERNEL__ */
35#endif /* __ASM_OPENRISC_SYSTEM_H */
diff --git a/arch/openrisc/kernel/idle.c b/arch/openrisc/kernel/idle.c
index e5fc7887783..7d618feb1b7 100644
--- a/arch/openrisc/kernel/idle.c
+++ b/arch/openrisc/kernel/idle.c
@@ -31,7 +31,6 @@
31 31
32#include <asm/pgtable.h> 32#include <asm/pgtable.h>
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34#include <asm/system.h>
35#include <asm/io.h> 34#include <asm/io.h>
36#include <asm/processor.h> 35#include <asm/processor.h>
37#include <asm/mmu.h> 36#include <asm/mmu.h>
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
index e4209af879e..55210f37d1a 100644
--- a/arch/openrisc/kernel/process.c
+++ b/arch/openrisc/kernel/process.c
@@ -38,7 +38,6 @@
38 38
39#include <asm/uaccess.h> 39#include <asm/uaccess.h>
40#include <asm/pgtable.h> 40#include <asm/pgtable.h>
41#include <asm/system.h>
42#include <asm/io.h> 41#include <asm/io.h>
43#include <asm/processor.h> 42#include <asm/processor.h>
44#include <asm/spr_defs.h> 43#include <asm/spr_defs.h>
diff --git a/arch/openrisc/kernel/prom.c b/arch/openrisc/kernel/prom.c
index 3d4478f6c94..5869e3fa5dd 100644
--- a/arch/openrisc/kernel/prom.c
+++ b/arch/openrisc/kernel/prom.c
@@ -42,7 +42,6 @@
42#include <asm/processor.h> 42#include <asm/processor.h>
43#include <asm/irq.h> 43#include <asm/irq.h>
44#include <linux/io.h> 44#include <linux/io.h>
45#include <asm/system.h>
46#include <asm/mmu.h> 45#include <asm/mmu.h>
47#include <asm/pgtable.h> 46#include <asm/pgtable.h>
48#include <asm/sections.h> 47#include <asm/sections.h>
diff --git a/arch/openrisc/kernel/ptrace.c b/arch/openrisc/kernel/ptrace.c
index 6deacb6b95a..e71781d24b0 100644
--- a/arch/openrisc/kernel/ptrace.c
+++ b/arch/openrisc/kernel/ptrace.c
@@ -33,7 +33,6 @@
33#include <asm/segment.h> 33#include <asm/segment.h>
34#include <asm/page.h> 34#include <asm/page.h>
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/system.h>
37 36
38/* 37/*
39 * Copy the thread state to a regset that can be interpreted by userspace. 38 * Copy the thread state to a regset that can be interpreted by userspace.
diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c
index bf5eba22ce9..f4d5bedc3b4 100644
--- a/arch/openrisc/kernel/setup.c
+++ b/arch/openrisc/kernel/setup.c
@@ -41,7 +41,6 @@
41#include <linux/of_platform.h> 41#include <linux/of_platform.h>
42 42
43#include <asm/segment.h> 43#include <asm/segment.h>
44#include <asm/system.h>
45#include <asm/pgtable.h> 44#include <asm/pgtable.h>
46#include <asm/types.h> 45#include <asm/types.h>
47#include <asm/setup.h> 46#include <asm/setup.h>
diff --git a/arch/openrisc/kernel/traps.c b/arch/openrisc/kernel/traps.c
index a2ee12948f4..5cce396016d 100644
--- a/arch/openrisc/kernel/traps.c
+++ b/arch/openrisc/kernel/traps.c
@@ -33,7 +33,6 @@
33#include <linux/kallsyms.h> 33#include <linux/kallsyms.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35 35
36#include <asm/system.h>
37#include <asm/segment.h> 36#include <asm/segment.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/pgtable.h> 38#include <asm/pgtable.h>
diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
index 736f6b2f30a..79dea9740a3 100644
--- a/arch/openrisc/mm/init.c
+++ b/arch/openrisc/mm/init.c
@@ -33,7 +33,6 @@
33#include <linux/pagemap.h> 33#include <linux/pagemap.h>
34#include <linux/memblock.h> 34#include <linux/memblock.h>
35 35
36#include <asm/system.h>
37#include <asm/segment.h> 36#include <asm/segment.h>
38#include <asm/pgalloc.h> 37#include <asm/pgalloc.h>
39#include <asm/pgtable.h> 38#include <asm/pgtable.h>
diff --git a/arch/openrisc/mm/tlb.c b/arch/openrisc/mm/tlb.c
index 56b0b89624a..683bd4d31c7 100644
--- a/arch/openrisc/mm/tlb.c
+++ b/arch/openrisc/mm/tlb.c
@@ -26,7 +26,6 @@
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/init.h> 27#include <linux/init.h>
28 28
29#include <asm/system.h>
30#include <asm/segment.h> 29#include <asm/segment.h>
31#include <asm/tlbflush.h> 30#include <asm/tlbflush.h>
32#include <asm/pgtable.h> 31#include <asm/pgtable.h>
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h
index 4054b31e0fa..3ae56073cc3 100644
--- a/arch/parisc/include/asm/atomic.h
+++ b/arch/parisc/include/asm/atomic.h
@@ -6,7 +6,6 @@
6#define _ASM_PARISC_ATOMIC_H_ 6#define _ASM_PARISC_ATOMIC_H_
7 7
8#include <linux/types.h> 8#include <linux/types.h>
9#include <asm/system.h>
10 9
11/* 10/*
12 * Atomic operations that C can't guarantee us. Useful for 11 * Atomic operations that C can't guarantee us. Useful for
diff --git a/arch/parisc/include/asm/barrier.h b/arch/parisc/include/asm/barrier.h
new file mode 100644
index 00000000000..e77d834aa80
--- /dev/null
+++ b/arch/parisc/include/asm/barrier.h
@@ -0,0 +1,35 @@
1#ifndef __PARISC_BARRIER_H
2#define __PARISC_BARRIER_H
3
4/*
5** This is simply the barrier() macro from linux/kernel.h but when serial.c
6** uses tqueue.h uses smp_mb() defined using barrier(), linux/kernel.h
7** hasn't yet been included yet so it fails, thus repeating the macro here.
8**
9** PA-RISC architecture allows for weakly ordered memory accesses although
10** none of the processors use it. There is a strong ordered bit that is
11** set in the O-bit of the page directory entry. Operating systems that
12** can not tolerate out of order accesses should set this bit when mapping
13** pages. The O-bit of the PSW should also be set to 1 (I don't believe any
14** of the processor implemented the PSW O-bit). The PCX-W ERS states that
15** the TLB O-bit is not implemented so the page directory does not need to
16** have the O-bit set when mapping pages (section 3.1). This section also
17** states that the PSW Y, Z, G, and O bits are not implemented.
18** So it looks like nothing needs to be done for parisc-linux (yet).
19** (thanks to chada for the above comment -ggg)
20**
21** The __asm__ op below simple prevents gcc/ld from reordering
22** instructions across the mb() "call".
23*/
24#define mb() __asm__ __volatile__("":::"memory") /* barrier() */
25#define rmb() mb()
26#define wmb() mb()
27#define smp_mb() mb()
28#define smp_rmb() mb()
29#define smp_wmb() mb()
30#define smp_read_barrier_depends() do { } while(0)
31#define read_barrier_depends() do { } while(0)
32
33#define set_mb(var, value) do { var = value; mb(); } while (0)
34
35#endif /* __PARISC_BARRIER_H */
diff --git a/arch/parisc/include/asm/delay.h b/arch/parisc/include/asm/delay.h
index 7a75e984674..912ee7e6a57 100644
--- a/arch/parisc/include/asm/delay.h
+++ b/arch/parisc/include/asm/delay.h
@@ -1,7 +1,7 @@
1#ifndef _PARISC_DELAY_H 1#ifndef _PARISC_DELAY_H
2#define _PARISC_DELAY_H 2#define _PARISC_DELAY_H
3 3
4#include <asm/system.h> /* for mfctl() */ 4#include <asm/special_insns.h> /* for mfctl() */
5#include <asm/processor.h> /* for boot_cpu_data */ 5#include <asm/processor.h> /* for boot_cpu_data */
6 6
7 7
diff --git a/arch/parisc/include/asm/dma.h b/arch/parisc/include/asm/dma.h
index f7a18f96870..fd48ae2de95 100644
--- a/arch/parisc/include/asm/dma.h
+++ b/arch/parisc/include/asm/dma.h
@@ -9,7 +9,6 @@
9#define _ASM_DMA_H 9#define _ASM_DMA_H
10 10
11#include <asm/io.h> /* need byte IO */ 11#include <asm/io.h> /* need byte IO */
12#include <asm/system.h>
13 12
14#define dma_outb outb 13#define dma_outb outb
15#define dma_inb inb 14#define dma_inb inb
diff --git a/arch/parisc/include/asm/exec.h b/arch/parisc/include/asm/exec.h
new file mode 100644
index 00000000000..6bb5af75b17
--- /dev/null
+++ b/arch/parisc/include/asm/exec.h
@@ -0,0 +1,6 @@
1#ifndef __PARISC_EXEC_H
2#define __PARISC_EXEC_H
3
4#define arch_align_stack(x) (x)
5
6#endif /* __PARISC_EXEC_H */
diff --git a/arch/parisc/include/asm/ldcw.h b/arch/parisc/include/asm/ldcw.h
new file mode 100644
index 00000000000..d2d11b7055b
--- /dev/null
+++ b/arch/parisc/include/asm/ldcw.h
@@ -0,0 +1,48 @@
1#ifndef __PARISC_LDCW_H
2#define __PARISC_LDCW_H
3
4#ifndef CONFIG_PA20
5/* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data,
6 and GCC only guarantees 8-byte alignment for stack locals, we can't
7 be assured of 16-byte alignment for atomic lock data even if we
8 specify "__attribute ((aligned(16)))" in the type declaration. So,
9 we use a struct containing an array of four ints for the atomic lock
10 type and dynamically select the 16-byte aligned int from the array
11 for the semaphore. */
12
13#define __PA_LDCW_ALIGNMENT 16
14#define __ldcw_align(a) ({ \
15 unsigned long __ret = (unsigned long) &(a)->lock[0]; \
16 __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) \
17 & ~(__PA_LDCW_ALIGNMENT - 1); \
18 (volatile unsigned int *) __ret; \
19})
20#define __LDCW "ldcw"
21
22#else /*CONFIG_PA20*/
23/* From: "Jim Hull" <jim.hull of hp.com>
24 I've attached a summary of the change, but basically, for PA 2.0, as
25 long as the ",CO" (coherent operation) completer is specified, then the
26 16-byte alignment requirement for ldcw and ldcd is relaxed, and instead
27 they only require "natural" alignment (4-byte for ldcw, 8-byte for
28 ldcd). */
29
30#define __PA_LDCW_ALIGNMENT 4
31#define __ldcw_align(a) (&(a)->slock)
32#define __LDCW "ldcw,co"
33
34#endif /*!CONFIG_PA20*/
35
36/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */
37#define __ldcw(a) ({ \
38 unsigned __ret; \
39 __asm__ __volatile__(__LDCW " 0(%2),%0" \
40 : "=r" (__ret), "+m" (*(a)) : "r" (a)); \
41 __ret; \
42})
43
44#ifdef CONFIG_SMP
45# define __lock_aligned __attribute__((__section__(".data..lock_aligned")))
46#endif
47
48#endif /* __PARISC_LDCW_H */
diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h
index 7213ec9e594..acdf4cad612 100644
--- a/arch/parisc/include/asm/processor.h
+++ b/arch/parisc/include/asm/processor.h
@@ -16,7 +16,6 @@
16#include <asm/pdc.h> 16#include <asm/pdc.h>
17#include <asm/ptrace.h> 17#include <asm/ptrace.h>
18#include <asm/types.h> 18#include <asm/types.h>
19#include <asm/system.h>
20#include <asm/percpu.h> 19#include <asm/percpu.h>
21 20
22#endif /* __ASSEMBLY__ */ 21#endif /* __ASSEMBLY__ */
@@ -169,6 +168,7 @@ struct thread_struct {
169 * Return saved PC of a blocked thread. This is used by ps mostly. 168 * Return saved PC of a blocked thread. This is used by ps mostly.
170 */ 169 */
171 170
171struct task_struct;
172unsigned long thread_saved_pc(struct task_struct *t); 172unsigned long thread_saved_pc(struct task_struct *t);
173void show_trace(struct task_struct *task, unsigned long *stack); 173void show_trace(struct task_struct *task, unsigned long *stack);
174 174
diff --git a/arch/parisc/include/asm/psw.h b/arch/parisc/include/asm/psw.h
index 5a3e23c9ce6..ad69a35e9c0 100644
--- a/arch/parisc/include/asm/psw.h
+++ b/arch/parisc/include/asm/psw.h
@@ -59,4 +59,45 @@
59#define USER_PSW_MASK (WIDE_PSW | PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB) 59#define USER_PSW_MASK (WIDE_PSW | PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB)
60#define USER_PSW (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I) 60#define USER_PSW (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I)
61 61
62#ifndef __ASSEMBLY__
63
64/* The program status word as bitfields. */
65struct pa_psw {
66 unsigned int y:1;
67 unsigned int z:1;
68 unsigned int rv:2;
69 unsigned int w:1;
70 unsigned int e:1;
71 unsigned int s:1;
72 unsigned int t:1;
73
74 unsigned int h:1;
75 unsigned int l:1;
76 unsigned int n:1;
77 unsigned int x:1;
78 unsigned int b:1;
79 unsigned int c:1;
80 unsigned int v:1;
81 unsigned int m:1;
82
83 unsigned int cb:8;
84
85 unsigned int o:1;
86 unsigned int g:1;
87 unsigned int f:1;
88 unsigned int r:1;
89 unsigned int q:1;
90 unsigned int p:1;
91 unsigned int d:1;
92 unsigned int i:1;
93};
94
95#ifdef CONFIG_64BIT
96#define pa_psw(task) ((struct pa_psw *) ((char *) (task) + TASK_PT_PSW + 4))
97#else
98#define pa_psw(task) ((struct pa_psw *) ((char *) (task) + TASK_PT_PSW))
99#endif
100
101#endif /* !__ASSEMBLY__ */
102
62#endif 103#endif
diff --git a/arch/parisc/include/asm/special_insns.h b/arch/parisc/include/asm/special_insns.h
new file mode 100644
index 00000000000..d306b75bc77
--- /dev/null
+++ b/arch/parisc/include/asm/special_insns.h
@@ -0,0 +1,40 @@
1#ifndef __PARISC_SPECIAL_INSNS_H
2#define __PARISC_SPECIAL_INSNS_H
3
4#define mfctl(reg) ({ \
5 unsigned long cr; \
6 __asm__ __volatile__( \
7 "mfctl " #reg ",%0" : \
8 "=r" (cr) \
9 ); \
10 cr; \
11})
12
13#define mtctl(gr, cr) \
14 __asm__ __volatile__("mtctl %0,%1" \
15 : /* no outputs */ \
16 : "r" (gr), "i" (cr) : "memory")
17
18/* these are here to de-mystefy the calling code, and to provide hooks */
19/* which I needed for debugging EIEM problems -PB */
20#define get_eiem() mfctl(15)
21static inline void set_eiem(unsigned long val)
22{
23 mtctl(val, 15);
24}
25
26#define mfsp(reg) ({ \
27 unsigned long cr; \
28 __asm__ __volatile__( \
29 "mfsp " #reg ",%0" : \
30 "=r" (cr) \
31 ); \
32 cr; \
33})
34
35#define mtsp(gr, cr) \
36 __asm__ __volatile__("mtsp %0,%1" \
37 : /* no outputs */ \
38 : "r" (gr), "i" (cr) : "memory")
39
40#endif /* __PARISC_SPECIAL_INSNS_H */
diff --git a/arch/parisc/include/asm/spinlock.h b/arch/parisc/include/asm/spinlock.h
index 74036f436a3..804aa28ab1d 100644
--- a/arch/parisc/include/asm/spinlock.h
+++ b/arch/parisc/include/asm/spinlock.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SPINLOCK_H 1#ifndef __ASM_SPINLOCK_H
2#define __ASM_SPINLOCK_H 2#define __ASM_SPINLOCK_H
3 3
4#include <asm/system.h>
5#include <asm/processor.h> 4#include <asm/processor.h>
6#include <asm/spinlock_types.h> 5#include <asm/spinlock_types.h>
7 6
diff --git a/arch/parisc/include/asm/switch_to.h b/arch/parisc/include/asm/switch_to.h
new file mode 100644
index 00000000000..8ed8fea1e78
--- /dev/null
+++ b/arch/parisc/include/asm/switch_to.h
@@ -0,0 +1,12 @@
1#ifndef __PARISC_SWITCH_TO_H
2#define __PARISC_SWITCH_TO_H
3
4struct task_struct;
5
6extern struct task_struct *_switch_to(struct task_struct *, struct task_struct *);
7
8#define switch_to(prev, next, last) do { \
9 (last) = _switch_to(prev, next); \
10} while(0)
11
12#endif /* __PARISC_SWITCH_TO_H */
diff --git a/arch/parisc/include/asm/system.h b/arch/parisc/include/asm/system.h
deleted file mode 100644
index b19e63a8e84..00000000000
--- a/arch/parisc/include/asm/system.h
+++ /dev/null
@@ -1,165 +0,0 @@
1#ifndef __PARISC_SYSTEM_H
2#define __PARISC_SYSTEM_H
3
4#include <linux/irqflags.h>
5
6/* The program status word as bitfields. */
7struct pa_psw {
8 unsigned int y:1;
9 unsigned int z:1;
10 unsigned int rv:2;
11 unsigned int w:1;
12 unsigned int e:1;
13 unsigned int s:1;
14 unsigned int t:1;
15
16 unsigned int h:1;
17 unsigned int l:1;
18 unsigned int n:1;
19 unsigned int x:1;
20 unsigned int b:1;
21 unsigned int c:1;
22 unsigned int v:1;
23 unsigned int m:1;
24
25 unsigned int cb:8;
26
27 unsigned int o:1;
28 unsigned int g:1;
29 unsigned int f:1;
30 unsigned int r:1;
31 unsigned int q:1;
32 unsigned int p:1;
33 unsigned int d:1;
34 unsigned int i:1;
35};
36
37#ifdef CONFIG_64BIT
38#define pa_psw(task) ((struct pa_psw *) ((char *) (task) + TASK_PT_PSW + 4))
39#else
40#define pa_psw(task) ((struct pa_psw *) ((char *) (task) + TASK_PT_PSW))
41#endif
42
43struct task_struct;
44
45extern struct task_struct *_switch_to(struct task_struct *, struct task_struct *);
46
47#define switch_to(prev, next, last) do { \
48 (last) = _switch_to(prev, next); \
49} while(0)
50
51#define mfctl(reg) ({ \
52 unsigned long cr; \
53 __asm__ __volatile__( \
54 "mfctl " #reg ",%0" : \
55 "=r" (cr) \
56 ); \
57 cr; \
58})
59
60#define mtctl(gr, cr) \
61 __asm__ __volatile__("mtctl %0,%1" \
62 : /* no outputs */ \
63 : "r" (gr), "i" (cr) : "memory")
64
65/* these are here to de-mystefy the calling code, and to provide hooks */
66/* which I needed for debugging EIEM problems -PB */
67#define get_eiem() mfctl(15)
68static inline void set_eiem(unsigned long val)
69{
70 mtctl(val, 15);
71}
72
73#define mfsp(reg) ({ \
74 unsigned long cr; \
75 __asm__ __volatile__( \
76 "mfsp " #reg ",%0" : \
77 "=r" (cr) \
78 ); \
79 cr; \
80})
81
82#define mtsp(gr, cr) \
83 __asm__ __volatile__("mtsp %0,%1" \
84 : /* no outputs */ \
85 : "r" (gr), "i" (cr) : "memory")
86
87
88/*
89** This is simply the barrier() macro from linux/kernel.h but when serial.c
90** uses tqueue.h uses smp_mb() defined using barrier(), linux/kernel.h
91** hasn't yet been included yet so it fails, thus repeating the macro here.
92**
93** PA-RISC architecture allows for weakly ordered memory accesses although
94** none of the processors use it. There is a strong ordered bit that is
95** set in the O-bit of the page directory entry. Operating systems that
96** can not tolerate out of order accesses should set this bit when mapping
97** pages. The O-bit of the PSW should also be set to 1 (I don't believe any
98** of the processor implemented the PSW O-bit). The PCX-W ERS states that
99** the TLB O-bit is not implemented so the page directory does not need to
100** have the O-bit set when mapping pages (section 3.1). This section also
101** states that the PSW Y, Z, G, and O bits are not implemented.
102** So it looks like nothing needs to be done for parisc-linux (yet).
103** (thanks to chada for the above comment -ggg)
104**
105** The __asm__ op below simple prevents gcc/ld from reordering
106** instructions across the mb() "call".
107*/
108#define mb() __asm__ __volatile__("":::"memory") /* barrier() */
109#define rmb() mb()
110#define wmb() mb()
111#define smp_mb() mb()
112#define smp_rmb() mb()
113#define smp_wmb() mb()
114#define smp_read_barrier_depends() do { } while(0)
115#define read_barrier_depends() do { } while(0)
116
117#define set_mb(var, value) do { var = value; mb(); } while (0)
118
119#ifndef CONFIG_PA20
120/* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data,
121 and GCC only guarantees 8-byte alignment for stack locals, we can't
122 be assured of 16-byte alignment for atomic lock data even if we
123 specify "__attribute ((aligned(16)))" in the type declaration. So,
124 we use a struct containing an array of four ints for the atomic lock
125 type and dynamically select the 16-byte aligned int from the array
126 for the semaphore. */
127
128#define __PA_LDCW_ALIGNMENT 16
129#define __ldcw_align(a) ({ \
130 unsigned long __ret = (unsigned long) &(a)->lock[0]; \
131 __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) \
132 & ~(__PA_LDCW_ALIGNMENT - 1); \
133 (volatile unsigned int *) __ret; \
134})
135#define __LDCW "ldcw"
136
137#else /*CONFIG_PA20*/
138/* From: "Jim Hull" <jim.hull of hp.com>
139 I've attached a summary of the change, but basically, for PA 2.0, as
140 long as the ",CO" (coherent operation) completer is specified, then the
141 16-byte alignment requirement for ldcw and ldcd is relaxed, and instead
142 they only require "natural" alignment (4-byte for ldcw, 8-byte for
143 ldcd). */
144
145#define __PA_LDCW_ALIGNMENT 4
146#define __ldcw_align(a) (&(a)->slock)
147#define __LDCW "ldcw,co"
148
149#endif /*!CONFIG_PA20*/
150
151/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */
152#define __ldcw(a) ({ \
153 unsigned __ret; \
154 __asm__ __volatile__(__LDCW " 0(%2),%0" \
155 : "=r" (__ret), "+m" (*(a)) : "r" (a)); \
156 __ret; \
157})
158
159#ifdef CONFIG_SMP
160# define __lock_aligned __attribute__((__section__(".data..lock_aligned")))
161#endif
162
163#define arch_align_stack(x) (x)
164
165#endif
diff --git a/arch/parisc/include/asm/thread_info.h b/arch/parisc/include/asm/thread_info.h
index 6d9c7c7973d..83ae7dd4d99 100644
--- a/arch/parisc/include/asm/thread_info.h
+++ b/arch/parisc/include/asm/thread_info.h
@@ -5,6 +5,7 @@
5 5
6#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
7#include <asm/processor.h> 7#include <asm/processor.h>
8#include <asm/special_insns.h>
8 9
9struct thread_info { 10struct thread_info {
10 struct task_struct *task; /* main task structure */ 11 struct task_struct *task; /* main task structure */
diff --git a/arch/parisc/include/asm/timex.h b/arch/parisc/include/asm/timex.h
index 3b68d77273d..2bd51f6d832 100644
--- a/arch/parisc/include/asm/timex.h
+++ b/arch/parisc/include/asm/timex.h
@@ -6,7 +6,6 @@
6#ifndef _ASMPARISC_TIMEX_H 6#ifndef _ASMPARISC_TIMEX_H
7#define _ASMPARISC_TIMEX_H 7#define _ASMPARISC_TIMEX_H
8 8
9#include <asm/system.h>
10 9
11#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ 10#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
12 11
diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h
index ff4cf9dab8d..9ac066086f0 100644
--- a/arch/parisc/include/asm/uaccess.h
+++ b/arch/parisc/include/asm/uaccess.h
@@ -5,7 +5,6 @@
5 * User space memory access functions 5 * User space memory access functions
6 */ 6 */
7#include <asm/page.h> 7#include <asm/page.h>
8#include <asm/system.h>
9#include <asm/cache.h> 8#include <asm/cache.h>
10#include <asm/errno.h> 9#include <asm/errno.h>
11#include <asm-generic/uaccess-unaligned.h> 10#include <asm-generic/uaccess-unaligned.h>
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 83335f3da5f..9d181890a7e 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -22,7 +22,6 @@
22#include <asm/cache.h> 22#include <asm/cache.h>
23#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
24#include <asm/tlbflush.h> 24#include <asm/tlbflush.h>
25#include <asm/system.h>
26#include <asm/page.h> 25#include <asm/page.h>
27#include <asm/pgalloc.h> 26#include <asm/pgalloc.h>
28#include <asm/processor.h> 27#include <asm/processor.h>
diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
index 4896ed09058..f65fa480c90 100644
--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -67,7 +67,6 @@
67#include <asm/page.h> 67#include <asm/page.h>
68#include <asm/pdc.h> 68#include <asm/pdc.h>
69#include <asm/pdcpat.h> 69#include <asm/pdcpat.h>
70#include <asm/system.h>
71#include <asm/processor.h> /* for boot_cpu_data */ 70#include <asm/processor.h> /* for boot_cpu_data */
72 71
73static DEFINE_SPINLOCK(pdc_lock); 72static DEFINE_SPINLOCK(pdc_lock);
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index 74d544b1cd2..24644aca10c 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -16,7 +16,6 @@
16#include <linux/types.h> 16#include <linux/types.h>
17 17
18#include <asm/io.h> 18#include <asm/io.h>
19#include <asm/system.h>
20#include <asm/superio.h> 19#include <asm/superio.h>
21 20
22#define DEBUG_RESOURCES 0 21#define DEBUG_RESOURCES 0
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
index 2905b1f52d3..857c2f54547 100644
--- a/arch/parisc/kernel/ptrace.c
+++ b/arch/parisc/kernel/ptrace.c
@@ -22,7 +22,6 @@
22 22
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <asm/pgtable.h> 24#include <asm/pgtable.h>
25#include <asm/system.h>
26#include <asm/processor.h> 25#include <asm/processor.h>
27#include <asm/asm-offsets.h> 26#include <asm/asm-offsets.h>
28 27
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 32d588488f0..5006e8ea305 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -32,7 +32,6 @@
32#include <linux/bitops.h> 32#include <linux/bitops.h>
33#include <linux/ftrace.h> 33#include <linux/ftrace.h>
34 34
35#include <asm/system.h>
36#include <linux/atomic.h> 35#include <linux/atomic.h>
37#include <asm/current.h> 36#include <asm/current.h>
38#include <asm/delay.h> 37#include <asm/delay.h>
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index f19e6604026..45ba99f5080 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -27,7 +27,6 @@
27#include <linux/bug.h> 27#include <linux/bug.h>
28 28
29#include <asm/assembly.h> 29#include <asm/assembly.h>
30#include <asm/system.h>
31#include <asm/uaccess.h> 30#include <asm/uaccess.h>
32#include <asm/io.h> 31#include <asm/io.h>
33#include <asm/irq.h> 32#include <asm/irq.h>
diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c
index a8bffd8af77..187118841af 100644
--- a/arch/parisc/lib/bitops.c
+++ b/arch/parisc/lib/bitops.c
@@ -8,7 +8,6 @@
8 8
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/spinlock.h> 10#include <linux/spinlock.h>
11#include <asm/system.h>
12#include <linux/atomic.h> 11#include <linux/atomic.h>
13 12
14#ifdef CONFIG_SMP 13#ifdef CONFIG_SMP
diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h
index 14174e838ad..da29032ae38 100644
--- a/arch/powerpc/include/asm/atomic.h
+++ b/arch/powerpc/include/asm/atomic.h
@@ -5,13 +5,9 @@
5 * PowerPC atomic operations 5 * PowerPC atomic operations
6 */ 6 */
7 7
8#include <linux/types.h>
9
10#ifdef __KERNEL__ 8#ifdef __KERNEL__
11#include <linux/compiler.h> 9#include <linux/types.h>
12#include <asm/synch.h> 10#include <asm/cmpxchg.h>
13#include <asm/asm-compat.h>
14#include <asm/system.h>
15 11
16#define ATOMIC_INIT(i) { (i) } 12#define ATOMIC_INIT(i) { (i) }
17 13
diff --git a/arch/powerpc/include/asm/auxvec.h b/arch/powerpc/include/asm/auxvec.h
index 19a099b62cd..ce17d2c9eb4 100644
--- a/arch/powerpc/include/asm/auxvec.h
+++ b/arch/powerpc/include/asm/auxvec.h
@@ -16,4 +16,6 @@
16 */ 16 */
17#define AT_SYSINFO_EHDR 33 17#define AT_SYSINFO_EHDR 33
18 18
19#define AT_VECTOR_SIZE_ARCH 6 /* entries in ARCH_DLINFO */
20
19#endif 21#endif
diff --git a/arch/powerpc/include/asm/barrier.h b/arch/powerpc/include/asm/barrier.h
new file mode 100644
index 00000000000..ae782254e73
--- /dev/null
+++ b/arch/powerpc/include/asm/barrier.h
@@ -0,0 +1,68 @@
1/*
2 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
3 */
4#ifndef _ASM_POWERPC_BARRIER_H
5#define _ASM_POWERPC_BARRIER_H
6
7/*
8 * Memory barrier.
9 * The sync instruction guarantees that all memory accesses initiated
10 * by this processor have been performed (with respect to all other
11 * mechanisms that access memory). The eieio instruction is a barrier
12 * providing an ordering (separately) for (a) cacheable stores and (b)
13 * loads and stores to non-cacheable memory (e.g. I/O devices).
14 *
15 * mb() prevents loads and stores being reordered across this point.
16 * rmb() prevents loads being reordered across this point.
17 * wmb() prevents stores being reordered across this point.
18 * read_barrier_depends() prevents data-dependent loads being reordered
19 * across this point (nop on PPC).
20 *
21 * *mb() variants without smp_ prefix must order all types of memory
22 * operations with one another. sync is the only instruction sufficient
23 * to do this.
24 *
25 * For the smp_ barriers, ordering is for cacheable memory operations
26 * only. We have to use the sync instruction for smp_mb(), since lwsync
27 * doesn't order loads with respect to previous stores. Lwsync can be
28 * used for smp_rmb() and smp_wmb().
29 *
30 * However, on CPUs that don't support lwsync, lwsync actually maps to a
31 * heavy-weight sync, so smp_wmb() can be a lighter-weight eieio.
32 */
33#define mb() __asm__ __volatile__ ("sync" : : : "memory")
34#define rmb() __asm__ __volatile__ ("sync" : : : "memory")
35#define wmb() __asm__ __volatile__ ("sync" : : : "memory")
36#define read_barrier_depends() do { } while(0)
37
38#define set_mb(var, value) do { var = value; mb(); } while (0)
39
40#ifdef CONFIG_SMP
41
42#ifdef __SUBARCH_HAS_LWSYNC
43# define SMPWMB LWSYNC
44#else
45# define SMPWMB eieio
46#endif
47
48#define smp_mb() mb()
49#define smp_rmb() __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
50#define smp_wmb() __asm__ __volatile__ (stringify_in_c(SMPWMB) : : :"memory")
51#define smp_read_barrier_depends() read_barrier_depends()
52#else
53#define smp_mb() barrier()
54#define smp_rmb() barrier()
55#define smp_wmb() barrier()
56#define smp_read_barrier_depends() do { } while(0)
57#endif /* CONFIG_SMP */
58
59/*
60 * This is a barrier which prevents following instructions from being
61 * started until the value of the argument x is known. For example, if
62 * x is a variable loaded from memory, this prevents following
63 * instructions from being executed until the load has been performed.
64 */
65#define data_barrier(x) \
66 asm volatile("twi 0,%0,0; isync" : : "r" (x) : "memory");
67
68#endif /* _ASM_POWERPC_BARRIER_H */
diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h
index 065c590c991..3eb53d74107 100644
--- a/arch/powerpc/include/asm/bug.h
+++ b/arch/powerpc/include/asm/bug.h
@@ -126,5 +126,16 @@
126 126
127#include <asm-generic/bug.h> 127#include <asm-generic/bug.h>
128 128
129#ifndef __ASSEMBLY__
130
131struct pt_regs;
132extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long);
133extern void bad_page_fault(struct pt_regs *, unsigned long, int);
134extern void _exception(int, struct pt_regs *, int, unsigned long);
135extern void die(const char *, struct pt_regs *, long);
136extern void print_backtrace(unsigned long *);
137
138#endif /* !__ASSEMBLY__ */
139
129#endif /* __KERNEL__ */ 140#endif /* __KERNEL__ */
130#endif /* _ASM_POWERPC_BUG_H */ 141#endif /* _ASM_POWERPC_BUG_H */
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h
index 4b509411ad8..9e495c9a6a8 100644
--- a/arch/powerpc/include/asm/cache.h
+++ b/arch/powerpc/include/asm/cache.h
@@ -42,8 +42,24 @@ extern struct ppc64_caches ppc64_caches;
42#endif /* __powerpc64__ && ! __ASSEMBLY__ */ 42#endif /* __powerpc64__ && ! __ASSEMBLY__ */
43 43
44#if !defined(__ASSEMBLY__) 44#if !defined(__ASSEMBLY__)
45
45#define __read_mostly __attribute__((__section__(".data..read_mostly"))) 46#define __read_mostly __attribute__((__section__(".data..read_mostly")))
47
48#ifdef CONFIG_6xx
49extern long _get_L2CR(void);
50extern long _get_L3CR(void);
51extern void _set_L2CR(unsigned long);
52extern void _set_L3CR(unsigned long);
53#else
54#define _get_L2CR() 0L
55#define _get_L3CR() 0L
56#define _set_L2CR(val) do { } while(0)
57#define _set_L3CR(val) do { } while(0)
46#endif 58#endif
47 59
60extern void cacheable_memzero(void *p, unsigned int nb);
61extern void *cacheable_memcpy(void *, const void *, unsigned int);
62
63#endif /* !__ASSEMBLY__ */
48#endif /* __KERNEL__ */ 64#endif /* __KERNEL__ */
49#endif /* _ASM_POWERPC_CACHE_H */ 65#endif /* _ASM_POWERPC_CACHE_H */
diff --git a/arch/powerpc/include/asm/cmpxchg.h b/arch/powerpc/include/asm/cmpxchg.h
new file mode 100644
index 00000000000..e245aab7f19
--- /dev/null
+++ b/arch/powerpc/include/asm/cmpxchg.h
@@ -0,0 +1,309 @@
1#ifndef _ASM_POWERPC_CMPXCHG_H_
2#define _ASM_POWERPC_CMPXCHG_H_
3
4#ifdef __KERNEL__
5#include <linux/compiler.h>
6#include <asm/synch.h>
7#include <asm/asm-compat.h>
8
9/*
10 * Atomic exchange
11 *
12 * Changes the memory location '*ptr' to be val and returns
13 * the previous value stored there.
14 */
15static __always_inline unsigned long
16__xchg_u32(volatile void *p, unsigned long val)
17{
18 unsigned long prev;
19
20 __asm__ __volatile__(
21 PPC_RELEASE_BARRIER
22"1: lwarx %0,0,%2 \n"
23 PPC405_ERR77(0,%2)
24" stwcx. %3,0,%2 \n\
25 bne- 1b"
26 PPC_ACQUIRE_BARRIER
27 : "=&r" (prev), "+m" (*(volatile unsigned int *)p)
28 : "r" (p), "r" (val)
29 : "cc", "memory");
30
31 return prev;
32}
33
34/*
35 * Atomic exchange
36 *
37 * Changes the memory location '*ptr' to be val and returns
38 * the previous value stored there.
39 */
40static __always_inline unsigned long
41__xchg_u32_local(volatile void *p, unsigned long val)
42{
43 unsigned long prev;
44
45 __asm__ __volatile__(
46"1: lwarx %0,0,%2 \n"
47 PPC405_ERR77(0,%2)
48" stwcx. %3,0,%2 \n\
49 bne- 1b"
50 : "=&r" (prev), "+m" (*(volatile unsigned int *)p)
51 : "r" (p), "r" (val)
52 : "cc", "memory");
53
54 return prev;
55}
56
57#ifdef CONFIG_PPC64
58static __always_inline unsigned long
59__xchg_u64(volatile void *p, unsigned long val)
60{
61 unsigned long prev;
62
63 __asm__ __volatile__(
64 PPC_RELEASE_BARRIER
65"1: ldarx %0,0,%2 \n"
66 PPC405_ERR77(0,%2)
67" stdcx. %3,0,%2 \n\
68 bne- 1b"
69 PPC_ACQUIRE_BARRIER
70 : "=&r" (prev), "+m" (*(volatile unsigned long *)p)
71 : "r" (p), "r" (val)
72 : "cc", "memory");
73
74 return prev;
75}
76
77static __always_inline unsigned long
78__xchg_u64_local(volatile void *p, unsigned long val)
79{
80 unsigned long prev;
81
82 __asm__ __volatile__(
83"1: ldarx %0,0,%2 \n"
84 PPC405_ERR77(0,%2)
85" stdcx. %3,0,%2 \n\
86 bne- 1b"
87 : "=&r" (prev), "+m" (*(volatile unsigned long *)p)
88 : "r" (p), "r" (val)
89 : "cc", "memory");
90
91 return prev;
92}
93#endif
94
95/*
96 * This function doesn't exist, so you'll get a linker error
97 * if something tries to do an invalid xchg().
98 */
99extern void __xchg_called_with_bad_pointer(void);
100
101static __always_inline unsigned long
102__xchg(volatile void *ptr, unsigned long x, unsigned int size)
103{
104 switch (size) {
105 case 4:
106 return __xchg_u32(ptr, x);
107#ifdef CONFIG_PPC64
108 case 8:
109 return __xchg_u64(ptr, x);
110#endif
111 }
112 __xchg_called_with_bad_pointer();
113 return x;
114}
115
116static __always_inline unsigned long
117__xchg_local(volatile void *ptr, unsigned long x, unsigned int size)
118{
119 switch (size) {
120 case 4:
121 return __xchg_u32_local(ptr, x);
122#ifdef CONFIG_PPC64
123 case 8:
124 return __xchg_u64_local(ptr, x);
125#endif
126 }
127 __xchg_called_with_bad_pointer();
128 return x;
129}
130#define xchg(ptr,x) \
131 ({ \
132 __typeof__(*(ptr)) _x_ = (x); \
133 (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(*(ptr))); \
134 })
135
136#define xchg_local(ptr,x) \
137 ({ \
138 __typeof__(*(ptr)) _x_ = (x); \
139 (__typeof__(*(ptr))) __xchg_local((ptr), \
140 (unsigned long)_x_, sizeof(*(ptr))); \
141 })
142
143/*
144 * Compare and exchange - if *p == old, set it to new,
145 * and return the old value of *p.
146 */
147#define __HAVE_ARCH_CMPXCHG 1
148
149static __always_inline unsigned long
150__cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
151{
152 unsigned int prev;
153
154 __asm__ __volatile__ (
155 PPC_RELEASE_BARRIER
156"1: lwarx %0,0,%2 # __cmpxchg_u32\n\
157 cmpw 0,%0,%3\n\
158 bne- 2f\n"
159 PPC405_ERR77(0,%2)
160" stwcx. %4,0,%2\n\
161 bne- 1b"
162 PPC_ACQUIRE_BARRIER
163 "\n\
1642:"
165 : "=&r" (prev), "+m" (*p)
166 : "r" (p), "r" (old), "r" (new)
167 : "cc", "memory");
168
169 return prev;
170}
171
172static __always_inline unsigned long
173__cmpxchg_u32_local(volatile unsigned int *p, unsigned long old,
174 unsigned long new)
175{
176 unsigned int prev;
177
178 __asm__ __volatile__ (
179"1: lwarx %0,0,%2 # __cmpxchg_u32\n\
180 cmpw 0,%0,%3\n\
181 bne- 2f\n"
182 PPC405_ERR77(0,%2)
183" stwcx. %4,0,%2\n\
184 bne- 1b"
185 "\n\
1862:"
187 : "=&r" (prev), "+m" (*p)
188 : "r" (p), "r" (old), "r" (new)
189 : "cc", "memory");
190
191 return prev;
192}
193
194#ifdef CONFIG_PPC64
195static __always_inline unsigned long
196__cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
197{
198 unsigned long prev;
199
200 __asm__ __volatile__ (
201 PPC_RELEASE_BARRIER
202"1: ldarx %0,0,%2 # __cmpxchg_u64\n\
203 cmpd 0,%0,%3\n\
204 bne- 2f\n\
205 stdcx. %4,0,%2\n\
206 bne- 1b"
207 PPC_ACQUIRE_BARRIER
208 "\n\
2092:"
210 : "=&r" (prev), "+m" (*p)
211 : "r" (p), "r" (old), "r" (new)
212 : "cc", "memory");
213
214 return prev;
215}
216
217static __always_inline unsigned long
218__cmpxchg_u64_local(volatile unsigned long *p, unsigned long old,
219 unsigned long new)
220{
221 unsigned long prev;
222
223 __asm__ __volatile__ (
224"1: ldarx %0,0,%2 # __cmpxchg_u64\n\
225 cmpd 0,%0,%3\n\
226 bne- 2f\n\
227 stdcx. %4,0,%2\n\
228 bne- 1b"
229 "\n\
2302:"
231 : "=&r" (prev), "+m" (*p)
232 : "r" (p), "r" (old), "r" (new)
233 : "cc", "memory");
234
235 return prev;
236}
237#endif
238
239/* This function doesn't exist, so you'll get a linker error
240 if something tries to do an invalid cmpxchg(). */
241extern void __cmpxchg_called_with_bad_pointer(void);
242
243static __always_inline unsigned long
244__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
245 unsigned int size)
246{
247 switch (size) {
248 case 4:
249 return __cmpxchg_u32(ptr, old, new);
250#ifdef CONFIG_PPC64
251 case 8:
252 return __cmpxchg_u64(ptr, old, new);
253#endif
254 }
255 __cmpxchg_called_with_bad_pointer();
256 return old;
257}
258
259static __always_inline unsigned long
260__cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
261 unsigned int size)
262{
263 switch (size) {
264 case 4:
265 return __cmpxchg_u32_local(ptr, old, new);
266#ifdef CONFIG_PPC64
267 case 8:
268 return __cmpxchg_u64_local(ptr, old, new);
269#endif
270 }
271 __cmpxchg_called_with_bad_pointer();
272 return old;
273}
274
275#define cmpxchg(ptr, o, n) \
276 ({ \
277 __typeof__(*(ptr)) _o_ = (o); \
278 __typeof__(*(ptr)) _n_ = (n); \
279 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
280 (unsigned long)_n_, sizeof(*(ptr))); \
281 })
282
283
284#define cmpxchg_local(ptr, o, n) \
285 ({ \
286 __typeof__(*(ptr)) _o_ = (o); \
287 __typeof__(*(ptr)) _n_ = (n); \
288 (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \
289 (unsigned long)_n_, sizeof(*(ptr))); \
290 })
291
292#ifdef CONFIG_PPC64
293#define cmpxchg64(ptr, o, n) \
294 ({ \
295 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
296 cmpxchg((ptr), (o), (n)); \
297 })
298#define cmpxchg64_local(ptr, o, n) \
299 ({ \
300 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
301 cmpxchg_local((ptr), (o), (n)); \
302 })
303#else
304#include <asm-generic/cmpxchg-local.h>
305#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
306#endif
307
308#endif /* __KERNEL__ */
309#endif /* _ASM_POWERPC_CMPXCHG_H_ */
diff --git a/arch/powerpc/include/asm/debug.h b/arch/powerpc/include/asm/debug.h
new file mode 100644
index 00000000000..716d2f089eb
--- /dev/null
+++ b/arch/powerpc/include/asm/debug.h
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
3 */
4#ifndef _ASM_POWERPC_DEBUG_H
5#define _ASM_POWERPC_DEBUG_H
6
7struct pt_regs;
8
9extern struct dentry *powerpc_debugfs_root;
10
11#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
12
13extern int (*__debugger)(struct pt_regs *regs);
14extern int (*__debugger_ipi)(struct pt_regs *regs);
15extern int (*__debugger_bpt)(struct pt_regs *regs);
16extern int (*__debugger_sstep)(struct pt_regs *regs);
17extern int (*__debugger_iabr_match)(struct pt_regs *regs);
18extern int (*__debugger_dabr_match)(struct pt_regs *regs);
19extern int (*__debugger_fault_handler)(struct pt_regs *regs);
20
21#define DEBUGGER_BOILERPLATE(__NAME) \
22static inline int __NAME(struct pt_regs *regs) \
23{ \
24 if (unlikely(__ ## __NAME)) \
25 return __ ## __NAME(regs); \
26 return 0; \
27}
28
29DEBUGGER_BOILERPLATE(debugger)
30DEBUGGER_BOILERPLATE(debugger_ipi)
31DEBUGGER_BOILERPLATE(debugger_bpt)
32DEBUGGER_BOILERPLATE(debugger_sstep)
33DEBUGGER_BOILERPLATE(debugger_iabr_match)
34DEBUGGER_BOILERPLATE(debugger_dabr_match)
35DEBUGGER_BOILERPLATE(debugger_fault_handler)
36
37#else
38static inline int debugger(struct pt_regs *regs) { return 0; }
39static inline int debugger_ipi(struct pt_regs *regs) { return 0; }
40static inline int debugger_bpt(struct pt_regs *regs) { return 0; }
41static inline int debugger_sstep(struct pt_regs *regs) { return 0; }
42static inline int debugger_iabr_match(struct pt_regs *regs) { return 0; }
43static inline int debugger_dabr_match(struct pt_regs *regs) { return 0; }
44static inline int debugger_fault_handler(struct pt_regs *regs) { return 0; }
45#endif
46
47extern int set_dabr(unsigned long dabr);
48#ifdef CONFIG_PPC_ADV_DEBUG_REGS
49extern void do_send_trap(struct pt_regs *regs, unsigned long address,
50 unsigned long error_code, int signal_code, int brkpt);
51#else
52extern void do_dabr(struct pt_regs *regs, unsigned long address,
53 unsigned long error_code);
54#endif
55
56#endif /* _ASM_POWERPC_DEBUG_H */
diff --git a/arch/powerpc/include/asm/dma.h b/arch/powerpc/include/asm/dma.h
index adadb994361..f6813e919bb 100644
--- a/arch/powerpc/include/asm/dma.h
+++ b/arch/powerpc/include/asm/dma.h
@@ -24,7 +24,6 @@
24 24
25#include <asm/io.h> 25#include <asm/io.h>
26#include <linux/spinlock.h> 26#include <linux/spinlock.h>
27#include <asm/system.h>
28 27
29#ifndef MAX_DMA_CHANNELS 28#ifndef MAX_DMA_CHANNELS
30#define MAX_DMA_CHANNELS 8 29#define MAX_DMA_CHANNELS 8
diff --git a/arch/powerpc/include/asm/exec.h b/arch/powerpc/include/asm/exec.h
new file mode 100644
index 00000000000..8196e9c7d7e
--- /dev/null
+++ b/arch/powerpc/include/asm/exec.h
@@ -0,0 +1,9 @@
1/*
2 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
3 */
4#ifndef _ASM_POWERPC_EXEC_H
5#define _ASM_POWERPC_EXEC_H
6
7extern unsigned long arch_align_stack(unsigned long sp);
8
9#endif /* _ASM_POWERPC_EXEC_H */
diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch/powerpc/include/asm/hw_breakpoint.h
index 80fd4d2b4a6..be04330af75 100644
--- a/arch/powerpc/include/asm/hw_breakpoint.h
+++ b/arch/powerpc/include/asm/hw_breakpoint.h
@@ -35,7 +35,7 @@ struct arch_hw_breakpoint {
35 35
36#include <linux/kdebug.h> 36#include <linux/kdebug.h>
37#include <asm/reg.h> 37#include <asm/reg.h>
38#include <asm/system.h> 38#include <asm/debug.h>
39 39
40struct perf_event; 40struct perf_event;
41struct pmu; 41struct pmu;
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index b585bff1a02..8e2d0371fe1 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -385,6 +385,36 @@ static inline unsigned long get_clean_sp(struct pt_regs *regs, int is_32)
385extern unsigned long cpuidle_disable; 385extern unsigned long cpuidle_disable;
386enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF}; 386enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF};
387 387
388extern int powersave_nap; /* set if nap mode can be used in idle loop */
389void cpu_idle_wait(void);
390
391#ifdef CONFIG_PSERIES_IDLE
392extern void update_smt_snooze_delay(int snooze);
393extern int pseries_notify_cpuidle_add_cpu(int cpu);
394#else
395static inline void update_smt_snooze_delay(int snooze) {}
396static inline int pseries_notify_cpuidle_add_cpu(int cpu) { return 0; }
397#endif
398
399extern void flush_instruction_cache(void);
400extern void hard_reset_now(void);
401extern void poweroff_now(void);
402extern int fix_alignment(struct pt_regs *);
403extern void cvt_fd(float *from, double *to);
404extern void cvt_df(double *from, float *to);
405extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
406
407#ifdef CONFIG_PPC64
408/*
409 * We handle most unaligned accesses in hardware. On the other hand
410 * unaligned DMA can be very expensive on some ppc64 IO chips (it does
411 * powers of 2 writes until it reaches sufficient alignment).
412 *
413 * Based on this we disable the IP header alignment in network drivers.
414 */
415#define NET_IP_ALIGN 0
416#endif
417
388#endif /* __KERNEL__ */ 418#endif /* __KERNEL__ */
389#endif /* __ASSEMBLY__ */ 419#endif /* __ASSEMBLY__ */
390#endif /* _ASM_POWERPC_PROCESSOR_H */ 420#endif /* _ASM_POWERPC_PROCESSOR_H */
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h
index 8a97aa7289d..b86faa9107d 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -15,6 +15,11 @@
15#ifndef __ASM_POWERPC_REG_BOOKE_H__ 15#ifndef __ASM_POWERPC_REG_BOOKE_H__
16#define __ASM_POWERPC_REG_BOOKE_H__ 16#define __ASM_POWERPC_REG_BOOKE_H__
17 17
18#ifdef CONFIG_BOOKE_WDT
19extern u32 booke_wdt_enabled;
20extern u32 booke_wdt_period;
21#endif /* CONFIG_BOOKE_WDT */
22
18/* Machine State Register (MSR) Fields */ 23/* Machine State Register (MSR) Fields */
19#define MSR_GS (1<<28) /* Guest state */ 24#define MSR_GS (1<<28) /* Guest state */
20#define MSR_UCLE (1<<26) /* User-mode cache lock enable */ 25#define MSR_UCLE (1<<26) /* User-mode cache lock enable */
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index f0a4db31ecb..557cff845de 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -357,5 +357,7 @@ static inline int page_is_rtas_user_buf(unsigned long pfn)
357static inline int page_is_rtas_user_buf(unsigned long pfn) { return 0;} 357static inline int page_is_rtas_user_buf(unsigned long pfn) { return 0;}
358#endif 358#endif
359 359
360extern int call_rtas(const char *, int, int, unsigned long *, ...);
361
360#endif /* __KERNEL__ */ 362#endif /* __KERNEL__ */
361#endif /* _POWERPC_RTAS_H */ 363#endif /* _POWERPC_RTAS_H */
diff --git a/arch/powerpc/include/asm/runlatch.h b/arch/powerpc/include/asm/runlatch.h
new file mode 100644
index 00000000000..54e9b963876
--- /dev/null
+++ b/arch/powerpc/include/asm/runlatch.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
3 */
4#ifndef _ASM_POWERPC_RUNLATCH_H
5#define _ASM_POWERPC_RUNLATCH_H
6
7#ifdef CONFIG_PPC64
8
9extern void __ppc64_runlatch_on(void);
10extern void __ppc64_runlatch_off(void);
11
12/*
13 * We manually hard enable-disable, this is called
14 * in the idle loop and we don't want to mess up
15 * with soft-disable/enable & interrupt replay.
16 */
17#define ppc64_runlatch_off() \
18 do { \
19 if (cpu_has_feature(CPU_FTR_CTRL) && \
20 test_thread_local_flags(_TLF_RUNLATCH)) { \
21 unsigned long msr = mfmsr(); \
22 __hard_irq_disable(); \
23 __ppc64_runlatch_off(); \
24 if (msr & MSR_EE) \
25 __hard_irq_enable(); \
26 } \
27 } while (0)
28
29#define ppc64_runlatch_on() \
30 do { \
31 if (cpu_has_feature(CPU_FTR_CTRL) && \
32 !test_thread_local_flags(_TLF_RUNLATCH)) { \
33 unsigned long msr = mfmsr(); \
34 __hard_irq_disable(); \
35 __ppc64_runlatch_on(); \
36 if (msr & MSR_EE) \
37 __hard_irq_enable(); \
38 } \
39 } while (0)
40#else
41#define ppc64_runlatch_on()
42#define ppc64_runlatch_off()
43#endif /* CONFIG_PPC64 */
44
45#endif /* _ASM_POWERPC_RUNLATCH_H */
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h
index 186e0fb835b..d084ce195fc 100644
--- a/arch/powerpc/include/asm/setup.h
+++ b/arch/powerpc/include/asm/setup.h
@@ -5,6 +5,28 @@
5 5
6#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
7extern void ppc_printk_progress(char *s, unsigned short hex); 7extern void ppc_printk_progress(char *s, unsigned short hex);
8#endif 8
9extern unsigned int rtas_data;
10extern int mem_init_done; /* set on boot once kmalloc can be called */
11extern int init_bootmem_done; /* set once bootmem is available */
12extern phys_addr_t memory_limit;
13extern unsigned long klimit;
14extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
15
16extern void via_cuda_init(void);
17extern void read_rtc_time(void);
18extern void pmac_find_display(void);
19
20struct device_node;
21extern void note_scsi_host(struct device_node *, void *);
22
23/* Used in very early kernel initialization. */
24extern unsigned long reloc_offset(void);
25extern unsigned long add_reloc_offset(unsigned long);
26extern void reloc_got2(unsigned long);
27
28#define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x)))
29
30#endif /* !__ASSEMBLY__ */
9 31
10#endif /* _ASM_POWERPC_SETUP_H */ 32#endif /* _ASM_POWERPC_SETUP_H */
diff --git a/arch/powerpc/include/asm/switch_to.h b/arch/powerpc/include/asm/switch_to.h
new file mode 100644
index 00000000000..caf82d0a00d
--- /dev/null
+++ b/arch/powerpc/include/asm/switch_to.h
@@ -0,0 +1,65 @@
1/*
2 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
3 */
4#ifndef _ASM_POWERPC_SWITCH_TO_H
5#define _ASM_POWERPC_SWITCH_TO_H
6
7struct thread_struct;
8struct task_struct;
9struct pt_regs;
10
11extern struct task_struct *__switch_to(struct task_struct *,
12 struct task_struct *);
13#define switch_to(prev, next, last) ((last) = __switch_to((prev), (next)))
14
15struct thread_struct;
16extern struct task_struct *_switch(struct thread_struct *prev,
17 struct thread_struct *next);
18
19extern void giveup_fpu(struct task_struct *);
20extern void disable_kernel_fp(void);
21extern void enable_kernel_fp(void);
22extern void flush_fp_to_thread(struct task_struct *);
23extern void enable_kernel_altivec(void);
24extern void giveup_altivec(struct task_struct *);
25extern void load_up_altivec(struct task_struct *);
26extern int emulate_altivec(struct pt_regs *);
27extern void __giveup_vsx(struct task_struct *);
28extern void giveup_vsx(struct task_struct *);
29extern void enable_kernel_spe(void);
30extern void giveup_spe(struct task_struct *);
31extern void load_up_spe(struct task_struct *);
32
33#ifndef CONFIG_SMP
34extern void discard_lazy_cpu_state(void);
35#else
36static inline void discard_lazy_cpu_state(void)
37{
38}
39#endif
40
41#ifdef CONFIG_ALTIVEC
42extern void flush_altivec_to_thread(struct task_struct *);
43#else
44static inline void flush_altivec_to_thread(struct task_struct *t)
45{
46}
47#endif
48
49#ifdef CONFIG_VSX
50extern void flush_vsx_to_thread(struct task_struct *);
51#else
52static inline void flush_vsx_to_thread(struct task_struct *t)
53{
54}
55#endif
56
57#ifdef CONFIG_SPE
58extern void flush_spe_to_thread(struct task_struct *);
59#else
60static inline void flush_spe_to_thread(struct task_struct *t)
61{
62}
63#endif
64
65#endif /* _ASM_POWERPC_SWITCH_TO_H */
diff --git a/arch/powerpc/include/asm/system.h b/arch/powerpc/include/asm/system.h
deleted file mode 100644
index a02883d5af4..00000000000
--- a/arch/powerpc/include/asm/system.h
+++ /dev/null
@@ -1,592 +0,0 @@
1/*
2 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
3 */
4#ifndef _ASM_POWERPC_SYSTEM_H
5#define _ASM_POWERPC_SYSTEM_H
6
7#include <linux/kernel.h>
8#include <linux/irqflags.h>
9
10#include <asm/hw_irq.h>
11
12/*
13 * Memory barrier.
14 * The sync instruction guarantees that all memory accesses initiated
15 * by this processor have been performed (with respect to all other
16 * mechanisms that access memory). The eieio instruction is a barrier
17 * providing an ordering (separately) for (a) cacheable stores and (b)
18 * loads and stores to non-cacheable memory (e.g. I/O devices).
19 *
20 * mb() prevents loads and stores being reordered across this point.
21 * rmb() prevents loads being reordered across this point.
22 * wmb() prevents stores being reordered across this point.
23 * read_barrier_depends() prevents data-dependent loads being reordered
24 * across this point (nop on PPC).
25 *
26 * *mb() variants without smp_ prefix must order all types of memory
27 * operations with one another. sync is the only instruction sufficient
28 * to do this.
29 *
30 * For the smp_ barriers, ordering is for cacheable memory operations
31 * only. We have to use the sync instruction for smp_mb(), since lwsync
32 * doesn't order loads with respect to previous stores. Lwsync can be
33 * used for smp_rmb() and smp_wmb().
34 *
35 * However, on CPUs that don't support lwsync, lwsync actually maps to a
36 * heavy-weight sync, so smp_wmb() can be a lighter-weight eieio.
37 */
38#define mb() __asm__ __volatile__ ("sync" : : : "memory")
39#define rmb() __asm__ __volatile__ ("sync" : : : "memory")
40#define wmb() __asm__ __volatile__ ("sync" : : : "memory")
41#define read_barrier_depends() do { } while(0)
42
43#define set_mb(var, value) do { var = value; mb(); } while (0)
44
45#ifdef __KERNEL__
46#define AT_VECTOR_SIZE_ARCH 6 /* entries in ARCH_DLINFO */
47#ifdef CONFIG_SMP
48
49#ifdef __SUBARCH_HAS_LWSYNC
50# define SMPWMB LWSYNC
51#else
52# define SMPWMB eieio
53#endif
54
55#define smp_mb() mb()
56#define smp_rmb() __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
57#define smp_wmb() __asm__ __volatile__ (stringify_in_c(SMPWMB) : : :"memory")
58#define smp_read_barrier_depends() read_barrier_depends()
59#else
60#define smp_mb() barrier()
61#define smp_rmb() barrier()
62#define smp_wmb() barrier()
63#define smp_read_barrier_depends() do { } while(0)
64#endif /* CONFIG_SMP */
65
66/*
67 * This is a barrier which prevents following instructions from being
68 * started until the value of the argument x is known. For example, if
69 * x is a variable loaded from memory, this prevents following
70 * instructions from being executed until the load has been performed.
71 */
72#define data_barrier(x) \
73 asm volatile("twi 0,%0,0; isync" : : "r" (x) : "memory");
74
75struct task_struct;
76struct pt_regs;
77
78#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
79
80extern int (*__debugger)(struct pt_regs *regs);
81extern int (*__debugger_ipi)(struct pt_regs *regs);
82extern int (*__debugger_bpt)(struct pt_regs *regs);
83extern int (*__debugger_sstep)(struct pt_regs *regs);
84extern int (*__debugger_iabr_match)(struct pt_regs *regs);
85extern int (*__debugger_dabr_match)(struct pt_regs *regs);
86extern int (*__debugger_fault_handler)(struct pt_regs *regs);
87
88#define DEBUGGER_BOILERPLATE(__NAME) \
89static inline int __NAME(struct pt_regs *regs) \
90{ \
91 if (unlikely(__ ## __NAME)) \
92 return __ ## __NAME(regs); \
93 return 0; \
94}
95
96DEBUGGER_BOILERPLATE(debugger)
97DEBUGGER_BOILERPLATE(debugger_ipi)
98DEBUGGER_BOILERPLATE(debugger_bpt)
99DEBUGGER_BOILERPLATE(debugger_sstep)
100DEBUGGER_BOILERPLATE(debugger_iabr_match)
101DEBUGGER_BOILERPLATE(debugger_dabr_match)
102DEBUGGER_BOILERPLATE(debugger_fault_handler)
103
104#else
105static inline int debugger(struct pt_regs *regs) { return 0; }
106static inline int debugger_ipi(struct pt_regs *regs) { return 0; }
107static inline int debugger_bpt(struct pt_regs *regs) { return 0; }
108static inline int debugger_sstep(struct pt_regs *regs) { return 0; }
109static inline int debugger_iabr_match(struct pt_regs *regs) { return 0; }
110static inline int debugger_dabr_match(struct pt_regs *regs) { return 0; }
111static inline int debugger_fault_handler(struct pt_regs *regs) { return 0; }
112#endif
113
114extern int set_dabr(unsigned long dabr);
115#ifdef CONFIG_PPC_ADV_DEBUG_REGS
116extern void do_send_trap(struct pt_regs *regs, unsigned long address,
117 unsigned long error_code, int signal_code, int brkpt);
118#else
119extern void do_dabr(struct pt_regs *regs, unsigned long address,
120 unsigned long error_code);
121#endif
122extern void print_backtrace(unsigned long *);
123extern void flush_instruction_cache(void);
124extern void hard_reset_now(void);
125extern void poweroff_now(void);
126
127#ifdef CONFIG_6xx
128extern long _get_L2CR(void);
129extern long _get_L3CR(void);
130extern void _set_L2CR(unsigned long);
131extern void _set_L3CR(unsigned long);
132#else
133#define _get_L2CR() 0L
134#define _get_L3CR() 0L
135#define _set_L2CR(val) do { } while(0)
136#define _set_L3CR(val) do { } while(0)
137#endif
138
139extern void via_cuda_init(void);
140extern void read_rtc_time(void);
141extern void pmac_find_display(void);
142extern void giveup_fpu(struct task_struct *);
143extern void disable_kernel_fp(void);
144extern void enable_kernel_fp(void);
145extern void flush_fp_to_thread(struct task_struct *);
146extern void enable_kernel_altivec(void);
147extern void giveup_altivec(struct task_struct *);
148extern void load_up_altivec(struct task_struct *);
149extern int emulate_altivec(struct pt_regs *);
150extern void __giveup_vsx(struct task_struct *);
151extern void giveup_vsx(struct task_struct *);
152extern void enable_kernel_spe(void);
153extern void giveup_spe(struct task_struct *);
154extern void load_up_spe(struct task_struct *);
155extern int fix_alignment(struct pt_regs *);
156extern void cvt_fd(float *from, double *to);
157extern void cvt_df(double *from, float *to);
158
159#ifndef CONFIG_SMP
160extern void discard_lazy_cpu_state(void);
161#else
162static inline void discard_lazy_cpu_state(void)
163{
164}
165#endif
166
167#ifdef CONFIG_ALTIVEC
168extern void flush_altivec_to_thread(struct task_struct *);
169#else
170static inline void flush_altivec_to_thread(struct task_struct *t)
171{
172}
173#endif
174
175#ifdef CONFIG_VSX
176extern void flush_vsx_to_thread(struct task_struct *);
177#else
178static inline void flush_vsx_to_thread(struct task_struct *t)
179{
180}
181#endif
182
183#ifdef CONFIG_SPE
184extern void flush_spe_to_thread(struct task_struct *);
185#else
186static inline void flush_spe_to_thread(struct task_struct *t)
187{
188}
189#endif
190
191extern int call_rtas(const char *, int, int, unsigned long *, ...);
192extern void cacheable_memzero(void *p, unsigned int nb);
193extern void *cacheable_memcpy(void *, const void *, unsigned int);
194extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long);
195extern void bad_page_fault(struct pt_regs *, unsigned long, int);
196extern void _exception(int, struct pt_regs *, int, unsigned long);
197extern void die(const char *, struct pt_regs *, long);
198extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
199
200#ifdef CONFIG_BOOKE_WDT
201extern u32 booke_wdt_enabled;
202extern u32 booke_wdt_period;
203#endif /* CONFIG_BOOKE_WDT */
204
205struct device_node;
206extern void note_scsi_host(struct device_node *, void *);
207
208extern struct task_struct *__switch_to(struct task_struct *,
209 struct task_struct *);
210#define switch_to(prev, next, last) ((last) = __switch_to((prev), (next)))
211
212struct thread_struct;
213extern struct task_struct *_switch(struct thread_struct *prev,
214 struct thread_struct *next);
215
216extern unsigned int rtas_data;
217extern int mem_init_done; /* set on boot once kmalloc can be called */
218extern int init_bootmem_done; /* set once bootmem is available */
219extern phys_addr_t memory_limit;
220extern unsigned long klimit;
221extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
222
223extern int powersave_nap; /* set if nap mode can be used in idle loop */
224void cpu_idle_wait(void);
225
226#ifdef CONFIG_PSERIES_IDLE
227extern void update_smt_snooze_delay(int snooze);
228extern int pseries_notify_cpuidle_add_cpu(int cpu);
229#else
230static inline void update_smt_snooze_delay(int snooze) {}
231static inline int pseries_notify_cpuidle_add_cpu(int cpu) { return 0; }
232#endif
233
234/*
235 * Atomic exchange
236 *
237 * Changes the memory location '*ptr' to be val and returns
238 * the previous value stored there.
239 */
240static __always_inline unsigned long
241__xchg_u32(volatile void *p, unsigned long val)
242{
243 unsigned long prev;
244
245 __asm__ __volatile__(
246 PPC_RELEASE_BARRIER
247"1: lwarx %0,0,%2 \n"
248 PPC405_ERR77(0,%2)
249" stwcx. %3,0,%2 \n\
250 bne- 1b"
251 PPC_ACQUIRE_BARRIER
252 : "=&r" (prev), "+m" (*(volatile unsigned int *)p)
253 : "r" (p), "r" (val)
254 : "cc", "memory");
255
256 return prev;
257}
258
259/*
260 * Atomic exchange
261 *
262 * Changes the memory location '*ptr' to be val and returns
263 * the previous value stored there.
264 */
265static __always_inline unsigned long
266__xchg_u32_local(volatile void *p, unsigned long val)
267{
268 unsigned long prev;
269
270 __asm__ __volatile__(
271"1: lwarx %0,0,%2 \n"
272 PPC405_ERR77(0,%2)
273" stwcx. %3,0,%2 \n\
274 bne- 1b"
275 : "=&r" (prev), "+m" (*(volatile unsigned int *)p)
276 : "r" (p), "r" (val)
277 : "cc", "memory");
278
279 return prev;
280}
281
282#ifdef CONFIG_PPC64
283static __always_inline unsigned long
284__xchg_u64(volatile void *p, unsigned long val)
285{
286 unsigned long prev;
287
288 __asm__ __volatile__(
289 PPC_RELEASE_BARRIER
290"1: ldarx %0,0,%2 \n"
291 PPC405_ERR77(0,%2)
292" stdcx. %3,0,%2 \n\
293 bne- 1b"
294 PPC_ACQUIRE_BARRIER
295 : "=&r" (prev), "+m" (*(volatile unsigned long *)p)
296 : "r" (p), "r" (val)
297 : "cc", "memory");
298
299 return prev;
300}
301
302static __always_inline unsigned long
303__xchg_u64_local(volatile void *p, unsigned long val)
304{
305 unsigned long prev;
306
307 __asm__ __volatile__(
308"1: ldarx %0,0,%2 \n"
309 PPC405_ERR77(0,%2)
310" stdcx. %3,0,%2 \n\
311 bne- 1b"
312 : "=&r" (prev), "+m" (*(volatile unsigned long *)p)
313 : "r" (p), "r" (val)
314 : "cc", "memory");
315
316 return prev;
317}
318#endif
319
320/*
321 * This function doesn't exist, so you'll get a linker error
322 * if something tries to do an invalid xchg().
323 */
324extern void __xchg_called_with_bad_pointer(void);
325
326static __always_inline unsigned long
327__xchg(volatile void *ptr, unsigned long x, unsigned int size)
328{
329 switch (size) {
330 case 4:
331 return __xchg_u32(ptr, x);
332#ifdef CONFIG_PPC64
333 case 8:
334 return __xchg_u64(ptr, x);
335#endif
336 }
337 __xchg_called_with_bad_pointer();
338 return x;
339}
340
341static __always_inline unsigned long
342__xchg_local(volatile void *ptr, unsigned long x, unsigned int size)
343{
344 switch (size) {
345 case 4:
346 return __xchg_u32_local(ptr, x);
347#ifdef CONFIG_PPC64
348 case 8:
349 return __xchg_u64_local(ptr, x);
350#endif
351 }
352 __xchg_called_with_bad_pointer();
353 return x;
354}
355#define xchg(ptr,x) \
356 ({ \
357 __typeof__(*(ptr)) _x_ = (x); \
358 (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(*(ptr))); \
359 })
360
361#define xchg_local(ptr,x) \
362 ({ \
363 __typeof__(*(ptr)) _x_ = (x); \
364 (__typeof__(*(ptr))) __xchg_local((ptr), \
365 (unsigned long)_x_, sizeof(*(ptr))); \
366 })
367
368/*
369 * Compare and exchange - if *p == old, set it to new,
370 * and return the old value of *p.
371 */
372#define __HAVE_ARCH_CMPXCHG 1
373
374static __always_inline unsigned long
375__cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
376{
377 unsigned int prev;
378
379 __asm__ __volatile__ (
380 PPC_RELEASE_BARRIER
381"1: lwarx %0,0,%2 # __cmpxchg_u32\n\
382 cmpw 0,%0,%3\n\
383 bne- 2f\n"
384 PPC405_ERR77(0,%2)
385" stwcx. %4,0,%2\n\
386 bne- 1b"
387 PPC_ACQUIRE_BARRIER
388 "\n\
3892:"
390 : "=&r" (prev), "+m" (*p)
391 : "r" (p), "r" (old), "r" (new)
392 : "cc", "memory");
393
394 return prev;
395}
396
397static __always_inline unsigned long
398__cmpxchg_u32_local(volatile unsigned int *p, unsigned long old,
399 unsigned long new)
400{
401 unsigned int prev;
402
403 __asm__ __volatile__ (
404"1: lwarx %0,0,%2 # __cmpxchg_u32\n\
405 cmpw 0,%0,%3\n\
406 bne- 2f\n"
407 PPC405_ERR77(0,%2)
408" stwcx. %4,0,%2\n\
409 bne- 1b"
410 "\n\
4112:"
412 : "=&r" (prev), "+m" (*p)
413 : "r" (p), "r" (old), "r" (new)
414 : "cc", "memory");
415
416 return prev;
417}
418
419#ifdef CONFIG_PPC64
420static __always_inline unsigned long
421__cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
422{
423 unsigned long prev;
424
425 __asm__ __volatile__ (
426 PPC_RELEASE_BARRIER
427"1: ldarx %0,0,%2 # __cmpxchg_u64\n\
428 cmpd 0,%0,%3\n\
429 bne- 2f\n\
430 stdcx. %4,0,%2\n\
431 bne- 1b"
432 PPC_ACQUIRE_BARRIER
433 "\n\
4342:"
435 : "=&r" (prev), "+m" (*p)
436 : "r" (p), "r" (old), "r" (new)
437 : "cc", "memory");
438
439 return prev;
440}
441
442static __always_inline unsigned long
443__cmpxchg_u64_local(volatile unsigned long *p, unsigned long old,
444 unsigned long new)
445{
446 unsigned long prev;
447
448 __asm__ __volatile__ (
449"1: ldarx %0,0,%2 # __cmpxchg_u64\n\
450 cmpd 0,%0,%3\n\
451 bne- 2f\n\
452 stdcx. %4,0,%2\n\
453 bne- 1b"
454 "\n\
4552:"
456 : "=&r" (prev), "+m" (*p)
457 : "r" (p), "r" (old), "r" (new)
458 : "cc", "memory");
459
460 return prev;
461}
462#endif
463
464/* This function doesn't exist, so you'll get a linker error
465 if something tries to do an invalid cmpxchg(). */
466extern void __cmpxchg_called_with_bad_pointer(void);
467
468static __always_inline unsigned long
469__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
470 unsigned int size)
471{
472 switch (size) {
473 case 4:
474 return __cmpxchg_u32(ptr, old, new);
475#ifdef CONFIG_PPC64
476 case 8:
477 return __cmpxchg_u64(ptr, old, new);
478#endif
479 }
480 __cmpxchg_called_with_bad_pointer();
481 return old;
482}
483
484static __always_inline unsigned long
485__cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
486 unsigned int size)
487{
488 switch (size) {
489 case 4:
490 return __cmpxchg_u32_local(ptr, old, new);
491#ifdef CONFIG_PPC64
492 case 8:
493 return __cmpxchg_u64_local(ptr, old, new);
494#endif
495 }
496 __cmpxchg_called_with_bad_pointer();
497 return old;
498}
499
500#define cmpxchg(ptr, o, n) \
501 ({ \
502 __typeof__(*(ptr)) _o_ = (o); \
503 __typeof__(*(ptr)) _n_ = (n); \
504 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
505 (unsigned long)_n_, sizeof(*(ptr))); \
506 })
507
508
509#define cmpxchg_local(ptr, o, n) \
510 ({ \
511 __typeof__(*(ptr)) _o_ = (o); \
512 __typeof__(*(ptr)) _n_ = (n); \
513 (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \
514 (unsigned long)_n_, sizeof(*(ptr))); \
515 })
516
517#ifdef CONFIG_PPC64
518/*
519 * We handle most unaligned accesses in hardware. On the other hand
520 * unaligned DMA can be very expensive on some ppc64 IO chips (it does
521 * powers of 2 writes until it reaches sufficient alignment).
522 *
523 * Based on this we disable the IP header alignment in network drivers.
524 */
525#define NET_IP_ALIGN 0
526
527#define cmpxchg64(ptr, o, n) \
528 ({ \
529 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
530 cmpxchg((ptr), (o), (n)); \
531 })
532#define cmpxchg64_local(ptr, o, n) \
533 ({ \
534 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
535 cmpxchg_local((ptr), (o), (n)); \
536 })
537#else
538#include <asm-generic/cmpxchg-local.h>
539#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
540#endif
541
542extern unsigned long arch_align_stack(unsigned long sp);
543
544/* Used in very early kernel initialization. */
545extern unsigned long reloc_offset(void);
546extern unsigned long add_reloc_offset(unsigned long);
547extern void reloc_got2(unsigned long);
548
549#define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x)))
550
551extern struct dentry *powerpc_debugfs_root;
552
553#ifdef CONFIG_PPC64
554
555extern void __ppc64_runlatch_on(void);
556extern void __ppc64_runlatch_off(void);
557
558/*
559 * We manually hard enable-disable, this is called
560 * in the idle loop and we don't want to mess up
561 * with soft-disable/enable & interrupt replay.
562 */
563#define ppc64_runlatch_off() \
564 do { \
565 if (cpu_has_feature(CPU_FTR_CTRL) && \
566 test_thread_local_flags(_TLF_RUNLATCH)) { \
567 unsigned long msr = mfmsr(); \
568 __hard_irq_disable(); \
569 __ppc64_runlatch_off(); \
570 if (msr & MSR_EE) \
571 __hard_irq_enable(); \
572 } \
573 } while (0)
574
575#define ppc64_runlatch_on() \
576 do { \
577 if (cpu_has_feature(CPU_FTR_CTRL) && \
578 !test_thread_local_flags(_TLF_RUNLATCH)) { \
579 unsigned long msr = mfmsr(); \
580 __hard_irq_disable(); \
581 __ppc64_runlatch_on(); \
582 if (msr & MSR_EE) \
583 __hard_irq_enable(); \
584 } \
585 } while (0)
586#else
587#define ppc64_runlatch_on()
588#define ppc64_runlatch_off()
589#endif /* CONFIG_PPC64 */
590
591#endif /* __KERNEL__ */
592#endif /* _ASM_POWERPC_SYSTEM_H */
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 8184ee97e48..ee5b690a0be 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -21,10 +21,10 @@
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <asm/processor.h> 22#include <asm/processor.h>
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <asm/system.h>
25#include <asm/cache.h> 24#include <asm/cache.h>
26#include <asm/cputable.h> 25#include <asm/cputable.h>
27#include <asm/emulated_ops.h> 26#include <asm/emulated_ops.h>
27#include <asm/switch_to.h>
28 28
29struct aligninfo { 29struct aligninfo {
30 unsigned char len; 30 unsigned char len;
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 138ae183c44..455faa38987 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -20,6 +20,7 @@
20#include <asm/cputable.h> 20#include <asm/cputable.h>
21#include <asm/prom.h> /* for PTRRELOC on ARCH=ppc */ 21#include <asm/prom.h> /* for PTRRELOC on ARCH=ppc */
22#include <asm/mmu.h> 22#include <asm/mmu.h>
23#include <asm/setup.h>
23 24
24struct cpu_spec* cur_cpu_spec = NULL; 25struct cpu_spec* cur_cpu_spec = NULL;
25EXPORT_SYMBOL(cur_cpu_spec); 26EXPORT_SYMBOL(cur_cpu_spec);
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index abef75176c0..fdcd8f551af 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -27,8 +27,8 @@
27#include <asm/kdump.h> 27#include <asm/kdump.h>
28#include <asm/prom.h> 28#include <asm/prom.h>
29#include <asm/smp.h> 29#include <asm/smp.h>
30#include <asm/system.h>
31#include <asm/setjmp.h> 30#include <asm/setjmp.h>
31#include <asm/debug.h>
32 32
33/* 33/*
34 * The primary CPU waits a while for all secondary CPUs to enter. This is to 34 * The primary CPU waits a while for all secondary CPUs to enter. This is to
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index e8e821146f3..6d2209ac0c4 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -26,11 +26,11 @@
26#include <linux/sysctl.h> 26#include <linux/sysctl.h>
27#include <linux/tick.h> 27#include <linux/tick.h>
28 28
29#include <asm/system.h>
30#include <asm/processor.h> 29#include <asm/processor.h>
31#include <asm/cputable.h> 30#include <asm/cputable.h>
32#include <asm/time.h> 31#include <asm/time.h>
33#include <asm/machdep.h> 32#include <asm/machdep.h>
33#include <asm/runlatch.h>
34#include <asm/smp.h> 34#include <asm/smp.h>
35 35
36#ifdef CONFIG_HOTPLUG_CPU 36#ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index cea2d9f3ae4..243dbabfe74 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -57,7 +57,6 @@
57#include <linux/of_irq.h> 57#include <linux/of_irq.h>
58 58
59#include <asm/uaccess.h> 59#include <asm/uaccess.h>
60#include <asm/system.h>
61#include <asm/io.h> 60#include <asm/io.h>
62#include <asm/pgtable.h> 61#include <asm/pgtable.h>
63#include <asm/irq.h> 62#include <asm/irq.h>
@@ -67,6 +66,7 @@
67#include <asm/machdep.h> 66#include <asm/machdep.h>
68#include <asm/udbg.h> 67#include <asm/udbg.h>
69#include <asm/smp.h> 68#include <asm/smp.h>
69#include <asm/debug.h>
70 70
71#ifdef CONFIG_PPC64 71#ifdef CONFIG_PPC64
72#include <asm/paca.h> 72#include <asm/paca.h>
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index bc47352deb1..e88c6433181 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -35,7 +35,6 @@
35#include <asm/cacheflush.h> 35#include <asm/cacheflush.h>
36#include <asm/sstep.h> 36#include <asm/sstep.h>
37#include <asm/uaccess.h> 37#include <asm/uaccess.h>
38#include <asm/system.h>
39 38
40#ifdef CONFIG_PPC_ADV_DEBUG_REGS 39#ifdef CONFIG_PPC_ADV_DEBUG_REGS
41#define MSR_SINGLESTEP (MSR_DE) 40#define MSR_SINGLESTEP (MSR_DE)
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index ac12bd80ad9..f5725bce9ed 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -30,7 +30,6 @@
30#include <asm/hvcall.h> 30#include <asm/hvcall.h>
31#include <asm/firmware.h> 31#include <asm/firmware.h>
32#include <asm/rtas.h> 32#include <asm/rtas.h>
33#include <asm/system.h>
34#include <asm/time.h> 33#include <asm/time.h>
35#include <asm/prom.h> 34#include <asm/prom.h>
36#include <asm/vdso_datapage.h> 35#include <asm/vdso_datapage.h>
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index d3114a71dd3..786a2700ec2 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -26,7 +26,6 @@
26#include <linux/cuda.h> 26#include <linux/cuda.h>
27#include <linux/pmu.h> 27#include <linux/pmu.h>
28#include <asm/prom.h> 28#include <asm/prom.h>
29#include <asm/system.h>
30#include <asm/pci-bridge.h> 29#include <asm/pci-bridge.h>
31#include <asm/irq.h> 30#include <asm/irq.h>
32#include <asm/pmac_feature.h> 31#include <asm/pmac_feature.h>
@@ -43,6 +42,7 @@
43#include <asm/signal.h> 42#include <asm/signal.h>
44#include <asm/dcr.h> 43#include <asm/dcr.h>
45#include <asm/ftrace.h> 44#include <asm/ftrace.h>
45#include <asm/switch_to.h>
46 46
47#ifdef CONFIG_PPC32 47#ifdef CONFIG_PPC32
48extern void transfer_to_handler(void); 48extern void transfer_to_handler(void);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index e40707032ac..f88698c0f33 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -41,14 +41,16 @@
41 41
42#include <asm/pgtable.h> 42#include <asm/pgtable.h>
43#include <asm/uaccess.h> 43#include <asm/uaccess.h>
44#include <asm/system.h>
45#include <asm/io.h> 44#include <asm/io.h>
46#include <asm/processor.h> 45#include <asm/processor.h>
47#include <asm/mmu.h> 46#include <asm/mmu.h>
48#include <asm/prom.h> 47#include <asm/prom.h>
49#include <asm/machdep.h> 48#include <asm/machdep.h>
50#include <asm/time.h> 49#include <asm/time.h>
50#include <asm/runlatch.h>
51#include <asm/syscalls.h> 51#include <asm/syscalls.h>
52#include <asm/switch_to.h>
53#include <asm/debug.h>
52#ifdef CONFIG_PPC64 54#ifdef CONFIG_PPC64
53#include <asm/firmware.h> 55#include <asm/firmware.h>
54#endif 56#endif
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 89e850af3dd..f191bf02943 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -41,7 +41,6 @@
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/kdump.h> 42#include <asm/kdump.h>
43#include <asm/smp.h> 43#include <asm/smp.h>
44#include <asm/system.h>
45#include <asm/mmu.h> 44#include <asm/mmu.h>
46#include <asm/paca.h> 45#include <asm/paca.h>
47#include <asm/pgtable.h> 46#include <asm/pgtable.h>
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index ea4e311e09d..99860273211 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -35,7 +35,6 @@
35#include <asm/irq.h> 35#include <asm/irq.h>
36#include <asm/io.h> 36#include <asm/io.h>
37#include <asm/smp.h> 37#include <asm/smp.h>
38#include <asm/system.h>
39#include <asm/mmu.h> 38#include <asm/mmu.h>
40#include <asm/pgtable.h> 39#include <asm/pgtable.h>
41#include <asm/pci.h> 40#include <asm/pci.h>
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 5b43325402b..8d8e028893b 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -36,7 +36,7 @@
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37#include <asm/page.h> 37#include <asm/page.h>
38#include <asm/pgtable.h> 38#include <asm/pgtable.h>
39#include <asm/system.h> 39#include <asm/switch_to.h>
40 40
41#define CREATE_TRACE_POINTS 41#define CREATE_TRACE_POINTS
42#include <trace/events/syscalls.h> 42#include <trace/events/syscalls.h>
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c
index 69c4be917d0..469349d14a9 100644
--- a/arch/powerpc/kernel/ptrace32.c
+++ b/arch/powerpc/kernel/ptrace32.c
@@ -32,7 +32,7 @@
32#include <asm/uaccess.h> 32#include <asm/uaccess.h>
33#include <asm/page.h> 33#include <asm/page.h>
34#include <asm/pgtable.h> 34#include <asm/pgtable.h>
35#include <asm/system.h> 35#include <asm/switch_to.h>
36 36
37/* 37/*
38 * does not yet catch signals sent when the child dies. 38 * does not yet catch signals sent when the child dies.
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 4d1a7babe34..fcec38241f7 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -33,7 +33,6 @@
33#include <asm/firmware.h> 33#include <asm/firmware.h>
34#include <asm/page.h> 34#include <asm/page.h>
35#include <asm/param.h> 35#include <asm/param.h>
36#include <asm/system.h>
37#include <asm/delay.h> 36#include <asm/delay.h>
38#include <asm/uaccess.h> 37#include <asm/uaccess.h>
39#include <asm/udbg.h> 38#include <asm/udbg.h>
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index b0ebdeab949..afd4f051f3f 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -51,7 +51,6 @@
51#include <asm/btext.h> 51#include <asm/btext.h>
52#include <asm/nvram.h> 52#include <asm/nvram.h>
53#include <asm/setup.h> 53#include <asm/setup.h>
54#include <asm/system.h>
55#include <asm/rtas.h> 54#include <asm/rtas.h>
56#include <asm/iommu.h> 55#include <asm/iommu.h>
57#include <asm/serial.h> 56#include <asm/serial.h>
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index ac761081511..9825f29d1fa 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -30,7 +30,6 @@
30#include <asm/btext.h> 30#include <asm/btext.h>
31#include <asm/machdep.h> 31#include <asm/machdep.h>
32#include <asm/uaccess.h> 32#include <asm/uaccess.h>
33#include <asm/system.h>
34#include <asm/pmac_feature.h> 33#include <asm/pmac_feature.h>
35#include <asm/sections.h> 34#include <asm/sections.h>
36#include <asm/nvram.h> 35#include <asm/nvram.h>
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4721b0c8d7b..389bd4f0cdb 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -52,7 +52,6 @@
52#include <asm/btext.h> 52#include <asm/btext.h>
53#include <asm/nvram.h> 53#include <asm/nvram.h>
54#include <asm/setup.h> 54#include <asm/setup.h>
55#include <asm/system.h>
56#include <asm/rtas.h> 55#include <asm/rtas.h>
57#include <asm/iommu.h> 56#include <asm/iommu.h>
58#include <asm/serial.h> 57#include <asm/serial.h>
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index 7006b7f4267..651c5963662 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -15,6 +15,7 @@
15#include <asm/hw_breakpoint.h> 15#include <asm/hw_breakpoint.h>
16#include <asm/uaccess.h> 16#include <asm/uaccess.h>
17#include <asm/unistd.h> 17#include <asm/unistd.h>
18#include <asm/debug.h>
18 19
19#include "signal.h" 20#include "signal.h"
20 21
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index e061ef5dd44..45eb998557f 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -43,6 +43,7 @@
43#include <asm/syscalls.h> 43#include <asm/syscalls.h>
44#include <asm/sigcontext.h> 44#include <asm/sigcontext.h>
45#include <asm/vdso.h> 45#include <asm/vdso.h>
46#include <asm/switch_to.h>
46#ifdef CONFIG_PPC64 47#ifdef CONFIG_PPC64
47#include "ppc32.h" 48#include "ppc32.h"
48#include <asm/unistd.h> 49#include <asm/unistd.h>
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index a50b5ec281d..2692efdb154 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -33,6 +33,7 @@
33#include <asm/cacheflush.h> 33#include <asm/cacheflush.h>
34#include <asm/syscalls.h> 34#include <asm/syscalls.h>
35#include <asm/vdso.h> 35#include <asm/vdso.h>
36#include <asm/switch_to.h>
36 37
37#include "signal.h" 38#include "signal.h"
38 39
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 46695febc09..d9f94410fd7 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -43,12 +43,12 @@
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/cputhreads.h> 44#include <asm/cputhreads.h>
45#include <asm/cputable.h> 45#include <asm/cputable.h>
46#include <asm/system.h>
47#include <asm/mpic.h> 46#include <asm/mpic.h>
48#include <asm/vdso_datapage.h> 47#include <asm/vdso_datapage.h>
49#ifdef CONFIG_PPC64 48#ifdef CONFIG_PPC64
50#include <asm/paca.h> 49#include <asm/paca.h>
51#endif 50#endif
51#include <asm/debug.h>
52 52
53#ifdef DEBUG 53#ifdef DEBUG
54#include <asm/udbg.h> 54#include <asm/udbg.h>
diff --git a/arch/powerpc/kernel/softemu8xx.c b/arch/powerpc/kernel/softemu8xx.c
index af0e8290b4f..29b2f81dd70 100644
--- a/arch/powerpc/kernel/softemu8xx.c
+++ b/arch/powerpc/kernel/softemu8xx.c
@@ -26,7 +26,6 @@
26 26
27#include <asm/pgtable.h> 27#include <asm/pgtable.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/system.h>
30#include <asm/io.h> 29#include <asm/io.h>
31 30
32/* Eventually we may need a look-up table, but this works for now. 31/* Eventually we may need a look-up table, but this works for now.
diff --git a/arch/powerpc/kernel/swsusp.c b/arch/powerpc/kernel/swsusp.c
index 641f9adc620..eae33e10b65 100644
--- a/arch/powerpc/kernel/swsusp.c
+++ b/arch/powerpc/kernel/swsusp.c
@@ -10,9 +10,9 @@
10 */ 10 */
11 11
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <asm/system.h>
14#include <asm/current.h> 13#include <asm/current.h>
15#include <asm/mmu_context.h> 14#include <asm/mmu_context.h>
15#include <asm/switch_to.h>
16 16
17void save_processor_state(void) 17void save_processor_state(void)
18{ 18{
diff --git a/arch/powerpc/kernel/swsusp_64.c b/arch/powerpc/kernel/swsusp_64.c
index 168e8848022..0e899e47c32 100644
--- a/arch/powerpc/kernel/swsusp_64.c
+++ b/arch/powerpc/kernel/swsusp_64.c
@@ -6,7 +6,6 @@
6 * GPLv2 6 * GPLv2
7 */ 7 */
8 8
9#include <asm/system.h>
10#include <asm/iommu.h> 9#include <asm/iommu.h>
11#include <linux/irq.h> 10#include <linux/irq.h>
12#include <linux/sched.h> 11#include <linux/sched.h>
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index 4e5bf1edc0f..81c570633ea 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -50,6 +50,7 @@
50#include <asm/mmu_context.h> 50#include <asm/mmu_context.h>
51#include <asm/ppc-pci.h> 51#include <asm/ppc-pci.h>
52#include <asm/syscalls.h> 52#include <asm/syscalls.h>
53#include <asm/switch_to.h>
53 54
54 55
55asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp, 56asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp,
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 0c683d376b1..3529446c2ab 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -17,7 +17,6 @@
17#include <asm/machdep.h> 17#include <asm/machdep.h>
18#include <asm/smp.h> 18#include <asm/smp.h>
19#include <asm/pmc.h> 19#include <asm/pmc.h>
20#include <asm/system.h>
21 20
22#include "cacheinfo.h" 21#include "cacheinfo.h"
23 22
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index a750409ccc4..6aa0c663e24 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -39,7 +39,6 @@
39#include <asm/emulated_ops.h> 39#include <asm/emulated_ops.h>
40#include <asm/pgtable.h> 40#include <asm/pgtable.h>
41#include <asm/uaccess.h> 41#include <asm/uaccess.h>
42#include <asm/system.h>
43#include <asm/io.h> 42#include <asm/io.h>
44#include <asm/machdep.h> 43#include <asm/machdep.h>
45#include <asm/rtas.h> 44#include <asm/rtas.h>
@@ -58,6 +57,8 @@
58#include <asm/ppc-opcode.h> 57#include <asm/ppc-opcode.h>
59#include <asm/rio.h> 58#include <asm/rio.h>
60#include <asm/fadump.h> 59#include <asm/fadump.h>
60#include <asm/switch_to.h>
61#include <asm/debug.h>
61 62
62#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC) 63#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
63int (*__debugger)(struct pt_regs *regs) __read_mostly; 64int (*__debugger)(struct pt_regs *regs) __read_mostly;
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index 972cca278f9..9eb5b9b536a 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -24,7 +24,6 @@
24#include <linux/memblock.h> 24#include <linux/memblock.h>
25 25
26#include <asm/pgtable.h> 26#include <asm/pgtable.h>
27#include <asm/system.h>
28#include <asm/processor.h> 27#include <asm/processor.h>
29#include <asm/mmu.h> 28#include <asm/mmu.h>
30#include <asm/mmu_context.h> 29#include <asm/mmu_context.h>
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index d386b6198bc..01294a5099d 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -45,6 +45,7 @@
45#include <asm/cputhreads.h> 45#include <asm/cputhreads.h>
46#include <asm/page.h> 46#include <asm/page.h>
47#include <asm/hvcall.h> 47#include <asm/hvcall.h>
48#include <asm/switch_to.h>
48#include <linux/gfp.h> 49#include <linux/gfp.h>
49#include <linux/vmalloc.h> 50#include <linux/vmalloc.h>
50#include <linux/highmem.h> 51#include <linux/highmem.h>
diff --git a/arch/powerpc/lib/alloc.c b/arch/powerpc/lib/alloc.c
index 13b676c20d1..da22c84a8fe 100644
--- a/arch/powerpc/lib/alloc.c
+++ b/arch/powerpc/lib/alloc.c
@@ -3,8 +3,8 @@
3#include <linux/slab.h> 3#include <linux/slab.h>
4#include <linux/bootmem.h> 4#include <linux/bootmem.h>
5#include <linux/string.h> 5#include <linux/string.h>
6#include <asm/setup.h>
6 7
7#include <asm/system.h>
8 8
9void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask) 9void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask)
10{ 10{
diff --git a/arch/powerpc/lib/copyuser_power7_vmx.c b/arch/powerpc/lib/copyuser_power7_vmx.c
index 6e1efadac48..bf2654f2b68 100644
--- a/arch/powerpc/lib/copyuser_power7_vmx.c
+++ b/arch/powerpc/lib/copyuser_power7_vmx.c
@@ -20,6 +20,7 @@
20 */ 20 */
21#include <linux/uaccess.h> 21#include <linux/uaccess.h>
22#include <linux/hardirq.h> 22#include <linux/hardirq.h>
23#include <asm/switch_to.h>
23 24
24int enter_vmx_copy(void) 25int enter_vmx_copy(void)
25{ 26{
diff --git a/arch/powerpc/mm/44x_mmu.c b/arch/powerpc/mm/44x_mmu.c
index 388b95e1a00..2c9441ee6bb 100644
--- a/arch/powerpc/mm/44x_mmu.c
+++ b/arch/powerpc/mm/44x_mmu.c
@@ -27,7 +27,6 @@
27#include <linux/memblock.h> 27#include <linux/memblock.h>
28 28
29#include <asm/mmu.h> 29#include <asm/mmu.h>
30#include <asm/system.h>
31#include <asm/page.h> 30#include <asm/page.h>
32#include <asm/cacheflush.h> 31#include <asm/cacheflush.h>
33 32
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 19f2f9498b2..08ffcf52a85 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -38,10 +38,10 @@
38#include <asm/pgtable.h> 38#include <asm/pgtable.h>
39#include <asm/mmu.h> 39#include <asm/mmu.h>
40#include <asm/mmu_context.h> 40#include <asm/mmu_context.h>
41#include <asm/system.h>
42#include <asm/uaccess.h> 41#include <asm/uaccess.h>
43#include <asm/tlbflush.h> 42#include <asm/tlbflush.h>
44#include <asm/siginfo.h> 43#include <asm/siginfo.h>
44#include <asm/debug.h>
45#include <mm/mmu_decl.h> 45#include <mm/mmu_decl.h>
46 46
47#include "icswx.h" 47#include "icswx.h"
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 3e8c37a4e39..377e5cbedbb 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -40,7 +40,6 @@
40#include <asm/mmu_context.h> 40#include <asm/mmu_context.h>
41#include <asm/page.h> 41#include <asm/page.h>
42#include <asm/types.h> 42#include <asm/types.h>
43#include <asm/system.h>
44#include <asm/uaccess.h> 43#include <asm/uaccess.h>
45#include <asm/machdep.h> 44#include <asm/machdep.h>
46#include <asm/prom.h> 45#include <asm/prom.h>
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 6157be2a704..01e2db97a21 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -45,7 +45,6 @@
45#include <asm/btext.h> 45#include <asm/btext.h>
46#include <asm/tlb.h> 46#include <asm/tlb.h>
47#include <asm/sections.h> 47#include <asm/sections.h>
48#include <asm/system.h>
49#include <asm/hugetlb.h> 48#include <asm/hugetlb.h>
50 49
51#include "mmu_decl.h" 50#include "mmu_decl.h"
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index e94b57fb79a..620b7acd2fd 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -61,7 +61,6 @@
61#include <asm/mmzone.h> 61#include <asm/mmzone.h>
62#include <asm/cputable.h> 62#include <asm/cputable.h>
63#include <asm/sections.h> 63#include <asm/sections.h>
64#include <asm/system.h>
65#include <asm/iommu.h> 64#include <asm/iommu.h>
66#include <asm/abs_addr.h> 65#include <asm/abs_addr.h>
67#include <asm/vdso.h> 66#include <asm/vdso.h>
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 3feefc3842a..b6edbb3b4a5 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -24,11 +24,11 @@
24#include <linux/node.h> 24#include <linux/node.h>
25#include <asm/sparsemem.h> 25#include <asm/sparsemem.h>
26#include <asm/prom.h> 26#include <asm/prom.h>
27#include <asm/system.h>
28#include <asm/smp.h> 27#include <asm/smp.h>
29#include <asm/firmware.h> 28#include <asm/firmware.h>
30#include <asm/paca.h> 29#include <asm/paca.h>
31#include <asm/hvcall.h> 30#include <asm/hvcall.h>
31#include <asm/setup.h>
32 32
33static int numa_enabled = 1; 33static int numa_enabled = 1;
34 34
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 0907f92ce30..6c856fb8c15 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -33,6 +33,7 @@
33#include <asm/pgalloc.h> 33#include <asm/pgalloc.h>
34#include <asm/fixmap.h> 34#include <asm/fixmap.h>
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/setup.h>
36 37
37#include "mmu_decl.h" 38#include "mmu_decl.h"
38 39
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index ad36ede469c..249a0631c4d 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -51,7 +51,6 @@
51#include <asm/processor.h> 51#include <asm/processor.h>
52#include <asm/cputable.h> 52#include <asm/cputable.h>
53#include <asm/sections.h> 53#include <asm/sections.h>
54#include <asm/system.h>
55#include <asm/abs_addr.h> 54#include <asm/abs_addr.h>
56#include <asm/firmware.h> 55#include <asm/firmware.h>
57 56
diff --git a/arch/powerpc/oprofile/common.c b/arch/powerpc/oprofile/common.c
index 6f01624f317..4f51025f5b0 100644
--- a/arch/powerpc/oprofile/common.c
+++ b/arch/powerpc/oprofile/common.c
@@ -18,7 +18,6 @@
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/errno.h> 19#include <linux/errno.h>
20#include <asm/ptrace.h> 20#include <asm/ptrace.h>
21#include <asm/system.h>
22#include <asm/pmc.h> 21#include <asm/pmc.h>
23#include <asm/cputable.h> 22#include <asm/cputable.h>
24#include <asm/oprofile_impl.h> 23#include <asm/oprofile_impl.h>
diff --git a/arch/powerpc/oprofile/op_model_7450.c b/arch/powerpc/oprofile/op_model_7450.c
index f8d36f940e8..ff617246d12 100644
--- a/arch/powerpc/oprofile/op_model_7450.c
+++ b/arch/powerpc/oprofile/op_model_7450.c
@@ -19,7 +19,6 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/smp.h> 20#include <linux/smp.h>
21#include <asm/ptrace.h> 21#include <asm/ptrace.h>
22#include <asm/system.h>
23#include <asm/processor.h> 22#include <asm/processor.h>
24#include <asm/cputable.h> 23#include <asm/cputable.h>
25#include <asm/page.h> 24#include <asm/page.h>
diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c
index cb515cff745..b9589c19ccd 100644
--- a/arch/powerpc/oprofile/op_model_cell.c
+++ b/arch/powerpc/oprofile/op_model_cell.c
@@ -34,7 +34,6 @@
34#include <asm/ptrace.h> 34#include <asm/ptrace.h>
35#include <asm/reg.h> 35#include <asm/reg.h>
36#include <asm/rtas.h> 36#include <asm/rtas.h>
37#include <asm/system.h>
38#include <asm/cell-regs.h> 37#include <asm/cell-regs.h>
39 38
40#include "../platforms/cell/interrupt.h" 39#include "../platforms/cell/interrupt.h"
diff --git a/arch/powerpc/oprofile/op_model_fsl_emb.c b/arch/powerpc/oprofile/op_model_fsl_emb.c
index d4e6507277b..ccc1daa33ae 100644
--- a/arch/powerpc/oprofile/op_model_fsl_emb.c
+++ b/arch/powerpc/oprofile/op_model_fsl_emb.c
@@ -17,7 +17,6 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/system.h>
21#include <asm/processor.h> 20#include <asm/processor.h>
22#include <asm/cputable.h> 21#include <asm/cputable.h>
23#include <asm/reg_fsl_emb.h> 22#include <asm/reg_fsl_emb.h>
diff --git a/arch/powerpc/oprofile/op_model_power4.c b/arch/powerpc/oprofile/op_model_power4.c
index e6bec74be13..95ae77dec3f 100644
--- a/arch/powerpc/oprofile/op_model_power4.c
+++ b/arch/powerpc/oprofile/op_model_power4.c
@@ -14,7 +14,6 @@
14#include <linux/smp.h> 14#include <linux/smp.h>
15#include <asm/firmware.h> 15#include <asm/firmware.h>
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17#include <asm/system.h>
18#include <asm/processor.h> 17#include <asm/processor.h>
19#include <asm/cputable.h> 18#include <asm/cputable.h>
20#include <asm/rtas.h> 19#include <asm/rtas.h>
diff --git a/arch/powerpc/oprofile/op_model_rs64.c b/arch/powerpc/oprofile/op_model_rs64.c
index a20afe45d93..9b801b8c8c5 100644
--- a/arch/powerpc/oprofile/op_model_rs64.c
+++ b/arch/powerpc/oprofile/op_model_rs64.c
@@ -11,7 +11,6 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/smp.h> 12#include <linux/smp.h>
13#include <asm/ptrace.h> 13#include <asm/ptrace.h>
14#include <asm/system.h>
15#include <asm/processor.h> 14#include <asm/processor.h>
16#include <asm/cputable.h> 15#include <asm/cputable.h>
17#include <asm/oprofile_impl.h> 16#include <asm/oprofile_impl.h>
diff --git a/arch/powerpc/platforms/52xx/lite5200_pm.c b/arch/powerpc/platforms/52xx/lite5200_pm.c
index eda0fc2a391..870b70f5d1b 100644
--- a/arch/powerpc/platforms/52xx/lite5200_pm.c
+++ b/arch/powerpc/platforms/52xx/lite5200_pm.c
@@ -3,6 +3,7 @@
3#include <asm/io.h> 3#include <asm/io.h>
4#include <asm/time.h> 4#include <asm/time.h>
5#include <asm/mpc52xx.h> 5#include <asm/mpc52xx.h>
6#include <asm/switch_to.h>
6 7
7/* defined in lite5200_sleep.S and only used here */ 8/* defined in lite5200_sleep.S and only used here */
8extern void lite5200_low_power(void __iomem *sram, void __iomem *mbar); 9extern void lite5200_low_power(void __iomem *sram, void __iomem *mbar);
diff --git a/arch/powerpc/platforms/82xx/pq2.c b/arch/powerpc/platforms/82xx/pq2.c
index d111b024eaf..fb94d10e5a4 100644
--- a/arch/powerpc/platforms/82xx/pq2.c
+++ b/arch/powerpc/platforms/82xx/pq2.c
@@ -17,7 +17,6 @@
17#include <asm/cpm2.h> 17#include <asm/cpm2.h>
18#include <asm/io.h> 18#include <asm/io.h>
19#include <asm/pci-bridge.h> 19#include <asm/pci-bridge.h>
20#include <asm/system.h>
21 20
22#include <platforms/82xx/pq2.h> 21#include <platforms/82xx/pq2.h>
23 22
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index 65eb792a0d0..a266ba87686 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -27,7 +27,6 @@
27#include <linux/of_platform.h> 27#include <linux/of_platform.h>
28#include <linux/of_device.h> 28#include <linux/of_device.h>
29 29
30#include <asm/system.h>
31#include <linux/atomic.h> 30#include <linux/atomic.h>
32#include <asm/time.h> 31#include <asm/time.h>
33#include <asm/io.h> 32#include <asm/io.h>
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index e36bc611dd6..d440435e055 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -26,7 +26,6 @@
26#include <linux/of_platform.h> 26#include <linux/of_platform.h>
27#include <linux/of_device.h> 27#include <linux/of_device.h>
28 28
29#include <asm/system.h>
30#include <linux/atomic.h> 29#include <linux/atomic.h>
31#include <asm/time.h> 30#include <asm/time.h>
32#include <asm/io.h> 31#include <asm/io.h>
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 39849dd1b5b..a494fa57bdf 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -25,7 +25,6 @@
25#include <linux/root_dev.h> 25#include <linux/root_dev.h>
26#include <linux/of_platform.h> 26#include <linux/of_platform.h>
27 27
28#include <asm/system.h>
29#include <linux/atomic.h> 28#include <linux/atomic.h>
30#include <asm/time.h> 29#include <asm/time.h>
31#include <asm/io.h> 30#include <asm/io.h>
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 5828d8e97c3..553e793a4a9 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -25,7 +25,6 @@
25#include <linux/root_dev.h> 25#include <linux/root_dev.h>
26#include <linux/of_platform.h> 26#include <linux/of_platform.h>
27 27
28#include <asm/system.h>
29#include <linux/atomic.h> 28#include <linux/atomic.h>
30#include <asm/time.h> 29#include <asm/time.h>
31#include <asm/io.h> 30#include <asm/io.h>
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index ad8e4bcd7d5..1b1f6c8a1a1 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -33,7 +33,6 @@
33#include <linux/of_platform.h> 33#include <linux/of_platform.h>
34#include <linux/of_device.h> 34#include <linux/of_device.h>
35 35
36#include <asm/system.h>
37#include <linux/atomic.h> 36#include <linux/atomic.h>
38#include <asm/time.h> 37#include <asm/time.h>
39#include <asm/io.h> 38#include <asm/io.h>
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c
index 8a81d7640b1..26cb3e93472 100644
--- a/arch/powerpc/platforms/83xx/sbc834x.c
+++ b/arch/powerpc/platforms/83xx/sbc834x.c
@@ -27,7 +27,6 @@
27#include <linux/root_dev.h> 27#include <linux/root_dev.h>
28#include <linux/of_platform.h> 28#include <linux/of_platform.h>
29 29
30#include <asm/system.h>
31#include <linux/atomic.h> 30#include <linux/atomic.h>
32#include <asm/time.h> 31#include <asm/time.h>
33#include <asm/io.h> 32#include <asm/io.h>
diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index edf66870d97..1a046715e46 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -27,6 +27,7 @@
27#include <asm/io.h> 27#include <asm/io.h>
28#include <asm/time.h> 28#include <asm/time.h>
29#include <asm/mpc6xx.h> 29#include <asm/mpc6xx.h>
30#include <asm/switch_to.h>
30 31
31#include <sysdev/fsl_soc.h> 32#include <sysdev/fsl_soc.h>
32 33
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c
index df69e99e511..dd3617c531d 100644
--- a/arch/powerpc/platforms/85xx/corenet_ds.c
+++ b/arch/powerpc/platforms/85xx/corenet_ds.c
@@ -18,7 +18,6 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/memblock.h> 19#include <linux/memblock.h>
20 20
21#include <asm/system.h>
22#include <asm/time.h> 21#include <asm/time.h>
23#include <asm/machdep.h> 22#include <asm/machdep.h>
24#include <asm/pci-bridge.h> 23#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/ge_imp3a.c b/arch/powerpc/platforms/85xx/ge_imp3a.c
index d50056f424f..18014629416 100644
--- a/arch/powerpc/platforms/85xx/ge_imp3a.c
+++ b/arch/powerpc/platforms/85xx/ge_imp3a.c
@@ -24,7 +24,6 @@
24#include <linux/of_platform.h> 24#include <linux/of_platform.h>
25#include <linux/memblock.h> 25#include <linux/memblock.h>
26 26
27#include <asm/system.h>
28#include <asm/time.h> 27#include <asm/time.h>
29#include <asm/machdep.h> 28#include <asm/machdep.h>
30#include <asm/pci-bridge.h> 29#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c
index 60120e55da4..3dc1bda3ddc 100644
--- a/arch/powerpc/platforms/85xx/ksi8560.c
+++ b/arch/powerpc/platforms/85xx/ksi8560.c
@@ -20,7 +20,6 @@
20#include <linux/seq_file.h> 20#include <linux/seq_file.h>
21#include <linux/of_platform.h> 21#include <linux/of_platform.h>
22 22
23#include <asm/system.h>
24#include <asm/time.h> 23#include <asm/time.h>
25#include <asm/machdep.h> 24#include <asm/machdep.h>
26#include <asm/pci-bridge.h> 25#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c
index f58872688d8..585bd22b140 100644
--- a/arch/powerpc/platforms/85xx/mpc8536_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c
@@ -19,7 +19,6 @@
19#include <linux/of_platform.h> 19#include <linux/of_platform.h>
20#include <linux/memblock.h> 20#include <linux/memblock.h>
21 21
22#include <asm/system.h>
23#include <asm/time.h> 22#include <asm/time.h>
24#include <asm/machdep.h> 23#include <asm/machdep.h>
25#include <asm/pci-bridge.h> 24#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index d19f675cb36..29ee8fcd75a 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -19,7 +19,6 @@
19#include <linux/seq_file.h> 19#include <linux/seq_file.h>
20#include <linux/of_platform.h> 20#include <linux/of_platform.h>
21 21
22#include <asm/system.h>
23#include <asm/time.h> 22#include <asm/time.h>
24#include <asm/machdep.h> 23#include <asm/machdep.h>
25#include <asm/pci-bridge.h> 24#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index ab5f0bf1945..11156fb53d8 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -27,7 +27,6 @@
27#include <linux/fsl_devices.h> 27#include <linux/fsl_devices.h>
28#include <linux/of_platform.h> 28#include <linux/of_platform.h>
29 29
30#include <asm/system.h>
31#include <asm/pgtable.h> 30#include <asm/pgtable.h>
32#include <asm/page.h> 31#include <asm/page.h>
33#include <linux/atomic.h> 32#include <linux/atomic.h>
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 6e23e3e34bd..1fd91e9e0ff 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -22,7 +22,6 @@
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23#include <linux/memblock.h> 23#include <linux/memblock.h>
24 24
25#include <asm/system.h>
26#include <asm/time.h> 25#include <asm/time.h>
27#include <asm/machdep.h> 26#include <asm/machdep.h>
28#include <asm/pci-bridge.h> 27#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index f33662b46b8..3754ddc00af 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -35,7 +35,6 @@
35#include <linux/phy.h> 35#include <linux/phy.h>
36#include <linux/memblock.h> 36#include <linux/memblock.h>
37 37
38#include <asm/system.h>
39#include <linux/atomic.h> 38#include <linux/atomic.h>
40#include <asm/time.h> 39#include <asm/time.h>
41#include <asm/io.h> 40#include <asm/io.h>
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index db214cd4c82..9848f9e3985 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -18,7 +18,6 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/of_platform.h> 19#include <linux/of_platform.h>
20 20
21#include <asm/system.h>
22#include <asm/time.h> 21#include <asm/time.h>
23#include <asm/machdep.h> 22#include <asm/machdep.h>
24#include <asm/pci-bridge.h> 23#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c
index d8bd6563d9c..dbaf44354f0 100644
--- a/arch/powerpc/platforms/85xx/p1010rdb.c
+++ b/arch/powerpc/platforms/85xx/p1010rdb.c
@@ -16,7 +16,6 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/of_platform.h> 17#include <linux/of_platform.h>
18 18
19#include <asm/system.h>
20#include <asm/time.h> 19#include <asm/time.h>
21#include <asm/machdep.h> 20#include <asm/machdep.h>
22#include <asm/pci-bridge.h> 21#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/p1023_rds.c b/arch/powerpc/platforms/85xx/p1023_rds.c
index 6b07398e436..2990e8b13dc 100644
--- a/arch/powerpc/platforms/85xx/p1023_rds.c
+++ b/arch/powerpc/platforms/85xx/p1023_rds.c
@@ -22,7 +22,6 @@
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23#include <linux/of_device.h> 23#include <linux/of_device.h>
24 24
25#include <asm/system.h>
26#include <asm/time.h> 25#include <asm/time.h>
27#include <asm/machdep.h> 26#include <asm/machdep.h>
28#include <asm/pci-bridge.h> 27#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/p2041_rdb.c b/arch/powerpc/platforms/85xx/p2041_rdb.c
index eda6ed5683e..6541fa2630c 100644
--- a/arch/powerpc/platforms/85xx/p2041_rdb.c
+++ b/arch/powerpc/platforms/85xx/p2041_rdb.c
@@ -16,7 +16,6 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/phy.h> 17#include <linux/phy.h>
18 18
19#include <asm/system.h>
20#include <asm/time.h> 19#include <asm/time.h>
21#include <asm/machdep.h> 20#include <asm/machdep.h>
22#include <asm/pci-bridge.h> 21#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/p3041_ds.c b/arch/powerpc/platforms/85xx/p3041_ds.c
index 96d99a374dc..f238efa7589 100644
--- a/arch/powerpc/platforms/85xx/p3041_ds.c
+++ b/arch/powerpc/platforms/85xx/p3041_ds.c
@@ -18,7 +18,6 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/phy.h> 19#include <linux/phy.h>
20 20
21#include <asm/system.h>
22#include <asm/time.h> 21#include <asm/time.h>
23#include <asm/machdep.h> 22#include <asm/machdep.h>
24#include <asm/pci-bridge.h> 23#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/p4080_ds.c b/arch/powerpc/platforms/85xx/p4080_ds.c
index d1b21d7663e..c92417dc657 100644
--- a/arch/powerpc/platforms/85xx/p4080_ds.c
+++ b/arch/powerpc/platforms/85xx/p4080_ds.c
@@ -17,7 +17,6 @@
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19 19
20#include <asm/system.h>
21#include <asm/time.h> 20#include <asm/time.h>
22#include <asm/machdep.h> 21#include <asm/machdep.h>
23#include <asm/pci-bridge.h> 22#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/p5020_ds.c b/arch/powerpc/platforms/85xx/p5020_ds.c
index e8cba5004fd..17bef15a85e 100644
--- a/arch/powerpc/platforms/85xx/p5020_ds.c
+++ b/arch/powerpc/platforms/85xx/p5020_ds.c
@@ -18,7 +18,6 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/phy.h> 19#include <linux/phy.h>
20 20
21#include <asm/system.h>
22#include <asm/time.h> 21#include <asm/time.h>
23#include <asm/machdep.h> 22#include <asm/machdep.h>
24#include <asm/pci-bridge.h> 23#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index 1677b8a2267..cd3a66bdb54 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -30,7 +30,6 @@
30#include <linux/fsl_devices.h> 30#include <linux/fsl_devices.h>
31#include <linux/of_platform.h> 31#include <linux/of_platform.h>
32 32
33#include <asm/system.h>
34#include <asm/pgtable.h> 33#include <asm/pgtable.h>
35#include <asm/page.h> 34#include <asm/page.h>
36#include <linux/atomic.h> 35#include <linux/atomic.h>
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c
index 3c3bbcc2756..b1be632ede4 100644
--- a/arch/powerpc/platforms/85xx/sbc8560.c
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -21,7 +21,6 @@
21#include <linux/seq_file.h> 21#include <linux/seq_file.h>
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23 23
24#include <asm/system.h>
25#include <asm/time.h> 24#include <asm/time.h>
26#include <asm/machdep.h> 25#include <asm/machdep.h>
27#include <asm/pci-bridge.h> 26#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c
index b7191921775..b9c6daa07b6 100644
--- a/arch/powerpc/platforms/85xx/socrates.c
+++ b/arch/powerpc/platforms/85xx/socrates.c
@@ -29,7 +29,6 @@
29#include <linux/seq_file.h> 29#include <linux/seq_file.h>
30#include <linux/of_platform.h> 30#include <linux/of_platform.h>
31 31
32#include <asm/system.h>
33#include <asm/time.h> 32#include <asm/time.h>
34#include <asm/machdep.h> 33#include <asm/machdep.h>
35#include <asm/pci-bridge.h> 34#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c
index 27ca3a7b04a..e0508002b08 100644
--- a/arch/powerpc/platforms/85xx/stx_gp3.c
+++ b/arch/powerpc/platforms/85xx/stx_gp3.c
@@ -28,7 +28,6 @@
28#include <linux/seq_file.h> 28#include <linux/seq_file.h>
29#include <linux/of_platform.h> 29#include <linux/of_platform.h>
30 30
31#include <asm/system.h>
32#include <asm/time.h> 31#include <asm/time.h>
33#include <asm/machdep.h> 32#include <asm/machdep.h>
34#include <asm/pci-bridge.h> 33#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c
index d7504cefe01..4d786c25d3e 100644
--- a/arch/powerpc/platforms/85xx/tqm85xx.c
+++ b/arch/powerpc/platforms/85xx/tqm85xx.c
@@ -26,7 +26,6 @@
26#include <linux/seq_file.h> 26#include <linux/seq_file.h>
27#include <linux/of_platform.h> 27#include <linux/of_platform.h>
28 28
29#include <asm/system.h>
30#include <asm/time.h> 29#include <asm/time.h>
31#include <asm/machdep.h> 30#include <asm/machdep.h>
32#include <asm/pci-bridge.h> 31#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
index 503c21596c6..41c687550ea 100644
--- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c
+++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
@@ -21,7 +21,6 @@
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23 23
24#include <asm/system.h>
25#include <asm/time.h> 24#include <asm/time.h>
26#include <asm/machdep.h> 25#include <asm/machdep.h>
27#include <asm/pci-bridge.h> 26#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c
index ed58b6cfd60..1fca663f1b2 100644
--- a/arch/powerpc/platforms/86xx/gef_ppc9a.c
+++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
@@ -24,7 +24,6 @@
24#include <linux/seq_file.h> 24#include <linux/seq_file.h>
25#include <linux/of_platform.h> 25#include <linux/of_platform.h>
26 26
27#include <asm/system.h>
28#include <asm/time.h> 27#include <asm/time.h>
29#include <asm/machdep.h> 28#include <asm/machdep.h>
30#include <asm/pci-bridge.h> 29#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c b/arch/powerpc/platforms/86xx/gef_sbc310.c
index 710db69bd52..14e0e576bcb 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc310.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc310.c
@@ -24,7 +24,6 @@
24#include <linux/seq_file.h> 24#include <linux/seq_file.h>
25#include <linux/of_platform.h> 25#include <linux/of_platform.h>
26 26
27#include <asm/system.h>
28#include <asm/time.h> 27#include <asm/time.h>
29#include <asm/machdep.h> 28#include <asm/machdep.h>
30#include <asm/pci-bridge.h> 29#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index 4a13d2f4ac2..1638f43599f 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -24,7 +24,6 @@
24#include <linux/seq_file.h> 24#include <linux/seq_file.h>
25#include <linux/of_platform.h> 25#include <linux/of_platform.h>
26 26
27#include <asm/system.h>
28#include <asm/time.h> 27#include <asm/time.h>
29#include <asm/machdep.h> 28#include <asm/machdep.h>
30#include <asm/pci-bridge.h> 29#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
index 13fa9a6403e..bbc615206c6 100644
--- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
@@ -25,7 +25,6 @@
25#include <linux/seq_file.h> 25#include <linux/seq_file.h>
26#include <linux/of.h> 26#include <linux/of.h>
27 27
28#include <asm/system.h>
29#include <asm/time.h> 28#include <asm/time.h>
30#include <asm/machdep.h> 29#include <asm/machdep.h>
31#include <asm/pci-bridge.h> 30#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 569262ca499..3755e61d7ec 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -21,7 +21,6 @@
21#include <linux/of_platform.h> 21#include <linux/of_platform.h>
22#include <linux/memblock.h> 22#include <linux/memblock.h>
23 23
24#include <asm/system.h>
25#include <asm/time.h> 24#include <asm/time.h>
26#include <asm/machdep.h> 25#include <asm/machdep.h>
27#include <asm/pci-bridge.h> 26#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/86xx/pic.c b/arch/powerpc/platforms/86xx/pic.c
index 22cc3571ae1..9982f57c98b 100644
--- a/arch/powerpc/platforms/86xx/pic.c
+++ b/arch/powerpc/platforms/86xx/pic.c
@@ -12,7 +12,6 @@
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/of_platform.h> 13#include <linux/of_platform.h>
14 14
15#include <asm/system.h>
16#include <asm/mpic.h> 15#include <asm/mpic.h>
17#include <asm/i8259.h> 16#include <asm/i8259.h>
18 17
diff --git a/arch/powerpc/platforms/86xx/sbc8641d.c b/arch/powerpc/platforms/86xx/sbc8641d.c
index 51c8f331b67..e7007d0d949 100644
--- a/arch/powerpc/platforms/86xx/sbc8641d.c
+++ b/arch/powerpc/platforms/86xx/sbc8641d.c
@@ -21,7 +21,6 @@
21#include <linux/seq_file.h> 21#include <linux/seq_file.h>
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23 23
24#include <asm/system.h>
25#include <asm/time.h> 24#include <asm/time.h>
26#include <asm/machdep.h> 25#include <asm/machdep.h>
27#include <asm/pci-bridge.h> 26#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index caaec29796b..866feff83c9 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -19,7 +19,6 @@
19 19
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/machdep.h> 21#include <asm/machdep.h>
22#include <asm/system.h>
23#include <asm/time.h> 22#include <asm/time.h>
24#include <asm/8xx_immap.h> 23#include <asm/8xx_immap.h>
25#include <asm/cpm1.h> 24#include <asm/cpm1.h>
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 45ed6cdc131..5d98398c2f5 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -32,7 +32,6 @@
32#include <asm/machdep.h> 32#include <asm/machdep.h>
33#include <asm/page.h> 33#include <asm/page.h>
34#include <asm/processor.h> 34#include <asm/processor.h>
35#include <asm/system.h>
36#include <asm/time.h> 35#include <asm/time.h>
37#include <asm/mpc8xx.h> 36#include <asm/mpc8xx.h>
38#include <asm/8xx_immap.h> 37#include <asm/8xx_immap.h>
diff --git a/arch/powerpc/platforms/8xx/tqm8xx_setup.c b/arch/powerpc/platforms/8xx/tqm8xx_setup.c
index 528e00ddef3..8d21ab70e06 100644
--- a/arch/powerpc/platforms/8xx/tqm8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/tqm8xx_setup.c
@@ -35,7 +35,6 @@
35#include <asm/machdep.h> 35#include <asm/machdep.h>
36#include <asm/page.h> 36#include <asm/page.h>
37#include <asm/processor.h> 37#include <asm/processor.h>
38#include <asm/system.h>
39#include <asm/time.h> 38#include <asm/time.h>
40#include <asm/mpc8xx.h> 39#include <asm/mpc8xx.h>
41#include <asm/8xx_immap.h> 40#include <asm/8xx_immap.h>
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c
index 4a255cf8cd1..49a65e2dfc7 100644
--- a/arch/powerpc/platforms/cell/smp.c
+++ b/arch/powerpc/platforms/cell/smp.c
@@ -38,7 +38,6 @@
38#include <asm/machdep.h> 38#include <asm/machdep.h>
39#include <asm/cputable.h> 39#include <asm/cputable.h>
40#include <asm/firmware.h> 40#include <asm/firmware.h>
41#include <asm/system.h>
42#include <asm/rtas.h> 41#include <asm/rtas.h>
43#include <asm/cputhreads.h> 42#include <asm/cputhreads.h>
44 43
diff --git a/arch/powerpc/platforms/embedded6xx/c2k.c b/arch/powerpc/platforms/embedded6xx/c2k.c
index 8cab5731850..ebd3963fdf9 100644
--- a/arch/powerpc/platforms/embedded6xx/c2k.c
+++ b/arch/powerpc/platforms/embedded6xx/c2k.c
@@ -23,7 +23,6 @@
23 23
24#include <asm/machdep.h> 24#include <asm/machdep.h>
25#include <asm/prom.h> 25#include <asm/prom.h>
26#include <asm/system.h>
27#include <asm/time.h> 26#include <asm/time.h>
28 27
29#include <mm/mmu_decl.h> 28#include <mm/mmu_decl.h>
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c
index ab51b21b4bd..8c305c7c897 100644
--- a/arch/powerpc/platforms/embedded6xx/holly.c
+++ b/arch/powerpc/platforms/embedded6xx/holly.c
@@ -28,7 +28,6 @@
28#include <linux/of_platform.h> 28#include <linux/of_platform.h>
29#include <linux/module.h> 29#include <linux/module.h>
30 30
31#include <asm/system.h>
32#include <asm/time.h> 31#include <asm/time.h>
33#include <asm/machdep.h> 32#include <asm/machdep.h>
34#include <asm/prom.h> 33#include <asm/prom.h>
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index 74ccce36bae..beeaf4a173e 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -32,7 +32,6 @@
32#include <linux/tty.h> 32#include <linux/tty.h>
33#include <linux/serial_core.h> 33#include <linux/serial_core.h>
34 34
35#include <asm/system.h>
36#include <asm/time.h> 35#include <asm/time.h>
37#include <asm/machdep.h> 36#include <asm/machdep.h>
38#include <asm/prom.h> 37#include <asm/prom.h>
diff --git a/arch/powerpc/platforms/embedded6xx/prpmc2800.c b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
index 670035f49a6..d455f08bea5 100644
--- a/arch/powerpc/platforms/embedded6xx/prpmc2800.c
+++ b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
@@ -17,7 +17,6 @@
17 17
18#include <asm/machdep.h> 18#include <asm/machdep.h>
19#include <asm/prom.h> 19#include <asm/prom.h>
20#include <asm/system.h>
21#include <asm/time.h> 20#include <asm/time.h>
22 21
23#include <mm/mmu_decl.h> 22#include <mm/mmu_decl.h>
diff --git a/arch/powerpc/platforms/embedded6xx/storcenter.c b/arch/powerpc/platforms/embedded6xx/storcenter.c
index e0ed3c71d69..c458b60d14c 100644
--- a/arch/powerpc/platforms/embedded6xx/storcenter.c
+++ b/arch/powerpc/platforms/embedded6xx/storcenter.c
@@ -16,7 +16,6 @@
16#include <linux/initrd.h> 16#include <linux/initrd.h>
17#include <linux/of_platform.h> 17#include <linux/of_platform.h>
18 18
19#include <asm/system.h>
20#include <asm/time.h> 19#include <asm/time.h>
21#include <asm/prom.h> 20#include <asm/prom.h>
22#include <asm/mpic.h> 21#include <asm/mpic.h>
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c
index 8b0c2082a78..64fde058e54 100644
--- a/arch/powerpc/platforms/fsl_uli1575.c
+++ b/arch/powerpc/platforms/fsl_uli1575.c
@@ -15,7 +15,6 @@
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/mc146818rtc.h> 16#include <linux/mc146818rtc.h>
17 17
18#include <asm/system.h>
19#include <asm/pci-bridge.h> 18#include <asm/pci-bridge.h>
20 19
21#define ULI_PIRQA 0x08 20#define ULI_PIRQA 0x08
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 3b7545a51aa..cb1b0b35a0c 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -47,7 +47,6 @@
47#include <asm/processor.h> 47#include <asm/processor.h>
48#include <asm/sections.h> 48#include <asm/sections.h>
49#include <asm/prom.h> 49#include <asm/prom.h>
50#include <asm/system.h>
51#include <asm/pgtable.h> 50#include <asm/pgtable.h>
52#include <asm/io.h> 51#include <asm/io.h>
53#include <asm/pci-bridge.h> 52#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/maple/time.c b/arch/powerpc/platforms/maple/time.c
index eac569dee27..b4a369dac3a 100644
--- a/arch/powerpc/platforms/maple/time.c
+++ b/arch/powerpc/platforms/maple/time.c
@@ -27,7 +27,6 @@
27 27
28#include <asm/sections.h> 28#include <asm/sections.h>
29#include <asm/prom.h> 29#include <asm/prom.h>
30#include <asm/system.h>
31#include <asm/io.h> 30#include <asm/io.h>
32#include <asm/pgtable.h> 31#include <asm/pgtable.h>
33#include <asm/machdep.h> 32#include <asm/machdep.h>
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index e777ad471a4..2ed9212d7d5 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -32,13 +32,13 @@
32#include <linux/gfp.h> 32#include <linux/gfp.h>
33 33
34#include <asm/prom.h> 34#include <asm/prom.h>
35#include <asm/system.h>
36#include <asm/iommu.h> 35#include <asm/iommu.h>
37#include <asm/machdep.h> 36#include <asm/machdep.h>
38#include <asm/mpic.h> 37#include <asm/mpic.h>
39#include <asm/smp.h> 38#include <asm/smp.h>
40#include <asm/time.h> 39#include <asm/time.h>
41#include <asm/mmu.h> 40#include <asm/mmu.h>
41#include <asm/debug.h>
42 42
43#include <pcmcia/ss.h> 43#include <pcmcia/ss.h>
44#include <pcmcia/cistpl.h> 44#include <pcmcia/cistpl.h>
diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c
index 84d7fd9bcc6..3e91ef53811 100644
--- a/arch/powerpc/platforms/powermac/bootx_init.c
+++ b/arch/powerpc/platforms/powermac/bootx_init.c
@@ -19,6 +19,7 @@
19#include <asm/bootx.h> 19#include <asm/bootx.h>
20#include <asm/btext.h> 20#include <asm/btext.h>
21#include <asm/io.h> 21#include <asm/io.h>
22#include <asm/setup.h>
22 23
23#undef DEBUG 24#undef DEBUG
24#define SET_BOOT_BAT 25#define SET_BOOT_BAT
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c
index 1fc386a23f1..64171198535 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_32.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_32.c
@@ -33,9 +33,9 @@
33#include <asm/sections.h> 33#include <asm/sections.h>
34#include <asm/cputable.h> 34#include <asm/cputable.h>
35#include <asm/time.h> 35#include <asm/time.h>
36#include <asm/system.h>
37#include <asm/mpic.h> 36#include <asm/mpic.h>
38#include <asm/keylargo.h> 37#include <asm/keylargo.h>
38#include <asm/switch_to.h>
39 39
40/* WARNING !!! This will cause calibrate_delay() to be called, 40/* WARNING !!! This will cause calibrate_delay() to be called,
41 * but this is an __init function ! So you MUST go edit 41 * but this is an __init function ! So you MUST go edit
diff --git a/arch/powerpc/platforms/powermac/nvram.c b/arch/powerpc/platforms/powermac/nvram.c
index da18b26dcc6..014d06e6d46 100644
--- a/arch/powerpc/platforms/powermac/nvram.c
+++ b/arch/powerpc/platforms/powermac/nvram.c
@@ -23,7 +23,6 @@
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <asm/sections.h> 24#include <asm/sections.h>
25#include <asm/io.h> 25#include <asm/io.h>
26#include <asm/system.h>
27#include <asm/prom.h> 26#include <asm/prom.h>
28#include <asm/machdep.h> 27#include <asm/machdep.h>
29#include <asm/nvram.h> 28#include <asm/nvram.h>
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 970ea1de429..141f8899a63 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -57,7 +57,6 @@
57#include <asm/reg.h> 57#include <asm/reg.h>
58#include <asm/sections.h> 58#include <asm/sections.h>
59#include <asm/prom.h> 59#include <asm/prom.h>
60#include <asm/system.h>
61#include <asm/pgtable.h> 60#include <asm/pgtable.h>
62#include <asm/io.h> 61#include <asm/io.h>
63#include <asm/pci-bridge.h> 62#include <asm/pci-bridge.h>
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c
index 11c9fce43b5..8680bb69795 100644
--- a/arch/powerpc/platforms/powermac/time.c
+++ b/arch/powerpc/platforms/powermac/time.c
@@ -26,7 +26,6 @@
26 26
27#include <asm/sections.h> 27#include <asm/sections.h>
28#include <asm/prom.h> 28#include <asm/prom.h>
29#include <asm/system.h>
30#include <asm/io.h> 29#include <asm/io.h>
31#include <asm/pgtable.h> 30#include <asm/pgtable.h>
32#include <asm/machdep.h> 31#include <asm/machdep.h>
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index 17210c526c5..3ef46254c35 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -25,7 +25,6 @@
25#include <asm/machdep.h> 25#include <asm/machdep.h>
26#include <asm/cputable.h> 26#include <asm/cputable.h>
27#include <asm/firmware.h> 27#include <asm/firmware.h>
28#include <asm/system.h>
29#include <asm/rtas.h> 28#include <asm/rtas.h>
30#include <asm/vdso_datapage.h> 29#include <asm/vdso_datapage.h>
31#include <asm/cputhreads.h> 30#include <asm/cputhreads.h>
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index 8bd6ba54269..de2aea42170 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -29,6 +29,7 @@
29#include <asm/prom.h> 29#include <asm/prom.h>
30#include <asm/udbg.h> 30#include <asm/udbg.h>
31#include <asm/lv1call.h> 31#include <asm/lv1call.h>
32#include <asm/setup.h>
32 33
33#include "platform.h" 34#include "platform.h"
34 35
diff --git a/arch/powerpc/platforms/pseries/dtl.c b/arch/powerpc/platforms/pseries/dtl.c
index 0e865637006..a7648543c59 100644
--- a/arch/powerpc/platforms/pseries/dtl.c
+++ b/arch/powerpc/platforms/pseries/dtl.c
@@ -25,10 +25,10 @@
25#include <linux/debugfs.h> 25#include <linux/debugfs.h>
26#include <linux/spinlock.h> 26#include <linux/spinlock.h>
27#include <asm/smp.h> 27#include <asm/smp.h>
28#include <asm/system.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
30#include <asm/firmware.h> 29#include <asm/firmware.h>
31#include <asm/lppaca.h> 30#include <asm/lppaca.h>
31#include <asm/debug.h>
32 32
33#include "plpar_wrappers.h" 33#include "plpar_wrappers.h"
34 34
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index c986d08d080..64c97d8ac0c 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -23,7 +23,6 @@
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/sched.h> /* for idle_task_exit */ 24#include <linux/sched.h> /* for idle_task_exit */
25#include <linux/cpu.h> 25#include <linux/cpu.h>
26#include <asm/system.h>
27#include <asm/prom.h> 26#include <asm/prom.h>
28#include <asm/rtas.h> 27#include <asm/rtas.h>
29#include <asm/firmware.h> 28#include <asm/firmware.h>
diff --git a/arch/powerpc/platforms/pseries/processor_idle.c b/arch/powerpc/platforms/pseries/processor_idle.c
index a12e95af693..41a34bc4a9a 100644
--- a/arch/powerpc/platforms/pseries/processor_idle.c
+++ b/arch/powerpc/platforms/pseries/processor_idle.c
@@ -14,9 +14,9 @@
14 14
15#include <asm/paca.h> 15#include <asm/paca.h>
16#include <asm/reg.h> 16#include <asm/reg.h>
17#include <asm/system.h>
18#include <asm/machdep.h> 17#include <asm/machdep.h>
19#include <asm/firmware.h> 18#include <asm/firmware.h>
19#include <asm/runlatch.h>
20 20
21#include "plpar_wrappers.h" 21#include "plpar_wrappers.h"
22#include "pseries.h" 22#include "pseries.h"
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index eadba9521a3..e16bb8d4855 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -37,7 +37,6 @@
37#include <asm/machdep.h> 37#include <asm/machdep.h>
38#include <asm/cputable.h> 38#include <asm/cputable.h>
39#include <asm/firmware.h> 39#include <asm/firmware.h>
40#include <asm/system.h>
41#include <asm/rtas.h> 40#include <asm/rtas.h>
42#include <asm/pSeries_reconfig.h> 41#include <asm/pSeries_reconfig.h>
43#include <asm/mpic.h> 42#include <asm/mpic.h>
diff --git a/arch/powerpc/platforms/wsp/chroma.c b/arch/powerpc/platforms/wsp/chroma.c
index ca6fa26f6e6..8ef53bc2e70 100644
--- a/arch/powerpc/platforms/wsp/chroma.c
+++ b/arch/powerpc/platforms/wsp/chroma.c
@@ -17,7 +17,6 @@
17#include <linux/time.h> 17#include <linux/time.h>
18 18
19#include <asm/machdep.h> 19#include <asm/machdep.h>
20#include <asm/system.h>
21#include <asm/udbg.h> 20#include <asm/udbg.h>
22 21
23#include "ics.h" 22#include "ics.h"
diff --git a/arch/powerpc/platforms/wsp/psr2.c b/arch/powerpc/platforms/wsp/psr2.c
index 0c1ae06d0be..508ec8282b9 100644
--- a/arch/powerpc/platforms/wsp/psr2.c
+++ b/arch/powerpc/platforms/wsp/psr2.c
@@ -17,7 +17,6 @@
17#include <linux/time.h> 17#include <linux/time.h>
18 18
19#include <asm/machdep.h> 19#include <asm/machdep.h>
20#include <asm/system.h>
21#include <asm/udbg.h> 20#include <asm/udbg.h>
22 21
23#include "ics.h" 22#include "ics.h"
diff --git a/arch/powerpc/platforms/wsp/wsp_pci.c b/arch/powerpc/platforms/wsp/wsp_pci.c
index 763014cd1e6..1526551f9fe 100644
--- a/arch/powerpc/platforms/wsp/wsp_pci.c
+++ b/arch/powerpc/platforms/wsp/wsp_pci.c
@@ -27,6 +27,7 @@
27#include <asm/ppc-pci.h> 27#include <asm/ppc-pci.h>
28#include <asm/iommu.h> 28#include <asm/iommu.h>
29#include <asm/io-workarounds.h> 29#include <asm/io-workarounds.h>
30#include <asm/debug.h>
30 31
31#include "wsp.h" 32#include "wsp.h"
32#include "wsp_pci.h" 33#include "wsp_pci.h"
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index bf6c7cc0a6a..4dd534194ae 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -26,7 +26,6 @@
26 26
27#include <asm/udbg.h> 27#include <asm/udbg.h>
28#include <asm/io.h> 28#include <asm/io.h>
29#include <asm/system.h>
30#include <asm/rheap.h> 29#include <asm/rheap.h>
31#include <asm/cpm.h> 30#include <asm/cpm.h>
32 31
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index e8f385fbf54..c449dbd1c93 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -31,7 +31,6 @@
31#include <linux/fs_enet_pd.h> 31#include <linux/fs_enet_pd.h>
32#include <linux/fs_uart_pd.h> 32#include <linux/fs_uart_pd.h>
33 33
34#include <asm/system.h>
35#include <linux/atomic.h> 34#include <linux/atomic.h>
36#include <asm/io.h> 35#include <asm/io.h>
37#include <asm/irq.h> 36#include <asm/irq.h>
diff --git a/arch/powerpc/sysdev/msi_bitmap.c b/arch/powerpc/sysdev/msi_bitmap.c
index 5287e95cec3..0968b66b4cf 100644
--- a/arch/powerpc/sysdev/msi_bitmap.c
+++ b/arch/powerpc/sysdev/msi_bitmap.c
@@ -12,6 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/bitmap.h> 13#include <linux/bitmap.h>
14#include <asm/msi_bitmap.h> 14#include <asm/msi_bitmap.h>
15#include <asm/setup.h>
15 16
16int msi_bitmap_alloc_hwirqs(struct msi_bitmap *bmp, int num) 17int msi_bitmap_alloc_hwirqs(struct msi_bitmap *bmp, int num)
17{ 18{
diff --git a/arch/powerpc/sysdev/tsi108_dev.c b/arch/powerpc/sysdev/tsi108_dev.c
index 2370e1c6337..1fd0717ade0 100644
--- a/arch/powerpc/sysdev/tsi108_dev.c
+++ b/arch/powerpc/sysdev/tsi108_dev.c
@@ -22,7 +22,6 @@
22#include <linux/of_net.h> 22#include <linux/of_net.h>
23#include <asm/tsi108.h> 23#include <asm/tsi108.h>
24 24
25#include <asm/system.h>
26#include <linux/atomic.h> 25#include <linux/atomic.h>
27#include <asm/io.h> 26#include <asm/io.h>
28#include <asm/irq.h> 27#include <asm/irq.h>
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 68a9cbbab45..0f3ab06d222 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -41,6 +41,7 @@
41#include <asm/spu_priv1.h> 41#include <asm/spu_priv1.h>
42#include <asm/setjmp.h> 42#include <asm/setjmp.h>
43#include <asm/reg.h> 43#include <asm/reg.h>
44#include <asm/debug.h>
44 45
45#ifdef CONFIG_PPC64 46#ifdef CONFIG_PPC64
46#include <asm/hvcall.h> 47#include <asm/hvcall.h>
diff --git a/arch/s390/crypto/crypt_s390.h b/arch/s390/crypto/crypt_s390.h
index ffd1ac255f1..9178db6db0a 100644
--- a/arch/s390/crypto/crypt_s390.h
+++ b/arch/s390/crypto/crypt_s390.h
@@ -17,6 +17,7 @@
17#define _CRYPTO_ARCH_S390_CRYPT_S390_H 17#define _CRYPTO_ARCH_S390_CRYPT_S390_H
18 18
19#include <asm/errno.h> 19#include <asm/errno.h>
20#include <asm/facility.h>
20 21
21#define CRYPT_S390_OP_MASK 0xFF00 22#define CRYPT_S390_OP_MASK 0xFF00
22#define CRYPT_S390_FUNC_MASK 0x00FF 23#define CRYPT_S390_FUNC_MASK 0x00FF
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h
index 8517d2ae3b5..748347baecb 100644
--- a/arch/s390/include/asm/atomic.h
+++ b/arch/s390/include/asm/atomic.h
@@ -15,7 +15,7 @@
15 15
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <asm/system.h> 18#include <asm/cmpxchg.h>
19 19
20#define ATOMIC_INIT(i) { (i) } 20#define ATOMIC_INIT(i) { (i) }
21 21
diff --git a/arch/s390/include/asm/barrier.h b/arch/s390/include/asm/barrier.h
new file mode 100644
index 00000000000..451273ad4d3
--- /dev/null
+++ b/arch/s390/include/asm/barrier.h
@@ -0,0 +1,35 @@
1/*
2 * Copyright IBM Corp. 1999, 2009
3 *
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
6
7#ifndef __ASM_BARRIER_H
8#define __ASM_BARRIER_H
9
10/*
11 * Force strict CPU ordering.
12 * And yes, this is required on UP too when we're talking
13 * to devices.
14 *
15 * This is very similar to the ppc eieio/sync instruction in that is
16 * does a checkpoint syncronisation & makes sure that
17 * all memory ops have completed wrt other CPU's ( see 7-15 POP DJB ).
18 */
19
20#define eieio() asm volatile("bcr 15,0" : : : "memory")
21#define SYNC_OTHER_CORES(x) eieio()
22#define mb() eieio()
23#define rmb() eieio()
24#define wmb() eieio()
25#define read_barrier_depends() do { } while(0)
26#define smp_mb() mb()
27#define smp_rmb() rmb()
28#define smp_wmb() wmb()
29#define smp_read_barrier_depends() read_barrier_depends()
30#define smp_mb__before_clear_bit() smp_mb()
31#define smp_mb__after_clear_bit() smp_mb()
32
33#define set_mb(var, value) do { var = value; mb(); } while (0)
34
35#endif /* __ASM_BARRIER_H */
diff --git a/arch/s390/include/asm/ctl_reg.h b/arch/s390/include/asm/ctl_reg.h
new file mode 100644
index 00000000000..ecde9417d66
--- /dev/null
+++ b/arch/s390/include/asm/ctl_reg.h
@@ -0,0 +1,76 @@
1/*
2 * Copyright IBM Corp. 1999, 2009
3 *
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
6
7#ifndef __ASM_CTL_REG_H
8#define __ASM_CTL_REG_H
9
10#ifdef __s390x__
11
12#define __ctl_load(array, low, high) ({ \
13 typedef struct { char _[sizeof(array)]; } addrtype; \
14 asm volatile( \
15 " lctlg %1,%2,%0\n" \
16 : : "Q" (*(addrtype *)(&array)), \
17 "i" (low), "i" (high)); \
18 })
19
20#define __ctl_store(array, low, high) ({ \
21 typedef struct { char _[sizeof(array)]; } addrtype; \
22 asm volatile( \
23 " stctg %1,%2,%0\n" \
24 : "=Q" (*(addrtype *)(&array)) \
25 : "i" (low), "i" (high)); \
26 })
27
28#else /* __s390x__ */
29
30#define __ctl_load(array, low, high) ({ \
31 typedef struct { char _[sizeof(array)]; } addrtype; \
32 asm volatile( \
33 " lctl %1,%2,%0\n" \
34 : : "Q" (*(addrtype *)(&array)), \
35 "i" (low), "i" (high)); \
36})
37
38#define __ctl_store(array, low, high) ({ \
39 typedef struct { char _[sizeof(array)]; } addrtype; \
40 asm volatile( \
41 " stctl %1,%2,%0\n" \
42 : "=Q" (*(addrtype *)(&array)) \
43 : "i" (low), "i" (high)); \
44 })
45
46#endif /* __s390x__ */
47
48#define __ctl_set_bit(cr, bit) ({ \
49 unsigned long __dummy; \
50 __ctl_store(__dummy, cr, cr); \
51 __dummy |= 1UL << (bit); \
52 __ctl_load(__dummy, cr, cr); \
53})
54
55#define __ctl_clear_bit(cr, bit) ({ \
56 unsigned long __dummy; \
57 __ctl_store(__dummy, cr, cr); \
58 __dummy &= ~(1UL << (bit)); \
59 __ctl_load(__dummy, cr, cr); \
60})
61
62#ifdef CONFIG_SMP
63
64extern void smp_ctl_set_bit(int cr, int bit);
65extern void smp_ctl_clear_bit(int cr, int bit);
66#define ctl_set_bit(cr, bit) smp_ctl_set_bit(cr, bit)
67#define ctl_clear_bit(cr, bit) smp_ctl_clear_bit(cr, bit)
68
69#else
70
71#define ctl_set_bit(cr, bit) __ctl_set_bit(cr, bit)
72#define ctl_clear_bit(cr, bit) __ctl_clear_bit(cr, bit)
73
74#endif /* CONFIG_SMP */
75
76#endif /* __ASM_CTL_REG_H */
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
index 547f1a6a35d..c4ee39f7a4d 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
@@ -129,7 +129,6 @@ typedef s390_fp_regs compat_elf_fpregset_t;
129typedef s390_compat_regs compat_elf_gregset_t; 129typedef s390_compat_regs compat_elf_gregset_t;
130 130
131#include <linux/sched.h> /* for task_struct */ 131#include <linux/sched.h> /* for task_struct */
132#include <asm/system.h> /* for save_access_regs */
133#include <asm/mmu_context.h> 132#include <asm/mmu_context.h>
134 133
135#include <asm/vdso.h> 134#include <asm/vdso.h>
diff --git a/arch/s390/include/asm/exec.h b/arch/s390/include/asm/exec.h
new file mode 100644
index 00000000000..c4a93d6327f
--- /dev/null
+++ b/arch/s390/include/asm/exec.h
@@ -0,0 +1,12 @@
1/*
2 * Copyright IBM Corp. 1999, 2009
3 *
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
6
7#ifndef __ASM_EXEC_H
8#define __ASM_EXEC_H
9
10extern unsigned long arch_align_stack(unsigned long sp);
11
12#endif /* __ASM_EXEC_H */
diff --git a/arch/s390/include/asm/facility.h b/arch/s390/include/asm/facility.h
new file mode 100644
index 00000000000..1e5b27edc0c
--- /dev/null
+++ b/arch/s390/include/asm/facility.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright IBM Corp. 1999, 2009
3 *
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
6
7#ifndef __ASM_FACILITY_H
8#define __ASM_FACILITY_H
9
10#include <linux/string.h>
11#include <linux/preempt.h>
12#include <asm/lowcore.h>
13
14#define MAX_FACILITY_BIT (256*8) /* stfle_fac_list has 256 bytes */
15
16/*
17 * The test_facility function uses the bit odering where the MSB is bit 0.
18 * That makes it easier to query facility bits with the bit number as
19 * documented in the Principles of Operation.
20 */
21static inline int test_facility(unsigned long nr)
22{
23 unsigned char *ptr;
24
25 if (nr >= MAX_FACILITY_BIT)
26 return 0;
27 ptr = (unsigned char *) &S390_lowcore.stfle_fac_list + (nr >> 3);
28 return (*ptr & (0x80 >> (nr & 7))) != 0;
29}
30
31/**
32 * stfle - Store facility list extended
33 * @stfle_fac_list: array where facility list can be stored
34 * @size: size of passed in array in double words
35 */
36static inline void stfle(u64 *stfle_fac_list, int size)
37{
38 unsigned long nr;
39
40 preempt_disable();
41 S390_lowcore.stfl_fac_list = 0;
42 asm volatile(
43 " .insn s,0xb2b10000,0(0)\n" /* stfl */
44 "0:\n"
45 EX_TABLE(0b, 0b)
46 : "=m" (S390_lowcore.stfl_fac_list));
47 nr = 4; /* bytes stored by stfl */
48 memcpy(stfle_fac_list, &S390_lowcore.stfl_fac_list, 4);
49 if (S390_lowcore.stfl_fac_list & 0x01000000) {
50 /* More facility bits available with stfle */
51 register unsigned long reg0 asm("0") = size - 1;
52
53 asm volatile(".insn s,0xb2b00000,0(%1)" /* stfle */
54 : "+d" (reg0)
55 : "a" (stfle_fac_list)
56 : "memory", "cc");
57 nr = (reg0 + 1) * 8; /* # bytes stored by stfle */
58 }
59 memset((char *) stfle_fac_list + nr, 0, size * 8 - nr);
60 preempt_enable();
61}
62
63#endif /* __ASM_FACILITY_H */
diff --git a/arch/s390/include/asm/mmu.h b/arch/s390/include/asm/mmu.h
index 4506791adcd..1c7d6ce328b 100644
--- a/arch/s390/include/asm/mmu.h
+++ b/arch/s390/include/asm/mmu.h
@@ -21,4 +21,18 @@ typedef struct {
21 .context.pgtable_list = LIST_HEAD_INIT(name.context.pgtable_list), \ 21 .context.pgtable_list = LIST_HEAD_INIT(name.context.pgtable_list), \
22 .context.gmap_list = LIST_HEAD_INIT(name.context.gmap_list), 22 .context.gmap_list = LIST_HEAD_INIT(name.context.gmap_list),
23 23
24static inline int tprot(unsigned long addr)
25{
26 int rc = -EFAULT;
27
28 asm volatile(
29 " tprot 0(%1),0\n"
30 "0: ipm %0\n"
31 " srl %0,28\n"
32 "1:\n"
33 EX_TABLE(0b,1b)
34 : "+d" (rc) : "a" (addr) : "cc");
35 return rc;
36}
37
24#endif 38#endif
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h
index 5682f160ff8..5d09e405c54 100644
--- a/arch/s390/include/asm/mmu_context.h
+++ b/arch/s390/include/asm/mmu_context.h
@@ -12,6 +12,7 @@
12#include <asm/pgalloc.h> 12#include <asm/pgalloc.h>
13#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14#include <asm/tlbflush.h> 14#include <asm/tlbflush.h>
15#include <asm/ctl_reg.h>
15#include <asm-generic/mm_hooks.h> 16#include <asm-generic/mm_hooks.h>
16 17
17static inline int init_new_context(struct task_struct *tsk, 18static inline int init_new_context(struct task_struct *tsk,
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index d25843a6a91..d499b30ea48 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -14,6 +14,7 @@
14#define __ASM_S390_PROCESSOR_H 14#define __ASM_S390_PROCESSOR_H
15 15
16#include <linux/linkage.h> 16#include <linux/linkage.h>
17#include <linux/irqflags.h>
17#include <asm/cpu.h> 18#include <asm/cpu.h>
18#include <asm/page.h> 19#include <asm/page.h>
19#include <asm/ptrace.h> 20#include <asm/ptrace.h>
@@ -156,6 +157,14 @@ unsigned long get_wchan(struct task_struct *p);
156#define KSTK_EIP(tsk) (task_pt_regs(tsk)->psw.addr) 157#define KSTK_EIP(tsk) (task_pt_regs(tsk)->psw.addr)
157#define KSTK_ESP(tsk) (task_pt_regs(tsk)->gprs[15]) 158#define KSTK_ESP(tsk) (task_pt_regs(tsk)->gprs[15])
158 159
160static inline unsigned short stap(void)
161{
162 unsigned short cpu_address;
163
164 asm volatile("stap %0" : "=m" (cpu_address));
165 return cpu_address;
166}
167
159/* 168/*
160 * Give up the time slice of the virtual PU. 169 * Give up the time slice of the virtual PU.
161 */ 170 */
@@ -304,6 +313,21 @@ static inline void __noreturn disabled_wait(unsigned long code)
304} 313}
305 314
306/* 315/*
316 * Use to set psw mask except for the first byte which
317 * won't be changed by this function.
318 */
319static inline void
320__set_psw_mask(unsigned long mask)
321{
322 __load_psw_mask(mask | (arch_local_save_flags() & ~(-1UL >> 8)));
323}
324
325#define local_mcck_enable() \
326 __set_psw_mask(psw_kernel_bits | PSW_MASK_DAT | PSW_MASK_MCHECK)
327#define local_mcck_disable() \
328 __set_psw_mask(psw_kernel_bits | PSW_MASK_DAT)
329
330/*
307 * Basic Machine Check/Program Check Handler. 331 * Basic Machine Check/Program Check Handler.
308 */ 332 */
309 333
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h
index 097183c7040..b21e46e5d4b 100644
--- a/arch/s390/include/asm/setup.h
+++ b/arch/s390/include/asm/setup.h
@@ -140,6 +140,20 @@ extern char vmpoff_cmd[];
140#define NSS_NAME_SIZE 8 140#define NSS_NAME_SIZE 8
141extern char kernel_nss_name[]; 141extern char kernel_nss_name[];
142 142
143#ifdef CONFIG_PFAULT
144extern int pfault_init(void);
145extern void pfault_fini(void);
146#else /* CONFIG_PFAULT */
147#define pfault_init() ({-1;})
148#define pfault_fini() do { } while (0)
149#endif /* CONFIG_PFAULT */
150
151extern void cmma_init(void);
152
153extern void (*_machine_restart)(char *command);
154extern void (*_machine_halt)(void);
155extern void (*_machine_power_off)(void);
156
143#else /* __ASSEMBLY__ */ 157#else /* __ASSEMBLY__ */
144 158
145#ifndef __s390x__ 159#ifndef __s390x__
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h
index 797f7872968..c77c6de6f6c 100644
--- a/arch/s390/include/asm/smp.h
+++ b/arch/s390/include/asm/smp.h
@@ -9,7 +9,7 @@
9 9
10#ifdef CONFIG_SMP 10#ifdef CONFIG_SMP
11 11
12#include <asm/system.h> 12#include <asm/lowcore.h>
13 13
14#define raw_smp_processor_id() (S390_lowcore.cpu_nr) 14#define raw_smp_processor_id() (S390_lowcore.cpu_nr)
15 15
diff --git a/arch/s390/include/asm/switch_to.h b/arch/s390/include/asm/switch_to.h
new file mode 100644
index 00000000000..f223068b782
--- /dev/null
+++ b/arch/s390/include/asm/switch_to.h
@@ -0,0 +1,100 @@
1/*
2 * Copyright IBM Corp. 1999, 2009
3 *
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
6
7#ifndef __ASM_SWITCH_TO_H
8#define __ASM_SWITCH_TO_H
9
10#include <linux/thread_info.h>
11
12extern struct task_struct *__switch_to(void *, void *);
13extern void update_per_regs(struct task_struct *task);
14
15static inline void save_fp_regs(s390_fp_regs *fpregs)
16{
17 asm volatile(
18 " std 0,%O0+8(%R0)\n"
19 " std 2,%O0+24(%R0)\n"
20 " std 4,%O0+40(%R0)\n"
21 " std 6,%O0+56(%R0)"
22 : "=Q" (*fpregs) : "Q" (*fpregs));
23 if (!MACHINE_HAS_IEEE)
24 return;
25 asm volatile(
26 " stfpc %0\n"
27 " std 1,%O0+16(%R0)\n"
28 " std 3,%O0+32(%R0)\n"
29 " std 5,%O0+48(%R0)\n"
30 " std 7,%O0+64(%R0)\n"
31 " std 8,%O0+72(%R0)\n"
32 " std 9,%O0+80(%R0)\n"
33 " std 10,%O0+88(%R0)\n"
34 " std 11,%O0+96(%R0)\n"
35 " std 12,%O0+104(%R0)\n"
36 " std 13,%O0+112(%R0)\n"
37 " std 14,%O0+120(%R0)\n"
38 " std 15,%O0+128(%R0)\n"
39 : "=Q" (*fpregs) : "Q" (*fpregs));
40}
41
42static inline void restore_fp_regs(s390_fp_regs *fpregs)
43{
44 asm volatile(
45 " ld 0,%O0+8(%R0)\n"
46 " ld 2,%O0+24(%R0)\n"
47 " ld 4,%O0+40(%R0)\n"
48 " ld 6,%O0+56(%R0)"
49 : : "Q" (*fpregs));
50 if (!MACHINE_HAS_IEEE)
51 return;
52 asm volatile(
53 " lfpc %0\n"
54 " ld 1,%O0+16(%R0)\n"
55 " ld 3,%O0+32(%R0)\n"
56 " ld 5,%O0+48(%R0)\n"
57 " ld 7,%O0+64(%R0)\n"
58 " ld 8,%O0+72(%R0)\n"
59 " ld 9,%O0+80(%R0)\n"
60 " ld 10,%O0+88(%R0)\n"
61 " ld 11,%O0+96(%R0)\n"
62 " ld 12,%O0+104(%R0)\n"
63 " ld 13,%O0+112(%R0)\n"
64 " ld 14,%O0+120(%R0)\n"
65 " ld 15,%O0+128(%R0)\n"
66 : : "Q" (*fpregs));
67}
68
69static inline void save_access_regs(unsigned int *acrs)
70{
71 asm volatile("stam 0,15,%0" : "=Q" (*acrs));
72}
73
74static inline void restore_access_regs(unsigned int *acrs)
75{
76 asm volatile("lam 0,15,%0" : : "Q" (*acrs));
77}
78
79#define switch_to(prev,next,last) do { \
80 if (prev->mm) { \
81 save_fp_regs(&prev->thread.fp_regs); \
82 save_access_regs(&prev->thread.acrs[0]); \
83 } \
84 if (next->mm) { \
85 restore_fp_regs(&next->thread.fp_regs); \
86 restore_access_regs(&next->thread.acrs[0]); \
87 update_per_regs(next); \
88 } \
89 prev = __switch_to(prev,next); \
90} while (0)
91
92extern void account_vtime(struct task_struct *, struct task_struct *);
93extern void account_tick_vtime(struct task_struct *);
94
95#define finish_arch_switch(prev) do { \
96 set_fs(current->thread.mm_segment); \
97 account_vtime(prev, current); \
98} while (0)
99
100#endif /* __ASM_SWITCH_TO_H */
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h
deleted file mode 100644
index 2e0bb7f0f9b..00000000000
--- a/arch/s390/include/asm/system.h
+++ /dev/null
@@ -1,315 +0,0 @@
1/*
2 * Copyright IBM Corp. 1999, 2009
3 *
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
6
7#ifndef __ASM_SYSTEM_H
8#define __ASM_SYSTEM_H
9
10#include <linux/preempt.h>
11#include <linux/kernel.h>
12#include <linux/errno.h>
13#include <linux/string.h>
14#include <asm/types.h>
15#include <asm/ptrace.h>
16#include <asm/setup.h>
17#include <asm/processor.h>
18#include <asm/lowcore.h>
19#include <asm/cmpxchg.h>
20
21#ifdef __KERNEL__
22
23struct task_struct;
24
25extern struct task_struct *__switch_to(void *, void *);
26extern void update_per_regs(struct task_struct *task);
27
28static inline void save_fp_regs(s390_fp_regs *fpregs)
29{
30 asm volatile(
31 " std 0,%O0+8(%R0)\n"
32 " std 2,%O0+24(%R0)\n"
33 " std 4,%O0+40(%R0)\n"
34 " std 6,%O0+56(%R0)"
35 : "=Q" (*fpregs) : "Q" (*fpregs));
36 if (!MACHINE_HAS_IEEE)
37 return;
38 asm volatile(
39 " stfpc %0\n"
40 " std 1,%O0+16(%R0)\n"
41 " std 3,%O0+32(%R0)\n"
42 " std 5,%O0+48(%R0)\n"
43 " std 7,%O0+64(%R0)\n"
44 " std 8,%O0+72(%R0)\n"
45 " std 9,%O0+80(%R0)\n"
46 " std 10,%O0+88(%R0)\n"
47 " std 11,%O0+96(%R0)\n"
48 " std 12,%O0+104(%R0)\n"
49 " std 13,%O0+112(%R0)\n"
50 " std 14,%O0+120(%R0)\n"
51 " std 15,%O0+128(%R0)\n"
52 : "=Q" (*fpregs) : "Q" (*fpregs));
53}
54
55static inline void restore_fp_regs(s390_fp_regs *fpregs)
56{
57 asm volatile(
58 " ld 0,%O0+8(%R0)\n"
59 " ld 2,%O0+24(%R0)\n"
60 " ld 4,%O0+40(%R0)\n"
61 " ld 6,%O0+56(%R0)"
62 : : "Q" (*fpregs));
63 if (!MACHINE_HAS_IEEE)
64 return;
65 asm volatile(
66 " lfpc %0\n"
67 " ld 1,%O0+16(%R0)\n"
68 " ld 3,%O0+32(%R0)\n"
69 " ld 5,%O0+48(%R0)\n"
70 " ld 7,%O0+64(%R0)\n"
71 " ld 8,%O0+72(%R0)\n"
72 " ld 9,%O0+80(%R0)\n"
73 " ld 10,%O0+88(%R0)\n"
74 " ld 11,%O0+96(%R0)\n"
75 " ld 12,%O0+104(%R0)\n"
76 " ld 13,%O0+112(%R0)\n"
77 " ld 14,%O0+120(%R0)\n"
78 " ld 15,%O0+128(%R0)\n"
79 : : "Q" (*fpregs));
80}
81
82static inline void save_access_regs(unsigned int *acrs)
83{
84 asm volatile("stam 0,15,%0" : "=Q" (*acrs));
85}
86
87static inline void restore_access_regs(unsigned int *acrs)
88{
89 asm volatile("lam 0,15,%0" : : "Q" (*acrs));
90}
91
92#define switch_to(prev,next,last) do { \
93 if (prev->mm) { \
94 save_fp_regs(&prev->thread.fp_regs); \
95 save_access_regs(&prev->thread.acrs[0]); \
96 } \
97 if (next->mm) { \
98 restore_fp_regs(&next->thread.fp_regs); \
99 restore_access_regs(&next->thread.acrs[0]); \
100 update_per_regs(next); \
101 } \
102 prev = __switch_to(prev,next); \
103} while (0)
104
105extern void account_vtime(struct task_struct *, struct task_struct *);
106extern void account_tick_vtime(struct task_struct *);
107
108#ifdef CONFIG_PFAULT
109extern int pfault_init(void);
110extern void pfault_fini(void);
111#else /* CONFIG_PFAULT */
112#define pfault_init() ({-1;})
113#define pfault_fini() do { } while (0)
114#endif /* CONFIG_PFAULT */
115
116extern void cmma_init(void);
117extern int memcpy_real(void *, void *, size_t);
118extern void copy_to_absolute_zero(void *dest, void *src, size_t count);
119extern int copy_to_user_real(void __user *dest, void *src, size_t count);
120extern int copy_from_user_real(void *dest, void __user *src, size_t count);
121
122#define finish_arch_switch(prev) do { \
123 set_fs(current->thread.mm_segment); \
124 account_vtime(prev, current); \
125} while (0)
126
127#define nop() asm volatile("nop")
128
129/*
130 * Force strict CPU ordering.
131 * And yes, this is required on UP too when we're talking
132 * to devices.
133 *
134 * This is very similar to the ppc eieio/sync instruction in that is
135 * does a checkpoint syncronisation & makes sure that
136 * all memory ops have completed wrt other CPU's ( see 7-15 POP DJB ).
137 */
138
139#define eieio() asm volatile("bcr 15,0" : : : "memory")
140#define SYNC_OTHER_CORES(x) eieio()
141#define mb() eieio()
142#define rmb() eieio()
143#define wmb() eieio()
144#define read_barrier_depends() do { } while(0)
145#define smp_mb() mb()
146#define smp_rmb() rmb()
147#define smp_wmb() wmb()
148#define smp_read_barrier_depends() read_barrier_depends()
149#define smp_mb__before_clear_bit() smp_mb()
150#define smp_mb__after_clear_bit() smp_mb()
151
152
153#define set_mb(var, value) do { var = value; mb(); } while (0)
154
155#ifdef __s390x__
156
157#define __ctl_load(array, low, high) ({ \
158 typedef struct { char _[sizeof(array)]; } addrtype; \
159 asm volatile( \
160 " lctlg %1,%2,%0\n" \
161 : : "Q" (*(addrtype *)(&array)), \
162 "i" (low), "i" (high)); \
163 })
164
165#define __ctl_store(array, low, high) ({ \
166 typedef struct { char _[sizeof(array)]; } addrtype; \
167 asm volatile( \
168 " stctg %1,%2,%0\n" \
169 : "=Q" (*(addrtype *)(&array)) \
170 : "i" (low), "i" (high)); \
171 })
172
173#else /* __s390x__ */
174
175#define __ctl_load(array, low, high) ({ \
176 typedef struct { char _[sizeof(array)]; } addrtype; \
177 asm volatile( \
178 " lctl %1,%2,%0\n" \
179 : : "Q" (*(addrtype *)(&array)), \
180 "i" (low), "i" (high)); \
181})
182
183#define __ctl_store(array, low, high) ({ \
184 typedef struct { char _[sizeof(array)]; } addrtype; \
185 asm volatile( \
186 " stctl %1,%2,%0\n" \
187 : "=Q" (*(addrtype *)(&array)) \
188 : "i" (low), "i" (high)); \
189 })
190
191#endif /* __s390x__ */
192
193#define __ctl_set_bit(cr, bit) ({ \
194 unsigned long __dummy; \
195 __ctl_store(__dummy, cr, cr); \
196 __dummy |= 1UL << (bit); \
197 __ctl_load(__dummy, cr, cr); \
198})
199
200#define __ctl_clear_bit(cr, bit) ({ \
201 unsigned long __dummy; \
202 __ctl_store(__dummy, cr, cr); \
203 __dummy &= ~(1UL << (bit)); \
204 __ctl_load(__dummy, cr, cr); \
205})
206
207/*
208 * Use to set psw mask except for the first byte which
209 * won't be changed by this function.
210 */
211static inline void
212__set_psw_mask(unsigned long mask)
213{
214 __load_psw_mask(mask | (arch_local_save_flags() & ~(-1UL >> 8)));
215}
216
217#define local_mcck_enable() \
218 __set_psw_mask(psw_kernel_bits | PSW_MASK_DAT | PSW_MASK_MCHECK)
219#define local_mcck_disable() \
220 __set_psw_mask(psw_kernel_bits | PSW_MASK_DAT)
221
222#ifdef CONFIG_SMP
223
224extern void smp_ctl_set_bit(int cr, int bit);
225extern void smp_ctl_clear_bit(int cr, int bit);
226#define ctl_set_bit(cr, bit) smp_ctl_set_bit(cr, bit)
227#define ctl_clear_bit(cr, bit) smp_ctl_clear_bit(cr, bit)
228
229#else
230
231#define ctl_set_bit(cr, bit) __ctl_set_bit(cr, bit)
232#define ctl_clear_bit(cr, bit) __ctl_clear_bit(cr, bit)
233
234#endif /* CONFIG_SMP */
235
236#define MAX_FACILITY_BIT (256*8) /* stfle_fac_list has 256 bytes */
237
238/*
239 * The test_facility function uses the bit odering where the MSB is bit 0.
240 * That makes it easier to query facility bits with the bit number as
241 * documented in the Principles of Operation.
242 */
243static inline int test_facility(unsigned long nr)
244{
245 unsigned char *ptr;
246
247 if (nr >= MAX_FACILITY_BIT)
248 return 0;
249 ptr = (unsigned char *) &S390_lowcore.stfle_fac_list + (nr >> 3);
250 return (*ptr & (0x80 >> (nr & 7))) != 0;
251}
252
253/**
254 * stfle - Store facility list extended
255 * @stfle_fac_list: array where facility list can be stored
256 * @size: size of passed in array in double words
257 */
258static inline void stfle(u64 *stfle_fac_list, int size)
259{
260 unsigned long nr;
261
262 preempt_disable();
263 S390_lowcore.stfl_fac_list = 0;
264 asm volatile(
265 " .insn s,0xb2b10000,0(0)\n" /* stfl */
266 "0:\n"
267 EX_TABLE(0b, 0b)
268 : "=m" (S390_lowcore.stfl_fac_list));
269 nr = 4; /* bytes stored by stfl */
270 memcpy(stfle_fac_list, &S390_lowcore.stfl_fac_list, 4);
271 if (S390_lowcore.stfl_fac_list & 0x01000000) {
272 /* More facility bits available with stfle */
273 register unsigned long reg0 asm("0") = size - 1;
274
275 asm volatile(".insn s,0xb2b00000,0(%1)" /* stfle */
276 : "+d" (reg0)
277 : "a" (stfle_fac_list)
278 : "memory", "cc");
279 nr = (reg0 + 1) * 8; /* # bytes stored by stfle */
280 }
281 memset((char *) stfle_fac_list + nr, 0, size * 8 - nr);
282 preempt_enable();
283}
284
285static inline unsigned short stap(void)
286{
287 unsigned short cpu_address;
288
289 asm volatile("stap %0" : "=m" (cpu_address));
290 return cpu_address;
291}
292
293extern void (*_machine_restart)(char *command);
294extern void (*_machine_halt)(void);
295extern void (*_machine_power_off)(void);
296
297extern unsigned long arch_align_stack(unsigned long sp);
298
299static inline int tprot(unsigned long addr)
300{
301 int rc = -EFAULT;
302
303 asm volatile(
304 " tprot 0(%1),0\n"
305 "0: ipm %0\n"
306 " srl %0,28\n"
307 "1:\n"
308 EX_TABLE(0b,1b)
309 : "+d" (rc) : "a" (addr) : "cc");
310 return rc;
311}
312
313#endif /* __KERNEL__ */
314
315#endif
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h
index 2b23885e81e..8f2cada4f7c 100644
--- a/arch/s390/include/asm/uaccess.h
+++ b/arch/s390/include/asm/uaccess.h
@@ -16,6 +16,7 @@
16 */ 16 */
17#include <linux/sched.h> 17#include <linux/sched.h>
18#include <linux/errno.h> 18#include <linux/errno.h>
19#include <asm/ctl_reg.h>
19 20
20#define VERIFY_READ 0 21#define VERIFY_READ 0
21#define VERIFY_WRITE 1 22#define VERIFY_WRITE 1
@@ -375,4 +376,9 @@ clear_user(void __user *to, unsigned long n)
375 return n; 376 return n;
376} 377}
377 378
379extern int memcpy_real(void *, void *, size_t);
380extern void copy_to_absolute_zero(void *dest, void *src, size_t count);
381extern int copy_to_user_real(void __user *dest, void *src, size_t count);
382extern int copy_from_user_real(void *dest, void __user *src, size_t count);
383
378#endif /* __S390_UACCESS_H */ 384#endif /* __S390_UACCESS_H */
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index ed8c913db79..83e6edf5cf1 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -12,7 +12,6 @@
12#include <asm/timer.h> 12#include <asm/timer.h>
13#include <asm/vdso.h> 13#include <asm/vdso.h>
14#include <asm/pgtable.h> 14#include <asm/pgtable.h>
15#include <asm/system.h>
16 15
17/* 16/*
18 * Make sure that the compiler is new enough. We want a compiler that 17 * Make sure that the compiler is new enough. We want a compiler that
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index 53a82c8d50e..28040fd5e8a 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -27,6 +27,7 @@
27#include <asm/ucontext.h> 27#include <asm/ucontext.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/lowcore.h> 29#include <asm/lowcore.h>
30#include <asm/switch_to.h>
30#include "compat_linux.h" 31#include "compat_linux.h"
31#include "compat_ptrace.h" 32#include "compat_ptrace.h"
32#include "entry.h" 33#include "entry.h"
diff --git a/arch/s390/kernel/cpcmd.c b/arch/s390/kernel/cpcmd.c
index 3e8b8816f30..e3dd886e1b3 100644
--- a/arch/s390/kernel/cpcmd.c
+++ b/arch/s390/kernel/cpcmd.c
@@ -18,7 +18,6 @@
18#include <linux/string.h> 18#include <linux/string.h>
19#include <asm/ebcdic.h> 19#include <asm/ebcdic.h>
20#include <asm/cpcmd.h> 20#include <asm/cpcmd.h>
21#include <asm/system.h>
22#include <asm/io.h> 21#include <asm/io.h>
23 22
24static DEFINE_SPINLOCK(cpcmd_lock); 23static DEFINE_SPINLOCK(cpcmd_lock);
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
index e2f847599c8..3221c6fca8b 100644
--- a/arch/s390/kernel/dis.c
+++ b/arch/s390/kernel/dis.c
@@ -24,7 +24,6 @@
24#include <linux/kprobes.h> 24#include <linux/kprobes.h>
25#include <linux/kdebug.h> 25#include <linux/kdebug.h>
26 26
27#include <asm/system.h>
28#include <asm/uaccess.h> 27#include <asm/uaccess.h>
29#include <asm/io.h> 28#include <asm/io.h>
30#include <linux/atomic.h> 29#include <linux/atomic.h>
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 578eb4e6d15..9475e682727 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -29,7 +29,7 @@
29#include <asm/sysinfo.h> 29#include <asm/sysinfo.h>
30#include <asm/cpcmd.h> 30#include <asm/cpcmd.h>
31#include <asm/sclp.h> 31#include <asm/sclp.h>
32#include <asm/system.h> 32#include <asm/facility.h>
33#include "entry.h" 33#include "entry.h"
34 34
35/* 35/*
diff --git a/arch/s390/kernel/lgr.c b/arch/s390/kernel/lgr.c
index 8431b92ca3a..ac39e7a731f 100644
--- a/arch/s390/kernel/lgr.c
+++ b/arch/s390/kernel/lgr.c
@@ -10,7 +10,6 @@
10#include <linux/slab.h> 10#include <linux/slab.h>
11#include <asm/sysinfo.h> 11#include <asm/sysinfo.h>
12#include <asm/ebcdic.h> 12#include <asm/ebcdic.h>
13#include <asm/system.h>
14#include <asm/debug.h> 13#include <asm/debug.h>
15#include <asm/ipl.h> 14#include <asm/ipl.h>
16 15
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index 0f8cdf1268d..bdad47d5447 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -19,7 +19,6 @@
19#include <asm/setup.h> 19#include <asm/setup.h>
20#include <asm/pgtable.h> 20#include <asm/pgtable.h>
21#include <asm/pgalloc.h> 21#include <asm/pgalloc.h>
22#include <asm/system.h>
23#include <asm/smp.h> 22#include <asm/smp.h>
24#include <asm/reset.h> 23#include <asm/reset.h>
25#include <asm/ipl.h> 24#include <asm/ipl.h>
diff --git a/arch/s390/kernel/os_info.c b/arch/s390/kernel/os_info.c
index bbe522672e0..e8d6c214d49 100644
--- a/arch/s390/kernel/os_info.c
+++ b/arch/s390/kernel/os_info.c
@@ -12,7 +12,6 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <asm/checksum.h> 13#include <asm/checksum.h>
14#include <asm/lowcore.h> 14#include <asm/lowcore.h>
15#include <asm/system.h>
16#include <asm/os_info.h> 15#include <asm/os_info.h>
17 16
18/* 17/*
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 3732e4c09cb..60055cefdd0 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -23,13 +23,13 @@
23#include <linux/kprobes.h> 23#include <linux/kprobes.h>
24#include <linux/random.h> 24#include <linux/random.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <asm/system.h>
27#include <asm/io.h> 26#include <asm/io.h>
28#include <asm/processor.h> 27#include <asm/processor.h>
29#include <asm/irq.h> 28#include <asm/irq.h>
30#include <asm/timer.h> 29#include <asm/timer.h>
31#include <asm/nmi.h> 30#include <asm/nmi.h>
32#include <asm/smp.h> 31#include <asm/smp.h>
32#include <asm/switch_to.h>
33#include "entry.h" 33#include "entry.h"
34 34
35asmlinkage void ret_from_fork(void) asm ("ret_from_fork"); 35asmlinkage void ret_from_fork(void) asm ("ret_from_fork");
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 61f95489d70..02f300fbf07 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -26,9 +26,9 @@
26#include <asm/page.h> 26#include <asm/page.h>
27#include <asm/pgtable.h> 27#include <asm/pgtable.h>
28#include <asm/pgalloc.h> 28#include <asm/pgalloc.h>
29#include <asm/system.h>
30#include <asm/uaccess.h> 29#include <asm/uaccess.h>
31#include <asm/unistd.h> 30#include <asm/unistd.h>
31#include <asm/switch_to.h>
32#include "entry.h" 32#include "entry.h"
33 33
34#ifdef CONFIG_COMPAT 34#ifdef CONFIG_COMPAT
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 38e751278bf..1581ea2e027 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -50,7 +50,6 @@
50 50
51#include <asm/ipl.h> 51#include <asm/ipl.h>
52#include <asm/uaccess.h> 52#include <asm/uaccess.h>
53#include <asm/system.h>
54#include <asm/smp.h> 53#include <asm/smp.h>
55#include <asm/mmu_context.h> 54#include <asm/mmu_context.h>
56#include <asm/cpcmd.h> 55#include <asm/cpcmd.h>
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index f29f5ef400e..f7582b27f60 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -30,6 +30,7 @@
30#include <asm/ucontext.h> 30#include <asm/ucontext.h>
31#include <asm/uaccess.h> 31#include <asm/uaccess.h>
32#include <asm/lowcore.h> 32#include <asm/lowcore.h>
33#include <asm/switch_to.h>
33#include "entry.h" 34#include "entry.h"
34 35
35#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 36#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
diff --git a/arch/s390/kernel/suspend.c b/arch/s390/kernel/suspend.c
index 47df775c844..aa1494d0e38 100644
--- a/arch/s390/kernel/suspend.c
+++ b/arch/s390/kernel/suspend.c
@@ -9,7 +9,7 @@
9#include <linux/pfn.h> 9#include <linux/pfn.h>
10#include <linux/suspend.h> 10#include <linux/suspend.h>
11#include <linux/mm.h> 11#include <linux/mm.h>
12#include <asm/system.h> 12#include <asm/ctl_reg.h>
13 13
14/* 14/*
15 * References to section boundaries 15 * References to section boundaries
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index cd6ebe12c48..77cdf4234eb 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -33,7 +33,6 @@
33#include <linux/kprobes.h> 33#include <linux/kprobes.h>
34#include <linux/bug.h> 34#include <linux/bug.h>
35#include <linux/utsname.h> 35#include <linux/utsname.h>
36#include <asm/system.h>
37#include <asm/uaccess.h> 36#include <asm/uaccess.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <linux/atomic.h> 38#include <linux/atomic.h>
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index 9c80138206b..ea5590fdca3 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -25,12 +25,12 @@
25#include <linux/compat.h> 25#include <linux/compat.h>
26#include <asm/asm-offsets.h> 26#include <asm/asm-offsets.h>
27#include <asm/pgtable.h> 27#include <asm/pgtable.h>
28#include <asm/system.h>
29#include <asm/processor.h> 28#include <asm/processor.h>
30#include <asm/mmu.h> 29#include <asm/mmu.h>
31#include <asm/mmu_context.h> 30#include <asm/mmu_context.h>
32#include <asm/sections.h> 31#include <asm/sections.h>
33#include <asm/vdso.h> 32#include <asm/vdso.h>
33#include <asm/facility.h>
34 34
35#if defined(CONFIG_32BIT) || defined(CONFIG_COMPAT) 35#if defined(CONFIG_32BIT) || defined(CONFIG_COMPAT)
36extern char vdso32_start, vdso32_end; 36extern char vdso32_start, vdso32_end;
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 17ad69d596f..217ce44395a 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -27,7 +27,7 @@
27#include <asm/lowcore.h> 27#include <asm/lowcore.h>
28#include <asm/pgtable.h> 28#include <asm/pgtable.h>
29#include <asm/nmi.h> 29#include <asm/nmi.h>
30#include <asm/system.h> 30#include <asm/switch_to.h>
31#include "kvm-s390.h" 31#include "kvm-s390.h"
32#include "gaccess.h" 32#include "gaccess.h"
33 33
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index b17c42df61c..46ef3fd0663 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -32,10 +32,10 @@
32#include <linux/uaccess.h> 32#include <linux/uaccess.h>
33#include <linux/hugetlb.h> 33#include <linux/hugetlb.h>
34#include <asm/asm-offsets.h> 34#include <asm/asm-offsets.h>
35#include <asm/system.h>
36#include <asm/pgtable.h> 35#include <asm/pgtable.h>
37#include <asm/irq.h> 36#include <asm/irq.h>
38#include <asm/mmu_context.h> 37#include <asm/mmu_context.h>
38#include <asm/facility.h>
39#include "../kernel/entry.h" 39#include "../kernel/entry.h"
40 40
41#ifndef CONFIG_64BIT 41#ifndef CONFIG_64BIT
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 50236610de8..2bea0605856 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -29,7 +29,6 @@
29#include <linux/export.h> 29#include <linux/export.h>
30#include <linux/gfp.h> 30#include <linux/gfp.h>
31#include <asm/processor.h> 31#include <asm/processor.h>
32#include <asm/system.h>
33#include <asm/uaccess.h> 32#include <asm/uaccess.h>
34#include <asm/pgtable.h> 33#include <asm/pgtable.h>
35#include <asm/pgalloc.h> 34#include <asm/pgalloc.h>
@@ -38,6 +37,7 @@
38#include <asm/tlb.h> 37#include <asm/tlb.h>
39#include <asm/tlbflush.h> 38#include <asm/tlbflush.h>
40#include <asm/sections.h> 39#include <asm/sections.h>
40#include <asm/ctl_reg.h>
41 41
42pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE))); 42pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
43 43
diff --git a/arch/s390/mm/maccess.c b/arch/s390/mm/maccess.c
index 1cb8427bedf..7bb15fcca75 100644
--- a/arch/s390/mm/maccess.c
+++ b/arch/s390/mm/maccess.c
@@ -12,7 +12,7 @@
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/gfp.h> 14#include <linux/gfp.h>
15#include <asm/system.h> 15#include <asm/ctl_reg.h>
16 16
17/* 17/*
18 * This function writes to kernel memory bypassing DAT and possible 18 * This function writes to kernel memory bypassing DAT and possible
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 51b0738e13d..373adf69b01 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -18,7 +18,6 @@
18#include <linux/rcupdate.h> 18#include <linux/rcupdate.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20 20
21#include <asm/system.h>
22#include <asm/pgtable.h> 21#include <asm/pgtable.h>
23#include <asm/pgalloc.h> 22#include <asm/pgalloc.h>
24#include <asm/tlb.h> 23#include <asm/tlb.h>
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c
index f097d516d8c..c6646de07bf 100644
--- a/arch/s390/oprofile/hwsampler.c
+++ b/arch/s390/oprofile/hwsampler.c
@@ -17,6 +17,8 @@
17#include <linux/semaphore.h> 17#include <linux/semaphore.h>
18#include <linux/oom.h> 18#include <linux/oom.h>
19#include <linux/oprofile.h> 19#include <linux/oprofile.h>
20
21#include <asm/facility.h>
20#include <asm/cpu_mf.h> 22#include <asm/cpu_mf.h>
21#include <asm/irq.h> 23#include <asm/irq.h>
22 24
diff --git a/arch/score/include/asm/atomic.h b/arch/score/include/asm/atomic.h
index 84eb8ddf9f3..edf33dbded1 100644
--- a/arch/score/include/asm/atomic.h
+++ b/arch/score/include/asm/atomic.h
@@ -1,6 +1,7 @@
1#ifndef _ASM_SCORE_ATOMIC_H 1#ifndef _ASM_SCORE_ATOMIC_H
2#define _ASM_SCORE_ATOMIC_H 2#define _ASM_SCORE_ATOMIC_H
3 3
4#include <asm/cmpxchg.h>
4#include <asm-generic/atomic.h> 5#include <asm-generic/atomic.h>
5 6
6#endif /* _ASM_SCORE_ATOMIC_H */ 7#endif /* _ASM_SCORE_ATOMIC_H */
diff --git a/arch/score/include/asm/barrier.h b/arch/score/include/asm/barrier.h
new file mode 100644
index 00000000000..0eacb6471e6
--- /dev/null
+++ b/arch/score/include/asm/barrier.h
@@ -0,0 +1,16 @@
1#ifndef _ASM_SCORE_BARRIER_H
2#define _ASM_SCORE_BARRIER_H
3
4#define mb() barrier()
5#define rmb() barrier()
6#define wmb() barrier()
7#define smp_mb() barrier()
8#define smp_rmb() barrier()
9#define smp_wmb() barrier()
10
11#define read_barrier_depends() do {} while (0)
12#define smp_read_barrier_depends() do {} while (0)
13
14#define set_mb(var, value) do {var = value; wmb(); } while (0)
15
16#endif /* _ASM_SCORE_BARRIER_H */
diff --git a/arch/score/include/asm/bitops.h b/arch/score/include/asm/bitops.h
index 2763b050fca..a304096b189 100644
--- a/arch/score/include/asm/bitops.h
+++ b/arch/score/include/asm/bitops.h
@@ -2,7 +2,6 @@
2#define _ASM_SCORE_BITOPS_H 2#define _ASM_SCORE_BITOPS_H
3 3
4#include <asm/byteorder.h> /* swab32 */ 4#include <asm/byteorder.h> /* swab32 */
5#include <asm/system.h> /* save_flags */
6 5
7/* 6/*
8 * clear_bit() doesn't provide any barrier for the compiler. 7 * clear_bit() doesn't provide any barrier for the compiler.
diff --git a/arch/score/include/asm/bug.h b/arch/score/include/asm/bug.h
index bb76a330bcf..fd7164af1f0 100644
--- a/arch/score/include/asm/bug.h
+++ b/arch/score/include/asm/bug.h
@@ -3,4 +3,15 @@
3 3
4#include <asm-generic/bug.h> 4#include <asm-generic/bug.h>
5 5
6struct pt_regs;
7extern void __die(const char *, struct pt_regs *, const char *,
8 const char *, unsigned long) __attribute__((noreturn));
9extern void __die_if_kernel(const char *, struct pt_regs *, const char *,
10 const char *, unsigned long);
11
12#define die(msg, regs) \
13 __die(msg, regs, __FILE__ ":", __func__, __LINE__)
14#define die_if_kernel(msg, regs) \
15 __die_if_kernel(msg, regs, __FILE__ ":", __func__, __LINE__)
16
6#endif /* _ASM_SCORE_BUG_H */ 17#endif /* _ASM_SCORE_BUG_H */
diff --git a/arch/score/include/asm/cmpxchg.h b/arch/score/include/asm/cmpxchg.h
new file mode 100644
index 00000000000..f384839c3ee
--- /dev/null
+++ b/arch/score/include/asm/cmpxchg.h
@@ -0,0 +1,49 @@
1#ifndef _ASM_SCORE_CMPXCHG_H
2#define _ASM_SCORE_CMPXCHG_H
3
4#include <linux/irqflags.h>
5
6struct __xchg_dummy { unsigned long a[100]; };
7#define __xg(x) ((struct __xchg_dummy *)(x))
8
9static inline
10unsigned long __xchg(volatile unsigned long *m, unsigned long val)
11{
12 unsigned long retval;
13 unsigned long flags;
14
15 local_irq_save(flags);
16 retval = *m;
17 *m = val;
18 local_irq_restore(flags);
19 return retval;
20}
21
22#define xchg(ptr, v) \
23 ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr), \
24 (unsigned long)(v)))
25
26static inline unsigned long __cmpxchg(volatile unsigned long *m,
27 unsigned long old, unsigned long new)
28{
29 unsigned long retval;
30 unsigned long flags;
31
32 local_irq_save(flags);
33 retval = *m;
34 if (retval == old)
35 *m = new;
36 local_irq_restore(flags);
37 return retval;
38}
39
40#define cmpxchg(ptr, o, n) \
41 ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
42 (unsigned long)(o), \
43 (unsigned long)(n)))
44
45#define __HAVE_ARCH_CMPXCHG 1
46
47#include <asm-generic/cmpxchg-local.h>
48
49#endif /* _ASM_SCORE_CMPXCHG_H */
diff --git a/arch/score/include/asm/exec.h b/arch/score/include/asm/exec.h
new file mode 100644
index 00000000000..f9f3cd59c86
--- /dev/null
+++ b/arch/score/include/asm/exec.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_SCORE_EXEC_H
2#define _ASM_SCORE_EXEC_H
3
4extern unsigned long arch_align_stack(unsigned long sp);
5
6#endif /* _ASM_SCORE_EXEC_H */
diff --git a/arch/score/include/asm/switch_to.h b/arch/score/include/asm/switch_to.h
new file mode 100644
index 00000000000..031756b59ec
--- /dev/null
+++ b/arch/score/include/asm/switch_to.h
@@ -0,0 +1,13 @@
1#ifndef _ASM_SCORE_SWITCH_TO_H
2#define _ASM_SCORE_SWITCH_TO_H
3
4extern void *resume(void *last, void *next, void *next_ti);
5
6#define switch_to(prev, next, last) \
7do { \
8 (last) = resume(prev, next, task_thread_info(next)); \
9} while (0)
10
11#define finish_arch_switch(prev) do {} while (0)
12
13#endif /* _ASM_SCORE_SWITCH_TO_H */
diff --git a/arch/score/include/asm/system.h b/arch/score/include/asm/system.h
deleted file mode 100644
index 589d5c7e171..00000000000
--- a/arch/score/include/asm/system.h
+++ /dev/null
@@ -1,90 +0,0 @@
1#ifndef _ASM_SCORE_SYSTEM_H
2#define _ASM_SCORE_SYSTEM_H
3
4#include <linux/types.h>
5#include <linux/irqflags.h>
6
7struct pt_regs;
8struct task_struct;
9
10extern void *resume(void *last, void *next, void *next_ti);
11
12#define switch_to(prev, next, last) \
13do { \
14 (last) = resume(prev, next, task_thread_info(next)); \
15} while (0)
16
17#define finish_arch_switch(prev) do {} while (0)
18
19typedef void (*vi_handler_t)(void);
20extern unsigned long arch_align_stack(unsigned long sp);
21
22#define mb() barrier()
23#define rmb() barrier()
24#define wmb() barrier()
25#define smp_mb() barrier()
26#define smp_rmb() barrier()
27#define smp_wmb() barrier()
28
29#define read_barrier_depends() do {} while (0)
30#define smp_read_barrier_depends() do {} while (0)
31
32#define set_mb(var, value) do {var = value; wmb(); } while (0)
33
34#define __HAVE_ARCH_CMPXCHG 1
35
36#include <asm-generic/cmpxchg-local.h>
37
38#ifndef __ASSEMBLY__
39
40struct __xchg_dummy { unsigned long a[100]; };
41#define __xg(x) ((struct __xchg_dummy *)(x))
42
43static inline
44unsigned long __xchg(volatile unsigned long *m, unsigned long val)
45{
46 unsigned long retval;
47 unsigned long flags;
48
49 local_irq_save(flags);
50 retval = *m;
51 *m = val;
52 local_irq_restore(flags);
53 return retval;
54}
55
56#define xchg(ptr, v) \
57 ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr), \
58 (unsigned long)(v)))
59
60static inline unsigned long __cmpxchg(volatile unsigned long *m,
61 unsigned long old, unsigned long new)
62{
63 unsigned long retval;
64 unsigned long flags;
65
66 local_irq_save(flags);
67 retval = *m;
68 if (retval == old)
69 *m = new;
70 local_irq_restore(flags);
71 return retval;
72}
73
74#define cmpxchg(ptr, o, n) \
75 ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
76 (unsigned long)(o), \
77 (unsigned long)(n)))
78
79extern void __die(const char *, struct pt_regs *, const char *,
80 const char *, unsigned long) __attribute__((noreturn));
81extern void __die_if_kernel(const char *, struct pt_regs *, const char *,
82 const char *, unsigned long);
83
84#define die(msg, regs) \
85 __die(msg, regs, __FILE__ ":", __func__, __LINE__)
86#define die_if_kernel(msg, regs) \
87 __die_if_kernel(msg, regs, __FILE__ ":", __func__, __LINE__)
88
89#endif /* !__ASSEMBLY__ */
90#endif /* _ASM_SCORE_SYSTEM_H */
diff --git a/arch/sh/boards/mach-microdev/irq.c b/arch/sh/boards/mach-microdev/irq.c
index 4fb00369f0e..9a8aff33961 100644
--- a/arch/sh/boards/mach-microdev/irq.c
+++ b/arch/sh/boards/mach-microdev/irq.c
@@ -12,7 +12,6 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/irq.h> 13#include <linux/irq.h>
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <asm/system.h>
16#include <asm/io.h> 15#include <asm/io.h>
17#include <mach/microdev.h> 16#include <mach/microdev.h>
18 17
diff --git a/arch/sh/include/asm/atomic-irq.h b/arch/sh/include/asm/atomic-irq.h
index 467d9415a32..9f7c56609e5 100644
--- a/arch/sh/include/asm/atomic-irq.h
+++ b/arch/sh/include/asm/atomic-irq.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_SH_ATOMIC_IRQ_H 1#ifndef __ASM_SH_ATOMIC_IRQ_H
2#define __ASM_SH_ATOMIC_IRQ_H 2#define __ASM_SH_ATOMIC_IRQ_H
3 3
4#include <linux/irqflags.h>
5
4/* 6/*
5 * To get proper branch prediction for the main line, we must branch 7 * To get proper branch prediction for the main line, we must branch
6 * forward to code at the end of this object's .text section, then 8 * forward to code at the end of this object's .text section, then
diff --git a/arch/sh/include/asm/atomic.h b/arch/sh/include/asm/atomic.h
index 63a27dbc952..37f2f4a5523 100644
--- a/arch/sh/include/asm/atomic.h
+++ b/arch/sh/include/asm/atomic.h
@@ -9,7 +9,7 @@
9 9
10#include <linux/compiler.h> 10#include <linux/compiler.h>
11#include <linux/types.h> 11#include <linux/types.h>
12#include <asm/system.h> 12#include <asm/cmpxchg.h>
13 13
14#define ATOMIC_INIT(i) ( (atomic_t) { (i) } ) 14#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
15 15
diff --git a/arch/sh/include/asm/auxvec.h b/arch/sh/include/asm/auxvec.h
index 483effd65e0..8bcc51af936 100644
--- a/arch/sh/include/asm/auxvec.h
+++ b/arch/sh/include/asm/auxvec.h
@@ -33,4 +33,6 @@
33#define AT_L1D_CACHESHAPE 35 33#define AT_L1D_CACHESHAPE 35
34#define AT_L2_CACHESHAPE 36 34#define AT_L2_CACHESHAPE 36
35 35
36#define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */
37
36#endif /* __ASM_SH_AUXVEC_H */ 38#endif /* __ASM_SH_AUXVEC_H */
diff --git a/arch/sh/include/asm/barrier.h b/arch/sh/include/asm/barrier.h
new file mode 100644
index 00000000000..72c103dae30
--- /dev/null
+++ b/arch/sh/include/asm/barrier.h
@@ -0,0 +1,54 @@
1/*
2 * Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima
3 * Copyright (C) 2002 Paul Mundt
4 */
5#ifndef __ASM_SH_BARRIER_H
6#define __ASM_SH_BARRIER_H
7
8#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
9#include <asm/cache_insns.h>
10#endif
11
12/*
13 * A brief note on ctrl_barrier(), the control register write barrier.
14 *
15 * Legacy SH cores typically require a sequence of 8 nops after
16 * modification of a control register in order for the changes to take
17 * effect. On newer cores (like the sh4a and sh5) this is accomplished
18 * with icbi.
19 *
20 * Also note that on sh4a in the icbi case we can forego a synco for the
21 * write barrier, as it's not necessary for control registers.
22 *
23 * Historically we have only done this type of barrier for the MMUCR, but
24 * it's also necessary for the CCR, so we make it generic here instead.
25 */
26#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
27#define mb() __asm__ __volatile__ ("synco": : :"memory")
28#define rmb() mb()
29#define wmb() __asm__ __volatile__ ("synco": : :"memory")
30#define ctrl_barrier() __icbi(PAGE_OFFSET)
31#define read_barrier_depends() do { } while(0)
32#else
33#define mb() __asm__ __volatile__ ("": : :"memory")
34#define rmb() mb()
35#define wmb() __asm__ __volatile__ ("": : :"memory")
36#define ctrl_barrier() __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop")
37#define read_barrier_depends() do { } while(0)
38#endif
39
40#ifdef CONFIG_SMP
41#define smp_mb() mb()
42#define smp_rmb() rmb()
43#define smp_wmb() wmb()
44#define smp_read_barrier_depends() read_barrier_depends()
45#else
46#define smp_mb() barrier()
47#define smp_rmb() barrier()
48#define smp_wmb() barrier()
49#define smp_read_barrier_depends() do { } while(0)
50#endif
51
52#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
53
54#endif /* __ASM_SH_BARRIER_H */
diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h
index 90fa3e48b4d..ea8706d94f0 100644
--- a/arch/sh/include/asm/bitops.h
+++ b/arch/sh/include/asm/bitops.h
@@ -7,7 +7,6 @@
7#error only <linux/bitops.h> can be included directly 7#error only <linux/bitops.h> can be included directly
8#endif 8#endif
9 9
10#include <asm/system.h>
11/* For __swab32 */ 10/* For __swab32 */
12#include <asm/byteorder.h> 11#include <asm/byteorder.h>
13 12
diff --git a/arch/sh/include/asm/bl_bit.h b/arch/sh/include/asm/bl_bit.h
new file mode 100644
index 00000000000..45e6b9fc37a
--- /dev/null
+++ b/arch/sh/include/asm/bl_bit.h
@@ -0,0 +1,10 @@
1#ifndef __ASM_SH_BL_BIT_H
2#define __ASM_SH_BL_BIT_H
3
4#ifdef CONFIG_SUPERH32
5# include "bl_bit_32.h"
6#else
7# include "bl_bit_64.h"
8#endif
9
10#endif /* __ASM_SH_BL_BIT_H */
diff --git a/arch/sh/include/asm/bl_bit_32.h b/arch/sh/include/asm/bl_bit_32.h
new file mode 100644
index 00000000000..fd21eee6214
--- /dev/null
+++ b/arch/sh/include/asm/bl_bit_32.h
@@ -0,0 +1,33 @@
1#ifndef __ASM_SH_BL_BIT_32_H
2#define __ASM_SH_BL_BIT_32_H
3
4static inline void set_bl_bit(void)
5{
6 unsigned long __dummy0, __dummy1;
7
8 __asm__ __volatile__ (
9 "stc sr, %0\n\t"
10 "or %2, %0\n\t"
11 "and %3, %0\n\t"
12 "ldc %0, sr\n\t"
13 : "=&r" (__dummy0), "=r" (__dummy1)
14 : "r" (0x10000000), "r" (0xffffff0f)
15 : "memory"
16 );
17}
18
19static inline void clear_bl_bit(void)
20{
21 unsigned long __dummy0, __dummy1;
22
23 __asm__ __volatile__ (
24 "stc sr, %0\n\t"
25 "and %2, %0\n\t"
26 "ldc %0, sr\n\t"
27 : "=&r" (__dummy0), "=r" (__dummy1)
28 : "1" (~0x10000000)
29 : "memory"
30 );
31}
32
33#endif /* __ASM_SH_BL_BIT_32_H */
diff --git a/arch/sh/include/asm/bl_bit_64.h b/arch/sh/include/asm/bl_bit_64.h
new file mode 100644
index 00000000000..6cc8711af43
--- /dev/null
+++ b/arch/sh/include/asm/bl_bit_64.h
@@ -0,0 +1,40 @@
1/*
2 * Copyright (C) 2000, 2001 Paolo Alberelli
3 * Copyright (C) 2003 Paul Mundt
4 * Copyright (C) 2004 Richard Curnow
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
8 * for more details.
9 */
10#ifndef __ASM_SH_BL_BIT_64_H
11#define __ASM_SH_BL_BIT_64_H
12
13#include <asm/processor.h>
14
15#define SR_BL_LL 0x0000000010000000LL
16
17static inline void set_bl_bit(void)
18{
19 unsigned long long __dummy0, __dummy1 = SR_BL_LL;
20
21 __asm__ __volatile__("getcon " __SR ", %0\n\t"
22 "or %0, %1, %0\n\t"
23 "putcon %0, " __SR "\n\t"
24 : "=&r" (__dummy0)
25 : "r" (__dummy1));
26
27}
28
29static inline void clear_bl_bit(void)
30{
31 unsigned long long __dummy0, __dummy1 = ~SR_BL_LL;
32
33 __asm__ __volatile__("getcon " __SR ", %0\n\t"
34 "and %0, %1, %0\n\t"
35 "putcon %0, " __SR "\n\t"
36 : "=&r" (__dummy0)
37 : "r" (__dummy1));
38}
39
40#endif /* __ASM_SH_BL_BIT_64_H */
diff --git a/arch/sh/include/asm/bug.h b/arch/sh/include/asm/bug.h
index 6323f864d11..2b87d86bfc4 100644
--- a/arch/sh/include/asm/bug.h
+++ b/arch/sh/include/asm/bug.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_SH_BUG_H 1#ifndef __ASM_SH_BUG_H
2#define __ASM_SH_BUG_H 2#define __ASM_SH_BUG_H
3 3
4#include <linux/linkage.h>
5
4#define TRAPA_BUG_OPCODE 0xc33e /* trapa #0x3e */ 6#define TRAPA_BUG_OPCODE 0xc33e /* trapa #0x3e */
5#define BUGFLAG_UNWINDER (1 << 1) 7#define BUGFLAG_UNWINDER (1 << 1)
6 8
@@ -107,4 +109,7 @@ do { \
107 109
108#include <asm-generic/bug.h> 110#include <asm-generic/bug.h>
109 111
112struct pt_regs;
113extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn));
114
110#endif /* __ASM_SH_BUG_H */ 115#endif /* __ASM_SH_BUG_H */
diff --git a/arch/sh/include/asm/cache_insns.h b/arch/sh/include/asm/cache_insns.h
new file mode 100644
index 00000000000..d25fbe53090
--- /dev/null
+++ b/arch/sh/include/asm/cache_insns.h
@@ -0,0 +1,11 @@
1#ifndef __ASM_SH_CACHE_INSNS_H
2#define __ASM_SH_CACHE_INSNS_H
3
4
5#ifdef CONFIG_SUPERH32
6# include "cache_insns_32.h"
7#else
8# include "cache_insns_64.h"
9#endif
10
11#endif /* __ASM_SH_CACHE_INSNS_H */
diff --git a/arch/sh/include/asm/cache_insns_32.h b/arch/sh/include/asm/cache_insns_32.h
new file mode 100644
index 00000000000..b92fe541609
--- /dev/null
+++ b/arch/sh/include/asm/cache_insns_32.h
@@ -0,0 +1,21 @@
1#ifndef __ASM_SH_CACHE_INSNS_32_H
2#define __ASM_SH_CACHE_INSNS_32_H
3
4#include <linux/types.h>
5
6#if defined(CONFIG_CPU_SH4A)
7#define __icbi(addr) __asm__ __volatile__ ( "icbi @%0\n\t" : : "r" (addr))
8#else
9#define __icbi(addr) mb()
10#endif
11
12#define __ocbp(addr) __asm__ __volatile__ ( "ocbp @%0\n\t" : : "r" (addr))
13#define __ocbi(addr) __asm__ __volatile__ ( "ocbi @%0\n\t" : : "r" (addr))
14#define __ocbwb(addr) __asm__ __volatile__ ( "ocbwb @%0\n\t" : : "r" (addr))
15
16static inline reg_size_t register_align(void *val)
17{
18 return (unsigned long)(signed long)val;
19}
20
21#endif /* __ASM_SH_CACHE_INSNS_32_H */
diff --git a/arch/sh/include/asm/cache_insns_64.h b/arch/sh/include/asm/cache_insns_64.h
new file mode 100644
index 00000000000..70b6357eaf1
--- /dev/null
+++ b/arch/sh/include/asm/cache_insns_64.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright (C) 2000, 2001 Paolo Alberelli
3 * Copyright (C) 2003 Paul Mundt
4 * Copyright (C) 2004 Richard Curnow
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
8 * for more details.
9 */
10#ifndef __ASM_SH_CACHE_INSNS_64_H
11#define __ASM_SH_CACHE_INSNS_64_H
12
13#define __icbi(addr) __asm__ __volatile__ ( "icbi %0, 0\n\t" : : "r" (addr))
14#define __ocbp(addr) __asm__ __volatile__ ( "ocbp %0, 0\n\t" : : "r" (addr))
15#define __ocbi(addr) __asm__ __volatile__ ( "ocbi %0, 0\n\t" : : "r" (addr))
16#define __ocbwb(addr) __asm__ __volatile__ ( "ocbwb %0, 0\n\t" : : "r" (addr))
17
18static inline reg_size_t register_align(void *val)
19{
20 return (unsigned long long)(signed long long)(signed long)val;
21}
22
23#endif /* __ASM_SH_CACHE_INSNS_64_H */
diff --git a/arch/sh/include/asm/cmpxchg-irq.h b/arch/sh/include/asm/cmpxchg-irq.h
index 43049ec0554..bd11f630414 100644
--- a/arch/sh/include/asm/cmpxchg-irq.h
+++ b/arch/sh/include/asm/cmpxchg-irq.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_SH_CMPXCHG_IRQ_H 1#ifndef __ASM_SH_CMPXCHG_IRQ_H
2#define __ASM_SH_CMPXCHG_IRQ_H 2#define __ASM_SH_CMPXCHG_IRQ_H
3 3
4#include <linux/irqflags.h>
5
4static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val) 6static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
5{ 7{
6 unsigned long flags, retval; 8 unsigned long flags, retval;
diff --git a/arch/sh/include/asm/cmpxchg.h b/arch/sh/include/asm/cmpxchg.h
new file mode 100644
index 00000000000..f6bd1406b89
--- /dev/null
+++ b/arch/sh/include/asm/cmpxchg.h
@@ -0,0 +1,70 @@
1#ifndef __ASM_SH_CMPXCHG_H
2#define __ASM_SH_CMPXCHG_H
3
4/*
5 * Atomic operations that C can't guarantee us. Useful for
6 * resource counting etc..
7 */
8
9#include <linux/compiler.h>
10#include <linux/types.h>
11
12#if defined(CONFIG_GUSA_RB)
13#include <asm/cmpxchg-grb.h>
14#elif defined(CONFIG_CPU_SH4A)
15#include <asm/cmpxchg-llsc.h>
16#else
17#include <asm/cmpxchg-irq.h>
18#endif
19
20extern void __xchg_called_with_bad_pointer(void);
21
22#define __xchg(ptr, x, size) \
23({ \
24 unsigned long __xchg__res; \
25 volatile void *__xchg_ptr = (ptr); \
26 switch (size) { \
27 case 4: \
28 __xchg__res = xchg_u32(__xchg_ptr, x); \
29 break; \
30 case 1: \
31 __xchg__res = xchg_u8(__xchg_ptr, x); \
32 break; \
33 default: \
34 __xchg_called_with_bad_pointer(); \
35 __xchg__res = x; \
36 break; \
37 } \
38 \
39 __xchg__res; \
40})
41
42#define xchg(ptr,x) \
43 ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))
44
45/* This function doesn't exist, so you'll get a linker error
46 * if something tries to do an invalid cmpxchg(). */
47extern void __cmpxchg_called_with_bad_pointer(void);
48
49#define __HAVE_ARCH_CMPXCHG 1
50
51static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
52 unsigned long new, int size)
53{
54 switch (size) {
55 case 4:
56 return __cmpxchg_u32(ptr, old, new);
57 }
58 __cmpxchg_called_with_bad_pointer();
59 return old;
60}
61
62#define cmpxchg(ptr,o,n) \
63 ({ \
64 __typeof__(*(ptr)) _o_ = (o); \
65 __typeof__(*(ptr)) _n_ = (n); \
66 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
67 (unsigned long)_n_, sizeof(*(ptr))); \
68 })
69
70#endif /* __ASM_SH_CMPXCHG_H */
diff --git a/arch/sh/include/asm/exec.h b/arch/sh/include/asm/exec.h
new file mode 100644
index 00000000000..69486a9497f
--- /dev/null
+++ b/arch/sh/include/asm/exec.h
@@ -0,0 +1,10 @@
1/*
2 * Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima
3 * Copyright (C) 2002 Paul Mundt
4 */
5#ifndef __ASM_SH_EXEC_H
6#define __ASM_SH_EXEC_H
7
8#define arch_align_stack(x) (x)
9
10#endif /* __ASM_SH_EXEC_H */
diff --git a/arch/sh/include/asm/futex-irq.h b/arch/sh/include/asm/futex-irq.h
index 6cb9f193a95..63d33129ea2 100644
--- a/arch/sh/include/asm/futex-irq.h
+++ b/arch/sh/include/asm/futex-irq.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SH_FUTEX_IRQ_H 1#ifndef __ASM_SH_FUTEX_IRQ_H
2#define __ASM_SH_FUTEX_IRQ_H 2#define __ASM_SH_FUTEX_IRQ_H
3 3
4#include <asm/system.h>
5 4
6static inline int atomic_futex_op_xchg_set(int oparg, u32 __user *uaddr, 5static inline int atomic_futex_op_xchg_set(int oparg, u32 __user *uaddr,
7 int *oldval) 6 int *oldval)
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index 28c5aa58bb4..35fc8b077cb 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -14,7 +14,6 @@
14 */ 14 */
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <asm/cache.h> 16#include <asm/cache.h>
17#include <asm/system.h>
18#include <asm/addrspace.h> 17#include <asm/addrspace.h>
19#include <asm/machvec.h> 18#include <asm/machvec.h>
20#include <asm/pgtable.h> 19#include <asm/pgtable.h>
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
index 9c7bdfcaebb..a229c393826 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -101,6 +101,10 @@ extern struct sh_cpuinfo cpu_data[];
101#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") 101#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory")
102#define cpu_relax() barrier() 102#define cpu_relax() barrier()
103 103
104void default_idle(void);
105void cpu_idle_wait(void);
106void stop_this_cpu(void *);
107
104/* Forward decl */ 108/* Forward decl */
105struct seq_operations; 109struct seq_operations;
106struct task_struct; 110struct task_struct;
@@ -161,6 +165,17 @@ int vsyscall_init(void);
161#define vsyscall_init() do { } while (0) 165#define vsyscall_init() do { } while (0)
162#endif 166#endif
163 167
168/*
169 * SH-2A has both 16 and 32-bit opcodes, do lame encoding checks.
170 */
171#ifdef CONFIG_CPU_SH2A
172extern unsigned int instruction_size(unsigned int insn);
173#elif defined(CONFIG_SUPERH32)
174#define instruction_size(insn) (2)
175#else
176#define instruction_size(insn) (4)
177#endif
178
164#endif /* __ASSEMBLY__ */ 179#endif /* __ASSEMBLY__ */
165 180
166#ifdef CONFIG_SUPERH32 181#ifdef CONFIG_SUPERH32
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h
index 2d3679b2447..c7b7e1ed194 100644
--- a/arch/sh/include/asm/ptrace.h
+++ b/arch/sh/include/asm/ptrace.h
@@ -37,7 +37,6 @@
37#include <linux/thread_info.h> 37#include <linux/thread_info.h>
38#include <asm/addrspace.h> 38#include <asm/addrspace.h>
39#include <asm/page.h> 39#include <asm/page.h>
40#include <asm/system.h>
41 40
42#define user_mode(regs) (((regs)->sr & 0x40000000)==0) 41#define user_mode(regs) (((regs)->sr & 0x40000000)==0)
43#define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15]) 42#define kernel_stack_pointer(_regs) ((unsigned long)(_regs)->regs[15])
diff --git a/arch/sh/include/asm/setup.h b/arch/sh/include/asm/setup.h
index 01fa17a3d75..465a22df8fd 100644
--- a/arch/sh/include/asm/setup.h
+++ b/arch/sh/include/asm/setup.h
@@ -20,6 +20,7 @@
20 20
21void sh_mv_setup(void); 21void sh_mv_setup(void);
22void check_for_initrd(void); 22void check_for_initrd(void);
23void per_cpu_trap_init(void);
23 24
24#endif /* __KERNEL__ */ 25#endif /* __KERNEL__ */
25 26
diff --git a/arch/sh/include/asm/switch_to.h b/arch/sh/include/asm/switch_to.h
new file mode 100644
index 00000000000..62b1941813e
--- /dev/null
+++ b/arch/sh/include/asm/switch_to.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright (C) 2000, 2001 Paolo Alberelli
3 * Copyright (C) 2003 Paul Mundt
4 * Copyright (C) 2004 Richard Curnow
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
8 * for more details.
9 */
10#ifndef __ASM_SH_SWITCH_TO_H
11#define __ASM_SH_SWITCH_TO_H
12
13#ifdef CONFIG_SUPERH32
14# include "switch_to_32.h"
15#else
16# include "switch_to_64.h"
17#endif
18
19#endif /* __ASM_SH_SWITCH_TO_H */
diff --git a/arch/sh/include/asm/system_32.h b/arch/sh/include/asm/switch_to_32.h
index a4ad1cd9bc4..0c065513e7a 100644
--- a/arch/sh/include/asm/system_32.h
+++ b/arch/sh/include/asm/switch_to_32.h
@@ -1,8 +1,5 @@
1#ifndef __ASM_SH_SYSTEM_32_H 1#ifndef __ASM_SH_SWITCH_TO_32_H
2#define __ASM_SH_SYSTEM_32_H 2#define __ASM_SH_SWITCH_TO_32_H
3
4#include <linux/types.h>
5#include <asm/mmu.h>
6 3
7#ifdef CONFIG_SH_DSP 4#ifdef CONFIG_SH_DSP
8 5
@@ -32,7 +29,6 @@ do { \
32 : : "r" (__ts2)); \ 29 : : "r" (__ts2)); \
33} while (0) 30} while (0)
34 31
35
36#define __save_dsp(tsk) \ 32#define __save_dsp(tsk) \
37do { \ 33do { \
38 register u32 *__ts2 __asm__ ("r2") = \ 34 register u32 *__ts2 __asm__ ("r2") = \
@@ -64,16 +60,6 @@ do { \
64#define __restore_dsp(tsk) do { } while (0) 60#define __restore_dsp(tsk) do { } while (0)
65#endif 61#endif
66 62
67#if defined(CONFIG_CPU_SH4A)
68#define __icbi(addr) __asm__ __volatile__ ( "icbi @%0\n\t" : : "r" (addr))
69#else
70#define __icbi(addr) mb()
71#endif
72
73#define __ocbp(addr) __asm__ __volatile__ ( "ocbp @%0\n\t" : : "r" (addr))
74#define __ocbi(addr) __asm__ __volatile__ ( "ocbi @%0\n\t" : : "r" (addr))
75#define __ocbwb(addr) __asm__ __volatile__ ( "ocbwb @%0\n\t" : : "r" (addr))
76
77struct task_struct *__switch_to(struct task_struct *prev, 63struct task_struct *__switch_to(struct task_struct *prev,
78 struct task_struct *next); 64 struct task_struct *next);
79 65
@@ -145,92 +131,4 @@ do { \
145 __restore_dsp(prev); \ 131 __restore_dsp(prev); \
146} while (0) 132} while (0)
147 133
148#ifdef CONFIG_CPU_HAS_SR_RB 134#endif /* __ASM_SH_SWITCH_TO_32_H */
149#define lookup_exception_vector() \
150({ \
151 unsigned long _vec; \
152 \
153 __asm__ __volatile__ ( \
154 "stc r2_bank, %0\n\t" \
155 : "=r" (_vec) \
156 ); \
157 \
158 _vec; \
159})
160#else
161#define lookup_exception_vector() \
162({ \
163 unsigned long _vec; \
164 __asm__ __volatile__ ( \
165 "mov r4, %0\n\t" \
166 : "=r" (_vec) \
167 ); \
168 \
169 _vec; \
170})
171#endif
172
173static inline reg_size_t register_align(void *val)
174{
175 return (unsigned long)(signed long)val;
176}
177
178int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
179 struct mem_access *ma, int, unsigned long address);
180
181static inline void trigger_address_error(void)
182{
183 __asm__ __volatile__ (
184 "ldc %0, sr\n\t"
185 "mov.l @%1, %0"
186 :
187 : "r" (0x10000000), "r" (0x80000001)
188 );
189}
190
191asmlinkage void do_address_error(struct pt_regs *regs,
192 unsigned long writeaccess,
193 unsigned long address);
194asmlinkage void do_divide_error(unsigned long r4, unsigned long r5,
195 unsigned long r6, unsigned long r7,
196 struct pt_regs __regs);
197asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5,
198 unsigned long r6, unsigned long r7,
199 struct pt_regs __regs);
200asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5,
201 unsigned long r6, unsigned long r7,
202 struct pt_regs __regs);
203asmlinkage void do_exception_error(unsigned long r4, unsigned long r5,
204 unsigned long r6, unsigned long r7,
205 struct pt_regs __regs);
206
207static inline void set_bl_bit(void)
208{
209 unsigned long __dummy0, __dummy1;
210
211 __asm__ __volatile__ (
212 "stc sr, %0\n\t"
213 "or %2, %0\n\t"
214 "and %3, %0\n\t"
215 "ldc %0, sr\n\t"
216 : "=&r" (__dummy0), "=r" (__dummy1)
217 : "r" (0x10000000), "r" (0xffffff0f)
218 : "memory"
219 );
220}
221
222static inline void clear_bl_bit(void)
223{
224 unsigned long __dummy0, __dummy1;
225
226 __asm__ __volatile__ (
227 "stc sr, %0\n\t"
228 "and %2, %0\n\t"
229 "ldc %0, sr\n\t"
230 : "=&r" (__dummy0), "=r" (__dummy1)
231 : "1" (~0x10000000)
232 : "memory"
233 );
234}
235
236#endif /* __ASM_SH_SYSTEM_32_H */
diff --git a/arch/sh/include/asm/switch_to_64.h b/arch/sh/include/asm/switch_to_64.h
new file mode 100644
index 00000000000..ba3129d6bc2
--- /dev/null
+++ b/arch/sh/include/asm/switch_to_64.h
@@ -0,0 +1,35 @@
1/*
2 * Copyright (C) 2000, 2001 Paolo Alberelli
3 * Copyright (C) 2003 Paul Mundt
4 * Copyright (C) 2004 Richard Curnow
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
8 * for more details.
9 */
10#ifndef __ASM_SH_SWITCH_TO_64_H
11#define __ASM_SH_SWITCH_TO_64_H
12
13struct thread_struct;
14struct task_struct;
15
16/*
17 * switch_to() should switch tasks to task nr n, first
18 */
19struct task_struct *sh64_switch_to(struct task_struct *prev,
20 struct thread_struct *prev_thread,
21 struct task_struct *next,
22 struct thread_struct *next_thread);
23
24#define switch_to(prev,next,last) \
25do { \
26 if (last_task_used_math != next) { \
27 struct pt_regs *regs = next->thread.uregs; \
28 if (regs) regs->sr |= SR_FD; \
29 } \
30 last = sh64_switch_to(prev, &prev->thread, next, \
31 &next->thread); \
32} while (0)
33
34
35#endif /* __ASM_SH_SWITCH_TO_64_H */
diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h
deleted file mode 100644
index 10c8b1823a1..00000000000
--- a/arch/sh/include/asm/system.h
+++ /dev/null
@@ -1,184 +0,0 @@
1#ifndef __ASM_SH_SYSTEM_H
2#define __ASM_SH_SYSTEM_H
3
4/*
5 * Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima
6 * Copyright (C) 2002 Paul Mundt
7 */
8
9#include <linux/irqflags.h>
10#include <linux/compiler.h>
11#include <linux/linkage.h>
12#include <asm/types.h>
13#include <asm/uncached.h>
14
15#define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */
16
17/*
18 * A brief note on ctrl_barrier(), the control register write barrier.
19 *
20 * Legacy SH cores typically require a sequence of 8 nops after
21 * modification of a control register in order for the changes to take
22 * effect. On newer cores (like the sh4a and sh5) this is accomplished
23 * with icbi.
24 *
25 * Also note that on sh4a in the icbi case we can forego a synco for the
26 * write barrier, as it's not necessary for control registers.
27 *
28 * Historically we have only done this type of barrier for the MMUCR, but
29 * it's also necessary for the CCR, so we make it generic here instead.
30 */
31#if defined(CONFIG_CPU_SH4A) || defined(CONFIG_CPU_SH5)
32#define mb() __asm__ __volatile__ ("synco": : :"memory")
33#define rmb() mb()
34#define wmb() __asm__ __volatile__ ("synco": : :"memory")
35#define ctrl_barrier() __icbi(PAGE_OFFSET)
36#define read_barrier_depends() do { } while(0)
37#else
38#define mb() __asm__ __volatile__ ("": : :"memory")
39#define rmb() mb()
40#define wmb() __asm__ __volatile__ ("": : :"memory")
41#define ctrl_barrier() __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop")
42#define read_barrier_depends() do { } while(0)
43#endif
44
45#ifdef CONFIG_SMP
46#define smp_mb() mb()
47#define smp_rmb() rmb()
48#define smp_wmb() wmb()
49#define smp_read_barrier_depends() read_barrier_depends()
50#else
51#define smp_mb() barrier()
52#define smp_rmb() barrier()
53#define smp_wmb() barrier()
54#define smp_read_barrier_depends() do { } while(0)
55#endif
56
57#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
58
59#ifdef CONFIG_GUSA_RB
60#include <asm/cmpxchg-grb.h>
61#elif defined(CONFIG_CPU_SH4A)
62#include <asm/cmpxchg-llsc.h>
63#else
64#include <asm/cmpxchg-irq.h>
65#endif
66
67extern void __xchg_called_with_bad_pointer(void);
68
69#define __xchg(ptr, x, size) \
70({ \
71 unsigned long __xchg__res; \
72 volatile void *__xchg_ptr = (ptr); \
73 switch (size) { \
74 case 4: \
75 __xchg__res = xchg_u32(__xchg_ptr, x); \
76 break; \
77 case 1: \
78 __xchg__res = xchg_u8(__xchg_ptr, x); \
79 break; \
80 default: \
81 __xchg_called_with_bad_pointer(); \
82 __xchg__res = x; \
83 break; \
84 } \
85 \
86 __xchg__res; \
87})
88
89#define xchg(ptr,x) \
90 ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))
91
92/* This function doesn't exist, so you'll get a linker error
93 * if something tries to do an invalid cmpxchg(). */
94extern void __cmpxchg_called_with_bad_pointer(void);
95
96#define __HAVE_ARCH_CMPXCHG 1
97
98static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
99 unsigned long new, int size)
100{
101 switch (size) {
102 case 4:
103 return __cmpxchg_u32(ptr, old, new);
104 }
105 __cmpxchg_called_with_bad_pointer();
106 return old;
107}
108
109#define cmpxchg(ptr,o,n) \
110 ({ \
111 __typeof__(*(ptr)) _o_ = (o); \
112 __typeof__(*(ptr)) _n_ = (n); \
113 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
114 (unsigned long)_n_, sizeof(*(ptr))); \
115 })
116
117struct pt_regs;
118
119extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn));
120void free_initmem(void);
121void free_initrd_mem(unsigned long start, unsigned long end);
122
123extern void *set_exception_table_vec(unsigned int vec, void *handler);
124
125static inline void *set_exception_table_evt(unsigned int evt, void *handler)
126{
127 return set_exception_table_vec(evt >> 5, handler);
128}
129
130/*
131 * SH-2A has both 16 and 32-bit opcodes, do lame encoding checks.
132 */
133#ifdef CONFIG_CPU_SH2A
134extern unsigned int instruction_size(unsigned int insn);
135#elif defined(CONFIG_SUPERH32)
136#define instruction_size(insn) (2)
137#else
138#define instruction_size(insn) (4)
139#endif
140
141void per_cpu_trap_init(void);
142void default_idle(void);
143void cpu_idle_wait(void);
144void stop_this_cpu(void *);
145
146#ifdef CONFIG_SUPERH32
147#define BUILD_TRAP_HANDLER(name) \
148asmlinkage void name##_trap_handler(unsigned long r4, unsigned long r5, \
149 unsigned long r6, unsigned long r7, \
150 struct pt_regs __regs)
151
152#define TRAP_HANDLER_DECL \
153 struct pt_regs *regs = RELOC_HIDE(&__regs, 0); \
154 unsigned int vec = regs->tra; \
155 (void)vec;
156#else
157#define BUILD_TRAP_HANDLER(name) \
158asmlinkage void name##_trap_handler(unsigned int vec, struct pt_regs *regs)
159#define TRAP_HANDLER_DECL
160#endif
161
162BUILD_TRAP_HANDLER(address_error);
163BUILD_TRAP_HANDLER(debug);
164BUILD_TRAP_HANDLER(bug);
165BUILD_TRAP_HANDLER(breakpoint);
166BUILD_TRAP_HANDLER(singlestep);
167BUILD_TRAP_HANDLER(fpu_error);
168BUILD_TRAP_HANDLER(fpu_state_restore);
169BUILD_TRAP_HANDLER(nmi);
170
171#define arch_align_stack(x) (x)
172
173struct mem_access {
174 unsigned long (*from)(void *dst, const void __user *src, unsigned long cnt);
175 unsigned long (*to)(void __user *dst, const void *src, unsigned long cnt);
176};
177
178#ifdef CONFIG_SUPERH32
179# include "system_32.h"
180#else
181# include "system_64.h"
182#endif
183
184#endif
diff --git a/arch/sh/include/asm/system_64.h b/arch/sh/include/asm/system_64.h
deleted file mode 100644
index 8593bc8d1a4..00000000000
--- a/arch/sh/include/asm/system_64.h
+++ /dev/null
@@ -1,79 +0,0 @@
1#ifndef __ASM_SH_SYSTEM_64_H
2#define __ASM_SH_SYSTEM_64_H
3
4/*
5 * include/asm-sh/system_64.h
6 *
7 * Copyright (C) 2000, 2001 Paolo Alberelli
8 * Copyright (C) 2003 Paul Mundt
9 * Copyright (C) 2004 Richard Curnow
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
13 * for more details.
14 */
15#include <cpu/registers.h>
16#include <asm/processor.h>
17
18/*
19 * switch_to() should switch tasks to task nr n, first
20 */
21struct thread_struct;
22struct task_struct *sh64_switch_to(struct task_struct *prev,
23 struct thread_struct *prev_thread,
24 struct task_struct *next,
25 struct thread_struct *next_thread);
26
27#define switch_to(prev,next,last) \
28do { \
29 if (last_task_used_math != next) { \
30 struct pt_regs *regs = next->thread.uregs; \
31 if (regs) regs->sr |= SR_FD; \
32 } \
33 last = sh64_switch_to(prev, &prev->thread, next, \
34 &next->thread); \
35} while (0)
36
37#define __icbi(addr) __asm__ __volatile__ ( "icbi %0, 0\n\t" : : "r" (addr))
38#define __ocbp(addr) __asm__ __volatile__ ( "ocbp %0, 0\n\t" : : "r" (addr))
39#define __ocbi(addr) __asm__ __volatile__ ( "ocbi %0, 0\n\t" : : "r" (addr))
40#define __ocbwb(addr) __asm__ __volatile__ ( "ocbwb %0, 0\n\t" : : "r" (addr))
41
42static inline reg_size_t register_align(void *val)
43{
44 return (unsigned long long)(signed long long)(signed long)val;
45}
46
47extern void phys_stext(void);
48
49static inline void trigger_address_error(void)
50{
51 phys_stext();
52}
53
54#define SR_BL_LL 0x0000000010000000LL
55
56static inline void set_bl_bit(void)
57{
58 unsigned long long __dummy0, __dummy1 = SR_BL_LL;
59
60 __asm__ __volatile__("getcon " __SR ", %0\n\t"
61 "or %0, %1, %0\n\t"
62 "putcon %0, " __SR "\n\t"
63 : "=&r" (__dummy0)
64 : "r" (__dummy1));
65
66}
67
68static inline void clear_bl_bit(void)
69{
70 unsigned long long __dummy0, __dummy1 = ~SR_BL_LL;
71
72 __asm__ __volatile__("getcon " __SR ", %0\n\t"
73 "and %0, %1, %0\n\t"
74 "putcon %0, " __SR "\n\t"
75 : "=&r" (__dummy0)
76 : "r" (__dummy1));
77}
78
79#endif /* __ASM_SH_SYSTEM_64_H */
diff --git a/arch/sh/include/asm/traps.h b/arch/sh/include/asm/traps.h
new file mode 100644
index 00000000000..afd9df8d064
--- /dev/null
+++ b/arch/sh/include/asm/traps.h
@@ -0,0 +1,21 @@
1#ifndef __ASM_SH_TRAPS_H
2#define __ASM_SH_TRAPS_H
3
4#include <linux/compiler.h>
5
6#ifdef CONFIG_SUPERH32
7# include "traps_32.h"
8#else
9# include "traps_64.h"
10#endif
11
12BUILD_TRAP_HANDLER(address_error);
13BUILD_TRAP_HANDLER(debug);
14BUILD_TRAP_HANDLER(bug);
15BUILD_TRAP_HANDLER(breakpoint);
16BUILD_TRAP_HANDLER(singlestep);
17BUILD_TRAP_HANDLER(fpu_error);
18BUILD_TRAP_HANDLER(fpu_state_restore);
19BUILD_TRAP_HANDLER(nmi);
20
21#endif /* __ASM_SH_TRAPS_H */
diff --git a/arch/sh/include/asm/traps_32.h b/arch/sh/include/asm/traps_32.h
new file mode 100644
index 00000000000..cfd55ff9dff
--- /dev/null
+++ b/arch/sh/include/asm/traps_32.h
@@ -0,0 +1,68 @@
1#ifndef __ASM_SH_TRAPS_32_H
2#define __ASM_SH_TRAPS_32_H
3
4#include <linux/types.h>
5#include <asm/mmu.h>
6
7#ifdef CONFIG_CPU_HAS_SR_RB
8#define lookup_exception_vector() \
9({ \
10 unsigned long _vec; \
11 \
12 __asm__ __volatile__ ( \
13 "stc r2_bank, %0\n\t" \
14 : "=r" (_vec) \
15 ); \
16 \
17 _vec; \
18})
19#else
20#define lookup_exception_vector() \
21({ \
22 unsigned long _vec; \
23 __asm__ __volatile__ ( \
24 "mov r4, %0\n\t" \
25 : "=r" (_vec) \
26 ); \
27 \
28 _vec; \
29})
30#endif
31
32static inline void trigger_address_error(void)
33{
34 __asm__ __volatile__ (
35 "ldc %0, sr\n\t"
36 "mov.l @%1, %0"
37 :
38 : "r" (0x10000000), "r" (0x80000001)
39 );
40}
41
42asmlinkage void do_address_error(struct pt_regs *regs,
43 unsigned long writeaccess,
44 unsigned long address);
45asmlinkage void do_divide_error(unsigned long r4, unsigned long r5,
46 unsigned long r6, unsigned long r7,
47 struct pt_regs __regs);
48asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5,
49 unsigned long r6, unsigned long r7,
50 struct pt_regs __regs);
51asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5,
52 unsigned long r6, unsigned long r7,
53 struct pt_regs __regs);
54asmlinkage void do_exception_error(unsigned long r4, unsigned long r5,
55 unsigned long r6, unsigned long r7,
56 struct pt_regs __regs);
57
58#define BUILD_TRAP_HANDLER(name) \
59asmlinkage void name##_trap_handler(unsigned long r4, unsigned long r5, \
60 unsigned long r6, unsigned long r7, \
61 struct pt_regs __regs)
62
63#define TRAP_HANDLER_DECL \
64 struct pt_regs *regs = RELOC_HIDE(&__regs, 0); \
65 unsigned int vec = regs->tra; \
66 (void)vec;
67
68#endif /* __ASM_SH_TRAPS_32_H */
diff --git a/arch/sh/include/asm/traps_64.h b/arch/sh/include/asm/traps_64.h
new file mode 100644
index 00000000000..c52d7f9a06c
--- /dev/null
+++ b/arch/sh/include/asm/traps_64.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2000, 2001 Paolo Alberelli
3 * Copyright (C) 2003 Paul Mundt
4 * Copyright (C) 2004 Richard Curnow
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
8 * for more details.
9 */
10#ifndef __ASM_SH_TRAPS_64_H
11#define __ASM_SH_TRAPS_64_H
12
13extern void phys_stext(void);
14
15static inline void trigger_address_error(void)
16{
17 phys_stext();
18}
19
20#define BUILD_TRAP_HANDLER(name) \
21asmlinkage void name##_trap_handler(unsigned int vec, struct pt_regs *regs)
22#define TRAP_HANDLER_DECL
23
24#endif /* __ASM_SH_TRAPS_64_H */
diff --git a/arch/sh/include/asm/uaccess.h b/arch/sh/include/asm/uaccess.h
index 075848f43b6..050f221fa89 100644
--- a/arch/sh/include/asm/uaccess.h
+++ b/arch/sh/include/asm/uaccess.h
@@ -254,5 +254,19 @@ int fixup_exception(struct pt_regs *regs);
254unsigned long search_exception_table(unsigned long addr); 254unsigned long search_exception_table(unsigned long addr);
255const struct exception_table_entry *search_exception_tables(unsigned long addr); 255const struct exception_table_entry *search_exception_tables(unsigned long addr);
256 256
257extern void *set_exception_table_vec(unsigned int vec, void *handler);
258
259static inline void *set_exception_table_evt(unsigned int evt, void *handler)
260{
261 return set_exception_table_vec(evt >> 5, handler);
262}
263
264struct mem_access {
265 unsigned long (*from)(void *dst, const void __user *src, unsigned long cnt);
266 unsigned long (*to)(void __user *dst, const void *src, unsigned long cnt);
267};
268
269int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
270 struct mem_access *ma, int, unsigned long address);
257 271
258#endif /* __ASM_SH_UACCESS_H */ 272#endif /* __ASM_SH_UACCESS_H */
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c
index fac742e514e..61a07dafcd4 100644
--- a/arch/sh/kernel/cpu/init.c
+++ b/arch/sh/kernel/cpu/init.c
@@ -18,13 +18,13 @@
18#include <asm/processor.h> 18#include <asm/processor.h>
19#include <asm/uaccess.h> 19#include <asm/uaccess.h>
20#include <asm/page.h> 20#include <asm/page.h>
21#include <asm/system.h>
22#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
23#include <asm/cache.h> 22#include <asm/cache.h>
24#include <asm/elf.h> 23#include <asm/elf.h>
25#include <asm/io.h> 24#include <asm/io.h>
26#include <asm/smp.h> 25#include <asm/smp.h>
27#include <asm/sh_bios.h> 26#include <asm/sh_bios.h>
27#include <asm/setup.h>
28 28
29#ifdef CONFIG_SH_FPU 29#ifdef CONFIG_SH_FPU
30#define cpu_has_fpu 1 30#define cpu_has_fpu 1
diff --git a/arch/sh/kernel/cpu/irq/imask.c b/arch/sh/kernel/cpu/irq/imask.c
index 39b6a24c159..e7f1745bd12 100644
--- a/arch/sh/kernel/cpu/irq/imask.c
+++ b/arch/sh/kernel/cpu/irq/imask.c
@@ -19,7 +19,6 @@
19#include <linux/cache.h> 19#include <linux/cache.h>
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/bitmap.h> 21#include <linux/bitmap.h>
22#include <asm/system.h>
23#include <asm/irq.h> 22#include <asm/irq.h>
24 23
25/* Bitmap of IRQ masked */ 24/* Bitmap of IRQ masked */
diff --git a/arch/sh/kernel/cpu/sh2a/opcode_helper.c b/arch/sh/kernel/cpu/sh2a/opcode_helper.c
index 9704b7926d8..72aa61c81e4 100644
--- a/arch/sh/kernel/cpu/sh2a/opcode_helper.c
+++ b/arch/sh/kernel/cpu/sh2a/opcode_helper.c
@@ -10,7 +10,6 @@
10 * for more details. 10 * for more details.
11 */ 11 */
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <asm/system.h>
14 13
15/* 14/*
16 * Instructions on SH are generally fixed at 16-bits, however, SH-2A 15 * Instructions on SH are generally fixed at 16-bits, however, SH-2A
diff --git a/arch/sh/kernel/cpu/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c
index 447482d7f65..e74cd6c0f10 100644
--- a/arch/sh/kernel/cpu/sh4/fpu.c
+++ b/arch/sh/kernel/cpu/sh4/fpu.c
@@ -15,7 +15,6 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <cpu/fpu.h> 16#include <cpu/fpu.h>
17#include <asm/processor.h> 17#include <asm/processor.h>
18#include <asm/system.h>
19#include <asm/fpu.h> 18#include <asm/fpu.h>
20 19
21/* The PR (precision) bit in the FP Status Register must be clear when 20/* The PR (precision) bit in the FP Status Register must be clear when
diff --git a/arch/sh/kernel/hw_breakpoint.c b/arch/sh/kernel/hw_breakpoint.c
index efae6ab3d54..f9173766ec4 100644
--- a/arch/sh/kernel/hw_breakpoint.c
+++ b/arch/sh/kernel/hw_breakpoint.c
@@ -22,6 +22,7 @@
22#include <asm/hw_breakpoint.h> 22#include <asm/hw_breakpoint.h>
23#include <asm/mmu_context.h> 23#include <asm/mmu_context.h>
24#include <asm/ptrace.h> 24#include <asm/ptrace.h>
25#include <asm/traps.h>
25 26
26/* 27/*
27 * Stores the breakpoints currently in use on each breakpoint address 28 * Stores the breakpoints currently in use on each breakpoint address
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
index 7e489282656..64852ecc688 100644
--- a/arch/sh/kernel/idle.c
+++ b/arch/sh/kernel/idle.c
@@ -18,9 +18,9 @@
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/cpuidle.h> 19#include <linux/cpuidle.h>
20#include <asm/pgalloc.h> 20#include <asm/pgalloc.h>
21#include <asm/system.h>
22#include <linux/atomic.h> 21#include <linux/atomic.h>
23#include <asm/smp.h> 22#include <asm/smp.h>
23#include <asm/bl_bit.h>
24 24
25void (*pm_idle)(void); 25void (*pm_idle)(void);
26 26
diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c
index 0f62f467275..c0a9761f2f8 100644
--- a/arch/sh/kernel/io_trapped.c
+++ b/arch/sh/kernel/io_trapped.c
@@ -15,7 +15,6 @@
15#include <linux/vmalloc.h> 15#include <linux/vmalloc.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <asm/system.h>
19#include <asm/mmu_context.h> 18#include <asm/mmu_context.h>
20#include <asm/uaccess.h> 19#include <asm/uaccess.h>
21#include <asm/io.h> 20#include <asm/io.h>
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c
index 7ec66517812..f72e3a95158 100644
--- a/arch/sh/kernel/process_32.c
+++ b/arch/sh/kernel/process_32.c
@@ -24,7 +24,6 @@
24#include <linux/prefetch.h> 24#include <linux/prefetch.h>
25#include <asm/uaccess.h> 25#include <asm/uaccess.h>
26#include <asm/mmu_context.h> 26#include <asm/mmu_context.h>
27#include <asm/system.h>
28#include <asm/fpu.h> 27#include <asm/fpu.h>
29#include <asm/syscalls.h> 28#include <asm/syscalls.h>
30 29
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c
index cbd4e4bb9fc..4264583eaba 100644
--- a/arch/sh/kernel/process_64.c
+++ b/arch/sh/kernel/process_64.c
@@ -30,6 +30,7 @@
30#include <asm/pgtable.h> 30#include <asm/pgtable.h>
31#include <asm/mmu_context.h> 31#include <asm/mmu_context.h>
32#include <asm/fpu.h> 32#include <asm/fpu.h>
33#include <asm/switch_to.h>
33 34
34struct task_struct *last_task_used_math = NULL; 35struct task_struct *last_task_used_math = NULL;
35 36
diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c
index a3e65156376..9698671444e 100644
--- a/arch/sh/kernel/ptrace_32.c
+++ b/arch/sh/kernel/ptrace_32.c
@@ -28,7 +28,6 @@
28#include <linux/hw_breakpoint.h> 28#include <linux/hw_breakpoint.h>
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <asm/pgtable.h> 30#include <asm/pgtable.h>
31#include <asm/system.h>
32#include <asm/processor.h> 31#include <asm/processor.h>
33#include <asm/mmu_context.h> 32#include <asm/mmu_context.h>
34#include <asm/syscalls.h> 33#include <asm/syscalls.h>
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c
index 3d0080b5c97..bc81e07dc09 100644
--- a/arch/sh/kernel/ptrace_64.c
+++ b/arch/sh/kernel/ptrace_64.c
@@ -34,11 +34,11 @@
34#include <asm/io.h> 34#include <asm/io.h>
35#include <asm/uaccess.h> 35#include <asm/uaccess.h>
36#include <asm/pgtable.h> 36#include <asm/pgtable.h>
37#include <asm/system.h>
38#include <asm/processor.h> 37#include <asm/processor.h>
39#include <asm/mmu_context.h> 38#include <asm/mmu_context.h>
40#include <asm/syscalls.h> 39#include <asm/syscalls.h>
41#include <asm/fpu.h> 40#include <asm/fpu.h>
41#include <asm/traps.h>
42 42
43#define CREATE_TRACE_POINTS 43#define CREATE_TRACE_POINTS
44#include <trace/events/syscalls.h> 44#include <trace/events/syscalls.h>
diff --git a/arch/sh/kernel/reboot.c b/arch/sh/kernel/reboot.c
index ca6a5ca6401..04afe5b2066 100644
--- a/arch/sh/kernel/reboot.c
+++ b/arch/sh/kernel/reboot.c
@@ -8,8 +8,8 @@
8#endif 8#endif
9#include <asm/addrspace.h> 9#include <asm/addrspace.h>
10#include <asm/reboot.h> 10#include <asm/reboot.h>
11#include <asm/system.h>
12#include <asm/tlbflush.h> 11#include <asm/tlbflush.h>
12#include <asm/traps.h>
13 13
14void (*pm_power_off)(void); 14void (*pm_power_off)(void);
15EXPORT_SYMBOL(pm_power_off); 15EXPORT_SYMBOL(pm_power_off);
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c
index a7a55ed43a5..0bc58866add 100644
--- a/arch/sh/kernel/signal_32.c
+++ b/arch/sh/kernel/signal_32.c
@@ -25,7 +25,6 @@
25#include <linux/freezer.h> 25#include <linux/freezer.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/tracehook.h> 27#include <linux/tracehook.h>
28#include <asm/system.h>
29#include <asm/ucontext.h> 28#include <asm/ucontext.h>
30#include <asm/uaccess.h> 29#include <asm/uaccess.h>
31#include <asm/pgtable.h> 30#include <asm/pgtable.h>
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index f624174bf23..a17a14d3234 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -23,7 +23,6 @@
23#include <linux/sched.h> 23#include <linux/sched.h>
24#include <linux/atomic.h> 24#include <linux/atomic.h>
25#include <asm/processor.h> 25#include <asm/processor.h>
26#include <asm/system.h>
27#include <asm/mmu_context.h> 26#include <asm/mmu_context.h>
28#include <asm/smp.h> 27#include <asm/smp.h>
29#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
index 0830c2a9f71..a87e58a9e38 100644
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -7,7 +7,7 @@
7#include <linux/uaccess.h> 7#include <linux/uaccess.h>
8#include <linux/hardirq.h> 8#include <linux/hardirq.h>
9#include <asm/unwinder.h> 9#include <asm/unwinder.h>
10#include <asm/system.h> 10#include <asm/traps.h>
11 11
12#ifdef CONFIG_GENERIC_BUG 12#ifdef CONFIG_GENERIC_BUG
13static void handle_BUG(struct pt_regs *regs) 13static void handle_BUG(struct pt_regs *regs)
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c
index 7bbef95c9d1..a37175deb73 100644
--- a/arch/sh/kernel/traps_32.c
+++ b/arch/sh/kernel/traps_32.c
@@ -27,10 +27,11 @@
27#include <linux/sysfs.h> 27#include <linux/sysfs.h>
28#include <linux/uaccess.h> 28#include <linux/uaccess.h>
29#include <linux/perf_event.h> 29#include <linux/perf_event.h>
30#include <asm/system.h>
31#include <asm/alignment.h> 30#include <asm/alignment.h>
32#include <asm/fpu.h> 31#include <asm/fpu.h>
33#include <asm/kprobes.h> 32#include <asm/kprobes.h>
33#include <asm/traps.h>
34#include <asm/bl_bit.h>
34 35
35#ifdef CONFIG_CPU_SH2 36#ifdef CONFIG_CPU_SH2
36# define TRAP_RESERVED_INST 4 37# define TRAP_RESERVED_INST 4
diff --git a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c
index cd3a4048329..6c0486094e4 100644
--- a/arch/sh/kernel/traps_64.c
+++ b/arch/sh/kernel/traps_64.c
@@ -25,7 +25,6 @@
25#include <linux/sysctl.h> 25#include <linux/sysctl.h>
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/perf_event.h> 27#include <linux/perf_event.h>
28#include <asm/system.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
30#include <asm/io.h> 29#include <asm/io.h>
31#include <linux/atomic.h> 30#include <linux/atomic.h>
diff --git a/arch/sh/math-emu/math.c b/arch/sh/math-emu/math.c
index 97719521065..b876780c1e1 100644
--- a/arch/sh/math-emu/math.c
+++ b/arch/sh/math-emu/math.c
@@ -14,7 +14,6 @@
14#include <linux/signal.h> 14#include <linux/signal.h>
15#include <linux/perf_event.h> 15#include <linux/perf_event.h>
16 16
17#include <asm/system.h>
18#include <asm/uaccess.h> 17#include <asm/uaccess.h>
19#include <asm/processor.h> 18#include <asm/processor.h>
20#include <asm/io.h> 19#include <asm/io.h>
diff --git a/arch/sh/mm/fault_32.c b/arch/sh/mm/fault_32.c
index 7bebd044f2a..324eef93c90 100644
--- a/arch/sh/mm/fault_32.c
+++ b/arch/sh/mm/fault_32.c
@@ -17,9 +17,9 @@
17#include <linux/kprobes.h> 17#include <linux/kprobes.h>
18#include <linux/perf_event.h> 18#include <linux/perf_event.h>
19#include <asm/io_trapped.h> 19#include <asm/io_trapped.h>
20#include <asm/system.h>
21#include <asm/mmu_context.h> 20#include <asm/mmu_context.h>
22#include <asm/tlbflush.h> 21#include <asm/tlbflush.h>
22#include <asm/traps.h>
23 23
24static inline int notify_page_fault(struct pt_regs *regs, int trap) 24static inline int notify_page_fault(struct pt_regs *regs, int trap)
25{ 25{
diff --git a/arch/sh/mm/fault_64.c b/arch/sh/mm/fault_64.c
index 2b356cec248..44a341029e7 100644
--- a/arch/sh/mm/fault_64.c
+++ b/arch/sh/mm/fault_64.c
@@ -33,7 +33,6 @@
33#include <linux/mm.h> 33#include <linux/mm.h>
34#include <linux/smp.h> 34#include <linux/smp.h>
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <asm/system.h>
37#include <asm/tlb.h> 36#include <asm/tlb.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/uaccess.h> 38#include <asm/uaccess.h>
diff --git a/arch/sh/mm/flush-sh4.c b/arch/sh/mm/flush-sh4.c
index cef402678f4..75a17f5bfa1 100644
--- a/arch/sh/mm/flush-sh4.c
+++ b/arch/sh/mm/flush-sh4.c
@@ -1,6 +1,7 @@
1#include <linux/mm.h> 1#include <linux/mm.h>
2#include <asm/mmu_context.h> 2#include <asm/mmu_context.h>
3#include <asm/cacheflush.h> 3#include <asm/cacheflush.h>
4#include <asm/traps.h>
4 5
5/* 6/*
6 * Write back the dirty D-caches, but not invalidate them. 7 * Write back the dirty D-caches, but not invalidate them.
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index fad52f1f681..7160c9fd6fe 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -25,7 +25,6 @@
25#include <linux/vmalloc.h> 25#include <linux/vmalloc.h>
26#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
27#include <asm/sizes.h> 27#include <asm/sizes.h>
28#include <asm/system.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
30#include <asm/pgtable.h> 29#include <asm/pgtable.h>
31#include <asm/page.h> 30#include <asm/page.h>
diff --git a/arch/sh/mm/tlb-pteaex.c b/arch/sh/mm/tlb-pteaex.c
index b71db6af806..4db21adfe5d 100644
--- a/arch/sh/mm/tlb-pteaex.c
+++ b/arch/sh/mm/tlb-pteaex.c
@@ -12,7 +12,6 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <asm/system.h>
16#include <asm/mmu_context.h> 15#include <asm/mmu_context.h>
17#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
18 17
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c
index 7a940dbfc2e..6554fb439f0 100644
--- a/arch/sh/mm/tlb-sh3.c
+++ b/arch/sh/mm/tlb-sh3.c
@@ -20,7 +20,6 @@
20#include <linux/smp.h> 20#include <linux/smp.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22 22
23#include <asm/system.h>
24#include <asm/io.h> 23#include <asm/io.h>
25#include <asm/uaccess.h> 24#include <asm/uaccess.h>
26#include <asm/pgalloc.h> 25#include <asm/pgalloc.h>
diff --git a/arch/sh/mm/tlb-sh4.c b/arch/sh/mm/tlb-sh4.c
index cfdf7930d29..d42dd7e443d 100644
--- a/arch/sh/mm/tlb-sh4.c
+++ b/arch/sh/mm/tlb-sh4.c
@@ -11,7 +11,6 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/io.h> 13#include <linux/io.h>
14#include <asm/system.h>
15#include <asm/mmu_context.h> 14#include <asm/mmu_context.h>
16#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
17 16
diff --git a/arch/sh/mm/tlbflush_64.c b/arch/sh/mm/tlbflush_64.c
index e3430e093d4..11c5a18f10e 100644
--- a/arch/sh/mm/tlbflush_64.c
+++ b/arch/sh/mm/tlbflush_64.c
@@ -22,7 +22,6 @@
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/perf_event.h> 23#include <linux/perf_event.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <asm/system.h>
26#include <asm/io.h> 25#include <asm/io.h>
27#include <asm/tlb.h> 26#include <asm/tlb.h>
28#include <asm/uaccess.h> 27#include <asm/uaccess.h>
diff --git a/arch/sparc/include/asm/atomic_32.h b/arch/sparc/include/asm/atomic_32.h
index 9dd0a769fa1..905832aa9e9 100644
--- a/arch/sparc/include/asm/atomic_32.h
+++ b/arch/sparc/include/asm/atomic_32.h
@@ -13,9 +13,9 @@
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15 15
16#include <asm/cmpxchg.h>
16#include <asm-generic/atomic64.h> 17#include <asm-generic/atomic64.h>
17 18
18#include <asm/system.h>
19 19
20#define ATOMIC_INIT(i) { (i) } 20#define ATOMIC_INIT(i) { (i) }
21 21
diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h
index 9f421df46ae..ce35a1cf1a2 100644
--- a/arch/sparc/include/asm/atomic_64.h
+++ b/arch/sparc/include/asm/atomic_64.h
@@ -8,7 +8,7 @@
8#define __ARCH_SPARC64_ATOMIC__ 8#define __ARCH_SPARC64_ATOMIC__
9 9
10#include <linux/types.h> 10#include <linux/types.h>
11#include <asm/system.h> 11#include <asm/cmpxchg.h>
12 12
13#define ATOMIC_INIT(i) { (i) } 13#define ATOMIC_INIT(i) { (i) }
14#define ATOMIC64_INIT(i) { (i) } 14#define ATOMIC64_INIT(i) { (i) }
@@ -85,7 +85,6 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
85 return c; 85 return c;
86} 86}
87 87
88
89#define atomic64_cmpxchg(v, o, n) \ 88#define atomic64_cmpxchg(v, o, n) \
90 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n))) 89 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
91#define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) 90#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
diff --git a/arch/sparc/include/asm/auxio_32.h b/arch/sparc/include/asm/auxio_32.h
index e03e088be95..3a319775ae3 100644
--- a/arch/sparc/include/asm/auxio_32.h
+++ b/arch/sparc/include/asm/auxio_32.h
@@ -6,7 +6,6 @@
6#ifndef _SPARC_AUXIO_H 6#ifndef _SPARC_AUXIO_H
7#define _SPARC_AUXIO_H 7#define _SPARC_AUXIO_H
8 8
9#include <asm/system.h>
10#include <asm/vaddrs.h> 9#include <asm/vaddrs.h>
11 10
12/* This register is an unsigned char in IO space. It does two things. 11/* This register is an unsigned char in IO space. It does two things.
diff --git a/arch/sparc/include/asm/barrier.h b/arch/sparc/include/asm/barrier.h
new file mode 100644
index 00000000000..b25f02a029e
--- /dev/null
+++ b/arch/sparc/include/asm/barrier.h
@@ -0,0 +1,8 @@
1#ifndef ___ASM_SPARC_BARRIER_H
2#define ___ASM_SPARC_BARRIER_H
3#if defined(__sparc__) && defined(__arch64__)
4#include <asm/barrier_64.h>
5#else
6#include <asm/barrier_32.h>
7#endif
8#endif
diff --git a/arch/sparc/include/asm/barrier_32.h b/arch/sparc/include/asm/barrier_32.h
new file mode 100644
index 00000000000..c1b76654ee7
--- /dev/null
+++ b/arch/sparc/include/asm/barrier_32.h
@@ -0,0 +1,15 @@
1#ifndef __SPARC_BARRIER_H
2#define __SPARC_BARRIER_H
3
4/* XXX Change this if we ever use a PSO mode kernel. */
5#define mb() __asm__ __volatile__ ("" : : : "memory")
6#define rmb() mb()
7#define wmb() mb()
8#define read_barrier_depends() do { } while(0)
9#define set_mb(__var, __value) do { __var = __value; mb(); } while(0)
10#define smp_mb() __asm__ __volatile__("":::"memory")
11#define smp_rmb() __asm__ __volatile__("":::"memory")
12#define smp_wmb() __asm__ __volatile__("":::"memory")
13#define smp_read_barrier_depends() do { } while(0)
14
15#endif /* !(__SPARC_BARRIER_H) */
diff --git a/arch/sparc/include/asm/barrier_64.h b/arch/sparc/include/asm/barrier_64.h
new file mode 100644
index 00000000000..95d45986f90
--- /dev/null
+++ b/arch/sparc/include/asm/barrier_64.h
@@ -0,0 +1,56 @@
1#ifndef __SPARC64_BARRIER_H
2#define __SPARC64_BARRIER_H
3
4/* These are here in an effort to more fully work around Spitfire Errata
5 * #51. Essentially, if a memory barrier occurs soon after a mispredicted
6 * branch, the chip can stop executing instructions until a trap occurs.
7 * Therefore, if interrupts are disabled, the chip can hang forever.
8 *
9 * It used to be believed that the memory barrier had to be right in the
10 * delay slot, but a case has been traced recently wherein the memory barrier
11 * was one instruction after the branch delay slot and the chip still hung.
12 * The offending sequence was the following in sym_wakeup_done() of the
13 * sym53c8xx_2 driver:
14 *
15 * call sym_ccb_from_dsa, 0
16 * movge %icc, 0, %l0
17 * brz,pn %o0, .LL1303
18 * mov %o0, %l2
19 * membar #LoadLoad
20 *
21 * The branch has to be mispredicted for the bug to occur. Therefore, we put
22 * the memory barrier explicitly into a "branch always, predicted taken"
23 * delay slot to avoid the problem case.
24 */
25#define membar_safe(type) \
26do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
27 " membar " type "\n" \
28 "1:\n" \
29 : : : "memory"); \
30} while (0)
31
32/* The kernel always executes in TSO memory model these days,
33 * and furthermore most sparc64 chips implement more stringent
34 * memory ordering than required by the specifications.
35 */
36#define mb() membar_safe("#StoreLoad")
37#define rmb() __asm__ __volatile__("":::"memory")
38#define wmb() __asm__ __volatile__("":::"memory")
39
40#define read_barrier_depends() do { } while(0)
41#define set_mb(__var, __value) \
42 do { __var = __value; membar_safe("#StoreLoad"); } while(0)
43
44#ifdef CONFIG_SMP
45#define smp_mb() mb()
46#define smp_rmb() rmb()
47#define smp_wmb() wmb()
48#else
49#define smp_mb() __asm__ __volatile__("":::"memory")
50#define smp_rmb() __asm__ __volatile__("":::"memory")
51#define smp_wmb() __asm__ __volatile__("":::"memory")
52#endif
53
54#define smp_read_barrier_depends() do { } while(0)
55
56#endif /* !(__SPARC64_BARRIER_H) */
diff --git a/arch/sparc/include/asm/bug.h b/arch/sparc/include/asm/bug.h
index 8a59e5a8c21..6bd9f43cb5a 100644
--- a/arch/sparc/include/asm/bug.h
+++ b/arch/sparc/include/asm/bug.h
@@ -19,4 +19,7 @@ extern void do_BUG(const char *file, int line);
19 19
20#include <asm-generic/bug.h> 20#include <asm-generic/bug.h>
21 21
22struct pt_regs;
23extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noreturn));
24
22#endif 25#endif
diff --git a/arch/sparc/include/asm/cacheflush_32.h b/arch/sparc/include/asm/cacheflush_32.h
index 2e468773f25..68431b47a22 100644
--- a/arch/sparc/include/asm/cacheflush_32.h
+++ b/arch/sparc/include/asm/cacheflush_32.h
@@ -83,4 +83,13 @@ extern void sparc_flush_page_to_ram(struct page *page);
83#define flush_cache_vmap(start, end) flush_cache_all() 83#define flush_cache_vmap(start, end) flush_cache_all()
84#define flush_cache_vunmap(start, end) flush_cache_all() 84#define flush_cache_vunmap(start, end) flush_cache_all()
85 85
86/* When a context switch happens we must flush all user windows so that
87 * the windows of the current process are flushed onto its stack. This
88 * way the windows are all clean for the next process and the stack
89 * frames are up to date.
90 */
91extern void flush_user_windows(void);
92extern void kill_user_windows(void);
93extern void flushw_all(void);
94
86#endif /* _SPARC_CACHEFLUSH_H */ 95#endif /* _SPARC_CACHEFLUSH_H */
diff --git a/arch/sparc/include/asm/cacheflush_64.h b/arch/sparc/include/asm/cacheflush_64.h
index b95384033e8..2efea2ff88b 100644
--- a/arch/sparc/include/asm/cacheflush_64.h
+++ b/arch/sparc/include/asm/cacheflush_64.h
@@ -9,6 +9,16 @@
9 9
10/* Cache flush operations. */ 10/* Cache flush operations. */
11 11
12
13#define flushi(addr) __asm__ __volatile__ ("flush %0" : : "r" (addr) : "memory")
14#define flushw_all() __asm__ __volatile__("flushw")
15
16extern void __flushw_user(void);
17#define flushw_user() __flushw_user()
18
19#define flush_user_windows flushw_user
20#define flush_register_windows flushw_all
21
12/* These are the same regardless of whether this is an SMP kernel or not. */ 22/* These are the same regardless of whether this is an SMP kernel or not. */
13#define flush_cache_mm(__mm) \ 23#define flush_cache_mm(__mm) \
14 do { if ((__mm) == current->mm) flushw_user(); } while(0) 24 do { if ((__mm) == current->mm) flushw_user(); } while(0)
diff --git a/arch/sparc/include/asm/cmpxchg.h b/arch/sparc/include/asm/cmpxchg.h
new file mode 100644
index 00000000000..9355893efa5
--- /dev/null
+++ b/arch/sparc/include/asm/cmpxchg.h
@@ -0,0 +1,8 @@
1#ifndef ___ASM_SPARC_CMPXCHG_H
2#define ___ASM_SPARC_CMPXCHG_H
3#if defined(__sparc__) && defined(__arch64__)
4#include <asm/cmpxchg_64.h>
5#else
6#include <asm/cmpxchg_32.h>
7#endif
8#endif
diff --git a/arch/sparc/include/asm/cmpxchg_32.h b/arch/sparc/include/asm/cmpxchg_32.h
new file mode 100644
index 00000000000..c786b0a92b5
--- /dev/null
+++ b/arch/sparc/include/asm/cmpxchg_32.h
@@ -0,0 +1,112 @@
1/* 32-bit atomic xchg() and cmpxchg() definitions.
2 *
3 * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
4 * Copyright (C) 2000 Anton Blanchard (anton@linuxcare.com.au)
5 * Copyright (C) 2007 Kyle McMartin (kyle@parisc-linux.org)
6 *
7 * Additions by Keith M Wesolowski (wesolows@foobazco.org) based
8 * on asm-parisc/atomic.h Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>.
9 */
10
11#ifndef __ARCH_SPARC_CMPXCHG__
12#define __ARCH_SPARC_CMPXCHG__
13
14#include <asm/btfixup.h>
15
16/* This has special calling conventions */
17#ifndef CONFIG_SMP
18BTFIXUPDEF_CALL(void, ___xchg32, void)
19#endif
20
21static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned long val)
22{
23#ifdef CONFIG_SMP
24 __asm__ __volatile__("swap [%2], %0"
25 : "=&r" (val)
26 : "0" (val), "r" (m)
27 : "memory");
28 return val;
29#else
30 register unsigned long *ptr asm("g1");
31 register unsigned long ret asm("g2");
32
33 ptr = (unsigned long *) m;
34 ret = val;
35
36 /* Note: this is magic and the nop there is
37 really needed. */
38 __asm__ __volatile__(
39 "mov %%o7, %%g4\n\t"
40 "call ___f____xchg32\n\t"
41 " nop\n\t"
42 : "=&r" (ret)
43 : "0" (ret), "r" (ptr)
44 : "g3", "g4", "g7", "memory", "cc");
45
46 return ret;
47#endif
48}
49
50extern void __xchg_called_with_bad_pointer(void);
51
52static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size)
53{
54 switch (size) {
55 case 4:
56 return xchg_u32(ptr, x);
57 }
58 __xchg_called_with_bad_pointer();
59 return x;
60}
61
62#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
63
64/* Emulate cmpxchg() the same way we emulate atomics,
65 * by hashing the object address and indexing into an array
66 * of spinlocks to get a bit of performance...
67 *
68 * See arch/sparc/lib/atomic32.c for implementation.
69 *
70 * Cribbed from <asm-parisc/atomic.h>
71 */
72#define __HAVE_ARCH_CMPXCHG 1
73
74/* bug catcher for when unsupported size is used - won't link */
75extern void __cmpxchg_called_with_bad_pointer(void);
76/* we only need to support cmpxchg of a u32 on sparc */
77extern unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_);
78
79/* don't worry...optimizer will get rid of most of this */
80static inline unsigned long
81__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
82{
83 switch (size) {
84 case 4:
85 return __cmpxchg_u32((u32 *)ptr, (u32)old, (u32)new_);
86 default:
87 __cmpxchg_called_with_bad_pointer();
88 break;
89 }
90 return old;
91}
92
93#define cmpxchg(ptr, o, n) \
94({ \
95 __typeof__(*(ptr)) _o_ = (o); \
96 __typeof__(*(ptr)) _n_ = (n); \
97 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
98 (unsigned long)_n_, sizeof(*(ptr))); \
99})
100
101#include <asm-generic/cmpxchg-local.h>
102
103/*
104 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
105 * them available.
106 */
107#define cmpxchg_local(ptr, o, n) \
108 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
109 (unsigned long)(n), sizeof(*(ptr))))
110#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
111
112#endif /* __ARCH_SPARC_CMPXCHG__ */
diff --git a/arch/sparc/include/asm/cmpxchg_64.h b/arch/sparc/include/asm/cmpxchg_64.h
new file mode 100644
index 00000000000..b30eb37294c
--- /dev/null
+++ b/arch/sparc/include/asm/cmpxchg_64.h
@@ -0,0 +1,145 @@
1/* 64-bit atomic xchg() and cmpxchg() definitions.
2 *
3 * Copyright (C) 1996, 1997, 2000 David S. Miller (davem@redhat.com)
4 */
5
6#ifndef __ARCH_SPARC64_CMPXCHG__
7#define __ARCH_SPARC64_CMPXCHG__
8
9static inline unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val)
10{
11 unsigned long tmp1, tmp2;
12
13 __asm__ __volatile__(
14" mov %0, %1\n"
15"1: lduw [%4], %2\n"
16" cas [%4], %2, %0\n"
17" cmp %2, %0\n"
18" bne,a,pn %%icc, 1b\n"
19" mov %1, %0\n"
20 : "=&r" (val), "=&r" (tmp1), "=&r" (tmp2)
21 : "0" (val), "r" (m)
22 : "cc", "memory");
23 return val;
24}
25
26static inline unsigned long xchg64(__volatile__ unsigned long *m, unsigned long val)
27{
28 unsigned long tmp1, tmp2;
29
30 __asm__ __volatile__(
31" mov %0, %1\n"
32"1: ldx [%4], %2\n"
33" casx [%4], %2, %0\n"
34" cmp %2, %0\n"
35" bne,a,pn %%xcc, 1b\n"
36" mov %1, %0\n"
37 : "=&r" (val), "=&r" (tmp1), "=&r" (tmp2)
38 : "0" (val), "r" (m)
39 : "cc", "memory");
40 return val;
41}
42
43#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
44
45extern void __xchg_called_with_bad_pointer(void);
46
47static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr,
48 int size)
49{
50 switch (size) {
51 case 4:
52 return xchg32(ptr, x);
53 case 8:
54 return xchg64(ptr, x);
55 }
56 __xchg_called_with_bad_pointer();
57 return x;
58}
59
60/*
61 * Atomic compare and exchange. Compare OLD with MEM, if identical,
62 * store NEW in MEM. Return the initial value in MEM. Success is
63 * indicated by comparing RETURN with OLD.
64 */
65
66#include <asm-generic/cmpxchg-local.h>
67
68#define __HAVE_ARCH_CMPXCHG 1
69
70static inline unsigned long
71__cmpxchg_u32(volatile int *m, int old, int new)
72{
73 __asm__ __volatile__("cas [%2], %3, %0"
74 : "=&r" (new)
75 : "0" (new), "r" (m), "r" (old)
76 : "memory");
77
78 return new;
79}
80
81static inline unsigned long
82__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
83{
84 __asm__ __volatile__("casx [%2], %3, %0"
85 : "=&r" (new)
86 : "0" (new), "r" (m), "r" (old)
87 : "memory");
88
89 return new;
90}
91
92/* This function doesn't exist, so you'll get a linker error
93 if something tries to do an invalid cmpxchg(). */
94extern void __cmpxchg_called_with_bad_pointer(void);
95
96static inline unsigned long
97__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
98{
99 switch (size) {
100 case 4:
101 return __cmpxchg_u32(ptr, old, new);
102 case 8:
103 return __cmpxchg_u64(ptr, old, new);
104 }
105 __cmpxchg_called_with_bad_pointer();
106 return old;
107}
108
109#define cmpxchg(ptr,o,n) \
110 ({ \
111 __typeof__(*(ptr)) _o_ = (o); \
112 __typeof__(*(ptr)) _n_ = (n); \
113 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
114 (unsigned long)_n_, sizeof(*(ptr))); \
115 })
116
117/*
118 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
119 * them available.
120 */
121
122static inline unsigned long __cmpxchg_local(volatile void *ptr,
123 unsigned long old,
124 unsigned long new, int size)
125{
126 switch (size) {
127 case 4:
128 case 8: return __cmpxchg(ptr, old, new, size);
129 default:
130 return __cmpxchg_local_generic(ptr, old, new, size);
131 }
132
133 return old;
134}
135
136#define cmpxchg_local(ptr, o, n) \
137 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
138 (unsigned long)(n), sizeof(*(ptr))))
139#define cmpxchg64_local(ptr, o, n) \
140 ({ \
141 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
142 cmpxchg_local((ptr), (o), (n)); \
143 })
144
145#endif /* __ARCH_SPARC64_CMPXCHG__ */
diff --git a/arch/sparc/include/asm/cpu_type.h b/arch/sparc/include/asm/cpu_type.h
new file mode 100644
index 00000000000..4ca184d95d8
--- /dev/null
+++ b/arch/sparc/include/asm/cpu_type.h
@@ -0,0 +1,34 @@
1#ifndef __ASM_CPU_TYPE_H
2#define __ASM_CPU_TYPE_H
3
4/*
5 * Sparc (general) CPU types
6 */
7enum sparc_cpu {
8 sun4 = 0x00,
9 sun4c = 0x01,
10 sun4m = 0x02,
11 sun4d = 0x03,
12 sun4e = 0x04,
13 sun4u = 0x05, /* V8 ploos ploos */
14 sun_unknown = 0x06,
15 ap1000 = 0x07, /* almost a sun4m */
16 sparc_leon = 0x08, /* Leon SoC */
17};
18
19#ifdef CONFIG_SPARC32
20extern enum sparc_cpu sparc_cpu_model;
21
22#define ARCH_SUN4C (sparc_cpu_model==sun4c)
23
24#define SUN4M_NCPUS 4 /* Architectural limit of sun4m. */
25
26#else
27
28#define sparc_cpu_model sun4u
29
30/* This cannot ever be a sun4c :) That's just history. */
31#define ARCH_SUN4C 0
32#endif
33
34#endif /* __ASM_CPU_TYPE_H */
diff --git a/arch/sparc/include/asm/exec.h b/arch/sparc/include/asm/exec.h
new file mode 100644
index 00000000000..2e085881e0d
--- /dev/null
+++ b/arch/sparc/include/asm/exec.h
@@ -0,0 +1,6 @@
1#ifndef __SPARC_EXEC_H
2#define __SPARC_EXEC_H
3
4#define arch_align_stack(x) (x)
5
6#endif /* __SPARC_EXEC_H */
diff --git a/arch/sparc/include/asm/floppy_32.h b/arch/sparc/include/asm/floppy_32.h
index 7440915e86d..698d9559fea 100644
--- a/arch/sparc/include/asm/floppy_32.h
+++ b/arch/sparc/include/asm/floppy_32.h
@@ -11,7 +11,6 @@
11 11
12#include <asm/page.h> 12#include <asm/page.h>
13#include <asm/pgtable.h> 13#include <asm/pgtable.h>
14#include <asm/system.h>
15#include <asm/idprom.h> 14#include <asm/idprom.h>
16#include <asm/machines.h> 15#include <asm/machines.h>
17#include <asm/oplib.h> 16#include <asm/oplib.h>
diff --git a/arch/sparc/include/asm/futex_64.h b/arch/sparc/include/asm/futex_64.h
index 444e7bea23b..4e899b0dabf 100644
--- a/arch/sparc/include/asm/futex_64.h
+++ b/arch/sparc/include/asm/futex_64.h
@@ -4,7 +4,6 @@
4#include <linux/futex.h> 4#include <linux/futex.h>
5#include <linux/uaccess.h> 5#include <linux/uaccess.h>
6#include <asm/errno.h> 6#include <asm/errno.h>
7#include <asm/system.h>
8 7
9#define __futex_cas_op(insn, ret, oldval, uaddr, oparg) \ 8#define __futex_cas_op(insn, ret, oldval, uaddr, oparg) \
10 __asm__ __volatile__( \ 9 __asm__ __volatile__( \
diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h
index 2006e5d359d..c1acbd891cb 100644
--- a/arch/sparc/include/asm/io_32.h
+++ b/arch/sparc/include/asm/io_32.h
@@ -6,7 +6,6 @@
6#include <linux/ioport.h> /* struct resource */ 6#include <linux/ioport.h> /* struct resource */
7 7
8#include <asm/page.h> /* IO address mapping routines need this */ 8#include <asm/page.h> /* IO address mapping routines need this */
9#include <asm/system.h>
10#include <asm-generic/pci_iomap.h> 9#include <asm-generic/pci_iomap.h>
11 10
12#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) 11#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h
index 9481e5a6fa9..09b0b88aeb2 100644
--- a/arch/sparc/include/asm/io_64.h
+++ b/arch/sparc/include/asm/io_64.h
@@ -6,7 +6,6 @@
6#include <linux/types.h> 6#include <linux/types.h>
7 7
8#include <asm/page.h> /* IO address mapping routines need this */ 8#include <asm/page.h> /* IO address mapping routines need this */
9#include <asm/system.h>
10#include <asm/asi.h> 9#include <asm/asi.h>
11#include <asm-generic/pci_iomap.h> 10#include <asm-generic/pci_iomap.h>
12 11
diff --git a/arch/sparc/include/asm/irqflags_32.h b/arch/sparc/include/asm/irqflags_32.h
index 14848909e0d..e414c06615c 100644
--- a/arch/sparc/include/asm/irqflags_32.h
+++ b/arch/sparc/include/asm/irqflags_32.h
@@ -13,6 +13,7 @@
13#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16#include <asm/psr.h>
16 17
17extern void arch_local_irq_restore(unsigned long); 18extern void arch_local_irq_restore(unsigned long);
18extern unsigned long arch_local_irq_save(void); 19extern unsigned long arch_local_irq_save(void);
diff --git a/arch/sparc/include/asm/mmu_context_64.h b/arch/sparc/include/asm/mmu_context_64.h
index 666a73fef28..a97fd085ceb 100644
--- a/arch/sparc/include/asm/mmu_context_64.h
+++ b/arch/sparc/include/asm/mmu_context_64.h
@@ -6,7 +6,6 @@
6#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
7 7
8#include <linux/spinlock.h> 8#include <linux/spinlock.h>
9#include <asm/system.h>
10#include <asm/spitfire.h> 9#include <asm/spitfire.h>
11#include <asm-generic/mm_hooks.h> 10#include <asm-generic/mm_hooks.h>
12 11
diff --git a/arch/sparc/include/asm/ns87303.h b/arch/sparc/include/asm/ns87303.h
index af755483e17..6b947ee0f6a 100644
--- a/arch/sparc/include/asm/ns87303.h
+++ b/arch/sparc/include/asm/ns87303.h
@@ -79,7 +79,6 @@
79 79
80#include <linux/spinlock.h> 80#include <linux/spinlock.h>
81 81
82#include <asm/system.h>
83#include <asm/io.h> 82#include <asm/io.h>
84 83
85extern spinlock_t ns87303_lock; 84extern spinlock_t ns87303_lock;
diff --git a/arch/sparc/include/asm/perfctr.h b/arch/sparc/include/asm/perfctr.h
index 8d8720a8770..3332d2cba6c 100644
--- a/arch/sparc/include/asm/perfctr.h
+++ b/arch/sparc/include/asm/perfctr.h
@@ -168,6 +168,29 @@ struct vcounter_struct {
168 unsigned long long vcnt1; 168 unsigned long long vcnt1;
169}; 169};
170 170
171#else /* !(__KERNEL__) */
172
173#ifndef CONFIG_SPARC32
174
175/* Performance counter register access. */
176#define read_pcr(__p) __asm__ __volatile__("rd %%pcr, %0" : "=r" (__p))
177#define write_pcr(__p) __asm__ __volatile__("wr %0, 0x0, %%pcr" : : "r" (__p))
178#define read_pic(__p) __asm__ __volatile__("rd %%pic, %0" : "=r" (__p))
179
180/* Blackbird errata workaround. See commentary in
181 * arch/sparc64/kernel/smp.c:smp_percpu_timer_interrupt()
182 * for more information.
183 */
184#define write_pic(__p) \
185 __asm__ __volatile__("ba,pt %%xcc, 99f\n\t" \
186 " nop\n\t" \
187 ".align 64\n" \
188 "99:wr %0, 0x0, %%pic\n\t" \
189 "rd %%pic, %%g0" : : "r" (__p))
190#define reset_pic() write_pic(0)
191
192#endif /* !CONFIG_SPARC32 */
193
171#endif /* !(__KERNEL__) */ 194#endif /* !(__KERNEL__) */
172 195
173#endif /* !(PERF_COUNTER_API) */ 196#endif /* !(PERF_COUNTER_API) */
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h
index a790cc65747..3d7101860e6 100644
--- a/arch/sparc/include/asm/pgtable_32.h
+++ b/arch/sparc/include/asm/pgtable_32.h
@@ -21,7 +21,7 @@
21#include <asm/vac-ops.h> 21#include <asm/vac-ops.h>
22#include <asm/oplib.h> 22#include <asm/oplib.h>
23#include <asm/btfixup.h> 23#include <asm/btfixup.h>
24#include <asm/system.h> 24#include <asm/cpu_type.h>
25 25
26 26
27struct vm_area_struct; 27struct vm_area_struct;
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h
index 38ebb2c6013..6fa2f7980e6 100644
--- a/arch/sparc/include/asm/pgtable_64.h
+++ b/arch/sparc/include/asm/pgtable_64.h
@@ -19,7 +19,6 @@
19#include <asm/types.h> 19#include <asm/types.h>
20#include <asm/spitfire.h> 20#include <asm/spitfire.h>
21#include <asm/asi.h> 21#include <asm/asi.h>
22#include <asm/system.h>
23#include <asm/page.h> 22#include <asm/page.h>
24#include <asm/processor.h> 23#include <asm/processor.h>
25 24
diff --git a/arch/sparc/include/asm/processor.h b/arch/sparc/include/asm/processor.h
index 9da9646bf6c..2fe99e66e76 100644
--- a/arch/sparc/include/asm/processor.h
+++ b/arch/sparc/include/asm/processor.h
@@ -5,4 +5,7 @@
5#else 5#else
6#include <asm/processor_32.h> 6#include <asm/processor_32.h>
7#endif 7#endif
8
9#define nop() __asm__ __volatile__ ("nop")
10
8#endif 11#endif
diff --git a/arch/sparc/include/asm/processor_64.h b/arch/sparc/include/asm/processor_64.h
index 59fcebb8f44..e713db24993 100644
--- a/arch/sparc/include/asm/processor_64.h
+++ b/arch/sparc/include/asm/processor_64.h
@@ -18,6 +18,9 @@
18#include <asm/ptrace.h> 18#include <asm/ptrace.h>
19#include <asm/page.h> 19#include <asm/page.h>
20 20
21/* Don't hold the runqueue lock over context switch */
22#define __ARCH_WANT_UNLOCKED_CTXSW
23
21/* The sparc has no problems with write protection */ 24/* The sparc has no problems with write protection */
22#define wp_works_ok 1 25#define wp_works_ok 1
23#define wp_works_ok__is_a_macro /* for versions in ksyms.c */ 26#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
diff --git a/arch/sparc/include/asm/ptrace.h b/arch/sparc/include/asm/ptrace.h
index c00c3b5c280..ef8c7c068f5 100644
--- a/arch/sparc/include/asm/ptrace.h
+++ b/arch/sparc/include/asm/ptrace.h
@@ -98,6 +98,8 @@ struct sparc_trapf {
98 */ 98 */
99#ifndef __ASSEMBLY__ 99#ifndef __ASSEMBLY__
100 100
101#include <linux/types.h>
102
101struct pt_regs { 103struct pt_regs {
102 unsigned long psr; 104 unsigned long psr;
103 unsigned long pc; 105 unsigned long pc;
@@ -163,7 +165,6 @@ struct sparc_stackf {
163#ifdef __KERNEL__ 165#ifdef __KERNEL__
164 166
165#include <linux/threads.h> 167#include <linux/threads.h>
166#include <asm/system.h>
167 168
168static inline int pt_regs_trap_type(struct pt_regs *regs) 169static inline int pt_regs_trap_type(struct pt_regs *regs)
169{ 170{
@@ -240,8 +241,6 @@ extern unsigned long profile_pc(struct pt_regs *);
240 241
241#ifdef __KERNEL__ 242#ifdef __KERNEL__
242 243
243#include <asm/system.h>
244
245static inline bool pt_regs_is_syscall(struct pt_regs *regs) 244static inline bool pt_regs_is_syscall(struct pt_regs *regs)
246{ 245{
247 return (regs->psr & PSR_SYSCALL); 246 return (regs->psr & PSR_SYSCALL);
diff --git a/arch/sparc/include/asm/setup.h b/arch/sparc/include/asm/setup.h
index 64718ba2643..00497abec99 100644
--- a/arch/sparc/include/asm/setup.h
+++ b/arch/sparc/include/asm/setup.h
@@ -13,14 +13,30 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16extern char reboot_command[];
17
16#ifdef CONFIG_SPARC32 18#ifdef CONFIG_SPARC32
17/* The CPU that was used for booting 19/* The CPU that was used for booting
18 * Only sun4d + leon may have boot_cpu_id != 0 20 * Only sun4d + leon may have boot_cpu_id != 0
19 */ 21 */
20extern unsigned char boot_cpu_id; 22extern unsigned char boot_cpu_id;
21extern unsigned char boot_cpu_id4; 23extern unsigned char boot_cpu_id4;
24
25extern unsigned long empty_bad_page;
26extern unsigned long empty_bad_page_table;
27extern unsigned long empty_zero_page;
28
29extern int serial_console;
30static inline int con_is_present(void)
31{
32 return serial_console ? 0 : 1;
33}
22#endif 34#endif
23 35
36extern void sun_do_break(void);
37extern int stop_a_enabled;
38extern int scons_pwroff;
39
24#endif /* __KERNEL__ */ 40#endif /* __KERNEL__ */
25 41
26#endif /* _SPARC_SETUP_H */ 42#endif /* _SPARC_SETUP_H */
diff --git a/arch/sparc/include/asm/switch_to.h b/arch/sparc/include/asm/switch_to.h
new file mode 100644
index 00000000000..2dc4fa5c6f8
--- /dev/null
+++ b/arch/sparc/include/asm/switch_to.h
@@ -0,0 +1,8 @@
1#ifndef ___ASM_SPARC_SWITCH_TO_H
2#define ___ASM_SPARC_SWITCH_TO_H
3#if defined(__sparc__) && defined(__arch64__)
4#include <asm/switch_to_64.h>
5#else
6#include <asm/switch_to_32.h>
7#endif
8#endif
diff --git a/arch/sparc/include/asm/switch_to_32.h b/arch/sparc/include/asm/switch_to_32.h
new file mode 100644
index 00000000000..e32e82b76ee
--- /dev/null
+++ b/arch/sparc/include/asm/switch_to_32.h
@@ -0,0 +1,106 @@
1#ifndef __SPARC_SWITCH_TO_H
2#define __SPARC_SWITCH_TO_H
3
4#include <asm/smp.h>
5
6extern struct thread_info *current_set[NR_CPUS];
7
8/*
9 * Flush windows so that the VM switch which follows
10 * would not pull the stack from under us.
11 *
12 * SWITCH_ENTER and SWITH_DO_LAZY_FPU do not work yet (e.g. SMP does not work)
13 * XXX WTF is the above comment? Found in late teen 2.4.x.
14 */
15#ifdef CONFIG_SMP
16#define SWITCH_ENTER(prv) \
17 do { \
18 if (test_tsk_thread_flag(prv, TIF_USEDFPU)) { \
19 put_psr(get_psr() | PSR_EF); \
20 fpsave(&(prv)->thread.float_regs[0], &(prv)->thread.fsr, \
21 &(prv)->thread.fpqueue[0], &(prv)->thread.fpqdepth); \
22 clear_tsk_thread_flag(prv, TIF_USEDFPU); \
23 (prv)->thread.kregs->psr &= ~PSR_EF; \
24 } \
25 } while(0)
26
27#define SWITCH_DO_LAZY_FPU(next) /* */
28#else
29#define SWITCH_ENTER(prv) /* */
30#define SWITCH_DO_LAZY_FPU(nxt) \
31 do { \
32 if (last_task_used_math != (nxt)) \
33 (nxt)->thread.kregs->psr&=~PSR_EF; \
34 } while(0)
35#endif
36
37#define prepare_arch_switch(next) do { \
38 __asm__ __volatile__( \
39 ".globl\tflush_patch_switch\nflush_patch_switch:\n\t" \
40 "save %sp, -0x40, %sp; save %sp, -0x40, %sp; save %sp, -0x40, %sp\n\t" \
41 "save %sp, -0x40, %sp; save %sp, -0x40, %sp; save %sp, -0x40, %sp\n\t" \
42 "save %sp, -0x40, %sp\n\t" \
43 "restore; restore; restore; restore; restore; restore; restore"); \
44} while(0)
45
46 /* Much care has gone into this code, do not touch it.
47 *
48 * We need to loadup regs l0/l1 for the newly forked child
49 * case because the trap return path relies on those registers
50 * holding certain values, gcc is told that they are clobbered.
51 * Gcc needs registers for 3 values in and 1 value out, so we
52 * clobber every non-fixed-usage register besides l2/l3/o4/o5. -DaveM
53 *
54 * Hey Dave, that do not touch sign is too much of an incentive
55 * - Anton & Pete
56 */
57#define switch_to(prev, next, last) do { \
58 SWITCH_ENTER(prev); \
59 SWITCH_DO_LAZY_FPU(next); \
60 cpumask_set_cpu(smp_processor_id(), mm_cpumask(next->active_mm)); \
61 __asm__ __volatile__( \
62 "sethi %%hi(here - 0x8), %%o7\n\t" \
63 "mov %%g6, %%g3\n\t" \
64 "or %%o7, %%lo(here - 0x8), %%o7\n\t" \
65 "rd %%psr, %%g4\n\t" \
66 "std %%sp, [%%g6 + %4]\n\t" \
67 "rd %%wim, %%g5\n\t" \
68 "wr %%g4, 0x20, %%psr\n\t" \
69 "nop\n\t" \
70 "std %%g4, [%%g6 + %3]\n\t" \
71 "ldd [%2 + %3], %%g4\n\t" \
72 "mov %2, %%g6\n\t" \
73 ".globl patchme_store_new_current\n" \
74"patchme_store_new_current:\n\t" \
75 "st %2, [%1]\n\t" \
76 "wr %%g4, 0x20, %%psr\n\t" \
77 "nop\n\t" \
78 "nop\n\t" \
79 "nop\n\t" /* LEON needs all 3 nops: load to %sp depends on CWP. */ \
80 "ldd [%%g6 + %4], %%sp\n\t" \
81 "wr %%g5, 0x0, %%wim\n\t" \
82 "ldd [%%sp + 0x00], %%l0\n\t" \
83 "ldd [%%sp + 0x38], %%i6\n\t" \
84 "wr %%g4, 0x0, %%psr\n\t" \
85 "nop\n\t" \
86 "nop\n\t" \
87 "jmpl %%o7 + 0x8, %%g0\n\t" \
88 " ld [%%g3 + %5], %0\n\t" \
89 "here:\n" \
90 : "=&r" (last) \
91 : "r" (&(current_set[hard_smp_processor_id()])), \
92 "r" (task_thread_info(next)), \
93 "i" (TI_KPSR), \
94 "i" (TI_KSP), \
95 "i" (TI_TASK) \
96 : "g1", "g2", "g3", "g4", "g5", "g7", \
97 "l0", "l1", "l3", "l4", "l5", "l6", "l7", \
98 "i0", "i1", "i2", "i3", "i4", "i5", \
99 "o0", "o1", "o2", "o3", "o7"); \
100 } while(0)
101
102extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
103 void *fpqueue, unsigned long *fpqdepth);
104extern void synchronize_user_stack(void);
105
106#endif /* __SPARC_SWITCH_TO_H */
diff --git a/arch/sparc/include/asm/switch_to_64.h b/arch/sparc/include/asm/switch_to_64.h
new file mode 100644
index 00000000000..7923c4a2be3
--- /dev/null
+++ b/arch/sparc/include/asm/switch_to_64.h
@@ -0,0 +1,72 @@
1#ifndef __SPARC64_SWITCH_TO_64_H
2#define __SPARC64_SWITCH_TO_64_H
3
4#include <asm/visasm.h>
5
6#define prepare_arch_switch(next) \
7do { \
8 flushw_all(); \
9} while (0)
10
11 /* See what happens when you design the chip correctly?
12 *
13 * We tell gcc we clobber all non-fixed-usage registers except
14 * for l0/l1. It will use one for 'next' and the other to hold
15 * the output value of 'last'. 'next' is not referenced again
16 * past the invocation of switch_to in the scheduler, so we need
17 * not preserve it's value. Hairy, but it lets us remove 2 loads
18 * and 2 stores in this critical code path. -DaveM
19 */
20#define switch_to(prev, next, last) \
21do { flush_tlb_pending(); \
22 save_and_clear_fpu(); \
23 /* If you are tempted to conditionalize the following */ \
24 /* so that ASI is only written if it changes, think again. */ \
25 __asm__ __volatile__("wr %%g0, %0, %%asi" \
26 : : "r" (__thread_flag_byte_ptr(task_thread_info(next))[TI_FLAG_BYTE_CURRENT_DS]));\
27 trap_block[current_thread_info()->cpu].thread = \
28 task_thread_info(next); \
29 __asm__ __volatile__( \
30 "mov %%g4, %%g7\n\t" \
31 "stx %%i6, [%%sp + 2047 + 0x70]\n\t" \
32 "stx %%i7, [%%sp + 2047 + 0x78]\n\t" \
33 "rdpr %%wstate, %%o5\n\t" \
34 "stx %%o6, [%%g6 + %6]\n\t" \
35 "stb %%o5, [%%g6 + %5]\n\t" \
36 "rdpr %%cwp, %%o5\n\t" \
37 "stb %%o5, [%%g6 + %8]\n\t" \
38 "wrpr %%g0, 15, %%pil\n\t" \
39 "mov %4, %%g6\n\t" \
40 "ldub [%4 + %8], %%g1\n\t" \
41 "wrpr %%g1, %%cwp\n\t" \
42 "ldx [%%g6 + %6], %%o6\n\t" \
43 "ldub [%%g6 + %5], %%o5\n\t" \
44 "ldub [%%g6 + %7], %%o7\n\t" \
45 "wrpr %%o5, 0x0, %%wstate\n\t" \
46 "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \
47 "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \
48 "ldx [%%g6 + %9], %%g4\n\t" \
49 "wrpr %%g0, 14, %%pil\n\t" \
50 "brz,pt %%o7, switch_to_pc\n\t" \
51 " mov %%g7, %0\n\t" \
52 "sethi %%hi(ret_from_syscall), %%g1\n\t" \
53 "jmpl %%g1 + %%lo(ret_from_syscall), %%g0\n\t" \
54 " nop\n\t" \
55 ".globl switch_to_pc\n\t" \
56 "switch_to_pc:\n\t" \
57 : "=&r" (last), "=r" (current), "=r" (current_thread_info_reg), \
58 "=r" (__local_per_cpu_offset) \
59 : "0" (task_thread_info(next)), \
60 "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \
61 "i" (TI_CWP), "i" (TI_TASK) \
62 : "cc", \
63 "g1", "g2", "g3", "g7", \
64 "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
65 "i0", "i1", "i2", "i3", "i4", "i5", \
66 "o0", "o1", "o2", "o3", "o4", "o5", "o7"); \
67} while(0)
68
69extern void synchronize_user_stack(void);
70extern void fault_in_user_windows(void);
71
72#endif /* __SPARC64_SWITCH_TO_64_H */
diff --git a/arch/sparc/include/asm/system.h b/arch/sparc/include/asm/system.h
deleted file mode 100644
index 7944a7cfc99..00000000000
--- a/arch/sparc/include/asm/system.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ___ASM_SPARC_SYSTEM_H
2#define ___ASM_SPARC_SYSTEM_H
3#if defined(__sparc__) && defined(__arch64__)
4#include <asm/system_64.h>
5#else
6#include <asm/system_32.h>
7#endif
8#endif
diff --git a/arch/sparc/include/asm/system_32.h b/arch/sparc/include/asm/system_32.h
deleted file mode 100644
index aba16092a81..00000000000
--- a/arch/sparc/include/asm/system_32.h
+++ /dev/null
@@ -1,284 +0,0 @@
1#ifndef __SPARC_SYSTEM_H
2#define __SPARC_SYSTEM_H
3
4#include <linux/kernel.h>
5#include <linux/threads.h> /* NR_CPUS */
6#include <linux/thread_info.h>
7
8#include <asm/page.h>
9#include <asm/psr.h>
10#include <asm/ptrace.h>
11#include <asm/btfixup.h>
12#include <asm/smp.h>
13
14#ifndef __ASSEMBLY__
15
16#include <linux/irqflags.h>
17
18/*
19 * Sparc (general) CPU types
20 */
21enum sparc_cpu {
22 sun4 = 0x00,
23 sun4c = 0x01,
24 sun4m = 0x02,
25 sun4d = 0x03,
26 sun4e = 0x04,
27 sun4u = 0x05, /* V8 ploos ploos */
28 sun_unknown = 0x06,
29 ap1000 = 0x07, /* almost a sun4m */
30 sparc_leon = 0x08, /* Leon SoC */
31};
32
33/* Really, userland should not be looking at any of this... */
34#ifdef __KERNEL__
35
36extern enum sparc_cpu sparc_cpu_model;
37
38#define ARCH_SUN4C (sparc_cpu_model==sun4c)
39
40#define SUN4M_NCPUS 4 /* Architectural limit of sun4m. */
41
42extern char reboot_command[];
43
44extern struct thread_info *current_set[NR_CPUS];
45
46extern unsigned long empty_bad_page;
47extern unsigned long empty_bad_page_table;
48extern unsigned long empty_zero_page;
49
50extern void sun_do_break(void);
51extern int serial_console;
52extern int stop_a_enabled;
53extern int scons_pwroff;
54
55static inline int con_is_present(void)
56{
57 return serial_console ? 0 : 1;
58}
59
60/* When a context switch happens we must flush all user windows so that
61 * the windows of the current process are flushed onto its stack. This
62 * way the windows are all clean for the next process and the stack
63 * frames are up to date.
64 */
65extern void flush_user_windows(void);
66extern void kill_user_windows(void);
67extern void synchronize_user_stack(void);
68extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
69 void *fpqueue, unsigned long *fpqdepth);
70
71#ifdef CONFIG_SMP
72#define SWITCH_ENTER(prv) \
73 do { \
74 if (test_tsk_thread_flag(prv, TIF_USEDFPU)) { \
75 put_psr(get_psr() | PSR_EF); \
76 fpsave(&(prv)->thread.float_regs[0], &(prv)->thread.fsr, \
77 &(prv)->thread.fpqueue[0], &(prv)->thread.fpqdepth); \
78 clear_tsk_thread_flag(prv, TIF_USEDFPU); \
79 (prv)->thread.kregs->psr &= ~PSR_EF; \
80 } \
81 } while(0)
82
83#define SWITCH_DO_LAZY_FPU(next) /* */
84#else
85#define SWITCH_ENTER(prv) /* */
86#define SWITCH_DO_LAZY_FPU(nxt) \
87 do { \
88 if (last_task_used_math != (nxt)) \
89 (nxt)->thread.kregs->psr&=~PSR_EF; \
90 } while(0)
91#endif
92
93extern void flushw_all(void);
94
95/*
96 * Flush windows so that the VM switch which follows
97 * would not pull the stack from under us.
98 *
99 * SWITCH_ENTER and SWITH_DO_LAZY_FPU do not work yet (e.g. SMP does not work)
100 * XXX WTF is the above comment? Found in late teen 2.4.x.
101 */
102#define prepare_arch_switch(next) do { \
103 __asm__ __volatile__( \
104 ".globl\tflush_patch_switch\nflush_patch_switch:\n\t" \
105 "save %sp, -0x40, %sp; save %sp, -0x40, %sp; save %sp, -0x40, %sp\n\t" \
106 "save %sp, -0x40, %sp; save %sp, -0x40, %sp; save %sp, -0x40, %sp\n\t" \
107 "save %sp, -0x40, %sp\n\t" \
108 "restore; restore; restore; restore; restore; restore; restore"); \
109} while(0)
110
111 /* Much care has gone into this code, do not touch it.
112 *
113 * We need to loadup regs l0/l1 for the newly forked child
114 * case because the trap return path relies on those registers
115 * holding certain values, gcc is told that they are clobbered.
116 * Gcc needs registers for 3 values in and 1 value out, so we
117 * clobber every non-fixed-usage register besides l2/l3/o4/o5. -DaveM
118 *
119 * Hey Dave, that do not touch sign is too much of an incentive
120 * - Anton & Pete
121 */
122#define switch_to(prev, next, last) do { \
123 SWITCH_ENTER(prev); \
124 SWITCH_DO_LAZY_FPU(next); \
125 cpumask_set_cpu(smp_processor_id(), mm_cpumask(next->active_mm)); \
126 __asm__ __volatile__( \
127 "sethi %%hi(here - 0x8), %%o7\n\t" \
128 "mov %%g6, %%g3\n\t" \
129 "or %%o7, %%lo(here - 0x8), %%o7\n\t" \
130 "rd %%psr, %%g4\n\t" \
131 "std %%sp, [%%g6 + %4]\n\t" \
132 "rd %%wim, %%g5\n\t" \
133 "wr %%g4, 0x20, %%psr\n\t" \
134 "nop\n\t" \
135 "std %%g4, [%%g6 + %3]\n\t" \
136 "ldd [%2 + %3], %%g4\n\t" \
137 "mov %2, %%g6\n\t" \
138 ".globl patchme_store_new_current\n" \
139"patchme_store_new_current:\n\t" \
140 "st %2, [%1]\n\t" \
141 "wr %%g4, 0x20, %%psr\n\t" \
142 "nop\n\t" \
143 "nop\n\t" \
144 "nop\n\t" /* LEON needs all 3 nops: load to %sp depends on CWP. */ \
145 "ldd [%%g6 + %4], %%sp\n\t" \
146 "wr %%g5, 0x0, %%wim\n\t" \
147 "ldd [%%sp + 0x00], %%l0\n\t" \
148 "ldd [%%sp + 0x38], %%i6\n\t" \
149 "wr %%g4, 0x0, %%psr\n\t" \
150 "nop\n\t" \
151 "nop\n\t" \
152 "jmpl %%o7 + 0x8, %%g0\n\t" \
153 " ld [%%g3 + %5], %0\n\t" \
154 "here:\n" \
155 : "=&r" (last) \
156 : "r" (&(current_set[hard_smp_processor_id()])), \
157 "r" (task_thread_info(next)), \
158 "i" (TI_KPSR), \
159 "i" (TI_KSP), \
160 "i" (TI_TASK) \
161 : "g1", "g2", "g3", "g4", "g5", "g7", \
162 "l0", "l1", "l3", "l4", "l5", "l6", "l7", \
163 "i0", "i1", "i2", "i3", "i4", "i5", \
164 "o0", "o1", "o2", "o3", "o7"); \
165 } while(0)
166
167/* XXX Change this if we ever use a PSO mode kernel. */
168#define mb() __asm__ __volatile__ ("" : : : "memory")
169#define rmb() mb()
170#define wmb() mb()
171#define read_barrier_depends() do { } while(0)
172#define set_mb(__var, __value) do { __var = __value; mb(); } while(0)
173#define smp_mb() __asm__ __volatile__("":::"memory")
174#define smp_rmb() __asm__ __volatile__("":::"memory")
175#define smp_wmb() __asm__ __volatile__("":::"memory")
176#define smp_read_barrier_depends() do { } while(0)
177
178#define nop() __asm__ __volatile__ ("nop")
179
180/* This has special calling conventions */
181#ifndef CONFIG_SMP
182BTFIXUPDEF_CALL(void, ___xchg32, void)
183#endif
184
185static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned long val)
186{
187#ifdef CONFIG_SMP
188 __asm__ __volatile__("swap [%2], %0"
189 : "=&r" (val)
190 : "0" (val), "r" (m)
191 : "memory");
192 return val;
193#else
194 register unsigned long *ptr asm("g1");
195 register unsigned long ret asm("g2");
196
197 ptr = (unsigned long *) m;
198 ret = val;
199
200 /* Note: this is magic and the nop there is
201 really needed. */
202 __asm__ __volatile__(
203 "mov %%o7, %%g4\n\t"
204 "call ___f____xchg32\n\t"
205 " nop\n\t"
206 : "=&r" (ret)
207 : "0" (ret), "r" (ptr)
208 : "g3", "g4", "g7", "memory", "cc");
209
210 return ret;
211#endif
212}
213
214#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
215
216extern void __xchg_called_with_bad_pointer(void);
217
218static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size)
219{
220 switch (size) {
221 case 4:
222 return xchg_u32(ptr, x);
223 }
224 __xchg_called_with_bad_pointer();
225 return x;
226}
227
228/* Emulate cmpxchg() the same way we emulate atomics,
229 * by hashing the object address and indexing into an array
230 * of spinlocks to get a bit of performance...
231 *
232 * See arch/sparc/lib/atomic32.c for implementation.
233 *
234 * Cribbed from <asm-parisc/atomic.h>
235 */
236#define __HAVE_ARCH_CMPXCHG 1
237
238/* bug catcher for when unsupported size is used - won't link */
239extern void __cmpxchg_called_with_bad_pointer(void);
240/* we only need to support cmpxchg of a u32 on sparc */
241extern unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_);
242
243/* don't worry...optimizer will get rid of most of this */
244static inline unsigned long
245__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
246{
247 switch (size) {
248 case 4:
249 return __cmpxchg_u32((u32 *)ptr, (u32)old, (u32)new_);
250 default:
251 __cmpxchg_called_with_bad_pointer();
252 break;
253 }
254 return old;
255}
256
257#define cmpxchg(ptr, o, n) \
258({ \
259 __typeof__(*(ptr)) _o_ = (o); \
260 __typeof__(*(ptr)) _n_ = (n); \
261 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
262 (unsigned long)_n_, sizeof(*(ptr))); \
263})
264
265#include <asm-generic/cmpxchg-local.h>
266
267/*
268 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
269 * them available.
270 */
271#define cmpxchg_local(ptr, o, n) \
272 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
273 (unsigned long)(n), sizeof(*(ptr))))
274#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
275
276extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noreturn));
277
278#endif /* __KERNEL__ */
279
280#endif /* __ASSEMBLY__ */
281
282#define arch_align_stack(x) (x)
283
284#endif /* !(__SPARC_SYSTEM_H) */
diff --git a/arch/sparc/include/asm/system_64.h b/arch/sparc/include/asm/system_64.h
deleted file mode 100644
index 10bcabce97b..00000000000
--- a/arch/sparc/include/asm/system_64.h
+++ /dev/null
@@ -1,331 +0,0 @@
1#ifndef __SPARC64_SYSTEM_H
2#define __SPARC64_SYSTEM_H
3
4#include <asm/ptrace.h>
5#include <asm/processor.h>
6#include <asm/visasm.h>
7
8#ifndef __ASSEMBLY__
9
10#include <linux/irqflags.h>
11#include <asm-generic/cmpxchg-local.h>
12
13/*
14 * Sparc (general) CPU types
15 */
16enum sparc_cpu {
17 sun4 = 0x00,
18 sun4c = 0x01,
19 sun4m = 0x02,
20 sun4d = 0x03,
21 sun4e = 0x04,
22 sun4u = 0x05, /* V8 ploos ploos */
23 sun_unknown = 0x06,
24 ap1000 = 0x07, /* almost a sun4m */
25};
26
27#define sparc_cpu_model sun4u
28
29/* This cannot ever be a sun4c :) That's just history. */
30#define ARCH_SUN4C 0
31
32extern char reboot_command[];
33
34/* These are here in an effort to more fully work around Spitfire Errata
35 * #51. Essentially, if a memory barrier occurs soon after a mispredicted
36 * branch, the chip can stop executing instructions until a trap occurs.
37 * Therefore, if interrupts are disabled, the chip can hang forever.
38 *
39 * It used to be believed that the memory barrier had to be right in the
40 * delay slot, but a case has been traced recently wherein the memory barrier
41 * was one instruction after the branch delay slot and the chip still hung.
42 * The offending sequence was the following in sym_wakeup_done() of the
43 * sym53c8xx_2 driver:
44 *
45 * call sym_ccb_from_dsa, 0
46 * movge %icc, 0, %l0
47 * brz,pn %o0, .LL1303
48 * mov %o0, %l2
49 * membar #LoadLoad
50 *
51 * The branch has to be mispredicted for the bug to occur. Therefore, we put
52 * the memory barrier explicitly into a "branch always, predicted taken"
53 * delay slot to avoid the problem case.
54 */
55#define membar_safe(type) \
56do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
57 " membar " type "\n" \
58 "1:\n" \
59 : : : "memory"); \
60} while (0)
61
62/* The kernel always executes in TSO memory model these days,
63 * and furthermore most sparc64 chips implement more stringent
64 * memory ordering than required by the specifications.
65 */
66#define mb() membar_safe("#StoreLoad")
67#define rmb() __asm__ __volatile__("":::"memory")
68#define wmb() __asm__ __volatile__("":::"memory")
69
70#endif
71
72#define nop() __asm__ __volatile__ ("nop")
73
74#define read_barrier_depends() do { } while(0)
75#define set_mb(__var, __value) \
76 do { __var = __value; membar_safe("#StoreLoad"); } while(0)
77
78#ifdef CONFIG_SMP
79#define smp_mb() mb()
80#define smp_rmb() rmb()
81#define smp_wmb() wmb()
82#else
83#define smp_mb() __asm__ __volatile__("":::"memory")
84#define smp_rmb() __asm__ __volatile__("":::"memory")
85#define smp_wmb() __asm__ __volatile__("":::"memory")
86#endif
87
88#define smp_read_barrier_depends() do { } while(0)
89
90#define flushi(addr) __asm__ __volatile__ ("flush %0" : : "r" (addr) : "memory")
91
92#define flushw_all() __asm__ __volatile__("flushw")
93
94/* Performance counter register access. */
95#define read_pcr(__p) __asm__ __volatile__("rd %%pcr, %0" : "=r" (__p))
96#define write_pcr(__p) __asm__ __volatile__("wr %0, 0x0, %%pcr" : : "r" (__p))
97#define read_pic(__p) __asm__ __volatile__("rd %%pic, %0" : "=r" (__p))
98
99/* Blackbird errata workaround. See commentary in
100 * arch/sparc64/kernel/smp.c:smp_percpu_timer_interrupt()
101 * for more information.
102 */
103#define write_pic(__p) \
104 __asm__ __volatile__("ba,pt %%xcc, 99f\n\t" \
105 " nop\n\t" \
106 ".align 64\n" \
107 "99:wr %0, 0x0, %%pic\n\t" \
108 "rd %%pic, %%g0" : : "r" (__p))
109#define reset_pic() write_pic(0)
110
111#ifndef __ASSEMBLY__
112
113extern void sun_do_break(void);
114extern int stop_a_enabled;
115extern int scons_pwroff;
116
117extern void fault_in_user_windows(void);
118extern void synchronize_user_stack(void);
119
120extern void __flushw_user(void);
121#define flushw_user() __flushw_user()
122
123#define flush_user_windows flushw_user
124#define flush_register_windows flushw_all
125
126/* Don't hold the runqueue lock over context switch */
127#define __ARCH_WANT_UNLOCKED_CTXSW
128#define prepare_arch_switch(next) \
129do { \
130 flushw_all(); \
131} while (0)
132
133 /* See what happens when you design the chip correctly?
134 *
135 * We tell gcc we clobber all non-fixed-usage registers except
136 * for l0/l1. It will use one for 'next' and the other to hold
137 * the output value of 'last'. 'next' is not referenced again
138 * past the invocation of switch_to in the scheduler, so we need
139 * not preserve it's value. Hairy, but it lets us remove 2 loads
140 * and 2 stores in this critical code path. -DaveM
141 */
142#define switch_to(prev, next, last) \
143do { flush_tlb_pending(); \
144 save_and_clear_fpu(); \
145 /* If you are tempted to conditionalize the following */ \
146 /* so that ASI is only written if it changes, think again. */ \
147 __asm__ __volatile__("wr %%g0, %0, %%asi" \
148 : : "r" (__thread_flag_byte_ptr(task_thread_info(next))[TI_FLAG_BYTE_CURRENT_DS]));\
149 trap_block[current_thread_info()->cpu].thread = \
150 task_thread_info(next); \
151 __asm__ __volatile__( \
152 "mov %%g4, %%g7\n\t" \
153 "stx %%i6, [%%sp + 2047 + 0x70]\n\t" \
154 "stx %%i7, [%%sp + 2047 + 0x78]\n\t" \
155 "rdpr %%wstate, %%o5\n\t" \
156 "stx %%o6, [%%g6 + %6]\n\t" \
157 "stb %%o5, [%%g6 + %5]\n\t" \
158 "rdpr %%cwp, %%o5\n\t" \
159 "stb %%o5, [%%g6 + %8]\n\t" \
160 "wrpr %%g0, 15, %%pil\n\t" \
161 "mov %4, %%g6\n\t" \
162 "ldub [%4 + %8], %%g1\n\t" \
163 "wrpr %%g1, %%cwp\n\t" \
164 "ldx [%%g6 + %6], %%o6\n\t" \
165 "ldub [%%g6 + %5], %%o5\n\t" \
166 "ldub [%%g6 + %7], %%o7\n\t" \
167 "wrpr %%o5, 0x0, %%wstate\n\t" \
168 "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \
169 "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \
170 "ldx [%%g6 + %9], %%g4\n\t" \
171 "wrpr %%g0, 14, %%pil\n\t" \
172 "brz,pt %%o7, switch_to_pc\n\t" \
173 " mov %%g7, %0\n\t" \
174 "sethi %%hi(ret_from_syscall), %%g1\n\t" \
175 "jmpl %%g1 + %%lo(ret_from_syscall), %%g0\n\t" \
176 " nop\n\t" \
177 ".globl switch_to_pc\n\t" \
178 "switch_to_pc:\n\t" \
179 : "=&r" (last), "=r" (current), "=r" (current_thread_info_reg), \
180 "=r" (__local_per_cpu_offset) \
181 : "0" (task_thread_info(next)), \
182 "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \
183 "i" (TI_CWP), "i" (TI_TASK) \
184 : "cc", \
185 "g1", "g2", "g3", "g7", \
186 "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
187 "i0", "i1", "i2", "i3", "i4", "i5", \
188 "o0", "o1", "o2", "o3", "o4", "o5", "o7"); \
189} while(0)
190
191static inline unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val)
192{
193 unsigned long tmp1, tmp2;
194
195 __asm__ __volatile__(
196" mov %0, %1\n"
197"1: lduw [%4], %2\n"
198" cas [%4], %2, %0\n"
199" cmp %2, %0\n"
200" bne,a,pn %%icc, 1b\n"
201" mov %1, %0\n"
202 : "=&r" (val), "=&r" (tmp1), "=&r" (tmp2)
203 : "0" (val), "r" (m)
204 : "cc", "memory");
205 return val;
206}
207
208static inline unsigned long xchg64(__volatile__ unsigned long *m, unsigned long val)
209{
210 unsigned long tmp1, tmp2;
211
212 __asm__ __volatile__(
213" mov %0, %1\n"
214"1: ldx [%4], %2\n"
215" casx [%4], %2, %0\n"
216" cmp %2, %0\n"
217" bne,a,pn %%xcc, 1b\n"
218" mov %1, %0\n"
219 : "=&r" (val), "=&r" (tmp1), "=&r" (tmp2)
220 : "0" (val), "r" (m)
221 : "cc", "memory");
222 return val;
223}
224
225#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
226
227extern void __xchg_called_with_bad_pointer(void);
228
229static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr,
230 int size)
231{
232 switch (size) {
233 case 4:
234 return xchg32(ptr, x);
235 case 8:
236 return xchg64(ptr, x);
237 }
238 __xchg_called_with_bad_pointer();
239 return x;
240}
241
242extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noreturn));
243
244/*
245 * Atomic compare and exchange. Compare OLD with MEM, if identical,
246 * store NEW in MEM. Return the initial value in MEM. Success is
247 * indicated by comparing RETURN with OLD.
248 */
249
250#define __HAVE_ARCH_CMPXCHG 1
251
252static inline unsigned long
253__cmpxchg_u32(volatile int *m, int old, int new)
254{
255 __asm__ __volatile__("cas [%2], %3, %0"
256 : "=&r" (new)
257 : "0" (new), "r" (m), "r" (old)
258 : "memory");
259
260 return new;
261}
262
263static inline unsigned long
264__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
265{
266 __asm__ __volatile__("casx [%2], %3, %0"
267 : "=&r" (new)
268 : "0" (new), "r" (m), "r" (old)
269 : "memory");
270
271 return new;
272}
273
274/* This function doesn't exist, so you'll get a linker error
275 if something tries to do an invalid cmpxchg(). */
276extern void __cmpxchg_called_with_bad_pointer(void);
277
278static inline unsigned long
279__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
280{
281 switch (size) {
282 case 4:
283 return __cmpxchg_u32(ptr, old, new);
284 case 8:
285 return __cmpxchg_u64(ptr, old, new);
286 }
287 __cmpxchg_called_with_bad_pointer();
288 return old;
289}
290
291#define cmpxchg(ptr,o,n) \
292 ({ \
293 __typeof__(*(ptr)) _o_ = (o); \
294 __typeof__(*(ptr)) _n_ = (n); \
295 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
296 (unsigned long)_n_, sizeof(*(ptr))); \
297 })
298
299/*
300 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
301 * them available.
302 */
303
304static inline unsigned long __cmpxchg_local(volatile void *ptr,
305 unsigned long old,
306 unsigned long new, int size)
307{
308 switch (size) {
309 case 4:
310 case 8: return __cmpxchg(ptr, old, new, size);
311 default:
312 return __cmpxchg_local_generic(ptr, old, new, size);
313 }
314
315 return old;
316}
317
318#define cmpxchg_local(ptr, o, n) \
319 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
320 (unsigned long)(n), sizeof(*(ptr))))
321#define cmpxchg64_local(ptr, o, n) \
322 ({ \
323 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
324 cmpxchg_local((ptr), (o), (n)); \
325 })
326
327#endif /* !(__ASSEMBLY__) */
328
329#define arch_align_stack(x) (x)
330
331#endif /* !(__SPARC64_SYSTEM_H) */
diff --git a/arch/sparc/include/asm/timer_32.h b/arch/sparc/include/asm/timer_32.h
index 2ec030ef381..1a91e11dd10 100644
--- a/arch/sparc/include/asm/timer_32.h
+++ b/arch/sparc/include/asm/timer_32.h
@@ -8,12 +8,13 @@
8#ifndef _SPARC_TIMER_H 8#ifndef _SPARC_TIMER_H
9#define _SPARC_TIMER_H 9#define _SPARC_TIMER_H
10 10
11#include <asm/system.h> /* For SUN4M_NCPUS */ 11#include <asm/cpu_type.h> /* For SUN4M_NCPUS */
12#include <asm/btfixup.h> 12#include <asm/btfixup.h>
13 13
14extern __volatile__ unsigned int *master_l10_counter; 14extern __volatile__ unsigned int *master_l10_counter;
15 15
16/* FIXME: Make do_[gs]ettimeofday btfixup calls */ 16/* FIXME: Make do_[gs]ettimeofday btfixup calls */
17struct timespec;
17BTFIXUPDEF_CALL(int, bus_do_settimeofday, struct timespec *tv) 18BTFIXUPDEF_CALL(int, bus_do_settimeofday, struct timespec *tv)
18#define bus_do_settimeofday(tv) BTFIXUP_CALL(bus_do_settimeofday)(tv) 19#define bus_do_settimeofday(tv) BTFIXUP_CALL(bus_do_settimeofday)(tv)
19 20
diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h
index 3e1449f0779..a1091afb883 100644
--- a/arch/sparc/include/asm/uaccess_64.h
+++ b/arch/sparc/include/asm/uaccess_64.h
@@ -11,7 +11,6 @@
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/thread_info.h> 12#include <linux/thread_info.h>
13#include <asm/asi.h> 13#include <asm/asi.h>
14#include <asm/system.h>
15#include <asm/spitfire.h> 14#include <asm/spitfire.h>
16#include <asm-generic/uaccess-unaligned.h> 15#include <asm-generic/uaccess-unaligned.h>
17#endif 16#endif
diff --git a/arch/sparc/kernel/auxio_32.c b/arch/sparc/kernel/auxio_32.c
index f7ea8f03271..56d0f52c3e6 100644
--- a/arch/sparc/kernel/auxio_32.c
+++ b/arch/sparc/kernel/auxio_32.c
@@ -13,6 +13,7 @@
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/auxio.h> 14#include <asm/auxio.h>
15#include <asm/string.h> /* memset(), Linux has no bzero() */ 15#include <asm/string.h> /* memset(), Linux has no bzero() */
16#include <asm/cpu_type.h>
16 17
17/* Probe and map in the Auxiliary I/O register */ 18/* Probe and map in the Auxiliary I/O register */
18 19
diff --git a/arch/sparc/kernel/devices.c b/arch/sparc/kernel/devices.c
index 113c052c304..6b2f56a6f8a 100644
--- a/arch/sparc/kernel/devices.c
+++ b/arch/sparc/kernel/devices.c
@@ -17,8 +17,8 @@
17#include <asm/oplib.h> 17#include <asm/oplib.h>
18#include <asm/prom.h> 18#include <asm/prom.h>
19#include <asm/smp.h> 19#include <asm/smp.h>
20#include <asm/system.h>
21#include <asm/cpudata.h> 20#include <asm/cpudata.h>
21#include <asm/cpu_type.h>
22 22
23extern void clock_stop_probe(void); /* tadpole.c */ 23extern void clock_stop_probe(void); /* tadpole.c */
24extern void sun4c_probe_memerr_reg(void); 24extern void sun4c_probe_memerr_reg(void);
diff --git a/arch/sparc/kernel/irq.h b/arch/sparc/kernel/irq.h
index 42851122bbd..5a021dd2f85 100644
--- a/arch/sparc/kernel/irq.h
+++ b/arch/sparc/kernel/irq.h
@@ -1,6 +1,7 @@
1#include <linux/platform_device.h> 1#include <linux/platform_device.h>
2 2
3#include <asm/btfixup.h> 3#include <asm/btfixup.h>
4#include <asm/cpu_type.h>
4 5
5struct irq_bucket { 6struct irq_bucket {
6 struct irq_bucket *next; 7 struct irq_bucket *next;
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index d45b710ea7e..dff2c3d7d37 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -26,7 +26,6 @@
26#include <asm/ptrace.h> 26#include <asm/ptrace.h>
27#include <asm/processor.h> 27#include <asm/processor.h>
28#include <linux/atomic.h> 28#include <linux/atomic.h>
29#include <asm/system.h>
30#include <asm/irq.h> 29#include <asm/irq.h>
31#include <asm/io.h> 30#include <asm/io.h>
32#include <asm/iommu.h> 31#include <asm/iommu.h>
diff --git a/arch/sparc/kernel/kgdb_32.c b/arch/sparc/kernel/kgdb_32.c
index 539243b236f..2e424a576a3 100644
--- a/arch/sparc/kernel/kgdb_32.c
+++ b/arch/sparc/kernel/kgdb_32.c
@@ -9,6 +9,7 @@
9#include <asm/kdebug.h> 9#include <asm/kdebug.h>
10#include <asm/ptrace.h> 10#include <asm/ptrace.h>
11#include <asm/irq.h> 11#include <asm/irq.h>
12#include <asm/cacheflush.h>
12 13
13extern unsigned long trapbase; 14extern unsigned long trapbase;
14 15
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c
index e5519870c3d..276359e1ff5 100644
--- a/arch/sparc/kernel/module.c
+++ b/arch/sparc/kernel/module.c
@@ -16,6 +16,7 @@
16 16
17#include <asm/processor.h> 17#include <asm/processor.h>
18#include <asm/spitfire.h> 18#include <asm/spitfire.h>
19#include <asm/cacheflush.h>
19 20
20#include "entry.h" 21#include "entry.h"
21 22
diff --git a/arch/sparc/kernel/muldiv.c b/arch/sparc/kernel/muldiv.c
index 6ce1021d487..f7db516b07d 100644
--- a/arch/sparc/kernel/muldiv.c
+++ b/arch/sparc/kernel/muldiv.c
@@ -14,7 +14,6 @@
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <asm/ptrace.h> 15#include <asm/ptrace.h>
16#include <asm/processor.h> 16#include <asm/processor.h>
17#include <asm/system.h>
18#include <asm/uaccess.h> 17#include <asm/uaccess.h>
19 18
20#include "kernel.h" 19#include "kernel.h"
diff --git a/arch/sparc/kernel/nmi.c b/arch/sparc/kernel/nmi.c
index c76fe0b5bd9..eb1c1f010a4 100644
--- a/arch/sparc/kernel/nmi.c
+++ b/arch/sparc/kernel/nmi.c
@@ -22,6 +22,7 @@
22#include <asm/perf_event.h> 22#include <asm/perf_event.h>
23#include <asm/ptrace.h> 23#include <asm/ptrace.h>
24#include <asm/pcr.h> 24#include <asm/pcr.h>
25#include <asm/perfctr.h>
25 26
26#include "kstack.h" 27#include "kstack.h"
27 28
diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c
index a24072a4927..0ce0dd2332a 100644
--- a/arch/sparc/kernel/pcr.c
+++ b/arch/sparc/kernel/pcr.c
@@ -14,6 +14,7 @@
14#include <asm/pcr.h> 14#include <asm/pcr.h>
15#include <asm/nmi.h> 15#include <asm/nmi.h>
16#include <asm/spitfire.h> 16#include <asm/spitfire.h>
17#include <asm/perfctr.h>
17 18
18/* This code is shared between various users of the performance 19/* This code is shared between various users of the performance
19 * counters. Users will be oprofile, pseudo-NMI watchdog, and the 20 * counters. Users will be oprofile, pseudo-NMI watchdog, and the
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
index 8e16a4a2158..28559ce5eeb 100644
--- a/arch/sparc/kernel/perf_event.c
+++ b/arch/sparc/kernel/perf_event.c
@@ -25,6 +25,8 @@
25#include <linux/atomic.h> 25#include <linux/atomic.h>
26#include <asm/nmi.h> 26#include <asm/nmi.h>
27#include <asm/pcr.h> 27#include <asm/pcr.h>
28#include <asm/perfctr.h>
29#include <asm/cacheflush.h>
28 30
29#include "kernel.h" 31#include "kernel.h"
30#include "kstack.h" 32#include "kstack.h"
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
index 935fdbcd88c..efa07542e85 100644
--- a/arch/sparc/kernel/process_32.c
+++ b/arch/sparc/kernel/process_32.c
@@ -28,7 +28,6 @@
28#include <asm/auxio.h> 28#include <asm/auxio.h>
29#include <asm/oplib.h> 29#include <asm/oplib.h>
30#include <asm/uaccess.h> 30#include <asm/uaccess.h>
31#include <asm/system.h>
32#include <asm/page.h> 31#include <asm/page.h>
33#include <asm/pgalloc.h> 32#include <asm/pgalloc.h>
34#include <asm/pgtable.h> 33#include <asm/pgtable.h>
@@ -38,6 +37,7 @@
38#include <asm/elf.h> 37#include <asm/elf.h>
39#include <asm/prom.h> 38#include <asm/prom.h>
40#include <asm/unistd.h> 39#include <asm/unistd.h>
40#include <asm/setup.h>
41 41
42/* 42/*
43 * Power management idle function 43 * Power management idle function
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
index 06b5b5fc20c..aff0c72fac0 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
@@ -32,7 +32,6 @@
32#include <linux/nmi.h> 32#include <linux/nmi.h>
33 33
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35#include <asm/system.h>
36#include <asm/page.h> 35#include <asm/page.h>
37#include <asm/pgalloc.h> 36#include <asm/pgalloc.h>
38#include <asm/pgtable.h> 37#include <asm/pgtable.h>
diff --git a/arch/sparc/kernel/ptrace_32.c b/arch/sparc/kernel/ptrace_32.c
index 27b9e93d012..896ba7c5cd8 100644
--- a/arch/sparc/kernel/ptrace_32.c
+++ b/arch/sparc/kernel/ptrace_32.c
@@ -23,8 +23,8 @@
23#include <linux/tracehook.h> 23#include <linux/tracehook.h>
24 24
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/system.h>
27#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/cacheflush.h>
28 28
29/* #define ALLOW_INIT_TRACING */ 29/* #define ALLOW_INIT_TRACING */
30 30
diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c
index 9388844cd88..6f97c076799 100644
--- a/arch/sparc/kernel/ptrace_64.c
+++ b/arch/sparc/kernel/ptrace_64.c
@@ -29,7 +29,6 @@
29 29
30#include <asm/asi.h> 30#include <asm/asi.h>
31#include <asm/pgtable.h> 31#include <asm/pgtable.h>
32#include <asm/system.h>
33#include <asm/uaccess.h> 32#include <asm/uaccess.h>
34#include <asm/psrcompat.h> 33#include <asm/psrcompat.h>
35#include <asm/visasm.h> 34#include <asm/visasm.h>
diff --git a/arch/sparc/kernel/reboot.c b/arch/sparc/kernel/reboot.c
index 006a42dd200..eba7d918162 100644
--- a/arch/sparc/kernel/reboot.c
+++ b/arch/sparc/kernel/reboot.c
@@ -7,9 +7,9 @@
7#include <linux/export.h> 7#include <linux/export.h>
8#include <linux/pm.h> 8#include <linux/pm.h>
9 9
10#include <asm/system.h>
11#include <asm/oplib.h> 10#include <asm/oplib.h>
12#include <asm/prom.h> 11#include <asm/prom.h>
12#include <asm/setup.h>
13 13
14/* sysctl - toggle power-off restriction for serial console 14/* sysctl - toggle power-off restriction for serial console
15 * systems in machine_power_off() 15 * systems in machine_power_off()
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
index ffb883ddd0f..d444468b27f 100644
--- a/arch/sparc/kernel/setup_32.c
+++ b/arch/sparc/kernel/setup_32.c
@@ -33,7 +33,6 @@
33#include <linux/kdebug.h> 33#include <linux/kdebug.h>
34#include <linux/export.h> 34#include <linux/export.h>
35 35
36#include <asm/system.h>
37#include <asm/io.h> 36#include <asm/io.h>
38#include <asm/processor.h> 37#include <asm/processor.h>
39#include <asm/oplib.h> 38#include <asm/oplib.h>
@@ -46,6 +45,7 @@
46#include <asm/machines.h> 45#include <asm/machines.h>
47#include <asm/cpudata.h> 46#include <asm/cpudata.h>
48#include <asm/setup.h> 47#include <asm/setup.h>
48#include <asm/cacheflush.h>
49 49
50#include "kernel.h" 50#include "kernel.h"
51 51
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index a854a1c240f..1414d16712b 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -31,7 +31,6 @@
31#include <linux/initrd.h> 31#include <linux/initrd.h>
32#include <linux/module.h> 32#include <linux/module.h>
33 33
34#include <asm/system.h>
35#include <asm/io.h> 34#include <asm/io.h>
36#include <asm/processor.h> 35#include <asm/processor.h>
37#include <asm/oplib.h> 36#include <asm/oplib.h>
@@ -49,6 +48,7 @@
49#include <asm/btext.h> 48#include <asm/btext.h>
50#include <asm/elf.h> 49#include <asm/elf.h>
51#include <asm/mdesc.h> 50#include <asm/mdesc.h>
51#include <asm/cacheflush.h>
52 52
53#ifdef CONFIG_IP_PNP 53#ifdef CONFIG_IP_PNP
54#include <net/ipconfig.h> 54#include <net/ipconfig.h>
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c
index c8f5b50db89..948700fb903 100644
--- a/arch/sparc/kernel/signal32.c
+++ b/arch/sparc/kernel/signal32.c
@@ -28,6 +28,7 @@
28#include <asm/fpumacro.h> 28#include <asm/fpumacro.h>
29#include <asm/visasm.h> 29#include <asm/visasm.h>
30#include <asm/compat_signal.h> 30#include <asm/compat_signal.h>
31#include <asm/switch_to.h>
31 32
32#include "sigutil.h" 33#include "sigutil.h"
33 34
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c
index 7bb71b6fbd2..1e750e415d7 100644
--- a/arch/sparc/kernel/signal_32.c
+++ b/arch/sparc/kernel/signal_32.c
@@ -25,6 +25,7 @@
25#include <asm/pgalloc.h> 25#include <asm/pgalloc.h>
26#include <asm/pgtable.h> 26#include <asm/pgtable.h>
27#include <asm/cacheflush.h> /* flush_sig_insns */ 27#include <asm/cacheflush.h> /* flush_sig_insns */
28#include <asm/switch_to.h>
28 29
29#include "sigutil.h" 30#include "sigutil.h"
30 31
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
index d8a67e60be8..48b0f57b65f 100644
--- a/arch/sparc/kernel/signal_64.c
+++ b/arch/sparc/kernel/signal_64.c
@@ -31,6 +31,8 @@
31#include <asm/uctx.h> 31#include <asm/uctx.h>
32#include <asm/siginfo.h> 32#include <asm/siginfo.h>
33#include <asm/visasm.h> 33#include <asm/visasm.h>
34#include <asm/switch_to.h>
35#include <asm/cacheflush.h>
34 36
35#include "entry.h" 37#include "entry.h"
36#include "systbls.h" 38#include "systbls.h"
diff --git a/arch/sparc/kernel/sigutil_32.c b/arch/sparc/kernel/sigutil_32.c
index 35c7897b009..0f6eebe71e6 100644
--- a/arch/sparc/kernel/sigutil_32.c
+++ b/arch/sparc/kernel/sigutil_32.c
@@ -7,6 +7,7 @@
7#include <asm/sigcontext.h> 7#include <asm/sigcontext.h>
8#include <asm/fpumacro.h> 8#include <asm/fpumacro.h>
9#include <asm/ptrace.h> 9#include <asm/ptrace.h>
10#include <asm/switch_to.h>
10 11
11#include "sigutil.h" 12#include "sigutil.h"
12 13
diff --git a/arch/sparc/kernel/sigutil_64.c b/arch/sparc/kernel/sigutil_64.c
index b19570d41a3..387834a9c56 100644
--- a/arch/sparc/kernel/sigutil_64.c
+++ b/arch/sparc/kernel/sigutil_64.c
@@ -7,6 +7,7 @@
7#include <asm/sigcontext.h> 7#include <asm/sigcontext.h>
8#include <asm/fpumacro.h> 8#include <asm/fpumacro.h>
9#include <asm/ptrace.h> 9#include <asm/ptrace.h>
10#include <asm/switch_to.h>
10 11
11#include "sigutil.h" 12#include "sigutil.h"
12 13
diff --git a/arch/sparc/kernel/sparc_ksyms_64.c b/arch/sparc/kernel/sparc_ksyms_64.c
index 12ff09824cd..9f5e24ddcc7 100644
--- a/arch/sparc/kernel/sparc_ksyms_64.c
+++ b/arch/sparc/kernel/sparc_ksyms_64.c
@@ -10,12 +10,12 @@
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/bitops.h> 11#include <linux/bitops.h>
12 12
13#include <asm/system.h>
14#include <asm/cpudata.h> 13#include <asm/cpudata.h>
15#include <asm/uaccess.h> 14#include <asm/uaccess.h>
16#include <asm/spitfire.h> 15#include <asm/spitfire.h>
17#include <asm/oplib.h> 16#include <asm/oplib.h>
18#include <asm/hypervisor.h> 17#include <asm/hypervisor.h>
18#include <asm/cacheflush.h>
19 19
20struct poll { 20struct poll {
21 int fd; 21 int fd;
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index 1060e0672a4..7d0c088e8ab 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -37,7 +37,6 @@
37#include <asm/oplib.h> 37#include <asm/oplib.h>
38#include <asm/timex.h> 38#include <asm/timex.h>
39#include <asm/timer.h> 39#include <asm/timer.h>
40#include <asm/system.h>
41#include <asm/irq.h> 40#include <asm/irq.h>
42#include <asm/io.h> 41#include <asm/io.h>
43#include <asm/idprom.h> 42#include <asm/idprom.h>
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index 591f20ca9e4..d2de2133314 100644
--- a/arch/sparc/kernel/traps_32.c
+++ b/arch/sparc/kernel/traps_32.c
@@ -17,7 +17,6 @@
17#include <linux/export.h> 17#include <linux/export.h>
18 18
19#include <asm/delay.h> 19#include <asm/delay.h>
20#include <asm/system.h>
21#include <asm/ptrace.h> 20#include <asm/ptrace.h>
22#include <asm/oplib.h> 21#include <asm/oplib.h>
23#include <asm/page.h> 22#include <asm/page.h>
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index 0cbdaa41cd1..c72fdf55e1c 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -22,7 +22,6 @@
22 22
23#include <asm/smp.h> 23#include <asm/smp.h>
24#include <asm/delay.h> 24#include <asm/delay.h>
25#include <asm/system.h>
26#include <asm/ptrace.h> 25#include <asm/ptrace.h>
27#include <asm/oplib.h> 26#include <asm/oplib.h>
28#include <asm/page.h> 27#include <asm/page.h>
@@ -41,6 +40,7 @@
41#include <asm/head.h> 40#include <asm/head.h>
42#include <asm/prom.h> 41#include <asm/prom.h>
43#include <asm/memctrl.h> 42#include <asm/memctrl.h>
43#include <asm/cacheflush.h>
44 44
45#include "entry.h" 45#include "entry.h"
46#include "kstack.h" 46#include "kstack.h"
diff --git a/arch/sparc/kernel/unaligned_32.c b/arch/sparc/kernel/unaligned_32.c
index 4d043a1b249..c0ec8978619 100644
--- a/arch/sparc/kernel/unaligned_32.c
+++ b/arch/sparc/kernel/unaligned_32.c
@@ -12,7 +12,6 @@
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <asm/ptrace.h> 13#include <asm/ptrace.h>
14#include <asm/processor.h> 14#include <asm/processor.h>
15#include <asm/system.h>
16#include <asm/uaccess.h> 15#include <asm/uaccess.h>
17#include <linux/smp.h> 16#include <linux/smp.h>
18#include <linux/perf_event.h> 17#include <linux/perf_event.h>
diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c
index 76e4ac1a13e..dae85bc2eda 100644
--- a/arch/sparc/kernel/unaligned_64.c
+++ b/arch/sparc/kernel/unaligned_64.c
@@ -16,7 +16,6 @@
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17#include <asm/pstate.h> 17#include <asm/pstate.h>
18#include <asm/processor.h> 18#include <asm/processor.h>
19#include <asm/system.h>
20#include <asm/uaccess.h> 19#include <asm/uaccess.h>
21#include <linux/smp.h> 20#include <linux/smp.h>
22#include <linux/bitops.h> 21#include <linux/bitops.h>
@@ -24,6 +23,7 @@
24#include <linux/ratelimit.h> 23#include <linux/ratelimit.h>
25#include <linux/bitops.h> 24#include <linux/bitops.h>
26#include <asm/fpumacro.h> 25#include <asm/fpumacro.h>
26#include <asm/cacheflush.h>
27 27
28enum direction { 28enum direction {
29 load, /* ld, ldd, ldh, ldsh */ 29 load, /* ld, ldd, ldh, ldsh */
diff --git a/arch/sparc/kernel/visemul.c b/arch/sparc/kernel/visemul.c
index 73370674ccf..08e074b7eb6 100644
--- a/arch/sparc/kernel/visemul.c
+++ b/arch/sparc/kernel/visemul.c
@@ -9,9 +9,9 @@
9 9
10#include <asm/ptrace.h> 10#include <asm/ptrace.h>
11#include <asm/pstate.h> 11#include <asm/pstate.h>
12#include <asm/system.h>
13#include <asm/fpumacro.h> 12#include <asm/fpumacro.h>
14#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14#include <asm/cacheflush.h>
15 15
16/* OPF field of various VIS instructions. */ 16/* OPF field of various VIS instructions. */
17 17
diff --git a/arch/sparc/math-emu/math_64.c b/arch/sparc/math-emu/math_64.c
index e575bd2fe38..2bbe2f28ad2 100644
--- a/arch/sparc/math-emu/math_64.c
+++ b/arch/sparc/math-emu/math_64.c
@@ -16,6 +16,7 @@
16#include <asm/fpumacro.h> 16#include <asm/fpumacro.h>
17#include <asm/ptrace.h> 17#include <asm/ptrace.h>
18#include <asm/uaccess.h> 18#include <asm/uaccess.h>
19#include <asm/cacheflush.h>
19 20
20#include "sfp-util_64.h" 21#include "sfp-util_64.h"
21#include <math-emu/soft-fp.h> 22#include <math-emu/soft-fp.h>
diff --git a/arch/sparc/mm/btfixup.c b/arch/sparc/mm/btfixup.c
index 8a7f81743c1..09d6af22db2 100644
--- a/arch/sparc/mm/btfixup.c
+++ b/arch/sparc/mm/btfixup.c
@@ -12,7 +12,6 @@
12#include <asm/pgalloc.h> 12#include <asm/pgalloc.h>
13#include <asm/pgtable.h> 13#include <asm/pgtable.h>
14#include <asm/oplib.h> 14#include <asm/oplib.h>
15#include <asm/system.h>
16#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
17 16
18#define BTFIXUP_OPTIMIZE_NOP 17#define BTFIXUP_OPTIMIZE_NOP
diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c
index 8023fd7e77b..7705c6731e2 100644
--- a/arch/sparc/mm/fault_32.c
+++ b/arch/sparc/mm/fault_32.c
@@ -22,7 +22,6 @@
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/kdebug.h> 23#include <linux/kdebug.h>
24 24
25#include <asm/system.h>
26#include <asm/page.h> 25#include <asm/page.h>
27#include <asm/pgtable.h> 26#include <asm/pgtable.h>
28#include <asm/memreg.h> 27#include <asm/memreg.h>
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
index 7b00de61c5f..c5f9021b1a0 100644
--- a/arch/sparc/mm/init_32.c
+++ b/arch/sparc/mm/init_32.c
@@ -27,7 +27,6 @@
27#include <linux/gfp.h> 27#include <linux/gfp.h>
28 28
29#include <asm/sections.h> 29#include <asm/sections.h>
30#include <asm/system.h>
31#include <asm/vac-ops.h> 30#include <asm/vac-ops.h>
32#include <asm/page.h> 31#include <asm/page.h>
33#include <asm/pgtable.h> 32#include <asm/pgtable.h>
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index b3f5e7dfea5..21faaeea85d 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -28,7 +28,6 @@
28#include <linux/gfp.h> 28#include <linux/gfp.h>
29 29
30#include <asm/head.h> 30#include <asm/head.h>
31#include <asm/system.h>
32#include <asm/page.h> 31#include <asm/page.h>
33#include <asm/pgalloc.h> 32#include <asm/pgalloc.h>
34#include <asm/pgtable.h> 33#include <asm/pgtable.h>
diff --git a/arch/sparc/mm/init_64.h b/arch/sparc/mm/init_64.h
index 77d1b313e34..3e1ac8b96ca 100644
--- a/arch/sparc/mm/init_64.h
+++ b/arch/sparc/mm/init_64.h
@@ -36,8 +36,6 @@ extern unsigned long kern_locked_tte_data;
36 36
37extern void prom_world(int enter); 37extern void prom_world(int enter);
38 38
39extern void free_initmem(void);
40
41#ifdef CONFIG_SPARSEMEM_VMEMMAP 39#ifdef CONFIG_SPARSEMEM_VMEMMAP
42#define VMEMMAP_CHUNK_SHIFT 22 40#define VMEMMAP_CHUNK_SHIFT 22
43#define VMEMMAP_CHUNK (1UL << VMEMMAP_CHUNK_SHIFT) 41#define VMEMMAP_CHUNK (1UL << VMEMMAP_CHUNK_SHIFT)
diff --git a/arch/sparc/mm/loadmmu.c b/arch/sparc/mm/loadmmu.c
index 82ec8f66603..c5bf2a6c385 100644
--- a/arch/sparc/mm/loadmmu.c
+++ b/arch/sparc/mm/loadmmu.c
@@ -11,7 +11,6 @@
11#include <linux/mm.h> 11#include <linux/mm.h>
12#include <linux/init.h> 12#include <linux/init.h>
13 13
14#include <asm/system.h>
15#include <asm/page.h> 14#include <asm/page.h>
16#include <asm/pgtable.h> 15#include <asm/pgtable.h>
17#include <asm/mmu_context.h> 16#include <asm/mmu_context.h>
diff --git a/arch/sparc/mm/tsb.c b/arch/sparc/mm/tsb.c
index 536412d8f41..c52add79b83 100644
--- a/arch/sparc/mm/tsb.c
+++ b/arch/sparc/mm/tsb.c
@@ -6,7 +6,6 @@
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/preempt.h> 7#include <linux/preempt.h>
8#include <linux/slab.h> 8#include <linux/slab.h>
9#include <asm/system.h>
10#include <asm/page.h> 9#include <asm/page.h>
11#include <asm/tlbflush.h> 10#include <asm/tlbflush.h>
12#include <asm/tlb.h> 11#include <asm/tlb.h>
diff --git a/arch/sparc/prom/console_32.c b/arch/sparc/prom/console_32.c
index a00f47b16c1..1cfb50f4cb9 100644
--- a/arch/sparc/prom/console_32.c
+++ b/arch/sparc/prom/console_32.c
@@ -11,7 +11,6 @@
11#include <linux/sched.h> 11#include <linux/sched.h>
12#include <asm/openprom.h> 12#include <asm/openprom.h>
13#include <asm/oplib.h> 13#include <asm/oplib.h>
14#include <asm/system.h>
15#include <linux/string.h> 14#include <linux/string.h>
16 15
17extern void restore_current(void); 16extern void restore_current(void);
diff --git a/arch/sparc/prom/console_64.c b/arch/sparc/prom/console_64.c
index 9de6c8cfe04..f95edcc54fd 100644
--- a/arch/sparc/prom/console_64.c
+++ b/arch/sparc/prom/console_64.c
@@ -10,7 +10,6 @@
10#include <linux/sched.h> 10#include <linux/sched.h>
11#include <asm/openprom.h> 11#include <asm/openprom.h>
12#include <asm/oplib.h> 12#include <asm/oplib.h>
13#include <asm/system.h>
14#include <linux/string.h> 13#include <linux/string.h>
15 14
16static int __prom_console_write_buf(const char *buf, int len) 15static int __prom_console_write_buf(const char *buf, int len)
diff --git a/arch/sparc/prom/misc_32.c b/arch/sparc/prom/misc_32.c
index 677b6a10fbd..8dc0b6b271e 100644
--- a/arch/sparc/prom/misc_32.c
+++ b/arch/sparc/prom/misc_32.c
@@ -13,7 +13,6 @@
13#include <asm/openprom.h> 13#include <asm/openprom.h>
14#include <asm/oplib.h> 14#include <asm/oplib.h>
15#include <asm/auxio.h> 15#include <asm/auxio.h>
16#include <asm/system.h>
17 16
18extern void restore_current(void); 17extern void restore_current(void);
19 18
diff --git a/arch/sparc/prom/misc_64.c b/arch/sparc/prom/misc_64.c
index e4f31d4d371..f178b9dcc7b 100644
--- a/arch/sparc/prom/misc_64.c
+++ b/arch/sparc/prom/misc_64.c
@@ -15,7 +15,6 @@
15 15
16#include <asm/openprom.h> 16#include <asm/openprom.h>
17#include <asm/oplib.h> 17#include <asm/oplib.h>
18#include <asm/system.h>
19#include <asm/ldc.h> 18#include <asm/ldc.h>
20 19
21static int prom_service_exists(const char *service_name) 20static int prom_service_exists(const char *service_name)
diff --git a/arch/sparc/prom/p1275.c b/arch/sparc/prom/p1275.c
index d9850c2b9bf..04a4540509d 100644
--- a/arch/sparc/prom/p1275.c
+++ b/arch/sparc/prom/p1275.c
@@ -13,7 +13,6 @@
13 13
14#include <asm/openprom.h> 14#include <asm/openprom.h>
15#include <asm/oplib.h> 15#include <asm/oplib.h>
16#include <asm/system.h>
17#include <asm/spitfire.h> 16#include <asm/spitfire.h>
18#include <asm/pstate.h> 17#include <asm/pstate.h>
19#include <asm/ldc.h> 18#include <asm/ldc.h>
diff --git a/arch/sparc/prom/ranges.c b/arch/sparc/prom/ranges.c
index 0857aa9e839..ad143c13bdc 100644
--- a/arch/sparc/prom/ranges.c
+++ b/arch/sparc/prom/ranges.c
@@ -11,7 +11,6 @@
11#include <asm/openprom.h> 11#include <asm/openprom.h>
12#include <asm/oplib.h> 12#include <asm/oplib.h>
13#include <asm/types.h> 13#include <asm/types.h>
14#include <asm/system.h>
15 14
16static struct linux_prom_ranges promlib_obio_ranges[PROMREG_MAX]; 15static struct linux_prom_ranges promlib_obio_ranges[PROMREG_MAX];
17static int num_obio_ranges; 16static int num_obio_ranges;
diff --git a/arch/tile/include/asm/atomic.h b/arch/tile/include/asm/atomic.h
index 921dbeb8a70..bb696da5d7c 100644
--- a/arch/tile/include/asm/atomic.h
+++ b/arch/tile/include/asm/atomic.h
@@ -20,7 +20,7 @@
20#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
21 21
22#include <linux/compiler.h> 22#include <linux/compiler.h>
23#include <asm/system.h> 23#include <linux/types.h>
24 24
25#define ATOMIC_INIT(i) { (i) } 25#define ATOMIC_INIT(i) { (i) }
26 26
diff --git a/arch/tile/include/asm/atomic_32.h b/arch/tile/include/asm/atomic_32.h
index c03349e0ca9..466dc4a39a4 100644
--- a/arch/tile/include/asm/atomic_32.h
+++ b/arch/tile/include/asm/atomic_32.h
@@ -17,6 +17,7 @@
17#ifndef _ASM_TILE_ATOMIC_32_H 17#ifndef _ASM_TILE_ATOMIC_32_H
18#define _ASM_TILE_ATOMIC_32_H 18#define _ASM_TILE_ATOMIC_32_H
19 19
20#include <asm/barrier.h>
20#include <arch/chip.h> 21#include <arch/chip.h>
21 22
22#ifndef __ASSEMBLY__ 23#ifndef __ASSEMBLY__
diff --git a/arch/tile/include/asm/atomic_64.h b/arch/tile/include/asm/atomic_64.h
index 27fe667fddf..f4500c688ff 100644
--- a/arch/tile/include/asm/atomic_64.h
+++ b/arch/tile/include/asm/atomic_64.h
@@ -19,6 +19,7 @@
19 19
20#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
21 21
22#include <asm/barrier.h>
22#include <arch/spr_def.h> 23#include <arch/spr_def.h>
23 24
24/* First, the 32-bit atomic ops that are "real" on our 64-bit platform. */ 25/* First, the 32-bit atomic ops that are "real" on our 64-bit platform. */
diff --git a/arch/tile/include/asm/system.h b/arch/tile/include/asm/barrier.h
index 23d1842f483..990a217a0b7 100644
--- a/arch/tile/include/asm/system.h
+++ b/arch/tile/include/asm/barrier.h
@@ -12,20 +12,15 @@
12 * more details. 12 * more details.
13 */ 13 */
14 14
15#ifndef _ASM_TILE_SYSTEM_H 15#ifndef _ASM_TILE_BARRIER_H
16#define _ASM_TILE_SYSTEM_H 16#define _ASM_TILE_BARRIER_H
17 17
18#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/irqflags.h>
22
23/* NOTE: we can't include <linux/ptrace.h> due to #include dependencies. */
24#include <asm/ptrace.h>
25
26#include <arch/chip.h> 21#include <arch/chip.h>
27#include <arch/sim_def.h>
28#include <arch/spr_def.h> 22#include <arch/spr_def.h>
23#include <asm/timex.h>
29 24
30/* 25/*
31 * read_barrier_depends - Flush all pending reads that subsequents reads 26 * read_barrier_depends - Flush all pending reads that subsequents reads
@@ -78,17 +73,10 @@
78 * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() 73 * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb()
79 * in cases like this where there are no data dependencies. 74 * in cases like this where there are no data dependencies.
80 */ 75 */
81
82#define read_barrier_depends() do { } while (0) 76#define read_barrier_depends() do { } while (0)
83 77
84#define __sync() __insn_mf() 78#define __sync() __insn_mf()
85 79
86#if CHIP_HAS_SPLIT_CYCLE()
87#define get_cycles_low() __insn_mfspr(SPR_CYCLE_LOW)
88#else
89#define get_cycles_low() __insn_mfspr(SPR_CYCLE) /* just get all 64 bits */
90#endif
91
92#if !CHIP_HAS_MF_WAITS_FOR_VICTIMS() 80#if !CHIP_HAS_MF_WAITS_FOR_VICTIMS()
93#include <hv/syscall_public.h> 81#include <hv/syscall_public.h>
94/* 82/*
@@ -156,106 +144,5 @@ mb_incoherent(void)
156#define set_mb(var, value) \ 144#define set_mb(var, value) \
157 do { var = value; mb(); } while (0) 145 do { var = value; mb(); } while (0)
158 146
159/*
160 * Pause the DMA engine and static network before task switching.
161 */
162#define prepare_arch_switch(next) _prepare_arch_switch(next)
163void _prepare_arch_switch(struct task_struct *next);
164
165
166/*
167 * switch_to(n) should switch tasks to task nr n, first
168 * checking that n isn't the current task, in which case it does nothing.
169 * The number of callee-saved registers saved on the kernel stack
170 * is defined here for use in copy_thread() and must agree with __switch_to().
171 */
172#endif /* !__ASSEMBLY__ */
173#define CALLEE_SAVED_FIRST_REG 30
174#define CALLEE_SAVED_REGS_COUNT 24 /* r30 to r52, plus an empty to align */
175#ifndef __ASSEMBLY__
176struct task_struct;
177#define switch_to(prev, next, last) ((last) = _switch_to((prev), (next)))
178extern struct task_struct *_switch_to(struct task_struct *prev,
179 struct task_struct *next);
180
181/* Helper function for _switch_to(). */
182extern struct task_struct *__switch_to(struct task_struct *prev,
183 struct task_struct *next,
184 unsigned long new_system_save_k_0);
185
186/* Address that switched-away from tasks are at. */
187extern unsigned long get_switch_to_pc(void);
188
189/*
190 * On SMP systems, when the scheduler does migration-cost autodetection,
191 * it needs a way to flush as much of the CPU's caches as possible:
192 *
193 * TODO: fill this in!
194 */
195static inline void sched_cacheflush(void)
196{
197}
198
199#define arch_align_stack(x) (x)
200
201/*
202 * Is the kernel doing fixups of unaligned accesses? If <0, no kernel
203 * intervention occurs and SIGBUS is delivered with no data address
204 * info. If 0, the kernel single-steps the instruction to discover
205 * the data address to provide with the SIGBUS. If 1, the kernel does
206 * a fixup.
207 */
208extern int unaligned_fixup;
209
210/* Is the kernel printing on each unaligned fixup? */
211extern int unaligned_printk;
212
213/* Number of unaligned fixups performed */
214extern unsigned int unaligned_fixup_count;
215
216/* Init-time routine to do tile-specific per-cpu setup. */
217void setup_cpu(int boot);
218
219/* User-level DMA management functions */
220void grant_dma_mpls(void);
221void restrict_dma_mpls(void);
222
223#ifdef CONFIG_HARDWALL
224/* User-level network management functions */
225void reset_network_state(void);
226void grant_network_mpls(void);
227void restrict_network_mpls(void);
228int hardwall_deactivate(struct task_struct *task);
229
230/* Hook hardwall code into changes in affinity. */
231#define arch_set_cpus_allowed(p, new_mask) do { \
232 if (p->thread.hardwall && !cpumask_equal(&p->cpus_allowed, new_mask)) \
233 hardwall_deactivate(p); \
234} while (0)
235#endif
236
237/*
238 * Kernel threads can check to see if they need to migrate their
239 * stack whenever they return from a context switch; for user
240 * threads, we defer until they are returning to user-space.
241 */
242#define finish_arch_switch(prev) do { \
243 if (unlikely((prev)->state == TASK_DEAD)) \
244 __insn_mtspr(SPR_SIM_CONTROL, SIM_CONTROL_OS_EXIT | \
245 ((prev)->pid << _SIM_CONTROL_OPERATOR_BITS)); \
246 __insn_mtspr(SPR_SIM_CONTROL, SIM_CONTROL_OS_SWITCH | \
247 (current->pid << _SIM_CONTROL_OPERATOR_BITS)); \
248 if (current->mm == NULL && !kstack_hash && \
249 current_thread_info()->homecache_cpu != smp_processor_id()) \
250 homecache_migrate_kthread(); \
251} while (0)
252
253/* Support function for forking a new task. */
254void ret_from_fork(void);
255
256/* Called from ret_from_fork() when a new process starts up. */
257struct task_struct *sim_notify_fork(struct task_struct *prev);
258
259#endif /* !__ASSEMBLY__ */ 147#endif /* !__ASSEMBLY__ */
260 148#endif /* _ASM_TILE_BARRIER_H */
261#endif /* _ASM_TILE_SYSTEM_H */
diff --git a/arch/tile/include/asm/bitops_32.h b/arch/tile/include/asm/bitops_32.h
index 571b118bfd9..ddc4c1efde4 100644
--- a/arch/tile/include/asm/bitops_32.h
+++ b/arch/tile/include/asm/bitops_32.h
@@ -17,7 +17,6 @@
17 17
18#include <linux/compiler.h> 18#include <linux/compiler.h>
19#include <linux/atomic.h> 19#include <linux/atomic.h>
20#include <asm/system.h>
21 20
22/* Tile-specific routines to support <asm/bitops.h>. */ 21/* Tile-specific routines to support <asm/bitops.h>. */
23unsigned long _atomic_or(volatile unsigned long *p, unsigned long mask); 22unsigned long _atomic_or(volatile unsigned long *p, unsigned long mask);
diff --git a/arch/tile/include/asm/bitops_64.h b/arch/tile/include/asm/bitops_64.h
index e9c8e381ee0..58d021a9834 100644
--- a/arch/tile/include/asm/bitops_64.h
+++ b/arch/tile/include/asm/bitops_64.h
@@ -17,7 +17,6 @@
17 17
18#include <linux/compiler.h> 18#include <linux/compiler.h>
19#include <linux/atomic.h> 19#include <linux/atomic.h>
20#include <asm/system.h>
21 20
22/* See <asm/bitops.h> for API comments. */ 21/* See <asm/bitops.h> for API comments. */
23 22
diff --git a/arch/tile/include/asm/cacheflush.h b/arch/tile/include/asm/cacheflush.h
index e925f4bb498..0fc63c488ed 100644
--- a/arch/tile/include/asm/cacheflush.h
+++ b/arch/tile/include/asm/cacheflush.h
@@ -20,7 +20,6 @@
20/* Keep includes the same across arches. */ 20/* Keep includes the same across arches. */
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/cache.h> 22#include <linux/cache.h>
23#include <asm/system.h>
24#include <arch/icache.h> 23#include <arch/icache.h>
25 24
26/* Caches are physically-indexed and so don't need special treatment */ 25/* Caches are physically-indexed and so don't need special treatment */
@@ -152,4 +151,14 @@ static inline void finv_buffer_local(void *buffer, size_t size)
152 */ 151 */
153void finv_buffer_remote(void *buffer, size_t size, int hfh); 152void finv_buffer_remote(void *buffer, size_t size, int hfh);
154 153
154/*
155 * On SMP systems, when the scheduler does migration-cost autodetection,
156 * it needs a way to flush as much of the CPU's caches as possible:
157 *
158 * TODO: fill this in!
159 */
160static inline void sched_cacheflush(void)
161{
162}
163
155#endif /* _ASM_TILE_CACHEFLUSH_H */ 164#endif /* _ASM_TILE_CACHEFLUSH_H */
diff --git a/arch/tile/include/asm/exec.h b/arch/tile/include/asm/exec.h
new file mode 100644
index 00000000000..a714e195086
--- /dev/null
+++ b/arch/tile/include/asm/exec.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright 2010 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14
15#ifndef _ASM_TILE_EXEC_H
16#define _ASM_TILE_EXEC_H
17
18#define arch_align_stack(x) (x)
19
20#endif /* _ASM_TILE_EXEC_H */
diff --git a/arch/tile/include/asm/pgtable.h b/arch/tile/include/asm/pgtable.h
index 1a20b7ef8ea..67490910774 100644
--- a/arch/tile/include/asm/pgtable.h
+++ b/arch/tile/include/asm/pgtable.h
@@ -29,7 +29,6 @@
29#include <linux/spinlock.h> 29#include <linux/spinlock.h>
30#include <asm/processor.h> 30#include <asm/processor.h>
31#include <asm/fixmap.h> 31#include <asm/fixmap.h>
32#include <asm/system.h>
33 32
34struct mm_struct; 33struct mm_struct;
35struct vm_area_struct; 34struct vm_area_struct;
diff --git a/arch/tile/include/asm/setup.h b/arch/tile/include/asm/setup.h
index 7caf0f36b03..e58613e0752 100644
--- a/arch/tile/include/asm/setup.h
+++ b/arch/tile/include/asm/setup.h
@@ -31,6 +31,28 @@ void early_panic(const char *fmt, ...);
31void warn_early_printk(void); 31void warn_early_printk(void);
32void __init disable_early_printk(void); 32void __init disable_early_printk(void);
33 33
34/* Init-time routine to do tile-specific per-cpu setup. */
35void setup_cpu(int boot);
36
37/* User-level DMA management functions */
38void grant_dma_mpls(void);
39void restrict_dma_mpls(void);
40
41#ifdef CONFIG_HARDWALL
42/* User-level network management functions */
43void reset_network_state(void);
44void grant_network_mpls(void);
45void restrict_network_mpls(void);
46struct task_struct;
47int hardwall_deactivate(struct task_struct *task);
48
49/* Hook hardwall code into changes in affinity. */
50#define arch_set_cpus_allowed(p, new_mask) do { \
51 if (p->thread.hardwall && !cpumask_equal(&p->cpus_allowed, new_mask)) \
52 hardwall_deactivate(p); \
53} while (0)
54#endif
55
34#endif /* __KERNEL__ */ 56#endif /* __KERNEL__ */
35 57
36#endif /* _ASM_TILE_SETUP_H */ 58#endif /* _ASM_TILE_SETUP_H */
diff --git a/arch/tile/include/asm/spinlock_32.h b/arch/tile/include/asm/spinlock_32.h
index a5e4208d34f..c0a77b38d39 100644
--- a/arch/tile/include/asm/spinlock_32.h
+++ b/arch/tile/include/asm/spinlock_32.h
@@ -19,7 +19,6 @@
19 19
20#include <linux/atomic.h> 20#include <linux/atomic.h>
21#include <asm/page.h> 21#include <asm/page.h>
22#include <asm/system.h>
23#include <linux/compiler.h> 22#include <linux/compiler.h>
24 23
25/* 24/*
diff --git a/arch/tile/include/asm/switch_to.h b/arch/tile/include/asm/switch_to.h
new file mode 100644
index 00000000000..1d48c5fee8b
--- /dev/null
+++ b/arch/tile/include/asm/switch_to.h
@@ -0,0 +1,76 @@
1/*
2 * Copyright 2010 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14
15#ifndef _ASM_TILE_SWITCH_TO_H
16#define _ASM_TILE_SWITCH_TO_H
17
18#include <arch/sim_def.h>
19
20/*
21 * switch_to(n) should switch tasks to task nr n, first
22 * checking that n isn't the current task, in which case it does nothing.
23 * The number of callee-saved registers saved on the kernel stack
24 * is defined here for use in copy_thread() and must agree with __switch_to().
25 */
26#define CALLEE_SAVED_FIRST_REG 30
27#define CALLEE_SAVED_REGS_COUNT 24 /* r30 to r52, plus an empty to align */
28
29#ifndef __ASSEMBLY__
30
31struct task_struct;
32
33/*
34 * Pause the DMA engine and static network before task switching.
35 */
36#define prepare_arch_switch(next) _prepare_arch_switch(next)
37void _prepare_arch_switch(struct task_struct *next);
38
39struct task_struct;
40#define switch_to(prev, next, last) ((last) = _switch_to((prev), (next)))
41extern struct task_struct *_switch_to(struct task_struct *prev,
42 struct task_struct *next);
43
44/* Helper function for _switch_to(). */
45extern struct task_struct *__switch_to(struct task_struct *prev,
46 struct task_struct *next,
47 unsigned long new_system_save_k_0);
48
49/* Address that switched-away from tasks are at. */
50extern unsigned long get_switch_to_pc(void);
51
52/*
53 * Kernel threads can check to see if they need to migrate their
54 * stack whenever they return from a context switch; for user
55 * threads, we defer until they are returning to user-space.
56 */
57#define finish_arch_switch(prev) do { \
58 if (unlikely((prev)->state == TASK_DEAD)) \
59 __insn_mtspr(SPR_SIM_CONTROL, SIM_CONTROL_OS_EXIT | \
60 ((prev)->pid << _SIM_CONTROL_OPERATOR_BITS)); \
61 __insn_mtspr(SPR_SIM_CONTROL, SIM_CONTROL_OS_SWITCH | \
62 (current->pid << _SIM_CONTROL_OPERATOR_BITS)); \
63 if (current->mm == NULL && !kstack_hash && \
64 current_thread_info()->homecache_cpu != smp_processor_id()) \
65 homecache_migrate_kthread(); \
66} while (0)
67
68/* Support function for forking a new task. */
69void ret_from_fork(void);
70
71/* Called from ret_from_fork() when a new process starts up. */
72struct task_struct *sim_notify_fork(struct task_struct *prev);
73
74#endif /* !__ASSEMBLY__ */
75
76#endif /* _ASM_TILE_SWITCH_TO_H */
diff --git a/arch/tile/include/asm/timex.h b/arch/tile/include/asm/timex.h
index 29921f0b86d..dc987d53e2a 100644
--- a/arch/tile/include/asm/timex.h
+++ b/arch/tile/include/asm/timex.h
@@ -29,11 +29,13 @@ typedef unsigned long long cycles_t;
29 29
30#if CHIP_HAS_SPLIT_CYCLE() 30#if CHIP_HAS_SPLIT_CYCLE()
31cycles_t get_cycles(void); 31cycles_t get_cycles(void);
32#define get_cycles_low() __insn_mfspr(SPR_CYCLE_LOW)
32#else 33#else
33static inline cycles_t get_cycles(void) 34static inline cycles_t get_cycles(void)
34{ 35{
35 return __insn_mfspr(SPR_CYCLE); 36 return __insn_mfspr(SPR_CYCLE);
36} 37}
38#define get_cycles_low() __insn_mfspr(SPR_CYCLE) /* just get all 64 bits */
37#endif 39#endif
38 40
39cycles_t get_clock_rate(void); 41cycles_t get_clock_rate(void);
diff --git a/arch/tile/include/asm/unaligned.h b/arch/tile/include/asm/unaligned.h
index 137e2de5b10..37dfbe59887 100644
--- a/arch/tile/include/asm/unaligned.h
+++ b/arch/tile/include/asm/unaligned.h
@@ -21,4 +21,19 @@
21#define get_unaligned __get_unaligned_le 21#define get_unaligned __get_unaligned_le
22#define put_unaligned __put_unaligned_le 22#define put_unaligned __put_unaligned_le
23 23
24/*
25 * Is the kernel doing fixups of unaligned accesses? If <0, no kernel
26 * intervention occurs and SIGBUS is delivered with no data address
27 * info. If 0, the kernel single-steps the instruction to discover
28 * the data address to provide with the SIGBUS. If 1, the kernel does
29 * a fixup.
30 */
31extern int unaligned_fixup;
32
33/* Is the kernel printing on each unaligned fixup? */
34extern int unaligned_printk;
35
36/* Number of unaligned fixups performed */
37extern unsigned int unaligned_fixup_count;
38
24#endif /* _ASM_TILE_UNALIGNED_H */ 39#endif /* _ASM_TILE_UNALIGNED_H */
diff --git a/arch/tile/kernel/early_printk.c b/arch/tile/kernel/early_printk.c
index 493a0e66d91..afb9c9a0d88 100644
--- a/arch/tile/kernel/early_printk.c
+++ b/arch/tile/kernel/early_printk.c
@@ -16,6 +16,7 @@
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/irqflags.h>
19#include <asm/setup.h> 20#include <asm/setup.h>
20#include <hv/hypervisor.h> 21#include <hv/hypervisor.h>
21 22
diff --git a/arch/tile/kernel/proc.c b/arch/tile/kernel/proc.c
index 62d820833c6..7a932704640 100644
--- a/arch/tile/kernel/proc.c
+++ b/arch/tile/kernel/proc.c
@@ -23,6 +23,7 @@
23#include <linux/sysctl.h> 23#include <linux/sysctl.h>
24#include <linux/hardirq.h> 24#include <linux/hardirq.h>
25#include <linux/mman.h> 25#include <linux/mman.h>
26#include <asm/unaligned.h>
26#include <asm/pgtable.h> 27#include <asm/pgtable.h>
27#include <asm/processor.h> 28#include <asm/processor.h>
28#include <asm/sections.h> 29#include <asm/sections.h>
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c
index 6ae495ef2b9..30caecac94d 100644
--- a/arch/tile/kernel/process.c
+++ b/arch/tile/kernel/process.c
@@ -27,16 +27,17 @@
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/tracehook.h> 28#include <linux/tracehook.h>
29#include <linux/signal.h> 29#include <linux/signal.h>
30#include <asm/system.h>
31#include <asm/stack.h> 30#include <asm/stack.h>
32#include <asm/homecache.h> 31#include <asm/homecache.h>
33#include <asm/syscalls.h> 32#include <asm/syscalls.h>
34#include <asm/traps.h> 33#include <asm/traps.h>
34#include <asm/setup.h>
35#ifdef CONFIG_HARDWALL 35#ifdef CONFIG_HARDWALL
36#include <asm/hardwall.h> 36#include <asm/hardwall.h>
37#endif 37#endif
38#include <arch/chip.h> 38#include <arch/chip.h>
39#include <arch/abi.h> 39#include <arch/abi.h>
40#include <arch/sim_def.h>
40 41
41 42
42/* 43/*
diff --git a/arch/tile/kernel/regs_32.S b/arch/tile/kernel/regs_32.S
index caa13101c26..c12280c2d90 100644
--- a/arch/tile/kernel/regs_32.S
+++ b/arch/tile/kernel/regs_32.S
@@ -13,11 +13,11 @@
13 */ 13 */
14 14
15#include <linux/linkage.h> 15#include <linux/linkage.h>
16#include <asm/system.h>
17#include <asm/ptrace.h> 16#include <asm/ptrace.h>
18#include <asm/asm-offsets.h> 17#include <asm/asm-offsets.h>
19#include <arch/spr_def.h> 18#include <arch/spr_def.h>
20#include <asm/processor.h> 19#include <asm/processor.h>
20#include <asm/switch_to.h>
21 21
22/* 22/*
23 * See <asm/system.h>; called with prev and next task_struct pointers. 23 * See <asm/system.h>; called with prev and next task_struct pointers.
diff --git a/arch/tile/kernel/regs_64.S b/arch/tile/kernel/regs_64.S
index f748c1e8528..0829fd01fa3 100644
--- a/arch/tile/kernel/regs_64.S
+++ b/arch/tile/kernel/regs_64.S
@@ -13,11 +13,11 @@
13 */ 13 */
14 14
15#include <linux/linkage.h> 15#include <linux/linkage.h>
16#include <asm/system.h>
17#include <asm/ptrace.h> 16#include <asm/ptrace.h>
18#include <asm/asm-offsets.h> 17#include <asm/asm-offsets.h>
19#include <arch/spr_def.h> 18#include <arch/spr_def.h>
20#include <asm/processor.h> 19#include <asm/processor.h>
20#include <asm/switch_to.h>
21 21
22/* 22/*
23 * See <asm/system.h>; called with prev and next task_struct pointers. 23 * See <asm/system.h>; called with prev and next task_struct pointers.
diff --git a/arch/tile/kernel/single_step.c b/arch/tile/kernel/single_step.c
index b7a87950408..bc1eb586e24 100644
--- a/arch/tile/kernel/single_step.c
+++ b/arch/tile/kernel/single_step.c
@@ -25,6 +25,7 @@
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/err.h> 26#include <linux/err.h>
27#include <asm/cacheflush.h> 27#include <asm/cacheflush.h>
28#include <asm/unaligned.h>
28#include <arch/abi.h> 29#include <arch/abi.h>
29#include <arch/opcode.h> 30#include <arch/opcode.h>
30 31
diff --git a/arch/tile/kernel/traps.c b/arch/tile/kernel/traps.c
index 4f47b8a356d..2bb6602a1ee 100644
--- a/arch/tile/kernel/traps.c
+++ b/arch/tile/kernel/traps.c
@@ -21,6 +21,7 @@
21#include <linux/ptrace.h> 21#include <linux/ptrace.h>
22#include <asm/stack.h> 22#include <asm/stack.h>
23#include <asm/traps.h> 23#include <asm/traps.h>
24#include <asm/setup.h>
24 25
25#include <arch/interrupts.h> 26#include <arch/interrupts.h>
26#include <arch/spr_def.h> 27#include <arch/spr_def.h>
diff --git a/arch/tile/mm/elf.c b/arch/tile/mm/elf.c
index 1a00fb64fc8..758b6038c2b 100644
--- a/arch/tile/mm/elf.c
+++ b/arch/tile/mm/elf.c
@@ -21,6 +21,7 @@
21#include <asm/pgtable.h> 21#include <asm/pgtable.h>
22#include <asm/pgalloc.h> 22#include <asm/pgalloc.h>
23#include <asm/sections.h> 23#include <asm/sections.h>
24#include <arch/sim_def.h>
24 25
25/* Notify a running simulator, if any, that an exec just occurred. */ 26/* Notify a running simulator, if any, that an exec just occurred. */
26static void sim_notify_exec(const char *binary_name) 27static void sim_notify_exec(const char *binary_name)
diff --git a/arch/tile/mm/fault.c b/arch/tile/mm/fault.c
index c1eaaa1fcc2..cba30e9547b 100644
--- a/arch/tile/mm/fault.c
+++ b/arch/tile/mm/fault.c
@@ -35,7 +35,6 @@
35#include <linux/syscalls.h> 35#include <linux/syscalls.h>
36#include <linux/uaccess.h> 36#include <linux/uaccess.h>
37 37
38#include <asm/system.h>
39#include <asm/pgalloc.h> 38#include <asm/pgalloc.h>
40#include <asm/sections.h> 39#include <asm/sections.h>
41#include <asm/traps.h> 40#include <asm/traps.h>
diff --git a/arch/tile/mm/init.c b/arch/tile/mm/init.c
index 7309988c979..830c4908ea7 100644
--- a/arch/tile/mm/init.c
+++ b/arch/tile/mm/init.c
@@ -38,7 +38,6 @@
38#include <linux/uaccess.h> 38#include <linux/uaccess.h>
39#include <asm/mmu_context.h> 39#include <asm/mmu_context.h>
40#include <asm/processor.h> 40#include <asm/processor.h>
41#include <asm/system.h>
42#include <asm/pgtable.h> 41#include <asm/pgtable.h>
43#include <asm/pgalloc.h> 42#include <asm/pgalloc.h>
44#include <asm/dma.h> 43#include <asm/dma.h>
diff --git a/arch/tile/mm/pgtable.c b/arch/tile/mm/pgtable.c
index de7d8e21e01..87303693a07 100644
--- a/arch/tile/mm/pgtable.c
+++ b/arch/tile/mm/pgtable.c
@@ -27,7 +27,6 @@
27#include <linux/vmalloc.h> 27#include <linux/vmalloc.h>
28#include <linux/smp.h> 28#include <linux/smp.h>
29 29
30#include <asm/system.h>
31#include <asm/pgtable.h> 30#include <asm/pgtable.h>
32#include <asm/pgalloc.h> 31#include <asm/pgalloc.h>
33#include <asm/fixmap.h> 32#include <asm/fixmap.h>
diff --git a/arch/um/include/asm/fixmap.h b/arch/um/include/asm/fixmap.h
index 69c0252345f..21a423bae5e 100644
--- a/arch/um/include/asm/fixmap.h
+++ b/arch/um/include/asm/fixmap.h
@@ -2,7 +2,6 @@
2#define __UM_FIXMAP_H 2#define __UM_FIXMAP_H
3 3
4#include <asm/processor.h> 4#include <asm/processor.h>
5#include <asm/system.h>
6#include <asm/kmap_types.h> 5#include <asm/kmap_types.h>
7#include <asm/archparam.h> 6#include <asm/archparam.h>
8#include <asm/page.h> 7#include <asm/page.h>
diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild
index ca113d6999c..34b789b7111 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -3,7 +3,6 @@ include include/asm-generic/Kbuild.asm
3generic-y += atomic.h 3generic-y += atomic.h
4generic-y += auxvec.h 4generic-y += auxvec.h
5generic-y += bitsperlong.h 5generic-y += bitsperlong.h
6generic-y += bug.h
7generic-y += bugs.h 6generic-y += bugs.h
8generic-y += cputime.h 7generic-y += cputime.h
9generic-y += current.h 8generic-y += current.h
diff --git a/arch/unicore32/include/asm/barrier.h b/arch/unicore32/include/asm/barrier.h
new file mode 100644
index 00000000000..a6620e5336b
--- /dev/null
+++ b/arch/unicore32/include/asm/barrier.h
@@ -0,0 +1,28 @@
1/*
2 * Memory barrier implementations for PKUnity SoC and UniCore ISA
3 *
4 * Copyright (C) 2001-2012 GUAN Xue-tao
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 __UNICORE_BARRIER_H__
11#define __UNICORE_BARRIER_H__
12
13#define isb() __asm__ __volatile__ ("" : : : "memory")
14#define dsb() __asm__ __volatile__ ("" : : : "memory")
15#define dmb() __asm__ __volatile__ ("" : : : "memory")
16
17#define mb() barrier()
18#define rmb() barrier()
19#define wmb() barrier()
20#define smp_mb() barrier()
21#define smp_rmb() barrier()
22#define smp_wmb() barrier()
23#define read_barrier_depends() do { } while (0)
24#define smp_read_barrier_depends() do { } while (0)
25
26#define set_mb(var, value) do { var = value; smp_mb(); } while (0)
27
28#endif /* __UNICORE_BARRIER_H__ */
diff --git a/arch/unicore32/include/asm/bug.h b/arch/unicore32/include/asm/bug.h
new file mode 100644
index 00000000000..b1ff8cadb08
--- /dev/null
+++ b/arch/unicore32/include/asm/bug.h
@@ -0,0 +1,27 @@
1/*
2 * Bug handling for PKUnity SoC and UniCore ISA
3 *
4 * Copyright (C) 2001-2012 GUAN Xue-tao
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 __UNICORE_BUG_H__
11#define __UNICORE_BUG_H__
12
13#include <asm-generic/bug.h>
14
15struct pt_regs;
16struct siginfo;
17
18extern void die(const char *msg, struct pt_regs *regs, int err);
19extern void uc32_notify_die(const char *str, struct pt_regs *regs,
20 struct siginfo *info, unsigned long err, unsigned long trap);
21
22extern asmlinkage void __backtrace(void);
23extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
24
25extern void __show_regs(struct pt_regs *);
26
27#endif /* __UNICORE_BUG_H__ */
diff --git a/arch/unicore32/include/asm/cmpxchg.h b/arch/unicore32/include/asm/cmpxchg.h
new file mode 100644
index 00000000000..df4d5acfd19
--- /dev/null
+++ b/arch/unicore32/include/asm/cmpxchg.h
@@ -0,0 +1,61 @@
1/*
2 * Atomics xchg/cmpxchg for PKUnity SoC and UniCore ISA
3 *
4 * Copyright (C) 2001-2012 GUAN Xue-tao
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 __UNICORE_CMPXCHG_H__
11#define __UNICORE_CMPXCHG_H__
12
13/*
14 * Generate a link failure on undefined symbol if the pointer points to a value
15 * of unsupported size.
16 */
17extern void __xchg_bad_pointer(void);
18
19static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
20 int size)
21{
22 unsigned long ret;
23
24 switch (size) {
25 case 1:
26 asm volatile("swapb %0, %1, [%2]"
27 : "=&r" (ret)
28 : "r" (x), "r" (ptr)
29 : "memory", "cc");
30 break;
31 case 4:
32 asm volatile("swapw %0, %1, [%2]"
33 : "=&r" (ret)
34 : "r" (x), "r" (ptr)
35 : "memory", "cc");
36 break;
37 default:
38 ret = __xchg_bad_pointer();
39 }
40
41 return ret;
42}
43
44#define xchg(ptr, x) \
45 ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
46
47#include <asm-generic/cmpxchg-local.h>
48
49/*
50 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
51 * them available.
52 */
53#define cmpxchg_local(ptr, o, n) \
54 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), \
55 (unsigned long)(o), (unsigned long)(n), sizeof(*(ptr))))
56#define cmpxchg64_local(ptr, o, n) \
57 __cmpxchg64_local_generic((ptr), (o), (n))
58
59#include <asm-generic/cmpxchg.h>
60
61#endif /* __UNICORE_CMPXCHG_H__ */
diff --git a/arch/unicore32/include/asm/exec.h b/arch/unicore32/include/asm/exec.h
new file mode 100644
index 00000000000..06d1f0f5788
--- /dev/null
+++ b/arch/unicore32/include/asm/exec.h
@@ -0,0 +1,15 @@
1/*
2 * Process execution bits for PKUnity SoC and UniCore ISA
3 *
4 * Copyright (C) 2001-2012 GUAN Xue-tao
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 __UNICORE_EXEC_H__
11#define __UNICORE_EXEC_H__
12
13#define arch_align_stack(x) (x)
14
15#endif /* __UNICORE_EXEC_H__ */
diff --git a/arch/unicore32/include/asm/hwdef-copro.h b/arch/unicore32/include/asm/hwdef-copro.h
new file mode 100644
index 00000000000..a3292f039a6
--- /dev/null
+++ b/arch/unicore32/include/asm/hwdef-copro.h
@@ -0,0 +1,48 @@
1/*
2 * Co-processor register definitions for PKUnity SoC and UniCore ISA
3 *
4 * Copyright (C) 2001-2012 GUAN Xue-tao
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 __UNICORE_HWDEF_COPRO_H__
11#define __UNICORE_HWDEF_COPRO_H__
12
13/*
14 * Control Register bits (CP#0 CR1)
15 */
16#define CR_M (1 << 0) /* MMU enable */
17#define CR_A (1 << 1) /* Alignment abort enable */
18#define CR_D (1 << 2) /* Dcache enable */
19#define CR_I (1 << 3) /* Icache enable */
20#define CR_B (1 << 4) /* Dcache write mechanism: write back */
21#define CR_T (1 << 5) /* Burst enable */
22#define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */
23
24#ifndef __ASSEMBLY__
25
26#define vectors_high() (cr_alignment & CR_V)
27
28extern unsigned long cr_no_alignment; /* defined in entry.S */
29extern unsigned long cr_alignment; /* defined in entry.S */
30
31static inline unsigned int get_cr(void)
32{
33 unsigned int val;
34 asm("movc %0, p0.c1, #0" : "=r" (val) : : "cc");
35 return val;
36}
37
38static inline void set_cr(unsigned int val)
39{
40 asm volatile("movc p0.c1, %0, #0" : : "r" (val) : "cc");
41 isb();
42}
43
44extern void adjust_cr(unsigned long mask, unsigned long set);
45
46#endif /* __ASSEMBLY__ */
47
48#endif /* __UNICORE_HWDEF_COPRO_H__ */
diff --git a/arch/unicore32/include/asm/io.h b/arch/unicore32/include/asm/io.h
index adddf6d6407..39decb6e6f5 100644
--- a/arch/unicore32/include/asm/io.h
+++ b/arch/unicore32/include/asm/io.h
@@ -16,7 +16,6 @@
16 16
17#include <asm/byteorder.h> 17#include <asm/byteorder.h>
18#include <asm/memory.h> 18#include <asm/memory.h>
19#include <asm/system.h>
20 19
21#define PCI_IOBASE PKUNITY_PCILIO_BASE 20#define PCI_IOBASE PKUNITY_PCILIO_BASE
22#include <asm-generic/io.h> 21#include <asm-generic/io.h>
diff --git a/arch/unicore32/include/asm/switch_to.h b/arch/unicore32/include/asm/switch_to.h
new file mode 100644
index 00000000000..39572d2bd69
--- /dev/null
+++ b/arch/unicore32/include/asm/switch_to.h
@@ -0,0 +1,30 @@
1/*
2 * Task switching for PKUnity SoC and UniCore ISA
3 *
4 * Copyright (C) 2001-2012 GUAN Xue-tao
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 __UNICORE_SWITCH_TO_H__
11#define __UNICORE_SWITCH_TO_H__
12
13struct task_struct;
14struct thread_info;
15
16/*
17 * switch_to(prev, next) should switch from task `prev' to `next'
18 * `prev' will never be the same as `next'. schedule() itself
19 * contains the memory barrier to tell GCC not to cache `current'.
20 */
21extern struct task_struct *__switch_to(struct task_struct *,
22 struct thread_info *, struct thread_info *);
23
24#define switch_to(prev, next, last) \
25 do { \
26 last = __switch_to(prev, task_thread_info(prev), \
27 task_thread_info(next)); \
28 } while (0)
29
30#endif /* __UNICORE_SWITCH_TO_H__ */
diff --git a/arch/unicore32/include/asm/system.h b/arch/unicore32/include/asm/system.h
deleted file mode 100644
index 246b71c17fd..00000000000
--- a/arch/unicore32/include/asm/system.h
+++ /dev/null
@@ -1,161 +0,0 @@
1/*
2 * linux/arch/unicore32/include/asm/system.h
3 *
4 * Code specific to PKUnity SoC and UniCore ISA
5 *
6 * Copyright (C) 2001-2010 GUAN Xue-tao
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#ifndef __UNICORE_SYSTEM_H__
13#define __UNICORE_SYSTEM_H__
14
15#ifdef __KERNEL__
16
17/*
18 * CR1 bits (CP#0 CR1)
19 */
20#define CR_M (1 << 0) /* MMU enable */
21#define CR_A (1 << 1) /* Alignment abort enable */
22#define CR_D (1 << 2) /* Dcache enable */
23#define CR_I (1 << 3) /* Icache enable */
24#define CR_B (1 << 4) /* Dcache write mechanism: write back */
25#define CR_T (1 << 5) /* Burst enable */
26#define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */
27
28#ifndef __ASSEMBLY__
29
30#include <linux/linkage.h>
31#include <linux/irqflags.h>
32
33struct thread_info;
34struct task_struct;
35
36struct pt_regs;
37
38void die(const char *msg, struct pt_regs *regs, int err);
39
40struct siginfo;
41void uc32_notify_die(const char *str, struct pt_regs *regs,
42 struct siginfo *info, unsigned long err, unsigned long trap);
43
44void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
45 struct pt_regs *),
46 int sig, int code, const char *name);
47
48#define xchg(ptr, x) \
49 ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
50
51extern asmlinkage void __backtrace(void);
52extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
53
54struct mm_struct;
55extern void show_pte(struct mm_struct *mm, unsigned long addr);
56extern void __show_regs(struct pt_regs *);
57
58extern int cpu_architecture(void);
59extern void cpu_init(void);
60
61#define vectors_high() (cr_alignment & CR_V)
62
63#define isb() __asm__ __volatile__ ("" : : : "memory")
64#define dsb() __asm__ __volatile__ ("" : : : "memory")
65#define dmb() __asm__ __volatile__ ("" : : : "memory")
66
67#define mb() barrier()
68#define rmb() barrier()
69#define wmb() barrier()
70#define smp_mb() barrier()
71#define smp_rmb() barrier()
72#define smp_wmb() barrier()
73#define read_barrier_depends() do { } while (0)
74#define smp_read_barrier_depends() do { } while (0)
75
76#define set_mb(var, value) do { var = value; smp_mb(); } while (0)
77#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
78
79extern unsigned long cr_no_alignment; /* defined in entry-unicore.S */
80extern unsigned long cr_alignment; /* defined in entry-unicore.S */
81
82static inline unsigned int get_cr(void)
83{
84 unsigned int val;
85 asm("movc %0, p0.c1, #0" : "=r" (val) : : "cc");
86 return val;
87}
88
89static inline void set_cr(unsigned int val)
90{
91 asm volatile("movc p0.c1, %0, #0 @set CR"
92 : : "r" (val) : "cc");
93 isb();
94}
95
96extern void adjust_cr(unsigned long mask, unsigned long set);
97
98/*
99 * switch_to(prev, next) should switch from task `prev' to `next'
100 * `prev' will never be the same as `next'. schedule() itself
101 * contains the memory barrier to tell GCC not to cache `current'.
102 */
103extern struct task_struct *__switch_to(struct task_struct *,
104 struct thread_info *, struct thread_info *);
105extern void panic(const char *fmt, ...);
106
107#define switch_to(prev, next, last) \
108do { \
109 last = __switch_to(prev, \
110 task_thread_info(prev), task_thread_info(next)); \
111} while (0)
112
113static inline unsigned long
114__xchg(unsigned long x, volatile void *ptr, int size)
115{
116 unsigned long ret;
117
118 switch (size) {
119 case 1:
120 asm volatile("@ __xchg1\n"
121 " swapb %0, %1, [%2]"
122 : "=&r" (ret)
123 : "r" (x), "r" (ptr)
124 : "memory", "cc");
125 break;
126 case 4:
127 asm volatile("@ __xchg4\n"
128 " swapw %0, %1, [%2]"
129 : "=&r" (ret)
130 : "r" (x), "r" (ptr)
131 : "memory", "cc");
132 break;
133 default:
134 panic("xchg: bad data size: ptr 0x%p, size %d\n",
135 ptr, size);
136 }
137
138 return ret;
139}
140
141#include <asm-generic/cmpxchg-local.h>
142
143/*
144 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
145 * them available.
146 */
147#define cmpxchg_local(ptr, o, n) \
148 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), \
149 (unsigned long)(o), (unsigned long)(n), sizeof(*(ptr))))
150#define cmpxchg64_local(ptr, o, n) \
151 __cmpxchg64_local_generic((ptr), (o), (n))
152
153#include <asm-generic/cmpxchg.h>
154
155#endif /* __ASSEMBLY__ */
156
157#define arch_align_stack(x) (x)
158
159#endif /* __KERNEL__ */
160
161#endif
diff --git a/arch/unicore32/include/asm/uaccess.h b/arch/unicore32/include/asm/uaccess.h
index 2acda503a6d..897e11ad812 100644
--- a/arch/unicore32/include/asm/uaccess.h
+++ b/arch/unicore32/include/asm/uaccess.h
@@ -16,7 +16,6 @@
16#include <linux/errno.h> 16#include <linux/errno.h>
17 17
18#include <asm/memory.h> 18#include <asm/memory.h>
19#include <asm/system.h>
20 19
21#define __copy_from_user __copy_from_user 20#define __copy_from_user __copy_from_user
22#define __copy_to_user __copy_to_user 21#define __copy_to_user __copy_to_user
diff --git a/arch/unicore32/kernel/dma.c b/arch/unicore32/kernel/dma.c
index ae441bc3122..ed2d4d78d9c 100644
--- a/arch/unicore32/kernel/dma.c
+++ b/arch/unicore32/kernel/dma.c
@@ -18,7 +18,6 @@
18#include <linux/errno.h> 18#include <linux/errno.h>
19#include <linux/io.h> 19#include <linux/io.h>
20 20
21#include <asm/system.h>
22#include <asm/irq.h> 21#include <asm/irq.h>
23#include <mach/hardware.h> 22#include <mach/hardware.h>
24#include <mach/dma.h> 23#include <mach/dma.h>
diff --git a/arch/unicore32/kernel/head.S b/arch/unicore32/kernel/head.S
index 8caf322e110..e8f0b98c02e 100644
--- a/arch/unicore32/kernel/head.S
+++ b/arch/unicore32/kernel/head.S
@@ -17,7 +17,7 @@
17#include <generated/asm-offsets.h> 17#include <generated/asm-offsets.h>
18#include <asm/memory.h> 18#include <asm/memory.h>
19#include <asm/thread_info.h> 19#include <asm/thread_info.h>
20#include <asm/system.h> 20#include <asm/hwdef-copro.h>
21#include <asm/pgtable-hwdef.h> 21#include <asm/pgtable-hwdef.h>
22 22
23#if (PHYS_OFFSET & 0x003fffff) 23#if (PHYS_OFFSET & 0x003fffff)
diff --git a/arch/unicore32/kernel/hibernate.c b/arch/unicore32/kernel/hibernate.c
index 7d0f0b7983a..d75ef8b6cb5 100644
--- a/arch/unicore32/kernel/hibernate.c
+++ b/arch/unicore32/kernel/hibernate.c
@@ -15,7 +15,6 @@
15#include <linux/suspend.h> 15#include <linux/suspend.h>
16#include <linux/bootmem.h> 16#include <linux/bootmem.h>
17 17
18#include <asm/system.h>
19#include <asm/page.h> 18#include <asm/page.h>
20#include <asm/pgtable.h> 19#include <asm/pgtable.h>
21#include <asm/pgalloc.h> 20#include <asm/pgalloc.h>
diff --git a/arch/unicore32/kernel/irq.c b/arch/unicore32/kernel/irq.c
index d4efa7d679f..0be5ccd7ccd 100644
--- a/arch/unicore32/kernel/irq.c
+++ b/arch/unicore32/kernel/irq.c
@@ -26,7 +26,6 @@
26#include <linux/syscore_ops.h> 26#include <linux/syscore_ops.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28 28
29#include <asm/system.h>
30#include <mach/hardware.h> 29#include <mach/hardware.h>
31 30
32#include "setup.h" 31#include "setup.h"
diff --git a/arch/unicore32/kernel/ksyms.c b/arch/unicore32/kernel/ksyms.c
index d98bd812cae..d285d71cbe3 100644
--- a/arch/unicore32/kernel/ksyms.c
+++ b/arch/unicore32/kernel/ksyms.c
@@ -20,7 +20,6 @@
20#include <linux/io.h> 20#include <linux/io.h>
21 21
22#include <asm/checksum.h> 22#include <asm/checksum.h>
23#include <asm/system.h>
24 23
25#include "ksyms.h" 24#include "ksyms.h"
26 25
diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c
index 432b4291f37..b6f0458c314 100644
--- a/arch/unicore32/kernel/process.c
+++ b/arch/unicore32/kernel/process.c
@@ -34,7 +34,6 @@
34 34
35#include <asm/cacheflush.h> 35#include <asm/cacheflush.h>
36#include <asm/processor.h> 36#include <asm/processor.h>
37#include <asm/system.h>
38#include <asm/stacktrace.h> 37#include <asm/stacktrace.h>
39 38
40#include "setup.h" 39#include "setup.h"
diff --git a/arch/unicore32/kernel/setup.h b/arch/unicore32/kernel/setup.h
index dcd1306eb5c..f23955028a1 100644
--- a/arch/unicore32/kernel/setup.h
+++ b/arch/unicore32/kernel/setup.h
@@ -12,8 +12,11 @@
12#ifndef __UNICORE_KERNEL_SETUP_H__ 12#ifndef __UNICORE_KERNEL_SETUP_H__
13#define __UNICORE_KERNEL_SETUP_H__ 13#define __UNICORE_KERNEL_SETUP_H__
14 14
15#include <asm/hwdef-copro.h>
16
15extern void paging_init(void); 17extern void paging_init(void);
16extern void puv3_core_init(void); 18extern void puv3_core_init(void);
19extern void cpu_init(void);
17 20
18extern void puv3_ps2_init(void); 21extern void puv3_ps2_init(void);
19extern void pci_puv3_preinit(void); 22extern void pci_puv3_preinit(void);
diff --git a/arch/unicore32/kernel/traps.c b/arch/unicore32/kernel/traps.c
index b9a26465e72..2054f0d4db1 100644
--- a/arch/unicore32/kernel/traps.c
+++ b/arch/unicore32/kernel/traps.c
@@ -26,7 +26,6 @@
26#include <linux/unistd.h> 26#include <linux/unistd.h>
27 27
28#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
29#include <asm/system.h>
30#include <asm/traps.h> 29#include <asm/traps.h>
31 30
32#include "setup.h" 31#include "setup.h"
diff --git a/arch/unicore32/mm/alignment.c b/arch/unicore32/mm/alignment.c
index 28f576d733e..de7dc5fdd58 100644
--- a/arch/unicore32/mm/alignment.c
+++ b/arch/unicore32/mm/alignment.c
@@ -24,6 +24,8 @@
24#include <asm/tlbflush.h> 24#include <asm/tlbflush.h>
25#include <asm/unaligned.h> 25#include <asm/unaligned.h>
26 26
27#include "mm.h"
28
27#define CODING_BITS(i) (i & 0xe0000120) 29#define CODING_BITS(i) (i & 0xe0000120)
28 30
29#define LDST_P_BIT(i) (i & (1 << 28)) /* Preindex */ 31#define LDST_P_BIT(i) (i & (1 << 28)) /* Preindex */
diff --git a/arch/unicore32/mm/fault.c b/arch/unicore32/mm/fault.c
index 283aa4b50b7..2eeb9c04cab 100644
--- a/arch/unicore32/mm/fault.c
+++ b/arch/unicore32/mm/fault.c
@@ -20,7 +20,6 @@
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <asm/system.h>
24#include <asm/pgtable.h> 23#include <asm/pgtable.h>
25#include <asm/tlbflush.h> 24#include <asm/tlbflush.h>
26 25
diff --git a/arch/unicore32/mm/flush.c b/arch/unicore32/mm/flush.c
index 93478cc8b26..6d4c096ffa2 100644
--- a/arch/unicore32/mm/flush.c
+++ b/arch/unicore32/mm/flush.c
@@ -14,7 +14,6 @@
14#include <linux/pagemap.h> 14#include <linux/pagemap.h>
15 15
16#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
17#include <asm/system.h>
18#include <asm/tlbflush.h> 17#include <asm/tlbflush.h>
19 18
20void flush_cache_mm(struct mm_struct *mm) 19void flush_cache_mm(struct mm_struct *mm)
diff --git a/arch/unicore32/mm/mm.h b/arch/unicore32/mm/mm.h
index 3296bca0f1f..05c7f532eee 100644
--- a/arch/unicore32/mm/mm.h
+++ b/arch/unicore32/mm/mm.h
@@ -9,6 +9,8 @@
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12#include <asm/hwdef-copro.h>
13
12/* the upper-most page table pointer */ 14/* the upper-most page table pointer */
13extern pmd_t *top_pmd; 15extern pmd_t *top_pmd;
14extern int sysctl_overcommit_memory; 16extern int sysctl_overcommit_memory;
@@ -34,6 +36,9 @@ struct mem_type {
34const struct mem_type *get_mem_type(unsigned int type); 36const struct mem_type *get_mem_type(unsigned int type);
35 37
36extern void __flush_dcache_page(struct address_space *, struct page *); 38extern void __flush_dcache_page(struct address_space *, struct page *);
39extern void hook_fault_code(int nr, int (*fn)
40 (unsigned long, unsigned int, struct pt_regs *),
41 int sig, int code, const char *name);
37 42
38void __init bootmem_init(void); 43void __init bootmem_init(void);
39void uc32_mm_memblock_reserve(void); 44void uc32_mm_memblock_reserve(void);
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
index 4c2e59a420b..d511d951a05 100644
--- a/arch/x86/ia32/ia32_aout.c
+++ b/arch/x86/ia32/ia32_aout.c
@@ -26,7 +26,6 @@
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/jiffies.h> 27#include <linux/jiffies.h>
28 28
29#include <asm/system.h>
30#include <asm/uaccess.h> 29#include <asm/uaccess.h>
31#include <asm/pgalloc.h> 30#include <asm/pgalloc.h>
32#include <asm/cacheflush.h> 31#include <asm/cacheflush.h>
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index a9371c91718..4b2caeefe1a 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -11,7 +11,6 @@
11#include <linux/atomic.h> 11#include <linux/atomic.h>
12#include <asm/fixmap.h> 12#include <asm/fixmap.h>
13#include <asm/mpspec.h> 13#include <asm/mpspec.h>
14#include <asm/system.h>
15#include <asm/msr.h> 14#include <asm/msr.h>
16 15
17#define ARCH_APICTIMER_STOPS_ON_C3 1 16#define ARCH_APICTIMER_STOPS_ON_C3 1
diff --git a/arch/x86/include/asm/auxvec.h b/arch/x86/include/asm/auxvec.h
index 1316b4c3542..77203ac352d 100644
--- a/arch/x86/include/asm/auxvec.h
+++ b/arch/x86/include/asm/auxvec.h
@@ -9,4 +9,11 @@
9#endif 9#endif
10#define AT_SYSINFO_EHDR 33 10#define AT_SYSINFO_EHDR 33
11 11
12/* entries in ARCH_DLINFO: */
13#if defined(CONFIG_IA32_EMULATION) || !defined(CONFIG_X86_64)
14# define AT_VECTOR_SIZE_ARCH 2
15#else /* else it's non-compat x86-64 */
16# define AT_VECTOR_SIZE_ARCH 1
17#endif
18
12#endif /* _ASM_X86_AUXVEC_H */ 19#endif /* _ASM_X86_AUXVEC_H */
diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h
new file mode 100644
index 00000000000..c6cd358a1ee
--- /dev/null
+++ b/arch/x86/include/asm/barrier.h
@@ -0,0 +1,116 @@
1#ifndef _ASM_X86_BARRIER_H
2#define _ASM_X86_BARRIER_H
3
4#include <asm/alternative.h>
5#include <asm/nops.h>
6
7/*
8 * Force strict CPU ordering.
9 * And yes, this is required on UP too when we're talking
10 * to devices.
11 */
12
13#ifdef CONFIG_X86_32
14/*
15 * Some non-Intel clones support out of order store. wmb() ceases to be a
16 * nop for these.
17 */
18#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)
19#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)
20#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
21#else
22#define mb() asm volatile("mfence":::"memory")
23#define rmb() asm volatile("lfence":::"memory")
24#define wmb() asm volatile("sfence" ::: "memory")
25#endif
26
27/**
28 * read_barrier_depends - Flush all pending reads that subsequents reads
29 * depend on.
30 *
31 * No data-dependent reads from memory-like regions are ever reordered
32 * over this barrier. All reads preceding this primitive are guaranteed
33 * to access memory (but not necessarily other CPUs' caches) before any
34 * reads following this primitive that depend on the data return by
35 * any of the preceding reads. This primitive is much lighter weight than
36 * rmb() on most CPUs, and is never heavier weight than is
37 * rmb().
38 *
39 * These ordering constraints are respected by both the local CPU
40 * and the compiler.
41 *
42 * Ordering is not guaranteed by anything other than these primitives,
43 * not even by data dependencies. See the documentation for
44 * memory_barrier() for examples and URLs to more information.
45 *
46 * For example, the following code would force ordering (the initial
47 * value of "a" is zero, "b" is one, and "p" is "&a"):
48 *
49 * <programlisting>
50 * CPU 0 CPU 1
51 *
52 * b = 2;
53 * memory_barrier();
54 * p = &b; q = p;
55 * read_barrier_depends();
56 * d = *q;
57 * </programlisting>
58 *
59 * because the read of "*q" depends on the read of "p" and these
60 * two reads are separated by a read_barrier_depends(). However,
61 * the following code, with the same initial values for "a" and "b":
62 *
63 * <programlisting>
64 * CPU 0 CPU 1
65 *
66 * a = 2;
67 * memory_barrier();
68 * b = 3; y = b;
69 * read_barrier_depends();
70 * x = a;
71 * </programlisting>
72 *
73 * does not enforce ordering, since there is no data dependency between
74 * the read of "a" and the read of "b". Therefore, on some CPUs, such
75 * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb()
76 * in cases like this where there are no data dependencies.
77 **/
78
79#define read_barrier_depends() do { } while (0)
80
81#ifdef CONFIG_SMP
82#define smp_mb() mb()
83#ifdef CONFIG_X86_PPRO_FENCE
84# define smp_rmb() rmb()
85#else
86# define smp_rmb() barrier()
87#endif
88#ifdef CONFIG_X86_OOSTORE
89# define smp_wmb() wmb()
90#else
91# define smp_wmb() barrier()
92#endif
93#define smp_read_barrier_depends() read_barrier_depends()
94#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
95#else
96#define smp_mb() barrier()
97#define smp_rmb() barrier()
98#define smp_wmb() barrier()
99#define smp_read_barrier_depends() do { } while (0)
100#define set_mb(var, value) do { var = value; barrier(); } while (0)
101#endif
102
103/*
104 * Stop RDTSC speculation. This is needed when you need to use RDTSC
105 * (or get_cycles or vread that possibly accesses the TSC) in a defined
106 * code region.
107 *
108 * (Could use an alternative three way for this if there was one.)
109 */
110static __always_inline void rdtsc_barrier(void)
111{
112 alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC);
113 alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);
114}
115
116#endif /* _ASM_X86_BARRIER_H */
diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index f654d1bb17f..11e1152222d 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -36,4 +36,8 @@ do { \
36#endif /* !CONFIG_BUG */ 36#endif /* !CONFIG_BUG */
37 37
38#include <asm-generic/bug.h> 38#include <asm-generic/bug.h>
39
40
41extern void show_regs_common(void);
42
39#endif /* _ASM_X86_BUG_H */ 43#endif /* _ASM_X86_BUG_H */
diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h
index 4e12668711e..9863ee3747d 100644
--- a/arch/x86/include/asm/cacheflush.h
+++ b/arch/x86/include/asm/cacheflush.h
@@ -3,6 +3,7 @@
3 3
4/* Caches aren't brain-dead on the intel. */ 4/* Caches aren't brain-dead on the intel. */
5#include <asm-generic/cacheflush.h> 5#include <asm-generic/cacheflush.h>
6#include <asm/special_insns.h>
6 7
7#ifdef CONFIG_X86_PAT 8#ifdef CONFIG_X86_PAT
8/* 9/*
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
index 5f962df30d0..f27f79abe02 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -84,7 +84,6 @@ extern unsigned int vdso_enabled;
84 (((x)->e_machine == EM_386) || ((x)->e_machine == EM_486)) 84 (((x)->e_machine == EM_386) || ((x)->e_machine == EM_486))
85 85
86#include <asm/processor.h> 86#include <asm/processor.h>
87#include <asm/system.h>
88 87
89#ifdef CONFIG_X86_32 88#ifdef CONFIG_X86_32
90#include <asm/desc.h> 89#include <asm/desc.h>
diff --git a/arch/x86/include/asm/exec.h b/arch/x86/include/asm/exec.h
new file mode 100644
index 00000000000..54c2e1db274
--- /dev/null
+++ b/arch/x86/include/asm/exec.h
@@ -0,0 +1 @@
/* define arch_align_stack() here */
diff --git a/arch/x86/include/asm/futex.h b/arch/x86/include/asm/futex.h
index d09bb03653f..71ecbcba1a4 100644
--- a/arch/x86/include/asm/futex.h
+++ b/arch/x86/include/asm/futex.h
@@ -9,7 +9,6 @@
9#include <asm/asm.h> 9#include <asm/asm.h>
10#include <asm/errno.h> 10#include <asm/errno.h>
11#include <asm/processor.h> 11#include <asm/processor.h>
12#include <asm/system.h>
13 12
14#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \ 13#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \
15 asm volatile("1:\t" insn "\n" \ 14 asm volatile("1:\t" insn "\n" \
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 7ce0798b1b2..257d9cca214 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -14,7 +14,6 @@
14 14
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/hardirq.h> 16#include <linux/hardirq.h>
17#include <asm/system.h>
18 17
19struct pt_regs; 18struct pt_regs;
20struct user_i387_struct; 19struct user_i387_struct;
diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h
index 9cdae5d47e8..c8bed0da434 100644
--- a/arch/x86/include/asm/local.h
+++ b/arch/x86/include/asm/local.h
@@ -3,7 +3,6 @@
3 3
4#include <linux/percpu.h> 4#include <linux/percpu.h>
5 5
6#include <asm/system.h>
7#include <linux/atomic.h> 6#include <linux/atomic.h>
8#include <asm/asm.h> 7#include <asm/asm.h>
9 8
diff --git a/arch/x86/include/asm/mc146818rtc.h b/arch/x86/include/asm/mc146818rtc.h
index 0e8e85bb7c5..d354fb781c5 100644
--- a/arch/x86/include/asm/mc146818rtc.h
+++ b/arch/x86/include/asm/mc146818rtc.h
@@ -5,7 +5,6 @@
5#define _ASM_X86_MC146818RTC_H 5#define _ASM_X86_MC146818RTC_H
6 6
7#include <asm/io.h> 7#include <asm/io.h>
8#include <asm/system.h>
9#include <asm/processor.h> 8#include <asm/processor.h>
10#include <linux/mc146818rtc.h> 9#include <linux/mc146818rtc.h>
11 10
diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h
index bce688d54c1..e21fdd10479 100644
--- a/arch/x86/include/asm/page_types.h
+++ b/arch/x86/include/asm/page_types.h
@@ -55,7 +55,6 @@ extern unsigned long init_memory_mapping(unsigned long start,
55 unsigned long end); 55 unsigned long end);
56 56
57extern void initmem_init(void); 57extern void initmem_init(void);
58extern void free_initmem(void);
59 58
60#endif /* !__ASSEMBLY__ */ 59#endif /* !__ASSEMBLY__ */
61 60
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 5533b30cac0..a19542c1685 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -14,13 +14,13 @@ struct mm_struct;
14#include <asm/sigcontext.h> 14#include <asm/sigcontext.h>
15#include <asm/current.h> 15#include <asm/current.h>
16#include <asm/cpufeature.h> 16#include <asm/cpufeature.h>
17#include <asm/system.h>
18#include <asm/page.h> 17#include <asm/page.h>
19#include <asm/pgtable_types.h> 18#include <asm/pgtable_types.h>
20#include <asm/percpu.h> 19#include <asm/percpu.h>
21#include <asm/msr.h> 20#include <asm/msr.h>
22#include <asm/desc_defs.h> 21#include <asm/desc_defs.h>
23#include <asm/nops.h> 22#include <asm/nops.h>
23#include <asm/special_insns.h>
24 24
25#include <linux/personality.h> 25#include <linux/personality.h>
26#include <linux/cpumask.h> 26#include <linux/cpumask.h>
@@ -29,6 +29,15 @@ struct mm_struct;
29#include <linux/math64.h> 29#include <linux/math64.h>
30#include <linux/init.h> 30#include <linux/init.h>
31#include <linux/err.h> 31#include <linux/err.h>
32#include <linux/irqflags.h>
33
34/*
35 * We handle most unaligned accesses in hardware. On the other hand
36 * unaligned DMA can be quite expensive on some Nehalem processors.
37 *
38 * Based on this we disable the IP header alignment in network drivers.
39 */
40#define NET_IP_ALIGN 0
32 41
33#define HBP_NUM 4 42#define HBP_NUM 4
34/* 43/*
@@ -959,4 +968,24 @@ extern bool cpu_has_amd_erratum(const int *);
959#define cpu_has_amd_erratum(x) (false) 968#define cpu_has_amd_erratum(x) (false)
960#endif /* CONFIG_CPU_SUP_AMD */ 969#endif /* CONFIG_CPU_SUP_AMD */
961 970
971#ifdef CONFIG_X86_32
972/*
973 * disable hlt during certain critical i/o operations
974 */
975#define HAVE_DISABLE_HLT
976#endif
977
978void disable_hlt(void);
979void enable_hlt(void);
980
981void cpu_idle_wait(void);
982
983extern unsigned long arch_align_stack(unsigned long sp);
984extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
985
986void default_idle(void);
987bool set_pm_idle_to_default(void);
988
989void stop_this_cpu(void *dummy);
990
962#endif /* _ASM_X86_PROCESSOR_H */ 991#endif /* _ASM_X86_PROCESSOR_H */
diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
index 5e641715c3f..165466233ab 100644
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
@@ -212,7 +212,61 @@
212#ifdef __KERNEL__ 212#ifdef __KERNEL__
213#ifndef __ASSEMBLY__ 213#ifndef __ASSEMBLY__
214extern const char early_idt_handlers[NUM_EXCEPTION_VECTORS][10]; 214extern const char early_idt_handlers[NUM_EXCEPTION_VECTORS][10];
215#endif 215
216#endif 216/*
217 * Load a segment. Fall back on loading the zero
218 * segment if something goes wrong..
219 */
220#define loadsegment(seg, value) \
221do { \
222 unsigned short __val = (value); \
223 \
224 asm volatile(" \n" \
225 "1: movl %k0,%%" #seg " \n" \
226 \
227 ".section .fixup,\"ax\" \n" \
228 "2: xorl %k0,%k0 \n" \
229 " jmp 1b \n" \
230 ".previous \n" \
231 \
232 _ASM_EXTABLE(1b, 2b) \
233 \
234 : "+r" (__val) : : "memory"); \
235} while (0)
236
237/*
238 * Save a segment register away
239 */
240#define savesegment(seg, value) \
241 asm("mov %%" #seg ",%0":"=r" (value) : : "memory")
242
243/*
244 * x86_32 user gs accessors.
245 */
246#ifdef CONFIG_X86_32
247#ifdef CONFIG_X86_32_LAZY_GS
248#define get_user_gs(regs) (u16)({unsigned long v; savesegment(gs, v); v;})
249#define set_user_gs(regs, v) loadsegment(gs, (unsigned long)(v))
250#define task_user_gs(tsk) ((tsk)->thread.gs)
251#define lazy_save_gs(v) savesegment(gs, (v))
252#define lazy_load_gs(v) loadsegment(gs, (v))
253#else /* X86_32_LAZY_GS */
254#define get_user_gs(regs) (u16)((regs)->gs)
255#define set_user_gs(regs, v) do { (regs)->gs = (v); } while (0)
256#define task_user_gs(tsk) (task_pt_regs(tsk)->gs)
257#define lazy_save_gs(v) do { } while (0)
258#define lazy_load_gs(v) do { } while (0)
259#endif /* X86_32_LAZY_GS */
260#endif /* X86_32 */
261
262static inline unsigned long get_limit(unsigned long segment)
263{
264 unsigned long __limit;
265 asm("lsll %1,%0" : "=r" (__limit) : "r" (segment));
266 return __limit + 1;
267}
268
269#endif /* !__ASSEMBLY__ */
270#endif /* __KERNEL__ */
217 271
218#endif /* _ASM_X86_SEGMENT_H */ 272#endif /* _ASM_X86_SEGMENT_H */
diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h
new file mode 100644
index 00000000000..41fc93a2e22
--- /dev/null
+++ b/arch/x86/include/asm/special_insns.h
@@ -0,0 +1,199 @@
1#ifndef _ASM_X86_SPECIAL_INSNS_H
2#define _ASM_X86_SPECIAL_INSNS_H
3
4
5#ifdef __KERNEL__
6
7static inline void native_clts(void)
8{
9 asm volatile("clts");
10}
11
12/*
13 * Volatile isn't enough to prevent the compiler from reordering the
14 * read/write functions for the control registers and messing everything up.
15 * A memory clobber would solve the problem, but would prevent reordering of
16 * all loads stores around it, which can hurt performance. Solution is to
17 * use a variable and mimic reads and writes to it to enforce serialization
18 */
19static unsigned long __force_order;
20
21static inline unsigned long native_read_cr0(void)
22{
23 unsigned long val;
24 asm volatile("mov %%cr0,%0\n\t" : "=r" (val), "=m" (__force_order));
25 return val;
26}
27
28static inline void native_write_cr0(unsigned long val)
29{
30 asm volatile("mov %0,%%cr0": : "r" (val), "m" (__force_order));
31}
32
33static inline unsigned long native_read_cr2(void)
34{
35 unsigned long val;
36 asm volatile("mov %%cr2,%0\n\t" : "=r" (val), "=m" (__force_order));
37 return val;
38}
39
40static inline void native_write_cr2(unsigned long val)
41{
42 asm volatile("mov %0,%%cr2": : "r" (val), "m" (__force_order));
43}
44
45static inline unsigned long native_read_cr3(void)
46{
47 unsigned long val;
48 asm volatile("mov %%cr3,%0\n\t" : "=r" (val), "=m" (__force_order));
49 return val;
50}
51
52static inline void native_write_cr3(unsigned long val)
53{
54 asm volatile("mov %0,%%cr3": : "r" (val), "m" (__force_order));
55}
56
57static inline unsigned long native_read_cr4(void)
58{
59 unsigned long val;
60 asm volatile("mov %%cr4,%0\n\t" : "=r" (val), "=m" (__force_order));
61 return val;
62}
63
64static inline unsigned long native_read_cr4_safe(void)
65{
66 unsigned long val;
67 /* This could fault if %cr4 does not exist. In x86_64, a cr4 always
68 * exists, so it will never fail. */
69#ifdef CONFIG_X86_32
70 asm volatile("1: mov %%cr4, %0\n"
71 "2:\n"
72 _ASM_EXTABLE(1b, 2b)
73 : "=r" (val), "=m" (__force_order) : "0" (0));
74#else
75 val = native_read_cr4();
76#endif
77 return val;
78}
79
80static inline void native_write_cr4(unsigned long val)
81{
82 asm volatile("mov %0,%%cr4": : "r" (val), "m" (__force_order));
83}
84
85#ifdef CONFIG_X86_64
86static inline unsigned long native_read_cr8(void)
87{
88 unsigned long cr8;
89 asm volatile("movq %%cr8,%0" : "=r" (cr8));
90 return cr8;
91}
92
93static inline void native_write_cr8(unsigned long val)
94{
95 asm volatile("movq %0,%%cr8" :: "r" (val) : "memory");
96}
97#endif
98
99static inline void native_wbinvd(void)
100{
101 asm volatile("wbinvd": : :"memory");
102}
103
104extern void native_load_gs_index(unsigned);
105
106#ifdef CONFIG_PARAVIRT
107#include <asm/paravirt.h>
108#else
109
110static inline unsigned long read_cr0(void)
111{
112 return native_read_cr0();
113}
114
115static inline void write_cr0(unsigned long x)
116{
117 native_write_cr0(x);
118}
119
120static inline unsigned long read_cr2(void)
121{
122 return native_read_cr2();
123}
124
125static inline void write_cr2(unsigned long x)
126{
127 native_write_cr2(x);
128}
129
130static inline unsigned long read_cr3(void)
131{
132 return native_read_cr3();
133}
134
135static inline void write_cr3(unsigned long x)
136{
137 native_write_cr3(x);
138}
139
140static inline unsigned long read_cr4(void)
141{
142 return native_read_cr4();
143}
144
145static inline unsigned long read_cr4_safe(void)
146{
147 return native_read_cr4_safe();
148}
149
150static inline void write_cr4(unsigned long x)
151{
152 native_write_cr4(x);
153}
154
155static inline void wbinvd(void)
156{
157 native_wbinvd();
158}
159
160#ifdef CONFIG_X86_64
161
162static inline unsigned long read_cr8(void)
163{
164 return native_read_cr8();
165}
166
167static inline void write_cr8(unsigned long x)
168{
169 native_write_cr8(x);
170}
171
172static inline void load_gs_index(unsigned selector)
173{
174 native_load_gs_index(selector);
175}
176
177#endif
178
179/* Clear the 'TS' bit */
180static inline void clts(void)
181{
182 native_clts();
183}
184
185#endif/* CONFIG_PARAVIRT */
186
187#define stts() write_cr0(read_cr0() | X86_CR0_TS)
188
189static inline void clflush(volatile void *__p)
190{
191 asm volatile("clflush %0" : "+m" (*(volatile char __force *)__p));
192}
193
194#define nop() asm volatile ("nop")
195
196
197#endif /* __KERNEL__ */
198
199#endif /* _ASM_X86_SPECIAL_INSNS_H */
diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h
index 15751776356..b5d9533d2c3 100644
--- a/arch/x86/include/asm/stackprotector.h
+++ b/arch/x86/include/asm/stackprotector.h
@@ -38,7 +38,6 @@
38#include <asm/tsc.h> 38#include <asm/tsc.h>
39#include <asm/processor.h> 39#include <asm/processor.h>
40#include <asm/percpu.h> 40#include <asm/percpu.h>
41#include <asm/system.h>
42#include <asm/desc.h> 41#include <asm/desc.h>
43#include <linux/random.h> 42#include <linux/random.h>
44 43
diff --git a/arch/x86/include/asm/switch_to.h b/arch/x86/include/asm/switch_to.h
new file mode 100644
index 00000000000..4ec45b3abba
--- /dev/null
+++ b/arch/x86/include/asm/switch_to.h
@@ -0,0 +1,129 @@
1#ifndef _ASM_X86_SWITCH_TO_H
2#define _ASM_X86_SWITCH_TO_H
3
4struct task_struct; /* one of the stranger aspects of C forward declarations */
5struct task_struct *__switch_to(struct task_struct *prev,
6 struct task_struct *next);
7struct tss_struct;
8void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
9 struct tss_struct *tss);
10
11#ifdef CONFIG_X86_32
12
13#ifdef CONFIG_CC_STACKPROTECTOR
14#define __switch_canary \
15 "movl %P[task_canary](%[next]), %%ebx\n\t" \
16 "movl %%ebx, "__percpu_arg([stack_canary])"\n\t"
17#define __switch_canary_oparam \
18 , [stack_canary] "=m" (stack_canary.canary)
19#define __switch_canary_iparam \
20 , [task_canary] "i" (offsetof(struct task_struct, stack_canary))
21#else /* CC_STACKPROTECTOR */
22#define __switch_canary
23#define __switch_canary_oparam
24#define __switch_canary_iparam
25#endif /* CC_STACKPROTECTOR */
26
27/*
28 * Saving eflags is important. It switches not only IOPL between tasks,
29 * it also protects other tasks from NT leaking through sysenter etc.
30 */
31#define switch_to(prev, next, last) \
32do { \
33 /* \
34 * Context-switching clobbers all registers, so we clobber \
35 * them explicitly, via unused output variables. \
36 * (EAX and EBP is not listed because EBP is saved/restored \
37 * explicitly for wchan access and EAX is the return value of \
38 * __switch_to()) \
39 */ \
40 unsigned long ebx, ecx, edx, esi, edi; \
41 \
42 asm volatile("pushfl\n\t" /* save flags */ \
43 "pushl %%ebp\n\t" /* save EBP */ \
44 "movl %%esp,%[prev_sp]\n\t" /* save ESP */ \
45 "movl %[next_sp],%%esp\n\t" /* restore ESP */ \
46 "movl $1f,%[prev_ip]\n\t" /* save EIP */ \
47 "pushl %[next_ip]\n\t" /* restore EIP */ \
48 __switch_canary \
49 "jmp __switch_to\n" /* regparm call */ \
50 "1:\t" \
51 "popl %%ebp\n\t" /* restore EBP */ \
52 "popfl\n" /* restore flags */ \
53 \
54 /* output parameters */ \
55 : [prev_sp] "=m" (prev->thread.sp), \
56 [prev_ip] "=m" (prev->thread.ip), \
57 "=a" (last), \
58 \
59 /* clobbered output registers: */ \
60 "=b" (ebx), "=c" (ecx), "=d" (edx), \
61 "=S" (esi), "=D" (edi) \
62 \
63 __switch_canary_oparam \
64 \
65 /* input parameters: */ \
66 : [next_sp] "m" (next->thread.sp), \
67 [next_ip] "m" (next->thread.ip), \
68 \
69 /* regparm parameters for __switch_to(): */ \
70 [prev] "a" (prev), \
71 [next] "d" (next) \
72 \
73 __switch_canary_iparam \
74 \
75 : /* reloaded segment registers */ \
76 "memory"); \
77} while (0)
78
79#else /* CONFIG_X86_32 */
80
81/* frame pointer must be last for get_wchan */
82#define SAVE_CONTEXT "pushf ; pushq %%rbp ; movq %%rsi,%%rbp\n\t"
83#define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp ; popf\t"
84
85#define __EXTRA_CLOBBER \
86 , "rcx", "rbx", "rdx", "r8", "r9", "r10", "r11", \
87 "r12", "r13", "r14", "r15"
88
89#ifdef CONFIG_CC_STACKPROTECTOR
90#define __switch_canary \
91 "movq %P[task_canary](%%rsi),%%r8\n\t" \
92 "movq %%r8,"__percpu_arg([gs_canary])"\n\t"
93#define __switch_canary_oparam \
94 , [gs_canary] "=m" (irq_stack_union.stack_canary)
95#define __switch_canary_iparam \
96 , [task_canary] "i" (offsetof(struct task_struct, stack_canary))
97#else /* CC_STACKPROTECTOR */
98#define __switch_canary
99#define __switch_canary_oparam
100#define __switch_canary_iparam
101#endif /* CC_STACKPROTECTOR */
102
103/* Save restore flags to clear handle leaking NT */
104#define switch_to(prev, next, last) \
105 asm volatile(SAVE_CONTEXT \
106 "movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \
107 "movq %P[threadrsp](%[next]),%%rsp\n\t" /* restore RSP */ \
108 "call __switch_to\n\t" \
109 "movq "__percpu_arg([current_task])",%%rsi\n\t" \
110 __switch_canary \
111 "movq %P[thread_info](%%rsi),%%r8\n\t" \
112 "movq %%rax,%%rdi\n\t" \
113 "testl %[_tif_fork],%P[ti_flags](%%r8)\n\t" \
114 "jnz ret_from_fork\n\t" \
115 RESTORE_CONTEXT \
116 : "=a" (last) \
117 __switch_canary_oparam \
118 : [next] "S" (next), [prev] "D" (prev), \
119 [threadrsp] "i" (offsetof(struct task_struct, thread.sp)), \
120 [ti_flags] "i" (offsetof(struct thread_info, flags)), \
121 [_tif_fork] "i" (_TIF_FORK), \
122 [thread_info] "i" (offsetof(struct task_struct, stack)), \
123 [current_task] "m" (current_task) \
124 __switch_canary_iparam \
125 : "memory", "cc" __EXTRA_CLOBBER)
126
127#endif /* CONFIG_X86_32 */
128
129#endif /* _ASM_X86_SWITCH_TO_H */
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
deleted file mode 100644
index 2d2f01ce6dc..00000000000
--- a/arch/x86/include/asm/system.h
+++ /dev/null
@@ -1,523 +0,0 @@
1#ifndef _ASM_X86_SYSTEM_H
2#define _ASM_X86_SYSTEM_H
3
4#include <asm/asm.h>
5#include <asm/segment.h>
6#include <asm/cpufeature.h>
7#include <asm/cmpxchg.h>
8#include <asm/nops.h>
9
10#include <linux/kernel.h>
11#include <linux/irqflags.h>
12
13/* entries in ARCH_DLINFO: */
14#if defined(CONFIG_IA32_EMULATION) || !defined(CONFIG_X86_64)
15# define AT_VECTOR_SIZE_ARCH 2
16#else /* else it's non-compat x86-64 */
17# define AT_VECTOR_SIZE_ARCH 1
18#endif
19
20struct task_struct; /* one of the stranger aspects of C forward declarations */
21struct task_struct *__switch_to(struct task_struct *prev,
22 struct task_struct *next);
23struct tss_struct;
24void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
25 struct tss_struct *tss);
26extern void show_regs_common(void);
27
28#ifdef CONFIG_X86_32
29
30#ifdef CONFIG_CC_STACKPROTECTOR
31#define __switch_canary \
32 "movl %P[task_canary](%[next]), %%ebx\n\t" \
33 "movl %%ebx, "__percpu_arg([stack_canary])"\n\t"
34#define __switch_canary_oparam \
35 , [stack_canary] "=m" (stack_canary.canary)
36#define __switch_canary_iparam \
37 , [task_canary] "i" (offsetof(struct task_struct, stack_canary))
38#else /* CC_STACKPROTECTOR */
39#define __switch_canary
40#define __switch_canary_oparam
41#define __switch_canary_iparam
42#endif /* CC_STACKPROTECTOR */
43
44/*
45 * Saving eflags is important. It switches not only IOPL between tasks,
46 * it also protects other tasks from NT leaking through sysenter etc.
47 */
48#define switch_to(prev, next, last) \
49do { \
50 /* \
51 * Context-switching clobbers all registers, so we clobber \
52 * them explicitly, via unused output variables. \
53 * (EAX and EBP is not listed because EBP is saved/restored \
54 * explicitly for wchan access and EAX is the return value of \
55 * __switch_to()) \
56 */ \
57 unsigned long ebx, ecx, edx, esi, edi; \
58 \
59 asm volatile("pushfl\n\t" /* save flags */ \
60 "pushl %%ebp\n\t" /* save EBP */ \
61 "movl %%esp,%[prev_sp]\n\t" /* save ESP */ \
62 "movl %[next_sp],%%esp\n\t" /* restore ESP */ \
63 "movl $1f,%[prev_ip]\n\t" /* save EIP */ \
64 "pushl %[next_ip]\n\t" /* restore EIP */ \
65 __switch_canary \
66 "jmp __switch_to\n" /* regparm call */ \
67 "1:\t" \
68 "popl %%ebp\n\t" /* restore EBP */ \
69 "popfl\n" /* restore flags */ \
70 \
71 /* output parameters */ \
72 : [prev_sp] "=m" (prev->thread.sp), \
73 [prev_ip] "=m" (prev->thread.ip), \
74 "=a" (last), \
75 \
76 /* clobbered output registers: */ \
77 "=b" (ebx), "=c" (ecx), "=d" (edx), \
78 "=S" (esi), "=D" (edi) \
79 \
80 __switch_canary_oparam \
81 \
82 /* input parameters: */ \
83 : [next_sp] "m" (next->thread.sp), \
84 [next_ip] "m" (next->thread.ip), \
85 \
86 /* regparm parameters for __switch_to(): */ \
87 [prev] "a" (prev), \
88 [next] "d" (next) \
89 \
90 __switch_canary_iparam \
91 \
92 : /* reloaded segment registers */ \
93 "memory"); \
94} while (0)
95
96/*
97 * disable hlt during certain critical i/o operations
98 */
99#define HAVE_DISABLE_HLT
100#else
101
102/* frame pointer must be last for get_wchan */
103#define SAVE_CONTEXT "pushf ; pushq %%rbp ; movq %%rsi,%%rbp\n\t"
104#define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp ; popf\t"
105
106#define __EXTRA_CLOBBER \
107 , "rcx", "rbx", "rdx", "r8", "r9", "r10", "r11", \
108 "r12", "r13", "r14", "r15"
109
110#ifdef CONFIG_CC_STACKPROTECTOR
111#define __switch_canary \
112 "movq %P[task_canary](%%rsi),%%r8\n\t" \
113 "movq %%r8,"__percpu_arg([gs_canary])"\n\t"
114#define __switch_canary_oparam \
115 , [gs_canary] "=m" (irq_stack_union.stack_canary)
116#define __switch_canary_iparam \
117 , [task_canary] "i" (offsetof(struct task_struct, stack_canary))
118#else /* CC_STACKPROTECTOR */
119#define __switch_canary
120#define __switch_canary_oparam
121#define __switch_canary_iparam
122#endif /* CC_STACKPROTECTOR */
123
124/* Save restore flags to clear handle leaking NT */
125#define switch_to(prev, next, last) \
126 asm volatile(SAVE_CONTEXT \
127 "movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \
128 "movq %P[threadrsp](%[next]),%%rsp\n\t" /* restore RSP */ \
129 "call __switch_to\n\t" \
130 "movq "__percpu_arg([current_task])",%%rsi\n\t" \
131 __switch_canary \
132 "movq %P[thread_info](%%rsi),%%r8\n\t" \
133 "movq %%rax,%%rdi\n\t" \
134 "testl %[_tif_fork],%P[ti_flags](%%r8)\n\t" \
135 "jnz ret_from_fork\n\t" \
136 RESTORE_CONTEXT \
137 : "=a" (last) \
138 __switch_canary_oparam \
139 : [next] "S" (next), [prev] "D" (prev), \
140 [threadrsp] "i" (offsetof(struct task_struct, thread.sp)), \
141 [ti_flags] "i" (offsetof(struct thread_info, flags)), \
142 [_tif_fork] "i" (_TIF_FORK), \
143 [thread_info] "i" (offsetof(struct task_struct, stack)), \
144 [current_task] "m" (current_task) \
145 __switch_canary_iparam \
146 : "memory", "cc" __EXTRA_CLOBBER)
147#endif
148
149#ifdef __KERNEL__
150
151extern void native_load_gs_index(unsigned);
152
153/*
154 * Load a segment. Fall back on loading the zero
155 * segment if something goes wrong..
156 */
157#define loadsegment(seg, value) \
158do { \
159 unsigned short __val = (value); \
160 \
161 asm volatile(" \n" \
162 "1: movl %k0,%%" #seg " \n" \
163 \
164 ".section .fixup,\"ax\" \n" \
165 "2: xorl %k0,%k0 \n" \
166 " jmp 1b \n" \
167 ".previous \n" \
168 \
169 _ASM_EXTABLE(1b, 2b) \
170 \
171 : "+r" (__val) : : "memory"); \
172} while (0)
173
174/*
175 * Save a segment register away
176 */
177#define savesegment(seg, value) \
178 asm("mov %%" #seg ",%0":"=r" (value) : : "memory")
179
180/*
181 * x86_32 user gs accessors.
182 */
183#ifdef CONFIG_X86_32
184#ifdef CONFIG_X86_32_LAZY_GS
185#define get_user_gs(regs) (u16)({unsigned long v; savesegment(gs, v); v;})
186#define set_user_gs(regs, v) loadsegment(gs, (unsigned long)(v))
187#define task_user_gs(tsk) ((tsk)->thread.gs)
188#define lazy_save_gs(v) savesegment(gs, (v))
189#define lazy_load_gs(v) loadsegment(gs, (v))
190#else /* X86_32_LAZY_GS */
191#define get_user_gs(regs) (u16)((regs)->gs)
192#define set_user_gs(regs, v) do { (regs)->gs = (v); } while (0)
193#define task_user_gs(tsk) (task_pt_regs(tsk)->gs)
194#define lazy_save_gs(v) do { } while (0)
195#define lazy_load_gs(v) do { } while (0)
196#endif /* X86_32_LAZY_GS */
197#endif /* X86_32 */
198
199static inline unsigned long get_limit(unsigned long segment)
200{
201 unsigned long __limit;
202 asm("lsll %1,%0" : "=r" (__limit) : "r" (segment));
203 return __limit + 1;
204}
205
206static inline void native_clts(void)
207{
208 asm volatile("clts");
209}
210
211/*
212 * Volatile isn't enough to prevent the compiler from reordering the
213 * read/write functions for the control registers and messing everything up.
214 * A memory clobber would solve the problem, but would prevent reordering of
215 * all loads stores around it, which can hurt performance. Solution is to
216 * use a variable and mimic reads and writes to it to enforce serialization
217 */
218static unsigned long __force_order;
219
220static inline unsigned long native_read_cr0(void)
221{
222 unsigned long val;
223 asm volatile("mov %%cr0,%0\n\t" : "=r" (val), "=m" (__force_order));
224 return val;
225}
226
227static inline void native_write_cr0(unsigned long val)
228{
229 asm volatile("mov %0,%%cr0": : "r" (val), "m" (__force_order));
230}
231
232static inline unsigned long native_read_cr2(void)
233{
234 unsigned long val;
235 asm volatile("mov %%cr2,%0\n\t" : "=r" (val), "=m" (__force_order));
236 return val;
237}
238
239static inline void native_write_cr2(unsigned long val)
240{
241 asm volatile("mov %0,%%cr2": : "r" (val), "m" (__force_order));
242}
243
244static inline unsigned long native_read_cr3(void)
245{
246 unsigned long val;
247 asm volatile("mov %%cr3,%0\n\t" : "=r" (val), "=m" (__force_order));
248 return val;
249}
250
251static inline void native_write_cr3(unsigned long val)
252{
253 asm volatile("mov %0,%%cr3": : "r" (val), "m" (__force_order));
254}
255
256static inline unsigned long native_read_cr4(void)
257{
258 unsigned long val;
259 asm volatile("mov %%cr4,%0\n\t" : "=r" (val), "=m" (__force_order));
260 return val;
261}
262
263static inline unsigned long native_read_cr4_safe(void)
264{
265 unsigned long val;
266 /* This could fault if %cr4 does not exist. In x86_64, a cr4 always
267 * exists, so it will never fail. */
268#ifdef CONFIG_X86_32
269 asm volatile("1: mov %%cr4, %0\n"
270 "2:\n"
271 _ASM_EXTABLE(1b, 2b)
272 : "=r" (val), "=m" (__force_order) : "0" (0));
273#else
274 val = native_read_cr4();
275#endif
276 return val;
277}
278
279static inline void native_write_cr4(unsigned long val)
280{
281 asm volatile("mov %0,%%cr4": : "r" (val), "m" (__force_order));
282}
283
284#ifdef CONFIG_X86_64
285static inline unsigned long native_read_cr8(void)
286{
287 unsigned long cr8;
288 asm volatile("movq %%cr8,%0" : "=r" (cr8));
289 return cr8;
290}
291
292static inline void native_write_cr8(unsigned long val)
293{
294 asm volatile("movq %0,%%cr8" :: "r" (val) : "memory");
295}
296#endif
297
298static inline void native_wbinvd(void)
299{
300 asm volatile("wbinvd": : :"memory");
301}
302
303#ifdef CONFIG_PARAVIRT
304#include <asm/paravirt.h>
305#else
306
307static inline unsigned long read_cr0(void)
308{
309 return native_read_cr0();
310}
311
312static inline void write_cr0(unsigned long x)
313{
314 native_write_cr0(x);
315}
316
317static inline unsigned long read_cr2(void)
318{
319 return native_read_cr2();
320}
321
322static inline void write_cr2(unsigned long x)
323{
324 native_write_cr2(x);
325}
326
327static inline unsigned long read_cr3(void)
328{
329 return native_read_cr3();
330}
331
332static inline void write_cr3(unsigned long x)
333{
334 native_write_cr3(x);
335}
336
337static inline unsigned long read_cr4(void)
338{
339 return native_read_cr4();
340}
341
342static inline unsigned long read_cr4_safe(void)
343{
344 return native_read_cr4_safe();
345}
346
347static inline void write_cr4(unsigned long x)
348{
349 native_write_cr4(x);
350}
351
352static inline void wbinvd(void)
353{
354 native_wbinvd();
355}
356
357#ifdef CONFIG_X86_64
358
359static inline unsigned long read_cr8(void)
360{
361 return native_read_cr8();
362}
363
364static inline void write_cr8(unsigned long x)
365{
366 native_write_cr8(x);
367}
368
369static inline void load_gs_index(unsigned selector)
370{
371 native_load_gs_index(selector);
372}
373
374#endif
375
376/* Clear the 'TS' bit */
377static inline void clts(void)
378{
379 native_clts();
380}
381
382#endif/* CONFIG_PARAVIRT */
383
384#define stts() write_cr0(read_cr0() | X86_CR0_TS)
385
386#endif /* __KERNEL__ */
387
388static inline void clflush(volatile void *__p)
389{
390 asm volatile("clflush %0" : "+m" (*(volatile char __force *)__p));
391}
392
393#define nop() asm volatile ("nop")
394
395void disable_hlt(void);
396void enable_hlt(void);
397
398void cpu_idle_wait(void);
399
400extern unsigned long arch_align_stack(unsigned long sp);
401extern void free_init_pages(char *what, unsigned long begin, unsigned long end);
402
403void default_idle(void);
404bool set_pm_idle_to_default(void);
405
406void stop_this_cpu(void *dummy);
407
408/*
409 * Force strict CPU ordering.
410 * And yes, this is required on UP too when we're talking
411 * to devices.
412 */
413#ifdef CONFIG_X86_32
414/*
415 * Some non-Intel clones support out of order store. wmb() ceases to be a
416 * nop for these.
417 */
418#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)
419#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)
420#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
421#else
422#define mb() asm volatile("mfence":::"memory")
423#define rmb() asm volatile("lfence":::"memory")
424#define wmb() asm volatile("sfence" ::: "memory")
425#endif
426
427/**
428 * read_barrier_depends - Flush all pending reads that subsequents reads
429 * depend on.
430 *
431 * No data-dependent reads from memory-like regions are ever reordered
432 * over this barrier. All reads preceding this primitive are guaranteed
433 * to access memory (but not necessarily other CPUs' caches) before any
434 * reads following this primitive that depend on the data return by
435 * any of the preceding reads. This primitive is much lighter weight than
436 * rmb() on most CPUs, and is never heavier weight than is
437 * rmb().
438 *
439 * These ordering constraints are respected by both the local CPU
440 * and the compiler.
441 *
442 * Ordering is not guaranteed by anything other than these primitives,
443 * not even by data dependencies. See the documentation for
444 * memory_barrier() for examples and URLs to more information.
445 *
446 * For example, the following code would force ordering (the initial
447 * value of "a" is zero, "b" is one, and "p" is "&a"):
448 *
449 * <programlisting>
450 * CPU 0 CPU 1
451 *
452 * b = 2;
453 * memory_barrier();
454 * p = &b; q = p;
455 * read_barrier_depends();
456 * d = *q;
457 * </programlisting>
458 *
459 * because the read of "*q" depends on the read of "p" and these
460 * two reads are separated by a read_barrier_depends(). However,
461 * the following code, with the same initial values for "a" and "b":
462 *
463 * <programlisting>
464 * CPU 0 CPU 1
465 *
466 * a = 2;
467 * memory_barrier();
468 * b = 3; y = b;
469 * read_barrier_depends();
470 * x = a;
471 * </programlisting>
472 *
473 * does not enforce ordering, since there is no data dependency between
474 * the read of "a" and the read of "b". Therefore, on some CPUs, such
475 * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb()
476 * in cases like this where there are no data dependencies.
477 **/
478
479#define read_barrier_depends() do { } while (0)
480
481#ifdef CONFIG_SMP
482#define smp_mb() mb()
483#ifdef CONFIG_X86_PPRO_FENCE
484# define smp_rmb() rmb()
485#else
486# define smp_rmb() barrier()
487#endif
488#ifdef CONFIG_X86_OOSTORE
489# define smp_wmb() wmb()
490#else
491# define smp_wmb() barrier()
492#endif
493#define smp_read_barrier_depends() read_barrier_depends()
494#define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
495#else
496#define smp_mb() barrier()
497#define smp_rmb() barrier()
498#define smp_wmb() barrier()
499#define smp_read_barrier_depends() do { } while (0)
500#define set_mb(var, value) do { var = value; barrier(); } while (0)
501#endif
502
503/*
504 * Stop RDTSC speculation. This is needed when you need to use RDTSC
505 * (or get_cycles or vread that possibly accesses the TSC) in a defined
506 * code region.
507 *
508 * (Could use an alternative three way for this if there was one.)
509 */
510static __always_inline void rdtsc_barrier(void)
511{
512 alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC);
513 alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);
514}
515
516/*
517 * We handle most unaligned accesses in hardware. On the other hand
518 * unaligned DMA can be quite expensive on some Nehalem processors.
519 *
520 * Based on this we disable the IP header alignment in network drivers.
521 */
522#define NET_IP_ALIGN 0
523#endif /* _ASM_X86_SYSTEM_H */
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
index 169be8938b9..c0e108e0807 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -5,7 +5,7 @@
5#include <linux/sched.h> 5#include <linux/sched.h>
6 6
7#include <asm/processor.h> 7#include <asm/processor.h>
8#include <asm/system.h> 8#include <asm/special_insns.h>
9 9
10#ifdef CONFIG_PARAVIRT 10#ifdef CONFIG_PARAVIRT
11#include <asm/paravirt.h> 11#include <asm/paravirt.h>
diff --git a/arch/x86/include/asm/virtext.h b/arch/x86/include/asm/virtext.h
index e0f9aa16358..5da71c27cc5 100644
--- a/arch/x86/include/asm/virtext.h
+++ b/arch/x86/include/asm/virtext.h
@@ -16,7 +16,6 @@
16#define _ASM_X86_VIRTEX_H 16#define _ASM_X86_VIRTEX_H
17 17
18#include <asm/processor.h> 18#include <asm/processor.h>
19#include <asm/system.h>
20 19
21#include <asm/vmx.h> 20#include <asm/vmx.h>
22#include <asm/svm.h> 21#include <asm/svm.h>
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index f50e7fb2a20..d2b7f27781b 100644
--- a/arch/x86/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
@@ -14,6 +14,7 @@
14#include <acpi/processor.h> 14#include <acpi/processor.h>
15#include <asm/acpi.h> 15#include <asm/acpi.h>
16#include <asm/mwait.h> 16#include <asm/mwait.h>
17#include <asm/special_insns.h>
17 18
18/* 19/*
19 * Initialize bm_flags based on the CPU cache properties 20 * Initialize bm_flags based on the CPU cache properties
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 5d56931a15b..459e78cbf61 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -231,7 +231,6 @@
231#include <linux/syscore_ops.h> 231#include <linux/syscore_ops.h>
232#include <linux/i8253.h> 232#include <linux/i8253.h>
233 233
234#include <asm/system.h>
235#include <asm/uaccess.h> 234#include <asm/uaccess.h>
236#include <asm/desc.h> 235#include <asm/desc.h>
237#include <asm/olpc.h> 236#include <asm/olpc.h>
diff --git a/arch/x86/kernel/cpu/mcheck/p5.c b/arch/x86/kernel/cpu/mcheck/p5.c
index 5c0e6533d9b..2d5454cd2c4 100644
--- a/arch/x86/kernel/cpu/mcheck/p5.c
+++ b/arch/x86/kernel/cpu/mcheck/p5.c
@@ -9,7 +9,6 @@
9#include <linux/smp.h> 9#include <linux/smp.h>
10 10
11#include <asm/processor.h> 11#include <asm/processor.h>
12#include <asm/system.h>
13#include <asm/mce.h> 12#include <asm/mce.h>
14#include <asm/msr.h> 13#include <asm/msr.h>
15 14
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 67bb17a37a0..47a1870279a 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -25,7 +25,6 @@
25#include <linux/cpu.h> 25#include <linux/cpu.h>
26 26
27#include <asm/processor.h> 27#include <asm/processor.h>
28#include <asm/system.h>
29#include <asm/apic.h> 28#include <asm/apic.h>
30#include <asm/idle.h> 29#include <asm/idle.h>
31#include <asm/mce.h> 30#include <asm/mce.h>
diff --git a/arch/x86/kernel/cpu/mcheck/winchip.c b/arch/x86/kernel/cpu/mcheck/winchip.c
index 54060f56597..2d7998fb628 100644
--- a/arch/x86/kernel/cpu/mcheck/winchip.c
+++ b/arch/x86/kernel/cpu/mcheck/winchip.c
@@ -8,7 +8,6 @@
8#include <linux/init.h> 8#include <linux/init.h>
9 9
10#include <asm/processor.h> 10#include <asm/processor.h>
11#include <asm/system.h>
12#include <asm/mce.h> 11#include <asm/mce.h>
13#include <asm/msr.h> 12#include <asm/msr.h>
14 13
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 97b26356e9e..75772ae6c65 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -12,7 +12,6 @@
12#include <asm/processor-flags.h> 12#include <asm/processor-flags.h>
13#include <asm/cpufeature.h> 13#include <asm/cpufeature.h>
14#include <asm/tlbflush.h> 14#include <asm/tlbflush.h>
15#include <asm/system.h>
16#include <asm/mtrr.h> 15#include <asm/mtrr.h>
17#include <asm/msr.h> 16#include <asm/msr.h>
18#include <asm/pat.h> 17#include <asm/pat.h>
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index a524353d93f..39472dd2323 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -43,7 +43,6 @@
43 43
44#include <asm/processor.h> 44#include <asm/processor.h>
45#include <asm/msr.h> 45#include <asm/msr.h>
46#include <asm/system.h>
47 46
48static struct class *cpuid_class; 47static struct class *cpuid_class;
49 48
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
index 610485223bd..36d1853e91a 100644
--- a/arch/x86/kernel/i8259.c
+++ b/arch/x86/kernel/i8259.c
@@ -15,7 +15,6 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16 16
17#include <linux/atomic.h> 17#include <linux/atomic.h>
18#include <asm/system.h>
19#include <asm/timer.h> 18#include <asm/timer.h>
20#include <asm/hw_irq.h> 19#include <asm/hw_irq.h>
21#include <asm/pgtable.h> 20#include <asm/pgtable.h>
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index 43e2b1cff0a..6d5fc8cfd5d 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -16,7 +16,6 @@
16#include <linux/delay.h> 16#include <linux/delay.h>
17 17
18#include <linux/atomic.h> 18#include <linux/atomic.h>
19#include <asm/system.h>
20#include <asm/timer.h> 19#include <asm/timer.h>
21#include <asm/hw_irq.h> 20#include <asm/hw_irq.h>
22#include <asm/pgtable.h> 21#include <asm/pgtable.h>
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index fdc37b3d0ce..db6720edfdd 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -46,7 +46,6 @@
46 46
47#include <asm/debugreg.h> 47#include <asm/debugreg.h>
48#include <asm/apicdef.h> 48#include <asm/apicdef.h>
49#include <asm/system.h>
50#include <asm/apic.h> 49#include <asm/apic.h>
51#include <asm/nmi.h> 50#include <asm/nmi.h>
52 51
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c
index ea697263b37..ebc98739892 100644
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
@@ -15,7 +15,6 @@
15#include <linux/vmalloc.h> 15#include <linux/vmalloc.h>
16#include <linux/uaccess.h> 16#include <linux/uaccess.h>
17 17
18#include <asm/system.h>
19#include <asm/ldt.h> 18#include <asm/ldt.h>
20#include <asm/desc.h> 19#include <asm/desc.h>
21#include <asm/mmu_context.h> 20#include <asm/mmu_context.h>
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c
index a3fa43ba5d3..5b19e4d78b0 100644
--- a/arch/x86/kernel/machine_kexec_32.c
+++ b/arch/x86/kernel/machine_kexec_32.c
@@ -23,7 +23,6 @@
23#include <asm/apic.h> 23#include <asm/apic.h>
24#include <asm/cpufeature.h> 24#include <asm/cpufeature.h>
25#include <asm/desc.h> 25#include <asm/desc.h>
26#include <asm/system.h>
27#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
28#include <asm/debugreg.h> 27#include <asm/debugreg.h>
29 28
diff --git a/arch/x86/kernel/mca_32.c b/arch/x86/kernel/mca_32.c
index 177183cbb6a..7eb1e2b9782 100644
--- a/arch/x86/kernel/mca_32.c
+++ b/arch/x86/kernel/mca_32.c
@@ -43,7 +43,6 @@
43#include <linux/mca.h> 43#include <linux/mca.h>
44#include <linux/kprobes.h> 44#include <linux/kprobes.h>
45#include <linux/slab.h> 45#include <linux/slab.h>
46#include <asm/system.h>
47#include <asm/io.h> 46#include <asm/io.h>
48#include <linux/proc_fs.h> 47#include <linux/proc_fs.h>
49#include <linux/mman.h> 48#include <linux/mman.h>
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
index 925179f871d..f21fd94ac89 100644
--- a/arch/x86/kernel/module.c
+++ b/arch/x86/kernel/module.c
@@ -26,7 +26,6 @@
26#include <linux/gfp.h> 26#include <linux/gfp.h>
27#include <linux/jump_label.h> 27#include <linux/jump_label.h>
28 28
29#include <asm/system.h>
30#include <asm/page.h> 29#include <asm/page.h>
31#include <asm/pgtable.h> 30#include <asm/pgtable.h>
32 31
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 96356762a51..eb113693f04 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -40,7 +40,6 @@
40 40
41#include <asm/processor.h> 41#include <asm/processor.h>
42#include <asm/msr.h> 42#include <asm/msr.h>
43#include <asm/system.h>
44 43
45static struct class *msr_class; 44static struct class *msr_class;
46 45
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 9c57c02e54f..ab137605e69 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -38,6 +38,7 @@
38#include <asm/apic.h> 38#include <asm/apic.h>
39#include <asm/tlbflush.h> 39#include <asm/tlbflush.h>
40#include <asm/timer.h> 40#include <asm/timer.h>
41#include <asm/special_insns.h>
41 42
42/* nop stub */ 43/* nop stub */
43void _paravirt_nop(void) 44void _paravirt_nop(void)
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 726494b5834..6ac5782f4d6 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -42,7 +42,6 @@
42#include <asm/calgary.h> 42#include <asm/calgary.h>
43#include <asm/tce.h> 43#include <asm/tce.h>
44#include <asm/pci-direct.h> 44#include <asm/pci-direct.h>
45#include <asm/system.h>
46#include <asm/dma.h> 45#include <asm/dma.h>
47#include <asm/rio.h> 46#include <asm/rio.h>
48#include <asm/bios_ebda.h> 47#include <asm/bios_ebda.h>
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 14baf78d5a1..9b24f36eb55 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -15,7 +15,6 @@
15#include <trace/events/power.h> 15#include <trace/events/power.h>
16#include <linux/hw_breakpoint.h> 16#include <linux/hw_breakpoint.h>
17#include <asm/cpu.h> 17#include <asm/cpu.h>
18#include <asm/system.h>
19#include <asm/apic.h> 18#include <asm/apic.h>
20#include <asm/syscalls.h> 19#include <asm/syscalls.h>
21#include <asm/idle.h> 20#include <asm/idle.h>
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 9d7d4842bfa..aae4f4bbbe8 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -41,7 +41,6 @@
41#include <linux/cpuidle.h> 41#include <linux/cpuidle.h>
42 42
43#include <asm/pgtable.h> 43#include <asm/pgtable.h>
44#include <asm/system.h>
45#include <asm/ldt.h> 44#include <asm/ldt.h>
46#include <asm/processor.h> 45#include <asm/processor.h>
47#include <asm/i387.h> 46#include <asm/i387.h>
@@ -59,6 +58,7 @@
59#include <asm/syscalls.h> 58#include <asm/syscalls.h>
60#include <asm/debugreg.h> 59#include <asm/debugreg.h>
61#include <asm/nmi.h> 60#include <asm/nmi.h>
61#include <asm/switch_to.h>
62 62
63asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); 63asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
64 64
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 292da13fc5a..61270e8d428 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -40,7 +40,6 @@
40#include <linux/cpuidle.h> 40#include <linux/cpuidle.h>
41 41
42#include <asm/pgtable.h> 42#include <asm/pgtable.h>
43#include <asm/system.h>
44#include <asm/processor.h> 43#include <asm/processor.h>
45#include <asm/i387.h> 44#include <asm/i387.h>
46#include <asm/fpu-internal.h> 45#include <asm/fpu-internal.h>
@@ -53,6 +52,7 @@
53#include <asm/syscalls.h> 52#include <asm/syscalls.h>
54#include <asm/debugreg.h> 53#include <asm/debugreg.h>
55#include <asm/nmi.h> 54#include <asm/nmi.h>
55#include <asm/switch_to.h>
56 56
57asmlinkage extern void ret_from_fork(void); 57asmlinkage extern void ret_from_fork(void);
58 58
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 78f05e438be..8a634c88765 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -24,7 +24,6 @@
24 24
25#include <asm/uaccess.h> 25#include <asm/uaccess.h>
26#include <asm/pgtable.h> 26#include <asm/pgtable.h>
27#include <asm/system.h>
28#include <asm/processor.h> 27#include <asm/processor.h>
29#include <asm/i387.h> 28#include <asm/i387.h>
30#include <asm/fpu-internal.h> 29#include <asm/fpu-internal.h>
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 88638883176..8cbeb7209c3 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -90,7 +90,6 @@
90#include <asm/processor.h> 90#include <asm/processor.h>
91#include <asm/bugs.h> 91#include <asm/bugs.h>
92 92
93#include <asm/system.h>
94#include <asm/vsyscall.h> 93#include <asm/vsyscall.h>
95#include <asm/cpu.h> 94#include <asm/cpu.h>
96#include <asm/desc.h> 95#include <asm/desc.h>
diff --git a/arch/x86/kernel/tce_64.c b/arch/x86/kernel/tce_64.c
index 9e540fee700..ab40954e113 100644
--- a/arch/x86/kernel/tce_64.c
+++ b/arch/x86/kernel/tce_64.c
@@ -34,6 +34,7 @@
34#include <asm/tce.h> 34#include <asm/tce.h>
35#include <asm/calgary.h> 35#include <asm/calgary.h>
36#include <asm/proto.h> 36#include <asm/proto.h>
37#include <asm/cacheflush.h>
37 38
38/* flush a tce at 'tceaddr' to main memory */ 39/* flush a tce at 'tceaddr' to main memory */
39static inline void flush_tce(void* tceaddr) 40static inline void flush_tce(void* tceaddr)
diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c
index 6bb7b8579e7..73920e4c6dc 100644
--- a/arch/x86/kernel/tls.c
+++ b/arch/x86/kernel/tls.c
@@ -6,7 +6,6 @@
6 6
7#include <asm/uaccess.h> 7#include <asm/uaccess.h>
8#include <asm/desc.h> 8#include <asm/desc.h>
9#include <asm/system.h>
10#include <asm/ldt.h> 9#include <asm/ldt.h>
11#include <asm/processor.h> 10#include <asm/processor.h>
12#include <asm/proto.h> 11#include <asm/proto.h>
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index ec61d4c1b93..860f126ca23 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -50,7 +50,6 @@
50#include <asm/processor.h> 50#include <asm/processor.h>
51#include <asm/debugreg.h> 51#include <asm/debugreg.h>
52#include <linux/atomic.h> 52#include <linux/atomic.h>
53#include <asm/system.h>
54#include <asm/traps.h> 53#include <asm/traps.h>
55#include <asm/desc.h> 54#include <asm/desc.h>
56#include <asm/i387.h> 55#include <asm/i387.h>
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 6cabf6570d6..4f0cec7e4ff 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -12,7 +12,6 @@
12#include <asm/page_types.h> 12#include <asm/page_types.h>
13#include <asm/sections.h> 13#include <asm/sections.h>
14#include <asm/setup.h> 14#include <asm/setup.h>
15#include <asm/system.h>
16#include <asm/tlbflush.h> 15#include <asm/tlbflush.h>
17#include <asm/tlb.h> 16#include <asm/tlb.h>
18#include <asm/proto.h> 17#include <asm/proto.h>
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 8663f6c47cc..575d86f85ce 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -35,7 +35,6 @@
35#include <asm/asm.h> 35#include <asm/asm.h>
36#include <asm/bios_ebda.h> 36#include <asm/bios_ebda.h>
37#include <asm/processor.h> 37#include <asm/processor.h>
38#include <asm/system.h>
39#include <asm/uaccess.h> 38#include <asm/uaccess.h>
40#include <asm/pgtable.h> 39#include <asm/pgtable.h>
41#include <asm/dma.h> 40#include <asm/dma.h>
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 436a0309db3..fc18be0f6f2 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -35,7 +35,6 @@
35 35
36#include <asm/processor.h> 36#include <asm/processor.h>
37#include <asm/bios_ebda.h> 37#include <asm/bios_ebda.h>
38#include <asm/system.h>
39#include <asm/uaccess.h> 38#include <asm/uaccess.h>
40#include <asm/pgtable.h> 39#include <asm/pgtable.h>
41#include <asm/pgalloc.h> 40#include <asm/pgalloc.h>
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c
index cac71849925..a69bcb8c762 100644
--- a/arch/x86/mm/pgtable_32.c
+++ b/arch/x86/mm/pgtable_32.c
@@ -10,7 +10,6 @@
10#include <linux/spinlock.h> 10#include <linux/spinlock.h>
11#include <linux/module.h> 11#include <linux/module.h>
12 12
13#include <asm/system.h>
14#include <asm/pgtable.h> 13#include <asm/pgtable.h>
15#include <asm/pgalloc.h> 14#include <asm/pgalloc.h>
16#include <asm/fixmap.h> 15#include <asm/fixmap.h>
diff --git a/arch/x86/power/hibernate_32.c b/arch/x86/power/hibernate_32.c
index 3769079874d..74202c1910c 100644
--- a/arch/x86/power/hibernate_32.c
+++ b/arch/x86/power/hibernate_32.c
@@ -10,7 +10,6 @@
10#include <linux/suspend.h> 10#include <linux/suspend.h>
11#include <linux/bootmem.h> 11#include <linux/bootmem.h>
12 12
13#include <asm/system.h>
14#include <asm/page.h> 13#include <asm/page.h>
15#include <asm/pgtable.h> 14#include <asm/pgtable.h>
16#include <asm/mmzone.h> 15#include <asm/mmzone.h>
diff --git a/arch/xtensa/include/asm/atomic.h b/arch/xtensa/include/asm/atomic.h
index 23592eff67a..b4098930877 100644
--- a/arch/xtensa/include/asm/atomic.h
+++ b/arch/xtensa/include/asm/atomic.h
@@ -18,7 +18,7 @@
18 18
19#ifdef __KERNEL__ 19#ifdef __KERNEL__
20#include <asm/processor.h> 20#include <asm/processor.h>
21#include <asm/system.h> 21#include <asm/cmpxchg.h>
22 22
23#define ATOMIC_INIT(i) { (i) } 23#define ATOMIC_INIT(i) { (i) }
24 24
diff --git a/arch/xtensa/include/asm/barrier.h b/arch/xtensa/include/asm/barrier.h
new file mode 100644
index 00000000000..55707a8009d
--- /dev/null
+++ b/arch/xtensa/include/asm/barrier.h
@@ -0,0 +1,29 @@
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) 2001 - 2005 Tensilica Inc.
7 */
8
9#ifndef _XTENSA_SYSTEM_H
10#define _XTENSA_SYSTEM_H
11
12#define smp_read_barrier_depends() do { } while(0)
13#define read_barrier_depends() do { } while(0)
14
15#define mb() barrier()
16#define rmb() mb()
17#define wmb() mb()
18
19#ifdef CONFIG_SMP
20#error smp_* not defined
21#else
22#define smp_mb() barrier()
23#define smp_rmb() barrier()
24#define smp_wmb() barrier()
25#endif
26
27#define set_mb(var, value) do { var = value; mb(); } while (0)
28
29#endif /* _XTENSA_SYSTEM_H */
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
index 40aa7fe77f6..5270197ddd3 100644
--- a/arch/xtensa/include/asm/bitops.h
+++ b/arch/xtensa/include/asm/bitops.h
@@ -21,7 +21,6 @@
21 21
22#include <asm/processor.h> 22#include <asm/processor.h>
23#include <asm/byteorder.h> 23#include <asm/byteorder.h>
24#include <asm/system.h>
25 24
26#ifdef CONFIG_SMP 25#ifdef CONFIG_SMP
27# error SMP not supported on this architecture 26# error SMP not supported on this architecture
diff --git a/arch/xtensa/include/asm/system.h b/arch/xtensa/include/asm/cmpxchg.h
index 1e7e09ab6cd..e32149063d8 100644
--- a/arch/xtensa/include/asm/system.h
+++ b/arch/xtensa/include/asm/cmpxchg.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-xtensa/system.h 2 * Atomic xchg and cmpxchg operations.
3 * 3 *
4 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive 5 * License. See the file "COPYING" in the main directory of this archive
@@ -8,44 +8,12 @@
8 * Copyright (C) 2001 - 2005 Tensilica Inc. 8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */ 9 */
10 10
11#ifndef _XTENSA_SYSTEM_H 11#ifndef _XTENSA_CMPXCHG_H
12#define _XTENSA_SYSTEM_H 12#define _XTENSA_CMPXCHG_H
13 13
14#include <linux/stringify.h> 14#ifndef __ASSEMBLY__
15#include <linux/irqflags.h>
16
17#include <asm/processor.h>
18
19#define smp_read_barrier_depends() do { } while(0)
20#define read_barrier_depends() do { } while(0)
21
22#define mb() barrier()
23#define rmb() mb()
24#define wmb() mb()
25 15
26#ifdef CONFIG_SMP 16#include <linux/stringify.h>
27#error smp_* not defined
28#else
29#define smp_mb() barrier()
30#define smp_rmb() barrier()
31#define smp_wmb() barrier()
32#endif
33
34#define set_mb(var, value) do { var = value; mb(); } while (0)
35
36#if !defined (__ASSEMBLY__)
37
38/* * switch_to(n) should switch tasks to task nr n, first
39 * checking that n isn't the current task, in which case it does nothing.
40 */
41extern void *_switch_to(void *last, void *next);
42
43#endif /* __ASSEMBLY__ */
44
45#define switch_to(prev,next,last) \
46do { \
47 (last) = _switch_to(prev, next); \
48} while(0)
49 17
50/* 18/*
51 * cmpxchg 19 * cmpxchg
@@ -158,27 +126,6 @@ __xchg(unsigned long x, volatile void * ptr, int size)
158 return x; 126 return x;
159} 127}
160 128
161extern void set_except_vector(int n, void *addr); 129#endif /* __ASSEMBLY__ */
162
163static inline void spill_registers(void)
164{
165 unsigned int a0, ps;
166
167 __asm__ __volatile__ (
168 "movi a14," __stringify (PS_EXCM_BIT) " | 1\n\t"
169 "mov a12, a0\n\t"
170 "rsr a13," __stringify(SAR) "\n\t"
171 "xsr a14," __stringify(PS) "\n\t"
172 "movi a0, _spill_registers\n\t"
173 "rsync\n\t"
174 "callx0 a0\n\t"
175 "mov a0, a12\n\t"
176 "wsr a13," __stringify(SAR) "\n\t"
177 "wsr a14," __stringify(PS) "\n\t"
178 :: "a" (&a0), "a" (&ps)
179 : "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", "memory");
180}
181
182#define arch_align_stack(x) (x)
183 130
184#endif /* _XTENSA_SYSTEM_H */ 131#endif /* _XTENSA_CMPXCHG_H */
diff --git a/arch/xtensa/include/asm/exec.h b/arch/xtensa/include/asm/exec.h
new file mode 100644
index 00000000000..af949e28cb3
--- /dev/null
+++ b/arch/xtensa/include/asm/exec.h
@@ -0,0 +1,14 @@
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) 2001 - 2005 Tensilica Inc.
7 */
8
9#ifndef _XTENSA_EXEC_H
10#define _XTENSA_EXEC_H
11
12#define arch_align_stack(x) (x)
13
14#endif /* _XTENSA_EXEC_H */
diff --git a/arch/xtensa/include/asm/setup.h b/arch/xtensa/include/asm/setup.h
index e3636520d8c..9fa8ad97936 100644
--- a/arch/xtensa/include/asm/setup.h
+++ b/arch/xtensa/include/asm/setup.h
@@ -13,4 +13,6 @@
13 13
14#define COMMAND_LINE_SIZE 256 14#define COMMAND_LINE_SIZE 256
15 15
16extern void set_except_vector(int n, void *addr);
17
16#endif 18#endif
diff --git a/arch/xtensa/include/asm/switch_to.h b/arch/xtensa/include/asm/switch_to.h
new file mode 100644
index 00000000000..6b73bf0eb1f
--- /dev/null
+++ b/arch/xtensa/include/asm/switch_to.h
@@ -0,0 +1,22 @@
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) 2001 - 2005 Tensilica Inc.
7 */
8
9#ifndef _XTENSA_SWITCH_TO_H
10#define _XTENSA_SWITCH_TO_H
11
12/* * switch_to(n) should switch tasks to task nr n, first
13 * checking that n isn't the current task, in which case it does nothing.
14 */
15extern void *_switch_to(void *last, void *next);
16
17#define switch_to(prev,next,last) \
18do { \
19 (last) = _switch_to(prev, next); \
20} while(0)
21
22#endif /* _XTENSA_SWITCH_TO_H */
diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h
index 3fa526fd3c9..6e4bb3b791a 100644
--- a/arch/xtensa/include/asm/uaccess.h
+++ b/arch/xtensa/include/asm/uaccess.h
@@ -17,7 +17,9 @@
17#define _XTENSA_UACCESS_H 17#define _XTENSA_UACCESS_H
18 18
19#include <linux/errno.h> 19#include <linux/errno.h>
20#ifndef __ASSEMBLY__
20#include <linux/prefetch.h> 21#include <linux/prefetch.h>
22#endif
21#include <asm/types.h> 23#include <asm/types.h>
22 24
23#define VERIFY_READ 0 25#define VERIFY_READ 0
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c
index 2c9004770c4..6a2d6edf8f7 100644
--- a/arch/xtensa/kernel/process.c
+++ b/arch/xtensa/kernel/process.c
@@ -34,7 +34,6 @@
34 34
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37#include <asm/system.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/processor.h> 38#include <asm/processor.h>
40#include <asm/platform.h> 39#include <asm/platform.h>
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c
index 2dff698ab02..33eea4c16f1 100644
--- a/arch/xtensa/kernel/ptrace.c
+++ b/arch/xtensa/kernel/ptrace.c
@@ -24,7 +24,6 @@
24 24
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/page.h> 26#include <asm/page.h>
27#include <asm/system.h>
28#include <asm/uaccess.h> 27#include <asm/uaccess.h>
29#include <asm/ptrace.h> 28#include <asm/ptrace.h>
30#include <asm/elf.h> 29#include <asm/elf.h>
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index 1e5a034fe01..17e746f7be6 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -34,7 +34,6 @@
34# include <linux/seq_file.h> 34# include <linux/seq_file.h>
35#endif 35#endif
36 36
37#include <asm/system.h>
38#include <asm/bootparam.h> 37#include <asm/bootparam.h>
39#include <asm/pgtable.h> 38#include <asm/pgtable.h>
40#include <asm/processor.h> 39#include <asm/processor.h>
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index e64efac3b9d..bc1e14cf936 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -381,6 +381,25 @@ static __always_inline unsigned long *stack_pointer(struct task_struct *task)
381 return sp; 381 return sp;
382} 382}
383 383
384static inline void spill_registers(void)
385{
386 unsigned int a0, ps;
387
388 __asm__ __volatile__ (
389 "movi a14," __stringify (PS_EXCM_BIT) " | 1\n\t"
390 "mov a12, a0\n\t"
391 "rsr a13," __stringify(SAR) "\n\t"
392 "xsr a14," __stringify(PS) "\n\t"
393 "movi a0, _spill_registers\n\t"
394 "rsync\n\t"
395 "callx0 a0\n\t"
396 "mov a0, a12\n\t"
397 "wsr a13," __stringify(SAR) "\n\t"
398 "wsr a14," __stringify(PS) "\n\t"
399 :: "a" (&a0), "a" (&ps)
400 : "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", "memory");
401}
402
384void show_trace(struct task_struct *task, unsigned long *sp) 403void show_trace(struct task_struct *task, unsigned long *sp)
385{ 404{
386 unsigned long a0, a1, pc; 405 unsigned long a0, a1, pc;
diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c
index e367e302643..b17885a0b50 100644
--- a/arch/xtensa/mm/fault.c
+++ b/arch/xtensa/mm/fault.c
@@ -19,7 +19,6 @@
19#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
20#include <asm/hardirq.h> 20#include <asm/hardirq.h>
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/system.h>
23#include <asm/pgalloc.h> 22#include <asm/pgalloc.h>
24 23
25unsigned long asid_cache = ASID_USER_FIRST; 24unsigned long asid_cache = ASID_USER_FIRST;
diff --git a/arch/xtensa/mm/tlb.c b/arch/xtensa/mm/tlb.c
index 239461d8ea8..e2700b21395 100644
--- a/arch/xtensa/mm/tlb.c
+++ b/arch/xtensa/mm/tlb.c
@@ -18,7 +18,6 @@
18#include <asm/processor.h> 18#include <asm/processor.h>
19#include <asm/mmu_context.h> 19#include <asm/mmu_context.h>
20#include <asm/tlbflush.h> 20#include <asm/tlbflush.h>
21#include <asm/system.h>
22#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
23 22
24 23
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 2801b418d7b..d4d9cb7e016 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -46,7 +46,6 @@
46#include <linux/slab.h> 46#include <linux/slab.h>
47 47
48#include <asm/io.h> 48#include <asm/io.h>
49#include <asm/system.h>
50#include <asm/cpu.h> 49#include <asm/cpu.h>
51#include <asm/delay.h> 50#include <asm/delay.h>
52#include <asm/uaccess.h> 51#include <asm/uaccess.h>
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index 6ff612d099c..2059ee460b0 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -19,7 +19,6 @@
19#include <linux/atm_eni.h> 19#include <linux/atm_eni.h>
20#include <linux/bitops.h> 20#include <linux/bitops.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <asm/system.h>
23#include <asm/io.h> 22#include <asm/io.h>
24#include <linux/atomic.h> 23#include <linux/atomic.h>
25#include <asm/uaccess.h> 24#include <asm/uaccess.h>
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 5072f8ac16f..86fed1b9169 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -49,7 +49,6 @@
49#include <linux/bitops.h> 49#include <linux/bitops.h>
50#include <linux/slab.h> 50#include <linux/slab.h>
51#include <asm/byteorder.h> 51#include <asm/byteorder.h>
52#include <asm/system.h>
53#include <asm/string.h> 52#include <asm/string.h>
54#include <asm/io.h> 53#include <asm/io.h>
55#include <linux/atomic.h> 54#include <linux/atomic.h>
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c
index b81210330ac..75fd691cd43 100644
--- a/drivers/atm/horizon.c
+++ b/drivers/atm/horizon.c
@@ -43,7 +43,6 @@
43#include <linux/wait.h> 43#include <linux/wait.h>
44#include <linux/slab.h> 44#include <linux/slab.h>
45 45
46#include <asm/system.h>
47#include <asm/io.h> 46#include <asm/io.h>
48#include <linux/atomic.h> 47#include <linux/atomic.h>
49#include <asm/uaccess.h> 48#include <asm/uaccess.h>
diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
index 487a5473985..45d506363ab 100644
--- a/drivers/atm/idt77105.c
+++ b/drivers/atm/idt77105.c
@@ -16,7 +16,6 @@
16#include <linux/atm_idt77105.h> 16#include <linux/atm_idt77105.h>
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <asm/system.h>
20#include <asm/param.h> 19#include <asm/param.h>
21#include <asm/uaccess.h> 20#include <asm/uaccess.h>
22 21
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 9e373ba2030..d4386019af5 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -56,7 +56,6 @@
56#include <linux/interrupt.h> 56#include <linux/interrupt.h>
57#include <linux/wait.h> 57#include <linux/wait.h>
58#include <linux/slab.h> 58#include <linux/slab.h>
59#include <asm/system.h>
60#include <asm/io.h> 59#include <asm/io.h>
61#include <linux/atomic.h> 60#include <linux/atomic.h>
62#include <asm/uaccess.h> 61#include <asm/uaccess.h>
diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c
index 90f1ccca9e5..02159345566 100644
--- a/drivers/atm/suni.c
+++ b/drivers/atm/suni.c
@@ -22,7 +22,6 @@
22#include <linux/capability.h> 22#include <linux/capability.h>
23#include <linux/atm_suni.h> 23#include <linux/atm_suni.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <asm/system.h>
26#include <asm/param.h> 25#include <asm/param.h>
27#include <asm/uaccess.h> 26#include <asm/uaccess.h>
28#include <linux/atomic.h> 27#include <linux/atomic.h>
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index d889f56e8d8..abe4e20b076 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -24,7 +24,6 @@
24#include <linux/wait.h> 24#include <linux/wait.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <asm/byteorder.h> 26#include <asm/byteorder.h>
27#include <asm/system.h>
28#include <asm/string.h> 27#include <asm/string.h>
29#include <asm/io.h> 28#include <asm/io.h>
30#include <linux/atomic.h> 29#include <linux/atomic.h>
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 744f078f4dd..76a08236430 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -202,7 +202,6 @@ static int slow_floppy;
202 202
203#include <asm/dma.h> 203#include <asm/dma.h>
204#include <asm/irq.h> 204#include <asm/irq.h>
205#include <asm/system.h>
206 205
207static int FLOPPY_IRQ = 6; 206static int FLOPPY_IRQ = 6;
208static int FLOPPY_DMA = 2; 207static int FLOPPY_DMA = 2;
diff --git a/drivers/block/hd.c b/drivers/block/hd.c
index b52c9ca146f..bf397bf108b 100644
--- a/drivers/block/hd.c
+++ b/drivers/block/hd.c
@@ -44,7 +44,6 @@
44#define HD_IRQ 14 44#define HD_IRQ 14
45 45
46#define REALLY_SLOW_IO 46#define REALLY_SLOW_IO
47#include <asm/system.h>
48#include <asm/io.h> 47#include <asm/io.h>
49#include <asm/uaccess.h> 48#include <asm/uaccess.h>
50 49
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index c3f0ee16594..c7ba11f9b20 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -34,7 +34,6 @@
34#include <linux/kthread.h> 34#include <linux/kthread.h>
35 35
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37#include <asm/system.h>
38#include <asm/types.h> 37#include <asm/types.h>
39 38
40#include <linux/nbd.h> 39#include <linux/nbd.h>
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index 51a972704db..ff540520bad 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -52,7 +52,6 @@
52#include <linux/io.h> 52#include <linux/io.h>
53#include <linux/gfp.h> 53#include <linux/gfp.h>
54 54
55#include <asm/system.h>
56#include <asm/uaccess.h> 55#include <asm/uaccess.h>
57#include <asm/dma.h> 56#include <asm/dma.h>
58 57
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 9c09d6f05dc..308c8599ab5 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -39,7 +39,6 @@
39#include <linux/serial.h> 39#include <linux/serial.h>
40#include <linux/serial_reg.h> 40#include <linux/serial_reg.h>
41#include <linux/bitops.h> 41#include <linux/bitops.h>
42#include <asm/system.h>
43#include <asm/io.h> 42#include <asm/io.h>
44 43
45#include <linux/device.h> 44#include <linux/device.h>
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 194224d07f7..c4fc2f3fc32 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -38,7 +38,6 @@
38#include <linux/serial.h> 38#include <linux/serial.h>
39#include <linux/serial_reg.h> 39#include <linux/serial_reg.h>
40#include <linux/bitops.h> 40#include <linux/bitops.h>
41#include <asm/system.h>
42#include <asm/io.h> 41#include <asm/io.h>
43 42
44#include <pcmcia/cistpl.h> 43#include <pcmcia/cistpl.h>
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 049c0594a76..6e8d9618968 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -38,7 +38,6 @@
38#include <linux/serial.h> 38#include <linux/serial.h>
39#include <linux/serial_reg.h> 39#include <linux/serial_reg.h>
40#include <linux/bitops.h> 40#include <linux/bitops.h>
41#include <asm/system.h>
42#include <asm/io.h> 41#include <asm/io.h>
43 42
44#include <pcmcia/cistpl.h> 43#include <pcmcia/cistpl.h>
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
index f4837a893df..57501ca9204 100644
--- a/drivers/char/apm-emulation.c
+++ b/drivers/char/apm-emulation.c
@@ -31,7 +31,6 @@
31#include <linux/kthread.h> 31#include <linux/kthread.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
33 33
34#include <asm/system.h>
35 34
36/* 35/*
37 * The apm_bios device is one of the misc char devices. 36 * The apm_bios device is one of the misc char devices.
diff --git a/drivers/char/ds1302.c b/drivers/char/ds1302.c
index ed8303f9890..7d34b203718 100644
--- a/drivers/char/ds1302.c
+++ b/drivers/char/ds1302.c
@@ -24,7 +24,6 @@
24#include <linux/uaccess.h> 24#include <linux/uaccess.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include <asm/system.h>
28#include <asm/rtc.h> 27#include <asm/rtc.h>
29#if defined(CONFIG_M32R) 28#if defined(CONFIG_M32R)
30#include <asm/m32r.h> 29#include <asm/m32r.h>
diff --git a/drivers/char/efirtc.c b/drivers/char/efirtc.c
index 53c524e7b82..a082d00b0f1 100644
--- a/drivers/char/efirtc.c
+++ b/drivers/char/efirtc.c
@@ -37,7 +37,6 @@
37#include <linux/efi.h> 37#include <linux/efi.h>
38#include <linux/uaccess.h> 38#include <linux/uaccess.h>
39 39
40#include <asm/system.h>
41 40
42#define EFI_RTC_VERSION "0.4" 41#define EFI_RTC_VERSION "0.4"
43 42
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c
index f773a9dd14f..21cb980f115 100644
--- a/drivers/char/genrtc.c
+++ b/drivers/char/genrtc.c
@@ -56,7 +56,6 @@
56#include <linux/workqueue.h> 56#include <linux/workqueue.h>
57 57
58#include <asm/uaccess.h> 58#include <asm/uaccess.h>
59#include <asm/system.h>
60#include <asm/rtc.h> 59#include <asm/rtc.h>
61 60
62/* 61/*
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 0833896cf6f..3845ab44c33 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -36,7 +36,6 @@
36#include <linux/io.h> 36#include <linux/io.h>
37 37
38#include <asm/current.h> 38#include <asm/current.h>
39#include <asm/system.h>
40#include <asm/irq.h> 39#include <asm/irq.h>
41#include <asm/div64.h> 40#include <asm/div64.h>
42 41
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index 2aa3977aae5..9eb360ff8ca 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -34,7 +34,6 @@
34#include <linux/module.h> 34#include <linux/module.h>
35#include <linux/moduleparam.h> 35#include <linux/moduleparam.h>
36#include <linux/errno.h> 36#include <linux/errno.h>
37#include <asm/system.h>
38#include <linux/poll.h> 37#include <linux/poll.h>
39#include <linux/sched.h> 38#include <linux/sched.h>
40#include <linux/spinlock.h> 39#include <linux/spinlock.h>
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 58c0e6387cf..c90e9390b78 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -33,7 +33,6 @@
33 33
34#include <linux/module.h> 34#include <linux/module.h>
35#include <linux/errno.h> 35#include <linux/errno.h>
36#include <asm/system.h>
37#include <linux/poll.h> 36#include <linux/poll.h>
38#include <linux/sched.h> 37#include <linux/sched.h>
39#include <linux/seq_file.h> 38#include <linux/seq_file.h>
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 50fcf9c0456..f9fdc114b31 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -41,7 +41,6 @@
41 41
42#include <linux/module.h> 42#include <linux/module.h>
43#include <linux/moduleparam.h> 43#include <linux/moduleparam.h>
44#include <asm/system.h>
45#include <linux/sched.h> 44#include <linux/sched.h>
46#include <linux/seq_file.h> 45#include <linux/seq_file.h>
47#include <linux/timer.h> 46#include <linux/timer.h>
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index f4348560706..0fbf1a776b5 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -135,7 +135,6 @@
135 135
136#include <asm/irq.h> 136#include <asm/irq.h>
137#include <asm/uaccess.h> 137#include <asm/uaccess.h>
138#include <asm/system.h>
139 138
140/* if you have more than 8 printers, remember to increase LP_NO */ 139/* if you have more than 8 printers, remember to increase LP_NO */
141#define LP_NO 8 140#define LP_NO 8
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c
index 1aeaaba680d..47ff7e470d8 100644
--- a/drivers/char/mbcs.c
+++ b/drivers/char/mbcs.c
@@ -28,7 +28,6 @@
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <asm/io.h> 29#include <asm/io.h>
30#include <asm/uaccess.h> 30#include <asm/uaccess.h>
31#include <asm/system.h>
32#include <asm/pgtable.h> 31#include <asm/pgtable.h>
33#include <asm/sn/addrs.h> 32#include <asm/sn/addrs.h>
34#include <asm/sn/intr.h> 33#include <asm/sn/intr.h>
diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c
index 5c0d96a820f..8b78750f1ef 100644
--- a/drivers/char/mspec.c
+++ b/drivers/char/mspec.c
@@ -44,7 +44,6 @@
44#include <linux/slab.h> 44#include <linux/slab.h>
45#include <linux/numa.h> 45#include <linux/numa.h>
46#include <asm/page.h> 46#include <asm/page.h>
47#include <asm/system.h>
48#include <asm/pgtable.h> 47#include <asm/pgtable.h>
49#include <linux/atomic.h> 48#include <linux/atomic.h>
50#include <asm/tlbflush.h> 49#include <asm/tlbflush.h>
diff --git a/drivers/char/mwave/3780i.c b/drivers/char/mwave/3780i.c
index 492dbfb2efd..881c9e59593 100644
--- a/drivers/char/mwave/3780i.c
+++ b/drivers/char/mwave/3780i.c
@@ -56,7 +56,6 @@
56 56
57#include <asm/io.h> 57#include <asm/io.h>
58#include <asm/uaccess.h> 58#include <asm/uaccess.h>
59#include <asm/system.h>
60#include <asm/irq.h> 59#include <asm/irq.h>
61#include "smapi.h" 60#include "smapi.h"
62#include "mwavedd.h" 61#include "mwavedd.h"
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index eaade8a1ecd..9df78e2cc45 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -111,7 +111,6 @@
111#include <linux/uaccess.h> 111#include <linux/uaccess.h>
112#include <linux/mutex.h> 112#include <linux/mutex.h>
113 113
114#include <asm/system.h>
115 114
116static DEFINE_MUTEX(nvram_mutex); 115static DEFINE_MUTEX(nvram_mutex);
117static DEFINE_SPINLOCK(nvram_state_lock); 116static DEFINE_SPINLOCK(nvram_state_lock);
diff --git a/drivers/char/nwflash.c b/drivers/char/nwflash.c
index bf586ae1ee8..d45c3345b4a 100644
--- a/drivers/char/nwflash.c
+++ b/drivers/char/nwflash.c
@@ -32,7 +32,6 @@
32#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/leds.h> 33#include <asm/leds.h>
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35#include <asm/system.h>
36#include <asm/uaccess.h> 35#include <asm/uaccess.h>
37 36
38/*****************************************************************************/ 37/*****************************************************************************/
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index f6453df4921..0a484b4a1b0 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -60,7 +60,6 @@
60#include <linux/ioctl.h> 60#include <linux/ioctl.h>
61#include <linux/synclink.h> 61#include <linux/synclink.h>
62 62
63#include <asm/system.h>
64#include <asm/io.h> 63#include <asm/io.h>
65#include <asm/irq.h> 64#include <asm/irq.h>
66#include <asm/dma.h> 65#include <asm/dma.h>
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index 872e09a02d2..af9437488b6 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -83,7 +83,6 @@
83#include <linux/ratelimit.h> 83#include <linux/ratelimit.h>
84 84
85#include <asm/current.h> 85#include <asm/current.h>
86#include <asm/system.h>
87 86
88#ifdef CONFIG_X86 87#ifdef CONFIG_X86
89#include <asm/hpet.h> 88#include <asm/hpet.h>
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index 1ee8ce7d276..45713f0e7d6 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -54,7 +54,6 @@
54 54
55#include <asm/uaccess.h> 55#include <asm/uaccess.h>
56#include <asm/io.h> 56#include <asm/io.h>
57#include <asm/system.h>
58 57
59#include <linux/sonypi.h> 58#include <linux/sonypi.h>
60 59
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
index e90e1c74fd4..31ba11ca75e 100644
--- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
+++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
@@ -89,7 +89,6 @@
89 89
90#include <asm/io.h> 90#include <asm/io.h>
91#include <asm/uaccess.h> 91#include <asm/uaccess.h>
92#include <asm/system.h>
93 92
94#ifdef CONFIG_OF 93#ifdef CONFIG_OF
95/* For open firmware. */ 94/* For open firmware. */
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index 67bbb06d046..17fa04d08be 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -27,7 +27,6 @@
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/regulator/consumer.h> 28#include <linux/regulator/consumer.h>
29 29
30#include <asm/system.h>
31#include <asm/smp_plat.h> 30#include <asm/smp_plat.h>
32#include <asm/cpu.h> 31#include <asm/cpu.h>
33 32
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c
index cf7e1ee005a..334cc2f1e9f 100644
--- a/drivers/cpufreq/powernow-k7.c
+++ b/drivers/cpufreq/powernow-k7.c
@@ -27,7 +27,6 @@
27 27
28#include <asm/timer.h> /* Needed for recalibrate_cpu_khz() */ 28#include <asm/timer.h> /* Needed for recalibrate_cpu_khz() */
29#include <asm/msr.h> 29#include <asm/msr.h>
30#include <asm/system.h>
31#include <asm/cpu_device_id.h> 30#include <asm/cpu_device_id.h>
32 31
33#ifdef CONFIG_X86_POWERNOW_K7_ACPI 32#ifdef CONFIG_X86_POWERNOW_K7_ACPI
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index 22c6df5f136..2e6b24547e2 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -44,7 +44,6 @@
44#include <linux/wait.h> 44#include <linux/wait.h>
45#include <linux/workqueue.h> 45#include <linux/workqueue.h>
46 46
47#include <asm/system.h>
48 47
49#include "core.h" 48#include "core.h"
50 49
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c
index afa7c83bd11..68109e9bb04 100644
--- a/drivers/firewire/core-device.c
+++ b/drivers/firewire/core-device.c
@@ -40,7 +40,6 @@
40 40
41#include <linux/atomic.h> 41#include <linux/atomic.h>
42#include <asm/byteorder.h> 42#include <asm/byteorder.h>
43#include <asm/system.h>
44 43
45#include "core.h" 44#include "core.h"
46 45
diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core-topology.c
index 255646ffc35..0de83508f32 100644
--- a/drivers/firewire/core-topology.c
+++ b/drivers/firewire/core-topology.c
@@ -31,7 +31,6 @@
31 31
32#include <linux/atomic.h> 32#include <linux/atomic.h>
33#include <asm/byteorder.h> 33#include <asm/byteorder.h>
34#include <asm/system.h>
35 34
36#include "core.h" 35#include "core.h"
37 36
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 187b3f2e797..2b5460075a9 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -46,7 +46,6 @@
46 46
47#include <asm/byteorder.h> 47#include <asm/byteorder.h>
48#include <asm/page.h> 48#include <asm/page.h>
49#include <asm/system.h>
50 49
51#ifdef CONFIG_PPC_PMAC 50#ifdef CONFIG_PPC_PMAC
52#include <asm/pmac_feature.h> 51#include <asm/pmac_feature.h>
diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c
index 000a29ffeda..b7e65d7eab6 100644
--- a/drivers/firewire/sbp2.c
+++ b/drivers/firewire/sbp2.c
@@ -52,7 +52,6 @@
52#include <linux/workqueue.h> 52#include <linux/workqueue.h>
53 53
54#include <asm/byteorder.h> 54#include <asm/byteorder.h>
55#include <asm/system.h>
56 55
57#include <scsi/scsi.h> 56#include <scsi/scsi.h>
58#include <scsi/scsi_cmnd.h> 57#include <scsi/scsi_cmnd.h>
diff --git a/drivers/i2c/busses/i2c-acorn.c b/drivers/i2c/busses/i2c-acorn.c
index 86796488ef4..ed9f48d566d 100644
--- a/drivers/i2c/busses/i2c-acorn.c
+++ b/drivers/i2c/busses/i2c-acorn.c
@@ -19,7 +19,6 @@
19 19
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21#include <asm/hardware/ioc.h> 21#include <asm/hardware/ioc.h>
22#include <asm/system.h>
23 22
24#define FORCE_ONES 0xdc 23#define FORCE_ONES 0xdc
25#define SCL 0x02 24#define SCL 0x02
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index d2f3db3cf3e..28e344ea514 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -41,7 +41,6 @@
41#include <linux/major.h> 41#include <linux/major.h>
42#include <linux/delay.h> 42#include <linux/delay.h>
43#include <asm/io.h> 43#include <asm/io.h>
44#include <asm/system.h>
45 44
46#include <pcmcia/cistpl.h> 45#include <pcmcia/cistpl.h>
47#include <pcmcia/ds.h> 46#include <pcmcia/ds.h>
diff --git a/drivers/ide/qd65xx.c b/drivers/ide/qd65xx.c
index 8bbfe5557c7..e03f4f19c1d 100644
--- a/drivers/ide/qd65xx.c
+++ b/drivers/ide/qd65xx.c
@@ -29,7 +29,6 @@
29#include <linux/blkdev.h> 29#include <linux/blkdev.h>
30#include <linux/ide.h> 30#include <linux/ide.h>
31#include <linux/init.h> 31#include <linux/init.h>
32#include <asm/system.h>
33#include <asm/io.h> 32#include <asm/io.h>
34 33
35#define DRV_NAME "qd65xx" 34#define DRV_NAME "qd65xx"
diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c
index 9a3fbfca9b4..fd05f48f6b0 100644
--- a/drivers/infiniband/hw/ehca/ehca_reqs.c
+++ b/drivers/infiniband/hw/ehca/ehca_reqs.c
@@ -42,7 +42,6 @@
42 */ 42 */
43 43
44 44
45#include <asm/system.h>
46#include "ehca_classes.h" 45#include "ehca_classes.h"
47#include "ehca_tools.h" 46#include "ehca_tools.h"
48#include "ehca_qes.h" 47#include "ehca_qes.h"
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index c24ec2d5f92..26043cc6a01 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -13,7 +13,6 @@
13#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 13#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
14 14
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/system.h>
17#include <linux/delay.h> 16#include <linux/delay.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
19#include <linux/joystick.h> 18#include <linux/joystick.h>
diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c
index 0bc86204213..24044dacbf7 100644
--- a/drivers/input/joystick/amijoy.c
+++ b/drivers/input/joystick/amijoy.c
@@ -35,7 +35,6 @@
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37 37
38#include <asm/system.h>
39#include <asm/amigahw.h> 38#include <asm/amigahw.h>
40#include <asm/amigaints.h> 39#include <asm/amigaints.h>
41 40
diff --git a/drivers/input/mouse/amimouse.c b/drivers/input/mouse/amimouse.c
index ff5f61a0fd3..5fa99341a39 100644
--- a/drivers/input/mouse/amimouse.c
+++ b/drivers/input/mouse/amimouse.c
@@ -25,7 +25,6 @@
25 25
26#include <asm/irq.h> 26#include <asm/irq.h>
27#include <asm/setup.h> 27#include <asm/setup.h>
28#include <asm/system.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
30#include <asm/amigahw.h> 29#include <asm/amigahw.h>
31#include <asm/amigaints.h> 30#include <asm/amigaints.h>
diff --git a/drivers/input/mouse/atarimouse.c b/drivers/input/mouse/atarimouse.c
index 5c4a692bf73..d1c43236b12 100644
--- a/drivers/input/mouse/atarimouse.c
+++ b/drivers/input/mouse/atarimouse.c
@@ -47,7 +47,6 @@
47 47
48#include <asm/irq.h> 48#include <asm/irq.h>
49#include <asm/setup.h> 49#include <asm/setup.h>
50#include <asm/system.h>
51#include <asm/uaccess.h> 50#include <asm/uaccess.h>
52#include <asm/atarihw.h> 51#include <asm/atarihw.h>
53#include <asm/atarikb.h> 52#include <asm/atarikb.h>
diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c
index be3316073ae..09a089996de 100644
--- a/drivers/input/serio/hp_sdc.c
+++ b/drivers/input/serio/hp_sdc.c
@@ -71,7 +71,6 @@
71#include <linux/slab.h> 71#include <linux/slab.h>
72#include <linux/hil.h> 72#include <linux/hil.h>
73#include <asm/io.h> 73#include <asm/io.h>
74#include <asm/system.h>
75 74
76/* Machine-specific abstraction */ 75/* Machine-specific abstraction */
77 76
diff --git a/drivers/input/serio/maceps2.c b/drivers/input/serio/maceps2.c
index 558200e96d0..61da763b120 100644
--- a/drivers/input/serio/maceps2.c
+++ b/drivers/input/serio/maceps2.c
@@ -21,7 +21,6 @@
21 21
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/irq.h> 23#include <asm/irq.h>
24#include <asm/system.h>
25#include <asm/ip32/mace.h> 24#include <asm/ip32/mace.h>
26#include <asm/ip32/ip32_ints.h> 25#include <asm/ip32/ip32_ints.h>
27 26
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index 58b224498b3..2af5df6a8fb 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -38,7 +38,6 @@
38 38
39#include <mach/hardware.h> 39#include <mach/hardware.h>
40#include <asm/hardware/iomd.h> 40#include <asm/hardware/iomd.h>
41#include <asm/system.h>
42 41
43MODULE_AUTHOR("Vojtech Pavlik, Russell King"); 42MODULE_AUTHOR("Vojtech Pavlik, Russell King");
44MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver"); 43MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver");
diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c
index 5ebabe3fc84..38976670753 100644
--- a/drivers/input/serio/sa1111ps2.c
+++ b/drivers/input/serio/sa1111ps2.c
@@ -20,7 +20,6 @@
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21 21
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/system.h>
24 23
25#include <asm/hardware/sa1111.h> 24#include <asm/hardware/sa1111.h>
26 25
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index 44b50cc645e..c21353d8e91 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -18,7 +18,6 @@
18#include <linux/serial.h> 18#include <linux/serial.h>
19#include <linux/major.h> 19#include <linux/major.h>
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/system.h>
22 21
23#include <pcmcia/cistpl.h> 22#include <pcmcia/cistpl.h>
24#include <pcmcia/ciscode.h> 23#include <pcmcia/ciscode.h>
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 33e3c94887d..c644557ae61 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -18,7 +18,6 @@
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/string.h> 19#include <linux/string.h>
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/system.h>
22 21
23#include <pcmcia/cistpl.h> 22#include <pcmcia/cistpl.h>
24#include <pcmcia/ds.h> 23#include <pcmcia/ds.h>
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index fe254e74a85..a8c4d3fc9a6 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -44,7 +44,6 @@
44#include <linux/timer.h> 44#include <linux/timer.h>
45#include <linux/ioport.h> 45#include <linux/ioport.h>
46#include <asm/io.h> 46#include <asm/io.h>
47#include <asm/system.h>
48 47
49#include <pcmcia/cistpl.h> 48#include <pcmcia/cistpl.h>
50#include <pcmcia/cisreg.h> 49#include <pcmcia/cisreg.h>
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index 68f50495d16..f0dfc0c976e 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -44,7 +44,6 @@
44#include <linux/timer.h> 44#include <linux/timer.h>
45#include <linux/ioport.h> 45#include <linux/ioport.h>
46#include <asm/io.h> 46#include <asm/io.h>
47#include <asm/system.h>
48 47
49#include <pcmcia/cistpl.h> 48#include <pcmcia/cistpl.h>
50#include <pcmcia/cisreg.h> 49#include <pcmcia/cisreg.h>
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index bfe94284b0d..4deac451807 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -25,7 +25,6 @@
25#include <linux/timer.h> 25#include <linux/timer.h>
26#include <linux/ioport.h> 26#include <linux/ioport.h>
27#include <asm/io.h> 27#include <asm/io.h>
28#include <asm/system.h>
29 28
30#include <pcmcia/cistpl.h> 29#include <pcmcia/cistpl.h>
31#include <pcmcia/cisreg.h> 30#include <pcmcia/cisreg.h>
diff --git a/drivers/isdn/i4l/isdn_bsdcomp.c b/drivers/isdn/i4l/isdn_bsdcomp.c
index 7f3c54d4047..c59e8d2c067 100644
--- a/drivers/isdn/i4l/isdn_bsdcomp.c
+++ b/drivers/isdn/i4l/isdn_bsdcomp.c
@@ -69,7 +69,6 @@
69#include <linux/signal.h> /* used in new tty drivers */ 69#include <linux/signal.h> /* used in new tty drivers */
70#include <linux/bitops.h> 70#include <linux/bitops.h>
71 71
72#include <asm/system.h>
73#include <asm/byteorder.h> 72#include <asm/byteorder.h>
74#include <asm/types.h> 73#include <asm/types.h>
75 74
diff --git a/drivers/isdn/pcbit/layer2.c b/drivers/isdn/pcbit/layer2.c
index 682911f8113..a18e639b40d 100644
--- a/drivers/isdn/pcbit/layer2.c
+++ b/drivers/isdn/pcbit/layer2.c
@@ -36,7 +36,6 @@
36 36
37#include <linux/isdnif.h> 37#include <linux/isdnif.h>
38 38
39#include <asm/system.h>
40#include <asm/io.h> 39#include <asm/io.h>
41 40
42 41
diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c
index b6ef8f59076..87de8d9bcfa 100644
--- a/drivers/macintosh/macio-adb.c
+++ b/drivers/macintosh/macio-adb.c
@@ -14,7 +14,6 @@
14#include <asm/pgtable.h> 14#include <asm/pgtable.h>
15#include <asm/hydra.h> 15#include <asm/hydra.h>
16#include <asm/irq.h> 16#include <asm/irq.h>
17#include <asm/system.h>
18#include <linux/init.h> 17#include <linux/init.h>
19#include <linux/ioport.h> 18#include <linux/ioport.h>
20 19
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index c60d025044e..fc71723cbc4 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -29,7 +29,6 @@
29#include <asm/prom.h> 29#include <asm/prom.h>
30#include <asm/machdep.h> 30#include <asm/machdep.h>
31#include <asm/io.h> 31#include <asm/io.h>
32#include <asm/system.h>
33#include <asm/sections.h> 32#include <asm/sections.h>
34 33
35#undef DEBUG 34#undef DEBUG
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index 0ff92c20800..97cfc5ac9fd 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -127,7 +127,6 @@
127#include <asm/prom.h> 127#include <asm/prom.h>
128#include <asm/machdep.h> 128#include <asm/machdep.h>
129#include <asm/io.h> 129#include <asm/io.h>
130#include <asm/system.h>
131#include <asm/sections.h> 130#include <asm/sections.h>
132#include <asm/macio.h> 131#include <asm/macio.h>
133 132
diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c
index 46c4e95f10d..3b4a157714b 100644
--- a/drivers/macintosh/therm_windtunnel.c
+++ b/drivers/macintosh/therm_windtunnel.c
@@ -41,7 +41,6 @@
41#include <asm/prom.h> 41#include <asm/prom.h>
42#include <asm/machdep.h> 42#include <asm/machdep.h>
43#include <asm/io.h> 43#include <asm/io.h>
44#include <asm/system.h>
45#include <asm/sections.h> 44#include <asm/sections.h>
46#include <asm/macio.h> 45#include <asm/macio.h>
47 46
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
index 971bc9582a5..86511c570dd 100644
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -26,7 +26,6 @@
26#include <asm/mac_via.h> 26#include <asm/mac_via.h>
27#endif 27#endif
28#include <asm/io.h> 28#include <asm/io.h>
29#include <asm/system.h>
30#include <linux/init.h> 29#include <linux/init.h>
31 30
32static volatile unsigned char __iomem *via; 31static volatile unsigned char __iomem *via;
diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c
index c9570fcf1cc..3725f088f17 100644
--- a/drivers/macintosh/via-macii.c
+++ b/drivers/macintosh/via-macii.c
@@ -34,7 +34,6 @@
34#include <asm/macintosh.h> 34#include <asm/macintosh.h>
35#include <asm/macints.h> 35#include <asm/macints.h>
36#include <asm/mac_via.h> 36#include <asm/mac_via.h>
37#include <asm/system.h>
38 37
39static volatile unsigned char *via; 38static volatile unsigned char *via;
40 39
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 6cccd60c594..22b8ce4191c 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -50,7 +50,6 @@
50#include <asm/machdep.h> 50#include <asm/machdep.h>
51#include <asm/io.h> 51#include <asm/io.h>
52#include <asm/pgtable.h> 52#include <asm/pgtable.h>
53#include <asm/system.h>
54#include <asm/sections.h> 53#include <asm/sections.h>
55#include <asm/irq.h> 54#include <asm/irq.h>
56#include <asm/pmac_feature.h> 55#include <asm/pmac_feature.h>
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c
index aeb30d07d5a..a00ee41f057 100644
--- a/drivers/macintosh/via-pmu68k.c
+++ b/drivers/macintosh/via-pmu68k.c
@@ -37,7 +37,6 @@
37#include <asm/mac_via.h> 37#include <asm/mac_via.h>
38 38
39#include <asm/pgtable.h> 39#include <asm/pgtable.h>
40#include <asm/system.h>
41#include <asm/irq.h> 40#include <asm/irq.h>
42#include <asm/uaccess.h> 41#include <asm/uaccess.h>
43 42
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c
index 647c6add219..4d6a90a1372 100644
--- a/drivers/macintosh/windfarm_lm75_sensor.c
+++ b/drivers/macintosh/windfarm_lm75_sensor.c
@@ -18,7 +18,6 @@
18#include <asm/prom.h> 18#include <asm/prom.h>
19#include <asm/machdep.h> 19#include <asm/machdep.h>
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/system.h>
22#include <asm/sections.h> 21#include <asm/sections.h>
23#include <asm/pmac_low_i2c.h> 22#include <asm/pmac_low_i2c.h>
24 23
diff --git a/drivers/macintosh/windfarm_pm121.c b/drivers/macintosh/windfarm_pm121.c
index 30e6195e19d..04067e073aa 100644
--- a/drivers/macintosh/windfarm_pm121.c
+++ b/drivers/macintosh/windfarm_pm121.c
@@ -215,7 +215,6 @@
215#include <asm/prom.h> 215#include <asm/prom.h>
216#include <asm/machdep.h> 216#include <asm/machdep.h>
217#include <asm/io.h> 217#include <asm/io.h>
218#include <asm/system.h>
219#include <asm/sections.h> 218#include <asm/sections.h>
220#include <asm/smu.h> 219#include <asm/smu.h>
221 220
diff --git a/drivers/macintosh/windfarm_pm81.c b/drivers/macintosh/windfarm_pm81.c
index 749d174b0dc..fc13d0f2663 100644
--- a/drivers/macintosh/windfarm_pm81.c
+++ b/drivers/macintosh/windfarm_pm81.c
@@ -107,7 +107,6 @@
107#include <asm/prom.h> 107#include <asm/prom.h>
108#include <asm/machdep.h> 108#include <asm/machdep.h>
109#include <asm/io.h> 109#include <asm/io.h>
110#include <asm/system.h>
111#include <asm/sections.h> 110#include <asm/sections.h>
112#include <asm/smu.h> 111#include <asm/smu.h>
113 112
diff --git a/drivers/macintosh/windfarm_pm91.c b/drivers/macintosh/windfarm_pm91.c
index 34427323512..a9430ed4f36 100644
--- a/drivers/macintosh/windfarm_pm91.c
+++ b/drivers/macintosh/windfarm_pm91.c
@@ -41,7 +41,6 @@
41#include <asm/prom.h> 41#include <asm/prom.h>
42#include <asm/machdep.h> 42#include <asm/machdep.h>
43#include <asm/io.h> 43#include <asm/io.h>
44#include <asm/system.h>
45#include <asm/sections.h> 44#include <asm/sections.h>
46#include <asm/smu.h> 45#include <asm/smu.h>
47 46
diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c
index 43137b421f9..3c2be5193fd 100644
--- a/drivers/macintosh/windfarm_smu_controls.c
+++ b/drivers/macintosh/windfarm_smu_controls.c
@@ -18,7 +18,6 @@
18#include <asm/prom.h> 18#include <asm/prom.h>
19#include <asm/machdep.h> 19#include <asm/machdep.h>
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/system.h>
22#include <asm/sections.h> 21#include <asm/sections.h>
23#include <asm/smu.h> 22#include <asm/smu.h>
24 23
diff --git a/drivers/macintosh/windfarm_smu_sensors.c b/drivers/macintosh/windfarm_smu_sensors.c
index 3c193504bb8..1cc4e4953d8 100644
--- a/drivers/macintosh/windfarm_smu_sensors.c
+++ b/drivers/macintosh/windfarm_smu_sensors.c
@@ -18,7 +18,6 @@
18#include <asm/prom.h> 18#include <asm/prom.h>
19#include <asm/machdep.h> 19#include <asm/machdep.h>
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/system.h>
22#include <asm/sections.h> 21#include <asm/sections.h>
23#include <asm/smu.h> 22#include <asm/smu.h>
24 23
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c
index e4b5c03ae51..73970cd97af 100644
--- a/drivers/media/dvb/dvb-core/dmxdev.c
+++ b/drivers/media/dvb/dvb-core/dmxdev.c
@@ -29,7 +29,6 @@
29#include <linux/ioctl.h> 29#include <linux/ioctl.h>
30#include <linux/wait.h> 30#include <linux/wait.h>
31#include <asm/uaccess.h> 31#include <asm/uaccess.h>
32#include <asm/system.h>
33#include "dmxdev.h" 32#include "dmxdev.h"
34 33
35static int debug; 34static int debug;
diff --git a/drivers/media/dvb/firewire/firedtv-fw.c b/drivers/media/dvb/firewire/firedtv-fw.c
index 864b6274c72..e24ec539a5f 100644
--- a/drivers/media/dvb/firewire/firedtv-fw.c
+++ b/drivers/media/dvb/firewire/firedtv-fw.c
@@ -20,7 +20,6 @@
20#include <linux/workqueue.h> 20#include <linux/workqueue.h>
21 21
22#include <asm/page.h> 22#include <asm/page.h>
23#include <asm/system.h>
24 23
25#include <dvb_demux.h> 24#include <dvb_demux.h>
26 25
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index 6ecbcf61487..4bd8bd56bef 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -53,7 +53,6 @@
53#include <asm/unaligned.h> 53#include <asm/unaligned.h>
54#include <asm/byteorder.h> 54#include <asm/byteorder.h>
55 55
56#include <asm/system.h>
57 56
58#include <linux/dvb/frontend.h> 57#include <linux/dvb/frontend.h>
59 58
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
index 421cf73858d..f6b52d54943 100644
--- a/drivers/media/media-devnode.c
+++ b/drivers/media/media-devnode.c
@@ -40,7 +40,6 @@
40#include <linux/string.h> 40#include <linux/string.h>
41#include <linux/types.h> 41#include <linux/types.h>
42#include <linux/uaccess.h> 42#include <linux/uaccess.h>
43#include <asm/system.h>
44 43
45#include <media/media-devnode.h> 44#include <media/media-devnode.h>
46 45
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h
index f767df94395..2e220028aad 100644
--- a/drivers/media/video/ivtv/ivtv-driver.h
+++ b/drivers/media/video/ivtv/ivtv-driver.h
@@ -54,7 +54,6 @@
54#include <linux/mutex.h> 54#include <linux/mutex.h>
55#include <linux/slab.h> 55#include <linux/slab.h>
56#include <asm/uaccess.h> 56#include <asm/uaccess.h>
57#include <asm/system.h>
58#include <asm/byteorder.h> 57#include <asm/byteorder.h>
59 58
60#include <linux/dvb/video.h> 59#include <linux/dvb/video.h>
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 5c6100fb407..1baec839330 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -55,7 +55,6 @@
55#include <linux/spi/spi.h> 55#include <linux/spi/spi.h>
56#endif 56#endif
57#include <asm/uaccess.h> 57#include <asm/uaccess.h>
58#include <asm/system.h>
59#include <asm/pgtable.h> 58#include <asm/pgtable.h>
60#include <asm/io.h> 59#include <asm/io.h>
61#include <asm/div64.h> 60#include <asm/div64.h>
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 041804b73eb..70bec548d90 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -26,7 +26,6 @@
26#include <linux/kmod.h> 26#include <linux/kmod.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/system.h>
30 29
31#include <media/v4l2-common.h> 30#include <media/v4l2-common.h>
32#include <media/v4l2-device.h> 31#include <media/v4l2-device.h>
diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c
index c8ed7b63fdf..1d31d7284cb 100644
--- a/drivers/message/i2o/i2o_scsi.c
+++ b/drivers/message/i2o/i2o_scsi.c
@@ -57,7 +57,6 @@
57#include <linux/scatterlist.h> 57#include <linux/scatterlist.h>
58 58
59#include <asm/dma.h> 59#include <asm/dma.h>
60#include <asm/system.h>
61#include <asm/io.h> 60#include <asm/io.h>
62#include <linux/atomic.h> 61#include <linux/atomic.h>
63 62
diff --git a/drivers/mfd/mcp-core.c b/drivers/mfd/mcp-core.c
index 6acf2e03f2b..62e5e3617eb 100644
--- a/drivers/mfd/mcp-core.c
+++ b/drivers/mfd/mcp-core.c
@@ -19,8 +19,6 @@
19#include <linux/string.h> 19#include <linux/string.h>
20#include <linux/mfd/mcp.h> 20#include <linux/mfd/mcp.h>
21 21
22#include <asm/system.h>
23
24 22
25#define to_mcp(d) container_of(d, struct mcp, attached_device) 23#define to_mcp(d) container_of(d, struct mcp, attached_device)
26#define to_mcp_driver(d) container_of(d, struct mcp_driver, drv) 24#define to_mcp_driver(d) container_of(d, struct mcp_driver, drv)
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c
index 1c0ceacaa1f..c54e244ca0c 100644
--- a/drivers/mfd/mcp-sa11x0.c
+++ b/drivers/mfd/mcp-sa11x0.c
@@ -24,7 +24,6 @@
24 24
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <asm/system.h>
28#include <mach/mcp.h> 27#include <mach/mcp.h>
29 28
30#define DRIVER_NAME "sa11x0-mcp" 29#define DRIVER_NAME "sa11x0-mcp"
diff --git a/drivers/misc/sgi-gru/gru_instructions.h b/drivers/misc/sgi-gru/gru_instructions.h
index d95587cc794..04d5170ac14 100644
--- a/drivers/misc/sgi-gru/gru_instructions.h
+++ b/drivers/misc/sgi-gru/gru_instructions.h
@@ -40,6 +40,7 @@ extern void gru_wait_abort_proc(void *cb);
40 *((volatile unsigned long *)(p)) = v; /* force st.rel */ \ 40 *((volatile unsigned long *)(p)) = v; /* force st.rel */ \
41 } while (0) 41 } while (0)
42#elif defined(CONFIG_X86_64) 42#elif defined(CONFIG_X86_64)
43#include <asm/cacheflush.h>
43#define __flush_cache(p) clflush(p) 44#define __flush_cache(p) clflush(p)
44#define gru_ordered_store_ulong(p, v) \ 45#define gru_ordered_store_ulong(p, v) \
45 do { \ 46 do { \
diff --git a/drivers/misc/sgi-xp/xp.h b/drivers/misc/sgi-xp/xp.h
index 851b2f25ce0..c862cd4583c 100644
--- a/drivers/misc/sgi-xp/xp.h
+++ b/drivers/misc/sgi-xp/xp.h
@@ -25,7 +25,6 @@
25#endif 25#endif
26 26
27#if defined CONFIG_IA64 27#if defined CONFIG_IA64
28#include <asm/system.h>
29#include <asm/sn/arch.h> /* defines is_shub1() and is_shub2() */ 28#include <asm/sn/arch.h> /* defines is_shub1() and is_shub2() */
30#define is_shub() ia64_platform_is("sn2") 29#define is_shub() ia64_platform_is("sn2")
31#endif 30#endif
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index e5a3c7b6ded..4c3b2847e47 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -41,7 +41,6 @@
41#include <linux/mmc/mmc.h> 41#include <linux/mmc/mmc.h>
42#include <linux/mmc/sd.h> 42#include <linux/mmc/sd.h>
43 43
44#include <asm/system.h>
45#include <asm/uaccess.h> 44#include <asm/uaccess.h>
46 45
47#include "queue.h" 46#include "queue.h"
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c
index ecff765579d..5d53c5760a6 100644
--- a/drivers/mtd/devices/pmc551.c
+++ b/drivers/mtd/devices/pmc551.c
@@ -93,7 +93,6 @@
93#include <linux/fs.h> 93#include <linux/fs.h>
94#include <linux/ioctl.h> 94#include <linux/ioctl.h>
95#include <asm/io.h> 95#include <asm/io.h>
96#include <asm/system.h>
97#include <linux/pci.h> 96#include <linux/pci.h>
98 97
99#include <linux/mtd/mtd.h> 98#include <linux/mtd/mtd.h>
diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c
index e585263161b..288594163c2 100644
--- a/drivers/mtd/devices/slram.c
+++ b/drivers/mtd/devices/slram.c
@@ -42,7 +42,6 @@
42#include <linux/ioctl.h> 42#include <linux/ioctl.h>
43#include <linux/init.h> 43#include <linux/init.h>
44#include <asm/io.h> 44#include <asm/io.h>
45#include <asm/system.h>
46 45
47#include <linux/mtd/mtd.h> 46#include <linux/mtd/mtd.h>
48 47
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index e8e9fec2355..0259cf58302 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -14,7 +14,6 @@
14#include <linux/timer.h> 14#include <linux/timer.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <asm/io.h> 16#include <asm/io.h>
17#include <asm/system.h>
18 17
19#include <pcmcia/cistpl.h> 18#include <pcmcia/cistpl.h>
20#include <pcmcia/ds.h> 19#include <pcmcia/ds.h>
diff --git a/drivers/mtd/nand/bcm_umi_nand.c b/drivers/mtd/nand/bcm_umi_nand.c
index 50387fd4009..64c9cbaf86a 100644
--- a/drivers/mtd/nand/bcm_umi_nand.c
+++ b/drivers/mtd/nand/bcm_umi_nand.c
@@ -31,7 +31,6 @@
31#include <linux/mtd/partitions.h> 31#include <linux/mtd/partitions.h>
32 32
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/system.h>
35 34
36#include <mach/reg_nand.h> 35#include <mach/reg_nand.h>
37#include <mach/reg_umi.h> 36#include <mach/reg_umi.h>
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c
index 9abd4eb86dc..dd5e04813b7 100644
--- a/drivers/net/appletalk/cops.c
+++ b/drivers/net/appletalk/cops.c
@@ -70,7 +70,6 @@ static const char *version =
70#include <linux/bitops.h> 70#include <linux/bitops.h>
71#include <linux/jiffies.h> 71#include <linux/jiffies.h>
72 72
73#include <asm/system.h>
74#include <asm/io.h> 73#include <asm/io.h>
75#include <asm/dma.h> 74#include <asm/dma.h>
76 75
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index 6057b30417a..0910dce3996 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -229,7 +229,6 @@ static int dma;
229#include <linux/bitops.h> 229#include <linux/bitops.h>
230#include <linux/gfp.h> 230#include <linux/gfp.h>
231 231
232#include <asm/system.h>
233#include <asm/dma.h> 232#include <asm/dma.h>
234#include <asm/io.h> 233#include <asm/io.h>
235 234
diff --git a/drivers/net/arcnet/com20020_cs.c b/drivers/net/arcnet/com20020_cs.c
index 980e65c1493..5bed4c4e250 100644
--- a/drivers/net/arcnet/com20020_cs.c
+++ b/drivers/net/arcnet/com20020_cs.c
@@ -47,7 +47,6 @@
47#include <pcmcia/ds.h> 47#include <pcmcia/ds.h>
48 48
49#include <asm/io.h> 49#include <asm/io.h>
50#include <asm/system.h>
51 50
52#define VERSION "arcnet: COM20020 PCMCIA support loaded.\n" 51#define VERSION "arcnet: COM20020 PCMCIA support loaded.\n"
53 52
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b920d829692..0c76186bb9e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -54,7 +54,6 @@
54#include <linux/inet.h> 54#include <linux/inet.h>
55#include <linux/bitops.h> 55#include <linux/bitops.h>
56#include <linux/io.h> 56#include <linux/io.h>
57#include <asm/system.h>
58#include <asm/dma.h> 57#include <asm/dma.h>
59#include <linux/uaccess.h> 58#include <linux/uaccess.h>
60#include <linux/errno.h> 59#include <linux/errno.h>
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index 98a5a7d867f..034c16b60e9 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -40,7 +40,6 @@
40#include <linux/module.h> 40#include <linux/module.h>
41#include <linux/moduleparam.h> 41#include <linux/moduleparam.h>
42 42
43#include <asm/system.h>
44#include <linux/uaccess.h> 43#include <linux/uaccess.h>
45#include <linux/bitops.h> 44#include <linux/bitops.h>
46#include <linux/string.h> 45#include <linux/string.h>
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 7cb2785e209..ec03b401620 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -35,7 +35,6 @@
35#include <asm/io.h> /* CRIS_LED_* I/O functions */ 35#include <asm/io.h> /* CRIS_LED_* I/O functions */
36#include <asm/irq.h> 36#include <asm/irq.h>
37#include <asm/dma.h> 37#include <asm/dma.h>
38#include <asm/system.h>
39#include <asm/ethernet.h> 38#include <asm/ethernet.h>
40#include <asm/cache.h> 39#include <asm/cache.h>
41#include <arch/io_interface_mux.h> 40#include <arch/io_interface_mux.h>
diff --git a/drivers/net/ethernet/3com/3c574_cs.c b/drivers/net/ethernet/3com/3c574_cs.c
index e61b2f82ba3..66df9363808 100644
--- a/drivers/net/ethernet/3com/3c574_cs.c
+++ b/drivers/net/ethernet/3com/3c574_cs.c
@@ -95,7 +95,6 @@ earlier 3Com products.
95 95
96#include <asm/uaccess.h> 96#include <asm/uaccess.h>
97#include <asm/io.h> 97#include <asm/io.h>
98#include <asm/system.h>
99 98
100/*====================================================================*/ 99/*====================================================================*/
101 100
diff --git a/drivers/net/ethernet/3com/3c589_cs.c b/drivers/net/ethernet/3com/3c589_cs.c
index b23253b9f74..a556c01e011 100644
--- a/drivers/net/ethernet/3com/3c589_cs.c
+++ b/drivers/net/ethernet/3com/3c589_cs.c
@@ -50,7 +50,6 @@
50 50
51#include <asm/uaccess.h> 51#include <asm/uaccess.h>
52#include <asm/io.h> 52#include <asm/io.h>
53#include <asm/system.h>
54 53
55/* To minimize the size of the driver source I only define operating 54/* To minimize the size of the driver source I only define operating
56 constants if they are used several times. You'll need the manual 55 constants if they are used several times. You'll need the manual
diff --git a/drivers/net/ethernet/8390/3c503.c b/drivers/net/ethernet/8390/3c503.c
index fbab1367505..49d76bd0dc8 100644
--- a/drivers/net/ethernet/8390/3c503.c
+++ b/drivers/net/ethernet/8390/3c503.c
@@ -54,7 +54,6 @@ static const char version[] =
54 54
55#include <asm/uaccess.h> 55#include <asm/uaccess.h>
56#include <asm/io.h> 56#include <asm/io.h>
57#include <asm/system.h>
58#include <asm/byteorder.h> 57#include <asm/byteorder.h>
59 58
60#include "8390.h" 59#include "8390.h"
diff --git a/drivers/net/ethernet/8390/ac3200.c b/drivers/net/ethernet/8390/ac3200.c
index 5337dd0a59b..ccf07942ff6 100644
--- a/drivers/net/ethernet/8390/ac3200.c
+++ b/drivers/net/ethernet/8390/ac3200.c
@@ -34,7 +34,6 @@ static const char version[] =
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36 36
37#include <asm/system.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/irq.h> 38#include <asm/irq.h>
40 39
diff --git a/drivers/net/ethernet/8390/apne.c b/drivers/net/ethernet/8390/apne.c
index 3ad5d2f9a49..923959275a8 100644
--- a/drivers/net/ethernet/8390/apne.c
+++ b/drivers/net/ethernet/8390/apne.c
@@ -39,7 +39,6 @@
39#include <linux/interrupt.h> 39#include <linux/interrupt.h>
40#include <linux/jiffies.h> 40#include <linux/jiffies.h>
41 41
42#include <asm/system.h>
43#include <asm/io.h> 42#include <asm/io.h>
44#include <asm/setup.h> 43#include <asm/setup.h>
45#include <asm/amigaints.h> 44#include <asm/amigaints.h>
diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c
index c30adcc9828..11476ca95e9 100644
--- a/drivers/net/ethernet/8390/ax88796.c
+++ b/drivers/net/ethernet/8390/ax88796.c
@@ -31,7 +31,6 @@
31 31
32#include <net/ax88796.h> 32#include <net/ax88796.h>
33 33
34#include <asm/system.h>
35 34
36/* Rename the lib8390.c functions to show that they are in this driver */ 35/* Rename the lib8390.c functions to show that they are in this driver */
37#define __ei_open ax_ei_open 36#define __ei_open ax_ei_open
diff --git a/drivers/net/ethernet/8390/axnet_cs.c b/drivers/net/ethernet/8390/axnet_cs.c
index c5bd8eb7a9f..e1b3941bd14 100644
--- a/drivers/net/ethernet/8390/axnet_cs.c
+++ b/drivers/net/ethernet/8390/axnet_cs.c
@@ -46,7 +46,6 @@
46#include <pcmcia/cisreg.h> 46#include <pcmcia/cisreg.h>
47 47
48#include <asm/io.h> 48#include <asm/io.h>
49#include <asm/system.h>
50#include <asm/byteorder.h> 49#include <asm/byteorder.h>
51#include <asm/uaccess.h> 50#include <asm/uaccess.h>
52 51
diff --git a/drivers/net/ethernet/8390/e2100.c b/drivers/net/ethernet/8390/e2100.c
index d16dc53c181..ed55ce85ebb 100644
--- a/drivers/net/ethernet/8390/e2100.c
+++ b/drivers/net/ethernet/8390/e2100.c
@@ -48,7 +48,6 @@ static const char version[] =
48#include <linux/delay.h> 48#include <linux/delay.h>
49 49
50#include <asm/io.h> 50#include <asm/io.h>
51#include <asm/system.h>
52 51
53#include "8390.h" 52#include "8390.h"
54 53
diff --git a/drivers/net/ethernet/8390/es3210.c b/drivers/net/ethernet/8390/es3210.c
index 6428f9e7a55..ba1b5c95531 100644
--- a/drivers/net/ethernet/8390/es3210.c
+++ b/drivers/net/ethernet/8390/es3210.c
@@ -59,7 +59,6 @@ static const char version[] =
59#include <linux/etherdevice.h> 59#include <linux/etherdevice.h>
60 60
61#include <asm/io.h> 61#include <asm/io.h>
62#include <asm/system.h>
63 62
64#include "8390.h" 63#include "8390.h"
65 64
diff --git a/drivers/net/ethernet/8390/etherh.c b/drivers/net/ethernet/8390/etherh.c
index 48c4948750d..dbefd5658c1 100644
--- a/drivers/net/ethernet/8390/etherh.c
+++ b/drivers/net/ethernet/8390/etherh.c
@@ -45,9 +45,9 @@
45#include <linux/bitops.h> 45#include <linux/bitops.h>
46#include <linux/jiffies.h> 46#include <linux/jiffies.h>
47 47
48#include <asm/system.h>
49#include <asm/ecard.h> 48#include <asm/ecard.h>
50#include <asm/io.h> 49#include <asm/io.h>
50#include <asm/system_info.h>
51 51
52#define EI_SHIFT(x) (ei_local->reg_offset[x]) 52#define EI_SHIFT(x) (ei_local->reg_offset[x])
53 53
diff --git a/drivers/net/ethernet/8390/hp-plus.c b/drivers/net/ethernet/8390/hp-plus.c
index d42938b6b59..52f70f999c0 100644
--- a/drivers/net/ethernet/8390/hp-plus.c
+++ b/drivers/net/ethernet/8390/hp-plus.c
@@ -33,7 +33,6 @@ static const char version[] =
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/delay.h> 34#include <linux/delay.h>
35 35
36#include <asm/system.h>
37#include <asm/io.h> 36#include <asm/io.h>
38 37
39#include "8390.h" 38#include "8390.h"
diff --git a/drivers/net/ethernet/8390/hp.c b/drivers/net/ethernet/8390/hp.c
index 113f1e075a2..37fa89aa457 100644
--- a/drivers/net/ethernet/8390/hp.c
+++ b/drivers/net/ethernet/8390/hp.c
@@ -33,7 +33,6 @@ static const char version[] =
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/delay.h> 34#include <linux/delay.h>
35 35
36#include <asm/system.h>
37#include <asm/io.h> 36#include <asm/io.h>
38 37
39#include "8390.h" 38#include "8390.h"
diff --git a/drivers/net/ethernet/8390/lib8390.c b/drivers/net/ethernet/8390/lib8390.c
index e77f624e819..b329f5c0d62 100644
--- a/drivers/net/ethernet/8390/lib8390.c
+++ b/drivers/net/ethernet/8390/lib8390.c
@@ -57,7 +57,6 @@
57#include <linux/types.h> 57#include <linux/types.h>
58#include <linux/string.h> 58#include <linux/string.h>
59#include <linux/bitops.h> 59#include <linux/bitops.h>
60#include <asm/system.h>
61#include <linux/uaccess.h> 60#include <linux/uaccess.h>
62#include <linux/io.h> 61#include <linux/io.h>
63#include <asm/irq.h> 62#include <asm/irq.h>
diff --git a/drivers/net/ethernet/8390/lne390.c b/drivers/net/ethernet/8390/lne390.c
index 69490ae018e..479409bf2e3 100644
--- a/drivers/net/ethernet/8390/lne390.c
+++ b/drivers/net/ethernet/8390/lne390.c
@@ -46,7 +46,6 @@ static const char *version =
46#include <linux/etherdevice.h> 46#include <linux/etherdevice.h>
47 47
48#include <asm/io.h> 48#include <asm/io.h>
49#include <asm/system.h>
50 49
51#include "8390.h" 50#include "8390.h"
52 51
diff --git a/drivers/net/ethernet/8390/mac8390.c b/drivers/net/ethernet/8390/mac8390.c
index af5d9822cad..88ccc8b14f0 100644
--- a/drivers/net/ethernet/8390/mac8390.c
+++ b/drivers/net/ethernet/8390/mac8390.c
@@ -37,7 +37,6 @@
37#include <linux/bitops.h> 37#include <linux/bitops.h>
38#include <linux/io.h> 38#include <linux/io.h>
39 39
40#include <asm/system.h>
41#include <asm/dma.h> 40#include <asm/dma.h>
42#include <asm/hwtest.h> 41#include <asm/hwtest.h>
43#include <asm/macints.h> 42#include <asm/macints.h>
diff --git a/drivers/net/ethernet/8390/ne-h8300.c b/drivers/net/ethernet/8390/ne-h8300.c
index 9b9c77d5a65..7fc28f2d28a 100644
--- a/drivers/net/ethernet/8390/ne-h8300.c
+++ b/drivers/net/ethernet/8390/ne-h8300.c
@@ -29,7 +29,6 @@ static const char version1[] =
29#include <linux/etherdevice.h> 29#include <linux/etherdevice.h>
30#include <linux/jiffies.h> 30#include <linux/jiffies.h>
31 31
32#include <asm/system.h>
33#include <asm/io.h> 32#include <asm/io.h>
34#include <asm/irq.h> 33#include <asm/irq.h>
35 34
diff --git a/drivers/net/ethernet/8390/ne.c b/drivers/net/ethernet/8390/ne.c
index f92ea2a65a5..d04911d33b6 100644
--- a/drivers/net/ethernet/8390/ne.c
+++ b/drivers/net/ethernet/8390/ne.c
@@ -53,7 +53,6 @@ static const char version2[] =
53#include <linux/jiffies.h> 53#include <linux/jiffies.h>
54#include <linux/platform_device.h> 54#include <linux/platform_device.h>
55 55
56#include <asm/system.h>
57#include <asm/io.h> 56#include <asm/io.h>
58 57
59#include "8390.h" 58#include "8390.h"
diff --git a/drivers/net/ethernet/8390/ne2.c b/drivers/net/ethernet/8390/ne2.c
index 922b32036c6..ef85839f43d 100644
--- a/drivers/net/ethernet/8390/ne2.c
+++ b/drivers/net/ethernet/8390/ne2.c
@@ -76,7 +76,6 @@ static const char *version = "ne2.c:v0.91 Nov 16 1998 Wim Dumon <wimpie@kotnet.o
76#include <linux/bitops.h> 76#include <linux/bitops.h>
77#include <linux/jiffies.h> 77#include <linux/jiffies.h>
78 78
79#include <asm/system.h>
80#include <asm/io.h> 79#include <asm/io.h>
81#include <asm/dma.h> 80#include <asm/dma.h>
82 81
diff --git a/drivers/net/ethernet/8390/ne2k-pci.c b/drivers/net/ethernet/8390/ne2k-pci.c
index 3fab04a0034..5e8845febfb 100644
--- a/drivers/net/ethernet/8390/ne2k-pci.c
+++ b/drivers/net/ethernet/8390/ne2k-pci.c
@@ -54,7 +54,6 @@ static int options[MAX_UNITS];
54#include <linux/netdevice.h> 54#include <linux/netdevice.h>
55#include <linux/etherdevice.h> 55#include <linux/etherdevice.h>
56 56
57#include <asm/system.h>
58#include <asm/io.h> 57#include <asm/io.h>
59#include <asm/irq.h> 58#include <asm/irq.h>
60#include <asm/uaccess.h> 59#include <asm/uaccess.h>
diff --git a/drivers/net/ethernet/8390/ne3210.c b/drivers/net/ethernet/8390/ne3210.c
index 2a3e8057fea..a2f8b2b8e27 100644
--- a/drivers/net/ethernet/8390/ne3210.c
+++ b/drivers/net/ethernet/8390/ne3210.c
@@ -39,7 +39,6 @@
39#include <linux/mm.h> 39#include <linux/mm.h>
40 40
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/system.h>
43 42
44#include "8390.h" 43#include "8390.h"
45 44
diff --git a/drivers/net/ethernet/8390/pcnet_cs.c b/drivers/net/ethernet/8390/pcnet_cs.c
index f2a4e5de18c..de1af0bfed4 100644
--- a/drivers/net/ethernet/8390/pcnet_cs.c
+++ b/drivers/net/ethernet/8390/pcnet_cs.c
@@ -49,7 +49,6 @@
49#include <pcmcia/cisreg.h> 49#include <pcmcia/cisreg.h>
50 50
51#include <asm/io.h> 51#include <asm/io.h>
52#include <asm/system.h>
53#include <asm/byteorder.h> 52#include <asm/byteorder.h>
54#include <asm/uaccess.h> 53#include <asm/uaccess.h>
55 54
diff --git a/drivers/net/ethernet/8390/smc-mca.c b/drivers/net/ethernet/8390/smc-mca.c
index 77efec44fea..7a68590f280 100644
--- a/drivers/net/ethernet/8390/smc-mca.c
+++ b/drivers/net/ethernet/8390/smc-mca.c
@@ -47,7 +47,6 @@
47#include <linux/etherdevice.h> 47#include <linux/etherdevice.h>
48 48
49#include <asm/io.h> 49#include <asm/io.h>
50#include <asm/system.h>
51 50
52#include "8390.h" 51#include "8390.h"
53 52
diff --git a/drivers/net/ethernet/8390/smc-ultra.c b/drivers/net/ethernet/8390/smc-ultra.c
index 1cc306a83ff..b0fbce39661 100644
--- a/drivers/net/ethernet/8390/smc-ultra.c
+++ b/drivers/net/ethernet/8390/smc-ultra.c
@@ -69,7 +69,6 @@ static const char version[] =
69 69
70#include <asm/io.h> 70#include <asm/io.h>
71#include <asm/irq.h> 71#include <asm/irq.h>
72#include <asm/system.h>
73 72
74#include "8390.h" 73#include "8390.h"
75 74
diff --git a/drivers/net/ethernet/8390/smc-ultra32.c b/drivers/net/ethernet/8390/smc-ultra32.c
index bb87053eb3d..923e42aedcf 100644
--- a/drivers/net/ethernet/8390/smc-ultra32.c
+++ b/drivers/net/ethernet/8390/smc-ultra32.c
@@ -57,7 +57,6 @@ static const char *version = "smc-ultra32.c: 06/97 v1.00\n";
57#include <linux/etherdevice.h> 57#include <linux/etherdevice.h>
58 58
59#include <asm/io.h> 59#include <asm/io.h>
60#include <asm/system.h>
61 60
62#include "8390.h" 61#include "8390.h"
63 62
diff --git a/drivers/net/ethernet/8390/stnic.c b/drivers/net/ethernet/8390/stnic.c
index 3b903759980..8df4c415723 100644
--- a/drivers/net/ethernet/8390/stnic.c
+++ b/drivers/net/ethernet/8390/stnic.c
@@ -17,7 +17,6 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/delay.h> 18#include <linux/delay.h>
19 19
20#include <asm/system.h>
21#include <asm/io.h> 20#include <asm/io.h>
22#include <mach-se/mach/se.h> 21#include <mach-se/mach/se.h>
23#include <asm/machvec.h> 22#include <asm/machvec.h>
diff --git a/drivers/net/ethernet/8390/wd.c b/drivers/net/ethernet/8390/wd.c
index c175fadb597..03eb3eed49f 100644
--- a/drivers/net/ethernet/8390/wd.c
+++ b/drivers/net/ethernet/8390/wd.c
@@ -39,7 +39,6 @@ static const char version[] =
39#include <linux/etherdevice.h> 39#include <linux/etherdevice.h>
40 40
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/system.h>
43 42
44#include "8390.h" 43#include "8390.h"
45 44
diff --git a/drivers/net/ethernet/8390/zorro8390.c b/drivers/net/ethernet/8390/zorro8390.c
index bcd27323b20..7818e6397e9 100644
--- a/drivers/net/ethernet/8390/zorro8390.c
+++ b/drivers/net/ethernet/8390/zorro8390.c
@@ -31,7 +31,6 @@
31#include <linux/zorro.h> 31#include <linux/zorro.h>
32#include <linux/jiffies.h> 32#include <linux/jiffies.h>
33 33
34#include <asm/system.h>
35#include <asm/irq.h> 34#include <asm/irq.h>
36#include <asm/amigaints.h> 35#include <asm/amigaints.h>
37#include <asm/amigahw.h> 36#include <asm/amigahw.h>
diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c
index 6c3b1c0adaa..7219123fa0a 100644
--- a/drivers/net/ethernet/alteon/acenic.c
+++ b/drivers/net/ethernet/alteon/acenic.c
@@ -78,7 +78,6 @@
78#include <net/sock.h> 78#include <net/sock.h>
79#include <net/ip.h> 79#include <net/ip.h>
80 80
81#include <asm/system.h>
82#include <asm/io.h> 81#include <asm/io.h>
83#include <asm/irq.h> 82#include <asm/irq.h>
84#include <asm/byteorder.h> 83#include <asm/byteorder.h>
diff --git a/drivers/net/ethernet/amd/7990.c b/drivers/net/ethernet/amd/7990.c
index 1b046f58d58..6e722dc37db 100644
--- a/drivers/net/ethernet/amd/7990.c
+++ b/drivers/net/ethernet/amd/7990.c
@@ -33,7 +33,6 @@
33#include <linux/socket.h> 33#include <linux/socket.h>
34#include <linux/bitops.h> 34#include <linux/bitops.h>
35 35
36#include <asm/system.h>
37#include <asm/io.h> 36#include <asm/io.h>
38#include <asm/dma.h> 37#include <asm/dma.h>
39#include <asm/pgtable.h> 38#include <asm/pgtable.h>
diff --git a/drivers/net/ethernet/amd/am79c961a.c b/drivers/net/ethernet/amd/am79c961a.c
index cc7b9e46780..e10ffad525a 100644
--- a/drivers/net/ethernet/amd/am79c961a.c
+++ b/drivers/net/ethernet/amd/am79c961a.c
@@ -30,7 +30,6 @@
30#include <linux/io.h> 30#include <linux/io.h>
31 31
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <asm/system.h>
34 33
35#define TX_BUFFERS 15 34#define TX_BUFFERS 15
36#define RX_BUFFERS 25 35#define RX_BUFFERS 25
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index 9f62504d008..64d0d9c1afa 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -88,7 +88,6 @@ Revision History:
88#include <linux/crc32.h> 88#include <linux/crc32.h>
89#include <linux/dma-mapping.h> 89#include <linux/dma-mapping.h>
90 90
91#include <asm/system.h>
92#include <asm/io.h> 91#include <asm/io.h>
93#include <asm/byteorder.h> 92#include <asm/byteorder.h>
94#include <asm/uaccess.h> 93#include <asm/uaccess.h>
diff --git a/drivers/net/ethernet/amd/declance.c b/drivers/net/ethernet/amd/declance.c
index 7dc508e5c72..75299f500ee 100644
--- a/drivers/net/ethernet/amd/declance.c
+++ b/drivers/net/ethernet/amd/declance.c
@@ -64,7 +64,6 @@
64#include <linux/types.h> 64#include <linux/types.h>
65 65
66#include <asm/addrspace.h> 66#include <asm/addrspace.h>
67#include <asm/system.h>
68 67
69#include <asm/dec/interrupts.h> 68#include <asm/dec/interrupts.h>
70#include <asm/dec/ioasic.h> 69#include <asm/dec/ioasic.h>
diff --git a/drivers/net/ethernet/amd/hplance.c b/drivers/net/ethernet/amd/hplance.c
index 4e2d68a4de8..8baff4e5d96 100644
--- a/drivers/net/ethernet/amd/hplance.c
+++ b/drivers/net/ethernet/amd/hplance.c
@@ -22,7 +22,6 @@
22#include <linux/etherdevice.h> 22#include <linux/etherdevice.h>
23#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24 24
25#include <asm/system.h>
26#include <asm/io.h> 25#include <asm/io.h>
27#include <asm/pgtable.h> 26#include <asm/pgtable.h>
28 27
diff --git a/drivers/net/ethernet/amd/mvme147.c b/drivers/net/ethernet/amd/mvme147.c
index 56bc47a9418..9af3c307862 100644
--- a/drivers/net/ethernet/amd/mvme147.c
+++ b/drivers/net/ethernet/amd/mvme147.c
@@ -22,7 +22,6 @@
22#include <linux/etherdevice.h> 22#include <linux/etherdevice.h>
23#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24 24
25#include <asm/system.h>
26#include <asm/io.h> 25#include <asm/io.h>
27#include <asm/pgtable.h> 26#include <asm/pgtable.h>
28#include <asm/mvme147hw.h> 27#include <asm/mvme147hw.h>
diff --git a/drivers/net/ethernet/amd/nmclan_cs.c b/drivers/net/ethernet/amd/nmclan_cs.c
index ebdb9e238a8..9f59bf63514 100644
--- a/drivers/net/ethernet/amd/nmclan_cs.c
+++ b/drivers/net/ethernet/amd/nmclan_cs.c
@@ -154,7 +154,6 @@ Include Files
154 154
155#include <asm/uaccess.h> 155#include <asm/uaccess.h>
156#include <asm/io.h> 156#include <asm/io.h>
157#include <asm/system.h>
158 157
159/* ---------------------------------------------------------------------------- 158/* ----------------------------------------------------------------------------
160Defines 159Defines
diff --git a/drivers/net/ethernet/amd/sunlance.c b/drivers/net/ethernet/amd/sunlance.c
index e3fe3504e19..d7a3533d990 100644
--- a/drivers/net/ethernet/amd/sunlance.c
+++ b/drivers/net/ethernet/amd/sunlance.c
@@ -95,7 +95,6 @@ static char lancestr[] = "LANCE";
95#include <linux/of_device.h> 95#include <linux/of_device.h>
96#include <linux/gfp.h> 96#include <linux/gfp.h>
97 97
98#include <asm/system.h>
99#include <asm/io.h> 98#include <asm/io.h>
100#include <asm/dma.h> 99#include <asm/dma.h>
101#include <asm/pgtable.h> 100#include <asm/pgtable.h>
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 7b71387cf93..4e4bb387586 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -48,7 +48,6 @@
48#include <net/checksum.h> 48#include <net/checksum.h>
49#include <net/ip.h> 49#include <net/ip.h>
50 50
51#include <asm/system.h>
52#include <linux/io.h> 51#include <linux/io.h>
53#include <asm/byteorder.h> 52#include <asm/byteorder.h>
54#include <linux/uaccess.h> 53#include <linux/uaccess.h>
diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
index 30fee428c48..b9406cbfc18 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -148,7 +148,6 @@
148#include <linux/delay.h> 148#include <linux/delay.h>
149#include <linux/gfp.h> 149#include <linux/gfp.h>
150 150
151#include <asm/system.h>
152#include <asm/io.h> 151#include <asm/io.h>
153#include <asm/irq.h> 152#include <asm/irq.h>
154#include <linux/atomic.h> 153#include <linux/atomic.h>
diff --git a/drivers/net/ethernet/cirrus/mac89x0.c b/drivers/net/ethernet/cirrus/mac89x0.c
index 932fdccc339..e285f384b09 100644
--- a/drivers/net/ethernet/cirrus/mac89x0.c
+++ b/drivers/net/ethernet/cirrus/mac89x0.c
@@ -99,7 +99,6 @@ static char *version =
99#include <linux/bitops.h> 99#include <linux/bitops.h>
100#include <linux/gfp.h> 100#include <linux/gfp.h>
101 101
102#include <asm/system.h>
103#include <asm/io.h> 102#include <asm/io.h>
104#include <asm/hwtest.h> 103#include <asm/hwtest.h>
105#include <asm/macints.h> 104#include <asm/macints.h>
diff --git a/drivers/net/ethernet/dlink/de600.c b/drivers/net/ethernet/dlink/de600.c
index 682750c052c..414f0eea104 100644
--- a/drivers/net/ethernet/dlink/de600.c
+++ b/drivers/net/ethernet/dlink/de600.c
@@ -46,7 +46,6 @@ static const char version[] = "de600.c: $Revision: 1.41-2.5 $, Bjorn Ekwall (bj
46#include <linux/interrupt.h> 46#include <linux/interrupt.h>
47#include <linux/ioport.h> 47#include <linux/ioport.h>
48#include <linux/in.h> 48#include <linux/in.h>
49#include <asm/system.h>
50#include <linux/errno.h> 49#include <linux/errno.h>
51#include <linux/init.h> 50#include <linux/init.h>
52#include <linux/delay.h> 51#include <linux/delay.h>
diff --git a/drivers/net/ethernet/dlink/de620.c b/drivers/net/ethernet/dlink/de620.c
index afc5aaac6b6..2e2bc60ee81 100644
--- a/drivers/net/ethernet/dlink/de620.c
+++ b/drivers/net/ethernet/dlink/de620.c
@@ -122,7 +122,6 @@ static const char version[] =
122#include <linux/skbuff.h> 122#include <linux/skbuff.h>
123 123
124#include <asm/io.h> 124#include <asm/io.h>
125#include <asm/system.h>
126 125
127/* Constant definitions for the DE-620 registers, commands and bits */ 126/* Constant definitions for the DE-620 registers, commands and bits */
128#include "de620.h" 127#include "de620.h"
diff --git a/drivers/net/ethernet/fujitsu/at1700.c b/drivers/net/ethernet/fujitsu/at1700.c
index 586b46fd4ee..3d94797c8f9 100644
--- a/drivers/net/ethernet/fujitsu/at1700.c
+++ b/drivers/net/ethernet/fujitsu/at1700.c
@@ -52,7 +52,6 @@
52#include <linux/crc32.h> 52#include <linux/crc32.h>
53#include <linux/bitops.h> 53#include <linux/bitops.h>
54 54
55#include <asm/system.h>
56#include <asm/io.h> 55#include <asm/io.h>
57#include <asm/dma.h> 56#include <asm/dma.h>
58 57
diff --git a/drivers/net/ethernet/fujitsu/eth16i.c b/drivers/net/ethernet/fujitsu/eth16i.c
index c3f0178fb5c..a992d1f7e0d 100644
--- a/drivers/net/ethernet/fujitsu/eth16i.c
+++ b/drivers/net/ethernet/fujitsu/eth16i.c
@@ -163,7 +163,6 @@ static char *version =
163#include <linux/jiffies.h> 163#include <linux/jiffies.h>
164#include <linux/io.h> 164#include <linux/io.h>
165 165
166#include <asm/system.h>
167#include <asm/dma.h> 166#include <asm/dma.h>
168 167
169 168
diff --git a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
index 0230319ddb5..2418faf2251 100644
--- a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
+++ b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
@@ -57,7 +57,6 @@
57 57
58#include <asm/uaccess.h> 58#include <asm/uaccess.h>
59#include <asm/io.h> 59#include <asm/io.h>
60#include <asm/system.h>
61 60
62/*====================================================================*/ 61/*====================================================================*/
63 62
diff --git a/drivers/net/ethernet/i825xx/3c507.c b/drivers/net/ethernet/i825xx/3c507.c
index ed6925f1147..e8984b05990 100644
--- a/drivers/net/ethernet/i825xx/3c507.c
+++ b/drivers/net/ethernet/i825xx/3c507.c
@@ -63,7 +63,6 @@ static const char version[] =
63 63
64#include <asm/dma.h> 64#include <asm/dma.h>
65#include <asm/io.h> 65#include <asm/io.h>
66#include <asm/system.h>
67#include <asm/uaccess.h> 66#include <asm/uaccess.h>
68 67
69/* use 0 for production, 1 for verification, 2..7 for debug */ 68/* use 0 for production, 1 for verification, 2..7 for debug */
diff --git a/drivers/net/ethernet/i825xx/3c527.c b/drivers/net/ethernet/i825xx/3c527.c
index ef43f3e951c..278e791afe0 100644
--- a/drivers/net/ethernet/i825xx/3c527.c
+++ b/drivers/net/ethernet/i825xx/3c527.c
@@ -106,7 +106,6 @@ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Procter <rnp@paradise.net.
106#include <linux/semaphore.h> 106#include <linux/semaphore.h>
107 107
108#include <asm/uaccess.h> 108#include <asm/uaccess.h>
109#include <asm/system.h>
110#include <asm/io.h> 109#include <asm/io.h>
111#include <asm/dma.h> 110#include <asm/dma.h>
112 111
diff --git a/drivers/net/ethernet/i825xx/eepro.c b/drivers/net/ethernet/i825xx/eepro.c
index 7a4ad4a0791..7f49fd54c52 100644
--- a/drivers/net/ethernet/i825xx/eepro.c
+++ b/drivers/net/ethernet/i825xx/eepro.c
@@ -148,7 +148,6 @@ static const char version[] =
148#include <linux/bitops.h> 148#include <linux/bitops.h>
149#include <linux/ethtool.h> 149#include <linux/ethtool.h>
150 150
151#include <asm/system.h>
152#include <asm/io.h> 151#include <asm/io.h>
153#include <asm/dma.h> 152#include <asm/dma.h>
154 153
diff --git a/drivers/net/ethernet/i825xx/eexpress.c b/drivers/net/ethernet/i825xx/eexpress.c
index 3fc649e54a3..cc2e66ad443 100644
--- a/drivers/net/ethernet/i825xx/eexpress.c
+++ b/drivers/net/ethernet/i825xx/eexpress.c
@@ -116,7 +116,6 @@
116#include <linux/bitops.h> 116#include <linux/bitops.h>
117#include <linux/jiffies.h> 117#include <linux/jiffies.h>
118 118
119#include <asm/system.h>
120#include <asm/io.h> 119#include <asm/io.h>
121#include <asm/irq.h> 120#include <asm/irq.h>
122 121
diff --git a/drivers/net/ethernet/i825xx/ether1.c b/drivers/net/ethernet/i825xx/ether1.c
index 406a12b4640..067db3f13e9 100644
--- a/drivers/net/ethernet/i825xx/ether1.c
+++ b/drivers/net/ethernet/i825xx/ether1.c
@@ -48,7 +48,6 @@
48#include <linux/skbuff.h> 48#include <linux/skbuff.h>
49#include <linux/bitops.h> 49#include <linux/bitops.h>
50 50
51#include <asm/system.h>
52#include <asm/io.h> 51#include <asm/io.h>
53#include <asm/dma.h> 52#include <asm/dma.h>
54#include <asm/ecard.h> 53#include <asm/ecard.h>
diff --git a/drivers/net/ethernet/i825xx/znet.c b/drivers/net/ethernet/i825xx/znet.c
index a43649735a0..bd1f1ef91e1 100644
--- a/drivers/net/ethernet/i825xx/znet.c
+++ b/drivers/net/ethernet/i825xx/znet.c
@@ -100,7 +100,6 @@
100#include <linux/if_arp.h> 100#include <linux/if_arp.h>
101#include <linux/bitops.h> 101#include <linux/bitops.h>
102 102
103#include <asm/system.h>
104#include <asm/io.h> 103#include <asm/io.h>
105#include <asm/dma.h> 104#include <asm/dma.h>
106 105
diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
index f30db1c4660..bc58f1dc22f 100644
--- a/drivers/net/ethernet/korina.c
+++ b/drivers/net/ethernet/korina.c
@@ -55,7 +55,6 @@
55#include <linux/crc32.h> 55#include <linux/crc32.h>
56 56
57#include <asm/bootinfo.h> 57#include <asm/bootinfo.h>
58#include <asm/system.h>
59#include <asm/bitops.h> 58#include <asm/bitops.h>
60#include <asm/pgtable.h> 59#include <asm/pgtable.h>
61#include <asm/io.h> 60#include <asm/io.h>
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 75af1afe46c..5e1ca0f0509 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -57,7 +57,6 @@
57#include <linux/types.h> 57#include <linux/types.h>
58#include <linux/inet_lro.h> 58#include <linux/inet_lro.h>
59#include <linux/slab.h> 59#include <linux/slab.h>
60#include <asm/system.h>
61 60
62static char mv643xx_eth_driver_name[] = "mv643xx_eth"; 61static char mv643xx_eth_driver_name[] = "mv643xx_eth";
63static char mv643xx_eth_driver_version[] = "1.4"; 62static char mv643xx_eth_driver_version[] = "1.4";
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 45a6333588e..efec6b60b32 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -43,7 +43,6 @@
43#include <linux/interrupt.h> 43#include <linux/interrupt.h>
44#include <linux/types.h> 44#include <linux/types.h>
45#include <asm/pgtable.h> 45#include <asm/pgtable.h>
46#include <asm/system.h>
47#include <asm/cacheflush.h> 46#include <asm/cacheflush.h>
48#include <linux/pxa168_eth.h> 47#include <linux/pxa168_eth.h>
49 48
diff --git a/drivers/net/ethernet/natsemi/jazzsonic.c b/drivers/net/ethernet/natsemi/jazzsonic.c
index 5b89fd377ae..95dd39ffb23 100644
--- a/drivers/net/ethernet/natsemi/jazzsonic.c
+++ b/drivers/net/ethernet/natsemi/jazzsonic.c
@@ -38,7 +38,6 @@
38#include <linux/slab.h> 38#include <linux/slab.h>
39 39
40#include <asm/bootinfo.h> 40#include <asm/bootinfo.h>
41#include <asm/system.h>
42#include <asm/pgtable.h> 41#include <asm/pgtable.h>
43#include <asm/io.h> 42#include <asm/io.h>
44#include <asm/dma.h> 43#include <asm/dma.h>
diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c
index e640e23460d..b9680ba5a32 100644
--- a/drivers/net/ethernet/natsemi/macsonic.c
+++ b/drivers/net/ethernet/natsemi/macsonic.c
@@ -53,7 +53,6 @@
53#include <linux/slab.h> 53#include <linux/slab.h>
54 54
55#include <asm/bootinfo.h> 55#include <asm/bootinfo.h>
56#include <asm/system.h>
57#include <asm/pgtable.h> 56#include <asm/pgtable.h>
58#include <asm/io.h> 57#include <asm/io.h>
59#include <asm/hwtest.h> 58#include <asm/hwtest.h>
diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c
index c24b46cbfe2..d52728b3c43 100644
--- a/drivers/net/ethernet/natsemi/ns83820.c
+++ b/drivers/net/ethernet/natsemi/ns83820.c
@@ -121,7 +121,6 @@
121 121
122#include <asm/io.h> 122#include <asm/io.h>
123#include <asm/uaccess.h> 123#include <asm/uaccess.h>
124#include <asm/system.h>
125 124
126#define DRV_NAME "ns83820" 125#define DRV_NAME "ns83820"
127 126
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
index 22a8de00bf0..6338ef8606a 100644
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -81,7 +81,6 @@
81#include <linux/prefetch.h> 81#include <linux/prefetch.h>
82#include <net/tcp.h> 82#include <net/tcp.h>
83 83
84#include <asm/system.h>
85#include <asm/div64.h> 84#include <asm/div64.h>
86#include <asm/irq.h> 85#include <asm/irq.h>
87 86
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 8561dd25db6..aca13046e43 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -69,7 +69,6 @@
69#include <linux/io.h> 69#include <linux/io.h>
70 70
71#include <asm/irq.h> 71#include <asm/irq.h>
72#include <asm/system.h>
73 72
74#define TX_WORK_PER_LOOP 64 73#define TX_WORK_PER_LOOP 64
75#define RX_WORK_PER_LOOP 64 74#define RX_WORK_PER_LOOP 64
diff --git a/drivers/net/ethernet/realtek/atp.c b/drivers/net/ethernet/realtek/atp.c
index 46c1932048c..e02f04d7f3a 100644
--- a/drivers/net/ethernet/realtek/atp.c
+++ b/drivers/net/ethernet/realtek/atp.c
@@ -140,7 +140,6 @@ static int xcvr[NUM_UNITS]; /* The data transfer mode. */
140#include <linux/delay.h> 140#include <linux/delay.h>
141#include <linux/bitops.h> 141#include <linux/bitops.h>
142 142
143#include <asm/system.h>
144#include <asm/io.h> 143#include <asm/io.h>
145#include <asm/dma.h> 144#include <asm/dma.h>
146 145
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 27c358c8f4d..7b23554f80b 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -29,7 +29,6 @@
29#include <linux/pci-aspm.h> 29#include <linux/pci-aspm.h>
30#include <linux/prefetch.h> 30#include <linux/prefetch.h>
31 31
32#include <asm/system.h>
33#include <asm/io.h> 32#include <asm/io.h>
34#include <asm/irq.h> 33#include <asm/irq.h>
35 34
diff --git a/drivers/net/ethernet/seeq/ether3.c b/drivers/net/ethernet/seeq/ether3.c
index 7b819bd8c41..df808ac8cb6 100644
--- a/drivers/net/ethernet/seeq/ether3.c
+++ b/drivers/net/ethernet/seeq/ether3.c
@@ -64,7 +64,6 @@
64#include <linux/delay.h> 64#include <linux/delay.h>
65#include <linux/bitops.h> 65#include <linux/bitops.h>
66 66
67#include <asm/system.h>
68#include <asm/ecard.h> 67#include <asm/ecard.h>
69#include <asm/io.h> 68#include <asm/io.h>
70 69
diff --git a/drivers/net/ethernet/seeq/seeq8005.c b/drivers/net/ethernet/seeq/seeq8005.c
index 79899077444..698edbbfc14 100644
--- a/drivers/net/ethernet/seeq/seeq8005.c
+++ b/drivers/net/ethernet/seeq/seeq8005.c
@@ -47,7 +47,6 @@ static const char version[] =
47#include <linux/bitops.h> 47#include <linux/bitops.h>
48#include <linux/jiffies.h> 48#include <linux/jiffies.h>
49 49
50#include <asm/system.h>
51#include <asm/io.h> 50#include <asm/io.h>
52#include <asm/dma.h> 51#include <asm/dma.h>
53 52
diff --git a/drivers/net/ethernet/smsc/smc91c92_cs.c b/drivers/net/ethernet/smsc/smc91c92_cs.c
index d12e48a7861..04393b5fef7 100644
--- a/drivers/net/ethernet/smsc/smc91c92_cs.c
+++ b/drivers/net/ethernet/smsc/smc91c92_cs.c
@@ -53,7 +53,6 @@
53#include <pcmcia/ss.h> 53#include <pcmcia/ss.h>
54 54
55#include <asm/io.h> 55#include <asm/io.h>
56#include <asm/system.h>
57#include <asm/uaccess.h> 56#include <asm/uaccess.h>
58 57
59/*====================================================================*/ 58/*====================================================================*/
diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
index 3c229556073..ce4df61b4b5 100644
--- a/drivers/net/ethernet/sun/cassini.c
+++ b/drivers/net/ethernet/sun/cassini.c
@@ -99,7 +99,6 @@
99#include <net/checksum.h> 99#include <net/checksum.h>
100 100
101#include <linux/atomic.h> 101#include <linux/atomic.h>
102#include <asm/system.h>
103#include <asm/io.h> 102#include <asm/io.h>
104#include <asm/byteorder.h> 103#include <asm/byteorder.h>
105#include <asm/uaccess.h> 104#include <asm/uaccess.h>
diff --git a/drivers/net/ethernet/sun/sunbmac.c b/drivers/net/ethernet/sun/sunbmac.c
index f359863b534..2a83fc57edb 100644
--- a/drivers/net/ethernet/sun/sunbmac.c
+++ b/drivers/net/ethernet/sun/sunbmac.c
@@ -35,7 +35,6 @@
35#include <asm/openprom.h> 35#include <asm/openprom.h>
36#include <asm/oplib.h> 36#include <asm/oplib.h>
37#include <asm/pgtable.h> 37#include <asm/pgtable.h>
38#include <asm/system.h>
39 38
40#include "sunbmac.h" 39#include "sunbmac.h"
41 40
diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
index ba041596e04..558409ff405 100644
--- a/drivers/net/ethernet/sun/sungem.c
+++ b/drivers/net/ethernet/sun/sungem.c
@@ -41,7 +41,6 @@
41#include <linux/mm.h> 41#include <linux/mm.h>
42#include <linux/gfp.h> 42#include <linux/gfp.h>
43 43
44#include <asm/system.h>
45#include <asm/io.h> 44#include <asm/io.h>
46#include <asm/byteorder.h> 45#include <asm/byteorder.h>
47#include <asm/uaccess.h> 46#include <asm/uaccess.h>
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index 8b627e2f798..b95e7e681b3 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -36,7 +36,6 @@
36#include <linux/bitops.h> 36#include <linux/bitops.h>
37#include <linux/dma-mapping.h> 37#include <linux/dma-mapping.h>
38 38
39#include <asm/system.h>
40#include <asm/io.h> 39#include <asm/io.h>
41#include <asm/dma.h> 40#include <asm/dma.h>
42#include <asm/byteorder.h> 41#include <asm/byteorder.h>
diff --git a/drivers/net/ethernet/sun/sunqe.c b/drivers/net/ethernet/sun/sunqe.c
index 139d6b410d6..7d4a040d84a 100644
--- a/drivers/net/ethernet/sun/sunqe.c
+++ b/drivers/net/ethernet/sun/sunqe.c
@@ -28,7 +28,6 @@
28#include <linux/of.h> 28#include <linux/of.h>
29#include <linux/of_device.h> 29#include <linux/of_device.h>
30 30
31#include <asm/system.h>
32#include <asm/io.h> 31#include <asm/io.h>
33#include <asm/dma.h> 32#include <asm/dma.h>
34#include <asm/byteorder.h> 33#include <asm/byteorder.h>
diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c
index 840e0e9031f..277c93e9ff4 100644
--- a/drivers/net/ethernet/tundra/tsi108_eth.c
+++ b/drivers/net/ethernet/tundra/tsi108_eth.c
@@ -50,7 +50,6 @@
50#include <linux/platform_device.h> 50#include <linux/platform_device.h>
51#include <linux/gfp.h> 51#include <linux/gfp.h>
52 52
53#include <asm/system.h>
54#include <asm/io.h> 53#include <asm/io.h>
55#include <asm/tsi108.h> 54#include <asm/tsi108.h>
56 55
diff --git a/drivers/net/ethernet/xircom/xirc2ps_cs.c b/drivers/net/ethernet/xircom/xirc2ps_cs.c
index 5c69c6f93fb..94a1f94f74b 100644
--- a/drivers/net/ethernet/xircom/xirc2ps_cs.c
+++ b/drivers/net/ethernet/xircom/xirc2ps_cs.c
@@ -89,7 +89,6 @@
89#include <pcmcia/ciscode.h> 89#include <pcmcia/ciscode.h>
90 90
91#include <asm/io.h> 91#include <asm/io.h>
92#include <asm/system.h>
93#include <asm/uaccess.h> 92#include <asm/uaccess.h>
94 93
95#ifndef MANFID_COMPAQ 94#ifndef MANFID_COMPAQ
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index 2a5a34d2d67..64783a0d545 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -13,7 +13,6 @@
13 */ 13 */
14 14
15#include <linux/module.h> 15#include <linux/module.h>
16#include <asm/system.h>
17#include <asm/uaccess.h> 16#include <asm/uaccess.h>
18#include <linux/bitops.h> 17#include <linux/bitops.h>
19#include <linux/string.h> 18#include <linux/string.h>
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c
index f1aea0c9833..acb636963e9 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -86,7 +86,6 @@
86#include <linux/bitops.h> 86#include <linux/bitops.h>
87#include <linux/jiffies.h> 87#include <linux/jiffies.h>
88 88
89#include <asm/system.h>
90#include <asm/uaccess.h> 89#include <asm/uaccess.h>
91 90
92/* --------------------------------------------------------------------- */ 91/* --------------------------------------------------------------------- */
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index 18d8affecd1..76d54774ba8 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -69,7 +69,6 @@
69#include <linux/if_arp.h> 69#include <linux/if_arp.h>
70#include <linux/skbuff.h> 70#include <linux/skbuff.h>
71#include <net/sock.h> 71#include <net/sock.h>
72#include <asm/system.h>
73#include <asm/uaccess.h> 72#include <asm/uaccess.h>
74#include <linux/mm.h> 73#include <linux/mm.h>
75#include <linux/interrupt.h> 74#include <linux/interrupt.h>
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index bc02968cee1..aed1a6105b2 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -17,7 +17,6 @@
17 * Copyright (C) 2004, 05 Thomas Osterried DL9SAU <thomas@x-berg.in-berlin.de> 17 * Copyright (C) 2004, 05 Thomas Osterried DL9SAU <thomas@x-berg.in-berlin.de>
18 */ 18 */
19#include <linux/module.h> 19#include <linux/module.h>
20#include <asm/system.h>
21#include <linux/bitops.h> 20#include <linux/bitops.h>
22#include <asm/uaccess.h> 21#include <asm/uaccess.h>
23#include <linux/crc16.h> 22#include <linux/crc16.h>
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index 33655814448..efc6c97163a 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -177,7 +177,6 @@
177#include <net/ax25.h> 177#include <net/ax25.h>
178 178
179#include <asm/irq.h> 179#include <asm/irq.h>
180#include <asm/system.h>
181#include <asm/io.h> 180#include <asm/io.h>
182#include <asm/uaccess.h> 181#include <asm/uaccess.h>
183 182
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 696327773fb..5a6412ecce7 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -52,7 +52,6 @@
52#include <linux/bitops.h> 52#include <linux/bitops.h>
53#include <linux/random.h> 53#include <linux/random.h>
54#include <asm/io.h> 54#include <asm/io.h>
55#include <asm/system.h>
56#include <linux/interrupt.h> 55#include <linux/interrupt.h>
57#include <linux/ioport.h> 56#include <linux/ioport.h>
58#include <linux/firmware.h> 57#include <linux/firmware.h>
diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
index 2a51363d9fe..168c8f41d09 100644
--- a/drivers/net/hippi/rrunner.c
+++ b/drivers/net/hippi/rrunner.c
@@ -43,7 +43,6 @@
43#include <linux/slab.h> 43#include <linux/slab.h>
44#include <net/sock.h> 44#include <net/sock.h>
45 45
46#include <asm/system.h>
47#include <asm/cache.h> 46#include <asm/cache.h>
48#include <asm/byteorder.h> 47#include <asm/byteorder.h>
49#include <asm/io.h> 48#include <asm/io.h>
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index 617a446d126..4351296dde3 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -156,7 +156,6 @@
156#include <linux/pci.h> 156#include <linux/pci.h>
157#include <linux/rtnetlink.h> 157#include <linux/rtnetlink.h>
158 158
159#include <asm/system.h>
160#include <asm/io.h> 159#include <asm/io.h>
161 160
162#include <net/irda/wrapper.h> 161#include <net/irda/wrapper.h>
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index b71998d0b5b..32eb94ece6c 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -41,7 +41,6 @@
41#include <linux/in.h> 41#include <linux/in.h>
42#include <linux/init.h> 42#include <linux/init.h>
43 43
44#include <asm/system.h>
45#include <asm/uaccess.h> 44#include <asm/uaccess.h>
46#include <asm/io.h> 45#include <asm/io.h>
47 46
diff --git a/drivers/net/plip/plip.c b/drivers/net/plip/plip.c
index 1a5a316cc96..bed62d9c53c 100644
--- a/drivers/net/plip/plip.c
+++ b/drivers/net/plip/plip.c
@@ -113,7 +113,6 @@ static const char version[] = "NET3 PLIP version 2.4-parport gniibe@mri.co.jp\n"
113 113
114#include <net/neighbour.h> 114#include <net/neighbour.h>
115 115
116#include <asm/system.h>
117#include <asm/irq.h> 116#include <asm/irq.h>
118#include <asm/byteorder.h> 117#include <asm/byteorder.h>
119 118
diff --git a/drivers/net/slip/slhc.c b/drivers/net/slip/slhc.c
index 0a0a6643cf3..1252d9c726a 100644
--- a/drivers/net/slip/slhc.c
+++ b/drivers/net/slip/slhc.c
@@ -75,7 +75,6 @@
75#include <linux/skbuff.h> 75#include <linux/skbuff.h>
76#include <net/sock.h> 76#include <net/sock.h>
77#include <linux/timer.h> 77#include <linux/timer.h>
78#include <asm/system.h>
79#include <asm/uaccess.h> 78#include <asm/uaccess.h>
80#include <net/checksum.h> 79#include <net/checksum.h>
81#include <asm/unaligned.h> 80#include <asm/unaligned.h>
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index 69345dfae0f..d4c9db3da22 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -64,7 +64,6 @@
64#include <linux/module.h> 64#include <linux/module.h>
65#include <linux/moduleparam.h> 65#include <linux/moduleparam.h>
66 66
67#include <asm/system.h>
68#include <asm/uaccess.h> 67#include <asm/uaccess.h>
69#include <linux/bitops.h> 68#include <linux/bitops.h>
70#include <linux/sched.h> 69#include <linux/sched.h>
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c
index d7c292aa76b..b15ac81d46f 100644
--- a/drivers/net/tokenring/3c359.c
+++ b/drivers/net/tokenring/3c359.c
@@ -68,7 +68,6 @@
68#include <net/checksum.h> 68#include <net/checksum.h>
69 69
70#include <asm/io.h> 70#include <asm/io.h>
71#include <asm/system.h>
72 71
73#include "3c359.h" 72#include "3c359.h"
74 73
diff --git a/drivers/net/tokenring/abyss.c b/drivers/net/tokenring/abyss.c
index 515f122777a..b715e6b444d 100644
--- a/drivers/net/tokenring/abyss.c
+++ b/drivers/net/tokenring/abyss.c
@@ -33,7 +33,6 @@
33#include <linux/netdevice.h> 33#include <linux/netdevice.h>
34#include <linux/trdevice.h> 34#include <linux/trdevice.h>
35 35
36#include <asm/system.h>
37#include <asm/io.h> 36#include <asm/io.h>
38#include <asm/irq.h> 37#include <asm/irq.h>
39 38
diff --git a/drivers/net/tokenring/ibmtr_cs.c b/drivers/net/tokenring/ibmtr_cs.c
index 91b684630fc..356e28e4881 100644
--- a/drivers/net/tokenring/ibmtr_cs.c
+++ b/drivers/net/tokenring/ibmtr_cs.c
@@ -63,7 +63,6 @@
63 63
64#include <asm/uaccess.h> 64#include <asm/uaccess.h>
65#include <asm/io.h> 65#include <asm/io.h>
66#include <asm/system.h>
67 66
68#define PCMCIA 67#define PCMCIA
69#include "ibmtr.c" 68#include "ibmtr.c"
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c
index 8d71e0d2906..3e4b4f09111 100644
--- a/drivers/net/tokenring/lanstreamer.c
+++ b/drivers/net/tokenring/lanstreamer.c
@@ -127,7 +127,6 @@
127#include <net/checksum.h> 127#include <net/checksum.h>
128 128
129#include <asm/io.h> 129#include <asm/io.h>
130#include <asm/system.h>
131 130
132#include "lanstreamer.h" 131#include "lanstreamer.h"
133 132
diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c
index 1cdc034f6ae..28adcdf3b14 100644
--- a/drivers/net/tokenring/madgemc.c
+++ b/drivers/net/tokenring/madgemc.c
@@ -28,7 +28,6 @@ static const char version[] = "madgemc.c: v0.91 23/01/2000 by Adam Fritzler\n";
28#include <linux/netdevice.h> 28#include <linux/netdevice.h>
29#include <linux/trdevice.h> 29#include <linux/trdevice.h>
30 30
31#include <asm/system.h>
32#include <asm/io.h> 31#include <asm/io.h>
33#include <asm/irq.h> 32#include <asm/irq.h>
34 33
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index fd8dce90c95..0e234741cc7 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -106,7 +106,6 @@
106#include <net/net_namespace.h> 106#include <net/net_namespace.h>
107 107
108#include <asm/io.h> 108#include <asm/io.h>
109#include <asm/system.h>
110 109
111#include "olympic.h" 110#include "olympic.h"
112 111
diff --git a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c
index 8d362e64a40..62d90e40f9e 100644
--- a/drivers/net/tokenring/proteon.c
+++ b/drivers/net/tokenring/proteon.c
@@ -31,7 +31,6 @@ static const char version[] = "proteon.c: v1.00 02/01/2003 by Jochen Friedrich\n
31#include <linux/trdevice.h> 31#include <linux/trdevice.h>
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33 33
34#include <asm/system.h>
35#include <asm/io.h> 34#include <asm/io.h>
36#include <asm/irq.h> 35#include <asm/irq.h>
37#include <asm/pci.h> 36#include <asm/pci.h>
diff --git a/drivers/net/tokenring/skisa.c b/drivers/net/tokenring/skisa.c
index 46db5c5395b..ee11e93dc30 100644
--- a/drivers/net/tokenring/skisa.c
+++ b/drivers/net/tokenring/skisa.c
@@ -38,7 +38,6 @@ static const char version[] = "skisa.c: v1.03 09/12/2002 by Jochen Friedrich\n";
38#include <linux/trdevice.h> 38#include <linux/trdevice.h>
39#include <linux/platform_device.h> 39#include <linux/platform_device.h>
40 40
41#include <asm/system.h>
42#include <asm/io.h> 41#include <asm/io.h>
43#include <asm/irq.h> 42#include <asm/irq.h>
44#include <asm/pci.h> 43#include <asm/pci.h>
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index 029846a9863..cb35fb79e01 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -49,7 +49,6 @@
49#include <linux/bitops.h> 49#include <linux/bitops.h>
50#include <linux/firmware.h> 50#include <linux/firmware.h>
51 51
52#include <asm/system.h>
53#include <asm/io.h> 52#include <asm/io.h>
54#include <asm/dma.h> 53#include <asm/dma.h>
55#include <asm/irq.h> 54#include <asm/irq.h>
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index 102f896bbc5..be4813e0366 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -98,7 +98,6 @@ static const char version[] = "tms380tr.c: v1.10 30/12/2002 by Christoph Goos, A
98#include <linux/firmware.h> 98#include <linux/firmware.h>
99#include <linux/bitops.h> 99#include <linux/bitops.h>
100 100
101#include <asm/system.h>
102#include <asm/io.h> 101#include <asm/io.h>
103#include <asm/dma.h> 102#include <asm/dma.h>
104#include <asm/irq.h> 103#include <asm/irq.h>
diff --git a/drivers/net/tokenring/tmspci.c b/drivers/net/tokenring/tmspci.c
index d3e788a9cd1..fb9918da579 100644
--- a/drivers/net/tokenring/tmspci.c
+++ b/drivers/net/tokenring/tmspci.c
@@ -34,7 +34,6 @@
34#include <linux/netdevice.h> 34#include <linux/netdevice.h>
35#include <linux/trdevice.h> 35#include <linux/trdevice.h>
36 36
37#include <asm/system.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/irq.h> 38#include <asm/irq.h>
40 39
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 74d7f76d14a..bb8c72c79c6 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -69,7 +69,6 @@
69#include <net/rtnetlink.h> 69#include <net/rtnetlink.h>
70#include <net/sock.h> 70#include <net/sock.h>
71 71
72#include <asm/system.h>
73#include <asm/uaccess.h> 72#include <asm/uaccess.h>
74 73
75/* Uncomment to enable debugging */ 74/* Uncomment to enable debugging */
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c
index 48ab38a34c5..147614ed86a 100644
--- a/drivers/net/wan/dlci.c
+++ b/drivers/net/wan/dlci.c
@@ -50,7 +50,6 @@
50 50
51#include <net/sock.h> 51#include <net/sock.h>
52 52
53#include <asm/system.h>
54#include <asm/io.h> 53#include <asm/io.h>
55#include <asm/dma.h> 54#include <asm/dma.h>
56#include <asm/uaccess.h> 55#include <asm/uaccess.h>
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index fe8d060d8ff..c676de7de02 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -93,7 +93,6 @@
93#include <linux/mm.h> 93#include <linux/mm.h>
94#include <linux/slab.h> 94#include <linux/slab.h>
95 95
96#include <asm/system.h>
97#include <asm/cache.h> 96#include <asm/cache.h>
98#include <asm/byteorder.h> 97#include <asm/byteorder.h>
99#include <asm/uaccess.h> 98#include <asm/uaccess.h>
diff --git a/drivers/net/wan/hd64570.c b/drivers/net/wan/hd64570.c
index 33b67d88fce..cf4903355a3 100644
--- a/drivers/net/wan/hd64570.c
+++ b/drivers/net/wan/hd64570.c
@@ -40,7 +40,6 @@
40#include <linux/string.h> 40#include <linux/string.h>
41#include <linux/types.h> 41#include <linux/types.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/system.h>
44#include <asm/uaccess.h> 43#include <asm/uaccess.h>
45#include "hd64570.h" 44#include "hd64570.h"
46 45
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c
index efc0db10118..e2779faa6c4 100644
--- a/drivers/net/wan/hd64572.c
+++ b/drivers/net/wan/hd64572.c
@@ -40,7 +40,6 @@
40#include <linux/string.h> 40#include <linux/string.h>
41#include <linux/types.h> 41#include <linux/types.h>
42#include <asm/io.h> 42#include <asm/io.h>
43#include <asm/system.h>
44#include <asm/uaccess.h> 43#include <asm/uaccess.h>
45#include "hd64572.h" 44#include "hd64572.h"
46 45
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index 7beeb9b88a3..a73b49eb87e 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -35,7 +35,6 @@
35#include <linux/if_arp.h> 35#include <linux/if_arp.h>
36#include <linux/skbuff.h> 36#include <linux/skbuff.h>
37#include <net/sock.h> 37#include <net/sock.h>
38#include <asm/system.h>
39#include <asm/uaccess.h> 38#include <asm/uaccess.h>
40#include <linux/mm.h> 39#include <linux/mm.h>
41#include <linux/interrupt.h> 40#include <linux/interrupt.h>
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
index c8531612eea..de3bbf43fc5 100644
--- a/drivers/net/wan/sdla.c
+++ b/drivers/net/wan/sdla.c
@@ -54,7 +54,6 @@
54#include <linux/sdla.h> 54#include <linux/sdla.h>
55#include <linux/bitops.h> 55#include <linux/bitops.h>
56 56
57#include <asm/system.h>
58#include <asm/io.h> 57#include <asm/io.h>
59#include <asm/dma.h> 58#include <asm/dma.h>
60#include <asm/uaccess.h> 59#include <asm/uaccess.h>
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index e862369b4a6..d7a65e141d1 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -18,7 +18,6 @@
18 18
19#include <linux/module.h> 19#include <linux/module.h>
20 20
21#include <asm/system.h>
22#include <linux/uaccess.h> 21#include <linux/uaccess.h>
23#include <linux/bitops.h> 22#include <linux/bitops.h>
24#include <linux/string.h> 23#include <linux/string.h>
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index ddc061dd150..520a4b2eb9c 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -37,7 +37,6 @@
37#include <linux/scatterlist.h> 37#include <linux/scatterlist.h>
38#include <linux/crypto.h> 38#include <linux/crypto.h>
39#include <asm/io.h> 39#include <asm/io.h>
40#include <asm/system.h>
41#include <asm/unaligned.h> 40#include <asm/unaligned.h>
42 41
43#include <linux/netdevice.h> 42#include <linux/netdevice.h>
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index c983c10e0f6..630577dd3a7 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -37,7 +37,6 @@
37#include <pcmcia/ds.h> 37#include <pcmcia/ds.h>
38 38
39#include <linux/io.h> 39#include <linux/io.h>
40#include <asm/system.h>
41 40
42#include "airo.h" 41#include "airo.h"
43 42
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index 3010cee7b95..6c87a823f5a 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -50,7 +50,6 @@
50#include <linux/timer.h> 50#include <linux/timer.h>
51#include <asm/byteorder.h> 51#include <asm/byteorder.h>
52#include <asm/io.h> 52#include <asm/io.h>
53#include <asm/system.h>
54#include <asm/uaccess.h> 53#include <asm/uaccess.h>
55#include <linux/module.h> 54#include <linux/module.h>
56#include <linux/netdevice.h> 55#include <linux/netdevice.h>
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index ec295c4f677..ded03d226a7 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -48,7 +48,6 @@
48#include <pcmcia/ciscode.h> 48#include <pcmcia/ciscode.h>
49 49
50#include <asm/io.h> 50#include <asm/io.h>
51#include <asm/system.h>
52#include <linux/wireless.h> 51#include <linux/wireless.h>
53 52
54#include "atmel.h" 53#include "atmel.h"
diff --git a/drivers/net/wireless/prism54/islpci_mgt.c b/drivers/net/wireless/prism54/islpci_mgt.c
index 851fa10241e..c5404cb59e0 100644
--- a/drivers/net/wireless/prism54/islpci_mgt.c
+++ b/drivers/net/wireless/prism54/islpci_mgt.c
@@ -24,7 +24,6 @@
24#include <linux/slab.h> 24#include <linux/slab.h>
25 25
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/system.h>
28#include <linux/if_arp.h> 27#include <linux/if_arp.h>
29 28
30#include "prismcompat.h" 29#include "prismcompat.h"
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 04fec1fa6e0..86a738bf591 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -53,7 +53,6 @@
53#include <net/iw_handler.h> 53#include <net/iw_handler.h>
54 54
55#include <asm/io.h> 55#include <asm/io.h>
56#include <asm/system.h>
57#include <asm/byteorder.h> 56#include <asm/byteorder.h>
58#include <asm/uaccess.h> 57#include <asm/uaccess.h>
59 58
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 98fbf54f600..00f6e69c1dc 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -53,7 +53,6 @@
53 53
54#include <asm/io.h> 54#include <asm/io.h>
55#include <asm/uaccess.h> 55#include <asm/uaccess.h>
56#include <asm/system.h>
57 56
58#include "wl3501.h" 57#include "wl3501.h"
59 58
diff --git a/drivers/nubus/nubus.c b/drivers/nubus/nubus.c
index b764ac22d52..44d01afafe9 100644
--- a/drivers/nubus/nubus.c
+++ b/drivers/nubus/nubus.c
@@ -17,7 +17,6 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <asm/setup.h> 19#include <asm/setup.h>
20#include <asm/system.h>
21#include <asm/page.h> 20#include <asm/page.h>
22#include <asm/hwtest.h> 21#include <asm/hwtest.h>
23#include <linux/proc_fs.h> 22#include <linux/proc_fs.h>
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index 0610e91bceb..432d4bbcc62 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -55,7 +55,6 @@
55 55
56#include <asm/pdc.h> 56#include <asm/pdc.h>
57#include <asm/page.h> 57#include <asm/page.h>
58#include <asm/system.h>
59#include <asm/io.h> 58#include <asm/io.h>
60#include <asm/hardware.h> 59#include <asm/hardware.h>
61 60
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c
index 95930d01623..1f9e9fefb8e 100644
--- a/drivers/parisc/iosapic.c
+++ b/drivers/parisc/iosapic.c
@@ -140,7 +140,6 @@
140#include <asm/pdc.h> 140#include <asm/pdc.h>
141#include <asm/pdcpat.h> 141#include <asm/pdcpat.h>
142#include <asm/page.h> 142#include <asm/page.h>
143#include <asm/system.h>
144#include <asm/io.h> /* read/write functions */ 143#include <asm/io.h> /* read/write functions */
145#ifdef CONFIG_SUPERIO 144#ifdef CONFIG_SUPERIO
146#include <asm/superio.h> 145#include <asm/superio.h>
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index e8857647e21..052fa230bc7 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -43,7 +43,6 @@
43#include <asm/pdc.h> 43#include <asm/pdc.h>
44#include <asm/pdcpat.h> 44#include <asm/pdcpat.h>
45#include <asm/page.h> 45#include <asm/page.h>
46#include <asm/system.h>
47 46
48#include <asm/ropes.h> 47#include <asm/ropes.h>
49#include <asm/hardware.h> /* for register_parisc_driver() stuff */ 48#include <asm/hardware.h> /* for register_parisc_driver() stuff */
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index d9ea192c400..673c14ea11e 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -29,7 +29,6 @@
29#include <linux/device.h> 29#include <linux/device.h>
30#include <linux/kthread.h> 30#include <linux/kthread.h>
31#include <linux/freezer.h> 31#include <linux/freezer.h>
32#include <asm/system.h>
33#include <asm/irq.h> 32#include <asm/irq.h>
34 33
35#include <pcmcia/ss.h> 34#include <pcmcia/ss.h>
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index 3e447d0387b..0b66bfc0e14 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -17,7 +17,6 @@
17 17
18#include <pcmcia/ss.h> 18#include <pcmcia/ss.h>
19 19
20#include <asm/system.h>
21#include <asm/io.h> 20#include <asm/io.h>
22 21
23#include "i82092aa.h" 22#include "i82092aa.h"
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index 72a033a2acd..e6f3d17dd2b 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -48,7 +48,6 @@
48#include <linux/bitops.h> 48#include <linux/bitops.h>
49#include <asm/irq.h> 49#include <asm/irq.h>
50#include <asm/io.h> 50#include <asm/io.h>
51#include <asm/system.h>
52 51
53#include <pcmcia/ss.h> 52#include <pcmcia/ss.h>
54 53
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
index 2adb0106a03..a26f38c6402 100644
--- a/drivers/pcmcia/m32r_cfc.c
+++ b/drivers/pcmcia/m32r_cfc.c
@@ -24,7 +24,6 @@
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <asm/irq.h> 25#include <asm/irq.h>
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/system.h>
28 27
29#include <pcmcia/ss.h> 28#include <pcmcia/ss.h>
30 29
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index 1511ff71c87..296514155cd 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -24,7 +24,6 @@
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <asm/irq.h> 25#include <asm/irq.h>
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/system.h>
28#include <asm/addrspace.h> 27#include <asm/addrspace.h>
29 28
30#include <pcmcia/ss.h> 29#include <pcmcia/ss.h>
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index 271a590a5f3..a317defd616 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -52,7 +52,6 @@
52#include <linux/of_platform.h> 52#include <linux/of_platform.h>
53 53
54#include <asm/io.h> 54#include <asm/io.h>
55#include <asm/system.h>
56#include <asm/time.h> 55#include <asm/time.h>
57#include <asm/mpc8xx.h> 56#include <asm/mpc8xx.h>
58#include <asm/8xx_immap.h> 57#include <asm/8xx_immap.h>
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 96c72e90b79..0f8b70b2776 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -19,7 +19,6 @@
19 19
20#include <pcmcia/ss.h> 20#include <pcmcia/ss.h>
21 21
22#include <asm/system.h>
23 22
24#include "pd6729.h" 23#include "pd6729.h"
25#include "i82365.h" 24#include "i82365.h"
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 66a54222bbf..490bb82b5bd 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -29,7 +29,6 @@
29#include <mach/smemc.h> 29#include <mach/smemc.h>
30#include <asm/io.h> 30#include <asm/io.h>
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/system.h>
33#include <mach/pxa2xx-regs.h> 32#include <mach/pxa2xx-regs.h>
34#include <asm/mach-types.h> 33#include <asm/mach-types.h>
35 34
diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c
index a3ee89a6dd0..6eecd7cddf5 100644
--- a/drivers/pcmcia/sa11xx_base.c
+++ b/drivers/pcmcia/sa11xx_base.c
@@ -41,7 +41,6 @@
41 41
42#include <mach/hardware.h> 42#include <mach/hardware.h>
43#include <asm/irq.h> 43#include <asm/irq.h>
44#include <asm/system.h>
45 44
46#include "soc_common.h" 45#include "soc_common.h"
47#include "sa11xx_base.h" 46#include "sa11xx_base.h"
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index e0433f57196..a2bc6ee1702 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -46,7 +46,6 @@
46#include <linux/timer.h> 46#include <linux/timer.h>
47 47
48#include <mach/hardware.h> 48#include <mach/hardware.h>
49#include <asm/system.h>
50 49
51#include "soc_common.h" 50#include "soc_common.h"
52 51
diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c
index 71aeed93037..d6881514d38 100644
--- a/drivers/pcmcia/socket_sysfs.c
+++ b/drivers/pcmcia/socket_sysfs.c
@@ -23,7 +23,6 @@
23#include <linux/pm.h> 23#include <linux/pm.h>
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/mutex.h> 25#include <linux/mutex.h>
26#include <asm/system.h>
27#include <asm/irq.h> 26#include <asm/irq.h>
28 27
29#include <pcmcia/ss.h> 28#include <pcmcia/ss.h>
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index 310160bffe3..cbe15fc3741 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -47,7 +47,6 @@
47#include <linux/bitops.h> 47#include <linux/bitops.h>
48 48
49#include <asm/io.h> 49#include <asm/io.h>
50#include <asm/system.h>
51 50
52#include <pcmcia/ss.h> 51#include <pcmcia/ss.h>
53#include "tcic.h" 52#include "tcic.h"
diff --git a/drivers/pcmcia/xxs1500_ss.c b/drivers/pcmcia/xxs1500_ss.c
index 379f4218857..8f6698074f8 100644
--- a/drivers/pcmcia/xxs1500_ss.c
+++ b/drivers/pcmcia/xxs1500_ss.c
@@ -21,7 +21,6 @@
21#include <pcmcia/cistpl.h> 21#include <pcmcia/cistpl.h>
22 22
23#include <asm/irq.h> 23#include <asm/irq.h>
24#include <asm/system.h>
25#include <asm/mach-au1x00/au1000.h> 24#include <asm/mach-au1x00/au1000.h>
26 25
27#define MEM_MAP_SIZE 0x400000 26#define MEM_MAP_SIZE 0x400000
diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
index b859d16cf78..769d265b221 100644
--- a/drivers/pnp/pnpbios/bioscalls.c
+++ b/drivers/pnp/pnpbios/bioscalls.c
@@ -17,7 +17,6 @@
17 17
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/desc.h> 19#include <asm/desc.h>
20#include <asm/system.h>
21#include <asm/byteorder.h> 20#include <asm/byteorder.h>
22 21
23#include "pnpbios.h" 22#include "pnpbios.h"
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index cfe86853feb..9d422264864 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -65,7 +65,6 @@
65 65
66#include <asm/page.h> 66#include <asm/page.h>
67#include <asm/desc.h> 67#include <asm/desc.h>
68#include <asm/system.h>
69#include <asm/byteorder.h> 68#include <asm/byteorder.h>
70 69
71#include "../base.h" 70#include "../base.h"
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c
index 168525a9c29..231a1d85127 100644
--- a/drivers/s390/char/sclp_cmd.c
+++ b/drivers/s390/char/sclp_cmd.c
@@ -21,6 +21,7 @@
21#include <asm/chpid.h> 21#include <asm/chpid.h>
22#include <asm/sclp.h> 22#include <asm/sclp.h>
23#include <asm/setup.h> 23#include <asm/setup.h>
24#include <asm/ctl_reg.h>
24 25
25#include "sclp.h" 26#include "sclp.h"
26 27
diff --git a/drivers/s390/cio/crw.c b/drivers/s390/cio/crw.c
index 425f741a280..d0a2dff43fb 100644
--- a/drivers/s390/cio/crw.c
+++ b/drivers/s390/cio/crw.c
@@ -13,6 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/wait.h> 14#include <linux/wait.h>
15#include <asm/crw.h> 15#include <asm/crw.h>
16#include <asm/ctl_reg.h>
16 17
17static DEFINE_MUTEX(crw_handler_mutex); 18static DEFINE_MUTEX(crw_handler_mutex);
18static crw_handler_t crw_handlers[NR_RSCS]; 19static crw_handler_t crw_handlers[NR_RSCS];
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 12ae1817b17..7e9a72eb2fe 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -42,10 +42,10 @@
42#include <asm/reset.h> 42#include <asm/reset.h>
43#include <asm/airq.h> 43#include <asm/airq.h>
44#include <linux/atomic.h> 44#include <linux/atomic.h>
45#include <asm/system.h>
46#include <asm/isc.h> 45#include <asm/isc.h>
47#include <linux/hrtimer.h> 46#include <linux/hrtimer.h>
48#include <linux/ktime.h> 47#include <linux/ktime.h>
48#include <asm/facility.h>
49 49
50#include "ap_bus.h" 50#include "ap_bus.h"
51 51
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index 826157f3869..327657e2e26 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -16,7 +16,6 @@
16#include <linux/of.h> 16#include <linux/of.h>
17#include <linux/of_device.h> 17#include <linux/of_device.h>
18 18
19#include <asm/system.h>
20#include <asm/uaccess.h> 19#include <asm/uaccess.h>
21#include <asm/pgtable.h> 20#include <asm/pgtable.h>
22#include <asm/io.h> 21#include <asm/io.h>
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 8d6e508222b..2236aea3ca2 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -40,7 +40,6 @@
40#include <linux/fs.h> 40#include <linux/fs.h>
41#include <asm/oplib.h> 41#include <asm/oplib.h>
42#include <asm/prom.h> 42#include <asm/prom.h>
43#include <asm/system.h>
44#include <asm/uaccess.h> 43#include <asm/uaccess.h>
45#include <asm/openpromio.h> 44#include <asm/openpromio.h>
46#ifdef CONFIG_PCI 45#ifdef CONFIG_PCI
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c
index 0b31658ccde..a9e468cc1ca 100644
--- a/drivers/sbus/char/uctrl.c
+++ b/drivers/sbus/char/uctrl.c
@@ -19,7 +19,6 @@
19 19
20#include <asm/openprom.h> 20#include <asm/openprom.h>
21#include <asm/oplib.h> 21#include <asm/oplib.h>
22#include <asm/system.h>
23#include <asm/irq.h> 22#include <asm/irq.h>
24#include <asm/io.h> 23#include <asm/io.h>
25#include <asm/pgtable.h> 24#include <asm/pgtable.h>
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index f672491774e..a3adfb4357f 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -129,7 +129,6 @@
129#include <linux/interrupt.h> 129#include <linux/interrupt.h>
130#include <linux/device.h> 130#include <linux/device.h>
131#include <asm/dma.h> 131#include <asm/dma.h>
132#include <asm/system.h>
133#include <asm/io.h> 132#include <asm/io.h>
134#include <asm/pgtable.h> 133#include <asm/pgtable.h>
135#include <asm/byteorder.h> 134#include <asm/byteorder.h>
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index f66c33b9ab4..d4da3708763 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -47,7 +47,6 @@
47 47
48#include <asm/dma.h> 48#include <asm/dma.h>
49#include <asm/io.h> 49#include <asm/io.h>
50#include <asm/system.h>
51 50
52#include <scsi/scsi.h> 51#include <scsi/scsi.h>
53#include <scsi/scsi_cmnd.h> 52#include <scsi/scsi_cmnd.h>
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index bfd618a6949..374c4edf4fc 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -41,7 +41,6 @@
41#include <linux/firmware.h> 41#include <linux/firmware.h>
42 42
43#include <asm/io.h> 43#include <asm/io.h>
44#include <asm/system.h>
45#include <asm/dma.h> 44#include <asm/dma.h>
46 45
47#include <scsi/scsi_cmnd.h> 46#include <scsi/scsi_cmnd.h>
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index f17c92cf808..19a36945e6f 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -239,7 +239,6 @@
239#include <asm/irq.h> 239#include <asm/irq.h>
240#include <linux/io.h> 240#include <linux/io.h>
241#include <linux/blkdev.h> 241#include <linux/blkdev.h>
242#include <asm/system.h>
243#include <linux/completion.h> 242#include <linux/completion.h>
244#include <linux/errno.h> 243#include <linux/errno.h>
245#include <linux/string.h> 244#include <linux/string.h>
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index ed119cedaae..ede91f37800 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -42,7 +42,6 @@
42#include <linux/slab.h> 42#include <linux/slab.h>
43 43
44#include <asm/dma.h> 44#include <asm/dma.h>
45#include <asm/system.h>
46#include <asm/io.h> 45#include <asm/io.h>
47 46
48#include "scsi.h" 47#include "scsi.h"
diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
index 1c10b796c1a..a3e6ed35391 100644
--- a/drivers/scsi/aha1740.c
+++ b/drivers/scsi/aha1740.c
@@ -53,7 +53,6 @@
53#include <linux/gfp.h> 53#include <linux/gfp.h>
54 54
55#include <asm/dma.h> 55#include <asm/dma.h>
56#include <asm/system.h>
57#include <asm/io.h> 56#include <asm/io.h>
58 57
59#include "scsi.h" 58#include "scsi.h"
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 2fe9e90e53d..cbde1dca45a 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -61,7 +61,6 @@
61#include <linux/aer.h> 61#include <linux/aer.h>
62#include <asm/dma.h> 62#include <asm/dma.h>
63#include <asm/io.h> 63#include <asm/io.h>
64#include <asm/system.h>
65#include <asm/uaccess.h> 64#include <asm/uaccess.h>
66#include <scsi/scsi_host.h> 65#include <scsi/scsi_host.h>
67#include <scsi/scsi.h> 66#include <scsi/scsi.h>
diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c
index c454e44cf51..b330438ac66 100644
--- a/drivers/scsi/arm/acornscsi.c
+++ b/drivers/scsi/arm/acornscsi.c
@@ -138,7 +138,6 @@
138#include <linux/stringify.h> 138#include <linux/stringify.h>
139#include <linux/io.h> 139#include <linux/io.h>
140 140
141#include <asm/system.h>
142#include <asm/ecard.h> 141#include <asm/ecard.h>
143 142
144#include "../scsi.h" 143#include "../scsi.h"
diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c
index a3398fe70a9..c3b99c93637 100644
--- a/drivers/scsi/arm/cumana_1.c
+++ b/drivers/scsi/arm/cumana_1.c
@@ -12,7 +12,6 @@
12 12
13#include <asm/ecard.h> 13#include <asm/ecard.h>
14#include <asm/io.h> 14#include <asm/io.h>
15#include <asm/system.h>
16 15
17#include "../scsi.h" 16#include "../scsi.h"
18#include <scsi/scsi_host.h> 17#include <scsi/scsi_host.h>
diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c
index 849cdf89f7b..d25f944b59c 100644
--- a/drivers/scsi/arm/oak.c
+++ b/drivers/scsi/arm/oak.c
@@ -13,7 +13,6 @@
13 13
14#include <asm/ecard.h> 14#include <asm/ecard.h>
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/system.h>
17 16
18#include "../scsi.h" 17#include "../scsi.h"
19#include <scsi/scsi_host.h> 18#include <scsi/scsi_host.h>
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index 7e6eca4a125..f29d5121d5e 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -30,7 +30,6 @@
30#include <linux/blkdev.h> 30#include <linux/blkdev.h>
31#include <linux/dma-mapping.h> 31#include <linux/dma-mapping.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <asm/system.h>
34#include <asm/io.h> 33#include <asm/io.h>
35 34
36#include <scsi/scsi.h> 35#include <scsi/scsi.h>
diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c
index c2677ba29c7..4b11bb04f5c 100644
--- a/drivers/scsi/dtc.c
+++ b/drivers/scsi/dtc.c
@@ -72,7 +72,6 @@
72#endif 72#endif
73 73
74 74
75#include <asm/system.h>
76#include <linux/module.h> 75#include <linux/module.h>
77#include <linux/signal.h> 76#include <linux/signal.h>
78#include <linux/blkdev.h> 77#include <linux/blkdev.h>
diff --git a/drivers/scsi/fd_mcs.c b/drivers/scsi/fd_mcs.c
index a2c6135d337..53bfcaa86f0 100644
--- a/drivers/scsi/fd_mcs.c
+++ b/drivers/scsi/fd_mcs.c
@@ -93,7 +93,6 @@
93#include <linux/mca-legacy.h> 93#include <linux/mca-legacy.h>
94 94
95#include <asm/io.h> 95#include <asm/io.h>
96#include <asm/system.h>
97 96
98#include "scsi.h" 97#include "scsi.h"
99#include <scsi/scsi_host.h> 98#include <scsi/scsi_host.h>
diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c
index 643f6d500fe..1a2a1e5824e 100644
--- a/drivers/scsi/fdomain.c
+++ b/drivers/scsi/fdomain.c
@@ -282,7 +282,6 @@
282#include <linux/slab.h> 282#include <linux/slab.h>
283#include <scsi/scsicam.h> 283#include <scsi/scsicam.h>
284 284
285#include <asm/system.h>
286 285
287#include <scsi/scsi.h> 286#include <scsi/scsi.h>
288#include <scsi/scsi_cmnd.h> 287#include <scsi/scsi_cmnd.h>
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index 81182badfeb..1a5954f0915 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -100,7 +100,6 @@
100#undef NCR5380_STAT_LIMIT 100#undef NCR5380_STAT_LIMIT
101#endif 101#endif
102 102
103#include <asm/system.h>
104#include <asm/io.h> 103#include <asm/io.h>
105#include <linux/signal.h> 104#include <linux/signal.h>
106#include <linux/blkdev.h> 105#include <linux/blkdev.h>
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index d42ec921de4..5d72274c507 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -129,7 +129,6 @@
129#include <linux/reboot.h> 129#include <linux/reboot.h>
130 130
131#include <asm/dma.h> 131#include <asm/dma.h>
132#include <asm/system.h>
133#include <asm/io.h> 132#include <asm/io.h>
134#include <asm/uaccess.h> 133#include <asm/uaccess.h>
135#include <linux/spinlock.h> 134#include <linux/spinlock.h>
diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c
index 67fc8ffd52e..cd09132d5d7 100644
--- a/drivers/scsi/ibmmca.c
+++ b/drivers/scsi/ibmmca.c
@@ -32,7 +32,6 @@
32#include <linux/spinlock.h> 32#include <linux/spinlock.h>
33#include <linux/init.h> 33#include <linux/init.h>
34 34
35#include <asm/system.h>
36#include <asm/io.h> 35#include <asm/io.h>
37 36
38#include "scsi.h" 37#include "scsi.h"
diff --git a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c
index 112f1bec775..deb5b6d8398 100644
--- a/drivers/scsi/in2000.c
+++ b/drivers/scsi/in2000.c
@@ -123,7 +123,6 @@
123#include <linux/stat.h> 123#include <linux/stat.h>
124 124
125#include <asm/io.h> 125#include <asm/io.h>
126#include <asm/system.h>
127 126
128#include "scsi.h" 127#include "scsi.h"
129#include <scsi/scsi_host.h> 128#include <scsi/scsi_host.h>
diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
index e6173376605..e5cd8d8d4ce 100644
--- a/drivers/scsi/mac53c94.c
+++ b/drivers/scsi/mac53c94.c
@@ -22,7 +22,6 @@
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/prom.h> 24#include <asm/prom.h>
25#include <asm/system.h>
26#include <asm/pci-bridge.h> 25#include <asm/pci-bridge.h>
27#include <asm/macio.h> 26#include <asm/macio.h>
28 27
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index 2bccfbe5661..24828b54773 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -43,7 +43,6 @@
43 43
44#include <asm/io.h> 44#include <asm/io.h>
45#include <asm/irq.h> 45#include <asm/irq.h>
46#include <asm/system.h>
47 46
48#include <asm/macintosh.h> 47#include <asm/macintosh.h>
49#include <asm/macints.h> 48#include <asm/macints.h>
diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
index 49447477953..e8a04ae3276 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -33,7 +33,6 @@
33#include <asm/io.h> 33#include <asm/io.h>
34#include <asm/pgtable.h> 34#include <asm/pgtable.h>
35#include <asm/prom.h> 35#include <asm/prom.h>
36#include <asm/system.h>
37#include <asm/irq.h> 36#include <asm/irq.h>
38#include <asm/hydra.h> 37#include <asm/hydra.h>
39#include <asm/processor.h> 38#include <asm/processor.h>
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c
index 4b3b4755945..5982a587bab 100644
--- a/drivers/scsi/ncr53c8xx.c
+++ b/drivers/scsi/ncr53c8xx.c
@@ -115,7 +115,6 @@
115 115
116#include <asm/dma.h> 116#include <asm/dma.h>
117#include <asm/io.h> 117#include <asm/io.h>
118#include <asm/system.h>
119 118
120#include <scsi/scsi.h> 119#include <scsi/scsi.h>
121#include <scsi/scsi_cmnd.h> 120#include <scsi/scsi_cmnd.h>
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index 002924963cd..62b616891a3 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -38,7 +38,6 @@
38#include <linux/dma-mapping.h> 38#include <linux/dma-mapping.h>
39 39
40#include <asm/dma.h> 40#include <asm/dma.h>
41#include <asm/system.h>
42#include <asm/io.h> 41#include <asm/io.h>
43 42
44#include <scsi/scsi.h> 43#include <scsi/scsi.h>
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index de0b1a704fb..21883a2d632 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -54,7 +54,6 @@ static const char * osst_version = "0.99.4";
54#include <linux/mutex.h> 54#include <linux/mutex.h>
55#include <asm/uaccess.h> 55#include <asm/uaccess.h>
56#include <asm/dma.h> 56#include <asm/dma.h>
57#include <asm/system.h>
58 57
59/* The driver prints some debugging information on the console if DEBUG 58/* The driver prints some debugging information on the console if DEBUG
60 is defined and non-zero. */ 59 is defined and non-zero. */
diff --git a/drivers/scsi/pas16.c b/drivers/scsi/pas16.c
index f2018b46f49..2f72c9807b1 100644
--- a/drivers/scsi/pas16.c
+++ b/drivers/scsi/pas16.c
@@ -113,7 +113,6 @@
113 113
114#include <linux/module.h> 114#include <linux/module.h>
115 115
116#include <asm/system.h>
117#include <linux/signal.h> 116#include <linux/signal.h>
118#include <linux/proc_fs.h> 117#include <linux/proc_fs.h>
119#include <asm/io.h> 118#include <asm/io.h>
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index d838205ab16..6c6486f626e 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -359,7 +359,6 @@
359#include <asm/byteorder.h> 359#include <asm/byteorder.h>
360#include <asm/processor.h> 360#include <asm/processor.h>
361#include <asm/types.h> 361#include <asm/types.h>
362#include <asm/system.h>
363 362
364#include <scsi/scsi.h> 363#include <scsi/scsi.h>
365#include <scsi/scsi_cmnd.h> 364#include <scsi/scsi_cmnd.h>
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index e40dc1cb09a..b191dd54920 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -35,7 +35,6 @@
35#include "qlogicpti.h" 35#include "qlogicpti.h"
36 36
37#include <asm/dma.h> 37#include <asm/dma.h>
38#include <asm/system.h>
39#include <asm/ptrace.h> 38#include <asm/ptrace.h>
40#include <asm/pgtable.h> 39#include <asm/pgtable.h>
41#include <asm/oplib.h> 40#include <asm/oplib.h>
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 9262cdfa4b2..a15f691f9d3 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -42,7 +42,6 @@ static const char *verstr = "20101219";
42 42
43#include <asm/uaccess.h> 43#include <asm/uaccess.h>
44#include <asm/dma.h> 44#include <asm/dma.h>
45#include <asm/system.h>
46 45
47#include <scsi/scsi.h> 46#include <scsi/scsi.h>
48#include <scsi/scsi_dbg.h> 47#include <scsi/scsi_dbg.h>
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
index baf7328de95..6e25889db9d 100644
--- a/drivers/scsi/sun3_scsi.c
+++ b/drivers/scsi/sun3_scsi.c
@@ -63,7 +63,6 @@
63#include <linux/blkdev.h> 63#include <linux/blkdev.h>
64 64
65#include <asm/io.h> 65#include <asm/io.h>
66#include <asm/system.h>
67 66
68#include <asm/sun3ints.h> 67#include <asm/sun3ints.h>
69#include <asm/dvma.h> 68#include <asm/dvma.h>
diff --git a/drivers/scsi/sun3_scsi_vme.c b/drivers/scsi/sun3_scsi_vme.c
index fbba78e5722..a3dd55d1d2f 100644
--- a/drivers/scsi/sun3_scsi_vme.c
+++ b/drivers/scsi/sun3_scsi_vme.c
@@ -25,7 +25,6 @@
25#include <linux/blkdev.h> 25#include <linux/blkdev.h>
26 26
27#include <asm/io.h> 27#include <asm/io.h>
28#include <asm/system.h>
29 28
30#include <asm/sun3ints.h> 29#include <asm/sun3ints.h>
31#include <asm/dvma.h> 30#include <asm/dvma.h>
diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c
index 012c86edd59..ac4eca6a532 100644
--- a/drivers/scsi/sym53c416.c
+++ b/drivers/scsi/sym53c416.c
@@ -37,7 +37,6 @@
37#include <linux/proc_fs.h> 37#include <linux/proc_fs.h>
38#include <linux/spinlock.h> 38#include <linux/spinlock.h>
39#include <asm/dma.h> 39#include <asm/dma.h>
40#include <asm/system.h>
41#include <asm/io.h> 40#include <asm/io.h>
42#include <linux/blkdev.h> 41#include <linux/blkdev.h>
43#include <linux/isapnp.h> 42#include <linux/isapnp.h>
diff --git a/drivers/scsi/t128.c b/drivers/scsi/t128.c
index 041eaaace2c..d672d97fb84 100644
--- a/drivers/scsi/t128.c
+++ b/drivers/scsi/t128.c
@@ -106,7 +106,6 @@
106 * $Log: t128.c,v $ 106 * $Log: t128.c,v $
107 */ 107 */
108 108
109#include <asm/system.h>
110#include <linux/signal.h> 109#include <linux/signal.h>
111#include <linux/io.h> 110#include <linux/io.h>
112#include <linux/blkdev.h> 111#include <linux/blkdev.h>
diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c
index 90e104d6b55..9c216e56356 100644
--- a/drivers/scsi/u14-34f.c
+++ b/drivers/scsi/u14-34f.c
@@ -410,7 +410,6 @@
410#include <linux/ioport.h> 410#include <linux/ioport.h>
411#include <linux/delay.h> 411#include <linux/delay.h>
412#include <asm/io.h> 412#include <asm/io.h>
413#include <asm/system.h>
414#include <asm/byteorder.h> 413#include <asm/byteorder.h>
415#include <linux/proc_fs.h> 414#include <linux/proc_fs.h>
416#include <linux/blkdev.h> 415#include <linux/blkdev.h>
diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
index 7e22b737dfd..14e0c40a68c 100644
--- a/drivers/scsi/ultrastor.c
+++ b/drivers/scsi/ultrastor.c
@@ -141,7 +141,6 @@
141#include <linux/delay.h> 141#include <linux/delay.h>
142 142
143#include <asm/io.h> 143#include <asm/io.h>
144#include <asm/system.h>
145#include <asm/dma.h> 144#include <asm/dma.h>
146 145
147#define ULTRASTOR_PRIVATE /* Get the private stuff from ultrastor.h */ 146#define ULTRASTOR_PRIVATE /* Get the private stuff from ultrastor.h */
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
index 9ee0afef2d1..d89a5dfd3ad 100644
--- a/drivers/scsi/wd7000.c
+++ b/drivers/scsi/wd7000.c
@@ -179,7 +179,6 @@
179#include <linux/stat.h> 179#include <linux/stat.h>
180#include <linux/io.h> 180#include <linux/io.h>
181 181
182#include <asm/system.h>
183#include <asm/dma.h> 182#include <asm/dma.h>
184 183
185#include <scsi/scsi.h> 184#include <scsi/scsi.h>
diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c
index 610f7391456..9b0d7169603 100644
--- a/drivers/spi/spi-omap-uwire.c
+++ b/drivers/spi/spi-omap-uwire.c
@@ -47,7 +47,6 @@
47#include <linux/spi/spi_bitbang.h> 47#include <linux/spi/spi_bitbang.h>
48#include <linux/module.h> 48#include <linux/module.h>
49 49
50#include <asm/system.h>
51#include <asm/irq.h> 50#include <asm/irq.h>
52#include <mach/hardware.h> 51#include <mach/hardware.h>
53#include <asm/io.h> 52#include <asm/io.h>
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index db1fd63aaab..bf185e2807d 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -42,7 +42,6 @@
42#include <linux/cdev.h> 42#include <linux/cdev.h>
43#include <linux/dma-mapping.h> 43#include <linux/dma-mapping.h>
44#include <linux/io.h> 44#include <linux/io.h>
45#include <asm/system.h>
46 45
47#include "comedidev.h" 46#include "comedidev.h"
48#include "internal.h" 47#include "internal.h"
diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
index c9e8c478576..915157d4780 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -86,7 +86,6 @@ TODO:
86#include "../comedidev.h" 86#include "../comedidev.h"
87#include <linux/delay.h> 87#include <linux/delay.h>
88#include <linux/interrupt.h> 88#include <linux/interrupt.h>
89#include <asm/system.h>
90 89
91#include "comedi_pci.h" 90#include "comedi_pci.h"
92#include "8253.h" 91#include "8253.h"
diff --git a/drivers/staging/comedi/drivers/mite.c b/drivers/staging/comedi/drivers/mite.c
index fd274e9c7b7..13e9c807169 100644
--- a/drivers/staging/comedi/drivers/mite.c
+++ b/drivers/staging/comedi/drivers/mite.c
@@ -55,7 +55,6 @@
55#include "comedi_pci.h" 55#include "comedi_pci.h"
56#include "../comedidev.h" 56#include "../comedidev.h"
57 57
58#include <asm/system.h>
59 58
60#define PCI_MITE_SIZE 4096 59#define PCI_MITE_SIZE 4096
61#define PCI_DAQ_SIZE 4096 60#define PCI_DAQ_SIZE 4096
diff --git a/drivers/staging/crystalhd/bc_dts_defs.h b/drivers/staging/crystalhd/bc_dts_defs.h
index 8cd51a7aad8..647e116e10d 100644
--- a/drivers/staging/crystalhd/bc_dts_defs.h
+++ b/drivers/staging/crystalhd/bc_dts_defs.h
@@ -26,6 +26,8 @@
26#ifndef _BC_DTS_DEFS_H_ 26#ifndef _BC_DTS_DEFS_H_
27#define _BC_DTS_DEFS_H_ 27#define _BC_DTS_DEFS_H_
28 28
29#include <linux/types.h>
30
29/* BIT Mask */ 31/* BIT Mask */
30#define BC_BIT(_x) (1 << (_x)) 32#define BC_BIT(_x) (1 << (_x))
31 33
diff --git a/drivers/staging/crystalhd/crystalhd.h b/drivers/staging/crystalhd/crystalhd.h
index 3f4d7951502..b3a550bd5b0 100644
--- a/drivers/staging/crystalhd/crystalhd.h
+++ b/drivers/staging/crystalhd/crystalhd.h
@@ -1,7 +1,6 @@
1#ifndef _CRYSTALHD_H_ 1#ifndef _CRYSTALHD_H_
2#define _CRYSTALHD_H_ 2#define _CRYSTALHD_H_
3 3
4#include <asm/system.h>
5#include "bc_dts_defs.h" 4#include "bc_dts_defs.h"
6#include "crystalhd_misc.h" 5#include "crystalhd_misc.h"
7#include "bc_dts_glob_lnx.h" 6#include "bc_dts_glob_lnx.h"
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.h b/drivers/staging/crystalhd/crystalhd_lnx.h
index a81f9298b0a..a9e36336d09 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.h
+++ b/drivers/staging/crystalhd/crystalhd_lnx.h
@@ -45,7 +45,6 @@
45#include <linux/io.h> 45#include <linux/io.h>
46#include <asm/irq.h> 46#include <asm/irq.h>
47#include <asm/pgtable.h> 47#include <asm/pgtable.h>
48#include <asm/system.h>
49#include <linux/uaccess.h> 48#include <linux/uaccess.h>
50 49
51#include "crystalhd.h" 50#include "crystalhd.h"
diff --git a/drivers/staging/crystalhd/crystalhd_misc.h b/drivers/staging/crystalhd/crystalhd_misc.h
index 84c87938a83..8cdaa7a3481 100644
--- a/drivers/staging/crystalhd/crystalhd_misc.h
+++ b/drivers/staging/crystalhd/crystalhd_misc.h
@@ -37,6 +37,7 @@
37#include <linux/ioctl.h> 37#include <linux/ioctl.h>
38#include <linux/dma-mapping.h> 38#include <linux/dma-mapping.h>
39#include <linux/sched.h> 39#include <linux/sched.h>
40#include "bc_dts_glob_lnx.h"
40 41
41/* Global log level variable defined in crystal_misc.c file */ 42/* Global log level variable defined in crystal_misc.c file */
42extern uint32_t g_linklog_level; 43extern uint32_t g_linklog_level;
diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index 3f919babe79..886f5650444 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -70,7 +70,6 @@
70#include <linux/delay.h> 70#include <linux/delay.h>
71#include <linux/bitops.h> 71#include <linux/bitops.h>
72#include <linux/io.h> 72#include <linux/io.h>
73#include <asm/system.h>
74 73
75#include <linux/netdevice.h> 74#include <linux/netdevice.h>
76#include <linux/etherdevice.h> 75#include <linux/etherdevice.h>
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
index 7569aa0f24d..c4a8a0a26eb 100644
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
@@ -29,7 +29,6 @@
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30#include <linux/in.h> 30#include <linux/in.h>
31#include <asm/io.h> 31#include <asm/io.h>
32#include <asm/system.h>
33#include <asm/bitops.h> 32#include <asm/bitops.h>
34 33
35#include <linux/netdevice.h> 34#include <linux/netdevice.h>
diff --git a/drivers/staging/media/go7007/go7007-driver.c b/drivers/staging/media/go7007/go7007-driver.c
index 6c9279a6d60..ece2dd14648 100644
--- a/drivers/staging/media/go7007/go7007-driver.c
+++ b/drivers/staging/media/go7007/go7007-driver.c
@@ -30,7 +30,6 @@
30#include <linux/mutex.h> 30#include <linux/mutex.h>
31#include <linux/uaccess.h> 31#include <linux/uaccess.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <asm/system.h>
34#include <linux/videodev2.h> 33#include <linux/videodev2.h>
35#include <media/tuner.h> 34#include <media/tuner.h>
36#include <media/v4l2-common.h> 35#include <media/v4l2-common.h>
diff --git a/drivers/staging/media/go7007/go7007-i2c.c b/drivers/staging/media/go7007/go7007-i2c.c
index b8cfa1a6eae..6bc82aaeef1 100644
--- a/drivers/staging/media/go7007/go7007-i2c.c
+++ b/drivers/staging/media/go7007/go7007-i2c.c
@@ -26,7 +26,6 @@
26#include <linux/i2c.h> 26#include <linux/i2c.h>
27#include <linux/mutex.h> 27#include <linux/mutex.h>
28#include <linux/uaccess.h> 28#include <linux/uaccess.h>
29#include <asm/system.h>
30 29
31#include "go7007-priv.h" 30#include "go7007-priv.h"
32#include "wis-i2c.h" 31#include "wis-i2c.h"
diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index f91658670e3..3ef4cd8b4de 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -34,7 +34,6 @@
34#include <linux/i2c.h> 34#include <linux/i2c.h>
35#include <linux/mutex.h> 35#include <linux/mutex.h>
36#include <linux/uaccess.h> 36#include <linux/uaccess.h>
37#include <asm/system.h>
38 37
39#include "go7007.h" 38#include "go7007.h"
40#include "go7007-priv.h" 39#include "go7007-priv.h"
diff --git a/drivers/staging/media/go7007/snd-go7007.c b/drivers/staging/media/go7007/snd-go7007.c
index d071c838ac2..5af29ff68bf 100644
--- a/drivers/staging/media/go7007/snd-go7007.c
+++ b/drivers/staging/media/go7007/snd-go7007.c
@@ -29,7 +29,6 @@
29#include <linux/mutex.h> 29#include <linux/mutex.h>
30#include <linux/uaccess.h> 30#include <linux/uaccess.h>
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <asm/system.h>
33#include <sound/core.h> 32#include <sound/core.h>
34#include <sound/pcm.h> 33#include <sound/pcm.h>
35#include <sound/initval.h> 34#include <sound/initval.h>
diff --git a/drivers/staging/media/lirc/lirc_serial.c b/drivers/staging/media/lirc/lirc_serial.c
index 97352cf6bd9..3295ea63f3e 100644
--- a/drivers/staging/media/lirc/lirc_serial.c
+++ b/drivers/staging/media/lirc/lirc_serial.c
@@ -66,7 +66,6 @@
66#include <linux/poll.h> 66#include <linux/poll.h>
67#include <linux/platform_device.h> 67#include <linux/platform_device.h>
68 68
69#include <asm/system.h>
70#include <linux/io.h> 69#include <linux/io.h>
71#include <linux/irq.h> 70#include <linux/irq.h>
72#include <linux/fcntl.h> 71#include <linux/fcntl.h>
diff --git a/drivers/staging/media/lirc/lirc_sir.c b/drivers/staging/media/lirc/lirc_sir.c
index c94382b917a..945d9623550 100644
--- a/drivers/staging/media/lirc/lirc_sir.c
+++ b/drivers/staging/media/lirc/lirc_sir.c
@@ -49,7 +49,6 @@
49#include <linux/mm.h> 49#include <linux/mm.h>
50#include <linux/delay.h> 50#include <linux/delay.h>
51#include <linux/poll.h> 51#include <linux/poll.h>
52#include <asm/system.h>
53#include <linux/io.h> 52#include <linux/io.h>
54#include <asm/irq.h> 53#include <asm/irq.h>
55#include <linux/fcntl.h> 54#include <linux/fcntl.h>
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 4683d5f355c..6183573f112 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -58,7 +58,6 @@
58 58
59#include <linux/io.h> 59#include <linux/io.h>
60#include <linux/uaccess.h> 60#include <linux/uaccess.h>
61#include <asm/system.h>
62 61
63#define LCD_MINOR 156 62#define LCD_MINOR 156
64#define KEYPAD_MINOR 185 63#define KEYPAD_MINOR 185
diff --git a/drivers/staging/sbe-2t3e3/io.c b/drivers/staging/sbe-2t3e3/io.c
index b458ff03406..9a50bcc5959 100644
--- a/drivers/staging/sbe-2t3e3/io.c
+++ b/drivers/staging/sbe-2t3e3/io.c
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13#include <linux/ip.h> 13#include <linux/ip.h>
14#include <asm/system.h>
15#include "2t3e3.h" 14#include "2t3e3.h"
16#include "ctrl.h" 15#include "ctrl.h"
17 16
diff --git a/drivers/staging/telephony/phonedev.c b/drivers/staging/telephony/phonedev.c
index 1915af20117..1dd0b6717cc 100644
--- a/drivers/staging/telephony/phonedev.c
+++ b/drivers/staging/telephony/phonedev.c
@@ -24,7 +24,6 @@
24#include <linux/phonedev.h> 24#include <linux/phonedev.h>
25#include <linux/init.h> 25#include <linux/init.h>
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/system.h>
28 27
29#include <linux/kmod.h> 28#include <linux/kmod.h>
30#include <linux/sem.h> 29#include <linux/sem.h>
diff --git a/drivers/staging/tidspbridge/include/dspbridge/host_os.h b/drivers/staging/tidspbridge/include/dspbridge/host_os.h
index a2f31c69d12..ed00d3da320 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/host_os.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/host_os.h
@@ -17,7 +17,6 @@
17#ifndef _HOST_OS_H_ 17#ifndef _HOST_OS_H_
18#define _HOST_OS_H_ 18#define _HOST_OS_H_
19 19
20#include <asm/system.h>
21#include <linux/atomic.h> 20#include <linux/atomic.h>
22#include <linux/semaphore.h> 21#include <linux/semaphore.h>
23#include <linux/uaccess.h> 22#include <linux/uaccess.h>
diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c
index a2cbb29c3f5..7084f414846 100644
--- a/drivers/staging/wlags49_h2/wl_cs.c
+++ b/drivers/staging/wlags49_h2/wl_cs.c
@@ -74,7 +74,6 @@
74#include <linux/in.h> 74#include <linux/in.h>
75#include <linux/delay.h> 75#include <linux/delay.h>
76#include <asm/io.h> 76#include <asm/io.h>
77#include <asm/system.h>
78#include <asm/bitops.h> 77#include <asm/bitops.h>
79 78
80#include <linux/netdevice.h> 79#include <linux/netdevice.h>
diff --git a/drivers/staging/wlags49_h2/wl_main.c b/drivers/staging/wlags49_h2/wl_main.c
index dab603e0f45..d5bf0a7012f 100644
--- a/drivers/staging/wlags49_h2/wl_main.c
+++ b/drivers/staging/wlags49_h2/wl_main.c
@@ -86,8 +86,7 @@
86// #include <linux/in.h> 86// #include <linux/in.h>
87// #include <linux/delay.h> 87// #include <linux/delay.h>
88// #include <asm/io.h> 88// #include <asm/io.h>
89// #include <asm/system.h> 89// // #include <asm/bitops.h>
90// #include <asm/bitops.h>
91#include <linux/unistd.h> 90#include <linux/unistd.h>
92#include <asm/uaccess.h> 91#include <asm/uaccess.h>
93 92
diff --git a/drivers/staging/wlags49_h2/wl_netdev.c b/drivers/staging/wlags49_h2/wl_netdev.c
index 9c16f5478a7..90820ff1ace 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -79,8 +79,7 @@
79// #include <linux/delay.h> 79// #include <linux/delay.h>
80// #include <linux/skbuff.h> 80// #include <linux/skbuff.h>
81// #include <asm/io.h> 81// #include <asm/io.h>
82// #include <asm/system.h> 82// // #include <asm/bitops.h>
83// #include <asm/bitops.h>
84 83
85#include <linux/netdevice.h> 84#include <linux/netdevice.h>
86#include <linux/ethtool.h> 85#include <linux/ethtool.h>
diff --git a/drivers/staging/wlags49_h2/wl_pci.c b/drivers/staging/wlags49_h2/wl_pci.c
index 2bd9b84ace8..3df990c7306 100644
--- a/drivers/staging/wlags49_h2/wl_pci.c
+++ b/drivers/staging/wlags49_h2/wl_pci.c
@@ -77,7 +77,6 @@
77#include <linux/interrupt.h> 77#include <linux/interrupt.h>
78#include <linux/in.h> 78#include <linux/in.h>
79#include <linux/delay.h> 79#include <linux/delay.h>
80#include <asm/system.h>
81#include <asm/io.h> 80#include <asm/io.h>
82#include <asm/irq.h> 81#include <asm/irq.h>
83#include <asm/bitops.h> 82#include <asm/bitops.h>
diff --git a/drivers/staging/wlags49_h2/wl_util.c b/drivers/staging/wlags49_h2/wl_util.c
index b748a3ff795..f104e6f1e98 100644
--- a/drivers/staging/wlags49_h2/wl_util.c
+++ b/drivers/staging/wlags49_h2/wl_util.c
@@ -73,8 +73,7 @@
73// #include <linux/in.h> 73// #include <linux/in.h>
74// #include <linux/delay.h> 74// #include <linux/delay.h>
75// #include <asm/io.h> 75// #include <asm/io.h>
76// #include <asm/system.h> 76// // #include <asm/bitops.h>
77// #include <asm/bitops.h>
78 77
79#include <linux/netdevice.h> 78#include <linux/netdevice.h>
80#include <linux/etherdevice.h> 79#include <linux/etherdevice.h>
diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
index afadcd43d14..24145c30c9b 100644
--- a/drivers/tty/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -85,7 +85,6 @@ static char *serial_version = "4.30";
85 85
86#include <asm/setup.h> 86#include <asm/setup.h>
87 87
88#include <asm/system.h>
89 88
90#include <asm/irq.h> 89#include <asm/irq.h>
91 90
diff --git a/drivers/tty/isicom.c b/drivers/tty/isicom.c
index 03c14979acc..794ecb40017 100644
--- a/drivers/tty/isicom.c
+++ b/drivers/tty/isicom.c
@@ -133,7 +133,6 @@
133 133
134#include <linux/uaccess.h> 134#include <linux/uaccess.h>
135#include <linux/io.h> 135#include <linux/io.h>
136#include <asm/system.h>
137 136
138#include <linux/pci.h> 137#include <linux/pci.h>
139 138
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
index 8a8d0440bab..324467d28a5 100644
--- a/drivers/tty/moxa.c
+++ b/drivers/tty/moxa.c
@@ -46,7 +46,6 @@
46#include <linux/slab.h> 46#include <linux/slab.h>
47#include <linux/ratelimit.h> 47#include <linux/ratelimit.h>
48 48
49#include <asm/system.h>
50#include <asm/io.h> 49#include <asm/io.h>
51#include <asm/uaccess.h> 50#include <asm/uaccess.h>
52 51
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 17ff377e412..c6f372dd562 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -41,7 +41,6 @@
41#include <linux/slab.h> 41#include <linux/slab.h>
42#include <linux/ratelimit.h> 42#include <linux/ratelimit.h>
43 43
44#include <asm/system.h>
45#include <asm/io.h> 44#include <asm/io.h>
46#include <asm/irq.h> 45#include <asm/irq.h>
47#include <asm/uaccess.h> 46#include <asm/uaccess.h>
diff --git a/drivers/tty/n_hdlc.c b/drivers/tty/n_hdlc.c
index a09ce3ef5d7..1b2db9a3038 100644
--- a/drivers/tty/n_hdlc.c
+++ b/drivers/tty/n_hdlc.c
@@ -102,7 +102,6 @@
102#include <linux/if.h> 102#include <linux/if.h>
103#include <linux/bitops.h> 103#include <linux/bitops.h>
104 104
105#include <asm/system.h>
106#include <asm/termios.h> 105#include <asm/termios.h>
107#include <asm/uaccess.h> 106#include <asm/uaccess.h>
108 107
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index d2256d08ee7..94b6eda87af 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -50,7 +50,6 @@
50#include <linux/uaccess.h> 50#include <linux/uaccess.h>
51#include <linux/module.h> 51#include <linux/module.h>
52 52
53#include <asm/system.h>
54 53
55/* number of characters left in xmit buffer before select has we have room */ 54/* number of characters left in xmit buffer before select has we have room */
56#define WAKEUP_CHARS 256 55#define WAKEUP_CHARS 256
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index f96ecaec24f..eeae7fafe9a 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -27,7 +27,6 @@
27#include <linux/devpts_fs.h> 27#include <linux/devpts_fs.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29 29
30#include <asm/system.h>
31 30
32#ifdef CONFIG_UNIX98_PTYS 31#ifdef CONFIG_UNIX98_PTYS
33static struct tty_driver *ptm_driver; 32static struct tty_driver *ptm_driver;
diff --git a/drivers/tty/serial/21285.c b/drivers/tty/serial/21285.c
index f899996b436..a44345a2dbb 100644
--- a/drivers/tty/serial/21285.c
+++ b/drivers/tty/serial/21285.c
@@ -16,6 +16,7 @@
16 16
17#include <asm/irq.h> 17#include <asm/irq.h>
18#include <asm/mach-types.h> 18#include <asm/mach-types.h>
19#include <asm/system_info.h>
19#include <asm/hardware/dec21285.h> 20#include <asm/hardware/dec21285.h>
20#include <mach/hardware.h> 21#include <mach/hardware.h>
21 22
diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index 7398390e7e6..5ce782529d6 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -39,7 +39,6 @@
39 39
40#include <asm/io.h> 40#include <asm/io.h>
41#include <asm/irq.h> 41#include <asm/irq.h>
42#include <asm/system.h>
43#include <asm/delay.h> 42#include <asm/delay.h>
44#include <asm/uaccess.h> 43#include <asm/uaccess.h>
45 44
diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
index 86090605a84..29b695d041e 100644
--- a/drivers/tty/serial/8250/serial_cs.c
+++ b/drivers/tty/serial/8250/serial_cs.c
@@ -43,7 +43,6 @@
43#include <linux/delay.h> 43#include <linux/delay.h>
44#include <linux/major.h> 44#include <linux/major.h>
45#include <asm/io.h> 45#include <asm/io.h>
46#include <asm/system.h>
47 46
48#include <pcmcia/cistpl.h> 47#include <pcmcia/cistpl.h>
49#include <pcmcia/ciscode.h> 48#include <pcmcia/ciscode.h>
diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
index 23d79169687..5b07c0c3a10 100644
--- a/drivers/tty/serial/crisv10.c
+++ b/drivers/tty/serial/crisv10.c
@@ -34,9 +34,9 @@ static char *serial_version = "$Revision: 1.25 $";
34 34
35#include <asm/irq.h> 35#include <asm/irq.h>
36#include <asm/dma.h> 36#include <asm/dma.h>
37#include <asm/system.h>
38 37
39#include <arch/svinto.h> 38#include <arch/svinto.h>
39#include <arch/system.h>
40 40
41/* non-arch dependent serial structures are in linux/serial.h */ 41/* non-arch dependent serial structures are in linux/serial.h */
42#include <linux/serial.h> 42#include <linux/serial.h>
diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c
index e3699a84049..6491b8644a7 100644
--- a/drivers/tty/serial/dz.c
+++ b/drivers/tty/serial/dz.c
@@ -52,7 +52,6 @@
52#include <linux/atomic.h> 52#include <linux/atomic.h>
53#include <asm/bootinfo.h> 53#include <asm/bootinfo.h>
54#include <asm/io.h> 54#include <asm/io.h>
55#include <asm/system.h>
56 55
57#include <asm/dec/interrupts.h> 56#include <asm/dec/interrupts.h>
58#include <asm/dec/kn01.h> 57#include <asm/dec/kn01.h>
diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c
index d55709a7a75..defc4e3393a 100644
--- a/drivers/tty/serial/icom.c
+++ b/drivers/tty/serial/icom.c
@@ -52,7 +52,6 @@
52#include <linux/firmware.h> 52#include <linux/firmware.h>
53#include <linux/bitops.h> 53#include <linux/bitops.h>
54 54
55#include <asm/system.h>
56#include <asm/io.h> 55#include <asm/io.h>
57#include <asm/irq.h> 56#include <asm/irq.h>
58#include <asm/uaccess.h> 57#include <asm/uaccess.h>
diff --git a/drivers/tty/serial/msm_serial_hs.c b/drivers/tty/serial/msm_serial_hs.c
index 5e85e1e14c4..fca13dc73e2 100644
--- a/drivers/tty/serial/msm_serial_hs.c
+++ b/drivers/tty/serial/msm_serial_hs.c
@@ -50,7 +50,6 @@
50 50
51#include <linux/atomic.h> 51#include <linux/atomic.h>
52#include <asm/irq.h> 52#include <asm/irq.h>
53#include <asm/system.h>
54 53
55#include <mach/hardware.h> 54#include <mach/hardware.h>
56#include <mach/dma.h> 55#include <mach/dma.h>
diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index 3ba5d285c2d..505961cfd93 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -23,6 +23,7 @@
23#include <asm/spitfire.h> 23#include <asm/spitfire.h>
24#include <asm/prom.h> 24#include <asm/prom.h>
25#include <asm/irq.h> 25#include <asm/irq.h>
26#include <asm/setup.h>
26 27
27#if defined(CONFIG_MAGIC_SYSRQ) 28#if defined(CONFIG_MAGIC_SYSRQ)
28#define SUPPORT_SYSRQ 29#define SUPPORT_SYSRQ
diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c
index 62dacd0ba52..f0d93eb7e6e 100644
--- a/drivers/tty/serial/sunsab.c
+++ b/drivers/tty/serial/sunsab.c
@@ -37,6 +37,7 @@
37#include <asm/io.h> 37#include <asm/io.h>
38#include <asm/irq.h> 38#include <asm/irq.h>
39#include <asm/prom.h> 39#include <asm/prom.h>
40#include <asm/setup.h>
40 41
41#if defined(CONFIG_SERIAL_SUNSAB_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 42#if defined(CONFIG_SERIAL_SUNSAB_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
42#define SUPPORT_SYSRQ 43#define SUPPORT_SYSRQ
diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c
index d3ca6da129f..675303b8ed8 100644
--- a/drivers/tty/serial/sunsu.c
+++ b/drivers/tty/serial/sunsu.c
@@ -41,6 +41,7 @@
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/irq.h> 42#include <asm/irq.h>
43#include <asm/prom.h> 43#include <asm/prom.h>
44#include <asm/setup.h>
44 45
45#if defined(CONFIG_SERIAL_SUNSU_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 46#if defined(CONFIG_SERIAL_SUNSU_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
46#define SUPPORT_SYSRQ 47#define SUPPORT_SYSRQ
diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c
index da4415842a4..b3b70b0bf85 100644
--- a/drivers/tty/serial/sunzilog.c
+++ b/drivers/tty/serial/sunzilog.c
@@ -37,6 +37,7 @@
37#include <asm/io.h> 37#include <asm/io.h>
38#include <asm/irq.h> 38#include <asm/irq.h>
39#include <asm/prom.h> 39#include <asm/prom.h>
40#include <asm/setup.h>
40 41
41#if defined(CONFIG_SERIAL_SUNZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 42#if defined(CONFIG_SERIAL_SUNZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
42#define SUPPORT_SYSRQ 43#define SUPPORT_SYSRQ
diff --git a/drivers/tty/serial/zs.c b/drivers/tty/serial/zs.c
index b7455b52608..4001eee6c08 100644
--- a/drivers/tty/serial/zs.c
+++ b/drivers/tty/serial/zs.c
@@ -67,7 +67,6 @@
67#include <linux/types.h> 67#include <linux/types.h>
68 68
69#include <linux/atomic.h> 69#include <linux/atomic.h>
70#include <asm/system.h>
71 70
72#include <asm/dec/interrupts.h> 71#include <asm/dec/interrupts.h>
73#include <asm/dec/ioasic_addrs.h> 72#include <asm/dec/ioasic_addrs.h>
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
index 8e518da85fd..593d40ad0a6 100644
--- a/drivers/tty/synclink.c
+++ b/drivers/tty/synclink.c
@@ -86,7 +86,6 @@
86#include <linux/ioctl.h> 86#include <linux/ioctl.h>
87#include <linux/synclink.h> 87#include <linux/synclink.h>
88 88
89#include <asm/system.h>
90#include <asm/io.h> 89#include <asm/io.h>
91#include <asm/irq.h> 90#include <asm/irq.h>
92#include <asm/dma.h> 91#include <asm/dma.h>
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
index 34b1a3c4306..aa1debf97cc 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -73,7 +73,6 @@
73#include <linux/hdlc.h> 73#include <linux/hdlc.h>
74#include <linux/synclink.h> 74#include <linux/synclink.h>
75 75
76#include <asm/system.h>
77#include <asm/io.h> 76#include <asm/io.h>
78#include <asm/irq.h> 77#include <asm/irq.h>
79#include <asm/dma.h> 78#include <asm/dma.h>
diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
index 4fb6c4b31b7..a3dddc12d2f 100644
--- a/drivers/tty/synclinkmp.c
+++ b/drivers/tty/synclinkmp.c
@@ -58,7 +58,6 @@
58#include <linux/delay.h> 58#include <linux/delay.h>
59#include <linux/ioctl.h> 59#include <linux/ioctl.h>
60 60
61#include <asm/system.h>
62#include <asm/io.h> 61#include <asm/io.h>
63#include <asm/irq.h> 62#include <asm/irq.h>
64#include <asm/dma.h> 63#include <asm/dma.h>
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index dd8a938510c..d939bd705c7 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -97,7 +97,6 @@
97#include <linux/ratelimit.h> 97#include <linux/ratelimit.h>
98 98
99#include <linux/uaccess.h> 99#include <linux/uaccess.h>
100#include <asm/system.h>
101 100
102#include <linux/kbd_kern.h> 101#include <linux/kbd_kern.h>
103#include <linux/vt_kern.h> 102#include <linux/vt_kern.h>
diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
index 9314d93c1a2..a1b9a2f6856 100644
--- a/drivers/tty/tty_ioctl.c
+++ b/drivers/tty/tty_ioctl.c
@@ -23,7 +23,6 @@
23 23
24#include <asm/io.h> 24#include <asm/io.h>
25#include <asm/uaccess.h> 25#include <asm/uaccess.h>
26#include <asm/system.h>
27 26
28#undef TTY_DEBUG_WAIT_UNTIL_SENT 27#undef TTY_DEBUG_WAIT_UNTIL_SENT
29 28
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 84c4a7d5603..3bdd4b19dd0 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -99,7 +99,6 @@
99#include <linux/notifier.h> 99#include <linux/notifier.h>
100#include <linux/device.h> 100#include <linux/device.h>
101#include <linux/io.h> 101#include <linux/io.h>
102#include <asm/system.h>
103#include <linux/uaccess.h> 102#include <linux/uaccess.h>
104#include <linux/kdb.h> 103#include <linux/kdb.h>
105#include <linux/ctype.h> 104#include <linux/ctype.h>
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 2204a4c68d8..77779271f48 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -54,7 +54,6 @@
54#include <linux/prefetch.h> 54#include <linux/prefetch.h>
55 55
56#include <asm/byteorder.h> 56#include <asm/byteorder.h>
57#include <asm/system.h>
58#include <asm/unaligned.h> 57#include <asm/unaligned.h>
59 58
60/* gadget stack */ 59/* gadget stack */
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 36fd2b4b49a..0c935d7c65b 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -36,7 +36,6 @@
36#include <mach/hardware.h> 36#include <mach/hardware.h>
37#include <asm/io.h> 37#include <asm/io.h>
38#include <asm/irq.h> 38#include <asm/irq.h>
39#include <asm/system.h>
40#include <asm/gpio.h> 39#include <asm/gpio.h>
41 40
42#include <mach/board.h> 41#include <mach/board.h>
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index e1cd56c5e2a..a6dfd216416 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -44,7 +44,6 @@
44#include <asm/byteorder.h> 44#include <asm/byteorder.h>
45#include <linux/io.h> 45#include <linux/io.h>
46#include <asm/irq.h> 46#include <asm/irq.h>
47#include <asm/system.h>
48#include <asm/unaligned.h> 47#include <asm/unaligned.h>
49 48
50#define DRIVER_DESC "USB Host+Gadget Emulator" 49#define DRIVER_DESC "USB Host+Gadget Emulator"
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index b30e21fdbb1..5f94e79cd6b 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -43,7 +43,6 @@
43 43
44#include <asm/byteorder.h> 44#include <asm/byteorder.h>
45#include <asm/io.h> 45#include <asm/io.h>
46#include <asm/system.h>
47#include <asm/unaligned.h> 46#include <asm/unaligned.h>
48#include <asm/dma.h> 47#include <asm/dma.h>
49 48
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index e1dfd32dc80..e151d6b87de 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -43,7 +43,6 @@
43#include <asm/byteorder.h> 43#include <asm/byteorder.h>
44#include <asm/io.h> 44#include <asm/io.h>
45#include <asm/irq.h> 45#include <asm/irq.h>
46#include <asm/system.h>
47#include <asm/unaligned.h> 46#include <asm/unaligned.h>
48 47
49 48
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
index edd52d963f1..f9cedd52cf2 100644
--- a/drivers/usb/gadget/langwell_udc.c
+++ b/drivers/usb/gadget/langwell_udc.c
@@ -32,7 +32,6 @@
32#include <linux/pm.h> 32#include <linux/pm.h>
33#include <linux/io.h> 33#include <linux/io.h>
34#include <linux/irq.h> 34#include <linux/irq.h>
35#include <asm/system.h>
36#include <asm/unaligned.h> 35#include <asm/unaligned.h>
37 36
38#include "langwell_udc.h" 37#include "langwell_udc.h"
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index 19bbe80c2f8..a73cf406e2a 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -34,7 +34,6 @@
34#include <linux/platform_device.h> 34#include <linux/platform_device.h>
35#include <linux/clk.h> 35#include <linux/clk.h>
36#include <linux/platform_data/mv_usb.h> 36#include <linux/platform_data/mv_usb.h>
37#include <asm/system.h>
38#include <asm/unaligned.h> 37#include <asm/unaligned.h>
39 38
40#include "mv_udc.h" 39#include "mv_udc.h"
diff --git a/drivers/usb/gadget/net2272.c b/drivers/usb/gadget/net2272.c
index 01ae56f4717..43ac7482fa9 100644
--- a/drivers/usb/gadget/net2272.c
+++ b/drivers/usb/gadget/net2272.c
@@ -42,7 +42,6 @@
42#include <linux/usb/gadget.h> 42#include <linux/usb/gadget.h>
43 43
44#include <asm/byteorder.h> 44#include <asm/byteorder.h>
45#include <asm/system.h>
46#include <asm/unaligned.h> 45#include <asm/unaligned.h>
47 46
48#include "net2272.h" 47#include "net2272.h"
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index a5ccabc37f3..ac335af154b 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -59,7 +59,6 @@
59#include <asm/byteorder.h> 59#include <asm/byteorder.h>
60#include <asm/io.h> 60#include <asm/io.h>
61#include <asm/irq.h> 61#include <asm/irq.h>
62#include <asm/system.h>
63#include <asm/unaligned.h> 62#include <asm/unaligned.h>
64 63
65 64
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index b44830df593..3b4b6dd0f95 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -40,7 +40,6 @@
40#include <asm/byteorder.h> 40#include <asm/byteorder.h>
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/irq.h> 42#include <asm/irq.h>
43#include <asm/system.h>
44#include <asm/unaligned.h> 43#include <asm/unaligned.h>
45#include <asm/mach-types.h> 44#include <asm/mach-types.h>
46 45
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
index d83134b0f78..4e4dc1f5f38 100644
--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -34,7 +34,6 @@
34#include <asm/byteorder.h> 34#include <asm/byteorder.h>
35#include <linux/io.h> 35#include <linux/io.h>
36#include <linux/irq.h> 36#include <linux/irq.h>
37#include <asm/system.h>
38#include <linux/uaccess.h> 37#include <linux/uaccess.h>
39#include <asm/unaligned.h> 38#include <asm/unaligned.h>
40 39
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index 1b33634f273..41ed69c96d8 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -41,7 +41,6 @@
41#include <asm/byteorder.h> 41#include <asm/byteorder.h>
42#include <asm/dma.h> 42#include <asm/dma.h>
43#include <asm/gpio.h> 43#include <asm/gpio.h>
44#include <asm/system.h>
45#include <asm/mach-types.h> 44#include <asm/mach-types.h>
46#include <asm/unaligned.h> 45#include <asm/unaligned.h>
47 46
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index d3cdffea9c8..73a934a170d 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -34,7 +34,6 @@
34 34
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/byteorder.h> 36#include <asm/byteorder.h>
37#include <asm/system.h>
38#include <asm/unaligned.h> 37#include <asm/unaligned.h>
39 38
40 39
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index ab9c65e2c1d..195524cde6c 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -37,7 +37,6 @@
37#include <asm/byteorder.h> 37#include <asm/byteorder.h>
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/irq.h> 39#include <asm/irq.h>
40#include <asm/system.h>
41#include <asm/unaligned.h> 40#include <asm/unaligned.h>
42#include <mach/irqs.h> 41#include <mach/irqs.h>
43 42
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index aede6374e4b..057cdda7a48 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -45,7 +45,6 @@
45#include <asm/byteorder.h> 45#include <asm/byteorder.h>
46#include <asm/io.h> 46#include <asm/io.h>
47#include <asm/irq.h> 47#include <asm/irq.h>
48#include <asm/system.h>
49#include <asm/unaligned.h> 48#include <asm/unaligned.h>
50 49
51#if defined(CONFIG_PPC_PS3) 50#if defined(CONFIG_PPC_PS3)
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index 924880087a7..9e65e3091c8 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -70,7 +70,6 @@
70 70
71#include <asm/io.h> 71#include <asm/io.h>
72#include <asm/irq.h> 72#include <asm/irq.h>
73#include <asm/system.h>
74#include <asm/byteorder.h> 73#include <asm/byteorder.h>
75 74
76#include "isp116x.h" 75#include "isp116x.h"
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c
index 9e63cdf1ab7..2ed112d3e15 100644
--- a/drivers/usb/host/isp1362-hcd.c
+++ b/drivers/usb/host/isp1362-hcd.c
@@ -84,7 +84,6 @@
84#include <linux/prefetch.h> 84#include <linux/prefetch.h>
85 85
86#include <asm/irq.h> 86#include <asm/irq.h>
87#include <asm/system.h>
88#include <asm/byteorder.h> 87#include <asm/byteorder.h>
89#include <asm/unaligned.h> 88#include <asm/unaligned.h>
90 89
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 543e90e336b..235171f2946 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -42,7 +42,6 @@
42 42
43#include <asm/io.h> 43#include <asm/io.h>
44#include <asm/irq.h> 44#include <asm/irq.h>
45#include <asm/system.h>
46#include <asm/unaligned.h> 45#include <asm/unaligned.h>
47#include <asm/byteorder.h> 46#include <asm/byteorder.h>
48 47
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index 015c7c62ed4..3b38030b02a 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -40,7 +40,6 @@
40#include <linux/io.h> 40#include <linux/io.h>
41 41
42#include <asm/irq.h> 42#include <asm/irq.h>
43#include <asm/system.h>
44#include <asm/unaligned.h> 43#include <asm/unaligned.h>
45 44
46#include <linux/irq.h> 45#include <linux/irq.h>
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 2a2cce2d2fa..91ce1c02e61 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -51,7 +51,6 @@
51 51
52#include <asm/io.h> 52#include <asm/io.h>
53#include <asm/irq.h> 53#include <asm/irq.h>
54#include <asm/system.h>
55#include <asm/byteorder.h> 54#include <asm/byteorder.h>
56#include <asm/unaligned.h> 55#include <asm/unaligned.h>
57 56
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index 16dd6a6abf0..dbbd1ba2522 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -55,7 +55,6 @@
55#include <linux/mutex.h> 55#include <linux/mutex.h>
56#include <asm/io.h> 56#include <asm/io.h>
57#include <asm/irq.h> 57#include <asm/irq.h>
58#include <asm/system.h>
59#include <asm/byteorder.h> 58#include <asm/byteorder.h>
60 59
61 /* FIXME ohci.h is ONLY for internal use by the OHCI driver. 60 /* FIXME ohci.h is ONLY for internal use by the OHCI driver.
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index e37dea87bb5..e4db350602b 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -45,7 +45,6 @@
45#include <asm/uaccess.h> 45#include <asm/uaccess.h>
46#include <asm/io.h> 46#include <asm/io.h>
47#include <asm/irq.h> 47#include <asm/irq.h>
48#include <asm/system.h>
49 48
50#include "uhci-hcd.h" 49#include "uhci-hcd.h"
51 50
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c
index f23cae094f1..887df9d8142 100644
--- a/drivers/video/amifb.c
+++ b/drivers/video/amifb.c
@@ -53,7 +53,6 @@
53#include <linux/platform_device.h> 53#include <linux/platform_device.h>
54#include <linux/uaccess.h> 54#include <linux/uaccess.h>
55 55
56#include <asm/system.h>
57#include <asm/irq.h> 56#include <asm/irq.h>
58#include <asm/amigahw.h> 57#include <asm/amigahw.h>
59#include <asm/amigaints.h> 58#include <asm/amigaints.h>
diff --git a/drivers/video/bt431.h b/drivers/video/bt431.h
index c826f2787ba..04e0cfbba53 100644
--- a/drivers/video/bt431.h
+++ b/drivers/video/bt431.h
@@ -8,7 +8,6 @@
8 * archive for more details. 8 * archive for more details.
9 */ 9 */
10#include <linux/types.h> 10#include <linux/types.h>
11#include <asm/system.h>
12 11
13/* 12/*
14 * Bt431 cursor generator registers, 32-bit aligned. 13 * Bt431 cursor generator registers, 32-bit aligned.
diff --git a/drivers/video/bt455.h b/drivers/video/bt455.h
index b7591fea7ad..80f61b03e9a 100644
--- a/drivers/video/bt455.h
+++ b/drivers/video/bt455.h
@@ -8,7 +8,6 @@
8 * archive for more details. 8 * archive for more details.
9 */ 9 */
10#include <linux/types.h> 10#include <linux/types.h>
11#include <asm/system.h>
12 11
13/* 12/*
14 * Bt455 byte-wide registers, 32-bit aligned. 13 * Bt455 byte-wide registers, 32-bit aligned.
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 8745637e4b7..2e471c22abf 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -77,7 +77,6 @@
77#include <linux/crc32.h> /* For counting font checksums */ 77#include <linux/crc32.h> /* For counting font checksums */
78#include <asm/fb.h> 78#include <asm/fb.h>
79#include <asm/irq.h> 79#include <asm/irq.h>
80#include <asm/system.h>
81 80
82#include "fbcon.h" 81#include "fbcon.h"
83 82
diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c
index a122d9287d1..6d159662904 100644
--- a/drivers/video/console/newport_con.c
+++ b/drivers/video/console/newport_con.c
@@ -22,7 +22,6 @@
22 22
23#include <asm/io.h> 23#include <asm/io.h>
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25#include <asm/system.h>
26#include <asm/page.h> 25#include <asm/page.h>
27#include <asm/pgtable.h> 26#include <asm/pgtable.h>
28#include <asm/gio_device.h> 27#include <asm/gio_device.h>
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c
index 850380795b0..c1527f5b47e 100644
--- a/drivers/video/cyber2000fb.c
+++ b/drivers/video/cyber2000fb.c
@@ -51,7 +51,6 @@
51#include <linux/i2c-algo-bit.h> 51#include <linux/i2c-algo-bit.h>
52 52
53#include <asm/pgtable.h> 53#include <asm/pgtable.h>
54#include <asm/system.h>
55 54
56#ifdef __arm__ 55#ifdef __arm__
57#include <asm/mach-types.h> 56#include <asm/mach-types.h>
diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c
index ec56d2544c7..49e3dda1a36 100644
--- a/drivers/video/dnfb.c
+++ b/drivers/video/dnfb.c
@@ -7,7 +7,6 @@
7#include <linux/platform_device.h> 7#include <linux/platform_device.h>
8 8
9#include <asm/setup.h> 9#include <asm/setup.h>
10#include <asm/system.h>
11#include <asm/irq.h> 10#include <asm/irq.h>
12#include <asm/amigahw.h> 11#include <asm/amigahw.h>
13#include <asm/amigaints.h> 12#include <asm/amigaints.h>
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index fb3f6739110..afc9521173e 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -71,7 +71,6 @@
71#include <asm/io.h> 71#include <asm/io.h>
72#include <asm/irq.h> 72#include <asm/irq.h>
73#include <asm/pgtable.h> 73#include <asm/pgtable.h>
74#include <asm/system.h>
75 74
76#ifdef CONFIG_MTRR 75#ifdef CONFIG_MTRR
77#include <asm/mtrr.h> 76#include <asm/mtrr.h>
diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c
index 0c69fa20251..9b4a60b52a4 100644
--- a/drivers/video/pmag-ba-fb.c
+++ b/drivers/video/pmag-ba-fb.c
@@ -33,7 +33,6 @@
33#include <linux/types.h> 33#include <linux/types.h>
34 34
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/system.h>
37 36
38#include <video/pmag-ba-fb.h> 37#include <video/pmag-ba-fb.h>
39 38
diff --git a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c
index 22fcb9a3d5c..4e7a9c46e11 100644
--- a/drivers/video/pmagb-b-fb.c
+++ b/drivers/video/pmagb-b-fb.c
@@ -29,7 +29,6 @@
29#include <linux/types.h> 29#include <linux/types.h>
30 30
31#include <asm/io.h> 31#include <asm/io.h>
32#include <asm/system.h>
33 32
34#include <video/pmagb-b-fb.h> 33#include <video/pmagb-b-fb.h>
35 34
diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c
index f5a39f5aa90..a104e8cd2f5 100644
--- a/drivers/video/q40fb.c
+++ b/drivers/video/q40fb.c
@@ -20,7 +20,6 @@
20 20
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/setup.h> 22#include <asm/setup.h>
23#include <asm/system.h>
24#include <asm/q40_master.h> 23#include <asm/q40_master.h>
25#include <linux/fb.h> 24#include <linux/fb.h>
26#include <linux/module.h> 25#include <linux/module.h>
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index beb495044b2..cee7803a0a1 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -56,7 +56,6 @@
56#include <asm/io.h> 56#include <asm/io.h>
57#include <asm/irq.h> 57#include <asm/irq.h>
58#include <asm/pgtable.h> 58#include <asm/pgtable.h>
59#include <asm/system.h>
60 59
61#ifdef CONFIG_MTRR 60#ifdef CONFIG_MTRR
62#include <asm/mtrr.h> 61#include <asm/mtrr.h>
diff --git a/drivers/virtio/config.c b/drivers/virtio/config.c
index 983d482fba4..f70bcd2ff98 100644
--- a/drivers/virtio/config.c
+++ b/drivers/virtio/config.c
@@ -9,5 +9,4 @@
9#include <linux/virtio.h> 9#include <linux/virtio.h>
10#include <linux/virtio_config.h> 10#include <linux/virtio_config.h>
11#include <linux/bug.h> 11#include <linux/bug.h>
12#include <asm/system.h>
13 12
diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c
index 72e81058176..64ae9e9fed9 100644
--- a/drivers/watchdog/advantechwdt.c
+++ b/drivers/watchdog/advantechwdt.c
@@ -42,7 +42,6 @@
42#include <linux/io.h> 42#include <linux/io.h>
43#include <linux/uaccess.h> 43#include <linux/uaccess.h>
44 44
45#include <asm/system.h>
46 45
47#define DRV_NAME "advantechwdt" 46#define DRV_NAME "advantechwdt"
48#define WATCHDOG_NAME "Advantech WDT" 47#define WATCHDOG_NAME "Advantech WDT"
diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c
index b9e9558ab21..5eee55012e3 100644
--- a/drivers/watchdog/alim7101_wdt.c
+++ b/drivers/watchdog/alim7101_wdt.c
@@ -36,7 +36,6 @@
36#include <linux/io.h> 36#include <linux/io.h>
37#include <linux/uaccess.h> 37#include <linux/uaccess.h>
38 38
39#include <asm/system.h>
40 39
41#define WDT_ENABLE 0x9C 40#define WDT_ENABLE 0x9C
42#define WDT_DISABLE 0x8C 41#define WDT_DISABLE 0x8C
diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 3990d82f935..ce0ab4415ef 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -23,7 +23,6 @@
23#include <linux/uaccess.h> 23#include <linux/uaccess.h>
24 24
25#include <asm/reg_booke.h> 25#include <asm/reg_booke.h>
26#include <asm/system.h>
27#include <asm/time.h> 26#include <asm/time.h>
28#include <asm/div64.h> 27#include <asm/div64.h>
29 28
diff --git a/drivers/watchdog/eurotechwdt.c b/drivers/watchdog/eurotechwdt.c
index 0c60af14ac6..cd31b8a2a72 100644
--- a/drivers/watchdog/eurotechwdt.c
+++ b/drivers/watchdog/eurotechwdt.c
@@ -61,7 +61,6 @@
61#include <linux/io.h> 61#include <linux/io.h>
62#include <linux/uaccess.h> 62#include <linux/uaccess.h>
63 63
64#include <asm/system.h>
65 64
66static unsigned long eurwdt_is_open; 65static unsigned long eurwdt_is_open;
67static int eurwdt_timeout; 66static int eurwdt_timeout;
diff --git a/drivers/watchdog/ib700wdt.c b/drivers/watchdog/ib700wdt.c
index e187664eaca..184c0bfc87a 100644
--- a/drivers/watchdog/ib700wdt.c
+++ b/drivers/watchdog/ib700wdt.c
@@ -46,7 +46,6 @@
46#include <linux/io.h> 46#include <linux/io.h>
47#include <linux/uaccess.h> 47#include <linux/uaccess.h>
48 48
49#include <asm/system.h>
50 49
51static struct platform_device *ibwdt_platform_device; 50static struct platform_device *ibwdt_platform_device;
52static unsigned long ibwdt_is_open; 51static unsigned long ibwdt_is_open;
diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c
index 405ae7be7c6..8a741bcb512 100644
--- a/drivers/watchdog/it87_wdt.c
+++ b/drivers/watchdog/it87_wdt.c
@@ -45,7 +45,6 @@
45#include <linux/uaccess.h> 45#include <linux/uaccess.h>
46#include <linux/io.h> 46#include <linux/io.h>
47 47
48#include <asm/system.h>
49 48
50#define WATCHDOG_VERSION "1.14" 49#define WATCHDOG_VERSION "1.14"
51#define WATCHDOG_NAME "IT87 WDT" 50#define WATCHDOG_NAME "IT87 WDT"
diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
index 52ed8834ced..bf84f788e59 100644
--- a/drivers/watchdog/machzwd.c
+++ b/drivers/watchdog/machzwd.c
@@ -45,7 +45,6 @@
45#include <linux/io.h> 45#include <linux/io.h>
46#include <linux/uaccess.h> 46#include <linux/uaccess.h>
47 47
48#include <asm/system.h>
49 48
50/* ports */ 49/* ports */
51#define ZF_IOBASE 0x218 50#define ZF_IOBASE 0x218
diff --git a/drivers/watchdog/pc87413_wdt.c b/drivers/watchdog/pc87413_wdt.c
index d5bf112e007..5afb89b4865 100644
--- a/drivers/watchdog/pc87413_wdt.c
+++ b/drivers/watchdog/pc87413_wdt.c
@@ -35,7 +35,6 @@
35#include <linux/io.h> 35#include <linux/io.h>
36#include <linux/uaccess.h> 36#include <linux/uaccess.h>
37 37
38#include <asm/system.h>
39 38
40/* #define DEBUG 1 */ 39/* #define DEBUG 1 */
41 40
diff --git a/drivers/watchdog/sbc60xxwdt.c b/drivers/watchdog/sbc60xxwdt.c
index 6b41276755b..63632ec87c7 100644
--- a/drivers/watchdog/sbc60xxwdt.c
+++ b/drivers/watchdog/sbc60xxwdt.c
@@ -65,7 +65,6 @@
65#include <linux/io.h> 65#include <linux/io.h>
66#include <linux/uaccess.h> 66#include <linux/uaccess.h>
67 67
68#include <asm/system.h>
69 68
70#define OUR_NAME "sbc60xxwdt" 69#define OUR_NAME "sbc60xxwdt"
71#define PFX OUR_NAME ": " 70#define PFX OUR_NAME ": "
diff --git a/drivers/watchdog/sbc7240_wdt.c b/drivers/watchdog/sbc7240_wdt.c
index 8ab757d3df5..719edc8fdeb 100644
--- a/drivers/watchdog/sbc7240_wdt.c
+++ b/drivers/watchdog/sbc7240_wdt.c
@@ -32,7 +32,6 @@
32#include <linux/io.h> 32#include <linux/io.h>
33#include <linux/uaccess.h> 33#include <linux/uaccess.h>
34#include <linux/atomic.h> 34#include <linux/atomic.h>
35#include <asm/system.h>
36 35
37#define SBC7240_ENABLE_PORT 0x443 36#define SBC7240_ENABLE_PORT 0x443
38#define SBC7240_DISABLE_PORT 0x043 37#define SBC7240_DISABLE_PORT 0x043
diff --git a/drivers/watchdog/sbc8360.c b/drivers/watchdog/sbc8360.c
index a9ea385fa12..d4781e05f01 100644
--- a/drivers/watchdog/sbc8360.c
+++ b/drivers/watchdog/sbc8360.c
@@ -53,7 +53,6 @@
53#include <linux/io.h> 53#include <linux/io.h>
54#include <linux/uaccess.h> 54#include <linux/uaccess.h>
55 55
56#include <asm/system.h>
57 56
58static unsigned long sbc8360_is_open; 57static unsigned long sbc8360_is_open;
59static char expect_close; 58static char expect_close;
diff --git a/drivers/watchdog/sbc_fitpc2_wdt.c b/drivers/watchdog/sbc_fitpc2_wdt.c
index 84042852922..90d5527ca88 100644
--- a/drivers/watchdog/sbc_fitpc2_wdt.c
+++ b/drivers/watchdog/sbc_fitpc2_wdt.c
@@ -25,7 +25,6 @@
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/uaccess.h> 26#include <linux/uaccess.h>
27 27
28#include <asm/system.h>
29 28
30static bool nowayout = WATCHDOG_NOWAYOUT; 29static bool nowayout = WATCHDOG_NOWAYOUT;
31static unsigned int margin = 60; /* (secs) Default is 1 minute */ 30static unsigned int margin = 60; /* (secs) Default is 1 minute */
diff --git a/drivers/watchdog/sc520_wdt.c b/drivers/watchdog/sc520_wdt.c
index d1ef58579a3..707e027e500 100644
--- a/drivers/watchdog/sc520_wdt.c
+++ b/drivers/watchdog/sc520_wdt.c
@@ -69,7 +69,6 @@
69#include <linux/io.h> 69#include <linux/io.h>
70#include <linux/uaccess.h> 70#include <linux/uaccess.h>
71 71
72#include <asm/system.h>
73 72
74/* 73/*
75 * The AMD Elan SC520 timeout value is 492us times a power of 2 (0-7) 74 * The AMD Elan SC520 timeout value is 492us times a power of 2 (0-7)
diff --git a/drivers/watchdog/smsc37b787_wdt.c b/drivers/watchdog/smsc37b787_wdt.c
index 4c3400574ad..6d665f9c1d5 100644
--- a/drivers/watchdog/smsc37b787_wdt.c
+++ b/drivers/watchdog/smsc37b787_wdt.c
@@ -60,7 +60,6 @@
60#include <linux/io.h> 60#include <linux/io.h>
61#include <linux/uaccess.h> 61#include <linux/uaccess.h>
62 62
63#include <asm/system.h>
64 63
65/* enable support for minutes as units? */ 64/* enable support for minutes as units? */
66/* (does not always work correctly, so disabled by default!) */ 65/* (does not always work correctly, so disabled by default!) */
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
index 452980361c6..92f1326f0cf 100644
--- a/drivers/watchdog/w83627hf_wdt.c
+++ b/drivers/watchdog/w83627hf_wdt.c
@@ -42,7 +42,6 @@
42#include <linux/io.h> 42#include <linux/io.h>
43#include <linux/uaccess.h> 43#include <linux/uaccess.h>
44 44
45#include <asm/system.h>
46 45
47#define WATCHDOG_NAME "w83627hf/thf/hg/dhg WDT" 46#define WATCHDOG_NAME "w83627hf/thf/hg/dhg WDT"
48#define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ 47#define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */
diff --git a/drivers/watchdog/w83697hf_wdt.c b/drivers/watchdog/w83697hf_wdt.c
index f5c9d9901ac..cd9f3c1e1af 100644
--- a/drivers/watchdog/w83697hf_wdt.c
+++ b/drivers/watchdog/w83697hf_wdt.c
@@ -41,7 +41,6 @@
41#include <linux/io.h> 41#include <linux/io.h>
42#include <linux/uaccess.h> 42#include <linux/uaccess.h>
43 43
44#include <asm/system.h>
45 44
46#define WATCHDOG_NAME "w83697hf/hg WDT" 45#define WATCHDOG_NAME "w83697hf/hg WDT"
47#define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ 46#define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */
diff --git a/drivers/watchdog/w83697ug_wdt.c b/drivers/watchdog/w83697ug_wdt.c
index ab45bfdf935..274be0bfaf2 100644
--- a/drivers/watchdog/w83697ug_wdt.c
+++ b/drivers/watchdog/w83697ug_wdt.c
@@ -46,7 +46,6 @@
46#include <linux/io.h> 46#include <linux/io.h>
47#include <linux/uaccess.h> 47#include <linux/uaccess.h>
48 48
49#include <asm/system.h>
50 49
51#define WATCHDOG_NAME "w83697ug/uf WDT" 50#define WATCHDOG_NAME "w83697ug/uf WDT"
52#define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ 51#define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */
diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c
index e76e7e30930..7874ae06232 100644
--- a/drivers/watchdog/w83877f_wdt.c
+++ b/drivers/watchdog/w83877f_wdt.c
@@ -58,7 +58,6 @@
58#include <linux/init.h> 58#include <linux/init.h>
59#include <linux/io.h> 59#include <linux/io.h>
60#include <linux/uaccess.h> 60#include <linux/uaccess.h>
61#include <asm/system.h>
62 61
63#define OUR_NAME "w83877f_wdt" 62#define OUR_NAME "w83877f_wdt"
64 63
diff --git a/drivers/watchdog/w83977f_wdt.c b/drivers/watchdog/w83977f_wdt.c
index 56bfded1f36..5d2c902825c 100644
--- a/drivers/watchdog/w83977f_wdt.c
+++ b/drivers/watchdog/w83977f_wdt.c
@@ -31,7 +31,6 @@
31#include <linux/uaccess.h> 31#include <linux/uaccess.h>
32#include <linux/io.h> 32#include <linux/io.h>
33 33
34#include <asm/system.h>
35 34
36#define WATCHDOG_VERSION "1.00" 35#define WATCHDOG_VERSION "1.00"
37#define WATCHDOG_NAME "W83977F WDT" 36#define WATCHDOG_NAME "W83977F WDT"
diff --git a/drivers/watchdog/wdt.c b/drivers/watchdog/wdt.c
index 64079d933c6..ee4333c0110 100644
--- a/drivers/watchdog/wdt.c
+++ b/drivers/watchdog/wdt.c
@@ -48,7 +48,6 @@
48#include <linux/io.h> 48#include <linux/io.h>
49#include <linux/uaccess.h> 49#include <linux/uaccess.h>
50 50
51#include <asm/system.h>
52#include "wd501p.h" 51#include "wd501p.h"
53 52
54static unsigned long wdt_is_open; 53static unsigned long wdt_is_open;
diff --git a/drivers/watchdog/wdt285.c b/drivers/watchdog/wdt285.c
index 3daa330ae43..5eec7405388 100644
--- a/drivers/watchdog/wdt285.c
+++ b/drivers/watchdog/wdt285.c
@@ -34,6 +34,7 @@
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35 35
36#include <asm/mach-types.h> 36#include <asm/mach-types.h>
37#include <asm/system_info.h>
37#include <asm/hardware/dec21285.h> 38#include <asm/hardware/dec21285.h>
38 39
39/* 40/*
diff --git a/drivers/watchdog/wdt977.c b/drivers/watchdog/wdt977.c
index 2de1632708a..65a40234493 100644
--- a/drivers/watchdog/wdt977.c
+++ b/drivers/watchdog/wdt977.c
@@ -39,7 +39,6 @@
39#include <linux/io.h> 39#include <linux/io.h>
40#include <linux/uaccess.h> 40#include <linux/uaccess.h>
41 41
42#include <asm/system.h>
43#include <asm/mach-types.h> 42#include <asm/mach-types.h>
44 43
45#define WATCHDOG_VERSION "0.04" 44#define WATCHDOG_VERSION "0.04"
diff --git a/drivers/watchdog/wdt_pci.c b/drivers/watchdog/wdt_pci.c
index a3cea594c8f..1c888c7d4cc 100644
--- a/drivers/watchdog/wdt_pci.c
+++ b/drivers/watchdog/wdt_pci.c
@@ -55,7 +55,6 @@
55#include <linux/io.h> 55#include <linux/io.h>
56#include <linux/uaccess.h> 56#include <linux/uaccess.h>
57 57
58#include <asm/system.h>
59 58
60#define WDT_IS_PCI 59#define WDT_IS_PCI
61#include "wd501p.h" 60#include "wd501p.h"
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
index 4d5e6d26578..2eb12f13593 100644
--- a/fs/binfmt_aout.c
+++ b/fs/binfmt_aout.c
@@ -26,7 +26,6 @@
26#include <linux/coredump.h> 26#include <linux/coredump.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28 28
29#include <asm/system.h>
30#include <asm/uaccess.h> 29#include <asm/uaccess.h>
31#include <asm/cacheflush.h> 30#include <asm/cacheflush.h>
32#include <asm/a.out-core.h> 31#include <asm/a.out-core.h>
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 504b6eee50a..7d7ff206cdc 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -35,6 +35,7 @@
35#include <asm/uaccess.h> 35#include <asm/uaccess.h>
36#include <asm/param.h> 36#include <asm/param.h>
37#include <asm/page.h> 37#include <asm/page.h>
38#include <asm/exec.h>
38 39
39static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs); 40static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs);
40static int load_elf_library(struct file *); 41static int load_elf_library(struct file *);
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index c64bf5ee2df..9bd5612a822 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -39,6 +39,7 @@
39#include <asm/uaccess.h> 39#include <asm/uaccess.h>
40#include <asm/param.h> 40#include <asm/param.h>
41#include <asm/pgalloc.h> 41#include <asm/pgalloc.h>
42#include <asm/exec.h>
42 43
43typedef char *elf_caddr_t; 44typedef char *elf_caddr_t;
44 45
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 5979027451b..024d20ee3ca 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -37,7 +37,6 @@
37#include <linux/syscalls.h> 37#include <linux/syscalls.h>
38 38
39#include <asm/byteorder.h> 39#include <asm/byteorder.h>
40#include <asm/system.h>
41#include <asm/uaccess.h> 40#include <asm/uaccess.h>
42#include <asm/unaligned.h> 41#include <asm/unaligned.h>
43#include <asm/cacheflush.h> 42#include <asm/cacheflush.h>
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index 05156c17b55..2870597b5c9 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -21,7 +21,6 @@
21#include <linux/vfs.h> 21#include <linux/vfs.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23 23
24#include <asm/system.h>
25#include <asm/uaccess.h> 24#include <asm/uaccess.h>
26 25
27#include <linux/fs.h> 26#include <linux/fs.h>
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index 8f616e0e252..761d5b31b18 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -38,7 +38,6 @@
38#include <linux/mutex.h> 38#include <linux/mutex.h>
39#include <linux/device.h> 39#include <linux/device.h>
40#include <asm/io.h> 40#include <asm/io.h>
41#include <asm/system.h>
42#include <asm/poll.h> 41#include <asm/poll.h>
43#include <asm/uaccess.h> 42#include <asm/uaccess.h>
44 43
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
index 9727e0c5257..0c68fd31fbf 100644
--- a/fs/coda/upcall.c
+++ b/fs/coda/upcall.c
@@ -14,7 +14,6 @@
14 * improvements to the Coda project. Contact Peter Braam <coda@cs.cmu.edu>. 14 * improvements to the Coda project. Contact Peter Braam <coda@cs.cmu.edu>.
15 */ 15 */
16 16
17#include <asm/system.h>
18#include <linux/signal.h> 17#include <linux/signal.h>
19#include <linux/sched.h> 18#include <linux/sched.h>
20#include <linux/types.h> 19#include <linux/types.h>
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 629e9ed99d0..739b0985b39 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -34,7 +34,6 @@
34#include <linux/mutex.h> 34#include <linux/mutex.h>
35#include <linux/anon_inodes.h> 35#include <linux/anon_inodes.h>
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37#include <asm/system.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/mman.h> 38#include <asm/mman.h>
40#include <linux/atomic.h> 39#include <linux/atomic.h>
diff --git a/fs/exec.c b/fs/exec.c
index 23559c227d9..c8b63d14da8 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -59,6 +59,7 @@
59#include <asm/uaccess.h> 59#include <asm/uaccess.h>
60#include <asm/mmu_context.h> 60#include <asm/mmu_context.h>
61#include <asm/tlb.h> 61#include <asm/tlb.h>
62#include <asm/exec.h>
62 63
63#include <trace/events/task.h> 64#include <trace/events/task.h>
64#include "internal.h" 65#include "internal.h"
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 17f557f01cf..806525a7269 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -28,7 +28,6 @@
28#include <linux/blkdev.h> 28#include <linux/blkdev.h>
29#include <linux/bitops.h> 29#include <linux/bitops.h>
30#include <trace/events/jbd2.h> 30#include <trace/events/jbd2.h>
31#include <asm/system.h>
32 31
33/* 32/*
34 * Default IO end handler for temporary BJ_IO buffer_heads. 33 * Default IO end handler for temporary BJ_IO buffer_heads.
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 98ed6dbfe38..1afb701622b 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -50,7 +50,6 @@
50 50
51#include <asm/uaccess.h> 51#include <asm/uaccess.h>
52#include <asm/page.h> 52#include <asm/page.h>
53#include <asm/system.h>
54 53
55EXPORT_SYMBOL(jbd2_journal_extend); 54EXPORT_SYMBOL(jbd2_journal_extend);
56EXPORT_SYMBOL(jbd2_journal_stop); 55EXPORT_SYMBOL(jbd2_journal_stop);
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c
index 64a326418aa..3ff5fcc1528 100644
--- a/fs/ncpfs/file.c
+++ b/fs/ncpfs/file.c
@@ -7,7 +7,6 @@
7 */ 7 */
8 8
9#include <asm/uaccess.h> 9#include <asm/uaccess.h>
10#include <asm/system.h>
11 10
12#include <linux/time.h> 11#include <linux/time.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index 49df0e7f837..87484fb8d17 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -11,7 +11,6 @@
11 11
12#include <linux/module.h> 12#include <linux/module.h>
13 13
14#include <asm/system.h>
15#include <asm/uaccess.h> 14#include <asm/uaccess.h>
16#include <asm/byteorder.h> 15#include <asm/byteorder.h>
17 16
diff --git a/fs/ncpfs/mmap.c b/fs/ncpfs/mmap.c
index e5d71b27a5b..be20a7e171a 100644
--- a/fs/ncpfs/mmap.c
+++ b/fs/ncpfs/mmap.c
@@ -19,7 +19,6 @@
19#include <linux/memcontrol.h> 19#include <linux/memcontrol.h>
20 20
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/system.h>
23 22
24#include "ncp_fs.h" 23#include "ncp_fs.h"
25 24
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 4a108a0a2a6..da7b5e4ff9e 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -43,7 +43,6 @@
43#include <linux/nsproxy.h> 43#include <linux/nsproxy.h>
44#include <linux/pid_namespace.h> 44#include <linux/pid_namespace.h>
45 45
46#include <asm/system.h>
47 46
48#include "nfs4_fs.h" 47#include "nfs4_fs.h"
49#include "callback.h" 48#include "callback.h"
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 9c7f66ac6cc..481be7f7bdd 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -51,7 +51,6 @@
51#include <linux/nfs_page.h> 51#include <linux/nfs_page.h>
52#include <linux/sunrpc/clnt.h> 52#include <linux/sunrpc/clnt.h>
53 53
54#include <asm/system.h>
55#include <asm/uaccess.h> 54#include <asm/uaccess.h>
56#include <linux/atomic.h> 55#include <linux/atomic.h>
57 56
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 4fdaaa63cf1..aa9b709fd32 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -30,7 +30,6 @@
30#include <linux/swap.h> 30#include <linux/swap.h>
31 31
32#include <asm/uaccess.h> 32#include <asm/uaccess.h>
33#include <asm/system.h>
34 33
35#include "delegation.h" 34#include "delegation.h"
36#include "internal.h" 35#include "internal.h"
diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 801d6d83078..4ca6f5c8038 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -32,7 +32,6 @@
32#include <linux/namei.h> 32#include <linux/namei.h>
33#include <linux/security.h> 33#include <linux/security.h>
34 34
35#include <asm/system.h>
36#include <asm/uaccess.h> 35#include <asm/uaccess.h>
37 36
38#include "nfs4_fs.h" 37#include "nfs4_fs.h"
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 7bb4d13c1cd..e8bbfa5b350 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -41,7 +41,6 @@
41#include <linux/freezer.h> 41#include <linux/freezer.h>
42#include <linux/crc32.h> 42#include <linux/crc32.h>
43 43
44#include <asm/system.h>
45#include <asm/uaccess.h> 44#include <asm/uaccess.h>
46 45
47#include "nfs4_fs.h" 46#include "nfs4_fs.h"
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index cc1f758a7ee..9a0e8ef4a40 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -20,7 +20,6 @@
20#include <linux/nfs_page.h> 20#include <linux/nfs_page.h>
21#include <linux/module.h> 21#include <linux/module.h>
22 22
23#include <asm/system.h>
24#include "pnfs.h" 23#include "pnfs.h"
25 24
26#include "nfs4_fs.h" 25#include "nfs4_fs.h"
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index ccc4cdb1efe..37412f706b3 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -55,7 +55,6 @@
55#include <linux/nsproxy.h> 55#include <linux/nsproxy.h>
56#include <linux/rcupdate.h> 56#include <linux/rcupdate.h>
57 57
58#include <asm/system.h>
59#include <asm/uaccess.h> 58#include <asm/uaccess.h>
60 59
61#include "nfs4_fs.h" 60#include "nfs4_fs.h"
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 8461a7b82fd..205c9228083 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -22,7 +22,6 @@
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/mount.h> 23#include <linux/mount.h>
24 24
25#include <asm/system.h>
26#include <asm/uaccess.h> 25#include <asm/uaccess.h>
27 26
28#include "internal.h" 27#include "internal.h"
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index cf9f4de00a9..b1a08573fe1 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -51,7 +51,6 @@
51#include <linux/uaccess.h> 51#include <linux/uaccess.h>
52#include <linux/slab.h> 52#include <linux/slab.h>
53 53
54#include <asm/system.h>
55 54
56/* gets a struct reiserfs_journal_list * from a list head */ 55/* gets a struct reiserfs_journal_list * from a list head */
57#define JOURNAL_LIST_ENTRY(h) (list_entry((h), struct reiserfs_journal_list, \ 56#define JOURNAL_LIST_ENTRY(h) (list_entry((h), struct reiserfs_journal_list, \
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index 9094e1d917b..7cdd3953d67 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -26,7 +26,6 @@
26 */ 26 */
27 27
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/system.h>
30 29
31#include <linux/errno.h> 30#include <linux/errno.h>
32#include <linux/fs.h> 31#include <linux/fs.h>
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index f636f6b460d..ac8e279eccc 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -73,7 +73,6 @@
73#include <stdarg.h> 73#include <stdarg.h>
74 74
75#include <asm/uaccess.h> 75#include <asm/uaccess.h>
76#include <asm/system.h>
77 76
78#include <linux/errno.h> 77#include <linux/errno.h>
79#include <linux/fs.h> 78#include <linux/fs.h>
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
index df7ffb0affe..5bf3be45f54 100644
--- a/fs/xfs/xfs_buf.h
+++ b/fs/xfs/xfs_buf.h
@@ -21,7 +21,6 @@
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <asm/system.h>
25#include <linux/mm.h> 24#include <linux/mm.h>
26#include <linux/fs.h> 25#include <linux/fs.h>
27#include <linux/buffer_head.h> 26#include <linux/buffer_head.h>
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index f4b2effe033..6fbc4cab583 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -57,7 +57,6 @@
57#include <linux/kernel.h> 57#include <linux/kernel.h>
58#include <linux/ctype.h> 58#include <linux/ctype.h>
59#include <linux/sched.h> 59#include <linux/sched.h>
60#include <asm/system.h>
61#include <linux/atomic.h> 60#include <linux/atomic.h>
62#include <asm/div64.h> 61#include <asm/div64.h>
63#include <asm/acpi.h> 62#include <asm/acpi.h>
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
index e37963c1df4..1ced6413ea0 100644
--- a/include/asm-generic/atomic.h
+++ b/include/asm-generic/atomic.h
@@ -15,6 +15,8 @@
15#ifndef __ASM_GENERIC_ATOMIC_H 15#ifndef __ASM_GENERIC_ATOMIC_H
16#define __ASM_GENERIC_ATOMIC_H 16#define __ASM_GENERIC_ATOMIC_H
17 17
18#include <asm/cmpxchg.h>
19
18#ifdef CONFIG_SMP 20#ifdef CONFIG_SMP
19/* Force people to define core atomics */ 21/* Force people to define core atomics */
20# if !defined(atomic_add_return) || !defined(atomic_sub_return) || \ 22# if !defined(atomic_add_return) || !defined(atomic_sub_return) || \
@@ -52,7 +54,6 @@
52#define atomic_set(v, i) (((v)->counter) = (i)) 54#define atomic_set(v, i) (((v)->counter) = (i))
53 55
54#include <linux/irqflags.h> 56#include <linux/irqflags.h>
55#include <asm/system.h>
56 57
57/** 58/**
58 * atomic_add_return - add integer to atomic variable 59 * atomic_add_return - add integer to atomic variable
diff --git a/include/asm-generic/barrier.h b/include/asm-generic/barrier.h
new file mode 100644
index 00000000000..639d7a4d033
--- /dev/null
+++ b/include/asm-generic/barrier.h
@@ -0,0 +1,50 @@
1/* Generic barrier definitions, based on MN10300 definitions.
2 *
3 * It should be possible to use these on really simple architectures,
4 * but it serves more as a starting point for new ports.
5 *
6 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
7 * Written by David Howells (dhowells@redhat.com)
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public Licence
11 * as published by the Free Software Foundation; either version
12 * 2 of the Licence, or (at your option) any later version.
13 */
14#ifndef __ASM_GENERIC_BARRIER_H
15#define __ASM_GENERIC_BARRIER_H
16
17#ifndef __ASSEMBLY__
18
19#define nop() asm volatile ("nop")
20
21/*
22 * Force strict CPU ordering.
23 * And yes, this is required on UP too when we're talking
24 * to devices.
25 *
26 * This implementation only contains a compiler barrier.
27 */
28
29#define mb() asm volatile ("": : :"memory")
30#define rmb() mb()
31#define wmb() asm volatile ("": : :"memory")
32
33#ifdef CONFIG_SMP
34#define smp_mb() mb()
35#define smp_rmb() rmb()
36#define smp_wmb() wmb()
37#else
38#define smp_mb() barrier()
39#define smp_rmb() barrier()
40#define smp_wmb() barrier()
41#endif
42
43#define set_mb(var, value) do { var = value; mb(); } while (0)
44#define set_wmb(var, value) do { var = value; wmb(); } while (0)
45
46#define read_barrier_depends() do {} while (0)
47#define smp_read_barrier_depends() do {} while (0)
48
49#endif /* !__ASSEMBLY__ */
50#endif /* __ASM_GENERIC_BARRIER_H */
diff --git a/include/asm-generic/bitops/atomic.h b/include/asm-generic/bitops/atomic.h
index ecc44a8e2b4..9ae6c34dc19 100644
--- a/include/asm-generic/bitops/atomic.h
+++ b/include/asm-generic/bitops/atomic.h
@@ -2,7 +2,7 @@
2#define _ASM_GENERIC_BITOPS_ATOMIC_H_ 2#define _ASM_GENERIC_BITOPS_ATOMIC_H_
3 3
4#include <asm/types.h> 4#include <asm/types.h>
5#include <asm/system.h> 5#include <linux/irqflags.h>
6 6
7#ifdef CONFIG_SMP 7#ifdef CONFIG_SMP
8#include <asm/spinlock.h> 8#include <asm/spinlock.h>
diff --git a/include/asm-generic/cmpxchg.h b/include/asm-generic/cmpxchg.h
index 213ac6e8fe3..8a361834dc2 100644
--- a/include/asm-generic/cmpxchg.h
+++ b/include/asm-generic/cmpxchg.h
@@ -1,22 +1,97 @@
1/*
2 * Generic UP xchg and cmpxchg using interrupt disablement. Does not
3 * support SMP.
4 */
5
1#ifndef __ASM_GENERIC_CMPXCHG_H 6#ifndef __ASM_GENERIC_CMPXCHG_H
2#define __ASM_GENERIC_CMPXCHG_H 7#define __ASM_GENERIC_CMPXCHG_H
3 8
4/*
5 * Generic cmpxchg
6 *
7 * Uses the local cmpxchg. Does not support SMP.
8 */
9#ifdef CONFIG_SMP 9#ifdef CONFIG_SMP
10#error "Cannot use generic cmpxchg on SMP" 10#error "Cannot use generic cmpxchg on SMP"
11#endif 11#endif
12 12
13#include <linux/irqflags.h>
14
15#ifndef xchg
16
17/*
18 * This function doesn't exist, so you'll get a linker error if
19 * something tries to do an invalidly-sized xchg().
20 */
21extern void __xchg_called_with_bad_pointer(void);
22
23static inline
24unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
25{
26 unsigned long ret, flags;
27
28 switch (size) {
29 case 1:
30#ifdef __xchg_u8
31 return __xchg_u8(x, ptr);
32#else
33 local_irq_save(flags);
34 ret = *(volatile u8 *)ptr;
35 *(volatile u8 *)ptr = x;
36 local_irq_restore(flags);
37 return ret;
38#endif /* __xchg_u8 */
39
40 case 2:
41#ifdef __xchg_u16
42 return __xchg_u16(x, ptr);
43#else
44 local_irq_save(flags);
45 ret = *(volatile u16 *)ptr;
46 *(volatile u16 *)ptr = x;
47 local_irq_restore(flags);
48 return ret;
49#endif /* __xchg_u16 */
50
51 case 4:
52#ifdef __xchg_u32
53 return __xchg_u32(x, ptr);
54#else
55 local_irq_save(flags);
56 ret = *(volatile u32 *)ptr;
57 *(volatile u32 *)ptr = x;
58 local_irq_restore(flags);
59 return ret;
60#endif /* __xchg_u32 */
61
62#ifdef CONFIG_64BIT
63 case 8:
64#ifdef __xchg_u64
65 return __xchg_u64(x, ptr);
66#else
67 local_irq_save(flags);
68 ret = *(volatile u64 *)ptr;
69 *(volatile u64 *)ptr = x;
70 local_irq_restore(flags);
71 return ret;
72#endif /* __xchg_u64 */
73#endif /* CONFIG_64BIT */
74
75 default:
76 __xchg_called_with_bad_pointer();
77 return x;
78 }
79}
80
81#define xchg(ptr, x) \
82 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
83
84#endif /* xchg */
85
13/* 86/*
14 * Atomic compare and exchange. 87 * Atomic compare and exchange.
15 * 88 *
16 * Do not define __HAVE_ARCH_CMPXCHG because we want to use it to check whether 89 * Do not define __HAVE_ARCH_CMPXCHG because we want to use it to check whether
17 * a cmpxchg primitive faster than repeated local irq save/restore exists. 90 * a cmpxchg primitive faster than repeated local irq save/restore exists.
18 */ 91 */
92#include <asm-generic/cmpxchg-local.h>
93
19#define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) 94#define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n))
20#define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n)) 95#define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n))
21 96
22#endif 97#endif /* __ASM_GENERIC_CMPXCHG_H */
diff --git a/include/asm-generic/exec.h b/include/asm-generic/exec.h
new file mode 100644
index 00000000000..567766b0074
--- /dev/null
+++ b/include/asm-generic/exec.h
@@ -0,0 +1,19 @@
1/* Generic process execution definitions, based on MN10300 definitions.
2 *
3 * It should be possible to use these on really simple architectures,
4 * but it serves more as a starting point for new ports.
5 *
6 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
7 * Written by David Howells (dhowells@redhat.com)
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public Licence
11 * as published by the Free Software Foundation; either version
12 * 2 of the Licence, or (at your option) any later version.
13 */
14#ifndef __ASM_GENERIC_EXEC_H
15#define __ASM_GENERIC_EXEC_H
16
17#define arch_align_stack(x) (x)
18
19#endif /* __ASM_GENERIC_EXEC_H */
diff --git a/include/asm-generic/switch_to.h b/include/asm-generic/switch_to.h
new file mode 100644
index 00000000000..052c4ac04fd
--- /dev/null
+++ b/include/asm-generic/switch_to.h
@@ -0,0 +1,30 @@
1/* Generic task switch macro wrapper, based on MN10300 definitions.
2 *
3 * It should be possible to use these on really simple architectures,
4 * but it serves more as a starting point for new ports.
5 *
6 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
7 * Written by David Howells (dhowells@redhat.com)
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public Licence
11 * as published by the Free Software Foundation; either version
12 * 2 of the Licence, or (at your option) any later version.
13 */
14#ifndef __ASM_GENERIC_SWITCH_TO_H
15#define __ASM_GENERIC_SWITCH_TO_H
16
17#include <linux/thread_info.h>
18
19/*
20 * Context switching is now performed out-of-line in switch_to.S
21 */
22extern struct task_struct *__switch_to(struct task_struct *,
23 struct task_struct *);
24
25#define switch_to(prev, next, last) \
26 do { \
27 ((last) = __switch_to((prev), (next))); \
28 } while (0)
29
30#endif /* __ASM_GENERIC_SWITCH_TO_H */
diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h
deleted file mode 100644
index 215efa74f5a..00000000000
--- a/include/asm-generic/system.h
+++ /dev/null
@@ -1,141 +0,0 @@
1/* Generic system definitions, based on MN10300 definitions.
2 *
3 * It should be possible to use these on really simple architectures,
4 * but it serves more as a starting point for new ports.
5 *
6 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
7 * Written by David Howells (dhowells@redhat.com)
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public Licence
11 * as published by the Free Software Foundation; either version
12 * 2 of the Licence, or (at your option) any later version.
13 */
14#ifndef __ASM_GENERIC_SYSTEM_H
15#define __ASM_GENERIC_SYSTEM_H
16
17#ifndef __ASSEMBLY__
18
19#include <linux/types.h>
20#include <linux/irqflags.h>
21
22#include <asm/cmpxchg-local.h>
23#include <asm/cmpxchg.h>
24
25struct task_struct;
26
27/* context switching is now performed out-of-line in switch_to.S */
28extern struct task_struct *__switch_to(struct task_struct *,
29 struct task_struct *);
30#define switch_to(prev, next, last) \
31 do { \
32 ((last) = __switch_to((prev), (next))); \
33 } while (0)
34
35#define arch_align_stack(x) (x)
36
37#define nop() asm volatile ("nop")
38
39#endif /* !__ASSEMBLY__ */
40
41/*
42 * Force strict CPU ordering.
43 * And yes, this is required on UP too when we're talking
44 * to devices.
45 *
46 * This implementation only contains a compiler barrier.
47 */
48
49#define mb() asm volatile ("": : :"memory")
50#define rmb() mb()
51#define wmb() asm volatile ("": : :"memory")
52
53#ifdef CONFIG_SMP
54#define smp_mb() mb()
55#define smp_rmb() rmb()
56#define smp_wmb() wmb()
57#else
58#define smp_mb() barrier()
59#define smp_rmb() barrier()
60#define smp_wmb() barrier()
61#endif
62
63#define set_mb(var, value) do { var = value; mb(); } while (0)
64#define set_wmb(var, value) do { var = value; wmb(); } while (0)
65
66#define read_barrier_depends() do {} while (0)
67#define smp_read_barrier_depends() do {} while (0)
68
69/*
70 * we make sure local_irq_enable() doesn't cause priority inversion
71 */
72#ifndef __ASSEMBLY__
73
74/* This function doesn't exist, so you'll get a linker error
75 * if something tries to do an invalid xchg(). */
76extern void __xchg_called_with_bad_pointer(void);
77
78static inline
79unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
80{
81 unsigned long ret, flags;
82
83 switch (size) {
84 case 1:
85#ifdef __xchg_u8
86 return __xchg_u8(x, ptr);
87#else
88 local_irq_save(flags);
89 ret = *(volatile u8 *)ptr;
90 *(volatile u8 *)ptr = x;
91 local_irq_restore(flags);
92 return ret;
93#endif /* __xchg_u8 */
94
95 case 2:
96#ifdef __xchg_u16
97 return __xchg_u16(x, ptr);
98#else
99 local_irq_save(flags);
100 ret = *(volatile u16 *)ptr;
101 *(volatile u16 *)ptr = x;
102 local_irq_restore(flags);
103 return ret;
104#endif /* __xchg_u16 */
105
106 case 4:
107#ifdef __xchg_u32
108 return __xchg_u32(x, ptr);
109#else
110 local_irq_save(flags);
111 ret = *(volatile u32 *)ptr;
112 *(volatile u32 *)ptr = x;
113 local_irq_restore(flags);
114 return ret;
115#endif /* __xchg_u32 */
116
117#ifdef CONFIG_64BIT
118 case 8:
119#ifdef __xchg_u64
120 return __xchg_u64(x, ptr);
121#else
122 local_irq_save(flags);
123 ret = *(volatile u64 *)ptr;
124 *(volatile u64 *)ptr = x;
125 local_irq_restore(flags);
126 return ret;
127#endif /* __xchg_u64 */
128#endif /* CONFIG_64BIT */
129
130 default:
131 __xchg_called_with_bad_pointer();
132 return x;
133 }
134}
135
136#define xchg(ptr, x) \
137 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
138
139#endif /* !__ASSEMBLY__ */
140
141#endif /* __ASM_GENERIC_SYSTEM_H */
diff --git a/include/linux/cnt32_to_63.h b/include/linux/cnt32_to_63.h
index e3d8bf26e5e..aa629bce903 100644
--- a/include/linux/cnt32_to_63.h
+++ b/include/linux/cnt32_to_63.h
@@ -16,7 +16,6 @@
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <asm/byteorder.h> 18#include <asm/byteorder.h>
19#include <asm/system.h>
20 19
21/* this is used only to give gcc a clue about good code generation */ 20/* this is used only to give gcc a clue about good code generation */
22union cnt32_to_63 { 21union cnt32_to_63 {
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
index 94f20c1488a..3bd46f76675 100644
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -4,7 +4,6 @@
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/atomic.h> 5#include <linux/atomic.h>
6#include <linux/bug.h> 6#include <linux/bug.h>
7#include <asm/system.h>
8 7
9struct task_struct; 8struct task_struct;
10 9
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 47fbf6b3dc7..88ec80670d5 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -22,7 +22,6 @@
22#include <linux/pstore.h> 22#include <linux/pstore.h>
23 23
24#include <asm/page.h> 24#include <asm/page.h>
25#include <asm/system.h>
26 25
27#define EFI_SUCCESS 0 26#define EFI_SUCCESS 0
28#define EFI_LOAD_ERROR ( 1 | (1UL << (BITS_PER_LONG-1))) 27#define EFI_LOAD_ERROR ( 1 | (1UL << (BITS_PER_LONG-1)))
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 7afe15f916d..b17974917db 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -22,7 +22,6 @@
22#include <acpi/acpi.h> 22#include <acpi/acpi.h>
23#endif 23#endif
24#include <asm/byteorder.h> 24#include <asm/byteorder.h>
25#include <asm/system.h>
26#include <asm/io.h> 25#include <asm/io.h>
27 26
28/* for request_sense */ 27/* for request_sense */
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 3f830e00511..2aea5d22db0 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -19,7 +19,6 @@
19 19
20#include <linux/atomic.h> 20#include <linux/atomic.h>
21#include <asm/ptrace.h> 21#include <asm/ptrace.h>
22#include <asm/system.h>
23 22
24/* 23/*
25 * These correspond to the IORESOURCE_IRQ_* defines in 24 * These correspond to the IORESOURCE_IRQ_* defines in
diff --git a/include/linux/llist.h b/include/linux/llist.h
index 801b44b07aa..a5199f6d0e8 100644
--- a/include/linux/llist.h
+++ b/include/linux/llist.h
@@ -56,8 +56,7 @@
56 */ 56 */
57 57
58#include <linux/kernel.h> 58#include <linux/kernel.h>
59#include <asm/system.h> 59#include <asm/cmpxchg.h>
60#include <asm/processor.h>
61 60
62struct llist_head { 61struct llist_head {
63 struct llist_node *first; 62 struct llist_node *first;
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h
index 88e78dedc2e..eab507f2b1c 100644
--- a/include/linux/lsm_audit.h
+++ b/include/linux/lsm_audit.h
@@ -21,7 +21,6 @@
21#include <linux/path.h> 21#include <linux/path.h>
22#include <linux/key.h> 22#include <linux/key.h>
23#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24#include <asm/system.h>
25 24
26 25
27/* Auxiliary data to use in generating the audit record. */ 26/* Auxiliary data to use in generating the audit record. */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index cf798233610..f2a60dde8c9 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1258,6 +1258,8 @@ static inline void pgtable_page_dtor(struct page *page)
1258extern void free_area_init(unsigned long * zones_size); 1258extern void free_area_init(unsigned long * zones_size);
1259extern void free_area_init_node(int nid, unsigned long * zones_size, 1259extern void free_area_init_node(int nid, unsigned long * zones_size,
1260 unsigned long zone_start_pfn, unsigned long *zholes_size); 1260 unsigned long zone_start_pfn, unsigned long *zholes_size);
1261extern void free_initmem(void);
1262
1261#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 1263#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
1262/* 1264/*
1263 * With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its 1265 * With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 94e924e2ecd..3595a0236b0 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -29,8 +29,8 @@
29#include <linux/kernel.h> 29#include <linux/kernel.h>
30 30
31#include <asm/unaligned.h> 31#include <asm/unaligned.h>
32#include <asm/system.h>
33#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/barrier.h>
34 34
35#ifdef CONFIG_MTD_MAP_BANK_WIDTH_1 35#ifdef CONFIG_MTD_MAP_BANK_WIDTH_1
36#define map_bankwidth(map) 1 36#define map_bankwidth(map) 1
diff --git a/include/linux/parport.h b/include/linux/parport.h
index 38a423ed3c0..106c2ca9440 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -100,7 +100,6 @@ typedef enum {
100#include <linux/wait.h> 100#include <linux/wait.h>
101#include <linux/irqreturn.h> 101#include <linux/irqreturn.h>
102#include <linux/semaphore.h> 102#include <linux/semaphore.h>
103#include <asm/system.h>
104#include <asm/ptrace.h> 103#include <asm/ptrace.h>
105 104
106/* Define this later. */ 105/* Define this later. */
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 63d40655439..54bd7cd7ecb 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -14,7 +14,6 @@
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16 16
17#include <asm/system.h>
18#include <linux/atomic.h> 17#include <linux/atomic.h>
19 18
20struct rw_semaphore; 19struct rw_semaphore;
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 0c3854b0d4b..81a173c0897 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -63,7 +63,6 @@ struct sched_param {
63#include <linux/nodemask.h> 63#include <linux/nodemask.h>
64#include <linux/mm_types.h> 64#include <linux/mm_types.h>
65 65
66#include <asm/system.h>
67#include <asm/page.h> 66#include <asm/page.h>
68#include <asm/ptrace.h> 67#include <asm/ptrace.h>
69#include <asm/cputime.h> 68#include <asm/cputime.h>
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 192250bd49f..33370271b8b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -501,7 +501,6 @@ struct sk_buff {
501 */ 501 */
502#include <linux/slab.h> 502#include <linux/slab.h>
503 503
504#include <asm/system.h>
505 504
506/* 505/*
507 * skb might have a dst pointer attached, refcounted or not. 506 * skb might have a dst pointer attached, refcounted or not.
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 36323908726..7d537ced949 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -55,8 +55,8 @@
55#include <linux/kernel.h> 55#include <linux/kernel.h>
56#include <linux/stringify.h> 56#include <linux/stringify.h>
57#include <linux/bottom_half.h> 57#include <linux/bottom_half.h>
58#include <asm/barrier.h>
58 59
59#include <asm/system.h>
60 60
61/* 61/*
62 * Must define these before including other files, inline functions need them 62 * Must define these before including other files, inline functions need them
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index c170edc3bf5..3b5e910d14c 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -5,7 +5,6 @@
5#include <linux/cpumask.h> 5#include <linux/cpumask.h>
6#include <linux/smp.h> 6#include <linux/smp.h>
7#include <linux/list.h> 7#include <linux/list.h>
8#include <asm/system.h>
9 8
10/* 9/*
11 * stop_cpu[s]() is simplistic per-cpu maximum priority cpu 10 * stop_cpu[s]() is simplistic per-cpu maximum priority cpu
diff --git a/include/linux/tty.h b/include/linux/tty.h
index a91ff403b3b..9f47ab540f6 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -44,7 +44,6 @@
44#include <linux/tty_ldisc.h> 44#include <linux/tty_ldisc.h>
45#include <linux/mutex.h> 45#include <linux/mutex.h>
46 46
47#include <asm/system.h>
48 47
49 48
50/* 49/*
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 7d9a9e990ce..1dee81c41ff 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -22,7 +22,6 @@
22#include <linux/list.h> 22#include <linux/list.h>
23#include <linux/stddef.h> 23#include <linux/stddef.h>
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <asm/system.h>
26#include <asm/current.h> 25#include <asm/current.h>
27 26
28typedef struct __wait_queue wait_queue_t; 27typedef struct __wait_queue wait_queue_t;
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index 03c85d7387f..6a198e46ab6 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -23,6 +23,7 @@ int xen_create_contiguous_region(unsigned long vstart, unsigned int order,
23 23
24void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order); 24void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order);
25 25
26struct vm_area_struct;
26int xen_remap_domain_mfn_range(struct vm_area_struct *vma, 27int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
27 unsigned long addr, 28 unsigned long addr,
28 unsigned long mfn, int nr, 29 unsigned long mfn, int nr,
diff --git a/init/main.c b/init/main.c
index 439715858ba..9d454f09f3b 100644
--- a/init/main.c
+++ b/init/main.c
@@ -87,7 +87,6 @@ extern void mca_init(void);
87extern void sbus_init(void); 87extern void sbus_init(void);
88extern void prio_tree_init(void); 88extern void prio_tree_init(void);
89extern void radix_tree_init(void); 89extern void radix_tree_init(void);
90extern void free_initmem(void);
91#ifndef CONFIG_DEBUG_RODATA 90#ifndef CONFIG_DEBUG_RODATA
92static inline void mark_rodata_ro(void) { } 91static inline void mark_rodata_ro(void) { }
93#endif 92#endif
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
index 3f88a45e6f0..1dc53bae56e 100644
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -53,7 +53,6 @@
53#include <asm/cacheflush.h> 53#include <asm/cacheflush.h>
54#include <asm/byteorder.h> 54#include <asm/byteorder.h>
55#include <linux/atomic.h> 55#include <linux/atomic.h>
56#include <asm/system.h>
57 56
58#include "debug_core.h" 57#include "debug_core.h"
59 58
diff --git a/kernel/debug/kdb/kdb_bt.c b/kernel/debug/kdb/kdb_bt.c
index 7179eac7b41..07c9bbb94a0 100644
--- a/kernel/debug/kdb/kdb_bt.c
+++ b/kernel/debug/kdb/kdb_bt.c
@@ -15,7 +15,6 @@
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/kdb.h> 16#include <linux/kdb.h>
17#include <linux/nmi.h> 17#include <linux/nmi.h>
18#include <asm/system.h>
19#include "kdb_private.h" 18#include "kdb_private.h"
20 19
21 20
diff --git a/kernel/dma.c b/kernel/dma.c
index 68a2306522c..6c6262f86c1 100644
--- a/kernel/dma.c
+++ b/kernel/dma.c
@@ -18,7 +18,6 @@
18#include <linux/proc_fs.h> 18#include <linux/proc_fs.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <asm/dma.h> 20#include <asm/dma.h>
21#include <asm/system.h>
22 21
23 22
24 23
diff --git a/kernel/kexec.c b/kernel/kexec.c
index a6a675cb981..2a0deffa5db 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -37,7 +37,6 @@
37#include <asm/page.h> 37#include <asm/page.h>
38#include <asm/uaccess.h> 38#include <asm/uaccess.h>
39#include <asm/io.h> 39#include <asm/io.h>
40#include <asm/system.h>
41#include <asm/sections.h> 40#include <asm/sections.h>
42 41
43/* Per cpu memory for storing cpu states in case of system crash. */ 42/* Per cpu memory for storing cpu states in case of system crash. */
diff --git a/kernel/rwsem.c b/kernel/rwsem.c
index b152f74f02d..6850f53e02d 100644
--- a/kernel/rwsem.c
+++ b/kernel/rwsem.c
@@ -10,7 +10,6 @@
10#include <linux/export.h> 10#include <linux/export.h>
11#include <linux/rwsem.h> 11#include <linux/rwsem.h>
12 12
13#include <asm/system.h>
14#include <linux/atomic.h> 13#include <linux/atomic.h>
15 14
16/* 15/*
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 503d6426126..157fb9b2b18 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -73,6 +73,7 @@
73#include <linux/init_task.h> 73#include <linux/init_task.h>
74#include <linux/binfmts.h> 74#include <linux/binfmts.h>
75 75
76#include <asm/switch_to.h>
76#include <asm/tlb.h> 77#include <asm/tlb.h>
77#include <asm/irq_regs.h> 78#include <asm/irq_regs.h>
78#include <asm/mutex.h> 79#include <asm/mutex.h>
diff --git a/kernel/signal.c b/kernel/signal.c
index d523da02dd1..17afcaf582d 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -36,6 +36,7 @@
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37#include <asm/unistd.h> 37#include <asm/unistd.h>
38#include <asm/siginfo.h> 38#include <asm/siginfo.h>
39#include <asm/cacheflush.h>
39#include "audit.h" /* audit_signal_info() */ 40#include "audit.h" /* audit_signal_info() */
40 41
41/* 42/*
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index d48ff4fd44c..803a374f676 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -68,6 +68,9 @@
68#include <asm/stacktrace.h> 68#include <asm/stacktrace.h>
69#include <asm/io.h> 69#include <asm/io.h>
70#endif 70#endif
71#ifdef CONFIG_SPARC
72#include <asm/setup.h>
73#endif
71#ifdef CONFIG_BSD_PROCESS_ACCT 74#ifdef CONFIG_BSD_PROCESS_ACCT
72#include <linux/acct.h> 75#include <linux/acct.h>
73#endif 76#endif
@@ -142,7 +145,6 @@ static const int cap_last_cap = CAP_LAST_CAP;
142#include <linux/inotify.h> 145#include <linux/inotify.h>
143#endif 146#endif
144#ifdef CONFIG_SPARC 147#ifdef CONFIG_SPARC
145#include <asm/system.h>
146#endif 148#endif
147 149
148#ifdef CONFIG_SPARC64 150#ifdef CONFIG_SPARC64
diff --git a/lib/llist.c b/lib/llist.c
index 8221b3d2fbf..4a15115e90f 100644
--- a/lib/llist.c
+++ b/lib/llist.c
@@ -27,7 +27,6 @@
27#include <linux/interrupt.h> 27#include <linux/interrupt.h>
28#include <linux/llist.h> 28#include <linux/llist.h>
29 29
30#include <asm/system.h>
31 30
32/** 31/**
33 * llist_add_batch - add several linked entries in batch 32 * llist_add_batch - add several linked entries in batch
diff --git a/lib/raid6/altivec.uc b/lib/raid6/altivec.uc
index 2654d5c854b..b71012b756f 100644
--- a/lib/raid6/altivec.uc
+++ b/lib/raid6/altivec.uc
@@ -28,8 +28,8 @@
28 28
29#include <altivec.h> 29#include <altivec.h>
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31# include <asm/system.h>
32# include <asm/cputable.h> 31# include <asm/cputable.h>
32# include <asm/switch_to.h>
33#endif 33#endif
34 34
35/* 35/*
diff --git a/net/802/fc.c b/net/802/fc.c
index bd345f3d29f..b324e31401a 100644
--- a/net/802/fc.c
+++ b/net/802/fc.c
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14#include <asm/system.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/string.h> 16#include <linux/string.h>
diff --git a/net/802/fddi.c b/net/802/fddi.c
index 94b3ad08f39..5ab25cd4314 100644
--- a/net/802/fddi.c
+++ b/net/802/fddi.c
@@ -27,7 +27,6 @@
27 */ 27 */
28 28
29#include <linux/module.h> 29#include <linux/module.h>
30#include <asm/system.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/kernel.h> 31#include <linux/kernel.h>
33#include <linux/string.h> 32#include <linux/string.h>
diff --git a/net/802/hippi.c b/net/802/hippi.c
index 91aca8780fd..056794e6637 100644
--- a/net/802/hippi.c
+++ b/net/802/hippi.c
@@ -35,7 +35,6 @@
35#include <net/arp.h> 35#include <net/arp.h>
36#include <net/sock.h> 36#include <net/sock.h>
37#include <asm/uaccess.h> 37#include <asm/uaccess.h>
38#include <asm/system.h>
39 38
40/* 39/*
41 * Create the HIPPI MAC header for an arbitrary protocol layer 40 * Create the HIPPI MAC header for an arbitrary protocol layer
diff --git a/net/802/tr.c b/net/802/tr.c
index 5e20cf8a074..b9a3a145e34 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -16,7 +16,6 @@
16 */ 16 */
17 17
18#include <asm/uaccess.h> 18#include <asm/uaccess.h>
19#include <asm/system.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/types.h> 20#include <linux/types.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 5de42ea309b..8ae3a787933 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -37,7 +37,6 @@
37#include <linux/param.h> /* for HZ */ 37#include <linux/param.h> /* for HZ */
38#include <linux/uaccess.h> 38#include <linux/uaccess.h>
39#include <asm/byteorder.h> /* for htons etc. */ 39#include <asm/byteorder.h> /* for htons etc. */
40#include <asm/system.h> /* save/restore_flags */
41#include <linux/atomic.h> 40#include <linux/atomic.h>
42 41
43#include "common.h" 42#include "common.h"
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 3cd0a0dc91c..0906c194a41 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -33,7 +33,6 @@
33#include <linux/skbuff.h> 33#include <linux/skbuff.h>
34#include <net/sock.h> 34#include <net/sock.h>
35#include <asm/uaccess.h> 35#include <asm/uaccess.h>
36#include <asm/system.h>
37#include <linux/fcntl.h> 36#include <linux/fcntl.h>
38#include <linux/termios.h> /* For TIOCINQ/OUTQ */ 37#include <linux/termios.h> /* For TIOCINQ/OUTQ */
39#include <linux/mm.h> 38#include <linux/mm.h>
diff --git a/net/ax25/ax25_addr.c b/net/ax25/ax25_addr.c
index 7e7964dd987..9162409559c 100644
--- a/net/ax25/ax25_addr.c
+++ b/net/ax25/ax25_addr.c
@@ -22,7 +22,6 @@
22#include <linux/skbuff.h> 22#include <linux/skbuff.h>
23#include <net/sock.h> 23#include <net/sock.h>
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25#include <asm/system.h>
26#include <linux/fcntl.h> 25#include <linux/fcntl.h>
27#include <linux/mm.h> 26#include <linux/mm.h>
28#include <linux/interrupt.h> 27#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c
index c1cb982f6e8..d0de30e8959 100644
--- a/net/ax25/ax25_dev.c
+++ b/net/ax25/ax25_dev.c
@@ -24,7 +24,6 @@
24#include <linux/skbuff.h> 24#include <linux/skbuff.h>
25#include <net/sock.h> 25#include <net/sock.h>
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/system.h>
28#include <linux/fcntl.h> 27#include <linux/fcntl.h>
29#include <linux/mm.h> 28#include <linux/mm.h>
30#include <linux/interrupt.h> 29#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_ds_in.c b/net/ax25/ax25_ds_in.c
index 8273b1200ee..9bd31e88aec 100644
--- a/net/ax25/ax25_ds_in.c
+++ b/net/ax25/ax25_ds_in.c
@@ -23,7 +23,6 @@
23#include <net/sock.h> 23#include <net/sock.h>
24#include <net/tcp_states.h> 24#include <net/tcp_states.h>
25#include <asm/uaccess.h> 25#include <asm/uaccess.h>
26#include <asm/system.h>
27#include <linux/fcntl.h> 26#include <linux/fcntl.h>
28#include <linux/mm.h> 27#include <linux/mm.h>
29#include <linux/interrupt.h> 28#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_ds_subr.c b/net/ax25/ax25_ds_subr.c
index 85816e612dc..5ea7fd3e2af 100644
--- a/net/ax25/ax25_ds_subr.c
+++ b/net/ax25/ax25_ds_subr.c
@@ -24,7 +24,6 @@
24#include <linux/skbuff.h> 24#include <linux/skbuff.h>
25#include <net/sock.h> 25#include <net/sock.h>
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/system.h>
28#include <linux/fcntl.h> 27#include <linux/fcntl.h>
29#include <linux/mm.h> 28#include <linux/mm.h>
30#include <linux/interrupt.h> 29#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_ds_timer.c b/net/ax25/ax25_ds_timer.c
index c7d81436213..993c439b4f7 100644
--- a/net/ax25/ax25_ds_timer.c
+++ b/net/ax25/ax25_ds_timer.c
@@ -25,7 +25,6 @@
25#include <linux/skbuff.h> 25#include <linux/skbuff.h>
26#include <net/sock.h> 26#include <net/sock.h>
27#include <asm/uaccess.h> 27#include <asm/uaccess.h>
28#include <asm/system.h>
29#include <linux/fcntl.h> 28#include <linux/fcntl.h>
30#include <linux/mm.h> 29#include <linux/mm.h>
31#include <linux/interrupt.h> 30#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_iface.c b/net/ax25/ax25_iface.c
index 60b545e2822..7d5f24b82cc 100644
--- a/net/ax25/ax25_iface.c
+++ b/net/ax25/ax25_iface.c
@@ -24,7 +24,6 @@
24#include <linux/skbuff.h> 24#include <linux/skbuff.h>
25#include <net/sock.h> 25#include <net/sock.h>
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/system.h>
28#include <linux/fcntl.h> 27#include <linux/fcntl.h>
29#include <linux/mm.h> 28#include <linux/mm.h>
30#include <linux/interrupt.h> 29#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c
index 9bb77654120..96f4cab3a2f 100644
--- a/net/ax25/ax25_in.c
+++ b/net/ax25/ax25_in.c
@@ -27,7 +27,6 @@
27#include <net/sock.h> 27#include <net/sock.h>
28#include <net/tcp_states.h> 28#include <net/tcp_states.h>
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <asm/system.h>
31#include <linux/fcntl.h> 30#include <linux/fcntl.h>
32#include <linux/mm.h> 31#include <linux/mm.h>
33#include <linux/interrupt.h> 32#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c
index cf0c47a2653..846ae4e2b11 100644
--- a/net/ax25/ax25_ip.c
+++ b/net/ax25/ax25_ip.c
@@ -24,7 +24,6 @@
24#include <linux/skbuff.h> 24#include <linux/skbuff.h>
25#include <net/sock.h> 25#include <net/sock.h>
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/system.h>
28#include <linux/fcntl.h> 27#include <linux/fcntl.h>
29#include <linux/termios.h> /* For TIOCINQ/OUTQ */ 28#include <linux/termios.h> /* For TIOCINQ/OUTQ */
30#include <linux/mm.h> 29#include <linux/mm.h>
diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c
index 37507d806f6..be8a25e0db6 100644
--- a/net/ax25/ax25_out.c
+++ b/net/ax25/ax25_out.c
@@ -27,7 +27,6 @@
27#include <linux/netfilter.h> 27#include <linux/netfilter.h>
28#include <net/sock.h> 28#include <net/sock.h>
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <asm/system.h>
31#include <linux/fcntl.h> 30#include <linux/fcntl.h>
32#include <linux/mm.h> 31#include <linux/mm.h>
33#include <linux/interrupt.h> 32#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c
index 87fddab22e0..a65588040b9 100644
--- a/net/ax25/ax25_route.c
+++ b/net/ax25/ax25_route.c
@@ -32,7 +32,6 @@
32#include <linux/spinlock.h> 32#include <linux/spinlock.h>
33#include <net/sock.h> 33#include <net/sock.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35#include <asm/system.h>
36#include <linux/fcntl.h> 35#include <linux/fcntl.h>
37#include <linux/mm.h> 36#include <linux/mm.h>
38#include <linux/interrupt.h> 37#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_std_in.c b/net/ax25/ax25_std_in.c
index a8eef88d865..3fbf8f7b2cf 100644
--- a/net/ax25/ax25_std_in.c
+++ b/net/ax25/ax25_std_in.c
@@ -30,7 +30,6 @@
30#include <net/sock.h> 30#include <net/sock.h>
31#include <net/tcp_states.h> 31#include <net/tcp_states.h>
32#include <asm/uaccess.h> 32#include <asm/uaccess.h>
33#include <asm/system.h>
34#include <linux/fcntl.h> 33#include <linux/fcntl.h>
35#include <linux/mm.h> 34#include <linux/mm.h>
36#include <linux/interrupt.h> 35#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_std_subr.c b/net/ax25/ax25_std_subr.c
index 277f81bb979..8b66a41e538 100644
--- a/net/ax25/ax25_std_subr.c
+++ b/net/ax25/ax25_std_subr.c
@@ -21,7 +21,6 @@
21#include <linux/skbuff.h> 21#include <linux/skbuff.h>
22#include <net/sock.h> 22#include <net/sock.h>
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <asm/system.h>
25#include <linux/fcntl.h> 24#include <linux/fcntl.h>
26#include <linux/mm.h> 25#include <linux/mm.h>
27#include <linux/interrupt.h> 26#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_std_timer.c b/net/ax25/ax25_std_timer.c
index 96e4b927325..004467c9e6e 100644
--- a/net/ax25/ax25_std_timer.c
+++ b/net/ax25/ax25_std_timer.c
@@ -25,7 +25,6 @@
25#include <net/sock.h> 25#include <net/sock.h>
26#include <net/tcp_states.h> 26#include <net/tcp_states.h>
27#include <asm/uaccess.h> 27#include <asm/uaccess.h>
28#include <asm/system.h>
29#include <linux/fcntl.h> 28#include <linux/fcntl.h>
30#include <linux/mm.h> 29#include <linux/mm.h>
31#include <linux/interrupt.h> 30#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c
index c6715ee4ab8..1997538a5d2 100644
--- a/net/ax25/ax25_subr.c
+++ b/net/ax25/ax25_subr.c
@@ -26,7 +26,6 @@
26#include <net/sock.h> 26#include <net/sock.h>
27#include <net/tcp_states.h> 27#include <net/tcp_states.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/system.h>
30#include <linux/fcntl.h> 29#include <linux/fcntl.h>
31#include <linux/mm.h> 30#include <linux/mm.h>
32#include <linux/interrupt.h> 31#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_timer.c b/net/ax25/ax25_timer.c
index db29ea71e80..c3cffa79baf 100644
--- a/net/ax25/ax25_timer.c
+++ b/net/ax25/ax25_timer.c
@@ -29,7 +29,6 @@
29#include <linux/skbuff.h> 29#include <linux/skbuff.h>
30#include <net/sock.h> 30#include <net/sock.h>
31#include <asm/uaccess.h> 31#include <asm/uaccess.h>
32#include <asm/system.h>
33#include <linux/fcntl.h> 32#include <linux/fcntl.h>
34#include <linux/mm.h> 33#include <linux/mm.h>
35#include <linux/interrupt.h> 34#include <linux/interrupt.h>
diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c
index 4c83137b595..e3c579ba632 100644
--- a/net/ax25/ax25_uid.c
+++ b/net/ax25/ax25_uid.c
@@ -26,7 +26,6 @@
26#include <linux/skbuff.h> 26#include <linux/skbuff.h>
27#include <net/sock.h> 27#include <net/sock.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/system.h>
30#include <linux/fcntl.h> 29#include <linux/fcntl.h>
31#include <linux/mm.h> 30#include <linux/mm.h>
32#include <linux/interrupt.h> 31#include <linux/interrupt.h>
diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c
index 9f9c8dcd8af..180bfc45810 100644
--- a/net/bluetooth/bnep/sock.c
+++ b/net/bluetooth/bnep/sock.c
@@ -42,7 +42,6 @@
42#include <linux/uaccess.h> 42#include <linux/uaccess.h>
43#include <net/sock.h> 43#include <net/sock.h>
44 44
45#include <asm/system.h>
46 45
47#include "bnep.h" 46#include "bnep.h"
48 47
diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c
index 1230faaac29..311668d1457 100644
--- a/net/bluetooth/cmtp/sock.c
+++ b/net/bluetooth/cmtp/sock.c
@@ -39,7 +39,6 @@
39 39
40#include <linux/isdn/capilli.h> 40#include <linux/isdn/capilli.h>
41 41
42#include <asm/system.h>
43 42
44#include "cmtp.h" 43#include "cmtp.h"
45 44
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 947172bf162..5238b6b3ea6 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -37,7 +37,6 @@
37#include <linux/interrupt.h> 37#include <linux/interrupt.h>
38#include <net/sock.h> 38#include <net/sock.h>
39 39
40#include <asm/system.h>
41#include <linux/uaccess.h> 40#include <linux/uaccess.h>
42#include <asm/unaligned.h> 41#include <asm/unaligned.h>
43 42
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 59ec99eb739..e33af63a884 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -45,7 +45,6 @@
45#include <linux/crypto.h> 45#include <linux/crypto.h>
46#include <net/sock.h> 46#include <net/sock.h>
47 47
48#include <asm/system.h>
49#include <linux/uaccess.h> 48#include <linux/uaccess.h>
50#include <asm/unaligned.h> 49#include <asm/unaligned.h>
51 50
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index badb7851d11..b37531094c4 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -37,7 +37,6 @@
37#include <linux/interrupt.h> 37#include <linux/interrupt.h>
38#include <net/sock.h> 38#include <net/sock.h>
39 39
40#include <asm/system.h>
41#include <linux/uaccess.h> 40#include <linux/uaccess.h>
42#include <asm/unaligned.h> 41#include <asm/unaligned.h>
43 42
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 63afd234283..49142612916 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -42,7 +42,6 @@
42#include <linux/ioctl.h> 42#include <linux/ioctl.h>
43#include <net/sock.h> 43#include <net/sock.h>
44 44
45#include <asm/system.h>
46#include <linux/uaccess.h> 45#include <linux/uaccess.h>
47#include <asm/unaligned.h> 46#include <asm/unaligned.h>
48 47
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 3e450f4a312..b8e17e4dac8 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -49,7 +49,6 @@
49#include <linux/crc16.h> 49#include <linux/crc16.h>
50#include <net/sock.h> 50#include <net/sock.h>
51 51
52#include <asm/system.h>
53#include <asm/unaligned.h> 52#include <asm/unaligned.h>
54 53
55#include <net/bluetooth/bluetooth.h> 54#include <net/bluetooth/bluetooth.h>
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 22169c3f148..a55a43e9f70 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -45,7 +45,6 @@
45#include <linux/security.h> 45#include <linux/security.h>
46#include <net/sock.h> 46#include <net/sock.h>
47 47
48#include <asm/system.h>
49#include <linux/uaccess.h> 48#include <linux/uaccess.h>
50 49
51#include <net/bluetooth/bluetooth.h> 50#include <net/bluetooth/bluetooth.h>
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 8bf26d1bc5c..f6ab1290796 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -44,7 +44,6 @@
44#include <linux/security.h> 44#include <linux/security.h>
45#include <net/sock.h> 45#include <net/sock.h>
46 46
47#include <asm/system.h>
48#include <linux/uaccess.h> 47#include <linux/uaccess.h>
49 48
50#include <net/bluetooth/bluetooth.h> 49#include <net/bluetooth/bluetooth.h>
diff --git a/net/core/datagram.c b/net/core/datagram.c
index d3cf12f62c8..e4fbfd6e2bd 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -37,7 +37,6 @@
37#include <linux/types.h> 37#include <linux/types.h>
38#include <linux/kernel.h> 38#include <linux/kernel.h>
39#include <asm/uaccess.h> 39#include <asm/uaccess.h>
40#include <asm/system.h>
41#include <linux/mm.h> 40#include <linux/mm.h>
42#include <linux/interrupt.h> 41#include <linux/interrupt.h>
43#include <linux/errno.h> 42#include <linux/errno.h>
diff --git a/net/core/dev.c b/net/core/dev.c
index 452db7090d1..5d59155adf2 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -73,7 +73,6 @@
73 */ 73 */
74 74
75#include <asm/uaccess.h> 75#include <asm/uaccess.h>
76#include <asm/system.h>
77#include <linux/bitops.h> 76#include <linux/bitops.h>
78#include <linux/capability.h> 77#include <linux/capability.h>
79#include <linux/cpu.h> 78#include <linux/cpu.h>
diff --git a/net/core/filter.c b/net/core/filter.c
index 5dea4527921..cf4989ac503 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -33,7 +33,6 @@
33#include <net/sock.h> 33#include <net/sock.h>
34#include <linux/errno.h> 34#include <linux/errno.h>
35#include <linux/timer.h> 35#include <linux/timer.h>
36#include <asm/system.h>
37#include <asm/uaccess.h> 36#include <asm/uaccess.h>
38#include <asm/unaligned.h> 37#include <asm/unaligned.h>
39#include <linux/filter.h> 38#include <linux/filter.h>
diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c
index 43b03dd71e8..d9d198aa9fe 100644
--- a/net/core/gen_estimator.c
+++ b/net/core/gen_estimator.c
@@ -14,7 +14,6 @@
14 */ 14 */
15 15
16#include <asm/uaccess.h> 16#include <asm/uaccess.h>
17#include <asm/system.h>
18#include <linux/bitops.h> 17#include <linux/bitops.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/types.h> 19#include <linux/types.h>
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 1a63c6efd2e..90430b776ec 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -38,7 +38,6 @@
38#include <linux/pci.h> 38#include <linux/pci.h>
39 39
40#include <asm/uaccess.h> 40#include <asm/uaccess.h>
41#include <asm/system.h>
42 41
43#include <linux/inet.h> 42#include <linux/inet.h>
44#include <linux/netdevice.h> 43#include <linux/netdevice.h>
diff --git a/net/core/scm.c b/net/core/scm.c
index ff52ad0a515..611c5efd4cb 100644
--- a/net/core/scm.c
+++ b/net/core/scm.c
@@ -28,7 +28,6 @@
28#include <linux/nsproxy.h> 28#include <linux/nsproxy.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30 30
31#include <asm/system.h>
32#include <asm/uaccess.h> 31#include <asm/uaccess.h>
33 32
34#include <net/protocol.h> 33#include <net/protocol.h>
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index a690cae91cd..f223cdc75da 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -66,7 +66,6 @@
66#include <net/xfrm.h> 66#include <net/xfrm.h>
67 67
68#include <asm/uaccess.h> 68#include <asm/uaccess.h>
69#include <asm/system.h>
70#include <trace/events/skb.h> 69#include <trace/events/skb.h>
71 70
72#include "kmap_skb.h" 71#include "kmap_skb.h"
diff --git a/net/core/sock.c b/net/core/sock.c
index 9be6d0d6c53..b2e14c07d92 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -115,7 +115,6 @@
115#include <linux/memcontrol.h> 115#include <linux/memcontrol.h>
116 116
117#include <asm/uaccess.h> 117#include <asm/uaccess.h>
118#include <asm/system.h>
119 118
120#include <linux/netdevice.h> 119#include <linux/netdevice.h>
121#include <net/protocol.h> 120#include <net/protocol.h>
diff --git a/net/core/utils.c b/net/core/utils.c
index 386e263f606..dc3c3faff2f 100644
--- a/net/core/utils.c
+++ b/net/core/utils.c
@@ -30,7 +30,6 @@
30#include <net/net_ratelimit.h> 30#include <net/net_ratelimit.h>
31 31
32#include <asm/byteorder.h> 32#include <asm/byteorder.h>
33#include <asm/system.h>
34#include <asm/uaccess.h> 33#include <asm/uaccess.h>
35 34
36int net_msg_warn __read_mostly = 1; 35int net_msg_warn __read_mostly = 1;
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 19acd00a638..4136987d94d 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -119,7 +119,6 @@ Version 0.0.6 2.1.110 07-aug-98 Eduardo Marcelo Serrat
119#include <net/sock.h> 119#include <net/sock.h>
120#include <net/tcp_states.h> 120#include <net/tcp_states.h>
121#include <net/flow.h> 121#include <net/flow.h>
122#include <asm/system.h>
123#include <asm/ioctls.h> 122#include <asm/ioctls.h>
124#include <linux/capability.h> 123#include <linux/capability.h>
125#include <linux/mm.h> 124#include <linux/mm.h>
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 74d321a60e7..c00e3077988 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -42,7 +42,6 @@
42#include <linux/notifier.h> 42#include <linux/notifier.h>
43#include <linux/slab.h> 43#include <linux/slab.h>
44#include <asm/uaccess.h> 44#include <asm/uaccess.h>
45#include <asm/system.h>
46#include <net/net_namespace.h> 45#include <net/net_namespace.h>
47#include <net/neighbour.h> 46#include <net/neighbour.h>
48#include <net/dst.h> 47#include <net/dst.h>
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c
index 73fa268fe2e..f6544b2c91b 100644
--- a/net/decnet/dn_nsp_in.c
+++ b/net/decnet/dn_nsp_in.c
@@ -60,7 +60,6 @@
60#include <linux/slab.h> 60#include <linux/slab.h>
61#include <net/sock.h> 61#include <net/sock.h>
62#include <net/tcp_states.h> 62#include <net/tcp_states.h>
63#include <asm/system.h>
64#include <linux/fcntl.h> 63#include <linux/fcntl.h>
65#include <linux/mm.h> 64#include <linux/mm.h>
66#include <linux/termios.h> 65#include <linux/termios.h>
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c
index bd78836a81e..e446e85e64a 100644
--- a/net/decnet/dn_nsp_out.c
+++ b/net/decnet/dn_nsp_out.c
@@ -52,7 +52,6 @@
52#include <linux/route.h> 52#include <linux/route.h>
53#include <linux/slab.h> 53#include <linux/slab.h>
54#include <net/sock.h> 54#include <net/sock.h>
55#include <asm/system.h>
56#include <linux/fcntl.h> 55#include <linux/fcntl.h>
57#include <linux/mm.h> 56#include <linux/mm.h>
58#include <linux/termios.h> 57#include <linux/termios.h>
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index 7e717cb35ad..71b5edcee40 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -47,7 +47,6 @@
47#include <linux/mutex.h> 47#include <linux/mutex.h>
48 48
49#include <linux/uaccess.h> 49#include <linux/uaccess.h>
50#include <asm/system.h>
51 50
52static const struct proto_ops econet_ops; 51static const struct proto_ops econet_ops;
53static struct hlist_head econet_sklist; 52static struct hlist_head econet_sklist;
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index a93af86b847..bf10a311cf1 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -59,7 +59,6 @@
59#include <net/ip.h> 59#include <net/ip.h>
60#include <net/dsa.h> 60#include <net/dsa.h>
61#include <asm/uaccess.h> 61#include <asm/uaccess.h>
62#include <asm/system.h>
63 62
64__setup("ether=", netdev_boot_setup); 63__setup("ether=", netdev_boot_setup);
65 64
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index fdf49fd44bb..10e3751466b 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -91,7 +91,6 @@
91#include <linux/slab.h> 91#include <linux/slab.h>
92 92
93#include <asm/uaccess.h> 93#include <asm/uaccess.h>
94#include <asm/system.h>
95 94
96#include <linux/inet.h> 95#include <linux/inet.h>
97#include <linux/igmp.h> 96#include <linux/igmp.h>
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 73f46d691ab..18d9b81ecb1 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -113,7 +113,6 @@
113#include <net/ax25.h> 113#include <net/ax25.h>
114#include <net/netrom.h> 114#include <net/netrom.h>
115 115
116#include <asm/system.h>
117#include <linux/uaccess.h> 116#include <linux/uaccess.h>
118 117
119#include <linux/netfilter_arp.h> 118#include <linux/netfilter_arp.h>
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index d4fad5c7744..6e447ff94df 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -27,7 +27,6 @@
27 27
28 28
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <asm/system.h>
31#include <linux/bitops.h> 30#include <linux/bitops.h>
32#include <linux/capability.h> 31#include <linux/capability.h>
33#include <linux/module.h> 32#include <linux/module.h>
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 76e72bacc21..cbe3a68507c 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -15,7 +15,6 @@
15 15
16#include <linux/module.h> 16#include <linux/module.h>
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <asm/system.h>
19#include <linux/bitops.h> 18#include <linux/bitops.h>
20#include <linux/capability.h> 19#include <linux/capability.h>
21#include <linux/types.h> 20#include <linux/types.h>
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index a8c5c1d6715..5063fa38ac7 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -14,7 +14,6 @@
14 */ 14 */
15 15
16#include <asm/uaccess.h> 16#include <asm/uaccess.h>
17#include <asm/system.h>
18#include <linux/bitops.h> 17#include <linux/bitops.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index da9b9cb2282..bce36f1a37b 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -51,7 +51,6 @@
51#define VERSION "0.409" 51#define VERSION "0.409"
52 52
53#include <asm/uaccess.h> 53#include <asm/uaccess.h>
54#include <asm/system.h>
55#include <linux/bitops.h> 54#include <linux/bitops.h>
56#include <linux/types.h> 55#include <linux/types.h>
57#include <linux/kernel.h> 56#include <linux/kernel.h>
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 9664d353ccd..2cb2bf84564 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -91,7 +91,6 @@
91#include <linux/errno.h> 91#include <linux/errno.h>
92#include <linux/timer.h> 92#include <linux/timer.h>
93#include <linux/init.h> 93#include <linux/init.h>
94#include <asm/system.h>
95#include <asm/uaccess.h> 94#include <asm/uaccess.h>
96#include <net/checksum.h> 95#include <net/checksum.h>
97#include <net/xfrm.h> 96#include <net/xfrm.h>
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 450e5d21ed2..5dfecfd7d5e 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -73,7 +73,6 @@
73#include <linux/module.h> 73#include <linux/module.h>
74#include <linux/slab.h> 74#include <linux/slab.h>
75#include <asm/uaccess.h> 75#include <asm/uaccess.h>
76#include <asm/system.h>
77#include <linux/types.h> 76#include <linux/types.h>
78#include <linux/kernel.h> 77#include <linux/kernel.h>
79#include <linux/jiffies.h> 78#include <linux/jiffies.h>
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index f3f1108940f..26eccc5bab1 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -115,7 +115,6 @@
115 115
116#define pr_fmt(fmt) "IPv4: " fmt 116#define pr_fmt(fmt) "IPv4: " fmt
117 117
118#include <asm/system.h>
119#include <linux/module.h> 118#include <linux/module.h>
120#include <linux/types.h> 119#include <linux/types.h>
121#include <linux/kernel.h> 120#include <linux/kernel.h>
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index ff302bde889..4910176d24e 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -43,7 +43,6 @@
43 */ 43 */
44 44
45#include <asm/uaccess.h> 45#include <asm/uaccess.h>
46#include <asm/system.h>
47#include <linux/module.h> 46#include <linux/module.h>
48#include <linux/types.h> 47#include <linux/types.h>
49#include <linux/kernel.h> 48#include <linux/kernel.h>
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 0518a4fb177..960fbfc3e97 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -26,7 +26,6 @@
26 * 26 *
27 */ 27 */
28 28
29#include <asm/system.h>
30#include <asm/uaccess.h> 29#include <asm/uaccess.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/capability.h> 31#include <linux/capability.h>
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index ab6b36e6da1..50009c787bc 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -20,7 +20,6 @@
20 * 20 *
21 */ 21 */
22 22
23#include <asm/system.h>
24#include <linux/uaccess.h> 23#include <linux/uaccess.h>
25#include <linux/types.h> 24#include <linux/types.h>
26#include <linux/fcntl.h> 25#include <linux/fcntl.h>
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 12ccf880eb8..4dc1c104c94 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -66,7 +66,6 @@
66 66
67#include <linux/module.h> 67#include <linux/module.h>
68#include <asm/uaccess.h> 68#include <asm/uaccess.h>
69#include <asm/system.h>
70#include <linux/bitops.h> 69#include <linux/bitops.h>
71#include <linux/types.h> 70#include <linux/types.h>
72#include <linux/kernel.h> 71#include <linux/kernel.h>
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index d6f5feeb3ea..fe141052a1b 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -79,7 +79,6 @@
79 79
80#define pr_fmt(fmt) "UDP: " fmt 80#define pr_fmt(fmt) "UDP: " fmt
81 81
82#include <asm/system.h>
83#include <asm/uaccess.h> 82#include <asm/uaccess.h>
84#include <asm/ioctls.h> 83#include <asm/ioctls.h>
85#include <linux/bootmem.h> 84#include <linux/bootmem.h>
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 5605f9dca87..8ed1b930e75 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -60,7 +60,6 @@
60#endif 60#endif
61 61
62#include <asm/uaccess.h> 62#include <asm/uaccess.h>
63#include <asm/system.h>
64#include <linux/mroute6.h> 63#include <linux/mroute6.h>
65 64
66MODULE_AUTHOR("Cast of dozens"); 65MODULE_AUTHOR("Cast of dozens");
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index af88934e4d7..27ac95a6342 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -66,7 +66,6 @@
66#include <net/inet_common.h> 66#include <net/inet_common.h>
67 67
68#include <asm/uaccess.h> 68#include <asm/uaccess.h>
69#include <asm/system.h>
70 69
71/* 70/*
72 * The ICMP socket(s). This is the most convenient way to flow control 71 * The ICMP socket(s). This is the most convenient way to flow control
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 5aa3981a392..8110362e0af 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -16,7 +16,6 @@
16 * 16 *
17 */ 17 */
18 18
19#include <asm/system.h>
20#include <asm/uaccess.h> 19#include <asm/uaccess.h>
21#include <linux/types.h> 20#include <linux/types.h>
22#include <linux/sched.h> 21#include <linux/sched.h>
diff --git a/net/irda/irlan/irlan_client.c b/net/irda/irlan/irlan_client.c
index ba1a3fc39b5..42cf1390ce9 100644
--- a/net/irda/irlan/irlan_client.c
+++ b/net/irda/irlan/irlan_client.c
@@ -37,7 +37,6 @@
37#include <linux/bitops.h> 37#include <linux/bitops.h>
38#include <net/arp.h> 38#include <net/arp.h>
39 39
40#include <asm/system.h>
41#include <asm/byteorder.h> 40#include <asm/byteorder.h>
42 41
43#include <net/irda/irda.h> 42#include <net/irda/irda.h>
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
index 579617cca12..7ac4d1becbf 100644
--- a/net/irda/irlan/irlan_common.c
+++ b/net/irda/irlan/irlan_common.c
@@ -40,7 +40,6 @@
40#include <linux/moduleparam.h> 40#include <linux/moduleparam.h>
41#include <linux/bitops.h> 41#include <linux/bitops.h>
42 42
43#include <asm/system.h>
44#include <asm/byteorder.h> 43#include <asm/byteorder.h>
45 44
46#include <net/irda/irda.h> 45#include <net/irda/irda.h>
diff --git a/net/irda/irlan/irlan_provider.c b/net/irda/irlan/irlan_provider.c
index 8b61cf0d8a6..32dcaac70b0 100644
--- a/net/irda/irlan/irlan_provider.c
+++ b/net/irda/irlan/irlan_provider.c
@@ -36,7 +36,6 @@
36#include <linux/bitops.h> 36#include <linux/bitops.h>
37#include <linux/slab.h> 37#include <linux/slab.h>
38 38
39#include <asm/system.h>
40#include <asm/byteorder.h> 39#include <asm/byteorder.h>
41 40
42#include <net/irda/irda.h> 41#include <net/irda/irda.h>
diff --git a/net/irda/timer.c b/net/irda/timer.c
index f418cb2ad49..1d552b3946f 100644
--- a/net/irda/timer.c
+++ b/net/irda/timer.c
@@ -24,7 +24,6 @@
24 * 24 *
25 ********************************************************************/ 25 ********************************************************************/
26 26
27#include <asm/system.h>
28#include <linux/delay.h> 27#include <linux/delay.h>
29 28
30#include <net/irda/timer.h> 29#include <net/irda/timer.h>
diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
index 8d0324bac01..ab3d35f2325 100644
--- a/net/lapb/lapb_iface.c
+++ b/net/lapb/lapb_iface.c
@@ -32,7 +32,6 @@
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <net/sock.h> 33#include <net/sock.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35#include <asm/system.h>
36#include <linux/fcntl.h> 35#include <linux/fcntl.h>
37#include <linux/mm.h> 36#include <linux/mm.h>
38#include <linux/interrupt.h> 37#include <linux/interrupt.h>
diff --git a/net/lapb/lapb_in.c b/net/lapb/lapb_in.c
index 2ec1af5c36c..f4e3c1accab 100644
--- a/net/lapb/lapb_in.c
+++ b/net/lapb/lapb_in.c
@@ -30,7 +30,6 @@
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <net/sock.h> 31#include <net/sock.h>
32#include <asm/uaccess.h> 32#include <asm/uaccess.h>
33#include <asm/system.h>
34#include <linux/fcntl.h> 33#include <linux/fcntl.h>
35#include <linux/mm.h> 34#include <linux/mm.h>
36#include <linux/interrupt.h> 35#include <linux/interrupt.h>
diff --git a/net/lapb/lapb_out.c b/net/lapb/lapb_out.c
index c75a79540f9..baab2760f65 100644
--- a/net/lapb/lapb_out.c
+++ b/net/lapb/lapb_out.c
@@ -28,7 +28,6 @@
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <net/sock.h> 29#include <net/sock.h>
30#include <asm/uaccess.h> 30#include <asm/uaccess.h>
31#include <asm/system.h>
32#include <linux/fcntl.h> 31#include <linux/fcntl.h>
33#include <linux/mm.h> 32#include <linux/mm.h>
34#include <linux/interrupt.h> 33#include <linux/interrupt.h>
diff --git a/net/lapb/lapb_subr.c b/net/lapb/lapb_subr.c
index 43a2a7fb327..066225b4e82 100644
--- a/net/lapb/lapb_subr.c
+++ b/net/lapb/lapb_subr.c
@@ -27,7 +27,6 @@
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <net/sock.h> 28#include <net/sock.h>
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <asm/system.h>
31#include <linux/fcntl.h> 30#include <linux/fcntl.h>
32#include <linux/mm.h> 31#include <linux/mm.h>
33#include <linux/interrupt.h> 32#include <linux/interrupt.h>
diff --git a/net/lapb/lapb_timer.c b/net/lapb/lapb_timer.c
index af6d14b44e2..f8cd641dfc8 100644
--- a/net/lapb/lapb_timer.c
+++ b/net/lapb/lapb_timer.c
@@ -28,7 +28,6 @@
28#include <linux/skbuff.h> 28#include <linux/skbuff.h>
29#include <net/sock.h> 29#include <net/sock.h>
30#include <asm/uaccess.h> 30#include <asm/uaccess.h>
31#include <asm/system.h>
32#include <linux/fcntl.h> 31#include <linux/fcntl.h>
33#include <linux/mm.h> 32#include <linux/mm.h>
34#include <linux/interrupt.h> 33#include <linux/interrupt.h>
diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
index fe6cb4304d7..52856178c9d 100644
--- a/net/netfilter/ipvs/ip_vs_app.c
+++ b/net/netfilter/ipvs/ip_vs_app.c
@@ -31,7 +31,6 @@
31#include <net/net_namespace.h> 31#include <net/net_namespace.h>
32#include <net/protocol.h> 32#include <net/protocol.h>
33#include <net/tcp.h> 33#include <net/tcp.h>
34#include <asm/system.h>
35#include <linux/stat.h> 34#include <linux/stat.h>
36#include <linux/proc_fs.h> 35#include <linux/proc_fs.h>
37#include <linux/seq_file.h> 36#include <linux/seq_file.h>
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
index 85312939695..f843a883325 100644
--- a/net/netfilter/ipvs/ip_vs_proto.c
+++ b/net/netfilter/ipvs/ip_vs_proto.c
@@ -25,7 +25,6 @@
25#include <net/protocol.h> 25#include <net/protocol.h>
26#include <net/tcp.h> 26#include <net/tcp.h>
27#include <net/udp.h> 27#include <net/udp.h>
28#include <asm/system.h>
29#include <linux/stat.h> 28#include <linux/stat.h>
30#include <linux/proc_fs.h> 29#include <linux/proc_fs.h>
31 30
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index 4d70785b953..e6ddde16561 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -23,7 +23,6 @@
23#include <linux/net.h> 23#include <linux/net.h>
24#include <linux/skbuff.h> 24#include <linux/skbuff.h>
25#include <asm/uaccess.h> 25#include <asm/uaccess.h>
26#include <asm/system.h>
27#include <net/sock.h> 26#include <net/sock.h>
28#include <net/netlink.h> 27#include <net/netlink.h>
29#include <linux/init.h> 28#include <linux/init.h>
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 7dab229bfbc..06592d8b4a2 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -31,7 +31,6 @@
31#include <net/net_namespace.h> 31#include <net/net_namespace.h>
32#include <net/sock.h> 32#include <net/sock.h>
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34#include <asm/system.h>
35#include <linux/fcntl.h> 34#include <linux/fcntl.h>
36#include <linux/termios.h> /* For TIOCINQ/OUTQ */ 35#include <linux/termios.h> /* For TIOCINQ/OUTQ */
37#include <linux/mm.h> 36#include <linux/mm.h>
diff --git a/net/netrom/nr_dev.c b/net/netrom/nr_dev.c
index 64e6dde9749..1c51d7a58f0 100644
--- a/net/netrom/nr_dev.c
+++ b/net/netrom/nr_dev.c
@@ -21,7 +21,6 @@
21#include <linux/if_ether.h> /* For the statistics structure. */ 21#include <linux/if_ether.h> /* For the statistics structure. */
22#include <linux/slab.h> 22#include <linux/slab.h>
23 23
24#include <asm/system.h>
25#include <asm/uaccess.h> 24#include <asm/uaccess.h>
26#include <asm/io.h> 25#include <asm/io.h>
27 26
diff --git a/net/netrom/nr_in.c b/net/netrom/nr_in.c
index 6d4ef6d65b3..c3073a2ef63 100644
--- a/net/netrom/nr_in.c
+++ b/net/netrom/nr_in.c
@@ -24,7 +24,6 @@
24#include <net/sock.h> 24#include <net/sock.h>
25#include <net/tcp_states.h> 25#include <net/tcp_states.h>
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/system.h>
28#include <linux/fcntl.h> 27#include <linux/fcntl.h>
29#include <linux/mm.h> 28#include <linux/mm.h>
30#include <linux/interrupt.h> 29#include <linux/interrupt.h>
diff --git a/net/netrom/nr_out.c b/net/netrom/nr_out.c
index 607fddb4fdb..0b4bcb2bf38 100644
--- a/net/netrom/nr_out.c
+++ b/net/netrom/nr_out.c
@@ -23,7 +23,6 @@
23#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24#include <net/sock.h> 24#include <net/sock.h>
25#include <asm/uaccess.h> 25#include <asm/uaccess.h>
26#include <asm/system.h>
27#include <linux/fcntl.h> 26#include <linux/fcntl.h>
28#include <linux/mm.h> 27#include <linux/mm.h>
29#include <linux/interrupt.h> 28#include <linux/interrupt.h>
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c
index 2cf330162d7..70ffff76a96 100644
--- a/net/netrom/nr_route.c
+++ b/net/netrom/nr_route.c
@@ -26,7 +26,6 @@
26#include <linux/skbuff.h> 26#include <linux/skbuff.h>
27#include <net/sock.h> 27#include <net/sock.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/system.h>
30#include <linux/fcntl.h> 29#include <linux/fcntl.h>
31#include <linux/termios.h> /* For TIOCINQ/OUTQ */ 30#include <linux/termios.h> /* For TIOCINQ/OUTQ */
32#include <linux/mm.h> 31#include <linux/mm.h>
diff --git a/net/netrom/nr_subr.c b/net/netrom/nr_subr.c
index 6a947ae50db..ca40e2298f5 100644
--- a/net/netrom/nr_subr.c
+++ b/net/netrom/nr_subr.c
@@ -23,7 +23,6 @@
23#include <net/sock.h> 23#include <net/sock.h>
24#include <net/tcp_states.h> 24#include <net/tcp_states.h>
25#include <asm/uaccess.h> 25#include <asm/uaccess.h>
26#include <asm/system.h>
27#include <linux/fcntl.h> 26#include <linux/fcntl.h>
28#include <linux/mm.h> 27#include <linux/mm.h>
29#include <linux/interrupt.h> 28#include <linux/interrupt.h>
diff --git a/net/netrom/nr_timer.c b/net/netrom/nr_timer.c
index 1cb98e88f5e..ff2c1b142f5 100644
--- a/net/netrom/nr_timer.c
+++ b/net/netrom/nr_timer.c
@@ -24,7 +24,6 @@
24#include <net/sock.h> 24#include <net/sock.h>
25#include <net/tcp_states.h> 25#include <net/tcp_states.h>
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/system.h>
28#include <linux/fcntl.h> 27#include <linux/fcntl.h>
29#include <linux/mm.h> 28#include <linux/mm.h>
30#include <linux/interrupt.h> 29#include <linux/interrupt.h>
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 2c030505b33..e44e631ea95 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -38,7 +38,6 @@
38#include <linux/udp.h> 38#include <linux/udp.h>
39#include <linux/ethtool.h> 39#include <linux/ethtool.h>
40#include <linux/wait.h> 40#include <linux/wait.h>
41#include <asm/system.h>
42#include <asm/div64.h> 41#include <asm/div64.h>
43#include <linux/highmem.h> 42#include <linux/highmem.h>
44#include <linux/netfilter_bridge.h> 43#include <linux/netfilter_bridge.h>
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index ae2d484416d..4f2c0df7956 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -73,7 +73,6 @@
73#include <net/sock.h> 73#include <net/sock.h>
74#include <linux/errno.h> 74#include <linux/errno.h>
75#include <linux/timer.h> 75#include <linux/timer.h>
76#include <asm/system.h>
77#include <asm/uaccess.h> 76#include <asm/uaccess.h>
78#include <asm/ioctls.h> 77#include <asm/ioctls.h>
79#include <asm/page.h> 78#include <asm/page.h>
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index f9ea925ad9c..c4719ce604c 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -34,7 +34,6 @@
34#include <linux/if_arp.h> 34#include <linux/if_arp.h>
35#include <linux/skbuff.h> 35#include <linux/skbuff.h>
36#include <net/sock.h> 36#include <net/sock.h>
37#include <asm/system.h>
38#include <asm/uaccess.h> 37#include <asm/uaccess.h>
39#include <linux/fcntl.h> 38#include <linux/fcntl.h>
40#include <linux/termios.h> 39#include <linux/termios.h>
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c
index 178ff4f73c8..1ab8689726e 100644
--- a/net/rose/rose_dev.c
+++ b/net/rose/rose_dev.c
@@ -21,7 +21,6 @@
21#include <linux/if_ether.h> 21#include <linux/if_ether.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23 23
24#include <asm/system.h>
25#include <asm/io.h> 24#include <asm/io.h>
26 25
27#include <linux/inet.h> 26#include <linux/inet.h>
diff --git a/net/rose/rose_in.c b/net/rose/rose_in.c
index 7f7fcb46b4f..79c4abcfa6b 100644
--- a/net/rose/rose_in.c
+++ b/net/rose/rose_in.c
@@ -26,7 +26,6 @@
26#include <linux/skbuff.h> 26#include <linux/skbuff.h>
27#include <net/sock.h> 27#include <net/sock.h>
28#include <net/tcp_states.h> 28#include <net/tcp_states.h>
29#include <asm/system.h>
30#include <linux/fcntl.h> 29#include <linux/fcntl.h>
31#include <linux/mm.h> 30#include <linux/mm.h>
32#include <linux/interrupt.h> 31#include <linux/interrupt.h>
diff --git a/net/rose/rose_link.c b/net/rose/rose_link.c
index 7a02bd1cc5a..bc5514211b0 100644
--- a/net/rose/rose_link.c
+++ b/net/rose/rose_link.c
@@ -22,7 +22,6 @@
22#include <linux/netdevice.h> 22#include <linux/netdevice.h>
23#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24#include <net/sock.h> 24#include <net/sock.h>
25#include <asm/system.h>
26#include <linux/fcntl.h> 25#include <linux/fcntl.h>
27#include <linux/mm.h> 26#include <linux/mm.h>
28#include <linux/interrupt.h> 27#include <linux/interrupt.h>
diff --git a/net/rose/rose_out.c b/net/rose/rose_out.c
index 4ebf33afbe4..9ad98b52464 100644
--- a/net/rose/rose_out.c
+++ b/net/rose/rose_out.c
@@ -21,7 +21,6 @@
21#include <linux/netdevice.h> 21#include <linux/netdevice.h>
22#include <linux/skbuff.h> 22#include <linux/skbuff.h>
23#include <net/sock.h> 23#include <net/sock.h>
24#include <asm/system.h>
25#include <linux/fcntl.h> 24#include <linux/fcntl.h>
26#include <linux/mm.h> 25#include <linux/mm.h>
27#include <linux/interrupt.h> 26#include <linux/interrupt.h>
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index cd9b7ee60f3..40148932c8a 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -25,7 +25,6 @@
25#include <linux/skbuff.h> 25#include <linux/skbuff.h>
26#include <net/sock.h> 26#include <net/sock.h>
27#include <net/tcp_states.h> 27#include <net/tcp_states.h>
28#include <asm/system.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
30#include <linux/fcntl.h> 29#include <linux/fcntl.h>
31#include <linux/termios.h> /* For TIOCINQ/OUTQ */ 30#include <linux/termios.h> /* For TIOCINQ/OUTQ */
diff --git a/net/rose/rose_subr.c b/net/rose/rose_subr.c
index f6c71caa94b..47f1fdb346b 100644
--- a/net/rose/rose_subr.c
+++ b/net/rose/rose_subr.c
@@ -22,7 +22,6 @@
22#include <linux/skbuff.h> 22#include <linux/skbuff.h>
23#include <net/sock.h> 23#include <net/sock.h>
24#include <net/tcp_states.h> 24#include <net/tcp_states.h>
25#include <asm/system.h>
26#include <linux/fcntl.h> 25#include <linux/fcntl.h>
27#include <linux/mm.h> 26#include <linux/mm.h>
28#include <linux/interrupt.h> 27#include <linux/interrupt.h>
diff --git a/net/rose/rose_timer.c b/net/rose/rose_timer.c
index b6c8f38cc26..bc5469d6d9c 100644
--- a/net/rose/rose_timer.c
+++ b/net/rose/rose_timer.c
@@ -23,7 +23,6 @@
23#include <linux/skbuff.h> 23#include <linux/skbuff.h>
24#include <net/sock.h> 24#include <net/sock.h>
25#include <net/tcp_states.h> 25#include <net/tcp_states.h>
26#include <asm/system.h>
27#include <linux/fcntl.h> 26#include <linux/fcntl.h>
28#include <linux/mm.h> 27#include <linux/mm.h>
29#include <linux/interrupt.h> 28#include <linux/interrupt.h>
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 7a4cb5fdc21..67972462a54 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -17,7 +17,6 @@
17 * Copyright (C) 1995,1996 Olaf Kirch <okir@monad.swb.de> 17 * Copyright (C) 1995,1996 Olaf Kirch <okir@monad.swb.de>
18 */ 18 */
19 19
20#include <asm/system.h>
21 20
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/types.h> 22#include <linux/types.h>
diff --git a/security/selinux/include/avc.h b/security/selinux/include/avc.h
index 47fda963495..005a91bcb20 100644
--- a/security/selinux/include/avc.h
+++ b/security/selinux/include/avc.h
@@ -15,7 +15,6 @@
15#include <linux/audit.h> 15#include <linux/audit.h>
16#include <linux/lsm_audit.h> 16#include <linux/lsm_audit.h>
17#include <linux/in6.h> 17#include <linux/in6.h>
18#include <asm/system.h>
19#include "flask.h" 18#include "flask.h"
20#include "av_permissions.h" 19#include "av_permissions.h"
21#include "security.h" 20#include "security.h"
diff --git a/security/selinux/include/xfrm.h b/security/selinux/include/xfrm.h
index b43813c9e04..c220f314709 100644
--- a/security/selinux/include/xfrm.h
+++ b/security/selinux/include/xfrm.h
@@ -7,6 +7,8 @@
7#ifndef _SELINUX_XFRM_H_ 7#ifndef _SELINUX_XFRM_H_
8#define _SELINUX_XFRM_H_ 8#define _SELINUX_XFRM_H_
9 9
10#include <net/flow.h>
11
10int selinux_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, 12int selinux_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp,
11 struct xfrm_user_sec_ctx *sec_ctx); 13 struct xfrm_user_sec_ctx *sec_ctx);
12int selinux_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx, 14int selinux_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx,
diff --git a/sound/oss/os.h b/sound/oss/os.h
index a1a962d7f67..75ad0cd0c0a 100644
--- a/sound/oss/os.h
+++ b/sound/oss/os.h
@@ -16,7 +16,6 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/system.h>
20#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
21#include <asm/uaccess.h> 20#include <asm/uaccess.h>
22#include <linux/poll.h> 21#include <linux/poll.h>
diff --git a/sound/oss/vidc.c b/sound/oss/vidc.c
index 12ba28e7b93..92ca5bee186 100644
--- a/sound/oss/vidc.c
+++ b/sound/oss/vidc.c
@@ -28,7 +28,6 @@
28#include <asm/io.h> 28#include <asm/io.h>
29#include <asm/hardware/iomd.h> 29#include <asm/hardware/iomd.h>
30#include <asm/irq.h> 30#include <asm/irq.h>
31#include <asm/system.h>
32 31
33#include "sound_config.h" 32#include "sound_config.h"
34#include "vidc.h" 33#include "vidc.h"
diff --git a/sound/oss/waveartist.c b/sound/oss/waveartist.c
index 52468742d9f..24c430f721d 100644
--- a/sound/oss/waveartist.c
+++ b/sound/oss/waveartist.c
@@ -42,7 +42,6 @@
42#include <linux/spinlock.h> 42#include <linux/spinlock.h>
43#include <linux/bitops.h> 43#include <linux/bitops.h>
44 44
45#include <asm/system.h>
46 45
47#include "sound_config.h" 46#include "sound_config.h"
48#include "waveartist.h" 47#include "waveartist.h"
diff --git a/sound/pci/asihpi/hpios.h b/sound/pci/asihpi/hpios.h
index c5cef113c20..d3fbd0d76c3 100644
--- a/sound/pci/asihpi/hpios.h
+++ b/sound/pci/asihpi/hpios.h
@@ -30,7 +30,6 @@ HPI Operating System Specific macros for Linux Kernel driver
30#define HPI_BUILD_KERNEL_MODE 30#define HPI_BUILD_KERNEL_MODE
31 31
32#include <linux/io.h> 32#include <linux/io.h>
33#include <asm/system.h>
34#include <linux/ioctl.h> 33#include <linux/ioctl.h>
35#include <linux/kernel.h> 34#include <linux/kernel.h>
36#include <linux/string.h> 35#include <linux/string.h>
diff --git a/sound/pci/aw2/aw2-saa7146.c b/sound/pci/aw2/aw2-saa7146.c
index 8afd8b5d1ac..4439636971e 100644
--- a/sound/pci/aw2/aw2-saa7146.c
+++ b/sound/pci/aw2/aw2-saa7146.c
@@ -27,7 +27,6 @@
27#include <linux/pci.h> 27#include <linux/pci.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <asm/system.h>
31#include <asm/io.h> 30#include <asm/io.h>
32#include <sound/core.h> 31#include <sound/core.h>
33#include <sound/initval.h> 32#include <sound/initval.h>