Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Aug 2008 02:04:36 +0000 (19:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Aug 2008 02:04:36 +0000 (19:04 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: Remove all cpumask_t local variables in xcall dispatch.
  sparc64: Kill error_mask from hypervisor_xcall_deliver().
  sparc64: Build cpu list and mondo block at top-level xcall_deliver().
  sparc64: Disable local interrupts around xcall_deliver_impl() invocation.
  sparc64: Make all xcall_deliver's go through common helper function.
  sparc64: Always allocate the send mondo blocks, even on non-sun4v.
  sparc64: Make smp_cross_call_masked() take a cpumask_t pointer.
  sparc64: Directly call xcall_deliver() in smp_start_sync_tick_client.
  sparc64: Call xcall_deliver() directly in some cases.
  sparc64: Use cpumask_t pointers and for_each_cpu_mask_nr() in xcall_deliver.
  sparc64: Use xcall_deliver() consistently.
  sparc64: Use function pointer for cross-call sending.
  arch/sparc64/kernel/signal.c: removed duplicated #include
  sparc64: Need to disable preemption around smp_tsb_sync().

501 files changed:
Documentation/DocBook/Makefile
Documentation/DocBook/sh.tmpl [new file with mode: 0644]
Documentation/powerpc/booting-without-of.txt
Documentation/powerpc/eeh-pci-error-recovery.txt
arch/mn10300/kernel/module.c
arch/powerpc/Kconfig.debug
arch/powerpc/boot/io.h
arch/powerpc/include/asm/8253pit.h [moved from include/asm-powerpc/8253pit.h with 100% similarity]
arch/powerpc/include/asm/8xx_immap.h [moved from include/asm-powerpc/8xx_immap.h with 100% similarity]
arch/powerpc/include/asm/Kbuild [moved from include/asm-powerpc/Kbuild with 100% similarity]
arch/powerpc/include/asm/a.out.h [moved from include/asm-powerpc/a.out.h with 100% similarity]
arch/powerpc/include/asm/abs_addr.h [moved from include/asm-powerpc/abs_addr.h with 100% similarity]
arch/powerpc/include/asm/agp.h [moved from include/asm-powerpc/agp.h with 100% similarity]
arch/powerpc/include/asm/asm-compat.h [moved from include/asm-powerpc/asm-compat.h with 100% similarity]
arch/powerpc/include/asm/atomic.h [moved from include/asm-powerpc/atomic.h with 100% similarity]
arch/powerpc/include/asm/auxvec.h [moved from include/asm-powerpc/auxvec.h with 100% similarity]
arch/powerpc/include/asm/backlight.h [moved from include/asm-powerpc/backlight.h with 100% similarity]
arch/powerpc/include/asm/bitops.h [moved from include/asm-powerpc/bitops.h with 100% similarity]
arch/powerpc/include/asm/bootx.h [moved from include/asm-powerpc/bootx.h with 100% similarity]
arch/powerpc/include/asm/btext.h [moved from include/asm-powerpc/btext.h with 100% similarity]
arch/powerpc/include/asm/bug.h [moved from include/asm-powerpc/bug.h with 100% similarity]
arch/powerpc/include/asm/bugs.h [moved from include/asm-powerpc/bugs.h with 100% similarity]
arch/powerpc/include/asm/byteorder.h [moved from include/asm-powerpc/byteorder.h with 100% similarity]
arch/powerpc/include/asm/cache.h [moved from include/asm-powerpc/cache.h with 100% similarity]
arch/powerpc/include/asm/cacheflush.h [moved from include/asm-powerpc/cacheflush.h with 100% similarity]
arch/powerpc/include/asm/cell-pmu.h [moved from include/asm-powerpc/cell-pmu.h with 100% similarity]
arch/powerpc/include/asm/cell-regs.h [moved from include/asm-powerpc/cell-regs.h with 100% similarity]
arch/powerpc/include/asm/checksum.h [moved from include/asm-powerpc/checksum.h with 100% similarity]
arch/powerpc/include/asm/clk_interface.h [moved from include/asm-powerpc/clk_interface.h with 100% similarity]
arch/powerpc/include/asm/code-patching.h [moved from include/asm-powerpc/code-patching.h with 100% similarity]
arch/powerpc/include/asm/compat.h [moved from include/asm-powerpc/compat.h with 100% similarity]
arch/powerpc/include/asm/cpm.h [moved from include/asm-powerpc/cpm.h with 100% similarity]
arch/powerpc/include/asm/cpm1.h [moved from include/asm-powerpc/cpm1.h with 100% similarity]
arch/powerpc/include/asm/cpm2.h [moved from include/asm-powerpc/cpm2.h with 100% similarity]
arch/powerpc/include/asm/cputable.h [moved from include/asm-powerpc/cputable.h with 100% similarity]
arch/powerpc/include/asm/cputhreads.h [moved from include/asm-powerpc/cputhreads.h with 100% similarity]
arch/powerpc/include/asm/cputime.h [moved from include/asm-powerpc/cputime.h with 100% similarity]
arch/powerpc/include/asm/current.h [moved from include/asm-powerpc/current.h with 100% similarity]
arch/powerpc/include/asm/dbdma.h [moved from include/asm-powerpc/dbdma.h with 100% similarity]
arch/powerpc/include/asm/dcr-generic.h [moved from include/asm-powerpc/dcr-generic.h with 100% similarity]
arch/powerpc/include/asm/dcr-mmio.h [moved from include/asm-powerpc/dcr-mmio.h with 100% similarity]
arch/powerpc/include/asm/dcr-native.h [moved from include/asm-powerpc/dcr-native.h with 100% similarity]
arch/powerpc/include/asm/dcr-regs.h [moved from include/asm-powerpc/dcr-regs.h with 100% similarity]
arch/powerpc/include/asm/dcr.h [moved from include/asm-powerpc/dcr.h with 94% similarity]
arch/powerpc/include/asm/delay.h [moved from include/asm-powerpc/delay.h with 100% similarity]
arch/powerpc/include/asm/device.h [moved from include/asm-powerpc/device.h with 100% similarity]
arch/powerpc/include/asm/div64.h [moved from include/asm-powerpc/div64.h with 100% similarity]
arch/powerpc/include/asm/dma-mapping.h [moved from include/asm-powerpc/dma-mapping.h with 100% similarity]
arch/powerpc/include/asm/dma.h [moved from include/asm-powerpc/dma.h with 100% similarity]
arch/powerpc/include/asm/edac.h [moved from include/asm-powerpc/edac.h with 100% similarity]
arch/powerpc/include/asm/eeh.h [moved from include/asm-powerpc/eeh.h with 100% similarity]
arch/powerpc/include/asm/eeh_event.h [moved from include/asm-powerpc/eeh_event.h with 100% similarity]
arch/powerpc/include/asm/elf.h [moved from include/asm-powerpc/elf.h with 100% similarity]
arch/powerpc/include/asm/emergency-restart.h [moved from include/asm-powerpc/emergency-restart.h with 100% similarity]
arch/powerpc/include/asm/errno.h [moved from include/asm-powerpc/errno.h with 100% similarity]
arch/powerpc/include/asm/exception.h [moved from include/asm-powerpc/exception.h with 100% similarity]
arch/powerpc/include/asm/fb.h [moved from include/asm-powerpc/fb.h with 100% similarity]
arch/powerpc/include/asm/fcntl.h [moved from include/asm-powerpc/fcntl.h with 100% similarity]
arch/powerpc/include/asm/feature-fixups.h [moved from include/asm-powerpc/feature-fixups.h with 100% similarity]
arch/powerpc/include/asm/firmware.h [moved from include/asm-powerpc/firmware.h with 100% similarity]
arch/powerpc/include/asm/fixmap.h [moved from include/asm-powerpc/fixmap.h with 100% similarity]
arch/powerpc/include/asm/floppy.h [moved from include/asm-powerpc/floppy.h with 100% similarity]
arch/powerpc/include/asm/fs_pd.h [moved from include/asm-powerpc/fs_pd.h with 100% similarity]
arch/powerpc/include/asm/fsl_gtm.h [moved from include/asm-powerpc/fsl_gtm.h with 100% similarity]
arch/powerpc/include/asm/fsl_lbc.h [moved from include/asm-powerpc/fsl_lbc.h with 100% similarity]
arch/powerpc/include/asm/ftrace.h [moved from include/asm-powerpc/ftrace.h with 100% similarity]
arch/powerpc/include/asm/futex.h [moved from include/asm-powerpc/futex.h with 100% similarity]
arch/powerpc/include/asm/gpio.h [moved from include/asm-powerpc/gpio.h with 100% similarity]
arch/powerpc/include/asm/grackle.h [moved from include/asm-powerpc/grackle.h with 100% similarity]
arch/powerpc/include/asm/hardirq.h [moved from include/asm-powerpc/hardirq.h with 100% similarity]
arch/powerpc/include/asm/heathrow.h [moved from include/asm-powerpc/heathrow.h with 100% similarity]
arch/powerpc/include/asm/highmem.h [moved from include/asm-powerpc/highmem.h with 100% similarity]
arch/powerpc/include/asm/hugetlb.h [moved from include/asm-powerpc/hugetlb.h with 100% similarity]
arch/powerpc/include/asm/hvcall.h [moved from include/asm-powerpc/hvcall.h with 100% similarity]
arch/powerpc/include/asm/hvconsole.h [moved from include/asm-powerpc/hvconsole.h with 100% similarity]
arch/powerpc/include/asm/hvcserver.h [moved from include/asm-powerpc/hvcserver.h with 100% similarity]
arch/powerpc/include/asm/hw_irq.h [moved from include/asm-powerpc/hw_irq.h with 100% similarity]
arch/powerpc/include/asm/hydra.h [moved from include/asm-powerpc/hydra.h with 100% similarity]
arch/powerpc/include/asm/i8259.h [moved from include/asm-powerpc/i8259.h with 71% similarity]
arch/powerpc/include/asm/ibmebus.h [moved from include/asm-powerpc/ibmebus.h with 100% similarity]
arch/powerpc/include/asm/ide.h [moved from include/asm-powerpc/ide.h with 100% similarity]
arch/powerpc/include/asm/immap_86xx.h [moved from include/asm-powerpc/immap_86xx.h with 100% similarity]
arch/powerpc/include/asm/immap_cpm2.h [moved from include/asm-powerpc/immap_cpm2.h with 100% similarity]
arch/powerpc/include/asm/immap_qe.h [moved from include/asm-powerpc/immap_qe.h with 99% similarity]
arch/powerpc/include/asm/io-defs.h [moved from include/asm-powerpc/io-defs.h with 100% similarity]
arch/powerpc/include/asm/io.h [moved from include/asm-powerpc/io.h with 100% similarity]
arch/powerpc/include/asm/ioctl.h [moved from include/asm-powerpc/ioctl.h with 100% similarity]
arch/powerpc/include/asm/ioctls.h [moved from include/asm-powerpc/ioctls.h with 100% similarity]
arch/powerpc/include/asm/iommu.h [moved from include/asm-powerpc/iommu.h with 100% similarity]
arch/powerpc/include/asm/ipcbuf.h [moved from include/asm-powerpc/ipcbuf.h with 100% similarity]
arch/powerpc/include/asm/ipic.h [moved from include/asm-powerpc/ipic.h with 93% similarity]
arch/powerpc/include/asm/irq.h [moved from include/asm-powerpc/irq.h with 58% similarity]
arch/powerpc/include/asm/irq_regs.h [moved from include/asm-powerpc/irq_regs.h with 100% similarity]
arch/powerpc/include/asm/irqflags.h [moved from include/asm-powerpc/irqflags.h with 93% similarity]
arch/powerpc/include/asm/iseries/alpaca.h [moved from include/asm-powerpc/iseries/alpaca.h with 100% similarity]
arch/powerpc/include/asm/iseries/hv_call.h [moved from include/asm-powerpc/iseries/hv_call.h with 100% similarity]
arch/powerpc/include/asm/iseries/hv_call_event.h [moved from include/asm-powerpc/iseries/hv_call_event.h with 100% similarity]
arch/powerpc/include/asm/iseries/hv_call_sc.h [moved from include/asm-powerpc/iseries/hv_call_sc.h with 100% similarity]
arch/powerpc/include/asm/iseries/hv_call_xm.h [moved from include/asm-powerpc/iseries/hv_call_xm.h with 100% similarity]
arch/powerpc/include/asm/iseries/hv_lp_config.h [moved from include/asm-powerpc/iseries/hv_lp_config.h with 100% similarity]
arch/powerpc/include/asm/iseries/hv_lp_event.h [moved from include/asm-powerpc/iseries/hv_lp_event.h with 100% similarity]
arch/powerpc/include/asm/iseries/hv_types.h [moved from include/asm-powerpc/iseries/hv_types.h with 100% similarity]
arch/powerpc/include/asm/iseries/iommu.h [moved from include/asm-powerpc/iseries/iommu.h with 100% similarity]
arch/powerpc/include/asm/iseries/it_lp_queue.h [moved from include/asm-powerpc/iseries/it_lp_queue.h with 100% similarity]
arch/powerpc/include/asm/iseries/lpar_map.h [moved from include/asm-powerpc/iseries/lpar_map.h with 100% similarity]
arch/powerpc/include/asm/iseries/mf.h [moved from include/asm-powerpc/iseries/mf.h with 100% similarity]
arch/powerpc/include/asm/iseries/vio.h [moved from include/asm-powerpc/iseries/vio.h with 100% similarity]
arch/powerpc/include/asm/kdebug.h [moved from include/asm-powerpc/kdebug.h with 100% similarity]
arch/powerpc/include/asm/kdump.h [moved from include/asm-powerpc/kdump.h with 100% similarity]
arch/powerpc/include/asm/kexec.h [moved from include/asm-powerpc/kexec.h with 100% similarity]
arch/powerpc/include/asm/keylargo.h [moved from include/asm-powerpc/keylargo.h with 100% similarity]
arch/powerpc/include/asm/kgdb.h [moved from include/asm-powerpc/kgdb.h with 98% similarity]
arch/powerpc/include/asm/kmap_types.h [moved from include/asm-powerpc/kmap_types.h with 100% similarity]
arch/powerpc/include/asm/kprobes.h [moved from include/asm-powerpc/kprobes.h with 100% similarity]
arch/powerpc/include/asm/kvm.h [moved from include/asm-powerpc/kvm.h with 100% similarity]
arch/powerpc/include/asm/kvm_asm.h [moved from include/asm-powerpc/kvm_asm.h with 100% similarity]
arch/powerpc/include/asm/kvm_host.h [moved from include/asm-powerpc/kvm_host.h with 100% similarity]
arch/powerpc/include/asm/kvm_para.h [moved from include/asm-powerpc/kvm_para.h with 100% similarity]
arch/powerpc/include/asm/kvm_ppc.h [moved from include/asm-powerpc/kvm_ppc.h with 100% similarity]
arch/powerpc/include/asm/libata-portmap.h [moved from include/asm-powerpc/libata-portmap.h with 100% similarity]
arch/powerpc/include/asm/linkage.h [moved from include/asm-powerpc/linkage.h with 100% similarity]
arch/powerpc/include/asm/lmb.h [moved from include/asm-powerpc/lmb.h with 100% similarity]
arch/powerpc/include/asm/local.h [moved from include/asm-powerpc/local.h with 100% similarity]
arch/powerpc/include/asm/lppaca.h [moved from include/asm-powerpc/lppaca.h with 100% similarity]
arch/powerpc/include/asm/lv1call.h [moved from include/asm-powerpc/lv1call.h with 100% similarity]
arch/powerpc/include/asm/machdep.h [moved from include/asm-powerpc/machdep.h with 100% similarity]
arch/powerpc/include/asm/macio.h [moved from include/asm-powerpc/macio.h with 100% similarity]
arch/powerpc/include/asm/mc146818rtc.h [moved from include/asm-powerpc/mc146818rtc.h with 100% similarity]
arch/powerpc/include/asm/mediabay.h [moved from include/asm-powerpc/mediabay.h with 100% similarity]
arch/powerpc/include/asm/mman.h [moved from include/asm-powerpc/mman.h with 100% similarity]
arch/powerpc/include/asm/mmu-40x.h [moved from include/asm-powerpc/mmu-40x.h with 100% similarity]
arch/powerpc/include/asm/mmu-44x.h [moved from include/asm-powerpc/mmu-44x.h with 100% similarity]
arch/powerpc/include/asm/mmu-8xx.h [moved from include/asm-powerpc/mmu-8xx.h with 100% similarity]
arch/powerpc/include/asm/mmu-fsl-booke.h [moved from include/asm-powerpc/mmu-fsl-booke.h with 100% similarity]
arch/powerpc/include/asm/mmu-hash32.h [moved from include/asm-powerpc/mmu-hash32.h with 100% similarity]
arch/powerpc/include/asm/mmu-hash64.h [moved from include/asm-powerpc/mmu-hash64.h with 100% similarity]
arch/powerpc/include/asm/mmu.h [moved from include/asm-powerpc/mmu.h with 100% similarity]
arch/powerpc/include/asm/mmu_context.h [moved from include/asm-powerpc/mmu_context.h with 100% similarity]
arch/powerpc/include/asm/mmzone.h [moved from include/asm-powerpc/mmzone.h with 100% similarity]
arch/powerpc/include/asm/module.h [moved from include/asm-powerpc/module.h with 100% similarity]
arch/powerpc/include/asm/mpc512x.h [moved from include/asm-powerpc/mpc512x.h with 100% similarity]
arch/powerpc/include/asm/mpc52xx.h [moved from include/asm-powerpc/mpc52xx.h with 100% similarity]
arch/powerpc/include/asm/mpc52xx_psc.h [moved from include/asm-powerpc/mpc52xx_psc.h with 100% similarity]
arch/powerpc/include/asm/mpc6xx.h [moved from include/asm-powerpc/mpc6xx.h with 100% similarity]
arch/powerpc/include/asm/mpc8260.h [moved from include/asm-powerpc/mpc8260.h with 100% similarity]
arch/powerpc/include/asm/mpc86xx.h [moved from include/asm-powerpc/mpc86xx.h with 100% similarity]
arch/powerpc/include/asm/mpc8xx.h [moved from include/asm-powerpc/mpc8xx.h with 100% similarity]
arch/powerpc/include/asm/mpic.h [moved from include/asm-powerpc/mpic.h with 100% similarity]
arch/powerpc/include/asm/msgbuf.h [moved from include/asm-powerpc/msgbuf.h with 100% similarity]
arch/powerpc/include/asm/mutex.h [moved from include/asm-powerpc/mutex.h with 100% similarity]
arch/powerpc/include/asm/nvram.h [moved from include/asm-powerpc/nvram.h with 100% similarity]
arch/powerpc/include/asm/of_device.h [moved from include/asm-powerpc/of_device.h with 100% similarity]
arch/powerpc/include/asm/of_platform.h [moved from include/asm-powerpc/of_platform.h with 100% similarity]
arch/powerpc/include/asm/ohare.h [moved from include/asm-powerpc/ohare.h with 100% similarity]
arch/powerpc/include/asm/oprofile_impl.h [moved from include/asm-powerpc/oprofile_impl.h with 100% similarity]
arch/powerpc/include/asm/pSeries_reconfig.h [moved from include/asm-powerpc/pSeries_reconfig.h with 100% similarity]
arch/powerpc/include/asm/paca.h [moved from include/asm-powerpc/paca.h with 99% similarity]
arch/powerpc/include/asm/page.h [moved from include/asm-powerpc/page.h with 100% similarity]
arch/powerpc/include/asm/page_32.h [moved from include/asm-powerpc/page_32.h with 100% similarity]
arch/powerpc/include/asm/page_64.h [moved from include/asm-powerpc/page_64.h with 100% similarity]
arch/powerpc/include/asm/param.h [moved from include/asm-powerpc/param.h with 100% similarity]
arch/powerpc/include/asm/parport.h [moved from include/asm-powerpc/parport.h with 100% similarity]
arch/powerpc/include/asm/pasemi_dma.h [moved from include/asm-powerpc/pasemi_dma.h with 100% similarity]
arch/powerpc/include/asm/pci-bridge.h [moved from include/asm-powerpc/pci-bridge.h with 100% similarity]
arch/powerpc/include/asm/pci.h [moved from include/asm-powerpc/pci.h with 100% similarity]
arch/powerpc/include/asm/percpu.h [moved from include/asm-powerpc/percpu.h with 100% similarity]
arch/powerpc/include/asm/pgalloc-32.h [moved from include/asm-powerpc/pgalloc-32.h with 100% similarity]
arch/powerpc/include/asm/pgalloc-64.h [moved from include/asm-powerpc/pgalloc-64.h with 100% similarity]
arch/powerpc/include/asm/pgalloc.h [moved from include/asm-powerpc/pgalloc.h with 100% similarity]
arch/powerpc/include/asm/pgtable-4k.h [moved from include/asm-powerpc/pgtable-4k.h with 100% similarity]
arch/powerpc/include/asm/pgtable-64k.h [moved from include/asm-powerpc/pgtable-64k.h with 100% similarity]
arch/powerpc/include/asm/pgtable-ppc32.h [moved from include/asm-powerpc/pgtable-ppc32.h with 100% similarity]
arch/powerpc/include/asm/pgtable-ppc64.h [moved from include/asm-powerpc/pgtable-ppc64.h with 99% similarity]
arch/powerpc/include/asm/pgtable.h [moved from include/asm-powerpc/pgtable.h with 100% similarity]
arch/powerpc/include/asm/phyp_dump.h [moved from include/asm-powerpc/phyp_dump.h with 100% similarity]
arch/powerpc/include/asm/pmac_feature.h [moved from include/asm-powerpc/pmac_feature.h with 100% similarity]
arch/powerpc/include/asm/pmac_low_i2c.h [moved from include/asm-powerpc/pmac_low_i2c.h with 100% similarity]
arch/powerpc/include/asm/pmac_pfunc.h [moved from include/asm-powerpc/pmac_pfunc.h with 100% similarity]
arch/powerpc/include/asm/pmc.h [moved from include/asm-powerpc/pmc.h with 100% similarity]
arch/powerpc/include/asm/pmi.h [moved from include/asm-powerpc/pmi.h with 100% similarity]
arch/powerpc/include/asm/poll.h [moved from include/asm-powerpc/poll.h with 100% similarity]
arch/powerpc/include/asm/posix_types.h [moved from include/asm-powerpc/posix_types.h with 100% similarity]
arch/powerpc/include/asm/ppc-pci.h [moved from include/asm-powerpc/ppc-pci.h with 100% similarity]
arch/powerpc/include/asm/ppc4xx.h [moved from include/asm-powerpc/ppc4xx.h with 100% similarity]
arch/powerpc/include/asm/ppc_asm.h [moved from include/asm-powerpc/ppc_asm.h with 100% similarity]
arch/powerpc/include/asm/processor.h [moved from include/asm-powerpc/processor.h with 100% similarity]
arch/powerpc/include/asm/prom.h [moved from include/asm-powerpc/prom.h with 100% similarity]
arch/powerpc/include/asm/ps3.h [moved from include/asm-powerpc/ps3.h with 100% similarity]
arch/powerpc/include/asm/ps3av.h [moved from include/asm-powerpc/ps3av.h with 100% similarity]
arch/powerpc/include/asm/ps3fb.h [moved from include/asm-powerpc/ps3fb.h with 100% similarity]
arch/powerpc/include/asm/ps3stor.h [moved from include/asm-powerpc/ps3stor.h with 100% similarity]
arch/powerpc/include/asm/ptrace.h [moved from include/asm-powerpc/ptrace.h with 100% similarity]
arch/powerpc/include/asm/qe.h [moved from include/asm-powerpc/qe.h with 100% similarity]
arch/powerpc/include/asm/qe_ic.h [moved from include/asm-powerpc/qe_ic.h with 99% similarity]
arch/powerpc/include/asm/reg.h [moved from include/asm-powerpc/reg.h with 100% similarity]
arch/powerpc/include/asm/reg_8xx.h [moved from include/asm-powerpc/reg_8xx.h with 100% similarity]
arch/powerpc/include/asm/reg_booke.h [moved from include/asm-powerpc/reg_booke.h with 100% similarity]
arch/powerpc/include/asm/reg_fsl_emb.h [moved from include/asm-powerpc/reg_fsl_emb.h with 100% similarity]
arch/powerpc/include/asm/resource.h [moved from include/asm-powerpc/resource.h with 100% similarity]
arch/powerpc/include/asm/rheap.h [moved from include/asm-powerpc/rheap.h with 100% similarity]
arch/powerpc/include/asm/rio.h [moved from include/asm-powerpc/rio.h with 100% similarity]
arch/powerpc/include/asm/rtas.h [moved from include/asm-powerpc/rtas.h with 100% similarity]
arch/powerpc/include/asm/rtc.h [moved from include/asm-powerpc/rtc.h with 100% similarity]
arch/powerpc/include/asm/rwsem.h [moved from include/asm-powerpc/rwsem.h with 96% similarity]
arch/powerpc/include/asm/scatterlist.h [moved from include/asm-powerpc/scatterlist.h with 100% similarity]
arch/powerpc/include/asm/seccomp.h [moved from include/asm-powerpc/seccomp.h with 100% similarity]
arch/powerpc/include/asm/sections.h [moved from include/asm-powerpc/sections.h with 100% similarity]
arch/powerpc/include/asm/sembuf.h [moved from include/asm-powerpc/sembuf.h with 100% similarity]
arch/powerpc/include/asm/serial.h [moved from include/asm-powerpc/serial.h with 100% similarity]
arch/powerpc/include/asm/setjmp.h [moved from include/asm-powerpc/setjmp.h with 100% similarity]
arch/powerpc/include/asm/setup.h [moved from include/asm-powerpc/setup.h with 100% similarity]
arch/powerpc/include/asm/shmbuf.h [moved from include/asm-powerpc/shmbuf.h with 100% similarity]
arch/powerpc/include/asm/shmparam.h [moved from include/asm-powerpc/shmparam.h with 100% similarity]
arch/powerpc/include/asm/sigcontext.h [moved from include/asm-powerpc/sigcontext.h with 100% similarity]
arch/powerpc/include/asm/siginfo.h [moved from include/asm-powerpc/siginfo.h with 100% similarity]
arch/powerpc/include/asm/signal.h [moved from include/asm-powerpc/signal.h with 100% similarity]
arch/powerpc/include/asm/smp.h [moved from include/asm-powerpc/smp.h with 100% similarity]
arch/powerpc/include/asm/smu.h [moved from include/asm-powerpc/smu.h with 100% similarity]
arch/powerpc/include/asm/socket.h [moved from include/asm-powerpc/socket.h with 100% similarity]
arch/powerpc/include/asm/sockios.h [moved from include/asm-powerpc/sockios.h with 100% similarity]
arch/powerpc/include/asm/sparsemem.h [moved from include/asm-powerpc/sparsemem.h with 100% similarity]
arch/powerpc/include/asm/spinlock.h [moved from include/asm-powerpc/spinlock.h with 100% similarity]
arch/powerpc/include/asm/spinlock_types.h [moved from include/asm-powerpc/spinlock_types.h with 100% similarity]
arch/powerpc/include/asm/spu.h [moved from include/asm-powerpc/spu.h with 100% similarity]
arch/powerpc/include/asm/spu_csa.h [moved from include/asm-powerpc/spu_csa.h with 100% similarity]
arch/powerpc/include/asm/spu_info.h [moved from include/asm-powerpc/spu_info.h with 100% similarity]
arch/powerpc/include/asm/spu_priv1.h [moved from include/asm-powerpc/spu_priv1.h with 100% similarity]
arch/powerpc/include/asm/sstep.h [moved from include/asm-powerpc/sstep.h with 100% similarity]
arch/powerpc/include/asm/stat.h [moved from include/asm-powerpc/stat.h with 100% similarity]
arch/powerpc/include/asm/statfs.h [moved from include/asm-powerpc/statfs.h with 100% similarity]
arch/powerpc/include/asm/string.h [moved from include/asm-powerpc/string.h with 100% similarity]
arch/powerpc/include/asm/suspend.h [moved from include/asm-powerpc/suspend.h with 100% similarity]
arch/powerpc/include/asm/synch.h [moved from include/asm-powerpc/synch.h with 100% similarity]
arch/powerpc/include/asm/syscall.h [moved from include/asm-powerpc/syscall.h with 100% similarity]
arch/powerpc/include/asm/syscalls.h [moved from include/asm-powerpc/syscalls.h with 100% similarity]
arch/powerpc/include/asm/systbl.h [moved from include/asm-powerpc/systbl.h with 100% similarity]
arch/powerpc/include/asm/system.h [moved from include/asm-powerpc/system.h with 100% similarity]
arch/powerpc/include/asm/tce.h [moved from include/asm-powerpc/tce.h with 100% similarity]
arch/powerpc/include/asm/termbits.h [moved from include/asm-powerpc/termbits.h with 100% similarity]
arch/powerpc/include/asm/termios.h [moved from include/asm-powerpc/termios.h with 100% similarity]
arch/powerpc/include/asm/thread_info.h [moved from include/asm-powerpc/thread_info.h with 100% similarity]
arch/powerpc/include/asm/time.h [moved from include/asm-powerpc/time.h with 100% similarity]
arch/powerpc/include/asm/timex.h [moved from include/asm-powerpc/timex.h with 100% similarity]
arch/powerpc/include/asm/tlb.h [moved from include/asm-powerpc/tlb.h with 100% similarity]
arch/powerpc/include/asm/tlbflush.h [moved from include/asm-powerpc/tlbflush.h with 100% similarity]
arch/powerpc/include/asm/topology.h [moved from include/asm-powerpc/topology.h with 100% similarity]
arch/powerpc/include/asm/tsi108.h [moved from include/asm-powerpc/tsi108.h with 100% similarity]
arch/powerpc/include/asm/tsi108_irq.h [moved from include/asm-powerpc/tsi108_irq.h with 100% similarity]
arch/powerpc/include/asm/tsi108_pci.h [moved from include/asm-powerpc/tsi108_pci.h with 100% similarity]
arch/powerpc/include/asm/types.h [moved from include/asm-powerpc/types.h with 100% similarity]
arch/powerpc/include/asm/uaccess.h [moved from include/asm-powerpc/uaccess.h with 100% similarity]
arch/powerpc/include/asm/ucc.h [moved from include/asm-powerpc/ucc.h with 100% similarity]
arch/powerpc/include/asm/ucc_fast.h [moved from include/asm-powerpc/ucc_fast.h with 99% similarity]
arch/powerpc/include/asm/ucc_slow.h [moved from include/asm-powerpc/ucc_slow.h with 100% similarity]
arch/powerpc/include/asm/ucontext.h [moved from include/asm-powerpc/ucontext.h with 100% similarity]
arch/powerpc/include/asm/udbg.h [moved from include/asm-powerpc/udbg.h with 100% similarity]
arch/powerpc/include/asm/uic.h [moved from include/asm-powerpc/uic.h with 95% similarity]
arch/powerpc/include/asm/unaligned.h [moved from include/asm-powerpc/unaligned.h with 100% similarity]
arch/powerpc/include/asm/uninorth.h [moved from include/asm-powerpc/uninorth.h with 100% similarity]
arch/powerpc/include/asm/unistd.h [moved from include/asm-powerpc/unistd.h with 100% similarity]
arch/powerpc/include/asm/user.h [moved from include/asm-powerpc/user.h with 100% similarity]
arch/powerpc/include/asm/vdso.h [moved from include/asm-powerpc/vdso.h with 100% similarity]
arch/powerpc/include/asm/vdso_datapage.h [moved from include/asm-powerpc/vdso_datapage.h with 100% similarity]
arch/powerpc/include/asm/vga.h [moved from include/asm-powerpc/vga.h with 100% similarity]
arch/powerpc/include/asm/vio.h [moved from include/asm-powerpc/vio.h with 100% similarity]
arch/powerpc/include/asm/xilinx_intc.h [moved from include/asm-powerpc/xilinx_intc.h with 100% similarity]
arch/powerpc/include/asm/xmon.h [moved from include/asm-powerpc/xmon.h with 100% similarity]
arch/powerpc/include/asm/xor.h [moved from include/asm-powerpc/xor.h with 100% similarity]
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/cpu_setup_44x.S
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/vdso.c
arch/powerpc/lib/Makefile
arch/powerpc/mm/mem.c
arch/powerpc/mm/ppc_mmu_32.c
arch/powerpc/mm/tlb_64.c
arch/powerpc/platforms/52xx/Makefile
arch/powerpc/platforms/86xx/mpc86xx_smp.c
arch/powerpc/platforms/Makefile
arch/powerpc/platforms/powermac/Makefile
arch/powerpc/sysdev/Makefile
arch/s390/include/asm/Kbuild [moved from include/asm-s390/Kbuild with 100% similarity]
arch/s390/include/asm/airq.h [moved from include/asm-s390/airq.h with 100% similarity]
arch/s390/include/asm/appldata.h [moved from include/asm-s390/appldata.h with 100% similarity]
arch/s390/include/asm/atomic.h [moved from include/asm-s390/atomic.h with 100% similarity]
arch/s390/include/asm/auxvec.h [moved from include/asm-s390/auxvec.h with 100% similarity]
arch/s390/include/asm/bitops.h [moved from include/asm-s390/bitops.h with 100% similarity]
arch/s390/include/asm/bug.h [moved from include/asm-s390/bug.h with 100% similarity]
arch/s390/include/asm/bugs.h [moved from include/asm-s390/bugs.h with 100% similarity]
arch/s390/include/asm/byteorder.h [moved from include/asm-s390/byteorder.h with 100% similarity]
arch/s390/include/asm/cache.h [moved from include/asm-s390/cache.h with 100% similarity]
arch/s390/include/asm/cacheflush.h [moved from include/asm-s390/cacheflush.h with 100% similarity]
arch/s390/include/asm/ccwdev.h [moved from include/asm-s390/ccwdev.h with 100% similarity]
arch/s390/include/asm/ccwgroup.h [moved from include/asm-s390/ccwgroup.h with 100% similarity]
arch/s390/include/asm/checksum.h [moved from include/asm-s390/checksum.h with 100% similarity]
arch/s390/include/asm/chpid.h [moved from include/asm-s390/chpid.h with 100% similarity]
arch/s390/include/asm/chsc.h [moved from include/asm-s390/chsc.h with 100% similarity]
arch/s390/include/asm/cio.h [moved from include/asm-s390/cio.h with 100% similarity]
arch/s390/include/asm/cmb.h [moved from include/asm-s390/cmb.h with 100% similarity]
arch/s390/include/asm/compat.h [moved from include/asm-s390/compat.h with 100% similarity]
arch/s390/include/asm/cpcmd.h [moved from include/asm-s390/cpcmd.h with 100% similarity]
arch/s390/include/asm/cpu.h [moved from include/asm-s390/cpu.h with 100% similarity]
arch/s390/include/asm/cputime.h [moved from include/asm-s390/cputime.h with 100% similarity]
arch/s390/include/asm/current.h [moved from include/asm-s390/current.h with 100% similarity]
arch/s390/include/asm/dasd.h [moved from include/asm-s390/dasd.h with 100% similarity]
arch/s390/include/asm/debug.h [moved from include/asm-s390/debug.h with 100% similarity]
arch/s390/include/asm/delay.h [moved from include/asm-s390/delay.h with 100% similarity]
arch/s390/include/asm/device.h [moved from include/asm-s390/device.h with 100% similarity]
arch/s390/include/asm/diag.h [moved from include/asm-s390/diag.h with 100% similarity]
arch/s390/include/asm/div64.h [moved from include/asm-s390/div64.h with 100% similarity]
arch/s390/include/asm/dma.h [moved from include/asm-s390/dma.h with 100% similarity]
arch/s390/include/asm/ebcdic.h [moved from include/asm-s390/ebcdic.h with 100% similarity]
arch/s390/include/asm/elf.h [moved from include/asm-s390/elf.h with 100% similarity]
arch/s390/include/asm/emergency-restart.h [moved from include/asm-s390/emergency-restart.h with 100% similarity]
arch/s390/include/asm/errno.h [moved from include/asm-s390/errno.h with 100% similarity]
arch/s390/include/asm/etr.h [moved from include/asm-s390/etr.h with 100% similarity]
arch/s390/include/asm/extmem.h [moved from include/asm-s390/extmem.h with 100% similarity]
arch/s390/include/asm/fb.h [moved from include/asm-s390/fb.h with 100% similarity]
arch/s390/include/asm/fcntl.h [moved from include/asm-s390/fcntl.h with 100% similarity]
arch/s390/include/asm/fcx.h [moved from include/asm-s390/fcx.h with 100% similarity]
arch/s390/include/asm/futex.h [moved from include/asm-s390/futex.h with 100% similarity]
arch/s390/include/asm/hardirq.h [moved from include/asm-s390/hardirq.h with 100% similarity]
arch/s390/include/asm/hugetlb.h [moved from include/asm-s390/hugetlb.h with 100% similarity]
arch/s390/include/asm/idals.h [moved from include/asm-s390/idals.h with 100% similarity]
arch/s390/include/asm/io.h [moved from include/asm-s390/io.h with 100% similarity]
arch/s390/include/asm/ioctl.h [moved from include/asm-s390/ioctl.h with 100% similarity]
arch/s390/include/asm/ioctls.h [moved from include/asm-s390/ioctls.h with 100% similarity]
arch/s390/include/asm/ipcbuf.h [moved from include/asm-s390/ipcbuf.h with 100% similarity]
arch/s390/include/asm/ipl.h [moved from include/asm-s390/ipl.h with 100% similarity]
arch/s390/include/asm/irq.h [moved from include/asm-s390/irq.h with 100% similarity]
arch/s390/include/asm/irq_regs.h [moved from include/asm-s390/irq_regs.h with 100% similarity]
arch/s390/include/asm/irqflags.h [moved from include/asm-s390/irqflags.h with 100% similarity]
arch/s390/include/asm/isc.h [moved from include/asm-s390/isc.h with 100% similarity]
arch/s390/include/asm/itcw.h [moved from include/asm-s390/itcw.h with 100% similarity]
arch/s390/include/asm/kdebug.h [moved from include/asm-s390/kdebug.h with 100% similarity]
arch/s390/include/asm/kexec.h [moved from include/asm-s390/kexec.h with 100% similarity]
arch/s390/include/asm/kmap_types.h [moved from include/asm-s390/kmap_types.h with 100% similarity]
arch/s390/include/asm/kprobes.h [moved from include/asm-s390/kprobes.h with 100% similarity]
arch/s390/include/asm/kvm.h [moved from include/asm-s390/kvm.h with 100% similarity]
arch/s390/include/asm/kvm_host.h [moved from include/asm-s390/kvm_host.h with 100% similarity]
arch/s390/include/asm/kvm_para.h [moved from include/asm-s390/kvm_para.h with 100% similarity]
arch/s390/include/asm/kvm_virtio.h [moved from include/asm-s390/kvm_virtio.h with 100% similarity]
arch/s390/include/asm/linkage.h [moved from include/asm-s390/linkage.h with 100% similarity]
arch/s390/include/asm/local.h [moved from include/asm-s390/local.h with 100% similarity]
arch/s390/include/asm/lowcore.h [moved from include/asm-s390/lowcore.h with 100% similarity]
arch/s390/include/asm/mathemu.h [moved from include/asm-s390/mathemu.h with 100% similarity]
arch/s390/include/asm/mman.h [moved from include/asm-s390/mman.h with 100% similarity]
arch/s390/include/asm/mmu.h [moved from include/asm-s390/mmu.h with 100% similarity]
arch/s390/include/asm/mmu_context.h [moved from include/asm-s390/mmu_context.h with 100% similarity]
arch/s390/include/asm/module.h [moved from include/asm-s390/module.h with 100% similarity]
arch/s390/include/asm/monwriter.h [moved from include/asm-s390/monwriter.h with 100% similarity]
arch/s390/include/asm/msgbuf.h [moved from include/asm-s390/msgbuf.h with 100% similarity]
arch/s390/include/asm/mutex.h [moved from include/asm-s390/mutex.h with 100% similarity]
arch/s390/include/asm/page.h [moved from include/asm-s390/page.h with 100% similarity]
arch/s390/include/asm/param.h [moved from include/asm-s390/param.h with 100% similarity]
arch/s390/include/asm/pci.h [moved from include/asm-s390/pci.h with 100% similarity]
arch/s390/include/asm/percpu.h [moved from include/asm-s390/percpu.h with 100% similarity]
arch/s390/include/asm/pgalloc.h [moved from include/asm-s390/pgalloc.h with 100% similarity]
arch/s390/include/asm/pgtable.h [moved from include/asm-s390/pgtable.h with 100% similarity]
arch/s390/include/asm/poll.h [moved from include/asm-s390/poll.h with 100% similarity]
arch/s390/include/asm/posix_types.h [moved from include/asm-s390/posix_types.h with 100% similarity]
arch/s390/include/asm/processor.h [moved from include/asm-s390/processor.h with 100% similarity]
arch/s390/include/asm/ptrace.h [moved from include/asm-s390/ptrace.h with 100% similarity]
arch/s390/include/asm/qdio.h [moved from include/asm-s390/qdio.h with 100% similarity]
arch/s390/include/asm/qeth.h [moved from include/asm-s390/qeth.h with 100% similarity]
arch/s390/include/asm/reset.h [moved from include/asm-s390/reset.h with 100% similarity]
arch/s390/include/asm/resource.h [moved from include/asm-s390/resource.h with 100% similarity]
arch/s390/include/asm/rwsem.h [moved from include/asm-s390/rwsem.h with 100% similarity]
arch/s390/include/asm/s390_ext.h [moved from include/asm-s390/s390_ext.h with 100% similarity]
arch/s390/include/asm/s390_rdev.h [moved from include/asm-s390/s390_rdev.h with 100% similarity]
arch/s390/include/asm/scatterlist.h [moved from include/asm-s390/scatterlist.h with 100% similarity]
arch/s390/include/asm/schid.h [moved from include/asm-s390/schid.h with 100% similarity]
arch/s390/include/asm/sclp.h [moved from include/asm-s390/sclp.h with 100% similarity]
arch/s390/include/asm/sections.h [moved from include/asm-s390/sections.h with 100% similarity]
arch/s390/include/asm/segment.h [moved from include/asm-s390/segment.h with 100% similarity]
arch/s390/include/asm/sembuf.h [moved from include/asm-s390/sembuf.h with 100% similarity]
arch/s390/include/asm/setup.h [moved from include/asm-s390/setup.h with 100% similarity]
arch/s390/include/asm/sfp-machine.h [moved from include/asm-s390/sfp-machine.h with 100% similarity]
arch/s390/include/asm/sfp-util.h [moved from include/asm-s390/sfp-util.h with 100% similarity]
arch/s390/include/asm/shmbuf.h [moved from include/asm-s390/shmbuf.h with 100% similarity]
arch/s390/include/asm/shmparam.h [moved from include/asm-s390/shmparam.h with 100% similarity]
arch/s390/include/asm/sigcontext.h [moved from include/asm-s390/sigcontext.h with 100% similarity]
arch/s390/include/asm/siginfo.h [moved from include/asm-s390/siginfo.h with 100% similarity]
arch/s390/include/asm/signal.h [moved from include/asm-s390/signal.h with 100% similarity]
arch/s390/include/asm/sigp.h [moved from include/asm-s390/sigp.h with 100% similarity]
arch/s390/include/asm/smp.h [moved from include/asm-s390/smp.h with 100% similarity]
arch/s390/include/asm/socket.h [moved from include/asm-s390/socket.h with 100% similarity]
arch/s390/include/asm/sockios.h [moved from include/asm-s390/sockios.h with 100% similarity]
arch/s390/include/asm/sparsemem.h [moved from include/asm-s390/sparsemem.h with 100% similarity]
arch/s390/include/asm/spinlock.h [moved from include/asm-s390/spinlock.h with 100% similarity]
arch/s390/include/asm/spinlock_types.h [moved from include/asm-s390/spinlock_types.h with 100% similarity]
arch/s390/include/asm/stat.h [moved from include/asm-s390/stat.h with 100% similarity]
arch/s390/include/asm/statfs.h [moved from include/asm-s390/statfs.h with 100% similarity]
arch/s390/include/asm/string.h [moved from include/asm-s390/string.h with 100% similarity]
arch/s390/include/asm/suspend.h [moved from include/asm-s390/suspend.h with 100% similarity]
arch/s390/include/asm/sysinfo.h [moved from include/asm-s390/sysinfo.h with 100% similarity]
arch/s390/include/asm/system.h [moved from include/asm-s390/system.h with 100% similarity]
arch/s390/include/asm/tape390.h [moved from include/asm-s390/tape390.h with 100% similarity]
arch/s390/include/asm/termbits.h [moved from include/asm-s390/termbits.h with 100% similarity]
arch/s390/include/asm/termios.h [moved from include/asm-s390/termios.h with 100% similarity]
arch/s390/include/asm/thread_info.h [moved from include/asm-s390/thread_info.h with 100% similarity]
arch/s390/include/asm/timer.h [moved from include/asm-s390/timer.h with 100% similarity]
arch/s390/include/asm/timex.h [moved from include/asm-s390/timex.h with 100% similarity]
arch/s390/include/asm/tlb.h [moved from include/asm-s390/tlb.h with 100% similarity]
arch/s390/include/asm/tlbflush.h [moved from include/asm-s390/tlbflush.h with 100% similarity]
arch/s390/include/asm/todclk.h [moved from include/asm-s390/todclk.h with 100% similarity]
arch/s390/include/asm/topology.h [moved from include/asm-s390/topology.h with 100% similarity]
arch/s390/include/asm/types.h [moved from include/asm-s390/types.h with 100% similarity]
arch/s390/include/asm/uaccess.h [moved from include/asm-s390/uaccess.h with 100% similarity]
arch/s390/include/asm/ucontext.h [moved from include/asm-s390/ucontext.h with 100% similarity]
arch/s390/include/asm/unaligned.h [moved from include/asm-s390/unaligned.h with 100% similarity]
arch/s390/include/asm/unistd.h [moved from include/asm-s390/unistd.h with 100% similarity]
arch/s390/include/asm/user.h [moved from include/asm-s390/user.h with 100% similarity]
arch/s390/include/asm/vtoc.h [moved from include/asm-s390/vtoc.h with 100% similarity]
arch/s390/include/asm/xor.h [moved from include/asm-s390/xor.h with 100% similarity]
arch/s390/include/asm/zcrypt.h [moved from include/asm-s390/zcrypt.h with 100% similarity]
arch/sh/Kconfig
arch/sh/Kconfig.debug
arch/sh/Makefile
arch/sh/boards/Makefile
arch/sh/boards/board-ap325rxa.c
arch/sh/boards/mach-se/7343/irq.c
arch/sh/configs/dreamcast_defconfig
arch/sh/include/asm/a.out.h [deleted file]
arch/sh/include/asm/ptrace.h
arch/sh/include/asm/seccomp.h [new file with mode: 0644]
arch/sh/include/asm/thread_info.h
arch/sh/include/asm/tlb_64.h
arch/sh/include/cpu-sh2/cpu/cache.h
arch/sh/include/cpu-sh2a/cpu/addrspace.h [new file with mode: 0644]
arch/sh/include/cpu-sh2a/cpu/cache.h
arch/sh/include/cpu-sh2a/cpu/cacheflush.h [new file with mode: 0644]
arch/sh/kernel/cpu/sh4/sq.c
arch/sh/kernel/cpu/sh5/entry.S
arch/sh/kernel/entry-common.S
arch/sh/kernel/machine_kexec.c
arch/sh/kernel/module.c
arch/sh/kernel/ptrace_32.c
arch/sh/kernel/ptrace_64.c
arch/sh/kernel/setup.c
arch/sh/kernel/signal_32.c
arch/sh/kernel/signal_64.c
arch/sh/mm/Kconfig
arch/sh/mm/Makefile_32
arch/sh/mm/cache-sh2.c
arch/sh/mm/cache-sh2a.c [new file with mode: 0644]
arch/sh/mm/tlb-sh5.c
arch/sh/tools/Makefile
block/scsi_ioctl.c
drivers/char/efirtc.c
drivers/char/hvc_console.h
drivers/char/hvcs.c
drivers/char/vt.c
drivers/infiniband/hw/ehca/ehca_reqs.c
drivers/input/keyboard/maple_keyb.c
drivers/isdn/Makefile
drivers/isdn/hardware/mISDN/hfcmulti.c
drivers/isdn/hardware/mISDN/hfcpci.c
drivers/isdn/mISDN/l1oip_core.c
drivers/isdn/mISDN/socket.c
drivers/net/stnic.c
drivers/pcmcia/rsrc_nonstatic.c
drivers/scsi/hptiop.c
drivers/scsi/scsi_transport_spi.c
drivers/scsi/sd.c
drivers/scsi/sd.h
drivers/scsi/ses.c
drivers/serial/bfin_5xx.c
drivers/serial/crisv10.c
drivers/serial/crisv10.h
drivers/sh/maple/maple.c
drivers/spi/atmel_spi.c
drivers/spi/spi_s3c24xx.c
drivers/watchdog/ar7_wdt.c
drivers/watchdog/it8712f_wdt.c
drivers/watchdog/s3c2410_wdt.c
drivers/watchdog/sc1200wdt.c
drivers/watchdog/wdt.c
drivers/watchdog/wdt_pci.c
firmware/ihex2fw.c
fs/nfs/nfsroot.c
fs/ufs/super.c
include/asm-m68k/contregs.h
include/asm-m68k/fbio.h
include/asm-m68k/idprom.h
include/linux/ihex.h
include/linux/mISDNif.h
include/linux/maple.h
include/linux/parser.h
include/linux/tracehook.h
include/linux/vt_kern.h
include/scsi/scsi_device.h
kernel/auditsc.c
kernel/sched.c
mm/memory.c
mm/mlock.c
mm/nommu.c
scripts/kconfig/conf.c
scripts/kconfig/confdata.c
sound/core/seq/oss/seq_oss_synth.c

index 0eb0d02..1d1b345 100644 (file)
@@ -12,7 +12,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \
            kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
            gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
            genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
-           mac80211.xml debugobjects.xml
+           mac80211.xml debugobjects.xml sh.xml
 
 ###
 # The build process is as follows (targets):
diff --git a/Documentation/DocBook/sh.tmpl b/Documentation/DocBook/sh.tmpl
new file mode 100644 (file)
index 0000000..0c3dc4c
--- /dev/null
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+       "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
+
+<book id="sh-drivers">
+ <bookinfo>
+  <title>SuperH Interfaces Guide</title>
+  
+  <authorgroup>
+   <author>
+    <firstname>Paul</firstname>
+    <surname>Mundt</surname>
+    <affiliation>
+     <address>
+      <email>lethal@linux-sh.org</email>
+     </address>
+    </affiliation>
+   </author>
+  </authorgroup>
+
+  <copyright>
+   <year>2008</year>
+   <holder>Paul Mundt</holder>
+  </copyright>
+  <copyright>
+   <year>2008</year>
+   <holder>Renesas Technology Corp.</holder>
+  </copyright>
+
+  <legalnotice>
+   <para>
+     This documentation is free software; you can redistribute
+     it and/or modify it under the terms of the GNU General Public
+     License version 2 as published by the Free Software Foundation.
+   </para>
+      
+   <para>
+     This program is distributed in the hope that it will be
+     useful, but WITHOUT ANY WARRANTY; without even the implied
+     warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+     See the GNU General Public License for more details.
+   </para>
+      
+   <para>
+     You should have received a copy of the GNU General Public
+     License along with this program; if not, write to the Free
+     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+     MA 02111-1307 USA
+   </para>
+      
+   <para>
+     For more details see the file COPYING in the source
+     distribution of Linux.
+   </para>
+  </legalnotice>
+ </bookinfo>
+
+<toc></toc>
+
+  <chapter id="mm">
+    <title>Memory Management</title>
+    <sect1 id="sh4">
+    <title>SH-4</title>
+      <sect2 id="sq">
+        <title>Store Queue API</title>
+!Earch/sh/kernel/cpu/sh4/sq.c
+      </sect2>
+    </sect1>
+    <sect1 id="sh5">
+      <title>SH-5</title>
+      <sect2 id="tlb">
+       <title>TLB Interfaces</title>
+!Iarch/sh/mm/tlb-sh5.c
+!Iarch/sh/include/asm/tlb_64.h
+      </sect2>
+    </sect1>
+  </chapter>
+  <chapter id="clk">
+    <title>Clock Framework Extensions</title>
+!Iarch/sh/include/asm/clock.h
+  </chapter>
+  <chapter id="mach">
+    <title>Machine Specific Interfaces</title>
+    <sect1 id="dreamcast">
+      <title>mach-dreamcast</title>
+!Iarch/sh/boards/mach-dreamcast/rtc.c
+    </sect1>
+    <sect1 id="x3proto">
+      <title>mach-x3proto</title>
+!Earch/sh/boards/mach-x3proto/ilsel.c
+    </sect1>
+  </chapter>
+  <chapter id="busses">
+    <title>Busses</title>
+    <sect1 id="superhyway">
+      <title>SuperHyway</title>
+!Edrivers/sh/superhyway/superhyway.c
+    </sect1>
+
+    <sect1 id="maple">
+      <title>Maple</title>
+!Edrivers/sh/maple/maple.c
+    </sect1>
+  </chapter>
+</book>
index 928a79c..de4063c 100644 (file)
@@ -278,7 +278,7 @@ it with special cases.
         a 64-bit platform.
 
         d) request and get assigned a platform number (see PLATFORM_*
-        constants in include/asm-powerpc/processor.h
+        constants in arch/powerpc/include/asm/processor.h
 
 32-bit embedded kernels:
 
@@ -340,7 +340,7 @@ the block to RAM before passing it to the kernel.
 ---------
 
    The kernel is entered with r3 pointing to an area of memory that is
-   roughly described in include/asm-powerpc/prom.h by the structure
+   roughly described in arch/powerpc/include/asm/prom.h by the structure
    boot_param_header:
 
 struct boot_param_header {
index df7afe4..9d4e33d 100644 (file)
@@ -133,7 +133,7 @@ error.  Given an arbitrary address, the routine
 pci_get_device_by_addr() will find the pci device associated
 with that address (if any).
 
-The default include/asm-powerpc/io.h macros readb(), inb(), insb(),
+The default arch/powerpc/include/asm/io.h macros readb(), inb(), insb(),
 etc. include a check to see if the i/o read returned all-0xff's.
 If so, these make a call to eeh_dn_check_failure(), which in turn
 asks the firmware if the all-ff's value is the sign of a true EEH
index 0e4d2f6..8fa3689 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/fs.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
+#include <linux/bug.h>
 
 #if 0
 #define DEBUGP printk
@@ -195,7 +196,7 @@ int module_finalize(const Elf_Ehdr *hdr,
                    const Elf_Shdr *sechdrs,
                    struct module *me)
 {
-       return 0;
+       return module_bug_finalize(hdr, sechdrs, me);
 }
 
 /*
@@ -203,4 +204,5 @@ int module_finalize(const Elf_Ehdr *hdr,
  */
 void module_arch_cleanup(struct module *mod)
 {
+       module_bug_cleanup(mod);
 }
index 8c8aadb..4ebc52a 100644 (file)
@@ -97,7 +97,7 @@ config IRQSTACKS
 
 config VIRQ_DEBUG
        bool "Expose hardware/virtual IRQ mapping via debugfs"
-       depends on DEBUG_FS && PPC_MERGE
+       depends on DEBUG_FS
        help
          This option will show the mapping relationship between hardware irq
          numbers and virtual irq numbers. The mapping is exposed via debugfs
index ccaedae..7c09f48 100644 (file)
@@ -6,7 +6,7 @@
 /*
  * Low-level I/O routines.
  *
- * Copied from <file:include/asm-powerpc/io.h> (which has no copyright)
+ * Copied from <file:arch/powerpc/include/asm/io.h> (which has no copyright)
  */
 static inline int in_8(const volatile unsigned char *addr)
 {
similarity index 94%
rename from include/asm-powerpc/dcr.h
rename to arch/powerpc/include/asm/dcr.h
index 53b2830..d13fb68 100644 (file)
@@ -65,17 +65,13 @@ typedef dcr_host_mmio_t dcr_host_t;
 #endif /* defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO) */
 
 /*
- * On CONFIG_PPC_MERGE, we have additional helpers to read the DCR
- * base from the device-tree
+ * additional helpers to read the DCR * base from the device-tree
  */
-#ifdef CONFIG_PPC_MERGE
 struct device_node;
 extern unsigned int dcr_resource_start(struct device_node *np,
                                       unsigned int index);
 extern unsigned int dcr_resource_len(struct device_node *np,
                                     unsigned int index);
-#endif /* CONFIG_PPC_MERGE */
-
 #endif /* CONFIG_PPC_DCR */
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
similarity index 71%
rename from include/asm-powerpc/i8259.h
rename to arch/powerpc/include/asm/i8259.h
index db1362f..105ade2 100644 (file)
@@ -4,14 +4,9 @@
 
 #include <linux/irq.h>
 
-#ifdef CONFIG_PPC_MERGE
 extern void i8259_init(struct device_node *node, unsigned long intack_addr);
 extern unsigned int i8259_irq(void);
 extern struct irq_host *i8259_get_host(void);
-#else
-extern void i8259_init(unsigned long intack_addr, int offset);
-extern int i8259_irq(void);
-#endif
 
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_I8259_H */
similarity index 99%
rename from include/asm-powerpc/immap_qe.h
rename to arch/powerpc/include/asm/immap_qe.h
index 7b6f411..3c2fced 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * include/asm-powerpc/immap_qe.h
- *
  * QUICC Engine (QE) Internal Memory Map.
  * The Internal Memory Map for devices with QE on them. This
  * is the superset of all QE devices (8360, etc.).
similarity index 93%
rename from include/asm-powerpc/ipic.h
rename to arch/powerpc/include/asm/ipic.h
index 8ff08be..fb59829 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * include/asm-powerpc/ipic.h
- *
  * IPIC external definitions and structure.
  *
  * Maintainer: Kumar Gala <galak@kernel.crashing.org>
@@ -79,15 +77,8 @@ extern void ipic_disable_mcp(enum ipic_mcp_irq mcp_irq);
 extern u32 ipic_get_mcp_status(void);
 extern void ipic_clear_mcp_status(u32 mask);
 
-#ifdef CONFIG_PPC_MERGE
 extern struct ipic * ipic_init(struct device_node *node, unsigned int flags);
 extern unsigned int ipic_get_irq(void);
-#else
-extern void ipic_init(phys_addr_t phys_addr, unsigned int flags,
-               unsigned int irq_offset,
-               unsigned char *senses, unsigned int senses_count);
-extern int ipic_get_irq(void);
-#endif
 
 #endif /* __ASM_IPIC_H__ */
 #endif /* __KERNEL__ */
similarity index 58%
rename from include/asm-powerpc/irq.h
rename to arch/powerpc/include/asm/irq.h
index 1ef8e30..a372f76 100644 (file)
@@ -25,8 +25,6 @@
 
 extern atomic_t ppc_n_lost_interrupts;
 
-#ifdef CONFIG_PPC_MERGE
-
 /* This number is used when no interrupt has been assigned */
 #define NO_IRQ                 (0)
 
@@ -326,292 +324,6 @@ static __inline__ int irq_canonicalize(int irq)
        return irq;
 }
 
-
-#else /* CONFIG_PPC_MERGE */
-
-/* This number is used when no interrupt has been assigned */
-#define NO_IRQ                 (-1)
-#define NO_IRQ_IGNORE          (-2)
-
-
-/*
- * These constants are used for passing information about interrupt
- * signal polarity and level/edge sensing to the low-level PIC chip
- * drivers.
- */
-#define IRQ_SENSE_MASK         0x1
-#define IRQ_SENSE_LEVEL                0x1     /* interrupt on active level */
-#define IRQ_SENSE_EDGE         0x0     /* interrupt triggered by edge */
-
-#define IRQ_POLARITY_MASK      0x2
-#define IRQ_POLARITY_POSITIVE  0x2     /* high level or low->high edge */
-#define IRQ_POLARITY_NEGATIVE  0x0     /* low level or high->low edge */
-
-
-#if defined(CONFIG_40x)
-#include <asm/ibm4xx.h>
-
-#ifndef NR_BOARD_IRQS
-#define NR_BOARD_IRQS 0
-#endif
-
-#ifndef UIC_WIDTH /* Number of interrupts per device */
-#define UIC_WIDTH 32
-#endif
-
-#ifndef NR_UICS /* number  of UIC devices */
-#define NR_UICS 1
-#endif
-
-#if defined (CONFIG_403)
-/*
- * The PowerPC 403 cores' Asynchronous Interrupt Controller (AIC) has
- * 32 possible interrupts, a majority of which are not implemented on
- * all cores. There are six configurable, external interrupt pins and
- * there are eight internal interrupts for the on-chip serial port
- * (SPU), DMA controller, and JTAG controller.
- *
- */
-
-#define        NR_AIC_IRQS 32
-#define        NR_IRQS  (NR_AIC_IRQS + NR_BOARD_IRQS)
-
-#elif !defined (CONFIG_403)
-
-/*
- *  The PowerPC 405 cores' Universal Interrupt Controller (UIC) has 32
- * possible interrupts as well. There are seven, configurable external
- * interrupt pins and there are 17 internal interrupts for the on-chip
- * serial port, DMA controller, on-chip Ethernet controller, PCI, etc.
- *
- */
-
-
-#define NR_UIC_IRQS UIC_WIDTH
-#define NR_IRQS                ((NR_UIC_IRQS * NR_UICS) + NR_BOARD_IRQS)
-#endif
-
-#elif defined(CONFIG_44x)
-#include <asm/ibm44x.h>
-
-#define        NR_UIC_IRQS     32
-#define        NR_IRQS         ((NR_UIC_IRQS * NR_UICS) + NR_BOARD_IRQS)
-
-#elif defined(CONFIG_8xx)
-
-/* Now include the board configuration specific associations.
-*/
-#include <asm/mpc8xx.h>
-
-/* The MPC8xx cores have 16 possible interrupts.  There are eight
- * possible level sensitive interrupts assigned and generated internally
- * from such devices as CPM, PCMCIA, RTC, PIT, TimeBase and Decrementer.
- * There are eight external interrupts (IRQs) that can be configured
- * as either level or edge sensitive.
- *
- * On some implementations, there is also the possibility of an 8259
- * through the PCI and PCI-ISA bridges.
- *
- * We are "flattening" the interrupt vectors of the cascaded CPM
- * and 8259 interrupt controllers so that we can uniquely identify
- * any interrupt source with a single integer.
- */
-#define NR_SIU_INTS    16
-#define NR_CPM_INTS    32
-#ifndef NR_8259_INTS
-#define NR_8259_INTS 0
-#endif
-
-#define SIU_IRQ_OFFSET         0
-#define CPM_IRQ_OFFSET         (SIU_IRQ_OFFSET + NR_SIU_INTS)
-#define I8259_IRQ_OFFSET       (CPM_IRQ_OFFSET + NR_CPM_INTS)
-
-#define NR_IRQS        (NR_SIU_INTS + NR_CPM_INTS + NR_8259_INTS)
-
-/* These values must be zero-based and map 1:1 with the SIU configuration.
- * They are used throughout the 8xx I/O subsystem to generate
- * interrupt masks, flags, and other control patterns.  This is why the
- * current kernel assumption of the 8259 as the base controller is such
- * a pain in the butt.
- */
-#define        SIU_IRQ0        (0)     /* Highest priority */
-#define        SIU_LEVEL0      (1)
-#define        SIU_IRQ1        (2)
-#define        SIU_LEVEL1      (3)
-#define        SIU_IRQ2        (4)
-#define        SIU_LEVEL2      (5)
-#define        SIU_IRQ3        (6)
-#define        SIU_LEVEL3      (7)
-#define        SIU_IRQ4        (8)
-#define        SIU_LEVEL4      (9)
-#define        SIU_IRQ5        (10)
-#define        SIU_LEVEL5      (11)
-#define        SIU_IRQ6        (12)
-#define        SIU_LEVEL6      (13)
-#define        SIU_IRQ7        (14)
-#define        SIU_LEVEL7      (15)
-
-#define MPC8xx_INT_FEC1                SIU_LEVEL1
-#define MPC8xx_INT_FEC2                SIU_LEVEL3
-
-#define MPC8xx_INT_SCC1                (CPM_IRQ_OFFSET + CPMVEC_SCC1)
-#define MPC8xx_INT_SCC2                (CPM_IRQ_OFFSET + CPMVEC_SCC2)
-#define MPC8xx_INT_SCC3                (CPM_IRQ_OFFSET + CPMVEC_SCC3)
-#define MPC8xx_INT_SCC4                (CPM_IRQ_OFFSET + CPMVEC_SCC4)
-#define MPC8xx_INT_SMC1                (CPM_IRQ_OFFSET + CPMVEC_SMC1)
-#define MPC8xx_INT_SMC2                (CPM_IRQ_OFFSET + CPMVEC_SMC2)
-
-/* The internal interrupts we can configure as we see fit.
- * My personal preference is CPM at level 2, which puts it above the
- * MBX PCI/ISA/IDE interrupts.
- */
-#ifndef PIT_INTERRUPT
-#define PIT_INTERRUPT          SIU_LEVEL0
-#endif
-#ifndef        CPM_INTERRUPT
-#define CPM_INTERRUPT          SIU_LEVEL2
-#endif
-#ifndef        PCMCIA_INTERRUPT
-#define PCMCIA_INTERRUPT       SIU_LEVEL6
-#endif
-#ifndef        DEC_INTERRUPT
-#define DEC_INTERRUPT          SIU_LEVEL7
-#endif
-
-/* Some internal interrupt registers use an 8-bit mask for the interrupt
- * level instead of a number.
- */
-#define        mk_int_int_mask(IL) (1 << (7 - (IL/2)))
-
-#else /* CONFIG_40x + CONFIG_8xx */
-/*
- * this is the # irq's for all ppc arch's (pmac/chrp/prep)
- * so it is the max of them all
- */
-#define NR_IRQS                        256
-#define __DO_IRQ_CANON 1
-
-#ifndef CONFIG_8260
-
-#define NUM_8259_INTERRUPTS    16
-
-#else /* CONFIG_8260 */
-
-/* The 8260 has an internal interrupt controller with a maximum of
- * 64 IRQs.  We will use NR_IRQs from above since it is large enough.
- * Don't be confused by the 8260 documentation where they list an
- * "interrupt number" and "interrupt vector".  We are only interested
- * in the interrupt vector.  There are "reserved" holes where the
- * vector number increases, but the interrupt number in the table does not.
- * (Document errata updates have fixed this...make sure you have up to
- * date processor documentation -- Dan).
- */
-
-#ifndef CPM_IRQ_OFFSET
-#define CPM_IRQ_OFFSET 0
-#endif
-
-#define NR_CPM_INTS    64
-
-#define        SIU_INT_ERROR           ((uint)0x00 + CPM_IRQ_OFFSET)
-#define        SIU_INT_I2C             ((uint)0x01 + CPM_IRQ_OFFSET)
-#define        SIU_INT_SPI             ((uint)0x02 + CPM_IRQ_OFFSET)
-#define        SIU_INT_RISC            ((uint)0x03 + CPM_IRQ_OFFSET)
-#define        SIU_INT_SMC1            ((uint)0x04 + CPM_IRQ_OFFSET)
-#define        SIU_INT_SMC2            ((uint)0x05 + CPM_IRQ_OFFSET)
-#define        SIU_INT_IDMA1           ((uint)0x06 + CPM_IRQ_OFFSET)
-#define        SIU_INT_IDMA2           ((uint)0x07 + CPM_IRQ_OFFSET)
-#define        SIU_INT_IDMA3           ((uint)0x08 + CPM_IRQ_OFFSET)
-#define        SIU_INT_IDMA4           ((uint)0x09 + CPM_IRQ_OFFSET)
-#define        SIU_INT_SDMA            ((uint)0x0a + CPM_IRQ_OFFSET)
-#define        SIU_INT_USB             ((uint)0x0b + CPM_IRQ_OFFSET)
-#define        SIU_INT_TIMER1          ((uint)0x0c + CPM_IRQ_OFFSET)
-#define        SIU_INT_TIMER2          ((uint)0x0d + CPM_IRQ_OFFSET)
-#define        SIU_INT_TIMER3          ((uint)0x0e + CPM_IRQ_OFFSET)
-#define        SIU_INT_TIMER4          ((uint)0x0f + CPM_IRQ_OFFSET)
-#define        SIU_INT_TMCNT           ((uint)0x10 + CPM_IRQ_OFFSET)
-#define        SIU_INT_PIT             ((uint)0x11 + CPM_IRQ_OFFSET)
-#define        SIU_INT_PCI             ((uint)0x12 + CPM_IRQ_OFFSET)
-#define        SIU_INT_IRQ1            ((uint)0x13 + CPM_IRQ_OFFSET)
-#define        SIU_INT_IRQ2            ((uint)0x14 + CPM_IRQ_OFFSET)
-#define        SIU_INT_IRQ3            ((uint)0x15 + CPM_IRQ_OFFSET)
-#define        SIU_INT_IRQ4            ((uint)0x16 + CPM_IRQ_OFFSET)
-#define        SIU_INT_IRQ5            ((uint)0x17 + CPM_IRQ_OFFSET)
-#define        SIU_INT_IRQ6            ((uint)0x18 + CPM_IRQ_OFFSET)
-#define        SIU_INT_IRQ7            ((uint)0x19 + CPM_IRQ_OFFSET)
-#define        SIU_INT_FCC1            ((uint)0x20 + CPM_IRQ_OFFSET)
-#define        SIU_INT_FCC2            ((uint)0x21 + CPM_IRQ_OFFSET)
-#define        SIU_INT_FCC3            ((uint)0x22 + CPM_IRQ_OFFSET)
-#define        SIU_INT_MCC1            ((uint)0x24 + CPM_IRQ_OFFSET)
-#define        SIU_INT_MCC2            ((uint)0x25 + CPM_IRQ_OFFSET)
-#define        SIU_INT_SCC1            ((uint)0x28 + CPM_IRQ_OFFSET)
-#define        SIU_INT_SCC2            ((uint)0x29 + CPM_IRQ_OFFSET)
-#define        SIU_INT_SCC3            ((uint)0x2a + CPM_IRQ_OFFSET)
-#define        SIU_INT_SCC4            ((uint)0x2b + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC15            ((uint)0x30 + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC14            ((uint)0x31 + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC13            ((uint)0x32 + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC12            ((uint)0x33 + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC11            ((uint)0x34 + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC10            ((uint)0x35 + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC9             ((uint)0x36 + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC8             ((uint)0x37 + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC7             ((uint)0x38 + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC6             ((uint)0x39 + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC5             ((uint)0x3a + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC4             ((uint)0x3b + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC3             ((uint)0x3c + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC2             ((uint)0x3d + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC1             ((uint)0x3e + CPM_IRQ_OFFSET)
-#define        SIU_INT_PC0             ((uint)0x3f + CPM_IRQ_OFFSET)
-
-#endif /* CONFIG_8260 */
-
-#endif /* Whatever way too big #ifdef */
-
-#define NR_MASK_WORDS  ((NR_IRQS + 31) / 32)
-/* pedantic: these are long because they are used with set_bit --RR */
-extern unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
-
-/*
- * Because many systems have two overlapping names spaces for
- * interrupts (ISA and XICS for example), and the ISA interrupts
- * have historically not been easy to renumber, we allow ISA
- * interrupts to take values 0 - 15, and shift up the remaining
- * interrupts by 0x10.
- */
-#define NUM_ISA_INTERRUPTS     0x10
-extern int __irq_offset_value;
-
-static inline int irq_offset_up(int irq)
-{
-       return(irq + __irq_offset_value);
-}
-
-static inline int irq_offset_down(int irq)
-{
-       return(irq - __irq_offset_value);
-}
-
-static inline int irq_offset_value(void)
-{
-       return __irq_offset_value;
-}
-
-#ifdef __DO_IRQ_CANON
-extern int ppc_do_canonicalize_irqs;
-#else
-#define ppc_do_canonicalize_irqs       0
-#endif
-
-static __inline__ int irq_canonicalize(int irq)
-{
-       if (ppc_do_canonicalize_irqs && irq == 2)
-               irq = 9;
-       return irq;
-}
-#endif /* CONFIG_PPC_MERGE */
-
 extern int distribute_irqs;
 
 struct irqaction;
similarity index 93%
rename from include/asm-powerpc/irqflags.h
rename to arch/powerpc/include/asm/irqflags.h
index cc6fdba..17ba3a8 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * include/asm-powerpc/irqflags.h
- *
  * IRQ flags handling
  */
 #ifndef _ASM_IRQFLAGS_H
@@ -10,7 +8,7 @@
 /*
  * Get definitions for raw_local_save_flags(x), etc.
  */
-#include <asm-powerpc/hw_irq.h>
+#include <asm/hw_irq.h>
 
 #else
 #ifdef CONFIG_TRACE_IRQFLAGS
similarity index 98%
rename from include/asm-powerpc/kgdb.h
rename to arch/powerpc/include/asm/kgdb.h
index 1399caf..edd2170 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * include/asm-powerpc/kgdb.h
- *
  * The PowerPC (32/64) specific defines / externs for KGDB.  Based on
  * the previous 32bit and 64bit specific files, which had the following
  * copyrights:
similarity index 99%
rename from include/asm-powerpc/paca.h
rename to arch/powerpc/include/asm/paca.h
index 7b56444..6493a39 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * include/asm-powerpc/paca.h
- *
  * This control block defines the PACA which defines the processor
  * specific data for each logical processor on the system.
  * There are some pointers defined that are utilized by PLIC.
similarity index 99%
rename from include/asm-powerpc/pgtable-ppc64.h
rename to arch/powerpc/include/asm/pgtable-ppc64.h
index 74c6f38..db0b8f3 100644 (file)
 
 #define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY)
 
-/* __pgprot defined in asm-powerpc/page.h */
+/* __pgprot defined in arch/powerpc/incliude/asm/page.h */
 #define PAGE_NONE      __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED)
 
 #define PAGE_SHARED    __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER)
similarity index 99%
rename from include/asm-powerpc/qe_ic.h
rename to arch/powerpc/include/asm/qe_ic.h
index a779b2c..56a7745 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * include/asm-powerpc/qe_ic.h
- *
  * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved.
  *
  * Authors:    Shlomi Gridish <gridish@freescale.com>
similarity index 96%
rename from include/asm-powerpc/rwsem.h
rename to arch/powerpc/include/asm/rwsem.h
index a6cc93b..24cd928 100644 (file)
@@ -8,8 +8,8 @@
 #ifdef __KERNEL__
 
 /*
- * include/asm-powerpc/rwsem.h: R/W semaphores for PPC using the stuff
- * in lib/rwsem.c.  Adapted largely from include/asm-i386/rwsem.h
+ * R/W semaphores for PPC using the stuff in lib/rwsem.c.
+ * Adapted largely from include/asm-i386/rwsem.h
  * by Paul Mackerras <paulus@samba.org>.
  */
 
similarity index 99%
rename from include/asm-powerpc/ucc_fast.h
rename to arch/powerpc/include/asm/ucc_fast.h
index fce16ab..839aab8 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * include/asm-powerpc/ucc_fast.h
- *
  * Internal header file for UCC FAST unit routines.
  *
  * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved.
similarity index 95%
rename from include/asm-powerpc/uic.h
rename to arch/powerpc/include/asm/uic.h
index 970eb7e..597edfc 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * include/asm-powerpc/uic.h
- *
  * IBM PPC4xx UIC external definitions and structure.
  *
  * Maintainer: David Gibson <dwg@au1.ibm.com>
index 1a40947..64f5948 100644 (file)
@@ -59,8 +59,6 @@ obj64-$(CONFIG_HIBERNATION)   += swsusp_asm64.o
 obj-$(CONFIG_MODULES)          += module.o module_$(CONFIG_WORD_SIZE).o
 obj-$(CONFIG_44x)              += cpu_setup_44x.o
 
-ifeq ($(CONFIG_PPC_MERGE),y)
-
 extra-$(CONFIG_PPC_STD_MMU)    := head_32.o
 extra-$(CONFIG_PPC64)          := head_64.o
 extra-$(CONFIG_40x)            := head_40x.o
@@ -100,12 +98,6 @@ ifneq ($(CONFIG_PPC_INDIRECT_IO),y)
 obj-y                          += iomap.o
 endif
 
-else
-# stuff used from here for ARCH=ppc
-smpobj-$(CONFIG_SMP)           += smp.o
-
-endif
-
 obj-$(CONFIG_PPC64)            += $(obj64-y)
 
 extra-$(CONFIG_PPC_FPU)                += fpu.o
@@ -121,9 +113,6 @@ PHONY += systbl_chk
 systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i
        $(call cmd,systbl_chk)
 
-
-ifeq ($(CONFIG_PPC_MERGE),y)
-
 $(obj)/built-in.o:             prom_init_check
 
 quiet_cmd_prom_init_check = CALL    $<
@@ -133,7 +122,4 @@ PHONY += prom_init_check
 prom_init_check: $(src)/prom_init_check.sh $(obj)/prom_init.o
        $(call cmd,prom_init_check)
 
-endif
-
-
 clean-files := vmlinux.lds
index 5465e8d..80cac98 100644 (file)
@@ -39,12 +39,6 @@ _GLOBAL(__setup_cpu_440gx)
 _GLOBAL(__setup_cpu_440spe)
        b       __fixup_440A_mcheck
 
- /* Temporary fixup for arch/ppc until we kill the whole thing */
-#ifndef CONFIG_PPC_MERGE
-_GLOBAL(__fixup_440A_mcheck)
-       blr
-#endif
-
 /* enable APU between CPU and FPU */
 _GLOBAL(__init_fpu_44x)
        mfspr   r3,SPRN_CCR0
index 6ac8612..d972dec 100644 (file)
@@ -77,22 +77,12 @@ static int ppc_spurious_interrupts;
 EXPORT_SYMBOL(__irq_offset_value);
 atomic_t ppc_n_lost_interrupts;
 
-#ifndef CONFIG_PPC_MERGE
-#define NR_MASK_WORDS  ((NR_IRQS + 31) / 32)
-unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
-#endif
-
 #ifdef CONFIG_TAU_INT
 extern int tau_initialized;
 extern int tau_interrupts(int);
 #endif
 #endif /* CONFIG_PPC32 */
 
-#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_MERGE)
-extern atomic_t ipi_recv;
-extern atomic_t ipi_sent;
-#endif
-
 #ifdef CONFIG_PPC64
 EXPORT_SYMBOL(irq_desc);
 
@@ -216,21 +206,14 @@ int show_interrupts(struct seq_file *p, void *v)
 skip:
                spin_unlock_irqrestore(&desc->lock, flags);
        } else if (i == NR_IRQS) {
-#ifdef CONFIG_PPC32
-#ifdef CONFIG_TAU_INT
+#if defined(CONFIG_PPC32) && defined(CONFIG_TAU_INT)
                if (tau_initialized){
                        seq_puts(p, "TAU: ");
                        for_each_online_cpu(j)
                                seq_printf(p, "%10u ", tau_interrupts(j));
                        seq_puts(p, "  PowerPC             Thermal Assist (cpu temp)\n");
                }
-#endif
-#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_MERGE)
-               /* should this be per processor send/receive? */
-               seq_printf(p, "IPI (recv/sent): %10u/%u\n",
-                               atomic_read(&ipi_recv), atomic_read(&ipi_sent));
-#endif
-#endif /* CONFIG_PPC32 */
+#endif /* CONFIG_PPC32 && CONFIG_TAU_INT*/
                seq_printf(p, "BAD: %10u\n", ppc_spurious_interrupts);
        }
        return 0;
@@ -454,8 +437,6 @@ void do_softirq(void)
  * IRQ controller and virtual interrupts
  */
 
-#ifdef CONFIG_PPC_MERGE
-
 static LIST_HEAD(irq_hosts);
 static DEFINE_SPINLOCK(irq_big_lock);
 static DEFINE_PER_CPU(unsigned int, irq_radix_reader);
@@ -1114,8 +1095,6 @@ static int __init irq_debugfs_init(void)
 __initcall(irq_debugfs_init);
 #endif /* CONFIG_VIRQ_DEBUG */
 
-#endif /* CONFIG_PPC_MERGE */
-
 #ifdef CONFIG_PPC64
 static int __init setup_noirqdistrib(char *str)
 {
index e030f3b..957bded 100644 (file)
@@ -276,10 +276,8 @@ int set_dabr(unsigned long dabr)
 {
        __get_cpu_var(current_dabr) = dabr;
 
-#ifdef CONFIG_PPC_MERGE                /* XXX for now */
        if (ppc_md.set_dabr)
                return ppc_md.set_dabr(dabr);
-#endif
 
        /* XXX should we have a CPU_FTR_HAS_DABR ? */
 #if defined(CONFIG_PPC64) || defined(CONFIG_6xx)
index f177c60..65639a4 100644 (file)
@@ -788,9 +788,7 @@ static int __init vdso_init(void)
 
        return 0;
 }
-#ifdef CONFIG_PPC_MERGE
 arch_initcall(vdso_init);
-#endif
 
 int in_gate_area_no_task(unsigned long addr)
 {
index 2a88e8b..d69912c 100644 (file)
@@ -6,12 +6,10 @@ ifeq ($(CONFIG_PPC64),y)
 EXTRA_CFLAGS           += -mno-minimal-toc
 endif
 
-ifeq ($(CONFIG_PPC_MERGE),y)
 obj-y                  := string.o alloc.o \
                           checksum_$(CONFIG_WORD_SIZE).o
 obj-$(CONFIG_PPC32)    += div64.o copy_32.o crtsavres.o
 obj-$(CONFIG_HAS_IOMEM)        += devres.o
-endif
 
 obj-$(CONFIG_PPC64)    += copypage_64.o copyuser_64.o \
                           memcpy_64.o usercopy_64.o mem_64.o string.o
index 702691c..1c93c25 100644 (file)
@@ -311,7 +311,7 @@ void __init paging_init(void)
 #endif /* CONFIG_HIGHMEM */
 
        printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%lx\n",
-              (u64)top_of_ram, total_ram);
+              (unsigned long long)top_of_ram, total_ram);
        printk(KERN_DEBUG "Memory hole size: %ldMB\n",
               (long int)((top_of_ram - total_ram) >> 20));
        memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
index c53145f..6aa1208 100644 (file)
@@ -236,8 +236,8 @@ void __init MMU_init_hw(void)
 
        Hash_end = (struct hash_pte *) ((unsigned long)Hash + Hash_size);
 
-       printk("Total memory = %ldMB; using %ldkB for hash table (at %p)\n",
-              total_memory >> 20, Hash_size >> 10, Hash);
+       printk("Total memory = %lldMB; using %ldkB for hash table (at %p)\n",
+              (unsigned long long)(total_memory >> 20), Hash_size >> 10, Hash);
 
 
        /*
index 409fcc7..be7dd42 100644 (file)
@@ -34,7 +34,7 @@
 DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch);
 
 /* This is declared as we are using the more or less generic
- * include/asm-powerpc/tlb.h file -- tgall
+ * arch/powerpc/include/asm/tlb.h file -- tgall
  */
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 static DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
index daf0e15..b8a5206 100644 (file)
@@ -1,10 +1,8 @@
 #
 # Makefile for 52xx based boards
 #
-ifeq ($(CONFIG_PPC_MERGE),y)
 obj-y                          += mpc52xx_pic.o mpc52xx_common.o
 obj-$(CONFIG_PCI)              += mpc52xx_pci.o
-endif
 
 obj-$(CONFIG_PPC_MPC5200_SIMPLE) += mpc5200_simple.o
 obj-$(CONFIG_PPC_EFIKA)                += efika.o
@@ -15,4 +13,4 @@ ifeq ($(CONFIG_PPC_LITE5200),y)
        obj-$(CONFIG_PM)        += lite5200_sleep.o lite5200_pm.o
 endif
 
-obj-$(CONFIG_PPC_MPC5200_GPIO) += mpc52xx_gpio.o
\ No newline at end of file
+obj-$(CONFIG_PPC_MPC5200_GPIO) += mpc52xx_gpio.o
index 835f2dc..014e26c 100644 (file)
@@ -19,7 +19,7 @@
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/pci-bridge.h>
-#include <asm-powerpc/mpic.h>
+#include <asm/mpic.h>
 #include <asm/mpc86xx.h>
 #include <asm/cacheflush.h>
 
index 423a023..8079e0b 100644 (file)
@@ -1,13 +1,7 @@
 
 obj-$(CONFIG_FSL_ULI1575)      += fsl_uli1575.o
 
-ifeq ($(CONFIG_PPC_MERGE),y)
 obj-$(CONFIG_PPC_PMAC)         += powermac/
-else
-ifeq ($(CONFIG_PPC64),y)
-obj-$(CONFIG_PPC_PMAC)         += powermac/
-endif
-endif
 obj-$(CONFIG_PPC_CHRP)         += chrp/
 obj-$(CONFIG_40x)              += 40x/
 obj-$(CONFIG_44x)              += 44x/
index 8977417..58ecdd7 100644 (file)
@@ -7,7 +7,7 @@ endif
 
 obj-y                          += pic.o setup.o time.o feature.o pci.o \
                                   sleep.o low_i2c.o cache.o pfunc_core.o \
-                                  pfunc_base.o
+                                  pfunc_base.o udbg_scc.o udbg_adb.o
 obj-$(CONFIG_PMAC_BACKLIGHT)   += backlight.o
 obj-$(CONFIG_CPU_FREQ_PMAC)    += cpufreq_32.o
 obj-$(CONFIG_CPU_FREQ_PMAC64)  += cpufreq_64.o
@@ -19,4 +19,3 @@ obj-$(CONFIG_NVRAM:m=y)               += nvram.o
 obj-$(CONFIG_PPC64)            += nvram.o
 obj-$(CONFIG_PPC32)            += bootx_init.o
 obj-$(CONFIG_SMP)              += smp.o
-obj-$(CONFIG_PPC_MERGE)                += udbg_scc.o udbg_adb.o
index 16a0ed2..a90054b 100644 (file)
@@ -25,7 +25,6 @@ obj-$(CONFIG_MV64X60)         += $(mv64x60-y) mv64x60_pic.o mv64x60_dev.o \
 obj-$(CONFIG_RTC_DRV_CMOS)     += rtc_cmos_setup.o
 obj-$(CONFIG_AXON_RAM)         += axonram.o
 
-ifeq ($(CONFIG_PPC_MERGE),y)
 obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
 obj-$(CONFIG_PPC_I8259)                += i8259.o
 obj-$(CONFIG_IPIC)             += ipic.o
@@ -36,7 +35,6 @@ obj-$(CONFIG_OF_RTC)          += of_rtc.o
 ifeq ($(CONFIG_PCI),y)
 obj-$(CONFIG_4xx)              += ppc4xx_pci.o
 endif
-endif
 
 # Temporary hack until we have migrated to asm-powerpc
 ifeq ($(ARCH),powerpc)
index cb992c3..5131d50 100644 (file)
@@ -48,6 +48,9 @@ config GENERIC_HWEIGHT
 config GENERIC_HARDIRQS
        def_bool y
 
+config GENERIC_HARDIRQS_NO__DO_IRQ
+       def_bool y
+
 config GENERIC_IRQ_PROBE
        def_bool y
 
@@ -63,6 +66,10 @@ config GENERIC_TIME
 config GENERIC_CLOCKEVENTS
        def_bool n
 
+config GENERIC_LOCKBREAK
+       def_bool y
+       depends on SMP && PREEMPT
+
 config SYS_SUPPORTS_PM
        bool
 
@@ -94,9 +101,6 @@ config ARCH_HAS_ILOG2_U64
 config ARCH_NO_VIRT_TO_BUS
        def_bool y
 
-config ARCH_SUPPORTS_AOUT
-       def_bool y
-
 config IO_TRAPPED
        bool
 
@@ -483,6 +487,23 @@ config CRASH_DUMP
 
          For more details see Documentation/kdump/kdump.txt
 
+config SECCOMP
+       bool "Enable seccomp to safely compute untrusted bytecode"
+       depends on PROC_FS
+       default y
+       help
+         This kernel feature is useful for number crunching applications
+         that may need to compute untrusted bytecode during their
+         execution. By using pipes or other transports made available to
+         the process as file descriptors supporting the read/write
+         syscalls, it's possible to isolate those applications in
+         their own address space using seccomp. Once seccomp is
+         enabled via prctl, it cannot be disabled and the task is only
+         allowed to execute a few safe syscalls defined by each seccomp
+         mode.
+
+         If unsure, say N.
+
 config SMP
        bool "Symmetric multi-processing support"
        depends on SYS_SUPPORTS_SMP
index 36f4b1f..4d2d102 100644 (file)
@@ -182,7 +182,7 @@ if SUPERH64
 
 config SH64_PROC_ASIDS
        bool "Debug: report ASIDs through /proc/asids"
-       depends on PROC_FS
+       depends on PROC_FS && MMU
 
 config SH64_SR_WATCH
        bool "Debug: set SR.WATCH to enable hardware watchpoints and trace"
index 25659ce..01d85c7 100644 (file)
@@ -95,8 +95,6 @@ head-y                        := arch/sh/kernel/init_task.o
 head-$(CONFIG_SUPERH32)        += arch/sh/kernel/head_32.o
 head-$(CONFIG_SUPERH64)        += arch/sh/kernel/head_64.o
 
-LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
-
 core-y                         += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/
 core-$(CONFIG_SH_FPU_EMU)      += arch/sh/math-emu/
 
@@ -145,10 +143,6 @@ cpuincdir-$(CONFIG_CPU_SH4)        += cpu-sh4
 cpuincdir-$(CONFIG_CPU_SH5)    += cpu-sh5
 cpuincdir-y                    += cpu-common   # Must be last
 
-libs-$(CONFIG_SUPERH32)                := arch/sh/lib/ $(libs-y)
-libs-$(CONFIG_SUPERH64)                := arch/sh/lib64/ $(libs-y)
-libs-y                         += $(LIBGCC)
-
 drivers-y                      += arch/sh/drivers/
 drivers-$(CONFIG_OPROFILE)     += arch/sh/oprofile/
 
@@ -161,10 +155,16 @@ KBUILD_CFLAGS             += -pipe $(cflags-y)
 KBUILD_CPPFLAGS                += $(cflags-y)
 KBUILD_AFLAGS          += $(cflags-y)
 
+LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
+
+libs-$(CONFIG_SUPERH32)                := arch/sh/lib/ $(libs-y)
+libs-$(CONFIG_SUPERH64)                := arch/sh/lib64/ $(libs-y)
+libs-y                         += $(LIBGCC)
+
 PHONY += maketools FORCE
 
 maketools:  include/linux/version.h FORCE
-       $(Q)$(MAKE) $(build)=arch/sh/tools arch/sh/include/asm/machtypes.h
+       $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
 
 all: $(KBUILD_IMAGE)
 
@@ -215,4 +215,4 @@ arch/sh/lib64/syscalltab.h: arch/sh/kernel/syscalls_64.S
        $(call filechk,gen-syscalltab)
 
 CLEAN_FILES += arch/sh/lib64/syscalltab.h \
-              arch/sh/include/asm/machtypes.h
+              include/asm-sh/machtypes.h
index ff9b93c..463022c 100644 (file)
@@ -5,4 +5,4 @@ obj-$(CONFIG_SH_AP325RXA)       += board-ap325rxa.o
 obj-$(CONFIG_SH_MAGIC_PANEL_R2)        += board-magicpanelr2.o
 obj-$(CONFIG_SH_RSK7203)       += board-rsk7203.o
 obj-$(CONFIG_SH_SH7785LCR)     += board-sh7785lcr.o
-obj-$(CONFIG_SH_SHMIN)         += board-shmin..o
+obj-$(CONFIG_SH_SHMIN)         += board-shmin.o
index 9c71603..025d4fe 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/mtd/physmap.h>
 #include <linux/delay.h>
 #include <linux/i2c.h>
-#include <linux/delay.h>
 #include <linux/smc911x.h>
 #include <media/soc_camera_platform.h>
 #include <media/sh_mobile_ceu.h>
index 5d96e2e..051c29d 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
-#include <linux/irq.h>
 #include <linux/io.h>
 #include <mach-se/mach/se7343.h>
 
index d407528..3dc1cbd 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.26
-# Wed Jul 30 01:34:24 2008
+# Linux kernel version: 2.6.27-rc1
+# Mon Aug  4 16:49:13 2008
 #
 CONFIG_SUPERH=y
 CONFIG_SUPERH32=y
@@ -11,6 +11,7 @@ CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_TIME=y
@@ -21,7 +22,6 @@ CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_ARCH_NO_VIRT_TO_BUS=y
-CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -87,6 +87,7 @@ CONFIG_HAVE_OPROFILE=y
 # CONFIG_USE_GENERIC_SMP_HELPERS is not set
 CONFIG_HAVE_CLK=y
 CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
@@ -284,6 +285,7 @@ CONFIG_HZ=250
 # CONFIG_SCHED_HRTICK is not set
 # CONFIG_KEXEC is not set
 # CONFIG_CRASH_DUMP is not set
+CONFIG_SECCOMP=y
 # CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREEMPT=y
@@ -317,10 +319,6 @@ CONFIG_PCI_LEGACY=y
 #
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
-
-#
-# Networking
-#
 CONFIG_NET=y
 
 #
@@ -555,7 +553,7 @@ CONFIG_INPUT_KEYBOARD=y
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 # CONFIG_KEYBOARD_STOWAWAY is not set
-# CONFIG_KEYBOARD_MAPLE is not set
+CONFIG_KEYBOARD_MAPLE=y
 # CONFIG_KEYBOARD_SH_KEYSC is not set
 CONFIG_INPUT_MOUSE=y
 # CONFIG_MOUSE_PS2 is not set
diff --git a/arch/sh/include/asm/a.out.h b/arch/sh/include/asm/a.out.h
deleted file mode 100644 (file)
index 1f93130..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __ASM_SH_A_OUT_H
-#define __ASM_SH_A_OUT_H
-
-struct exec
-{
-  unsigned long a_info;                /* Use macros N_MAGIC, etc for access */
-  unsigned a_text;             /* length of text, in bytes */
-  unsigned a_data;             /* length of data, in bytes */
-  unsigned a_bss;              /* length of uninitialized data area for file, in bytes */
-  unsigned a_syms;             /* length of symbol table data in file, in bytes */
-  unsigned a_entry;            /* start address */
-  unsigned a_trsize;           /* length of relocation info for text, in bytes */
-  unsigned a_drsize;           /* length of relocation info for data, in bytes */
-};
-
-#define N_TRSIZE(a)    ((a).a_trsize)
-#define N_DRSIZE(a)    ((a).a_drsize)
-#define N_SYMSIZE(a)   ((a).a_syms)
-
-#endif /* __ASM_SH_A_OUT_H */
index 643ab5a..b86aeab 100644 (file)
@@ -104,6 +104,15 @@ struct pt_dspregs {
 
 extern void show_regs(struct pt_regs *);
 
+/*
+ * These are defined as per linux/ptrace.h.
+ */
+struct task_struct;
+
+#define arch_has_single_step() (1)
+extern void user_enable_single_step(struct task_struct *);
+extern void user_disable_single_step(struct task_struct *);
+
 #ifdef CONFIG_SH_DSP
 #define task_pt_regs(task) \
        ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
diff --git a/arch/sh/include/asm/seccomp.h b/arch/sh/include/asm/seccomp.h
new file mode 100644 (file)
index 0000000..3280ed3
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef __ASM_SECCOMP_H
+
+#include <linux/unistd.h>
+
+#define __NR_seccomp_read __NR_read
+#define __NR_seccomp_write __NR_write
+#define __NR_seccomp_exit __NR_exit
+#define __NR_seccomp_sigreturn __NR_rt_sigreturn
+
+#endif /* __ASM_SECCOMP_H */
index eeb4c74..0a894ca 100644 (file)
@@ -117,24 +117,45 @@ static inline struct thread_info *current_thread_info(void)
 #define TIF_NEED_RESCHED       2       /* rescheduling necessary */
 #define TIF_RESTORE_SIGMASK    3       /* restore signal mask in do_signal() */
 #define TIF_SINGLESTEP         4       /* singlestepping active */
-#define TIF_SYSCALL_AUDIT      5
+#define TIF_SYSCALL_AUDIT      5       /* syscall auditing active */
+#define TIF_SECCOMP            6       /* secure computing */
+#define TIF_NOTIFY_RESUME      7       /* callback before returning to user */
 #define TIF_USEDFPU            16      /* FPU was used by this task this quantum (SMP) */
 #define TIF_POLLING_NRFLAG     17      /* true if poll_idle() is polling TIF_NEED_RESCHED */
 #define TIF_MEMDIE             18
-#define TIF_FREEZE             19
-
-#define _TIF_SYSCALL_TRACE     (1<<TIF_SYSCALL_TRACE)
-#define _TIF_SIGPENDING                (1<<TIF_SIGPENDING)
-#define _TIF_NEED_RESCHED      (1<<TIF_NEED_RESCHED)
-#define _TIF_RESTORE_SIGMASK   (1<<TIF_RESTORE_SIGMASK)
-#define _TIF_SINGLESTEP                (1<<TIF_SINGLESTEP)
-#define _TIF_SYSCALL_AUDIT             (1<<TIF_SYSCALL_AUDIT)
-#define _TIF_USEDFPU           (1<<TIF_USEDFPU)
-#define _TIF_POLLING_NRFLAG    (1<<TIF_POLLING_NRFLAG)
-#define _TIF_FREEZE            (1<<TIF_FREEZE)
-
-#define _TIF_WORK_MASK         0x000000FE      /* work to do on interrupt/exception return */
-#define _TIF_ALLWORK_MASK      0x000000FF      /* work to do on any return to u-space */
+#define TIF_FREEZE             19      /* Freezing for suspend */
+
+#define _TIF_SYSCALL_TRACE     (1 << TIF_SYSCALL_TRACE)
+#define _TIF_SIGPENDING                (1 << TIF_SIGPENDING)
+#define _TIF_NEED_RESCHED      (1 << TIF_NEED_RESCHED)
+#define _TIF_RESTORE_SIGMASK   (1 << TIF_RESTORE_SIGMASK)
+#define _TIF_SINGLESTEP                (1 << TIF_SINGLESTEP)
+#define _TIF_SYSCALL_AUDIT     (1 << TIF_SYSCALL_AUDIT)
+#define _TIF_SECCOMP           (1 << TIF_SECCOMP)
+#define _TIF_NOTIFY_RESUME     (1 << TIF_NOTIFY_RESUME)
+#define _TIF_USEDFPU           (1 << TIF_USEDFPU)
+#define _TIF_POLLING_NRFLAG    (1 << TIF_POLLING_NRFLAG)
+#define _TIF_FREEZE            (1 << TIF_FREEZE)
+
+/*
+ * _TIF_ALLWORK_MASK and _TIF_WORK_MASK need to fit within a byte, or we
+ * blow the tst immediate size constraints and need to fix up
+ * arch/sh/kernel/entry-common.S.
+ */
+
+/* work to do in syscall trace */
+#define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
+                                _TIF_SYSCALL_AUDIT | _TIF_SECCOMP)
+
+/* work to do on any return to u-space */
+#define _TIF_ALLWORK_MASK      (_TIF_SYSCALL_TRACE | _TIF_SIGPENDING      | \
+                                _TIF_NEED_RESCHED  | _TIF_SYSCALL_AUDIT   | \
+                                _TIF_SINGLESTEP    | _TIF_RESTORE_SIGMASK | \
+                                _TIF_NOTIFY_RESUME)
+
+/* work to do on interrupt/exception return */
+#define _TIF_WORK_MASK         (_TIF_ALLWORK_MASK & ~(_TIF_SYSCALL_TRACE | \
+                                _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP))
 
 #endif /* __KERNEL__ */
 
