sparc, sparc64: use arch/sparc/include
Sam Ravnborg [Sun, 27 Jul 2008 21:00:59 +0000 (23:00 +0200)]
The majority of this patch was created by the following script:

***
ASM=arch/sparc/include/asm
mkdir -p $ASM
git mv include/asm-sparc64/ftrace.h $ASM
git rm include/asm-sparc64/*
git mv include/asm-sparc/* $ASM
sed -ie 's/asm-sparc64/asm/g' $ASM/*
sed -ie 's/asm-sparc/asm/g' $ASM/*
***

The rest was an update of the top-level Makefile to use sparc
for header files when sparc64 is being build.
And a small fixlet to pick up the correct unistd.h from
sparc64 code.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

577 files changed:
Makefile
arch/sparc/include/asm/Kbuild [moved from include/asm-sparc/Kbuild with 100% similarity]
arch/sparc/include/asm/agp.h [moved from include/asm-sparc/agp.h with 100% similarity]
arch/sparc/include/asm/apb.h [moved from include/asm-sparc/apb.h with 100% similarity]
arch/sparc/include/asm/apc.h [moved from include/asm-sparc/apc.h with 100% similarity]
arch/sparc/include/asm/asi.h [moved from include/asm-sparc/asi.h with 100% similarity]
arch/sparc/include/asm/asmmacro.h [moved from include/asm-sparc/asmmacro.h with 100% similarity]
arch/sparc/include/asm/atomic.h [new file with mode: 0644]
arch/sparc/include/asm/atomic_32.h [moved from include/asm-sparc/atomic_32.h with 100% similarity]
arch/sparc/include/asm/atomic_64.h [moved from include/asm-sparc/atomic_64.h with 100% similarity]
arch/sparc/include/asm/auxio.h [new file with mode: 0644]
arch/sparc/include/asm/auxio_32.h [new file with mode: 0644]
arch/sparc/include/asm/auxio_64.h [moved from include/asm-sparc/auxio_64.h with 100% similarity]
arch/sparc/include/asm/auxvec.h [moved from include/asm-sparc/auxvec.h with 100% similarity]
arch/sparc/include/asm/backoff.h [moved from include/asm-sparc/backoff.h with 100% similarity]
arch/sparc/include/asm/bbc.h [moved from include/asm-sparc/bbc.h with 100% similarity]
arch/sparc/include/asm/bitext.h [moved from include/asm-sparc/bitext.h with 100% similarity]
arch/sparc/include/asm/bitops.h [new file with mode: 0644]
arch/sparc/include/asm/bitops_32.h [moved from include/asm-sparc/bitops_32.h with 100% similarity]
arch/sparc/include/asm/bitops_64.h [moved from include/asm-sparc/bitops_64.h with 100% similarity]
arch/sparc/include/asm/bpp.h [moved from include/asm-sparc/bpp.h with 100% similarity]
arch/sparc/include/asm/btfixup.h [new file with mode: 0644]
arch/sparc/include/asm/bug.h [moved from include/asm-sparc/bug.h with 100% similarity]
arch/sparc/include/asm/bugs.h [new file with mode: 0644]
arch/sparc/include/asm/byteorder.h [moved from include/asm-sparc/byteorder.h with 100% similarity]
arch/sparc/include/asm/cache.h [moved from include/asm-sparc/cache.h with 100% similarity]
arch/sparc/include/asm/cacheflush.h [new file with mode: 0644]
arch/sparc/include/asm/cacheflush_32.h [moved from include/asm-sparc/cacheflush_32.h with 100% similarity]
arch/sparc/include/asm/cacheflush_64.h [moved from include/asm-sparc/cacheflush_64.h with 100% similarity]
arch/sparc/include/asm/chafsr.h [moved from include/asm-sparc/chafsr.h with 100% similarity]
arch/sparc/include/asm/checksum.h [new file with mode: 0644]
arch/sparc/include/asm/checksum_32.h [moved from include/asm-sparc/checksum_32.h with 100% similarity]
arch/sparc/include/asm/checksum_64.h [moved from include/asm-sparc/checksum_64.h with 100% similarity]
arch/sparc/include/asm/chmctrl.h [moved from include/asm-sparc/chmctrl.h with 100% similarity]
arch/sparc/include/asm/clock.h [moved from include/asm-sparc/clock.h with 100% similarity]
arch/sparc/include/asm/cmt.h [moved from include/asm-sparc/cmt.h with 100% similarity]
arch/sparc/include/asm/compat.h [moved from include/asm-sparc/compat.h with 100% similarity]
arch/sparc/include/asm/compat_signal.h [moved from include/asm-sparc/compat_signal.h with 100% similarity]
arch/sparc/include/asm/contregs.h [moved from include/asm-sparc/contregs.h with 100% similarity]
arch/sparc/include/asm/cpudata.h [new file with mode: 0644]
arch/sparc/include/asm/cpudata_32.h [new file with mode: 0644]
arch/sparc/include/asm/cpudata_64.h [moved from include/asm-sparc/cpudata_64.h with 100% similarity]
arch/sparc/include/asm/cputime.h [moved from include/asm-sparc/cputime.h with 100% similarity]
arch/sparc/include/asm/current.h [new file with mode: 0644]
arch/sparc/include/asm/cypress.h [moved from include/asm-sparc/cypress.h with 100% similarity]
arch/sparc/include/asm/dcr.h [moved from include/asm-sparc/dcr.h with 100% similarity]
arch/sparc/include/asm/dcu.h [moved from include/asm-sparc/dcu.h with 100% similarity]
arch/sparc/include/asm/delay.h [new file with mode: 0644]
arch/sparc/include/asm/delay_32.h [moved from include/asm-sparc/delay_32.h with 100% similarity]
arch/sparc/include/asm/delay_64.h [moved from include/asm-sparc/delay_64.h with 100% similarity]
arch/sparc/include/asm/device.h [moved from include/asm-sparc/device.h with 100% similarity]
arch/sparc/include/asm/display7seg.h [moved from include/asm-sparc/display7seg.h with 100% similarity]
arch/sparc/include/asm/div64.h [moved from include/asm-sparc/div64.h with 100% similarity]
arch/sparc/include/asm/dma-mapping.h [new file with mode: 0644]
arch/sparc/include/asm/dma-mapping_32.h [moved from include/asm-sparc/dma-mapping_32.h with 100% similarity]
arch/sparc/include/asm/dma-mapping_64.h [moved from include/asm-sparc/dma-mapping_64.h with 100% similarity]
arch/sparc/include/asm/dma.h [new file with mode: 0644]
arch/sparc/include/asm/dma_32.h [new file with mode: 0644]
arch/sparc/include/asm/dma_64.h [new file with mode: 0644]
arch/sparc/include/asm/ebus.h [new file with mode: 0644]
arch/sparc/include/asm/ebus_32.h [moved from include/asm-sparc/ebus_32.h with 100% similarity]
arch/sparc/include/asm/ebus_64.h [moved from include/asm-sparc/ebus_64.h with 100% similarity]
arch/sparc/include/asm/ecc.h [moved from include/asm-sparc/ecc.h with 100% similarity]
arch/sparc/include/asm/eeprom.h [moved from include/asm-sparc/eeprom.h with 100% similarity]
arch/sparc/include/asm/elf.h [new file with mode: 0644]
arch/sparc/include/asm/elf_32.h [moved from include/asm-sparc/elf_32.h with 100% similarity]
arch/sparc/include/asm/elf_64.h [moved from include/asm-sparc/elf_64.h with 100% similarity]
arch/sparc/include/asm/emergency-restart.h [moved from include/asm-sparc/emergency-restart.h with 100% similarity]
arch/sparc/include/asm/envctrl.h [moved from include/asm-sparc/envctrl.h with 100% similarity]
arch/sparc/include/asm/errno.h [moved from include/asm-sparc/errno.h with 100% similarity]
arch/sparc/include/asm/estate.h [moved from include/asm-sparc/estate.h with 100% similarity]
arch/sparc/include/asm/fb.h [moved from include/asm-sparc/fb.h with 100% similarity]
arch/sparc/include/asm/fbio.h [moved from include/asm-sparc/fbio.h with 100% similarity]
arch/sparc/include/asm/fcntl.h [moved from include/asm-sparc/fcntl.h with 100% similarity]
arch/sparc/include/asm/fhc.h [moved from include/asm-sparc/fhc.h with 100% similarity]
arch/sparc/include/asm/fixmap.h [moved from include/asm-sparc/fixmap.h with 100% similarity]
arch/sparc/include/asm/floppy.h [new file with mode: 0644]
arch/sparc/include/asm/floppy_32.h [new file with mode: 0644]
arch/sparc/include/asm/floppy_64.h [moved from include/asm-sparc/floppy_64.h with 100% similarity]
arch/sparc/include/asm/fpumacro.h [moved from include/asm-sparc/fpumacro.h with 100% similarity]
arch/sparc/include/asm/ftrace.h [moved from include/asm-sparc64/ftrace.h with 100% similarity]
arch/sparc/include/asm/futex.h [new file with mode: 0644]
arch/sparc/include/asm/futex_32.h [moved from include/asm-sparc/futex_32.h with 100% similarity]
arch/sparc/include/asm/futex_64.h [moved from include/asm-sparc/futex_64.h with 100% similarity]
arch/sparc/include/asm/hardirq.h [new file with mode: 0644]
arch/sparc/include/asm/hardirq_32.h [moved from include/asm-sparc/hardirq_32.h with 100% similarity]
arch/sparc/include/asm/hardirq_64.h [moved from include/asm-sparc/hardirq_64.h with 100% similarity]
arch/sparc/include/asm/head.h [new file with mode: 0644]
arch/sparc/include/asm/head_32.h [moved from include/asm-sparc/head_32.h with 100% similarity]
arch/sparc/include/asm/head_64.h [moved from include/asm-sparc/head_64.h with 100% similarity]
arch/sparc/include/asm/highmem.h [moved from include/asm-sparc/highmem.h with 100% similarity]
arch/sparc/include/asm/hugetlb.h [moved from include/asm-sparc/hugetlb.h with 100% similarity]
arch/sparc/include/asm/hvtramp.h [moved from include/asm-sparc/hvtramp.h with 100% similarity]
arch/sparc/include/asm/hw_irq.h [moved from include/asm-sparc/hw_irq.h with 100% similarity]
arch/sparc/include/asm/hypervisor.h [moved from include/asm-sparc/hypervisor.h with 100% similarity]
arch/sparc/include/asm/ide.h [moved from include/asm-sparc/ide.h with 100% similarity]
arch/sparc/include/asm/idprom.h [moved from include/asm-sparc/idprom.h with 100% similarity]
arch/sparc/include/asm/intr_queue.h [moved from include/asm-sparc/intr_queue.h with 100% similarity]
arch/sparc/include/asm/io-unit.h [moved from include/asm-sparc/io-unit.h with 100% similarity]
arch/sparc/include/asm/io.h [new file with mode: 0644]
arch/sparc/include/asm/io_32.h [moved from include/asm-sparc/io_32.h with 100% similarity]
arch/sparc/include/asm/io_64.h [moved from include/asm-sparc/io_64.h with 100% similarity]
arch/sparc/include/asm/ioctl.h [moved from include/asm-sparc/ioctl.h with 100% similarity]
arch/sparc/include/asm/ioctls.h [moved from include/asm-sparc/ioctls.h with 100% similarity]
arch/sparc/include/asm/iommu.h [new file with mode: 0644]
arch/sparc/include/asm/iommu_32.h [moved from include/asm-sparc/iommu_32.h with 100% similarity]
arch/sparc/include/asm/iommu_64.h [moved from include/asm-sparc/iommu_64.h with 100% similarity]
arch/sparc/include/asm/ipcbuf.h [new file with mode: 0644]
arch/sparc/include/asm/ipcbuf_32.h [moved from include/asm-sparc/ipcbuf_32.h with 100% similarity]
arch/sparc/include/asm/ipcbuf_64.h [moved from include/asm-sparc/ipcbuf_64.h with 100% similarity]
arch/sparc/include/asm/irq.h [new file with mode: 0644]
arch/sparc/include/asm/irq_32.h [moved from include/asm-sparc/irq_32.h with 100% similarity]
arch/sparc/include/asm/irq_64.h [moved from include/asm-sparc/irq_64.h with 100% similarity]
arch/sparc/include/asm/irq_regs.h [moved from include/asm-sparc/irq_regs.h with 100% similarity]
arch/sparc/include/asm/irqflags.h [new file with mode: 0644]
arch/sparc/include/asm/irqflags_32.h [new file with mode: 0644]
arch/sparc/include/asm/irqflags_64.h [new file with mode: 0644]
arch/sparc/include/asm/jsflash.h [moved from include/asm-sparc/jsflash.h with 100% similarity]
arch/sparc/include/asm/kdebug.h [new file with mode: 0644]
arch/sparc/include/asm/kdebug_32.h [moved from include/asm-sparc/kdebug_32.h with 100% similarity]
arch/sparc/include/asm/kdebug_64.h [moved from include/asm-sparc/kdebug_64.h with 100% similarity]
arch/sparc/include/asm/kgdb.h [moved from include/asm-sparc/kgdb.h with 100% similarity]
arch/sparc/include/asm/kmap_types.h [moved from include/asm-sparc/kmap_types.h with 100% similarity]
arch/sparc/include/asm/kprobes.h [moved from include/asm-sparc/kprobes.h with 100% similarity]
arch/sparc/include/asm/ldc.h [moved from include/asm-sparc/ldc.h with 100% similarity]
arch/sparc/include/asm/linkage.h [moved from include/asm-sparc/linkage.h with 100% similarity]
arch/sparc/include/asm/lmb.h [moved from include/asm-sparc/lmb.h with 100% similarity]
arch/sparc/include/asm/local.h [moved from include/asm-sparc/local.h with 100% similarity]
arch/sparc/include/asm/lsu.h [moved from include/asm-sparc/lsu.h with 100% similarity]
arch/sparc/include/asm/machines.h [moved from include/asm-sparc/machines.h with 100% similarity]
arch/sparc/include/asm/mbus.h [moved from include/asm-sparc/mbus.h with 100% similarity]
arch/sparc/include/asm/mc146818rtc.h [new file with mode: 0644]
arch/sparc/include/asm/mc146818rtc_32.h [moved from include/asm-sparc/mc146818rtc_32.h with 100% similarity]
arch/sparc/include/asm/mc146818rtc_64.h [moved from include/asm-sparc/mc146818rtc_64.h with 100% similarity]
arch/sparc/include/asm/mdesc.h [moved from include/asm-sparc/mdesc.h with 100% similarity]
arch/sparc/include/asm/memreg.h [moved from include/asm-sparc/memreg.h with 100% similarity]
arch/sparc/include/asm/mman.h [moved from include/asm-sparc/mman.h with 100% similarity]
arch/sparc/include/asm/mmu.h [new file with mode: 0644]
arch/sparc/include/asm/mmu_32.h [moved from include/asm-sparc/mmu_32.h with 100% similarity]
arch/sparc/include/asm/mmu_64.h [moved from include/asm-sparc/mmu_64.h with 100% similarity]
arch/sparc/include/asm/mmu_context.h [new file with mode: 0644]
arch/sparc/include/asm/mmu_context_32.h [moved from include/asm-sparc/mmu_context_32.h with 100% similarity]
arch/sparc/include/asm/mmu_context_64.h [moved from include/asm-sparc/mmu_context_64.h with 100% similarity]
arch/sparc/include/asm/mmzone.h [moved from include/asm-sparc/mmzone.h with 100% similarity]
arch/sparc/include/asm/module.h [new file with mode: 0644]
arch/sparc/include/asm/module_32.h [moved from include/asm-sparc/module_32.h with 100% similarity]
arch/sparc/include/asm/module_64.h [moved from include/asm-sparc/module_64.h with 100% similarity]
arch/sparc/include/asm/mostek.h [new file with mode: 0644]
arch/sparc/include/asm/mostek_32.h [moved from include/asm-sparc/mostek_32.h with 100% similarity]
arch/sparc/include/asm/mostek_64.h [moved from include/asm-sparc/mostek_64.h with 100% similarity]
arch/sparc/include/asm/mpmbox.h [moved from include/asm-sparc/mpmbox.h with 100% similarity]
arch/sparc/include/asm/msgbuf.h [moved from include/asm-sparc/msgbuf.h with 100% similarity]
arch/sparc/include/asm/msi.h [moved from include/asm-sparc/msi.h with 100% similarity]
arch/sparc/include/asm/mutex.h [moved from include/asm-sparc/mutex.h with 100% similarity]
arch/sparc/include/asm/mxcc.h [moved from include/asm-sparc/mxcc.h with 100% similarity]
arch/sparc/include/asm/ns87303.h [moved from include/asm-sparc/ns87303.h with 100% similarity]
arch/sparc/include/asm/obio.h [moved from include/asm-sparc/obio.h with 100% similarity]
arch/sparc/include/asm/of_device.h [moved from include/asm-sparc/of_device.h with 100% similarity]
arch/sparc/include/asm/of_platform.h [new file with mode: 0644]
arch/sparc/include/asm/of_platform_32.h [new file with mode: 0644]
arch/sparc/include/asm/of_platform_64.h [new file with mode: 0644]
arch/sparc/include/asm/openprom.h [new file with mode: 0644]
arch/sparc/include/asm/openprom_32.h [moved from include/asm-sparc/openprom_32.h with 100% similarity]
arch/sparc/include/asm/openprom_64.h [moved from include/asm-sparc/openprom_64.h with 100% similarity]
arch/sparc/include/asm/openpromio.h [moved from include/asm-sparc/openpromio.h with 100% similarity]
arch/sparc/include/asm/oplib.h [new file with mode: 0644]
arch/sparc/include/asm/oplib_32.h [moved from include/asm-sparc/oplib_32.h with 100% similarity]
arch/sparc/include/asm/oplib_64.h [moved from include/asm-sparc/oplib_64.h with 100% similarity]
arch/sparc/include/asm/page.h [new file with mode: 0644]
arch/sparc/include/asm/page_32.h [moved from include/asm-sparc/page_32.h with 100% similarity]
arch/sparc/include/asm/page_64.h [moved from include/asm-sparc/page_64.h with 100% similarity]
arch/sparc/include/asm/param.h [moved from include/asm-sparc/param.h with 100% similarity]
arch/sparc/include/asm/parport.h [moved from include/asm-sparc/parport.h with 100% similarity]
arch/sparc/include/asm/pbm.h [moved from include/asm-sparc/pbm.h with 100% similarity]
arch/sparc/include/asm/pci.h [new file with mode: 0644]
arch/sparc/include/asm/pci_32.h [moved from include/asm-sparc/pci_32.h with 100% similarity]
arch/sparc/include/asm/pci_64.h [moved from include/asm-sparc/pci_64.h with 100% similarity]
arch/sparc/include/asm/pcic.h [moved from include/asm-sparc/pcic.h with 100% similarity]
arch/sparc/include/asm/percpu.h [new file with mode: 0644]
arch/sparc/include/asm/percpu_32.h [moved from include/asm-sparc/percpu_32.h with 100% similarity]
arch/sparc/include/asm/percpu_64.h [moved from include/asm-sparc/percpu_64.h with 100% similarity]
arch/sparc/include/asm/perfctr.h [moved from include/asm-sparc/perfctr.h with 100% similarity]
arch/sparc/include/asm/pgalloc.h [new file with mode: 0644]
arch/sparc/include/asm/pgalloc_32.h [moved from include/asm-sparc/pgalloc_32.h with 100% similarity]
arch/sparc/include/asm/pgalloc_64.h [moved from include/asm-sparc/pgalloc_64.h with 100% similarity]
arch/sparc/include/asm/pgtable.h [new file with mode: 0644]
arch/sparc/include/asm/pgtable_32.h [new file with mode: 0644]
arch/sparc/include/asm/pgtable_64.h [moved from include/asm-sparc/pgtable_64.h with 100% similarity]
arch/sparc/include/asm/pgtsrmmu.h [moved from include/asm-sparc/pgtsrmmu.h with 100% similarity]
arch/sparc/include/asm/pgtsun4.h [moved from include/asm-sparc/pgtsun4.h with 100% similarity]
arch/sparc/include/asm/pgtsun4c.h [moved from include/asm-sparc/pgtsun4c.h with 100% similarity]
arch/sparc/include/asm/pil.h [moved from include/asm-sparc/pil.h with 100% similarity]
arch/sparc/include/asm/poll.h [moved from include/asm-sparc/poll.h with 100% similarity]
arch/sparc/include/asm/posix_types.h [new file with mode: 0644]
arch/sparc/include/asm/posix_types_32.h [moved from include/asm-sparc/posix_types_32.h with 100% similarity]
arch/sparc/include/asm/posix_types_64.h [moved from include/asm-sparc/posix_types_64.h with 100% similarity]
arch/sparc/include/asm/processor.h [new file with mode: 0644]
arch/sparc/include/asm/processor_32.h [new file with mode: 0644]
arch/sparc/include/asm/processor_64.h [new file with mode: 0644]
arch/sparc/include/asm/prom.h [moved from include/asm-sparc/prom.h with 100% similarity]
arch/sparc/include/asm/psr.h [moved from include/asm-sparc/psr.h with 100% similarity]
arch/sparc/include/asm/psrcompat.h [moved from include/asm-sparc/psrcompat.h with 100% similarity]
arch/sparc/include/asm/pstate.h [moved from include/asm-sparc/pstate.h with 100% similarity]
arch/sparc/include/asm/ptrace.h [new file with mode: 0644]
arch/sparc/include/asm/ptrace_32.h [moved from include/asm-sparc/ptrace_32.h with 100% similarity]
arch/sparc/include/asm/ptrace_64.h [moved from include/asm-sparc/ptrace_64.h with 100% similarity]
arch/sparc/include/asm/reboot.h [moved from include/asm-sparc/reboot.h with 100% similarity]
arch/sparc/include/asm/reg.h [new file with mode: 0644]
arch/sparc/include/asm/reg_32.h [new file with mode: 0644]
arch/sparc/include/asm/reg_64.h [new file with mode: 0644]
arch/sparc/include/asm/resource.h [moved from include/asm-sparc/resource.h with 100% similarity]
arch/sparc/include/asm/ross.h [moved from include/asm-sparc/ross.h with 100% similarity]
arch/sparc/include/asm/rtc.h [moved from include/asm-sparc/rtc.h with 100% similarity]
arch/sparc/include/asm/rwsem-const.h [moved from include/asm-sparc/rwsem-const.h with 100% similarity]
arch/sparc/include/asm/rwsem.h [moved from include/asm-sparc/rwsem.h with 100% similarity]
arch/sparc/include/asm/sbi.h [moved from include/asm-sparc/sbi.h with 100% similarity]
arch/sparc/include/asm/sbus.h [new file with mode: 0644]
arch/sparc/include/asm/sbus_32.h [moved from include/asm-sparc/sbus_32.h with 100% similarity]
arch/sparc/include/asm/sbus_64.h [moved from include/asm-sparc/sbus_64.h with 100% similarity]
arch/sparc/include/asm/scatterlist.h [new file with mode: 0644]
arch/sparc/include/asm/scatterlist_32.h [moved from include/asm-sparc/scatterlist_32.h with 100% similarity]
arch/sparc/include/asm/scatterlist_64.h [moved from include/asm-sparc/scatterlist_64.h with 100% similarity]
arch/sparc/include/asm/scratchpad.h [moved from include/asm-sparc/scratchpad.h with 100% similarity]
arch/sparc/include/asm/seccomp.h [moved from include/asm-sparc/seccomp.h with 100% similarity]
arch/sparc/include/asm/sections.h [new file with mode: 0644]
arch/sparc/include/asm/sections_32.h [moved from include/asm-sparc/sections_32.h with 100% similarity]
arch/sparc/include/asm/sections_64.h [moved from include/asm-sparc/sections_64.h with 100% similarity]
arch/sparc/include/asm/sembuf.h [moved from include/asm-sparc/sembuf.h with 100% similarity]
arch/sparc/include/asm/setup.h [moved from include/asm-sparc/setup.h with 100% similarity]
arch/sparc/include/asm/sfafsr.h [moved from include/asm-sparc/sfafsr.h with 100% similarity]
arch/sparc/include/asm/sfp-machine.h [new file with mode: 0644]
arch/sparc/include/asm/sfp-machine_32.h [moved from include/asm-sparc/sfp-machine_32.h with 100% similarity]
arch/sparc/include/asm/sfp-machine_64.h [moved from include/asm-sparc/sfp-machine_64.h with 100% similarity]
arch/sparc/include/asm/shmbuf.h [moved from include/asm-sparc/shmbuf.h with 100% similarity]
arch/sparc/include/asm/shmparam.h [new file with mode: 0644]
arch/sparc/include/asm/shmparam_32.h [moved from include/asm-sparc/shmparam_32.h with 100% similarity]
arch/sparc/include/asm/shmparam_64.h [moved from include/asm-sparc/shmparam_64.h with 100% similarity]
arch/sparc/include/asm/sigcontext.h [new file with mode: 0644]
arch/sparc/include/asm/sigcontext_32.h [moved from include/asm-sparc/sigcontext_32.h with 100% similarity]
arch/sparc/include/asm/sigcontext_64.h [moved from include/asm-sparc/sigcontext_64.h with 100% similarity]
arch/sparc/include/asm/siginfo.h [new file with mode: 0644]
arch/sparc/include/asm/siginfo_32.h [moved from include/asm-sparc/siginfo_32.h with 100% similarity]
arch/sparc/include/asm/siginfo_64.h [moved from include/asm-sparc/siginfo_64.h with 100% similarity]
arch/sparc/include/asm/signal.h [new file with mode: 0644]
arch/sparc/include/asm/signal_32.h [moved from include/asm-sparc/signal_32.h with 100% similarity]
arch/sparc/include/asm/signal_64.h [moved from include/asm-sparc/signal_64.h with 100% similarity]
arch/sparc/include/asm/smp.h [new file with mode: 0644]
arch/sparc/include/asm/smp_32.h [moved from include/asm-sparc/smp_32.h with 100% similarity]
arch/sparc/include/asm/smp_64.h [moved from include/asm-sparc/smp_64.h with 100% similarity]
arch/sparc/include/asm/smpprim.h [moved from include/asm-sparc/smpprim.h with 100% similarity]
arch/sparc/include/asm/socket.h [moved from include/asm-sparc/socket.h with 100% similarity]
arch/sparc/include/asm/sockios.h [moved from include/asm-sparc/sockios.h with 100% similarity]
arch/sparc/include/asm/sparsemem.h [moved from include/asm-sparc/sparsemem.h with 100% similarity]
arch/sparc/include/asm/spinlock.h [new file with mode: 0644]
arch/sparc/include/asm/spinlock_32.h [moved from include/asm-sparc/spinlock_32.h with 100% similarity]
arch/sparc/include/asm/spinlock_64.h [moved from include/asm-sparc/spinlock_64.h with 100% similarity]
arch/sparc/include/asm/spinlock_types.h [moved from include/asm-sparc/spinlock_types.h with 100% similarity]
arch/sparc/include/asm/spitfire.h [moved from include/asm-sparc/spitfire.h with 100% similarity]
arch/sparc/include/asm/sstate.h [moved from include/asm-sparc/sstate.h with 100% similarity]
arch/sparc/include/asm/stacktrace.h [moved from include/asm-sparc/stacktrace.h with 100% similarity]
arch/sparc/include/asm/starfire.h [moved from include/asm-sparc/starfire.h with 100% similarity]
arch/sparc/include/asm/stat.h [new file with mode: 0644]
arch/sparc/include/asm/stat_32.h [moved from include/asm-sparc/stat_32.h with 100% similarity]
arch/sparc/include/asm/stat_64.h [moved from include/asm-sparc/stat_64.h with 100% similarity]
arch/sparc/include/asm/statfs.h [new file with mode: 0644]
arch/sparc/include/asm/statfs_32.h [moved from include/asm-sparc/statfs_32.h with 100% similarity]
arch/sparc/include/asm/statfs_64.h [moved from include/asm-sparc/statfs_64.h with 100% similarity]
arch/sparc/include/asm/string.h [new file with mode: 0644]
arch/sparc/include/asm/string_32.h [moved from include/asm-sparc/string_32.h with 100% similarity]
arch/sparc/include/asm/string_64.h [moved from include/asm-sparc/string_64.h with 100% similarity]
arch/sparc/include/asm/sun4paddr.h [moved from include/asm-sparc/sun4paddr.h with 100% similarity]
arch/sparc/include/asm/sun4prom.h [moved from include/asm-sparc/sun4prom.h with 100% similarity]
arch/sparc/include/asm/sunbpp.h [new file with mode: 0644]
arch/sparc/include/asm/swift.h [moved from include/asm-sparc/swift.h with 100% similarity]
arch/sparc/include/asm/syscalls.h [moved from include/asm-sparc/syscalls.h with 100% similarity]
arch/sparc/include/asm/sysen.h [moved from include/asm-sparc/sysen.h with 100% similarity]
arch/sparc/include/asm/system.h [new file with mode: 0644]
arch/sparc/include/asm/system_32.h [moved from include/asm-sparc/system_32.h with 100% similarity]
arch/sparc/include/asm/system_64.h [moved from include/asm-sparc/system_64.h with 100% similarity]
arch/sparc/include/asm/termbits.h [moved from include/asm-sparc/termbits.h with 100% similarity]
arch/sparc/include/asm/termios.h [moved from include/asm-sparc/termios.h with 100% similarity]
arch/sparc/include/asm/thread_info.h [new file with mode: 0644]
arch/sparc/include/asm/thread_info_32.h [moved from include/asm-sparc/thread_info_32.h with 100% similarity]
arch/sparc/include/asm/thread_info_64.h [moved from include/asm-sparc/thread_info_64.h with 100% similarity]
arch/sparc/include/asm/timer.h [new file with mode: 0644]
arch/sparc/include/asm/timer_32.h [moved from include/asm-sparc/timer_32.h with 100% similarity]
arch/sparc/include/asm/timer_64.h [moved from include/asm-sparc/timer_64.h with 100% similarity]
arch/sparc/include/asm/timex.h [new file with mode: 0644]
arch/sparc/include/asm/timex_32.h [new file with mode: 0644]
arch/sparc/include/asm/timex_64.h [new file with mode: 0644]
arch/sparc/include/asm/tlb.h [new file with mode: 0644]
arch/sparc/include/asm/tlb_32.h [moved from include/asm-sparc/tlb_32.h with 100% similarity]
arch/sparc/include/asm/tlb_64.h [moved from include/asm-sparc/tlb_64.h with 100% similarity]
arch/sparc/include/asm/tlbflush.h [new file with mode: 0644]
arch/sparc/include/asm/tlbflush_32.h [moved from include/asm-sparc/tlbflush_32.h with 100% similarity]
arch/sparc/include/asm/tlbflush_64.h [moved from include/asm-sparc/tlbflush_64.h with 100% similarity]
arch/sparc/include/asm/topology.h [new file with mode: 0644]
arch/sparc/include/asm/topology_32.h [moved from include/asm-sparc/topology_32.h with 100% similarity]
arch/sparc/include/asm/topology_64.h [moved from include/asm-sparc/topology_64.h with 100% similarity]
arch/sparc/include/asm/traps.h [moved from include/asm-sparc/traps.h with 100% similarity]
arch/sparc/include/asm/tsb.h [moved from include/asm-sparc/tsb.h with 100% similarity]
arch/sparc/include/asm/tsunami.h [moved from include/asm-sparc/tsunami.h with 100% similarity]
arch/sparc/include/asm/ttable.h [moved from include/asm-sparc/ttable.h with 100% similarity]
arch/sparc/include/asm/turbosparc.h [moved from include/asm-sparc/turbosparc.h with 100% similarity]
arch/sparc/include/asm/types.h [moved from include/asm-sparc/types.h with 100% similarity]
arch/sparc/include/asm/uaccess.h [new file with mode: 0644]
arch/sparc/include/asm/uaccess_32.h [moved from include/asm-sparc/uaccess_32.h with 100% similarity]
arch/sparc/include/asm/uaccess_64.h [moved from include/asm-sparc/uaccess_64.h with 100% similarity]
arch/sparc/include/asm/uctx.h [moved from include/asm-sparc/uctx.h with 100% similarity]
arch/sparc/include/asm/unaligned.h [moved from include/asm-sparc/unaligned.h with 100% similarity]
arch/sparc/include/asm/unistd.h [new file with mode: 0644]
arch/sparc/include/asm/unistd_32.h [moved from include/asm-sparc/unistd_32.h with 100% similarity]
arch/sparc/include/asm/unistd_64.h [moved from include/asm-sparc/unistd_64.h with 100% similarity]
arch/sparc/include/asm/upa.h [moved from include/asm-sparc/upa.h with 100% similarity]
arch/sparc/include/asm/user.h [moved from include/asm-sparc/user.h with 100% similarity]
arch/sparc/include/asm/utrap.h [new file with mode: 0644]
arch/sparc/include/asm/vac-ops.h [moved from include/asm-sparc/vac-ops.h with 100% similarity]
arch/sparc/include/asm/vaddrs.h [new file with mode: 0644]
arch/sparc/include/asm/vfc_ioctls.h [moved from include/asm-sparc/vfc_ioctls.h with 100% similarity]
arch/sparc/include/asm/vga.h [moved from include/asm-sparc/vga.h with 100% similarity]
arch/sparc/include/asm/viking.h [moved from include/asm-sparc/viking.h with 100% similarity]
arch/sparc/include/asm/vio.h [moved from include/asm-sparc/vio.h with 100% similarity]
arch/sparc/include/asm/visasm.h [moved from include/asm-sparc/visasm.h with 100% similarity]
arch/sparc/include/asm/watchdog.h [moved from include/asm-sparc/watchdog.h with 100% similarity]
arch/sparc/include/asm/winmacro.h [moved from include/asm-sparc/winmacro.h with 100% similarity]
arch/sparc/include/asm/xor.h [new file with mode: 0644]
arch/sparc/include/asm/xor_32.h [new file with mode: 0644]
arch/sparc/include/asm/xor_64.h [new file with mode: 0644]
arch/sparc64/kernel/compat_audit.c
include/asm-sparc/atomic.h [deleted file]
include/asm-sparc/auxio.h [deleted file]
include/asm-sparc/auxio_32.h [deleted file]
include/asm-sparc/bitops.h [deleted file]
include/asm-sparc/btfixup.h [deleted file]
include/asm-sparc/bugs.h [deleted file]
include/asm-sparc/cacheflush.h [deleted file]
include/asm-sparc/checksum.h [deleted file]
include/asm-sparc/cpudata.h [deleted file]
include/asm-sparc/cpudata_32.h [deleted file]
include/asm-sparc/current.h [deleted file]
include/asm-sparc/delay.h [deleted file]
include/asm-sparc/dma-mapping.h [deleted file]
include/asm-sparc/dma.h [deleted file]
include/asm-sparc/dma_32.h [deleted file]
include/asm-sparc/dma_64.h [deleted file]
include/asm-sparc/ebus.h [deleted file]
include/asm-sparc/elf.h [deleted file]
include/asm-sparc/floppy.h [deleted file]
include/asm-sparc/floppy_32.h [deleted file]
include/asm-sparc/futex.h [deleted file]
include/asm-sparc/hardirq.h [deleted file]
include/asm-sparc/head.h [deleted file]
include/asm-sparc/io.h [deleted file]
include/asm-sparc/iommu.h [deleted file]
include/asm-sparc/ipcbuf.h [deleted file]
include/asm-sparc/irq.h [deleted file]
include/asm-sparc/irqflags.h [deleted file]
include/asm-sparc/irqflags_32.h [deleted file]
include/asm-sparc/irqflags_64.h [deleted file]
include/asm-sparc/kdebug.h [deleted file]
include/asm-sparc/mc146818rtc.h [deleted file]
include/asm-sparc/mmu.h [deleted file]
include/asm-sparc/mmu_context.h [deleted file]
include/asm-sparc/module.h [deleted file]
include/asm-sparc/mostek.h [deleted file]
include/asm-sparc/of_platform.h [deleted file]
include/asm-sparc/of_platform_32.h [deleted file]
include/asm-sparc/of_platform_64.h [deleted file]
include/asm-sparc/openprom.h [deleted file]
include/asm-sparc/oplib.h [deleted file]
include/asm-sparc/page.h [deleted file]
include/asm-sparc/pci.h [deleted file]
include/asm-sparc/percpu.h [deleted file]
include/asm-sparc/pgalloc.h [deleted file]
include/asm-sparc/pgtable.h [deleted file]
include/asm-sparc/pgtable_32.h [deleted file]
include/asm-sparc/posix_types.h [deleted file]
include/asm-sparc/processor.h [deleted file]
include/asm-sparc/processor_32.h [deleted file]
include/asm-sparc/processor_64.h [deleted file]
include/asm-sparc/ptrace.h [deleted file]
include/asm-sparc/reg.h [deleted file]
include/asm-sparc/reg_32.h [deleted file]
include/asm-sparc/reg_64.h [deleted file]
include/asm-sparc/sbus.h [deleted file]
include/asm-sparc/scatterlist.h [deleted file]
include/asm-sparc/sections.h [deleted file]
include/asm-sparc/sfp-machine.h [deleted file]
include/asm-sparc/shmparam.h [deleted file]
include/asm-sparc/sigcontext.h [deleted file]
include/asm-sparc/siginfo.h [deleted file]
include/asm-sparc/signal.h [deleted file]
include/asm-sparc/smp.h [deleted file]
include/asm-sparc/spinlock.h [deleted file]
include/asm-sparc/stat.h [deleted file]
include/asm-sparc/statfs.h [deleted file]
include/asm-sparc/string.h [deleted file]
include/asm-sparc/sunbpp.h [deleted file]
include/asm-sparc/system.h [deleted file]
include/asm-sparc/thread_info.h [deleted file]
include/asm-sparc/timer.h [deleted file]
include/asm-sparc/timex.h [deleted file]
include/asm-sparc/timex_32.h [deleted file]
include/asm-sparc/timex_64.h [deleted file]
include/asm-sparc/tlb.h [deleted file]
include/asm-sparc/tlbflush.h [deleted file]
include/asm-sparc/topology.h [deleted file]
include/asm-sparc/uaccess.h [deleted file]
include/asm-sparc/unistd.h [deleted file]
include/asm-sparc/utrap.h [deleted file]
include/asm-sparc/vaddrs.h [deleted file]
include/asm-sparc/xor.h [deleted file]
include/asm-sparc/xor_32.h [deleted file]
include/asm-sparc/xor_64.h [deleted file]
include/asm-sparc64/Kbuild [deleted file]
include/asm-sparc64/agp.h [deleted file]
include/asm-sparc64/apb.h [deleted file]
include/asm-sparc64/asi.h [deleted file]
include/asm-sparc64/atomic.h [deleted file]
include/asm-sparc64/auxio.h [deleted file]
include/asm-sparc64/auxvec.h [deleted file]
include/asm-sparc64/backoff.h [deleted file]
include/asm-sparc64/bbc.h [deleted file]
include/asm-sparc64/bitops.h [deleted file]
include/asm-sparc64/bpp.h [deleted file]
include/asm-sparc64/bug.h [deleted file]
include/asm-sparc64/bugs.h [deleted file]
include/asm-sparc64/byteorder.h [deleted file]
include/asm-sparc64/cache.h [deleted file]
include/asm-sparc64/cacheflush.h [deleted file]
include/asm-sparc64/chafsr.h [deleted file]
include/asm-sparc64/checksum.h [deleted file]
include/asm-sparc64/chmctrl.h [deleted file]
include/asm-sparc64/cmt.h [deleted file]
include/asm-sparc64/compat.h [deleted file]
include/asm-sparc64/compat_signal.h [deleted file]
include/asm-sparc64/cpudata.h [deleted file]
include/asm-sparc64/cputime.h [deleted file]
include/asm-sparc64/current.h [deleted file]
include/asm-sparc64/dcr.h [deleted file]
include/asm-sparc64/dcu.h [deleted file]
include/asm-sparc64/delay.h [deleted file]
include/asm-sparc64/device.h [deleted file]
include/asm-sparc64/display7seg.h [deleted file]
include/asm-sparc64/div64.h [deleted file]
include/asm-sparc64/dma-mapping.h [deleted file]
include/asm-sparc64/dma.h [deleted file]
include/asm-sparc64/ebus.h [deleted file]
include/asm-sparc64/elf.h [deleted file]
include/asm-sparc64/emergency-restart.h [deleted file]
include/asm-sparc64/envctrl.h [deleted file]
include/asm-sparc64/errno.h [deleted file]
include/asm-sparc64/estate.h [deleted file]
include/asm-sparc64/fb.h [deleted file]
include/asm-sparc64/fbio.h [deleted file]
include/asm-sparc64/fcntl.h [deleted file]
include/asm-sparc64/fhc.h [deleted file]
include/asm-sparc64/floppy.h [deleted file]
include/asm-sparc64/fpumacro.h [deleted file]
include/asm-sparc64/futex.h [deleted file]
include/asm-sparc64/hardirq.h [deleted file]
include/asm-sparc64/head.h [deleted file]
include/asm-sparc64/hugetlb.h [deleted file]
include/asm-sparc64/hvtramp.h [deleted file]
include/asm-sparc64/hw_irq.h [deleted file]
include/asm-sparc64/hypervisor.h [deleted file]
include/asm-sparc64/ide.h [deleted file]
include/asm-sparc64/idprom.h [deleted file]
include/asm-sparc64/intr_queue.h [deleted file]
include/asm-sparc64/io.h [deleted file]
include/asm-sparc64/ioctl.h [deleted file]
include/asm-sparc64/ioctls.h [deleted file]
include/asm-sparc64/iommu.h [deleted file]
include/asm-sparc64/ipcbuf.h [deleted file]
include/asm-sparc64/irq.h [deleted file]
include/asm-sparc64/irq_regs.h [deleted file]
include/asm-sparc64/irqflags.h [deleted file]
include/asm-sparc64/kdebug.h [deleted file]
include/asm-sparc64/kgdb.h [deleted file]
include/asm-sparc64/kmap_types.h [deleted file]
include/asm-sparc64/kprobes.h [deleted file]
include/asm-sparc64/ldc.h [deleted file]
include/asm-sparc64/linkage.h [deleted file]
include/asm-sparc64/lmb.h [deleted file]
include/asm-sparc64/local.h [deleted file]
include/asm-sparc64/lsu.h [deleted file]
include/asm-sparc64/mc146818rtc.h [deleted file]
include/asm-sparc64/mdesc.h [deleted file]
include/asm-sparc64/mman.h [deleted file]
include/asm-sparc64/mmu.h [deleted file]
include/asm-sparc64/mmu_context.h [deleted file]
include/asm-sparc64/mmzone.h [deleted file]
include/asm-sparc64/module.h [deleted file]
include/asm-sparc64/mostek.h [deleted file]
include/asm-sparc64/msgbuf.h [deleted file]
include/asm-sparc64/mutex.h [deleted file]
include/asm-sparc64/ns87303.h [deleted file]
include/asm-sparc64/of_device.h [deleted file]
include/asm-sparc64/of_platform.h [deleted file]
include/asm-sparc64/openprom.h [deleted file]
include/asm-sparc64/openpromio.h [deleted file]
include/asm-sparc64/oplib.h [deleted file]
include/asm-sparc64/page.h [deleted file]
include/asm-sparc64/param.h [deleted file]
include/asm-sparc64/parport.h [deleted file]
include/asm-sparc64/pci.h [deleted file]
include/asm-sparc64/percpu.h [deleted file]
include/asm-sparc64/perfctr.h [deleted file]
include/asm-sparc64/pgalloc.h [deleted file]
include/asm-sparc64/pgtable.h [deleted file]
include/asm-sparc64/pil.h [deleted file]
include/asm-sparc64/poll.h [deleted file]
include/asm-sparc64/posix_types.h [deleted file]
include/asm-sparc64/processor.h [deleted file]
include/asm-sparc64/prom.h [deleted file]
include/asm-sparc64/psrcompat.h [deleted file]
include/asm-sparc64/pstate.h [deleted file]
include/asm-sparc64/ptrace.h [deleted file]
include/asm-sparc64/reboot.h [deleted file]
include/asm-sparc64/reg.h [deleted file]
include/asm-sparc64/resource.h [deleted file]
include/asm-sparc64/rtc.h [deleted file]
include/asm-sparc64/rwsem-const.h [deleted file]
include/asm-sparc64/rwsem.h [deleted file]
include/asm-sparc64/sbus.h [deleted file]
include/asm-sparc64/scatterlist.h [deleted file]
include/asm-sparc64/scratchpad.h [deleted file]
include/asm-sparc64/seccomp.h [deleted file]
include/asm-sparc64/sections.h [deleted file]
include/asm-sparc64/sembuf.h [deleted file]
include/asm-sparc64/setup.h [deleted file]
include/asm-sparc64/sfafsr.h [deleted file]
include/asm-sparc64/sfp-machine.h [deleted file]
include/asm-sparc64/shmbuf.h [deleted file]
include/asm-sparc64/shmparam.h [deleted file]
include/asm-sparc64/sigcontext.h [deleted file]
include/asm-sparc64/siginfo.h [deleted file]
include/asm-sparc64/signal.h [deleted file]
include/asm-sparc64/smp.h [deleted file]
include/asm-sparc64/socket.h [deleted file]
include/asm-sparc64/sockios.h [deleted file]
include/asm-sparc64/sparsemem.h [deleted file]
include/asm-sparc64/spinlock.h [deleted file]
include/asm-sparc64/spinlock_types.h [deleted file]
include/asm-sparc64/spitfire.h [deleted file]
include/asm-sparc64/sstate.h [deleted file]
include/asm-sparc64/stacktrace.h [deleted file]
include/asm-sparc64/starfire.h [deleted file]
include/asm-sparc64/stat.h [deleted file]
include/asm-sparc64/statfs.h [deleted file]
include/asm-sparc64/string.h [deleted file]
include/asm-sparc64/sunbpp.h [deleted file]
include/asm-sparc64/syscalls.h [deleted file]
include/asm-sparc64/system.h [deleted file]
include/asm-sparc64/termbits.h [deleted file]
include/asm-sparc64/termios.h [deleted file]
include/asm-sparc64/thread_info.h [deleted file]
include/asm-sparc64/timer.h [deleted file]
include/asm-sparc64/timex.h [deleted file]
include/asm-sparc64/tlb.h [deleted file]
include/asm-sparc64/tlbflush.h [deleted file]
include/asm-sparc64/topology.h [deleted file]
include/asm-sparc64/tsb.h [deleted file]
include/asm-sparc64/ttable.h [deleted file]
include/asm-sparc64/types.h [deleted file]
include/asm-sparc64/uaccess.h [deleted file]
include/asm-sparc64/uctx.h [deleted file]
include/asm-sparc64/unaligned.h [deleted file]
include/asm-sparc64/unistd.h [deleted file]
include/asm-sparc64/upa.h [deleted file]
include/asm-sparc64/user.h [deleted file]
include/asm-sparc64/utrap.h [deleted file]
include/asm-sparc64/vga.h [deleted file]
include/asm-sparc64/vio.h [deleted file]
include/asm-sparc64/visasm.h [deleted file]
include/asm-sparc64/watchdog.h [deleted file]
include/asm-sparc64/xor.h [deleted file]

index 40f2481..baee3d4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -206,7 +206,11 @@ ifeq ($(ARCH),x86_64)
 endif
 
 # Where to locate arch specific headers
-hdr-arch       := $(SRCARCH)
+ifeq ($(ARCH),sparc64)
+       hdr-arch  := sparc
+else
+       hdr-arch  := $(SRCARCH)
+endif
 
 KCONFIG_CONFIG ?= .config
 
diff --git a/arch/sparc/include/asm/atomic.h b/arch/sparc/include/asm/atomic.h
new file mode 100644 (file)
index 0000000..8ff83d8
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_ATOMIC_H
+#define ___ASM_SPARC_ATOMIC_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/atomic_64.h>
+#else
+#include <asm/atomic_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/auxio.h b/arch/sparc/include/asm/auxio.h
new file mode 100644 (file)
index 0000000..13dc67f
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_AUXIO_H
+#define ___ASM_SPARC_AUXIO_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/auxio_64.h>
+#else
+#include <asm/auxio_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/auxio_32.h b/arch/sparc/include/asm/auxio_32.h
new file mode 100644 (file)
index 0000000..e03e088
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * auxio.h:  Definitions and code for the Auxiliary I/O register.
+ *
+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ */
+#ifndef _SPARC_AUXIO_H
+#define _SPARC_AUXIO_H
+
+#include <asm/system.h>
+#include <asm/vaddrs.h>
+
+/* This register is an unsigned char in IO space.  It does two things.
+ * First, it is used to control the front panel LED light on machines
+ * that have it (good for testing entry points to trap handlers and irq's)
+ * Secondly, it controls various floppy drive parameters.
+ */
+#define AUXIO_ORMEIN      0xf0    /* All writes must set these bits. */
+#define AUXIO_ORMEIN4M    0xc0    /* sun4m - All writes must set these bits. */
+#define AUXIO_FLPY_DENS   0x20    /* Floppy density, high if set. Read only. */
+#define AUXIO_FLPY_DCHG   0x10    /* A disk change occurred.  Read only. */
+#define AUXIO_EDGE_ON     0x10    /* sun4m - On means Jumper block is in. */
+#define AUXIO_FLPY_DSEL   0x08    /* Drive select/start-motor. Write only. */
+#define AUXIO_LINK_TEST   0x08    /* sun4m - On means TPE Carrier detect. */
+
+/* Set the following to one, then zero, after doing a pseudo DMA transfer. */
+#define AUXIO_FLPY_TCNT   0x04    /* Floppy terminal count. Write only. */
+
+/* Set the following to zero to eject the floppy. */
+#define AUXIO_FLPY_EJCT   0x02    /* Eject floppy disk.  Write only. */
+#define AUXIO_LED         0x01    /* On if set, off if unset. Read/Write */
+
+#ifndef __ASSEMBLY__
+
+/*
+ * NOTE: these routines are implementation dependent--
+ * understand the hardware you are querying!
+ */
+extern void set_auxio(unsigned char bits_on, unsigned char bits_off);
+extern unsigned char get_auxio(void); /* .../asm/floppy.h */
+
+/*
+ * The following routines are provided for driver-compatibility
+ * with sparc64 (primarily sunlance.c)
+ */
+
+#define AUXIO_LTE_ON    1
+#define AUXIO_LTE_OFF   0
+
+/* auxio_set_lte - Set Link Test Enable (TPE Link Detect)
+ *
+ * on - AUXIO_LTE_ON or AUXIO_LTE_OFF
+ */
+#define auxio_set_lte(on) \
+do { \
+       if(on) { \
+               set_auxio(AUXIO_LINK_TEST, 0); \
+       } else { \
+               set_auxio(0, AUXIO_LINK_TEST); \
+       } \
+} while (0)
+
+#define AUXIO_LED_ON    1
+#define AUXIO_LED_OFF   0
+
+/* auxio_set_led - Set system front panel LED
+ *
+ * on - AUXIO_LED_ON or AUXIO_LED_OFF
+ */
+#define auxio_set_led(on) \
+do { \
+       if(on) { \
+               set_auxio(AUXIO_LED, 0); \
+       } else { \
+               set_auxio(0, AUXIO_LED); \
+       } \
+} while (0)
+
+#endif /* !(__ASSEMBLY__) */
+
+
+/* AUXIO2 (Power Off Control) */
+extern __volatile__ unsigned char * auxio_power_register;
+
+#define        AUXIO_POWER_DETECT_FAILURE      32
+#define        AUXIO_POWER_CLEAR_FAILURE       2
+#define        AUXIO_POWER_OFF                 1
+
+
+#endif /* !(_SPARC_AUXIO_H) */
diff --git a/arch/sparc/include/asm/bitops.h b/arch/sparc/include/asm/bitops.h
new file mode 100644 (file)
index 0000000..b1edd94
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_BITOPS_H
+#define ___ASM_SPARC_BITOPS_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/bitops_64.h>
+#else
+#include <asm/bitops_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/btfixup.h b/arch/sparc/include/asm/btfixup.h
new file mode 100644 (file)
index 0000000..797722c
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ *  asm/btfixup.h:    Macros for boot time linking.
+ *
+ *  Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
+ */
+#ifndef _SPARC_BTFIXUP_H
+#define _SPARC_BTFIXUP_H
+
+#include <linux/init.h>
+
+#ifndef __ASSEMBLY__
+
+#ifdef MODULE
+extern unsigned int ___illegal_use_of_BTFIXUP_SIMM13_in_module(void);
+extern unsigned int ___illegal_use_of_BTFIXUP_SETHI_in_module(void);
+extern unsigned int ___illegal_use_of_BTFIXUP_HALF_in_module(void);
+extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void);
+
+#define BTFIXUP_SIMM13(__name) ___illegal_use_of_BTFIXUP_SIMM13_in_module()
+#define BTFIXUP_HALF(__name) ___illegal_use_of_BTFIXUP_HALF_in_module()
+#define BTFIXUP_SETHI(__name) ___illegal_use_of_BTFIXUP_SETHI_in_module()
+#define BTFIXUP_INT(__name) ___illegal_use_of_BTFIXUP_INT_in_module()
+#define BTFIXUP_BLACKBOX(__name) ___illegal_use_of_BTFIXUP_BLACKBOX_in_module
+
+#else
+
+#define BTFIXUP_SIMM13(__name) ___sf_##__name()
+#define BTFIXUP_HALF(__name) ___af_##__name()
+#define BTFIXUP_SETHI(__name) ___hf_##__name()
+#define BTFIXUP_INT(__name) ((unsigned int)&___i_##__name)
+/* This must be written in assembly and present in a sethi */
+#define BTFIXUP_BLACKBOX(__name) ___b_##__name
+#endif /* MODULE */
+
+/* Fixup call xx */
+
+#define BTFIXUPDEF_CALL(__type, __name, __args...)                                     \
+       extern __type ___f_##__name(__args);                                            \
+       extern unsigned ___fs_##__name[3];
+#define BTFIXUPDEF_CALL_CONST(__type, __name, __args...)                               \
+       extern __type ___f_##__name(__args) __attribute_const__;                        \
+       extern unsigned ___fs_##__name[3];
+#define BTFIXUP_CALL(__name) ___f_##__name
+
+#define BTFIXUPDEF_BLACKBOX(__name)                                                    \
+       extern unsigned ___bs_##__name[2];
+
+/* Put bottom 13bits into some register variable */
+
+#define BTFIXUPDEF_SIMM13(__name)                                                      \
+       static inline unsigned int ___sf_##__name(void) __attribute_const__;            \
+       extern unsigned ___ss_##__name[2];                                              \
+       static inline unsigned int ___sf_##__name(void) {                               \
+               unsigned int ret;                                                       \
+               __asm__ ("or %%g0, ___s_" #__name ", %0" : "=r"(ret));                  \
+               return ret;                                                             \
+       }
+#define BTFIXUPDEF_SIMM13_INIT(__name,__val)                                           \
+       static inline unsigned int ___sf_##__name(void) __attribute_const__;            \
+       extern unsigned ___ss_##__name[2];                                              \
+       static inline unsigned int ___sf_##__name(void) {                               \
+               unsigned int ret;                                                       \
+               __asm__ ("or %%g0, ___s_" #__name "__btset_" #__val ", %0" : "=r"(ret));\
+               return ret;                                                             \
+       }
+
+/* Put either bottom 13 bits, or upper 22 bits into some register variable
+ * (depending on the value, this will lead into sethi FIX, reg; or
+ * mov FIX, reg; )
+ */
+
+#define BTFIXUPDEF_HALF(__name)                                                                \
+       static inline unsigned int ___af_##__name(void) __attribute_const__;            \
+       extern unsigned ___as_##__name[2];                                              \
+       static inline unsigned int ___af_##__name(void) {                               \
+               unsigned int ret;                                                       \
+               __asm__ ("or %%g0, ___a_" #__name ", %0" : "=r"(ret));                  \
+               return ret;                                                             \
+       }
+#define BTFIXUPDEF_HALF_INIT(__name,__val)                                             \
+       static inline unsigned int ___af_##__name(void) __attribute_const__;            \
+       extern unsigned ___as_##__name[2];                                              \
+       static inline unsigned int ___af_##__name(void) {                               \
+               unsigned int ret;                                                       \
+               __asm__ ("or %%g0, ___a_" #__name "__btset_" #__val ", %0" : "=r"(ret));\
+               return ret;                                                             \
+       }
+
+/* Put upper 22 bits into some register variable */
+
+#define BTFIXUPDEF_SETHI(__name)                                                       \
+       static inline unsigned int ___hf_##__name(void) __attribute_const__;            \
+       extern unsigned ___hs_##__name[2];                                              \
+       static inline unsigned int ___hf_##__name(void) {                               \
+               unsigned int ret;                                                       \
+               __asm__ ("sethi %%hi(___h_" #__name "), %0" : "=r"(ret));               \
+               return ret;                                                             \
+       }
+#define BTFIXUPDEF_SETHI_INIT(__name,__val)                                            \
+       static inline unsigned int ___hf_##__name(void) __attribute_const__;            \
+       extern unsigned ___hs_##__name[2];                                              \
+       static inline unsigned int ___hf_##__name(void) {                               \
+               unsigned int ret;                                                       \
+               __asm__ ("sethi %%hi(___h_" #__name "__btset_" #__val "), %0" :         \
+                        "=r"(ret));                                                    \
+               return ret;                                                             \
+       }
+
+/* Put a full 32bit integer into some register variable */
+
+#define BTFIXUPDEF_INT(__name)                                                         \
+       extern unsigned char ___i_##__name;                                             \
+       extern unsigned ___is_##__name[2];
+
+#define BTFIXUPCALL_NORM       0x00000000                      /* Always call */
+#define BTFIXUPCALL_NOP                0x01000000                      /* Possibly optimize to nop */
+#define BTFIXUPCALL_RETINT(i)  (0x90102000|((i) & 0x1fff))     /* Possibly optimize to mov i, %o0 */
+#define BTFIXUPCALL_ORINT(i)   (0x90122000|((i) & 0x1fff))     /* Possibly optimize to or %o0, i, %o0 */
+#define BTFIXUPCALL_RETO0      0x01000000                      /* Return first parameter, actually a nop */
+#define BTFIXUPCALL_ANDNINT(i) (0x902a2000|((i) & 0x1fff))     /* Possibly optimize to andn %o0, i, %o0 */
+#define BTFIXUPCALL_SWAPO0O1   0xd27a0000                      /* Possibly optimize to swap [%o0],%o1 */
+#define BTFIXUPCALL_SWAPO0G0   0xc07a0000                      /* Possibly optimize to swap [%o0],%g0 */
+#define BTFIXUPCALL_SWAPG1G2   0xc4784000                      /* Possibly optimize to swap [%g1],%g2 */
+#define BTFIXUPCALL_STG0O0     0xc0220000                      /* Possibly optimize to st %g0,[%o0] */
+#define BTFIXUPCALL_STO1O0     0xd2220000                      /* Possibly optimize to st %o1,[%o0] */
+
+#define BTFIXUPSET_CALL(__name, __addr, __insn)                                                \
+       do {                                                                            \
+               ___fs_##__name[0] |= 1;                                                 \
+               ___fs_##__name[1] = (unsigned long)__addr;                              \
+               ___fs_##__name[2] = __insn;                                             \
+       } while (0)
+       
+#define BTFIXUPSET_BLACKBOX(__name, __func)                                            \
+       do {                                                                            \
+               ___bs_##__name[0] |= 1;                                                 \
+               ___bs_##__name[1] = (unsigned long)__func;                              \
+       } while (0)
+       
+#define BTFIXUPCOPY_CALL(__name, __from)                                               \
+       do {                                                                            \
+               ___fs_##__name[0] |= 1;                                                 \
+               ___fs_##__name[1] = ___fs_##__from[1];                                  \
+               ___fs_##__name[2] = ___fs_##__from[2];                                  \
+       } while (0)
+               
+#define BTFIXUPSET_SIMM13(__name, __val)                                               \
+       do {                                                                            \
+               ___ss_##__name[0] |= 1;                                                 \
+               ___ss_##__name[1] = (unsigned)__val;                                    \
+       } while (0)
+       
+#define BTFIXUPCOPY_SIMM13(__name, __from)                                             \
+       do {                                                                            \
+               ___ss_##__name[0] |= 1;                                                 \
+               ___ss_##__name[1] = ___ss_##__from[1];                                  \
+       } while (0)
+               
+#define BTFIXUPSET_HALF(__name, __val)                                                 \
+       do {                                                                            \
+               ___as_##__name[0] |= 1;                                                 \
+               ___as_##__name[1] = (unsigned)__val;                                    \
+       } while (0)
+       
+#define BTFIXUPCOPY_HALF(__name, __from)                                               \
+       do {                                                                            \
+               ___as_##__name[0] |= 1;                                                 \
+               ___as_##__name[1] = ___as_##__from[1];                                  \
+       } while (0)
+               
+#define BTFIXUPSET_SETHI(__name, __val)                                                        \
+       do {                                                                            \
+               ___hs_##__name[0] |= 1;                                                 \
+               ___hs_##__name[1] = (unsigned)__val;                                    \
+       } while (0)
+       
+#define BTFIXUPCOPY_SETHI(__name, __from)                                              \
+       do {                                                                            \
+               ___hs_##__name[0] |= 1;                                                 \
+               ___hs_##__name[1] = ___hs_##__from[1];                                  \
+       } while (0)
+               
+#define BTFIXUPSET_INT(__name, __val)                                                  \
+       do {                                                                            \
+               ___is_##__name[0] |= 1;                                                 \
+               ___is_##__name[1] = (unsigned)__val;                                    \
+       } while (0)
+       
+#define BTFIXUPCOPY_INT(__name, __from)                                                        \
+       do {                                                                            \
+               ___is_##__name[0] |= 1;                                                 \
+               ___is_##__name[1] = ___is_##__from[1];                                  \
+       } while (0)
+       
+#define BTFIXUPVAL_CALL(__name)                                                                \
+       ((unsigned long)___fs_##__name[1])
+       
+extern void btfixup(void);
+
+#else /* __ASSEMBLY__ */
+
+#define BTFIXUP_SETHI(__name)                  %hi(___h_ ## __name)
+#define BTFIXUP_SETHI_INIT(__name,__val)       %hi(___h_ ## __name ## __btset_ ## __val)
+
+#endif /* __ASSEMBLY__ */
+       
+#endif /* !(_SPARC_BTFIXUP_H) */
diff --git a/arch/sparc/include/asm/bugs.h b/arch/sparc/include/asm/bugs.h
new file mode 100644 (file)
index 0000000..e179bc1
--- /dev/null
@@ -0,0 +1,24 @@
+/* include/asm/bugs.h:  Sparc probes for various bugs.
+ *
+ * Copyright (C) 1996, 2007 David S. Miller (davem@davemloft.net)
+ */
+
+#ifdef CONFIG_SPARC32
+#include <asm/cpudata.h>
+#endif
+
+#ifdef CONFIG_SPARC64
+#include <asm/sstate.h>
+#endif
+
+extern unsigned long loops_per_jiffy;
+
+static void __init check_bugs(void)
+{
+#if defined(CONFIG_SPARC32) && !defined(CONFIG_SMP)
+       cpu_data(0).udelay_val = loops_per_jiffy;
+#endif
+#ifdef CONFIG_SPARC64
+       sstate_running();
+#endif
+}
diff --git a/arch/sparc/include/asm/cacheflush.h b/arch/sparc/include/asm/cacheflush.h
new file mode 100644 (file)
index 0000000..0491680
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_CACHEFLUSH_H
+#define ___ASM_SPARC_CACHEFLUSH_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/cacheflush_64.h>
+#else
+#include <asm/cacheflush_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/checksum.h b/arch/sparc/include/asm/checksum.h
new file mode 100644 (file)
index 0000000..7ac0d74
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_CHECKSUM_H
+#define ___ASM_SPARC_CHECKSUM_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/checksum_64.h>
+#else
+#include <asm/checksum_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/cpudata.h b/arch/sparc/include/asm/cpudata.h
new file mode 100644 (file)
index 0000000..b5976de
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_CPUDATA_H
+#define ___ASM_SPARC_CPUDATA_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/cpudata_64.h>
+#else
+#include <asm/cpudata_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/cpudata_32.h b/arch/sparc/include/asm/cpudata_32.h
new file mode 100644 (file)
index 0000000..31d48a0
--- /dev/null
@@ -0,0 +1,27 @@
+/* cpudata.h: Per-cpu parameters.
+ *
+ * Copyright (C) 2004 Keith M Wesolowski (wesolows@foobazco.org)
+ *
+ * Based on include/asm/cpudata.h and Linux 2.4 smp.h
+ * both (C) David S. Miller.
+ */
+
+#ifndef _SPARC_CPUDATA_H
+#define _SPARC_CPUDATA_H
+
+#include <linux/percpu.h>
+
+typedef struct {
+       unsigned long udelay_val;
+       unsigned long clock_tick;
+       unsigned int multiplier;
+       unsigned int counter;
+       int prom_node;
+       int mid;
+       int next;
+} cpuinfo_sparc;
+
+DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);
+#define cpu_data(__cpu) per_cpu(__cpu_data, (__cpu))
+
+#endif /* _SPARC_CPUDATA_H */
diff --git a/arch/sparc/include/asm/current.h b/arch/sparc/include/asm/current.h
new file mode 100644 (file)
index 0000000..10a0df5
--- /dev/null
@@ -0,0 +1,34 @@
+/* include/asm/current.h
+ *
+ * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Copyright (C) 2002 Pete Zaitcev (zaitcev@yahoo.com)
+ * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
+ *
+ *  Derived from "include/asm-s390/current.h" by
+ *  Martin Schwidefsky (schwidefsky@de.ibm.com)
+ *  Derived from "include/asm-i386/current.h"
+*/
+#ifndef _SPARC_CURRENT_H
+#define _SPARC_CURRENT_H
+
+#include <linux/thread_info.h>
+
+#ifdef CONFIG_SPARC64
+register struct task_struct *current asm("g4");
+#endif
+
+#ifdef CONFIG_SPARC32
+/* We might want to consider using %g4 like sparc64 to shave a few cycles.
+ *
+ * Two stage process (inline + #define) for type-checking.
+ * We also obfuscate get_current() to check if anyone used that by mistake.
+ */
+struct task_struct;
+static inline struct task_struct *__get_current(void)
+{
+       return current_thread_info()->task;
+}
+#define current __get_current()
+#endif
+
+#endif /* !(_SPARC_CURRENT_H) */
diff --git a/arch/sparc/include/asm/delay.h b/arch/sparc/include/asm/delay.h
new file mode 100644 (file)
index 0000000..467caa2
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_DELAY_H
+#define ___ASM_SPARC_DELAY_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/delay_64.h>
+#else
+#include <asm/delay_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h
new file mode 100644 (file)
index 0000000..0f4150e
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_DMA_MAPPING_H
+#define ___ASM_SPARC_DMA_MAPPING_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/dma-mapping_64.h>
+#else
+#include <asm/dma-mapping_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/dma.h b/arch/sparc/include/asm/dma.h
new file mode 100644 (file)
index 0000000..aa1d90a
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_DMA_H
+#define ___ASM_SPARC_DMA_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/dma_64.h>
+#else
+#include <asm/dma_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/dma_32.h b/arch/sparc/include/asm/dma_32.h
new file mode 100644 (file)
index 0000000..cf7189c
--- /dev/null
@@ -0,0 +1,288 @@
+/* include/asm/dma.h
+ *
+ * Copyright 1995 (C) David S. Miller (davem@davemloft.net)
+ */
+
+#ifndef _ASM_SPARC_DMA_H
+#define _ASM_SPARC_DMA_H
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+#include <asm/vac-ops.h>  /* for invalidate's, etc. */
+#include <asm/sbus.h>
+#include <asm/delay.h>
+#include <asm/oplib.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <linux/spinlock.h>
+
+struct page;
+extern spinlock_t  dma_spin_lock;
+
+static inline unsigned long claim_dma_lock(void)
+{
+       unsigned long flags;
+       spin_lock_irqsave(&dma_spin_lock, flags);
+       return flags;
+}
+
+static inline void release_dma_lock(unsigned long flags)
+{
+       spin_unlock_irqrestore(&dma_spin_lock, flags);
+}
+
+/* These are irrelevant for Sparc DMA, but we leave it in so that
+ * things can compile.
+ */
+#define MAX_DMA_CHANNELS 8
+#define MAX_DMA_ADDRESS  (~0UL)
+#define DMA_MODE_READ    1
+#define DMA_MODE_WRITE   2
+
+/* Useful constants */
+#define SIZE_16MB      (16*1024*1024)
+#define SIZE_64K       (64*1024)
+
+/* SBUS DMA controller reg offsets */
+#define DMA_CSR                0x00UL          /* rw  DMA control/status register    0x00   */
+#define DMA_ADDR       0x04UL          /* rw  DMA transfer address register  0x04   */
+#define DMA_COUNT      0x08UL          /* rw  DMA transfer count register    0x08   */
+#define DMA_TEST       0x0cUL          /* rw  DMA test/debug register        0x0c   */
+
+/* DVMA chip revisions */
+enum dvma_rev {
+       dvmarev0,
+       dvmaesc1,
+       dvmarev1,
+       dvmarev2,
+       dvmarev3,
+       dvmarevplus,
+       dvmahme
+};
+
+#define DMA_HASCOUNT(rev)  ((rev)==dvmaesc1)
+
+/* Linux DMA information structure, filled during probe. */
+struct sbus_dma {
+       struct sbus_dma *next;
+       struct sbus_dev *sdev;
+       void __iomem *regs;
+
+       /* Status, misc info */
+       int node;                /* Prom node for this DMA device */
+       int running;             /* Are we doing DMA now? */
+       int allocated;           /* Are we "owned" by anyone yet? */
+
+       /* Transfer information. */
+       unsigned long addr;      /* Start address of current transfer */
+       int nbytes;              /* Size of current transfer */
+       int realbytes;           /* For splitting up large transfers, etc. */
+
+       /* DMA revision */
+       enum dvma_rev revision;
+};
+
+extern struct sbus_dma *dma_chain;
+
+/* Broken hardware... */
+#ifdef CONFIG_SUN4
+/* Have to sort this out. Does rev0 work fine on sun4[cmd] without isbroken?
+ * Or is rev0 present only on sun4 boxes? -jj */
+#define DMA_ISBROKEN(dma)    ((dma)->revision == dvmarev0 || (dma)->revision == dvmarev1)
+#else
+#define DMA_ISBROKEN(dma)    ((dma)->revision == dvmarev1)
+#endif
+#define DMA_ISESC1(dma)      ((dma)->revision == dvmaesc1)
+
+/* Main routines in dma.c */
+extern void dvma_init(struct sbus_bus *);
+
+/* Fields in the cond_reg register */
+/* First, the version identification bits */
+#define DMA_DEVICE_ID    0xf0000000        /* Device identification bits */
+#define DMA_VERS0        0x00000000        /* Sunray DMA version */
+#define DMA_ESCV1        0x40000000        /* DMA ESC Version 1 */
+#define DMA_VERS1        0x80000000        /* DMA rev 1 */
+#define DMA_VERS2        0xa0000000        /* DMA rev 2 */
+#define DMA_VERHME       0xb0000000        /* DMA hme gate array */
+#define DMA_VERSPLUS     0x90000000        /* DMA rev 1 PLUS */
+
+#define DMA_HNDL_INTR    0x00000001        /* An IRQ needs to be handled */
+#define DMA_HNDL_ERROR   0x00000002        /* We need to take an error */
+#define DMA_FIFO_ISDRAIN 0x0000000c        /* The DMA FIFO is draining */
+#define DMA_INT_ENAB     0x00000010        /* Turn on interrupts */
+#define DMA_FIFO_INV     0x00000020        /* Invalidate the FIFO */
+#define DMA_ACC_SZ_ERR   0x00000040        /* The access size was bad */
+#define DMA_FIFO_STDRAIN 0x00000040        /* DMA_VERS1 Drain the FIFO */
+#define DMA_RST_SCSI     0x00000080        /* Reset the SCSI controller */
+#define DMA_RST_ENET     DMA_RST_SCSI      /* Reset the ENET controller */
+#define DMA_RST_BPP      DMA_RST_SCSI      /* Reset the BPP controller */
+#define DMA_ST_WRITE     0x00000100        /* write from device to memory */
+#define DMA_ENABLE       0x00000200        /* Fire up DMA, handle requests */
+#define DMA_PEND_READ    0x00000400        /* DMA_VERS1/0/PLUS Pending Read */
+#define DMA_ESC_BURST    0x00000800        /* 1=16byte 0=32byte */
+#define DMA_READ_AHEAD   0x00001800        /* DMA read ahead partial longword */
+#define DMA_DSBL_RD_DRN  0x00001000        /* No EC drain on slave reads */
+#define DMA_BCNT_ENAB    0x00002000        /* If on, use the byte counter */
+#define DMA_TERM_CNTR    0x00004000        /* Terminal counter */
+#define DMA_SCSI_SBUS64  0x00008000        /* HME: Enable 64-bit SBUS mode. */
+#define DMA_CSR_DISAB    0x00010000        /* No FIFO drains during csr */
+#define DMA_SCSI_DISAB   0x00020000        /* No FIFO drains during reg */
+#define DMA_DSBL_WR_INV  0x00020000        /* No EC inval. on slave writes */
+#define DMA_ADD_ENABLE   0x00040000        /* Special ESC DVMA optimization */
+#define DMA_E_BURSTS    0x000c0000        /* ENET: SBUS r/w burst mask */
+#define DMA_E_BURST32   0x00040000        /* ENET: SBUS 32 byte r/w burst */
+#define DMA_E_BURST16   0x00000000        /* ENET: SBUS 16 byte r/w burst */
+#define DMA_BRST_SZ      0x000c0000        /* SCSI: SBUS r/w burst size */
+#define DMA_BRST64       0x00080000        /* SCSI: 64byte bursts (HME on UltraSparc only) */
+#define DMA_BRST32       0x00040000        /* SCSI/BPP: 32byte bursts */
+#define DMA_BRST16       0x00000000        /* SCSI/BPP: 16byte bursts */
+#define DMA_BRST0        0x00080000        /* SCSI: no bursts (non-HME gate arrays) */
+#define DMA_ADDR_DISAB   0x00100000        /* No FIFO drains during addr */
+#define DMA_2CLKS        0x00200000        /* Each transfer = 2 clock ticks */
+#define DMA_3CLKS        0x00400000        /* Each transfer = 3 clock ticks */
+#define DMA_EN_ENETAUI   DMA_3CLKS         /* Put lance into AUI-cable mode */
+#define DMA_CNTR_DISAB   0x00800000        /* No IRQ when DMA_TERM_CNTR set */
+#define DMA_AUTO_NADDR   0x01000000        /* Use "auto nxt addr" feature */
+#define DMA_SCSI_ON      0x02000000        /* Enable SCSI dma */
+#define DMA_BPP_ON       DMA_SCSI_ON       /* Enable BPP dma */
+#define DMA_PARITY_OFF   0x02000000        /* HME: disable parity checking */
+#define DMA_LOADED_ADDR  0x04000000        /* Address has been loaded */
+#define DMA_LOADED_NADDR 0x08000000        /* Next address has been loaded */
+#define DMA_RESET_FAS366 0x08000000        /* HME: Assert RESET to FAS366 */
+
+/* Values describing the burst-size property from the PROM */
+#define DMA_BURST1       0x01
+#define DMA_BURST2       0x02
+#define DMA_BURST4       0x04
+#define DMA_BURST8       0x08
+#define DMA_BURST16      0x10
+#define DMA_BURST32      0x20
+#define DMA_BURST64      0x40
+#define DMA_BURSTBITS    0x7f
+
+/* Determine highest possible final transfer address given a base */
+#define DMA_MAXEND(addr) (0x01000000UL-(((unsigned long)(addr))&0x00ffffffUL))
+
+/* Yes, I hack a lot of elisp in my spare time... */
+#define DMA_ERROR_P(regs)  ((((regs)->cond_reg) & DMA_HNDL_ERROR))
+#define DMA_IRQ_P(regs)    ((((regs)->cond_reg) & (DMA_HNDL_INTR | DMA_HNDL_ERROR)))
+#define DMA_WRITE_P(regs)  ((((regs)->cond_reg) & DMA_ST_WRITE))
+#define DMA_OFF(regs)      ((((regs)->cond_reg) &= (~DMA_ENABLE)))
+#define DMA_INTSOFF(regs)  ((((regs)->cond_reg) &= (~DMA_INT_ENAB)))
+#define DMA_INTSON(regs)   ((((regs)->cond_reg) |= (DMA_INT_ENAB)))
+#define DMA_PUNTFIFO(regs) ((((regs)->cond_reg) |= DMA_FIFO_INV))
+#define DMA_SETSTART(regs, addr)  ((((regs)->st_addr) = (char *) addr))
+#define DMA_BEGINDMA_W(regs) \
+        ((((regs)->cond_reg |= (DMA_ST_WRITE|DMA_ENABLE|DMA_INT_ENAB))))
+#define DMA_BEGINDMA_R(regs) \
+        ((((regs)->cond_reg |= ((DMA_ENABLE|DMA_INT_ENAB)&(~DMA_ST_WRITE)))))
+
+/* For certain DMA chips, we need to disable ints upon irq entry
+ * and turn them back on when we are done.  So in any ESP interrupt
+ * handler you *must* call DMA_IRQ_ENTRY upon entry and DMA_IRQ_EXIT
+ * when leaving the handler.  You have been warned...
+ */
+#define DMA_IRQ_ENTRY(dma, dregs) do { \
+        if(DMA_ISBROKEN(dma)) DMA_INTSOFF(dregs); \
+   } while (0)
+
+#define DMA_IRQ_EXIT(dma, dregs) do { \
+       if(DMA_ISBROKEN(dma)) DMA_INTSON(dregs); \
+   } while(0)
+
+#if 0  /* P3 this stuff is inline in ledma.c:init_restart_ledma() */
+/* Pause until counter runs out or BIT isn't set in the DMA condition
+ * register.
+ */
+static inline void sparc_dma_pause(struct sparc_dma_registers *regs,
+                                      unsigned long bit)
+{
+       int ctr = 50000;   /* Let's find some bugs ;) */
+
+       /* Busy wait until the bit is not set any more */
+       while((regs->cond_reg&bit) && (ctr>0)) {
+               ctr--;
+               __delay(5);
+       }
+
+       /* Check for bogus outcome. */
+       if(!ctr)
+               panic("DMA timeout");
+}
+
+/* Reset the friggin' thing... */
+#define DMA_RESET(dma) do { \
+       struct sparc_dma_registers *regs = dma->regs;                      \
+       /* Let the current FIFO drain itself */                            \
+       sparc_dma_pause(regs, (DMA_FIFO_ISDRAIN));                         \
+       /* Reset the logic */                                              \
+       regs->cond_reg |= (DMA_RST_SCSI);     /* assert */                 \
+       __delay(400);                         /* let the bits set ;) */    \
+       regs->cond_reg &= ~(DMA_RST_SCSI);    /* de-assert */              \
+       sparc_dma_enable_interrupts(regs);    /* Re-enable interrupts */   \
+       /* Enable FAST transfers if available */                           \
+       if(dma->revision>dvmarev1) regs->cond_reg |= DMA_3CLKS;            \
+       dma->running = 0;                                                  \
+} while(0)
+#endif
+
+#define for_each_dvma(dma) \
+        for((dma) = dma_chain; (dma); (dma) = (dma)->next)
+
+extern int get_dma_list(char *);
+extern int request_dma(unsigned int, __const__ char *);
+extern void free_dma(unsigned int);
+
+/* From PCI */
+
+#ifdef CONFIG_PCI
+extern int isa_dma_bridge_buggy;
+#else
+#define isa_dma_bridge_buggy   (0)
+#endif
+
+/* Routines for data transfer buffers. */
+BTFIXUPDEF_CALL(char *, mmu_lockarea, char *, unsigned long)
+BTFIXUPDEF_CALL(void,   mmu_unlockarea, char *, unsigned long)
+
+#define mmu_lockarea(vaddr,len) BTFIXUP_CALL(mmu_lockarea)(vaddr,len)
+#define mmu_unlockarea(vaddr,len) BTFIXUP_CALL(mmu_unlockarea)(vaddr,len)
+
+/* These are implementations for sbus_map_sg/sbus_unmap_sg... collapse later */
+BTFIXUPDEF_CALL(__u32, mmu_get_scsi_one, char *, unsigned long, struct sbus_bus *sbus)
+BTFIXUPDEF_CALL(void,  mmu_get_scsi_sgl, struct scatterlist *, int, struct sbus_bus *sbus)
+BTFIXUPDEF_CALL(void,  mmu_release_scsi_one, __u32, unsigned long, struct sbus_bus *sbus)
+BTFIXUPDEF_CALL(void,  mmu_release_scsi_sgl, struct scatterlist *, int, struct sbus_bus *sbus)
+
+#define mmu_get_scsi_one(vaddr,len,sbus) BTFIXUP_CALL(mmu_get_scsi_one)(vaddr,len,sbus)
+#define mmu_get_scsi_sgl(sg,sz,sbus) BTFIXUP_CALL(mmu_get_scsi_sgl)(sg,sz,sbus)
+#define mmu_release_scsi_one(vaddr,len,sbus) BTFIXUP_CALL(mmu_release_scsi_one)(vaddr,len,sbus)
+#define mmu_release_scsi_sgl(sg,sz,sbus) BTFIXUP_CALL(mmu_release_scsi_sgl)(sg,sz,sbus)
+
+/*
+ * mmu_map/unmap are provided by iommu/iounit; Invalid to call on IIep.
+ *
+ * The mmu_map_dma_area establishes two mappings in one go.
+ * These mappings point to pages normally mapped at 'va' (linear address).
+ * First mapping is for CPU visible address at 'a', uncached.
+ * This is an alias, but it works because it is an uncached mapping.
+ * Second mapping is for device visible address, or "bus" address.
+ * The bus address is returned at '*pba'.
+ *
+ * These functions seem distinct, but are hard to split. On sun4c,
+ * at least for now, 'a' is equal to bus address, and retured in *pba.
+ * On sun4m, page attributes depend on the CPU type, so we have to
+ * know if we are mapping RAM or I/O, so it has to be an additional argument
+ * to a separate mapping function for CPU visible mappings.
+ */
+BTFIXUPDEF_CALL(int,  mmu_map_dma_area, dma_addr_t *, unsigned long, unsigned long, int len)
+BTFIXUPDEF_CALL(struct page *, mmu_translate_dvma, unsigned long busa)
+BTFIXUPDEF_CALL(void,  mmu_unmap_dma_area, unsigned long busa, int len)
+
+#define mmu_map_dma_area(pba,va,a,len) BTFIXUP_CALL(mmu_map_dma_area)(pba,va,a,len)
+#define mmu_unmap_dma_area(ba,len) BTFIXUP_CALL(mmu_unmap_dma_area)(ba,len)
+#define mmu_translate_dvma(ba)     BTFIXUP_CALL(mmu_translate_dvma)(ba)
+
+#endif /* !(_ASM_SPARC_DMA_H) */
diff --git a/arch/sparc/include/asm/dma_64.h b/arch/sparc/include/asm/dma_64.h
new file mode 100644 (file)
index 0000000..46a8aec
--- /dev/null
@@ -0,0 +1,205 @@
+/*
+ * include/asm/dma.h
+ *
+ * Copyright 1996 (C) David S. Miller (davem@caip.rutgers.edu)
+ */
+
+#ifndef _ASM_SPARC64_DMA_H
+#define _ASM_SPARC64_DMA_H
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/spinlock.h>
+
+#include <asm/sbus.h>
+#include <asm/delay.h>
+#include <asm/oplib.h>
+
+/* These are irrelevant for Sparc DMA, but we leave it in so that
+ * things can compile.
+ */
+#define MAX_DMA_CHANNELS 8
+#define DMA_MODE_READ    1
+#define DMA_MODE_WRITE   2
+#define MAX_DMA_ADDRESS  (~0UL)
+
+/* Useful constants */
+#define SIZE_16MB      (16*1024*1024)
+#define SIZE_64K       (64*1024)
+
+/* SBUS DMA controller reg offsets */
+#define DMA_CSR                0x00UL          /* rw  DMA control/status register    0x00   */
+#define DMA_ADDR       0x04UL          /* rw  DMA transfer address register  0x04   */
+#define DMA_COUNT      0x08UL          /* rw  DMA transfer count register    0x08   */
+#define DMA_TEST       0x0cUL          /* rw  DMA test/debug register        0x0c   */
+
+/* DVMA chip revisions */
+enum dvma_rev {
+       dvmarev0,
+       dvmaesc1,
+       dvmarev1,
+       dvmarev2,
+       dvmarev3,
+       dvmarevplus,
+       dvmahme
+};
+
+#define DMA_HASCOUNT(rev)  ((rev)==dvmaesc1)
+
+/* Linux DMA information structure, filled during probe. */
+struct sbus_dma {
+       struct sbus_dma *next;
+       struct sbus_dev *sdev;
+       void __iomem *regs;
+
+       /* Status, misc info */
+       int node;                /* Prom node for this DMA device */
+       int running;             /* Are we doing DMA now? */
+       int allocated;           /* Are we "owned" by anyone yet? */
+
+       /* Transfer information. */
+       u32 addr;                /* Start address of current transfer */
+       int nbytes;              /* Size of current transfer */
+       int realbytes;           /* For splitting up large transfers, etc. */
+
+       /* DMA revision */
+       enum dvma_rev revision;
+};
+
+extern struct sbus_dma *dma_chain;
+
+/* Broken hardware... */
+#define DMA_ISBROKEN(dma)    ((dma)->revision == dvmarev1)
+#define DMA_ISESC1(dma)      ((dma)->revision == dvmaesc1)
+
+/* Main routines in dma.c */
+extern void dvma_init(struct sbus_bus *);
+
+/* Fields in the cond_reg register */
+/* First, the version identification bits */
+#define DMA_DEVICE_ID    0xf0000000        /* Device identification bits */
+#define DMA_VERS0        0x00000000        /* Sunray DMA version */
+#define DMA_ESCV1        0x40000000        /* DMA ESC Version 1 */
+#define DMA_VERS1        0x80000000        /* DMA rev 1 */
+#define DMA_VERS2        0xa0000000        /* DMA rev 2 */
+#define DMA_VERHME       0xb0000000        /* DMA hme gate array */
+#define DMA_VERSPLUS     0x90000000        /* DMA rev 1 PLUS */
+
+#define DMA_HNDL_INTR    0x00000001        /* An IRQ needs to be handled */
+#define DMA_HNDL_ERROR   0x00000002        /* We need to take an error */
+#define DMA_FIFO_ISDRAIN 0x0000000c        /* The DMA FIFO is draining */
+#define DMA_INT_ENAB     0x00000010        /* Turn on interrupts */
+#define DMA_FIFO_INV     0x00000020        /* Invalidate the FIFO */
+#define DMA_ACC_SZ_ERR   0x00000040        /* The access size was bad */
+#define DMA_FIFO_STDRAIN 0x00000040        /* DMA_VERS1 Drain the FIFO */
+#define DMA_RST_SCSI     0x00000080        /* Reset the SCSI controller */
+#define DMA_RST_ENET     DMA_RST_SCSI      /* Reset the ENET controller */
+#define DMA_ST_WRITE     0x00000100        /* write from device to memory */
+#define DMA_ENABLE       0x00000200        /* Fire up DMA, handle requests */
+#define DMA_PEND_READ    0x00000400        /* DMA_VERS1/0/PLUS Pending Read */
+#define DMA_ESC_BURST    0x00000800        /* 1=16byte 0=32byte */
+#define DMA_READ_AHEAD   0x00001800        /* DMA read ahead partial longword */
+#define DMA_DSBL_RD_DRN  0x00001000        /* No EC drain on slave reads */
+#define DMA_BCNT_ENAB    0x00002000        /* If on, use the byte counter */
+#define DMA_TERM_CNTR    0x00004000        /* Terminal counter */
+#define DMA_SCSI_SBUS64  0x00008000        /* HME: Enable 64-bit SBUS mode. */
+#define DMA_CSR_DISAB    0x00010000        /* No FIFO drains during csr */
+#define DMA_SCSI_DISAB   0x00020000        /* No FIFO drains during reg */
+#define DMA_DSBL_WR_INV  0x00020000        /* No EC inval. on slave writes */
+#define DMA_ADD_ENABLE   0x00040000        /* Special ESC DVMA optimization */
+#define DMA_E_BURSTS    0x000c0000        /* ENET: SBUS r/w burst mask */
+#define DMA_E_BURST32   0x00040000        /* ENET: SBUS 32 byte r/w burst */
+#define DMA_E_BURST16   0x00000000        /* ENET: SBUS 16 byte r/w burst */
+#define DMA_BRST_SZ      0x000c0000        /* SCSI: SBUS r/w burst size */
+#define DMA_BRST64       0x000c0000        /* SCSI: 64byte bursts (HME on UltraSparc only) */
+#define DMA_BRST32       0x00040000        /* SCSI: 32byte bursts */
+#define DMA_BRST16       0x00000000        /* SCSI: 16byte bursts */
+#define DMA_BRST0        0x00080000        /* SCSI: no bursts (non-HME gate arrays) */
+#define DMA_ADDR_DISAB   0x00100000        /* No FIFO drains during addr */
+#define DMA_2CLKS        0x00200000        /* Each transfer = 2 clock ticks */
+#define DMA_3CLKS        0x00400000        /* Each transfer = 3 clock ticks */
+#define DMA_EN_ENETAUI   DMA_3CLKS         /* Put lance into AUI-cable mode */
+#define DMA_CNTR_DISAB   0x00800000        /* No IRQ when DMA_TERM_CNTR set */
+#define DMA_AUTO_NADDR   0x01000000        /* Use "auto nxt addr" feature */
+#define DMA_SCSI_ON      0x02000000        /* Enable SCSI dma */
+#define DMA_PARITY_OFF   0x02000000        /* HME: disable parity checking */
+#define DMA_LOADED_ADDR  0x04000000        /* Address has been loaded */
+#define DMA_LOADED_NADDR 0x08000000        /* Next address has been loaded */
+#define DMA_RESET_FAS366 0x08000000        /* HME: Assert RESET to FAS366 */
+
+/* Values describing the burst-size property from the PROM */
+#define DMA_BURST1       0x01
+#define DMA_BURST2       0x02
+#define DMA_BURST4       0x04
+#define DMA_BURST8       0x08
+#define DMA_BURST16      0x10
+#define DMA_BURST32      0x20
+#define DMA_BURST64      0x40
+#define DMA_BURSTBITS    0x7f
+
+/* Determine highest possible final transfer address given a base */
+#define DMA_MAXEND(addr) (0x01000000UL-(((unsigned long)(addr))&0x00ffffffUL))
+
+/* Yes, I hack a lot of elisp in my spare time... */
+#define DMA_ERROR_P(regs)  ((sbus_readl((regs) + DMA_CSR) & DMA_HNDL_ERROR))
+#define DMA_IRQ_P(regs)    ((sbus_readl((regs) + DMA_CSR)) & (DMA_HNDL_INTR | DMA_HNDL_ERROR))
+#define DMA_WRITE_P(regs)  ((sbus_readl((regs) + DMA_CSR) & DMA_ST_WRITE))
+#define DMA_OFF(__regs)                \
+do {   u32 tmp = sbus_readl((__regs) + DMA_CSR); \
+       tmp &= ~DMA_ENABLE; \
+       sbus_writel(tmp, (__regs) + DMA_CSR); \
+} while(0)
+#define DMA_INTSOFF(__regs)    \
+do {   u32 tmp = sbus_readl((__regs) + DMA_CSR); \
+       tmp &= ~DMA_INT_ENAB; \
+       sbus_writel(tmp, (__regs) + DMA_CSR); \
+} while(0)
+#define DMA_INTSON(__regs)     \
+do {   u32 tmp = sbus_readl((__regs) + DMA_CSR); \
+       tmp |= DMA_INT_ENAB; \
+       sbus_writel(tmp, (__regs) + DMA_CSR); \
+} while(0)
+#define DMA_PUNTFIFO(__regs)   \
+do {   u32 tmp = sbus_readl((__regs) + DMA_CSR); \
+       tmp |= DMA_FIFO_INV; \
+       sbus_writel(tmp, (__regs) + DMA_CSR); \
+} while(0)
+#define DMA_SETSTART(__regs, __addr)   \
+       sbus_writel((u32)(__addr), (__regs) + DMA_ADDR);
+#define DMA_BEGINDMA_W(__regs) \
+do {   u32 tmp = sbus_readl((__regs) + DMA_CSR); \
+       tmp |= (DMA_ST_WRITE|DMA_ENABLE|DMA_INT_ENAB); \
+       sbus_writel(tmp, (__regs) + DMA_CSR); \
+} while(0)
+#define DMA_BEGINDMA_R(__regs) \
+do {   u32 tmp = sbus_readl((__regs) + DMA_CSR); \
+       tmp |= (DMA_ENABLE|DMA_INT_ENAB); \
+       tmp &= ~DMA_ST_WRITE; \
+       sbus_writel(tmp, (__regs) + DMA_CSR); \
+} while(0)
+
+/* For certain DMA chips, we need to disable ints upon irq entry
+ * and turn them back on when we are done.  So in any ESP interrupt
+ * handler you *must* call DMA_IRQ_ENTRY upon entry and DMA_IRQ_EXIT
+ * when leaving the handler.  You have been warned...
+ */
+#define DMA_IRQ_ENTRY(dma, dregs) do { \
+        if(DMA_ISBROKEN(dma)) DMA_INTSOFF(dregs); \
+   } while (0)
+
+#define DMA_IRQ_EXIT(dma, dregs) do { \
+       if(DMA_ISBROKEN(dma)) DMA_INTSON(dregs); \
+   } while(0)
+
+#define for_each_dvma(dma) \
+        for((dma) = dma_chain; (dma); (dma) = (dma)->next)
+
+/* From PCI */
+
+#ifdef CONFIG_PCI
+extern int isa_dma_bridge_buggy;
+#else
+#define isa_dma_bridge_buggy   (0)
+#endif
+
+#endif /* !(_ASM_SPARC64_DMA_H) */
diff --git a/arch/sparc/include/asm/ebus.h b/arch/sparc/include/asm/ebus.h
new file mode 100644 (file)
index 0000000..83a6d16
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_EBUS_H
+#define ___ASM_SPARC_EBUS_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/ebus_64.h>
+#else
+#include <asm/ebus_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/elf.h b/arch/sparc/include/asm/elf.h
new file mode 100644 (file)
index 0000000..0a2816c
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_ELF_H
+#define ___ASM_SPARC_ELF_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/elf_64.h>
+#else
+#include <asm/elf_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/floppy.h b/arch/sparc/include/asm/floppy.h
new file mode 100644 (file)
index 0000000..faebd33
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_FLOPPY_H
+#define ___ASM_SPARC_FLOPPY_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/floppy_64.h>
+#else
+#include <asm/floppy_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/floppy_32.h b/arch/sparc/include/asm/floppy_32.h
new file mode 100644 (file)
index 0000000..ae3f00b
--- /dev/null
@@ -0,0 +1,388 @@
+/* asm/floppy.h: Sparc specific parts of the Floppy driver.
+ *
+ * Copyright (C) 1995 David S. Miller (davem@davemloft.net)
+ */
+
+#ifndef __ASM_SPARC_FLOPPY_H
+#define __ASM_SPARC_FLOPPY_H
+
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/system.h>
+#include <asm/idprom.h>
+#include <asm/machines.h>
+#include <asm/oplib.h>
+#include <asm/auxio.h>
+#include <asm/irq.h>
+
+/* We don't need no stinkin' I/O port allocation crap. */
+#undef release_region
+#undef request_region
+#define release_region(X, Y)   do { } while(0)
+#define request_region(X, Y, Z)        (1)
+
+/* References:
+ * 1) Netbsd Sun floppy driver.
+ * 2) NCR 82077 controller manual
+ * 3) Intel 82077 controller manual
+ */
+struct sun_flpy_controller {
+       volatile unsigned char status_82072;  /* Main Status reg. */
+#define dcr_82072              status_82072   /* Digital Control reg. */
+#define status1_82077          status_82072   /* Auxiliary Status reg. 1 */
+
+       volatile unsigned char data_82072;    /* Data fifo. */
+#define status2_82077          data_82072     /* Auxiliary Status reg. 2 */
+
+       volatile unsigned char dor_82077;     /* Digital Output reg. */
+       volatile unsigned char tapectl_82077; /* What the? Tape control reg? */
+
+       volatile unsigned char status_82077;  /* Main Status Register. */
+#define drs_82077              status_82077   /* Digital Rate Select reg. */
+
+       volatile unsigned char data_82077;    /* Data fifo. */
+       volatile unsigned char ___unused;
+       volatile unsigned char dir_82077;     /* Digital Input reg. */
+#define dcr_82077              dir_82077      /* Config Control reg. */
+};
+
+/* You'll only ever find one controller on a SparcStation anyways. */
+static struct sun_flpy_controller *sun_fdc = NULL;
+extern volatile unsigned char *fdc_status;
+
+struct sun_floppy_ops {
+       unsigned char (*fd_inb)(int port);
+       void (*fd_outb)(unsigned char value, int port);
+};
+
+static struct sun_floppy_ops sun_fdops;
+
+#define fd_inb(port)              sun_fdops.fd_inb(port)
+#define fd_outb(value,port)       sun_fdops.fd_outb(value,port)
+#define fd_enable_dma()           sun_fd_enable_dma()
+#define fd_disable_dma()          sun_fd_disable_dma()
+#define fd_request_dma()          (0) /* nothing... */
+#define fd_free_dma()             /* nothing... */
+#define fd_clear_dma_ff()         /* nothing... */
+#define fd_set_dma_mode(mode)     sun_fd_set_dma_mode(mode)
+#define fd_set_dma_addr(addr)     sun_fd_set_dma_addr(addr)
+#define fd_set_dma_count(count)   sun_fd_set_dma_count(count)
+#define fd_enable_irq()           /* nothing... */
+#define fd_disable_irq()          /* nothing... */
+#define fd_cacheflush(addr, size) /* nothing... */
+#define fd_request_irq()          sun_fd_request_irq()
+#define fd_free_irq()             /* nothing... */
+#if 0  /* P3: added by Alain, these cause a MMU corruption. 19960524 XXX */
+#define fd_dma_mem_alloc(size)    ((unsigned long) vmalloc(size))
+#define fd_dma_mem_free(addr,size) (vfree((void *)(addr)))
+#endif
+
+/* XXX This isn't really correct. XXX */
+#define get_dma_residue(x)        (0)
+
+#define FLOPPY0_TYPE  4
+#define FLOPPY1_TYPE  0
+
+/* Super paranoid... */
+#undef HAVE_DISABLE_HLT
+
+/* Here is where we catch the floppy driver trying to initialize,
+ * therefore this is where we call the PROM device tree probing
+ * routine etc. on the Sparc.
+ */
+#define FDC1                      sun_floppy_init()
+
+#define N_FDC    1
+#define N_DRIVE  8
+
+/* No 64k boundary crossing problems on the Sparc. */
+#define CROSS_64KB(a,s) (0)
+
+/* Routines unique to each controller type on a Sun. */
+static void sun_set_dor(unsigned char value, int fdc_82077)
+{
+       if (sparc_cpu_model == sun4c) {
+               unsigned int bits = 0;
+               if (value & 0x10)
+                       bits |= AUXIO_FLPY_DSEL;
+               if ((value & 0x80) == 0)
+                       bits |= AUXIO_FLPY_EJCT;
+               set_auxio(bits, (~bits) & (AUXIO_FLPY_DSEL|AUXIO_FLPY_EJCT));
+       }
+       if (fdc_82077) {
+               sun_fdc->dor_82077 = value;
+       }
+}
+
+static unsigned char sun_read_dir(void)
+{
+       if (sparc_cpu_model == sun4c)
+               return (get_auxio() & AUXIO_FLPY_DCHG) ? 0x80 : 0;
+       else
+               return sun_fdc->dir_82077;
+}
+
+static unsigned char sun_82072_fd_inb(int port)
+{
+       udelay(5);
+       switch(port & 7) {
+       default:
+               printk("floppy: Asked to read unknown port %d\n", port);
+               panic("floppy: Port bolixed.");
+       case 4: /* FD_STATUS */
+               return sun_fdc->status_82072 & ~STATUS_DMA;
+       case 5: /* FD_DATA */
+               return sun_fdc->data_82072;
+       case 7: /* FD_DIR */
+               return sun_read_dir();
+       };
+       panic("sun_82072_fd_inb: How did I get here?");
+}
+
+static void sun_82072_fd_outb(unsigned char value, int port)
+{
+       udelay(5);
+       switch(port & 7) {
+       default:
+               printk("floppy: Asked to write to unknown port %d\n", port);
+               panic("floppy: Port bolixed.");
+       case 2: /* FD_DOR */
+               sun_set_dor(value, 0);
+               break;
+       case 5: /* FD_DATA */
+               sun_fdc->data_82072 = value;
+               break;
+       case 7: /* FD_DCR */
+               sun_fdc->dcr_82072 = value;
+               break;
+       case 4: /* FD_STATUS */
+               sun_fdc->status_82072 = value;
+               break;
+       };
+       return;
+}
+
+static unsigned char sun_82077_fd_inb(int port)
+{
+       udelay(5);
+       switch(port & 7) {
+       default:
+               printk("floppy: Asked to read unknown port %d\n", port);
+               panic("floppy: Port bolixed.");
+       case 0: /* FD_STATUS_0 */
+               return sun_fdc->status1_82077;
+       case 1: /* FD_STATUS_1 */
+               return sun_fdc->status2_82077;
+       case 2: /* FD_DOR */
+               return sun_fdc->dor_82077;
+       case 3: /* FD_TDR */
+               return sun_fdc->tapectl_82077;
+       case 4: /* FD_STATUS */
+               return sun_fdc->status_82077 & ~STATUS_DMA;
+       case 5: /* FD_DATA */
+               return sun_fdc->data_82077;
+       case 7: /* FD_DIR */
+               return sun_read_dir();
+       };
+       panic("sun_82077_fd_inb: How did I get here?");
+}
+
+static void sun_82077_fd_outb(unsigned char value, int port)
+{
+       udelay(5);
+       switch(port & 7) {
+       default:
+               printk("floppy: Asked to write to unknown port %d\n", port);
+               panic("floppy: Port bolixed.");
+       case 2: /* FD_DOR */
+               sun_set_dor(value, 1);
+               break;
+       case 5: /* FD_DATA */
+               sun_fdc->data_82077 = value;
+               break;
+       case 7: /* FD_DCR */
+               sun_fdc->dcr_82077 = value;
+               break;
+       case 4: /* FD_STATUS */
+               sun_fdc->status_82077 = value;
+               break;
+       case 3: /* FD_TDR */
+               sun_fdc->tapectl_82077 = value;
+               break;
+       };
+       return;
+}
+
+/* For pseudo-dma (Sun floppy drives have no real DMA available to
+ * them so we must eat the data fifo bytes directly ourselves) we have
+ * three state variables.  doing_pdma tells our inline low-level
+ * assembly floppy interrupt entry point whether it should sit and eat
+ * bytes from the fifo or just transfer control up to the higher level
+ * floppy interrupt c-code.  I tried very hard but I could not get the
+ * pseudo-dma to work in c-code without getting many overruns and
+ * underruns.  If non-zero, doing_pdma encodes the direction of
+ * the transfer for debugging.  1=read 2=write
+ */
+extern char *pdma_vaddr;
+extern unsigned long pdma_size;
+extern volatile int doing_pdma;
+
+/* This is software state */
+extern char *pdma_base;
+extern unsigned long pdma_areasize;
+
+/* Common routines to all controller types on the Sparc. */
+static inline void virtual_dma_init(void)
+{
+       /* nothing... */
+}
+
+static inline void sun_fd_disable_dma(void)
+{
+       doing_pdma = 0;
+       if (pdma_base) {
+               mmu_unlockarea(pdma_base, pdma_areasize);
+               pdma_base = NULL;
+       }
+}
+
+static inline void sun_fd_set_dma_mode(int mode)
+{
+       switch(mode) {
+       case DMA_MODE_READ:
+               doing_pdma = 1;
+               break;
+       case DMA_MODE_WRITE:
+               doing_pdma = 2;
+               break;
+       default:
+               printk("Unknown dma mode %d\n", mode);
+               panic("floppy: Giving up...");
+       }
+}
+
+static inline void sun_fd_set_dma_addr(char *buffer)
+{
+       pdma_vaddr = buffer;
+}
+
+static inline void sun_fd_set_dma_count(int length)
+{
+       pdma_size = length;
+}
+
+static inline void sun_fd_enable_dma(void)
+{
+       pdma_vaddr = mmu_lockarea(pdma_vaddr, pdma_size);
+       pdma_base = pdma_vaddr;
+       pdma_areasize = pdma_size;
+}
+
+/* Our low-level entry point in arch/sparc/kernel/entry.S */
+extern int sparc_floppy_request_irq(int irq, unsigned long flags,
+                                   irq_handler_t irq_handler);
+
+static int sun_fd_request_irq(void)
+{
+       static int once = 0;
+       int error;
+
+       if(!once) {
+               once = 1;
+               error = sparc_floppy_request_irq(FLOPPY_IRQ,
+                                                IRQF_DISABLED,
+                                                floppy_interrupt);
+               return ((error == 0) ? 0 : -1);
+       } else return 0;
+}
+
+static struct linux_prom_registers fd_regs[2];
+
+static int sun_floppy_init(void)
+{
+       char state[128];
+       int tnode, fd_node, num_regs;
+       struct resource r;
+
+       use_virtual_dma = 1;
+
+       FLOPPY_IRQ = 11;
+       /* Forget it if we aren't on a machine that could possibly
+        * ever have a floppy drive.
+        */
+       if((sparc_cpu_model != sun4c && sparc_cpu_model != sun4m) ||
+          ((idprom->id_machtype == (SM_SUN4C | SM_4C_SLC)) ||
+           (idprom->id_machtype == (SM_SUN4C | SM_4C_ELC)))) {
+               /* We certainly don't have a floppy controller. */
+               goto no_sun_fdc;
+       }
+       /* Well, try to find one. */
+       tnode = prom_getchild(prom_root_node);
+       fd_node = prom_searchsiblings(tnode, "obio");
+       if(fd_node != 0) {
+               tnode = prom_getchild(fd_node);
+               fd_node = prom_searchsiblings(tnode, "SUNW,fdtwo");
+       } else {
+               fd_node = prom_searchsiblings(tnode, "fd");
+       }
+       if(fd_node == 0) {
+               goto no_sun_fdc;
+       }
+
+       /* The sun4m lets us know if the controller is actually usable. */
+       if(sparc_cpu_model == sun4m &&
+          prom_getproperty(fd_node, "status", state, sizeof(state)) != -1) {
+               if(!strcmp(state, "disabled")) {
+                       goto no_sun_fdc;
+               }
+       }
+       num_regs = prom_getproperty(fd_node, "reg", (char *) fd_regs, sizeof(fd_regs));
+       num_regs = (num_regs / sizeof(fd_regs[0]));
+       prom_apply_obio_ranges(fd_regs, num_regs);
+       memset(&r, 0, sizeof(r));
+       r.flags = fd_regs[0].which_io;
+       r.start = fd_regs[0].phys_addr;
+       sun_fdc = (struct sun_flpy_controller *)
+           sbus_ioremap(&r, 0, fd_regs[0].reg_size, "floppy");
+
+       /* Last minute sanity check... */
+       if(sun_fdc->status_82072 == 0xff) {
+               sun_fdc = NULL;
+               goto no_sun_fdc;
+       }
+
+       sun_fdops.fd_inb = sun_82077_fd_inb;
+       sun_fdops.fd_outb = sun_82077_fd_outb;
+       fdc_status = &sun_fdc->status_82077;
+
+       if (sun_fdc->dor_82077 == 0x80) {
+               sun_fdc->dor_82077 = 0x02;
+               if (sun_fdc->dor_82077 == 0x80) {
+                       sun_fdops.fd_inb = sun_82072_fd_inb;
+                       sun_fdops.fd_outb = sun_82072_fd_outb;
+                       fdc_status = &sun_fdc->status_82072;
+               }
+       }
+
+       /* Success... */
+       allowed_drive_mask = 0x01;
+       return (int) sun_fdc;
+
+no_sun_fdc:
+       return -1;
+}
+
+static int sparc_eject(void)
+{
+       set_dor(0x00, 0xff, 0x90);
+       udelay(500);
+       set_dor(0x00, 0x6f, 0x00);
+       udelay(500);
+       return 0;
+}
+
+#define fd_eject(drive) sparc_eject()
+
+#define EXTRA_FLOPPY_PARAMS
+
+#endif /* !(__ASM_SPARC_FLOPPY_H) */
diff --git a/arch/sparc/include/asm/futex.h b/arch/sparc/include/asm/futex.h
new file mode 100644 (file)
index 0000000..736335f
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_FUTEX_H
+#define ___ASM_SPARC_FUTEX_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/futex_64.h>
+#else
+#include <asm/futex_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/hardirq.h b/arch/sparc/include/asm/hardirq.h
new file mode 100644 (file)
index 0000000..44d4e23
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_HARDIRQ_H
+#define ___ASM_SPARC_HARDIRQ_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/hardirq_64.h>
+#else
+#include <asm/hardirq_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/head.h b/arch/sparc/include/asm/head.h
new file mode 100644 (file)
index 0000000..be8f03f
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_HEAD_H
+#define ___ASM_SPARC_HEAD_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/head_64.h>
+#else
+#include <asm/head_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/io.h b/arch/sparc/include/asm/io.h
new file mode 100644 (file)
index 0000000..a34b299
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_IO_H
+#define ___ASM_SPARC_IO_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/io_64.h>
+#else
+#include <asm/io_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/iommu.h b/arch/sparc/include/asm/iommu.h
new file mode 100644 (file)
index 0000000..e650965
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_IOMMU_H
+#define ___ASM_SPARC_IOMMU_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/iommu_64.h>
+#else
+#include <asm/iommu_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/ipcbuf.h b/arch/sparc/include/asm/ipcbuf.h
new file mode 100644 (file)
index 0000000..17d6ef7
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_IPCBUF_H
+#define ___ASM_SPARC_IPCBUF_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/ipcbuf_64.h>
+#else
+#include <asm/ipcbuf_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/irq.h b/arch/sparc/include/asm/irq.h
new file mode 100644 (file)
index 0000000..3b44a6a
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_IRQ_H
+#define ___ASM_SPARC_IRQ_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/irq_64.h>
+#else
+#include <asm/irq_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/irqflags.h b/arch/sparc/include/asm/irqflags.h
new file mode 100644 (file)
index 0000000..1e13863
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_IRQFLAGS_H
+#define ___ASM_SPARC_IRQFLAGS_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/irqflags_64.h>
+#else
+#include <asm/irqflags_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/irqflags_32.h b/arch/sparc/include/asm/irqflags_32.h
new file mode 100644 (file)
index 0000000..0fca9d9
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * include/asm/irqflags.h
+ *
+ * IRQ flags handling
+ *
+ * This file gets included from lowlevel asm headers too, to provide
+ * wrapped versions of the local_irq_*() APIs, based on the
+ * raw_local_irq_*() functions from the lowlevel headers.
+ */
+#ifndef _ASM_IRQFLAGS_H
+#define _ASM_IRQFLAGS_H
+
+#ifndef __ASSEMBLY__
+
+extern void raw_local_irq_restore(unsigned long);
+extern unsigned long __raw_local_irq_save(void);
+extern void raw_local_irq_enable(void);
+
+static inline unsigned long getipl(void)
+{
+        unsigned long retval;
+
+        __asm__ __volatile__("rd        %%psr, %0" : "=r" (retval));
+        return retval;
+}
+
+#define raw_local_save_flags(flags) ((flags) = getipl())
+#define raw_local_irq_save(flags)   ((flags) = __raw_local_irq_save())
+#define raw_local_irq_disable()     ((void) __raw_local_irq_save())
+#define raw_irqs_disabled()         ((getipl() & PSR_PIL) != 0)
+
+static inline int raw_irqs_disabled_flags(unsigned long flags)
+{
+        return ((flags & PSR_PIL) != 0);
+}
+
+#endif /* (__ASSEMBLY__) */
+
+#endif /* !(_ASM_IRQFLAGS_H) */
diff --git a/arch/sparc/include/asm/irqflags_64.h b/arch/sparc/include/asm/irqflags_64.h
new file mode 100644 (file)
index 0000000..bb42e59
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * include/asm/irqflags.h
+ *
+ * IRQ flags handling
+ *
+ * This file gets included from lowlevel asm headers too, to provide
+ * wrapped versions of the local_irq_*() APIs, based on the
+ * raw_local_irq_*() functions from the lowlevel headers.
+ */
+#ifndef _ASM_IRQFLAGS_H
+#define _ASM_IRQFLAGS_H
+
+#ifndef __ASSEMBLY__
+
+static inline unsigned long __raw_local_save_flags(void)
+{
+       unsigned long flags;
+
+       __asm__ __volatile__(
+               "rdpr   %%pil, %0"
+               : "=r" (flags)
+       );
+
+       return flags;
+}
+
+#define raw_local_save_flags(flags) \
+               do { (flags) = __raw_local_save_flags(); } while (0)
+
+static inline void raw_local_irq_restore(unsigned long flags)
+{
+       __asm__ __volatile__(
+               "wrpr   %0, %%pil"
+               : /* no output */
+               : "r" (flags)
+               : "memory"
+       );
+}
+
+static inline void raw_local_irq_disable(void)
+{
+       __asm__ __volatile__(
+               "wrpr   15, %%pil"
+               : /* no outputs */
+               : /* no inputs */
+               : "memory"
+       );
+}
+
+static inline void raw_local_irq_enable(void)
+{
+       __asm__ __volatile__(
+               "wrpr   0, %%pil"
+               : /* no outputs */
+               : /* no inputs */
+               : "memory"
+       );
+}
+
+static inline int raw_irqs_disabled_flags(unsigned long flags)
+{
+       return (flags > 0);
+}
+
+static inline int raw_irqs_disabled(void)
+{
+       unsigned long flags = __raw_local_save_flags();
+
+       return raw_irqs_disabled_flags(flags);
+}
+
+/*
+ * For spinlocks, etc:
+ */
+static inline unsigned long __raw_local_irq_save(void)
+{
+       unsigned long flags = __raw_local_save_flags();
+
+       raw_local_irq_disable();
+
+       return flags;
+}
+
+#define raw_local_irq_save(flags) \
+               do { (flags) = __raw_local_irq_save(); } while (0)
+
+#endif /* (__ASSEMBLY__) */
+
+#endif /* !(_ASM_IRQFLAGS_H) */
diff --git a/arch/sparc/include/asm/kdebug.h b/arch/sparc/include/asm/kdebug.h
new file mode 100644 (file)
index 0000000..8d12581
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_KDEBUG_H
+#define ___ASM_SPARC_KDEBUG_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/kdebug_64.h>
+#else
+#include <asm/kdebug_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/mc146818rtc.h b/arch/sparc/include/asm/mc146818rtc.h
new file mode 100644 (file)
index 0000000..67ed9e3
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_MC146818RTC_H
+#define ___ASM_SPARC_MC146818RTC_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/mc146818rtc_64.h>
+#else
+#include <asm/mc146818rtc_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/mmu.h b/arch/sparc/include/asm/mmu.h
new file mode 100644 (file)
index 0000000..88fa313
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_MMU_H
+#define ___ASM_SPARC_MMU_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/mmu_64.h>
+#else
+#include <asm/mmu_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/mmu_context.h b/arch/sparc/include/asm/mmu_context.h
new file mode 100644 (file)
index 0000000..5531346
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_MMU_CONTEXT_H
+#define ___ASM_SPARC_MMU_CONTEXT_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/mmu_context_64.h>
+#else
+#include <asm/mmu_context_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/module.h b/arch/sparc/include/asm/module.h
new file mode 100644 (file)
index 0000000..e82cf9a
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_MODULE_H
+#define ___ASM_SPARC_MODULE_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/module_64.h>
+#else
+#include <asm/module_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/mostek.h b/arch/sparc/include/asm/mostek.h
new file mode 100644 (file)
index 0000000..433be3e
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_MOSTEK_H
+#define ___ASM_SPARC_MOSTEK_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/mostek_64.h>
+#else
+#include <asm/mostek_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/of_platform.h b/arch/sparc/include/asm/of_platform.h
new file mode 100644 (file)
index 0000000..aa69977
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_OF_PLATFORM_H
+#define ___ASM_SPARC_OF_PLATFORM_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/of_platform_64.h>
+#else
+#include <asm/of_platform_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/of_platform_32.h b/arch/sparc/include/asm/of_platform_32.h
new file mode 100644 (file)
index 0000000..723f7c9
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef _ASM_SPARC_OF_PLATFORM_H
+#define _ASM_SPARC_OF_PLATFORM_H
+/*
+ *    Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
+ *                      <benh@kernel.crashing.org>
+ *    Modified for Sparc by merging parts of asm/of_device.h
+ *             by Stephen Rothwell
+ *
+ *  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 the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ *
+ */
+
+/* This is just here during the transition */
+#include <linux/of_platform.h>
+
+extern struct bus_type ebus_bus_type;
+extern struct bus_type sbus_bus_type;
+
+#define of_bus_type    of_platform_bus_type    /* for compatibility */
+
+#endif /* _ASM_SPARC_OF_PLATFORM_H */
diff --git a/arch/sparc/include/asm/of_platform_64.h b/arch/sparc/include/asm/of_platform_64.h
new file mode 100644 (file)
index 0000000..4f66a5f
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef _ASM_SPARC64_OF_PLATFORM_H
+#define _ASM_SPARC64_OF_PLATFORM_H
+/*
+ *    Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp.
+ *                      <benh@kernel.crashing.org>
+ *    Modified for Sparc by merging parts of asm/of_device.h
+ *             by Stephen Rothwell
+ *
+ *  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 the Free Software Foundation; either version
+ *  2 of the License, or (at your option) any later version.
+ *
+ */
+
+/* This is just here during the transition */
+#include <linux/of_platform.h>
+
+extern struct bus_type isa_bus_type;
+extern struct bus_type ebus_bus_type;
+extern struct bus_type sbus_bus_type;
+
+#define of_bus_type    of_platform_bus_type    /* for compatibility */
+
+#endif /* _ASM_SPARC64_OF_PLATFORM_H */
diff --git a/arch/sparc/include/asm/openprom.h b/arch/sparc/include/asm/openprom.h
new file mode 100644 (file)
index 0000000..aaeae90
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_OPENPROM_H
+#define ___ASM_SPARC_OPENPROM_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/openprom_64.h>
+#else
+#include <asm/openprom_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/oplib.h b/arch/sparc/include/asm/oplib.h
new file mode 100644 (file)
index 0000000..72e04e1
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_OPLIB_H
+#define ___ASM_SPARC_OPLIB_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/oplib_64.h>
+#else
+#include <asm/oplib_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/page.h b/arch/sparc/include/asm/page.h
new file mode 100644 (file)
index 0000000..f21de03
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_PAGE_H
+#define ___ASM_SPARC_PAGE_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/page_64.h>
+#else
+#include <asm/page_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/pci.h b/arch/sparc/include/asm/pci.h
new file mode 100644 (file)
index 0000000..6e14fd1
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_PCI_H
+#define ___ASM_SPARC_PCI_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/pci_64.h>
+#else
+#include <asm/pci_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/percpu.h b/arch/sparc/include/asm/percpu.h
new file mode 100644 (file)
index 0000000..bfb1d19
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_PERCPU_H
+#define ___ASM_SPARC_PERCPU_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/percpu_64.h>
+#else
+#include <asm/percpu_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/pgalloc.h b/arch/sparc/include/asm/pgalloc.h
new file mode 100644 (file)
index 0000000..b6db1f7
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_PGALLOC_H
+#define ___ASM_SPARC_PGALLOC_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/pgalloc_64.h>
+#else
+#include <asm/pgalloc_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/pgtable.h b/arch/sparc/include/asm/pgtable.h
new file mode 100644 (file)
index 0000000..59ba6f6
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_PGTABLE_H
+#define ___ASM_SPARC_PGTABLE_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/pgtable_64.h>
+#else
+#include <asm/pgtable_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h
new file mode 100644 (file)
index 0000000..08237fd
--- /dev/null
@@ -0,0 +1,480 @@
+#ifndef _SPARC_PGTABLE_H
+#define _SPARC_PGTABLE_H
+
+/*  asm/pgtable.h:  Defines and functions used to work
+ *                        with Sparc page tables.
+ *
+ *  Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ *  Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
+ */
+
+#ifndef __ASSEMBLY__
+#include <asm-generic/4level-fixup.h>
+
+#include <linux/spinlock.h>
+#include <linux/swap.h>
+#include <asm/types.h>
+#ifdef CONFIG_SUN4
+#include <asm/pgtsun4.h>
+#else
+#include <asm/pgtsun4c.h>
+#endif
+#include <asm/pgtsrmmu.h>
+#include <asm/vac-ops.h>
+#include <asm/oplib.h>
+#include <asm/btfixup.h>
+#include <asm/system.h>
+
+
+struct vm_area_struct;
+struct page;
+
+extern void load_mmu(void);
+extern unsigned long calc_highpages(void);
+
+BTFIXUPDEF_SIMM13(pgdir_shift)
+BTFIXUPDEF_SETHI(pgdir_size)
+BTFIXUPDEF_SETHI(pgdir_mask)
+
+BTFIXUPDEF_SIMM13(ptrs_per_pmd)
+BTFIXUPDEF_SIMM13(ptrs_per_pgd)
+BTFIXUPDEF_SIMM13(user_ptrs_per_pgd)
+
+#define pte_ERROR(e)   __builtin_trap()
+#define pmd_ERROR(e)   __builtin_trap()
+#define pgd_ERROR(e)   __builtin_trap()
+
+BTFIXUPDEF_INT(page_none)
+BTFIXUPDEF_INT(page_copy)
+BTFIXUPDEF_INT(page_readonly)
+BTFIXUPDEF_INT(page_kernel)
+
+#define PMD_SHIFT              SUN4C_PMD_SHIFT
+#define PMD_SIZE               (1UL << PMD_SHIFT)
+#define PMD_MASK               (~(PMD_SIZE-1))
+#define PMD_ALIGN(__addr)      (((__addr) + ~PMD_MASK) & PMD_MASK)
+#define PGDIR_SHIFT            BTFIXUP_SIMM13(pgdir_shift)
+#define PGDIR_SIZE             BTFIXUP_SETHI(pgdir_size)
+#define PGDIR_MASK             BTFIXUP_SETHI(pgdir_mask)
+#define PTRS_PER_PTE           1024
+#define PTRS_PER_PMD           BTFIXUP_SIMM13(ptrs_per_pmd)
+#define PTRS_PER_PGD           BTFIXUP_SIMM13(ptrs_per_pgd)
+#define USER_PTRS_PER_PGD      BTFIXUP_SIMM13(user_ptrs_per_pgd)
+#define FIRST_USER_ADDRESS     0
+#define PTE_SIZE               (PTRS_PER_PTE*4)
+
+#define PAGE_NONE      __pgprot(BTFIXUP_INT(page_none))
+extern pgprot_t PAGE_SHARED;
+#define PAGE_COPY      __pgprot(BTFIXUP_INT(page_copy))
+#define PAGE_READONLY  __pgprot(BTFIXUP_INT(page_readonly))
+
+extern unsigned long page_kernel;
+
+#ifdef MODULE
+#define PAGE_KERNEL    page_kernel
+#else
+#define PAGE_KERNEL    __pgprot(BTFIXUP_INT(page_kernel))
+#endif
+
+/* Top-level page directory */
+extern pgd_t swapper_pg_dir[1024];
+
+extern void paging_init(void);
+
+/* Page table for 0-4MB for everybody, on the Sparc this
+ * holds the same as on the i386.
+ */
+extern pte_t pg0[1024];
+extern pte_t pg1[1024];
+extern pte_t pg2[1024];
+extern pte_t pg3[1024];
+
+extern unsigned long ptr_in_current_pgd;
+
+/* Here is a trick, since mmap.c need the initializer elements for
+ * protection_map[] to be constant at compile time, I set the following
+ * to all zeros.  I set it to the real values after I link in the
+ * appropriate MMU page table routines at boot time.
+ */
+#define __P000  __pgprot(0)
+#define __P001  __pgprot(0)
+#define __P010  __pgprot(0)
+#define __P011  __pgprot(0)
+#define __P100  __pgprot(0)
+#define __P101  __pgprot(0)
+#define __P110  __pgprot(0)
+#define __P111  __pgprot(0)
+
+#define __S000 __pgprot(0)
+#define __S001 __pgprot(0)
+#define __S010 __pgprot(0)
+#define __S011 __pgprot(0)
+#define __S100 __pgprot(0)
+#define __S101 __pgprot(0)
+#define __S110 __pgprot(0)
+#define __S111 __pgprot(0)
+
+extern int num_contexts;
+
+/* First physical page can be anywhere, the following is needed so that
+ * va-->pa and vice versa conversions work properly without performance
+ * hit for all __pa()/__va() operations.
+ */
+extern unsigned long phys_base;
+extern unsigned long pfn_base;
+
+/*
+ * BAD_PAGETABLE is used when we need a bogus page-table, while
+ * BAD_PAGE is used for a bogus page.
+ *
+ * ZERO_PAGE is a global shared page that is always zero: used
+ * for zero-mapped memory areas etc..
+ */
+extern pte_t * __bad_pagetable(void);
+extern pte_t __bad_page(void);
+extern unsigned long empty_zero_page;
+
+#define BAD_PAGETABLE __bad_pagetable()
+#define BAD_PAGE __bad_page()
+#define ZERO_PAGE(vaddr) (virt_to_page(&empty_zero_page))
+
+/*
+ */
+BTFIXUPDEF_CALL_CONST(struct page *, pmd_page, pmd_t)
+BTFIXUPDEF_CALL_CONST(unsigned long, pgd_page_vaddr, pgd_t)
+
+#define pmd_page(pmd) BTFIXUP_CALL(pmd_page)(pmd)
+#define pgd_page_vaddr(pgd) BTFIXUP_CALL(pgd_page_vaddr)(pgd)
+
+BTFIXUPDEF_SETHI(none_mask)
+BTFIXUPDEF_CALL_CONST(int, pte_present, pte_t)
+BTFIXUPDEF_CALL(void, pte_clear, pte_t *)
+
+static inline int pte_none(pte_t pte)
+{
+       return !(pte_val(pte) & ~BTFIXUP_SETHI(none_mask));
+}
+
+#define pte_present(pte) BTFIXUP_CALL(pte_present)(pte)
+#define pte_clear(mm,addr,pte) BTFIXUP_CALL(pte_clear)(pte)
+
+BTFIXUPDEF_CALL_CONST(int, pmd_bad, pmd_t)
+BTFIXUPDEF_CALL_CONST(int, pmd_present, pmd_t)
+BTFIXUPDEF_CALL(void, pmd_clear, pmd_t *)
+
+static inline int pmd_none(pmd_t pmd)
+{
+       return !(pmd_val(pmd) & ~BTFIXUP_SETHI(none_mask));
+}
+
+#define pmd_bad(pmd) BTFIXUP_CALL(pmd_bad)(pmd)
+#define pmd_present(pmd) BTFIXUP_CALL(pmd_present)(pmd)
+#define pmd_clear(pmd) BTFIXUP_CALL(pmd_clear)(pmd)
+
+BTFIXUPDEF_CALL_CONST(int, pgd_none, pgd_t)
+BTFIXUPDEF_CALL_CONST(int, pgd_bad, pgd_t)
+BTFIXUPDEF_CALL_CONST(int, pgd_present, pgd_t)
+BTFIXUPDEF_CALL(void, pgd_clear, pgd_t *)
+
+#define pgd_none(pgd) BTFIXUP_CALL(pgd_none)(pgd)
+#define pgd_bad(pgd) BTFIXUP_CALL(pgd_bad)(pgd)
+#define pgd_present(pgd) BTFIXUP_CALL(pgd_present)(pgd)
+#define pgd_clear(pgd) BTFIXUP_CALL(pgd_clear)(pgd)
+
+/*
+ * The following only work if pte_present() is true.
+ * Undefined behaviour if not..
+ */
+BTFIXUPDEF_HALF(pte_writei)
+BTFIXUPDEF_HALF(pte_dirtyi)
+BTFIXUPDEF_HALF(pte_youngi)
+
+static int pte_write(pte_t pte) __attribute_const__;
+static inline int pte_write(pte_t pte)
+{
+       return pte_val(pte) & BTFIXUP_HALF(pte_writei);
+}
+
+static int pte_dirty(pte_t pte) __attribute_const__;
+static inline int pte_dirty(pte_t pte)
+{
+       return pte_val(pte) & BTFIXUP_HALF(pte_dirtyi);
+}
+
+static int pte_young(pte_t pte) __attribute_const__;
+static inline int pte_young(pte_t pte)
+{
+       return pte_val(pte) & BTFIXUP_HALF(pte_youngi);
+}
+
+/*
+ * The following only work if pte_present() is not true.
+ */
+BTFIXUPDEF_HALF(pte_filei)
+
+static int pte_file(pte_t pte) __attribute_const__;
+static inline int pte_file(pte_t pte)
+{
+       return pte_val(pte) & BTFIXUP_HALF(pte_filei);
+}
+
+static inline int pte_special(pte_t pte)
+{
+       return 0;
+}
+
+/*
+ */
+BTFIXUPDEF_HALF(pte_wrprotecti)
+BTFIXUPDEF_HALF(pte_mkcleani)
+BTFIXUPDEF_HALF(pte_mkoldi)
+
+static pte_t pte_wrprotect(pte_t pte) __attribute_const__;
+static inline pte_t pte_wrprotect(pte_t pte)
+{
+       return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_wrprotecti));
+}
+
+static pte_t pte_mkclean(pte_t pte) __attribute_const__;
+static inline pte_t pte_mkclean(pte_t pte)
+{
+       return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_mkcleani));
+}
+
+static pte_t pte_mkold(pte_t pte) __attribute_const__;
+static inline pte_t pte_mkold(pte_t pte)
+{
+       return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_mkoldi));
+}
+
+BTFIXUPDEF_CALL_CONST(pte_t, pte_mkwrite, pte_t)
+BTFIXUPDEF_CALL_CONST(pte_t, pte_mkdirty, pte_t)
+BTFIXUPDEF_CALL_CONST(pte_t, pte_mkyoung, pte_t)
+
+#define pte_mkwrite(pte) BTFIXUP_CALL(pte_mkwrite)(pte)
+#define pte_mkdirty(pte) BTFIXUP_CALL(pte_mkdirty)(pte)
+#define pte_mkyoung(pte) BTFIXUP_CALL(pte_mkyoung)(pte)
+
+#define pte_mkspecial(pte)    (pte)
+
+#define pfn_pte(pfn, prot)             mk_pte(pfn_to_page(pfn), prot)
+
+BTFIXUPDEF_CALL(unsigned long,  pte_pfn, pte_t)
+#define pte_pfn(pte) BTFIXUP_CALL(pte_pfn)(pte)
+#define pte_page(pte)  pfn_to_page(pte_pfn(pte))
+
+/*
+ * Conversion functions: convert a page and protection to a page entry,
+ * and a page entry and page directory to the page they refer to.
+ */
+BTFIXUPDEF_CALL_CONST(pte_t, mk_pte, struct page *, pgprot_t)
+
+BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_phys, unsigned long, pgprot_t)
+BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_io, unsigned long, pgprot_t, int)
+BTFIXUPDEF_CALL_CONST(pgprot_t, pgprot_noncached, pgprot_t)
+
+#define mk_pte(page,pgprot) BTFIXUP_CALL(mk_pte)(page,pgprot)
+#define mk_pte_phys(page,pgprot) BTFIXUP_CALL(mk_pte_phys)(page,pgprot)
+#define mk_pte_io(page,pgprot,space) BTFIXUP_CALL(mk_pte_io)(page,pgprot,space)
+
+#define pgprot_noncached(pgprot) BTFIXUP_CALL(pgprot_noncached)(pgprot)
+
+BTFIXUPDEF_INT(pte_modify_mask)
+
+static pte_t pte_modify(pte_t pte, pgprot_t newprot) __attribute_const__;
+static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+{
+       return __pte((pte_val(pte) & BTFIXUP_INT(pte_modify_mask)) |
+               pgprot_val(newprot));
+}
+
+#define pgd_index(address) ((address) >> PGDIR_SHIFT)
+
+/* to find an entry in a page-table-directory */
+#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
+
+/* to find an entry in a kernel page-table-directory */
+#define pgd_offset_k(address) pgd_offset(&init_mm, address)
+
+/* Find an entry in the second-level page table.. */
+BTFIXUPDEF_CALL(pmd_t *, pmd_offset, pgd_t *, unsigned long)
+#define pmd_offset(dir,addr) BTFIXUP_CALL(pmd_offset)(dir,addr)
+
+/* Find an entry in the third-level page table.. */
+BTFIXUPDEF_CALL(pte_t *, pte_offset_kernel, pmd_t *, unsigned long)
+#define pte_offset_kernel(dir,addr) BTFIXUP_CALL(pte_offset_kernel)(dir,addr)
+
+/*
+ * This shortcut works on sun4m (and sun4d) because the nocache area is static,
+ * and sun4c is guaranteed to have no highmem anyway.
+ */
+#define pte_offset_map(d, a)           pte_offset_kernel(d,a)
+#define pte_offset_map_nested(d, a)    pte_offset_kernel(d,a)
+
+#define pte_unmap(pte)         do{}while(0)
+#define pte_unmap_nested(pte)  do{}while(0)
+
+/* Certain architectures need to do special things when pte's
+ * within a page table are directly modified.  Thus, the following
+ * hook is made available.
+ */
+
+BTFIXUPDEF_CALL(void, set_pte, pte_t *, pte_t)
+
+#define set_pte(ptep,pteval) BTFIXUP_CALL(set_pte)(ptep,pteval)
+#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
+
+struct seq_file;
+BTFIXUPDEF_CALL(void, mmu_info, struct seq_file *)
+
+#define mmu_info(p) BTFIXUP_CALL(mmu_info)(p)
+
+/* Fault handler stuff... */
+#define FAULT_CODE_PROT     0x1
+#define FAULT_CODE_WRITE    0x2
+#define FAULT_CODE_USER     0x4
+
+BTFIXUPDEF_CALL(void, update_mmu_cache, struct vm_area_struct *, unsigned long, pte_t)
+
+#define update_mmu_cache(vma,addr,pte) BTFIXUP_CALL(update_mmu_cache)(vma,addr,pte)
+
+BTFIXUPDEF_CALL(void, sparc_mapiorange, unsigned int, unsigned long,
+    unsigned long, unsigned int)
+BTFIXUPDEF_CALL(void, sparc_unmapiorange, unsigned long, unsigned int)
+#define sparc_mapiorange(bus,pa,va,len) BTFIXUP_CALL(sparc_mapiorange)(bus,pa,va,len)
+#define sparc_unmapiorange(va,len) BTFIXUP_CALL(sparc_unmapiorange)(va,len)
+
+extern int invalid_segment;
+
+/* Encode and de-code a swap entry */
+BTFIXUPDEF_CALL(unsigned long, __swp_type, swp_entry_t)
+BTFIXUPDEF_CALL(unsigned long, __swp_offset, swp_entry_t)
+BTFIXUPDEF_CALL(swp_entry_t, __swp_entry, unsigned long, unsigned long)
+
+#define __swp_type(__x)                        BTFIXUP_CALL(__swp_type)(__x)
+#define __swp_offset(__x)              BTFIXUP_CALL(__swp_offset)(__x)
+#define __swp_entry(__type,__off)      BTFIXUP_CALL(__swp_entry)(__type,__off)
+
+#define __pte_to_swp_entry(pte)                ((swp_entry_t) { pte_val(pte) })
+#define __swp_entry_to_pte(x)          ((pte_t) { (x).val })
+
+/* file-offset-in-pte helpers */
+BTFIXUPDEF_CALL(unsigned long, pte_to_pgoff, pte_t pte);
+BTFIXUPDEF_CALL(pte_t, pgoff_to_pte, unsigned long pgoff);
+
+#define pte_to_pgoff(pte) BTFIXUP_CALL(pte_to_pgoff)(pte)
+#define pgoff_to_pte(off) BTFIXUP_CALL(pgoff_to_pte)(off)
+
+/*
+ * This is made a constant because mm/fremap.c required a constant.
+ * Note that layout of these bits is different between sun4c.c and srmmu.c.
+ */
+#define PTE_FILE_MAX_BITS 24
+
+/*
+ */
+struct ctx_list {
+       struct ctx_list *next;
+       struct ctx_list *prev;
+       unsigned int ctx_number;
+       struct mm_struct *ctx_mm;
+};
+
+extern struct ctx_list *ctx_list_pool;  /* Dynamically allocated */
+extern struct ctx_list ctx_free;        /* Head of free list */
+extern struct ctx_list ctx_used;        /* Head of used contexts list */
+
+#define NO_CONTEXT     -1
+
+static inline void remove_from_ctx_list(struct ctx_list *entry)
+{
+       entry->next->prev = entry->prev;
+       entry->prev->next = entry->next;
+}
+
+static inline void add_to_ctx_list(struct ctx_list *head, struct ctx_list *entry)
+{
+       entry->next = head;
+       (entry->prev = head->prev)->next = entry;
+       head->prev = entry;
+}
+#define add_to_free_ctxlist(entry) add_to_ctx_list(&ctx_free, entry)
+#define add_to_used_ctxlist(entry) add_to_ctx_list(&ctx_used, entry)
+
+static inline unsigned long
+__get_phys (unsigned long addr)
+{
+       switch (sparc_cpu_model){
+       case sun4:
+       case sun4c:
+               return sun4c_get_pte (addr) << PAGE_SHIFT;
+       case sun4m:
+       case sun4d:
+               return ((srmmu_get_pte (addr) & 0xffffff00) << 4);
+       default:
+               return 0;
+       }
+}
+
+static inline int
+__get_iospace (unsigned long addr)
+{
+       switch (sparc_cpu_model){
+       case sun4:
+       case sun4c:
+               return -1; /* Don't check iospace on sun4c */
+       case sun4m:
+       case sun4d:
+               return (srmmu_get_pte (addr) >> 28);
+       default:
+               return -1;
+       }
+}
+
+extern unsigned long *sparc_valid_addr_bitmap;
+
+/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
+#define kern_addr_valid(addr) \
+       (test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap))
+
+extern int io_remap_pfn_range(struct vm_area_struct *vma,
+                             unsigned long from, unsigned long pfn,
+                             unsigned long size, pgprot_t prot);
+
+/*
+ * For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in
+ * its high 4 bits.  These macros/functions put it there or get it from there.
+ */
+#define MK_IOSPACE_PFN(space, pfn)     (pfn | (space << (BITS_PER_LONG - 4)))
+#define GET_IOSPACE(pfn)               (pfn >> (BITS_PER_LONG - 4))
+#define GET_PFN(pfn)                   (pfn & 0x0fffffffUL)
+
+#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
+#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
+({                                                                       \
+       int __changed = !pte_same(*(__ptep), __entry);                    \
+       if (__changed) {                                                  \
+               set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \
+               flush_tlb_page(__vma, __address);                         \
+       }                                                                 \
+       (sparc_cpu_model == sun4c) || __changed;                          \
+})
+
+#include <asm-generic/pgtable.h>
+
+#endif /* !(__ASSEMBLY__) */
+
+#define VMALLOC_START           0xfe600000
+/* XXX Alter this when I get around to fixing sun4c - Anton */
+#define VMALLOC_END             0xffc00000
+
+
+/* We provide our own get_unmapped_area to cope with VA holes for userland */
+#define HAVE_ARCH_UNMAPPED_AREA
+
+/*
+ * No page table caches to initialise
+ */
+#define pgtable_cache_init()   do { } while (0)
+
+#endif /* !(_SPARC_PGTABLE_H) */
diff --git a/arch/sparc/include/asm/posix_types.h b/arch/sparc/include/asm/posix_types.h
new file mode 100644 (file)
index 0000000..03a0e09
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_POSIX_TYPES_H
+#define ___ASM_SPARC_POSIX_TYPES_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/posix_types_64.h>
+#else
+#include <asm/posix_types_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/processor.h b/arch/sparc/include/asm/processor.h
new file mode 100644 (file)
index 0000000..9da9646
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_PROCESSOR_H
+#define ___ASM_SPARC_PROCESSOR_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/processor_64.h>
+#else
+#include <asm/processor_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/processor_32.h b/arch/sparc/include/asm/processor_32.h
new file mode 100644 (file)
index 0000000..718e7e0
--- /dev/null
@@ -0,0 +1,128 @@
+/* include/asm/processor.h
+ *
+ * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
+ */
+
+#ifndef __ASM_SPARC_PROCESSOR_H
+#define __ASM_SPARC_PROCESSOR_H
+
+/*
+ * Sparc32 implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ void *pc; __asm__("sethi %%hi(1f), %0; or %0, %%lo(1f), %0;\n1:" : "=r" (pc)); pc; })
+
+#include <asm/psr.h>
+#include <asm/ptrace.h>
+#include <asm/head.h>
+#include <asm/signal.h>
+#include <asm/btfixup.h>
+#include <asm/page.h>
+
+/*
+ * The sparc has no problems with write protection
+ */
+#define wp_works_ok 1
+#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
+
+/* Whee, this is STACK_TOP + PAGE_SIZE and the lowest kernel address too...
+ * That one page is used to protect kernel from intruders, so that
+ * we can make our access_ok test faster
+ */
+#define TASK_SIZE      PAGE_OFFSET
+#ifdef __KERNEL__
+#define STACK_TOP      (PAGE_OFFSET - PAGE_SIZE)
+#define STACK_TOP_MAX  STACK_TOP
+#endif /* __KERNEL__ */
+
+struct task_struct;
+
+#ifdef __KERNEL__
+struct fpq {
+       unsigned long *insn_addr;
+       unsigned long insn;
+};
+#endif
+
+typedef struct {
+       int seg;
+} mm_segment_t;
+
+/* The Sparc processor specific thread struct. */
+struct thread_struct {
+       struct pt_regs *kregs;
+       unsigned int _pad1;
+
+       /* Special child fork kpsr/kwim values. */
+       unsigned long fork_kpsr __attribute__ ((aligned (8)));
+       unsigned long fork_kwim;
+
+       /* Floating point regs */
+       unsigned long   float_regs[32] __attribute__ ((aligned (8)));
+       unsigned long   fsr;
+       unsigned long   fpqdepth;
+       struct fpq      fpqueue[16];
+       unsigned long flags;
+       mm_segment_t current_ds;
+};
+
+#define SPARC_FLAG_KTHREAD      0x1    /* task is a kernel thread */
+#define SPARC_FLAG_UNALIGNED    0x2    /* is allowed to do unaligned accesses */
+
+#define INIT_THREAD  { \
+       .flags = SPARC_FLAG_KTHREAD, \
+       .current_ds = KERNEL_DS, \
+}
+
+/* Return saved PC of a blocked thread. */
+extern unsigned long thread_saved_pc(struct task_struct *t);
+
+/* Do necessary setup to start up a newly executed thread. */
+static inline void start_thread(struct pt_regs * regs, unsigned long pc,
+                                   unsigned long sp)
+{
+       register unsigned long zero asm("g1");
+
+       regs->psr = (regs->psr & (PSR_CWP)) | PSR_S;
+       regs->pc = ((pc & (~3)) - 4);
+       regs->npc = regs->pc + 4;
+       regs->y = 0;
+       zero = 0;
+       __asm__ __volatile__("std\t%%g0, [%0 + %3 + 0x00]\n\t"
+                            "std\t%%g0, [%0 + %3 + 0x08]\n\t"
+                            "std\t%%g0, [%0 + %3 + 0x10]\n\t"
+                            "std\t%%g0, [%0 + %3 + 0x18]\n\t"
+                            "std\t%%g0, [%0 + %3 + 0x20]\n\t"
+                            "std\t%%g0, [%0 + %3 + 0x28]\n\t"
+                            "std\t%%g0, [%0 + %3 + 0x30]\n\t"
+                            "st\t%1, [%0 + %3 + 0x38]\n\t"
+                            "st\t%%g0, [%0 + %3 + 0x3c]"
+                            : /* no outputs */
+                            : "r" (regs),
+                              "r" (sp - sizeof(struct reg_window)),
+                              "r" (zero),
+                              "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))
+                            : "memory");
+}
+
+/* Free all resources held by a thread. */
+#define release_thread(tsk)            do { } while(0)
+extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
+
+/* Prepare to copy thread state - unlazy all lazy status */
+#define prepare_to_copy(tsk)   do { } while (0)
+
+extern unsigned long get_wchan(struct task_struct *);
+
+#define KSTK_EIP(tsk)  ((tsk)->thread.kregs->pc)
+#define KSTK_ESP(tsk)  ((tsk)->thread.kregs->u_regs[UREG_FP])
+
+#ifdef __KERNEL__
+
+extern struct task_struct *last_task_used_math;
+
+#define cpu_relax()    barrier()
+
+#endif
+
+#endif /* __ASM_SPARC_PROCESSOR_H */
diff --git a/arch/sparc/include/asm/processor_64.h b/arch/sparc/include/asm/processor_64.h
new file mode 100644 (file)
index 0000000..137a6bd
--- /dev/null
@@ -0,0 +1,237 @@
+/*
+ * include/asm/processor.h
+ *
+ * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
+ */
+
+#ifndef __ASM_SPARC64_PROCESSOR_H
+#define __ASM_SPARC64_PROCESSOR_H
+
+/*
+ * Sparc64 implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+#define current_text_addr() ({ void *pc; __asm__("rd %%pc, %0" : "=r" (pc)); pc; })
+
+#include <asm/asi.h>
+#include <asm/pstate.h>
+#include <asm/ptrace.h>
+#include <asm/page.h>
+
+/* The sparc has no problems with write protection */
+#define wp_works_ok 1
+#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
+
+/*
+ * User lives in his very own context, and cannot reference us. Note
+ * that TASK_SIZE is a misnomer, it really gives maximum user virtual
+ * address that the kernel will allocate out.
+ *
+ * XXX No longer using virtual page tables, kill this upper limit...
+ */
+#define VA_BITS                44
+#ifndef __ASSEMBLY__
+#define VPTE_SIZE      (1UL << (VA_BITS - PAGE_SHIFT + 3))
+#else
+#define VPTE_SIZE      (1 << (VA_BITS - PAGE_SHIFT + 3))
+#endif
+
+#define TASK_SIZE      ((unsigned long)-VPTE_SIZE)
+#define TASK_SIZE_OF(tsk) \
+       (test_tsk_thread_flag(tsk,TIF_32BIT) ? \
+        (1UL << 32UL) : TASK_SIZE)
+#ifdef __KERNEL__
+
+#define STACK_TOP32    ((1UL << 32UL) - PAGE_SIZE)
+#define STACK_TOP64    (0x0000080000000000UL - (1UL << 32UL))
+
+#define STACK_TOP      (test_thread_flag(TIF_32BIT) ? \
+                        STACK_TOP32 : STACK_TOP64)
+
+#define STACK_TOP_MAX  STACK_TOP64
+
+#endif
+
+#ifndef __ASSEMBLY__
+
+typedef struct {
+       unsigned char seg;
+} mm_segment_t;
+
+/* The Sparc processor specific thread struct. */
+/* XXX This should die, everything can go into thread_info now. */
+struct thread_struct {
+#ifdef CONFIG_DEBUG_SPINLOCK
+       /* How many spinlocks held by this thread.
+        * Used with spin lock debugging to catch tasks
+        * sleeping illegally with locks held.
+        */
+       int smp_lock_count;
+       unsigned int smp_lock_pc;
+#else
+       int dummy; /* f'in gcc bug... */
+#endif
+};
+
+#endif /* !(__ASSEMBLY__) */
+
+#ifndef CONFIG_DEBUG_SPINLOCK
+#define INIT_THREAD  {                 \
+       0,                              \
+}
+#else /* CONFIG_DEBUG_SPINLOCK */
+#define INIT_THREAD  {                                 \
+/* smp_lock_count, smp_lock_pc, */                     \
+   0,             0,                                   \
+}
+#endif /* !(CONFIG_DEBUG_SPINLOCK) */
+
+#ifndef __ASSEMBLY__
+
+#include <linux/types.h>
+
+/* Return saved PC of a blocked thread. */
+struct task_struct;
+extern unsigned long thread_saved_pc(struct task_struct *);
+
+/* On Uniprocessor, even in RMO processes see TSO semantics */
+#ifdef CONFIG_SMP
+#define TSTATE_INITIAL_MM      TSTATE_TSO
+#else
+#define TSTATE_INITIAL_MM      TSTATE_RMO
+#endif
+
+/* Do necessary setup to start up a newly executed thread. */
+#define start_thread(regs, pc, sp) \
+do { \
+       unsigned long __asi = ASI_PNF; \
+       regs->tstate = (regs->tstate & (TSTATE_CWP)) | (TSTATE_INITIAL_MM|TSTATE_IE) | (__asi << 24UL); \
+       regs->tpc = ((pc & (~3)) - 4); \
+       regs->tnpc = regs->tpc + 4; \
+       regs->y = 0; \
+       set_thread_wstate(1 << 3); \
+       if (current_thread_info()->utraps) { \
+               if (*(current_thread_info()->utraps) < 2) \
+                       kfree(current_thread_info()->utraps); \
+               else \
+                       (*(current_thread_info()->utraps))--; \
+               current_thread_info()->utraps = NULL; \
+       } \
+       __asm__ __volatile__( \
+       "stx            %%g0, [%0 + %2 + 0x00]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x08]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x10]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x18]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x20]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x28]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x30]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x38]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x40]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x48]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x50]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x58]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x60]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x68]\n\t" \
+       "stx            %1,   [%0 + %2 + 0x70]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x78]\n\t" \
+       "wrpr           %%g0, (1 << 3), %%wstate\n\t" \
+       : \
+       : "r" (regs), "r" (sp - sizeof(struct reg_window) - STACK_BIAS), \
+         "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); \
+} while (0)
+
+#define start_thread32(regs, pc, sp) \
+do { \
+       unsigned long __asi = ASI_PNF; \
+       pc &= 0x00000000ffffffffUL; \
+       sp &= 0x00000000ffffffffUL; \
+       regs->tstate = (regs->tstate & (TSTATE_CWP))|(TSTATE_INITIAL_MM|TSTATE_IE|TSTATE_AM) | (__asi << 24UL); \
+       regs->tpc = ((pc & (~3)) - 4); \
+       regs->tnpc = regs->tpc + 4; \
+       regs->y = 0; \
+       set_thread_wstate(2 << 3); \
+       if (current_thread_info()->utraps) { \
+               if (*(current_thread_info()->utraps) < 2) \
+                       kfree(current_thread_info()->utraps); \
+               else \
+                       (*(current_thread_info()->utraps))--; \
+               current_thread_info()->utraps = NULL; \
+       } \
+       __asm__ __volatile__( \
+       "stx            %%g0, [%0 + %2 + 0x00]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x08]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x10]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x18]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x20]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x28]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x30]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x38]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x40]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x48]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x50]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x58]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x60]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x68]\n\t" \
+       "stx            %1,   [%0 + %2 + 0x70]\n\t" \
+       "stx            %%g0, [%0 + %2 + 0x78]\n\t" \
+       "wrpr           %%g0, (2 << 3), %%wstate\n\t" \
+       : \
+       : "r" (regs), "r" (sp - sizeof(struct reg_window32)), \
+         "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); \
+} while (0)
+
+/* Free all resources held by a thread. */
+#define release_thread(tsk)            do { } while (0)
+
+/* Prepare to copy thread state - unlazy all lazy status */
+#define prepare_to_copy(tsk)   do { } while (0)
+
+extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
+
+extern unsigned long get_wchan(struct task_struct *task);
+
+#define task_pt_regs(tsk) (task_thread_info(tsk)->kregs)
+#define KSTK_EIP(tsk)  (task_pt_regs(tsk)->tpc)
+#define KSTK_ESP(tsk)  (task_pt_regs(tsk)->u_regs[UREG_FP])
+
+#define cpu_relax()    barrier()
+
+/* Prefetch support.  This is tuned for UltraSPARC-III and later.
+ * UltraSPARC-I will treat these as nops, and UltraSPARC-II has
+ * a shallower prefetch queue than later chips.
+ */
+#define ARCH_HAS_PREFETCH
+#define ARCH_HAS_PREFETCHW
+#define ARCH_HAS_SPINLOCK_PREFETCH
+
+static inline void prefetch(const void *x)
+{
+       /* We do not use the read prefetch mnemonic because that
+        * prefetches into the prefetch-cache which only is accessible
+        * by floating point operations in UltraSPARC-III and later.
+        * By contrast, "#one_write" prefetches into the L2 cache
+        * in shared state.
+        */
+       __asm__ __volatile__("prefetch [%0], #one_write"
+                            : /* no outputs */
+                            : "r" (x));
+}
+
+static inline void prefetchw(const void *x)
+{
+       /* The most optimal prefetch to use for writes is
+        * "#n_writes".  This brings the cacheline into the
+        * L2 cache in "owned" state.
+        */
+       __asm__ __volatile__("prefetch [%0], #n_writes"
+                            : /* no outputs */
+                            : "r" (x));
+}
+
+#define spin_lock_prefetch(x)  prefetchw(x)
+
+#define HAVE_ARCH_PICK_MMAP_LAYOUT
+
+#endif /* !(__ASSEMBLY__) */
+
+#endif /* !(__ASM_SPARC64_PROCESSOR_H) */
diff --git a/arch/sparc/include/asm/ptrace.h b/arch/sparc/include/asm/ptrace.h
new file mode 100644 (file)
index 0000000..6dcbe2e
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_PTRACE_H
+#define ___ASM_SPARC_PTRACE_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/ptrace_64.h>
+#else
+#include <asm/ptrace_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/reg.h b/arch/sparc/include/asm/reg.h
new file mode 100644 (file)
index 0000000..0c16e19
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_REG_H
+#define ___ASM_SPARC_REG_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/reg_64.h>
+#else
+#include <asm/reg_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/reg_32.h b/arch/sparc/include/asm/reg_32.h
new file mode 100644 (file)
index 0000000..1efb056
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * linux/include/asm/reg.h
+ * Layout of the registers as expected by gdb on the Sparc
+ * we should replace the user.h definitions with those in
+ * this file, we don't even use the other
+ * -miguel
+ *
+ * The names of the structures, constants and aliases in this file
+ * have the same names as the sunos ones, some programs rely on these
+ * names (gdb for example).
+ *
+ */
+
+#ifndef __SPARC_REG_H
+#define __SPARC_REG_H
+
+struct regs {
+       int     r_psr;
+#define r_ps r_psr
+        int     r_pc;
+        int     r_npc;
+        int     r_y;
+        int     r_g1;
+        int     r_g2;
+        int     r_g3;
+        int     r_g4;
+        int     r_g5;
+        int     r_g6;
+        int     r_g7;
+        int     r_o0;
+        int     r_o1;
+        int     r_o2;
+        int     r_o3;
+        int     r_o4;
+        int     r_o5;
+        int     r_o6;
+        int     r_o7;
+};
+
+struct fpq {
+        unsigned long *addr;
+        unsigned long instr;
+};
+
+struct  fq {
+        union {
+                double  whole;
+                struct  fpq fpq;
+        } FQu;
+};
+
+#define FPU_REGS_TYPE unsigned int
+#define FPU_FSR_TYPE unsigned
+
+struct fp_status {
+        union {
+                FPU_REGS_TYPE Fpu_regs[32];
+                double  Fpu_dregs[16];
+        } fpu_fr;
+        FPU_FSR_TYPE Fpu_fsr;
+        unsigned Fpu_flags;
+        unsigned Fpu_extra;
+        unsigned Fpu_qcnt;
+        struct fq Fpu_q[16];
+};
+
+#define fpu_regs  f_fpstatus.fpu_fr.Fpu_regs
+#define fpu_dregs f_fpstatus.fpu_fr.Fpu_dregs
+#define fpu_fsr   f_fpstatus.Fpu_fsr
+#define fpu_flags f_fpstatus.Fpu_flags
+#define fpu_extra f_fpstatus.Fpu_extra
+#define fpu_q     f_fpstatus.Fpu_q
+#define fpu_qcnt  f_fpstatus.Fpu_qcnt
+
+struct fpu {
+        struct fp_status f_fpstatus;
+};
+
+#endif /* __SPARC_REG_H */
diff --git a/arch/sparc/include/asm/reg_64.h b/arch/sparc/include/asm/reg_64.h
new file mode 100644 (file)
index 0000000..6f277d7
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * linux/asm/reg.h
+ * Layout of the registers as expected by gdb on the Sparc
+ * we should replace the user.h definitions with those in
+ * this file, we don't even use the other
+ * -miguel
+ *
+ * The names of the structures, constants and aliases in this file
+ * have the same names as the sunos ones, some programs rely on these
+ * names (gdb for example).
+ *
+ */
+
+#ifndef __SPARC64_REG_H
+#define __SPARC64_REG_H
+
+struct regs {
+        unsigned long r_g1;
+        unsigned long r_g2;
+        unsigned long r_g3;
+        unsigned long r_g4;
+        unsigned long r_g5;
+        unsigned long r_g6;
+        unsigned long r_g7;
+        unsigned long r_o0;
+        unsigned long r_o1;
+        unsigned long r_o2;
+        unsigned long r_o3;
+        unsigned long r_o4;
+        unsigned long r_o5;
+        unsigned long r_o6;
+        unsigned long r_o7;
+        unsigned long __pad;
+        unsigned long r_tstate;
+        unsigned long r_tpc;
+        unsigned long r_tnpc;
+        unsigned int  r_y;
+        unsigned int  r_fprs;
+};
+
+#define FPU_REGS_TYPE unsigned int
+#define FPU_FSR_TYPE unsigned long
+
+struct fp_status {
+        unsigned long fpu_fr[32];
+        unsigned long Fpu_fsr;
+};
+
+struct fpu {
+       struct fp_status f_fpstatus;
+};
+
+#define fpu_regs  f_fpstatus.fpu_fr
+#define fpu_fsr   f_fpstatus.Fpu_fsr
+
+#endif /* __SPARC64_REG_H */
diff --git a/arch/sparc/include/asm/sbus.h b/arch/sparc/include/asm/sbus.h
new file mode 100644 (file)
index 0000000..f82481a
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_SBUS_H
+#define ___ASM_SPARC_SBUS_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/sbus_64.h>
+#else
+#include <asm/sbus_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/scatterlist.h b/arch/sparc/include/asm/scatterlist.h
new file mode 100644 (file)
index 0000000..ec21a45
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_SCATTERLIST_H
+#define ___ASM_SPARC_SCATTERLIST_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/scatterlist_64.h>
+#else
+#include <asm/scatterlist_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/sections.h b/arch/sparc/include/asm/sections.h
new file mode 100644 (file)
index 0000000..c7c69b0
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_SECTIONS_H
+#define ___ASM_SPARC_SECTIONS_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/sections_64.h>
+#else
+#include <asm/sections_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/sfp-machine.h b/arch/sparc/include/asm/sfp-machine.h
new file mode 100644 (file)
index 0000000..4ebc382
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_SFP_MACHINE_H
+#define ___ASM_SPARC_SFP_MACHINE_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/sfp-machine_64.h>
+#else
+#include <asm/sfp-machine_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/shmparam.h b/arch/sparc/include/asm/shmparam.h
new file mode 100644 (file)
index 0000000..8bf0cfe
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_SHMPARAM_H
+#define ___ASM_SPARC_SHMPARAM_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/shmparam_64.h>
+#else
+#include <asm/shmparam_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/sigcontext.h b/arch/sparc/include/asm/sigcontext.h
new file mode 100644 (file)
index 0000000..e92de7e
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_SIGCONTEXT_H
+#define ___ASM_SPARC_SIGCONTEXT_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/sigcontext_64.h>
+#else
+#include <asm/sigcontext_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/siginfo.h b/arch/sparc/include/asm/siginfo.h
new file mode 100644 (file)
index 0000000..bd81f8d
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_SIGINFO_H
+#define ___ASM_SPARC_SIGINFO_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/siginfo_64.h>
+#else
+#include <asm/siginfo_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/signal.h b/arch/sparc/include/asm/signal.h
new file mode 100644 (file)
index 0000000..27ab05d
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_SIGNAL_H
+#define ___ASM_SPARC_SIGNAL_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/signal_64.h>
+#else
+#include <asm/signal_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/smp.h b/arch/sparc/include/asm/smp.h
new file mode 100644 (file)
index 0000000..b59672d
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_SMP_H
+#define ___ASM_SPARC_SMP_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/smp_64.h>
+#else
+#include <asm/smp_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/spinlock.h b/arch/sparc/include/asm/spinlock.h
new file mode 100644 (file)
index 0000000..f276b00
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_SPINLOCK_H
+#define ___ASM_SPARC_SPINLOCK_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/spinlock_64.h>
+#else
+#include <asm/spinlock_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/stat.h b/arch/sparc/include/asm/stat.h
new file mode 100644 (file)
index 0000000..d815301
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_STAT_H
+#define ___ASM_SPARC_STAT_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/stat_64.h>
+#else
+#include <asm/stat_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/statfs.h b/arch/sparc/include/asm/statfs.h
new file mode 100644 (file)
index 0000000..5e937a7
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_STATFS_H
+#define ___ASM_SPARC_STATFS_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/statfs_64.h>
+#else
+#include <asm/statfs_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/string.h b/arch/sparc/include/asm/string.h
new file mode 100644 (file)
index 0000000..98b72a0
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_STRING_H
+#define ___ASM_SPARC_STRING_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/string_64.h>
+#else
+#include <asm/string_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/sunbpp.h b/arch/sparc/include/asm/sunbpp.h
new file mode 100644 (file)
index 0000000..d81a02e
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * include/asm/sunbpp.h
+ */
+
+#ifndef _ASM_SPARC_SUNBPP_H
+#define _ASM_SPARC_SUNBPP_H
+
+struct bpp_regs {
+  /* DMA registers */
+  __volatile__ __u32 p_csr;            /* DMA Control/Status Register */
+  __volatile__ __u32 p_addr;           /* Address Register */
+  __volatile__ __u32 p_bcnt;           /* Byte Count Register */
+  __volatile__ __u32 p_tst_csr;                /* Test Control/Status (DMA2 only) */
+  /* Parallel Port registers */
+  __volatile__ __u16 p_hcr;            /* Hardware Configuration Register */
+  __volatile__ __u16 p_ocr;            /* Operation Configuration Register */
+  __volatile__ __u8 p_dr;              /* Parallel Data Register */
+  __volatile__ __u8 p_tcr;             /* Transfer Control Register */
+  __volatile__ __u8 p_or;              /* Output Register */
+  __volatile__ __u8 p_ir;              /* Input Register */
+  __volatile__ __u16 p_icr;            /* Interrupt Control Register */
+};
+
+/* P_HCR. Time is in increments of SBus clock. */
+#define P_HCR_TEST      0x8000      /* Allows buried counters to be read */
+#define P_HCR_DSW       0x7f00      /* Data strobe width (in ticks) */
+#define P_HCR_DDS       0x007f      /* Data setup before strobe (in ticks) */
+
+/* P_OCR. */
+#define P_OCR_MEM_CLR   0x8000
+#define P_OCR_DATA_SRC  0x4000      /* )                  */
+#define P_OCR_DS_DSEL   0x2000      /* )  Bidirectional      */
+#define P_OCR_BUSY_DSEL 0x1000      /* )    selects            */
+#define P_OCR_ACK_DSEL  0x0800      /* )                  */
+#define P_OCR_EN_DIAG   0x0400
+#define P_OCR_BUSY_OP   0x0200      /* Busy operation */
+#define P_OCR_ACK_OP    0x0100      /* Ack operation */
+#define P_OCR_SRST      0x0080      /* Reset state machines. Not selfcleaning. */
+#define P_OCR_IDLE      0x0008      /* PP data transfer state machine is idle */
+#define P_OCR_V_ILCK    0x0002      /* Versatec faded. Zebra only. */
+#define P_OCR_EN_VER    0x0001      /* Enable Versatec (0 - enable). Zebra only. */
+
+/* P_TCR */
+#define P_TCR_DIR       0x08
+#define P_TCR_BUSY      0x04
+#define P_TCR_ACK       0x02
+#define P_TCR_DS        0x01        /* Strobe */
+
+/* P_OR */
+#define P_OR_V3         0x20        /* )                 */
+#define P_OR_V2         0x10        /* ) on Zebra only   */
+#define P_OR_V1         0x08        /* )                 */
+#define P_OR_INIT       0x04
+#define P_OR_AFXN       0x02        /* Auto Feed */
+#define P_OR_SLCT_IN    0x01
+
+/* P_IR */
+#define P_IR_PE         0x04
+#define P_IR_SLCT       0x02
+#define P_IR_ERR        0x01
+
+/* P_ICR */
+#define P_DS_IRQ        0x8000      /* RW1  */
+#define P_ACK_IRQ       0x4000      /* RW1  */
+#define P_BUSY_IRQ      0x2000      /* RW1  */
+#define P_PE_IRQ        0x1000      /* RW1  */
+#define P_SLCT_IRQ      0x0800      /* RW1  */
+#define P_ERR_IRQ       0x0400      /* RW1  */
+#define P_DS_IRQ_EN     0x0200      /* RW   Always on rising edge */
+#define P_ACK_IRQ_EN    0x0100      /* RW   Always on rising edge */
+#define P_BUSY_IRP      0x0080      /* RW   1= rising edge */
+#define P_BUSY_IRQ_EN   0x0040      /* RW   */
+#define P_PE_IRP        0x0020      /* RW   1= rising edge */
+#define P_PE_IRQ_EN     0x0010      /* RW   */
+#define P_SLCT_IRP      0x0008      /* RW   1= rising edge */
+#define P_SLCT_IRQ_EN   0x0004      /* RW   */
+#define P_ERR_IRP       0x0002      /* RW1  1= rising edge */
+#define P_ERR_IRQ_EN    0x0001      /* RW   */
+
+#endif /* !(_ASM_SPARC_SUNBPP_H) */
diff --git a/arch/sparc/include/asm/system.h b/arch/sparc/include/asm/system.h
new file mode 100644 (file)
index 0000000..7944a7c
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_SYSTEM_H
+#define ___ASM_SPARC_SYSTEM_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/system_64.h>
+#else
+#include <asm/system_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/thread_info.h b/arch/sparc/include/asm/thread_info.h
new file mode 100644 (file)
index 0000000..122d7ac
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_THREAD_INFO_H
+#define ___ASM_SPARC_THREAD_INFO_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/thread_info_64.h>
+#else
+#include <asm/thread_info_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/timer.h b/arch/sparc/include/asm/timer.h
new file mode 100644 (file)
index 0000000..612fd27
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_TIMER_H
+#define ___ASM_SPARC_TIMER_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/timer_64.h>
+#else
+#include <asm/timer_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/timex.h b/arch/sparc/include/asm/timex.h
new file mode 100644 (file)
index 0000000..70cc37b
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_TIMEX_H
+#define ___ASM_SPARC_TIMEX_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/timex_64.h>
+#else
+#include <asm/timex_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/timex_32.h b/arch/sparc/include/asm/timex_32.h
new file mode 100644 (file)
index 0000000..b6ccdb0
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * linux/include/asm/timex.h
+ *
+ * sparc architecture timex specifications
+ */
+#ifndef _ASMsparc_TIMEX_H
+#define _ASMsparc_TIMEX_H
+
+#define CLOCK_TICK_RATE        1193180 /* Underlying HZ */
+
+/* XXX Maybe do something better at some point... -DaveM */
+typedef unsigned long cycles_t;
+#define get_cycles()   (0)
+
+#endif
diff --git a/arch/sparc/include/asm/timex_64.h b/arch/sparc/include/asm/timex_64.h
new file mode 100644 (file)
index 0000000..18b30bc
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * linux/include/asm/timex.h
+ *
+ * sparc64 architecture timex specifications
+ */
+#ifndef _ASMsparc64_TIMEX_H
+#define _ASMsparc64_TIMEX_H
+
+#include <asm/timer.h>
+
+#define CLOCK_TICK_RATE        1193180 /* Underlying HZ */
+
+/* Getting on the cycle counter on sparc64. */
+typedef unsigned long cycles_t;
+#define get_cycles()   tick_ops->get_tick()
+
+#define ARCH_HAS_READ_CURRENT_TIMER
+
+#endif
diff --git a/arch/sparc/include/asm/tlb.h b/arch/sparc/include/asm/tlb.h
new file mode 100644 (file)
index 0000000..92d0393
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_TLB_H
+#define ___ASM_SPARC_TLB_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/tlb_64.h>
+#else
+#include <asm/tlb_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/tlbflush.h b/arch/sparc/include/asm/tlbflush.h
new file mode 100644 (file)
index 0000000..2c9629f
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef ___ASM_SPARC_TLBFLUSH_H
+#define ___ASM_SPARC_TLBFLUSH_H
+#if defined(__sparc__) && defined(__arch64__)
+#include <asm/tlbflush_64.h>
+#else
+#include <asm/tlbflush_32.h>
+#endif
+#endif
diff --git a/arch/sparc/include/asm/topology.h b/arch/sparc/include/asm/topology.h
new file mode 100644 (file)
index 0000000..ee4f