summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-10-05 01:18:40 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-10-05 01:18:40 +0000
commit012bb3e61e5eced6c610f9e036372bf0c8def2d1 (patch)
tree87efc733f9b164e8c85c0336f92c8fb7eff6d183 /include
parent625a1589d3d6464b5d90b8a0918789e3afffd220 (diff)
Merge with Linux 2.4.0-test9. Please check DECstation, I had a number
of rejects to fixup while integrating Linus patches. I also found that this kernel will only boot SMP on Origin; the UP kernel freeze soon after bootup with SCSI timeout messages. I commit this anyway since I found that the last CVS versions had the same problem.
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/atomic.h43
-rw-r--r--include/asm-alpha/bitops.h153
-rw-r--r--include/asm-alpha/core_irongate.h275
-rw-r--r--include/asm-alpha/elf.h2
-rw-r--r--include/asm-alpha/fcntl.h9
-rw-r--r--include/asm-alpha/resource.h4
-rw-r--r--include/asm-alpha/semaphore-helper.h2
-rw-r--r--include/asm-alpha/spinlock.h26
-rw-r--r--include/asm-alpha/system.h58
-rw-r--r--include/asm-alpha/termios.h1
-rw-r--r--include/asm-alpha/uaccess.h28
-rw-r--r--include/asm-arm/arch-arc/dma.h16
-rw-r--r--include/asm-arm/arch-arc/hardware.h18
-rw-r--r--include/asm-arm/arch-arc/ide.h20
-rw-r--r--include/asm-arm/arch-arc/io.h12
-rw-r--r--include/asm-arm/arch-arc/irq.h14
-rw-r--r--include/asm-arm/arch-arc/irqs.h12
-rw-r--r--include/asm-arm/arch-arc/keyboard.h12
-rw-r--r--include/asm-arm/arch-arc/memory.h8
-rw-r--r--include/asm-arm/arch-arc/oldlatches.h12
-rw-r--r--include/asm-arm/arch-arc/processor.h14
-rw-r--r--include/asm-arm/arch-arc/serial.h14
-rw-r--r--include/asm-arm/arch-arc/system.h8
-rw-r--r--include/asm-arm/arch-arc/time.h16
-rw-r--r--include/asm-arm/arch-arc/timex.h10
-rw-r--r--include/asm-arm/arch-arc/uncompress.h8
-rw-r--r--include/asm-arm/arch-cl7500/hardware.h2
-rw-r--r--include/asm-arm/arch-cl7500/irq.h2
-rw-r--r--include/asm-arm/arch-cl7500/system.h2
-rw-r--r--include/asm-arm/arch-ebsa110/dma.h10
-rw-r--r--include/asm-arm/arch-ebsa110/hardware.h8
-rw-r--r--include/asm-arm/arch-ebsa110/io.h8
-rw-r--r--include/asm-arm/arch-ebsa110/irq.h10
-rw-r--r--include/asm-arm/arch-ebsa110/irqs.h8
-rw-r--r--include/asm-arm/arch-ebsa110/memory.h18
-rw-r--r--include/asm-arm/arch-ebsa110/processor.h12
-rw-r--r--include/asm-arm/arch-ebsa110/serial.h12
-rw-r--r--include/asm-arm/arch-ebsa110/system.h21
-rw-r--r--include/asm-arm/arch-ebsa110/time.h9
-rw-r--r--include/asm-arm/arch-ebsa110/timex.h10
-rw-r--r--include/asm-arm/arch-ebsa110/uncompress.h8
-rw-r--r--include/asm-arm/arch-ebsa110/vmalloc.h8
-rw-r--r--include/asm-arm/arch-ebsa285/dma.h8
-rw-r--r--include/asm-arm/arch-ebsa285/hardware.h25
-rw-r--r--include/asm-arm/arch-ebsa285/ide.h12
-rw-r--r--include/asm-arm/arch-ebsa285/io.h16
-rw-r--r--include/asm-arm/arch-ebsa285/irq.h22
-rw-r--r--include/asm-arm/arch-ebsa285/memory.h20
-rw-r--r--include/asm-arm/arch-ebsa285/processor.h12
-rw-r--r--include/asm-arm/arch-ebsa285/serial.h14
-rw-r--r--include/asm-arm/arch-ebsa285/system.h12
-rw-r--r--include/asm-arm/arch-ebsa285/time.h8
-rw-r--r--include/asm-arm/arch-ebsa285/timex.h10
-rw-r--r--include/asm-arm/arch-ebsa285/uncompress.h9
-rw-r--r--include/asm-arm/arch-ebsa285/vmalloc.h6
-rw-r--r--include/asm-arm/arch-nexuspci/dma.h7
-rw-r--r--include/asm-arm/arch-nexuspci/hardware.h10
-rw-r--r--include/asm-arm/arch-nexuspci/irq.h7
-rw-r--r--include/asm-arm/arch-nexuspci/irqs.h15
-rw-r--r--include/asm-arm/arch-nexuspci/system.h8
-rw-r--r--include/asm-arm/arch-nexuspci/time.h8
-rw-r--r--include/asm-arm/arch-nexuspci/uncompress.h12
-rw-r--r--include/asm-arm/arch-rpc/acornfb.h10
-rw-r--r--include/asm-arm/arch-rpc/dma.h8
-rw-r--r--include/asm-arm/arch-rpc/hardware.h10
-rw-r--r--include/asm-arm/arch-rpc/ide.h12
-rw-r--r--include/asm-arm/arch-rpc/io.h8
-rw-r--r--include/asm-arm/arch-rpc/irq.h21
-rw-r--r--include/asm-arm/arch-rpc/irqs.h8
-rw-r--r--include/asm-arm/arch-rpc/keyboard.h11
-rw-r--r--include/asm-arm/arch-rpc/memory.h22
-rw-r--r--include/asm-arm/arch-rpc/processor.h14
-rw-r--r--include/asm-arm/arch-rpc/serial.h12
-rw-r--r--include/asm-arm/arch-rpc/system.h12
-rw-r--r--include/asm-arm/arch-rpc/time.h16
-rw-r--r--include/asm-arm/arch-rpc/timex.h10
-rw-r--r--include/asm-arm/arch-rpc/uncompress.h8
-rw-r--r--include/asm-arm/arch-rpc/vmalloc.h8
-rw-r--r--include/asm-arm/arch-sa1100/SA-1100.h4
-rw-r--r--include/asm-arm/arch-sa1100/assabet.h6
-rw-r--r--include/asm-arm/arch-sa1100/bitsy.h1
-rw-r--r--include/asm-arm/arch-sa1100/cerf.h3
-rw-r--r--include/asm-arm/arch-sa1100/hardware.h37
-rw-r--r--include/asm-arm/arch-sa1100/ide.h57
-rw-r--r--include/asm-arm/arch-sa1100/memory.h18
-rw-r--r--include/asm-arm/arch-sa1100/mmzone.h55
-rw-r--r--include/asm-arm/arch-sa1100/system.h9
-rw-r--r--include/asm-arm/arch-sa1100/thinclient.h4
-rw-r--r--include/asm-arm/arch-sa1100/vmalloc.h2
-rw-r--r--include/asm-arm/arch-shark/hardware.h18
-rw-r--r--include/asm-arm/arch-shark/io.h2
-rw-r--r--include/asm-arm/arch-shark/keyboard.h51
-rw-r--r--include/asm-arm/arch-shark/system.h13
-rw-r--r--include/asm-arm/arch-shark/time.h13
-rw-r--r--include/asm-arm/arch-shark/vmalloc.h17
-rw-r--r--include/asm-arm/arch-tbox/dma.h37
-rw-r--r--include/asm-arm/arch-tbox/hardware.h60
-rw-r--r--include/asm-arm/arch-tbox/ide.h3
-rw-r--r--include/asm-arm/arch-tbox/io.h55
-rw-r--r--include/asm-arm/arch-tbox/irq.h50
-rw-r--r--include/asm-arm/arch-tbox/irqs.h29
-rw-r--r--include/asm-arm/arch-tbox/keyboard.h29
-rw-r--r--include/asm-arm/arch-tbox/memory.h38
-rw-r--r--include/asm-arm/arch-tbox/param.h1
-rw-r--r--include/asm-arm/arch-tbox/processor.h24
-rw-r--r--include/asm-arm/arch-tbox/serial.h34
-rw-r--r--include/asm-arm/arch-tbox/system.h33
-rw-r--r--include/asm-arm/arch-tbox/time.h36
-rw-r--r--include/asm-arm/arch-tbox/timex.h8
-rw-r--r--include/asm-arm/arch-tbox/uncompress.h42
-rw-r--r--include/asm-arm/arch-tbox/vmalloc.h17
-rw-r--r--include/asm-arm/atomic.h18
-rw-r--r--include/asm-arm/bugs.h6
-rw-r--r--include/asm-arm/cache.h2
-rw-r--r--include/asm-arm/checksum.h2
-rw-r--r--include/asm-arm/cpu-multi26.h9
-rw-r--r--include/asm-arm/cpu-multi32.h185
-rw-r--r--include/asm-arm/cpu-single.h72
-rw-r--r--include/asm-arm/current.h18
-rw-r--r--include/asm-arm/dma.h8
-rw-r--r--include/asm-arm/fcntl.h9
-rw-r--r--include/asm-arm/floppy.h10
-rw-r--r--include/asm-arm/hardware.h10
-rw-r--r--include/asm-arm/hardware/dec21285.h (renamed from include/asm-arm/dec21285.h)10
-rw-r--r--include/asm-arm/hardware/ioc.h (renamed from include/asm-arm/ioc.h)12
-rw-r--r--include/asm-arm/hardware/iomd.h (renamed from include/asm-arm/iomd.h)12
-rw-r--r--include/asm-arm/hardware/memc.h (renamed from include/asm-arm/memc.h)9
-rw-r--r--include/asm-arm/hardware/pci_v3.h148
-rw-r--r--include/asm-arm/hardware/serial_amba.h91
-rw-r--r--include/asm-arm/io.h9
-rw-r--r--include/asm-arm/keyboard.h10
-rw-r--r--include/asm-arm/leds.h11
-rw-r--r--include/asm-arm/linux_logo.h10
-rw-r--r--include/asm-arm/mach/arch.h88
-rw-r--r--include/asm-arm/mach/dma.h55
-rw-r--r--include/asm-arm/mach/map.h32
-rw-r--r--include/asm-arm/mach/pci.h42
-rw-r--r--include/asm-arm/memory.h12
-rw-r--r--include/asm-arm/mmu_context.h22
-rw-r--r--include/asm-arm/mmzone.h9
-rw-r--r--include/asm-arm/param.h8
-rw-r--r--include/asm-arm/parport.h4
-rw-r--r--include/asm-arm/pci.h15
-rw-r--r--include/asm-arm/pgalloc.h21
-rw-r--r--include/asm-arm/pgtable.h14
-rw-r--r--include/asm-arm/posix_types.h12
-rw-r--r--include/asm-arm/proc-armo/assembler.h34
-rw-r--r--include/asm-arm/proc-armo/cache.h22
-rw-r--r--include/asm-arm/proc-armo/io.h8
-rw-r--r--include/asm-arm/proc-armo/locks.h99
-rw-r--r--include/asm-arm/proc-armo/page.h8
-rw-r--r--include/asm-arm/proc-armo/pgtable.h10
-rw-r--r--include/asm-arm/proc-armo/processor.h24
-rw-r--r--include/asm-arm/proc-armo/ptrace.h10
-rw-r--r--include/asm-arm/proc-armo/shmparam.h11
-rw-r--r--include/asm-arm/proc-armo/system.h9
-rw-r--r--include/asm-arm/proc-armo/uaccess.h8
-rw-r--r--include/asm-arm/proc-armo/uncompress.h8
-rw-r--r--include/asm-arm/proc-armv/assembler.h33
-rw-r--r--include/asm-arm/proc-armv/cache.h162
-rw-r--r--include/asm-arm/proc-armv/domain.h8
-rw-r--r--include/asm-arm/proc-armv/io.h35
-rw-r--r--include/asm-arm/proc-armv/locks.h10
-rw-r--r--include/asm-arm/proc-armv/page.h8
-rw-r--r--include/asm-arm/proc-armv/pgtable.h12
-rw-r--r--include/asm-arm/proc-armv/processor.h22
-rw-r--r--include/asm-arm/proc-armv/ptrace.h12
-rw-r--r--include/asm-arm/proc-armv/shmparam.h13
-rw-r--r--include/asm-arm/proc-armv/system.h9
-rw-r--r--include/asm-arm/proc-armv/uaccess.h7
-rw-r--r--include/asm-arm/proc-armv/uncompress.h8
-rw-r--r--include/asm-arm/proc-fns.h29
-rw-r--r--include/asm-arm/processor.h8
-rw-r--r--include/asm-arm/procinfo.h8
-rw-r--r--include/asm-arm/ptrace.h10
-rw-r--r--include/asm-arm/resource.h4
-rw-r--r--include/asm-arm/scatterlist.h20
-rw-r--r--include/asm-arm/serial.h12
-rw-r--r--include/asm-arm/setup.h14
-rw-r--r--include/asm-arm/shmparam.h5
-rw-r--r--include/asm-arm/timex.h10
-rw-r--r--include/asm-arm/uaccess.h13
-rw-r--r--include/asm-i386/atomic.h58
-rw-r--r--include/asm-i386/bitops.h105
-rw-r--r--include/asm-i386/bugs.h122
-rw-r--r--include/asm-i386/fcntl.h10
-rw-r--r--include/asm-i386/mpspec.h14
-rw-r--r--include/asm-i386/page.h2
-rw-r--r--include/asm-i386/resource.h4
-rw-r--r--include/asm-i386/rwlock.h7
-rw-r--r--include/asm-i386/semaphore.h24
-rw-r--r--include/asm-i386/spinlock.h22
-rw-r--r--include/asm-i386/system.h26
-rw-r--r--include/asm-i386/uaccess.h18
-rw-r--r--include/asm-ia64/fcntl.h9
-rw-r--r--include/asm-ia64/resource.h4
-rw-r--r--include/asm-ia64/uaccess.h22
-rw-r--r--include/asm-m68k/fcntl.h9
-rw-r--r--include/asm-m68k/resource.h4
-rw-r--r--include/asm-m68k/uaccess.h4
-rw-r--r--include/asm-mips/atomic.h71
-rw-r--r--include/asm-mips/bitops.h150
-rw-r--r--include/asm-mips/fcntl.h19
-rw-r--r--include/asm-mips/resource.h4
-rw-r--r--include/asm-mips/semaphore.h22
-rw-r--r--include/asm-mips/spinlock.h30
-rw-r--r--include/asm-mips/system.h67
-rw-r--r--include/asm-mips/uaccess.h28
-rw-r--r--include/asm-mips64/atomic.h52
-rw-r--r--include/asm-mips64/bitops.h82
-rw-r--r--include/asm-mips64/fcntl.h10
-rw-r--r--include/asm-mips64/resource.h4
-rw-r--r--include/asm-mips64/semaphore-helper.h15
-rw-r--r--include/asm-mips64/semaphore.h23
-rw-r--r--include/asm-mips64/spinlock.h34
-rw-r--r--include/asm-mips64/system.h17
-rw-r--r--include/asm-mips64/uaccess.h22
-rw-r--r--include/asm-ppc/atomic.h30
-rw-r--r--include/asm-ppc/backlight.h2
-rw-r--r--include/asm-ppc/bitops.h155
-rw-r--r--include/asm-ppc/bootx.h1
-rw-r--r--include/asm-ppc/cpm_8260.h191
-rw-r--r--include/asm-ppc/fcntl.h21
-rw-r--r--include/asm-ppc/feature.h7
-rw-r--r--include/asm-ppc/hardirq.h7
-rw-r--r--include/asm-ppc/heathrow.h5
-rw-r--r--include/asm-ppc/highmem.h121
-rw-r--r--include/asm-ppc/ide.h2
-rw-r--r--include/asm-ppc/immap_8260.h8
-rw-r--r--include/asm-ppc/io.h80
-rw-r--r--include/asm-ppc/irq.h3
-rw-r--r--include/asm-ppc/keylargo.h103
-rw-r--r--include/asm-ppc/kmap_types.h10
-rw-r--r--include/asm-ppc/machdep.h4
-rw-r--r--include/asm-ppc/mbx.h1
-rw-r--r--include/asm-ppc/mman.h4
-rw-r--r--include/asm-ppc/nvram.h13
-rw-r--r--include/asm-ppc/pci-bridge.h9
-rw-r--r--include/asm-ppc/pgtable.h2
-rw-r--r--include/asm-ppc/processor.h1
-rw-r--r--include/asm-ppc/prom.h5
-rw-r--r--include/asm-ppc/resource.h4
-rw-r--r--include/asm-ppc/serial.h11
-rw-r--r--include/asm-ppc/smp.h7
-rw-r--r--include/asm-ppc/spinlock.h1
-rw-r--r--include/asm-ppc/system.h88
-rw-r--r--include/asm-ppc/time.h83
-rw-r--r--include/asm-ppc/uaccess.h31
-rw-r--r--include/asm-ppc/uninorth.h83
-rw-r--r--include/asm-ppc/unistd.h8
-rw-r--r--include/asm-s390/fcntl.h9
-rw-r--r--include/asm-s390/resource.h4
-rw-r--r--include/asm-s390/uaccess.h4
-rw-r--r--include/asm-sh/atomic.h25
-rw-r--r--include/asm-sh/bitops.h34
-rw-r--r--include/asm-sh/checksum.h12
-rw-r--r--include/asm-sh/delay.h3
-rw-r--r--include/asm-sh/fcntl.h21
-rw-r--r--include/asm-sh/ide.h3
-rw-r--r--include/asm-sh/io_hd64461.h4
-rw-r--r--include/asm-sh/irq.h3
-rw-r--r--include/asm-sh/page.h10
-rw-r--r--include/asm-sh/pci.h16
-rw-r--r--include/asm-sh/pgtable.h62
-rw-r--r--include/asm-sh/resource.h4
-rw-r--r--include/asm-sh/string.h13
-rw-r--r--include/asm-sh/system.h33
-rw-r--r--include/asm-sh/uaccess.h62
-rw-r--r--include/asm-sh/unistd.h44
-rw-r--r--include/asm-sparc/atomic.h13
-rw-r--r--include/asm-sparc/audioio.h1
-rw-r--r--include/asm-sparc/bitops.h5
-rw-r--r--include/asm-sparc/fcntl.h9
-rw-r--r--include/asm-sparc/floppy.h2
-rw-r--r--include/asm-sparc/hardirq.h76
-rw-r--r--include/asm-sparc/io.h6
-rw-r--r--include/asm-sparc/irq.h14
-rw-r--r--include/asm-sparc/oplib.h6
-rw-r--r--include/asm-sparc/resource.h4
-rw-r--r--include/asm-sparc/smp.h6
-rw-r--r--include/asm-sparc/system.h5
-rw-r--r--include/asm-sparc/uaccess.h37
-rw-r--r--include/asm-sparc64/atomic.h2
-rw-r--r--include/asm-sparc64/bitops.h5
-rw-r--r--include/asm-sparc64/fcntl.h9
-rw-r--r--include/asm-sparc64/io.h6
-rw-r--r--include/asm-sparc64/resource.h4
-rw-r--r--include/asm-sparc64/smp.h5
-rw-r--r--include/asm-sparc64/starfire.h21
-rw-r--r--include/asm-sparc64/system.h20
-rw-r--r--include/asm-sparc64/uaccess.h47
-rw-r--r--include/linux/ac97_codec.h5
-rw-r--r--include/linux/adb.h2
-rw-r--r--include/linux/adfs_fs.h2
-rw-r--r--include/linux/arcdevice.h1
-rw-r--r--include/linux/atalk.h2
-rw-r--r--include/linux/blk.h2
-rw-r--r--include/linux/brlock.h17
-rw-r--r--include/linux/byteorder/swab.h18
-rw-r--r--include/linux/capability.h4
-rw-r--r--include/linux/cciss_ioctl.h186
-rw-r--r--include/linux/coda.h90
-rw-r--r--include/linux/coda_cache.h14
-rw-r--r--include/linux/coda_fs_i.h7
-rw-r--r--include/linux/coda_linux.h16
-rw-r--r--include/linux/coda_psdev.h15
-rw-r--r--include/linux/cuda.h3
-rw-r--r--include/linux/dcache.h4
-rw-r--r--include/linux/devpts_fs.h8
-rw-r--r--include/linux/dnotify.h25
-rw-r--r--include/linux/elf.h2
-rw-r--r--include/linux/ext2_fs_sb.h2
-rw-r--r--include/linux/fat_cvf.h3
-rw-r--r--include/linux/fcntl.h20
-rw-r--r--include/linux/fs.h49
-rw-r--r--include/linux/gameport.h1
-rw-r--r--include/linux/hdlcdrv.h22
-rw-r--r--include/linux/hfs_fs.h4
-rw-r--r--include/linux/hfs_sysdep.h40
-rw-r--r--include/linux/highmem.h2
-rw-r--r--include/linux/if_pppox.h2
-rw-r--r--include/linux/inet.h1
-rw-r--r--include/linux/ixjuser.h90
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/kmod.h1
-rw-r--r--include/linux/locks.h11
-rw-r--r--include/linux/major.h15
-rw-r--r--include/linux/minix_fs.h7
-rw-r--r--include/linux/miscdevice.h2
-rw-r--r--include/linux/mm.h48
-rw-r--r--include/linux/mmzone.h9
-rw-r--r--include/linux/module.h8
-rw-r--r--include/linux/mount.h3
-rw-r--r--include/linux/netdevice.h1
-rw-r--r--include/linux/nfs_fs.h6
-rw-r--r--include/linux/nfs_mount.h1
-rw-r--r--include/linux/nfs_xdr.h3
-rw-r--r--include/linux/nfsd/export.h3
-rw-r--r--include/linux/nfsd/interface.h23
-rw-r--r--include/linux/nfsd/nfsd.h2
-rw-r--r--include/linux/pci.h108
-rw-r--r--include/linux/pci_ids.h22
-rw-r--r--include/linux/pmu.h64
-rw-r--r--include/linux/raid/md.h2
-rw-r--r--include/linux/raid/md_compatible.h6
-rw-r--r--include/linux/sched.h59
-rw-r--r--include/linux/signal.h45
-rw-r--r--include/linux/slab.h9
-rw-r--r--include/linux/smp.h1
-rw-r--r--include/linux/sunrpc/clnt.h1
-rw-r--r--include/linux/swap.h146
-rw-r--r--include/linux/sysctl.h21
-rw-r--r--include/linux/tcp.h58
-rw-r--r--include/linux/telephony.h70
-rw-r--r--include/linux/time.h37
-rw-r--r--include/linux/timex.h18
-rw-r--r--include/linux/toshiba.h36
-rw-r--r--include/linux/tqueue.h2
-rw-r--r--include/linux/usb.h72
-rw-r--r--include/linux/usbdevice_fs.h1
-rw-r--r--include/linux/vmalloc.h3
-rw-r--r--include/linux/vt_buffer.h10
-rw-r--r--include/linux/wait.h6
-rw-r--r--include/linux/zftape.h4
-rw-r--r--include/net/addrconf.h18
-rw-r--r--include/net/checksum.h2
-rw-r--r--include/net/dn_route.h6
-rw-r--r--include/net/dsfield.h10
-rw-r--r--include/net/dst.h16
-rw-r--r--include/net/if_inet6.h4
-rw-r--r--include/net/ip.h12
-rw-r--r--include/net/ip6_fib.h4
-rw-r--r--include/net/ip6_route.h2
-rw-r--r--include/net/ip_fib.h18
-rw-r--r--include/net/ipv6.h14
-rw-r--r--include/net/ndisc.h2
-rw-r--r--include/net/neighbour.h16
-rw-r--r--include/net/pkt_cls.h2
-rw-r--r--include/net/pkt_sched.h18
-rw-r--r--include/net/profile.h32
-rw-r--r--include/net/route.h20
-rw-r--r--include/net/snmp.h53
-rw-r--r--include/net/sock.h61
-rw-r--r--include/net/tcp.h64
-rw-r--r--include/net/x25.h2
-rw-r--r--include/pcmcia/bulkmem.h4
-rw-r--r--include/pcmcia/bus_ops.h4
-rw-r--r--include/pcmcia/ciscode.h11
-rw-r--r--include/pcmcia/cisreg.h4
-rw-r--r--include/pcmcia/cistpl.h21
-rw-r--r--include/pcmcia/cs.h9
-rw-r--r--include/pcmcia/cs_types.h4
-rw-r--r--include/pcmcia/driver_ops.h4
-rw-r--r--include/pcmcia/ds.h4
-rw-r--r--include/pcmcia/ftl.h4
-rw-r--r--include/pcmcia/mem_op.h4
-rw-r--r--include/pcmcia/memory.h4
-rw-r--r--include/pcmcia/ss.h6
-rw-r--r--include/pcmcia/version.h6
-rw-r--r--include/scsi/scsi.h1
-rw-r--r--include/scsi/scsi_ioctl.h7
-rw-r--r--include/scsi/sg.h8
402 files changed, 5894 insertions, 2983 deletions
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h
index cc8b6f278..4e8d0c410 100644
--- a/include/asm-alpha/atomic.h
+++ b/include/asm-alpha/atomic.h
@@ -1,8 +1,6 @@
#ifndef _ALPHA_ATOMIC_H
#define _ALPHA_ATOMIC_H
-#include <linux/config.h>
-
/*
* Atomic operations that C can't guarantee us. Useful for
* resource counting etc...
@@ -11,11 +9,13 @@
* than regular operations.
*/
-#ifdef CONFIG_SMP
+
+/*
+ * Counter is volatile to make sure gcc doesn't try to be clever
+ * and move things around on us. We need to use _exactly_ the address
+ * the user gave us, not some alias that contains the same information.
+ */
typedef struct { volatile int counter; } atomic_t;
-#else
-typedef struct { int counter; } atomic_t;
-#endif
#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
@@ -23,19 +23,12 @@ typedef struct { int counter; } atomic_t;
#define atomic_set(v,i) ((v)->counter = (i))
/*
- * Make sure gcc doesn't try to be clever and move things around
- * on us. We need to use _exactly_ the address the user gave us,
- * not some alias that contains the same information.
- */
-#define __atomic_fool_gcc(x) (*(struct { int a[100]; } *)x)
-
-/*
* To get proper branch prediction for the main line, we must branch
* forward to code at the end of this object's .text section, then
* branch back to restart the operation.
*/
-extern __inline__ void atomic_add(int i, atomic_t * v)
+static __inline__ void atomic_add(int i, atomic_t * v)
{
unsigned long temp;
__asm__ __volatile__(
@@ -46,11 +39,11 @@ extern __inline__ void atomic_add(int i, atomic_t * v)
".subsection 2\n"
"2: br 1b\n"
".previous"
- :"=&r" (temp), "=m" (__atomic_fool_gcc(v))
- :"Ir" (i), "m" (__atomic_fool_gcc(v)));
+ :"=&r" (temp), "=m" (v->counter)
+ :"Ir" (i), "m" (v->counter));
}
-extern __inline__ void atomic_sub(int i, atomic_t * v)
+static __inline__ void atomic_sub(int i, atomic_t * v)
{
unsigned long temp;
__asm__ __volatile__(
@@ -61,14 +54,14 @@ extern __inline__ void atomic_sub(int i, atomic_t * v)
".subsection 2\n"
"2: br 1b\n"
".previous"
- :"=&r" (temp), "=m" (__atomic_fool_gcc(v))
- :"Ir" (i), "m" (__atomic_fool_gcc(v)));
+ :"=&r" (temp), "=m" (v->counter)
+ :"Ir" (i), "m" (v->counter));
}
/*
* Same as above, but return the result value
*/
-extern __inline__ long atomic_add_return(int i, atomic_t * v)
+static __inline__ long atomic_add_return(int i, atomic_t * v)
{
long temp, result;
__asm__ __volatile__(
@@ -81,12 +74,12 @@ extern __inline__ long atomic_add_return(int i, atomic_t * v)
".subsection 2\n"
"2: br 1b\n"
".previous"
- :"=&r" (temp), "=m" (__atomic_fool_gcc(v)), "=&r" (result)
- :"Ir" (i), "m" (__atomic_fool_gcc(v)));
+ :"=&r" (temp), "=m" (v->counter), "=&r" (result)
+ :"Ir" (i), "m" (v->counter) : "memory");
return result;
}
-extern __inline__ long atomic_sub_return(int i, atomic_t * v)
+static __inline__ long atomic_sub_return(int i, atomic_t * v)
{
long temp, result;
__asm__ __volatile__(
@@ -99,8 +92,8 @@ extern __inline__ long atomic_sub_return(int i, atomic_t * v)
".subsection 2\n"
"2: br 1b\n"
".previous"
- :"=&r" (temp), "=m" (__atomic_fool_gcc(v)), "=&r" (result)
- :"Ir" (i), "m" (__atomic_fool_gcc(v)));
+ :"=&r" (temp), "=m" (v->counter), "=&r" (result)
+ :"Ir" (i), "m" (v->counter) : "memory");
return result;
}
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h
index 69bfdcaf1..649abd02d 100644
--- a/include/asm-alpha/bitops.h
+++ b/include/asm-alpha/bitops.h
@@ -1,6 +1,9 @@
#ifndef _ALPHA_BITOPS_H
#define _ALPHA_BITOPS_H
+#include <linux/config.h>
+#include <linux/kernel.h>
+
/*
* Copyright 1994, Linus Torvalds.
*/
@@ -17,14 +20,19 @@
* bit 0 is the LSB of addr; bit 64 is the LSB of (addr+1).
*/
+#define BITOPS_NO_BRANCH
+
extern __inline__ void set_bit(unsigned long nr, volatile void * addr)
{
+#ifndef BITOPS_NO_BRANCH
unsigned long oldbit;
+#endif
unsigned long temp;
unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
+#ifndef BITOPS_NO_BRANCH
__asm__ __volatile__(
- "1: ldl_l %0,%1\n"
+ "1: ldl_l %0,%4\n"
" and %0,%3,%2\n"
" bne %2,2f\n"
" xor %0,%3,%0\n"
@@ -36,16 +44,57 @@ extern __inline__ void set_bit(unsigned long nr, volatile void * addr)
".previous"
:"=&r" (temp), "=m" (*m), "=&r" (oldbit)
:"Ir" (1UL << (nr & 31)), "m" (*m));
+#else
+ __asm__ __volatile__(
+ "1: ldl_l %0,%3\n"
+ " bis %0,%2,%0\n"
+ " stl_c %0,%1\n"
+ " beq %0,2f\n"
+ ".subsection 2\n"
+ "2: br 1b\n"
+ ".previous"
+ :"=&r" (temp), "=m" (*m)
+ :"Ir" (1UL << (nr & 31)), "m" (*m));
+#endif
}
+/*
+ * WARNING: non atomic version.
+ */
+extern __inline__ void __set_bit(unsigned long nr, volatile void * addr)
+{
+ unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
+ /*
+ * Asm and C produces the same thing so let
+ * the compiler to do its good work.
+ */
+#if 0
+ int tmp;
+
+ __asm__ __volatile__(
+ "ldl %0,%3\n\t"
+ "bis %0,%2,%0\n\t"
+ "stl %0,%1"
+ : "=&r" (tmp), "=m" (*m)
+ : "Ir" (1UL << (nr & 31)), "m" (*m));
+#else
+ *m |= 1UL << (nr & 31);
+#endif
+}
+
+#define smp_mb__before_clear_bit() smp_mb()
+#define smp_mb__after_clear_bit() smp_mb()
extern __inline__ void clear_bit(unsigned long nr, volatile void * addr)
{
+#ifndef BITOPS_NO_BRANCH
unsigned long oldbit;
+#endif
unsigned long temp;
unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
+#ifndef BITOPS_NO_BRANCH
__asm__ __volatile__(
- "1: ldl_l %0,%1\n"
+ "1: ldl_l %0,%4\n"
" and %0,%3,%2\n"
" beq %2,2f\n"
" xor %0,%3,%0\n"
@@ -57,6 +106,18 @@ extern __inline__ void clear_bit(unsigned long nr, volatile void * addr)
".previous"
:"=&r" (temp), "=m" (*m), "=&r" (oldbit)
:"Ir" (1UL << (nr & 31)), "m" (*m));
+#else
+ __asm__ __volatile__(
+ "1: ldl_l %0,%3\n"
+ " and %0,%2,%0\n"
+ " stl_c %0,%1\n"
+ " beq %0,2f\n"
+ ".subsection 2\n"
+ "2: br 1b\n"
+ ".previous"
+ :"=&r" (temp), "=m" (*m)
+ :"Ir" (~(1UL << (nr & 31))), "m" (*m));
+#endif
}
extern __inline__ void change_bit(unsigned long nr, volatile void * addr)
@@ -65,12 +126,12 @@ extern __inline__ void change_bit(unsigned long nr, volatile void * addr)
unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
__asm__ __volatile__(
- "1: ldl_l %0,%1\n"
+ "1: ldl_l %0,%3\n"
" xor %0,%2,%0\n"
" stl_c %0,%1\n"
- " beq %0,3f\n"
+ " beq %0,2f\n"
".subsection 2\n"
- "3: br 1b\n"
+ "2: br 1b\n"
".previous"
:"=&r" (temp), "=m" (*m)
:"Ir" (1UL << (nr & 31)), "m" (*m));
@@ -84,18 +145,43 @@ extern __inline__ int test_and_set_bit(unsigned long nr,
unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
__asm__ __volatile__(
- "1: ldl_l %0,%1\n"
+ "1: ldl_l %0,%4\n"
" and %0,%3,%2\n"
" bne %2,2f\n"
" xor %0,%3,%0\n"
" stl_c %0,%1\n"
" beq %0,3f\n"
+#ifdef CONFIG_SMP
" mb\n"
+#endif
"2:\n"
".subsection 2\n"
"3: br 1b\n"
".previous"
:"=&r" (temp), "=m" (*m), "=&r" (oldbit)
+ :"Ir" (1UL << (nr & 31)), "m" (*m) : "memory");
+
+ return oldbit != 0;
+}
+
+/*
+ * WARNING: non atomic version.
+ */
+extern __inline__ int __test_and_set_bit(unsigned long nr,
+ volatile void * addr)
+{
+ unsigned long oldbit;
+ unsigned long temp;
+ unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
+
+ __asm__ __volatile__(
+ " ldl %0,%4\n"
+ " and %0,%3,%2\n"
+ " bne %2,1f\n"
+ " xor %0,%3,%0\n"
+ " stl %0,%1\n"
+ "1:\n"
+ :"=&r" (temp), "=m" (*m), "=&r" (oldbit)
:"Ir" (1UL << (nr & 31)), "m" (*m));
return oldbit != 0;
@@ -109,18 +195,43 @@ extern __inline__ int test_and_clear_bit(unsigned long nr,
unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
__asm__ __volatile__(
- "1: ldl_l %0,%1\n"
+ "1: ldl_l %0,%4\n"
" and %0,%3,%2\n"
" beq %2,2f\n"
" xor %0,%3,%0\n"
" stl_c %0,%1\n"
" beq %0,3f\n"
+#ifdef CONFIG_SMP
" mb\n"
+#endif
"2:\n"
".subsection 2\n"
"3: br 1b\n"
".previous"
:"=&r" (temp), "=m" (*m), "=&r" (oldbit)
+ :"Ir" (1UL << (nr & 31)), "m" (*m) : "memory");
+
+ return oldbit != 0;
+}
+
+/*
+ * WARNING: non atomic version.
+ */
+extern __inline__ int __test_and_clear_bit(unsigned long nr,
+ volatile void * addr)
+{
+ unsigned long oldbit;
+ unsigned long temp;
+ unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
+
+ __asm__ __volatile__(
+ " ldl %0,%4\n"
+ " and %0,%3,%2\n"
+ " beq %2,1f\n"
+ " xor %0,%3,%0\n"
+ " stl %0,%1\n"
+ "1:\n"
+ :"=&r" (temp), "=m" (*m), "=&r" (oldbit)
:"Ir" (1UL << (nr & 31)), "m" (*m));
return oldbit != 0;
@@ -134,17 +245,19 @@ extern __inline__ int test_and_change_bit(unsigned long nr,
unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
__asm__ __volatile__(
- "1: ldl_l %0,%1\n"
+ "1: ldl_l %0,%4\n"
" and %0,%3,%2\n"
" xor %0,%3,%0\n"
" stl_c %0,%1\n"
" beq %0,3f\n"
+#ifdef CONFIG_SMP
" mb\n"
+#endif
".subsection 2\n"
"3: br 1b\n"
".previous"
:"=&r" (temp), "=m" (*m), "=&r" (oldbit)
- :"Ir" (1UL << (nr & 31)), "m" (*m));
+ :"Ir" (1UL << (nr & 31)), "m" (*m) : "memory");
return oldbit != 0;
}
@@ -175,13 +288,10 @@ extern inline unsigned long ffz_b(unsigned long x)
extern inline unsigned long ffz(unsigned long word)
{
-#if 0 && defined(__alpha_cix__)
- /* Swine architects -- a year after they publish v3 of the
- handbook, in the 21264 data sheet they quietly change CIX
- to FIX and remove the spiffy counting instructions. */
+#if defined(__alpha_cix__) && defined(__alpha_fix__)
/* Whee. EV6 can calculate it directly. */
unsigned long result;
- __asm__("ctlz %1,%0" : "=r"(result) : "r"(~word));
+ __asm__("cttz %1,%0" : "=r"(result) : "r"(~word));
return result;
#else
unsigned long bits, qofs, bofs;
@@ -214,10 +324,7 @@ extern inline int ffs(int word)
* of bits set) of a N-bit word
*/
-#if 0 && defined(__alpha_cix__)
-/* Swine architects -- a year after they publish v3 of the handbook, in
- the 21264 data sheet they quietly change CIX to FIX and remove the
- spiffy counting instructions. */
+#if defined(__alpha_cix__) && defined(__alpha_fix__)
/* Whee. EV6 can calculate it directly. */
extern __inline__ unsigned long hweight64(unsigned long w)
{
@@ -285,16 +392,16 @@ found_middle:
#ifdef __KERNEL__
-#define ext2_set_bit test_and_set_bit
-#define ext2_clear_bit test_and_clear_bit
+#define ext2_set_bit __test_and_set_bit
+#define ext2_clear_bit __test_and_clear_bit
#define ext2_test_bit test_bit
#define ext2_find_first_zero_bit find_first_zero_bit
#define ext2_find_next_zero_bit find_next_zero_bit
/* Bitmap functions for the minix filesystem. */
-#define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr)
-#define minix_set_bit(nr,addr) set_bit(nr,addr)
-#define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr)
+#define minix_test_and_set_bit(nr,addr) __test_and_set_bit(nr,addr)
+#define minix_set_bit(nr,addr) __set_bit(nr,addr)
+#define minix_test_and_clear_bit(nr,addr) __test_and_clear_bit(nr,addr)
#define minix_test_bit(nr,addr) test_bit(nr,addr)
#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
diff --git a/include/asm-alpha/core_irongate.h b/include/asm-alpha/core_irongate.h
index c97283d89..e2c9fa968 100644
--- a/include/asm-alpha/core_irongate.h
+++ b/include/asm-alpha/core_irongate.h
@@ -83,247 +83,24 @@ typedef struct {
igcsr32 agpmode; /* 0xB0 - AGP/GART mode control */
} Irongate0;
-/* Bitfield and mask register definitions */
-
-/* Device, vendor IDs - offset 0x00 */
-
-typedef union {
- igcsr32 i; /* integer value of CSR */
- struct {
- unsigned v : 16;
- unsigned d : 16;
- } r; /* structured interpretation */
-} ig_dev_vendor_t;
-
-
-/* Status, command registers - offset 0x04 */
-
-typedef union {
- igcsr32 i;
- struct {
- unsigned command;
- unsigned status;
- } s;
- struct {
- /* command register fields */
- unsigned iospc : 1; /* always reads zero */
- unsigned memspc : 1; /* PCI memory space accesses? */
- unsigned iten : 1; /* always 1: can be bus initiator */
- unsigned scmon : 1; /* always 0 special cycles not chckd */
- unsigned mwic : 1; /* always 0 - no mem write & invalid */
- unsigned vgaps : 1; /* always 0 - palette rds not special */
- unsigned per : 1; /* parity error resp: always 0 */
- unsigned step : 1; /* address/data stepping : always 0 */
- unsigned serre : 1; /* 1 = sys err output driver enable */
- unsigned fbbce : 1; /* fast back-back cycle : always 0 */
- unsigned zero1 : 6; /* must be zero */
-
- /* status register fields */
- unsigned zero2 : 4; /* must be zero */
- unsigned cl : 1; /* config space capa list: always 1 */
- unsigned pci66 : 1; /* 66 MHz PCI support - always 0 */
- unsigned udf : 1; /* user defined features - always 0 */
- unsigned fbbc : 1; /* back-back transactions - always 0 */
- unsigned ppe : 1; /* PCI parity error detected (0) */
- unsigned devsel : 2; /* DEVSEL timing (always 01) */
- unsigned sta : 1; /* signalled target abort (0) */
- unsigned rta : 1; /* recvd target abort */
- unsigned ria : 1; /* recvd initiator abort */
- unsigned serr : 1; /* SERR has been asserted */
- unsigned dpe : 1; /* DRAM parity error (0) */
- } r;
-} ig_stat_cmd_t;
-
-
-/* Revision ID, Programming interface, subclass, baseclass - offset 0x08 */
-
-typedef union {
- igcsr32 i;
- struct {
- /* revision ID */
- unsigned step : 4; /* stepping Revision ID */
- unsigned die : 4; /* die Revision ID */
- unsigned pif : 8; /* programming interface (0x00) */
- unsigned sub : 8; /* subclass code (0x00) */
- unsigned base: 8; /* baseclass code (0x06) */
- } r;
-} ig_class_t;
-
-
-/* Latency Timer, PCI Header type - offset 0x0C */
-
-typedef union {
- igcsr32 i;
- struct {
- unsigned zero1:8; /* reserved */
- unsigned lat : 8; /* latency in PCI bus clocks */
- unsigned hdr : 8; /* PCI header type */
- unsigned zero2:8; /* reserved */
- } r;
-} ig_latency_t;
-
-
-/* Base Address Register 0 - offset 0x10 */
-
-typedef union {
- igcsr32 i;
- struct {
- unsigned mem : 1; /* Reg pts to memory (always 0) */
- unsigned type: 2; /* 32 bit register = 0b00 */
- unsigned pref: 1; /* graphics mem prefetchable=1 */
- unsigned baddrl : 21; /* 32M = minimum alloc -> all zero */
- unsigned size : 6; /* size requirements for AGP */
- unsigned zero : 1; /* reserved=0 */
- } r;
-} ig_bar0_t;
-
-
-/* Base Address Register 1 - offset 0x14 */
-
-typedef union {
- igcsr32 i;
- struct {
- unsigned mem : 1; /* BAR0 maps to memory -> 0 */
- unsigned type : 2; /* BAR1 is 32-bit -> 0b00 */
- unsigned pref : 1; /* graphics mem prefetchable=1 */
- unsigned baddrl : 8; /* 4K alloc for AGP CSRs -> 0b00 */
- unsigned baddrh : 20; /* base addr of AGP CSRs A[30:11] */
- } r;
-} ig_bar1_t;
-
-
-/* Base Address Register 2 - offset 0x18 */
-
-typedef union {
- igcsr32 i;
- struct {
- unsigned io : 1; /* BAR2 maps to I/O space -> 1 */
- unsigned zero1: 1; /* reserved */
- unsigned addr : 22; /* BAR2[31:10] - PM2_BLK base */
- unsigned zero2: 8; /* reserved */
- } r;
-} ig_bar2_t;
-
-
-/* Capabilities Pointer - offset 0x34 */
-
-typedef union {
- igcsr32 i;
- struct {
- unsigned cap : 8; /* =0xA0, offset of AGP ctrl regs */
- unsigned zero: 24; /* reserved */
- } r;
-} ig_capptr_t;
-
-
-/* Base Address Chip Select Register 1,0 - offset 0x40 */
-/* Base Address Chip Select Register 3,2 - offset 0x44 */
-/* Base Address Chip Select Register 5,4 - offset 0x48 */
-
-typedef union {
-
- igcsr32 i;
- struct {
- /* lower bank */
- unsigned en0 : 1; /* memory bank enabled */
- unsigned mask0 : 6; /* Address mask for A[28:23] */
- unsigned base0 : 9; /* Bank Base Address A[31:23] */
-
- /* upper bank */
- unsigned en1 : 1; /* memory bank enabled */
- unsigned mask1 : 6; /* Address mask for A[28:23] */
- unsigned base1 : 9; /* Bank Base Address A[31:23] */
- } r;
-} ig_bacsr_t, ig_bacsr10_t, ig_bacsr32_t, ig_bacsr54_t;
-
-
-/* SDRAM Address Mapping Control Register - offset 0x50 */
-
-typedef union {
- igcsr32 i;
- struct {
- unsigned z1 : 1; /* reserved */
- unsigned bnks0: 1; /* 0->2 banks in chip select 0 */
- unsigned am0 : 1; /* row/column addressing */
- unsigned z2 : 1; /* reserved */
-
- unsigned z3 : 1; /* reserved */
- unsigned bnks1: 1; /* 0->2 banks in chip select 1 */
- unsigned am1 : 1; /* row/column addressing */
- unsigned z4 : 1; /* reserved */
-
- unsigned z5 : 1; /* reserved */
- unsigned bnks2: 1; /* 0->2 banks in chip select 2 */
- unsigned am2 : 1; /* row/column addressing */
- unsigned z6 : 1; /* reserved */
-
- unsigned z7 : 1; /* reserved */
- unsigned bnks3: 1; /* 0->2 banks in chip select 3 */
- unsigned am3 : 1; /* row/column addressing */
- unsigned z8 : 1; /* reserved */
-
- unsigned z9 : 1; /* reserved */
- unsigned bnks4: 1; /* 0->2 banks in chip select 4 */
- unsigned am4 : 1; /* row/column addressing */
- unsigned z10 : 1; /* reserved */
-
- unsigned z11 : 1; /* reserved */
- unsigned bnks5: 1; /* 0->2 banks in chip select 5 */
- unsigned am5 : 1; /* row/column addressing */
- unsigned z12 : 1; /* reserved */
-
- unsigned rsrvd: 8; /* reserved */
- } r;
-} ig_drammap_t;
-
-
-/* DRAM timing and driver strength register - offset 0x54 */
-
-typedef union {
- igcsr32 i;
- struct {
- /* DRAM timing parameters */
- unsigned trcd : 2;
- unsigned tcl : 2;
- unsigned tras: 3;
- unsigned trp : 2;
- unsigned trc : 3;
- unsigned icl: 2;
- unsigned ph : 2;
-
- /* Chipselect driver strength */
- unsigned adra : 1;
- unsigned adrb : 1;
- unsigned ctrl : 3;
- unsigned dqm : 1;
- unsigned cs : 1;
- unsigned clk: 1;
- unsigned rsrvd:8;
- } r;
-} ig_dramtm_t;
-
-
-/* DRAM Mode / Status and ECC Register - offset 0x58 */
-
-typedef union {
- igcsr32 i;
- struct {
- unsigned chipsel : 6; /* failing ECC chip select */
- unsigned zero1 : 2; /* always reads zero */
- unsigned status : 2; /* ECC Detect logic status */
- unsigned zero2 : 6; /* always reads zero */
-
- unsigned cycles : 2; /* cycles per refresh, see table */
- unsigned en : 1; /* ECC enable */
- unsigned r : 1; /* Large burst enable (=0) */
- unsigned bre : 1; /* Burst refresh enable */
- unsigned zero3 : 2; /* reserved = 0 */
- unsigned mwe : 1; /* Enable writes to DRAM mode reg */
- unsigned type : 1; /* SDRAM = 0, default */
- unsigned sdraminit : 1; /* SDRAM init - set params first! */
- unsigned zero4 : 6; /* reserved = 0 */
- } r;
-} ig_dramms_t;
+
+typedef struct {
+
+ igcsr32 dev_vendor; /* 0x00 - Device and Vendor IDs */
+ igcsr32 stat_cmd; /* 0x04 - Status and Command regs */
+ igcsr32 class; /* 0x08 - subclass, baseclass etc */
+ igcsr32 htype; /* 0x0C - header type (at 0x0E) */
+ igcsr32 rsrvd0[2]; /* 0x10-0x17 reserved */
+ igcsr32 busnos; /* 0x18 - Primary, secondary bus nos */
+ igcsr32 io_baselim_regs; /* 0x1C - IO base, IO lim, AGP status */
+ igcsr32 mem_baselim; /* 0x20 - memory base, memory lim */
+ igcsr32 pfmem_baselim; /* 0x24 - prefetchable base, lim */
+ igcsr32 rsrvd1[2]; /* 0x28-0x2F reserved */
+ igcsr32 io_baselim; /* 0x30 - IO base, IO limit */
+ igcsr32 rsrvd2[2]; /* 0x34-0x3B - reserved */
+ igcsr32 interrupt; /* 0x3C - interrupt, PCI bridge ctrl */
+
+} Irongate1;
/*
@@ -343,7 +120,21 @@ typedef union {
#define IRONGATE_IO (IDENT_ADDR | IRONGATE_BIAS | 0x1FC000000UL)
#define IRONGATE_CONF (IDENT_ADDR | IRONGATE_BIAS | 0x1FE000000UL)
-#define IRONGATE0 ((Irongate0 *) IRONGATE_CONF)
+/*
+ * PCI Configuration space accesses are formed like so:
+ *
+ * 0x1FE << 24 | : 2 2 2 2 1 1 1 1 : 1 1 1 1 1 1 0 0 : 0 0 0 0 0 0 0 0 :
+ * : 3 2 1 0 9 8 7 6 : 5 4 3 2 1 0 9 8 : 7 6 5 4 3 2 1 0 :
+ * ---bus numer--- -device-- -fun- ---register----
+ */
+
+#define IGCSR(dev,fun,reg) ( IRONGATE_CONF | \
+ ((dev)<<11) | \
+ ((fun)<<8) | \
+ (reg) )
+
+#define IRONGATE0 ((Irongate0 *) IGCSR(0, 0, 0))
+#define IRONGATE1 ((Irongate1 *) IGCSR(1, 0, 0))
/*
* Data structure for handling IRONGATE machine checks:
diff --git a/include/asm-alpha/elf.h b/include/asm-alpha/elf.h
index d031ef3c2..7d5df3a44 100644
--- a/include/asm-alpha/elf.h
+++ b/include/asm-alpha/elf.h
@@ -127,7 +127,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
#ifdef __KERNEL__
#define SET_PERSONALITY(EX, IBCS2) \
- set_personality((EX).e_flags & EF_ALPHA_32BIT \
+ set_personality(((EX).e_flags & EF_ALPHA_32BIT) \
? PER_LINUX_32BIT : (IBCS2) ? PER_SVR4 : PER_LINUX)
#endif
diff --git a/include/asm-alpha/fcntl.h b/include/asm-alpha/fcntl.h
index 314e3addb..86a73667f 100644
--- a/include/asm-alpha/fcntl.h
+++ b/include/asm-alpha/fcntl.h
@@ -48,13 +48,19 @@
#define F_EXLCK 16 /* or 3 */
#define F_SHLCK 32 /* or 4 */
+#define F_INPROGRESS 16
+
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
#define LOCK_NB 4 /* or'd with one of the above to prevent
blocking */
#define LOCK_UN 8 /* remove lock */
-
+#define LOCK_MAND 32 /* This is a mandatory flock */
+#define LOCK_READ 64 /* ... Which allows concurrent read operations */
+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
+
struct flock {
short l_type;
short l_whence;
@@ -66,5 +72,6 @@ struct flock {
#ifdef __KERNEL__
#define flock64 flock
#endif
+#define F_LINUX_SPECIFIC_BASE 1024
#endif
diff --git a/include/asm-alpha/resource.h b/include/asm-alpha/resource.h
index 0f2ddd20c..686b9558d 100644
--- a/include/asm-alpha/resource.h
+++ b/include/asm-alpha/resource.h
@@ -15,8 +15,9 @@
#define RLIMIT_AS 7 /* address space limit(?) */
#define RLIMIT_NPROC 8 /* max number of processes */
#define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
-#define RLIM_NLIMITS 10
+#define RLIM_NLIMITS 11
/*
* SuS says limits have to be unsigned. Fine, it's unsigned, but
@@ -39,6 +40,7 @@
{LONG_MAX, LONG_MAX}, /* RLIMIT_AS */ \
{LONG_MAX, LONG_MAX}, /* RLIMIT_NPROC */ \
{LONG_MAX, LONG_MAX}, /* RLIMIT_MEMLOCK */ \
+ {LONG_MAX, LONG_MAX}, /* RLIMIT_LOCKS */ \
}
#endif /* __KERNEL__ */
diff --git a/include/asm-alpha/semaphore-helper.h b/include/asm-alpha/semaphore-helper.h
index 2812510db..52d8fb5f4 100644
--- a/include/asm-alpha/semaphore-helper.h
+++ b/include/asm-alpha/semaphore-helper.h
@@ -37,7 +37,7 @@ waking_non_zero(struct semaphore *sem)
".subsection 2\n"
"3: br 1b\n"
".previous"
- : "=r"(ret), "=r"(tmp), "=m"(__atomic_fool_gcc(&sem->waking))
+ : "=r"(ret), "=r"(tmp), "=m"(sem->waking.counter)
: "0"(0));
return ret > 0;
diff --git a/include/asm-alpha/spinlock.h b/include/asm-alpha/spinlock.h
index c14eb0909..64e05d17b 100644
--- a/include/asm-alpha/spinlock.h
+++ b/include/asm-alpha/spinlock.h
@@ -5,8 +5,8 @@
#include <linux/kernel.h>
#include <asm/current.h>
-#define DEBUG_SPINLOCK 1
-#define DEBUG_RWLOCK 1
+#define DEBUG_SPINLOCK 0
+#define DEBUG_RWLOCK 0
/*
* Simple spin lock operations. There are two variants, one clears IRQ's
@@ -38,9 +38,6 @@ typedef struct {
#define spin_is_locked(x) ((x)->lock != 0)
#define spin_unlock_wait(x) ({ do { barrier(); } while ((x)->lock); })
-typedef struct { unsigned long a[100]; } __dummy_lock_t;
-#define __dummy_lock(lock) (*(__dummy_lock_t *)(lock))
-
#if DEBUG_SPINLOCK
extern void spin_unlock(spinlock_t * lock);
extern void debug_spin_lock(spinlock_t * lock, const char *, int);
@@ -83,8 +80,8 @@ static inline void spin_lock(spinlock_t * lock)
" blbs %0,2b\n"
" br 1b\n"
".previous"
- : "=r" (tmp), "=m" (__dummy_lock(lock))
- : "m"(__dummy_lock(lock)));
+ : "=r" (tmp), "=m" (lock->lock)
+ : "m"(lock->lock) : "memory");
}
#define spin_trylock(lock) (!test_and_set_bit(0,(lock)))
@@ -119,9 +116,8 @@ static inline void write_lock(rwlock_t * lock)
" bne %1,6b\n"
" br 1b\n"
".previous"
- : "=m" (__dummy_lock(lock)), "=&r" (regx)
- : "0" (__dummy_lock(lock))
- );
+ : "=m" (*(volatile int *)lock), "=&r" (regx)
+ : "0" (*(volatile int *)lock) : "memory");
}
static inline void read_lock(rwlock_t * lock)
@@ -140,9 +136,8 @@ static inline void read_lock(rwlock_t * lock)
" blbs %1,6b\n"
" br 1b\n"
".previous"
- : "=m" (__dummy_lock(lock)), "=&r" (regx)
- : "m" (__dummy_lock(lock))
- );
+ : "=m" (*(volatile int *)lock), "=&r" (regx)
+ : "m" (*(volatile int *)lock) : "memory");
}
#endif /* DEBUG_RWLOCK */
@@ -156,6 +151,7 @@ static inline void read_unlock(rwlock_t * lock)
{
long regx;
__asm__ __volatile__(
+ " mb\n"
"1: ldl_l %1,%0\n"
" addl %1,2,%1\n"
" stl_c %1,%0\n"
@@ -163,8 +159,8 @@ static inline void read_unlock(rwlock_t * lock)
".subsection 2\n"
"6: br 1b\n"
".previous"
- : "=m" (__dummy_lock(lock)), "=&r" (regx)
- : "m" (__dummy_lock(lock)));
+ : "=m" (*(volatile int *)lock), "=&r" (regx)
+ : "m" (*(volatile int *)lock) : "memory");
}
#endif /* _ALPHA_SPINLOCK_H */
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
index 6328750e1..b97d0c5b6 100644
--- a/include/asm-alpha/system.h
+++ b/include/asm-alpha/system.h
@@ -137,12 +137,19 @@ __asm__ __volatile__("mb": : :"memory")
#define wmb() \
__asm__ __volatile__("wmb": : :"memory")
+#ifdef CONFIG_SMP
+#define smp_mb() mb()
+#define smp_rmb() rmb()
+#define smp_wmb() wmb()
+#else
+#define smp_mb() barrier()
+#define smp_rmb() barrier()
+#define smp_wmb() barrier()
+#endif
+
#define set_mb(var, value) \
do { var = value; mb(); } while (0)
-#define set_rmb(var, value) \
-do { var = value; rmb(); } while (0)
-
#define set_wmb(var, value) \
do { var = value; wmb(); } while (0)
@@ -284,11 +291,11 @@ extern int __min_ipl;
#define getipl() (rdps() & 7)
#define setipl(ipl) ((void) swpipl(ipl))
-#define __cli() setipl(IPL_MAX)
-#define __sti() setipl(IPL_MIN)
+#define __cli() do { setipl(IPL_MAX); barrier(); } while(0)
+#define __sti() do { barrier(); setipl(IPL_MIN); } while(0)
#define __save_flags(flags) ((flags) = rdps())
-#define __save_and_cli(flags) ((flags) = swpipl(IPL_MAX))
-#define __restore_flags(flags) setipl(flags)
+#define __save_and_cli(flags) do { (flags) = swpipl(IPL_MAX); barrier(); } while(0)
+#define __restore_flags(flags) do { barrier(); setipl(flags); barrier(); } while(0)
#define local_irq_save(flags) __save_and_cli(flags)
#define local_irq_restore(flags) __restore_flags(flags)
@@ -344,6 +351,8 @@ extern void __global_restore_flags(unsigned long flags);
/*
* Atomic exchange.
+ * Since it can be used to implement critical sections
+ * it must clobber "memory" (also for interrupts in UP).
*/
extern __inline__ unsigned long
@@ -352,16 +361,18 @@ __xchg_u32(volatile int *m, unsigned long val)
unsigned long dummy;
__asm__ __volatile__(
- "1: ldl_l %0,%2\n"
+ "1: ldl_l %0,%4\n"
" bis $31,%3,%1\n"
" stl_c %1,%2\n"
" beq %1,2f\n"
+#ifdef CONFIG_SMP
" mb\n"
+#endif
".subsection 2\n"
"2: br 1b\n"
".previous"
: "=&r" (val), "=&r" (dummy), "=m" (*m)
- : "rI" (val), "m" (*m));
+ : "rI" (val), "m" (*m) : "memory");
return val;
}
@@ -372,16 +383,18 @@ __xchg_u64(volatile long *m, unsigned long val)
unsigned long dummy;
__asm__ __volatile__(
- "1: ldq_l %0,%2\n"
+ "1: ldq_l %0,%4\n"
" bis $31,%3,%1\n"
" stq_c %1,%2\n"
" beq %1,2f\n"
+#ifdef CONFIG_SMP
" mb\n"
+#endif
".subsection 2\n"
"2: br 1b\n"
".previous"
: "=&r" (val), "=&r" (dummy), "=m" (*m)
- : "rI" (val), "m" (*m));
+ : "rI" (val), "m" (*m) : "memory");
return val;
}
@@ -416,6 +429,11 @@ __xchg(volatile void *ptr, unsigned long x, int size)
* Atomic compare and exchange. Compare OLD with MEM, if identical,
* store NEW in MEM. Return the initial value in MEM. Success is
* indicated by comparing RETURN with OLD.
+ *
+ * The memory barrier should be placed in SMP only when we actually
+ * make the change. If we don't change anything (so if the returned
+ * prev is equal to old) then we aren't acquiring anything new and
+ * we don't need any memory barrier as far I can tell.
*/
#define __HAVE_ARCH_CMPXCHG 1
@@ -426,18 +444,21 @@ __cmpxchg_u32(volatile int *m, int old, int new)
unsigned long prev, cmp;
__asm__ __volatile__(
- "1: ldl_l %0,%2\n"
+ "1: ldl_l %0,%5\n"
" cmpeq %0,%3,%1\n"
" beq %1,2f\n"
" mov %4,%1\n"
" stl_c %1,%2\n"
" beq %1,3f\n"
- "2: mb\n"
+#ifdef CONFIG_SMP
+ " mb\n"
+#endif
+ "2:\n"
".subsection 2\n"
"3: br 1b\n"
".previous"
: "=&r"(prev), "=&r"(cmp), "=m"(*m)
- : "r"((long) old), "r"(new), "m"(*m));
+ : "r"((long) old), "r"(new), "m"(*m) : "memory");
return prev;
}
@@ -448,18 +469,21 @@ __cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
unsigned long prev, cmp;
__asm__ __volatile__(
- "1: ldq_l %0,%2\n"
+ "1: ldq_l %0,%5\n"
" cmpeq %0,%3,%1\n"
" beq %1,2f\n"
" mov %4,%1\n"
" stq_c %1,%2\n"
" beq %1,3f\n"
- "2: mb\n"
+#ifdef CONFIG_SMP
+ " mb\n"
+#endif
+ "2:\n"
".subsection 2\n"
"3: br 1b\n"
".previous"
: "=&r"(prev), "=&r"(cmp), "=m"(*m)
- : "r"((long) old), "r"(new), "m"(*m));
+ : "r"((long) old), "r"(new), "m"(*m) : "memory");
return prev;
}
diff --git a/include/asm-alpha/termios.h b/include/asm-alpha/termios.h
index 2c8b5288a..670576b84 100644
--- a/include/asm-alpha/termios.h
+++ b/include/asm-alpha/termios.h
@@ -71,6 +71,7 @@ struct termio {
#define N_SLIP 1
#define N_MOUSE 2
#define N_PPP 3
+#define N_STRIP 4
#define N_AX25 5
#define N_X25 6 /* X.25 async */
#define N_6PACK 7
diff --git a/include/asm-alpha/uaccess.h b/include/asm-alpha/uaccess.h
index 98c446942..eeb5b8540 100644
--- a/include/asm-alpha/uaccess.h
+++ b/include/asm-alpha/uaccess.h
@@ -79,24 +79,6 @@ extern inline int verify_area(int type, const void * addr, unsigned long size)
__get_user_nocheck((x),(ptr),sizeof(*(ptr)))
/*
- * The "xxx_ret" versions return constant specified in third argument, if
- * something bad happens. These macros can be optimized for the
- * case of just returning from the function xxx_ret is used.
- */
-
-#define put_user_ret(x,ptr,ret) ({ \
-if (put_user(x,ptr)) return ret; })
-
-#define get_user_ret(x,ptr,ret) ({ \
-if (get_user(x,ptr)) return ret; })
-
-#define __put_user_ret(x,ptr,ret) ({ \
-if (__put_user(x,ptr)) return ret; })
-
-#define __get_user_ret(x,ptr,ret) ({ \
-if (__get_user(x,ptr)) return ret; })
-
-/*
* The "lda %1, 2b-1b(%0)" bits are magic to get the assembler to
* encode the bits we need for resolving the exception. See the
* more extensive comments with fixup_inline_exception below for
@@ -417,16 +399,6 @@ copy_from_user(void *to, const void *from, long n)
return __copy_tofrom_user(to, from, n, from);
}
-#define copy_to_user_ret(to,from,n,retval) ({ \
-if (copy_to_user(to,from,n)) \
- return retval; \
-})
-
-#define copy_from_user_ret(to,from,n,retval) ({ \
-if (copy_from_user(to,from,n)) \
- return retval; \
-})
-
extern void __do_clear_user(void);
extern inline long
diff --git a/include/asm-arm/arch-arc/dma.h b/include/asm-arm/arch-arc/dma.h
index 77d1dfddf..0e72b5336 100644
--- a/include/asm-arm/arch-arc/dma.h
+++ b/include/asm-arm/arch-arc/dma.h
@@ -1,13 +1,17 @@
/*
- * linux/include/asm-arm/arch-arc/dma.h
+ * linux/include/asm-arm/arch-arc/dma.h
*
- * Copyright (C) 1996-1998 Russell King
+ * Copyright (C) 1996-1998 Russell King
*
- * Acorn Archimedes/A5000 architecture virtual DMA
- * implementation
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
- * Modifications:
- * 04-04-1998 RMK Merged arc and a5k versions
+ * Acorn Archimedes/A5000 architecture virtual DMA
+ * implementation
+ *
+ * Modifications:
+ * 04-04-1998 RMK Merged arc and a5k versions
*/
#ifndef __ASM_ARCH_DMA_H
#define __ASM_ARCH_DMA_H
diff --git a/include/asm-arm/arch-arc/hardware.h b/include/asm-arm/arch-arc/hardware.h
index 789f4cf6f..a3d942abe 100644
--- a/include/asm-arm/arch-arc/hardware.h
+++ b/include/asm-arm/arch-arc/hardware.h
@@ -1,13 +1,17 @@
/*
- * linux/include/asm-arm/arch-arc/hardware.h
+ * linux/include/asm-arm/arch-arc/hardware.h
*
- * Copyright (C) 1996-1999 Russell King.
+ * Copyright (C) 1996-1999 Russell King.
*
- * This file contains the hardware definitions of the
- * Acorn Archimedes/A5000 machines.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
- * Modifications:
- * 04-04-1998 PJB/RMK Merged arc and a5k versions
+ * This file contains the hardware definitions of the
+ * Acorn Archimedes/A5000 machines.
+ *
+ * Modifications:
+ * 04-04-1998 PJB/RMK Merged arc and a5k versions
*/
#ifndef __ASM_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H
@@ -22,7 +26,7 @@
*/
#define HAS_IOC
#define HAS_MEMC
-#include <asm/memc.h>
+#include <asm/hardware/memc.h>
#define HAS_VIDC
/* Hardware addresses of major areas.
diff --git a/include/asm-arm/arch-arc/ide.h b/include/asm-arm/arch-arc/ide.h
index 3a7c9a968..593de5849 100644
--- a/include/asm-arm/arch-arc/ide.h
+++ b/include/asm-arm/arch-arc/ide.h
@@ -1,15 +1,19 @@
/*
- * linux/include/asm-arm/arch-arc/ide.h
+ * linux/include/asm-arm/arch-arc/ide.h
*
- * Copyright (c) 1997,1998 Russell King
+ * Copyright (C) 1997,1998 Russell King
*
- * IDE definitions for the Acorn Archimedes/A5000
- * architecture
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
- * Modifications:
- * 04-04-1998 PJB Merged `arc' and `a5k' versions
- * 01-07-1998 RMK Added new ide_ioregspec_t
- * 29-07-1998 RMK Major re-work of IDE architecture specific code
+ * IDE definitions for the Acorn Archimedes/A5000
+ * architecture
+ *
+ * Modifications:
+ * 04-04-1998 PJB Merged `arc' and `a5k' versions
+ * 01-07-1998 RMK Added new ide_ioregspec_t
+ * 29-07-1998 RMK Major re-work of IDE architecture specific code
*/
#include <asm/irq.h>
#include <asm/mach-types.h>
diff --git a/include/asm-arm/arch-arc/io.h b/include/asm-arm/arch-arc/io.h
index e42c80b02..22a30f583 100644
--- a/include/asm-arm/arch-arc/io.h
+++ b/include/asm-arm/arch-arc/io.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/arch-arc/io.h
+ * linux/include/asm-arm/arch-arc/io.h
*
- * Copyright (C) 1997 Russell King
+ * Copyright (C) 1997 Russell King
*
- * Modifications:
- * 06-Dec-1997 RMK Created.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Modifications:
+ * 06-Dec-1997 RMK Created.
*/
#ifndef __ASM_ARM_ARCH_IO_H
#define __ASM_ARM_ARCH_IO_H
diff --git a/include/asm-arm/arch-arc/irq.h b/include/asm-arm/arch-arc/irq.h
index 61997a1b2..5e4d417e2 100644
--- a/include/asm-arm/arch-arc/irq.h
+++ b/include/asm-arm/arch-arc/irq.h
@@ -1,9 +1,13 @@
/*
- * include/asm-arm/arch-arc/irq.h
+ * linux/include/asm-arm/arch-arc/irq.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
*
- * Changelog:
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
* 24-09-1996 RMK Created
* 10-10-1996 RMK Brought up to date with arch-sa110eval
* 22-10-1996 RMK Changed interrupt numbers & uses new inb/outb macros
@@ -11,7 +15,7 @@
* 22-08-1998 RMK Restructured IRQ routines
*/
#include <linux/config.h>
-#include <asm/ioc.h>
+#include <asm/hardware/ioc.h>
#ifdef CONFIG_ARCH_ARC
#define a_clf() clf()
@@ -168,5 +172,7 @@ static __inline__ void irq_init_irq(void)
}
}
+ irq_desc[IRQ_KEYBOARDTX].noautoenable = 1;
+
init_FIQ();
}
diff --git a/include/asm-arm/arch-arc/irqs.h b/include/asm-arm/arch-arc/irqs.h
index e4abc83f7..2cb34d39f 100644
--- a/include/asm-arm/arch-arc/irqs.h
+++ b/include/asm-arm/arch-arc/irqs.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/arch-arc/irqs.h
+ * linux/include/asm-arm/arch-arc/irqs.h
*
- * Copyright (C) 1996 Russell King, Dave Gilbert
+ * Copyright (C) 1996 Russell King, Dave Gilbert
*
- * Modifications:
- * 04-04-1998 PJB Merged arc and a5k versions
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Modifications:
+ * 04-04-1998 PJB Merged arc and a5k versions
*/
#include <linux/config.h>
diff --git a/include/asm-arm/arch-arc/keyboard.h b/include/asm-arm/arch-arc/keyboard.h
index 1f57b9757..250c2f549 100644
--- a/include/asm-arm/arch-arc/keyboard.h
+++ b/include/asm-arm/arch-arc/keyboard.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/arch-arc/keyboard.h
+ * linux/include/asm-arm/arch-arc/keyboard.h
*
- * Keyboard driver definitions for Acorn Archimedes/A5000
- * architecture
+ * Copyright (C) 1998 Russell King
*
- * Copyright (C) 1998 Russell King
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Keyboard driver definitions for Acorn Archimedes/A5000
+ * architecture
*/
#include <asm/irq.h>
diff --git a/include/asm-arm/arch-arc/memory.h b/include/asm-arm/arch-arc/memory.h
index 903e48d72..fb4d819f4 100644
--- a/include/asm-arm/arch-arc/memory.h
+++ b/include/asm-arm/arch-arc/memory.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/arch-arc/memory.h
+ * linux/include/asm-arm/arch-arc/memory.h
*
- * Copyright (c) 1996-1999 Russell King.
+ * Copyright (C) 1996-1999 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
* Changelog:
* 22-Nov-1996 RMK Created
diff --git a/include/asm-arm/arch-arc/oldlatches.h b/include/asm-arm/arch-arc/oldlatches.h
index 847d3a0ba..bc87089b2 100644
--- a/include/asm-arm/arch-arc/oldlatches.h
+++ b/include/asm-arm/arch-arc/oldlatches.h
@@ -1,12 +1,14 @@
/*
- * linux/include/asm-arm/arch-arc/oldlatches.h
+ * linux/include/asm-arm/arch-arc/oldlatches.h
*
- * Copyright (C) 1996 Russell King, Dave Gilbert
+ * Copyright (C) 1996 Russell King, Dave Gilbert
*
- * Dummy oldlatches.h
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
- * Modifications:
- * 04-04-1998 PJB/RMK Merged arc and a5k versions
+ * Modifications:
+ * 04-04-1998 PJB/RMK Merged arc and a5k versions
*/
#ifndef _ASM_ARCH_OLDLATCH_H
#define _ASM_ARCH_OLDLATCH_H
diff --git a/include/asm-arm/arch-arc/processor.h b/include/asm-arm/arch-arc/processor.h
index 564565c46..7eea170e3 100644
--- a/include/asm-arm/arch-arc/processor.h
+++ b/include/asm-arm/arch-arc/processor.h
@@ -1,11 +1,15 @@
/*
- * linux/include/asm-arm/arch-arc/processor.h
+ * linux/include/asm-arm/arch-arc/processor.h
*
- * Copyright (c) 1996-1999 Russell King.
+ * Copyright (c) 1996-1999 Russell King.
*
- * Changelog:
- * 10-Sep-1996 RMK Created
- * 21-Mar-1999 RMK Added asm/arch/memory.h
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 10-Sep-1996 RMK Created
+ * 21-Mar-1999 RMK Added asm/arch/memory.h
*/
#ifndef __ASM_ARCH_PROCESSOR_H
diff --git a/include/asm-arm/arch-arc/serial.h b/include/asm-arm/arch-arc/serial.h
index 16d5bd73b..46f6f3828 100644
--- a/include/asm-arm/arch-arc/serial.h
+++ b/include/asm-arm/arch-arc/serial.h
@@ -1,11 +1,15 @@
/*
- * linux/include/asm-arm/arch-arc/serial.h
+ * linux/include/asm-arm/arch-arc/serial.h
*
- * Copyright (c) 1996 Russell King.
+ * Copyright (C) 1996 Russell King.
*
- * Changelog:
- * 15-10-1996 RMK Created
- * 04-04-1998 PJB Merged `arc' and `a5k' architectures
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 15-10-1996 RMK Created
+ * 04-04-1998 PJB Merged `arc' and `a5k' architectures
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
diff --git a/include/asm-arm/arch-arc/system.h b/include/asm-arm/arch-arc/system.h
index 0caf739d6..162889621 100644
--- a/include/asm-arm/arch-arc/system.h
+++ b/include/asm-arm/arch-arc/system.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/arch-arc/system.h
+ * linux/include/asm-arm/arch-arc/system.h
*
- * Copyright (c) 1996-1999 Russell King and Dave Gilbert
+ * Copyright (C) 1996-1999 Russell King and Dave Gilbert
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
static void arch_idle(void)
diff --git a/include/asm-arm/arch-arc/time.h b/include/asm-arm/arch-arc/time.h
index 95c8ae14f..52add5ae3 100644
--- a/include/asm-arm/arch-arc/time.h
+++ b/include/asm-arm/arch-arc/time.h
@@ -1,12 +1,16 @@
/*
- * linux/include/asm-arm/arch-arc/time.h
+ * linux/include/asm-arm/arch-arc/time.h
*
- * Copyright (c) 1996-2000 Russell King.
+ * Copyright (C) 1996-2000 Russell King.
*
- * Changelog:
- * 24-Sep-1996 RMK Created
- * 10-Oct-1996 RMK Brought up to date with arch-sa110eval
- * 04-Dec-1997 RMK Updated for new arch/arm/time.c
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 24-Sep-1996 RMK Created
+ * 10-Oct-1996 RMK Brought up to date with arch-sa110eval
+ * 04-Dec-1997 RMK Updated for new arch/arm/time.c
*/
extern void ioctime_init(void);
diff --git a/include/asm-arm/arch-arc/timex.h b/include/asm-arm/arch-arc/timex.h
index 569e01bb2..58a76ffef 100644
--- a/include/asm-arm/arch-arc/timex.h
+++ b/include/asm-arm/arch-arc/timex.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/arch-arc/timex.h
+ * linux/include/asm-arm/arch-arc/timex.h
*
- * Acorn Archimedes/A5000 architecture timex specifications
+ * Copyright (C) 1997, 1998 Russell King
*
- * Copyright (C) 1997, 1998 Russell King
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Acorn Archimedes/A5000 architecture timex specifications
*/
/*
diff --git a/include/asm-arm/arch-arc/uncompress.h b/include/asm-arm/arch-arc/uncompress.h
index d9b46f1af..df2cba816 100644
--- a/include/asm-arm/arch-arc/uncompress.h
+++ b/include/asm-arm/arch-arc/uncompress.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/arch-arc/uncompress.h
+ * linux/include/asm-arm/arch-arc/uncompress.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#define VIDMEM ((char *)0x02000000)
diff --git a/include/asm-arm/arch-cl7500/hardware.h b/include/asm-arm/arch-cl7500/hardware.h
index 938389b20..b0a61c939 100644
--- a/include/asm-arm/arch-cl7500/hardware.h
+++ b/include/asm-arm/arch-cl7500/hardware.h
@@ -11,7 +11,7 @@
#define __ASM_ARCH_HARDWARE_H
#include <asm/arch/memory.h>
-#include <asm/iomd.h>
+#include <asm/hardware/iomd.h>
/*
* What hardware must be present
diff --git a/include/asm-arm/arch-cl7500/irq.h b/include/asm-arm/arch-cl7500/irq.h
index 3621c08f7..89cac299a 100644
--- a/include/asm-arm/arch-cl7500/irq.h
+++ b/include/asm-arm/arch-cl7500/irq.h
@@ -9,7 +9,7 @@
* 22-08-1998 RMK Restructured IRQ routines
* 11-08-1999 PJB Created ARM7500 version, derived from RiscPC code
*/
-#include <asm/iomd.h>
+#include <asm/hardware/iomd.h>
static inline int fixup_irq(unsigned int irq)
{
diff --git a/include/asm-arm/arch-cl7500/system.h b/include/asm-arm/arch-cl7500/system.h
index 1962f75e0..f84adffc5 100644
--- a/include/asm-arm/arch-cl7500/system.h
+++ b/include/asm-arm/arch-cl7500/system.h
@@ -6,7 +6,7 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
-#include <asm/iomd.h>
+#include <asm/hardware/iomd.h>
static void arch_idle(void)
{
diff --git a/include/asm-arm/arch-ebsa110/dma.h b/include/asm-arm/arch-ebsa110/dma.h
index ae841827a..d491776ac 100644
--- a/include/asm-arm/arch-ebsa110/dma.h
+++ b/include/asm-arm/arch-ebsa110/dma.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/arch-ebsa110/dma.h
+ * linux/include/asm-arm/arch-ebsa110/dma.h
*
- * Architecture DMA routes
+ * Copyright (C) 1997,1998 Russell King
*
- * Copyright (C) 1997,1998 Russell King
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * EBSA110 DMA definitions
*/
#ifndef __ASM_ARCH_DMA_H
#define __ASM_ARCH_DMA_H
diff --git a/include/asm-arm/arch-ebsa110/hardware.h b/include/asm-arm/arch-ebsa110/hardware.h
index 18ee0f968..3dcd8c6f4 100644
--- a/include/asm-arm/arch-ebsa110/hardware.h
+++ b/include/asm-arm/arch-ebsa110/hardware.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/arch-ebsa110/hardware.h
+ * linux/include/asm-arm/arch-ebsa110/hardware.h
*
- * Copyright (C) 1996-2000 Russell King.
+ * Copyright (C) 1996-2000 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
* This file contains the hardware definitions of the EBSA-110.
*/
diff --git a/include/asm-arm/arch-ebsa110/io.h b/include/asm-arm/arch-ebsa110/io.h
index bca7df287..73172dcd7 100644
--- a/include/asm-arm/arch-ebsa110/io.h
+++ b/include/asm-arm/arch-ebsa110/io.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/arch-ebsa110/io.h
+ * linux/include/asm-arm/arch-ebsa110/io.h
*
- * Copyright (C) 1997,1998 Russell King
+ * Copyright (C) 1997,1998 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
* Modifications:
* 06-Dec-1997 RMK Created.
diff --git a/include/asm-arm/arch-ebsa110/irq.h b/include/asm-arm/arch-ebsa110/irq.h
index d26e93c76..a24754e0b 100644
--- a/include/asm-arm/arch-ebsa110/irq.h
+++ b/include/asm-arm/arch-ebsa110/irq.h
@@ -1,9 +1,13 @@
/*
- * include/asm-arm/arch-ebsa110/irq.h
+ * linux/include/asm-arm/arch-ebsa110/irq.h
*
- * Copyright (C) 1996-1998 Russell King
+ * Copyright (C) 1996-1998 Russell King
*
- * Changelog:
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
* 22-08-1998 RMK Restructured IRQ routines
*/
diff --git a/include/asm-arm/arch-ebsa110/irqs.h b/include/asm-arm/arch-ebsa110/irqs.h
index 0add03e59..ded9bd9d7 100644
--- a/include/asm-arm/arch-ebsa110/irqs.h
+++ b/include/asm-arm/arch-ebsa110/irqs.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/arch-ebsa110/irqs.h
+ * linux/include/asm-arm/arch-ebsa110/irqs.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#define NR_IRQS 8
diff --git a/include/asm-arm/arch-ebsa110/memory.h b/include/asm-arm/arch-ebsa110/memory.h
index 36f899faa..96d7e3354 100644
--- a/include/asm-arm/arch-ebsa110/memory.h
+++ b/include/asm-arm/arch-ebsa110/memory.h
@@ -1,13 +1,17 @@
/*
- * linux/include/asm-arm/arch-ebsa110/memory.h
+ * linux/include/asm-arm/arch-ebsa110/memory.h
*
- * Copyright (c) 1996-1999 Russell King.
+ * Copyright (C) 1996-1999 Russell King.
*
- * Changelog:
- * 20-Oct-1996 RMK Created
- * 31-Dec-1997 RMK Fixed definitions to reduce warnings
- * 21-Mar-1999 RMK Renamed to memory.h
- * RMK Moved TASK_SIZE and PAGE_OFFSET here
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 20-Oct-1996 RMK Created
+ * 31-Dec-1997 RMK Fixed definitions to reduce warnings
+ * 21-Mar-1999 RMK Renamed to memory.h
+ * RMK Moved TASK_SIZE and PAGE_OFFSET here
*/
#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H
diff --git a/include/asm-arm/arch-ebsa110/processor.h b/include/asm-arm/arch-ebsa110/processor.h
index d94e9b808..1c0561018 100644
--- a/include/asm-arm/arch-ebsa110/processor.h
+++ b/include/asm-arm/arch-ebsa110/processor.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/arch-ebsa110/processor.h
+ * linux/include/asm-arm/arch-ebsa110/processor.h
*
- * Copyright (C) 1996-1999 Russell King
+ * Copyright (C) 1996-1999 Russell King
*
- * Changelog:
- * 21-Mar-1999 RMK Added asm/arch/memory.h
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 21-Mar-1999 RMK Added asm/arch/memory.h
*/
#ifndef __ASM_ARCH_PROCESSOR_H
diff --git a/include/asm-arm/arch-ebsa110/serial.h b/include/asm-arm/arch-ebsa110/serial.h
index d2133c6d1..a861317e5 100644
--- a/include/asm-arm/arch-ebsa110/serial.h
+++ b/include/asm-arm/arch-ebsa110/serial.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/arch-ebsa110/serial.h
+ * linux/include/asm-arm/arch-ebsa110/serial.h
*
- * Copyright (c) 1996,1997,1998 Russell King.
+ * Copyright (C) 1996,1997,1998 Russell King.
*
- * Changelog:
- * 15-10-1996 RMK Created
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 15-10-1996 RMK Created
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
diff --git a/include/asm-arm/arch-ebsa110/system.h b/include/asm-arm/arch-ebsa110/system.h
index 76bd8c2e3..c4af29bef 100644
--- a/include/asm-arm/arch-ebsa110/system.h
+++ b/include/asm-arm/arch-ebsa110/system.h
@@ -1,14 +1,25 @@
/*
- * linux/include/asm-arm/arch-ebsa110/system.h
+ * linux/include/asm-arm/arch-ebsa110/system.h
*
- * Copyright (c) 1996-1999 Russell King.
+ * Copyright (C) 1996-2000 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
/*
- * This machine must never stop it MCLK. However, if we are
- * idle for a long time, slow the processor clock to MCLK.
+ * EBSA110 idling methodology:
+ *
+ * We can not execute the "wait for interrupt" instruction since that
+ * will stop our MCLK signal (which provides the clock for the glue
+ * logic, and therefore the timer interrupt).
+ *
+ * Instead, we spin, waiting for either hlt_counter or need_resched
+ * to be set. If we have been spinning for 2cs, then we drop the
+ * core clock down to the memory clock.
*/
static void arch_idle(void)
{
@@ -19,7 +30,7 @@ static void arch_idle(void)
do {
if (current->need_resched || hlt_counter)
goto slow_out;
- } while (time_before(start_idle, jiffies + HZ/3));
+ } while (time_before(jiffies, start_idle + HZ/50));
cpu_do_idle(IDLE_CLOCK_SLOW);
diff --git a/include/asm-arm/arch-ebsa110/time.h b/include/asm-arm/arch-ebsa110/time.h
index dbddeb1b9..fb3d9cbbe 100644
--- a/include/asm-arm/arch-ebsa110/time.h
+++ b/include/asm-arm/arch-ebsa110/time.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/arch-ebsa110/time.h
+ * linux/include/asm-arm/arch-ebsa110/time.h
*
- * Copyright (c) 1996,1997,1998 Russell King.
+ * Copyright (C) 1996,1997,1998 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
* No real time clock on the evalulation board!
*
@@ -46,6 +50,7 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
#endif
do_leds();
do_timer(regs);
+ do_profile(regs);
}
/*
diff --git a/include/asm-arm/arch-ebsa110/timex.h b/include/asm-arm/arch-ebsa110/timex.h
index 06acb9dfc..6cdd6b5de 100644
--- a/include/asm-arm/arch-ebsa110/timex.h
+++ b/include/asm-arm/arch-ebsa110/timex.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/arch-ebsa110/timex.h
+ * linux/include/asm-arm/arch-ebsa110/timex.h
*
- * EBSA110 architecture timex specifications
+ * Copyright (C) 1997, 1998 Russell King
*
- * Copyright (C) 1997, 1998 Russell King
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * EBSA110 architecture timex specifications
*/
/*
diff --git a/include/asm-arm/arch-ebsa110/uncompress.h b/include/asm-arm/arch-ebsa110/uncompress.h
index d6097d43f..47633b626 100644
--- a/include/asm-arm/arch-ebsa110/uncompress.h
+++ b/include/asm-arm/arch-ebsa110/uncompress.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/arch-ebsa110/uncompress.h
+ * linux/include/asm-arm/arch-ebsa110/uncompress.h
*
- * Copyright (C) 1996,1997,1998 Russell King
+ * Copyright (C) 1996,1997,1998 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
/*
diff --git a/include/asm-arm/arch-ebsa110/vmalloc.h b/include/asm-arm/arch-ebsa110/vmalloc.h
index d9d09f03c..78c71c2db 100644
--- a/include/asm-arm/arch-ebsa110/vmalloc.h
+++ b/include/asm-arm/arch-ebsa110/vmalloc.h
@@ -1,5 +1,11 @@
/*
- * linux/include/asm-arm/arch-ebsa110/vmalloc.h
+ * linux/include/asm-arm/arch-ebsa110/vmalloc.h
+ *
+ * Copyright (C) 1998 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
/*
diff --git a/include/asm-arm/arch-ebsa285/dma.h b/include/asm-arm/arch-ebsa285/dma.h
index 8b74a7f84..c43046eb8 100644
--- a/include/asm-arm/arch-ebsa285/dma.h
+++ b/include/asm-arm/arch-ebsa285/dma.h
@@ -1,10 +1,10 @@
/*
- * linux/include/asm-arm/arch-ebsa285/dma.h
+ * linux/include/asm-arm/arch-ebsa285/dma.h
*
- * Architecture DMA routines
+ * Architecture DMA routines
*
- * Copyright (C) 1998,1999 Russell King
- * Copyright (C) 1998,1999 Philip Blundell
+ * Copyright (C) 1998,1999 Russell King
+ * Copyright (C) 1998,1999 Philip Blundell
*/
#ifndef __ASM_ARCH_DMA_H
#define __ASM_ARCH_DMA_H
diff --git a/include/asm-arm/arch-ebsa285/hardware.h b/include/asm-arm/arch-ebsa285/hardware.h
index ae5817d9e..44747379c 100644
--- a/include/asm-arm/arch-ebsa285/hardware.h
+++ b/include/asm-arm/arch-ebsa285/hardware.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/arch-ebsa285/hardware.h
+ * linux/include/asm-arm/arch-ebsa285/hardware.h
*
- * Copyright (C) 1998-1999 Russell King.
+ * Copyright (C) 1998-1999 Russell King.
*
- * This file contains the hardware definitions of the EBSA-285.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This file contains the hardware definitions of the EBSA-285.
*/
#ifndef __ASM_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H
@@ -15,20 +19,13 @@
/* Virtual Physical Size
* 0xff800000 0x40000000 1MB X-Bus
* 0xff000000 0x7c000000 1MB PCI I/O space
- *
* 0xfe000000 0x42000000 1MB CSR
* 0xfd000000 0x78000000 1MB Outbound write flush (not supported)
* 0xfc000000 0x79000000 1MB PCI IACK/special space
- *
* 0xfb000000 0x7a000000 16MB PCI Config type 1
* 0xfa000000 0x7b000000 16MB PCI Config type 0
- *
* 0xf9000000 0x50000000 1MB Cache flush
- * 0xf8000000 0x41000000 16MB Flash memory
- *
- * 0xe1000000 unmapped (to catch bad ISA/PCI)
- *
- * 0xe0000000 0x80000000 16MB ISA memory
+ * 0xf0000000 0x80000000 16MB ISA memory
*/
#define XBUS_SIZE 0x00100000
#define XBUS_BASE 0xff800000
@@ -54,9 +51,6 @@
#define FLUSH_SIZE 0x00100000
#define FLUSH_BASE 0xf9000000
-#define FLASH_SIZE 0x01000000
-#define FLASH_BASE 0xf8000000
-
#define PCIMEM_SIZE 0x01000000
#define PCIMEM_BASE 0xf0000000
@@ -67,9 +61,6 @@
#define PCIMEM_SIZE 0x80000000
#define PCIMEM_BASE 0x80000000
-#define FLASH_SIZE 0x01000000
-#define FLASH_BASE 0x7f000000
-
#define FLUSH_SIZE 0x00100000
#define FLUSH_BASE 0x7e000000
diff --git a/include/asm-arm/arch-ebsa285/ide.h b/include/asm-arm/arch-ebsa285/ide.h
index dbdeb1fab..ddc2bcbde 100644
--- a/include/asm-arm/arch-ebsa285/ide.h
+++ b/include/asm-arm/arch-ebsa285/ide.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/arch-ebsa285/ide.h
+ * linux/include/asm-arm/arch-ebsa285/ide.h
*
- * Copyright (c) 1998 Russell King
+ * Copyright (C) 1998 Russell King
*
- * Modifications:
- * 29-07-1998 RMK Major re-work of IDE architecture specific code
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Modifications:
+ * 29-07-1998 RMK Major re-work of IDE architecture specific code
*/
#include <asm/irq.h>
diff --git a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h
index 8f24298b2..e06ed893a 100644
--- a/include/asm-arm/arch-ebsa285/io.h
+++ b/include/asm-arm/arch-ebsa285/io.h
@@ -1,11 +1,15 @@
/*
- * linux/include/asm-arm/arch-ebsa285/io.h
+ * linux/include/asm-arm/arch-ebsa285/io.h
*
- * Copyright (C) 1997-1999 Russell King
+ * Copyright (C) 1997-1999 Russell King
*
- * Modifications:
- * 06-12-1997 RMK Created.
- * 07-04-1999 RMK Major cleanup
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Modifications:
+ * 06-12-1997 RMK Created.
+ * 07-04-1999 RMK Major cleanup
*/
#ifndef __ASM_ARM_ARCH_IO_H
#define __ASM_ARM_ARCH_IO_H
@@ -74,7 +78,7 @@ extern __inline__ void __arch_putw(unsigned int value, unsigned long a)
#define outw(v,p) __arch_putw(v,__io_pci(p))
#define outl(v,p) __arch_putl(v,__io_pci(p))
-#include <asm/dec21285.h>
+#include <asm/hardware/dec21285.h>
/*
* ioremap support - validate a PCI memory address,
diff --git a/include/asm-arm/arch-ebsa285/irq.h b/include/asm-arm/arch-ebsa285/irq.h
index 791c00fae..34b8287f8 100644
--- a/include/asm-arm/arch-ebsa285/irq.h
+++ b/include/asm-arm/arch-ebsa285/irq.h
@@ -1,17 +1,21 @@
/*
- * include/asm-arm/arch-ebsa285/irq.h
+ * linux/include/asm-arm/arch-ebsa285/irq.h
*
- * Copyright (C) 1996-1998 Russell King
+ * Copyright (C) 1996-1998 Russell King
*
- * Changelog:
- * 22-Aug-1998 RMK Restructured IRQ routines
- * 03-Sep-1998 PJB Merged CATS support
- * 20-Jan-1998 RMK Started merge of EBSA286, CATS and NetWinder
- * 26-Jan-1999 PJB Don't use IACK on CATS
- * 16-Mar-1999 RMK Added autodetect of ISA PICs
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 22-Aug-1998 RMK Restructured IRQ routines
+ * 03-Sep-1998 PJB Merged CATS support
+ * 20-Jan-1998 RMK Started merge of EBSA286, CATS and NetWinder
+ * 26-Jan-1999 PJB Don't use IACK on CATS
+ * 16-Mar-1999 RMK Added autodetect of ISA PICs
*/
#include <asm/hardware.h>
-#include <asm/dec21285.h>
+#include <asm/hardware/dec21285.h>
#include <asm/irq.h>
#include <asm/mach-types.h>
diff --git a/include/asm-arm/arch-ebsa285/memory.h b/include/asm-arm/arch-ebsa285/memory.h
index d9859cb76..98172671f 100644
--- a/include/asm-arm/arch-ebsa285/memory.h
+++ b/include/asm-arm/arch-ebsa285/memory.h
@@ -1,14 +1,18 @@
/*
- * linux/include/asm-arm/arch-ebsa285/memory.h
+ * linux/include/asm-arm/arch-ebsa285/memory.h
*
- * Copyright (c) 1996-1999 Russell King.
+ * Copyright (C) 1996-1999 Russell King.
*
- * Changelog:
- * 20-Oct-1996 RMK Created
- * 31-Dec-1997 RMK Fixed definitions to reduce warnings.
- * 17-May-1998 DAG Added __virt_to_bus and __bus_to_virt functions.
- * 21-Nov-1998 RMK Changed __virt_to_bus and __bus_to_virt to macros.
- * 21-Mar-1999 RMK Added PAGE_OFFSET for co285 architecture.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 20-Oct-1996 RMK Created
+ * 31-Dec-1997 RMK Fixed definitions to reduce warnings.
+ * 17-May-1998 DAG Added __virt_to_bus and __bus_to_virt functions.
+ * 21-Nov-1998 RMK Changed __virt_to_bus and __bus_to_virt to macros.
+ * 21-Mar-1999 RMK Added PAGE_OFFSET for co285 architecture.
* Renamed to memory.h
* Moved PAGE_OFFSET and TASK_SIZE here
*/
diff --git a/include/asm-arm/arch-ebsa285/processor.h b/include/asm-arm/arch-ebsa285/processor.h
index d94e9b808..1c0561018 100644
--- a/include/asm-arm/arch-ebsa285/processor.h
+++ b/include/asm-arm/arch-ebsa285/processor.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/arch-ebsa110/processor.h
+ * linux/include/asm-arm/arch-ebsa110/processor.h
*
- * Copyright (C) 1996-1999 Russell King
+ * Copyright (C) 1996-1999 Russell King
*
- * Changelog:
- * 21-Mar-1999 RMK Added asm/arch/memory.h
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 21-Mar-1999 RMK Added asm/arch/memory.h
*/
#ifndef __ASM_ARCH_PROCESSOR_H
diff --git a/include/asm-arm/arch-ebsa285/serial.h b/include/asm-arm/arch-ebsa285/serial.h
index 0efc4c849..3bba8f9cc 100644
--- a/include/asm-arm/arch-ebsa285/serial.h
+++ b/include/asm-arm/arch-ebsa285/serial.h
@@ -1,11 +1,15 @@
/*
- * linux/include/asm-arm/arch-ebsa285/serial.h
+ * linux/include/asm-arm/arch-ebsa285/serial.h
*
- * Copyright (c) 1996,1997,1998 Russell King.
+ * Copyright (C) 1996,1997,1998 Russell King.
*
- * Changelog:
- * 15-10-1996 RMK Created
- * 25-05-1998 PJB CATS support
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 15-10-1996 RMK Created
+ * 25-05-1998 PJB CATS support
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
diff --git a/include/asm-arm/arch-ebsa285/system.h b/include/asm-arm/arch-ebsa285/system.h
index dbbaf9444..a0644771c 100644
--- a/include/asm-arm/arch-ebsa285/system.h
+++ b/include/asm-arm/arch-ebsa285/system.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/arch-ebsa285/system.h
+ * linux/include/asm-arm/arch-ebsa285/system.h
*
- * Copyright (c) 1996-1999 Russell King.
+ * Copyright (C) 1996-1999 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
-#include <asm/dec21285.h>
+#include <asm/hardware/dec21285.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include <asm/leds.h>
@@ -19,7 +23,7 @@ static void arch_idle(void)
if (current->need_resched || hlt_counter)
goto slow_out;
cpu_do_idle(IDLE_WAIT_FAST);
- } while (time_before(start_idle, jiffies + HZ/3));
+ } while (time_before(jiffies, start_idle + HZ/50));
cpu_do_idle(IDLE_CLOCK_SLOW);
diff --git a/include/asm-arm/arch-ebsa285/time.h b/include/asm-arm/arch-ebsa285/time.h
index 2ae77bcb1..d42f472c1 100644
--- a/include/asm-arm/arch-ebsa285/time.h
+++ b/include/asm-arm/arch-ebsa285/time.h
@@ -1,8 +1,8 @@
/*
- * linux/include/asm-arm/arch-ebsa285/time.h
+ * linux/include/asm-arm/arch-ebsa285/time.h
*
- * Copyright (c) 1998 Russell King.
- * Copyright (c) 1998 Phil Blundell
+ * Copyright (C) 1998 Russell King.
+ * Copyright (C) 1998 Phil Blundell
*
* CATS has a real-time clock, though the evaluation board doesn't.
*
@@ -19,7 +19,7 @@
#include <linux/mc146818rtc.h>
-#include <asm/dec21285.h>
+#include <asm/hardware/dec21285.h>
#include <asm/leds.h>
#include <asm/mach-types.h>
diff --git a/include/asm-arm/arch-ebsa285/timex.h b/include/asm-arm/arch-ebsa285/timex.h
index f269d439b..39a73cdf9 100644
--- a/include/asm-arm/arch-ebsa285/timex.h
+++ b/include/asm-arm/arch-ebsa285/timex.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/arch-ebsa285/timex.h
+ * linux/include/asm-arm/arch-ebsa285/timex.h
*
- * EBSA285 architecture timex specifications
+ * Copyright (C) 1998 Russell King
*
- * Copyright (C) 1998 Russell King
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * EBSA285 architecture timex specifications
*/
/*
diff --git a/include/asm-arm/arch-ebsa285/uncompress.h b/include/asm-arm/arch-ebsa285/uncompress.h
index ab103585c..351cc7b2c 100644
--- a/include/asm-arm/arch-ebsa285/uncompress.h
+++ b/include/asm-arm/arch-ebsa285/uncompress.h
@@ -1,8 +1,13 @@
/*
- * linux/include/asm-arm/arch-ebsa285/uncompress.h
+ * linux/include/asm-arm/arch-ebsa285/uncompress.h
*
- * Copyright (C) 1996-1999 Russell King
+ * Copyright (C) 1996-1999 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
+#include <asm/mach-types.h>
/*
* Note! This could cause problems on the NetWinder
diff --git a/include/asm-arm/arch-ebsa285/vmalloc.h b/include/asm-arm/arch-ebsa285/vmalloc.h
index 63dbeb9af..823c6d794 100644
--- a/include/asm-arm/arch-ebsa285/vmalloc.h
+++ b/include/asm-arm/arch-ebsa285/vmalloc.h
@@ -1,5 +1,9 @@
/*
- * linux/include/asm-arm/arch-ebsa285/vmalloc.h
+ * linux/include/asm-arm/arch-ebsa285/vmalloc.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
/*
diff --git a/include/asm-arm/arch-nexuspci/dma.h b/include/asm-arm/arch-nexuspci/dma.h
index 585fbe53b..dee1ea217 100644
--- a/include/asm-arm/arch-nexuspci/dma.h
+++ b/include/asm-arm/arch-nexuspci/dma.h
@@ -7,6 +7,13 @@
*/
/*
+ * 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 the maximum DMA address that can be DMAd to.
*/
#define MAX_DMA_ADDRESS 0xffffffff
diff --git a/include/asm-arm/arch-nexuspci/hardware.h b/include/asm-arm/arch-nexuspci/hardware.h
index 364edd010..303dc2c97 100644
--- a/include/asm-arm/arch-nexuspci/hardware.h
+++ b/include/asm-arm/arch-nexuspci/hardware.h
@@ -5,6 +5,14 @@
*
* This file contains the hardware definitions of the FTV PCI card.
*/
+
+/*
+ * 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.
+ */
+
#ifndef __ASM_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H
@@ -63,4 +71,6 @@
#define INTCONT_LED 0x1a
#define INTCONT_PCI_RESET 0x1c
+#define UNCACHEABLE_ADDR STATUS_BASE
+
#endif
diff --git a/include/asm-arm/arch-nexuspci/irq.h b/include/asm-arm/arch-nexuspci/irq.h
index 501a97c87..292ed47b8 100644
--- a/include/asm-arm/arch-nexuspci/irq.h
+++ b/include/asm-arm/arch-nexuspci/irq.h
@@ -4,6 +4,13 @@
* Copyright (C) 1998, 1999, 2000 Philip Blundell
*/
+/*
+ * 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.
+ */
+
#include <asm/io.h>
#define fixup_irq(x) (x)
diff --git a/include/asm-arm/arch-nexuspci/irqs.h b/include/asm-arm/arch-nexuspci/irqs.h
index fdc88f1d5..954149a7c 100644
--- a/include/asm-arm/arch-nexuspci/irqs.h
+++ b/include/asm-arm/arch-nexuspci/irqs.h
@@ -4,9 +4,18 @@
* Copyright (C) 1997, 1998, 2000 Philip Blundell
*/
-/* The hardware is capable of routing any interrupt source (except the
- DUART) to either IRQ or FIQ. We ignore FIQ and use IRQ exclusively
- for simplicity. */
+/*
+ * 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.
+ */
+
+/*
+ * The hardware is capable of routing any interrupt source (except the
+ * DUART) to either IRQ or FIQ. We ignore FIQ and use IRQ exclusively
+ * for simplicity.
+ */
#define IRQ_DUART 0
#define IRQ_PLX 1
diff --git a/include/asm-arm/arch-nexuspci/system.h b/include/asm-arm/arch-nexuspci/system.h
index cf083f496..028788bdc 100644
--- a/include/asm-arm/arch-nexuspci/system.h
+++ b/include/asm-arm/arch-nexuspci/system.h
@@ -3,6 +3,14 @@
*
* Copyright (c) 1996, 97, 98, 99, 2000 FutureTV Labs Ltd.
*/
+
+/*
+ * 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.
+ */
+
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
diff --git a/include/asm-arm/arch-nexuspci/time.h b/include/asm-arm/arch-nexuspci/time.h
index b1ff948a1..7bb4322f6 100644
--- a/include/asm-arm/arch-nexuspci/time.h
+++ b/include/asm-arm/arch-nexuspci/time.h
@@ -7,6 +7,13 @@
* SCC chip.
*/
+/*
+ * 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.
+ */
+
static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
static int count = 25;
@@ -46,6 +53,7 @@ extern __inline__ void setup_timer(void)
__raw_writeb(0x10, DUART_BASE + 0x14);
timer_irq.handler = timer_interrupt;
+ timer_irq.flags = SA_SHIRQ;
setup_arm_irq(IRQ_TIMER, &timer_irq);
}
diff --git a/include/asm-arm/arch-nexuspci/uncompress.h b/include/asm-arm/arch-nexuspci/uncompress.h
index e03ea93b3..dd697a924 100644
--- a/include/asm-arm/arch-nexuspci/uncompress.h
+++ b/include/asm-arm/arch-nexuspci/uncompress.h
@@ -4,6 +4,13 @@
* Copyright (C) 1998, 1999, 2000 Philip Blundell
*/
+/*
+ * 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.
+ */
+
#include <asm/hardware.h>
#include <asm/io.h>
@@ -22,8 +29,11 @@ void _ll_write_char(char c)
*/
static void puts(const char *s)
{
- while (*s)
+ while (*s) {
+ if (*s == '\n')
+ _ll_write_char('\r');
_ll_write_char(*(s++));
+ }
}
/*
diff --git a/include/asm-arm/arch-rpc/acornfb.h b/include/asm-arm/arch-rpc/acornfb.h
index 531481215..6c7696e67 100644
--- a/include/asm-arm/arch-rpc/acornfb.h
+++ b/include/asm-arm/arch-rpc/acornfb.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/arch-rpc/acornfb.h
+ * linux/include/asm-arm/arch-rpc/acornfb.h
*
- * (C) 1999 Russell King
+ * Copyright (C) 1999 Russell King
*
- * AcornFB architecture specific code
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * AcornFB architecture specific code
*/
#define acornfb_valid_pixrate(rate) (1)
diff --git a/include/asm-arm/arch-rpc/dma.h b/include/asm-arm/arch-rpc/dma.h
index b52f5b110..d24a27e30 100644
--- a/include/asm-arm/arch-rpc/dma.h
+++ b/include/asm-arm/arch-rpc/dma.h
@@ -1,5 +1,11 @@
/*
- * linux/include/asm-arm/arch-rpc/dma.h
+ * linux/include/asm-arm/arch-rpc/dma.h
+ *
+ * Copyright (C) 1997 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_ARCH_DMA_H
#define __ASM_ARCH_DMA_H
diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h
index ce1a27b13..b13b4efbe 100644
--- a/include/asm-arm/arch-rpc/hardware.h
+++ b/include/asm-arm/arch-rpc/hardware.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/arch-rpc/hardware.h
+ * linux/include/asm-arm/arch-rpc/hardware.h
*
- * Copyright (C) 1996-1999 Russell King.
+ * Copyright (C) 1996-1999 Russell King.
*
- * This file contains the hardware definitions of the RiscPC series machines.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This file contains the hardware definitions of the RiscPC series machines.
*/
#ifndef __ASM_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H
diff --git a/include/asm-arm/arch-rpc/ide.h b/include/asm-arm/arch-rpc/ide.h
index 827d81c2b..15fecab1f 100644
--- a/include/asm-arm/arch-rpc/ide.h
+++ b/include/asm-arm/arch-rpc/ide.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/arch-rpc/ide.h
+ * linux/include/asm-arm/arch-rpc/ide.h
*
- * Copyright (c) 1997 Russell King
+ * Copyright (C) 1997 Russell King
*
- * Modifications:
- * 29-07-1998 RMK Major re-work of IDE architecture specific code
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Modifications:
+ * 29-07-1998 RMK Major re-work of IDE architecture specific code
*/
#include <asm/irq.h>
diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h
index 508560bda..81f201aae 100644
--- a/include/asm-arm/arch-rpc/io.h
+++ b/include/asm-arm/arch-rpc/io.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/arch-rpc/io.h
+ * linux/include/asm-arm/arch-rpc/io.h
*
- * Copyright (C) 1997 Russell King
+ * Copyright (C) 1997 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
* Modifications:
* 06-Dec-1997 RMK Created.
diff --git a/include/asm-arm/arch-rpc/irq.h b/include/asm-arm/arch-rpc/irq.h
index c7d98b0c0..48aece366 100644
--- a/include/asm-arm/arch-rpc/irq.h
+++ b/include/asm-arm/arch-rpc/irq.h
@@ -1,13 +1,17 @@
/*
- * include/asm-arm/arch-rpc/irq.h
+ * linux/include/asm-arm/arch-rpc/irq.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
*
- * Changelog:
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
* 10-10-1996 RMK Brought up to date with arch-sa110eval
* 22-08-1998 RMK Restructured IRQ routines
*/
-#include <asm/iomd.h>
+#include <asm/hardware/iomd.h>
#define fixup_irq(x) (x)
@@ -152,21 +156,22 @@ static __inline__ void irq_init_irq(void)
irq_desc[irq].unmask = rpc_unmask_irq_b;
break;
- case 16 ... 22:
+ case 16 ... 21:
irq_desc[irq].valid = 1;
+ irq_desc[irq].noautoenable = 1;
irq_desc[irq].mask_ack = rpc_mask_irq_dma;
irq_desc[irq].mask = rpc_mask_irq_dma;
irq_desc[irq].unmask = rpc_unmask_irq_dma;
break;
- case 32 ... 40:
+ case 32 ... 39:
irq_desc[irq].valid = 1;
irq_desc[irq].mask_ack = ecard_disableirq;
irq_desc[irq].mask = ecard_disableirq;
irq_desc[irq].unmask = ecard_enableirq;
break;
- case 64 ... 72:
+ case 64 ... 71:
irq_desc[irq].valid = 1;
irq_desc[irq].mask_ack = rpc_mask_irq_fiq;
irq_desc[irq].mask = rpc_mask_irq_fiq;
@@ -175,5 +180,7 @@ static __inline__ void irq_init_irq(void)
}
}
+ irq_desc[IRQ_KEYBOARDTX].noautoenable = 1;
+
init_FIQ();
}
diff --git a/include/asm-arm/arch-rpc/irqs.h b/include/asm-arm/arch-rpc/irqs.h
index 948ba961d..72ee47185 100644
--- a/include/asm-arm/arch-rpc/irqs.h
+++ b/include/asm-arm/arch-rpc/irqs.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/arch-rpc/irqs.h
+ * linux/include/asm-arm/arch-rpc/irqs.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#define IRQ_PRINTER 0
diff --git a/include/asm-arm/arch-rpc/keyboard.h b/include/asm-arm/arch-rpc/keyboard.h
index c083b08bb..0e9566812 100644
--- a/include/asm-arm/arch-rpc/keyboard.h
+++ b/include/asm-arm/arch-rpc/keyboard.h
@@ -1,11 +1,14 @@
/*
- * linux/include/asm-arm/arch-rpc/keyboard.h
+ * linux/include/asm-arm/arch-rpc/keyboard.h
*
- * Keyboard driver definitions for RiscPC architecture
+ * Copyright (C) 1998 Russell King
*
- * (C) 1998 Russell King
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Keyboard driver definitions for RiscPC architecture
*/
-
#include <asm/irq.h>
#define NR_SCANCODES 128
diff --git a/include/asm-arm/arch-rpc/memory.h b/include/asm-arm/arch-rpc/memory.h
index e5f59abdb..2b3899173 100644
--- a/include/asm-arm/arch-rpc/memory.h
+++ b/include/asm-arm/arch-rpc/memory.h
@@ -1,15 +1,19 @@
/*
- * linux/include/asm-arm/arch-rpc/memory.h
+ * linux/include/asm-arm/arch-rpc/memory.h
*
- * Copyright (c) 1996,1997,1998 Russell King.
+ * Copyright (C) 1996,1997,1998 Russell King.
*
- * Changelog:
- * 20-Oct-1996 RMK Created
- * 31-Dec-1997 RMK Fixed definitions to reduce warnings
- * 11-Jan-1998 RMK Uninlined to reduce hits on cache
- * 08-Feb-1998 RMK Added __virt_to_bus and __bus_to_virt
- * 21-Mar-1999 RMK Renamed to memory.h
- * RMK Added TASK_SIZE and PAGE_OFFSET
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 20-Oct-1996 RMK Created
+ * 31-Dec-1997 RMK Fixed definitions to reduce warnings
+ * 11-Jan-1998 RMK Uninlined to reduce hits on cache
+ * 08-Feb-1998 RMK Added __virt_to_bus and __bus_to_virt
+ * 21-Mar-1999 RMK Renamed to memory.h
+ * RMK Added TASK_SIZE and PAGE_OFFSET
*/
#ifndef __ASM_ARCH_MMU_H
#define __ASM_ARCH_MMU_H
diff --git a/include/asm-arm/arch-rpc/processor.h b/include/asm-arm/arch-rpc/processor.h
index fd9aa088d..b64eaebfc 100644
--- a/include/asm-arm/arch-rpc/processor.h
+++ b/include/asm-arm/arch-rpc/processor.h
@@ -1,11 +1,15 @@
/*
- * linux/include/asm-arm/arch-rpc/processor.h
+ * linux/include/asm-arm/arch-rpc/processor.h
*
- * Copyright (c) 1996-1999 Russell King.
+ * Copyright (C) 1996-1999 Russell King.
*
- * Changelog:
- * 10-Sep-1996 RMK Created
- * 21-Mar-1999 RMK Added asm/arch/memory.h
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 10-Sep-1996 RMK Created
+ * 21-Mar-1999 RMK Added asm/arch/memory.h
*/
#ifndef __ASM_ARCH_PROCESSOR_H
diff --git a/include/asm-arm/arch-rpc/serial.h b/include/asm-arm/arch-rpc/serial.h
index 87e81c609..1497fc6fe 100644
--- a/include/asm-arm/arch-rpc/serial.h
+++ b/include/asm-arm/arch-rpc/serial.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/arch-rpc/serial.h
+ * linux/include/asm-arm/arch-rpc/serial.h
*
- * Copyright (c) 1996 Russell King.
+ * Copyright (C) 1996 Russell King.
*
- * Changelog:
- * 15-10-1996 RMK Created
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 15-10-1996 RMK Created
*/
#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H
diff --git a/include/asm-arm/arch-rpc/system.h b/include/asm-arm/arch-rpc/system.h
index 885e43de3..2e8711ec5 100644
--- a/include/asm-arm/arch-rpc/system.h
+++ b/include/asm-arm/arch-rpc/system.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/arch-rpc/system.h
+ * linux/include/asm-arm/arch-rpc/system.h
*
- * Copyright (c) 1996-1999 Russell King.
+ * Copyright (C) 1996-1999 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#include <asm/arch/hardware.h>
-#include <asm/iomd.h>
+#include <asm/hardware/iomd.h>
#include <asm/io.h>
static void arch_idle(void)
@@ -17,7 +21,7 @@ static void arch_idle(void)
if (current->need_resched || hlt_counter)
goto slow_out;
cpu_do_idle(IDLE_WAIT_FAST);
- } while (time_before(start_idle, jiffies + HZ/3));
+ } while (time_before(jiffies, start_idle + HZ/50));
cpu_do_idle(IDLE_CLOCK_SLOW);
diff --git a/include/asm-arm/arch-rpc/time.h b/include/asm-arm/arch-rpc/time.h
index 94974241f..334de6235 100644
--- a/include/asm-arm/arch-rpc/time.h
+++ b/include/asm-arm/arch-rpc/time.h
@@ -1,12 +1,16 @@
/*
- * linux/include/asm-arm/arch-rpc/time.h
+ * linux/include/asm-arm/arch-rpc/time.h
*
- * Copyright (c) 1996-2000 Russell King.
+ * Copyright (C) 1996-2000 Russell King.
*
- * Changelog:
- * 24-Sep-1996 RMK Created
- * 10-Oct-1996 RMK Brought up to date with arch-sa110eval
- * 04-Dec-1997 RMK Updated for new arch/arm/time.c
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 24-Sep-1996 RMK Created
+ * 10-Oct-1996 RMK Brought up to date with arch-sa110eval
+ * 04-Dec-1997 RMK Updated for new arch/arm/time.c
*/
extern void ioctime_init(void);
diff --git a/include/asm-arm/arch-rpc/timex.h b/include/asm-arm/arch-rpc/timex.h
index cb3c72abe..ed7df64d9 100644
--- a/include/asm-arm/arch-rpc/timex.h
+++ b/include/asm-arm/arch-rpc/timex.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/arch-rpc/timex.h
+ * linux/include/asm-arm/arch-rpc/timex.h
*
- * RiscPC architecture timex specifications
+ * Copyright (C) 1997, 1998 Russell King
*
- * Copyright (C) 1997, 1998 Russell King
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * RiscPC architecture timex specifications
*/
/*
diff --git a/include/asm-arm/arch-rpc/uncompress.h b/include/asm-arm/arch-rpc/uncompress.h
index 21701094a..0834d287e 100644
--- a/include/asm-arm/arch-rpc/uncompress.h
+++ b/include/asm-arm/arch-rpc/uncompress.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/arch-a5k/uncompress.h
+ * linux/include/asm-arm/arch-rpc/uncompress.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#define VIDMEM ((char *)SCREEN_START)
diff --git a/include/asm-arm/arch-rpc/vmalloc.h b/include/asm-arm/arch-rpc/vmalloc.h
index 60f72ec84..579bd1190 100644
--- a/include/asm-arm/arch-rpc/vmalloc.h
+++ b/include/asm-arm/arch-rpc/vmalloc.h
@@ -1,5 +1,11 @@
/*
- * linux/include/asm-arm/arch-rpc/vmalloc.h
+ * linux/include/asm-arm/arch-rpc/vmalloc.h
+ *
+ * Copyright (C) 1997 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
/*
diff --git a/include/asm-arm/arch-sa1100/SA-1100.h b/include/asm-arm/arch-sa1100/SA-1100.h
index d528c3d2e..236e880c9 100644
--- a/include/asm-arm/arch-sa1100/SA-1100.h
+++ b/include/asm-arm/arch-sa1100/SA-1100.h
@@ -2417,8 +2417,8 @@ typedef PCMCIAPrtType PCMCIAType [PCMCIASp/PCMCIAPrtSp] ;
(0xF << FShft (DDAR_DS))
#define DDAR_DA Fld (24, 8) /* Device Address */
#define DDAR_DevAdd(Add) /* Device Address */ \
- ((Add) & 0xF0000000 | \
- ((Add) & 0X003FFFFC) << (FShft (DDAR_DA) - 2))
+ (((Add) & 0xF0000000) | \
+ (((Add) & 0X003FFFFC) << (FShft (DDAR_DA) - 2)))
#define DDAR_Ser0UDCWr /* Ser. port 0 UDC Write */ \
(DDAR_DevWr + DDAR_Brst8 + DDAR_8BitDev + \
DDAR_Ser0UDCTr + DDAR_DevAdd (_Ser0UDCDR))
diff --git a/include/asm-arm/arch-sa1100/assabet.h b/include/asm-arm/arch-sa1100/assabet.h
index 75bd395a5..b40b2cf1e 100644
--- a/include/asm-arm/arch-sa1100/assabet.h
+++ b/include/asm-arm/arch-sa1100/assabet.h
@@ -28,7 +28,7 @@
/* Board Control Register */
-#define BCR_BASE 0xdc000000
+#define BCR_BASE 0xf1000000
#define BCR (*(volatile unsigned int *)(BCR_BASE))
#define BCR_DB1110 (0x00A07410)
@@ -105,8 +105,8 @@ extern unsigned long BCR_value;
#define NEPONSET_USAR_IRQ MISC_IRQ1
#define NEPONSET_CPLD_BASE (0x10000000)
-#define Nep_p2v( x ) ((x) - NEPONSET_CPLD_BASE + 0xd4000000)
-#define Nep_v2p( x ) ((x) - 0xd4000000 + NEPONSET_CPLD_BASE)
+#define Nep_p2v( x ) ((x) - NEPONSET_CPLD_BASE + 0xf0000000)
+#define Nep_v2p( x ) ((x) - 0xf0000000 + NEPONSET_CPLD_BASE)
#define _IRR 0x10000024 /* Interrupt Reason Register */
#define _AUD_CTL 0x100000c0 /* Audio controls (RW) */
diff --git a/include/asm-arm/arch-sa1100/bitsy.h b/include/asm-arm/arch-sa1100/bitsy.h
index 42c178f58..69f467132 100644
--- a/include/asm-arm/arch-sa1100/bitsy.h
+++ b/include/asm-arm/arch-sa1100/bitsy.h
@@ -38,6 +38,7 @@
#define EGPIO_BITSY_LVDD_ON (1 << 15) /* enable 9V and -6.5V to LCD. */
#ifndef __ASSEMBLY__
+#define BITSY_EGPIO (*(volatile int *)0xf0000000)
extern void clr_bitsy_egpio(unsigned long x);
extern void set_bitsy_egpio(unsigned long x);
#endif
diff --git a/include/asm-arm/arch-sa1100/cerf.h b/include/asm-arm/arch-sa1100/cerf.h
index 95d58a17b..5aad7afea 100644
--- a/include/asm-arm/arch-sa1100/cerf.h
+++ b/include/asm-arm/arch-sa1100/cerf.h
@@ -12,5 +12,8 @@
#define IRQ_GPIO_CF_BVD2 IRQ_GPIO19
#define IRQ_GPIO_CF_BVD1 IRQ_GPIO20
+#define GPIO_UCB1200_IRQ GPIO_GPIO (18)
+#define IRQ_GPIO_UCB1200_IRQ IRQ_GPIO18
+
#endif
diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h
index a4a1b5884..e60c4ec68 100644
--- a/include/asm-arm/arch-sa1100/hardware.h
+++ b/include/asm-arm/arch-sa1100/hardware.h
@@ -13,17 +13,28 @@
#define __ASM_ARCH_HARDWARE_H
#include <linux/config.h>
+#include <asm/mach-types.h>
+
/* Flushing areas */
#define FLUSH_BASE_PHYS 0xe0000000 /* SA1100 zero bank */
-#define FLUSH_BASE 0xdf000000
-#define FLUSH_BASE_MINICACHE 0xdf800000
+#define FLUSH_BASE 0xf5000000
+#define FLUSH_BASE_MINICACHE 0xf5800000
#define UNCACHEABLE_ADDR 0xfa050000
/*
- * We requires absolute addresses i.e. (0xe00000 + 0x3f8) for in*()/out*()
- * macros to be useful for all cases.
+ * Those are statically mapped PCMCIA IO space for designs using it as a
+ * generic IO bus, typically with ISA parts, hardwired IDE interfaces, etc.
+ * The actual PCMCIA code is mapping required IO region at run time.
+ */
+#define PCMCIA_IO_0_BASE 0xf6000000
+#define PCMCIA_IO_1_BASE 0xf7000000
+
+
+/*
+ * We requires absolute addresses i.e. (PCMCIA_IO_0_BASE + 0x3f8) for
+ * in*()/out*() macros to be usable for all cases.
*/
#define PCIO_BASE 0
@@ -37,8 +48,6 @@
* 90000000 fa000000
* a0000000 fc000000
* b0000000 fe000000
- *
- * Nb: PCMCIA is mapped from 0xe0000000 to f7ffffff in mm-sa1100.c
*/
#define VIO_BASE 0xf8000000 /* virtual start of IO space */
@@ -89,20 +98,24 @@ extern void set_GPIO_IRQ_edge( int gpio_mask, int edge_mask );
#include "bitsy.h"
#endif
-#if defined(CONFIG_SA1100_GRAPHICSCLIENT) || defined(CONFIG_SA1100_THINCLIENT)
+#if defined(CONFIG_SA1100_THINCLIENT)
#include "thinclient.h"
#endif
+#if defined(CONFIG_SA1100_GRAPHICSCLIENT)
+#include "graphicsclient.h"
+#endif
+
#ifdef CONFIG_SA1101
/*
* We have mapped the sa1101 depending on the value of SA1101_BASE.
- * It then appears from 0xdc000000.
+ * It then appears from 0xf4000000.
*/
-#define SA1101_p2v( x ) ((x) - SA1101_BASE + 0xdc000000)
-#define SA1101_v2p( x ) ((x) - 0xdc000000 + SA1101_BASE)
+#define SA1101_p2v( x ) ((x) - SA1101_BASE + 0xf4000000)
+#define SA1101_v2p( x ) ((x) - 0xf4000000 + SA1101_BASE)
#include "SA-1101.h"
@@ -111,8 +124,8 @@ extern void set_GPIO_IRQ_edge( int gpio_mask, int edge_mask );
#ifdef CONFIG_SA1111
-#define SA1111_p2v( x ) ((x) - SA1111_BASE + 0xd8000000)
-#define SA1111_v2p( x ) ((x) - 0xd8000000 + SA1111_BASE)
+#define SA1111_p2v( x ) ((x) - SA1111_BASE + 0xf4000000)
+#define SA1111_v2p( x ) ((x) - 0xf4000000 + SA1111_BASE)
#include "SA-1111.h"
diff --git a/include/asm-arm/arch-sa1100/ide.h b/include/asm-arm/arch-sa1100/ide.h
index ac2190140..22aae0157 100644
--- a/include/asm-arm/arch-sa1100/ide.h
+++ b/include/asm-arm/arch-sa1100/ide.h
@@ -3,14 +3,22 @@
*
* Copyright (c) 1998 Hugo Fiennes & Nicolas Pitre
*
+ * 18-aug-2000: Cleanup by Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
+ * Get rid of the special ide_init_hwif_ports() functions
+ * and make a generalised function that can be used by all
+ * architectures.
*/
#include <linux/config.h>
-
#include <asm/irq.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
+
+#define PCMCIA_IO_0_BASE 0xe0000000
+#define PCMCIA_IO_1_BASE 0xe4000000
+
+
/*
* Set up a hw structure for a specified data port, control port and IRQ.
* This should follow whatever the default interface uses.
@@ -20,47 +28,33 @@ ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int *irq)
{
ide_ioreg_t reg;
int i;
- int ioshift = 0;
-
+ int regincr = 1;
+
/* The Empeg board has the first two address lines unused */
if (machine_is_empeg())
- ioshift = 2;
-
+ regincr = 1 << 2;
+
+ /* The LART doesn't use A0 for IDE */
+ if (machine_is_lart())
+ regincr = 1 << 1;
+
memset(hw, 0, sizeof(*hw));
- reg = (ide_ioreg_t) (data_port << ioshift);
+ reg = (ide_ioreg_t)data_port;
+
for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
hw->io_ports[i] = reg;
- reg += (1 << ioshift);
+ reg += regincr;
}
- hw->io_ports[IDE_CONTROL_OFFSET] =
- (ide_ioreg_t) (ctrl_port << ioshift);
+ hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
if (irq)
*irq = 0;
}
-/*
- * Special case for the empeg board which has the first two
- * address lines unused
- */
-static __inline__ void
-empeg_ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port)
-{
- ide_ioreg_t reg;
- int i;
- memset(hw, 0, sizeof(*hw));
- reg = (ide_ioreg_t) (0xe0000000 + (data_port << 2));
- for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
- hw->io_ports[i] = reg;
- reg += (1 << 2);
- }
- hw->io_ports[IDE_CONTROL_OFFSET] =
- (ide_ioreg_t) (0xe0000000 + (ctrl_port << 2));
-}
/*
* This registers the standard ports for this architecture with the IDE
@@ -92,10 +86,10 @@ ide_init_default_hwifs(void)
/* MAC 23/4/1999, swap these round so that the left hand
hard disk is hda when viewed from the front. This
doesn't match the silkscreen however. */
- empeg_ide_init_hwif_ports(&hw,0x10,0x1e);
+ ide_init_hwif_ports(&hw, PCMCIA_IO_0_BASE + 0x40, PCMCIA_IO_0_BASE + 0x78, NULL);
hw.irq = EMPEG_IRQ_IDE2;
ide_register_hw(&hw, NULL);
- empeg_ide_init_hwif_ports(&hw,0x00,0x0e);
+ ide_init_hwif_ports(&hw, PCMCIA_IO_0_BASE + 0x00, PCMCIA_IO_0_BASE + 0x38, NULL);
hw.irq = ,EMPEG_IRQ_IDE1;
ide_register_hw(&hw, NULL);
#endif
@@ -112,7 +106,7 @@ ide_init_default_hwifs(void)
/* set the pcmcia interface timing */
MECR = 0x00060006;
- ide_init_hwif_ports(&hw, 0xe00001f0, 0xe00003f6, NULL);
+ ide_init_hwif_ports(&hw, PCMCIA_IO_0_BASE + 0x1f0, PCMCIA_IO_0_BASE + 0x3f6, NULL);
hw.irq = IRQ_GPIO7;
ide_register_hw(&hw, NULL);
#endif
@@ -129,8 +123,7 @@ ide_init_default_hwifs(void)
MECR = 0x00060006;
/* init the interface */
-/* ide_init_hwif_ports(&hw, 0xe00000000, 0xe00001000, NULL); */
- ide_init_hwif_ports(&hw, 0xe00001000, 0xe00000000, NULL);
+ ide_init_hwif_ports(&hw, PCMCIA_IO_0_BASE + 0x0000, PCMCIA_IO_0_BASE + 0x1000, NULL);
hw.irq = IRQ_GPIO1;
ide_register_hw(&hw, NULL);
#endif
diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h
index 4c2126208..28c4015c5 100644
--- a/include/asm-arm/arch-sa1100/memory.h
+++ b/include/asm-arm/arch-sa1100/memory.h
@@ -24,22 +24,22 @@
*/
#define PHYS_OFFSET (0xc0000000UL)
-
-#define __virt_to_phys__is_a_macro
-#define __phys_to_virt__is_a_macro
-
/*
- * The following gives a maximum memory size of 128MB (32MB in each bank).
+ * We take advantage of the fact that physical and virtual address can be the
+ * same. The NUMA code is handling the large holes that might exist between
+ * all memory banks.
*/
-#define __virt_to_phys(x) (((x) & 0xf9ffffff) | ((x) & 0x06000000) << 2)
-#define __phys_to_virt(x) (((x) & 0xe7ffffff) | ((x) & 0x18000000) >> 2)
+#define __virt_to_phys__is_a_macro
+#define __phys_to_virt__is_a_macro
+#define __virt_to_phys(x) (x)
+#define __phys_to_virt(x) (x)
/*
* Virtual view <-> DMA view memory address translations
* virt_to_bus: Used to translate the virtual address to an
- * address suitable to be passed to set_dma_addr
+ * address suitable to be passed to set_dma_addr
* bus_to_virt: Used to convert an address for DMA operations
- * to an address that the kernel can use.
+ * to an address that the kernel can use.
*
* On the SA1100, bus addresses are equivalent to physical addresses.
*/
diff --git a/include/asm-arm/arch-sa1100/mmzone.h b/include/asm-arm/arch-sa1100/mmzone.h
index c721a1d55..09e90be62 100644
--- a/include/asm-arm/arch-sa1100/mmzone.h
+++ b/include/asm-arm/arch-sa1100/mmzone.h
@@ -11,6 +11,14 @@
*
* Of course, all this isn't mandatory for SA1100 implementations with only
* one used memory bank. For those, simply undefine CONFIG_DISCONTIGMEM.
+ *
+ * The nodes are matched with the physical memory bank addresses which are
+ * incidentally the same as virtual addresses.
+ *
+ * node 0: 0xc0000000 - 0xc7ffffff
+ * node 1: 0xc8000000 - 0xcfffffff
+ * node 2: 0xd0000000 - 0xd7ffffff
+ * node 3: 0xd8000000 - 0xdfffffff
*/
@@ -20,18 +28,6 @@
extern pg_data_t sa1100_node_data[];
/*
- * 32MB max in each bank, must fit with __virt_to_phys() & __phys_to_virt()
- */
-#define NODE_MAX_MEM_SHIFT 25
-#define NODE_MAX_MEM_SIZE (1<<NODE_MAX_MEM_SHIFT)
-
-/*
- * Given a kernel address, find the home node of the underlying memory.
- */
-#define KVADDR_TO_NID(addr) \
- (((unsigned long)(addr) - PAGE_OFFSET) >> NODE_MAX_MEM_SHIFT)
-
-/*
* Return a pointer to the node data for node n.
*/
#define NODE_DATA(nid) (&sa1100_node_data[nid])
@@ -42,11 +38,10 @@ extern pg_data_t sa1100_node_data[];
#define NODE_MEM_MAP(nid) (NODE_DATA(nid)->node_mem_map)
/*
- * Given a mem_map_t, LOCAL_MAP_BASE finds the owning node for the
- * physical page and returns the kaddr for the mem_map of that node.
+ * Given a kernel address, find the home node of the underlying memory.
*/
-#define LOCAL_MAP_BASE(page) \
- NODE_MEM_MAP(KVADDR_TO_NID((unsigned long)(page)))
+#define KVADDR_TO_NID(addr) \
+ (((unsigned long)(addr) & 0x18000000) >> 27)
/*
* Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
@@ -56,28 +51,22 @@ extern pg_data_t sa1100_node_data[];
NODE_MEM_MAP(KVADDR_TO_NID((unsigned long)(kaddr)))
/*
- * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory
- * and returns the kaddr corresponding to first physical page in the
- * node's mem_map.
- */
-#define LOCAL_BASE_ADDR(kaddr) ((unsigned long)(kaddr) & ~(NODE_MAX_MEM_SIZE-1))
-
-/*
* Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
* and returns the index corresponding to the appropriate page in the
* node's mem_map.
*/
#define LOCAL_MAP_NR(kvaddr) \
- (((unsigned long)(kvaddr)-LOCAL_BASE_ADDR((kvaddr))) >> PAGE_SHIFT)
+ (((unsigned long)(kvaddr) & 0x07ffffff) >> PAGE_SHIFT)
-/*
- * With discontigmem, the conceptual mem_map array starts from PAGE_OFFSET.
- * Given a kaddr, MAP_NR returns the appropriate global mem_map index so
- * it matches the corresponding node's local mem_map.
+/*
+ * Given a kaddr, virt_to_page returns a pointer to the corresponding
+ * mem_map entry.
+ */
+#define virt_to_page(kaddr) \
+ (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
+
+/*
+ * Didn't find the best way to validate a page pointer yet...
*/
-#define MAP_NR(kaddr) (LOCAL_MAP_NR((kaddr)) + \
- (((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \
- sizeof(mem_map_t)))
-#define virt_to_page(kaddr) (mem_map + MAP_NR(kaddr))
-#define VALID_PAGE(page) ((page - mem_map) < max_mapnr)
+#define VALID_PAGE(page) (1)
diff --git a/include/asm-arm/arch-sa1100/system.h b/include/asm-arm/arch-sa1100/system.h
index 5f0febaaa..ca8e6330a 100644
--- a/include/asm-arm/arch-sa1100/system.h
+++ b/include/asm-arm/arch-sa1100/system.h
@@ -5,13 +5,10 @@
*/
#include <linux/config.h>
-static void arch_idle(void)
+static inline void arch_idle(void)
{
- while (!current->need_resched && !hlt_counter) {
- cpu_do_idle(IDLE_CLOCK_SLOW);
- cpu_do_idle(IDLE_WAIT_FAST);
- cpu_do_idle(IDLE_CLOCK_FAST);
- }
+ while (!current->need_resched && !hlt_counter)
+ cpu_do_idle(0);
}
#ifdef CONFIG_SA1100_VICTOR
diff --git a/include/asm-arm/arch-sa1100/thinclient.h b/include/asm-arm/arch-sa1100/thinclient.h
index 4c1846779..830152117 100644
--- a/include/asm-arm/arch-sa1100/thinclient.h
+++ b/include/asm-arm/arch-sa1100/thinclient.h
@@ -13,8 +13,8 @@
#define ADS_CPLD_BASE (0x10000000)
-#define ADS_p2v( x ) ((x) - ADS_CPLD_BASE + 0xdc000000)
-#define ADS_v2p( x ) ((x) - 0xdc000000 + ADS_CPLD_BASE)
+#define ADS_p2v( x ) ((x) - ADS_CPLD_BASE + 0xf0000000)
+#define ADS_v2p( x ) ((x) - 0xf0000000 + ADS_CPLD_BASE)
/* Parallel Port */
diff --git a/include/asm-arm/arch-sa1100/vmalloc.h b/include/asm-arm/arch-sa1100/vmalloc.h
index 42affe414..82c5ce9b6 100644
--- a/include/asm-arm/arch-sa1100/vmalloc.h
+++ b/include/asm-arm/arch-sa1100/vmalloc.h
@@ -13,4 +13,4 @@
#define VMALLOC_OFFSET (8*1024*1024)
#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
#define VMALLOC_VMADDR(x) ((unsigned long)(x))
-#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
+#define VMALLOC_END (0xe8000000)
diff --git a/include/asm-arm/arch-shark/hardware.h b/include/asm-arm/arch-shark/hardware.h
index fc38d57aa..3e000fd50 100644
--- a/include/asm-arm/arch-shark/hardware.h
+++ b/include/asm-arm/arch-shark/hardware.h
@@ -20,7 +20,7 @@
/*
* RAM definitions
*/
-#define FLUSH_BASE_PHYS 0x60000000
+#define FLUSH_BASE_PHYS 0x80000000
#else
@@ -28,22 +28,26 @@
#endif
-#define IO_SIZE 0x10000000
+#define IO_SIZE 0x08000000
#define IO_START 0x40000000
+#define ROMCARD_SIZE 0x08000000
+#define ROMCARD_START 0x10000000
#define FLUSH_BASE 0xdf000000
#define PCIO_BASE 0xe0000000
/* defines for the Framebuffer */
-#define FB_BASE 0xd0000000
#define FB_START 0x06000000
-#define FB_SIZE 0x00200000
/* Registers for Framebuffer */
-#define FBREG_BASE (FB_BASE + FB_SIZE)
-#define FBREG_START 0x06800000
-#define FBREG_SIZE 0x000c0000
+/*#define FBREG_START 0x06800000*/
+
+#define UNCACHEABLE_ADDR 0xdf010000
+
+#define SEQUOIA_LED_GREEN (1<<6)
+#define SEQUOIA_LED_AMBER (1<<5)
+#define SEQUOIA_LED_BACK (1<<7)
#endif
diff --git a/include/asm-arm/arch-shark/io.h b/include/asm-arm/arch-shark/io.h
index ff0def03a..ef14f7169 100644
--- a/include/asm-arm/arch-shark/io.h
+++ b/include/asm-arm/arch-shark/io.h
@@ -11,6 +11,8 @@
#ifndef __ASM_ARM_ARCH_IO_H
#define __ASM_ARM_ARCH_IO_H
+#define __arch_ioremap(off,size,nocache) __ioremap(off,size,0)
+
#define IO_SPACE_LIMIT 0xffffffff
/*
diff --git a/include/asm-arm/arch-shark/keyboard.h b/include/asm-arm/arch-shark/keyboard.h
index dcb47641e..821be3e47 100644
--- a/include/asm-arm/arch-shark/keyboard.h
+++ b/include/asm-arm/arch-shark/keyboard.h
@@ -1,8 +1,8 @@
/*
- * linux/include/asm-arm/arch-ebsa285/keyboard.h
- *
- * Keyboard driver definitions for EBSA285 architecture
- *
+ * linux/include/asm-arm/arch-shark/keyboard.h
+ * by Alexander.Schulz@stud.uni-karlsruhe.de
+ *
+ * Derived from linux/include/asm-arm/arch-ebsa285/keyboard.h
* (C) 1998 Russell King
* (C) 1998 Phil Blundell
*/
@@ -24,45 +24,12 @@ extern unsigned char pckbd_sysrq_xlate[128];
#define NR_SCANCODES 128
-#define kbd_setkeycode(sc,kc) \
- ({ \
- int __ret; \
- if (have_isa_bridge) \
- __ret = pckbd_setkeycode(sc,kc);\
- else \
- __ret = -EINVAL; \
- __ret; \
- })
-
-#define kbd_getkeycode(sc) \
- ({ \
- int __ret; \
- if (have_isa_bridge) \
- __ret = pckbd_getkeycode(sc); \
- else \
- __ret = -EINVAL; \
- __ret; \
- })
-
-#define kbd_translate(sc, kcp, rm) \
- ({ \
- pckbd_translate(sc, kcp, rm); \
- })
-
+#define kbd_setkeycode(sc,kc) pckbd_setkeycode(sc,kc)
+#define kbd_getkeycode(sc) pckbd_getkeycode(sc)
+#define kbd_translate(sc, kcp, rm) pckbd_translate(sc, kcp, rm)
#define kbd_unexpected_up pckbd_unexpected_up
-
-#define kbd_leds(leds) \
- do { \
- if (have_isa_bridge) \
- pckbd_leds(leds); \
- } while (0)
-
-#define kbd_init_hw() \
- do { \
- if (have_isa_bridge) \
- pckbd_init_hw(); \
- } while (0)
-
+#define kbd_leds(leds) pckbd_leds(leds)
+#define kbd_init_hw() pckbd_init_hw()
#define kbd_sysrq_xlate pckbd_sysrq_xlate
#define kbd_disable_irq()
diff --git a/include/asm-arm/arch-shark/system.h b/include/asm-arm/arch-shark/system.h
index cefb21609..97989e50e 100644
--- a/include/asm-arm/arch-shark/system.h
+++ b/include/asm-arm/arch-shark/system.h
@@ -6,12 +6,19 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
+#include <asm/io.h>
+
static void arch_reset(char mode)
{
- /*
- * loop endlessly
- */
+ short temp;
cli();
+ /* Reset the Machine via pc[3] of the sequoia chipset */
+ outw(0x09,0x24);
+ temp=inw(0x26);
+ temp = temp | (1<<3) | (1<<10);
+ outw(0x09,0x24);
+ outw(temp,0x26);
+
}
static void arch_idle(void)
diff --git a/include/asm-arm/arch-shark/time.h b/include/asm-arm/arch-shark/time.h
index 5bfc2cf06..c81a535ed 100644
--- a/include/asm-arm/arch-shark/time.h
+++ b/include/asm-arm/arch-shark/time.h
@@ -43,15 +43,6 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
}
-static struct irqaction timerirq = {
- timer_interrupt,
- SA_INTERRUPT,
- 0,
- "timer",
- NULL,
- NULL
-};
-
/*
* Set up timer interrupt, and return the current time in seconds.
*/
@@ -88,5 +79,7 @@ extern __inline__ void setup_timer(void)
xtime.tv_sec = mktime(r_time.tm_year+epoch, r_time.tm_mon+1, r_time.tm_mday,
r_time.tm_hour, r_time.tm_min, r_time.tm_sec);
- setup_arm_irq(IRQ_TIMER, &timerirq);
+ timer_irq.handler = timer_interrupt;
+ timer_irq.flags = SA_INTERRUPT; /* FIXME: really? */
+ setup_arm_irq(IRQ_TIMER, &timer_irq);
}
diff --git a/include/asm-arm/arch-shark/vmalloc.h b/include/asm-arm/arch-shark/vmalloc.h
new file mode 100644
index 000000000..31fe3e777
--- /dev/null
+++ b/include/asm-arm/arch-shark/vmalloc.h
@@ -0,0 +1,17 @@
+/*
+ * linux/include/asm-arm/arch-rpc/vmalloc.h
+ */
+
+/*
+ * Just any arbitrary offset to the start of the vmalloc VM area: the
+ * current 8MB value just means that there will be a 8MB "hole" after the
+ * physical memory until the kernel virtual memory starts. That means that
+ * any out-of-bounds memory accesses will hopefully be caught.
+ * The vmalloc() routines leaves a hole of 4kB between each vmalloced
+ * area for the same reason. ;)
+ */
+#define VMALLOC_OFFSET (8*1024*1024)
+#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
+#define VMALLOC_VMADDR(x) ((unsigned long)(x))
+#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
+
diff --git a/include/asm-arm/arch-tbox/dma.h b/include/asm-arm/arch-tbox/dma.h
new file mode 100644
index 000000000..1d5d39175
--- /dev/null
+++ b/include/asm-arm/arch-tbox/dma.h
@@ -0,0 +1,37 @@
+/*
+ * linux/include/asm-arm/arch-tbox/dma.h
+ *
+ * Architecture DMA routines. We have to contend with the bizarre DMA
+ * machine built into the Tbox hardware.
+ *
+ * Copyright (C) 1998 Philip Blundell
+ */
+
+/*
+ * 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.
+ */
+
+/*
+ * DMA channel definitions. Some of these are physically strange but
+ * we sort it out inside dma.c so the user never has to care. The
+ * exception is the double-buffering which we can't really abstract
+ * away sensibly.
+ */
+#define DMA_VIDEO 0
+#define DMA_MPEG_B 1
+#define DMA_AUDIO_B 2
+#define DMA_ASHRX_B 3
+#define DMA_ASHTX 4
+#define DMA_MPEG 5
+#define DMA_AUDIO 6
+#define DMA_ASHRX 7
+
+#define MAX_DMA_CHANNELS 0 /* XXX */
+
+/*
+ * This is the maximum DMA address that can be DMAd to.
+ */
+#define MAX_DMA_ADDRESS 0xffffffff
diff --git a/include/asm-arm/arch-tbox/hardware.h b/include/asm-arm/arch-tbox/hardware.h
new file mode 100644
index 000000000..9aa3f4508
--- /dev/null
+++ b/include/asm-arm/arch-tbox/hardware.h
@@ -0,0 +1,60 @@
+/*
+ * linux/include/asm-arm/arch-tbox/hardware.h
+ *
+ * Copyright (C) 1998, 1999, 2000 Philip Blundell
+ * Copyright (C) 2000 FutureTV Labs Ltd
+ *
+ * This file contains the hardware definitions of the Tbox
+ */
+
+/*
+ * 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.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+/* Logical Physical
+ * 0xfff00000 0x00100000 I/O
+ * 0xfff00000 0x00100000 Expansion CS0
+ * 0xfff10000 0x00110000 DMA
+ * 0xfff20000 0x00120000 C-Cube
+ * 0xfff30000 0x00130000 FPGA 1
+ * 0xfff40000 0x00140000 UART 2
+ * 0xfff50000 0x00150000 UART 1
+ * 0xfff60000 0x00160000 CS8900
+ * 0xfff70000 0x00170000 INTCONT
+ * 0xfff80000 0x00180000 RAMDAC
+ * 0xfff90000 0x00190000 Control 0
+ * 0xfffa0000 0x001a0000 Control 1
+ * 0xfffb0000 0x001b0000 Control 2
+ * 0xfffc0000 0x001c0000 FPGA 2
+ * 0xfffd0000 0x001d0000 INTRESET
+ * 0xfffe0000 0x001e0000 C-Cube DMA throttle
+ * 0xffff0000 0x001f0000 Expansion CS1
+ * 0xffe00000 0x82000000 cache flush
+ */
+
+/*
+ * Mapping areas
+ */
+#define IO_BASE 0xfff00000
+#define IO_START 0x00100000
+#define FLUSH_BASE 0xffe00000
+
+#define INTCONT 0xfff70000
+
+#define FPGA1CONT 0xffff3000
+
+/*
+ * RAM definitions
+ */
+#define RAM_BASE 0x80000000
+#define FLUSH_BASE_PHYS 0x82000000
+
+#define UNCACHEABLE_ADDR INTCONT
+
+#endif
diff --git a/include/asm-arm/arch-tbox/ide.h b/include/asm-arm/arch-tbox/ide.h
new file mode 100644
index 000000000..d66e67c94
--- /dev/null
+++ b/include/asm-arm/arch-tbox/ide.h
@@ -0,0 +1,3 @@
+/*
+ * linux/include/asm-arm/arch-tbox/ide.h
+ */
diff --git a/include/asm-arm/arch-tbox/io.h b/include/asm-arm/arch-tbox/io.h
new file mode 100644
index 000000000..322941657
--- /dev/null
+++ b/include/asm-arm/arch-tbox/io.h
@@ -0,0 +1,55 @@
+/*
+ * linux/include/asm-arm/arch-tbox/io.h
+ *
+ * Copyright (C) 1996-1999 Russell King
+ * Copyright (C) 1998, 1999 Philip Blundell
+ *
+ */
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+#define __io_pc(_x) ((_x) << 2)
+
+/*
+ * Generic virtual read/write
+ */
+#define __arch_getb(a) (*(volatile unsigned char *)(a))
+#define __arch_getl(a) (*(volatile unsigned long *)(a))
+
+extern __inline__ unsigned int __arch_getw(unsigned long a)
+{
+ unsigned int value;
+ __asm__ __volatile__("ldr%?h %0, [%1, #0] @ getw"
+ : "=&r" (value)
+ : "r" (a));
+ return value;
+}
+
+
+#define __arch_putb(v,a) (*(volatile unsigned char *)(a) = (v))
+#define __arch_putl(v,a) (*(volatile unsigned long *)(a) = (v))
+
+extern __inline__ void __arch_putw(unsigned int value, unsigned long a)
+{
+ __asm__ __volatile__("str%?h %0, [%1, #0] @ putw"
+ : : "r" (value), "r" (a));
+}
+
+#define inb(p) __arch_getb(__io_pc(p))
+#define inw(p) __arch_getw(__io_pc(p))
+#define inl(p) __arch_getl(__io_pc(p))
+
+#define outb(v,p) __arch_putb(v,__io_pc(p))
+#define outw(v,p) __arch_putw(v,__io_pc(p))
+#define outl(v,p) __arch_putl(v,__io_pc(p))
+
+/* Idem, for devices on the upper byte lanes */
+#define inb_u(p) __arch_getb(__io_pc(p) + 2)
+#define inw_u(p) __arch_getw(__io_pc(p) + 2)
+
+#define outb_u(v,p) __arch_putb(v,__io_pc(p) + 2)
+#define outw_u(v,p) __arch_putw(v,__io_pc(p) + 2)
+
+#endif
diff --git a/include/asm-arm/arch-tbox/irq.h b/include/asm-arm/arch-tbox/irq.h
new file mode 100644
index 000000000..3e41df159
--- /dev/null
+++ b/include/asm-arm/arch-tbox/irq.h
@@ -0,0 +1,50 @@
+/*
+ * include/asm-arm/arch-tbox/irq.h
+ *
+ * Copyright (C) 1998, 1999, 2000 Philip Blundell
+ */
+
+/*
+ * 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.
+ */
+
+#include <asm/io.h>
+
+#define fixup_irq(x) (x)
+
+extern unsigned long soft_irq_mask;
+
+static void tbox_mask_irq(unsigned int irq)
+{
+ __raw_writel(0, INTCONT + (irq << 2));
+ soft_irq_mask &= ~(1<<irq);
+}
+
+static void tbox_unmask_irq(unsigned int irq)
+{
+ soft_irq_mask |= (1<<irq);
+ __raw_writel(1, INTCONT + (irq << 2));
+}
+
+static __inline__ void irq_init_irq(void)
+{
+ unsigned int i;
+
+ /* Disable all interrupts initially. */
+ for (i = 0; i < NR_IRQS; i++) {
+ if (i <= 10 || (i >= 12 && i <= 13)) {
+ irq_desc[i].valid = 1;
+ irq_desc[i].probe_ok = 0;
+ irq_desc[i].mask_ack = tbox_mask_irq;
+ irq_desc[i].mask = tbox_mask_irq;
+ irq_desc[i].unmask = tbox_unmask_irq;
+ tbox_mask_irq(i);
+ } else {
+ irq_desc[i].valid = 0;
+ irq_desc[i].probe_ok = 0;
+ }
+ }
+}
diff --git a/include/asm-arm/arch-tbox/irqs.h b/include/asm-arm/arch-tbox/irqs.h
new file mode 100644
index 000000000..0c02ae5f5
--- /dev/null
+++ b/include/asm-arm/arch-tbox/irqs.h
@@ -0,0 +1,29 @@
+/*
+ * linux/include/asm-arm/arch-tbox/irqs.h
+ *
+ * Copyright (C) 1998, 2000 Philip Blundell
+ */
+
+/*
+ * 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.
+ */
+
+#define IRQ_MPEGDMA 0
+#define IRQ_ASHTX 1
+#define IRQ_ASHRX 2
+#define IRQ_VSYNC 3
+#define IRQ_HSYNC 4
+#define IRQ_MPEG 5
+#define IRQ_UART2 6
+#define IRQ_UART1 7
+#define IRQ_ETHERNET 8
+#define IRQ_TIMER 9
+#define IRQ_AUDIODMA 10
+/* bit 11 used for video field ident */
+#define IRQ_EXPMODCS0 12
+#define IRQ_EXPMODCS1 13
+
+#define irq_cannonicalize(i) (i)
diff --git a/include/asm-arm/arch-tbox/keyboard.h b/include/asm-arm/arch-tbox/keyboard.h
new file mode 100644
index 000000000..8fb341c2a
--- /dev/null
+++ b/include/asm-arm/arch-tbox/keyboard.h
@@ -0,0 +1,29 @@
+/*
+ * linux/include/asm-arm/arch-tbox/keyboard.h
+ *
+ * Driver definitions for Tbox dummy keyboard.
+ *
+ * Copyright (C) 1998 Russell King
+ * Copyright (C) 1998 Philip Blundell
+ */
+
+#define NR_SCANCODES 128
+
+#define kbd_setkeycode(sc,kc) (-EINVAL)
+#define kbd_getkeycode(sc) (-EINVAL)
+
+/* Prototype: int kbd_pretranslate(scancode, raw_mode)
+ * Returns : 0 to ignore scancode
+ */
+#define kbd_pretranslate(sc,rm) (1)
+
+/* Prototype: int kbd_translate(scancode, *keycode, *up_flag, raw_mode)
+ * Returns : 0 to ignore scancode, *keycode set to keycode, *up_flag
+ * set to 0200 if scancode indicates release
+ */
+#define kbd_translate(sc, kcp, rm) 0
+#define kbd_unexpected_up(kc) (0200)
+#define kbd_leds(leds) do { } while (0)
+#define kbd_init_hw() do { } while (0)
+#define kbd_disable_irq() do { } while (0)
+#define kbd_enable_irq() do { } while (0)
diff --git a/include/asm-arm/arch-tbox/memory.h b/include/asm-arm/arch-tbox/memory.h
new file mode 100644
index 000000000..e066821f2
--- /dev/null
+++ b/include/asm-arm/arch-tbox/memory.h
@@ -0,0 +1,38 @@
+/*
+ * linux/include/asm-arm/arch-tbox/memory.h
+ *
+ * Copyright (c) 1996-1999 Russell King.
+ * Copyright (c) 1998-1999 Phil Blundell
+ */
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+/*
+ * Task size: 3GB
+ */
+#define TASK_SIZE (0xc0000000UL)
+#define TASK_SIZE_26 (0x04000000UL)
+
+/*
+ * Page offset: 3GB
+ */
+#define PAGE_OFFSET (0xc0000000UL)
+#define PHYS_OFFSET (0x80000000UL)
+
+/*
+ * DRAM is contiguous
+ */
+#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET)
+#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET)
+#define __virt_to_phys__is_a_macro
+#define __phys_to_virt__is_a_macro
+
+/*
+ * Bus view is the same as physical view
+ */
+#define __virt_to_bus__is_a_macro
+#define __virt_to_bus(x) __virt_to_phys(x)
+#define __bus_to_virt__is_a_macro
+#define __bus_to_virt(x) __phys_to_virt(x)
+
+#endif
diff --git a/include/asm-arm/arch-tbox/param.h b/include/asm-arm/arch-tbox/param.h
new file mode 100644
index 000000000..5e9139c0e
--- /dev/null
+++ b/include/asm-arm/arch-tbox/param.h
@@ -0,0 +1 @@
+#define HZ 1000
diff --git a/include/asm-arm/arch-tbox/processor.h b/include/asm-arm/arch-tbox/processor.h
new file mode 100644
index 000000000..0f8e7129b
--- /dev/null
+++ b/include/asm-arm/arch-tbox/processor.h
@@ -0,0 +1,24 @@
+/*
+ * linux/include/asm-arm/arch-tbox/processor.h
+ * from linux/include/asm-arm/arch-ebsa110/processor.h
+ *
+ * Copyright (C) 1996,1997,1998 Russell King
+ */
+
+#ifndef __ASM_ARCH_PROCESSOR_H
+#define __ASM_ARCH_PROCESSOR_H
+
+/*
+ * Bus types
+ */
+#define EISA_bus 0
+#define EISA_bus__is_a_macro /* for versions in ksyms.c */
+#define MCA_bus 0
+#define MCA_bus__is_a_macro /* for versions in ksyms.c */
+
+/* This decides where the kernel will search for a free chunk of vm
+ * space during mmap's.
+ */
+#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
+
+#endif
diff --git a/include/asm-arm/arch-tbox/serial.h b/include/asm-arm/arch-tbox/serial.h
new file mode 100644
index 000000000..abb7ecbeb
--- /dev/null
+++ b/include/asm-arm/arch-tbox/serial.h
@@ -0,0 +1,34 @@
+/*
+ * linux/include/asm-arm/arch-tbox/serial.h
+ *
+ * Copyright (c) 1996 Russell King.
+ * Copyright (c) 1998 Phil Blundell
+ *
+ * Changelog:
+ * 15-10-1996 RMK Created
+ * 09-06-1998 PJB tbox version
+ */
+#ifndef __ASM_ARCH_SERIAL_H
+#define __ASM_ARCH_SERIAL_H
+
+/*
+ * This assumes you have a 1.8432 MHz clock for your UART.
+ *
+ * It'd be nice if someone built a serial card with a 24.576 MHz
+ * clock, since the 16550A is capable of handling a top speed of 1.5
+ * megabits/second; but this requires the faster clock.
+ */
+#define BASE_BAUD (1843200 / 16)
+
+#define RS_TABLE_SIZE 2
+
+#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
+
+ /* UART CLK PORT IRQ FLAGS */
+#define STD_SERIAL_PORT_DEFNS \
+ { 0, BASE_BAUD, 0xffff4000 >> 2, 6, STD_COM_FLAGS }, /* ttyS0 */ \
+ { 0, BASE_BAUD, 0xffff5000 >> 2, 7, STD_COM_FLAGS }, /* ttyS1 */
+
+#define EXTRA_SERIAL_PORT_DEFNS
+
+#endif
diff --git a/include/asm-arm/arch-tbox/system.h b/include/asm-arm/arch-tbox/system.h
new file mode 100644
index 000000000..e52bb50fd
--- /dev/null
+++ b/include/asm-arm/arch-tbox/system.h
@@ -0,0 +1,33 @@
+/*
+ * linux/include/asm-arm/arch-tbox/system.h
+ *
+ * Copyright (c) 1996-1999 Russell King.
+ */
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H
+
+static void arch_idle(void)
+{
+ unsigned long start_idle;
+
+ start_idle = jiffies;
+
+ do {
+ if (current->need_resched || hlt_counter)
+ goto slow_out;
+ cpu_do_idle(IDLE_WAIT_FAST);
+ } while (time_before(jiffies, start_idle + HZ/50));
+
+ cpu_do_idle(IDLE_CLOCK_SLOW);
+
+ while (!current->need_resched && !hlt_counter) {
+ cpu_do_idle(IDLE_WAIT_SLOW);
+ }
+
+ cpu_do_idle(IDLE_CLOCK_FAST);
+slow_out:
+}
+
+#define arch_reset(mode) do { } while (0)
+
+#endif
diff --git a/include/asm-arm/arch-tbox/time.h b/include/asm-arm/arch-tbox/time.h
new file mode 100644
index 000000000..87e92abb6
--- /dev/null
+++ b/include/asm-arm/arch-tbox/time.h
@@ -0,0 +1,36 @@
+/*
+ * linux/include/asm-arm/arch-tbox/time.h
+ *
+ * Copyright (c) 1997, 1999 Phil Blundell.
+ * Copyright (c) 2000 FutureTV Labs Ltd
+ *
+ * Tbox has no real-time clock -- we get millisecond ticks to update
+ * our soft copy.
+ */
+
+#include <asm/io.h>
+#include <asm/hardware.h>
+
+#define update_rtc()
+
+static void timer_interrupt (int irq, void *dev_id, struct pt_regs *regs)
+{
+ /* Clear irq */
+ __raw_writel(1, FPGA1CONT + 0xc);
+ __raw_writel(0, FPGA1CONT + 0xc);
+
+ do_timer(regs);
+}
+
+extern __inline__ void setup_timer (void)
+{
+ /*
+ * Default the date to 1 Jan 1970 0:0:0
+ * You will have to run a time daemon to set the
+ * clock correctly at bootup
+ */
+ xtime.tv_sec = mktime(1970, 1, 1, 0, 0, 0);
+
+ timer_irq.handler = timer_interrupt;
+ setup_arm_irq(IRQ_TIMER, &timer_irq);
+}
diff --git a/include/asm-arm/arch-tbox/timex.h b/include/asm-arm/arch-tbox/timex.h
new file mode 100644
index 000000000..c5489cd66
--- /dev/null
+++ b/include/asm-arm/arch-tbox/timex.h
@@ -0,0 +1,8 @@
+/*
+ * linux/include/asm-arm/arch-tbox/timex.h
+ *
+ * Tbox timex specifications
+ *
+ * Copyright (C) 1999 Philip Blundell
+ */
+
diff --git a/include/asm-arm/arch-tbox/uncompress.h b/include/asm-arm/arch-tbox/uncompress.h
new file mode 100644
index 000000000..17a5034e7
--- /dev/null
+++ b/include/asm-arm/arch-tbox/uncompress.h
@@ -0,0 +1,42 @@
+/*
+ * linux/include/asm-arm/arch-nexuspci/uncompress.h
+ * from linux/include/asm-arm/arch-ebsa110/uncompress.h
+ *
+ * Copyright (C) 1996,1997,1998 Russell King
+ * Copyright (C) 1998, 1999 Phil Blundell
+ */
+
+#include <asm/io.h>
+
+#define UARTBASE 0x00400000
+
+/*
+ * This does not append a newline
+ */
+static void puts(const char *s)
+{
+ while (*s)
+ {
+ char c = *(s++);
+ while (!(__raw_readb(UARTBASE + 0x14) & 0x20));
+ __raw_writeb(c, UARTBASE);
+ if (c == 10) {
+ while (!(__raw_readb(UARTBASE + 0x14) & 0x20));
+ __raw_writeb(13, UARTBASE);
+ }
+ }
+}
+
+/*
+ * nothing to do
+ */
+#define arch_decomp_setup()
+
+/*
+ * Stroke the watchdog so we don't get reset during decompression.
+ */
+#define arch_decomp_wdog() \
+ do { \
+ __raw_writel(1, 0xa00000); \
+ __raw_writel(0, 0xa00000); \
+ } while (0)
diff --git a/include/asm-arm/arch-tbox/vmalloc.h b/include/asm-arm/arch-tbox/vmalloc.h
new file mode 100644
index 000000000..31fe3e777
--- /dev/null
+++ b/include/asm-arm/arch-tbox/vmalloc.h
@@ -0,0 +1,17 @@
+/*
+ * linux/include/asm-arm/arch-rpc/vmalloc.h
+ */
+
+/*
+ * Just any arbitrary offset to the start of the vmalloc VM area: the
+ * current 8MB value just means that there will be a 8MB "hole" after the
+ * physical memory until the kernel virtual memory starts. That means that
+ * any out-of-bounds memory accesses will hopefully be caught.
+ * The vmalloc() routines leaves a hole of 4kB between each vmalloced
+ * area for the same reason. ;)
+ */
+#define VMALLOC_OFFSET (8*1024*1024)
+#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
+#define VMALLOC_VMADDR(x) ((unsigned long)(x))
+#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
+
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
index 94fd17170..0907316dd 100644
--- a/include/asm-arm/atomic.h
+++ b/include/asm-arm/atomic.h
@@ -1,13 +1,17 @@
/*
- * linux/include/asm-arm/atomic.h
+ * linux/include/asm-arm/atomic.h
*
- * Copyright (c) 1996 Russell King.
+ * Copyright (c) 1996 Russell King.
*
- * Changelog:
- * 27-06-1996 RMK Created
- * 13-04-1997 RMK Made functions atomic!
- * 07-12-1997 RMK Upgraded for v2.1.
- * 26-08-1998 PJB Added #ifdef __KERNEL__
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 27-06-1996 RMK Created
+ * 13-04-1997 RMK Made functions atomic!
+ * 07-12-1997 RMK Upgraded for v2.1.
+ * 26-08-1998 PJB Added #ifdef __KERNEL__
*/
#ifndef __ASM_ARM_ATOMIC_H
#define __ASM_ARM_ATOMIC_H
diff --git a/include/asm-arm/bugs.h b/include/asm-arm/bugs.h
index 637d89c1b..2f7b33b10 100644
--- a/include/asm-arm/bugs.h
+++ b/include/asm-arm/bugs.h
@@ -1,7 +1,11 @@
/*
- * include/asm-arm/bugs.h
+ * linux/include/asm-arm/bugs.h
*
* Copyright (C) 1995 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_BUGS_H
#define __ASM_BUGS_H
diff --git a/include/asm-arm/cache.h b/include/asm-arm/cache.h
index d5bb17841..a56ffb7c2 100644
--- a/include/asm-arm/cache.h
+++ b/include/asm-arm/cache.h
@@ -1,5 +1,5 @@
/*
- * linux/include/asm-arm/cache.h
+ * linux/include/asm-arm/cache.h
*/
#ifndef __ASMARM_CACHE_H
#define __ASMARM_CACHE_H
diff --git a/include/asm-arm/checksum.h b/include/asm-arm/checksum.h
index b91f5e7f4..0090141fa 100644
--- a/include/asm-arm/checksum.h
+++ b/include/asm-arm/checksum.h
@@ -1,5 +1,5 @@
/*
- * linux/include/asm-arm/checksum.h
+ * linux/include/asm-arm/checksum.h
*
* IP checksum routines
*
diff --git a/include/asm-arm/cpu-multi26.h b/include/asm-arm/cpu-multi26.h
index 50639037d..62b8c77ed 100644
--- a/include/asm-arm/cpu-multi26.h
+++ b/include/asm-arm/cpu-multi26.h
@@ -1,3 +1,12 @@
+/*
+ * linux/include/asm-arm/cpu-multi26.h
+ *
+ * Copyright (C) 2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
#ifndef __ASSEMBLY__
#include <asm/page.h>
diff --git a/include/asm-arm/cpu-multi32.h b/include/asm-arm/cpu-multi32.h
index b8a5b58f8..7f07bc8e5 100644
--- a/include/asm-arm/cpu-multi32.h
+++ b/include/asm-arm/cpu-multi32.h
@@ -1,3 +1,12 @@
+/*
+ * linux/include/asm-arm/cpu-multi32.h
+ *
+ * Copyright (C) 2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
#ifndef __ASSEMBLY__
#include <asm/page.h>
@@ -27,79 +36,91 @@ extern struct processor {
*/
void (*_proc_fin)(void);
/*
- * Processor architecture specific
- */
- /* CACHE
- *
- * flush all caches
- */
- void (*_flush_cache_all)(void);
- /*
- * flush a specific page or pages
- */
- void (*_flush_cache_area)(unsigned long address, unsigned long end, int flags);
- /*
- * flush cache entry for an address
- */
- void (*_flush_cache_entry)(unsigned long address);
- /*
- * clean a virtual address range from the
- * D-cache without flushing the cache.
- */
- void (*_clean_cache_area)(unsigned long start, unsigned long size);
- /*
- * flush a page to RAM
- */
- void (*_flush_ram_page)(unsigned long page);
- /* TLB
- *
- * flush all TLBs
- */
- void (*_flush_tlb_all)(void);
- /*
- * flush a specific TLB
- */
- void (*_flush_tlb_area)(unsigned long address, unsigned long end, int flags);
- /*
- * Set the page table
- */
- void (*_set_pgd)(unsigned long pgd_phys);
- /*
- * Set a PMD (handling IMP bit 4)
- */
- void (*_set_pmd)(pmd_t *pmdp, pmd_t pmd);
- /*
- * Set a PTE
- */
- void (*_set_pte)(pte_t *ptep, pte_t pte);
- /*
* Special stuff for a reset
*/
volatile void (*reset)(unsigned long addr);
/*
- * flush an icached page
- */
- void (*_flush_icache_area)(unsigned long start, unsigned long size);
- /*
- * write back dirty cached data
- */
- void (*_cache_wback_area)(unsigned long start, unsigned long end);
- /*
- * purge cached data without (necessarily) writing it back
- */
- void (*_cache_purge_area)(unsigned long start, unsigned long end);
- /*
- * flush a specific TLB
- */
- void (*_flush_tlb_page)(unsigned long address, int flags);
- /*
* Idle the processor
*/
int (*_do_idle)(int mode);
/*
- * flush I cache for a page
+ * Processor architecture specific
*/
- void (*_flush_icache_page)(unsigned long address);
+ struct { /* CACHE */
+ /*
+ * flush all caches
+ */
+ void (*clean_invalidate_all)(void);
+ /*
+ * flush a specific page or pages
+ */
+ void (*clean_invalidate_range)(unsigned long address, unsigned long end, int flags);
+ /*
+ * flush a page to RAM
+ */
+ void (*_flush_ram_page)(void *virt_page);
+ } cache;
+
+ struct { /* D-cache */
+ /*
+ * invalidate the specified data range
+ */
+ void (*invalidate_range)(unsigned long start, unsigned long end);
+ /*
+ * clean specified data range
+ */
+ void (*clean_range)(unsigned long start, unsigned long end);
+ /*
+ * obsolete flush cache entry
+ */
+ void (*clean_page)(void *virt_page);
+ /*
+ * clean a virtual address range from the
+ * D-cache without flushing the cache.
+ */
+ void (*clean_entry)(unsigned long start);
+ } dcache;
+
+ struct { /* I-cache */
+ /*
+ * invalidate the I-cache for the specified range
+ */
+ void (*invalidate_range)(unsigned long start, unsigned long end);
+ /*
+ * invalidate the I-cache for the specified virtual page
+ */
+ void (*invalidate_page)(void *virt_page);
+ } icache;
+
+ struct { /* TLB */
+ /*
+ * flush all TLBs
+ */
+ void (*invalidate_all)(void);
+ /*
+ * flush a specific TLB
+ */
+ void (*invalidate_range)(unsigned long address, unsigned long end);
+ /*
+ * flush a specific TLB
+ */
+ void (*invalidate_page)(unsigned long address, int flags);
+ } tlb;
+
+ struct { /* PageTable */
+ /*
+ * Set the page table
+ */
+ void (*set_pgd)(unsigned long pgd_phys);
+ /*
+ * Set a PMD (handling IMP bit 4)
+ */
+ void (*set_pmd)(pmd_t *pmdp, pmd_t pmd);
+ /*
+ * Set a PTE
+ */
+ void (*set_pte)(pte_t *ptep, pte_t pte);
+ } pgtable;
} processor;
extern const struct processor arm6_processor_functions;
@@ -110,24 +131,28 @@ extern const struct processor sa110_processor_functions;
#define cpu_check_bugs() processor._check_bugs()
#define cpu_proc_init() processor._proc_init()
#define cpu_proc_fin() processor._proc_fin()
+#define cpu_reset(addr) processor.reset(addr)
#define cpu_do_idle(mode) processor._do_idle(mode)
-#define cpu_flush_cache_all() processor._flush_cache_all()
-#define cpu_flush_cache_area(start,end,flags) processor._flush_cache_area(start,end,flags)
-#define cpu_flush_cache_entry(addr) processor._flush_cache_entry(addr)
-#define cpu_clean_cache_area(start,size) processor._clean_cache_area(start,size)
-#define cpu_flush_ram_page(page) processor._flush_ram_page(page)
-#define cpu_flush_tlb_all() processor._flush_tlb_all()
-#define cpu_flush_tlb_area(start,end,flags) processor._flush_tlb_area(start,end,flags)
-#define cpu_flush_tlb_page(addr,flags) processor._flush_tlb_page(addr,flags)
-#define cpu_set_pgd(pgd) processor._set_pgd(pgd)
-#define cpu_set_pmd(pmdp, pmd) processor._set_pmd(pmdp, pmd)
-#define cpu_set_pte(ptep, pte) processor._set_pte(ptep, pte)
-#define cpu_reset(addr) processor.reset(addr)
-#define cpu_flush_icache_area(start,end) processor._flush_icache_area(start,end)
-#define cpu_cache_wback_area(start,end) processor._cache_wback_area(start,end)
-#define cpu_cache_purge_area(start,end) processor._cache_purge_area(start,end)
-#define cpu_flush_icache_page(virt) processor._flush_icache_page(virt)
+#define cpu_cache_clean_invalidate_all() processor.cache.clean_invalidate_all()
+#define cpu_cache_clean_invalidate_range(s,e,f) processor.cache.clean_invalidate_range(s,e,f)
+#define cpu_flush_ram_page(vp) processor.cache._flush_ram_page(vp)
+
+#define cpu_dcache_clean_page(vp) processor.dcache.clean_page(vp)
+#define cpu_dcache_clean_entry(addr) processor.dcache.clean_entry(addr)
+#define cpu_dcache_clean_range(s,e) processor.dcache.clean_range(s,e)
+#define cpu_dcache_invalidate_range(s,e) processor.dcache.invalidate_range(s,e)
+
+#define cpu_icache_invalidate_range(s,e) processor.icache.invalidate_range(s,e)
+#define cpu_icache_invalidate_page(vp) processor.icache.invalidate_page(vp)
+
+#define cpu_tlb_invalidate_all() processor.tlb.invalidate_all()
+#define cpu_tlb_invalidate_range(s,e) processor.tlb.invalidate_range(s,e)
+#define cpu_tlb_invalidate_page(vp,f) processor.tlb.invalidate_page(vp,f)
+
+#define cpu_set_pgd(pgd) processor.pgtable.set_pgd(pgd)
+#define cpu_set_pmd(pmdp, pmd) processor.pgtable.set_pmd(pmdp, pmd)
+#define cpu_set_pte(ptep, pte) processor.pgtable.set_pte(ptep, pte)
#define cpu_switch_mm(pgd,tsk) cpu_set_pgd(__virt_to_phys((unsigned long)(pgd)))
diff --git a/include/asm-arm/cpu-single.h b/include/asm-arm/cpu-single.h
index 6a4c256f2..476115883 100644
--- a/include/asm-arm/cpu-single.h
+++ b/include/asm-arm/cpu-single.h
@@ -1,4 +1,13 @@
/*
+ * linux/include/asm-arm/cpu-single.h
+ *
+ * Copyright (C) 2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+/*
* Single CPU
*/
#ifdef __STDC__
@@ -9,33 +18,36 @@
#define cpu_fn(name,x) __cpu_fn(name,x)
/*
- * If we are supporting multiple CPUs, then
- * we must use a table of function pointers
- * for this lot. Otherwise, we can optimise
- * the table away.
+ * If we are supporting multiple CPUs, then we must use a table of
+ * function pointers for this lot. Otherwise, we can optimise the
+ * table away.
*/
#define cpu_data_abort cpu_fn(CPU_NAME,_data_abort)
#define cpu_check_bugs cpu_fn(CPU_NAME,_check_bugs)
#define cpu_proc_init cpu_fn(CPU_NAME,_proc_init)
#define cpu_proc_fin cpu_fn(CPU_NAME,_proc_fin)
+#define cpu_reset cpu_fn(CPU_NAME,_reset)
#define cpu_do_idle cpu_fn(CPU_NAME,_do_idle)
-#define cpu_flush_cache_all cpu_fn(CPU_NAME,_flush_cache_all)
-#define cpu_flush_cache_area cpu_fn(CPU_NAME,_flush_cache_area)
-#define cpu_flush_cache_entry cpu_fn(CPU_NAME,_flush_cache_entry)
-#define cpu_clean_cache_area cpu_fn(CPU_NAME,_clean_cache_area)
+#define cpu_cache_clean_invalidate_all cpu_fn(CPU_NAME,_cache_clean_invalidate_all)
+#define cpu_cache_clean_invalidate_range cpu_fn(CPU_NAME,_cache_clean_invalidate_range)
#define cpu_flush_ram_page cpu_fn(CPU_NAME,_flush_ram_page)
-#define cpu_flush_tlb_all cpu_fn(CPU_NAME,_flush_tlb_all)
-#define cpu_flush_tlb_area cpu_fn(CPU_NAME,_flush_tlb_area)
-#define cpu_flush_tlb_page cpu_fn(CPU_NAME,_flush_tlb_page)
+
+#define cpu_dcache_invalidate_range cpu_fn(CPU_NAME,_dcache_invalidate_range)
+#define cpu_dcache_clean_range cpu_fn(CPU_NAME,_dcache_clean_range)
+#define cpu_dcache_clean_page cpu_fn(CPU_NAME,_dcache_clean_page)
+#define cpu_dcache_clean_entry cpu_fn(CPU_NAME,_dcache_clean_entry)
+
+#define cpu_icache_invalidate_range cpu_fn(CPU_NAME,_icache_invalidate_range)
+#define cpu_icache_invalidate_page cpu_fn(CPU_NAME,_icache_invalidate_page)
+
+#define cpu_tlb_invalidate_all cpu_fn(CPU_NAME,_tlb_invalidate_all)
+#define cpu_tlb_invalidate_range cpu_fn(CPU_NAME,_tlb_invalidate_range)
+#define cpu_tlb_invalidate_page cpu_fn(CPU_NAME,_tlb_invalidate_page)
+
#define cpu_set_pgd cpu_fn(CPU_NAME,_set_pgd)
#define cpu_set_pmd cpu_fn(CPU_NAME,_set_pmd)
#define cpu_set_pte cpu_fn(CPU_NAME,_set_pte)
-#define cpu_reset cpu_fn(CPU_NAME,_reset)
-#define cpu_flush_icache_area cpu_fn(CPU_NAME,_flush_icache_area)
-#define cpu_cache_wback_area cpu_fn(CPU_NAME,_cache_wback_area)
-#define cpu_cache_purge_area cpu_fn(CPU_NAME,_cache_purge_area)
-#define cpu_flush_icache_page cpu_fn(CPU_NAME,_flush_icache_page)
#ifndef __ASSEMBLY__
@@ -51,22 +63,26 @@ extern void cpu_proc_init(void);
extern void cpu_proc_fin(void);
extern int cpu_do_idle(int mode);
-extern void cpu_flush_cache_all(void);
-extern void cpu_flush_cache_area(unsigned long address, unsigned long end, int flags);
-extern void cpu_flush_cache_entry(unsigned long address);
-extern void cpu_clean_cache_area(unsigned long start, unsigned long size);
-extern void cpu_flush_ram_page(unsigned long page);
-extern void cpu_flush_tlb_all(void);
-extern void cpu_flush_tlb_area(unsigned long address, unsigned long end, int flags);
-extern void cpu_flush_tlb_page(unsigned long address, int flags);
+extern void cpu_cache_clean_invalidate_all(void);
+extern void cpu_cache_clean_invalidate_range(unsigned long address, unsigned long end, int flags);
+extern void cpu_flush_ram_page(void *virt_page);
+
+extern void cpu_dcache_invalidate_range(unsigned long start, unsigned long end);
+extern void cpu_dcache_clean_range(unsigned long start, unsigned long end);
+extern void cpu_dcache_clean_page(void *virt_page);
+extern void cpu_dcache_clean_entry(unsigned long address);
+
+extern void cpu_icache_invalidate_range(unsigned long start, unsigned long end);
+extern void cpu_icache_invalidate_page(void *virt_page);
+
+extern void cpu_tlb_invalidate_all(void);
+extern void cpu_tlb_invalidate_range(unsigned long address, unsigned long end);
+extern void cpu_tlb_invalidate_page(unsigned long address, int flags);
+
extern void cpu_set_pgd(unsigned long pgd_phys);
extern void cpu_set_pmd(pmd_t *pmdp, pmd_t pmd);
extern void cpu_set_pte(pte_t *ptep, pte_t pte);
extern volatile void cpu_reset(unsigned long addr);
-extern void cpu_flush_icache_area(unsigned long start, unsigned long size);
-extern void cpu_cache_wback_area(unsigned long start, unsigned long end);
-extern void cpu_cache_purge_area(unsigned long start, unsigned long end);
-extern void cpu_flush_icache_page(unsigned long virt);
#define cpu_switch_mm(pgd,tsk) cpu_set_pgd(__virt_to_phys((unsigned long)(pgd)))
diff --git a/include/asm-arm/current.h b/include/asm-arm/current.h
index b2b83ebb7..3a06c2a8a 100644
--- a/include/asm-arm/current.h
+++ b/include/asm-arm/current.h
@@ -1,30 +1,16 @@
#ifndef _ASMARM_CURRENT_H
#define _ASMARM_CURRENT_H
-static inline unsigned long get_sp(void)
-{
- unsigned long sp;
- __asm__ ("mov %0,sp" : "=r" (sp));
- return sp;
-}
-
/* Old compilers seem to generate bad code if we allow `current' to be
non volatile. */
#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ > 90)
static inline struct task_struct *get_current(void) __attribute__ (( __const__ ));
-#define __VOLATILE_CURRENT
-#else
-#define __VOLATILE_CURRENT volatile
#endif
static inline struct task_struct *get_current(void)
{
- struct task_struct *ts;
- __asm__ __VOLATILE_CURRENT (
- "bic %0, sp, #0x1f00 @ get_current
- bic %0, %0, #0x00ff"
- : "=r" (ts));
- return ts;
+ register unsigned long sp asm ("sp");
+ return (struct task_struct *)(sp & ~0x1fff);
}
#define current (get_current())
diff --git a/include/asm-arm/dma.h b/include/asm-arm/dma.h
index 78c65b599..dc23c66dd 100644
--- a/include/asm-arm/dma.h
+++ b/include/asm-arm/dma.h
@@ -7,6 +7,7 @@ typedef unsigned int dmach_t;
#include <linux/spinlock.h>
#include <asm/system.h>
#include <asm/memory.h>
+#include <asm/scatterlist.h>
#include <asm/arch/dma.h>
/*
@@ -21,11 +22,6 @@ typedef unsigned int dmamode_t;
#define DMA_MODE_CASCADE 2
#define DMA_AUTOINIT 4
-typedef struct {
- unsigned long address;
- unsigned long length;
-} dmasg_t;
-
extern spinlock_t dma_spin_lock;
extern __inline__ unsigned long claim_dma_lock(void)
@@ -84,7 +80,7 @@ extern void disable_dma(dmach_t channel);
* especially since some DMA architectures don't update the
* DMA address immediately, but defer it to the enable_dma().
*/
-extern void set_dma_sg(dmach_t channel, dmasg_t *sg, int nr_sg);
+extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg);
/* Set the DMA address for this channel
*
diff --git a/include/asm-arm/fcntl.h b/include/asm-arm/fcntl.h
index b05970217..da2861ca3 100644
--- a/include/asm-arm/fcntl.h
+++ b/include/asm-arm/fcntl.h
@@ -51,6 +51,9 @@
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
+/* for leases */
+#define F_INPROGRESS 16
+
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
@@ -58,6 +61,11 @@
blocking */
#define LOCK_UN 8 /* remove lock */
+#define LOCK_MAND 32 /* This is a mandatory flock */
+#define LOCK_READ 64 /* ... Which allows concurrent read operations */
+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
+
struct flock {
short l_type;
short l_whence;
@@ -74,4 +82,5 @@ struct flock64 {
pid_t l_pid;
};
+#define F_LINUX_SPECIFIC_BASE 1024
#endif
diff --git a/include/asm-arm/floppy.h b/include/asm-arm/floppy.h
index 05a94a2e6..1083b95a2 100644
--- a/include/asm-arm/floppy.h
+++ b/include/asm-arm/floppy.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/floppy.h
+ * linux/include/asm-arm/floppy.h
*
- * (C) 1996-2000 Russell King
+ * Copyright (C) 1996-2000 Russell King
*
- * Note that we don't touch FLOPPY_DMA nor FLOPPY_IRQ here
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Note that we don't touch FLOPPY_DMA nor FLOPPY_IRQ here
*/
#ifndef __ASM_ARM_FLOPPY_H
#define __ASM_ARM_FLOPPY_H
diff --git a/include/asm-arm/hardware.h b/include/asm-arm/hardware.h
index 594552e84..4ded5b8f0 100644
--- a/include/asm-arm/hardware.h
+++ b/include/asm-arm/hardware.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/hardware.h
+ * linux/include/asm-arm/hardware.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
*
- * Common hardware definitions
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Common hardware definitions
*/
#ifndef __ASM_HARDWARE_H
diff --git a/include/asm-arm/dec21285.h b/include/asm-arm/hardware/dec21285.h
index dd49f6416..9049f0dda 100644
--- a/include/asm-arm/dec21285.h
+++ b/include/asm-arm/hardware/dec21285.h
@@ -1,9 +1,13 @@
/*
- * include/asm-arm/dec21285.h
+ * linux/include/asm-arm/hardware/dec21285.h
*
- * Copyright (C) 1998 Russell King
+ * Copyright (C) 1998 Russell King
*
- * DC21285 registers
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * DC21285 registers
*/
#define DC21285_PCI_IACK 0x79000000
#define DC21285_ARMCSR_BASE 0x42000000
diff --git a/include/asm-arm/ioc.h b/include/asm-arm/hardware/ioc.h
index 68286872b..fe65d7742 100644
--- a/include/asm-arm/ioc.h
+++ b/include/asm-arm/hardware/ioc.h
@@ -1,6 +1,14 @@
/*
- * Use these macros to read/write the IOC. All it does is perform the actual
- * read/write.
+ * linux/include/asm-arm/hardware/ioc.h
+ *
+ * Copyright (C) Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Use these macros to read/write the IOC. All it does is perform the actual
+ * read/write.
*/
#ifndef IOC_CONTROL
diff --git a/include/asm-arm/iomd.h b/include/asm-arm/hardware/iomd.h
index 3a1e09dfe..7145b89fd 100644
--- a/include/asm-arm/iomd.h
+++ b/include/asm-arm/hardware/iomd.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/iomd.h
+ * linux/include/asm-arm/iomd.h
*
- * Copyright (C) 1999 Russell King
+ * Copyright (C) 1999 Russell King
*
- * This file contains information out the IOMD ASIC used in the
- * Acorn RiscPC and subsequently integrated into the CLPS7500 chips.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This file contains information out the IOMD ASIC used in the
+ * Acorn RiscPC and subsequently integrated into the CLPS7500 chips.
*/
#include <linux/config.h>
diff --git a/include/asm-arm/memc.h b/include/asm-arm/hardware/memc.h
index 66873dc9e..8aef5aa0e 100644
--- a/include/asm-arm/memc.h
+++ b/include/asm-arm/hardware/memc.h
@@ -1,3 +1,12 @@
+/*
+ * linux/include/asm-arm/hardware/memc.h
+ *
+ * Copyright (C) Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
#define VDMA_ALIGNMENT PAGE_SIZE
#define VDMA_XFERSIZE 16
#define VDMA_INIT 0
diff --git a/include/asm-arm/hardware/pci_v3.h b/include/asm-arm/hardware/pci_v3.h
new file mode 100644
index 000000000..e64cebdd9
--- /dev/null
+++ b/include/asm-arm/hardware/pci_v3.h
@@ -0,0 +1,148 @@
+/*
+ * linux/include/asm-arm/hardware/pci_v3.h
+ *
+ * Internal header file PCI V3 chip
+ *
+ * Copyright (C) ARM Limited
+ * Copyright (C) 2000 Deep Blue Solutions Ltd.
+ *
+ * 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 program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef ASM_ARM_HARDWARE_PCI_V3_H
+#define ASM_ARM_HARDWARE_PCI_V3_H
+
+/* -------------------------------------------------------------------------------
+ * V3 Local Bus to PCI Bridge definitions
+ * -------------------------------------------------------------------------------
+ * Registers (these are taken from page 129 of the EPC User's Manual Rev 1.04
+ * All V3 register names are prefaced by V3_ to avoid clashing with any other
+ * PCI definitions. Their names match the user's manual.
+ *
+ * I'm assuming that I20 is disabled.
+ *
+ */
+#define V3_PCI_VENDOR 0x00000000
+#define V3_PCI_DEVICE 0x00000002
+#define V3_PCI_CMD 0x00000004
+#define V3_PCI_STAT 0x00000006
+#define V3_PCI_CC_REV 0x00000008
+#define V3_PCI_HDR_CFG 0x0000000C
+#define V3_PCI_IO_BASE 0x00000010
+#define V3_PCI_BASE0 0x00000014
+#define V3_PCI_BASE1 0x00000018
+#define V3_PCI_SUB_VENDOR 0x0000002C
+#define V3_PCI_SUB_ID 0x0000002E
+#define V3_PCI_ROM 0x00000030
+#define V3_PCI_BPARAM 0x0000003C
+#define V3_PCI_MAP0 0x00000040
+#define V3_PCI_MAP1 0x00000044
+#define V3_PCI_INT_STAT 0x00000048
+#define V3_PCI_INT_CFG 0x0000004C
+#define V3_LB_BASE0 0x00000054
+#define V3_LB_BASE1 0x00000058
+#define V3_LB_MAP0 0x0000005E
+#define V3_LB_MAP1 0x00000062
+#define V3_LB_BASE2 0x00000064
+#define V3_LB_MAP2 0x00000066
+#define V3_LB_SIZE 0x00000068
+#define V3_LB_IO_BASE 0x0000006E
+#define V3_FIFO_CFG 0x00000070
+#define V3_FIFO_PRIORITY 0x00000072
+#define V3_FIFO_STAT 0x00000074
+#define V3_LB_ISTAT 0x00000076
+#define V3_LB_IMASK 0x00000077
+#define V3_SYSTEM 0x00000078
+#define V3_LB_CFG 0x0000007A
+#define V3_PCI_CFG 0x0000007C
+#define V3_DMA_PCI_ADR0 0x00000080
+#define V3_DMA_PCI_ADR1 0x00000090
+#define V3_DMA_LOCAL_ADR0 0x00000084
+#define V3_DMA_LOCAL_ADR1 0x00000094
+#define V3_DMA_LENGTH0 0x00000088
+#define V3_DMA_LENGTH1 0x00000098
+#define V3_DMA_CSR0 0x0000008B
+#define V3_DMA_CSR1 0x0000009B
+#define V3_DMA_CTLB_ADR0 0x0000008C
+#define V3_DMA_CTLB_ADR1 0x0000009C
+#define V3_DMA_DELAY 0x000000E0
+#define V3_MAIL_DATA 0x000000C0
+#define V3_PCI_MAIL_IEWR 0x000000D0
+#define V3_PCI_MAIL_IERD 0x000000D2
+#define V3_LB_MAIL_IEWR 0x000000D4
+#define V3_LB_MAIL_IERD 0x000000D6
+#define V3_MAIL_WR_STAT 0x000000D8
+#define V3_MAIL_RD_STAT 0x000000DA
+#define V3_QBA_MAP 0x000000DC
+
+/* PCI COMMAND REGISTER bits
+ */
+#define V3_COMMAND_M_FBB_EN BIT9
+#define V3_COMMAND_M_SERR_EN BIT8
+#define V3_COMMAND_M_PAR_EN BIT6
+#define V3_COMMAND_M_MASTER_EN BIT2
+#define V3_COMMAND_M_MEM_EN BIT1
+#define V3_COMMAND_M_IO_EN BIT0
+
+/* SYSTEM REGISTER bits
+ */
+#define V3_SYSTEM_M_RST_OUT BIT15
+#define V3_SYSTEM_M_LOCK BIT14
+
+/* PCI_CFG bits
+ */
+#define V3_PCI_CFG_M_RETRY_EN BIT10
+#define V3_PCI_CFG_M_AD_LOW1 BIT9
+#define V3_PCI_CFG_M_AD_LOW0 BIT8
+
+/* PCI_BASE register bits (PCI -> Local Bus)
+ */
+#define V3_PCI_BASE_M_ADR_BASE 0xFFF00000
+#define V3_PCI_BASE_M_ADR_BASEL 0x000FFF00
+#define V3_PCI_BASE_M_PREFETCH BIT3
+#define V3_PCI_BASE_M_TYPE BIT2+BIT1
+#define V3_PCI_BASE_M_IO BIT0
+
+/* PCI MAP register bits (PCI -> Local bus)
+ */
+#define V3_PCI_MAP_M_MAP_ADR 0xFFF00000
+#define V3_PCI_MAP_M_RD_POST_INH BIT15
+#define V3_PCI_MAP_M_ROM_SIZE BIT11+BIT10
+#define V3_PCI_MAP_M_SWAP BIT9+BIT8
+#define V3_PCI_MAP_M_ADR_SIZE 0x000000F0
+#define V3_PCI_MAP_M_REG_EN BIT1
+#define V3_PCI_MAP_M_ENABLE BIT0
+
+/* 9 => 512M window size
+ */
+#define V3_PCI_MAP_M_ADR_SIZE_512M 0x00000090
+/* A => 1024M window size
+ */
+#define V3_PCI_MAP_M_ADR_SIZE_1024M 0x000000A0
+
+/* LB_BASE register bits (Local bus -> PCI)
+ */
+#define V3_LB_BASE_M_MAP_ADR 0xFFF00000
+#define V3_LB_BASE_M_SWAP BIT9+BIT8
+#define V3_LB_BASE_M_ADR_SIZE 0x000000F0
+#define V3_LB_BASE_M_PREFETCH BIT3
+#define V3_LB_BASE_M_ENABLE BIT0
+
+/* LB_MAP register bits (Local bus -> PCI)
+ */
+#define V3_LB_MAP_M_MAP_ADR 0xFFF0
+#define V3_LB_MAP_M_TYPE 0x000E
+#define V3_LB_MAP_M_AD_LOW_EN BIT0
+
+#endif
diff --git a/include/asm-arm/hardware/serial_amba.h b/include/asm-arm/hardware/serial_amba.h
new file mode 100644
index 000000000..15bfbb98d
--- /dev/null
+++ b/include/asm-arm/hardware/serial_amba.h
@@ -0,0 +1,91 @@
+/*
+ * linux/include/asm-arm/hardware/serial_amba.h
+ *
+ * Internal header file for AMBA serial ports
+ *
+ * Copyright (C) ARM Limited
+ * Copyright (C) 2000 Deep Blue Solutions Ltd.
+ *
+ * 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 program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef ASM_ARM_HARDWARE_SERIAL_AMBA_H
+#define ASM_ARM_HARDWARE_SERIAL_AMBA_H
+
+/* -------------------------------------------------------------------------------
+ * From AMBA UART (PL010) Block Specification (ARM-0001-CUST-DSPC-A03)
+ * -------------------------------------------------------------------------------
+ * UART Register Offsets.
+ */
+#define AMBA_UARTDR 0x00 /* Data read or written from the interface. */
+#define AMBA_UARTRSR 0x04 /* Receive status register (Read). */
+#define AMBA_UARTECR 0x04 /* Error clear register (Write). */
+#define AMBA_UARTLCR_H 0x08 /* Line control register, high byte. */
+#define AMBA_UARTLCR_M 0x0C /* Line control register, middle byte. */
+#define AMBA_UARTLCR_L 0x10 /* Line control register, low byte. */
+#define AMBA_UARTCR 0x14 /* Control register. */
+#define AMBA_UARTFR 0x18 /* Flag register (Read only). */
+#define AMBA_UARTIIR 0x1C /* Interrupt indentification register (Read). */
+#define AMBA_UARTICR 0x1C /* Interrupt clear register (Write). */
+#define AMBA_UARTILPR 0x20 /* IrDA low power counter register. */
+
+#define AMBA_UARTRSR_OE 0x08
+#define AMBA_UARTRSR_BE 0x04
+#define AMBA_UARTRSR_PE 0x02
+#define AMBA_UARTRSR_FE 0x01
+
+#define AMBA_UARTFR_TXFF 0x20
+#define AMBA_UARTFR_RXFE 0x10
+#define AMBA_UARTFR_BUSY 0x08
+#define AMBA_UARTFR_DCD 0x04
+#define AMBA_UARTFR_DSR 0x02
+#define AMBA_UARTFR_CTS 0x01
+#define AMBA_UARTFR_TMSK (AMBA_UARTFR_TXFF + AMBA_UARTFR_BUSY)
+
+#define AMBA_UARTCR_RTIE 0x40
+#define AMBA_UARTCR_TIE 0x20
+#define AMBA_UARTCR_RIE 0x10
+#define AMBA_UARTCR_MSIE 0x08
+#define AMBA_UARTCR_IIRLP 0x04
+#define AMBA_UARTCR_SIREN 0x02
+#define AMBA_UARTCR_UARTEN 0x01
+
+#define AMBA_UARTLCR_H_WLEN_8 0x60
+#define AMBA_UARTLCR_H_WLEN_7 0x40
+#define AMBA_UARTLCR_H_WLEN_6 0x20
+#define AMBA_UARTLCR_H_WLEN_5 0x00
+#define AMBA_UARTLCR_H_FEN 0x10
+#define AMBA_UARTLCR_H_STP2 0x08
+#define AMBA_UARTLCR_H_EPS 0x04
+#define AMBA_UARTLCR_H_PEN 0x02
+#define AMBA_UARTLCR_H_BRK 0x01
+
+#define AMBA_UARTIIR_RTIS 0x08
+#define AMBA_UARTIIR_TIS 0x04
+#define AMBA_UARTIIR_RIS 0x02
+#define AMBA_UARTIIR_MIS 0x01
+
+#define ARM_BAUD_460800 1
+#define ARM_BAUD_230400 3
+#define ARM_BAUD_115200 7
+#define ARM_BAUD_57600 15
+#define ARM_BAUD_38400 23
+#define ARM_BAUD_19200 47
+#define ARM_BAUD_14400 63
+#define ARM_BAUD_9600 95
+#define ARM_BAUD_4800 191
+#define ARM_BAUD_2400 383
+#define ARM_BAUD_1200 767
+
+#endif
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index fad9e7412..707aa9788 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/io.h
+ * linux/include/asm-arm/io.h
*
- * Copyright (C) 1996-2000 Russell King
+ * Copyright (C) 1996-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
* Modifications:
* 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both
@@ -19,7 +23,6 @@
#include <linux/types.h>
#include <asm/arch/hardware.h>
#include <asm/arch/io.h>
-#include <asm/proc/io.h>
#define outb_p(val,port) outb((val),(port))
#define outw_p(val,port) outw((val),(port))
diff --git a/include/asm-arm/keyboard.h b/include/asm-arm/keyboard.h
index 9514b470a..7d256af70 100644
--- a/include/asm-arm/keyboard.h
+++ b/include/asm-arm/keyboard.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/keyboard.h
+ * linux/include/asm-arm/keyboard.h
*
- * Keyboard driver definitions for ARM
+ * Copyright (C) 1998 Russell King
*
- * (C) 1998 Russell King
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Keyboard driver definitions for ARM
*/
#ifndef __ASM_ARM_KEYBOARD_H
#define __ASM_ARM_KEYBOARD_H
diff --git a/include/asm-arm/leds.h b/include/asm-arm/leds.h
index 7eebdb1c2..598b5086c 100644
--- a/include/asm-arm/leds.h
+++ b/include/asm-arm/leds.h
@@ -1,11 +1,14 @@
/*
- * include/asm-arm/leds.h
+ * linux/include/asm-arm/leds.h
*
- * Copyright (C) 1998 Russell King
+ * Copyright (C) 1998 Russell King
*
- * Event-driven interface for LEDs on machines
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
- * Added led_start and led_stop- Alex Holden, 28th Dec 1998.
+ * Event-driven interface for LEDs on machines
+ * Added led_start and led_stop- Alex Holden, 28th Dec 1998.
*/
#ifndef ASM_ARM_LEDS_H
#define ASM_ARM_LEDS_H
diff --git a/include/asm-arm/linux_logo.h b/include/asm-arm/linux_logo.h
index 35ee86403..ba0bc304d 100644
--- a/include/asm-arm/linux_logo.h
+++ b/include/asm-arm/linux_logo.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/linux_logo.h
+ * linux/include/asm-arm/linux_logo.h
*
- * Copyright (C) 1998 Russell King
+ * Copyright (C) 1998 Russell King
*
- * Linux console driver logo definitions for ARM
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Linux console driver logo definitions for ARM
*/
#include <linux/init.h>
diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h
new file mode 100644
index 000000000..f5297ecf1
--- /dev/null
+++ b/include/asm-arm/mach/arch.h
@@ -0,0 +1,88 @@
+/*
+ * linux/include/asm-arm/mach/arch.h
+ *
+ * Copyright (C) 2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * The size of struct machine_desc
+ * (for assembler code)
+ */
+#define SIZEOF_MACHINE_DESC 44
+
+#ifndef __ASSEMBLY__
+
+struct machine_desc {
+ /*
+ * Note! The first four elements are used
+ * by assembler code in head-armv.S
+ */
+ unsigned int nr; /* architecture number */
+ unsigned int phys_ram; /* start of physical ram */
+ unsigned int phys_io; /* start of physical io */
+ unsigned int virt_io; /* start of virtual io */
+
+ const char *name; /* architecture name */
+ unsigned int param_offset; /* parameter page */
+
+ unsigned int video_start; /* start of video RAM */
+ unsigned int video_end; /* end of video RAM */
+
+ unsigned int reserve_lp0 :1; /* never has lp0 */
+ unsigned int reserve_lp1 :1; /* never has lp1 */
+ unsigned int reserve_lp2 :1; /* never has lp2 */
+ unsigned int broken_hlt :1; /* hlt is broken */
+ unsigned int soft_reboot :1; /* soft reboot */
+ void (*fixup)(struct machine_desc *,
+ struct param_struct *, char **,
+ struct meminfo *);
+ void (*map_io)(void);/* IO mapping function */
+};
+
+/*
+ * Set of macros to define architecture features. This is built into
+ * a table by the linker.
+ */
+#define MACHINE_START(_type,_name) \
+const struct machine_desc __mach_desc_##_type \
+ __attribute__((__section__(".arch.info"))) = { \
+ nr: MACH_TYPE_##_type##, \
+ name: _name,
+
+#define MAINTAINER(n)
+
+#define BOOT_MEM(_pram,_pio,_vio) \
+ phys_ram: _pram, \
+ phys_io: _pio, \
+ virt_io: _vio,
+
+#define BOOT_PARAMS(_params) \
+ param_offset: _params,
+
+#define VIDEO(_start,_end) \
+ video_start: _start, \
+ video_end: _end,
+
+#define DISABLE_PARPORT(_n) \
+ reserve_lp##_n##: 1,
+
+#define BROKEN_HLT \
+ broken_hlt: 1,
+
+#define SOFT_REBOOT \
+ soft_reboot: 1,
+
+#define FIXUP(_func) \
+ fixup: _func,
+
+#define MAPIO(_func) \
+ map_io: _func,
+
+#define MACHINE_END \
+};
+
+#endif
diff --git a/include/asm-arm/mach/dma.h b/include/asm-arm/mach/dma.h
new file mode 100644
index 000000000..d48d94a1d
--- /dev/null
+++ b/include/asm-arm/mach/dma.h
@@ -0,0 +1,55 @@
+/*
+ * linux/include/asm-arm/mach/dma.h
+ *
+ * Copyright (C) 1998-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This header file describes the interface between the generic DMA handler
+ * (dma.c) and the architecture-specific DMA backends (dma-*.c)
+ */
+
+struct dma_struct;
+typedef struct dma_struct dma_t;
+
+struct dma_ops {
+ int (*request)(dmach_t, dma_t *); /* optional */
+ void (*free)(dmach_t, dma_t *); /* optional */
+ void (*enable)(dmach_t, dma_t *); /* mandatory */
+ void (*disable)(dmach_t, dma_t *); /* mandatory */
+ int (*residue)(dmach_t, dma_t *); /* optional */
+ int (*setspeed)(dmach_t, dma_t *, int); /* optional */
+ char *type;
+};
+
+struct dma_struct {
+ struct scatterlist buf; /* single DMA */
+ int sgcount; /* number of DMA SG */
+ struct scatterlist *sg; /* DMA Scatter-Gather List */
+
+ unsigned int active:1; /* Transfer active */
+ unsigned int invalid:1; /* Address/Count changed */
+ unsigned int using_sg:1; /* using scatter list? */
+ dmamode_t dma_mode; /* DMA mode */
+ int speed; /* DMA speed */
+
+ unsigned int lock; /* Device is allocated */
+ const char *device_id; /* Device name */
+
+ unsigned int dma_base; /* Controller base address */
+ int dma_irq; /* Controller IRQ */
+ int state; /* Controller state */
+ struct scatterlist cur_sg; /* Current controller buffer */
+
+ struct dma_ops *d_ops;
+};
+
+/* Prototype: void arch_dma_init(dma)
+ * Purpose : Initialise architecture specific DMA
+ * Params : dma - pointer to array of DMA structures
+ */
+extern void arch_dma_init(dma_t *dma);
+
+extern void isa_init_dma(dma_t *dma);
diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h
new file mode 100644
index 000000000..51fef86d2
--- /dev/null
+++ b/include/asm-arm/mach/map.h
@@ -0,0 +1,32 @@
+/*
+ * linux/include/asm-arm/map.h
+ *
+ * Copyright (C) 1999-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Page table mapping constructs and function prototypes
+ */
+struct map_desc {
+ unsigned long virtual;
+ unsigned long physical;
+ unsigned long length;
+ int domain:4,
+ prot_read:1,
+ prot_write:1,
+ cacheable:1,
+ bufferable:1,
+ last:1;
+};
+
+#define LAST_DESC \
+ { last: 1 }
+
+struct meminfo;
+
+extern void create_memmap_holes(struct meminfo *);
+extern void memtable_init(struct meminfo *);
+extern void iotable_init(struct map_desc *);
+extern void setup_io_desc(void);
diff --git a/include/asm-arm/mach/pci.h b/include/asm-arm/mach/pci.h
new file mode 100644
index 000000000..7f118bc75
--- /dev/null
+++ b/include/asm-arm/mach/pci.h
@@ -0,0 +1,42 @@
+/*
+ * linux/include/asm-arm/mach/pci.h
+ *
+ * Copyright (C) 2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#define MAX_NR_BUS 2
+
+struct arm_bus_sysdata {
+ /*
+ * bitmask of features we can turn.
+ * See PCI command register for more info.
+ */
+ u16 features;
+ /*
+ * Maximum devsel for this bus.
+ */
+ u16 maxdevsel;
+ /*
+ * The maximum latency that devices on this
+ * bus can withstand.
+ */
+ u8 max_lat;
+};
+
+struct arm_pci_sysdata {
+ struct arm_bus_sysdata bus[MAX_NR_BUS];
+};
+
+struct hw_pci {
+ void (*init)(struct arm_pci_sysdata *);
+ u8 (*swizzle)(struct pci_dev *dev, u8 *pin);
+ int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
+};
+
+extern u8 no_swizzle(struct pci_dev *dev, u8 *pin);
+
+void __init dc21285_init(struct arm_pci_sysdata *);
+void __init plx90x0_init(struct arm_pci_sysdata *);
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index 837ea199a..f2e0d2be9 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -1,11 +1,15 @@
/*
- * linux/include/asm-arm/memory.h
+ * linux/include/asm-arm/memory.h
*
- * Copyright (C) 2000 Russell King
+ * Copyright (C) 2000 Russell King
*
- * Note: this file should not be included by non-asm/.h files
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
- * Modifications:
+ * Note: this file should not be included by non-asm/.h files
+ *
+ * Modifications:
*/
#ifndef __ASM_ARM_MEMORY_H
#define __ASM_ARM_MEMORY_H
diff --git a/include/asm-arm/mmu_context.h b/include/asm-arm/mmu_context.h
index f358628a9..6aad02f46 100644
--- a/include/asm-arm/mmu_context.h
+++ b/include/asm-arm/mmu_context.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/mmu_context.h
+ * linux/include/asm-arm/mmu_context.h
*
- * Copyright (c) 1996 Russell King.
+ * Copyright (C) 1996 Russell King.
*
- * Changelog:
- * 27-06-1996 RMK Created
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 27-06-1996 RMK Created
*/
#ifndef __ASM_ARM_MMU_CONTEXT_H
#define __ASM_ARM_MMU_CONTEXT_H
@@ -17,9 +21,19 @@
#define destroy_context(mm) do { } while(0)
#define init_new_context(tsk,mm) 0
+/*
+ * This is called when "tsk" is about to enter lazy TLB mode.
+ *
+ * mm: describes the currently active mm context
+ * tsk: task which is entering lazy tlb
+ * cpu: cpu number which is entering lazy tlb
+ *
+ * tsk->mm will be NULL
+ */
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
{
}
+
/*
* This is the actual mm switch as far as the scheduler
* is concerned. No registers are touched.
diff --git a/include/asm-arm/mmzone.h b/include/asm-arm/mmzone.h
index 97ddd9718..a8b0977c3 100644
--- a/include/asm-arm/mmzone.h
+++ b/include/asm-arm/mmzone.h
@@ -1,9 +1,12 @@
/*
- * linux/include/asm-arm/mmzone.h
+ * linux/include/asm-arm/mmzone.h
*
- * 1999-12-29 Nicolas Pitre Created
+ * 1999-12-29 Nicolas Pitre Created
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
-
#ifndef __ASM_MMZONE_H
#define __ASM_MMZONE_H
diff --git a/include/asm-arm/param.h b/include/asm-arm/param.h
index 0e944f375..992a9d6a5 100644
--- a/include/asm-arm/param.h
+++ b/include/asm-arm/param.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/param.h
+ * linux/include/asm-arm/param.h
*
- * Copyright (C) 1995-1999 Russell King
+ * Copyright (C) 1995-1999 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_PARAM_H
#define __ASM_PARAM_H
diff --git a/include/asm-arm/parport.h b/include/asm-arm/parport.h
index bab49ad3a..f2f90c76d 100644
--- a/include/asm-arm/parport.h
+++ b/include/asm-arm/parport.h
@@ -1,7 +1,7 @@
/*
- * parport.h: ARM-specific parport initialisation
+ * linux/include/asm-arm/parport.h: ARM-specific parport initialisation
*
- * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
+ * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
*
* This file should only be included by drivers/parport/parport_pc.c.
*/
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
index 2a2fcc947..63c1ee9cf 100644
--- a/include/asm-arm/pci.h
+++ b/include/asm-arm/pci.h
@@ -93,8 +93,10 @@ pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int directi
{
int i;
- for (i = 0; i < nents; i++, sg++)
+ for (i = 0; i < nents; i++, sg++) {
consistent_sync(sg->address, sg->length, direction);
+ sg->dma_address = virt_to_bus(sg->address);
+ }
return nents;
}
@@ -136,7 +138,7 @@ pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int d
int i;
for (i = 0; i < nelems; i++, sg++)
- consistent_sync(sg->address, sg->length, 3);
+ consistent_sync(sg->address, sg->length, direction);
}
/* Return whether the given PCI device DMA address mask can
@@ -149,15 +151,6 @@ extern inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask)
return 1;
}
-/* These macros should be used after a pci_map_sg call has been done
- * to get bus addresses of each of the SG entries and their lengths.
- * You should only work with the number of sg entries pci_map_sg
- * returns, or alternatively stop on the first sg_dma_len(sg) which
- * is 0.
- */
-#define sg_dma_address(sg) (virt_to_bus((sg)->address))
-#define sg_dma_len(sg) ((sg)->length)
-
#endif /* __KERNEL__ */
#endif
diff --git a/include/asm-arm/pgalloc.h b/include/asm-arm/pgalloc.h
index a16a0d54c..280009ecf 100644
--- a/include/asm-arm/pgalloc.h
+++ b/include/asm-arm/pgalloc.h
@@ -1,5 +1,11 @@
/*
- * linux/include/asm-arm/pgalloc.h
+ * linux/include/asm-arm/pgalloc.h
+ *
+ * Copyright (C) 2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef _ASMARM_PGALLOC_H
#define _ASMARM_PGALLOC_H
@@ -13,11 +19,10 @@
*/
#include <asm/proc/cache.h>
-extern __inline__ void flush_tlb_pgtables(struct mm_struct *mm,
- unsigned long start,
- unsigned long end)
-{
-}
+/*
+ * ARM processors do not cache TLB tables in RAM.
+ */
+#define flush_tlb_pgtables(mm,start,end) do { } while (0)
/*
* Page table cache stuff
@@ -50,7 +55,7 @@ extern __inline__ pgd_t *get_pgd_fast(void)
if ((ret = pgd_quicklist) != NULL) {
pgd_quicklist = (unsigned long *)__pgd_next(ret);
ret[1] = ret[2];
- clean_cache_area(ret + 1, 4);
+ clean_dcache_entry(ret + 1);
pgtable_cache_size--;
}
return (pgd_t *)ret;
@@ -77,7 +82,7 @@ extern __inline__ pte_t *get_pte_fast(void)
if((ret = pte_quicklist) != NULL) {
pte_quicklist = (unsigned long *)__pte_next(ret);
ret[0] = ret[1];
- clean_cache_area(ret, 4);
+ clean_dcache_entry(ret);
pgtable_cache_size--;
}
return (pte_t *)ret;
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index 65b39ad72..a18b26035 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -1,5 +1,11 @@
/*
- * linux/include/asm-arm/pgtable.h
+ * linux/include/asm-arm/pgtable.h
+ *
+ * Copyright (C) 2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef _ASMARM_PGTABLE_H
#define _ASMARM_PGTABLE_H
@@ -88,7 +94,7 @@ extern void __handle_bad_pmd_kernel(pmd_t *pmd);
* which, if __va and __pa are expensive causes twice the expense for
* zero gain. --rmk
*/
-#define pte_page(x) (mem_map + MAP_NR(__va(pte_val((x)))))
+#define pte_page(x) (virt_to_page(__va(pte_val((x)))))
#endif
#define pmd_none(pmd) (!pmd_val(pmd))
@@ -173,6 +179,10 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
#define module_map vmalloc
#define module_unmap vfree
+/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
+/* FIXME: this is not correct */
+#define kern_addr_valid(addr) (1)
+
#define io_remap_page_range remap_page_range
#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-arm/posix_types.h b/include/asm-arm/posix_types.h
index 8ad590dd4..c412486db 100644
--- a/include/asm-arm/posix_types.h
+++ b/include/asm-arm/posix_types.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/posix_types.h
+ * linux/include/asm-arm/posix_types.h
*
- * Copyright (c) 1996-1998 Russell King.
+ * Copyright (C) 1996-1998 Russell King.
*
- * Changelog:
- * 27-06-1996 RMK Created
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 27-06-1996 RMK Created
*/
#ifndef __ARCH_ARM_POSIX_TYPES_H
#define __ARCH_ARM_POSIX_TYPES_H
diff --git a/include/asm-arm/proc-armo/assembler.h b/include/asm-arm/proc-armo/assembler.h
index 42b23aa89..7f6bd57cb 100644
--- a/include/asm-arm/proc-armo/assembler.h
+++ b/include/asm-arm/proc-armo/assembler.h
@@ -1,10 +1,14 @@
/*
- * linux/asm-arm/proc-armo/assembler.h
+ * linux/asm-arm/proc-armo/assembler.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
*
- * This file contains arm architecture specific defines
- * for the different processors
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This file contains arm architecture specific defines
+ * for the different processors
*/
#define MODE_USR USR26_MODE
#define MODE_FIQ FIQ26_MODE
@@ -78,3 +82,25 @@
.macro restore_irqs, oldcpsr
@ This be restore_irqs
.endm
+
+/*
+ * These two are used to save LR/restore PC over a user-based access.
+ * The old 26-bit architecture requires that we do. On 32-bit
+ * architecture, we can safely ignore this requirement.
+ */
+ .macro save_lr
+ str lr, [sp, #-4]!
+ .endm
+
+ .macro restore_pc
+ ldmfd sp!, {pc}^
+ .endm
+
+#define USER(x...) \
+9999: x; \
+ .section __ex_table,"a"; \
+ .align 3; \
+ .long 9999b,9001f; \
+ .previous
+
+
diff --git a/include/asm-arm/proc-armo/cache.h b/include/asm-arm/proc-armo/cache.h
index ca99bcf82..5331a13ce 100644
--- a/include/asm-arm/proc-armo/cache.h
+++ b/include/asm-arm/proc-armo/cache.h
@@ -1,14 +1,29 @@
/*
- * Cache flushing...
+ * linux/include/asm-arm/proc-armo/cache.h
+ *
+ * Copyright (C) 1999-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Cache handling for 26-bit ARM processors.
*/
#define flush_cache_all() do { } while (0)
#define flush_cache_mm(mm) do { } while (0)
#define flush_cache_range(mm,start,end) do { } while (0)
#define flush_cache_page(vma,vmaddr) do { } while (0)
#define flush_page_to_ram(page) do { } while (0)
+
+#define invalidate_dcache_range(start,end) do { } while (0)
+#define clean_dcache_range(start,end) do { } while (0)
+#define flush_dcache_range(start,end) do { } while (0)
#define flush_dcache_page(page) do { } while (0)
-#define flush_icache_page(vma,page) do { } while (0)
+#define clean_dcache_entry(_s) do { } while (0)
+#define clean_cache_entry(_start) do { } while (0)
+
#define flush_icache_range(start,end) do { } while (0)
+#define flush_icache_page(vma,page) do { } while (0)
/* DAG: ARM3 will flush cache on MEMC updates anyway? so don't bother */
#define clean_cache_area(_start,_size) do { } while (0)
@@ -67,6 +82,3 @@ memc_clear(struct mm_struct *mm, struct page *page)
if (mm == current->active_mm)
processor._set_pgd(mm->pgd);
}
-
-#define __flush_entry_to_ram(entry)
-
diff --git a/include/asm-arm/proc-armo/io.h b/include/asm-arm/proc-armo/io.h
deleted file mode 100644
index 84143003e..000000000
--- a/include/asm-arm/proc-armo/io.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * linux/include/asm-arm/proc-armo/io.h
- */
-
-/* Nothing to do */
-#define dma_cache_inv(_start,_size) do { } while (0)
-#define dma_cache_wback(_start,_size) do { } while (0)
-#define dma_cache_wback_inv(_start,_size) do { } while (0)
diff --git a/include/asm-arm/proc-armo/locks.h b/include/asm-arm/proc-armo/locks.h
index fcf0cab01..cbbb5f54e 100644
--- a/include/asm-arm/proc-armo/locks.h
+++ b/include/asm-arm/proc-armo/locks.h
@@ -1,11 +1,14 @@
/*
- * linux/include/asm-arm/proc-armo/locks.h
+ * linux/include/asm-arm/proc-armo/locks.h
*
- * Copyright (C) 2000 Russell King
- * Fixes for 26 bit machines, (C) 2000 Dave Gilbert
+ * Copyright (C) 2000 Russell King
+ * Fixes for 26 bit machines, (C) 2000 Dave Gilbert
*
- * Interrupt safe locking assembler.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*
+ * Interrupt safe locking assembler.
*/
#ifndef __ASM_PROC_LOCKS_H
#define __ASM_PROC_LOCKS_H
@@ -15,20 +18,20 @@
({ \
__asm__ __volatile__ ( \
"@ atomic down operation\n" \
-" mov r0, pc\n" \
-" orr lr, r0, #0x08000000\n" \
+" mov ip, pc\n" \
+" orr lr, ip, #0x08000000\n" \
" teqp lr, #0\n" \
" ldr lr, [%0]\n" \
-" and r0, r0, #0x0c000003\n" \
+" and ip, ip, #0x0c000003\n" \
" subs lr, lr, #1\n" \
" str lr, [%0]\n" \
-" orrmi r0, r0, #0x80000000 @ set N\n" \
-" teqp r0, #0\n" \
-" movmi r0, %0\n" \
+" orrmi ip, ip, #0x80000000 @ set N\n" \
+" teqp ip, #0\n" \
+" movmi ip, %0\n" \
" blmi " SYMBOL_NAME_STR(fail) \
: \
: "r" (ptr) \
- : "r0", "lr", "cc"); \
+ : "ip", "lr", "cc"); \
})
#define __down_op_ret(ptr,fail) \
@@ -36,22 +39,22 @@
unsigned int result; \
__asm__ __volatile__ ( \
" @ down_op_ret\n" \
-" mov r0, pc\n" \
-" orr lr, r0, #0x08000000\n" \
+" mov ip, pc\n" \
+" orr lr, ip, #0x08000000\n" \
" teqp lr, #0\n" \
" ldr lr, [%1]\n" \
-" and r0, r0, #0x0c000003\n" \
+" and ip, ip, #0x0c000003\n" \
" subs lr, lr, #1\n" \
" str lr, [%1]\n" \
-" orrmi r0, r0, #0x80000000 @ set N\n" \
-" teqp r0, #0\n" \
-" movmi r0, %1\n" \
-" movpl r0, #0\n" \
+" orrmi ip, ip, #0x80000000 @ set N\n" \
+" teqp ip, #0\n" \
+" movmi ip, %1\n" \
+" movpl ip, #0\n" \
" blmi " SYMBOL_NAME_STR(fail) "\n" \
-" mov %0, r0" \
+" mov %0, ip" \
: "=&r" (result) \
: "r" (ptr) \
- : "r0", "lr", "cc"); \
+ : "ip", "lr", "cc"); \
result; \
})
@@ -59,20 +62,20 @@
({ \
__asm__ __volatile__ ( \
"@ up_op\n" \
-" mov r0, pc\n" \
-" orr lr, r0, #0x08000000\n" \
+" mov ip, pc\n" \
+" orr lr, ip, #0x08000000\n" \
" teqp lr, #0\n" \
" ldr lr, [%0]\n" \
-" and r0, r0, #0x0c000003\n" \
+" and ip, ip, #0x0c000003\n" \
" adds lr, lr, #1\n" \
" str lr, [%0]\n" \
-" orrle r0, r0, #0x80000000 @ set N - should this be mi ??? DAG ! \n" \
-" teqp r0, #0\n" \
-" movmi r0, %0\n" \
+" orrle ip, ip, #0x80000000 @ set N - should this be mi ??? DAG ! \n" \
+" teqp ip, #0\n" \
+" movmi ip, %0\n" \
" blmi " SYMBOL_NAME_STR(wake) \
: \
: "r" (ptr) \
- : "r0", "lr", "cc"); \
+ : "ip", "lr", "cc"); \
})
/*
@@ -89,22 +92,22 @@
({ \
__asm__ __volatile__( \
"@ down_op_write\n" \
-" mov r0, pc\n" \
-" orr lr, r0, #0x08000000\n" \
+" mov ip, pc\n" \
+" orr lr, ip, #0x08000000\n" \
" teqp lr, #0\n" \
-" and r0, r0, #0x0c000003\n" \
+" and ip, ip, #0x0c000003\n" \
\
" ldr lr, [%0]\n" \
" subs lr, lr, %1\n" \
" str lr, [%0]\n" \
\
-" orreq r0, r0, #0x40000000 @ set Z \n"\
-" teqp r0, #0\n" \
-" movne r0, %0\n" \
+" orreq ip, ip, #0x40000000 @ set Z \n"\
+" teqp ip, #0\n" \
+" movne ip, %0\n" \
" blne " SYMBOL_NAME_STR(fail) \
: \
: "r" (ptr), "I" (RW_LOCK_BIAS) \
- : "r0", "lr", "cc"); \
+ : "ip", "lr", "cc"); \
})
/* Increments by RW_LOCK_BIAS, wakes if value >= 0 */
@@ -112,22 +115,22 @@
({ \
__asm__ __volatile__( \
"@ up_op_read\n" \
-" mov r0, pc\n" \
-" orr lr, r0, #0x08000000\n" \
+" mov ip, pc\n" \
+" orr lr, ip, #0x08000000\n" \
" teqp lr, #0\n" \
\
" ldr lr, [%0]\n" \
-" and r0, r0, #0x0c000003\n" \
+" and ip, ip, #0x0c000003\n" \
" adds lr, lr, %1\n" \
" str lr, [%0]\n" \
\
-" orrcs r0, r0, #0x20000000 @ set C\n" \
-" teqp r0, #0\n" \
-" movcs r0, %0\n" \
+" orrcs ip, ip, #0x20000000 @ set C\n" \
+" teqp ip, #0\n" \
+" movcs ip, %0\n" \
" blcs " SYMBOL_NAME_STR(wake) \
: \
: "r" (ptr), "I" (RW_LOCK_BIAS) \
- : "r0", "lr", "cc"); \
+ : "ip", "lr", "cc"); \
})
#define __down_op_read(ptr,fail) \
@@ -137,22 +140,22 @@
({ \
__asm__ __volatile__( \
"@ up_op_read\n" \
-" mov r0, pc\n" \
-" orr lr, r0, #0x08000000\n" \
+" mov ip, pc\n" \
+" orr lr, ip, #0x08000000\n" \
" teqp lr, #0\n" \
\
" ldr lr, [%0]\n" \
-" and r0, r0, #0x0c000003\n" \
+" and ip, ip, #0x0c000003\n" \
" adds lr, lr, %1\n" \
" str lr, [%0]\n" \
\
-" orreq r0, r0, #0x40000000 @ Set Z \n" \
-" teqp r0, #0\n" \
-" moveq r0, %0\n" \
+" orreq ip, ip, #0x40000000 @ Set Z \n" \
+" teqp ip, #0\n" \
+" moveq ip, %0\n" \
" bleq " SYMBOL_NAME_STR(wake) \
: \
: "r" (ptr), "I" (1) \
- : "r0", "lr", "cc"); \
+ : "ip", "lr", "cc"); \
})
#endif
diff --git a/include/asm-arm/proc-armo/page.h b/include/asm-arm/proc-armo/page.h
index dd3331994..b1abf388e 100644
--- a/include/asm-arm/proc-armo/page.h
+++ b/include/asm-arm/proc-armo/page.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/proc-armo/page.h
+ * linux/include/asm-arm/proc-armo/page.h
*
- * Copyright (C) 1995, 1996 Russell King
+ * Copyright (C) 1995, 1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_PROC_PAGE_H
#define __ASM_PROC_PAGE_H
diff --git a/include/asm-arm/proc-armo/pgtable.h b/include/asm-arm/proc-armo/pgtable.h
index 56456e0e1..12dc2cee0 100644
--- a/include/asm-arm/proc-armo/pgtable.h
+++ b/include/asm-arm/proc-armo/pgtable.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/proc-armo/pgtable.h
+ * linux/include/asm-arm/proc-armo/pgtable.h
*
- * Copyright (C) 1995-1999 Russell King
+ * Copyright (C) 1995-1999 Russell King
*
- * 18-Oct-1997 RMK Now two-level (32x32)
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 18-Oct-1997 RMK Now two-level (32x32)
*/
#ifndef __ASM_PROC_PGTABLE_H
#define __ASM_PROC_PGTABLE_H
diff --git a/include/asm-arm/proc-armo/processor.h b/include/asm-arm/proc-armo/processor.h
index 6562ee712..581236378 100644
--- a/include/asm-arm/proc-armo/processor.h
+++ b/include/asm-arm/proc-armo/processor.h
@@ -1,16 +1,20 @@
/*
- * linux/include/asm-arm/proc-armo/processor.h
+ * linux/include/asm-arm/proc-armo/processor.h
*
- * Copyright (c) 1996 Russell King.
+ * Copyright (C) 1996 Russell King.
*
- * Changelog:
- * 27-06-1996 RMK Created
- * 10-10-1996 RMK Brought up to date with SA110
- * 26-09-1996 RMK Added 'EXTRA_THREAD_STRUCT*'
- * 28-09-1996 RMK Moved start_thread into the processor dependencies
- * 11-01-1998 RMK Added new uaccess_t
- * 09-09-1998 PJB Delete redundant `wp_works_ok'
- * 30-05-1999 PJB Save sl across context switches
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 27-06-1996 RMK Created
+ * 10-10-1996 RMK Brought up to date with SA110
+ * 26-09-1996 RMK Added 'EXTRA_THREAD_STRUCT*'
+ * 28-09-1996 RMK Moved start_thread into the processor dependencies
+ * 11-01-1998 RMK Added new uaccess_t
+ * 09-09-1998 PJB Delete redundant `wp_works_ok'
+ * 30-05-1999 PJB Save sl across context switches
*/
#ifndef __ASM_PROC_PROCESSOR_H
#define __ASM_PROC_PROCESSOR_H
diff --git a/include/asm-arm/proc-armo/ptrace.h b/include/asm-arm/proc-armo/ptrace.h
index 9bf506501..287f258c1 100644
--- a/include/asm-arm/proc-armo/ptrace.h
+++ b/include/asm-arm/proc-armo/ptrace.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/proc-armo/ptrace.h
+ * linux/include/asm-arm/proc-armo/ptrace.h
*
- * Copyright (C) 1996-1999 Russell King
+ * Copyright (C) 1996-1999 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_PROC_PTRACE_H
#define __ASM_PROC_PTRACE_H
@@ -54,6 +58,8 @@ struct pt_regs {
#define user_mode(regs) \
(processor_mode(regs) == USR26_MODE)
+#define thumb_mode(regs) (0)
+
#define interrupts_enabled(regs) \
(!((regs)->ARM_pc & I_BIT))
diff --git a/include/asm-arm/proc-armo/shmparam.h b/include/asm-arm/proc-armo/shmparam.h
index e85eadb3f..6b106f141 100644
--- a/include/asm-arm/proc-armo/shmparam.h
+++ b/include/asm-arm/proc-armo/shmparam.h
@@ -1,11 +1,14 @@
/*
- * linux/include/asm-arm/proc-armo/shmparam.h
+ * linux/include/asm-arm/proc-armo/shmparam.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
*
- * definitions for the shared process memory on the ARM3
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * definitions for the shared process memory on the ARM3
*/
-
#ifndef __ASM_PROC_SHMPARAM_H
#define __ASM_PROC_SHMPARAM_H
diff --git a/include/asm-arm/proc-armo/system.h b/include/asm-arm/proc-armo/system.h
index 42a6bc70a..1ba35108c 100644
--- a/include/asm-arm/proc-armo/system.h
+++ b/include/asm-arm/proc-armo/system.h
@@ -1,9 +1,12 @@
/*
- * linux/include/asm-arm/proc-armo/system.h
+ * linux/include/asm-arm/proc-armo/system.h
*
- * Copyright (C) 1995, 1996 Russell King
+ * Copyright (C) 1995, 1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
-
#ifndef __ASM_PROC_SYSTEM_H
#define __ASM_PROC_SYSTEM_H
diff --git a/include/asm-arm/proc-armo/uaccess.h b/include/asm-arm/proc-armo/uaccess.h
index 7e1a62c5e..d3e733d87 100644
--- a/include/asm-arm/proc-armo/uaccess.h
+++ b/include/asm-arm/proc-armo/uaccess.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/proc-armo/segment.h
+ * linux/include/asm-arm/proc-armo/segment.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
/*
diff --git a/include/asm-arm/proc-armo/uncompress.h b/include/asm-arm/proc-armo/uncompress.h
index b4edb06f7..26a8747d2 100644
--- a/include/asm-arm/proc-armo/uncompress.h
+++ b/include/asm-arm/proc-armo/uncompress.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/proc-armo/uncompress.h
+ * linux/include/asm-arm/proc-armo/uncompress.h
*
- * (c) 1997 Russell King
+ * Copyright (C) 1997 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#define proc_decomp_setup()
diff --git a/include/asm-arm/proc-armv/assembler.h b/include/asm-arm/proc-armv/assembler.h
index aaec7f9c7..6881898f5 100644
--- a/include/asm-arm/proc-armv/assembler.h
+++ b/include/asm-arm/proc-armv/assembler.h
@@ -1,10 +1,14 @@
/*
- * linux/asm-arm/proc-armv/assembler.h
+ * linux/asm-arm/proc-armv/assembler.h
*
- * Copyright (C) 1996-2000 Russell King
+ * Copyright (C) 1996-2000 Russell King
*
- * This file contains ARM processor specifics for
- * the ARM6 and better processors.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This file contains ARM processor specifics for
+ * the ARM6 and better processors.
*/
#define MODE_USR USR_MODE
#define MODE_FIQ FIQ_MODE
@@ -47,3 +51,24 @@
.macro restore_irqs, oldcpsr
msr cpsr_c, \oldcpsr
.endm
+
+/*
+ * These two are used to save LR/restore PC over a user-based access.
+ * The old 26-bit architecture requires that we do. On 32-bit
+ * architecture, we can safely ignore this requirement.
+ */
+ .macro save_lr
+ .endm
+
+ .macro restore_pc
+ mov pc, lr
+ .endm
+
+#define USER(x...) \
+9999: x; \
+ .section __ex_table,"a"; \
+ .align 3; \
+ .long 9999b,9001f; \
+ .previous
+
+
diff --git a/include/asm-arm/proc-armv/cache.h b/include/asm-arm/proc-armv/cache.h
index dbdc10f6b..806856347 100644
--- a/include/asm-arm/proc-armv/cache.h
+++ b/include/asm-arm/proc-armv/cache.h
@@ -1,57 +1,98 @@
+/*
+ * linux/include/asm-arm/proc-armv/cache.h
+ *
+ * Copyright (C) 1999-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
#include <asm/mman.h>
/*
- * Cache flushing...
+ * Cache handling for 32-bit ARM processors.
+ *
+ * Note that on ARM, we have a more accurate specification than that
+ * Linux's "flush". We therefore do not use "flush" here, but instead
+ * use:
+ *
+ * clean: the act of pushing dirty cache entries out to memory.
+ * invalidate: the act of discarding data held within the cache,
+ * whether it is dirty or not.
+ */
+
+/*
+ * Generic I + D cache
*/
#define flush_cache_all() \
- cpu_flush_cache_all()
+ do { \
+ cpu_cache_clean_invalidate_all(); \
+ } while (0)
+/* This is always called for current->mm */
#define flush_cache_mm(_mm) \
do { \
- if ((_mm) == current->mm) \
- cpu_flush_cache_all(); \
+ if ((_mm) == current->active_mm) \
+ cpu_cache_clean_invalidate_all(); \
} while (0)
#define flush_cache_range(_mm,_start,_end) \
do { \
if ((_mm) == current->mm) \
- cpu_flush_cache_area((_start), (_end), 1); \
+ cpu_cache_clean_invalidate_range((_start), (_end), 1); \
} while (0)
#define flush_cache_page(_vma,_vmaddr) \
do { \
- if ((_vma)->vm_mm == current->mm) \
- cpu_flush_cache_area((_vmaddr), \
+ if ((_vma)->vm_mm == current->mm) { \
+ cpu_cache_clean_invalidate_range((_vmaddr), \
(_vmaddr) + PAGE_SIZE, \
((_vma)->vm_flags & VM_EXEC)); \
+ } \
} while (0)
-#define clean_cache_range(_start,_end) \
- do { \
- unsigned long _s, _sz; \
- _s = (unsigned long)_start; \
- _sz = (unsigned long)_end - _s; \
- cpu_clean_cache_area(_s, _sz); \
- } while (0)
+/*
+ * This flushes back any buffered write data. We have to clean the entries
+ * in the cache for this page. This does not invalidate either I or D caches.
+ */
+static __inline__ void flush_page_to_ram(struct page *page)
+{
+ cpu_flush_ram_page(page_address(page));
+}
+
+/*
+ * D cache only
+ */
+
+#define invalidate_dcache_range(_s,_e) cpu_dcache_invalidate_range((_s),(_e))
+#define clean_dcache_range(_s,_e) cpu_dcache_clean_range((_s),(_e))
+#define flush_dcache_range(_s,_e) cpu_cache_clean_invalidate_range((_s),(_e),0)
+
+/*
+ * FIXME: We currently clean the dcache for this page. Should we
+ * also invalidate the Dcache? And what about the Icache? -- rmk
+ */
+#define flush_dcache_page(page) cpu_dcache_clean_page(page_address(page))
+
+#define clean_dcache_entry(_s) cpu_dcache_clean_entry((unsigned long)(_s))
-#define clean_cache_area(_start,_size) \
+/*
+ * I cache only
+ */
+#define flush_icache_range(_s,_e) \
do { \
- unsigned long _s; \
- _s = (unsigned long)_start; \
- cpu_clean_cache_area(_s, _size); \
+ cpu_icache_invalidate_range((_s), (_e)); \
} while (0)
-#define flush_icache_range(_start,_end) \
- cpu_flush_icache_area((_start), (_end) - (_start))
-
#define flush_icache_page(vma,pg) \
do { \
if ((vma)->vm_flags & PROT_EXEC) \
- cpu_flush_icache_page((unsigned long) page_address(pg)); \
+ cpu_icache_invalidate_page(page_address(pg)); \
} while (0)
/*
- * We don't have a MEMC chip...
+ * Old ARM MEMC stuff. This supports the reversed mapping handling that
+ * we have on the older 26-bit machines. We don't have a MEMC chip, so...
*/
#define memc_update_all() do { } while (0)
#define memc_update_mm(mm) do { } while (0)
@@ -59,48 +100,57 @@
#define memc_clear(mm,physaddr) do { } while (0)
/*
- * This flushes back any buffered write data. We have to clean the entries
- * in the cache for this page. This does not invalidate either I or D caches.
- */
-static __inline__ void flush_page_to_ram(struct page *page)
-{
- cpu_flush_ram_page((unsigned long) page_address(page));
-}
-
-/* You guys might need to do something here. -DaveM */
-#define flush_dcache_page(page) do { } while (0)
-
-/*
- * TLB flushing:
+ * TLB flushing.
*
- * - flush_tlb_all() flushes all processes TLBs
- * - flush_tlb_mm(mm) flushes the specified mm context TLB's
- * - flush_tlb_page(vma, vmaddr) flushes one page
- * - flush_tlb_range(mm, start, end) flushes a range of pages
+ * - flush_tlb_all() flushes all processes TLBs
+ * - flush_tlb_mm(mm) flushes the specified mm context TLB's
+ * - flush_tlb_page(vma, vmaddr) flushes TLB for specified page
+ * - flush_tlb_range(mm, start, end) flushes TLB for specified range of pages
*
* We drain the write buffer in here to ensure that the page tables in ram
* are really up to date. It is more efficient to do this here...
*/
-#define flush_tlb_all() \
- cpu_flush_tlb_all()
-#define flush_tlb_mm(_mm) \
- do { \
- if ((_mm) == current->mm) \
- cpu_flush_tlb_all(); \
+/*
+ * Notes:
+ * current->active_mm is the currently active memory description.
+ * current->mm == NULL iff we are lazy.
+ */
+#define flush_tlb_all() \
+ do { \
+ cpu_tlb_invalidate_all(); \
} while (0)
-#define flush_tlb_range(_mm,_start,_end) \
- do { \
- if ((_mm) == current->mm) \
- cpu_flush_tlb_area((_start), (_end), 1); \
+/*
+ * Flush all user virtual address space translations described by `_mm'.
+ *
+ * Currently, this is always called for current->mm, which should be
+ * the same as current->active_mm. This is currently not be called for
+ * the lazy TLB case.
+ */
+#define flush_tlb_mm(_mm) \
+ do { \
+ if ((_mm) == current->active_mm) \
+ cpu_tlb_invalidate_all(); \
} while (0)
-#define flush_tlb_page(_vma,_vmaddr) \
- do { \
- if ((_vma)->vm_mm == current->mm) \
- cpu_flush_tlb_page((_vmaddr), \
- ((_vma)->vm_flags & VM_EXEC)); \
+/*
+ * Flush the specified range of user virtual address space translations.
+ *
+ * _mm may not be current->active_mm, but may not be NULL.
+ */
+#define flush_tlb_range(_mm,_start,_end) \
+ do { \
+ if ((_mm) == current->active_mm) \
+ cpu_tlb_invalidate_range((_start), (_end)); \
} while (0)
-
+/*
+ * Flush the specified user virtual address space translation.
+ */
+#define flush_tlb_page(_vma,_page) \
+ do { \
+ if ((_vma)->vm_mm == current->active_mm) \
+ cpu_tlb_invalidate_page((_page), \
+ ((_vma)->vm_flags & VM_EXEC)); \
+ } while (0)
diff --git a/include/asm-arm/proc-armv/domain.h b/include/asm-arm/proc-armv/domain.h
index 398fdce5c..aadc83187 100644
--- a/include/asm-arm/proc-armv/domain.h
+++ b/include/asm-arm/proc-armv/domain.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/proc-armv/domain.h
+ * linux/include/asm-arm/proc-armv/domain.h
*
- * Copyright (C) 1999 Russell King.
+ * Copyright (C) 1999 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_PROC_DOMAIN_H
#define __ASM_PROC_DOMAIN_H
diff --git a/include/asm-arm/proc-armv/io.h b/include/asm-arm/proc-armv/io.h
deleted file mode 100644
index 72f0593ef..000000000
--- a/include/asm-arm/proc-armv/io.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * linux/include/asm-arm/proc-armv/io.h
- */
-
-/*
- * The caches on some architectures aren't dma-coherent and have need to
- * handle this in software. There are two types of operations that
- * can be applied to dma buffers.
- *
- * - dma_cache_wback_inv(start, size) makes caches and RAM coherent by
- * writing the content of the caches back to memory, if necessary.
- * The function also invalidates the affected part of the caches as
- * necessary before DMA transfers from outside to memory.
- * - dma_cache_inv(start, size) invalidates the affected parts of the
- * caches. Dirty lines of the caches may be written back or simply
- * be discarded. This operation is necessary before dma operations
- * to the memory.
- * - dma_cache_wback(start, size) writes back any dirty lines but does
- * not invalidate the cache. This can be used before DMA reads from
- * memory,
- */
-
-#include <asm/proc-fns.h>
-
-#define dma_cache_inv(start, size) \
- do { cpu_cache_purge_area((unsigned long)(start), \
- ((unsigned long)(start)+(size))); } while (0)
-
-#define dma_cache_wback(start, size) \
- do { cpu_cache_wback_area((unsigned long)(start), \
- ((unsigned long)(start)+(size))); } while (0)
-
-#define dma_cache_wback_inv(start, size) \
- do { cpu_flush_cache_area((unsigned long)(start), \
- ((unsigned long)(start)+(size)), 0); } while (0)
diff --git a/include/asm-arm/proc-armv/locks.h b/include/asm-arm/proc-armv/locks.h
index 047f0ce16..865663322 100644
--- a/include/asm-arm/proc-armv/locks.h
+++ b/include/asm-arm/proc-armv/locks.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/proc-armv/locks.h
+ * linux/include/asm-arm/proc-armv/locks.h
*
- * Copyright (C) 2000 Russell King
+ * Copyright (C) 2000 Russell King
*
- * Interrupt safe locking assembler.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Interrupt safe locking assembler.
*/
#ifndef __ASM_PROC_LOCKS_H
#define __ASM_PROC_LOCKS_H
diff --git a/include/asm-arm/proc-armv/page.h b/include/asm-arm/proc-armv/page.h
index cd80dec3a..2317fce51 100644
--- a/include/asm-arm/proc-armv/page.h
+++ b/include/asm-arm/proc-armv/page.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/proc-armv/page.h
+ * linux/include/asm-arm/proc-armv/page.h
*
- * Copyright (C) 1995, 1996 Russell King
+ * Copyright (C) 1995, 1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_PROC_PAGE_H
#define __ASM_PROC_PAGE_H
diff --git a/include/asm-arm/proc-armv/pgtable.h b/include/asm-arm/proc-armv/pgtable.h
index b5d53a59e..2de66aabe 100644
--- a/include/asm-arm/proc-armv/pgtable.h
+++ b/include/asm-arm/proc-armv/pgtable.h
@@ -1,11 +1,15 @@
/*
- * linux/include/asm-arm/proc-armv/pgtable.h
+ * linux/include/asm-arm/proc-armv/pgtable.h
*
- * Copyright (C) 1995-1999 Russell King
+ * Copyright (C) 1995-1999 Russell King
*
- * 12-Jan-1997 RMK Altered flushing routines to use function pointers
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 12-Jan-1997 RMK Altered flushing routines to use function pointers
* now possible to combine ARM6, ARM7 and StrongARM versions.
- * 17-Apr-1999 RMK Now pass an area size to clean_cache_area and
+ * 17-Apr-1999 RMK Now pass an area size to clean_cache_area and
* flush_icache_area.
*/
#ifndef __ASM_PROC_PGTABLE_H
diff --git a/include/asm-arm/proc-armv/processor.h b/include/asm-arm/proc-armv/processor.h
index 9ddfd0028..ab7f31d65 100644
--- a/include/asm-arm/proc-armv/processor.h
+++ b/include/asm-arm/proc-armv/processor.h
@@ -1,15 +1,19 @@
/*
- * linux/include/asm-arm/proc-armv/processor.h
+ * linux/include/asm-arm/proc-armv/processor.h
*
- * Copyright (c) 1996-1999 Russell King.
+ * Copyright (C) 1996-1999 Russell King.
*
- * Changelog:
- * 20-09-1996 RMK Created
- * 26-09-1996 RMK Added 'EXTRA_THREAD_STRUCT*'
- * 28-09-1996 RMK Moved start_thread into the processor dependencies
- * 09-09-1998 PJB Delete redundant `wp_works_ok'
- * 30-05-1999 PJB Save sl across context switches
- * 31-07-1999 RMK Added 'domain' stuff
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 20-09-1996 RMK Created
+ * 26-09-1996 RMK Added 'EXTRA_THREAD_STRUCT*'
+ * 28-09-1996 RMK Moved start_thread into the processor dependencies
+ * 09-09-1998 PJB Delete redundant `wp_works_ok'
+ * 30-05-1999 PJB Save sl across context switches
+ * 31-07-1999 RMK Added 'domain' stuff
*/
#ifndef __ASM_PROC_PROCESSOR_H
#define __ASM_PROC_PROCESSOR_H
diff --git a/include/asm-arm/proc-armv/ptrace.h b/include/asm-arm/proc-armv/ptrace.h
index 362eac178..d15d5a6ec 100644
--- a/include/asm-arm/proc-armv/ptrace.h
+++ b/include/asm-arm/proc-armv/ptrace.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/proc-armv/ptrace.h
+ * linux/include/asm-arm/proc-armv/ptrace.h
*
- * Copyright (C) 1996-1999 Russell King
+ * Copyright (C) 1996-1999 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_PROC_PTRACE_H
#define __ASM_PROC_PTRACE_H
@@ -18,6 +22,7 @@
#define UND_MODE 0x1b
#define SYSTEM_MODE 0x1f
#define MODE_MASK 0x1f
+#define T_BIT 0x20
#define F_BIT 0x40
#define I_BIT 0x80
#define CC_V_BIT (1 << 28)
@@ -59,6 +64,9 @@ struct pt_regs {
#define user_mode(regs) \
(((regs)->ARM_cpsr & 0xf) == 0)
+#define thumb_mode(regs) \
+ (((regs)->ARM_cpsr & T_BIT))
+
#define processor_mode(regs) \
((regs)->ARM_cpsr & MODE_MASK)
diff --git a/include/asm-arm/proc-armv/shmparam.h b/include/asm-arm/proc-armv/shmparam.h
index 664b8deaf..5b692cc5b 100644
--- a/include/asm-arm/proc-armv/shmparam.h
+++ b/include/asm-arm/proc-armv/shmparam.h
@@ -1,12 +1,15 @@
/*
- * linux/include/asm-arm/proc-armv/shmparam.h
+ * linux/include/asm-arm/proc-armv/shmparam.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
*
- * definitions for the shared process memory on ARM v3 or v4
- * processors
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * definitions for the shared process memory on ARM v3 or v4
+ * processors
*/
-
#ifndef __ASM_PROC_SHMPARAM_H
#define __ASM_PROC_SHMPARAM_H
diff --git a/include/asm-arm/proc-armv/system.h b/include/asm-arm/proc-armv/system.h
index e05e6356f..247ed3e2b 100644
--- a/include/asm-arm/proc-armv/system.h
+++ b/include/asm-arm/proc-armv/system.h
@@ -1,9 +1,12 @@
/*
- * linux/include/asm-arm/proc-armv/system.h
+ * linux/include/asm-arm/proc-armv/system.h
*
- * Copyright (C) 1996 Russell King
+ * Copyright (C) 1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
-
#ifndef __ASM_PROC_SYSTEM_H
#define __ASM_PROC_SYSTEM_H
diff --git a/include/asm-arm/proc-armv/uaccess.h b/include/asm-arm/proc-armv/uaccess.h
index af146abf9..4baee9ce7 100644
--- a/include/asm-arm/proc-armv/uaccess.h
+++ b/include/asm-arm/proc-armv/uaccess.h
@@ -1,7 +1,10 @@
/*
- * linux/include/asm-arm/proc-armv/uaccess.h
+ * linux/include/asm-arm/proc-armv/uaccess.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
-
#include <asm/arch/memory.h>
#include <asm/proc/domain.h>
diff --git a/include/asm-arm/proc-armv/uncompress.h b/include/asm-arm/proc-armv/uncompress.h
index e67566d5d..bc41b2811 100644
--- a/include/asm-arm/proc-armv/uncompress.h
+++ b/include/asm-arm/proc-armv/uncompress.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/proc-armv/uncompress.h
+ * linux/include/asm-arm/proc-armv/uncompress.h
*
- * (c) 1997 Russell King
+ * Copyright (C) 1997 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
static inline void proc_decomp_setup (void)
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h
index 5e5f1e623..18008c510 100644
--- a/include/asm-arm/proc-fns.h
+++ b/include/asm-arm/proc-fns.h
@@ -1,7 +1,12 @@
/*
- * linux/include/asm-arm/proc-fns.h
+ * linux/include/asm-arm/proc-fns.h
*
- * Copyright (C) 1997-1999 Russell King
+ * Copyright (C) 1997-1999 Russell King
+ * Copyright (C) 2000 Deep Blue Solutions Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_PROCFNS_H
#define __ASM_PROCFNS_H
@@ -39,28 +44,36 @@
# define CPU_NAME arm7
# endif
# endif
-# ifdef CONFIG_CPU_SA110
+# ifdef CONFIG_CPU_ARM720
# ifdef CPU_NAME
# undef MULTI_CPU
# define MULTI_CPU
# else
-# define CPU_NAME sa110
+# define CPU_NAME arm720
# endif
# endif
-# ifdef CONFIG_CPU_SA1100
+# ifdef CONFIG_CPU_ARM920
# ifdef CPU_NAME
# undef MULTI_CPU
# define MULTI_CPU
# else
-# define CPU_NAME sa1100
+# define CPU_NAME arm920
# endif
# endif
-# ifdef CONFIG_CPU_ARM720
+# ifdef CONFIG_CPU_SA110
# ifdef CPU_NAME
# undef MULTI_CPU
# define MULTI_CPU
# else
-# define CPU_NAME arm720
+# define CPU_NAME sa110
+# endif
+# endif
+# ifdef CONFIG_CPU_SA1100
+# ifdef CPU_NAME
+# undef MULTI_CPU
+# define MULTI_CPU
+# else
+# define CPU_NAME sa1100
# endif
# endif
#endif
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h
index 462c9a8c0..cf21f2c1b 100644
--- a/include/asm-arm/processor.h
+++ b/include/asm-arm/processor.h
@@ -1,7 +1,11 @@
/*
- * include/asm-arm/processor.h
+ * linux/include/asm-arm/processor.h
*
- * Copyright (C) 1995 Russell King
+ * Copyright (C) 1995 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_ARM_PROCESSOR_H
diff --git a/include/asm-arm/procinfo.h b/include/asm-arm/procinfo.h
index 0e6fcd87f..5a07ca9d3 100644
--- a/include/asm-arm/procinfo.h
+++ b/include/asm-arm/procinfo.h
@@ -1,7 +1,11 @@
/*
- * linux/include/asm-arm/procinfo.h
+ * linux/include/asm-arm/procinfo.h
*
- * Copyright (C) 1996-1999 Russell King
+ * Copyright (C) 1996-1999 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
*/
#ifndef __ASM_PROCINFO_H
#define __ASM_PROCINFO_H
diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
index 3126767a4..ae4927937 100644
--- a/include/asm-arm/ptrace.h
+++ b/include/asm-arm/ptrace.h
@@ -3,11 +3,6 @@
#include <asm/proc/ptrace.h>
-#define PTRACE_GETREGS 12
-#define PTRACE_SETREGS 13
-#define PTRACE_GETFPREGS 14
-#define PTRACE_SETFPREGS 15
-
#ifndef __ASSEMBLY__
#define pc_pointer(v) \
((v) & ~PCMASK)
@@ -16,6 +11,11 @@
(pc_pointer((regs)->ARM_pc))
#ifdef __KERNEL__
+#define PTRACE_GETREGS 12
+#define PTRACE_SETREGS 13
+#define PTRACE_GETFPREGS 14
+#define PTRACE_SETFPREGS 15
+
extern void show_regs(struct pt_regs *);
#define predicate(x) (x & 0xf0000000)
diff --git a/include/asm-arm/resource.h b/include/asm-arm/resource.h
index 8a26bc85d..9da87b622 100644
--- a/include/asm-arm/resource.h
+++ b/include/asm-arm/resource.h
@@ -15,8 +15,9 @@
#define RLIMIT_NOFILE 7 /* max number of open files */
#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
#define RLIMIT_AS 9 /* address space limit */
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
-#define RLIM_NLIMITS 10
+#define RLIM_NLIMITS 11
#ifdef __KERNEL__
@@ -38,6 +39,7 @@
{ INR_OPEN, INR_OPEN }, \
{ RLIM_INFINITY, RLIM_INFINITY }, \
{ RLIM_INFINITY, RLIM_INFINITY }, \
+ { RLIM_INFINITY, RLIM_INFINITY }, \
}
#endif /* __KERNEL__ */
diff --git a/include/asm-arm/scatterlist.h b/include/asm-arm/scatterlist.h
index 7d0175507..73260c410 100644
--- a/include/asm-arm/scatterlist.h
+++ b/include/asm-arm/scatterlist.h
@@ -1,13 +1,25 @@
#ifndef _ASMARM_SCATTERLIST_H
#define _ASMARM_SCATTERLIST_H
+#include <asm/types.h>
+
struct scatterlist {
- char * address; /* Location data is to be transferred to */
- char * alt_address; /* Location of actual if address is a
- * dma indirect buffer. NULL otherwise */
- unsigned int length;
+ char *address; /* virtual address */
+ char *alt_address; /* indirect dma address, or NULL */
+ dma_addr_t dma_address; /* dma address */
+ unsigned int length; /* length */
};
+/*
+ * These macros should be used after a pci_map_sg call has been done
+ * to get bus addresses of each of the SG entries and their lengths.
+ * You should only work with the number of sg entries pci_map_sg
+ * returns, or alternatively stop on the first sg_dma_len(sg) which
+ * is 0.
+ */
+#define sg_dma_address(sg) ((sg)->dma_address)
+#define sg_dma_len(sg) ((sg)->length)
+
#define ISA_DMA_THRESHOLD (0xffffffff)
#endif /* _ASMARM_SCATTERLIST_H */
diff --git a/include/asm-arm/serial.h b/include/asm-arm/serial.h
index 88d57fe07..1cce84a8c 100644
--- a/include/asm-arm/serial.h
+++ b/include/asm-arm/serial.h
@@ -1,10 +1,14 @@
/*
- * linux/include/asm-arm/serial.h
+ * linux/include/asm-arm/serial.h
*
- * Copyright (c) 1996 Russell King.
+ * Copyright (C) 1996 Russell King.
*
- * Changelog:
- * 15-10-1996 RMK Created
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Changelog:
+ * 15-10-1996 RMK Created
*/
#ifndef __ASM_SERIAL_H
diff --git a/include/asm-arm/setup.h b/include/asm-arm/setup.h
index f50c2f4e7..c067c9618 100644
--- a/include/asm-arm/setup.h
+++ b/include/asm-arm/setup.h
@@ -1,11 +1,15 @@
/*
- * include/asm/setup.h
+ * linux/include/asm/setup.h
*
- * Structure passed to kernel to tell it about the
- * hardware it's running on. See linux/Documentation/arm/Setup
- * for more info.
+ * Copyright (C) 1997-1999 Russell King
*
- * Copyright (C) 1997-1999 Russell King
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Structure passed to kernel to tell it about the
+ * hardware it's running on. See linux/Documentation/arm/Setup
+ * for more info.
*/
#ifndef __ASMARM_SETUP_H
#define __ASMARM_SETUP_H
diff --git a/include/asm-arm/shmparam.h b/include/asm-arm/shmparam.h
index 0b94f747d..4359852cc 100644
--- a/include/asm-arm/shmparam.h
+++ b/include/asm-arm/shmparam.h
@@ -3,6 +3,11 @@
#include <asm/proc/shmparam.h>
+/*
+ * This should be the size of the virtually indexed cache/ways,
+ * or page size, whichever is greater since the cache aliases
+ * every size/ways bytes.
+ */
#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
#endif /* _ASMARM_SHMPARAM_H */
diff --git a/include/asm-arm/timex.h b/include/asm-arm/timex.h
index d9a3303be..0713f0de6 100644
--- a/include/asm-arm/timex.h
+++ b/include/asm-arm/timex.h
@@ -1,9 +1,13 @@
/*
- * linux/include/asm-arm/timex.h
+ * linux/include/asm-arm/timex.h
*
- * Architecture Specific TIME specifications
+ * Copyright (C) 1997,1998 Russell King
*
- * Copyright (C) 1997,1998 Russell King
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Architecture Specific TIME specifications
*/
#ifndef _ASMARM_TIMEX_H
#define _ASMARM_TIMEX_H
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h
index add086e55..7e8040d73 100644
--- a/include/asm-arm/uaccess.h
+++ b/include/asm-arm/uaccess.h
@@ -59,9 +59,6 @@ extern __inline__ int verify_area(int type, const void * addr, unsigned long siz
* address space - it must have been done previously with a separate
* "access_ok()" call.
*
- * The "xxx_ret" versions return constant specified in the third
- * argument if something bad happens.
- *
* The "xxx_error" versions set the third argument to EFAULT if an
* error occurs, and leave it unchanged on success. Note that these
* versions are void (ie, don't return a value as such).
@@ -69,14 +66,10 @@ extern __inline__ int verify_area(int type, const void * addr, unsigned long siz
#define get_user(x,p) __get_user_check((x),(p),sizeof(*(p)))
#define __get_user(x,p) __get_user_nocheck((x),(p),sizeof(*(p)))
#define __get_user_error(x,p,e) __get_user_nocheck_error((x),(p),sizeof(*(p)),(e))
-#define get_user_ret(x,p,r) ({ if (get_user(x,p)) return r; })
-#define __get_user_ret(x,p,r) ({ if (__get_user(x,p)) return r; })
#define put_user(x,p) __put_user_check((__typeof(*(p)))(x),(p),sizeof(*(p)))
#define __put_user(x,p) __put_user_nocheck((__typeof(*(p)))(x),(p),sizeof(*(p)))
#define __put_user_error(x,p,e) __put_user_nocheck_error((x),(p),sizeof(*(p)),(e))
-#define put_user_ret(x,p,r) ({ if (put_user(x,p)) return r; })
-#define __put_user_ret(x,p,r) ({ if (__put_user(x,p)) return r; })
static __inline__ unsigned long copy_from_user(void *to, const void *from, unsigned long n)
{
@@ -91,9 +84,6 @@ static __inline__ unsigned long __copy_from_user(void *to, const void *from, uns
return n;
}
-#define copy_from_user_ret(t,f,n,r) \
- ({ if (copy_from_user(t,f,n)) return r; })
-
static __inline__ unsigned long copy_to_user(void *to, const void *from, unsigned long n)
{
if (access_ok(VERIFY_WRITE, to, n))
@@ -107,9 +97,6 @@ static __inline__ unsigned long __copy_to_user(void *to, const void *from, unsig
return n;
}
-#define copy_to_user_ret(t,f,n,r) \
- ({ if (copy_to_user(t,f,n)) return r; })
-
static __inline__ unsigned long clear_user (void *to, unsigned long n)
{
if (access_ok(VERIFY_WRITE, to, n))
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h
index 945ab9b5d..94a7ea264 100644
--- a/include/asm-i386/atomic.h
+++ b/include/asm-i386/atomic.h
@@ -19,102 +19,96 @@
* on us. We need to use _exactly_ the address the user gave us,
* not some alias that contains the same information.
*/
-#define __atomic_fool_gcc(x) (*(volatile struct { int a[100]; } *)x)
-
-#ifdef CONFIG_SMP
typedef struct { volatile int counter; } atomic_t;
-#else
-typedef struct { int counter; } atomic_t;
-#endif
#define ATOMIC_INIT(i) { (i) }
#define atomic_read(v) ((v)->counter)
#define atomic_set(v,i) (((v)->counter) = (i))
-static __inline__ void atomic_add(int i, volatile atomic_t *v)
+static __inline__ void atomic_add(int i, atomic_t *v)
{
__asm__ __volatile__(
LOCK "addl %1,%0"
- :"=m" (__atomic_fool_gcc(v))
- :"ir" (i), "m" (__atomic_fool_gcc(v)));
+ :"=m" (v->counter)
+ :"ir" (i), "m" (v->counter));
}
-static __inline__ void atomic_sub(int i, volatile atomic_t *v)
+static __inline__ void atomic_sub(int i, atomic_t *v)
{
__asm__ __volatile__(
LOCK "subl %1,%0"
- :"=m" (__atomic_fool_gcc(v))
- :"ir" (i), "m" (__atomic_fool_gcc(v)));
+ :"=m" (v->counter)
+ :"ir" (i), "m" (v->counter));
}
-static __inline__ int atomic_sub_and_test(int i, volatile atomic_t *v)
+static __inline__ int atomic_sub_and_test(int i, atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
LOCK "subl %2,%0; sete %1"
- :"=m" (__atomic_fool_gcc(v)), "=qm" (c)
- :"ir" (i), "m" (__atomic_fool_gcc(v)));
+ :"=m" (v->counter), "=qm" (c)
+ :"ir" (i), "m" (v->counter) : "memory");
return c;
}
-static __inline__ void atomic_inc(volatile atomic_t *v)
+static __inline__ void atomic_inc(atomic_t *v)
{
__asm__ __volatile__(
LOCK "incl %0"
- :"=m" (__atomic_fool_gcc(v))
- :"m" (__atomic_fool_gcc(v)));
+ :"=m" (v->counter)
+ :"m" (v->counter));
}
-static __inline__ void atomic_dec(volatile atomic_t *v)
+static __inline__ void atomic_dec(atomic_t *v)
{
__asm__ __volatile__(
LOCK "decl %0"
- :"=m" (__atomic_fool_gcc(v))
- :"m" (__atomic_fool_gcc(v)));
+ :"=m" (v->counter)
+ :"m" (v->counter));
}
-static __inline__ int atomic_dec_and_test(volatile atomic_t *v)
+static __inline__ int atomic_dec_and_test(atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
LOCK "decl %0; sete %1"
- :"=m" (__atomic_fool_gcc(v)), "=qm" (c)
- :"m" (__atomic_fool_gcc(v)));
+ :"=m" (v->counter), "=qm" (c)
+ :"m" (v->counter) : "memory");
return c != 0;
}
-static __inline__ int atomic_inc_and_test(volatile atomic_t *v)
+static __inline__ int atomic_inc_and_test(atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
LOCK "incl %0; sete %1"
- :"=m" (__atomic_fool_gcc(v)), "=qm" (c)
- :"m" (__atomic_fool_gcc(v)));
+ :"=m" (v->counter), "=qm" (c)
+ :"m" (v->counter) : "memory");
return c != 0;
}
-extern __inline__ int atomic_add_negative(int i, volatile atomic_t *v)
+static __inline__ int atomic_add_negative(int i, atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
LOCK "addl %2,%0; sets %1"
- :"=m" (__atomic_fool_gcc(v)), "=qm" (c)
- :"ir" (i), "m" (__atomic_fool_gcc(v)));
+ :"=m" (v->counter), "=qm" (c)
+ :"ir" (i), "m" (v->counter) : "memory");
return c;
}
/* These are x86-specific, used by some header files */
#define atomic_clear_mask(mask, addr) \
__asm__ __volatile__(LOCK "andl %0,%1" \
-: : "r" (~(mask)),"m" (__atomic_fool_gcc(addr)) : "memory")
+: : "r" (~(mask)),"m" (*addr) : "memory")
#define atomic_set_mask(mask, addr) \
__asm__ __volatile__(LOCK "orl %0,%1" \
-: : "r" (mask),"m" (__atomic_fool_gcc(addr)) : "memory")
+: : "r" (mask),"m" (*addr) : "memory")
#endif
diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h
index 18454e929..444f247c3 100644
--- a/include/asm-i386/bitops.h
+++ b/include/asm-i386/bitops.h
@@ -21,29 +21,9 @@
#define LOCK_PREFIX ""
#endif
-/*
- * Function prototypes to keep gcc -Wall happy
- */
-extern void set_bit(int nr, volatile void * addr);
-extern void clear_bit(int nr, volatile void * addr);
-extern void change_bit(int nr, volatile void * addr);
-extern int test_and_set_bit(int nr, volatile void * addr);
-extern int test_and_clear_bit(int nr, volatile void * addr);
-extern int test_and_change_bit(int nr, volatile void * addr);
-extern int __constant_test_bit(int nr, const volatile void * addr);
-extern int __test_bit(int nr, volatile void * addr);
-extern int find_first_zero_bit(void * addr, unsigned size);
-extern int find_next_zero_bit (void * addr, int size, int offset);
-extern unsigned long ffz(unsigned long word);
-
-/*
- * Some hacks to defeat gcc over-optimizations..
- */
-struct __dummy { unsigned long a[100]; };
-#define ADDR (*(volatile struct __dummy *) addr)
-#define CONST_ADDR (*(volatile const struct __dummy *) addr)
+#define ADDR (*(volatile long *) addr)
-extern __inline__ void set_bit(int nr, volatile void * addr)
+static __inline__ void set_bit(int nr, volatile void * addr)
{
__asm__ __volatile__( LOCK_PREFIX
"btsl %1,%0"
@@ -51,7 +31,21 @@ extern __inline__ void set_bit(int nr, volatile void * addr)
:"Ir" (nr));
}
-extern __inline__ void clear_bit(int nr, volatile void * addr)
+/* WARNING: non atomic and it can be reordered! */
+static __inline__ void __set_bit(int nr, volatile void * addr)
+{
+ __asm__(
+ "btsl %1,%0"
+ :"=m" (ADDR)
+ :"Ir" (nr));
+}
+
+/*
+ * clear_bit() doesn't provide any barrier for the compiler.
+ */
+#define smp_mb__before_clear_bit() barrier()
+#define smp_mb__after_clear_bit() barrier()
+static __inline__ void clear_bit(int nr, volatile void * addr)
{
__asm__ __volatile__( LOCK_PREFIX
"btrl %1,%0"
@@ -59,7 +53,7 @@ extern __inline__ void clear_bit(int nr, volatile void * addr)
:"Ir" (nr));
}
-extern __inline__ void change_bit(int nr, volatile void * addr)
+static __inline__ void change_bit(int nr, volatile void * addr)
{
__asm__ __volatile__( LOCK_PREFIX
"btcl %1,%0"
@@ -67,48 +61,77 @@ extern __inline__ void change_bit(int nr, volatile void * addr)
:"Ir" (nr));
}
-extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
+/*
+ * It will also imply a memory barrier, thus it must clobber memory
+ * to make sure to reload anything that was cached into registers
+ * outside _this_ critical section.
+ */
+static __inline__ int test_and_set_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__( LOCK_PREFIX
"btsl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR)
+ :"Ir" (nr) : "memory");
+ return oldbit;
+}
+
+/* WARNING: non atomic and it can be reordered! */
+static __inline__ int __test_and_set_bit(int nr, volatile void * addr)
+{
+ int oldbit;
+
+ __asm__(
+ "btsl %2,%1\n\tsbbl %0,%0"
+ :"=r" (oldbit),"=m" (ADDR)
:"Ir" (nr));
return oldbit;
}
-extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
+static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__( LOCK_PREFIX
"btrl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR)
+ :"Ir" (nr) : "memory");
+ return oldbit;
+}
+
+/* WARNING: non atomic and it can be reordered! */
+static __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
+{
+ int oldbit;
+
+ __asm__(
+ "btrl %2,%1\n\tsbbl %0,%0"
+ :"=r" (oldbit),"=m" (ADDR)
:"Ir" (nr));
return oldbit;
}
-extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
+static __inline__ int test_and_change_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__( LOCK_PREFIX
"btcl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" (ADDR)
- :"Ir" (nr));
+ :"Ir" (nr) : "memory");
return oldbit;
}
/*
* This routine doesn't need to be atomic.
*/
-extern __inline__ int __constant_test_bit(int nr, const volatile void * addr)
+static __inline__ int constant_test_bit(int nr, const volatile void * addr)
{
return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
}
-extern __inline__ int __test_bit(int nr, volatile void * addr)
+static __inline__ int variable_test_bit(int nr, volatile void * addr)
{
int oldbit;
@@ -121,13 +144,13 @@ extern __inline__ int __test_bit(int nr, volatile void * addr)
#define test_bit(nr,addr) \
(__builtin_constant_p(nr) ? \
- __constant_test_bit((nr),(addr)) : \
- __test_bit((nr),(addr)))
+ constant_test_bit((nr),(addr)) : \
+ variable_test_bit((nr),(addr)))
/*
* Find-bit routines..
*/
-extern __inline__ int find_first_zero_bit(void * addr, unsigned size)
+static __inline__ int find_first_zero_bit(void * addr, unsigned size)
{
int d0, d1, d2;
int res;
@@ -151,7 +174,7 @@ extern __inline__ int find_first_zero_bit(void * addr, unsigned size)
return res;
}
-extern __inline__ int find_next_zero_bit (void * addr, int size, int offset)
+static __inline__ int find_next_zero_bit (void * addr, int size, int offset)
{
unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
int set = 0, bit = offset & 31, res;
@@ -182,7 +205,7 @@ extern __inline__ int find_next_zero_bit (void * addr, int size, int offset)
* ffz = Find First Zero in word. Undefined if no zero exists,
* so code should check against ~0UL first..
*/
-extern __inline__ unsigned long ffz(unsigned long word)
+static __inline__ unsigned long ffz(unsigned long word)
{
__asm__("bsfl %1,%0"
:"=r" (word)
@@ -198,7 +221,7 @@ extern __inline__ unsigned long ffz(unsigned long word)
* differs in spirit from the above ffz (man ffs).
*/
-extern __inline__ int ffs(int x)
+static __inline__ int ffs(int x)
{
int r;
@@ -222,16 +245,16 @@ extern __inline__ int ffs(int x)
#ifdef __KERNEL__
-#define ext2_set_bit test_and_set_bit
-#define ext2_clear_bit test_and_clear_bit
+#define ext2_set_bit __test_and_set_bit
+#define ext2_clear_bit __test_and_clear_bit
#define ext2_test_bit test_bit
#define ext2_find_first_zero_bit find_first_zero_bit
#define ext2_find_next_zero_bit find_next_zero_bit
/* Bitmap functions for the minix filesystem. */
-#define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr)
-#define minix_set_bit(nr,addr) set_bit(nr,addr)
-#define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr)
+#define minix_test_and_set_bit(nr,addr) __test_and_set_bit(nr,addr)
+#define minix_set_bit(nr,addr) __set_bit(nr,addr)
+#define minix_test_and_clear_bit(nr,addr) __test_and_clear_bit(nr,addr)
#define minix_test_bit(nr,addr) test_bit(nr,addr)
#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h
index 0ec21d98a..008a3d47d 100644
--- a/include/asm-i386/bugs.h
+++ b/include/asm-i386/bugs.h
@@ -50,32 +50,22 @@ static int __init no_387(char *s)
__setup("no387", no_387);
-static char __initdata fpu_error = 0;
-
-static struct timer_list copro_timer __initdata = {{0, 0}, 0};
-
-static void __init copro_timeout(unsigned long dummy)
-{
- fpu_error = 1;
- mod_timer(&copro_timer, jiffies+HZ);
- printk(KERN_ERR "387 failed: trying to reset\n");
- send_sig(SIGFPE, current, 1);
- outb_p(0,0xf1);
- outb_p(0,0xf0);
-}
-
static double __initdata x = 4195835.0;
static double __initdata y = 3145727.0;
-#ifdef CONFIG_X86_XMM
-static float __initdata zero[4] = { 0.0, 0.0, 0.0, 0.0 };
-static float __initdata one[4] = { 1.0, 1.0, 1.0, 1.0 };
-#endif
-
+/*
+ * This used to check for exceptions..
+ * However, it turns out that to support that,
+ * the XMM trap handlers basically had to
+ * be buggy. So let's have a correct XMM trap
+ * handler, and forget about printing out
+ * some status at boot.
+ *
+ * We should really only care about bugs here
+ * anyway. Not features.
+ */
static void __init check_fpu(void)
{
- unsigned short control_word;
-
if (!boot_cpu_data.hard_math) {
#ifndef CONFIG_MATH_EMULATION
printk(KERN_EMERG "No coprocessor found and no math emulation present.\n");
@@ -84,72 +74,8 @@ static void __init check_fpu(void)
#endif
return;
}
- if (mca_pentium_flag) {
- /* The IBM Model 95 machines with pentiums lock up on
- * fpu test, so we avoid it. All pentiums have inbuilt
- * FPU and thus should use exception 16. We still do
- * the FDIV test, although I doubt there where ever any
- * MCA boxes built with non-FDIV-bug cpus.
- */
- __asm__("fninit\n\t"
- "fldl %1\n\t"
- "fdivl %2\n\t"
- "fmull %2\n\t"
- "fldl %1\n\t"
- "fsubp %%st,%%st(1)\n\t"
- "fistpl %0\n\t"
- "fwait\n\t"
- "fninit"
- : "=m" (*&boot_cpu_data.fdiv_bug)
- : "m" (*&x), "m" (*&y));
- printk("mca-pentium specified, avoiding FPU coupling test... ");
- if (!boot_cpu_data.fdiv_bug)
- printk("??? No FDIV bug? Lucky you...\n");
- else
- printk("detected FDIV bug though.\n");
- return;
- }
- /*
- * check if exception 16 works correctly.. This is truly evil
- * code: it disables the high 8 interrupts to make sure that
- * the irq13 doesn't happen. But as this will lead to a lockup
- * if no exception16 arrives, it depends on the fact that the
- * high 8 interrupts will be re-enabled by the next timer tick.
- * So the irq13 will happen eventually, but the exception 16
- * should get there first..
- */
- printk(KERN_INFO "Checking 386/387 coupling... ");
- init_timer(&copro_timer);
- copro_timer.function = copro_timeout;
- mod_timer(&copro_timer, jiffies+HZ/2);
- __asm__("clts ; fninit ; fnstcw %0 ; fwait":"=m" (*&control_word));
- control_word &= 0xffc0;
- __asm__("fldcw %0 ; fwait": :"m" (*&control_word));
- outb_p(inb_p(0x21) | (1 << 2), 0x21);
- __asm__("fldz ; fld1 ; fdiv %st,%st(1) ; fwait");
- del_timer(&copro_timer);
- if (fpu_error)
- return;
- if (!ignore_irq13) {
- printk("OK, FPU using old IRQ 13 error reporting\n");
- return;
- }
- __asm__("fninit\n\t"
- "fldl %1\n\t"
- "fdivl %2\n\t"
- "fmull %2\n\t"
- "fldl %1\n\t"
- "fsubp %%st,%%st(1)\n\t"
- "fistpl %0\n\t"
- "fwait\n\t"
- "fninit"
- : "=m" (*&boot_cpu_data.fdiv_bug)
- : "m" (*&x), "m" (*&y));
- if (!boot_cpu_data.fdiv_bug)
- printk("OK, FPU using exception 16 error reporting.\n");
- else
- printk("Hmm, FPU using exception 16 error reporting with FDIV bug.\n");
+/* Enable FXSR and company _before_ testing for FP problems. */
#if defined(CONFIG_X86_FXSR) || defined(CONFIG_X86_RUNTIME_FXSR)
/*
* Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
@@ -168,18 +94,24 @@ static void __init check_fpu(void)
printk(KERN_INFO "Enabling unmasked SIMD FPU exception support... ");
set_in_cr4(X86_CR4_OSXMMEXCPT);
printk("done.\n");
-
- /* Check if exception 19 works okay. */
- load_mxcsr(0x0000);
- printk(KERN_INFO "Checking SIMD FPU exceptions... ");
- __asm__("movups %0,%%xmm0\n\t"
- "movups %1,%%xmm1\n\t"
- "divps %%xmm0,%%xmm1\n\t"
- : : "m" (*&zero), "m" (*&one));
- printk("OK, SIMD FPU using exception 19 error reporting.\n");
load_mxcsr(0x1f80);
}
#endif
+
+ /* Test for the divl bug.. */
+ __asm__("fninit\n\t"
+ "fldl %1\n\t"
+ "fdivl %2\n\t"
+ "fmull %2\n\t"
+ "fldl %1\n\t"
+ "fsubp %%st,%%st(1)\n\t"
+ "fistpl %0\n\t"
+ "fwait\n\t"
+ "fninit"
+ : "=m" (*&boot_cpu_data.fdiv_bug)
+ : "m" (*&x), "m" (*&y));
+ if (boot_cpu_data.fdiv_bug)
+ printk("Hmm, FPU with FDIV bug.\n");
}
static void __init check_hlt(void)
diff --git a/include/asm-i386/fcntl.h b/include/asm-i386/fcntl.h
index 5292b3798..5637eca59 100644
--- a/include/asm-i386/fcntl.h
+++ b/include/asm-i386/fcntl.h
@@ -51,6 +51,9 @@
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
+/* for leases */
+#define F_INPROGRESS 16
+
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
@@ -58,6 +61,11 @@
blocking */
#define LOCK_UN 8 /* remove lock */
+#define LOCK_MAND 32 /* This is a mandatory flock */
+#define LOCK_READ 64 /* ... Which allows concurrent read operations */
+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
+
struct flock {
short l_type;
short l_whence;
@@ -74,4 +82,6 @@ struct flock64 {
pid_t l_pid;
};
+#define F_LINUX_SPECIFIC_BASE 1024
+
#endif
diff --git a/include/asm-i386/mpspec.h b/include/asm-i386/mpspec.h
index 2956def6b..c856efe54 100644
--- a/include/asm-i386/mpspec.h
+++ b/include/asm-i386/mpspec.h
@@ -79,6 +79,7 @@ struct mpc_config_bus
unsigned char mpc_bustype[6] __attribute((packed));
};
+/* List of Bus Type string values, Intel MP Spec. */
#define BUSTYPE_EISA "EISA"
#define BUSTYPE_ISA "ISA"
#define BUSTYPE_INTERN "INTERN" /* Internal BUS */
@@ -86,6 +87,17 @@ struct mpc_config_bus
#define BUSTYPE_VL "VL" /* Local bus */
#define BUSTYPE_PCI "PCI"
#define BUSTYPE_PCMCIA "PCMCIA"
+#define BUSTYPE_CBUS "CBUS"
+#define BUSTYPE_CBUSII "CBUSII"
+#define BUSTYPE_FUTURE "FUTURE"
+#define BUSTYPE_MBI "MBI"
+#define BUSTYPE_MBII "MBII"
+#define BUSTYPE_MPI "MPI"
+#define BUSTYPE_MPSA "MPSA"
+#define BUSTYPE_NUBUS "NUBUS"
+#define BUSTYPE_TC "TC"
+#define BUSTYPE_VME "VME"
+#define BUSTYPE_XPRESS "XPRESS"
struct mpc_config_ioapic
{
@@ -147,7 +159,7 @@ struct mpc_config_lintsrc
#define MAX_IRQ_SOURCES 128
#define MAX_MP_BUSSES 32
enum mp_bustype {
- MP_BUS_ISA,
+ MP_BUS_ISA = 1,
MP_BUS_EISA,
MP_BUS_PCI,
MP_BUS_MCA
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index 7a070fa53..03b2ba400 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -75,7 +75,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
* amount of physical memory you can use to about 950MB.
*
* If you want more physical memory than this then see the CONFIG_HIGHMEM4G
- * amd CONFIG_HIGHMEM64G options in the kernel configuration.
+ * and CONFIG_HIGHMEM64G options in the kernel configuration.
*/
#define __PAGE_OFFSET (0xC0000000)
diff --git a/include/asm-i386/resource.h b/include/asm-i386/resource.h
index e49c5b8c3..e0da3ad1d 100644
--- a/include/asm-i386/resource.h
+++ b/include/asm-i386/resource.h
@@ -15,8 +15,9 @@
#define RLIMIT_NOFILE 7 /* max number of open files */
#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
#define RLIMIT_AS 9 /* address space limit */
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
-#define RLIM_NLIMITS 10
+#define RLIM_NLIMITS 11
/*
* SuS says limits have to be unsigned.
@@ -38,6 +39,7 @@
{ INR_OPEN, INR_OPEN }, \
{ RLIM_INFINITY, RLIM_INFINITY }, \
{ RLIM_INFINITY, RLIM_INFINITY }, \
+ { RLIM_INFINITY, RLIM_INFINITY }, \
}
#endif /* __KERNEL__ */
diff --git a/include/asm-i386/rwlock.h b/include/asm-i386/rwlock.h
index ac9e8f36b..9475419f9 100644
--- a/include/asm-i386/rwlock.h
+++ b/include/asm-i386/rwlock.h
@@ -17,9 +17,6 @@
#ifndef _ASM_I386_RWLOCK_H
#define _ASM_I386_RWLOCK_H
-typedef struct { unsigned long a[100]; } __dummy_lock_t;
-#define __dummy_lock(lock) (*(__dummy_lock_t *)(lock))
-
#define RW_LOCK_BIAS 0x01000000
#define RW_LOCK_BIAS_STR "0x01000000"
@@ -44,7 +41,7 @@ typedef struct { unsigned long a[100]; } __dummy_lock_t;
"popl %%eax\n\t" \
"jmp 1b\n" \
".previous" \
- :"=m" (__dummy_lock(rw)))
+ :"=m" (*(volatile int *)rw) : : "memory")
#define __build_read_lock(rw, helper) do { \
if (__builtin_constant_p(rw)) \
@@ -74,7 +71,7 @@ typedef struct { unsigned long a[100]; } __dummy_lock_t;
"popl %%eax\n\t" \
"jmp 1b\n" \
".previous" \
- :"=m" (__dummy_lock(rw)))
+ :"=m" (*(volatile int *)rw) : : "memory")
#define __build_write_lock(rw, helper) do { \
if (__builtin_constant_p(rw)) \
diff --git a/include/asm-i386/semaphore.h b/include/asm-i386/semaphore.h
index 972b450cf..ecceb0c7b 100644
--- a/include/asm-i386/semaphore.h
+++ b/include/asm-i386/semaphore.h
@@ -64,7 +64,7 @@ struct semaphore {
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
-extern inline void sema_init (struct semaphore *sem, int val)
+static inline void sema_init (struct semaphore *sem, int val)
{
/*
* *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val);
@@ -105,7 +105,7 @@ asmlinkage void __up(struct semaphore * sem);
* "__down_failed" is a special asm handler that calls the C
* routine that actually waits. See arch/i386/kernel/semaphore.c
*/
-extern inline void down(struct semaphore * sem)
+static inline void down(struct semaphore * sem)
{
#if WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
@@ -125,7 +125,7 @@ extern inline void down(struct semaphore * sem)
:"memory");
}
-extern inline int down_interruptible(struct semaphore * sem)
+static inline int down_interruptible(struct semaphore * sem)
{
int result;
@@ -149,7 +149,7 @@ extern inline int down_interruptible(struct semaphore * sem)
return result;
}
-extern inline int down_trylock(struct semaphore * sem)
+static inline int down_trylock(struct semaphore * sem)
{
int result;
@@ -179,7 +179,7 @@ extern inline int down_trylock(struct semaphore * sem)
* The default case (no contention) will result in NO
* jumps for both down() and up().
*/
-extern inline void up(struct semaphore * sem)
+static inline void up(struct semaphore * sem)
{
#if WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
@@ -252,7 +252,7 @@ struct rw_semaphore {
#define DECLARE_RWSEM_READ_LOCKED(name) __DECLARE_RWSEM_GENERIC(name,RW_LOCK_BIAS-1)
#define DECLARE_RWSEM_WRITE_LOCKED(name) __DECLARE_RWSEM_GENERIC(name,0)
-extern inline void init_rwsem(struct rw_semaphore *sem)
+static inline void init_rwsem(struct rw_semaphore *sem)
{
atomic_set(&sem->count, RW_LOCK_BIAS);
sem->read_bias_granted = 0;
@@ -271,7 +271,7 @@ extern struct rw_semaphore *FASTCALL(__down_read_failed(struct rw_semaphore *sem
extern struct rw_semaphore *FASTCALL(__down_write_failed(struct rw_semaphore *sem));
extern struct rw_semaphore *FASTCALL(__rwsem_wake(struct rw_semaphore *sem));
-extern inline void down_read(struct rw_semaphore *sem)
+static inline void down_read(struct rw_semaphore *sem)
{
#if WAITQUEUE_DEBUG
if (sem->__magic != (long)&sem->__magic)
@@ -287,7 +287,7 @@ extern inline void down_read(struct rw_semaphore *sem)
#endif
}
-extern inline void down_write(struct rw_semaphore *sem)
+static inline void down_write(struct rw_semaphore *sem)
{
#if WAITQUEUE_DEBUG
if (sem->__magic != (long)&sem->__magic)
@@ -311,7 +311,7 @@ extern inline void down_write(struct rw_semaphore *sem)
* case is when there was a writer waiting, and we've
* bumped the count to 0: we must wake the writer up.
*/
-extern inline void __up_read(struct rw_semaphore *sem)
+static inline void __up_read(struct rw_semaphore *sem)
{
__asm__ __volatile__(
"# up_read\n\t"
@@ -330,7 +330,7 @@ extern inline void __up_read(struct rw_semaphore *sem)
/* releasing the writer is easy -- just release it and
* wake up any sleepers.
*/
-extern inline void __up_write(struct rw_semaphore *sem)
+static inline void __up_write(struct rw_semaphore *sem)
{
__asm__ __volatile__(
"# up_write\n\t"
@@ -346,7 +346,7 @@ extern inline void __up_write(struct rw_semaphore *sem)
);
}
-extern inline void up_read(struct rw_semaphore *sem)
+static inline void up_read(struct rw_semaphore *sem)
{
#if WAITQUEUE_DEBUG
if (sem->write_bias_granted)
@@ -358,7 +358,7 @@ extern inline void up_read(struct rw_semaphore *sem)
__up_read(sem);
}
-extern inline void up_write(struct rw_semaphore *sem)
+static inline void up_write(struct rw_semaphore *sem)
{
#if WAITQUEUE_DEBUG
if (sem->read_bias_granted)
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index 5d5b67ab2..4a92bb2a2 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -70,12 +70,12 @@ static inline int spin_trylock(spinlock_t *lock)
char oldval;
__asm__ __volatile__(
"xchgb %b0,%1"
- :"=q" (oldval), "=m" (__dummy_lock(lock))
- :"0" (0));
+ :"=q" (oldval), "=m" (lock->lock)
+ :"0" (0) : "memory");
return oldval > 0;
}
-extern inline void spin_lock(spinlock_t *lock)
+static inline void spin_lock(spinlock_t *lock)
{
#if SPINLOCK_DEBUG
__label__ here;
@@ -87,10 +87,10 @@ printk("eip: %p\n", &&here);
#endif
__asm__ __volatile__(
spin_lock_string
- :"=m" (__dummy_lock(lock)));
+ :"=m" (lock->lock) : : "memory");
}
-extern inline void spin_unlock(spinlock_t *lock)
+static inline void spin_unlock(spinlock_t *lock)
{
#if SPINLOCK_DEBUG
if (lock->magic != SPINLOCK_MAGIC)
@@ -100,7 +100,7 @@ extern inline void spin_unlock(spinlock_t *lock)
#endif
__asm__ __volatile__(
spin_unlock_string
- :"=m" (__dummy_lock(lock)));
+ :"=m" (lock->lock) : : "memory");
}
/*
@@ -143,7 +143,7 @@ typedef struct {
*/
/* the spinlock helpers are in arch/i386/kernel/semaphore.S */
-extern inline void read_lock(rwlock_t *rw)
+static inline void read_lock(rwlock_t *rw)
{
#if SPINLOCK_DEBUG
if (rw->magic != RWLOCK_MAGIC)
@@ -152,7 +152,7 @@ extern inline void read_lock(rwlock_t *rw)
__build_read_lock(rw, "__read_lock_failed");
}
-extern inline void write_lock(rwlock_t *rw)
+static inline void write_lock(rwlock_t *rw)
{
#if SPINLOCK_DEBUG
if (rw->magic != RWLOCK_MAGIC)
@@ -161,10 +161,10 @@ extern inline void write_lock(rwlock_t *rw)
__build_write_lock(rw, "__write_lock_failed");
}
-#define read_unlock(rw) asm volatile("lock ; incl %0" :"=m" (__dummy_lock(&(rw)->lock)))
-#define write_unlock(rw) asm volatile("lock ; addl $" RW_LOCK_BIAS_STR ",%0":"=m" (__dummy_lock(&(rw)->lock)))
+#define read_unlock(rw) asm volatile("lock ; incl %0" :"=m" ((rw)->lock) : : "memory")
+#define write_unlock(rw) asm volatile("lock ; addl $" RW_LOCK_BIAS_STR ",%0":"=m" ((rw)->lock) : : "memory")
-extern inline int write_trylock(rwlock_t *lock)
+static inline int write_trylock(rwlock_t *lock)
{
atomic_t *count = (atomic_t *)lock;
if (atomic_sub_and_test(RW_LOCK_BIAS, count))
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 563e53b77..d3b01ab8b 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -267,15 +267,33 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
* I expect future Intel CPU's to have a weaker ordering,
* but I'd also expect them to finally get their act together
* and add some real memory barriers if so.
+ *
+ * The Pentium III does add a real memory barrier with the
+ * sfence instruction, so we use that where appropriate.
*/
+#ifndef CONFIG_X86_XMM
#define mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
+#else
+#define mb() __asm__ __volatile__ ("sfence": : :"memory")
+#endif
#define rmb() mb()
#define wmb() __asm__ __volatile__ ("": : :"memory")
+
+#ifdef CONFIG_SMP
+#define smp_mb() mb()
+#define smp_rmb() rmb()
+#define smp_wmb() wmb()
+#else
+#define smp_mb() barrier()
+#define smp_rmb() barrier()
+#define smp_wmb() barrier()
+#endif
+
#define set_mb(var, value) do { xchg(&var, value); } while (0)
#define set_wmb(var, value) do { var = value; wmb(); } while (0)
/* interrupt control.. */
-#define __save_flags(x) __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */ :"memory")
+#define __save_flags(x) __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */)
#define __restore_flags(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory")
#define __cli() __asm__ __volatile__("cli": : :"memory")
#define __sti() __asm__ __volatile__("sti": : :"memory")
@@ -284,9 +302,9 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
/* For spinlocks etc */
#define local_irq_save(x) __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory")
-#define local_irq_restore(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory")
-#define local_irq_disable() __asm__ __volatile__("cli": : :"memory")
-#define local_irq_enable() __asm__ __volatile__("sti": : :"memory")
+#define local_irq_restore(x) __restore_flags(x)
+#define local_irq_disable() __cli()
+#define local_irq_enable() __sti()
#ifdef CONFIG_SMP
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index 3f3bc50f4..67347daea 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -232,20 +232,6 @@ do { \
: "=r"(err), ltype (x) \
: "m"(__m(addr)), "i"(-EFAULT), "0"(err))
-/*
- * The "xxx_ret" versions return constant specified in third argument, if
- * something bad happens. These macros can be optimized for the
- * case of just returning from the function xxx_ret is used.
- */
-
-#define put_user_ret(x,ptr,ret) ({ if (put_user(x,ptr)) return ret; })
-
-#define get_user_ret(x,ptr,ret) ({ if (get_user(x,ptr)) return ret; })
-
-#define __put_user_ret(x,ptr,ret) ({ if (__put_user(x,ptr)) return ret; })
-
-#define __get_user_ret(x,ptr,ret) ({ if (__get_user(x,ptr)) return ret; })
-
/*
* Copy To/From Userspace
@@ -583,10 +569,6 @@ __constant_copy_from_user_nocheck(void *to, const void *from, unsigned long n)
__constant_copy_from_user((to),(from),(n)) : \
__generic_copy_from_user((to),(from),(n)))
-#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; })
-
-#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; })
-
#define __copy_to_user(to,from,n) \
(__builtin_constant_p(n) ? \
__constant_copy_to_user_nocheck((to),(from),(n)) : \
diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h
index 175618aaa..c20ab10ec 100644
--- a/include/asm-ia64/fcntl.h
+++ b/include/asm-ia64/fcntl.h
@@ -55,6 +55,9 @@
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
+/* for leases */
+#define F_INPROGRESS 16
+
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
@@ -62,6 +65,11 @@
blocking */
#define LOCK_UN 8 /* remove lock */
+#define LOCK_MAND 32 /* This is a mandatory flock */
+#define LOCK_READ 64 /* ... Which allows concurrent read operations */
+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
+
struct flock {
short l_type;
short l_whence;
@@ -70,4 +78,5 @@ struct flock {
pid_t l_pid;
};
+#define F_LINUX_SPECIFIC_BASE 1024
#endif /* _ASM_IA64_FCNTL_H */
diff --git a/include/asm-ia64/resource.h b/include/asm-ia64/resource.h
index a8d75ecdd..40223b9c3 100644
--- a/include/asm-ia64/resource.h
+++ b/include/asm-ia64/resource.h
@@ -18,8 +18,9 @@
#define RLIMIT_NOFILE 7 /* max number of open files */
#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
#define RLIMIT_AS 9 /* address space limit */
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
-#define RLIM_NLIMITS 10
+#define RLIM_NLIMITS 11
/*
* SuS says limits have to be unsigned.
@@ -41,6 +42,7 @@
{ INR_OPEN, INR_OPEN }, \
{ RLIM_INFINITY, RLIM_INFINITY }, \
{ RLIM_INFINITY, RLIM_INFINITY }, \
+ { RLIM_INFINITY, RLIM_INFINITY }, \
}
# endif /* __KERNEL__ */
diff --git a/include/asm-ia64/uaccess.h b/include/asm-ia64/uaccess.h
index e530e7f35..319784a5b 100644
--- a/include/asm-ia64/uaccess.h
+++ b/include/asm-ia64/uaccess.h
@@ -86,16 +86,6 @@ verify_area (int type, const void *addr, unsigned long size)
#define __put_user(x,ptr) __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
#define __get_user(x,ptr) __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
-/*
- * The "xxx_ret" versions return constant specified in third argument, if
- * something bad happens. These macros can be optimized for the
- * case of just returning from the function xxx_ret is used.
- */
-#define put_user_ret(x,ptr,ret) ({ if (put_user(x,ptr)) return ret; })
-#define get_user_ret(x,ptr,ret) ({ if (get_user(x,ptr)) return ret; })
-#define __put_user_ret(x,ptr,ret) ({ if (__put_user(x,ptr)) return ret; })
-#define __get_user_ret(x,ptr,ret) ({ if (__get_user(x,ptr)) return ret; })
-
extern void __get_user_unknown (void);
#define __get_user_nocheck(x,ptr,size) \
@@ -280,18 +270,6 @@ extern unsigned long __copy_user (void *to, const void *from, unsigned long coun
__cu_len; \
})
-#define copy_to_user_ret(to,from,n,retval) \
-({ \
- if (copy_to_user(to,from,n)) \
- return retval; \
-})
-
-#define copy_from_user_ret(to,from,n,retval) \
-({ \
- if (copy_from_user(to,from,n)) \
- return retval; \
-})
-
extern unsigned long __do_clear_user (void *, unsigned long);
#define __clear_user(to,n) \
diff --git a/include/asm-m68k/fcntl.h b/include/asm-m68k/fcntl.h
index 63b22687a..9738061b7 100644
--- a/include/asm-m68k/fcntl.h
+++ b/include/asm-m68k/fcntl.h
@@ -47,6 +47,9 @@
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
+/* for leases */
+#define F_INPROGRESS 16
+
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
@@ -54,6 +57,11 @@
blocking */
#define LOCK_UN 8 /* remove lock */
+#define LOCK_MAND 32 /* This is a mandatory flock */
+#define LOCK_READ 64 /* ... Which allows concurrent read operations */
+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
+
struct flock {
short l_type;
short l_whence;
@@ -62,4 +70,5 @@ struct flock {
pid_t l_pid;
};
+#define F_LINUX_SPECIFIC_BASE 1024
#endif /* _M68K_FCNTL_H */
diff --git a/include/asm-m68k/resource.h b/include/asm-m68k/resource.h
index f2a6f0f41..29cc6e973 100644
--- a/include/asm-m68k/resource.h
+++ b/include/asm-m68k/resource.h
@@ -15,8 +15,9 @@
#define RLIMIT_NOFILE 7 /* max number of open files */
#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space*/
#define RLIMIT_AS 9 /* address space limit */
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
-#define RLIM_NLIMITS 10
+#define RLIM_NLIMITS 11
/*
* SuS says limits have to be unsigned.
@@ -37,6 +38,7 @@
{0, 0}, \
{INR_OPEN, INR_OPEN}, \
{LONG_MAX, LONG_MAX}, \
+ {LONG_MAX, LONG_MAX}, \
{LONG_MAX, LONG_MAX} \
}
diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h
index 82897ade9..1fe589f66 100644
--- a/include/asm-m68k/uaccess.h
+++ b/include/asm-m68k/uaccess.h
@@ -759,10 +759,6 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n)
#define __copy_from_user(to, from, n) copy_from_user(to, from, n)
#define __copy_to_user(to, from, n) copy_to_user(to, from, n)
-#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; })
-
-#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; })
-
/*
* Copy a null terminated string from userspace.
*/
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index fbd2daee7..e4084d577 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -9,20 +9,14 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 1996, 1997 by Ralf Baechle
- *
- * $Id: atomic.h,v 1.6 1999/07/26 19:42:42 harald Exp $
+ * Copyright (C) 1996, 1997, 2000 by Ralf Baechle
*/
#ifndef __ASM_ATOMIC_H
#define __ASM_ATOMIC_H
#include <linux/config.h>
-#ifdef CONFIG_SMP
typedef struct { volatile int counter; } atomic_t;
-#else
-typedef struct { int counter; } atomic_t;
-#endif
#ifdef __KERNEL__
#define ATOMIC_INIT(i) { (i) }
@@ -38,7 +32,7 @@ typedef struct { int counter; } atomic_t;
* The MIPS I implementation is only atomic with respect to
* interrupts. R3000 based multiprocessor machines are rare anyway ...
*/
-extern __inline__ void atomic_add(int i, volatile atomic_t * v)
+extern __inline__ void atomic_add(int i, atomic_t * v)
{
int flags;
@@ -48,7 +42,7 @@ extern __inline__ void atomic_add(int i, volatile atomic_t * v)
restore_flags(flags);
}
-extern __inline__ void atomic_sub(int i, volatile atomic_t * v)
+extern __inline__ void atomic_sub(int i, atomic_t * v)
{
int flags;
@@ -108,41 +102,30 @@ extern __inline__ void atomic_clear_mask(unsigned long mask, unsigned long * v)
* implementation is SMP safe ...
*/
-/*
- * Make sure gcc doesn't try to be clever and move things around
- * on us. We need to use _exactly_ the address the user gave us,
- * not some alias that contains the same information.
- */
-#define __atomic_fool_gcc(x) (*(volatile struct { int a[100]; } *)x)
-
-extern __inline__ void atomic_add(int i, volatile atomic_t * v)
+extern __inline__ void atomic_add(int i, atomic_t * v)
{
unsigned long temp;
__asm__ __volatile__(
- "1:\tll\t%0,%1\n\t"
- "addu\t%0,%2\n\t"
- "sc\t%0,%1\n\t"
- "beqz\t%0,1b"
- :"=&r" (temp),
- "=m" (__atomic_fool_gcc(v))
- :"Ir" (i),
- "m" (__atomic_fool_gcc(v)));
+ "1:\tll\t%0, %1\t\t\t# atomic_add\n\t"
+ "addu\t%0, %2\n\t"
+ "sc\t%0, %1\n\t"
+ "beqz\t%0, 1b"
+ : "=&r" (temp), "=m" (v->counter)
+ : "Ir" (i), "m" (v->counter));
}
-extern __inline__ void atomic_sub(int i, volatile atomic_t * v)
+extern __inline__ void atomic_sub(int i, atomic_t * v)
{
unsigned long temp;
__asm__ __volatile__(
- "1:\tll\t%0,%1\n\t"
- "subu\t%0,%2\n\t"
- "sc\t%0,%1\n\t"
- "beqz\t%0,1b"
- :"=&r" (temp),
- "=m" (__atomic_fool_gcc(v))
- :"Ir" (i),
- "m" (__atomic_fool_gcc(v)));
+ "1:\tll\t%0, %1\t\t\t# atomic_sub\n\t"
+ "subu\t%0, %2\n\t"
+ "sc\t%0, %1\n\t"
+ "beqz\t%0, 1b"
+ : "=&r" (temp), "=m" (v->counter)
+ : "Ir" (i), "m" (v->counter));
}
/*
@@ -153,18 +136,15 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)
unsigned long temp, result;
__asm__ __volatile__(
- ".set\tnoreorder\n"
+ ".set\tnoreorder\t\t\t# atomic_add_return\n"
"1:\tll\t%1,%2\n\t"
"addu\t%0,%1,%3\n\t"
"sc\t%0,%2\n\t"
"beqz\t%0,1b\n\t"
"addu\t%0,%1,%3\n\t"
".set\treorder"
- :"=&r" (result),
- "=&r" (temp),
- "=m" (__atomic_fool_gcc(v))
- :"Ir" (i),
- "m" (__atomic_fool_gcc(v)));
+ : "=&r" (result), "=&r" (temp), "=m" (v->counter)
+ : "Ir" (i), "m" (v->counter));
return result;
}
@@ -174,18 +154,15 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v)
unsigned long temp, result;
__asm__ __volatile__(
- ".set\tnoreorder\n"
+ ".set\tnoreorder\t\t\t# atomic_sub_return\n"
"1:\tll\t%1,%2\n\t"
"subu\t%0,%1,%3\n\t"
"sc\t%0,%2\n\t"
"beqz\t%0,1b\n\t"
"subu\t%0,%1,%3\n\t"
".set\treorder"
- :"=&r" (result),
- "=&r" (temp),
- "=m" (__atomic_fool_gcc(v))
- :"Ir" (i),
- "m" (__atomic_fool_gcc(v)));
+ : "=&r" (result), "=&r" (temp), "=m" (v->counter)
+ : "Ir" (i), "m" (v->counter));
return result;
}
@@ -201,4 +178,4 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v)
#define atomic_dec(v) atomic_sub(1,(v))
#endif /* defined(__KERNEL__) */
-#endif /* __ASM_MIPS_ATOMIC_H */
+#endif /* __ASM_ATOMIC_H */
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index 9f209e847..da1f33cc7 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -19,6 +19,12 @@
#include <linux/config.h>
/*
+ * clear_bit() doesn't provide any barrier for the compiler.
+ */
+#define smp_mb__before_clear_bit() barrier()
+#define smp_mb__after_clear_bit() barrier()
+
+/*
* Only disable interrupt for kernel mode stuff to keep usermode stuff
* that dares to use kernel include files alive.
*/
@@ -35,25 +41,6 @@
#define __bi_restore_flags(x)
#endif /* __KERNEL__ */
-/*
- * Note that the bit operations are defined on arrays of 32 bit sized
- * elements. With respect to a future 64 bit implementation it is
- * wrong to use long *. Use u32 * or int *.
- */
-extern __inline__ void set_bit(int nr, volatile void *addr);
-extern __inline__ void clear_bit(int nr, volatile void *addr);
-extern __inline__ void change_bit(int nr, volatile void *addr);
-extern __inline__ int test_and_set_bit(int nr, volatile void *addr);
-extern __inline__ int test_and_clear_bit(int nr, volatile void *addr);
-extern __inline__ int test_and_change_bit(int nr, volatile void *addr);
-
-extern __inline__ int test_bit(int nr, volatile void *addr);
-#ifndef __MIPSEB__
-extern __inline__ int find_first_zero_bit (void *addr, unsigned size);
-#endif
-extern __inline__ int find_next_zero_bit (void * addr, int size, int offset);
-extern __inline__ unsigned long ffz(unsigned long word);
-
#if defined(CONFIG_CPU_HAS_LLSC)
#include <asm/mipsregs.h>
@@ -74,8 +61,16 @@ set_bit(int nr, volatile void *addr)
"or\t%0, %2\n\t"
"sc\t%0, %1\n\t"
"beqz\t%0, 1b"
- :"=&r" (temp), "=m" (*m)
- :"ir" (1UL << (nr & 0x1f)), "m" (*m));
+ : "=&r" (temp), "=m" (*m)
+ : "ir" (1UL << (nr & 0x1f)), "m" (*m));
+}
+
+/* WARNING: non atomic and it can be reordered! */
+extern __inline__ void __set_bit(int nr, volatile void * addr)
+{
+ unsigned long * m = ((unsigned long *) addr) + (nr >> 5);
+
+ *m |= 1UL << (nr & 31);
}
extern __inline__ void
@@ -89,8 +84,8 @@ clear_bit(int nr, volatile void *addr)
"and\t%0, %2\n\t"
"sc\t%0, %1\n\t"
"beqz\t%0, 1b\n\t"
- :"=&r" (temp), "=m" (*m)
- :"ir" (~(1UL << (nr & 0x1f))), "m" (*m));
+ : "=&r" (temp), "=m" (*m)
+ : "ir" (~(1UL << (nr & 0x1f))), "m" (*m));
}
extern __inline__ void
@@ -104,10 +99,15 @@ change_bit(int nr, volatile void *addr)
"xor\t%0, %2\n\t"
"sc\t%0, %1\n\t"
"beqz\t%0, 1b"
- :"=&r" (temp), "=m" (*m)
- :"ir" (1UL << (nr & 0x1f)), "m" (*m));
+ : "=&r" (temp), "=m" (*m)
+ : "ir" (1UL << (nr & 0x1f)), "m" (*m));
}
+/*
+ * It will also imply a memory barrier, thus it must clobber memory
+ * to make sure to reload anything that was cached into registers
+ * outside _this_ critical section.
+ */
extern __inline__ int
test_and_set_bit(int nr, volatile void *addr)
{
@@ -122,12 +122,27 @@ test_and_set_bit(int nr, volatile void *addr)
"beqz\t%2, 1b\n\t"
" and\t%2, %0, %3\n\t"
".set\treorder"
- :"=&r" (temp), "=m" (*m), "=&r" (res)
- :"r" (1UL << (nr & 0x1f)), "m" (*m));
+ : "=&r" (temp), "=m" (*m), "=&r" (res)
+ : "r" (1UL << (nr & 0x1f)), "m" (*m)
+ : "memory");
return res != 0;
}
+/* WARNING: non atomic and it can be reordered! */
+extern __inline__ int __test_and_set_bit(int nr, volatile void * addr)
+{
+ int mask, retval;
+ volatile int *a = addr;
+
+ a += nr >> 5;
+ mask = 1 << (nr & 0x1f);
+ retval = (mask & *a) != 0;
+ *a |= mask;
+
+ return retval;
+}
+
extern __inline__ int
test_and_clear_bit(int nr, volatile void *addr)
{
@@ -143,12 +158,27 @@ test_and_clear_bit(int nr, volatile void *addr)
"beqz\t%2, 1b\n\t"
" and\t%2, %0, %3\n\t"
".set\treorder"
- :"=&r" (temp), "=m" (*m), "=&r" (res)
- :"r" (1UL << (nr & 0x1f)), "m" (*m));
+ : "=&r" (temp), "=m" (*m), "=&r" (res)
+ : "r" (1UL << (nr & 0x1f)), "m" (*m)
+ : "memory");
return res != 0;
}
+/* WARNING: non atomic and it can be reordered! */
+extern __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
+{
+ int mask, retval;
+ volatile int *a = addr;
+
+ a += nr >> 5;
+ mask = 1 << (nr & 0x1f);
+ retval = (mask & *a) != 0;
+ *a &= ~mask;
+
+ return retval;
+}
+
extern __inline__ int
test_and_change_bit(int nr, volatile void *addr)
{
@@ -163,8 +193,9 @@ test_and_change_bit(int nr, volatile void *addr)
"beqz\t%2, 1b\n\t"
" and\t%2, %0, %3\n\t"
".set\treorder"
- :"=&r" (temp), "=m" (*m), "=&r" (res)
- :"r" (1UL << (nr & 0x1f)), "m" (*m));
+ : "=&r" (temp), "=m" (*m), "=&r" (res)
+ : "r" (1UL << (nr & 0x1f)), "m" (*m)
+ : "memory");
return res != 0;
}
@@ -184,6 +215,18 @@ extern __inline__ void set_bit(int nr, volatile void * addr)
__bi_restore_flags(flags);
}
+/* WARNING: non atomic and it can be reordered! */
+extern __inline__ void __set_bit(int nr, volatile void * addr)
+{
+ int mask;
+ volatile int *a = addr;
+
+ a += nr >> 5;
+ mask = 1 << (nr & 0x1f);
+ *a |= mask;
+}
+
+/* WARNING: non atomic and it can be reordered! */
extern __inline__ void clear_bit(int nr, volatile void * addr)
{
int mask;
@@ -226,6 +269,20 @@ extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
return retval;
}
+/* WARNING: non atomic and it can be reordered! */
+extern __inline__ int __test_and_set_bit(int nr, volatile void * addr)
+{
+ int mask, retval;
+ volatile int *a = addr;
+
+ a += nr >> 5;
+ mask = 1 << (nr & 0x1f);
+ retval = (mask & *a) != 0;
+ *a |= mask;
+
+ return retval;
+}
+
extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
{
int mask, retval;
@@ -242,6 +299,20 @@ extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
return retval;
}
+/* WARNING: non atomic and it can be reordered! */
+extern __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
+{
+ int mask, retval;
+ volatile int *a = addr;
+
+ a += nr >> 5;
+ mask = 1 << (nr & 0x1f);
+ retval = (mask & *a) != 0;
+ *a &= ~mask;
+
+ return retval;
+}
+
extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
{
int mask, retval;
@@ -310,13 +381,9 @@ extern __inline__ int find_first_zero_bit (void *addr, unsigned size)
".set\tat\n\t"
".set\treorder\n"
"2:"
- : "=r" (res),
- "=r" (dummy),
- "=r" (addr)
- : "0" ((signed int) 0),
- "1" ((unsigned int) 0xffffffff),
- "2" (addr),
- "r" (size)
+ : "=r" (res), "=r" (dummy), "=r" (addr)
+ : "0" ((signed int) 0), "1" ((unsigned int) 0xffffffff),
+ "2" (addr), "r" (size)
: "$1");
return res;
@@ -345,11 +412,8 @@ extern __inline__ int find_next_zero_bit (void * addr, int size, int offset)
".set\tat\n\t"
".set\treorder\n"
"1:"
- : "=r" (set),
- "=r" (dummy)
- : "0" (0),
- "1" (1 << bit),
- "r" (*p)
+ : "=r" (set), "=r" (dummy)
+ : "0" (0), "1" (1 << bit), "r" (*p)
: "$1");
if (set < (32 - bit))
return set + offset;
diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h
index 8417da12e..f7a6ada7f 100644
--- a/include/asm-mips/fcntl.h
+++ b/include/asm-mips/fcntl.h
@@ -1,13 +1,12 @@
-/* $Id: fcntl.h,v 1.4 1998/09/19 19:19:36 ralf Exp $
- *
+/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1995, 1996, 1997, 1998 by Ralf Baechle
*/
-#ifndef __ASM_MIPS_FCNTL_H
-#define __ASM_MIPS_FCNTL_H
+#ifndef __ASM_FCNTL_H
+#define __ASM_FCNTL_H
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
@@ -60,6 +59,9 @@
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
+/* for leases */
+#define F_INPROGRESS 16
+
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
@@ -67,6 +69,11 @@
blocking */
#define LOCK_UN 8 /* remove lock */
+#define LOCK_MAND 32 /* This is a mandatory flock */
+#define LOCK_READ 64 /* ... Which allows concurrent read operations */
+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
+
typedef struct flock {
short l_type;
short l_whence;
@@ -85,4 +92,6 @@ typedef struct flock64 {
pid_t l_pid;
} flock64_t;
-#endif /* __ASM_MIPS_FCNTL_H */
+#define F_LINUX_SPECIFIC_BASE 1024
+
+#endif /* __ASM_FCNTL_H */
diff --git a/include/asm-mips/resource.h b/include/asm-mips/resource.h
index af41618ba..718e983e6 100644
--- a/include/asm-mips/resource.h
+++ b/include/asm-mips/resource.h
@@ -22,8 +22,9 @@
#define RLIMIT_RSS 7 /* max resident set size */
#define RLIMIT_NPROC 8 /* max number of processes */
#define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
-#define RLIM_NLIMITS 10 /* Number of limit flavors. */
+#define RLIM_NLIMITS 11 /* Number of limit flavors. */
/*
* SuS says limits have to be unsigned.
@@ -45,6 +46,7 @@
{ RLIM_INFINITY, RLIM_INFINITY }, \
{ 0, 0 }, \
{ RLIM_INFINITY, RLIM_INFINITY }, \
+ { RLIM_INFINITY, RLIM_INFINITY }, \
}
#endif /* __KERNEL__ */
diff --git a/include/asm-mips/semaphore.h b/include/asm-mips/semaphore.h
index f8774022f..9be99be4b 100644
--- a/include/asm-mips/semaphore.h
+++ b/include/asm-mips/semaphore.h
@@ -59,7 +59,7 @@ struct semaphore {
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
-extern inline void sema_init (struct semaphore *sem, int val)
+static inline void sema_init (struct semaphore *sem, int val)
{
atomic_set(&sem->count, val);
atomic_set(&sem->waking, 0);
@@ -84,7 +84,7 @@ asmlinkage int __down_interruptible(struct semaphore * sem);
asmlinkage int __down_trylock(struct semaphore * sem);
asmlinkage void __up(struct semaphore * sem);
-extern inline void down(struct semaphore * sem)
+static inline void down(struct semaphore * sem)
{
#if WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
@@ -93,7 +93,7 @@ extern inline void down(struct semaphore * sem)
__down(sem);
}
-extern inline int down_interruptible(struct semaphore * sem)
+static inline int down_interruptible(struct semaphore * sem)
{
int ret = 0;
@@ -107,7 +107,7 @@ extern inline int down_interruptible(struct semaphore * sem)
#if !defined(CONFIG_CPU_HAS_LLSC)
-extern inline int down_trylock(struct semaphore * sem)
+static inline int down_trylock(struct semaphore * sem)
{
int ret = 0;
if (atomic_dec_return(&sem->count) < 0)
@@ -139,7 +139,7 @@ extern inline int down_trylock(struct semaphore * sem)
* }
* }
*/
-extern inline int down_trylock(struct semaphore * sem)
+static inline int down_trylock(struct semaphore * sem)
{
long ret, tmp, tmp2, sub;
@@ -180,7 +180,7 @@ extern inline int down_trylock(struct semaphore * sem)
* Note! This is subtle. We jump to wake people up only if
* the semaphore was negative (== somebody was waiting on it).
*/
-extern inline void up(struct semaphore * sem)
+static inline void up(struct semaphore * sem)
{
#if WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
@@ -247,7 +247,7 @@ struct rw_semaphore {
#define DECLARE_RWSEM_WRITE_LOCKED(name) \
__DECLARE_RWSEM_GENERIC(name, 0)
-extern inline void init_rwsem(struct rw_semaphore *sem)
+static inline void init_rwsem(struct rw_semaphore *sem)
{
atomic_set(&sem->count, RW_LOCK_BIAS);
sem->granted = 0;
@@ -265,7 +265,7 @@ extern void __down_read(struct rw_semaphore *sem, int count);
extern void __down_write(struct rw_semaphore *sem, int count);
extern void __rwsem_wake(struct rw_semaphore *sem, unsigned long readers);
-extern inline void down_read(struct rw_semaphore *sem)
+static inline void down_read(struct rw_semaphore *sem)
{
int count;
@@ -288,7 +288,7 @@ extern inline void down_read(struct rw_semaphore *sem)
#endif
}
-extern inline void down_write(struct rw_semaphore *sem)
+static inline void down_write(struct rw_semaphore *sem)
{
int count;
@@ -317,7 +317,7 @@ extern inline void down_write(struct rw_semaphore *sem)
there was a writer waiting, and we've bumped the count to 0: we must
wake the writer up. */
-extern inline void up_read(struct rw_semaphore *sem)
+static inline void up_read(struct rw_semaphore *sem)
{
#if WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
@@ -336,7 +336,7 @@ extern inline void up_read(struct rw_semaphore *sem)
/*
* Releasing the writer is easy -- just release it and wake up any sleepers.
*/
-extern inline void up_write(struct rw_semaphore *sem)
+static inline void up_write(struct rw_semaphore *sem)
{
int count;
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h
index 724d10520..4ac282bbc 100644
--- a/include/asm-mips/spinlock.h
+++ b/include/asm-mips/spinlock.h
@@ -1,5 +1,4 @@
-/* $Id: spinlock.h,v 1.8 2000/01/23 21:15:52 ralf Exp $
- *
+/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
@@ -29,9 +28,6 @@ typedef struct {
* We make no fairness assumptions. They have a cost.
*/
-typedef struct { unsigned long a[100]; } __dummy_lock_t;
-#define __dummy_lock(lock) (*(__dummy_lock_t *)(lock))
-
static inline void spin_lock(spinlock_t *lock)
{
unsigned int tmp;
@@ -45,8 +41,8 @@ static inline void spin_lock(spinlock_t *lock)
"beqz\t%1, 1b\n\t"
" sync\n\t"
".set\treorder"
- : "=o" (__dummy_lock(lock)), "=&r" (tmp)
- : "o" (__dummy_lock(lock))
+ : "=o" (lock->lock), "=&r" (tmp)
+ : "o" (lock->lock)
: "memory");
}
@@ -57,8 +53,8 @@ static inline void spin_unlock(spinlock_t *lock)
"sync\n\t"
"sw\t$0, %0\n\t"
".set\treorder"
- : "=o" (__dummy_lock(lock))
- : "o" (__dummy_lock(lock))
+ : "=o" (lock->lock)
+ : "o" (lock->lock)
: "memory");
}
@@ -92,8 +88,8 @@ static inline void read_lock(rwlock_t *rw)
"beqz\t%1, 1b\n\t"
" sync\n\t"
".set\treorder"
- : "=o" (__dummy_lock(rw)), "=&r" (tmp)
- : "o" (__dummy_lock(rw))
+ : "=o" (rw->lock), "=&r" (tmp)
+ : "o" (rw->lock)
: "memory");
}
@@ -111,8 +107,8 @@ static inline void read_unlock(rwlock_t *rw)
"sc\t%1, %0\n\t"
"beqz\t%1, 1b\n\t"
".set\treorder"
- : "=o" (__dummy_lock(rw)), "=&r" (tmp)
- : "o" (__dummy_lock(rw))
+ : "=o" (rw->lock), "=&r" (tmp)
+ : "o" (rw->lock)
: "memory");
}
@@ -129,8 +125,8 @@ static inline void write_lock(rwlock_t *rw)
"beqz\t%1, 1b\n\t"
" sync\n\t"
".set\treorder"
- : "=o" (__dummy_lock(rw)), "=&r" (tmp)
- : "o" (__dummy_lock(rw))
+ : "=o" (rw->lock), "=&r" (tmp)
+ : "o" (rw->lock)
: "memory");
}
@@ -141,8 +137,8 @@ static inline void write_unlock(rwlock_t *rw)
"sync\n\t"
"sw\t$0, %0\n\t"
".set\treorder"
- : "=o" (__dummy_lock(rw))
- : "o" (__dummy_lock(rw))
+ : "=o" (rw->lock)
+ : "o" (rw->lock)
: "memory");
}
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index c057c0925..35800cd5b 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -1,5 +1,4 @@
-/* $Id: system.h,v 1.20 1999/12/06 23:13:21 ralf Exp $
- *
+/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
@@ -61,32 +60,30 @@ __cli(void)
: "$1", "memory");
}
-#define __save_flags(x) \
-__asm__ __volatile__( \
- ".set\tpush\n\t" \
- ".set\treorder\n\t" \
- "mfc0\t%0,$12\n\t" \
- ".set\tpop\n\t" \
- : "=r" (x) \
- : /* no inputs */ \
- : "memory")
+#define __save_flags(x) \
+__asm__ __volatile__( \
+ ".set\tpush\n\t" \
+ ".set\treorder\n\t" \
+ "mfc0\t%0,$12\n\t" \
+ ".set\tpop\n\t" \
+ : "=r" (x))
-#define __save_and_cli(x) \
-__asm__ __volatile__( \
- ".set\tpush\n\t" \
- ".set\treorder\n\t" \
- ".set\tnoat\n\t" \
- "mfc0\t%0,$12\n\t" \
- "ori\t$1,%0,1\n\t" \
- "xori\t$1,1\n\t" \
- ".set\tnoreorder\n\t" \
- "mtc0\t$1,$12\n\t" \
- "nop\n\t" \
- "nop\n\t" \
- "nop\n\t" \
- ".set\tpop\n\t" \
- : "=r" (x) \
- : /* no inputs */ \
+#define __save_and_cli(x) \
+__asm__ __volatile__( \
+ ".set\tpush\n\t" \
+ ".set\treorder\n\t" \
+ ".set\tnoat\n\t" \
+ "mfc0\t%0,$12\n\t" \
+ "ori\t$1,%0,1\n\t" \
+ "xori\t$1,1\n\t" \
+ ".set\tnoreorder\n\t" \
+ "mtc0\t$1,$12\n\t" \
+ "nop\n\t" \
+ "nop\n\t" \
+ "nop\n\t" \
+ ".set\tpop\n\t" \
+ : "=r" (x) \
+ : /* no inputs */ \
: "$1", "memory")
extern void __inline__
@@ -131,11 +128,14 @@ __restore_flags(int flags)
* These are probably defined overly paranoid ...
*/
#ifdef CONFIG_CPU_HAS_WB
+
#include <asm/wbflush.h>
#define rmb()
#define wmb() wbflush()
#define mb() wbflush()
-#else
+
+#else /* CONFIG_CPU_HAS_WB */
+
#define mb() \
__asm__ __volatile__( \
"# prevent instructions being moved around\n\t" \
@@ -148,6 +148,17 @@ __asm__ __volatile__( \
: "memory")
#define rmb() mb()
#define wmb() mb()
+
+#endif /* CONFIG_CPU_HAS_WB */
+
+#ifdef CONFIG_SMP
+#define smp_mb() mb()
+#define smp_rmb() rmb()
+#define smp_wmb() wmb()
+#else
+#define smp_mb() barrier()
+#define smp_rmb() barrier()
+#define smp_wmb() barrier()
#endif
#define set_mb(var, value) \
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h
index 2d3cc959d..c94006594 100644
--- a/include/asm-mips/uaccess.h
+++ b/include/asm-mips/uaccess.h
@@ -84,24 +84,6 @@ extern inline int verify_area(int type, const void * addr, unsigned long size)
#define __get_user(x,ptr) \
__get_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
-/*
- * The "xxx_ret" versions return constant specified in third argument, if
- * something bad happens. These macros can be optimized for the
- * case of just returning from the function xxx_ret is used.
- */
-
-#define put_user_ret(x,ptr,ret) ({ \
-if (put_user(x,ptr)) return ret; })
-
-#define get_user_ret(x,ptr,ret) ({ \
-if (get_user(x,ptr)) return ret; })
-
-#define __put_user_ret(x,ptr,ret) ({ \
-if (__put_user(x,ptr)) return ret; })
-
-#define __get_user_ret(x,ptr,ret) ({ \
-if (__get_user(x,ptr)) return ret; })
-
struct __large_struct { unsigned long buf[100]; };
#define __m(x) (*(struct __large_struct *)(x))
@@ -281,16 +263,6 @@ extern void __put_user_unknown(void);
"jal\t" #destination "\n\t"
#endif
-#define copy_to_user_ret(to,from,n,retval) ({ \
-if (copy_to_user(to,from,n)) \
- return retval; \
-})
-
-#define copy_from_user_ret(to,from,n,retval) ({ \
-if (copy_from_user(to,from,n)) \
- return retval; \
-})
-
extern size_t __copy_user(void *__to, const void *__from, size_t __n);
#define __copy_to_user(to,from,n) ({ \
diff --git a/include/asm-mips64/atomic.h b/include/asm-mips64/atomic.h
index 5d57f8a8c..0ed12d406 100644
--- a/include/asm-mips64/atomic.h
+++ b/include/asm-mips64/atomic.h
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
* Atomic operations that C can't guarantee us. Useful for
* resource counting etc..
*
@@ -10,20 +9,14 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 1996, 1997, 1999 by Ralf Baechle
+ * Copyright (C) 1996, 1997, 1999, 2000 by Ralf Baechle
*/
#ifndef _ASM_ATOMIC_H
#define _ASM_ATOMIC_H
-#include <linux/config.h>
-
#include <asm/sgidefs.h>
-#ifdef CONFIG_SMP
typedef struct { volatile int counter; } atomic_t;
-#else
-typedef struct { int counter; } atomic_t;
-#endif
#ifdef __KERNEL__
#define ATOMIC_INIT(i) { (i) }
@@ -31,26 +24,17 @@ typedef struct { int counter; } atomic_t;
#define atomic_read(v) ((v)->counter)
#define atomic_set(v,i) ((v)->counter = (i))
-/*
- * Make sure gcc doesn't try to be clever and move things around
- * on us. We need to use _exactly_ the address the user gave us,
- * not some alias that contains the same information.
- */
-#define __atomic_fool_gcc(x) (*(volatile struct { int a[100]; } *)x)
-
extern __inline__ void atomic_add(int i, volatile atomic_t * v)
{
unsigned long temp;
__asm__ __volatile__(
- "1:\tll\t%0,%1\n\t"
+ "1:\tll\t%0,%1\t\t\t# atomic_add\n\t"
"addu\t%0,%2\n\t"
"sc\t%0,%1\n\t"
"beqz\t%0,1b"
- :"=&r" (temp),
- "=m" (__atomic_fool_gcc(v))
- :"Ir" (i),
- "m" (__atomic_fool_gcc(v)));
+ : "=&r" (temp), "=m" (v->counter)
+ : "Ir" (i), "m" (v->counter));
}
extern __inline__ void atomic_sub(int i, volatile atomic_t * v)
@@ -58,14 +42,12 @@ extern __inline__ void atomic_sub(int i, volatile atomic_t * v)
unsigned long temp;
__asm__ __volatile__(
- "1:\tll\t%0,%1\n\t"
+ "1:\tll\t%0,%1\t\t\t# atomic_sub\n\t"
"subu\t%0,%2\n\t"
"sc\t%0,%1\n\t"
"beqz\t%0,1b"
- :"=&r" (temp),
- "=m" (__atomic_fool_gcc(v))
- :"Ir" (i),
- "m" (__atomic_fool_gcc(v)));
+ : "=&r" (temp), "=m" (v->counter)
+ : "Ir" (i), "m" (v->counter));
}
/*
@@ -76,18 +58,15 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)
unsigned long temp, result;
__asm__ __volatile__(
- ".set\tnoreorder\n"
+ ".set\tnoreorder\t\t\t# atomic_add_return\n"
"1:\tll\t%1,%2\n\t"
"addu\t%0,%1,%3\n\t"
"sc\t%0,%2\n\t"
"beqz\t%0,1b\n\t"
"addu\t%0,%1,%3\n\t"
".set\treorder"
- :"=&r" (result),
- "=&r" (temp),
- "=m" (__atomic_fool_gcc(v))
- :"Ir" (i),
- "m" (__atomic_fool_gcc(v)));
+ : "=&r" (result), "=&r" (temp), "=m" (v->counter)
+ : "Ir" (i), "m" (v->counter));
return result;
}
@@ -97,18 +76,15 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v)
unsigned long temp, result;
__asm__ __volatile__(
- ".set\tnoreorder\n"
+ ".set\tnoreorder\t\t\t# atomic_sub_return\n"
"1:\tll\t%1,%2\n\t"
"subu\t%0,%1,%3\n\t"
"sc\t%0,%2\n\t"
"beqz\t%0,1b\n\t"
"subu\t%0,%1,%3\n\t"
".set\treorder"
- :"=&r" (result),
- "=&r" (temp),
- "=m" (__atomic_fool_gcc(v))
- :"Ir" (i),
- "m" (__atomic_fool_gcc(v)));
+ : "=&r" (result), "=&r" (temp), "=m" (v->counter)
+ : "Ir" (i), "m" (v->counter));
return result;
}
diff --git a/include/asm-mips64/bitops.h b/include/asm-mips64/bitops.h
index a6ff41cc0..179eff6f9 100644
--- a/include/asm-mips64/bitops.h
+++ b/include/asm-mips64/bitops.h
@@ -21,6 +21,12 @@
#include <asm/mipsregs.h>
/*
+ * clear_bit() doesn't provide any barrier for the compiler.
+ */
+#define smp_mb__before_clear_bit() barrier()
+#define smp_mb__after_clear_bit() barrier()
+
+/*
* These functions for MIPS ISA > 1 are interrupt and SMP proof and
* interrupt friendly
*/
@@ -36,8 +42,17 @@ set_bit(unsigned long nr, volatile void *addr)
"or\t%0, %2\n\t"
"scd\t%0, %1\n\t"
"beqz\t%0, 1b"
- :"=&r" (temp), "=m" (*m)
- :"ir" (1UL << (nr & 0x3f)), "m" (*m));
+ : "=&r" (temp), "=m" (*m)
+ : "ir" (1UL << (nr & 0x3f)), "m" (*m)
+ : "memory");
+}
+
+/* WARNING: non atomic and it can be reordered! */
+extern __inline__ void __set_bit(int nr, volatile void * addr)
+{
+ unsigned long * m = ((unsigned long *) addr) + (nr >> 6);
+
+ *m |= 1UL << (nr & 0x3f);
}
extern __inline__ void
@@ -51,10 +66,11 @@ clear_bit(unsigned long nr, volatile void *addr)
"and\t%0, %2\n\t"
"scd\t%0, %1\n\t"
"beqz\t%0, 1b\n\t"
- :"=&r" (temp), "=m" (*m)
- :"ir" (~(1UL << (nr & 0x3f))), "m" (*m));
+ : "=&r" (temp), "=m" (*m)
+ : "ir" (~(1UL << (nr & 0x3f))), "m" (*m));
}
+
extern __inline__ void
change_bit(unsigned long nr, volatile void *addr)
{
@@ -84,12 +100,26 @@ test_and_set_bit(unsigned long nr, volatile void *addr)
"beqz\t%2, 1b\n\t"
" and\t%2, %0, %3\n\t"
".set\treorder"
- :"=&r" (temp), "=m" (*m), "=&r" (res)
- :"r" (1UL << (nr & 0x3f)), "m" (*m));
+ : "=&r" (temp), "=m" (*m), "=&r" (res)
+ : "r" (1UL << (nr & 0x3f)), "m" (*m)
+ : "memory");
return res != 0;
}
+extern __inline__ int __test_and_set_bit(int nr, volatile void * addr)
+{
+ int mask, retval;
+ volatile long *a = addr;
+
+ a += nr >> 6;
+ mask = 1 << (nr & 0x3f);
+ retval = (mask & *a) != 0;
+ *a |= mask;
+
+ return retval;
+}
+
extern __inline__ unsigned long
test_and_clear_bit(unsigned long nr, volatile void *addr)
{
@@ -105,12 +135,26 @@ test_and_clear_bit(unsigned long nr, volatile void *addr)
"beqz\t%2, 1b\n\t"
" and\t%2, %0, %3\n\t"
".set\treorder"
- :"=&r" (temp), "=m" (*m), "=&r" (res)
- :"r" (1UL << (nr & 0x3f)), "m" (*m));
+ : "=&r" (temp), "=m" (*m), "=&r" (res)
+ : "r" (1UL << (nr & 0x3f)), "m" (*m)
+ : "memory");
return res != 0;
}
+extern __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
+{
+ int mask, retval;
+ volatile long *a = addr;
+
+ a += nr >> 6;
+ mask = 1 << (nr & 0x3f);
+ retval = (mask & *a) != 0;
+ *a &= ~mask;
+
+ return retval;
+}
+
extern __inline__ unsigned long
test_and_change_bit(unsigned long nr, volatile void *addr)
{
@@ -125,8 +169,9 @@ test_and_change_bit(unsigned long nr, volatile void *addr)
"beqz\t%2, 1b\n\t"
" and\t%2, %0, %3\n\t"
".set\treorder"
- :"=&r" (temp), "=m" (*m), "=&r" (res)
- :"r" (1UL << (nr & 0x3f)), "m" (*m));
+ : "=&r" (temp), "=m" (*m), "=&r" (res)
+ : "r" (1UL << (nr & 0x3f)), "m" (*m)
+ : "memory");
return res != 0;
}
@@ -175,13 +220,9 @@ find_first_zero_bit (void *addr, unsigned size)
".set\tat\n\t"
".set\treorder\n"
"2:"
- : "=r" (res),
- "=r" (dummy),
- "=r" (addr)
- : "0" ((signed int) 0),
- "1" ((unsigned int) 0xffffffff),
- "2" (addr),
- "r" (size)
+ : "=r" (res), "=r" (dummy), "=r" (addr)
+ : "0" ((signed int) 0), "1" ((unsigned int) 0xffffffff),
+ "2" (addr), "r" (size)
: "$1");
return res;
@@ -208,11 +249,8 @@ find_next_zero_bit (void * addr, int size, int offset)
".set\tat\n\t"
".set\treorder\n"
"1:"
- : "=r" (set),
- "=r" (dummy)
- : "0" (0),
- "1" (1 << bit),
- "r" (*p)
+ : "=r" (set), "=r" (dummy)
+ : "0" (0), "1" (1 << bit), "r" (*p)
: "$1");
if (set < (32 - bit))
return set + offset;
diff --git a/include/asm-mips64/fcntl.h b/include/asm-mips64/fcntl.h
index 95d7dd1c9..3e714eff2 100644
--- a/include/asm-mips64/fcntl.h
+++ b/include/asm-mips64/fcntl.h
@@ -62,6 +62,9 @@
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
+/* for leases */
+#define F_INPROGRESS 16
+
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
@@ -69,6 +72,11 @@
blocking */
#define LOCK_UN 8 /* remove lock */
+#define LOCK_MAND 32 /* This is a mandatory flock */
+#define LOCK_READ 64 /* ... Which allows concurrent read operations */
+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
+
typedef struct flock {
short l_type;
short l_whence;
@@ -83,4 +91,6 @@ typedef struct flock {
#define flock64 flock
#endif
+#define F_LINUX_SPECIFIC_BASE 1024
+
#endif /* _ASM_FCNTL_H */
diff --git a/include/asm-mips64/resource.h b/include/asm-mips64/resource.h
index b4af33144..448a8bb3a 100644
--- a/include/asm-mips64/resource.h
+++ b/include/asm-mips64/resource.h
@@ -23,8 +23,9 @@
#define RLIMIT_RSS 7 /* max resident set size */
#define RLIMIT_NPROC 8 /* max number of processes */
#define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
-#define RLIM_NLIMITS 10 /* Number of limit flavors. */
+#define RLIM_NLIMITS 11 /* Number of limit flavors. */
/*
* SuS says limits have to be unsigned.
@@ -46,6 +47,7 @@
{ RLIM_INFINITY, RLIM_INFINITY }, \
{ 0, 0 }, \
{ RLIM_INFINITY, RLIM_INFINITY }, \
+ { RLIM_INFINITY, RLIM_INFINITY }, \
}
#endif /* __KERNEL__ */
diff --git a/include/asm-mips64/semaphore-helper.h b/include/asm-mips64/semaphore-helper.h
index fa2f70645..91799d486 100644
--- a/include/asm-mips64/semaphore-helper.h
+++ b/include/asm-mips64/semaphore-helper.h
@@ -1,5 +1,4 @@
-/* $Id: semaphore-helper.h,v 1.2 1999/10/20 18:10:32 ralf Exp $
- *
+/*
* SMP- and interrupt-safe semaphores helper functions.
*
* (C) Copyright 1996 Linus Torvalds
@@ -31,8 +30,8 @@ waking_non_zero(struct semaphore *sem)
"beqz\t%0, 1b\n\t"
"2:"
".text"
- : "=r"(ret), "=r"(tmp), "=m"(__atomic_fool_gcc(&sem->waking))
- : "0"(0));
+ : "=r" (ret), "=r" (tmp), "=m" (sem->waking)
+ : "0" (0));
return ret;
}
@@ -88,8 +87,8 @@ waking_non_zero_interruptible(struct semaphore *sem, struct task_struct *tsk)
scd %1, %2
beqz %1, 0b
.set pop"
- : "=&r"(ret), "=&r"(tmp), "=m"(*sem)
- : "r"(signal_pending(tsk)), "i"(-EINTR));
+ : "=&r" (ret), "=&r" (tmp), "=m" (*sem)
+ : "r" (signal_pending(tsk)), "i" (-EINTR));
#elif defined(__MIPSEL__)
@@ -121,8 +120,8 @@ waking_non_zero_interruptible(struct semaphore *sem, struct task_struct *tsk)
scd %1, %2
beqz %1, 0b
.set pop"
- : "=&r"(ret), "=&r"(tmp), "=m"(*sem)
- : "r"(signal_pending(tsk)), "i"(-EINTR));
+ : "=&r" (ret), "=&r" (tmp), "=m" (*sem)
+ : "r" (signal_pending(tsk)), "i" (-EINTR));
#else
#error "MIPS but neither __MIPSEL__ nor __MIPSEB__?"
diff --git a/include/asm-mips64/semaphore.h b/include/asm-mips64/semaphore.h
index 0ca9689e6..2e164ab33 100644
--- a/include/asm-mips64/semaphore.h
+++ b/include/asm-mips64/semaphore.h
@@ -1,5 +1,4 @@
-/* $Id: semaphore.h,v 1.5 2000/02/18 00:24:49 ralf Exp $
- *
+/*
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
@@ -55,7 +54,7 @@ struct semaphore {
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
-extern inline void sema_init (struct semaphore *sem, int val)
+static inline void sema_init (struct semaphore *sem, int val)
{
atomic_set(&sem->count, val);
atomic_set(&sem->waking, 0);
@@ -80,7 +79,7 @@ asmlinkage int __down_interruptible(struct semaphore * sem);
asmlinkage int __down_trylock(struct semaphore * sem);
asmlinkage void __up(struct semaphore * sem);
-extern inline void down(struct semaphore * sem)
+static inline void down(struct semaphore * sem)
{
#if WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
@@ -89,7 +88,7 @@ extern inline void down(struct semaphore * sem)
__down(sem);
}
-extern inline int down_interruptible(struct semaphore * sem)
+static inline int down_interruptible(struct semaphore * sem)
{
int ret = 0;
@@ -122,7 +121,7 @@ extern inline int down_interruptible(struct semaphore * sem)
* }
* }
*/
-extern inline int down_trylock(struct semaphore * sem)
+static inline int down_trylock(struct semaphore * sem)
{
long ret, tmp, tmp2, sub;
@@ -161,7 +160,7 @@ extern inline int down_trylock(struct semaphore * sem)
* Note! This is subtle. We jump to wake people up only if
* the semaphore was negative (== somebody was waiting on it).
*/
-extern inline void up(struct semaphore * sem)
+static inline void up(struct semaphore * sem)
{
#if WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
@@ -228,7 +227,7 @@ struct rw_semaphore {
#define DECLARE_RWSEM_WRITE_LOCKED(name) \
__DECLARE_RWSEM_GENERIC(name, 0)
-extern inline void init_rwsem(struct rw_semaphore *sem)
+static inline void init_rwsem(struct rw_semaphore *sem)
{
atomic_set(&sem->count, RW_LOCK_BIAS);
sem->granted = 0;
@@ -246,7 +245,7 @@ extern void __down_read(struct rw_semaphore *sem, int count);
extern void __down_write(struct rw_semaphore *sem, int count);
extern void __rwsem_wake(struct rw_semaphore *sem, unsigned long readers);
-extern inline void down_read(struct rw_semaphore *sem)
+static inline void down_read(struct rw_semaphore *sem)
{
int count;
@@ -269,7 +268,7 @@ extern inline void down_read(struct rw_semaphore *sem)
#endif
}
-extern inline void down_write(struct rw_semaphore *sem)
+static inline void down_write(struct rw_semaphore *sem)
{
int count;
@@ -298,7 +297,7 @@ extern inline void down_write(struct rw_semaphore *sem)
there was a writer waiting, and we've bumped the count to 0: we must
wake the writer up. */
-extern inline void up_read(struct rw_semaphore *sem)
+static inline void up_read(struct rw_semaphore *sem)
{
int count;
@@ -321,7 +320,7 @@ extern inline void up_read(struct rw_semaphore *sem)
/*
* Releasing the writer is easy -- just release it and wake up any sleepers.
*/
-extern inline void up_write(struct rw_semaphore *sem)
+static inline void up_write(struct rw_semaphore *sem)
{
int count;
diff --git a/include/asm-mips64/spinlock.h b/include/asm-mips64/spinlock.h
index 9a1ccf198..7e560d4c0 100644
--- a/include/asm-mips64/spinlock.h
+++ b/include/asm-mips64/spinlock.h
@@ -1,5 +1,4 @@
-/* $Id: spinlock.h,v 1.4 2000/01/25 00:41:46 ralf Exp $
- *
+/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
@@ -32,9 +31,6 @@ typedef struct {
* We make no fairness assumptions. They have a cost.
*/
-typedef struct { unsigned long a[100]; } __dummy_lock_t;
-#define __dummy_lock(lock) (*(__dummy_lock_t *)(lock))
-
static inline void spin_lock(spinlock_t *lock)
{
unsigned int tmp;
@@ -48,8 +44,8 @@ static inline void spin_lock(spinlock_t *lock)
"beqz\t%1, 1b\n\t"
" sync\n\t"
".set\treorder"
- : "=o" (__dummy_lock(lock)), "=&r" (tmp)
- : "o" (__dummy_lock(lock))
+ : "=o" (lock->lock), "=&r" (tmp)
+ : "o" (lock->lock)
: "memory");
}
@@ -60,8 +56,8 @@ static inline void spin_unlock(spinlock_t *lock)
"sync\n\t"
"sw\t$0, %0\n\t"
".set\treorder"
- : "=o" (__dummy_lock(lock))
- : "o" (__dummy_lock(lock))
+ : "=o" (lock->lock)
+ : "o" (lock->lock)
: "memory");
}
@@ -77,8 +73,8 @@ static inline unsigned int spin_trylock(spinlock_t *lock)
"beqz\t%2, 1b\n\t"
" and\t%2, %0, %3\n\t"
".set\treorder"
- :"=&r" (temp), "=m" (*lock), "=&r" (res)
- :"r" (1), "m" (*lock)
+ : "=&r" (temp), "=m" (lock->lock), "=&r" (res)
+ : "r" (1), "m" (lock->lock)
: "memory");
return res == 0;
@@ -112,8 +108,8 @@ static inline void read_lock(rwlock_t *rw)
"beqz\t%1, 1b\n\t"
" sync\n\t"
".set\treorder"
- : "=o" (__dummy_lock(rw)), "=&r" (tmp)
- : "o" (__dummy_lock(rw))
+ : "=o" (rw->lock), "=&r" (tmp)
+ : "o" (rw->lock)
: "memory");
}
@@ -132,8 +128,8 @@ static inline void read_unlock(rwlock_t *rw)
"beqz\t%1, 1b\n\t"
"sync\n\t"
".set\treorder"
- : "=o" (__dummy_lock(rw)), "=&r" (tmp)
- : "o" (__dummy_lock(rw))
+ : "=o" (rw->lock), "=&r" (tmp)
+ : "o" (rw->lock)
: "memory");
}
@@ -150,8 +146,8 @@ static inline void write_lock(rwlock_t *rw)
"beqz\t%1, 1b\n\t"
" sync\n\t"
".set\treorder"
- : "=o" (__dummy_lock(rw)), "=&r" (tmp)
- : "o" (__dummy_lock(rw))
+ : "=o" (rw->lock), "=&r" (tmp)
+ : "o" (rw->lock)
: "memory");
}
@@ -162,8 +158,8 @@ static inline void write_unlock(rwlock_t *rw)
"sync\n\t"
"sw\t$0, %0\n\t"
".set\treorder"
- : "=o" (__dummy_lock(rw))
- : "o" (__dummy_lock(rw))
+ : "=o" (rw->lock)
+ : "o" (rw->lock)
: "memory");
}
diff --git a/include/asm-mips64/system.h b/include/asm-mips64/system.h
index 4b9d9f551..ca81b8bf5 100644
--- a/include/asm-mips64/system.h
+++ b/include/asm-mips64/system.h
@@ -65,9 +65,7 @@ __asm__ __volatile__( \
".set\tnoreorder\n\t" \
"mfc0\t%0,$12\n\t" \
".set\treorder" \
- : "=r" (x) \
- : /* no inputs */ \
- : "memory")
+ : "=r" (x))
#define __save_and_cli(x) \
__asm__ __volatile__( \
@@ -142,8 +140,7 @@ extern void __global_restore_flags(unsigned long);
__asm__ __volatile__( \
"# prevent instructions being moved around\n\t" \
".set\tnoreorder\n\t" \
- "# 8 nops to fool the R4400 pipeline\n\t" \
- "nop;nop;nop;nop;nop;nop;nop;nop\n\t" \
+ "sync\n\t" \
".set\treorder" \
: /* no output */ \
: /* no input */ \
@@ -151,6 +148,16 @@ __asm__ __volatile__( \
#define rmb() mb()
#define wmb() mb()
+#ifdef CONFIG_SMP
+#define smp_mb() mb()
+#define smp_rmb() rmb()
+#define smp_wmb() wmb()
+#else
+#define smp_mb() barrier()
+#define smp_rmb() barrier()
+#define smp_wmb() barrier()
+#endif
+
#define set_mb(var, value) \
do { var = value; mb(); } while (0)
diff --git a/include/asm-mips64/uaccess.h b/include/asm-mips64/uaccess.h
index 2a9f2ee16..1727b8de2 100644
--- a/include/asm-mips64/uaccess.h
+++ b/include/asm-mips64/uaccess.h
@@ -84,18 +84,6 @@ extern inline int verify_area(int type, const void * addr, unsigned long size)
#define __get_user(x,ptr) \
__get_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
-/*
- * The "xxx_ret" versions return constant specified in third argument, if
- * something bad happens. These macros can be optimized for the
- * case of just returning from the function xxx_ret is used.
- */
-
-#define put_user_ret(x,ptr,ret) ({ if (put_user(x,ptr)) return ret; })
-#define get_user_ret(x,ptr,ret) ({ if (get_user(x,ptr)) return ret; })
-
-#define __put_user_ret(x,ptr,ret) ({ if (__put_user(x,ptr)) return ret; })
-#define __get_user_ret(x,ptr,ret) ({ if (__get_user(x,ptr)) return ret; })
-
struct __large_struct { unsigned long buf[100]; };
#define __m(x) (*(struct __large_struct *)(x))
@@ -213,16 +201,6 @@ extern void __put_user_unknown(void);
"jal\t" #destination "\n\t"
#endif
-#define copy_to_user_ret(to,from,n,retval) ({ \
-if (copy_to_user(to,from,n)) \
- return retval; \
-})
-
-#define copy_from_user_ret(to,from,n,retval) ({ \
-if (copy_from_user(to,from,n)) \
- return retval; \
-})
-
extern size_t __copy_user(void *__to, const void *__from, size_t __n);
#define __copy_to_user(to,from,n) ({ \
diff --git a/include/asm-ppc/atomic.h b/include/asm-ppc/atomic.h
index c3c5133d6..cf0e122dc 100644
--- a/include/asm-ppc/atomic.h
+++ b/include/asm-ppc/atomic.h
@@ -5,13 +5,7 @@
#ifndef _ASM_PPC_ATOMIC_H_
#define _ASM_PPC_ATOMIC_H_
-#include <linux/config.h>
-
-#ifdef CONFIG_SMP
typedef struct { volatile int counter; } atomic_t;
-#else
-typedef struct { int counter; } atomic_t;
-#endif
#define ATOMIC_INIT(i) { (i) }
@@ -21,7 +15,7 @@ typedef struct { int counter; } atomic_t;
extern void atomic_clear_mask(unsigned long mask, unsigned long *addr);
extern void atomic_set_mask(unsigned long mask, unsigned long *addr);
-extern __inline__ int atomic_add_return(int a, atomic_t *v)
+static __inline__ int atomic_add_return(int a, atomic_t *v)
{
int t;
@@ -30,14 +24,14 @@ extern __inline__ int atomic_add_return(int a, atomic_t *v)
add %0,%2,%0\n\
stwcx. %0,0,%3\n\
bne- 1b"
- : "=&r" (t), "=m" (*v)
- : "r" (a), "r" (v), "m" (*v)
+ : "=&r" (t), "=m" (v->counter)
+ : "r" (a), "r" (v), "m" (v->counter)
: "cc");
return t;
}
-extern __inline__ int atomic_sub_return(int a, atomic_t *v)
+static __inline__ int atomic_sub_return(int a, atomic_t *v)
{
int t;
@@ -46,14 +40,14 @@ extern __inline__ int atomic_sub_return(int a, atomic_t *v)
subf %0,%2,%0\n\
stwcx. %0,0,%3\n\
bne- 1b"
- : "=&r" (t), "=m" (*v)
- : "r" (a), "r" (v), "m" (*v)
+ : "=&r" (t), "=m" (v->counter)
+ : "r" (a), "r" (v), "m" (v->counter)
: "cc");
return t;
}
-extern __inline__ int atomic_inc_return(atomic_t *v)
+static __inline__ int atomic_inc_return(atomic_t *v)
{
int t;
@@ -62,14 +56,14 @@ extern __inline__ int atomic_inc_return(atomic_t *v)
addic %0,%0,1\n\
stwcx. %0,0,%2\n\
bne- 1b"
- : "=&r" (t), "=m" (*v)
- : "r" (v), "m" (*v)
+ : "=&r" (t), "=m" (v->counter)
+ : "r" (v), "m" (v->counter)
: "cc");
return t;
}
-extern __inline__ int atomic_dec_return(atomic_t *v)
+static __inline__ int atomic_dec_return(atomic_t *v)
{
int t;
@@ -78,8 +72,8 @@ extern __inline__ int atomic_dec_return(atomic_t *v)
addic %0,%0,-1\n\
stwcx. %0,0,%2\n\
bne 1b"
- : "=&r" (t), "=m" (*v)
- : "r" (v), "m" (*v)
+ : "=&r" (t), "=m" (v->counter)
+ : "r" (v), "m" (v->counter)
: "cc");
return t;
diff --git a/include/asm-ppc/backlight.h b/include/asm-ppc/backlight.h
index db315e677..79756eca3 100644
--- a/include/asm-ppc/backlight.h
+++ b/include/asm-ppc/backlight.h
@@ -25,4 +25,4 @@ extern int get_backlight_enable(void);
extern int set_backlight_level(int level);
extern int get_backlight_level(void);
-#endif \ No newline at end of file
+#endif
diff --git a/include/asm-ppc/bitops.h b/include/asm-ppc/bitops.h
index ccb0f199f..b82a9fc21 100644
--- a/include/asm-ppc/bitops.h
+++ b/include/asm-ppc/bitops.h
@@ -9,17 +9,9 @@
#include <linux/config.h>
#include <asm/byteorder.h>
-extern void set_bit(int nr, volatile void *addr);
-extern void clear_bit(int nr, volatile void *addr);
-extern void change_bit(int nr, volatile void *addr);
-extern int test_and_set_bit(int nr, volatile void *addr);
-extern int test_and_clear_bit(int nr, volatile void *addr);
-extern int test_and_change_bit(int nr, volatile void *addr);
-
/*
- * Arguably these bit operations don't imply any memory barrier or
- * SMP ordering, but in fact a lot of drivers expect them to imply
- * both, since they do on x86 cpus.
+ * The test_and_*_bit operations are taken to imply a memory barrier
+ * on SMP systems.
*/
#ifdef CONFIG_SMP
#define SMP_WMB "eieio\n"
@@ -36,58 +28,75 @@ extern int test_and_change_bit(int nr, volatile void *addr);
* These used to be if'd out here because using : "cc" as a constraint
* resulted in errors from egcs. Things may be OK with gcc-2.95.
*/
-extern __inline__ void set_bit(int nr, volatile void * addr)
+static __inline__ void set_bit(int nr, volatile void * addr)
{
unsigned long old;
unsigned long mask = 1 << (nr & 0x1f);
unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
- __asm__ __volatile__(SMP_WMB "\
+ __asm__ __volatile__("\
1: lwarx %0,0,%3
or %0,%0,%2
stwcx. %0,0,%3
- bne 1b"
- SMP_MB
+ bne- 1b"
: "=&r" (old), "=m" (*p)
: "r" (mask), "r" (p), "m" (*p)
: "cc" );
}
-extern __inline__ void clear_bit(int nr, volatile void *addr)
+/*
+ * non-atomic version
+ */
+static __inline__ void __set_bit(int nr, volatile void *addr)
+{
+ unsigned long mask = 1 << (nr & 0x1f);
+ unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
+
+ *p |= mask;
+}
+
+/*
+ * clear_bit doesn't imply a memory barrier
+ */
+#define smp_mb__before_clear_bit() smp_mb()
+#define smp_mb__after_clear_bit() smp_mb()
+
+static __inline__ void clear_bit(int nr, volatile void *addr)
{
unsigned long old;
unsigned long mask = 1 << (nr & 0x1f);
unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
- __asm__ __volatile__(SMP_WMB "\
+ __asm__ __volatile__("\
1: lwarx %0,0,%3
andc %0,%0,%2
stwcx. %0,0,%3
- bne 1b"
- SMP_MB
+ bne- 1b"
: "=&r" (old), "=m" (*p)
: "r" (mask), "r" (p), "m" (*p)
: "cc");
}
-extern __inline__ void change_bit(int nr, volatile void *addr)
+static __inline__ void change_bit(int nr, volatile void *addr)
{
unsigned long old;
unsigned long mask = 1 << (nr & 0x1f);
unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
- __asm__ __volatile__(SMP_WMB "\
+ __asm__ __volatile__("\
1: lwarx %0,0,%3
xor %0,%0,%2
stwcx. %0,0,%3
- bne 1b"
- SMP_MB
+ bne- 1b"
: "=&r" (old), "=m" (*p)
: "r" (mask), "r" (p), "m" (*p)
: "cc");
}
-extern __inline__ int test_and_set_bit(int nr, volatile void *addr)
+/*
+ * test_and_*_bit do imply a memory barrier (?)
+ */
+static __inline__ int test_and_set_bit(int nr, volatile void *addr)
{
unsigned int old, t;
unsigned int mask = 1 << (nr & 0x1f);
@@ -101,12 +110,25 @@ extern __inline__ int test_and_set_bit(int nr, volatile void *addr)
SMP_MB
: "=&r" (old), "=&r" (t), "=m" (*p)
: "r" (mask), "r" (p), "m" (*p)
- : "cc");
+ : "cc", "memory");
return (old & mask) != 0;
}
-extern __inline__ int test_and_clear_bit(int nr, volatile void *addr)
+/*
+ * non-atomic version
+ */
+static __inline__ int __test_and_set_bit(int nr, volatile void *addr)
+{
+ unsigned long mask = 1 << (nr & 0x1f);
+ unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
+ unsigned long old = *p;
+
+ *p = old | mask;
+ return (old & mask) != 0;
+}
+
+static __inline__ int test_and_clear_bit(int nr, volatile void *addr)
{
unsigned int old, t;
unsigned int mask = 1 << (nr & 0x1f);
@@ -120,12 +142,25 @@ extern __inline__ int test_and_clear_bit(int nr, volatile void *addr)
SMP_MB
: "=&r" (old), "=&r" (t), "=m" (*p)
: "r" (mask), "r" (p), "m" (*p)
- : "cc");
+ : "cc", "memory");
return (old & mask) != 0;
}
-extern __inline__ int test_and_change_bit(int nr, volatile void *addr)
+/*
+ * non-atomic version
+ */
+static __inline__ int __test_and_clear_bit(int nr, volatile void *addr)
+{
+ unsigned long mask = 1 << (nr & 0x1f);
+ unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
+ unsigned long old = *p;
+
+ *p = old & ~mask;
+ return (old & mask) != 0;
+}
+
+static __inline__ int test_and_change_bit(int nr, volatile void *addr)
{
unsigned int old, t;
unsigned int mask = 1 << (nr & 0x1f);
@@ -139,13 +174,22 @@ extern __inline__ int test_and_change_bit(int nr, volatile void *addr)
SMP_MB
: "=&r" (old), "=&r" (t), "=m" (*p)
: "r" (mask), "r" (p), "m" (*p)
- : "cc");
+ : "cc", "memory");
return (old & mask) != 0;
}
+#else /* __INLINE_BITOPS */
+
+extern void set_bit(int nr, volatile void *addr);
+extern void clear_bit(int nr, volatile void *addr);
+extern void change_bit(int nr, volatile void *addr);
+extern int test_and_set_bit(int nr, volatile void *addr);
+extern int test_and_clear_bit(int nr, volatile void *addr);
+extern int test_and_change_bit(int nr, volatile void *addr);
+
#endif /* __INLINE_BITOPS */
-extern __inline__ int test_bit(int nr, __const__ volatile void *addr)
+static __inline__ int test_bit(int nr, __const__ volatile void *addr)
{
__const__ unsigned int *p = (__const__ unsigned int *) addr;
@@ -153,7 +197,7 @@ extern __inline__ int test_bit(int nr, __const__ volatile void *addr)
}
/* Return the bit position of the most significant 1 bit in a word */
-extern __inline__ int __ilog2(unsigned int x)
+static __inline__ int __ilog2(unsigned int x)
{
int lz;
@@ -161,7 +205,7 @@ extern __inline__ int __ilog2(unsigned int x)
return 31 - lz;
}
-extern __inline__ int ffz(unsigned int x)
+static __inline__ int ffz(unsigned int x)
{
if ((x = ~x) == 0)
return 32;
@@ -175,7 +219,7 @@ extern __inline__ int ffz(unsigned int x)
* the libc and compiler builtin ffs routines, therefore
* differs in spirit from the above ffz (man ffs).
*/
-extern __inline__ int ffs(int x)
+static __inline__ int ffs(int x)
{
return __ilog2(x & -x) + 1;
}
@@ -198,7 +242,7 @@ extern __inline__ int ffs(int x)
#define find_first_zero_bit(addr, size) \
find_next_zero_bit((addr), (size), 0)
-extern __inline__ unsigned long find_next_zero_bit(void * addr,
+static __inline__ unsigned long find_next_zero_bit(void * addr,
unsigned long size, unsigned long offset)
{
unsigned int * p = ((unsigned int *) addr) + (offset >> 5);
@@ -230,6 +274,8 @@ extern __inline__ unsigned long find_next_zero_bit(void * addr,
tmp = *p;
found_first:
tmp |= ~0UL << size;
+ if (tmp == ~0UL) /* Are any bits zero? */
+ return result + size; /* Nope. */
found_middle:
return result + ffz(tmp);
}
@@ -238,42 +284,11 @@ found_middle:
#define _EXT2_HAVE_ASM_BITOPS_
#ifdef __KERNEL__
-/*
- * test_and_{set,clear}_bit guarantee atomicity without
- * disabling interrupts.
- */
-#define ext2_set_bit(nr, addr) test_and_set_bit((nr) ^ 0x18, addr)
-#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr) ^ 0x18, addr)
-#else
-extern __inline__ int ext2_set_bit(int nr, void * addr)
-{
- int mask;
- unsigned char *ADDR = (unsigned char *) addr;
- int oldbit;
-
- ADDR += nr >> 3;
- mask = 1 << (nr & 0x07);
- oldbit = (*ADDR & mask) ? 1 : 0;
- *ADDR |= mask;
- return oldbit;
-}
-
-extern __inline__ int ext2_clear_bit(int nr, void * addr)
-{
- int mask;
- unsigned char *ADDR = (unsigned char *) addr;
- int oldbit;
-
- ADDR += nr >> 3;
- mask = 1 << (nr & 0x07);
- oldbit = (*ADDR & mask) ? 1 : 0;
- *ADDR = *ADDR & ~mask;
- return oldbit;
-}
-#endif /* __KERNEL__ */
+#define ext2_set_bit(nr, addr) __test_and_set_bit((nr) ^ 0x18, addr)
+#define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 0x18, addr)
-extern __inline__ int ext2_test_bit(int nr, __const__ void * addr)
+static __inline__ int ext2_test_bit(int nr, __const__ void * addr)
{
__const__ unsigned char *ADDR = (__const__ unsigned char *) addr;
@@ -288,7 +303,7 @@ extern __inline__ int ext2_test_bit(int nr, __const__ void * addr)
#define ext2_find_first_zero_bit(addr, size) \
ext2_find_next_zero_bit((addr), (size), 0)
-extern __inline__ unsigned long ext2_find_next_zero_bit(void *addr,
+static __inline__ unsigned long ext2_find_next_zero_bit(void *addr,
unsigned long size, unsigned long offset)
{
unsigned int *p = ((unsigned int *) addr) + (offset >> 5);
@@ -320,6 +335,8 @@ extern __inline__ unsigned long ext2_find_next_zero_bit(void *addr,
tmp = cpu_to_le32p(p);
found_first:
tmp |= ~0U << size;
+ if (tmp == ~0UL) /* Are any bits zero? */
+ return result + size; /* Nope. */
found_middle:
return result + ffz(tmp);
}
@@ -331,4 +348,6 @@ found_middle:
#define minix_test_bit(nr,addr) ext2_test_bit(nr,addr)
#define minix_find_first_zero_bit(addr,size) ext2_find_first_zero_bit(addr,size)
+#endif /* __KERNEL__ */
+
#endif /* _PPC_BITOPS_H */
diff --git a/include/asm-ppc/bootx.h b/include/asm-ppc/bootx.h
index 5674bd0f9..90c79cdb7 100644
--- a/include/asm-ppc/bootx.h
+++ b/include/asm-ppc/bootx.h
@@ -133,4 +133,3 @@ typedef struct boot_infos
#endif
#endif
- \ No newline at end of file
diff --git a/include/asm-ppc/cpm_8260.h b/include/asm-ppc/cpm_8260.h
index 5f500d5c3..427ec1884 100644
--- a/include/asm-ppc/cpm_8260.h
+++ b/include/asm-ppc/cpm_8260.h
@@ -85,6 +85,7 @@
#define CPM_DATAONLY_BASE ((uint)128)
#define CPM_DATAONLY_SIZE ((uint)(16 * 1024) - CPM_DATAONLY_BASE)
#define CPM_DP_NOSPACE ((uint)0x7fffffff)
+#define CPM_FCC_SPECIAL_BASE ((uint)0x0000b000)
/* The number of pages of host memory we allocate for CPM. This is
* done early in kernel initialization to get physically contiguous
@@ -97,8 +98,8 @@
* and dual port ram.
*/
extern cpm8260_t *cpmp; /* Pointer to comm processor */
-uint m8260_cpm_dpalloc(uint size);
-uint m8260_cpm_hostalloc(uint size);
+uint m8260_cpm_dpalloc(uint size, uint align);
+uint m8260_cpm_hostalloc(uint size, uint align);
void m8260_cpm_setbrg(uint brg, uint rate);
void m8260_cpm_fastbrg(uint brg, uint rate, int div16);
@@ -153,7 +154,7 @@ typedef struct cpm_buf_desc {
#define PROFF_REVNUM ((uint)0x8af0)
#define PROFF_RAND ((uint)0x8af8)
#define PROFF_I2C_BASE ((uint)0x8afc)
-#define PROFF_IDMA4_BASE ((uint)0x89fe)
+#define PROFF_IDMA4_BASE ((uint)0x8afe)
/* The SMCs are relocated to any of the first eight DPRAM pages.
* We will fix these at the first locations of DPRAM, until we
@@ -403,40 +404,44 @@ typedef struct scc_enet {
#define SCCE_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
#define SCCE_ENET_RXB ((ushort)0x0001) /* A buffer was received */
-/* SCC Mode Register (PMSR) as used by Ethernet.
+/* SCC Mode Register (PSMR) as used by Ethernet.
*/
-#define SCC_PMSR_HBC ((ushort)0x8000) /* Enable heartbeat */
-#define SCC_PMSR_FC ((ushort)0x4000) /* Force collision */
-#define SCC_PMSR_RSH ((ushort)0x2000) /* Receive short frames */
-#define SCC_PMSR_IAM ((ushort)0x1000) /* Check individual hash */
-#define SCC_PMSR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */
-#define SCC_PMSR_PRO ((ushort)0x0200) /* Promiscuous mode */
-#define SCC_PMSR_BRO ((ushort)0x0100) /* Catch broadcast pkts */
-#define SCC_PMSR_SBT ((ushort)0x0080) /* Special backoff timer */
-#define SCC_PMSR_LPB ((ushort)0x0040) /* Set Loopback mode */
-#define SCC_PMSR_SIP ((ushort)0x0020) /* Sample Input Pins */
-#define SCC_PMSR_LCW ((ushort)0x0010) /* Late collision window */
-#define SCC_PMSR_NIB22 ((ushort)0x000a) /* Start frame search */
-#define SCC_PMSR_FDE ((ushort)0x0001) /* Full duplex enable */
+#define SCC_PSMR_HBC ((ushort)0x8000) /* Enable heartbeat */
+#define SCC_PSMR_FC ((ushort)0x4000) /* Force collision */
+#define SCC_PSMR_RSH ((ushort)0x2000) /* Receive short frames */
+#define SCC_PSMR_IAM ((ushort)0x1000) /* Check individual hash */
+#define SCC_PSMR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */
+#define SCC_PSMR_PRO ((ushort)0x0200) /* Promiscuous mode */
+#define SCC_PSMR_BRO ((ushort)0x0100) /* Catch broadcast pkts */
+#define SCC_PSMR_SBT ((ushort)0x0080) /* Special backoff timer */
+#define SCC_PSMR_LPB ((ushort)0x0040) /* Set Loopback mode */
+#define SCC_PSMR_SIP ((ushort)0x0020) /* Sample Input Pins */
+#define SCC_PSMR_LCW ((ushort)0x0010) /* Late collision window */
+#define SCC_PSMR_NIB22 ((ushort)0x000a) /* Start frame search */
+#define SCC_PSMR_FDE ((ushort)0x0001) /* Full duplex enable */
/* Buffer descriptor control/status used by Ethernet receive.
-*/
+ * Common to SCC and FCC.
+ */
#define BD_ENET_RX_EMPTY ((ushort)0x8000)
#define BD_ENET_RX_WRAP ((ushort)0x2000)
#define BD_ENET_RX_INTR ((ushort)0x1000)
#define BD_ENET_RX_LAST ((ushort)0x0800)
#define BD_ENET_RX_FIRST ((ushort)0x0400)
#define BD_ENET_RX_MISS ((ushort)0x0100)
+#define BD_ENET_RX_BC ((ushort)0x0080) /* FCC Only */
+#define BD_ENET_RX_MC ((ushort)0x0040) /* FCC Only */
#define BD_ENET_RX_LG ((ushort)0x0020)
#define BD_ENET_RX_NO ((ushort)0x0010)
#define BD_ENET_RX_SH ((ushort)0x0008)
#define BD_ENET_RX_CR ((ushort)0x0004)
#define BD_ENET_RX_OV ((ushort)0x0002)
#define BD_ENET_RX_CL ((ushort)0x0001)
-#define BD_ENET_RX_STATS ((ushort)0x013f) /* All status bits */
+#define BD_ENET_RX_STATS ((ushort)0x01ff) /* All status bits */
/* Buffer descriptor control/status used by Ethernet transmit.
-*/
+ * Common to SCC and FCC.
+ */
#define BD_ENET_TX_READY ((ushort)0x8000)
#define BD_ENET_TX_PAD ((ushort)0x4000)
#define BD_ENET_TX_WRAP ((ushort)0x2000)
@@ -523,6 +528,152 @@ typedef struct scc_trans {
#define BD_SCC_TX_LAST ((ushort)0x0800)
+/* How about some FCCs.....
+*/
+#define FCC_GFMR_DIAG_NORM ((uint)0x00000000)
+#define FCC_GFMR_DIAG_LE ((uint)0x40000000)
+#define FCC_GFMR_DIAG_AE ((uint)0x80000000)
+#define FCC_GFMR_DIAG_ALE ((uint)0xc0000000)
+#define FCC_GFMR_TCI ((uint)0x20000000)
+#define FCC_GFMR_TRX ((uint)0x10000000)
+#define FCC_GFMR_TTX ((uint)0x08000000)
+#define FCC_GFMR_TTX ((uint)0x08000000)
+#define FCC_GFMR_CDP ((uint)0x04000000)
+#define FCC_GFMR_CTSP ((uint)0x02000000)
+#define FCC_GFMR_CDS ((uint)0x01000000)
+#define FCC_GFMR_CTSS ((uint)0x00800000)
+#define FCC_GFMR_SYNL_NONE ((uint)0x00000000)
+#define FCC_GFMR_SYNL_AUTO ((uint)0x00004000)
+#define FCC_GFMR_SYNL_8 ((uint)0x00008000)
+#define FCC_GFMR_SYNL_16 ((uint)0x0000c000)
+#define FCC_GFMR_RTSM ((uint)0x00002000)
+#define FCC_GFMR_RENC_NRZ ((uint)0x00000000)
+#define FCC_GFMR_RENC_NRZI ((uint)0x00000800)
+#define FCC_GFMR_REVD ((uint)0x00000400)
+#define FCC_GFMR_TENC_NRZ ((uint)0x00000000)
+#define FCC_GFMR_TENC_NRZI ((uint)0x00000100)
+#define FCC_GFMR_TCRC_16 ((uint)0x00000000)
+#define FCC_GFMR_TCRC_32 ((uint)0x00000080)
+#define FCC_GFMR_ENR ((uint)0x00000020)
+#define FCC_GFMR_ENT ((uint)0x00000010)
+#define FCC_GFMR_MODE_ENET ((uint)0x0000000c)
+#define FCC_GFMR_MODE_ATM ((uint)0x0000000a)
+#define FCC_GFMR_MODE_HDLC ((uint)0x00000000)
+
+/* Generic FCC parameter ram.
+*/
+typedef struct fcc_param {
+ ushort fcc_riptr; /* Rx Internal temp pointer */
+ ushort fcc_tiptr; /* Tx Internal temp pointer */
+ ushort fcc_res1;
+ ushort fcc_mrblr; /* Max receive buffer length, mod 32 bytes */
+ uint fcc_rstate; /* Upper byte is Func code, must be set */
+ uint fcc_rbase; /* Receive BD base */
+ ushort fcc_rbdstat; /* RxBD status */
+ ushort fcc_rbdlen; /* RxBD down counter */
+ uint fcc_rdptr; /* RxBD internal data pointer */
+ uint fcc_tstate; /* Upper byte is Func code, must be set */
+ uint fcc_tbase; /* Transmit BD base */
+ ushort fcc_tbdstat; /* TxBD status */
+ ushort fcc_tbdlen; /* TxBD down counter */
+ uint fcc_tdptr; /* TxBD internal data pointer */
+ uint fcc_rbptr; /* Rx BD Internal buf pointer */
+ uint fcc_tbptr; /* Tx BD Internal buf pointer */
+ uint fcc_rcrc; /* Rx temp CRC */
+ uint fcc_res2;
+ uint fcc_tcrc; /* Tx temp CRC */
+} fccp_t;
+
+
+/* Ethernet controller through FCC.
+*/
+typedef struct fcc_enet {
+ fccp_t fen_genfcc;
+ uint fen_statbuf; /* Internal status buffer */
+ uint fen_camptr; /* CAM address */
+ uint fen_cmask; /* Constant mask for CRC */
+ uint fen_cpres; /* Preset CRC */
+ uint fen_crcec; /* CRC Error counter */
+ uint fen_alec; /* alignment error counter */
+ uint fen_disfc; /* discard frame counter */
+ ushort fen_retlim; /* Retry limit */
+ ushort fen_retcnt; /* Retry counter */
+ ushort fen_pper; /* Persistence */
+ ushort fen_boffcnt; /* backoff counter */
+ uint fen_gaddrh; /* Group address filter, high 32-bits */
+ uint fen_gaddrl; /* Group address filter, low 32-bits */
+ ushort fen_tfcstat; /* out of sequence TxBD */
+ ushort fen_tfclen;
+ uint fen_tfcptr;
+ ushort fen_mflr; /* Maximum frame length (1518) */
+ ushort fen_paddrh; /* MAC address */
+ ushort fen_paddrm;
+ ushort fen_paddrl;
+ ushort fen_ibdcount; /* Internal BD counter */
+ ushort fen_idbstart; /* Internal BD start pointer */
+ ushort fen_ibdend; /* Internal BD end pointer */
+ ushort fen_txlen; /* Internal Tx frame length counter */
+ uint fen_ibdbase[8]; /* Internal use */
+ uint fen_iaddrh; /* Individual address filter */
+ uint fen_iaddrl;
+ ushort fen_minflr; /* Minimum frame length (64) */
+ ushort fen_taddrh; /* Filter transfer MAC address */
+ ushort fen_taddrm;
+ ushort fen_taddrl;
+ ushort fen_padptr; /* Pointer to pad byte buffer */
+ ushort fen_cftype; /* control frame type */
+ ushort fen_cfrange; /* control frame range */
+ ushort fen_maxb; /* maximum BD count */
+ ushort fen_maxd1; /* Max DMA1 length (1520) */
+ ushort fen_maxd2; /* Max DMA2 length (1520) */
+ ushort fen_maxd; /* internal max DMA count */
+ ushort fen_dmacnt; /* internal DMA counter */
+ uint fen_octc; /* Total octect counter */
+ uint fen_colc; /* Total collision counter */
+ uint fen_broc; /* Total broadcast packet counter */
+ uint fen_mulc; /* Total multicast packet count */
+ uint fen_uspc; /* Total packets < 64 bytes */
+ uint fen_frgc; /* Total packets < 64 bytes with errors */
+ uint fen_ospc; /* Total packets > 1518 */
+ uint fen_jbrc; /* Total packets > 1518 with errors */
+ uint fen_p64c; /* Total packets == 64 bytes */
+ uint fen_p65c; /* Total packets 64 < bytes <= 127 */
+ uint fen_p128c; /* Total packets 127 < bytes <= 255 */
+ uint fen_p256c; /* Total packets 256 < bytes <= 511 */
+ uint fen_p512c; /* Total packets 512 < bytes <= 1023 */
+ uint fen_p1024c; /* Total packets 1024 < bytes <= 1518 */
+ uint fen_cambuf; /* Internal CAM buffer poiner */
+ ushort fen_rfthr; /* Received frames threshold */
+ ushort fen_rfcnt; /* Received frames count */
+} fcc_enet_t;
+
+/* FCC Event/Mask register as used by Ethernet.
+*/
+#define FCC_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
+#define FCC_ENET_RXC ((ushort)0x0040) /* Control Frame Received */
+#define FCC_ENET_TXC ((ushort)0x0020) /* Out of seq. Tx sent */
+#define FCC_ENET_TXE ((ushort)0x0010) /* Transmit Error */
+#define FCC_ENET_RXF ((ushort)0x0008) /* Full frame received */
+#define FCC_ENET_BSY ((ushort)0x0004) /* Busy. Rx Frame dropped */
+#define FCC_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
+#define FCC_ENET_RXB ((ushort)0x0001) /* A buffer was received */
+
+/* FCC Mode Register (FPSMR) as used by Ethernet.
+*/
+#define FCC_PSMR_HBC ((uint)0x80000000) /* Enable heartbeat */
+#define FCC_PSMR_FC ((uint)0x40000000) /* Force Collision */
+#define FCC_PSMR_SBT ((uint)0x20000000) /* Stop backoff timer */
+#define FCC_PSMR_LPB ((uint)0x10000000) /* Local protect. 1 = FDX */
+#define FCC_PSMR_LCW ((uint)0x08000000) /* Late collision select */
+#define FCC_PSMR_FDE ((uint)0x04000000) /* Full Duplex Enable */
+#define FCC_PSMR_MON ((uint)0x02000000) /* RMON Enable */
+#define FCC_PSMR_PRO ((uint)0x00400000) /* Promiscuous Enable */
+#define FCC_PSMR_FCE ((uint)0x00200000) /* Flow Control Enable */
+#define FCC_PSMR_RSH ((uint)0x00100000) /* Receive Short Frames */
+#define FCC_PSMR_CAM ((uint)0x00000400) /* CAM enable */
+#define FCC_PSMR_BRO ((uint)0x00000200) /* Broadcast pkt discard */
+#define FCC_PSMR_ENCRC ((uint)0x00000080) /* Use 32-bit CRC */
+
/* IIC parameter RAM.
*/
typedef struct iic {
diff --git a/include/asm-ppc/fcntl.h b/include/asm-ppc/fcntl.h
index 6250eba7c..f8181d44d 100644
--- a/include/asm-ppc/fcntl.h
+++ b/include/asm-ppc/fcntl.h
@@ -35,6 +35,10 @@
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */
+#define F_GETLK64 12 /* using 'struct flock64' */
+#define F_SETLK64 13
+#define F_SETLKW64 14
+
/* for F_[GET|SET]FL */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
@@ -47,6 +51,9 @@
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
+/* for leases */
+#define F_INPROGRESS 16
+
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
@@ -54,6 +61,11 @@
blocking */
#define LOCK_UN 8 /* remove lock */
+#define LOCK_MAND 32 /* This is a mandatory flock */
+#define LOCK_READ 64 /* ... Which allows concurrent read operations */
+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
+
#ifdef __KERNEL__
#define F_POSIX 1
#define F_FLOCK 2
@@ -68,4 +80,13 @@ struct flock {
pid_t l_pid;
};
+struct flock64 {
+ short l_type;
+ short l_whence;
+ loff_t l_start;
+ loff_t l_len;
+ pid_t l_pid;
+};
+
+#define F_LINUX_SPECIFIC_BASE 1024
#endif
diff --git a/include/asm-ppc/feature.h b/include/asm-ppc/feature.h
index c9f2d2eac..ca4ca4692 100644
--- a/include/asm-ppc/feature.h
+++ b/include/asm-ppc/feature.h
@@ -7,7 +7,9 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 1998 Paul Mackerras.
+ * Copyright (C) 1998 Paul Mackerras &
+ * Ben. Herrenschmidt.
+ *
*
*/
#ifndef __ASM_PPC_FEATURE_H
@@ -76,6 +78,9 @@ extern void feature_init(void);
*/
extern void feature_set_gmac_power(struct device_node* device, int power);
+ /* use constants in KeyLargo.h for the reset parameter */
+extern void feature_set_gmac_phy_reset(struct device_node* device, int reset);
+
extern void feature_set_usb_power(struct device_node* device, int power);
extern void feature_set_firewire_power(struct device_node* device, int power);
diff --git a/include/asm-ppc/hardirq.h b/include/asm-ppc/hardirq.h
index 07398997a..f7c12df77 100644
--- a/include/asm-ppc/hardirq.h
+++ b/include/asm-ppc/hardirq.h
@@ -5,16 +5,23 @@
#include <asm/smp.h>
/* entry.S is sensitive to the offsets of these fields */
+/* The __last_jiffy_stamp field is needed to ensure that no decrementer
+ * interrupt is lost on SMP machines. Since on most CPUs it is in the same
+ * cache line as local_irq_count, it is cheap to access and is also used on UP
+ * for uniformity.
+ */
typedef struct {
unsigned int __softirq_active;
unsigned int __softirq_mask;
unsigned int __local_irq_count;
unsigned int __local_bh_count;
unsigned int __syscall_count;
+ unsigned int __last_jiffy_stamp;
} ____cacheline_aligned irq_cpustat_t;
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
+#define last_jiffy_stamp(cpu) __IRQ_STAT((cpu), __last_jiffy_stamp)
/*
* Are we in an interrupt context? Either doing bottom half
* or hardware interrupt processing?
diff --git a/include/asm-ppc/heathrow.h b/include/asm-ppc/heathrow.h
index 647c63261..039f22158 100644
--- a/include/asm-ppc/heathrow.h
+++ b/include/asm-ppc/heathrow.h
@@ -44,4 +44,9 @@
#define HRW_BMAC_IO_ENABLE 0x60000000 /* two bits, not documented in OF */
#define HRW_BMAC_RESET 0x80000000 /* not documented in OF */
+/* We OR those features at boot on desktop G3s */
+#define HRW_DEFAULTS (HRW_SCCA_IO | HRW_SCCB_IO | HRW_SCC_ENABLE)
+
+/* Those seem to be different on paddington */
#define PADD_MODEM_POWER_N 0x00000001 /* modem power on paddington */
+#define PADD_RESET_SCC 0x02000000 /* check this please */
diff --git a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h
new file mode 100644
index 000000000..428a59d1c
--- /dev/null
+++ b/include/asm-ppc/highmem.h
@@ -0,0 +1,121 @@
+/*
+ * highmem.h: virtual kernel memory mappings for high memory
+ *
+ * PowerPC version, stolen from the i386 version.
+ *
+ * Used in CONFIG_HIGHMEM systems for memory pages which
+ * are not addressable by direct kernel virtual adresses.
+ *
+ * Copyright (C) 1999 Gerhard Wichert, Siemens AG
+ * Gerhard.Wichert@pdb.siemens.de
+ *
+ *
+ * Redesigned the x86 32-bit VM architecture to deal with
+ * up to 16 Terrabyte physical memory. With current x86 CPUs
+ * we now support up to 64 Gigabytes physical RAM.
+ *
+ * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
+ */
+
+#ifndef _ASM_HIGHMEM_H
+#define _ASM_HIGHMEM_H
+
+#ifdef __KERNEL__
+
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <asm/kmap_types.h>
+#include <asm/pgtable.h>
+
+/* undef for production */
+#define HIGHMEM_DEBUG 1
+
+extern pte_t *kmap_pte;
+extern pgprot_t kmap_prot;
+extern pte_t *pkmap_page_table;
+
+extern void kmap_init(void) __init;
+
+/*
+ * Right now we initialize only a single pte table. It can be extended
+ * easily, subsequent pte tables have to be allocated in one physical
+ * chunk of RAM.
+ */
+#define PKMAP_BASE (0xfe000000UL)
+#define LAST_PKMAP 1024
+#define LAST_PKMAP_MASK (LAST_PKMAP-1)
+#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
+#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
+
+#define KMAP_FIX_BEGIN (0xfe400000UL)
+
+extern unsigned long kmap_high(struct page *page);
+extern void kunmap_high(struct page *page);
+
+extern inline unsigned long kmap(struct page *page)
+{
+ if (in_interrupt())
+ BUG();
+ if (page < highmem_start_page)
+ return (unsigned long) page_address(page);
+ return kmap_high(page);
+}
+
+extern inline void kunmap(struct page *page)
+{
+ if (in_interrupt())
+ BUG();
+ if (page < highmem_start_page)
+ return;
+ kunmap_high(page);
+}
+
+/*
+ * The use of kmap_atomic/kunmap_atomic is discouraged - kmap/kunmap
+ * gives a more generic (and caching) interface. But kmap_atomic can
+ * be used in IRQ contexts, so in some (very limited) cases we need
+ * it.
+ */
+extern inline unsigned long kmap_atomic(struct page *page, enum km_type type)
+{
+ unsigned int idx;
+ unsigned long vaddr;
+
+ if (page < highmem_start_page)
+ return (unsigned long) page_address(page);
+
+ idx = type + KM_TYPE_NR*smp_processor_id();
+ vaddr = KMAP_FIX_BEGIN + idx * PAGE_SIZE;
+#if HIGHMEM_DEBUG
+ if (!pte_none(*(kmap_pte+idx)))
+ BUG();
+#endif
+ set_pte(kmap_pte+idx, mk_pte(page, kmap_prot));
+ flush_hash_page(0, vaddr);
+
+ return vaddr;
+}
+
+extern inline void kunmap_atomic(unsigned long vaddr, enum km_type type)
+{
+#if HIGHMEM_DEBUG
+ unsigned int idx = type + KM_TYPE_NR*smp_processor_id();
+
+ if (vaddr < KMAP_FIX_BEGIN) // FIXME
+ return;
+
+ if (vaddr != KMAP_FIX_BEGIN + idx * PAGE_SIZE)
+ BUG();
+
+ /*
+ * force other mappings to Oops if they'll try to access
+ * this pte without first remap it
+ */
+ pte_clear(kmap_pte+idx);
+ flush_hash_page(0, vaddr);
+#endif
+}
+
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_HIGHMEM_H */
diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h
index 198132fa4..8b50f862b 100644
--- a/include/asm-ppc/ide.h
+++ b/include/asm-ppc/ide.h
@@ -63,7 +63,6 @@ void ide_insw(ide_ioreg_t port, void *buf, int ns);
void ide_outsw(ide_ioreg_t port, void *buf, int ns);
void ppc_generic_ide_fix_driveid(struct hd_driveid *id);
-#if 0
#undef insw
#define insw(port, buf, ns) do { \
ppc_ide_md.insw((port), (buf), (ns)); \
@@ -73,7 +72,6 @@ void ppc_generic_ide_fix_driveid(struct hd_driveid *id);
#define outsw(port, buf, ns) do { \
ppc_ide_md.outsw((port), (buf), (ns)); \
} while (0)
-#endif
#undef SUPPORT_SLOW_DATA_PORTS
#define SUPPORT_SLOW_DATA_PORTS 0
diff --git a/include/asm-ppc/immap_8260.h b/include/asm-ppc/immap_8260.h
index 407cbf04c..298276363 100644
--- a/include/asm-ppc/immap_8260.h
+++ b/include/asm-ppc/immap_8260.h
@@ -241,10 +241,12 @@ typedef struct fcc {
char res1[2];
ushort fcc_fdsr;
char res2[2];
- uint fcc_fcce;
- uint fcc_fccm;
+ ushort fcc_fcce;
+ char res3[2];
+ ushort fcc_fccm;
+ char res4[2];
u_char fcc_fccs;
- char res3[3];
+ char res5[3];
u_char fcc_ftirr_phy[4];
} fcc_t;
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 6e5a57ad6..45b2531a3 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -25,12 +25,12 @@
#include <asm/mpc8xx.h>
#elif defined(CONFIG_8260)
#include <asm/mpc8260.h>
-#else
+#else /* 4xx/8xx/8260 */
#ifdef CONFIG_APUS
#define _IO_BASE 0
#define _ISA_MEM_BASE 0
#define PCI_DRAM_OFFSET 0
-#else
+#else /* CONFIG_APUS */
extern unsigned long isa_io_base;
extern unsigned long isa_mem_base;
extern unsigned long pci_dram_offset;
@@ -54,6 +54,14 @@ extern unsigned long pci_dram_offset;
#define writel(b,addr) out_le32((volatile u32 *)(addr),(b))
#endif
+
+#define __raw_readb(addr) (*(volatile unsigned char *)(addr))
+#define __raw_readw(addr) (*(volatile unsigned short *)(addr))
+#define __raw_readl(addr) (*(volatile unsigned int *)(addr))
+#define __raw_writeb(v, addr) (*(volatile unsigned char *)(addr) = (v))
+#define __raw_writew(v, addr) (*(volatile unsigned short *)(addr) = (v))
+#define __raw_writel(v, addr) (*(volatile unsigned int *)(addr) = (v))
+
/*
* The insw/outsw/insl/outsl macros don't do byte-swapping.
* They are only used in practice for transferring buffers which
@@ -67,26 +75,76 @@ extern unsigned long pci_dram_offset;
#define insl(port, buf, nl) _insl_ns((u32 *)((port)+_IO_BASE), (buf), (nl))
#define outsl(port, buf, nl) _outsl_ns((u32 *)((port)+_IO_BASE), (buf), (nl))
+#ifdef CONFIG_ALL_PPC
+/*
+ * We have to handle possible machine checks here on powermacs
+ * and potentially some CHRPs -- paulus.
+ */
+#define __do_in_asm(name, op) \
+extern __inline__ unsigned int name(unsigned int port) \
+{ \
+ unsigned int x; \
+ __asm__ __volatile__( \
+ op " %0,0,%1\n" \
+ "1: sync\n" \
+ "2:\n" \
+ ".section .fixup,\"ax\"\n" \
+ "3: li %0,-1\n" \
+ " b 2b\n" \
+ ".previous\n" \
+ ".section __ex_table,\"ax\"\n" \
+ " .align 2\n" \
+ " .long 1b,3b\n" \
+ ".previous" \
+ : "=&r" (x) \
+ : "r" (port + _IO_BASE)); \
+ return x; \
+}
+
+#define __do_out_asm(name, op) \
+extern __inline__ void name(unsigned int val, unsigned int port) \
+{ \
+ __asm__ __volatile__( \
+ op " %0,0,%1\n" \
+ "1: sync\n" \
+ "2:\n" \
+ ".section __ex_table,\"ax\"\n" \
+ " .align 2\n" \
+ " .long 1b,2b\n" \
+ ".previous" \
+ : : "r" (val), "r" (port + _IO_BASE)); \
+}
+
+__do_in_asm(inb, "lbzx")
+__do_in_asm(inw, "lhbrx")
+__do_in_asm(inl, "lwbrx")
+__do_out_asm(outb, "stbx")
+__do_out_asm(outw, "sthbrx")
+__do_out_asm(outl, "stwbrx")
+
+#elif defined(CONFIG_APUS)
#define inb(port) in_8((u8 *)((port)+_IO_BASE))
#define outb(val, port) out_8((u8 *)((port)+_IO_BASE), (val))
-#if defined(CONFIG_APUS)
#define inw(port) in_be16((u16 *)((port)+_IO_BASE))
#define outw(val, port) out_be16((u16 *)((port)+_IO_BASE), (val))
#define inl(port) in_be32((u32 *)((port)+_IO_BASE))
#define outl(val, port) out_be32((u32 *)((port)+_IO_BASE), (val))
-#else
+
+#else /* not APUS or ALL_PPC */
+#define inb(port) in_8((u8 *)((port)+_IO_BASE))
+#define outb(val, port) out_8((u8 *)((port)+_IO_BASE), (val))
#define inw(port) in_le16((u16 *)((port)+_IO_BASE))
#define outw(val, port) out_le16((u16 *)((port)+_IO_BASE), (val))
#define inl(port) in_le32((u32 *)((port)+_IO_BASE))
#define outl(val, port) out_le32((u32 *)((port)+_IO_BASE), (val))
#endif
-#define inb_p(port) in_8((u8 *)((port)+_IO_BASE))
-#define outb_p(val, port) out_8((u8 *)((port)+_IO_BASE), (val))
-#define inw_p(port) in_le16((u16 *)((port)+_IO_BASE))
-#define outw_p(val, port) out_le16((u16 *)((port)+_IO_BASE), (val))
-#define inl_p(port) in_le32((u32 *)((port)+_IO_BASE))
-#define outl_p(val, port) out_le32((u32 *)((port)+_IO_BASE), (val))
+#define inb_p(port) inb((port))
+#define outb_p(val, port) outb((val), (port))
+#define inw_p(port) inw((port))
+#define outw_p(val, port) outw((val), (port))
+#define inl_p(port) inl((port))
+#define outl_p(val, port) outl((val), (port))
extern void _insb(volatile u8 *port, void *buf, int ns);
extern void _outsb(volatile u8 *port, const void *buf, int ns);
@@ -123,6 +181,8 @@ extern void _outsl_ns(volatile u32 *port, const void *buf, int nl);
*/
extern void *__ioremap(unsigned long address, unsigned long size,
unsigned long flags);
+extern void *__ioremap_at(unsigned long phys, unsigned long size,
+ unsigned long flags);
extern void *ioremap(unsigned long address, unsigned long size);
#define ioremap_nocache(addr, size) ioremap((addr), (size))
extern void iounmap(void *addr);
diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h
index 0f1972ddf..86647a0e6 100644
--- a/include/asm-ppc/irq.h
+++ b/include/asm-ppc/irq.h
@@ -184,6 +184,9 @@ extern irq_node_t *new_irq_node(void);
*/
#define SIU_INT_SMC1 ((uint)0x04)
#define SIU_INT_SMC2 ((uint)0x05)
+#define SIU_INT_FCC1 ((uint)0x20)
+#define SIU_INT_FCC2 ((uint)0x21)
+#define SIU_INT_FCC3 ((uint)0x22)
#define SIU_INT_SCC1 ((uint)0x28)
#define SIU_INT_SCC2 ((uint)0x29)
#define SIU_INT_SCC3 ((uint)0x2a)
diff --git a/include/asm-ppc/keylargo.h b/include/asm-ppc/keylargo.h
new file mode 100644
index 000000000..5408262a1
--- /dev/null
+++ b/include/asm-ppc/keylargo.h
@@ -0,0 +1,103 @@
+/*
+ * keylargo.h: definitions for using the "KeyLargo" I/O controller chip.
+ *
+ */
+
+/* offset from base for feature control registers */
+#define KEYLARGO_MBCR 0x34 /* Media bay control/status */
+#define KEYLARGO_FCR0 0x38
+#define KEYLARGO_FCR1 0x3c
+#define KEYLARGO_FCR2 0x40
+#define KEYLARGO_FCR3 0x44
+#define KEYLARGO_FCR4 0x48
+
+/* GPIO registers */
+#define KEYLARGO_GPIO_LEVELS0 0x50
+#define KEYLARGO_GPIO_LEVELS1 0x54
+#define KEYLARGO_GPIO_EXTINT_0 0x58
+#define KEYLARGO_GPIO_EXTINT_CNT 18
+#define KEYLARGO_GPIO_0 0x6A
+#define KEYLARGO_GPIO_CNT 17
+
+/* Specific GPIO regs */
+#define KL_GPIO_ETH_PHY_RESET (KEYLARGO_GPIO_0+0x10)
+#define KL_GPIO_ETH_PHY_RESET_ASSERT 0x04
+#define KL_GPIO_ETH_PHY_RESET_RELEASE 0x05
+#define KL_GPIO_ETH_PHY_RESET_TRISTATE 0x00
+/*
+ * Bits in feature control register
+ */
+#define KL_MBCR_MBDEV_ENABLE 0x00001000
+
+#define KL0_SCC_B_INTF_ENABLE 0x00000001 /* ??? */
+#define KL0_SCC_A_INTF_ENABLE 0x00000002 /* ??? */
+#define KL0_SCC_SLOWPCLK 0x00000004
+#define KL0_SCC_RESET 0x00000008
+#define KL0_SCCA_ENABLE 0x00000010
+#define KL0_SCCB_ENABLE 0x00000020
+#define KL0_SCC_CELL_ENABLE 0x00000040
+#define KL0_IRDA_ENABLE 0x00008000
+#define KL0_IRDA_CLK32_ENABLE 0x00010000
+#define KL0_IRDA_CLK19_ENABLE 0x00020000
+#define KL0_USB0_PAD_SUSPEND0 0x00040000
+#define KL0_USB0_PAD_SUSPEND1 0x00080000
+#define KL0_USB0_CELL_ENABLE 0x00100000
+#define KL0_USB1_PAD_SUSPEND0 0x00400000
+#define KL0_USB1_PAD_SUSPEND1 0x00800000
+#define KL0_USB1_CELL_ENABLE 0x01000000
+#define KL0_USB_REF_SUSPEND 0x10000000
+
+#define KL0_SERIAL_ENABLE (KL0_SCC_B_INTF_ENABLE | \
+ KL0_SCC_SLOWPCLK | \
+ KL0_SCC_CELL_ENABLE | KL0_SCCA_ENABLE)
+
+#define KL1_AUDIO_SEL_22MCLK 0x00000002
+#define KL1_AUDIO_CLK_ENABLE_BIT 0x00000008
+#define KL1_AUDIO_CLK_OUT_ENABLE 0x00000020 /* Burgundy only ? */
+#define KL1_AUDIO_CELL_ENABLE 0x00000040
+#define KL1_AUDIO_CHOOSE 0x00000080 /* Burgundy only ? */
+#define KL1_I2S0_CELL_ENABLE 0x00000400
+#define KL1_I2S0_CLK_ENABLE_BIT 0x00001000
+#define KL1_I2S0_ENABLE 0x00002000
+#define KL1_I2S1_CELL_ENABLE 0x00020000
+#define KL1_I2S1_CLK_ENABLE_BIT 0x00080000
+#define KL1_I2S1_ENABLE 0x00100000
+#define KL1_EIDE0_ENABLE 0x00800000
+#define KL1_EIDE0_RESET_N 0x01000000
+#define KL1_EIDE1_ENABLE 0x04000000
+#define KL1_EIDE1_RESET_N 0x08000000
+#define KL1_UIDE_ENABLE 0x20000000
+#define KL1_UIDE_RESET_N 0x40000000
+
+#define KL2_IOBUS_ENABLE 0x00000002
+#define KL2_SLEEP_STATE_BIT 0x00000100
+#define KL2_MPIC_ENABLE 0x00020000
+#define KL2_MODEM_POWER_N 0x02000000
+#define KL2_AIRPORT_RESET_N 0x08000000 /* Or power ? */
+
+#define KL3_SHUTDOWN_PLL_TOTAL 0x00000001
+#define KL3_SHUTDOWN_PLLKW6 0x00000002
+#define KL3_SHUTDOWN_PLLKW4 0x00000004
+#define KL3_SHUTDOWN_PLLKW35 0x00000008
+#define KL3_SHUTDOWN_PLLKW12 0x00000010
+#define KL3_PLL_RESET 0x00000020
+#define KL3_SHUTDOWN_PLL2X 0x00000080
+#define KL3_CLK66_ENABLE 0x00000100
+#define KL3_CLK49_ENABLE 0x00000200
+#define KL3_CLK45_ENABLE 0x00000400
+#define KL3_CLK31_ENABLE 0x00000800
+#define KL3_TIMER_CLK18_ENABLE 0x00001000
+#define KL3_I2S1_CLK18_ENABLE 0x00002000
+#define KL3_I2S0_CLK18_ENABLE 0x00004000
+#define KL3_VIA_CLK16_ENABLE 0x00008000
+#define KL3_STOPPING33_ENABLED 0x00080000
+
+/* Port 0,1 : bus 0, port 2,3 : bus 1 */
+#define KL4_SET_PORT_ENABLE(p) (0x00000008 << (p<<3))
+#define KL4_SET_PORT_RESUME(p) (0x00000004 << (p<<3))
+#define KL4_SET_PORT_CONNECT(p) (0x00000002 << (p<<3))
+#define KL4_SET_PORT_DISCONNECT(p) (0x00000001 << (p<<3))
+#define KL4_GET_PORT_RESUME(p) (0x00000040 << (p<<3))
+#define KL4_GET_PORT_CONNECT(p) (0x00000020 << (p<<3))
+#define KL4_GET_PORT_DISCONNECT(p) (0x00000010 << (p<<3))
+
diff --git a/include/asm-ppc/kmap_types.h b/include/asm-ppc/kmap_types.h
new file mode 100644
index 000000000..d92d81b20
--- /dev/null
+++ b/include/asm-ppc/kmap_types.h
@@ -0,0 +1,10 @@
+#ifndef _ASM_KMAP_TYPES_H
+#define _ASM_KMAP_TYPES_H
+
+enum km_type {
+ KM_BOUNCE_READ,
+ KM_BOUNCE_WRITE,
+ KM_TYPE_NR
+};
+
+#endif
diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h
index 306fc2b21..709827f29 100644
--- a/include/asm-ppc/machdep.h
+++ b/include/asm-ppc/machdep.h
@@ -31,7 +31,7 @@ struct machdep_calls {
void (*power_off)(void);
void (*halt)(void);
- void (*time_init)(void); /* Optional, may be NULL */
+ long (*time_init)(void); /* Optional, may be NULL */
int (*set_rtc_time)(unsigned long nowtime);
unsigned long (*get_rtc_time)(void);
void (*calibrate_decr)(void);
@@ -75,7 +75,7 @@ struct machdep_calls {
void (*pcibios_fixup)(void);
void (*pcibios_fixup_bus)(struct pci_bus *);
- void* (*pci_dev_io_base)(unsigned char bus, unsigned char devfn);
+ void* (*pci_dev_io_base)(unsigned char bus, unsigned char devfn, int physical);
void* (*pci_dev_mem_base)(unsigned char bus, unsigned char devfn);
int (*pci_dev_root_bridge)(unsigned char bus, unsigned char devfn);
diff --git a/include/asm-ppc/mbx.h b/include/asm-ppc/mbx.h
index e67e0344f..6c84b8955 100644
--- a/include/asm-ppc/mbx.h
+++ b/include/asm-ppc/mbx.h
@@ -25,6 +25,7 @@ typedef struct bd_info {
unsigned int bi_busfreq; /* Bus Freq, in Hz */
unsigned int bi_clun; /* Boot device controller */
unsigned int bi_dlun; /* Boot device logical dev */
+ unsigned int bi_baudrate; /* ...to be like everyone else */
} bd_t;
/* Memory map for the MBX as configured by EPPC-Bug. We could reprogram
diff --git a/include/asm-ppc/mman.h b/include/asm-ppc/mman.h
index 99a5c8386..64abf0c58 100644
--- a/include/asm-ppc/mman.h
+++ b/include/asm-ppc/mman.h
@@ -22,8 +22,8 @@
#define MS_INVALIDATE 2 /* invalidate the caches */
#define MS_SYNC 4 /* synchronous memory sync */
-#define MCL_CURRENT 1 /* lock all current mappings */
-#define MCL_FUTURE 2 /* lock all future mappings */
+#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */
+#define MCL_FUTURE 0x4000 /* lock all additions to address space */
#define MADV_NORMAL 0x0 /* default page-in behavior */
#define MADV_RANDOM 0x1 /* page-in minimum required */
diff --git a/include/asm-ppc/nvram.h b/include/asm-ppc/nvram.h
index 985d2a321..144d518b9 100644
--- a/include/asm-ppc/nvram.h
+++ b/include/asm-ppc/nvram.h
@@ -38,6 +38,8 @@ enum {
pmac_nvram_NR /* MacOS Name Registry partition */
};
+#ifdef __KERNEL__
+
/* Return partition offset in nvram */
extern int pmac_get_partition(int partition);
@@ -45,15 +47,20 @@ extern int pmac_get_partition(int partition);
extern u8 pmac_xpram_read(int xpaddr);
extern void pmac_xpram_write(int xpaddr, u8 data);
+#endif /* __KERNEL__ */
+
/* Some offsets in XPRAM */
#define PMAC_XPRAM_MACHINE_LOC 0xe4
#define PMAC_XPRAM_SOUND_VOLUME 0x08
/* Machine location structure in XPRAM */
struct pmac_machine_location {
- u32 latitude; /* 2+30 bit Fractional number */
- u32 longitude; /* 2+30 bit Fractional number */
- u32 delta; /* mix of GMT delta and DLS */
+ unsigned int latitude; /* 2+30 bit Fractional number */
+ unsigned int longitude; /* 2+30 bit Fractional number */
+ unsigned int delta; /* mix of GMT delta and DLS */
};
+/* /dev/nvram ioctls */
+#define PMAC_NVRAM_GET_OFFSET _IOWR('p', 0x40, int) /* Get NVRAM partition offset */
+
#endif
diff --git a/include/asm-ppc/pci-bridge.h b/include/asm-ppc/pci-bridge.h
index ca893118a..5aa72d3a2 100644
--- a/include/asm-ppc/pci-bridge.h
+++ b/include/asm-ppc/pci-bridge.h
@@ -15,8 +15,12 @@ void *pci_io_base(unsigned int bus);
/* This version handles the new Uni-N host bridge, the iobase is now
* a per-device thing. I also added the memory base so PReP can
* be fixed to return 0xc0000000 (I didn't actually implement it)
+ *
+ * pci_dev_io_base() returns either a virtual (ioremap'ed) address or
+ * a physical address. In-kernel clients will use logical while the
+ * sys_pciconfig_iobase syscall returns a physical one to userland.
*/
-void *pci_dev_io_base(unsigned char bus, unsigned char devfn);
+void *pci_dev_io_base(unsigned char bus, unsigned char devfn, int physical);
void *pci_dev_mem_base(unsigned char bus, unsigned char devfn);
/* Returns the root-bridge number (Uni-N number) of a device */
@@ -33,7 +37,8 @@ int pci_device_loc(struct device_node *dev, unsigned char *bus_ptr,
struct bridge_data {
volatile unsigned int *cfg_addr;
volatile unsigned char *cfg_data;
- void *io_base;
+ void *io_base; /* virtual */
+ unsigned long io_base_phys;
int bus_number;
int max_bus;
struct bridge_data *next;
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index 348404828..c5a90fba0 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -69,7 +69,7 @@ extern inline void flush_tlb_pgtables(struct mm_struct *mm,
extern void flush_icache_range(unsigned long, unsigned long);
extern void __flush_page_to_ram(unsigned long page_va);
-#define flush_page_to_ram(page) __flush_page_to_ram((unsigned long) page_address(page))
+extern void flush_page_to_ram(struct page *page);
#define flush_dcache_page(page) do { } while (0)
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index 4fd684705..f99eb4abe 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -287,6 +287,7 @@
#define SPRN_UPMC3 0x3AD /* User Performance Counter Register 3 */
#define SPRN_UPMC4 0x3AE /* User Performance Counter Register 4 */
#define SPRN_USIA 0x3AB /* User Sampled Instruction Address Register */
+#define SPRN_VRSAVE 0x100 /* Vector Register Save Register */
#define SPRN_XER 0x001 /* Fixed Point Exception Register */
#define SPRN_ZPR 0x3B0 /* Zone Protection Register */
diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h
index a3d6e5d22..dc98c596d 100644
--- a/include/asm-ppc/prom.h
+++ b/include/asm-ppc/prom.h
@@ -7,11 +7,16 @@
#ifndef _PPC_PROM_H
#define _PPC_PROM_H
+#include <linux/config.h>
+
typedef void *phandle;
typedef void *ihandle;
extern char *prom_display_paths[];
extern unsigned int prom_num_displays;
+#ifndef CONFIG_MACH_SPECIFIC
+extern int have_of;
+#endif
struct address_range {
unsigned int space;
diff --git a/include/asm-ppc/resource.h b/include/asm-ppc/resource.h
index d31976a3d..956b34602 100644
--- a/include/asm-ppc/resource.h
+++ b/include/asm-ppc/resource.h
@@ -11,8 +11,9 @@
#define RLIMIT_NOFILE 7 /* max number of open files */
#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
#define RLIMIT_AS 9 /* address space limit(?) */
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
-#define RLIM_NLIMITS 10
+#define RLIM_NLIMITS 11
#ifdef __KERNEL__
@@ -35,6 +36,7 @@
{ INR_OPEN, INR_OPEN }, \
{ RLIM_INFINITY, RLIM_INFINITY }, \
{ RLIM_INFINITY, RLIM_INFINITY }, \
+ { RLIM_INFINITY, RLIM_INFINITY }, \
}
#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h
index 61d3412b9..b6b89dc79 100644
--- a/include/asm-ppc/serial.h
+++ b/include/asm-ppc/serial.h
@@ -23,16 +23,6 @@
#define RS_TABLE_SIZE 4
#endif
-#ifdef CONFIG_PMAC
-/*
- * Auto-probing will cause machine checks on powermacs.
- */
-#define SERIAL_PORT_DFNS
-#else
-/*
- * PReP, CHRP, etc.
- */
-
/* Standard COM flags (except for COM4, because of the 8514 problem) */
#ifdef CONFIG_SERIAL_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
@@ -136,5 +126,4 @@
HUB6_SERIAL_PORT_DFNS \
MCA_SERIAL_PORT_DFNS
-#endif /* CONFIG_PMAC */
#endif /* CONFIG_GEMINI */
diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h
index aec727670..abbd0ca0c 100644
--- a/include/asm-ppc/smp.h
+++ b/include/asm-ppc/smp.h
@@ -24,10 +24,11 @@ extern struct cpuinfo_PPC cpu_data[NR_CPUS];
extern unsigned long smp_proc_in_lock[NR_CPUS];
-extern void smp_message_pass(int target, int msg, unsigned long data, int wait);
extern void smp_store_cpu_info(int id);
-extern void smp_message_recv(int);
-void smp_send_tlb_invalidate(int);
+extern void smp_send_tlb_invalidate(int);
+extern void smp_send_xmon_break(int cpu);
+struct pt_regs;
+extern void smp_message_recv(int, struct pt_regs *);
#define NO_PROC_ID 0xFF /* No processor magic marker */
#define PROC_CHANGE_PENALTY 20
diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h
index 5e7e2a19e..292406736 100644
--- a/include/asm-ppc/spinlock.h
+++ b/include/asm-ppc/spinlock.h
@@ -41,6 +41,7 @@ typedef struct {
} rwlock_t;
#define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0 }
+#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0)
extern void _read_lock(rwlock_t *rw);
extern void _read_unlock(rwlock_t *rw);
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index 153e1c49d..523a427a0 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -36,6 +36,16 @@
#define set_mb(var, value) do { var = value; mb(); } while (0)
#define set_wmb(var, value) do { var = value; wmb(); } while (0)
+#ifdef CONFIG_SMP
+#define smp_mb() mb()
+#define smp_rmb() rmb()
+#define smp_wmb() wmb()
+#else
+#define smp_mb() __asm__ __volatile__("": : :"memory")
+#define smp_rmb() __asm__ __volatile__("": : :"memory")
+#define smp_wmb() __asm__ __volatile__("": : :"memory")
+#endif /* CONFIG_SMP */
+
extern void xmon_irq(int, void *, struct pt_regs *);
extern void xmon(struct pt_regs *excp);
@@ -67,6 +77,7 @@ extern void cvt_fd(float *from, double *to, unsigned long *fpscr);
extern void cvt_df(double *from, float *to, unsigned long *fpscr);
extern int call_rtas(const char *, int, int, unsigned long *, ...);
extern int abs(int);
+extern void cacheable_memzero(void *p, unsigned int nb);
struct device_node;
extern void note_scsi_host(struct device_node *, void *);
@@ -114,16 +125,25 @@ extern void __global_restore_flags(unsigned long);
#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
-extern unsigned long xchg_u64(void *ptr, unsigned long val);
-extern unsigned long xchg_u32(void *ptr, unsigned long val);
+static __inline__ unsigned long
+xchg_u32(volatile void *p, unsigned long val)
+{
+ unsigned long prev;
+
+ __asm__ __volatile__ ("
+1: lwarx %0,0,%2
+ stwcx. %3,0,%2
+ bne- 1b"
+ : "=&r" (prev), "=m" (*(volatile unsigned long *)p)
+ : "r" (p), "r" (val), "m" (*(volatile unsigned long *)p)
+ : "cc", "memory");
+
+ return prev;
+}
/*
* This function doesn't exist, so you'll get a linker error
* if something tries to do an invalid xchg().
- *
- * This only works if the compiler isn't horribly bad at optimizing.
- * gcc-2.5.8 reportedly can't handle this, but as that doesn't work
- * too well on the alpha anyway..
*/
extern void __xchg_called_with_bad_pointer(void);
@@ -135,8 +155,10 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
switch (size) {
case 4:
return (unsigned long )xchg_u32(ptr, x);
+#if 0 /* xchg_u64 doesn't exist on 32-bit PPC */
case 8:
return (unsigned long )xchg_u64(ptr, x);
+#endif /* 0 */
}
__xchg_called_with_bad_pointer();
return x;
@@ -149,4 +171,56 @@ extern inline void * xchg_ptr(void * m, void * val)
return (void *) xchg_u32(m, (unsigned long) val);
}
-#endif
+
+#define __HAVE_ARCH_CMPXCHG 1
+
+static __inline__ unsigned long
+__cmpxchg_u32(volatile int *p, int old, int new)
+{
+ int prev;
+
+ __asm__ __volatile__ ("
+1: lwarx %0,0,%2
+ cmpw 0,%0,%3
+ bne 2f
+ stwcx. %4,0,%2
+ bne- 1b\n"
+#ifdef CONFIG_SMP
+" sync\n"
+#endif /* CONFIG_SMP */
+"2:"
+ : "=&r" (prev), "=m" (*p)
+ : "r" (p), "r" (old), "r" (new), "m" (*p)
+ : "cc", "memory");
+
+ return prev;
+}
+
+/* This function doesn't exist, so you'll get a linker error
+ if something tries to do an invalid cmpxchg(). */
+extern void __cmpxchg_called_with_bad_pointer(void);
+
+static __inline__ unsigned long
+__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
+{
+ switch (size) {
+ case 4:
+ return __cmpxchg_u32(ptr, old, new);
+#if 0 /* we don't have __cmpxchg_u64 on 32-bit PPC */
+ case 8:
+ return __cmpxchg_u64(ptr, old, new);
+#endif /* 0 */
+ }
+ __cmpxchg_called_with_bad_pointer();
+ return old;
+}
+
+#define cmpxchg(ptr,o,n) \
+ ({ \
+ __typeof__(*(ptr)) _o_ = (o); \
+ __typeof__(*(ptr)) _n_ = (n); \
+ (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
+ (unsigned long)_n_, sizeof(*(ptr))); \
+ })
+
+#endif /* __PPC_SYSTEM_H */
diff --git a/include/asm-ppc/time.h b/include/asm-ppc/time.h
index 05d791546..1eb0ae9f0 100644
--- a/include/asm-ppc/time.h
+++ b/include/asm-ppc/time.h
@@ -12,11 +12,10 @@
#include <asm/processor.h>
/* time.c */
-extern unsigned decrementer_count;
-extern unsigned count_period_num;
-extern unsigned count_period_den;
-extern unsigned long mktime(unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, unsigned int);
+extern unsigned tb_ticks_per_jiffy;
+extern unsigned tb_to_us;
+extern unsigned tb_last_stamp;
+
extern void to_tm(int tim, struct rtc_time * tm);
extern time_t last_rtc_update;
@@ -37,6 +36,80 @@ static __inline__ void set_dec(unsigned int val)
#if defined(CONFIG_4xx)
mtspr(SPRN_PIT, val);
#else
+#ifdef CONFIG_8xx_CPU6
+ set_dec_cpu6(val);
+#else
mtspr(SPRN_DEC, val);
#endif
+#endif
+}
+
+/* Accessor functions for the timebase (RTC on 601) registers. */
+/* If one day CONFIG_POWER is added just define __USE_RTC as 1 */
+#ifdef CONFIG_6xx
+extern __inline__ int const __USE_RTC(void) {
+ return (mfspr(SPRN_PVR)>>16) == 1;
+}
+#else
+#define __USE_RTC() 0
+#endif
+
+extern __inline__ unsigned long get_tbl(void) {
+ unsigned long tbl;
+ asm volatile("mftb %0" : "=r" (tbl));
+ return tbl;
}
+
+extern __inline__ unsigned long get_rtcl(void) {
+ unsigned long rtcl;
+ asm volatile("mfrtcl %0" : "=r" (rtcl));
+ return rtcl;
+}
+
+extern __inline__ unsigned get_native_tbl(void) {
+ if (__USE_RTC())
+ return get_rtcl();
+ else
+ return get_tbl();
+}
+
+/* On machines with RTC, this function can only be used safely
+ * after the timestamp and for 1 second. It is only used by gettimeofday
+ * however so it should not matter.
+ */
+extern __inline__ unsigned tb_ticks_since(unsigned tstamp) {
+ if (__USE_RTC()) {
+ int delta = get_rtcl() - tstamp;
+ return delta<0 ? delta + 1000000000 : delta;
+ } else {
+ return get_tbl() - tstamp;
+ }
+}
+
+#if 0
+extern __inline__ unsigned long get_bin_rtcl(void) {
+ unsigned long rtcl, rtcu1, rtcu2;
+ asm volatile("\
+1: mfrtcu %0\n\
+ mfrtcl %1\n\
+ mfrtcu %2\n\
+ cmpw %0,%2\n\
+ bne- 1b\n"
+ : "=r" (rtcu1), "=r" (rtcl), "=r" (rtcu2)
+ : : "cr0");
+ return rtcu2*1000000000+rtcl;
+}
+
+extern __inline__ unsigned binary_tbl(void) {
+ if (__USE_RTC())
+ return get_bin_rtcl();
+ else
+ return get_tbl();
+}
+#endif
+
+/* Use mulhwu to scale processor timebase to timeval */
+#define mulhwu(x,y) \
+({unsigned z; asm ("mulhwu %0,%1,%2" : "=r" (z) : "r" (x), "r" (y)); z;})
+
+unsigned mulhwu_scale_factor(unsigned, unsigned);
diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h
index 3eafdbd91..628373b15 100644
--- a/include/asm-ppc/uaccess.h
+++ b/include/asm-ppc/uaccess.h
@@ -57,7 +57,7 @@ struct exception_table_entry
/* Returns 0 if exception not found and fixup otherwise. */
extern unsigned long search_exception_table(unsigned long);
-
+extern void sort_exception_table(void);
/*
* These are the main single-value transfer routines. They automatically
@@ -87,25 +87,6 @@ extern unsigned long search_exception_table(unsigned long);
#define __put_user(x,ptr) \
__put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
-/*
- * The "xxx_ret" versions return constant specified in third argument, if
- * something bad happens. These macros can be optimized for the
- * case of just returning from the function xxx_ret is used.
- */
-
-#define put_user_ret(x,ptr,ret) ({ \
-if (put_user(x,ptr)) return ret; })
-
-#define get_user_ret(x,ptr,ret) ({ \
-if (get_user(x,ptr)) return ret; })
-
-#define __put_user_ret(x,ptr,ret) ({ \
-if (__put_user(x,ptr)) return ret; })
-
-#define __get_user_ret(x,ptr,ret) ({ \
-if (__get_user(x,ptr)) return ret; })
-
-
extern long __put_user_bad(void);
#define __put_user_nocheck(x,ptr,size) \
@@ -150,10 +131,11 @@ struct __large_struct { unsigned long buf[100]; };
".section .fixup,\"ax\"\n" \
"3: li %0,%3\n" \
" b 2b\n" \
+ ".previous\n" \
".section __ex_table,\"a\"\n" \
" .align 2\n" \
" .long 1b,3b\n" \
- ".text" \
+ ".previous" \
: "=r"(err) \
: "r"(x), "b"(addr), "i"(-EFAULT), "0"(err))
@@ -197,10 +179,11 @@ do { \
"3: li %0,%3\n" \
" li %1,0\n" \
" b 2b\n" \
+ ".previous\n" \
".section __ex_table,\"a\"\n" \
" .align 2\n" \
" .long 1b,3b\n" \
- ".text" \
+ ".previous" \
: "=r"(err), "=r"(x) \
: "b"(addr), "i"(-EFAULT), "0"(err))
@@ -236,10 +219,6 @@ copy_to_user(void *to, const void *from, unsigned long n)
return n;
}
-#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; })
-
-#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; })
-
#define __copy_from_user(to, from, size) \
__copy_tofrom_user((to), (from), (size))
#define __copy_to_user(to, from, size) \
diff --git a/include/asm-ppc/uninorth.h b/include/asm-ppc/uninorth.h
new file mode 100644
index 000000000..eefe4389c
--- /dev/null
+++ b/include/asm-ppc/uninorth.h
@@ -0,0 +1,83 @@
+/*
+ * uninorth.h: definitions for using the "UniNorth" host bridge chip
+ * from Apple. This chip is used on "Core99" machines
+ *
+ */
+
+
+/*
+ * Uni-N config space reg. definitions
+ *
+ * (Little endian)
+ */
+
+/* Address ranges selection. This one should work with Bandit too */
+#define UNI_N_ADDR_SELECT 0x48
+#define UNI_N_ADDR_COARSE_MASK 0xffff0000 /* 256Mb regions at *0000000 */
+#define UNI_N_ADDR_FINE_MASK 0x0000ffff /* 16Mb regions at f*000000 */
+
+/* AGP registers */
+#define UNI_N_CFG_GART_BASE 0x8c
+#define UNI_N_CFG_AGP_BASE 0x90
+#define UNI_N_CFG_GART_CTRL 0x94
+#define UNI_N_CFG_INTERNAL_STATUS 0x98
+
+/* UNI_N_CFG_GART_CTRL bits definitions */
+#define UNI_N_CFG_GART_INVAL 0x00000001
+#define UNI_N_CFG_GART_ENABLE 0x00000100
+#define UNI_N_CFG_GART_2xRESET 0x00010000
+
+
+/*
+ * Uni-N memory mapped reg. definitions
+ *
+ * Those registers are Big-Endian !!
+ *
+ * Their meaning come from either Darwin and/or from experiments I made with
+ * the bootrom, I'm not sure about their exact meaning yet
+ *
+ */
+
+/* Version of the UniNorth chip */
+#define UNI_N_VERSION 0x0000 /* Known versions: 3,7 and 8 */
+
+/* This register is used to enable/disable various parts */
+#define UNI_N_CLOCK_CNTL 0x0020
+#define UNI_N_CLOCK_CNTL_PCI 0x00000001 /* guess ? */
+#define UNI_N_CLOCK_CNTL_GMAC 0x00000002
+#define UNI_N_CLOCK_CNTL_FW 0x00000004 /* guess ? */
+
+/* Power Management control ? (from Darwin) */
+#define UNI_N_POWER_MGT 0x0030
+#define UNI_N_POWER_MGT_NORMAL 0x00
+#define UNI_N_POWER_MGT_IDLE2 0x01
+#define UNI_N_POWER_MGT_SLEEP 0x02
+
+/* This register is configured by Darwin depending on the UniN
+ * revision
+ */
+#define UNI_N_ARB_CTRL 0x0040
+#define UNI_N_ARB_CTRL_QACK_DELAY_SHIFT 15
+#define UNI_N_ARB_CTRL_QACK_DELAY_MASK 0x0e1f8000
+#define UNI_N_ARB_CTRL_QACK_DELAY 0x30
+#define UNI_N_ARB_CTRL_QACK_DELAY105 0x00
+
+/* This one _might_ return the CPU number of the CPU reading it;
+ * the bootROM decides wether to boot or to sleep/spinloop depending
+ * on this register beeing 0 or not
+ */
+#define UNI_N_CPU_NUMBER 0x0050
+
+/* This register appear to be read by the bootROM to decide what
+ * to do on a non-recoverable reset (powerup or wakeup)
+ */
+#define UNI_N_HWINIT_STATE 0x0070
+#define UNI_N_HWINIT_STATE_SLEEPING 0x01
+#define UNI_N_HWINIT_STATE_RUNNING 0x02
+/* This last bit appear to be used by the bootROM to know the second
+ * CPU has started and will enter it's sleep loop with IP=0
+ */
+#define UNI_N_HWINIT_STATE_CPU1_FLAG 0x10000000
+
+
+
diff --git a/include/asm-ppc/unistd.h b/include/asm-ppc/unistd.h
index 3b884cbb4..5c432792b 100644
--- a/include/asm-ppc/unistd.h
+++ b/include/asm-ppc/unistd.h
@@ -201,10 +201,10 @@
#define __NR_stat64 195
#define __NR_lstat64 196
#define __NR_fstat64 197
-#define __NR_sys_pciconfig_read 198
-#define __NR_sys_pciconfig_write 199
-#define __NR_sys_pciconfig_iobase 200
-#define __NR_multiplexer 201
+#define __NR_pciconfig_read 198
+#define __NR_pciconfig_write 199
+#define __NR_pciconfig_iobase 200
+#define __NR_multiplexer 201
#define __NR_getdents64 202
#define __NR(n) #n
diff --git a/include/asm-s390/fcntl.h b/include/asm-s390/fcntl.h
index 3631627a4..c1987889a 100644
--- a/include/asm-s390/fcntl.h
+++ b/include/asm-s390/fcntl.h
@@ -54,6 +54,9 @@
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
+/* for leases */
+#define F_INPROGRESS 16
+
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
@@ -61,6 +64,11 @@
blocking */
#define LOCK_UN 8 /* remove lock */
+#define LOCK_MAND 32 /* This is a mandatory flock */
+#define LOCK_READ 64 /* ... Which allows concurrent read operations */
+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
+
struct flock {
short l_type;
short l_whence;
@@ -69,4 +77,5 @@ struct flock {
pid_t l_pid;
};
+#define F_LINUX_SPECIFIC_BASE 1024
#endif
diff --git a/include/asm-s390/resource.h b/include/asm-s390/resource.h
index 9cf7a4993..4e5d91143 100644
--- a/include/asm-s390/resource.h
+++ b/include/asm-s390/resource.h
@@ -23,8 +23,9 @@
#define RLIMIT_NOFILE 7 /* max number of open files */
#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
#define RLIMIT_AS 9 /* address space limit */
+#define RLIMIT_AS 10 /* maximum file locks held */
-#define RLIM_NLIMITS 10
+#define RLIM_NLIMITS 11
/*
* SuS says limits have to be unsigned.
@@ -46,6 +47,7 @@
{ INR_OPEN, INR_OPEN }, \
{ LONG_MAX, LONG_MAX }, \
{ LONG_MAX, LONG_MAX }, \
+ { LONG_MAX, LONG_MAX }, \
}
#endif /* __KERNEL__ */
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h
index 9f448fc50..a19cfa29f 100644
--- a/include/asm-s390/uaccess.h
+++ b/include/asm-s390/uaccess.h
@@ -407,10 +407,6 @@ __copy_from_user_asm(void* to, const void* from, long n)
err; \
})
-#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; })
-
-#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; })
-
/*
* Copy a null terminated string from userspace.
*/
diff --git a/include/asm-sh/atomic.h b/include/asm-sh/atomic.h
index e46fdc7bc..6fe7d5194 100644
--- a/include/asm-sh/atomic.h
+++ b/include/asm-sh/atomic.h
@@ -7,13 +7,7 @@
*
*/
-#include <linux/config.h>
-
-#ifdef CONFIG_SMP
typedef struct { volatile int counter; } atomic_t;
-#else
-typedef struct { int counter; } atomic_t;
-#endif
#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
@@ -23,19 +17,12 @@ typedef struct { int counter; } atomic_t;
#include <asm/system.h>
/*
- * Make sure gcc doesn't try to be clever and move things around
- * on us. We need to use _exactly_ the address the user gave us,
- * not some alias that contains the same information.
- */
-#define __atomic_fool_gcc(x) (*(volatile struct { int a[100]; } *)x)
-
-/*
* To get proper branch prediction for the main line, we must branch
* forward to code at the end of this object's .text section, then
* branch back to restart the operation.
*/
-extern __inline__ void atomic_add(int i, atomic_t * v)
+static __inline__ void atomic_add(int i, atomic_t * v)
{
unsigned long flags;
@@ -44,7 +31,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v)
restore_flags(flags);
}
-extern __inline__ void atomic_sub(int i, atomic_t *v)
+static __inline__ void atomic_sub(int i, atomic_t *v)
{
unsigned long flags;
@@ -53,7 +40,7 @@ extern __inline__ void atomic_sub(int i, atomic_t *v)
restore_flags(flags);
}
-extern __inline__ int atomic_add_return(int i, atomic_t * v)
+static __inline__ int atomic_add_return(int i, atomic_t * v)
{
unsigned long temp, flags;
@@ -66,7 +53,7 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)
return temp;
}
-extern __inline__ int atomic_sub_return(int i, atomic_t * v)
+static __inline__ int atomic_sub_return(int i, atomic_t * v)
{
unsigned long temp, flags;
@@ -88,7 +75,7 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v)
#define atomic_inc(v) atomic_add(1,(v))
#define atomic_dec(v) atomic_sub(1,(v))
-extern __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v)
+static __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v)
{
unsigned long flags;
@@ -97,7 +84,7 @@ extern __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v)
restore_flags(flags);
}
-extern __inline__ void atomic_set_mask(unsigned int mask, atomic_t *v)
+static __inline__ void atomic_set_mask(unsigned int mask, atomic_t *v)
{
unsigned long flags;
diff --git a/include/asm-sh/bitops.h b/include/asm-sh/bitops.h
index fde5f2121..d74bd4fbf 100644
--- a/include/asm-sh/bitops.h
+++ b/include/asm-sh/bitops.h
@@ -6,7 +6,7 @@
/* For __swab32 */
#include <asm/byteorder.h>
-extern __inline__ void set_bit(int nr, volatile void * addr)
+static __inline__ void set_bit(int nr, volatile void * addr)
{
int mask;
volatile unsigned int *a = addr;
@@ -19,7 +19,12 @@ extern __inline__ void set_bit(int nr, volatile void * addr)
restore_flags(flags);
}
-extern __inline__ void clear_bit(int nr, volatile void * addr)
+/*
+ * clear_bit() doesn't provide any barrier for the compiler.
+ */
+#define smp_mb__before_clear_bit() barrier()
+#define smp_mb__after_clear_bit() barrier()
+static __inline__ void clear_bit(int nr, volatile void * addr)
{
int mask;
volatile unsigned int *a = addr;
@@ -32,7 +37,7 @@ extern __inline__ void clear_bit(int nr, volatile void * addr)
restore_flags(flags);
}
-extern __inline__ void change_bit(int nr, volatile void * addr)
+static __inline__ void change_bit(int nr, volatile void * addr)
{
int mask;
volatile unsigned int *a = addr;
@@ -45,7 +50,7 @@ extern __inline__ void change_bit(int nr, volatile void * addr)
restore_flags(flags);
}
-extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
+static __inline__ int test_and_set_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile unsigned int *a = addr;
@@ -61,7 +66,7 @@ extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
return retval;
}
-extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
+static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile unsigned int *a = addr;
@@ -77,7 +82,7 @@ extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
return retval;
}
-extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
+static __inline__ int test_and_change_bit(int nr, volatile void * addr)
{
int mask, retval;
volatile unsigned int *a = addr;
@@ -94,12 +99,12 @@ extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
}
-extern __inline__ int test_bit(int nr, const volatile void *addr)
+static __inline__ int test_bit(int nr, const volatile void *addr)
{
return 1UL & (((const volatile unsigned int *) addr)[nr >> 5] >> (nr & 31));
}
-extern __inline__ unsigned long ffz(unsigned long word)
+static __inline__ unsigned long ffz(unsigned long word)
{
unsigned long result;
@@ -108,11 +113,12 @@ extern __inline__ unsigned long ffz(unsigned long word)
"bt/s 1b\n\t"
" add #1, %0"
: "=r" (result), "=r" (word)
- : "0" (~0L), "1" (word));
+ : "0" (~0L), "1" (word)
+ : "t");
return result;
}
-extern __inline__ int find_next_zero_bit(void *addr, int size, int offset)
+static __inline__ int find_next_zero_bit(void *addr, int size, int offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
unsigned long result = offset & ~31UL;
@@ -159,7 +165,7 @@ found_middle:
#define ext2_find_next_zero_bit(addr, size, offset) \
find_next_zero_bit((addr), (size), (offset))
#else
-extern __inline__ int ext2_set_bit(int nr, volatile void * addr)
+static __inline__ int ext2_set_bit(int nr, volatile void * addr)
{
int mask, retval;
unsigned long flags;
@@ -174,7 +180,7 @@ extern __inline__ int ext2_set_bit(int nr, volatile void * addr)
return retval;
}
-extern __inline__ int ext2_clear_bit(int nr, volatile void * addr)
+static __inline__ int ext2_clear_bit(int nr, volatile void * addr)
{
int mask, retval;
unsigned long flags;
@@ -189,7 +195,7 @@ extern __inline__ int ext2_clear_bit(int nr, volatile void * addr)
return retval;
}
-extern __inline__ int ext2_test_bit(int nr, const volatile void * addr)
+static __inline__ int ext2_test_bit(int nr, const volatile void * addr)
{
int mask;
const volatile unsigned char *ADDR = (const unsigned char *) addr;
@@ -202,7 +208,7 @@ extern __inline__ int ext2_test_bit(int nr, const volatile void * addr)
#define ext2_find_first_zero_bit(addr, size) \
ext2_find_next_zero_bit((addr), (size), 0)
-extern __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
+static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
unsigned long result = offset & ~31UL;
diff --git a/include/asm-sh/checksum.h b/include/asm-sh/checksum.h
index 05a556fc7..7e9418b3b 100644
--- a/include/asm-sh/checksum.h
+++ b/include/asm-sh/checksum.h
@@ -82,7 +82,8 @@ static __inline__ unsigned int csum_fold(unsigned int sum)
"add %1, %0\n\t"
"not %0, %0\n\t"
: "=r" (sum), "=&r" (__dummy)
- : "0" (sum));
+ : "0" (sum)
+ : "t");
return sum;
}
@@ -115,7 +116,8 @@ static __inline__ unsigned short ip_fast_csum(unsigned char * iph, unsigned int
are modified, we must also specify them as outputs, or gcc
will assume they contain their original values. */
: "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (__dummy0), "=&z" (__dummy1)
- : "1" (iph), "2" (ihl));
+ : "1" (iph), "2" (ihl)
+ : "t");
return csum_fold(sum);
}
@@ -138,7 +140,8 @@ static __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr,
"movt %0\n\t"
"add %1, %0"
: "=r" (sum), "=r" (len_proto)
- : "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum));
+ : "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum)
+ : "t");
return sum;
}
@@ -197,7 +200,8 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
"add %1, %0\n"
: "=r" (sum), "=&r" (__dummy)
: "r" (saddr), "r" (daddr),
- "r" (htonl(len)), "r" (htonl(proto)), "0" (sum));
+ "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)
+ : "t");
return csum_fold(sum);
}
diff --git a/include/asm-sh/delay.h b/include/asm-sh/delay.h
index 7495d31c8..38e5a48c0 100644
--- a/include/asm-sh/delay.h
+++ b/include/asm-sh/delay.h
@@ -15,7 +15,8 @@ extern __inline__ void __delay(unsigned long loops)
"bf/s 1b\n\t"
" dt %0"
: "=r" (loops)
- : "0" (loops));
+ : "0" (loops)
+ : "t");
}
extern __inline__ void __udelay(unsigned long usecs, unsigned long lps)
diff --git a/include/asm-sh/fcntl.h b/include/asm-sh/fcntl.h
index 7e8345ff6..21e39b7cc 100644
--- a/include/asm-sh/fcntl.h
+++ b/include/asm-sh/fcntl.h
@@ -35,6 +35,10 @@
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */
+#define F_GETLK64 12 /* using 'struct flock64' */
+#define F_SETLK64 13
+#define F_SETLKW64 14
+
/* for F_[GET|SET]FL */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
@@ -47,6 +51,9 @@
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
+/* for leases */
+#define F_INPROGRESS 16
+
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
@@ -54,6 +61,11 @@
blocking */
#define LOCK_UN 8 /* remove lock */
+#define LOCK_MAND 32 /* This is a mandatory flock */
+#define LOCK_READ 64 /* ... Which allows concurrent read operations */
+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
+
struct flock {
short l_type;
short l_whence;
@@ -62,5 +74,14 @@ struct flock {
pid_t l_pid;
};
+struct flock64 {
+ short l_type;
+ short l_whence;
+ loff_t l_start;
+ loff_t l_len;
+ pid_t l_pid;
+};
+
+#define F_LINUX_SPECIFIC_BASE 1024
#endif /* __ASM_SH_FCNTL_H */
diff --git a/include/asm-sh/ide.h b/include/asm-sh/ide.h
index 25570cea2..db9df9256 100644
--- a/include/asm-sh/ide.h
+++ b/include/asm-sh/ide.h
@@ -18,7 +18,8 @@
#include <asm/machvec.h>
#ifndef MAX_HWIFS
-#define MAX_HWIFS 1
+/* Should never have less than 2, ide-pci.c(ide_match_hwif) requires it */
+#define MAX_HWIFS 2
#endif
#define ide__sti() __sti()
diff --git a/include/asm-sh/io_hd64461.h b/include/asm-sh/io_hd64461.h
index 2574a39ab..ab7a8a506 100644
--- a/include/asm-sh/io_hd64461.h
+++ b/include/asm-sh/io_hd64461.h
@@ -62,6 +62,10 @@ extern void hd64461_outsl(unsigned int port, const void *addr, unsigned long cou
# define __writew generic_writew
# define __writel generic_writel
+# define __isa_port2addr generic_isa_port2addr
+# define __ioremap generic_ioremap
+# define __iounmap generic_iounmap
+
#endif
#endif /* _ASM_SH_IO_HD64461_H */
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
index 48016e3f9..28d25be33 100644
--- a/include/asm-sh/irq.h
+++ b/include/asm-sh/irq.h
@@ -42,6 +42,7 @@
#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
#define SCIF_ERI_IRQ 56
#define SCIF_RXI_IRQ 57
+#define SCIF_BRI_IRQ 58
#define SCIF_TXI_IRQ 59
#define SCIF_IPR_ADDR INTC_IPRE
#define SCIF_IPR_POS 1
@@ -49,6 +50,7 @@
#define IRDA_ERI_IRQ 52
#define IRDA_RXI_IRQ 53
+#define IRDA_BRI_IRQ 54
#define IRDA_TXI_IRQ 55
#define IRDA_IPR_ADDR INTC_IPRE
#define IRDA_IPR_POS 2
@@ -56,6 +58,7 @@
#elif defined(CONFIG_CPU_SUBTYPE_SH7750)
#define SCIF_ERI_IRQ 40
#define SCIF_RXI_IRQ 41
+#define SCIF_BRI_IRQ 42
#define SCIF_TXI_IRQ 43
#define SCIF_IPR_ADDR INTC_IPRC
#define SCIF_IPR_POS 1
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h
index dcac85fa6..aa406533f 100644
--- a/include/asm-sh/page.h
+++ b/include/asm-sh/page.h
@@ -9,7 +9,7 @@
[ P0/U0 (virtual) ] 0x00000000 <------ User space
[ P1 (fixed) cached ] 0x80000000 <------ Kernel space
[ P2 (fixed) non-cachable] 0xA0000000 <------ Physical access
- [ P3 (virtual) cached] 0xC0000000 <------ not used
+ [ P3 (virtual) cached] 0xC0000000 <------ vmalloced area
[ P4 control ] 0xE0000000
*/
@@ -26,8 +26,14 @@
#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
#define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE)
+
+#if defined(__sh3__)
#define clear_user_page(page, vaddr) clear_page(page)
#define copy_user_page(to, from, vaddr) copy_page(to, from)
+#elif defined(__SH4__)
+extern void clear_user_page(void *to, unsigned long address);
+extern void copy_user_page(void *to, void *from, unsigned long address);
+#endif
/*
* These are used to make use of C type-checking..
@@ -62,7 +68,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
#define __MEMORY_START CONFIG_MEMORY_START
-#define PAGE_OFFSET (0x80000000)
+#define PAGE_OFFSET (0x80000000UL)
#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
#define virt_to_page(kaddr) (mem_map + ((__pa(kaddr)-__MEMORY_START) >> PAGE_SHIFT))
diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h
index 2c3ce9038..9c53169f6 100644
--- a/include/asm-sh/pci.h
+++ b/include/asm-sh/pci.h
@@ -18,12 +18,12 @@
#define PCIBIOS_MIN_MEM 0x10000000
#endif
-extern inline void pcibios_set_master(struct pci_dev *dev)
+static inline void pcibios_set_master(struct pci_dev *dev)
{
/* No special bus mastering setup handling */
}
-extern inline void pcibios_penalize_isa_irq(int irq)
+static inline void pcibios_penalize_isa_irq(int irq)
{
/* We don't do dynamic PCI IRQ allocation */
}
@@ -67,7 +67,7 @@ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
* Once the device is given the dma address, the device owns this memory
* until either pci_unmap_single or pci_dma_sync_single is performed.
*/
-extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
+static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
size_t size,int directoin)
{
return virt_to_bus(ptr);
@@ -80,7 +80,7 @@ extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
* After this call, reads by the cpu to the buffer are guarenteed to see
* whatever the device wrote there.
*/
-extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
+static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
size_t size,int direction)
{
/* Nothing to do */
@@ -101,7 +101,7 @@ extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
* Device ownership issues as mentioned above for pci_map_single are
* the same here.
*/
-extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
+static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
int nents,int direction)
{
return nents;
@@ -111,7 +111,7 @@ extern inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
* Again, cpu read rules concerning calls here are the same as for
* pci_unmap_single() above.
*/
-extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
+static inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
int nents,int direction)
{
/* Nothing to do */
@@ -126,7 +126,7 @@ extern inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
* next point you give the PCI dma address back to the card, the
* device again owns the buffer.
*/
-extern inline void pci_dma_sync_single(struct pci_dev *hwdev,
+static inline void pci_dma_sync_single(struct pci_dev *hwdev,
dma_addr_t dma_handle,
size_t size,int direction)
{
@@ -139,7 +139,7 @@ extern inline void pci_dma_sync_single(struct pci_dev *hwdev,
* The same as pci_dma_sync_single but for a scatter-gather list,
* same rules and usage.
*/
-extern inline void pci_dma_sync_sg(struct pci_dev *hwdev,
+static inline void pci_dma_sync_sg(struct pci_dev *hwdev,
struct scatterlist *sg,
int nelems,int direction)
{
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index df3e8edf2..f84b7904a 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -92,45 +92,44 @@ extern unsigned long empty_zero_page[1024];
#define VMALLOC_VMADDR(x) ((unsigned long)(x))
#define VMALLOC_END P4SEG
-#define _PAGE_PRESENT 0x001 /* software: page is present */
-#define _PAGE_ACCESSED 0x002 /* software: page referenced */
+/* 0x001 WT-bit on SH-4, 0 on SH-3 */
+#define _PAGE_HW_SHARED 0x002 /* SH-bit : page is shared among processes */
#define _PAGE_DIRTY 0x004 /* D-bit : page changed */
#define _PAGE_CACHABLE 0x008 /* C-bit : cachable */
-/* 0x010 SZ-bit : size of page */
+/* 0x010 SZ0-bit : Size of page */
#define _PAGE_RW 0x020 /* PR0-bit : write access allowed */
#define _PAGE_USER 0x040 /* PR1-bit : user space access allowed */
-#define _PAGE_PROTNONE 0x080 /* software: if not present */
-/* 0x100 V-bit : page is valid */
-/* 0x200 can be used as software flag */
-/* 0x400 can be used as software flag */
-/* 0x800 can be used as software flag */
+/* 0x080 SZ1-bit : Size of page (on SH-4) */
+#define _PAGE_PRESENT 0x100 /* V-bit : page is valid */
+#define _PAGE_PROTNONE 0x200 /* software: if not present */
+#define _PAGE_ACCESSED 0x400 /* software: page referenced */
+#define _PAGE_U0_SHARED 0x800 /* software: page is shared in user space */
-#if defined(__sh3__)
/* Mask which drop software flags */
-#define _PAGE_FLAGS_HARDWARE_MASK 0x1ffff06c
-/* Flags defalult: SZ=1 (4k-byte), C=0 (non-cachable), SH=0 (not shared) */
-#define _PAGE_FLAGS_HARDWARE_DEFAULT 0x00000110
+#define _PAGE_FLAGS_HARDWARE_MASK 0x1ffff1ff
+/* Hardware flags: SZ=1 (4k-byte) */
+#define _PAGE_FLAGS_HARD 0x00000010
+
+#if defined(__sh3__)
+#define _PAGE_SHARED _PAGE_HW_SHARED
#elif defined(__SH4__)
-/* Mask which drops software flags */
-#define _PAGE_FLAGS_HARDWARE_MASK 0x1ffff06c
-/* Flags defalult: SZ=01 (4k-byte), C=0 (non-cachable), SH=0 (not shared), WT=0 */
-#define _PAGE_FLAGS_HARDWARE_DEFAULT 0x00000110
+#define _PAGE_SHARED _PAGE_U0_SHARED
#endif
#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
-#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_CACHABLE | _PAGE_DIRTY)
+#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_CACHABLE | _PAGE_DIRTY | _PAGE_SHARED)
-#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_CACHABLE |_PAGE_ACCESSED)
-#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_CACHABLE |_PAGE_ACCESSED)
-#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_CACHABLE | _PAGE_ACCESSED)
-#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_CACHABLE | _PAGE_ACCESSED)
-#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_CACHABLE | _PAGE_DIRTY | _PAGE_ACCESSED)
-#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_CACHABLE | _PAGE_DIRTY | _PAGE_ACCESSED)
+#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_CACHABLE |_PAGE_ACCESSED | _PAGE_FLAGS_HARD)
+#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_CACHABLE |_PAGE_ACCESSED | _PAGE_SHARED | _PAGE_FLAGS_HARD)
+#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_CACHABLE | _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
+#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_CACHABLE | _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
+#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_CACHABLE | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_HW_SHARED | _PAGE_FLAGS_HARD)
+#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_CACHABLE | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_HW_SHARED | _PAGE_FLAGS_HARD)
/*
* As i386 and MIPS, SuperH can't do page protection for execute, and
- * considers that the same are read. Also, write permissions imply
+ * considers that the same as a read. Also, write permissions imply
* read permissions. This is the closest we can get..
*/
@@ -184,6 +183,7 @@ extern inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
extern inline int pte_dirty(pte_t pte){ return pte_val(pte) & _PAGE_DIRTY; }
extern inline int pte_young(pte_t pte){ return pte_val(pte) & _PAGE_ACCESSED; }
extern inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_RW; }
+extern inline int pte_shared(pte_t pte){ return pte_val(pte) & _PAGE_SHARED; }
extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
@@ -244,11 +244,15 @@ extern void update_mmu_cache(struct vm_area_struct * vma,
unsigned long address, pte_t pte);
/* Encode and de-code a swap entry */
-#define SWP_TYPE(x) (((x).val >> 1) & 0x3f)
-#define SWP_OFFSET(x) ((x).val >> 8)
-#define SWP_ENTRY(type, offset) ((swp_entry_t) { ((type) << 1) | ((offset) << 8) })
-#define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
-#define swp_entry_to_pte(x) ((pte_t) { (x).val })
+/*
+ * NOTE: We should set ZEROs at the position of _PAGE_PRESENT
+ * and _PAGE_PROTONOE bits
+ */
+#define SWP_TYPE(x) ((x).val & 0xff)
+#define SWP_OFFSET(x) ((x).val >> 10)
+#define SWP_ENTRY(type, offset) ((swp_entry_t) { (type) | ((offset) << 10) })
+#define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
+#define swp_entry_to_pte(x) ((pte_t) { (x).val })
#define module_map vmalloc
#define module_unmap vfree
diff --git a/include/asm-sh/resource.h b/include/asm-sh/resource.h
index 084ad61ec..574b64488 100644
--- a/include/asm-sh/resource.h
+++ b/include/asm-sh/resource.h
@@ -15,8 +15,9 @@
#define RLIMIT_NOFILE 7 /* max number of open files */
#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
#define RLIMIT_AS 9 /* address space limit */
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
-#define RLIM_NLIMITS 10
+#define RLIM_NLIMITS 11
#ifdef __KERNEL__
@@ -38,6 +39,7 @@
{ INR_OPEN, INR_OPEN }, \
{ RLIM_INFINITY, RLIM_INFINITY }, \
{ RLIM_INFINITY, RLIM_INFINITY }, \
+ { RLIM_INFINITY, RLIM_INFINITY }, \
}
#endif /* __KERNEL__ */
diff --git a/include/asm-sh/string.h b/include/asm-sh/string.h
index 3eab1c123..d85e4e406 100644
--- a/include/asm-sh/string.h
+++ b/include/asm-sh/string.h
@@ -20,7 +20,7 @@ extern __inline__ char *strcpy(char *__dest, const char *__src)
" add #1, %0\n\t"
: "=r" (__dest), "=r" (__src), "=&z" (__dummy)
: "0" (__dest), "1" (__src)
- : "memory");
+ : "memory", "t");
return __xdest;
}
@@ -46,7 +46,7 @@ extern __inline__ char *strncpy(char *__dest, const char *__src, size_t __n)
"2:"
: "=r" (__dest), "=r" (__src), "=&z" (__dummy)
: "0" (__dest), "1" (__src), "r" (__src+__n)
- : "memory");
+ : "memory", "t");
return __xdest;
}
@@ -71,7 +71,8 @@ extern __inline__ int strcmp(const char *__cs, const char *__ct)
"sub %3, %2\n"
"2:"
: "=r" (__cs), "=r" (__ct), "=&r" (__res), "=&z" (__dummy)
- : "0" (__cs), "1" (__ct));
+ : "0" (__cs), "1" (__ct)
+ : "t");
return __res;
}
@@ -82,6 +83,9 @@ extern __inline__ int strncmp(const char *__cs, const char *__ct, size_t __n)
register int __res;
unsigned long __dummy;
+ if (__n == 0)
+ return 0;
+
__asm__ __volatile__(
"mov.b @%1+, %3\n"
"1:\n\t"
@@ -99,7 +103,8 @@ extern __inline__ int strncmp(const char *__cs, const char *__ct, size_t __n)
"sub %3, %2\n"
"3:"
:"=r" (__cs), "=r" (__ct), "=&r" (__res), "=&z" (__dummy)
- : "0" (__cs), "1" (__ct), "r" (__cs+__n));
+ : "0" (__cs), "1" (__ct), "r" (__cs+__n)
+ : "t");
return __res;
}
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index c3ca3b467..86786c730 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -21,12 +21,12 @@ typedef struct {
#define prepare_to_switch() do { } while(0)
#define switch_to(prev,next,last) do { \
register struct task_struct *__last; \
- register unsigned long *__ts1 __asm__ ("$r1") = &prev->thread.sp; \
- register unsigned long *__ts2 __asm__ ("$r2") = &prev->thread.pc; \
- register unsigned long *__ts4 __asm__ ("$r4") = (unsigned long *)prev; \
- register unsigned long *__ts5 __asm__ ("$r5") = (unsigned long *)next; \
- register unsigned long *__ts6 __asm__ ("$r6") = &next->thread.sp; \
- register unsigned long __ts7 __asm__ ("$r7") = next->thread.pc; \
+ register unsigned long *__ts1 __asm__ ("r1") = &prev->thread.sp; \
+ register unsigned long *__ts2 __asm__ ("r2") = &prev->thread.pc; \
+ register unsigned long *__ts4 __asm__ ("r4") = (unsigned long *)prev; \
+ register unsigned long *__ts5 __asm__ ("r5") = (unsigned long *)next; \
+ register unsigned long *__ts6 __asm__ ("r6") = &next->thread.sp; \
+ register unsigned long __ts7 __asm__ ("r7") = next->thread.pc; \
__asm__ __volatile__ (".balign 4\n\t" \
"stc.l $gbr, @-$r15\n\t" \
"sts.l $pr, @-$r15\n\t" \
@@ -63,7 +63,7 @@ typedef struct {
:"0" (prev), \
"r" (__ts1), "r" (__ts2), \
"r" (__ts4), "r" (__ts5), "r" (__ts6), "r" (__ts7) \
- :"r3"); \
+ :"r3", "t"); \
last = __last; \
} while (0)
#endif
@@ -88,11 +88,22 @@ extern void __xchg_called_with_bad_pointer(void);
#define mb() __asm__ __volatile__ ("": : :"memory")
#define rmb() mb()
#define wmb() __asm__ __volatile__ ("": : :"memory")
+
+#ifdef CONFIG_SMP
+#define smp_mb() mb()
+#define smp_rmb() rmb()
+#define smp_wmb() wmb()
+#else
+#define smp_mb() barrier()
+#define smp_rmb() barrier()
+#define smp_wmb() barrier()
+#endif
+
#define set_mb(var, value) do { xchg(&var, value); } while (0)
#define set_wmb(var, value) do { var = value; wmb(); } while (0)
/* Interrupt Control */
-extern __inline__ void __sti(void)
+static __inline__ void __sti(void)
{
unsigned long __dummy0, __dummy1;
@@ -106,7 +117,7 @@ extern __inline__ void __sti(void)
: "memory");
}
-extern __inline__ void __cli(void)
+static __inline__ void __cli(void)
{
unsigned long __dummy;
__asm__ __volatile__("stc $sr, %0\n\t"
@@ -205,7 +216,7 @@ extern void __global_restore_flags(unsigned long);
#endif
-extern __inline__ unsigned long xchg_u32(volatile int * m, unsigned long val)
+static __inline__ unsigned long xchg_u32(volatile int * m, unsigned long val)
{
unsigned long flags, retval;
@@ -216,7 +227,7 @@ extern __inline__ unsigned long xchg_u32(volatile int * m, unsigned long val)
return retval;
}
-extern __inline__ unsigned long xchg_u8(volatile unsigned char * m, unsigned long val)
+static __inline__ unsigned long xchg_u8(volatile unsigned char * m, unsigned long val)
{
unsigned long flags, retval;
diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h
index 2237d34a4..4fe09b005 100644
--- a/include/asm-sh/uaccess.h
+++ b/include/asm-sh/uaccess.h
@@ -45,11 +45,12 @@
* sum := addr + size; carry? --> flag = true;
* if (sum >= addr_limit) flag = true;
*/
-#define __range_ok(addr,size) ({ \
- unsigned long flag,sum; \
- __asm__("clrt; addc %3, %1; movt %0; cmp/hi %4, %1; rotcl %0" \
- :"=&r" (flag), "=r" (sum) \
- :"1" (addr), "r" ((int)(size)), "r" (current->addr_limit.seg)); \
+#define __range_ok(addr,size) ({ \
+ unsigned long flag,sum; \
+ __asm__("clrt; addc %3, %1; movt %0; cmp/hi %4, %1; rotcl %0" \
+ :"=&r" (flag), "=r" (sum) \
+ :"1" (addr), "r" ((int)(size)), "r" (current->addr_limit.seg) \
+ :"t"); \
flag; })
#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
@@ -83,24 +84,6 @@ extern inline int verify_area(int type, const void * addr, unsigned long size)
#define __put_user(x,ptr) __put_user_nocheck((x),(ptr),sizeof(*(ptr)))
#define __get_user(x,ptr) __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
-/*
- * The "xxx_ret" versions return constant specified in third argument, if
- * something bad happens. These macros can be optimized for the
- * case of just returning from the function xxx_ret is used.
- */
-
-#define put_user_ret(x,ptr,ret) ({ \
-if (put_user(x,ptr)) return ret; })
-
-#define get_user_ret(x,ptr,ret) ({ \
-if (get_user(x,ptr)) return ret; })
-
-#define __put_user_ret(x,ptr,ret) ({ \
-if (__put_user(x,ptr)) return ret; })
-
-#define __get_user_ret(x,ptr,ret) ({ \
-if (__get_user(x,ptr)) return ret; })
-
struct __large_struct { unsigned long buf[100]; };
#define __m(x) (*(struct __large_struct *)(x))
@@ -204,7 +187,8 @@ __asm__ __volatile__( \
".long 1b, 3b\n\t" \
".previous" \
:"=&r" (__pu_err) \
- :"r" (__pu_val), "m" (__m(__pu_addr)), "i" (-EFAULT)); })
+ :"r" (__pu_val), "m" (__m(__pu_addr)), "i" (-EFAULT) \
+ :"memory"); })
extern void __put_user_unknown(void);
@@ -242,7 +226,7 @@ __copy_user(void *__to, const void *__from, __kernel_size_t __n)
".previous"
: "=r" (res), "=&z" (__dummy), "=r" (_f), "=r" (_t)
: "2" (__from), "3" (__to), "0" (res)
- : "memory");
+ : "memory", "t");
return res;
}
@@ -256,20 +240,10 @@ __copy_res = __copy_user(__copy_to, (void *) (from), __copy_size); \
} else __copy_res = __copy_size; \
__copy_res; })
-#define copy_to_user_ret(to,from,n,retval) ({ \
-if (copy_to_user(to,from,n)) \
- return retval; \
-})
-
#define __copy_to_user(to,from,n) \
__copy_user((void *)(to), \
(void *)(from), n)
-#define __copy_to_user_ret(to,from,n,retval) ({ \
-if (__copy_to_user(to,from,n)) \
- return retval; \
-})
-
#define copy_from_user(to,from,n) ({ \
void *__copy_to = (void *) (to); \
void *__copy_from = (void *) (from); \
@@ -280,20 +254,10 @@ __copy_res = __copy_user(__copy_to, __copy_from, __copy_size); \
} else __copy_res = __copy_size; \
__copy_res; })
-#define copy_from_user_ret(to,from,n,retval) ({ \
-if (copy_from_user(to,from,n)) \
- return retval; \
-})
-
#define __copy_from_user(to,from,n) \
__copy_user((void *)(to), \
(void *)(from), n)
-#define __copy_from_user_ret(to,from,n,retval) ({ \
-if (__copy_from_user(to,from,n)) \
- return retval; \
-})
-
/* XXX: Not sure it works well..
should be such that: 4byte clear and the rest. */
extern __inline__ __kernel_size_t
@@ -322,7 +286,8 @@ __clear_user(void *addr, __kernel_size_t size)
" .long 1b,3b\n"
".previous"
: "=r" (size), "=r" (__a)
- : "0" (size), "1" (addr), "r" (0));
+ : "0" (size), "1" (addr), "r" (0)
+ : "memory", "t");
return size;
}
@@ -368,7 +333,7 @@ __strncpy_from_user(unsigned long __dest, unsigned long __src, int __count)
: "=r" (res), "=&z" (__dummy), "=r" (_s), "=r" (_d)
: "0" (__count), "2" (__src), "3" (__dest), "r" (__count),
"i" (-EFAULT)
- : "memory");
+ : "memory", "t");
return res;
}
@@ -414,7 +379,8 @@ extern __inline__ long __strnlen_user(const char *__s, long __n)
" .long 1b,3b\n"
".previous"
: "=z" (res), "=&r" (__dummy)
- : "0" (0), "r" (__s), "r" (__n), "i" (-EFAULT));
+ : "0" (0), "r" (__s), "r" (__n), "i" (-EFAULT)
+ : "t");
return res;
}
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index 132a4edc1..e5896abec 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -230,6 +230,7 @@
#define __NR_mincore 218
#define __NR_madvise 219
#define __NR_getdents64 220
+#define __NR_fcntl64 221
/* user-visible error numbers are in the range -1 - -125: see <asm-sh/errno.h> */
@@ -249,7 +250,7 @@ do { \
#define _syscall0(type,name) \
type name(void) \
{ \
-register long __sc0 __asm__ ("$r3") = __NR_##name; \
+register long __sc0 __asm__ ("r3") = __NR_##name; \
__asm__ __volatile__ ("trapa #0x10" \
: "=z" (__sc0) \
: "0" (__sc0) \
@@ -260,8 +261,8 @@ __syscall_return(type,__sc0); \
#define _syscall1(type,name,type1,arg1) \
type name(type1 arg1) \
{ \
-register long __sc0 __asm__ ("$r3") = __NR_##name; \
-register long __sc4 __asm__ ("$r4") = (long) arg1; \
+register long __sc0 __asm__ ("r3") = __NR_##name; \
+register long __sc4 __asm__ ("r4") = (long) arg1; \
__asm__ __volatile__ ("trapa #0x11" \
: "=z" (__sc0) \
: "0" (__sc0), "r" (__sc4) \
@@ -272,9 +273,9 @@ __syscall_return(type,__sc0); \
#define _syscall2(type,name,type1,arg1,type2,arg2) \
type name(type1 arg1,type2 arg2) \
{ \
-register long __sc0 __asm__ ("$r3") = __NR_##name; \
-register long __sc4 __asm__ ("$r4") = (long) arg1; \
-register long __sc5 __asm__ ("$r5") = (long) arg2; \
+register long __sc0 __asm__ ("r3") = __NR_##name; \
+register long __sc4 __asm__ ("r4") = (long) arg1; \
+register long __sc5 __asm__ ("r5") = (long) arg2; \
__asm__ __volatile__ ("trapa #0x12" \
: "=z" (__sc0) \
: "0" (__sc0), "r" (__sc4), "r" (__sc5) \
@@ -285,10 +286,10 @@ __syscall_return(type,__sc0); \
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
type name(type1 arg1,type2 arg2,type3 arg3) \
{ \
-register long __sc0 __asm__ ("$r3") = __NR_##name; \
-register long __sc4 __asm__ ("$r4") = (long) arg1; \
-register long __sc5 __asm__ ("$r5") = (long) arg2; \
-register long __sc6 __asm__ ("$r6") = (long) arg3; \
+register long __sc0 __asm__ ("r3") = __NR_##name; \
+register long __sc4 __asm__ ("r4") = (long) arg1; \
+register long __sc5 __asm__ ("r5") = (long) arg2; \
+register long __sc6 __asm__ ("r6") = (long) arg3; \
__asm__ __volatile__ ("trapa #0x13" \
: "=z" (__sc0) \
: "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) \
@@ -299,11 +300,11 @@ __syscall_return(type,__sc0); \
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
{ \
-register long __sc0 __asm__ ("$r3") = __NR_##name; \
-register long __sc4 __asm__ ("$r4") = (long) arg1; \
-register long __sc5 __asm__ ("$r5") = (long) arg2; \
-register long __sc6 __asm__ ("$r6") = (long) arg3; \
-register long __sc7 __asm__ ("$r7") = (long) arg4; \
+register long __sc0 __asm__ ("r3") = __NR_##name; \
+register long __sc4 __asm__ ("r4") = (long) arg1; \
+register long __sc5 __asm__ ("r5") = (long) arg2; \
+register long __sc6 __asm__ ("r6") = (long) arg3; \
+register long __sc7 __asm__ ("r7") = (long) arg4; \
__asm__ __volatile__ ("trapa #0x14" \
: "=z" (__sc0) \
: "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), \
@@ -315,12 +316,12 @@ __syscall_return(type,__sc0); \
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
{ \
-register long __sc3 __asm__ ("$r3") = __NR_##name; \
-register long __sc4 __asm__ ("$r4") = (long) arg1; \
-register long __sc5 __asm__ ("$r5") = (long) arg2; \
-register long __sc6 __asm__ ("$r6") = (long) arg3; \
-register long __sc7 __asm__ ("$r7") = (long) arg4; \
-register long __sc0 __asm__ ("$r0") = (long) arg5; \
+register long __sc3 __asm__ ("r3") = __NR_##name; \
+register long __sc4 __asm__ ("r4") = (long) arg1; \
+register long __sc5 __asm__ ("r5") = (long) arg2; \
+register long __sc6 __asm__ ("r6") = (long) arg3; \
+register long __sc7 __asm__ ("r7") = (long) arg4; \
+register long __sc0 __asm__ ("r0") = (long) arg5; \
__asm__ __volatile__ ("trapa #0x15" \
: "=z" (__sc0) \
: "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \
@@ -345,7 +346,6 @@ __syscall_return(type,__sc0); \
*/
#define __NR__exit __NR_exit
static __inline__ _syscall0(int,pause)
-static __inline__ _syscall1(int,setup,int,magic)
static __inline__ _syscall0(int,sync)
static __inline__ _syscall0(pid_t,setsid)
static __inline__ _syscall3(int,write,int,fd,const char *,buf,off_t,count)
diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h
index dc29a13cd..4a55a8929 100644
--- a/include/asm-sparc/atomic.h
+++ b/include/asm-sparc/atomic.h
@@ -8,21 +8,12 @@
#include <linux/config.h>
-#ifdef CONFIG_SMP
-/* This is a temporary measure. -DaveM */
typedef struct { volatile int counter; } atomic_t;
-#define ATOMIC_INIT(i) { (i << 8) }
-#else
-typedef struct { int counter; } atomic_t;
-#define ATOMIC_INIT(i) { (i) }
-#endif
#ifdef __KERNEL__
-#include <asm/system.h>
-#include <asm/psr.h>
-
#ifndef CONFIG_SMP
+#define ATOMIC_INIT(i) { (i) }
#define atomic_read(v) ((v)->counter)
#define atomic_set(v, i) (((v)->counter) = i)
@@ -41,6 +32,8 @@ typedef struct { int counter; } atomic_t;
* 31 8 7 0
*/
+#define ATOMIC_INIT(i) { (i << 8) }
+
static __inline__ int atomic_read(atomic_t *v)
{
int ret = v->counter;
diff --git a/include/asm-sparc/audioio.h b/include/asm-sparc/audioio.h
index fc5458949..ed50485d2 100644
--- a/include/asm-sparc/audioio.h
+++ b/include/asm-sparc/audioio.h
@@ -431,6 +431,7 @@ extern void sparcaudio_input_done(struct sparcaudio_driver *, int);
extern int sparcaudio_init(void);
extern int amd7930_init(void);
extern int cs4231_init(void);
+extern int dbri_init(void);
#endif
diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h
index 8ab8bdaf0..b10853490 100644
--- a/include/asm-sparc/bitops.h
+++ b/include/asm-sparc/bitops.h
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.60 2000/08/10 23:49:16 davem Exp $
+/* $Id: bitops.h,v 1.61 2000/09/23 02:11:22 davem Exp $
* bitops.h: Bit string operations on the Sparc.
*
* Copyright 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -156,6 +156,9 @@ extern __inline__ void change_bit(unsigned long nr, volatile void *addr)
#endif /* __KERNEL__ */
+#define smp_mb__before_clear_bit() do { } while(0)
+#define smp_mb__after_clear_bit() do { } while(0)
+
/* The following routine need not be atomic. */
extern __inline__ int test_bit(int nr, __const__ void *addr)
{
diff --git a/include/asm-sparc/fcntl.h b/include/asm-sparc/fcntl.h
index 344765930..d481e7b27 100644
--- a/include/asm-sparc/fcntl.h
+++ b/include/asm-sparc/fcntl.h
@@ -50,6 +50,9 @@
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
+/* for leases */
+#define F_INPROGRESS 16
+
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
@@ -57,6 +60,11 @@
blocking */
#define LOCK_UN 8 /* remove lock */
+#define LOCK_MAND 32 /* This is a mandatory flock */
+#define LOCK_READ 64 /* ... Which allows concurrent read operations */
+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
+
struct flock {
short l_type;
short l_whence;
@@ -75,4 +83,5 @@ struct flock64 {
short __unused;
};
+#define F_LINUX_SPECIFIC_BASE 1024
#endif
diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h
index 0c54061f9..5a8422926 100644
--- a/include/asm-sparc/floppy.h
+++ b/include/asm-sparc/floppy.h
@@ -21,7 +21,7 @@
#undef request_region
#define release_region(X, Y) do { } while(0)
#define check_region(X, Y) (0)
-#define request_region(X, Y, Z) do { } while(0)
+#define request_region(X, Y, Z) (1)
/* References:
* 1) Netbsd Sun floppy driver.
diff --git a/include/asm-sparc/hardirq.h b/include/asm-sparc/hardirq.h
index cfee071dc..00205d6ef 100644
--- a/include/asm-sparc/hardirq.h
+++ b/include/asm-sparc/hardirq.h
@@ -1,7 +1,7 @@
/* hardirq.h: 32-bit Sparc hard IRQ support.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
- * Copyright (C) 1998-99 Anton Blanchard (anton@progsoc.uts.edu.au)
+ * Copyright (C) 1998-2000 Anton Blanchard (anton@linuxcare.com)
*/
#ifndef __SPARC_HARDIRQ_H
@@ -9,77 +9,83 @@
#include <linux/config.h>
#include <linux/threads.h>
+#include <linux/brlock.h>
+#include <linux/spinlock.h>
/* entry.S is sensitive to the offsets of these fields */
typedef struct {
unsigned int __softirq_active;
unsigned int __softirq_mask;
+#ifndef CONFIG_SMP
unsigned int __local_irq_count;
+#else
+ unsigned int __unused_on_SMP; /* DaveM says use brlock for SMP irq. KAO */
+#endif
unsigned int __local_bh_count;
unsigned int __syscall_count;
} ____cacheline_aligned irq_cpustat_t;
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
+/* Note that local_irq_count() is replaced by sparc64 specific version for SMP */
+
+#ifndef CONFIG_SMP
+#define irq_enter(cpu, irq) ((void)(irq), local_irq_count(cpu)++)
+#define irq_exit(cpu, irq) ((void)(irq), local_irq_count(cpu)--)
+#else
+#undef local_irq_count
+#define local_irq_count(cpu) (__brlock_array[cpu][BR_GLOBALIRQ_LOCK])
+#define irq_enter(cpu, irq) br_read_lock(BR_GLOBALIRQ_LOCK)
+#define irq_exit(cpu, irq) br_read_unlock(BR_GLOBALIRQ_LOCK)
+#endif
/*
* Are we in an interrupt context? Either doing bottom half
* or hardware interrupt processing?
*/
-#define in_interrupt() ({ int __cpu = smp_processor_id(); \
- (local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
+#define in_interrupt() ((local_irq_count(smp_processor_id()) + \
+ local_bh_count(smp_processor_id())) != 0)
-#define in_irq() ({ int __cpu = smp_processor_id(); \
- (local_irq_count(__cpu) != 0); })
+/* This tests only the local processors hw IRQ context disposition. */
+#define in_irq() (local_irq_count(smp_processor_id()) != 0)
#ifndef CONFIG_SMP
-#define hardirq_trylock(cpu) (local_irq_count(cpu) == 0)
-#define hardirq_endlock(cpu) do { (void)(cpu); } while (0)
-
-#define hardirq_enter(cpu) (++local_irq_count(cpu))
-#define hardirq_exit(cpu) (--local_irq_count(cpu))
+#define hardirq_trylock(cpu) ((void)(cpu), local_irq_count(smp_processor_id()) == 0)
+#define hardirq_endlock(cpu) do { (void)(cpu); } while(0)
#define synchronize_irq() barrier()
-#else
+#else /* (CONFIG_SMP) */
-#include <asm/atomic.h>
-#include <linux/spinlock.h>
-#include <asm/system.h>
-#include <asm/smp.h>
+static __inline__ int irqs_running(void)
+{
+ int i;
+
+ for (i = 0; i < smp_num_cpus; i++)
+ if (local_irq_count(cpu_logical_map(i)))
+ return 1;
+ return 0;
+}
extern unsigned char global_irq_holder;
-extern spinlock_t global_irq_lock;
-extern atomic_t global_irq_count;
static inline void release_irqlock(int cpu)
{
- /* if we didn't own the irq lock, just ignore.. */
- if (global_irq_holder == (unsigned char) cpu) {
+ /* if we didn't own the irq lock, just ignore... */
+ if(global_irq_holder == (unsigned char) cpu) {
global_irq_holder = NO_PROC_ID;
- spin_unlock(&global_irq_lock);
+ br_write_unlock(BR_GLOBALIRQ_LOCK);
}
}
-static inline void hardirq_enter(int cpu)
-{
- ++local_irq_count(cpu);
- atomic_inc(&global_irq_count);
-}
-
-static inline void hardirq_exit(int cpu)
-{
- atomic_dec(&global_irq_count);
- --local_irq_count(cpu);
-}
-
static inline int hardirq_trylock(int cpu)
{
- return (! atomic_read(&global_irq_count) &&
- ! spin_is_locked (&global_irq_lock));
+ spinlock_t *lock = &__br_write_locks[BR_GLOBALIRQ_LOCK].lock;
+
+ return (!local_irq_count(cpu) && !spin_is_locked(lock));
}
-#define hardirq_endlock(cpu) do { } while (0)
+#define hardirq_endlock(cpu) do { (void)(cpu); } while (0)
extern void synchronize_irq(void);
diff --git a/include/asm-sparc/io.h b/include/asm-sparc/io.h
index a32ce08fe..7c9bfa8e9 100644
--- a/include/asm-sparc/io.h
+++ b/include/asm-sparc/io.h
@@ -1,5 +1,5 @@
/*
- * $Id: io.h,v 1.27 2000/04/13 04:45:59 davem Exp $
+ * $Id: io.h,v 1.28 2000/09/17 05:12:00 davem Exp $
*/
#ifndef __SPARC_IO_H
#define __SPARC_IO_H
@@ -164,6 +164,8 @@ static inline void *sbus_memset_io(void *__dst, int c, __kernel_size_t n)
return (void *) dst;
}
+#ifdef __KERNEL__
+
/*
* Bus number may be embedded in the higher bits of the physical address.
* This is why we have no bus number argument to ioremap().
@@ -200,4 +202,6 @@ extern void sbus_iounmap(unsigned long vaddr, unsigned long size);
#define dma_cache_wback(_start,_size) do { } while (0)
#define dma_cache_wback_inv(_start,_size) do { } while (0)
+#endif
+
#endif /* !(__SPARC_IO_H) */
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h
index a58a80810..6008023a5 100644
--- a/include/asm-sparc/irq.h
+++ b/include/asm-sparc/irq.h
@@ -1,4 +1,4 @@
-/* $Id: irq.h,v 1.31 2000/08/05 10:48:41 davem Exp $
+/* $Id: irq.h,v 1.32 2000/08/26 02:42:28 anton Exp $
* irq.h: IRQ registers on the Sparc.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -21,18 +21,6 @@ BTFIXUPDEF_CALL(char *, __irq_itoa, unsigned int)
#define NR_IRQS 15
-/* IRQ handler dispatch entry and exit. */
-#ifdef CONFIG_SMP
-#define irq_enter(cpu, irq) \
-do { hardirq_enter(cpu); \
- spin_unlock_wait(&global_irq_lock); \
- } while(0)
-#define irq_exit(cpu, irq) hardirq_exit(cpu)
-#else
-#define irq_enter(cpu, irq) (++local_irq_count(cpu))
-#define irq_exit(cpu, irq) (--local_irq_count(cpu))
-#endif
-
/* Dave Redman (djhr@tadpole.co.uk)
* changed these to function pointers.. it saves cycles and will allow
* the irq dependencies to be split into different files at a later date
diff --git a/include/asm-sparc/oplib.h b/include/asm-sparc/oplib.h
index 396f9ef07..4e2e60157 100644
--- a/include/asm-sparc/oplib.h
+++ b/include/asm-sparc/oplib.h
@@ -1,4 +1,4 @@
-/* $Id: oplib.h,v 1.20 1998/09/17 11:05:25 jj Exp $
+/* $Id: oplib.h,v 1.21 2000/08/26 02:38:04 anton Exp $
* oplib.h: Describes the interface and available routines in the
* Linux Prom library.
*
@@ -9,6 +9,7 @@
#define __SPARC_OPLIB_H
#include <asm/openprom.h>
+#include <linux/spinlock.h>
/* The master romvec pointer... */
extern struct linux_romvec *romvec;
@@ -311,6 +312,7 @@ extern void prom_apply_obio_ranges(struct linux_prom_registers *obioregs, int nr
/* Apply ranges of any prom node (and optionally parent node as well) to registers. */
extern void prom_apply_generic_ranges(int node, int parent,
struct linux_prom_registers *sbusregs, int nregs);
-
+
+extern spinlock_t prom_lock;
#endif /* !(__SPARC_OPLIB_H) */
diff --git a/include/asm-sparc/resource.h b/include/asm-sparc/resource.h
index 5b654cdf9..24cca3ba1 100644
--- a/include/asm-sparc/resource.h
+++ b/include/asm-sparc/resource.h
@@ -21,8 +21,9 @@
#define RLIMIT_NPROC 7 /* max number of processes */
#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
#define RLIMIT_AS 9 /* address space limit */
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
-#define RLIM_NLIMITS 10
+#define RLIM_NLIMITS 11
/*
* SuS says limits have to be unsigned.
@@ -42,6 +43,7 @@
{RLIM_INFINITY, RLIM_INFINITY}, \
{INR_OPEN, INR_OPEN}, {0, 0}, \
{RLIM_INFINITY, RLIM_INFINITY}, \
+ {RLIM_INFINITY, RLIM_INFINITY}, \
{RLIM_INFINITY, RLIM_INFINITY} \
}
diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h
index f6504165d..5f7040345 100644
--- a/include/asm-sparc/smp.h
+++ b/include/asm-sparc/smp.h
@@ -93,12 +93,6 @@ extern __inline__ void xc5(smpfunc_t func, unsigned long arg1, unsigned long arg
unsigned long arg3, unsigned long arg4, unsigned long arg5)
{ smp_cross_call(func, arg1, arg2, arg3, arg4, arg5); }
-extern __inline__ int smp_call_function(void (*func)(void *info), void *info, int nonatomic, int wait)
-{
- xc1((smpfunc_t)func, (unsigned long)info);
- return 0;
-}
-
extern __volatile__ int __cpu_number_map[NR_CPUS];
extern __volatile__ int __cpu_logical_map[NR_CPUS];
extern unsigned long smp_proc_in_lock[NR_CPUS];
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index 0a101cacd..28b07675f 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -1,4 +1,4 @@
-/* $Id: system.h,v 1.83 2000/08/04 05:35:55 davem Exp $ */
+/* $Id: system.h,v 1.84 2000/09/23 02:11:22 davem Exp $ */
#include <linux/config.h>
#ifndef __SPARC_SYSTEM_H
@@ -280,6 +280,9 @@ extern void __global_restore_flags(unsigned long flags);
#define wmb() mb()
#define set_mb(__var, __value) do { __var = __value; mb(); } while(0)
#define set_wmb(__var, __value) set_mb(__var, __value)
+#define smp_mb() __asm__ __volatile__("":::"memory");
+#define smp_rmb() __asm__ __volatile__("":::"memory");
+#define smp_wmb() __asm__ __volatile__("":::"memory");
#define nop() __asm__ __volatile__ ("nop");
diff --git a/include/asm-sparc/uaccess.h b/include/asm-sparc/uaccess.h
index c026a21fa..1587f92f9 100644
--- a/include/asm-sparc/uaccess.h
+++ b/include/asm-sparc/uaccess.h
@@ -1,4 +1,4 @@
-/* $Id: uaccess.h,v 1.21 2000/01/08 16:38:23 anton Exp $
+/* $Id: uaccess.h,v 1.22 2000/08/29 07:01:58 davem Exp $
* uaccess.h: User space memore access functions.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -94,27 +94,17 @@ extern void __ret_efault(void);
unsigned long __pu_addr = (unsigned long)(ptr); \
__put_user_check((__typeof__(*(ptr)))(x),__pu_addr,sizeof(*(ptr))); })
-#define put_user_ret(x,ptr,retval) ({ \
-unsigned long __pu_addr = (unsigned long)(ptr); \
-__put_user_check_ret((__typeof__(*(ptr)))(x),__pu_addr,sizeof(*(ptr)),retval); })
-
#define get_user(x,ptr) ({ \
unsigned long __gu_addr = (unsigned long)(ptr); \
__get_user_check((x),__gu_addr,sizeof(*(ptr)),__typeof__(*(ptr))); })
-#define get_user_ret(x,ptr,retval) ({ \
-unsigned long __gu_addr = (unsigned long)(ptr); \
-__get_user_check_ret((x),__gu_addr,sizeof(*(ptr)),__typeof__(*(ptr)),retval); })
-
/*
* The "__xxx" versions do not do address space checking, useful when
* doing multiple accesses to the same area (the user has to do the
* checks by hand with "access_ok()")
*/
#define __put_user(x,ptr) __put_user_nocheck((x),(ptr),sizeof(*(ptr)))
-#define __put_user_ret(x,ptr,retval) __put_user_nocheck_ret((x),(ptr),sizeof(*(ptr)),retval)
#define __get_user(x,ptr) __get_user_nocheck((x),(ptr),sizeof(*(ptr)),__typeof__(*(ptr)))
-#define __get_user_ret(x,ptr,retval) __get_user_nocheck_ret((x),(ptr),sizeof(*(ptr)),__typeof__(*(ptr)),retval)
struct __large_struct { unsigned long buf[100]; };
#define __m(x) ((struct __large_struct *)(x))
@@ -303,20 +293,10 @@ __copy_res = __copy_user(__copy_to, (void *) (from), __copy_size); \
} else __copy_res = __copy_size; \
__copy_res; })
-#define copy_to_user_ret(to,from,n,retval) ({ \
-if (copy_to_user(to,from,n)) \
- return retval; \
-})
-
#define __copy_to_user(to,from,n) \
__copy_user((void *)(to), \
(void *)(from), n)
-#define __copy_to_user_ret(to,from,n,retval) ({ \
-if (__copy_to_user(to,from,n)) \
- return retval; \
-})
-
#define copy_from_user(to,from,n) ({ \
void *__copy_to = (void *) (to); \
void *__copy_from = (void *) (from); \
@@ -327,20 +307,10 @@ __copy_res = __copy_user(__copy_to, __copy_from, __copy_size); \
} else __copy_res = __copy_size; \
__copy_res; })
-#define copy_from_user_ret(to,from,n,retval) ({ \
-if (copy_from_user(to,from,n)) \
- return retval; \
-})
-
#define __copy_from_user(to,from,n) \
__copy_user((void *)(to), \
(void *)(from), n)
-#define __copy_from_user_ret(to,from,n,retval) ({ \
-if (__copy_from_user(to,from,n)) \
- return retval; \
-})
-
extern __inline__ __kernel_size_t __clear_user(void *addr, __kernel_size_t size)
{
__kernel_size_t ret;
@@ -368,11 +338,6 @@ __clear_res = __clear_user(__clear_addr, __clear_size); \
} else __clear_res = __clear_size; \
__clear_res; })
-#define clear_user_ret(addr,size,retval) ({ \
-if (clear_user(addr,size)) \
- return retval; \
-})
-
extern int __strncpy_from_user(unsigned long dest, unsigned long src, int count);
#define strncpy_from_user(dest,src,count) ({ \
diff --git a/include/asm-sparc64/atomic.h b/include/asm-sparc64/atomic.h
index db3cd5831..2461ec29d 100644
--- a/include/asm-sparc64/atomic.h
+++ b/include/asm-sparc64/atomic.h
@@ -8,7 +8,7 @@
#ifndef __ARCH_SPARC64_ATOMIC__
#define __ARCH_SPARC64_ATOMIC__
-typedef struct { int counter; } atomic_t;
+typedef struct { volatile int counter; } atomic_t;
#define ATOMIC_INIT(i) { (i) }
#define atomic_read(v) ((v)->counter)
diff --git a/include/asm-sparc64/bitops.h b/include/asm-sparc64/bitops.h
index e297d6f96..26e3716cc 100644
--- a/include/asm-sparc64/bitops.h
+++ b/include/asm-sparc64/bitops.h
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.30 2000/08/10 23:49:16 davem Exp $
+/* $Id: bitops.h,v 1.31 2000/09/23 02:09:21 davem Exp $
* bitops.h: Bit string operations on the V9.
*
* Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -20,6 +20,9 @@ extern long __test_and_change_bit(unsigned long nr, volatile void *addr);
#define clear_bit(nr,addr) ((void)__test_and_clear_bit(nr,addr))
#define change_bit(nr,addr) ((void)__test_and_change_bit(nr,addr))
+#define smp_mb__before_clear_bit() do { } while(0)
+#define smp_mb__after_clear_bit() do { } while(0)
+
extern __inline__ int test_bit(int nr, __const__ void *addr)
{
return (1UL & (((__const__ long *) addr)[nr >> 6] >> (nr & 63))) != 0UL;
diff --git a/include/asm-sparc64/fcntl.h b/include/asm-sparc64/fcntl.h
index bd087fc21..e485ed45f 100644
--- a/include/asm-sparc64/fcntl.h
+++ b/include/asm-sparc64/fcntl.h
@@ -52,6 +52,9 @@
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
+/* for leases */
+#define F_INPROGRESS 16
+
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
@@ -59,6 +62,11 @@
blocking */
#define LOCK_UN 8 /* remove lock */
+#define LOCK_MAND 32 /* This is a mandatory flock */
+#define LOCK_READ 64 /* ... Which allows concurrent read operations */
+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
+
struct flock {
short l_type;
short l_whence;
@@ -83,4 +91,5 @@ struct flock32 {
#define flock64 flock
#endif
+#define F_LINUX_SPECIFIC_BASE 1024
#endif /* !(_SPARC64_FCNTL_H) */
diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h
index d829b7c53..9e80435f8 100644
--- a/include/asm-sparc64/io.h
+++ b/include/asm-sparc64/io.h
@@ -1,4 +1,4 @@
-/* $Id: io.h,v 1.35 2000/04/13 04:45:59 davem Exp $ */
+/* $Id: io.h,v 1.36 2000/09/17 05:12:00 davem Exp $ */
#ifndef __SPARC64_IO_H
#define __SPARC64_IO_H
@@ -363,6 +363,8 @@ out:
return retval;
}
+#ifdef __KERNEL__
+
/* On sparc64 we have the whole physical IO address space accessible
* using physically addressed loads and stores, so this does nothing.
*/
@@ -389,4 +391,6 @@ out:
#define dma_cache_wback(_start,_size) do { } while (0)
#define dma_cache_wback_inv(_start,_size) do { } while (0)
+#endif
+
#endif /* !(__SPARC64_IO_H) */
diff --git a/include/asm-sparc64/resource.h b/include/asm-sparc64/resource.h
index 1d2b5eff0..658637fbc 100644
--- a/include/asm-sparc64/resource.h
+++ b/include/asm-sparc64/resource.h
@@ -21,8 +21,9 @@
#define RLIMIT_NPROC 7 /* max number of processes */
#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
#define RLIMIT_AS 9 /* address space limit */
+#define RLIMIT_LOCKS 10 /* maximum file locks held */
-#define RLIM_NLIMITS 10
+#define RLIM_NLIMITS 11
/*
* SuS says limits have to be unsigned.
@@ -41,6 +42,7 @@
{RLIM_INFINITY, RLIM_INFINITY}, \
{INR_OPEN, INR_OPEN}, {0, 0}, \
{RLIM_INFINITY, RLIM_INFINITY}, \
+ {RLIM_INFINITY, RLIM_INFINITY}, \
{RLIM_INFINITY, RLIM_INFINITY} \
}
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h
index 0927fe5cc..3898efdd2 100644
--- a/include/asm-sparc64/smp.h
+++ b/include/asm-sparc64/smp.h
@@ -9,6 +9,7 @@
#include <linux/config.h>
#include <linux/threads.h>
#include <asm/asi.h>
+#include <asm/starfire.h>
#ifndef __ASSEMBLY__
/* PROM provided per-processor information we need
@@ -82,11 +83,7 @@ extern __inline__ int cpu_number_map(int cpu)
extern __inline__ int hard_smp_processor_id(void)
{
- extern int this_is_starfire;
-
if(this_is_starfire != 0) {
- extern int starfire_hard_smp_processor_id(void);
-
return starfire_hard_smp_processor_id();
} else {
unsigned long upaconfig;
diff --git a/include/asm-sparc64/starfire.h b/include/asm-sparc64/starfire.h
new file mode 100644
index 000000000..d59bda0c3
--- /dev/null
+++ b/include/asm-sparc64/starfire.h
@@ -0,0 +1,21 @@
+/* $Id: starfire.h,v 1.1 2000/09/21 06:18:53 anton Exp $
+ * starfire.h: Group all starfire specific code together.
+ *
+ * Copyright (C) 2000 Anton Blanchard (anton@linuxcare.com)
+ */
+
+#ifndef _SPARC64_STARFIRE_H
+#define _SPARC64_STARFIRE_H
+
+#ifndef __ASSEMBLY__
+
+extern int this_is_starfire;
+
+extern void check_if_starfire(void);
+extern void starfire_cpu_setup(void);
+extern int starfire_hard_smp_processor_id(void);
+extern void *starfire_hookup(int);
+extern unsigned int starfire_translate(unsigned long imap, unsigned int upaid);
+
+#endif
+#endif
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 803a15a51..3c396eb00 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -1,4 +1,4 @@
-/* $Id: system.h,v 1.61 2000/08/04 05:35:55 davem Exp $ */
+/* $Id: system.h,v 1.62 2000/09/23 02:09:21 davem Exp $ */
#ifndef __SPARC64_SYSTEM_H
#define __SPARC64_SYSTEM_H
@@ -95,18 +95,28 @@ extern void __global_restore_flags(unsigned long flags);
#endif
-#define mb() __asm__ __volatile__ ("stbar" : : : "memory")
-
#define nop() __asm__ __volatile__ ("nop")
#define membar(type) __asm__ __volatile__ ("membar " type : : : "memory");
-#define rmb() membar("#LoadLoad | #LoadStore")
-#define wmb() membar("#StoreLoad | #StoreStore")
+#define mb() \
+ membar("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad");
+#define rmb() membar("#LoadLoad")
+#define wmb() membar("#StoreStore")
#define set_mb(__var, __value) \
do { __var = __value; membar("#StoreLoad | #StoreStore"); } while(0)
#define set_wmb(__var, __value) \
do { __var = __value; membar("#StoreStore"); } while(0)
+#ifdef CONFIG_SMP
+#define smp_mb() mb()
+#define smp_rmb() rmb()
+#define smp_wmb() wmb()
+#else
+#define smp_mb() __asm__ __volatile__("":::"memory");
+#define smp_rmb() __asm__ __volatile__("":::"memory");
+#define smp_wmb() __asm__ __volatile__("":::"memory");
+#endif
+
#define flushi(addr) __asm__ __volatile__ ("flush %0" : : "r" (addr) : "memory")
#define flushw_all() __asm__ __volatile__("flushw")
diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h
index 72c2c6916..bf60670f4 100644
--- a/include/asm-sparc64/uaccess.h
+++ b/include/asm-sparc64/uaccess.h
@@ -1,4 +1,4 @@
-/* $Id: uaccess.h,v 1.32 1999/11/23 08:56:48 davem Exp $ */
+/* $Id: uaccess.h,v 1.33 2000/08/29 07:01:58 davem Exp $ */
#ifndef _ASM_UACCESS_H
#define _ASM_UACCESS_H
@@ -102,22 +102,12 @@ extern void __ret_efault(void);
unsigned long __pu_addr = (unsigned long)(ptr); \
__put_user_nocheck((__typeof__(*(ptr)))(x),__pu_addr,sizeof(*(ptr))); })
-#define put_user_ret(x,ptr,retval) ({ \
-unsigned long __pu_addr = (unsigned long)(ptr); \
-__put_user_nocheck_ret((__typeof__(*(ptr)))(x),__pu_addr,sizeof(*(ptr)),retval); })
-
#define get_user(x,ptr) ({ \
unsigned long __gu_addr = (unsigned long)(ptr); \
__get_user_nocheck((x),__gu_addr,sizeof(*(ptr)),__typeof__(*(ptr))); })
-#define get_user_ret(x,ptr,retval) ({ \
-unsigned long __gu_addr = (unsigned long)(ptr); \
-__get_user_nocheck_ret((x),__gu_addr,sizeof(*(ptr)),__typeof__(*(ptr)),retval); })
-
#define __put_user(x,ptr) put_user(x,ptr)
-#define __put_user_ret(x,ptr,retval) put_user_ret(x,ptr,retval)
#define __get_user(x,ptr) get_user(x,ptr)
-#define __get_user_ret(x,ptr,retval) get_user_ret(x,ptr,retval)
struct __large_struct { unsigned long buf[100]; };
#define __m(x) ((struct __large_struct *)(x))
@@ -288,44 +278,14 @@ extern __kernel_size_t __copy_in_user(void *to, const void *from,
__copy_from_user((void *)(to), \
(void *)(from), (__kernel_size_t)(n))
-#define copy_from_user_ret(to,from,n,retval) ({ \
-if (copy_from_user(to,from,n)) \
- return retval; \
-})
-
-#define __copy_from_user_ret(to,from,n,retval) ({ \
-if (__copy_from_user(to,from,n)) \
- return retval; \
-})
-
#define copy_to_user(to,from,n) \
__copy_to_user((void *)(to), \
(void *) (from), (__kernel_size_t)(n))
-#define copy_to_user_ret(to,from,n,retval) ({ \
-if (copy_to_user(to,from,n)) \
- return retval; \
-})
-
-#define __copy_to_user_ret(to,from,n,retval) ({ \
-if (__copy_to_user(to,from,n)) \
- return retval; \
-})
-
#define copy_in_user(to,from,n) \
__copy_in_user((void *)(to), \
(void *) (from), (__kernel_size_t)(n))
-#define copy_in_user_ret(to,from,n,retval) ({ \
-if (copy_in_user(to,from,n)) \
- return retval; \
-})
-
-#define __copy_in_user_ret(to,from,n,retval) ({ \
-if (__copy_in_user(to,from,n)) \
- return retval; \
-})
-
extern __inline__ __kernel_size_t __clear_user(void *addr, __kernel_size_t size)
{
extern __kernel_size_t __bzero_noasi(void *addr, __kernel_size_t size);
@@ -336,11 +296,6 @@ extern __inline__ __kernel_size_t __clear_user(void *addr, __kernel_size_t size)
#define clear_user(addr,n) \
__clear_user((void *)(addr), (__kernel_size_t)(n))
-#define clear_user_ret(addr,size,retval) ({ \
-if (clear_user(addr,size)) \
- return retval; \
-})
-
extern int __strncpy_from_user(unsigned long dest, unsigned long src, int count);
#define strncpy_from_user(dest,src,count) \
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h
index f4468611e..84d6387d5 100644
--- a/include/linux/ac97_codec.h
+++ b/include/linux/ac97_codec.h
@@ -142,6 +142,7 @@ struct ac97_codec {
char *name;
int id;
int dev_mixer;
+ int type;
/* codec specific init/reset routines, used mainly for 4 or 6 channel support */
int (*codec_init) (struct ac97_codec *codec);
@@ -158,7 +159,9 @@ struct ac97_codec {
int supported_mixers;
int stereo_mixers;
int record_sources;
-
+
+ int bit_resolution;
+
/* OSS mixer interface */
int (*read_mixer) (struct ac97_codec *codec, int oss_channel);
void (*write_mixer)(struct ac97_codec *codec, int oss_channel,
diff --git a/include/linux/adb.h b/include/linux/adb.h
index 639a6535d..e2af8f33c 100644
--- a/include/linux/adb.h
+++ b/include/linux/adb.h
@@ -58,7 +58,6 @@ struct adb_driver {
int (*probe)(void);
int (*init)(void);
int (*send_request)(struct adb_request *req, int sync);
- /*int (*write)(struct adb_request *req);*/
int (*autopoll)(int devs);
void (*poll)(void);
int (*reset_bus)(void);
@@ -83,6 +82,7 @@ int adb_request(struct adb_request *req, void (*done)(struct adb_request *),
int flags, int nbytes, ...);
int adb_register(int default_id,int handler_id,struct adb_ids *ids,
void (*handler)(unsigned char *, int, struct pt_regs *, int));
+int adb_unregister(int index);
void adb_poll(void);
void adb_input(unsigned char *, int, struct pt_regs *, int);
int adb_reset_bus(void);
diff --git a/include/linux/adfs_fs.h b/include/linux/adfs_fs.h
index c881f0fd6..43add21b5 100644
--- a/include/linux/adfs_fs.h
+++ b/include/linux/adfs_fs.h
@@ -46,7 +46,7 @@ struct adfs_discrecord {
* appear to be correct if the sector contains all zeros, so also check that
* the disk size is non-zero!!!
*/
-extern inline int adfs_checkbblk(unsigned char *ptr)
+static inline int adfs_checkbblk(unsigned char *ptr)
{
unsigned int result = 0;
unsigned char *p = ptr + 511;
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index dd88e8a80..3c37d0538 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -340,7 +340,6 @@ void arcnet_rfc1051_init(void);
void arcnet_raw_init(void);
int com90xx_probe(struct net_device *dev);
-void com20020pci_probe_all(void);
#endif /* __KERNEL__ */
diff --git a/include/linux/atalk.h b/include/linux/atalk.h
index 5b1dafc17..5c2c0c355 100644
--- a/include/linux/atalk.h
+++ b/include/linux/atalk.h
@@ -161,7 +161,7 @@ extern void aarp_proto_init(void);
* Give a device find its atif control structure
*/
-extern __inline__ struct atalk_iface *atalk_find_dev(struct net_device *dev)
+static inline struct atalk_iface *atalk_find_dev(struct net_device *dev)
{
return dev->atalk_ptr;
}
diff --git a/include/linux/blk.h b/include/linux/blk.h
index 778617529..66bbdcf60 100644
--- a/include/linux/blk.h
+++ b/include/linux/blk.h
@@ -308,7 +308,7 @@ static void floppy_off(unsigned int nr);
#elif (MAJOR_NR == I2O_MAJOR)
#define DEVICE_NAME "I2O block"
-#define DEVICE_REQUEST do_i2ob_request
+#define DEVICE_REQUEST i2ob_request
#define DEVICE_NR(device) (MINOR(device)>>4)
#elif (MAJOR_NR == COMPAQ_SMART2_MAJOR)
diff --git a/include/linux/brlock.h b/include/linux/brlock.h
index 2fd39cac9..c805304f1 100644
--- a/include/linux/brlock.h
+++ b/include/linux/brlock.h
@@ -114,10 +114,23 @@ static inline void br_read_lock (enum brlock_indices idx)
lock = &__br_write_locks[idx].lock;
again:
(*ctr)++;
- rmb();
+ mb();
if (spin_is_locked(lock)) {
(*ctr)--;
- rmb();
+ wmb(); /*
+ * The release of the ctr must become visible
+ * to the other cpus eventually thus wmb(),
+ * we don't care if spin_is_locked is reordered
+ * before the releasing of the ctr.
+ * However IMHO this wmb() is superflous even in theory.
+ * It would not be superflous only if on the
+ * other CPUs doing a ldl_l instead of an ldl
+ * would make a difference and I don't think this is
+ * the case.
+ * I'd like to clarify this issue further
+ * but for now this is a slow path so adding the
+ * wmb() will keep us on the safe side.
+ */
while (spin_is_locked(lock))
barrier();
goto again;
diff --git a/include/linux/byteorder/swab.h b/include/linux/byteorder/swab.h
index 813df46c3..23f1be7d7 100644
--- a/include/linux/byteorder/swab.h
+++ b/include/linux/byteorder/swab.h
@@ -43,33 +43,33 @@
* provide defaults when no architecture-specific optimization is detected
*/
#ifndef __arch__swab16
-# define __arch__swab16(x) ___swab16(x)
+# define __arch__swab16(x) ({ __u16 __tmp = (x) ; ___swab16(__tmp); })
#endif
#ifndef __arch__swab32
-# define __arch__swab32(x) ___swab32(x)
+# define __arch__swab32(x) ({ __u32 __tmp = (x) ; ___swab32(__tmp); })
#endif
#ifndef __arch__swab64
-# define __arch__swab64(x) ___swab64(x)
+# define __arch__swab64(x) ({ __u64 __tmp = (x) ; ___swab64(__tmp); })
#endif
#ifndef __arch__swab16p
-# define __arch__swab16p(x) __swab16(*(x))
+# define __arch__swab16p(x) __arch__swab16(*(x))
#endif
#ifndef __arch__swab32p
-# define __arch__swab32p(x) __swab32(*(x))
+# define __arch__swab32p(x) __arch__swab32(*(x))
#endif
#ifndef __arch__swab64p
-# define __arch__swab64p(x) __swab64(*(x))
+# define __arch__swab64p(x) __arch__swab64(*(x))
#endif
#ifndef __arch__swab16s
-# define __arch__swab16s(x) do { *(x) = __swab16p((x)); } while (0)
+# define __arch__swab16s(x) do { *(x) = __arch__swab16p((x)); } while (0)
#endif
#ifndef __arch__swab32s
-# define __arch__swab32s(x) do { *(x) = __swab32p((x)); } while (0)
+# define __arch__swab32s(x) do { *(x) = __arch__swab32p((x)); } while (0)
#endif
#ifndef __arch__swab64s
-# define __arch__swab64s(x) do { *(x) = __swab64p((x)); } while (0)
+# define __arch__swab64s(x) do { *(x) = __arch__swab64p((x)); } while (0)
#endif
diff --git a/include/linux/capability.h b/include/linux/capability.h
index a1e9dc3d4..945fabb5e 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -273,6 +273,10 @@ typedef __u32 kernel_cap_t;
#define CAP_MKNOD 27
+/* Allow taking of leases on files */
+
+#define CAP_LEASE 28
+
#ifdef __KERNEL__
/*
* Bounding set
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h
new file mode 100644
index 000000000..989549b24
--- /dev/null
+++ b/include/linux/cciss_ioctl.h
@@ -0,0 +1,186 @@
+#ifndef CCISS_IOCTLH
+#define CCISS_IOCTLH
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#define CCISS_IOC_MAGIC 'B'
+
+
+typedef struct _cciss_pci_info_struct
+{
+ unsigned char bus;
+ unsigned char dev_fn;
+ __u32 board_id;
+} cciss_pci_info_struct;
+
+typedef struct _cciss_coalint_struct
+{
+ __u32 delay;
+ __u32 count;
+} cciss_coalint_struct;
+
+typedef char NodeName_type[16];
+
+typedef __u32 Heartbeat_type;
+
+#define CISS_PARSCSIU2 0x0001
+#define CISS_PARCSCIU3 0x0002
+#define CISS_FIBRE1G 0x0100
+#define CISS_FIBRE2G 0x0200
+typedef __u32 BusTypes_type;
+
+typedef char FirmwareVer_type[4];
+typedef __u32 DriverVer_type;
+
+
+#ifndef CCISS_CMD_H
+// This defines are duplicated in cciss_cmd.h in the driver directory
+
+//general boundary defintions
+#define SENSEINFOBYTES 32//note that this value may vary between host implementations
+
+//Command Status value
+#define CMD_SUCCESS 0x0000
+#define CMD_TARGET_STATUS 0x0001
+#define CMD_DATA_UNDERRUN 0x0002
+#define CMD_DATA_OVERRUN 0x0003
+#define CMD_INVALID 0x0004
+#define CMD_PROTOCOL_ERR 0x0005
+#define CMD_HARDWARE_ERR 0x0006
+#define CMD_CONNECTION_LOST 0x0007
+#define CMD_ABORTED 0x0008
+#define CMD_ABORT_FAILED 0x0009
+#define CMD_UNSOLICITED_ABORT 0x000A
+#define CMD_TIMEOUT 0x000B
+#define CMD_UNABORTABLE 0x000C
+
+//transfer direction
+#define XFER_NONE 0x00
+#define XFER_WRITE 0x01
+#define XFER_READ 0x02
+#define XFER_RSVD 0x03
+
+//task attribute
+#define ATTR_UNTAGGED 0x00
+#define ATTR_SIMPLE 0x04
+#define ATTR_HEADOFQUEUE 0x05
+#define ATTR_ORDERED 0x06
+#define ATTR_ACA 0x07
+
+//cdb type
+#define TYPE_CMD 0x00
+#define TYPE_MSG 0x01
+
+// Type defs used in the following structs
+#define BYTE __u8
+#define WORD __u16
+#define HWORD __u16
+#define DWORD __u32
+
+#define CISS_MAX_LUN 16
+
+#pragma pack(1)
+
+//Command List Structure
+typedef union _SCSI3Addr_struct {
+ struct {
+ BYTE Bus:6;
+ BYTE Mode:2; // b00
+ BYTE Dev;
+ } PeripDev;
+ struct {
+ BYTE DevMSB:6;
+ BYTE Mode:2; // b01
+ BYTE DevLSB;
+ } LogDev;
+ struct {
+ BYTE Targ:6;
+ BYTE Mode:2; // b10
+ BYTE Dev:5;
+ BYTE Bus:3;
+ } LogUnit;
+} SCSI3Addr_struct;
+
+typedef struct _PhysDevAddr_struct {
+ DWORD TargetId:24;
+ DWORD Bus:6;
+ DWORD Mode:2;
+ SCSI3Addr_struct Target[2]; //2 level target device addr
+} PhysDevAddr_struct;
+
+typedef struct _LogDevAddr_struct {
+ DWORD VolId:30;
+ DWORD Mode:2;
+ BYTE reserved[4];
+} LogDevAddr_struct;
+
+typedef union _LUNAddr_struct {
+ BYTE LunAddrBytes[8];
+ SCSI3Addr_struct SCSI3Lun[4];
+ PhysDevAddr_struct PhysDev;
+ LogDevAddr_struct LogDev;
+} LUNAddr_struct;
+
+typedef struct _RequestBlock_struct {
+ BYTE CDBLen;
+ struct {
+ BYTE Type:3;
+ BYTE Attribute:3;
+ BYTE Direction:2;
+ } Type;
+ HWORD Timeout;
+ BYTE CDB[16];
+} RequestBlock_struct;
+
+typedef union _MoreErrInfo_struct{
+ struct {
+ BYTE Reserved[3];
+ BYTE Type;
+ DWORD ErrorInfo;
+ }Common_Info;
+ struct{
+ BYTE Reserved[2];
+ BYTE offense_size;//size of offending entry
+ BYTE offense_num; //byte # of offense 0-base
+ DWORD offense_value;
+ }Invalid_Cmd;
+}MoreErrInfo_struct;
+typedef struct _ErrorInfo_struct {
+ BYTE ScsiStatus;
+ BYTE SenseLen;
+ HWORD CommandStatus;
+ DWORD ResidualCnt;
+ MoreErrInfo_struct MoreErrInfo;
+ BYTE SenseInfo[SENSEINFOBYTES];
+} ErrorInfo_struct;
+
+#pragma pack()
+#endif /* CCISS_CMD_H */
+
+typedef struct _IOCTL_Command_struct {
+ LUNAddr_struct LUN_info;
+ RequestBlock_struct Request;
+ ErrorInfo_struct error_info;
+ WORD buf_size; /* size in bytes of the buf */
+ BYTE *buf;
+} IOCTL_Command_struct;
+
+
+#define CCISS_GETPCIINFO _IOR(CCISS_IOC_MAGIC, 1, cciss_pci_info_struct)
+
+#define CCISS_GETINTINFO _IOR(CCISS_IOC_MAGIC, 2, cciss_coalint_struct)
+#define CCISS_SETINTINFO _IOW(CCISS_IOC_MAGIC, 3, cciss_coalint_struct)
+
+#define CCISS_GETNODENAME _IOR(CCISS_IOC_MAGIC, 4, NodeName_type)
+#define CCISS_SETNODENAME _IOW(CCISS_IOC_MAGIC, 5, NodeName_type)
+
+#define CCISS_GETHEARTBEAT _IOR(CCISS_IOC_MAGIC, 6, Heartbeat_type)
+#define CCISS_GETBUSTYPES _IOR(CCISS_IOC_MAGIC, 7, BusTypes_type)
+#define CCISS_GETFIRMVER _IOR(CCISS_IOC_MAGIC, 8, FirmwareVer_type)
+#define CCISS_GETDRIVVER _IOR(CCISS_IOC_MAGIC, 9, DriverVer_type)
+#define CCISS_REVALIDVOLS _IO(CCISS_IOC_MAGIC, 10)
+#define CCISS_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 11, IOCTL_Command_struct)
+
+
+#endif
diff --git a/include/linux/coda.h b/include/linux/coda.h
index a08558628..d9ab68c35 100644
--- a/include/linux/coda.h
+++ b/include/linux/coda.h
@@ -284,7 +284,7 @@ struct coda_statfs {
*/
#define CODA_ROOT 2
-#define CODA_SYNC 3
+#define CODA_OPEN_BY_FD 3
#define CODA_OPEN 4
#define CODA_CLOSE 5
#define CODA_IOCTL 6
@@ -298,11 +298,9 @@ struct coda_statfs {
#define CODA_RENAME 14
#define CODA_MKDIR 15
#define CODA_RMDIR 16
-#define CODA_READDIR 17
#define CODA_SYMLINK 18
#define CODA_READLINK 19
#define CODA_FSYNC 20
-#define CODA_INACTIVE 21
#define CODA_VGET 22
#define CODA_SIGNAL 23
#define CODA_REPLACE 24 /* DOWNCALL */
@@ -315,12 +313,9 @@ struct coda_statfs {
#define CODA_RESOLVE 32
#define CODA_REINTEGRATE 33
#define CODA_STATFS 34
-#define CODA_MAKE_CINODE 35 /* DOWNCALL */
-#define CODA_NCALLS 36
+#define CODA_NCALLS 35
-#define DOWNCALL(opcode) \
- ((opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID) || \
- opcode == CODA_MAKE_CINODE)
+#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
#define VC_MAXDATASIZE 8192
#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\
@@ -328,7 +323,7 @@ struct coda_statfs {
#define CIOC_KERNEL_VERSION _IOWR('c', 10, sizeof (int))
-#if 0
+#if 0
#define CODA_KERNEL_VERSION 0 /* don't care about kernel version number */
#define CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */
#endif
@@ -363,9 +358,6 @@ struct coda_root_in {
struct coda_in_hdr in;
};
-/* coda_sync: */
-/* Nothing needed for coda_sync */
-
/* coda_open: */
struct coda_open_in {
struct coda_in_hdr ih;
@@ -542,20 +534,6 @@ struct coda_rmdir_out {
struct coda_out_hdr out;
};
-/* coda_readdir: */
-struct coda_readdir_in {
- struct coda_in_hdr ih;
- ViceFid VFid;
- int count;
- int offset;
-};
-
-struct coda_readdir_out {
- struct coda_out_hdr oh;
- int size;
- caddr_t data; /* Place holder for data. */
-};
-
/* coda_symlink: NO_OUT */
struct coda_symlink_in {
struct coda_in_hdr ih;
@@ -592,12 +570,6 @@ struct coda_fsync_out {
struct coda_out_hdr out;
};
-/* coda_inactive: NO_OUT */
-struct coda_inactive_in {
- struct coda_in_hdr ih;
- ViceFid VFid;
-};
-
/* coda_vget: */
struct coda_vget_in {
struct coda_in_hdr ih;
@@ -651,38 +623,24 @@ struct coda_purgefid_out {
ViceFid CodaFid;
};
-struct coda_make_cinode_out {
+/* coda_replace: */
+/* CODA_REPLACE is a venus->kernel call */
+struct coda_replace_out { /* coda_replace is a venus->kernel call */
struct coda_out_hdr oh;
- ViceFid CodaFid;
- struct coda_vattr attr;
- int fd;
+ ViceFid NewFid;
+ ViceFid OldFid;
};
-/* coda_rdwr: */
-struct coda_rdwr_in {
+/* coda_open_by_fd: */
+struct coda_open_by_fd_in {
struct coda_in_hdr ih;
- ViceFid VFid;
- int rwflag;
- int count;
- int offset;
- int ioflag;
- caddr_t data; /* Place holder for data. */
+ ViceFid VFid;
+ int flags;
};
-struct coda_rdwr_out {
+struct coda_open_by_fd_out {
struct coda_out_hdr oh;
- int rwflag;
- int count;
- caddr_t data; /* Place holder for data. */
-};
-
-
-/* coda_replace: */
-/* CODA_REPLACE is a venus->kernel call */
-struct coda_replace_out { /* coda_replace is a venus->kernel call */
- struct coda_out_hdr oh;
- ViceFid NewFid;
- ViceFid OldFid;
+ int fd;
};
/* coda_open_by_path: */
@@ -729,13 +687,11 @@ union inputArgs {
struct coda_rename_in coda_rename;
struct coda_mkdir_in coda_mkdir;
struct coda_rmdir_in coda_rmdir;
- struct coda_readdir_in coda_readdir;
struct coda_symlink_in coda_symlink;
struct coda_readlink_in coda_readlink;
struct coda_fsync_in coda_fsync;
- struct coda_inactive_in coda_inactive;
struct coda_vget_in coda_vget;
- struct coda_rdwr_in coda_rdwr;
+ struct coda_open_by_fd_in coda_open_by_fd;
struct coda_open_by_path_in coda_open_by_path;
struct coda_statfs_in coda_statfs;
};
@@ -749,7 +705,6 @@ union outputArgs {
struct coda_lookup_out coda_lookup;
struct coda_create_out coda_create;
struct coda_mkdir_out coda_mkdir;
- struct coda_readdir_out coda_readdir;
struct coda_readlink_out coda_readlink;
struct coda_vget_out coda_vget;
struct coda_purgeuser_out coda_purgeuser;
@@ -757,9 +712,8 @@ union outputArgs {
struct coda_zapdir_out coda_zapdir;
struct coda_zapvnode_out coda_zapvnode;
struct coda_purgefid_out coda_purgefid;
- struct coda_rdwr_out coda_rdwr;
struct coda_replace_out coda_replace;
- struct coda_make_cinode_out coda_make_cinode;
+ struct coda_open_by_fd_out coda_open_by_fd;
struct coda_open_by_path_out coda_open_by_path;
struct coda_statfs_out coda_statfs;
};
@@ -805,5 +759,15 @@ struct PioctlData {
#define IS_CTL_FID(fidp) ((fidp)->Volume == CTL_VOL &&\
(fidp)->Vnode == CTL_VNO &&\
(fidp)->Unique == CTL_UNI)
+
+/* Data passed to mount */
+
+#define CODA_MOUNT_VERSION 1
+
+struct coda_mount_data {
+ int version;
+ int fd; /* Opened device */
+};
+
#endif
diff --git a/include/linux/coda_cache.h b/include/linux/coda_cache.h
index fe3b2f40c..95b593d14 100644
--- a/include/linux/coda_cache.h
+++ b/include/linux/coda_cache.h
@@ -10,22 +10,10 @@
#ifndef _CFSNC_HEADER_
#define _CFSNC_HEADER_
-/*
- * Structure for an element in the Coda Credential Cache.
- */
-
-struct coda_cache {
- struct list_head cc_cclist; /* list of all cache entries */
- struct list_head cc_cnlist; /* list of cache entries/cnode */
- int cc_mask;
- struct coda_cred cc_cred;
-};
-
/* credential cache */
void coda_cache_enter(struct inode *inode, int mask);
void coda_cache_clear_inode(struct inode *);
-void coda_cache_clear_all(struct super_block *sb);
-void coda_cache_clear_cred(struct super_block *sb, struct coda_cred *cred);
+void coda_cache_clear_all(struct super_block *sb, struct coda_cred *cred);
int coda_cache_check(struct inode *inode, int mask);
/* for downcalls and attributes and lookups */
diff --git a/include/linux/coda_fs_i.h b/include/linux/coda_fs_i.h
index ac14c8e7f..4a776e87f 100644
--- a/include/linux/coda_fs_i.h
+++ b/include/linux/coda_fs_i.h
@@ -20,9 +20,12 @@
struct coda_inode_info {
struct ViceFid c_fid; /* Coda identifier */
u_short c_flags; /* flags (see below) */
- struct list_head c_cnhead; /* head of cache entries */
struct list_head c_volrootlist; /* list of volroot cnoddes */
- struct inode *c_vnode; /* inode associated with cnode */
+ struct list_head c_cilist; /* list of all coda inodes */
+ struct inode *c_vnode; /* inode associated with cnode */
+ unsigned int c_contcount; /* refcount for container inode */
+ struct coda_cred c_cached_cred; /* credentials of cached perms */
+ unsigned int c_cached_perm; /* cached access permissions */
int c_magic; /* to verify the data structure */
};
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index 0b4057efc..3374036ce 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -40,6 +40,8 @@ int coda_release(struct inode *i, struct file *f);
int coda_permission(struct inode *inode, int mask);
int coda_revalidate_inode(struct dentry *);
int coda_notify_change(struct dentry *, struct iattr *);
+int coda_pioctl(struct inode * inode, struct file * filp,
+ unsigned int cmd, unsigned long arg);
/* global variables */
extern int coda_debug;
@@ -103,20 +105,20 @@ void coda_sysctl_clean(void);
#define CODA_ALLOC(ptr, cast, size) \
do { \
- if (size < 3000) { \
+ if (size < PAGE_SIZE) { \
ptr = (cast)kmalloc((unsigned long) size, GFP_KERNEL); \
- CDEBUG(D_MALLOC, "kmalloced: %lx at %p.\n", (long)size, ptr);\
- } else { \
+ CDEBUG(D_MALLOC, "kmalloced: %lx at %p.\n", (long)size, ptr); \
+ } else { \
ptr = (cast)vmalloc((unsigned long) size); \
- CDEBUG(D_MALLOC, "vmalloced: %lx at %p .\n", (long)size, ptr);}\
+ CDEBUG(D_MALLOC, "vmalloced: %lx at %p .\n", (long)size, ptr);} \
if (ptr == 0) { \
- printk("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \
+ printk("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \
} \
- memset( ptr, 0, size ); \
+ else memset( ptr, 0, size ); \
} while (0)
-#define CODA_FREE(ptr,size) do {if (size < 3000) { kfree((ptr)); CDEBUG(D_MALLOC, "kfreed: %lx at %p.\n", (long) size, ptr); } else { vfree((ptr)); CDEBUG(D_MALLOC, "vfreed: %lx at %p.\n", (long) size, ptr);} } while (0)
+#define CODA_FREE(ptr,size) do {if (size < PAGE_SIZE) { kfree((ptr)); CDEBUG(D_MALLOC, "kfreed: %lx at %p.\n", (long) size, ptr); } else { vfree((ptr)); CDEBUG(D_MALLOC, "vfreed: %lx at %p.\n", (long) size, ptr);} } while (0)
/* inode to cnode access functions */
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index 73757bb53..db03f6af8 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -4,19 +4,13 @@
#define CODA_PSDEV_MAJOR 67
#define MAX_CODADEVS 5 /* how many do we allow */
-extern struct venus_comm coda_upc_comm;
-extern struct coda_sb_info coda_super_info;
#define CODA_SUPER_MAGIC 0x73757245
struct coda_sb_info
{
- struct inode * sbi_psdev; /* /dev/cfs? Venus/kernel device */
- int sbi_refct;
struct venus_comm * sbi_vcomm;
- struct inode * sbi_root;
struct super_block *sbi_sb;
- struct list_head sbi_cchead;
- struct list_head sbi_volroothead;
+ struct list_head sbi_cihead;
};
/* communication pending/processing queues */
@@ -26,6 +20,7 @@ struct venus_comm {
struct list_head vc_pending;
struct list_head vc_processing;
int vc_inuse;
+ struct super_block *vc_sb;
};
@@ -35,11 +30,6 @@ static inline struct coda_sb_info *coda_sbp(struct super_block *sb)
}
-
-extern void coda_psdev_detach(int unit);
-extern int init_coda_psdev(void);
-
-
/* upcalls */
int venus_rootfid(struct super_block *sb, ViceFid *fidp);
int venus_getattr(struct super_block *sb, struct ViceFid *fid,
@@ -112,6 +102,7 @@ struct coda_upcallstats {
} ;
extern struct coda_upcallstats coda_callstats;
+extern struct venus_comm coda_comms[];
static inline void clstats(int opcode)
{
diff --git a/include/linux/cuda.h b/include/linux/cuda.h
index 049448cc9..75549da3f 100644
--- a/include/linux/cuda.h
+++ b/include/linux/cuda.h
@@ -28,7 +28,8 @@
#ifdef __KERNEL__
-void find_via_cuda(void);
+extern int find_via_cuda(void);
+extern int via_cuda_start(void);
extern int cuda_request(struct adb_request *req,
void (*done)(struct adb_request *), int nbytes, ...);
extern void cuda_poll(void);
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 4c3f211cc..695d4bb67 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -163,11 +163,11 @@ extern int d_invalidate(struct dentry *);
#define shrink_dcache() prune_dcache(0)
struct zone_struct;
/* dcache memory management */
-extern int shrink_dcache_memory(int, unsigned int);
+extern void shrink_dcache_memory(int, unsigned int);
extern void prune_dcache(int);
/* icache memory management (defined in linux/fs/inode.c) */
-extern int shrink_icache_memory(int, int);
+extern void shrink_icache_memory(int, int);
extern void prune_icache(int);
/* only used at mount-time */
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h
index d9dfbb440..38164e6b2 100644
--- a/include/linux/devpts_fs.h
+++ b/include/linux/devpts_fs.h
@@ -46,14 +46,14 @@ extern unsigned int unix98_max_ptys;
#endif
#ifndef BUILDING_DEVPTS
-extern inline void
+static inline void
devpts_pty_new(int line, kdev_t device)
{
if ( devpts_upcall_new )
return devpts_upcall_new(line,device);
}
-extern inline void
+static inline void
devpts_pty_kill(int line)
{
if ( devpts_upcall_kill )
@@ -63,10 +63,10 @@ devpts_pty_kill(int line)
#else /* No /dev/pts filesystem at all */
-extern inline void
+static inline void
devpts_pty_new(int line, kdev_t device) { }
-extern inline void
+static inline void
devpts_pty_kill(int line) { }
#endif
diff --git a/include/linux/dnotify.h b/include/linux/dnotify.h
new file mode 100644
index 000000000..5e231462b
--- /dev/null
+++ b/include/linux/dnotify.h
@@ -0,0 +1,25 @@
+/*
+ * Directory notification for Linux
+ *
+ * Copyright 2000 (C) Stephen Rothwell
+ */
+
+struct dnotify_struct {
+ struct dnotify_struct * dn_next;
+ int dn_magic;
+ unsigned long dn_mask; /* Events to be notified
+ see linux/fcntl.h */
+ int dn_fd;
+ struct file * dn_filp;
+};
+
+#define DNOTIFY_MAGIC 0x444E4F54
+
+extern void __inode_dir_notify(struct inode *, unsigned long);
+extern int fcntl_dirnotify(int, struct file *, unsigned long);
+
+static inline void inode_dir_notify(struct inode *inode, unsigned long event)
+{
+ if ((inode)->i_dnotify_mask & (event))
+ __inode_dir_notify(inode, event);
+}
diff --git a/include/linux/elf.h b/include/linux/elf.h
index f22e7387e..45e9f1007 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -72,6 +72,8 @@ typedef __u64 Elf64_Word;
#define EM_IA_64 50 /* HP/Intel IA-64 */
+#define EM_X8664 62 /* AMD x86-64 */
+
/*
* This is an interim value that we will use until the committee comes
* up with a final number.
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h
index 10d7bbb9d..69b35b7f7 100644
--- a/include/linux/ext2_fs_sb.h
+++ b/include/linux/ext2_fs_sb.h
@@ -16,8 +16,6 @@
#ifndef _LINUX_EXT2_FS_SB
#define _LINUX_EXT2_FS_SB
-#include <linux/ext2_fs.h>
-
/*
* The following is not needed anymore since the descriptors buffer
* heads are now dynamically allocated
diff --git a/include/linux/fat_cvf.h b/include/linux/fat_cvf.h
index 6349e45cf..bfaf4b057 100644
--- a/include/linux/fat_cvf.h
+++ b/include/linux/fat_cvf.h
@@ -14,8 +14,7 @@ struct cvf_format
struct buffer_head* (*cvf_getblk) (struct super_block*sb,int block);
void (*cvf_brelse) (struct super_block *sb,struct buffer_head *bh);
void (*cvf_mark_buffer_dirty) (struct super_block *sb,
- struct buffer_head *bh,
- int dirty_val);
+ struct buffer_head *bh);
void (*cvf_set_uptodate) (struct super_block *sb,
struct buffer_head *bh,
int val);
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h
index 9de3512e8..bdcf78b74 100644
--- a/include/linux/fcntl.h
+++ b/include/linux/fcntl.h
@@ -3,4 +3,24 @@
#include <asm/fcntl.h>
+#define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0)
+#define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1)
+
+/*
+ * Request nofications on a directory.
+ * See below for events that may be notified.
+ */
+#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
+
+/*
+ * Types of directory notifications that may be requested.
+ */
+#define DN_ACCESS 0x00000001 /* File accessed */
+#define DN_MODIFY 0x00000002 /* File modified */
+#define DN_CREATE 0x00000004 /* File created */
+#define DN_DELETE 0x00000008 /* File removed */
+#define DN_RENAME 0x00000010 /* File renamed */
+#define DN_ATTRIB 0x00000020 /* File changed attibutes */
+#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
+
#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3ce2c58bd..eb2241226 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -54,6 +54,7 @@ struct files_stat_struct {
};
extern struct files_stat_struct files_stat;
extern int max_super_blocks, nr_super_blocks;
+extern int leases_enable, dir_notify_enable, lease_break_time;
#define NR_FILE 8192 /* this can well be larger on a larger system */
#define NR_RESERVED_FILES 10 /* reserved for root */
@@ -93,7 +94,7 @@ extern int max_super_blocks, nr_super_blocks;
* as nfs_rename() will be cleaned up
*/
/*
- * These are the fs-independent mount-flags: up to 16 flags are supported
+ * These are the fs-independent mount-flags: up to 32 flags are supported
*/
#define MS_RDONLY 1 /* Mount read-only */
#define MS_NOSUID 2 /* Ignore suid and sgid bits */
@@ -104,6 +105,7 @@ extern int max_super_blocks, nr_super_blocks;
#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */
#define MS_NOATIME 1024 /* Do not update access times. */
#define MS_NODIRATIME 2048 /* Do not update directory access times */
+#define MS_BIND 4096
/*
* Flags that can be altered by MS_REMOUNT
@@ -361,7 +363,8 @@ struct address_space {
unsigned long nrpages; /* number of pages */
struct address_space_operations *a_ops; /* methods */
void *host; /* owner: inode, block_device */
- struct vm_area_struct *i_mmap; /* list of mappings */
+ struct vm_area_struct *i_mmap; /* list of private mappings */
+ struct vm_area_struct *i_mmap_shared; /* list of shared mappings */
spinlock_t i_shared_lock; /* and spinlock protecting it */
};
@@ -408,6 +411,9 @@ struct inode {
struct pipe_inode_info *i_pipe;
struct block_device *i_bdev;
+ unsigned long i_dnotify_mask; /* Directory notify events */
+ struct dnotify_struct *i_dnotify; /* for directory notifications */
+
unsigned long i_state;
unsigned int i_flags;
@@ -497,6 +503,7 @@ extern int init_private_file(struct file *, struct dentry *, int);
#define FL_BROKEN 4 /* broken flock() emulation */
#define FL_ACCESS 8 /* for processes suspended by mandatory locking */
#define FL_LOCKD 16 /* lock held by rpc.lockd */
+#define FL_LEASE 32 /* lease held on this file */
/*
* The POSIX file lock owner is determined by
@@ -511,6 +518,7 @@ struct file_lock {
struct file_lock *fl_next; /* singly linked list for this inode */
struct list_head fl_link; /* doubly linked list of all locks */
struct list_head fl_block; /* circular list of blocked processes */
+ struct list_head fl_list; /* block list member */
fl_owner_t fl_owner;
unsigned int fl_pid;
wait_queue_head_t fl_wait;
@@ -524,6 +532,8 @@ struct file_lock {
void (*fl_insert)(struct file_lock *); /* lock insertion callback */
void (*fl_remove)(struct file_lock *); /* lock removal callback */
+ struct fasync_struct * fl_fasync; /* for lease break notifications */
+
union {
struct nfs_lock_info nfs_fl;
} fl_u;
@@ -537,6 +547,7 @@ struct file_lock {
#endif
extern struct list_head file_lock_list;
+extern struct semaphore file_lock_sem;
#include <linux/fcntl.h>
@@ -547,12 +558,18 @@ extern int fcntl_getlk64(unsigned int, struct flock64 *);
extern int fcntl_setlk64(unsigned int, unsigned int, struct flock64 *);
/* fs/locks.c */
+extern void locks_init_lock(struct file_lock *);
+extern void locks_copy_lock(struct file_lock *, struct file_lock *);
extern void locks_remove_posix(struct file *, fl_owner_t);
extern void locks_remove_flock(struct file *);
extern struct file_lock *posix_test_lock(struct file *, struct file_lock *);
extern int posix_lock_file(struct file *, struct file_lock *, unsigned int);
extern void posix_block_lock(struct file_lock *, struct file_lock *);
extern void posix_unblock_lock(struct file_lock *);
+extern int __get_lease(struct inode *inode, unsigned int flags);
+extern time_t lease_get_mtime(struct inode *);
+extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
+extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
struct fasync_struct {
int magic;
@@ -885,6 +902,12 @@ static inline int locks_verify_truncate(struct inode *inode,
return 0;
}
+extern inline int get_lease(struct inode *inode, unsigned int mode)
+{
+ if (inode->i_flock && (inode->i_flock->fl_flags & FL_LEASE))
+ return __get_lease(inode, mode);
+ return 0;
+}
/* fs/open.c */
@@ -984,8 +1007,8 @@ static inline void mark_buffer_protected(struct buffer_head * bh)
__mark_buffer_protected(bh);
}
-extern void FASTCALL(__mark_buffer_dirty(struct buffer_head *bh, int flag));
-extern void FASTCALL(mark_buffer_dirty(struct buffer_head *bh, int flag));
+extern void FASTCALL(__mark_buffer_dirty(struct buffer_head *bh));
+extern void FASTCALL(mark_buffer_dirty(struct buffer_head *bh));
#define atomic_set_buffer_dirty(bh) test_and_set_bit(BH_Dirty, &(bh)->b_state)
@@ -1049,9 +1072,20 @@ extern ino_t find_inode_number(struct dentry *, struct qstr *);
* This should be a per-architecture thing, to allow different
* error and pointer decisions.
*/
-#define ERR_PTR(err) ((void *)((long)(err)))
-#define PTR_ERR(ptr) ((long)(ptr))
-#define IS_ERR(ptr) ((unsigned long)(ptr) > (unsigned long)(-1000))
+static inline void *ERR_PTR(long error)
+{
+ return (void *) error;
+}
+
+static inline long PTR_ERR(const void *ptr)
+{
+ return (long) ptr;
+}
+
+static inline long IS_ERR(const void *ptr)
+{
+ return (unsigned long)ptr > (unsigned long)-1000L;
+}
/*
* The bitmask for a lookup event:
@@ -1161,6 +1195,7 @@ extern int block_sync_page(struct page *);
int generic_block_bmap(struct address_space *, long, get_block_t *);
int generic_commit_write(struct file *, struct page *, unsigned, unsigned);
+int block_truncate_page(struct address_space *, loff_t, get_block_t *);
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *);
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 972dd0bfb..457521681 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -29,6 +29,7 @@
* Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
*/
+#include <linux/sched.h>
#include <asm/io.h>
struct gameport;
diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h
index 10f3f71ee..2a55e6018 100644
--- a/include/linux/hdlcdrv.h
+++ b/include/linux/hdlcdrv.h
@@ -132,7 +132,7 @@ struct hdlcdrv_bitbuffer {
unsigned char buffer[HDLCDRV_BITBUFFER];
};
-extern inline void hdlcdrv_add_bitbuffer(struct hdlcdrv_bitbuffer *buf,
+static inline void hdlcdrv_add_bitbuffer(struct hdlcdrv_bitbuffer *buf,
unsigned int bit)
{
unsigned char new;
@@ -147,7 +147,7 @@ extern inline void hdlcdrv_add_bitbuffer(struct hdlcdrv_bitbuffer *buf,
}
}
-extern inline void hdlcdrv_add_bitbuffer_word(struct hdlcdrv_bitbuffer *buf,
+static inline void hdlcdrv_add_bitbuffer_word(struct hdlcdrv_bitbuffer *buf,
unsigned int bits)
{
buf->buffer[buf->wr] = bits & 0xff;
@@ -250,7 +250,7 @@ struct hdlcdrv_state {
/* -------------------------------------------------------------------- */
-extern inline int hdlcdrv_hbuf_full(struct hdlcdrv_hdlcbuffer *hb)
+static inline int hdlcdrv_hbuf_full(struct hdlcdrv_hdlcbuffer *hb)
{
unsigned long flags;
int ret;
@@ -263,7 +263,7 @@ extern inline int hdlcdrv_hbuf_full(struct hdlcdrv_hdlcbuffer *hb)
/* -------------------------------------------------------------------- */
-extern inline int hdlcdrv_hbuf_empty(struct hdlcdrv_hdlcbuffer *hb)
+static inline int hdlcdrv_hbuf_empty(struct hdlcdrv_hdlcbuffer *hb)
{
unsigned long flags;
int ret;
@@ -276,7 +276,7 @@ extern inline int hdlcdrv_hbuf_empty(struct hdlcdrv_hdlcbuffer *hb)
/* -------------------------------------------------------------------- */
-extern inline unsigned short hdlcdrv_hbuf_get(struct hdlcdrv_hdlcbuffer *hb)
+static inline unsigned short hdlcdrv_hbuf_get(struct hdlcdrv_hdlcbuffer *hb)
{
unsigned long flags;
unsigned short val;
@@ -296,7 +296,7 @@ extern inline unsigned short hdlcdrv_hbuf_get(struct hdlcdrv_hdlcbuffer *hb)
/* -------------------------------------------------------------------- */
-extern inline void hdlcdrv_hbuf_put(struct hdlcdrv_hdlcbuffer *hb,
+static inline void hdlcdrv_hbuf_put(struct hdlcdrv_hdlcbuffer *hb,
unsigned short val)
{
unsigned newp;
@@ -313,12 +313,12 @@ extern inline void hdlcdrv_hbuf_put(struct hdlcdrv_hdlcbuffer *hb,
/* -------------------------------------------------------------------- */
-extern inline void hdlcdrv_putbits(struct hdlcdrv_state *s, unsigned int bits)
+static inline void hdlcdrv_putbits(struct hdlcdrv_state *s, unsigned int bits)
{
hdlcdrv_hbuf_put(&s->hdlcrx.hbuf, bits);
}
-extern inline unsigned int hdlcdrv_getbits(struct hdlcdrv_state *s)
+static inline unsigned int hdlcdrv_getbits(struct hdlcdrv_state *s)
{
unsigned int ret;
@@ -336,19 +336,19 @@ extern inline unsigned int hdlcdrv_getbits(struct hdlcdrv_state *s)
return ret;
}
-extern inline void hdlcdrv_channelbit(struct hdlcdrv_state *s, unsigned int bit)
+static inline void hdlcdrv_channelbit(struct hdlcdrv_state *s, unsigned int bit)
{
#ifdef HDLCDRV_DEBUG
hdlcdrv_add_bitbuffer(&s->bitbuf_channel, bit);
#endif /* HDLCDRV_DEBUG */
}
-extern inline void hdlcdrv_setdcd(struct hdlcdrv_state *s, int dcd)
+static inline void hdlcdrv_setdcd(struct hdlcdrv_state *s, int dcd)
{
s->hdlcrx.dcd = !!dcd;
}
-extern inline int hdlcdrv_ptt(struct hdlcdrv_state *s)
+static inline int hdlcdrv_ptt(struct hdlcdrv_state *s)
{
return s->hdlctx.ptt || (s->hdlctx.calibrate > 0);
}
diff --git a/include/linux/hfs_fs.h b/include/linux/hfs_fs.h
index 65392fc39..0f619399e 100644
--- a/include/linux/hfs_fs.h
+++ b/include/linux/hfs_fs.h
@@ -320,12 +320,12 @@ extern void hfs_tolower(unsigned char *, int);
#define HFS_I(X) (&((X)->u.hfs_i))
#define HFS_SB(X) (&((X)->u.hfs_sb))
-extern __inline__ void hfs_nameout(struct inode *dir, struct hfs_name *out,
+static inline void hfs_nameout(struct inode *dir, struct hfs_name *out,
const char *in, int len) {
HFS_SB(dir->i_sb)->s_nameout(out, in, len);
}
-extern __inline__ int hfs_namein(struct inode *dir, char *out,
+static inline int hfs_namein(struct inode *dir, char *out,
const struct hfs_name *in) {
int len = HFS_SB(dir->i_sb)->s_namein(out, in);
if (HFS_SB(dir->i_sb)->s_lowercase) {
diff --git a/include/linux/hfs_sysdep.h b/include/linux/hfs_sysdep.h
index 0c0b9bb91..cefce233d 100644
--- a/include/linux/hfs_sysdep.h
+++ b/include/linux/hfs_sysdep.h
@@ -52,7 +52,7 @@ typedef unsigned char hfs_lword_t[4];
extern long int hfs_alloc;
#endif
-extern inline void *hfs_malloc(unsigned int size) {
+static inline void *hfs_malloc(unsigned int size) {
#if defined(DEBUG_ALL) || defined(DEBUG_MEM)
hfs_warn("%ld bytes allocation at %s:%u\n",
(hfs_alloc += size), __FILE__, __LINE__);
@@ -60,7 +60,7 @@ extern inline void *hfs_malloc(unsigned int size) {
return kmalloc(size, GFP_KERNEL);
}
-extern inline void hfs_free(void *ptr, unsigned int size) {
+static inline void hfs_free(void *ptr, unsigned int size) {
kfree(ptr);
#if defined(DEBUG_ALL) || defined(DEBUG_MEM)
hfs_warn("%ld bytes allocation at %s:%u\n",
@@ -75,17 +75,17 @@ extern inline void hfs_free(void *ptr, unsigned int size) {
* not a good thing to do. instead, we depend upon tz_minuteswest
* having the correct daylight savings correction.
*/
-extern inline hfs_u32 hfs_from_utc(hfs_s32 time)
+static inline hfs_u32 hfs_from_utc(hfs_s32 time)
{
return time - sys_tz.tz_minuteswest*60;
}
-extern inline hfs_s32 hfs_to_utc(hfs_u32 time)
+static inline hfs_s32 hfs_to_utc(hfs_u32 time)
{
return time + sys_tz.tz_minuteswest*60;
}
-extern inline hfs_u32 hfs_time(void) {
+static inline hfs_u32 hfs_time(void) {
return htonl(hfs_from_utc(CURRENT_TIME)+2082844800U);
}
@@ -95,19 +95,19 @@ extern inline hfs_u32 hfs_time(void) {
*/
typedef wait_queue_head_t hfs_wait_queue;
-extern inline void hfs_init_waitqueue(hfs_wait_queue *queue) {
+static inline void hfs_init_waitqueue(hfs_wait_queue *queue) {
init_waitqueue_head(queue);
}
-extern inline void hfs_sleep_on(hfs_wait_queue *queue) {
+static inline void hfs_sleep_on(hfs_wait_queue *queue) {
sleep_on(queue);
}
-extern inline void hfs_wake_up(hfs_wait_queue *queue) {
+static inline void hfs_wake_up(hfs_wait_queue *queue) {
wake_up(queue);
}
-extern inline void hfs_relinquish(void) {
+static inline void hfs_relinquish(void) {
schedule();
}
@@ -117,11 +117,11 @@ extern inline void hfs_relinquish(void) {
*/
typedef struct super_block *hfs_sysmdb;
-extern inline void hfs_mdb_dirty(hfs_sysmdb sys_mdb) {
+static inline void hfs_mdb_dirty(hfs_sysmdb sys_mdb) {
sys_mdb->s_dirt = 1;
}
-extern inline const char *hfs_mdb_name(hfs_sysmdb sys_mdb) {
+static inline const char *hfs_mdb_name(hfs_sysmdb sys_mdb) {
return kdevname(sys_mdb->s_dev);
}
@@ -141,19 +141,19 @@ typedef struct buffer_head *hfs_buffer;
/* In sysdep.c, since it needs HFS_SECTOR_SIZE */
extern hfs_buffer hfs_buffer_get(hfs_sysmdb, int, int);
-extern inline int hfs_buffer_ok(hfs_buffer buffer) {
+static inline int hfs_buffer_ok(hfs_buffer buffer) {
return (buffer != NULL);
}
-extern inline void hfs_buffer_put(hfs_buffer buffer) {
+static inline void hfs_buffer_put(hfs_buffer buffer) {
brelse(buffer);
}
-extern inline void hfs_buffer_dirty(hfs_buffer buffer) {
- mark_buffer_dirty(buffer, 1);
+static inline void hfs_buffer_dirty(hfs_buffer buffer) {
+ mark_buffer_dirty(buffer);
}
-extern inline void hfs_buffer_sync(hfs_buffer buffer) {
+static inline void hfs_buffer_sync(hfs_buffer buffer) {
while (buffer_locked(buffer)) {
wait_on_buffer(buffer);
}
@@ -163,7 +163,7 @@ extern inline void hfs_buffer_sync(hfs_buffer buffer) {
}
}
-extern inline void *hfs_buffer_data(const hfs_buffer buffer) {
+static inline void *hfs_buffer_data(const hfs_buffer buffer) {
return buffer->b_data;
}
@@ -199,15 +199,15 @@ extern inline void *hfs_buffer_data(const hfs_buffer buffer) {
# error "Don't know if bytes are big- or little-endian!"
#endif
-extern inline int hfs_clear_bit(int bitnr, hfs_u32 *lword) {
+static inline int hfs_clear_bit(int bitnr, hfs_u32 *lword) {
return test_and_clear_bit(BITNR(bitnr), lword);
}
-extern inline int hfs_set_bit(int bitnr, hfs_u32 *lword) {
+static inline int hfs_set_bit(int bitnr, hfs_u32 *lword) {
return test_and_set_bit(BITNR(bitnr), lword);
}
-extern inline int hfs_test_bit(int bitnr, const hfs_u32 *lword) {
+static inline int hfs_test_bit(int bitnr, const hfs_u32 *lword) {
/* the kernel should declare the second arg of test_bit as const */
return test_bit(BITNR(bitnr), (void *)lword);
}
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index a80434823..184407e40 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -19,7 +19,7 @@ extern struct buffer_head * create_bounce(int rw, struct buffer_head * bh_orig);
#else /* CONFIG_HIGHMEM */
-extern inline unsigned int nr_free_highpages(void) { return 0; }
+static inline unsigned int nr_free_highpages(void) { return 0; }
#define prepare_highmem_swapout(page) page
#define replace_with_highmem(page) page
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 0129c67b9..c8fa6b199 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -130,7 +130,7 @@ enum {
extern struct ppp_channel_ops pppoe_chan_ops;
-extern void pppox_proto_init(struct net_proto *np);
+extern int pppox_proto_init(struct net_proto *np);
#endif /* __KERNEL__ */
diff --git a/include/linux/inet.h b/include/linux/inet.h
index 6a8e27bcd..acb93765f 100644
--- a/include/linux/inet.h
+++ b/include/linux/inet.h
@@ -46,7 +46,6 @@
extern void inet_proto_init(struct net_proto *pro);
extern char *in_ntoa(__u32 in);
-extern char *in_ntoa2(__u32 in, char *buf);
extern __u32 in_aton(const char *str);
#endif
diff --git a/include/linux/ixjuser.h b/include/linux/ixjuser.h
index a70195334..2aca5e2c8 100644
--- a/include/linux/ixjuser.h
+++ b/include/linux/ixjuser.h
@@ -1,7 +1,8 @@
-/*
+/******************************************************************************
+ *
* ixjuser.h
*
- * User-space include file for the Internet PhoneJACK and
+ * Device Driver for the Internet PhoneJACK and
* Internet LineJACK Telephony Cards.
*
* (c) Copyright 1999 Quicknet Technologies, Inc.
@@ -22,31 +23,48 @@
* at our website: http://www.quicknet.net
*
* Fixes:
- */
+ *
+ * IN NO EVENT SHALL QUICKNET TECHNOLOGIES, INC. BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+ * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF QUICKNET
+ * TECHNOLOGIES, INC.HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * QUICKNET TECHNOLOGIES, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION
+ * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ *****************************************************************************/
-static char ixjuser_h_rcsid[] = "$Id: ixjuser.h,v 3.4 1999/12/16 22:18:36 root Exp root $";
+static char ixjuser_h_rcsid[] = "$Id: ixjuser.h,v 3.11 2000/03/30 22:06:48 eokerson Exp $";
-#include <linux/telephony.h>
+#include "telephony.h"
-/***************************************************************************
- If you use the IXJCTL_TESTRAM command, the card must be power
- cycled to reset the SRAM values before futher use.
+/******************************************************************************
+*
+* IOCTL's used for the Quicknet Cards
+*
+* If you use the IXJCTL_TESTRAM command, the card must be power cycled to
+* reset the SRAM values before futher use.
+*
+******************************************************************************/
-***************************************************************************/
#define IXJCTL_DSP_RESET _IO ('q', 0xC0)
-#define IXJCTL_RING PHONE_RING
-#define IXJCTL_HOOKSTATE PHONE_HOOKSTATE
+#define IXJCTL_RING PHONE_RING
+#define IXJCTL_HOOKSTATE PHONE_HOOKSTATE
#define IXJCTL_MAXRINGS PHONE_MAXRINGS
-#define IXJCTL_RING_CADENCE PHONE_RING_CADENCE
+#define IXJCTL_RING_CADENCE PHONE_RING_CADENCE
#define IXJCTL_RING_START PHONE_RING_START
#define IXJCTL_RING_STOP PHONE_RING_STOP
#define IXJCTL_CARDTYPE _IOR ('q', 0xC1, int)
-#define IXJCTL_SERIAL _IOR ('q', 0xC2, int)
-#define IXJCTL_DSP_TYPE _IOR ('q', 0xC3, int)
-#define IXJCTL_DSP_VERSION _IOR ('q', 0xC4, int)
+#define IXJCTL_SERIAL _IOR ('q', 0xC2, int)
+#define IXJCTL_DSP_TYPE _IOR ('q', 0xC3, int)
+#define IXJCTL_DSP_VERSION _IOR ('q', 0xC4, int)
+#define IXJCTL_VERSION _IOR ('q', 0xDA, char *)
#define IXJCTL_DSP_IDLE _IO ('q', 0xC5)
#define IXJCTL_TESTRAM _IO ('q', 0xC6)
@@ -104,8 +122,22 @@ typedef struct {
char enable;
} IXJ_FILTER;
+typedef struct {
+ char enable;
+ char en_filter;
+ unsigned int filter;
+ unsigned int on1;
+ unsigned int off1;
+ unsigned int on2;
+ unsigned int off2;
+ unsigned int on3;
+ unsigned int off3;
+} IXJ_FILTER_CADENCE;
+
#define IXJCTL_SET_FILTER _IOW ('q', 0xC7, IXJ_FILTER *)
#define IXJCTL_GET_FILTER_HIST _IOW ('q', 0xC8, int)
+#define IXJCTL_FILTER_CADENCE _IOW ('q', 0xD6, IXJ_FILTER_CADENCE *)
+#define IXJCTL_PLAY_CID _IO ('q', 0xD7)
/******************************************************************************
*
* This IOCTL allows you to reassign values in the tone index table. The
@@ -222,7 +254,9 @@ typedef enum {
hz1800 = 0x1405,
hz1860 = 0xe0b,
hz2100 = 0xf5f6,
- hz2450 = 0xd3b3
+ hz2130 = 0xf2f5,
+ hz2450 = 0xd3b3,
+ hz2750 = 0xb8e4
} IXJ_FREQ;
typedef enum {
@@ -344,6 +378,7 @@ typedef struct {
#define AEC_LOW 1
#define AEC_MED 2
#define AEC_HIGH 3
+#define AEC_AUTO 4
/******************************************************************************
*
* Call Progress Tones, DTMF, etc.
@@ -533,16 +568,16 @@ typedef struct {
/******************************************************************************
*
-* The DAA Analog GAIN sets 2 parameters at one time, the receive gain (AGRR),
+* The DAA Analog GAIN sets 2 parameters at one time, the recieve gain (AGRR),
* and the transmit gain (AGX). OR together the components and pass them
* as the parameter to IXJCTL_DAA_AGAIN. The default setting is both at 0dB.
*
******************************************************************************/
#define IXJCTL_DAA_AGAIN _IOW ('q', 0xD2, int)
-#define AGRR00DB 0x00 // Analog gain in receive direction 0dB
-#define AGRR3_5DB 0x10 // Analog gain in receive direction 3.5dB
-#define AGRR06DB 0x30 // Analog gain in receive direction 6dB
+#define AGRR00DB 0x00 // Analog gain in recieve direction 0dB
+#define AGRR3_5DB 0x10 // Analog gain in recieve direction 3.5dB
+#define AGRR06DB 0x30 // Analog gain in recieve direction 6dB
#define AGX00DB 0x00 // Analog gain in transmit direction 0dB
#define AGX_6DB 0x04 // Analog gain in transmit direction -6dB
@@ -551,18 +586,9 @@ typedef struct {
#define IXJCTL_PSTN_LINETEST _IO ('q', 0xD3)
-typedef struct {
- char month[3];
- char day[3];
- char hour[3];
- char min[3];
- int numlen;
- char number[11];
- int namelen;
- char name[80];
-} IXJ_CID;
-
-#define IXJCTL_CID _IOR ('q', 0xD4, IXJ_CID *)
+#define IXJCTL_CID _IOR ('q', 0xD4, PHONE_CID *)
+#define IXJCTL_VMWI _IOR ('q', 0xD8, int)
+#define IXJCTL_CIDCW _IOW ('q', 0xD9, PHONE_CID *)
/******************************************************************************
*
* The wink duration is tunable with this ioctl. The default wink duration
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index ac6f029b9..aa337fe6c 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -9,6 +9,7 @@
#include <stdarg.h>
#include <linux/linkage.h>
+#include <linux/stddef.h>
/* Optimization barrier */
/* The "volatile" is due to gcc bugs */
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 4bc6187b3..bab128898 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -10,6 +10,7 @@ extern int request_module(const char * name);
extern int exec_usermodehelper(char *program_path, char *argv[], char *envp[]);
#ifdef CONFIG_HOTPLUG
extern char hotplug_path [];
+extern int call_usermodehelper(char *path, char *argv[], char *envp[]);
#endif
#else
static inline int request_module(const char * name) { return -ENOSYS; }
diff --git a/include/linux/locks.h b/include/linux/locks.h
index 2094a4d19..9d342e669 100644
--- a/include/linux/locks.h
+++ b/include/linux/locks.h
@@ -29,7 +29,9 @@ extern inline void lock_buffer(struct buffer_head * bh)
extern inline void unlock_buffer(struct buffer_head *bh)
{
clear_bit(BH_Lock, &bh->b_state);
- wake_up(&bh->b_wait);
+ smp_mb__after_clear_bit();
+ if (waitqueue_active(&bh->b_wait))
+ wake_up(&bh->b_wait);
}
/*
@@ -55,7 +57,12 @@ extern inline void lock_super(struct super_block * sb)
extern inline void unlock_super(struct super_block * sb)
{
sb->s_lock = 0;
- wake_up(&sb->s_wait);
+ /*
+ * No need of any barrier, we're protected by
+ * the big kernel lock here... unfortunately :)
+ */
+ if (waitqueue_active(&sb->s_wait))
+ wake_up(&sb->s_wait);
}
#endif /* _LINUX_LOCKS_H */
diff --git a/include/linux/major.h b/include/linux/major.h
index 7b43e59d0..372e1841a 100644
--- a/include/linux/major.h
+++ b/include/linux/major.h
@@ -108,6 +108,15 @@
#define SPECIALIX_NORMAL_MAJOR 75
#define SPECIALIX_CALLOUT_MAJOR 76
+#define COMPAQ_CISS_MAJOR 104
+#define COMPAQ_CISS_MAJOR1 105
+#define COMPAQ_CISS_MAJOR2 106
+#define COMPAQ_CISS_MAJOR3 107
+#define COMPAQ_CISS_MAJOR4 108
+#define COMPAQ_CISS_MAJOR5 109
+#define COMPAQ_CISS_MAJOR6 110
+#define COMPAQ_CISS_MAJOR7 111
+
#define DASD_MAJOR 94 /* Official assignations from Peter */
#define MDISK_MAJOR 95 /* Official assignations from Peter */
@@ -134,12 +143,14 @@
#define USB_ACM_AUX_MAJOR 167
#define USB_CHAR_MAJOR 180
-#define TUN_MAJOR 195
-
#define UNIX98_PTY_MASTER_MAJOR 128
#define UNIX98_PTY_MAJOR_COUNT 8
#define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT)
+#define VXVM_MAJOR 199 /* VERITAS volume i/o driver */
+#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */
+#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */
+
#define MSR_MAJOR 202
#define CPUID_MAJOR 203
diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h
index 99cd63717..b90790341 100644
--- a/include/linux/minix_fs.h
+++ b/include/linux/minix_fs.h
@@ -99,9 +99,14 @@ extern unsigned long minix_count_free_blocks(struct super_block *sb);
extern struct buffer_head * minix_getblk(struct inode *, int, int);
extern struct buffer_head * minix_bread(struct inode *, int, int);
+extern void V1_minix_truncate(struct inode *);
+extern void V2_minix_truncate(struct inode *);
extern void minix_truncate(struct inode *);
extern int minix_sync_inode(struct inode *);
-extern int minix_sync_file(struct file *, struct dentry *, int);
+extern int V1_minix_sync_file(struct inode *);
+extern int V2_minix_sync_file(struct inode *);
+extern int V1_minix_get_block(struct inode *, long, struct buffer_head *, int);
+extern int V2_minix_get_block(struct inode *, long, struct buffer_head *, int);
extern struct address_space_operations minix_aops;
extern struct inode_operations minix_file_inode_operations;
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index f2bc32f72..3532658c6 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -31,6 +31,8 @@
/* drivers/sgi/char/usema.c */
#define SGI_USEMACLONE 151
+#define TUN_MINOR 200
+
extern int misc_init(void);
struct miscdevice
diff --git a/include/linux/mm.h b/include/linux/mm.h
index f606186cf..69d4d2490 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -15,7 +15,9 @@ extern unsigned long max_mapnr;
extern unsigned long num_physpages;
extern void * high_memory;
extern int page_cluster;
-extern struct list_head lru_cache;
+/* The inactive_clean lists are per zone. */
+extern struct list_head active_list;
+extern struct list_head inactive_dirty_list;
#include <asm/page.h>
#include <asm/pgtable.h>
@@ -52,7 +54,8 @@ struct vm_area_struct {
struct vm_area_struct * vm_avl_left;
struct vm_area_struct * vm_avl_right;
- /* For areas with inode, the list inode->i_mapping->i_mmap,
+ /* For areas with an address space and backing store,
+ * one of the address_space->i_mmap{,shared} lists,
* for shm areas, the list of attaches, otherwise unused.
*/
struct vm_area_struct *vm_next_share;
@@ -91,6 +94,7 @@ struct vm_area_struct {
#define VM_RAND_READ 0x00010000 /* App will not benefit from clustered reads */
#define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */
+#define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */
#define VM_STACK_FLAGS 0x00000177
@@ -148,6 +152,7 @@ typedef struct page {
atomic_t count;
unsigned long flags; /* atomic flags, some possibly updated asynchronously */
struct list_head lru;
+ unsigned long age;
wait_queue_head_t wait;
struct page **pprev_hash;
struct buffer_head * buffers;
@@ -168,12 +173,12 @@ typedef struct page {
#define PG_uptodate 3
#define PG_dirty 4
#define PG_decr_after 5
-#define PG_unused_01 6
-#define PG__unused_02 7
+#define PG_active 6
+#define PG_inactive_dirty 7
#define PG_slab 8
#define PG_swap_cache 9
#define PG_skip 10
-#define PG_unused_03 11
+#define PG_inactive_clean 11
#define PG_highmem 12
/* bits 21-30 unused */
#define PG_reserved 31
@@ -189,15 +194,25 @@ typedef struct page {
#define PageLocked(page) test_bit(PG_locked, &(page)->flags)
#define LockPage(page) set_bit(PG_locked, &(page)->flags)
#define TryLockPage(page) test_and_set_bit(PG_locked, &(page)->flags)
+/*
+ * The first mb is necessary to safely close the critical section opened by the
+ * TryLockPage(), the second mb is necessary to enforce ordering between
+ * the clear_bit and the read of the waitqueue (to avoid SMP races with a
+ * parallel wait_on_page).
+ */
#define UnlockPage(page) do { \
+ smp_mb__before_clear_bit(); \
clear_bit(PG_locked, &(page)->flags); \
- wake_up(&page->wait); \
+ smp_mb__after_clear_bit(); \
+ if (waitqueue_active(&page->wait)) \
+ wake_up(&page->wait); \
} while (0)
#define PageError(page) test_bit(PG_error, &(page)->flags)
#define SetPageError(page) set_bit(PG_error, &(page)->flags)
#define ClearPageError(page) clear_bit(PG_error, &(page)->flags)
#define PageReferenced(page) test_bit(PG_referenced, &(page)->flags)
#define SetPageReferenced(page) set_bit(PG_referenced, &(page)->flags)
+#define ClearPageReferenced(page) clear_bit(PG_referenced, &(page)->flags)
#define PageTestandClearReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags)
#define PageDecrAfter(page) test_bit(PG_decr_after, &(page)->flags)
#define SetPageDecrAfter(page) set_bit(PG_decr_after, &(page)->flags)
@@ -216,6 +231,18 @@ typedef struct page {
#define PageTestandClearSwapCache(page) test_and_clear_bit(PG_swap_cache, &(page)->flags)
+#define PageActive(page) test_bit(PG_active, &(page)->flags)
+#define SetPageActive(page) set_bit(PG_active, &(page)->flags)
+#define ClearPageActive(page) clear_bit(PG_active, &(page)->flags)
+
+#define PageInactiveDirty(page) test_bit(PG_inactive_dirty, &(page)->flags)
+#define SetPageInactiveDirty(page) set_bit(PG_inactive_dirty, &(page)->flags)
+#define ClearPageInactiveDirty(page) clear_bit(PG_inactive_dirty, &(page)->flags)
+
+#define PageInactiveClean(page) test_bit(PG_inactive_clean, &(page)->flags)
+#define SetPageInactiveClean(page) set_bit(PG_inactive_clean, &(page)->flags)
+#define ClearPageInactiveClean(page) clear_bit(PG_inactive_clean, &(page)->flags)
+
#ifdef CONFIG_HIGHMEM
#define PageHighMem(page) test_bit(PG_highmem, &(page)->flags)
#else
@@ -375,7 +402,7 @@ extern int pgt_cache_water[2];
extern int check_pgt_cache(void);
extern void free_area_init(unsigned long * zones_size);
-extern void free_area_init_node(int nid, pg_data_t *pgdat,
+extern void free_area_init_node(int nid, pg_data_t *pgdat, struct page *pmap,
unsigned long * zones_size, unsigned long zone_start_paddr,
unsigned long *zholes_size);
extern void mem_init(void);
@@ -415,7 +442,6 @@ struct zone_t;
/* filemap.c */
extern void remove_inode_page(struct page *);
extern unsigned long page_unuse(struct page *);
-extern int shrink_mmap(int, int);
extern void truncate_inode_pages(struct address_space *, loff_t);
/* generic vm_area_ops exported for stackable file systems */
@@ -443,11 +469,11 @@ extern struct page *filemap_nopage(struct vm_area_struct * area,
#define GFP_BUFFER (__GFP_HIGH | __GFP_WAIT)
#define GFP_ATOMIC (__GFP_HIGH)
-#define GFP_USER (__GFP_WAIT | __GFP_IO)
-#define GFP_HIGHUSER (GFP_USER | __GFP_HIGHMEM)
+#define GFP_USER ( __GFP_WAIT | __GFP_IO)
+#define GFP_HIGHUSER ( __GFP_WAIT | __GFP_IO | __GFP_HIGHMEM)
#define GFP_KERNEL (__GFP_HIGH | __GFP_WAIT | __GFP_IO)
#define GFP_NFS (__GFP_HIGH | __GFP_WAIT | __GFP_IO)
-#define GFP_KSWAPD (__GFP_IO)
+#define GFP_KSWAPD ( __GFP_IO)
/* Flag - indicates that the buffer will be suitable for DMA. Ignored on some
platforms, used as appropriate on others */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 61f672a3c..4a8280d7d 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -28,13 +28,14 @@ typedef struct zone_struct {
spinlock_t lock;
unsigned long offset;
unsigned long free_pages;
- char low_on_memory;
- char zone_wake_kswapd;
+ unsigned long inactive_clean_pages;
+ unsigned long inactive_dirty_pages;
unsigned long pages_min, pages_low, pages_high;
/*
* free areas of different sizes
*/
+ struct list_head inactive_clean_list;
free_area_t free_area[MAX_ORDER];
/*
@@ -99,9 +100,11 @@ extern pg_data_t *pgdat_list;
* The following two are not meant for general usage. They are here as
* prototypes for the discontig memory code.
*/
+struct page;
extern void show_free_areas_core(int);
extern void free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap,
- unsigned long *zones_size, unsigned long paddr, unsigned long *zholes_size);
+ unsigned long *zones_size, unsigned long paddr, unsigned long *zholes_size,
+ struct page *pmap);
#ifndef CONFIG_DISCONTIGMEM
diff --git a/include/linux/module.h b/include/linux/module.h
index fef8d2b20..5a52811a8 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -279,14 +279,6 @@ extern struct module *module_list;
#define EXPORT_SYMBOL(var)
#define EXPORT_SYMBOL_NOVERS(var)
-#elif !defined(EXPORT_SYMTAB)
-
-/* If things weren't set up in the Makefiles to get EXPORT_SYMTAB defined,
- then they weren't set up to run genksyms properly so MODVERSIONS breaks. */
-#define __EXPORT_SYMBOL(sym,str) error EXPORT_SYMTAB_not_defined
-#define EXPORT_SYMBOL(var) error EXPORT_SYMTAB_not_defined
-#define EXPORT_SYMBOL_NOVERS(var) error EXPORT_SYMTAB_not_defined
-
#else
#define __EXPORT_SYMBOL(sym, str) \
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 8eff1ecc9..a4fc9a05c 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -27,8 +27,7 @@ struct vfsmount
struct list_head mnt_child; /* and going through their mnt_child */
atomic_t mnt_count;
int mnt_flags;
-
- char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
+ char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
struct list_head mnt_list;
uid_t mnt_owner;
};
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ebe8428da..95c0e130b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -416,7 +416,6 @@ extern int dev_alloc_name(struct net_device *dev, const char *name);
extern int dev_open(struct net_device *dev);
extern int dev_close(struct net_device *dev);
extern int dev_queue_xmit(struct sk_buff *skb);
-extern void dev_loopback_xmit(struct sk_buff *skb);
extern int register_netdevice(struct net_device *dev);
extern int unregister_netdevice(struct net_device *dev);
extern int register_netdevice_notifier(struct notifier_block *nb);
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index ddd0563a5..b61722b15 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -184,6 +184,12 @@ extern struct inode_operations nfs_symlink_inode_operations;
extern int nfs_lock(struct file *, int, struct file_lock *);
/*
+ * linux/fs/nfs/unlink.c
+ */
+extern int nfs_async_unlink(struct dentry *);
+extern void nfs_complete_unlink(struct dentry *);
+
+/*
* linux/fs/nfs/write.c
*/
extern int nfs_writepage(struct file *file, struct page *);
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h
index 7b7df5b06..2b552936e 100644
--- a/include/linux/nfs_mount.h
+++ b/include/linux/nfs_mount.h
@@ -52,6 +52,7 @@ struct nfs_mount_data {
#define NFS_MOUNT_VER3 0x0080 /* 3 */
#define NFS_MOUNT_KERBEROS 0x0100 /* 3 */
#define NFS_MOUNT_NONLM 0x0200 /* 3 */
+#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
#define NFS_MOUNT_FLAGMASK 0xFFFF
#endif
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 63c3e1c7b..9863c06af 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -334,6 +334,9 @@ struct nfs_rpc_ops {
int (*create) (struct dentry *, struct qstr *, struct iattr *,
int, struct nfs_fh *, struct nfs_fattr *);
int (*remove) (struct dentry *, struct qstr *);
+ int (*unlink_setup) (struct rpc_message *,
+ struct dentry *, struct qstr *);
+ void (*unlink_done) (struct dentry *, struct rpc_message *);
int (*rename) (struct dentry *, struct qstr *,
struct dentry *, struct qstr *);
int (*link) (struct dentry *, struct dentry *, struct qstr *);
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 5fb55c738..db948a701 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -38,7 +38,8 @@
#define NFSEXP_CROSSMNT 0x0200
#define NFSEXP_NOSUBTREECHECK 0x0400
#define NFSEXP_NOAUTHNLM 0x0800 /* Don't authenticate NLM requests - just trust */
-#define NFSEXP_ALLFLAGS 0x0FFF
+#define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect */
+#define NFSEXP_ALLFLAGS 0x1FFF
#ifdef __KERNEL__
diff --git a/include/linux/nfsd/interface.h b/include/linux/nfsd/interface.h
new file mode 100644
index 000000000..cdce71e82
--- /dev/null
+++ b/include/linux/nfsd/interface.h
@@ -0,0 +1,23 @@
+/*
+ * include/linux/nfsd/interface.h
+ *
+ * defines interface between nfsd and other bits of
+ * the kernel. Particularly filesystems (eventually).
+ *
+ * Copyright (C) 2000 Neil Brown <neilb@cse.unsw.edu.au>
+ */
+
+#ifndef LINUX_NFSD_INTERFACE_H
+#define LINUX_NFSD_INTERFACE_H
+
+#include <linux/config.h>
+
+#ifdef CONFIG_NFSD_MODULE
+
+extern struct nfsd_linkage {
+ long (*do_nfsservctl)(int cmd, void *argp, void *resp);
+} * nfsd_linkage;
+
+#endif
+
+#endif /* LINUX_NFSD_INTERFACE_H */
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index dacab2198..f183f57a5 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -21,7 +21,7 @@
#include <linux/nfsd/export.h>
#include <linux/nfsd/auth.h>
#include <linux/nfsd/stats.h>
-
+#include <linux/nfsd/interface.h>
/*
* nfsd version
*/
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 1efa437bb..0c2dc46ae 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -298,6 +298,16 @@
#define DEVICE_COUNT_DMA 2
#define DEVICE_COUNT_RESOURCE 12
+#define PCI_ANY_ID (~0)
+
+#define pci_present pcibios_present
+
+#define pci_for_each_dev(dev) \
+ for(dev = pci_dev_g(pci_devices.next); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.next))
+
+#define pci_for_each_dev_reverse(dev) \
+ for(dev = pci_dev_g(pci_devices.prev); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.prev))
+
/*
* The pci_dev structure is used to describe both PCI and ISAPnP devices.
*/
@@ -429,6 +439,27 @@ struct pbus_set_ranges_data
unsigned long mem_start, mem_end;
};
+struct pci_device_id {
+ unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */
+ unsigned int subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */
+ unsigned int class, class_mask; /* (class,subclass,prog-if) triplet */
+ unsigned long driver_data; /* Data private to the driver */
+};
+
+struct pci_driver {
+ struct list_head node;
+ char *name;
+ const struct pci_device_id *id_table; /* NULL if wants all devices */
+ int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
+ void (*remove)(struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
+ void (*suspend)(struct pci_dev *dev); /* Device suspended */
+ void (*resume)(struct pci_dev *dev); /* Device woken up */
+};
+
+
+/* these external functions are only available when PCI support is enabled */
+#ifdef CONFIG_PCI
+
void pcibios_init(void);
void pcibios_fixup_bus(struct pci_bus *);
int pcibios_enable_device(struct pci_dev *);
@@ -444,7 +475,6 @@ void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *);
/* Backward compatibility, don't use in new code! */
int pcibios_present(void);
-#define pci_present pcibios_present
int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn,
unsigned char where, unsigned char *val);
int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn,
@@ -488,8 +518,6 @@ struct pci_dev *pci_find_class (unsigned int class, const struct pci_dev *from);
struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
int pci_find_capability (struct pci_dev *dev, int cap);
-#define PCI_ANY_ID (~0)
-
int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val);
int pci_read_config_word(struct pci_dev *dev, int where, u16 *val);
int pci_read_config_dword(struct pci_dev *dev, int where, u32 *val);
@@ -502,12 +530,6 @@ void pci_set_master(struct pci_dev *dev);
int pci_set_power_state(struct pci_dev *dev, int state);
int pci_assign_resource(struct pci_dev *dev, int i);
-#define pci_for_each_dev(dev) \
- for(dev = pci_dev_g(pci_devices.next); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.next))
-
-#define pci_for_each_dev_reverse(dev) \
- for(dev = pci_dev_g(pci_devices.prev); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.prev))
-
/* Helper functions for low-level code (drivers/pci/setup.c) */
int pci_claim_resource(struct pci_dev *, int);
@@ -518,24 +540,6 @@ void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
int (*)(struct pci_dev *, u8, u8));
/* New-style probing supporting hot-pluggable devices */
-
-struct pci_device_id {
- unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */
- unsigned int subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */
- unsigned int class, class_mask; /* (class,subclass,prog-if) triplet */
- unsigned long driver_data; /* Data private to the driver */
-};
-
-struct pci_driver {
- struct list_head node;
- char *name;
- const struct pci_device_id *id_table; /* NULL if wants all devices */
- int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
- void (*remove)(struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
- void (*suspend)(struct pci_dev *dev); /* Device suspended */
- void (*resume)(struct pci_dev *dev); /* Device woken up */
-};
-
int pci_register_driver(struct pci_driver *);
void pci_unregister_driver(struct pci_driver *);
void pci_insert_device(struct pci_dev *, struct pci_bus *);
@@ -543,6 +547,8 @@ void pci_remove_device(struct pci_dev *);
struct pci_driver *pci_dev_driver(const struct pci_dev *);
const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev);
+#endif /* CONFIG_PCI */
+
/* Include architecture-dependent settings and functions */
#include <asm/pci.h>
@@ -553,14 +559,14 @@ const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, co
*/
#ifndef CONFIG_PCI
-extern inline int pcibios_present(void) { return 0; }
-extern inline int pcibios_find_class (unsigned int class_code, unsigned short index, unsigned char *bus, unsigned char *dev_fn)
+static inline int pcibios_present(void) { return 0; }
+static inline int pcibios_find_class (unsigned int class_code, unsigned short index, unsigned char *bus, unsigned char *dev_fn)
{ return PCIBIOS_DEVICE_NOT_FOUND; }
#define _PCI_NOP(o,s,t) \
- extern inline int pcibios_##o##_config_##s## (u8 bus, u8 dfn, u8 where, t val) \
+ static inline int pcibios_##o##_config_##s## (u8 bus, u8 dfn, u8 where, t val) \
{ return PCIBIOS_FUNC_NOT_SUPPORTED; } \
- extern inline int pci_##o##_config_##s## (struct pci_dev *dev, int where, t val) \
+ static inline int pci_##o##_config_##s## (struct pci_dev *dev, int where, t val) \
{ return PCIBIOS_FUNC_NOT_SUPPORTED; }
#define _PCI_NOP_ALL(o,x) _PCI_NOP(o,byte,u8 x) \
_PCI_NOP(o,word,u16 x) \
@@ -568,27 +574,27 @@ extern inline int pcibios_find_class (unsigned int class_code, unsigned short in
_PCI_NOP_ALL(read, *)
_PCI_NOP_ALL(write,)
-extern inline struct pci_dev *pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *from)
+static inline struct pci_dev *pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *from)
{ return NULL; }
-extern inline struct pci_dev *pci_find_class(unsigned int class, const struct pci_dev *from)
+static inline struct pci_dev *pci_find_class(unsigned int class, const struct pci_dev *from)
{ return NULL; }
-extern inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn)
+static inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn)
{ return NULL; }
-extern inline struct pci_dev *pci_find_subsys(unsigned int vendor, unsigned int device,
+static inline struct pci_dev *pci_find_subsys(unsigned int vendor, unsigned int device,
unsigned int ss_vendor, unsigned int ss_device, const struct pci_dev *from)
{ return NULL; }
-extern inline void pci_set_master(struct pci_dev *dev) { }
-extern inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
-extern inline int pci_module_init(struct pci_driver *drv) { return -ENODEV; }
-extern inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;}
-extern inline int pci_register_driver(struct pci_driver *drv) { return 0;}
-extern inline void pci_unregister_driver(struct pci_driver *drv) { }
-extern inline int scsi_to_pci_dma_dir(unsigned char scsi_dir) { return scsi_dir; }
-extern inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
+static inline void pci_set_master(struct pci_dev *dev) { }
+static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
+static inline int pci_module_init(struct pci_driver *drv) { return -ENODEV; }
+static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;}
+static inline int pci_register_driver(struct pci_driver *drv) { return 0;}
+static inline void pci_unregister_driver(struct pci_driver *drv) { }
+static inline int scsi_to_pci_dma_dir(unsigned char scsi_dir) { return scsi_dir; }
+static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
#else
@@ -598,7 +604,7 @@ extern inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0;
*
* This MUST stay in a header, as it checks for -DMODULE
*/
-extern inline int pci_module_init(struct pci_driver *drv)
+static inline int pci_module_init(struct pci_driver *drv)
{
int rc = pci_register_driver (drv);
@@ -636,6 +642,20 @@ extern inline int pci_module_init(struct pci_driver *drv)
(pci_resource_end((dev),(bar)) - \
pci_resource_start((dev),(bar)) + 1))
+/* Similar to the helpers above, these manipulate per-pci_dev
+ * driver-specific data. Currently stored as pci_dev::driver_data,
+ * a void pointer, but it is not present on older kernels.
+ */
+static inline void *pci_get_drvdata (struct pci_dev *pdev)
+{
+ return pdev->driver_data;
+}
+
+static inline void pci_set_drvdata (struct pci_dev *pdev, void *data)
+{
+ pdev->driver_data = data;
+}
+
/*
* The world is not perfect and supplies us with broken PCI devices.
* For at least a part of these bugs we need a work-around, so both
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 7f68d1951..329e39079 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -131,6 +131,7 @@
#define PCI_DEVICE_ID_COMPAQ_NETEL100D 0xae40
#define PCI_DEVICE_ID_COMPAQ_NETEL100PI 0xae43
#define PCI_DEVICE_ID_COMPAQ_NETEL100I 0xb011
+#define PCI_DEVICE_ID_COMPAQ_CISS 0xb060
#define PCI_DEVICE_ID_COMPAQ_THUNDER 0xf130
#define PCI_DEVICE_ID_COMPAQ_NETFLEX3B 0xf150
@@ -333,9 +334,11 @@
#define PCI_DEVICE_ID_SI_300 0x0300
#define PCI_DEVICE_ID_SI_530 0x0530
#define PCI_DEVICE_ID_SI_540 0x0540
+#define PCI_DEVICE_ID_SI_540_VGA 0x5300
#define PCI_DEVICE_ID_SI_601 0x0601
#define PCI_DEVICE_ID_SI_620 0x0620
#define PCI_DEVICE_ID_SI_630 0x0630
+#define PCI_DEVICE_ID_SI_630_VGA 0x6300
#define PCI_DEVICE_ID_SI_5107 0x5107
#define PCI_DEVICE_ID_SI_5300 0x5300
#define PCI_DEVICE_ID_SI_5511 0x5511
@@ -461,6 +464,7 @@
#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001
#define PCI_DEVICE_ID_APPLE_GC 0x0002
#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e
+#define PCI_DEVICE_ID_APPLE_UNINORTH 0x0020
#define PCI_VENDOR_ID_NEXGEN 0x1074
#define PCI_DEVICE_ID_NEXGEN_82C501 0x4e78
@@ -820,6 +824,11 @@
#define PCI_DEVICE_ID_SERVERWORKS_CMIC_HE 0x0011
#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201
+#define PCI_VENDOR_ID_SBE 0x1176
+#define PCI_DEVICE_ID_SBE_WANXL100 0x0301
+#define PCI_DEVICE_ID_SBE_WANXL200 0x0302
+#define PCI_DEVICE_ID_SBE_WANXL400 0x0104
+
#define PCI_VENDOR_ID_TOSHIBA 0x1179
#define PCI_DEVICE_ID_TOSHIBA_601 0x0601
#define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a
@@ -911,6 +920,10 @@
#define PCI_DEVICE_ID_CYCLOM_8Y_Hi 0x0105
#define PCI_DEVICE_ID_CYCLOM_Z_Lo 0x0200
#define PCI_DEVICE_ID_CYCLOM_Z_Hi 0x0201
+#define PCI_DEVICE_ID_PC300_RX_2 0x0300
+#define PCI_DEVICE_ID_PC300_RX_1 0x0301
+#define PCI_DEVICE_ID_PC300_TE_2 0x0310
+#define PCI_DEVICE_ID_PC300_TE_1 0x0311
#define PCI_VENDOR_ID_ESSENTIAL 0x120f
#define PCI_DEVICE_ID_ESSENTIAL_ROADRUNNER 0x0001
@@ -1071,11 +1084,6 @@
#define PCI_DEVICE_ID_LAVA_QUAD_B 0x0202 /* 2x 16650, half of 4 port */
#define PCI_DEVICE_ID_LAVA_SSERIAL 0x0500 /* 1x 16550 */
#define PCI_DEVICE_ID_LAVA_PORT_650 0x0600 /* 1x 16650 */
-
-#define PCI_VENDOR_ID_SYBA 0x1592
-#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782
-#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783
-
#define PCI_DEVICE_ID_LAVA_PARALLEL 0x8000
#define PCI_DEVICE_ID_LAVA_DUAL_PAR_A 0x8002 /* The Lava Dual Parallel is */
#define PCI_DEVICE_ID_LAVA_DUAL_PAR_B 0x8003 /* two PCI devices on a card */
@@ -1102,6 +1110,10 @@
#define PCI_VENDOR_ID_AFAVLAB 0x14db
#define PCI_DEVICE_ID_AFAVLAB_TK9902 0x2120
+#define PCI_VENDOR_ID_SYBA 0x1592
+#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782
+#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783
+
#define PCI_VENDOR_ID_MORETON 0x15aa
#define PCI_DEVICE_ID_RASTEL_2PORT 0x2000
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index ad4d12b67..cd1ac601a 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -10,6 +10,7 @@
/*
* PMU commands
*/
+#define PMU_POWER_CTRL0 0x10 /* control power of some devices */
#define PMU_POWER_CTRL 0x11 /* control power of some devices */
#define PMU_ADB_CMD 0x20 /* send ADB packet */
#define PMU_ADB_POLL_OFF 0x21 /* disable ADB auto-poll */
@@ -26,15 +27,25 @@
#define PMU_INT_ACK 0x78 /* read interrupt bits */
#define PMU_SHUTDOWN 0x7e /* turn power off */
#define PMU_SLEEP 0x7f /* put CPU to sleep */
+#define PMU_POWER_EVENTS 0x8f /* Send power-event commands to PMU */
#define PMU_RESET 0xd0 /* reset CPU */
#define PMU_GET_BRIGHTBUTTON 0xd9 /* report brightness up/down pos */
#define PMU_GET_COVER 0xdc /* report cover open/closed */
+#define PMU_SYSTEM_READY 0xdf /* tell PMU we are awake */
+
+/* Bits to use with the PMU_POWER_CTRL0 command */
+#define PMU_POW0_ON 0x80 /* OR this to power ON the device */
+#define PMU_POW0_OFF 0x00 /* leave bit 7 to 0 to power it OFF */
+#define PMU_POW0_HARD_DRIVE 0x04 /* Hard drive power (on wallstreet/lombard ?) */
/* Bits to use with the PMU_POWER_CTRL command */
#define PMU_POW_ON 0x80 /* OR this to power ON the device */
#define PMU_POW_OFF 0x00 /* leave bit 7 to 0 to power it OFF */
#define PMU_POW_BACKLIGHT 0x01 /* backlight power */
+#define PMU_POW_CHARGER 0x02 /* battery charger power */
#define PMU_POW_IRLED 0x04 /* IR led power (on wallstreet) */
+#define PMU_POW_MEDIABAY 0x08 /* media bay power (wallstreet/lombard ?) */
+
/* Bits in PMU interrupt and interrupt mask bytes */
#define PMU_INT_ADB_AUTO 0x04 /* ADB autopoll, when PMU_INT_ADB */
@@ -54,6 +65,25 @@ enum {
PMU_KEYLARGO_BASED, /* Core99 motherboard (PMU99) */
};
+/* PMU PMU_POWER_EVENTS commands */
+enum {
+ PMU_PWR_GET_POWERUP_EVENTS = 0x00,
+ PMU_PWR_SET_POWERUP_EVENTS = 0x01,
+ PMU_PWR_CLR_POWERUP_EVENTS = 0x02,
+ PMU_PWR_GET_WAKEUP_EVENTS = 0x03,
+ PMU_PWR_SET_WAKEUP_EVENTS = 0x04,
+ PMU_PWR_CLR_WAKEUP_EVENTS = 0x05,
+};
+
+/* Power events wakeup bits */
+enum {
+ PMU_PWR_WAKEUP_KEY = 0x01, /* Wake on key press */
+ PMU_PWR_WAKEUP_AC_INSERT = 0x02, /* Wake on AC adapter plug */
+ PMU_PWR_WAKEUP_AC_CHANGE = 0x04,
+ PMU_PWR_WAKEUP_LID_OPEN = 0x08,
+ PMU_PWR_WAKEUP_RING = 0x10,
+};
+
/*
* Ioctl commands for the /dev/pmu device
*/
@@ -61,34 +91,38 @@ enum {
/* no param */
#define PMU_IOC_SLEEP _IO('B', 0)
-/* out param: u32* backlight value: 0 to 31 */
+/* out param: u32* backlight value: 0 to 15 */
#define PMU_IOC_GET_BACKLIGHT _IOR('B', 1, sizeof(__u32*))
-/* in param: u32 backlight value: 0 to 31 */
+/* in param: u32 backlight value: 0 to 15 */
#define PMU_IOC_SET_BACKLIGHT _IOW('B', 2, sizeof(__u32))
-/* out param: u32* backlight value: 0 to 31 */
+/* out param: u32* PMU model */
#define PMU_IOC_GET_MODEL _IOR('B', 3, sizeof(__u32*))
/* out param: u32* has_adb: 0 or 1 */
#define PMU_IOC_HAS_ADB _IOR('B', 4, sizeof(__u32*))
#ifdef __KERNEL__
-int find_via_pmu(void);
-int via_pmu_init(void);
+extern int find_via_pmu(void);
+extern int via_pmu_start(void);
-int pmu_request(struct adb_request *req,
+extern int pmu_request(struct adb_request *req,
void (*done)(struct adb_request *), int nbytes, ...);
-void pmu_poll(void);
-void pmu_enable_backlight(int on);
-void pmu_set_brightness(int level);
+extern void pmu_poll(void);
+
+/* For use before switching interrupts off for a long time;
+ * warning: not stackable
+ */
+extern void pmu_suspend(void);
+extern void pmu_resume(void);
-void pmu_enable_irled(int on);
+extern void pmu_enable_irled(int on);
-void pmu_restart(void);
-void pmu_shutdown(void);
+extern void pmu_restart(void);
+extern void pmu_shutdown(void);
-int pmu_present(void);
-int pmu_get_model(void);
+extern int pmu_present(void);
+extern int pmu_get_model(void);
#ifdef CONFIG_PMAC_PBOOK
/*
@@ -135,4 +169,4 @@ int pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* notifier);
#endif /* CONFIG_PMAC_PBOOK */
-#endif /* __KERNEL */
+#endif /* __KERNEL__ */
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h
index 6cc9767a3..ec87c2ddd 100644
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -82,7 +82,7 @@ extern struct gendisk * find_gendisk (kdev_t dev);
extern int md_notify_reboot(struct notifier_block *this,
unsigned long code, void *x);
extern int md_error (kdev_t mddev, kdev_t rdev);
-extern void md_run_setup(void);
+extern int md_run_setup(void);
extern void md_print_devices (void);
diff --git a/include/linux/raid/md_compatible.h b/include/linux/raid/md_compatible.h
index fbeac31a1..1dd422185 100644
--- a/include/linux/raid/md_compatible.h
+++ b/include/linux/raid/md_compatible.h
@@ -77,11 +77,7 @@ extern inline void md_init_signals (void)
/* 011 */
#define md_signal_pending signal_pending
-/* 012 */
-extern inline void md_set_global_readahead(int * table)
-{
- max_readahead[MD_MAJOR] = table;
-}
+/* 012 - md_set_global_readahead - nowhere used */
/* 013 */
#define md_mdelay(x) mdelay(x)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4357bb6fe..bb4537f24 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -33,12 +33,14 @@ extern unsigned long event;
#define CLONE_VM 0x00000100 /* set if VM shared between processes */
#define CLONE_FS 0x00000200 /* set if fs info shared between processes */
#define CLONE_FILES 0x00000400 /* set if open files shared between processes */
-#define CLONE_SIGHAND 0x00000800 /* set if signal handlers shared */
+#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */
#define CLONE_PID 0x00001000 /* set if pid shared */
#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
-#define CLONE_THREAD 0x00010000 /* set if we want to clone the "thread group" */
+#define CLONE_THREAD 0x00010000 /* Same thread group? */
+
+#define CLONE_SIGNAL (CLONE_SIGHAND | CLONE_THREAD)
/*
* These are the constant used to fake the fixed-point load-average
@@ -296,6 +298,7 @@ struct task_struct {
* that's just fine.)
*/
struct list_head run_list;
+ unsigned long sleep_time;
struct task_struct *next_task, *prev_task;
struct mm_struct *active_mm;
@@ -354,6 +357,7 @@ struct task_struct {
/* file system info */
int link_count;
struct tty_struct *tty; /* NULL if no tty */
+ unsigned int locks; /* How many file locks are being held */
/* ipc stuff */
struct sem_undo *semundo;
struct sem_queue *semsleeping;
@@ -366,8 +370,10 @@ struct task_struct {
/* signal handlers */
spinlock_t sigmask_lock; /* Protects signal and blocked */
struct signal_struct *sig;
- sigset_t signal, blocked;
- struct signal_queue *sigqueue, **sigqueue_tail;
+
+ sigset_t blocked;
+ struct sigpending pending;
+
unsigned long sas_ss_sp;
size_t sas_ss_size;
int (*notifier)(void *priv);
@@ -455,10 +461,8 @@ struct task_struct {
files: &init_files, \
sigmask_lock: SPIN_LOCK_UNLOCKED, \
sig: &init_signals, \
- signal: {{0}}, \
+ pending: { NULL, &tsk.pending.head, {{0}}}, \
blocked: {{0}}, \
- sigqueue: NULL, \
- sigqueue_tail: &tsk.sigqueue, \
alloc_lock: SPIN_LOCK_UNLOCKED \
}
@@ -577,11 +581,11 @@ static inline int signal_pending(struct task_struct *p)
return (p->sigpending != 0);
}
-/* Reevaluate whether the task has signals pending delivery.
- This is required every time the blocked sigset_t changes.
- All callers should have t->sigmask_lock. */
-
-static inline void recalc_sigpending(struct task_struct *t)
+/*
+ * Re-calculate pending state from the set of locally pending
+ * signals, globally pending signals, and blocked signals.
+ */
+static inline int has_pending_signals(sigset_t *signal, sigset_t *blocked)
{
unsigned long ready;
long i;
@@ -589,23 +593,31 @@ static inline void recalc_sigpending(struct task_struct *t)
switch (_NSIG_WORDS) {
default:
for (i = _NSIG_WORDS, ready = 0; --i >= 0 ;)
- ready |= t->signal.sig[i] &~ t->blocked.sig[i];
+ ready |= signal->sig[i] &~ blocked->sig[i];
break;
- case 4: ready = t->signal.sig[3] &~ t->blocked.sig[3];
- ready |= t->signal.sig[2] &~ t->blocked.sig[2];
- ready |= t->signal.sig[1] &~ t->blocked.sig[1];
- ready |= t->signal.sig[0] &~ t->blocked.sig[0];
+ case 4: ready = signal->sig[3] &~ blocked->sig[3];
+ ready |= signal->sig[2] &~ blocked->sig[2];
+ ready |= signal->sig[1] &~ blocked->sig[1];
+ ready |= signal->sig[0] &~ blocked->sig[0];
break;
- case 2: ready = t->signal.sig[1] &~ t->blocked.sig[1];
- ready |= t->signal.sig[0] &~ t->blocked.sig[0];
+ case 2: ready = signal->sig[1] &~ blocked->sig[1];
+ ready |= signal->sig[0] &~ blocked->sig[0];
break;
- case 1: ready = t->signal.sig[0] &~ t->blocked.sig[0];
+ case 1: ready = signal->sig[0] &~ blocked->sig[0];
}
+ return ready != 0;
+}
+
+/* Reevaluate whether the task has signals pending delivery.
+ This is required every time the blocked sigset_t changes.
+ All callers should have t->sigmask_lock. */
- t->sigpending = (ready != 0);
+static inline void recalc_sigpending(struct task_struct *t)
+{
+ t->sigpending = has_pending_signals(&t->pending.signal, &t->blocked);
}
/* True if we are on the alternate signal stack. */
@@ -710,7 +722,7 @@ extern fd_set *alloc_fdset(int);
extern int expand_fdset(struct files_struct *, int nr);
extern void free_fdset(fd_set *, int);
-extern int copy_thread(int, unsigned long, unsigned long, struct task_struct *, struct pt_regs *);
+extern int copy_thread(int, unsigned long, unsigned long, unsigned long, struct task_struct *, struct pt_regs *);
extern void flush_thread(void);
extern void exit_thread(void);
@@ -721,7 +733,7 @@ extern void exit_sighand(struct task_struct *);
extern void daemonize(void);
extern int do_execve(char *, char **, char **, struct pt_regs *);
-extern int do_fork(unsigned long, unsigned long, struct pt_regs *);
+extern int do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long);
extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait));
extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait));
@@ -810,6 +822,7 @@ do { \
static inline void del_from_runqueue(struct task_struct * p)
{
nr_running--;
+ p->sleep_time = jiffies;
list_del(&p->run_list);
p->run_list.next = NULL;
}
diff --git a/include/linux/signal.h b/include/linux/signal.h
index d6e82ae05..f2d0766ef 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -9,12 +9,16 @@
* Real Time signals may be queued.
*/
-struct signal_queue
-{
- struct signal_queue *next;
+struct sigqueue {
+ struct sigqueue *next;
siginfo_t info;
};
+struct sigpending {
+ struct sigqueue *head, **tail;
+ sigset_t signal;
+};
+
/*
* Define some primitives to manipulate sigset_t.
*/
@@ -24,7 +28,7 @@ struct signal_queue
/* We don't use <asm/bitops.h> for these because there is no need to
be atomic. */
-extern inline void sigaddset(sigset_t *set, int _sig)
+static inline void sigaddset(sigset_t *set, int _sig)
{
unsigned long sig = _sig - 1;
if (_NSIG_WORDS == 1)
@@ -33,7 +37,7 @@ extern inline void sigaddset(sigset_t *set, int _sig)
set->sig[sig / _NSIG_BPW] |= 1UL << (sig % _NSIG_BPW);
}
-extern inline void sigdelset(sigset_t *set, int _sig)
+static inline void sigdelset(sigset_t *set, int _sig)
{
unsigned long sig = _sig - 1;
if (_NSIG_WORDS == 1)
@@ -42,7 +46,7 @@ extern inline void sigdelset(sigset_t *set, int _sig)
set->sig[sig / _NSIG_BPW] &= ~(1UL << (sig % _NSIG_BPW));
}
-extern inline int sigismember(sigset_t *set, int _sig)
+static inline int sigismember(sigset_t *set, int _sig)
{
unsigned long sig = _sig - 1;
if (_NSIG_WORDS == 1)
@@ -51,7 +55,7 @@ extern inline int sigismember(sigset_t *set, int _sig)
return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW));
}
-extern inline int sigfindinword(unsigned long word)
+static inline int sigfindinword(unsigned long word)
{
return ffz(~word);
}
@@ -64,7 +68,7 @@ extern inline int sigfindinword(unsigned long word)
#include <linux/string.h>
#define _SIG_SET_BINOP(name, op) \
-extern inline void name(sigset_t *r, const sigset_t *a, const sigset_t *b) \
+static inline void name(sigset_t *r, const sigset_t *a, const sigset_t *b) \
{ \
unsigned long a0, a1, a2, a3, b0, b1, b2, b3; \
unsigned long i; \
@@ -115,7 +119,7 @@ _SIG_SET_BINOP(signandsets, _sig_nand)
#undef _sig_nand
#define _SIG_SET_OP(name, op) \
-extern inline void name(sigset_t *set) \
+static inline void name(sigset_t *set) \
{ \
unsigned long i; \
\
@@ -138,7 +142,7 @@ _SIG_SET_OP(signotset, _sig_not)
#undef _SIG_SET_OP
#undef _sig_not
-extern inline void sigemptyset(sigset_t *set)
+static inline void sigemptyset(sigset_t *set)
{
switch (_NSIG_WORDS) {
default:
@@ -150,7 +154,7 @@ extern inline void sigemptyset(sigset_t *set)
}
}
-extern inline void sigfillset(sigset_t *set)
+static inline void sigfillset(sigset_t *set)
{
switch (_NSIG_WORDS) {
default:
@@ -166,22 +170,22 @@ extern char * render_sigset_t(sigset_t *set, char *buffer);
/* Some extensions for manipulating the low 32 signals in particular. */
-extern inline void sigaddsetmask(sigset_t *set, unsigned long mask)
+static inline void sigaddsetmask(sigset_t *set, unsigned long mask)
{
set->sig[0] |= mask;
}
-extern inline void sigdelsetmask(sigset_t *set, unsigned long mask)
+static inline void sigdelsetmask(sigset_t *set, unsigned long mask)
{
set->sig[0] &= ~mask;
}
-extern inline int sigtestsetmask(sigset_t *set, unsigned long mask)
+static inline int sigtestsetmask(sigset_t *set, unsigned long mask)
{
return (set->sig[0] & mask) != 0;
}
-extern inline void siginitset(sigset_t *set, unsigned long mask)
+static inline void siginitset(sigset_t *set, unsigned long mask)
{
set->sig[0] = mask;
switch (_NSIG_WORDS) {
@@ -193,7 +197,7 @@ extern inline void siginitset(sigset_t *set, unsigned long mask)
}
}
-extern inline void siginitsetinv(sigset_t *set, unsigned long mask)
+static inline void siginitsetinv(sigset_t *set, unsigned long mask)
{
set->sig[0] = ~mask;
switch (_NSIG_WORDS) {
@@ -207,6 +211,15 @@ extern inline void siginitsetinv(sigset_t *set, unsigned long mask)
#endif /* __HAVE_ARCH_SIG_SETOPS */
+static inline void init_sigpending(struct sigpending *sig)
+{
+ sigemptyset(&sig->signal);
+ sig->head = NULL;
+ sig->tail = &sig->head;
+}
+
+extern long do_sigpending(void *, unsigned long);
+
#endif /* __KERNEL__ */
#endif /* _LINUX_SIGNAL_H */
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 4f4818873..9a6e61025 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -11,7 +11,6 @@
typedef struct kmem_cache_s kmem_cache_t;
-#include <linux/config.h>
#include <linux/mm.h>
#include <linux/cache.h>
@@ -76,14 +75,6 @@ extern kmem_cache_t *bh_cachep;
extern kmem_cache_t *fs_cachep;
extern kmem_cache_t *sigact_cachep;
-#ifdef CONFIG_SMP
-extern unsigned long slab_cache_drain_mask;
-extern void slab_drain_local_cache(void);
-#else
-#define slab_cache_drain_mask 0
-#define slab_drain_local_cache() do { } while (0)
-#endif
-
#endif /* __KERNEL__ */
#endif /* _LINUX_SLAB_H */
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 33e2ee28a..cf20a8bd6 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -10,6 +10,7 @@
#ifdef CONFIG_SMP
+#include <linux/kernel.h>
#include <asm/smp.h>
/*
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 4cc0f16ad..3f8d354bd 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -45,6 +45,7 @@ struct rpc_clnt {
cl_chatty : 1,/* be verbose */
cl_autobind : 1,/* use getport() */
cl_binding : 1,/* doing a getport() */
+ cl_droppriv : 1,/* enable NFS suid hack */
cl_oneshot : 1,/* dispose after use */
cl_dead : 1;/* abandoned */
unsigned int cl_flags; /* misc client flags */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 9226ce0a5..05317e725 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -65,13 +65,16 @@ struct swap_info_struct {
extern int nr_swap_pages;
FASTCALL(unsigned int nr_free_pages(void));
+FASTCALL(unsigned int nr_inactive_clean_pages(void));
FASTCALL(unsigned int nr_free_buffer_pages(void));
-FASTCALL(unsigned int nr_free_highpages(void));
-extern int nr_lru_pages;
+extern int nr_active_pages;
+extern int nr_inactive_dirty_pages;
extern atomic_t nr_async_pages;
extern struct address_space swapper_space;
extern atomic_t page_cache_size;
extern atomic_t buffermem_pages;
+extern spinlock_t pagecache_lock;
+extern void __remove_inode_page(struct page *);
/* Incomplete types for prototype declarations: */
struct task_struct;
@@ -83,9 +86,30 @@ struct zone_t;
extern int shm_swap(int, int);
/* linux/mm/swap.c */
+extern int memory_pressure;
+extern void age_page_up(struct page *);
+extern void age_page_up_nolock(struct page *);
+extern void age_page_down(struct page *);
+extern void age_page_down_nolock(struct page *);
+extern void age_page_down_ageonly(struct page *);
+extern void deactivate_page(struct page *);
+extern void deactivate_page_nolock(struct page *);
+extern void activate_page(struct page *);
+extern void activate_page_nolock(struct page *);
+extern void lru_cache_add(struct page *);
+extern void __lru_cache_del(struct page *);
+extern void lru_cache_del(struct page *);
+extern void recalculate_vm_stats(void);
extern void swap_setup(void);
/* linux/mm/vmscan.c */
+extern struct page * reclaim_page(zone_t *);
+extern wait_queue_head_t kswapd_wait;
+extern wait_queue_head_t kreclaimd_wait;
+extern int page_launder(int, int);
+extern int free_shortage(void);
+extern int inactive_shortage(void);
+extern void wakeup_kswapd(int);
extern int try_to_free_pages(unsigned int gfp_mask);
/* linux/mm/page_io.c */
@@ -161,30 +185,102 @@ static inline int is_page_shared(struct page *page)
extern spinlock_t pagemap_lru_lock;
/*
- * Helper macros for lru_pages handling.
+ * Page aging defines.
+ * Since we do exponential decay of the page age, we
+ * can chose a fairly large maximum.
*/
-#define lru_cache_add(page) \
-do { \
- spin_lock(&pagemap_lru_lock); \
- list_add(&(page)->lru, &lru_cache); \
- nr_lru_pages++; \
- spin_unlock(&pagemap_lru_lock); \
-} while (0)
-
-#define __lru_cache_del(page) \
-do { \
- list_del(&(page)->lru); \
- nr_lru_pages--; \
-} while (0)
-
-#define lru_cache_del(page) \
-do { \
- if (!PageLocked(page)) \
- BUG(); \
- spin_lock(&pagemap_lru_lock); \
- __lru_cache_del(page); \
- spin_unlock(&pagemap_lru_lock); \
-} while (0)
+#define PAGE_AGE_START 2
+#define PAGE_AGE_ADV 3
+#define PAGE_AGE_MAX 64
+
+/*
+ * List add/del helper macros. These must be called
+ * with the pagemap_lru_lock held!
+ */
+#define DEBUG_ADD_PAGE \
+ if (PageActive(page) || PageInactiveDirty(page) || \
+ PageInactiveClean(page)) BUG();
+
+#define ZERO_PAGE_BUG \
+ if (page_count(page) == 0) BUG();
+
+#define add_page_to_active_list(page) { \
+ DEBUG_ADD_PAGE \
+ ZERO_PAGE_BUG \
+ SetPageActive(page); \
+ list_add(&(page)->lru, &active_list); \
+ nr_active_pages++; \
+}
+
+#define add_page_to_inactive_dirty_list(page) { \
+ DEBUG_ADD_PAGE \
+ ZERO_PAGE_BUG \
+ SetPageInactiveDirty(page); \
+ list_add(&(page)->lru, &inactive_dirty_list); \
+ nr_inactive_dirty_pages++; \
+ page->zone->inactive_dirty_pages++; \
+}
+
+#define add_page_to_inactive_clean_list(page) { \
+ DEBUG_ADD_PAGE \
+ ZERO_PAGE_BUG \
+ SetPageInactiveClean(page); \
+ list_add(&(page)->lru, &page->zone->inactive_clean_list); \
+ page->zone->inactive_clean_pages++; \
+}
+
+#define del_page_from_active_list(page) { \
+ list_del(&(page)->lru); \
+ ClearPageActive(page); \
+ nr_active_pages--; \
+ DEBUG_ADD_PAGE \
+ ZERO_PAGE_BUG \
+}
+
+#define del_page_from_inactive_dirty_list(page) { \
+ list_del(&(page)->lru); \
+ ClearPageInactiveDirty(page); \
+ nr_inactive_dirty_pages--; \
+ page->zone->inactive_dirty_pages--; \
+ DEBUG_ADD_PAGE \
+ ZERO_PAGE_BUG \
+}
+
+#define del_page_from_inactive_clean_list(page) { \
+ list_del(&(page)->lru); \
+ ClearPageInactiveClean(page); \
+ page->zone->inactive_clean_pages--; \
+ DEBUG_ADD_PAGE \
+ ZERO_PAGE_BUG \
+}
+
+/*
+ * In mm/swap.c::recalculate_vm_stats(), we substract
+ * inactive_target from memory_pressure every second.
+ * This means that memory_pressure is smoothed over
+ * 64 (1 << INACTIVE_SHIFT) seconds.
+ */
+#define INACTIVE_SHIFT 6
+#define inactive_min(a,b) ((a) < (b) ? (a) : (b))
+#define inactive_target inactive_min((memory_pressure >> INACTIVE_SHIFT), \
+ (num_physpages / 4))
+
+/*
+ * Ugly ugly ugly HACK to make sure the inactive lists
+ * don't fill up with unfreeable ramdisk pages. We really
+ * want to fix the ramdisk driver to mark its pages as
+ * unfreeable instead of using dirty buffer magic, but the
+ * next code-change time is when 2.5 is forked...
+ */
+#ifndef _LINUX_KDEV_T_H
+#include <linux/kdev_t.h>
+#endif
+#ifndef _LINUX_MAJOR_H
+#include <linux/major.h>
+#endif
+
+#define page_ramdisk(page) \
+ (page->buffers && (MAJOR(page->buffers->b_dev) == RAMDISK_MAJOR))
extern spinlock_t swaplock;
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 91913e545..c15bd0e55 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -186,7 +186,8 @@ enum
NET_CORE_MSG_COST=8,
NET_CORE_MSG_BURST=9,
NET_CORE_OPTMEM_MAX=10,
- NET_CORE_HOT_LIST_LENGTH=11
+ NET_CORE_HOT_LIST_LENGTH=11,
+ NET_CORE_DIVERT_VERSION=12
};
/* /proc/sys/net/ethernet */
@@ -512,7 +513,10 @@ enum
FS_NRSUPER=9, /* int:current number of allocated super_blocks */
FS_MAXSUPER=10, /* int:maximum number of super_blocks that can be allocated */
FS_OVERFLOWUID=11, /* int: overflow UID */
- FS_OVERFLOWGID=12 /* int: overflow GID */
+ FS_OVERFLOWGID=12, /* int: overflow GID */
+ FS_LEASES=13, /* int: leases enabled */
+ FS_DIR_NOTIFY=14, /* int: directory notification enabled */
+ FS_LEASE_TIME=15, /* int: maximum time to wait for a lease break */
};
/* CTL_DEBUG names: */
@@ -522,7 +526,8 @@ enum {
DEV_CDROM=1,
DEV_HWMON=2,
DEV_PARPORT=3,
- DEV_RAID=4
+ DEV_RAID=4,
+ DEV_MAC_HID=5
};
/* /proc/sys/dev/cdrom */
@@ -573,6 +578,16 @@ enum {
DEV_PARPORT_DEVICE_TIMESLICE=1,
};
+/* /proc/sys/dev/mac_hid */
+enum {
+ DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1,
+ DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2,
+ DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3,
+ DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4,
+ DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5,
+ DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6
+};
+
#ifdef __KERNEL__
extern asmlinkage long sys_sysctl(struct __sysctl_args *);
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index e030ee09f..89b009e5f 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -125,5 +125,63 @@ enum {
#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
+#define TCP_INFO 11 /* Information about this connection. */
+
+#define TCPI_OPT_TIMESTAMPS 1
+#define TCPI_OPT_SACK 2
+#define TCPI_OPT_WSCALE 4
+#define TCPI_OPT_ECN 8
+
+enum tcp_ca_state
+{
+ TCP_CA_Open = 0,
+#define TCPF_CA_Open (1<<TCP_CA_Open)
+ TCP_CA_Disorder = 1,
+#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
+ TCP_CA_CWR = 2,
+#define TCPF_CA_CWR (1<<TCP_CA_CWR)
+ TCP_CA_Recovery = 3,
+#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
+ TCP_CA_Loss = 4
+#define TCPF_CA_Loss (1<<TCP_CA_Loss)
+};
+
+struct tcp_info
+{
+ __u8 tcpi_state;
+ __u8 tcpi_ca_state;
+ __u8 tcpi_retransmits;
+ __u8 tcpi_probes;
+ __u8 tcpi_backoff;
+ __u8 tcpi_options;
+ __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
+
+ __u32 tcpi_rto;
+ __u32 tcpi_ato;
+ __u32 tcpi_snd_mss;
+ __u32 tcpi_rcv_mss;
+
+ __u32 tcpi_unacked;
+ __u32 tcpi_sacked;
+ __u32 tcpi_lost;
+ __u32 tcpi_retrans;
+ __u32 tcpi_fackets;
+
+ /* Times. */
+ __u32 tcpi_last_data_sent;
+ __u32 tcpi_last_ack_sent; /* Not remembered, sorry. */
+ __u32 tcpi_last_data_recv;
+ __u32 tcpi_last_ack_recv;
+
+ /* Metrics. */
+ __u32 tcpi_pmtu;
+ __u32 tcpi_rcv_ssthresh;
+ __u32 tcpi_rtt;
+ __u32 tcpi_rttvar;
+ __u32 tcpi_snd_ssthresh;
+ __u32 tcpi_snd_cwnd;
+ __u32 tcpi_advmss;
+ __u32 tcpi_reordering;
+};
#endif /* _LINUX_TCP_H */
diff --git a/include/linux/telephony.h b/include/linux/telephony.h
index c3e4c5573..3dd5a969a 100644
--- a/include/linux/telephony.h
+++ b/include/linux/telephony.h
@@ -1,32 +1,33 @@
-/*
- * telephony.h
+/******************************************************************************
+ *
+ * telephony.h
*
- * Basic Linux Telephony Interface
+ * Basic Linux Telephony Interface
*
- * (c) Copyright 1999 Quicknet Technologies, Inc.
+ * (c) Copyright 1999 Quicknet Technologies, Inc.
*
- * 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 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.
*
- * Authors: Ed Okerson, <eokerson@quicknet.net>
- * Greg Herlein, <gherlein@quicknet.net>
+ * Authors: Ed Okerson, <eokerson@quicknet.net>
+ * Greg Herlein, <gherlein@quicknet.net>
*
- * Contributors: Alan Cox, <acox@redhat.com>
- * David Erhart, <derhart@quicknet.net>
+ * Contributors: Alan Cox, <alan@redhat.com>
+ * David W. Erhart, <derhart@quicknet.net>
*
* Version: 0.1.0 - December 19, 1999
*
* Fixes:
- */
+ *
+ *****************************************************************************/
#ifndef TELEPHONY_H
#define TELEPHONY_H
-/* vendor identification numbers */
#define PHONE_VENDOR_IXJ 1
-#define PHONE_VENDOR_QUICKNET PHONE_IXJ
+#define PHONE_VENDOR_QUICKNET PHONE_VENDOR_IXJ
#define PHONE_VENDOR_VOICETRONIX 2
#define PHONE_VENDOR_ACULAB 3
#define PHONE_VENDOR_DIGI 4
@@ -43,7 +44,6 @@
*
*****************************************************************************/
-
/******************************************************************************
*
* The capabilities ioctls can inform you of the capabilities of each phone
@@ -81,11 +81,23 @@ typedef enum {
#define PHONE_CAPABILITIES_LIST _IOR ('q', 0x81, struct phone_capability *)
#define PHONE_CAPABILITIES_CHECK _IOW ('q', 0x82, struct phone_capability *)
+typedef struct {
+ char month[3];
+ char day[3];
+ char hour[3];
+ char min[3];
+ int numlen;
+ char number[11];
+ int namelen;
+ char name[80];
+} PHONE_CID;
+
#define PHONE_RING _IO ('q', 0x83)
#define PHONE_HOOKSTATE _IO ('q', 0x84)
#define PHONE_MAXRINGS _IOW ('q', 0x85, char)
#define PHONE_RING_CADENCE _IOW ('q', 0x86, short)
-#define PHONE_RING_START _IO ('q', 0x87)
+#define OLD_PHONE_RING_START _IO ('q', 0x87)
+#define PHONE_RING_START _IOW ('q', 0x87, PHONE_CID *)
#define PHONE_RING_STOP _IO ('q', 0x88)
#define USA_RING_CADENCE 0xC0C0
@@ -167,6 +179,23 @@ struct phone_codec_data
#define PHONE_QUERY_CODEC _IOWR ('q', 0xA7, struct phone_codec_data *)
#define PHONE_PSTN_LINETEST _IO ('q', 0xA8)
+/******************************************************************************
+*
+* This controls the VAD/CNG functionality of G.723.1. The driver will
+* always pass full size frames, any unused bytes will be padded with zeros,
+* and frames passed to the driver should also be padded with zeros. The
+* frame type is encoded in the least significant two bits of the first
+* WORD of the frame as follows:
+*
+* bits 1-0 Frame Type Data Rate Significant Words
+* 00 0 G.723.1 6.3 12
+* 01 1 G.723.1 5.3 10
+* 10 2 VAD/CNG 2
+* 11 3 Repeat last CNG 2 bits
+*
+******************************************************************************/
+#define PHONE_VAD _IOW ('q', 0xA9, int)
+
/******************************************************************************
*
@@ -198,7 +227,12 @@ struct phone_except
unsigned int f1:1;
unsigned int f2:1;
unsigned int f3:1;
- unsigned int reserved:23;
+ unsigned int flash:1;
+ unsigned int fc0:1;
+ unsigned int fc1:1;
+ unsigned int fc2:1;
+ unsigned int fc3:1;
+ unsigned int reserved:18;
};
union telephony_exception {
diff --git a/include/linux/time.h b/include/linux/time.h
index 53a125a08..87f334547 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -45,7 +45,42 @@ jiffies_to_timespec(unsigned long jiffies, struct timespec *value)
value->tv_nsec = (jiffies % HZ) * (1000000000L / HZ);
value->tv_sec = jiffies / HZ;
}
-
+
+
+/* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
+ * Assumes input in normal date format, i.e. 1980-12-31 23:59:59
+ * => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
+ *
+ * [For the Julian calendar (which was used in Russia before 1917,
+ * Britain & colonies before 1752, anywhere else before 1582,
+ * and is still in use by some communities) leave out the
+ * -year/100+year/400 terms, and add 10.]
+ *
+ * This algorithm was first published by Gauss (I think).
+ *
+ * WARNING: this function will overflow on 2106-02-07 06:28:16 on
+ * machines were long is 32-bit! (However, as time_t is signed, we
+ * will already get problems at other places on 2038-01-19 03:14:08)
+ */
+static inline unsigned long
+mktime (unsigned int year, unsigned int mon,
+ unsigned int day, unsigned int hour,
+ unsigned int min, unsigned int sec)
+{
+ if (0 >= (int) (mon -= 2)) { /* 1..12 -> 11,12,1..10 */
+ mon += 12; /* Puts Feb last since it has leap day */
+ year -= 1;
+ }
+
+ return (((
+ (unsigned long) (year/4 - year/100 + year/400 + 367*mon/12 + day) +
+ year*365 - 719499
+ )*24 + hour /* now have hours */
+ )*60 + min /* now have minutes */
+ )*60 + sec; /* finally seconds */
+}
+
+
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 653009adf..5e8c283da 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -51,6 +51,8 @@
#ifndef _LINUX_TIMEX_H
#define _LINUX_TIMEX_H
+#include <asm/param.h>
+
/*
* The following defines establish the engineering parameters of the PLL
* model. The HZ variable establishes the timer interrupt frequency, 100 Hz
@@ -58,10 +60,20 @@
* OSF/1 kernel. The SHIFT_HZ define expresses the same value as the
* nearest power of two in order to avoid hardware multiply operations.
*/
-#ifdef __alpha__
-# define SHIFT_HZ 10 /* log2(HZ) */
+#if HZ >= 24 && HZ < 48
+# define SHIFT_HZ 5
+#elif HZ >= 48 && HZ < 96
+# define SHIFT_HZ 6
+#elif HZ >= 96 && HZ < 192
+# define SHIFT_HZ 7
+#elif HZ >= 192 && HZ < 384
+# define SHIFT_HZ 8
+#elif HZ >= 384 && HZ < 768
+# define SHIFT_HZ 9
+#elif HZ >= 768 && HZ < 1536
+# define SHIFT_HZ 10
#else
-# define SHIFT_HZ 7 /* log2(HZ) */
+# error You lose.
#endif
/*
diff --git a/include/linux/toshiba.h b/include/linux/toshiba.h
new file mode 100644
index 000000000..8865b6bb1
--- /dev/null
+++ b/include/linux/toshiba.h
@@ -0,0 +1,36 @@
+/* toshiba.h -- Linux driver for accessing the SMM on Toshiba laptops
+ *
+ * Copyright (c) 1996-2000 Jonathan A. Buzzard (jonathan@buzzard.org.uk)
+ *
+ * Thanks to Juergen Heinzl <juergen@monocerus.demon.co.uk> for the pointers
+ * on making sure the structure is aligned and packed.
+ *
+ * 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, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef _LINUX_TOSHIBA_H
+#define _LINUX_TOSHIBA_H
+
+#define TOSH_PROC "/proc/toshiba"
+#define TOSH_DEVICE "/dev/toshiba"
+#define TOSH_SMM _IOWR('t', 0x90, 24)
+
+typedef struct {
+ unsigned int eax;
+ unsigned int ebx __attribute__ ((packed));
+ unsigned int ecx __attribute__ ((packed));
+ unsigned int edx __attribute__ ((packed));
+ unsigned int esi __attribute__ ((packed));
+ unsigned int edi __attribute__ ((packed));
+} SMMRegisters;
+
+#endif
diff --git a/include/linux/tqueue.h b/include/linux/tqueue.h
index 85517135d..3eb8f14ae 100644
--- a/include/linux/tqueue.h
+++ b/include/linux/tqueue.h
@@ -114,7 +114,7 @@ static inline void run_task_queue(task_queue *list)
f = p -> routine;
save_p = p;
p = p -> next;
- mb();
+ smp_mb();
save_p -> sync = 0;
if (f)
(*f)(arg);
diff --git a/include/linux/usb.h b/include/linux/usb.h
index c01871586..bc8d32db4 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -29,6 +29,7 @@
/*
* USB recipients
*/
+#define USB_RECIP_MASK 0x1f
#define USB_RECIP_DEVICE 0x00
#define USB_RECIP_INTERFACE 0x01
#define USB_RECIP_ENDPOINT 0x02
@@ -234,36 +235,36 @@ struct usb_device_descriptor {
/* Endpoint descriptor */
struct usb_endpoint_descriptor {
- __u8 bLength;
- __u8 bDescriptorType;
- __u8 bEndpointAddress;
- __u8 bmAttributes;
- __u16 wMaxPacketSize;
- __u8 bInterval;
- __u8 bRefresh;
- __u8 bSynchAddress;
+ __u8 bLength __attribute__ ((packed));
+ __u8 bDescriptorType __attribute__ ((packed));
+ __u8 bEndpointAddress __attribute__ ((packed));
+ __u8 bmAttributes __attribute__ ((packed));
+ __u16 wMaxPacketSize __attribute__ ((packed));
+ __u8 bInterval __attribute__ ((packed));
+ __u8 bRefresh __attribute__ ((packed));
+ __u8 bSynchAddress __attribute__ ((packed));
unsigned char *extra; /* Extra descriptors */
int extralen;
-} __attribute__ ((packed));
+};
/* Interface descriptor */
struct usb_interface_descriptor {
- __u8 bLength;
- __u8 bDescriptorType;
- __u8 bInterfaceNumber;
- __u8 bAlternateSetting;
- __u8 bNumEndpoints;
- __u8 bInterfaceClass;
- __u8 bInterfaceSubClass;
- __u8 bInterfaceProtocol;
- __u8 iInterface;
+ __u8 bLength __attribute__ ((packed));
+ __u8 bDescriptorType __attribute__ ((packed));
+ __u8 bInterfaceNumber __attribute__ ((packed));
+ __u8 bAlternateSetting __attribute__ ((packed));
+ __u8 bNumEndpoints __attribute__ ((packed));
+ __u8 bInterfaceClass __attribute__ ((packed));
+ __u8 bInterfaceSubClass __attribute__ ((packed));
+ __u8 bInterfaceProtocol __attribute__ ((packed));
+ __u8 iInterface __attribute__ ((packed));
struct usb_endpoint_descriptor *endpoint;
unsigned char *extra; /* Extra descriptors */
int extralen;
-} __attribute__ ((packed));
+};
struct usb_interface {
struct usb_interface_descriptor *altsetting;
@@ -278,20 +279,20 @@ struct usb_interface {
/* Configuration descriptor information.. */
struct usb_config_descriptor {
- __u8 bLength;
- __u8 bDescriptorType;
- __u16 wTotalLength;
- __u8 bNumInterfaces;
- __u8 bConfigurationValue;
- __u8 iConfiguration;
- __u8 bmAttributes;
- __u8 MaxPower;
+ __u8 bLength __attribute__ ((packed));
+ __u8 bDescriptorType __attribute__ ((packed));
+ __u16 wTotalLength __attribute__ ((packed));
+ __u8 bNumInterfaces __attribute__ ((packed));
+ __u8 bConfigurationValue __attribute__ ((packed));
+ __u8 iConfiguration __attribute__ ((packed));
+ __u8 bmAttributes __attribute__ ((packed));
+ __u8 MaxPower __attribute__ ((packed));
struct usb_interface *interface;
unsigned char *extra; /* Extra descriptors */
int extralen;
-} __attribute__ ((packed));
+};
/* String descriptor */
struct usb_string_descriptor {
@@ -345,9 +346,9 @@ typedef int (*usb_device_irq)(int, void *, int, void *);
*/
#define USB_DISABLE_SPD 0x0001
#define USB_ISO_ASAP 0x0002
-#define USB_URB_EARLY_COMPLETE 0x0004
#define USB_ASYNC_UNLINK 0x0008
#define USB_QUEUE_BULK 0x0010
+#define USB_NO_FSBR 0x0020
#define USB_TIMEOUT_KILLED 0x1000 // only set by HCD!
typedef struct
@@ -553,6 +554,7 @@ struct usb_device {
};
extern struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum);
+extern struct usb_endpoint_descriptor *usb_epnum_to_ep_desc(struct usb_device *dev, unsigned epnum);
extern int usb_register(struct usb_driver *);
extern void usb_deregister(struct usb_driver *);
@@ -775,13 +777,13 @@ extern void usbdevfs_cleanup(void);
#else /* CONFIG_USB_DEVICEFS */
-extern inline void usbdevfs_add_bus(struct usb_bus *bus) {}
-extern inline void usbdevfs_remove_bus(struct usb_bus *bus) {}
-extern inline void usbdevfs_add_device(struct usb_device *dev) {}
-extern inline void usbdevfs_remove_device(struct usb_device *dev) {}
+static inline void usbdevfs_add_bus(struct usb_bus *bus) {}
+static inline void usbdevfs_remove_bus(struct usb_bus *bus) {}
+static inline void usbdevfs_add_device(struct usb_device *dev) {}
+static inline void usbdevfs_remove_device(struct usb_device *dev) {}
-extern inline int usbdevfs_init(void) { return 0; }
-extern inline void usbdevfs_cleanup(void) { }
+static inline int usbdevfs_init(void) { return 0; }
+static inline void usbdevfs_cleanup(void) { }
#endif /* CONFIG_USB_DEVICEFS */
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 4ad7577df..487ee8215 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -80,6 +80,7 @@ struct usbdevfs_connectinfo {
#define USBDEVFS_URB_DISABLE_SPD 1
#define USBDEVFS_URB_ISO_ASAP 2
+#define USBDEVFS_URB_QUEUE_BULK 0x10
#define USBDEVFS_URB_TYPE_ISO 0
#define USBDEVFS_URB_TYPE_INTERRUPT 1
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index bba1e159e..f87bd8571 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -26,9 +26,6 @@ extern void vmfree_area_pages(unsigned long address, unsigned long size);
extern int vmalloc_area_pages(unsigned long address, unsigned long size,
int gfp_mask, pgprot_t prot);
-extern struct vm_struct * vmlist;
-
-
/*
* Allocate any pages
*/
diff --git a/include/linux/vt_buffer.h b/include/linux/vt_buffer.h
index 626b2524d..87561dd4e 100644
--- a/include/linux/vt_buffer.h
+++ b/include/linux/vt_buffer.h
@@ -32,7 +32,7 @@
#endif
#ifndef VT_BUF_HAVE_MEMSETW
-extern inline void scr_memsetw(u16 *s, u16 c, unsigned int count)
+static inline void scr_memsetw(u16 *s, u16 c, unsigned int count)
{
count /= 2;
while (count--)
@@ -41,7 +41,7 @@ extern inline void scr_memsetw(u16 *s, u16 c, unsigned int count)
#endif
#ifndef VT_BUF_HAVE_MEMCPYW
-extern inline void scr_memcpyw(u16 *d, const u16 *s, unsigned int count)
+static inline void scr_memcpyw(u16 *d, const u16 *s, unsigned int count)
{
count /= 2;
while (count--)
@@ -50,7 +50,7 @@ extern inline void scr_memcpyw(u16 *d, const u16 *s, unsigned int count)
#endif
#ifndef VT_BUF_HAVE_MEMMOVEW
-extern inline void scr_memmovew(u16 *d, const u16 *s, unsigned int count)
+static inline void scr_memmovew(u16 *d, const u16 *s, unsigned int count)
{
if (d < s)
scr_memcpyw(d, s, count);
@@ -65,14 +65,14 @@ extern inline void scr_memmovew(u16 *d, const u16 *s, unsigned int count)
#endif
#ifndef VT_BUF_HAVE_MEMCPYF
-extern inline void scr_memcpyw_from(u16 *d, const u16 *s, unsigned int count)
+static inline void scr_memcpyw_from(u16 *d, const u16 *s, unsigned int count)
{
count /= 2;
while (count--)
*d++ = scr_readw(s++);
}
-extern inline void scr_memcpyw_to(u16 *d, const u16 *s, unsigned int count)
+static inline void scr_memcpyw_to(u16 *d, const u16 *s, unsigned int count)
{
count /= 2;
while (count--)
diff --git a/include/linux/wait.h b/include/linux/wait.h
index a3687bf53..8629f3241 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -158,7 +158,7 @@ static inline int waitqueue_active(wait_queue_head_t *q)
return !list_empty(&q->task_list);
}
-extern inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
+static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
{
#if WAITQUEUE_DEBUG
if (!head || !new)
@@ -174,7 +174,7 @@ extern inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
/*
* Used for wake-one threads:
*/
-extern inline void __add_wait_queue_tail(wait_queue_head_t *head,
+static inline void __add_wait_queue_tail(wait_queue_head_t *head,
wait_queue_t *new)
{
#if WAITQUEUE_DEBUG
@@ -188,7 +188,7 @@ extern inline void __add_wait_queue_tail(wait_queue_head_t *head,
list_add_tail(&new->task_list, &head->task_list);
}
-extern inline void __remove_wait_queue(wait_queue_head_t *head,
+static inline void __remove_wait_queue(wait_queue_head_t *head,
wait_queue_t *old)
{
#if WAITQUEUE_DEBUG
diff --git a/include/linux/zftape.h b/include/linux/zftape.h
index ec5d2ffe0..b057c6536 100644
--- a/include/linux/zftape.h
+++ b/include/linux/zftape.h
@@ -56,7 +56,7 @@ struct mtblksz {
extern int zft_init(void);
-extern inline __s64 zft_div_blksz(__s64 value, __u32 blk_sz)
+static inline __s64 zft_div_blksz(__s64 value, __u32 blk_sz)
{
if (blk_sz == 1) {
return value;
@@ -66,7 +66,7 @@ extern inline __s64 zft_div_blksz(__s64 value, __u32 blk_sz)
}
}
-extern inline __s64 zft_mul_blksz(__s64 value, __u32 blk_sz)
+static inline __s64 zft_mul_blksz(__s64 value, __u32 blk_sz)
{
if (blk_sz == 1) {
return value;
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 6a5b87ee6..465b452ae 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -87,7 +87,7 @@ extern int ipv6_chk_mcast_addr(struct net_device *dev,
extern void addrconf_prefix_rcv(struct net_device *dev,
u8 *opt, int len);
-extern __inline__ struct inet6_dev *
+static inline struct inet6_dev *
__in6_dev_get(struct net_device *dev)
{
return (struct inet6_dev *)dev->ip6_ptr;
@@ -95,7 +95,7 @@ __in6_dev_get(struct net_device *dev)
extern rwlock_t addrconf_lock;
-extern __inline__ struct inet6_dev *
+static inline struct inet6_dev *
in6_dev_get(struct net_device *dev)
{
struct inet6_dev *idev = NULL;
@@ -109,7 +109,7 @@ in6_dev_get(struct net_device *dev)
extern void in6_dev_finish_destroy(struct inet6_dev *idev);
-extern __inline__ void
+static inline void
in6_dev_put(struct inet6_dev *idev)
{
if (atomic_dec_and_test(&idev->refcnt))
@@ -122,7 +122,7 @@ in6_dev_put(struct inet6_dev *idev)
extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp);
-extern __inline__ void in6_ifa_put(struct inet6_ifaddr *ifp)
+static inline void in6_ifa_put(struct inet6_ifaddr *ifp)
{
if (atomic_dec_and_test(&ifp->refcnt))
inet6_ifa_finish_destroy(ifp);
@@ -157,7 +157,7 @@ static __inline__ u8 ipv6_addr_hash(struct in6_addr *addr)
* compute link-local solicited-node multicast address
*/
-extern __inline__ void addrconf_addr_solict_mult_old(struct in6_addr *addr,
+static inline void addrconf_addr_solict_mult_old(struct in6_addr *addr,
struct in6_addr *solicited)
{
ipv6_addr_set(solicited,
@@ -165,7 +165,7 @@ extern __inline__ void addrconf_addr_solict_mult_old(struct in6_addr *addr,
__constant_htonl(0x1), addr->s6_addr32[3]);
}
-extern __inline__ void addrconf_addr_solict_mult_new(struct in6_addr *addr,
+static inline void addrconf_addr_solict_mult_new(struct in6_addr *addr,
struct in6_addr *solicited)
{
ipv6_addr_set(solicited,
@@ -175,21 +175,21 @@ extern __inline__ void addrconf_addr_solict_mult_new(struct in6_addr *addr,
}
-extern __inline__ void ipv6_addr_all_nodes(struct in6_addr *addr)
+static inline void ipv6_addr_all_nodes(struct in6_addr *addr)
{
ipv6_addr_set(addr,
__constant_htonl(0xFF020000), 0, 0,
__constant_htonl(0x1));
}
-extern __inline__ void ipv6_addr_all_routers(struct in6_addr *addr)
+static inline void ipv6_addr_all_routers(struct in6_addr *addr)
{
ipv6_addr_set(addr,
__constant_htonl(0xFF020000), 0, 0,
__constant_htonl(0x2));
}
-extern __inline__ int ipv6_addr_is_multicast(struct in6_addr *addr)
+static inline int ipv6_addr_is_multicast(struct in6_addr *addr)
{
return (addr->s6_addr32[0] & __constant_htonl(0xFF000000)) == __constant_htonl(0xFF000000);
}
diff --git a/include/net/checksum.h b/include/net/checksum.h
index 6793f196f..76cf27e77 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -93,7 +93,7 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
#endif
#ifndef _HAVE_ARCH_COPY_AND_CSUM_FROM_USER
-extern __inline__
+static inline
unsigned int csum_and_copy_from_user (const char *src, char *dst,
int len, int sum, int *err_ptr)
{
diff --git a/include/net/dn_route.h b/include/net/dn_route.h
index 7c7d3dd0e..30ec0d245 100644
--- a/include/net/dn_route.h
+++ b/include/net/dn_route.h
@@ -91,12 +91,12 @@ extern void dn_route_cleanup(void);
#include <net/sock.h>
#include <linux/if_arp.h>
-extern __inline__ void dn_rt_send(struct sk_buff *skb)
+static inline void dn_rt_send(struct sk_buff *skb)
{
dev_queue_xmit(skb);
}
-extern __inline__ void dn_rt_finish_output(struct sk_buff *skb, char *dst)
+static inline void dn_rt_finish_output(struct sk_buff *skb, char *dst)
{
struct net_device *dev = skb->dev;
@@ -110,7 +110,7 @@ extern __inline__ void dn_rt_finish_output(struct sk_buff *skb, char *dst)
kfree_skb(skb);
}
-extern __inline__ void dn_nsp_send(struct sk_buff *skb)
+static inline void dn_nsp_send(struct sk_buff *skb)
{
struct sock *sk = skb->sk;
struct dn_scp *scp = &sk->protinfo.dn;
diff --git a/include/net/dsfield.h b/include/net/dsfield.h
index 778b6baea..80bb84c7c 100644
--- a/include/net/dsfield.h
+++ b/include/net/dsfield.h
@@ -12,19 +12,19 @@
#include <asm/byteorder.h>
-extern __inline__ __u8 ipv4_get_dsfield(struct iphdr *iph)
+static inline __u8 ipv4_get_dsfield(struct iphdr *iph)
{
return iph->tos;
}
-extern __inline__ __u8 ipv6_get_dsfield(struct ipv6hdr *ipv6h)
+static inline __u8 ipv6_get_dsfield(struct ipv6hdr *ipv6h)
{
return ntohs(*(__u16 *) ipv6h) >> 4;
}
-extern __inline__ void ipv4_change_dsfield(struct iphdr *iph,__u8 mask,
+static inline void ipv4_change_dsfield(struct iphdr *iph,__u8 mask,
__u8 value)
{
__u32 check = ntohs(iph->check);
@@ -40,7 +40,7 @@ extern __inline__ void ipv4_change_dsfield(struct iphdr *iph,__u8 mask,
}
-extern __inline__ void ipv6_change_dsfield(struct ipv6hdr *ipv6h,__u8 mask,
+static inline void ipv6_change_dsfield(struct ipv6hdr *ipv6h,__u8 mask,
__u8 value)
{
__u16 tmp;
@@ -53,7 +53,7 @@ extern __inline__ void ipv6_change_dsfield(struct ipv6hdr *ipv6h,__u8 mask,
#if 0 /* put this later into asm-i386 or such ... */
-extern __inline__ void ip_change_dsfield(struct iphdr *iph,__u16 dsfield)
+static inline void ip_change_dsfield(struct iphdr *iph,__u16 dsfield)
{
__u16 check;
diff --git a/include/net/dst.h b/include/net/dst.h
index 253d72a22..d81eb07bb 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -88,12 +88,12 @@ struct dst_ops
#ifdef __KERNEL__
-extern __inline__ void dst_hold(struct dst_entry * dst)
+static inline void dst_hold(struct dst_entry * dst)
{
atomic_inc(&dst->__refcnt);
}
-extern __inline__
+static inline
struct dst_entry * dst_clone(struct dst_entry * dst)
{
if (dst)
@@ -101,7 +101,7 @@ struct dst_entry * dst_clone(struct dst_entry * dst)
return dst;
}
-extern __inline__
+static inline
void dst_release(struct dst_entry * dst)
{
if (dst)
@@ -112,7 +112,7 @@ extern void * dst_alloc(struct dst_ops * ops);
extern void __dst_free(struct dst_entry * dst);
extern void dst_destroy(struct dst_entry * dst);
-extern __inline__
+static inline
void dst_free(struct dst_entry * dst)
{
if (dst->obsolete > 1)
@@ -124,27 +124,27 @@ void dst_free(struct dst_entry * dst)
__dst_free(dst);
}
-extern __inline__ void dst_confirm(struct dst_entry *dst)
+static inline void dst_confirm(struct dst_entry *dst)
{
if (dst)
neigh_confirm(dst->neighbour);
}
-extern __inline__ void dst_negative_advice(struct dst_entry **dst_p)
+static inline void dst_negative_advice(struct dst_entry **dst_p)
{
struct dst_entry * dst = *dst_p;
if (dst && dst->ops->negative_advice)
*dst_p = dst->ops->negative_advice(dst);
}
-extern __inline__ void dst_link_failure(struct sk_buff *skb)
+static inline void dst_link_failure(struct sk_buff *skb)
{
struct dst_entry * dst = skb->dst;
if (dst && dst->ops && dst->ops->link_failure)
dst->ops->link_failure(skb);
}
-extern __inline__ void dst_set_expires(struct dst_entry *dst, int timeout)
+static inline void dst_set_expires(struct dst_entry *dst, int timeout)
{
unsigned long expires = jiffies + timeout;
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 2ea636834..921268e00 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -108,7 +108,7 @@ struct inet6_dev
extern struct ipv6_devconf ipv6_devconf;
-extern __inline__ void ipv6_eth_mc_map(struct in6_addr *addr, char *buf)
+static inline void ipv6_eth_mc_map(struct in6_addr *addr, char *buf)
{
/*
* +-------+-------+-------+-------+-------+-------+
@@ -122,7 +122,7 @@ extern __inline__ void ipv6_eth_mc_map(struct in6_addr *addr, char *buf)
memcpy(buf + 2, &addr->s6_addr32[3], sizeof(__u32));
}
-extern __inline__ void ipv6_tr_mc_map(struct in6_addr *addr, char *buf)
+static inline void ipv6_tr_mc_map(struct in6_addr *addr, char *buf)
{
/* All nodes FF01::1, FF02::1, FF02::1:FFxx:xxxx */
diff --git a/include/net/ip.h b/include/net/ip.h
index 45a85abfe..1ba956ac8 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -115,7 +115,7 @@ extern int ip_build_xmit(struct sock *sk,
* multicast packets.
*/
-extern __inline__ void ip_tr_mc_map(u32 addr, char *buf)
+static inline void ip_tr_mc_map(u32 addr, char *buf)
{
buf[0]=0xC0;
buf[1]=0x00;
@@ -159,7 +159,7 @@ extern int sysctl_local_port_range[2];
extern int sysctl_ip_default_ttl;
#ifdef CONFIG_INET
-extern __inline__ int ip_send(struct sk_buff *skb)
+static inline int ip_send(struct sk_buff *skb)
{
if (skb->len > skb->dst->pmtu)
return ip_fragment(skb, ip_finish_output);
@@ -169,7 +169,7 @@ extern __inline__ int ip_send(struct sk_buff *skb)
/* The function in 2.2 was invalid, producing wrong result for
* check=0xFEFF. It was noticed by Arthur Skawina _year_ ago. --ANK(000625) */
-extern __inline__
+static inline
int ip_decrease_ttl(struct iphdr *iph)
{
u32 check = iph->check;
@@ -178,7 +178,7 @@ int ip_decrease_ttl(struct iphdr *iph)
return --iph->ttl;
}
-extern __inline__
+static inline
int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
{
return (sk->protinfo.af_inet.pmtudisc == IP_PMTUDISC_DO ||
@@ -188,7 +188,7 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst);
-extern __inline__ void ip_select_ident(struct iphdr *iph, struct dst_entry *dst)
+static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst)
{
if (iph->frag_off&__constant_htons(IP_DF))
iph->id = 0;
@@ -200,7 +200,7 @@ extern __inline__ void ip_select_ident(struct iphdr *iph, struct dst_entry *dst)
* Map a multicast IP onto multicast MAC for type ethernet.
*/
-extern __inline__ void ip_eth_mc_map(u32 addr, char *buf)
+static inline void ip_eth_mc_map(u32 addr, char *buf)
{
addr=ntohl(addr);
buf[0]=0x01;
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index e07802554..f8d382f4e 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -96,7 +96,7 @@ struct fib6_walker_t
extern struct fib6_walker_t fib6_walker_list;
extern rwlock_t fib6_walker_lock;
-extern __inline__ void fib6_walker_link(struct fib6_walker_t *w)
+static inline void fib6_walker_link(struct fib6_walker_t *w)
{
write_lock_bh(&fib6_walker_lock);
w->next = fib6_walker_list.next;
@@ -106,7 +106,7 @@ extern __inline__ void fib6_walker_link(struct fib6_walker_t *w)
write_unlock_bh(&fib6_walker_lock);
}
-extern __inline__ void fib6_walker_unlink(struct fib6_walker_t *w)
+static inline void fib6_walker_unlink(struct fib6_walker_t *w)
{
write_lock_bh(&fib6_walker_lock);
w->next->prev = w->prev;
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index cd6097d45..2ea9eefcb 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -94,7 +94,7 @@ extern rwlock_t rt6_lock;
* For UDP/RAW sockets this is done on udp_connect.
*/
-extern __inline__ void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
+static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
struct in6_addr *daddr)
{
struct ipv6_pinfo *np = &sk->net_pinfo.af_inet6;
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index afcec35f6..804f34927 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -140,19 +140,19 @@ struct fib_table
extern struct fib_table *local_table;
extern struct fib_table *main_table;
-extern __inline__ struct fib_table *fib_get_table(int id)
+static inline struct fib_table *fib_get_table(int id)
{
if (id != RT_TABLE_LOCAL)
return main_table;
return local_table;
}
-extern __inline__ struct fib_table *fib_new_table(int id)
+static inline struct fib_table *fib_new_table(int id)
{
return fib_get_table(id);
}
-extern __inline__ int fib_lookup(const struct rt_key *key, struct fib_result *res)
+static inline int fib_lookup(const struct rt_key *key, struct fib_result *res)
{
if (local_table->tb_lookup(local_table, key, res) &&
main_table->tb_lookup(main_table, key, res))
@@ -160,7 +160,7 @@ extern __inline__ int fib_lookup(const struct rt_key *key, struct fib_result *re
return 0;
}
-extern __inline__ void fib_select_default(const struct rt_key *key, struct fib_result *res)
+static inline void fib_select_default(const struct rt_key *key, struct fib_result *res)
{
if (FIB_RES_GW(*res) && FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK)
main_table->tb_select_default(main_table, key, res);
@@ -175,7 +175,7 @@ extern int fib_lookup(const struct rt_key *key, struct fib_result *res);
extern struct fib_table *__fib_new_table(int id);
extern void fib_rule_put(struct fib_rule *r);
-extern __inline__ struct fib_table *fib_get_table(int id)
+static inline struct fib_table *fib_get_table(int id)
{
if (id == 0)
id = RT_TABLE_MAIN;
@@ -183,7 +183,7 @@ extern __inline__ struct fib_table *fib_get_table(int id)
return fib_tables[id];
}
-extern __inline__ struct fib_table *fib_new_table(int id)
+static inline struct fib_table *fib_new_table(int id)
{
if (id == 0)
id = RT_TABLE_MAIN;
@@ -241,7 +241,7 @@ extern u32 fib_rules_policy(u32 saddr, struct fib_result *res, unsigned *flags);
extern void fib_rules_init(void);
#endif
-extern __inline__ void fib_combine_itag(u32 *itag, struct fib_result *res)
+static inline void fib_combine_itag(u32 *itag, struct fib_result *res)
{
#ifdef CONFIG_NET_CLS_ROUTE
#ifdef CONFIG_IP_MULTIPLE_TABLES
@@ -259,13 +259,13 @@ extern __inline__ void fib_combine_itag(u32 *itag, struct fib_result *res)
extern void free_fib_info(struct fib_info *fi);
-extern __inline__ void fib_info_put(struct fib_info *fi)
+static inline void fib_info_put(struct fib_info *fi)
{
if (atomic_dec_and_test(&fi->fib_clntref))
free_fib_info(fi);
}
-extern __inline__ void fib_res_put(struct fib_result *res)
+static inline void fib_res_put(struct fib_result *res)
{
if (res->fi)
fib_info_put(res->fi);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 235ae404d..60708b5ee 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -4,7 +4,7 @@
* Authors:
* Pedro Roque <roque@di.fc.ul.pt>
*
- * $Id: ipv6.h,v 1.21 2000/07/07 22:29:42 davem Exp $
+ * $Id: ipv6.h,v 1.22 2000/09/18 05:54:13 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -169,7 +169,7 @@ extern int ipv6_flowlabel_opt(struct sock *sk, char *optval, int optlen);
extern void ip6_flowlabel_init(void);
extern void ip6_flowlabel_cleanup(void);
-extern __inline__ void fl6_sock_release(struct ip6_flowlabel *fl)
+static inline void fl6_sock_release(struct ip6_flowlabel *fl)
{
if (fl)
atomic_dec(&fl->users);
@@ -206,23 +206,23 @@ typedef int (*inet_getfrag_t) (const void *data,
extern int ipv6_addr_type(struct in6_addr *addr);
-extern __inline__ int ipv6_addr_scope(struct in6_addr *addr)
+static inline int ipv6_addr_scope(struct in6_addr *addr)
{
return ipv6_addr_type(addr) & IPV6_ADDR_SCOPE_MASK;
}
-extern __inline__ int ipv6_addr_cmp(struct in6_addr *a1, struct in6_addr *a2)
+static inline int ipv6_addr_cmp(struct in6_addr *a1, struct in6_addr *a2)
{
return memcmp((void *) a1, (void *) a2, sizeof(struct in6_addr));
}
-extern __inline__ void ipv6_addr_copy(struct in6_addr *a1, struct in6_addr *a2)
+static inline void ipv6_addr_copy(struct in6_addr *a1, struct in6_addr *a2)
{
memcpy((void *) a1, (void *) a2, sizeof(struct in6_addr));
}
#ifndef __HAVE_ARCH_ADDR_SET
-extern __inline__ void ipv6_addr_set(struct in6_addr *addr,
+static inline void ipv6_addr_set(struct in6_addr *addr,
__u32 w1, __u32 w2,
__u32 w3, __u32 w4)
{
@@ -233,7 +233,7 @@ extern __inline__ void ipv6_addr_set(struct in6_addr *addr,
}
#endif
-extern __inline__ int ipv6_addr_any(struct in6_addr *a)
+static inline int ipv6_addr_any(struct in6_addr *a)
{
return ((a->s6_addr32[0] | a->s6_addr32[1] |
a->s6_addr32[2] | a->s6_addr32[3] ) == 0);
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index d4f99ff72..1ef3341cd 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -101,7 +101,7 @@ extern int igmp6_event_report(struct sk_buff *skb,
extern void igmp6_cleanup(void);
-extern __inline__ struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr)
+static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr)
{
if (dev)
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index c8490705f..1a60139a3 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -212,13 +212,13 @@ extern void neigh_sysctl_unregister(struct neigh_parms *p);
* Neighbour references
*/
-extern __inline__ void neigh_release(struct neighbour *neigh)
+static inline void neigh_release(struct neighbour *neigh)
{
if (atomic_dec_and_test(&neigh->refcnt))
neigh_destroy(neigh);
}
-extern __inline__ struct neighbour * neigh_clone(struct neighbour *neigh)
+static inline struct neighbour * neigh_clone(struct neighbour *neigh)
{
if (neigh)
atomic_inc(&neigh->refcnt);
@@ -227,23 +227,23 @@ extern __inline__ struct neighbour * neigh_clone(struct neighbour *neigh)
#define neigh_hold(n) atomic_inc(&(n)->refcnt)
-extern __inline__ void neigh_confirm(struct neighbour *neigh)
+static inline void neigh_confirm(struct neighbour *neigh)
{
if (neigh)
neigh->confirmed = jiffies;
}
-extern __inline__ int neigh_is_connected(struct neighbour *neigh)
+static inline int neigh_is_connected(struct neighbour *neigh)
{
return neigh->nud_state&NUD_CONNECTED;
}
-extern __inline__ int neigh_is_valid(struct neighbour *neigh)
+static inline int neigh_is_valid(struct neighbour *neigh)
{
return neigh->nud_state&NUD_VALID;
}
-extern __inline__ int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
+static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
{
neigh->used = jiffies;
if (!(neigh->nud_state&(NUD_CONNECTED|NUD_DELAY|NUD_PROBE)))
@@ -251,7 +251,7 @@ extern __inline__ int neigh_event_send(struct neighbour *neigh, struct sk_buff *
return 0;
}
-extern __inline__ struct neighbour *
+static inline struct neighbour *
__neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat)
{
struct neighbour *n = neigh_lookup(tbl, pkey, dev);
@@ -263,7 +263,7 @@ __neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev
return IS_ERR(n) ? NULL : n;
}
-extern __inline__ struct neighbour *
+static inline struct neighbour *
__neigh_lookup_errno(struct neigh_table *tbl, const void *pkey,
struct net_device *dev)
{
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index f9c80dd0f..cb2bde236 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -63,7 +63,7 @@ struct tcf_proto_ops
specific classifiers.
*/
-extern __inline__ int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, struct tcf_result *res)
+static inline int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, struct tcf_result *res)
{
int err = 0;
u32 protocol = skb->protocol;
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 2089faac1..58aa70d2c 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -104,32 +104,32 @@ struct qdisc_rate_table
int refcnt;
};
-extern __inline__ void sch_tree_lock(struct Qdisc *q)
+static inline void sch_tree_lock(struct Qdisc *q)
{
write_lock(&qdisc_tree_lock);
spin_lock_bh(&q->dev->queue_lock);
}
-extern __inline__ void sch_tree_unlock(struct Qdisc *q)
+static inline void sch_tree_unlock(struct Qdisc *q)
{
spin_unlock_bh(&q->dev->queue_lock);
write_unlock(&qdisc_tree_lock);
}
-extern __inline__ void tcf_tree_lock(struct tcf_proto *tp)
+static inline void tcf_tree_lock(struct tcf_proto *tp)
{
write_lock(&qdisc_tree_lock);
spin_lock_bh(&tp->q->dev->queue_lock);
}
-extern __inline__ void tcf_tree_unlock(struct tcf_proto *tp)
+static inline void tcf_tree_unlock(struct tcf_proto *tp)
{
spin_unlock_bh(&tp->q->dev->queue_lock);
write_unlock(&qdisc_tree_lock);
}
-extern __inline__ unsigned long
+static inline unsigned long
cls_set_class(struct tcf_proto *tp, unsigned long *clp, unsigned long cl)
{
unsigned long old_cl;
@@ -141,7 +141,7 @@ cls_set_class(struct tcf_proto *tp, unsigned long *clp, unsigned long cl)
return old_cl;
}
-extern __inline__ unsigned long
+static inline unsigned long
__cls_set_class(unsigned long *clp, unsigned long cl)
{
unsigned long old_cl;
@@ -401,7 +401,7 @@ extern struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *
extern int tcf_police_dump(struct sk_buff *skb, struct tcf_police *p);
extern int tcf_police(struct sk_buff *skb, struct tcf_police *p);
-extern __inline__ void tcf_police_release(struct tcf_police *p)
+static inline void tcf_police_release(struct tcf_police *p)
{
if (p && --p->refcnt == 0)
tcf_police_destroy(p);
@@ -433,7 +433,7 @@ int pktsched_init(void);
extern int qdisc_restart(struct net_device *dev);
-extern __inline__ void qdisc_run(struct net_device *dev)
+static inline void qdisc_run(struct net_device *dev)
{
while (!netif_queue_stopped(dev) &&
qdisc_restart(dev)<0)
@@ -443,7 +443,7 @@ extern __inline__ void qdisc_run(struct net_device *dev)
/* Calculate maximal size of packet seen by hard_start_xmit
routine of this device.
*/
-extern __inline__ unsigned psched_mtu(struct net_device *dev)
+static inline unsigned psched_mtu(struct net_device *dev)
{
unsigned mtu = dev->mtu;
return dev->hard_header ? mtu + dev->hard_header_len : mtu;
diff --git a/include/net/profile.h b/include/net/profile.h
index ebba04ae9..5393f0d04 100644
--- a/include/net/profile.h
+++ b/include/net/profile.h
@@ -31,12 +31,12 @@ extern void net_profile_irq_adjust(struct timeval *entered, struct timeval* leav
#ifdef CONFIG_X86_TSC
-extern __inline__ void net_profile_stamp(struct timeval *pstamp)
+static inline void net_profile_stamp(struct timeval *pstamp)
{
rdtsc(pstamp->tv_usec, pstamp->tv_sec);
}
-extern __inline__ void net_profile_accumulate(struct timeval *entered,
+static inline void net_profile_accumulate(struct timeval *entered,
struct timeval *leaved,
struct timeval *acc)
{
@@ -52,7 +52,7 @@ extern __inline__ void net_profile_accumulate(struct timeval *entered,
"0" (acc->tv_usec), "1" (acc->tv_sec));
}
-extern __inline__ void net_profile_sub(struct timeval *sub,
+static inline void net_profile_sub(struct timeval *sub,
struct timeval *acc)
{
__asm__ __volatile__ ("subl %2,%0\n\t"
@@ -62,7 +62,7 @@ extern __inline__ void net_profile_sub(struct timeval *sub,
"0" (acc->tv_usec), "1" (acc->tv_sec));
}
-extern __inline__ void net_profile_add(struct timeval *add,
+static inline void net_profile_add(struct timeval *add,
struct timeval *acc)
{
__asm__ __volatile__ ("addl %2,%0\n\t"
@@ -80,7 +80,7 @@ extern long alpha_hi;
/* On alpha cycle counter has only 32 bits :-( :-( */
-extern __inline__ void net_profile_stamp(struct timeval *pstamp)
+static inline void net_profile_stamp(struct timeval *pstamp)
{
__u32 result;
__asm__ __volatile__ ("rpcc %0" : "r="(result));
@@ -91,7 +91,7 @@ extern __inline__ void net_profile_stamp(struct timeval *pstamp)
pstamp->tv_usec = alpha_lo;
}
-extern __inline__ void net_profile_accumulate(struct timeval *entered,
+static inline void net_profile_accumulate(struct timeval *entered,
struct timeval *leaved,
struct timeval *acc)
{
@@ -113,7 +113,7 @@ extern __inline__ void net_profile_accumulate(struct timeval *entered,
acc->tv_usec = usecs;
}
-extern __inline__ void net_profile_sub(struct timeval *entered,
+static inline void net_profile_sub(struct timeval *entered,
struct timeval *leaved)
{
time_t usecs = leaved->tv_usec - entered->tv_usec;
@@ -127,7 +127,7 @@ extern __inline__ void net_profile_sub(struct timeval *entered,
leaved->tv_usec = usecs;
}
-extern __inline__ void net_profile_add(struct timeval *entered, struct timeval *leaved)
+static inline void net_profile_add(struct timeval *entered, struct timeval *leaved)
{
time_t usecs = leaved->tv_usec + entered->tv_usec;
time_t secs = leaved->tv_sec + entered->tv_sec;
@@ -143,18 +143,18 @@ extern __inline__ void net_profile_add(struct timeval *entered, struct timeval
#else
-extern __inline__ void net_profile_stamp(struct timeval *pstamp)
+static inline void net_profile_stamp(struct timeval *pstamp)
{
/* Not "fast" counterpart! On architectures without
cpu clock "fast" routine is absolutely useless in this
situation. do_gettimeofday still says something on slow-slow-slow
- boxes, though it eats more cpu time than the sobject of
+ boxes, though it eats more cpu time than the subject of
investigation :-) :-)
*/
do_gettimeofday(pstamp);
}
-extern __inline__ void net_profile_accumulate(struct timeval *entered,
+static inline void net_profile_accumulate(struct timeval *entered,
struct timeval *leaved,
struct timeval *acc)
{
@@ -176,7 +176,7 @@ extern __inline__ void net_profile_accumulate(struct timeval *entered,
acc->tv_usec = usecs;
}
-extern __inline__ void net_profile_sub(struct timeval *entered,
+static inline void net_profile_sub(struct timeval *entered,
struct timeval *leaved)
{
time_t usecs = leaved->tv_usec - entered->tv_usec;
@@ -190,7 +190,7 @@ extern __inline__ void net_profile_sub(struct timeval *entered,
leaved->tv_usec = usecs;
}
-extern __inline__ void net_profile_add(struct timeval *entered, struct timeval *leaved)
+static inline void net_profile_add(struct timeval *entered, struct timeval *leaved)
{
time_t usecs = leaved->tv_usec + entered->tv_usec;
time_t secs = leaved->tv_sec + entered->tv_sec;
@@ -207,7 +207,7 @@ extern __inline__ void net_profile_add(struct timeval *entered, struct timeval
#endif
-extern __inline__ void net_profile_enter(struct net_profile_slot *s)
+static inline void net_profile_enter(struct net_profile_slot *s)
{
unsigned long flags;
@@ -220,7 +220,7 @@ extern __inline__ void net_profile_enter(struct net_profile_slot *s)
restore_flags(flags);
}
-extern __inline__ void net_profile_leave_irq(struct net_profile_slot *s)
+static inline void net_profile_leave_irq(struct net_profile_slot *s)
{
unsigned long flags;
@@ -241,7 +241,7 @@ extern __inline__ void net_profile_leave_irq(struct net_profile_slot *s)
restore_flags(flags);
}
-extern __inline__ void net_profile_leave(struct net_profile_slot *s)
+static inline void net_profile_leave(struct net_profile_slot *s)
{
unsigned long flags;
save_flags(flags);
diff --git a/include/net/route.h b/include/net/route.h
index 20536ca63..f6ce04008 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -94,12 +94,13 @@ struct ip_rt_acct
extern struct ip_rt_acct *ip_rt_acct;
+struct in_device;
extern void ip_rt_init(void);
extern void ip_rt_redirect(u32 old_gw, u32 dst, u32 new_gw,
u32 src, u8 tos, struct net_device *dev);
extern void ip_rt_advice(struct rtable **rp, int advice);
extern void rt_cache_flush(int how);
-extern int ip_route_output(struct rtable **, u32 dst, u32 src, u32 tos, int oif);
+extern int ip_route_output_key(struct rtable **, const struct rt_key *key);
extern int ip_route_input(struct sk_buff*, u32 dst, u32 src, u8 tos, struct net_device *devin);
extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu);
extern void ip_rt_update_pmtu(struct dst_entry *dst, unsigned mtu);
@@ -111,8 +112,17 @@ extern int ip_rt_ioctl(unsigned int cmd, void *arg);
extern void ip_rt_get_source(u8 *src, struct rtable *rt);
extern int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb);
+/* Deprecated: use ip_route_output_key directly */
+static inline int ip_route_output(struct rtable **rp,
+ u32 daddr, u32 saddr, u32 tos, int oif)
+{
+ struct rt_key key = { dst:daddr, src:saddr, oif:oif, tos:tos };
+
+ return ip_route_output_key(rp, &key);
+}
+
-extern __inline__ void ip_rt_put(struct rtable * rt)
+static inline void ip_rt_put(struct rtable * rt)
{
if (rt)
dst_release(&rt->u.dst);
@@ -127,12 +137,12 @@ extern __inline__ void ip_rt_put(struct rtable * rt)
extern __u8 ip_tos2prio[16];
-extern __inline__ char rt_tos2priority(u8 tos)
+static inline char rt_tos2priority(u8 tos)
{
return ip_tos2prio[IPTOS_TOS(tos)>>1];
}
-extern __inline__ int ip_route_connect(struct rtable **rp, u32 dst, u32 src, u32 tos, int oif)
+static inline int ip_route_connect(struct rtable **rp, u32 dst, u32 src, u32 tos, int oif)
{
int err;
err = ip_route_output(rp, dst, src, tos, oif);
@@ -147,7 +157,7 @@ extern __inline__ int ip_route_connect(struct rtable **rp, u32 dst, u32 src, u32
extern void rt_bind_peer(struct rtable *rt, int create);
-extern __inline__ struct inet_peer *rt_get_peer(struct rtable *rt)
+static inline struct inet_peer *rt_get_peer(struct rtable *rt)
{
if (rt->peer)
return rt->peer;
diff --git a/include/net/snmp.h b/include/net/snmp.h
index 2bd127299..03b0dfa99 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -14,17 +14,34 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
+ * $Id: snmp.h,v 1.17 2000/09/21 01:31:50 davem Exp $
+ *
*/
#ifndef _SNMP_H
#define _SNMP_H
+
+#include <linux/cache.h>
/*
* We use all unsigned longs. Linux will soon be so reliable that even these
* will rapidly get too small 8-). Seriously consider the IpInReceives count
* on the 20Gb/s + networks people expect in a few years time!
*/
-
+
+/*
+ * The rule for padding:
+ * Best is power of two because then the right structure can be found by a simple
+ * shift. The structure should be always cache line aligned.
+ * gcc needs n=alignto(cachelinesize, popcnt(sizeof(bla_mib))) shift/add instructions
+ * to emulate multiply in case it is not power-of-two. Currently n is always <=3 for
+ * all sizes so simple cache line alignment is enough.
+ *
+ * The best solution would be a global CPU local area , especially on 64 and 128byte
+ * cacheline machine it makes a *lot* of sense -AK
+ */
+
+
struct ip_mib
{
unsigned long IpInReceives;
@@ -44,8 +61,8 @@ struct ip_mib
unsigned long IpFragOKs;
unsigned long IpFragFails;
unsigned long IpFragCreates;
- unsigned long __pad[32-19];
-};
+ unsigned long __pad[0];
+} ____cacheline_aligned;
struct ipv6_mib
{
@@ -71,8 +88,8 @@ struct ipv6_mib
unsigned long Ip6FragCreates;
unsigned long Ip6InMcastPkts;
unsigned long Ip6OutMcastPkts;
- unsigned long __pad[32-22];
-};
+ unsigned long __pad[0];
+} ____cacheline_aligned;
struct icmp_mib
{
@@ -102,8 +119,8 @@ struct icmp_mib
unsigned long IcmpOutTimestampReps;
unsigned long IcmpOutAddrMasks;
unsigned long IcmpOutAddrMaskReps;
- unsigned long __pad[32-26];
-};
+ unsigned long __pad[0];
+} ____cacheline_aligned;
struct icmpv6_mib
{
@@ -140,8 +157,8 @@ struct icmpv6_mib
unsigned long Icmp6OutRedirects;
unsigned long Icmp6OutGroupMembResponses;
unsigned long Icmp6OutGroupMembReductions;
- unsigned long __pad[32-28];
-};
+ unsigned long __pad[0];
+} ____cacheline_aligned;
struct tcp_mib
{
@@ -159,8 +176,8 @@ struct tcp_mib
unsigned long TcpRetransSegs;
unsigned long TcpInErrs;
unsigned long TcpOutRsts;
- unsigned long __pad[16-14];
-};
+ unsigned long __pad[0];
+} ____cacheline_aligned;
struct udp_mib
{
@@ -168,8 +185,8 @@ struct udp_mib
unsigned long UdpNoPorts;
unsigned long UdpInErrors;
unsigned long UdpOutDatagrams;
- unsigned long __pad[0];
-};
+ unsigned long __pad[0];
+} ____cacheline_aligned;
struct linux_mib
{
@@ -237,9 +254,15 @@ struct linux_mib
unsigned long TCPAbortOnLinger;
unsigned long TCPAbortFailed;
unsigned long TCPMemoryPressures;
- unsigned long __pad[64-64];
-};
+ unsigned long __pad[0];
+} ____cacheline_aligned;
+
+/*
+ * FIXME: On x86 and some other CPUs the split into user and softirq parts is not needed because
+ * addl $1,memory is atomic against interrupts (but atomic_inc would be overkill because of the lock
+ * cycles). Wants new nonlocked_atomic_inc() primitives -AK
+ */
#define SNMP_INC_STATS(mib, field) ((mib)[2*smp_processor_id()+!in_softirq()].field++)
#define SNMP_INC_STATS_BH(mib, field) ((mib)[2*smp_processor_id()].field++)
#define SNMP_INC_STATS_USER(mib, field) ((mib)[2*smp_processor_id()+1].field++)
diff --git a/include/net/sock.h b/include/net/sock.h
index 38b5549d6..e3527b2f3 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -470,7 +470,6 @@ typedef struct {
#define sock_lock_init(__sk) \
do { spin_lock_init(&((__sk)->lock.slock)); \
- (__sk)->dst_lock = RW_LOCK_UNLOCKED; \
(__sk)->lock.users = 0; \
init_waitqueue_head(&((__sk)->lock.wq)); \
} while(0);
@@ -749,6 +748,7 @@ static void __inline__ sock_prot_dec_use(struct proto *prot)
#define SOCK_SNDBUF_LOCK 1
#define SOCK_RCVBUF_LOCK 2
#define SOCK_BINDADDR_LOCK 4
+#define SOCK_BINDPORT_LOCK 8
/* Used by processes to "lock" a socket state, so that
@@ -818,7 +818,6 @@ extern struct sk_buff *sock_rmalloc(struct sock *sk,
int priority);
extern void sock_wfree(struct sk_buff *skb);
extern void sock_rfree(struct sk_buff *skb);
-extern unsigned long sock_wspace(struct sock *sk);
extern int sock_setsockopt(struct socket *sock, int level,
int op, char *optval,
@@ -901,7 +900,7 @@ extern void sklist_destroy_socket(struct sock **list, struct sock *sk);
* be accepted or 1 if the packet should be tossed.
*/
-extern __inline__ int sk_filter(struct sk_buff *skb, struct sk_filter *filter)
+static inline int sk_filter(struct sk_buff *skb, struct sk_filter *filter)
{
int pkt_len;
@@ -922,7 +921,7 @@ extern __inline__ int sk_filter(struct sk_buff *skb, struct sk_filter *filter)
* Remove a filter from a socket and release its resources.
*/
-extern __inline__ void sk_filter_release(struct sock *sk, struct sk_filter *fp)
+static inline void sk_filter_release(struct sock *sk, struct sk_filter *fp)
{
unsigned int size = sk_filter_len(fp);
@@ -932,7 +931,7 @@ extern __inline__ void sk_filter_release(struct sock *sk, struct sk_filter *fp)
kfree(fp);
}
-extern __inline__ void sk_filter_charge(struct sock *sk, struct sk_filter *fp)
+static inline void sk_filter_charge(struct sock *sk, struct sk_filter *fp)
{
atomic_inc(&fp->refcnt);
atomic_add(sk_filter_len(fp), &sk->omem_alloc);
@@ -971,7 +970,7 @@ extern __inline__ void sk_filter_charge(struct sock *sk, struct sk_filter *fp)
modifications.
*/
-extern __inline__ void sock_hold(struct sock *sk)
+static inline void sock_hold(struct sock *sk)
{
atomic_inc(&sk->refcnt);
}
@@ -979,13 +978,13 @@ extern __inline__ void sock_hold(struct sock *sk)
/* Ungrab socket in the context, which assumes that socket refcnt
cannot hit zero, f.e. it is true in context of any socketcall.
*/
-extern __inline__ void __sock_put(struct sock *sk)
+static inline void __sock_put(struct sock *sk)
{
atomic_dec(&sk->refcnt);
}
/* Ungrab socket and destroy it, if it was the last reference. */
-extern __inline__ void sock_put(struct sock *sk)
+static inline void sock_put(struct sock *sk)
{
if (atomic_dec_and_test(&sk->refcnt))
sk_free(sk);
@@ -998,7 +997,7 @@ extern __inline__ void sock_put(struct sock *sk)
* probably wants some additional cleanups or even continuing
* to work with this socket (TCP).
*/
-extern __inline__ void sock_orphan(struct sock *sk)
+static inline void sock_orphan(struct sock *sk)
{
write_lock_bh(&sk->callback_lock);
sk->dead = 1;
@@ -1007,7 +1006,7 @@ extern __inline__ void sock_orphan(struct sock *sk)
write_unlock_bh(&sk->callback_lock);
}
-extern __inline__ void sock_graft(struct sock *sk, struct socket *parent)
+static inline void sock_graft(struct sock *sk, struct socket *parent)
{
write_lock_bh(&sk->callback_lock);
sk->sleep = &parent->wait;
@@ -1036,13 +1035,13 @@ static inline unsigned long sock_i_ino(struct sock *sk)
return ino;
}
-extern __inline__ struct dst_entry *
+static inline struct dst_entry *
__sk_dst_get(struct sock *sk)
{
return sk->dst_cache;
}
-extern __inline__ struct dst_entry *
+static inline struct dst_entry *
sk_dst_get(struct sock *sk)
{
struct dst_entry *dst;
@@ -1055,7 +1054,7 @@ sk_dst_get(struct sock *sk)
return dst;
}
-extern __inline__ void
+static inline void
__sk_dst_set(struct sock *sk, struct dst_entry *dst)
{
struct dst_entry *old_dst;
@@ -1065,7 +1064,7 @@ __sk_dst_set(struct sock *sk, struct dst_entry *dst)
dst_release(old_dst);
}
-extern __inline__ void
+static inline void
sk_dst_set(struct sock *sk, struct dst_entry *dst)
{
write_lock(&sk->dst_lock);
@@ -1073,7 +1072,7 @@ sk_dst_set(struct sock *sk, struct dst_entry *dst)
write_unlock(&sk->dst_lock);
}
-extern __inline__ void
+static inline void
__sk_dst_reset(struct sock *sk)
{
struct dst_entry *old_dst;
@@ -1083,7 +1082,7 @@ __sk_dst_reset(struct sock *sk)
dst_release(old_dst);
}
-extern __inline__ void
+static inline void
sk_dst_reset(struct sock *sk)
{
write_lock(&sk->dst_lock);
@@ -1091,7 +1090,7 @@ sk_dst_reset(struct sock *sk)
write_unlock(&sk->dst_lock);
}
-extern __inline__ struct dst_entry *
+static inline struct dst_entry *
__sk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = sk->dst_cache;
@@ -1104,7 +1103,7 @@ __sk_dst_check(struct sock *sk, u32 cookie)
return dst;
}
-extern __inline__ struct dst_entry *
+static inline struct dst_entry *
sk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = sk_dst_get(sk);
@@ -1127,7 +1126,7 @@ sk_dst_check(struct sock *sk, u32 cookie)
* packet ever received.
*/
-extern __inline__ void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
+static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
{
sock_hold(sk);
skb->sk = sk;
@@ -1135,14 +1134,14 @@ extern __inline__ void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
atomic_add(skb->truesize, &sk->wmem_alloc);
}
-extern __inline__ void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
+static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
{
skb->sk = sk;
skb->destructor = sock_rfree;
atomic_add(skb->truesize, &sk->rmem_alloc);
}
-extern __inline__ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
+static inline int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
{
/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
number of warnings when compiling with -W --ANK
@@ -1175,7 +1174,7 @@ extern __inline__ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
return 0;
}
-extern __inline__ int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
+static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
{
/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
number of warnings when compiling with -W --ANK
@@ -1193,13 +1192,13 @@ extern __inline__ int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
* Recover an error report and clear atomically
*/
-extern __inline__ int sock_error(struct sock *sk)
+static inline int sock_error(struct sock *sk)
{
int err=xchg(&sk->err,0);
return -err;
}
-extern __inline__ unsigned long sock_wspace(struct sock *sk)
+static inline unsigned long sock_wspace(struct sock *sk)
{
int amt = 0;
@@ -1211,7 +1210,7 @@ extern __inline__ unsigned long sock_wspace(struct sock *sk)
return amt;
}
-extern __inline__ void sk_wake_async(struct sock *sk, int how, int band)
+static inline void sk_wake_async(struct sock *sk, int how, int band)
{
if (sk->socket && sk->socket->fasync_list)
sock_wake_async(sk->socket, how, band);
@@ -1226,27 +1225,27 @@ extern __inline__ void sk_wake_async(struct sock *sk, int how, int band)
* Default write policy as shown to user space via poll/select/SIGIO
* Kernel internally doesn't use the MIN_WRITE_SPACE threshold.
*/
-extern __inline__ int sock_writeable(struct sock *sk)
+static inline int sock_writeable(struct sock *sk)
{
return sock_wspace(sk) >= SOCK_MIN_WRITE_SPACE;
}
-extern __inline__ int gfp_any(void)
+static inline int gfp_any(void)
{
return in_softirq() ? GFP_ATOMIC : GFP_KERNEL;
}
-extern __inline__ long sock_rcvtimeo(struct sock *sk, int noblock)
+static inline long sock_rcvtimeo(struct sock *sk, int noblock)
{
return noblock ? 0 : sk->rcvtimeo;
}
-extern __inline__ long sock_sndtimeo(struct sock *sk, int noblock)
+static inline long sock_sndtimeo(struct sock *sk, int noblock)
{
return noblock ? 0 : sk->sndtimeo;
}
-extern __inline__ int sock_rcvlowat(struct sock *sk, int waitall, int len)
+static inline int sock_rcvlowat(struct sock *sk, int waitall, int len)
{
return (waitall ? len : min(sk->rcvlowat, len)) ? : 1;
}
@@ -1254,7 +1253,7 @@ extern __inline__ int sock_rcvlowat(struct sock *sk, int waitall, int len)
/* Alas, with timeout socket operations are not restartable.
* Compare this to poll().
*/
-extern __inline__ int sock_intr_errno(long timeo)
+static inline int sock_intr_errno(long timeo)
{
return timeo == MAX_SCHEDULE_TIMEOUT ? -ERESTARTSYS : -EINTR;
}
diff --git a/include/net/tcp.h b/include/net/tcp.h
index d3a63962c..3fdb1e97a 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -166,7 +166,7 @@ struct tcp_tw_bucket {
extern kmem_cache_t *tcp_timewait_cachep;
-extern __inline__ void tcp_tw_put(struct tcp_tw_bucket *tw)
+static inline void tcp_tw_put(struct tcp_tw_bucket *tw)
{
if (atomic_dec_and_test(&tw->refcnt)) {
#ifdef INET_REFCNT_DEBUG
@@ -495,7 +495,7 @@ extern kmem_cache_t *tcp_openreq_cachep;
#define tcp_openreq_alloc() kmem_cache_alloc(tcp_openreq_cachep, SLAB_ATOMIC)
#define tcp_openreq_fastfree(req) kmem_cache_free(tcp_openreq_cachep, req)
-extern __inline__ void tcp_openreq_free(struct open_request *req)
+static inline void tcp_openreq_free(struct open_request *req)
{
req->class->destructor(req);
tcp_openreq_fastfree(req);
@@ -656,20 +656,6 @@ static __inline__ void tcp_delack_init(struct tcp_opt *tp)
memset(&tp->ack, 0, sizeof(tp->ack));
}
-enum tcp_ca_state
-{
- TCP_CA_Open = 0,
-#define TCPF_CA_Open (1<<TCP_CA_Open)
- TCP_CA_Disorder = 1,
-#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
- TCP_CA_CWR = 2,
-#define TCPF_CA_CWR (1<<TCP_CA_CWR)
- TCP_CA_Recovery = 3,
-#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
- TCP_CA_Loss = 4
-#define TCPF_CA_Loss (1<<TCP_CA_Loss)
-};
-
enum tcp_tw_status
{
@@ -893,7 +879,7 @@ static __inline__ unsigned int tcp_current_mss(struct sock *sk)
* Underestimations are more easy to detect and fix by tcp_measure_rcv_mss().
*/
-extern __inline__ void tcp_initialize_rcv_mss(struct sock *sk)
+static inline void tcp_initialize_rcv_mss(struct sock *sk)
{
struct tcp_opt *tp = &sk->tp_pinfo.af_tcp;
@@ -1034,7 +1020,7 @@ static __inline__ int tcp_packets_in_flight(struct tcp_opt *tp)
* one half the current congestion window, but no
* less than two segments
*/
-extern __inline__ __u32 tcp_recalc_ssthresh(struct tcp_opt *tp)
+static inline __u32 tcp_recalc_ssthresh(struct tcp_opt *tp)
{
return max(tp->snd_cwnd>>1, 2);
}
@@ -1043,7 +1029,7 @@ extern __inline__ __u32 tcp_recalc_ssthresh(struct tcp_opt *tp)
* The exception is rate halving phase, when cwnd is decreasing towards
* ssthresh.
*/
-extern __inline__ __u32 tcp_current_ssthresh(struct tcp_opt *tp)
+static inline __u32 tcp_current_ssthresh(struct tcp_opt *tp)
{
if ((1<<tp->ca_state)&(TCPF_CA_CWR|TCPF_CA_Recovery))
return tp->snd_ssthresh;
@@ -1072,7 +1058,7 @@ static inline void tcp_cwnd_validate(struct sock *sk, struct tcp_opt *tp)
}
/* Set slow start threshould and cwnd not falling to slow start */
-extern __inline__ void __tcp_enter_cwr(struct tcp_opt *tp)
+static inline void __tcp_enter_cwr(struct tcp_opt *tp)
{
tp->undo_marker = 0;
tp->snd_ssthresh = tcp_recalc_ssthresh(tp);
@@ -1083,7 +1069,7 @@ extern __inline__ void __tcp_enter_cwr(struct tcp_opt *tp)
TCP_ECN_queue_cwr(tp);
}
-extern __inline__ void tcp_enter_cwr(struct tcp_opt *tp)
+static inline void tcp_enter_cwr(struct tcp_opt *tp)
{
tp->prior_ssthresh = 0;
if (tp->ca_state < TCP_CA_CWR) {
@@ -1307,6 +1293,8 @@ static __inline__ void tcp_set_state(struct sock *sk, int state)
case TCP_CLOSE:
sk->prot->unhash(sk);
+ if (sk->prev && !(sk->userlocks&SOCK_BINDPORT_LOCK))
+ tcp_put_port(sk);
/* fall through */
default:
if (oldstate==TCP_ESTABLISHED)
@@ -1378,7 +1366,7 @@ static __inline__ void tcp_build_and_update_options(__u32 *ptr, struct tcp_opt *
* MAX_SYN_SIZE to match the new maximum number of options that you
* can generate.
*/
-extern __inline__ void tcp_syn_build_options(__u32 *ptr, int mss, int ts, int sack,
+static inline void tcp_syn_build_options(__u32 *ptr, int mss, int ts, int sack,
int offer_wscale, int wscale, __u32 tstamp, __u32 ts_recent)
{
/* We always get an MSS option.
@@ -1418,7 +1406,7 @@ extern __inline__ void tcp_syn_build_options(__u32 *ptr, int mss, int ts, int sa
* be a multiple of mss if possible. We assume here that mss >= 1.
* This MUST be enforced by all callers.
*/
-extern __inline__ void tcp_select_initial_window(int space, __u32 mss,
+static inline void tcp_select_initial_window(int space, __u32 mss,
__u32 *rcv_wnd,
__u32 *window_clamp,
int wscale_ok,
@@ -1477,32 +1465,32 @@ static inline int tcp_win_from_space(int space)
}
/* Note: caller must be prepared to deal with negative returns */
-extern __inline__ int tcp_space(struct sock *sk)
+static inline int tcp_space(struct sock *sk)
{
return tcp_win_from_space(sk->rcvbuf - atomic_read(&sk->rmem_alloc));
}
-extern __inline__ int tcp_full_space( struct sock *sk)
+static inline int tcp_full_space( struct sock *sk)
{
return tcp_win_from_space(sk->rcvbuf);
}
-extern __inline__ void tcp_acceptq_removed(struct sock *sk)
+static inline void tcp_acceptq_removed(struct sock *sk)
{
sk->ack_backlog--;
}
-extern __inline__ void tcp_acceptq_added(struct sock *sk)
+static inline void tcp_acceptq_added(struct sock *sk)
{
sk->ack_backlog++;
}
-extern __inline__ int tcp_acceptq_is_full(struct sock *sk)
+static inline int tcp_acceptq_is_full(struct sock *sk)
{
return sk->ack_backlog > sk->max_ack_backlog;
}
-extern __inline__ void tcp_acceptq_queue(struct sock *sk, struct open_request *req,
+static inline void tcp_acceptq_queue(struct sock *sk, struct open_request *req,
struct sock *child)
{
struct tcp_opt *tp = &sk->tp_pinfo.af_tcp;
@@ -1528,7 +1516,7 @@ struct tcp_listen_opt
struct open_request *syn_table[TCP_SYNQ_HSIZE];
};
-extern __inline__ void
+static inline void
tcp_synq_removed(struct sock *sk, struct open_request *req)
{
struct tcp_listen_opt *lopt = sk->tp_pinfo.af_tcp.listen_opt;
@@ -1539,7 +1527,7 @@ tcp_synq_removed(struct sock *sk, struct open_request *req)
lopt->qlen_young--;
}
-extern __inline__ void tcp_synq_added(struct sock *sk)
+static inline void tcp_synq_added(struct sock *sk)
{
struct tcp_listen_opt *lopt = sk->tp_pinfo.af_tcp.listen_opt;
@@ -1548,22 +1536,22 @@ extern __inline__ void tcp_synq_added(struct sock *sk)
lopt->qlen_young++;
}
-extern __inline__ int tcp_synq_len(struct sock *sk)
+static inline int tcp_synq_len(struct sock *sk)
{
return sk->tp_pinfo.af_tcp.listen_opt->qlen;
}
-extern __inline__ int tcp_synq_young(struct sock *sk)
+static inline int tcp_synq_young(struct sock *sk)
{
return sk->tp_pinfo.af_tcp.listen_opt->qlen_young;
}
-extern __inline__ int tcp_synq_is_full(struct sock *sk)
+static inline int tcp_synq_is_full(struct sock *sk)
{
return tcp_synq_len(sk)>>sk->tp_pinfo.af_tcp.listen_opt->max_qlen_log;
}
-extern __inline__ void tcp_synq_unlink(struct tcp_opt *tp, struct open_request *req,
+static inline void tcp_synq_unlink(struct tcp_opt *tp, struct open_request *req,
struct open_request **prev)
{
write_lock(&tp->syn_wait_lock);
@@ -1571,7 +1559,7 @@ extern __inline__ void tcp_synq_unlink(struct tcp_opt *tp, struct open_request *
write_unlock(&tp->syn_wait_lock);
}
-extern __inline__ void tcp_synq_drop(struct sock *sk, struct open_request *req,
+static inline void tcp_synq_drop(struct sock *sk, struct open_request *req,
struct open_request **prev)
{
tcp_synq_unlink(&sk->tp_pinfo.af_tcp, req, prev);
@@ -1679,7 +1667,7 @@ extern void tcp_listen_wlock(void);
* use plain read_(un)lock(&tcp_lhash_lock).
*/
-extern __inline__ void tcp_listen_lock(void)
+static inline void tcp_listen_lock(void)
{
/* read_lock synchronizes to candidates to writers */
read_lock(&tcp_lhash_lock);
@@ -1687,7 +1675,7 @@ extern __inline__ void tcp_listen_lock(void)
read_unlock(&tcp_lhash_lock);
}
-extern __inline__ void tcp_listen_unlock(void)
+static inline void tcp_listen_unlock(void)
{
if (atomic_dec_and_test(&tcp_lhash_users))
wake_up(&tcp_lhash_wait);
diff --git a/include/net/x25.h b/include/net/x25.h
index 66575c464..fb8346f81 100644
--- a/include/net/x25.h
+++ b/include/net/x25.h
@@ -188,7 +188,7 @@ extern struct x25_neigh *x25_get_neigh(struct net_device *);
extern void x25_link_free(void);
/* x25_out.c */
-extern void x25_output(struct sock *, struct sk_buff *);
+extern int x25_output(struct sock *, struct sk_buff *);
extern void x25_kick(struct sock *);
extern void x25_enquiry_response(struct sock *);
diff --git a/include/pcmcia/bulkmem.h b/include/pcmcia/bulkmem.h
index c920e3d41..c9bdab7a1 100644
--- a/include/pcmcia/bulkmem.h
+++ b/include/pcmcia/bulkmem.h
@@ -1,7 +1,7 @@
/*
* Definitions for bulk memory services
*
- * bulkmem.h 1.11 1999/10/25 20:23:16
+ * bulkmem.h 1.12 2000/06/12 21:55:41
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -14,7 +14,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
diff --git a/include/pcmcia/bus_ops.h b/include/pcmcia/bus_ops.h
index 29e13547a..bd4c2958f 100644
--- a/include/pcmcia/bus_ops.h
+++ b/include/pcmcia/bus_ops.h
@@ -1,5 +1,5 @@
/*
- * bus_ops.h 1.8 1999/10/25 20:23:16
+ * bus_ops.h 1.10 2000/06/12 21:55:41
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -12,7 +12,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h
index e5c328054..d449b4234 100644
--- a/include/pcmcia/ciscode.h
+++ b/include/pcmcia/ciscode.h
@@ -1,5 +1,5 @@
/*
- * ciscode.h 1.40 2000/02/01 19:06:40
+ * ciscode.h 1.45 2000/08/12 02:08:23
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -12,7 +12,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
@@ -78,6 +78,9 @@
#define MANFID_NEW_MEDIA 0x0057
+#define MANFID_NOKIA 0x0124
+#define PRODID_NOKIA_CARDPHONE 0x0900
+
#define MANFID_OLICOM 0x0121
#define PRODID_OLICOM_OC2231 0x3122
#define PRODID_OLICOM_OC2232 0x3222
@@ -94,6 +97,7 @@
#define MANFID_PIONEER 0x000b
#define MANFID_PSION 0x016c
+#define PRODID_PSION_NET100 0x0023
#define MANFID_QUATECH 0x0137
#define PRODID_QUATECH_SPP100 0x0003
@@ -106,12 +110,15 @@
#define MANFID_SOCKET 0x0104
#define PRODID_SOCKET_DUAL_RS232 0x0006
+#define PRODID_SOCKET_EIO 0x000a
#define PRODID_SOCKET_LPE 0x000d
#define MANFID_SUNDISK 0x0045
#define MANFID_TDK 0x0105
+#define MANFID_TOSHIBA 0x0098
+
#define MANFID_XIRCOM 0x0105
#endif /* _LINUX_CISCODE_H */
diff --git a/include/pcmcia/cisreg.h b/include/pcmcia/cisreg.h
index 803660503..884d46de0 100644
--- a/include/pcmcia/cisreg.h
+++ b/include/pcmcia/cisreg.h
@@ -1,5 +1,5 @@
/*
- * cisreg.h 1.16 2000/01/16 19:19:14
+ * cisreg.h 1.17 2000/06/12 21:55:41
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -12,7 +12,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
diff --git a/include/pcmcia/cistpl.h b/include/pcmcia/cistpl.h
index d53e44646..5f9701fe2 100644
--- a/include/pcmcia/cistpl.h
+++ b/include/pcmcia/cistpl.h
@@ -1,5 +1,5 @@
/*
- * cistpl.h 1.32 2000/01/11 19:06:50
+ * cistpl.h 1.34 2000/06/19 23:18:12
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -12,7 +12,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
@@ -68,6 +68,7 @@
#define CISTPL_BYTEORDER 0x43
#define CISTPL_DATE 0x44
#define CISTPL_BATTERY 0x45
+#define CISTPL_FORMAT_A 0x47
/* Layer 3 tuples */
#define CISTPL_ORG 0x46
#define CISTPL_SPCL 0x90
@@ -530,6 +531,21 @@ typedef struct cistpl_org_t {
#define CISTPL_ORG_APPSPEC 0x01
#define CISTPL_ORG_XIP 0x02
+typedef struct cistpl_format_t {
+ u_char type;
+ u_char edc;
+ u_int offset;
+ u_int length;
+} cistpl_format_t;
+
+#define CISTPL_FORMAT_DISK 0x00
+#define CISTPL_FORMAT_MEM 0x01
+
+#define CISTPL_EDC_NONE 0x00
+#define CISTPL_EDC_CKSUM 0x01
+#define CISTPL_EDC_CRC 0x02
+#define CISTPL_EDC_PCC 0x03
+
typedef union cisparse_t {
cistpl_device_t device;
cistpl_checksum_t checksum;
@@ -548,6 +564,7 @@ typedef union cisparse_t {
cistpl_device_geo_t device_geo;
cistpl_vers_2_t vers_2;
cistpl_org_t org;
+ cistpl_format_t format;
} cisparse_t;
typedef struct tuple_t {
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 669de1eac..bfbf3d744 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -1,5 +1,5 @@
/*
- * cs.h 1.69 1999/10/25 20:23:17
+ * cs.h 1.71 2000/08/29 00:54:20
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -12,7 +12,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
@@ -251,11 +251,6 @@ typedef struct eventmask_t {
#define PRESENT_IOBASE_3 0x100
#define PRESENT_IOSIZE 0x200
-/* Attributes for Request/GetConfiguration */
-#define CONF_ENABLE_IRQ 0x01
-#define EXCLUSIVE_USE 0x02
-#define VALID_CLIENT 0x04
-
/* For GetMemPage, MapMemPage */
typedef struct memreq_t {
u_int CardOffset;
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h
index 92feb6322..186ce9f3e 100644
--- a/include/pcmcia/cs_types.h
+++ b/include/pcmcia/cs_types.h
@@ -1,5 +1,5 @@
/*
- * cs_types.h 1.17 2000/01/18 01:14:36
+ * cs_types.h 1.18 2000/06/12 21:55:40
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -12,7 +12,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
diff --git a/include/pcmcia/driver_ops.h b/include/pcmcia/driver_ops.h
index 337076a24..bb95644b3 100644
--- a/include/pcmcia/driver_ops.h
+++ b/include/pcmcia/driver_ops.h
@@ -1,5 +1,5 @@
/*
- * driver_ops.h 1.14 1999/10/25 20:23:17
+ * driver_ops.h 1.15 2000/06/12 21:55:40
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -12,7 +12,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index ddb271ec9..e50033bc6 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -1,5 +1,5 @@
/*
- * ds.h 1.55 1999/10/25 20:23:17
+ * ds.h 1.56 2000/06/12 21:55:40
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -12,7 +12,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
diff --git a/include/pcmcia/ftl.h b/include/pcmcia/ftl.h
index 0fb527845..deab295b6 100644
--- a/include/pcmcia/ftl.h
+++ b/include/pcmcia/ftl.h
@@ -1,5 +1,5 @@
/*
- * ftl.h 1.7 1999/10/25 20:23:17
+ * ftl.h 1.8 2000/06/12 21:55:40
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -12,7 +12,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
diff --git a/include/pcmcia/mem_op.h b/include/pcmcia/mem_op.h
index 38101ab10..d7f70599d 100644
--- a/include/pcmcia/mem_op.h
+++ b/include/pcmcia/mem_op.h
@@ -1,5 +1,5 @@
/*
- * mem_op.h 1.12 1999/10/25 20:23:17
+ * mem_op.h 1.13 2000/06/12 21:55:40
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -12,7 +12,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
diff --git a/include/pcmcia/memory.h b/include/pcmcia/memory.h
index 5c0cdb69f..c87a3645f 100644
--- a/include/pcmcia/memory.h
+++ b/include/pcmcia/memory.h
@@ -1,5 +1,5 @@
/*
- * memory.h 1.6 1999/10/25 20:23:17
+ * memory.h 1.7 2000/06/12 21:55:40
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -12,7 +12,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index b53657fad..e50861c1b 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -1,5 +1,5 @@
/*
- * ss.h 1.26 2000/02/04 20:35:21
+ * ss.h 1.28 2000/06/12 21:55:40
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -12,7 +12,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dhinds@pcmcia.sourceforge.org>. Portions created by David A. Hinds
+ * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
@@ -61,6 +61,7 @@ typedef struct socket_cap_t {
#define SS_CAP_PAGE_REGS 0x0001
#define SS_CAP_VIRTUAL_BUS 0x0002
#define SS_CAP_MEM_ALIGN 0x0004
+#define SS_CAP_STATIC_MAP 0x0008
#define SS_CAP_PCCARD 0x4000
#define SS_CAP_CARDBUS 0x8000
@@ -81,6 +82,7 @@ extern socket_state_t dead_socket;
#define SS_DMA_MODE 0x0080
#define SS_SPKR_ENA 0x0100
#define SS_OUTPUT_ENA 0x0200
+#define SS_DEBOUNCED 0x0400 /* Tell driver that the debounce delay has ended */
/* Flags for I/O port and memory windows */
#define MAP_ACTIVE 0x01
diff --git a/include/pcmcia/version.h b/include/pcmcia/version.h
index 4f6ffc702..70f3d8a48 100644
--- a/include/pcmcia/version.h
+++ b/include/pcmcia/version.h
@@ -1,4 +1,4 @@
-/* version.h 1.83 2000/02/03 02:16:14 (David Hinds) */
+/* version.h 1.92 2000/07/21 18:26:56 (David Hinds) */
-#define CS_RELEASE "3.1.11"
-#define CS_RELEASE_CODE 0x310b
+#define CS_RELEASE "3.1.20"
+#define CS_RELEASE_CODE 0x3115
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 76e63aa75..fa82b5325 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -137,6 +137,7 @@
#define TYPE_MOD 0x07 /* Magneto-optical disk -
* - treated as TYPE_DISK */
#define TYPE_MEDIUM_CHANGER 0x08
+#define TYPE_COMM 0x09 /* Communications device */
#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
#define TYPE_NO_LUN 0x7f
diff --git a/include/scsi/scsi_ioctl.h b/include/scsi/scsi_ioctl.h
index 6ba0dd542..937cadfb9 100644
--- a/include/scsi/scsi_ioctl.h
+++ b/include/scsi/scsi_ioctl.h
@@ -32,6 +32,13 @@ typedef struct scsi_idlun {
__u32 host_unique_id;
} Scsi_Idlun;
+/* Fibre Channel WWN, port_id struct */
+typedef struct scsi_fctargaddress
+{
+ __u32 host_port_id;
+ unsigned char host_wwn[8]; // include NULL term.
+} Scsi_FCTargAddress;
+
extern int scsi_ioctl (Scsi_Device *dev, int cmd, void *arg);
extern int kernel_scsi_ioctl (Scsi_Device *dev, int cmd, void *arg);
extern int scsi_ioctl_send_command(Scsi_Device *dev,
diff --git a/include/scsi/sg.h b/include/scsi/sg.h
index 060d5de24..9423ba1db 100644
--- a/include/scsi/sg.h
+++ b/include/scsi/sg.h
@@ -11,9 +11,13 @@ Original driver (sg.h):
Version 2 and 3 extensions to driver:
* Copyright (C) 1998 - 2000 Douglas Gilbert
- Version: 3.1.16 (20000716)
- This version is for 2.3/2.4 series kernels.
+ Version: 3.1.17 (20000921)
+ This version is for 2.4 series kernels.
+ Changes since 3.1.16 (20000716)
+ - changes for new scsi subsystem initialization
+ - change Scsi_Cmnd usage to Scsi_Request
+ - cleanup for no procfs
Changes since 3.1.15 (20000528)
- further (scatter gather) buffer length changes
Changes since 3.1.14 (20000503)