index 0a96f3a..ef0ae2a 100644 (file)
 #ifndef __ASSEMBLY__
 
 /**
- * for_each_dtlb_entry
+ * for_each_dtlb_entry - Iterate over free (non-wired) DTLB entries
  *
  * @tlb:       TLB entry
- *
- * Iterate over free (non-wired) DTLB entries
  */
 #define for_each_dtlb_entry(tlb)               \
        for (tlb  = cpu_data->dtlb.first;       \
             tlb += cpu_data->dtlb.step)
 
 /**
- * for_each_itlb_entry
+ * for_each_itlb_entry - Iterate over free (non-wired) ITLB entries
  *
  * @tlb:       TLB entry
- *
- * Iterate over free (non-wired) ITLB entries
  */
 #define for_each_itlb_entry(tlb)               \
        for (tlb  = cpu_data->itlb.first;       \
             tlb += cpu_data->itlb.step)
 
 /**
- * __flush_tlb_slot
+ * __flush_tlb_slot - Flushes TLB slot @slot.
  *
  * @slot:      Address of TLB slot.
- *
- * Flushes TLB slot @slot.
  */
 static inline void __flush_tlb_slot(unsigned long long slot)
 {
index 4e0b165..673515b 100644 (file)
 #define CCR            0xffffffec
 
 #define CCR_CACHE_CE   0x01    /* Cache enable */
-#define CCR_CACHE_WT   0x06    /* CCR[bit1=1,bit2=1] */
+#define CCR_CACHE_WT   0x02    /* CCR[bit1=1,bit2=1] */
                                /* 0x00000000-0x7fffffff: Write-through  */
                                /* 0x80000000-0x9fffffff: Write-back     */
                                 /* 0xc0000000-0xdfffffff: Write-through  */
-#define CCR_CACHE_CB   0x00    /* CCR[bit1=0,bit2=0] */
+#define CCR_CACHE_CB   0x04    /* CCR[bit1=0,bit2=0] */
                                /* 0x00000000-0x7fffffff: Write-back     */
                                /* 0x80000000-0x9fffffff: Write-through  */
                                 /* 0xc0000000-0xdfffffff: Write-back     */
@@ -36,6 +36,8 @@
 
 #define CCR_CACHE_ENABLE       CCR_CACHE_CE
 #define CCR_CACHE_INVALIDATE   CCR_CACHE_CF
+#define CACHE_PHYSADDR_MASK    0x1ffffc00
+
 #endif
 
 #endif /* __ASM_CPU_SH2_CACHE_H */
diff --git a/arch/sh/include/cpu-sh2a/cpu/addrspace.h b/arch/sh/include/cpu-sh2a/cpu/addrspace.h
new file mode 100644 (file)
index 0000000..31eb4b5
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef __ASM_SH_CPU_SH2A_ADDRSPACE_H
+#define __ASM_SH_CPU_SH2A_ADDRSPACE_H
+
+#define P0SEG          0x00000000
+#define P1SEG          0x00000000
+#define P2SEG          0x20000000
+#define P3SEG          0x40000000
+#define P4SEG          0x60000000
+
+#endif /* __ASM_SH_CPU_SH2A_ADDRSPACE_H */
index afe228b..defb0ba 100644 (file)
@@ -36,5 +36,8 @@
 
 #define CCR_CACHE_ENABLE       (CCR_CACHE_OCE | CCR_CACHE_ICE)
 #define CCR_CACHE_INVALIDATE   (CCR_CACHE_OCI | CCR_CACHE_ICI)
+#define CCR_ICACHE_INVALIDATE  CCR_CACHE_ICI
+#define CCR_OCACHE_INVALIDATE  CCR_CACHE_OCI
+#define CACHE_PHYSADDR_MASK    0x1ffffc00
 
 #endif /* __ASM_CPU_SH2A_CACHE_H */
diff --git a/arch/sh/include/cpu-sh2a/cpu/cacheflush.h b/arch/sh/include/cpu-sh2a/cpu/cacheflush.h
new file mode 100644 (file)
index 0000000..3d3b920
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef __ASM_CPU_SH2A_CACHEFLUSH_H
+#define __ASM_CPU_SH2A_CACHEFLUSH_H
+
+/* 
+ * Cache flushing:
+ *
+ *  - flush_cache_all() flushes entire cache
+ *  - flush_cache_mm(mm) flushes the specified mm context's cache lines
+ *  - flush_cache_dup mm(mm) handles cache flushing when forking
+ *  - flush_cache_page(mm, vmaddr, pfn) flushes a single page
+ *  - flush_cache_range(vma, start, end) flushes a range of pages
+ *
+ *  - flush_dcache_page(pg) flushes(wback&invalidates) a page for dcache
+ *  - flush_icache_range(start, end) flushes(invalidates) a range for icache
+ *  - flush_icache_page(vma, pg) flushes(invalidates) a page for icache
+ *
+ *  Caches are indexed (effectively) by physical address on SH-2, so
+ *  we don't need them.
+ */
+#define flush_cache_all()                      do { } while (0)
+#define flush_cache_mm(mm)                     do { } while (0)
+#define flush_cache_dup_mm(mm)                 do { } while (0)
+#define flush_cache_range(vma, start, end)     do { } while (0)
+#define flush_cache_page(vma, vmaddr, pfn)     do { } while (0)
+#define flush_dcache_page(page)                        do { } while (0)
+#define flush_dcache_mmap_lock(mapping)                do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)      do { } while (0)
+void flush_icache_range(unsigned long start, unsigned long end);
+#define flush_icache_page(vma,pg)              do { } while (0)
+#define flush_icache_user_range(vma,pg,adr,len)        do { } while (0)
+#define flush_cache_sigtramp(vaddr)            do { } while (0)
+
+#define p3_cache_init()                                do { } while (0)
+#endif /* __ASM_CPU_SH2A_CACHEFLUSH_H */
index dcdf959..8a8a993 100644 (file)
@@ -199,7 +199,7 @@ EXPORT_SYMBOL(sq_remap);
 
 /**
  * sq_unmap - Unmap a Store Queue allocation
- * @map: Pre-allocated Store Queue mapping.
+ * @vaddr: Pre-allocated Store Queue mapping.
  *
  * Unmaps the store queue allocation @map that was previously created by
  * sq_remap(). Also frees up the pte that was previously inserted into
index ca08e7f..04c7da9 100644 (file)
@@ -987,11 +987,11 @@ work_resched:
 work_notifysig:
        gettr   tr1, LINK
 
-       movi    do_signal, r6
+       movi    do_notify_resume, r6
        ptabs   r6, tr0
        or      SP, ZERO, r2
-       or      ZERO, ZERO, r3
-       blink   tr0, LINK           /* Call do_signal(regs, 0), return here */
+       or      r7, ZERO, r3
+       blink   tr0, LINK           /* Call do_notify_resume(regs, current_thread_info->flags), return here */
 
 restore_all:
        /* Do prefetches */
@@ -1300,18 +1300,20 @@ syscall_allowed:
 
        getcon  KCR0, r2
        ld.l    r2, TI_FLAGS, r4
-       movi    (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | _TIF_SYSCALL_AUDIT), r6
+       movi    _TIF_WORK_SYSCALL_MASK, r6
        and     r6, r4, r6
        beq/l   r6, ZERO, tr0
 
        /* Trace it by calling syscall_trace before and after */
-       movi    syscall_trace, r4
+       movi    do_syscall_trace_enter, r4
        or      SP, ZERO, r2
-       or      ZERO, ZERO, r3
        ptabs   r4, tr0
        blink   tr0, LINK
 
-       /* Reload syscall number as r5 is trashed by syscall_trace */
+       /* Save the retval */
+       st.q    SP, FRAME_R(2), r2
+
+       /* Reload syscall number as r5 is trashed by do_syscall_trace_enter */
        ld.q    SP, FRAME_S(FSYSCALL_ID), r5
        andi    r5, 0x1ff, r5
 
@@ -1343,9 +1345,8 @@ syscall_ret_trace:
        /* We get back here only if under trace */
        st.q    SP, FRAME_R(9), r2      /* Save return value */
 
-       movi    syscall_trace, LINK
+       movi    do_syscall_trace_leave, LINK
        or      SP, ZERO, r2
-       movi    1, r3
        ptabs   LINK, tr0
        blink   tr0, LINK
 
index 5e0dd19..0bc17de 100644 (file)
@@ -202,7 +202,7 @@ work_resched:
 syscall_exit_work:
        ! r0: current_thread_info->flags
        ! r8: current_thread_info
-       tst     #_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | _TIF_SYSCALL_AUDIT, r0
+       tst     #_TIF_WORK_SYSCALL_MASK, r0
        bt/s    work_pending
         tst    #_TIF_NEED_RESCHED, r0
 #ifdef CONFIG_TRACE_IRQFLAGS
@@ -211,10 +211,8 @@ syscall_exit_work:
         nop
 #endif
        sti
-       ! XXX setup arguments...
        mov     r15, r4
-       mov     #1, r5
-       mov.l   4f, r0                  ! do_syscall_trace
+       mov.l   8f, r0                  ! do_syscall_trace_leave
        jsr     @r0
         nop
        bra     resume_userspace
@@ -223,12 +221,11 @@ syscall_exit_work:
        .align  2
 syscall_trace_entry:
        !                       Yes it is traced.
-       ! XXX setup arguments...
        mov     r15, r4
-       mov     #0, r5
-       mov.l   4f, r11         ! Call do_syscall_trace which notifies
+       mov.l   7f, r11         ! Call do_syscall_trace_enter which notifies
        jsr     @r11            ! superior (will chomp R[0-7])
         nop
+       mov.l   r0, @(OFF_R0,r15)       ! Save return value
        !                       Reload R0-R4 from kernel stack, where the
        !                       parent may have modified them using
        !                       ptrace(POKEUSR).  (Note that R0-R2 are
@@ -351,7 +348,7 @@ ENTRY(system_call)
        !
        get_current_thread_info r8, r10
        mov.l   @(TI_FLAGS,r8), r8
-       mov     #(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT), r10
+       mov     #_TIF_WORK_SYSCALL_MASK, r10
        tst     r10, r8
        bf      syscall_trace_entry
        !
@@ -389,8 +386,9 @@ syscall_exit:
 #endif
 2:     .long   NR_syscalls
 3:     .long   sys_call_table
-4:     .long   do_syscall_trace
 #ifdef CONFIG_TRACE_IRQFLAGS
 5:     .long   trace_hardirqs_on
 6:     .long   trace_hardirqs_off
 #endif
+7:     .long   do_syscall_trace_enter
+8:     .long   do_syscall_trace_leave
index ec1eadc..4703dff 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/kexec.h>
 #include <linux/delay.h>
 #include <linux/reboot.h>
+#include <linux/numa.h>
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/mmu_context.h>
@@ -104,3 +105,10 @@ void machine_kexec(struct kimage *image)
        (*rnk)(page_list, reboot_code_buffer, image->start, vbr_reg);
 }
 
+void arch_crash_save_vmcoreinfo(void)
+{
+#ifdef CONFIG_NUMA
+       VMCOREINFO_SYMBOL(node_data);
+       VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
+#endif
+}
index 5482e65..c430810 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/moduleloader.h>
 #include <linux/elf.h>
 #include <linux/vmalloc.h>
+#include <linux/bug.h>
 #include <linux/fs.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
@@ -36,7 +37,8 @@ void *module_alloc(unsigned long size)
 {
        if (size == 0)
                return NULL;
-       return vmalloc(size);
+
+       return vmalloc_exec(size);
 }
 
 
@@ -145,9 +147,10 @@ int module_finalize(const Elf_Ehdr *hdr,
                    const Elf_Shdr *sechdrs,
                    struct module *me)
 {
-       return 0;
+       return module_bug_finalize(hdr, sechdrs, me);
 }
 
 void module_arch_cleanup(struct module *mod)
 {
+       module_bug_cleanup(mod);
 }
index 2bc72de..035cb30 100644 (file)
@@ -20,6 +20,8 @@
 #include <linux/signal.h>
 #include <linux/io.h>
 #include <linux/audit.h>
+#include <linux/seccomp.h>
+#include <linux/tracehook.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 #include <asm/system.h>
@@ -57,7 +59,23 @@ static inline int put_stack_long(struct task_struct *task, int offset,
        return 0;
 }
 
-static void ptrace_disable_singlestep(struct task_struct *child)
+void user_enable_single_step(struct task_struct *child)
+{
+       struct pt_regs *regs = task_pt_regs(child);
+       long pc;
+
+       pc = get_stack_long(child, (long)&regs->pc);
+
+       /* Next scheduling will set up UBC */
+       if (child->thread.ubc_pc == 0)
+               ubc_usercnt += 1;
+
+       child->thread.ubc_pc = pc;
+
+       set_tsk_thread_flag(child, TIF_SINGLESTEP);
+}
+
+void user_disable_single_step(struct task_struct *child)
 {
        clear_tsk_thread_flag(child, TIF_SINGLESTEP);
 
@@ -81,7 +99,7 @@ static void ptrace_disable_singlestep(struct task_struct *child)
  */
 void ptrace_disable(struct task_struct *child)
 {
-       ptrace_disable_singlestep(child);
+       user_disable_single_step(child);
 }
 
 long arch_ptrace(struct task_struct *child, long request, long addr, long data)
@@ -90,12 +108,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
        int ret;
 
        switch (request) {
-       /* when I and D space are separate, these will need to be fixed. */
-       case PTRACE_PEEKTEXT: /* read word at location addr. */
-       case PTRACE_PEEKDATA:
-               ret = generic_ptrace_peekdata(child, addr, data);
-               break;
-
        /* read the word at location addr in the USER area. */
        case PTRACE_PEEKUSR: {
                unsigned long tmp;
@@ -125,12 +137,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                break;
        }
 
-       /* when I and D space are separate, this will have to be fixed. */
-       case PTRACE_POKETEXT: /* write the word at location addr. */
-       case PTRACE_POKEDATA:
-               ret = generic_ptrace_pokedata(child, addr, data);
-               break;
-
        case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
                ret = -EIO;
                if ((addr & 3) || addr < 0 ||
@@ -151,67 +157,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                }
                break;
 
-       case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
-       case PTRACE_CONT: { /* restart after signal. */
-               ret = -EIO;
-               if (!valid_signal(data))
-                       break;
-               if (request == PTRACE_SYSCALL)
-                       set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-               else
-                       clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-
-               ptrace_disable_singlestep(child);
-
-               child->exit_code = data;
-               wake_up_process(child);
-               ret = 0;
-               break;
-       }
-
-/*
- * make the child exit.  Best I can do is send it a sigkill.
- * perhaps it should be put in the status that it wants to
- * exit.
- */
-       case PTRACE_KILL: {
-               ret = 0;
-               if (child->exit_state == EXIT_ZOMBIE)   /* already dead */
-                       break;
-               ptrace_disable_singlestep(child);
-               child->exit_code = SIGKILL;
-               wake_up_process(child);
-               break;
-       }
-
-       case PTRACE_SINGLESTEP: {  /* set the trap flag. */
-               long pc;
-               struct pt_regs *regs = NULL;
-
-               ret = -EIO;
-               if (!valid_signal(data))
-                       break;
-               clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-               if ((child->ptrace & PT_DTRACE) == 0) {
-                       /* Spurious delayed TF traps may occur */
-                       child->ptrace |= PT_DTRACE;
-               }
-
-               pc = get_stack_long(child, (long)&regs->pc);
-
-               /* Next scheduling will set up UBC */
-               if (child->thread.ubc_pc == 0)
-                       ubc_usercnt += 1;
-               child->thread.ubc_pc = pc;
-
-               set_tsk_thread_flag(child, TIF_SINGLESTEP);
-               child->exit_code = data;
-               /* give it a chance to run. */
-               wake_up_process(child);
-               ret = 0;
-               break;
-       }
-
 #ifdef CONFIG_SH_DSP
        case PTRACE_GETDSPREGS: {
                unsigned long dp;
@@ -272,39 +217,49 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
        return ret;
 }
 
-asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)
+static inline int audit_arch(void)
 {
-       struct task_struct *tsk = current;
+       int arch = EM_SH;
 
-       if (unlikely(current->audit_context) && entryexit)
-               audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]),
-                                  regs->regs[0]);
+#ifdef CONFIG_CPU_LITTLE_ENDIAN
+       arch |= __AUDIT_ARCH_LE;
+#endif
 
