From f5e706ad886b6a5eb59637830110b09ccebf01c5 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Thu, 17 Jul 2008 21:55:51 -0700 Subject: sparc: join the remaining header files With this commit all sparc64 header files are moved to asm-sparc. The remaining files (71 files) were too different to be trivially merged so divide them up in a _32.h and a _64.h file which are both included from the file with no bit size. The following script were used: cd include FILES=`wc -l asm-sparc64/*h | grep -v '^ 1' | cut -b 20-` for FILE in ${FILES}; do echo $FILE: BASE=`echo $FILE | cut -d '.' -f 1` FN32=${BASE}_32.h FN64=${BASE}_64.h GUARD=___ASM_SPARC_`echo $BASE | tr '-' '_' | tr [:lower:] [:upper:]`_H git mv asm-sparc/$FILE asm-sparc/$FN32 git mv asm-sparc64/$FILE asm-sparc/$FN64 echo git mv done printf "#ifndef %s\n" $GUARD > asm-sparc/$FILE printf "#define %s\n" $GUARD >> asm-sparc/$FILE printf "#if defined(__sparc__) && defined(__arch64__)\n" >> asm-sparc/$FILE printf "#include \n" $FN64 >> asm-sparc/$FILE printf "#else\n" >> asm-sparc/$FILE printf "#include \n" $FN32 >> asm-sparc/$FILE printf "#endif\n" >> asm-sparc/$FILE printf "#endif\n" >> asm-sparc/$FILE git add asm-sparc/$FILE echo new file done printf "#include \n" $FILE > asm-sparc64/$FILE git add asm-sparc64/$FILE echo sparc64 file done done The guard contains three '_' to avoid conflict with existing guards. In additing the two Kbuild files are emptied to avoid breaking headers_* targets. We will reintroduce the exported header files when the necessary kbuild changes are merged. Signed-off-by: Sam Ravnborg Signed-off-by: David S. Miller --- include/asm-sparc/Kbuild | 23 +- include/asm-sparc/atomic.h | 169 +------- include/asm-sparc/atomic_32.h | 165 ++++++++ include/asm-sparc/atomic_64.h | 128 ++++++ include/asm-sparc/auxio.h | 97 +---- include/asm-sparc/auxio_32.h | 89 +++++ include/asm-sparc/auxio_64.h | 100 +++++ include/asm-sparc/bitops.h | 117 +----- include/asm-sparc/bitops_32.h | 111 ++++++ include/asm-sparc/bitops_64.h | 107 +++++ include/asm-sparc/cacheflush.h | 93 +---- include/asm-sparc/cacheflush_32.h | 85 ++++ include/asm-sparc/cacheflush_64.h | 76 ++++ include/asm-sparc/checksum.h | 249 +----------- include/asm-sparc/checksum_32.h | 241 ++++++++++++ include/asm-sparc/checksum_64.h | 167 ++++++++ include/asm-sparc/cpudata.h | 35 +- include/asm-sparc/cpudata_32.h | 27 ++ include/asm-sparc/cpudata_64.h | 240 ++++++++++++ include/asm-sparc/delay.h | 42 +- include/asm-sparc/delay_32.h | 34 ++ include/asm-sparc/delay_64.h | 17 + include/asm-sparc/dma-mapping.h | 17 +- include/asm-sparc/dma-mapping_32.h | 11 + include/asm-sparc/dma-mapping_64.h | 154 ++++++++ include/asm-sparc/dma.h | 290 +------------- include/asm-sparc/dma_32.h | 288 ++++++++++++++ include/asm-sparc/dma_64.h | 205 ++++++++++ include/asm-sparc/ebus.h | 105 +---- include/asm-sparc/ebus_32.h | 99 +++++ include/asm-sparc/ebus_64.h | 94 +++++ include/asm-sparc/elf.h | 149 +------ include/asm-sparc/elf_32.h | 145 +++++++ include/asm-sparc/elf_64.h | 217 ++++++++++ include/asm-sparc/floppy.h | 394 +------------------ include/asm-sparc/floppy_32.h | 388 ++++++++++++++++++ include/asm-sparc/floppy_64.h | 782 ++++++++++++++++++++++++++++++++++++ include/asm-sparc/futex.h | 12 +- include/asm-sparc/futex_32.h | 6 + include/asm-sparc/futex_64.h | 110 ++++++ include/asm-sparc/hardirq.h | 31 +- include/asm-sparc/hardirq_32.h | 23 ++ include/asm-sparc/hardirq_64.h | 19 + include/asm-sparc/head.h | 106 +---- include/asm-sparc/head_32.h | 102 +++++ include/asm-sparc/head_64.h | 76 ++++ include/asm-sparc/ide.h | 103 +---- include/asm-sparc/ide_32.h | 95 +++++ include/asm-sparc/ide_64.h | 118 ++++++ include/asm-sparc/io.h | 331 +--------------- include/asm-sparc/io_32.h | 325 +++++++++++++++ include/asm-sparc/io_64.h | 511 ++++++++++++++++++++++++ include/asm-sparc/iommu.h | 129 +----- include/asm-sparc/iommu_32.h | 121 ++++++ include/asm-sparc/iommu_64.h | 62 +++ include/asm-sparc/ipcbuf.h | 39 +- include/asm-sparc/ipcbuf_32.h | 31 ++ include/asm-sparc/ipcbuf_64.h | 28 ++ include/asm-sparc/irq.h | 21 +- include/asm-sparc/irq_32.h | 15 + include/asm-sparc/irq_64.h | 93 +++++ include/asm-sparc/irqflags.h | 47 +-- include/asm-sparc/irqflags_32.h | 39 ++ include/asm-sparc/irqflags_64.h | 89 +++++ include/asm-sparc/kdebug.h | 81 +--- include/asm-sparc/kdebug_32.h | 73 ++++ include/asm-sparc/kdebug_64.h | 19 + include/asm-sparc/mc146818rtc.h | 35 +- include/asm-sparc/mc146818rtc_32.h | 29 ++ include/asm-sparc/mc146818rtc_64.h | 34 ++ include/asm-sparc/mmu.h | 13 +- include/asm-sparc/mmu_32.h | 7 + include/asm-sparc/mmu_64.h | 127 ++++++ include/asm-sparc/mmu_context.h | 50 +-- include/asm-sparc/mmu_context_32.h | 42 ++ include/asm-sparc/mmu_context_64.h | 155 ++++++++ include/asm-sparc/module.h | 15 +- include/asm-sparc/module_32.h | 7 + include/asm-sparc/module_64.h | 7 + include/asm-sparc/mostek.h | 173 +------- include/asm-sparc/mostek_32.h | 171 ++++++++ include/asm-sparc/mostek_64.h | 143 +++++++ include/asm-sparc/namei.h | 21 +- include/asm-sparc/namei_32.h | 13 + include/asm-sparc/namei_64.h | 13 + include/asm-sparc/of_platform.h | 32 +- include/asm-sparc/of_platform_32.h | 24 ++ include/asm-sparc/of_platform_64.h | 25 ++ include/asm-sparc/openprom.h | 263 +------------ include/asm-sparc/openprom_32.h | 255 ++++++++++++ include/asm-sparc/openprom_64.h | 280 +++++++++++++ include/asm-sparc/oplib.h | 278 +------------ include/asm-sparc/oplib_32.h | 272 +++++++++++++ include/asm-sparc/oplib_64.h | 322 +++++++++++++++ include/asm-sparc/page.h | 165 +------- include/asm-sparc/page_32.h | 163 ++++++++ include/asm-sparc/page_64.h | 142 +++++++ include/asm-sparc/pci.h | 176 +-------- include/asm-sparc/pci_32.h | 170 ++++++++ include/asm-sparc/pci_64.h | 209 ++++++++++ include/asm-sparc/percpu.h | 14 +- include/asm-sparc/percpu_32.h | 6 + include/asm-sparc/percpu_64.h | 28 ++ include/asm-sparc/pgalloc.h | 76 +--- include/asm-sparc/pgalloc_32.h | 68 ++++ include/asm-sparc/pgalloc_64.h | 81 ++++ include/asm-sparc/pgtable.h | 482 +---------------------- include/asm-sparc/pgtable_32.h | 480 +++++++++++++++++++++++ include/asm-sparc/pgtable_64.h | 781 ++++++++++++++++++++++++++++++++++++ include/asm-sparc/posix_types.h | 124 +----- include/asm-sparc/posix_types_32.h | 118 ++++++ include/asm-sparc/posix_types_64.h | 122 ++++++ include/asm-sparc/processor.h | 132 +------ include/asm-sparc/processor_32.h | 128 ++++++ include/asm-sparc/processor_64.h | 237 +++++++++++ include/asm-sparc/ptrace.h | 179 +-------- include/asm-sparc/ptrace_32.h | 175 +++++++++ include/asm-sparc/ptrace_64.h | 346 ++++++++++++++++ include/asm-sparc/reg.h | 87 +---- include/asm-sparc/reg_32.h | 79 ++++ include/asm-sparc/reg_64.h | 56 +++ include/asm-sparc/sbus.h | 161 +------- include/asm-sparc/sbus_32.h | 153 ++++++++ include/asm-sparc/sbus_64.h | 190 +++++++++ include/asm-sparc/scatterlist.h | 32 +- include/asm-sparc/scatterlist_32.h | 26 ++ include/asm-sparc/scatterlist_64.h | 27 ++ include/asm-sparc/sections.h | 12 +- include/asm-sparc/sections_32.h | 6 + include/asm-sparc/sections_64.h | 9 + include/asm-sparc/sfp-machine.h | 214 +--------- include/asm-sparc/sfp-machine_32.h | 212 ++++++++++ include/asm-sparc/sfp-machine_64.h | 93 +++++ include/asm-sparc/shmparam.h | 19 +- include/asm-sparc/shmparam_32.h | 11 + include/asm-sparc/shmparam_64.h | 10 + include/asm-sparc/sigcontext.h | 70 +--- include/asm-sparc/sigcontext_32.h | 62 +++ include/asm-sparc/sigcontext_64.h | 87 +++++ include/asm-sparc/siginfo.h | 25 +- include/asm-sparc/siginfo_32.h | 17 + include/asm-sparc/siginfo_64.h | 32 ++ include/asm-sparc/signal.h | 209 +--------- include/asm-sparc/signal_32.h | 207 ++++++++++ include/asm-sparc/signal_64.h | 194 +++++++++ include/asm-sparc/smp.h | 177 +-------- include/asm-sparc/smp_32.h | 173 ++++++++ include/asm-sparc/smp_64.h | 64 +++ include/asm-sparc/spinlock.h | 200 +--------- include/asm-sparc/spinlock_32.h | 192 +++++++++ include/asm-sparc/spinlock_64.h | 250 ++++++++++++ include/asm-sparc/stat.h | 82 +--- include/asm-sparc/stat_32.h | 76 ++++ include/asm-sparc/stat_64.h | 47 +++ include/asm-sparc/statfs.h | 12 +- include/asm-sparc/statfs_32.h | 6 + include/asm-sparc/statfs_64.h | 54 +++ include/asm-sparc/string.h | 213 +--------- include/asm-sparc/string_32.h | 205 ++++++++++ include/asm-sparc/string_64.h | 83 ++++ include/asm-sparc/system.h | 290 +------------- include/asm-sparc/system_32.h | 288 ++++++++++++++ include/asm-sparc/system_64.h | 355 +++++++++++++++++ include/asm-sparc/thread_info.h | 157 +------- include/asm-sparc/thread_info_32.h | 151 +++++++ include/asm-sparc/thread_info_64.h | 277 +++++++++++++ include/asm-sparc/timer.h | 111 +----- include/asm-sparc/timer_32.h | 107 +++++ include/asm-sparc/timer_64.h | 30 ++ include/asm-sparc/timex.h | 21 +- include/asm-sparc/timex_32.h | 15 + include/asm-sparc/timex_64.h | 19 + include/asm-sparc/tlb.h | 32 +- include/asm-sparc/tlb_32.h | 24 ++ include/asm-sparc/tlb_64.h | 111 ++++++ include/asm-sparc/tlbflush.h | 68 +--- include/asm-sparc/tlbflush_32.h | 60 +++ include/asm-sparc/tlbflush_64.h | 44 +++ include/asm-sparc/topology.h | 14 +- include/asm-sparc/topology_32.h | 6 + include/asm-sparc/topology_64.h | 86 ++++ include/asm-sparc/uaccess.h | 342 +--------------- include/asm-sparc/uaccess_32.h | 336 ++++++++++++++++ include/asm-sparc/uaccess_64.h | 273 +++++++++++++ include/asm-sparc/unistd.h | 386 +----------------- include/asm-sparc/unistd_32.h | 378 ++++++++++++++++++ include/asm-sparc/unistd_64.h | 373 ++++++++++++++++++ include/asm-sparc/xor.h | 277 +------------ include/asm-sparc/xor_32.h | 269 +++++++++++++ include/asm-sparc/xor_64.h | 70 ++++ include/asm-sparc64/Kbuild | 22 +- include/asm-sparc64/atomic.h | 129 +----- include/asm-sparc64/auxio.h | 101 +---- include/asm-sparc64/bitops.h | 108 +---- include/asm-sparc64/cacheflush.h | 77 +--- include/asm-sparc64/checksum.h | 168 +------- include/asm-sparc64/cpudata.h | 241 +----------- include/asm-sparc64/delay.h | 18 +- include/asm-sparc64/dma-mapping.h | 155 +------- include/asm-sparc64/dma.h | 206 +--------- include/asm-sparc64/ebus.h | 95 +---- include/asm-sparc64/elf.h | 218 +---------- include/asm-sparc64/floppy.h | 783 +------------------------------------ include/asm-sparc64/futex.h | 111 +----- include/asm-sparc64/hardirq.h | 20 +- include/asm-sparc64/head.h | 77 +--- include/asm-sparc64/ide.h | 119 +----- include/asm-sparc64/io.h | 512 +----------------------- include/asm-sparc64/iommu.h | 63 +-- include/asm-sparc64/ipcbuf.h | 29 +- include/asm-sparc64/irq.h | 94 +---- include/asm-sparc64/irqflags.h | 90 +---- include/asm-sparc64/kdebug.h | 20 +- include/asm-sparc64/mc146818rtc.h | 35 +- include/asm-sparc64/mmu.h | 128 +----- include/asm-sparc64/mmu_context.h | 156 +------- include/asm-sparc64/module.h | 8 +- include/asm-sparc64/mostek.h | 144 +------ include/asm-sparc64/namei.h | 14 +- include/asm-sparc64/of_platform.h | 26 +- include/asm-sparc64/openprom.h | 281 +------------ include/asm-sparc64/oplib.h | 323 +-------------- include/asm-sparc64/page.h | 143 +------ include/asm-sparc64/pci.h | 210 +--------- include/asm-sparc64/percpu.h | 29 +- include/asm-sparc64/pgalloc.h | 82 +--- include/asm-sparc64/pgtable.h | 782 +----------------------------------- include/asm-sparc64/posix_types.h | 123 +----- include/asm-sparc64/processor.h | 238 +---------- include/asm-sparc64/ptrace.h | 347 +--------------- include/asm-sparc64/reg.h | 57 +-- include/asm-sparc64/sbus.h | 191 +-------- include/asm-sparc64/scatterlist.h | 28 +- include/asm-sparc64/sections.h | 10 +- include/asm-sparc64/sfp-machine.h | 94 +---- include/asm-sparc64/shmparam.h | 11 +- include/asm-sparc64/sigcontext.h | 88 +---- include/asm-sparc64/siginfo.h | 33 +- include/asm-sparc64/signal.h | 195 +-------- include/asm-sparc64/smp.h | 65 +-- include/asm-sparc64/spinlock.h | 251 +----------- include/asm-sparc64/stat.h | 48 +-- include/asm-sparc64/statfs.h | 55 +-- include/asm-sparc64/string.h | 84 +--- include/asm-sparc64/system.h | 356 +---------------- include/asm-sparc64/thread_info.h | 278 +------------ include/asm-sparc64/timer.h | 31 +- include/asm-sparc64/timex.h | 20 +- include/asm-sparc64/tlb.h | 112 +----- include/asm-sparc64/tlbflush.h | 45 +-- include/asm-sparc64/topology.h | 87 +---- include/asm-sparc64/uaccess.h | 274 +------------ include/asm-sparc64/unistd.h | 374 +----------------- include/asm-sparc64/xor.h | 71 +--- 254 files changed, 17513 insertions(+), 16987 deletions(-) create mode 100644 include/asm-sparc/atomic_32.h create mode 100644 include/asm-sparc/atomic_64.h create mode 100644 include/asm-sparc/auxio_32.h create mode 100644 include/asm-sparc/auxio_64.h create mode 100644 include/asm-sparc/bitops_32.h create mode 100644 include/asm-sparc/bitops_64.h create mode 100644 include/asm-sparc/cacheflush_32.h create mode 100644 include/asm-sparc/cacheflush_64.h create mode 100644 include/asm-sparc/checksum_32.h create mode 100644 include/asm-sparc/checksum_64.h create mode 100644 include/asm-sparc/cpudata_32.h create mode 100644 include/asm-sparc/cpudata_64.h create mode 100644 include/asm-sparc/delay_32.h create mode 100644 include/asm-sparc/delay_64.h create mode 100644 include/asm-sparc/dma-mapping_32.h create mode 100644 include/asm-sparc/dma-mapping_64.h create mode 100644 include/asm-sparc/dma_32.h create mode 100644 include/asm-sparc/dma_64.h create mode 100644 include/asm-sparc/ebus_32.h create mode 100644 include/asm-sparc/ebus_64.h create mode 100644 include/asm-sparc/elf_32.h create mode 100644 include/asm-sparc/elf_64.h create mode 100644 include/asm-sparc/floppy_32.h create mode 100644 include/asm-sparc/floppy_64.h create mode 100644 include/asm-sparc/futex_32.h create mode 100644 include/asm-sparc/futex_64.h create mode 100644 include/asm-sparc/hardirq_32.h create mode 100644 include/asm-sparc/hardirq_64.h create mode 100644 include/asm-sparc/head_32.h create mode 100644 include/asm-sparc/head_64.h create mode 100644 include/asm-sparc/ide_32.h create mode 100644 include/asm-sparc/ide_64.h create mode 100644 include/asm-sparc/io_32.h create mode 100644 include/asm-sparc/io_64.h create mode 100644 include/asm-sparc/iommu_32.h create mode 100644 include/asm-sparc/iommu_64.h create mode 100644 include/asm-sparc/ipcbuf_32.h create mode 100644 include/asm-sparc/ipcbuf_64.h create mode 100644 include/asm-sparc/irq_32.h create mode 100644 include/asm-sparc/irq_64.h create mode 100644 include/asm-sparc/irqflags_32.h create mode 100644 include/asm-sparc/irqflags_64.h create mode 100644 include/asm-sparc/kdebug_32.h create mode 100644 include/asm-sparc/kdebug_64.h create mode 100644 include/asm-sparc/mc146818rtc_32.h create mode 100644 include/asm-sparc/mc146818rtc_64.h create mode 100644 include/asm-sparc/mmu_32.h create mode 100644 include/asm-sparc/mmu_64.h create mode 100644 include/asm-sparc/mmu_context_32.h create mode 100644 include/asm-sparc/mmu_context_64.h create mode 100644 include/asm-sparc/module_32.h create mode 100644 include/asm-sparc/module_64.h create mode 100644 include/asm-sparc/mostek_32.h create mode 100644 include/asm-sparc/mostek_64.h create mode 100644 include/asm-sparc/namei_32.h create mode 100644 include/asm-sparc/namei_64.h create mode 100644 include/asm-sparc/of_platform_32.h create mode 100644 include/asm-sparc/of_platform_64.h create mode 100644 include/asm-sparc/openprom_32.h create mode 100644 include/asm-sparc/openprom_64.h create mode 100644 include/asm-sparc/oplib_32.h create mode 100644 include/asm-sparc/oplib_64.h create mode 100644 include/asm-sparc/page_32.h create mode 100644 include/asm-sparc/page_64.h create mode 100644 include/asm-sparc/pci_32.h create mode 100644 include/asm-sparc/pci_64.h create mode 100644 include/asm-sparc/percpu_32.h create mode 100644 include/asm-sparc/percpu_64.h create mode 100644 include/asm-sparc/pgalloc_32.h create mode 100644 include/asm-sparc/pgalloc_64.h create mode 100644 include/asm-sparc/pgtable_32.h create mode 100644 include/asm-sparc/pgtable_64.h create mode 100644 include/asm-sparc/posix_types_32.h create mode 100644 include/asm-sparc/posix_types_64.h create mode 100644 include/asm-sparc/processor_32.h create mode 100644 include/asm-sparc/processor_64.h create mode 100644 include/asm-sparc/ptrace_32.h create mode 100644 include/asm-sparc/ptrace_64.h create mode 100644 include/asm-sparc/reg_32.h create mode 100644 include/asm-sparc/reg_64.h create mode 100644 include/asm-sparc/sbus_32.h create mode 100644 include/asm-sparc/sbus_64.h create mode 100644 include/asm-sparc/scatterlist_32.h create mode 100644 include/asm-sparc/scatterlist_64.h create mode 100644 include/asm-sparc/sections_32.h create mode 100644 include/asm-sparc/sections_64.h create mode 100644 include/asm-sparc/sfp-machine_32.h create mode 100644 include/asm-sparc/sfp-machine_64.h create mode 100644 include/asm-sparc/shmparam_32.h create mode 100644 include/asm-sparc/shmparam_64.h create mode 100644 include/asm-sparc/sigcontext_32.h create mode 100644 include/asm-sparc/sigcontext_64.h create mode 100644 include/asm-sparc/siginfo_32.h create mode 100644 include/asm-sparc/siginfo_64.h create mode 100644 include/asm-sparc/signal_32.h create mode 100644 include/asm-sparc/signal_64.h create mode 100644 include/asm-sparc/smp_32.h create mode 100644 include/asm-sparc/smp_64.h create mode 100644 include/asm-sparc/spinlock_32.h create mode 100644 include/asm-sparc/spinlock_64.h create mode 100644 include/asm-sparc/stat_32.h create mode 100644 include/asm-sparc/stat_64.h create mode 100644 include/asm-sparc/statfs_32.h create mode 100644 include/asm-sparc/statfs_64.h create mode 100644 include/asm-sparc/string_32.h create mode 100644 include/asm-sparc/string_64.h create mode 100644 include/asm-sparc/system_32.h create mode 100644 include/asm-sparc/system_64.h create mode 100644 include/asm-sparc/thread_info_32.h create mode 100644 include/asm-sparc/thread_info_64.h create mode 100644 include/asm-sparc/timer_32.h create mode 100644 include/asm-sparc/timer_64.h create mode 100644 include/asm-sparc/timex_32.h create mode 100644 include/asm-sparc/timex_64.h create mode 100644 include/asm-sparc/tlb_32.h create mode 100644 include/asm-sparc/tlb_64.h create mode 100644 include/asm-sparc/tlbflush_32.h create mode 100644 include/asm-sparc/tlbflush_64.h create mode 100644 include/asm-sparc/topology_32.h create mode 100644 include/asm-sparc/topology_64.h create mode 100644 include/asm-sparc/uaccess_32.h create mode 100644 include/asm-sparc/uaccess_64.h create mode 100644 include/asm-sparc/unistd_32.h create mode 100644 include/asm-sparc/unistd_64.h create mode 100644 include/asm-sparc/xor_32.h create mode 100644 include/asm-sparc/xor_64.h diff --git a/include/asm-sparc/Kbuild b/include/asm-sparc/Kbuild index c83e3c0aa30b..6cdaf9d33b38 100644 --- a/include/asm-sparc/Kbuild +++ b/include/asm-sparc/Kbuild @@ -1,22 +1 @@ -include include/asm-generic/Kbuild.asm - -header-y += apc.h -header-y += asi.h -header-y += bpp.h -header-y += display7seg.h -header-y += envctrl.h -header-y += jsflash.h -header-y += openprom.h -header-y += openpromio.h -header-y += psrcompat.h -header-y += pstate.h -header-y += reg.h -header-y += traps.h -header-y += uctx.h -header-y += utrap.h -header-y += vfc_ioctls.h -header-y += watchdog.h - -unifdef-y += fbio.h -unifdef-y += perfctr.h -unifdef-y += psr.h +# dummy file to avoid breaking make headers_install diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h index 5c944b5a8040..66d8166ec1d7 100644 --- a/include/asm-sparc/atomic.h +++ b/include/asm-sparc/atomic.h @@ -1,165 +1,8 @@ -/* atomic.h: These still suck, but the I-cache hit rate is higher. - * - * Copyright (C) 1996 David S. Miller (davem@davemloft.net) - * Copyright (C) 2000 Anton Blanchard (anton@linuxcare.com.au) - * Copyright (C) 2007 Kyle McMartin (kyle@parisc-linux.org) - * - * Additions by Keith M Wesolowski (wesolows@foobazco.org) based - * on asm-parisc/atomic.h Copyright (C) 2000 Philipp Rumpf . - */ - -#ifndef __ARCH_SPARC_ATOMIC__ -#define __ARCH_SPARC_ATOMIC__ - -#include - -typedef struct { volatile int counter; } atomic_t; - -#ifdef __KERNEL__ - -#define ATOMIC_INIT(i) { (i) } - -extern int __atomic_add_return(int, atomic_t *); -extern int atomic_cmpxchg(atomic_t *, int, int); -#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) -extern int atomic_add_unless(atomic_t *, int, int); -extern void atomic_set(atomic_t *, int); - -#define atomic_read(v) ((v)->counter) - -#define atomic_add(i, v) ((void)__atomic_add_return( (int)(i), (v))) -#define atomic_sub(i, v) ((void)__atomic_add_return(-(int)(i), (v))) -#define atomic_inc(v) ((void)__atomic_add_return( 1, (v))) -#define atomic_dec(v) ((void)__atomic_add_return( -1, (v))) - -#define atomic_add_return(i, v) (__atomic_add_return( (int)(i), (v))) -#define atomic_sub_return(i, v) (__atomic_add_return(-(int)(i), (v))) -#define atomic_inc_return(v) (__atomic_add_return( 1, (v))) -#define atomic_dec_return(v) (__atomic_add_return( -1, (v))) - -#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) - -/* - * atomic_inc_and_test - increment and test - * @v: pointer of type atomic_t - * - * Atomically increments @v by 1 - * and returns true if the result is zero, or false for all - * other cases. - */ -#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) - -#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) -#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) - -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - -/* This is the old 24-bit implementation. It's still used internally - * by some sparc-specific code, notably the semaphore implementation. - */ -typedef struct { volatile int counter; } atomic24_t; - -#ifndef CONFIG_SMP - -#define ATOMIC24_INIT(i) { (i) } -#define atomic24_read(v) ((v)->counter) -#define atomic24_set(v, i) (((v)->counter) = i) - +#ifndef ___ASM_SPARC_ATOMIC_H +#define ___ASM_SPARC_ATOMIC_H +#if defined(__sparc__) && defined(__arch64__) +#include #else -/* We do the bulk of the actual work out of line in two common - * routines in assembler, see arch/sparc/lib/atomic.S for the - * "fun" details. - * - * For SMP the trick is you embed the spin lock byte within - * the word, use the low byte so signedness is easily retained - * via a quick arithmetic shift. It looks like this: - * - * ---------------------------------------- - * | signed 24-bit counter value | lock | atomic_t - * ---------------------------------------- - * 31 8 7 0 - */ - -#define ATOMIC24_INIT(i) { ((i) << 8) } - -static inline int atomic24_read(const atomic24_t *v) -{ - int ret = v->counter; - - while(ret & 0xff) - ret = v->counter; - - return ret >> 8; -} - -#define atomic24_set(v, i) (((v)->counter) = ((i) << 8)) +#include +#endif #endif - -static inline int __atomic24_add(int i, atomic24_t *v) -{ - register volatile int *ptr asm("g1"); - register int increment asm("g2"); - register int tmp1 asm("g3"); - register int tmp2 asm("g4"); - register int tmp3 asm("g7"); - - ptr = &v->counter; - increment = i; - - __asm__ __volatile__( - "mov %%o7, %%g4\n\t" - "call ___atomic24_add\n\t" - " add %%o7, 8, %%o7\n" - : "=&r" (increment), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3) - : "0" (increment), "r" (ptr) - : "memory", "cc"); - - return increment; -} - -static inline int __atomic24_sub(int i, atomic24_t *v) -{ - register volatile int *ptr asm("g1"); - register int increment asm("g2"); - register int tmp1 asm("g3"); - register int tmp2 asm("g4"); - register int tmp3 asm("g7"); - - ptr = &v->counter; - increment = i; - - __asm__ __volatile__( - "mov %%o7, %%g4\n\t" - "call ___atomic24_sub\n\t" - " add %%o7, 8, %%o7\n" - : "=&r" (increment), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3) - : "0" (increment), "r" (ptr) - : "memory", "cc"); - - return increment; -} - -#define atomic24_add(i, v) ((void)__atomic24_add((i), (v))) -#define atomic24_sub(i, v) ((void)__atomic24_sub((i), (v))) - -#define atomic24_dec_return(v) __atomic24_sub(1, (v)) -#define atomic24_inc_return(v) __atomic24_add(1, (v)) - -#define atomic24_sub_and_test(i, v) (__atomic24_sub((i), (v)) == 0) -#define atomic24_dec_and_test(v) (__atomic24_sub(1, (v)) == 0) - -#define atomic24_inc(v) ((void)__atomic24_add(1, (v))) -#define atomic24_dec(v) ((void)__atomic24_sub(1, (v))) - -#define atomic24_add_negative(i, v) (__atomic24_add((i), (v)) < 0) - -/* Atomic operations are already serializing */ -#define smp_mb__before_atomic_dec() barrier() -#define smp_mb__after_atomic_dec() barrier() -#define smp_mb__before_atomic_inc() barrier() -#define smp_mb__after_atomic_inc() barrier() - -#endif /* !(__KERNEL__) */ - -#include -#endif /* !(__ARCH_SPARC_ATOMIC__) */ diff --git a/include/asm-sparc/atomic_32.h b/include/asm-sparc/atomic_32.h new file mode 100644 index 000000000000..5c944b5a8040 --- /dev/null +++ b/include/asm-sparc/atomic_32.h @@ -0,0 +1,165 @@ +/* atomic.h: These still suck, but the I-cache hit rate is higher. + * + * Copyright (C) 1996 David S. Miller (davem@davemloft.net) + * Copyright (C) 2000 Anton Blanchard (anton@linuxcare.com.au) + * Copyright (C) 2007 Kyle McMartin (kyle@parisc-linux.org) + * + * Additions by Keith M Wesolowski (wesolows@foobazco.org) based + * on asm-parisc/atomic.h Copyright (C) 2000 Philipp Rumpf . + */ + +#ifndef __ARCH_SPARC_ATOMIC__ +#define __ARCH_SPARC_ATOMIC__ + +#include + +typedef struct { volatile int counter; } atomic_t; + +#ifdef __KERNEL__ + +#define ATOMIC_INIT(i) { (i) } + +extern int __atomic_add_return(int, atomic_t *); +extern int atomic_cmpxchg(atomic_t *, int, int); +#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) +extern int atomic_add_unless(atomic_t *, int, int); +extern void atomic_set(atomic_t *, int); + +#define atomic_read(v) ((v)->counter) + +#define atomic_add(i, v) ((void)__atomic_add_return( (int)(i), (v))) +#define atomic_sub(i, v) ((void)__atomic_add_return(-(int)(i), (v))) +#define atomic_inc(v) ((void)__atomic_add_return( 1, (v))) +#define atomic_dec(v) ((void)__atomic_add_return( -1, (v))) + +#define atomic_add_return(i, v) (__atomic_add_return( (int)(i), (v))) +#define atomic_sub_return(i, v) (__atomic_add_return(-(int)(i), (v))) +#define atomic_inc_return(v) (__atomic_add_return( 1, (v))) +#define atomic_dec_return(v) (__atomic_add_return( -1, (v))) + +#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) + +/* + * atomic_inc_and_test - increment and test + * @v: pointer of type atomic_t + * + * Atomically increments @v by 1 + * and returns true if the result is zero, or false for all + * other cases. + */ +#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) + +#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) +#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0) + +#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) + +/* This is the old 24-bit implementation. It's still used internally + * by some sparc-specific code, notably the semaphore implementation. + */ +typedef struct { volatile int counter; } atomic24_t; + +#ifndef CONFIG_SMP + +#define ATOMIC24_INIT(i) { (i) } +#define atomic24_read(v) ((v)->counter) +#define atomic24_set(v, i) (((v)->counter) = i) + +#else +/* We do the bulk of the actual work out of line in two common + * routines in assembler, see arch/sparc/lib/atomic.S for the + * "fun" details. + * + * For SMP the trick is you embed the spin lock byte within + * the word, use the low byte so signedness is easily retained + * via a quick arithmetic shift. It looks like this: + * + * ---------------------------------------- + * | signed 24-bit counter value | lock | atomic_t + * ---------------------------------------- + * 31 8 7 0 + */ + +#define ATOMIC24_INIT(i) { ((i) << 8) } + +static inline int atomic24_read(const atomic24_t *v) +{ + int ret = v->counter; + + while(ret & 0xff) + ret = v->counter; + + return ret >> 8; +} + +#define atomic24_set(v, i) (((v)->counter) = ((i) << 8)) +#endif + +static inline int __atomic24_add(int i, atomic24_t *v) +{ + register volatile int *ptr asm("g1"); + register int increment asm("g2"); + register int tmp1 asm("g3"); + register int tmp2 asm("g4"); + register int tmp3 asm("g7"); + + ptr = &v->counter; + increment = i; + + __asm__ __volatile__( + "mov %%o7, %%g4\n\t" + "call ___atomic24_add\n\t" + " add %%o7, 8, %%o7\n" + : "=&r" (increment), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3) + : "0" (increment), "r" (ptr) + : "memory", "cc"); + + return increment; +} + +static inline int __atomic24_sub(int i, atomic24_t *v) +{ + register volatile int *ptr asm("g1"); + register int increment asm("g2"); + register int tmp1 asm("g3"); + register int tmp2 asm("g4"); + register int tmp3 asm("g7"); + + ptr = &v->counter; + increment = i; + + __asm__ __volatile__( + "mov %%o7, %%g4\n\t" + "call ___atomic24_sub\n\t" + " add %%o7, 8, %%o7\n" + : "=&r" (increment), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3) + : "0" (increment), "r" (ptr) + : "memory", "cc"); + + return increment; +} + +#define atomic24_add(i, v) ((void)__atomic24_add((i), (v))) +#define atomic24_sub(i, v) ((void)__atomic24_sub((i), (v))) + +#define atomic24_dec_return(v) __atomic24_sub(1, (v)) +#define atomic24_inc_return(v) __atomic24_add(1, (v)) + +#define atomic24_sub_and_test(i, v) (__atomic24_sub((i), (v)) == 0) +#define atomic24_dec_and_test(v) (__atomic24_sub(1, (v)) == 0) + +#define atomic24_inc(v) ((void)__atomic24_add(1, (v))) +#define atomic24_dec(v) ((void)__atomic24_sub(1, (v))) + +#define atomic24_add_negative(i, v) (__atomic24_add((i), (v)) < 0) + +/* Atomic operations are already serializing */ +#define smp_mb__before_atomic_dec() barrier() +#define smp_mb__after_atomic_dec() barrier() +#define smp_mb__before_atomic_inc() barrier() +#define smp_mb__after_atomic_inc() barrier() + +#endif /* !(__KERNEL__) */ + +#include +#endif /* !(__ARCH_SPARC_ATOMIC__) */ diff --git a/include/asm-sparc/atomic_64.h b/include/asm-sparc/atomic_64.h new file mode 100644 index 000000000000..2c71ec4a3b18 --- /dev/null +++ b/include/asm-sparc/atomic_64.h @@ -0,0 +1,128 @@ +/* atomic.h: Thankfully the V9 is at least reasonable for this + * stuff. + * + * Copyright (C) 1996, 1997, 2000 David S. Miller (davem@redhat.com) + */ + +#ifndef __ARCH_SPARC64_ATOMIC__ +#define __ARCH_SPARC64_ATOMIC__ + +#include +#include + +typedef struct { volatile int counter; } atomic_t; +typedef struct { volatile __s64 counter; } atomic64_t; + +#define ATOMIC_INIT(i) { (i) } +#define ATOMIC64_INIT(i) { (i) } + +#define atomic_read(v) ((v)->counter) +#define atomic64_read(v) ((v)->counter) + +#define atomic_set(v, i) (((v)->counter) = i) +#define atomic64_set(v, i) (((v)->counter) = i) + +extern void atomic_add(int, atomic_t *); +extern void atomic64_add(int, atomic64_t *); +extern void atomic_sub(int, atomic_t *); +extern void atomic64_sub(int, atomic64_t *); + +extern int atomic_add_ret(int, atomic_t *); +extern int atomic64_add_ret(int, atomic64_t *); +extern int atomic_sub_ret(int, atomic_t *); +extern int atomic64_sub_ret(int, atomic64_t *); + +#define atomic_dec_return(v) atomic_sub_ret(1, v) +#define atomic64_dec_return(v) atomic64_sub_ret(1, v) + +#define atomic_inc_return(v) atomic_add_ret(1, v) +#define atomic64_inc_return(v) atomic64_add_ret(1, v) + +#define atomic_sub_return(i, v) atomic_sub_ret(i, v) +#define atomic64_sub_return(i, v) atomic64_sub_ret(i, v) + +#define atomic_add_return(i, v) atomic_add_ret(i, v) +#define atomic64_add_return(i, v) atomic64_add_ret(i, v) + +/* + * atomic_inc_and_test - increment and test + * @v: pointer of type atomic_t + * + * Atomically increments @v by 1 + * and returns true if the result is zero, or false for all + * other cases. + */ +#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) +#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0) + +#define atomic_sub_and_test(i, v) (atomic_sub_ret(i, v) == 0) +#define atomic64_sub_and_test(i, v) (atomic64_sub_ret(i, v) == 0) + +#define atomic_dec_and_test(v) (atomic_sub_ret(1, v) == 0) +#define atomic64_dec_and_test(v) (atomic64_sub_ret(1, v) == 0) + +#define atomic_inc(v) atomic_add(1, v) +#define atomic64_inc(v) atomic64_add(1, v) + +#define atomic_dec(v) atomic_sub(1, v) +#define atomic64_dec(v) atomic64_sub(1, v) + +#define atomic_add_negative(i, v) (atomic_add_ret(i, v) < 0) +#define atomic64_add_negative(i, v) (atomic64_add_ret(i, v) < 0) + +#define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) +#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) + +static inline int atomic_add_unless(atomic_t *v, int a, int u) +{ + int c, old; + c = atomic_read(v); + for (;;) { + if (unlikely(c == (u))) + break; + old = atomic_cmpxchg((v), c, c + (a)); + if (likely(old == c)) + break; + c = old; + } + return c != (u); +} + +#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) + +#define atomic64_cmpxchg(v, o, n) \ + ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n))) +#define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) + +static inline int atomic64_add_unless(atomic64_t *v, long a, long u) +{ + long c, old; + c = atomic64_read(v); + for (;;) { + if (unlikely(c == (u))) + break; + old = atomic64_cmpxchg((v), c, c + (a)); + if (likely(old == c)) + break; + c = old; + } + return c != (u); +} + +#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) + +/* Atomic operations are already serializing */ +#ifdef CONFIG_SMP +#define smp_mb__before_atomic_dec() membar_storeload_loadload(); +#define smp_mb__after_atomic_dec() membar_storeload_storestore(); +#define smp_mb__before_atomic_inc() membar_storeload_loadload(); +#define smp_mb__after_atomic_inc() membar_storeload_storestore(); +#else +#define smp_mb__before_atomic_dec() barrier() +#define smp_mb__after_atomic_dec() barrier() +#define smp_mb__before_atomic_inc() barrier() +#define smp_mb__after_atomic_inc() barrier() +#endif + +#include +#endif /* !(__ARCH_SPARC64_ATOMIC__) */ diff --git a/include/asm-sparc/auxio.h b/include/asm-sparc/auxio.h index e552b8d68450..24c6f3c0f577 100644 --- a/include/asm-sparc/auxio.h +++ b/include/asm-sparc/auxio.h @@ -1,89 +1,8 @@ -/* - * 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 -#include - -/* 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-sparc/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) */ +#ifndef ___ASM_SPARC_AUXIO_H +#define ___ASM_SPARC_AUXIO_H +#if defined(__sparc__) && defined(__arch64__) +#include +#else +#include +#endif +#endif diff --git a/include/asm-sparc/auxio_32.h b/include/asm-sparc/auxio_32.h new file mode 100644 index 000000000000..4db8f23db20f --- /dev/null +++ b/include/asm-sparc/auxio_32.h @@ -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 +#include + +/* 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-sparc/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/include/asm-sparc/auxio_64.h b/include/asm-sparc/auxio_64.h new file mode 100644 index 000000000000..f61cd1e3e395 --- /dev/null +++ b/include/asm-sparc/auxio_64.h @@ -0,0 +1,100 @@ +/* + * auxio.h: Definitions and code for the Auxiliary I/O registers. + * + * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) + * + * Refactoring for unified NCR/PCIO support 2002 Eric Brower (ebrower@usa.net) + */ +#ifndef _SPARC64_AUXIO_H +#define _SPARC64_AUXIO_H + +/* AUXIO implementations: + * sbus-based NCR89C105 "Slavio" + * LED/Floppy (AUX1) register + * Power (AUX2) register + * + * ebus-based auxio on PCIO + * LED Auxio Register + * Power Auxio Register + * + * Register definitions from NCR _NCR89C105 Chip Specification_ + * + * SLAVIO AUX1 @ 0x1900000 + * ------------------------------------------------- + * | (R) | (R) | D | (R) | E | M | T | L | + * ------------------------------------------------- + * (R) - bit 7:6,4 are reserved and should be masked in s/w + * D - Floppy Density Sense (1=high density) R/O + * E - Link Test Enable, directly reflected on AT&T 7213 LTE pin + * M - Monitor/Mouse Mux, directly reflected on MON_MSE_MUX pin + * T - Terminal Count: sends TC pulse to 82077 floppy controller + * L - System LED on front panel (0=off, 1=on) + */ +#define AUXIO_AUX1_MASK 0xc0 /* Mask bits */ +#define AUXIO_AUX1_FDENS 0x20 /* Floppy Density Sense */ +#define AUXIO_AUX1_LTE 0x08 /* Link Test Enable */ +#define AUXIO_AUX1_MMUX 0x04 /* Monitor/Mouse Mux */ +#define AUXIO_AUX1_FTCNT 0x02 /* Terminal Count, */ +#define AUXIO_AUX1_LED 0x01 /* System LED */ + +/* SLAVIO AUX2 @ 0x1910000 + * ------------------------------------------------- + * | (R) | (R) | D | (R) | (R) | (R) | C | F | + * ------------------------------------------------- + * (R) - bits 7:6,4:2 are reserved and should be masked in s/w + * D - Power Failure Detect (1=power fail) + * C - Clear Power Failure Detect Int (1=clear) + * F - Power Off (1=power off) + */ +#define AUXIO_AUX2_MASK 0xdc /* Mask Bits */ +#define AUXIO_AUX2_PFAILDET 0x20 /* Power Fail Detect */ +#define AUXIO_AUX2_PFAILCLR 0x02 /* Clear Pwr Fail Det Intr */ +#define AUXIO_AUX2_PWR_OFF 0x01 /* Power Off */ + +/* Register definitions from Sun Microsystems _PCIO_ p/n 802-7837 + * + * PCIO LED Auxio @ 0x726000 + * ------------------------------------------------- + * | 31:1 Unused | LED | + * ------------------------------------------------- + * Bits 31:1 unused + * LED - System LED on front panel (0=off, 1=on) + */ +#define AUXIO_PCIO_LED 0x01 /* System LED */ + +/* PCIO Power Auxio @ 0x724000 + * ------------------------------------------------- + * | 31:2 Unused | CPO | SPO | + * ------------------------------------------------- + * Bits 31:2 unused + * CPO - Courtesy Power Off (1=off) + * SPO - System Power Off (1=off) + */ +#define AUXIO_PCIO_CPWR_OFF 0x02 /* Courtesy Power Off */ +#define AUXIO_PCIO_SPWR_OFF 0x01 /* System Power Off */ + +#ifndef __ASSEMBLY__ + +extern void __iomem *auxio_register; + +#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 + */ +extern void auxio_set_lte(int on); + +#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 + */ +extern void auxio_set_led(int on); + +#endif /* ifndef __ASSEMBLY__ */ + +#endif /* !(_SPARC64_AUXIO_H) */ diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h index 68b98a7e6454..1a2949d0193f 100644 --- a/include/asm-sparc/bitops.h +++ b/include/asm-sparc/bitops.h @@ -1,111 +1,8 @@ -/* - * bitops.h: Bit string operations on the Sparc. - * - * Copyright 1995 David S. Miller (davem@caip.rutgers.edu) - * Copyright 1996 Eddie C. Dost (ecd@skynet.be) - * Copyright 2001 Anton Blanchard (anton@samba.org) - */ - -#ifndef _SPARC_BITOPS_H -#define _SPARC_BITOPS_H - -#include -#include - -#ifdef __KERNEL__ - -#ifndef _LINUX_BITOPS_H -#error only can be included directly +#ifndef ___ASM_SPARC_BITOPS_H +#define ___ASM_SPARC_BITOPS_H +#if defined(__sparc__) && defined(__arch64__) +#include +#else +#include +#endif #endif - -extern unsigned long ___set_bit(unsigned long *addr, unsigned long mask); -extern unsigned long ___clear_bit(unsigned long *addr, unsigned long mask); -extern unsigned long ___change_bit(unsigned long *addr, unsigned long mask); - -/* - * Set bit 'nr' in 32-bit quantity at address 'addr' where bit '0' - * is in the highest of the four bytes and bit '31' is the high bit - * within the first byte. Sparc is BIG-Endian. Unless noted otherwise - * all bit-ops return 0 if bit was previously clear and != 0 otherwise. - */ -static inline int test_and_set_bit(unsigned long nr, volatile unsigned long *addr) -{ - unsigned long *ADDR, mask; - - ADDR = ((unsigned long *) addr) + (nr >> 5); - mask = 1 << (nr & 31); - - return ___set_bit(ADDR, mask) != 0; -} - -static inline void set_bit(unsigned long nr, volatile unsigned long *addr) -{ - unsigned long *ADDR, mask; - - ADDR = ((unsigned long *) addr) + (nr >> 5); - mask = 1 << (nr & 31); - - (void) ___set_bit(ADDR, mask); -} - -static inline int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr) -{ - unsigned long *ADDR, mask; - - ADDR = ((unsigned long *) addr) + (nr >> 5); - mask = 1 << (nr & 31); - - return ___clear_bit(ADDR, mask) != 0; -} - -static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) -{ - unsigned long *ADDR, mask; - - ADDR = ((unsigned long *) addr) + (nr >> 5); - mask = 1 << (nr & 31); - - (void) ___clear_bit(ADDR, mask); -} - -static inline int test_and_change_bit(unsigned long nr, volatile unsigned long *addr) -{ - unsigned long *ADDR, mask; - - ADDR = ((unsigned long *) addr) + (nr >> 5); - mask = 1 << (nr & 31); - - return ___change_bit(ADDR, mask) != 0; -} - -static inline void change_bit(unsigned long nr, volatile unsigned long *addr) -{ - unsigned long *ADDR, mask; - - ADDR = ((unsigned long *) addr) + (nr >> 5); - mask = 1 << (nr & 31); - - (void) ___change_bit(ADDR, mask); -} - -#include - -#define smp_mb__before_clear_bit() do { } while(0) -#define smp_mb__after_clear_bit() do { } while(0) - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif /* __KERNEL__ */ - -#endif /* defined(_SPARC_BITOPS_H) */ diff --git a/include/asm-sparc/bitops_32.h b/include/asm-sparc/bitops_32.h new file mode 100644 index 000000000000..68b98a7e6454 --- /dev/null +++ b/include/asm-sparc/bitops_32.h @@ -0,0 +1,111 @@ +/* + * bitops.h: Bit string operations on the Sparc. + * + * Copyright 1995 David S. Miller (davem@caip.rutgers.edu) + * Copyright 1996 Eddie C. Dost (ecd@skynet.be) + * Copyright 2001 Anton Blanchard (anton@samba.org) + */ + +#ifndef _SPARC_BITOPS_H +#define _SPARC_BITOPS_H + +#include +#include + +#ifdef __KERNEL__ + +#ifndef _LINUX_BITOPS_H +#error only can be included directly +#endif + +extern unsigned long ___set_bit(unsigned long *addr, unsigned long mask); +extern unsigned long ___clear_bit(unsigned long *addr, unsigned long mask); +extern unsigned long ___change_bit(unsigned long *addr, unsigned long mask); + +/* + * Set bit 'nr' in 32-bit quantity at address 'addr' where bit '0' + * is in the highest of the four bytes and bit '31' is the high bit + * within the first byte. Sparc is BIG-Endian. Unless noted otherwise + * all bit-ops return 0 if bit was previously clear and != 0 otherwise. + */ +static inline int test_and_set_bit(unsigned long nr, volatile unsigned long *addr) +{ + unsigned long *ADDR, mask; + + ADDR = ((unsigned long *) addr) + (nr >> 5); + mask = 1 << (nr & 31); + + return ___set_bit(ADDR, mask) != 0; +} + +static inline void set_bit(unsigned long nr, volatile unsigned long *addr) +{ + unsigned long *ADDR, mask; + + ADDR = ((unsigned long *) addr) + (nr >> 5); + mask = 1 << (nr & 31); + + (void) ___set_bit(ADDR, mask); +} + +static inline int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr) +{ + unsigned long *ADDR, mask; + + ADDR = ((unsigned long *) addr) + (nr >> 5); + mask = 1 << (nr & 31); + + return ___clear_bit(ADDR, mask) != 0; +} + +static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) +{ + unsigned long *ADDR, mask; + + ADDR = ((unsigned long *) addr) + (nr >> 5); + mask = 1 << (nr & 31); + + (void) ___clear_bit(ADDR, mask); +} + +static inline int test_and_change_bit(unsigned long nr, volatile unsigned long *addr) +{ + unsigned long *ADDR, mask; + + ADDR = ((unsigned long *) addr) + (nr >> 5); + mask = 1 << (nr & 31); + + return ___change_bit(ADDR, mask) != 0; +} + +static inline void change_bit(unsigned long nr, volatile unsigned long *addr) +{ + unsigned long *ADDR, mask; + + ADDR = ((unsigned long *) addr) + (nr >> 5); + mask = 1 << (nr & 31); + + (void) ___change_bit(ADDR, mask); +} + +#include + +#define smp_mb__before_clear_bit() do { } while(0) +#define smp_mb__after_clear_bit() do { } while(0) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif /* __KERNEL__ */ + +#endif /* defined(_SPARC_BITOPS_H) */ diff --git a/include/asm-sparc/bitops_64.h b/include/asm-sparc/bitops_64.h new file mode 100644 index 000000000000..bb87b8080220 --- /dev/null +++ b/include/asm-sparc/bitops_64.h @@ -0,0 +1,107 @@ +/* + * bitops.h: Bit string operations on the V9. + * + * Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu) + */ + +#ifndef _SPARC64_BITOPS_H +#define _SPARC64_BITOPS_H + +#ifndef _LINUX_BITOPS_H +#error only can be included directly +#endif + +#include +#include + +extern int test_and_set_bit(unsigned long nr, volatile unsigned long *addr); +extern int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr); +extern int test_and_change_bit(unsigned long nr, volatile unsigned long *addr); +extern void set_bit(unsigned long nr, volatile unsigned long *addr); +extern void clear_bit(unsigned long nr, volatile unsigned long *addr); +extern void change_bit(unsigned long nr, volatile unsigned long *addr); + +#include + +#ifdef CONFIG_SMP +#define smp_mb__before_clear_bit() membar_storeload_loadload() +#define smp_mb__after_clear_bit() membar_storeload_storestore() +#else +#define smp_mb__before_clear_bit() barrier() +#define smp_mb__after_clear_bit() barrier() +#endif + +#include +#include +#include +#include +#include + +#ifdef __KERNEL__ + +#include +#include + +/* + * hweightN: returns the hamming weight (i.e. the number + * of bits set) of a N-bit word + */ + +#ifdef ULTRA_HAS_POPULATION_COUNT + +static inline unsigned int hweight64(unsigned long w) +{ + unsigned int res; + + __asm__ ("popc %1,%0" : "=r" (res) : "r" (w)); + return res; +} + +static inline unsigned int hweight32(unsigned int w) +{ + unsigned int res; + + __asm__ ("popc %1,%0" : "=r" (res) : "r" (w & 0xffffffff)); + return res; +} + +static inline unsigned int hweight16(unsigned int w) +{ + unsigned int res; + + __asm__ ("popc %1,%0" : "=r" (res) : "r" (w & 0xffff)); + return res; +} + +static inline unsigned int hweight8(unsigned int w) +{ + unsigned int res; + + __asm__ ("popc %1,%0" : "=r" (res) : "r" (w & 0xff)); + return res; +} + +#else + +#include + +#endif +#include +#endif /* __KERNEL__ */ + +#include + +#ifdef __KERNEL__ + +#include + +#define ext2_set_bit_atomic(lock,nr,addr) \ + test_and_set_bit((nr) ^ 0x38,(unsigned long *)(addr)) +#define ext2_clear_bit_atomic(lock,nr,addr) \ + test_and_clear_bit((nr) ^ 0x38,(unsigned long *)(addr)) + +#include + +#endif /* __KERNEL__ */ + +#endif /* defined(_SPARC64_BITOPS_H) */ diff --git a/include/asm-sparc/cacheflush.h b/include/asm-sparc/cacheflush.h index 68ac10910271..2b6a37957c2d 100644 --- a/include/asm-sparc/cacheflush.h +++ b/include/asm-sparc/cacheflush.h @@ -1,85 +1,8 @@ -#ifndef _SPARC_CACHEFLUSH_H -#define _SPARC_CACHEFLUSH_H - -#include /* Common for other includes */ -// #include from pgalloc.h -// #include from pgalloc.h - -// #include -#include - -/* - * Fine grained cache flushing. - */ -#ifdef CONFIG_SMP - -BTFIXUPDEF_CALL(void, local_flush_cache_all, void) -BTFIXUPDEF_CALL(void, local_flush_cache_mm, struct mm_struct *) -BTFIXUPDEF_CALL(void, local_flush_cache_range, struct vm_area_struct *, unsigned long, unsigned long) -BTFIXUPDEF_CALL(void, local_flush_cache_page, struct vm_area_struct *, unsigned long) - -#define local_flush_cache_all() BTFIXUP_CALL(local_flush_cache_all)() -#define local_flush_cache_mm(mm) BTFIXUP_CALL(local_flush_cache_mm)(mm) -#define local_flush_cache_range(vma,start,end) BTFIXUP_CALL(local_flush_cache_range)(vma,start,end) -#define local_flush_cache_page(vma,addr) BTFIXUP_CALL(local_flush_cache_page)(vma,addr) - -BTFIXUPDEF_CALL(void, local_flush_page_to_ram, unsigned long) -BTFIXUPDEF_CALL(void, local_flush_sig_insns, struct mm_struct *, unsigned long) - -#define local_flush_page_to_ram(addr) BTFIXUP_CALL(local_flush_page_to_ram)(addr) -#define local_flush_sig_insns(mm,insn_addr) BTFIXUP_CALL(local_flush_sig_insns)(mm,insn_addr) - -extern void smp_flush_cache_all(void); -extern void smp_flush_cache_mm(struct mm_struct *mm); -extern void smp_flush_cache_range(struct vm_area_struct *vma, - unsigned long start, - unsigned long end); -extern void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page); - -extern void smp_flush_page_to_ram(unsigned long page); -extern void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr); - -#endif /* CONFIG_SMP */ - -BTFIXUPDEF_CALL(void, flush_cache_all, void) -BTFIXUPDEF_CALL(void, flush_cache_mm, struct mm_struct *) -BTFIXUPDEF_CALL(void, flush_cache_range, struct vm_area_struct *, unsigned long, unsigned long) -BTFIXUPDEF_CALL(void, flush_cache_page, struct vm_area_struct *, unsigned long) - -#define flush_cache_all() BTFIXUP_CALL(flush_cache_all)() -#define flush_cache_mm(mm) BTFIXUP_CALL(flush_cache_mm)(mm) -#define flush_cache_dup_mm(mm) BTFIXUP_CALL(flush_cache_mm)(mm) -#define flush_cache_range(vma,start,end) BTFIXUP_CALL(flush_cache_range)(vma,start,end) -#define flush_cache_page(vma,addr,pfn) BTFIXUP_CALL(flush_cache_page)(vma,addr) -#define flush_icache_range(start, end) do { } while (0) -#define flush_icache_page(vma, pg) do { } while (0) - -#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) - -#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ - do { \ - flush_cache_page(vma, vaddr, page_to_pfn(page));\ - memcpy(dst, src, len); \ - } while (0) -#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ - do { \ - flush_cache_page(vma, vaddr, page_to_pfn(page));\ - memcpy(dst, src, len); \ - } while (0) - -BTFIXUPDEF_CALL(void, __flush_page_to_ram, unsigned long) -BTFIXUPDEF_CALL(void, flush_sig_insns, struct mm_struct *, unsigned long) - -#define __flush_page_to_ram(addr) BTFIXUP_CALL(__flush_page_to_ram)(addr) -#define flush_sig_insns(mm,insn_addr) BTFIXUP_CALL(flush_sig_insns)(mm,insn_addr) - -extern void sparc_flush_page_to_ram(struct page *page); - -#define flush_dcache_page(page) sparc_flush_page_to_ram(page) -#define flush_dcache_mmap_lock(mapping) do { } while (0) -#define flush_dcache_mmap_unlock(mapping) do { } while (0) - -#define flush_cache_vmap(start, end) flush_cache_all() -#define flush_cache_vunmap(start, end) flush_cache_all() - -#endif /* _SPARC_CACHEFLUSH_H */ +#ifndef ___ASM_SPARC_CACHEFLUSH_H +#define ___ASM_SPARC_CACHEFLUSH_H +#if defined(__sparc__) && defined(__arch64__) +#include +#else +#include +#endif +#endif diff --git a/include/asm-sparc/cacheflush_32.h b/include/asm-sparc/cacheflush_32.h new file mode 100644 index 000000000000..68ac10910271 --- /dev/null +++ b/include/asm-sparc/cacheflush_32.h @@ -0,0 +1,85 @@ +#ifndef _SPARC_CACHEFLUSH_H +#define _SPARC_CACHEFLUSH_H + +#include /* Common for other includes */ +// #include from pgalloc.h +// #include from pgalloc.h + +// #include +#include + +/* + * Fine grained cache flushing. + */ +#ifdef CONFIG_SMP + +BTFIXUPDEF_CALL(void, local_flush_cache_all, void) +BTFIXUPDEF_CALL(void, local_flush_cache_mm, struct mm_struct *) +BTFIXUPDEF_CALL(void, local_flush_cache_range, struct vm_area_struct *, unsigned long, unsigned long) +BTFIXUPDEF_CALL(void, local_flush_cache_page, struct vm_area_struct *, unsigned long) + +#define local_flush_cache_all() BTFIXUP_CALL(local_flush_cache_all)() +#define local_flush_cache_mm(mm) BTFIXUP_CALL(local_flush_cache_mm)(mm) +#define local_flush_cache_range(vma,start,end) BTFIXUP_CALL(local_flush_cache_range)(vma,start,end) +#define local_flush_cache_page(vma,addr) BTFIXUP_CALL(local_flush_cache_page)(vma,addr) + +BTFIXUPDEF_CALL(void, local_flush_page_to_ram, unsigned long) +BTFIXUPDEF_CALL(void, local_flush_sig_insns, struct mm_struct *, unsigned long) + +#define local_flush_page_to_ram(addr) BTFIXUP_CALL(local_flush_page_to_ram)(addr) +#define local_flush_sig_insns(mm,insn_addr) BTFIXUP_CALL(local_flush_sig_insns)(mm,insn_addr) + +extern void smp_flush_cache_all(void); +extern void smp_flush_cache_mm(struct mm_struct *mm); +extern void smp_flush_cache_range(struct vm_area_struct *vma, + unsigned long start, + unsigned long end); +extern void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page); + +extern void smp_flush_page_to_ram(unsigned long page); +extern void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr); + +#endif /* CONFIG_SMP */ + +BTFIXUPDEF_CALL(void, flush_cache_all, void) +BTFIXUPDEF_CALL(void, flush_cache_mm, struct mm_struct *) +BTFIXUPDEF_CALL(void, flush_cache_range, struct vm_area_struct *, unsigned long, unsigned long) +BTFIXUPDEF_CALL(void, flush_cache_page, struct vm_area_struct *, unsigned long) + +#define flush_cache_all() BTFIXUP_CALL(flush_cache_all)() +#define flush_cache_mm(mm) BTFIXUP_CALL(flush_cache_mm)(mm) +#define flush_cache_dup_mm(mm) BTFIXUP_CALL(flush_cache_mm)(mm) +#define flush_cache_range(vma,start,end) BTFIXUP_CALL(flush_cache_range)(vma,start,end) +#define flush_cache_page(vma,addr,pfn) BTFIXUP_CALL(flush_cache_page)(vma,addr) +#define flush_icache_range(start, end) do { } while (0) +#define flush_icache_page(vma, pg) do { } while (0) + +#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + do { \ + flush_cache_page(vma, vaddr, page_to_pfn(page));\ + memcpy(dst, src, len); \ + } while (0) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + do { \ + flush_cache_page(vma, vaddr, page_to_pfn(page));\ + memcpy(dst, src, len); \ + } while (0) + +BTFIXUPDEF_CALL(void, __flush_page_to_ram, unsigned long) +BTFIXUPDEF_CALL(void, flush_sig_insns, struct mm_struct *, unsigned long) + +#define __flush_page_to_ram(addr) BTFIXUP_CALL(__flush_page_to_ram)(addr) +#define flush_sig_insns(mm,insn_addr) BTFIXUP_CALL(flush_sig_insns)(mm,insn_addr) + +extern void sparc_flush_page_to_ram(struct page *page); + +#define flush_dcache_page(page) sparc_flush_page_to_ram(page) +#define flush_dcache_mmap_lock(mapping) do { } while (0) +#define flush_dcache_mmap_unlock(mapping) do { } while (0) + +#define flush_cache_vmap(start, end) flush_cache_all() +#define flush_cache_vunmap(start, end) flush_cache_all() + +#endif /* _SPARC_CACHEFLUSH_H */ diff --git a/include/asm-sparc/cacheflush_64.h b/include/asm-sparc/cacheflush_64.h new file mode 100644 index 000000000000..c43321729b3b --- /dev/null +++ b/include/asm-sparc/cacheflush_64.h @@ -0,0 +1,76 @@ +#ifndef _SPARC64_CACHEFLUSH_H +#define _SPARC64_CACHEFLUSH_H + +#include + +#ifndef __ASSEMBLY__ + +#include + +/* Cache flush operations. */ + +/* These are the same regardless of whether this is an SMP kernel or not. */ +#define flush_cache_mm(__mm) \ + do { if ((__mm) == current->mm) flushw_user(); } while(0) +#define flush_cache_dup_mm(mm) flush_cache_mm(mm) +#define flush_cache_range(vma, start, end) \ + flush_cache_mm((vma)->vm_mm) +#define flush_cache_page(vma, page, pfn) \ + flush_cache_mm((vma)->vm_mm) + +/* + * On spitfire, the icache doesn't snoop local stores and we don't + * use block commit stores (which invalidate icache lines) during + * module load, so we need this. + */ +extern void flush_icache_range(unsigned long start, unsigned long end); +extern void __flush_icache_page(unsigned long); + +extern void __flush_dcache_page(void *addr, int flush_icache); +extern void flush_dcache_page_impl(struct page *page); +#ifdef CONFIG_SMP +extern void smp_flush_dcache_page_impl(struct page *page, int cpu); +extern void flush_dcache_page_all(struct mm_struct *mm, struct page *page); +#else +#define smp_flush_dcache_page_impl(page,cpu) flush_dcache_page_impl(page) +#define flush_dcache_page_all(mm,page) flush_dcache_page_impl(page) +#endif + +extern void __flush_