-       if (!test_thread_flag(TIF_SYSCALL_TRACE) &&
-           !test_thread_flag(TIF_SINGLESTEP))
-               goto out;
-       if (!(tsk->ptrace & PT_PTRACED))
-               goto out;
+       return arch;
+}
 
-       /* the 0x80 provides a way for the tracing parent to distinguish
-          between a syscall stop and SIGTRAP delivery */
-       ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) &&
-                                !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0));
+asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
+{
+       long ret = 0;
 
-       /*
-        * this isn't the same as continuing with a signal, but it will do
-        * for normal use.  strace only continues with a signal if the
-        * stopping signal is not SIGTRAP.  -brl
-        */
-       if (tsk->exit_code) {
-               send_sig(tsk->exit_code, tsk, 1);
-               tsk->exit_code = 0;
-       }
+       secure_computing(regs->regs[0]);
+
+       if (test_thread_flag(TIF_SYSCALL_TRACE) &&
+           tracehook_report_syscall_entry(regs))
+               /*
+                * Tracing decided this syscall should not happen.
+                * We'll return a bogus call number to get an ENOSYS
+                * error, but leave the original number in regs->regs[0].
+                */
+               ret = -1L;
 
-out:
-       if (unlikely(current->audit_context) && !entryexit)
-               audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[3],
+       if (unlikely(current->audit_context))
+               audit_syscall_entry(audit_arch(), regs->regs[3],
                                    regs->regs[4], regs->regs[5],
                                    regs->regs[6], regs->regs[7]);
 
+       return ret ?: regs->regs[0];
+}
+
+asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
+{
+       int step;
+
+       if (unlikely(current->audit_context))
+               audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]),
+                                  regs->regs[0]);
+
+       step = test_thread_flag(TIF_SINGLESTEP);
+       if (step || test_thread_flag(TIF_SYSCALL_TRACE))
+               tracehook_report_syscall_exit(regs, step);
 }
index d453c47..5922edd 100644 (file)
@@ -27,6 +27,8 @@
 #include <linux/signal.h>
 #include <linux/syscalls.h>
 #include <linux/audit.h>
+#include <linux/seccomp.h>
+#include <linux/tracehook.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
@@ -120,18 +122,23 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data)
        return 0;
 }
 
+void user_enable_single_step(struct task_struct *child)
+{
+       struct pt_regs *regs = child->thread.uregs;
+
+       regs->sr |= SR_SSTEP;   /* auto-resetting upon exception */
+}
+
+void user_disable_single_step(struct task_struct *child)
+{
+       regs->sr &= ~SR_SSTEP;
+}
 
 long arch_ptrace(struct task_struct *child, long request, long addr, long data)
 {
        int ret;
 
        switch (request) {
-       /* when I and D space are separate, these will need to be fixed. */
-       case PTRACE_PEEKTEXT: /* read word at location addr. */
-       case PTRACE_PEEKDATA:
-               ret = generic_ptrace_peekdata(child, addr, data);
-               break;
-
        /* read the word at location addr in the USER area. */
        case PTRACE_PEEKUSR: {
                unsigned long tmp;
@@ -154,12 +161,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                break;
        }
 
-       /* when I and D space are separate, this will have to be fixed. */
-       case PTRACE_POKETEXT: /* write the word at location addr. */
-       case PTRACE_POKEDATA:
-               ret = generic_ptrace_pokedata(child, addr, data);
-               break;
-
        case PTRACE_POKEUSR:
                 /* write the word at location addr in the USER area. We must
                    disallow any changes to certain SR bits or u_fpvalid, since
@@ -191,58 +192,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                }
                break;
 
-       case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
-       case PTRACE_CONT: { /* restart after signal. */
-               ret = -EIO;
-               if (!valid_signal(data))
-                       break;
-               if (request == PTRACE_SYSCALL)
-                       set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-               else
-                       clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-               child->exit_code = data;
-               wake_up_process(child);
-               ret = 0;
-               break;
-       }
-
-/*
- * make the child exit.  Best I can do is send it a sigkill.
- * perhaps it should be put in the status that it wants to
- * exit.
- */
-       case PTRACE_KILL: {
-               ret = 0;
-               if (child->exit_state == EXIT_ZOMBIE)   /* already dead */
-                       break;
-               child->exit_code = SIGKILL;
-               wake_up_process(child);
-               break;
-       }
-
-       case PTRACE_SINGLESTEP: {  /* set the trap flag. */
-               struct pt_regs *regs;
-
-               ret = -EIO;
-               if (!valid_signal(data))
-                       break;
-               clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-               if ((child->ptrace & PT_DTRACE) == 0) {
-                       /* Spurious delayed TF traps may occur */
-                       child->ptrace |= PT_DTRACE;
-               }
-
-               regs = child->thread.uregs;
-
-               regs->sr |= SR_SSTEP;   /* auto-resetting upon exception */
-
-               child->exit_code = data;
-               /* give it a chance to run. */
-               wake_up_process(child);
-               ret = 0;
-               break;
-       }
-
        default:
                ret = ptrace_request(child, request, addr, data);
                break;
@@ -273,38 +222,51 @@ asmlinkage int sh64_ptrace(long request, long pid, long addr, long data)
        return sys_ptrace(request, pid, addr, data);
 }
 
-asmlinkage void syscall_trace(struct pt_regs *regs, int entryexit)
+static inline int audit_arch(void)
 {
-       struct task_struct *tsk = current;
+       int arch = EM_SH;
 
-       if (unlikely(current->audit_context) && entryexit)
-               audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]),
-                                  regs->regs[9]);
+#ifdef CONFIG_64BIT
+       arch |= __AUDIT_ARCH_64BIT;
+#endif
+#ifdef CONFIG_CPU_LITTLE_ENDIAN
+       arch |= __AUDIT_ARCH_LE;
+#endif
 
-       if (!test_thread_flag(TIF_SYSCALL_TRACE) &&
-           !test_thread_flag(TIF_SINGLESTEP))
-               goto out;
-       if (!(tsk->ptrace & PT_PTRACED))
-               goto out;
-
-       ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) &&
-                               !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0));
-
-       /*
-        * this isn't the same as continuing with a signal, but it will do
-        * for normal use.  strace only continues with a signal if the
-        * stopping signal is not SIGTRAP.  -brl
-        */
-       if (tsk->exit_code) {
-               send_sig(tsk->exit_code, tsk, 1);
-               tsk->exit_code = 0;
-       }
+       return arch;
+}
 
-out:
-       if (unlikely(current->audit_context) && !entryexit)
-               audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[1],
+asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs)
+{
+       long long ret = 0;
+
+       secure_computing(regs->regs[9]);
+
+       if (test_thread_flag(TIF_SYSCALL_TRACE) &&
+           tracehook_report_syscall_entry(regs))
+               /*
+                * Tracing decided this syscall should not happen.
+                * We'll return a bogus call number to get an ENOSYS
+                * error, but leave the original number in regs->regs[0].
+                */
+               ret = -1LL;
+
+       if (unlikely(current->audit_context))
+               audit_syscall_entry(audit_arch(), regs->regs[1],
                                    regs->regs[2], regs->regs[3],
                                    regs->regs[4], regs->regs[5]);
+
+       return ret ?: regs->regs[9];
+}
+
+asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
+{
+       if (unlikely(current->audit_context))
+               audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]),
+                                  regs->regs[9]);
+
+       if (test_thread_flag(TIF_SYSCALL_TRACE))
+               tracehook_report_syscall_exit(regs, 0);
 }
 
 /* Called with interrupts disabled */
@@ -338,5 +300,5 @@ asmlinkage void do_software_break_point(unsigned long long vec,
  */
 void ptrace_disable(struct task_struct *child)
 {
-        /* nothing to do.. */
+       user_disable_single_step(child);
 }
index 6339d0c..a352076 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/smp.h>
 #include <linux/err.h>
 #include <linux/debugfs.h>
+#include <linux/crash_dump.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/page.h>
@@ -286,6 +287,25 @@ static void __init setup_memory(void)
 extern void __init setup_memory(void);
 #endif
 
+/*
+ * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by
+ * is_kdump_kernel() to determine if we are booting after a panic. Hence
+ * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.
+ */
+#ifdef CONFIG_CRASH_DUMP
+/* elfcorehdr= specifies the location of elf core header
+ * stored by the crashed kernel.
+ */
+static int __init parse_elfcorehdr(char *arg)
+{
+       if (!arg)
+               return -EINVAL;
+       elfcorehdr_addr = memparse(arg, &arg);
+       return 0;
+}
+early_param("elfcorehdr", parse_elfcorehdr);
+#endif
+
 void __init setup_arch(char **cmdline_p)
 {
        enable_mmu();
index 4bbbde8..51689d2 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/binfmts.h>
 #include <linux/freezer.h>
 #include <linux/io.h>
+#include <linux/tracehook.h>
 #include <asm/system.h>
 #include <asm/ucontext.h>
 #include <asm/uaccess.h>
@@ -507,14 +508,13 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
                switch (regs->regs[0]) {
                        case -ERESTART_RESTARTBLOCK:
                        case -ERESTARTNOHAND:
+                       no_system_call_restart:
                                regs->regs[0] = -EINTR;
                                break;
 
                        case -ERESTARTSYS:
-                               if (!(ka->sa.sa_flags & SA_RESTART)) {
-                                       regs->regs[0] = -EINTR;
-                                       break;
-                               }
+                               if (!(ka->sa.sa_flags & SA_RESTART))
+                                       goto no_system_call_restart;
                        /* fallthrough */
                        case -ERESTARTNOINTR:
                                regs->regs[0] = save_r0;
@@ -589,12 +589,15 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
                         * clear the TIF_RESTORE_SIGMASK flag */
                        if (test_thread_flag(TIF_RESTORE_SIGMASK))
                                clear_thread_flag(TIF_RESTORE_SIGMASK);
+
+                       tracehook_signal_handler(signr, &info, &ka, regs,
+                                       test_thread_flag(TIF_SINGLESTEP));
                }
 
                return;
        }
 
- no_signal:
+no_signal:
        /* Did we come from a system call? */
        if (regs->tra >= 0) {
                /* Restart the system call - no handlers present */
@@ -618,9 +621,14 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
 }
 
 asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0,
-                                __u32 thread_info_flags)
+                                unsigned long thread_info_flags)
 {
        /* deal with pending signal delivery */
-       if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK))
+       if (thread_info_flags & _TIF_SIGPENDING)
                do_signal(regs, save_r0);
+
+       if (thread_info_flags & _TIF_NOTIFY_RESUME) {
+               clear_thread_flag(TIF_NOTIFY_RESUME);
+               tracehook_notify_resume(regs);
+       }
 }
index 552eb81..1d62dfe 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/ptrace.h>
 #include <linux/unistd.h>
 #include <linux/stddef.h>
+#include <linux/tracehook.h>
 #include <asm/ucontext.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
-asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset);
+/*
+ * Note that 'init' is a special process: it doesn't get signals it doesn't
+ * want to handle. Thus you cannot kill init even with a SIGKILL even by
+ * mistake.
+ *
+ * Note that we go through the signals twice: once to check the signals that
+ * the kernel can handle, and then we build all the user-level signal handling
+ * stack-frames in one go after that.
+ */
+static int do_signal(struct pt_regs *regs, sigset_t *oldset)
+{
+       siginfo_t info;
+       int signr;
+       struct k_sigaction ka;
+
+       /*
+        * We want the common case to go fast, which
+        * is why we may in certain cases get here from
+        * kernel mode. Just return without doing anything
+        * if so.
+        */
+       if (!user_mode(regs))
+               return 1;
+
+       if (try_to_freeze())
+               goto no_signal;
+
+       if (test_thread_flag(TIF_RESTORE_SIGMASK))
+               oldset = &current->saved_sigmask;
+       else if (!oldset)
+               oldset = &current->blocked;
+
+       signr = get_signal_to_deliver(&info, &ka, regs, 0);
+
+       if (signr > 0) {
+               /* Whee!  Actually deliver the signal.  */
+               handle_signal(signr, &info, &ka, oldset, regs);
+
+               /*
+                * If a signal was successfully delivered, the saved sigmask
+                * is in its frame, and we can clear the TIF_RESTORE_SIGMASK
+                * flag.
+                */
+               if (test_thread_flag(TIF_RESTORE_SIGMASK))
+                       clear_thread_flag(TIF_RESTORE_SIGMASK);
+
+               tracehook_signal_handler(signr, &info, &ka, regs, 0);
+               return 1;
+       }
+
+no_signal:
+       /* Did we come from a system call? */
+       if (regs->syscall_nr >= 0) {
+               /* Restart the system call - no handlers present */
+               switch (regs->regs[REG_RET]) {
+               case -ERESTARTNOHAND:
+               case -ERESTARTSYS:
+               case -ERESTARTNOINTR:
+                       /* Decode Syscall # */
+                       regs->regs[REG_RET] = regs->syscall_nr;
+                       regs->pc -= 4;
+                       break;
+
+               case -ERESTART_RESTARTBLOCK:
+                       regs->regs[REG_RET] = __NR_restart_syscall;
+                       regs->pc -= 4;
+                       break;
+               }
+       }
+
+       /* No signal to deliver -- put the saved sigmask back */
+       if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
+               clear_thread_flag(TIF_RESTORE_SIGMASK);
+               sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
+       }
+
+       return 0;
+}
 
 /*
  * Atomically swap in the new signal mask, and wait for a signal.
@@ -643,14 +721,13 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
                switch (regs->regs[REG_RET]) {
                        case -ERESTART_RESTARTBLOCK:
                        case -ERESTARTNOHAND:
+                       no_system_call_restart:
                                regs->regs[REG_RET] = -EINTR;
                                break;
 
                        case -ERESTARTSYS:
-                               if (!(ka->sa.sa_flags & SA_RESTART)) {
-                                       regs->regs[REG_RET] = -EINTR;
-                                       break;
-                               }
+                               if (!(ka->sa.sa_flags & SA_RESTART))
+                                       goto no_system_call_restart;
                        /* fallthrough */
                        case -ERESTARTNOINTR:
                                /* Decode syscall # */
@@ -673,80 +750,13 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
        spin_unlock_irq(&current->sighand->siglock);
 }
 
-/*
- * Note that 'init' is a special process: it doesn't get signals it doesn't
- * want to handle. Thus you cannot kill init even with a SIGKILL even by
- * mistake.
- *
- * Note that we go through the signals twice: once to check the signals that
- * the kernel can handle, and then we build all the user-level signal handling
- * stack-frames in one go after that.
- */
-int do_signal(struct pt_regs *regs, sigset_t *oldset)
+asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
 {
-       siginfo_t info;
-       int signr;
-       struct k_sigaction ka;
-
-       /*
-        * We want the common case to go fast, which
-        * is why we may in certain cases get here from
-        * kernel mode. Just return without doing anything
-        * if so.
-        */
-       if (!user_mode(regs))
-               return 1;
-
-       if (try_to_freeze())
-               goto no_signal;
-
-       if (test_thread_flag(TIF_RESTORE_SIGMASK))
-               oldset = &current->saved_sigmask;
-       else if (!oldset)
-               oldset = &current->blocked;
-
-       signr = get_signal_to_deliver(&info, &ka, regs, 0);
-
-       if (signr > 0) {
-               /* Whee!  Actually deliver the signal.  */
-               handle_signal(signr, &info, &ka, oldset, regs);
+       if (thread_info_flags & _TIF_SIGPENDING)
+               do_signal(regs, 0);
 
-               /*
-                * If a signal was successfully delivered, the saved sigmask
-                * is in its frame, and we can clear the TIF_RESTORE_SIGMASK
-                * flag.
-                */
-               if (test_thread_flag(TIF_RESTORE_SIGMASK))
-                       clear_thread_flag(TIF_RESTORE_SIGMASK);
-
-               return 1;
+       if (thread_info_flags & _TIF_NOTIFY_RESUME) {
+               clear_thread_flag(TIF_NOTIFY_RESUME);
+               tracehook_notify_resume(regs);
        }
-
-no_signal:
-       /* Did we come from a system call? */
-       if (regs->syscall_nr >= 0) {
-               /* Restart the system call - no handlers present */
-               switch (regs->regs[REG_RET]) {
-               case -ERESTARTNOHAND:
-               case -ERESTARTSYS:
-               case -ERESTARTNOINTR:
-                       /* Decode Syscall # */
-                       regs->regs[REG_RET] = regs->syscall_nr;
-                       regs->pc -= 4;
-                       break;
-
-               case -ERESTART_RESTARTBLOCK:
-                       regs->regs[REG_RET] = __NR_restart_syscall;
-                       regs->pc -= 4;
-                       break;
-               }
-       }
-
-       /* No signal to deliver -- put the saved sigmask back */
-       if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
-               clear_thread_flag(TIF_RESTORE_SIGMASK);
-               sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
-       }
-
-       return 0;
 }
index 56d0a7d..9c131ca 100644 (file)
@@ -237,7 +237,6 @@ choice
 
 config CACHE_WRITEBACK
        bool "Write-back"
-       depends on CPU_SH2A || CPU_SH3 || CPU_SH4 || CPU_SH5
 
 config CACHE_WRITETHROUGH
        bool "Write-through"
index e295db6..70e0906 100644 (file)
@@ -5,12 +5,15 @@
 obj-y                  := init.o extable_32.o consistent.o
 
 ifndef CONFIG_CACHE_OFF
-obj-$(CONFIG_CPU_SH2)          += cache-sh2.o
-obj-$(CONFIG_CPU_SH3)          += cache-sh3.o
-obj-$(CONFIG_CPU_SH4)          += cache-sh4.o
-obj-$(CONFIG_SH7705_CACHE_32KB)        += cache-sh7705.o
+cache-$(CONFIG_CPU_SH2)                := cache-sh2.o
+cache-$(CONFIG_CPU_SH2A)       := cache-sh2a.o
+cache-$(CONFIG_CPU_SH3)                := cache-sh3.o
+cache-$(CONFIG_CPU_SH4)                := cache-sh4.o
+cache-$(CONFIG_SH7705_CACHE_32KB)      += cache-sh7705.o
 endif
 
+obj-y                  += $(cache-y)
+
 mmu-y                  := tlb-nommu.o pg-nommu.o
 mmu-$(CONFIG_MMU)      := fault_32.o tlbflush_32.o ioremap_32.o
 
index 6614033..c4e80d2 100644 (file)
@@ -2,6 +2,7 @@
  * arch/sh/mm/cache-sh2.c
  *
  * Copyright (C) 2002 Paul Mundt
+ * Copyright (C) 2008 Yoshinori Sato
  *
  * Released under the terms of the GNU GPL v2.0.
  */
@@ -24,8 +25,15 @@ void __flush_wback_region(void *start, int size)
        end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
                & ~(L1_CACHE_BYTES-1);
        for (v = begin; v < end; v+=L1_CACHE_BYTES) {
-               /* FIXME cache purge */
-               ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008);
+               unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0);
+               int way;
+               for (way = 0; way < 4; way++) {
+                       unsigned long data =  ctrl_inl(addr | (way << 12));
+                       if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) {
+                               data &= ~SH_CACHE_UPDATED;
+                               ctrl_outl(data, addr | (way << 12));
+                       }
+               }
        }
 }
 
@@ -37,21 +45,40 @@ void __flush_purge_region(void *start, int size)
        begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
        end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
                & ~(L1_CACHE_BYTES-1);
-       for (v = begin; v < end; v+=L1_CACHE_BYTES) {
-               ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008);
-       }
+
+       for (v = begin; v < end; v+=L1_CACHE_BYTES)
+               ctrl_outl((v & CACHE_PHYSADDR_MASK),
+                         CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008);
 }
 
 void __flush_invalidate_region(void *start, int size)
 {
+#ifdef CONFIG_CACHE_WRITEBACK
+       /*
+        * SH-2 does not support individual line invalidation, only a
+        * global invalidate.
+        */
+       unsigned long ccr;
+       unsigned long flags;
+       local_irq_save(flags);
+       jump_to_uncached();
+
+       ccr = ctrl_inl(CCR);
+       ccr |= CCR_CACHE_INVALIDATE;
+       ctrl_outl(ccr, CCR);
+
+       back_to_cached();
+       local_irq_restore(flags);
+#else
        unsigned long v;
        unsigned long begin, end;
 
        begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
        end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
                & ~(L1_CACHE_BYTES-1);
-       for (v = begin; v < end; v+=L1_CACHE_BYTES) {
-               ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008);
-       }
-}
 
+       for (v = begin; v < end; v+=L1_CACHE_BYTES)
+               ctrl_outl((v & CACHE_PHYSADDR_MASK),
+                         CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008);
+#endif
+}
diff --git a/arch/sh/mm/cache-sh2a.c b/arch/sh/mm/cache-sh2a.c
new file mode 100644 (file)
index 0000000..62c0c5f
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * arch/sh/mm/cache-sh2a.c
+ *
+ * Copyright (C) 2008 Yoshinori Sato
+ *
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <linux/init.h>
+#include <linux/mm.h>
+
+#include <asm/cache.h>
+#include <asm/addrspace.h>
+#include <asm/processor.h>
+#include <asm/cacheflush.h>
+#include <asm/io.h>
+
+void __flush_wback_region(void *start, int size)
+{
+       unsigned long v;
+       unsigned long begin, end;
+       unsigned long flags;
+
+       begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
+       end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
+               & ~(L1_CACHE_BYTES-1);
+
+       local_irq_save(flags);
+       jump_to_uncached();
+
+       for (v = begin; v < end; v+=L1_CACHE_BYTES) {
+               unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0);
+               int way;
+               for (way = 0; way < 4; way++) {
+                       unsigned long data =  ctrl_inl(addr | (way << 11));
+                       if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) {
+                               data &= ~SH_CACHE_UPDATED;
+                               ctrl_outl(data, addr | (way << 11));
+                       }
+               }
+       }
+
+       back_to_cached();
+       local_irq_restore(flags);
+}
+
+void __flush_purge_region(void *start, int size)
+{
+       unsigned long v;
+       unsigned long begin, end;
+       unsigned long flags;
+
+       begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
+       end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
+               & ~(L1_CACHE_BYTES-1);
+
+       local_irq_save(flags);
+       jump_to_uncached();
+
+       for (v = begin; v < end; v+=L1_CACHE_BYTES) {
+               ctrl_outl((v & CACHE_PHYSADDR_MASK),
+                         CACHE_OC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008);
+       }
+       back_to_cached();
+       local_irq_restore(flags);
+}
+
+void __flush_invalidate_region(void *start, int size)
+{
+       unsigned long v;
+       unsigned long begin, end;
+       unsigned long flags;
+
+       begin = (unsigned long)start & ~(L1_CACHE_BYTES-1);
+       end = ((unsigned long)start + size + L1_CACHE_BYTES-1)
+               & ~(L1_CACHE_BYTES-1);
+       local_irq_save(flags);
+       jump_to_uncached();
+
+#ifdef CONFIG_CACHE_WRITEBACK
+       ctrl_outl(ctrl_inl(CCR) | CCR_OCACHE_INVALIDATE, CCR);
+       /* I-cache invalidate */
+       for (v = begin; v < end; v+=L1_CACHE_BYTES) {
+               ctrl_outl((v & CACHE_PHYSADDR_MASK),
+                         CACHE_IC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008);
+       }
+#else
+       for (v = begin; v < end; v+=L1_CACHE_BYTES) {
+               ctrl_outl((v & CACHE_PHYSADDR_MASK),
+                         CACHE_IC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008);
+               ctrl_outl((v & CACHE_PHYSADDR_MASK),
+                         CACHE_OC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008);
+       }
+#endif
+       back_to_cached();
+       local_irq_restore(flags);
+}
+
+/* WBack O-Cache and flush I-Cache */
+void flush_icache_range(unsigned long start, unsigned long end)
+{
+       unsigned long v;
+       unsigned long flags;
+
+       start = start & ~(L1_CACHE_BYTES-1);
+       end = (end + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1);
+
+       local_irq_save(flags);
+       jump_to_uncached();
+
+       for (v = start; v < end; v+=L1_CACHE_BYTES) {
+               unsigned long addr = (v & 0x000007f0);
+               int way;
+               /* O-Cache writeback */
+               for (way = 0; way < 4; way++) {
+                       unsigned long data =  ctrl_inl(CACHE_OC_ADDRESS_ARRAY | addr | (way << 11));
+                       if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) {
+                               data &= ~SH_CACHE_UPDATED;
+                               ctrl_outl(data, CACHE_OC_ADDRESS_ARRAY | addr | (way << 11));
+                       }
+               }
+               /* I-Cache invalidate */
+               ctrl_outl(addr,
+                         CACHE_IC_ADDRESS_ARRAY | addr | 0x00000008);
+       }
+
+       back_to_cached();
+       local_irq_restore(flags);
+}
index f34274a..dae1312 100644 (file)
@@ -15,9 +15,7 @@
 #include <asm/mmu_context.h>
 
 /**
- * sh64_tlb_init
- *
- * Perform initial setup for the DTLB and ITLB.
+ * sh64_tlb_init - Perform initial setup for the DTLB and ITLB.
  */
 int __init sh64_tlb_init(void)
 {
@@ -46,9 +44,7 @@ int __init sh64_tlb_init(void)
 }
 
 /**
- * sh64_next_free_dtlb_entry
- *
- * Find the next available DTLB entry
+ * sh64_next_free_dtlb_entry - Find the next available DTLB entry
  */
 unsigned long long sh64_next_free_dtlb_entry(void)
 {
@@ -56,9 +52,7 @@ unsigned long long sh64_next_free_dtlb_entry(void)
 }
 
 /**
- * sh64_get_wired_dtlb_entry
- *
- * Allocate a wired (locked-in) entry in the DTLB
+ * sh64_get_wired_dtlb_entry - Allocate a wired (locked-in) entry in the DTLB
  */
 unsigned long long sh64_get_wired_dtlb_entry(void)
 {
@@ -71,12 +65,10 @@ unsigned long long sh64_get_wired_dtlb_entry(void)
 }
 
 /**
- * sh64_put_wired_dtlb_entry
+ * sh64_put_wired_dtlb_entry - Free a wired (locked-in) entry in the DTLB.
  *
  * @entry:     Address of TLB slot.
  *
- * Free a wired (locked-in) entry in the DTLB.
- *
  * Works like a stack, last one to allocate must be first one to free.
  */
 int sh64_put_wired_dtlb_entry(unsigned long long entry)
@@ -115,7 +107,7 @@ int sh64_put_wired_dtlb_entry(unsigned long long entry)
 }
 
 /**
- * sh64_setup_tlb_slot
+ * sh64_setup_tlb_slot - Load up a translation in a wired slot.
  *
  * @config_addr:       Address of TLB slot.
  * @eaddr:             Virtual address.
@@ -154,7 +146,7 @@ inline void sh64_setup_tlb_slot(unsigned long long config_addr,
 }
 
 /**
- * sh64_teardown_tlb_slot
+ * sh64_teardown_tlb_slot - Teardown a translation.
  *
  * @config_addr:       Address of TLB slot.
  *
index b5d202b..567516b 100644 (file)
@@ -10,7 +10,7 @@
 # Shamelessly cloned from ARM.
 #
 
-arch/sh/include/asm/machtypes.h: $(src)/gen-mach-types $(src)/mach-types
+include/asm-sh/machtypes.h: $(src)/gen-mach-types $(src)/mach-types
        @echo '  Generating $@'
-       $(Q)if [ ! -d arch/sh/include/asm ]; then mkdir -p arch/sh/include/asm; fi
+       $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
        $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
index c5b9bcf..12a5182 100644 (file)
@@ -518,7 +518,7 @@ int scsi_cmd_ioctl(struct file *file, struct request_queue *q,
                        hdr.sbp = cgc.sense;
                        if (hdr.sbp)
                                hdr.mx_sb_len = sizeof(struct request_sense);
-                       hdr.timeout = cgc.timeout;
+                       hdr.timeout = jiffies_to_msecs(cgc.timeout);
                        hdr.cmdp = ((struct cdrom_generic_command __user*) arg)->cmd;
                        hdr.cmd_len = sizeof(cgc.cmd);
 
index 67fbd7a..34d15d5 100644 (file)
@@ -37,7 +37,6 @@
 #include <linux/rtc.h>
 #include <linux/proc_fs.h>
 #include <linux/efi.h>
-#include <linux/smp_lock.h>
 #include <linux/uaccess.h>
 
 #include <asm/system.h>
index d9ce109..9790201 100644 (file)
@@ -6,7 +6,7 @@
  *     Ryan S. Arnold <rsa@us.ibm.com>
  *
  * hvc_console header information:
- *      moved here from include/asm-powerpc/hvconsole.h
+ *      moved here from arch/powerpc/include/asm/hvconsole.h
  *      and drivers/char/hvc_console.c
  *
  * This program is free software; you can redistribute it and/or modify
index 786d518..473d9b1 100644 (file)
  * the hvcs_final_close() function in order to get it out of the spinlock.
  * Rearranged hvcs_close().  Cleaned up some printks and did some housekeeping
  * on the changelog.  Removed local CLC_LENGTH and used HVCS_CLC_LENGTH from
- * include/asm-powerpc/hvcserver.h 
+ * arch/powerepc/include/asm/hvcserver.h
  *
  * 1.3.2 -> 1.3.3 Replaced yield() in hvcs_close() with tty_wait_until_sent() to
  * prevent possible lockup with realtime scheduling as similarily pointed out by
index 82a51f3..1bc00c9 100644 (file)
@@ -916,7 +916,6 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
                ws.ws_col = vc->vc_cols;
                ws.ws_ypixel = vc->vc_scan_lines;
 
-               mutex_lock(&vc->vc_tty->termios_mutex);
                spin_lock_irq(&vc->vc_tty->ctrl_lock);
                if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col))
                        pgrp = get_pid(vc->vc_tty->pgrp);
@@ -926,7 +925,6 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
                        put_pid(pgrp);
                }
                *cws = ws;
-               mutex_unlock(&vc->vc_tty->termios_mutex);
        }
 
        if (CON_IS_VISIBLE(vc))
index dd9bc68..898c8b5 100644 (file)
@@ -42,7 +42,7 @@
  */
 
 
-#include <asm-powerpc/system.h>
+#include <asm/system.h>
 #include "ehca_classes.h"
 #include "ehca_tools.h"
 #include "ehca_qes.h"
index 7797ef6..22f17a5 100644 (file)
@@ -2,7 +2,7 @@
  * SEGA Dreamcast keyboard driver
  * Based on drivers/usb/usbkbd.c
  * Copyright YAEGASHI Takeshi, 2001
- * Porting to 2.6 Copyright Adrian McMenamin, 2007
+ * Porting to 2.6 Copyright Adrian McMenamin, 2007, 2008
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -45,39 +45,51 @@ struct dc_kbd {
 };
 
 static const unsigned short dc_kbd_keycode[NR_SCANCODES] = {
-       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_A, KEY_B, KEY_C, KEY_D,
-       KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L,
-       KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T,
-       KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_1, KEY_2,
-       KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0,
-       KEY_ENTER, KEY_ESC, KEY_BACKSPACE, KEY_TAB, KEY_SPACE, KEY_MINUS, KEY_EQUAL, KEY_LEFTBRACE,
-       KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_BACKSLASH, KEY_SEMICOLON, KEY_APOSTROPHE, KEY_GRAVE, KEY_COMMA,
-       KEY_DOT, KEY_SLASH, KEY_CAPSLOCK, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_A, KEY_B,
+       KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L,
+       KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V,
+       KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6,
+       KEY_7, KEY_8, KEY_9, KEY_0, KEY_ENTER, KEY_ESC, KEY_BACKSPACE,
+       KEY_TAB, KEY_SPACE, KEY_MINUS, KEY_EQUAL, KEY_LEFTBRACE,
+       KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_BACKSLASH, KEY_SEMICOLON,
+       KEY_APOSTROPHE, KEY_GRAVE, KEY_COMMA, KEY_DOT, KEY_SLASH,
+       KEY_CAPSLOCK, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6,
        KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12, KEY_SYSRQ,
-       KEY_SCROLLLOCK, KEY_PAUSE, KEY_INSERT, KEY_HOME, KEY_PAGEUP, KEY_DELETE,
-       KEY_END, KEY_PAGEDOWN, KEY_RIGHT, KEY_LEFT, KEY_DOWN, KEY_UP,
-       KEY_NUMLOCK, KEY_KPSLASH, KEY_KPASTERISK, KEY_KPMINUS, KEY_KPPLUS, KEY_KPENTER, KEY_KP1, KEY_KP2,
-       KEY_KP3, KEY_KP4, KEY_KP5, KEY_KP6, KEY_KP7, KEY_KP8, KEY_KP9, KEY_KP0, KEY_KPDOT,
-       KEY_102ND, KEY_COMPOSE, KEY_POWER, KEY_KPEQUAL, KEY_F13, KEY_F14, KEY_F15,
-       KEY_F16, KEY_F17, KEY_F18, KEY_F19, KEY_F20,
-       KEY_F21, KEY_F22, KEY_F23, KEY_F24, KEY_OPEN, KEY_HELP, KEY_PROPS, KEY_FRONT,
-       KEY_STOP, KEY_AGAIN, KEY_UNDO, KEY_CUT, KEY_COPY, KEY_PASTE, KEY_FIND, KEY_MUTE,
-       KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_KPCOMMA, KEY_RESERVED, KEY_RO, KEY_KATAKANAHIRAGANA , KEY_YEN,
-       KEY_HENKAN, KEY_MUHENKAN, KEY_KPJPCOMMA, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
-       KEY_HANGEUL, KEY_HANJA, KEY_KATAKANA, KEY_HIRAGANA, KEY_ZENKAKUHANKAKU, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
-       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
-       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
-       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
-       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
-       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
-       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
-       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
-       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
-       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
-       KEY_LEFTCTRL, KEY_LEFTSHIFT, KEY_LEFTALT, KEY_LEFTMETA, KEY_RIGHTCTRL, KEY_RIGHTSHIFT, KEY_RIGHTALT, KEY_RIGHTMETA,
-       KEY_PLAYPAUSE, KEY_STOPCD, KEY_PREVIOUSSONG, KEY_NEXTSONG, KEY_EJECTCD, KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_MUTE,
-       KEY_WWW, KEY_BACK, KEY_FORWARD, KEY_STOP, KEY_FIND, KEY_SCROLLUP, KEY_SCROLLDOWN, KEY_EDIT, KEY_SLEEP,
-       KEY_SCREENLOCK, KEY_REFRESH, KEY_CALC, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED
+       KEY_SCROLLLOCK, KEY_PAUSE, KEY_INSERT, KEY_HOME, KEY_PAGEUP,
+       KEY_DELETE, KEY_END, KEY_PAGEDOWN, KEY_RIGHT, KEY_LEFT, KEY_DOWN,
+       KEY_UP, KEY_NUMLOCK, KEY_KPSLASH, KEY_KPASTERISK, KEY_KPMINUS,
+       KEY_KPPLUS, KEY_KPENTER, KEY_KP1, KEY_KP2, KEY_KP3, KEY_KP4, KEY_KP5,
+       KEY_KP6, KEY_KP7, KEY_KP8, KEY_KP9, KEY_KP0, KEY_KPDOT, KEY_102ND,
+       KEY_COMPOSE, KEY_POWER, KEY_KPEQUAL, KEY_F13, KEY_F14, KEY_F15,
+       KEY_F16, KEY_F17, KEY_F18, KEY_F19, KEY_F20, KEY_F21, KEY_F22,
+       KEY_F23, KEY_F24, KEY_OPEN, KEY_HELP, KEY_PROPS, KEY_FRONT, KEY_STOP,
+       KEY_AGAIN, KEY_UNDO, KEY_CUT, KEY_COPY, KEY_PASTE, KEY_FIND, KEY_MUTE,
+       KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_KPCOMMA, KEY_RESERVED, KEY_RO, KEY_KATAKANAHIRAGANA , KEY_YEN,
+       KEY_HENKAN, KEY_MUHENKAN, KEY_KPJPCOMMA, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_HANGEUL, KEY_HANJA, KEY_KATAKANA, KEY_HIRAGANA,
+       KEY_ZENKAKUHANKAKU, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,
+       KEY_RESERVED, KEY_RESERVED, KEY_LEFTCTRL, KEY_LEFTSHIFT, KEY_LEFTALT,
+       KEY_LEFTMETA, KEY_RIGHTCTRL, KEY_RIGHTSHIFT, KEY_RIGHTALT,
+       KEY_RIGHTMETA, KEY_PLAYPAUSE, KEY_STOPCD, KEY_PREVIOUSSONG,
+       KEY_NEXTSONG, KEY_EJECTCD, KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_MUTE,
+       KEY_WWW, KEY_BACK, KEY_FORWARD, KEY_STOP, KEY_FIND, KEY_SCROLLUP,
+       KEY_SCROLLDOWN, KEY_EDIT, KEY_SLEEP, KEY_SCREENLOCK, KEY_REFRESH,
+       KEY_CALC, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED
 };
 
 static void dc_scan_kbd(struct dc_kbd *kbd)
@@ -127,12 +139,12 @@ static void dc_scan_kbd(struct dc_kbd *kbd)
 static void dc_kbd_callback(struct mapleq *mq)
 {
        struct maple_device *mapledev = mq->dev;
-       struct dc_kbd *kbd = mapledev->private_data;
+       struct dc_kbd *kbd = maple_get_drvdata(mapledev);
        unsigned long *buf = mq->recvbuf;
 
        /*
-        * We should always be getting the lock because the only
-        * time it may be locked if driver is in cleanup phase.
+        * We should always get the lock because the only
+        * time it may be locked is if the driver is in the cleanup phase.
         */
        if (likely(mutex_trylock(&maple_keyb_mutex))) {
 
@@ -145,106 +157,96 @@ static void dc_kbd_callback(struct mapleq *mq)
        }
 }
 
-static int dc_kbd_connect(struct maple_device *mdev)
+static int probe_maple_kbd(struct device *dev)
 {
+       struct maple_device *mdev = to_maple_dev(dev);
+       struct maple_driver *mdrv = to_maple_driver(dev->driver);
        int i, error;
        struct dc_kbd *kbd;
-       struct input_dev *dev;
+       struct input_dev *idev;
 
        if (!(mdev->function & MAPLE_FUNC_KEYBOARD))
                return -EINVAL;
 
        kbd = kzalloc(sizeof(struct dc_kbd), GFP_KERNEL);
-       dev = input_allocate_device();
-       if (!kbd || !dev) {
+       idev = input_allocate_device();
+       if (!kbd || !idev) {
                error = -ENOMEM;
                goto fail;
        }
 
-       mdev->private_data = kbd;
-
-       kbd->dev = dev;
+       kbd->dev = idev;
        memcpy(kbd->keycode, dc_kbd_keycode, sizeof(kbd->keycode));
 
-       dev->name = mdev->product_name;
-       dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
-       dev->keycode = kbd->keycode;
-       dev->keycodesize = sizeof (unsigned short);
-       dev->keycodemax = ARRAY_SIZE(kbd->keycode);
-       dev->id.bustype = BUS_HOST;
-       dev->dev.parent = &mdev->dev;
+       idev->name = mdev->product_name;
+       idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+       idev->keycode = kbd->keycode;
+       idev->keycodesize = sizeof(unsigned short);
+       idev->keycodemax = ARRAY_SIZE(kbd->keycode);
+       idev->id.bustype = BUS_HOST;
+       idev->dev.parent = &mdev->dev;
 
        for (i = 0; i < NR_SCANCODES; i++)
-               __set_bit(dc_kbd_keycode[i], dev->keybit);
-       __clear_bit(KEY_RESERVED, dev->keybit);
+               __set_bit(dc_kbd_keycode[i], idev->keybit);
+       __clear_bit(KEY_RESERVED, idev->keybit);
 
-       input_set_capability(dev, EV_MSC, MSC_SCAN);
-       input_set_drvdata(dev, kbd);
+       input_set_capability(idev, EV_MSC, MSC_SCAN);
+       input_set_drvdata(idev, kbd);
 
-       error = input_register_device(dev);
+       error = input_register_device(idev);
        if (error)
                goto fail;
 
        /* Maple polling is locked to VBLANK - which may be just 50/s */
-       maple_getcond_callback(mdev, dc_kbd_callback, HZ/50, MAPLE_FUNC_KEYBOARD);
-       return 0;
+       maple_getcond_callback(mdev, dc_kbd_callback, HZ/50,
+               MAPLE_FUNC_KEYBOARD);
 
- fail:
-       input_free_device(dev);
+       mdev->driver = mdrv;
+
+       maple_set_drvdata(mdev, kbd);
+
+       return error;
+
+fail:
+       input_free_device(idev);
        kfree(kbd);
-       mdev->private_data = NULL;
+       maple_set_drvdata(mdev, NULL);
        return error;
 }
 
-static void dc_kbd_disconnect(struct maple_device *mdev)
+static int remove_maple_kbd(struct device *dev)
 {
-       struct dc_kbd *kbd;
+       struct maple_device *mdev = to_maple_dev(dev);
+       struct dc_kbd *kbd = maple_get_drvdata(mdev);
 
        mutex_lock(&maple_keyb_mutex);
 
-       kbd = mdev->private_data;
-       mdev->private_data = NULL;
        input_unregister_device(kbd->dev);
        kfree(kbd);
 
-       mutex_unlock(&maple_keyb_mutex);
-}
-
-/* allow the keyboard to be used */
-static int probe_maple_kbd(struct device *dev)
-{
-       struct maple_device *mdev = to_maple_dev(dev);
-       struct maple_driver *mdrv = to_maple_driver(dev->driver);
-       int error;
-
-       error = dc_kbd_connect(mdev);
-       if (error)
-               return error;
-
-       mdev->driver = mdrv;
-       mdev->registered = 1;
+       maple_set_drvdata(mdev, NULL);
 
+       mutex_unlock(&maple_keyb_mutex);
        return 0;
 }
 
 static struct maple_driver dc_kbd_driver = {
        .function = MAPLE_FUNC_KEYBOARD,
-       .connect = dc_kbd_connect,
-       .disconnect = dc_kbd_disconnect,
        .drv = {
                .name = "Dreamcast_keyboard",
                .probe = probe_maple_kbd,
-       },
+               .remove = remove_maple_kbd,
+       },
 };
 
 static int __init dc_kbd_init(void)
 {
-       return maple_driver_register(&dc_kbd_driver.drv);
+       return maple_driver_register(&dc_kbd_driver);
 }
 
 static void __exit dc_kbd_exit(void)
 {
-       driver_unregister(&dc_kbd_driver.drv);
+       maple_driver_unregister(&dc_kbd_driver);
 }
 
 module_init(dc_kbd_init);
index 8380a45..f1f7775 100644 (file)
@@ -5,7 +5,7 @@
 obj-$(CONFIG_ISDN_I4L)                 += i4l/
 obj-$(CONFIG_ISDN_CAPI)                        += capi/
 obj-$(CONFIG_MISDN)                    += mISDN/
-obj-$(CONFIG_ISDN_CAPI)                        += hardware/
+obj-$(CONFIG_ISDN)                     += hardware/
 obj-$(CONFIG_ISDN_DIVERSION)           += divert/
 obj-$(CONFIG_ISDN_DRV_HISAX)           += hisax/
 obj-$(CONFIG_ISDN_DRV_ICN)             += icn/
index 2649ea5..1eac03f 100644 (file)
  * #define HFC_REGISTER_DEBUG
  */
 
-static const char *hfcmulti_revision = "2.00";
+static const char *hfcmulti_revision = "2.02";
 
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -427,12 +427,12 @@ write_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
 {
        outb(A_FIFO_DATA0, (hc->pci_iobase)+4);
        while (len>>2) {
-               outl(*(u32 *)data, hc->pci_iobase);
+               outl(cpu_to_le32(*(u32 *)data), hc->pci_iobase);
                data += 4;
                len -= 4;
        }
        while (len>>1) {
-               outw(*(u16 *)data, hc->pci_iobase);
+               outw(cpu_to_le16(*(u16 *)data), hc->pci_iobase);
                data += 2;
                len -= 2;
        }
@@ -447,17 +447,19 @@ void
 write_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
 {
        while (len>>2) {
-               writel(*(u32 *)data, (hc->pci_membase)+A_FIFO_DATA0);
+               writel(cpu_to_le32(*(u32 *)data),
+                       hc->pci_membase + A_FIFO_DATA0);
                data += 4;
                len -= 4;
        }
        while (len>>1) {
-               writew(*(u16 *)data, (hc->pci_membase)+A_FIFO_DATA0);
+               writew(cpu_to_le16(*(u16 *)data),
+                       hc->pci_membase + A_FIFO_DATA0);
                data += 2;
                len -= 2;
        }
        while (len) {
-               writeb(*data, (hc->pci_membase)+A_FIFO_DATA0);
+               writeb(*data, hc->pci_membase + A_FIFO_DATA0);
                data++;
                len--;
        }
@@ -468,12 +470,12 @@ read_fifo_regio(struct hfc_multi *hc, u_char *data, int len)
 {
        outb(A_FIFO_DATA0, (hc->pci_iobase)+4);
        while (len>>2) {
-               *(u32 *)data = inl(hc->pci_iobase);
+               *(u32 *)data = le32_to_cpu(inl(hc->pci_iobase));
                data += 4;
                len -= 4;
        }
        while (len>>1) {
-               *(u16 *)data = inw(hc->pci_iobase);
+               *(u16 *)data = le16_to_cpu(inw(hc->pci_iobase));
                data += 2;
                len -= 2;
        }
@@ -490,18 +492,18 @@ read_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len)
 {
        while (len>>2) {
                *(u32 *)data =
-                       readl((hc->pci_membase)+A_FIFO_DATA0);
+                       le32_to_cpu(readl(hc->pci_membase + A_FIFO_DATA0));
                data += 4;
                len -= 4;
        }
        while (len>>1) {
                *(u16 *)data =
-                       readw((hc->pci_membase)+A_FIFO_DATA0);
+                       le16_to_cpu(readw(hc->pci_membase + A_FIFO_DATA0));
                data += 2;
                len -= 2;
        }
        while (len) {
-               *data = readb((hc->pci_membase)+A_FIFO_DATA0);
+               *data = readb(hc->pci_membase + A_FIFO_DATA0);
                data++;
                len--;
        }
@@ -3971,7 +3973,7 @@ open_bchannel(struct hfc_multi *hc, struct dchannel *dch,
        struct bchannel *bch;
        int             ch;
 
-       if (!test_bit(rq->adr.channel, &dch->dev.channelmap[0]))
+       if (!test_channelmap(rq->adr.channel, dch->dev.channelmap))
                return -EINVAL;
        if (rq->protocol == ISDN_P_NONE)
                return -EINVAL;
@@ -4587,7 +4589,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m)
                list_add(&bch->ch.list, &dch->dev.bchannels);
                hc->chan[ch].bch = bch;
                hc->chan[ch].port = 0;
-               test_and_set_bit(bch->nr, &dch->dev.channelmap[0]);
+               set_channelmap(bch->nr, dch->dev.channelmap);
        }
        /* set optical line type */
        if (port[Port_cnt] & 0x001) {
@@ -4755,7 +4757,7 @@ init_multi_port(struct hfc_multi *hc, int pt)
                list_add(&bch->ch.list, &dch->dev.bchannels);
                hc->chan[i + ch].bch = bch;
                hc->chan[i + ch].port = pt;
-               test_and_set_bit(bch->nr, &dch->dev.channelmap[0]);
+               set_channelmap(bch->nr, dch->dev.channelmap);
        }
        /* set master clock */
        if (port[Port_cnt] & 0x001) {
@@ -5050,12 +5052,12 @@ static void __devexit hfc_remove_pci(struct pci_dev *pdev)
 
 static const struct hm_map hfcm_map[] = {
 /*0*/  {VENDOR_BN, "HFC-1S Card (mini PCI)", 4, 1, 1, 3, 0, DIP_4S, 0},
-/*1*/  {VENDOR_BN, "HFC-2S Card", 4, 2, 1, 3, 0, DIP_4S},
+/*1*/  {VENDOR_BN, "HFC-2S Card", 4, 2, 1, 3, 0, DIP_4S, 0},
 /*2*/  {VENDOR_BN, "HFC-2S Card (mini PCI)", 4, 2, 1, 3, 0, DIP_4S, 0},
 /*3*/  {VENDOR_BN, "HFC-4S Card", 4, 4, 1, 2, 0, DIP_4S, 0},
 /*4*/  {VENDOR_BN, "HFC-4S Card (mini PCI)", 4, 4, 1, 2, 0, 0, 0},
 /*5*/  {VENDOR_CCD, "HFC-4S Eval (old)", 4, 4, 0, 0, 0, 0, 0},
-/*6*/  {VENDOR_CCD, "HFC-4S IOB4ST", 4, 4, 1, 2, 0, 0, 0},
+/*6*/  {VENDOR_CCD, "HFC-4S IOB4ST", 4, 4, 1, 2, 0, DIP_4S, 0},
 /*7*/  {VENDOR_CCD, "HFC-4S", 4, 4, 1, 2, 0, 0, 0},
 /*8*/  {VENDOR_DIG, "HFC-4S Card", 4, 4, 0, 2, 0, 0, HFC_IO_MODE_REGIO},
 /*9*/  {VENDOR_CCD, "HFC-4S Swyx 4xS0 SX2 QuadBri", 4, 4, 1, 2, 0, 0, 0},
@@ -5251,9 +5253,6 @@ HFCmulti_init(void)
        if (debug & DEBUG_HFCMULTI_INIT)
                printk(KERN_DEBUG "%s: init entered\n", __func__);
 
-#ifdef __BIG_ENDIAN
-#error "not running on big endian machines now"
-#endif
        hfc_interrupt = symbol_get(ztdummy_extern_interrupt);
        register_interrupt = symbol_get(ztdummy_register_interrupt);
        unregister_interrupt = symbol_get(ztdummy_unregister_interrupt);
index 3231814..9cf5edb 100644 (file)
@@ -2056,7 +2056,7 @@ setup_card(struct hfc_pci *card)
        card->dch.dev.nrbchan = 2;
        for (i = 0; i < 2; i++) {
                card->bch[i].nr = i + 1;
-               test_and_set_bit(i + 1, &card->dch.dev.channelmap[0]);
+               set_channelmap(i + 1, card->dch.dev.channelmap);
                card->bch[i].debug = debug;
                mISDN_initbchannel(&card->bch[i], MAX_DATA_MEM);
                card->bch[i].hw = card;
index 155b997..e42150a 100644 (file)
@@ -1006,8 +1006,7 @@ open_bchannel(struct l1oip *hc, struct dchannel *dch, struct channel_req *rq)
        struct bchannel *bch;
        int             ch;
 
-       if (!test_bit(rq->adr.channel & 0x1f,
-               &dch->dev.channelmap[rq->adr.channel >> 5]))
+       if (!test_channelmap(rq->adr.channel, dch->dev.channelmap))
                return -EINVAL;
        if (rq->protocol == ISDN_P_NONE)
                return -EINVAL;
@@ -1412,8 +1411,7 @@ init_card(struct l1oip *hc, int pri, int bundle)
                bch->ch.nr = i + ch;
                list_add(&bch->ch.list, &dch->dev.bchannels);
                hc->chan[i + ch].bch = bch;
-               test_and_set_bit(bch->nr & 0x1f,
-                       &dch->dev.channelmap[bch->nr >> 5]);
+               set_channelmap(bch->nr, dch->dev.channelmap);
        }
        ret = mISDN_register_device(&dch->dev, hc->name);
        if (ret)
index 4ba4cc3..e5a20f9 100644 (file)
@@ -379,7 +379,7 @@ data_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                        di.Bprotocols = dev->Bprotocols | get_all_Bprotocols();
                        di.protocol = dev->D.protocol;
                        memcpy(di.channelmap, dev->channelmap,
-                               MISDN_CHMAP_SIZE * 4);
+                               sizeof(di.channelmap));
                        di.nrbchan = dev->nrbchan;
                        strcpy(di.name, dev->name);
                        if (copy_to_user((void __user *)arg, &di, sizeof(di)))
@@ -637,7 +637,7 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                        di.Bprotocols = dev->Bprotocols | get_all_Bprotocols();
                        di.protocol = dev->D.protocol;
                        memcpy(di.channelmap, dev->channelmap,
-                               MISDN_CHMAP_SIZE * 4);
+                               sizeof(di.channelmap));
                        di.nrbchan = dev->nrbchan;
                        strcpy(di.name, dev->name);
                        if (copy_to_user((void __user *)arg, &di, sizeof(di)))
index b65be5d..2ed0bd5 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <asm/system.h>
 #include <asm/io.h>
-#include <asm/se.h>
+#include <mach-se/mach/se.h>
 #include <asm/machvec.h>
 #ifdef CONFIG_SH_STANDARD_BIOS
 #include <asm/sh_bios.h>
index d0c1d63..203e579 100644 (file)
@@ -275,7 +275,7 @@ static int readable(struct pcmcia_socket *s, struct resource *res,
                destroy_cis_cache(s);
        }
        s->cis_mem.res = NULL;
-       if ((ret != 0) || (count == 0))
+       if ((ret != 0) || (*count == 0))
                return 0;
        return 1;
 }
index da876d3..74d12b5 100644 (file)
@@ -1249,6 +1249,13 @@ static struct pci_device_id hptiop_id_table[] = {
        { PCI_VDEVICE(TTI, 0x3522), (kernel_ulong_t)&hptiop_itl_ops },
        { PCI_VDEVICE(TTI, 0x3410), (kernel_ulong_t)&hptiop_itl_ops },
        { PCI_VDEVICE(TTI, 0x3540), (kernel_ulong_t)&hptiop_itl_ops },
+       { PCI_VDEVICE(TTI, 0x3530), (kernel_ulong_t)&hptiop_itl_ops },
+       { PCI_VDEVICE(TTI, 0x3560), (kernel_ulong_t)&hptiop_itl_ops },
+       { PCI_VDEVICE(TTI, 0x4322), (kernel_ulong_t)&hptiop_itl_ops },
+       { PCI_VDEVICE(TTI, 0x4210), (kernel_ulong_t)&hptiop_itl_ops },
+       { PCI_VDEVICE(TTI, 0x4211), (kernel_ulong_t)&hptiop_itl_ops },
+       { PCI_VDEVICE(TTI, 0x4310), (kernel_ulong_t)&hptiop_itl_ops },
+       { PCI_VDEVICE(TTI, 0x4311), (kernel_ulong_t)&hptiop_itl_ops },
        { PCI_VDEVICE(TTI, 0x3120), (kernel_ulong_t)&hptiop_mv_ops },
        { PCI_VDEVICE(TTI, 0x3122), (kernel_ulong_t)&hptiop_mv_ops },
        { PCI_VDEVICE(TTI, 0x3020), (kernel_ulong_t)&hptiop_mv_ops },
index 75a64a6..b29360e 100644 (file)
@@ -366,12 +366,14 @@ spi_transport_rd_attr(rti, "%d\n");
 spi_transport_rd_attr(pcomp_en, "%d\n");
 spi_transport_rd_attr(hold_mcs, "%d\n");
 
-/* we only care about the first child device so we return 1 */
+/* we only care about the first child device that's a real SCSI device
+ * so we return 1 to terminate the iteration when we find it */
 static int child_iter(struct device *dev, void *data)
 {
-       struct scsi_device *sdev = to_scsi_device(dev);
+       if (!scsi_is_sdev_device(dev))
+               return 0;
 
-       spi_dv_device(sdev);
+       spi_dv_device(to_scsi_device(dev));
        return 1;
 }
 
index e5e7d78..8e08d51 100644 (file)
@@ -375,7 +375,6 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
        struct gendisk *disk = rq->rq_disk;
        struct scsi_disk *sdkp;
        sector_t block = rq->sector;
-       sector_t threshold;
        unsigned int this_count = rq->nr_sectors;
        unsigned int timeout = sdp->timeout;
        int ret;
@@ -423,21 +422,13 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
        }
 
        /*
-        * Some SD card readers can't handle multi-sector accesses which touch
-        * the last one or two hardware sectors.  Split accesses as needed.
+        * Some devices (some sdcards for one) don't like it if the
+        * last sector gets read in a larger then 1 sector read.
         */
-       threshold = get_capacity(disk) - SD_LAST_BUGGY_SECTORS *
-               (sdp->sector_size / 512);
-
-       if (unlikely(sdp->last_sector_bug && block + this_count > threshold)) {
-               if (block < threshold) {
-                       /* Access up to the threshold but not beyond */
-                       this_count = threshold - block;
-               } else {
-                       /* Access only a single hardware sector */
-                       this_count = sdp->sector_size / 512;
-               }
-       }
+       if (unlikely(sdp->last_sector_bug &&
+           rq->nr_sectors > sdp->sector_size / 512 &&
+           block + this_count == get_capacity(disk)))
+               this_count -= sdp->sector_size / 512;
 
        SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, "block=%llu\n",
                                        (unsigned long long)block));
index 95b9f06..550b2f7 100644 (file)
  */
 #define SD_BUF_SIZE            512
 
-/*
- * Number of sectors at the end of the device to avoid multi-sector
- * accesses to in the case of last_sector_bug
- */
-#define SD_LAST_BUGGY_SECTORS  8
-
 struct scsi_disk {
        struct scsi_driver *driver;     /* always &sd_template */
        struct scsi_device *device;
index 0fe031f..1bcf3c3 100644 (file)
@@ -345,14 +345,14 @@ static int ses_enclosure_find_by_addr(struct enclosure_device *edev,
        return 0;
 }
 
-#define VPD_INQUIRY_SIZE 512
+#define VPD_INQUIRY_SIZE 36
 
 static void ses_match_to_enclosure(struct enclosure_device *edev,
                                   struct scsi_device *sdev)
 {
        unsigned char *buf = kmalloc(VPD_INQUIRY_SIZE, GFP_KERNEL);
        unsigned char *desc;
-       int len;
+       u16 vpd_len;
        struct efd efd = {
                .addr = 0,
        };
@@ -372,9 +372,19 @@ static void ses_match_to_enclosure(struct enclosure_device *edev,
                             VPD_INQUIRY_SIZE, NULL, SES_TIMEOUT, SES_RETRIES))
                goto free;
 
-       len = (buf[2] << 8) + buf[3];
+       vpd_len = (buf[2] << 8) + buf[3];
+       kfree(buf);
+       buf = kmalloc(vpd_len, GFP_KERNEL);
+       if (!buf)
+               return;
+       cmd[3] = vpd_len >> 8;
+       cmd[4] = vpd_len & 0xff;
+       if (scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf,
+                            vpd_len, NULL, SES_TIMEOUT, SES_RETRIES))
+               goto free;
+
        desc = buf + 4;
-       while (desc < buf + len) {
+       while (desc < buf + vpd_len) {
                enum scsi_protocol proto = desc[0] >> 4;
                u8 code_set = desc[0] & 0x0f;
                u8 piv = desc[1] & 0x80;
index 9d85437..efcd443 100644 (file)
@@ -817,7 +817,7 @@ static void bfin_serial_set_ldisc(struct uart_port *port)
        if (line >= port->info->port.tty->driver->num)
                return;
 
-       switch (port->info->port.tty->ldisc.num) {
+       switch (port->info->port.tty->termios->c_line) {
        case N_IRDA:
                val = UART_GET_GCTL(&bfin_serial_ports[line]);
                val |= (IREN | RPOLC);
index 8249ac4..bf94a77 100644 (file)
@@ -234,7 +234,7 @@ unsigned long r_alt_ser_baudrate_shadow = 0;
 
 static struct e100_serial rs_table[] = {
        { .baud        = DEF_BAUD,
-         .port        = (unsigned char *)R_SERIAL0_CTRL,
+         .ioport        = (unsigned char *)R_SERIAL0_CTRL,
          .irq         = 1U << 12, /* uses DMA 6 and 7 */
          .oclrintradr = R_DMA_CH6_CLR_INTR,
          .ofirstadr   = R_DMA_CH6_FIRST,
@@ -288,7 +288,7 @@ static struct e100_serial rs_table[] = {
 },  /* ttyS0 */
 #ifndef CONFIG_SVINTO_SIM
        { .baud        = DEF_BAUD,
-         .port        = (unsigned char *)R_SERIAL1_CTRL,
+         .ioport        = (unsigned char *)R_SERIAL1_CTRL,
          .irq         = 1U << 16, /* uses DMA 8 and 9 */
          .oclrintradr = R_DMA_CH8_CLR_INTR,
          .ofirstadr   = R_DMA_CH8_FIRST,
@@ -344,7 +344,7 @@ static struct e100_serial rs_table[] = {
 },  /* ttyS1 */
 
        { .baud        = DEF_BAUD,
-         .port        = (unsigned char *)R_SERIAL2_CTRL,
+         .ioport        = (unsigned char *)R_SERIAL2_CTRL,
          .irq         = 1U << 4,  /* uses DMA 2 and 3 */
          .oclrintradr = R_DMA_CH2_CLR_INTR,
          .ofirstadr   = R_DMA_CH2_FIRST,
@@ -398,7 +398,7 @@ static struct e100_serial rs_table[] = {
  },  /* ttyS2 */
 
        { .baud        = DEF_BAUD,
-         .port        = (unsigned char *)R_SERIAL3_CTRL,
+         .ioport        = (unsigned char *)R_SERIAL3_CTRL,
          .irq         = 1U << 8,  /* uses DMA 4 and 5 */
          .oclrintradr = R_DMA_CH4_CLR_INTR,
          .ofirstadr   = R_DMA_CH4_FIRST,
@@ -939,7 +939,7 @@ static const struct control_pins e100_modem_pins[NR_PORTS] =
 /* Output */
 #define E100_RTS_GET(info) ((info)->rx_ctrl & E100_RTS_MASK)
 /* Input */
-#define E100_CTS_GET(info) ((info)->port[REG_STATUS] & E100_CTS_MASK)
+#define E100_CTS_GET(info) ((info)->ioport[REG_STATUS] & E100_CTS_MASK)
 
 /* These are typically PA or PB and 0 means 0V, 1 means 3.3V */
 /* Is an output */
@@ -1092,7 +1092,7 @@ e100_rts(struct e100_serial *info, int set)
        local_irq_save(flags);
        info->rx_ctrl &= ~E100_RTS_MASK;
        info->rx_ctrl |= (set ? 0 : E100_RTS_MASK);  /* RTS is active low */
-       info->port[REG_REC_CTRL] = info->rx_ctrl;
+       info->ioport[REG_REC_CTRL] = info->rx_ctrl;
        local_irq_restore(flags);
 #ifdef SERIAL_DEBUG_IO
        printk("ser%i rts %i\n", info->line, set);
@@ -1142,7 +1142,7 @@ e100_disable_rx(struct e100_serial *info)
 {
 #ifndef CONFIG_SVINTO_SIM
        /* disable the receiver */
-       info->port[REG_REC_CTRL] =
+       info->ioport[REG_REC_CTRL] =
                (info->rx_ctrl &= ~IO_MASK(R_SERIAL0_REC_CTRL, rec_enable));
 #endif
 }
@@ -1152,7 +1152,7 @@ e100_enable_rx(struct e100_serial *info)
 {
 #ifndef CONFIG_SVINTO_SIM
        /* enable the receiver */
-       info->port[REG_REC_CTRL] =
+       info->ioport[REG_REC_CTRL] =
                (info->rx_ctrl |= IO_MASK(R_SERIAL0_REC_CTRL, rec_enable));
 #endif
 }
@@ -1490,7 +1490,7 @@ rs_stop(struct tty_struct *tty)
                        xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable);
                }
 
-               *((unsigned long *)&info->port[REG_XOFF]) = xoff;
+               *((unsigned long *)&info->ioport[REG_XOFF]) = xoff;
                local_irq_restore(flags);
        }
 }
@@ -1513,7 +1513,7 @@ rs_start(struct tty_struct *tty)
                        xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable);
                }
 
-               *((unsigned long *)&info->port[REG_XOFF]) = xoff;
+               *((unsigned long *)&info->ioport[REG_XOFF]) = xoff;
                if (!info->uses_dma_out &&
                    info->xmit.head != info->xmit.tail && info->xmit.buf)
                        e100_enable_serial_tx_ready_irq(info);
@@ -1888,7 +1888,7 @@ static void receive_chars_dma(struct e100_serial *info)
        handle_all_descr_data(info);
 
        /* Read the status register to detect errors */
-       rstat = info->port[REG_STATUS];
+       rstat = info->ioport[REG_STATUS];
        if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) ) {
                DFLOW(DEBUG_LOG(info->line, "XOFF detect stat %x\n", rstat));
        }
@@ -1897,7 +1897,7 @@ static void receive_chars_dma(struct e100_serial *info)
                /* If we got an error, we must reset it by reading the
                 * data_in field
                 */
-               unsigned char data = info->port[REG_DATA];
+               unsigned char data = info->ioport[REG_DATA];
 
                PROCSTAT(ser_stat[info->line].errors_cnt++);
                DEBUG_LOG(info->line, "#dERR: s d 0x%04X\n",
@@ -2077,7 +2077,7 @@ static int force_eop_if_needed(struct e100_serial *info)
        /* We check data_avail bit to determine if data has
         * arrived since last time
         */
-       unsigned char rstat = info->port[REG_STATUS];
+       unsigned char rstat = info->ioport[REG_STATUS];
 
        /* error or datavail? */
        if (rstat & SER_ERROR_MASK) {
@@ -2096,7 +2096,7 @@ static int force_eop_if_needed(struct e100_serial *info)
                TIMERD(DEBUG_LOG(info->line, "timeout: rstat 0x%03X\n",
                          rstat | (info->line << 8)));
                /* Read data to clear status flags */
-               (void)info->port[REG_DATA];
+               (void)info->ioport[REG_DATA];
 
                info->forced_eop = 0;
                START_FLUSH_FAST_TIMER(info, "magic");
@@ -2296,7 +2296,7 @@ struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info)
        }
 
        /* Read data and status at the same time */
-       data_read = *((unsigned long *)&info->port[REG_DATA_STATUS32]);
+       data_read = *((unsigned long *)&info->ioport[REG_DATA_STATUS32]);
 more_data:
        if (data_read & IO_MASK(R_SERIAL0_READ, xoff_detect) ) {
                DFLOW(DEBUG_LOG(info->line, "XOFF detect\n", 0));
@@ -2391,7 +2391,7 @@ more_data:
 
 
        info->icount.rx++;
-       data_read = *((unsigned long *)&info->port[REG_DATA_STATUS32]);
+       data_read = *((unsigned long *)&info->ioport[REG_DATA_STATUS32]);
        if (data_read & IO_MASK(R_SERIAL0_READ, data_avail)) {
                DEBUG_LOG(info->line, "ser_rx   %c in loop\n", IO_EXTRACT(R_SERIAL0_READ, data_in, data_read));
                goto more_data;
@@ -2413,7 +2413,7 @@ static struct e100_serial* handle_ser_rx_interrupt(struct e100_serial *info)
                return handle_ser_rx_interrupt_no_dma(info);
        }
        /* DMA is used */
-       rstat = info->port[REG_STATUS];
+       rstat = info->ioport[REG_STATUS];
        if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) ) {
                DFLOW(DEBUG_LOG(info->line, "XOFF detect\n", 0));
        }
@@ -2426,7 +2426,7 @@ static struct e100_serial* handle_ser_rx_interrupt(struct e100_serial *info)
                /* If we got an error, we must reset it by reading the
                 * data_in field
                 */
-               data = info->port[REG_DATA];
+               data = info->ioport[REG_DATA];
                DINTR1(DEBUG_LOG(info->line, "ser_rx!  %c\n", data));
                DINTR1(DEBUG_LOG(info->line, "ser_rx err stat %02X\n", rstat));
                if (!data && (rstat & SER_FRAMING_ERR_MASK)) {
@@ -2528,10 +2528,10 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
                unsigned char rstat;
                DFLOW(DEBUG_LOG(info->line, "tx_int: xchar 0x%02X\n", info->x_char));
                local_irq_save(flags);
-               rstat = info->port[REG_STATUS];
+               rstat = info->ioport[REG_STATUS];
                DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat));
 
-               info->port[REG_TR_DATA] = info->x_char;
+               info->ioport[REG_TR_DATA] = info->x_char;
                info->icount.tx++;
                info->x_char = 0;
                /* We must enable since it is disabled in ser_interrupt */
@@ -2545,7 +2545,7 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
                /* We only use normal tx interrupt when sending x_char */
                DFLOW(DEBUG_LOG(info->line, "tx_int: xchar sent\n", 0));
                local_irq_save(flags);
-               rstat = info->port[REG_STATUS];
+               rstat = info->ioport[REG_STATUS];
                DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat));
                e100_disable_serial_tx_ready_irq(info);
                if (info->port.tty->stopped)
@@ -2573,7 +2573,7 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
        DINTR2(DEBUG_LOG(info->line, "tx_int %c\n", info->xmit.buf[info->xmit.tail]));
        /* Send a byte, rs485 timing is critical so turn of ints */
        local_irq_save(flags);
-       info->port[REG_TR_DATA] = info->xmit.buf[info->xmit.tail];
+       info->ioport[REG_TR_DATA] = info->xmit.buf[info->xmit.tail];
        info->xmit.tail = (info->xmit.tail + 1) & (SERIAL_XMIT_SIZE-1);
        info->icount.tx++;
        if (info->xmit.head == info->xmit.tail) {
@@ -2848,7 +2848,7 @@ startup(struct e100_serial * info)
 
        /* dummy read to reset any serial errors */
 
-       (void)info->port[REG_DATA];
+       (void)info->ioport[REG_DATA];
 
        /* enable the interrupts */
        if (info->uses_dma_out)
@@ -2897,7 +2897,7 @@ shutdown(struct e100_serial * info)
        /* shut down the transmitter and receiver */
        DFLOW(DEBUG_LOG(info->line, "shutdown %i\n", info->line));
        e100_disable_rx(info);
-       info->port[REG_TR_CTRL] = (info->tx_ctrl &= ~0x40);
+       info->ioport[REG_TR_CTRL] = (info->tx_ctrl &= ~0x40);
 
        /* disable interrupts, reset dma channels */
        if (info->uses_dma_in) {
@@ -2968,7 +2968,7 @@ change_speed(struct e100_serial *info)
 
        if (!info->port.tty || !info->port.tty->termios)
                return;
-       if (!info->port)
+       if (!info->ioport)
                return;
 
        cflag = info->port.tty->termios->c_cflag;
@@ -3037,7 +3037,7 @@ change_speed(struct e100_serial *info)
 
                info->baud = cflag_to_baud(cflag);
 #ifndef CONFIG_SVINTO_SIM
-               info->port[REG_BAUD] = cflag_to_etrax_baud(cflag);
+               info->ioport[REG_BAUD] = cflag_to_etrax_baud(cflag);
 #endif /* CONFIG_SVINTO_SIM */
        }
 
@@ -3097,8 +3097,8 @@ change_speed(struct e100_serial *info)
 
        /* actually write the control regs to the hardware */
 
-       info->port[REG_TR_CTRL] = info->tx_ctrl;
-       info->port[REG_REC_CTRL] = info->rx_ctrl;
+       info->ioport[REG_TR_CTRL] = info->tx_ctrl;
+       info->ioport[REG_REC_CTRL] = info->rx_ctrl;
        xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->port.tty));
        xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable);
        if (info->port.tty->termios->c_iflag & IXON ) {
@@ -3107,7 +3107,7 @@ change_speed(struct e100_serial *info)
                xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable);
        }
 
-       *((unsigned long *)&info->port[REG_XOFF]) = xoff;
+       *((unsigned long *)&info->ioport[REG_XOFF]) = xoff;
        local_irq_restore(flags);
 #endif /* !CONFIG_SVINTO_SIM */
 
@@ -3156,7 +3156,7 @@ static int rs_raw_write(struct tty_struct *tty,
 #ifdef SERIAL_DEBUG_DATA
        if (info->line == SERIAL_DEBUG_LINE)
                printk("rs_raw_write (%d), status %d\n",
-                      count, info->port[REG_STATUS]);
+                      count, info->ioport[REG_STATUS]);
 #endif
 
 #ifdef CONFIG_SVINTO_SIM
@@ -3427,7 +3427,7 @@ get_serial_info(struct e100_serial * info,
        memset(&tmp, 0, sizeof(tmp));
        tmp.type = info->type;
        tmp.line = info->line;
-       tmp.port = (int)info->port;
+       tmp.port = (int)info->ioport;
        tmp.irq = info->irq;
        tmp.flags = info->flags;
        tmp.baud_base = info->baud_base;
@@ -3557,14 +3557,14 @@ char *get_control_state_str(int MLines, char *s)
 }
 #endif
 
-static void
+static int
 rs_break(struct tty_struct *tty, int break_state)
 {
        struct e100_serial *info = (struct e100_serial *)tty->driver_data;
        unsigned long flags;
 
-       if (!info->port)
-               return;
+       if (!info->ioport)
+               return -EIO;
 
        local_irq_save(flags);
        if (break_state == -1) {
@@ -3575,8 +3575,9 @@ rs_break(struct tty_struct *tty, int break_state)
                /* Set bit 7 (txd) and 6 (tr_enable) */
                info->tx_ctrl |= (0x80 | 0x40);
        }
-       info->port[REG_TR_CTRL] = info->tx_ctrl;
+       info->ioport[REG_TR_CTRL] = info->tx_ctrl;
        local_irq_restore(flags);
+       return 0;
 }
 
 static int
@@ -4231,9 +4232,9 @@ static int line_info(char *buf, struct e100_serial *info)
        unsigned long tmp;
 
        ret = sprintf(buf, "%d: uart:E100 port:%lX irq:%d",
-                     info->line, (unsigned long)info->port, info->irq);
+                     info->line, (unsigned long)info->ioport, info->irq);
 
-       if (!info->port || (info->type == PORT_UNKNOWN)) {
+       if (!info->ioport || (info->type == PORT_UNKNOWN)) {
                ret += sprintf(buf+ret, "\n");
                return ret;
        }
@@ -4281,7 +4282,7 @@ static int line_info(char *buf, struct e100_serial *info)
        }
 
        {
-               unsigned char rstat = info->port[REG_STATUS];
+               unsigned char rstat = info->ioport[REG_STATUS];
                if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) )
                        ret += sprintf(buf+ret, " xoff_detect:1");
        }
@@ -4502,7 +4503,7 @@ rs_init(void)
 
                if (info->enabled) {
                        printk(KERN_INFO "%s%d at 0x%x is a builtin UART with DMA\n",
-                              serial_driver->name, info->line, (unsigned int)info->port);
+                              serial_driver->name, info->line, (unsigned int)info->ioport);
                }
        }
 #ifdef CONFIG_ETRAX_FAST_TIMER
index ccd0f32..e3c5c8c 100644 (file)
@@ -36,8 +36,9 @@ struct etrax_recv_buffer {
 };
 
 struct e100_serial {
+       struct tty_port port;
        int baud;
-       volatile u8     *port;  /* R_SERIALx_CTRL */
+       volatile u8     *ioport;        /* R_SERIALx_CTRL */
        u32             irq;    /* bitnr in R_IRQ_MASK2 for dmaX_descr */
 
        /* Output registers */
index be97789..d1812d3 100644 (file)
@@ -2,6 +2,7 @@
  * Core maple bus functionality
  *
  *  Copyright (C) 2007, 2008 Adrian McMenamin
+ *  Copyright (C) 2001 - 2008 Paul Mundt
  *
  * Based on 2.4 code by:
  *
@@ -31,7 +32,7 @@
 #include <mach/dma.h>
 #include <mach/sysasic.h>
 
-MODULE_AUTHOR("Yaegshi Takeshi, Paul Mundt, M.R. Brown, Adrian McMenamin");
+MODULE_AUTHOR("Yaegashi Takeshi, Paul Mundt, M. R. Brown, Adrian McMenamin");
 MODULE_DESCRIPTION("Maple bus driver for Dreamcast");
 MODULE_LICENSE("GPL v2");
 MODULE_SUPPORTED_DEVICE("{{SEGA, Dreamcast/Maple}}");
@@ -65,19 +66,36 @@ static bool checked[4];
 static struct maple_device *baseunits[4];
 
 /**
- *  maple_driver_register - register a device driver
- *  automatically makes the driver bus a maple bus
- *  @drv: the driver to be registered
+ * maple_driver_register - register a maple driver
+ * @drv: maple driver to be registered.
+ *
+ * Registers the passed in @drv, while updating the bus type.
+ * Devices with matching function IDs will be automatically probed.
  */
-int maple_driver_register(struct device_driver *drv)
+int maple_driver_register(struct maple_driver *drv)
 {
        if (!drv)
                return -EINVAL;
-       drv->bus = &maple_bus_type;
-       return driver_register(drv);
+
+       drv->drv.bus = &maple_bus_type;
+
+       return driver_register(&drv->drv);
 }
 EXPORT_SYMBOL_GPL(maple_driver_register);
 
+/**
+ * maple_driver_unregister - unregister a maple driver.
+ * @drv: maple driver to unregister.
+ *
+ * Cleans up after maple_driver_register(). To be invoked in the exit
+ * path of any module drivers.
+ */
+void maple_driver_unregister(struct maple_driver *drv)
+{
+       driver_unregister(&drv->drv);
+}
+EXPORT_SYMBOL_GPL(maple_driver_unregister);
+
 /* set hardware registers to enable next round of dma */
 static void maplebus_dma_reset(void)
 {
@@ -129,13 +147,13 @@ static void maple_release_device(struct device *dev)
        kfree(mdev);
 }
 
-/*
+/**
  * maple_add_packet - add a single instruction to the queue
- * @mdev - maple device
- * @function - function on device being queried
- * @command - maple command to add
- * @length - length of command string (in 32 bit words)
- * @data - remainder of command string
+ * @mdev: maple device
+ * @function: function on device being queried
+ * @command: maple command to add
+ * @length: length of command string (in 32 bit words)
+ * @data: remainder of command string
  */
 int maple_add_packet(struct maple_device *mdev, u32 function, u32 command,
        size_t length, void *data)
@@ -176,14 +194,15 @@ out:
 }
 EXPORT_SYMBOL_GPL(maple_add_packet);
 
-/*
+/**
  * maple_add_packet_sleeps - add a single instruction to the queue
- *  - waits for lock to be free
- * @mdev - maple device
- * @function - function on device being queried
- * @command - maple command to add
- * @length - length of command string (in 32 bit words)
- * @data - remainder of command string
+ * @mdev: maple device
+ * @function: function on device being queried
+ * @command: maple command to add
+ * @length: length of command string (in 32 bit words)
+ * @data: remainder of command string
+ *
+ * Same as maple_add_packet(), but waits for the lock to become free.
  */
 int maple_add_packet_sleeps(struct maple_device *mdev, u32 function,
        u32 command, size_t length, void *data)
@@ -724,11 +743,9 @@ static int maple_get_dma_buffer(void)
 static int match_maple_bus_driver(struct device *devptr,
                                  struct device_driver *drvptr)
 {
-       struct maple_driver *maple_drv;
-       struct maple_device *maple_dev;
+       struct maple_driver *maple_drv = to_maple_driver(drvptr);
+       struct maple_device *maple_dev = to_maple_dev(devptr);
 
-       maple_drv = container_of(drvptr, struct maple_driver, drv);
-       maple_dev = container_of(devptr, struct maple_device, dev);
        /* Trap empty port case */
        if (maple_dev->devinfo.function == 0xFFFFFFFF)
                return 0;
index 0c71656..95190c6 100644 (file)
@@ -184,7 +184,8 @@ static void atmel_spi_next_xfer(struct spi_master *master,
 {
        struct atmel_spi        *as = spi_master_get_devdata(master);
        struct spi_transfer     *xfer;
-       u32                     len, remaining, total;
+       u32                     len, remaining;
+       u32                     ieval;
        dma_addr_t              tx_dma, rx_dma;
 
        if (!as->current_transfer)
@@ -197,6 +198,8 @@ static void atmel_spi_next_xfer(struct spi_master *master,
                xfer = NULL;
 
        if (xfer) {
+               spi_writel(as, PTCR, SPI_BIT(RXTDIS) | SPI_BIT(TXTDIS));
+
                len = xfer->len;
                atmel_spi_next_xfer_data(master, xfer, &tx_dma, &rx_dma, &len);
                remaining = xfer->len - len;
@@ -234,6 +237,8 @@ static void atmel_spi_next_xfer(struct spi_master *master,
        as->next_transfer = xfer;
 
        if (xfer) {
+               u32     total;
+
                total = len;
                atmel_spi_next_xfer_data(master, xfer, &tx_dma, &rx_dma, &len);
                as->next_remaining_bytes = total - len;
@@ -250,9 +255,11 @@ static void atmel_spi_next_xfer(struct spi_master *master,
                        "  next xfer %p: len %u tx %p/%08x rx %p/%08x\n",
                        xfer, xfer->len, xfer->tx_buf, xfer->tx_dma,
                        xfer->rx_buf, xfer->rx_dma);
+               ieval = SPI_BIT(ENDRX) | SPI_BIT(OVRES);
        } else {
                spi_writel(as, RNCR, 0);
                spi_writel(as, TNCR, 0);
+               ieval = SPI_BIT(RXBUFF) | SPI_BIT(ENDRX) | SPI_BIT(OVRES);
        }
 
        /* REVISIT: We're waiting for ENDRX before we start the next
@@ -265,7 +272,7 @@ static void atmel_spi_next_xfer(struct spi_master *master,
         *
         * It should be doable, though. Just not now...
         */
-       spi_writel(as, IER, SPI_BIT(ENDRX) | SPI_BIT(OVRES));
+       spi_writel(as, IER, ieval);
        spi_writel(as, PTCR, SPI_BIT(TXTEN) | SPI_BIT(RXTEN));
 }
 
@@ -396,7 +403,7 @@ atmel_spi_interrupt(int irq, void *dev_id)
 
                ret = IRQ_HANDLED;
 
-               spi_writel(as, IDR, (SPI_BIT(ENDTX) | SPI_BIT(ENDRX)
+               spi_writel(as, IDR, (SPI_BIT(RXBUFF) | SPI_BIT(ENDRX)
                                     | SPI_BIT(OVRES)));
 
                /*
@@ -418,7 +425,7 @@ atmel_spi_interrupt(int irq, void *dev_id)
                if (xfer->delay_usecs)
                        udelay(xfer->delay_usecs);
 
-               dev_warn(master->dev.parent, "fifo overrun (%u/%u remaining)\n",
+               dev_warn(master->dev.parent, "overrun (%u/%u remaining)\n",
                         spi_readl(as, TCR), spi_readl(as, RCR));
 
                /*
@@ -442,7 +449,7 @@ atmel_spi_interrupt(int irq, void *dev_id)
                spi_readl(as, SR);
 
                atmel_spi_msg_done(master, as, msg, -EIO, 0);
-       } else if (pending & SPI_BIT(ENDRX)) {
+       } else if (pending & (SPI_BIT(RXBUFF) | SPI_BIT(ENDRX))) {
                ret = IRQ_HANDLED;
 
                spi_writel(as, IDR, pending);
index 1c643c9..21661c7 100644 (file)
@@ -236,6 +236,19 @@ static irqreturn_t s3c24xx_spi_irq(int irq, void *dev)
        return IRQ_HANDLED;
 }
 
+static void s3c24xx_spi_initialsetup(struct s3c24xx_spi *hw)
+{
+       /* for the moment, permanently enable the clock */
+
+       clk_enable(hw->clk);
+
+       /* program defaults into the registers */
+
+       writeb(0xff, hw->regs + S3C2410_SPPRE);
+       writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
+       writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
+}
+
 static int __init s3c24xx_spi_probe(struct platform_device *pdev)
 {
        struct s3c2410_spi_info *pdata;
@@ -327,15 +340,7 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
                goto err_no_clk;
        }
 
-       /* for the moment, permanently enable the clock */
-
-       clk_enable(hw->clk);
-
-       /* program defaults into the registers */
-
-       writeb(0xff, hw->regs + S3C2410_SPPRE);
-       writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
-       writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
+       s3c24xx_spi_initialsetup(hw);
 
        /* setup any gpio we can */
 
@@ -415,7 +420,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev)
 {
        struct s3c24xx_spi *hw = platform_get_drvdata(pdev);
 
-       clk_enable(hw->clk);
+       s3c24xx_spi_initialsetup(hw);
        return 0;
 }
 
index 2eb48c0..ef7b0d6 100644 (file)
@@ -69,7 +69,8 @@ struct ar7_wdt {
        u32 prescale;
 };
 
-static struct semaphore open_semaphore;
+static unsigned long wdt_is_open;
+static spinlock_t wdt_lock;
 static unsigned expect_close;
 
 /* XXX currently fixed, allows max margin ~68.72 secs */
@@ -154,8 +155,10 @@ static void ar7_wdt_update_margin(int new_margin)
        u32 change;
 
        change = new_margin * (ar7_vbus_freq() / prescale_value);
-       if (change < 1) change = 1;
-       if (change > 0xffff) change = 0xffff;
+       if (change < 1)
+               change = 1;
+       if (change > 0xffff)
+               change = 0xffff;
        ar7_wdt_change(change);
        margin = change * prescale_value / ar7_vbus_freq();
        printk(KERN_INFO DRVNAME
@@ -179,7 +182,7 @@ static void ar7_wdt_disable_wdt(void)
 static int ar7_wdt_open(struct inode *inode, struct file *file)
 {
        /* only allow one at a time */
-       if (down_trylock(&open_semaphore))
+       if (test_and_set_bit(0, &wdt_is_open))
                return -EBUSY;
        ar7_wdt_enable_wdt();
        expect_close = 0;
@@ -195,9 +198,7 @@ static int ar7_wdt_release(struct inode *inode, struct file *file)
                "will not disable the watchdog timer\n");
        else if (!nowayout)
                ar7_wdt_disable_wdt();
-
-       up(&open_semaphore);
-
+       clear_bit(0, &wdt_is_open);
        return 0;
 }
 
@@ -222,7 +223,9 @@ static ssize_t ar7_wdt_write(struct file *file, const char *data,
        if (len) {
                size_t i;
 
+               spin_lock(&wdt_lock);
                ar7_wdt_kick(1);
+               spin_unlock(&wdt_lock);
 
                expect_close = 0;
                for (i = 0; i < len; ++i) {
@@ -237,8 +240,8 @@ static ssize_t ar7_wdt_write(struct file *file, const char *data,
        return len;
 }
 
-static int ar7_wdt_ioctl(struct inode *inode, struct file *file,
-                        unsigned int cmd, unsigned long arg)
+static long ar7_wdt_ioctl(struct file *file,
+                                       unsigned int cmd, unsigned long arg)
 {
        static struct watchdog_info ident = {
                .identity = LONGNAME,
@@ -269,8 +272,10 @@ static int ar7_wdt_ioctl(struct inode *inode, struct file *file,
                if (new_margin < 1)
                        return -EINVAL;
 
+               spin_lock(&wdt_lock);
                ar7_wdt_update_margin(new_margin);
                ar7_wdt_kick(1);
+               spin_unlock(&wdt_lock);
 
        case WDIOC_GETTIMEOUT:
                if (put_user(margin, (int *)arg))
@@ -282,7 +287,7 @@ static int ar7_wdt_ioctl(struct inode *inode, struct file *file,
 static const struct file_operations ar7_wdt_fops = {
        .owner          = THIS_MODULE,
        .write          = ar7_wdt_write,
-       .ioctl          = ar7_wdt_ioctl,
+       .unlocked_ioctl = ar7_wdt_ioctl,
        .open           = ar7_wdt_open,
        .release        = ar7_wdt_release,
 };
@@ -297,6 +302,8 @@ static int __init ar7_wdt_init(void)
 {
        int rc;
 
+       spin_lock_init(&wdt_lock);
+
        ar7_wdt_get_regs();
 
        if (!request_mem_region(ar7_regs_wdt, sizeof(struct ar7_wdt),
@@ -312,8 +319,6 @@ static int __init ar7_wdt_init(void)
        ar7_wdt_prescale(prescale_value);
        ar7_wdt_update_margin(margin);
 
-       sema_init(&open_semaphore, 1);
-
        rc = register_reboot_notifier(&ar7_wdt_notifier);
        if (rc) {
                printk(KERN_ERR DRVNAME
index 445b7e8..51bfd57 100644 (file)
@@ -30,9 +30,8 @@
 #include <linux/fs.h>
 #include <linux/pci.h>
 #include <linux/spinlock.h>
-
-#include <asm/uaccess.h>
-#include <asm/io.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>
 
 #define NAME "it8712f_wdt"
 
@@ -50,7 +49,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
 MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close");
 
-static struct semaphore it8712f_wdt_sem;
+static unsigned long wdt_open;
 static unsigned expect_close;
 static spinlock_t io_lock;
 static unsigned char revision;
@@ -86,22 +85,19 @@ static unsigned short address;
 #define WDT_OUT_PWROK  0x10
 #define WDT_OUT_KRST   0x40
 
-static int
-superio_inb(int reg)
+static int superio_inb(int reg)
 {
        outb(reg, REG);
        return inb(VAL);
 }
 
-static void
-superio_outb(int val, int reg)
+static void superio_outb(int val, int reg)
 {
        outb(reg, REG);
        outb(val, VAL);
 }
 
-static int
-superio_inw(int reg)
+static int superio_inw(int reg)
 {
        int val;
        outb(reg++, REG);
@@ -111,15 +107,13 @@ superio_inw(int reg)
        return val;
 }
 
-static inline void
-superio_select(int ldn)
+static inline void superio_select(int ldn)
 {
        outb(LDN, REG);
        outb(ldn, VAL);
 }
 
-static inline void
-superio_enter(void)
+static inline void superio_enter(void)
 {
        spin_lock(&io_lock);
        outb(0x87, REG);
@@ -128,22 +122,19 @@ superio_enter(void)
        outb(0x55, REG);
 }
 
-static inline void
-superio_exit(void)
+static inline void superio_exit(void)
 {
        outb(0x02, REG);
        outb(0x02, VAL);
        spin_unlock(&io_lock);
 }
 
-static inline void
-it8712f_wdt_ping(void)
+static inline void it8712f_wdt_ping(void)
 {
        inb(address);
 }
 
-static void
-it8712f_wdt_update_margin(void)
+static void it8712f_wdt_update_margin(void)
 {
        int config = WDT_OUT_KRST | WDT_OUT_PWROK;
        int units = margin;
@@ -165,8 +156,7 @@ it8712f_wdt_update_margin(void)
        superio_outb(units, WDT_TIMEOUT);
 }
 
-static int
-it8712f_wdt_get_status(void)
+static int it8712f_wdt_get_status(void)
 {
        if (superio_inb(WDT_CONTROL) & 0x01)
                return WDIOF_CARDRESET;
@@ -174,8 +164,7 @@ it8712f_wdt_get_status(void)
                return 0;
 }
 
-static void
-it8712f_wdt_enable(void)
+static void it8712f_wdt_enable(void)
 {
        printk(KERN_DEBUG NAME ": enabling watchdog timer\n");
        superio_enter();
@@ -190,8 +179,7 @@ it8712f_wdt_enable(void)
        it8712f_wdt_ping();
 }
 
-static void
-it8712f_wdt_disable(void)
+static void it8712f_wdt_disable(void)
 {
        printk(KERN_DEBUG NAME ": disabling watchdog timer\n");
 
@@ -207,8 +195,7 @@ it8712f_wdt_disable(void)
        superio_exit();
 }
 
-static int
-it8712f_wdt_notify(struct notifier_block *this,
+static int it8712f_wdt_notify(struct notifier_block *this,
                    unsigned long code, void *unused)
 {
        if (code == SYS_HALT || code == SYS_POWER_OFF)
@@ -222,9 +209,8 @@ static struct notifier_block it8712f_wdt_notifier = {
        .notifier_call = it8712f_wdt_notify,
 };
 
-static ssize_t
-it8712f_wdt_write(struct file *file, const char __user *data,
-       size_t len, loff_t *ppos)
+static ssize_t it8712f_wdt_write(struct file *file, const char __user *data,
+                                       size_t len, loff_t *ppos)
 {
        /* check for a magic close character */
        if (len) {
@@ -245,9 +231,8 @@ it8712f_wdt_write(struct file *file, const char __user *data,
        return len;
 }
 
-static int
-it8712f_wdt_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
+static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd,
+                                                       unsigned long arg)
 {
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
@@ -302,19 +287,16 @@ it8712f_wdt_ioctl(struct inode *inode, struct file *file,
        }
 }
 
-static int
-it8712f_wdt_open(struct inode *inode, struct file *file)
+static int it8712f_wdt_open(struct inode *inode, struct file *file)
 {
        /* only allow one at a time */
-       if (down_trylock(&it8712f_wdt_sem))
+       if (test_and_set_bit(0, &wdt_open))
                return -EBUSY;
        it8712f_wdt_enable();
-
        return nonseekable_open(inode, file);
 }
 
-static int
-it8712f_wdt_release(struct inode *inode, struct file *file)
+static int it8712f_wdt_release(struct inode *inode, struct file *file)
 {
        if (expect_close != 42) {
                printk(KERN_WARNING NAME
@@ -324,7 +306,7 @@ it8712f_wdt_release(struct inode *inode, struct file *file)
                it8712f_wdt_disable();
        }
        expect_close = 0;
-       up(&it8712f_wdt_sem);
+       clear_bit(0, &wdt_open);
 
        return 0;
 }
@@ -333,7 +315,7 @@ static const struct file_operations it8712f_wdt_fops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .write = it8712f_wdt_write,
-       .ioctl = it8712f_wdt_ioctl,
+       .unlocked_ioctl = it8712f_wdt_ioctl,
        .open = it8712f_wdt_open,
        .release = it8712f_wdt_release,
 };
@@ -344,8 +326,7 @@ static struct miscdevice it8712f_wdt_miscdev = {
        .fops = &it8712f_wdt_fops,
 };
 
-static int __init
-it8712f_wdt_find(unsigned short *address)
+static int __init it8712f_wdt_find(unsigned short *address)
 {
        int err = -ENODEV;
        int chip_type;
@@ -387,8 +368,7 @@ exit:
        return err;
 }
 
-static int __init
-it8712f_wdt_init(void)
+static int __init it8712f_wdt_init(void)
 {
        int err = 0;
 
@@ -404,8 +384,6 @@ it8712f_wdt_init(void)
 
        it8712f_wdt_disable();
 
-       sema_init(&it8712f_wdt_sem, 1);
-
        err = register_reboot_notifier(&it8712f_wdt_notifier);
        if (err) {
                printk(KERN_ERR NAME ": unable to register reboot notifier\n");
@@ -430,8 +408,7 @@ out:
        return err;
 }
 
-static void __exit
-it8712f_wdt_exit(void)
+static void __exit it8712f_wdt_exit(void)
 {
        misc_deregister(&it8712f_wdt_miscdev);
        unregister_reboot_notifier(&it8712f_wdt_notifier);
index 98532c0..97b4a2e 100644 (file)
@@ -46,9 +46,8 @@
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
 #include <linux/clk.h>
-
-#include <asm/uaccess.h>
-#include <asm/io.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>
 
 #include <asm/arch/map.h>
 
@@ -65,8 +64,8 @@
 static int nowayout    = WATCHDOG_NOWAYOUT;
 static int tmr_margin  = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME;
 static int tmr_atboot  = CONFIG_S3C2410_WATCHDOG_ATBOOT;
-static int soft_noboot = 0;
-static int debug       = 0;
+static int soft_noboot;
+static int debug;
 
 module_param(tmr_margin,  int, 0);
 module_param(tmr_atboot,  int, 0);
@@ -74,24 +73,23 @@ module_param(nowayout,    int, 0);
 module_param(soft_noboot, int, 0);
 module_param(debug,      int, 0);
 
-MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. default=" __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")");
-
-MODULE_PARM_DESC(tmr_atboot, "Watchdog is started at boot time if set to 1, default=" __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_ATBOOT));
-
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
+MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. default="
+               __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")");
+MODULE_PARM_DESC(tmr_atboot,
+               "Watchdog is started at boot time if set to 1, default="
+                       __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_ATBOOT));
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
+                       __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, 0 to reboot (default depends on ONLY_TESTING)");
-
 MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug, (default 0)");
 
 
 typedef enum close_state {
        CLOSE_STATE_NOT,
-       CLOSE_STATE_ALLOW=0x4021
+       CLOSE_STATE_ALLOW = 0x4021
 } close_state_t;
 
-static DECLARE_MUTEX(open_lock);
-
+static unsigned long open_lock;
 static struct device    *wdt_dev;      /* platform device attached to */
 static struct resource *wdt_mem;
 static struct resource *wdt_irq;
@@ -99,38 +97,58 @@ static struct clk   *wdt_clock;
 static void __iomem    *wdt_base;
 static unsigned int     wdt_count;
 static close_state_t    allow_close;
+static DEFINE_SPINLOCK(wdt_lock);
 
 /* watchdog control routines */
 
 #define DBG(msg...) do { \
        if (debug) \
                printk(KERN_INFO msg); \
-       } while(0)
+       } while (0)
 
 /* functions */
 
-static int s3c2410wdt_keepalive(void)
+static void s3c2410wdt_keepalive(void)
 {
+       spin_lock(&wdt_lock);
        writel(wdt_count, wdt_base + S3C2410_WTCNT);
-       return 0;
+       spin_unlock(&wdt_lock);
 }
 
-static int s3c2410wdt_stop(void)
+static void __s3c2410wdt_stop(void)
 {
        unsigned long wtcon;
 
+       spin_lock(&wdt_lock);
        wtcon = readl(wdt_base + S3C2410_WTCON);
        wtcon &= ~(S3C2410_WTCON_ENABLE | S3C2410_WTCON_RSTEN);
        writel(wtcon, wdt_base + S3C2410_WTCON);
+       spin_unlock(&wdt_lock);
+}
 
-       return 0;
+static void __s3c2410wdt_stop(void)
+{
+       unsigned long wtcon;
+
+       wtcon = readl(wdt_base + S3C2410_WTCON);
+       wtcon &= ~(S3C2410_WTCON_ENABLE | S3C2410_WTCON_RSTEN);
+       writel(wtcon, wdt_base + S3C2410_WTCON);
+}
+
+static void s3c2410wdt_stop(void)
+{
+       spin_lock(&wdt_lock);
+       __s3c2410wdt_stop();
+       spin_unlock(&wdt_lock);
 }
 
-static int s3c2410wdt_start(void)
+static void s3c2410wdt_start(void)
 {
        unsigned long wtcon;
 
-       s3c2410wdt_stop();
+       spin_lock(&wdt_lock);
+
+       __s3c2410wdt_stop();
 
        wtcon = readl(wdt_base + S3C2410_WTCON);
        wtcon |= S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128;
@@ -149,6 +167,7 @@ static int s3c2410wdt_start(void)
        writel(wdt_count, wdt_base + S3C2410_WTDAT);
        writel(wdt_count, wdt_base + S3C2410_WTCNT);
        writel(wtcon, wdt_base + S3C2410_WTCON);
+       spin_unlock(&wdt_lock);
 
        return 0;
 }
@@ -211,7 +230,7 @@ static int s3c2410wdt_set_heartbeat(int timeout)
 
 static int s3c2410wdt_open(struct inode *inode, struct file *file)
 {
-       if(down_trylock(&open_lock))
+       if (test_and_set_bit(0, &open_lock))
                return -EBUSY;
 
        if (nowayout)
@@ -231,15 +250,14 @@ static int s3c2410wdt_release(struct inode *inode, struct file *file)
         *      Lock it in if it's a module and we set nowayout
         */
 
-       if (allow_close == CLOSE_STATE_ALLOW) {
+       if (allow_close == CLOSE_STATE_ALLOW)
                s3c2410wdt_stop();
-       else {
+       else {
                dev_err(wdt_dev, "Unexpected close, not stopping watchdog\n");
                s3c2410wdt_keepalive();
        }
-
        allow_close = CLOSE_STATE_NOT;
-       up(&open_lock);
+       clear_bit(0, &open_lock);
        return 0;
 }
 
@@ -249,7 +267,7 @@ static ssize_t s3c2410wdt_write(struct file *file, const char __user *data,
        /*
         *      Refresh the timer.
         */
-       if(len) {
+       if (len) {
                if (!nowayout) {
                        size_t i;
 
@@ -265,7 +283,6 @@ static ssize_t s3c2410wdt_write(struct file *file, const char __user *data,
                                        allow_close = CLOSE_STATE_ALLOW;
                        }
                }
-
                s3c2410wdt_keepalive();
        }
        return len;
@@ -273,48 +290,41 @@ static ssize_t s3c2410wdt_write(struct file *file, const char __user *data,
 
 #define OPTIONS WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE
 
-static struct watchdog_info s3c2410_wdt_ident = {
+static const struct watchdog_info s3c2410_wdt_ident = {
        .options          =     OPTIONS,
        .firmware_version =     0,
        .identity         =     "S3C2410 Watchdog",
 };
 
 
-static int s3c2410wdt_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
+static long s3c2410wdt_ioctl(struct file *file,        unsigned int cmd,
+                                                       unsigned long arg)
 {
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
        int new_margin;
 
        switch (cmd) {
-               default:
-                       return -ENOTTY;
-
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &s3c2410_wdt_ident,
-                               sizeof(s3c2410_wdt_ident)) ? -EFAULT : 0;
-
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-
-               case WDIOC_KEEPALIVE:
-                       s3c2410wdt_keepalive();
-                       return 0;
-
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_margin, p))
-                               return -EFAULT;
-
-                       if (s3c2410wdt_set_heartbeat(new_margin))
-                               return -EINVAL;
-
-                       s3c2410wdt_keepalive();
-                       return put_user(tmr_margin, p);
-
-               case WDIOC_GETTIMEOUT:
-                       return put_user(tmr_margin, p);
+       default:
+               return -ENOTTY;
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(argp, &s3c2410_wdt_ident,
+                       sizeof(s3c2410_wdt_ident)) ? -EFAULT : 0;
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+       case WDIOC_KEEPALIVE:
+               s3c2410wdt_keepalive();
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_margin, p))
+                       return -EFAULT;
+               if (s3c2410wdt_set_heartbeat(new_margin))
+                       return -EINVAL;
+               s3c2410wdt_keepalive();
+               return put_user(tmr_margin, p);
+       case WDIOC_GETTIMEOUT:
+               return put_user(tmr_margin, p);
        }
 }
 
@@ -324,7 +334,7 @@ static const struct file_operations s3c2410wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = s3c2410wdt_write,
-       .ioctl          = s3c2410wdt_ioctl,
+       .unlocked_ioctl = s3c2410wdt_ioctl,
        .open           = s3c2410wdt_open,
        .release        = s3c2410wdt_release,
 };
@@ -411,14 +421,15 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
         * not, try the default value */
 
        if (s3c2410wdt_set_heartbeat(tmr_margin)) {
-               started = s3c2410wdt_set_heartbeat(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME);
+               started = s3c2410wdt_set_heartbeat(
+                                       CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME);
 
-               if (started == 0) {
-                       dev_info(dev,"tmr_margin value out of range, default %d used\n",
+               if (started == 0)
+                       dev_info(dev,
+                          "tmr_margin value out of range, default %d used\n",
                               CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME);
-               } else {
+               else
                        dev_info(dev, "default timer value is out of range, cannot start\n");
-               }
        }
 
        ret = misc_register(&s3c2410wdt_miscdev);
@@ -447,7 +458,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
                 (wtcon & S3C2410_WTCON_ENABLE) ?  "" : "in",
                 (wtcon & S3C2410_WTCON_RSTEN) ? "" : "dis",
                 (wtcon & S3C2410_WTCON_INTEN) ? "" : "en");
-       
+
        return 0;
 
  err_clk:
@@ -487,7 +498,7 @@ static int s3c2410wdt_remove(struct platform_device *dev)
 
 static void s3c2410wdt_shutdown(struct platform_device *dev)
 {
-       s3c2410wdt_stop();      
+       s3c2410wdt_stop();
 }
 
 #ifdef CONFIG_PM
@@ -540,7 +551,8 @@ static struct platform_driver s3c2410wdt_driver = {
 };
 
 
-static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n";
+static char banner[] __initdata =
+       KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n";
 
 static int __init watchdog_init(void)
 {
index 35cddff..621ebad 100644 (file)
  *
  *     Changelog:
  *     20020220 Zwane Mwaikambo        Code based on datasheet, no hardware.
- *     20020221 Zwane Mwaikambo        Cleanups as suggested by Jeff Garzik and Alan Cox.
+ *     20020221 Zwane Mwaikambo        Cleanups as suggested by Jeff Garzik
+ *                                     and Alan Cox.
  *     20020222 Zwane Mwaikambo        Added probing.
  *     20020225 Zwane Mwaikambo        Added ISAPNP support.
  *     20020412 Rob Radez              Broke out start/stop functions
- *              <rob@osinvestor.com>   Return proper status instead of temperature warning
- *                                     Add WDIOC_GETBOOTSTATUS and WDIOC_SETOPTIONS ioctls
+ *              <rob@osinvestor.com>   Return proper status instead of
+ *                                     temperature warning
+ *                                     Add WDIOC_GETBOOTSTATUS and
+ *                                     WDIOC_SETOPTIONS ioctls
  *                                     Fix CONFIG_WATCHDOG_NOWAYOUT
- *     20020530 Joel Becker            Add Matt Domsch's nowayout module option
+ *     20020530 Joel Becker            Add Matt Domsch's nowayout module
+ *                                     option
  *     20030116 Adam Belay             Updated to the latest pnp code
  *
  */
@@ -39,9 +43,8 @@
 #include <linux/pnp.h>
 #include <linux/fs.h>
 #include <linux/semaphore.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
 
 #define SC1200_MODULE_VER      "build 20020303"
 #define SC1200_MODULE_NAME     "sc1200wdt"
@@ -72,7 +75,7 @@ static char banner[] __initdata = KERN_INFO PFX SC1200_MODULE_VER;
 static int timeout = 1;
 static int io = -1;
 static int io_len = 2;         /* for non plug and play */
-static struct semaphore open_sem;
+static unsigned long open_flag;
 static char expect_close;
 static DEFINE_SPINLOCK(sc1200wdt_lock);        /* io port access serialisation */
 
@@ -81,7 +84,8 @@ static int isapnp = 1;
 static struct pnp_dev *wdt_dev;
 
 module_param(isapnp, int, 0);
-MODULE_PARM_DESC(isapnp, "When set to 0 driver ISA PnP support will be disabled");
+MODULE_PARM_DESC(isapnp,
+       "When set to 0 driver ISA PnP support will be disabled");
 #endif
 
 module_param(io, int, 0);
@@ -91,26 +95,40 @@ MODULE_PARM_DESC(timeout, "range is 0-255 minutes, default is 1");
 
 static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+MODULE_PARM_DESC(nowayout,
+       "Watchdog cannot be stopped once started (default="
+                               __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 
 
 
 /* Read from Data Register */
-static inline void sc1200wdt_read_data(unsigned char index, unsigned char *data)
+static inline void __sc1200wdt_read_data(unsigned char index,
+                                               unsigned char *data)
 {
-       spin_lock(&sc1200wdt_lock);
        outb_p(index, PMIR);
        *data = inb(PMDR);
-       spin_unlock(&sc1200wdt_lock);
 }
 
+static void sc1200wdt_read_data(unsigned char index, unsigned char *data)
+{
+       spin_lock(&sc1200wdt_lock);
+       __sc1200wdt_read_data(index, data);
+       spin_unlock(&sc1200wdt_lock);
+}
 
 /* Write to Data Register */
-static inline void sc1200wdt_write_data(unsigned char index, unsigned char data)
+static inline void __sc1200wdt_write_data(unsigned char index,
+                                               unsigned char data)
 {
-       spin_lock(&sc1200wdt_lock);
        outb_p(index, PMIR);
        outb(data, PMDR);
+}
+
+static inline void sc1200wdt_write_data(unsigned char index,
+                                               unsigned char data)
+{
+       spin_lock(&sc1200wdt_lock);
+       __sc1200wdt_write_data(index, data);
        spin_unlock(&sc1200wdt_lock);
 }
 
@@ -118,22 +136,23 @@ static inline void sc1200wdt_write_data(unsigned char index, unsigned char data)
 static void sc1200wdt_start(void)
 {
        unsigned char reg;
+       spin_lock(&sc1200wdt_lock);
 
-       sc1200wdt_read_data(WDCF, &reg);
+       __sc1200wdt_read_data(WDCF, &reg);
        /* assert WDO when any of the following interrupts are triggered too */
        reg |= (KBC_IRQ | MSE_IRQ | UART1_IRQ | UART2_IRQ);
-       sc1200wdt_write_data(WDCF, reg);
+       __sc1200wdt_write_data(WDCF, reg);
        /* set the timeout and get the ball rolling */
-       sc1200wdt_write_data(WDTO, timeout);
-}
+       __sc1200wdt_write_data(WDTO, timeout);
 
+       spin_unlock(&sc1200wdt_lock);
+}
 
 static void sc1200wdt_stop(void)
 {
        sc1200wdt_write_data(WDTO, 0);
 }
 
-
 /* This returns the status of the WDO signal, inactive high. */
 static inline int sc1200wdt_status(void)
 {
@@ -144,14 +163,13 @@ static inline int sc1200wdt_status(void)
         * KEEPALIVEPING which is a bit of a kludge because there's nothing
         * else for enabled/disabled status
         */
-       return (ret & 0x01) ? 0 : WDIOF_KEEPALIVEPING;  /* bits 1 - 7 are undefined */
+       return (ret & 0x01) ? 0 : WDIOF_KEEPALIVEPING;
 }
 
-
 static int sc1200wdt_open(struct inode *inode, struct file *file)
 {
        /* allow one at a time */
-       if (down_trylock(&open_sem))
+       if (test_and_set_bit(0, &open_flag))
                return -EBUSY;
 
        if (timeout > MAX_TIMEOUT)
@@ -164,71 +182,71 @@ static int sc1200wdt_open(struct inode *inode, struct file *file)
 }
 
 
-static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static long sc1200wdt_ioctl(struct file *file, unsigned int cmd,
+                                               unsigned long arg)
 {
        int new_timeout;
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+       static const struct watchdog_info ident = {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
+                                                       WDIOF_MAGICCLOSE,
                .firmware_version = 0,
                .identity = "PC87307/PC97307",
        };
 
        switch (cmd) {
-               default:
-                       return -ENOTTY;
-
-               case WDIOC_GETSUPPORT:
-                       if (copy_to_user(argp, &ident, sizeof ident))
-                               return -EFAULT;
-                       return 0;
-
-               case WDIOC_GETSTATUS:
-                       return put_user(sc1200wdt_status(), p);
-
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-
-               case WDIOC_KEEPALIVE:
-                       sc1200wdt_write_data(WDTO, timeout);
-                       return 0;
 
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_timeout, p))
-                               return -EFAULT;
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &ident, sizeof ident))
+                       return -EFAULT;
+               return 0;
 
-                       /* the API states this is given in secs */
-                       new_timeout /= 60;
-                       if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
-                               return -EINVAL;
+       case WDIOC_GETSTATUS:
+               return put_user(sc1200wdt_status(), p);
 
-                       timeout = new_timeout;
-                       sc1200wdt_write_data(WDTO, timeout);
-                       /* fall through and return the new timeout */
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
 
-               case WDIOC_GETTIMEOUT:
-                       return put_user(timeout * 60, p);
+       case WDIOC_KEEPALIVE:
+               sc1200wdt_write_data(WDTO, timeout);
+               return 0;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, p))
+                       return -EFAULT;
+               /* the API states this is given in secs */
+               new_timeout /= 60;
+               if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
+                       return -EINVAL;
+               timeout = new_timeout;
+               sc1200wdt_write_data(WDTO, timeout);
+               /* fall through and return the new timeout */
 
-               case WDIOC_SETOPTIONS:
-               {
-                       int options, retval = -EINVAL;
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout * 60, p);
 
-                       if (get_user(options, p))
-                               return -EFAULT;
+       case WDIOC_SETOPTIONS:
+       {
+               int options, retval = -EINVAL;
 
-                       if (options & WDIOS_DISABLECARD) {
-                               sc1200wdt_stop();
-                               retval = 0;
-                       }
+               if (get_user(options, p))
+                       return -EFAULT;
 
-                       if (options & WDIOS_ENABLECARD) {
-                               sc1200wdt_start();
-                               retval = 0;
-                       }
+               if (options & WDIOS_DISABLECARD) {
+                       sc1200wdt_stop();
+                       retval = 0;
+               }
 
-                       return retval;
+               if (options & WDIOS_ENABLECARD) {
+                       sc1200wdt_start();
+                       retval = 0;
                }
+
+               return retval;
+       }
+       default:
+               return -ENOTTY;
        }
 }
 
@@ -240,16 +258,18 @@ static int sc1200wdt_release(struct inode *inode, struct file *file)
                printk(KERN_INFO PFX "Watchdog disabled\n");
        } else {
                sc1200wdt_write_data(WDTO, timeout);
-               printk(KERN_CRIT PFX "Unexpected close!, timeout = %d min(s)\n", timeout);
+               printk(KERN_CRIT PFX
+                       "Unexpected close!, timeout = %d min(s)\n", timeout);
        }
-       up(&open_sem);
+       clear_bit(0, &open_flag);
        expect_close = 0;
 
        return 0;
 }
 
 
-static ssize_t sc1200wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
+static ssize_t sc1200wdt_write(struct file *file, const char __user *data,
+                                               size_t len, loff_t *ppos)
 {
        if (len) {
                if (!nowayout) {
@@ -275,7 +295,8 @@ static ssize_t sc1200wdt_write(struct file *file, const char __user *data, size_
 }
 
 
-static int sc1200wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
+static int sc1200wdt_notify_sys(struct notifier_block *this,
+                                       unsigned long code, void *unused)
 {
        if (code == SYS_DOWN || code == SYS_HALT)
                sc1200wdt_stop();
@@ -284,23 +305,20 @@ static int sc1200wdt_notify_sys(struct notifier_block *this, unsigned long code,
 }
 
 
-static struct notifier_block sc1200wdt_notifier =
-{
+static struct notifier_block sc1200wdt_notifier = {
        .notifier_call =        sc1200wdt_notify_sys,
 };
 
-static const struct file_operations sc1200wdt_fops =
-{
+static const struct file_operations sc1200wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = sc1200wdt_write,
-       .ioctl          = sc1200wdt_ioctl,
+       .unlocked_ioctl = sc1200wdt_ioctl,
        .open           = sc1200wdt_open,
        .release        = sc1200wdt_release,
 };
 
-static struct miscdevice sc1200wdt_miscdev =
-{
+static struct miscdevice sc1200wdt_miscdev = {
        .minor          = WATCHDOG_MINOR,
        .name           = "watchdog",
        .fops           = &sc1200wdt_fops,
@@ -312,14 +330,14 @@ static int __init sc1200wdt_probe(void)
        /* The probe works by reading the PMC3 register's default value of 0x0e
         * there is one caveat, if the device disables the parallel port or any
         * of the UARTs we won't be able to detect it.
-        * Nb. This could be done with accuracy by reading the SID registers, but
-        * we don't have access to those io regions.
+        * NB. This could be done with accuracy by reading the SID registers,
+        * but we don't have access to those io regions.
         */
 
        unsigned char reg;
 
        sc1200wdt_read_data(PMC3, &reg);
-       reg &= 0x0f;                            /* we don't want the UART busy bits */
+       reg &= 0x0f;            /* we don't want the UART busy bits */
        return (reg == 0x0e) ? 0 : -ENODEV;
 }
 
@@ -332,7 +350,8 @@ static struct pnp_device_id scl200wdt_pnp_devices[] = {
        {.id = ""},
 };
 
-static int scl200wdt_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id)
+static int scl200wdt_pnp_probe(struct pnp_dev *dev,
+                                       const struct pnp_device_id *dev_id)
 {
        /* this driver only supports one card at a time */
        if (wdt_dev || !isapnp)
@@ -347,13 +366,14 @@ static int scl200wdt_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id
                return -EBUSY;
        }
 
-       printk(KERN_INFO "scl200wdt: PnP device found at io port %#x/%d\n", io, io_len);
+       printk(KERN_INFO "scl200wdt: PnP device found at io port %#x/%d\n",
+                                                               io, io_len);
        return 0;
 }
 
-static void scl200wdt_pnp_remove(struct pnp_dev * dev)
+static void scl200wdt_pnp_remove(struct pnp_dev *dev)
 {
-       if (wdt_dev){
+       if (wdt_dev) {
                release_region(io, io_len);
                wdt_dev = NULL;
        }
@@ -375,8 +395,6 @@ static int __init sc1200wdt_init(void)
 
        printk("%s\n", banner);
 
-       sema_init(&open_sem, 1);
-
 #if defined CONFIG_PNP
        if (isapnp) {
                ret = pnp_register_driver(&scl200wdt_pnp_driver);
@@ -410,13 +428,16 @@ static int __init sc1200wdt_init(void)
 
        ret = register_reboot_notifier(&sc1200wdt_notifier);
        if (ret) {
-               printk(KERN_ERR PFX "Unable to register reboot notifier err = %d\n", ret);
+               printk(KERN_ERR PFX
+                       "Unable to register reboot notifier err = %d\n", ret);
                goto out_io;
        }
 
        ret = misc_register(&sc1200wdt_miscdev);
        if (ret) {
-               printk(KERN_ERR PFX "Unable to register miscdev on minor %d\n", WATCHDOG_MINOR);
+               printk(KERN_ERR PFX
+                       "Unable to register miscdev on minor %d\n",
+                                                       WATCHDOG_MINOR);
                goto out_rbt;
        }
 
@@ -446,7 +467,7 @@ static void __exit sc1200wdt_exit(void)
        unregister_reboot_notifier(&sc1200wdt_notifier);
 
 #if defined CONFIG_PNP
-       if(isapnp)
+       if (isapnp)
                pnp_unregister_driver(&scl200wdt_pnp_driver);
        else
 #endif
index 756fb15..53a6b18 100644 (file)
  *                                     Matt Crocker).
  *             Alan Cox        :       Added wdt= boot option
  *             Alan Cox        :       Cleaned up copy/user stuff
- *             Tim Hockin      :       Added insmod parameters, comment cleanup
- *                                     Parameterized timeout
- *             Tigran Aivazian :       Restructured wdt_init() to handle failures
+ *             Tim Hockin      :       Added insmod parameters, comment
+ *                                     cleanup, parameterized timeout
+ *             Tigran Aivazian :       Restructured wdt_init() to handle
+ *                                     failures
  *             Joel Becker     :       Added WDIOC_GET/SETTIMEOUT
  *             Matt Domsch     :       Added nowayout module option
  */
@@ -42,9 +43,9 @@
 #include <linux/notifier.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
 
-#include <asm/io.h>
-#include <asm/uaccess.h>
 #include <asm/system.h>
 #include "wd501p.h"
 
@@ -60,15 +61,19 @@ static char expect_close;
 static int heartbeat = WD_TIMO;
 static int wd_heartbeat;
 module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")");
+MODULE_PARM_DESC(heartbeat,
+       "Watchdog heartbeat in seconds. (0 < heartbeat < 65536, default="
+                               __MODULE_STRING(WD_TIMO) ")");
 
 static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+MODULE_PARM_DESC(nowayout,
+       "Watchdog cannot be stopped once started (default="
+                               __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 
 /* You must set these - there is no sane way to probe for this board. */
-static int io=0x240;
-static int irq=11;
+static int io = 0x240;
+static int irq = 11;
 
 static DEFINE_SPINLOCK(wdt_lock);
 
@@ -82,7 +87,8 @@ MODULE_PARM_DESC(irq, "WDT irq (default=11)");
 static int tachometer;
 
 module_param(tachometer, int, 0);
-MODULE_PARM_DESC(tachometer, "WDT501-P Fan Tachometer support (0=disable, default=0)");
+MODULE_PARM_DESC(tachometer,
+               "WDT501-P Fan Tachometer support (0=disable, default=0)");
 #endif /* CONFIG_WDT_501 */
 
 /*
@@ -91,9 +97,9 @@ MODULE_PARM_DESC(tachometer, "WDT501-P Fan Tachometer support (0=disable, defaul
 
 static void wdt_ctr_mode(int ctr, int mode)
 {
-       ctr<<=6;
-       ctr|=0x30;
-       ctr|=(mode<<1);
+       ctr <<= 6;
+       ctr |= 0x30;
+       ctr |= (mode << 1);
        outb_p(ctr, WDT_CR);
 }
 
@@ -114,12 +120,15 @@ static int wdt_start(void)
        unsigned long flags;
        spin_lock_irqsave(&wdt_lock, flags);
        inb_p(WDT_DC);                  /* Disable watchdog */
-       wdt_ctr_mode(0,3);              /* Program CTR0 for Mode 3: Square Wave Generator */
-       wdt_ctr_mode(1,2);              /* Program CTR1 for Mode 2: Rate Generator */
-       wdt_ctr_mode(2,0);              /* Program CTR2 for Mode 0: Pulse on Terminal Count */
+       wdt_ctr_mode(0, 3);             /* Program CTR0 for Mode 3:
+                                               Square Wave Generator */
+       wdt_ctr_mode(1, 2);             /* Program CTR1 for Mode 2:
+                                               Rate Generator */
+       wdt_ctr_mode(2, 0);             /* Program CTR2 for Mode 0:
+                                               Pulse on Terminal Count */
        wdt_ctr_load(0, 8948);          /* Count at 100Hz */
-       wdt_ctr_load(1,wd_heartbeat);   /* Heartbeat */
-       wdt_ctr_load(2,65535);          /* Length of reset pulse */
+       wdt_ctr_load(1, wd_heartbeat);  /* Heartbeat */
+       wdt_ctr_load(2, 65535);         /* Length of reset pulse */
        outb_p(0, WDT_DC);              /* Enable watchdog */
        spin_unlock_irqrestore(&wdt_lock, flags);
        return 0;
@@ -131,13 +140,13 @@ static int wdt_start(void)
  *     Stop the watchdog driver.
  */
 
-static int wdt_stop (void)
+static int wdt_stop(void)
 {
        unsigned long flags;
        spin_lock_irqsave(&wdt_lock, flags);
        /* Turn the card off */
        inb_p(WDT_DC);                  /* Disable watchdog */
-       wdt_ctr_load(2,0);              /* 0 length reset pulses now */
+       wdt_ctr_load(2, 0);             /* 0 length reset pulses now */
        spin_unlock_irqrestore(&wdt_lock, flags);
        return 0;
 }
@@ -145,8 +154,8 @@ static int wdt_stop (void)
 /**
  *     wdt_ping:
  *
- *     Reload counter one with the watchdog heartbeat. We don't bother reloading
- *     the cascade counter.
+ *     Reload counter one with the watchdog heartbeat. We don't bother
+ *     reloading the cascade counter.
  */
 
 static int wdt_ping(void)
@@ -155,8 +164,9 @@ static int wdt_ping(void)
        spin_lock_irqsave(&wdt_lock, flags);
        /* Write a watchdog value */
        inb_p(WDT_DC);                  /* Disable watchdog */
-       wdt_ctr_mode(1,2);              /* Re-Program CTR1 for Mode 2: Rate Generator */
-       wdt_ctr_load(1,wd_heartbeat);   /* Heartbeat */
+       wdt_ctr_mode(1, 2);             /* Re-Program CTR1 for Mode 2:
+                                                       Rate Generator */
+       wdt_ctr_load(1, wd_heartbeat);  /* Heartbeat */
        outb_p(0, WDT_DC);              /* Enable watchdog */
        spin_unlock_irqrestore(&wdt_lock, flags);
        return 0;
@@ -166,13 +176,14 @@ static int wdt_ping(void)
  *     wdt_set_heartbeat:
  *     @t:             the new heartbeat value that needs to be set.
  *
- *     Set a new heartbeat value for the watchdog device. If the heartbeat value is
- *     incorrect we keep the old value and return -EINVAL. If successfull we
- *     return 0.
+ *     Set a new heartbeat value for the watchdog device. If the heartbeat
+ *     value is incorrect we keep the old value and return -EINVAL. If
+ *     successful we return 0.
  */
+
 static int wdt_set_heartbeat(int t)
 {
-       if ((t < 1) || (t > 65535))
+       if (t < 1 || t > 65535)
                return -EINVAL;
 
        heartbeat = t;
@@ -200,7 +211,7 @@ static int wdt_get_status(int *status)
        new_status = inb_p(WDT_SR);
        spin_unlock_irqrestore(&wdt_lock, flags);
 
-       *status=0;
+       *status = 0;
        if (new_status & WDC_SR_ISOI0)
                *status |= WDIOF_EXTERN1;
        if (new_status & WDC_SR_ISII1)
@@ -266,7 +277,7 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id)
 
 #ifdef CONFIG_WDT_501
        if (!(status & WDC_SR_TGOOD))
-               printk(KERN_CRIT "Overheat alarm.(%d)\n",inb_p(WDT_RT));
+               printk(KERN_CRIT "Overheat alarm.(%d)\n", inb_p(WDT_RT));
        if (!(status & WDC_SR_PSUOVER))
                printk(KERN_CRIT "PSU over voltage.\n");
        if (!(status & WDC_SR_PSUUNDR))
@@ -304,9 +315,10 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id)
  *     write of data will do, as we we don't define content meaning.
  */
 
-static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+static ssize_t wdt_write(struct file *file, const char __user *buf,
+                                               size_t count, loff_t *ppos)
 {
-       if(count) {
+       if (count) {
                if (!nowayout) {
                        size_t i;
 
@@ -328,7 +340,6 @@ static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count
 
 /**
  *     wdt_ioctl:
- *     @inode: inode of the device
  *     @file: file handle to the device
  *     @cmd: watchdog command
  *     @arg: argument pointer
@@ -338,8 +349,7 @@ static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count
  *     querying capabilities and current status.
  */
 
-static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-       unsigned long arg)
+static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
@@ -362,32 +372,28 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                ident.options |= WDIOF_FANFAULT;
 #endif /* CONFIG_WDT_501 */
 
-       switch(cmd)
-       {
-               default:
-                       return -ENOTTY;
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
-
-               case WDIOC_GETSTATUS:
-                       wdt_get_status(&status);
-                       return put_user(status, p);
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-               case WDIOC_KEEPALIVE:
-                       wdt_ping();
-                       return 0;
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_heartbeat, p))
-                               return -EFAULT;
-
-                       if (wdt_set_heartbeat(new_heartbeat))
-                               return -EINVAL;
-
-                       wdt_ping();
-                       /* Fall */
-               case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, p);
+       switch (cmd) {
+       default:
+               return -ENOTTY;
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
+       case WDIOC_GETSTATUS:
+               wdt_get_status(&status);
+               return put_user(status, p);
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+       case WDIOC_KEEPALIVE:
+               wdt_ping();
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_heartbeat, p))
+                       return -EFAULT;
+               if (wdt_set_heartbeat(new_heartbeat))
+                       return -EINVAL;
+               wdt_ping();
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               return put_user(heartbeat, p);
        }
 }
 
@@ -405,7 +411,7 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
 static int wdt_open(struct inode *inode, struct file *file)
 {
-       if(test_and_set_bit(0, &wdt_is_open))
+       if (test_and_set_bit(0, &wdt_is_open))
                return -EBUSY;
        /*
         *      Activate
@@ -432,7 +438,8 @@ static int wdt_release(struct inode *inode, struct file *file)
                wdt_stop();
                clear_bit(0, &wdt_is_open);
        } else {
-               printk(KERN_CRIT "wdt: WDT device closed unexpectedly.  WDT will not stop!\n");
+               printk(KERN_CRIT
+                "wdt: WDT device closed unexpectedly.  WDT will not stop!\n");
                wdt_ping();
        }
        expect_close = 0;
@@ -451,14 +458,15 @@ static int wdt_release(struct inode *inode, struct file *file)
  *     farenheit. It was designed by an imperial measurement luddite.
  */
 
-static ssize_t wdt_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
+static ssize_t wdt_temp_read(struct file *file, char __user *buf,
+                                               size_t count, loff_t *ptr)
 {
        int temperature;
 
        if (wdt_get_temperature(&temperature))
                return -EFAULT;
 
-       if (copy_to_user (buf, &temperature, 1))
+       if (copy_to_user(buf, &temperature, 1))
                return -EFAULT;
 
        return 1;
@@ -506,10 +514,8 @@ static int wdt_temp_release(struct inode *inode, struct file *file)
 static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
        void *unused)
 {
-       if(code==SYS_DOWN || code==SYS_HALT) {
-               /* Turn the card off */
+       if (code == SYS_DOWN || code == SYS_HALT)
                wdt_stop();
-       }
        return NOTIFY_DONE;
 }
 
@@ -522,7 +528,7 @@ static const struct file_operations wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = wdt_write,
-       .ioctl          = wdt_ioctl,
+       .unlocked_ioctl = wdt_ioctl,
        .open           = wdt_open,
        .release        = wdt_release,
 };
@@ -576,7 +582,7 @@ static void __exit wdt_exit(void)
 #endif /* CONFIG_WDT_501 */
        unregister_reboot_notifier(&wdt_notifier);
        free_irq(irq, NULL);
-       release_region(io,8);
+       release_region(io, 8);
 }
 
 /**
@@ -591,44 +597,49 @@ static int __init wdt_init(void)
 {
        int ret;
 
-       /* Check that the heartbeat value is within it's range ; if not reset to the default */
+       /* Check that the heartbeat value is within it's range;
+          if not reset to the default */
        if (wdt_set_heartbeat(heartbeat)) {
                wdt_set_heartbeat(WD_TIMO);
-               printk(KERN_INFO "wdt: heartbeat value must be 0<heartbeat<65536, using %d\n",
+               printk(KERN_INFO "wdt: heartbeat value must be 0 < heartbeat < 65536, using %d\n",
                        WD_TIMO);
        }
 
        if (!request_region(io, 8, "wdt501p")) {
-               printk(KERN_ERR "wdt: I/O address 0x%04x already in use\n", io);
+               printk(KERN_ERR
+                       "wdt: I/O address 0x%04x already in use\n", io);
                ret = -EBUSY;
                goto out;
        }
 
        ret = request_irq(irq, wdt_interrupt, IRQF_DISABLED, "wdt501p", NULL);
-       if(ret) {
+       if (ret) {
                printk(KERN_ERR "wdt: IRQ %d is not free.\n", irq);
                goto outreg;
        }
 
        ret = register_reboot_notifier(&wdt_notifier);
-       if(ret) {
-               printk(KERN_ERR "wdt: cannot register reboot notifier (err=%d)\n", ret);
+       if (ret) {
+               printk(KERN_ERR
+                     "wdt: cannot register reboot notifier (err=%d)\n", ret);
                goto outirq;
        }
 
 #ifdef CONFIG_WDT_501
        ret = misc_register(&temp_miscdev);
        if (ret) {
-               printk(KERN_ERR "wdt: cannot register miscdev on minor=%d (err=%d)\n",
-                       TEMP_MINOR, ret);
+               printk(KERN_ERR
+                       "wdt: cannot register miscdev on minor=%d (err=%d)\n",
+                                                       TEMP_MINOR, ret);
                goto outrbt;
        }
 #endif /* CONFIG_WDT_501 */
 
        ret = misc_register(&wdt_miscdev);
        if (ret) {
-               printk(KERN_ERR "wdt: cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
+               printk(KERN_ERR
+                       "wdt: cannot register miscdev on minor=%d (err=%d)\n",
+                                                       WATCHDOG_MINOR, ret);
                goto outmisc;
        }
 
@@ -636,7 +647,8 @@ static int __init wdt_init(void)
        printk(KERN_INFO "WDT500/501-P driver 0.10 at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n",
                io, irq, heartbeat, nowayout);
 #ifdef CONFIG_WDT_501
-       printk(KERN_INFO "wdt: Fan Tachometer is %s\n", (tachometer ? "Enabled" : "Disabled"));
+       printk(KERN_INFO "wdt: Fan Tachometer is %s\n",
+                               (tachometer ? "Enabled" : "Disabled"));
 #endif /* CONFIG_WDT_501 */
 
 out:
@@ -651,7 +663,7 @@ outrbt:
 outirq:
        free_irq(irq, NULL);
 outreg:
-       release_region(io,8);
+       release_region(io, 8);
        goto out;
 }
 
index 1355608..5d922fd 100644 (file)
  *             JP Nollmann     :       Added support for PCI wdt501p
  *             Alan Cox        :       Split ISA and PCI cards into two drivers
  *             Jeff Garzik     :       PCI cleanups
- *             Tigran Aivazian :       Restructured wdtpci_init_one() to handle failures
+ *             Tigran Aivazian :       Restructured wdtpci_init_one() to handle
+ *                                     failures
  *             Joel Becker     :       Added WDIOC_GET/SETTIMEOUT
- *             Zwane Mwaikambo :       Magic char closing, locking changes, cleanups
+ *             Zwane Mwaikambo :       Magic char closing, locking changes,
+ *                                     cleanups
  *             Matt Domsch     :       nowayout module option
  */
 
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
 #include <linux/ioport.h>
+#include <linux/delay.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/pci.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
 
-#include <asm/io.h>
-#include <asm/uaccess.h>
 #include <asm/system.h>
 
 #define WDT_IS_PCI
@@ -73,7 +76,7 @@
 /* We can only use 1 card due to the /dev/watchdog restriction */
 static int dev_count;
 
-static struct semaphore open_sem;
+static unsigned long open_lock;
 static DEFINE_SPINLOCK(wdtpci_lock);
 static char expect_close;
 
@@ -86,18 +89,23 @@ static int irq;
 static int heartbeat = WD_TIMO;
 static int wd_heartbeat;
 module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")");
+MODULE_PARM_DESC(heartbeat,
+               "Watchdog heartbeat in seconds. (0<heartbeat<65536, default="
+                               __MODULE_STRING(WD_TIMO) ")");
 
 static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+MODULE_PARM_DESC(nowayout,
+               "Watchdog cannot be stopped once started (default="
+                               __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 
 #ifdef CONFIG_WDT_501_PCI
 /* Support for the Fan Tachometer on the PCI-WDT501 */
 static int tachometer;
 
 module_param(tachometer, int, 0);
-MODULE_PARM_DESC(tachometer, "PCI-WDT501 Fan Tachometer support (0=disable, default=0)");
+MODULE_PARM_DESC(tachometer,
+       "PCI-WDT501 Fan Tachometer support (0=disable, default=0)");
 #endif /* CONFIG_WDT_501_PCI */
 
 /*
@@ -106,16 +114,19 @@ MODULE_PARM_DESC(tachometer, "PCI-WDT501 Fan Tachometer support (0=disable, defa
 
 static void wdtpci_ctr_mode(int ctr, int mode)
 {
-       ctr<<=6;
-       ctr|=0x30;
-       ctr|=(mode<<1);
-       outb_p(ctr, WDT_CR);
+       ctr <<= 6;
+       ctr |= 0x30;
+       ctr |= (mode << 1);
+       outb(ctr, WDT_CR);
+       udelay(8);
 }
 
 static void wdtpci_ctr_load(int ctr, int val)
 {
-       outb_p(val&0xFF, WDT_COUNT0+ctr);
-       outb_p(val>>8, WDT_COUNT0+ctr);
+       outb(val & 0xFF, WDT_COUNT0 + ctr);
+       udelay(8);
+       outb(val >> 8, WDT_COUNT0 + ctr);
+       udelay(8);
 }
 
 /**
@@ -134,23 +145,35 @@ static int wdtpci_start(void)
         * "pet" the watchdog, as Access says.
         * This resets the clock outputs.
         */
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       wdtpci_ctr_mode(2,0);           /* Program CTR2 for Mode 0: Pulse on Terminal Count */
-       outb_p(0, WDT_DC);              /* Enable watchdog */
-
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       outb_p(0, WDT_CLOCK);           /* 2.0833MHz clock */
-       inb_p(WDT_BUZZER);              /* disable */
-       inb_p(WDT_OPTONOTRST);          /* disable */
-       inb_p(WDT_OPTORST);             /* disable */
-       inb_p(WDT_PROGOUT);             /* disable */
-       wdtpci_ctr_mode(0,3);           /* Program CTR0 for Mode 3: Square Wave Generator */
-       wdtpci_ctr_mode(1,2);           /* Program CTR1 for Mode 2: Rate Generator */
-       wdtpci_ctr_mode(2,1);           /* Program CTR2 for Mode 1: Retriggerable One-Shot */
-       wdtpci_ctr_load(0,20833);       /* count at 100Hz */
-       wdtpci_ctr_load(1,wd_heartbeat);/* Heartbeat */
+       inb(WDT_DC);                    /* Disable watchdog */
+       udelay(8);
+       wdtpci_ctr_mode(2, 0);          /* Program CTR2 for Mode 0:
+                                               Pulse on Terminal Count */
+       outb(0, WDT_DC);                /* Enable watchdog */
+       udelay(8);
+       inb(WDT_DC);                    /* Disable watchdog */
+       udelay(8);
+       outb(0, WDT_CLOCK);             /* 2.0833MHz clock */
+       udelay(8);
+       inb(WDT_BUZZER);                /* disable */
+       udelay(8);
+       inb(WDT_OPTONOTRST);            /* disable */
+       udelay(8);
+       inb(WDT_OPTORST);               /* disable */
+       udelay(8);
+       inb(WDT_PROGOUT);               /* disable */
+       udelay(8);
+       wdtpci_ctr_mode(0, 3);          /* Program CTR0 for Mode 3:
+                                               Square Wave Generator */
+       wdtpci_ctr_mode(1, 2);          /* Program CTR1 for Mode 2:
+                                               Rate Generator */
+       wdtpci_ctr_mode(2, 1);          /* Program CTR2 for Mode 1:
+                                               Retriggerable One-Shot */
+       wdtpci_ctr_load(0, 20833);      /* count at 100Hz */
+       wdtpci_ctr_load(1, wd_heartbeat);/* Heartbeat */
        /* DO NOT LOAD CTR2 on PCI card! -- JPN */
-       outb_p(0, WDT_DC);              /* Enable watchdog */
+       outb(0, WDT_DC);                /* Enable watchdog */
+       udelay(8);
 
        spin_unlock_irqrestore(&wdtpci_lock, flags);
        return 0;
@@ -162,14 +185,15 @@ static int wdtpci_start(void)
  *     Stop the watchdog driver.
  */
 
-static int wdtpci_stop (void)
+static int wdtpci_stop(void)
 {
        unsigned long flags;
 
        /* Turn the card off */
        spin_lock_irqsave(&wdtpci_lock, flags);
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       wdtpci_ctr_load(2,0);           /* 0 length reset pulses now */
+       inb(WDT_DC);                    /* Disable watchdog */
+       udelay(8);
+       wdtpci_ctr_load(2, 0);          /* 0 length reset pulses now */
        spin_unlock_irqrestore(&wdtpci_lock, flags);
        return 0;
 }
@@ -177,20 +201,23 @@ static int wdtpci_stop (void)
 /**
  *     wdtpci_ping:
  *
- *     Reload counter one with the watchdog heartbeat. We don't bother reloading
- *     the cascade counter.
+ *     Reload counter one with the watchdog heartbeat. We don't bother
+ *     reloading the cascade counter.
  */
 
 static int wdtpci_ping(void)
 {
        unsigned long flags;
 
-       /* Write a watchdog value */
        spin_lock_irqsave(&wdtpci_lock, flags);
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       wdtpci_ctr_mode(1,2);           /* Re-Program CTR1 for Mode 2: Rate Generator */
-       wdtpci_ctr_load(1,wd_heartbeat);/* Heartbeat */
-       outb_p(0, WDT_DC);              /* Enable watchdog */
+       /* Write a watchdog value */
+       inb(WDT_DC);                    /* Disable watchdog */
+       udelay(8);
+       wdtpci_ctr_mode(1, 2);          /* Re-Program CTR1 for Mode 2:
+                                                       Rate Generator */
+       wdtpci_ctr_load(1, wd_heartbeat);/* Heartbeat */
+       outb(0, WDT_DC);                /* Enable watchdog */
+       udelay(8);
        spin_unlock_irqrestore(&wdtpci_lock, flags);
        return 0;
 }
@@ -199,14 +226,14 @@ static int wdtpci_ping(void)
  *     wdtpci_set_heartbeat:
  *     @t:             the new heartbeat value that needs to be set.
  *
- *     Set a new heartbeat value for the watchdog device. If the heartbeat value is
- *     incorrect we keep the old value and return -EINVAL. If successfull we
- *     return 0.
+ *     Set a new heartbeat value for the watchdog device. If the heartbeat
+ *     value is incorrect we keep the old value and return -EINVAL.
+ *     If successful we return 0.
  */
 static int wdtpci_set_heartbeat(int t)
 {
        /* Arbitrary, can't find the card's limits */
-       if ((t < 1) || (t > 65535))
+       if (t < 1 || t > 65535)
                return -EINVAL;
 
        heartbeat = t;
@@ -227,9 +254,14 @@ static int wdtpci_set_heartbeat(int t)
 
 static int wdtpci_get_status(int *status)
 {
-       unsigned char new_status=inb_p(WDT_SR);
+       unsigned char new_status;
+       unsigned long flags;
+
+       spin_lock_irqsave(&wdtpci_lock, flags);
+       new_status = inb(WDT_SR);
+       spin_unlock_irqrestore(&wdtpci_lock, flags);
 
-       *status=0;
+       *status = 0;
        if (new_status & WDC_SR_ISOI0)
                *status |= WDIOF_EXTERN1;
        if (new_status & WDC_SR_ISII1)
@@ -259,8 +291,12 @@ static int wdtpci_get_status(int *status)
 
 static int wdtpci_get_temperature(int *temperature)
 {
-       unsigned short c=inb_p(WDT_RT);
-
+       unsigned short c;
+       unsigned long flags;
+       spin_lock_irqsave(&wdtpci_lock, flags);
+       c = inb(WDT_RT);
+       udelay(8);
+       spin_unlock_irqrestore(&wdtpci_lock, flags);
        *temperature = (c * 11 / 15) + 7;
        return 0;
 }
@@ -282,17 +318,25 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id)
         *      Read the status register see what is up and
         *      then printk it.
         */
-       unsigned char status=inb_p(WDT_SR);
+       unsigned char status;
+
+       spin_lock(&wdtpci_lock);
+
+       status = inb(WDT_SR);
+       udelay(8);
 
        printk(KERN_CRIT PFX "status %d\n", status);
 
 #ifdef CONFIG_WDT_501_PCI
-       if (!(status & WDC_SR_TGOOD))
-               printk(KERN_CRIT PFX "Overheat alarm.(%d)\n",inb_p(WDT_RT));
+       if (!(status & WDC_SR_TGOOD)) {
+               u8 alarm = inb(WDT_RT);
+               printk(KERN_CRIT PFX "Overheat alarm.(%d)\n", alarm);
+               udelay(8);
+       }
        if (!(status & WDC_SR_PSUOVER))
-               printk(KERN_CRIT PFX "PSU over voltage.\n");
+               printk(KERN_CRIT PFX "PSU over voltage.\n");
        if (!(status & WDC_SR_PSUUNDR))
-               printk(KERN_CRIT PFX "PSU under voltage.\n");
+               printk(KERN_CRIT PFX "PSU under voltage.\n");
        if (tachometer) {
                if (!(status & WDC_SR_FANGOOD))
                        printk(KERN_CRIT PFX "Possible fan fault.\n");
@@ -310,6 +354,7 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id)
                printk(KERN_CRIT PFX "Reset in 5ms.\n");
 #endif
        }
+       spin_unlock(&wdtpci_lock);
        return IRQ_HANDLED;
 }
 
@@ -325,7 +370,8 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id)
  *     write of data will do, as we we don't define content meaning.
  */
 
-static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+static ssize_t wdtpci_write(struct file *file, const char __user *buf,
+                                       size_t count, loff_t *ppos)
 {
        if (count) {
                if (!nowayout) {
@@ -335,7 +381,7 @@ static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t co
 
                        for (i = 0; i != count; i++) {
                                char c;
-                               if(get_user(c, buf+i))
+                               if (get_user(c, buf+i))
                                        return -EFAULT;
                                if (c == 'V')
                                        expect_close = 42;
@@ -343,13 +389,11 @@ static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t co
                }
                wdtpci_ping();
        }
-
        return count;
 }
 
 /**
  *     wdtpci_ioctl:
- *     @inode: inode of the device
  *     @file: file handle to the device
  *     @cmd: watchdog command
  *     @arg: argument pointer
@@ -359,8 +403,8 @@ static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t co
  *     querying capabilities and current status.
  */
 
-static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-       unsigned long arg)
+static long wdtpci_ioctl(struct file *file, unsigned int cmd,
+                                                       unsigned long arg)
 {
        int new_heartbeat;
        int status;
@@ -383,33 +427,29 @@ static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd
                ident.options |= WDIOF_FANFAULT;
 #endif /* CONFIG_WDT_501_PCI */
 
-       switch(cmd)
-       {
-               default:
-                       return -ENOTTY;
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
-
-               case WDIOC_GETSTATUS:
-                       wdtpci_get_status(&status);
-                       return put_user(status, p);
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-               case WDIOC_KEEPALIVE:
-                       wdtpci_ping();
-                       return 0;
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_heartbeat, p))
-                               return -EFAULT;
-
-                       if (wdtpci_set_heartbeat(new_heartbeat))
-                               return -EINVAL;
-
-                       wdtpci_ping();
-                       /* Fall */
-               case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, p);
-       }
+       switch (cmd) {
+       default:
+               return -ENOTTY;
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
+       case WDIOC_GETSTATUS:
+               wdtpci_get_status(&status);
+               return put_user(status, p);
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+       case WDIOC_KEEPALIVE:
+               wdtpci_ping();
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_heartbeat, p))
+                       return -EFAULT;
+               if (wdtpci_set_heartbeat(new_heartbeat))
+                       return -EINVAL;
+               wdtpci_ping();
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               return put_user(heartbeat, p);
+               }
 }
 
 /**
@@ -426,12 +466,11 @@ static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 
 static int wdtpci_open(struct inode *inode, struct file *file)
 {
-       if (down_trylock(&open_sem))
+       if (test_and_set_bit(0, &open_lock))
                return -EBUSY;
 
-       if (nowayout) {
+       if (nowayout)
                __module_get(THIS_MODULE);
-       }
        /*
         *      Activate
         */
@@ -460,7 +499,7 @@ static int wdtpci_release(struct inode *inode, struct file *file)
                wdtpci_ping();
        }
        expect_close = 0;
-       up(&open_sem);
+       clear_bit(0, &open_lock);
        return 0;
 }
 
@@ -476,14 +515,15 @@ static int wdtpci_release(struct inode *inode, struct file *file)
  *     fahrenheit. It was designed by an imperial measurement luddite.
  */
 
-static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
+static ssize_t wdtpci_temp_read(struct file *file, char __user *buf,
+                                               size_t count, loff_t *ptr)
 {
        int temperature;
 
        if (wdtpci_get_temperature(&temperature))
                return -EFAULT;
 
-       if (copy_to_user (buf, &temperature, 1))
+       if (copy_to_user(buf, &temperature, 1))
                return -EFAULT;
 
        return 1;
@@ -529,12 +569,10 @@ static int wdtpci_temp_release(struct inode *inode, struct file *file)
  */
 
 static int wdtpci_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
+                                                       void *unused)
 {
-       if (code==SYS_DOWN || code==SYS_HALT) {
-               /* Turn the card off */
+       if (code == SYS_DOWN || code == SYS_HALT)
                wdtpci_stop();
-       }
        return NOTIFY_DONE;
 }
 
@@ -547,7 +585,7 @@ static const struct file_operations wdtpci_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = wdtpci_write,
-       .ioctl          = wdtpci_ioctl,
+       .unlocked_ioctl = wdtpci_ioctl,
        .open           = wdtpci_open,
        .release        = wdtpci_release,
 };
@@ -584,80 +622,85 @@ static struct notifier_block wdtpci_notifier = {
 };
 
 
-static int __devinit wdtpci_init_one (struct pci_dev *dev,
-                                  const struct pci_device_id *ent)
+static int __devinit wdtpci_init_one(struct pci_dev *dev,
+                                       const struct pci_device_id *ent)
 {
        int ret = -EIO;
 
        dev_count++;
        if (dev_count > 1) {
-               printk (KERN_ERR PFX "this driver only supports 1 device\n");
+               printk(KERN_ERR PFX "This driver only supports one device\n");
                return -ENODEV;
        }
 
-       if (pci_enable_device (dev)) {
-               printk (KERN_ERR PFX "Not possible to enable PCI Device\n");
+       if (pci_enable_device(dev)) {
+               printk(KERN_ERR PFX "Not possible to enable PCI Device\n");
                return -ENODEV;
        }
 
-       if (pci_resource_start (dev, 2) == 0x0000) {
-               printk (KERN_ERR PFX "No I/O-Address for card detected\n");
+       if (pci_resource_start(dev, 2) == 0x0000) {
+               printk(KERN_ERR PFX "No I/O-Address for card detected\n");
                ret = -ENODEV;
                goto out_pci;
        }
 
-       sema_init(&open_sem, 1);
-
        irq = dev->irq;
-       io = pci_resource_start (dev, 2);
+       io = pci_resource_start(dev, 2);
 
-       if (request_region (io, 16, "wdt_pci") == NULL) {
-               printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", io);
+       if (request_region(io, 16, "wdt_pci") == NULL) {
+               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", io);
                goto out_pci;
        }
 
-       if (request_irq (irq, wdtpci_interrupt, IRQF_DISABLED | IRQF_SHARED,
+       if (request_irq(irq, wdtpci_interrupt, IRQF_DISABLED | IRQF_SHARED,
                         "wdt_pci", &wdtpci_miscdev)) {
-               printk (KERN_ERR PFX "IRQ %d is not free\n", irq);
+               printk(KERN_ERR PFX "IRQ %d is not free\n", irq);
                goto out_reg;
        }
 
-       printk ("PCI-WDT500/501 (PCI-WDG-CSM) driver 0.10 at 0x%04x (Interrupt %d)\n",
-               io, irq);
+       printk(KERN_INFO
+        "PCI-WDT500/501 (PCI-WDG-CSM) driver 0.10 at 0x%04x (Interrupt %d)\n",
+                                                               io, irq);
 
-       /* Check that the heartbeat value is within it's range ; if not reset to the default */
+       /* Check that the heartbeat value is within its range;
+          if not reset to the default */
        if (wdtpci_set_heartbeat(heartbeat)) {
                wdtpci_set_heartbeat(WD_TIMO);
-               printk(KERN_INFO PFX "heartbeat value must be 0<heartbeat<65536, using %d\n",
-                       WD_TIMO);
+               printk(KERN_INFO PFX
+                 "heartbeat value must be 0 < heartbeat < 65536, using %d\n",
+                                                               WD_TIMO);
        }
 
-       ret = register_reboot_notifier (&wdtpci_notifier);
+       ret = register_reboot_notifier(&wdtpci_notifier);
        if (ret) {
-               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", ret);
+               printk(KERN_ERR PFX
+                       "cannot register reboot notifier (err=%d)\n", ret);
                goto out_irq;
        }
 
 #ifdef CONFIG_WDT_501_PCI
-       ret = misc_register (&temp_miscdev);
+       ret = misc_register(&temp_miscdev);
        if (ret) {
-               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       TEMP_MINOR, ret);
+               printk(KERN_ERR PFX
+                       "cannot register miscdev on minor=%d (err=%d)\n",
+                                       TEMP_MINOR, ret);
                goto out_rbt;
        }
 #endif /* CONFIG_WDT_501_PCI */
 
-       ret = misc_register (&wdtpci_miscdev);
+       ret = misc_register(&wdtpci_miscdev);
        if (ret) {
-               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
+               printk(KERN_ERR PFX
+                       "cannot register miscdev on minor=%d (err=%d)\n",
+                                               WATCHDOG_MINOR, ret);
                goto out_misc;
        }
 
        printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
                heartbeat, nowayout);
 #ifdef CONFIG_WDT_501_PCI
-       printk(KERN_INFO "wdt: Fan Tachometer is %s\n", (tachometer ? "Enabled" : "Disabled"));
+       printk(KERN_INFO "wdt: Fan Tachometer is %s\n",
+                               (tachometer ? "Enabled" : "Disabled"));
 #endif /* CONFIG_WDT_501_PCI */
 
        ret = 0;
@@ -673,14 +716,14 @@ out_rbt:
 out_irq:
        free_irq(irq, &wdtpci_miscdev);
 out_reg:
-       release_region (io, 16);
+       release_region(io, 16);
 out_pci:
        pci_disable_device(dev);
        goto out;
 }
 
 
-static void __devexit wdtpci_remove_one (struct pci_dev *pdev)
+static void __devexit wdtpci_remove_one(struct pci_dev *pdev)
 {
        /* here we assume only one device will ever have
         * been picked up and registered by probe function */
@@ -728,7 +771,7 @@ static struct pci_driver wdtpci_driver = {
 
 static void __exit wdtpci_cleanup(void)
 {
-       pci_unregister_driver (&wdtpci_driver);
+       pci_unregister_driver(&wdtpci_driver);
 }
 
 
@@ -742,7 +785,7 @@ static void __exit wdtpci_cleanup(void)
 
 static int __init wdtpci_init(void)
 {
-       return pci_register_driver (&wdtpci_driver);
+       return pci_register_driver(&wdtpci_driver);
 }
 
 
index 660b191..8f7fdaa 100644 (file)
@@ -250,19 +250,19 @@ static void file_record(struct ihex_binrec *record)
 
 static int output_records(int outfd)
 {
-       unsigned char zeroes[5] = {0, 0, 0, 0, 0};
+       unsigned char zeroes[6] = {0, 0, 0, 0, 0, 0};
        struct ihex_binrec *p = records;
 
        while (p) {
                uint16_t writelen = (p->len + 9) & ~3;
 
                p->addr = htonl(p->addr);
-               p->len = htonl(p->len);
+               p->len = htons(p->len);
                write(outfd, &p->addr, writelen);
                p = p->next;
        }
        /* EOF record is zero length, since we don't bother to represent
           the type field in the binary version */
-       write(outfd, zeroes, 5);
+       write(outfd, zeroes, 6);
        return 0;
 }
index 8478fc2..46763d1 100644 (file)
@@ -127,7 +127,7 @@ enum {
        Opt_err
 };
 
-static match_table_t __initconst tokens = {
+static match_table_t __initdata tokens = {
        {Opt_port, "port=%u"},
        {Opt_rsize, "rsize=%u"},
        {Opt_wsize, "wsize=%u"},
index 3e30e40..3141969 100644 (file)
@@ -1233,7 +1233,7 @@ static int ufs_show_options(struct seq_file *seq, struct vfsmount *vfs)
 {
        struct ufs_sb_info *sbi = UFS_SB(vfs->mnt_sb);
        unsigned mval = sbi->s_mount_opt & UFS_MOUNT_UFSTYPE;
-       const struct match_token *tp = tokens;
+       struct match_token *tp = tokens;
 
        while (tp->token != Opt_onerror_panic && tp->token != mval)
                ++tp;
index 1e233e7..d1ea750 100644 (file)
@@ -1,4 +1,53 @@
 #ifndef _M68K_CONTREGS_H
 #define _M68K_CONTREGS_H
-#include <asm-sparc/contregs.h>
+
+/* contregs.h:  Addresses of registers in the ASI_CONTROL alternate address
+ *              space. These are for the mmu's context register, etc.
+ *
+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ */
+
+/* 3=sun3
+   4=sun4 (as in sun4 sysmaint student book)
+   c=sun4c (according to davem) */
+
+#define AC_IDPROM     0x00000000    /* 34  ID PROM, R/O, byte, 32 bytes      */
+#define AC_PAGEMAP    0x10000000    /* 3   Pagemap R/W, long                 */
+#define AC_SEGMAP     0x20000000    /* 3   Segment map, byte                 */
+#define AC_CONTEXT    0x30000000    /* 34c current mmu-context               */
+#define AC_SENABLE    0x40000000    /* 34c system dvma/cache/reset enable reg*/
+#define AC_UDVMA_ENB  0x50000000    /* 34  Not used on Sun boards, byte      */
+#define AC_BUS_ERROR  0x60000000    /* 34  Not cleared on read, byte.        */
+#define AC_SYNC_ERR   0x60000000    /*  c fault type                         */
+#define AC_SYNC_VA    0x60000004    /*  c fault virtual address              */
+#define AC_ASYNC_ERR  0x60000008    /*  c asynchronous fault type            */
+#define AC_ASYNC_VA   0x6000000c    /*  c async fault virtual address        */
+#define AC_LEDS       0x70000000    /* 34  Zero turns on LEDs, byte          */
+#define AC_CACHETAGS  0x80000000    /* 34c direct access to the VAC tags     */
+#define AC_CACHEDDATA 0x90000000    /* 3 c direct access to the VAC data     */
+#define AC_UDVMA_MAP  0xD0000000    /* 4  Not used on Sun boards, byte       */
+#define AC_VME_VECTOR 0xE0000000    /* 4  For non-Autovector VME, byte       */
+#define AC_BOOT_SCC   0xF0000000    /* 34  bypass to access Zilog 8530. byte.*/
+
+/* s=Swift, h=Ross_HyperSPARC, v=TI_Viking, t=Tsunami, r=Ross_Cypress        */
+#define AC_M_PCR      0x0000        /* shv Processor Control Reg             */
+#define AC_M_CTPR     0x0100        /* shv Context Table Pointer Reg         */
+#define AC_M_CXR      0x0200        /* shv Context Register                  */
+#define AC_M_SFSR     0x0300        /* shv Synchronous Fault Status Reg      */
+#define AC_M_SFAR     0x0400        /* shv Synchronous Fault Address Reg     */
+#define AC_M_AFSR     0x0500        /*  hv Asynchronous Fault Status Reg     */
+#define AC_M_AFAR     0x0600        /*  hv Asynchronous Fault Address Reg    */
+#define AC_M_RESET    0x0700        /*  hv Reset Reg                         */
+#define AC_M_RPR      0x1000        /*  hv Root Pointer Reg                  */
+#define AC_M_TSUTRCR  0x1000        /* s   TLB Replacement Ctrl Reg          */
+#define AC_M_IAPTP    0x1100        /*  hv Instruction Access PTP            */
+#define AC_M_DAPTP    0x1200        /*  hv Data Access PTP                   */
+#define AC_M_ITR      0x1300        /*  hv Index Tag Register                */
+#define AC_M_TRCR     0x1400        /*  hv TLB Replacement Control Reg       */
+#define AC_M_SFSRX    0x1300        /* s   Synch Fault Status Reg prim       */
+#define AC_M_SFARX    0x1400        /* s   Synch Fault Address Reg prim      */
+#define AC_M_RPR1     0x1500        /*  h  Root Pointer Reg (entry 2)        */
+#define AC_M_IAPTP1   0x1600        /*  h  Instruction Access PTP (entry 2)  */
+#define AC_M_DAPTP1   0x1700        /*  h  Data Access PTP (entry 2)         */
+
 #endif /* _M68K_CONTREGS_H */
index c17edf8..b9215a0 100644 (file)
@@ -1 +1,330 @@
-#include <asm-sparc/fbio.h>
+#ifndef __LINUX_FBIO_H
+#define __LINUX_FBIO_H
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+/* Constants used for fbio SunOS compatibility */
+/* (C) 1996 Miguel de Icaza */
+
+/* Frame buffer types */
+#define FBTYPE_NOTYPE           -1
+#define FBTYPE_SUN1BW           0   /* mono */
+#define FBTYPE_SUN1COLOR        1 
+#define FBTYPE_SUN2BW           2 
+#define FBTYPE_SUN2COLOR        3 
+#define FBTYPE_SUN2GP           4 
+#define FBTYPE_SUN5COLOR        5 
+#define FBTYPE_SUN3COLOR        6 
+#define FBTYPE_MEMCOLOR         7 
+#define FBTYPE_SUN4COLOR        8 
+#define FBTYPE_NOTSUN1          9 
+#define FBTYPE_NOTSUN2          10
+#define FBTYPE_NOTSUN3          11
+#define FBTYPE_SUNFAST_COLOR    12  /* cg6 */
+#define FBTYPE_SUNROP_COLOR     13
+#define FBTYPE_SUNFB_VIDEO      14
+#define FBTYPE_SUNGIFB          15
+#define FBTYPE_SUNGPLAS         16
+#define FBTYPE_SUNGP3           17
+#define FBTYPE_SUNGT            18
+#define FBTYPE_SUNLEO           19      /* zx Leo card */
+#define FBTYPE_MDICOLOR         20      /* cg14 */
+#define FBTYPE_TCXCOLOR                21      /* SUNW,tcx card */
+
+#define FBTYPE_LASTPLUSONE      21     /* This is not last + 1 in fact... */
+
+/* Does not seem to be listed in the Sun file either */
+#define FBTYPE_CREATOR          22
+#define FBTYPE_PCI_IGA1682     23
+#define FBTYPE_P9100COLOR      24
+
+#define FBTYPE_PCI_GENERIC     1000
+#define FBTYPE_PCI_MACH64      1001
+
+/* fbio ioctls */
+/* Returned by FBIOGTYPE */
+struct  fbtype {
+        int     fb_type;        /* fb type, see above */
+        int     fb_height;      /* pixels */
+        int     fb_width;       /* pixels */
+        int     fb_depth;
+        int     fb_cmsize;      /* color map entries */
+        int     fb_size;        /* fb size in bytes */
+};
+#define FBIOGTYPE _IOR('F', 0, struct fbtype)
+
+struct  fbcmap {
+        int             index;          /* first element (0 origin) */
+        int             count;
+        unsigned char   __user *red;
+        unsigned char   __user *green;
+        unsigned char   __user *blue;
+};
+
+#ifdef __KERNEL__
+#define FBIOPUTCMAP_SPARC _IOW('F', 3, struct fbcmap)
+#define FBIOGETCMAP_SPARC _IOW('F', 4, struct fbcmap)
+#else
+#define FBIOPUTCMAP _IOW('F', 3, struct fbcmap)
+#define FBIOGETCMAP _IOW('F', 4, struct fbcmap)
+#endif
+
+/* # of device specific values */
+#define FB_ATTR_NDEVSPECIFIC    8
+/* # of possible emulations */
+#define FB_ATTR_NEMUTYPES       4
+struct fbsattr {
+        int     flags;
+        int     emu_type;      /* -1 if none */
+        int     dev_specific[FB_ATTR_NDEVSPECIFIC];
+};
+struct fbgattr {
+        int     real_type;     /* real frame buffer type */
+        int     owner;         /* unknown */
+        struct fbtype fbtype;  /* real frame buffer fbtype */
+        struct fbsattr sattr;   
+        int     emu_types[FB_ATTR_NEMUTYPES]; /* supported emulations */
+};
+#define FBIOSATTR  _IOW('F', 5, struct fbgattr) /* Unsupported: */
+#define FBIOGATTR  _IOR('F', 6, struct fbgattr)        /* supported */
+
+#define FBIOSVIDEO _IOW('F', 7, int)
+#define FBIOGVIDEO _IOR('F', 8, int)
+
+struct fbcursor {
+        short set;              /* what to set, choose from the list above */
+        short enable;           /* cursor on/off */
+        struct fbcurpos pos;    /* cursor position */
+        struct fbcurpos hot;    /* cursor hot spot */
+        struct fbcmap cmap;     /* color map info */
+        struct fbcurpos size;   /* cursor bit map size */
+        char __user *image;     /* cursor image bits */
+        char __user *mask;      /* cursor mask bits */
+};
+
+/* set/get cursor attributes/shape */
+#define FBIOSCURSOR     _IOW('F', 24, struct fbcursor)
+#define FBIOGCURSOR     _IOWR('F', 25, struct fbcursor)
+/* set/get cursor position */
+#define FBIOSCURPOS     _IOW('F', 26, struct fbcurpos)
+#define FBIOGCURPOS     _IOW('F', 27, struct fbcurpos)
+/* get max cursor size */
+#define FBIOGCURMAX     _IOR('F', 28, struct fbcurpos)
+
+/* wid manipulation */
+struct fb_wid_alloc {
+#define FB_WID_SHARED_8                0
+#define FB_WID_SHARED_24       1
+#define FB_WID_DBL_8           2
+#define FB_WID_DBL_24          3
+       __u32   wa_type;
+       __s32   wa_index;       /* Set on return */
+       __u32   wa_count;       
+};
+struct fb_wid_item {
+       __u32   wi_type;
+       __s32   wi_index;
+       __u32   wi_attrs;
+       __u32   wi_values[32];
+};
+struct fb_wid_list {
+       __u32   wl_flags;
+       __u32   wl_count;
+       struct fb_wid_item      *wl_list;
+};
+
+#define FBIO_WID_ALLOC _IOWR('F', 30, struct fb_wid_alloc)
+#define FBIO_WID_FREE  _IOW('F', 31, struct fb_wid_alloc)
+#define FBIO_WID_PUT   _IOW('F', 32, struct fb_wid_list)
+#define FBIO_WID_GET   _IOWR('F', 33, struct fb_wid_list)
+
+/* Creator ioctls */
+#define FFB_IOCTL      ('F'<<8)
+#define FFB_SYS_INFO           (FFB_IOCTL|80)
+#define FFB_CLUTREAD           (FFB_IOCTL|81)
+#define FFB_CLUTPOST           (FFB_IOCTL|82)
+#define FFB_SETDIAGMODE                (FFB_IOCTL|83)
+#define FFB_GETMONITORID       (FFB_IOCTL|84)
+#define FFB_GETVIDEOMODE       (FFB_IOCTL|85)
+#define FFB_SETVIDEOMODE       (FFB_IOCTL|86)
+#define FFB_SETSERVER          (FFB_IOCTL|87)
+#define FFB_SETOVCTL           (FFB_IOCTL|88)
+#define FFB_GETOVCTL           (FFB_IOCTL|89)
+#define FFB_GETSAXNUM          (FFB_IOCTL|90)
+#define FFB_FBDEBUG            (FFB_IOCTL|91)
+
+/* Cg14 ioctls */
+#define MDI_IOCTL          ('M'<<8)
+#define MDI_RESET          (MDI_IOCTL|1)
+#define MDI_GET_CFGINFO    (MDI_IOCTL|2)
+#define MDI_SET_PIXELMODE  (MDI_IOCTL|3)
+#    define MDI_32_PIX     32
+#    define MDI_16_PIX     16
+#    define MDI_8_PIX      8
+
+struct mdi_cfginfo {
+       int     mdi_ncluts;     /* Number of implemented CLUTs in this MDI */
+        int     mdi_type;       /* FBTYPE name */
+        int     mdi_height;     /* height */
+        int     mdi_width;      /* widht */
+        int     mdi_size;       /* available ram */
+        int     mdi_mode;       /* 8bpp, 16bpp or 32bpp */
+        int     mdi_pixfreq;    /* pixel clock (from PROM) */
+};
+
+/* SparcLinux specific ioctl for the MDI, should be replaced for
+ * the SET_XLUT/SET_CLUTn ioctls instead
+ */
+#define MDI_CLEAR_XLUT       (MDI_IOCTL|9)
+
+/* leo & ffb ioctls */
+struct fb_clut_alloc {
+       __u32   clutid; /* Set on return */
+       __u32   flag;
+       __u32   index;
+};
+
+struct fb_clut {
+#define FB_CLUT_WAIT   0x00000001      /* Not yet implemented */
+       __u32   flag;
+       __u32   clutid;
+       __u32   offset;
+       __u32   count;
+       char *  red;
+       char *  green;
+       char *  blue;
+};
+
+struct fb_clut32 {
+       __u32   flag;
+       __u32   clutid;
+       __u32   offset;
+       __u32   count;
+       __u32   red;
+       __u32   green;
+       __u32   blue;
+};
+
+#define LEO_CLUTALLOC  _IOWR('L', 53, struct fb_clut_alloc)
+#define LEO_CLUTFREE   _IOW('L', 54, struct fb_clut_alloc)
+#define LEO_CLUTREAD   _IOW('L', 55, struct fb_clut)
+#define LEO_CLUTPOST   _IOW('L', 56, struct fb_clut)
+#define LEO_SETGAMMA   _IOW('L', 68, int) /* Not yet implemented */
+#define LEO_GETGAMMA   _IOR('L', 69, int) /* Not yet implemented */
+
+#ifdef __KERNEL__
+/* Addresses on the fd of a cgsix that are mappable */
+#define CG6_FBC    0x70000000
+#define CG6_TEC    0x70001000
+#define CG6_BTREGS 0x70002000
+#define CG6_FHC    0x70004000
+#define CG6_THC    0x70005000
+#define CG6_ROM    0x70006000
+#define CG6_RAM    0x70016000
+#define CG6_DHC    0x80000000
+
+#define CG3_MMAP_OFFSET 0x4000000
+
+/* Addresses on the fd of a tcx that are mappable */
+#define TCX_RAM8BIT            0x00000000
+#define TCX_RAM24BIT                   0x01000000
+#define TCX_UNK3               0x10000000
+#define TCX_UNK4               0x20000000
+#define TCX_CONTROLPLANE       0x28000000
+#define TCX_UNK6               0x30000000
+#define TCX_UNK7               0x38000000
+#define TCX_TEC                0x70000000
+#define TCX_BTREGS             0x70002000
+#define TCX_THC                0x70004000
+#define TCX_DHC                0x70008000
+#define TCX_ALT                        0x7000a000
+#define TCX_SYNC               0x7000e000
+#define TCX_UNK2               0x70010000
+
+/* CG14 definitions */
+
+/* Offsets into the OBIO space: */
+#define CG14_REGS        0       /* registers */
+#define CG14_CURSORREGS  0x1000  /* cursor registers */
+#define CG14_DACREGS     0x2000  /* DAC registers */
+#define CG14_XLUT        0x3000  /* X Look Up Table -- ??? */
+#define CG14_CLUT1       0x4000  /* Color Look Up Table */
+#define CG14_CLUT2       0x5000  /* Color Look Up Table */
+#define CG14_CLUT3       0x6000  /* Color Look Up Table */
+#define CG14_AUTO       0xf000
+
+#endif /* KERNEL */
+
+/* These are exported to userland for applications to use */
+/* Mappable offsets for the cg14: control registers */
+#define MDI_DIRECT_MAP 0x10000000
+#define MDI_CTLREG_MAP 0x20000000
+#define MDI_CURSOR_MAP 0x30000000
+#define MDI_SHDW_VRT_MAP 0x40000000
+
+/* Mappable offsets for the cg14: frame buffer resolutions */
+/* 32 bits */
+#define MDI_CHUNKY_XBGR_MAP 0x50000000
+#define MDI_CHUNKY_BGR_MAP 0x60000000
+
+/* 16 bits */
+#define MDI_PLANAR_X16_MAP 0x70000000
+#define MDI_PLANAR_C16_MAP 0x80000000
+
+/* 8 bit is done as CG3 MMAP offset */
+/* 32 bits, planar */
+#define MDI_PLANAR_X32_MAP 0x90000000
+#define MDI_PLANAR_B32_MAP 0xa0000000
+#define MDI_PLANAR_G32_MAP 0xb0000000
+#define MDI_PLANAR_R32_MAP 0xc0000000
+
+/* Mappable offsets on leo */
+#define LEO_SS0_MAP            0x00000000
+#define LEO_LC_SS0_USR_MAP     0x00800000
+#define LEO_LD_SS0_MAP         0x00801000
+#define LEO_LX_CURSOR_MAP      0x00802000
+#define LEO_SS1_MAP            0x00803000
+#define LEO_LC_SS1_USR_MAP     0x01003000
+#define LEO_LD_SS1_MAP         0x01004000
+#define LEO_UNK_MAP            0x01005000
+#define LEO_LX_KRN_MAP         0x01006000
+#define LEO_LC_SS0_KRN_MAP     0x01007000
+#define LEO_LC_SS1_KRN_MAP     0x01008000
+#define LEO_LD_GBL_MAP         0x01009000
+#define LEO_UNK2_MAP           0x0100a000
+
+#ifdef __KERNEL__
+struct  fbcmap32 {
+       int             index;          /* first element (0 origin) */
+       int             count;
+       u32             red;
+       u32             green;
+       u32             blue;
+};
+
+#define FBIOPUTCMAP32  _IOW('F', 3, struct fbcmap32)
+#define FBIOGETCMAP32  _IOW('F', 4, struct fbcmap32)
+
+struct fbcursor32 {
+       short set;              /* what to set, choose from the list above */
+       short enable;           /* cursor on/off */
+       struct fbcurpos pos;    /* cursor position */
+       struct fbcurpos hot;    /* cursor hot spot */
+       struct fbcmap32 cmap;   /* color map info */
+       struct fbcurpos size;   /* cursor bit map size */
+       u32     image;          /* cursor image bits */
+       u32     mask;           /* cursor mask bits */
+};
+
+#define FBIOSCURSOR32  _IOW('F', 24, struct fbcursor32)
+#define FBIOGCURSOR32  _IOW('F', 25, struct fbcursor32)
+#endif
+
+#endif /* __LINUX_FBIO_H */
index 4349eaf..160616a 100644 (file)
@@ -1,6 +1,25 @@
 #ifndef _M68K_IDPROM_H
 #define _M68K_IDPROM_H
-#include <asm-sparc/idprom.h>
+/*
+ * idprom.h: Macros and defines for idprom routines
+ *
+ * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
+ */
+
+#include <linux/types.h>
+
+struct idprom {
+       u8              id_format;      /* Format identifier (always 0x01) */
+       u8              id_machtype;    /* Machine type */
+       u8              id_ethaddr[6];  /* Hardware ethernet address */
+       s32             id_date;        /* Date of manufacture */
+       u32             id_sernum:24;   /* Unique serial number */
+       u8              id_cksum;       /* Checksum - xor of the data bytes */
+       u8              reserved[16];
+};
+
+extern struct idprom *idprom;
+extern void idprom_init(void);
 
 /* Sun3: in control space */
 #define SUN3_IDPROM_BASE       0x00000000
index 2baace2..31d8629 100644 (file)
@@ -18,7 +18,7 @@ struct ihex_binrec {
        __be32 addr;
        __be16 len;
        uint8_t data[0];
-} __attribute__((aligned(4)));
+} __attribute__((packed));
 
 /* Find the next record, taking into account the 4-byte alignment */
 static inline const struct ihex_binrec *
index 5c948f3..8f2d60d 100644 (file)
@@ -37,7 +37,7 @@
  */
 #define        MISDN_MAJOR_VERSION     1
 #define        MISDN_MINOR_VERSION     0
-#define MISDN_RELEASE          18
+#define MISDN_RELEASE          19
 
 /* primitives for information exchange
  * generell format
@@ -242,7 +242,8 @@ struct mISDNhead {
 #define TEI_SAPI               63
 #define CTRL_SAPI              0
 
-#define MISDN_CHMAP_SIZE       4
+#define MISDN_MAX_CHANNEL      127
+#define MISDN_CHMAP_SIZE       ((MISDN_MAX_CHANNEL + 1) >> 3)
 
 #define SOL_MISDN      0
 
@@ -275,11 +276,32 @@ struct mISDN_devinfo {
        u_int                   Dprotocols;
        u_int                   Bprotocols;
        u_int                   protocol;
-       u_long                  channelmap[MISDN_CHMAP_SIZE];
+       u_char                  channelmap[MISDN_CHMAP_SIZE];
        u_int                   nrbchan;
        char                    name[MISDN_MAX_IDLEN];
 };
 
+static inline int
+test_channelmap(u_int nr, u_char *map)
+{
+       if (nr <= MISDN_MAX_CHANNEL)
+               return map[nr >> 3] & (1 << (nr & 7));
+       else
+               return 0;
+}
+
+static inline void
+set_channelmap(u_int nr, u_char *map)
+{
+       map[nr >> 3] |= (1 << (nr & 7));
+}
+
+static inline void
+clear_channelmap(u_int nr, u_char *map)
+{
+       map[nr >> 3] &= ~(1 << (nr & 7));
+}
+
 /* CONTROL_CHANNEL parameters */
 #define MISDN_CTRL_GETOP               0x0000
 #define MISDN_CTRL_LOOP                        0x0001
@@ -405,7 +427,7 @@ struct mISDNdevice {
        u_int                   Dprotocols;
        u_int                   Bprotocols;
        u_int                   nrbchan;
-       u_long                  channelmap[MISDN_CHMAP_SIZE];
+       u_char                  channelmap[MISDN_CHMAP_SIZE];
        struct list_head        bchannels;
        struct mISDNchannel     *teimgr;
        struct device           dev;
@@ -430,7 +452,7 @@ struct mISDNstack {
 #endif
 };
 
-/* global alloc/queue dunctions */
+/* global alloc/queue functions */
 
 static inline struct sk_buff *
 mI_alloc_skb(unsigned int len, gfp_t gfp_mask)
index c853b10..c23d3f5 100644 (file)
@@ -51,7 +51,6 @@ struct maple_devinfo {
 struct maple_device {
        struct maple_driver *driver;
        struct mapleq *mq;
-       void *private_data;
        void (*callback) (struct mapleq * mq);
        unsigned long when, interval, function;
        struct maple_devinfo devinfo;
@@ -70,7 +69,9 @@ void maple_getcond_callback(struct maple_device *dev,
                            void (*callback) (struct mapleq * mq),
                            unsigned long interval,
                            unsigned long function);
-int maple_driver_register(struct device_driver *drv);
+int maple_driver_register(struct maple_driver *);
+void maple_driver_unregister(struct maple_driver *);
+
 int maple_add_packet_sleeps(struct maple_device *mdev, u32 function,
        u32 command, u32 length, void *data);
 void maple_clear_dev(struct maple_device *mdev);
@@ -78,4 +79,7 @@ void maple_clear_dev(struct maple_device *mdev);
 #define to_maple_dev(n) container_of(n, struct maple_device, dev)
 #define to_maple_driver(n) container_of(n, struct maple_driver, drv)
 
+#define maple_get_drvdata(d)           dev_get_drvdata(&(d)->dev)
+#define maple_set_drvdata(d,p)         dev_set_drvdata(&(d)->dev, (p))
+
 #endif                         /* __LINUX_MAPLE_H */
index cc554ca..7dcd050 100644 (file)
@@ -14,7 +14,7 @@ struct match_token {
        const char *pattern;
 };
 
-typedef const struct match_token match_table_t[];
+typedef struct match_token match_table_t[];
 
 /* Maximum number of arguments that match_token will find in a pattern */
 enum {MAX_OPT_ARGS = 3};
index 1253283..ab3ef7a 100644 (file)
@@ -487,6 +487,9 @@ static inline int tracehook_notify_jctl(int notify, int why)
        return notify || (current->ptrace & PT_PTRACED);
 }
 
+#define DEATH_REAP                     -1
+#define DEATH_DELAYED_GROUP_LEADER     -2
+
 /**
  * tracehook_notify_death - task is dead, ready to notify parent
  * @task:              @current task now exiting
@@ -501,8 +504,6 @@ static inline int tracehook_notify_jctl(int notify, int why)
  *
  * Called with write_lock_irq(&tasklist_lock) held.
  */
-#define DEATH_REAP                     -1
-#define DEATH_DELAYED_GROUP_LEADER     -2
 static inline int tracehook_notify_death(struct task_struct *task,
                                         void **death_cookie, int group_dead)
 {
index 8c8119f..1c78d56 100644 (file)
@@ -86,6 +86,7 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
 #define con_copy_unimap(d, s) (0)
 #define con_get_unimap(vc, ct, uct, list) (-EINVAL)
 #define con_free_unimap(vc) do { ; } while (0)
+#define con_protect_unimap(vc, rdonly) do { ; } while (0)
 
 #define vc_translate(vc, c) (c)
 #endif
index 291d56a..9cecc40 100644 (file)
@@ -140,8 +140,7 @@ struct scsi_device {
        unsigned fix_capacity:1;        /* READ_CAPACITY is too high by 1 */
        unsigned guess_capacity:1;      /* READ_CAPACITY might be too high by 1 */
        unsigned retry_hwerror:1;       /* Retry HARDWARE_ERROR */
-       unsigned last_sector_bug:1;     /* do not use multisector accesses on
-                                          SD_LAST_BUGGY_SECTORS */
+       unsigned last_sector_bug:1;     /* Always read last sector in a 1 sector read */
 
        DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
        struct list_head event_list;    /* asserted events */
index 496c3dd..972f8e6 100644 (file)
@@ -243,6 +243,9 @@ static inline int open_arg(int flags, int mask)
 
 static int audit_match_perm(struct audit_context *ctx, int mask)
 {
+       if (unlikely(!ctx))
+               return 0;
+
        unsigned n = ctx->major;
        switch (audit_classify_syscall(ctx->arch, n)) {
        case 0: /* native */
@@ -284,6 +287,10 @@ static int audit_match_filetype(struct audit_context *ctx, int which)
 {
        unsigned index = which & ~S_IFMT;
        mode_t mode = which & S_IFMT;
+
+       if (unlikely(!ctx))
+               return 0;
+
        if (index >= ctx->name_count)
                return 0;
        if (ctx->names[index].ino == -1)
index 21f7da9..04160d2 100644 (file)
@@ -5004,19 +5004,21 @@ recheck:
                        return -EPERM;
        }
 
+       if (user) {
 #ifdef CONFIG_RT_GROUP_SCHED
-       /*
-        * Do not allow realtime tasks into groups that have no runtime
-        * assigned.
-        */
-       if (user
-           && rt_policy(policy) && task_group(p)->rt_bandwidth.rt_runtime == 0)
-               return -EPERM;
+               /*
+                * Do not allow realtime tasks into groups that have no runtime
+                * assigned.
+                */
+               if (rt_policy(policy) && task_group(p)->rt_bandwidth.rt_runtime == 0)
+                       return -EPERM;
 #endif
 
-       retval = security_task_setscheduler(p, policy, param);
-       if (retval)
-               return retval;
+               retval = security_task_setscheduler(p, policy, param);
+               if (retval)
+                       return retval;
+       }
+
        /*
         * make sure no PI-waiters arrive (or leave) while we are
         * changing the priority of the task:
index 6793b9c..a472bcd 100644 (file)
@@ -2765,16 +2765,26 @@ int make_pages_present(unsigned long addr, unsigned long end)
 
        vma = find_vma(current->mm, addr);
        if (!vma)
-               return -1;
+               return -ENOMEM;
        write = (vma->vm_flags & VM_WRITE) != 0;
        BUG_ON(addr >= end);
        BUG_ON(end > vma->vm_end);
        len = DIV_ROUND_UP(end, PAGE_SIZE) - addr/PAGE_SIZE;
        ret = get_user_pages(current, current->mm, addr,
                        len, write, 0, NULL, NULL);
-       if (ret < 0)
+       if (ret < 0) {
+               /*
+                  SUS require strange return value to mlock
+                   - invalid addr generate to ENOMEM.
+                   - out of memory should generate EAGAIN.
+               */
+               if (ret == -EFAULT)
+                       ret = -ENOMEM;
+               else if (ret == -ENOMEM)
+                       ret = -EAGAIN;
                return ret;
-       return ret == len ? 0 : -1;
+       }
+       return ret == len ? 0 : -ENOMEM;
 }
 
 #if !defined(__HAVE_ARCH_GATE_AREA)
index 7b26560..01fbe93 100644 (file)
@@ -78,8 +78,6 @@ success:
 
        mm->locked_vm -= pages;
 out:
-       if (ret == -ENOMEM)
-               ret = -EAGAIN;
        return ret;
 }
 
index 5edccd9..ed75bc9 100644 (file)
@@ -266,6 +266,27 @@ void *vmalloc_node(unsigned long size, int node)
 }
 EXPORT_SYMBOL(vmalloc_node);
 
+#ifndef PAGE_KERNEL_EXEC
+# define PAGE_KERNEL_EXEC PAGE_KERNEL
+#endif
+
+/**
+ *     vmalloc_exec  -  allocate virtually contiguous, executable memory
+ *     @size:          allocation size
+ *
+ *     Kernel-internal function to allocate enough pages to cover @size
+ *     the page level allocator and map them into contiguous and
+ *     executable kernel virtual space.
+ *
+ *     For tight control over page level allocator and protection flags
+ *     use __vmalloc() instead.
+ */
+
+void *vmalloc_exec(unsigned long size)
+{
+       return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC);
+}
+
 /**
  * vmalloc_32  -  allocate virtually contiguous memory (32bit addressable)
  *     @size:          allocation size
index 9fba838..36b5eed 100644 (file)
@@ -596,7 +596,7 @@ int main(int ac, char **av)
                break;
        }
 
-       if (conf_get_changed() && conf_write(NULL)) {
+       if (conf_write(NULL)) {
                fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
                exit(1);
        }
index 0759761..df6a188 100644 (file)
@@ -222,10 +222,8 @@ load:
                                continue;
                        if (def == S_DEF_USER) {
                                sym = sym_find(line + 9);
-                               if (!sym) {
-                                       conf_warning("trying to assign nonexistent symbol %s", line + 9);
+                               if (!sym)
                                        break;
-                               }
                        } else {
                                sym = sym_lookup(line + 9, 0);
                                if (sym->type == S_UNKNOWN)
@@ -261,10 +259,8 @@ load:
                        }
                        if (def == S_DEF_USER) {
                                sym = sym_find(line + 7);
-                               if (!sym) {
-                                       conf_warning("trying to assign nonexistent symbol %s", line + 7);
+                               if (!sym)
                                        break;
-                               }
                        } else {
                                sym = sym_lookup(line + 7, 0);
                                if (sym->type == S_UNKNOWN)
index 558dadb..e024e45 100644 (file)
@@ -604,6 +604,9 @@ snd_seq_oss_synth_make_info(struct seq_oss_devinfo *dp, int dev, struct synth_in
 {
        struct seq_oss_synth *rec;
 
+       if (dev < 0 || dev >= dp->max_synthdev)
+               return -ENXIO;
+
        if (dp->synths[dev].is_midi) {
                struct midi_info minf;
                snd_seq_oss_midi_make_info(dp, dp->synths[dev].midi_mapped, &minf);