summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/a.out.h3
-rw-r--r--include/asm-alpha/apecs.h18
-rw-r--r--include/asm-alpha/cache.h8
-rw-r--r--include/asm-alpha/dma.h2
-rw-r--r--include/asm-alpha/elf.h40
-rw-r--r--include/asm-alpha/fpu.h34
-rw-r--r--include/asm-alpha/hardirq.h1
-rw-r--r--include/asm-alpha/hwrpb.h21
-rw-r--r--include/asm-alpha/io.h4
-rw-r--r--include/asm-alpha/ioctls.h2
-rw-r--r--include/asm-alpha/irq.h13
-rw-r--r--include/asm-alpha/lca.h31
-rw-r--r--include/asm-alpha/mman.h6
-rw-r--r--include/asm-alpha/pal.h3
-rw-r--r--include/asm-alpha/processor.h5
-rw-r--r--include/asm-alpha/pyxis.h436
-rw-r--r--include/asm-alpha/signal.h9
-rw-r--r--include/asm-alpha/smp.h2
-rw-r--r--include/asm-alpha/socket.h6
-rw-r--r--include/asm-alpha/softirq.h54
-rw-r--r--include/asm-alpha/t2.h508
-rw-r--r--include/asm-alpha/types.h2
-rw-r--r--include/asm-alpha/unistd.h51
-rw-r--r--include/asm-arm/a.out.h28
-rw-r--r--include/asm-arm/arcaudio.h51
-rw-r--r--include/asm-arm/arch-a5k/a.out.h16
-rw-r--r--include/asm-arm/arch-a5k/dma.h101
-rw-r--r--include/asm-arm/arch-a5k/hardware.h81
-rw-r--r--include/asm-arm/arch-a5k/ide.h44
-rw-r--r--include/asm-arm/arch-a5k/io.h215
-rw-r--r--include/asm-arm/arch-a5k/irq.h130
-rw-r--r--include/asm-arm/arch-a5k/irqs.h28
-rw-r--r--include/asm-arm/arch-a5k/mmu.h15
-rw-r--r--include/asm-arm/arch-a5k/oldlatches.h9
-rw-r--r--include/asm-arm/arch-a5k/processor.h34
-rw-r--r--include/asm-arm/arch-a5k/serial.h40
-rw-r--r--include/asm-arm/arch-a5k/shmparam.h5
-rw-r--r--include/asm-arm/arch-a5k/system.h30
-rw-r--r--include/asm-arm/arch-a5k/time.h96
-rw-r--r--include/asm-arm/arch-a5k/timex.h13
-rw-r--r--include/asm-arm/arch-a5k/uncompress.h104
-rw-r--r--include/asm-arm/arch-arc/a.out.h16
-rw-r--r--include/asm-arm/arch-arc/dma.h95
-rw-r--r--include/asm-arm/arch-arc/hardware.h82
-rw-r--r--include/asm-arm/arch-arc/ide.h40
-rw-r--r--include/asm-arm/arch-arc/io.h215
-rw-r--r--include/asm-arm/arch-arc/irq.h130
-rw-r--r--include/asm-arm/arch-arc/irqs.h30
-rw-r--r--include/asm-arm/arch-arc/mmu.h15
-rw-r--r--include/asm-arm/arch-arc/oldlatches.h24
-rw-r--r--include/asm-arm/arch-arc/processor.h34
-rw-r--r--include/asm-arm/arch-arc/serial.h40
-rw-r--r--include/asm-arm/arch-arc/shmparam.h5
-rw-r--r--include/asm-arm/arch-arc/system.h41
-rw-r--r--include/asm-arm/arch-arc/time.h96
-rw-r--r--include/asm-arm/arch-arc/timex.h13
-rw-r--r--include/asm-arm/arch-arc/uncompress.h104
-rw-r--r--include/asm-arm/arch-ebsa110/a.out.h16
-rw-r--r--include/asm-arm/arch-ebsa110/dma.h100
-rw-r--r--include/asm-arm/arch-ebsa110/hardware.h50
-rw-r--r--include/asm-arm/arch-ebsa110/ide.h1
-rw-r--r--include/asm-arm/arch-ebsa110/io.h192
-rw-r--r--include/asm-arm/arch-ebsa110/irq.h46
-rw-r--r--include/asm-arm/arch-ebsa110/irqs.h14
-rw-r--r--include/asm-arm/arch-ebsa110/mm-init.h11
-rw-r--r--include/asm-arm/arch-ebsa110/mmap.h10
-rw-r--r--include/asm-arm/arch-ebsa110/mmu.h19
-rw-r--r--include/asm-arm/arch-ebsa110/oldlatches.h9
-rw-r--r--include/asm-arm/arch-ebsa110/processor.h31
-rw-r--r--include/asm-arm/arch-ebsa110/serial.h41
-rw-r--r--include/asm-arm/arch-ebsa110/shmparam.h5
-rw-r--r--include/asm-arm/arch-ebsa110/system.h18
-rw-r--r--include/asm-arm/arch-ebsa110/time.h89
-rw-r--r--include/asm-arm/arch-ebsa110/timex.h15
-rw-r--r--include/asm-arm/arch-ebsa110/uncompress.h33
-rw-r--r--include/asm-arm/arch-nexuspci/a.out.h16
-rw-r--r--include/asm-arm/arch-nexuspci/dma.h100
-rw-r--r--include/asm-arm/arch-nexuspci/hardware.h40
-rw-r--r--include/asm-arm/arch-nexuspci/irq.h46
-rw-r--r--include/asm-arm/arch-nexuspci/irqs.h14
-rw-r--r--include/asm-arm/arch-nexuspci/mmap.h10
-rw-r--r--include/asm-arm/arch-nexuspci/mmu.h16
-rw-r--r--include/asm-arm/arch-nexuspci/processor.h31
-rw-r--r--include/asm-arm/arch-nexuspci/serial.h41
-rw-r--r--include/asm-arm/arch-nexuspci/shmparam.h5
-rw-r--r--include/asm-arm/arch-nexuspci/system.h18
-rw-r--r--include/asm-arm/arch-nexuspci/time.h29
-rw-r--r--include/asm-arm/arch-nexuspci/uncompress.h17
-rw-r--r--include/asm-arm/arch-rpc/a.out.h16
-rw-r--r--include/asm-arm/arch-rpc/dma.h128
-rw-r--r--include/asm-arm/arch-rpc/hardware.h101
-rw-r--r--include/asm-arm/arch-rpc/ide.h44
-rw-r--r--include/asm-arm/arch-rpc/io.h203
-rw-r--r--include/asm-arm/arch-rpc/irq.h138
-rw-r--r--include/asm-arm/arch-rpc/irqs.h28
-rw-r--r--include/asm-arm/arch-rpc/mmap.h48
-rw-r--r--include/asm-arm/arch-rpc/mmu.h17
-rw-r--r--include/asm-arm/arch-rpc/oldlatches.h9
-rw-r--r--include/asm-arm/arch-rpc/processor.h34
-rw-r--r--include/asm-arm/arch-rpc/serial.h40
-rw-r--r--include/asm-arm/arch-rpc/shmparam.h5
-rw-r--r--include/asm-arm/arch-rpc/system.h23
-rw-r--r--include/asm-arm/arch-rpc/time.h96
-rw-r--r--include/asm-arm/arch-rpc/timex.h13
-rw-r--r--include/asm-arm/arch-rpc/uncompress.h143
-rw-r--r--include/asm-arm/assembler.h34
-rw-r--r--include/asm-arm/atomic.h85
-rw-r--r--include/asm-arm/bitops.h72
-rw-r--r--include/asm-arm/bugs.h13
-rw-r--r--include/asm-arm/byteorder.h39
-rw-r--r--include/asm-arm/cache.h10
-rw-r--r--include/asm-arm/checksum.h154
-rw-r--r--include/asm-arm/current.h23
-rw-r--r--include/asm-arm/delay.h32
-rw-r--r--include/asm-arm/dma.h28
-rw-r--r--include/asm-arm/ecard.h227
-rw-r--r--include/asm-arm/elf.h54
-rw-r--r--include/asm-arm/errno.h132
-rw-r--r--include/asm-arm/fcntl.h59
-rw-r--r--include/asm-arm/floppy.h113
-rw-r--r--include/asm-arm/hardirq.h23
-rw-r--r--include/asm-arm/hardware.h271
-rw-r--r--include/asm-arm/ide.h85
-rw-r--r--include/asm-arm/init.h24
-rw-r--r--include/asm-arm/io.h203
-rw-r--r--include/asm-arm/ioctl.h75
-rw-r--r--include/asm-arm/ioctls.h80
-rw-r--r--include/asm-arm/ipc.h28
-rw-r--r--include/asm-arm/irq-no.h11
-rw-r--r--include/asm-arm/irq.h13
-rw-r--r--include/asm-arm/limits.h11
-rw-r--r--include/asm-arm/mm-init.h46
-rw-r--r--include/asm-arm/mman.h32
-rw-r--r--include/asm-arm/mmu_context.h17
-rw-r--r--include/asm-arm/namei.h18
-rw-r--r--include/asm-arm/page.h20
-rw-r--r--include/asm-arm/param.h1
-rw-r--r--include/asm-arm/pgtable.h10
-rw-r--r--include/asm-arm/poll.h25
-rw-r--r--include/asm-arm/posix_types.h60
-rw-r--r--include/asm-arm/proc-armo/assembler.h88
-rw-r--r--include/asm-arm/proc-armo/mm-init-flat.h82
-rw-r--r--include/asm-arm/proc-armo/mm-init.h130
-rw-r--r--include/asm-arm/proc-armo/page.h69
-rw-r--r--include/asm-arm/proc-armo/param.h27
-rw-r--r--include/asm-arm/proc-armo/pgtable-flat.h307
-rw-r--r--include/asm-arm/proc-armo/pgtable.h403
-rw-r--r--include/asm-arm/proc-armo/processor.h118
-rw-r--r--include/asm-arm/proc-armo/ptrace.h65
-rw-r--r--include/asm-arm/proc-armo/semaphore.h83
-rw-r--r--include/asm-arm/proc-armo/shmparam.h18
-rw-r--r--include/asm-arm/proc-armo/system.h124
-rw-r--r--include/asm-arm/proc-armo/uaccess.h140
-rw-r--r--include/asm-arm/proc-armo/uncompress.h7
-rw-r--r--include/asm-arm/proc-armv/assembler.h84
-rw-r--r--include/asm-arm/proc-armv/mm-init.h118
-rw-r--r--include/asm-arm/proc-armv/page.h68
-rw-r--r--include/asm-arm/proc-armv/param.h27
-rw-r--r--include/asm-arm/proc-armv/pgtable.h617
-rw-r--r--include/asm-arm/proc-armv/processor.h103
-rw-r--r--include/asm-arm/proc-armv/ptrace.h75
-rw-r--r--include/asm-arm/proc-armv/semaphore.h81
-rw-r--r--include/asm-arm/proc-armv/shmparam.h19
-rw-r--r--include/asm-arm/proc-armv/system.h137
-rw-r--r--include/asm-arm/proc-armv/uaccess.h204
-rw-r--r--include/asm-arm/proc-armv/uncompress.h22
-rw-r--r--include/asm-arm/proc-fns.h111
-rw-r--r--include/asm-arm/processor.h51
-rw-r--r--include/asm-arm/procinfo.h32
-rw-r--r--include/asm-arm/ptrace.h11
-rw-r--r--include/asm-arm/resource.h39
-rw-r--r--include/asm-arm/scatterlist.h13
-rw-r--r--include/asm-arm/segment.h11
-rw-r--r--include/asm-arm/semaphore.h67
-rw-r--r--include/asm-arm/serial.h15
-rw-r--r--include/asm-arm/setup.h49
-rw-r--r--include/asm-arm/shmparam.h47
-rw-r--r--include/asm-arm/sigcontext.h33
-rw-r--r--include/asm-arm/siginfo.h195
-rw-r--r--include/asm-arm/signal.h147
-rw-r--r--include/asm-arm/smp.h7
-rw-r--r--include/asm-arm/smp_lock.h17
-rw-r--r--include/asm-arm/socket.h33
-rw-r--r--include/asm-arm/sockios.h12
-rw-r--r--include/asm-arm/softirq.h68
-rw-r--r--include/asm-arm/spinlock.h59
-rw-r--r--include/asm-arm/stat.h41
-rw-r--r--include/asm-arm/statfs.h25
-rw-r--r--include/asm-arm/string.h24
-rw-r--r--include/asm-arm/system.h33
-rw-r--r--include/asm-arm/termbits.h161
-rw-r--r--include/asm-arm/termios.h98
-rw-r--r--include/asm-arm/timex.h13
-rw-r--r--include/asm-arm/types.h45
-rw-r--r--include/asm-arm/uaccess.h194
-rw-r--r--include/asm-arm/ucontext.h12
-rw-r--r--include/asm-arm/unaligned.h59
-rw-r--r--include/asm-arm/unistd.h371
-rw-r--r--include/asm-arm/user.h82
-rw-r--r--include/asm-arm/vt.h8
-rw-r--r--include/asm-i386/bugs.h75
-rw-r--r--include/asm-i386/elf.h20
-rw-r--r--include/asm-i386/floppy.h194
-rw-r--r--include/asm-i386/hardirq.h23
-rw-r--r--include/asm-i386/ioctls.h2
-rw-r--r--include/asm-i386/irq.h9
-rw-r--r--include/asm-i386/pgtable.h11
-rw-r--r--include/asm-i386/processor.h60
-rw-r--r--include/asm-i386/semaphore.h13
-rw-r--r--include/asm-i386/signal.h9
-rw-r--r--include/asm-i386/smp.h35
-rw-r--r--include/asm-i386/socket.h4
-rw-r--r--include/asm-i386/softirq.h81
-rw-r--r--include/asm-i386/spinlock.h5
-rw-r--r--include/asm-i386/system.h17
-rw-r--r--include/asm-i386/types.h2
-rw-r--r--include/asm-i386/uaccess.h335
-rw-r--r--include/asm-i386/unistd.h3
-rw-r--r--include/asm-m68k/amigahw.h1
-rw-r--r--include/asm-m68k/amigamouse.h26
-rw-r--r--include/asm-m68k/amihdreg.h31
-rw-r--r--include/asm-m68k/apollohw.h71
-rw-r--r--include/asm-m68k/atari_SCCserial.h4
-rw-r--r--include/asm-m68k/atari_rootsec.h34
-rw-r--r--include/asm-m68k/atari_stram.h17
-rw-r--r--include/asm-m68k/atarihdreg.h24
-rw-r--r--include/asm-m68k/atarihw.h49
-rw-r--r--include/asm-m68k/bitops.h96
-rw-r--r--include/asm-m68k/bootinfo.h138
-rw-r--r--include/asm-m68k/bugs.h4
-rw-r--r--include/asm-m68k/elf.h18
-rw-r--r--include/asm-m68k/entry.h13
-rw-r--r--include/asm-m68k/font.h35
-rw-r--r--include/asm-m68k/hardirq.h1
-rw-r--r--include/asm-m68k/ide.h103
-rw-r--r--include/asm-m68k/init.h19
-rw-r--r--include/asm-m68k/io.h29
-rw-r--r--include/asm-m68k/ioctls.h2
-rw-r--r--include/asm-m68k/keyboard.h11
-rw-r--r--include/asm-m68k/mac_asc.h27
-rw-r--r--include/asm-m68k/mac_mouse.h23
-rw-r--r--include/asm-m68k/machdep.h8
-rw-r--r--include/asm-m68k/machw.h108
-rw-r--r--include/asm-m68k/macintosh.h139
-rw-r--r--include/asm-m68k/macints.h160
-rw-r--r--include/asm-m68k/mvme16xhw.h118
-rw-r--r--include/asm-m68k/pgtable.h23
-rw-r--r--include/asm-m68k/processor.h22
-rw-r--r--include/asm-m68k/ptrace.h6
-rw-r--r--include/asm-m68k/segment.h30
-rw-r--r--include/asm-m68k/serial.h113
-rw-r--r--include/asm-m68k/setup.h68
-rw-r--r--include/asm-m68k/siginfo.h195
-rw-r--r--include/asm-m68k/signal.h135
-rw-r--r--include/asm-m68k/socket.h6
-rw-r--r--include/asm-m68k/softirq.h10
-rw-r--r--include/asm-m68k/system.h9
-rw-r--r--include/asm-m68k/types.h2
-rw-r--r--include/asm-m68k/ucontext.h32
-rw-r--r--include/asm-m68k/unistd.h18
-rw-r--r--include/asm-mips/elf.h22
-rw-r--r--include/asm-mips/errno.h3
-rw-r--r--include/asm-mips/hardirq.h1
-rw-r--r--include/asm-mips/ioctls.h2
-rw-r--r--include/asm-mips/offset.h58
-rw-r--r--include/asm-mips/pgtable.h3
-rw-r--r--include/asm-mips/processor.h6
-rw-r--r--include/asm-mips/semaphore.h4
-rw-r--r--include/asm-mips/smp.h2
-rw-r--r--include/asm-mips/socket.h6
-rw-r--r--include/asm-mips/softirq.h31
-rw-r--r--include/asm-mips/stackframe.h42
-rw-r--r--include/asm-mips/types.h1
-rw-r--r--include/asm-mips/unistd.h5
-rw-r--r--include/asm-ppc/adb.h57
-rw-r--r--include/asm-ppc/adb_mouse.h23
-rw-r--r--include/asm-ppc/atomic.h1
-rw-r--r--include/asm-ppc/cache.h3
-rw-r--r--include/asm-ppc/cuda.h35
-rw-r--r--include/asm-ppc/delay.h1
-rw-r--r--include/asm-ppc/dma.h73
-rw-r--r--include/asm-ppc/elf.h37
-rw-r--r--include/asm-ppc/gg2.h59
-rw-r--r--include/asm-ppc/hardirq.h3
-rw-r--r--include/asm-ppc/hydra.h11
-rw-r--r--include/asm-ppc/ide.h112
-rw-r--r--include/asm-ppc/io.h45
-rw-r--r--include/asm-ppc/ioctls.h2
-rw-r--r--include/asm-ppc/irq.h2
-rw-r--r--include/asm-ppc/linux_logo.h562
-rw-r--r--include/asm-ppc/md.h13
-rw-r--r--include/asm-ppc/mmu.h141
-rw-r--r--include/asm-ppc/page.h20
-rw-r--r--include/asm-ppc/pgtable.h51
-rw-r--r--include/asm-ppc/processor.h146
-rw-r--r--include/asm-ppc/prom.h33
-rw-r--r--include/asm-ppc/scatterlist.h20
-rw-r--r--include/asm-ppc/siginfo.h195
-rw-r--r--include/asm-ppc/signal.h85
-rw-r--r--include/asm-ppc/smp.h20
-rw-r--r--include/asm-ppc/smp_lock.h24
-rw-r--r--include/asm-ppc/socket.h2
-rw-r--r--include/asm-ppc/softirq.h12
-rw-r--r--include/asm-ppc/spinlock.h103
-rw-r--r--include/asm-ppc/system.h17
-rw-r--r--include/asm-ppc/types.h2
-rw-r--r--include/asm-ppc/uaccess.h11
-rw-r--r--include/asm-ppc/ucontext.h13
-rw-r--r--include/asm-ppc/unistd.h4
-rw-r--r--include/asm-sparc/asm_offsets.h86
-rw-r--r--include/asm-sparc/auxio.h4
-rw-r--r--include/asm-sparc/bitops.h9
-rw-r--r--include/asm-sparc/byteorder.h1
-rw-r--r--include/asm-sparc/delay.h6
-rw-r--r--include/asm-sparc/elf.h28
-rw-r--r--include/asm-sparc/head.h4
-rw-r--r--include/asm-sparc/io-unit.h43
-rw-r--r--include/asm-sparc/ioctls.h3
-rw-r--r--include/asm-sparc/irq.h13
-rw-r--r--include/asm-sparc/kdebug.h6
-rw-r--r--include/asm-sparc/kgdb.h12
-rw-r--r--include/asm-sparc/md.h13
-rw-r--r--include/asm-sparc/namei.h45
-rw-r--r--include/asm-sparc/obio.h203
-rw-r--r--include/asm-sparc/oplib.h2
-rw-r--r--include/asm-sparc/page.h13
-rw-r--r--include/asm-sparc/pgtable.h4
-rw-r--r--include/asm-sparc/processor.h15
-rw-r--r--include/asm-sparc/psr.h34
-rw-r--r--include/asm-sparc/ross.h3
-rw-r--r--include/asm-sparc/sbi.h107
-rw-r--r--include/asm-sparc/sbus.h6
-rw-r--r--include/asm-sparc/siginfo.h199
-rw-r--r--include/asm-sparc/signal.h68
-rw-r--r--include/asm-sparc/socket.h10
-rw-r--r--include/asm-sparc/string.h6
-rw-r--r--include/asm-sparc/svr4.h2
-rw-r--r--include/asm-sparc/timer.h16
-rw-r--r--include/asm-sparc/types.h4
-rw-r--r--include/asm-sparc/uaccess.h19
-rw-r--r--include/asm-sparc/unaligned.h2
-rw-r--r--include/asm-sparc/unistd.h23
-rw-r--r--include/asm-sparc64/asm_offsets.h198
-rw-r--r--include/asm-sparc64/bitops.h12
-rw-r--r--include/asm-sparc64/byteorder.h6
-rw-r--r--include/asm-sparc64/delay.h8
-rw-r--r--include/asm-sparc64/ebus.h5
-rw-r--r--include/asm-sparc64/elf.h37
-rw-r--r--include/asm-sparc64/floppy.h33
-rw-r--r--include/asm-sparc64/fpumacro.h10
-rw-r--r--include/asm-sparc64/io.h55
-rw-r--r--include/asm-sparc64/ioctls.h5
-rw-r--r--include/asm-sparc64/irq.h5
-rw-r--r--include/asm-sparc64/kdebug.h6
-rw-r--r--include/asm-sparc64/keyboard.h28
-rw-r--r--include/asm-sparc64/md.h91
-rw-r--r--include/asm-sparc64/mmu_context.h5
-rw-r--r--include/asm-sparc64/namei.h39
-rw-r--r--include/asm-sparc64/ns87303.h84
-rw-r--r--include/asm-sparc64/page.h7
-rw-r--r--include/asm-sparc64/pbm.h17
-rw-r--r--include/asm-sparc64/pgtable.h37
-rw-r--r--include/asm-sparc64/posix_types.h2
-rw-r--r--include/asm-sparc64/processor.h94
-rw-r--r--include/asm-sparc64/ptrace.h4
-rw-r--r--include/asm-sparc64/reg.h88
-rw-r--r--include/asm-sparc64/sigcontext.h4
-rw-r--r--include/asm-sparc64/siginfo.h277
-rw-r--r--include/asm-sparc64/signal.h101
-rw-r--r--include/asm-sparc64/socket.h10
-rw-r--r--include/asm-sparc64/string.h6
-rw-r--r--include/asm-sparc64/svr4.h2
-rw-r--r--include/asm-sparc64/system.h14
-rw-r--r--include/asm-sparc64/ttable.h18
-rw-r--r--include/asm-sparc64/types.h4
-rw-r--r--include/asm-sparc64/uaccess.h49
-rw-r--r--include/asm-sparc64/unaligned.h2
-rw-r--r--include/asm-sparc64/unistd.h49
-rw-r--r--include/asm-sparc64/utrap.h51
-rw-r--r--include/linux/adfs_fs.h183
-rw-r--r--include/linux/adfs_fs_fs.h177
-rw-r--r--include/linux/adfs_fs_i.h17
-rw-r--r--include/linux/adfs_fs_sb.h29
-rw-r--r--include/linux/affs_fs.h8
-rw-r--r--include/linux/affs_fs_sb.h1
-rw-r--r--include/linux/apm_bios.h11
-rw-r--r--include/linux/arcdevice.h4
-rw-r--r--include/linux/baycom.h5
-rw-r--r--include/linux/blk.h17
-rw-r--r--include/linux/blkdev.h14
-rw-r--r--include/linux/byteorder/pdp_endian.h (renamed from include/linux/byteorder/vax_endian.h)29
-rw-r--r--include/linux/byteorder/swabb.h17
-rw-r--r--include/linux/cd1400.h2
-rw-r--r--include/linux/cdk.h6
-rw-r--r--include/linux/cdrom.h5
-rw-r--r--include/linux/coda.h838
-rw-r--r--include/linux/coda_cache.h80
-rw-r--r--include/linux/coda_cnode.h47
-rw-r--r--include/linux/coda_fs_i.h52
-rw-r--r--include/linux/coda_linux.h108
-rw-r--r--include/linux/coda_namecache.h160
-rw-r--r--include/linux/coda_opstats.h27
-rw-r--r--include/linux/coda_psdev.h96
-rw-r--r--include/linux/comstats.h2
-rw-r--r--include/linux/config.h24
-rw-r--r--include/linux/console.h1
-rw-r--r--include/linux/ctype.h2
-rw-r--r--include/linux/dcache.h8
-rw-r--r--include/linux/elf.h50
-rw-r--r--include/linux/elfcore.h4
-rw-r--r--include/linux/etherdevice.h5
-rw-r--r--include/linux/ext2_fs.h5
-rw-r--r--include/linux/fat_cvf.h49
-rw-r--r--include/linux/fd.h2
-rw-r--r--include/linux/file.h9
-rw-r--r--include/linux/filter.h107
-rw-r--r--include/linux/fs.h124
-rw-r--r--include/linux/genhd.h36
-rw-r--r--include/linux/hdlcdrv.h16
-rw-r--r--include/linux/hdreg.h14
-rw-r--r--include/linux/hfs_fs.h324
-rw-r--r--include/linux/hfs_fs_i.h40
-rw-r--r--include/linux/hfs_fs_sb.h52
-rw-r--r--include/linux/hfs_sysdep.h224
-rw-r--r--include/linux/if.h3
-rw-r--r--include/linux/if_arp.h17
-rw-r--r--include/linux/if_packet.h5
-rw-r--r--include/linux/if_ppp.h6
-rw-r--r--include/linux/if_pppvar.h34
-rw-r--r--include/linux/if_shaper.h5
-rw-r--r--include/linux/if_slip.h2
-rw-r--r--include/linux/igmp.h1
-rw-r--r--include/linux/in_route.h4
-rw-r--r--include/linux/inetdevice.h60
-rw-r--r--include/linux/interrupt.h7
-rw-r--r--include/linux/ip.h4
-rw-r--r--include/linux/ip_fw.h13
-rw-r--r--include/linux/ipv6_route.h9
-rw-r--r--include/linux/ipx.h9
-rw-r--r--include/linux/isdn.h20
-rw-r--r--include/linux/iso_fs.h4
-rw-r--r--include/linux/iso_fs_i.h2
-rw-r--r--include/linux/iso_fs_sb.h1
-rw-r--r--include/linux/istallion.h3
-rw-r--r--include/linux/kernel.h6
-rw-r--r--include/linux/kernel_stat.h23
-rw-r--r--include/linux/kerneld.h35
-rw-r--r--include/linux/linkage.h5
-rw-r--r--include/linux/lp.h25
-rw-r--r--include/linux/mc146818rtc.h2
-rw-r--r--include/linux/minix_fs.h2
-rw-r--r--include/linux/minix_fs_sb.h4
-rw-r--r--include/linux/miscdevice.h2
-rw-r--r--include/linux/mm.h46
-rw-r--r--include/linux/module.h1
-rw-r--r--include/linux/msdos_fs.h14
-rw-r--r--include/linux/msdos_fs_i.h9
-rw-r--r--include/linux/msdos_fs_sb.h3
-rw-r--r--include/linux/ncp_fs.h83
-rw-r--r--include/linux/ncp_fs_sb.h27
-rw-r--r--include/linux/ncp_mount.h15
-rw-r--r--include/linux/net.h6
-rw-r--r--include/linux/netdevice.h70
-rw-r--r--include/linux/netlink.h3
-rw-r--r--include/linux/nfs.h15
-rw-r--r--include/linux/nfs_fs.h83
-rw-r--r--include/linux/nfs_fs_i.h6
-rw-r--r--include/linux/nfs_fs_sb.h5
-rw-r--r--include/linux/nfsd/nfsd.h3
-rw-r--r--include/linux/nfsd/nfsfh.h19
-rw-r--r--include/linux/nls.h1
-rw-r--r--include/linux/notifier.h1
-rw-r--r--include/linux/ntfs_fs.h7
-rw-r--r--include/linux/ntfs_fs_i.h79
-rw-r--r--include/linux/ntfs_fs_sb.h44
-rw-r--r--include/linux/parport.h266
-rw-r--r--include/linux/parport_pc.h117
-rw-r--r--include/linux/pci.h206
-rw-r--r--include/linux/personality.h2
-rw-r--r--include/linux/poll.h6
-rw-r--r--include/linux/ppp-comp.h7
-rw-r--r--include/linux/proc_fs.h18
-rw-r--r--include/linux/route.h3
-rw-r--r--include/linux/rtnetlink.h406
-rw-r--r--include/linux/sc26198.h12
-rw-r--r--include/linux/sched.h54
-rw-r--r--include/linux/sdla_fr.h12
-rw-r--r--include/linux/sdla_x25.h5
-rw-r--r--include/linux/signal.h5
-rw-r--r--include/linux/skbuff.h93
-rw-r--r--include/linux/slab.h18
-rw-r--r--include/linux/smb_fs.h11
-rw-r--r--include/linux/smb_fs_i.h5
-rw-r--r--include/linux/smb_fs_sb.h1
-rw-r--r--include/linux/smp.h53
-rw-r--r--include/linux/sockios.h8
-rw-r--r--include/linux/soundmodem.h5
-rw-r--r--include/linux/stallion.h4
-rw-r--r--include/linux/sunrpc/sched.h4
-rw-r--r--include/linux/sunrpc/stats.h3
-rw-r--r--include/linux/sunrpc/svcsock.h2
-rw-r--r--include/linux/swap.h64
-rw-r--r--include/linux/sysctl.h124
-rw-r--r--include/linux/sysv_fs.h4
-rw-r--r--include/linux/sysv_fs_sb.h10
-rw-r--r--include/linux/timer.h68
-rw-r--r--include/linux/tty.h6
-rw-r--r--include/linux/tty_driver.h1
-rw-r--r--include/linux/ufs_fs.h172
-rw-r--r--include/linux/ufs_fs_i.h9
-rw-r--r--include/linux/ufs_fs_sb.h5
-rw-r--r--include/linux/umsdos_fs.h124
-rw-r--r--include/linux/umsdos_fs.p107
-rw-r--r--include/linux/uts.h23
-rw-r--r--include/linux/videodev.h17
-rw-r--r--include/linux/wanpipe.h67
-rw-r--r--include/linux/wanrouter.h50
-rw-r--r--include/linux/wireless.h2
-rw-r--r--include/net/addrconf.h37
-rw-r--r--include/net/arp.h38
-rw-r--r--include/net/checksum.h16
-rw-r--r--include/net/dst.h55
-rw-r--r--include/net/if_inet6.h53
-rw-r--r--include/net/inet_common.h2
-rw-r--r--include/net/ip.h92
-rw-r--r--include/net/ip6_fib.h20
-rw-r--r--include/net/ip6_route.h18
-rw-r--r--include/net/ip_fib.h38
-rw-r--r--include/net/ip_masq.h1
-rw-r--r--include/net/ipv6.h29
-rw-r--r--include/net/ipx.h6
-rw-r--r--include/net/ndisc.h106
-rw-r--r--include/net/neighbour.h316
-rw-r--r--include/net/pkt_sched.h6
-rw-r--r--include/net/profile.h311
-rw-r--r--include/net/route.h56
-rw-r--r--include/net/scm.h1
-rw-r--r--include/net/sock.h81
-rw-r--r--include/net/tcp.h64
539 files changed, 23704 insertions, 4152 deletions
diff --git a/include/asm-alpha/a.out.h b/include/asm-alpha/a.out.h
index f1965d5ca..073b90a99 100644
--- a/include/asm-alpha/a.out.h
+++ b/include/asm-alpha/a.out.h
@@ -90,7 +90,8 @@ struct exec
#ifdef __KERNEL__
-#define STACK_TOP (0x00120000000UL)
+#define STACK_TOP \
+ ((current->personality==PER_LINUX_32BIT) ? (0x80000000) : (0x00120000000UL))
#endif
diff --git a/include/asm-alpha/apecs.h b/include/asm-alpha/apecs.h
index 0f38c8aac..161813515 100644
--- a/include/asm-alpha/apecs.h
+++ b/include/asm-alpha/apecs.h
@@ -31,7 +31,7 @@
BIOS ROMs. So we must put the windows high enough to avoid these areas.
We put window 1 at BUS 64Mb for 64Mb, mapping physical 0 to 64Mb-1,
- and window 2 at BUS 512Mb for 512Mb, mapping physical 0 to 512Mb-1.
+ and window 2 at BUS 1Gb for 1Gb, mapping physical 0 to 1Gb-1.
Yes, this does map 0 to 64Mb-1 twice, but only window 1 will actually
be used for that range (via virt_to_bus()).
@@ -53,12 +53,14 @@
DMAable memory; they count on being able to DMA to any memory they
get from kmalloc()/get_free_pages(). They will also use window 1 for
any physical memory accesses below 64Mb; the rest will be handled by
- window 2, maxing out at 512Mb of memory. I trust this is enough... :-)
+ window 2, maxing out at 1Gb of memory. I trust this is enough... :-)
- Finally, the reason we make window 2 start at 512Mb for 512Mb, is so that
- we can allocate PCI bus devices' memory starting at 1Gb and up, to ensure
- that no conflicts occur and bookkeeping is simplified (ie we don't
- try to fill the gap between the two windows, we just go above the top).
+ We hope that the area before the first window is large enough so that
+ there will be no overlap at the top end (64Mb). We *must* locate the
+ PCI cards' memory just below window 1, so that there's still the
+ possibility of being able to access it via SPARSE space. This is
+ important for cards such as the Matrox Millennium, whose Xserver
+ wants to access memory-mapped registers in byte and short lengths.
Note that the XL is treated differently from the AVANTI, even though
for most other things they are identical. It didn't seem reasonable to
@@ -69,8 +71,8 @@
#define APECS_XL_DMA_WIN1_BASE (64*1024*1024)
#define APECS_XL_DMA_WIN1_SIZE (64*1024*1024)
#define APECS_XL_DMA_WIN1_SIZE_PARANOID (48*1024*1024)
-#define APECS_XL_DMA_WIN2_BASE (512*1024*1024)
-#define APECS_XL_DMA_WIN2_SIZE (512*1024*1024)
+#define APECS_XL_DMA_WIN2_BASE (1024*1024*1024)
+#define APECS_XL_DMA_WIN2_SIZE (1024*1024*1024)
#else /* CONFIG_ALPHA_XL */
diff --git a/include/asm-alpha/cache.h b/include/asm-alpha/cache.h
index c1276cb1e..c9b94b76b 100644
--- a/include/asm-alpha/cache.h
+++ b/include/asm-alpha/cache.h
@@ -4,9 +4,9 @@
#ifndef __ARCH_ALPHA_CACHE_H
#define __ARCH_ALPHA_CACHE_H
-/* bytes per L1 cache line */
-#define L1_CACHE_BYTES 32 /* a guess */
-
-#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
+/* Bytes per L1 (data) cache line. Both EV4 and EV5 are write-through,
+ read-allocate, direct-mapped, physical. */
+#define L1_CACHE_BYTES 32
+#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
#endif
diff --git a/include/asm-alpha/dma.h b/include/asm-alpha/dma.h
index b5c3c1c7c..d8077298d 100644
--- a/include/asm-alpha/dma.h
+++ b/include/asm-alpha/dma.h
@@ -313,5 +313,7 @@ static __inline__ int get_dma_residue(unsigned int dmanr)
/* These are in kernel/dma.c: */
extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */
extern void free_dma(unsigned int dmanr); /* release it again */
+#define KERNEL_HAVE_CHECK_DMA
+extern int check_dma(unsigned int dmanr);
#endif /* _ASM_DMA_H */
diff --git a/include/asm-alpha/elf.h b/include/asm-alpha/elf.h
index eb5df17f6..89657ba78 100644
--- a/include/asm-alpha/elf.h
+++ b/include/asm-alpha/elf.h
@@ -1,5 +1,5 @@
-#ifndef __ASMaxp_ELF_H
-#define __ASMaxp_ELF_H
+#ifndef __ASM_ALPHA_ELF_H
+#define __ASM_ALPHA_ELF_H
/*
* ELF register definitions..
@@ -39,7 +39,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
the loader. We need to make sure that it is out of the way of the program
that it will "exec", and that there is sufficient room for the brk. */
-#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
+#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000)
/* $0 is set by ld.so to a pointer to a function which might be
registered using atexit. This provides a mean for the dynamic
@@ -98,4 +98,38 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
_dest[32] = _dump.regs[EF_PS]; \
}
+/* This yields a mask that user programs can use to figure out what
+ instruction set this cpu supports. This is trivial on Alpha,
+ but not so on other machines. */
+
+#define ELF_HWCAP \
+({ \
+ /* Sadly, most folks don't yet have assemblers that know about \
+ amask. This is "amask v0, v0" */ \
+ register long _v0 __asm("$0") = -1; \
+ __asm(".long 0x47e00c20" : "=r"(_v0) : "0"(_v0)); \
+ ~_v0; \
+})
+
+/* This yields a string that ld.so will use to load implementation
+ specific libraries for optimization. This is more specific in
+ intent than poking at uname or /proc/cpuinfo.
+
+ This might do with checking bwx simultaneously... */
+
+#define ELF_PLATFORM \
+({ \
+ /* Or "implver v0" ... */ \
+ register long _v0 __asm("$0"); \
+ __asm(".long 0x47e03d80" : "=r"(_v0)); \
+ _v0 == 0 ? "ev4" : "ev5"; \
+})
+
+#ifdef __KERNEL__
+#define SET_PERSONALITY(EX, IBCS2) \
+ current->personality = \
+ ((EX).e_flags & EF_ALPHA_32BIT \
+ ? PER_LINUX_32BIT : (IBCS2) ? PER_SVR4 : PER_LINUX)
+#endif
+
#endif
diff --git a/include/asm-alpha/fpu.h b/include/asm-alpha/fpu.h
index 25148b14b..ab9b28f6e 100644
--- a/include/asm-alpha/fpu.h
+++ b/include/asm-alpha/fpu.h
@@ -81,4 +81,38 @@ ieee_swcr_to_fpcr(unsigned long sw)
return fp;
}
+#ifdef __KERNEL__
+
+/* The following two functions don't need trapb/excb instructions
+ around the mf_fpcr/mt_fpcr instructions because (a) the kernel
+ never generates arithmetic faults and (b) call_pal instructions
+ are implied trap barriers. */
+
+static inline unsigned long rdfpcr(void)
+{
+ unsigned long tmp, ret;
+ __asm__ ("stt $f0,%0\n\t"
+ "mf_fpcr $f0\n\t"
+ "stt $f0,%1\n\t"
+ "ldt $f0,%0"
+ : "=m"(tmp), "=m"(ret));
+ return ret;
+}
+
+static inline void wrfpcr(unsigned long val)
+{
+ unsigned long tmp;
+ __asm__ __volatile__ (
+ "stt $f0,%0\n\t"
+ "ldt $f0,%1\n\t"
+ "mt_fpcr $f0\n\t"
+ "ldt $f0,%0"
+ : "=m"(tmp) : "m"(val));
+}
+
+extern unsigned long alpha_read_fp_reg (unsigned long reg);
+extern void alpha_write_fp_reg (unsigned long reg, unsigned long val);
+
+#endif /* __KERNEL__ */
+
#endif /* __ASM_ALPHA_FPU_H */
diff --git a/include/asm-alpha/hardirq.h b/include/asm-alpha/hardirq.h
index 79bf079ed..733216be9 100644
--- a/include/asm-alpha/hardirq.h
+++ b/include/asm-alpha/hardirq.h
@@ -4,7 +4,6 @@
#include <linux/tasks.h>
extern unsigned int local_irq_count[NR_CPUS];
-#define in_interrupt() (local_irq_count[smp_processor_id()] != 0)
#ifndef __SMP__
diff --git a/include/asm-alpha/hwrpb.h b/include/asm-alpha/hwrpb.h
index 662aa35f6..4f6c5d01e 100644
--- a/include/asm-alpha/hwrpb.h
+++ b/include/asm-alpha/hwrpb.h
@@ -15,6 +15,8 @@
#define EV45_CPU 6 /* EV4.5 (21064/xxx) */
#define EV56_CPU 7 /* EV5.6 (21164) */
#define EV6_CPU 8 /* EV6 (21164) */
+#define PCA56_CPU 9 /* PCA56 (21164PC) */
+#define PCA57_CPU 10 /* PCA57 (??) */
/*
* DEC system types for Alpha systems. Found in HWRPB.
@@ -39,7 +41,26 @@
#define ST_DEC_EB64P 20 /* EB64+ systype */
#define ST_DEC_EB66P -19 /* EB66 systype */
#define ST_DEC_EBPC64 -20 /* Cabriolet (AlphaPC64) systype */
+#define ST_DEC_BURNS 21 /* Laptop systype */
+#define ST_DEC_RAWHIDE 22 /* Rawhide systype */
+#define ST_DEC_K2 23 /* K2 systype */
+#define ST_DEC_LYNX 24 /* Lynx systype */
+#define ST_DEC_XL 25 /* Alpha XL systype */
#define ST_DEC_EB164 26 /* EB164 systype */
+#define ST_DEC_NORITAKE 27 /* Noritake systype */
+#define ST_DEC_CORTEX 28 /* Cortex systype */
+#define ST_DEC_MIATA 30 /* MIATA systype */
+#define ST_DEC_XXM 31 /* XXM systype */
+#define ST_DEC_TAKARA 32 /* Takara systype */
+#define ST_DEC_YUKON 33 /* Yukon systype */
+#define ST_DEC_TSUNAMI 34 /* Tsunami systype */
+#define ST_DEC_WILDFIRE 35 /* Wildfire systype */
+#define ST_DEC_CUSCO 36 /* CUSCO systype */
+
+/* UNOFFICIAL!!! */
+#define ST_UNOFFICIAL_BIAS 100
+#define ST_DTI_RUFFIAN 101 /* RUFFIAN systype */
+
struct pcb_struct {
unsigned long ksp;
diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h
index a81f5289e..da03e68db 100644
--- a/include/asm-alpha/io.h
+++ b/include/asm-alpha/io.h
@@ -80,6 +80,10 @@ extern void _sethae (unsigned long addr); /* cached version */
# include <asm/apecs.h> /* get chip-specific definitions */
#elif defined(CONFIG_ALPHA_CIA)
# include <asm/cia.h> /* get chip-specific definitions */
+#elif defined(CONFIG_ALPHA_T2)
+# include <asm/t2.h> /* get chip-specific definitions */
+#elif defined(CONFIG_ALPHA_PYXIS)
+# include <asm/pyxis.h> /* get chip-specific definitions */
#else
# include <asm/jensen.h>
#endif
diff --git a/include/asm-alpha/ioctls.h b/include/asm-alpha/ioctls.h
index 203bde501..2a065c5b6 100644
--- a/include/asm-alpha/ioctls.h
+++ b/include/asm-alpha/ioctls.h
@@ -86,6 +86,8 @@
#define TIOCSBRK 0x5427 /* BSD compatibility */
#define TIOCCBRK 0x5428 /* BSD compatibility */
#define TIOCGSID 0x5429 /* Return the session ID of FD */
+#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
#define TIOCSERCONFIG 0x5453
#define TIOCSERGWILD 0x5454
diff --git a/include/asm-alpha/irq.h b/include/asm-alpha/irq.h
index c1f6939c0..5c81ff6a3 100644
--- a/include/asm-alpha/irq.h
+++ b/include/asm-alpha/irq.h
@@ -10,12 +10,19 @@
#include <linux/linkage.h>
#include <linux/config.h>
-#if defined(CONFIG_ALPHA_CABRIOLET) || defined(CONFIG_ALPHA_EB66P) || defined(CONFIG_ALPHA_EB164) || defined(CONFIG_ALPHA_PC164)
+#if defined(CONFIG_ALPHA_CABRIOLET) || defined(CONFIG_ALPHA_EB66P) || \
+ defined(CONFIG_ALPHA_EB164) || defined(CONFIG_ALPHA_PC164) || \
+ defined(CONFIG_ALPHA_LX164)
# define NR_IRQS 33
-#elif defined(CONFIG_ALPHA_EB66) || defined(CONFIG_ALPHA_EB64P) || defined(CONFIG_ALPHA_MIKASA)
+#elif defined(CONFIG_ALPHA_EB66) || defined(CONFIG_ALPHA_EB64P) || \
+ defined(CONFIG_ALPHA_MIKASA)
# define NR_IRQS 32
-#elif defined(CONFIG_ALPHA_ALCOR) || defined(CONFIG_ALPHA_XLT)
+#elif defined(CONFIG_ALPHA_ALCOR) || defined(CONFIG_ALPHA_XLT) || \
+ defined(CONFIG_ALPHA_MIATA) || defined(CONFIG_ALPHA_NORITAKE) || \
+ defined(CONFIG_ALPHA_RUFFIAN)
# define NR_IRQS 48
+#elif defined(CONFIG_ALPHA_SABLE) || defined(CONFIG_ALPHA_SX164)
+# define NR_IRQS 40
#else
# define NR_IRQS 16
#endif
diff --git a/include/asm-alpha/lca.h b/include/asm-alpha/lca.h
index 43c6e9eca..1eb35a2e4 100644
--- a/include/asm-alpha/lca.h
+++ b/include/asm-alpha/lca.h
@@ -130,6 +130,37 @@
#define HAE_ADDRESS LCA_IOC_HAE
+/* LCA PMR Power Management register defines */
+#define LCA_PMR_ADDR (IDENT_ADDR + 0x120000098UL)
+#define LCA_PMR_PDIV 0x7 /* Primary clock divisor */
+#define LCA_PMR_ODIV 0x38 /* Override clock divisor */
+#define LCA_PMR_INTO 0x40 /* Interrupt override */
+#define LCA_PMR_DMAO 0x80 /* DMA override */
+#define LCA_PMR_OCCEB 0xffff0000L /* Override cycle counter - even
+ bits */
+#define LCA_PMR_OCCOB 0xffff000000000000L /* Override cycle counter - even
+ bits */
+#define LCA_PMR_PRIMARY_MASK 0xfffffffffffffff8
+/* LCA PMR Macros */
+
+#define READ_PMR (*(volatile unsigned long *)LCA_PMR_ADDR)
+#define WRITE_PMR(d) (*((volatile unsigned long *)LCA_PMR_ADDR) = (d))
+
+#define GET_PRIMARY(r) ((r) & LCA_PMR_PDIV)
+#define GET_OVERRIDE(r) (((r) >> 3) & LCA_PMR_PDIV)
+#define SET_PRIMARY_CLOCK(r, c) ((r) = (((r) & LCA_PMR_PRIMARY_MASK) | (c)))
+
+/* LCA PMR Divisor values */
+#define DIV_1 0x0
+#define DIV_1_5 0x1
+#define DIV_2 0x2
+#define DIV_4 0x3
+#define DIV_8 0x4
+#define DIV_16 0x5
+#define DIV_MIN DIV_1
+#define DIV_MAX DIV_16
+
+
#ifdef __KERNEL__
/*
diff --git a/include/asm-alpha/mman.h b/include/asm-alpha/mman.h
index a08ec81df..ddfe6bda4 100644
--- a/include/asm-alpha/mman.h
+++ b/include/asm-alpha/mman.h
@@ -13,9 +13,9 @@
#define MAP_ANONYMOUS 0x10 /* don't use a file */
/* not used by linux, but here to make sure we don't clash with OSF/1 defines */
-#define MAP_HASSEMAPHORE 0x0200
-#define MAP_INHERIT 0x0400
-#define MAP_UNALIGNED 0x0800
+#define _MAP_HASSEMAPHORE 0x0200
+#define _MAP_INHERIT 0x0400
+#define _MAP_UNALIGNED 0x0800
/* These are linux-specific */
#define MAP_GROWSDOWN 0x1000 /* stack-like segment */
diff --git a/include/asm-alpha/pal.h b/include/asm-alpha/pal.h
index a4ef2e38a..510d13326 100644
--- a/include/asm-alpha/pal.h
+++ b/include/asm-alpha/pal.h
@@ -7,7 +7,6 @@
#define PAL_halt 0
#define PAL_cflush 1
#define PAL_draina 2
-#define PAL_cobratt 9
#define PAL_bpt 128
#define PAL_bugchk 129
#define PAL_chmk 131
@@ -27,6 +26,8 @@
/*
* OSF specific PAL-code
*/
+#define PAL_cserve 9
+#define PAL_wripir 13
#define PAL_rdmces 16
#define PAL_wrmces 17
#define PAL_wrfen 43
diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h
index 47f1bf4f6..2b805db93 100644
--- a/include/asm-alpha/processor.h
+++ b/include/asm-alpha/processor.h
@@ -15,7 +15,8 @@
/* This decides where the kernel will search for a free chunk of vm
* space during mmap's.
*/
-#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
+#define TASK_UNMAPPED_BASE \
+ ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2)
/*
* Bus types
@@ -93,7 +94,7 @@ extern void release_thread(struct task_struct *);
/* NOTE: The task struct and the stack go together! */
#define alloc_task_struct() \
- ((struct task_struct *) __get_free_pages(GFP_KERNEL,1,0))
+ ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
#define free_task_struct(p) free_pages((unsigned long)(p),1)
#define init_task (init_task_union.task)
diff --git a/include/asm-alpha/pyxis.h b/include/asm-alpha/pyxis.h
new file mode 100644
index 000000000..9d3d49595
--- /dev/null
+++ b/include/asm-alpha/pyxis.h
@@ -0,0 +1,436 @@
+#ifndef __ALPHA_PYXIS__H__
+#define __ALPHA_PYXIS__H__
+
+#include <linux/config.h> /* CONFIG_ALPHA_RUFFIAN. */
+#include <linux/types.h>
+
+/*
+ * PYXIS is the internal name for a cor logic chipset which provides
+ * memory controller and PCI access for the 21164A chip based systems.
+ *
+ * This file is based on:
+ *
+ * Pyxis Chipset Spec
+ * 14-Jun-96
+ * Rev. X2.0
+ *
+ */
+
+/*------------------------------------------------------------------------**
+** **
+** I/O procedures **
+** **
+** inport[b|w|t|l], outport[b|w|t|l] 8:16:24:32 IO xfers **
+** inportbxt: 8 bits only **
+** inport: alias of inportw **
+** outport: alias of outportw **
+** **
+** inmem[b|w|t|l], outmem[b|w|t|l] 8:16:24:32 ISA memory xfers **
+** inmembxt: 8 bits only **
+** inmem: alias of inmemw **
+** outmem: alias of outmemw **
+** **
+**------------------------------------------------------------------------*/
+
+
+/* CIA ADDRESS BIT DEFINITIONS
+ *
+ * 3 3 3 3|3 3 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1
+ * 9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |1| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |0|0|0|
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | \_/ \_/
+ * | | |
+ * +-- IO space, not cached. Byte Enable --+ |
+ * Transfer Length --+
+ *
+ *
+ *
+ * Byte Transfer
+ * Enable Length Transfer Byte Address
+ * adr<6:5> adr<4:3> Length Enable Adder
+ * ---------------------------------------------
+ * 00 00 Byte 1110 0x000
+ * 01 00 Byte 1101 0x020
+ * 10 00 Byte 1011 0x040
+ * 11 00 Byte 0111 0x060
+ *
+ * 00 01 Word 1100 0x008
+ * 01 01 Word 1001 0x028 <= Not supported in this code.
+ * 10 01 Word 0011 0x048
+ *
+ * 00 10 Tribyte 1000 0x010
+ * 01 10 Tribyte 0001 0x030
+ *
+ * 10 11 Longword 0000 0x058
+ *
+ * Note that byte enables are asserted low.
+ *
+ */
+
+#define BYTE_ENABLE_SHIFT 5
+#define TRANSFER_LENGTH_SHIFT 3
+#define MEM_SP1_MASK 0x1fffffff /* Mem sparse space 1 mask is 29 bits */
+
+
+#define PYXIS_DMA_WIN_BASE (1024UL*1024UL*1024UL)
+#define PYXIS_DMA_WIN_SIZE (1024*1024*1024)
+
+/*
+ * General Registers
+ */
+#define PYXIS_REV (IDENT_ADDR + 0x8740000080UL)
+#define PYXIS_PCI_LAT (IDENT_ADDR + 0x87400000C0UL)
+#define PYXIS_CTRL (IDENT_ADDR + 0x8740000100UL)
+#define PYXIS_CTRL1 (IDENT_ADDR + 0x8740000140UL)
+#define PYXIS_FLASH_CTRL (IDENT_ADDR + 0x8740000200UL)
+
+#define PYXIS_HAE_MEM (IDENT_ADDR + 0x8740000400UL)
+#define PYXIS_HAE_IO (IDENT_ADDR + 0x8740000440UL)
+#define PYXIS_CFG (IDENT_ADDR + 0x8740000480UL)
+
+/*
+ * Diagnostic Registers
+ */
+#define PYXIS_DIAG (IDENT_ADDR + 0x8740002000UL)
+#define PYXIS_DIAG_CHECK (IDENT_ADDR + 0x8740003000UL)
+
+/*
+ * Performance Monitor registers (p4-3)
+ */
+#define PYXIS_PERF_MONITOR (IDENT_ADDR + 0x8740004000UL)
+#define PYXIS_PERF_CONTROL (IDENT_ADDR + 0x8740004040UL)
+
+/*
+ * 21171-CA Error registers (p4-3)
+ */
+#define PYXIS_ERR (IDENT_ADDR + 0x8740008200UL)
+#define PYXIS_STAT (IDENT_ADDR + 0x8740008240UL)
+#define PYXIS_ERR_MASK (IDENT_ADDR + 0x8740008280UL)
+#define PYXIS_SYN (IDENT_ADDR + 0x8740008300UL)
+#define PYXIS_ERR_DATA (IDENT_ADDR + 0x8740008308UL)
+
+#define PYXIS_MEAR (IDENT_ADDR + 0x8740008400UL)
+#define PYXIS_MESR (IDENT_ADDR + 0x8740008440UL)
+#define PYXIS_PCI_ERR0 (IDENT_ADDR + 0x8740008800UL)
+#define PYXIS_PCI_ERR1 (IDENT_ADDR + 0x8740008840UL)
+#define PYXIS_PCI_ERR2 (IDENT_ADDR + 0x8740008880UL)
+
+/*
+ * PCI Address Translation Registers. I've only defined
+ * the first window fully as that's the only one that we're currently using.
+ * The other window bases are needed to disable the windows.
+ */
+#define PYXIS_TBIA (IDENT_ADDR + 0x8760000100UL)
+#define PYXIS_W0_BASE (IDENT_ADDR + 0x8760000400UL)
+#define PYXIS_W0_MASK (IDENT_ADDR + 0x8760000440UL)
+#define PYXIS_T0_BASE (IDENT_ADDR + 0x8760000480UL)
+
+#define PYXIS_W1_BASE (IDENT_ADDR + 0x8760000500UL)
+#define PYXIS_W2_BASE (IDENT_ADDR + 0x8760000600UL)
+#define PYXIS_W3_BASE (IDENT_ADDR + 0x8760000700UL)
+
+/*
+ * Memory Control registers
+ */
+#define PYXIS_MCR (IDENT_ADDR + 0x8750000000UL)
+
+/*
+ * Memory spaces:
+ */
+#define PYXIS_IACK_SC (IDENT_ADDR + 0x8720000000UL)
+#define PYXIS_CONF (IDENT_ADDR + 0x8700000000UL)
+#define PYXIS_IO (IDENT_ADDR + 0x8580000000UL)
+#define PYXIS_SPARSE_MEM (IDENT_ADDR + 0x8000000000UL)
+#define PYXIS_DENSE_MEM (IDENT_ADDR + 0x8600000000UL)
+
+/*
+ * Interrupt Control registers
+ */
+#define PYXIS_INT_REQ (IDENT_ADDR + 0x87A0000000UL)
+#define PYXIS_INT_MASK (IDENT_ADDR + 0x87A0000040UL)
+#define PYXIS_INT_HILO (IDENT_ADDR + 0x87A00000C0UL)
+#define PYXIS_INT_ROUTE (IDENT_ADDR + 0x87A0000140UL)
+#define PYXIS_GPO (IDENT_ADDR + 0x87A0000180UL)
+#define PYXIS_INT_CNFG (IDENT_ADDR + 0x87A00001C0UL)
+#define PYXIS_RT_COUNT (IDENT_ADDR + 0x87A0000200UL)
+#define PYXIS_INT_TIME (IDENT_ADDR + 0x87A0000240UL)
+#define PYXIS_IIC_CTRL (IDENT_ADDR + 0x87A00002C0UL)
+
+/*
+ * Bit definitions for I/O Controller status register 0:
+ */
+#define PYXIS_STAT0_CMD 0xf
+#define PYXIS_STAT0_ERR (1<<4)
+#define PYXIS_STAT0_LOST (1<<5)
+#define PYXIS_STAT0_THIT (1<<6)
+#define PYXIS_STAT0_TREF (1<<7)
+#define PYXIS_STAT0_CODE_SHIFT 8
+#define PYXIS_STAT0_CODE_MASK 0x7
+#define PYXIS_STAT0_P_NBR_SHIFT 13
+#define PYXIS_STAT0_P_NBR_MASK 0x7ffff
+
+#define HAE_ADDRESS PYXIS_HAE_MEM
+
+#ifdef __KERNEL__
+
+/*
+ * Translate physical memory address as seen on (PCI) bus into
+ * a kernel virtual address and vv.
+ */
+
+#if defined(CONFIG_ALPHA_RUFFIAN)
+/* Ruffian doesn't do 1G PCI window. */
+
+extern inline unsigned long virt_to_bus(void * address)
+{
+ return virt_to_phys(address);
+}
+
+extern inline void * bus_to_virt(unsigned long address)
+{
+ return phys_to_virt(address);
+}
+#else
+extern inline unsigned long virt_to_bus(void * address)
+{
+ return virt_to_phys(address) + PYXIS_DMA_WIN_BASE;
+}
+
+extern inline void * bus_to_virt(unsigned long address)
+{
+ return phys_to_virt(address - PYXIS_DMA_WIN_BASE);
+}
+#endif /* RUFFIAN */
+
+/*
+ * I/O functions:
+ *
+ * PYXIS (the 2117x PCI/memory support chipset for the EV5 (21164)
+ * series of processors uses a sparse address mapping scheme to
+ * get at PCI memory and I/O.
+ */
+
+#define vuip volatile unsigned int *
+
+extern inline unsigned int __inb(unsigned long addr)
+{
+ long result = *(vuip) ((addr << 5) + PYXIS_IO + 0x00);
+ result >>= (addr & 3) * 8;
+ return 0xffUL & result;
+}
+
+extern inline void __outb(unsigned char b, unsigned long addr)
+{
+ unsigned int w;
+
+ asm ("insbl %2,%1,%0" : "r="(w) : "ri"(addr & 0x3), "r"(b));
+ *(vuip) ((addr << 5) + PYXIS_IO + 0x00) = w;
+ mb();
+}
+
+extern inline unsigned int __inw(unsigned long addr)
+{
+ long result = *(vuip) ((addr << 5) + PYXIS_IO + 0x08);
+ result >>= (addr & 3) * 8;
+ return 0xffffUL & result;
+}
+
+extern inline void __outw(unsigned short b, unsigned long addr)
+{
+ unsigned int w;
+
+ asm ("inswl %2,%1,%0" : "r="(w) : "ri"(addr & 0x3), "r"(b));
+ *(vuip) ((addr << 5) + PYXIS_IO + 0x08) = w;
+ mb();
+}
+
+extern inline unsigned int __inl(unsigned long addr)
+{
+ return *(vuip) ((addr << 5) + PYXIS_IO + 0x18);
+}
+
+extern inline void __outl(unsigned int b, unsigned long addr)
+{
+ *(vuip) ((addr << 5) + PYXIS_IO + 0x18) = b;
+ mb();
+}
+
+
+/*
+ * Memory functions. 64-bit and 32-bit accesses are done through
+ * dense memory space, everything else through sparse space.
+ *
+ * For reading and writing 8 and 16 bit quantities we need to
+ * go through one of the three sparse address mapping regions
+ * and use the HAE_MEM CSR to provide some bits of the address.
+ * The following few routines use only sparse address region 1
+ * which gives 1Gbyte of accessible space which relates exactly
+ * to the amount of PCI memory mapping *into* system address space.
+ * See p 6-17 of the specification but it looks something like this:
+ *
+ * 21164 Address:
+ *
+ * 3 2 1
+ * 9876543210987654321098765432109876543210
+ * 1ZZZZ0.PCI.QW.Address............BBLL
+ *
+ * ZZ = SBZ
+ * BB = Byte offset
+ * LL = Transfer length
+ *
+ * PCI Address:
+ *
+ * 3 2 1
+ * 10987654321098765432109876543210
+ * HHH....PCI.QW.Address........ 00
+ *
+ * HHH = 31:29 HAE_MEM CSR
+ *
+ */
+
+extern inline void pyxis_set_hae(unsigned long new_hae)
+{
+ unsigned long ipl = swpipl(7);
+ hae.cache = new_hae;
+ *hae.reg = new_hae;
+ mb();
+ new_hae = *hae.reg; /* read it to be sure it got out */
+ setipl(ipl);
+}
+
+extern inline unsigned long __readb(unsigned long addr)
+{
+ unsigned long result, shift, msb, work, temp;
+
+ shift = (addr & 0x3) << 3;
+ msb = addr & 0xE0000000UL;
+ temp = addr & MEM_SP1_MASK ;
+ if (msb != hae.cache) {
+ pyxis_set_hae(msb);
+ }
+ work = ((temp << 5) + PYXIS_SPARSE_MEM + 0x00);
+ result = *(vuip) work;
+ result >>= shift;
+ return 0x0ffUL & result;
+}
+
+extern inline unsigned long __readw(unsigned long addr)
+{
+ unsigned long result, shift, msb, work, temp;
+
+ shift = (addr & 0x3) << 3;
+ msb = addr & 0xE0000000UL;
+ temp = addr & MEM_SP1_MASK ;
+ if (msb != hae.cache) {
+ pyxis_set_hae(msb);
+ }
+ work = ((temp << 5) + PYXIS_SPARSE_MEM + 0x08);
+ result = *(vuip) work;
+ result >>= shift;
+ return 0x0ffffUL & result;
+}
+
+extern inline unsigned long __readl(unsigned long addr)
+{
+ return *(vuip) (addr + PYXIS_DENSE_MEM);
+}
+
+extern inline void __writeb(unsigned char b, unsigned long addr)
+{
+ unsigned long msb ;
+
+ msb = addr & 0xE0000000 ;
+ addr &= MEM_SP1_MASK ;
+ if (msb != hae.cache) {
+ pyxis_set_hae(msb);
+ }
+ *(vuip) ((addr << 5) + PYXIS_SPARSE_MEM + 0x00) = b * 0x01010101;
+}
+
+extern inline void __writew(unsigned short b, unsigned long addr)
+{
+ unsigned long msb ;
+
+ msb = addr & 0xE0000000 ;
+ addr &= MEM_SP1_MASK ;
+ if (msb != hae.cache) {
+ pyxis_set_hae(msb);
+ }
+ *(vuip) ((addr << 5) + PYXIS_SPARSE_MEM + 0x08) = b * 0x00010001;
+}
+
+extern inline void __writel(unsigned int b, unsigned long addr)
+{
+ *(vuip) (addr + PYXIS_DENSE_MEM) = b;
+}
+
+#define inb(port) \
+(__builtin_constant_p((port))?__inb(port):_inb(port))
+
+#define outb(x, port) \
+(__builtin_constant_p((port))?__outb((x),(port)):_outb((x),(port)))
+
+#define readl(a) __readl((unsigned long)(a))
+#define writel(v,a) __writel((v),(unsigned long)(a))
+
+#undef vuip
+
+extern unsigned long pyxis_init (unsigned long mem_start,
+ unsigned long mem_end);
+
+#endif /* __KERNEL__ */
+
+/*
+ * Data structure for handling PYXIS machine checks:
+ */
+struct el_PYXIS_sysdata_mcheck {
+ u_long coma_gcr;
+ u_long coma_edsr;
+ u_long coma_ter;
+ u_long coma_elar;
+ u_long coma_ehar;
+ u_long coma_ldlr;
+ u_long coma_ldhr;
+ u_long coma_base0;
+ u_long coma_base1;
+ u_long coma_base2;
+ u_long coma_cnfg0;
+ u_long coma_cnfg1;
+ u_long coma_cnfg2;
+ u_long epic_dcsr;
+ u_long epic_pear;
+ u_long epic_sear;
+ u_long epic_tbr1;
+ u_long epic_tbr2;
+ u_long epic_pbr1;
+ u_long epic_pbr2;
+ u_long epic_pmr1;
+ u_long epic_pmr2;
+ u_long epic_harx1;
+ u_long epic_harx2;
+ u_long epic_pmlt;
+ u_long epic_tag0;
+ u_long epic_tag1;
+ u_long epic_tag2;
+ u_long epic_tag3;
+ u_long epic_tag4;
+ u_long epic_tag5;
+ u_long epic_tag6;
+ u_long epic_tag7;
+ u_long epic_data0;
+ u_long epic_data1;
+ u_long epic_data2;
+ u_long epic_data3;
+ u_long epic_data4;
+ u_long epic_data5;
+ u_long epic_data6;
+ u_long epic_data7;
+};
+
+#define RTC_PORT(x) (0x70 + (x))
+#define RTC_ADDR(x) (0x80 | (x))
+#define RTC_ALWAYS_BCD 0
+
+#endif /* __ALPHA_PYXIS__H__ */
diff --git a/include/asm-alpha/signal.h b/include/asm-alpha/signal.h
index 06c3bb7e3..80e27df1a 100644
--- a/include/asm-alpha/signal.h
+++ b/include/asm-alpha/signal.h
@@ -145,10 +145,17 @@ struct k_sigaction {
/* Here we must cater to libcs that poke about in kernel headers. */
struct sigaction {
- __sighandler_t sa_handler;
+ union {
+ __sighandler_t _sa_handler;
+ void (*_sa_sigaction)(int, struct siginfo *, void *);
+ } _u;
sigset_t sa_mask;
int sa_flags;
};
+
+#define sa_handler _u._sa_handler
+#define sa_sigaction _u._sa_sigaction
+
#endif /* __KERNEL__ */
typedef struct sigaltstack {
diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h
index d206bcc3b..f7596af91 100644
--- a/include/asm-alpha/smp.h
+++ b/include/asm-alpha/smp.h
@@ -1,6 +1,8 @@
#ifndef __ASM_SMP_H
#define __ASM_SMP_H
+#define cpu_logical_map(cpu) (cpu)
+
/* We'll get here eventually.. */
#endif
diff --git a/include/asm-alpha/socket.h b/include/asm-alpha/socket.h
index bbaf9b6c4..a40786fad 100644
--- a/include/asm-alpha/socket.h
+++ b/include/asm-alpha/socket.h
@@ -39,15 +39,15 @@
#define SO_PEERCRED 18
#define SO_BINDTODEVICE 25
-#define SO_BINDTODEVICE 25
+/* Socket filtering */
+#define SO_ATTACH_FILTER 26
+#define SO_DETACH_FILTER 27
/* Security levels - as per NRL IPv6 - don't actually do anything */
#define SO_SECURITY_AUTHENTICATION 19
#define SO_SECURITY_ENCRYPTION_TRANSPORT 20
#define SO_SECURITY_ENCRYPTION_NETWORK 21
-#define SO_BINDTODEVICE 22
-
/* Socket types. */
#define SOCK_STREAM 1 /* stream (connection) socket */
#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
diff --git a/include/asm-alpha/softirq.h b/include/asm-alpha/softirq.h
index 456103536..96be9ed43 100644
--- a/include/asm-alpha/softirq.h
+++ b/include/asm-alpha/softirq.h
@@ -5,7 +5,7 @@
* is entirely private to an implementation, it should not be
* referenced at all outside of this file.
*/
-extern atomic_t __alpha_bh_counter;
+extern unsigned int local_bh_count[NR_CPUS];
#define get_active_bhs() (bh_mask & bh_active)
@@ -43,51 +43,49 @@ extern inline void mark_bh(int nr)
}
/*
- * These use a mask count to correctly handle
- * nested disable/enable calls
- */
-extern inline void disable_bh(int nr)
-{
- bh_mask &= ~(1 << nr);
- bh_mask_count[nr]++;
-}
-
-extern inline void enable_bh(int nr)
-{
- if (!--bh_mask_count[nr])
- bh_mask |= 1 << nr;
-}
-
-/*
* start_bh_atomic/end_bh_atomic also nest
* naturally by using a counter
*/
extern inline void start_bh_atomic(void)
{
-#ifdef __SMP__
- atomic_inc(&__alpha_bh_counter);
- synchronize_irq();
-#else
- atomic_inc(&__alpha_bh_counter);
-#endif
+ local_bh_count[smp_processor_id()]++;
+ barrier();
}
extern inline void end_bh_atomic(void)
{
- atomic_dec(&__alpha_bh_counter);
+ barrier();
+ local_bh_count[smp_processor_id()]--;
}
#ifndef __SMP__
/* These are for the irq's testing the lock */
-#define softirq_trylock() (atomic_read(&__alpha_bh_counter) ? \
- 0 : \
- ((atomic_set(&__alpha_bh_counter,1)),1))
-#define softirq_endlock() (atomic_set(&__alpha_bh_counter, 0))
+#define softirq_trylock(cpu) \
+ (local_bh_count[cpu] ? 0 : (local_bh_count[cpu] = 1))
+#define softirq_endlock(cpu) \
+ (local_bh_count[cpu] = 0)
#else
#error FIXME
#endif /* __SMP__ */
+
+/*
+ * These use a mask count to correctly handle
+ * nested disable/enable calls
+ */
+extern inline void disable_bh(int nr)
+{
+ bh_mask &= ~(1 << nr);
+ bh_mask_count[nr]++;
+}
+
+extern inline void enable_bh(int nr)
+{
+ if (!--bh_mask_count[nr])
+ bh_mask |= 1 << nr;
+}
+
#endif /* _ALPHA_SOFTIRQ_H */
diff --git a/include/asm-alpha/t2.h b/include/asm-alpha/t2.h
new file mode 100644
index 000000000..1f4f8c741
--- /dev/null
+++ b/include/asm-alpha/t2.h
@@ -0,0 +1,508 @@
+#ifndef __ALPHA_T2__H__
+#define __ALPHA_T2__H__
+
+#include <linux/types.h>
+
+/*
+ * T2 is the internal name for the core logic chipset which provides
+ * memory controller and PCI access for the SABLE-based systems.
+ *
+ * This file is based on:
+ *
+ * SABLE I/O Specification
+ * Revision/Update Information: 1.3
+ *
+ * jestabro@amt.tay1.dec.com Initial Version.
+ *
+ */
+
+#define BYTE_ENABLE_SHIFT 5
+#define TRANSFER_LENGTH_SHIFT 3
+#define MEM_SP1_MASK 0x1fffffff /* Mem sparse space 1 mask is 29 bits */
+
+
+#define T2_DMA_WIN_BASE (1024UL*1024UL*1024UL)
+#define T2_DMA_WIN_SIZE (1024*1024*1024)
+
+/*
+ * Memory spaces:
+ */
+#define T2_CONF (IDENT_ADDR + 0x390000000UL)
+#define T2_IO (IDENT_ADDR + 0x3a0000000UL)
+#define T2_SPARSE_MEM (IDENT_ADDR + 0x200000000UL)
+#define T2_DENSE_MEM (IDENT_ADDR + 0x3c0000000UL)
+
+#define T2_IOCSR (IDENT_ADDR + 0x38e000000UL)
+#define T2_CERR1 (IDENT_ADDR + 0x38e000020UL)
+#define T2_CERR2 (IDENT_ADDR + 0x38e000040UL)
+#define T2_CERR3 (IDENT_ADDR + 0x38e000060UL)
+#define T2_PERR1 (IDENT_ADDR + 0x38e000080UL)
+#define T2_PERR2 (IDENT_ADDR + 0x38e0000a0UL)
+#define T2_PSCR (IDENT_ADDR + 0x38e0000c0UL)
+#define T2_HAE_1 (IDENT_ADDR + 0x38e0000e0UL)
+#define T2_HAE_2 (IDENT_ADDR + 0x38e000100UL)
+#define T2_HBASE (IDENT_ADDR + 0x38e000120UL)
+#define T2_WBASE1 (IDENT_ADDR + 0x38e000140UL)
+#define T2_WMASK1 (IDENT_ADDR + 0x38e000160UL)
+#define T2_TBASE1 (IDENT_ADDR + 0x38e000180UL)
+#define T2_WBASE2 (IDENT_ADDR + 0x38e0001a0UL)
+#define T2_WMASK2 (IDENT_ADDR + 0x38e0001c0UL)
+#define T2_TBASE2 (IDENT_ADDR + 0x38e0001e0UL)
+#define T2_TLBBR (IDENT_ADDR + 0x38e000200UL)
+
+#define T2_HAE_3 (IDENT_ADDR + 0x38e000240UL)
+#define T2_HAE_4 (IDENT_ADDR + 0x38e000260UL)
+
+#define HAE_ADDRESS T2_HAE_1
+
+/* T2 CSRs are in the non-cachable primary IO space from 3.8000.0000 to
+ 3.8fff.ffff
+ *
+ * +--------------+ 3 8000 0000
+ * | CPU 0 CSRs |
+ * +--------------+ 3 8100 0000
+ * | CPU 1 CSRs |
+ * +--------------+ 3 8200 0000
+ * | CPU 2 CSRs |
+ * +--------------+ 3 8300 0000
+ * | CPU 3 CSRs |
+ * +--------------+ 3 8400 0000
+ * | CPU Reserved |
+ * +--------------+ 3 8700 0000
+ * | Mem Reserved |
+ * +--------------+ 3 8800 0000
+ * | Mem 0 CSRs |
+ * +--------------+ 3 8900 0000
+ * | Mem 1 CSRs |
+ * +--------------+ 3 8a00 0000
+ * | Mem 2 CSRs |
+ * +--------------+ 3 8b00 0000
+ * | Mem 3 CSRs |
+ * +--------------+ 3 8c00 0000
+ * | Mem Reserved |
+ * +--------------+ 3 8e00 0000
+ * | PCI Bridge |
+ * +--------------+ 3 8f00 0000
+ * | Expansion IO |
+ * +--------------+ 3 9000 0000
+ *
+ *
+ */
+#define CPU0_BASE (IDENT_ADDR + 0x380000000L)
+#define CPU1_BASE (IDENT_ADDR + 0x381000000L)
+#define CPU2_BASE (IDENT_ADDR + 0x382000000L)
+#define CPU3_BASE (IDENT_ADDR + 0x383000000L)
+#define MEM0_BASE (IDENT_ADDR + 0x388000000L)
+#define MEM1_BASE (IDENT_ADDR + 0x389000000L)
+#define MEM2_BASE (IDENT_ADDR + 0x38a000000L)
+#define MEM3_BASE (IDENT_ADDR + 0x38b000000L)
+
+#ifdef __KERNEL__
+
+/*
+ * Translate physical memory address as seen on (PCI) bus into
+ * a kernel virtual address and vv.
+ */
+extern inline unsigned long virt_to_bus(void * address)
+{
+ return virt_to_phys(address) + T2_DMA_WIN_BASE;
+}
+
+extern inline void * bus_to_virt(unsigned long address)
+{
+ return phys_to_virt(address - T2_DMA_WIN_BASE);
+}
+
+/*
+ * I/O functions:
+ *
+ * T2 (the core logic PCI/memory support chipset for the SABLE
+ * series of processors uses a sparse address mapping scheme to
+ * get at PCI memory and I/O.
+ */
+
+#define vuip volatile unsigned int *
+
+extern inline unsigned int __inb(unsigned long addr)
+{
+ long result = *(vuip) ((addr << 5) + T2_IO + 0x00);
+ result >>= (addr & 3) * 8;
+ return 0xffUL & result;
+}
+
+extern inline void __outb(unsigned char b, unsigned long addr)
+{
+ unsigned int w;
+
+ asm ("insbl %2,%1,%0" : "r="(w) : "ri"(addr & 0x3), "r"(b));
+ *(vuip) ((addr << 5) + T2_IO + 0x00) = w;
+ mb();
+}
+
+extern inline unsigned int __inw(unsigned long addr)
+{
+ long result = *(vuip) ((addr << 5) + T2_IO + 0x08);
+ result >>= (addr & 3) * 8;
+ return 0xffffUL & result;
+}
+
+extern inline void __outw(unsigned short b, unsigned long addr)
+{
+ unsigned int w;
+
+ asm ("inswl %2,%1,%0" : "r="(w) : "ri"(addr & 0x3), "r"(b));
+ *(vuip) ((addr << 5) + T2_IO + 0x08) = w;
+ mb();
+}
+
+extern inline unsigned int __inl(unsigned long addr)
+{
+ return *(vuip) ((addr << 5) + T2_IO + 0x18);
+}
+
+extern inline void __outl(unsigned int b, unsigned long addr)
+{
+ *(vuip) ((addr << 5) + T2_IO + 0x18) = b;
+ mb();
+}
+
+
+/*
+ * Memory functions. 64-bit and 32-bit accesses are done through
+ * dense memory space, everything else through sparse space.
+ *
+ * For reading and writing 8 and 16 bit quantities we need to
+ * go through one of the three sparse address mapping regions
+ * and use the HAE_MEM CSR to provide some bits of the address.
+ * The following few routines use only sparse address region 1
+ * which gives 1Gbyte of accessible space which relates exactly
+ * to the amount of PCI memory mapping *into* system address space.
+ * See p 6-17 of the specification but it looks something like this:
+ *
+ * 21164 Address:
+ *
+ * 3 2 1
+ * 9876543210987654321098765432109876543210
+ * 1ZZZZ0.PCI.QW.Address............BBLL
+ *
+ * ZZ = SBZ
+ * BB = Byte offset
+ * LL = Transfer length
+ *
+ * PCI Address:
+ *
+ * 3 2 1
+ * 10987654321098765432109876543210
+ * HHH....PCI.QW.Address........ 00
+ *
+ * HHH = 31:29 HAE_MEM CSR
+ *
+ */
+
+extern inline unsigned long __readb(unsigned long addr)
+{
+ unsigned long result, shift, msb;
+
+ shift = (addr & 0x3) * 8 ;
+ msb = addr & 0xE0000000 ;
+ addr &= MEM_SP1_MASK ;
+ if (msb != hae.cache) {
+ set_hae(msb);
+ }
+ result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x00) ;
+ result >>= shift;
+ return 0xffUL & result;
+}
+
+extern inline unsigned long __readw(unsigned long addr)
+{
+ unsigned long result, shift, msb;
+
+ shift = (addr & 0x3) * 8;
+ msb = addr & 0xE0000000 ;
+ addr &= MEM_SP1_MASK ;
+ if (msb != hae.cache) {
+ set_hae(msb);
+ }
+ result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08);
+ result >>= shift;
+ return 0xffffUL & result;
+}
+
+/* on SABLE with T2, we must use SPARSE memory even for 32-bit access */
+extern inline unsigned long __readl(unsigned long addr)
+{
+ unsigned long result, msb;
+
+ msb = addr & 0xE0000000 ;
+ addr &= MEM_SP1_MASK ;
+ if (msb != hae.cache) {
+ set_hae(msb);
+ }
+ result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18);
+ return 0xffffffffUL & result;
+}
+
+extern inline void __writeb(unsigned char b, unsigned long addr)
+{
+ unsigned long msb ;
+
+ msb = addr & 0xE0000000 ;
+ addr &= MEM_SP1_MASK ;
+ if (msb != hae.cache) {
+ set_hae(msb);
+ }
+ *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x00) = b * 0x01010101;
+}
+
+extern inline void __writew(unsigned short b, unsigned long addr)
+{
+ unsigned long msb ;
+
+ msb = addr & 0xE0000000 ;
+ addr &= MEM_SP1_MASK ;
+ if (msb != hae.cache) {
+ set_hae(msb);
+ }
+ *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08) = b * 0x00010001;
+}
+
+/* on SABLE with T2, we must use SPARSE memory even for 32-bit access */
+extern inline void __writel(unsigned int b, unsigned long addr)
+{
+ unsigned long msb ;
+
+ msb = addr & 0xE0000000 ;
+ addr &= MEM_SP1_MASK ;
+ if (msb != hae.cache) {
+ set_hae(msb);
+ }
+ *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18) = b;
+}
+
+#define inb(port) \
+(__builtin_constant_p((port))?__inb(port):_inb(port))
+
+#define outb(x, port) \
+(__builtin_constant_p((port))?__outb((x),(port)):_outb((x),(port)))
+
+#define readl(a) __readl((unsigned long)(a))
+#define writel(v,a) __writel((v),(unsigned long)(a))
+
+#undef vuip
+
+extern unsigned long t2_init (unsigned long mem_start,
+ unsigned long mem_end);
+
+#endif /* __KERNEL__ */
+
+/*
+ * Sable CPU Module CSRS
+ *
+ * These are CSRs for hardware other than the CPU chip on the CPU module.
+ * The CPU module has Backup Cache control logic, Cbus control logic, and
+ * interrupt control logic on it. There is a duplicate tag store to speed
+ * up maintaining cache coherency.
+ */
+
+struct sable_cpu_csr {
+unsigned long bcc; long fill_00[3]; /* Backup Cache Control */
+unsigned long bcce; long fill_01[3]; /* Backup Cache Correctable Error */
+unsigned long bccea; long fill_02[3]; /* B-Cache Corr Err Address Latch */
+unsigned long bcue; long fill_03[3]; /* B-Cache Uncorrectable Error */
+unsigned long bcuea; long fill_04[3]; /* B-Cache Uncorr Err Addr Latch */
+unsigned long dter; long fill_05[3]; /* Duplicate Tag Error */
+unsigned long cbctl; long fill_06[3]; /* CBus Control */
+unsigned long cbe; long fill_07[3]; /* CBus Error */
+unsigned long cbeal; long fill_08[3]; /* CBus Error Addr Latch low */
+unsigned long cbeah; long fill_09[3]; /* CBus Error Addr Latch high */
+unsigned long pmbx; long fill_10[3]; /* Processor Mailbox */
+unsigned long ipir; long fill_11[3]; /* Inter-Processor Int Request */
+unsigned long sic; long fill_12[3]; /* System Interrupt Clear */
+unsigned long adlk; long fill_13[3]; /* Address Lock (LDxL/STxC) */
+unsigned long madrl; long fill_14[3]; /* CBus Miss Address */
+unsigned long rev; long fill_15[3]; /* CMIC Revision */
+};
+
+/*
+ * Data structure for handling T2 machine checks:
+ */
+struct el_t2_frame_header {
+ unsigned int elcf_fid; /* Frame ID (from above) */
+ unsigned int elcf_size; /* Size of frame in bytes */
+};
+
+struct el_t2_procdata_mcheck {
+ unsigned long elfmc_paltemp[32]; /* PAL TEMP REGS. */
+ /* EV4-specific fields */
+ unsigned long elfmc_exc_addr; /* Addr of excepting insn. */
+ unsigned long elfmc_exc_sum; /* Summary of arith traps. */
+ unsigned long elfmc_exc_mask; /* Exception mask (from exc_sum). */
+ unsigned long elfmc_iccsr; /* IBox hardware enables. */
+ unsigned long elfmc_pal_base; /* Base address for PALcode. */
+ unsigned long elfmc_hier; /* Hardware Interrupt Enable. */
+ unsigned long elfmc_hirr; /* Hardware Interrupt Request. */
+ unsigned long elfmc_mm_csr; /* D-stream fault info. */
+ unsigned long elfmc_dc_stat; /* D-cache status (ECC/Parity Err). */
+ unsigned long elfmc_dc_addr; /* EV3 Phys Addr for ECC/DPERR. */
+ unsigned long elfmc_abox_ctl; /* ABox Control Register. */
+ unsigned long elfmc_biu_stat; /* BIU Status. */
+ unsigned long elfmc_biu_addr; /* BUI Address. */
+ unsigned long elfmc_biu_ctl; /* BIU Control. */
+ unsigned long elfmc_fill_syndrome; /* For correcting ECC errors. */
+ unsigned long elfmc_fill_addr;/* Cache block which was being read. */
+ unsigned long elfmc_va; /* Effective VA of fault or miss. */
+ unsigned long elfmc_bc_tag; /* Backup Cache Tag Probe Results. */
+};
+
+/*
+ * Sable processor specific Machine Check Data segment.
+ */
+
+struct el_t2_logout_header {
+ unsigned int elfl_size; /* size in bytes of logout area. */
+ int elfl_sbz1:31; /* Should be zero. */
+ char elfl_retry:1; /* Retry flag. */
+ unsigned int elfl_procoffset; /* Processor-specific offset. */
+ unsigned int elfl_sysoffset; /* Offset of system-specific. */
+ unsigned int elfl_error_type; /* PAL error type code. */
+ unsigned int elfl_frame_rev; /* PAL Frame revision. */
+};
+struct el_t2_sysdata_mcheck {
+ unsigned long elcmc_bcc; /* CSR 0 */
+ unsigned long elcmc_bcce; /* CSR 1 */
+ unsigned long elcmc_bccea; /* CSR 2 */
+ unsigned long elcmc_bcue; /* CSR 3 */
+ unsigned long elcmc_bcuea; /* CSR 4 */
+ unsigned long elcmc_dter; /* CSR 5 */
+ unsigned long elcmc_cbctl; /* CSR 6 */
+ unsigned long elcmc_cbe; /* CSR 7 */
+ unsigned long elcmc_cbeal; /* CSR 8 */
+ unsigned long elcmc_cbeah; /* CSR 9 */
+ unsigned long elcmc_pmbx; /* CSR 10 */
+ unsigned long elcmc_ipir; /* CSR 11 */
+ unsigned long elcmc_sic; /* CSR 12 */
+ unsigned long elcmc_adlk; /* CSR 13 */
+ unsigned long elcmc_madrl; /* CSR 14 */
+ unsigned long elcmc_crrev4; /* CSR 15 */
+};
+
+/*
+ * Sable memory error frame - sable pfms section 3.42
+ */
+struct el_t2_data_memory {
+ struct el_t2_frame_header elcm_hdr; /* ID$MEM-FERR = 0x08 */
+ unsigned int elcm_module; /* Module id. */
+ unsigned int elcm_res04; /* Reserved. */
+ unsigned long elcm_merr; /* CSR0: Error Reg 1. */
+ unsigned long elcm_mcmd1; /* CSR1: Command Trap 1. */
+ unsigned long elcm_mcmd2; /* CSR2: Command Trap 2. */
+ unsigned long elcm_mconf; /* CSR3: Configuration. */
+ unsigned long elcm_medc1; /* CSR4: EDC Status 1. */
+ unsigned long elcm_medc2; /* CSR5: EDC Status 2. */
+ unsigned long elcm_medcc; /* CSR6: EDC Control. */
+ unsigned long elcm_msctl; /* CSR7: Stream Buffer Control. */
+ unsigned long elcm_mref; /* CSR8: Refresh Control. */
+ unsigned long elcm_filter; /* CSR9: CRD Filter Control. */
+};
+
+
+/*
+ * Sable other cpu error frame - sable pfms section 3.43
+ */
+struct el_t2_data_other_cpu {
+ short elco_cpuid; /* CPU ID */
+ short elco_res02[3];
+ unsigned long elco_bcc; /* CSR 0 */
+ unsigned long elco_bcce; /* CSR 1 */
+ unsigned long elco_bccea; /* CSR 2 */
+ unsigned long elco_bcue; /* CSR 3 */
+ unsigned long elco_bcuea; /* CSR 4 */
+ unsigned long elco_dter; /* CSR 5 */
+ unsigned long elco_cbctl; /* CSR 6 */
+ unsigned long elco_cbe; /* CSR 7 */
+ unsigned long elco_cbeal; /* CSR 8 */
+ unsigned long elco_cbeah; /* CSR 9 */
+ unsigned long elco_pmbx; /* CSR 10 */
+ unsigned long elco_ipir; /* CSR 11 */
+ unsigned long elco_sic; /* CSR 12 */
+ unsigned long elco_adlk; /* CSR 13 */
+ unsigned long elco_madrl; /* CSR 14 */
+ unsigned long elco_crrev4; /* CSR 15 */
+};
+
+/*
+ * Sable other cpu error frame - sable pfms section 3.44
+ */
+struct el_t2_data_t2{
+ struct el_t2_frame_header elct_hdr; /* ID$T2-FRAME */
+ unsigned long elct_iocsr; /* IO Control and Status Register */
+ unsigned long elct_cerr1; /* Cbus Error Register 1 */
+ unsigned long elct_cerr2; /* Cbus Error Register 2 */
+ unsigned long elct_cerr3; /* Cbus Error Register 3 */
+ unsigned long elct_perr1; /* PCI Error Register 1 */
+ unsigned long elct_perr2; /* PCI Error Register 2 */
+ unsigned long elct_hae0_1; /* High Address Extension Register 1 */
+ unsigned long elct_hae0_2; /* High Address Extension Register 2 */
+ unsigned long elct_hbase; /* High Base Register */
+ unsigned long elct_wbase1; /* Window Base Register 1 */
+ unsigned long elct_wmask1; /* Window Mask Register 1 */
+ unsigned long elct_tbase1; /* Translated Base Register 1 */
+ unsigned long elct_wbase2; /* Window Base Register 2 */
+ unsigned long elct_wmask2; /* Window Mask Register 2 */
+ unsigned long elct_tbase2; /* Translated Base Register 2 */
+ unsigned long elct_tdr0; /* TLB Data Register 0 */
+ unsigned long elct_tdr1; /* TLB Data Register 1 */
+ unsigned long elct_tdr2; /* TLB Data Register 2 */
+ unsigned long elct_tdr3; /* TLB Data Register 3 */
+ unsigned long elct_tdr4; /* TLB Data Register 4 */
+ unsigned long elct_tdr5; /* TLB Data Register 5 */
+ unsigned long elct_tdr6; /* TLB Data Register 6 */
+ unsigned long elct_tdr7; /* TLB Data Register 7 */
+};
+
+/*
+ * Sable error log data structure - sable pfms section 3.40
+ */
+struct el_t2_data_corrected {
+ unsigned long elcpb_biu_stat;
+ unsigned long elcpb_biu_addr;
+ unsigned long elcpb_biu_ctl;
+ unsigned long elcpb_fill_syndrome;
+ unsigned long elcpb_fill_addr;
+ unsigned long elcpb_bc_tag;
+};
+
+/*
+ * Sable error log data structure
+ * Note there are 4 memory slots on sable (see t2.h)
+ */
+struct el_t2_frame_mcheck {
+ struct el_t2_frame_header elfmc_header; /* ID$P-FRAME_MCHECK */
+ struct el_t2_logout_header elfmc_hdr;
+ struct el_t2_procdata_mcheck elfmc_procdata;
+ struct el_t2_sysdata_mcheck elfmc_sysdata;
+ struct el_t2_data_t2 elfmc_t2data;
+ struct el_t2_data_memory elfmc_memdata[4];
+ struct el_t2_frame_header elfmc_footer; /* empty */
+};
+
+
+/*
+ * Sable error log data structures on memory errors
+ */
+struct el_t2_frame_corrected {
+ struct el_t2_frame_header elfcc_header; /* ID$P-BC-COR */
+ struct el_t2_logout_header elfcc_hdr;
+ struct el_t2_data_corrected elfcc_procdata;
+/* struct el_t2_data_t2 elfcc_t2data; */
+/* struct el_t2_data_memory elfcc_memdata[4]; */
+ struct el_t2_frame_header elfcc_footer; /* empty */
+};
+
+
+#define RTC_PORT(x) (0x70 + (x))
+#define RTC_ADDR(x) (0x80 | (x))
+#define RTC_ALWAYS_BCD 0
+
+#endif /* __ALPHA_T2__H__ */
diff --git a/include/asm-alpha/types.h b/include/asm-alpha/types.h
index 28e5d487d..381d5f044 100644
--- a/include/asm-alpha/types.h
+++ b/include/asm-alpha/types.h
@@ -63,11 +63,13 @@ typedef unsigned int u32;
typedef signed long long s64;
typedef unsigned long long u64;
+#define BITS_PER_LONG 32
#else
typedef signed long s64;
typedef unsigned long u64;
+#define BITS_PER_LONG 64
#endif
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index 44855135e..cef856f24 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -8,7 +8,7 @@
#define __NR_write 4
#define __NR_osf_old_open 5 /* not implemented */
#define __NR_close 6
-#define __NR_wait4 7
+#define __NR_osf_wait4 7
#define __NR_osf_old_creat 8 /* not implemented */
#define __NR_link 9
#define __NR_unlink 10
@@ -84,17 +84,17 @@
#define __NR_setgroups 80
#define __NR_osf_old_getpgrp 81 /* not implemented */
#define __NR_setpgrp 82 /* BSD alias for setpgid */
-#define __NR_setitimer 83
+#define __NR_osf_setitimer 83
#define __NR_osf_old_wait 84 /* not implemented */
#define __NR_osf_table 85 /* not implemented */
-#define __NR_getitimer 86
+#define __NR_osf_getitimer 86
#define __NR_gethostname 87
#define __NR_sethostname 88
#define __NR_getdtablesize 89
#define __NR_dup2 90
#define __NR_fstat 91
#define __NR_fcntl 92
-#define __NR_select 93
+#define __NR_osf_select 93
#define __NR_poll 94
#define __NR_fsync 95
#define __NR_setpriority 96
@@ -117,13 +117,13 @@
#define __NR_recvmsg 113
#define __NR_sendmsg 114
#define __NR_osf_old_vtrace 115 /* not implemented */
-#define __NR_gettimeofday 116
-#define __NR_getrusage 117
+#define __NR_osf_gettimeofday 116
+#define __NR_osf_getrusage 117
#define __NR_getsockopt 118
#define __NR_readv 120
#define __NR_writev 121
-#define __NR_settimeofday 122
+#define __NR_osf_settimeofday 122
#define __NR_fchown 123
#define __NR_fchmod 124
#define __NR_recvfrom 125
@@ -139,7 +139,7 @@
#define __NR_socketpair 135
#define __NR_mkdir 136
#define __NR_rmdir 137
-#define __NR_utimes 138
+#define __NR_osf_utimes 138
#define __NR_osf_old_sigreturn 139 /* not implemented */
#define __NR_osf_adjtime 140 /* not implemented */
#define __NR_getpeername 141
@@ -156,7 +156,7 @@
#define __NR_osf_pid_block 153 /* not implemented */
#define __NR_osf_pid_unblock 154 /* not implemented */
-#define __NR_osf_sigaction 156
+#define __NR_sigaction 156
#define __NR_osf_sigwaitprim 157 /* not implemented */
#define __NR_osf_nfssvc 158 /* not implemented */
#define __NR_osf_getdirentries 159
@@ -186,7 +186,7 @@
#define __NR_semget 205
#define __NR_semop 206
#define __NR_osf_utsname 207
-#define __NR_osf_lchown 208 /* not implemented */
+#define __NR_lchown 208
#define __NR_osf_shmat 209
#define __NR_shmctl 210
#define __NR_shmdt 211
@@ -240,7 +240,7 @@
#define __NR_bdflush 300
#define __NR_sethae 301
#define __NR_mount 302
-#define __NR_adjtimex 303
+#define __NR_old_adjtimex 303
#define __NR_swapoff 304
#define __NR_getdents 305
#define __NR_create_module 306
@@ -295,6 +295,15 @@
#define __NR_rt_sigtimedwait 355
#define __NR_rt_sigqueueinfo 356
#define __NR_rt_sigsuspend 357
+#define __NR_select 358
+#define __NR_gettimeofday 359
+#define __NR_settimeofday 360
+#define __NR_getitimer 361
+#define __NR_setitimer 362
+#define __NR_utimes 363
+#define __NR_getrusage 364
+#define __NR_wait4 365
+#define __NR_adjtimex 366
#if defined(__LIBRARY__) && defined(__GNUC__)
@@ -386,6 +395,12 @@ static inline int close(int fd)
return sys_close(fd);
}
+extern off_t sys_lseek(int, off_t, int);
+static inline off_t lseek(int fd, off_t off, int whense)
+{
+ return sys_lseek(fd, off, whense);
+}
+
extern int sys_exit(int);
static inline int _exit(int value)
{
@@ -406,22 +421,12 @@ static inline int read(int fd, char * buf, int nr)
return sys_read(fd, buf, nr);
}
-extern int do_execve(char *, char **, char **, struct pt_regs *);
-extern void ret_from_sys_call(void);
+extern int __kernel_execve(char *, char **, char **, struct pt_regs *);
static inline int execve(char * file, char ** argvp, char ** envp)
{
- int i;
struct pt_regs regs;
-
memset(&regs, 0, sizeof(regs));
- i = do_execve(file, argvp, envp, &regs);
- if (!i) {
- __asm__ __volatile__("bis %0,%0,$30\n\t"
- "bis %1,%1,$26\n\t"
- "ret $31,($26),1\n\t"
- : :"r" (&regs), "r" (ret_from_sys_call));
- }
- return -1;
+ return __kernel_execve(file, argvp, envp, &regs);
}
extern int sys_setsid(void);
diff --git a/include/asm-arm/a.out.h b/include/asm-arm/a.out.h
new file mode 100644
index 000000000..45e4a9cd6
--- /dev/null
+++ b/include/asm-arm/a.out.h
@@ -0,0 +1,28 @@
+#ifndef __ARM_A_OUT_H__
+#define __ARM_A_OUT_H__
+
+struct exec
+{
+ unsigned long a_info; /* Use macros N_MAGIC, etc for access */
+ unsigned a_text; /* length of text, in bytes */
+ unsigned a_data; /* length of data, in bytes */
+ unsigned a_bss; /* length of uninitialized data area for file, in bytes */
+ unsigned a_syms; /* length of symbol table data in file, in bytes */
+ unsigned a_entry; /* start address */
+ unsigned a_trsize; /* length of relocation info for text, in bytes */
+ unsigned a_drsize; /* length of relocation info for data, in bytes */
+};
+
+/*
+ * This is always the same
+ */
+#define N_TXTADDR(a) (0x00008000)
+
+#define N_TRSIZE(a) ((a).a_trsize)
+#define N_DRSIZE(a) ((a).a_drsize)
+#define N_SYMSIZE(a) ((a).a_syms)
+
+#define M_ARM 103
+
+#include <asm/arch/a.out.h>
+#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-arm/arcaudio.h b/include/asm-arm/arcaudio.h
new file mode 100644
index 000000000..43a31bc79
--- /dev/null
+++ b/include/asm-arm/arcaudio.h
@@ -0,0 +1,51 @@
+/*
+ * arcaudio.h
+ *
+ */
+
+#ifndef _LINUX_ARCAUDIO_H
+#define _LINUX_ARCAUDIO_H
+
+#define ARCAUDIO_MAXCHANNELS 8
+
+enum ch_type
+{
+ ARCAUDIO_NONE, /* No sound (muted) */
+ ARCAUDIO_8BITSIGNED, /* signed 8 bits per samples */
+ ARCAUDIO_8BITUNSIGNED, /* unsigned 8 bits per samples */
+ ARCAUDIO_16BITSIGNED, /* signed 16 bits per samples (little endian) */
+ ARCAUDIO_16BITUNSIGNED, /* unsigned 16 bits per samples (little endian) */
+ ARCAUDIO_LOG /* Vidc Log */
+};
+
+/*
+ * Global information
+ */
+struct arcaudio
+{
+ int sample_rate; /* sample rate (Hz) */
+ int num_channels; /* number of channels */
+ int volume; /* overall system volume */
+};
+
+/*
+ * Per channel information
+ */
+struct arcaudio_channel
+{
+ int stereo_position; /* Channel position */
+ int channel_volume; /* Channel volume */
+ enum ch_type channel_type; /* Type of channel */
+ int buffer_size; /* Size of channel buffer */
+};
+
+/* IOCTLS */
+#define ARCAUDIO_GETINFO 0x6101
+#define ARCAUDIO_SETINFO 0x6102
+#define ARCAUDIO_GETCHANNELINFO 0x6111
+#define ARCAUDIO_SETCHANNELINFO 0x6112
+#define ARCAUDIO_GETOPTS 0x61f0
+#define ARCAUDIO_SETOPTS 0x61f1
+#define ARCAUDIO_OPTSPKR 1<<0
+
+#endif
diff --git a/include/asm-arm/arch-a5k/a.out.h b/include/asm-arm/arch-a5k/a.out.h
new file mode 100644
index 000000000..065340745
--- /dev/null
+++ b/include/asm-arm/arch-a5k/a.out.h
@@ -0,0 +1,16 @@
+/*
+ * linux/include/asm-arm/arch-a5k/a.out.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_ARCH_A_OUT_H
+#define __ASM_ARCH_A_OUT_H
+
+#ifdef __KERNEL__
+#define STACK_TOP (0x01a00000)
+#define LIBRARY_START_TEXT (0x00c00000)
+#endif
+
+#endif
+
diff --git a/include/asm-arm/arch-a5k/dma.h b/include/asm-arm/arch-a5k/dma.h
new file mode 100644
index 000000000..9acb5c122
--- /dev/null
+++ b/include/asm-arm/arch-a5k/dma.h
@@ -0,0 +1,101 @@
+#ifndef __ASM_ARCH_DMA_H
+#define __ASM_ARCH_DMA_H
+
+#define MAX_DMA_ADDRESS 0x03000000
+
+#ifdef KERNEL_ARCH_DMA
+
+static inline void arch_disable_dma (int dmanr)
+{
+ printk (dma_str, "arch_disable_dma", dmanr);
+}
+
+static inline void arch_enable_dma (int dmanr)
+{
+ printk (dma_str, "arch_enable_dma", dmanr);
+}
+
+static inline void arch_set_dma_addr (int dmanr, unsigned int addr)
+{
+ printk (dma_str, "arch_set_dma_addr", dmanr);
+}
+
+static inline void arch_set_dma_count (int dmanr, unsigned int count)
+{
+ printk (dma_str, "arch_set_dma_count", dmanr);
+}
+
+static inline void arch_set_dma_mode (int dmanr, char mode)
+{
+ printk (dma_str, "arch_set_dma_mode", dmanr);
+}
+
+static inline int arch_dma_count (int dmanr)
+{
+ printk (dma_str, "arch_dma_count", dmanr);
+ return 0;
+}
+
+#endif
+
+/* enable/disable a specific DMA channel */
+extern void enable_dma(unsigned int dmanr);
+
+static __inline__ void disable_dma(unsigned int dmanr)
+{
+ switch(dmanr) {
+ case 2: disable_irq(64); break;
+ default: printk (dma_str, "disable_dma", dmanr); break;
+ }
+}
+
+/* Clear the 'DMA Pointer Flip Flop'.
+ * Write 0 for LSB/MSB, 1 for MSB/LSB access.
+ * Use this once to initialize the FF to a known state.
+ * After that, keep track of it. :-)
+ * --- In order to do that, the DMA routines below should ---
+ * --- only be used while interrupts are disabled! ---
+ */
+static __inline__ void clear_dma_ff(unsigned int dmanr)
+{
+ switch(dmanr) {
+ case 2: break;
+ default: printk (dma_str, "clear_dma_ff", dmanr); break;
+ }
+}
+
+/* set mode (above) for a specific DMA channel */
+extern void set_dma_mode(unsigned int dmanr, char mode);
+
+/* Set only the page register bits of the transfer address.
+ * This is used for successive transfers when we know the contents of
+ * the lower 16 bits of the DMA current address register, but a 64k boundary
+ * may have been crossed.
+ */
+static __inline__ void set_dma_page(unsigned int dmanr, char pagenr)
+{
+ printk (dma_str, "set_dma_page", dmanr);
+}
+
+
+/* Set transfer address & page bits for specific DMA channel.
+ * Assumes dma flipflop is clear.
+ */
+extern void set_dma_addr(unsigned int dmanr, unsigned int addr);
+
+/* Set transfer size for a specific DMA channel.
+ */
+extern void set_dma_count(unsigned int dmanr, unsigned int count);
+
+/* Get DMA residue count. After a DMA transfer, this
+ * should return zero. Reading this while a DMA transfer is
+ * still in progress will return unpredictable results.
+ * If called before the channel has been used, it may return 1.
+ * Otherwise, it returns the number of _bytes_ left to transfer.
+ *
+ * Assumes DMA flip-flop is clear.
+ */
+extern int get_dma_residue(unsigned int dmanr);
+
+#endif /* _ASM_ARCH_DMA_H */
+
diff --git a/include/asm-arm/arch-a5k/hardware.h b/include/asm-arm/arch-a5k/hardware.h
new file mode 100644
index 000000000..317b4c64f
--- /dev/null
+++ b/include/asm-arm/arch-a5k/hardware.h
@@ -0,0 +1,81 @@
+/*
+ * linux/include/asm-arm/arch-a5k/hardware.h
+ *
+ * Copyright (C) 1996 Russell King.
+ *
+ * This file contains the hardware definitions of the A5000 series machines.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+/*
+ * What hardware must be present
+ */
+#define HAS_IOC
+#define HAS_PCIO
+#define HAS_MEMC
+#define HAS_MEMC1A
+#define HAS_VIDC
+
+/*
+ * Optional hardware
+ */
+#define HAS_EXPMASK
+
+#ifndef __ASSEMBLER__
+
+/*
+ * for use with inb/outb
+ */
+#define VIDC_BASE 0x80100000
+#define IOCEC4IO_BASE 0x8009c000
+#define IOCECIO_BASE 0x80090000
+#define IOC_BASE 0x80080000
+#define MEMCECIO_BASE 0x80000000
+
+/*
+ * IO definitions
+ */
+#define EXPMASK_BASE ((volatile unsigned char *)0x03360000)
+#define IOEB_BASE ((volatile unsigned char *)0x03350050)
+#define PCIO_FLOPPYDMABASE ((volatile unsigned char *)0x0302a000)
+#define PCIO_BASE 0x03010000
+
+/*
+ * Mapping areas
+ */
+#define IO_END 0x03ffffff
+#define IO_BASE 0x03000000
+#define IO_SIZE (IO_END - IO_BASE)
+#define IO_START 0x03000000
+
+/*
+ * Screen mapping information
+ */
+#define SCREEN2_END 0x02078000
+#define SCREEN2_BASE 0x02000000
+#define SCREEN1_END SCREEN2_BASE
+#define SCREEN1_BASE 0x01f88000
+#define SCREEN_START 0x02000000
+
+/*
+ * RAM definitions
+ */
+#define MAPTOPHYS(a) (((unsigned long)a & 0x007fffff) + PAGE_OFFSET)
+#define KERNTOPHYS(a) ((((unsigned long)(&a)) & 0x007fffff) + PAGE_OFFSET)
+#define GET_MEMORY_END(p) (PAGE_OFFSET + (p->u1.s.page_size) * (p->u1.s.nr_pages))
+#define PARAMS_BASE (PAGE_OFFSET + 0x7c000)
+#define KERNEL_BASE (PAGE_OFFSET + 0x80000)
+
+#else
+
+#define IOEB_BASE 0x03350050
+#define IOC_BASE 0x03200000
+#define PCIO_FLOPPYDMABASE 0x0302a000
+#define PCIO_BASE 0x03010000
+#define IO_BASE 0x03000000
+
+#endif
+#endif
+
diff --git a/include/asm-arm/arch-a5k/ide.h b/include/asm-arm/arch-a5k/ide.h
new file mode 100644
index 000000000..3beb3c3aa
--- /dev/null
+++ b/include/asm-arm/arch-a5k/ide.h
@@ -0,0 +1,44 @@
+/*
+ * linux/include/asm-arm/arch-a5k/ide.h
+ *
+ * Copyright (c) 1997 Russell King
+ */
+
+static __inline__ int
+ide_default_irq(ide_ioreg_t base)
+{
+ if (base == 0x1f0)
+ return 11;
+ return 0;
+}
+
+static __inline__ ide_ioreg_t
+ide_default_io_base(int index)
+{
+ if (index == 0)
+ return 0x1f0;
+ return 0;
+}
+
+static __inline__ int
+ide_default_stepping(int index)
+{
+ return 0;
+}
+
+static __inline__ void
+ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int stepping, int *irq)
+{
+ ide_ioreg_t port = base;
+ ide_ioreg_t ctrl = base + 0x206;
+ int i;
+
+ i = 8;
+ while (i--) {
+ *p++ = port;
+ port += 1 << stepping;
+ }
+ *p++ = ctrl;
+ if (irq != NULL)
+ irq = 0;
+}
diff --git a/include/asm-arm/arch-a5k/io.h b/include/asm-arm/arch-a5k/io.h
new file mode 100644
index 000000000..b305c7dba
--- /dev/null
+++ b/include/asm-arm/arch-a5k/io.h
@@ -0,0 +1,215 @@
+/*
+ * linux/include/asm-arm/arch-a5k/io.h
+ *
+ * Copyright (C) 1997 Russell King
+ *
+ * Modifications:
+ * 06-Dec-1997 RMK Created.
+ */
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+/*
+ * 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
+ * bus_to_virt: Used to convert an address for DMA operations
+ * to an address that the kernel can use.
+ */
+#define virt_to_bus(x) ((unsigned long)(x))
+#define bus_to_virt(x) ((void *)(x))
+
+/*
+ * This architecture does not require any delayed IO, and
+ * has the constant-optimised IO
+ */
+#undef ARCH_IO_DELAY
+
+/*
+ * We use two different types of addressing - PC style addresses, and ARM
+ * addresses. PC style accesses the PC hardware with the normal PC IO
+ * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
+ * and are translated to the start of IO. Note that all addresses are
+ * shifted left!
+ */
+#define __PORT_PCIO(x) (!((x) & 0x80000000))
+
+/*
+ * Dynamic IO functions - let the compiler
+ * optimize the expressions
+ */
+extern __inline__ void __outb (unsigned int value, unsigned int port)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "tst %2, #0x80000000\n\t"
+ "mov %0, %4\n\t"
+ "addeq %0, %0, %3\n\t"
+ "strb %1, [%0, %2, lsl #2]"
+ : "=&r" (temp)
+ : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
+ : "cc");
+}
+
+extern __inline__ void __outw (unsigned int value, unsigned int port)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "tst %2, #0x80000000\n\t"
+ "mov %0, %4\n\t"
+ "addeq %0, %0, %3\n\t"
+ "str %1, [%0, %2, lsl #2]"
+ : "=&r" (temp)
+ : "r" (value|value<<16), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
+ : "cc");
+}
+
+extern __inline__ void __outl (unsigned int value, unsigned int port)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "tst %2, #0x80000000\n\t"
+ "mov %0, %4\n\t"
+ "addeq %0, %0, %3\n\t"
+ "str %1, [%0, %2, lsl #2]"
+ : "=&r" (temp)
+ : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
+ : "cc");
+}
+
+#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
+extern __inline__ unsigned sz __in##fnsuffix (unsigned int port) \
+{ \
+ unsigned long temp, value; \
+ __asm__ __volatile__( \
+ "tst %2, #0x80000000\n\t" \
+ "mov %0, %4\n\t" \
+ "addeq %0, %0, %3\n\t" \
+ "ldr" ##instr## " %1, [%0, %2, lsl #2]" \
+ : "=&r" (temp), "=r" (value) \
+ : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
+ : "cc"); \
+ return (unsigned sz)value; \
+}
+
+extern __inline__ unsigned int __ioaddr (unsigned int port) \
+{ \
+ if (__PORT_PCIO(port)) \
+ return (unsigned int)(PCIO_BASE + (port << 2)); \
+ else \
+ return (unsigned int)(IO_BASE + (port << 2)); \
+}
+
+#define DECLARE_IO(sz,fnsuffix,instr) \
+ DECLARE_DYN_IN(sz,fnsuffix,instr)
+
+DECLARE_IO(char,b,"b")
+DECLARE_IO(short,w,"")
+DECLARE_IO(long,l,"")
+
+#undef DECLARE_IO
+#undef DECLARE_DYN_IN
+
+/*
+ * Constant address IO functions
+ *
+ * These have to be macros for the 'J' constraint to work -
+ * +/-4096 immediate operand.
+ */
+#define __outbc(value,port) \
+({ \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "strb %0, [%1, %2]" \
+ : : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "strb %0, [%1, %2]" \
+ : : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
+})
+
+#define __inbc(port) \
+({ \
+ unsigned char result; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "ldrb %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldrb %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
+ result; \
+})
+
+#define __outwc(value,port) \
+({ \
+ unsigned long v = value; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "str %0, [%1, %2]" \
+ : : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "str %0, [%1, %2]" \
+ : : "r" (v|v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
+})
+
+#define __inwc(port) \
+({ \
+ unsigned short result; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
+ result & 0xffff; \
+})
+
+#define __outlc(v,p) __outwc((v),(p))
+
+#define __inlc(port) \
+({ \
+ unsigned long result; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
+ result; \
+})
+
+#define __ioaddrc(port) \
+({ \
+ unsigned long addr; \
+ if (__PORT_PCIO((port))) \
+ addr = PCIO_BASE + ((port) << 2); \
+ else \
+ addr = IO_BASE + ((port) << 2); \
+ addr; \
+})
+
+/*
+ * Translated address IO functions
+ *
+ * IO address has already been translated to a virtual address
+ */
+#define outb_t(v,p) \
+ (*(volatile unsigned char *)(p) = (v))
+
+#define inb_t(p) \
+ (*(volatile unsigned char *)(p))
+
+#define outl_t(v,p) \
+ (*(volatile unsigned long *)(p) = (v))
+
+#define inl_t(p) \
+ (*(volatile unsigned long *)(p))
+
+#endif
diff --git a/include/asm-arm/arch-a5k/irq.h b/include/asm-arm/arch-a5k/irq.h
new file mode 100644
index 000000000..6c868d83a
--- /dev/null
+++ b/include/asm-arm/arch-a5k/irq.h
@@ -0,0 +1,130 @@
+/*
+ * include/asm-arm/arch-a5k/irq.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * 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-01-1998 RMK Added mask_and_ack_irq
+ */
+
+#define BUILD_IRQ(s,n,m) \
+ void IRQ##n##_interrupt(void); \
+ void fast_IRQ##n##_interrupt(void); \
+ void bad_IRQ##n##_interrupt(void); \
+ void probe_IRQ##n##_interrupt(void);
+
+/*
+ * The timer is a special interrupt
+ */
+#define IRQ5_interrupt timer_IRQ_interrupt
+
+#define IRQ_INTERRUPT(n) IRQ##n##_interrupt
+#define FAST_INTERRUPT(n) fast_IRQ##n##_interrupt
+#define BAD_INTERRUPT(n) bad_IRQ##n##_interrupt
+#define PROBE_INTERRUPT(n) probe_IRQ##n##_interrupt
+
+#define X(x) (x)|0x01, (x)|0x02, (x)|0x04, (x)|0x08, (x)|0x10, (x)|0x20, (x)|0x40, (x)|0x80
+#define Z(x) (x), (x), (x), (x), (x), (x), (x), (x)
+
+static __inline__ void mask_and_ack_irq(unsigned int irq)
+{
+ static const int addrmasks[] = {
+ X((IOC_IRQMASKA - IOC_BASE)<<18 | (1 << 15)),
+ X((IOC_IRQMASKB - IOC_BASE)<<18),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ X((IOC_FIQMASK - IOC_BASE)<<18),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0)
+ };
+ unsigned int temp1, temp2;
+
+ __asm__ __volatile__(
+" ldr %1, [%5, %3, lsl #2]\n"
+" teq %1, #0\n"
+" beq 2f\n"
+" ldrb %0, [%2, %1, lsr #16]\n"
+" bic %0, %0, %1\n"
+" strb %0, [%2, %1, lsr #16]\n"
+" tst %1, #0x8000\n" /* do we need an IRQ clear? */
+" strneb %1, [%2, %4]\n"
+"2:"
+ : "=&r" (temp1), "=&r" (temp2)
+ : "r" (ioaddr(IOC_BASE)), "r" (irq),
+ "I" ((IOC_IRQCLRA - IOC_BASE) << 2), "r" (addrmasks));
+}
+
+#undef X
+#undef Z
+
+static __inline__ void mask_irq(unsigned int irq)
+{
+ extern void ecard_disableirq (unsigned int);
+ extern void ecard_disablefiq (unsigned int);
+ unsigned char mask = 1 << (irq & 7);
+
+ switch (irq >> 3) {
+ case 0:
+ outb(inb(IOC_IRQMASKA) & ~mask, IOC_IRQMASKA);
+ break;
+ case 1:
+ outb(inb(IOC_IRQMASKB) & ~mask, IOC_IRQMASKB);
+ break;
+ case 4:
+ ecard_disableirq (irq & 7);
+ break;
+ case 8:
+ outb(inb(IOC_FIQMASK) & ~mask, IOC_FIQMASK);
+ break;
+ case 12:
+ ecard_disablefiq (irq & 7);
+ }
+}
+
+static __inline__ void unmask_irq(unsigned int irq)
+{
+ extern void ecard_enableirq (unsigned int);
+ extern void ecard_enablefiq (unsigned int);
+ unsigned char mask = 1 << (irq & 7);
+
+ switch (irq >> 3) {
+ case 0:
+ outb(inb(IOC_IRQMASKA) | mask, IOC_IRQMASKA);
+ break;
+ case 1:
+ outb(inb(IOC_IRQMASKB) | mask, IOC_IRQMASKB);
+ break;
+ case 4:
+ ecard_enableirq (irq & 7);
+ break;
+ case 8:
+ outb(inb(IOC_FIQMASK) | mask, IOC_FIQMASK);
+ break;
+ case 12:
+ ecard_enablefiq (irq & 7);
+ }
+}
+
+static __inline__ unsigned long get_enabled_irqs(void)
+{
+ return inb(IOC_IRQMASKA) | inb(IOC_IRQMASKB) << 8;
+}
+
+static __inline__ void irq_init_irq(void)
+{
+ outb(0, IOC_IRQMASKA);
+ outb(0, IOC_IRQMASKB);
+ outb(0, IOC_FIQMASK);
+}
diff --git a/include/asm-arm/arch-a5k/irqs.h b/include/asm-arm/arch-a5k/irqs.h
new file mode 100644
index 000000000..b7188fb8e
--- /dev/null
+++ b/include/asm-arm/arch-a5k/irqs.h
@@ -0,0 +1,28 @@
+/*
+ * linux/include/asm-arm/arch-a5k/irqs.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#define IRQ_PRINTER 0
+#define IRQ_BATLOW 1
+#define IRQ_FLOPPYINDEX 2
+#define IRQ_VSYNCPULSE 3
+#define IRQ_POWERON 4
+#define IRQ_TIMER0 5
+#define IRQ_TIMER1 6
+#define IRQ_IMMEDIATE 7
+#define IRQ_EXPCARDFIQ 8
+#define IRQ_SOUNDCHANGE 9
+#define IRQ_SERIALPORT 10
+#define IRQ_HARDDISK 11
+#define IRQ_FLOPPYDISK 12
+#define IRQ_EXPANSIONCARD 13
+#define IRQ_KEYBOARDTX 14
+#define IRQ_KEYBOARDRX 15
+
+#define FIQ_FLOPPYDATA 0
+#define FIQ_ECONET 2
+#define FIQ_SERIALPORT 4
+#define FIQ_EXPANSIONCARD 6
+#define FIQ_FORCE 7
diff --git a/include/asm-arm/arch-a5k/mmu.h b/include/asm-arm/arch-a5k/mmu.h
new file mode 100644
index 000000000..3c2fb95a1
--- /dev/null
+++ b/include/asm-arm/arch-a5k/mmu.h
@@ -0,0 +1,15 @@
+/*
+ * linux/include/asm-arm/arch-a5k/mmu.h
+ *
+ * Copyright (c) 1996 Russell King.
+ *
+ * Changelog:
+ * 22-11-1996 RMK Created
+ */
+#ifndef __ASM_ARCH_MMU_H
+#define __ASM_ARCH_MMU_H
+
+#define __virt_to_phys(vpage) vpage
+#define __phys_to_virt(ppage) ppage
+
+#endif
diff --git a/include/asm-arm/arch-a5k/oldlatches.h b/include/asm-arm/arch-a5k/oldlatches.h
new file mode 100644
index 000000000..fa759a23e
--- /dev/null
+++ b/include/asm-arm/arch-a5k/oldlatches.h
@@ -0,0 +1,9 @@
+/*
+ * Dummy oldlatches.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifdef __need_oldlatches
+#error "Old latches not present in this (a5k) machine"
+#endif
diff --git a/include/asm-arm/arch-a5k/processor.h b/include/asm-arm/arch-a5k/processor.h
new file mode 100644
index 000000000..a8bf6e540
--- /dev/null
+++ b/include/asm-arm/arch-a5k/processor.h
@@ -0,0 +1,34 @@
+/*
+ * linux/include/asm-arm/arch-a5k/processor.h
+ *
+ * Copyright (c) 1996 Russell King.
+ *
+ * Changelog:
+ * 10-09-1996 RMK Created
+ */
+
+#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 */
+
+/*
+ * User space: 26MB
+ */
+#define TASK_SIZE (0x01a00000UL)
+
+/* This decides where the kernel will search for a free chunk of vm
+ * space during mmap's.
+ */
+#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
+
+#define INIT_MMAP \
+{ &init_mm, 0, 0x02000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
+
+#endif
diff --git a/include/asm-arm/arch-a5k/serial.h b/include/asm-arm/arch-a5k/serial.h
new file mode 100644
index 000000000..c8397084e
--- /dev/null
+++ b/include/asm-arm/arch-a5k/serial.h
@@ -0,0 +1,40 @@
+/*
+ * linux/include/asm-arm/arch-a5k/serial.h
+ *
+ * Copyright (c) 1996 Russell King.
+ *
+ * Changelog:
+ * 15-10-1996 RMK Created
+ */
+#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 STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
+
+ /* UART CLK PORT IRQ FLAGS */
+#define RS_UARTS \
+ { 0, BASE_BAUD, 0x3F8, 10, STD_COM_FLAGS }, /* ttyS0 */ \
+ { 0, BASE_BAUD, 0x2F8, 10, STD_COM_FLAGS }, /* ttyS1 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS2 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS3 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS4 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS5 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS6 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS7 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS8 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS9 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS10 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS11 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS12 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS13 */
+
+#endif
diff --git a/include/asm-arm/arch-a5k/shmparam.h b/include/asm-arm/arch-a5k/shmparam.h
new file mode 100644
index 000000000..073c7c276
--- /dev/null
+++ b/include/asm-arm/arch-a5k/shmparam.h
@@ -0,0 +1,5 @@
+/*
+ * linux/include/asm-arm/arch-a5k/shmparam.h
+ *
+ * Copyright (c) 1996 Russell King.
+ */
diff --git a/include/asm-arm/arch-a5k/system.h b/include/asm-arm/arch-a5k/system.h
new file mode 100644
index 000000000..a1d845c2a
--- /dev/null
+++ b/include/asm-arm/arch-a5k/system.h
@@ -0,0 +1,30 @@
+/*
+ * linux/include/asm-arm/arch-a5k/system.h
+ *
+ * Copyright (c) 1996 Russell King
+ */
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H
+
+extern __inline__ void arch_hard_reset (void)
+{
+ extern void ecard_reset (int card);
+
+ /*
+ * Reset all expansion cards.
+ */
+ ecard_reset (-1);
+
+ /*
+ * copy branch instruction to reset location and call it
+ */
+ *(unsigned long *)0 = *(unsigned long *)0x03800000;
+ ((void(*)(void))0)();
+
+ /*
+ * If that didn't work, loop endlessly
+ */
+ while (1);
+}
+
+#endif
diff --git a/include/asm-arm/arch-a5k/time.h b/include/asm-arm/arch-a5k/time.h
new file mode 100644
index 000000000..0d12303cb
--- /dev/null
+++ b/include/asm-arm/arch-a5k/time.h
@@ -0,0 +1,96 @@
+/*
+ * linux/include/asm-arm/arch-a5k/time.h
+ *
+ * Copyright (c) 1996 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
+ */
+
+extern __inline__ unsigned long gettimeoffset (void)
+{
+ unsigned int count1, count2, status1, status2;
+ unsigned long offset = 0;
+
+ status1 = IOC_IRQREQA;
+ barrier ();
+ outb (0, IOC_T0LATCH);
+ barrier ();
+ count1 = inb(IOC_T0CNTL) | (inb(IOC_T0CNTH) << 8);
+ barrier ();
+ status2 = inb(IOC_IRQREQA);
+ barrier ();
+ outb (0, IOC_T0LATCH);
+ barrier ();
+ count2 = inb(IOC_T0CNTL) | (inb(IOC_T0CNTH) << 8);
+
+ if (count2 < count1) {
+ /*
+ * This means that we haven't just had an interrupt
+ * while reading into status2.
+ */
+ if (status2 & (1 << 5))
+ offset = tick;
+ count1 = count2;
+ } else if (count2 > count1) {
+ /*
+ * We have just had another interrupt while reading
+ * status2.
+ */
+ offset += tick;
+ count1 = count2;
+ }
+
+ count1 = LATCH - count1;
+ /*
+ * count1 = number of clock ticks since last interrupt
+ */
+ offset += count1 * tick / LATCH;
+ return offset;
+}
+
+/*
+ * No need to reset the timer at every irq
+ */
+#define reset_timer() 1
+
+/*
+ * Updating of the RTC. We don't currently write the time to the
+ * CMOS clock.
+ */
+#define update_rtc()
+
+/*
+ * Set up timer interrupt, and return the current time in seconds.
+ */
+extern __inline__ unsigned long setup_timer (void)
+{
+ extern int iic_control (unsigned char, int, char *, int);
+ unsigned int year, mon, day, hour, min, sec;
+ char buf[8];
+
+ outb(LATCH & 255, IOC_T0LTCHL);
+ outb(LATCH >> 8, IOC_T0LTCHH);
+ outb(0, IOC_T0GO);
+
+ iic_control (0xa0, 0xc0, buf, 1);
+ year = buf[0];
+ if ((year += 1900) < 1970)
+ year += 100;
+
+ iic_control (0xa0, 2, buf, 5);
+ mon = buf[4] & 0x1f;
+ day = buf[3] & 0x3f;
+ hour = buf[2];
+ min = buf[1];
+ sec = buf[0];
+ BCD_TO_BIN(mon);
+ BCD_TO_BIN(day);
+ BCD_TO_BIN(hour);
+ BCD_TO_BIN(min);
+ BCD_TO_BIN(sec);
+
+ return mktime(year, mon, day, hour, min, sec);
+}
diff --git a/include/asm-arm/arch-a5k/timex.h b/include/asm-arm/arch-a5k/timex.h
new file mode 100644
index 000000000..84baf1fc4
--- /dev/null
+++ b/include/asm-arm/arch-a5k/timex.h
@@ -0,0 +1,13 @@
+/*
+ * linux/include/asm-arm/arch-a5k/timex.h
+ *
+ * A5000 architecture timex specifications
+ *
+ * Copyright (C) 1997, 1998 Russell King
+ */
+
+/*
+ * On the RiscPC, the clock ticks at 2MHz.
+ */
+#define CLOCK_TICK_RATE 2000000
+
diff --git a/include/asm-arm/arch-a5k/uncompress.h b/include/asm-arm/arch-a5k/uncompress.h
new file mode 100644
index 000000000..e6af264b5
--- /dev/null
+++ b/include/asm-arm/arch-a5k/uncompress.h
@@ -0,0 +1,104 @@
+/*
+ * linux/include/asm-arm/arch-a5k/uncompress.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+#define VIDMEM ((char *)0x02000000)
+
+#include "../arch/arm/drivers/char/font.h"
+
+int video_num_columns, video_num_lines, video_size_row;
+int white, bytes_per_char_h;
+extern unsigned long con_charconvtable[256];
+
+struct param_struct {
+ unsigned long page_size;
+ unsigned long nr_pages;
+ unsigned long ramdisk_size;
+ unsigned long mountrootrdonly;
+ unsigned long rootdev;
+ unsigned long video_num_cols;
+ unsigned long video_num_rows;
+ unsigned long video_x;
+ unsigned long video_y;
+ unsigned long memc_control_reg;
+ unsigned char sounddefault;
+ unsigned char adfsdrives;
+ unsigned char bytes_per_char_h;
+ unsigned char bytes_per_char_v;
+ unsigned long unused[256/4-11];
+};
+
+static struct param_struct *params = (struct param_struct *)0x0207c000;
+
+/*
+ * This does not append a newline
+ */
+static void puts(const char *s)
+{
+ extern void ll_write_char(char *, unsigned long);
+ int x,y;
+ unsigned char c;
+ char *ptr;
+
+ x = params->video_x;
+ y = params->video_y;
+
+ while ( ( c = *(unsigned char *)s++ ) != '\0' ) {
+ if ( c == '\n' ) {
+ x = 0;
+ if ( ++y >= video_num_lines ) {
+ y--;
+ }
+ } else {
+ ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
+ ll_write_char(ptr, c|(white<<8));
+ if ( ++x >= video_num_columns ) {
+ x = 0;
+ if ( ++y >= video_num_lines ) {
+ y--;
+ }
+ }
+ }
+ }
+
+ params->video_x = x;
+ params->video_y = y;
+}
+
+static void error(char *x);
+
+/*
+ * Setup for decompression
+ */
+static void arch_decomp_setup(void)
+{
+ int i;
+
+ video_num_lines = params->video_num_rows;
+ video_num_columns = params->video_num_cols;
+ bytes_per_char_h = params->bytes_per_char_h;
+ video_size_row = video_num_columns * bytes_per_char_h;
+ if (bytes_per_char_h == 4)
+ for (i = 0; i < 256; i++)
+ con_charconvtable[i] =
+ (i & 128 ? 1 << 0 : 0) |
+ (i & 64 ? 1 << 4 : 0) |
+ (i & 32 ? 1 << 8 : 0) |
+ (i & 16 ? 1 << 12 : 0) |
+ (i & 8 ? 1 << 16 : 0) |
+ (i & 4 ? 1 << 20 : 0) |
+ (i & 2 ? 1 << 24 : 0) |
+ (i & 1 ? 1 << 28 : 0);
+ else
+ for (i = 0; i < 16; i++)
+ con_charconvtable[i] =
+ (i & 8 ? 1 << 0 : 0) |
+ (i & 4 ? 1 << 8 : 0) |
+ (i & 2 ? 1 << 16 : 0) |
+ (i & 1 ? 1 << 24 : 0);
+
+ white = bytes_per_char_h == 8 ? 0xfc : 7;
+
+ if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n");
+}
diff --git a/include/asm-arm/arch-arc/a.out.h b/include/asm-arm/arch-arc/a.out.h
new file mode 100644
index 000000000..985c27e90
--- /dev/null
+++ b/include/asm-arm/arch-arc/a.out.h
@@ -0,0 +1,16 @@
+/*
+ * linux/include/asm-arm/arch-arc/a.out.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_ARCH_A_OUT_H
+#define __ASM_ARCH_A_OUT_H
+
+#ifdef __KERNEL__
+#define STACK_TOP (0x01a00000)
+#define LIBRARY_START_TEXT (0x00c00000)
+#endif
+
+#endif
+
diff --git a/include/asm-arm/arch-arc/dma.h b/include/asm-arm/arch-arc/dma.h
new file mode 100644
index 000000000..8e82fe58d
--- /dev/null
+++ b/include/asm-arm/arch-arc/dma.h
@@ -0,0 +1,95 @@
+#ifndef __ASM_ARCH_DMA_H
+#define __ASM_ARCH_DMA_H
+
+#define MAX_DMA_ADDRESS 0x03000000
+
+#ifdef KERNEL_ARCH_DMA
+
+static inline void arch_disable_dma (int dmanr)
+{
+ printk (dma_str, "arch_disable_dma", dmanr);
+}
+
+static inline void arch_enable_dma (int dmanr)
+{
+ printk (dma_str, "arch_enable_dma", dmanr);
+}
+
+static inline void arch_set_dma_addr (int dmanr, unsigned int addr)
+{
+ printk (dma_str, "arch_set_dma_addr", dmanr);
+}
+
+static inline void arch_set_dma_count (int dmanr, unsigned int count)
+{
+ printk (dma_str, "arch_set_dma_count", dmanr);
+}
+
+static inline void arch_set_dma_mode (int dmanr, char mode)
+{
+ printk (dma_str, "arch_set_dma_mode", dmanr);
+}
+
+static inline int arch_dma_count (int dmanr)
+{
+ printk (dma_str, "arch_dma_count", dmanr);
+ return 0;
+}
+
+#endif
+
+/* enable/disable a specific DMA channel */
+extern void enable_dma(unsigned int dmanr);
+
+static __inline__ void disable_dma(unsigned int dmanr)
+{
+ switch(dmanr) {
+ case 0: disable_irq(64); break;
+ case 1: break;
+ default: printk (dma_str, "disable_dma", dmanr); break;
+ }
+}
+
+/* Clear the 'DMA Pointer Flip Flop'.
+ * Write 0 for LSB/MSB, 1 for MSB/LSB access.
+ * Use this once to initialize the FF to a known state.
+ * After that, keep track of it. :-)
+ * --- In order to do that, the DMA routines below should ---
+ * --- only be used while interrupts are disabled! ---
+ */
+#define clear_dma_ff(dmanr)
+
+/* set mode (above) for a specific DMA channel */
+extern void set_dma_mode(unsigned int dmanr, char mode);
+
+/* Set only the page register bits of the transfer address.
+ * This is used for successive transfers when we know the contents of
+ * the lower 16 bits of the DMA current address register, but a 64k boundary
+ * may have been crossed.
+ */
+static __inline__ void set_dma_page(unsigned int dmanr, char pagenr)
+{
+ printk (dma_str, "set_dma_page", dmanr);
+}
+
+
+/* Set transfer address & page bits for specific DMA channel.
+ * Assumes dma flipflop is clear.
+ */
+extern void set_dma_addr(unsigned int dmanr, unsigned int addr);
+
+/* Set transfer size for a specific DMA channel.
+ */
+extern void set_dma_count(unsigned int dmanr, unsigned int count);
+
+/* Get DMA residue count. After a DMA transfer, this
+ * should return zero. Reading this while a DMA transfer is
+ * still in progress will return unpredictable results.
+ * If called before the channel has been used, it may return 1.
+ * Otherwise, it returns the number of _bytes_ left to transfer.
+ *
+ * Assumes DMA flip-flop is clear.
+ */
+extern int get_dma_residue(unsigned int dmanr);
+
+#endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-arc/hardware.h b/include/asm-arm/arch-arc/hardware.h
new file mode 100644
index 000000000..21d933d86
--- /dev/null
+++ b/include/asm-arm/arch-arc/hardware.h
@@ -0,0 +1,82 @@
+/*
+ * linux/include/asm-arm/arch-arc/hardware.h
+ *
+ * Copyright (C) 1996 Russell King.
+ *
+ * This file contains the hardware definitions of the A3/4/5xx series machines.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+/*
+ * What hardware must be present
+ */
+#define HAS_IOC
+#define HAS_MEMC
+#define HAS_MEMC1A
+#define HAS_VIDC
+
+/*
+ * Optional hardware
+ */
+#define HAS_EXPMASK
+
+#ifndef __ASSEMBLER__
+
+/*
+ * for use with inb/outb
+ */
+#define VIDC_BASE 0x80100000
+#define IOCEC4IO_BASE 0x8009c000
+#define LATCHAADDR 0x80094010
+#define LATCHBADDR 0x80094006
+#define IOCECIO_BASE 0x80090000
+#define IOC_BASE 0x80080000
+#define MEMCECIO_BASE 0x80000000
+
+/*
+ * IO definitions
+ */
+#define EXPMASK_BASE ((volatile unsigned char *)0x03360000)
+#define IOEB_BASE ((volatile unsigned char *)0x03350050)
+#define PCIO_FLOPPYDMABASE ((volatile unsigned char *)0x0302a000)
+#define PCIO_BASE 0x03010000
+
+/*
+ * Mapping areas
+ */
+#define IO_END 0x03ffffff
+#define IO_BASE 0x03000000
+#define IO_SIZE (IO_END - IO_BASE)
+#define IO_START 0x03000000
+
+/*
+ * Screen mapping information
+ */
+#define SCREEN2_END 0x02078000
+#define SCREEN2_BASE 0x02000000
+#define SCREEN1_END SCREEN2_BASE
+#define SCREEN1_BASE 0x01f88000
+#define SCREEN_START 0x02000000
+
+/*
+ * RAM definitions
+ */
+#define MAPTOPHYS(a) (((unsigned long)a & 0x007fffff) + PAGE_OFFSET)
+#define KERNTOPHYS(a) ((((unsigned long)(&a)) & 0x007fffff) + PAGE_OFFSET)
+#define GET_MEMORY_END(p) (PAGE_OFFSET + (p->u1.s.page_size) * (p->u1.s.nr_pages))
+#define PARAMS_BASE (PAGE_OFFSET + 0x7c000)
+#define KERNEL_BASE (PAGE_OFFSET + 0x80000)
+
+#else
+
+#define IOEB_BASE 0x03350050
+#define IOC_BASE 0x03200000
+#define PCIO_FLOPPYDMABASE 0x0302a000
+#define PCIO_BASE 0x03010000
+#define IO_BASE 0x03000000
+
+#endif
+#endif
+
diff --git a/include/asm-arm/arch-arc/ide.h b/include/asm-arm/arch-arc/ide.h
new file mode 100644
index 000000000..9da7a9c56
--- /dev/null
+++ b/include/asm-arm/arch-arc/ide.h
@@ -0,0 +1,40 @@
+/*
+ * linux/include/asm-arm/arch-arc/ide.h
+ *
+ * Copyright (c) 1997,1998 Russell King
+ */
+
+static __inline__ int
+ide_default_irq(ide_ioreg_t base)
+{
+ return 0;
+}
+
+static __inline__ ide_ioreg_t
+ide_default_io_base(int index)
+{
+ return 0;
+}
+
+static __inline__ int
+ide_default_stepping(int index)
+{
+ return 0;
+}
+
+static __inline__ void
+ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int stepping, int *irq)
+{
+ ide_ioreg_t port = base;
+ ide_ioreg_t ctrl = base + 0x206;
+ int i;
+
+ i = 8;
+ while (i--) {
+ *p++ = port;
+ port += 1 << stepping;
+ }
+ *p++ = ctrl;
+ if (irq != NULL)
+ irq = 0;
+}
diff --git a/include/asm-arm/arch-arc/io.h b/include/asm-arm/arch-arc/io.h
new file mode 100644
index 000000000..40775ec8f
--- /dev/null
+++ b/include/asm-arm/arch-arc/io.h
@@ -0,0 +1,215 @@
+/*
+ * linux/include/asm-arm/arch-arc/io.h
+ *
+ * Copyright (C) 1997 Russell King
+ *
+ * Modifications:
+ * 06-Dec-1997 RMK Created.
+ */
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+/*
+ * 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
+ * bus_to_virt: Used to convert an address for DMA operations
+ * to an address that the kernel can use.
+ */
+#define virt_to_bus(x) ((unsigned long)(x))
+#define bus_to_virt(x) ((void *)(x))
+
+/*
+ * This architecture does not require any delayed IO, and
+ * has the constant-optimised IO
+ */
+#undef ARCH_IO_DELAY
+
+/*
+ * We use two different types of addressing - PC style addresses, and ARM
+ * addresses. PC style accesses the PC hardware with the normal PC IO
+ * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
+ * and are translated to the start of IO. Note that all addresses are
+ * shifted left!
+ */
+#define __PORT_PCIO(x) (!((x) & 0x80000000))
+
+/*
+ * Dynamic IO functions - let the compiler
+ * optimize the expressions
+ */
+extern __inline__ void __outb (unsigned int value, unsigned int port)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "tst %2, #0x80000000\n\t"
+ "mov %0, %4\n\t"
+ "addeq %0, %0, %3\n\t"
+ "strb %1, [%0, %2, lsl #2]"
+ : "=&r" (temp)
+ : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
+ : "cc");
+}
+
+extern __inline__ void __outw (unsigned int value, unsigned int port)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "tst %2, #0x80000000\n\t"
+ "mov %0, %4\n\t"
+ "addeq %0, %0, %3\n\t"
+ "strb %1, [%0, %2, lsl #2]"
+ : "=&r" (temp)
+ : "r" (value|value<<16), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
+ : "cc");
+}
+
+extern __inline__ void __outl (unsigned int value, unsigned int port)
+{
+ unsigned long temp;
+ __asm__ __volatile__(
+ "tst %2, #0x80000000\n\t"
+ "mov %0, %4\n\t"
+ "addeq %0, %0, %3\n\t"
+ "strb %1, [%0, %2, lsl #2]"
+ : "=&r" (temp)
+ : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE)
+ : "cc");
+}
+
+#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
+extern __inline__ unsigned sz __in##fnsuffix (unsigned int port) \
+{ \
+ unsigned long temp, value; \
+ __asm__ __volatile__( \
+ "tst %2, #0x80000000\n\t" \
+ "mov %0, %4\n\t" \
+ "addeq %0, %0, %3\n\t" \
+ "ldr" ##instr## " %1, [%0, %2, lsl #2]" \
+ : "=&r" (temp), "=r" (value) \
+ : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
+ : "cc"); \
+ return (unsigned sz)value; \
+}
+
+extern __inline__ unsigned int __ioaddr (unsigned int port) \
+{ \
+ if (__PORT_PCIO(port)) \
+ return (unsigned int)(PCIO_BASE + (port << 2)); \
+ else \
+ return (unsigned int)(IO_BASE + (port << 2)); \
+}
+
+#define DECLARE_IO(sz,fnsuffix,instr) \
+ DECLARE_DYN_IN(sz,fnsuffix,instr)
+
+DECLARE_IO(char,b,"b")
+DECLARE_IO(short,w,"")
+DECLARE_IO(long,l,"")
+
+#undef DECLARE_IO
+#undef DECLARE_DYN_IN
+
+/*
+ * Constant address IO functions
+ *
+ * These have to be macros for the 'J' constraint to work -
+ * +/-4096 immediate operand.
+ */
+#define __outbc(value,port) \
+({ \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "strb %0, [%1, %2]" \
+ : : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "strb %0, [%1, %2]" \
+ : : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
+})
+
+#define __inbc(port) \
+({ \
+ unsigned char result; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "ldrb %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldrb %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
+ result; \
+})
+
+#define __outwc(value,port) \
+({ \
+ unsigned long v = value; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "str %0, [%1, %2]" \
+ : : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "str %0, [%1, %2]" \
+ : : "r" (v|v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
+})
+
+#define __inwc(port) \
+({ \
+ unsigned short result; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
+ result & 0xffff; \
+})
+
+#define __outlc(v,p) __outwc((v),(p))
+
+#define __inlc(port) \
+({ \
+ unsigned long result; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
+ result; \
+})
+
+#define __ioaddrc(port) \
+({ \
+ unsigned long addr; \
+ if (__PORT_PCIO((port))) \
+ addr = PCIO_BASE + ((port) << 2); \
+ else \
+ addr = IO_BASE + ((port) << 2); \
+ addr; \
+})
+
+/*
+ * Translated address IO functions
+ *
+ * IO address has already been translated to a virtual address
+ */
+#define outb_t(v,p) \
+ (*(volatile unsigned char *)(p) = (v))
+
+#define inb_t(p) \
+ (*(volatile unsigned char *)(p))
+
+#define outl_t(v,p) \
+ (*(volatile unsigned long *)(p) = (v))
+
+#define inl_t(p) \
+ (*(volatile unsigned long *)(p))
+
+#endif
diff --git a/include/asm-arm/arch-arc/irq.h b/include/asm-arm/arch-arc/irq.h
new file mode 100644
index 000000000..62ea30478
--- /dev/null
+++ b/include/asm-arm/arch-arc/irq.h
@@ -0,0 +1,130 @@
+/*
+ * include/asm-arm/arch-arc/irq.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * Changelog:
+ * 24-09-1996 RMK Created
+ * 10-10-1996 RMK Brought up to date with arch-sa110eval
+ * 05-11-1996 RMK Changed interrupt numbers & uses new inb/outb macros
+ * 11-01-1998 RMK Added mask_and_ack_irq
+ */
+
+#define BUILD_IRQ(s,n,m) \
+ void IRQ##n##_interrupt(void); \
+ void fast_IRQ##n##_interrupt(void); \
+ void bad_IRQ##n##_interrupt(void); \
+ void probe_IRQ##n##_interrupt(void);
+
+/*
+ * The timer is a special interrupt
+ */
+#define IRQ5_interrupt timer_IRQ_interrupt
+
+#define IRQ_INTERRUPT(n) IRQ##n##_interrupt
+#define FAST_INTERRUPT(n) fast_IRQ##n##_interrupt
+#define BAD_INTERRUPT(n) bad_IRQ##n##_interrupt
+#define PROBE_INTERRUPT(n) probe_IRQ##n##_interrupt
+
+#define X(x) (x)|0x01, (x)|0x02, (x)|0x04, (x)|0x08, (x)|0x10, (x)|0x20, (x)|0x40, (x)|0x80
+#define Z(x) (x), (x), (x), (x), (x), (x), (x), (x)
+
+static __inline__ void mask_and_ack_irq(unsigned int irq)
+{
+ static const int addrmasks[] = {
+ X((IOC_IRQMASKA - IOC_BASE)<<18 | (1 << 15)),
+ X((IOC_IRQMASKB - IOC_BASE)<<18),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ X((IOC_FIQMASK - IOC_BASE)<<18),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0)
+ };
+ unsigned int temp1, temp2;
+
+ __asm__ __volatile__(
+" ldr %1, [%5, %3, lsl #2]\n"
+" teq %1, #0\n"
+" beq 2f\n"
+" ldrb %0, [%2, %1, lsr #16]\n"
+" bic %0, %0, %1\n"
+" strb %0, [%2, %1, lsr #16]\n"
+" tst %1, #0x8000\n" /* do we need an IRQ clear? */
+" strneb %1, [%2, %4]\n"
+"2:"
+ : "=&r" (temp1), "=&r" (temp2)
+ : "r" (ioaddr(IOC_BASE)), "r" (irq),
+ "I" ((IOC_IRQCLRA - IOC_BASE) << 2), "r" (addrmasks));
+}
+
+#undef X
+#undef Z
+
+static __inline__ void mask_irq(unsigned int irq)
+{
+ extern void ecard_disableirq (unsigned int);
+ extern void ecard_disablefiq (unsigned int);
+ unsigned char mask = 1 << (irq & 7);
+
+ switch (irq >> 3) {
+ case 0:
+ outb(inb(IOC_IRQMASKA) & ~mask, IOC_IRQMASKA);
+ break;
+ case 1:
+ outb(inb(IOC_IRQMASKB) & ~mask, IOC_IRQMASKB);
+ break;
+ case 4:
+ ecard_disableirq (irq & 7);
+ break;
+ case 8:
+ outb(inb(IOC_FIQMASK) & ~mask, IOC_FIQMASK);
+ break;
+ case 12:
+ ecard_disablefiq (irq & 7);
+ }
+}
+
+static __inline__ void unmask_irq(unsigned int irq)
+{
+ extern void ecard_enableirq (unsigned int);
+ extern void ecard_enablefiq (unsigned int);
+ unsigned char mask = 1 << (irq & 7);
+
+ switch (irq >> 3) {
+ case 0:
+ outb(inb(IOC_IRQMASKA) | mask, IOC_IRQMASKA);
+ break;
+ case 1:
+ outb(inb(IOC_IRQMASKB) | mask, IOC_IRQMASKB);
+ break;
+ case 4:
+ ecard_enableirq (irq & 7);
+ break;
+ case 8:
+ outb(inb(IOC_FIQMASK) | mask, IOC_FIQMASK);
+ break;
+ case 12:
+ ecard_enablefiq (irq & 7);
+ }
+}
+
+static __inline__ unsigned long get_enabled_irqs(void)
+{
+ return inb(IOC_IRQMASKA) | inb(IOC_IRQMASKB) << 8;
+}
+
+static __inline__ void irq_init_irq(void)
+{
+ outb(0, IOC_IRQMASKA);
+ outb(0, IOC_IRQMASKB);
+ outb(0, IOC_FIQMASK);
+}
diff --git a/include/asm-arm/arch-arc/irqs.h b/include/asm-arm/arch-arc/irqs.h
new file mode 100644
index 000000000..e4043aaef
--- /dev/null
+++ b/include/asm-arm/arch-arc/irqs.h
@@ -0,0 +1,30 @@
+/*
+ * linux/include/asm-arm/arch-arc/irqs.h
+ *
+ * Copyright (C) 1996 Russell King, Dave Gilbert (gilbertd@cs.man.ac.uk)
+ */
+
+#define IRQ_PRINTERBUSY 0
+#define IRQ_SERIALRING 1
+#define IRQ_PRINTERACK 2
+#define IRQ_VSYNCPULSE 3
+#define IRQ_POWERON 4
+#define IRQ_TIMER0 5
+#define IRQ_TIMER1 6
+#define IRQ_IMMEDIATE 7
+#define IRQ_EXPCARDFIQ 8
+#define IRQ_SOUNDCHANGE 9
+#define IRQ_SERIALPORT 10
+#define IRQ_HARDDISK 11
+#define IRQ_FLOPPYCHANGED 12
+#define IRQ_EXPANSIONCARD 13
+#define IRQ_KEYBOARDTX 14
+#define IRQ_KEYBOARDRX 15
+
+#define FIQ_FLOPPYDATA 0
+#define FIQ_FLOPPYIRQ 1
+#define FIQ_ECONET 2
+#define FIQ_EXPANSIONCARD 6
+#define FIQ_FORCE 7
+
+#define FIQ_FD1772 FIQ_FLOPPYIRQ
diff --git a/include/asm-arm/arch-arc/mmu.h b/include/asm-arm/arch-arc/mmu.h
new file mode 100644
index 000000000..747f61ada
--- /dev/null
+++ b/include/asm-arm/arch-arc/mmu.h
@@ -0,0 +1,15 @@
+/*
+ * linux/include/asm-arm/arch-arc/mmu.h
+ *
+ * Copyright (c) 1996 Russell King.
+ *
+ * Changelog:
+ * 22-11-1996 RMK Created
+ */
+#ifndef __ASM_ARCH_MMU_H
+#define __ASM_ARCH_MMU_H
+
+#define __virt_to_phys(vpage) vpage
+#define __phys_to_virt(ppage) ppage
+
+#endif
diff --git a/include/asm-arm/arch-arc/oldlatches.h b/include/asm-arm/arch-arc/oldlatches.h
new file mode 100644
index 000000000..747a5e86d
--- /dev/null
+++ b/include/asm-arm/arch-arc/oldlatches.h
@@ -0,0 +1,24 @@
+#ifndef _ASM_ARM_ARCHARC_OLDLATCH_H
+#define _ASM_ARM_ARCHARC_OLDLATCH_H
+
+#define LATCHA_FDSEL0 (1<<0)
+#define LATCHA_FDSEL1 (1<<1)
+#define LATCHA_FDSEL2 (1<<2)
+#define LATCHA_FDSEL3 (1<<3)
+#define LATCHA_FDSELALL (0xf)
+#define LATCHA_SIDESEL (1<<4)
+#define LATCHA_MOTOR (1<<5)
+#define LATCHA_INUSE (1<<6)
+#define LATCHA_CHANGERST (1<<7)
+
+#define LATCHB_FDCDENSITY (1<<1)
+#define LATCHB_FDCRESET (1<<3)
+#define LATCHB_PRINTSTROBE (1<<4)
+
+/* newval=(oldval & mask)|newdata */
+void oldlatch_bupdate(unsigned char mask,unsigned char newdata);
+
+/* newval=(oldval & mask)|newdata */
+void oldlatch_aupdate(unsigned char mask,unsigned char newdata);
+
+#endif
diff --git a/include/asm-arm/arch-arc/processor.h b/include/asm-arm/arch-arc/processor.h
new file mode 100644
index 000000000..0d3aee84a
--- /dev/null
+++ b/include/asm-arm/arch-arc/processor.h
@@ -0,0 +1,34 @@
+/*
+ * linux/include/asm-arm/arch-arc/processor.h
+ *
+ * Copyright (c) 1996 Russell King.
+ *
+ * Changelog:
+ * 10-09-1996 RMK Created
+ */
+
+#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 */
+
+/*
+ * User space: 26MB
+ */
+#define TASK_SIZE (0x01a00000UL)
+
+/* This decides where the kernel will search for a free chunk of vm
+ * space during mmap's.
+ */
+#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
+
+#define INIT_MMAP \
+{ &init_mm, 0, 0x02000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
+
+#endif
diff --git a/include/asm-arm/arch-arc/serial.h b/include/asm-arm/arch-arc/serial.h
new file mode 100644
index 000000000..d9a6bde58
--- /dev/null
+++ b/include/asm-arm/arch-arc/serial.h
@@ -0,0 +1,40 @@
+/*
+ * linux/include/asm-arm/arch-arc/serial.h
+ *
+ * Copyright (c) 1996 Russell King.
+ *
+ * Changelog:
+ * 15-10-1996 RMK Created
+ */
+#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 STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
+
+ /* UART CLK PORT IRQ FLAGS */
+#define RS_UARTS \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS0 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS1 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS2 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS3 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS4 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS5 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS6 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS7 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS8 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS9 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS10 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS11 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS12 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS13 */
+
+#endif
diff --git a/include/asm-arm/arch-arc/shmparam.h b/include/asm-arm/arch-arc/shmparam.h
new file mode 100644
index 000000000..e4e47e254
--- /dev/null
+++ b/include/asm-arm/arch-arc/shmparam.h
@@ -0,0 +1,5 @@
+/*
+ * linux/include/asm-arm/arch-arc/shmparam.h
+ *
+ * Copyright (c) 1996 Russell King.
+ */
diff --git a/include/asm-arm/arch-arc/system.h b/include/asm-arm/arch-arc/system.h
new file mode 100644
index 000000000..6807cc66c
--- /dev/null
+++ b/include/asm-arm/arch-arc/system.h
@@ -0,0 +1,41 @@
+/*
+ * linux/include/asm-arm/arch-arc/system.h
+ *
+ * Copyright (c) 1996 Russell King and Dave Gilbert
+ */
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H
+
+#define cliIF() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc\n" \
+" orr %0, %0, #0x0c000000\n" \
+" teqp %0, #0\n" \
+ : "=r" (temp) \
+ : ); \
+ } while(0)
+
+extern __inline__ void arch_hard_reset (void)
+{
+ extern void ecard_reset (int card);
+
+ /*
+ * Reset all expansion cards.
+ */
+ ecard_reset (-1);
+
+ /*
+ * copy branch instruction to reset location and call it
+ */
+ *(unsigned long *)0 = *(unsigned long *)0x03800000;
+ ((void(*)(void))0)();
+
+ /*
+ * If that didn't work, loop endlessly
+ */
+ while (1);
+}
+
+#endif
diff --git a/include/asm-arm/arch-arc/time.h b/include/asm-arm/arch-arc/time.h
new file mode 100644
index 000000000..6df347484
--- /dev/null
+++ b/include/asm-arm/arch-arc/time.h
@@ -0,0 +1,96 @@
+/*
+ * linux/include/asm-arm/arch-arc/time.h
+ *
+ * Copyright (c) 1996 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
+ */
+
+extern __inline__ unsigned long gettimeoffset (void)
+{
+ unsigned int count1, count2, status1, status2;
+ unsigned long offset = 0;
+
+ status1 = inb(IOC_IRQREQA);
+ barrier ();
+ outb (0, IOC_T0LATCH);
+ barrier ();
+ count1 = inb(IOC_T0CNTL) | (inb(IOC_T0CNTH) << 8);
+ barrier ();
+ status2 = inb(IOC_IRQREQA);
+ barrier ();
+ outb (0, IOC_T0LATCH);
+ barrier ();
+ count2 = inb(IOC_T0CNTL) | (inb(IOC_T0CNTH) << 8);
+
+ if (count2 < count1) {
+ /*
+ * This means that we haven't just had an interrupt
+ * while reading into status2.
+ */
+ if (status2 & (1 << 5))
+ offset = tick;
+ count1 = count2;
+ } else if (count2 > count1) {
+ /*
+ * We have just had another interrupt while reading
+ * status2.
+ */
+ offset += tick;
+ count1 = count2;
+ }
+
+ count1 = LATCH - count1;
+ /*
+ * count1 = number of clock ticks since last interrupt
+ */
+ offset += count1 * tick / LATCH;
+ return offset;
+}
+
+/*
+ * No need to reset the timer at every irq
+ */
+#define reset_timer() 1
+
+/*
+ * Updating of the RTC. We don't currently write the time to the
+ * CMOS clock.
+ */
+#define update_rtc()
+
+/*
+ * Set up timer interrupt, and return the current time in seconds.
+ */
+extern __inline__ unsigned long setup_timer (void)
+{
+ extern int iic_control (unsigned char, int, char *, int);
+ unsigned int year, mon, day, hour, min, sec;
+ char buf[8];
+
+ outb(LATCH & 255, IOC_T0LTCHL);
+ outb(LATCH >> 8, IOC_T0LTCHH);
+ outb(0, IOC_T0GO);
+
+ iic_control (0xa0, 0xc0, buf, 1);
+ year = buf[0];
+ if ((year += 1900) < 1970)
+ year += 100;
+
+ iic_control (0xa0, 2, buf, 5);
+ mon = buf[4] & 0x1f;
+ day = buf[3] & 0x3f;
+ hour = buf[2];
+ min = buf[1];
+ sec = buf[0];
+ BCD_TO_BIN(mon);
+ BCD_TO_BIN(day);
+ BCD_TO_BIN(hour);
+ BCD_TO_BIN(min);
+ BCD_TO_BIN(sec);
+
+ return mktime(year, mon, day, hour, min, sec);
+}
diff --git a/include/asm-arm/arch-arc/timex.h b/include/asm-arm/arch-arc/timex.h
new file mode 100644
index 000000000..5161a9a62
--- /dev/null
+++ b/include/asm-arm/arch-arc/timex.h
@@ -0,0 +1,13 @@
+/*
+ * linux/include/asm-arm/arch-arc/timex.h
+ *
+ * Archimedes architecture timex specifications
+ *
+ * Copyright (C) 1997, 1998 Russell King
+ */
+
+/*
+ * On the RiscPC, the clock ticks at 2MHz.
+ */
+#define CLOCK_TICK_RATE 2000000
+
diff --git a/include/asm-arm/arch-arc/uncompress.h b/include/asm-arm/arch-arc/uncompress.h
new file mode 100644
index 000000000..e6af264b5
--- /dev/null
+++ b/include/asm-arm/arch-arc/uncompress.h
@@ -0,0 +1,104 @@
+/*
+ * linux/include/asm-arm/arch-a5k/uncompress.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+#define VIDMEM ((char *)0x02000000)
+
+#include "../arch/arm/drivers/char/font.h"
+
+int video_num_columns, video_num_lines, video_size_row;
+int white, bytes_per_char_h;
+extern unsigned long con_charconvtable[256];
+
+struct param_struct {
+ unsigned long page_size;
+ unsigned long nr_pages;
+ unsigned long ramdisk_size;
+ unsigned long mountrootrdonly;
+ unsigned long rootdev;
+ unsigned long video_num_cols;
+ unsigned long video_num_rows;
+ unsigned long video_x;
+ unsigned long video_y;
+ unsigned long memc_control_reg;
+ unsigned char sounddefault;
+ unsigned char adfsdrives;
+ unsigned char bytes_per_char_h;
+ unsigned char bytes_per_char_v;
+ unsigned long unused[256/4-11];
+};
+
+static struct param_struct *params = (struct param_struct *)0x0207c000;
+
+/*
+ * This does not append a newline
+ */
+static void puts(const char *s)
+{
+ extern void ll_write_char(char *, unsigned long);
+ int x,y;
+ unsigned char c;
+ char *ptr;
+
+ x = params->video_x;
+ y = params->video_y;
+
+ while ( ( c = *(unsigned char *)s++ ) != '\0' ) {
+ if ( c == '\n' ) {
+ x = 0;
+ if ( ++y >= video_num_lines ) {
+ y--;
+ }
+ } else {
+ ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
+ ll_write_char(ptr, c|(white<<8));
+ if ( ++x >= video_num_columns ) {
+ x = 0;
+ if ( ++y >= video_num_lines ) {
+ y--;
+ }
+ }
+ }
+ }
+
+ params->video_x = x;
+ params->video_y = y;
+}
+
+static void error(char *x);
+
+/*
+ * Setup for decompression
+ */
+static void arch_decomp_setup(void)
+{
+ int i;
+
+ video_num_lines = params->video_num_rows;
+ video_num_columns = params->video_num_cols;
+ bytes_per_char_h = params->bytes_per_char_h;
+ video_size_row = video_num_columns * bytes_per_char_h;
+ if (bytes_per_char_h == 4)
+ for (i = 0; i < 256; i++)
+ con_charconvtable[i] =
+ (i & 128 ? 1 << 0 : 0) |
+ (i & 64 ? 1 << 4 : 0) |
+ (i & 32 ? 1 << 8 : 0) |
+ (i & 16 ? 1 << 12 : 0) |
+ (i & 8 ? 1 << 16 : 0) |
+ (i & 4 ? 1 << 20 : 0) |
+ (i & 2 ? 1 << 24 : 0) |
+ (i & 1 ? 1 << 28 : 0);
+ else
+ for (i = 0; i < 16; i++)
+ con_charconvtable[i] =
+ (i & 8 ? 1 << 0 : 0) |
+ (i & 4 ? 1 << 8 : 0) |
+ (i & 2 ? 1 << 16 : 0) |
+ (i & 1 ? 1 << 24 : 0);
+
+ white = bytes_per_char_h == 8 ? 0xfc : 7;
+
+ if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n");
+}
diff --git a/include/asm-arm/arch-ebsa110/a.out.h b/include/asm-arm/arch-ebsa110/a.out.h
new file mode 100644
index 000000000..a34c23ef2
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/a.out.h
@@ -0,0 +1,16 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/a.out.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_ARCH_A_OUT_H
+#define __ASM_ARCH_A_OUT_H
+
+#ifdef __KERNEL__
+#define STACK_TOP (0xc0000000)
+#define LIBRARY_START_TEXT (0x00c00000)
+#endif
+
+#endif
+
diff --git a/include/asm-arm/arch-ebsa110/dma.h b/include/asm-arm/arch-ebsa110/dma.h
new file mode 100644
index 000000000..73340527a
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/dma.h
@@ -0,0 +1,100 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/dma.h
+ *
+ * Architecture DMA routes
+ *
+ * Copyright (C) 1997.1998 Russell King
+ */
+#ifndef __ASM_ARCH_DMA_H
+#define __ASM_ARCH_DMA_H
+
+#ifdef KERNEL_ARCH_DMA
+
+static inline void arch_disable_dma (int dmanr)
+{
+ printk (dma_str, "arch_disable_dma", dmanr);
+}
+
+static inline void arch_enable_dma (int dmanr)
+{
+ printk (dma_str, "arch_enable_dma", dmanr);
+}
+
+static inline void arch_set_dma_addr (int dmanr, unsigned int addr)
+{
+ printk (dma_str, "arch_set_dma_addr", dmanr);
+}
+
+static inline void arch_set_dma_count (int dmanr, unsigned int count)
+{
+ printk (dma_str, "arch_set_dma_count", dmanr);
+}
+
+static inline void arch_set_dma_mode (int dmanr, char mode)
+{
+ printk (dma_str, "arch_set_dma_mode", dmanr);
+}
+
+static inline int arch_dma_count (int dmanr)
+{
+ printk (dma_str, "arch_dma_count", dmanr);
+ return 0;
+}
+
+#endif
+
+/* enable/disable a specific DMA channel */
+extern void enable_dma(unsigned int dmanr);
+
+static __inline__ void disable_dma(unsigned int dmanr)
+{
+ printk (dma_str, "disable_dma", dmanr);
+}
+
+/* Clear the 'DMA Pointer Flip Flop'.
+ * Write 0 for LSB/MSB, 1 for MSB/LSB access.
+ * Use this once to initialize the FF to a known state.
+ * After that, keep track of it. :-)
+ * --- In order to do that, the DMA routines below should ---
+ * --- only be used while interrupts are disabled! ---
+ */
+static __inline__ void clear_dma_ff(unsigned int dmanr)
+{
+ printk (dma_str, "clear_dma_ff", dmanr);
+}
+
+/* set mode (above) for a specific DMA channel */
+extern void set_dma_mode(unsigned int dmanr, char mode);
+
+/* Set only the page register bits of the transfer address.
+ * This is used for successive transfers when we know the contents of
+ * the lower 16 bits of the DMA current address register, but a 64k boundary
+ * may have been crossed.
+ */
+static __inline__ void set_dma_page(unsigned int dmanr, char pagenr)
+{
+ printk (dma_str, "set_dma_page", dmanr);
+}
+
+
+/* Set transfer address & page bits for specific DMA channel.
+ * Assumes dma flipflop is clear.
+ */
+extern void set_dma_addr(unsigned int dmanr, unsigned int addr);
+
+/* Set transfer size for a specific DMA channel.
+ */
+extern void set_dma_count(unsigned int dmanr, unsigned int count);
+
+/* Get DMA residue count. After a DMA transfer, this
+ * should return zero. Reading this while a DMA transfer is
+ * still in progress will return unpredictable results.
+ * If called before the channel has been used, it may return 1.
+ * Otherwise, it returns the number of _bytes_ left to transfer.
+ *
+ * Assumes DMA flip-flop is clear.
+ */
+extern int get_dma_residue(unsigned int dmanr);
+
+#endif /* _ASM_ARCH_DMA_H */
+
diff --git a/include/asm-arm/arch-ebsa110/hardware.h b/include/asm-arm/arch-ebsa110/hardware.h
new file mode 100644
index 000000000..14655b47b
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/hardware.h
@@ -0,0 +1,50 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/hardware.h
+ *
+ * Copyright (C) 1996,1997,1998 Russell King.
+ *
+ * This file contains the hardware definitions of the EBSA-110.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+/*
+ * What hardware must be present
+ */
+#define HAS_PCIO
+
+#ifndef __ASSEMBLER__
+
+/*
+ * IO definitions
+ */
+#define PIT_CTRL ((volatile unsigned char *)0xf200000d)
+#define PIT_T2 ((volatile unsigned char *)0xf2000009)
+#define PIT_T1 ((volatile unsigned char *)0xf2000005)
+#define PIT_T0 ((volatile unsigned char *)0xf2000001)
+#define PCIO_BASE 0xf0000000
+
+/*
+ * Mapping areas
+ */
+#define IO_END 0xffffffff
+#define IO_BASE 0xe0000000
+#define IO_SIZE (IO_END - IO_BASE)
+#define IO_START 0xe0000000
+
+/*
+ * RAM definitions
+ */
+#define MAPTOPHYS(a) ((unsigned long)(a) - PAGE_OFFSET)
+#define KERNTOPHYS(a) ((unsigned long)(&a))
+#define KERNEL_BASE (0xc0008000)
+
+#else
+
+#define PCIO_BASE 0xf0000000
+#define IO_BASE 0
+
+#endif
+#endif
+
diff --git a/include/asm-arm/arch-ebsa110/ide.h b/include/asm-arm/arch-ebsa110/ide.h
new file mode 100644
index 000000000..35eff5c28
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/ide.h
@@ -0,0 +1 @@
+/* no ide */
diff --git a/include/asm-arm/arch-ebsa110/io.h b/include/asm-arm/arch-ebsa110/io.h
new file mode 100644
index 000000000..30621db0a
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/io.h
@@ -0,0 +1,192 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/io.h
+ *
+ * Copyright (C) 1997,1998 Russell King
+ *
+ * Modifications:
+ * 06-Dec-1997 RMK Created.
+ */
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+/*
+ * 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
+ * bus_to_virt: Used to convert an address for DMA operations
+ * to an address that the kernel can use.
+ */
+#define virt_to_bus(x) ((unsigned long)(x))
+#define bus_to_virt(x) ((void *)(x))
+
+/*
+ * This architecture does not require any delayed IO, and
+ * has the constant-optimised IO
+ */
+#undef ARCH_IO_DELAY
+
+/*
+ * We use two different types of addressing - PC style addresses, and ARM
+ * addresses. PC style accesses the PC hardware with the normal PC IO
+ * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
+ * and are translated to the start of IO. Note that all addresses are
+ * shifted left!
+ */
+#define __PORT_PCIO(x) (!((x) & 0x80000000))
+
+/*
+ * Dynamic IO functions - let the compiler
+ * optimize the expressions
+ */
+#define DECLARE_DYN_OUT(fnsuffix,instr) \
+extern __inline__ void __out##fnsuffix (unsigned int value, unsigned int port) \
+{ \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "tst %2, #0x80000000\n\t" \
+ "mov %0, %4\n\t" \
+ "addeq %0, %0, %3\n\t" \
+ "str" ##instr## " %1, [%0, %2, lsl #2]" \
+ : "=&r" (temp) \
+ : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
+ : "cc"); \
+}
+
+#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
+extern __inline__ unsigned sz __in##fnsuffix (unsigned int port) \
+{ \
+ unsigned long temp, value; \
+ __asm__ __volatile__( \
+ "tst %2, #0x80000000\n\t" \
+ "mov %0, %4\n\t" \
+ "addeq %0, %0, %3\n\t" \
+ "ldr" ##instr## " %1, [%0, %2, lsl #2]" \
+ : "=&r" (temp), "=r" (value) \
+ : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
+ : "cc"); \
+ return (unsigned sz)value; \
+}
+
+extern __inline__ unsigned int __ioaddr (unsigned int port) \
+{ \
+ if (__PORT_PCIO(port)) \
+ return (unsigned int)(PCIO_BASE + (port << 2)); \
+ else \
+ return (unsigned int)(IO_BASE + (port << 2)); \
+}
+
+#define DECLARE_IO(sz,fnsuffix,instr) \
+ DECLARE_DYN_OUT(fnsuffix,instr) \
+ DECLARE_DYN_IN(sz,fnsuffix,instr)
+
+DECLARE_IO(char,b,"b")
+DECLARE_IO(short,w,"")
+DECLARE_IO(long,l,"")
+
+#undef DECLARE_IO
+#undef DECLARE_DYN_OUT
+#undef DECLARE_DYN_IN
+
+/*
+ * Constant address IO functions
+ *
+ * These have to be macros for the 'J' constraint to work -
+ * +/-4096 immediate operand.
+ */
+#define __outbc(value,port) \
+({ \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "strb %0, [%1, %2]" \
+ : : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "strb %0, [%1, %2]" \
+ : : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
+})
+
+#define __inbc(port) \
+({ \
+ unsigned char result; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "ldrb %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldrb %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
+ result; \
+})
+
+#define __outwc(value,port) \
+({ \
+ unsigned long v = value; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "str %0, [%1, %2]" \
+ : : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "str %0, [%1, %2]" \
+ : : "r" (v|v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
+})
+
+#define __inwc(port) \
+({ \
+ unsigned short result; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
+ result & 0xffff; \
+})
+
+#define __outlc(v,p) __outwc((v),(p))
+
+#define __inlc(port) \
+({ \
+ unsigned long result; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
+ result; \
+})
+
+#define __ioaddrc(port) \
+({ \
+ unsigned long addr; \
+ if (__PORT_PCIO((port))) \
+ addr = PCIO_BASE + ((port) << 2); \
+ else \
+ addr = IO_BASE + ((port) << 2); \
+ addr; \
+})
+
+/*
+ * Translated address IO functions
+ *
+ * IO address has already been translated to a virtual address
+ */
+#define outb_t(v,p) \
+ (*(volatile unsigned char *)(p) = (v))
+
+#define inb_t(p) \
+ (*(volatile unsigned char *)(p))
+
+#define outl_t(v,p) \
+ (*(volatile unsigned long *)(p) = (v))
+
+#define inl_t(p) \
+ (*(volatile unsigned long *)(p))
+
+#endif
diff --git a/include/asm-arm/arch-ebsa110/irq.h b/include/asm-arm/arch-ebsa110/irq.h
new file mode 100644
index 000000000..18ddf053b
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/irq.h
@@ -0,0 +1,46 @@
+/*
+ * include/asm-arm/arch-ebsa110/irq.h
+ *
+ * Copyright (C) 1996,1997,1998 Russell King
+ */
+
+#define IRQ_MCLR ((volatile unsigned char *)0xf3000000)
+#define IRQ_MSET ((volatile unsigned char *)0xf2c00000)
+#define IRQ_MASK ((volatile unsigned char *)0xf2c00000)
+
+static __inline__ void mask_and_ack_irq(unsigned int irq)
+{
+ if (irq < 8)
+ *IRQ_MCLR = 1 << irq;
+}
+
+static __inline__ void mask_irq(unsigned int irq)
+{
+ if (irq < 8)
+ *IRQ_MCLR = 1 << irq;
+}
+
+static __inline__ void unmask_irq(unsigned int irq)
+{
+ if (irq < 8)
+ *IRQ_MSET = 1 << irq;
+}
+
+static __inline__ unsigned long get_enabled_irqs(void)
+{
+ return 0;
+}
+
+static __inline__ void irq_init_irq(void)
+{
+ unsigned long flags;
+
+ save_flags_cli (flags);
+ *IRQ_MCLR = 0xff;
+ *IRQ_MSET = 0x55;
+ *IRQ_MSET = 0x00;
+ if (*IRQ_MASK != 0x55)
+ while (1);
+ *IRQ_MCLR = 0xff; /* clear all interrupt enables */
+ restore_flags (flags);
+}
diff --git a/include/asm-arm/arch-ebsa110/irqs.h b/include/asm-arm/arch-ebsa110/irqs.h
new file mode 100644
index 000000000..b83b5967c
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/irqs.h
@@ -0,0 +1,14 @@
+/*
+ * linux/include/asm-arm/arch-sa100eval/irqs.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#define IRQ_PRINTER 0
+#define IRQ_COM1 1
+#define IRQ_COM2 2
+#define IRQ_ETHERNET 3
+#define IRQ_TIMER0 4
+#define IRQ_TIMER1 5
+#define IRQ_PCMCIA 6
+#define IRQ_IMMEDIATE 7
diff --git a/include/asm-arm/arch-ebsa110/mm-init.h b/include/asm-arm/arch-ebsa110/mm-init.h
new file mode 100644
index 000000000..9c70f7505
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/mm-init.h
@@ -0,0 +1,11 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/mm-init.h
+ *
+ * Copyright (C) 1997,1998 Russell King
+ *
+ * Description of the initial memory map for EBSA-110
+ */
+
+static init_mem_map_t init_mem_map[] = {
+ INIT_MEM_MAP_SENTINEL
+};
diff --git a/include/asm-arm/arch-ebsa110/mmap.h b/include/asm-arm/arch-ebsa110/mmap.h
new file mode 100644
index 000000000..2ba0c2a27
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/mmap.h
@@ -0,0 +1,10 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/mmap.h
+ *
+ * Copyright (C) 1996,1997,1998 Russell King
+ */
+
+/*
+ * Use SRAM for cache flushing
+ */
+#define SAFE_ADDR 0x40000000
diff --git a/include/asm-arm/arch-ebsa110/mmu.h b/include/asm-arm/arch-ebsa110/mmu.h
new file mode 100644
index 000000000..fb684dd74
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/mmu.h
@@ -0,0 +1,19 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/mmu.h
+ *
+ * Copyright (c) 1996,1997,1998 Russell King.
+ *
+ * Changelog:
+ * 20-10-1996 RMK Created
+ * 31-12-1997 RMK Fixed definitions to reduce warnings
+ */
+#ifndef __ASM_ARCH_MMU_H
+#define __ASM_ARCH_MMU_H
+
+/*
+ * On ebsa, the dram is contiguous
+ */
+#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET)
+#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET)
+
+#endif
diff --git a/include/asm-arm/arch-ebsa110/oldlatches.h b/include/asm-arm/arch-ebsa110/oldlatches.h
new file mode 100644
index 000000000..8ff6ebd67
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/oldlatches.h
@@ -0,0 +1,9 @@
+/*
+ * Dummy oldlatches.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifdef __need_oldlatches
+#error "Old latches not present in this (rpc) machine"
+#endif
diff --git a/include/asm-arm/arch-ebsa110/processor.h b/include/asm-arm/arch-ebsa110/processor.h
new file mode 100644
index 000000000..b54085946
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/processor.h
@@ -0,0 +1,31 @@
+/*
+ * 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 */
+
+/*
+ * User space: 3GB
+ */
+#define TASK_SIZE (0xc0000000UL)
+
+/* This decides where the kernel will search for a free chunk of vm
+ * space during mmap's.
+ */
+#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
+
+#define INIT_MMAP \
+{ &init_mm, 0xc0000000, 0xc2000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
+
+#endif
diff --git a/include/asm-arm/arch-ebsa110/serial.h b/include/asm-arm/arch-ebsa110/serial.h
new file mode 100644
index 000000000..1d41a7c1d
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/serial.h
@@ -0,0 +1,41 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/serial.h
+ *
+ * Copyright (c) 1996,1997,1998 Russell King.
+ *
+ * Changelog:
+ * 15-10-1996 RMK Created
+ */
+#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 STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
+
+ /* UART CLK PORT IRQ FLAGS */
+#define RS_UARTS \
+ { 0, BASE_BAUD, 0x3F8, 1, STD_COM_FLAGS }, /* ttyS0 */ \
+ { 0, BASE_BAUD, 0x2F8, 2, STD_COM_FLAGS }, /* ttyS1 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS2 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS3 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS4 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS5 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS6 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS7 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS8 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS9 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS10 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS11 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS12 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS13 */
+
+#endif
+
diff --git a/include/asm-arm/arch-ebsa110/shmparam.h b/include/asm-arm/arch-ebsa110/shmparam.h
new file mode 100644
index 000000000..9c36489cb
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/shmparam.h
@@ -0,0 +1,5 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/shmparam.h
+ *
+ * Copyright (c) 1996 Russell King.
+ */
diff --git a/include/asm-arm/arch-ebsa110/system.h b/include/asm-arm/arch-ebsa110/system.h
new file mode 100644
index 000000000..7a2957cae
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/system.h
@@ -0,0 +1,18 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/system.h
+ *
+ * Copyright (c) 1996,1997,1998 Russell King.
+ */
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H
+
+extern __inline__ void arch_hard_reset (void)
+{
+ /*
+ * loop endlessly
+ */
+ cli();
+ while (1);
+}
+
+#endif
diff --git a/include/asm-arm/arch-ebsa110/time.h b/include/asm-arm/arch-ebsa110/time.h
new file mode 100644
index 000000000..84d04d90f
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/time.h
@@ -0,0 +1,89 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/time.h
+ *
+ * Copyright (c) 1996,1997,1998 Russell King.
+ *
+ * No real time clock on the evalulation board!
+ *
+ * Changelog:
+ * 10-Oct-1996 RMK Created
+ * 04-Dec-1997 RMK Updated for new arch/arm/time.c
+ */
+
+#define MCLK_47_8
+
+#if defined(MCLK_42_3)
+#define PIT1_COUNT 0xecbe
+#elif defined(MCLK_47_8)
+/*
+ * This should be 0x10AE1, but that doesn't exactly fit.
+ * We run the timer interrupt at 5ms, and then divide it by
+ * two in software... This is so that the user processes
+ * see exactly the same model whichever ARM processor they're
+ * running on.
+ */
+#define PIT1_COUNT 0x8570
+#define DIVISOR 2
+#endif
+
+extern __inline__ unsigned long gettimeoffset (void)
+{
+ return 0;
+}
+
+#ifndef DIVISOR
+extern __inline__ int reset_timer (void)
+{
+ *PIT_T1 = (PIT1_COUNT) & 0xff;
+ *PIT_T1 = (PIT1_COUNT) >> 8;
+ return 1;
+}
+#else
+extern __inline__ int reset_timer (void)
+{
+ static unsigned int divisor;
+ static int count = 50;
+
+ *PIT_T1 = (PIT1_COUNT) & 0xff;
+ *PIT_T1 = (PIT1_COUNT) >> 8;
+
+ if (--count == 0) {
+ count = 50;
+ *(volatile unsigned char *)0xf2400000 ^= 128;
+ }
+
+ if (divisor == 0) {
+ divisor = DIVISOR - 1;
+ return 1;
+ }
+ divisor -= 1;
+ return 0;
+}
+#endif
+
+/*
+ * We don't have a RTC to update!
+ */
+#define update_rtc()
+
+/*
+ * Set up timer interrupt, and return the current time in seconds.
+ */
+extern __inline__ unsigned long setup_timer (void)
+{
+ /*
+ * Timer 1, mode 0, 16-bit, autoreload
+ */
+ *PIT_CTRL = 0x70;
+ /*
+ * Refresh counter clocked at 47.8MHz/7 = 146.4ns
+ * We want centi-second interrupts
+ */
+ reset_timer ();
+ /*
+ * 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
+ */
+ return mktime(1970, 1, 1, 0, 0, 0);
+}
diff --git a/include/asm-arm/arch-ebsa110/timex.h b/include/asm-arm/arch-ebsa110/timex.h
new file mode 100644
index 000000000..86bb588e7
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/timex.h
@@ -0,0 +1,15 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/timex.h
+ *
+ * RiscPC architecture timex specifications
+ *
+ * Copyright (C) 1997, 1998 Russell King
+ */
+
+/*
+ * On the EBSA, the clock ticks at weird rates.
+ * This is therefore not used to calculate the
+ * divisor.
+ */
+//#define CLOCK_TICK_RATE 2000000
+
diff --git a/include/asm-arm/arch-ebsa110/uncompress.h b/include/asm-arm/arch-ebsa110/uncompress.h
new file mode 100644
index 000000000..d5260b027
--- /dev/null
+++ b/include/asm-arm/arch-ebsa110/uncompress.h
@@ -0,0 +1,33 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/uncompress.h
+ *
+ * Copyright (C) 1996,1997,1998 Russell King
+ */
+
+/*
+ * This does not append a newline
+ */
+static void puts(const char *s)
+{
+ __asm__ __volatile__("
+ ldrb %0, [%2], #1
+ teq %0, #0
+ beq 3f
+1: strb %0, [%3]
+2: ldrb %1, [%3, #0x14]
+ and %1, %1, #0x60
+ teq %1, #0x60
+ bne 2b
+ teq %0, #'\n'
+ moveq %0, #'\r'
+ beq 1b
+ ldrb %0, [%2], #1
+ teq %0, #0
+ bne 1b
+3: " : : "r" (0), "r" (0), "r" (s), "r" (0xf0000be0) : "cc");
+}
+
+/*
+ * nothing to do
+ */
+#define arch_decomp_setup()
diff --git a/include/asm-arm/arch-nexuspci/a.out.h b/include/asm-arm/arch-nexuspci/a.out.h
new file mode 100644
index 000000000..b8e278074
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/a.out.h
@@ -0,0 +1,16 @@
+/*
+ * linux/include/asm-arm/arch-ebsa/a.out.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_ARCH_A_OUT_H
+#define __ASM_ARCH_A_OUT_H
+
+#ifdef __KERNEL__
+#define STACK_TOP (0xc0000000)
+#define LIBRARY_START_TEXT (0x00c00000)
+#endif
+
+#endif
+
diff --git a/include/asm-arm/arch-nexuspci/dma.h b/include/asm-arm/arch-nexuspci/dma.h
new file mode 100644
index 000000000..73340527a
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/dma.h
@@ -0,0 +1,100 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/dma.h
+ *
+ * Architecture DMA routes
+ *
+ * Copyright (C) 1997.1998 Russell King
+ */
+#ifndef __ASM_ARCH_DMA_H
+#define __ASM_ARCH_DMA_H
+
+#ifdef KERNEL_ARCH_DMA
+
+static inline void arch_disable_dma (int dmanr)
+{
+ printk (dma_str, "arch_disable_dma", dmanr);
+}
+
+static inline void arch_enable_dma (int dmanr)
+{
+ printk (dma_str, "arch_enable_dma", dmanr);
+}
+
+static inline void arch_set_dma_addr (int dmanr, unsigned int addr)
+{
+ printk (dma_str, "arch_set_dma_addr", dmanr);
+}
+
+static inline void arch_set_dma_count (int dmanr, unsigned int count)
+{
+ printk (dma_str, "arch_set_dma_count", dmanr);
+}
+
+static inline void arch_set_dma_mode (int dmanr, char mode)
+{
+ printk (dma_str, "arch_set_dma_mode", dmanr);
+}
+
+static inline int arch_dma_count (int dmanr)
+{
+ printk (dma_str, "arch_dma_count", dmanr);
+ return 0;
+}
+
+#endif
+
+/* enable/disable a specific DMA channel */
+extern void enable_dma(unsigned int dmanr);
+
+static __inline__ void disable_dma(unsigned int dmanr)
+{
+ printk (dma_str, "disable_dma", dmanr);
+}
+
+/* Clear the 'DMA Pointer Flip Flop'.
+ * Write 0 for LSB/MSB, 1 for MSB/LSB access.
+ * Use this once to initialize the FF to a known state.
+ * After that, keep track of it. :-)
+ * --- In order to do that, the DMA routines below should ---
+ * --- only be used while interrupts are disabled! ---
+ */
+static __inline__ void clear_dma_ff(unsigned int dmanr)
+{
+ printk (dma_str, "clear_dma_ff", dmanr);
+}
+
+/* set mode (above) for a specific DMA channel */
+extern void set_dma_mode(unsigned int dmanr, char mode);
+
+/* Set only the page register bits of the transfer address.
+ * This is used for successive transfers when we know the contents of
+ * the lower 16 bits of the DMA current address register, but a 64k boundary
+ * may have been crossed.
+ */
+static __inline__ void set_dma_page(unsigned int dmanr, char pagenr)
+{
+ printk (dma_str, "set_dma_page", dmanr);
+}
+
+
+/* Set transfer address & page bits for specific DMA channel.
+ * Assumes dma flipflop is clear.
+ */
+extern void set_dma_addr(unsigned int dmanr, unsigned int addr);
+
+/* Set transfer size for a specific DMA channel.
+ */
+extern void set_dma_count(unsigned int dmanr, unsigned int count);
+
+/* Get DMA residue count. After a DMA transfer, this
+ * should return zero. Reading this while a DMA transfer is
+ * still in progress will return unpredictable results.
+ * If called before the channel has been used, it may return 1.
+ * Otherwise, it returns the number of _bytes_ left to transfer.
+ *
+ * Assumes DMA flip-flop is clear.
+ */
+extern int get_dma_residue(unsigned int dmanr);
+
+#endif /* _ASM_ARCH_DMA_H */
+
diff --git a/include/asm-arm/arch-nexuspci/hardware.h b/include/asm-arm/arch-nexuspci/hardware.h
new file mode 100644
index 000000000..154bce9df
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/hardware.h
@@ -0,0 +1,40 @@
+/*
+ * linux/include/asm-arm/arch-nexuspci/hardware.h
+ *
+ * Copyright (C) 1997 Philip Blundell
+ *
+ * This file contains the hardware definitions of the Nexus PCI card.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+/*
+ * What hardware must be present
+ */
+
+#ifndef __ASSEMBLER__
+
+/*
+ * Mapping areas
+ */
+#define IO_END 0xffffffff
+#define IO_BASE 0xd0000000
+#define IO_SIZE (IO_END - IO_BASE)
+#define IO_START 0xd0000000
+
+/*
+ * RAM definitions
+ */
+#define RAM_BASE 0x40000000
+#define MAPTOPHYS(a) ((unsigned long)(a) - PAGE_OFFSET + RAM_BASE)
+#define KERNTOPHYS(a) ((unsigned long)(&a))
+#define KERNEL_BASE (0xc0008000)
+
+#else
+
+#define IO_BASE 0
+
+#endif
+#endif
+
diff --git a/include/asm-arm/arch-nexuspci/irq.h b/include/asm-arm/arch-nexuspci/irq.h
new file mode 100644
index 000000000..18ddf053b
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/irq.h
@@ -0,0 +1,46 @@
+/*
+ * include/asm-arm/arch-ebsa110/irq.h
+ *
+ * Copyright (C) 1996,1997,1998 Russell King
+ */
+
+#define IRQ_MCLR ((volatile unsigned char *)0xf3000000)
+#define IRQ_MSET ((volatile unsigned char *)0xf2c00000)
+#define IRQ_MASK ((volatile unsigned char *)0xf2c00000)
+
+static __inline__ void mask_and_ack_irq(unsigned int irq)
+{
+ if (irq < 8)
+ *IRQ_MCLR = 1 << irq;
+}
+
+static __inline__ void mask_irq(unsigned int irq)
+{
+ if (irq < 8)
+ *IRQ_MCLR = 1 << irq;
+}
+
+static __inline__ void unmask_irq(unsigned int irq)
+{
+ if (irq < 8)
+ *IRQ_MSET = 1 << irq;
+}
+
+static __inline__ unsigned long get_enabled_irqs(void)
+{
+ return 0;
+}
+
+static __inline__ void irq_init_irq(void)
+{
+ unsigned long flags;
+
+ save_flags_cli (flags);
+ *IRQ_MCLR = 0xff;
+ *IRQ_MSET = 0x55;
+ *IRQ_MSET = 0x00;
+ if (*IRQ_MASK != 0x55)
+ while (1);
+ *IRQ_MCLR = 0xff; /* clear all interrupt enables */
+ restore_flags (flags);
+}
diff --git a/include/asm-arm/arch-nexuspci/irqs.h b/include/asm-arm/arch-nexuspci/irqs.h
new file mode 100644
index 000000000..661af14a1
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/irqs.h
@@ -0,0 +1,14 @@
+/*
+ * linux/include/asm-arm/arch-nexuspci/irqs.h
+ *
+ * Copyright (C) 1997 Philip Blundell
+ */
+
+#define IRQ_DUART 0
+#define IRQ_TIMER0 0 /* timer is part of the DUART */
+#define IRQ_PLX 1
+#define IRQ_PCI_D 2
+#define IRQ_PCI_C 3
+#define IRQ_PCI_B 4
+#define IRQ_PCI_A 5
+#define IRQ_SYSERR 6 /* must ask JB about this one */
diff --git a/include/asm-arm/arch-nexuspci/mmap.h b/include/asm-arm/arch-nexuspci/mmap.h
new file mode 100644
index 000000000..2ba0c2a27
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/mmap.h
@@ -0,0 +1,10 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/mmap.h
+ *
+ * Copyright (C) 1996,1997,1998 Russell King
+ */
+
+/*
+ * Use SRAM for cache flushing
+ */
+#define SAFE_ADDR 0x40000000
diff --git a/include/asm-arm/arch-nexuspci/mmu.h b/include/asm-arm/arch-nexuspci/mmu.h
new file mode 100644
index 000000000..6e21320d3
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/mmu.h
@@ -0,0 +1,16 @@
+/*
+ * linux/include/asm-arm/arch-nexuspci/mmu.h
+ *
+ * Copyright (c) 1997 Philip Blundell.
+ *
+ */
+#ifndef __ASM_ARCH_MMU_H
+#define __ASM_ARCH_MMU_H
+
+/*
+ * On NexusPCI, the dram is contiguous
+ */
+#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + 0x40000000)
+#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - 0x40000000)
+
+#endif
diff --git a/include/asm-arm/arch-nexuspci/processor.h b/include/asm-arm/arch-nexuspci/processor.h
new file mode 100644
index 000000000..b54085946
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/processor.h
@@ -0,0 +1,31 @@
+/*
+ * 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 */
+
+/*
+ * User space: 3GB
+ */
+#define TASK_SIZE (0xc0000000UL)
+
+/* This decides where the kernel will search for a free chunk of vm
+ * space during mmap's.
+ */
+#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
+
+#define INIT_MMAP \
+{ &init_mm, 0xc0000000, 0xc2000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
+
+#endif
diff --git a/include/asm-arm/arch-nexuspci/serial.h b/include/asm-arm/arch-nexuspci/serial.h
new file mode 100644
index 000000000..1d41a7c1d
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/serial.h
@@ -0,0 +1,41 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/serial.h
+ *
+ * Copyright (c) 1996,1997,1998 Russell King.
+ *
+ * Changelog:
+ * 15-10-1996 RMK Created
+ */
+#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 STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
+
+ /* UART CLK PORT IRQ FLAGS */
+#define RS_UARTS \
+ { 0, BASE_BAUD, 0x3F8, 1, STD_COM_FLAGS }, /* ttyS0 */ \
+ { 0, BASE_BAUD, 0x2F8, 2, STD_COM_FLAGS }, /* ttyS1 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS2 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS3 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS4 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS5 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS6 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS7 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS8 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS9 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS10 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS11 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS12 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS13 */
+
+#endif
+
diff --git a/include/asm-arm/arch-nexuspci/shmparam.h b/include/asm-arm/arch-nexuspci/shmparam.h
new file mode 100644
index 000000000..9c36489cb
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/shmparam.h
@@ -0,0 +1,5 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/shmparam.h
+ *
+ * Copyright (c) 1996 Russell King.
+ */
diff --git a/include/asm-arm/arch-nexuspci/system.h b/include/asm-arm/arch-nexuspci/system.h
new file mode 100644
index 000000000..7a2957cae
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/system.h
@@ -0,0 +1,18 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/system.h
+ *
+ * Copyright (c) 1996,1997,1998 Russell King.
+ */
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H
+
+extern __inline__ void arch_hard_reset (void)
+{
+ /*
+ * loop endlessly
+ */
+ cli();
+ while (1);
+}
+
+#endif
diff --git a/include/asm-arm/arch-nexuspci/time.h b/include/asm-arm/arch-nexuspci/time.h
new file mode 100644
index 000000000..ddbee82db
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/time.h
@@ -0,0 +1,29 @@
+/*
+ * linux/include/asm-arm/arch-nexuspci/time.h
+ *
+ * Copyright (c) 1997 Phil Blundell.
+ *
+ * Nexus PCI card has no real-time clock.
+ *
+ */
+
+extern __inline__ unsigned long gettimeoffset (void)
+{
+ return 0;
+}
+
+extern __inline__ int reset_timer (void)
+{
+ return 0;
+}
+
+extern __inline__ unsigned long setup_timer (void)
+{
+ reset_timer ();
+ /*
+ * 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
+ */
+ return mktime(1970, 1, 1, 0, 0, 0);
+}
diff --git a/include/asm-arm/arch-nexuspci/uncompress.h b/include/asm-arm/arch-nexuspci/uncompress.h
new file mode 100644
index 000000000..16daee5b9
--- /dev/null
+++ b/include/asm-arm/arch-nexuspci/uncompress.h
@@ -0,0 +1,17 @@
+/*
+ * linux/include/asm-arm/arch-ebsa110/uncompress.h
+ *
+ * Copyright (C) 1996,1997,1998 Russell King
+ */
+
+/*
+ * This does not append a newline
+ */
+static void puts(const char *s)
+{
+}
+
+/*
+ * nothing to do
+ */
+#define arch_decomp_setup()
diff --git a/include/asm-arm/arch-rpc/a.out.h b/include/asm-arm/arch-rpc/a.out.h
new file mode 100644
index 000000000..c9a1d0413
--- /dev/null
+++ b/include/asm-arm/arch-rpc/a.out.h
@@ -0,0 +1,16 @@
+/*
+ * linux/include/asm-arm/arch-rpc/a.out.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_ARCH_A_OUT_H
+#define __ASM_ARCH_A_OUT_H
+
+#ifdef __KERNEL__
+#define STACK_TOP (0xc0000000)
+#define LIBRARY_START_TEXT (0x00c00000)
+#endif
+
+#endif
+
diff --git a/include/asm-arm/arch-rpc/dma.h b/include/asm-arm/arch-rpc/dma.h
new file mode 100644
index 000000000..540ac46f1
--- /dev/null
+++ b/include/asm-arm/arch-rpc/dma.h
@@ -0,0 +1,128 @@
+#ifndef __ASM_ARCH_DMA_H
+#define __ASM_ARCH_DMA_H
+
+#define MAX_DMA_ADDRESS 0xd0000000
+
+#ifdef KERNEL_ARCH_DMA
+
+static unsigned char arch_dma_setup;
+unsigned char arch_dma_ctrl[8];
+unsigned long arch_dma_addr[8];
+unsigned long arch_dma_cnt[8];
+
+static inline void arch_enable_dma(int dmanr)
+{
+ if (!(arch_dma_setup & (1 << dmanr))) {
+ arch_dma_setup |= 1 << dmanr;
+/* dma_interrupt (16 + dmanr);*/
+ }
+ arch_dma_ctrl[dmanr] |= DMA_CR_E;
+ switch (dmanr) {
+ case 0: outb (arch_dma_ctrl[0], IOMD_IO0CR); break;
+ case 1: outb (arch_dma_ctrl[1], IOMD_IO1CR); break;
+ case 2: outb (arch_dma_ctrl[2], IOMD_IO2CR); break;
+ case 3: outb (arch_dma_ctrl[3], IOMD_IO3CR); break;
+ case 4: outb (arch_dma_ctrl[4], IOMD_SD0CR); break;
+ case 5: outb (arch_dma_ctrl[5], IOMD_SD1CR); break;
+ }
+}
+
+static inline void arch_disable_dma(int dmanr)
+{
+ arch_dma_ctrl[dmanr] &= ~DMA_CR_E;
+ switch (dmanr) {
+ case 0: outb (arch_dma_ctrl[0], IOMD_IO0CR); break;
+ case 1: outb (arch_dma_ctrl[1], IOMD_IO1CR); break;
+ case 2: outb (arch_dma_ctrl[2], IOMD_IO2CR); break;
+ case 3: outb (arch_dma_ctrl[3], IOMD_IO3CR); break;
+ case 4: outb (arch_dma_ctrl[4], IOMD_SD0CR); break;
+ case 5: outb (arch_dma_ctrl[5], IOMD_SD1CR); break;
+ }
+}
+
+static inline void arch_set_dma_addr(int dmanr, unsigned int addr)
+{
+ arch_dma_setup &= ~dmanr;
+ arch_dma_addr[dmanr] = addr;
+}
+
+static inline void arch_set_dma_count(int dmanr, unsigned int count)
+{
+ arch_dma_setup &= ~dmanr;
+ arch_dma_cnt[dmanr] = count;
+}
+
+static inline void arch_set_dma_mode(int dmanr, char mode)
+{
+ switch (mode) {
+ case DMA_MODE_READ:
+ arch_dma_ctrl[dmanr] |= DMA_CR_D;
+ break;
+ case DMA_MODE_WRITE:
+ arch_dma_ctrl[dmanr] &= ~DMA_CR_D;
+ break;
+ }
+}
+
+static inline int arch_dma_count (int dmanr)
+{
+ return arch_dma_cnt[dmanr];
+}
+#endif
+
+/* enable/disable a specific DMA channel */
+extern void enable_dma(unsigned int dmanr);
+
+static __inline__ void disable_dma(unsigned int dmanr)
+{
+ switch(dmanr) {
+ case 1: break;
+ case 2: disable_irq(64); break;
+ default: printk(dma_str, "disable_dma", dmanr); break;
+ }
+}
+
+/* Clear the 'DMA Pointer Flip Flop'.
+ * Write 0 for LSB/MSB, 1 for MSB/LSB access.
+ * Use this once to initialize the FF to a known state.
+ * After that, keep track of it. :-)
+ * --- In order to do that, the DMA routines below should ---
+ * --- only be used while interrupts are disabled! ---
+ */
+#define clear_dma_ff(dmanr)
+
+/* set mode (above) for a specific DMA channel */
+extern void set_dma_mode(unsigned int dmanr, char mode);
+
+/* Set only the page register bits of the transfer address.
+ * This is used for successive transfers when we know the contents of
+ * the lower 16 bits of the DMA current address register, but a 64k boundary
+ * may have been crossed.
+ */
+static __inline__ void set_dma_page(unsigned int dmanr, char pagenr)
+{
+ printk (dma_str, "set_dma_page", dmanr);
+}
+
+
+/* Set transfer address & page bits for specific DMA channel.
+ * Assumes dma flipflop is clear.
+ */
+extern void set_dma_addr(unsigned int dmanr, unsigned int addr);
+
+/* Set transfer size for a specific DMA channel.
+ */
+extern void set_dma_count(unsigned int dmanr, unsigned int count);
+
+/* Get DMA residue count. After a DMA transfer, this
+ * should return zero. Reading this while a DMA transfer is
+ * still in progress will return unpredictable results.
+ * If called before the channel has been used, it may return 1.
+ * Otherwise, it returns the number of _bytes_ left to transfer.
+ *
+ * Assumes DMA flip-flop is clear.
+ */
+extern int get_dma_residue(unsigned int dmanr);
+
+#endif /* _ASM_ARCH_DMA_H */
+
diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h
new file mode 100644
index 000000000..2bdd96c6f
--- /dev/null
+++ b/include/asm-arm/arch-rpc/hardware.h
@@ -0,0 +1,101 @@
+/*
+ * linux/include/asm-arm/arch-rpc/hardware.h
+ *
+ * Copyright (C) 1996 Russell King.
+ *
+ * This file contains the hardware definitions of the RiscPC series machines.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+/*
+ * What hardware must be present
+ */
+#define HAS_IOMD
+#define HAS_PCIO
+#define HAS_VIDC20
+
+/*
+ * Optional hardware
+ */
+#define HAS_EXPMASK
+
+/*
+ * Physical definitions
+ */
+#define RAM_START 0x10000000
+#define IO_START 0x03000000
+#define SCREEN_START 0x02000000 /* VRAM */
+
+#ifndef __ASSEMBLER__
+
+/*
+ * for use with inb/outb
+ */
+#define VIDC_AUDIO_BASE 0x80140000
+#define VIDC_BASE 0x80100000
+#define IOCEC4IO_BASE 0x8009c000
+#define IOCECIO_BASE 0x80090000
+#define IOMD_BASE 0x80080000
+#define MEMCEC8IO_BASE 0x8000ac00
+#define MEMCECIO_BASE 0x80000000
+
+/*
+ * IO definitions
+ */
+#define EXPMASK_BASE ((volatile unsigned char *)0xe0360000)
+#define IOEB_BASE ((volatile unsigned char *)0xe0350050)
+#define IOC_BASE ((volatile unsigned char *)0xe0200000)
+#define PCIO_FLOPPYDMABASE ((volatile unsigned char *)0xe002a000)
+#define PCIO_BASE 0xe0010000
+
+/*
+ * Mapping areas
+ */
+#define IO_END 0xe0ffffff
+#define IO_BASE 0xe0000000
+#define IO_SIZE (IO_END - IO_BASE)
+
+/*
+ * Screen mapping information
+ */
+#define SCREEN2_END 0xe0000000
+#define SCREEN2_BASE 0xd8000000
+#define SCREEN1_END SCREEN2_BASE
+#define SCREEN1_BASE 0xd0000000
+
+/*
+ * Offsets from RAM base
+ */
+#define PARAMS_OFFSET 0x0100
+#define KERNEL_OFFSET 0x8000
+
+/*
+ * RAM definitions
+ */
+#define MAPTOPHYS(x) (x)
+#define KERNTOPHYS(x) ((unsigned long)(&x))
+#define GET_MEMORY_END(p) (PAGE_OFFSET + p->u1.s.page_size * \
+ (p->u1.s.pages_in_bank[0] + \
+ p->u1.s.pages_in_bank[1] + \
+ p->u1.s.pages_in_bank[2] + \
+ p->u1.s.pages_in_bank[3]))
+
+#define KERNEL_BASE (PAGE_OFFSET + KERNEL_OFFSET)
+#define PARAMS_BASE (PAGE_OFFSET + PARAMS_OFFSET)
+#define Z_PARAMS_BASE (RAM_START + PARAMS_OFFSET)
+
+#else
+
+#define VIDC_SND_BASE 0xe0500000
+#define VIDC_BASE 0xe0400000
+#define IOMD_BASE 0xe0200000
+#define IOC_BASE 0xe0200000
+#define PCIO_FLOPPYDMABASE 0xe002a000
+#define PCIO_BASE 0xe0010000
+#define IO_BASE 0xe0000000
+
+#endif
+#endif
+
diff --git a/include/asm-arm/arch-rpc/ide.h b/include/asm-arm/arch-rpc/ide.h
new file mode 100644
index 000000000..49463bae0
--- /dev/null
+++ b/include/asm-arm/arch-rpc/ide.h
@@ -0,0 +1,44 @@
+/*
+ * linux/include/asm-arm/arch-rpc/ide.h
+ *
+ * Copyright (c) 1997 Russell King
+ */
+
+static __inline__ int
+ide_default_irq(ide_ioreg_t base)
+{
+ if (base == 0x1f0)
+ return 9;
+ return 0;
+}
+
+static __inline__ ide_ioreg_t
+ide_default_io_base(int index)
+{
+ if (index == 0)
+ return 0x1f0;
+ return 0;
+}
+
+static __inline__ int
+ide_default_stepping(int index)
+{
+ return 0;
+}
+
+static __inline__ void
+ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int stepping, int *irq)
+{
+ ide_ioreg_t port = base;
+ ide_ioreg_t ctrl = base + 0x206;
+ int i;
+
+ i = 8;
+ while (i--) {
+ *p++ = port;
+ port += 1 << stepping;
+ }
+ *p++ = ctrl;
+ if (irq != NULL)
+ irq = 0;
+}
diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h
new file mode 100644
index 000000000..b78483cc8
--- /dev/null
+++ b/include/asm-arm/arch-rpc/io.h
@@ -0,0 +1,203 @@
+/*
+ * linux/include/asm-arm/arch-rpc/io.h
+ *
+ * Copyright (C) 1997 Russell King
+ *
+ * Modifications:
+ * 06-Dec-1997 RMK Created.
+ */
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+/*
+ * 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
+ * bus_to_virt: Used to convert an address for DMA operations
+ * to an address that the kernel can use.
+ */
+#define virt_to_bus(x) ((unsigned long)(x))
+#define bus_to_virt(x) ((void *)(x))
+
+/*
+ * This architecture does not require any delayed IO, and
+ * has the constant-optimised IO
+ */
+#undef ARCH_IO_DELAY
+
+/*
+ * We use two different types of addressing - PC style addresses, and ARM
+ * addresses. PC style accesses the PC hardware with the normal PC IO
+ * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
+ * and are translated to the start of IO. Note that all addresses are
+ * shifted left!
+ */
+#define __PORT_PCIO(x) (!((x) & 0x80000000))
+
+/*
+ * Dynamic IO functions - let the compiler
+ * optimize the expressions
+ */
+#define DECLARE_DYN_OUT(fnsuffix,instr) \
+extern __inline__ void __out##fnsuffix (unsigned int value, unsigned int port) \
+{ \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "tst %2, #0x80000000\n\t" \
+ "mov %0, %4\n\t" \
+ "addeq %0, %0, %3\n\t" \
+ "str" ##instr## " %1, [%0, %2, lsl #2]" \
+ : "=&r" (temp) \
+ : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
+ : "cc"); \
+}
+
+#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
+extern __inline__ unsigned sz __in##fnsuffix (unsigned int port) \
+{ \
+ unsigned long temp, value; \
+ __asm__ __volatile__( \
+ "tst %2, #0x80000000\n\t" \
+ "mov %0, %4\n\t" \
+ "addeq %0, %0, %3\n\t" \
+ "ldr" ##instr## " %1, [%0, %2, lsl #2]" \
+ : "=&r" (temp), "=r" (value) \
+ : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
+ : "cc"); \
+ return (unsigned sz)value; \
+}
+
+extern __inline__ unsigned int __ioaddr (unsigned int port) \
+{ \
+ if (__PORT_PCIO(port)) \
+ return (unsigned int)(PCIO_BASE + (port << 2)); \
+ else \
+ return (unsigned int)(IO_BASE + (port << 2)); \
+}
+
+#define DECLARE_IO(sz,fnsuffix,instr) \
+ DECLARE_DYN_OUT(fnsuffix,instr) \
+ DECLARE_DYN_IN(sz,fnsuffix,instr)
+
+DECLARE_IO(char,b,"b")
+DECLARE_IO(short,w,"")
+DECLARE_IO(long,l,"")
+
+#undef DECLARE_IO
+#undef DECLARE_DYN_OUT
+#undef DECLARE_DYN_IN
+
+/*
+ * Constant address IO functions
+ *
+ * These have to be macros for the 'J' constraint to work -
+ * +/-4096 immediate operand.
+ */
+#define __outbc(value,port) \
+({ \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "strb %0, [%1, %2]" \
+ : : "r" (value), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "strb %0, [%1, %2]" \
+ : : "r" (value), "r" (IO_BASE), "r" ((port) << 2)); \
+})
+
+#define __inbc(port) \
+({ \
+ unsigned char result; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "ldrb %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldrb %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
+ result; \
+})
+
+#define __outwc(value,port) \
+({ \
+ unsigned long v = value; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "str %0, [%1, %2]" \
+ : : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "str %0, [%1, %2]" \
+ : : "r" (v|v<<16), "r" (IO_BASE), "r" ((port) << 2)); \
+})
+
+#define __inwc(port) \
+({ \
+ unsigned short result; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
+ result & 0xffff; \
+})
+
+#define __outlc(value,port) \
+({ \
+ unsigned long v = value; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "str %0, [%1, %2]" \
+ : : "r" (v), "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "str %0, [%1, %2]" \
+ : : "r" (v), "r" (IO_BASE), "r" ((port) << 2)); \
+})
+
+#define __inlc(port) \
+({ \
+ unsigned long result; \
+ if (__PORT_PCIO((port))) \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port) << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldr %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" ((port) << 2)); \
+ result; \
+})
+
+#define __ioaddrc(port) \
+({ \
+ unsigned long addr; \
+ if (__PORT_PCIO((port))) \
+ addr = PCIO_BASE + ((port) << 2); \
+ else \
+ addr = IO_BASE + ((port) << 2); \
+ addr; \
+})
+
+/*
+ * Translated address IO functions
+ *
+ * IO address has already been translated to a virtual address
+ */
+#define outb_t(v,p) \
+ (*(volatile unsigned char *)(p) = (v))
+
+#define inb_t(p) \
+ (*(volatile unsigned char *)(p))
+
+#define outl_t(v,p) \
+ (*(volatile unsigned long *)(p) = (v))
+
+#define inl_t(p) \
+ (*(volatile unsigned long *)(p))
+
+#endif
diff --git a/include/asm-arm/arch-rpc/irq.h b/include/asm-arm/arch-rpc/irq.h
new file mode 100644
index 000000000..750f5c905
--- /dev/null
+++ b/include/asm-arm/arch-rpc/irq.h
@@ -0,0 +1,138 @@
+/*
+ * include/asm-arm/arch-rpc/irq.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * Changelog:
+ * 10-10-1996 RMK Brought up to date with arch-sa110eval
+ */
+
+#define BUILD_IRQ(s,n,m) \
+ void IRQ##n##_interrupt(void); \
+ void fast_IRQ##n##_interrupt(void); \
+ void bad_IRQ##n##_interrupt(void); \
+ void probe_IRQ##n##_interrupt(void);
+
+/*
+ * The timer is a special interrupt
+ */
+#define IRQ5_interrupt timer_IRQ_interrupt
+
+#define IRQ_INTERRUPT(n) IRQ##n##_interrupt
+#define FAST_INTERRUPT(n) fast_IRQ##n##_interrupt
+#define BAD_INTERRUPT(n) bad_IRQ##n##_interrupt
+#define PROBE_INTERRUPT(n) probe_IRQ##n##_interrupt
+
+#define X(x) (x)|0x01, (x)|0x02, (x)|0x04, (x)|0x08, (x)|0x10, (x)|0x20, (x)|0x40, (x)|0x80
+#define Z(x) (x), (x), (x), (x), (x), (x), (x), (x)
+
+static __inline__ void mask_and_ack_irq(unsigned int irq)
+{
+ static const int addrmasks[] = {
+ X((IOMD_IRQMASKA - IOMD_BASE)<<18 | (1 << 15)),
+ X((IOMD_IRQMASKB - IOMD_BASE)<<18),
+ X((IOMD_DMAMASK - IOMD_BASE)<<18),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ X((IOMD_FIQMASK - IOMD_BASE)<<18),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0),
+ Z(0)
+ };
+ unsigned int temp1, temp2;
+
+ __asm__ __volatile__(
+" ldr %1, [%5, %3, lsl #2]\n"
+" teq %1, #0\n"
+" beq 2f\n"
+" ldrb %0, [%2, %1, lsr #16]\n"
+" bic %0, %0, %1\n"
+" strb %0, [%2, %1, lsr #16]\n"
+" tst %1, #0x8000\n" /* do we need an IRQ clear? */
+" strneb %1, [%2, %4]\n"
+"2:"
+ : "=&r" (temp1), "=&r" (temp2)
+ : "r" (ioaddr(IOMD_BASE)), "r" (irq),
+ "I" ((IOMD_IRQCLRA - IOMD_BASE) << 2), "r" (addrmasks));
+}
+
+#undef X
+#undef Z
+
+static __inline__ void mask_irq(unsigned int irq)
+{
+ extern void ecard_disableirq (unsigned int);
+ extern void ecard_disablefiq (unsigned int);
+ unsigned char mask = 1 << (irq & 7);
+
+ switch (irq >> 3) {
+ case 0:
+ outb(inb(IOMD_IRQMASKA) & ~mask, IOMD_IRQMASKA);
+ break;
+ case 1:
+ outb(inb(IOMD_IRQMASKB) & ~mask, IOMD_IRQMASKB);
+ break;
+ case 2:
+ outb(inb(IOMD_DMAMASK) & ~mask, IOMD_DMAMASK);
+ break;
+ case 4:
+ ecard_disableirq (irq & 7);
+ break;
+ case 8:
+ outb(inb(IOMD_FIQMASK) & ~mask, IOMD_FIQMASK);
+ break;
+ case 12:
+ ecard_disablefiq (irq & 7);
+ }
+}
+
+static __inline__ void unmask_irq(unsigned int irq)
+{
+ extern void ecard_enableirq (unsigned int);
+ extern void ecard_enablefiq (unsigned int);
+ unsigned char mask = 1 << (irq & 7);
+
+ switch (irq >> 3) {
+ case 0:
+ outb(inb(IOMD_IRQMASKA) | mask, IOMD_IRQMASKA);
+ break;
+ case 1:
+ outb(inb(IOMD_IRQMASKB) | mask, IOMD_IRQMASKB);
+ break;
+ case 2:
+ outb(inb(IOMD_DMAMASK) | mask, IOMD_DMAMASK);
+ break;
+ case 4:
+ ecard_enableirq (irq & 7);
+ break;
+ case 8:
+ outb(inb(IOMD_FIQMASK) | mask, IOMD_FIQMASK);
+ break;
+ case 12:
+ ecard_enablefiq (irq & 7);
+ }
+}
+
+static __inline__ unsigned long get_enabled_irqs(void)
+{
+ return inb(IOMD_IRQMASKA) | inb(IOMD_IRQMASKB) << 8 | inb(IOMD_DMAMASK) << 16;
+}
+
+static __inline__ void irq_init_irq(void)
+{
+ outb(0, IOMD_IRQMASKA);
+ outb(0, IOMD_IRQMASKB);
+ outb(0, IOMD_FIQMASK);
+ outb(0, IOMD_DMAMASK);
+ outb(0, IOMD_IO0CR);
+ outb(0, IOMD_IO1CR);
+ outb(0, IOMD_IO2CR);
+ outb(0, IOMD_IO3CR);
+}
diff --git a/include/asm-arm/arch-rpc/irqs.h b/include/asm-arm/arch-rpc/irqs.h
new file mode 100644
index 000000000..b7188fb8e
--- /dev/null
+++ b/include/asm-arm/arch-rpc/irqs.h
@@ -0,0 +1,28 @@
+/*
+ * linux/include/asm-arm/arch-a5k/irqs.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#define IRQ_PRINTER 0
+#define IRQ_BATLOW 1
+#define IRQ_FLOPPYINDEX 2
+#define IRQ_VSYNCPULSE 3
+#define IRQ_POWERON 4
+#define IRQ_TIMER0 5
+#define IRQ_TIMER1 6
+#define IRQ_IMMEDIATE 7
+#define IRQ_EXPCARDFIQ 8
+#define IRQ_SOUNDCHANGE 9
+#define IRQ_SERIALPORT 10
+#define IRQ_HARDDISK 11
+#define IRQ_FLOPPYDISK 12
+#define IRQ_EXPANSIONCARD 13
+#define IRQ_KEYBOARDTX 14
+#define IRQ_KEYBOARDRX 15
+
+#define FIQ_FLOPPYDATA 0
+#define FIQ_ECONET 2
+#define FIQ_SERIALPORT 4
+#define FIQ_EXPANSIONCARD 6
+#define FIQ_FORCE 7
diff --git a/include/asm-arm/arch-rpc/mmap.h b/include/asm-arm/arch-rpc/mmap.h
new file mode 100644
index 000000000..4a1cdeab9
--- /dev/null
+++ b/include/asm-arm/arch-rpc/mmap.h
@@ -0,0 +1,48 @@
+/*
+ * linux/include/asm-arm/arch-rpc/mmap.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#define HAVE_MAP_VID_MEM
+#define SAFE_ADDR 0x00000000 /* ROM */
+
+unsigned long map_screen_mem(unsigned long log_start, unsigned long kmem, int update)
+{
+ static int updated = 0;
+ unsigned long address;
+ pgd_t *pgd;
+
+ if (updated)
+ return 0;
+ updated = update;
+
+ address = SCREEN_START | PMD_TYPE_SECT | PMD_DOMAIN(DOMAIN_KERNEL) | PMD_SECT_AP_WRITE;
+ pgd = swapper_pg_dir + (SCREEN2_BASE >> PGDIR_SHIFT);
+ pgd_val(pgd[0]) = address;
+ pgd_val(pgd[1]) = address + (1 << PGDIR_SHIFT);
+
+ if (update) {
+ unsigned long pgtable = PAGE_ALIGN(kmem), *p;
+ int i;
+
+ memzero ((void *)pgtable, 4096);
+
+ pgd_val(pgd[-2]) = virt_to_phys(pgtable) | PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_KERNEL);
+ pgd_val(pgd[-1]) = virt_to_phys(pgtable + PTRS_PER_PTE*4) | PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_KERNEL);
+ p = (unsigned long *)pgtable;
+
+ i = PTRS_PER_PTE * 2 - ((SCREEN1_END - log_start) >> PAGE_SHIFT);
+ address = SCREEN_START | PTE_TYPE_SMALL | PTE_AP_WRITE;
+
+ while (i < PTRS_PER_PTE * 2) {
+ p[i++] = address;
+ address += PAGE_SIZE;
+ }
+
+ flush_page_to_ram(pgtable);
+
+ kmem = pgtable + PAGE_SIZE;
+ }
+ return kmem;
+}
diff --git a/include/asm-arm/arch-rpc/mmu.h b/include/asm-arm/arch-rpc/mmu.h
new file mode 100644
index 000000000..fbd403d36
--- /dev/null
+++ b/include/asm-arm/arch-rpc/mmu.h
@@ -0,0 +1,17 @@
+/*
+ * linux/include/asm-arm/arch-rpc/mmu.h
+ *
+ * Copyright (c) 1996,1997,1998 Russell King.
+ *
+ * Changelog:
+ * 20-10-1996 RMK Created
+ * 31-12-1997 RMK Fixed definitions to reduce warnings
+ * 11-01-1998 RMK Uninlined to reduce hits on cache
+ */
+#ifndef __ASM_ARCH_MMU_H
+#define __ASM_ARCH_MMU_H
+
+extern unsigned long __virt_to_phys(unsigned long vpage);
+extern unsigned long __phys_to_virt(unsigned long ppage);
+
+#endif
diff --git a/include/asm-arm/arch-rpc/oldlatches.h b/include/asm-arm/arch-rpc/oldlatches.h
new file mode 100644
index 000000000..8ff6ebd67
--- /dev/null
+++ b/include/asm-arm/arch-rpc/oldlatches.h
@@ -0,0 +1,9 @@
+/*
+ * Dummy oldlatches.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifdef __need_oldlatches
+#error "Old latches not present in this (rpc) machine"
+#endif
diff --git a/include/asm-arm/arch-rpc/processor.h b/include/asm-arm/arch-rpc/processor.h
new file mode 100644
index 000000000..d5c478737
--- /dev/null
+++ b/include/asm-arm/arch-rpc/processor.h
@@ -0,0 +1,34 @@
+/*
+ * linux/include/asm-arm/arch-rpc/processor.h
+ *
+ * Copyright (c) 1996 Russell King.
+ *
+ * Changelog:
+ * 10-09-1996 RMK Created
+ */
+
+#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 */
+
+/*
+ * User space: 3GB
+ */
+#define TASK_SIZE (0xc0000000UL)
+
+/* This decides where the kernel will search for a free chunk of vm
+ * space during mmap's.
+ */
+#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
+
+#define INIT_MMAP \
+{ &init_mm, 0xc0000000, 0xc2000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
+
+#endif
diff --git a/include/asm-arm/arch-rpc/serial.h b/include/asm-arm/arch-rpc/serial.h
new file mode 100644
index 000000000..2718276cb
--- /dev/null
+++ b/include/asm-arm/arch-rpc/serial.h
@@ -0,0 +1,40 @@
+/*
+ * linux/include/asm-arm/arch-rpc/serial.h
+ *
+ * Copyright (c) 1996 Russell King.
+ *
+ * Changelog:
+ * 15-10-1996 RMK Created
+ */
+#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 STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
+
+ /* UART CLK PORT IRQ FLAGS */
+#define RS_UARTS \
+ { 0, BASE_BAUD, 0x3F8, 10, STD_COM_FLAGS }, /* ttyS0 */ \
+ { 0, BASE_BAUD, 0x2F8, 10, STD_COM_FLAGS }, /* ttyS1 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS2 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS3 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS4 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS5 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS6 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS7 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS8 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS9 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS10 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS11 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS12 */ \
+ { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS13 */
+
+#endif
diff --git a/include/asm-arm/arch-rpc/shmparam.h b/include/asm-arm/arch-rpc/shmparam.h
new file mode 100644
index 000000000..2f7dec9c3
--- /dev/null
+++ b/include/asm-arm/arch-rpc/shmparam.h
@@ -0,0 +1,5 @@
+/*
+ * linux/include/asm-arm/arch-rpc/shmparam.h
+ *
+ * Copyright (c) 1996 Russell King.
+ */
diff --git a/include/asm-arm/arch-rpc/system.h b/include/asm-arm/arch-rpc/system.h
new file mode 100644
index 000000000..aa6e645c6
--- /dev/null
+++ b/include/asm-arm/arch-rpc/system.h
@@ -0,0 +1,23 @@
+/*
+ * linux/include/asm-arm/arch-rpc/system.h
+ *
+ * Copyright (c) 1996 Russell King
+ */
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H
+
+#include <asm/proc-fns.h>
+
+#define arch_hard_reset() { \
+ extern void ecard_reset (int card); \
+ outb (0, IOMD_ROMCR0); \
+ ecard_reset (-1); \
+ cli(); \
+ __asm__ __volatile__("msr spsr, r1;" \
+ "mcr p15, 0, %0, c1, c0, 0;" \
+ "movs pc, #0" \
+ : \
+ : "r" (processor.u.armv3v4.reset())); \
+ }
+
+#endif
diff --git a/include/asm-arm/arch-rpc/time.h b/include/asm-arm/arch-rpc/time.h
new file mode 100644
index 000000000..3d0f742da
--- /dev/null
+++ b/include/asm-arm/arch-rpc/time.h
@@ -0,0 +1,96 @@
+/*
+ * linux/include/asm-arm/arch-rpc/time.h
+ *
+ * Copyright (c) 1996 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
+ */
+
+extern __inline__ unsigned long gettimeoffset (void)
+{
+ unsigned long offset = 0;
+ unsigned int count1, count2, status1, status2;
+
+ status1 = IOMD_IRQREQA;
+ barrier ();
+ outb(0, IOMD_T0LATCH);
+ barrier ();
+ count1 = inb(IOMD_T0CNTL) | (inb(IOMD_T0CNTH) << 8);
+ barrier ();
+ status2 = inb(IOMD_IRQREQA);
+ barrier ();
+ outb(0, IOMD_T0LATCH);
+ barrier ();
+ count2 = inb(IOMD_T0CNTL) | (inb(IOMD_T0CNTH) << 8);
+
+ if (count2 < count1) {
+ /*
+ * This means that we haven't just had an interrupt
+ * while reading into status2.
+ */
+ if (status2 & (1 << 5))
+ offset = tick;
+ count1 = count2;
+ } else if (count2 > count1) {
+ /*
+ * We have just had another interrupt while reading
+ * status2.
+ */
+ offset += tick;
+ count1 = count2;
+ }
+
+ count1 = LATCH - count1;
+ /*
+ * count1 = number of clock ticks since last interrupt
+ */
+ offset += count1 * tick / LATCH;
+ return offset;
+}
+
+/*
+ * No need to reset the timer at every irq
+ */
+#define reset_timer() 1
+
+/*
+ * Updating of the RTC. We don't currently write the time to the
+ * CMOS clock.
+ */
+#define update_rtc()
+
+/*
+ * Set up timer interrupt, and return the current time in seconds.
+ */
+extern __inline__ unsigned long setup_timer (void)
+{
+ extern int iic_control (unsigned char, int, char *, int);
+ unsigned int year, mon, day, hour, min, sec;
+ char buf[8];
+
+ outb(LATCH & 255, IOMD_T0LTCHL);
+ outb(LATCH >> 8, IOMD_T0LTCHH);
+ outb(0, IOMD_T0GO);
+
+ iic_control (0xa0, 0xc0, buf, 1);
+ year = buf[0];
+ if ((year += 1900) < 1970)
+ year += 100;
+
+ iic_control (0xa0, 2, buf, 5);
+ mon = buf[4] & 0x1f;
+ day = buf[3] & 0x3f;
+ hour = buf[2];
+ min = buf[1];
+ sec = buf[0];
+ BCD_TO_BIN(mon);
+ BCD_TO_BIN(day);
+ BCD_TO_BIN(hour);
+ BCD_TO_BIN(min);
+ BCD_TO_BIN(sec);
+
+ return mktime(year, mon, day, hour, min, sec);
+}
diff --git a/include/asm-arm/arch-rpc/timex.h b/include/asm-arm/arch-rpc/timex.h
new file mode 100644
index 000000000..cb3c72abe
--- /dev/null
+++ b/include/asm-arm/arch-rpc/timex.h
@@ -0,0 +1,13 @@
+/*
+ * linux/include/asm-arm/arch-rpc/timex.h
+ *
+ * RiscPC architecture timex specifications
+ *
+ * Copyright (C) 1997, 1998 Russell King
+ */
+
+/*
+ * On the RiscPC, the clock ticks at 2MHz.
+ */
+#define CLOCK_TICK_RATE 2000000
+
diff --git a/include/asm-arm/arch-rpc/uncompress.h b/include/asm-arm/arch-rpc/uncompress.h
new file mode 100644
index 000000000..de645f76d
--- /dev/null
+++ b/include/asm-arm/arch-rpc/uncompress.h
@@ -0,0 +1,143 @@
+/*
+ * linux/include/asm-arm/arch-a5k/uncompress.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+#define VIDMEM ((char *)SCREEN_START)
+
+#include "../arch/arm/drivers/char/font.h"
+#include <asm/hardware.h>
+#include <asm/io.h>
+
+int video_num_columns, video_num_lines, video_size_row;
+int white, bytes_per_char_h;
+extern unsigned long con_charconvtable[256];
+
+struct param_struct {
+ unsigned long page_size;
+ unsigned long nr_pages;
+ unsigned long ramdisk_size;
+ unsigned long mountrootrdonly;
+ unsigned long rootdev;
+ unsigned long video_num_cols;
+ unsigned long video_num_rows;
+ unsigned long video_x;
+ unsigned long video_y;
+ unsigned long memc_control_reg;
+ unsigned char sounddefault;
+ unsigned char adfsdrives;
+ unsigned char bytes_per_char_h;
+ unsigned char bytes_per_char_v;
+ unsigned long unused[256/4-11];
+};
+
+static const unsigned long palette_4[16] = {
+ 0x00000000,
+ 0x000000cc,
+ 0x0000cc00, /* Green */
+ 0x0000cccc, /* Yellow */
+ 0x00cc0000, /* Blue */
+ 0x00cc00cc, /* Magenta */
+ 0x00cccc00, /* Cyan */
+ 0x00cccccc, /* White */
+ 0x00000000,
+ 0x000000ff,
+ 0x0000ff00,
+ 0x0000ffff,
+ 0x00ff0000,
+ 0x00ff00ff,
+ 0x00ffff00,
+ 0x00ffffff
+};
+
+#define palette_setpixel(p) *(unsigned long *)(IO_START+0x00400000) = 0x10000000|((p) & 255)
+#define palette_write(v) *(unsigned long *)(IO_START+0x00400000) = 0x00000000|((v) & 0x00ffffff)
+
+static struct param_struct * const params = (struct param_struct *)Z_PARAMS_BASE;
+
+#ifndef STANDALONE_DEBUG
+/*
+ * This does not append a newline
+ */
+static void puts(const char *s)
+{
+ extern void ll_write_char(char *, unsigned long);
+ int x,y;
+ unsigned char c;
+ char *ptr;
+
+ x = params->video_x;
+ y = params->video_y;
+
+ while ( ( c = *(unsigned char *)s++ ) != '\0' ) {
+ if ( c == '\n' ) {
+ x = 0;
+ if ( ++y >= video_num_lines ) {
+ y--;
+ }
+ } else {
+ ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
+ ll_write_char(ptr, c|(white<<8));
+ if ( ++x >= video_num_columns ) {
+ x = 0;
+ if ( ++y >= video_num_lines ) {
+ y--;
+ }
+ }
+ }
+ }
+
+ params->video_x = x;
+ params->video_y = y;
+}
+
+static void error(char *x);
+
+/*
+ * Setup for decompression
+ */
+static void arch_decomp_setup(void)
+{
+ int i;
+
+ video_num_lines = params->video_num_rows;
+ video_num_columns = params->video_num_cols;
+ bytes_per_char_h = params->bytes_per_char_h;
+ video_size_row = video_num_columns * bytes_per_char_h;
+ if (bytes_per_char_h == 4)
+ for (i = 0; i < 256; i++)
+ con_charconvtable[i] =
+ (i & 128 ? 1 << 0 : 0) |
+ (i & 64 ? 1 << 4 : 0) |
+ (i & 32 ? 1 << 8 : 0) |
+ (i & 16 ? 1 << 12 : 0) |
+ (i & 8 ? 1 << 16 : 0) |
+ (i & 4 ? 1 << 20 : 0) |
+ (i & 2 ? 1 << 24 : 0) |
+ (i & 1 ? 1 << 28 : 0);
+ else
+ for (i = 0; i < 16; i++)
+ con_charconvtable[i] =
+ (i & 8 ? 1 << 0 : 0) |
+ (i & 4 ? 1 << 8 : 0) |
+ (i & 2 ? 1 << 16 : 0) |
+ (i & 1 ? 1 << 24 : 0);
+
+
+ palette_setpixel(0);
+ if (bytes_per_char_h == 1) {
+ palette_write (0);
+ palette_write (0x00ffffff);
+ for (i = 2; i < 256; i++)
+ palette_write (0);
+ white = 1;
+ } else {
+ for (i = 0; i < 256; i++)
+ palette_write (i < 16 ? palette_4[i] : 0);
+ white = 7;
+ }
+
+ if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n");
+}
+#endif
+
diff --git a/include/asm-arm/assembler.h b/include/asm-arm/assembler.h
new file mode 100644
index 000000000..e2dae1533
--- /dev/null
+++ b/include/asm-arm/assembler.h
@@ -0,0 +1,34 @@
+/*
+ * linux/asm/assembler.h
+ *
+ * This file contains arm architecture specific defines
+ * for the different processors.
+ *
+ * Do not include any C declarations in this file - it is included by
+ * assembler source.
+ */
+
+/*
+ * LOADREGS: multiple register load (ldm) with pc in register list
+ * (takes account of ARM6 not using ^)
+ *
+ * RETINSTR: return instruction: adds the 's' in at the end of the
+ * instruction if this is not an ARM6
+ *
+ * SAVEIRQS: save IRQ state (not required on ARM2/ARM3 - done
+ * implicitly
+ *
+ * RESTOREIRQS: restore IRQ state (not required on ARM2/ARM3 - done
+ * implicitly with ldm ... ^ or movs.
+ *
+ * These next two need thinking about - can't easily use stack... (see system.S)
+ * DISABLEIRQS: disable IRQS in SVC mode
+ *
+ * ENABLEIRQS: enable IRQS in SVC mode
+ *
+ * USERMODE: switch to USER mode
+ *
+ * SVCMODE: switch to SVC mode
+ */
+
+#include <asm/proc/assembler.h>
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
new file mode 100644
index 000000000..df9e941db
--- /dev/null
+++ b/include/asm-arm/atomic.h
@@ -0,0 +1,85 @@
+/*
+ * linux/include/asm-arm/atomic.h
+ *
+ * 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.
+ */
+#ifndef __ASM_ARM_ATOMIC_H
+#define __ASM_ARM_ATOMIC_H
+
+#include <asm/system.h>
+
+#ifdef __SMP__
+#error SMP not supported
+#endif
+
+typedef struct { int counter; } atomic_t;
+
+#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)
+{
+ unsigned long flags;
+
+ save_flags_cli (flags);
+ v->counter += i;
+ restore_flags (flags);
+}
+
+static __inline__ void atomic_sub(int i, volatile atomic_t *v)
+{
+ unsigned long flags;
+
+ save_flags_cli (flags);
+ v->counter -= i;
+ restore_flags (flags);
+}
+
+static __inline__ void atomic_inc(volatile atomic_t *v)
+{
+ unsigned long flags;
+
+ save_flags_cli (flags);
+ v->counter += 1;
+ restore_flags (flags);
+}
+
+static __inline__ void atomic_dec(volatile atomic_t *v)
+{
+ unsigned long flags;
+
+ save_flags_cli (flags);
+ v->counter -= 1;
+ restore_flags (flags);
+}
+
+static __inline__ int atomic_dec_and_test(volatile atomic_t *v)
+{
+ unsigned long flags;
+ int result;
+
+ save_flags_cli (flags);
+ v->counter -= 1;
+ result = (v->counter == 0);
+ restore_flags (flags);
+
+ return result;
+}
+
+static __inline__ void atomic_clear_mask(unsigned long mask, unsigned long *addr)
+{
+ unsigned long flags;
+
+ save_flags_cli (flags);
+ *addr &= ~mask;
+ restore_flags (flags);
+}
+
+#endif
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
new file mode 100644
index 000000000..e6d942f71
--- /dev/null
+++ b/include/asm-arm/bitops.h
@@ -0,0 +1,72 @@
+#ifndef __ASM_ARM_BITOPS_H
+#define __ASM_ARM_BITOPS_H
+
+/*
+ * Copyright 1995, Russell King.
+ * Various bits and pieces copyrights include:
+ * Linus Torvalds (test_bit).
+ */
+
+/*
+ * These should be done with inline assembly.
+ * All bit operations return 0 if the bit
+ * was cleared before the operation and != 0 if it was not.
+ *
+ * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
+ */
+
+/*
+ * 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 find_first_zero_bit(void * addr, unsigned size);
+extern int find_next_zero_bit(void * addr, int size, int offset);
+
+/*
+ * This routine doesn't need to be atomic.
+ */
+extern __inline__ int test_bit(int nr, const void * addr)
+{
+ return ((unsigned char *) addr)[nr >> 3] & (1U << (nr & 7));
+}
+
+/*
+ * 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)
+{
+ int k;
+
+ word = ~word;
+ k = 31;
+ if (word & 0x0000ffff) { k -= 16; word <<= 16; }
+ if (word & 0x00ff0000) { k -= 8; word <<= 8; }
+ if (word & 0x0f000000) { k -= 4; word <<= 4; }
+ if (word & 0x30000000) { k -= 2; word <<= 2; }
+ if (word & 0x40000000) { k -= 1; }
+ return k;
+}
+
+#ifdef __KERNEL__
+
+#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_set_bit(nr,addr) test_and_set_bit(nr,addr)
+#define minix_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)
+
+#endif /* __KERNEL__ */
+
+#endif /* _ARM_BITOPS_H */
diff --git a/include/asm-arm/bugs.h b/include/asm-arm/bugs.h
new file mode 100644
index 000000000..b9fc82775
--- /dev/null
+++ b/include/asm-arm/bugs.h
@@ -0,0 +1,13 @@
+/*
+ * include/asm-arm/bugs.h
+ *
+ * Copyright (C) 1995 Russell King
+ */
+#ifndef __ASM_BUGS_H
+#define __ASM_BUGS_H
+
+#include <asm/proc-fns.h>
+
+#define check_bugs() processor._check_bugs()
+
+#endif
diff --git a/include/asm-arm/byteorder.h b/include/asm-arm/byteorder.h
new file mode 100644
index 000000000..7b232d906
--- /dev/null
+++ b/include/asm-arm/byteorder.h
@@ -0,0 +1,39 @@
+#ifndef __ASM_ARM_BYTEORDER_H
+#define __ASM_ARM_BYTEORDER_H
+
+#include <asm/types.h>
+
+#ifdef __GNUC__
+
+static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+{
+ unsigned long xx;
+ __asm__("eor\t%1, %0, %0, ror #16\n\t"
+ "bic\t%1, %1, #0xff0000\n\t"
+ "mov\t%0, %0, ror #8\n\t"
+ "eor\t%0, %0, %1, lsr #8\n\t"
+ : "=r" (x), "=&r" (xx)
+ : "0" (x));
+ return x;
+}
+
+static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+{
+ __asm__("eor\t%0, %0, %0, lsr #8\n\t"
+ "eor\t%0, %0, %0, lsl #8\n\t"
+ "bic\t%0, %0, #0xff0000\n\t"
+ "eor\t%0, %0, %0, lsr #8\n\t"
+ : "=r" (x)
+ : "0" (x));
+ return x;
+}
+
+#define __arch__swab32(x) ___arch__swab32(x)
+#define __arch__swab16(x) ___arch__swab16(x)
+
+#endif /* __GNUC__ */
+
+#include <linux/byteorder/little_endian.h>
+
+#endif
+
diff --git a/include/asm-arm/cache.h b/include/asm-arm/cache.h
new file mode 100644
index 000000000..c5b3c6659
--- /dev/null
+++ b/include/asm-arm/cache.h
@@ -0,0 +1,10 @@
+/*
+ * include/asm-i386/cache.h
+ */
+#ifndef __ASMARM_CACHE_H
+#define __ASMARM_CACHE_H
+
+#define L1_CACHE_BYTES 32
+#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
+
+#endif
diff --git a/include/asm-arm/checksum.h b/include/asm-arm/checksum.h
new file mode 100644
index 000000000..ccfadd761
--- /dev/null
+++ b/include/asm-arm/checksum.h
@@ -0,0 +1,154 @@
+/*
+ * linux/include/asm-arm/checksum.h
+ *
+ * IP checksum routines
+ *
+ * Copyright (C) Original authors of ../asm-i386/checksum.h
+ * Copyright (C) 1996,1997,1998 Russell King
+ */
+#ifndef __ASM_ARM_CHECKSUM_H
+#define __ASM_ARM_CHECKSUM_H
+
+#ifndef __ASM_ARM_SEGMENT_H
+#include <asm/segment.h>
+#endif
+
+/*
+ * computes the checksum of a memory block at buff, length len,
+ * and adds in "sum" (32-bit)
+ *
+ * returns a 32-bit number suitable for feeding into itself
+ * or csum_tcpudp_magic
+ *
+ * this function must be called with even lengths, except
+ * for the last fragment, which may be odd
+ *
+ * it's best to have buff aligned on a 32-bit boundary
+ */
+unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
+
+/*
+ * the same as csum_partial, but copies from src while it
+ * checksums, and handles user-space pointer exceptions correctly, when needed.
+ *
+ * here even more important to align src and dst on a 32-bit (or even
+ * better 64-bit) boundary
+ */
+
+extern
+unsigned int csum_partial_copy_from_user (const char *src, char *dst, int len, int sum, int *err_ptr);
+
+/*
+ * This combination is currently not used, but possible:
+ */
+extern
+unsigned int csum_partial_copy_to_user (const char *src, char *dst, int len, int sum, int *err_ptr);
+
+/*
+ * These are the old (and unsafe) way of doing checksums, a warning message will be
+ * printed if they are used and an exception occurs.
+ *
+ * these functions should go away after some time.
+ */
+#define csum_partial_copy_fromuser csum_partial_copy
+unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum);
+
+/*
+ * This is a version of ip_compute_csum() optimized for IP headers,
+ * which always checksum on 4 octet boundaries.
+ *
+ * Converted and optimised for ARM by R. M. King.
+ *
+ * Note: the order that the LDM registers are loaded with respect to
+ * the adc's doesn't matter.
+ */
+static inline unsigned short ip_fast_csum(unsigned char * iph,
+ unsigned int ihl) {
+ unsigned int sum, tmp1;
+
+ __asm__ __volatile__("
+ sub %2, %2, #5
+ ldr %0, [%1], #4
+ ldr %3, [%1], #4
+ adds %0, %0, %3
+ ldr %3, [%1], #4
+ adcs %0, %0, %3
+ ldr %3, [%1], #4
+ adcs %0, %0, %3
+1: ldr %3, [%1], #4
+ adcs %0, %0, %3
+ tst %2, #15
+ subne %2, %2, #1
+ bne 1b
+ adc %0, %0, #0
+ adds %0, %0, %0, lsl #16
+ addcs %0, %0, #0x10000
+ mvn %0, %0
+ mov %0, %0, lsr #16
+ "
+ : "=&r" (sum), "=&r" (iph), "=&r" (ihl), "=&r" (tmp1)
+ : "1" (iph), "2" (ihl));
+ return(sum);
+}
+
+/*
+ * computes the checksum of the TCP/UDP pseudo-header
+ * returns a 16-bit checksum, already complemented
+ */
+static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
+ unsigned long daddr,
+ unsigned short len,
+ unsigned short proto,
+ unsigned int sum) {
+ __asm__ __volatile__("
+ adds %0, %0, %1
+ adcs %0, %0, %4
+ adcs %0, %0, %5
+ adc %0, %0, #0
+ adds %0, %0, %0, lsl #16
+ addcs %0, %0, #0x10000
+ mvn %0, %0
+ mov %0, %0, lsr #16
+ "
+ : "=&r" (sum), "=&r" (saddr)
+ : "0" (daddr), "1"(saddr), "r"((ntohs(len)<<16)+proto*256), "r"(sum));
+ return((unsigned short)sum);
+}
+
+/*
+ * Fold a partial checksum without adding pseudo headers
+ */
+static inline unsigned int csum_fold(unsigned int sum)
+{
+ __asm__ __volatile__("
+ adds %0, %0, %0, lsl #16
+ addcs %0, %0, #0x10000
+ mvn %0, %0
+ mov %0, %0, lsr #16
+ "
+ : "=r" (sum)
+ : "0" (sum));
+ return sum;
+}
+
+
+/*
+ * this routine is used for miscellaneous IP-like checksums, mainly
+ * in icmp.c
+ */
+
+static inline unsigned short ip_compute_csum(unsigned char * buff, int len) {
+ unsigned int sum;
+
+ __asm__ __volatile__("
+ adds %0, %0, %0, lsl #16
+ addcs %0, %0, #0x10000
+ mvn %0, %0
+ mov %0, %0, lsr #16
+ "
+ : "=r"(sum)
+ : "0" (csum_partial(buff, len, 0)));
+ return(sum);
+}
+
+#endif
diff --git a/include/asm-arm/current.h b/include/asm-arm/current.h
new file mode 100644
index 000000000..9f08dae30
--- /dev/null
+++ b/include/asm-arm/current.h
@@ -0,0 +1,23 @@
+#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;
+}
+
+static inline struct task_struct *get_current(void)
+{
+ struct task_struct *ts;
+ __asm__ __volatile__("
+ bic %0, sp, #0x1f00
+ bic %0, %0, #0x00ff
+ " : "=r" (ts));
+ return ts;
+}
+
+#define current (get_current())
+
+#endif /* _ASMARM_CURRENT_H */
diff --git a/include/asm-arm/delay.h b/include/asm-arm/delay.h
new file mode 100644
index 000000000..3f56cbd70
--- /dev/null
+++ b/include/asm-arm/delay.h
@@ -0,0 +1,32 @@
+#ifndef __ASM_ARM_DELAY_H
+#define __ASM_ARM_DELAY_H
+
+/*
+ * Copyright (C) 1995 Russell King
+ *
+ * Delay routines, using a pre-computed "loops_per_second" value.
+ */
+
+extern void __delay(int loops);
+
+/*
+ * division by multiplication: you don't have to worry about
+ * loss of precision.
+ *
+ * Use only for very small delays ( < 1 msec). Should probably use a
+ * lookup table, really, as the multiplications take much too long with
+ * short delays. This is a "reasonable" implementation, though (and the
+ * first constant multiplications gets optimized away if the delay is
+ * a constant)
+ */
+extern void udelay(unsigned long usecs);
+
+extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
+{
+ return a * b / c;
+}
+
+
+
+#endif /* defined(_ARM_DELAY_H) */
+
diff --git a/include/asm-arm/dma.h b/include/asm-arm/dma.h
new file mode 100644
index 000000000..718fbb2b8
--- /dev/null
+++ b/include/asm-arm/dma.h
@@ -0,0 +1,28 @@
+#ifndef __ASM_ARM_DMA_H
+#define __ASM_ARM_DMA_H
+
+#include <asm/irq.h>
+
+#define MAX_DMA_CHANNELS 14
+#define DMA_0 8
+#define DMA_1 9
+#define DMA_2 10
+#define DMA_3 11
+#define DMA_S0 12
+#define DMA_S1 13
+
+#define DMA_MODE_READ 0x44
+#define DMA_MODE_WRITE 0x48
+
+extern const char dma_str[];
+
+#include <asm/arch/dma.h>
+
+/* These are in kernel/dma.c: */
+/* reserve a DMA channel */
+extern int request_dma(unsigned int dmanr, const char * device_id);
+/* release it again */
+extern void free_dma(unsigned int dmanr);
+
+#endif /* _ARM_DMA_H */
+
diff --git a/include/asm-arm/ecard.h b/include/asm-arm/ecard.h
new file mode 100644
index 000000000..3ca8cf1fb
--- /dev/null
+++ b/include/asm-arm/ecard.h
@@ -0,0 +1,227 @@
+/*
+ * linux/include/asm-arm/ecard.h
+ *
+ * definitions for expansion cards
+ *
+ * This is a new system as from Linux 1.2.3
+ *
+ * Changelog:
+ * 11-12-1996 RMK Further minor improvements
+ * 12-09-1997 RMK Added interrupt enable/disable for card level
+ *
+ * Reference: Acorns Risc OS 3 Programmers Reference Manuals.
+ */
+
+#ifndef __ASM_ECARD_H
+#define __ASM_ECARD_H
+
+/*
+ * Currently understood cards
+ * Manufacturer Product ID
+ */
+#define MANU_ACORN 0x0000
+#define PROD_ACORN_SCSI 0x0002
+#define PROD_ACORN_ETHER1 0x0003
+#define PROD_ACORN_MFM 0x000b
+
+#define MANU_ANT2 0x0011
+#define PROD_ANT_ETHER3 0x00a4
+
+#define MANU_ATOMWIDE 0x0017
+#define PROD_ATOMWIDE_3PSERIAL 0x0090
+
+#define MANU_OAK 0x0021
+#define PROD_OAK_SCSI 0x0058
+
+#define MANU_MORLEY 0x002b
+#define PROD_MORLEY_SCSI_UNCACHED 0x0067
+
+#define MANU_CUMANA 0x003a
+#define PROD_CUMANA_SCSI_1 0x00a0
+#define PROD_CUMANA_SCSI_2 0x003a
+
+#define MANU_ICS 0x003c
+#define PROD_ICS_IDE 0x00ae
+
+#define MANU_SERPORT 0x003f
+#define PROD_SERPORT_DSPORT 0x00b9
+
+#define MANU_I3 0x0046
+#define PROD_I3_ETHERLAN500 0x00d4
+#define PROD_I3_ETHERLAN600 0x00ec
+#define PROD_I3_ETHERLAN600A 0x011e
+
+#define MANU_ANT 0x0053
+#define PROD_ANT_ETHERB 0x00e4
+
+#define MANU_ALSYSTEMS 0x005b
+#define PROD_ALSYS_SCSIATAPI 0x0107
+
+#define MANU_MCS 0x0063
+#define PROD_MCS_CONNECT32 0x0125
+
+
+
+#ifdef ECARD_C
+#define CONST
+#else
+#define CONST const
+#endif
+
+#define MAX_ECARDS 8
+
+/* Type of card's address space */
+typedef enum {
+ ECARD_IOC = 0,
+ ECARD_MEMC = 1
+} card_type_t;
+
+/* Speed of card for ECARD_IOC address space */
+typedef enum {
+ ECARD_SLOW = 0,
+ ECARD_MEDIUM = 1,
+ ECARD_FAST = 2,
+ ECARD_SYNC = 3
+} card_speed_t;
+
+/* Card ID structure */
+typedef struct {
+ unsigned short manufacturer;
+ unsigned short product;
+} card_ids;
+
+/* External view of card ID information */
+struct in_ecld {
+ unsigned short product;
+ unsigned short manufacturer;
+ unsigned char ecld;
+ unsigned char country;
+ unsigned char fiqmask;
+ unsigned char irqmask;
+ unsigned long fiqaddr;
+ unsigned long irqaddr;
+};
+
+typedef struct expansion_card ecard_t;
+
+/* Card handler routines */
+typedef struct {
+ void (*irqenable)(ecard_t *ec, int irqnr);
+ void (*irqdisable)(ecard_t *ec, int irqnr);
+ void (*fiqenable)(ecard_t *ec, int fiqnr);
+ void (*fiqdisable)(ecard_t *ec, int fiqnr);
+} expansioncard_ops_t;
+
+typedef unsigned long *loader_t;
+
+/*
+ * This contains all the info needed on an expansion card
+ */
+struct expansion_card {
+ /* Public data */
+ volatile unsigned char *irqaddr; /* address of IRQ register */
+ volatile unsigned char *fiqaddr; /* address of FIQ register */
+ unsigned char irqmask; /* IRQ mask */
+ unsigned char fiqmask; /* FIQ mask */
+ unsigned char claimed; /* Card claimed? */
+ CONST unsigned char slot_no; /* Slot number */
+ CONST unsigned char irq; /* IRQ number (for request_irq) */
+ CONST unsigned char fiq; /* FIQ number (for request_irq) */
+ CONST unsigned short unused;
+ CONST struct in_ecld cld; /* Card Identification */
+ void *irq_data; /* Data for use for IRQ by card */
+ void *fiq_data; /* Data for use for FIQ by card */
+ expansioncard_ops_t *ops; /* Enable/Disable Ops for card */
+
+ /* Private internal data */
+ CONST unsigned int podaddr; /* Base Linux address for card */
+ CONST loader_t loader; /* loader program */
+};
+
+struct in_chunk_dir {
+ unsigned int start_offset;
+ union {
+ unsigned char string[256];
+ unsigned char data[1];
+ } d;
+};
+
+/*
+ * ecard_claim: claim an expansion card entry
+ */
+#define ecard_claim(ec) ((ec)->claimed = 1)
+
+/*
+ * ecard_release: release an expansion card entry
+ */
+#define ecard_release(ec) ((ec)->claimed = 0)
+
+/*
+ * Start finding cards from the top of the list
+ */
+extern void ecard_startfind (void);
+
+/*
+ * Find an expansion card with the correct cld, product and manufacturer code
+ */
+extern struct expansion_card *ecard_find (int cld, const card_ids *ids);
+
+/*
+ * Read a chunk from an expansion card
+ * cd : where to put read data
+ * ec : expansion card info struct
+ * id : id number to find
+ * num: (n+1)'th id to find.
+ */
+extern int ecard_readchunk (struct in_chunk_dir *cd, struct expansion_card *ec, int id, int num);
+
+/*
+ * Obtain the address of a card
+ */
+extern unsigned int ecard_address (struct expansion_card *ec, card_type_t card_type, card_speed_t speed);
+
+#ifdef ECARD_C
+/* Definitions internal to ecard.c - for it's use only!!
+ *
+ * External expansion card header as read from the card
+ */
+struct ex_ecld {
+ unsigned char r_ecld;
+ unsigned char r_reserved[2];
+ unsigned char r_product[2];
+ unsigned char r_manufacturer[2];
+ unsigned char r_country;
+ long r_fiqs;
+ long r_irqs;
+#define e_ecld(x) ((x)->r_ecld)
+#define e_cd(x) ((x)->r_reserved[0] & 1)
+#define e_is(x) ((x)->r_reserved[0] & 2)
+#define e_w(x) (((x)->r_reserved[0] & 12)>>2)
+#define e_prod(x) ((x)->r_product[0]|((x)->r_product[1]<<8))
+#define e_manu(x) ((x)->r_manufacturer[0]|((x)->r_manufacturer[1]<<8))
+#define e_country(x) ((x)->r_country)
+#define e_fiqmask(x) ((x)->r_fiqs & 0xff)
+#define e_fiqaddr(x) ((x)->r_fiqs >> 8)
+#define e_irqmask(x) ((x)->r_irqs & 0xff)
+#define e_irqaddr(x) ((x)->r_irqs >> 8)
+};
+
+/*
+ * Chunk directory entry as read from the card
+ */
+struct ex_chunk_dir {
+ unsigned char r_id;
+ unsigned char r_len[3];
+ unsigned long r_start;
+ union {
+ char string[256];
+ char data[1];
+ } d;
+#define c_id(x) ((x)->r_id)
+#define c_len(x) ((x)->r_len[0]|((x)->r_len[1]<<8)|((x)->r_len[2]<<16))
+#define c_start(x) ((x)->r_start)
+};
+
+#endif
+
+#endif
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h
new file mode 100644
index 000000000..cf49fbfa1
--- /dev/null
+++ b/include/asm-arm/elf.h
@@ -0,0 +1,54 @@
+#ifndef __ASMARM_ELF_H
+#define __ASMARM_ELF_H
+
+/*
+ * ELF register definitions..
+ */
+
+#include <asm/ptrace.h>
+
+typedef unsigned long elf_greg_t;
+
+#define EM_ARM 40
+
+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef struct { void *null; } elf_fpregset_t;
+
+/*
+ * This is used to ensure we don't load something for the wrong architecture.
+ */
+#define elf_check_arch(x) ( ((x) == EM_ARM) )
+
+/*
+ * These are used to set parameters in the core dumps.
+ */
+#define ELF_CLASS ELFCLASS32
+#define ELF_DATA ELFDATA2LSB;
+#define ELF_ARCH EM_ARM
+
+#define USE_ELF_CORE_DUMP
+#define ELF_EXEC_PAGESIZE 32768
+
+/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
+ use of this is to invoke "./ld.so someprog" to test out a new version of
+ the loader. We need to make sure that it is out of the way of the program
+ that it will "exec", and that there is sufficient room for the brk. */
+
+#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
+
+#define R_ARM_NONE (0)
+#define R_ARM_32 (1) /* => ld 32 */
+#define R_ARM_PC26 (2) /* => ld b/bl branches */
+#define R_ARM_PC32 (3)
+#define R_ARM_GOT32 (4) /* -> object relocation into GOT */
+#define R_ARM_PLT32 (5)
+#define R_ARM_COPY (6) /* => dlink copy object */
+#define R_ARM_GLOB_DAT (7) /* => dlink 32bit absolute address for .got */
+#define R_ARM_JUMP_SLOT (8) /* => dlink 32bit absolute address for .got.plt */
+#define R_ARM_RELATIVE (9) /* => ld resolved 32bit absolute address requiring load address adjustment */
+#define R_ARM_GOTOFF (10) /* => ld calculates offset of data from base of GOT */
+#define R_ARM_GOTPC (11) /* => ld 32-bit relative offset */
+
+#endif
diff --git a/include/asm-arm/errno.h b/include/asm-arm/errno.h
new file mode 100644
index 000000000..48fcd2bca
--- /dev/null
+++ b/include/asm-arm/errno.h
@@ -0,0 +1,132 @@
+#ifndef _ARM_ERRNO_H
+#define _ARM_ERRNO_H
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* I/O error */
+#define ENXIO 6 /* No such device or address */
+#define E2BIG 7 /* Arg list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file number */
+#define ECHILD 10 /* No child processes */
+#define EAGAIN 11 /* Try again */
+#define ENOMEM 12 /* Out of memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+#define ENOTBLK 15 /* Block device required */
+#define EBUSY 16 /* Device or resource busy */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* No such device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* File table overflow */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Not a typewriter */
+#define ETXTBSY 26 /* Text file busy */
+#define EFBIG 27 /* File too large */
+#define ENOSPC 28 /* No space left on device */
+#define ESPIPE 29 /* Illegal seek */
+#define EROFS 30 /* Read-only file system */
+#define EMLINK 31 /* Too many links */
+#define EPIPE 32 /* Broken pipe */
+#define EDOM 33 /* Math argument out of domain of func */
+#define ERANGE 34 /* Math result not representable */
+#define EDEADLK 35 /* Resource deadlock would occur */
+#define ENAMETOOLONG 36 /* File name too long */
+#define ENOLCK 37 /* No record locks available */
+#define ENOSYS 38 /* Function not implemented */
+#define ENOTEMPTY 39 /* Directory not empty */
+#define ELOOP 40 /* Too many symbolic links encountered */
+#define EWOULDBLOCK EAGAIN /* Operation would block */
+#define ENOMSG 42 /* No message of desired type */
+#define EIDRM 43 /* Identifier removed */
+#define ECHRNG 44 /* Channel number out of range */
+#define EL2NSYNC 45 /* Level 2 not synchronized */
+#define EL3HLT 46 /* Level 3 halted */
+#define EL3RST 47 /* Level 3 reset */
+#define ELNRNG 48 /* Link number out of range */
+#define EUNATCH 49 /* Protocol driver not attached */
+#define ENOCSI 50 /* No CSI structure available */
+#define EL2HLT 51 /* Level 2 halted */
+#define EBADE 52 /* Invalid exchange */
+#define EBADR 53 /* Invalid request descriptor */
+#define EXFULL 54 /* Exchange full */
+#define ENOANO 55 /* No anode */
+#define EBADRQC 56 /* Invalid request code */
+#define EBADSLT 57 /* Invalid slot */
+
+#define EDEADLOCK EDEADLK
+
+#define EBFONT 59 /* Bad font file format */
+#define ENOSTR 60 /* Device not a stream */
+#define ENODATA 61 /* No data available */
+#define ETIME 62 /* Timer expired */
+#define ENOSR 63 /* Out of streams resources */
+#define ENONET 64 /* Machine is not on the network */
+#define ENOPKG 65 /* Package not installed */
+#define EREMOTE 66 /* Object is remote */
+#define ENOLINK 67 /* Link has been severed */
+#define EADV 68 /* Advertise error */
+#define ESRMNT 69 /* Srmount error */
+#define ECOMM 70 /* Communication error on send */
+#define EPROTO 71 /* Protocol error */
+#define EMULTIHOP 72 /* Multihop attempted */
+#define EDOTDOT 73 /* RFS specific error */
+#define EBADMSG 74 /* Not a data message */
+#define EOVERFLOW 75 /* Value too large for defined data type */
+#define ENOTUNIQ 76 /* Name not unique on network */
+#define EBADFD 77 /* File descriptor in bad state */
+#define EREMCHG 78 /* Remote address changed */
+#define ELIBACC 79 /* Can not access a needed shared library */
+#define ELIBBAD 80 /* Accessing a corrupted shared library */
+#define ELIBSCN 81 /* .lib section in a.out corrupted */
+#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
+#define ELIBEXEC 83 /* Cannot exec a shared library directly */
+#define EILSEQ 84 /* Illegal byte sequence */
+#define ERESTART 85 /* Interrupted system call should be restarted */
+#define ESTRPIPE 86 /* Streams pipe error */
+#define EUSERS 87 /* Too many users */
+#define ENOTSOCK 88 /* Socket operation on non-socket */
+#define EDESTADDRREQ 89 /* Destination address required */
+#define EMSGSIZE 90 /* Message too long */
+#define EPROTOTYPE 91 /* Protocol wrong type for socket */
+#define ENOPROTOOPT 92 /* Protocol not available */
+#define EPROTONOSUPPORT 93 /* Protocol not supported */
+#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
+#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
+#define EPFNOSUPPORT 96 /* Protocol family not supported */
+#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
+#define EADDRINUSE 98 /* Address already in use */
+#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
+#define ENETDOWN 100 /* Network is down */
+#define ENETUNREACH 101 /* Network is unreachable */
+#define ENETRESET 102 /* Network dropped connection because of reset */
+#define ECONNABORTED 103 /* Software caused connection abort */
+#define ECONNRESET 104 /* Connection reset by peer */
+#define ENOBUFS 105 /* No buffer space available */
+#define EISCONN 106 /* Transport endpoint is already connected */
+#define ENOTCONN 107 /* Transport endpoint is not connected */
+#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
+#define ETOOMANYREFS 109 /* Too many references: cannot splice */
+#define ETIMEDOUT 110 /* Connection timed out */
+#define ECONNREFUSED 111 /* Connection refused */
+#define EHOSTDOWN 112 /* Host is down */
+#define EHOSTUNREACH 113 /* No route to host */
+#define EALREADY 114 /* Operation already in progress */
+#define EINPROGRESS 115 /* Operation now in progress */
+#define ESTALE 116 /* Stale NFS file handle */
+#define EUCLEAN 117 /* Structure needs cleaning */
+#define ENOTNAM 118 /* Not a XENIX named type file */
+#define ENAVAIL 119 /* No XENIX semaphores available */
+#define EISNAM 120 /* Is a named type file */
+#define EREMOTEIO 121 /* Remote I/O error */
+#define EDQUOT 122 /* Quota exceeded */
+
+#define ENOMEDIUM 123 /* No medium found */
+#define EMEDIUMTYPE 124 /* Wrong medium type */
+
+#endif
diff --git a/include/asm-arm/fcntl.h b/include/asm-arm/fcntl.h
new file mode 100644
index 000000000..af29f7f46
--- /dev/null
+++ b/include/asm-arm/fcntl.h
@@ -0,0 +1,59 @@
+#ifndef _ARM_FCNTL_H
+#define _ARM_FCNTL_H
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+ located on an ext2 file system */
+#define O_ACCMODE 0003
+#define O_RDONLY 00
+#define O_WRONLY 01
+#define O_RDWR 02
+#define O_CREAT 0100 /* not fcntl */
+#define O_EXCL 0200 /* not fcntl */
+#define O_NOCTTY 0400 /* not fcntl */
+#define O_TRUNC 01000 /* not fcntl */
+#define O_APPEND 02000
+#define O_NONBLOCK 04000
+#define O_NDELAY O_NONBLOCK
+#define O_SYNC 010000
+#define FASYNC 020000 /* fcntl, for BSD compatibility */
+
+#define F_DUPFD 0 /* dup */
+#define F_GETFD 1 /* get f_flags */
+#define F_SETFD 2 /* set f_flags */
+#define F_GETFL 3 /* more flags (cloexec) */
+#define F_SETFL 4
+#define F_GETLK 5
+#define F_SETLK 6
+#define F_SETLKW 7
+
+#define F_SETOWN 8 /* for sockets. */
+#define F_GETOWN 9 /* for sockets. */
+
+/* for F_[GET|SET]FL */
+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+/* for posix fcntl() and lockf() */
+#define F_RDLCK 0
+#define F_WRLCK 1
+#define F_UNLCK 2
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
+
+/* 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 */
+
+struct flock {
+ short l_type;
+ short l_whence;
+ off_t l_start;
+ off_t l_len;
+ pid_t l_pid;
+};
+
+#endif
diff --git a/include/asm-arm/floppy.h b/include/asm-arm/floppy.h
new file mode 100644
index 000000000..0f3857962
--- /dev/null
+++ b/include/asm-arm/floppy.h
@@ -0,0 +1,113 @@
+/*
+ * linux/include/asm-arm/floppy.h
+ *
+ * (C) 1996 Russell King
+ */
+#ifndef __ASM_ARM_FLOPPY_H
+#define __ASM_ARM_FLOPPY_H
+#if 0
+#include <asm/arch/floppy.h>
+#endif
+
+#define fd_outb(val,port) outb((val),(port))
+#define fd_inb(port) inb((port))
+#define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
+ SA_INTERRUPT|SA_SAMPLE_RANDOM,"floppy",NULL)
+#define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL)
+#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK)
+#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK)
+
+#define fd_request_dma() request_dma(FLOPPY_DMA,"floppy")
+#define fd_free_dma() free_dma(FLOPPY_DMA)
+#define fd_disable_dma() disable_dma(FLOPPY_DMA)
+#define fd_enable_dma() enable_dma(FLOPPY_DMA)
+#define fd_clear_dma_ff() clear_dma_ff(FLOPPY_DMA)
+#define fd_set_dma_mode(mode) set_dma_mode(FLOPPY_DMA, (mode))
+#define fd_set_dma_addr(addr) set_dma_addr(FLOPPY_DMA, virt_to_bus((addr)))
+#define fd_set_dma_count(len) set_dma_count(FLOPPY_DMA, (len))
+#define fd_cacheflush(addr,sz)
+
+/* Floppy_selects is the list of DOR's to select drive fd
+ *
+ * On initialisation, the floppy list is scanned, and the drives allocated
+ * in the order that they are found. This is done by seeking the drive
+ * to a non-zero track, and then restoring it to track 0. If an error occurs,
+ * then there is no floppy drive present. [to be put back in again]
+ */
+static unsigned char floppy_selects[2][4] =
+{
+ { 0x10, 0x21, 0x23, 0x33 },
+ { 0x10, 0x21, 0x23, 0x33 }
+};
+
+#define fd_setdor(dor) \
+do { \
+ int new_dor = (dor); \
+ if (new_dor & 0xf0) \
+ fd_outb((new_dor & 0x0c) | floppy_selects[fdc][new_dor & 3], FD_DOR); \
+ else \
+ fd_outb((new_dor & 0x0c), FD_DOR); \
+} while (0)
+
+/*
+ * Someday, we'll automatically detect which drives are present...
+ */
+extern __inline__ void fd_scandrives (void)
+{
+#if 0
+ int floppy, drive_count;
+
+ fd_disable_irq();
+ raw_cmd = &default_raw_cmd;
+ raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_SEEK;
+ raw_cmd->track = 0;
+ raw_cmd->rate = ?;
+ drive_count = 0;
+ for (floppy = 0; floppy < 4; floppy ++) {
+ current_drive = drive_count;
+ /*
+ * Turn on floppy motor
+ */
+ if (start_motor(redo_fd_request))
+ continue;
+ /*
+ * Set up FDC
+ */
+ fdc_specify();
+ /*
+ * Tell FDC to recalibrate
+ */
+ output_byte(FD_RECALIBRATE);
+ LAST_OUT(UNIT(floppy));
+ /* wait for command to complete */
+ if (!successful) {
+ int i;
+ for (i = drive_count; i < 3; i--)
+ floppy_selects[fdc][i] = floppy_selects[fdc][i + 1];
+ floppy_selects[fdc][3] = 0;
+ floppy -= 1;
+ } else
+ drive_count++;
+ }
+#else
+ floppy_selects[0][0] = 0x10;
+ floppy_selects[0][1] = 0x21;
+ floppy_selects[0][2] = 0x23;
+ floppy_selects[0][3] = 0x33;
+#endif
+}
+
+#define FDC1 (0x3f0)
+static int FDC2 = -1;
+
+#define FLOPPY0_TYPE 4
+#define FLOPPY1_TYPE 4
+
+#define N_FDC 1
+#define N_DRIVE 8
+
+#define FLOPPY_MOTOR_MASK 0xf0
+
+#define CROSS_64KB(a,s) (0)
+
+#endif
diff --git a/include/asm-arm/hardirq.h b/include/asm-arm/hardirq.h
new file mode 100644
index 000000000..0e38fc890
--- /dev/null
+++ b/include/asm-arm/hardirq.h
@@ -0,0 +1,23 @@
+#ifndef __ASM_HARDIRQ_H
+#define __ASM_HARDIRQ_H
+
+#include <linux/tasks.h>
+
+extern unsigned int local_irq_count[NR_CPUS];
+#define in_interrupt() (local_irq_count[smp_processor_id()] != 0)
+
+#ifndef __SMP__
+
+#define hardirq_trylock(cpu) (local_irq_count[cpu] == 0)
+#define hardirq_endlock(cpu) do { } while (0)
+
+#define hardirq_enter(cpu) (local_irq_count[cpu]++)
+#define hardirq_exit(cpu) (local_irq_count[cpu]--)
+
+#define synchronize_irq() do { } while (0)
+
+#else
+#error SMP not supported
+#endif /* __SMP__ */
+
+#endif /* __ASM_HARDIRQ_H */
diff --git a/include/asm-arm/hardware.h b/include/asm-arm/hardware.h
new file mode 100644
index 000000000..6b3cbfaba
--- /dev/null
+++ b/include/asm-arm/hardware.h
@@ -0,0 +1,271 @@
+/*
+ * linux/include/asm-arm/hardware.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * Common hardware definitions
+ */
+
+#ifndef __ASM_HARDWARE_H
+#define __ASM_HARDWARE_H
+
+#include <asm/arch/hardware.h>
+
+/*
+ * Use these macros to read/write the IOC. All it does is perform the actual
+ * read/write.
+ */
+#ifdef HAS_IOC
+#ifndef __ASSEMBLER__
+#define __IOC(offset) (IOC_BASE + (offset >> 2))
+#else
+#define __IOC(offset) offset
+#endif
+
+#define IOC_CONTROL __IOC(0x00)
+#define IOC_KARTTX __IOC(0x04)
+#define IOC_KARTRX __IOC(0x04)
+
+#define IOC_IRQSTATA __IOC(0x10)
+#define IOC_IRQREQA __IOC(0x14)
+#define IOC_IRQCLRA __IOC(0x14)
+#define IOC_IRQMASKA __IOC(0x18)
+
+#define IOC_IRQSTATB __IOC(0x20)
+#define IOC_IRQREQB __IOC(0x24)
+#define IOC_IRQMASKB __IOC(0x28)
+
+#define IOC_FIQSTAT __IOC(0x30)
+#define IOC_FIQREQ __IOC(0x34)
+#define IOC_FIQMASK __IOC(0x38)
+
+#define IOC_T0CNTL __IOC(0x40)
+#define IOC_T0LTCHL __IOC(0x40)
+#define IOC_T0CNTH __IOC(0x44)
+#define IOC_T0LTCHH __IOC(0x44)
+#define IOC_T0GO __IOC(0x48)
+#define IOC_T0LATCH __IOC(0x4c)
+
+#define IOC_T1CNTL __IOC(0x50)
+#define IOC_T1LTCHL __IOC(0x50)
+#define IOC_T1CNTH __IOC(0x54)
+#define IOC_T1LTCHH __IOC(0x54)
+#define IOC_T1GO __IOC(0x58)
+#define IOC_T1LATCH __IOC(0x5c)
+
+#define IOC_T2CNTL __IOC(0x60)
+#define IOC_T2LTCHL __IOC(0x60)
+#define IOC_T2CNTH __IOC(0x64)
+#define IOC_T2LTCHH __IOC(0x64)
+#define IOC_T2GO __IOC(0x68)
+#define IOC_T2LATCH __IOC(0x6c)
+
+#define IOC_T3CNTL __IOC(0x70)
+#define IOC_T3LTCHL __IOC(0x70)
+#define IOC_T3CNTH __IOC(0x74)
+#define IOC_T3LTCHH __IOC(0x74)
+#define IOC_T3GO __IOC(0x78)
+#define IOC_T3LATCH __IOC(0x7c)
+#endif
+
+#ifdef HAS_MEMC
+#define VDMA_ALIGNMENT PAGE_SIZE
+#define VDMA_XFERSIZE 16
+#define VDMA_INIT 0
+#define VDMA_START 1
+#define VDMA_END 2
+
+#define video_set_dma(start,end,offset) \
+do { \
+ memc_write (VDMA_START, (start >> 2)); \
+ memc_write (VDMA_END, (end - VDMA_XFERSIZE) >> 2); \
+ memc_write (VDMA_INIT, (offset >> 2)); \
+} while (0)
+#endif
+
+#ifdef HAS_IOMD
+#ifndef __ASSEMBLER__
+#define __IOMD(offset) (IOMD_BASE + (offset >> 2))
+#else
+#define __IOMD(offset) offset
+#endif
+
+#define IOMD_CONTROL __IOMD(0x000)
+#define IOMD_KARTTX __IOMD(0x004)
+#define IOMD_KARTRX __IOMD(0x004)
+#define IOMD_KCTRL __IOMD(0x008)
+
+#define IOMD_IRQSTATA __IOMD(0x010)
+#define IOMD_IRQREQA __IOMD(0x014)
+#define IOMD_IRQCLRA __IOMD(0x014)
+#define IOMD_IRQMASKA __IOMD(0x018)
+
+#define IOMD_IRQSTATB __IOMD(0x020)
+#define IOMD_IRQREQB __IOMD(0x024)
+#define IOMD_IRQMASKB __IOMD(0x028)
+
+#define IOMD_FIQSTAT __IOMD(0x030)
+#define IOMD_FIQREQ __IOMD(0x034)
+#define IOMD_FIQMASK __IOMD(0x038)
+
+#define IOMD_T0CNTL __IOMD(0x040)
+#define IOMD_T0LTCHL __IOMD(0x040)
+#define IOMD_T0CNTH __IOMD(0x044)
+#define IOMD_T0LTCHH __IOMD(0x044)
+#define IOMD_T0GO __IOMD(0x048)
+#define IOMD_T0LATCH __IOMD(0x04c)
+
+#define IOMD_T1CNTL __IOMD(0x050)
+#define IOMD_T1LTCHL __IOMD(0x050)
+#define IOMD_T1CNTH __IOMD(0x054)
+#define IOMD_T1LTCHH __IOMD(0x054)
+#define IOMD_T1GO __IOMD(0x058)
+#define IOMD_T1LATCH __IOMD(0x05c)
+
+#define IOMD_ROMCR0 __IOMD(0x080)
+#define IOMD_ROMCR1 __IOMD(0x084)
+#define IOMD_DRAMCR __IOMD(0x088)
+#define IOMD_VREFCR __IOMD(0x08C)
+
+#define IOMD_FSIZE __IOMD(0x090)
+#define IOMD_ID0 __IOMD(0x094)
+#define IOMD_ID1 __IOMD(0x098)
+#define IOMD_VERSION __IOMD(0x09C)
+
+#define IOMD_MOUSEX __IOMD(0x0A0)
+#define IOMD_MOUSEY __IOMD(0x0A4)
+
+#define IOMD_DMATCR __IOMD(0x0C0)
+#define IOMD_IOTCR __IOMD(0x0C4)
+#define IOMD_ECTCR __IOMD(0x0C8)
+#define IOMD_DMAEXT __IOMD(0x0CC)
+
+#define IOMD_IO0CURA __IOMD(0x100)
+#define IOMD_IO0ENDA __IOMD(0x104)
+#define IOMD_IO0CURB __IOMD(0x108)
+#define IOMD_IO0ENDB __IOMD(0x10C)
+#define IOMD_IO0CR __IOMD(0x110)
+#define IOMD_IO0ST __IOMD(0x114)
+
+#define IOMD_IO1CURA __IOMD(0x120)
+#define IOMD_IO1ENDA __IOMD(0x124)
+#define IOMD_IO1CURB __IOMD(0x128)
+#define IOMD_IO1ENDB __IOMD(0x12C)
+#define IOMD_IO1CR __IOMD(0x130)
+#define IOMD_IO1ST __IOMD(0x134)
+
+#define IOMD_IO2CURA __IOMD(0x140)
+#define IOMD_IO2ENDA __IOMD(0x144)
+#define IOMD_IO2CURB __IOMD(0x148)
+#define IOMD_IO2ENDB __IOMD(0x14C)
+#define IOMD_IO2CR __IOMD(0x150)
+#define IOMD_IO2ST __IOMD(0x154)
+
+#define IOMD_IO3CURA __IOMD(0x160)
+#define IOMD_IO3ENDA __IOMD(0x164)
+#define IOMD_IO3CURB __IOMD(0x168)
+#define IOMD_IO3ENDB __IOMD(0x16C)
+#define IOMD_IO3CR __IOMD(0x170)
+#define IOMD_IO3ST __IOMD(0x174)
+
+#define IOMD_SD0CURA __IOMD(0x180)
+#define IOMD_SD0ENDA __IOMD(0x184)
+#define IOMD_SD0CURB __IOMD(0x188)
+#define IOMD_SD0ENDB __IOMD(0x18C)
+#define IOMD_SD0CR __IOMD(0x190)
+#define IOMD_SD0ST __IOMD(0x194)
+
+#define IOMD_SD1CURA __IOMD(0x1A0)
+#define IOMD_SD1ENDA __IOMD(0x1A4)
+#define IOMD_SD1CURB __IOMD(0x1A8)
+#define IOMD_SD1ENDB __IOMD(0x1AC)
+#define IOMD_SD1CR __IOMD(0x1B0)
+#define IOMD_SD1ST __IOMD(0x1B4)
+
+#define IOMD_CURSCUR __IOMD(0x1C0)
+#define IOMD_CURSINIT __IOMD(0x1C4)
+
+#define IOMD_VIDCUR __IOMD(0x1D0)
+#define IOMD_VIDEND __IOMD(0x1D4)
+#define IOMD_VIDSTART __IOMD(0x1D8)
+#define IOMD_VIDINIT __IOMD(0x1DC)
+#define IOMD_VIDCR __IOMD(0x1E0)
+
+#define IOMD_DMASTAT __IOMD(0x1F0)
+#define IOMD_DMAREQ __IOMD(0x1F4)
+#define IOMD_DMAMASK __IOMD(0x1F8)
+
+#define DMA_CR_C 0x80
+#define DMA_CR_D 0x40
+#define DMA_CR_E 0x20
+
+#define DMA_ST_OFL 4
+#define DMA_ST_INT 2
+#define DMA_ST_AB 1
+/*
+ * IOC compatability
+ */
+#define IOC_CONTROL IOMD_CONTROL
+#define IOC_IRQSTATA IOMD_IRQSTATA
+#define IOC_IRQREQA IOMD_IRQREQA
+#define IOC_IRQCLRA IOMD_IRQCLRA
+#define IOC_IRQMASKA IOMD_IRQMASKA
+
+#define IOC_IRQSTATB IOMD_IRQSTATB
+#define IOC_IRQREQB IOMD_IRQREQB
+#define IOC_IRQMASKB IOMD_IRQMASKB
+
+#define IOC_FIQSTAT IOMD_FIQSTAT
+#define IOC_FIQREQ IOMD_FIQREQ
+#define IOC_FIQMASK IOMD_FIQMASK
+
+#define IOC_T0CNTL IOMD_T0CNTL
+#define IOC_T0LTCHL IOMD_T0LTCHL
+#define IOC_T0CNTH IOMD_T0CNTH
+#define IOC_T0LTCHH IOMD_T0LTCHH
+#define IOC_T0GO IOMD_T0GO
+#define IOC_T0LATCH IOMD_T0LATCH
+
+#define IOC_T1CNTL IOMD_T1CNTL
+#define IOC_T1LTCHL IOMD_T1LTCHL
+#define IOC_T1CNTH IOMD_T1CNTH
+#define IOC_T1LTCHH IOMD_T1LTCHH
+#define IOC_T1GO IOMD_T1GO
+#define IOC_T1LATCH IOMD_T1LATCH
+
+/*
+ * DMA (MEMC) compatability
+ */
+#define HALF_SAM vram_half_sam
+#define VDMA_ALIGNMENT (HALF_SAM * 2)
+#define VDMA_XFERSIZE (HALF_SAM)
+#define VDMA_INIT IOMD_VIDINIT
+#define VDMA_START IOMD_VIDSTART
+#define VDMA_END IOMD_VIDEND
+
+#ifndef __ASSEMBLER__
+extern unsigned int vram_half_sam;
+#define video_set_dma(start,end,offset) \
+do { \
+ outl (SCREEN_START + start, VDMA_START); \
+ outl (SCREEN_START + end - VDMA_XFERSIZE, VDMA_END); \
+ if (offset >= end - VDMA_XFERSIZE) \
+ offset |= 0x40000000; \
+ outl (SCREEN_START + offset, VDMA_INIT); \
+} while (0)
+#endif
+#endif
+
+#ifdef HAS_EXPMASK
+#ifndef __ASSEMBLER__
+#define __EXPMASK(offset) (((volatile unsigned char *)EXPMASK_BASE)[offset])
+#else
+#define __EXPMASK(offset) offset
+#endif
+
+#define EXPMASK_STATUS __EXPMASK(0x00)
+#define EXPMASK_ENABLE __EXPMASK(0x04)
+
+#endif
+
+#endif
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h
new file mode 100644
index 000000000..3710c2911
--- /dev/null
+++ b/include/asm-arm/ide.h
@@ -0,0 +1,85 @@
+/*
+ * linux/include/asm-arm/ide.h
+ *
+ * Copyright (C) 1994-1996 Linus Torvalds & authors
+ */
+
+/*
+ * This file contains the i386 architecture specific IDE code.
+ */
+
+#ifndef __ASMARM_IDE_H
+#define __ASMARM_IDE_H
+
+#ifdef __KERNEL__
+
+typedef unsigned long ide_ioreg_t;
+
+#ifndef MAX_HWIFS
+#define MAX_HWIFS 4
+#endif
+
+#define ide_sti() sti()
+
+#include <asm/arch/ide.h>
+
+typedef union {
+ unsigned all : 8; /* all of the bits together */
+ struct {
+ unsigned head : 4; /* always zeros here */
+ unsigned unit : 1; /* drive select number, 0 or 1 */
+ unsigned bit5 : 1; /* always 1 */
+ unsigned lba : 1; /* using LBA instead of CHS */
+ unsigned bit7 : 1; /* always 1 */
+ } b;
+ } select_t;
+
+static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
+ unsigned long flags, const char *device, void *dev_id)
+{
+ return request_irq(irq, handler, flags, device, dev_id);
+}
+
+static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
+{
+ free_irq(irq, dev_id);
+}
+
+static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
+{
+ return check_region(from, extent);
+}
+
+static __inline__ void ide_request_region (ide_ioreg_t from, unsigned int extent, const char *name)
+{
+ request_region(from, extent, name);
+}
+
+static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent)
+{
+ release_region(from, extent);
+}
+
+/*
+ * The following are not needed for the non-m68k ports
+ */
+static __inline__ int ide_ack_intr (ide_ioreg_t status_port, ide_ioreg_t irq_port)
+{
+ return(1);
+}
+
+static __inline__ void ide_fix_driveid(struct hd_driveid *id)
+{
+}
+
+static __inline__ void ide_release_lock (int *ide_lock)
+{
+}
+
+static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, struct pt_regs *), void *data)
+{
+}
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASMi386_IDE_H */
diff --git a/include/asm-arm/init.h b/include/asm-arm/init.h
new file mode 100644
index 000000000..7c1e47360
--- /dev/null
+++ b/include/asm-arm/init.h
@@ -0,0 +1,24 @@
+#ifndef _ASMARM_INIT_H
+#define _ASMARM_INIT_H
+
+#if 0
+#define __init __attribute__ ((__section__ (".text.init")))
+#define __initdata __attribute__ ((__section__ (".data.init")))
+#define __initfunc(__arginit) \
+ __arginit __init; \
+ __arginit
+/* For assembly routines */
+#define __INIT .section ".text.init",@alloc,@execinstr
+#define __FINIT .previous
+#define __INITDATA .section ".data.init",@alloc,@write
+#else
+#define __init
+#define __initdata
+#define __initfunc(__arginit) __arginit
+/* For assembly routines */
+#define __INIT
+#define __FINIT
+#define __INITDATA
+#endif
+
+#endif
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
new file mode 100644
index 000000000..8703c920a
--- /dev/null
+++ b/include/asm-arm/io.h
@@ -0,0 +1,203 @@
+/*
+ * linux/include/asm-arm/io.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * Modifications:
+ * 16-Sep-1996 RMK Inlined the inx/outx functions & optimised for both
+ * constant addresses and variable addresses.
+ * 04-Dec-1997 RMK Moved a lot of this stuff to the new architecture
+ * specific IO header files.
+ */
+#ifndef __ASM_ARM_IO_H
+#define __ASM_ARM_IO_H
+
+#include <asm/hardware.h>
+#include <asm/arch/mmu.h>
+#include <asm/arch/io.h>
+
+/* unsigned long virt_to_phys(void *x) */
+#define virt_to_phys(x) __virt_to_phys((unsigned long)(x))
+
+/* void *phys_to_virt(unsigned long x) */
+#define phys_to_virt(x) ((void *)(__phys_to_virt((unsigned long)(x))))
+
+/*
+ * These macros actually build the multi-value IO function prototypes
+ */
+#define __OUTS(s,i,x) extern void outs##s(unsigned int port, const void *from, int len);
+#define __INS(s,i,x) extern void ins##s(unsigned int port, void *to, int len);
+
+#define __IO(s,i,x) \
+ __OUTS(s,i,x) \
+ __INS(s,i,x)
+
+__IO(b,"b",char)
+__IO(w,"h",short)
+__IO(l,"",long)
+
+/*
+ * Note that due to the way __builtin_constant_t() works, you
+ * - can't use it inside an inline function (it will never be true)
+ * - you don't have to worry about side effects withing the __builtin..
+ */
+#ifdef __outbc
+#define outb(val,port) \
+ (__builtin_constant_p((port)) ? __outbc((val),(port)) : __outb((val),(port)))
+#else
+#define outb(val,port) __outb((val),(port))
+#endif
+
+#ifdef __outwc
+#define outw(val,port) \
+ (__builtin_constant_p((port)) ? __outwc((val),(port)) : __outw((val),(port)))
+#else
+#define outw(val,port) __outw((val),(port))
+#endif
+
+#ifdef __outlc
+#define outl(val,port) \
+ (__builtin_constant_p((port)) ? __outlc((val),(port)) : __outl((val),(port)))
+#else
+#define outl(val,port) __outl((val),(port))
+#endif
+
+#ifdef __inbc
+#define inb(port) \
+ (__builtin_constant_p((port)) ? __inbc((port)) : __inb((port)))
+#else
+#define inb(port) __inb((port))
+#endif
+
+#ifdef __inwc
+#define inw(port) \
+ (__builtin_constant_p((port)) ? __inwc((port)) : __inw((port)))
+#else
+#define inw(port) __inw((port))
+#endif
+
+#ifdef __inlc
+#define inl(port) \
+ (__builtin_constant_p((port)) ? __inlc((port)) : __inl((port)))
+#else
+#define inl(port) __inl((port))
+#endif
+
+/*
+ * This macro will give you the translated IO address for this particular
+ * architecture, which can be used with the out_t... functions.
+ */
+#define ioaddr(port) \
+ (__builtin_constant_p((port)) ? __ioaddrc((port)) : __ioaddr((port)))
+
+#ifndef ARCH_IO_DELAY
+/*
+ * This architecture does not require any delayed IO.
+ * It is handled in the hardware.
+ */
+#define outb_p(val,port) outb((val),(port))
+#define outw_p(val,port) outw((val),(port))
+#define outl_p(val,port) outl((val),(port))
+#define inb_p(port) inb((port))
+#define inw_p(port) inw((port))
+#define inl_p(port) inl((port))
+#define outsb_p(port,from,len) outsb(port,from,len)
+#define outsw_p(port,from,len) outsw(port,from,len)
+#define outsl_p(port,from,len) outsl(port,from,len)
+#define insb_p(port,to,len) insb(port,to,len)
+#define insw_p(port,to,len) insw(port,to,len)
+#define insl_p(port,to,len) insl(port,to,len)
+
+#else
+
+/*
+ * We have to delay the IO...
+ */
+#ifdef __outbc_p
+#define outb_p(val,port) \
+ (__builtin_constant_p((port)) ? __outbc_p((val),(port)) : __outb_p((val),(port)))
+#else
+#define outb_p(val,port) __outb_p((val),(port))
+#endif
+
+#ifdef __outwc_p
+#define outw_p(val,port) \
+ (__builtin_constant_p((port)) ? __outwc_p((val),(port)) : __outw_p((val),(port)))
+#else
+#define outw_p(val,port) __outw_p((val),(port))
+#endif
+
+#ifdef __outlc_p
+#define outl_p(val,port) \
+ (__builtin_constant_p((port)) ? __outlc_p((val),(port)) : __outl_p((val),(port)))
+#else
+#define outl_p(val,port) __outl_p((val),(port))
+#endif
+
+#ifdef __inbc_p
+#define inb_p(port) \
+ (__builtin_constant_p((port)) ? __inbc_p((port)) : __inb_p((port)))
+#else
+#define inb_p(port) __inb_p((port))
+#endif
+
+#ifdef __inwc_p
+#define inw_p(port) \
+ (__builtin_constant_p((port)) ? __inwc_p((port)) : __inw_p((port)))
+#else
+#define inw_p(port) __inw_p((port))
+#endif
+
+#ifdef __inlc_p
+#define inl_p(port) \
+ (__builtin_constant_p((port)) ? __inlc_p((port)) : __inl_p((port)))
+#else
+#define inl_p(port) __inl_p((port))
+#endif
+
+#endif
+
+#undef ARCH_IO_DELAY
+#undef ARCH_IO_CONSTANT
+
+/*
+ * Leftovers...
+ */
+#if 0
+#define __outwc(value,port) \
+({ \
+ if (port < 256) \
+ __asm__ __volatile__( \
+ "strh %0, [%1, %2]" \
+ : : "r" (value), "r" (PCIO_BASE), "J" (port << 2)); \
+ else if (__PORT_PCIO(port)) \
+ __asm__ __volatile__( \
+ "strh %0, [%1, %2]" \
+ : : "r" (value), "r" (PCIO_BASE), "r" (port << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "strh %0, [%1, %2]" \
+ : : "r" (value), "r" (IO_BASE), "r" (port << 2)); \
+})
+
+#define __inwc(port) \
+({ \
+ unsigned short result; \
+ if (port < 256) \
+ __asm__ __volatile__( \
+ "ldrh %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "J" (port << 2)); \
+ else \
+ if (__PORT_PCIO(port)) \
+ __asm__ __volatile__( \
+ "ldrh %0, [%1, %2]" \
+ : "=r" (result) : "r" (PCIO_BASE), "r" (port << 2)); \
+ else \
+ __asm__ __volatile__( \
+ "ldrh %0, [%1, %2]" \
+ : "=r" (result) : "r" (IO_BASE), "r" (port << 2)); \
+ result; \
+})
+#endif
+#endif
+
diff --git a/include/asm-arm/ioctl.h b/include/asm-arm/ioctl.h
new file mode 100644
index 000000000..a45e2fadc
--- /dev/null
+++ b/include/asm-arm/ioctl.h
@@ -0,0 +1,75 @@
+/* $Id: ioctl.h,v 1.5 1993/07/19 21:53:50 root Exp root $
+ *
+ * linux/ioctl.h for Linux by H.H. Bergman.
+ */
+
+#ifndef _ASMARM_IOCTL_H
+#define _ASMARM_IOCTL_H
+
+/* ioctl command encoding: 32 bits total, command in lower 16 bits,
+ * size of the parameter structure in the lower 14 bits of the
+ * upper 16 bits.
+ * Encoding the size of the parameter structure in the ioctl request
+ * is useful for catching programs compiled with old versions
+ * and to avoid overwriting user space outside the user buffer area.
+ * The highest 2 bits are reserved for indicating the ``access mode''.
+ * NOTE: This limits the max parameter size to 16kB -1 !
+ */
+
+/*
+ * The following is for compatibility across the various Linux
+ * platforms. The i386 ioctl numbering scheme doesn't really enforce
+ * a type field. De facto, however, the top 8 bits of the lower 16
+ * bits are indeed used as a type field, so we might just as well make
+ * this explicit here. Please be sure to use the decoding macros
+ * below from now on.
+ */
+#define _IOC_NRBITS 8
+#define _IOC_TYPEBITS 8
+#define _IOC_SIZEBITS 14
+#define _IOC_DIRBITS 2
+
+#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
+#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
+#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
+#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
+
+#define _IOC_NRSHIFT 0
+#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
+#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
+#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
+
+/*
+ * Direction bits.
+ */
+#define _IOC_NONE 0U
+#define _IOC_WRITE 1U
+#define _IOC_READ 2U
+
+#define _IOC(dir,type,nr,size) \
+ (((dir) << _IOC_DIRSHIFT) | \
+ ((type) << _IOC_TYPESHIFT) | \
+ ((nr) << _IOC_NRSHIFT) | \
+ ((size) << _IOC_SIZESHIFT))
+
+/* used to create numbers */
+#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
+#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
+#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
+#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
+
+/* used to decode ioctl numbers.. */
+#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
+#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
+#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
+#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
+
+/* ...and for the drivers/sound files... */
+
+#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
+#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
+#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
+#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
+#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
+
+#endif /* _ASMARM_IOCTL_H */
diff --git a/include/asm-arm/ioctls.h b/include/asm-arm/ioctls.h
new file mode 100644
index 000000000..87f998fae
--- /dev/null
+++ b/include/asm-arm/ioctls.h
@@ -0,0 +1,80 @@
+#ifndef __ASM_ARM_IOCTLS_H
+#define __ASM_ARM_IOCTLS_H
+
+#include <asm/ioctl.h>
+
+/* 0x54 is just a magic number to make these relatively unique ('T') */
+
+#define TCGETS 0x5401
+#define TCSETS 0x5402
+#define TCSETSW 0x5403
+#define TCSETSF 0x5404
+#define TCGETA 0x5405
+#define TCSETA 0x5406
+#define TCSETAW 0x5407
+#define TCSETAF 0x5408
+#define TCSBRK 0x5409
+#define TCXONC 0x540A
+#define TCFLSH 0x540B
+#define TIOCEXCL 0x540C
+#define TIOCNXCL 0x540D
+#define TIOCSCTTY 0x540E
+#define TIOCGPGRP 0x540F
+#define TIOCSPGRP 0x5410
+#define TIOCOUTQ 0x5411
+#define TIOCSTI 0x5412
+#define TIOCGWINSZ 0x5413
+#define TIOCSWINSZ 0x5414
+#define TIOCMGET 0x5415
+#define TIOCMBIS 0x5416
+#define TIOCMBIC 0x5417
+#define TIOCMSET 0x5418
+#define TIOCGSOFTCAR 0x5419
+#define TIOCSSOFTCAR 0x541A
+#define FIONREAD 0x541B
+#define TIOCINQ FIONREAD
+#define TIOCLINUX 0x541C
+#define TIOCCONS 0x541D
+#define TIOCGSERIAL 0x541E
+#define TIOCSSERIAL 0x541F
+#define TIOCPKT 0x5420
+#define FIONBIO 0x5421
+#define TIOCNOTTY 0x5422
+#define TIOCSETD 0x5423
+#define TIOCGETD 0x5424
+#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
+#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
+#define TIOCSBRK 0x5427 /* BSD compatibility */
+#define TIOCCBRK 0x5428 /* BSD compatibility */
+#define TIOCGSID 0x5429 /* Return the session ID of FD */
+#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
+
+#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
+#define FIOCLEX 0x5451
+#define FIOASYNC 0x5452
+#define TIOCSERCONFIG 0x5453
+#define TIOCSERGWILD 0x5454
+#define TIOCSERSWILD 0x5455
+#define TIOCGLCKTRMIOS 0x5456
+#define TIOCSLCKTRMIOS 0x5457
+#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
+#define TIOCSERGETLSR 0x5459 /* Get line status register */
+#define TIOCSERGETMULTI 0x545A /* Get multiport config */
+#define TIOCSERSETMULTI 0x545B /* Set multiport config */
+
+#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
+#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
+
+/* Used for packet mode */
+#define TIOCPKT_DATA 0
+#define TIOCPKT_FLUSHREAD 1
+#define TIOCPKT_FLUSHWRITE 2
+#define TIOCPKT_STOP 4
+#define TIOCPKT_START 8
+#define TIOCPKT_NOSTOP 16
+#define TIOCPKT_DOSTOP 32
+
+#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+
+#endif
diff --git a/include/asm-arm/ipc.h b/include/asm-arm/ipc.h
new file mode 100644
index 000000000..c330504ba
--- /dev/null
+++ b/include/asm-arm/ipc.h
@@ -0,0 +1,28 @@
+#ifndef __ASMARM_IPC_H
+#define __ASMARM_IPC_H
+
+/*
+ * These are used to wrap system calls on ARM.
+ *
+ * See arch/arm/kernel/sys-arm.c for ugly details..
+ */
+struct ipc_kludge {
+ struct msgbuf *msgp;
+ long msgtyp;
+};
+
+#define SEMOP 1
+#define SEMGET 2
+#define SEMCTL 3
+#define MSGSND 11
+#define MSGRCV 12
+#define MSGGET 13
+#define MSGCTL 14
+#define SHMAT 21
+#define SHMDT 22
+#define SHMGET 23
+#define SHMCTL 24
+
+#define IPCCALL(version,op) ((version)<<16 | (op))
+
+#endif
diff --git a/include/asm-arm/irq-no.h b/include/asm-arm/irq-no.h
new file mode 100644
index 000000000..7d599cb80
--- /dev/null
+++ b/include/asm-arm/irq-no.h
@@ -0,0 +1,11 @@
+/*
+ * linux/include/asm-arm/irq-no.h
+ *
+ * Machine independent interrupt numbers
+ */
+
+#include <asm/arch/irqs.h>
+
+#ifndef NR_IRQS
+#define NR_IRQS 128
+#endif
diff --git a/include/asm-arm/irq.h b/include/asm-arm/irq.h
new file mode 100644
index 000000000..f7a7a8934
--- /dev/null
+++ b/include/asm-arm/irq.h
@@ -0,0 +1,13 @@
+#ifndef __ASM_ARM_IRQ_H
+#define __ASM_ARM_IRQ_H
+
+#include <asm/irq-no.h>
+
+extern void disable_irq(unsigned int);
+extern void enable_irq(unsigned int);
+
+#define __STR(x) #x
+#define STR(x) __STR(x)
+
+#endif
+
diff --git a/include/asm-arm/limits.h b/include/asm-arm/limits.h
new file mode 100644
index 000000000..08d8c6600
--- /dev/null
+++ b/include/asm-arm/limits.h
@@ -0,0 +1,11 @@
+#ifndef __ASM_PIPE_H
+#define __ASM_PIPE_H
+
+#ifndef PAGE_SIZE
+#include <asm/page.h>
+#endif
+
+#define PIPE_BUF PAGE_SIZE
+
+#endif
+
diff --git a/include/asm-arm/mm-init.h b/include/asm-arm/mm-init.h
new file mode 100644
index 000000000..863e66259
--- /dev/null
+++ b/include/asm-arm/mm-init.h
@@ -0,0 +1,46 @@
+/*
+ * linux/include/asm-arm/mm-init.h
+ *
+ * Copyright (C) 1997,1998 Russell King
+ *
+ * Contained within are structures to describe how to set up the
+ * initial memory map. It includes both a processor-specific header
+ * for parsing these structures, and an architecture-specific header
+ * to fill out the structures.
+ */
+#ifndef __ASM_MM_INIT_H
+#define __ASM_MM_INIT_H
+
+typedef enum {
+ // physical address is absolute
+ init_mem_map_absolute,
+ /* physical address is relative to start_mem
+ * as passed in paging_init
+ */
+ init_mem_map_relative_start_mem
+} init_memmap_type_t;
+
+typedef struct {
+ init_memmap_type_t type;
+ unsigned long physical_address;
+ unsigned long virtual_address;
+ unsigned long size;
+} init_memmap_t;
+
+#define INIT_MEM_MAP_SENTINEL { init_mem_map_absolute, 0, 0, 0 }
+#define INIT_MEM_MAP_ABSOLUTE(p,l,s) { init_mem_map_absolute,p,l,s }
+#define INIT_MEM_MAP_RELATIVE(o,l,s) { init_mem_map_relative_start_mem,o,l,s }
+
+/*
+ * Within this file, initialise an array of init_mem_map_t's
+ * to describe your initial memory mapping structure.
+ */
+#include <asm/arch/mm-init.h>
+
+/*
+ * Contained within this file is code to read the array
+ * of init_mem_map_t's created above.
+ */
+#include <asm/proc/mm-init.h>
+
+#endif
diff --git a/include/asm-arm/mman.h b/include/asm-arm/mman.h
new file mode 100644
index 000000000..9fa76d215
--- /dev/null
+++ b/include/asm-arm/mman.h
@@ -0,0 +1,32 @@
+#ifndef __ARM_MMAN_H__
+#define __ARM_MMAN_H__
+
+#define PROT_READ 0x1 /* page can be read */
+#define PROT_WRITE 0x2 /* page can be written */
+#define PROT_EXEC 0x4 /* page can be executed */
+#define PROT_NONE 0x0 /* page can not be accessed */
+
+#define MAP_SHARED 0x01 /* Share changes */
+#define MAP_PRIVATE 0x02 /* Changes are private */
+#define MAP_TYPE 0x0f /* Mask for type of mapping */
+#define MAP_FIXED 0x10 /* Interpret addr exactly */
+#define MAP_ANONYMOUS 0x20 /* don't use a file */
+
+#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
+#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
+#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
+#define MAP_LOCKED 0x2000 /* pages are locked */
+#define MAP_NORESERVE 0x4000 /* don't check for reservations */
+
+#define MS_ASYNC 1 /* sync memory asynchronously */
+#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 */
+
+/* compatibility flags */
+#define MAP_ANON MAP_ANONYMOUS
+#define MAP_FILE 0
+
+#endif /* __ARM_MMAN_H__ */
diff --git a/include/asm-arm/mmu_context.h b/include/asm-arm/mmu_context.h
new file mode 100644
index 000000000..7325fbaa4
--- /dev/null
+++ b/include/asm-arm/mmu_context.h
@@ -0,0 +1,17 @@
+/*
+ * linux/include/asm-arm/mmu_context.h
+ *
+ * Copyright (c) 1996 Russell King.
+ *
+ * Changelog:
+ * 27-06-1996 RMK Created
+ */
+#ifndef __ASM_ARM_MMU_CONTEXT_H
+#define __ASM_ARM_MMU_CONTEXT_H
+
+#define get_mmu_context(x) do { } while (0)
+
+#define init_new_context(mm) do { } while(0)
+#define destroy_context(mm) do { } while(0)
+
+#endif
diff --git a/include/asm-arm/namei.h b/include/asm-arm/namei.h
new file mode 100644
index 000000000..5270c3bdc
--- /dev/null
+++ b/include/asm-arm/namei.h
@@ -0,0 +1,18 @@
+/* $Id: namei.h,v 1.1 1996/12/13 14:48:21 jj Exp $
+ * linux/include/asm-i386/namei.h
+ *
+ * Included from linux/fs/namei.c
+ */
+
+#ifndef __ASMARM_NAMEI_H
+#define __ASMARM_NAMEI_H
+
+/* This dummy routine maybe changed to something useful
+ * for /usr/gnemul/ emulation stuff.
+ * Look at asm-sparc/namei.h for details.
+ */
+
+#define __prefix_namei(retrieve_mode, name, base, buf, res_dir, res_inode, \
+ last_name, last_entry, last_error) 1
+
+#endif /* __ASMARM_NAMEI_H */
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h
new file mode 100644
index 000000000..9a4429eb9
--- /dev/null
+++ b/include/asm-arm/page.h
@@ -0,0 +1,20 @@
+#ifndef _ASMARM_PAGE_H
+#define _ASMARM_PAGE_H
+
+#include <asm/arch/mmu.h>
+#include <asm/proc/page.h>
+
+#ifdef __KERNEL__
+
+#define clear_page(page) memzero((void *)(page), PAGE_SIZE)
+#define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE)
+
+#endif
+
+/* unsigned long __pa(void *x) */
+#define __pa(x) __virt_to_phys((unsigned long)(x))
+
+/* void *__va(unsigned long x) */
+#define __va(x) ((void *)(__phys_to_virt((unsigned long)(x))))
+
+#endif
diff --git a/include/asm-arm/param.h b/include/asm-arm/param.h
new file mode 100644
index 000000000..0d7de8684
--- /dev/null
+++ b/include/asm-arm/param.h
@@ -0,0 +1 @@
+#include <asm/proc/param.h>
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
new file mode 100644
index 000000000..4f9e5ba4a
--- /dev/null
+++ b/include/asm-arm/pgtable.h
@@ -0,0 +1,10 @@
+#ifndef _ASMARM_PGTABLE_H
+#define _ASMARM_PGTABLE_H
+
+#include <asm/proc-fns.h>
+#include <asm/proc/pgtable.h>
+
+#define module_map vmalloc
+#define module_unmap vfree
+
+#endif /* _ASMARM_PGTABLE_H */
diff --git a/include/asm-arm/poll.h b/include/asm-arm/poll.h
new file mode 100644
index 000000000..fdfdab064
--- /dev/null
+++ b/include/asm-arm/poll.h
@@ -0,0 +1,25 @@
+#ifndef __ASMARM_POLL_H
+#define __ASMARM_POLL_H
+
+/* These are specified by iBCS2 */
+#define POLLIN 0x0001
+#define POLLPRI 0x0002
+#define POLLOUT 0x0004
+#define POLLERR 0x0008
+#define POLLHUP 0x0010
+#define POLLNVAL 0x0020
+
+/* The rest seem to be more-or-less nonstandard. Check them! */
+#define POLLRDNORM 0x0040
+#define POLLRDBAND 0x0080
+#define POLLWRNORM 0x0100
+#define POLLWRBAND 0x0200
+#define POLLMSG 0x0400
+
+struct pollfd {
+ int fd;
+ short events;
+ short revents;
+};
+
+#endif
diff --git a/include/asm-arm/posix_types.h b/include/asm-arm/posix_types.h
new file mode 100644
index 000000000..e32c78139
--- /dev/null
+++ b/include/asm-arm/posix_types.h
@@ -0,0 +1,60 @@
+/*
+ * linux/include/asm-arm/posix_types.h
+ *
+ * Copyright (c) 1996 Russell King.
+ *
+ * Changelog:
+ * 27-06-1996 RMK Created
+ */
+#ifndef __ARCH_ARM_POSIX_TYPES_H
+#define __ARCH_ARM_POSIX_TYPES_H
+
+/*
+ * This file is generally used by user-level software, so you need to
+ * be a little careful about namespace pollution etc. Also, we cannot
+ * assume GCC is being used.
+ */
+
+typedef unsigned short __kernel_dev_t;
+typedef unsigned long __kernel_ino_t;
+typedef unsigned short __kernel_mode_t;
+typedef unsigned short __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef unsigned short __kernel_ipc_pid_t;
+typedef unsigned short __kernel_uid_t;
+typedef unsigned short __kernel_gid_t;
+typedef unsigned int __kernel_size_t;
+typedef int __kernel_ssize_t;
+typedef int __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+
+#ifdef __GNUC__
+typedef long long __kernel_loff_t;
+#endif
+
+typedef struct {
+ int val[2];
+} __kernel_fsid_t;
+
+#undef __FD_SET
+#define __FD_SET(fd, fdsetp) \
+ (((fd_set *)fdsetp)->fds_bits[fd >> 5] |= (1<<(fd & 31)))
+
+#undef __FD_CLR
+#define __FD_CLR(fd, fdsetp) \
+ (((fd_set *)fdsetp)->fds_bits[fd >> 5] &= ~(1<<(fd & 31)))
+
+#undef __FD_ISSET
+#define __FD_ISSET(fd, fdsetp) \
+ ((((fd_set *)fdsetp)->fds_bits[fd >> 5] & (1<<(fd & 31))) != 0)
+
+#undef __FD_ZERO
+#define __FD_ZERO(fdsetp) \
+ (memset (fdsetp, 0, sizeof (*(fd_set *)fdsetp)))
+
+#endif
diff --git a/include/asm-arm/proc-armo/assembler.h b/include/asm-arm/proc-armo/assembler.h
new file mode 100644
index 000000000..5b9e7c058
--- /dev/null
+++ b/include/asm-arm/proc-armo/assembler.h
@@ -0,0 +1,88 @@
+/*
+ * linux/asm-arm/proc-armo/assembler.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * This file contains arm architecture specific defines
+ * for the different processors
+ */
+
+/*
+ * LOADREGS: multiple register load (ldm) with pc in register list
+ * (takes account of ARM6 not using ^)
+ *
+ * RETINSTR: return instruction: adds the 's' in at the end of the
+ * instruction if this is not an ARM6
+ *
+ * SAVEIRQS: save IRQ state (not required on ARM2/ARM3 - done
+ * implicitly
+ *
+ * RESTOREIRQS: restore IRQ state (not required on ARM2/ARM3 - done
+ * implicitly with ldm ... ^ or movs.
+ *
+ * These next two need thinking about - can't easily use stack... (see system.S)
+ * DISABLEIRQS: disable IRQS in SVC mode
+ *
+ * ENABLEIRQS: enable IRQS in SVC mode
+ *
+ * USERMODE: switch to USER mode
+ *
+ * SVCMODE: switch to SVC mode
+ */
+
+#define N_BIT (1 << 31)
+#define Z_BIT (1 << 30)
+#define C_BIT (1 << 29)
+#define V_BIT (1 << 28)
+
+#define PCMASK 0xfc000003
+
+#ifdef __ASSEMBLER__
+
+#define I_BIT (1 << 27)
+#define F_BIT (1 << 26)
+
+#define MODE_USR 0
+#define MODE_FIQ 1
+#define MODE_IRQ 2
+#define MODE_SVC 3
+
+#define DEFAULT_FIQ MODE_FIQ
+
+#define LOADREGS(cond, base, reglist...)\
+ ldm##cond base,reglist^
+
+#define RETINSTR(instr, regs...)\
+ instr##s regs
+
+#define MODENOP\
+ mov r0, r0
+
+#define MODE(savereg,tmpreg,mode) \
+ mov savereg, pc; \
+ bic tmpreg, savereg, $0x0c000003; \
+ orr tmpreg, tmpreg, $mode; \
+ teqp tmpreg, $0
+
+#define RESTOREMODE(savereg) \
+ teqp savereg, $0
+
+#define SAVEIRQS(tmpreg)
+
+#define RESTOREIRQS(tmpreg)
+
+#define DISABLEIRQS(tmpreg)\
+ teqp pc, $0x08000003
+
+#define ENABLEIRQS(tmpreg)\
+ teqp pc, $0x00000003
+
+#define USERMODE(tmpreg)\
+ teqp pc, $0x00000000;\
+ mov r0, r0
+
+#define SVCMODE(tmpreg)\
+ teqp pc, $0x00000003;\
+ mov r0, r0
+
+#endif
diff --git a/include/asm-arm/proc-armo/mm-init-flat.h b/include/asm-arm/proc-armo/mm-init-flat.h
new file mode 100644
index 000000000..919ef59a4
--- /dev/null
+++ b/include/asm-arm/proc-armo/mm-init-flat.h
@@ -0,0 +1,82 @@
+/*
+ * linux/include/asm-arm/proc-armo/mmap.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * This contains the code to setup the memory map on an ARM2/ARM250/ARM3
+ * machine. This is both processor & architecture specific, and requires
+ * some more work to get it to fit into our separate processor and
+ * architecture structure.
+ */
+
+static unsigned long phys_screen_end;
+int page_nr;
+
+#define setup_processor_functions()
+
+/*
+ * This routine needs more work to make it dynamically release/allocate mem!
+ */
+unsigned long map_screen_mem(unsigned long log_start, unsigned long kmem, int update)
+{
+ static int updated = 0;
+ unsigned long address = SCREEN_START, i;
+ pgd_t *pg_dir;
+ pmd_t *pm_dir;
+ pte_t *pt_entry;
+
+ if (updated)
+ return 0;
+ updated = update;
+
+ pg_dir = swapper_pg_dir + (SCREEN1_BASE >> PGDIR_SHIFT);
+ pm_dir = pmd_offset(pg_dir, SCREEN1_BASE);
+ pt_entry = pte_offset(pm_dir, SCREEN1_BASE);
+
+ for (i = SCREEN1_BASE; i < SCREEN1_END; i += PAGE_SIZE) {
+ if (i >= log_start) {
+ *pt_entry = mk_pte(address, __pgprot(_PAGE_PRESENT));
+ address += PAGE_SIZE;
+ } else
+ *pt_entry = mk_pte(0, __pgprot(0));
+ pt_entry++;
+ }
+ phys_screen_end = address;
+ if (update)
+ flush_tlb_all ();
+ return kmem;
+}
+
+static inline unsigned long setup_pagetables(unsigned long start_mem, unsigned long end_mem)
+{
+ unsigned long address;
+ unsigned int spi;
+
+ page_nr = MAP_NR(end_mem);
+
+ /* Allocate zero page */
+ address = PAGE_OFFSET + 480*1024;
+ for (spi = 0; spi < 32768 >> PAGE_SHIFT; spi++) {
+ pgd_val(swapper_pg_dir[spi]) = pte_val(mk_pte(address, PAGE_READONLY));
+ address += PAGE_SIZE;
+ }
+
+ while (spi < (PAGE_OFFSET >> PGDIR_SHIFT))
+ pgd_val(swapper_pg_dir[spi++]) = 0;
+
+ map_screen_mem (SCREEN1_END - 480*1024, 0, 0);
+ return start_mem;
+}
+
+static inline void mark_usable_memory_areas(unsigned long *start_mem, unsigned long end_mem)
+{
+ unsigned long smem = PAGE_ALIGN(*start_mem);
+
+ while (smem < end_mem) {
+ clear_bit(PG_reserved, &mem_map[MAP_NR(smem)].flags);
+ smem += PAGE_SIZE;
+ }
+
+ for (smem = phys_screen_end; smem < SCREEN2_END; smem += PAGE_SIZE)
+ clear_bit(PG_reserved, &mem_map[MAP_NR(smem)].flags);
+}
diff --git a/include/asm-arm/proc-armo/mm-init.h b/include/asm-arm/proc-armo/mm-init.h
new file mode 100644
index 000000000..2cf40e9da
--- /dev/null
+++ b/include/asm-arm/proc-armo/mm-init.h
@@ -0,0 +1,130 @@
+/*
+ * linux/include/asm-arm/proc-armo/mm-init.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * This contains the code to setup the memory map on an ARM2/ARM250/ARM3
+ * machine. This is both processor & architecture specific, and requires
+ * some more work to get it to fit into our separate processor and
+ * architecture structure.
+ */
+
+static unsigned long phys_screen_end;
+int page_nr;
+
+#define setup_processor_functions()
+#define PTE_SIZE (PTRS_PER_PTE * BYTES_PER_PTR)
+
+static inline void setup_swapper_dir (int index, pte_t *ptep)
+{
+ set_pmd (pmd_offset (swapper_pg_dir + index, 0), mk_pmd (ptep));
+}
+
+/*
+ * This routine needs more work to make it dynamically release/allocate mem!
+ */
+unsigned long map_screen_mem(unsigned long log_start, unsigned long kmem, int update)
+{
+ static int updated = 0;
+
+ if (updated)
+ return 0;
+
+ updated = update;
+
+ if (update) {
+ unsigned long address = log_start, offset;
+ pgd_t *pgdp;
+
+ kmem = (kmem + 3) & ~3;
+
+ pgdp = pgd_offset (&init_mm, address); /* +31 */
+ offset = SCREEN_START;
+ while (address < SCREEN1_END) {
+ unsigned long addr_pmd, end_pmd;
+ pmd_t *pmdp;
+
+ /* if (pgd_none (*pgdp)) alloc pmd */
+ pmdp = pmd_offset (pgdp, address); /* +0 */
+ addr_pmd = address & ~PGDIR_MASK; /* 088000 */
+ end_pmd = addr_pmd + SCREEN1_END - address; /* 100000 */
+ if (end_pmd > PGDIR_SIZE)
+ end_pmd = PGDIR_SIZE;
+
+ do {
+ unsigned long addr_pte, end_pte;
+ pte_t *ptep;
+
+ if (pmd_none (*pmdp)) {
+ pte_t *new_pte = (pte_t *)kmem;
+ kmem += PTRS_PER_PTE * BYTES_PER_PTR;
+ memzero (new_pte, PTRS_PER_PTE * BYTES_PER_PTR);
+ set_pmd (pmdp, mk_pmd(new_pte));
+ }
+
+ ptep = pte_offset (pmdp, addr_pmd); /* +11 */
+ addr_pte = addr_pmd & ~PMD_MASK; /* 088000 */
+ end_pte = addr_pte + end_pmd - addr_pmd; /* 100000 */
+ if (end_pte > PMD_SIZE)
+ end_pte = PMD_SIZE;
+
+ do {
+ set_pte (ptep, mk_pte(offset, PAGE_KERNEL));
+ addr_pte += PAGE_SIZE;
+ offset += PAGE_SIZE;
+ ptep++;
+ } while (addr_pte < end_pte);
+
+ pmdp++;
+ addr_pmd = (addr_pmd + PMD_SIZE) & PMD_MASK;
+ } while (addr_pmd < end_pmd);
+
+ address = (address + PGDIR_SIZE) & PGDIR_MASK;
+ pgdp ++;
+ }
+
+ phys_screen_end = offset;
+ flush_tlb_all ();
+ update_mm_cache_all ();
+ }
+ return kmem;
+}
+
+static inline unsigned long setup_pagetables(unsigned long start_mem, unsigned long end_mem)
+{
+ unsigned int i;
+ union {unsigned long l; pte_t *pte; } u;
+
+ page_nr = MAP_NR(end_mem);
+
+ /* map in pages for (0x0000 - 0x8000) */
+ u.l = ((start_mem + (PTE_SIZE-1)) & ~(PTE_SIZE-1));
+ start_mem = u.l + PTE_SIZE;
+ memzero (u.pte, PTE_SIZE);
+ u.pte[0] = mk_pte(PAGE_OFFSET + 491520, PAGE_READONLY);
+ setup_swapper_dir (0, u.pte);
+
+ for (i = 1; i < PTRS_PER_PGD; i++)
+ pgd_val(swapper_pg_dir[i]) = 0;
+
+ /* now map screen mem in */
+ phys_screen_end = SCREEN2_END;
+ map_screen_mem (SCREEN1_END - 480*1024, 0, 0);
+
+ return start_mem;
+}
+
+static inline void mark_usable_memory_areas(unsigned long *start_mem, unsigned long end_mem)
+{
+ unsigned long smem;
+
+ *start_mem = smem = PAGE_ALIGN(*start_mem);
+
+ while (smem < end_mem) {
+ clear_bit(PG_reserved, &mem_map[MAP_NR(smem)].flags);
+ smem += PAGE_SIZE;
+ }
+
+ for (smem = phys_screen_end; smem < SCREEN2_END; smem += PAGE_SIZE)
+ clear_bit(PG_reserved, &mem_map[MAP_NR(smem)].flags);
+}
diff --git a/include/asm-arm/proc-armo/page.h b/include/asm-arm/proc-armo/page.h
new file mode 100644
index 000000000..058d7e9bd
--- /dev/null
+++ b/include/asm-arm/proc-armo/page.h
@@ -0,0 +1,69 @@
+/*
+ * linux/include/asm-arm/proc-armo/page.h
+ *
+ * Copyright (C) 1995, 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_PAGE_H
+#define __ASM_PROC_PAGE_H
+
+/* PAGE_SHIFT determines the page size */
+#define PAGE_SHIFT 15
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
+#define PAGE_MASK (~(PAGE_SIZE-1))
+
+#ifdef __KERNEL__
+
+#define STRICT_MM_TYPECHECKS
+
+#ifdef STRICT_MM_TYPECHECKS
+/*
+ * These are used to make use of C type-checking..
+ */
+typedef struct { unsigned long pte; } pte_t;
+typedef struct { unsigned long pmd; } pmd_t;
+typedef struct { unsigned long pgd; } pgd_t;
+typedef struct { unsigned long pgprot; } pgprot_t;
+
+#define pte_val(x) ((x).pte)
+#define pmd_val(x) ((x).pmd)
+#define pgd_val(x) ((x).pgd)
+#define pgprot_val(x) ((x).pgprot)
+
+#define __pte(x) ((pte_t) { (x) } )
+#define __pmd(x) ((pmd_t) { (x) } )
+#define __pgd(x) ((pgd_t) { (x) } )
+#define __pgprot(x) ((pgprot_t) { (x) } )
+
+#else
+/*
+ * .. while these make it easier on the compiler
+ */
+typedef unsigned long pte_t;
+typedef unsigned long pmd_t;
+typedef unsigned long pgd_t;
+typedef unsigned long pgprot_t;
+
+#define pte_val(x) (x)
+#define pmd_val(x) (x)
+#define pgd_val(x) (x)
+#define pgprot_val(x) (x)
+
+#define __pte(x) (x)
+#define __pmd(x) (x)
+#define __pgd(x) (x)
+#define __pgprot(x) (x)
+
+#endif
+
+/* to align the pointer to the (next) page boundary */
+#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
+
+/* This handles the memory map.. */
+#define PAGE_OFFSET 0x02000000
+#define MAP_NR(addr) (((unsigned long)(addr) - PAGE_OFFSET) >> PAGE_SHIFT)
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_PROC_PAGE_H */
+
diff --git a/include/asm-arm/proc-armo/param.h b/include/asm-arm/proc-armo/param.h
new file mode 100644
index 000000000..230511003
--- /dev/null
+++ b/include/asm-arm/proc-armo/param.h
@@ -0,0 +1,27 @@
+/*
+ * linux/include/asm-arm/proc-armo/param.h
+ *
+ * Copyright (C) 1995, 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_PARAM_H
+#define __ASM_PROC_PARAM_H
+
+#ifndef HZ
+#define HZ 100
+#endif
+
+#define EXEC_PAGESIZE 32768
+
+#ifndef NGROUPS
+#define NGROUPS 32
+#endif
+
+#ifndef NOGROUP
+#define NOGROUP (-1)
+#endif
+
+#define MAXHOSTNAMELEN 64 /* max length of hostname */
+
+#endif
+
diff --git a/include/asm-arm/proc-armo/pgtable-flat.h b/include/asm-arm/proc-armo/pgtable-flat.h
new file mode 100644
index 000000000..994fa9f21
--- /dev/null
+++ b/include/asm-arm/proc-armo/pgtable-flat.h
@@ -0,0 +1,307 @@
+/*
+ * linux/include/asm-arm/proc-armo/pgtable.h
+ *
+ * Copyright (C) 1995, 1996 Russell King
+ */
+#ifndef __ASM_PROC_PGTABLE_H
+#define __ASM_PROC_PGTABLE_H
+
+#include <asm/arch/mmu.h>
+
+#define LIBRARY_TEXT_START 0x0c000000
+
+/*
+ * Cache flushing...
+ */
+#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)
+
+/*
+ * TLB flushing:
+ *
+ * - flush_tlb() flushes the current mm struct TLBs
+ * - 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
+ */
+
+#define flush_tlb() flush_tlb_mm(current->mm)
+
+extern __inline__ void flush_tlb_all(void)
+{
+ struct task_struct *p;
+
+ p = &init_task;
+ do {
+ processor.u.armv2._update_map(p);
+ p = p->next_task;
+ } while (p != &init_task);
+
+ processor.u.armv2._remap_memc (current);
+}
+
+extern __inline__ void flush_tlb_mm(struct mm_struct *mm)
+{
+ struct task_struct *p;
+
+ p = &init_task;
+ do {
+ if (p->mm == mm)
+ processor.u.armv2._update_map(p);
+ p = p->next_task;
+ } while (p != &init_task);
+
+ if (current->mm == mm)
+ processor.u.armv2._remap_memc (current);
+}
+
+#define flush_tlb_range(mm, start, end) flush_tlb_mm(mm)
+#define flush_tlb_page(vma, vmaddr) flush_tlb_mm(vma->vm_mm)
+
+#define __flush_entry_to_ram(entry)
+
+/* Certain architectures need to do special things when pte's
+ * within a page table are directly modified. Thus, the following
+ * hook is made available.
+ */
+#define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval))
+
+/* PMD_SHIFT determines the size of the area a second-level page table can map */
+#define PMD_SHIFT PAGE_SHIFT
+#define PMD_SIZE (1UL << PMD_SHIFT)
+#define PMD_MASK (~(PMD_SIZE-1))
+
+/* PGDIR_SHIFT determines what a third-level page table entry can map */
+#define PGDIR_SHIFT PAGE_SHIFT
+#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
+#define PGDIR_MASK (~(PGDIR_SIZE-1))
+
+/*
+ * entries per page directory level: the arm3 is one-level, so
+ * we don't really have any PMD or PTE directory physically.
+ */
+#define PTRS_PER_PTE 1
+#define PTRS_PER_PMD 1
+#define PTRS_PER_PGD 1024
+
+/* 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_START 0x01a00000
+#define VMALLOC_VMADDR(x) ((unsigned long)(x))
+
+#define _PAGE_PRESENT 0x001
+#define _PAGE_RW 0x002
+#define _PAGE_USER 0x004
+#define _PAGE_PCD 0x010
+#define _PAGE_ACCESSED 0x020
+#define _PAGE_DIRTY 0x040
+
+#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
+#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
+
+#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED)
+#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
+#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
+#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
+#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
+
+/*
+ * The arm can't do page protection for execute, and considers that the same are read.
+ * Also, write permissions imply read permissions. This is the closest we can get..
+ */
+#define __P000 PAGE_NONE
+#define __P001 PAGE_READONLY
+#define __P010 PAGE_COPY
+#define __P011 PAGE_COPY
+#define __P100 PAGE_READONLY
+#define __P101 PAGE_READONLY
+#define __P110 PAGE_COPY
+#define __P111 PAGE_COPY
+
+#define __S000 PAGE_NONE
+#define __S001 PAGE_READONLY
+#define __S010 PAGE_SHARED
+#define __S011 PAGE_SHARED
+#define __S100 PAGE_READONLY
+#define __S101 PAGE_READONLY
+#define __S110 PAGE_SHARED
+#define __S111 PAGE_SHARED
+
+#undef TEST_VERIFY_AREA
+
+/*
+ * BAD_PAGE is used for a bogus page.
+ *
+ * ZERO_PAGE is a global shared page that is always zero: used
+ * for zero-mapped memory areas etc..
+ */
+extern pte_t __bad_page(void);
+extern unsigned long *empty_zero_page;
+
+#define BAD_PAGE __bad_page()
+#define ZERO_PAGE ((unsigned long) empty_zero_page)
+
+/* number of bits that fit into a memory pointer */
+#define BYTES_PER_PTR (sizeof(unsigned long))
+#define BITS_PER_PTR (8*BYTES_PER_PTR)
+
+/* to align the pointer to a pointer address */
+#define PTR_MASK (~(sizeof(void*)-1))
+
+/* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
+#define SIZEOF_PTR_LOG2 2
+
+/* to find an entry in a page-table */
+#define PAGE_PTR(address) \
+((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
+
+/* to set the page-dir */
+#define SET_PAGE_DIR(tsk,pgdir) \
+do { \
+ tsk->tss.memmap = (unsigned long)pgdir; \
+ processor.u.armv2._update_map(tsk); \
+ if ((tsk) == current) \
+ processor.u.armv2._remap_memc (current); \
+} while (0)
+
+extern unsigned long physical_start;
+extern unsigned long physical_end;
+
+extern inline int pte_none(pte_t pte) { return !pte_val(pte); }
+extern inline int pte_present(pte_t pte) { return pte_val(pte) & _PAGE_PRESENT; }
+extern inline void pte_clear(pte_t *ptep) { pte_val(*ptep) = 0; }
+
+extern inline int pmd_none(pmd_t pmd) { return 0; }
+extern inline int pmd_bad(pmd_t pmd) { return 0; }
+extern inline int pmd_present(pmd_t pmd) { return 1; }
+extern inline void pmd_clear(pmd_t * pmdp) { }
+
+/*
+ * The "pgd_xxx()" functions here are trivial for a folded two-level
+ * setup: the pgd is never bad, and a pmd always exists (as it's folded
+ * into the pgd entry)
+ */
+extern inline int pgd_none(pgd_t pgd) { return 0; }
+extern inline int pgd_bad(pgd_t pgd) { return 0; }
+extern inline int pgd_present(pgd_t pgd) { return 1; }
+extern inline void pgd_clear(pgd_t * pgdp) { }
+
+/*
+ * The following only work if pte_present() is true.
+ * Undefined behaviour if not..
+ */
+extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
+extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
+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; }
+#define pte_cacheable(pte) 1
+
+extern inline pte_t pte_nocache(pte_t pte) { return pte; }
+extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_RW; return pte; }
+extern inline pte_t pte_rdprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_USER; return pte; }
+extern inline pte_t pte_exprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_USER; return pte; }
+extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
+extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
+extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_RW; return pte; }
+extern inline pte_t pte_mkread(pte_t pte) { pte_val(pte) |= _PAGE_USER; return pte; }
+extern inline pte_t pte_mkexec(pte_t pte) { pte_val(pte) |= _PAGE_USER; return pte; }
+extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; }
+extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; }
+
+/*
+ * Conversion functions: convert a page and protection to a page entry,
+ * and a page entry and page directory to the page they refer to.
+ */
+extern inline pte_t mk_pte(unsigned long page, pgprot_t pgprot)
+{ pte_t pte; pte_val(pte) = virt_to_phys(page) | pgprot_val(pgprot); return pte; }
+
+extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }
+
+extern inline unsigned long pte_page(pte_t pte)
+{ return phys_to_virt(pte_val(pte) & PAGE_MASK); }
+
+extern inline unsigned long pmd_page(pmd_t pmd)
+{ return phys_to_virt(pmd_val(pmd) & PAGE_MASK); }
+
+/* to find an entry in a page-table-directory */
+extern inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address)
+{
+ return mm->pgd + (address >> PGDIR_SHIFT);
+}
+
+/* Find an entry in the second-level page table.. */
+#define pmd_offset(dir, address) ((pmd_t *)(dir))
+
+/* Find an entry in the third-level page table.. */
+#define pte_offset(dir, address) ((pte_t *)(dir))
+
+/*
+ * Allocate and free page tables. The xxx_kernel() versions are
+ * used to allocate a kernel page table - this turns on ASN bits
+ * if any.
+ */
+extern inline void pte_free_kernel(pte_t * pte)
+{
+ pte_val(*pte) = 0;
+}
+
+extern inline pte_t * pte_alloc_kernel(pmd_t *pmd, unsigned long address)
+{
+ return (pte_t *) pmd;
+}
+
+/*
+ * allocating and freeing a pmd is trivial: the 1-entry pmd is
+ * inside the pgd, so has no extra memory associated with it.
+ */
+#define pmd_free_kernel(pmdp)
+#define pmd_alloc_kernel(pgd,address) ((pmd_t *)(pgd))
+
+#define pte_free(ptep)
+#define pte_alloc(pmd,address) ((pte_t *)(pmd))
+
+/*
+ * allocating and freeing a pmd is trivial: the 1-entry pmd is
+ * inside the pgd, so has no extra memory associated with it.
+ */
+#define pmd_free(pmd)
+#define pmd_alloc(pgd,address) ((pmd_t *)(pgd))
+
+extern inline void pgd_free(pgd_t * pgd)
+{
+ extern void kfree(void *);
+ kfree((void *)pgd);
+}
+
+extern inline pgd_t * pgd_alloc(void)
+{
+ pgd_t *pgd;
+ extern void *kmalloc(unsigned int, int);
+
+ pgd = (pgd_t *) kmalloc(PTRS_PER_PGD * BYTES_PER_PTR, GFP_KERNEL);
+ if (pgd)
+ memset(pgd, 0, PTRS_PER_PGD * BYTES_PER_PTR);
+ return pgd;
+}
+
+extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
+
+#define update_mmu_cache(vma,address,pte) processor.u.armv2._update_mmu_cache(vma,address,pte)
+
+#define SWP_TYPE(entry) (((entry) >> 1) & 0x7f)
+#define SWP_OFFSET(entry) ((entry) >> 8)
+#define SWP_ENTRY(type,offset) (((type) << 1) | ((offset) << 8))
+
+#endif /* __ASM_PROC_PAGE_H */
+
diff --git a/include/asm-arm/proc-armo/pgtable.h b/include/asm-arm/proc-armo/pgtable.h
new file mode 100644
index 000000000..3fdb824e7
--- /dev/null
+++ b/include/asm-arm/proc-armo/pgtable.h
@@ -0,0 +1,403 @@
+/*
+ * linux/include/asm-arm/proc-armo/pgtable.h
+ *
+ * Copyright (C) 1995, 1996 Russell King
+ * Modified 18/19-Oct-1997 for two-level page table
+ */
+#ifndef __ASM_PROC_PGTABLE_H
+#define __ASM_PROC_PGTABLE_H
+
+#include <asm/arch/mmu.h>
+#include <linux/slab.h>
+
+#define LIBRARY_TEXT_START 0x0c000000
+
+/*
+ * Cache flushing...
+ */
+#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 flush_icache_range(start,end) do { } while (0)
+
+/*
+ * TLB flushing:
+ *
+ * - flush_tlb() flushes the current mm struct TLBs
+ * - 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
+ */
+#define flush_tlb() do { } while (0)
+#define flush_tlb_all() do { } while (0)
+#define flush_tlb_mm(mm) do { } while (0)
+#define flush_tlb_range(mm, start, end) do { } while (0)
+#define flush_tlb_page(vma, vmaddr) do { } while (0)
+
+/*
+ * We have a mem map cache...
+ */
+extern __inline__ void update_mm_cache_all(void)
+{
+ struct task_struct *p;
+
+ p = &init_task;
+ do {
+ processor.u.armv2._update_map(p);
+ p = p->next_task;
+ } while (p != &init_task);
+
+ processor.u.armv2._remap_memc (current);
+}
+
+extern __inline__ void update_mm_cache_task(struct task_struct *tsk)
+{
+ processor.u.armv2._update_map(tsk);
+
+ if (tsk == current)
+ processor.u.armv2._remap_memc (tsk);
+}
+
+extern __inline__ void update_mm_cache_mm(struct mm_struct *mm)
+{
+ struct task_struct *p;
+
+ p = &init_task;
+ do {
+ if (p->mm == mm)
+ processor.u.armv2._update_map(p);
+ p = p->next_task;
+ } while (p != &init_task);
+
+ if (current->mm == mm)
+ processor.u.armv2._remap_memc (current);
+}
+
+extern __inline__ void update_mm_cache_mm_addr(struct mm_struct *mm, unsigned long addr, pte_t pte)
+{
+ struct task_struct *p;
+
+ p = &init_task;
+ do {
+ if (p->mm == mm)
+ processor.u.armv2._update_mmu_cache(p, addr, pte);
+ p = p->next_task;
+ } while (p != &init_task);
+
+ if (current->mm == mm)
+ processor.u.armv2._remap_memc (current);
+}
+
+#define __flush_entry_to_ram(entry)
+
+/* Certain architectures need to do special things when pte's
+ * within a page table are directly modified. Thus, the following
+ * hook is made available.
+ */
+/* PMD_SHIFT determines the size of the area a second-level page table can map */
+#define PMD_SHIFT 20
+#define PMD_SIZE (1UL << PMD_SHIFT)
+#define PMD_MASK (~(PMD_SIZE-1))
+
+/* PGDIR_SHIFT determines what a third-level page table entry can map */
+#define PGDIR_SHIFT 20
+#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
+#define PGDIR_MASK (~(PGDIR_SIZE-1))
+
+/*
+ * entries per page directory level: the arm3 is one-level, so
+ * we don't really have any PMD or PTE directory physically.
+ *
+ * 18-Oct-1997 RMK Now two-level (32x32)
+ */
+#define PTRS_PER_PTE 32
+#define PTRS_PER_PMD 1
+#define PTRS_PER_PGD 32
+
+/* 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_START 0x01a00000
+#define VMALLOC_VMADDR(x) ((unsigned long)(x))
+
+#define _PAGE_PRESENT 0x01
+#define _PAGE_READONLY 0x02
+#define _PAGE_NOT_USER 0x04
+#define _PAGE_OLD 0x08
+#define _PAGE_CLEAN 0x10
+
+#define _PAGE_TABLE (_PAGE_PRESENT)
+#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_OLD | _PAGE_CLEAN)
+
+/* -- present -- -- !dirty -- --- !write --- ---- !user --- */
+#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_CLEAN | _PAGE_READONLY | _PAGE_NOT_USER)
+#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_CLEAN )
+#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_CLEAN | _PAGE_READONLY )
+#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_CLEAN | _PAGE_READONLY )
+#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_NOT_USER)
+
+/*
+ * The arm can't do page protection for execute, and considers that the same are read.
+ * Also, write permissions imply read permissions. This is the closest we can get..
+ */
+#define __P000 PAGE_NONE
+#define __P001 PAGE_READONLY
+#define __P010 PAGE_COPY
+#define __P011 PAGE_COPY
+#define __P100 PAGE_READONLY
+#define __P101 PAGE_READONLY
+#define __P110 PAGE_COPY
+#define __P111 PAGE_COPY
+
+#define __S000 PAGE_NONE
+#define __S001 PAGE_READONLY
+#define __S010 PAGE_SHARED
+#define __S011 PAGE_SHARED
+#define __S100 PAGE_READONLY
+#define __S101 PAGE_READONLY
+#define __S110 PAGE_SHARED
+#define __S111 PAGE_SHARED
+
+#undef TEST_VERIFY_AREA
+
+extern unsigned long *empty_zero_page;
+
+/*
+ * BAD_PAGETABLE is used when we need a bogus page-table, while
+ * BAD_PAGE is used for a bogus page.
+ *
+ * ZERO_PAGE is a global shared page that is always zero: used
+ * for zero-mapped memory areas etc..
+ */
+extern pte_t __bad_page(void);
+extern pte_t *__bad_pagetable(void);
+
+#define BAD_PAGETABLE __bad_pagetable()
+#define BAD_PAGE __bad_page()
+#define ZERO_PAGE ((unsigned long) empty_zero_page)
+
+/* number of bits that fit into a memory pointer */
+#define BYTES_PER_PTR (sizeof(unsigned long))
+#define BITS_PER_PTR (8*BYTES_PER_PTR)
+
+/* to align the pointer to a pointer address */
+#define PTR_MASK (~(sizeof(void*)-1))
+
+/* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
+#define SIZEOF_PTR_LOG2 2
+
+/* to find an entry in a page-table */
+#define PAGE_PTR(address) \
+((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
+
+/* to set the page-dir */
+#define SET_PAGE_DIR(tsk,pgdir) \
+do { \
+ tsk->tss.memmap = (unsigned long)pgdir; \
+ processor.u.armv2._update_map(tsk); \
+ if ((tsk) == current) \
+ processor.u.armv2._remap_memc (current); \
+} while (0)
+
+extern unsigned long physical_start;
+extern unsigned long physical_end;
+
+#define pte_none(pte) (!pte_val(pte))
+#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
+#define pte_clear(ptep) set_pte((ptep), __pte(0))
+
+#define pmd_none(pmd) (!pmd_val(pmd))
+#define pmd_bad(pmd) ((pmd_val(pmd) & 0xfc000002))
+#define pmd_present(pmd) (pmd_val(pmd) & _PAGE_PRESENT)
+#define pmd_clear(pmdp) set_pmd(pmdp, __pmd(0))
+
+/*
+ * The "pgd_xxx()" functions here are trivial for a folded two-level
+ * setup: the pgd is never bad, and a pmd always exists (as it's folded
+ * into the pgd entry)
+ */
+#define pgd_none(pgd) (0)
+#define pgd_bad(pgd) (0)
+#define pgd_present(pgd) (1)
+#define pgd_clear(pgdp)
+
+/*
+ * The following only work if pte_present() is true.
+ * Undefined behaviour if not..
+ */
+extern inline int pte_read(pte_t pte) { return !(pte_val(pte) & _PAGE_NOT_USER); }
+extern inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_READONLY); }
+extern inline int pte_exec(pte_t pte) { return !(pte_val(pte) & _PAGE_NOT_USER); }
+extern inline int pte_dirty(pte_t pte) { return !(pte_val(pte) & _PAGE_CLEAN); }
+extern inline int pte_young(pte_t pte) { return !(pte_val(pte) & _PAGE_OLD); }
+#define pte_cacheable(pte) 1
+
+extern inline pte_t pte_nocache(pte_t pte) { return pte; }
+extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_READONLY; return pte; }
+extern inline pte_t pte_rdprotect(pte_t pte) { pte_val(pte) |= _PAGE_NOT_USER; return pte; }
+extern inline pte_t pte_exprotect(pte_t pte) { pte_val(pte) |= _PAGE_NOT_USER; return pte; }
+extern inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) |= _PAGE_CLEAN; return pte; }
+extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) |= _PAGE_OLD; return pte; }
+
+extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) &= ~_PAGE_READONLY; return pte; }
+extern inline pte_t pte_mkread(pte_t pte) { pte_val(pte) &= ~_PAGE_NOT_USER; return pte; }
+extern inline pte_t pte_mkexec(pte_t pte) { pte_val(pte) &= ~_PAGE_NOT_USER; return pte; }
+extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) &= ~_PAGE_CLEAN; return pte; }
+extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) &= ~_PAGE_OLD; return pte; }
+
+/*
+ * Conversion functions: convert a page and protection to a page entry,
+ * and a page entry and page directory to the page they refer to.
+ */
+extern __inline__ pte_t mk_pte(unsigned long page, pgprot_t pgprot)
+{
+ pte_t pte;
+ pte_val(pte) = __virt_to_phys(page) | pgprot_val(pgprot);
+ return pte;
+}
+
+/* This takes a physical page address that is used by the remapping functions */
+extern __inline__ pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
+{
+ pte_t pte;
+ pte_val(pte) = physpage + pgprot_val(pgprot);
+ return pte;
+}
+
+extern __inline__ pte_t pte_modify(pte_t pte, pgprot_t newprot)
+{
+ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot);
+ return pte;
+}
+
+#define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval))
+
+extern __inline__ unsigned long pte_page(pte_t pte)
+{
+ return __phys_to_virt(pte_val(pte) & PAGE_MASK);
+}
+
+extern __inline__ pmd_t mk_pmd (pte_t *ptep)
+{
+ pmd_t pmd;
+ pmd_val(pmd) = __virt_to_phys((unsigned long)ptep) | _PAGE_TABLE;
+ return pmd;
+}
+
+#define set_pmd(pmdp,pmd) ((*(pmdp)) = (pmd))
+
+extern __inline__ unsigned long pmd_page(pmd_t pmd)
+{
+ return __phys_to_virt(pmd_val(pmd) & ~_PAGE_TABLE);
+}
+
+/* to find an entry in a kernel page-table-directory */
+#define pgd_offset_k(address) pgd_offset(&init_mm, address)
+
+/* to find an entry in a page-table-directory */
+extern __inline__ pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address)
+{
+ return mm->pgd + (address >> PGDIR_SHIFT);
+}
+
+/* Find an entry in the second-level page table.. */
+#define pmd_offset(dir, address) ((pmd_t *)(dir))
+
+/* Find an entry in the third-level page table.. */
+extern __inline__ pte_t * pte_offset(pmd_t *dir, unsigned long address)
+{
+ return (pte_t *)pmd_page(*dir) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
+}
+
+/*
+ * Allocate and free page tables. The xxx_kernel() versions are
+ * used to allocate a kernel page table - this turns on ASN bits
+ * if any.
+ */
+#define pte_free_kernel(pte) pte_free((pte))
+#define pte_alloc_kernel(pmd,address) pte_alloc((pmd),(address))
+
+/*
+ * allocating and freeing a pmd is trivial: the 1-entry pmd is
+ * inside the pgd, so has no extra memory associated with it.
+ */
+#define pmd_free_kernel(pmdp)
+#define pmd_alloc_kernel(pgd,address) ((pmd_t *)(pgd))
+
+extern __inline__ void pte_free(pte_t * pte)
+{
+ kfree (pte);
+}
+
+extern const char bad_pmd_string[];
+
+extern __inline__ pte_t *pte_alloc(pmd_t * pmd, unsigned long address)
+{
+ address = (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
+
+ if (pmd_none (*pmd)) {
+ pte_t *page = (pte_t *) kmalloc (PTRS_PER_PTE * BYTES_PER_PTR, GFP_KERNEL);
+ if (pmd_none (*pmd)) {
+ if (page) {
+ memzero (page, PTRS_PER_PTE * BYTES_PER_PTR);
+ set_pmd(pmd, mk_pmd(page));
+ return page + address;
+ }
+ set_pmd (pmd, mk_pmd (BAD_PAGETABLE));
+ return NULL;
+ }
+ kfree (page);
+ }
+ if (pmd_bad (*pmd)) {
+ printk(bad_pmd_string, pmd_val(*pmd));
+ set_pmd (pmd, mk_pmd (BAD_PAGETABLE));
+ return NULL;
+ }
+ return (pte_t *) pmd_page(*pmd) + address;
+}
+
+/*
+ * allocating and freeing a pmd is trivial: the 1-entry pmd is
+ * inside the pgd, so has no extra memory associated with it.
+ */
+#define pmd_free(pmd)
+#define pmd_alloc(pgd,address) ((pmd_t *)(pgd))
+
+/*
+ * Free a page directory. Takes the virtual address.
+ */
+extern __inline__ void pgd_free(pgd_t * pgd)
+{
+ kfree ((void *)pgd);
+}
+
+/*
+ * Allocate a new page directory. Return the virtual address of it.
+ */
+extern __inline__ pgd_t * pgd_alloc(void)
+{
+ pgd_t *pgd;
+
+ pgd = (pgd_t *) kmalloc(PTRS_PER_PGD * BYTES_PER_PTR, GFP_KERNEL);
+ if (pgd)
+ memzero (pgd, PTRS_PER_PGD * BYTES_PER_PTR);
+ return pgd;
+}
+
+extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
+
+#define update_mmu_cache(vma,address,pte)
+
+#define SWP_TYPE(entry) (((entry) >> 1) & 0x7f)
+#define SWP_OFFSET(entry) ((entry) >> 8)
+#define SWP_ENTRY(type,offset) (((type) << 1) | ((offset) << 8))
+
+#endif /* __ASM_PROC_PAGE_H */
+
diff --git a/include/asm-arm/proc-armo/processor.h b/include/asm-arm/proc-armo/processor.h
new file mode 100644
index 000000000..0da437ff7
--- /dev/null
+++ b/include/asm-arm/proc-armo/processor.h
@@ -0,0 +1,118 @@
+/*
+ * linux/include/asm-arm/proc-armo/processor.h
+ *
+ * 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
+ */
+#ifndef __ASM_PROC_PROCESSOR_H
+#define __ASM_PROC_PROCESSOR_H
+
+#ifdef __KERNEL__
+
+#include <asm/assembler.h>
+#include <linux/string.h>
+
+#define KERNEL_STACK_SIZE 4096
+
+/*
+ * on arm2,3 wp does not work
+ */
+#define wp_works_ok 0
+#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
+
+struct context_save_struct {
+ unsigned long r4;
+ unsigned long r5;
+ unsigned long r6;
+ unsigned long r7;
+ unsigned long r8;
+ unsigned long r9;
+ unsigned long fp;
+ unsigned long pc;
+};
+
+typedef struct {
+ void (*put_byte)(void); /* Special calling convention */
+ void (*get_byte)(void); /* Special calling convention */
+ void (*put_half)(void); /* Special calling convention */
+ void (*get_half)(void); /* Special calling convention */
+ void (*put_word)(void); /* Special calling convention */
+ void (*get_word)(void); /* Special calling convention */
+ unsigned long (*copy_from_user)(void *to, const void *from, unsigned long sz);
+ unsigned long (*copy_to_user)(void *to, const void *from, unsigned long sz);
+ unsigned long (*clear_user)(void *addr, unsigned long sz);
+ unsigned long (*strncpy_from_user)(char *to, const char *from, unsigned long sz);
+ unsigned long (*strlen_user)(const char *s);
+} uaccess_t;
+
+extern uaccess_t uaccess_user, uaccess_kernel;
+
+#define EXTRA_THREAD_STRUCT \
+ uaccess_t *uaccess; /* User access functions*/ \
+ struct context_save_struct *save; \
+ unsigned long memmap; \
+ unsigned long memcmap[256];
+
+#define EXTRA_THREAD_STRUCT_INIT \
+ &uaccess_kernel, \
+ 0, \
+ (unsigned long) swapper_pg_dir, \
+ { 0, }
+
+DECLARE_THREAD_STRUCT;
+
+/*
+ * Return saved PC of a blocked thread.
+ */
+extern __inline__ unsigned long thread_saved_pc (struct thread_struct *t)
+{
+ if (t->save)
+ return t->save->pc & ~PCMASK;
+ else
+ return 0;
+}
+
+extern __inline__ unsigned long get_css_fp (struct thread_struct *t)
+{
+ if (t->save)
+ return t->save->fp;
+ else
+ return 0;
+}
+
+asmlinkage void ret_from_sys_call(void) __asm__("ret_from_sys_call");
+
+extern __inline__ void copy_thread_css (struct context_save_struct *save)
+{
+ save->r4 =
+ save->r5 =
+ save->r6 =
+ save->r7 =
+ save->r8 =
+ save->r9 =
+ save->fp = 0;
+ save->pc = ((unsigned long)ret_from_sys_call) | SVC26_MODE;
+}
+
+#define start_thread(regs,pc,sp) \
+({ \
+ unsigned long *stack = (unsigned long *)sp; \
+ set_fs(USER_DS); \
+ memzero(regs->uregs, sizeof (regs->uregs)); \
+ regs->ARM_pc = pc; /* pc */ \
+ regs->ARM_sp = sp; /* sp */ \
+ regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
+ regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
+ regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
+ flush_tlb_mm(current->mm); \
+})
+
+#endif
+
+#endif
diff --git a/include/asm-arm/proc-armo/ptrace.h b/include/asm-arm/proc-armo/ptrace.h
new file mode 100644
index 000000000..6468fb549
--- /dev/null
+++ b/include/asm-arm/proc-armo/ptrace.h
@@ -0,0 +1,65 @@
+/*
+ * linux/include/asm-arm/proc-armo/ptrace.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_PTRACE_H
+#define __ASM_PROC_PTRACE_H
+
+/* this struct defines the way the registers are stored on the
+ stack during a system call. */
+
+struct pt_regs {
+ long uregs[17];
+};
+
+#define ARM_pc uregs[15]
+#define ARM_lr uregs[14]
+#define ARM_sp uregs[13]
+#define ARM_ip uregs[12]
+#define ARM_fp uregs[11]
+#define ARM_r10 uregs[10]
+#define ARM_r9 uregs[9]
+#define ARM_r8 uregs[8]
+#define ARM_r7 uregs[7]
+#define ARM_r6 uregs[6]
+#define ARM_r5 uregs[5]
+#define ARM_r4 uregs[4]
+#define ARM_r3 uregs[3]
+#define ARM_r2 uregs[2]
+#define ARM_r1 uregs[1]
+#define ARM_r0 uregs[0]
+#define ARM_ORIG_r0 uregs[16] /* -1 */
+
+#define USR26_MODE 0x00
+#define FIQ26_MODE 0x01
+#define IRQ26_MODE 0x02
+#define SVC26_MODE 0x03
+#define MODE_MASK 0x03
+#define F_BIT (1 << 26)
+#define I_BIT (1 << 27)
+#define CC_V_BIT (1 << 28)
+#define CC_C_BIT (1 << 29)
+#define CC_Z_BIT (1 << 30)
+#define CC_N_BIT (1 << 31)
+
+#define user_mode(regs) \
+ (((regs)->ARM_pc & MODE_MASK) == USR26_MODE)
+
+#define processor_mode(regs) \
+ ((regs)->ARM_pc & MODE_MASK)
+
+#define interrupts_enabled(regs) \
+ (!((regs)->ARM_pc & I_BIT))
+
+#define fast_interrupts_enabled(regs) \
+ (!((regs)->ARM_pc & F_BIT))
+
+#define condition_codes(regs) \
+ ((regs)->ARM_pc & (CC_V_BIT|CC_C_BIT|CC_Z_BIT|CC_N_BIT))
+
+#define instruction_pointer(regs) ((regs)->ARM_pc & 0x03fffffc)
+#define pc_pointer(v) ((v) & 0x03fffffc)
+#endif
+
diff --git a/include/asm-arm/proc-armo/semaphore.h b/include/asm-arm/proc-armo/semaphore.h
new file mode 100644
index 000000000..483803217
--- /dev/null
+++ b/include/asm-arm/proc-armo/semaphore.h
@@ -0,0 +1,83 @@
+/*
+ * linux/include/asm-arm/proc-armo/semaphore.h
+ */
+#ifndef __ASM_PROC_SEMAPHORE_H
+#define __ASM_PROC_SEMAPHORE_H
+
+/*
+ * This is ugly, but we want the default case to fall through.
+ * "__down" is the actual routine that waits...
+ */
+extern inline void down(struct semaphore * sem)
+{
+ __asm__ __volatile__ ("
+ @ atomic down operation
+ mov r0, pc
+ orr r1, r0, #0x08000000
+ and r0, r0, #0x0c000003
+ teqp r1, #0
+ ldr r1, [%0]
+ subs r1, r1, #1
+ str r1, [%0]
+ mov r1, pc, lsr #28
+ teqp r0, r1, lsl #28
+ movmi r0, %0
+ blmi " SYMBOL_NAME_STR(__down)
+ : : "r" (sem) : "r0", "r1", "r2", "r3", "ip", "lr", "cc");
+}
+
+/*
+ * This is ugly, but we want the default case to fall through.
+ * "__down_interruptible" is the actual routine that waits...
+ */
+extern inline int down_interruptible (struct semaphore * sem)
+{
+ int result;
+ __asm__ __volatile__ ("
+ @ atomic down operation
+ mov r0, pc
+ orr r1, r0, #0x08000000
+ and r0, r0, #0x0c000003
+ teqp r1, #0
+ ldr r1, [%1]
+ subs r1, r1, #1
+ str r1, [%1]
+ mov r1, pc, lsr #28
+ orrmi r0, r0, #0x80000000 @ set N
+ teqp r0, r1, lsl #28
+ movmi r0, %1
+ movpl r0, #0
+ blmi " SYMBOL_NAME_STR(__down_interruptible) "
+ mov %0, r0"
+ : "=r" (result)
+ : "r" (sem)
+ : "r0", "r1", "r2", "r3", "ip", "lr", "cc");
+ return result;
+}
+
+/*
+ * Note! This is subtle. We jump to wake people up only if
+ * the semaphore was negative (== somebody was waiting on it).
+ * The default case (no contention) will result in NO
+ * jumps for both down() and up().
+ */
+extern inline void up(struct semaphore * sem)
+{
+ __asm__ __volatile__ ("
+ @ atomic up operation
+ mov r0, pc
+ orr r1, r0, #0x08000000
+ and r0, r0, #0x0c000003
+ teqp r1, #0
+ ldr r1, [%0]
+ adds r1, r1, #1
+ str r1, [%0]
+ mov r1, pc, lsr #28
+ orrls r0, r0, #0x80000000 @ set N
+ teqp r0, r1, lsl #28
+ movmi r0, %0
+ blmi " SYMBOL_NAME_STR(__up)
+ : : "r" (sem) : "r0", "r1", "r2", "r3", "ip", "lr", "cc");
+}
+
+#endif
diff --git a/include/asm-arm/proc-armo/shmparam.h b/include/asm-arm/proc-armo/shmparam.h
new file mode 100644
index 000000000..e61096091
--- /dev/null
+++ b/include/asm-arm/proc-armo/shmparam.h
@@ -0,0 +1,18 @@
+/*
+ * linux/include/asm-arm/proc-armo/shmparam.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * definitions for the shared process memory on the ARM3
+ */
+
+#ifndef __ASM_PROC_SHMPARAM_H
+#define __ASM_PROC_SHMPARAM_H
+
+#ifndef SHM_RANGE_START
+#define SHM_RANGE_START 0x00a00000
+#define SHM_RANGE_END 0x00c00000
+#define SHMMAX 0x003fa000
+#endif
+
+#endif
diff --git a/include/asm-arm/proc-armo/system.h b/include/asm-arm/proc-armo/system.h
new file mode 100644
index 000000000..a1c2d01cb
--- /dev/null
+++ b/include/asm-arm/proc-armo/system.h
@@ -0,0 +1,124 @@
+/*
+ * linux/include/asm-arm/proc-armo/system.h
+ *
+ * Copyright (C) 1995, 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_SYSTEM_H
+#define __ASM_PROC_SYSTEM_H
+
+extern const char xchg_str[];
+
+#include <asm/proc-fns.h>
+
+extern __inline__ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
+{
+ switch (size) {
+ case 1: return processor.u.armv2._xchg_1(x, ptr);
+ case 2: return processor.u.armv2._xchg_2(x, ptr);
+ case 4: return processor.u.armv2._xchg_4(x, ptr);
+ default: arm_invalidptr(xchg_str, size);
+ }
+}
+
+/*
+ * We need to turn the caches off before calling the reset vector - RiscOS
+ * messes up if we don't
+ */
+#define proc_hard_reset() processor._proc_fin()
+
+/*
+ * This processor does not idle
+ */
+#define proc_idle()
+
+/*
+ * A couple of speedups for the ARM
+ */
+
+/*
+ * Save the current interrupt enable state & disable IRQs
+ */
+#define __save_flags_cli(x) \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc\n" \
+" orr %1, %0, #0x08000000\n" \
+" and %0, %0, #0x0c000000\n" \
+" teqp %1, #0\n" \
+ : "=r" (x), "=r" (temp) \
+ : \
+ : "memory"); \
+ } while (0)
+
+/*
+ * Enable IRQs
+ */
+#define __sti() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc\n" \
+" bic %0, %0, #0x08000000\n" \
+" teqp %0, #0\n" \
+ : "=r" (temp) \
+ : \
+ : "memory"); \
+ } while(0)
+
+/*
+ * Disable IRQs
+ */
+#define __cli() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc\n" \
+" orr %0, %0, #0x08000000\n" \
+" teqp %0, #0\n" \
+ : "=r" (temp) \
+ : \
+ : "memory"); \
+ } while(0)
+
+/*
+ * save current IRQ & FIQ state
+ */
+#define __save_flags(x) \
+ do { \
+ __asm__ __volatile__( \
+" mov %0, pc\n" \
+" and %0, %0, #0x0c000000\n" \
+ : "=r" (x)); \
+ } while (0)
+
+/*
+ * restore saved IRQ & FIQ state
+ */
+#define __restore_flags(x) \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+" mov %0, pc\n" \
+" bic %0, %0, #0x0c000000\n" \
+" orr %0, %0, %1\n" \
+" teqp %0, #0\n" \
+ : "=r" (temp) \
+ : "r" (x) \
+ : "memory"); \
+ } while (0)
+
+#ifdef __SMP__
+#error SMP not supported
+#else
+
+#define cli() __cli()
+#define sti() __sti()
+#define save_flags(x) __save_flags(x)
+#define restore_flags(x) __restore_flags(x)
+#define save_flags_cli(x) __save_flags_cli(x)
+
+#endif
+
+#endif
diff --git a/include/asm-arm/proc-armo/uaccess.h b/include/asm-arm/proc-armo/uaccess.h
new file mode 100644
index 000000000..8d5745aed
--- /dev/null
+++ b/include/asm-arm/proc-armo/uaccess.h
@@ -0,0 +1,140 @@
+/*
+ * linux/include/asm-arm/proc-armo/segment.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+/*
+ * The fs functions are implemented on the ARM2 and ARM3 architectures
+ * manually.
+ * Use *_user functions to access user memory with faulting behaving
+ * as though the user is accessing the memory.
+ * Use set_fs(get_ds()) and then the *_user functions to allow them to
+ * access kernel memory.
+ */
+
+/*
+ * These are the values used to represent the user `fs' and the kernel `ds'
+ */
+#define KERNEL_DS 0x03000000
+#define USER_DS 0x02000000
+
+#define get_ds() (KERNEL_DS)
+#define get_fs() (current->addr_limit)
+#define segment_eq(a,b) ((a) == (b))
+
+extern uaccess_t uaccess_user, uaccess_kernel;
+
+extern __inline__ void set_fs (mm_segment_t fs)
+{
+ current->addr_limit = fs;
+ current->tss.uaccess = fs == USER_DS ? &uaccess_user : &uaccess_kernel;
+}
+
+#define __range_ok(addr,size) ({ \
+ unsigned long flag, sum; \
+ __asm__ __volatile__("adds %1, %2, %3; cmpls %1, %0; movls %0, #0" \
+ : "=&r" (flag), "=&r" (sum) \
+ : "r" (addr), "Ir" (size), "0" (current->addr_limit) \
+ : "cc"); \
+ flag; })
+
+#define __addr_ok(addr) ({ \
+ unsigned long flag; \
+ __asm__ __volatile__("cmp %2, %0; movlo %0, #0" \
+ : "=&r" (flag) \
+ : "0" (current->addr_limit), "r" (addr) \
+ : "cc"); \
+ (flag == 0); })
+
+#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
+
+#define __put_user_asm_byte(x,addr,err) \
+ __asm__ __volatile__( \
+ " mov r0, %1\n" \
+ " mov r1, %2\n" \
+ " mov r2, %0\n" \
+ " mov lr, pc\n" \
+ " mov pc, %3\n" \
+ " mov %0, r2\n" \
+ : "=r" (err) \
+ : "r" (x), "r" (addr), "r" (current->tss.uaccess->put_byte), \
+ "0" (err) \
+ : "r0", "r1", "r2", "lr")
+
+#define __put_user_asm_half(x,addr,err) \
+ __asm__ __volatile__( \
+ " mov r0, %1\n" \
+ " mov r1, %2\n" \
+ " mov r2, %0\n" \
+ " mov lr, pc\n" \
+ " mov pc, %3\n" \
+ " mov %0, r2\n" \
+ : "=r" (err) \
+ : "r" (x), "r" (addr), "r" (current->tss.uaccess->put_half), \
+ "0" (err) \
+ : "r0", "r1", "r2", "lr")
+
+#define __put_user_asm_word(x,addr,err) \
+ __asm__ __volatile__( \
+ " mov r0, %1\n" \
+ " mov r1, %2\n" \
+ " mov r2, %0\n" \
+ " mov lr, pc\n" \
+ " mov pc, %3\n" \
+ " mov %0, r2\n" \
+ : "=r" (err) \
+ : "r" (x), "r" (addr), "r" (current->tss.uaccess->put_word), \
+ "0" (err) \
+ : "r0", "r1", "r2", "lr")
+
+#define __get_user_asm_byte(x,addr,err) \
+ __asm__ __volatile__( \
+ " mov r0, %2\n" \
+ " mov r1, %0\n" \
+ " mov lr, pc\n" \
+ " mov pc, %3\n" \
+ " mov %0, r1\n" \
+ " mov %1, r0\n" \
+ : "=r" (err), "=r" (x) \
+ : "r" (addr), "r" (current->tss.uaccess->get_byte), "0" (err) \
+ : "r0", "r1", "r2", "lr")
+
+#define __get_user_asm_half(x,addr,err) \
+ __asm__ __volatile__( \
+ " mov r0, %2\n" \
+ " mov r1, %0\n" \
+ " mov lr, pc\n" \
+ " mov pc, %3\n" \
+ " mov %0, r1\n" \
+ " mov %1, r0\n" \
+ : "=r" (err), "=r" (x) \
+ : "r" (addr), "r" (current->tss.uaccess->get_half), "0" (err) \
+ : "r0", "r1", "r2", "lr")
+
+#define __get_user_asm_word(x,addr,err) \
+ __asm__ __volatile__( \
+ " mov r0, %2\n" \
+ " mov r1, %0\n" \
+ " mov lr, pc\n" \
+ " mov pc, %3\n" \
+ " mov %0, r1\n" \
+ " mov %1, r0\n" \
+ : "=r" (err), "=r" (x) \
+ : "r" (addr), "r" (current->tss.uaccess->get_word), "0" (err) \
+ : "r0", "r1", "r2", "lr")
+
+#define __do_copy_from_user(to,from,n) \
+ (n) = current->tss.uaccess->copy_from_user((to),(from),(n))
+
+#define __do_copy_to_user(to,from,n) \
+ (n) = current->tss.uaccess->copy_to_user((to),(from),(n))
+
+#define __do_clear_user(addr,sz) \
+ (sz) = current->tss.uaccess->clear_user((addr),(sz))
+
+#define __do_strncpy_from_user(dst,src,count,res) \
+ (res) = current->tss.uaccess->strncpy_from_user(dst,src,count)
+
+#define __do_strlen_user(s,res) \
+ (res) = current->tss.uaccess->strlen_user(s)
diff --git a/include/asm-arm/proc-armo/uncompress.h b/include/asm-arm/proc-armo/uncompress.h
new file mode 100644
index 000000000..b4edb06f7
--- /dev/null
+++ b/include/asm-arm/proc-armo/uncompress.h
@@ -0,0 +1,7 @@
+/*
+ * linux/include/asm-arm/proc-armo/uncompress.h
+ *
+ * (c) 1997 Russell King
+ */
+
+#define proc_decomp_setup()
diff --git a/include/asm-arm/proc-armv/assembler.h b/include/asm-arm/proc-armv/assembler.h
new file mode 100644
index 000000000..2294981c3
--- /dev/null
+++ b/include/asm-arm/proc-armv/assembler.h
@@ -0,0 +1,84 @@
+/*
+ * linux/asm-arm/proc-armv/assembler.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * This file contains arm architecture specific defines
+ * for the different processors
+ */
+
+/*
+ * LOADREGS: multiple register load (ldm) with pc in register list
+ * (takes account of ARM6 not using ^)
+ *
+ * RETINSTR: return instruction: adds the 's' in at the end of the
+ * instruction if this is not an ARM6
+ *
+ * SAVEIRQS: save IRQ state (not required on ARM2/ARM3 - done
+ * implicitly
+ *
+ * RESTOREIRQS: restore IRQ state (not required on ARM2/ARM3 - done
+ * implicitly with ldm ... ^ or movs.
+ *
+ * These next two need thinking about - can't easily use stack... (see system.S)
+ * DISABLEIRQS: disable IRQS in SVC mode
+ *
+ * ENABLEIRQS: enable IRQS in SVC mode
+ *
+ * USERMODE: switch to USER mode
+ *
+ * SVCMODE: switch to SVC mode
+ */
+
+#define N_BIT (1 << 31)
+#define Z_BIT (1 << 30)
+#define C_BIT (1 << 29)
+#define V_BIT (1 << 28)
+
+#define PCMASK 0
+
+#ifdef __ASSEMBLER__
+
+#define I_BIT (1 << 7)
+#define F_BIT (1 << 6)
+
+#define MODE_FIQ26 0x01
+#define MODE_FIQ32 0x11
+
+#define DEFAULT_FIQ MODE_FIQ32
+
+#define LOADREGS(cond, base, reglist...)\
+ ldm##cond base,reglist
+
+#define RETINSTR(instr, regs...)\
+ instr regs
+
+#define MODENOP
+
+#define MODE(savereg,tmpreg,mode) \
+ mrs savereg, cpsr; \
+ bic tmpreg, savereg, $0x1f; \
+ orr tmpreg, tmpreg, $mode; \
+ msr cpsr, tmpreg
+
+#define RESTOREMODE(savereg) \
+ msr cpsr, savereg
+
+#define SAVEIRQS(tmpreg)\
+ mrs tmpreg, cpsr; \
+ str tmpreg, [sp, $-4]!
+
+#define RESTOREIRQS(tmpreg)\
+ ldr tmpreg, [sp], $4; \
+ msr cpsr, tmpreg
+
+#define DISABLEIRQS(tmpreg)\
+ mrs tmpreg , cpsr; \
+ orr tmpreg , tmpreg , $I_BIT; \
+ msr cpsr, tmpreg
+
+#define ENABLEIRQS(tmpreg)\
+ mrs tmpreg , cpsr; \
+ bic tmpreg , tmpreg , $I_BIT; \
+ msr cpsr, tmpreg
+#endif
diff --git a/include/asm-arm/proc-armv/mm-init.h b/include/asm-arm/proc-armv/mm-init.h
new file mode 100644
index 000000000..0ffb05a16
--- /dev/null
+++ b/include/asm-arm/proc-armv/mm-init.h
@@ -0,0 +1,118 @@
+/*
+ * linux/include/asm-arm/proc-armv/mm-init.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * This contains the code to setup the memory map on an ARM v3 or v4 machine.
+ * This is both processor & architecture specific, and requires some
+ * more work to get it to fit into our separate processor and architecture
+ * structure.
+ */
+
+/*
+ * On ebsa, we want the memory map set up so:
+ *
+ * PHYS VIRT
+ * 00000000 00000000 Zero page
+ * 000003ff 000003ff Zero page end
+ * 00000000 c0000000 Kernel and all physical memory
+ * 01ffffff c1ffffff End of physical (32MB)
+ * e0000000 e0000000 IO start
+ * ffffffff ffffffff IO end
+ *
+ * On rpc, we want:
+ *
+ * PHYS VIRT
+ * 10000000 00000000 Zero page
+ * 100003ff 000003ff Zero page end
+ * 10000000 c0000000 Kernel and all physical memory
+ * 1fffffff cfffffff End of physical (32MB)
+ * 02000000 d?000000 Screen memory (first image)
+ * 02000000 d8000000 Screen memory (second image)
+ * 00000000 df000000 StrongARM cache invalidation area
+ * 03000000 e0000000 IO start
+ * 03ffffff e0ffffff IO end
+ *
+ * We set it up using the section page table entries.
+ */
+
+#include <asm/arch/mmap.h>
+#include <asm/pgtable.h>
+
+#define V2P(x) virt_to_phys(x)
+#define PTE_SIZE (PTRS_PER_PTE * 4)
+
+#define PMD_SECT (PMD_TYPE_SECT | PMD_DOMAIN(DOMAIN_KERNEL) | PMD_SECT_CACHEABLE)
+
+static inline void setup_swapper_dir (int index, unsigned long entry)
+{
+ pmd_t pmd;
+
+ pmd_val(pmd) = entry;
+ set_pmd (pmd_offset (swapper_pg_dir + index, 0), pmd);
+}
+
+static inline unsigned long setup_pagetables(unsigned long start_mem, unsigned long end_mem)
+{
+ unsigned long address;
+ unsigned int spi;
+ union { unsigned long l; unsigned long *p; } u;
+
+ /* map in zero page */
+ u.l = ((start_mem + (PTE_SIZE-1)) & ~(PTE_SIZE-1));
+ start_mem = u.l + PTE_SIZE;
+ memzero (u.p, PTE_SIZE);
+ *u.p = V2P(PAGE_OFFSET) | PTE_CACHEABLE | PTE_TYPE_SMALL;
+ setup_swapper_dir (0, V2P(u.l) | PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_USER));
+
+ for (spi = 1; spi < (PAGE_OFFSET >> PGDIR_SHIFT); spi++)
+ pgd_val(swapper_pg_dir[spi]) = 0;
+
+ /* map in physical ram & kernel */
+ address = PAGE_OFFSET;
+ while (spi < end_mem >> PGDIR_SHIFT) {
+ setup_swapper_dir (spi++,
+ V2P(address) | PMD_SECT |
+ PMD_SECT_BUFFERABLE | PMD_SECT_AP_WRITE);
+ address += PGDIR_SIZE;
+ }
+ while (spi < PTRS_PER_PGD)
+ pgd_val(swapper_pg_dir[spi++]) = 0;
+
+ /*
+ * An area to invalidate the cache
+ */
+ setup_swapper_dir (0xdf0, SAFE_ADDR | PMD_SECT | PMD_SECT_AP_READ);
+
+ /* map in IO */
+ address = IO_START;
+ spi = IO_BASE >> PGDIR_SHIFT;
+ pgd_val(swapper_pg_dir[spi-1]) = 0xc0000000 | PMD_TYPE_SECT |
+ PMD_DOMAIN(DOMAIN_KERNEL) | PMD_SECT_AP_WRITE;
+ while (address < IO_START + IO_SIZE && address) {
+ pgd_val(swapper_pg_dir[spi++]) = address |
+ PMD_TYPE_SECT | PMD_DOMAIN(DOMAIN_IO) |
+ PMD_SECT_AP_WRITE;
+ address += PGDIR_SIZE;
+ }
+
+#ifdef HAVE_MAP_VID_MEM
+ map_screen_mem(0, 0, 0);
+#endif
+
+ flush_cache_all();
+ return start_mem;
+}
+
+static inline void mark_usable_memory_areas(unsigned long *start_mem, unsigned long end_mem)
+{
+ unsigned long smem;
+
+ *start_mem = smem = PAGE_ALIGN(*start_mem);
+
+ while (smem < end_mem) {
+ clear_bit(PG_reserved, &mem_map[MAP_NR(smem)].flags);
+ smem += PAGE_SIZE;
+ }
+}
+
diff --git a/include/asm-arm/proc-armv/page.h b/include/asm-arm/proc-armv/page.h
new file mode 100644
index 000000000..fd8768939
--- /dev/null
+++ b/include/asm-arm/proc-armv/page.h
@@ -0,0 +1,68 @@
+/*
+ * linux/include/asm-arm/proc-armv/page.h
+ *
+ * Copyright (C) 1995, 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_PAGE_H
+#define __ASM_PROC_PAGE_H
+
+/* PAGE_SHIFT determines the page size */
+#define PAGE_SHIFT 12
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
+#define PAGE_MASK (~(PAGE_SIZE-1))
+
+#ifdef __KERNEL__
+
+#define STRICT_MM_TYPECHECKS
+
+#ifdef STRICT_MM_TYPECHECKS
+/*
+ * These are used to make use of C type-checking..
+ */
+typedef struct { unsigned long pte; } pte_t;
+typedef struct { unsigned long pmd; } pmd_t;
+typedef struct { unsigned long pgd; } pgd_t;
+typedef struct { unsigned long pgprot; } pgprot_t;
+
+#define pte_val(x) ((x).pte)
+#define pmd_val(x) ((x).pmd)
+#define pgd_val(x) ((x).pgd)
+#define pgprot_val(x) ((x).pgprot)
+
+#define __pte(x) ((pte_t) { (x) } )
+#define __pmd(x) ((pmd_t) { (x) } )
+#define __pgd(x) ((pgd_t) { (x) } )
+#define __pgprot(x) ((pgprot_t) { (x) } )
+
+#else
+/*
+ * .. while these make it easier on the compiler
+ */
+typedef unsigned long pte_t;
+typedef unsigned long pmd_t;
+typedef unsigned long pgd_t;
+typedef unsigned long pgprot_t;
+
+#define pte_val(x) (x)
+#define pmd_val(x) (x)
+#define pgd_val(x) (x)
+#define pgprot_val(x) (x)
+
+#define __pte(x) (x)
+#define __pmd(x) (x)
+#define __pgd(x) (x)
+#define __pgprot(x) (x)
+
+#endif
+
+/* to align the pointer to the (next) page boundary */
+#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
+
+/* This handles the memory map.. */
+#define PAGE_OFFSET 0xc0000000
+#define MAP_NR(addr) (((unsigned long)(addr) - PAGE_OFFSET) >> PAGE_SHIFT)
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_PROC_PAGE_H */
diff --git a/include/asm-arm/proc-armv/param.h b/include/asm-arm/proc-armv/param.h
new file mode 100644
index 000000000..fa22ce2d3
--- /dev/null
+++ b/include/asm-arm/proc-armv/param.h
@@ -0,0 +1,27 @@
+/*
+ * linux/include/asm-arm/proc-armv/param.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_PARAM_H
+#define __ASM_PROC_PARAM_H
+
+#ifndef HZ
+#define HZ 100
+#endif
+
+#define EXEC_PAGESIZE 4096
+
+#ifndef NGROUPS
+#define NGROUPS 32
+#endif
+
+#ifndef NOGROUP
+#define NOGROUP (-1)
+#endif
+
+#define MAXHOSTNAMELEN 64 /* max length of hostname */
+
+#endif
+
diff --git a/include/asm-arm/proc-armv/pgtable.h b/include/asm-arm/proc-armv/pgtable.h
new file mode 100644
index 000000000..5816b2698
--- /dev/null
+++ b/include/asm-arm/proc-armv/pgtable.h
@@ -0,0 +1,617 @@
+/*
+ * linux/include/asm-arm/proc-armv/pgtable.h
+ *
+ * Copyright (C) 1995, 1996, 1997 Russell King
+ *
+ * 12-01-1997 RMK Altered flushing routines to use function pointers
+ * now possible to combine ARM6, ARM7 and StrongARM versions.
+ */
+#ifndef __ASM_PROC_PGTABLE_H
+#define __ASM_PROC_PGTABLE_H
+
+#include <asm/arch/mmu.h>
+
+#define LIBRARY_TEXT_START 0x0c000000
+
+/*
+ * Cache flushing...
+ */
+#define flush_cache_all() \
+ processor.u.armv3v4._flush_cache_all()
+
+#define flush_cache_mm(_mm) \
+ do { \
+ if ((_mm) == current->mm) \
+ processor.u.armv3v4._flush_cache_all(); \
+ } while (0)
+
+#define flush_cache_range(_mm,_start,_end) \
+ do { \
+ if ((_mm) == current->mm) \
+ processor.u.armv3v4._flush_cache_area \
+ ((_start), (_end), 1); \
+ } while (0)
+
+#define flush_cache_page(_vma,_vmaddr) \
+ do { \
+ if ((_vma)->vm_mm == current->mm) \
+ processor.u.armv3v4._flush_cache_area \
+ ((_vmaddr), (_vmaddr) + PAGE_SIZE, \
+ ((_vma)->vm_flags & VM_EXEC) ? 1 : 0); \
+ } while (0)
+
+#define flush_icache_range(_start,_end) \
+ processor.u.armv3v4._flush_icache_area((_start), (_end))
+
+/*
+ * We don't have a mem map cache...
+ */
+#define update_mm_cache_all() do { } while (0)
+#define update_mm_cache_task(tsk) do { } while (0)
+#define update_mm_cache_mm(mm) do { } while (0)
+#define update_mm_cache_mm_addr(mm,addr,pte) do { } while (0)
+
+/*
+ * This flushes back any buffered write data. We have to clean and flush the entries
+ * in the cache for this page. Is it necessary to invalidate the I-cache?
+ */
+#define flush_page_to_ram(_page) \
+ processor.u.armv3v4._flush_ram_page ((_page) & PAGE_MASK);
+
+/*
+ * Make the page uncacheable (must flush page beforehand).
+ */
+#define uncache_page(_page) \
+ processor.u.armv3v4._flush_ram_page ((_page) & PAGE_MASK);
+
+/*
+ * TLB flushing:
+ *
+ * - flush_tlb() flushes the current mm struct TLBs
+ * - 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
+ *
+ * GCC uses conditional instructions, and expects the assembler code to do so as well.
+ *
+ * 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() flush_tlb_all()
+
+#define flush_tlb_all() \
+ processor.u.armv3v4._flush_tlb_all()
+
+#define flush_tlb_mm(_mm) \
+ do { \
+ if ((_mm) == current->mm) \
+ processor.u.armv3v4._flush_tlb_all(); \
+ } while (0)
+
+#define flush_tlb_range(_mm,_start,_end) \
+ do { \
+ if ((_mm) == current->mm) \
+ processor.u.armv3v4._flush_tlb_area \
+ ((_start), (_end), 1); \
+ } while (0)
+
+#define flush_tlb_page(_vma,_vmaddr) \
+ do { \
+ if ((_vma)->vm_mm == current->mm) \
+ processor.u.armv3v4._flush_tlb_area \
+ ((_vmaddr), (_vmaddr) + PAGE_SIZE, \
+ ((_vma)->vm_flags & VM_EXEC) ? 1 : 0); \
+ } while (0)
+
+/*
+ * Since the page tables are in cached memory, we need to flush the dirty
+ * data cached entries back before we flush the tlb... This is also useful
+ * to flush out the SWI instruction for signal handlers...
+ */
+#define __flush_entry_to_ram(entry) \
+ processor.u.armv3v4._flush_cache_entry((unsigned long)(entry))
+
+#define __flush_pte_to_ram(entry) \
+ processor.u.armv3v4._flush_cache_pte((unsigned long)(entry))
+
+/* PMD_SHIFT determines the size of the area a second-level page table can map */
+#define PMD_SHIFT 20
+#define PMD_SIZE (1UL << PMD_SHIFT)
+#define PMD_MASK (~(PMD_SIZE-1))
+
+/* PGDIR_SHIFT determines what a third-level page table entry can map */
+#define PGDIR_SHIFT 20
+#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
+#define PGDIR_MASK (~(PGDIR_SIZE-1))
+
+/*
+ * entries per page directory level: the sa110 is two-level, so
+ * we don't really have any PMD directory physically.
+ */
+#define PTRS_PER_PTE 256
+#define PTRS_PER_PMD 1
+#define PTRS_PER_PGD 4096
+
+/* 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))
+
+/* PMD types (actually level 1 descriptor) */
+#define PMD_TYPE_MASK 0x0003
+#define PMD_TYPE_FAULT 0x0000
+#define PMD_TYPE_TABLE 0x0001
+#define PMD_TYPE_SECT 0x0002
+#define PMD_UPDATABLE 0x0010
+#define PMD_SECT_CACHEABLE 0x0008
+#define PMD_SECT_BUFFERABLE 0x0004
+#define PMD_SECT_AP_WRITE 0x0400
+#define PMD_SECT_AP_READ 0x0800
+#define PMD_DOMAIN(x) ((x) << 5)
+
+/* PTE types (actially level 2 descriptor) */
+#define PTE_TYPE_MASK 0x0003
+#define PTE_TYPE_FAULT 0x0000
+#define PTE_TYPE_LARGE 0x0001
+#define PTE_TYPE_SMALL 0x0002
+#define PTE_AP_READ 0x0aa0
+#define PTE_AP_WRITE 0x0550
+#define PTE_CACHEABLE 0x0008
+#define PTE_BUFFERABLE 0x0004
+
+/* Domains */
+#define DOMAIN_USER 0
+#define DOMAIN_KERNEL 1
+#define DOMAIN_TABLE 1
+#define DOMAIN_IO 2
+
+#define _PAGE_CHG_MASK (0xfffff00c | PTE_TYPE_MASK)
+
+/*
+ * We define the bits in the page tables as follows:
+ * PTE_BUFFERABLE page is dirty
+ * PTE_AP_WRITE page is writable
+ * PTE_AP_READ page is a young (unsetting this causes faults for any access)
+ *
+ * Any page that is mapped in is assumed to be readable...
+ */
+#define PAGE_NONE __pgprot(PTE_TYPE_SMALL)
+#define PAGE_SHARED __pgprot(PTE_TYPE_SMALL | PTE_CACHEABLE | PTE_AP_READ | PTE_AP_WRITE)
+#define PAGE_COPY __pgprot(PTE_TYPE_SMALL | PTE_CACHEABLE | PTE_AP_READ)
+#define PAGE_READONLY __pgprot(PTE_TYPE_SMALL | PTE_CACHEABLE | PTE_AP_READ)
+#define PAGE_KERNEL __pgprot(PTE_TYPE_SMALL | PTE_CACHEABLE | PTE_BUFFERABLE | PTE_AP_WRITE)
+
+#define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_USER))
+#define _PAGE_KERNEL_TABLE (PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_KERNEL))
+
+/*
+ * The arm can't do page protection for execute, and considers that the same are read.
+ * Also, write permissions imply read permissions. This is the closest we can get..
+ */
+#define __P000 PAGE_NONE
+#define __P001 PAGE_READONLY
+#define __P010 PAGE_COPY
+#define __P011 PAGE_COPY
+#define __P100 PAGE_READONLY
+#define __P101 PAGE_READONLY
+#define __P110 PAGE_COPY
+#define __P111 PAGE_COPY
+
+#define __S000 PAGE_NONE
+#define __S001 PAGE_READONLY
+#define __S010 PAGE_SHARED
+#define __S011 PAGE_SHARED
+#define __S100 PAGE_READONLY
+#define __S101 PAGE_READONLY
+#define __S110 PAGE_SHARED
+#define __S111 PAGE_SHARED
+
+#undef TEST_VERIFY_AREA
+
+/*
+ * BAD_PAGETABLE is used when we need a bogus page-table, while
+ * BAD_PAGE is used for a bogus page.
+ *
+ * ZERO_PAGE is a global shared page that is always zero: used
+ * for zero-mapped memory areas etc..
+ */
+extern pte_t __bad_page(void);
+extern pte_t * __bad_pagetable(void);
+extern unsigned long *empty_zero_page;
+
+#define BAD_PAGETABLE __bad_pagetable()
+#define BAD_PAGE __bad_page()
+#define ZERO_PAGE ((unsigned long) empty_zero_page)
+
+/* number of bits that fit into a memory pointer */
+#define BYTES_PER_PTR (sizeof(unsigned long))
+#define BITS_PER_PTR (8*BYTES_PER_PTR)
+
+/* to align the pointer to a pointer address */
+#define PTR_MASK (~(sizeof(void*)-1))
+
+/* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
+#define SIZEOF_PTR_LOG2 2
+
+/* to find an entry in a page-table */
+#define PAGE_PTR(address) \
+((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
+
+/* to set the page-dir */
+#define SET_PAGE_DIR(tsk,pgdir) \
+do { \
+ tsk->tss.memmap = __virt_to_phys(pgdir); \
+ if ((tsk) == current) \
+ __asm__ __volatile__( \
+ "mcr%? p15, 0, %0, c2, c0, 0\n" \
+ : : "r" (tsk->tss.memmap)); \
+} while (0)
+
+extern __inline__ int pte_none(pte_t pte)
+{
+ return !pte_val(pte);
+}
+
+#define pte_clear(ptep) set_pte(ptep, __pte(0))
+
+extern __inline__ int pte_present(pte_t pte)
+{
+ switch (pte_val(pte) & PTE_TYPE_MASK) {
+ case PTE_TYPE_LARGE:
+ case PTE_TYPE_SMALL:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+extern __inline__ int pmd_none(pmd_t pmd)
+{
+ return !pmd_val(pmd);
+}
+
+#define pmd_clear(pmdp) set_pmd(pmdp, __pmd(0))
+
+extern __inline__ int pmd_bad(pmd_t pmd)
+{
+ switch (pmd_val(pmd) & PMD_TYPE_MASK) {
+ case PMD_TYPE_FAULT:
+ case PMD_TYPE_TABLE:
+ return 0;
+ default:
+ return 1;
+ }
+}
+
+extern __inline__ int pmd_present(pmd_t pmd)
+{
+ switch (pmd_val(pmd) & PMD_TYPE_MASK) {
+ case PMD_TYPE_TABLE:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+/*
+ * The "pgd_xxx()" functions here are trivial for a folded two-level
+ * setup: the pgd is never bad, and a pmd always exists (as it's folded
+ * into the pgd entry)
+ */
+#define pgd_none(pgd) (0)
+#define pgd_bad(pgd) (0)
+#define pgd_present(pgd) (1)
+#define pgd_clear(pgdp)
+
+/*
+ * The following only work if pte_present() is true.
+ * Undefined behaviour if not..
+ */
+#define pte_read(pte) (1)
+#define pte_exec(pte) (1)
+
+extern __inline__ int pte_write(pte_t pte)
+{
+ return pte_val(pte) & PTE_AP_WRITE;
+}
+
+extern __inline__ int pte_cacheable(pte_t pte)
+{
+ return pte_val(pte) & PTE_CACHEABLE;
+}
+
+extern __inline__ int pte_dirty(pte_t pte)
+{
+ return pte_val(pte) & PTE_BUFFERABLE;
+}
+
+extern __inline__ int pte_young(pte_t pte)
+{
+ return pte_val(pte) & PTE_AP_READ;
+}
+
+extern __inline__ pte_t pte_wrprotect(pte_t pte)
+{
+ pte_val(pte) &= ~PTE_AP_WRITE;
+ return pte;
+}
+
+extern __inline__ pte_t pte_nocache(pte_t pte)
+{
+ pte_val(pte) &= ~PTE_CACHEABLE;
+ return pte;
+}
+
+extern __inline__ pte_t pte_mkclean(pte_t pte)
+{
+ pte_val(pte) &= ~PTE_BUFFERABLE;
+ return pte;
+}
+
+extern __inline__ pte_t pte_mkold(pte_t pte)
+{
+ pte_val(pte) &= ~PTE_AP_READ;
+ return pte;
+}
+
+extern __inline__ pte_t pte_mkwrite(pte_t pte)
+{
+ pte_val(pte) |= PTE_AP_WRITE;
+ return pte;
+}
+
+extern __inline__ pte_t pte_mkdirty(pte_t pte)
+{
+ pte_val(pte) |= PTE_BUFFERABLE;
+ return pte;
+}
+
+extern __inline__ pte_t pte_mkyoung(pte_t pte)
+{
+ pte_val(pte) |= PTE_AP_READ;
+ return pte;
+}
+
+/*
+ * The following are unable to be implemented on this MMU
+ */
+#if 0
+extern __inline__ pte_t pte_rdprotect(pte_t pte)
+{
+ pte_val(pte) &= ~(PTE_CACHEABLE|PTE_AP_READ);
+ return pte;
+}
+
+extern __inline__ pte_t pte_exprotect(pte_t pte)
+{
+ pte_val(pte) &= ~(PTE_CACHEABLE|PTE_AP_READ);
+ return pte;
+}
+
+extern __inline__ pte_t pte_mkread(pte_t pte)
+{
+ pte_val(pte) |= PTE_CACHEABLE;
+ return pte;
+}
+
+extern __inline__ pte_t pte_mkexec(pte_t pte)
+{
+ pte_val(pte) |= PTE_CACHEABLE;
+ return pte;
+}
+#endif
+
+/*
+ * Conversion functions: convert a page and protection to a page entry,
+ * and a page entry and page directory to the page they refer to.
+ */
+extern __inline__ pte_t mk_pte(unsigned long page, pgprot_t pgprot)
+{
+ pte_t pte;
+ pte_val(pte) = __virt_to_phys(page) | pgprot_val(pgprot);
+ return pte;
+}
+
+/* This takes a physical page address that is used by the remapping functions */
+extern __inline__ pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
+{
+ pte_t pte;
+ pte_val(pte) = physpage + pgprot_val(pgprot);
+ return pte;
+}
+
+extern __inline__ pte_t pte_modify(pte_t pte, pgprot_t newprot)
+{
+ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot);
+ return pte;
+}
+
+extern __inline__ void set_pte(pte_t *pteptr, pte_t pteval)
+{
+ *pteptr = pteval;
+ __flush_pte_to_ram(pteptr);
+}
+
+extern __inline__ unsigned long pte_page(pte_t pte)
+{
+ return (unsigned long)phys_to_virt(pte_val(pte) & PAGE_MASK);
+}
+
+extern __inline__ pmd_t mk_user_pmd(pte_t *ptep)
+{
+ pmd_t pmd;
+ pmd_val(pmd) = __virt_to_phys((unsigned long)ptep) | _PAGE_USER_TABLE;
+ return pmd;
+}
+
+extern __inline__ pmd_t mk_kernel_pmd(pte_t *ptep)
+{
+ pmd_t pmd;
+ pmd_val(pmd) = __virt_to_phys((unsigned long)ptep) | _PAGE_KERNEL_TABLE;
+ return pmd;
+}
+
+#if 1
+#define set_pmd(pmdp,pmd) processor.u.armv3v4._set_pmd(pmdp,pmd)
+#else
+extern __inline__ void set_pmd(pmd_t *pmdp, pmd_t pmd)
+{
+ *pmdp = pmd;
+ __flush_pte_to_ram(pmdp);
+}
+#endif
+
+extern __inline__ unsigned long pmd_page(pmd_t pmd)
+{
+ return (unsigned long)phys_to_virt(pmd_val(pmd) & 0xfffffc00);
+}
+
+/* to find an entry in a kernel page-table-directory */
+#define pgd_offset_k(address) pgd_offset(&init_mm, address)
+
+/* to find an entry in a page-table-directory */
+extern __inline__ pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address)
+{
+ return mm->pgd + (address >> PGDIR_SHIFT);
+}
+
+/* Find an entry in the second-level page table.. */
+#define pmd_offset(dir, address) ((pmd_t *)(dir))
+
+/* Find an entry in the third-level page table.. */
+extern __inline__ pte_t * pte_offset(pmd_t * dir, unsigned long address)
+{
+ return (pte_t *) pmd_page(*dir) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
+}
+
+extern unsigned long get_small_page(int priority);
+extern void free_small_page(unsigned long page);
+
+/*
+ * Allocate and free page tables. The xxx_kernel() versions are
+ * used to allocate a kernel page table - this turns on ASN bits
+ * if any.
+ */
+extern __inline__ void pte_free_kernel(pte_t * pte)
+{
+ free_small_page((unsigned long) pte);
+}
+
+extern const char bad_pmd_string[];
+
+extern __inline__ pte_t * pte_alloc_kernel(pmd_t *pmd, unsigned long address)
+{
+ address = (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
+ if (pmd_none(*pmd)) {
+ pte_t *page = (pte_t *) get_small_page(GFP_KERNEL);
+ if (pmd_none(*pmd)) {
+ if (page) {
+ memzero (page, PTRS_PER_PTE * BYTES_PER_PTR);
+ set_pmd(pmd, mk_kernel_pmd(page));
+ return page + address;
+ }
+ set_pmd(pmd, mk_kernel_pmd(BAD_PAGETABLE));
+ return NULL;
+ }
+ free_small_page((unsigned long) page);
+ }
+ if (pmd_bad(*pmd)) {
+ printk(bad_pmd_string, pmd_val(*pmd));
+ set_pmd(pmd, mk_kernel_pmd(BAD_PAGETABLE));
+ return NULL;
+ }
+ return (pte_t *) pmd_page(*pmd) + address;
+}
+
+/*
+ * allocating and freeing a pmd is trivial: the 1-entry pmd is
+ * inside the pgd, so has no extra memory associated with it.
+ */
+#define pmd_free_kernel(pmdp) pmd_val(*(pmdp)) = 0;
+#define pmd_alloc_kernel(pgdp, address) ((pmd_t *)(pgdp))
+
+extern __inline__ void pte_free(pte_t * pte)
+{
+ free_small_page((unsigned long) pte);
+}
+
+extern __inline__ pte_t * pte_alloc(pmd_t * pmd, unsigned long address)
+{
+ address = (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
+
+ if (pmd_none(*pmd)) {
+ pte_t *page = (pte_t *) get_small_page(GFP_KERNEL);
+ if (pmd_none(*pmd)) {
+ if (page) {
+ memzero (page, PTRS_PER_PTE * BYTES_PER_PTR);
+ set_pmd(pmd, mk_user_pmd(page));
+ return page + address;
+ }
+ set_pmd(pmd, mk_user_pmd(BAD_PAGETABLE));
+ return NULL;
+ }
+ free_small_page ((unsigned long) page);
+ }
+ if (pmd_bad(*pmd)) {
+ printk(bad_pmd_string, pmd_val(*pmd));
+ set_pmd(pmd, mk_user_pmd(BAD_PAGETABLE));
+ return NULL;
+ }
+ return (pte_t *) pmd_page(*pmd) + address;
+}
+
+/*
+ * allocating and freeing a pmd is trivial: the 1-entry pmd is
+ * inside the pgd, so has no extra memory associated with it.
+ */
+#define pmd_free(pmdp) pmd_val(*(pmdp)) = 0;
+#define pmd_alloc(pgdp, address) ((pmd_t *)(pgdp))
+
+/*
+ * Free a page directory. Takes the virtual address.
+ */
+extern __inline__ void pgd_free(pgd_t * pgd)
+{
+ free_pages((unsigned long) pgd, 2);
+}
+
+/*
+ * Allocate a new page directory. Return the virtual address of it.
+ */
+extern __inline__ pgd_t * pgd_alloc(void)
+{
+ unsigned long pgd;
+
+ /*
+ * need to get a 16k page for level 1
+ */
+ pgd = __get_free_pages(GFP_KERNEL,2,0);
+ if (pgd)
+ memzero ((void *)pgd, PTRS_PER_PGD * BYTES_PER_PTR);
+ return (pgd_t *)pgd;
+}
+
+extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
+
+/*
+ * The sa110 doesn't have any external MMU info: the kernel page
+ * tables contain all the necessary information.
+ */
+extern __inline__ void update_mmu_cache(struct vm_area_struct * vma,
+ unsigned long address, pte_t pte)
+{
+}
+
+#define SWP_TYPE(entry) (((entry) >> 2) & 0x7f)
+#define SWP_OFFSET(entry) ((entry) >> 9)
+#define SWP_ENTRY(type,offset) (((type) << 2) | ((offset) << 9))
+
+#endif /* __ASM_PROC_PAGE_H */
+
diff --git a/include/asm-arm/proc-armv/processor.h b/include/asm-arm/proc-armv/processor.h
new file mode 100644
index 000000000..cc2be2ceb
--- /dev/null
+++ b/include/asm-arm/proc-armv/processor.h
@@ -0,0 +1,103 @@
+/*
+ * linux/include/asm-arm/proc-armv/processor.h
+ *
+ * Copyright (c) 1996 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
+ */
+#ifndef __ASM_PROC_PROCESSOR_H
+#define __ASM_PROC_PROCESSOR_H
+
+#ifdef __KERNEL__
+
+#define KERNEL_STACK_SIZE PAGE_SIZE
+
+/*
+ * on arm2,3 wp does not work
+ */
+#define wp_works_ok 0
+#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
+
+struct context_save_struct {
+ unsigned long cpsr;
+ unsigned long r4;
+ unsigned long r5;
+ unsigned long r6;
+ unsigned long r7;
+ unsigned long r8;
+ unsigned long r9;
+ unsigned long fp;
+ unsigned long pc;
+};
+
+#define EXTRA_THREAD_STRUCT \
+ struct context_save_struct *save; \
+ unsigned long memmap;
+
+#define EXTRA_THREAD_STRUCT_INIT \
+ 0, \
+ ((unsigned long) swapper_pg_dir) - PAGE_OFFSET
+
+DECLARE_THREAD_STRUCT;
+
+/*
+ * Return saved PC of a blocked thread.
+ */
+extern __inline__ unsigned long thread_saved_pc (struct thread_struct *t)
+{
+ if (t->save)
+ return t->save->pc;
+ else
+ return 0;
+}
+
+extern __inline__ unsigned long get_css_fp (struct thread_struct *t)
+{
+ if (t->save)
+ return t->save->fp;
+ else
+ return 0;
+}
+
+asmlinkage void ret_from_sys_call(void) __asm__ ("ret_from_sys_call");
+
+extern __inline__ void copy_thread_css (struct context_save_struct *save)
+{
+ save->cpsr = SVC_MODE;
+ save->r4 =
+ save->r5 =
+ save->r6 =
+ save->r7 =
+ save->r8 =
+ save->r9 =
+ save->fp = 0;
+ save->pc = (unsigned long) ret_from_sys_call;
+}
+
+#define start_thread(regs,pc,sp) \
+({ \
+ unsigned long *stack = (unsigned long *)sp; \
+ set_fs(USER_DS); \
+ memzero(regs->uregs, sizeof(regs->uregs)); \
+ regs->ARM_cpsr = sp <= 0x04000000 ? USR26_MODE : USR_MODE; \
+ regs->ARM_pc = pc; /* pc */ \
+ regs->ARM_sp = sp; /* sp */ \
+ regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
+ regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
+ regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
+})
+
+/* Allocation and freeing of basic task resources. */
+/*
+ * NOTE! The task struct and the stack go together
+ */
+#define alloc_task_struct() \
+ ((struct task_struct *) __get_free_pages(GFP_KERNEL,1,0))
+#define free_task_struct(p) free_pages((unsigned long)(p),1)
+
+#endif
+
+#endif
diff --git a/include/asm-arm/proc-armv/ptrace.h b/include/asm-arm/proc-armv/ptrace.h
new file mode 100644
index 000000000..42a56433f
--- /dev/null
+++ b/include/asm-arm/proc-armv/ptrace.h
@@ -0,0 +1,75 @@
+/*
+ * linux/include/asm-arm/proc-armv/ptrace.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_PTRACE_H
+#define __ASM_PROC_PTRACE_H
+
+/* this struct defines the way the registers are stored on the
+ stack during a system call. */
+
+struct pt_regs {
+ long uregs[18];
+};
+
+#define ARM_cpsr uregs[16]
+#define ARM_pc uregs[15]
+#define ARM_lr uregs[14]
+#define ARM_sp uregs[13]
+#define ARM_ip uregs[12]
+#define ARM_fp uregs[11]
+#define ARM_r10 uregs[10]
+#define ARM_r9 uregs[9]
+#define ARM_r8 uregs[8]
+#define ARM_r7 uregs[7]
+#define ARM_r6 uregs[6]
+#define ARM_r5 uregs[5]
+#define ARM_r4 uregs[4]
+#define ARM_r3 uregs[3]
+#define ARM_r2 uregs[2]
+#define ARM_r1 uregs[1]
+#define ARM_r0 uregs[0]
+#define ARM_ORIG_r0 uregs[17] /* -1 */
+
+#define USR26_MODE 0x00
+#define FIQ26_MODE 0x01
+#define IRQ26_MODE 0x02
+#define SVC26_MODE 0x03
+#define USR_MODE 0x10
+#define FIQ_MODE 0x11
+#define IRQ_MODE 0x12
+#define SVC_MODE 0x13
+#define ABT_MODE 0x17
+#define UND_MODE 0x1b
+#define SYSTEM_MODE 0x1f
+#define MODE_MASK 0x1f
+#define F_BIT 0x40
+#define I_BIT 0x80
+#define CC_V_BIT (1 << 28)
+#define CC_C_BIT (1 << 29)
+#define CC_Z_BIT (1 << 30)
+#define CC_N_BIT (1 << 31)
+
+#define user_mode(regs) \
+ ((((regs)->ARM_cpsr & MODE_MASK) == USR_MODE) || \
+ (((regs)->ARM_cpsr & MODE_MASK) == USR26_MODE))
+
+#define processor_mode(regs) \
+ ((regs)->ARM_cpsr & MODE_MASK)
+
+#define interrupts_enabled(regs) \
+ (!((regs)->ARM_cpsr & I_BIT))
+
+#define fast_interrupts_enabled(regs) \
+ (!((regs)->ARM_cpsr & F_BIT))
+
+#define condition_codes(regs) \
+ ((regs)->ARM_cpsr & (CC_V_BIT|CC_C_BIT|CC_Z_BIT|CC_N_BIT))
+
+#define instruction_pointer(regs) ((regs)->ARM_pc)
+#define pc_pointer(v) (v)
+
+#endif
+
diff --git a/include/asm-arm/proc-armv/semaphore.h b/include/asm-arm/proc-armv/semaphore.h
new file mode 100644
index 000000000..fb1ad746f
--- /dev/null
+++ b/include/asm-arm/proc-armv/semaphore.h
@@ -0,0 +1,81 @@
+/*
+ * linux/include/asm-arm/semaphore.h
+ */
+#ifndef __ASM_PROC_SEMAPHORE_H
+#define __ASM_PROC_SEMAPHORE_H
+
+/*
+ * This is ugly, but we want the default case to fall through.
+ * "__down" is the actual routine that waits...
+ */
+extern inline void down(struct semaphore * sem)
+{
+ __asm__ __volatile__ ("
+ @ atomic down operation
+ mrs r0, cpsr
+ orr r1, r0, #128 @ disable IRQs
+ bic r0, r0, #0x80000000 @ clear N
+ msr cpsr, r1
+ ldr r1, [%0]
+ subs r1, r1, #1
+ str r1, [%0]
+ orrmi r0, r0, #0x80000000 @ set N
+ msr cpsr, r0
+ movmi r0, %0
+ blmi " SYMBOL_NAME_STR(__down)
+ : : "r" (sem) : "r0", "r1", "r2", "r3", "ip", "lr", "cc");
+}
+
+/*
+ * This is ugly, but we want the default case to fall through.
+ * "__down_interruptible" is the actual routine that waits...
+ */
+extern inline int down_interruptible (struct semaphore * sem)
+{
+ int result;
+ __asm__ __volatile__ ("
+ @ atomic down operation
+ mrs r0, cpsr
+ orr r1, r0, #128 @ disable IRQs
+ bic r0, r0, #0x80000000 @ clear N
+ msr cpsr, r1
+ ldr r1, [%1]
+ subs r1, r1, #1
+ str r1, [%1]
+ orrmi r0, r0, #0x80000000 @ set N
+ msr cpsr, r0
+ movmi r0, %1
+ movpl r0, #0
+ blmi " SYMBOL_NAME_STR(__down_interruptible) "
+ mov %0, r0"
+ : "=r" (result)
+ : "r" (sem)
+ : "r0", "r1", "r2", "r3", "ip", "lr", "cc");
+ return result;
+}
+
+/*
+ * Note! This is subtle. We jump to wake people up only if
+ * the semaphore was negative (== somebody was waiting on it).
+ * The default case (no contention) will result in NO
+ * jumps for both down() and up().
+ */
+extern inline void up(struct semaphore * sem)
+{
+ __asm__ __volatile__ ("
+ @ atomic up operation
+ mrs r0, cpsr
+ orr r1, r0, #128 @ disable IRQs
+ bic r0, r0, #0x80000000 @ clear N
+ msr cpsr, r1
+ ldr r1, [%0]
+ adds r1, r1, #1
+ str r1, [%0]
+ orrls r0, r0, #0x80000000 @ set N
+ msr cpsr, r0
+ movmi r0, %0
+ blmi " SYMBOL_NAME_STR(__up)
+ : : "r" (sem) : "r0", "r1", "r2", "r3", "ip", "lr", "cc");
+}
+
+#endif
diff --git a/include/asm-arm/proc-armv/shmparam.h b/include/asm-arm/proc-armv/shmparam.h
new file mode 100644
index 000000000..10e280b6d
--- /dev/null
+++ b/include/asm-arm/proc-armv/shmparam.h
@@ -0,0 +1,19 @@
+/*
+ * linux/include/asm-arm/proc-armv/shmparam.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * definitions for the shared process memory on ARM v3 or v4
+ * processors
+ */
+
+#ifndef __ASM_PROC_SHMPARAM_H
+#define __ASM_PROC_SHMPARAM_H
+
+#ifndef SHM_RANGE_START
+#define SHM_RANGE_START 0x50000000
+#define SHM_RANGE_END 0x60000000
+#define SHMMAX 0x01000000
+#endif
+
+#endif
diff --git a/include/asm-arm/proc-armv/system.h b/include/asm-arm/proc-armv/system.h
new file mode 100644
index 000000000..6a1f38de0
--- /dev/null
+++ b/include/asm-arm/proc-armv/system.h
@@ -0,0 +1,137 @@
+/*
+ * linux/include/asm-arm/proc-armv/system.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_SYSTEM_H
+#define __ASM_PROC_SYSTEM_H
+
+extern const char xchg_str[];
+
+extern __inline__ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
+{
+ switch (size) {
+ case 1: __asm__ __volatile__ ("swpb %0, %1, [%2]" : "=r" (x) : "r" (x), "r" (ptr) : "memory");
+ break;
+ case 2: abort ();
+ case 4: __asm__ __volatile__ ("swp %0, %1, [%2]" : "=r" (x) : "r" (x), "r" (ptr) : "memory");
+ break;
+ default: arm_invalidptr(xchg_str, size);
+ }
+ return x;
+}
+
+/*
+ * This processor does not need anything special before reset,
+ * but RPC may do...
+ */
+extern __inline__ void proc_hard_reset(void)
+{
+}
+
+/*
+ * We can wait for an interrupt...
+ */
+#if 0
+#define proc_idle() \
+ do { \
+ __asm__ __volatile__( \
+" mcr p15, 0, %0, c15, c8, 2" \
+ : : "r" (0)); \
+ } while (0)
+#else
+#define proc_idle()
+#endif
+/*
+ * A couple of speedups for the ARM
+ */
+
+/*
+ * Save the current interrupt enable state & disable IRQs
+ */
+#define __save_flags_cli(x) \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "mrs %1, cpsr\n" \
+" and %0, %1, #192\n" \
+" orr %1, %1, #128\n" \
+" msr cpsr, %1" \
+ : "=r" (x), "=r" (temp) \
+ : \
+ : "memory"); \
+ } while (0)
+
+/*
+ * Enable IRQs
+ */
+#define __sti() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "mrs %0, cpsr\n" \
+" bic %0, %0, #128\n" \
+" msr cpsr, %0" \
+ : "=r" (temp) \
+ : \
+ : "memory"); \
+ } while(0)
+
+/*
+ * Disable IRQs
+ */
+#define __cli() \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "mrs %0, cpsr\n" \
+" orr %0, %0, #128\n" \
+" msr cpsr, %0" \
+ : "=r" (temp) \
+ : \
+ : "memory"); \
+ } while(0)
+
+/*
+ * save current IRQ & FIQ state
+ */
+#define __save_flags(x) \
+ do { \
+ __asm__ __volatile__( \
+ "mrs %0, cpsr\n" \
+" and %0, %0, #192" \
+ : "=r" (x) \
+ : \
+ : "memory"); \
+ } while (0)
+
+/*
+ * restore saved IRQ & FIQ state
+ */
+#define __restore_flags(x) \
+ do { \
+ unsigned long temp; \
+ __asm__ __volatile__( \
+ "mrs %0, cpsr\n" \
+" bic %0, %0, #192\n" \
+" orr %0, %0, %1\n" \
+" msr cpsr, %0" \
+ : "=r" (temp) \
+ : "r" (x) \
+ : "memory"); \
+ } while (0)
+
+#ifdef __SMP__
+#error SMP not supported
+#else
+
+#define cli() __cli()
+#define sti() __sti()
+#define save_flags(x) __save_flags(x)
+#define restore_flags(x) __restore_flags(x)
+#define save_flags_cli(x) __save_flags_cli(x)
+
+#endif
+
+#endif
diff --git a/include/asm-arm/proc-armv/uaccess.h b/include/asm-arm/proc-armv/uaccess.h
new file mode 100644
index 000000000..acadb35a3
--- /dev/null
+++ b/include/asm-arm/proc-armv/uaccess.h
@@ -0,0 +1,204 @@
+/*
+ * linux/include/asm-arm/proc-armv/uaccess.h
+ */
+
+/*
+ * The fs functions are implemented on the ARMV3 and V4 architectures
+ * using the domain register.
+ *
+ * DOMAIN_IO - domain 2 includes all IO only
+ * DOMAIN_KERNEL - domain 1 includes all kernel memory only
+ * DOMAIN_USER - domain 0 includes all user memory only
+ */
+
+#define DOMAIN_CLIENT 1
+#define DOMAIN_MANAGER 3
+
+#define DOMAIN_USER_CLIENT ((DOMAIN_CLIENT) << 0)
+#define DOMAIN_USER_MANAGER ((DOMAIN_MANAGER) << 0)
+
+#define DOMAIN_KERNEL_CLIENT ((DOMAIN_CLIENT) << 2)
+#define DOMAIN_KERNEL_MANAGER ((DOMAIN_MANAGER) << 2)
+
+#define DOMAIN_IO_CLIENT ((DOMAIN_CLIENT) << 4)
+#define DOMAIN_IO_MANAGER ((DOMAIN_MANAGER) << 4)
+
+/*
+ * When we want to access kernel memory in the *_user functions,
+ * we change the domain register to KERNEL_DS, thus allowing
+ * unrestricted access
+ */
+#define KERNEL_DOMAIN (DOMAIN_USER_CLIENT | DOMAIN_KERNEL_MANAGER | DOMAIN_IO_CLIENT)
+#define USER_DOMAIN (DOMAIN_USER_CLIENT | DOMAIN_KERNEL_CLIENT | DOMAIN_IO_CLIENT)
+
+/*
+ * Note that this is actually 0x1,0000,0000
+ */
+#define KERNEL_DS 0x00000000
+#define USER_DS 0xc0000000
+
+#define get_ds() (KERNEL_DS)
+#define get_fs() (current->addr_limit)
+
+#define segment_eq(a,b) ((a) == (b))
+
+extern __inline__ void set_fs (mm_segment_t fs)
+{
+ current->addr_limit = fs;
+
+ __asm__ __volatile__("mcr p15, 0, %0, c3, c0" :
+ : "r" (fs ? USER_DOMAIN : KERNEL_DOMAIN));
+}
+
+/*
+ * a + s <= 2^32 -> C = 0 || Z = 0 (LS)
+ * (a + s) <= l -> C = 0 || Z = 0 (LS)
+ */
+#define __range_ok(addr,size) ({ \
+ unsigned long flag, sum; \
+ __asm__ __volatile__("adds %1, %2, %3; cmpls %1, %0; movls %0, #0" \
+ : "=&r" (flag), "=&r" (sum) \
+ : "r" (addr), "Ir" (size), "0" (current->addr_limit) \
+ : "cc"); \
+ flag; })
+
+#define __addr_ok(addr) ({ \
+ unsigned long flag; \
+ __asm__ __volatile__("cmp %2, %0; movlo %0, #0" \
+ : "=&r" (flag) \
+ : "0" (current->addr_limit), "r" (addr) \
+ : "cc"); \
+ (flag == 0); })
+
+#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
+
+#define __put_user_asm_byte(x,addr,err) \
+ __asm__ __volatile__( \
+ "1: strbt %1,[%2],#0\n" \
+ "2:\n" \
+ " .section .fixup,\"ax\"\n" \
+ " .align 2\n" \
+ "3: mvn %0, %3\n" \
+ " b 2b\n" \
+ " .previous\n" \
+ " .section __ex_table,\"a\"\n" \
+ " .align 3\n" \
+ " .long 1b, 3b\n" \
+ " .previous" \
+ : "=r" (err) \
+ : "r" (x), "r" (addr), "i" (EFAULT), "0" (err))
+
+#define __put_user_asm_half(x,addr,err) \
+({ \
+ unsigned long __temp = (unsigned long)(x); \
+ __asm__ __volatile__( \
+ "1: strbt %1,[%3],#0\n" \
+ "2: strbt %2,[%4],#0\n" \
+ "3:\n" \
+ " .section .fixup,\"ax\"\n" \
+ " .align 2\n" \
+ "4: mvn %0, %5\n" \
+ " b 3b\n" \
+ " .previous\n" \
+ " .section __ex_table,\"a\"\n" \
+ " .align 3\n" \
+ " .long 1b, 4b\n" \
+ " .long 2b, 4b\n" \
+ " .previous" \
+ : "=r" (err) \
+ : "r" (__temp), "r" (__temp >> 8), \
+ "r" (addr), "r" ((int)(addr) + 1), \
+ "i" (EFAULT), "0" (err)); \
+})
+
+#define __put_user_asm_word(x,addr,err) \
+ __asm__ __volatile__( \
+ "1: strt %1,[%2],#0\n" \
+ "2:\n" \
+ " .section .fixup,\"ax\"\n" \
+ " .align 2\n" \
+ "3: mvn %0, %3\n" \
+ " b 2b\n" \
+ " .previous\n" \
+ " .section __ex_table,\"a\"\n" \
+ " .align 3\n" \
+ " .long 1b, 3b\n" \
+ " .previous" \
+ : "=r" (err) \
+ : "r" (x), "r" (addr), "i" (EFAULT), "0" (err))
+
+#define __get_user_asm_byte(x,addr,err) \
+ __asm__ __volatile__( \
+ "1: ldrbt %1,[%2],#0\n" \
+ "2:\n" \
+ " .section .fixup,\"ax\"\n" \
+ " .align 2\n" \
+ "3: mvn %0, %3\n" \
+ " b 2b\n" \
+ " .previous\n" \
+ " .section __ex_table,\"a\"\n" \
+ " .align 3\n" \
+ " .long 1b, 3b\n" \
+ " .previous" \
+ : "=r" (err), "=r" (x) \
+ : "r" (addr), "i" (EFAULT), "0" (err))
+
+#define __get_user_asm_half(x,addr,err) \
+({ \
+ unsigned long __temp; \
+ __asm__ __volatile__( \
+ "1: ldrbt %1,[%3],#0\n" \
+ "2: ldrbt %2,[%4],#0\n" \
+ " orr %1, %1, %2, lsl #8\n" \
+ "3:\n" \
+ " .section .fixup,\"ax\"\n" \
+ " .align 2\n" \
+ "4: mvn %0, %5\n" \
+ " b 3b\n" \
+ " .previous\n" \
+ " .section __ex_table,\"a\"\n" \
+ " .align 3\n" \
+ " .long 1b, 4b\n" \
+ " .long 2b, 4b\n" \
+ " .previous" \
+ : "=r" (err), "=r" (x), "=&r" (__temp) \
+ : "r" (addr), "r" ((int)(addr) + 1), \
+ "i" (EFAULT), "0" (err)); \
+})
+
+
+#define __get_user_asm_word(x,addr,err) \
+ __asm__ __volatile__( \
+ "1: ldrt %1,[%2],#0\n" \
+ "2:\n" \
+ " .section .fixup,\"ax\"\n" \
+ " .align 2\n" \
+ "3: mvn %0, %3\n" \
+ " b 2b\n" \
+ " .previous\n" \
+ " .section __ex_table,\"a\"\n" \
+ " .align 3\n" \
+ " .long 1b, 3b\n" \
+ " .previous" \
+ : "=r" (err), "=r" (x) \
+ : "r" (addr), "i" (EFAULT), "0" (err))
+
+extern unsigned long __arch_copy_from_user(void *to, const void *from, unsigned long n);
+#define __do_copy_from_user(to,from,n) \
+ (n) = __arch_copy_from_user(to,from,n)
+
+extern unsigned long __arch_copy_to_user(void *to, const void *from, unsigned long n);
+#define __do_copy_to_user(to,from,n) \
+ (n) = __arch_copy_to_user(to,from,n)
+
+extern unsigned long __arch_clear_user(void *addr, unsigned long n);
+#define __do_clear_user(addr,sz) \
+ (sz) = __arch_clear_user(addr,sz)
+
+extern unsigned long __arch_strncpy_from_user(char *to, const char *from, unsigned long count);
+#define __do_strncpy_from_user(dst,src,count,res) \
+ (res) = __arch_strncpy_from_user(dst,src,count)
+
+extern unsigned long __arch_strlen_user(const char *s);
+#define __do_strlen_user(s,res) \
+ (res) = __arch_strlen_user(s)
diff --git a/include/asm-arm/proc-armv/uncompress.h b/include/asm-arm/proc-armv/uncompress.h
new file mode 100644
index 000000000..acce2de35
--- /dev/null
+++ b/include/asm-arm/proc-armv/uncompress.h
@@ -0,0 +1,22 @@
+/*
+ * linux/include/asm-arm/proc-armv/uncompress.h
+ *
+ * (c) 1997 Russell King
+ */
+
+static inline void proc_decomp_setup (void)
+{
+ __asm__ __volatile__("
+ mrc p15, 0, r0, c0, c0
+ eor r0, r0, #0x44 << 24
+ eor r0, r0, #0x01 << 16
+ eor r0, r0, #0xA1 << 8
+ movs r0, r0, lsr #4
+ mcreq p15, 0, r0, c7, c5, 0 @ flush I cache
+ mrceq p15, 0, r0, c1, c0
+ orreq r0, r0, #1 << 12
+ mcreq p15, 0, r0, c1, c0 @ enable I cache
+ mov r0, #0
+ mcreq p15, 0, r0, c15, c1, 2 @ enable clock switching
+ " : : : "r0", "cc", "memory");
+}
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h
new file mode 100644
index 000000000..4f8a48d06
--- /dev/null
+++ b/include/asm-arm/proc-fns.h
@@ -0,0 +1,111 @@
+/*
+ * linux/include/asm-arm/proc-fns.h
+ *
+ * Copyright (C) 1997 Russell King
+ */
+#ifndef __ASM_PROCFNS_H
+#define __ASM_PROCFNS_H
+
+#include <asm/page.h>
+
+#ifdef __KERNEL__
+/*
+ * Don't change this structure
+ */
+extern struct processor {
+ const char *name;
+ /* MISC
+ *
+ * flush caches for task switch
+ */
+ void (*_switch_to)(void *prev, void *next);
+ /*
+ * get data abort address/flags
+ */
+ void (*_data_abort)(unsigned long pc);
+ /*
+ * check for any bugs
+ */
+ void (*_check_bugs)(void);
+ /*
+ * Set up any processor specifics
+ */
+ void (*_proc_init)(void);
+ /*
+ * Disable any processor specifics
+ */
+ void (*_proc_fin)(void);
+ /*
+ * Processor architecture specific
+ */
+ union {
+ struct {
+ /* 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);
+ /*
+ * flush a virtual address used for a page table
+ * note D-cache only!
+ */
+ void (*_flush_cache_pte)(unsigned long address);
+ /*
+ * 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 a PMD (handling IMP bit 4)
+ */
+ void (*_set_pmd)(pmd_t *pmdp, pmd_t pmd);
+ /*
+ * Special stuff for a reset
+ */
+ unsigned long (*reset)(void);
+ /*
+ * flush an icached page
+ */
+ void (*_flush_icache_area)(unsigned long start, unsigned long end);
+ } armv3v4;
+ struct {
+ /* MEMC
+ *
+ * remap memc tables
+ */
+ void (*_remap_memc)(void *tsk);
+ /*
+ * update task's idea of mmap
+ */
+ void (*_update_map)(void *tsk);
+ /*
+ * update task's idea after abort
+ */
+ void (*_update_mmu_cache)(void *vma, unsigned long addr, pte_t pte);
+ /* XCHG
+ */
+ unsigned long (*_xchg_1)(unsigned long x, volatile void *ptr);
+ unsigned long (*_xchg_2)(unsigned long x, volatile void *ptr);
+ unsigned long (*_xchg_4)(unsigned long x, volatile void *ptr);
+ } armv2;
+ } u;
+} processor;
+#endif
+#endif
+
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h
new file mode 100644
index 000000000..a75d4a960
--- /dev/null
+++ b/include/asm-arm/processor.h
@@ -0,0 +1,51 @@
+/*
+ * include/asm-arm/processor.h
+ *
+ * Copyright (C) 1995 Russell King
+ */
+
+#ifndef __ASM_ARM_PROCESSOR_H
+#define __ASM_ARM_PROCESSOR_H
+
+struct fp_hard_struct {
+ unsigned int save[140/4]; /* as yet undefined */
+};
+
+struct fp_soft_struct {
+ unsigned int save[140/4]; /* undefined information */
+};
+
+union fp_state {
+ struct fp_hard_struct hard;
+ struct fp_soft_struct soft;
+};
+
+typedef unsigned long mm_segment_t; /* domain register */
+
+#define DECLARE_THREAD_STRUCT \
+struct thread_struct { \
+ unsigned long address; /* Address of fault */ \
+ unsigned long trap_no; /* Trap number */ \
+ unsigned long error_code; /* Error code of trap */ \
+ union fp_state fpstate; /* FPE save state */ \
+ EXTRA_THREAD_STRUCT \
+}
+
+#include <asm/arch/processor.h>
+#include <asm/proc/processor.h>
+
+#define INIT_TSS { \
+ 0, \
+ 0, \
+ 0, \
+ { { { 0, }, }, }, \
+ EXTRA_THREAD_STRUCT_INIT \
+}
+
+/* Free all resources held by a thread. */
+extern void release_thread(struct task_struct *);
+
+#define init_task (init_task_union.task)
+#define init_stack (init_task_union.stack)
+
+#endif /* __ASM_ARM_PROCESSOR_H */
diff --git a/include/asm-arm/procinfo.h b/include/asm-arm/procinfo.h
new file mode 100644
index 000000000..0d8811624
--- /dev/null
+++ b/include/asm-arm/procinfo.h
@@ -0,0 +1,32 @@
+/*
+ * linux/include/asm-arm/procinfo.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROCINFO_H
+#define __ASM_PROCINFO_H
+
+#include <asm/proc-fns.h>
+
+#define F_MEMC (1<<0)
+#define F_MMU (1<<1)
+#define F_32BIT (1<<2)
+#define F_CACHE (1<<3)
+#define F_IOEB (1<<31)
+
+#ifndef __ASSEMBLER__
+
+struct armversions {
+ unsigned long id;
+ unsigned long mask;
+ unsigned long features;
+ const char *manu;
+ const char *name;
+ const struct processor *proc;
+};
+
+#endif
+
+#endif
+
diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
new file mode 100644
index 000000000..5cd91dc31
--- /dev/null
+++ b/include/asm-arm/ptrace.h
@@ -0,0 +1,11 @@
+#ifndef __ASM_ARM_PTRACE_H
+#define __ASM_ARM_PTRACE_H
+
+#include <asm/proc/ptrace.h>
+
+#ifdef __KERNEL__
+extern void show_regs(struct pt_regs *);
+#endif
+
+#endif
+
diff --git a/include/asm-arm/resource.h b/include/asm-arm/resource.h
new file mode 100644
index 000000000..85d281157
--- /dev/null
+++ b/include/asm-arm/resource.h
@@ -0,0 +1,39 @@
+#ifndef _ARM_RESOURCE_H
+#define _ARM_RESOURCE_H
+
+/*
+ * Resource limits
+ */
+
+#define RLIMIT_CPU 0 /* CPU time in ms */
+#define RLIMIT_FSIZE 1 /* Maximum filesize */
+#define RLIMIT_DATA 2 /* max data size */
+#define RLIMIT_STACK 3 /* max stack size */
+#define RLIMIT_CORE 4 /* max core file size */
+#define RLIMIT_RSS 5 /* max resident set size */
+#define RLIMIT_NPROC 6 /* max number of processes */
+#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 RLIM_NLIMITS 10
+
+#ifdef __KERNEL__
+
+#define INIT_RLIMITS \
+{ \
+ { LONG_MAX, LONG_MAX }, \
+ { LONG_MAX, LONG_MAX }, \
+ { LONG_MAX, LONG_MAX }, \
+ { _STK_LIM, _STK_LIM }, \
+ { 0, LONG_MAX }, \
+ { LONG_MAX, LONG_MAX }, \
+ { MAX_TASKS_PER_USER, MAX_TASKS_PER_USER }, \
+ { NR_OPEN, NR_OPEN }, \
+ { LONG_MAX, LONG_MAX }, \
+ { LONG_MAX, LONG_MAX }, \
+}
+
+#endif /* __KERNEL__ */
+
+#endif
diff --git a/include/asm-arm/scatterlist.h b/include/asm-arm/scatterlist.h
new file mode 100644
index 000000000..7d0175507
--- /dev/null
+++ b/include/asm-arm/scatterlist.h
@@ -0,0 +1,13 @@
+#ifndef _ASMARM_SCATTERLIST_H
+#define _ASMARM_SCATTERLIST_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;
+};
+
+#define ISA_DMA_THRESHOLD (0xffffffff)
+
+#endif /* _ASMARM_SCATTERLIST_H */
diff --git a/include/asm-arm/segment.h b/include/asm-arm/segment.h
new file mode 100644
index 000000000..9e24c21f6
--- /dev/null
+++ b/include/asm-arm/segment.h
@@ -0,0 +1,11 @@
+#ifndef __ASM_ARM_SEGMENT_H
+#define __ASM_ARM_SEGMENT_H
+
+#define __KERNEL_CS 0x0
+#define __KERNEL_DS 0x0
+
+#define __USER_CS 0x1
+#define __USER_DS 0x1
+
+#endif /* __ASM_ARM_SEGMENT_H */
+
diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h
new file mode 100644
index 000000000..3186aac19
--- /dev/null
+++ b/include/asm-arm/semaphore.h
@@ -0,0 +1,67 @@
+/*
+ * linux/include/asm-arm/semaphore.h
+ */
+#ifndef __ASM_ARM_SEMAPHORE_H
+#define __ASM_ARM_SEMAPHORE_H
+
+#include <linux/linkage.h>
+#include <asm/system.h>
+#include <asm/atomic.h>
+
+struct semaphore {
+ atomic_t count;
+ int waking;
+ struct wait_queue * wait;
+};
+
+#define MUTEX ((struct semaphore) { ATOMIC_INIT(1), 0, NULL })
+#define MUTEX_LOCKED ((struct semaphore) { ATOMIC_INIT(0), 0, NULL })
+
+asmlinkage void __down_failed (void /* special register calling convention */);
+asmlinkage int __down_failed_interruptible (void /* special register calling convention */);
+asmlinkage void __up_wakeup (void /* special register calling convention */);
+
+extern void __down(struct semaphore * sem);
+extern void __up(struct semaphore * sem);
+
+#define sema_init(sem, val) atomic_set(&((sem)->count), (val))
+
+/*
+ * These two _must_ execute atomically wrt each other.
+ *
+ * This is trivially done with load_locked/store_cond,
+ * but on the x86 we need an external synchronizer.
+ * Currently this is just the global interrupt lock,
+ * bah. Go for a smaller spinlock some day.
+ *
+ * (On the other hand this shouldn't be in any critical
+ * path, so..)
+ */
+static inline void wake_one_more(struct semaphore * sem)
+{
+ unsigned long flags;
+
+ save_flags(flags);
+ cli();
+ sem->waking++;
+ restore_flags(flags);
+}
+
+static inline int waking_non_zero(struct semaphore *sem)
+{
+ unsigned long flags;
+ int ret = 0;
+
+ save_flags(flags);
+ cli();
+ if (sem->waking > 0) {
+ sem->waking--;
+ ret = 1;
+ }
+ restore_flags(flags);
+ return ret;
+}
+
+#include <asm/proc/semaphore.h>
+
+#endif
diff --git a/include/asm-arm/serial.h b/include/asm-arm/serial.h
new file mode 100644
index 000000000..3e1513a45
--- /dev/null
+++ b/include/asm-arm/serial.h
@@ -0,0 +1,15 @@
+/*
+ * linux/include/asm-arm/serial.h
+ *
+ * Copyright (c) 1996 Russell King.
+ *
+ * Changelog:
+ * 15-10-1996 RMK Created
+ */
+
+#ifndef __ASM_SERIAL_H
+#define __ASM_SERIAL_H
+
+#include <asm/arch/serial.h>
+
+#endif
diff --git a/include/asm-arm/setup.h b/include/asm-arm/setup.h
new file mode 100644
index 000000000..07aefda05
--- /dev/null
+++ b/include/asm-arm/setup.h
@@ -0,0 +1,49 @@
+/*
+ * include/asm/setup.h
+ *
+ * Structure passed to kernel to tell it about the hardware it's running on
+ *
+ * Copyright (C) 1997,1998 Russell King
+ */
+#ifndef __ASMARM_SETUP_H
+#define __ASMARM_SETUP_H
+
+struct param_struct {
+ union {
+ struct {
+ unsigned long page_size; /* 0 */
+ unsigned long nr_pages; /* 4 */
+ unsigned long ramdisk_size; /* 8 */
+ unsigned long flags; /* 12 */
+#define FLAG_READONLY 1
+#define FLAG_RDLOAD 4
+#define FLAG_RDPROMPT 8
+ unsigned long rootdev; /* 16 */
+ unsigned long video_num_cols; /* 20 */
+ unsigned long video_num_rows; /* 24 */
+ unsigned long video_x; /* 28 */
+ unsigned long video_y; /* 32 */
+ unsigned long memc_control_reg; /* 36 */
+ unsigned char sounddefault; /* 40 */
+ unsigned char adfsdrives; /* 41 */
+ unsigned char bytes_per_char_h; /* 42 */
+ unsigned char bytes_per_char_v; /* 43 */
+ unsigned long pages_in_bank[4]; /* 44 */
+ unsigned long pages_in_vram; /* 60 */
+ unsigned long initrd_start; /* 64 */
+ unsigned long initrd_size; /* 68 */
+ unsigned long rd_start; /* 72 */
+ } s;
+ char unused[256];
+ } u1;
+ union {
+ char paths[8][128];
+ struct {
+ unsigned long magic;
+ char n[1024 - sizeof(unsigned long)];
+ } s;
+ } u2;
+ char commandline[256];
+};
+
+#endif
diff --git a/include/asm-arm/shmparam.h b/include/asm-arm/shmparam.h
new file mode 100644
index 000000000..74d2a6122
--- /dev/null
+++ b/include/asm-arm/shmparam.h
@@ -0,0 +1,47 @@
+#ifndef _ASMARM_SHMPARAM_H
+#define _ASMARM_SHMPARAM_H
+
+/*
+ * Include the machine specific shm parameters before the processor
+ * dependent parameters so that the machine parameters can override
+ * the processor parameters
+ */
+#include <asm/arch/shmparam.h>
+#include <asm/proc/shmparam.h>
+
+/*
+ * Format of a swap-entry for shared memory pages currently out in
+ * swap space (see also mm/swap.c).
+ *
+ * SWP_TYPE = SHM_SWP_TYPE
+ * SWP_OFFSET is used as follows:
+ *
+ * bits 0..6 : id of shared memory segment page belongs to (SHM_ID)
+ * bits 7..21: index of page within shared memory segment (SHM_IDX)
+ * (actually fewer bits get used since SHMMAX is so low)
+ */
+
+/*
+ * Keep _SHM_ID_BITS as low as possible since SHMMNI depends on it and
+ * there is a static array of size SHMMNI.
+ */
+#define _SHM_ID_BITS 7
+#define SHM_ID_MASK ((1<<_SHM_ID_BITS)-1)
+
+#define SHM_IDX_SHIFT (_SHM_ID_BITS)
+#define _SHM_IDX_BITS 15
+#define SHM_IDX_MASK ((1<<_SHM_IDX_BITS)-1)
+
+/*
+ * _SHM_ID_BITS + _SHM_IDX_BITS must be <= 24 on the i386 and
+ * SHMMAX <= (PAGE_SIZE << _SHM_IDX_BITS).
+ */
+
+#define SHMMIN 1 /* really PAGE_SIZE */ /* min shared seg size (bytes) */
+#define SHMMNI (1<<_SHM_ID_BITS) /* max num of segs system wide */
+#define SHMALL /* max shm system wide (pages) */ \
+ (1<<(_SHM_IDX_BITS+_SHM_ID_BITS))
+#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
+#define SHMSEG SHMMNI /* max shared segs per process */
+
+#endif /* _ASMARM_SHMPARAM_H */
diff --git a/include/asm-arm/sigcontext.h b/include/asm-arm/sigcontext.h
new file mode 100644
index 000000000..6ce49457f
--- /dev/null
+++ b/include/asm-arm/sigcontext.h
@@ -0,0 +1,33 @@
+#ifndef _ASMARM_SIGCONTEXT_H
+#define _ASMARM_SIGCONTEXT_H
+
+/*
+ * Signal context structure - contains all info to do with the state
+ * before the signal handler was invoked. Note: only add new entries
+ * to the end of the structure.
+ */
+struct sigcontext {
+ unsigned long trap_no;
+ unsigned long error_code;
+ unsigned long oldmask;
+ unsigned long arm_r0;
+ unsigned long arm_r1;
+ unsigned long arm_r2;
+ unsigned long arm_r3;
+ unsigned long arm_r4;
+ unsigned long arm_r5;
+ unsigned long arm_r6;
+ unsigned long arm_r7;
+ unsigned long arm_r8;
+ unsigned long arm_r9;
+ unsigned long arm_r10;
+ unsigned long arm_fp;
+ unsigned long arm_ip;
+ unsigned long arm_sp;
+ unsigned long arm_lr;
+ unsigned long arm_pc;
+ unsigned long arm_cpsr;
+};
+
+
+#endif
diff --git a/include/asm-arm/siginfo.h b/include/asm-arm/siginfo.h
new file mode 100644
index 000000000..b987a12eb
--- /dev/null
+++ b/include/asm-arm/siginfo.h
@@ -0,0 +1,195 @@
+#ifndef _ASMARM_SIGINFO_H
+#define _ASMARM_SIGINFO_H
+
+#include <linux/types.h>
+
+/* XXX: This structure was copied from the Alpha; is there an iBCS version? */
+
+typedef union sigval {
+ int sival_int;
+ void *sival_ptr;
+} sigval_t;
+
+#define SI_MAX_SIZE 128
+#define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct siginfo {
+ int si_signo;
+ int si_errno;
+ int si_code;
+
+ union {
+ int _pad[SI_PAD_SIZE];
+
+ /* kill() */
+ struct {
+ pid_t _pid; /* sender's pid */
+ uid_t _uid; /* sender's uid */
+ } _kill;
+
+ /* POSIX.1b timers */
+ struct {
+ unsigned int _timer1;
+ unsigned int _timer2;
+ } _timer;
+
+ /* POSIX.1b signals */
+ struct {
+ pid_t _pid; /* sender's pid */
+ uid_t _uid; /* sender's uid */
+ sigval_t _sigval;
+ } _rt;
+
+ /* SIGCHLD */
+ struct {
+ pid_t _pid; /* which child */
+ int _status; /* exit code */
+ clock_t _utime;
+ clock_t _stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+ struct {
+ void *_addr; /* faulting insn/memory ref. */
+ } _sigfault;
+
+ /* SIGPOLL */
+ struct {
+ int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ int _fd;
+ } _sigpoll;
+ } _sifields;
+} siginfo_t;
+
+/*
+ * How these fields are to be accessed.
+ */
+#define si_pid _sifields._kill._pid
+#define si_uid _sifields._kill._uid
+#define si_status _sifields._sigchld._status
+#define si_utime _sifields._sigchld._utime
+#define si_stime _sifields._sigchld._stime
+#define si_value _sifields._rt._sigval
+#define si_int _sifields._rt._sigval.sival_int
+#define si_ptr _sifields._rt._sigval.sival_ptr
+#define si_addr _sifields._sigfault._addr
+#define si_band _sifields._sigpoll._band
+#define si_fd _sifields._sigpoll._fd
+
+/*
+ * si_code values
+ * Digital reserves positive values for kernel-generated signals.
+ */
+#define SI_USER 0 /* sent by kill, sigsend, raise */
+#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
+#define SI_QUEUE -1 /* sent by sigqueue */
+#define SI_TIMER -2 /* sent by timer expiration */
+#define SI_MESGQ -3 /* sent by real time mesq state change */
+#define SI_ASYNCIO -4 /* sent by AIO completion */
+
+#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
+#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
+
+/*
+ * SIGILL si_codes
+ */
+#define ILL_ILLOPC 1 /* illegal opcode */
+#define ILL_ILLOPN 2 /* illegal operand */
+#define ILL_ILLADR 3 /* illegal addressing mode */
+#define ILL_ILLTRP 4 /* illegal trap */
+#define ILL_PRVOPC 5 /* privileged opcode */
+#define ILL_PRVREG 6 /* privileged register */
+#define ILL_COPROC 7 /* coprocessor error */
+#define ILL_BADSTK 8 /* internal stack error */
+#define NSIGILL 8
+
+/*
+ * SIGFPE si_codes
+ */
+#define FPE_INTDIV 1 /* integer divide by zero */
+#define FPE_INTOVF 2 /* integer overflow */
+#define FPE_FLTDIV 3 /* floating point divide by zero */
+#define FPE_FLTOVF 4 /* floating point overflow */
+#define FPE_FLTUND 5 /* floating point underflow */
+#define FPE_FLTRES 6 /* floating point inexact result */
+#define FPE_FLTINV 7 /* floating point invalid operation */
+#define FPE_FLTSUB 8 /* subscript out of range */
+#define NSIGFPE 8
+
+/*
+ * SIGSEGV si_codes
+ */
+#define SEGV_MAPERR 1 /* address not mapped to object */
+#define SEGV_ACCERR 2 /* invalid permissions for mapped object */
+#define NSIGSEGV 2
+
+/*
+ * SIGBUS si_codes
+ */
+#define BUS_ADRALN 1 /* invalid address alignment */
+#define BUS_ADRERR 2 /* non-existant physical address */
+#define BUS_OBJERR 3 /* object specific hardware error */
+#define NSIGBUS 3
+
+/*
+ * SIGTRAP si_codes
+ */
+#define TRAP_BRKPT 1 /* process breakpoint */
+#define TRAP_TRACE 2 /* process trace trap */
+#define NSIGTRAP
+
+/*
+ * SIGCHLD si_codes
+ */
+#define CLD_EXITED 1 /* child has exited */
+#define CLD_KILLED 2 /* child was killed */
+#define CLD_DUMPED 3 /* child terminated abnormally */
+#define CLD_TRAPPED 4 /* traced child has trapped */
+#define CLD_STOPPED 5 /* child has stopped */
+#define CLD_CONTINUED 6 /* stopped child has continued */
+#define NSIGCHLD
+
+/*
+ * SIGPOLL si_codes
+ */
+#define POLL_IN 1 /* data input available */
+#define POLL_OUT 2 /* output buffers available */
+#define POLL_MSG 3 /* input message available */
+#define POLL_ERR 4 /* i/o error */
+#define POLL_PRI 5 /* high priority input available */
+#define POLL_HUP 6 /* device disconnected */
+#define NSIGPOLL 6
+
+/*
+ * sigevent definitions
+ *
+ * It seems likely that SIGEV_THREAD will have to be handled from
+ * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
+ * thread manager then catches and does the appropriate nonsense.
+ * However, everything is written out here so as to not get lost.
+ */
+#define SIGEV_SIGNAL 0 /* notify via signal */
+#define SIGEV_NONE 1 /* other notification: meaningless */
+#define SIGEV_THREAD 2 /* deliver via thread creation */
+
+#define SIGEV_MAX_SIZE 64
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct sigevent {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ union {
+ int _pad[SIGEV_PAD_SIZE];
+
+ struct {
+ void (*_function)(sigval_t);
+ void *_attribute; /* really pthread_attr_t */
+ } _sigev_thread;
+ } _sigev_un;
+} sigevent_t;
+
+#define sigev_notify_function _sigev_un._sigev_thread._function
+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+#endif
diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h
new file mode 100644
index 000000000..6303537f6
--- /dev/null
+++ b/include/asm-arm/signal.h
@@ -0,0 +1,147 @@
+#ifndef _ASMARM_SIGNAL_H
+#define _ASMARM_SIGNAL_H
+
+#include <linux/types.h>
+
+/* Avoid too many header ordering problems. */
+struct siginfo;
+
+/* Most things should be clean enough to redefine this at will, if care
+ is taken to make libc match. */
+
+#define _NSIG 64
+#define _NSIG_BPW 32
+#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
+
+typedef unsigned long old_sigset_t; /* at least 32 bits */
+
+typedef struct {
+ unsigned long sig[_NSIG_WORDS];
+} sigset_t;
+
+#define SIGHUP 1
+#define SIGINT 2
+#define SIGQUIT 3
+#define SIGILL 4
+#define SIGTRAP 5
+#define SIGABRT 6
+#define SIGIOT 6
+#define SIGBUS 7
+#define SIGFPE 8
+#define SIGKILL 9
+#define SIGUSR1 10
+#define SIGSEGV 11
+#define SIGUSR2 12
+#define SIGPIPE 13
+#define SIGALRM 14
+#define SIGTERM 15
+#define SIGSTKFLT 16
+#define SIGCHLD 17
+#define SIGCONT 18
+#define SIGSTOP 19
+#define SIGTSTP 20
+#define SIGTTIN 21
+#define SIGTTOU 22
+#define SIGURG 23
+#define SIGXCPU 24
+#define SIGXFSZ 25
+#define SIGVTALRM 26
+#define SIGPROF 27
+#define SIGWINCH 28
+#define SIGIO 29
+#define SIGPOLL SIGIO
+/*
+#define SIGLOST 29
+*/
+#define SIGPWR 30
+#define SIGUNUSED 31
+
+/* These should not be considered constants from userland. */
+#define SIGRTMIN 32
+#define SIGRTMAX (_NSIG-1)
+
+/*
+ * SA_FLAGS values:
+ *
+ * SA_ONSTACK is not currently supported, but will allow sigaltstack(2).
+ * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
+ * SA_RESTART flag to get restarting signals (which were the default long ago)
+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
+ * SA_RESETHAND clears the handler when the signal is delivered.
+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
+ * SA_NODEFER prevents the current signal from being masked in the handler.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
+ */
+#define SA_NOCLDSTOP 0x00000001
+#define SA_NOCLDWAIT 0x00000002 /* not supported yet */
+#define SA_SIGINFO 0x00000004
+#define SA_ONSTACK 0x08000000
+#define SA_RESTART 0x10000000
+#define SA_NODEFER 0x40000000
+#define SA_RESETHAND 0x80000000
+
+#define SA_NOMASK SA_NODEFER
+#define SA_ONESHOT SA_RESETHAND
+#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
+
+#define SA_RESTORER 0x04000000
+
+#ifdef __KERNEL__
+
+/*
+ * These values of sa_flags are used only by the kernel as part of the
+ * irq handling routines.
+ *
+ * SA_INTERRUPT is also used by the irq handling routines.
+ * SA_SHIRQ is for shared interrupt support on PCI and EISA.
+ */
+#define SA_PROBE SA_ONESHOT
+#define SA_SAMPLE_RANDOM SA_RESTART
+#define SA_SHIRQ 0x04000000
+#endif
+
+#define SIG_BLOCK 0 /* for blocking signals */
+#define SIG_UNBLOCK 1 /* for unblocking signals */
+#define SIG_SETMASK 2 /* for setting the signal mask */
+
+/* Type of a signal handler. */
+typedef void (*__sighandler_t)(int);
+
+#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
+#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
+#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
+
+struct old_sigaction {
+ __sighandler_t sa_handler;
+ old_sigset_t sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+};
+
+struct sigaction {
+ __sighandler_t sa_handler;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+ sigset_t sa_mask; /* mask last for extensibility */
+};
+
+struct k_sigaction {
+ struct sigaction sa;
+};
+
+typedef struct sigaltstack {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+} stack_t;
+
+#ifdef __KERNEL__
+#include <asm/sigcontext.h>
+
+#define sigmask(sig) (1UL << ((sig) - 1))
+
+#endif
+
+#endif
diff --git a/include/asm-arm/smp.h b/include/asm-arm/smp.h
new file mode 100644
index 000000000..888933936
--- /dev/null
+++ b/include/asm-arm/smp.h
@@ -0,0 +1,7 @@
+#ifndef __ASM_SMP_H
+#define __ASM_SMP_H
+
+#ifdef __SMP__
+#error SMP not supported
+#endif
+#endif
diff --git a/include/asm-arm/smp_lock.h b/include/asm-arm/smp_lock.h
new file mode 100644
index 000000000..2d024ed57
--- /dev/null
+++ b/include/asm-arm/smp_lock.h
@@ -0,0 +1,17 @@
+#ifndef __I386_SMPLOCK_H
+#define __I386_SMPLOCK_H
+
+#define __STR(x) #x
+
+#ifndef __SMP__
+
+#define lock_kernel() do { } while(0)
+#define unlock_kernel() do { } while(0)
+#define release_kernel_lock(task, cpu, depth) ((depth) = 1)
+#define reacquire_kernel_lock(task, cpu, depth) do { } while(0)
+
+#else
+#error SMP not supported
+#endif /* __SMP__ */
+
+#endif /* __I386_SMPLOCK_H */
diff --git a/include/asm-arm/socket.h b/include/asm-arm/socket.h
new file mode 100644
index 000000000..312aef936
--- /dev/null
+++ b/include/asm-arm/socket.h
@@ -0,0 +1,33 @@
+#ifndef _ASMARM_SOCKET_H
+#define _ASMARM_SOCKET_H
+
+#include <asm/sockios.h>
+
+/* For setsockoptions(2) */
+#define SOL_SOCKET 1
+
+#define SO_DEBUG 1
+#define SO_REUSEADDR 2
+#define SO_TYPE 3
+#define SO_ERROR 4
+#define SO_DONTROUTE 5
+#define SO_BROADCAST 6
+#define SO_SNDBUF 7
+#define SO_RCVBUF 8
+#define SO_KEEPALIVE 9
+#define SO_OOBINLINE 10
+#define SO_NO_CHECK 11
+#define SO_PRIORITY 12
+#define SO_LINGER 13
+#define SO_BSDCOMPAT 14
+/* To add :#define SO_REUSEPORT 15 */
+#define SO_PASSCRED 16
+#define SO_PEERCRED 17
+#define SO_RCVLOWAT 18
+#define SO_SNDLOWAT 19
+#define SO_RCVTIMEO 20
+#define SO_SNDTIMEO 21
+
+#define SO_BINDTODEVICE 25
+
+#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-arm/sockios.h b/include/asm-arm/sockios.h
new file mode 100644
index 000000000..77c34087d
--- /dev/null
+++ b/include/asm-arm/sockios.h
@@ -0,0 +1,12 @@
+#ifndef __ARCH_ARM_SOCKIOS_H
+#define __ARCH_ARM_SOCKIOS_H
+
+/* Socket-level I/O control calls. */
+#define FIOSETOWN 0x8901
+#define SIOCSPGRP 0x8902
+#define FIOGETOWN 0x8903
+#define SIOCGPGRP 0x8904
+#define SIOCATMARK 0x8905
+#define SIOCGSTAMP 0x8906 /* Get stamp */
+
+#endif
diff --git a/include/asm-arm/softirq.h b/include/asm-arm/softirq.h
new file mode 100644
index 000000000..a9208b421
--- /dev/null
+++ b/include/asm-arm/softirq.h
@@ -0,0 +1,68 @@
+#ifndef __ASM_SOFTIRQ_H
+#define __ASM_SOFTIRQ_H
+
+#include <asm/atomic.h>
+#include <asm/hardirq.h>
+
+#define get_active_bhs() (bh_mask & bh_active)
+#define clear_active_bhs(x) atomic_clear_mask((int)(x),&bh_active)
+
+extern inline void init_bh(int nr, void (*routine)(void))
+{
+ bh_base[nr] = routine;
+ bh_mask_count[nr] = 0;
+ bh_mask |= 1 << nr;
+}
+
+extern inline void remove_bh(int nr)
+{
+ bh_base[nr] = NULL;
+ bh_mask &= ~(1 << nr);
+}
+
+extern inline void mark_bh(int nr)
+{
+ set_bit(nr, &bh_active);
+}
+
+/*
+ * These use a mask count to correctly handle
+ * nested disable/enable calls
+ */
+extern inline void disable_bh(int nr)
+{
+ bh_mask &= ~(1 << nr);
+ bh_mask_count[nr]++;
+}
+
+extern inline void enable_bh(int nr)
+{
+ if (!--bh_mask_count[nr])
+ bh_mask |= 1 << nr;
+}
+
+#ifdef __SMP__
+#error SMP not supported
+#else
+
+extern int __arm_bh_counter;
+
+extern inline void start_bh_atomic(void)
+{
+ __arm_bh_counter++;
+ barrier();
+}
+
+extern inline void end_bh_atomic(void)
+{
+ barrier();
+ __arm_bh_counter--;
+}
+
+/* These are for the irq's testing the lock */
+#define softirq_trylock() (__arm_bh_counter ? 0 : (__arm_bh_counter=1))
+#define softirq_endlock() (__arm_bh_counter = 0)
+
+#endif /* SMP */
+
+#endif /* __ASM_SOFTIRQ_H */
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h
new file mode 100644
index 000000000..376179b96
--- /dev/null
+++ b/include/asm-arm/spinlock.h
@@ -0,0 +1,59 @@
+#ifndef __ASM_SPINLOCK_H
+#define __ASM_SPINLOCK_H
+
+#ifndef __SMP__
+
+/*
+ * Your basic spinlocks, allowing only a single CPU anywhere
+ */
+typedef struct { } spinlock_t;
+#define SPIN_LOCK_UNLOCKED { }
+
+#define spin_lock_init(lock) do { } while(0)
+#define spin_lock(lock) do { } while(0)
+#define spin_trylock(lock) do { } while(0)
+#define spin_unlock_wait(lock) do { } while(0)
+#define spin_unlock(lock) do { } while(0)
+#define spin_lock_irq(lock) cli()
+#define spin_unlock_irq(lock) sti()
+
+#define spin_lock_irqsave(lock, flags) \
+ do { save_flags(flags); cli(); } while (0)
+#define spin_unlock_irqrestore(lock, flags) \
+ restore_flags(flags)
+
+/*
+ * Read-write spinlocks, allowing multiple readers
+ * but only one writer.
+ *
+ * NOTE! it is quite common to have readers in interrupts
+ * but no interrupt writers. For those circumstances we
+ * can "mix" irq-safe locks - any writer needs to get a
+ * irq-safe write-lock, but readers can get non-irqsafe
+ * read-locks.
+ */
+typedef struct { } rwlock_t;
+#define RW_LOCK_UNLOCKED { }
+
+#define read_lock(lock) do { } while(0)
+#define read_unlock(lock) do { } while(0)
+#define write_lock(lock) do { } while(0)
+#define write_unlock(lock) do { } while(0)
+#define read_lock_irq(lock) cli()
+#define read_unlock_irq(lock) sti()
+#define write_lock_irq(lock) cli()
+#define write_unlock_irq(lock) sti()
+
+#define read_lock_irqsave(lock, flags) \
+ do { save_flags(flags); cli(); } while (0)
+#define read_unlock_irqrestore(lock, flags) \
+ restore_flags(flags)
+#define write_lock_irqsave(lock, flags) \
+ do { save_flags(flags); cli(); } while (0)
+#define write_unlock_irqrestore(lock, flags) \
+ restore_flags(flags)
+
+#else
+#error ARM architecture does not support spin locks
+#endif /* SMP */
+#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-arm/stat.h b/include/asm-arm/stat.h
new file mode 100644
index 000000000..76c20e28f
--- /dev/null
+++ b/include/asm-arm/stat.h
@@ -0,0 +1,41 @@
+#ifndef _ASMARM_STAT_H
+#define _ASMARM_STAT_H
+
+struct __old_kernel_stat {
+ unsigned short st_dev;
+ unsigned short st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+ unsigned short st_rdev;
+ unsigned long st_size;
+ unsigned long st_atime;
+ unsigned long st_mtime;
+ unsigned long st_ctime;
+};
+
+struct stat {
+ unsigned short st_dev;
+ unsigned short __pad1;
+ unsigned long st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+ unsigned short st_rdev;
+ unsigned short __pad2;
+ unsigned long st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ unsigned long st_atime;
+ unsigned long __unused1;
+ unsigned long st_mtime;
+ unsigned long __unused2;
+ unsigned long st_ctime;
+ unsigned long __unused3;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+#endif
diff --git a/include/asm-arm/statfs.h b/include/asm-arm/statfs.h
new file mode 100644
index 000000000..a1eba73de
--- /dev/null
+++ b/include/asm-arm/statfs.h
@@ -0,0 +1,25 @@
+#ifndef _ASMARM_STATFS_H
+#define _ASMARM_STATFS_H
+
+#ifndef __KERNEL_STRICT_NAMES
+
+#include <linux/types.h>
+
+typedef __kernel_fsid_t fsid_t;
+
+#endif
+
+struct statfs {
+ long f_type;
+ long f_bsize;
+ long f_blocks;
+ long f_bfree;
+ long f_bavail;
+ long f_files;
+ long f_ffree;
+ __kernel_fsid_t f_fsid;
+ long f_namelen;
+ long f_spare[6];
+};
+
+#endif
diff --git a/include/asm-arm/string.h b/include/asm-arm/string.h
new file mode 100644
index 000000000..d185c87bb
--- /dev/null
+++ b/include/asm-arm/string.h
@@ -0,0 +1,24 @@
+#ifndef __ASM_ARM_STRING_H
+#define __ASM_ARM_STRING_H
+
+/*
+ * inline versions, hmm...
+ */
+
+#define __HAVE_ARCH_STRRCHR
+extern char * strrchr(const char * s, int c);
+
+#define __HAVE_ARCH_STRCHR
+extern char * strchr(const char * s, int c);
+
+#define __HAVE_ARCH_MEMCPY
+#define __HAVE_ARCH_MEMMOVE
+#define __HAVE_ARCH_MEMSET
+
+#define __HAVE_ARCH_MEMZERO
+extern void memzero(void *ptr, int n);
+
+extern void memsetl (unsigned long *, unsigned long, int n);
+
+#endif
+
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
new file mode 100644
index 000000000..2ad6a16cd
--- /dev/null
+++ b/include/asm-arm/system.h
@@ -0,0 +1,33 @@
+#ifndef __ASM_ARM_SYSTEM_H
+#define __ASM_ARM_SYSTEM_H
+
+#include <linux/kernel.h>
+#include <asm/proc-fns.h>
+
+extern void arm_malalignedptr(const char *, void *, volatile void *);
+extern void arm_invalidptr(const char *, int);
+
+#define xchg(ptr,x) \
+ ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
+
+#define tas(ptr) (xchg((ptr),1))
+
+/*
+ * switch_to(prev, next) should switch from task `prev' to `next'
+ * `prev' will never be the same as `next'.
+ *
+ * `next' and `prev' should be struct task_struct, but it isn't always defined
+ */
+#define switch_to(prev,next) processor._switch_to(prev,next)
+
+/*
+ * Include processor dependent parts
+ */
+#include <asm/proc/system.h>
+#include <asm/arch/system.h>
+
+#define mb() __asm__ __volatile__ ("" : : : "memory")
+#define nop() __asm__ __volatile__("mov r0,r0\n\t");
+
+#endif
+
diff --git a/include/asm-arm/termbits.h b/include/asm-arm/termbits.h
new file mode 100644
index 000000000..435833937
--- /dev/null
+++ b/include/asm-arm/termbits.h
@@ -0,0 +1,161 @@
+#ifndef __ASM_ARM_TERMBITS_H
+#define __ASM_ARM_TERMBITS_H
+
+#include <linux/posix_types.h>
+
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+#define NCCS 19
+struct termios {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+};
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* c_iflag bits */
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK 0000020
+#define ISTRIP 0000040
+#define INLCR 0000100
+#define IGNCR 0000200
+#define ICRNL 0000400
+#define IUCLC 0001000
+#define IXON 0002000
+#define IXANY 0004000
+#define IXOFF 0010000
+#define IMAXBEL 0020000
+
+/* c_oflag bits */
+#define OPOST 0000001
+#define OLCUC 0000002
+#define ONLCR 0000004
+#define OCRNL 0000010
+#define ONOCR 0000020
+#define ONLRET 0000040
+#define OFILL 0000100
+#define OFDEL 0000200
+#define NLDLY 0000400
+#define NL0 0000000
+#define NL1 0000400
+#define CRDLY 0003000
+#define CR0 0000000
+#define CR1 0001000
+#define CR2 0002000
+#define CR3 0003000
+#define TABDLY 0014000
+#define TAB0 0000000
+#define TAB1 0004000
+#define TAB2 0010000
+#define TAB3 0014000
+#define XTABS 0014000
+#define BSDLY 0020000
+#define BS0 0000000
+#define BS1 0020000
+#define VTDLY 0040000
+#define VT0 0000000
+#define VT1 0040000
+#define FFDLY 0100000
+#define FF0 0000000
+#define FF1 0100000
+
+/* c_cflag bit meaning */
+#define CBAUD 0010017
+#define B0 0000000 /* hang up */
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+#define EXTA B19200
+#define EXTB B38400
+#define CSIZE 0000060
+#define CS5 0000000
+#define CS6 0000020
+#define CS7 0000040
+#define CS8 0000060
+#define CSTOPB 0000100
+#define CREAD 0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL 0002000
+#define CLOCAL 0004000
+#define CBAUDEX 0010000
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define CIBAUD 002003600000 /* input baud rate (not used) */
+#define CMSPAR 010000000000 /* mark or space (stick) parity */
+#define CRTSCTS 020000000000 /* flow control */
+
+/* c_lflag bits */
+#define ISIG 0000001
+#define ICANON 0000002
+#define XCASE 0000004
+#define ECHO 0000010
+#define ECHOE 0000020
+#define ECHOK 0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#define ECHOCTL 0001000
+#define ECHOPRT 0002000
+#define ECHOKE 0004000
+#define FLUSHO 0010000
+#define PENDIN 0040000
+#define IEXTEN 0100000
+
+/* tcflow() and TCXONC use these */
+#define TCOOFF 0
+#define TCOON 1
+#define TCIOFF 2
+#define TCION 3
+
+/* tcflush() and TCFLSH use these */
+#define TCIFLUSH 0
+#define TCOFLUSH 1
+#define TCIOFLUSH 2
+
+/* tcsetattr uses these */
+#define TCSANOW 0
+#define TCSADRAIN 1
+#define TCSAFLUSH 2
+
+#endif /* __ASM_ARM_TERMBITS_H */
diff --git a/include/asm-arm/termios.h b/include/asm-arm/termios.h
new file mode 100644
index 000000000..9ad62d154
--- /dev/null
+++ b/include/asm-arm/termios.h
@@ -0,0 +1,98 @@
+#ifndef __ASM_ARM_TERMIOS_H
+#define __ASM_ARM_TERMIOS_H
+
+#include <asm/termbits.h>
+#include <asm/ioctls.h>
+
+struct winsize {
+ unsigned short ws_row;
+ unsigned short ws_col;
+ unsigned short ws_xpixel;
+ unsigned short ws_ypixel;
+};
+
+#define NCC 8
+struct termio {
+ unsigned short c_iflag; /* input mode flags */
+ unsigned short c_oflag; /* output mode flags */
+ unsigned short c_cflag; /* control mode flags */
+ unsigned short c_lflag; /* local mode flags */
+ unsigned char c_line; /* line discipline */
+ unsigned char c_cc[NCC]; /* control characters */
+};
+
+#ifdef __KERNEL__
+/* intr=^C quit=^| erase=del kill=^U
+ eof=^D vtime=\0 vmin=\1 sxtc=\0
+ start=^Q stop=^S susp=^Z eol=\0
+ reprint=^R discard=^U werase=^W lnext=^V
+ eol2=\0
+*/
+#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
+#endif
+
+/* modem lines */
+#define TIOCM_LE 0x001
+#define TIOCM_DTR 0x002
+#define TIOCM_RTS 0x004
+#define TIOCM_ST 0x008
+#define TIOCM_SR 0x010
+#define TIOCM_CTS 0x020
+#define TIOCM_CAR 0x040
+#define TIOCM_RNG 0x080
+#define TIOCM_DSR 0x100
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RI TIOCM_RNG
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+
+/* line disciplines */
+#define N_TTY 0
+#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 */
+
+#ifdef __KERNEL__
+
+#include <linux/string.h>
+
+/*
+ * Translate a "termio" structure into a "termios". Ugh.
+ */
+#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
+ unsigned short __tmp; \
+ get_user(__tmp,&(termio)->x); \
+ *(unsigned short *) &(termios)->x = __tmp; \
+}
+
+#define user_termio_to_kernel_termios(termios, termio) \
+({ \
+ SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
+ SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
+ SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
+ SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
+ copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
+})
+
+/*
+ * Translate a "termios" structure into a "termio". Ugh.
+ */
+#define kernel_termios_to_user_termio(termio, termios) \
+({ \
+ put_user((termios)->c_iflag, &(termio)->c_iflag); \
+ put_user((termios)->c_oflag, &(termio)->c_oflag); \
+ put_user((termios)->c_cflag, &(termio)->c_cflag); \
+ put_user((termios)->c_lflag, &(termio)->c_lflag); \
+ put_user((termios)->c_line, &(termio)->c_line); \
+ copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
+})
+
+#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios))
+#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios))
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_ARM_TERMIOS_H */
diff --git a/include/asm-arm/timex.h b/include/asm-arm/timex.h
new file mode 100644
index 000000000..29ae27df2
--- /dev/null
+++ b/include/asm-arm/timex.h
@@ -0,0 +1,13 @@
+/*
+ * linux/include/asm-arm/timex.h
+ *
+ * Architecture Specific TIME specifications
+ *
+ * Copyright (C) 1997,1998 Russell King
+ */
+#ifndef _ASMARM_TIMEX_H
+#define _ASMARM_TIMEX_H
+
+#include <asm/arch/timex.h>
+
+#endif
diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h
new file mode 100644
index 000000000..38ea29855
--- /dev/null
+++ b/include/asm-arm/types.h
@@ -0,0 +1,45 @@
+#ifndef __ASM_ARM_TYPES_H
+#define __ASM_ARM_TYPES_H
+
+typedef unsigned short umode_t;
+
+/*
+ * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
+ * header files exported to user space
+ */
+
+typedef __signed__ char __s8;
+typedef unsigned char __u8;
+
+typedef __signed__ short __s16;
+typedef unsigned short __u16;
+
+typedef __signed__ int __s32;
+typedef unsigned int __u32;
+
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+typedef __signed__ long long __s64;
+typedef unsigned long long __u64;
+#endif
+
+/*
+ * These aren't exported outside the kernel to avoid name space clashes
+ */
+#ifdef __KERNEL__
+
+typedef signed char s8;
+typedef unsigned char u8;
+
+typedef signed short s16;
+typedef unsigned short u16;
+
+typedef signed int s32;
+typedef unsigned int u32;
+
+typedef signed long long s64;
+typedef unsigned long long u64;
+
+#endif /* __KERNEL__ */
+
+#endif
+
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h
new file mode 100644
index 000000000..30b4950fe
--- /dev/null
+++ b/include/asm-arm/uaccess.h
@@ -0,0 +1,194 @@
+#ifndef _ASMARM_UACCESS_H
+#define _ASMARM_UACCESS_H
+
+/*
+ * User space memory access functions
+ */
+#include <linux/sched.h>
+
+#define VERIFY_READ 0
+#define VERIFY_WRITE 1
+
+/*
+ * The exception table consists of pairs of addresses: the first is the
+ * address of an instruction that is allowed to fault, and the second is
+ * the address at which the program should continue. No registers are
+ * modified, so it is entirely up to the continuation code to figure out
+ * what to do.
+ *
+ * All the routines below use bits of fixup code that are out of line
+ * with the main instruction path. This means when everything is well,
+ * we don't even have to jump over them. Further, they do not intrude
+ * on our cache or tlb entries.
+ */
+
+struct exception_table_entry
+{
+ unsigned long insn, fixup;
+};
+
+/* Returns 0 if exception not found and fixup otherwise. */
+extern unsigned long search_exception_table(unsigned long);
+
+#include <asm/proc/uaccess.h>
+
+extern inline int verify_area(int type, const void * addr, unsigned long size)
+{
+ return access_ok(type,addr,size) ? 0 : -EFAULT;
+}
+
+/*
+ * Single-value transfer routines. They automatically use the right
+ * size if we just have the right pointer type.
+ *
+ * The "__xxx" versions of the user access functions do not verify the
+ * 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.
+ */
+#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_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_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)
+{
+ if (access_ok(VERIFY_READ, from, n))
+ __do_copy_from_user(to, from, n);
+ return n;
+}
+
+static __inline__ unsigned long __copy_from_user(void *to, const void *from, unsigned long n)
+{
+ __do_copy_from_user(to, from, n);
+ 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))
+ __do_copy_to_user(to, from, n);
+ return n;
+}
+
+static __inline__ unsigned long __copy_to_user(void *to, const void *from, unsigned long n)
+{
+ __do_copy_to_user(to, from, n);
+ 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))
+ __do_clear_user(to, n);
+ return n;
+}
+
+static __inline__ unsigned long __clear_user (void *to, unsigned long n)
+{
+ __do_clear_user(to, n);
+ return n;
+}
+
+static __inline__ long strncpy_from_user (char *dst, const char *src, long count)
+{
+ long res = -EFAULT;
+ if (access_ok(VERIFY_READ, src, 1))
+ __do_strncpy_from_user(dst, src, count, res);
+ return res;
+}
+
+static __inline__ long __strncpy_from_user (char *dst, const char *src, long count)
+{
+ long res;
+ __do_strncpy_from_user(dst, src, count, res);
+ return res;
+}
+
+extern __inline__ long strlen_user (const char *s)
+{
+ unsigned long res = 0;
+
+ if (__addr_ok(s))
+ __do_strlen_user (s, res);
+
+ return res;
+}
+
+/*
+ * These are the work horses of the get/put_user functions
+ */
+#define __get_user_check(x,ptr,size) \
+({ \
+ long __gu_err = -EFAULT, __gu_val = 0; \
+ const __typeof__(*(ptr)) *__gu_addr = (ptr); \
+ if (access_ok(VERIFY_READ,__gu_addr,size)) \
+ __get_user_size(__gu_val,__gu_addr,(size),__gu_err); \
+ (x) = (__typeof__(*(ptr)))__gu_val; \
+ __gu_err; \
+})
+
+#define __get_user_nocheck(x,ptr,size) \
+({ \
+ long __gu_err = 0, __gu_val = 0; \
+ __get_user_size(__gu_val,(ptr),(size),__gu_err); \
+ (x) = (__typeof__(*(ptr)))__gu_val; \
+ __gu_err; \
+})
+
+#define __put_user_check(x,ptr,size) \
+({ \
+ long __pu_err = -EFAULT; \
+ __typeof__(*(ptr)) *__pu_addr = (ptr); \
+ if (access_ok(VERIFY_WRITE,__pu_addr,size)) \
+ __put_user_size((x),__pu_addr,(size),__pu_err); \
+ __pu_err; \
+})
+
+#define __put_user_nocheck(x,ptr,size) \
+({ \
+ long __pu_err = 0; \
+ __put_user_size((x),(ptr),(size),__pu_err); \
+ __pu_err; \
+})
+
+extern long __get_user_bad(void);
+
+#define __get_user_size(x,ptr,size,retval) \
+do { \
+ retval = 0; \
+ switch (size) { \
+ case 1: __get_user_asm_byte(x,ptr,retval); break; \
+ case 2: __get_user_asm_half(x,ptr,retval); break; \
+ case 4: __get_user_asm_word(x,ptr,retval); break; \
+ default: (x) = __get_user_bad(); \
+ } \
+} while (0)
+
+extern long __put_user_bad(void);
+
+#define __put_user_size(x,ptr,size,retval) \
+do { \
+ retval = 0; \
+ switch (size) { \
+ case 1: __put_user_asm_byte(x,ptr,retval); break; \
+ case 2: __put_user_asm_half(x,ptr,retval); break; \
+ case 4: __put_user_asm_word(x,ptr,retval); break; \
+ default: __put_user_bad(); \
+ } \
+} while (0)
+
+#endif /* _ASMARM_UACCESS_H */
diff --git a/include/asm-arm/ucontext.h b/include/asm-arm/ucontext.h
new file mode 100644
index 000000000..f85313013
--- /dev/null
+++ b/include/asm-arm/ucontext.h
@@ -0,0 +1,12 @@
+#ifndef _ASMARM_UCONTEXT_H
+#define _ASMARM_UCONTEXT_H
+
+struct ucontext {
+ unsigned long uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ struct sigcontext uc_mcontext;
+ sigset_t uc_sigmask; /* mask last for extensibility */
+};
+
+#endif /* !_ASMARM_UCONTEXT_H */
diff --git a/include/asm-arm/unaligned.h b/include/asm-arm/unaligned.h
new file mode 100644
index 000000000..9b86bd415
--- /dev/null
+++ b/include/asm-arm/unaligned.h
@@ -0,0 +1,59 @@
+#ifndef __ARM_UNALIGNED_H
+#define __ARM_UNALIGNED_H
+
+#define get_unaligned(ptr) \
+ ((__typeof__(*(ptr)))__get_unaligned((ptr), sizeof(*(ptr))))
+
+#define put_unaligned(val, ptr) \
+ __put_unaligned((unsigned long)(val), (ptr), sizeof(*(ptr)))
+
+extern void bad_unaligned_access_length (void);
+
+extern inline unsigned long __get_unaligned(const void *ptr, size_t size)
+{
+ unsigned long val;
+ switch (size) {
+ case 1:
+ val = *(const unsigned char *)ptr;
+ break;
+
+ case 2:
+ val = ((const unsigned char *)ptr)[0] | (((const unsigned char *)ptr)[1] << 8);
+ break;
+
+ case 4:
+ val = ((const unsigned char *)ptr)[0] | (((const unsigned char *)ptr)[1] << 8) |
+ (((const unsigned char *)ptr)[2]) << 16 | (((const unsigned char *)ptr)[3] << 24);
+ break;
+
+ default:
+ bad_unaligned_access_length ();
+ }
+ return val;
+}
+
+extern inline void __put_unaligned(unsigned long val, void *ptr, size_t size)
+{
+ switch (size) {
+ case 1:
+ *(unsigned char *)ptr = val;
+ break;
+
+ case 2:
+ ((unsigned char *)ptr)[0] = val;
+ ((unsigned char *)ptr)[1] = val >> 8;
+ break;
+
+ case 4:
+ ((unsigned char *)ptr)[0] = val;
+ ((unsigned char *)ptr)[1] = val >> 8;
+ ((unsigned char *)ptr)[2] = val >> 16;
+ ((unsigned char *)ptr)[3] = val >> 24;
+ break;
+
+ default:
+ bad_unaligned_access_length ();
+ }
+}
+
+#endif
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
new file mode 100644
index 000000000..31b407dbb
--- /dev/null
+++ b/include/asm-arm/unistd.h
@@ -0,0 +1,371 @@
+#ifndef __ASM_ARM_UNISTD_H
+#define __ASM_ARM_UNISTD_H
+
+#define __NR_SYSCALL_BASE 0x900000
+
+/*
+ * This file contains the system call numbers.
+ */
+
+#define __NR_setup (__NR_SYSCALL_BASE+ 0) /* used only by init, to get system going */
+#define __NR_exit (__NR_SYSCALL_BASE+ 1)
+#define __NR_fork (__NR_SYSCALL_BASE+ 2)
+#define __NR_read (__NR_SYSCALL_BASE+ 3)
+#define __NR_write (__NR_SYSCALL_BASE+ 4)
+#define __NR_open (__NR_SYSCALL_BASE+ 5)
+#define __NR_close (__NR_SYSCALL_BASE+ 6)
+#define __NR_waitpid (__NR_SYSCALL_BASE+ 7)
+#define __NR_creat (__NR_SYSCALL_BASE+ 8)
+#define __NR_link (__NR_SYSCALL_BASE+ 9)
+#define __NR_unlink (__NR_SYSCALL_BASE+ 10)
+#define __NR_execve (__NR_SYSCALL_BASE+ 11)
+#define __NR_chdir (__NR_SYSCALL_BASE+ 12)
+#define __NR_time (__NR_SYSCALL_BASE+ 13)
+#define __NR_mknod (__NR_SYSCALL_BASE+ 14)
+#define __NR_chmod (__NR_SYSCALL_BASE+ 15)
+#define __NR_chown (__NR_SYSCALL_BASE+ 16)
+#define __NR_break (__NR_SYSCALL_BASE+ 17)
+#define __NR_oldstat (__NR_SYSCALL_BASE+ 18)
+#define __NR_lseek (__NR_SYSCALL_BASE+ 19)
+#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
+#define __NR_mount (__NR_SYSCALL_BASE+ 21)
+#define __NR_umount (__NR_SYSCALL_BASE+ 22)
+#define __NR_setuid (__NR_SYSCALL_BASE+ 23)
+#define __NR_getuid (__NR_SYSCALL_BASE+ 24)
+#define __NR_stime (__NR_SYSCALL_BASE+ 25)
+#define __NR_ptrace (__NR_SYSCALL_BASE+ 26)
+#define __NR_alarm (__NR_SYSCALL_BASE+ 27)
+#define __NR_oldfstat (__NR_SYSCALL_BASE+ 28)
+#define __NR_pause (__NR_SYSCALL_BASE+ 29)
+#define __NR_utime (__NR_SYSCALL_BASE+ 30)
+#define __NR_stty (__NR_SYSCALL_BASE+ 31)
+#define __NR_gtty (__NR_SYSCALL_BASE+ 32)
+#define __NR_access (__NR_SYSCALL_BASE+ 33)
+#define __NR_nice (__NR_SYSCALL_BASE+ 34)
+#define __NR_ftime (__NR_SYSCALL_BASE+ 35)
+#define __NR_sync (__NR_SYSCALL_BASE+ 36)
+#define __NR_kill (__NR_SYSCALL_BASE+ 37)
+#define __NR_rename (__NR_SYSCALL_BASE+ 38)
+#define __NR_mkdir (__NR_SYSCALL_BASE+ 39)
+#define __NR_rmdir (__NR_SYSCALL_BASE+ 40)
+#define __NR_dup (__NR_SYSCALL_BASE+ 41)
+#define __NR_pipe (__NR_SYSCALL_BASE+ 42)
+#define __NR_times (__NR_SYSCALL_BASE+ 43)
+#define __NR_prof (__NR_SYSCALL_BASE+ 44)
+#define __NR_brk (__NR_SYSCALL_BASE+ 45)
+#define __NR_setgid (__NR_SYSCALL_BASE+ 46)
+#define __NR_getgid (__NR_SYSCALL_BASE+ 47)
+#define __NR_signal (__NR_SYSCALL_BASE+ 48)
+#define __NR_geteuid (__NR_SYSCALL_BASE+ 49)
+#define __NR_getegid (__NR_SYSCALL_BASE+ 50)
+#define __NR_acct (__NR_SYSCALL_BASE+ 51)
+#define __NR_phys (__NR_SYSCALL_BASE+ 52)
+#define __NR_lock (__NR_SYSCALL_BASE+ 53)
+#define __NR_ioctl (__NR_SYSCALL_BASE+ 54)
+#define __NR_fcntl (__NR_SYSCALL_BASE+ 55)
+#define __NR_mpx (__NR_SYSCALL_BASE+ 56)
+#define __NR_setpgid (__NR_SYSCALL_BASE+ 57)
+#define __NR_ulimit (__NR_SYSCALL_BASE+ 58)
+#define __NR_oldolduname (__NR_SYSCALL_BASE+ 59)
+#define __NR_umask (__NR_SYSCALL_BASE+ 60)
+#define __NR_chroot (__NR_SYSCALL_BASE+ 61)
+#define __NR_ustat (__NR_SYSCALL_BASE+ 62)
+#define __NR_dup2 (__NR_SYSCALL_BASE+ 63)
+#define __NR_getppid (__NR_SYSCALL_BASE+ 64)
+#define __NR_getpgrp (__NR_SYSCALL_BASE+ 65)
+#define __NR_setsid (__NR_SYSCALL_BASE+ 66)
+#define __NR_sigaction (__NR_SYSCALL_BASE+ 67)
+#define __NR_sgetmask (__NR_SYSCALL_BASE+ 68)
+#define __NR_ssetmask (__NR_SYSCALL_BASE+ 69)
+#define __NR_setreuid (__NR_SYSCALL_BASE+ 70)
+#define __NR_setregid (__NR_SYSCALL_BASE+ 71)
+#define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72)
+#define __NR_sigpending (__NR_SYSCALL_BASE+ 73)
+#define __NR_sethostname (__NR_SYSCALL_BASE+ 74)
+#define __NR_setrlimit (__NR_SYSCALL_BASE+ 75)
+#define __NR_getrlimit (__NR_SYSCALL_BASE+ 76)
+#define __NR_getrusage (__NR_SYSCALL_BASE+ 77)
+#define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78)
+#define __NR_settimeofday (__NR_SYSCALL_BASE+ 79)
+#define __NR_getgroups (__NR_SYSCALL_BASE+ 80)
+#define __NR_setgroups (__NR_SYSCALL_BASE+ 81)
+#define __NR_select (__NR_SYSCALL_BASE+ 82)
+#define __NR_symlink (__NR_SYSCALL_BASE+ 83)
+#define __NR_oldlstat (__NR_SYSCALL_BASE+ 84)
+#define __NR_readlink (__NR_SYSCALL_BASE+ 85)
+#define __NR_uselib (__NR_SYSCALL_BASE+ 86)
+#define __NR_swapon (__NR_SYSCALL_BASE+ 87)
+#define __NR_reboot (__NR_SYSCALL_BASE+ 88)
+#define __NR_readdir (__NR_SYSCALL_BASE+ 89)
+#define __NR_mmap (__NR_SYSCALL_BASE+ 90)
+#define __NR_munmap (__NR_SYSCALL_BASE+ 91)
+#define __NR_truncate (__NR_SYSCALL_BASE+ 92)
+#define __NR_ftruncate (__NR_SYSCALL_BASE+ 93)
+#define __NR_fchmod (__NR_SYSCALL_BASE+ 94)
+#define __NR_fchown (__NR_SYSCALL_BASE+ 95)
+#define __NR_getpriority (__NR_SYSCALL_BASE+ 96)
+#define __NR_setpriority (__NR_SYSCALL_BASE+ 97)
+#define __NR_profil (__NR_SYSCALL_BASE+ 98)
+#define __NR_statfs (__NR_SYSCALL_BASE+ 99)
+#define __NR_fstatfs (__NR_SYSCALL_BASE+100)
+#define __NR_ioperm (__NR_SYSCALL_BASE+101)
+#define __NR_socketcall (__NR_SYSCALL_BASE+102)
+#define __NR_syslog (__NR_SYSCALL_BASE+103)
+#define __NR_setitimer (__NR_SYSCALL_BASE+104)
+#define __NR_getitimer (__NR_SYSCALL_BASE+105)
+#define __NR_stat (__NR_SYSCALL_BASE+106)
+#define __NR_lstat (__NR_SYSCALL_BASE+107)
+#define __NR_fstat (__NR_SYSCALL_BASE+108)
+#define __NR_olduname (__NR_SYSCALL_BASE+109)
+#define __NR_iopl (__NR_SYSCALL_BASE+110)
+#define __NR_vhangup (__NR_SYSCALL_BASE+111)
+#define __NR_idle (__NR_SYSCALL_BASE+112)
+#define __NR_syscall (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */
+#define __NR_wait4 (__NR_SYSCALL_BASE+114)
+#define __NR_swapoff (__NR_SYSCALL_BASE+115)
+#define __NR_sysinfo (__NR_SYSCALL_BASE+116)
+#define __NR_ipc (__NR_SYSCALL_BASE+117)
+#define __NR_fsync (__NR_SYSCALL_BASE+118)
+#define __NR_sigreturn (__NR_SYSCALL_BASE+119)
+#define __NR_clone (__NR_SYSCALL_BASE+120)
+#define __NR_setdomainname (__NR_SYSCALL_BASE+121)
+#define __NR_uname (__NR_SYSCALL_BASE+122)
+#define __NR_modify_ldt (__NR_SYSCALL_BASE+123)
+#define __NR_adjtimex (__NR_SYSCALL_BASE+124)
+#define __NR_mprotect (__NR_SYSCALL_BASE+125)
+#define __NR_sigprocmask (__NR_SYSCALL_BASE+126)
+#define __NR_create_module (__NR_SYSCALL_BASE+127)
+#define __NR_init_module (__NR_SYSCALL_BASE+128)
+#define __NR_delete_module (__NR_SYSCALL_BASE+129)
+#define __NR_get_kernel_syms (__NR_SYSCALL_BASE+130)
+#define __NR_quotactl (__NR_SYSCALL_BASE+131)
+#define __NR_getpgid (__NR_SYSCALL_BASE+132)
+#define __NR_fchdir (__NR_SYSCALL_BASE+133)
+#define __NR_bdflush (__NR_SYSCALL_BASE+134)
+#define __NR_sysfs (__NR_SYSCALL_BASE+135)
+#define __NR_personality (__NR_SYSCALL_BASE+136)
+#define __NR_afs_syscall (__NR_SYSCALL_BASE+137) /* Syscall for Andrew File System */
+#define __NR_setfsuid (__NR_SYSCALL_BASE+138)
+#define __NR_setfsgid (__NR_SYSCALL_BASE+139)
+#define __NR__llseek (__NR_SYSCALL_BASE+140)
+#define __NR_getdents (__NR_SYSCALL_BASE+141)
+#define __NR__newselect (__NR_SYSCALL_BASE+142)
+#define __NR_flock (__NR_SYSCALL_BASE+143)
+#define __NR_msync (__NR_SYSCALL_BASE+144)
+#define __NR_readv (__NR_SYSCALL_BASE+145)
+#define __NR_writev (__NR_SYSCALL_BASE+146)
+#define __NR_getsid (__NR_SYSCALL_BASE+147)
+#define __NR_fdatasync (__NR_SYSCALL_BASE+148)
+#define __NR__sysctl (__NR_SYSCALL_BASE+149)
+#define __NR_mlock (__NR_SYSCALL_BASE+150)
+#define __NR_munlock (__NR_SYSCALL_BASE+151)
+#define __NR_mlockall (__NR_SYSCALL_BASE+152)
+#define __NR_munlockall (__NR_SYSCALL_BASE+153)
+#define __NR_sched_setparam (__NR_SYSCALL_BASE+154)
+#define __NR_sched_getparam (__NR_SYSCALL_BASE+155)
+#define __NR_sched_setscheduler (__NR_SYSCALL_BASE+156)
+#define __NR_sched_getscheduler (__NR_SYSCALL_BASE+157)
+#define __NR_sched_yield (__NR_SYSCALL_BASE+158)
+#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE+159)
+#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE+160)
+#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE+161)
+#define __NR_nanosleep (__NR_SYSCALL_BASE+162)
+#define __NR_mremap (__NR_SYSCALL_BASE+163)
+#define __NR_setresuid (__NR_SYSCALL_BASE+164)
+#define __NR_getresuid (__NR_SYSCALL_BASE+165)
+#define __NR_vm86 (__NR_SYSCALL_BASE+166)
+#define __NR_query_module (__NR_SYSCALL_BASE+167)
+#define __NR_poll (__NR_SYSCALL_BASE+168)
+#define __NR_nfsservctl (__NR_SYSCALL_BASE+169)
+#define __NR_setresgid (__NR_SYSCALL_BASE+170)
+#define __NR_getresgid (__NR_SYSCALL_BASE+171)
+#define __NR_prctl (__NR_SYSCALL_BASE+172)
+#define __NR_rt_sigreturn (__NR_SYSCALL_BASE+173)
+#define __NR_rt_sigaction (__NR_SYSCALL_BASE+174)
+#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE+175)
+#define __NR_rt_sigpending (__NR_SYSCALL_BASE+176)
+#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)
+#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)
+#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
+#define __NR_pread (__NR_SYSCALL_BASE+180)
+#define __NR_pwrite (__NR_SYSCALL_BASE+181)
+
+#define __sys2(x) #x
+#define __sys1(x) __sys2(x)
+
+#ifndef __syscall
+#define __syscall(name) "swi\t" __sys1(__NR_##name) "\n\t"
+#endif
+
+#define __syscall_return(type, res) \
+do { \
+ if ((unsigned long)(res) >= (unsigned long)(-125)) { \
+ errno = -(res); \
+ res = -1; \
+ } \
+ return (type) (res); \
+} while (0)
+
+#define _syscall0(type,name) \
+type name(void) { \
+ long __res; \
+ __asm__ __volatile__ ( \
+ __syscall(name) \
+ "mov %0,r0" \
+ :"=r" (__res) : : "r0","lr"); \
+ __syscall_return(type,__res); \
+}
+
+#define _syscall1(type,name,type1,arg1) \
+type name(type1 arg1) { \
+ long __res; \
+ __asm__ __volatile__ ( \
+ "mov\tr0,%1\n\t" \
+ __syscall(name) \
+ "mov %0,r0" \
+ : "=r" (__res) \
+ : "r" ((long)(arg1)) \
+ : "r0","lr"); \
+ __syscall_return(type,__res); \
+}
+
+#define _syscall2(type,name,type1,arg1,type2,arg2) \
+type name(type1 arg1,type2 arg2) { \
+ long __res; \
+ __asm__ __volatile__ ( \
+ "mov\tr0,%1\n\t" \
+ "mov\tr1,%2\n\t" \
+ __syscall(name) \
+ "mov\t%0,r0" \
+ : "=r" (__res) \
+ : "r" ((long)(arg1)),"r" ((long)(arg2)) \
+ : "r0","r1","lr"); \
+ __syscall_return(type,__res); \
+}
+
+
+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
+type name(type1 arg1,type2 arg2,type3 arg3) { \
+ long __res; \
+ __asm__ __volatile__ ( \
+ "mov\tr0,%1\n\t" \
+ "mov\tr1,%2\n\t" \
+ "mov\tr2,%3\n\t" \
+ __syscall(name) \
+ "mov\t%0,r0" \
+ : "=r" (__res) \
+ : "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)) \
+ : "r0","r1","r2","lr"); \
+ __syscall_return(type,__res); \
+}
+
+
+#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
+type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
+ long __res; \
+ __asm__ __volatile__ ( \
+ "mov\tr0,%1\n\t" \
+ "mov\tr1,%2\n\t" \
+ "mov\tr2,%3\n\t" \
+ "mov\tr3,%4\n\t" \
+ __syscall(name) \
+ "mov\t%0,r0" \
+ : "=r" (__res) \
+ : "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)),"r" ((long)(arg4)) \
+ : "r0","r1","r2","r3","lr"); \
+ __syscall_return(type,__res); \
+}
+
+
+#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) { \
+ long __res; \
+ __asm__ __volatile__ ( \
+ "mov\tr0,%1\n\t" \
+ "mov\tr1,%2\n\t" \
+ "mov\tr2,%3\n\t" \
+ "mov\tr3,%4\n\t" \
+ "mov\tr4,%5\n\t" \
+ __syscall(name) \
+ "mov\t%0,r0" \
+ : "=r" (__res) \
+ : "r" ((long)(arg1)),"r" ((long)(arg2)),"r" ((long)(arg3)),"r" ((long)(arg4)), \
+ "r" ((long)(arg5)) \
+ : "r0","r1","r2","r3","r4","lr"); \
+ __syscall_return(type,__res); \
+}
+
+#ifdef __KERNEL_SYSCALLS__
+
+/*
+ * we need this inline - forking from kernel space will result
+ * in NO COPY ON WRITE (!!!), until an execve is executed. This
+ * is no problem, but for the stack. This is handled by not letting
+ * main() use the stack at all after fork(). Thus, no function
+ * calls - which means inline code for fork too, as otherwise we
+ * would use the stack upon exit from 'fork()'.
+ *
+ * Actually only pause and fork are needed inline, so that there
+ * won't be any messing with the stack from main(), but we define
+ * some others too.
+ */
+#define __NR__exit __NR_exit
+static inline _syscall0(int,idle);
+static inline _syscall0(int,fork);
+static inline _syscall2(int,clone,unsigned long,flags,char *,esp);
+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);
+static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
+static inline _syscall1(int,dup,int,fd);
+static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp);
+static inline _syscall3(int,open,const char *,file,int,flag,int,mode);
+static inline _syscall1(int,close,int,fd);
+static inline _syscall1(int,_exit,int,exitcode);
+static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options);
+
+static inline pid_t wait(int * wait_stat)
+{
+ return waitpid(-1,wait_stat,0);
+}
+
+
+
+/*
+ * This is the mechanism for creating a new kernel thread.
+ *
+ * NOTE! Only a kernel-only process(ie the swapper or direct descendants
+ * who haven't done an "execve()") should use this: it will work within
+ * a system call from a "real" process, but the process memory space will
+ * not be free'd until both the parent and the child have exited.
+ */
+static inline pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
+{
+ long retval;
+
+ __asm__ __volatile__("
+ mov r0,%1
+ mov r1,%2
+ "__syscall(clone)"
+ teq r0, #0
+ bne 1f
+ mov r0,%4
+ mov lr, pc
+ mov pc, %3
+ "__syscall(exit)"
+1: mov %0,r0"
+ : "=r" (retval)
+ : "Ir" (flags | CLONE_VM), "Ir" (NULL), "r" (fn), "Ir" (arg)
+ : "r0","r1","r2","r3","lr");
+
+ return retval;
+}
+
+#endif
+
+#endif /* __ASM_ARM_UNISTD_H */
+
+
+
diff --git a/include/asm-arm/user.h b/include/asm-arm/user.h
new file mode 100644
index 000000000..7afe1a2a9
--- /dev/null
+++ b/include/asm-arm/user.h
@@ -0,0 +1,82 @@
+#ifndef _ARM_USER_H
+#define _ARM_USER_H
+
+#include <asm/page.h>
+#include <linux/ptrace.h>
+/* Core file format: The core file is written in such a way that gdb
+ can understand it and provide useful information to the user (under
+ linux we use the 'trad-core' bfd). There are quite a number of
+ obstacles to being able to view the contents of the floating point
+ registers, and until these are solved you will not be able to view the
+ contents of them. Actually, you can read in the core file and look at
+ the contents of the user struct to find out what the floating point
+ registers contain.
+ The actual file contents are as follows:
+ UPAGE: 1 page consisting of a user struct that tells gdb what is present
+ in the file. Directly after this is a copy of the task_struct, which
+ is currently not used by gdb, but it may come in useful at some point.
+ All of the registers are stored as part of the upage. The upage should
+ always be only one page.
+ DATA: The data area is stored. We use current->end_text to
+ current->brk to pick up all of the user variables, plus any memory
+ that may have been malloced. No attempt is made to determine if a page
+ is demand-zero or if a page is totally unused, we just cover the entire
+ range. All of the addresses are rounded in such a way that an integral
+ number of pages is written.
+ STACK: We need the stack information in order to get a meaningful
+ backtrace. We need to write the data from (esp) to
+ current->start_stack, so we round each of these off in order to be able
+ to write an integer number of pages.
+ The minimum core file size is 3 pages, or 12288 bytes.
+*/
+
+struct user_fp {
+ struct fp_reg {
+ unsigned int sign1:1;
+ unsigned int unused:15;
+ unsigned int sign2:1;
+ unsigned int exponent:14;
+ unsigned int j:1;
+ unsigned int mantissa1:31;
+ unsigned int mantissa0:32;
+ } fpregs[8];
+ unsigned int fpsr:32;
+ unsigned int fpcr:32;
+};
+
+/* When the kernel dumps core, it starts by dumping the user struct -
+ this will be used by gdb to figure out where the data and stack segments
+ are within the file, and what virtual addresses to use. */
+struct user{
+/* We start with the registers, to mimic the way that "memory" is returned
+ from the ptrace(3,...) function. */
+ struct pt_regs regs; /* Where the registers are actually stored */
+/* ptrace does not yet supply these. Someday.... */
+ int u_fpvalid; /* True if math co-processor being used. */
+ /* for this mess. Not yet used. */
+/* The rest of this junk is to help gdb figure out what goes where */
+ unsigned long int u_tsize; /* Text segment size (pages). */
+ unsigned long int u_dsize; /* Data segment size (pages). */
+ unsigned long int u_ssize; /* Stack segment size (pages). */
+ unsigned long start_code; /* Starting virtual address of text. */
+ unsigned long start_stack; /* Starting virtual address of stack area.
+ This is actually the bottom of the stack,
+ the top of the stack is always found in the
+ esp register. */
+ long int signal; /* Signal that caused the core dump. */
+ int reserved; /* No longer used */
+ struct pt_regs * u_ar0; /* Used by gdb to help find the values for */
+ /* the registers. */
+ unsigned long magic; /* To uniquely identify a core file */
+ char u_comm[32]; /* User command that was responsible */
+ int u_debugreg[8];
+ struct user_fp u_fp; /* FP state */
+ struct user_fp_struct * u_fp0;/* Used by gdb to help find the values for */
+ /* the FP registers. */
+};
+#define NBPG PAGE_SIZE
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif /* _ARM_USER_H */
diff --git a/include/asm-arm/vt.h b/include/asm-arm/vt.h
new file mode 100644
index 000000000..6c3573768
--- /dev/null
+++ b/include/asm-arm/vt.h
@@ -0,0 +1,8 @@
+#ifndef _ASMARM_VT_H
+#define _ASMARM_VT_H
+
+#define VT_GETSCRINFO 0x56FD /* get screen info */
+#define VT_GETPALETTE 0x56FE /* get palette */
+#define VT_SETPALETTE 0x56FF /* set palette */
+
+#endif /* _ASMARM_VT_H */
diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h
index b7f2e1507..0a5c60bf5 100644
--- a/include/asm-i386/bugs.h
+++ b/include/asm-i386/bugs.h
@@ -18,12 +18,12 @@
__initfunc(static void no_halt(char *s, int *ints))
{
- hlt_works_ok = 0;
+ boot_cpu_data.hlt_works_ok = 0;
}
__initfunc(static void no_387(char *s, int *ints))
{
- hard_math = 0;
+ boot_cpu_data.hard_math = 0;
__asm__("movl %%cr0,%%eax\n\t"
"orl $0xE,%%eax\n\t"
"movl %%eax,%%cr0\n\t" : : : "ax");
@@ -49,7 +49,7 @@ __initfunc(static void check_fpu(void))
{
unsigned short control_word;
- if (!hard_math) {
+ if (!boot_cpu_data.hard_math) {
#ifndef CONFIG_MATH_EMULATION
printk(KERN_EMERG "No coprocessor found and no math emulation present.\n");
printk(KERN_EMERG "Giving up.\n");
@@ -91,9 +91,9 @@ __initfunc(static void check_fpu(void))
"fistpl %0\n\t"
"fwait\n\t"
"fninit"
- : "=m" (*&fdiv_bug)
+ : "=m" (*&boot_cpu_data.fdiv_bug)
: "m" (*&x), "m" (*&y));
- if (!fdiv_bug)
+ 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");
@@ -102,7 +102,7 @@ __initfunc(static void check_fpu(void))
__initfunc(static void check_hlt(void))
{
printk(KERN_INFO "Checking 'hlt' instruction... ");
- if (!hlt_works_ok) {
+ if (!boot_cpu_data.hlt_works_ok) {
printk("disabled\n");
return;
}
@@ -117,7 +117,7 @@ __initfunc(static void check_tlb(void))
* The 386 chips don't support TLB finegrained invalidation.
* They will fault when they hit an invlpg instruction.
*/
- if (x86 == 3) {
+ if (boot_cpu_data.x86 == 3) {
printk(KERN_EMERG "CPU is a 386 and this kernel was compiled for 486 or better.\n");
printk("Giving up.\n");
for (;;) ;
@@ -152,17 +152,53 @@ __initfunc(static void check_popad(void))
* misexecution of code under Linux. Owners of such processors should
* contact AMD for precise details and a CPU swap.
*
- * See http://www.creaweb.fr/bpc/k6bug_faq.html
+ * See http://www.chorus.com/~poulot/k6bug.html
* http://www.amd.com/K6/k6docs/revgd.html
+ *
+ * The following test is erm.. interesting. AMD neglected to up
+ * the chip setting when fixing the bug but they also tweaked some
+ * performance at the same time..
*/
+extern void vide(void);
+__asm__(".align 4\nvide: ret");
+
__initfunc(static void check_amd_k6(void))
{
- /* B Step AMD K6 */
- if(x86_model==6 && x86_mask==1 && memcmp(x86_vendor_id, "AuthenticAMD", 12)==0)
+ if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
+ boot_cpu_data.x86_model == 6 &&
+ boot_cpu_data.x86_mask == 1)
{
- printk(KERN_INFO "AMD K6 stepping B detected - system stability may be impaired. Please see.\n");
- printk(KERN_INFO "http://www.creaweb.fr/bpc/k6bug_faq.html");
+ int n;
+ void (*f_vide)(void);
+ unsigned long d, d2;
+
+ printk(KERN_INFO "AMD K6 stepping B detected - ");
+
+#define K6_BUG_LOOP 1000000
+
+ /*
+ * It looks like AMD fixed the 2.6.2 bug and improved indirect
+ * calls at the same time.
+ */
+
+ n = K6_BUG_LOOP;
+ f_vide = vide;
+ __asm__ ("rdtsc" : "=a" (d));
+ while (n--)
+ f_vide();
+ __asm__ ("rdtsc" : "=a" (d2));
+ d = d2-d;
+
+ /* Knock these two lines out if it debugs out ok */
+ printk(KERN_INFO "K6 BUG %ld %d (Report these if test report is incorrect)\n", d, 20*K6_BUG_LOOP);
+ printk(KERN_INFO "AMD K6 stepping B detected - ");
+ /* -- cut here -- */
+ if (d > 20*K6_BUG_LOOP)
+ printk(KERN_INFO "system stability may be impaired when more than 32 MB are used.\n");
+ else
+ printk(KERN_INFO "probably OK (after B9730xxxx).\n");
+ printk(KERN_INFO "Please see http://www.chorus.com/bpc/k6bug.html\n");
}
}
@@ -171,30 +207,33 @@ __initfunc(static void check_amd_k6(void))
* have the F0 0F bug, which lets nonpriviledged users lock up the system:
*/
-extern int pentium_f00f_bug;
extern void trap_init_f00f_bug(void);
-
__initfunc(static void check_pentium_f00f(void))
{
/*
* Pentium and Pentium MMX
*/
- pentium_f00f_bug = 0;
- if (x86==5 && !memcmp(x86_vendor_id, "GenuineIntel", 12)) {
+ boot_cpu_data.f00f_bug = 0;
+ if (boot_cpu_data.x86 == 5 && boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
printk(KERN_INFO "Intel Pentium with F0 0F bug - workaround enabled.\n");
- pentium_f00f_bug = 1;
+ boot_cpu_data.f00f_bug = 1;
trap_init_f00f_bug();
}
}
__initfunc(static void check_bugs(void))
{
+ identify_cpu(&boot_cpu_data);
+#ifndef __SMP__
+ printk("CPU: ");
+ print_cpu_info(&boot_cpu_data);
+#endif
check_tlb();
check_fpu();
check_hlt();
check_popad();
check_amd_k6();
check_pentium_f00f();
- system_utsname.machine[1] = '0' + x86;
+ system_utsname.machine[1] = '0' + boot_cpu_data.x86;
}
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index 1eae23267..700bb8233 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -70,4 +70,24 @@ typedef struct user_i387_struct elf_fpregset_t;
pr_reg[15] = regs->esp; \
pr_reg[16] = regs->xss;
+/* This yields a mask that user programs can use to figure out what
+ instruction set this cpu supports. This could be done in userspace,
+ but it's not easy, and we've already done it here. */
+
+#define ELF_HWCAP (boot_cpu_data.x86_capability)
+
+/* This yields a string that ld.so will use to load implementation
+ specific libraries for optimization. This is more specific in
+ intent than poking at uname or /proc/cpuinfo.
+
+ For the moment, we have only optimizations for the Intel generations,
+ but that could change... */
+
+#define ELF_PLATFORM ("i386\0i486\0i586\0i686"+((boot_cpu_data.x86-3)*5))
+
+#ifdef __KERNEL__
+#define SET_PERSONALITY(ex, ibcs2) \
+ current->personality = (ibcs2 ? PER_SVR4 : PER_LINUX)
+#endif
+
#endif
diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h
index eb7272ef6..2b548bb1c 100644
--- a/include/asm-i386/floppy.h
+++ b/include/asm-i386/floppy.h
@@ -3,33 +3,36 @@
#include <linux/vmalloc.h>
+/*
+ * The DMA channel used by the floppy controller cannot access data at
+ * addresses >= 16MB
+ *
+ * Went back to the 1MB limit, as some people had problems with the floppy
+ * driver otherwise. It doesn't matter much for performance anyway, as most
+ * floppy accesses go through the track buffer.
+ */
+#define _CROSS_64KB(a,s,vdma) \
+(!vdma && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
+
+#define CROSS_64KB(a,s) _CROSS_64KB(a,s,use_virtual_dma & 1)
+
+
#define SW fd_routine[use_virtual_dma&1]
+#define CSW fd_routine[can_use_virtual_dma & 1]
#define fd_inb(port) inb_p(port)
#define fd_outb(port,value) outb_p(port,value)
-
-#define fd_enable_dma(channel) SW._enable_dma(channel)
-#define fd_disable_dma(channel) SW._disable_dma(channel)
-#define fd_request_dma(channel) SW._request_dma(channel, "floppy")
-#define fd_free_dma(channel) SW._free_dma(channel)
-#define fd_clear_dma_ff(channel) SW._clear_dma_ff(channel)
-#define fd_set_dma_mode(channel,mode) SW._set_dma_mode(channel, mode)
-#define fd_set_dma_addr(channel,addr) SW._set_dma_addr(channel, addr)
-#define fd_set_dma_count(channel,count) SW._set_dma_count(channel ,count)
+#define fd_request_dma() CSW._request_dma(FLOPPY_DMA,"floppy")
+#define fd_free_dma() CSW._free_dma(FLOPPY_DMA)
#define fd_enable_irq(irq) enable_irq(irq)
#define fd_disable_irq(irq) disable_irq(irq)
-#define fd_cacheflush(addr,size) /* nothing */
-#define fd_request_irq(irq) SW._request_irq(irq, \
- floppy_interrupt, \
- SA_INTERRUPT \
- | SA_SAMPLE_RANDOM, \
- "floppy", NULL)
#define fd_free_irq(irq) free_irq(irq, NULL)
#define fd_get_dma_residue(channel) SW._get_dma_residue(channel)
-
#define fd_dma_mem_alloc(size) SW._dma_mem_alloc(size)
-#define fd_dma_mem_free(addr,size) SW._dma_mem_free(addr,size)
+#define fd_dma_setup(addr, size, mode, io) SW._dma_setup(addr, size, mode, io)
+
+#define FLOPPY_CAN_FALLBACK_ON_NODMA
static int virtual_dma_count=0;
static int virtual_dma_residue=0;
@@ -42,7 +45,7 @@ static void floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
register unsigned char st;
#undef TRACE_FLPY_INT
-#undef NO_FLOPPY_ASSEMBLER
+#define NO_FLOPPY_ASSEMBLER
#ifdef TRACE_FLPY_INT
static int calls=0;
@@ -105,10 +108,10 @@ static void floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
outb_p(*lptr, virtual_dma_port+5);
else
*lptr = inb_p(virtual_dma_port+5);
- st = inb(virtual_dma_port+4);
}
virtual_dma_count = lcount;
virtual_dma_addr = lptr;
+ st = inb(virtual_dma_port+4);
}
#endif
@@ -137,16 +140,13 @@ static void floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
#endif
}
-static void vdma_enable_dma(unsigned int dummy)
-{
- doing_pdma = 1;
-}
-
-static void vdma_disable_dma(unsigned int dummy)
+static void fd_disable_dma(void)
{
+ if(! (can_use_virtual_dma & 1))
+ disable_dma(FLOPPY_DMA);
doing_pdma = 0;
virtual_dma_residue += virtual_dma_count;
- virtual_dma_count=0;
+ virtual_dma_count=0;
}
static int vdma_request_dma(unsigned int dmanr, const char * device_id)
@@ -158,26 +158,6 @@ static void vdma_nop(unsigned int dummy)
{
}
-static void vdma_set_dma_mode(unsigned int dummy,char mode)
-{
- virtual_dma_mode = (mode == DMA_MODE_WRITE);
-}
-
-static void hset_dma_addr(unsigned int no, char *addr)
-{
- set_dma_addr(no, virt_to_bus(addr));
-}
-
-static void vdma_set_dma_addr(unsigned int dummy, char *addr)
-{
- virtual_dma_addr = addr;
-}
-
-static void vdma_set_dma_count(unsigned int dummy,unsigned int count)
-{
- virtual_dma_count = count;
- virtual_dma_residue = 0;
-}
static int vdma_get_dma_residue(unsigned int dummy)
{
@@ -185,13 +165,15 @@ static int vdma_get_dma_residue(unsigned int dummy)
}
-static int vdma_request_irq(unsigned int irq,
- void (*handler)(int, void *, struct pt_regs *),
- unsigned long flags,
- const char *device,
- void *dev_id)
+static int fd_request_irq(void)
{
- return request_irq(irq, floppy_hardint,SA_INTERRUPT,device, dev_id);
+ if(can_use_virtual_dma)
+ return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
+ "floppy", NULL);
+ else
+ return request_irq(FLOPPY_IRQ, floppy_interrupt,
+ SA_INTERRUPT|SA_SAMPLE_RANDOM,
+ "floppy", NULL);
}
@@ -214,73 +196,94 @@ static unsigned long dma_mem_alloc(unsigned long size)
return __get_dma_pages(GFP_KERNEL,__get_order(size));
}
-static void dma_mem_free(unsigned long addr, unsigned long size)
-{
- free_pages(addr, __get_order(size));
-}
static unsigned long vdma_mem_alloc(unsigned long size)
{
return (unsigned long) vmalloc(size);
+
}
-static void vdma_mem_free(unsigned long addr, unsigned long size)
+#define nodma_mem_alloc(size) vdma_mem_alloc(size)
+
+static void _fd_dma_mem_free(unsigned long addr, unsigned long size)
+{
+ if((unsigned int) addr >= (unsigned int) high_memory)
+ return vfree((void *)addr);
+ else
+ free_pages(addr, __get_order(size));
+}
+
+#define fd_dma_mem_free(addr, size) _fd_dma_mem_free(addr, size)
+
+static void _fd_chose_dma_mode(char *addr, unsigned long size)
+{
+ if(can_use_virtual_dma == 2) {
+ if((unsigned int) addr >= (unsigned int) high_memory ||
+ virt_to_bus(addr) >= 0x1000000 ||
+ _CROSS_64KB(addr, size, 0))
+ use_virtual_dma = 1;
+ else
+ use_virtual_dma = 0;
+ } else {
+ use_virtual_dma = can_use_virtual_dma & 1;
+ }
+}
+
+#define fd_chose_dma_mode(addr, size) _fd_chose_dma_mode(addr, size)
+
+
+static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
{
- return vfree((void *)addr);
+ doing_pdma = 1;
+ virtual_dma_port = io;
+ virtual_dma_mode = (mode == DMA_MODE_WRITE);
+ virtual_dma_addr = addr;
+ virtual_dma_count = size;
+ virtual_dma_residue = 0;
+ return 0;
+}
+
+static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
+{
+#ifdef FLOPPY_SANITY_CHECK
+ if (CROSS_64KB(addr, size)) {
+ printk("DMA crossing 64-K boundary %p-%p\n", addr, addr+size);
+ return -1;
+ }
+#endif
+ /* actual, physical DMA */
+ doing_pdma = 0;
+ clear_dma_ff(FLOPPY_DMA);
+ set_dma_mode(FLOPPY_DMA,mode);
+ set_dma_addr(FLOPPY_DMA,virt_to_bus(addr));
+ set_dma_count(FLOPPY_DMA,size);
+ enable_dma(FLOPPY_DMA);
+ return 0;
}
struct fd_routine_l {
- void (*_enable_dma)(unsigned int dummy);
- void (*_disable_dma)(unsigned int dummy);
int (*_request_dma)(unsigned int dmanr, const char * device_id);
void (*_free_dma)(unsigned int dmanr);
- void (*_clear_dma_ff)(unsigned int dummy);
- void (*_set_dma_mode)(unsigned int dummy, char mode);
- void (*_set_dma_addr)(unsigned int dummy, char *addr);
- void (*_set_dma_count)(unsigned int dummy, unsigned int count);
int (*_get_dma_residue)(unsigned int dummy);
- int (*_request_irq)(unsigned int irq,
- void (*handler)(int, void *, struct pt_regs *),
- unsigned long flags,
- const char *device,
- void *dev_id);
unsigned long (*_dma_mem_alloc) (unsigned long size);
- void (*_dma_mem_free)(unsigned long addr, unsigned long size);
+ int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
} fd_routine[] = {
{
- enable_dma,
- disable_dma,
request_dma,
free_dma,
- clear_dma_ff,
- set_dma_mode,
- hset_dma_addr,
- set_dma_count,
get_dma_residue,
- request_irq,
dma_mem_alloc,
- dma_mem_free
+ hard_dma_setup
},
{
- vdma_enable_dma,
- vdma_disable_dma,
vdma_request_dma,
vdma_nop,
- vdma_nop,
- vdma_set_dma_mode,
- vdma_set_dma_addr,
- vdma_set_dma_count,
vdma_get_dma_residue,
- vdma_request_irq,
vdma_mem_alloc,
- vdma_mem_free
+ vdma_dma_setup
}
};
-__inline__ void virtual_dma_init(void)
-{
- /* Nothing to do on an i386 */
-}
static int FDC1 = 0x3f0;
static int FDC2 = -1;
@@ -293,14 +296,7 @@ static int FDC2 = -1;
#define FLOPPY_MOTOR_MASK 0xf0
-/*
- * The DMA channel used by the floppy controller cannot access data at
- * addresses >= 16MB
- *
- * Went back to the 1MB limit, as some people had problems with the floppy
- * driver otherwise. It doesn't matter much for performance anyway, as most
- * floppy accesses go through the track buffer.
- */
-#define CROSS_64KB(a,s) (((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64) && ! (use_virtual_dma & 1))
+#define AUTO_DMA
+
#endif /* __ASM_I386_FLOPPY_H */
diff --git a/include/asm-i386/hardirq.h b/include/asm-i386/hardirq.h
index 0ceef9108..f679516bb 100644
--- a/include/asm-i386/hardirq.h
+++ b/include/asm-i386/hardirq.h
@@ -4,7 +4,6 @@
#include <linux/tasks.h>
extern unsigned int local_irq_count[NR_CPUS];
-#define in_interrupt() (local_irq_count[smp_processor_id()] != 0)
#ifndef __SMP__
@@ -29,7 +28,7 @@ static inline void release_irqlock(int cpu)
/* if we didn't own the irq lock, just ignore.. */
if (global_irq_holder == (unsigned char) cpu) {
global_irq_holder = NO_PROC_ID;
- global_irq_lock = 0;
+ clear_bit(0,&global_irq_lock);
}
}
@@ -47,26 +46,10 @@ static inline void hardirq_exit(int cpu)
static inline int hardirq_trylock(int cpu)
{
- unsigned long flags;
-
- __save_flags(flags);
- __cli();
- atomic_inc(&global_irq_count);
- if (atomic_read(&global_irq_count) != 1 || test_bit(0,&global_irq_lock)) {
- atomic_dec(&global_irq_count);
- __restore_flags(flags);
- return 0;
- }
- ++local_irq_count[cpu];
- return 1;
+ return !atomic_read(&global_irq_count) && !test_bit(0,&global_irq_lock);
}
-static inline void hardirq_endlock(int cpu)
-{
- __cli();
- hardirq_exit(cpu);
- __sti();
-}
+#define hardirq_endlock(cpu) do { } while (0)
extern void synchronize_irq(void);
diff --git a/include/asm-i386/ioctls.h b/include/asm-i386/ioctls.h
index 7930defbe..1b8af73a4 100644
--- a/include/asm-i386/ioctls.h
+++ b/include/asm-i386/ioctls.h
@@ -47,6 +47,8 @@
#define TIOCSBRK 0x5427 /* BSD compatibility */
#define TIOCCBRK 0x5428 /* BSD compatibility */
#define TIOCGSID 0x5429 /* Return the session ID of FD */
+#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
#define FIOCLEX 0x5451
diff --git a/include/asm-i386/irq.h b/include/asm-i386/irq.h
index b96288a5c..aa9b5be37 100644
--- a/include/asm-i386/irq.h
+++ b/include/asm-i386/irq.h
@@ -4,12 +4,17 @@
/*
* linux/include/asm/irq.h
*
- * (C) 1992, 1993 Linus Torvalds
+ * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
*
- * IRQ/IPI changes taken from work by Thomas Radke <tomsoft@informatik.tu-chemnitz.de>
+ * IRQ/IPI changes taken from work by Thomas Radke
+ * <tomsoft@informatik.tu-chemnitz.de>
*/
+#ifndef __SMP__
#define NR_IRQS 16
+#else
+#define NR_IRQS 24
+#endif
#define TIMER_IRQ 0
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 61d94b8b9..fe0864913 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -200,7 +200,8 @@ static inline void flush_tlb_range(struct mm_struct *mm,
* memory.
*/
#define _PAGE_PRESENT 0x001
-#define _PAGE_RW 0x002
+#define _PAGE_PROTNONE 0x002 /* If not present */
+#define _PAGE_RW 0x002 /* If present */
#define _PAGE_USER 0x004
#define _PAGE_WT 0x008
#define _PAGE_PCD 0x010
@@ -213,7 +214,7 @@ static inline void flush_tlb_range(struct mm_struct *mm,
#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
-#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED)
+#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
@@ -291,7 +292,7 @@ do { \
} while (0)
#define pte_none(x) (!pte_val(x))
-#define pte_present(x) (pte_val(x) & _PAGE_PRESENT)
+#define pte_present(x) (pte_val(x) & (_PAGE_PRESENT | _PAGE_PROTNONE))
#define pte_clear(xp) do { pte_val(*(xp)) = 0; } while (0)
#define pmd_none(x) (!pmd_val(x))
@@ -489,9 +490,9 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma,
{
}
-#define SWP_TYPE(entry) (((entry) >> 1) & 0x7f)
+#define SWP_TYPE(entry) (((entry) >> 2) & 0x3f)
#define SWP_OFFSET(entry) ((entry) >> 8)
-#define SWP_ENTRY(type,offset) (((type) << 1) | ((offset) << 8))
+#define SWP_ENTRY(type,offset) (((type) << 2) | ((offset) << 8))
#define module_map vmalloc
#define module_unmap vfree
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 9e4ca405d..778466bbe 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -12,21 +12,51 @@
#include <asm/segment.h>
/*
- * System setup and hardware bug flags..
- * [Note we don't test the 386 multiply bug or popad bug]
+ * CPU type and hardware bug flags. Kept separately for each CPU.
+ * Members of this structure are referenced in head.S, so think twice
+ * before touching them. [mj]
*/
-extern char hard_math;
-extern char x86; /* lower 4 bits */
-extern char x86_vendor_id[13];
-extern char x86_model; /* lower 4 bits */
-extern char x86_mask; /* lower 4 bits */
-extern int x86_capability; /* field of flags */
-extern int fdiv_bug;
+struct cpuinfo_x86 {
+ __u8 x86; /* CPU family */
+ __u8 x86_vendor; /* CPU vendor */
+ __u8 x86_model;
+ __u8 x86_mask;
+ char wp_works_ok; /* It doesn't on 386's */
+ char hlt_works_ok; /* Problems on some 486Dx4's and old 386's */
+ char hard_math;
+ char rfu;
+ int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */
+ __u32 x86_capability;
+ char x86_vendor_id[16];
+ char x86_model_id[64];
+ int fdiv_bug;
+ int f00f_bug;
+ unsigned long loops_per_sec;
+};
+
+#define X86_VENDOR_INTEL 0
+#define X86_VENDOR_CYRIX 1
+#define X86_VENDOR_AMD 2
+#define X86_VENDOR_UMC 3
+#define X86_VENDOR_NEXGEN 4
+#define X86_VENDOR_CENTAUR 5
+#define X86_VENDOR_UNKNOWN 0xff
+
+extern struct cpuinfo_x86 boot_cpu_data;
+
+#ifdef __SMP__
+extern struct cpuinfo_x86 cpu_data[];
+#define current_cpu_data cpu_data[smp_processor_id()]
+#else
+#define cpu_data &boot_cpu_data
+#define current_cpu_data boot_cpu_data
+#endif
+
extern char ignore_irq13;
-extern char wp_works_ok; /* doesn't work on a 386 */
-extern char hlt_works_ok; /* problems on some 486Dx4's and old 386's */
-extern int have_cpuid; /* We have a CPUID */
+
+extern void identify_cpu(struct cpuinfo_x86 *);
+extern void print_cpu_info(struct cpuinfo_x86 *);
/*
* Bus types (default is ISA, but people can check others with these..)
@@ -142,7 +172,7 @@ struct thread_struct {
_LDT(0),0, \
0, 0x8000, \
{~0, }, /* ioperm */ \
- _TSS(0), 0, 0, 0, KERNEL_DS, \
+ _TSS(0), 0, 0, 0, (mm_segment_t) { 0 } /* obsolete */ , \
{ { 0, }, }, /* 387 state */ \
NULL, 0, 0, 0, 0, 0 /* vm86_info */, \
}
@@ -150,7 +180,7 @@ struct thread_struct {
#define start_thread(regs, new_eip, new_esp) do {\
unsigned long seg = __USER_DS; \
__asm__("mov %w0,%%fs ; mov %w0,%%gs":"=r" (seg) :"0" (seg)); \
- set_fs(MAKE_MM_SEG(seg)); \
+ set_fs(USER_DS); \
regs->xds = seg; \
regs->xes = seg; \
regs->xss = seg; \
@@ -175,7 +205,7 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t)
* NOTE! The task struct and the stack go together
*/
#define alloc_task_struct() \
- ((struct task_struct *) __get_free_pages(GFP_KERNEL,1,0))
+ ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
#define free_task_struct(p) free_pages((unsigned long)(p),1)
#define init_task (init_task_union.task)
diff --git a/include/asm-i386/semaphore.h b/include/asm-i386/semaphore.h
index 3ba3f8af5..a68b23fc6 100644
--- a/include/asm-i386/semaphore.h
+++ b/include/asm-i386/semaphore.h
@@ -21,6 +21,7 @@
#include <asm/system.h>
#include <asm/atomic.h>
+#include <asm/spinlock.h>
struct semaphore {
atomic_t count;
@@ -38,6 +39,8 @@ asmlinkage void __up_wakeup(void /* special register calling convention */);
extern void __down(struct semaphore * sem);
extern void __up(struct semaphore * sem);
+extern spinlock_t semaphore_wake_lock;
+
#define sema_init(sem, val) atomic_set(&((sem)->count), (val))
/*
@@ -55,10 +58,9 @@ static inline void wake_one_more(struct semaphore * sem)
{
unsigned long flags;
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&semaphore_wake_lock, flags);
sem->waking++;
- restore_flags(flags);
+ spin_unlock_irqrestore(&semaphore_wake_lock, flags);
}
static inline int waking_non_zero(struct semaphore *sem)
@@ -66,13 +68,12 @@ static inline int waking_non_zero(struct semaphore *sem)
unsigned long flags;
int ret = 0;
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&semaphore_wake_lock, flags);
if (sem->waking > 0) {
sem->waking--;
ret = 1;
}
- restore_flags(flags);
+ spin_unlock_irqrestore(&semaphore_wake_lock, flags);
return ret;
}
diff --git a/include/asm-i386/signal.h b/include/asm-i386/signal.h
index 5da9ff0ed..598a21008 100644
--- a/include/asm-i386/signal.h
+++ b/include/asm-i386/signal.h
@@ -144,11 +144,18 @@ struct k_sigaction {
/* Here we must cater to libcs that poke about in kernel headers. */
struct sigaction {
- __sighandler_t sa_handler;
+ union {
+ __sighandler_t _sa_handler;
+ void (*_sa_sigaction)(int, struct siginfo *, void *);
+ } _u;
sigset_t sa_mask;
unsigned long sa_flags;
void (*sa_restorer)(void);
};
+
+#define sa_handler _u._sa_handler
+#define sa_sigaction _u._sa_sigaction
+
#endif /* __KERNEL__ */
typedef struct sigaltstack {
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index 0f7ae1224..6fb2e2541 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -149,28 +149,6 @@ struct mpc_config_intlocal
*/
/*
- * Per process x86 parameters
- */
-
-struct cpuinfo_x86
-{
- char hard_math;
- char x86;
- char x86_model;
- char x86_mask;
- char x86_vendor_id[16];
- int x86_capability;
- int fdiv_bug;
- int have_cpuid;
- char wp_works_ok;
- char hlt_works_ok;
- unsigned long udelay_val;
-};
-
-
-extern struct cpuinfo_x86 cpu_data[NR_CPUS];
-
-/*
* Private routines/data
*/
@@ -181,7 +159,6 @@ extern unsigned char *apic_reg;
extern unsigned char boot_cpu_id;
extern unsigned long cpu_present_map;
extern volatile int cpu_number_map[NR_CPUS];
-extern volatile int cpu_logical_map[NR_CPUS];
extern volatile unsigned long smp_invalidate_needed;
extern void smp_flush_tlb(void);
extern volatile unsigned long kernel_flag, kernel_counter;
@@ -193,6 +170,11 @@ extern unsigned long ipi_count;
extern void smp_invalidate_rcv(void); /* Process an NMI */
extern void smp_local_timer_interrupt(struct pt_regs * regs);
extern void setup_APIC_clock (void);
+extern volatile int __cpu_logical_map[NR_CPUS];
+extern inline int cpu_logical_map(int cpu)
+{
+ return __cpu_logical_map[cpu];
+}
/*
@@ -257,5 +239,12 @@ extern __inline int hard_smp_processor_id(void)
#define SMP_FROM_INT 1
#define SMP_FROM_SYSCALL 2
+#else
+#ifndef ASSEMBLY
+extern inline int cpu_logical_map(int cpu)
+{
+ return cpu;
+}
+#endif
#endif
#endif
diff --git a/include/asm-i386/socket.h b/include/asm-i386/socket.h
index e09eaea21..1a2ae578f 100644
--- a/include/asm-i386/socket.h
+++ b/include/asm-i386/socket.h
@@ -35,6 +35,10 @@
#define SO_BINDTODEVICE 25
+/* Socket filtering */
+#define SO_ATTACH_FILTER 26
+#define SO_DETACH_FILTER 27
+
/* Socket types. */
#define SOCK_STREAM 1 /* stream (connection) socket */
#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
diff --git a/include/asm-i386/softirq.h b/include/asm-i386/softirq.h
index 07a678435..008edf305 100644
--- a/include/asm-i386/softirq.h
+++ b/include/asm-i386/softirq.h
@@ -4,6 +4,8 @@
#include <asm/atomic.h>
#include <asm/hardirq.h>
+extern unsigned int local_bh_count[NR_CPUS];
+
#define get_active_bhs() (bh_mask & bh_active)
#define clear_active_bhs(x) atomic_clear_mask((x),&bh_active)
@@ -25,22 +27,6 @@ extern inline void mark_bh(int nr)
set_bit(nr, &bh_active);
}
-/*
- * These use a mask count to correctly handle
- * nested disable/enable calls
- */
-extern inline void disable_bh(int nr)
-{
- bh_mask &= ~(1 << nr);
- bh_mask_count[nr]++;
-}
-
-extern inline void enable_bh(int nr)
-{
- if (!--bh_mask_count[nr])
- bh_mask |= 1 << nr;
-}
-
#ifdef __SMP__
/*
@@ -48,52 +34,77 @@ extern inline void enable_bh(int nr)
* is entirely private to an implementation, it should not be
* referenced at all outside of this file.
*/
-extern atomic_t __intel_bh_counter;
+extern atomic_t global_bh_lock;
+extern atomic_t global_bh_count;
-extern inline void start_bh_atomic(void)
+extern void synchronize_bh(void);
+
+static inline void start_bh_atomic(void)
{
- atomic_inc(&__intel_bh_counter);
- synchronize_irq();
+ atomic_inc(&global_bh_lock);
+ synchronize_bh();
}
-extern inline void end_bh_atomic(void)
+static inline void end_bh_atomic(void)
{
- atomic_dec(&__intel_bh_counter);
+ atomic_dec(&global_bh_lock);
}
/* These are for the irq's testing the lock */
-static inline int softirq_trylock(void)
+static inline int softirq_trylock(int cpu)
{
- atomic_inc(&__intel_bh_counter);
- if (atomic_read(&__intel_bh_counter) != 1) {
- atomic_dec(&__intel_bh_counter);
- return 0;
+ if (!test_and_set_bit(0,&global_bh_count)) {
+ if (atomic_read(&global_bh_lock) == 0) {
+ ++local_bh_count[cpu];
+ return 1;
+ }
+ clear_bit(0,&global_bh_count);
}
- return 1;
+ return 0;
}
-#define softirq_endlock() atomic_dec(&__intel_bh_counter)
+static inline void softirq_endlock(int cpu)
+{
+ local_bh_count[cpu]--;
+ clear_bit(0,&global_bh_count);
+}
#else
-extern int __intel_bh_counter;
-
extern inline void start_bh_atomic(void)
{
- __intel_bh_counter++;
+ local_bh_count[smp_processor_id()]++;
barrier();
}
extern inline void end_bh_atomic(void)
{
barrier();
- __intel_bh_counter--;
+ local_bh_count[smp_processor_id()]--;
}
/* These are for the irq's testing the lock */
-#define softirq_trylock() (__intel_bh_counter ? 0 : (__intel_bh_counter=1))
-#define softirq_endlock() (__intel_bh_counter = 0)
+#define softirq_trylock(cpu) (local_bh_count[cpu] ? 0 : (local_bh_count[cpu]=1))
+#define softirq_endlock(cpu) (local_bh_count[cpu] = 0)
+#define synchronize_bh() do { } while (0)
#endif /* SMP */
+/*
+ * These use a mask count to correctly handle
+ * nested disable/enable calls
+ */
+extern inline void disable_bh(int nr)
+{
+ bh_mask &= ~(1 << nr);
+ bh_mask_count[nr]++;
+ synchronize_bh();
+}
+
+extern inline void enable_bh(int nr)
+{
+ if (!--bh_mask_count[nr])
+ bh_mask |= 1 << nr;
+}
+
#endif /* __ASM_SOFTIRQ_H */
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index af6cf8c9c..48c586d6c 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -64,12 +64,11 @@ typedef struct { } rwlock_t;
typedef struct {
volatile unsigned int lock;
- unsigned long previous;
} spinlock_t;
-#define SPIN_LOCK_UNLOCKED { 0, 0 }
+#define SPIN_LOCK_UNLOCKED { 0 }
-#define spin_lock_init(x) do { (x)->lock = 0; (x)->previous = 0; } while(0)
+#define spin_lock_init(x) do { (x)->lock = 0; } while(0)
#define spin_unlock_wait(x) do { barrier(); } while(((volatile spinlock_t *)(x))->lock)
typedef struct { unsigned long a[100]; } __dummy_lock_t;
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 738268052..e940c7c6f 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -11,13 +11,18 @@
* 3 - kernel data segment
* 4 - user code segment
* 5 - user data segment
- * ...
- * 8 - TSS #0
- * 9 - LDT #0
- * 10 - TSS #1
- * 11 - LDT #1
+ * 6 - not used
+ * 7 - not used
+ * 8 - APM BIOS support
+ * 9 - APM BIOS support
+ * 10 - APM BIOS support
+ * 11 - APM BIOS support
+ * 12 - TSS #0
+ * 13 - LDT #0
+ * 14 - TSS #1
+ * 15 - LDT #1
*/
-#define FIRST_TSS_ENTRY 8
+#define FIRST_TSS_ENTRY 12
#define FIRST_LDT_ENTRY (FIRST_TSS_ENTRY+1)
#define _TSS(n) ((((unsigned long) n)<<4)+(FIRST_TSS_ENTRY<<3))
#define _LDT(n) ((((unsigned long) n)<<4)+(FIRST_LDT_ENTRY<<3))
diff --git a/include/asm-i386/types.h b/include/asm-i386/types.h
index 71309ac82..d792546f9 100644
--- a/include/asm-i386/types.h
+++ b/include/asm-i386/types.h
@@ -39,6 +39,8 @@ typedef unsigned int u32;
typedef signed long long s64;
typedef unsigned long long u64;
+#define BITS_PER_LONG 32
+
#endif /* __KERNEL__ */
#endif
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index 0ac6380fd..ef08ac510 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -18,49 +18,43 @@
*/
#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
-#define KERNEL_DS MAKE_MM_SEG(0)
-#define USER_DS MAKE_MM_SEG(3)
+
+
+#define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF)
+#define USER_DS MAKE_MM_SEG(0xC0000000)
#define get_ds() (KERNEL_DS)
-#define get_fs() (current->tss.segment)
-#define set_fs(x) (current->tss.segment = (x))
+#define get_fs() (current->addr_limit)
+#define set_fs(x) (current->addr_limit = (x))
#define segment_eq(a,b) ((a).seg == (b).seg)
+extern int __verify_write(const void *, unsigned long);
+
+#define __addr_ok(addr) ((unsigned long)(addr) < (current->addr_limit.seg))
/*
- * Address Ok:
- *
- * segment
- * 00 (kernel) 11 (user)
- *
- * high 00 1 1
- * two 01 1 1
- * bits of 10 1 1
- * address 11 1 0
+ * Uhhuh, this needs 33-bit arithmetic. We have a carry..
*/
-#define __addr_ok(x) \
- ((((unsigned long)(x)>>30)&get_fs().seg) != 3)
+#define __range_ok(addr,size) ({ \
+ unsigned long flag,sum; \
+ asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \
+ :"=&r" (flag), "=r" (sum) \
+ :"1" (addr),"g" (size),"g" (current->addr_limit.seg)); \
+ flag; })
-#define __user_ok(addr,size) \
- ((size <= 0xC0000000UL) && (addr <= 0xC0000000UL - size))
-#define __kernel_ok \
- (!get_fs().seg)
+#if CPU > 386
-extern int __verify_write(const void *, unsigned long);
+#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
-#if CPU > 386
-#define __access_ok(type,addr,size) \
- (__kernel_ok || __user_ok(addr,size))
#else
-#define __access_ok(type,addr,size) \
- (__kernel_ok || (__user_ok(addr,size) && \
- ((type) == VERIFY_READ || wp_works_ok || \
- __verify_write((void *)(addr),(size)))))
-#endif /* CPU */
-#define access_ok(type,addr,size) \
- __access_ok((type),(unsigned long)(addr),(size))
+#define access_ok(type,addr,size) ( (__range_ok(addr,size) == 0) && \
+ ((type) == VERIFY_READ || boot_cpu_data.wp_works_ok || \
+ segment_eq(get_fs(),KERNEL_DS) || \
+ __verify_write((void *)(addr),(size))))
+
+#endif /* CPU */
extern inline int verify_area(int type, const void * addr, unsigned long size)
{
@@ -104,38 +98,57 @@ extern unsigned long search_exception_table(unsigned long);
* with a separate "access_ok()" call (this is used when we do multiple
* accesses to the same area of user memory).
*/
-#define get_user(x,ptr) \
- __get_user_check((x),(ptr),sizeof(*(ptr)))
-#define put_user(x,ptr) \
- __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
+
+extern void __get_user_1(void);
+extern void __get_user_2(void);
+extern void __get_user_4(void);
+
+#define __get_user_x(size,ret,x,ptr) \
+ __asm__ __volatile__("call __get_user_" #size \
+ :"=a" (ret),"=d" (x) \
+ :"0" (ptr))
+
+/* Careful: we have to cast the result to the type of the pointer for sign reasons */
+#define get_user(x,ptr) \
+({ int __ret_gu,__val_gu; \
+ switch(sizeof (*(ptr))) { \
+ case 1: __get_user_x(1,__ret_gu,__val_gu,ptr); break; \
+ case 2: __get_user_x(2,__ret_gu,__val_gu,ptr); break; \
+ case 4: __get_user_x(4,__ret_gu,__val_gu,ptr); break; \
+ default: __get_user_x(X,__ret_gu,__val_gu,ptr); break; \
+ } \
+ (x) = (__typeof__(*(ptr)))__val_gu; \
+ __ret_gu; \
+})
+
+extern void __put_user_1(void);
+extern void __put_user_2(void);
+extern void __put_user_4(void);
+
+extern void __put_user_bad(void);
+
+#define __put_user_x(size,ret,x,ptr) \
+ __asm__ __volatile__("call __put_user_" #size \
+ :"=a" (ret) \
+ :"0" (ptr),"d" (x) \
+ :"cx")
+
+#define put_user(x,ptr) \
+({ int __ret_pu; \
+ switch(sizeof (*(ptr))) { \
+ case 1: __put_user_x(1,__ret_pu,(__typeof__(*(ptr)))(x),ptr); break; \
+ case 2: __put_user_x(2,__ret_pu,(__typeof__(*(ptr)))(x),ptr); break; \
+ case 4: __put_user_x(4,__ret_pu,(__typeof__(*(ptr)))(x),ptr); break; \
+ default: __put_user_x(X,__ret_pu,x,ptr); break; \
+ } \
+ __ret_pu; \
+})
#define __get_user(x,ptr) \
__get_user_nocheck((x),(ptr),sizeof(*(ptr)))
#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) \
({ \
long __pu_err; \
@@ -143,15 +156,6 @@ extern long __put_user_bad(void);
__pu_err; \
})
-#define __put_user_check(x,ptr,size) \
-({ \
- long __pu_err = -EFAULT; \
- __typeof__(*(ptr)) *__pu_addr = (ptr); \
- if (access_ok(VERIFY_WRITE,__pu_addr,size)) \
- __put_user_size((x),__pu_addr,(size),__pu_err); \
- __pu_err; \
-})
-
#define __put_user_size(x,ptr,size,retval) \
do { \
retval = 0; \
@@ -195,16 +199,6 @@ struct __large_struct { unsigned long buf[100]; };
__gu_err; \
})
-#define __get_user_check(x,ptr,size) \
-({ \
- long __gu_err = -EFAULT, __gu_val = 0; \
- const __typeof__(*(ptr)) *__gu_addr = (ptr); \
- if (access_ok(VERIFY_READ,__gu_addr,size)) \
- __get_user_size(__gu_val,__gu_addr,(size),__gu_err); \
- (x) = (__typeof__(*(ptr)))__gu_val; \
- __gu_err; \
-})
-
extern long __get_user_bad(void);
#define __get_user_size(x,ptr,size,retval) \
@@ -234,6 +228,20 @@ 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
@@ -255,10 +263,28 @@ do { \
" .long 0b,3b\n" \
" .long 1b,2b\n" \
".previous" \
- : "=c"(size) \
+ : "=&c"(size) \
: "r"(size & 3), "0"(size / 4), "D"(to), "S"(from) \
: "di", "si", "memory")
+/* We let the __ versions of copy_from/to_user inline, because they're often
+ * used in fast paths and have only a small space overhead.
+ */
+static inline unsigned long
+__generic_copy_from_user_nocheck(void *to, const void *from, unsigned long n)
+{
+ __copy_user(to,from,n);
+ return n;
+}
+
+static inline unsigned long
+__generic_copy_to_user_nocheck(void *to, const void *from, unsigned long n)
+{
+ __copy_user(to,from,n);
+ return n;
+}
+
+
/* Optimize just a little bit when we know the size of the move. */
#define __constant_copy_user(to, from, size) \
do { \
@@ -342,13 +368,8 @@ do { \
} \
} while (0)
-static inline unsigned long
-__generic_copy_to_user(void *to, const void *from, unsigned long n)
-{
- if (access_ok(VERIFY_WRITE, to, n))
- __copy_user(to,from,n);
- return n;
-}
+unsigned long __generic_copy_to_user(void *, const void *, unsigned long);
+unsigned long __generic_copy_from_user(void *, const void *, unsigned long);
static inline unsigned long
__constant_copy_to_user(void *to, const void *from, unsigned long n)
@@ -359,14 +380,6 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n)
}
static inline unsigned long
-__generic_copy_from_user(void *to, const void *from, unsigned long n)
-{
- if (access_ok(VERIFY_READ, from, n))
- __copy_user(to,from,n);
- return n;
-}
-
-static inline unsigned long
__constant_copy_from_user(void *to, const void *from, unsigned long n)
{
if (access_ok(VERIFY_READ, from, n))
@@ -375,13 +388,6 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n)
}
static inline unsigned long
-__generic_copy_to_user_nocheck(void *to, const void *from, unsigned long n)
-{
- __copy_user(to,from,n);
- return n;
-}
-
-static inline unsigned long
__constant_copy_to_user_nocheck(void *to, const void *from, unsigned long n)
{
__constant_copy_user(to,from,n);
@@ -389,13 +395,6 @@ __constant_copy_to_user_nocheck(void *to, const void *from, unsigned long n)
}
static inline unsigned long
-__generic_copy_from_user_nocheck(void *to, const void *from, unsigned long n)
-{
- __copy_user(to,from,n);
- return n;
-}
-
-static inline unsigned long
__constant_copy_from_user_nocheck(void *to, const void *from, unsigned long n)
{
__constant_copy_user(to,from,n);
@@ -412,15 +411,9 @@ __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_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_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) ? \
@@ -432,116 +425,10 @@ if (copy_from_user(to,from,n)) \
__constant_copy_from_user_nocheck((to),(from),(n)) : \
__generic_copy_from_user_nocheck((to),(from),(n)))
-
-/*
- * Zero Userspace
- */
-
-#define __do_clear_user(addr,size) \
- __asm__ __volatile__( \
- "0: rep; stosl\n" \
- " movl %1,%0\n" \
- "1: rep; stosb\n" \
- "2:\n" \
- ".section .fixup,\"ax\"\n" \
- "3: lea 0(%1,%0,4),%0\n" \
- " jmp 2b\n" \
- ".previous\n" \
- ".section __ex_table,\"a\"\n" \
- " .align 4\n" \
- " .long 0b,3b\n" \
- " .long 1b,2b\n" \
- ".previous" \
- : "=c"(size) \
- : "r"(size & 3), "0"(size / 4), "D"(addr), "a"(0) \
- : "di")
-
-static inline unsigned long
-clear_user(void *to, unsigned long n)
-{
- if (access_ok(VERIFY_WRITE, to, n))
- __do_clear_user(to, n);
- return n;
-}
-
-static inline unsigned long
-__clear_user(void *to, unsigned long n)
-{
- __do_clear_user(to, n);
- return n;
-}
-
-
-/*
- * Copy a null terminated string from userspace.
- */
-
-#define __do_strncpy_from_user(dst,src,count,res) \
- __asm__ __volatile__( \
- " testl %1,%1\n" \
- " jz 2f\n" \
- "0: lodsb\n" \
- " stosb\n" \
- " testb %%al,%%al\n" \
- " jz 1f\n" \
- " decl %1\n" \
- " jnz 0b\n" \
- "1: subl %1,%0\n" \
- "2:\n" \
- ".section .fixup,\"ax\"\n" \
- "3: movl %2,%0\n" \
- " jmp 2b\n" \
- ".previous\n" \
- ".section __ex_table,\"a\"\n" \
- " .align 4\n" \
- " .long 0b,3b\n" \
- ".previous" \
- : "=d"(res), "=c"(count) \
- : "i"(-EFAULT), "0"(count), "1"(count), "S"(src), "D"(dst) \
- : "si", "di", "ax", "memory")
-
-static inline long
-__strncpy_from_user(char *dst, const char *src, long count)
-{
- long res;
- __do_strncpy_from_user(dst, src, count, res);
- return res;
-}
-
-static inline long
-strncpy_from_user(char *dst, const char *src, long count)
-{
- long res = -EFAULT;
- if (access_ok(VERIFY_READ, src, 1))
- __do_strncpy_from_user(dst, src, count, res);
- return res;
-}
-
-/*
- * Return the size of a string (including the ending 0)
- *
- * Return 0 for error
- */
-
-extern inline long strlen_user(const char *s)
-{
- unsigned long res;
-
- __asm__ __volatile__(
- "0: repne; scasb\n"
- " notl %0\n"
- "1:\n"
- ".section .fixup,\"ax\"\n"
- "2: xorl %0,%0\n"
- " jmp 1b\n"
- ".previous\n"
- ".section __ex_table,\"a\"\n"
- " .align 4\n"
- " .long 0b,2b\n"
- ".previous"
- :"=c" (res), "=D" (s)
- :"1" (s), "a" (0), "0" (-__addr_ok(s)));
- return res & -__addr_ok(s);
-}
+long strncpy_from_user(char *dst, const char *src, long count);
+long __strncpy_from_user(char *dst, const char *src, long count);
+long strlen_user(const char *str);
+unsigned long clear_user(void *mem, unsigned long len);
+unsigned long __clear_user(void *mem, unsigned long len);
#endif /* __i386_UACCESS_H */
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index 1a45b75c3..53766f701 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -21,7 +21,7 @@
#define __NR_time 13
#define __NR_mknod 14
#define __NR_chmod 15
-#define __NR_chown 16
+#define __NR_lchown 16
#define __NR_break 17
#define __NR_oldstat 18
#define __NR_lseek 19
@@ -187,6 +187,7 @@
#define __NR_rt_sigsuspend 179
#define __NR_pread 180
#define __NR_pwrite 181
+#define __NR_chown 182
/* user-visible error numbers are in the range -1 - -122: see <asm-i386/errno.h> */
diff --git a/include/asm-m68k/amigahw.h b/include/asm-m68k/amigahw.h
index a7b6c8609..caaa8d0de 100644
--- a/include/asm-m68k/amigahw.h
+++ b/include/asm-m68k/amigahw.h
@@ -103,6 +103,7 @@ struct amiga_hw_present {
AMIGAHW_DECLARE(ALICE_PAL); /* PAL Alice (8374) */
AMIGAHW_DECLARE(ALICE_NTSC); /* NTSC Alice (8374) */
AMIGAHW_DECLARE(MAGIC_REKICK); /* A3000 Magic Hard Rekick */
+ AMIGAHW_DECLARE(PCMCIA); /* PCMCIA Slot */
AMIGAHW_DECLARE(ZORRO); /* Zorro AutoConfig */
AMIGAHW_DECLARE(ZORRO3); /* Zorro III */
};
diff --git a/include/asm-m68k/amigamouse.h b/include/asm-m68k/amigamouse.h
deleted file mode 100644
index 7f90cff41..000000000
--- a/include/asm-m68k/amigamouse.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef _ASMm68k_AMIGAMOUSE_H
-#define _ASMm68k_AMIGAMOUSE_H
-
-/*
- * linux/include/asm-m68k/amigamouse.h: header file for Amiga Mouse driver
- * by Michael Rausch
- */
-
-/*
-#define MSE_INT_OFF() outb(MSE_DISABLE_INTERRUPTS, MSE_CONTROL_PORT)
-#define MSE_INT_ON() outb(MSE_ENABLE_INTERRUPTS, MSE_CONTROL_PORT)
-*/
-
-struct mouse_status {
- unsigned char buttons;
- unsigned char latch_buttons;
- int dx;
- int dy;
- int present;
- int ready;
- int active;
- struct wait_queue *wait;
- struct fasync_struct *fasyncptr;
-};
-
-#endif
diff --git a/include/asm-m68k/amihdreg.h b/include/asm-m68k/amihdreg.h
deleted file mode 100644
index 8e5a0d34d..000000000
--- a/include/asm-m68k/amihdreg.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _LINUX_AMIHDREG_H
-#define _LINUX_AMIHDREG_H
-
-/*
- * This file contains some defines for the Amiga IDE hd controller.
- * Various sources. Check out some definitions (see comments with
- * a ques).
- */
-
-#define IDE_DISABLE_IRQ 0x02
-#define IDE_ENABLE_IRQ 0x00
-
-/* Bases of the hard drive controller */
-#define HD_BASE_A4000 0xdd2020
-#define HD_BASE_A1200 0xda0000
-
-/* Offsets from one of the above bases */
-#define AMI_HD_ERROR (0x06) /* see err-bits */
-#define AMI_HD_NSECTOR (0x0a) /* nr of sectors to read/write */
-#define AMI_HD_SECTOR (0x0e) /* starting sector */
-#define AMI_HD_LCYL (0x12) /* starting cylinder */
-#define AMI_HD_HCYL (0x16) /* high byte of starting cyl */
-#define AMI_HD_SELECT (0x1a) /* 101dhhhh , d=drive, hhhh=head */
-#define AMI_HD_STATUS (0x1e) /* see status-bits */
-#define AMI_HD_CMD (0x101a)
-
-/* These are at different offsets from the base */
-#define HD_A4000_IRQ (0xdd3020) /* MSB = 1, Harddisk is source of interrupt */
-#define HD_A1200_IRQ (0xda9000) /* MSB = 1, Harddisk is source of interrupt */
-
-#endif
diff --git a/include/asm-m68k/apollohw.h b/include/asm-m68k/apollohw.h
new file mode 100644
index 000000000..54177aa3d
--- /dev/null
+++ b/include/asm-m68k/apollohw.h
@@ -0,0 +1,71 @@
+/* apollohw.h : some structures to access apollo HW */
+
+#ifndef _ASMm68k_APOLLOHW_H_
+#define _ASMm68k_APOLLOHW_H_
+
+
+/*
+ see scn2681 data sheet for more info.
+ member names are read_write.
+*/
+
+#define DECLARE_2681_FIELD(x) unsigned char x; unsigned char dummy##x
+
+struct SCN2681 {
+
+ DECLARE_2681_FIELD(mra);
+ DECLARE_2681_FIELD(sra_csra);
+ DECLARE_2681_FIELD(BRGtest_cra);
+ DECLARE_2681_FIELD(rhra_thra);
+ DECLARE_2681_FIELD(ipcr_acr);
+ DECLARE_2681_FIELD(isr_imr);
+ DECLARE_2681_FIELD(ctu_ctur);
+ DECLARE_2681_FIELD(ctl_ctlr);
+ DECLARE_2681_FIELD(mrb);
+ DECLARE_2681_FIELD(srb_csrb);
+ DECLARE_2681_FIELD(tst_crb);
+ DECLARE_2681_FIELD(rhrb_thrb);
+ DECLARE_2681_FIELD(reserved);
+ DECLARE_2681_FIELD(ip_opcr);
+ DECLARE_2681_FIELD(startCnt_setOutBit);
+ DECLARE_2681_FIELD(stopCnt_resetOutBit);
+
+};
+
+#if 0
+struct mc146818 {
+
+ unsigned int second1:4, second2:4, alarm_second1:4, alarm_second2:4,
+ minute1:4, minute2:4, alarm_minute1:4, alarm_minute2:4;
+ unsigned int hours1:4, hours2:4, alarm_hours1:4, alarm_hours2:4,
+ day_of_week1:4, day_of_week2:4, day_of_month1:4, day_of_month2:4;
+ unsigned int month1:4, month2:4, year1:4, year2:4, :16;
+
+};
+#endif
+
+struct mc146818 {
+ unsigned char second, alarm_second;
+ unsigned char minute, alarm_minute;
+ unsigned char hours, alarm_hours;
+ unsigned char day_of_week, day_of_month;
+ unsigned char month, year;
+};
+
+#define IO_BASE 0x80000000
+
+#define SIO01_PHYSADDR 0x10400
+#define SIO23_PHYSADDR 0x10500
+#define RTC_PHYSADDR 0x10900
+#define PICA 0x11000
+#define PICB 0x11100
+#define sio01 ((*(volatile struct SCN2681 *)(IO_BASE + SIO01_PHYSADDR)))
+#define sio23 ((*(volatile struct SCN2681 *)(IO_BASE + SIO01_PHYSADDR)))
+#define rtc (((volatile struct mc146818 *)(IO_BASE + RTC_PHYSADDR)))
+
+#define inb(addr) (*((volatile unsigned char *)(addr)))
+#define outb(val,addr) (*((volatile unsigned char *)(addr)) = (val))
+#define inw(addr) (*((volatile unsigned short *)(addr)))
+#define outw(val,addr) (*((volatile unsigned short *)(addr)) = (val))
+
+#endif
diff --git a/include/asm-m68k/atari_SCCserial.h b/include/asm-m68k/atari_SCCserial.h
index fc08d4009..0ab7c15d0 100644
--- a/include/asm-m68k/atari_SCCserial.h
+++ b/include/asm-m68k/atari_SCCserial.h
@@ -28,6 +28,10 @@
#define SCC_BAUD_BASE_NONE 0 /* for not connected or unused
* clock sources */
+#define SCC_BAUD_BASE_MVME_PCLK 781250 /* 12.5 MHz */
+#define SCC_BAUD_BASE_BVM 460800 /* 7.3728 MHz */
+#define SCC_BAUD_BASE_MVME 625000 /* 10.000 MHz */
+
/* The SCC configuration structure */
struct atari_SCCserial {
diff --git a/include/asm-m68k/atari_rootsec.h b/include/asm-m68k/atari_rootsec.h
deleted file mode 100644
index 2e6390f1d..000000000
--- a/include/asm-m68k/atari_rootsec.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef _LINUX_ATARI_ROOTSEC_H
-#define _LINUX_ATARI_ROOTSEC_H
-
-/*
- * linux/include/linux/atari_rootsec.h
- * definitions for Atari Rootsector layout
- * by Andreas Schwab (schwab@ls5.informatik.uni-dortmund.de)
- *
- * modified for ICD/Supra partitioning scheme restricted to at most 12
- * partitions
- * by Guenther Kelleter (guenther@pool.informatik.rwth-aachen.de)
- */
-
-struct partition_info
-{
- u_char flg; /* bit 0: active; bit 7: bootable */
- char id[3]; /* "GEM", "BGM", "XGM", or other */
- u_long st; /* start of partition */
- u_long siz; /* length of partition */
-};
-
-struct rootsector
-{
- char unused[0x156]; /* room for boot code */
- struct partition_info icdpart[8]; /* info for ICD-partitions 5..12 */
- char unused2[0xc];
- u_long hd_siz; /* size of disk in blocks */
- struct partition_info part[4];
- u_long bsl_st; /* start of bad sector list */
- u_long bsl_cnt; /* length of bad sector list */
- u_short checksum; /* checksum for bootable disks */
-} __attribute__((__packed__));
-
-#endif /* _LINUX_ATARI_ROOTSEC_H */
diff --git a/include/asm-m68k/atari_stram.h b/include/asm-m68k/atari_stram.h
new file mode 100644
index 000000000..31d620b67
--- /dev/null
+++ b/include/asm-m68k/atari_stram.h
@@ -0,0 +1,17 @@
+#ifndef _M68K_ATARI_STRAM_H
+#define _M68K_ATARI_STRAM_H
+
+/*
+ * Functions for Atari ST-RAM management
+ */
+
+/* public interface */
+void *atari_stram_alloc( long size, unsigned long *start_mem,
+ const char *owner );
+void atari_stram_free( void *);
+
+/* functions called internally by other parts of the kernel */
+void atari_stram_init( void);
+void atari_stram_reserve_pages( unsigned long start_mem );
+
+#endif /*_M68K_ATARI_STRAM_H */
diff --git a/include/asm-m68k/atarihdreg.h b/include/asm-m68k/atarihdreg.h
deleted file mode 100644
index bf0846001..000000000
--- a/include/asm-m68k/atarihdreg.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _LINUX_ATAHDREG_H
-#define _LINUX_ATAHDREG_H
-
-/*
- * This file contains some defines for the Falcon IDE hd controller.
- * Various sources. Check out some definitions (see comments with
- * a ques).
- */
-
-#define ATA_HD_BASE 0xfff00000
-
-#define ATA_HD_DATA 0x00 /* _CTL when writing */
-#define ATA_HD_ERROR 0x05 /* see err-bits */
-#define ATA_HD_NSECTOR 0x09 /* nr of sectors to read/write */
-#define ATA_HD_SECTOR 0x0d /* starting sector */
-#define ATA_HD_LCYL 0x11 /* starting cylinder */
-#define ATA_HD_HCYL 0x15 /* high byte of starting cyl */
-#define ATA_HD_CURRENT 0x19 /* 101dhhhh , d=drive, hhhh=head */
-#define ATA_HD_STATUS 0x1d /* see status-bits */
-
-#define ATA_HD_CMD 0x39
-#define ATA_HD_ALTSTATUS 0x39 /* same as HD_STATUS but doesn't clear irq */
-
-#endif /* _LINUX_ATAHDREG_H */
diff --git a/include/asm-m68k/atarihw.h b/include/asm-m68k/atarihw.h
index 5b137e769..8937fc2d1 100644
--- a/include/asm-m68k/atarihw.h
+++ b/include/asm-m68k/atarihw.h
@@ -21,15 +21,38 @@
#define _LINUX_ATARIHW_H_
#include <linux/types.h>
+#include <asm/bootinfo.h>
extern u_long atari_mch_cookie;
-
-/* mch_cookie values (upper word) */
-#define ATARI_MCH_ST 0
-#define ATARI_MCH_STE 1
-#define ATARI_MCH_TT 2
-#define ATARI_MCH_FALCON 3
-
+extern u_long atari_mch_type;
+extern u_long atari_switches;
+extern int atari_rtc_year_offset;
+extern int atari_dont_touch_floppy_select;
+
+/* convenience macros for testing machine type */
+#define MACH_IS_ST ((atari_mch_cookie >> 16) == ATARI_MCH_ST)
+#define MACH_IS_STE ((atari_mch_cookie >> 16) == ATARI_MCH_STE && \
+ (atari_mch_cookie & 0xffff) == 0)
+#define MACH_IS_MSTE ((atari_mch_cookie >> 16) == ATARI_MCH_STE && \
+ (atari_mch_cookie & 0xffff) == 0x10)
+#define MACH_IS_TT ((atari_mch_cookie >> 16) == ATARI_MCH_TT)
+#define MACH_IS_FALCON ((atari_mch_cookie >> 16) == ATARI_MCH_FALCON)
+#define MACH_IS_MEDUSA (atari_mch_type == ATARI_MACH_MEDUSA)
+#define MACH_IS_HADES (atari_mch_type == ATARI_MACH_HADES)
+#define MACH_IS_AB40 (atari_mch_type == ATARI_MACH_AB40)
+
+/* values for atari_switches */
+#define ATARI_SWITCH_IKBD 0x01
+#define ATARI_SWITCH_MIDI 0x02
+#define ATARI_SWITCH_SND6 0x04
+#define ATARI_SWITCH_SND7 0x08
+#define ATARI_SWITCH_OVSC_SHIFT 16
+#define ATARI_SWITCH_OVSC_IKBD (ATARI_SWITCH_IKBD << ATARI_SWITCH_OVSC_SHIFT)
+#define ATARI_SWITCH_OVSC_MIDI (ATARI_SWITCH_MIDI << ATARI_SWITCH_OVSC_SHIFT)
+#define ATARI_SWITCH_OVSC_SND6 (ATARI_SWITCH_SND6 << ATARI_SWITCH_OVSC_SHIFT)
+#define ATARI_SWITCH_OVSC_SND7 (ATARI_SWITCH_SND7 << ATARI_SWITCH_OVSC_SHIFT)
+#define ATARI_SWITCH_OVSC_MASK 0xffff0000
+
/*
* Define several Hardware-Chips for indication so that for the ATARI we do
* no longer decide whether it is a Falcon or other machine . It's just
@@ -92,14 +115,6 @@ extern struct atari_hw_present atari_hw_present;
#define MFPDELAY() \
__asm__ __volatile__ ( "tstb %0" : : "m" (mfp.par_dt_reg) : "cc" );
-/* Memory used for screen ram and stdma buffers */
-void atari_stram_init (void);
-void *atari_stram_alloc (long size, unsigned long *start_mem );
-void atari_stram_free (void *);
-
-extern int is_medusa;
-extern int is_hades;
-
/* Do cache push/invalidate for DMA read/write. This function obeys the
* snooping on some machines (Medusa) and processors: The Medusa itself can
* snoop, but only the '040 can source data from its cache to DMA writes i.e.,
@@ -116,11 +131,11 @@ static inline void dma_cache_maintenance( unsigned long paddr,
{
if (writeflag) {
- if (!is_medusa || CPU_IS_060)
+ if (!MACH_IS_MEDUSA || CPU_IS_060)
cache_push( paddr, len );
}
else {
- if (!is_medusa)
+ if (!MACH_IS_MEDUSA)
cache_clear( paddr, len );
}
}
diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
index c43c1ed2e..b2a335a7d 100644
--- a/include/asm-m68k/bitops.h
+++ b/include/asm-m68k/bitops.h
@@ -14,7 +14,23 @@
* They use the standard big-endian m680x0 bit ordering.
*/
-extern __inline__ int test_and_set_bit(int nr,void * vaddr)
+#define test_and_set_bit(nr,vaddr) \
+ (__builtin_constant_p(nr) ? \
+ __constant_test_and_set_bit(nr, vaddr) : \
+ __generic_test_and_set_bit(nr, vaddr))
+
+extern __inline__ int __constant_test_and_set_bit(int nr,void * vaddr)
+{
+ char retval;
+
+ __asm__ __volatile__ ("bset %1,%2; sne %0"
+ : "=d" (retval)
+ : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+
+ return retval;
+}
+
+extern __inline__ int __generic_test_and_set_bit(int nr,void * vaddr)
{
char retval;
@@ -24,13 +40,40 @@ extern __inline__ int test_and_set_bit(int nr,void * vaddr)
return retval;
}
-extern __inline__ void set_bit(int nr, void * vaddr)
+#define set_bit(nr,vaddr) \
+ (__builtin_constant_p(nr) ? \
+ __constant_set_bit(nr, vaddr) : \
+ __generic_set_bit(nr, vaddr))
+
+extern __inline__ void __constant_set_bit(int nr, void * vaddr)
+{
+ __asm__ __volatile__ ("bset %0,%1"
+ : : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+}
+
+extern __inline__ void __generic_set_bit(int nr, void * vaddr)
{
__asm__ __volatile__ ("bfset %1@{%0:#1}"
: : "d" (nr^31), "a" (vaddr));
}
-extern __inline__ int test_and_clear_bit(int nr, void * vaddr)
+#define test_and_clear_bit(nr,vaddr) \
+ (__builtin_constant_p(nr) ? \
+ __constant_test_and_clear_bit(nr, vaddr) : \
+ __generic_test_and_clear_bit(nr, vaddr))
+
+extern __inline__ int __constant_test_and_clear_bit(int nr, void * vaddr)
+{
+ char retval;
+
+ __asm__ __volatile__ ("bclr %1,%2; sne %0"
+ : "=d" (retval)
+ : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+
+ return retval;
+}
+
+extern __inline__ int __generic_test_and_clear_bit(int nr, void * vaddr)
{
char retval;
@@ -40,13 +83,40 @@ extern __inline__ int test_and_clear_bit(int nr, void * vaddr)
return retval;
}
-extern __inline__ void clear_bit(int nr, void * vaddr)
+#define clear_bit(nr,vaddr) \
+ (__builtin_constant_p(nr) ? \
+ __constant_clear_bit(nr, vaddr) : \
+ __generic_clear_bit(nr, vaddr))
+
+extern __inline__ void __constant_clear_bit(int nr, void * vaddr)
+{
+ __asm__ __volatile__ ("bclr %0,%1"
+ : : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+}
+
+extern __inline__ void __generic_clear_bit(int nr, void * vaddr)
{
__asm__ __volatile__ ("bfclr %1@{%0:#1}"
: : "d" (nr^31), "a" (vaddr));
}
-extern __inline__ int test_and_change_bit(int nr, void * vaddr)
+#define test_and_change_bit(nr,vaddr) \
+ (__builtin_constant_p(nr) ? \
+ __constant_test_and_change_bit(nr, vaddr) : \
+ __generic_test_and_change_bit(nr, vaddr))
+
+extern __inline__ int __constant_test_and_change_bit(int nr, void * vaddr)
+{
+ char retval;
+
+ __asm__ __volatile__ ("bchg %1,%2; sne %0"
+ : "=d" (retval)
+ : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+
+ return retval;
+}
+
+extern __inline__ int __generic_test_and_change_bit(int nr, void * vaddr)
{
char retval;
@@ -56,7 +126,18 @@ extern __inline__ int test_and_change_bit(int nr, void * vaddr)
return retval;
}
-extern __inline__ void change_bit(int nr, void * vaddr)
+#define change_bit(nr,vaddr) \
+ (__builtin_constant_p(nr) ? \
+ __constant_change_bit(nr, vaddr) : \
+ __generic_change_bit(nr, vaddr))
+
+extern __inline__ void __constant_change_bit(int nr, void * vaddr)
+{
+ __asm__ __volatile__ ("bchg %0,%1"
+ : : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+}
+
+extern __inline__ void __generic_change_bit(int nr, void * vaddr)
{
__asm__ __volatile__ ("bfchg %1@{%0:#1}"
: : "d" (nr^31), "a" (vaddr));
@@ -257,7 +338,4 @@ ext2_find_next_zero_bit (const void *vaddr, unsigned size, unsigned offset)
return (p - addr) * 32 + res;
}
-
-/* Byte swapping (swab16 and swab32) is now in asm/byteorder.h . */
-
#endif /* _M68K_BITOPS_H */
diff --git a/include/asm-m68k/bootinfo.h b/include/asm-m68k/bootinfo.h
index 5c1f215a9..279f82a16 100644
--- a/include/asm-m68k/bootinfo.h
+++ b/include/asm-m68k/bootinfo.h
@@ -93,7 +93,73 @@ BIR_data = BIR_size+2
*/
#define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (u_long) */
+#define BI_ATARI_MCH_TYPE 0x8001 /* special machine type (u_long) */
+ /* (values are ATARI_MACH_* defines */
+/* mch_cookie values (upper word) */
+#define ATARI_MCH_ST 0
+#define ATARI_MCH_STE 1
+#define ATARI_MCH_TT 2
+#define ATARI_MCH_FALCON 3
+
+/* mch_type values */
+#define ATARI_MACH_NORMAL 0 /* no special machine type */
+#define ATARI_MACH_MEDUSA 1 /* Medusa 040 */
+#define ATARI_MACH_HADES 2 /* Hades 040 or 060 */
+#define ATARI_MACH_AB40 3 /* Afterburner040 on Falcon */
+
+ /*
+ * Macintosh-specific tags
+ */
+
+#define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */
+#define BI_MAC_VADDR 0x8001 /* Mac video base address */
+#define BI_MAC_VDEPTH 0x8002 /* Mac video depth */
+#define BI_MAC_VROW 0x8003 /* Mac video rowbytes */
+#define BI_MAC_VDIM 0x8004 /* Mac video dimensions */
+#define BI_MAC_VLOGICAL 0x8005 /* Mac video logical base */
+#define BI_MAC_SCCBASE 0x8006 /* Mac SCC base address */
+#define BI_MAC_BTIME 0x8007 /* Mac boot time */
+#define BI_MAC_GMTBIAS 0x8008 /* Mac GMT timezone offset */
+#define BI_MAC_MEMSIZE 0x8009 /* Mac RAM size (sanity check) */
+#define BI_MAC_CPUID 0x800a /* Mac CPU type (sanity check) */
+
+ /*
+ * Mac: compatibility with old booter data format (temporarily)
+ */
+
+#ifndef __ASSEMBLY__
+
+struct mac_booter_data
+{
+ unsigned long videoaddr;
+ unsigned long videorow;
+ unsigned long videodepth;
+ unsigned long dimensions;
+ unsigned long args;
+ unsigned long boottime;
+ unsigned long gmtbias;
+ unsigned long bootver;
+ unsigned long videological;
+ unsigned long sccbase;
+ unsigned long id;
+ unsigned long memsize;
+ unsigned long serialmf;
+ unsigned long serialhsk;
+ unsigned long serialgpi;
+ unsigned long printmf;
+ unsigned long printhsk;
+ unsigned long printgpi;
+ unsigned long cpuid;
+ unsigned long rombase;
+ unsigned long adbdelay;
+ unsigned long timedbra;
+};
+
+extern struct mac_booter_data
+ mac_bi_data;
+
+#endif
/*
* Stuff for bootinfo interface versioning
@@ -129,7 +195,9 @@ struct bootversion {
#endif /* __ASSEMBLY__ */
#define AMIGA_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
-#define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
+#define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 1 )
+#define MAC_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
+#define MVME16x_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
#ifdef BOOTINFO_COMPAT_1_0
@@ -140,6 +208,7 @@ struct bootversion {
#define COMPAT_AMIGA_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
#define COMPAT_ATARI_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
+#define COMPAT_MAC_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
#include <linux/zorro.h>
@@ -162,6 +231,67 @@ struct compat_bi_Atari {
unsigned long mch_cookie;
};
+#ifndef __ASSEMBLY__
+
+#define MACHW_DECLARE(name) unsigned name : 1
+#define MACHW_SET(name) (boot_info.bi_mac.hw_present.name = 1)
+#define MACHW_PRESENT(name) (boot_info.bi_mac.hw_present.name)
+
+struct compat_bi_Macintosh
+{
+ unsigned long videoaddr;
+ unsigned long videorow;
+ unsigned long videodepth;
+ unsigned long dimensions;
+ unsigned long args;
+ unsigned long boottime;
+ unsigned long gmtbias;
+ unsigned long bootver;
+ unsigned long videological;
+ unsigned long sccbase;
+ unsigned long id;
+ unsigned long memsize;
+ unsigned long serialmf;
+ unsigned long serialhsk;
+ unsigned long serialgpi;
+ unsigned long printmf;
+ unsigned long printhsk;
+ unsigned long printgpi;
+ unsigned long cpuid;
+ unsigned long rombase;
+ unsigned long adbdelay;
+ unsigned long timedbra;
+ struct {
+ /* video hardware */
+ /* sound hardware */
+ /* disk storage interfaces */
+ MACHW_DECLARE(MAC_SCSI); /* Directly mapped NCR5380 */
+ MACHW_DECLARE(IDE); /* IDE Interface */
+ /* other I/O hardware */
+ MACHW_DECLARE(SCC); /* Serial Communications Contr. */
+ /* DMA */
+ MACHW_DECLARE(SCSI_DMA); /* DMA for the NCR5380 */
+ /* real time clocks */
+ MACHW_DECLARE(RTC_CLK); /* clock chip */
+ /* supporting hardware */
+ MACHW_DECLARE(VIA1); /* Versatile Interface Ad. 1 */
+ MACHW_DECLARE(VIA2); /* Versatile Interface Ad. 2 */
+ MACHW_DECLARE(RBV); /* Versatile Interface Ad. 2+ */
+ /* NUBUS */
+ MACHW_DECLARE(NUBUS); /* NUBUS */
+ } hw_present;
+};
+#else
+
+#define BI_videoaddr BI_un
+#define BI_videorow BI_videoaddr+4
+#define BI_videodepth BI_videorow+4
+#define BI_dimensions BI_videodepth+4
+#define BI_args BI_dimensions+4
+#define BI_cpuid BI_args+56
+
+#endif
+
struct compat_mem_info {
unsigned long addr;
unsigned long size;
@@ -200,13 +330,15 @@ struct compat_bootinfo {
unsigned long ramdisk_addr;
char command_line[COMPAT_CL_SIZE];
union {
- struct compat_bi_Amiga bi_ami;
- struct compat_bi_Atari bi_ata;
+ struct compat_bi_Amiga bi_ami;
+ struct compat_bi_Atari bi_ata;
+ struct compat_bi_Macintosh bi_mac;
} bi_un;
};
#define bi_amiga bi_un.bi_ami
#define bi_atari bi_un.bi_ata
+#define bi_mac bi_un.bi_mac
#endif /* BOOTINFO_COMPAT_1_0 */
diff --git a/include/asm-m68k/bugs.h b/include/asm-m68k/bugs.h
index 5f382dac3..d01935592 100644
--- a/include/asm-m68k/bugs.h
+++ b/include/asm-m68k/bugs.h
@@ -11,6 +11,4 @@
* void check_bugs(void);
*/
-static void check_bugs(void)
-{
-}
+extern void check_bugs(void); /* in arch/m68k/kernel/setup.c */
diff --git a/include/asm-m68k/elf.h b/include/asm-m68k/elf.h
index 0925126ad..70a0c8087 100644
--- a/include/asm-m68k/elf.h
+++ b/include/asm-m68k/elf.h
@@ -40,7 +40,7 @@ typedef struct user_m68kfp_struct elf_fpregset_t;
the loader. We need to make sure that it is out of the way of the program
that it will "exec", and that there is sufficient room for the brk. */
-#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
+#define ELF_ET_DYN_BASE 0xD0000000UL
#define ELF_CORE_COPY_REGS(pr_reg, regs) \
/* Bleech. */ \
@@ -68,4 +68,20 @@ typedef struct user_m68kfp_struct elf_fpregset_t;
pr_reg[13] = sw->a6; \
}
+/* This yields a mask that user programs can use to figure out what
+ instruction set this cpu supports. */
+
+#define ELF_HWCAP (0)
+
+/* This yields a string that ld.so will use to load implementation
+ specific libraries for optimization. This is more specific in
+ intent than poking at uname or /proc/cpuinfo. */
+
+#define ELF_PLATFORM (NULL)
+
+#ifdef __KERNEL__
+#define SET_PERSONALITY(ex, ibcs2) \
+ current->personality = (ibcs2 ? PER_SVR4 : PER_LINUX)
+#endif
+
#endif
diff --git a/include/asm-m68k/entry.h b/include/asm-m68k/entry.h
index 6f907936a..2c3182696 100644
--- a/include/asm-m68k/entry.h
+++ b/include/asm-m68k/entry.h
@@ -40,12 +40,11 @@
/*
* these are offsets into the task-struct
*/
-LTASK_STATE = 0
-LTASK_COUNTER = 4
-LTASK_PRIORITY = 8
-LTASK_SIGNAL = 12
-LTASK_BLOCKED = 16
-LTASK_FLAGS = 20
+LTASK_STATE = 0
+LTASK_FLAGS = 4
+LTASK_SIGPENDING = 8
+LTASK_ADDRLIMIT = 12
+LTASK_EXECDOMAIN = 16
LTSS_KSP = 0
LTSS_USP = 4
@@ -55,7 +54,7 @@ LTSS_CRP = 12
LTSS_FPCTXT = 24
/* the following macro is used when enabling interrupts */
-#if defined(MACH_ATARI_ONLY)
+#if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES)
/* block out HSYNC on the atari */
#define ALLOWINT 0xfbff
#define MAX_NOINT_IPL 3
diff --git a/include/asm-m68k/font.h b/include/asm-m68k/font.h
deleted file mode 100644
index 926e7194c..000000000
--- a/include/asm-m68k/font.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * asm-m68k/font.h -- `Soft' font definitions
- *
- * Created 1995 by Geert Uytterhoeven
- *
- * 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.
- */
-
-#ifndef _ASM_M68K_FONT_H_
-#define _ASM_M68K_FONT_H_
-
-#include <linux/types.h>
-
-
- /*
- * Find a font with a specific name
- */
-
-extern int findsoftfont(char *name, int *width, int *height, u_char *data[]);
-
-
- /*
- * Get the default font for a specific screen size
- */
-
-extern void getdefaultfont(int xres, int yres, char *name[], int *width,
- int *height, u_char *data[]);
-
-
-/* Max. length for the name of a predefined font */
-#define MAX_FONT_NAME 32
-
-#endif /* _ASM_M68K_FONT_H_ */
diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h
index ab3ca802e..76968803b 100644
--- a/include/asm-m68k/hardirq.h
+++ b/include/asm-m68k/hardirq.h
@@ -4,7 +4,6 @@
#include <linux/tasks.h>
extern unsigned int local_irq_count[NR_CPUS];
-#define in_interrupt() (local_irq_count[smp_processor_id()] != 0)
#define hardirq_trylock(cpu) (++local_irq_count[cpu], (cpu) == 0)
#define hardirq_endlock(cpu) (--local_irq_count[cpu])
diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h
index 2567392cd..bf155740f 100644
--- a/include/asm-m68k/ide.h
+++ b/include/asm-m68k/ide.h
@@ -33,28 +33,18 @@
#include <linux/config.h>
-#ifdef CONFIG_AMIGA
-#include <asm/amigahw.h>
-#include <asm/amihdreg.h>
-#include <asm/amigaints.h>
-#endif /* CONFIG_AMIGA */
-
-#ifdef CONFIG_ATARI
-#include <linux/interrupt.h> /* intr_count */
-#include <asm/atarihw.h>
-#include <asm/atarihdreg.h>
-#include <asm/atariints.h>
-#include <asm/atari_stdma.h>
-#endif /* CONFIG_ATARI */
-
#include <asm/setup.h>
#include <asm/io.h>
#include <asm/irq.h>
+#ifdef CONFIG_ATARI
+#include <asm/atari_stdma.h>
+#endif
+
typedef unsigned char * ide_ioreg_t;
#ifndef MAX_HWIFS
-#define MAX_HWIFS 1
+#define MAX_HWIFS 4 /* same as the other archs */
#endif
static __inline int ide_default_irq (ide_ioreg_t base)
@@ -62,68 +52,12 @@ static __inline int ide_default_irq (ide_ioreg_t base)
return 0;
}
-static __inline__ ide_ioreg_t ide_default_io_base (int index)
-{
- if (index)
- return NULL;
-#ifdef CONFIG_AMIGA
- if (MACH_IS_AMIGA) {
- if (AMIGAHW_PRESENT(A4000_IDE)) {
- printk("Gayle IDE interface (A%d style)\n", 4000);
- return ((ide_ioreg_t)ZTWO_VADDR(HD_BASE_A4000));
- }
- if (AMIGAHW_PRESENT(A1200_IDE)) {
- printk("Gayle IDE interface (A%d style)\n", 1200);
- return ((ide_ioreg_t)ZTWO_VADDR(HD_BASE_A1200));
- }
- }
-#endif /* CONFIG_AMIGA */
-#ifdef CONFIG_ATARI
- if (MACH_IS_ATARI) {
- if (ATARIHW_PRESENT(IDE)) {
- printk("Falcon IDE interface\n");
- return ((ide_ioreg_t) ATA_HD_BASE);
- }
- }
-#endif /* CONFIG_ATARI */
- return NULL;
-}
-
+/*
+ * Can we do this in a generic manner??
+ */
static __inline__ void ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int *irq)
{
- *p++ = base;
-#ifdef CONFIG_AMIGA
- if (MACH_IS_AMIGA) {
- *p++ = base + AMI_HD_ERROR;
- *p++ = base + AMI_HD_NSECTOR;
- *p++ = base + AMI_HD_SECTOR;
- *p++ = base + AMI_HD_LCYL;
- *p++ = base + AMI_HD_HCYL;
- *p++ = base + AMI_HD_SELECT;
- *p++ = base + AMI_HD_STATUS;
- *p++ = base + AMI_HD_CMD;
- if (AMIGAHW_PRESENT(A4000_IDE))
- *p++ = (ide_ioreg_t) ZTWO_VADDR(HD_A4000_IRQ);
- else if (AMIGAHW_PRESENT(A1200_IDE))
- *p++ = (ide_ioreg_t) ZTWO_VADDR(HD_A1200_IRQ);
- if (irq != NULL)
- *irq = IRQ_AMIGA_PORTS;
- }
-#endif /* CONFIG_AMIGA */
-#ifdef CONFIG_ATARI
- if (MACH_IS_ATARI) {
- *p++ = base + ATA_HD_ERROR;
- *p++ = base + ATA_HD_NSECTOR;
- *p++ = base + ATA_HD_SECTOR;
- *p++ = base + ATA_HD_LCYL;
- *p++ = base + ATA_HD_HCYL;
- *p++ = base + ATA_HD_CURRENT;
- *p++ = base + ATA_HD_STATUS;
- *p++ = base + ATA_HD_CMD;
- if (irq != NULL)
- *irq = IRQ_MFP_IDE;
- }
-#endif /* CONFIG_ATARI */
+ printk("ide_init_hwif_ports: must not be called\n");
}
typedef union {
@@ -363,23 +297,6 @@ static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent
#endif /* CONFIG_ATARI */
-static __inline__ int ide_ack_intr (ide_ioreg_t status_port, ide_ioreg_t irq_port)
-{
-#ifdef CONFIG_AMIGA
- if (MACH_IS_AMIGA) {
- unsigned char ch;
- ch = inb(irq_port);
- if (!(ch & 0x80))
- return(0);
- if (AMIGAHW_PRESENT(A1200_IDE)) {
- (void) inb(status_port);
- outb(0x7c | (ch & 0x03), irq_port);
- }
- }
-#endif /* CONFIG_AMIGA */
- return(1);
-}
-
#define T_CHAR (0x0000) /* char: don't touch */
#define T_SHORT (0x4000) /* short: 12 -> 21 */
#define T_INT (0x8000) /* int: 1234 -> 4321 */
@@ -489,6 +406,8 @@ static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *,
#endif /* CONFIG_ATARI */
}
+#define ide_ack_intr(hwif) (hwif)->ack_intr((hwif))
+
/*
* On the Atari, we sometimes can't enable interrupts:
*/
diff --git a/include/asm-m68k/init.h b/include/asm-m68k/init.h
index 93a323fd6..9d366561a 100644
--- a/include/asm-m68k/init.h
+++ b/include/asm-m68k/init.h
@@ -1,6 +1,10 @@
#ifndef _M68K_INIT_H
#define _M68K_INIT_H
+#include <linux/config.h>
+
+#ifndef CONFIG_KGDB
+
#define __init __attribute__ ((__section__ (".text.init")))
#define __initdata __attribute__ ((__section__ (".data.init")))
#define __initfunc(__arginit) \
@@ -11,4 +15,19 @@
#define __FINIT .previous
#define __INITDATA .section ".data.init",#alloc,#write
+#else
+
+/* gdb doesn't like it all if the code for one source file isn't together in
+ * the executable, so we must avoid the .init sections :-( */
+
+#define __init
+#define __initdata
+#define __initfunc(__arginit) __arginit
+/* For assembly routines */
+#define __INIT
+#define __FINIT
+#define __INITDATA
+
+#endif /* CONFIG_KGDB */
+
#endif
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h
index a9d65f743..8cee601e6 100644
--- a/include/asm-m68k/io.h
+++ b/include/asm-m68k/io.h
@@ -3,15 +3,30 @@
#ifdef __KERNEL__
+#include <linux/config.h> /* CONFIG_ATARI, CONFIG_HADES */
+#include <asm/byteorder.h>
+
+#ifdef CONFIG_ATARI
+#include <asm/atarihw.h>
+
+#define SLOW_DOWN_IO do { if (MACH_IS_ATARI) MFPDELAY(); } while (0)
+#endif
+
/*
* readX/writeX() are used to access memory mapped devices. On some
* architectures the memory mapped IO stuff needs to be accessed
* differently. On the m68k architecture, we just read/write the
* memory location directly.
*/
-#define readb(addr) (*(volatile unsigned char *) (addr))
-#define readw(addr) (*(volatile unsigned short *) (addr))
-#define readl(addr) (*(volatile unsigned int *) (addr))
+/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates
+ * two accesses to memory, which may be undesireable for some devices.
+ */
+#define readb(addr) \
+ ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
+#define readw(addr) \
+ ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
+#define readl(addr) \
+ ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
#define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b))
#define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b))
@@ -44,10 +59,16 @@ extern inline void * phys_to_virt(unsigned long address)
}
/*
- * IO bus memory addresses are 1:1 with the physical address
+ * IO bus memory addresses are 1:1 with the physical address,
+ * except on the PCI bus of the Hades.
*/
+#ifdef CONFIG_HADES
+#define virt_to_bus(a) (virt_to_phys(a) + (MACH_IS_HADES ? 0x80000000 : 0))
+#define bus_to_virt(a) (phys_to_virt((a) - (MACH_IS_HADES ? 0x80000000 : 0)))
+#else
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt
+#endif
#endif /* __KERNEL__ */
diff --git a/include/asm-m68k/ioctls.h b/include/asm-m68k/ioctls.h
index fa91491f6..213bd58df 100644
--- a/include/asm-m68k/ioctls.h
+++ b/include/asm-m68k/ioctls.h
@@ -47,6 +47,8 @@
#define TIOCSBRK 0x5427 /* BSD compatibility */
#define TIOCCBRK 0x5428 /* BSD compatibility */
#define TIOCGSID 0x5429 /* Return the session ID of FD */
+#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
#define FIOCLEX 0x5451
diff --git a/include/asm-m68k/keyboard.h b/include/asm-m68k/keyboard.h
index e4c602263..cb013200b 100644
--- a/include/asm-m68k/keyboard.h
+++ b/include/asm-m68k/keyboard.h
@@ -8,6 +8,7 @@
* This file contains the m68k architecture specific keyboard definitions
*/
+#include <linux/config.h> /* CONFIG_MAGIC_SYSRQ */
#ifndef __M68K_KEYBOARD_H
#define __M68K_KEYBOARD_H
@@ -49,8 +50,16 @@ static __inline__ void kbd_leds(unsigned char leds)
mach_kbd_leds(leds);
}
+#ifdef CONFIG_MAGIC_SYSRQ
+#define kbd_is_sysrq(keycode) ((keycode) == mach_sysrq_key && \
+ (up_flag || \
+ (shift_state & mach_sysrq_shift_mask) == \
+ mach_sysrq_shift_state))
+#define kbd_sysrq_xlate mach_sysrq_xlate
+#endif
+
#define kbd_init_hw mach_keyb_init
#endif /* __KERNEL__ */
-#endif /* __ASMm68k_KEYBOARD_H */
+#endif /* __M68K_KEYBOARD_H */
diff --git a/include/asm-m68k/mac_asc.h b/include/asm-m68k/mac_asc.h
new file mode 100644
index 000000000..a36aa5a27
--- /dev/null
+++ b/include/asm-m68k/mac_asc.h
@@ -0,0 +1,27 @@
+/*
+ * Apple Sound Chip
+ */
+
+#ifndef __ASM_MAC_ASC_H
+#define __ASM_MAC_ASC_H
+
+/*
+ * ASC offsets and controls
+ */
+
+#define ASC_BUF_BASE 0x00 /* RAM buffer offset */
+#define ASC_BUF_SIZE 0x800
+
+#define ASC_CONTROL 0x800
+#define ASC_CONTROL_OFF 0x00
+#define ASC_FREQ(chan,byte) ((0x810)+((chan)<<3)+(byte))
+#define ASC_ENABLE 0x801
+#define ASC_ENABLE_SAMPLE 0x02
+#define ASC_MODE 0x802
+#define ASC_MODE_SAMPLE 0x02
+
+#define ASC_VOLUME 0x806
+#define ASC_CHAN 0x807 /* ??? */
+
+
+#endif
diff --git a/include/asm-m68k/mac_mouse.h b/include/asm-m68k/mac_mouse.h
new file mode 100644
index 000000000..228c14d0d
--- /dev/null
+++ b/include/asm-m68k/mac_mouse.h
@@ -0,0 +1,23 @@
+#ifndef _ASM_MAC_MOUSE_H
+#define _ASM_MAC_MOUSE_H
+
+/*
+ * linux/include/asm-m68k/mac_mouse.h
+ * header file for Macintosh ADB mouse driver
+ * 27-10-97 Michael Schmitz
+ * copied from:
+ * header file for Atari Mouse driver
+ * by Robert de Vries (robert@and.nl) on 19Jul93
+ */
+
+struct mouse_status {
+ char buttons;
+ short dx;
+ short dy;
+ int ready;
+ int active;
+ struct wait_queue *wait;
+ struct fasync_struct *fasyncptr;
+};
+
+#endif
diff --git a/include/asm-m68k/machdep.h b/include/asm-m68k/machdep.h
index c6a4b8b33..b5be7c65d 100644
--- a/include/asm-m68k/machdep.h
+++ b/include/asm-m68k/machdep.h
@@ -30,13 +30,15 @@ extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour,
extern int (*mach_hwclk)(int, struct hwclk_time*);
extern int (*mach_set_clock_mmss)(unsigned long);
extern void (*mach_reset)( void );
-extern int (*mach_floppy_init) (void);
extern unsigned long (*mach_hd_init) (unsigned long, unsigned long);
extern void (*mach_hd_setup)(char *, int *);
-extern struct fb_info *(*mach_fb_init)(long *);
extern long mach_max_dma_address;
-extern void (*mach_video_setup)(char *, int *);
extern void (*mach_floppy_setup)(char *, int *);
extern void (*mach_floppy_eject)(void);
+extern void (*mach_heartbeat) (int);
+extern int mach_sysrq_key;
+extern int mach_sysrq_shift_state;
+extern int mach_sysrq_shift_mask;
+extern char *mach_sysrq_xlate;
#endif /* _M68K_MACHDEP_H */
diff --git a/include/asm-m68k/machw.h b/include/asm-m68k/machw.h
new file mode 100644
index 000000000..4012d8111
--- /dev/null
+++ b/include/asm-m68k/machw.h
@@ -0,0 +1,108 @@
+/*
+** linux/machw.h -- This header defines some macros and pointers for
+** the various Macintosh custom hardware registers.
+**
+** Copyright 1997 by Michael Schmitz
+**
+** 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.
+**
+*/
+
+#ifndef _ASM_MACHW_H_
+#define _ASM_MACHW_H_
+
+#include <linux/types.h>
+
+/* Mac SCSI Controller 5380 */
+
+#define MAC_5380_BAS (0x50F10000) /* This is definitely wrong!! */
+struct MAC_5380 {
+ u_char scsi_data;
+ u_char char_dummy1;
+ u_char scsi_icr;
+ u_char char_dummy2;
+ u_char scsi_mode;
+ u_char char_dummy3;
+ u_char scsi_tcr;
+ u_char char_dummy4;
+ u_char scsi_idstat;
+ u_char char_dummy5;
+ u_char scsi_dmastat;
+ u_char char_dummy6;
+ u_char scsi_targrcv;
+ u_char char_dummy7;
+ u_char scsi_inircv;
+};
+#define mac_scsi ((*(volatile struct MAC_5380 *)MAC_5380_BAS))
+
+/*
+** SCC Z8530
+*/
+
+#define MAC_SCC_BAS (0x50F04000)
+struct MAC_SCC
+ {
+ u_char cha_a_ctrl;
+ u_char char_dummy1;
+ u_char cha_a_data;
+ u_char char_dummy2;
+ u_char cha_b_ctrl;
+ u_char char_dummy3;
+ u_char cha_b_data;
+ };
+# define mac_scc ((*(volatile struct SCC*)MAC_SCC_BAS))
+
+/*
+** VIA 6522
+*/
+
+#define VIA1_BAS (0x50F00000)
+#define VIA2_BAS (0x50F02000)
+#define VIA2_BAS_IIci (0x50F26000)
+struct VIA
+ {
+ u_char buf_b;
+ u_char dummy1[0x199];
+ u_char buf_a;
+ u_char dummy2[0x199];
+ u_char dir_b;
+ u_char dummy3[0x199];
+ u_char dir_a;
+ u_char dummy4[0x199];
+ u_char timer1_cl;
+ u_char dummy5[0x199];
+ u_char timer1_ch;
+ u_char dummy6[0x199];
+ u_char timer1_ll;
+ u_char dummy7[0x199];
+ u_char timer1_lh;
+ u_char dummy8[0x199];
+ u_char timer2_cl;
+ u_char dummy9[0x199];
+ u_char timer2_ch;
+ u_char dummy10[0x199];
+ u_char sr;
+ u_char dummy11[0x199];
+ u_char acr;
+ u_char dummy12[0x199];
+ u_char pcr;
+ u_char dummy13[0x199];
+ u_char int_fl;
+ u_char dummy14[0x199];
+ u_char int_en;
+ u_char dummy15[0x199];
+ u_char anr;
+ u_char dummy16[0x199];
+ };
+
+# define via_1 ((*(volatile struct VIA *)VIA1_BAS))
+# define via_2 ((*(volatile struct VIA *)VIA2_BAS))
+# define via1_regp ((volatile unsigned char *)VIA1_BAS)
+
+# define via2_regp ((volatile unsigned char *)VIA2_BAS)
+# define via2_ci_regp ((volatile unsigned char *)VIA2_BAS_IIci)
+# define rbv_regp ((volatile unsigned char *)VIA2_BAS_IIci)
+
+#endif /* linux/machw.h */
diff --git a/include/asm-m68k/macintosh.h b/include/asm-m68k/macintosh.h
new file mode 100644
index 000000000..f40ff86c5
--- /dev/null
+++ b/include/asm-m68k/macintosh.h
@@ -0,0 +1,139 @@
+#ifndef __ASM_MACINTOSH_H
+#define __ASM_MACINTOSH_H
+
+/*
+ * Apple Macintoshisms
+ */
+
+extern void mac_reset(void);
+extern void mac_init_IRQ(void);
+extern int mac_request_irq (unsigned int, void (*)(int, void *,
+ struct pt_regs *),
+ unsigned long, const char *, void *);
+extern void mac_free_irq(unsigned int, void *);
+extern void mac_enable_irq(unsigned int);
+extern void mac_disable_irq(unsigned int);
+extern int mac_get_irq_list(char *);
+#if 0
+extern void mac_default_handler(int irq);
+#endif
+extern void mac_identify(void);
+extern void mac_report_hardware(void);
+extern void mac_debugging_penguin(int);
+extern void mac_boom(int);
+extern void mac_video_setup(char *,int *);
+
+/*
+ * Floppy driver magic hook - probably shouldnt be here
+ */
+
+extern void via1_set_head(int);
+
+extern void parse_booter(char *ptr);
+extern void print_booter(char *ptr);
+
+/*
+ * Macintosh Table
+ */
+
+struct mac_model *macintosh_config;
+
+
+struct mac_model
+{
+ short ident;
+ char *name;
+ char adb_type;
+ char via_type;
+ char scsi_type;
+ char ide_type;
+ char scc_type;
+ char ether_type;
+ char nubus_type;
+};
+
+#define MAC_ADB_NONE 0
+#define MAC_ADB_II 1
+#define MAC_ADB_IISI 2
+#define MAC_ADB_CUDA 3
+
+#define MAC_VIA_II 1
+#define MAC_VIA_IIci 2
+#define MAC_VIA_QUADRA 3
+
+#define MAC_SCSI_NONE 0
+#define MAC_SCSI_OLD 1
+#define MAC_SCSI_QUADRA 2
+#define MAC_SCSI_QUADRA2 3
+#define MAC_SCSI_QUADRA3 4
+
+#define MAC_IDE_NONE 0
+#define MAC_IDE_QUADRA 1
+#define MAC_IDE_PB 2
+
+#define MAC_SCC_II 1
+#define MAC_SCC_QUADRA 2
+#define MAC_SCC_QUADRA2 3
+
+#define MAC_ETHER_NONE 0
+#define MAC_ETHER_SONIC 1
+
+#define MAC_NO_NUBUS 0
+#define MAC_NUBUS 1
+
+/*
+ * Gestalt numbers
+ */
+
+#define MAC_MODEL_II 6
+#define MAC_MODEL_IIX 7
+#define MAC_MODEL_IICX 8
+#define MAC_MODEL_SE30 9
+#define MAC_MODEL_IICI 11
+#define MAC_MODEL_IIFX 13 /* And well numbered it is too */
+#define MAC_MODEL_IISI 18
+#define MAC_MODEL_Q900 20
+#define MAC_MODEL_PB170 25
+#define MAC_MODEL_Q700 22
+#define MAC_MODEL_CLII 23
+#define MAC_MODEL_PB140 25
+#define MAC_MODEL_Q950 26
+#define MAC_MODEL_LCIII 27 /* aka: P450 */
+#define MAC_MODEL_PB210 29
+#define MAC_MODEL_C650 30
+#define MAC_MODEL_PB230 32
+#define MAC_MODEL_PB180 33
+#define MAC_MODEL_PB160 34
+#define MAC_MODEL_Q800 35
+#define MAC_MODEL_Q650 36
+#define MAC_MODEL_LCII 37 /* aka: P400/405/410/430 */
+#define MAC_MODEL_PB250 38
+#define MAC_MODEL_IIVI 44
+#define MAC_MODEL_IIVX 48
+#define MAC_MODEL_CCL 49
+#define MAC_MODEL_PB165C 50
+#define MAC_MODEL_C610 52
+#define MAC_MODEL_Q610 53
+#define MAC_MODEL_PB145 54
+#define MAC_MODEL_P520 56 /* aka: LC520 */
+#define MAC_MODEL_C660 60
+#define MAC_MODEL_P460 62 /* aka: LCIII+, P466/7 */
+#define MAC_MODEL_PB180C 71
+#define MAC_MODEL_PB520 72
+#define MAC_MODEL_PB270C 77
+#define MAC_MODEL_Q840 78
+#define MAC_MODEL_P550 80
+#define MAC_MODEL_PB165 84
+#define MAC_MODEL_PB190 85
+#define MAC_MODEL_TV 88
+#define MAC_MODEL_P475 89 /* aka: LC475, P476 */
+#define MAC_MODEL_P575 92 /* aka: LC575/580, P577/578/508 */
+#define MAC_MODEL_Q605 94
+#define MAC_MODEL_Q630 98 /* aka: LC630, P630/631/636/640 */
+#define MAC_MODEL_PB280 102
+#define MAC_MODEL_PB280C 103
+#define MAC_MODEL_PB150 115
+
+extern struct mac_model *macintosh_config;
+
+#endif
diff --git a/include/asm-m68k/macints.h b/include/asm-m68k/macints.h
new file mode 100644
index 000000000..b2522f78d
--- /dev/null
+++ b/include/asm-m68k/macints.h
@@ -0,0 +1,160 @@
+/*
+** macints.h -- Macintosh Linux interrupt handling structs and prototypes
+**
+** Copyright 1997 by Michael Schmitz
+**
+** 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.
+**
+*/
+
+#ifndef _ASM_MACINTS_H_
+#define _ASM_MACINTS_H_
+
+#include <asm/irq.h>
+
+/*
+** Macintosh Interrupt sources.
+**
+** Note: these are all routed via the generic VIA interrupt routine!
+**
+*/
+
+#define SRC_VIA1 0
+#define SRC_VIA2 1
+
+#define VIA1_SOURCE_BASE 8
+#define VIA2_SOURCE_BASE 16
+#define RBF_SOURCE_BASE 24
+#define MAC_SCC_SOURCE_BASE 32
+#define NUBUS_SOURCE_BASE 40
+#define NUBUS_MAX_SOURCES 8
+
+/* FIXME: sources not contigous ... */
+#define NUM_MAC_SOURCES (NUBUS_SOURCE_BASE+NUBUS_MAX_SOURCES-VIA1_SOURCE_BASE)
+
+#define IRQ_SRC_MASK (VIA1_SOURCE_BASE|VIA2_SOURCE_BASE|MAC_SCC_SOURCE_BASE)
+#define IRQ_IDX_MASK 7
+
+/*
+ * quick hack to adapt old MACHSPEC-aware source
+ */
+#define IRQ_IDX(irq) (irq)
+
+#if 0
+/* convert vector number to int source number */
+#define IRQ_VECTOR_TO_SOURCE(v) (v)
+
+/* convert irq_handler index to vector number */
+#define IRQ_SOURCE_TO_VECTOR(i) (i)
+#endif
+
+/* interrupt service types */
+#define IRQ_TYPE_SLOW 0
+#define IRQ_TYPE_FAST 1
+#define IRQ_TYPE_PRIO 2
+
+#define IRQ_SPURIOUS (0)
+
+/* auto-vector interrupts */
+#define IRQ_AUTO_1 (1)
+#define IRQ_AUTO_2 (2)
+#define IRQ_AUTO_3 (3)
+#define IRQ_AUTO_4 (4)
+#define IRQ_AUTO_5 (5)
+#define IRQ_AUTO_6 (6)
+#define IRQ_AUTO_7 (7)
+
+/* VIA1 interrupts */
+#define IRQ_VIA1_0 (8) /* one second int. */
+#define IRQ_VIA1_1 (9) /* VBlank int. */
+#define IRQ_MAC_VBL IRQ_VIA1_1
+#define IRQ_VIA1_2 (10) /* ADB SR shifts complete */
+#define IRQ_MAC_ADB IRQ_VIA1_2
+#define IRQ_MAC_ADB_SR IRQ_VIA1_2
+#define IRQ_VIA1_3 (11) /* ADB SR CB2 ?? */
+#define IRQ_MAC_ADB_SD IRQ_VIA1_3
+#define IRQ_VIA1_4 (12) /* ADB SR ext. clock pulse */
+#define IRQ_MAC_ADB_CL IRQ_VIA1_4
+#define IRQ_VIA1_5 (13)
+#define IRQ_MAC_TIMER_2 IRQ_VIA1_5
+#define IRQ_VIA1_6 (14)
+#define IRQ_MAC_TIMER_1 IRQ_VIA1_6
+#define IRQ_VIA1_7 (15)
+
+/* VIA2 interrupts */
+#define IRQ_VIA2_0 (16)
+#define IRQ_MAC_SCSIDRQ IRQ_VIA2_0
+#define IRQ_VIA2_1 (17)
+#define IRQ_MAC_NUBUS IRQ_VIA2_1
+#define IRQ_VIA2_2 (18)
+#define IRQ_VIA2_3 (19)
+#define IRQ_MAC_SCSI IRQ_VIA2_3
+#define IRQ_VIA2_4 (20)
+#define IRQ_VIA2_5 (21)
+#define IRQ_VIA2_6 (22)
+#define IRQ_VIA2_7 (23)
+
+/* RBV interrupts */
+#define IRQ_RBV_0 (24)
+#define IRQ_RBV_1 (25)
+#define IRQ_RBV_2 (26)
+#define IRQ_RBV_3 (27)
+#define IRQ_RBV_4 (28)
+#define IRQ_RBV_5 (29)
+#define IRQ_RBV_6 (30)
+#define IRQ_RBV_7 (31)
+
+#define IRQ_SCC (32)
+#define IRQ_SCCB (32)
+#define IRQ_SCCA (33)
+#if 0 /* FIXME: are there multiple interrupt conditions on the SCC ?? */
+/* SCC interrupts */
+#define IRQ_SCCB_TX (32)
+#define IRQ_SCCB_STAT (33)
+#define IRQ_SCCB_RX (34)
+#define IRQ_SCCB_SPCOND (35)
+#define IRQ_SCCA_TX (36)
+#define IRQ_SCCA_STAT (37)
+#define IRQ_SCCA_RX (38)
+#define IRQ_SCCA_SPCOND (39)
+#endif
+
+#define IRQ_NUBUS_1 (40)
+
+#define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */
+#define INT_TICKS 246 /* to make sched_time = 99.902... HZ */
+
+
+#define VIA_ENABLE 0
+#define VIA_PENDING 1
+#define VIA_SERVICE 2
+#define VIA_MASK 3
+
+/*
+ * Utility functions for setting/clearing bits in the interrupt registers of
+ * the VIA.
+ */
+
+void mac_enable_irq( unsigned irq );
+void mac_disable_irq( unsigned irq );
+void mac_turnon_irq( unsigned irq );
+void mac_turnoff_irq( unsigned irq );
+void mac_clear_pending_irq( unsigned irq );
+int mac_irq_pending( unsigned irq );
+int nubus_request_irq(int slot, void (*handler)(int,void *,struct pt_regs *));
+int nubus_free_irq(int slot);
+
+unsigned long mac_register_nubus_int( void );
+void mac_unregister_nubus_int( unsigned long );
+
+extern void mac_default_handler(int irq, void *dev_id, struct pt_regs *regs);
+extern void via1_irq(int irq, void *dev_id, struct pt_regs *regs);
+extern void via2_irq(int irq, void *dev_id, struct pt_regs *regs);
+extern void rbv_irq(int irq, void *dev_id, struct pt_regs *regs);
+extern void mac_bang(int irq, void *dev_id, struct pt_regs *regs);
+
+extern void mac_SCC_handler(int irq, void *dev_id, struct pt_regs *regs);
+
+#endif /* asm/macints.h */
diff --git a/include/asm-m68k/mvme16xhw.h b/include/asm-m68k/mvme16xhw.h
new file mode 100644
index 000000000..dbcee2672
--- /dev/null
+++ b/include/asm-m68k/mvme16xhw.h
@@ -0,0 +1,118 @@
+#ifndef _M68K_MVME16xHW_H_
+#define _M68K_MVME16xHW_H_
+
+#include <asm/irq.h>
+
+/* Board ID data structure - pointer to this retrieved from Bug by head.S */
+
+/* Note, bytes 12 and 13 are board no in BCD (0162,0166,0167,0177,etc) */
+
+extern long mvme_bdid_ptr;
+
+typedef struct {
+ char bdid[4];
+ u_char rev, mth, day, yr;
+ u_short size, reserved;
+ u_short brdno;
+ char brdsuffix[2];
+ u_long options;
+ u_short clun, dlun, ctype, dnum;
+ u_long option2;
+} t_bdid, *p_bdid;
+
+
+typedef struct {
+ u_char ack_icr,
+ flt_icr,
+ sel_icr,
+ pe_icr,
+ bsy_icr,
+ spare1,
+ isr,
+ cr,
+ spare2,
+ spare3,
+ spare4,
+ data;
+} lpr_ctrl;
+
+#define LPR_REGS ((volatile lpr_ctrl *)0xfff42030)
+
+#define I596_BASE 0xfff46000
+
+#define SCC_A_ADDR 0xfff45005
+#define SCC_B_ADDR 0xfff45001
+
+#define IRQ_MVME162_TYPE_PRIO 0
+
+#define IRQ_MVME167_PRN 0x54
+#define IRQ_MVME16x_I596 0x57
+#define IRQ_MVME16x_SCSI 0x55
+#define IRQ_MVME16x_FLY 0x7f
+#define IRQ_MVME167_SER_ERR 0x5c
+#define IRQ_MVME167_SER_MODEM 0x5d
+#define IRQ_MVME167_SER_TX 0x5e
+#define IRQ_MVME167_SER_RX 0x5f
+#define IRQ_MVME16x_TIMER 0x59
+
+/* SCC interrupts, for MVME162 */
+#define IRQ_MVME162_SCC_BASE 0x40
+#define IRQ_MVME162_SCCB_TX 0x40
+#define IRQ_MVME162_SCCB_STAT 0x42
+#define IRQ_MVME162_SCCB_RX 0x44
+#define IRQ_MVME162_SCCB_SPCOND 0x46
+#define IRQ_MVME162_SCCA_TX 0x48
+#define IRQ_MVME162_SCCA_STAT 0x4a
+#define IRQ_MVME162_SCCA_RX 0x4c
+#define IRQ_MVME162_SCCA_SPCOND 0x4e
+
+/* MVME162 version register */
+
+#define MVME162_VERSION_REG 0xfff4202e
+
+extern unsigned short mvme16x_config;
+
+/* Lower 8 bits must match the revision register in the MC2 chip */
+
+#define MVME16x_CONFIG_SPEED_32 0x0001
+#define MVME16x_CONFIG_NO_VMECHIP2 0x0002
+#define MVME16x_CONFIG_NO_SCSICHIP 0x0004
+#define MVME16x_CONFIG_NO_ETHERNET 0x0008
+#define MVME16x_CONFIG_GOT_FPU 0x0010
+
+#define MVME16x_CONFIG_GOT_LP 0x0100
+#define MVME16x_CONFIG_GOT_CD2401 0x0200
+#define MVME16x_CONFIG_GOT_SCCA 0x0400
+#define MVME16x_CONFIG_GOT_SCCB 0x0800
+
+/* Specials for the ethernet driver */
+
+#define CA() (((struct i596_reg *)dev->base_addr)->ca = 1)
+
+#define MPU_PORT(c,x) \
+ ((struct i596_reg *)(dev->base_addr))->porthi = ((c) | (u32)(x)) & 0xffff; \
+ ((struct i596_reg *)(dev->base_addr))->portlo = ((c) | (u32)(x)) >> 16
+
+#define SCP_SYSBUS 0x00000054
+
+#define WSWAPrfd(x) ((struct i596_rfd *) (((u32)(x)<<16) | ((((u32)(x)))>>16)))
+#define WSWAPrbd(x) ((struct i596_rbd *) (((u32)(x)<<16) | ((((u32)(x)))>>16)))
+#define WSWAPiscp(x) ((struct i596_iscp *)(((u32)(x)<<16) | ((((u32)(x)))>>16)))
+#define WSWAPscb(x) ((struct i596_scb *) (((u32)(x)<<16) | ((((u32)(x)))>>16)))
+#define WSWAPcmd(x) ((struct i596_cmd *) (((u32)(x)<<16) | ((((u32)(x)))>>16)))
+#define WSWAPtbd(x) ((struct i596_tbd *) (((u32)(x)<<16) | ((((u32)(x)))>>16)))
+#define WSWAPchar(x) ((char *) (((u32)(x)<<16) | ((((u32)(x)))>>16)))
+
+/*
+ * The MPU_PORT command allows direct access to the 82596. With PORT access
+ * the following commands are available (p5-18). The 32-bit port command
+ * must be word-swapped with the most significant word written first.
+ */
+#define PORT_RESET 0x00 /* reset 82596 */
+#define PORT_SELFTEST 0x01 /* selftest */
+#define PORT_ALTSCP 0x02 /* alternate SCB address */
+#define PORT_ALTDUMP 0x03 /* Alternate DUMP address */
+
+#define ISCP_BUSY 0x00010000
+
+#endif /* _M68K_MVME16xHW_H_ */
diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h
index ef2246585..d20bc6144 100644
--- a/include/asm-m68k/pgtable.h
+++ b/include/asm-m68k/pgtable.h
@@ -26,7 +26,7 @@ do { \
asm __volatile__ ("nop\n\t" \
".chip 68040\n\t" \
"cinva %%ic\n\t" \
- ".chip 68k"); \
+ ".chip 68k" : ); \
else { \
unsigned long _tmp; \
asm __volatile__ ("movec %%cacr,%0\n\t" \
@@ -136,9 +136,12 @@ extern inline void flush_page_to_ram (unsigned long address)
}
/* Push n pages at kernel virtual address and clear the icache */
-extern inline void flush_pages_to_ram (unsigned long address, int n)
+extern inline void flush_icache_range (unsigned long address,
+ unsigned long endaddr)
{
if (CPU_IS_040_OR_060) {
+ short n = (endaddr - address + PAGE_SIZE - 1) / PAGE_SIZE;
+
while (n--) {
__asm__ __volatile__ ("nop\n\t"
".chip 68040\n\t"
@@ -159,7 +162,6 @@ extern inline void flush_pages_to_ram (unsigned long address, int n)
}
}
-#define flush_icache_range(start, end) do { } while (0)
/*
* flush all user-space atc entries.
@@ -223,7 +225,7 @@ static inline void flush_tlb_range(struct mm_struct *mm,
extern inline void flush_tlb_kernel_page(unsigned long addr)
{
if (CPU_IS_040_OR_060) {
- unsigned long old_fs = get_fs();
+ mm_segment_t old_fs = get_fs();
set_fs(KERNEL_DS);
__asm__ __volatile__(".chip 68040\n\t"
"pflush (%0)\n\t"
@@ -298,6 +300,8 @@ typedef pte_table pte_tablepage[PTE_TABLES_PER_PAGE];
#define _PAGE_RONLY 0x004
#define _PAGE_ACCESSED 0x008
#define _PAGE_DIRTY 0x010
+#define _PAGE_SUPER 0x080 /* 68040 supervisor only */
+#define _PAGE_FAKE_SUPER 0x200 /* fake supervisor only on 680[23]0 */
#define _PAGE_GLOBAL040 0x400 /* 68040 global bit, used for kva descs */
#define _PAGE_COW 0x800 /* implemented in software */
#define _PAGE_NOCACHE030 0x040 /* 68030 no-cache mode */
@@ -440,7 +444,7 @@ extern inline unsigned long pgd_page(pgd_t pgd)
{ return PTOV(pgd_val(pgd) & _TABLE_MASK); }
extern inline int pte_none(pte_t pte) { return !pte_val(pte); }
-extern inline int pte_present(pte_t pte) { return pte_val(pte) & _PAGE_PRESENT; }
+extern inline int pte_present(pte_t pte) { return pte_val(pte) & (_PAGE_PRESENT | _PAGE_FAKE_SUPER); }
extern inline void pte_clear(pte_t *ptep) { pte_val(*ptep) = 0; }
extern inline int pmd_none2(pmd_t *pmd) { return !pmd_val(*pmd); }
@@ -728,12 +732,15 @@ extern inline pgd_t * pgd_alloc(void)
int mm_end_of_chunk (unsigned long addr, int len);
/*
- * Map some physical address range into the kernel address space. The
- * code is copied and adapted from map_chunk().
+ * Map some physical address range into the kernel address space.
*/
extern unsigned long kernel_map(unsigned long paddr, unsigned long size,
int nocacheflag, unsigned long *memavailp );
/*
+ * Unmap a region alloced by kernel_map().
+ */
+extern void kernel_unmap( unsigned long addr );
+/*
* Change the cache mode of some kernel address range.
*/
extern void kernel_set_cachemode( unsigned long address, unsigned long size,
@@ -758,6 +765,8 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma,
* I don't know what is going on here, but since these were changed,
* swapping hasn't been working on the 68040.
*/
+/* With the new handling of PAGE_NONE the old definitions definitely
+ don't work any more. */
#define SWP_TYPE(entry) (((entry) >> 2) & 0x7f)
#if 0
diff --git a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h
index 9ec6df6e8..6d04e36d0 100644
--- a/include/asm-m68k/processor.h
+++ b/include/asm-m68k/processor.h
@@ -48,7 +48,7 @@ struct thread_struct {
#define INIT_TSS { \
sizeof(init_stack) + (unsigned long) init_stack, 0, \
- PS_S, KERNEL_DS, \
+ PS_S, __KERNEL_DS, \
{0, 0}, 0, {0,}, {0, 0, 0}, {0,}, \
}
@@ -58,13 +58,6 @@ struct thread_struct {
static inline void start_thread(struct pt_regs * regs, unsigned long pc,
unsigned long usp)
{
- unsigned long nilstate = 0;
-
- /* clear floating point state */
- __asm__ __volatile__ (".chip 68k/68881\n\t"
- "frestore %0@\n\t"
- ".chip 68k" : : "a" (&nilstate));
-
/* reads from user space */
set_fs(USER_DS);
@@ -74,7 +67,16 @@ static inline void start_thread(struct pt_regs * regs, unsigned long pc,
}
/* Free all resources held by a thread. */
-extern void release_thread(struct task_struct *);
+static inline void release_thread(struct task_struct *dead_task)
+{
+}
+
+/*
+ * Free current thread data structures etc..
+ */
+static inline void exit_thread(void)
+{
+}
/*
* Return saved PC of a blocked thread.
@@ -94,7 +96,7 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t)
/* Allocation and freeing of basic task resources. */
#define alloc_task_struct() \
- ((struct task_struct *) __get_free_pages(GFP_KERNEL,1,0))
+ ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
#define free_task_struct(p) free_pages((unsigned long)(p),1)
#define init_task (init_task_union.task)
diff --git a/include/asm-m68k/ptrace.h b/include/asm-m68k/ptrace.h
index e0c9d0ac2..f62c54ea2 100644
--- a/include/asm-m68k/ptrace.h
+++ b/include/asm-m68k/ptrace.h
@@ -58,6 +58,12 @@ struct switch_stack {
unsigned long retpc;
};
+/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
+#define PTRACE_GETREGS 12
+#define PTRACE_SETREGS 13
+#define PTRACE_GETFPREGS 14
+#define PTRACE_SETFPREGS 15
+
#ifdef __KERNEL__
#ifndef PS_S
diff --git a/include/asm-m68k/segment.h b/include/asm-m68k/segment.h
index 5fe0c033f..7b0b2d312 100644
--- a/include/asm-m68k/segment.h
+++ b/include/asm-m68k/segment.h
@@ -4,44 +4,54 @@
/* define constants */
/* Address spaces (FC0-FC2) */
#define USER_DATA (1)
-#ifndef USER_DS
-#define USER_DS (USER_DATA)
+#ifndef __USER_DS
+#define __USER_DS (USER_DATA)
#endif
#define USER_PROGRAM (2)
#define SUPER_DATA (5)
-#ifndef KERNEL_DS
-#define KERNEL_DS (SUPER_DATA)
+#ifndef __KERNEL_DS
+#define __KERNEL_DS (SUPER_DATA)
#endif
#define SUPER_PROGRAM (6)
#define CPU_SPACE (7)
#ifndef __ASSEMBLY__
+typedef struct {
+ unsigned long seg;
+} mm_segment_t;
+
+#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
+#define USER_DS MAKE_MM_SEG(__USER_DS)
+#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
+
/*
* Get/set the SFC/DFC registers for MOVES instructions
*/
-static inline unsigned long get_fs(void)
+static inline mm_segment_t get_fs(void)
{
- unsigned long _v;
- __asm__ ("movec %/dfc,%0":"=r" (_v):);
+ mm_segment_t _v;
+ __asm__ ("movec %/dfc,%0":"=r" (_v.seg):);
return _v;
}
-static inline unsigned long get_ds(void)
+static inline mm_segment_t get_ds(void)
{
/* return the supervisor data space code */
return KERNEL_DS;
}
-static inline void set_fs(unsigned long val)
+static inline void set_fs(mm_segment_t val)
{
__asm__ __volatile__ ("movec %0,%/sfc\n\t"
"movec %0,%/dfc\n\t"
- : /* no outputs */ : "r" (val) : "memory");
+ : /* no outputs */ : "r" (val.seg) : "memory");
}
+#define segment_eq(a,b) ((a).seg == (b).seg)
+
#endif /* __ASSEMBLY__ */
#endif /* _M68K_SEGMENT_H */
diff --git a/include/asm-m68k/serial.h b/include/asm-m68k/serial.h
index 607b408ec..bc30f6e56 100644
--- a/include/asm-m68k/serial.h
+++ b/include/asm-m68k/serial.h
@@ -32,6 +32,8 @@
#define SER_IOEXT 106 /* Amiga GVP IO-Extender (16c552) */
#define SER_MFC_III 107 /* Amiga BSC Multiface Card III (MC68681) */
#define SER_WHIPPET 108 /* Amiga Hisoft Whippet PCMCIA (16c550B) */
+#define SER_SCC_MVME 109 /* MVME162/MVME172 ports */
+#define SER_SCC_MAC 110 /* Macintosh SCC channel */
struct serial_struct {
int type;
@@ -99,33 +101,33 @@ struct serial_struct {
*
*/
-struct async_struct;
+struct m68k_async_struct;
typedef struct {
- void (*init)( struct async_struct *info );
- void (*deinit)( struct async_struct *info, int leave_dtr );
- void (*enab_tx_int)( struct async_struct *info, int enab_flag );
- int (*check_custom_divisor)( struct async_struct *info, int baud_base,
+ void (*init)( struct m68k_async_struct *info );
+ void (*deinit)( struct m68k_async_struct *info, int leave_dtr );
+ void (*enab_tx_int)( struct m68k_async_struct *info, int enab_flag );
+ int (*check_custom_divisor)( struct m68k_async_struct *info, int baud_base,
int divisor );
- void (*change_speed)( struct async_struct *info );
- void (*throttle)( struct async_struct *info, int status );
- void (*set_break)( struct async_struct *info, int break_flag );
- void (*get_serial_info)( struct async_struct *info,
+ void (*change_speed)( struct m68k_async_struct *info );
+ void (*throttle)( struct m68k_async_struct *info, int status );
+ void (*set_break)( struct m68k_async_struct *info, int break_flag );
+ void (*get_serial_info)( struct m68k_async_struct *info,
struct serial_struct *retinfo );
- unsigned int (*get_modem_info)( struct async_struct *info );
- int (*set_modem_info)( struct async_struct *info, int new_dtr,
+ unsigned int (*get_modem_info)( struct m68k_async_struct *info );
+ int (*set_modem_info)( struct m68k_async_struct *info, int new_dtr,
int new_rts );
int (*ioctl)( struct tty_struct *tty, struct file *file,
- struct async_struct *info, unsigned int cmd,
+ struct m68k_async_struct *info, unsigned int cmd,
unsigned long arg );
- void (*stop_receive)( struct async_struct *info );
- int (*trans_empty)( struct async_struct *info );
- int (*check_open)( struct async_struct *info, struct tty_struct *tty,
+ void (*stop_receive)( struct m68k_async_struct *info );
+ int (*trans_empty)( struct m68k_async_struct *info );
+ int (*check_open)( struct m68k_async_struct *info, struct tty_struct *tty,
struct file *file );
} SERIALSWITCH;
/*
- * Definitions for async_struct (and serial_struct) flags field
+ * Definitions for m68k_async_struct (and serial_struct) flags field
*/
#define ASYNC_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes
on the callout port */
@@ -191,16 +193,18 @@ struct serial_icounter_struct {
#include <linux/termios.h>
#include <linux/tqueue.h>
-/*
- * Counters of the input lines (CTS, DSR, RI, CD) interrupts
- */
-struct async_icount {
- __u32 cts, dsr, rng, dcd, tx, rx;
- __u32 frame, parity, overrun, brk;
- __u32 buf_overrun;
+#include <linux/config.h> /* for Mac SCC extensions */
+
+#ifdef CONFIG_MAC
+#define NUM_ZSREGS 16
+struct mac_zschannel {
+ volatile unsigned char *control;
+ volatile unsigned char *data;
};
+struct m68k_async_private;
+#endif
-struct async_struct {
+struct m68k_async_struct {
int magic;
int baud_base;
int port;
@@ -233,15 +237,14 @@ struct async_struct {
int xmit_tail;
int xmit_cnt;
struct tq_struct tqueue;
- struct tq_struct tqueue_hangup;
struct termios normal_termios;
struct termios callout_termios;
struct wait_queue *open_wait;
struct wait_queue *close_wait;
struct wait_queue *delta_msr_wait;
struct async_icount icount; /* kernel counters for the 4 input interrupts */
- struct async_struct *next_port; /* For the linked list */
- struct async_struct *prev_port;
+ struct m68k_async_struct *next_port; /* For the linked list */
+ struct m68k_async_struct *prev_port;
void *board_base; /* board-base address for use with
boards carrying several UART's,
like some Amiga boards. */
@@ -254,8 +257,41 @@ struct async_struct {
interrupt, instead of checking
IRQ-registers on all UART's */
SERIALSWITCH *sw; /* functions to manage this port */
+#ifdef CONFIG_MAC
+ struct m68k_async_private *private;
+#endif
};
+#ifdef CONFIG_MAC
+struct m68k_async_private {
+ struct m68k_async_info *zs_next; /* For IRQ servicing chain */
+ struct mac_zschannel *zs_channel; /* Channel registers */
+ struct mac_zschannel *zs_chan_a; /* A side registers */
+ unsigned char read_reg_zero;
+
+ char soft_carrier; /* Use soft carrier on this */
+ char break_abort; /* console, process brk/abrt */
+ char kgdb_channel; /* Kgdb running on this channel */
+ char is_cons; /* Is this our console. */
+ unsigned char tx_active; /* character being xmitted */
+ unsigned char tx_stopped; /* output is suspended */
+
+ /* We need to know the current clock divisor
+ * to read the bps rate the chip has currently
+ * loaded.
+ */
+ unsigned char clk_divisor; /* May be 1, 16, 32, or 64 */
+ int zs_baud;
+
+ /* Current write register values */
+ unsigned char curregs[NUM_ZSREGS];
+
+ /* Values we need to set next opportunity */
+ unsigned char pendregs[NUM_ZSREGS];
+
+ char change_needed;
+};
+#endif
#define SERIAL_MAGIC 0x5301
/*
@@ -275,7 +311,7 @@ struct async_struct {
/* Export to allow PCMCIA to use this - Dave Hinds */
extern int register_serial(struct serial_struct *req);
extern void unregister_serial(int line);
-extern struct async_struct rs_table[];
+extern struct m68k_async_struct rs_table[];
extern task_queue tq_serial;
@@ -283,14 +319,14 @@ extern task_queue tq_serial;
* This routine is used by the interrupt handler to schedule
* processing in the software interrupt portion of the driver.
*/
-static __inline__ void rs_sched_event(struct async_struct *info, int event)
+static __inline__ void rs_sched_event(struct m68k_async_struct *info, int event)
{
info->event |= 1 << event;
queue_task(&info->tqueue, &tq_serial);
mark_bh(SERIAL_BH);
}
-static __inline__ void rs_receive_char( struct async_struct *info,
+static __inline__ void rs_receive_char( struct m68k_async_struct *info,
int ch, int err )
{
struct tty_struct *tty = info->tty;
@@ -305,10 +341,10 @@ static __inline__ void rs_receive_char( struct async_struct *info,
*tty->flip.flag_buf_ptr++ = err;
*tty->flip.char_buf_ptr++ = ch;
info->icount.rx++;
- queue_task(&tty->flip.tqueue, &tq_timer);
+ tty_flip_buffer_push(tty);
}
-static __inline__ int rs_get_tx_char( struct async_struct *info )
+static __inline__ int rs_get_tx_char( struct m68k_async_struct *info )
{
unsigned char ch;
@@ -330,14 +366,14 @@ static __inline__ int rs_get_tx_char( struct async_struct *info )
return( ch );
}
-static __inline__ int rs_no_more_tx( struct async_struct *info )
+static __inline__ int rs_no_more_tx( struct m68k_async_struct *info )
{
return( info->xmit_cnt <= 0 ||
info->tty->stopped ||
info->tty->hw_stopped );
}
-static __inline__ void rs_dcd_changed( struct async_struct *info, int dcd )
+static __inline__ void rs_dcd_changed( struct m68k_async_struct *info, int dcd )
{
/* update input line counter */
@@ -356,7 +392,8 @@ static __inline__ void rs_dcd_changed( struct async_struct *info, int dcd )
#ifdef SERIAL_DEBUG_OPEN
printk("scheduling hangup...");
#endif
- queue_task(&info->tqueue_hangup, &tq_scheduler);
+ if (info->tty)
+ tty_hangup(info->tty);
}
}
}
@@ -365,13 +402,13 @@ static __inline__ void rs_dcd_changed( struct async_struct *info, int dcd )
void rs_stop( struct tty_struct *tty );
void rs_start( struct tty_struct *tty );
-static __inline__ void rs_check_cts( struct async_struct *info, int cts )
+static __inline__ void rs_check_cts( struct m68k_async_struct *info, int cts )
{
/* update input line counter */
info->icount.cts++;
wake_up_interruptible(&info->delta_msr_wait);
- if ((info->flags & ASYNC_CTS_FLOW) && info->tty)
+ if ((info->flags & ASYNC_CTS_FLOW) && info->tty) {
if (info->tty->hw_stopped) {
if (cts) {
#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
@@ -388,7 +425,7 @@ static __inline__ void rs_check_cts( struct async_struct *info, int cts )
rs_stop( info->tty );
}
}
-
+ }
}
diff --git a/include/asm-m68k/setup.h b/include/asm-m68k/setup.h
index c95bdfc01..0255ca97f 100644
--- a/include/asm-m68k/setup.h
+++ b/include/asm-m68k/setup.h
@@ -30,12 +30,14 @@
* Linux/m68k Architectures
*/
-#define MACH_AMIGA 1
-#define MACH_ATARI 2
-#define MACH_MAC 3
-#define MACH_APOLLO 4
-#define MACH_SUN3 5
-/* MVME 166/167/162/147?? */
+#define MACH_AMIGA 1
+#define MACH_ATARI 2
+#define MACH_MAC 3
+#define MACH_APOLLO 4
+#define MACH_SUN3 5
+#define MACH_MVME147 6
+#define MACH_MVME16x 7
+#define MACH_BVME6000 8
#ifdef __KERNEL__
@@ -45,7 +47,8 @@ extern u_long m68k_machtype;
#if !defined(CONFIG_AMIGA)
# define MACH_IS_AMIGA (0)
-#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC)
+#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
+ || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)
# define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA)
#else
# define MACH_AMIGA_ONLY
@@ -55,7 +58,8 @@ extern u_long m68k_machtype;
#if !defined(CONFIG_ATARI)
# define MACH_IS_ATARI (0)
-#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC)
+#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
+ || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)
# define MACH_IS_ATARI (m68k_machtype == MACH_ATARI)
#else
# define MACH_ATARI_ONLY
@@ -63,18 +67,56 @@ extern u_long m68k_machtype;
# define MACH_TYPE (MACH_ATARI)
#endif
-#if defined(CONFIG_MAC)
-# error Currently no Mac support!
+#if !defined(CONFIG_MAC)
+# define MACH_IS_MAC (0)
+#elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO)
+# define MACH_IS_MAC (m68k_machtype == MACH_MAC)
+#else
+# define CONFIG_MAC_ONLY
+# define MACH_IS_MAC (1)
+# define MACH_TYPE (MACH_MAC)
#endif
#if defined(CONFIG_SUN3)
# error Currently no Sun-3 support!
+#else
+#define MACH_IS_SUN3 (0)
+#endif
+
+#if !defined (CONFIG_APOLLO)
+# define MACH_IS_APOLLO (0)
+#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
+ || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)
+# define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO)
+#else
+# define CONFIG_APOLLO_ONLY
+# define MACH_IS_APOLLO (1)
+# define MACH_TYPE (MACH_APOLLO)
#endif
-#if defined(CONFIG_APOLLO)
-# error Currently no Apollo support!
+#if !defined (CONFIG_MVME16x)
+# define MACH_IS_MVME16x (0)
+#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
+ || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000)
+# define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x)
+#else
+# define CONFIG_MVME16x_ONLY
+# define MACH_IS_MVME16x (1)
+# define MACH_TYPE (MACH_MVME16x)
#endif
+#if !defined (CONFIG_BVME6000)
+# define MACH_IS_BVME6000 (0)
+#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
+ || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x)
+# define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000)
+#else
+# define CONFIG_BVME6000_ONLY
+# define MACH_IS_BVME6000 (1)
+# define MACH_TYPE (MACH_BVME6000)
+#endif
+
+
#ifndef MACH_TYPE
# define MACH_TYPE (m68k_machtype)
#endif
@@ -89,7 +131,7 @@ extern u_long m68k_machtype;
*
* CPU_68020 == MMU_68851
* CPU_68030 == MMU_68030
- * CPU_68040 == FPU_68040 == MMU_68040
+ * CPU_68040 == FPU_68040 == MMU_68040 (not strictly, think of 68LC040!)
* CPU_68060 == FPU_68060 == MMU_68060
*/
diff --git a/include/asm-m68k/siginfo.h b/include/asm-m68k/siginfo.h
new file mode 100644
index 000000000..e53589ef9
--- /dev/null
+++ b/include/asm-m68k/siginfo.h
@@ -0,0 +1,195 @@
+#ifndef _M68K_SIGINFO_H
+#define _M68K_SIGINFO_H
+
+#include <linux/types.h>
+
+/* This is copied from asm-alpha/siginfo.h. */
+
+typedef union sigval {
+ int sival_int;
+ void *sival_ptr;
+} sigval_t;
+
+#define SI_MAX_SIZE 128
+#define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct siginfo {
+ int si_signo;
+ int si_errno;
+ int si_code;
+
+ union {
+ int _pad[SI_PAD_SIZE];
+
+ /* kill() */
+ struct {
+ pid_t _pid; /* sender's pid */
+ uid_t _uid; /* sender's uid */
+ } _kill;
+
+ /* POSIX.1b timers */
+ struct {
+ unsigned int _timer1;
+ unsigned int _timer2;
+ } _timer;
+
+ /* POSIX.1b signals */
+ struct {
+ pid_t _pid; /* sender's pid */
+ uid_t _uid; /* sender's uid */
+ sigval_t _sigval;
+ } _rt;
+
+ /* SIGCHLD */
+ struct {
+ pid_t _pid; /* which child */
+ int _status; /* exit code */
+ clock_t _utime;
+ clock_t _stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+ struct {
+ void *_addr; /* faulting insn/memory ref. */
+ } _sigfault;
+
+ /* SIGPOLL */
+ struct {
+ int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ int _fd;
+ } _sigpoll;
+ } _sifields;
+} siginfo_t;
+
+/*
+ * How these fields are to be accessed.
+ */
+#define si_pid _sifields._kill._pid
+#define si_uid _sifields._kill._uid
+#define si_status _sifields._sigchld._status
+#define si_utime _sifields._sigchld._utime
+#define si_stime _sifields._sigchld._stime
+#define si_value _sifields._rt._sigval
+#define si_int _sifields._rt._sigval.sival_int
+#define si_ptr _sifields._rt._sigval.sival_ptr
+#define si_addr _sifields._sigfault._addr
+#define si_band _sifields._sigpoll._band
+#define si_fd _sifields._sigpoll._fd
+
+/*
+ * si_code values
+ * Digital reserves positive values for kernel-generated signals.
+ */
+#define SI_USER 0 /* sent by kill, sigsend, raise */
+#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
+#define SI_QUEUE -1 /* sent by sigqueue */
+#define SI_TIMER -2 /* sent by timer expiration */
+#define SI_MESGQ -3 /* sent by real time mesq state change */
+#define SI_ASYNCIO -4 /* sent by AIO completion */
+
+#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
+#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
+
+/*
+ * SIGILL si_codes
+ */
+#define ILL_ILLOPC 1 /* illegal opcode */
+#define ILL_ILLOPN 2 /* illegal operand */
+#define ILL_ILLADR 3 /* illegal addressing mode */
+#define ILL_ILLTRP 4 /* illegal trap */
+#define ILL_PRVOPC 5 /* privileged opcode */
+#define ILL_PRVREG 6 /* privileged register */
+#define ILL_COPROC 7 /* coprocessor error */
+#define ILL_BADSTK 8 /* internal stack error */
+#define NSIGILL 8
+
+/*
+ * SIGFPE si_codes
+ */
+#define FPE_INTDIV 1 /* integer divide by zero */
+#define FPE_INTOVF 2 /* integer overflow */
+#define FPE_FLTDIV 3 /* floating point divide by zero */
+#define FPE_FLTOVF 4 /* floating point overflow */
+#define FPE_FLTUND 5 /* floating point underflow */
+#define FPE_FLTRES 6 /* floating point inexact result */
+#define FPE_FLTINV 7 /* floating point invalid operation */
+#define FPE_FLTSUB 8 /* subscript out of range */
+#define NSIGFPE 8
+
+/*
+ * SIGSEGV si_codes
+ */
+#define SEGV_MAPERR 1 /* address not mapped to object */
+#define SEGV_ACCERR 2 /* invalid permissions for mapped object */
+#define NSIGSEGV 2
+
+/*
+ * SIGBUS si_codes
+ */
+#define BUS_ADRALN 1 /* invalid address alignment */
+#define BUS_ADRERR 2 /* non-existant physical address */
+#define BUS_OBJERR 3 /* object specific hardware error */
+#define NSIGBUS 3
+
+/*
+ * SIGTRAP si_codes
+ */
+#define TRAP_BRKPT 1 /* process breakpoint */
+#define TRAP_TRACE 2 /* process trace trap */
+#define NSIGTRAP 2
+
+/*
+ * SIGCHLD si_codes
+ */
+#define CLD_EXITED 1 /* child has exited */
+#define CLD_KILLED 2 /* child was killed */
+#define CLD_DUMPED 3 /* child terminated abnormally */
+#define CLD_TRAPPED 4 /* traced child has trapped */
+#define CLD_STOPPED 5 /* child has stopped */
+#define CLD_CONTINUED 6 /* stopped child has continued */
+#define NSIGCHLD 6
+
+/*
+ * SIGPOLL si_codes
+ */
+#define POLL_IN 1 /* data input available */
+#define POLL_OUT 2 /* output buffers available */
+#define POLL_MSG 3 /* input message available */
+#define POLL_ERR 4 /* i/o error */
+#define POLL_PRI 5 /* high priority input available */
+#define POLL_HUP 6 /* device disconnected */
+#define NSIGPOLL 6
+
+/*
+ * sigevent definitions
+ *
+ * It seems likely that SIGEV_THREAD will have to be handled from
+ * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
+ * thread manager then catches and does the appropriate nonsense.
+ * However, everything is written out here so as to not get lost.
+ */
+#define SIGEV_SIGNAL 0 /* notify via signal */
+#define SIGEV_NONE 1 /* other notification: meaningless */
+#define SIGEV_THREAD 2 /* deliver via thread creation */
+
+#define SIGEV_MAX_SIZE 64
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct sigevent {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ union {
+ int _pad[SIGEV_PAD_SIZE];
+
+ struct {
+ void (*_function)(sigval_t);
+ void *_attribute; /* really pthread_attr_t */
+ } _sigev_thread;
+ } _sigev_un;
+} sigevent_t;
+
+#define sigev_notify_function _sigev_un._sigev_thread._function
+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+#endif
diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h
index 1069ccc55..1f3466aff 100644
--- a/include/asm-m68k/signal.h
+++ b/include/asm-m68k/signal.h
@@ -1,10 +1,32 @@
#ifndef _M68K_SIGNAL_H
#define _M68K_SIGNAL_H
-typedef unsigned long sigset_t; /* at least 32 bits */
+#include <linux/types.h>
-#define _NSIG 32
-#define NSIG _NSIG
+/* Avoid too many header ordering problems. */
+struct siginfo;
+
+#ifdef __KERNEL__
+/* Most things should be clean enough to redefine this at will, if care
+ is taken to make libc match. */
+
+#define _NSIG 64
+#define _NSIG_BPW 32
+#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
+
+typedef unsigned long old_sigset_t; /* at least 32 bits */
+
+typedef struct {
+ unsigned long sig[_NSIG_WORDS];
+} sigset_t;
+
+#else
+/* Here we must cater to libcs that poke about in kernel headers. */
+
+#define NSIG 32
+typedef unsigned long sigset_t;
+
+#endif /* __KERNEL__ */
#define SIGHUP 1
#define SIGINT 2
@@ -43,22 +65,36 @@ typedef unsigned long sigset_t; /* at least 32 bits */
#define SIGPWR 30
#define SIGUNUSED 31
+/* These should not be considered constants from userland. */
+#define SIGRTMIN 32
+#define SIGRTMAX (_NSIG-1)
+
/*
- * sa_flags values: SA_STACK is not currently supported, but will allow the
- * usage of signal stacks by using the (now obsolete) sa_restorer field in
- * the sigaction structure as a stack pointer. This is now possible due to
- * the changes in signal handling. LBT 010493.
+ * SA_FLAGS values:
+ *
+ * SA_ONSTACK is not currently supported, but will allow sigaltstack(2).
+ * (++roman: SA_ONSTACK is supported on m68k)
* SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
* SA_RESTART flag to get restarting signals (which were the default long ago)
- * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
+ * SA_RESETHAND clears the handler when the signal is delivered.
+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
+ * SA_NODEFER prevents the current signal from being masked in the handler.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
*/
-#define SA_NOCLDSTOP 1
-#define SA_SHIRQ 0x04000000
-#define SA_STACK 0x08000000
+#define SA_NOCLDSTOP 0x00000001
+#define SA_NOCLDWAIT 0x00000002 /* not supported yet */
+#define SA_SIGINFO 0x00000004
+#define SA_ONSTACK 0x08000000
#define SA_RESTART 0x10000000
-#define SA_INTERRUPT 0x20000000
-#define SA_NOMASK 0x40000000
-#define SA_ONESHOT 0x80000000
+#define SA_NODEFER 0x40000000
+#define SA_RESETHAND 0x80000000
+
+#define SA_NOMASK SA_NODEFER
+#define SA_ONESHOT SA_RESETHAND
+#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
#ifdef __KERNEL__
/*
@@ -66,9 +102,11 @@ typedef unsigned long sigset_t; /* at least 32 bits */
* irq handling routines.
*
* SA_INTERRUPT is also used by the irq handling routines.
+ * SA_SHIRQ is for shared interrupt support on PCI and EISA.
*/
-#define SA_PROBE SA_ONESHOT
-#define SA_SAMPLE_RANDOM SA_RESTART
+#define SA_PROBE SA_ONESHOT
+#define SA_SAMPLE_RANDOM SA_RESTART
+#define SA_SHIRQ 0x04000000
#endif
#define SIG_BLOCK 0 /* for blocking signals */
@@ -82,15 +120,78 @@ typedef void (*__sighandler_t)(int);
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
+#ifdef __KERNEL__
+struct old_sigaction {
+ __sighandler_t sa_handler;
+ old_sigset_t sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+};
+
+struct k_sigaction {
+ struct sigaction sa;
+};
+#else
+/* Here we must cater to libcs that poke about in kernel headers. */
+
struct sigaction {
__sighandler_t sa_handler;
sigset_t sa_mask;
unsigned long sa_flags;
void (*sa_restorer)(void);
};
+#endif /* __KERNEL__ */
+
+typedef struct sigaltstack {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+} stack_t;
#ifdef __KERNEL__
#include <asm/sigcontext.h>
-#endif
+
+#define __HAVE_ARCH_SIG_BITOPS
+
+extern __inline__ void sigaddset(sigset_t *set, int _sig)
+{
+ __asm__("bfset %0{%1,#1}" : "=m" (*set) : "id" ((_sig - 1) ^ 31)
+ : "cc");
+}
+
+extern __inline__ void sigdelset(sigset_t *set, int _sig)
+{
+ __asm__("bfclr %0{%1,#1}" : "=m"(*set) : "id"((_sig - 1) ^ 31)
+ : "cc");
+}
+
+extern __inline__ int __const_sigismember(sigset_t *set, int _sig)
+{
+ unsigned long sig = _sig - 1;
+ return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW));
+}
+
+extern __inline__ int __gen_sigismember(sigset_t *set, int _sig)
+{
+ char ret;
+ __asm__("bftst %1{%2,#1}\n\t sne %0"
+ : "=rm"(ret) : "m"(*set), "id"((_sig-1) ^ 31) : "cc");
+ return ret;
+}
+
+#define sigismember(set,sig) \
+ (__builtin_constant_p(sig) ? \
+ __const_sigismember(set,sig) : \
+ __gen_sigismember(set,sig))
+
+#define sigmask(sig) (1UL << ((sig) - 1))
+
+extern __inline__ int sigfindinword(unsigned long word)
+{
+ __asm__("bfffo %1{#0,#0},%0" : "=d"(word) : "d"(word & -word) : "cc");
+ return word ^ 31;
+}
+
+#endif /* __KERNEL__ */
#endif /* _M68K_SIGNAL_H */
diff --git a/include/asm-m68k/socket.h b/include/asm-m68k/socket.h
index 22aa27cc7..cc27f2e32 100644
--- a/include/asm-m68k/socket.h
+++ b/include/asm-m68k/socket.h
@@ -33,4 +33,10 @@
#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
#define SO_SECURITY_ENCRYPTION_NETWORK 24
+#define SO_BINDTODEVICE 25
+
+/* Socket filtering */
+#define SO_ATTACH_FILTER 26
+#define SO_DETACH_FILTER 27
+
#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-m68k/softirq.h b/include/asm-m68k/softirq.h
index 1cc0cbb81..bed386d44 100644
--- a/include/asm-m68k/softirq.h
+++ b/include/asm-m68k/softirq.h
@@ -44,22 +44,22 @@ extern inline void remove_bh(int nr)
bh_mask &= ~(1 << nr);
}
-extern int __m68k_bh_counter;
+extern unsigned int local_bh_count[NR_CPUS];
extern inline void start_bh_atomic(void)
{
- __m68k_bh_counter++;
+ local_bh_count[smp_processor_id()]++;
barrier();
}
extern inline void end_bh_atomic(void)
{
barrier();
- __m68k_bh_counter--;
+ local_bh_count[smp_processor_id()]--;
}
/* These are for the irq's testing the lock */
-#define softirq_trylock() (__m68k_bh_counter ? 0 : (__m68k_bh_counter=1))
-#define softirq_endlock() (__m68k_bh_counter = 0)
+#define softirq_trylock(cpu) (local_bh_count[cpu] ? 0 : (local_bh_count[cpu]=1))
+#define softirq_endlock(cpu) (local_bh_count[cpu] = 0)
#endif
diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h
index fd2eb8991..729f7b34b 100644
--- a/include/asm-m68k/system.h
+++ b/include/asm-m68k/system.h
@@ -8,15 +8,12 @@
extern inline unsigned long rdusp(void) {
unsigned long usp;
- __asm__ __volatile__("movec %/usp,%0"
- : "=d" (usp));
+ __asm__ __volatile__("move %/usp,%0" : "=a" (usp));
return usp;
}
extern inline void wrusp(unsigned long usp) {
- __asm__ __volatile__("movec %0,%/usp"
- :
- : "d" (usp));
+ __asm__ __volatile__("move %0,%/usp" : : "a" (usp));
}
/*
@@ -63,7 +60,7 @@ asmlinkage void resume(void);
struct __xchg_dummy { unsigned long a[100]; };
#define __xg(x) ((volatile struct __xchg_dummy *)(x))
-#if defined(CONFIG_ATARI) && !defined(CONFIG_AMIGA) && !defined(CONFIG_MAC)
+#if defined(CONFIG_ATARI) && !defined(CONFIG_AMIGA) && !defined(CONFIG_MAC) && !defined(CONFIG_HADES)
/* block out HSYNC on the atari */
#define __sti() __asm__ __volatile__ ("andiw #0xfbff,%/sr": : : "memory")
#else /* portable version */
diff --git a/include/asm-m68k/types.h b/include/asm-m68k/types.h
index 945edb982..b0ece7bda 100644
--- a/include/asm-m68k/types.h
+++ b/include/asm-m68k/types.h
@@ -47,6 +47,8 @@ typedef unsigned int u32;
typedef signed long long s64;
typedef unsigned long long u64;
+#define BITS_PER_LONG 32
+
#endif /* __KERNEL__ */
#endif /* _M68K_TYPES_H */
diff --git a/include/asm-m68k/ucontext.h b/include/asm-m68k/ucontext.h
new file mode 100644
index 000000000..fb6d732ad
--- /dev/null
+++ b/include/asm-m68k/ucontext.h
@@ -0,0 +1,32 @@
+#ifndef _M68K_UCONTEXT_H
+#define _M68K_UCONTEXT_H
+
+typedef int greg_t;
+#define NGREG 18
+typedef greg_t gregset_t[NGREG];
+
+typedef struct fpregset {
+ int f_pcr;
+ int f_psr;
+ int f_fpiaddr;
+ int f_fpregs[8][3];
+} fpregset_t;
+
+struct mcontext {
+ int version;
+ gregset_t gregs;
+ fpregset_t fpregs;
+};
+
+#define MCONTEXT_VERSION 2
+
+struct ucontext {
+ unsigned long uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ struct mcontext uc_mcontext;
+ unsigned long uc_filler[80];
+ sigset_t uc_sigmask; /* mask last for extensibility */
+};
+
+#endif
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h
index 0f0ac9976..7c5226b95 100644
--- a/include/asm-m68k/unistd.h
+++ b/include/asm-m68k/unistd.h
@@ -174,9 +174,19 @@
#define __NR_query_module 167
#define __NR_poll 168
#define __NR_nfsservctl 169
-#define __NR_prctl 170
-#define __NR_pread 171
-#define __NR_pwrite 172
+#define __NR_setresgid 170
+#define __NR_getresgid 171
+#define __NR_prctl 172
+#define __NR_rt_sigreturn 173
+#define __NR_rt_sigaction 174
+#define __NR_rt_sigprocmask 175
+#define __NR_rt_sigpending 176
+#define __NR_rt_sigtimedwait 177
+#define __NR_rt_sigqueueinfo 178
+#define __NR_rt_sigsuspend 179
+#define __NR_pread 180
+#define __NR_pwrite 181
+#define __NR_lchown 182
/* user-visible error numbers are in the range -1 - -122: see
<asm-m68k/errno.h> */
@@ -319,7 +329,7 @@ static inline pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long f
{
register long retval __asm__ ("d0") = __NR_clone;
register long clone_arg __asm__ ("d1") = flags | CLONE_VM;
- unsigned long fs;
+ mm_segment_t fs;
fs = get_fs();
set_fs (KERNEL_DS);
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h
index 5cd755b38..ffdd577cd 100644
--- a/include/asm-mips/elf.h
+++ b/include/asm-mips/elf.h
@@ -1,5 +1,5 @@
/*
- * $Id: elf.h,v 1.4 1997/12/15 10:38:30 ralf Exp $
+ * $Id: elf.h,v 1.4 1997/12/16 05:36:40 ralf Exp $
*/
#ifndef __ASM_MIPS_ELF_H
#define __ASM_MIPS_ELF_H
@@ -38,6 +38,21 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
memcpy((char *) &_dest, (char *) _regs, \
sizeof(struct pt_regs));
+/* This yields a mask that user programs can use to figure out what
+ instruction set this cpu supports. This could be done in userspace,
+ but it's not easy, and we've already done it here. */
+
+#define ELF_HWCAP (0)
+
+/* This yields a string that ld.so will use to load implementation
+ specific libraries for optimization. This is more specific in
+ intent than poking at uname or /proc/cpuinfo.
+
+ For the moment, we have only optimizations for the Intel generations,
+ but that could change... */
+
+#define ELF_PLATFORM (NULL)
+
/* See comments in asm-alpha/elf.h, this is the same thing
* on the MIPS.
*/
@@ -50,4 +65,9 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
+#ifdef __KERNEL__
+#define SET_PERSONALITY(ex,ibcs2) \
+ current->personality = (ibcs2 ? PER_SVR4 : PER_LINUX)
+#endif
+
#endif /* __ASM_MIPS_ELF_H */
diff --git a/include/asm-mips/errno.h b/include/asm-mips/errno.h
index 38fd881be..a8fb34260 100644
--- a/include/asm-mips/errno.h
+++ b/include/asm-mips/errno.h
@@ -156,4 +156,7 @@
#define EDQUOT 1133 /* Quota exceeded */
#define ENFSREMOTE 1134 /* ??? */
+/* The biggest error number defined here or in <linux/errno.h>. */
+#define EMAXERRNO 1134
+
#endif /* __ASM_MIPS_ERRNO_H */
diff --git a/include/asm-mips/hardirq.h b/include/asm-mips/hardirq.h
index f372b24d5..9a666e6c5 100644
--- a/include/asm-mips/hardirq.h
+++ b/include/asm-mips/hardirq.h
@@ -4,7 +4,6 @@
#include <linux/tasks.h>
extern unsigned int local_irq_count[NR_CPUS];
-#define in_interrupt() (local_irq_count[smp_processor_id()] != 0)
#ifndef __SMP__
diff --git a/include/asm-mips/ioctls.h b/include/asm-mips/ioctls.h
index b871cd449..c7142ceb2 100644
--- a/include/asm-mips/ioctls.h
+++ b/include/asm-mips/ioctls.h
@@ -99,6 +99,8 @@
#define TIOCSBRK 0x5427 /* BSD compatibility */
#define TIOCCBRK 0x5428 /* BSD compatibility */
#define TIOCGSID 0x7416 /* Return the session ID of FD */
+#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
#define TIOCSERCONFIG 0x5488
#define TIOCSERGWILD 0x5489
diff --git a/include/asm-mips/offset.h b/include/asm-mips/offset.h
index cb0be6469..23a1a2dfe 100644
--- a/include/asm-mips/offset.h
+++ b/include/asm-mips/offset.h
@@ -48,41 +48,41 @@
/* MIPS task_struct offsets. */
#define TASK_STATE 0
-#define TASK_COUNTER 4
-#define TASK_PRIORITY 8
-#define TASK_FLAGS 12
-#define TASK_SIGPENDING 16
-#define TASK_MM 928
+#define TASK_COUNTER 52
+#define TASK_PRIORITY 56
+#define TASK_FLAGS 4
+#define TASK_SIGPENDING 8
+#define TASK_MM 936
/* MIPS specific thread_struct offsets. */
-#define THREAD_REG16 560
-#define THREAD_REG17 564
-#define THREAD_REG18 568
-#define THREAD_REG19 572
-#define THREAD_REG20 576
-#define THREAD_REG21 580
-#define THREAD_REG22 584
-#define THREAD_REG23 588
-#define THREAD_REG28 592
-#define THREAD_REG29 596
-#define THREAD_REG30 600
-#define THREAD_REG31 604
-#define THREAD_STATUS 608
-#define THREAD_FPU 616
-#define THREAD_BVADDR 880
-#define THREAD_ECODE 884
-#define THREAD_TRAPNO 888
-#define THREAD_KSP 892
-#define THREAD_PGDIR 896
-#define THREAD_MFLAGS 900
-#define THREAD_CURDS 904
-#define THREAD_TRAMP 908
-#define THREAD_OLDCTX 912
+#define THREAD_REG16 568
+#define THREAD_REG17 572
+#define THREAD_REG18 576
+#define THREAD_REG19 580
+#define THREAD_REG20 584
+#define THREAD_REG21 588
+#define THREAD_REG22 592
+#define THREAD_REG23 596
+#define THREAD_REG28 600
+#define THREAD_REG29 604
+#define THREAD_REG30 608
+#define THREAD_REG31 612
+#define THREAD_STATUS 616
+#define THREAD_FPU 624
+#define THREAD_BVADDR 888
+#define THREAD_ECODE 892
+#define THREAD_TRAPNO 896
+#define THREAD_KSP 900
+#define THREAD_PGDIR 904
+#define THREAD_MFLAGS 908
+#define THREAD_CURDS 912
+#define THREAD_TRAMP 916
+#define THREAD_OLDCTX 920
/* Linux mm_struct offsets. */
#define MM_COUNT 12
#define MM_PGD 8
-#define MM_CONTEXT 28
+#define MM_CONTEXT 32
/* Linux sigcontext offsets. */
#define SC_REGMASK 0
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 460676d2b..dbecc0da9 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -121,8 +121,7 @@ extern void (*add_wired_entry)(unsigned long entrylo0, unsigned long entrylo1,
#define _PAGE_CHG_MASK (PAGE_MASK | __READABLE | __WRITEABLE | _CACHE_MASK)
-#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
- _CACHE_CACHABLE_NONCOHERENT)
+#define PAGE_NONE __pgprot(0)
#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
_CACHE_CACHABLE_NONCOHERENT)
#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ | \
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index c1de4e748..617428b34 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -5,7 +5,7 @@
* written by Ralf Baechle
* Modified further for R[236]000 compatibility by Paul M. Antoine
*
- * $Id: processor.h,v 1.3 1997/12/01 18:00:41 ralf Exp $
+ * $Id: processor.h,v 1.4 1997/12/16 05:36:43 ralf Exp $
*/
#ifndef __ASM_MIPS_PROCESSOR_H
#define __ASM_MIPS_PROCESSOR_H
@@ -141,7 +141,7 @@ struct thread_struct {
/* \
* For now the default is to fix address errors \
*/ \
- MF_FIXADE, 0, 0, 0 \
+ MF_FIXADE, { 0 }, 0, 0 \
}
#ifdef __KERNEL__
@@ -183,7 +183,7 @@ extern int (*running_in_user_mode)(void);
* NOTE! The task struct and the stack go together
*/
#define alloc_task_struct() \
- ((struct task_struct *) __get_free_pages(GFP_KERNEL,1,0))
+ ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
#define free_task_struct(p) free_pages((unsigned long)(p),1)
#define init_task (init_task_union.task)
diff --git a/include/asm-mips/semaphore.h b/include/asm-mips/semaphore.h
index 6d527848b..71ffec761 100644
--- a/include/asm-mips/semaphore.h
+++ b/include/asm-mips/semaphore.h
@@ -10,7 +10,9 @@
#ifndef __ASM_MIPS_SEMAPHORE_H
#define __ASM_MIPS_SEMAPHORE_H
+#include <asm/system.h>
#include <asm/atomic.h>
+#include <asm/spinlock.h>
struct semaphore {
atomic_t count;
@@ -25,6 +27,8 @@ extern void __down(struct semaphore * sem);
extern int __down_interruptible(struct semaphore * sem);
extern void __up(struct semaphore * sem);
+extern spinlock_t semaphore_wake_lock;
+
#define sema_init(sem, val) atomic_set(&((sem)->count), val)
/*
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h
index 780beff0b..601826429 100644
--- a/include/asm-mips/smp.h
+++ b/include/asm-mips/smp.h
@@ -1,6 +1,6 @@
#ifndef __ASM_MIPS_SMP_H
#define __ASM_MIPS_SMP_H
-/* We'll get here eventually.. */
+#define cpu_logical_map(cpu) (cpu)
#endif /* __ASM_MIPS_SMP_H */
diff --git a/include/asm-mips/socket.h b/include/asm-mips/socket.h
index 9b96d561f..721735127 100644
--- a/include/asm-mips/socket.h
+++ b/include/asm-mips/socket.h
@@ -1,5 +1,5 @@
/*
- * $Id:$
+ * $Id: socket.h,v 1.4 1997/12/06 23:55:49 ralf Exp $
*/
#ifndef __ASM_MIPS_SOCKET_H
#define __ASM_MIPS_SOCKET_H
@@ -52,6 +52,10 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
#define SO_BINDTODEVICE 25
+/* Socket filtering */
+#define SO_ATTACH_FILTER 26
+#define SO_DETACH_FILTER 27
+
/* Types of sockets. */
#define SOCK_DGRAM 1 /* Connectionless, unreliable datagrams
of fixed maximum length. */
diff --git a/include/asm-mips/softirq.h b/include/asm-mips/softirq.h
index 8d73fed78..7a47d780f 100644
--- a/include/asm-mips/softirq.h
+++ b/include/asm-mips/softirq.h
@@ -7,6 +7,8 @@
*/
extern atomic_t __mips_bh_counter;
+extern unsigned int local_bh_count[NR_CPUS];
+
#define get_active_bhs() (bh_mask & bh_active)
static inline void clear_active_bhs(unsigned long x)
@@ -58,36 +60,21 @@ extern inline void enable_bh(int nr)
bh_mask |= 1 << nr;
}
-/*
- * start_bh_atomic/end_bh_atomic also nest
- * naturally by using a counter
- */
extern inline void start_bh_atomic(void)
{
-#ifdef __SMP__
- atomic_inc(&__mips_bh_counter);
- synchronize_irq();
-#else
- atomic_inc(&__mips_bh_counter);
-#endif
+ local_bh_count[smp_processor_id()]++;
+ barrier();
}
extern inline void end_bh_atomic(void)
{
- atomic_dec(&__mips_bh_counter);
+ barrier();
+ local_bh_count[smp_processor_id()]--;
}
-#ifndef __SMP__
-
/* These are for the irq's testing the lock */
-#define softirq_trylock() (atomic_read(&__mips_bh_counter) ? \
- 0 : \
- ((atomic_set(&__mips_bh_counter,1)),1))
-#define softirq_endlock() (atomic_set(&__mips_bh_counter, 0))
-
-#else
-
-#error FIXME
+#define softirq_trylock(cpu) (local_bh_count[cpu] ? 0 : (local_bh_count[cpu] = 1))
+#define softirq_endlock(cpu) (local_bh_count[cpu] = 0)
+#define synchronize_bh() do { } while (0)
-#endif /* __SMP__ */
#endif /* __ASM_MIPS_SOFTIRQ_H */
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index 1481c667d..0c9de1627 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -8,46 +8,57 @@
#include <asm/asm.h>
#include <asm/offset.h>
+#include <asm/cacheops.h> /* XXX */
#define SAVE_ALL \
.set push; \
+ .set mips3; \
.set reorder; \
mfc0 k0, CP0_STATUS; \
sll k0, 3; /* extract cu0 bit */ \
- .set pop; \
+ .set noreorder; \
bltz k0, 8f; \
move k1, sp; \
+ .set reorder; \
/* Called from user mode, new stack. */ \
lui k1, %hi(kernelsp); \
lw k1, %lo(kernelsp)(k1); \
8: \
move k0, sp; \
- subu sp, k1, PT_SIZE; \
+ /* subu sp, k1, PT_SIZE; */ \
+ subu sp, k1, ((PT_SIZE + 31) & ~31); \
+ ori sp, 31; \
+ xori sp, 31; \
+ cache Create_Dirty_Excl_D, (sp); \
+ cache Create_Dirty_Excl_D, 32(sp); \
+ cache Create_Dirty_Excl_D, 64(sp); \
+ cache Create_Dirty_Excl_D, 96(sp); \
+ cache Create_Dirty_Excl_D, 128(sp); \
sw k0, PT_R29(sp); \
- sw $2, PT_R2(sp); \
+ sw $3, PT_R3(sp); \
sw $1, PT_R1(sp); \
sw $2, PT_OR2(sp); \
sw $0, PT_R0(sp); \
- mfc0 v0, CP0_STATUS; \
- sw $3, PT_R3(sp); \
- sw v0, PT_STATUS(sp); \
+ mfc0 v1, CP0_STATUS; \
+ sw $2, PT_R2(sp); \
+ sw v1, PT_STATUS(sp); \
sw $4, PT_R4(sp); \
- mfc0 v0, CP0_CAUSE; \
+ mfc0 v1, CP0_CAUSE; \
sw $5, PT_R5(sp); \
- sw v0, PT_CAUSE(sp); \
+ sw v1, PT_CAUSE(sp); \
sw $6, PT_R6(sp); \
- mfc0 v0, CP0_EPC; \
+ mfc0 v1, CP0_EPC; \
sw $7, PT_R7(sp); \
- sw v0, PT_EPC(sp); \
+ sw v1, PT_EPC(sp); \
sw $7, PT_OR7(sp); \
sw $8, PT_R8(sp); \
- mfhi v0; \
+ mfhi v1; \
sw $9, PT_R9(sp); \
- sw v0, PT_HI(sp); \
+ sw v1, PT_HI(sp); \
sw $10,PT_R10(sp); \
- mflo v0; \
+ mflo v1; \
sw $11, PT_R11(sp); \
- sw v0, PT_LO(sp); \
+ sw v1, PT_LO(sp); \
sw $12, PT_R12(sp); \
sw $13, PT_R13(sp); \
sw $14, PT_R14(sp); \
@@ -64,7 +75,8 @@
sw $25, PT_R25(sp); \
sw $28, PT_R28(sp); \
sw $30, PT_R30(sp); \
- sw $31, PT_R31(sp);
+ sw $31, PT_R31(sp); \
+ .set pop
/*
* Note that we restore the IE flags from stack. This means
diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h
index 4d27f768b..5bbc1a4b8 100644
--- a/include/asm-mips/types.h
+++ b/include/asm-mips/types.h
@@ -67,6 +67,7 @@ typedef __signed__ long s64;
typedef unsigned long u64;
#endif
+#define BITS_PER_LONG _MIPS_SZLONG
#endif /* __KERNEL__ */
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 22694b75f..854c95257 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -1003,7 +1003,7 @@
#define __NR_time (__NR_Linux + 13)
#define __NR_mknod (__NR_Linux + 14)
#define __NR_chmod (__NR_Linux + 15)
-#define __NR_chown (__NR_Linux + 16)
+#define __NR_lchown (__NR_Linux + 16)
#define __NR_break (__NR_Linux + 17)
#define __NR_oldstat (__NR_Linux + 18)
#define __NR_lseek (__NR_Linux + 19)
@@ -1189,11 +1189,12 @@
#define __NR_rt_sigsuspend (__NR_Linux + 199)
#define __NR_pread (__NR_Linux + 200)
#define __NR_pwrite (__NR_Linux + 201)
+#define __NR_chown (__NR_Linux + 202)
/*
* Offset of the last Linux flavoured syscall
*/
-#define __NR_Linux_syscalls 201
+#define __NR_Linux_syscalls 202
#ifndef __LANGUAGE_ASSEMBLY__
diff --git a/include/asm-ppc/adb.h b/include/asm-ppc/adb.h
new file mode 100644
index 000000000..92fd06e02
--- /dev/null
+++ b/include/asm-ppc/adb.h
@@ -0,0 +1,57 @@
+/*
+ * Definitions for ADB (Apple Desktop Bus) support.
+ */
+#ifndef __PPC_ADB_H
+#define __PPC_ADB_H
+
+/* ADB commands */
+#define ADB_BUSRESET 0
+#define ADB_FLUSH(id) (1 + ((id) << 4))
+#define ADB_WRITEREG(id, reg) (8 + (reg) + ((id) << 4))
+#define ADB_READREG(id, reg) (0xc + (reg) + ((id) << 4))
+
+/* ADB default device IDs (upper 4 bits of ADB command byte) */
+#define ADB_DONGLE 1 /* "software execution control" devices */
+#define ADB_KEYBOARD 2
+#define ADB_MOUSE 3
+#define ADB_TABLET 4
+#define ADB_MODEM 5
+#define ADB_MISC 7 /* maybe a monitor */
+
+
+#ifdef __KERNEL__
+
+struct adb_request {
+ unsigned char data[16];
+ int nbytes;
+ unsigned char reply[16];
+ int reply_len;
+ unsigned char reply_expected;
+ unsigned char sent;
+ unsigned char complete;
+ void (*done)(struct adb_request *);
+ void *arg;
+ struct adb_request *next;
+};
+
+extern enum adb_hw {
+ ADB_NONE, ADB_VIACUDA, ADB_VIAPMU, ADB_MACIO
+} adb_hardware;
+
+extern int (*adb_send_request)(struct adb_request *req, int sync);
+extern int (*adb_autopoll)(int on);
+
+/* Values for adb_request flags */
+#define ADBREQ_REPLY 1 /* expect reply */
+#define ADBREQ_SYNC 2 /* poll until done */
+
+void adb_init(void);
+int adb_request(struct adb_request *req, void (*done)(struct adb_request *),
+ int flags, int nbytes, ...);
+int adb_register(int default_id,
+ void (*handler)(unsigned char *, int, struct pt_regs *, int));
+void adb_input(unsigned char *, int, struct pt_regs *, int);
+
+#endif /* __KERNEL__ */
+
+#endif /* __PPC_ADB_H */
diff --git a/include/asm-ppc/adb_mouse.h b/include/asm-ppc/adb_mouse.h
new file mode 100644
index 000000000..879178043
--- /dev/null
+++ b/include/asm-ppc/adb_mouse.h
@@ -0,0 +1,23 @@
+#ifndef _LINUX_ADB_MOUSE_H
+#define _LINUX_ADB_MOUSE_H
+
+/*
+ * linux/include/linux/mac_mouse.h
+ * header file for Macintosh ADB mouse driver
+ * 27-10-97 Michael Schmitz
+ * copied from:
+ * header file for Atari Mouse driver
+ * by Robert de Vries (robert@and.nl) on 19Jul93
+ */
+
+struct mouse_status {
+ char buttons;
+ short dx;
+ short dy;
+ int ready;
+ int active;
+ struct wait_queue *wait;
+ struct fasync_struct *fasyncptr;
+};
+
+#endif
diff --git a/include/asm-ppc/atomic.h b/include/asm-ppc/atomic.h
index 6070ea738..01911bee9 100644
--- a/include/asm-ppc/atomic.h
+++ b/include/asm-ppc/atomic.h
@@ -17,6 +17,7 @@ typedef struct { int counter; } atomic_t;
#define atomic_set(v,i) (((v)->counter) = (i))
extern void atomic_add(int a, atomic_t *v);
+extern int atomic_add_return(int a, atomic_t *v);
extern void atomic_sub(int a, atomic_t *v);
extern void atomic_inc(atomic_t *v);
extern int atomic_inc_return(atomic_t *v);
diff --git a/include/asm-ppc/cache.h b/include/asm-ppc/cache.h
index 8bdffcdfb..53bc673e6 100644
--- a/include/asm-ppc/cache.h
+++ b/include/asm-ppc/cache.h
@@ -5,9 +5,8 @@
#define __ARCH_PPC_CACHE_H
/* bytes per L1 cache line */
-/* a guess */ /* a correct one -- Cort */
#define L1_CACHE_BYTES 32
-
#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
+#define L1_CACHE_PAGES 8
#endif
diff --git a/include/asm-ppc/cuda.h b/include/asm-ppc/cuda.h
index 3f1a47cf2..7c6375c9f 100644
--- a/include/asm-ppc/cuda.h
+++ b/include/asm-ppc/cuda.h
@@ -13,20 +13,6 @@
#define POWER_PACKET 4
#define MACIIC_PACKET 5
-/* ADB commands (2nd byte) */
-#define ADB_BUSRESET 0
-#define ADB_FLUSH(id) (1 + ((id) << 4))
-#define ADB_WRITEREG(id, reg) (8 + (reg) + ((id) << 4))
-#define ADB_READREG(id, reg) (0xc + (reg) + ((id) << 4))
-
-/* ADB default device IDs (upper 4 bits of 2nd byte) */
-#define ADB_DONGLE 1 /* "software execution control" devices */
-#define ADB_KEYBOARD 2
-#define ADB_MOUSE 3
-#define ADB_TABLET 4
-#define ADB_MODEM 5
-#define ADB_MISC 7 /* maybe a monitor */
-
/* CUDA commands (2nd byte) */
#define CUDA_WARM_START 0
#define CUDA_AUTOPOLL 1
@@ -50,25 +36,10 @@
#ifdef __KERNEL__
-struct cuda_request {
- unsigned char data[16];
- int nbytes;
- unsigned char reply[16];
- int reply_len;
- unsigned char reply_expected;
- unsigned char sent;
- unsigned char got_reply;
- void (*done)(struct cuda_request *);
- void *arg;
- struct cuda_request *next;
-};
-
void via_cuda_init(void);
-int cuda_request(struct cuda_request *req,
- void (*done)(struct cuda_request *), int nbytes, ...);
-int cuda_send_request(struct cuda_request *req);
+int cuda_request(struct adb_request *req,
+ void (*done)(struct adb_request *), int nbytes, ...);
+int cuda_send_request(struct adb_request *req);
void cuda_poll(void);
-int adb_register(int default_id,
- void (*handler)(unsigned char *, int, struct pt_regs *));
#endif /* __KERNEL */
diff --git a/include/asm-ppc/delay.h b/include/asm-ppc/delay.h
index 9da227167..74b3d62f7 100644
--- a/include/asm-ppc/delay.h
+++ b/include/asm-ppc/delay.h
@@ -29,4 +29,3 @@ extern __inline__ void udelay(unsigned long usecs)
}
#endif /* defined(_PPC_DELAY_H) */
-
diff --git a/include/asm-ppc/dma.h b/include/asm-ppc/dma.h
index f27c4c988..fd50bc241 100644
--- a/include/asm-ppc/dma.h
+++ b/include/asm-ppc/dma.h
@@ -3,9 +3,11 @@
* Written by Hennus Bergman, 1992.
* High DMA channel support & info by Hannu Savolainen
* and John Boyd, Nov. 1992.
+ * Changes for ppc sound by Christoph Nadig
*/
#include <linux/config.h>
+#include <asm/io.h>
/*
* Note: Adapted for PowerPC by Gary Thomas
@@ -31,8 +33,31 @@
/* Doesn't really apply... */
#define MAX_DMA_ADDRESS 0xFFFFFFFF
-#if defined(CONFIG_PREP) || defined(CONFIG_CHRP)
-#include <asm/io.h> /* need byte IO */
+#if defined(CONFIG_MACH_SPECIFIC)
+
+#if defined(CONFIG_PREP)
+#define DMA_MODE_READ 0x44
+#define DMA_MODE_WRITE 0x48
+#define ISA_DMA_THRESHOLD 0x00ffffff
+#endif /* CONFIG_PREP */
+
+#if defined(CONFIG_CHRP)
+#define DMA_MODE_READ 0x44
+#define DMA_MODE_WRITE 0x48
+#define ISA_DMA_THRESHOLD ~0L
+#endif /* CONFIG_CHRP */
+
+#ifdef CONFIG_PMAC
+#define DMA_MODE_READ 1
+#define DMA_MODE_WRITE 2
+#define ISA_DMA_THRESHOLD ~0L
+#endif /* CONFIG_PMAC */
+
+#else
+/* in arch/ppc/kernel/setup.c -- Cort */
+extern unsigned long DMA_MODE_WRITE, DMA_MODE_READ;
+extern unsigned long ISA_DMA_THRESHOLD;
+#endif
#ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER
@@ -92,8 +117,20 @@
*
*/
-#define POWERSTACK_SND_DMA 6
-#define POWERSTACK_SND_DMA2 7
+/* used in nasty hack for sound - see prep_setup_arch() -- Cort */
+extern long ppc_cs4232_dma, ppc_cs4232_dma2;
+#ifdef CONFIG_CS4232
+#define SND_DMA1 ppc_cs4232_dma
+#define SND_DMA2 ppc_cs4232_dma2
+#else
+#ifdef CONFIG_MSS
+#define SND_DMA1 CONFIG_MSS_DMA
+#define SND_DMA2 CONFIG_MSS_DMA2
+#else
+#define SND_DMA1 -1
+#define SND_DMA2 -1
+#endif
+#endif
/* 8237 DMA controllers */
#define IO_DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */
@@ -159,8 +196,6 @@
#define DMA1_EXT_REG 0x40B
#define DMA2_EXT_REG 0x4D6
-#define DMA_MODE_READ 0x44 /* I/O to memory, no autoinit, increment, single mode */
-#define DMA_MODE_WRITE 0x48 /* memory to I/O, no autoinit, increment, single mode */
#define DMA_MODE_CASCADE 0xC0 /* pass thru DREQ->HRQ, DACK<-HLDA only */
/* enable/disable a specific DMA channel */
@@ -235,20 +270,24 @@ static __inline__ void set_dma_page(unsigned int dmanr, int pagenr)
break;
case 3:
dma_outb(pagenr, DMA_LO_PAGE_3);
+ dma_outb(pagenr>>8, DMA_HI_PAGE_3);
break;
case 5:
- dma_outb(pagenr & 0xfe, DMA_LO_PAGE_5);
+ if (SND_DMA1 == 5 || SND_DMA2 == 5)
+ dma_outb(pagenr, DMA_LO_PAGE_5);
+ else
+ dma_outb(pagenr & 0xfe, DMA_LO_PAGE_5);
dma_outb(pagenr>>8, DMA_HI_PAGE_5);
break;
case 6:
- if (POWERSTACK_SND_DMA == 6 || POWERSTACK_SND_DMA2 == 6)
+ if (SND_DMA1 == 6 || SND_DMA2 == 6)
dma_outb(pagenr, DMA_LO_PAGE_6);
else
dma_outb(pagenr & 0xfe, DMA_LO_PAGE_6);
dma_outb(pagenr>>8, DMA_HI_PAGE_6);
break;
case 7:
- if (POWERSTACK_SND_DMA == 7 || POWERSTACK_SND_DMA2 == 7)
+ if (SND_DMA1 == 7 || SND_DMA2 == 7)
dma_outb(pagenr, DMA_LO_PAGE_7);
else
dma_outb(pagenr & 0xfe, DMA_LO_PAGE_7);
@@ -267,7 +306,7 @@ static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int phys)
dma_outb( phys & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
dma_outb( (phys>>8) & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
} else {
- if (dmanr == POWERSTACK_SND_DMA || dmanr == POWERSTACK_SND_DMA2) {
+ if (dmanr == SND_DMA1 || dmanr == SND_DMA2) {
dma_outb( phys & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
dma_outb( (phys>>8) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
dma_outb( (dmanr&3), DMA2_EXT_REG);
@@ -295,7 +334,7 @@ static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
dma_outb( count & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
dma_outb( (count>>8) & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
} else {
- if (dmanr == POWERSTACK_SND_DMA || dmanr == POWERSTACK_SND_DMA2) {
+ if (dmanr == SND_DMA1 || dmanr == SND_DMA2) {
dma_outb( count & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
dma_outb( (count>>8) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
} else {
@@ -325,18 +364,10 @@ static __inline__ int get_dma_residue(unsigned int dmanr)
count = 1 + dma_inb(io_port);
count += dma_inb(io_port) << 8;
- return (dmanr<=3)? count : (count<<1);
+ return (dmanr <= 3 || dmanr == SND_DMA1 || dmanr == SND_DMA2)
+ ? count : (count<<1);
}
-#endif /* CONFIG_PREP || CONFIG_CHRP */
-
-#ifdef CONFIG_PMAC
-
-#define DMA_MODE_READ 1
-#define DMA_MODE_WRITE 2
-
-#endif /* CONFIG_PMAC */
-
/* These are in kernel/dma.c: */
extern void free_dma(unsigned int dmanr); /* release it again */
diff --git a/include/asm-ppc/elf.h b/include/asm-ppc/elf.h
index 76684b4ed..394b9db56 100644
--- a/include/asm-ppc/elf.h
+++ b/include/asm-ppc/elf.h
@@ -42,4 +42,41 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
sizeof(struct pt_regs) < sizeof(elf_gregset_t)? \
sizeof(struct pt_regs): sizeof(elf_gregset_t));
+
+/* This yields a mask that user programs can use to figure out what
+ instruction set this cpu supports. This could be done in userspace,
+ but it's not easy, and we've already done it here. */
+
+#define ELF_HWCAP (0)
+
+/* This yields a string that ld.so will use to load implementation
+ specific libraries for optimization. This is more specific in
+ intent than poking at uname or /proc/cpuinfo.
+
+ For the moment, we have only optimizations for the Intel generations,
+ but that could change... */
+
+#define ELF_PLATFORM (NULL)
+
+#ifdef __KERNEL__
+#define SET_PERSONALITY(ibcs2) current->personality = (ibcs2 ? PER_SVR4 : PER_LINUX)
+#endif
+
+
+/* This yields a mask that user programs can use to figure out what
+ instruction set this cpu supports. */
+
+#define ELF_HWCAP (0)
+
+/* This yields a string that ld.so will use to load implementation
+ specific libraries for optimization. This is more specific in
+ intent than poking at uname or /proc/cpuinfo. */
+
+#define ELF_PLATFORM (NULL)
+
+#ifdef __KERNEL__
+#define SET_PERSONALITY(ex, ibcs2) \
+ current->personality = (ibcs2 ? PER_SVR4 : PER_LINUX)
+#endif
+
#endif
diff --git a/include/asm-ppc/gg2.h b/include/asm-ppc/gg2.h
new file mode 100644
index 000000000..8aa3ba2ac
--- /dev/null
+++ b/include/asm-ppc/gg2.h
@@ -0,0 +1,59 @@
+/*
+ * asm-ppc/gg2.h -- VLSI VAS96011/12 `Golden Gate 2' register definitions
+ *
+ * Copyright (C) 1997 Geert Uytterhoeven
+ *
+ * This file is based on the following documentation:
+ *
+ * The VAS96011/12 Chipset, Data Book, Edition 1.0
+ * VLSI Technology, Inc.
+ *
+ * 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.
+ */
+
+#ifndef _ASMPPC_GG2_H
+#define _ASMPPC_GG2_H
+
+ /*
+ * Memory Map (CHRP mode)
+ */
+
+#define GG2_PCI_MEM_BASE 0xc0000000 /* Peripheral memory space */
+#define GG2_ISA_MEM_BASE 0xf7000000 /* Peripheral memory alias */
+#define GG2_ISA_IO_BASE 0xf8000000 /* Peripheral I/O space */
+#define GG2_PCI_CONFIG_BASE 0xfec00000 /* PCI configuration space */
+#define GG2_INT_ACK_SPECIAL 0xfec80000 /* Interrupt acknowledge and */
+ /* special PCI cycles */
+#define GG2_ROM_BASE0 0xff000000 /* ROM bank 0 */
+#define GG2_ROM_BASE1 0xff800000 /* ROM bank 1 */
+
+
+ /*
+ * GG2 specific PCI Registers
+ */
+
+#define GG2_PCI_BUSNO 0x40 /* Bus number */
+#define GG2_PCI_SUBBUSNO 0x41 /* Subordinate bus number */
+#define GG2_PCI_DISCCTR 0x42 /* Disconnect counter */
+#define GG2_PCI_PPC_CTRL 0x50 /* PowerPC interface control register */
+#define GG2_PCI_ADDR_MAP 0x5c /* Address map */
+#define GG2_PCI_PCI_CTRL 0x60 /* PCI interface control register */
+#define GG2_PCI_ROM_CTRL 0x70 /* ROM interface control register */
+#define GG2_PCI_ROM_TIME 0x74 /* ROM timing */
+#define GG2_PCI_CC_CTRL 0x80 /* Cache controller control register */
+#define GG2_PCI_DRAM_BANK0 0x90 /* Control register for DRAM bank #0 */
+#define GG2_PCI_DRAM_BANK1 0x94 /* Control register for DRAM bank #1 */
+#define GG2_PCI_DRAM_BANK2 0x98 /* Control register for DRAM bank #2 */
+#define GG2_PCI_DRAM_BANK3 0x9c /* Control register for DRAM bank #3 */
+#define GG2_PCI_DRAM_BANK4 0xa0 /* Control register for DRAM bank #4 */
+#define GG2_PCI_DRAM_BANK5 0xa4 /* Control register for DRAM bank #5 */
+#define GG2_PCI_DRAM_TIME0 0xb0 /* Timing parameters set #0 */
+#define GG2_PCI_DRAM_TIME1 0xb4 /* Timing parameters set #1 */
+#define GG2_PCI_DRAM_CTRL 0xc0 /* DRAM control */
+#define GG2_PCI_ERR_CTRL 0xd0 /* Error control register */
+#define GG2_PCI_ERR_STATUS 0xd4 /* Error status register */
+ /* Cleared when read */
+
+#endif /* _ASMPPC_GG2_H */
diff --git a/include/asm-ppc/hardirq.h b/include/asm-ppc/hardirq.h
index a21a9e0d4..454934f39 100644
--- a/include/asm-ppc/hardirq.h
+++ b/include/asm-ppc/hardirq.h
@@ -21,7 +21,8 @@ extern spinlock_t global_irq_lock;
extern atomic_t global_irq_count;
#define release_irqlock(cpu) \
-do { if(global_irq_holder == (unsigned char) cpu) { \
+do { \
+ if(global_irq_holder == (unsigned char) cpu) { \
global_irq_holder = NO_PROC_ID; \
spin_unlock(&global_irq_lock); \
} \
diff --git a/include/asm-ppc/hydra.h b/include/asm-ppc/hydra.h
index bb291c8b1..2f6303350 100644
--- a/include/asm-ppc/hydra.h
+++ b/include/asm-ppc/hydra.h
@@ -1,12 +1,8 @@
/*
- * linux/hydra.h -- Mac I/O `Hydra' definitions
+ * asm-ppc/hydra.h -- Mac I/O `Hydra' definitions
*
* Copyright (C) 1997 Geert Uytterhoeven
*
- * 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.
- *
* This file is based on the following documentation:
*
* Macintosh Technology in the Common Hardware Reference Platform
@@ -98,8 +94,9 @@ extern volatile struct Hydra *Hydra;
#define HYDRA_INT_EXT7 18
#define HYDRA_INT_SPARE 19
+extern int hydra_init(void);
+extern void macio_adb_init(void);
+
#endif /* __KERNEL__ */
-volatile struct Hydra *find_hydra(void);
-void hydra_post_openpic_init(void);
#endif /* _ASMPPC_HYDRA_H */
diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h
index 4cce72d28..14f8d3312 100644
--- a/include/asm-ppc/ide.h
+++ b/include/asm-ppc/ide.h
@@ -13,22 +13,32 @@
#ifdef __KERNEL__
-#include <linux/config.h>
+#include <linux/ioport.h>
+#include <asm/io.h> /* so we can redefine insw/outsw */
#ifndef MAX_HWIFS
#define MAX_HWIFS 4
#endif
+#undef SUPPORT_SLOW_DATA_PORTS
+#define SUPPORT_SLOW_DATA_PORTS 0
+#undef SUPPORT_VLB_SYNC
+#define SUPPORT_VLB_SYNC 0
+
+
#define ide_sti() sti()
-typedef unsigned short ide_ioreg_t;
+typedef unsigned long ide_ioreg_t;
void ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq);
void prep_ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq);
void pmac_ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq);
+void ide_insw(ide_ioreg_t port, void *buf, int ns);
+void ide_outsw(ide_ioreg_t port, void *buf, int ns);
-#if defined(CONFIG_PREP) || defined(CONFIG_CHRP)
static __inline__ int ide_default_irq(ide_ioreg_t base)
{
+ if ( _machine == _MACH_Pmac )
+ return 0;
switch (base) {
case 0x1f0: return 13;
case 0x170: return 13;
@@ -41,6 +51,8 @@ static __inline__ int ide_default_irq(ide_ioreg_t base)
static __inline__ ide_ioreg_t ide_default_io_base(int index)
{
+ if ( _machine == _MACH_Pmac )
+ return index;
switch (index) {
case 0: return 0x1f0;
case 1: return 0x170;
@@ -51,53 +63,52 @@ static __inline__ ide_ioreg_t ide_default_io_base(int index)
}
}
-typedef union {
- unsigned all : 8; /* all of the bits together */
- struct {
- unsigned head : 4; /* always zeros here */
- unsigned unit : 1; /* drive select number, 0 or 1 */
- unsigned bit5 : 1; /* always 1 */
- unsigned lba : 1; /* using LBA instead of CHS */
- unsigned bit7 : 1; /* always 1 */
- } b;
-} select_t;
-
static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
{
+ if ( _machine == _MACH_Pmac )
+ return 0;
return check_region(from, extent);
}
static __inline__ void ide_request_region (ide_ioreg_t from, unsigned int extent, const char *name)
{
+ if ( _machine == _MACH_Pmac )
+ return;
request_region(from, extent, name);
}
static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent)
{
+ if ( _machine == _MACH_Pmac )
+ return;
release_region(from, extent);
}
-#define ide_fix_driveid(id) do {} while (0)
-
-#endif /* CONFIG_CHRP || CONFIG_PREP */
-
-
-#ifdef CONFIG_PMAC
-
-#include <asm/io.h> /* so we can redefine insw/outsw */
-
-typedef unsigned long ide_ioreg_t;
+#define ide_fix_driveid(id) do { \
+ int nh; \
+ unsigned short *p = (unsigned short *) id; \
+ if ( _machine == _MACH_Pmac ) \
+ for (nh = SECTOR_WORDS * 2; nh != 0; --nh, ++p) \
+ *p = (*p << 8) + (*p >> 8); \
+} while (0)
-static __inline__ int ide_default_irq(ide_ioreg_t base)
-{
- return 0;
-}
-
-extern __inline__ ide_ioreg_t ide_default_io_base(int index)
-{
- return index;
-}
+#undef insw
+#define insw(port, buf, ns) do { \
+ if ( _machine != _MACH_Pmac ) \
+ /* this must be the same as insw in io.h!! */ \
+ _insw((unsigned short *)((port)+_IO_BASE), (buf), (ns)); \
+ else \
+ ide_insw((port), (buf), (ns)); \
+} while (0)
+#undef outsw
+#define outsw(port, buf, ns) do { \
+ if ( _machine != _MACH_Pmac ) \
+ /* this must be the same as outsw in io.h!! */ \
+ _outsw((unsigned short *)((port)+_IO_BASE), (buf), (ns)); \
+ else \
+ ide_outsw((port), (buf), (ns)); \
+} while (0)
typedef union {
unsigned all : 8; /* all of the bits together */
@@ -110,41 +121,6 @@ typedef union {
} b;
} select_t;
-#undef SUPPORT_SLOW_DATA_PORTS
-#define SUPPORT_SLOW_DATA_PORTS 0
-#undef SUPPORT_VLB_SYNC
-#define SUPPORT_VLB_SYNC 0
-
-static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
-{
- return 0;
-}
-
-static __inline__ void ide_request_region (ide_ioreg_t from, unsigned int extent, const char *name)
-{
-}
-
-static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent)
-{
-}
-
-#undef insw
-#undef outsw
-#define insw(port, buf, ns) ide_insw((port), (buf), (ns))
-#define outsw(port, buf, ns) ide_outsw((port), (buf), (ns))
-
-void ide_insw(ide_ioreg_t port, void *buf, int ns);
-void ide_outsw(ide_ioreg_t port, void *buf, int ns);
-
-#define ide_fix_driveid(id) do { \
- int nh; \
- unsigned short *p = (unsigned short *) id; \
- for (nh = SECTOR_WORDS * 2; nh != 0; --nh, ++p) \
- *p = (*p << 8) + (*p >> 8); \
-} while (0)
-
-#endif
-
static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *device, void *dev_id)
{
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index bc0d16497..9e2f23c3c 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -16,14 +16,47 @@
#define IBM_L2_INVALIDATE 0x814
#define IBM_SYS_CTL 0x81c
-extern unsigned long io_base;
#define SLOW_DOWN_IO
-#define _IO_BASE io_base
-extern unsigned long pci_dram_offset;
+#define PMAC_ISA_IO_BASE 0
+#define PMAC_ISA_MEM_BASE 0
+#define PMAC_PCI_DRAM_OFFSET 0
+#define CHRP_ISA_IO_BASE 0xf8000000
+#define CHRP_ISA_MEM_BASE 0xf7000000
+#define CHRP_PCI_DRAM_OFFSET 0
+#define PREP_ISA_IO_BASE 0x80000000
+#define PREP_ISA_MEM_BASE 0xd0000000
+/*#define PREP_ISA_MEM_BASE 0xc0000000*/
+#define PREP_PCI_DRAM_OFFSET 0x80000000
+
+#if defined(CONFIG_MACH_SPECIFIC)
+#ifdef CONFIG_PREP
+#define _IO_BASE PREP_ISA_IO_BASE
+#define _ISA_MEM_BASE PREP_ISA_MEM_BASE
+#define PCI_DRAM_OFFSET PREP_PCI_DRAM_OFFSET
+#endif /* CONFIG_PREP */
+
+#ifdef CONFIG_CHRP
+#define _IO_BASE CHRP_ISA_IO_BASE
+#define _ISA_MEM_BASE CHRP_ISA_MEM_BASE
+#define PCI_DRAM_OFFSET CHRP_PCI_DRAM_OFFSET
+#endif /* CONFIG_CHRP */
+
+#ifdef CONFIG_PMAC
+#define _IO_BASE PMAC_ISA_IO_BASE
+#define _ISA_MEM_BASE PMAC_ISA_MEM_BASE
+#define PCI_DRAM_OFFSET PMAC_PCI_DRAM_OFFSET
+#endif /* CONFIG_PMAC */
+
+#else /* CONFIG_MACH_SPECIFIC */
+extern unsigned long isa_io_base;
+#define _IO_BASE isa_io_base
+extern unsigned long isa_mem_base;
+#define _ISA_MEM_BASE isa_mem_base
#undef PCI_DRAM_OFFSET
#define PCI_DRAM_OFFSET pci_dram_offset
-
+extern unsigned long pci_dram_offset;
+#endif /* CONFIG_MACH_SPECIFIC */
#define readb(addr) (*(volatile unsigned char *) (addr))
#define readw(addr) ld_le16((volatile unsigned short *)(addr))
#define readl(addr) ld_le32((volatile unsigned *)addr)
@@ -59,6 +92,10 @@ extern void _outsw(volatile unsigned short *port, const void *buf, int ns);
extern void _insl(volatile unsigned long *port, void *buf, int nl);
extern void _outsl(volatile unsigned long *port, const void *buf, int nl);
+#define memset_io(a,b,c) memset((a),(b),(c))
+#define memcpy_fromio(a,b,c) memcpy((a),(b),(c))
+#define memcpy_toio(a,b,c) memcpy((a),(b),(c))
+
#ifdef __KERNEL__
/*
* The PCI bus is inherently Little-Endian. The PowerPC is being
diff --git a/include/asm-ppc/ioctls.h b/include/asm-ppc/ioctls.h
index 7bbf41cf0..0f879c163 100644
--- a/include/asm-ppc/ioctls.h
+++ b/include/asm-ppc/ioctls.h
@@ -86,6 +86,8 @@
#define TIOCSBRK 0x5427 /* BSD compatibility */
#define TIOCCBRK 0x5428 /* BSD compatibility */
#define TIOCGSID 0x5429 /* Return the session ID of FD */
+#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
#define TIOCSERCONFIG 0x5453
#define TIOCSERGWILD 0x5454
diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h
index 28e788a65..26a481e5d 100644
--- a/include/asm-ppc/irq.h
+++ b/include/asm-ppc/irq.h
@@ -1,8 +1,6 @@
#ifndef _ASM_IRQ_H
#define _ASM_IRQ_H
-#include <linux/config.h>
-
/*
* this is the # irq's for all ppc arch's (pmac/chrp/prep)
* so it is the max of them all - which happens to be chrp
diff --git a/include/asm-ppc/linux_logo.h b/include/asm-ppc/linux_logo.h
index 7e88d4ccf..02a237a2c 100644
--- a/include/asm-ppc/linux_logo.h
+++ b/include/asm-ppc/linux_logo.h
@@ -13,10 +13,13 @@
#include <linux/init.h>
+#define linux_logo_banner "Linux/PPC version " UTS_RELEASE
+
#define LINUX_LOGO_HEIGHT 80
#define LINUX_LOGO_WIDTH 80
#define LINUX_LOGO_COLORS 221
+#ifdef INCLUDE_LINUX_LOGO_DATA
unsigned char linux_logo_red[] __initdata = {
0xF3, 0xF6, 0xF8, 0xF7, 0xEF, 0xE7, 0xE5, 0xE3,
0xCA, 0xD4, 0xDD, 0xC8, 0xC7, 0xC4, 0xC2, 0xE5,
@@ -912,3 +915,562 @@ unsigned char linux_logo[] __initdata = {
0xD0, 0x5E, 0xD0, 0xD1, 0xCB, 0x58, 0x4C, 0xCF,
0xCF, 0xCE, 0xCE, 0x57, 0x63, 0xCC, 0xCD, 0x57,
};
+
+unsigned char linux_logo_bw[] __initdata = {
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x3F,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F,
+ 0xFE, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFE, 0x3F, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFE, 0x7F, 0xFF, 0xC7, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xC3,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF,
+ 0xFB, 0xE3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFD, 0xFF, 0xFF, 0xE1, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0xF1, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0xF1,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF,
+ 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xF9, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xF9, 0xCF, 0xC3, 0xF8, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x87, 0x81, 0xF9,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xA7,
+ 0x99, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xF9, 0xF3, 0xBC, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xF9, 0xE3, 0xBC, 0xF9, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xB0, 0x3C, 0xF9,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xB0,
+ 0x19, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xF9, 0xC0, 0x03, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xF9, 0x80, 0x01, 0xF8, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x80, 0x01, 0xF8,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x80,
+ 0x01, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xF9, 0xC0, 0x21, 0xD8, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xF9, 0xB1, 0x80, 0xEC, 0xC0, 0x1F,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xF1, 0x90, 0x00, 0xE4,
+ 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xF1, 0x8C,
+ 0xC0, 0x7C, 0x04, 0x81, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xE3, 0x80, 0x00, 0x7C, 0x40, 0x11, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xE3, 0x80, 0x00, 0x7F, 0xD2, 0x29,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x87, 0x00, 0x00, 0x3F,
+ 0x80, 0x19, 0xFF, 0xFF, 0xFF, 0xFF, 0x0E, 0x00,
+ 0x00, 0x3F, 0x80, 0x19, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x1E, 0x00, 0x00, 0x1F, 0x80, 0x19, 0xFF, 0xFF,
+ 0xFF, 0xFE, 0x1C, 0x00, 0x00, 0x1E, 0x80, 0x19,
+ 0xFF, 0xFF, 0xFF, 0xFE, 0x3C, 0x00, 0x00, 0x1E,
+ 0x80, 0x11, 0xFF, 0xFF, 0xFF, 0xFC, 0x7C, 0x00,
+ 0x00, 0x0F, 0x80, 0x11, 0xFF, 0xFF, 0xFF, 0xFC,
+ 0xF8, 0x00, 0x00, 0x0E, 0x80, 0x11, 0xFF, 0xFF,
+ 0xFF, 0xFC, 0xF8, 0x00, 0x00, 0x06, 0x00, 0x11,
+ 0xFF, 0xFF, 0xFF, 0xF8, 0xF8, 0x00, 0x00, 0x06,
+ 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xF9, 0xF0, 0x00,
+ 0x00, 0x02, 0x00, 0x09, 0xFF, 0xFF, 0xFF, 0xF1,
+ 0xF0, 0x00, 0x00, 0x02, 0x80, 0x10, 0xFF, 0xFF,
+ 0xFF, 0xF1, 0xE0, 0x00, 0x00, 0x00, 0x97, 0x10,
+ 0xFF, 0xFF, 0xFF, 0xE3, 0xE0, 0x00, 0x00, 0x00,
+ 0xDF, 0xF0, 0xFF, 0xFF, 0xFF, 0xE3, 0xC0, 0x00,
+ 0x00, 0x00, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xC7,
+ 0xC0, 0x00, 0x00, 0x01, 0xFF, 0xF8, 0xFF, 0xFF,
+ 0xFF, 0xC7, 0x80, 0x00, 0x00, 0x01, 0xFF, 0xF8,
+ 0xFF, 0xFF, 0xFF, 0x8F, 0x80, 0x00, 0x00, 0x01,
+ 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0x8F, 0x80, 0x00,
+ 0x00, 0x01, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0x9F,
+ 0x80, 0x00, 0x00, 0x01, 0xFF, 0xF8, 0xFF, 0xFF,
+ 0xFF, 0x9F, 0x80, 0x00, 0x00, 0x01, 0x80, 0x18,
+ 0xFF, 0xFF, 0xFF, 0x9E, 0x80, 0x00, 0x00, 0x03,
+ 0xA8, 0x11, 0xFF, 0xFF, 0xFF, 0x9F, 0x80, 0x00,
+ 0x00, 0x02, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0x99,
+ 0x80, 0x00, 0x00, 0x00, 0x00, 0x09, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x80, 0x00, 0x00, 0x01, 0xC0, 0x01,
+ 0xFF, 0xFF, 0xFE, 0x20, 0x60, 0x00, 0x00, 0x00,
+ 0xFF, 0xC3, 0xFF, 0xFF, 0xF8, 0x00, 0x30, 0x00,
+ 0x00, 0x00, 0xFF, 0x0F, 0xFF, 0xFF, 0xC0, 0x40,
+ 0x38, 0x00, 0x00, 0x00, 0xFE, 0x47, 0xFF, 0xFF,
+ 0x81, 0x00, 0x1C, 0x00, 0x00, 0x00, 0xFC, 0x23,
+ 0xFF, 0xFF, 0x90, 0x00, 0x1E, 0x00, 0x00, 0x00,
+ 0x78, 0x11, 0xFF, 0xFF, 0x80, 0x00, 0x0F, 0x80,
+ 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00,
+ 0x07, 0xC0, 0x00, 0x00, 0x00, 0x08, 0xFF, 0xFF,
+ 0xC0, 0x00, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x04,
+ 0x7F, 0xFF, 0x80, 0x00, 0x03, 0xC0, 0x00, 0x10,
+ 0x00, 0x00, 0x1F, 0xFF, 0x80, 0x00, 0x01, 0x80,
+ 0x00, 0x30, 0x00, 0x00, 0x0F, 0xFF, 0x80, 0x00,
+ 0x00, 0x00, 0x00, 0x70, 0x00, 0x01, 0x4F, 0xFF,
+ 0x80, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00,
+ 0x0F, 0xFF, 0xC0, 0x00, 0x00, 0x80, 0x03, 0xF0,
+ 0x00, 0x00, 0x8F, 0xFF, 0x80, 0x00, 0x00, 0x40,
+ 0x0F, 0xF0, 0x00, 0x04, 0x1F, 0xFF, 0x80, 0x00,
+ 0x00, 0x7F, 0xFF, 0xF0, 0x00, 0x10, 0x1F, 0xFF,
+ 0xC0, 0x00, 0x00, 0x7F, 0xFF, 0xF0, 0x00, 0x40,
+ 0xFF, 0xFF, 0x98, 0x00, 0x00, 0xFF, 0xFF, 0xF0,
+ 0x00, 0x83, 0xFF, 0xFF, 0x81, 0xE0, 0x01, 0xFF,
+ 0xFF, 0xF8, 0x02, 0x07, 0xFF, 0xFF, 0x80, 0x3F,
+ 0x07, 0xE0, 0x00, 0x1C, 0x0C, 0x1F, 0xFF, 0xFF,
+ 0xF8, 0x03, 0xFF, 0x80, 0x00, 0x1F, 0x78, 0x1F,
+ 0xFF, 0xFF, 0xFF, 0x80, 0x7F, 0x00, 0x07, 0x0F,
+ 0xF0, 0x7F, 0xFF, 0xFF, 0xFF, 0xFE, 0x0C, 0x07,
+ 0xFF, 0x83, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x1F, 0xFF, 0xC0, 0x03, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x07, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+};
+
+unsigned char linux_logo16_red[] __initdata = {
+ 0x00, 0x90, 0xb0, 0x9c, 0xf7, 0x35, 0x83, 0xa5,
+ 0x65, 0x8f, 0x98, 0xc9, 0xdb, 0xe1, 0xe7, 0xf8
+};
+
+unsigned char linux_logo16_green[] __initdata = {
+ 0x00, 0x90, 0xb0, 0x9c, 0xf7, 0x2e, 0x83, 0xa5,
+ 0x65, 0x6e, 0x98, 0x89, 0xbf, 0xac, 0xda, 0xf8
+};
+
+unsigned char linux_logo16_blue[] __initdata = {
+ 0x00, 0x90, 0xaf, 0x9c, 0xf7, 0x2b, 0x82, 0xa5,
+ 0x65, 0x41, 0x97, 0x1e, 0x60, 0x29, 0xa5, 0xf8
+};
+
+unsigned char linux_logo16[] __initdata = {
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa1, 0x11, 0x11,
+ 0x61, 0x16, 0x66, 0x66, 0x11, 0x11, 0x11, 0x11,
+ 0x11, 0x11, 0x1a, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0x33, 0xa8, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x87, 0x77, 0x77, 0x77, 0x77,
+ 0x77, 0x77, 0x73, 0x33, 0x33, 0x3a, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xa3, 0x33, 0x33, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x77, 0x77, 0x77, 0x77,
+ 0x77, 0x27, 0x77, 0x77, 0x77, 0x33, 0x3a, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xa3, 0x33, 0x33, 0x30, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x55, 0x50, 0x08, 0x33, 0x77, 0x77,
+ 0x77, 0x72, 0x72, 0x27, 0x77, 0x77, 0x33, 0x33,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xa3, 0x33, 0x33, 0x77, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x58, 0x85, 0x00, 0x11, 0x11, 0xaa,
+ 0xa3, 0x37, 0x77, 0x72, 0x22, 0x22, 0x77, 0x73,
+ 0x33, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3,
+ 0x33, 0x37, 0x77, 0x33, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x56, 0x85, 0x00, 0x06, 0x66, 0x11,
+ 0x11, 0x1a, 0xa3, 0x37, 0x77, 0x72, 0x22, 0x77,
+ 0x73, 0x33, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x33,
+ 0x33, 0x33, 0x33, 0x30, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x55, 0x00, 0x00, 0x06, 0x66, 0x66,
+ 0x66, 0x66, 0x11, 0x1a, 0xa3, 0x77, 0x72, 0x22,
+ 0x77, 0x73, 0x3a, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x33, 0x33,
+ 0x33, 0x33, 0x33, 0xa0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11,
+ 0x66, 0x66, 0x66, 0x66, 0x11, 0xa3, 0x77, 0x22,
+ 0x22, 0x77, 0x33, 0x33, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x33, 0x33, 0x33,
+ 0x33, 0x3a, 0xa1, 0x10, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x33,
+ 0xaa, 0x11, 0x16, 0x66, 0x66, 0x61, 0x1a, 0x37,
+ 0x22, 0x22, 0x77, 0x33, 0x3a, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0x33, 0x33, 0x33,
+ 0x3a, 0xa1, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x22,
+ 0x22, 0x77, 0x3a, 0x11, 0x66, 0x66, 0x66, 0x1a,
+ 0x37, 0x22, 0x22, 0x77, 0x33, 0x3a, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0x33, 0x33, 0x33, 0x3a,
+ 0xa1, 0x11, 0x11, 0x10, 0x00, 0x00, 0x50, 0x00,
+ 0x00, 0x05, 0x80, 0x50, 0x00, 0x00, 0x07, 0x72,
+ 0x22, 0x22, 0x22, 0x73, 0xa1, 0x66, 0x66, 0x61,
+ 0x1a, 0x77, 0x22, 0x27, 0x73, 0x33, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0x33, 0x33, 0x3a, 0xaa,
+ 0x11, 0x11, 0x1a, 0xa0, 0x08, 0x71, 0x05, 0x00,
+ 0x00, 0x12, 0x22, 0x50, 0x00, 0x00, 0x07, 0x77,
+ 0x77, 0x72, 0x22, 0x22, 0x27, 0x31, 0x16, 0x66,
+ 0x61, 0x13, 0x77, 0x22, 0x77, 0x33, 0x3a, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xa3, 0x33, 0x33, 0xaa, 0xa1,
+ 0x11, 0x1a, 0x33, 0x70, 0x07, 0x2e, 0x70, 0x00,
+ 0x01, 0x44, 0x42, 0x60, 0x00, 0x00, 0x02, 0x22,
+ 0x22, 0x22, 0x22, 0x22, 0x22, 0x27, 0x31, 0x66,
+ 0x66, 0x61, 0xa3, 0x72, 0x22, 0x77, 0x33, 0xaa,
+ 0xaa, 0xaa, 0xa3, 0x33, 0x33, 0xaa, 0xaa, 0x11,
+ 0x1a, 0x33, 0x77, 0x30, 0x04, 0x82, 0x40, 0x00,
+ 0x54, 0x48, 0x54, 0x40, 0x00, 0x00, 0x01, 0xaa,
+ 0x32, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x31,
+ 0x66, 0x66, 0x11, 0x37, 0x22, 0x27, 0x73, 0x3a,
+ 0xaa, 0xaa, 0xa3, 0x33, 0x3a, 0xaa, 0xaa, 0xaa,
+ 0xa3, 0x77, 0xaa, 0x10, 0x50, 0x08, 0x46, 0x05,
+ 0x54, 0x80, 0x50, 0x42, 0x00, 0x00, 0x08, 0x66,
+ 0x66, 0x1a, 0x32, 0x22, 0x22, 0x22, 0x22, 0x27,
+ 0x31, 0x66, 0x66, 0x13, 0x72, 0x22, 0x77, 0x33,
+ 0xaa, 0xaa, 0xaa, 0x33, 0xaa, 0xa1, 0xaa, 0xa3,
+ 0x37, 0xa1, 0x1a, 0x30, 0x50, 0x06, 0x26, 0x00,
+ 0x54, 0x00, 0x00, 0x44, 0x00, 0x00, 0x08, 0xe2,
+ 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x22, 0x22,
+ 0x27, 0xa6, 0x66, 0x61, 0xa7, 0x72, 0x27, 0x73,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x33,
+ 0x31, 0x11, 0x37, 0x70, 0x02, 0x00, 0xab, 0xbb,
+ 0xb6, 0x00, 0x00, 0xf4, 0x00, 0x00, 0xee, 0xee,
+ 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x22,
+ 0x22, 0x23, 0x16, 0x66, 0x1a, 0x37, 0x22, 0x77,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0x3a,
+ 0x11, 0xa7, 0x33, 0x10, 0x04, 0x09, 0xbd, 0xdd,
+ 0xbd, 0xd0, 0x04, 0x45, 0x00, 0x0e, 0xee, 0xee,
+ 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0x22,
+ 0x22, 0x22, 0x71, 0x66, 0x66, 0x13, 0x72, 0x27,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x33, 0x11,
+ 0xa3, 0x73, 0xa1, 0x60, 0x08, 0xbd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdb, 0x90, 0x00, 0x02, 0xec, 0xee,
+ 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xce, 0x22,
+ 0x22, 0x22, 0x27, 0xa6, 0x66, 0x61, 0x37, 0x27,
+ 0x1a, 0xaa, 0xaa, 0xaa, 0xaa, 0xa3, 0xa1, 0x1a,
+ 0x33, 0xa1, 0x16, 0x60, 0x0b, 0xbd, 0xdd, 0xdd,
+ 0xcd, 0xdd, 0xdd, 0xd9, 0x00, 0x00, 0xec, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0xa2,
+ 0x22, 0x22, 0x22, 0x7a, 0x66, 0x66, 0x13, 0x77,
+ 0x1a, 0xaa, 0xaa, 0xaa, 0xaa, 0x3a, 0x11, 0x33,
+ 0xaa, 0x11, 0x66, 0x60, 0x9b, 0xdd, 0xdd, 0xdd,
+ 0xcd, 0xdd, 0xdb, 0xb9, 0x00, 0x00, 0xec, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xee, 0x61,
+ 0x72, 0x22, 0x22, 0x22, 0xa1, 0x66, 0x61, 0x37,
+ 0x1a, 0xaa, 0xaa, 0xaa, 0xa3, 0xa1, 0x13, 0x3a,
+ 0x11, 0x11, 0x11, 0x10, 0x5b, 0xdd, 0xdd, 0xdc,
+ 0xdd, 0xdd, 0xbd, 0xd9, 0x00, 0x00, 0xec, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xee, 0x86,
+ 0x17, 0x22, 0x22, 0x22, 0x23, 0x16, 0x66, 0xaa,
+ 0xaa, 0xa3, 0x3a, 0xaa, 0xaa, 0x1a, 0x3a, 0xa1,
+ 0x11, 0x11, 0x1a, 0x70, 0x05, 0xbd, 0xdd, 0xdd,
+ 0xdb, 0x5b, 0xdd, 0xb0, 0x00, 0x60, 0x2e, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xe6, 0x88,
+ 0x66, 0x32, 0x22, 0x22, 0x22, 0x36, 0x66, 0x11,
+ 0x33, 0x33, 0x3a, 0xaa, 0x11, 0xaa, 0xaa, 0xa1,
+ 0x11, 0x1a, 0x3a, 0x60, 0x02, 0x99, 0xbb, 0xb9,
+ 0x9b, 0xbb, 0xbc, 0x22, 0x00, 0x86, 0x5e, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xe1, 0x68,
+ 0x86, 0x63, 0x22, 0x22, 0x22, 0x2a, 0x66, 0x66,
+ 0x33, 0x33, 0xaa, 0xaa, 0x1a, 0xaa, 0xaa, 0x11,
+ 0x1a, 0xa7, 0x68, 0x80, 0x02, 0x2b, 0xbd, 0xbb,
+ 0xbb, 0xb9, 0x22, 0x22, 0x00, 0x06, 0x6e, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xc7, 0xa6,
+ 0x88, 0x86, 0x32, 0x22, 0x22, 0x27, 0xa6, 0x66,
+ 0x33, 0x3a, 0xaa, 0xa1, 0xaa, 0xaa, 0xa1, 0x11,
+ 0xa3, 0xa6, 0x88, 0x80, 0x02, 0x22, 0x9b, 0xbb,
+ 0xbb, 0x22, 0x24, 0xf4, 0x60, 0x00, 0x0c, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xc2, 0x21,
+ 0x68, 0x88, 0x63, 0x22, 0x22, 0x22, 0x71, 0x66,
+ 0x33, 0x3a, 0x11, 0x11, 0xaa, 0xaa, 0x11, 0xaa,
+ 0x71, 0x88, 0x88, 0x00, 0x02, 0xe2, 0x26, 0x99,
+ 0x22, 0x22, 0x4f, 0xf4, 0x40, 0x00, 0x0c, 0xcc,
+ 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x22, 0x22,
+ 0x16, 0x88, 0x86, 0xa2, 0x22, 0x22, 0x27, 0x11,
+ 0x33, 0xa1, 0x11, 0x11, 0xaa, 0x31, 0x1a, 0xa3,
+ 0x68, 0x88, 0x81, 0x00, 0x54, 0x42, 0x22, 0x22,
+ 0x22, 0x44, 0xff, 0xff, 0x48, 0x00, 0x00, 0x99,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x99, 0x22, 0x22,
+ 0x21, 0x88, 0x88, 0x6a, 0x22, 0x22, 0x22, 0x31,
+ 0x3a, 0xa1, 0x11, 0x1a, 0xa3, 0x11, 0x33, 0x36,
+ 0x88, 0x86, 0x30, 0x00, 0x4f, 0x44, 0x22, 0x22,
+ 0x24, 0xff, 0xff, 0xff, 0x44, 0x00, 0x00, 0x99,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x95, 0x22, 0x72,
+ 0x22, 0x18, 0x88, 0x86, 0x32, 0x22, 0x22, 0x27,
+ 0xaa, 0x11, 0x11, 0x1a, 0x31, 0x13, 0x33, 0x68,
+ 0x88, 0x6a, 0x00, 0x02, 0x4f, 0x4f, 0x42, 0x24,
+ 0x4f, 0xff, 0xff, 0xff, 0xf4, 0x50, 0x00, 0x99,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x99, 0x22, 0x73,
+ 0x72, 0x26, 0x88, 0x88, 0x63, 0x22, 0x22, 0x22,
+ 0x11, 0x11, 0x11, 0xa3, 0xa1, 0x73, 0xa6, 0x88,
+ 0x81, 0xa5, 0x00, 0x04, 0x4f, 0x4f, 0x44, 0x4f,
+ 0xff, 0xff, 0xff, 0xff, 0xf4, 0x40, 0x00, 0x99,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x99, 0x12, 0x27,
+ 0xaa, 0x22, 0x68, 0x55, 0x86, 0x72, 0x22, 0x22,
+ 0x11, 0x11, 0x1a, 0x33, 0x13, 0x3a, 0x18, 0x88,
+ 0x1a, 0x10, 0x00, 0x44, 0x4f, 0x4f, 0xff, 0x4f,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x99,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x99, 0x61, 0x22,
+ 0x3a, 0xa2, 0x26, 0x85, 0x58, 0x67, 0x22, 0x22,
+ 0x61, 0x61, 0x1a, 0x7a, 0x37, 0x31, 0x88, 0x81,
+ 0x11, 0x00, 0x05, 0xe4, 0x44, 0xff, 0xff, 0xff,
+ 0x4f, 0xf4, 0x44, 0xff, 0xff, 0xf5, 0x00, 0x99,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x99, 0x88, 0x12,
+ 0x2a, 0xaa, 0x72, 0x68, 0x55, 0x81, 0x22, 0x22,
+ 0x66, 0x61, 0xa3, 0x33, 0x73, 0x16, 0x88, 0x11,
+ 0x10, 0x00, 0x08, 0x74, 0x44, 0x4f, 0x44, 0x44,
+ 0xf4, 0xf4, 0x44, 0x44, 0xe2, 0x44, 0x00, 0x99,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x99, 0x88, 0x81,
+ 0x22, 0xaa, 0xa7, 0x26, 0x85, 0x88, 0x12, 0x22,
+ 0x66, 0x61, 0x37, 0xa7, 0x3a, 0x66, 0x66, 0x11,
+ 0x80, 0x00, 0x0a, 0x72, 0x44, 0x4f, 0x44, 0x4f,
+ 0xff, 0x44, 0x44, 0x22, 0x22, 0x24, 0x00, 0x99,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x99, 0x85, 0x88,
+ 0x12, 0x2a, 0xaa, 0x22, 0x68, 0x58, 0x63, 0x22,
+ 0x66, 0x1a, 0x73, 0x77, 0x31, 0x66, 0x61, 0x11,
+ 0x00, 0x00, 0x07, 0x44, 0xff, 0x4f, 0xf4, 0x4f,
+ 0xff, 0x4f, 0x44, 0xf4, 0x42, 0x22, 0x40, 0x9b,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xb9, 0x85, 0x55,
+ 0x81, 0x27, 0xaa, 0xa2, 0x78, 0x88, 0x86, 0x72,
+ 0x66, 0x13, 0x77, 0x73, 0x11, 0x66, 0x61, 0x76,
+ 0x00, 0x50, 0x84, 0xf4, 0xff, 0x4f, 0xf4, 0xff,
+ 0xff, 0x4f, 0x44, 0xff, 0x4f, 0x42, 0x40, 0x9b,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xb9, 0x68, 0x55,
+ 0x58, 0x12, 0x3a, 0xaa, 0x23, 0x88, 0x88, 0xa7,
+ 0x66, 0xa7, 0x77, 0x7a, 0x16, 0x66, 0x1a, 0x15,
+ 0x05, 0x00, 0x4f, 0xf4, 0xff, 0x4f, 0xf4, 0xff,
+ 0xff, 0x4f, 0x44, 0xff, 0x4f, 0x44, 0x24, 0x9b,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xb9, 0x26, 0x55,
+ 0x55, 0x81, 0x23, 0xaa, 0x32, 0x18, 0x88, 0x6a,
+ 0x61, 0x37, 0x77, 0x31, 0x66, 0x66, 0x17, 0x60,
+ 0x05, 0x08, 0x4f, 0xf4, 0xff, 0x4f, 0xf4, 0xff,
+ 0xff, 0x4f, 0x44, 0xff, 0x4f, 0x4f, 0x4e, 0x99,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x99, 0xa2, 0x65,
+ 0x55, 0x58, 0xa2, 0x7a, 0xa2, 0x26, 0x88, 0x61,
+ 0x61, 0x32, 0x27, 0xa1, 0x66, 0x61, 0x31, 0x60,
+ 0x00, 0x04, 0x4f, 0xf4, 0xff, 0x44, 0x44, 0xff,
+ 0xff, 0x4f, 0x44, 0xff, 0x4f, 0x44, 0xf4, 0x99,
+ 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x9b, 0xaa, 0x26,
+ 0x55, 0x55, 0x87, 0x27, 0x33, 0x27, 0x68, 0x61,
+ 0x1a, 0x72, 0x27, 0xa6, 0x66, 0x6a, 0x71, 0x00,
+ 0x80, 0x84, 0xff, 0xf4, 0xff, 0x44, 0x44, 0xff,
+ 0xff, 0x4f, 0x44, 0xff, 0x4f, 0x44, 0xf4, 0x99,
+ 0x9b, 0x9b, 0x99, 0xb9, 0xb9, 0x99, 0xaa, 0xa2,
+ 0x85, 0x55, 0x56, 0x22, 0x27, 0x22, 0x36, 0x66,
+ 0x13, 0x22, 0x23, 0x16, 0x86, 0x63, 0x73, 0x00,
+ 0x00, 0x44, 0xf4, 0xf4, 0xff, 0x44, 0x44, 0xff,
+ 0xff, 0x4f, 0x44, 0xff, 0x4f, 0x4f, 0x4f, 0x99,
+ 0x9b, 0x99, 0x99, 0x99, 0xb9, 0x99, 0xaa, 0xaa,
+ 0x28, 0x55, 0x58, 0x12, 0x22, 0x22, 0x21, 0x11,
+ 0xa3, 0x27, 0x7a, 0x66, 0x86, 0x17, 0x75, 0x05,
+ 0x05, 0xff, 0xf4, 0xf4, 0xff, 0x44, 0x44, 0xff,
+ 0xff, 0x4f, 0x44, 0x4f, 0x4f, 0x44, 0x4f, 0x99,
+ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x3a, 0xaa,
+ 0xa2, 0x85, 0x58, 0x67, 0x72, 0x22, 0x27, 0xa1,
+ 0x37, 0x27, 0x7a, 0x68, 0x86, 0xa2, 0x70, 0x00,
+ 0x02, 0xff, 0xf4, 0xf4, 0xff, 0x44, 0x44, 0x4f,
+ 0xff, 0x4f, 0x44, 0xf4, 0xf4, 0xf4, 0xf4, 0x99,
+ 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x23, 0xaa,
+ 0xa7, 0x78, 0x88, 0x81, 0x77, 0x22, 0x27, 0x3a,
+ 0x72, 0x73, 0x71, 0x68, 0x66, 0x32, 0x50, 0x00,
+ 0x04, 0x4f, 0xf4, 0xf4, 0xff, 0x44, 0x44, 0x4f,
+ 0xff, 0x4f, 0x44, 0xf4, 0xf4, 0xf4, 0x44, 0x95,
+ 0x99, 0x99, 0x99, 0x99, 0x99, 0x55, 0x12, 0x3a,
+ 0xaa, 0x21, 0x88, 0x81, 0x77, 0x27, 0x73, 0x73,
+ 0x72, 0x33, 0x36, 0x86, 0x61, 0x72, 0x00, 0x00,
+ 0x04, 0x44, 0xf4, 0xf4, 0xf4, 0x44, 0x44, 0x4f,
+ 0xff, 0x4f, 0x44, 0xff, 0x4f, 0x4f, 0x44, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x8a, 0x27,
+ 0xaa, 0x77, 0x68, 0x61, 0x23, 0x71, 0x11, 0x3a,
+ 0x27, 0xa3, 0x36, 0x86, 0x61, 0x20, 0x00, 0x00,
+ 0x04, 0xf4, 0xf4, 0xf4, 0xf4, 0x44, 0x44, 0x4f,
+ 0xff, 0x4f, 0x44, 0xff, 0x4f, 0x4f, 0x41, 0x59,
+ 0x99, 0x99, 0x99, 0x99, 0x99, 0x95, 0x58, 0x77,
+ 0x27, 0x32, 0x36, 0x63, 0x23, 0x71, 0x66, 0x11,
+ 0x27, 0x13, 0xa6, 0x86, 0x6a, 0x20, 0x00, 0x50,
+ 0x04, 0x4f, 0x4f, 0x4f, 0x4f, 0x44, 0x44, 0x4f,
+ 0xff, 0x4f, 0x44, 0xff, 0x4f, 0x4f, 0x41, 0x99,
+ 0x9b, 0xbb, 0xbb, 0xbb, 0xb9, 0x99, 0x68, 0x13,
+ 0x32, 0x22, 0x73, 0xa7, 0x2a, 0x31, 0x88, 0x66,
+ 0x7a, 0x13, 0x18, 0x66, 0x63, 0x20, 0x00, 0x06,
+ 0x0f, 0x4f, 0x4f, 0x4f, 0x4f, 0x44, 0x44, 0x4f,
+ 0xff, 0x4f, 0x44, 0xff, 0x4f, 0x4f, 0x49, 0x95,
+ 0xa9, 0xa9, 0x99, 0x97, 0x92, 0x99, 0x65, 0x6a,
+ 0x17, 0x22, 0x23, 0x72, 0x27, 0xaa, 0x88, 0x88,
+ 0xa1, 0x17, 0x68, 0x66, 0x67, 0x70, 0x00, 0x05,
+ 0x0f, 0x4f, 0x4f, 0x4f, 0x4f, 0x44, 0x44, 0x4f,
+ 0xff, 0x4f, 0x44, 0xff, 0xf4, 0xf4, 0x49, 0x9c,
+ 0x2e, 0xee, 0xee, 0xee, 0xee, 0xa9, 0x65, 0x8a,
+ 0x1a, 0xaa, 0x37, 0x72, 0x27, 0x37, 0x88, 0x88,
+ 0x11, 0x17, 0x68, 0x66, 0x67, 0x10, 0x9d, 0xd0,
+ 0x84, 0x44, 0xff, 0x4f, 0x4f, 0x44, 0xf4, 0x4f,
+ 0xff, 0x4f, 0x44, 0xff, 0xf4, 0xf4, 0x4f, 0x69,
+ 0xcc, 0xee, 0xee, 0xee, 0xec, 0x99, 0x88, 0x63,
+ 0x61, 0x68, 0x61, 0x72, 0x22, 0x7a, 0x68, 0x88,
+ 0x11, 0x17, 0x88, 0x66, 0x12, 0x1b, 0xdd, 0xdd,
+ 0x02, 0x44, 0x4f, 0x4f, 0x4f, 0x44, 0x44, 0x4f,
+ 0xff, 0x4f, 0x44, 0xff, 0xff, 0x4f, 0x4c, 0xc5,
+ 0x0c, 0xc1, 0x11, 0x1c, 0xc0, 0x26, 0x66, 0x17,
+ 0x66, 0x88, 0x88, 0x12, 0x22, 0x23, 0xa8, 0x88,
+ 0x11, 0x13, 0x88, 0x66, 0x17, 0xbb, 0xdd, 0xdd,
+ 0xd0, 0x8f, 0xff, 0xf4, 0xf4, 0x44, 0xf4, 0x4f,
+ 0xff, 0x4f, 0x44, 0xf4, 0x4f, 0x44, 0xdd, 0xdd,
+ 0x00, 0x00, 0x00, 0x05, 0x9d, 0x21, 0x66, 0x27,
+ 0xa6, 0x65, 0x58, 0x67, 0x22, 0x27, 0x28, 0x88,
+ 0x11, 0xaa, 0x86, 0x68, 0x1a, 0xbb, 0xdd, 0xdd,
+ 0xdb, 0x05, 0xf4, 0xf4, 0xf4, 0xf4, 0x44, 0x4f,
+ 0xff, 0x4f, 0x44, 0xf4, 0xf4, 0xf4, 0xdd, 0xdb,
+ 0x00, 0x00, 0x00, 0x00, 0xdd, 0xda, 0x66, 0x22,
+ 0x71, 0x15, 0x55, 0x81, 0x22, 0x22, 0x76, 0x88,
+ 0x11, 0x31, 0x88, 0x88, 0xab, 0xbd, 0xdd, 0xdd,
+ 0xdd, 0x00, 0x04, 0x44, 0xff, 0xff, 0x4f, 0x4f,
+ 0xff, 0x4f, 0x44, 0xf4, 0xf4, 0x44, 0xdd, 0xdb,
+ 0x00, 0x00, 0x00, 0x0b, 0xdd, 0xda, 0x11, 0x22,
+ 0x23, 0x68, 0x55, 0x86, 0x22, 0x22, 0x7a, 0x88,
+ 0x1a, 0x71, 0x88, 0x89, 0xbb, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xd0, 0x00, 0x4f, 0x44, 0xff, 0x4f, 0x4f,
+ 0xff, 0x4f, 0x44, 0xf4, 0xff, 0xe2, 0xdd, 0xdb,
+ 0x90, 0x00, 0x05, 0xbd, 0xdd, 0xb8, 0x63, 0x22,
+ 0x27, 0xa6, 0x55, 0x88, 0x77, 0x22, 0x22, 0x88,
+ 0x1a, 0x28, 0xbd, 0xdb, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdb, 0x00, 0x07, 0x44, 0x4f, 0x4f, 0x4f,
+ 0xff, 0x4f, 0x44, 0x4f, 0x4f, 0x22, 0xdd, 0xdb,
+ 0xbb, 0x9b, 0xbb, 0xbd, 0xdd, 0xd5, 0x86, 0x22,
+ 0x22, 0x77, 0x85, 0x88, 0x17, 0x22, 0x22, 0x88,
+ 0xaa, 0x2b, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0x00, 0x00, 0x54, 0x4f, 0x4f, 0x4f,
+ 0xff, 0x4f, 0x44, 0xf4, 0x44, 0x22, 0xbd, 0xdd,
+ 0xbb, 0xbb, 0xbb, 0xdd, 0xdd, 0xdd, 0x88, 0x72,
+ 0x27, 0x22, 0x88, 0x88, 0x67, 0x72, 0x22, 0x18,
+ 0x33, 0x2d, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xd0, 0x00, 0x05, 0x4f, 0x4f, 0x4f,
+ 0xff, 0x4f, 0x44, 0x44, 0x4f, 0x22, 0xbd, 0xdd,
+ 0xdb, 0xbb, 0xdd, 0xdd, 0xdd, 0xdd, 0x88, 0x17,
+ 0x27, 0x72, 0x68, 0x88, 0x87, 0x32, 0x22, 0x36,
+ 0x37, 0x2d, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xd5, 0x00, 0x00, 0x4f, 0x4f, 0x4f,
+ 0xff, 0xf4, 0xf4, 0xf4, 0xf4, 0x22, 0xbb, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xd8, 0x67,
+ 0x72, 0x77, 0x38, 0x88, 0x83, 0x37, 0x22, 0x26,
+ 0x72, 0x2b, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0x00, 0x00, 0x4f, 0x4f, 0x4f,
+ 0xff, 0xf4, 0xf4, 0xf4, 0x44, 0x25, 0xbb, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xd3,
+ 0x32, 0x73, 0x76, 0x88, 0x81, 0x33, 0x22, 0x2a,
+ 0x22, 0x2b, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xb0, 0x54, 0x4f, 0x4f, 0x4f,
+ 0xff, 0xf4, 0xf4, 0xff, 0x44, 0x00, 0xbb, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xa7, 0x73, 0x26, 0x88, 0x86, 0x7a, 0x72, 0x27,
+ 0x22, 0x2b, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdb, 0x44, 0xff, 0x4f, 0x4f,
+ 0xff, 0xf4, 0xf4, 0x44, 0x40, 0x05, 0xbb, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0x13, 0x23, 0x21, 0x68, 0x86, 0x17, 0x72, 0x22,
+ 0x22, 0x2b, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdb, 0x44, 0x4f, 0x4f, 0x4f,
+ 0xff, 0xff, 0x44, 0x42, 0x00, 0x05, 0xbd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0x87, 0x27, 0x27, 0x16, 0x66, 0x67, 0x22, 0x22,
+ 0x72, 0x7b, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0x94, 0x44, 0x44, 0x44,
+ 0x44, 0x44, 0x44, 0x00, 0x00, 0x05, 0xbb, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xb8,
+ 0x86, 0x22, 0x22, 0x7a, 0x68, 0x81, 0x22, 0x22,
+ 0x37, 0x7b, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdb, 0xb5, 0x44, 0x44, 0x44,
+ 0x44, 0x47, 0x00, 0x00, 0x00, 0x05, 0xbd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xd8, 0x68,
+ 0x58, 0x72, 0x22, 0x27, 0x18, 0x86, 0x72, 0x22,
+ 0x1a, 0xbb, 0xbd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdb, 0xb5, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xbb, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xb9, 0x18, 0x85,
+ 0x58, 0x12, 0x22, 0x36, 0x18, 0x88, 0x32, 0x22,
+ 0x61, 0x3b, 0xbb, 0xbb, 0xbd, 0xdd, 0xdd, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdb, 0xb9, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xbb, 0xdd,
+ 0xdd, 0xdd, 0xdd, 0xdd, 0xb9, 0x7a, 0x68, 0x85,
+ 0x88, 0x62, 0x27, 0x16, 0x18, 0x88, 0x12, 0x27,
+ 0x86, 0x18, 0x9b, 0xbb, 0xbb, 0xbb, 0xbb, 0xbd,
+ 0xdd, 0xdd, 0xdd, 0xbb, 0xb5, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xbb, 0xbd,
+ 0xdd, 0xdd, 0xdb, 0xbb, 0x87, 0x31, 0x68, 0x65,
+ 0x88, 0x82, 0x23, 0x16, 0x18, 0x88, 0x12, 0x23,
+ 0x88, 0x67, 0x27, 0xa8, 0x9b, 0xbb, 0xbb, 0xbb,
+ 0xbd, 0xdd, 0xbb, 0xbb, 0x95, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x9b, 0xbb,
+ 0xbb, 0xbb, 0xbb, 0x96, 0x87, 0x16, 0x68, 0x18,
+ 0x88, 0x62, 0x31, 0x66, 0x18, 0x88, 0x62, 0x73,
+ 0x88, 0x63, 0x27, 0x33, 0x65, 0x55, 0x99, 0x9b,
+ 0xbb, 0xbb, 0xbb, 0x99, 0x55, 0x0a, 0xa1, 0x86,
+ 0x81, 0x68, 0x88, 0x55, 0x58, 0x85, 0x9b, 0xbb,
+ 0xbb, 0xbb, 0x95, 0x88, 0x83, 0x66, 0x66, 0x18,
+ 0x66, 0x82, 0xa1, 0x66, 0x18, 0x88, 0x62, 0x33,
+ 0x88, 0x81, 0x27, 0x7a, 0x18, 0x58, 0x86, 0x85,
+ 0x99, 0x99, 0x99, 0x95, 0x53, 0x2a, 0xaa, 0x88,
+ 0x67, 0x31, 0x68, 0x55, 0x58, 0x85, 0x59, 0xbb,
+ 0xbb, 0xb9, 0x58, 0x68, 0x83, 0x66, 0x61, 0x16,
+ 0x66, 0x62, 0x16, 0x66, 0x68, 0x88, 0x62, 0xaa,
+ 0x88, 0x86, 0x27, 0x77, 0x78, 0x55, 0x88, 0x22,
+ 0x25, 0x55, 0x95, 0x55, 0x6a, 0xa2, 0x2a, 0x88,
+ 0x62, 0x27, 0x37, 0x38, 0x88, 0x87, 0x55, 0x59,
+ 0x95, 0x58, 0x16, 0x88, 0x8a, 0x66, 0x63, 0x68,
+ 0x86, 0x67, 0x66, 0x66, 0x68, 0x88, 0x12, 0x11,
+ 0x88, 0x88, 0x72, 0x77, 0x78, 0x85, 0x58, 0x17,
+ 0x23, 0x32, 0x55, 0x55, 0x81, 0x13, 0x73, 0x66,
+ 0x62, 0x7a, 0xaa, 0x38, 0x88, 0x58, 0x27, 0x55,
+ 0x58, 0x32, 0x38, 0x88, 0x81, 0x66, 0xa2, 0x88,
+ 0x86, 0x61, 0x66, 0x61, 0x66, 0x68, 0x13, 0x11,
+ 0x88, 0x88, 0x12, 0x22, 0x71, 0x85, 0x58, 0x62,
+ 0x23, 0xa2, 0x68, 0x88, 0x81, 0x66, 0x88, 0x88,
+ 0x63, 0x2a, 0xaa, 0x28, 0x88, 0x55, 0x86, 0x61,
+ 0x66, 0x66, 0x68, 0x88, 0x66, 0x66, 0x77, 0x88,
+ 0x68, 0x16, 0x66, 0x62, 0x66, 0x68, 0xa1, 0x61,
+ 0x88, 0x88, 0x62, 0x22, 0x22, 0x85, 0x55, 0x83,
+ 0x72, 0x37, 0xa8, 0x88, 0x61, 0x66, 0x85, 0x55,
+ 0x86, 0x23, 0xaa, 0x71, 0x88, 0x85, 0x88, 0x66,
+ 0x88, 0x86, 0x88, 0x88, 0x16, 0x61, 0x21, 0x88,
+ 0x66, 0xa6, 0x86, 0x17, 0x66, 0x66, 0x31, 0x61,
+ 0x88, 0x88, 0x87, 0x72, 0x22, 0x68, 0x55, 0x86,
+ 0x77, 0x77, 0x36, 0x88, 0x13, 0x68, 0x85, 0x55,
+ 0x58, 0x12, 0x73, 0x72, 0x76, 0x88, 0x88, 0x68,
+ 0x88, 0x88, 0x88, 0x66, 0x36, 0x63, 0x26, 0x86,
+ 0x86, 0x36, 0x86, 0x11, 0x66, 0x66, 0x76, 0x61,
+ 0x88, 0x88, 0x81, 0x22, 0x22, 0x38, 0x85, 0x58,
+ 0x37, 0x22, 0x21, 0x68, 0xa2, 0x31, 0x68, 0x55,
+ 0x55, 0x81, 0x22, 0x22, 0xa8, 0x88, 0x88, 0x68,
+ 0x86, 0x88, 0x68, 0x81, 0x36, 0x17, 0x21, 0x68,
+ 0x86, 0x16, 0x66, 0x26, 0x66, 0x61, 0x36, 0x66,
+ 0x68, 0x88, 0x86, 0x27, 0x22, 0x28, 0x88, 0x88,
+ 0x17, 0x72, 0x2a, 0x66, 0xa2, 0x22, 0x36, 0x55,
+ 0x55, 0x58, 0x37, 0x3a, 0x16, 0x66, 0x66, 0x66,
+ 0x66, 0x18, 0x88, 0x67, 0x16, 0x12, 0x71, 0x68,
+ 0x81, 0x68, 0x61, 0x76, 0x66, 0x6a, 0x16, 0x66,
+ 0x88, 0x88, 0x86, 0x77, 0x22, 0x26, 0x88, 0x88,
+ 0x13, 0x37, 0x71, 0x66, 0xa2, 0x33, 0x2a, 0x85,
+ 0x55, 0x55, 0x17, 0x73, 0x16, 0x66, 0x66, 0x68,
+ 0x63, 0x88, 0x88, 0xa2, 0x66, 0xa2, 0xa6, 0x88,
+ 0x61, 0x68, 0x6a, 0x76, 0x66, 0x6a, 0x66, 0x6a
+};
+
+/* Painted by Johnny Stenback <jst@uwasa.fi> */
+
+unsigned char *linux_serial_image __initdata = "\n"
+" .u$e.\n"
+" .$$$$$:S\n"
+" $\"*$/\"*$$\n"
+" $.`$ . ^F\n"
+" 4k+#+T.$F\n"
+" 4P+++\"$\"$\n"
+" :R\"+ t$$B\n"
+" ___# $$$\n"
+" | | R$$k\n"
+" dd. | Linux $!$\n"
+" ddd | PPC $9$F\n"
+" '!!!!!$ !!#!`\n"
+" !!!!!* .!!!!!`\n"
+"'!!!!!!!W..e$$!!!!!!` %s\n"
+" \"~^^~ ^~~^\n"
+"\n";
+
+#else
+
+/* prototypes only */
+extern unsigned char linux_logo_red[];
+extern unsigned char linux_logo_green[];
+extern unsigned char linux_logo_blue[];
+extern unsigned char linux_logo[];
+extern unsigned char linux_logo_bw[];
+extern unsigned char linux_logo16_red[];
+extern unsigned char linux_logo16_green[];
+extern unsigned char linux_logo16_blue[];
+extern unsigned char linux_logo16[];
+extern unsigned char *linux_serial_image;
+
+extern int (*console_show_logo)(void);
+
+#endif
diff --git a/include/asm-ppc/md.h b/include/asm-ppc/md.h
new file mode 100644
index 000000000..d404b2906
--- /dev/null
+++ b/include/asm-ppc/md.h
@@ -0,0 +1,13 @@
+/* $Id: md.h,v 1.1 1998/03/16 08:43:38 ralf Exp $
+ * md.h: High speed xor_block operation for RAID4/5
+ *
+ */
+
+#ifndef __ASM_MD_H
+#define __ASM_MD_H
+
+/* #define HAVE_ARCH_XORBLOCK */
+
+#define MD_XORBLOCK_ALIGNMENT sizeof(long)
+
+#endif /* __ASM_MD_H */
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index 57ce8eda8..db12454a5 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -6,23 +6,22 @@
#define _PPC_MMU_H_
/* Hardware Page Table Entry */
-typedef struct _PTE
- {
- unsigned long v:1; /* Entry is valid */
- unsigned long vsid:24; /* Virtual segment identifier */
- unsigned long h:1; /* Hash algorithm indicator */
- unsigned long api:6; /* Abbreviated page index */
- unsigned long rpn:20; /* Real (physical) page number */
- unsigned long :3; /* Unused */
- unsigned long r:1; /* Referenced */
- unsigned long c:1; /* Changed */
- unsigned long w:1; /* Write-thru cache mode */
- unsigned long i:1; /* Cache inhibited */
- unsigned long m:1; /* Memory coherence */
- unsigned long g:1; /* Guarded */
- unsigned long :1; /* Unused */
- unsigned long pp:2; /* Page protection */
- } PTE;
+typedef struct _PTE {
+ unsigned long v:1; /* Entry is valid */
+ unsigned long vsid:24; /* Virtual segment identifier */
+ unsigned long h:1; /* Hash algorithm indicator */
+ unsigned long api:6; /* Abbreviated page index */
+ unsigned long rpn:20; /* Real (physical) page number */
+ unsigned long :3; /* Unused */
+ unsigned long r:1; /* Referenced */
+ unsigned long c:1; /* Changed */
+ unsigned long w:1; /* Write-thru cache mode */
+ unsigned long i:1; /* Cache inhibited */
+ unsigned long m:1; /* Memory coherence */
+ unsigned long g:1; /* Guarded */
+ unsigned long :1; /* Unused */
+ unsigned long pp:2; /* Page protection */
+} PTE;
/* Values for PP (assumes Ks=0, Kp=1) */
#define PP_RWXX 0 /* Supervisor read/write, User none */
@@ -31,68 +30,61 @@ typedef struct _PTE
#define PP_RXRX 3 /* Supervisor read, User read */
/* Segment Register */
-typedef struct _SEGREG
-{
- unsigned long t:1; /* Normal or I/O type */
- unsigned long ks:1; /* Supervisor 'key' (normally 0) */
- unsigned long kp:1; /* User 'key' (normally 1) */
- unsigned long n:1; /* No-execute */
- unsigned long :4; /* Unused */
- unsigned long vsid:24; /* Virtual Segment Identifier */
+typedef struct _SEGREG {
+ unsigned long t:1; /* Normal or I/O type */
+ unsigned long ks:1; /* Supervisor 'key' (normally 0) */
+ unsigned long kp:1; /* User 'key' (normally 1) */
+ unsigned long n:1; /* No-execute */
+ unsigned long :4; /* Unused */
+ unsigned long vsid:24; /* Virtual Segment Identifier */
} SEGREG;
/* Block Address Translation (BAT) Registers */
-typedef struct _P601_BATU
-{
- unsigned long bepi:15; /* Effective page index (virtual address) */
- unsigned long :8; /* unused */
- unsigned long w:1;
- unsigned long i:1; /* Cache inhibit */
- unsigned long m:1; /* Memory coherence */
- unsigned long vs:1; /* Supervisor valid */
- unsigned long vp:1; /* User valid */
- unsigned long pp:2; /* Page access protections */
+typedef struct _P601_BATU { /* Upper part of BAT for 601 processor */
+ unsigned long bepi:15; /* Effective page index (virtual address) */
+ unsigned long :8; /* unused */
+ unsigned long w:1;
+ unsigned long i:1; /* Cache inhibit */
+ unsigned long m:1; /* Memory coherence */
+ unsigned long ks:1; /* Supervisor key (normally 0) */
+ unsigned long kp:1; /* User key (normally 1) */
+ unsigned long pp:2; /* Page access protections */
} P601_BATU;
-typedef struct _BATU /* Upper part of BAT */
-{
- unsigned long bepi:15; /* Effective page index (virtual address) */
- unsigned long :4; /* Unused */
- unsigned long bl:11; /* Block size mask */
- unsigned long vs:1; /* Supervisor valid */
- unsigned long vp:1; /* User valid */
+typedef struct _BATU { /* Upper part of BAT (all except 601) */
+ unsigned long bepi:15; /* Effective page index (virtual address) */
+ unsigned long :4; /* Unused */
+ unsigned long bl:11; /* Block size mask */
+ unsigned long vs:1; /* Supervisor valid */
+ unsigned long vp:1; /* User valid */
} BATU;
-typedef struct _P601_BATL
-{
- unsigned long brpn:15; /* Real page index (physical address) */
- unsigned long :10; /* Unused */
- unsigned long v:1; /* valid/invalid */
- unsigned long bl:6; /* Block size mask */
+typedef struct _P601_BATL { /* Lower part of BAT for 601 processor */
+ unsigned long brpn:15; /* Real page index (physical address) */
+ unsigned long :10; /* Unused */
+ unsigned long v:1; /* Valid bit */
+ unsigned long bl:6; /* Block size mask */
} P601_BATL;
-typedef struct _BATL /* Lower part of BAT */
-{
- unsigned long brpn:15; /* Real page index (physical address) */
- unsigned long :10; /* Unused */
- unsigned long w:1; /* Write-thru cache */
- unsigned long i:1; /* Cache inhibit */
- unsigned long m:1; /* Memory coherence */
- unsigned long g:1; /* Guarded (MBZ) */
- unsigned long :1; /* Unused */
- unsigned long pp:2; /* Page access protections */
+typedef struct _BATL { /* Lower part of BAT (all except 601) */
+ unsigned long brpn:15; /* Real page index (physical address) */
+ unsigned long :10; /* Unused */
+ unsigned long w:1; /* Write-thru cache */
+ unsigned long i:1; /* Cache inhibit */
+ unsigned long m:1; /* Memory coherence */
+ unsigned long g:1; /* Guarded (MBZ in IBAT) */
+ unsigned long :1; /* Unused */
+ unsigned long pp:2; /* Page access protections */
} BATL;
-typedef struct _BAT
-{
- BATU batu; /* Upper register */
- BATL batl; /* Lower register */
+typedef struct _BAT {
+ BATU batu; /* Upper register */
+ BATL batl; /* Lower register */
} BAT;
-typedef struct _P601_BAT
-{
- P601_BATU batu; /* Upper register */
- P601_BATL batl; /* Lower register */
+typedef struct _P601_BAT {
+ P601_BATU batu; /* Upper register */
+ P601_BATL batl; /* Lower register */
} P601_BAT;
/* Block size masks */
@@ -123,11 +115,10 @@ typedef struct _P601_BAT
* platforms, notably the 80x86 and 680x0.
*/
-typedef struct _pte
- {
+typedef struct _pte {
unsigned long page_num:20;
- unsigned long flags:12; /* Page flags (with some unused bits) */
- } pte;
+ unsigned long flags:12; /* Page flags (some unused bits) */
+} pte;
#define PD_SHIFT (10+12) /* Page directory */
#define PD_MASK 0x02FF
@@ -138,11 +129,10 @@ typedef struct _pte
/* MMU context */
-typedef struct _MMU_context
- {
- SEGREG segs[16]; /* Segment registers */
- pte **pmap; /* Two-level page-map structure */
- } MMU_context;
+typedef struct _MMU_context {
+ SEGREG segs[16]; /* Segment registers */
+ pte **pmap; /* Two-level page-map structure */
+} MMU_context;
/* Used to set up SDR1 register */
#define HASH_TABLE_SIZE_64K 0x00010000
@@ -167,5 +157,4 @@ extern inline void _tlbie(unsigned long va)
}
extern void _tlbia(void); /* invalidate all TLB entries */
-
#endif
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h
index 000a64416..1b6e92393 100644
--- a/include/asm-ppc/page.h
+++ b/include/asm-ppc/page.h
@@ -1,28 +1,12 @@
#ifndef _PPC_PAGE_H
#define _PPC_PAGE_H
-#include <linux/config.h>
-
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
-/* This handles the memory map.. */
-
-/*
- * these virtual mappings for prep and pmac
- * on the prep machine the io areas are at different physical locations
- * than their virtual address. On the pmac and chrp the io areas
- * are mapped 1-1 virtual/physical.
- * -- Cort
- */
-#if defined(CONFIG_PREP) || defined(CONFIG_CHRP)
-#define KERNELBASE 0x90000000
-#endif
-#ifdef CONFIG_PMAC
-#define KERNELBASE 0xc0000000
-#endif
+/* KERNELBASE comes from arch/ppc/Makefile */
#define PAGE_OFFSET KERNELBASE
@@ -85,7 +69,7 @@ typedef unsigned long pgprot_t;
#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
-#define MAP_NR(addr) (__pa(addr) >> PAGE_SHIFT)
+#define MAP_NR(addr) (((unsigned long)addr-PAGE_OFFSET) >> PAGE_SHIFT)
#define MAP_PAGE_RESERVED (1<<15)
extern unsigned long get_prezerod_page(void);
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index d6698d9b2..3f3c32b9c 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -3,31 +3,39 @@
#include <linux/mm.h>
-extern void flush_tlb_all(void);
-extern void flush_tlb_mm(struct mm_struct *mm);
-extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
-extern void flush_tlb_range(struct mm_struct *mm, unsigned long start,
+extern void local_flush_tlb_all(void);
+extern void local_flush_tlb_mm(struct mm_struct *mm);
+extern void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
+extern void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
unsigned long end);
+#ifndef __SMP__
+#define flush_tlb_all local_flush_tlb_all
+#define flush_tlb_mm local_flush_tlb_mm
+#define flush_tlb_page local_flush_tlb_page
+#define flush_tlb_range local_flush_tlb_range
+#else /* __SMP__ */
+#define flush_tlb_all local_flush_tlb_all
+#define flush_tlb_mm local_flush_tlb_mm
+#define flush_tlb_page local_flush_tlb_page
+#define flush_tlb_range local_flush_tlb_range
+#endif /* __SMP__ */
+
/*
* No cache flushing is required when address mappings are
* changed, because the caches on PowerPCs are physically
* addressed.
+ * Also, when SMP we use the coherency (M) bit of the
+ * BATs and PTEs. -- Cort
*/
#define flush_cache_all() do { } while (0)
#define flush_cache_mm(mm) do { } while (0)
#define flush_cache_range(mm, a, b) do { } while (0)
#define flush_cache_page(vma, p) do { } while (0)
-extern void flush_icache_range(unsigned long, unsigned long);
-/*
- * For the page specified, write modified lines in the data cache
- * out to memory, and invalidate lines in the instruction cache.
- */
+extern void flush_icache_range(unsigned long, unsigned long);
extern void flush_page_to_ram(unsigned long);
-extern unsigned long va_to_phys(unsigned long address);
-
/*
* The PowerPC MMU uses a hash table containing PTEs, together with
* a set of 16 segment registers (on 32-bit implementations), to define
@@ -61,13 +69,19 @@ extern unsigned long va_to_phys(unsigned long address);
#define PTRS_PER_PGD 1024
/* 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
+ * current 64MB value just means that there will be a 64MB "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. ;)
+ *
+ * The vmalloc_offset MUST be larger than the gap between the bat2 mapping
+ * and the size of physical ram. Since the bat2 mapping can be larger than
+ * the amount of ram we have vmalloc_offset must ensure that we don't try
+ * to allocate areas that don't exist! This value of 64M will only cause
+ * problems when we have >128M -- Cort
*/
-#define VMALLOC_OFFSET (0x2000000) /* 32M */
+#define VMALLOC_OFFSET (0x4000000) /* 64M */
#define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
#define VMALLOC_VMADDR(x) ((unsigned long)(x))
@@ -150,7 +164,8 @@ extern unsigned long empty_zero_page[1024];
/* to set the page-dir */
/* tsk is a task_struct and pgdir is a pte_t */
-#define SET_PAGE_DIR(tsk,pgdir)
+#define SET_PAGE_DIR(tsk,pgdir) \
+ ((tsk)->tss.pg_tables = (unsigned long *)(pgdir))
extern inline int pte_none(pte_t pte) { return !pte_val(pte); }
extern inline int pte_present(pte_t pte) { return pte_val(pte) & _PAGE_PRESENT; }
@@ -253,7 +268,7 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }
extern inline unsigned long pte_page(pte_t pte)
-{ return (pte_val(pte) & PAGE_MASK) + KERNELBASE; }
+{ return (unsigned long) __va(pte_val(pte) & PAGE_MASK); }
extern inline unsigned long pmd_page(pmd_t pmd)
{ return pmd_val(pmd); }
@@ -394,12 +409,6 @@ extern pgd_t swapper_pg_dir[1024];
extern void flush_hash_segments(unsigned low_vsid, unsigned high_vsid);
extern void flush_hash_page(unsigned context, unsigned long va);
-extern inline void
-flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
-{
- if (vmaddr < TASK_SIZE)
- flush_hash_page(vma->vm_mm->context, vmaddr);
-}
#define SWP_TYPE(entry) (((entry) >> 1) & 0x7f)
#define SWP_OFFSET(entry) ((entry) >> 8)
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index fc46a3a3c..c86ac43c5 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -1,6 +1,8 @@
#ifndef __ASM_PPC_PROCESSOR_H
#define __ASM_PPC_PROCESSOR_H
+#include <linux/config.h>
+
#include <asm/ptrace.h>
#include <asm/residual.h>
@@ -47,33 +49,128 @@
#define HID0_DCI (1<<10) /* Data Cache Invalidate */
#define HID0_SIED (1<<7) /* Serial Instruction Execution [Disable] */
#define HID0_BHTE (1<<2) /* Branch History Table Enable */
+#define HID0_BTCD (1<<1) /* Branch target cache disable */
/* fpscr settings */
#define FPSCR_FX (1<<31)
#define FPSCR_FEX (1<<30)
-#define _MACH_Motorola 1 /* motorola prep */
-#define _MACH_IBM 2 /* ibm prep */
-#define _MACH_Pmac 4 /* pmac or pmac clone (non-chrp) */
-#define _MACH_chrp 8 /* chrp machine */
+#define _MACH_prep 1
+#define _MACH_Pmac 2 /* pmac or pmac clone (non-chrp) */
+#define _MACH_chrp 4 /* chrp machine */
+
+/* see residual.h for these */
+#define _PREP_Motorola 0x01 /* motorola prep */
+#define _PREP_Firm 0x02 /* firmworks prep */
+#define _PREP_IBM 0x00 /* ibm prep */
+#define _PREP_Bull 0x03 /* bull prep */
+
+#define _GLOBAL(n)\
+ .globl n;\
+n:
+
+#define TBRU 269 /* Time base Upper/Lower (Reading) */
+#define TBRL 268
+#define TBWU 284 /* Time base Upper/Lower (Writing) */
+#define TBWL 285
+#define XER 1
+#define LR 8
+#define CTR 9
+#define HID0 1008 /* Hardware Implementation */
+#define PVR 287 /* Processor Version */
+#define IBAT0U 528 /* Instruction BAT #0 Upper/Lower */
+#define IBAT0L 529
+#define IBAT1U 530 /* Instruction BAT #1 Upper/Lower */
+#define IBAT1L 531
+#define IBAT2U 532 /* Instruction BAT #2 Upper/Lower */
+#define IBAT2L 533
+#define IBAT3U 534 /* Instruction BAT #3 Upper/Lower */
+#define IBAT3L 535
+#define DBAT0U 536 /* Data BAT #0 Upper/Lower */
+#define DBAT0L 537
+#define DBAT1U 538 /* Data BAT #1 Upper/Lower */
+#define DBAT1L 539
+#define DBAT2U 540 /* Data BAT #2 Upper/Lower */
+#define DBAT2L 541
+#define DBAT3U 542 /* Data BAT #3 Upper/Lower */
+#define DBAT3L 543
+#define DMISS 976 /* TLB Lookup/Refresh registers */
+#define DCMP 977
+#define HASH1 978
+#define HASH2 979
+#define IMISS 980
+#define ICMP 981
+#define RPA 982
+#define SDR1 25 /* MMU hash base register */
+#define DAR 19 /* Data Address Register */
+#define SPR0 272 /* Supervisor Private Registers */
+#define SPRG0 272
+#define SPR1 273
+#define SPRG1 273
+#define SPR2 274
+#define SPRG2 274
+#define SPR3 275
+#define SPRG3 275
+#define DSISR 18
+#define SRR0 26 /* Saved Registers (exception) */
+#define SRR1 27
+#define IABR 1010 /* Instruction Address Breakpoint */
+#define DEC 22 /* Decrementer */
+#define EAR 282 /* External Address Register */
+
+/* Segment Registers */
+#define SR0 0
+#define SR1 1
+#define SR2 2
+#define SR3 3
+#define SR4 4
+#define SR5 5
+#define SR6 6
+#define SR7 7
+#define SR8 8
+#define SR9 9
+#define SR10 10
+#define SR11 11
+#define SR12 12
+#define SR13 13
+#define SR14 14
+#define SR15 15
#ifndef __ASSEMBLY__
+/*
+ * If we've configured for a specific machine set things
+ * up so the compiler can optimize away the other parts.
+ * -- Cort
+ */
+#ifdef CONFIG_MACH_SPECIFIC
+#ifdef CONFIG_PREP
+#define _machine (_MACH_prep)
+#define is_prep (1)
+#endif /* CONFIG_PREP */
+
+#ifdef CONFIG_CHRP
+#define _machine (_MACH_chrp)
+#define is_prep (0)
+#endif /* CONFIG_CHRP */
+
+#ifdef CONFIG_PMAC
+#define _machine (_MACH_Pmac)
+#define is_prep (0)
+#endif /* CONFIG_PMAC */
+
+#else /* CONFIG_MACH_SPECIFIC */
+
extern int _machine;
/* if we're a prep machine */
-#define is_prep (_machine & (_MACH_Motorola|_MACH_IBM))
-/*
- * if we have openfirmware - pmac/chrp have it implicitly
- * but we have to check residual data to know on prep
- */
-extern __inline__ int have_of(void)
-{
- if ( (_machine & (_MACH_Pmac|_MACH_chrp)) /*||
- ( is_prep && (res.VitalProductData.FirmwareSupplier & OpenFirmware))*/)
- return 1;
- else
- return 0;
-}
+#define is_prep (_machine == _MACH_prep)
+
+#endif /* CONFIG_MACH_SPECIFIC */
+
+/* if we have openfirmware */
+extern unsigned long have_of;
+/* what kind of prep workstation we are */
+extern int _prep_type;
struct task_struct;
void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
@@ -100,11 +197,21 @@ void release_thread(struct task_struct *);
*/
#define TASK_UNMAPPED_BASE (TASK_SIZE / 8 * 3)
+#define COPY_TASK_STRUCT(dst, src) \
+do { \
+ *dst = *src; \
+} while (0)
+
+typedef struct {
+ unsigned long seg;
+} mm_segment_t;
+
struct thread_struct {
unsigned long ksp; /* Kernel stack pointer */
+ unsigned long *pg_tables; /* Base of page-table tree */
unsigned long wchan; /* Event task is sleeping on */
struct pt_regs *regs; /* Pointer to saved register state */
- unsigned long fs; /* for get_fs() validation */
+ mm_segment_t fs; /* for get_fs() validation */
signed long last_syscall;
double fpr[32]; /* Complete floating point set */
unsigned long fpscr_pad; /* fpr ... fpscr must be contiguous */
@@ -115,6 +222,7 @@ struct thread_struct {
#define INIT_TSS { \
INIT_SP, /* ksp */ \
+ (unsigned long *) swapper_pg_dir, /* pg_tables */ \
0, /* wchan */ \
(struct pt_regs *)INIT_SP - 1, /* regs */ \
KERNEL_DS, /*fs*/ \
@@ -137,7 +245,7 @@ static inline unsigned long thread_saved_pc(struct thread_struct *t)
* NOTE! The task struct and the stack go together
*/
#define alloc_task_struct() \
- ((struct task_struct *) __get_free_pages(GFP_KERNEL,1,0))
+ ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
#define free_task_struct(p) free_pages((unsigned long)(p),1)
/* in process.c - for early bootup debug -- Cort */
diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h
index f5ec558aa..f0b4c7470 100644
--- a/include/asm-ppc/prom.h
+++ b/include/asm-ppc/prom.h
@@ -8,10 +8,17 @@
typedef void *phandle;
typedef void *ihandle;
-extern ihandle prom_stdout;
-extern ihandle prom_chosen;
-extern phandle cpu_node;
-extern char prom_display_path[];
+#ifndef FB_MAX
+#define FB_MAX 8 /* I don't want to include the whole console stuff */
+#endif
+extern char *prom_display_paths[FB_MAX];
+extern unsigned int prom_num_displays;
+
+struct address_range {
+ unsigned int space;
+ unsigned int address;
+ unsigned int size;
+};
struct reg_property {
unsigned int address;
@@ -37,7 +44,7 @@ struct device_node {
char *type;
phandle node;
int n_addrs;
- struct reg_property *addrs;
+ struct address_range *addrs;
int n_intrs;
int *intrs;
char *full_name;
@@ -49,17 +56,21 @@ struct device_node {
struct device_node *allnext; /* next in list of all nodes */
};
+struct prom_args;
+typedef void (*prom_entry)(struct prom_args *);
+
/* Prototypes */
void abort(void);
-void prom_exit(void);
-void *call_prom(const char *service, int nargs, int nret, ...);
-void prom_print(const char *msg);
-void prom_init(char *params, int unused, void (*)(void *));
-void set_prom_callback(void);
-unsigned long copy_device_tree(unsigned long, unsigned long);
+void prom_init(int, int, prom_entry);
+void finish_device_tree(void);
struct device_node *find_devices(const char *name);
struct device_node *find_type_devices(const char *type);
struct device_node *find_path_device(const char *path);
+struct device_node *find_compatible_devices(const char *type,
+ const char *compat);
+struct device_node *find_phandle(phandle);
unsigned char *get_property(struct device_node *node, const char *name,
int *lenp);
void print_properties(struct device_node *node);
+int call_rtas(const char *service, int nargs, int nret,
+ unsigned long *outputs, ...);
diff --git a/include/asm-ppc/scatterlist.h b/include/asm-ppc/scatterlist.h
index 6c5105291..f81590716 100644
--- a/include/asm-ppc/scatterlist.h
+++ b/include/asm-ppc/scatterlist.h
@@ -1,7 +1,7 @@
#ifndef _PPC_SCATTERLIST_H
#define _PPC_SCATTERLIST_H
-#include <linux/config.h>
+#include <asm/dma.h>
struct scatterlist {
char * address; /* Location data is to be transferred to */
@@ -10,23 +10,5 @@ struct scatterlist {
unsigned int length;
};
-#ifdef CONFIG_PMAC
-/*
- * This is used in the scsi code to decide if bounce buffers are needed.
- * Fortunately the dma controllers on the PowerMac are a bit better
- * than on PCs...
- */
-#define ISA_DMA_THRESHOLD (~0UL)
-#endif
-
-#ifdef CONFIG_PREP
-/* PReP systems are like PCs */
-#define ISA_DMA_THRESHOLD (0x00ffffff)
-#endif
-
-#ifdef CONFIG_CHRP
-/* The W83C553F supports 32-bit DMA on ISA */
-#define ISA_DMA_THRESHOLD (~0UL)
-#endif
#endif /* !(_PPC_SCATTERLIST_H) */
diff --git a/include/asm-ppc/siginfo.h b/include/asm-ppc/siginfo.h
new file mode 100644
index 000000000..ff491fb3d
--- /dev/null
+++ b/include/asm-ppc/siginfo.h
@@ -0,0 +1,195 @@
+#ifndef _PPC_SIGINFO_H
+#define _PPC_SIGINFO_H
+
+/* Copied from i386 from alpha. */
+
+#include <linux/types.h>
+
+typedef union sigval {
+ int sival_int;
+ void *sival_ptr;
+} sigval_t;
+
+#define SI_MAX_SIZE 128
+#define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct siginfo {
+ int si_signo;
+ int si_errno;
+ int si_code;
+
+ union {
+ int _pad[SI_PAD_SIZE];
+
+ /* kill() */
+ struct {
+ pid_t _pid; /* sender's pid */
+ uid_t _uid; /* sender's uid */
+ } _kill;
+
+ /* POSIX.1b timers */
+ struct {
+ unsigned int _timer1;
+ unsigned int _timer2;
+ } _timer;
+
+ /* POSIX.1b signals */
+ struct {
+ pid_t _pid; /* sender's pid */
+ uid_t _uid; /* sender's uid */
+ sigval_t _sigval;
+ } _rt;
+
+ /* SIGCHLD */
+ struct {
+ pid_t _pid; /* which child */
+ int _status; /* exit code */
+ clock_t _utime;
+ clock_t _stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+ struct {
+ void *_addr; /* faulting insn/memory ref. */
+ } _sigfault;
+
+ /* SIGPOLL */
+ struct {
+ int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ int _fd;
+ } _sigpoll;
+ } _sifields;
+} siginfo_t;
+
+/*
+ * How these fields are to be accessed.
+ */
+#define si_pid _sifields._kill._pid
+#define si_uid _sifields._kill._uid
+#define si_status _sifields._sigchld._status
+#define si_utime _sifields._sigchld._utime
+#define si_stime _sifields._sigchld._stime
+#define si_value _sifields._rt._sigval
+#define si_int _sifields._rt._sigval.sival_int
+#define si_ptr _sifields._rt._sigval.sival_ptr
+#define si_addr _sifields._sigfault._addr
+#define si_band _sifields._sigpoll._band
+#define si_fd _sifields._sigpoll._fd
+
+/*
+ * si_code values
+ * Digital reserves positive values for kernel-generated signals.
+ */
+#define SI_USER 0 /* sent by kill, sigsend, raise */
+#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
+#define SI_QUEUE -1 /* sent by sigqueue */
+#define SI_TIMER -2 /* sent by timer expiration */
+#define SI_MESGQ -3 /* sent by real time mesq state change */
+#define SI_ASYNCIO -4 /* sent by AIO completion */
+
+#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
+#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
+
+/*
+ * SIGILL si_codes
+ */
+#define ILL_ILLOPC 1 /* illegal opcode */
+#define ILL_ILLOPN 2 /* illegal operand */
+#define ILL_ILLADR 3 /* illegal addressing mode */
+#define ILL_ILLTRP 4 /* illegal trap */
+#define ILL_PRVOPC 5 /* privileged opcode */
+#define ILL_PRVREG 6 /* privileged register */
+#define ILL_COPROC 7 /* coprocessor error */
+#define ILL_BADSTK 8 /* internal stack error */
+#define NSIGILL 8
+
+/*
+ * SIGFPE si_codes
+ */
+#define FPE_INTDIV 1 /* integer divide by zero */
+#define FPE_INTOVF 2 /* integer overflow */
+#define FPE_FLTDIV 3 /* floating point divide by zero */
+#define FPE_FLTOVF 4 /* floating point overflow */
+#define FPE_FLTUND 5 /* floating point underflow */
+#define FPE_FLTRES 6 /* floating point inexact result */
+#define FPE_FLTINV 7 /* floating point invalid operation */
+#define FPE_FLTSUB 8 /* subscript out of range */
+#define NSIGFPE 8
+
+/*
+ * SIGSEGV si_codes
+ */
+#define SEGV_MAPERR 1 /* address not mapped to object */
+#define SRGV_ACCERR 2 /* invalid permissions for mapped object */
+#define NSIGSEGV 2
+
+/*
+ * SIGBUS si_codes
+ */
+#define BUS_ADRALN 1 /* invalid address alignment */
+#define BUS_ADRERR 2 /* non-existant physical address */
+#define BUS_OBJERR 3 /* object specific hardware error */
+#define NSIGBUS 3
+
+/*
+ * SIGTRAP si_codes
+ */
+#define TRAP_BRKPT 1 /* process breakpoint */
+#define TRAP_TRACE 2 /* process trace trap */
+#define NSIGTRAP
+
+/*
+ * SIGCHLD si_codes
+ */
+#define CLD_EXITED 1 /* child has exited */
+#define CLD_KILLED 2 /* child was killed */
+#define CLD_DUMPED 3 /* child terminated abnormally */
+#define CLD_TRAPPED 4 /* traced child has trapped */
+#define CLD_STOPPED 5 /* child has stopped */
+#define CLD_CONTINUED 6 /* stopped child has continued */
+#define NSIGCHLD
+
+/*
+ * SIGPOLL si_codes
+ */
+#define POLL_IN 1 /* data input available */
+#define POLL_OUT 2 /* output buffers available */
+#define POLL_MSG 3 /* input message available */
+#define POLL_ERR 4 /* i/o error */
+#define POLL_PRI 5 /* high priority input available */
+#define POLL_HUP 6 /* device disconnected */
+#define NSIGPOLL 6
+
+/*
+ * sigevent definitions
+ *
+ * It seems likely that SIGEV_THREAD will have to be handled from
+ * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
+ * thread manager then catches and does the appropriate nonsense.
+ * However, everything is written out here so as to not get lost.
+ */
+#define SIGEV_SIGNAL 0 /* notify via signal */
+#define SIGEV_NONE 1 /* other notification: meaningless */
+#define SIGEV_THREAD 2 /* deliver via thread creation */
+
+#define SIGEV_MAX_SIZE 64
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct sigevent {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ union {
+ int _pad[SIGEV_PAD_SIZE];
+
+ struct {
+ void (*_function)(sigval_t);
+ void *_attribute; /* really pthread_attr_t */
+ } _sigev_thread;
+ } _sigev_un;
+} sigevent_t;
+
+#define sigev_notify_function _sigev_un._sigev_thread._function
+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+#endif
diff --git a/include/asm-ppc/signal.h b/include/asm-ppc/signal.h
index 5387400dc..d0c532878 100644
--- a/include/asm-ppc/signal.h
+++ b/include/asm-ppc/signal.h
@@ -1,10 +1,23 @@
#ifndef _ASMPPC_SIGNAL_H
#define _ASMPPC_SIGNAL_H
-typedef unsigned long sigset_t; /* at least 32 bits */
+#include <linux/types.h>
-#define _NSIG 32
-#define NSIG _NSIG
+/* Avoid too many header ordering problems. */
+struct siginfo;
+
+/* Most things should be clean enough to redefine this at will, if care
+ is taken to make libc match. */
+
+#define _NSIG 64
+#define _NSIG_BPW 32
+#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
+
+typedef unsigned long old_sigset_t; /* at least 32 bits */
+
+typedef struct {
+ unsigned long sig[_NSIG_WORDS];
+} sigset_t;
#define SIGHUP 1
#define SIGINT 2
@@ -43,32 +56,50 @@ typedef unsigned long sigset_t; /* at least 32 bits */
#define SIGPWR 30
#define SIGUNUSED 31
+/* These should not be considered constants from userland. */
+#define SIGRTMIN 32
+#define SIGRTMAX (_NSIG-1)
+
/*
- * sa_flags values: SA_STACK is not currently supported, but will allow the
- * usage of signal stacks by using the (now obsolete) sa_restorer field in
- * the sigaction structure as a stack pointer. This is now possible due to
- * the changes in signal handling. LBT 010493.
+ * SA_FLAGS values:
+ *
+ * SA_ONSTACK is not currently supported, but will allow sigaltstack(2).
* SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
* SA_RESTART flag to get restarting signals (which were the default long ago)
- * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
+ * SA_RESETHAND clears the handler when the signal is delivered.
+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
+ * SA_NODEFER prevents the current signal from being masked in the handler.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
*/
-#define SA_NOCLDSTOP 1
-#define SA_SHIRQ 0x04000000
-#define SA_STACK 0x08000000
+#define SA_NOCLDSTOP 0x00000001
+#define SA_NOCLDWAIT 0x00000002 /* not supported yet */
+#define SA_SIGINFO 0x00000004
+#define SA_ONSTACK 0x08000000
#define SA_RESTART 0x10000000
-#define SA_INTERRUPT 0x20000000
-#define SA_NOMASK 0x40000000
-#define SA_ONESHOT 0x80000000
+#define SA_NODEFER 0x40000000
+#define SA_RESETHAND 0x80000000
+
+#define SA_NOMASK SA_NODEFER
+#define SA_ONESHOT SA_RESETHAND
+#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
+
+#define SA_RESTORER 0x04000000
#ifdef __KERNEL__
+
/*
* These values of sa_flags are used only by the kernel as part of the
* irq handling routines.
*
* SA_INTERRUPT is also used by the irq handling routines.
+ * SA_SHIRQ is for shared interrupt support on PCI and EISA.
*/
-#define SA_PROBE SA_ONESHOT
-#define SA_SAMPLE_RANDOM SA_RESTART
+#define SA_PROBE SA_ONESHOT
+#define SA_SAMPLE_RANDOM SA_RESTART
+#define SA_SHIRQ 0x04000000
#endif
#define SIG_BLOCK 0 /* for blocking signals */
@@ -82,17 +113,33 @@ typedef void (*__sighandler_t)(int);
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
+struct old_sigaction {
+ __sighandler_t sa_handler;
+ old_sigset_t sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+};
+
struct sigaction {
__sighandler_t sa_handler;
- sigset_t sa_mask;
unsigned long sa_flags;
void (*sa_restorer)(void);
+ sigset_t sa_mask; /* mask last for extensibility */
+};
+
+struct k_sigaction {
+ struct sigaction sa;
};
+typedef struct sigaltstack {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+} stack_t;
+
#ifdef __KERNEL__
#include <asm/sigcontext.h>
-#endif
#endif
-
+#endif
diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h
index db17e6552..02dbd8816 100644
--- a/include/asm-ppc/smp.h
+++ b/include/asm-ppc/smp.h
@@ -1,12 +1,13 @@
/* smp.h: PPC specific SMP stuff.
*
- * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
+ * Taken from asm-sparc/smp.h
*/
#ifndef _PPC_SMP_H
#define _PPC_SMP_H
#include <linux/kernel.h> /* for panic */
+#include <linux/tasks.h> /* for NR_CPUS */
#ifdef __SMP__
@@ -16,7 +17,8 @@ extern unsigned long cpu_present_map;
/* per processor PPC parameters we need. */
struct cpuinfo_PPC {
- unsigned long udelay_val;
+ unsigned long loops_per_sec;
+ unsigned long pvr;
};
extern struct cpuinfo_PPC cpu_data[NR_CPUS];
@@ -31,7 +33,7 @@ extern struct klock_info klock_info;
#define KLOCK_HELD 0xff
#define KLOCK_CLEAR 0x00
-#define PROC_CHANGE_PENALTY 20
+#define PROC_CHANGE_PENALTY 1000 /* don't change cpu's for now */
extern __volatile__ int cpu_number_map[NR_CPUS];
extern __volatile__ int cpu_logical_map[NR_CPUS];
@@ -39,16 +41,12 @@ extern unsigned long smp_proc_in_lock[NR_CPUS];
extern __inline__ int hard_smp_processor_id(void)
{
- int cpuid;
- if ( ! have_of() ) /* assume prep */
- panic("hard_smp_processor_id()\n");
- else
- panic("hard_smp_processor_id()\n");
-
+ int cpuid = 0;
+ /* assume cpu # 0 for now */
return cpuid;
}
-#define smp_processor_id() hard_smp_processor_id()
+#define smp_processor_id() (current->processor)
#endif /* __ASSEMBLY__ */
@@ -56,4 +54,6 @@ extern __inline__ int hard_smp_processor_id(void)
#define NO_PROC_ID 0xFF /* No processor magic marker */
+extern void smp_store_cpu_info(int id);
+
#endif /* !(_PPC_SMP_H) */
diff --git a/include/asm-ppc/smp_lock.h b/include/asm-ppc/smp_lock.h
index 0174acfac..1db50d5ef 100644
--- a/include/asm-ppc/smp_lock.h
+++ b/include/asm-ppc/smp_lock.h
@@ -1,7 +1,6 @@
#ifndef __PPC_SMPLOCK_H
#define __PPC_SMPLOCK_H
-#include <linux/kernel.h> /* for panic */
#ifndef __SMP__
#define lock_kernel() do { } while (0)
@@ -9,7 +8,7 @@
#define release_kernel_lock(task, cpu, depth) ((depth) = 1)
#define reacquire_kernel_lock(task, cpu, depth) do { } while(0)
-#else
+#else /* __SMP__ */
/* Release global kernel lock and global interrupt lock */
#define release_kernel_lock(task, cpu, depth) \
@@ -19,39 +18,30 @@ do { \
(task)->lock_depth = 0; \
klock_info.akp = NO_PROC_ID; \
klock_info.kernel_flag = 0; \
- } \
+ } \
release_irqlock(cpu); \
__sti(); \
} while(0)
-/* Re-acquire the kernel lock */
-#define reacquire_kernel_lock(task, cpu, depth) \
-do { if (depth) \
- { __cli(); \
- __asm__ __volatile__( \
- "blr __lock_kernel\n\t" \
- "stw %2,%0\n\t" \
- : "=m" (task->lock_depth) \
- : "d" (cpu), "c" (depth)); \
- __sti(); \
- } \
-} while (0)
+extern void reacquire_kernel_lock(struct task_struct *, int,int);
/* The following acquire and release the master kernel global lock,
* the idea is that the usage of this mechanmism becomes less and less
* as time goes on, to the point where they are no longer needed at all
* and can thus disappear.
*/
+extern void __lock_kernel(struct task_struct *);
+extern void __unlock_kernel(struct task_struct *);
extern __inline__ void lock_kernel(void)
{
- panic("lock_kernel()\n");
+ __lock_kernel(current);
}
/* Release kernel global lock. */
extern __inline__ void unlock_kernel(void)
{
- panic("unlock_kernel()\n");
+ __unlock_kernel(current);
}
diff --git a/include/asm-ppc/socket.h b/include/asm-ppc/socket.h
index 62a4062cf..a33aed501 100644
--- a/include/asm-ppc/socket.h
+++ b/include/asm-ppc/socket.h
@@ -39,4 +39,6 @@
#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
#define SO_SECURITY_ENCRYPTION_NETWORK 24
+#define SO_BINDTODEVICE 25
+
#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-ppc/softirq.h b/include/asm-ppc/softirq.h
index 7cea505a8..e7e2bbb8f 100644
--- a/include/asm-ppc/softirq.h
+++ b/include/asm-ppc/softirq.h
@@ -74,12 +74,12 @@ extern inline void end_bh_atomic(void)
#else /* __SMP__ */
-extern atomic_t __sparc_bh_counter;
+extern atomic_t __ppc_bh_counter;
#define start_bh_atomic() \
- do { atomic_inc(&__sparc_bh_counter); synchronize_irq(); } while(0)
+ do { atomic_inc(&__ppc_bh_counter); synchronize_irq(); } while(0)
-#define end_bh_atomic() atomic_dec(&__sparc_bh_counter)
+#define end_bh_atomic() atomic_dec(&__ppc_bh_counter)
#include <asm/spinlock.h>
@@ -132,13 +132,13 @@ do { unsigned long flags; \
#define softirq_trylock() \
({ \
int ret = 1; \
- if(atomic_add_return(1, &__sparc_bh_counter) != 1) { \
- atomic_dec(&__sparc_bh_counter); \
+ if(atomic_add_return(1, &__ppc_bh_counter) != 1) { \
+ atomic_dec(&__ppc_bh_counter); \
ret = 0; \
} \
ret; \
})
-#define softirq_endlock() atomic_dec(&__sparc_bh_counter)
+#define softirq_endlock() atomic_dec(&__ppc_bh_counter)
#define clear_active_bhs(mask) \
do { unsigned long flags; \
spin_lock_irqsave(&global_bh_lock, flags); \
diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h
index b2fb48d03..bb4af6a0c 100644
--- a/include/asm-ppc/spinlock.h
+++ b/include/asm-ppc/spinlock.h
@@ -71,71 +71,37 @@ typedef struct _spinlock_debug spinlock_t;
#define spin_unlock_wait(lp) do { barrier(); } while((lp)->lock)
extern void _spin_lock(spinlock_t *lock);
-extern int _spin_trylock(spinlock_t *lock);
extern void _spin_unlock(spinlock_t *lock);
-extern void _spin_lock_irq(spinlock_t *lock);
-extern void _spin_unlock_irq(spinlock_t *lock);
-extern void _spin_lock_irqsave(spinlock_t *lock);
-extern void _spin_unlock_irqrestore(spinlock_t *lock);
#define spin_lock(lp) _spin_lock(lp)
-#define spin_trylock(lp) _spin_trylock(lp)
#define spin_unlock(lp) _spin_unlock(lp)
-#define spin_lock_irq(lp) _spin_lock_irq(lp)
-#define spin_unlock_irq(lp) _spin_unlock_irq(lp)
-#define spin_lock_irqsave(lp, flags) do { __save_and_cli(flags); \
- _spin_lock_irqsave(lp); } while (0)
-#define spin_unlock_irqrestore(lp, flags) do { _spin_unlock_irqrestore(lp); \
- __restore_flags(flags); } while(0)
-#if 0
-extern __inline__ void spin_unlock(spinlock_t *lock)
-{
- __asm__ __volatile__("stw 0,%0" : : "m" (lock) : "memory");
-}
-
-static inline void spin_lock(spinlock_t * lock)
-{
- int stuck = 10000000;
- int tmp, val;
-
- __asm__ __volatile__(
- " mtctr %2\n"
- "1: lwarx %0,0,%3\n"
- " andi. %1,%0,1\n\t"
- " ori %0,%0,1\n\t"
- " bne- 2f\n\t"
- " stwcx. %0,0,%3\n\t"
- "2: bdnzf- 2,1b"
- : "=r" (tmp), "=r" (val)
- : "r" (stuck), "r" (lock)
- : "ctr");
- if (!val)
- {
- unsigned long __nip;
- asm("mfnip %0\n": "=r" (__nip));
- printk("spinlock stuck at %08lx\n", __nip);
- }
-}
-#define spin_trylock(lock) (!set_bit(0,(lock)))
+
+#define spin_trylock(l) (!test_and_set_bit(0, &((l)->lock) ))
#define spin_lock_irq(lock) \
do { __cli(); spin_lock(lock); } while (0)
-
#define spin_unlock_irq(lock) \
do { spin_unlock(lock); __sti(); } while (0)
#define spin_lock_irqsave(lock, flags) \
do { __save_flags(flags); __cli(); spin_lock(lock); } while (0)
-
#define spin_unlock_irqrestore(lock, flags) \
do { spin_unlock(lock); __restore_flags(flags); } while (0)
-#endif
-struct _rwlock_debug {
- volatile unsigned int lock;
- unsigned long owner_pc;
-};
-typedef struct _rwlock_debug rwlock_t;
+/*
+ * Read-write spinlocks, allowing multiple readers
+ * but only one writer.
+ *
+ * NOTE! it is quite common to have readers in interrupts
+ * but no interrupt writers. For those circumstances we
+ * can "mix" irq-safe locks - any writer needs to get a
+ * irq-safe write-lock, but readers can get non-irqsafe
+ * read-locks.
+ */
+typedef struct {
+ volatile unsigned long lock;
+ volatile unsigned long owner_pc;
+} rwlock_t;
#define RW_LOCK_UNLOCKED { 0, 0 }
@@ -143,36 +109,25 @@ extern void _read_lock(rwlock_t *rw);
extern void _read_unlock(rwlock_t *rw);
extern void _write_lock(rwlock_t *rw);
extern void _write_unlock(rwlock_t *rw);
-extern void _read_lock_irq(rwlock_t *rw);
-extern void _read_unlock_irq(rwlock_t *rw);
-extern void _write_lock_irq(rwlock_t *rw);
-extern void _write_unlock_irq(rwlock_t *rw);
-extern void _read_lock_irqsave(rwlock_t *rw);
-extern void _read_unlock_irqrestore(rwlock_t *rw);
-extern void _write_lock_irqsave(rwlock_t *rw);
-extern void _write_unlock_irqrestore(rwlock_t *rw);
#define read_lock(rw) _read_lock(rw)
-#define read_unlock(rw) _read_unlock(rw)
#define write_lock(rw) _write_lock(rw)
#define write_unlock(rw) _write_unlock(rw)
-#define read_lock_irq(rw) _read_lock_irq(rw)
-#define read_unlock_irq(rw) _read_unlock_irq(rw)
-#define write_lock_irq(rw) _write_lock_irq(rw)
-#define write_unlock_irq(rw) _write_unlock_irq(rw)
-
-#define read_lock_irqsave(rw, flags) \
-do { __save_and_cli(flags); _read_lock_irqsave(rw); } while (0)
-
-#define read_unlock_irqrestore(rw, flags) do { _read_unlock_irqrestore(rw); \
- __restore_flags(flags); } while(0)
-
-#define write_lock_irqsave(rw, flags) \
-do { __save_and_cli(flags); _write_lock_irqsave(rw); } while(0)
+#define read_unlock(rw) _read_unlock(rw)
-#define write_unlock_irqrestore(rw, flags) do { _write_unlock_irqrestore(rw); \
- __restore_flags(flags); } while(0)
+#define read_lock_irq(lock) do { __cli(); read_lock(lock); } while (0)
+#define read_unlock_irq(lock) do { read_unlock(lock); __sti(); } while (0)
+#define write_lock_irq(lock) do { __cli(); write_lock(lock); } while (0)
+#define write_unlock_irq(lock) do { write_unlock(lock); __sti(); } while (0)
+#define read_lock_irqsave(lock, flags) \
+ do { __save_flags(flags); __cli(); read_lock(lock); } while (0)
+#define read_unlock_irqrestore(lock, flags) \
+ do { read_unlock(lock); __restore_flags(flags); } while (0)
+#define write_lock_irqsave(lock, flags) \
+ do { __save_flags(flags); __cli(); write_lock(lock); } while (0)
+#define write_unlock_irqrestore(lock, flags) \
+ do { write_unlock(lock); __restore_flags(flags); } while (0)
#endif /* SMP */
#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index 11700eb41..99fe62999 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -10,6 +10,22 @@
__asm__ __volatile__ ("mfmsr %0" : "=r" ((flags)) : : "memory"); })
#define __save_and_cli(flags) ({__save_flags(flags);__cli();})
+extern __inline__ void dcbf(void *line)
+{
+ asm("dcbf %0,%1\n\t"
+ "sync \n\t"
+ "isync \n\t"
+ :: "r" (line), "r" (0));
+}
+
+extern __inline__ void dcbi(void *line)
+{
+ asm("dcbi %0,%1\n\t"
+ "sync \n\t"
+ "isync \n\t"
+ :: "r" (line), "r" (0));
+}
+
extern __inline__ void __restore_flags(unsigned long flags)
{
extern unsigned lost_interrupts;
@@ -78,7 +94,6 @@ extern void _switch(struct thread_struct *prev, struct thread_struct *next,
unsigned long context);
struct pt_regs;
-extern int do_signal(unsigned long oldmask, struct pt_regs *regs);
extern void dump_regs(struct pt_regs *);
#ifndef __SMP__
diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h
index 0582b117c..1c9e605da 100644
--- a/include/asm-ppc/types.h
+++ b/include/asm-ppc/types.h
@@ -39,6 +39,8 @@ typedef unsigned int u32;
typedef signed long long s64;
typedef unsigned long long u64;
+#define BITS_PER_LONG 32
+
#endif /* __KERNEL__ */
#endif
diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h
index b1e19ef1f..df3d3d591 100644
--- a/include/asm-ppc/uaccess.h
+++ b/include/asm-ppc/uaccess.h
@@ -4,6 +4,7 @@
#ifndef __ASSEMBLY__
#include <linux/sched.h>
#include <linux/errno.h>
+#include <asm/processor.h>
#define VERIFY_READ 0
#define VERIFY_WRITE 1
@@ -16,15 +17,17 @@
* For historical reasons, these macros are grossly misnamed.
*/
-#define KERNEL_DS (0)
-#define USER_DS (1)
+#define KERNEL_DS ((mm_segment_t) { 0 })
+#define USER_DS ((mm_segment_t) { 1 })
-#define get_fs() (current->tss.fs)
#define get_ds() (KERNEL_DS)
+#define get_fs() (current->tss.fs)
#define set_fs(val) (current->tss.fs = (val))
+#define segment_eq(a,b) ((a).seg == (b).seg)
+
+#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS))
#define __user_ok(addr,size) (((size) <= 0x80000000)&&((addr) <= 0x80000000-(size)))
-#define __kernel_ok (get_fs() == KERNEL_DS)
#define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size)))
#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size))
diff --git a/include/asm-ppc/ucontext.h b/include/asm-ppc/ucontext.h
new file mode 100644
index 000000000..12d444cb1
--- /dev/null
+++ b/include/asm-ppc/ucontext.h
@@ -0,0 +1,13 @@
+#ifndef _ASMPPC_UCONTEXT_H
+#define _ASMPPC_UCONTEXT_H
+
+/* Copied from i386. */
+
+struct ucontext {
+ unsigned long uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ sigset_t uc_sigmask; /* mask last for extensibility */
+};
+
+#endif /* !_ASMPPC_UCONTEXT_H */
diff --git a/include/asm-ppc/unistd.h b/include/asm-ppc/unistd.h
index 227d9f155..a03465065 100644
--- a/include/asm-ppc/unistd.h
+++ b/include/asm-ppc/unistd.h
@@ -174,7 +174,9 @@
#define __NR_query_module 166
#define __NR_poll 167
#define __NR_nfsservctl 168
-#define __NR_prctl 169
+#define __NR_setresgid 169
+#define __NR_getresgid 170
+#define __NR_prctl 171
#define __NR(n) #n
#define __do_syscall(n) \
diff --git a/include/asm-sparc/asm_offsets.h b/include/asm-sparc/asm_offsets.h
index b90462a69..b3cf79d56 100644
--- a/include/asm-sparc/asm_offsets.h
+++ b/include/asm-sparc/asm_offsets.h
@@ -8,32 +8,32 @@
#define ASIZ_task_counter 0x00000004
#define AOFF_task_priority 0x00000008
#define ASIZ_task_priority 0x00000004
-#define AOFF_task_signal 0x0000000c
-#define ASIZ_task_signal 0x00000004
-#define AOFF_task_blocked 0x00000010
-#define ASIZ_task_blocked 0x00000004
-#define AOFF_task_flags 0x00000014
+#define AOFF_task_flags 0x0000000c
#define ASIZ_task_flags 0x00000004
-#define AOFF_task_errno 0x00000018
-#define ASIZ_task_errno 0x00000004
-#define AOFF_task_debugreg 0x0000001c
+#define AOFF_task_addr_limit 0x00000010
+#define ASIZ_task_addr_limit 0x00000004
+#define AOFF_task_sigpending 0x00000014
+#define ASIZ_task_sigpending 0x00000004
+#define AOFF_task_debugreg 0x00000018
#define ASIZ_task_debugreg 0x00000020
-#define AOFF_task_exec_domain 0x0000003c
+#define AOFF_task_exec_domain 0x00000038
#define ASIZ_task_exec_domain 0x00000004
-#define AOFF_task_binfmt 0x00000040
+#define AOFF_task_binfmt 0x0000003c
#define ASIZ_task_binfmt 0x00000004
-#define AOFF_task_next_task 0x00000044
+#define AOFF_task_next_task 0x00000040
#define ASIZ_task_next_task 0x00000004
-#define AOFF_task_prev_task 0x00000048
+#define AOFF_task_prev_task 0x00000044
#define ASIZ_task_prev_task 0x00000004
-#define AOFF_task_next_run 0x0000004c
+#define AOFF_task_next_run 0x00000048
#define ASIZ_task_next_run 0x00000004
-#define AOFF_task_prev_run 0x00000050
+#define AOFF_task_prev_run 0x0000004c
#define ASIZ_task_prev_run 0x00000004
-#define AOFF_task_exit_code 0x00000054
+#define AOFF_task_exit_code 0x00000050
#define ASIZ_task_exit_code 0x00000004
-#define AOFF_task_exit_signal 0x00000058
+#define AOFF_task_exit_signal 0x00000054
#define ASIZ_task_exit_signal 0x00000004
+#define AOFF_task_pdeath_signal 0x00000058
+#define ASIZ_task_pdeath_signal 0x00000004
#define AOFF_task_personality 0x0000005c
#define ASIZ_task_personality 0x00000004
#define AOFF_task_pid 0x00000064
@@ -104,14 +104,8 @@
#define ASIZ_task_it_virt_incr 0x00000004
#define AOFF_task_real_timer 0x00000114
#define ASIZ_task_real_timer 0x00000014
-#define AOFF_task_utime 0x00000128
-#define ASIZ_task_utime 0x00000004
-#define AOFF_task_stime 0x0000012c
-#define ASIZ_task_stime 0x00000004
-#define AOFF_task_cutime 0x00000130
-#define ASIZ_task_cutime 0x00000004
-#define AOFF_task_cstime 0x00000134
-#define ASIZ_task_cstime 0x00000004
+#define AOFF_task_times 0x00000128
+#define ASIZ_task_times 0x00000010
#define AOFF_task_start_time 0x00000138
#define ASIZ_task_start_time 0x00000004
#define AOFF_task_min_flt 0x0000013c
@@ -138,37 +132,47 @@
#define ASIZ_task_rlim 0x00000050
#define AOFF_task_used_math 0x000001b8
#define ASIZ_task_used_math 0x00000002
-#define AOFF_task_comm 0x000001ba
+#define AOFF_task_io_usage 0x000001bc
+#define ASIZ_task_io_usage 0x00000004
+#define AOFF_task_comm 0x000001c0
#define ASIZ_task_comm 0x00000010
-#define AOFF_task_link_count 0x000001cc
+#define AOFF_task_link_count 0x000001d0
#define ASIZ_task_link_count 0x00000004
-#define AOFF_task_tty 0x000001d0
+#define AOFF_task_tty 0x000001d4
#define ASIZ_task_tty 0x00000004
-#define AOFF_task_semundo 0x000001d4
+#define AOFF_task_semundo 0x000001d8
#define ASIZ_task_semundo 0x00000004
-#define AOFF_task_semsleeping 0x000001d8
+#define AOFF_task_semsleeping 0x000001dc
#define ASIZ_task_semsleeping 0x00000004
-#define AOFF_task_ldt 0x000001dc
+#define AOFF_task_ldt 0x000001e0
#define ASIZ_task_ldt 0x00000004
-#define AOFF_task_tss 0x000001e0
+#define AOFF_task_tss 0x000001e8
#define ASIZ_task_tss 0x00000390
-#define AOFF_task_fs 0x00000570
+#define AOFF_task_fs 0x00000578
#define ASIZ_task_fs 0x00000004
-#define AOFF_task_files 0x00000574
+#define AOFF_task_files 0x0000057c
#define ASIZ_task_files 0x00000004
-#define AOFF_task_mm 0x00000578
+#define AOFF_task_mm 0x00000580
#define ASIZ_task_mm 0x00000004
-#define AOFF_task_sig 0x0000057c
+#define AOFF_task_sig 0x00000584
#define ASIZ_task_sig 0x00000004
-#define AOFF_task_has_cpu 0x00000580
+#define AOFF_task_signal 0x00000588
+#define ASIZ_task_signal 0x00000008
+#define AOFF_task_blocked 0x00000590
+#define ASIZ_task_blocked 0x00000008
+#define AOFF_task_sigqueue 0x00000598
+#define ASIZ_task_sigqueue 0x00000004
+#define AOFF_task_sigqueue_tail 0x0000059c
+#define ASIZ_task_sigqueue_tail 0x00000004
+#define AOFF_task_has_cpu 0x000005a0
#define ASIZ_task_has_cpu 0x00000004
-#define AOFF_task_processor 0x00000584
+#define AOFF_task_processor 0x000005a4
#define ASIZ_task_processor 0x00000004
-#define AOFF_task_last_processor 0x00000588
+#define AOFF_task_last_processor 0x000005a8
#define ASIZ_task_last_processor 0x00000004
-#define AOFF_task_lock_depth 0x0000058c
+#define AOFF_task_lock_depth 0x000005ac
#define ASIZ_task_lock_depth 0x00000004
-#define AOFF_task_sigmask_lock 0x00000590
+#define AOFF_task_sigmask_lock 0x000005b0
#define ASIZ_task_sigmask_lock 0x00000000
#define AOFF_mm_mmap 0x00000000
#define ASIZ_mm_mmap 0x00000004
@@ -214,6 +218,8 @@
#define ASIZ_mm_locked_vm 0x00000004
#define AOFF_mm_def_flags 0x0000005c
#define ASIZ_mm_def_flags 0x00000004
+#define AOFF_mm_cpu_vm_mask 0x00000060
+#define ASIZ_mm_cpu_vm_mask 0x00000004
#define AOFF_thread_uwinmask 0x00000000
#define ASIZ_thread_uwinmask 0x00000004
#define AOFF_thread_kregs 0x00000004
diff --git a/include/asm-sparc/auxio.h b/include/asm-sparc/auxio.h
index f70a447bf..adffbf933 100644
--- a/include/asm-sparc/auxio.h
+++ b/include/asm-sparc/auxio.h
@@ -1,4 +1,4 @@
-/* $Id: auxio.h,v 1.17 1997/05/01 01:42:02 davem Exp $
+/* $Id: auxio.h,v 1.18 1997/11/07 15:01:45 jj Exp $
* auxio.h: Definitions and code for the Auxiliary I/O register.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -59,6 +59,8 @@ do { \
regval = *AUXREG; \
*AUXREG = ((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN4M; \
break; \
+ case sun4d: \
+ break; \
default: \
panic("Can't set AUXIO register on this machine."); \
}; \
diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h
index cd4a8ef8c..a433b684c 100644
--- a/include/asm-sparc/bitops.h
+++ b/include/asm-sparc/bitops.h
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.47 1997/05/14 20:47:56 davem Exp $
+/* $Id: bitops.h,v 1.48 1997/12/18 02:44:06 ecd Exp $
* bitops.h: Bit string operations on the Sparc.
*
* Copyright 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -9,6 +9,7 @@
#define _SPARC_BITOPS_H
#include <linux/kernel.h>
+#include <asm/byteorder.h>
#ifndef __KERNEL__
@@ -336,12 +337,6 @@ extern __inline__ int test_le_bit(int nr, __const__ void * addr)
#define find_first_zero_le_bit(addr, size) \
find_next_zero_le_bit((addr), (size), 0)
-extern __inline__ unsigned long __swab32(unsigned long value)
-{
- return((value>>24) | ((value>>8)&0xff00) |
- ((value<<8)&0xff0000) | (value<<24));
-}
-
extern __inline__ unsigned long find_next_zero_le_bit(void *addr, unsigned long size, unsigned long offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
diff --git a/include/asm-sparc/byteorder.h b/include/asm-sparc/byteorder.h
index 7cbbfd26d..a2949aea4 100644
--- a/include/asm-sparc/byteorder.h
+++ b/include/asm-sparc/byteorder.h
@@ -1,3 +1,4 @@
+/* $Id: byteorder.h,v 1.15 1997/12/16 19:20:44 davem Exp $ */
#ifndef _SPARC_BYTEORDER_H
#define _SPARC_BYTEORDER_H
diff --git a/include/asm-sparc/delay.h b/include/asm-sparc/delay.h
index e604769ed..dcb477a6c 100644
--- a/include/asm-sparc/delay.h
+++ b/include/asm-sparc/delay.h
@@ -1,4 +1,4 @@
-/* $Id: delay.h,v 1.9 1997/04/11 00:42:19 davem Exp $
+/* $Id: delay.h,v 1.10 1997/11/07 18:24:30 mj Exp $
* delay.h: Linux delay routines on the Sparc.
*
* Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu).
@@ -22,8 +22,4 @@ extern __inline__ void __delay(unsigned long loops)
/* This is too messy with inline asm on the Sparc. */
extern void udelay(unsigned long usecs);
-/* calibrate_delay() wants this... */
-#define muldiv(a, b, c) (((a)*(b))/(c))
-
#endif /* defined(__SPARC_DELAY_H) */
-
diff --git a/include/asm-sparc/elf.h b/include/asm-sparc/elf.h
index f9a6d836f..483cd73f2 100644
--- a/include/asm-sparc/elf.h
+++ b/include/asm-sparc/elf.h
@@ -1,4 +1,4 @@
-/* $Id: elf.h,v 1.7 1997/08/29 17:04:34 richard Exp $ */
+/* $Id: elf.h,v 1.11 1997/09/26 18:37:32 tdyas Exp $ */
#ifndef __ASMSPARC_ELF_H
#define __ASMSPARC_ELF_H
@@ -7,6 +7,7 @@
*/
#include <asm/ptrace.h>
+#include <asm/mbus.h>
typedef unsigned long elf_greg_t;
@@ -37,5 +38,30 @@ typedef unsigned long elf_fpregset_t;
#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000)
+/* This yields a mask that user programs can use to figure out what
+ instruction set this cpu supports. This can NOT be done in userspace
+ on Sparc. */
+
+/* Sun4c has none of the capabilities, most sun4m's have them all.
+ * XXX This is gross, set some global variable at boot time. -DaveM
+ */
+#define ELF_HWCAP ((sparc_cpu_model == sun4c) ? 0 : \
+ (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \
+ HWCAP_SPARC_SWAP | \
+ ((srmmu_modtype != Cypress && \
+ srmmu_modtype != Cypress_vE && \
+ srmmu_modtype != Cypress_vD) ? \
+ HWCAP_SPARC_MULDIV : 0)))
+
+/* This yields a string that ld.so will use to load implementation
+ specific libraries for optimization. This is more specific in
+ intent than poking at uname or /proc/cpuinfo. */
+
+#define ELF_PLATFORM (NULL)
+
+#ifdef __KERNEL__
+#define SET_PERSONALITY(ex, ibcs2) \
+ current->personality = (ibcs2 ? PER_SVR4 : PER_LINUX)
+#endif
#endif /* !(__ASMSPARC_ELF_H) */
diff --git a/include/asm-sparc/head.h b/include/asm-sparc/head.h
index 306328e96..7693be507 100644
--- a/include/asm-sparc/head.h
+++ b/include/asm-sparc/head.h
@@ -1,4 +1,4 @@
-/* $Id: head.h,v 1.32 1996/12/04 00:12:48 ecd Exp $ */
+/* $Id: head.h,v 1.33 1997/10/04 08:54:22 ecd Exp $ */
#ifndef __SPARC_HEAD_H
#define __SPARC_HEAD_H
@@ -111,4 +111,4 @@
#define WINDOW_FILL \
rd %psr, %l0; rd %wim, %l3; b fill_window_entry; andcc %l0, PSR_PS, %g0;
-#endif __SPARC_HEAD_H
+#endif /* __SPARC_HEAD_H */
diff --git a/include/asm-sparc/io-unit.h b/include/asm-sparc/io-unit.h
new file mode 100644
index 000000000..606346937
--- /dev/null
+++ b/include/asm-sparc/io-unit.h
@@ -0,0 +1,43 @@
+/* io-unit.h: Definitions for the sun4d IO-UNIT.
+ *
+ * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
+ */
+#ifndef _SPARC_IO_UNIT_H
+#define _SPARC_IO_UNIT_H
+
+#include <asm/page.h>
+#include <asm/spinlock.h>
+
+/* The io-unit handles all virtual to physical address translations
+ * that occur between the SBUS and physical memory. Access by
+ * the cpu to IO registers and similar go over the xdbus so are
+ * translated by the on chip SRMMU. The io-unit and the srmmu do
+ * not need to have the same translations at all, in fact most
+ * of the time the translations they handle are a disjunct set.
+ * Basically the io-unit handles all dvma sbus activity.
+ */
+
+/* AIEEE, unlike the nice sun4m, these monsters have
+ fixed DMA range 64M */
+
+#define IOUNIT_DMA_BASE 0xfc000000 /* TOP - 64M */
+#define IOUNIT_DMA_SIZE 0x04000000 /* 64M */
+/* We use last 4M for sparc_dvma_malloc */
+#define IOUNIT_DVMA_SIZE 0x00400000 /* 4M */
+
+/* The format of an iopte in the external page tables */
+#define IOUPTE_PAGE 0xffffff00 /* Physical page number (PA[35:12]) */
+#define IOUPTE_CACHE 0x00000080 /* Cached (in Viking/MXCC) */
+#define IOUPTE_STREAM 0x00000040
+#define IOUPTE_INTRA 0x00000008 /* Not regular memory - probably direct sbus<->sbus dma
+ FIXME: Play with this and find out how we can make use of this */
+#define IOUPTE_WRITE 0x00000004 /* Writeable */
+#define IOUPTE_VALID 0x00000002 /* IOPTE is valid */
+#define IOUPTE_PARITY 0x00000001
+
+struct iounit_struct {
+ spinlock_t iommu_lock;
+ iopte_t *page_table;
+};
+
+#endif /* !(_SPARC_IO_UNIT_H) */
diff --git a/include/asm-sparc/ioctls.h b/include/asm-sparc/ioctls.h
index 1124df116..5cd982c28 100644
--- a/include/asm-sparc/ioctls.h
+++ b/include/asm-sparc/ioctls.h
@@ -75,6 +75,9 @@
#define TIOCGPGRP _IOR('t', 131, int)
#define TIOCSCTTY _IO('t', 132)
#define TIOCGSID _IOR('t', 133, int)
+/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */
+#define TIOCGPTN _IOR('t', 134, unsigned int) /* Get Pty Number */
+#define TIOCSPTLCK _IOW('t', 135, int) /* Lock/unlock PTY */
/* Little f */
#define FIOCLEX _IO('f', 1)
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h
index 811bf524a..60a328094 100644
--- a/include/asm-sparc/irq.h
+++ b/include/asm-sparc/irq.h
@@ -1,4 +1,4 @@
-/* $Id: irq.h,v 1.20 1997/05/28 05:25:07 davem Exp $
+/* $Id: irq.h,v 1.21 1997/11/19 15:12:20 jj Exp $
* irq.h: IRQ registers on the Sparc.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -11,6 +11,17 @@
#include <asm/system.h> /* For NCPUS */
+/* This is used for sun4d */
+struct devid_cookie {
+ /* Caller specifies these. */
+ void *real_dev_id; /* What dev_id would usually contain. */
+ void *bus_cookie; /* linux_sbus_device *, etc. */
+ /* Return values. */
+ unsigned int ret_ino;
+};
+
+#define SA_DCOOKIE 0x10000
+
#define NR_IRQS 15
/* Get rid of this when lockups have gone away. -DaveM */
diff --git a/include/asm-sparc/kdebug.h b/include/asm-sparc/kdebug.h
index 8607d9b5c..8a0fdfd51 100644
--- a/include/asm-sparc/kdebug.h
+++ b/include/asm-sparc/kdebug.h
@@ -1,4 +1,4 @@
-/* $Id: kdebug.h,v 1.9 1996/05/10 19:52:35 davem Exp $
+/* $Id: kdebug.h,v 1.10 1997/12/14 23:24:40 ecd Exp $
* kdebug.h: Defines and definitions for debugging the Linux kernel
* under various kernel debuggers.
*
@@ -72,8 +72,4 @@ extern __inline__ void sp_enter_debugger(void)
#define KDEBUG_DUNNO2_OFF 0x8
#define KDEBUG_TEACH_OFF 0xc
-/* ugh... */
-#define TRAP_TRACE(reg1, reg2) \
-
-
#endif /* !(_SPARC_KDEBUG_H) */
diff --git a/include/asm-sparc/kgdb.h b/include/asm-sparc/kgdb.h
index 79534dac8..614ebad01 100644
--- a/include/asm-sparc/kgdb.h
+++ b/include/asm-sparc/kgdb.h
@@ -1,4 +1,4 @@
-/* $Id: kgdb.h,v 1.7 1995/11/27 02:43:18 davem Exp $
+/* $Id: kgdb.h,v 1.8 1998/01/07 06:33:44 baccala Exp $
* kgdb.h: Defines and declarations for serial line source level
* remote debugging of the Linux kernel using gdb.
*
@@ -83,8 +83,12 @@ struct kgdb_frame {
ldd [%reg + REGWIN_SZ + KGDB_I4], %i4; \
ldd [%reg + REGWIN_SZ + KGDB_I6], %i6;
-#define LOAD_KGDB_SREGS(reg, reg_y_and_psr, reg_pc_and_npc) \
- ldd [%reg + REGWIN_SZ + KGDB_Y], %reg_y_and_psr; \
- ldd [%reg + REGWIN_SZ + KGDB_PC], %reg_pc_and_npc;
+#define LOAD_KGDB_SREGS(reg, reg_y, reg_psr, reg_wim, reg_tbr, reg_pc, reg_npc) \
+ ld [%reg + REGWIN_SZ + KGDB_Y], %reg_y; \
+ ld [%reg + REGWIN_SZ + KGDB_PSR], %reg_psr; \
+ ld [%reg + REGWIN_SZ + KGDB_WIM], %reg_wim; \
+ ld [%reg + REGWIN_SZ + KGDB_TBR], %reg_tbr; \
+ ld [%reg + REGWIN_SZ + KGDB_PC], %reg_pc; \
+ ld [%reg + REGWIN_SZ + KGDB_NPC], %reg_npc;
#endif /* !(_SPARC_KGDB_H) */
diff --git a/include/asm-sparc/md.h b/include/asm-sparc/md.h
new file mode 100644
index 000000000..e0d0e85a5
--- /dev/null
+++ b/include/asm-sparc/md.h
@@ -0,0 +1,13 @@
+/* $Id: md.h,v 1.1 1997/12/15 15:12:39 jj Exp $
+ * md.h: High speed xor_block operation for RAID4/5
+ *
+ */
+
+#ifndef __ASM_MD_H
+#define __ASM_MD_H
+
+/* #define HAVE_ARCH_XORBLOCK */
+
+#define MD_XORBLOCK_ALIGNMENT sizeof(long)
+
+#endif /* __ASM_MD_H */
diff --git a/include/asm-sparc/namei.h b/include/asm-sparc/namei.h
index d8f559440..d16626424 100644
--- a/include/asm-sparc/namei.h
+++ b/include/asm-sparc/namei.h
@@ -1,4 +1,4 @@
-/* $Id: namei.h,v 1.8 1997/09/05 12:38:51 jj Exp $
+/* $Id: namei.h,v 1.10 1997/09/24 16:20:36 jj Exp $
* linux/include/asm-sparc/namei.h
*
* Routines to handle famous /usr/gnemul/s*.
@@ -14,37 +14,48 @@
static inline struct dentry *
__sparc_lookup_dentry(const char *name, int follow_link)
{
- int error;
struct dentry *base;
+ char *emul;
switch (current->personality) {
case PER_BSD:
+ emul = SPARC_BSD_EMUL; break;
case PER_SVR4:
- break;
+ emul = SPARC_SOL_EMUL; break;
default:
- return ERR_PTR(-ENOENT);
+ return NULL;
}
- base = lookup_dentry ((current->personality == PER_BSD) ?
- SPARC_BSD_EMUL : SPARC_SOL_EMUL,
- dget (current->fs->root), 1);
+ base = lookup_dentry (emul, dget (current->fs->root), 1);
- if (IS_ERR (base)) return base;
+ if (IS_ERR (base)) return NULL;
base = lookup_dentry (name, base, follow_link);
-
- if (IS_ERR (base)) return base;
-
+
+ if (IS_ERR (base)) return NULL;
+
if (!base->d_inode) {
- dput(base);
- return ERR_PTR(-ENOENT);
+ struct dentry *fromroot;
+
+ fromroot = lookup_dentry (name, dget (current->fs->root), follow_link);
+
+ if (IS_ERR (fromroot)) return base;
+
+ if (fromroot->d_inode) {
+ dput(base);
+ return fromroot;
+ }
+
+ dput(fromroot);
}
-
- return base;
+
+ return base;
}
#define __prefix_lookup_dentry(name, follow_link) \
- dentry = __sparc_lookup_dentry (name, follow_link); \
- if (!IS_ERR (dentry)) return dentry;
+ if (current->personality) { \
+ dentry = __sparc_lookup_dentry (name, follow_link); \
+ if (dentry) return dentry; \
+ }
#endif /* __SPARC_NAMEI_H */
diff --git a/include/asm-sparc/obio.h b/include/asm-sparc/obio.h
new file mode 100644
index 000000000..171a0a34d
--- /dev/null
+++ b/include/asm-sparc/obio.h
@@ -0,0 +1,203 @@
+/* $Id: obio.h,v 1.3 1997/12/18 14:21:41 jj Exp $
+ * obio.h: Some useful locations in 0xFXXXXXXXX PA obio space on sun4d.
+ *
+ * Copyright (C) 1997 Jakub Jelinek <jj@sunsite.mff.cuni.cz>
+ */
+
+#ifndef _SPARC_OBIO_H
+#define _SPARC_OBIO_H
+
+#include <asm/asi.h>
+
+/* This weird monster likes to use the very upper parts of
+ 36bit PA for these things :) */
+
+/* CSR space (for each XDBUS)
+ * ------------------------------------------------------------------------
+ * | 0xFE | DEVID | | XDBUS ID | |
+ * ------------------------------------------------------------------------
+ * 35 28 27 20 19 10 9 8 7 0
+ */
+
+#define CSR_BASE_ADDR 0xe0000000
+#define CSR_CPU_SHIFT (32 - 4 - 5)
+#define CSR_XDBUS_SHIFT 8
+
+#define CSR_BASE(cpu) (((CSR_BASE_ADDR >> CSR_CPU_SHIFT) + cpu) << CSR_CPU_SHIFT)
+
+/* ECSR space (not for each XDBUS)
+ * ------------------------------------------------------------------------
+ * | 0xF | DEVID[7:1] | |
+ * ------------------------------------------------------------------------
+ * 35 32 31 25 24 0
+ */
+
+#define ECSR_BASE_ADDR 0x00000000
+#define ECSR_CPU_SHIFT (32 - 5)
+#define ECSR_DEV_SHIFT (32 - 8)
+
+#define ECSR_BASE(cpu) ((cpu) << ECSR_CPU_SHIFT)
+#define ECSR_DEV_BASE(devid) ((devid) << ECSR_DEV_SHIFT)
+
+/* Bus Watcher */
+#define BW_LOCAL_BASE 0xfff00000
+
+#define BW_CID 0x00000000
+#define BW_DBUS_CTRL 0x00000008
+#define BW_DBUS_DATA 0x00000010
+#define BW_CTRL 0x00001000
+#define BW_INTR_TABLE 0x00001040
+#define BW_INTR_TABLE_CLEAR 0x00001080
+#define BW_PRESCALER 0x000010c0
+#define BW_PTIMER_LIMIT 0x00002000
+#define BW_PTIMER_COUNTER2 0x00002004
+#define BW_PTIMER_NDLIMIT 0x00002008
+#define BW_PTIMER_CTRL 0x0000200c
+#define BW_PTIMER_COUNTER 0x00002010
+#define BW_TIMER_LIMIT 0x00003000
+#define BW_TIMER_COUNTER2 0x00003004
+#define BW_TIMER_NDLIMIT 0x00003008
+#define BW_TIMER_CTRL 0x0000300c
+#define BW_TIMER_COUNTER 0x00003010
+
+/* BW Control */
+#define BW_CTRL_USER_TIMER 0x00000004 /* Is User Timer Free run enabled */
+
+/* Boot Bus */
+#define BB_LOCAL_BASE 0xf0000000
+
+#define BB_LEDS 0x002e0000
+
+/* Cache Controller */
+#define CC_DATSTREAM 0x1F00000 /* Data stream register */
+#define CC_DATSIZE 0x1F0003F /* Size */
+#define CC_SRCSTREAM 0x1F00100 /* Source stream register */
+#define CC_DESSTREAM 0x1F00200 /* Destination stream register */
+#define CC_RMCOUNT 0x1F00300 /* Count of references and misses */
+#define CC_IPEN 0x1F00406 /* Pending Interrupts */
+#define CC_IMSK 0x1F00506 /* Interrupt Mask */
+#define CC_ICLR 0x1F00606 /* Clear pending Interrupts */
+#define CC_IGEN 0x1F00704 /* Generate Interrupt register */
+#define CC_STEST 0x1F00804 /* Internal self-test */
+#define CC_CREG 0x1F00A04 /* Control register */
+#define CC_SREG 0x1F00B00 /* Status register */
+#define CC_RREG 0x1F00C04 /* Reset register */
+#define CC_EREG 0x1F00E00 /* Error code register */
+#define CC_CID 0x1F00F04 /* Component ID */
+
+#ifndef __ASSEMBLY__
+
+extern __inline__ int bw_get_intr_mask(int sbus_level)
+{
+ int mask;
+
+ __asm__ __volatile__ ("lduha [%1] %2, %0" :
+ "=r" (mask) :
+ "r" (BW_LOCAL_BASE + BW_INTR_TABLE + (sbus_level << 3)),
+ "i" (ASI_M_CTL));
+ return mask;
+}
+
+extern __inline__ void bw_clear_intr_mask(int sbus_level, int mask)
+{
+ __asm__ __volatile__ ("stha %0, [%1] %2" : :
+ "r" (mask),
+ "r" (BW_LOCAL_BASE + BW_INTR_TABLE_CLEAR + (sbus_level << 3)),
+ "i" (ASI_M_CTL));
+}
+
+extern __inline__ unsigned bw_get_prof_limit(int cpu)
+{
+ unsigned limit;
+
+ __asm__ __volatile__ ("lda [%1] %2, %0" :
+ "=r" (limit) :
+ "r" (CSR_BASE(cpu) + BW_PTIMER_LIMIT),
+ "i" (ASI_M_CTL));
+ return limit;
+}
+
+extern __inline__ void bw_set_prof_limit(int cpu, unsigned limit)
+{
+ __asm__ __volatile__ ("sta %0, [%1] %2" : :
+ "r" (limit),
+ "r" (CSR_BASE(cpu) + BW_PTIMER_LIMIT),
+ "i" (ASI_M_CTL));
+}
+
+extern __inline__ unsigned bw_get_ctrl(int cpu)
+{
+ unsigned ctrl;
+
+ __asm__ __volatile__ ("lda [%1] %2, %0" :
+ "=r" (ctrl) :
+ "r" (CSR_BASE(cpu) + BW_CTRL),
+ "i" (ASI_M_CTL));
+ return ctrl;
+}
+
+extern __inline__ void bw_set_ctrl(int cpu, unsigned ctrl)
+{
+ __asm__ __volatile__ ("sta %0, [%1] %2" : :
+ "r" (ctrl),
+ "r" (CSR_BASE(cpu) + BW_CTRL),
+ "i" (ASI_M_CTL));
+}
+
+extern __inline__ void show_leds(int cpuid, unsigned char mask)
+{
+ __asm__ __volatile__ ("stba %0, [%1] %2" : :
+ "r" (mask),
+ "r" (ECSR_BASE(cpuid) | BB_LEDS),
+ "i" (ASI_M_CTL));
+}
+
+extern __inline__ unsigned cc_get_ipen(void)
+{
+ unsigned pending;
+
+ __asm__ __volatile__ ("lduha [%1] %2, %0" :
+ "=r" (pending) :
+ "r" (CC_IPEN),
+ "i" (ASI_M_MXCC));
+ return pending;
+}
+
+extern __inline__ void cc_set_iclr(unsigned clear)
+{
+ __asm__ __volatile__ ("stha %0, [%1] %2" : :
+ "r" (clear),
+ "r" (CC_ICLR),
+ "i" (ASI_M_MXCC));
+}
+
+extern __inline__ unsigned cc_get_imsk(void)
+{
+ unsigned mask;
+
+ __asm__ __volatile__ ("lduha [%1] %2, %0" :
+ "=r" (mask) :
+ "r" (CC_IMSK),
+ "i" (ASI_M_MXCC));
+ return mask;
+}
+
+extern __inline__ void cc_set_imsk(unsigned mask)
+{
+ __asm__ __volatile__ ("stha %0, [%1] %2" : :
+ "r" (mask),
+ "r" (CC_IMSK),
+ "i" (ASI_M_MXCC));
+}
+
+extern __inline__ void cc_set_igen(unsigned gen)
+{
+ __asm__ __volatile__ ("sta %0, [%1] %2" : :
+ "r" (gen),
+ "r" (CC_IGEN),
+ "i" (ASI_M_MXCC));
+}
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* !(_SPARC_OBIO_H) */
diff --git a/include/asm-sparc/oplib.h b/include/asm-sparc/oplib.h
index bb404745f..f91394a7f 100644
--- a/include/asm-sparc/oplib.h
+++ b/include/asm-sparc/oplib.h
@@ -1,4 +1,4 @@
-/* $Id: oplib.h,v 1.16 1997/06/27 14:55:04 jj Exp $
+/* $Id: oplib.h,v 1.18 1997/09/24 11:34:18 jj Exp $
* oplib.h: Describes the interface and available routines in the
* Linux Prom library.
*
diff --git a/include/asm-sparc/page.h b/include/asm-sparc/page.h
index 23d2aebc2..2cd6512b4 100644
--- a/include/asm-sparc/page.h
+++ b/include/asm-sparc/page.h
@@ -1,4 +1,4 @@
-/* $Id: page.h,v 1.35 1996/12/19 08:08:22 davem Exp $
+/* $Id: page.h,v 1.37 1997/11/28 15:59:21 jj Exp $
* page.h: Various defines and such for MMU operations on the Sparc for
* the Linux kernel.
*
@@ -8,14 +8,15 @@
#ifndef _SPARC_PAGE_H
#define _SPARC_PAGE_H
-#include <linux/config.h>
-#include <asm/head.h> /* for KERNBASE */
-
#define PAGE_SHIFT 12
#define PAGE_SIZE (1 << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#ifdef __KERNEL__
+
+#include <linux/config.h>
+#include <asm/head.h> /* for KERNBASE */
+
#ifndef __ASSEMBLY__
#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
@@ -29,8 +30,8 @@ extern unsigned long page_offset;
extern unsigned long (*mmu_v2p)(unsigned long);
extern unsigned long (*mmu_p2v)(unsigned long);
-#define __pa(x) mmu_v2p((unsigned long)(x))
-#define __va(x) mmu_p2v((unsigned long)(x))
+#define __pa(x) (mmu_v2p((unsigned long)(x)))
+#define __va(x) ((void *)(mmu_p2v((unsigned long)(x))))
/* The following structure is used to hold the physical
* memory configuration of the machine. This is filled in
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index dd6428edf..a8403c531 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.63 1997/08/13 04:44:15 paulus Exp $ */
+/* $Id: pgtable.h,v 1.64 1997/11/07 15:01:44 jj Exp $ */
#ifndef _SPARC_PGTABLE_H
#define _SPARC_PGTABLE_H
@@ -376,6 +376,7 @@ __get_phys (unsigned long addr)
case sun4c:
return sun4c_get_pte (addr) << PAGE_SHIFT;
case sun4m:
+ case sun4d:
return ((srmmu_get_pte (addr) & 0xffffff00) << 4);
default:
return 0;
@@ -389,6 +390,7 @@ __get_iospace (unsigned long addr)
case sun4c:
return -1; /* Don't check iospace on sun4c */
case sun4m:
+ case sun4d:
return (srmmu_get_pte (addr) >> 28);
default:
return -1;
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h
index 6ee971dc2..8b6bfdeed 100644
--- a/include/asm-sparc/processor.h
+++ b/include/asm-sparc/processor.h
@@ -1,4 +1,4 @@
-/* $Id: processor.h,v 1.59 1997/05/01 01:42:03 davem Exp $
+/* $Id: processor.h,v 1.61 1997/10/22 09:25:42 jj Exp $
* include/asm-sparc/processor.h
*
* Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
@@ -35,11 +35,20 @@
*/
#define TASK_SIZE (page_offset)
+#define COPY_TASK_STRUCT(dst, src) \
+do { \
+ *dst = *src; \
+} while (0)
+
struct fpq {
unsigned long *insn_addr;
unsigned long insn;
};
+typedef struct {
+ int seg;
+} mm_segment_t;
+
/* The Sparc processor specific thread struct. */
struct thread_struct {
unsigned long uwinmask __attribute__ ((aligned (8)));
@@ -74,7 +83,7 @@ struct thread_struct {
struct fpq fpqueue[16];
struct sigstack sstk_info;
unsigned long flags;
- int current_ds;
+ mm_segment_t current_ds;
struct exec core_exec; /* just what it says. */
int new_signal;
};
@@ -103,7 +112,7 @@ struct thread_struct {
/* sstk_info */ \
{ 0, 0, }, \
/* flags, current_ds, */ \
- SPARC_FLAG_KTHREAD, USER_DS, \
+ SPARC_FLAG_KTHREAD, KERNEL_DS, \
/* core_exec */ \
{ 0, }, \
/* new_signal */ \
diff --git a/include/asm-sparc/psr.h b/include/asm-sparc/psr.h
index bbec3d969..9778b8c8b 100644
--- a/include/asm-sparc/psr.h
+++ b/include/asm-sparc/psr.h
@@ -1,4 +1,4 @@
-/* $Id: psr.h,v 1.14 1997/04/11 00:42:19 davem Exp $
+/* $Id: psr.h,v 1.15 1997/10/04 08:54:22 ecd Exp $
* psr.h: This file holds the macros for masking off various parts of
* the processor status register on the Sparc. This is valid
* for Version 8. On the V9 this is renamed to the PSTATE
@@ -41,12 +41,12 @@
extern __inline__ unsigned int get_psr(void)
{
unsigned int psr;
- __asm__ __volatile__("
- rd %%psr, %0
- nop
- nop
- nop
-" : "=r" (psr)
+ __asm__ __volatile__(
+ "rd %%psr, %0\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ : "=r" (psr)
: /* no inputs */
: "memory");
@@ -55,12 +55,12 @@ extern __inline__ unsigned int get_psr(void)
extern __inline__ void put_psr(unsigned int new_psr)
{
- __asm__ __volatile__("
- wr %0, 0x0, %%psr
- nop
- nop
- nop
-" : /* no outputs */
+ __asm__ __volatile__(
+ "wr %0, 0x0, %%psr\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ "nop\n\t"
+ : /* no outputs */
: "r" (new_psr)
: "memory", "cc");
}
@@ -76,10 +76,10 @@ extern __inline__ unsigned int get_fsr(void)
{
unsigned int fsr = 0;
- __asm__ __volatile__("
- st %%fsr, %1
- ld %1, %0
-" : "=r" (fsr)
+ __asm__ __volatile__(
+ "st %%fsr, %1\n\t"
+ "ld %1, %0\n\t"
+ : "=r" (fsr)
: "m" (fsr_storage));
return fsr;
diff --git a/include/asm-sparc/ross.h b/include/asm-sparc/ross.h
index 7b270883f..42c5381eb 100644
--- a/include/asm-sparc/ross.h
+++ b/include/asm-sparc/ross.h
@@ -1,4 +1,4 @@
-/* $Id: ross.h,v 1.12 1997/03/10 09:16:57 davem Exp $
+/* $Id: ross.h,v 1.13 1998/01/07 06:49:11 baccala Exp $
* ross.h: Ross module specific definitions and defines.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -8,6 +8,7 @@
#define _SPARC_ROSS_H
#include <asm/asi.h>
+#include <asm/page.h>
/* Ross made Hypersparcs have a %psr 'impl' field of '0001'. The 'vers'
* field has '1111'.
diff --git a/include/asm-sparc/sbi.h b/include/asm-sparc/sbi.h
new file mode 100644
index 000000000..75aa2598b
--- /dev/null
+++ b/include/asm-sparc/sbi.h
@@ -0,0 +1,107 @@
+/* $Id: sbi.h,v 1.1 1997/11/19 15:12:16 jj Exp $
+ * sbi.h: SBI (Sbus Interface on sun4d) definitions
+ *
+ * Copyright (C) 1997 Jakub Jelinek <jj@sunsite.mff.cuni.cz>
+ */
+
+#ifndef _SPARC_SBI_H
+#define _SPARC_SBI_H
+
+#include <asm/obio.h>
+
+/* SBI */
+struct sbi_regs {
+/* 0x0000 */ u32 cid; /* Component ID */
+/* 0x0004 */ u32 ctl; /* Control */
+/* 0x0008 */ u32 status; /* Status */
+ u32 _unused1;
+
+/* 0x0010 */ u32 cfg0; /* Slot0 config reg */
+/* 0x0014 */ u32 cfg1; /* Slot1 config reg */
+/* 0x0018 */ u32 cfg2; /* Slot2 config reg */
+/* 0x001c */ u32 cfg3; /* Slot3 config reg */
+
+/* 0x0020 */ u32 stb0; /* Streaming buf control for slot 0 */
+/* 0x0024 */ u32 stb1; /* Streaming buf control for slot 1 */
+/* 0x0028 */ u32 stb2; /* Streaming buf control for slot 2 */
+/* 0x002c */ u32 stb3; /* Streaming buf control for slot 3 */
+
+/* 0x0030 */ u32 intr_state; /* Interrupt state */
+/* 0x0034 */ u32 intr_tid; /* Interrupt target ID */
+/* 0x0038 */ u32 intr_diag; /* Interrupt diagnostics */
+};
+
+#define SBI_CID 0x02800000
+#define SBI_CTL 0x02800004
+#define SBI_STATUS 0x02800008
+#define SBI_CFG0 0x02800010
+#define SBI_CFG1 0x02800014
+#define SBI_CFG2 0x02800018
+#define SBI_CFG3 0x0280001c
+#define SBI_STB0 0x02800020
+#define SBI_STB1 0x02800024
+#define SBI_STB2 0x02800028
+#define SBI_STB3 0x0280002c
+#define SBI_INTR_STATE 0x02800030
+#define SBI_INTR_TID 0x02800034
+#define SBI_INTR_DIAG 0x02800038
+
+/* Burst bits for 8, 16, 32, 64 are in cfgX registers at bits 2, 3, 4, 5 respectively */
+#define SBI_CFG_BURST_MASK 0x0000001e
+
+/* How to make devid from sbi no */
+#define SBI2DEVID(sbino) ((sbino<<4)|2)
+
+/* intr_state has 4 bits for slots 0 .. 3 and these bits are repeated for each sbus irq level
+ *
+ * +-------+-------+-------+-------+-------+-------+-------+-------+
+ * SBUS IRQ LEVEL | 7 | 6 | 5 | 4 | 3 | 2 | 1 | |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Reser |
+ * SLOT # |3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0|3|2|1|0| ved |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-------+
+ * Bits 31 27 23 19 15 11 7 3 0
+ */
+
+
+#ifndef __ASSEMBLY__
+
+extern __inline__ int acquire_sbi(int devid, int mask)
+{
+ __asm__ __volatile__ ("swapa [%2] %3, %0" :
+ "=r" (mask) :
+ "0" (mask),
+ "r" (ECSR_DEV_BASE(devid) | SBI_INTR_STATE),
+ "i" (ASI_M_CTL));
+ return mask;
+}
+
+extern __inline__ void release_sbi(int devid, int mask)
+{
+ __asm__ __volatile__ ("sta %0, [%1] %2" : :
+ "r" (mask),
+ "r" (ECSR_DEV_BASE(devid) | SBI_INTR_STATE),
+ "i" (ASI_M_CTL));
+}
+
+extern __inline__ int get_sbi_ctl(int devid, int cfgno)
+{
+ int cfg;
+
+ __asm__ __volatile__ ("lda [%1] %2, %0" :
+ "=r" (cfg) :
+ "r" ((ECSR_DEV_BASE(devid) | SBI_CFG0) + (cfgno<<2)),
+ "i" (ASI_M_CTL));
+ return cfg;
+}
+
+extern __inline__ void set_sbi_ctl(int devid, int cfgno, int cfg)
+{
+ __asm__ __volatile__ ("sta %0, [%1] %2" : :
+ "r" (cfg),
+ "r" ((ECSR_DEV_BASE(devid) | SBI_CFG0) + (cfgno<<2)),
+ "i" (ASI_M_CTL));
+}
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* !(_SPARC_SBI_H) */
diff --git a/include/asm-sparc/sbus.h b/include/asm-sparc/sbus.h
index 2750e7600..5e8131118 100644
--- a/include/asm-sparc/sbus.h
+++ b/include/asm-sparc/sbus.h
@@ -1,4 +1,4 @@
-/* $Id: sbus.h,v 1.12 1997/02/04 07:29:21 davem Exp $
+/* $Id: sbus.h,v 1.13 1997/11/19 15:12:18 jj Exp $
* sbus.h: Defines for the Sun SBus.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -69,10 +69,12 @@ struct linux_sbus {
struct linux_sbus_device *devices; /* Link to devices on this SBus */
struct iommu_struct *iommu; /* IOMMU for this sbus if applicable */
int prom_node; /* PROM device tree node for this SBus */
- char prom_name[64]; /* Usually "sbus" or "sbi" */
+ char prom_name[16]; /* Usually "sbus" or "sbi" */
int clock_freq;
struct linux_prom_ranges sbus_ranges[PROMREG_MAX];
int num_sbus_ranges;
+ int devid;
+ int board;
};
extern struct linux_sbus *SBus_chain;
diff --git a/include/asm-sparc/siginfo.h b/include/asm-sparc/siginfo.h
new file mode 100644
index 000000000..1d1d0a28e
--- /dev/null
+++ b/include/asm-sparc/siginfo.h
@@ -0,0 +1,199 @@
+/* $Id: siginfo.h,v 1.1 1997/12/14 23:24:40 ecd Exp $
+ * siginfo.c:
+ */
+
+#ifndef _SPARC_SIGINFO_H
+#define _SPARC_SIGINFO_H
+
+#include <linux/types.h>
+
+typedef union sigval {
+ int sival_int;
+ void *sival_ptr;
+} sigval_t;
+
+#define SI_MAX_SIZE 128
+#define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct siginfo {
+ int si_signo;
+ int si_errno;
+ int si_code;
+
+ union {
+ int _pad[SI_PAD_SIZE];
+
+ /* kill() */
+ struct {
+ pid_t _pid; /* sender's pid */
+ uid_t _uid; /* sender's uid */
+ } _kill;
+
+ /* POSIX.1b timers */
+ struct {
+ unsigned int _timer1;
+ unsigned int _timer2;
+ } _timer;
+
+ /* POSIX.1b signals */
+ struct {
+ pid_t _pid; /* sender's pid */
+ uid_t _uid; /* sender's uid */
+ sigval_t _sigval;
+ } _rt;
+
+ /* SIGCHLD */
+ struct {
+ pid_t _pid; /* which child */
+ int _status; /* exit code */
+ clock_t _utime;
+ clock_t _stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+ struct {
+ void *_addr; /* faulting insn/memory ref. */
+ int _trapno; /* TRAP # which caused the signal */
+ } _sigfault;
+
+ /* SIGPOLL */
+ struct {
+ int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ int _fd;
+ } _sigpoll;
+ } _sifields;
+} siginfo_t;
+
+/*
+ * How these fields are to be accessed.
+ */
+#define si_pid _sifields._kill._pid
+#define si_uid _sifields._kill._uid
+#define si_status _sifields._sigchld._status
+#define si_utime _sifields._sigchld._utime
+#define si_stime _sifields._sigchld._stime
+#define si_value _sifields._rt._sigval
+#define si_int _sifields._rt._sigval.sival_int
+#define si_ptr _sifields._rt._sigval.sival_ptr
+#define si_addr _sifields._sigfault._addr
+#define si_trapno _sifields._sigfault._trapno
+#define si_band _sifields._sigpoll._band
+#define si_fd _sifields._sigpoll._fd
+
+/*
+ * si_code values
+ * Digital reserves positive values for kernel-generated signals.
+ */
+#define SI_USER 0 /* sent by kill, sigsend, raise */
+#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
+#define SI_QUEUE -1 /* sent by sigqueue */
+#define SI_TIMER -2 /* sent by timer expiration */
+#define SI_MESGQ -3 /* sent by real time mesq state change */
+#define SI_ASYNCIO -4 /* sent by AIO completion */
+
+#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
+#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
+
+/*
+ * SIGILL si_codes
+ */
+#define ILL_ILLOPC 1 /* illegal opcode */
+#define ILL_ILLOPN 2 /* illegal operand */
+#define ILL_ILLADR 3 /* illegal addressing mode */
+#define ILL_ILLTRP 4 /* illegal trap */
+#define ILL_PRVOPC 5 /* privileged opcode */
+#define ILL_PRVREG 6 /* privileged register */
+#define ILL_COPROC 7 /* coprocessor error */
+#define ILL_BADSTK 8 /* internal stack error */
+#define NSIGILL 8
+
+/*
+ * SIGFPE si_codes
+ */
+#define FPE_INTDIV 1 /* integer divide by zero */
+#define FPE_INTOVF 2 /* integer overflow */
+#define FPE_FLTDIV 3 /* floating point divide by zero */
+#define FPE_FLTOVF 4 /* floating point overflow */
+#define FPE_FLTUND 5 /* floating point underflow */
+#define FPE_FLTRES 6 /* floating point inexact result */
+#define FPE_FLTINV 7 /* floating point invalid operation */
+#define FPE_FLTSUB 8 /* subscript out of range */
+#define NSIGFPE 8
+
+/*
+ * SIGSEGV si_codes
+ */
+#define SEGV_MAPERR 1 /* address not mapped to object */
+#define SRGV_ACCERR 2 /* invalid permissions for mapped object */
+#define NSIGSEGV 2
+
+/*
+ * SIGBUS si_codes
+ */
+#define BUS_ADRALN 1 /* invalid address alignment */
+#define BUS_ADRERR 2 /* non-existant physical address */
+#define BUS_OBJERR 3 /* object specific hardware error */
+#define NSIGBUS 3
+
+/*
+ * SIGTRAP si_codes
+ */
+#define TRAP_BRKPT 1 /* process breakpoint */
+#define TRAP_TRACE 2 /* process trace trap */
+#define NSIGTRAP
+
+/*
+ * SIGCHLD si_codes
+ */
+#define CLD_EXITED 1 /* child has exited */
+#define CLD_KILLED 2 /* child was killed */
+#define CLD_DUMPED 3 /* child terminated abnormally */
+#define CLD_TRAPPED 4 /* traced child has trapped */
+#define CLD_STOPPED 5 /* child has stopped */
+#define CLD_CONTINUED 6 /* stopped child has continued */
+#define NSIGCHLD
+
+/*
+ * SIGPOLL si_codes
+ */
+#define POLL_IN 1 /* data input available */
+#define POLL_OUT 2 /* output buffers available */
+#define POLL_MSG 3 /* input message available */
+#define POLL_ERR 4 /* i/o error */
+#define POLL_PRI 5 /* high priority input available */
+#define POLL_HUP 6 /* device disconnected */
+#define NSIGPOLL 6
+
+/*
+ * sigevent definitions
+ *
+ * It seems likely that SIGEV_THREAD will have to be handled from
+ * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
+ * thread manager then catches and does the appropriate nonsense.
+ * However, everything is written out here so as to not get lost.
+ */
+#define SIGEV_SIGNAL 0 /* notify via signal */
+#define SIGEV_NONE 1 /* other notification: meaningless */
+#define SIGEV_THREAD 2 /* deliver via thread creation */
+
+#define SIGEV_MAX_SIZE 64
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct sigevent {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ union {
+ int _pad[SIGEV_PAD_SIZE];
+
+ struct {
+ void (*_function)(sigval_t);
+ void *_attribute; /* really pthread_attr_t */
+ } _sigev_thread;
+ } _sigev_un;
+} sigevent_t;
+
+#define sigev_notify_function _sigev_un._sigev_thread._function
+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+#endif /* !(_SPARC_SIGINFO_H) */
diff --git a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h
index d2e4e7eab..cdc8b27fc 100644
--- a/include/asm-sparc/signal.h
+++ b/include/asm-sparc/signal.h
@@ -1,4 +1,4 @@
-/* $Id: signal.h,v 1.30 1996/12/24 08:59:36 davem Exp $ */
+/* $Id: signal.h,v 1.31 1997/12/14 23:24:41 ecd Exp $ */
#ifndef _ASMSPARC_SIGNAL_H
#define _ASMSPARC_SIGNAL_H
@@ -7,15 +7,13 @@
#ifdef __KERNEL__
#ifndef __ASSEMBLY__
#include <linux/personality.h>
+#include <linux/types.h>
#endif
#endif
/* On the Sparc the signal handlers get passed a 'sub-signal' code
* for certain signal types, which we document here.
*/
-#define _NSIG 32
-#define NSIG _NSIG
-
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
@@ -80,14 +78,38 @@
#define SIGUSR1 30
#define SIGUSR2 31
-#ifndef __ASSEMBLY__
+/* Most things should be clean enough to redefine this at will, if care
+ * is taken to make libc match.
+ */
-typedef unsigned long sigset_t;
+#define __OLD_NSIG 32
+#define __NEW_NSIG 64
+#define _NSIG_BPW 32
+#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
-#ifdef __KERNEL__
-#include <asm/sigcontext.h>
+#define SIGRTMIN 32
+#define SIGRTMAX (__NEW_NSIG - 1)
+
+#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
+#define _NSIG __NEW_NSIG
+#define __new_sigset_t sigset_t
+#define __new_sigaction sigaction
+#define __old_sigset_t old_sigset_t
+#define __old_sigaction old_sigaction
+#else
+#define _NSIG __OLD_NSIG
+#define __old_sigset_t sigset_t
+#define __old_sigaction sigaction
#endif
+#ifndef __ASSEMBLY__
+
+typedef unsigned long __old_sigset_t;
+
+typedef struct {
+ unsigned long sig[_NSIG_WORDS];
+} __new_sigset_t;
+
/* A SunOS sigstack */
struct sigstack {
char *the_stack;
@@ -116,6 +138,8 @@ struct sigstack {
#define SA_INTERRUPT 0x10
#define SA_NOMASK 0x20
#define SA_SHIRQ 0x40
+#define SA_NOCLDWAIT 0x100 /* not supported yet */
+#define SA_SIGINFO 0x200
#define SIG_BLOCK 0x01 /* for blocking signals */
#define SIG_UNBLOCK 0x02 /* for unblocking signals */
@@ -154,13 +178,31 @@ typedef void (*__sighandler_t)(int);
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
-struct sigaction {
- __sighandler_t sa_handler;
- sigset_t sa_mask;
- unsigned long sa_flags;
- void (*sa_restorer) (void); /* not used by Linux/SPARC yet */
+struct __new_sigaction {
+ __sighandler_t sa_handler;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void); /* Not used by Linux/SPARC */
+ __new_sigset_t sa_mask;
+};
+
+struct k_sigaction {
+ struct __new_sigaction sa;
+ void *ka_restorer;
+};
+
+struct __old_sigaction {
+ __sighandler_t sa_handler;
+ __old_sigset_t sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer) (void); /* not used by Linux/SPARC */
};
+typedef struct sigaltstack {
+ void *ss_sp;
+ int ss_flags;
+ __kernel_size_t ss_size;
+} stack_t;
+
#endif /* !(__ASSEMBLY__) */
#endif /* !(_ASMSPARC_SIGNAL_H) */
diff --git a/include/asm-sparc/socket.h b/include/asm-sparc/socket.h
index f5205550d..00be94356 100644
--- a/include/asm-sparc/socket.h
+++ b/include/asm-sparc/socket.h
@@ -1,4 +1,4 @@
-/* $Id: socket.h,v 1.9 1997/03/17 04:50:50 davem Exp $ */
+/* $Id: socket.h,v 1.11 1997/10/19 00:19:14 davem Exp $ */
#ifndef _ASM_SOCKET_H
#define _ASM_SOCKET_H
@@ -35,9 +35,11 @@
#define SO_NO_CHECK 0x000b
#define SO_PRIORITY 0x000c
+#define SO_BINDTODEVICE 0x000d
+
/* Security levels - as per NRL IPv6 - don't actually do anything */
-#define SO_SECURITY_AUTHENTICATION 0x000d
-#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x000e
-#define SO_SECURITY_ENCRYPTION_NETWORK 0x000f
+#define SO_SECURITY_AUTHENTICATION 0x5001
+#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
+#define SO_SECURITY_ENCRYPTION_NETWORK 0x5004
#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-sparc/string.h b/include/asm-sparc/string.h
index 7fa65510f..6957dde67 100644
--- a/include/asm-sparc/string.h
+++ b/include/asm-sparc/string.h
@@ -1,4 +1,4 @@
-/* $Id: string.h,v 1.32 1997/05/20 07:58:59 jj Exp $
+/* $Id: string.h,v 1.33 1997/11/19 07:57:48 jj Exp $
* string.h: External definitions for optimized assembly string
* routines for the Linux Kernel.
*
@@ -17,7 +17,7 @@ extern void __memmove(void *,const void *,__kernel_size_t);
extern __kernel_size_t __memcpy(void *,const void *,__kernel_size_t);
extern __kernel_size_t __memset(void *,int,__kernel_size_t);
-#ifndef EXPORT_SYMTAB
+#ifndef EXPORT_SYMTAB_STROPS
/* First the mem*() things. */
#define __HAVE_ARCH_BCOPY
@@ -192,7 +192,7 @@ extern inline int __constant_strncmp(const char *src, const char *dest, __kernel
__constant_strncmp(__arg0, __arg1, __arg2) : \
__strncmp(__arg0, __arg1, __arg2))
-#endif /* EXPORT_SYMTAB */
+#endif /* !EXPORT_SYMTAB_STROPS */
#endif /* __KERNEL__ */
diff --git a/include/asm-sparc/svr4.h b/include/asm-sparc/svr4.h
index 7eb1c3aad..7d163a6fc 100644
--- a/include/asm-sparc/svr4.h
+++ b/include/asm-sparc/svr4.h
@@ -69,7 +69,7 @@ typedef struct {
caddr_t ptr;
} svr4_xrs_t;
-/* Machine dependant context */
+/* Machine dependent context */
typedef struct {
svr4_gregset_t greg; /* registers 0..19 (see top) */
svr4_gwindows_t *gwin; /* may point to register windows */
diff --git a/include/asm-sparc/timer.h b/include/asm-sparc/timer.h
index 3820794e7..9dcd84dec 100644
--- a/include/asm-sparc/timer.h
+++ b/include/asm-sparc/timer.h
@@ -1,4 +1,4 @@
-/* $Id: timer.h,v 1.13 1996/08/29 09:48:59 davem Exp $
+/* $Id: timer.h,v 1.15 1997/12/18 14:21:43 jj Exp $
* timer.h: Definitions for the timer chips on the Sparc.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -76,6 +76,20 @@ struct sun4m_timer_regs {
};
extern struct sun4m_timer_regs *sun4m_timers;
+
+#define SUN4D_PRM_CNT_L 0x80000000
+#define SUN4D_PRM_CNT_LVALUE 0x7FFFFC00
+
+struct sun4d_timer_regs {
+ volatile unsigned int l10_timer_limit;
+ volatile unsigned int l10_cur_countx;
+ volatile unsigned int l10_limit_noclear;
+ volatile unsigned int ctrl;
+ volatile unsigned int l10_cur_count;
+};
+
+extern struct sun4d_timer_regs *sun4d_timers;
+
extern __volatile__ unsigned int *master_l10_counter;
extern __volatile__ unsigned int *master_l10_limit;
diff --git a/include/asm-sparc/types.h b/include/asm-sparc/types.h
index d8334325a..b70210ba8 100644
--- a/include/asm-sparc/types.h
+++ b/include/asm-sparc/types.h
@@ -1,4 +1,4 @@
-/* $Id: types.h,v 1.10 1996/08/29 09:49:04 davem Exp $ */
+/* $Id: types.h,v 1.11 1997/12/22 13:28:22 mj Exp $ */
#ifndef _SPARC_TYPES_H
#define _SPARC_TYPES_H
@@ -43,6 +43,8 @@ typedef unsigned int u32;
typedef __signed__ long long s64;
typedef unsigned long long u64;
+#define BITS_PER_LONG 32
+
#endif /* __KERNEL__ */
#endif /* defined(_SPARC_TYPES_H) */
diff --git a/include/asm-sparc/uaccess.h b/include/asm-sparc/uaccess.h
index 4ffc23657..c89ec9c35 100644
--- a/include/asm-sparc/uaccess.h
+++ b/include/asm-sparc/uaccess.h
@@ -1,4 +1,4 @@
-/* $Id: uaccess.h,v 1.13 1997/04/11 00:42:22 davem Exp $
+/* $Id: uaccess.h,v 1.14 1997/09/18 10:42:02 rth Exp $
* uaccess.h: User space memore access functions.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -21,15 +21,18 @@
*
* "For historical reasons, these macros are grossly misnamed." -Linus
*/
-#define KERNEL_DS 0
-#define USER_DS -1
+
+#define KERNEL_DS ((mm_segment_t) { 0 })
+#define USER_DS ((mm_segment_t) { -1 })
#define VERIFY_READ 0
#define VERIFY_WRITE 1
-#define get_fs() (current->tss.current_ds)
-#define get_ds() (KERNEL_DS)
-#define set_fs(val) ((current->tss.current_ds) = (val))
+#define get_ds() (KERNEL_DS)
+#define get_fs() (current->tss.current_ds)
+#define set_fs(val) ((current->tss.current_ds) = (val))
+
+#define segment_eq(a,b) ((a).seg == (b).seg)
/* We have there a nice not-mapped page at page_offset - PAGE_SIZE, so that this test
* can be fairly lightweight.
@@ -37,8 +40,8 @@
* large size and address near to page_offset - a fault will break his intentions.
*/
#define __user_ok(addr,size) ((addr) < stack_top)
-#define __kernel_ok (get_fs() == KERNEL_DS)
-#define __access_ok(addr,size) (__user_ok((addr) & get_fs(),(size)))
+#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS))
+#define __access_ok(addr,size) (__user_ok((addr) & get_fs().seg,(size)))
#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size))
extern inline int verify_area(int type, const void * addr, unsigned long size)
diff --git a/include/asm-sparc/unaligned.h b/include/asm-sparc/unaligned.h
index 470b8fe59..9bbc1c822 100644
--- a/include/asm-sparc/unaligned.h
+++ b/include/asm-sparc/unaligned.h
@@ -3,7 +3,7 @@
/* Sparc can't handle unaligned accesses. */
-#include <asm/string.h>
+#include <linux/string.h>
/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index a99623c74..df519f28f 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -1,4 +1,4 @@
-/* $Id: unistd.h,v 1.33 1997/05/21 10:21:55 jj Exp $ */
+/* $Id: unistd.h,v 1.36 1997/12/14 23:24:43 ecd Exp $ */
#ifndef _SPARC_UNISTD_H
#define _SPARC_UNISTD_H
@@ -83,8 +83,8 @@
#define __NR_getpagesize 64 /* Common */
#define __NR_msync 65 /* Common in newer 1.3.x revs... */
/* #define __NR_ni_syscall 66 ENOSYS under SunOS */
-/* #define __NR_ni_syscall 67 ENOSYS under SunOS */
-/* #define __NR_ni_syscall 68 ENOSYS under SunOS */
+#define __NR_pread 67 /* Linux Specific */
+#define __NR_pwrite 68 /* Linux Specific */
#define __NR_sbrk 69 /* SunOS Specific */
#define __NR_sstk 70 /* SunOS Specific */
#define __NR_mmap 71 /* Common */
@@ -117,13 +117,13 @@
#define __NR_connect 98 /* Common */
#define __NR_accept 99 /* Common */
#define __NR_getpriority 100 /* Common */
-#define __NR_send 101 /* Common */
-#define __NR_recv 102 /* Common */
-/* #define __NR_ni_syscall 103 ENOSYS under SunOS */
-#define __NR_bind 104 /* Common */
-#define __NR_setsockopt 105 /* Common */
-#define __NR_listen 106 /* Common */
-/* #define __NR_ni_syscall 107 ENOSYS under SunOS */
+#define __NR_rt_sigreturn 101 /* Linux Specific */
+#define __NR_rt_sigaction 102 /* Linux Specific */
+#define __NR_rt_sigprocmask 103 /* Linux Specific */
+#define __NR_rt_sigpending 104 /* Linux Specific */
+#define __NR_rt_sigtimedwait 105 /* Linux Specific */
+#define __NR_rt_sigqueueinfo 106 /* Linux Specific */
+#define __NR_rt_sigsuspend 107 /* Linux Specific */
#define __NR_sigvec 108 /* SunOS Specific */
#define __NR_sigblock 109 /* SunOS Specific */
#define __NR_sigsetmask 110 /* SunOS Specific */
@@ -163,7 +163,7 @@
#define __NR_getrlimit 144 /* Common */
#define __NR_setrlimit 145 /* Common */
#define __NR_killpg 146 /* SunOS Specific */
-/* #define __NR_ni_syscall 147 ENOSYS under SunOS */
+#define __NR_prctl 147 /* ENOSYS under SunOS */
/* #define __NR_ni_syscall 148 ENOSYS under SunOS */
/* #define __NR_ni_syscall 149 ENOSYS under SunOS */
#define __NR_getsockname 150 /* Common */
@@ -272,7 +272,6 @@
#define __NR_fdatasync 253
#define __NR_nfsservctl 254
#define __NR_aplib 255
-#define __NR_prctl 256
#define _syscall0(type,name) \
type name(void) \
diff --git a/include/asm-sparc64/asm_offsets.h b/include/asm-sparc64/asm_offsets.h
index 18cf7c541..5dac70418 100644
--- a/include/asm-sparc64/asm_offsets.h
+++ b/include/asm-sparc64/asm_offsets.h
@@ -8,32 +8,32 @@
#define ASIZ_task_counter 0x00000008
#define AOFF_task_priority 0x00000010
#define ASIZ_task_priority 0x00000008
-#define AOFF_task_signal 0x00000018
-#define ASIZ_task_signal 0x00000008
-#define AOFF_task_blocked 0x00000020
-#define ASIZ_task_blocked 0x00000008
-#define AOFF_task_flags 0x00000028
+#define AOFF_task_flags 0x00000018
#define ASIZ_task_flags 0x00000008
-#define AOFF_task_errno 0x00000030
-#define ASIZ_task_errno 0x00000004
-#define AOFF_task_debugreg 0x00000038
+#define AOFF_task_addr_limit 0x00000020
+#define ASIZ_task_addr_limit 0x00000008
+#define AOFF_task_sigpending 0x00000028
+#define ASIZ_task_sigpending 0x00000004
+#define AOFF_task_debugreg 0x00000030
#define ASIZ_task_debugreg 0x00000040
-#define AOFF_task_exec_domain 0x00000078
+#define AOFF_task_exec_domain 0x00000070
#define ASIZ_task_exec_domain 0x00000008
-#define AOFF_task_binfmt 0x00000080
+#define AOFF_task_binfmt 0x00000078
#define ASIZ_task_binfmt 0x00000008
-#define AOFF_task_next_task 0x00000088
+#define AOFF_task_next_task 0x00000080
#define ASIZ_task_next_task 0x00000008
-#define AOFF_task_prev_task 0x00000090
+#define AOFF_task_prev_task 0x00000088
#define ASIZ_task_prev_task 0x00000008
-#define AOFF_task_next_run 0x00000098
+#define AOFF_task_next_run 0x00000090
#define ASIZ_task_next_run 0x00000008
-#define AOFF_task_prev_run 0x000000a0
+#define AOFF_task_prev_run 0x00000098
#define ASIZ_task_prev_run 0x00000008
-#define AOFF_task_exit_code 0x000000a8
+#define AOFF_task_exit_code 0x000000a0
#define ASIZ_task_exit_code 0x00000004
-#define AOFF_task_exit_signal 0x000000ac
+#define AOFF_task_exit_signal 0x000000a4
#define ASIZ_task_exit_signal 0x00000004
+#define AOFF_task_pdeath_signal 0x000000a8
+#define ASIZ_task_pdeath_signal 0x00000004
#define AOFF_task_personality 0x000000b0
#define ASIZ_task_personality 0x00000008
#define AOFF_task_pid 0x000000bc
@@ -69,100 +69,110 @@
#define AOFF_task_wait_chldexit 0x00000198
#define ASIZ_task_wait_chldexit 0x00000008
#define AOFF_task_uid 0x000001a0
-#define ASIZ_task_uid 0x00000002
-#define AOFF_task_euid 0x000001a2
-#define ASIZ_task_euid 0x00000002
-#define AOFF_task_suid 0x000001a4
-#define ASIZ_task_suid 0x00000002
-#define AOFF_task_fsuid 0x000001a6
-#define ASIZ_task_fsuid 0x00000002
-#define AOFF_task_gid 0x000001a8
-#define ASIZ_task_gid 0x00000002
-#define AOFF_task_egid 0x000001aa
-#define ASIZ_task_egid 0x00000002
-#define AOFF_task_sgid 0x000001ac
-#define ASIZ_task_sgid 0x00000002
-#define AOFF_task_fsgid 0x000001ae
-#define ASIZ_task_fsgid 0x00000002
-#define AOFF_task_timeout 0x000001b0
+#define ASIZ_task_uid 0x00000004
+#define AOFF_task_euid 0x000001a4
+#define ASIZ_task_euid 0x00000004
+#define AOFF_task_suid 0x000001a8
+#define ASIZ_task_suid 0x00000004
+#define AOFF_task_fsuid 0x000001ac
+#define ASIZ_task_fsuid 0x00000004
+#define AOFF_task_gid 0x000001b0
+#define ASIZ_task_gid 0x00000004
+#define AOFF_task_egid 0x000001b4
+#define ASIZ_task_egid 0x00000004
+#define AOFF_task_sgid 0x000001b8
+#define ASIZ_task_sgid 0x00000004
+#define AOFF_task_fsgid 0x000001bc
+#define ASIZ_task_fsgid 0x00000004
+#define AOFF_task_timeout 0x000001c0
#define ASIZ_task_timeout 0x00000008
-#define AOFF_task_policy 0x000001b8
+#define AOFF_task_policy 0x000001c8
#define ASIZ_task_policy 0x00000008
-#define AOFF_task_rt_priority 0x000001c0
+#define AOFF_task_rt_priority 0x000001d0
#define ASIZ_task_rt_priority 0x00000008
-#define AOFF_task_it_real_value 0x000001c8
+#define AOFF_task_it_real_value 0x000001d8
#define ASIZ_task_it_real_value 0x00000008
-#define AOFF_task_it_prof_value 0x000001d0
+#define AOFF_task_it_prof_value 0x000001e0
#define ASIZ_task_it_prof_value 0x00000008
-#define AOFF_task_it_virt_value 0x000001d8
+#define AOFF_task_it_virt_value 0x000001e8
#define ASIZ_task_it_virt_value 0x00000008
-#define AOFF_task_it_real_incr 0x000001e0
+#define AOFF_task_it_real_incr 0x000001f0
#define ASIZ_task_it_real_incr 0x00000008
-#define AOFF_task_it_prof_incr 0x000001e8
+#define AOFF_task_it_prof_incr 0x000001f8
#define ASIZ_task_it_prof_incr 0x00000008
-#define AOFF_task_it_virt_incr 0x000001f0
+#define AOFF_task_it_virt_incr 0x00000200
#define ASIZ_task_it_virt_incr 0x00000008
-#define AOFF_task_real_timer 0x000001f8
+#define AOFF_task_real_timer 0x00000208
#define ASIZ_task_real_timer 0x00000028
-#define AOFF_task_times 0x00000220
+#define AOFF_task_times 0x00000230
#define ASIZ_task_times 0x00000020
-#define AOFF_task_start_time 0x00000240
+#define AOFF_task_start_time 0x00000250
#define ASIZ_task_start_time 0x00000008
-#define AOFF_task_min_flt 0x00000248
+#define AOFF_task_min_flt 0x00000258
#define ASIZ_task_min_flt 0x00000008
-#define AOFF_task_maj_flt 0x00000250
+#define AOFF_task_maj_flt 0x00000260
#define ASIZ_task_maj_flt 0x00000008
-#define AOFF_task_nswap 0x00000258
+#define AOFF_task_nswap 0x00000268
#define ASIZ_task_nswap 0x00000008
-#define AOFF_task_cmin_flt 0x00000260
+#define AOFF_task_cmin_flt 0x00000270
#define ASIZ_task_cmin_flt 0x00000008
-#define AOFF_task_cmaj_flt 0x00000268
+#define AOFF_task_cmaj_flt 0x00000278
#define ASIZ_task_cmaj_flt 0x00000008
-#define AOFF_task_cnswap 0x00000270
+#define AOFF_task_cnswap 0x00000280
#define ASIZ_task_cnswap 0x00000008
-#define AOFF_task_swap_address 0x00000280
+#define AOFF_task_swap_address 0x00000290
#define ASIZ_task_swap_address 0x00000008
-#define AOFF_task_old_maj_flt 0x00000288
+#define AOFF_task_old_maj_flt 0x00000298
#define ASIZ_task_old_maj_flt 0x00000008
-#define AOFF_task_dec_flt 0x00000290
+#define AOFF_task_dec_flt 0x000002a0
#define ASIZ_task_dec_flt 0x00000008
-#define AOFF_task_swap_cnt 0x00000298
+#define AOFF_task_swap_cnt 0x000002a8
#define ASIZ_task_swap_cnt 0x00000008
-#define AOFF_task_rlim 0x000002a0
+#define AOFF_task_rlim 0x000002b0
#define ASIZ_task_rlim 0x000000a0
-#define AOFF_task_used_math 0x00000340
+#define AOFF_task_used_math 0x00000350
#define ASIZ_task_used_math 0x00000002
-#define AOFF_task_comm 0x00000342
+#define AOFF_task_io_usage 0x00000358
+#define ASIZ_task_io_usage 0x00000008
+#define AOFF_task_comm 0x00000360
#define ASIZ_task_comm 0x00000010
-#define AOFF_task_link_count 0x00000354
+#define AOFF_task_link_count 0x00000370
#define ASIZ_task_link_count 0x00000004
-#define AOFF_task_tty 0x00000358
+#define AOFF_task_tty 0x00000378
#define ASIZ_task_tty 0x00000008
-#define AOFF_task_semundo 0x00000360
+#define AOFF_task_semundo 0x00000380
#define ASIZ_task_semundo 0x00000008
-#define AOFF_task_semsleeping 0x00000368
+#define AOFF_task_semsleeping 0x00000388
#define ASIZ_task_semsleeping 0x00000008
-#define AOFF_task_ldt 0x00000370
+#define AOFF_task_ldt 0x00000390
#define ASIZ_task_ldt 0x00000008
-#define AOFF_task_tss 0x00000380
-#define ASIZ_task_tss 0x000004c0
-#define AOFF_task_fs 0x00000840
+#define AOFF_task_tss 0x000003a0
+#define ASIZ_task_tss 0x00000490
+#define AOFF_task_fs 0x00000830
#define ASIZ_task_fs 0x00000008
-#define AOFF_task_files 0x00000848
+#define AOFF_task_files 0x00000838
#define ASIZ_task_files 0x00000008
-#define AOFF_task_mm 0x00000850
+#define AOFF_task_mm 0x00000840
#define ASIZ_task_mm 0x00000008
-#define AOFF_task_sig 0x00000858
+#define AOFF_task_sig 0x00000848
#define ASIZ_task_sig 0x00000008
-#define AOFF_task_has_cpu 0x00000860
+#define AOFF_task_signal 0x00000850
+#define ASIZ_task_signal 0x00000008
+#define AOFF_task_blocked 0x00000858
+#define ASIZ_task_blocked 0x00000008
+#define AOFF_task_sigqueue 0x00000860
+#define ASIZ_task_sigqueue 0x00000008
+#define AOFF_task_sigqueue_tail 0x00000868
+#define ASIZ_task_sigqueue_tail 0x00000008
+#define AOFF_task_has_cpu 0x00000870
#define ASIZ_task_has_cpu 0x00000004
-#define AOFF_task_processor 0x00000864
+#define AOFF_task_processor 0x00000874
#define ASIZ_task_processor 0x00000004
-#define AOFF_task_last_processor 0x00000868
+#define AOFF_task_last_processor 0x00000878
#define ASIZ_task_last_processor 0x00000004
-#define AOFF_task_lock_depth 0x0000086c
+#define AOFF_task_lock_depth 0x0000087c
#define ASIZ_task_lock_depth 0x00000004
-#define AOFF_task_sigmask_lock 0x00000870
+#define AOFF_task_sigmask_lock 0x00000880
#define ASIZ_task_sigmask_lock 0x00000000
#define AOFF_mm_mmap 0x00000000
#define ASIZ_mm_mmap 0x00000008
@@ -213,34 +223,34 @@
#define AOFF_thread_ksp 0x00000000
#define ASIZ_thread_ksp 0x00000008
#define AOFF_thread_kpc 0x00000008
-#define ASIZ_thread_kpc 0x00000008
-#define AOFF_thread_wstate 0x00000010
-#define ASIZ_thread_wstate 0x00000008
-#define AOFF_thread_cwp 0x00000018
-#define ASIZ_thread_cwp 0x00000004
-#define AOFF_thread_ctx 0x0000001c
-#define ASIZ_thread_ctx 0x00000004
-#define AOFF_thread_flags 0x00000020
-#define ASIZ_thread_flags 0x00000004
-#define AOFF_thread_new_signal 0x00000024
-#define ASIZ_thread_new_signal 0x00000004
-#define AOFF_thread_current_ds 0x00000028
+#define ASIZ_thread_kpc 0x00000004
+#define AOFF_thread_wstate 0x0000000c
+#define ASIZ_thread_wstate 0x00000002
+#define AOFF_thread_cwp 0x0000000e
+#define ASIZ_thread_cwp 0x00000002
+#define AOFF_thread_flags 0x00000010
+#define ASIZ_thread_flags 0x00000002
+#define AOFF_thread_ctx 0x00000012
+#define ASIZ_thread_ctx 0x00000002
+#define AOFF_thread_w_saved 0x00000014
+#define ASIZ_thread_w_saved 0x00000002
+#define AOFF_thread_new_signal 0x00000016
+#define ASIZ_thread_new_signal 0x00000002
+#define AOFF_thread_current_ds 0x00000018
#define ASIZ_thread_current_ds 0x00000008
-#define AOFF_thread_w_saved 0x00000030
-#define ASIZ_thread_w_saved 0x00000008
-#define AOFF_thread_kregs 0x00000038
+#define AOFF_thread_kregs 0x00000020
#define ASIZ_thread_kregs 0x00000008
-#define AOFF_thread_reg_window 0x00000040
+#define AOFF_thread_utraps 0x00000028
+#define ASIZ_thread_utraps 0x00000008
+#define AOFF_thread_reg_window 0x00000030
#define ASIZ_thread_reg_window 0x00000400
-#define AOFF_thread_rwbuf_stkptrs 0x00000440
+#define AOFF_thread_rwbuf_stkptrs 0x00000430
#define ASIZ_thread_rwbuf_stkptrs 0x00000040
-#define AOFF_thread_sig_address 0x00000480
+#define AOFF_thread_sig_address 0x00000470
#define ASIZ_thread_sig_address 0x00000008
-#define AOFF_thread_sig_desc 0x00000488
+#define AOFF_thread_sig_desc 0x00000478
#define ASIZ_thread_sig_desc 0x00000008
-#define AOFF_thread_sstk_info 0x00000490
+#define AOFF_thread_sstk_info 0x00000480
#define ASIZ_thread_sstk_info 0x00000010
-#define AOFF_thread_core_exec 0x000004a0
-#define ASIZ_thread_core_exec 0x00000020
#endif /* __ASM_OFFSETS_H__ */
diff --git a/include/asm-sparc64/bitops.h b/include/asm-sparc64/bitops.h
index ab4523e9d..e8b600eb0 100644
--- a/include/asm-sparc64/bitops.h
+++ b/include/asm-sparc64/bitops.h
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.22 1997/08/07 02:54:04 davem Exp $
+/* $Id: bitops.h,v 1.23 1997/12/18 02:44:12 ecd Exp $
* bitops.h: Bit string operations on the V9.
*
* Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -7,6 +7,7 @@
#ifndef _SPARC64_BITOPS_H
#define _SPARC64_BITOPS_H
+#include <asm/byteorder.h>
#include <asm/asi.h> /* For the little endian spaces. */
/* These can all be exported to userland, because the atomic
@@ -287,15 +288,6 @@ extern __inline__ int test_le_bit(int nr, __const__ void * addr)
#define find_first_zero_le_bit(addr, size) \
find_next_zero_le_bit((addr), (size), 0)
-extern __inline__ unsigned long __swab64p(unsigned long *addr)
-{
- unsigned long ret;
- __asm__ __volatile__ ("ldxa [%1] %2, %0"
- : "=r" (ret)
- : "r" (addr), "i" (ASI_PL));
- return ret;
-}
-
extern __inline__ unsigned long find_next_zero_le_bit(void *addr, unsigned long size, unsigned long offset)
{
unsigned long *p = ((unsigned long *) addr) + (offset >> 6);
diff --git a/include/asm-sparc64/byteorder.h b/include/asm-sparc64/byteorder.h
index 43964767b..f8c370d26 100644
--- a/include/asm-sparc64/byteorder.h
+++ b/include/asm-sparc64/byteorder.h
@@ -1,3 +1,4 @@
+/* $Id: byteorder.h,v 1.8 1997/12/18 02:44:14 ecd Exp $ */
#ifndef _SPARC64_BYTEORDER_H
#define _SPARC64_BYTEORDER_H
@@ -26,7 +27,8 @@ static __inline__ __u32 ___arch__swab32p(__u32 *addr)
return ret;
}
-static __inline__ __u64 ___arch__swab64p(__u64 *addr) {
+static __inline__ __u64 ___arch__swab64p(__u64 *addr)
+{
__u64 ret;
__asm__ __volatile__ ("ldxa [%1] %2, %0"
@@ -41,6 +43,8 @@ static __inline__ __u64 ___arch__swab64p(__u64 *addr) {
#define __BYTEORDER_HAS_U64__
+#endif /* __GNUC__ */
+
#include <linux/byteorder/big_endian.h>
#endif /* _SPARC64_BYTEORDER_H */
diff --git a/include/asm-sparc64/delay.h b/include/asm-sparc64/delay.h
index eac45ef9a..1df90bce6 100644
--- a/include/asm-sparc64/delay.h
+++ b/include/asm-sparc64/delay.h
@@ -1,4 +1,4 @@
-/* $Id: delay.h,v 1.6 1997/07/29 21:11:22 davem Exp $
+/* $Id: delay.h,v 1.7 1997/11/07 18:24:31 mj Exp $
* delay.h: Linux delay routines on the V9.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu).
@@ -46,10 +46,4 @@ extern __inline__ void __udelay(unsigned long usecs, unsigned long lps)
#define udelay(usecs) __udelay((usecs),__udelay_val)
-extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
-{
- return (a*b)/c;
-}
-
#endif /* defined(__SPARC64_DELAY_H) */
-
diff --git a/include/asm-sparc64/ebus.h b/include/asm-sparc64/ebus.h
index 0fe16f474..4337c0193 100644
--- a/include/asm-sparc64/ebus.h
+++ b/include/asm-sparc64/ebus.h
@@ -1,4 +1,4 @@
-/* $Id: ebus.h,v 1.3 1997/09/05 23:00:14 ecd Exp $
+/* $Id: ebus.h,v 1.4 1998/01/10 18:26:08 ecd Exp $
* ebus.h: PCI to Ebus pseudo driver software state.
*
* Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
@@ -12,6 +12,7 @@
struct linux_ebus_child {
struct linux_ebus_child *next;
struct linux_ebus_device *parent;
+ struct linux_ebus *bus;
int prom_node;
char prom_name[64];
unsigned long base_address[PROMREG_MAX];
@@ -23,7 +24,7 @@ struct linux_ebus_child {
struct linux_ebus_device {
struct linux_ebus_device *next;
struct linux_ebus_child *children;
- struct linux_ebus *parent;
+ struct linux_ebus *bus;
int prom_node;
char prom_name[64];
unsigned long base_address[PROMREG_MAX];
diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h
index caf1c9434..a6891d681 100644
--- a/include/asm-sparc64/elf.h
+++ b/include/asm-sparc64/elf.h
@@ -1,4 +1,4 @@
-/* $Id: elf.h,v 1.8 1997/08/21 18:09:07 richard Exp $ */
+/* $Id: elf.h,v 1.13 1997/10/03 18:44:14 davem Exp $ */
#ifndef __ASM_SPARC64_ELF_H
#define __ASM_SPARC64_ELF_H
@@ -25,10 +25,6 @@ typedef unsigned long elf_fpregset_t;
#define ELF_DATA ELFDATA2MSB
#endif
-#ifndef ELF_FLAGS_INIT
-#define ELF_FLAGS_INIT current->tss.flags &= ~SPARC_FLAG_32BIT
-#endif
-
/*
* This is used to ensure we don't load something for the wrong architecture.
*/
@@ -45,7 +41,36 @@ typedef unsigned long elf_fpregset_t;
that it will "exec", and that there is sufficient room for the brk. */
#ifndef ELF_ET_DYN_BASE
-#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
+#define ELF_ET_DYN_BASE 0x50000000000
+#endif
+
+
+/* This yields a mask that user programs can use to figure out what
+ instruction set this cpu supports. */
+
+/* On Ultra, we support all of the v8 capabilities. */
+#define ELF_HWCAP (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \
+ HWCAP_SPARC_SWAP | HWCAP_SPARC_MULDIV)
+
+/* This yields a string that ld.so will use to load implementation
+ specific libraries for optimization. This is more specific in
+ intent than poking at uname or /proc/cpuinfo. */
+
+#define ELF_PLATFORM (NULL)
+
+#ifdef __KERNEL__
+#define SET_PERSONALITY(ex, ibcs2) \
+do { \
+ if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \
+ current->tss.flags |= SPARC_FLAG_32BIT; \
+ else \
+ current->tss.flags &= ~SPARC_FLAG_32BIT; \
+ \
+ if (ibcs2) \
+ current->personality = PER_SVR4; \
+ else if (current->personality != PER_LINUX32) \
+ current->personality = PER_LINUX; \
+} while (0)
#endif
#endif /* !(__ASM_SPARC64_ELF_H) */
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index 48d46a9f6..4ae034a33 100644
--- a/include/asm-sparc64/floppy.h
+++ b/include/asm-sparc64/floppy.h
@@ -1,4 +1,4 @@
-/* $Id: floppy.h,v 1.4 1997/09/05 23:00:15 ecd Exp $
+/* $Id: floppy.h,v 1.7 1997/09/07 03:34:08 davem Exp $
* asm-sparc64/floppy.h: Sparc specific parts of the Floppy driver.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -42,6 +42,7 @@ struct sun_flpy_controller {
/* You'll only ever find one controller on a SparcStation anyways. */
static struct sun_flpy_controller *sun_fdc = NULL;
volatile unsigned char *fdc_status;
+static struct linux_sbus_device *floppy_sdev = NULL;
struct sun_floppy_ops {
unsigned char (*fd_inb) (unsigned long port);
@@ -229,10 +230,25 @@ static int sun_fd_request_irq(void)
int error;
if(!once) {
+ struct devid_cookie dcookie;
+
once = 1;
- error = request_fast_irq(FLOPPY_IRQ, floppy_hardint, SA_INTERRUPT, "floppy");
+
+ dcookie.real_dev_id = NULL;
+ dcookie.imap = dcookie.iclr = 0;
+ dcookie.pil = -1;
+ dcookie.bus_cookie = floppy_sdev->my_bus;
+
+ error = request_fast_irq(FLOPPY_IRQ, floppy_hardint,
+ (SA_INTERRUPT | SA_SBUS | SA_DCOOKIE),
+ "floppy", &dcookie);
+
+ if(error == 0)
+ FLOPPY_IRQ = dcookie.ret_ino;
+
return ((error == 0) ? 0 : -1);
- } else return 0;
+ }
+ return 0;
}
static void sun_fd_enable_irq(void)
@@ -378,14 +394,16 @@ static unsigned long sun_floppy_init(void)
char state[128];
int fd_node, num_regs;
struct linux_sbus *bus;
- struct linux_sbus_device *sdev;
+ struct linux_sbus_device *sdev = NULL;
- FLOPPY_IRQ = 11;
for_all_sbusdev (sdev, bus) {
if (!strcmp(sdev->prom_name, "SUNW,fdtwo"))
break;
}
- if (!bus) {
+ if(sdev) {
+ floppy_sdev = sdev;
+ FLOPPY_IRQ = sdev->irqs[0].pri;
+ } else {
#ifdef CONFIG_PCI
struct linux_ebus *ebus;
struct linux_ebus_device *edev;
@@ -438,7 +456,8 @@ static unsigned long sun_floppy_init(void)
}
fd_node = sdev->prom_node;
prom_getproperty(fd_node, "status", state, sizeof(state));
- if(!strcmp(state, "disabled")) return -1;
+ if(!strncmp(state, "disabled", 8))
+ return -1;
num_regs = prom_getproperty(fd_node, "reg", (char *) fd_regs, sizeof(fd_regs));
num_regs = (num_regs / sizeof(fd_regs[0]));
prom_apply_sbus_ranges(sdev->my_bus, fd_regs, num_regs, sdev);
diff --git a/include/asm-sparc64/fpumacro.h b/include/asm-sparc64/fpumacro.h
index dab134472..91b9b81f8 100644
--- a/include/asm-sparc64/fpumacro.h
+++ b/include/asm-sparc64/fpumacro.h
@@ -7,6 +7,16 @@
#ifndef _SPARC64_FPUMACRO_H
#define _SPARC64_FPUMACRO_H
+#include <asm/asi.h>
+
+struct fpustate {
+ u32 regs[64];
+ u64 fsr;
+ u64 gsr;
+};
+
+#define FPUSTATE (struct fpustate *)(((unsigned long)current) + (((PAGE_SIZE<<1)-((64*4)+(2*8))) & ~(64 - 1)))
+
extern __inline__ unsigned long fprs_read(void)
{
unsigned long retval;
diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h
index e6d13f2de..3316c0c1d 100644
--- a/include/asm-sparc64/io.h
+++ b/include/asm-sparc64/io.h
@@ -1,4 +1,4 @@
-/* $Id: io.h,v 1.12 1997/08/19 03:11:52 davem Exp $ */
+/* $Id: io.h,v 1.14 1997/11/01 10:23:58 ecd Exp $ */
#ifndef __SPARC64_IO_H
#define __SPARC64_IO_H
@@ -91,21 +91,56 @@ extern void insw(unsigned long addr, void *dst, unsigned long count);
extern void insl(unsigned long addr, void *dst, unsigned long count);
/* Memory functions, same as I/O accesses on Ultra. */
-#define readb(addr) inb(addr)
-#define readw(addr) inw(addr)
-#define readl(addr) inl(addr)
-#define writeb(b, addr) outb((b), (addr))
-#define writew(w, addr) outw((w), (addr))
-#define writel(l, addr) outl((l), (addr))
+#define readb(addr) inb((unsigned long)addr)
+#define readw(addr) inw((unsigned long)addr)
+#define readl(addr) inl((unsigned long)addr)
+#define writeb(b, addr) outb((b), (unsigned long)(addr))
+#define writew(w, addr) outw((w), (unsigned long)(addr))
+#define writel(l, addr) outl((l), (unsigned long)(addr))
/* Memcpy to/from I/O space is just a regular memory operation on Ultra as well. */
+/*
+ * FIXME: Write faster routines using ASL_*L for this.
+ */
+static inline void *
+memset_io(void *dst, int c, __kernel_size_t n)
+{
+ char *d = dst;
+
+ while (n--)
+ *d++ = c;
+
+ return dst;
+}
+
+static inline void *
+memcpy_fromio(void *dst, const void *src, __kernel_size_t n)
+{
+ const char *s = src;
+ char *d = dst;
+
+ while (n--)
+ *d++ = *s++;
+
+ return dst;
+}
+
+static inline void *
+memcpy_toio(void *dst, const void *src, __kernel_size_t n)
+{
+ const char *s = src;
+ char *d = dst;
+
+ while (n--)
+ *d++ = *s++;
+
+ return dst;
+}
+
#if 0 /* XXX Not exactly, we need to use ASI_*L from/to the I/O end,
* XXX so these are disabled until we code that stuff.
*/
-#define memset_io(a,b,c) memset(((char *)(a)),(b),(c))
-#define memcpy_fromio(a,b,c) memcpy((a),((char *)(b)),(c))
-#define memcpy_toio(a,b,c) memcpy(((char *)(a)),(b),(c))
#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),((char *)(b)),(c),(d))
#endif
diff --git a/include/asm-sparc64/ioctls.h b/include/asm-sparc64/ioctls.h
index 56d74c356..c06f75ad0 100644
--- a/include/asm-sparc64/ioctls.h
+++ b/include/asm-sparc64/ioctls.h
@@ -1,4 +1,4 @@
-/* $Id: ioctls.h,v 1.5 1997/08/12 04:13:13 ecd Exp $ */
+/* $Id: ioctls.h,v 1.6 1997/12/16 19:20:58 davem Exp $ */
#ifndef _ASM_SPARC64_IOCTLS_H
#define _ASM_SPARC64_IOCTLS_H
@@ -76,6 +76,9 @@
#define TIOCGPGRP _IOR('t', 131, int)
#define TIOCSCTTY _IO('t', 132)
#define TIOCGSID _IOR('t', 133, int)
+/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */
+#define TIOCGPTN _IOR('t', 134, unsigned int) /* Get Pty Number */
+#define TIOCSPTLCK _IOW('t', 135, int) /* Lock/unlock PTY */
/* Little f */
#define FIOCLEX _IO('f', 1)
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
index 2f946fbab..1b36e2323 100644
--- a/include/asm-sparc64/irq.h
+++ b/include/asm-sparc64/irq.h
@@ -1,4 +1,4 @@
-/* $Id: irq.h,v 1.6 1997/08/07 08:06:40 davem Exp $
+/* $Id: irq.h,v 1.7 1997/09/07 02:56:44 davem Exp $
* irq.h: IRQ registers on the 64-bit Sparc.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -49,7 +49,8 @@ extern void set_irq_udt(int);
extern int request_fast_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
- unsigned long flags, __const__ char *devname);
+ unsigned long flags, __const__ char *devname,
+ void *dev_id);
extern __inline__ void set_softint(unsigned long bits)
{
diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h
index fe3055836..4b61cc432 100644
--- a/include/asm-sparc64/kdebug.h
+++ b/include/asm-sparc64/kdebug.h
@@ -1,4 +1,4 @@
-/* $Id: kdebug.h,v 1.2 1997/04/04 00:50:21 davem Exp $
+/* $Id: kdebug.h,v 1.3 1997/12/14 23:24:47 ecd Exp $
* kdebug.h: Defines and definitions for debugging the Linux kernel
* under various kernel debuggers.
*
@@ -74,8 +74,4 @@ extern __inline__ void sp_enter_debugger(void)
#define KDEBUG_DUNNO2_OFF 0x8
#define KDEBUG_TEACH_OFF 0xc
-/* ugh... */
-#define TRAP_TRACE(reg1, reg2) \
-
-
#endif /* !(_SPARC64_KDEBUG_H) */
diff --git a/include/asm-sparc64/keyboard.h b/include/asm-sparc64/keyboard.h
index dba75e0de..1bc97d597 100644
--- a/include/asm-sparc64/keyboard.h
+++ b/include/asm-sparc64/keyboard.h
@@ -1,4 +1,4 @@
-/* $Id: keyboard.h,v 1.1 1997/09/04 05:50:39 ecd Exp $
+/* $Id: keyboard.h,v 1.2 1997/09/07 15:40:49 ecd Exp $
* linux/include/asm-sparc64/keyboard.h
*
* Created Aug 29 1997 by Eddie C. Dost (ecd@skynet.be)
@@ -26,15 +26,23 @@ extern void pcikbd_leds(unsigned char leds);
extern void pcikbd_init_hw(void);
extern unsigned char pcikbd_sysrq_xlate[128];
-#define kbd_setkeycode pcikbd_setkeycode
-#define kbd_getkeycode pcikbd_getkeycode
-#define kbd_pretranslate pcikbd_pretranslate
-#define kbd_translate pcikbd_translate
-#define kbd_unexpected_up pcikbd_unexpected_up
-#define kbd_leds pcikbd_leds
-#define kbd_init_hw pcikbd_init_hw
-#define kbd_sysrq_xlate pcikbd_sysrq_xlate
-#define kbd_init pcikbd_init
+#define kbd_setkeycode pcikbd_setkeycode
+#define kbd_getkeycode pcikbd_getkeycode
+#define kbd_pretranslate pcikbd_pretranslate
+#define kbd_translate pcikbd_translate
+#define kbd_unexpected_up pcikbd_unexpected_up
+#define kbd_leds pcikbd_leds
+#define kbd_init_hw pcikbd_init_hw
+#define kbd_sysrq_xlate pcikbd_sysrq_xlate
+#define kbd_init pcikbd_init
+
+#define compute_shiftstate pci_compute_shiftstate
+#define keyboard_wait_for_keypress pci_wait_for_keypress
+#define getkeycode pci_getkeycode
+#define setkeycode pci_setkeycode
+#define getledstate pci_getledstate
+#define setledstate pci_setledstate
+#define register_leds pci_register_leds
#define SYSRQ_KEY 0x54
diff --git a/include/asm-sparc64/md.h b/include/asm-sparc64/md.h
new file mode 100644
index 000000000..03879934e
--- /dev/null
+++ b/include/asm-sparc64/md.h
@@ -0,0 +1,91 @@
+/* $Id: md.h,v 1.2 1997/12/27 16:28:38 jj Exp $
+ * md.h: High speed xor_block operation for RAID4/5
+ * utilizing the UltraSparc Visual Instruction Set.
+ *
+ * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
+ */
+
+#ifndef __ASM_MD_H
+#define __ASM_MD_H
+
+#include <asm/head.h>
+#include <asm/asi.h>
+
+#define HAVE_ARCH_XORBLOCK
+
+#define MD_XORBLOCK_ALIGNMENT 64
+
+/* void __xor_block (char *dest, char *src, long len)
+ * {
+ * while (len--) *dest++ ^= *src++;
+ * }
+ *
+ * Requirements:
+ * !(((long)dest | (long)src) & (MD_XORBLOCK_ALIGNMENT - 1)) &&
+ * !(len & 127) && len >= 256
+ */
+
+static inline void __xor_block (char *dest, char *src, long len)
+{
+ __asm__ __volatile__ ("
+ wr %%g0, %3, %%fprs
+ wr %%g0, %4, %%asi
+ membar #LoadStore|#StoreLoad|#StoreStore
+ sub %2, 128, %2
+ ldda [%0] %4, %%f0
+ ldda [%1] %4, %%f16
+1: ldda [%0 + 64] %%asi, %%f32
+ fxor %%f0, %%f16, %%f16
+ fxor %%f2, %%f18, %%f18
+ fxor %%f4, %%f20, %%f20
+ fxor %%f6, %%f22, %%f22
+ fxor %%f8, %%f24, %%f24
+ fxor %%f10, %%f26, %%f26
+ fxor %%f12, %%f28, %%f28
+ fxor %%f14, %%f30, %%f30
+ stda %%f16, [%0] %4
+ ldda [%1 + 64] %%asi, %%f48
+ ldda [%0 + 128] %%asi, %%f0
+ fxor %%f32, %%f48, %%f48
+ fxor %%f34, %%f50, %%f50
+ add %0, 128, %0
+ fxor %%f36, %%f52, %%f52
+ add %1, 128, %1
+ fxor %%f38, %%f54, %%f54
+ subcc %2, 128, %2
+ fxor %%f40, %%f56, %%f56
+ fxor %%f42, %%f58, %%f58
+ fxor %%f44, %%f60, %%f60
+ fxor %%f46, %%f62, %%f62
+ stda %%f48, [%0 - 64] %%asi
+ bne,pt %%xcc, 1b
+ ldda [%1] %4, %%f16
+ ldda [%0 + 64] %%asi, %%f32
+ fxor %%f0, %%f16, %%f16
+ fxor %%f2, %%f18, %%f18
+ fxor %%f4, %%f20, %%f20
+ fxor %%f6, %%f22, %%f22
+ fxor %%f8, %%f24, %%f24
+ fxor %%f10, %%f26, %%f26
+ fxor %%f12, %%f28, %%f28
+ fxor %%f14, %%f30, %%f30
+ stda %%f16, [%0] %4
+ ldda [%1 + 64] %%asi, %%f48
+ membar #Sync
+ fxor %%f32, %%f48, %%f48
+ fxor %%f34, %%f50, %%f50
+ fxor %%f36, %%f52, %%f52
+ fxor %%f38, %%f54, %%f54
+ fxor %%f40, %%f56, %%f56
+ fxor %%f42, %%f58, %%f58
+ fxor %%f44, %%f60, %%f60
+ fxor %%f46, %%f62, %%f62
+ stda %%f48, [%0 + 64] %%asi
+ membar #Sync|#StoreStore|#StoreLoad
+ wr %%g0, 0, %%fprs
+ " : :
+ "r" (dest), "r" (src), "r" (len), "i" (FPRS_FEF), "i" (ASI_BLK_P) :
+ "cc", "memory");
+}
+
+#endif /* __ASM_MD_H */
diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h
index 53745626e..b92481dd5 100644
--- a/include/asm-sparc64/mmu_context.h
+++ b/include/asm-sparc64/mmu_context.h
@@ -1,4 +1,4 @@
-/* $Id: mmu_context.h,v 1.19 1997/08/07 02:54:08 davem Exp $ */
+/* $Id: mmu_context.h,v 1.20 1997/09/18 10:42:08 rth Exp $ */
#ifndef __SPARC64_MMU_CONTEXT_H
#define __SPARC64_MMU_CONTEXT_H
@@ -54,7 +54,8 @@ extern __inline__ void get_mmu_context(struct task_struct *tsk)
get_new_mmu_context(mm, &tlb_context_cache);
/* Don't worry, set_fs() will restore it... */
- tsk->tss.ctx = (tsk->tss.current_ds ?
+ /* Sigh, damned include loops... just poke seg directly. */
+ tsk->tss.ctx = (tsk->tss.current_ds.seg ?
(mm->context & 0x1fff) : 0);
} else
tsk->tss.ctx = 0;
diff --git a/include/asm-sparc64/namei.h b/include/asm-sparc64/namei.h
index 70d0f337f..453f73217 100644
--- a/include/asm-sparc64/namei.h
+++ b/include/asm-sparc64/namei.h
@@ -1,4 +1,4 @@
-/* $Id: namei.h,v 1.8 1997/09/06 02:25:27 davem Exp $
+/* $Id: namei.h,v 1.10 1997/09/24 16:20:41 jj Exp $
* linux/include/asm-sparc64/namei.h
*
* Routines to handle famous /usr/gnemul/s*.
@@ -10,40 +10,55 @@
#define SPARC_BSD_EMUL "usr/gnemul/sunos/"
#define SPARC_SOL_EMUL "usr/gnemul/solaris/"
+#define SPARC_LIN_EMUL "usr/gnemul/linux32/"
static inline struct dentry *
__sparc64_lookup_dentry(const char *name, int follow_link)
{
struct dentry *base;
+ char *emul;
switch (current->personality) {
case PER_BSD:
+ emul = SPARC_BSD_EMUL; break;
case PER_SVR4:
- break;
+ emul = SPARC_SOL_EMUL; break;
+ case PER_LINUX32:
+ emul = SPARC_LIN_EMUL; break;
default:
- return ERR_PTR(-ENOENT);
+ return NULL;
}
- base = lookup_dentry ((current->personality == PER_BSD) ?
- SPARC_BSD_EMUL : SPARC_SOL_EMUL,
- dget (current->fs->root), 1);
+ base = lookup_dentry (emul, dget (current->fs->root), 1);
- if (IS_ERR (base)) return base;
+ if (IS_ERR (base)) return NULL;
base = lookup_dentry (name, base, follow_link);
- if (IS_ERR (base)) return base;
+ if (IS_ERR (base)) return NULL;
if (!base->d_inode) {
- dput(base);
- return ERR_PTR(-ENOENT);
+ struct dentry *fromroot;
+
+ fromroot = lookup_dentry (name, dget (current->fs->root), follow_link);
+
+ if (IS_ERR (fromroot)) return base;
+
+ if (fromroot->d_inode) {
+ dput(base);
+ return fromroot;
+ }
+
+ dput(fromroot);
}
return base;
}
#define __prefix_lookup_dentry(name, follow_link) \
- dentry = __sparc64_lookup_dentry (name, follow_link); \
- if (!IS_ERR (dentry)) return dentry;
+ if (current->personality) { \
+ dentry = __sparc64_lookup_dentry (name, follow_link); \
+ if (dentry) return dentry; \
+ }
#endif /* __SPARC64_NAMEI_H */
diff --git a/include/asm-sparc64/ns87303.h b/include/asm-sparc64/ns87303.h
new file mode 100644
index 000000000..92b3d689c
--- /dev/null
+++ b/include/asm-sparc64/ns87303.h
@@ -0,0 +1,84 @@
+/* $Id: ns87303.h,v 1.1 1997/10/14 13:30:37 ecd Exp $
+ * ns87303.h: Configuration Register Description for the
+ * National Semiconductor PC87303 (SuperIO).
+ *
+ * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
+ */
+
+#ifndef _SPARC_NS87303_H
+#define _SPARC_NS87303_H 1
+
+/*
+ * Controll Register Index Values
+ */
+#define FER 0x00
+#define FAR 0x01
+#define PTR 0x02
+#define FCR 0x03
+#define PCR 0x04
+#define KRR 0x05
+#define PMC 0x06
+#define TUP 0x07
+#define SID 0x08
+#define ASC 0x09
+#define CS0CF0 0x0a
+#define CS0CF1 0x0b
+#define CS1CF0 0x0c
+#define CS1CF1 0x0d
+
+/* Function Address Register (FAR) bits */
+#define FAR_LPT_MASK 0x03
+#define FAR_LPTB 0x00
+#define FAR_LPTA 0x01
+#define FAR_LPTC 0x02
+
+/* Power and Test Register (PTR) bits */
+#define PTR_LPTB_IRQ7 0x08
+#define PTR_LEVEL_IRQ 0x80 /* When not ECP/EPP: Use level IRQ */
+#define PTR_LPT_REG_DIR 0x80 /* When ECP/EPP: LPT CTR controlls direction */
+ /* of the parallel port */
+
+/* Function Control Register (FCR) bits */
+#define FCR_ZWS_ENA 0x20 /* Enable short host read/write in ECP/EPP */
+
+/* Printer Controll Register (PCR) bits */
+#define PCR_EPP_ENABLE 0x01
+#define PCR_EPP_IEEE 0x02 /* Enable EPP Version 1.9 (IEEE 1284) */
+#define PCR_ECP_ENABLE 0x04
+#define PCR_ECP_CLK_ENA 0x08 /* If 0 ECP Clock is stopped on Power down */
+#define PCR_IRQ_POLAR 0x20 /* If 0 IRQ is level high or negative pulse, */
+ /* if 1 polarity is inverted */
+#define PCR_IRQ_ODRAIN 0x40 /* If 1, IRQ is open drain */
+
+/* Tape UARTs and Parallel Port Config Register (TUP) bits */
+#define TUP_EPP_TIMO 0x02 /* Enable EPP timeout IRQ */
+
+/* Advanced SuperIO Config Register (ASC) bits */
+#define ASC_LPT_IRQ7 0x01 /* Allways use IRQ7 for LPT */
+
+#ifdef __KERNEL__
+
+#include <asm/system.h>
+#include <asm/io.h>
+
+static __inline__ void ns87303_writeb(unsigned long port, int index,
+ unsigned char value)
+{
+ unsigned long flags;
+
+ save_flags(flags); cli();
+ outb(index, port);
+ outb(value, port + 1);
+ outb(value, port + 1);
+ restore_flags(flags);
+}
+
+static __inline__ unsigned char ns87303_readb(unsigned long port, int index)
+{
+ outb(index, port);
+ return inb(port + 1);
+}
+
+#endif /* __KERNEL__ */
+
+#endif /* !(_SPARC_NS87303_H) */
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h
index a4e8e5a8f..70b787ced 100644
--- a/include/asm-sparc64/page.h
+++ b/include/asm-sparc64/page.h
@@ -1,12 +1,9 @@
-/* $Id: page.h,v 1.15 1997/08/09 04:56:54 davem Exp $ */
+/* $Id: page.h,v 1.16 1997/11/28 15:59:34 jj Exp $ */
#ifndef _SPARC64_PAGE_H
#define _SPARC64_PAGE_H
#define PAGE_SHIFT 13
-
-#ifdef __KERNEL__
-
#ifndef __ASSEMBLY__
/* I have my suspicions... -DaveM */
#define PAGE_SIZE (1UL << PAGE_SHIFT)
@@ -16,6 +13,8 @@
#define PAGE_MASK (~(PAGE_SIZE-1))
+#ifdef __KERNEL__
+
#ifndef __ASSEMBLY__
#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h
index fec37e16e..0c09bd338 100644
--- a/include/asm-sparc64/pbm.h
+++ b/include/asm-sparc64/pbm.h
@@ -1,4 +1,4 @@
-/* $Id: pbm.h,v 1.7 1997/08/25 06:01:14 davem Exp $
+/* $Id: pbm.h,v 1.8 1998/01/10 18:26:10 ecd Exp $
* pbm.h: U2P PCI bus module pseudo driver software state.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -53,6 +53,7 @@ struct linux_psycho {
unsigned long *pci_IO_space;
unsigned long *pci_mem_space;
u32 upa_portid;
+ int index;
struct linux_pbm_info pbm_A;
struct linux_pbm_info pbm_B;
};
@@ -67,6 +68,16 @@ struct pcidev_cookie {
};
extern struct linux_psycho *psycho_root;
+extern struct linux_psycho **psycho_index_map;
+extern int linux_num_psycho;
+
+static __inline__ struct linux_psycho *
+psycho_by_index(int index)
+{
+ if (index >= linux_num_psycho)
+ return NULL;
+ return psycho_index_map[index];
+}
/* Special PCI IRQ encoding, this just makes life easier for the generic
* irq registry layer, there is already enough crap in there due to sbus,
@@ -75,8 +86,8 @@ extern struct linux_psycho *psycho_root;
#define PCI_IRQ_IDENT 0x80000000 /* This tells irq.c what we are */
#define PCI_IRQ_IMAP_OFF 0x7ff00000 /* Offset from first PSYCHO imap */
#define PCI_IRQ_IMAP_OFF_SHFT 20
-#define PCI_IRQ_BUSNO 0x000f8000 /* PSYCHO instance, currently unused */
-#define PCI_IRQ_BUSNO_SHFT 15
+#define PCI_IRQ_BUSNO 0x000fc000 /* PSYCHO instance, currently unused */
+#define PCI_IRQ_BUSNO_SHFT 14
#define PCI_IRQ_IGN 0x000007c0 /* PSYCHO "Int Group Number" */
#define PCI_IRQ_INO 0x0000003f /* PSYCHO INO */
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index d58977981..c84571752 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.57 1997/08/13 04:44:20 paulus Exp $
+/* $Id: pgtable.h,v 1.59 1997/10/12 06:20:43 davem Exp $
* pgtable.h: SpitFire page table operations.
*
* Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu)
@@ -198,7 +198,7 @@ extern __inline__ void flush_tlb_page(struct vm_area_struct *vma, unsigned long
struct mm_struct *mm = vma->vm_mm;
if(mm->context != NO_CONTEXT)
- __flush_tlb_page(mm->context & 0x1fff, page & PAGE_MASK);
+ __flush_tlb_page(mm->context & 0x1fff, page);
}
#else /* __SMP__ */
@@ -231,7 +231,7 @@ extern __inline__ void flush_tlb_page(struct vm_area_struct *vma, unsigned long
struct mm_struct *mm = vma->vm_mm;
if(mm->context != NO_CONTEXT)
- smp_flush_tlb_page(mm, page & PAGE_MASK);
+ smp_flush_tlb_page(mm, page);
}
#endif
@@ -499,7 +499,36 @@ extern void mmu_release_scsi_sgl(struct mmu_sglist *sg, int sz, struct linux_sbu
/* These do nothing with the way I have things setup. */
#define mmu_lockarea(vaddr, len) (vaddr)
#define mmu_unlockarea(vaddr, len) do { } while(0)
-#define update_mmu_cache(vma, address, pte) do { } while(0)
+
+extern __inline__ void update_mmu_cache(struct vm_area_struct *vma,
+ unsigned long address, pte_t pte)
+{
+ struct mm_struct *mm = vma->vm_mm;
+ unsigned long ctx = mm->context & 0x1fff;
+ unsigned long tag_access;
+
+ tag_access = address | ctx;
+
+ __asm__ __volatile__("
+ rdpr %%pstate, %%g1
+ wrpr %%g1, %0, %%pstate
+ brz,pt %1, 1f
+ mov %2, %%g2
+ stxa %3, [%%g2] %5
+ b,pt %%xcc, 2f
+ stxa %4, [%%g0] %6
+1:
+ stxa %3, [%%g2] %7
+ stxa %4, [%%g0] %8
+2:
+ wrpr %%g1, 0x0, %%pstate
+" : /* no outputs */
+ : "i" (PSTATE_IE), "r" (vma->vm_flags & VM_EXEC),
+ "i" (TLB_TAG_ACCESS), "r" (tag_access), "r" (pte_val(pte)),
+ "i" (ASI_IMMU), "i" (ASI_ITLB_DATA_IN),
+ "i" (ASI_DMMU), "i" (ASI_DTLB_DATA_IN)
+ : "g1", "g2");
+}
/* Make a non-present pseudo-TTE. */
extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
diff --git a/include/asm-sparc64/posix_types.h b/include/asm-sparc64/posix_types.h
index 0c0e25a77..dd09cb516 100644
--- a/include/asm-sparc64/posix_types.h
+++ b/include/asm-sparc64/posix_types.h
@@ -18,7 +18,7 @@ typedef int __kernel_ipc_pid_t;
typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;
typedef unsigned int __kernel_dev_t;
-typedef unsigned int __kernel_ino_t;
+typedef unsigned long __kernel_ino_t;
typedef unsigned int __kernel_mode_t;
typedef unsigned short __kernel_umode_t;
typedef unsigned int __kernel_nlink_t;
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h
index b47f75b7f..ba2ab11b0 100644
--- a/include/asm-sparc64/processor.h
+++ b/include/asm-sparc64/processor.h
@@ -1,4 +1,4 @@
-/* $Id: processor.h,v 1.33 1997/08/19 14:18:36 jj Exp $
+/* $Id: processor.h,v 1.40 1997/10/24 11:57:59 jj Exp $
* include/asm-sparc64/processor.h
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -7,6 +7,7 @@
#ifndef __ASM_SPARC64_PROCESSOR_H
#define __ASM_SPARC64_PROCESSOR_H
+#include <asm/asi.h>
#include <asm/a.out.h>
#include <asm/pstate.h>
#include <asm/ptrace.h>
@@ -26,23 +27,42 @@
/* User lives in his very own context, and cannot reference us. */
#define TASK_SIZE ((1UL << (PAGE_SHIFT - 3)) * PGDIR_SIZE)
+#define COPY_TASK_STRUCT(dst, src) \
+do { \
+ if (src->tss.w_saved) \
+ *dst = *src; \
+ else { \
+ memcpy (dst, src, ((const unsigned long)(&((struct task_struct *)0)->tss.reg_window))); \
+ memcpy ((char *)dst + ((const unsigned long)(&((struct task_struct *)0)->tss.sig_address)), \
+ (char *)src + ((const unsigned long)(&((struct task_struct *)0)->tss.sig_address)), \
+ sizeof(struct task_struct) - \
+ ((const unsigned long)(&((struct task_struct *)0)->tss.sig_address))); \
+ } \
+} while (0)
+
#ifndef __ASSEMBLY__
#define NSWINS 8
+typedef struct {
+ unsigned long seg;
+} mm_segment_t;
+
/* The Sparc processor specific thread struct. */
struct thread_struct {
/*DC1*/ unsigned long ksp __attribute__ ((aligned(16)));
- unsigned long kpc;
-/*DC2*/ unsigned long wstate;
- unsigned int cwp;
- unsigned int ctx;
+ unsigned int kpc;
+ unsigned short wstate;
+ unsigned short cwp;
-/*DC3*/ unsigned int flags;
- unsigned int new_signal;
- unsigned long current_ds;
-/*DC4*/ unsigned long w_saved;
- struct pt_regs *kregs;
+/*DC2*/ unsigned short flags;
+ unsigned short ctx;
+ unsigned short w_saved;
+ unsigned short new_signal;
+ mm_segment_t current_ds;
+
+/*DC3*/ struct pt_regs *kregs;
+ unsigned long *utraps;
struct reg_window reg_window[NSWINS] __attribute__ ((aligned (16)));
unsigned long rwbuf_stkptrs[NSWINS] __attribute__ ((aligned (8)));
@@ -50,7 +70,6 @@ struct thread_struct {
unsigned long sig_address __attribute__ ((aligned (8)));
unsigned long sig_desc;
struct sigstack sstk_info;
- struct exec core_exec; /* just what it says. */
};
#endif /* !(__ASSEMBLY__) */
@@ -66,19 +85,19 @@ struct thread_struct {
#define INIT_MMAP { &init_mm, 0xfffff80000000000, 0xfffff80001000000, \
PAGE_SHARED , VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap }
-#define INIT_TSS { \
-/* ksp, kpc, wstate, cwp, secctx */ \
- 0, 0, 0, 0, 0, \
-/* flags, new_signal, current_ds, */ \
- SPARC_FLAG_KTHREAD, 0, USER_DS, \
-/* w_saved, kregs, */ \
- 0, 0, \
-/* reg_window */ \
- { { { 0, }, { 0, } }, }, \
-/* rwbuf_stkptrs */ \
- { 0, 0, 0, 0, 0, 0, 0, 0, }, \
-/* sig_address, sig_desc, sstk_info, core_exec */ \
- 0, 0, { 0, 0, }, { 0, }, \
+#define INIT_TSS { \
+/* ksp, kpc, wstate, cwp */ \
+ 0, 0, 0, 0, \
+/* flags, ctx, w_saved, new_signal, current_ds, */ \
+ SPARC_FLAG_KTHREAD, 0, 0, 0, KERNEL_DS, \
+/* kregs, utraps, */ \
+ 0, 0, \
+/* reg_window */ \
+ { { { 0, }, { 0, } }, }, \
+/* rwbuf_stkptrs */ \
+ { 0, 0, 0, 0, 0, 0, 0, 0, }, \
+/* sig_address, sig_desc, sstk_info */ \
+ 0, 0, { 0, 0, }, \
}
#ifndef __ASSEMBLY__
@@ -89,15 +108,29 @@ extern __inline__ unsigned long thread_saved_pc(struct thread_struct *t)
return t->kpc;
}
+/* On Uniprocessor, even in RMO processes see TSO semantics */
+#ifdef __SMP__
+#define TSTATE_INITIAL_MM TSTATE_TSO
+#else
+#define TSTATE_INITIAL_MM TSTATE_RMO
+#endif
+
/* Do necessary setup to start up a newly executed thread. */
#define start_thread(regs, pc, sp) \
do { \
- regs->tstate = (regs->tstate & (TSTATE_CWP)) | (TSTATE_IE); \
+ regs->tstate = (regs->tstate & (TSTATE_CWP)) | (TSTATE_INITIAL_MM|TSTATE_IE) | (ASI_PNF << 24); \
regs->tpc = ((pc & (~3)) - 4); \
regs->tnpc = regs->tpc + 4; \
regs->y = 0; \
current->tss.flags &= ~SPARC_FLAG_32BIT; \
current->tss.wstate = (1 << 3); \
+ if (current->tss.utraps) { \
+ if (*(current->tss.utraps) < 2) \
+ kfree (current->tss.utraps); \
+ else \
+ (*(current->tss.utraps))--; \
+ current->tss.utraps = NULL; \
+ } \
__asm__ __volatile__( \
"stx %%g0, [%0 + %2 + 0x00]\n\t" \
"stx %%g0, [%0 + %2 + 0x08]\n\t" \
@@ -128,12 +161,19 @@ do { \
pc &= 0x00000000ffffffffUL; \
sp &= 0x00000000ffffffffUL; \
\
- regs->tstate = (regs->tstate & (TSTATE_CWP))|(TSTATE_IE|TSTATE_AM); \
+ regs->tstate = (regs->tstate & (TSTATE_CWP))|(TSTATE_INITIAL_MM|TSTATE_IE|TSTATE_AM); \
regs->tpc = ((pc & (~3)) - 4); \
regs->tnpc = regs->tpc + 4; \
regs->y = 0; \
current->tss.flags |= SPARC_FLAG_32BIT; \
current->tss.wstate = (2 << 3); \
+ if (current->tss.utraps) { \
+ if (*(current->tss.utraps) < 2) \
+ kfree (current->tss.utraps); \
+ else \
+ (*(current->tss.utraps))--; \
+ current->tss.utraps = NULL; \
+ } \
zero = 0; \
__asm__ __volatile__( \
"stx %%g0, [%0 + %2 + 0x00]\n\t" \
@@ -164,7 +204,7 @@ do { \
#ifdef __KERNEL__
/* Allocation and freeing of task_struct and kernel stack. */
-#define alloc_task_struct() ((struct task_struct *)__get_free_pages(GFP_KERNEL, 1, 0))
+#define alloc_task_struct() ((struct task_struct *)__get_free_pages(GFP_KERNEL, 1))
#define free_task_struct(tsk) free_pages((unsigned long)(tsk),1)
#define init_task (init_task_union.task)
diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h
index a4784d41e..39bb8203a 100644
--- a/include/asm-sparc64/ptrace.h
+++ b/include/asm-sparc64/ptrace.h
@@ -1,4 +1,4 @@
-/* $Id: ptrace.h,v 1.12 1997/06/24 16:30:35 davem Exp $ */
+/* $Id: ptrace.h,v 1.13 1997/09/17 17:27:51 davem Exp $ */
#ifndef _SPARC64_PTRACE_H
#define _SPARC64_PTRACE_H
@@ -114,7 +114,9 @@ extern void show_regs(struct pt_regs *);
#include <asm/asm_offsets.h>
#endif
+#ifdef __KERNEL__
#define STACK_BIAS 2047
+#endif
/* These are for pt_regs. */
#define PT_V9_G0 0x00
diff --git a/include/asm-sparc64/reg.h b/include/asm-sparc64/reg.h
index ea3fc6e9c..2aabb1f42 100644
--- a/include/asm-sparc64/reg.h
+++ b/include/asm-sparc64/reg.h
@@ -1,4 +1,4 @@
-/* $Id: reg.h,v 1.2 1997/06/24 23:19:55 davem Exp $
+/* $Id: reg.h,v 1.4 1997/09/14 08:40:29 davem Exp $
* linux/asm-sparc64/reg.h
* Layout of the registers as expected by gdb on the Sparc
* we should replace the user.h definitions with those in
@@ -15,69 +15,7 @@
#define __SPARC64_REG_H
struct regs {
- int r_psr;
-#define r_ps r_psr
- int r_pc;
- int r_npc;
- int r_y;
- int r_g1;
- int r_g2;
- int r_g3;
- int r_g4;
- int r_g5;
- int r_g6;
- int r_g7;
- int r_o0;
- int r_o1;
- int r_o2;
- int r_o3;
- int r_o4;
- int r_o5;
- int r_o6;
- int r_o7;
-};
-
-struct fpq {
- unsigned int *addr;
- unsigned ing instr;
-};
-
-struct fq {
- union {
- double whole;
- struct fpq fpq;
- } FQu;
-};
-
-#define FPU_REGS_TYPE unsigned int
-#define FPU_FSR_TYPE unsigned
-
-struct fp_status {
- union {
- FPU_REGS_TYPE Fpu_regs[32];
- double Fpu_dregs[16];
- } fpu_fr;
- FPU_FSR_TYPE Fpu_fsr;
- unsigned Fpu_flags;
- unsigned Fpu_extra;
- unsigned Fpu_qcnt;
- struct fq Fpu_q[16];
-};
-
-#define fpu_regs f_fpstatus.fpu_fr.Fpu_regs
-#define fpu_dregs f_fpstatus.fpu_fr.Fpu_dregs
-#define fpu_fsr f_fpstatus.Fpu_fsr
-#define fpu_flags f_fpstatus.Fpu_flags
-#define fpu_extra f_fpstatus.Fpu_extra
-#define fpu_q f_fpstatus.Fpu_q
-#define fpu_qcnt f_fpstatus.Fpu_qcnt
-
-struct fpu {
- struct fp_status f_fpstatus;
-};
-
-struct regs64 {
- unsigned long r_g1;
+ unsigned long r_g1;
unsigned long r_g2;
unsigned long r_g3;
unsigned long r_g4;
@@ -92,17 +30,23 @@ struct regs64 {
unsigned long r_o5;
unsigned long r_o6;
unsigned long r_o7;
- unsigned long tstate;
- unsigned long tpc;
- unsigned long tnpc;
- unsigned int y;
- unsigned int fprs;
+ unsigned long __pad;
+ unsigned long r_tstate;
+ unsigned long r_tpc;
+ unsigned long r_tnpc;
+ unsigned int r_y;
+ unsigned int r_fprs;
};
-struct fp_status64 {
- unsigned long regs[32];
- unsigned long fsr;
+struct fp_status {
+ unsigned long fpu_fr[32];
+ unsigned long Fpu_fsr;
+};
+
+struct fpu {
+ struct fp_status f_fpstatus;
};
+#define fpu_regs f_fpstatus.fpu_fr
#endif /* __SPARC64_REG_H */
diff --git a/include/asm-sparc64/sigcontext.h b/include/asm-sparc64/sigcontext.h
index 8934cd9b1..102e73385 100644
--- a/include/asm-sparc64/sigcontext.h
+++ b/include/asm-sparc64/sigcontext.h
@@ -1,4 +1,4 @@
-/* $Id: sigcontext.h,v 1.9 1997/08/19 14:18:38 jj Exp $ */
+/* $Id: sigcontext.h,v 1.10 1997/12/11 15:16:11 jj Exp $ */
#ifndef __SPARC64_SIGCONTEXT_H
#define __SPARC64_SIGCONTEXT_H
@@ -67,7 +67,7 @@ typedef struct {
typedef struct {
struct pt_regs si_regs;
- int si_mask;
+ long si_mask;
} __siginfo_t;
typedef struct {
diff --git a/include/asm-sparc64/siginfo.h b/include/asm-sparc64/siginfo.h
new file mode 100644
index 000000000..cd0611f89
--- /dev/null
+++ b/include/asm-sparc64/siginfo.h
@@ -0,0 +1,277 @@
+#ifndef _SPARC64_SIGINFO_H
+#define _SPARC64_SIGINFO_H
+
+#include <linux/types.h>
+
+typedef union sigval {
+ int sival_int;
+ void *sival_ptr;
+} sigval_t;
+
+#ifdef __KERNEL__
+
+typedef union sigval32 {
+ int sival_int;
+ u32 sival_ptr;
+} sigval_t32;
+
+#endif /* __KERNEL__ */
+
+#define SI_MAX_SIZE 128
+#define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 4)
+#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct siginfo {
+ int si_signo;
+ int si_errno;
+ int si_code;
+
+ union {
+ int _pad[SI_PAD_SIZE];
+
+ /* kill() */
+ struct {
+ pid_t _pid; /* sender's pid */
+ uid_t _uid; /* sender's uid */
+ } _kill;
+
+ /* POSIX.1b timers */
+ struct {
+ unsigned int _timer1;
+ unsigned int _timer2;
+ } _timer;
+
+ /* POSIX.1b signals */
+ struct {
+ pid_t _pid; /* sender's pid */
+ uid_t _uid; /* sender's uid */
+ sigval_t _sigval;
+ } _rt;
+
+ /* SIGCHLD */
+ struct {
+ pid_t _pid; /* which child */
+ int _status; /* exit code */
+ clock_t _utime;
+ clock_t _stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+ struct {
+ void *_addr; /* faulting insn/memory ref. */
+ int _trapno; /* TRAP # which caused the signal */
+ } _sigfault;
+
+ /* SIGPOLL */
+ struct {
+ int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ int _fd;
+ } _sigpoll;
+ } _sifields;
+} siginfo_t;
+
+#ifdef __KERNEL__
+
+typedef struct siginfo32 {
+ int si_signo;
+ int si_errno;
+ int si_code;
+
+ union {
+ int _pad[SI_PAD_SIZE32];
+
+ /* kill() */
+ struct {
+ __kernel_pid_t32 _pid; /* sender's pid */
+ __kernel_uid_t32 _uid; /* sender's uid */
+ } _kill;
+
+ /* POSIX.1b timers */
+ struct {
+ unsigned int _timer1;
+ unsigned int _timer2;
+ } _timer;
+
+ /* POSIX.1b signals */
+ struct {
+ __kernel_pid_t32 _pid; /* sender's pid */
+ __kernel_uid_t32 _uid; /* sender's uid */
+ sigval_t32 _sigval;
+ } _rt;
+
+ /* SIGCHLD */
+ struct {
+ __kernel_pid_t32 _pid; /* which child */
+ int _status; /* exit code */
+ __kernel_clock_t32 _utime;
+ __kernel_clock_t32 _stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+ struct {
+ u32 _addr; /* faulting insn/memory ref. */
+ int _trapno;
+ } _sigfault;
+
+ /* SIGPOLL */
+ struct {
+ int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ int _fd;
+ } _sigpoll;
+ } _sifields;
+} siginfo_t32;
+
+#endif /* __KERNEL__ */
+
+/*
+ * How these fields are to be accessed.
+ */
+#define si_pid _sifields._kill._pid
+#define si_uid _sifields._kill._uid
+#define si_status _sifields._sigchld._status
+#define si_utime _sifields._sigchld._utime
+#define si_stime _sifields._sigchld._stime
+#define si_value _sifields._rt._sigval
+#define si_int _sifields._rt._sigval.sival_int
+#define si_ptr _sifields._rt._sigval.sival_ptr
+#define si_addr _sifields._sigfault._addr
+#define si_trapno _sifields._sigfault._trapno
+#define si_band _sifields._sigpoll._band
+#define si_fd _sifields._sigpoll._fd
+
+/*
+ * si_code values
+ * Digital reserves positive values for kernel-generated signals.
+ */
+#define SI_USER 0 /* sent by kill, sigsend, raise */
+#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
+#define SI_QUEUE -1 /* sent by sigqueue */
+#define SI_TIMER -2 /* sent by timer expiration */
+#define SI_MESGQ -3 /* sent by real time mesq state change */
+#define SI_ASYNCIO -4 /* sent by AIO completion */
+
+#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
+#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
+
+/*
+ * SIGILL si_codes
+ */
+#define ILL_ILLOPC 1 /* illegal opcode */
+#define ILL_ILLOPN 2 /* illegal operand */
+#define ILL_ILLADR 3 /* illegal addressing mode */
+#define ILL_ILLTRP 4 /* illegal trap */
+#define ILL_PRVOPC 5 /* privileged opcode */
+#define ILL_PRVREG 6 /* privileged register */
+#define ILL_COPROC 7 /* coprocessor error */
+#define ILL_BADSTK 8 /* internal stack error */
+#define NSIGILL 8
+
+/*
+ * SIGFPE si_codes
+ */
+#define FPE_INTDIV 1 /* integer divide by zero */
+#define FPE_INTOVF 2 /* integer overflow */
+#define FPE_FLTDIV 3 /* floating point divide by zero */
+#define FPE_FLTOVF 4 /* floating point overflow */
+#define FPE_FLTUND 5 /* floating point underflow */
+#define FPE_FLTRES 6 /* floating point inexact result */
+#define FPE_FLTINV 7 /* floating point invalid operation */
+#define FPE_FLTSUB 8 /* subscript out of range */
+#define NSIGFPE 8
+
+/*
+ * SIGSEGV si_codes
+ */
+#define SEGV_MAPERR 1 /* address not mapped to object */
+#define SRGV_ACCERR 2 /* invalid permissions for mapped object */
+#define NSIGSEGV 2
+
+/*
+ * SIGBUS si_codes
+ */
+#define BUS_ADRALN 1 /* invalid address alignment */
+#define BUS_ADRERR 2 /* non-existant physical address */
+#define BUS_OBJERR 3 /* object specific hardware error */
+#define NSIGBUS 3
+
+/*
+ * SIGTRAP si_codes
+ */
+#define TRAP_BRKPT 1 /* process breakpoint */
+#define TRAP_TRACE 2 /* process trace trap */
+#define NSIGTRAP
+
+/*
+ * SIGCHLD si_codes
+ */
+#define CLD_EXITED 1 /* child has exited */
+#define CLD_KILLED 2 /* child was killed */
+#define CLD_DUMPED 3 /* child terminated abnormally */
+#define CLD_TRAPPED 4 /* traced child has trapped */
+#define CLD_STOPPED 5 /* child has stopped */
+#define CLD_CONTINUED 6 /* stopped child has continued */
+#define NSIGCHLD
+
+/*
+ * SIGPOLL si_codes
+ */
+#define POLL_IN 1 /* data input available */
+#define POLL_OUT 2 /* output buffers available */
+#define POLL_MSG 3 /* input message available */
+#define POLL_ERR 4 /* i/o error */
+#define POLL_PRI 5 /* high priority input available */
+#define POLL_HUP 6 /* device disconnected */
+#define NSIGPOLL 6
+
+/*
+ * sigevent definitions
+ *
+ * It seems likely that SIGEV_THREAD will have to be handled from
+ * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
+ * thread manager then catches and does the appropriate nonsense.
+ * However, everything is written out here so as to not get lost.
+ */
+#define SIGEV_SIGNAL 0 /* notify via signal */
+#define SIGEV_NONE 1 /* other notification: meaningless */
+#define SIGEV_THREAD 2 /* deliver via thread creation */
+
+#define SIGEV_MAX_SIZE 64
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
+#define SIGEV_PAD_SIZE32 ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct sigevent {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ union {
+ int _pad[SIGEV_PAD_SIZE];
+
+ struct {
+ void (*_function)(sigval_t);
+ void *_attribute; /* really pthread_attr_t */
+ } _sigev_thread;
+ } _sigev_un;
+} sigevent_t;
+
+#ifdef __KERNEL__
+
+typedef struct sigevent32 {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ union {
+ int _pad[SIGEV_PAD_SIZE32];
+
+ struct {
+ u32 _function;
+ u32 _attribute; /* really pthread_attr_t */
+ } _sigev_thread;
+ } _sigev_un;
+} sigevent_t32;
+
+#endif /* __KERNEL__ */
+
+#define sigev_notify_function _sigev_un._sigev_thread._function
+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+#endif
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
index cd4503cc6..42382c42c 100644
--- a/include/asm-sparc64/signal.h
+++ b/include/asm-sparc64/signal.h
@@ -1,4 +1,4 @@
-/* $Id: signal.h,v 1.3 1997/04/18 14:34:47 jj Exp $ */
+/* $Id: signal.h,v 1.4 1997/12/11 15:16:06 jj Exp $ */
#ifndef _ASMSPARC64_SIGNAL_H
#define _ASMSPARC64_SIGNAL_H
@@ -7,15 +7,13 @@
#ifdef __KERNEL__
#ifndef __ASSEMBLY__
#include <linux/personality.h>
+#include <linux/types.h>
#endif
#endif
/* On the Sparc the signal handlers get passed a 'sub-signal' code
* for certain signal types, which we document here.
*/
-#define _NSIG 32
-#define NSIG _NSIG
-
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
@@ -80,14 +78,51 @@
#define SIGUSR1 30
#define SIGUSR2 31
+/* Most things should be clean enough to redefine this at will, if care
+ is taken to make libc match. */
+
+#define __OLD_NSIG 32
+#define __NEW_NSIG 64
+#define _NSIG_BPW 64
+#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
+
+#define _NSIG_BPW32 32
+#define _NSIG_WORDS32 (__NEW_NSIG / _NSIG_BPW32)
+
+#define SIGRTMIN 32
+#define SIGRTMAX (__NEW_NSIG - 1)
+
+#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
+#define _NSIG __NEW_NSIG
+#define __new_sigset_t sigset_t
+#define __new_sigset_t32 sigset_t32
+#define __new_sigaction sigaction
+#define __new_sigaction32 sigaction32
+#define __old_sigset_t old_sigset_t
+#define __old_sigset_t32 old_sigset_t32
+#define __old_sigaction old_sigaction
+#define __old_sigaction32 old_sigaction32
+#else
+#define _NSIG __OLD_NSIG
+#define NSIG _NSIG
+#define __old_sigset_t sigset_t
+#define __old_sigset_t32 sigset_t32
+#define __old_sigaction sigaction
+#define __old_sigaction32 sigaction32
+#endif
+
#ifndef __ASSEMBLY__
-typedef unsigned long sigset_t;
-typedef unsigned int sigset_t32;
+typedef unsigned long __old_sigset_t; /* at least 32 bits */
+typedef unsigned int __old_sigset_t32;
-#ifdef __KERNEL__
-#include <asm/sigcontext.h>
-#endif
+typedef struct {
+ unsigned long sig[_NSIG_WORDS];
+} __new_sigset_t;
+
+typedef struct {
+ unsigned int sig[_NSIG_WORDS32];
+} __new_sigset_t32;
/* A SunOS sigstack */
struct sigstack {
@@ -118,6 +153,9 @@ struct sigstack {
#define SA_INTERRUPT 0x10
#define SA_NOMASK 0x20
#define SA_SHIRQ 0x40
+#define SA_NOCLDWAIT 0x100 /* not supported yet */
+#define SA_SIGINFO 0x200
+
#define SIG_BLOCK 0x01 /* for blocking signals */
#define SIG_UNBLOCK 0x02 /* for unblocking signals */
@@ -156,20 +194,45 @@ typedef void (*__sighandler_t)(int);
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
-struct sigaction {
- __sighandler_t sa_handler;
- sigset_t sa_mask;
- unsigned long sa_flags;
- void (*sa_restorer) (void); /* not used by Linux/SPARC yet */
+struct __new_sigaction {
+ __sighandler_t sa_handler;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
+ __new_sigset_t sa_mask;
+};
+
+struct __new_sigaction32 {
+ unsigned sa_handler;
+ unsigned int sa_flags;
+ unsigned sa_restorer; /* not used by Linux/SPARC yet */
+ __new_sigset_t32 sa_mask;
+};
+
+struct k_sigaction {
+ struct __new_sigaction sa;
+ void *ka_restorer;
+};
+
+struct __old_sigaction {
+ __sighandler_t sa_handler;
+ __old_sigset_t sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
};
-struct sigaction32 {
- unsigned sa_handler;
- sigset_t32 sa_mask;
- unsigned int sa_flags;
- unsigned sa_restorer; /* not used by Linux/SPARC yet */
+struct __old_sigaction32 {
+ unsigned sa_handler;
+ __old_sigset_t32 sa_mask;
+ unsigned int sa_flags;
+ unsigned sa_restorer; /* not used by Linux/SPARC yet */
};
+typedef struct sigaltstack {
+ void *ss_sp;
+ int ss_flags;
+ __kernel_size_t ss_size;
+} stack_t;
+
#endif /* !(__ASSEMBLY__) */
#endif /* !(_ASMSPARC64_SIGNAL_H) */
diff --git a/include/asm-sparc64/socket.h b/include/asm-sparc64/socket.h
index c216fe6a7..3c110baeb 100644
--- a/include/asm-sparc64/socket.h
+++ b/include/asm-sparc64/socket.h
@@ -1,4 +1,4 @@
-/* $Id: socket.h,v 1.2 1997/03/17 04:50:55 davem Exp $ */
+/* $Id: socket.h,v 1.4 1997/10/19 00:19:23 davem Exp $ */
#ifndef _ASM_SOCKET_H
#define _ASM_SOCKET_H
@@ -35,9 +35,11 @@
#define SO_NO_CHECK 0x000b
#define SO_PRIORITY 0x000c
+#define SO_BINDTODEVICE 0x000d
+
/* Security levels - as per NRL IPv6 - don't actually do anything */
-#define SO_SECURITY_AUTHENTICATION 0x000d
-#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x000e
-#define SO_SECURITY_ENCRYPTION_NETWORK 0x000f
+#define SO_SECURITY_AUTHENTICATION 0x5001
+#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
+#define SO_SECURITY_ENCRYPTION_NETWORK 0x5004
#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-sparc64/string.h b/include/asm-sparc64/string.h
index 45b166c91..545e1285d 100644
--- a/include/asm-sparc64/string.h
+++ b/include/asm-sparc64/string.h
@@ -1,4 +1,4 @@
-/* $Id: string.h,v 1.7 1997/07/13 18:23:44 davem Exp $
+/* $Id: string.h,v 1.8 1997/11/19 07:57:50 jj Exp $
* string.h: External definitions for optimized assembly string
* routines for the Linux Kernel.
*
@@ -23,7 +23,7 @@ extern __kernel_size_t __memcpy_16plus(void *,const void *,__kernel_size_t,long,
extern __kernel_size_t __memcpy_384plus(void *,const void *,__kernel_size_t,long,long);
extern __kernel_size_t __memset(void *,int,__kernel_size_t);
-#ifndef EXPORT_SYMTAB
+#ifndef EXPORT_SYMTAB_STROPS
/* First the mem*() things. */
#define __HAVE_ARCH_BCOPY
@@ -192,7 +192,7 @@ extern inline int __constant_strncmp(const char *src, const char *dest, __kernel
__constant_strncmp(__arg0, __arg1, __arg2) : \
__strncmp(__arg0, __arg1, __arg2))
-#endif /* !EXPORT_SYMTAB */
+#endif /* !EXPORT_SYMTAB_STROPS */
#endif /* __KERNEL__ */
diff --git a/include/asm-sparc64/svr4.h b/include/asm-sparc64/svr4.h
index 5dcee9d3f..2e624a94b 100644
--- a/include/asm-sparc64/svr4.h
+++ b/include/asm-sparc64/svr4.h
@@ -70,7 +70,7 @@ typedef struct {
u32 ptr;
} svr4_xrs_t;
-/* Machine dependant context */
+/* Machine dependent context */
typedef struct {
svr4_gregset_t greg; /* registers 0..19 (see top) */
u32 gwin; /* may point to register windows */
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 9f29c06e6..a1dd29513 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -1,4 +1,4 @@
-/* $Id: system.h,v 1.36 1997/08/19 14:18:33 jj Exp $ */
+/* $Id: system.h,v 1.37 1997/10/20 00:14:22 davem Exp $ */
#ifndef __SPARC64_SYSTEM_H
#define __SPARC64_SYSTEM_H
@@ -154,17 +154,17 @@ do { __label__ switch_continue; \
"stx %%i7, [%%sp + 2047 + 0x78]\n\t" \
"rdpr %%wstate, %%o5\n\t" \
"stx %%o6, [%%g6 + %3]\n\t" \
- "stx %%o5, [%%g6 + %2]\n\t" \
+ "stw %%o7, [%%g6 + %4]\n\t" \
+ "sth %%o5, [%%g6 + %2]\n\t" \
"rdpr %%cwp, %%o5\n\t" \
- "stx %%o7, [%%g6 + %4]\n\t" \
- "st %%o5, [%%g6 + %5]\n\t" \
+ "sth %%o5, [%%g6 + %5]\n\t" \
"membar #Sync\n\t" \
"mov %0, %%g6\n\t" \
- "ld [%0 + %5], %%g1\n\t" \
+ "lduh [%0 + %5], %%g1\n\t" \
"wrpr %%g1, %%cwp\n\t" \
- "ldx [%%g6 + %2], %%o5\n\t" \
"ldx [%%g6 + %3], %%o6\n\t" \
- "ldx [%%g6 + %4], %%o7\n\t" \
+ "lduw [%%g6 + %4], %%o7\n\t" \
+ "lduh [%%g6 + %2], %%o5\n\t" \
"mov %%g6, %0\n\t" \
"wrpr %%o5, 0x0, %%wstate\n\t" \
"ldx [%%sp + 2047 + 0x70], %%i6\n\t" \
diff --git a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h
index bb0a56efd..10840dc57 100644
--- a/include/asm-sparc64/ttable.h
+++ b/include/asm-sparc64/ttable.h
@@ -1,8 +1,10 @@
-/* $Id: ttable.h,v 1.3 1997/08/29 15:52:35 jj Exp $ */
+/* $Id: ttable.h,v 1.5 1997/10/14 16:21:34 jj Exp $ */
#ifndef _SPARC64_TTABLE_H
#define _SPARC64_TTABLE_H
#include <linux/config.h>
+#include <asm/asm_offsets.h>
+#include <asm/utrap.h>
#define BOOT_KERNEL b sparc64_boot; nop; nop; nop; nop; nop; nop; nop;
@@ -97,9 +99,19 @@
ba,pt %xcc, tl0_solaris + 0xc; \
mov num, %g1; \
nop;nop;nop;
+
+#define TRAP_UTRAP(handler,lvl) \
+ ldx [%g6 + AOFF_task_tss + AOFF_thread_utraps], %g1; \
+ sethi %hi(109f), %g7; \
+ brz,pn %g1, utrap; \
+ or %g7, %lo(109f), %g7; \
+ ba,pt %xcc, utrap; \
+109: ldx [%g1 + handler*8], %g1; \
+ ba,pt %xcc, utrap_ill; \
+ mov lvl, %o1;
-#define SUNOS_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sunos_sys_table)
-#define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table32)
+#define SUNOS_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sunos_sys_table)
+#define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32)
#define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64)
#define GETCC_TRAP TRAP(getcc)
#define SETCC_TRAP TRAP(setcc)
diff --git a/include/asm-sparc64/types.h b/include/asm-sparc64/types.h
index cff47e3d0..e96909af4 100644
--- a/include/asm-sparc64/types.h
+++ b/include/asm-sparc64/types.h
@@ -1,4 +1,4 @@
-/* $Id: types.h,v 1.1 1996/11/20 12:03:51 davem Exp $ */
+/* $Id: types.h,v 1.2 1997/12/22 13:28:33 mj Exp $ */
#ifndef _SPARC64_TYPES_H
#define _SPARC64_TYPES_H
@@ -43,6 +43,8 @@ typedef unsigned int u32;
typedef __signed__ long s64;
typedef unsigned long u64;
+#define BITS_PER_LONG 64
+
#endif /* __KERNEL__ */
#endif /* defined(_SPARC64_TYPES_H) */
diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h
index 1d06cce7d..e2d59cf23 100644
--- a/include/asm-sparc64/uaccess.h
+++ b/include/asm-sparc64/uaccess.h
@@ -1,4 +1,4 @@
-/* $Id: uaccess.h,v 1.22 1997/08/19 15:25:35 jj Exp $ */
+/* $Id: uaccess.h,v 1.24 1997/12/15 15:05:14 jj Exp $ */
#ifndef _ASM_UACCESS_H
#define _ASM_UACCESS_H
@@ -17,13 +17,21 @@
#ifndef __ASSEMBLY__
-/* Sparc is not segmented, however we need to be able to fool verify_area()
- * when doing system calls from kernel mode legitimately.
+/*
+ * Sparc64 is segmented, though more like the M68K than the I386.
+ * We use the secondary ASI to address user memory, which references a
+ * completely different VM map, thus there is zero chance of the user
+ * doing something queer and tricking us into poking kernel memory.
+ *
+ * What is left here is basically what is needed for the other parts of
+ * the kernel that expect to be able to manipulate, erum, "segments".
+ * Or perhaps more properly, permissions.
*
* "For historical reasons, these macros are grossly misnamed." -Linus
*/
-#define KERNEL_DS 0x00
-#define USER_DS 0x2B /* har har har */
+
+#define KERNEL_DS ((mm_segment_t) { 0x00 })
+#define USER_DS ((mm_segment_t) { 0x2B }) /* har har har */
#define VERIFY_READ 0
#define VERIFY_WRITE 1
@@ -31,24 +39,29 @@
#define get_fs() (current->tss.current_ds)
#define get_ds() (KERNEL_DS)
+#define segment_eq(a,b) ((a).seg == (b).seg)
+
extern spinlock_t scheduler_lock;
-#define set_fs(val) \
-do { spin_lock(&scheduler_lock); \
- current->tss.current_ds = (val); \
- if ((val) == KERNEL_DS) { \
- flushw_user (); \
- current->tss.ctx = 0; \
- } else { \
- current->tss.ctx = (current->mm->context & 0x1fff); \
- } \
- spitfire_set_secondary_context(current->tss.ctx); \
- __asm__ __volatile__("flush %g6"); \
- spin_unlock(&scheduler_lock); \
+#define set_fs(val) \
+do { \
+ if (current->tss.current_ds.seg != val.seg) { \
+ spin_lock(&scheduler_lock); \
+ current->tss.current_ds = (val); \
+ if (segment_eq((val), KERNEL_DS)) { \
+ flushw_user (); \
+ current->tss.ctx = 0; \
+ } else { \
+ current->tss.ctx = (current->mm->context & 0x1fff); \
+ } \
+ spitfire_set_secondary_context(current->tss.ctx); \
+ __asm__ __volatile__("flush %g6"); \
+ spin_unlock(&scheduler_lock); \
+ } \
} while(0)
#define __user_ok(addr,size) 1
-#define __kernel_ok (get_fs() == KERNEL_DS)
+#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS))
#define __access_ok(addr,size) 1
#define access_ok(type,addr,size) 1
diff --git a/include/asm-sparc64/unaligned.h b/include/asm-sparc64/unaligned.h
index 4f1adb8c1..9418756d5 100644
--- a/include/asm-sparc64/unaligned.h
+++ b/include/asm-sparc64/unaligned.h
@@ -3,7 +3,7 @@
/* Sparc can't handle unaligned accesses. */
-#include <asm/string.h>
+#include <linux/string.h>
/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index f8b34f6a5..1983c79d9 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -1,4 +1,4 @@
-/* $Id: unistd.h,v 1.7 1997/06/16 05:37:44 davem Exp $ */
+/* $Id: unistd.h,v 1.14 1997/12/11 15:16:08 jj Exp $ */
#ifndef _SPARC64_UNISTD_H
#define _SPARC64_UNISTD_H
@@ -68,7 +68,7 @@
#define __NR_geteuid 49 /* SunOS calls getuid() */
#define __NR_getegid 50 /* SunOS calls getgid() */
#define __NR_acct 51 /* Common */
-/* #define __NR_ni_syscall 52 ENOSYS under SunOS */
+#define __NR_memory_ordering 52 /* Linux Specific */
#define __NR_mctl 53 /* SunOS specific */
#define __NR_ioctl 54 /* Common */
#define __NR_reboot 55 /* Common */
@@ -83,8 +83,8 @@
#define __NR_getpagesize 64 /* Common */
#define __NR_msync 65 /* Common in newer 1.3.x revs... */
/* #define __NR_ni_syscall 66 ENOSYS under SunOS */
-/* #define __NR_ni_syscall 67 ENOSYS under SunOS */
-/* #define __NR_ni_syscall 68 ENOSYS under SunOS */
+#define __NR_pread 67 /* Linux Specific */
+#define __NR_pwrite 68 /* Linux Specific */
#define __NR_sbrk 69 /* SunOS Specific */
#define __NR_sstk 70 /* SunOS Specific */
#define __NR_mmap 71 /* Common */
@@ -117,13 +117,13 @@
#define __NR_connect 98 /* Common */
#define __NR_accept 99 /* Common */
#define __NR_getpriority 100 /* Common */
-#define __NR_send 101 /* Common */
-#define __NR_recv 102 /* Common */
-/* #define __NR_ni_syscall 103 ENOSYS under SunOS */
-#define __NR_bind 104 /* Common */
-#define __NR_setsockopt 105 /* Common */
-#define __NR_listen 106 /* Common */
-/* #define __NR_ni_syscall 107 ENOSYS under SunOS */
+#define __NR_rt_sigreturn 101 /* Linux Specific */
+#define __NR_rt_sigaction 102 /* Linux Specific */
+#define __NR_rt_sigprocmask 103 /* Linux Specific */
+#define __NR_rt_sigpending 104 /* Linux Specific */
+#define __NR_rt_sigtimedwait 105 /* Linux Specific */
+#define __NR_rt_sigqueueinfo 106 /* Linux Specific */
+#define __NR_rt_sigsuspend 107 /* Linux Specific */
#define __NR_sigvec 108 /* SunOS Specific */
#define __NR_sigblock 109 /* SunOS Specific */
#define __NR_sigsetmask 110 /* SunOS Specific */
@@ -163,9 +163,9 @@
#define __NR_getrlimit 144 /* Common */
#define __NR_setrlimit 145 /* Common */
#define __NR_killpg 146 /* SunOS Specific */
-/* #define __NR_ni_syscall 147 ENOSYS under SunOS */
-/* #define __NR_ni_syscall 148 ENOSYS under SunOS */
-/* #define __NR_ni_syscall 149 ENOSYS under SunOS */
+#define __NR_prctl 147 /* ENOSYS under SunOS */
+#define __NR_pciconfig_read 148 /* ENOSYS under SunOS */
+#define __NR_pciconfig_write 149 /* ENOSYS under SunOS */
#define __NR_getsockname 150 /* Common */
#define __NR_getmsg 151 /* SunOS Specific */
#define __NR_putmsg 152 /* SunOS Specific */
@@ -180,7 +180,7 @@
#define __NR_getfh 161 /* SunOS Specific */
#define __NR_getdomainname 162 /* SunOS Specific */
#define __NR_setdomainname 163 /* Common */
-/* #define __NR_ni_syscall 164 ENOSYS under SunOS */
+#define __NR_utrap_install 164 /* SYSV ABI/v9 required */
#define __NR_quotactl 165 /* Common */
#define __NR_exportfs 166 /* SunOS Specific */
#define __NR_mount 167 /* Common */
@@ -200,7 +200,7 @@
#define __NR_aiowait 181 /* SunOS Specific */
#define __NR_aiocancel 182 /* SunOS Specific */
#define __NR_sigpending 183 /* Common */
-/* #define __NR_ni_syscall 184 ENOSYS under SunOS */
+#define __NR_query_module 184 /* Linux Specific */
#define __NR_setpgid 185 /* Common */
#define __NR_pathconf 186 /* SunOS Specific */
#define __NR_fpathconf 187 /* SunOS Specific */
@@ -272,14 +272,13 @@
#define __NR_fdatasync 253
#define __NR_nfsservctl 254
#define __NR_aplib 255
-#define __NR_prctl 256
#define _syscall0(type,name) \
type name(void) \
{ \
long __res; \
__asm__ __volatile__ ("mov %0, %%g1\n\t" \
- "t 0x11\n\t" \
+ "t 0x6d\n\t" \
"sub %%g0, %%o0, %0\n\t" \
"movcc %%xcc, %%o0, %0\n\t" \
: "=r" (__res)\
@@ -297,7 +296,7 @@ type name(type1 arg1) \
long __res; \
__asm__ __volatile__ ("mov %0, %%g1\n\t" \
"mov %1, %%o0\n\t" \
- "t 0x11\n\t" \
+ "t 0x6d\n\t" \
"sub %%g0, %%o0, %0\n\t" \
"movcc %%xcc, %%o0, %0\n\t" \
: "=r" (__res), "=r" ((long)(arg1)) \
@@ -316,7 +315,7 @@ long __res; \
__asm__ __volatile__ ("mov %0, %%g1\n\t" \
"mov %1, %%o0\n\t" \
"mov %2, %%o1\n\t" \
- "t 0x11\n\t" \
+ "t 0x6d\n\t" \
"sub %%g0, %%o0, %0\n\t" \
"movcc %%xcc, %%o0, %0\n\t" \
: "=r" (__res), "=r" ((long)(arg1)), "=r" ((long)(arg2)) \
@@ -336,7 +335,7 @@ __asm__ __volatile__ ("mov %0, %%g1\n\t" \
"mov %1, %%o0\n\t" \
"mov %2, %%o1\n\t" \
"mov %3, %%o2\n\t" \
- "t 0x11\n\t" \
+ "t 0x6d\n\t" \
"sub %%g0, %%o0, %0\n\t" \
"movcc %%xcc, %%o0, %0\n\t" \
: "=r" (__res), "=r" ((long)(arg1)), "=r" ((long)(arg2)), \
@@ -359,7 +358,7 @@ __asm__ __volatile__ ("mov %0, %%g1\n\t" \
"mov %2, %%o1\n\t" \
"mov %3, %%o2\n\t" \
"mov %4, %%o3\n\t" \
- "t 0x11\n\t" \
+ "t 0x6d\n\t" \
"sub %%g0,%%o0, %0\n\t" \
"movcc %%xcc, %%o0, %0\n\t" \
: "=r" (__res), "=r" ((long)(arg1)), "=r" ((long)(arg2)), \
@@ -385,7 +384,7 @@ __asm__ __volatile__ ("mov %1, %%o0\n\t" \
"mov %4, %%o3\n\t" \
"mov %5, %%o4\n\t" \
"mov %6, %%g1\n\t" \
- "t 0x11\n\t" \
+ "t 0x6d\n\t" \
"sub %%g0, %%o0, %0\n\t" \
"movcc %%xcc, %%o0, %0\n\t" \
: "=r" (__res) \
@@ -450,13 +449,13 @@ static __inline__ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned lo
"mov %1, %%g1\n\t"
"mov %2, %%o0\n\t" /* Clone flags. */
"mov 0, %%o1\n\t" /* usp arg == 0 */
- "t 0x11\n\t" /* Linux/Sparc clone(). */
+ "t 0x6d\n\t" /* Linux/Sparc clone(). */
"brz,a,pn %%o1, 1f\n\t" /* The parent, just return. */
" mov %%o0, %0\n\t"
"jmpl %%g2, %%o7\n\t" /* Call the function. */
" mov %%g3, %%o0\n\t" /* Get back the arg in delay. */
"mov %3, %%g1\n\t"
- "t 0x11\n\t" /* Linux/Sparc exit(). */
+ "t 0x6d\n\t" /* Linux/Sparc exit(). */
/* Notreached by child. */
"1:" :
"=r" (retval) :
diff --git a/include/asm-sparc64/utrap.h b/include/asm-sparc64/utrap.h
new file mode 100644
index 000000000..81b0ebf37
--- /dev/null
+++ b/include/asm-sparc64/utrap.h
@@ -0,0 +1,51 @@
+/* $Id: utrap.h,v 1.1 1997/10/14 16:21:31 jj Exp $
+ * include/asm-sparc64/utrap.h
+ *
+ * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
+ */
+
+#ifndef __ASM_SPARC64_UTRAP_H
+#define __ASM_SPARC64_UTRAP_H
+
+#define UT_INSTRUCTION_EXCEPTION 1
+#define UT_INSTRUCTION_ERROR 2
+#define UT_INSTRUCTION_PROTECTION 3
+#define UT_ILLTRAP_INSTRUCTION 4
+#define UT_ILLEGAL_INSTRUCTION 5
+#define UT_PRIVILEGED_OPCODE 6
+#define UT_FP_DISABLED 7
+#define UT_FP_EXCEPTION_IEEE_754 8
+#define UT_FP_EXCEPTION_OTHER 9
+#define UT_TAG_OVERVIEW 10
+#define UT_DIVISION_BY_ZERO 11
+#define UT_DATA_EXCEPTION 12
+#define UT_DATA_ERROR 13
+#define UT_DATA_PROTECTION 14
+#define UT_MEM_ADDRESS_NOT_ALIGNED 15
+#define UT_PRIVILEGED_ACTION 16
+#define UT_ASYNC_DATA_ERROR 17
+#define UT_TRAP_INSTRUCTION_16 18
+#define UT_TRAP_INSTRUCTION_17 19
+#define UT_TRAP_INSTRUCTION_18 20
+#define UT_TRAP_INSTRUCTION_19 21
+#define UT_TRAP_INSTRUCTION_20 22
+#define UT_TRAP_INSTRUCTION_21 23
+#define UT_TRAP_INSTRUCTION_22 24
+#define UT_TRAP_INSTRUCTION_23 25
+#define UT_TRAP_INSTRUCTION_24 26
+#define UT_TRAP_INSTRUCTION_25 27
+#define UT_TRAP_INSTRUCTION_26 28
+#define UT_TRAP_INSTRUCTION_27 29
+#define UT_TRAP_INSTRUCTION_28 30
+#define UT_TRAP_INSTRUCTION_29 31
+#define UT_TRAP_INSTRUCTION_30 32
+#define UT_TRAP_INSTRUCTION_31 33
+
+#define UTH_NOCHANGE (-1)
+
+#ifndef __ASSEMBLY__
+typedef int utrap_entry_t;
+typedef void *utrap_handler_t;
+#endif /* __ASSEMBLY__ */
+
+#endif /* !(__ASM_SPARC64_PROCESSOR_H) */
diff --git a/include/linux/adfs_fs.h b/include/linux/adfs_fs.h
new file mode 100644
index 000000000..453bb9258
--- /dev/null
+++ b/include/linux/adfs_fs.h
@@ -0,0 +1,183 @@
+#ifndef _ADFS_FS_H
+#define _ADFS_FS_H
+
+#include <linux/types.h>
+/*
+ * Structures of data on the disk
+ */
+
+/*
+ * Disc Record at disc address 0xc00
+ */
+struct adfs_discrecord {
+ unsigned char log2secsize;
+ unsigned char secspertrack;
+ unsigned char heads;
+ unsigned char density;
+ unsigned char idlen;
+ unsigned char log2bpmb;
+ unsigned char skew;
+ unsigned char bootoption;
+ unsigned char lowsector;
+ unsigned char nzones;
+ unsigned short zone_spare;
+ unsigned long root;
+ unsigned long disc_size;
+ unsigned short disc_id;
+ unsigned char disc_name[10];
+ unsigned long disc_type;
+ unsigned long disc_size_high;
+ unsigned char log2sharesize:4;
+ unsigned char unused:4;
+ unsigned char big_flag:1;
+};
+
+#define ADFS_DISCRECORD (0xc00)
+#define ADFS_DR_OFFSET (0x1c0)
+#define ADFS_DR_SIZE 60
+#define ADFS_SUPER_MAGIC 0xadf5
+#define ADFS_FREE_FRAG 0
+#define ADFS_BAD_FRAG 1
+#define ADFS_ROOT_FRAG 2
+
+/*
+ * Directory header
+ */
+struct adfs_dirheader {
+ unsigned char startmasseq;
+ unsigned char startname[4];
+};
+
+#define ADFS_NEWDIR_SIZE 2048
+#define ADFS_OLDDIR_SIZE 1024
+#define ADFS_NUM_DIR_ENTRIES 77
+
+/*
+ * Directory entries
+ */
+struct adfs_direntry {
+ char dirobname[10];
+#define ADFS_NAME_LEN 10
+ __u8 dirload[4];
+ __u8 direxec[4];
+ __u8 dirlen[4];
+ __u8 dirinddiscadd[3];
+ __u8 newdiratts;
+#define ADFS_NDA_OWNER_READ (1 << 0)
+#define ADFS_NDA_OWNER_WRITE (1 << 1)
+#define ADFS_NDA_LOCKED (1 << 2)
+#define ADFS_NDA_DIRECTORY (1 << 3)
+#define ADFS_NDA_EXECUTE (1 << 4)
+#define ADFS_NDA_PUBLIC_READ (1 << 5)
+#define ADFS_NDA_PUBLIC_WRITE (1 << 6)
+};
+
+#define ADFS_MAX_NAME_LEN 255
+struct adfs_idir_entry {
+ __u32 inode_no; /* Address */
+ __u32 file_id; /* file id */
+ __u32 name_len; /* name length */
+ __u32 size; /* size */
+ __u32 mtime; /* modification time */
+ __u32 filetype; /* RiscOS file type */
+ __u8 mode; /* internal mode */
+ char name[ADFS_MAX_NAME_LEN]; /* file name */
+};
+
+/*
+ * Directory tail
+ */
+union adfs_dirtail {
+ struct {
+ unsigned char dirlastmask;
+ char dirname[10];
+ unsigned char dirparent[3];
+ char dirtitle[19];
+ unsigned char reserved[14];
+ unsigned char endmasseq;
+ unsigned char endname[4];
+ unsigned char dircheckbyte;
+ } old;
+ struct {
+ unsigned char dirlastmask;
+ unsigned char reserved[2];
+ unsigned char dirparent[3];
+ char dirtitle[19];
+ char dirname[10];
+ unsigned char endmasseq;
+ unsigned char endname[4];
+ unsigned char dircheckbyte;
+ } new;
+};
+
+#ifdef __KERNEL__
+
+
+/*
+ * Calculate the boot block checksum on an ADFS drive. Note that this will
+ * 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)
+{
+ int i = 511;
+
+ int result = 0;
+
+ do {
+ result = (result & 0xff) + (result >> 8);
+ result = result + ptr[i];
+ i--;
+ }
+ while (i != 0);
+
+ result &= 0xff;
+ return result != ptr[511];
+ return 0;
+}
+
+/* dir.c */
+extern unsigned int adfs_val (unsigned char *p, int len);
+extern int adfs_dir_read_parent (struct inode *inode, struct buffer_head **bhp);
+extern int adfs_dir_read (struct inode *inode, struct buffer_head **bhp);
+extern int adfs_dir_check (struct inode *inode, struct buffer_head **bhp,
+ int buffers, union adfs_dirtail *dtp);
+extern void adfs_dir_free (struct buffer_head **bhp, int buffers);
+extern int adfs_dir_get (struct super_block *sb, struct buffer_head **bhp,
+ int buffers, int pos, unsigned long parent_object_id,
+ struct adfs_idir_entry *ide);
+extern int adfs_dir_find_entry (struct super_block *sb, struct buffer_head **bhp,
+ int buffers, unsigned int index,
+ struct adfs_idir_entry *ide);
+
+/* inode.c */
+extern int adfs_inode_validate (struct inode *inode);
+extern unsigned long adfs_inode_generate (unsigned long parent_id, int diridx);
+extern unsigned long adfs_inode_objid (struct inode *inode);
+extern unsigned int adfs_parent_bmap (struct inode *inode, int block);
+extern int adfs_bmap (struct inode *inode, int block);
+extern void adfs_read_inode (struct inode *inode);
+
+/* map.c */
+extern int adfs_map_lookup (struct super_block *sb, int frag_id, int offset);
+
+/* namei.c */
+extern int adfs_lookup (struct inode *dir, struct dentry *dentry);
+
+/* super.c */
+extern int init_adfs_fs (void);
+extern void adfs_error (struct super_block *, const char *, const char *, ...);
+
+/*
+ * Inodes and file operations
+ */
+
+/* dir.c */
+extern struct inode_operations adfs_dir_inode_operations;
+
+/* file.c */
+extern struct inode_operations adfs_file_inode_operations;
+#endif
+
+#endif
diff --git a/include/linux/adfs_fs_fs.h b/include/linux/adfs_fs_fs.h
new file mode 100644
index 000000000..7fff6be19
--- /dev/null
+++ b/include/linux/adfs_fs_fs.h
@@ -0,0 +1,177 @@
+#ifndef _ADFS_FS_H
+#define _ADFS_FS_H
+
+#include <linux/types.h>
+/*
+ * Structures of data on the disk
+ */
+
+/*
+ * Disc Record at disc address 0xc00
+ */
+struct adfs_discrecord {
+ unsigned char log2secsize;
+ unsigned char secspertrack;
+ unsigned char heads;
+ unsigned char density;
+ unsigned char idlen;
+ unsigned char log2bpmb;
+ unsigned char skew;
+ unsigned char bootoption;
+ unsigned char lowsector;
+ unsigned char nzones;
+ unsigned short zone_spare;
+ unsigned long root;
+ unsigned long disc_size;
+ unsigned short disc_id;
+ unsigned char disc_name[10];
+ unsigned long disc_type;
+ unsigned long disc_size_high;
+ unsigned char log2sharesize:4;
+ unsigned char unused:4;
+ unsigned char big_flag:1;
+};
+
+#define ADFS_DISCRECORD (0xc00)
+#define ADFS_DR_OFFSET (0x1c0)
+#define ADFS_DR_SIZE 60
+#define ADFS_SUPER_MAGIC 0xadf5
+#define ADFS_FREE_FRAG 0
+#define ADFS_BAD_FRAG 1
+#define ADFS_ROOT_FRAG 2
+
+/*
+ * Directory header
+ */
+struct adfs_dirheader {
+ unsigned char startmasseq;
+ unsigned char startname[4];
+};
+
+#define ADFS_NEWDIR_SIZE 2048
+#define ADFS_OLDDIR_SIZE 1024
+#define ADFS_NUM_DIR_ENTRIES 77
+
+/*
+ * Directory entries
+ */
+struct adfs_direntry {
+ char dirobname[10];
+#define ADFS_NAME_LEN 10
+ __u8 dirload[4];
+ __u8 direxec[4];
+ __u8 dirlen[4];
+ __u8 dirinddiscadd[3];
+ __u8 newdiratts;
+#define ADFS_NDA_OWNER_READ (1 << 0)
+#define ADFS_NDA_OWNER_WRITE (1 << 1)
+#define ADFS_NDA_LOCKED (1 << 2)
+#define ADFS_NDA_DIRECTORY (1 << 3)
+#define ADFS_NDA_EXECUTE (1 << 4)
+#define ADFS_NDA_PUBLIC_READ (1 << 5)
+#define ADFS_NDA_PUBLIC_WRITE (1 << 6)
+};
+
+#define ADFS_MAX_NAME_LEN 255
+struct adfs_idir_entry {
+ __u32 inode_no; /* Address */
+ __u32 file_id; /* file id */
+ __u32 name_len; /* name length */
+ __u32 size; /* size */
+ __u32 mtime; /* modification time */
+ __u32 filetype; /* RiscOS file type */
+ __u8 mode; /* internal mode */
+ char name[ADFS_MAX_NAME_LEN]; /* file name */
+};
+
+/*
+ * Directory tail
+ */
+union adfs_dirtail {
+ struct {
+ unsigned char dirlastmask;
+ char dirname[10];
+ unsigned char dirparent[3];
+ char dirtitle[19];
+ unsigned char reserved[14];
+ unsigned char endmasseq;
+ unsigned char endname[4];
+ unsigned char dircheckbyte;
+ } old;
+ struct {
+ unsigned char dirlastmask;
+ unsigned char reserved[2];
+ unsigned char dirparent[3];
+ char dirtitle[19];
+ char dirname[10];
+ unsigned char endmasseq;
+ unsigned char endname[4];
+ unsigned char dircheckbyte;
+ } new;
+};
+
+#ifdef __KERNEL__
+/*
+ * Calculate the boot block checksum on an ADFS drive. Note that this will
+ * 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)
+{
+ unsigned int result = 0;
+ unsigned char *p = ptr + 511;
+
+ do {
+ result = (result & 0xff) + (result >> 8);
+ result = result + *--p;
+ } while (p != ptr);
+
+ return (result & 0xff) != ptr[511];
+}
+
+/* dir.c */
+extern unsigned int adfs_val (unsigned char *p, int len);
+extern int adfs_dir_read_parent (struct inode *inode, struct buffer_head **bhp);
+extern int adfs_dir_read (struct inode *inode, struct buffer_head **bhp);
+extern int adfs_dir_check (struct inode *inode, struct buffer_head **bhp,
+ int buffers, union adfs_dirtail *dtp);
+extern void adfs_dir_free (struct buffer_head **bhp, int buffers);
+extern int adfs_dir_get (struct super_block *sb, struct buffer_head **bhp,
+ int buffers, int pos, unsigned long parent_object_id,
+ struct adfs_idir_entry *ide);
+extern int adfs_dir_find_entry (struct super_block *sb, struct buffer_head **bhp,
+ int buffers, unsigned int index,
+ struct adfs_idir_entry *ide);
+
+/* inode.c */
+extern int adfs_inode_validate (struct inode *inode);
+extern unsigned long adfs_inode_generate (unsigned long parent_id, int diridx);
+extern unsigned long adfs_inode_objid (struct inode *inode);
+extern unsigned int adfs_parent_bmap (struct inode *inode, int block);
+extern int adfs_bmap (struct inode *inode, int block);
+extern void adfs_read_inode (struct inode *inode);
+
+/* map.c */
+extern int adfs_map_lookup (struct super_block *sb, int frag_id, int offset);
+
+/* namei.c */
+extern int adfs_lookup (struct inode * dir, const char * name, int len,
+ struct inode ** result);
+
+/* super.c */
+extern int init_adfs_fs (void);
+extern void adfs_error (struct super_block *, const char *, const char *, ...);
+
+/*
+ * Inodes and file operations
+ */
+
+/* dir.c */
+extern struct inode_operations adfs_dir_inode_operations;
+
+/* file.c */
+extern struct inode_operations adfs_file_inode_operations;
+#endif
+
+#endif
+
diff --git a/include/linux/adfs_fs_i.h b/include/linux/adfs_fs_i.h
new file mode 100644
index 000000000..831575165
--- /dev/null
+++ b/include/linux/adfs_fs_i.h
@@ -0,0 +1,17 @@
+/*
+ * linux/include/linux/adfs_fs_i.h
+ *
+ * Copyright (C) 1997 Russell King
+ */
+
+#ifndef _ADFS_FS_I
+#define _ADFS_FS_I
+
+/*
+ * adfs file system inode data in memory
+ */
+struct adfs_inode_info {
+ unsigned long file_id; /* id of fragments containing actual data */
+};
+
+#endif
diff --git a/include/linux/adfs_fs_sb.h b/include/linux/adfs_fs_sb.h
new file mode 100644
index 000000000..527c29fb6
--- /dev/null
+++ b/include/linux/adfs_fs_sb.h
@@ -0,0 +1,29 @@
+/*
+ * linux/include/linux/adfs_fs_sb.h
+ *
+ * Copyright (C) 1997 Russell King
+ */
+
+#ifndef _ADFS_FS_SB
+#define _ADFS_FS_SB
+
+#include <linux/adfs_fs.h>
+
+/*
+ * adfs file system superblock data in memory
+ */
+struct adfs_sb_info {
+ struct buffer_head *s_sbh; /* buffer head containing disc record */
+ struct adfs_discrecord *s_dr; /* pointer to disc record in s_sbh */
+ __u16 s_zone_size; /* size of a map zone in bits */
+ __u16 s_ids_per_zone; /* max. no ids in one zone */
+ __u32 s_idlen; /* length of ID in map */
+ __u32 s_map_size; /* size of a map */
+ __u32 s_zonesize; /* zone size (in map bits) */
+ __u32 s_map_block; /* block address of map */
+ struct buffer_head **s_map; /* bh list containing map */
+ __u32 s_root; /* root disc address */
+ __s8 s_map2blk; /* shift left by this for map->sector */
+};
+
+#endif
diff --git a/include/linux/affs_fs.h b/include/linux/affs_fs.h
index ec637973d..79e3c3639 100644
--- a/include/linux/affs_fs.h
+++ b/include/linux/affs_fs.h
@@ -65,7 +65,7 @@ extern int affs_unlink(struct inode *dir, struct dentry *dentry);
extern int affs_create(struct inode *dir, struct dentry *dentry, int mode);
extern int affs_mkdir(struct inode *dir, struct dentry *dentry, int mode);
extern int affs_rmdir(struct inode *dir, struct dentry *dentry);
-extern int affs_link(struct inode *oldinode, struct inode *dir,
+extern int affs_link(struct dentry *olddentry, struct inode *dir,
struct dentry *dentry);
extern int affs_symlink(struct inode *dir, struct dentry *dentry,
const char *symname);
@@ -78,7 +78,7 @@ extern struct buffer_head *affs_bread(kdev_t dev, int block, int size);
extern void affs_brelse(struct buffer_head *buf);
extern unsigned long affs_parent_ino(struct inode *dir);
extern struct inode *affs_new_inode(const struct inode *dir);
-extern int affs_notify_change(struct inode *inode, struct iattr *attr);
+extern int affs_notify_change(struct dentry *dentry, struct iattr *attr);
extern int affs_add_entry(struct inode *dir, struct inode *link,
struct inode *inode, struct dentry *dentry, s32 type);
extern void affs_put_inode(struct inode *inode);
@@ -89,6 +89,7 @@ extern void affs_write_inode(struct inode *inode);
/* super.c */
extern int affs_fs(void);
+extern int init_affs_fs(void);
/* file.c */
@@ -107,4 +108,7 @@ extern struct inode_operations affs_symlink_inode_operations;
extern struct inode_operations affs_chrdev_inode_operations;
extern struct inode_operations affs_blkdev_inode_operations;
+extern struct dentry_operations affs_dentry_operations;
+extern struct dentry_operations affs_dentry_operations_intl;
+
#endif
diff --git a/include/linux/affs_fs_sb.h b/include/linux/affs_fs_sb.h
index 7ab261209..a066aee71 100644
--- a/include/linux/affs_fs_sb.h
+++ b/include/linux/affs_fs_sb.h
@@ -37,6 +37,7 @@ struct affs_zone {
struct affs_sb_info {
int s_partition_size; /* Partition size in blocks. */
+ int s_blksize; /* Initial device blksize */
s32 s_root_block; /* FFS root block number. */
int s_hashsize; /* Size of hash table. */
unsigned long s_flags; /* See below. */
diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h
index 326445110..f0b7a5793 100644
--- a/include/linux/apm_bios.h
+++ b/include/linux/apm_bios.h
@@ -19,13 +19,12 @@
*/
typedef unsigned short apm_event_t;
+typedef unsigned short apm_eventinfo_t;
#ifdef __KERNEL__
-#include <linux/tasks.h> /* for NR_TASKS */
-#include <linux/sched.h> /* for _TSS */
-
-#define APM_CS _TSS(NR_TASKS)
+#define APM_40 0x40
+#define APM_CS (APM_40 + 8)
#define APM_CS_16 (APM_CS + 8)
#define APM_DS (APM_CS_16 + 8)
@@ -37,6 +36,7 @@ struct apm_bios_info {
unsigned short dseg;
unsigned short flags;
unsigned short cseg_len;
+ unsigned short cseg_16_len;
unsigned short dseg_len;
};
@@ -113,6 +113,7 @@ extern int apm_display_unblank(void);
#define APM_USER_STANDBY 0x0009
#define APM_USER_SUSPEND 0x000a
#define APM_STANDBY_RESUME 0x000b
+#define APM_CAPABILITY_CHANGE 0x000c
/*
* Error codes
@@ -128,6 +129,8 @@ extern int apm_display_unblank(void);
#define APM_BAD_DEVICE 0x09
#define APM_BAD_PARAM 0x0a
#define APM_NOT_ENGAGED 0x0b
+#define APM_BAD_FUNCTION 0x0c
+#define APM_RESUME_DISABLED 0x0d
#define APM_BAD_STATE 0x60
#define APM_NO_EVENTS 0x80
#define APM_NOT_PRESENT 0x86
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index 843c0ad8c..dc427588b 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -5,7 +5,7 @@
*
* Definitions for the ARCnet handlers.
*
- * Version: $Id: arcdevice.h,v 1.2 1997/09/05 08:57:56 mj Exp $
+ * Version: $Id: arcdevice.h,v 1.3 1997/11/09 11:05:05 mj Exp $
*
* Authors: Avery Pennarun <apenwarr@bond.net>
* David Woodhouse <dwmw2@cam.ac.uk>
@@ -74,7 +74,7 @@
/* Display warnings about the driver being an ALPHA version.
*/
-#define ALPHA_WARNING
+#undef ALPHA_WARNING
/* New debugging bitflags: each option can be enabled individually.
diff --git a/include/linux/baycom.h b/include/linux/baycom.h
index 9754f9384..81249e029 100644
--- a/include/linux/baycom.h
+++ b/include/linux/baycom.h
@@ -1,15 +1,12 @@
/*
* The Linux BAYCOM driver for the Baycom serial 1200 baud modem
* and the parallel 9600 baud modem
- * (C) 1997 by Thomas Sailer, HB9JNX/AE4WA
+ * (C) 1997-1998 by Thomas Sailer, HB9JNX/AE4WA
*/
#ifndef _BAYCOM_H
#define _BAYCOM_H
-#include <linux/sockios.h>
-#include <linux/if_ether.h>
-
/* -------------------------------------------------------------------- */
/*
* structs for the IOCTL commands
diff --git a/include/linux/blk.h b/include/linux/blk.h
index 8893b170a..ec19b0cdd 100644
--- a/include/linux/blk.h
+++ b/include/linux/blk.h
@@ -5,6 +5,15 @@
#include <linux/locks.h>
#include <linux/config.h>
+#include <asm/spinlock.h>
+
+/*
+ * Spinlock for protecting the request queue which
+ * is mucked around with in interrupts on potentially
+ * multiple CPU's..
+ */
+extern spinlock_t io_request_lock;
+
/*
* NR_REQUEST is the number of entries in the request-queue.
* NOTE that writes may use only the low 2/3 of these: reads
@@ -39,6 +48,9 @@
#ifdef CONFIG_CDROM
extern int cdrom_init(void);
#endif CONFIG_CDROM
+#ifdef CONFIG_ISP16_CDI
+extern int isp16_init(void);
+#endif CONFIG_ISP16_CDI
#ifdef CONFIG_CDU31A
extern int cdu31a_init(void);
#endif CONFIG_CDU31A
@@ -433,6 +445,11 @@ static void (DEVICE_REQUEST)(void);
#if ! SCSI_BLK_MAJOR(MAJOR_NR)
+/*
+ * The [*_]end_request() handler has to be called with the request queue
+ * spinlock aquired. All functions called within end_request() _must be_
+ * atomic.
+ */
#if defined(IDE_DRIVER) && !defined(_IDE_C) /* shared copy for IDE modules */
void ide_end_request(byte uptodate, ide_hwgroup_t *hwgroup);
#else
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 1e7005e6c..f2d143359 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -38,6 +38,9 @@ typedef struct request ** (queue_proc) (kdev_t dev);
struct blk_dev_struct {
request_fn_proc *request_fn;
+ /*
+ * queue_proc has to be atomic
+ */
queue_proc *queue;
void *data;
struct request *current_request;
@@ -72,4 +75,15 @@ extern int * max_readahead[MAX_BLKDEV];
extern int * max_sectors[MAX_BLKDEV];
+#define MAX_SECTORS 244 /* 254 ? */
+
+#define PageAlignSize(size) (((size) + PAGE_SIZE -1) & PAGE_MASK)
+#if 0 /* small readahead */
+#define MAX_READAHEAD PageAlignSize(4096*7)
+#define MIN_READAHEAD PageAlignSize(4096*2)
+#else /* large readahead */
+#define MAX_READAHEAD PageAlignSize(4096*18)
+#define MIN_READAHEAD PageAlignSize(4096*3)
+#endif
+
#endif
diff --git a/include/linux/byteorder/vax_endian.h b/include/linux/byteorder/pdp_endian.h
index 1c420fa69..306123839 100644
--- a/include/linux/byteorder/vax_endian.h
+++ b/include/linux/byteorder/pdp_endian.h
@@ -1,23 +1,30 @@
-#ifndef _LINUX_BYTEORDER_VAX_ENDIAN_H
-#define _LINUX_BYTEORDER_VAX_ENDIAN_H
+#ifndef _LINUX_BYTEORDER_PDP_ENDIAN_H
+#define _LINUX_BYTEORDER_PDP_ENDIAN_H
/*
- * Could have been named NUXI-endian
+ * Could have been named NUXI-endian, but we use the same name as in glibc.
+ * hopefully only the PDP and its evolutions (old VAXen in compatibility mode)
+ * should ever use this braindead byteorder.
* This file *should* work, but has not been tested.
- * It's the beginning of what vaxlinux implementers will have to do.
- * I just hope we won't have to write standardized cpu_to_ve32() and suches!
- * little endian is 1234; bigendian is 4321; vaxendian is 3412
+ *
+ * little-endian is 1234; big-endian is 4321; nuxi/pdp-endian is 3412
+ *
+ * I thought vaxen were NUXI-endian, but was told they were correct-endian
+ * (little-endian), though indeed there existed NUXI-endian machines
+ * (DEC PDP-11 and old VAXen in compatibility mode).
+ * This makes this file a bit useless, but as a proof-of-concept.
*
* But what does a __u64 look like: is it 34127856 or 78563412 ???
* I don't dare imagine! Hence, no 64-bit byteorder support yet.
+ * Hopefully, there 64-bit pdp-endian support shouldn't ever be required.
*
*/
-#ifndef __VAX_ENDIAN
-#define __VAX_ENDIAN 3412
+#ifndef __PDP_ENDIAN
+#define __PDP_ENDIAN 3412
#endif
-#ifndef __VAX_ENDIAN_BITFIELD
-#define __VAX_ENDIAN_BITFIELD
+#ifndef __PDP_ENDIAN_BITFIELD
+#define __PDP_ENDIAN_BITFIELD
#endif
#include <linux/byteorder/swab.h>
@@ -66,4 +73,4 @@
#include <linux/byteorder/generic.h>
-#endif /* _LINUX_BYTEORDER_VAX_ENDIAN_H */
+#endif /* _LINUX_BYTEORDER_PDP_ENDIAN_H */
diff --git a/include/linux/byteorder/swabb.h b/include/linux/byteorder/swabb.h
index 1f34bc13d..22407afdf 100644
--- a/include/linux/byteorder/swabb.h
+++ b/include/linux/byteorder/swabb.h
@@ -6,7 +6,10 @@
* SWAp Bytes Bizarrely
* swaHHXX[ps]?(foo)
*
- * Support for obNUXIous vax-endian and other bizarre architectures...
+ * Support for obNUXIous pdp-endian and other bizarre architectures.
+ * Will Linux ever run on such ancient beasts? if not, this file
+ * will be but a programming pearl. Still, it's a reminder that
+ * cpu_to_beXX and beXX_to_cpu should be well distinguished.
*
*/
@@ -15,13 +18,11 @@
* swahw32 swap 16-bit half-words in a 32-bit word
* swahb32 swap 8-bit halves of each 16-bit half-word in a 32-bit word
*
- * No 64-bit support yet. I don't know VAX conventions for long longs.
+ * No 64-bit support yet. I don't know NUXI conventions for long longs.
* I guarantee it will be a mess when it's there, though :->
- * It will be even worse if there are conflicting 64-bit conventions for vaxen
+ * It will be even worse if there are conflicting 64-bit conventions.
+ * Hopefully, no one ever used 64-bit objects on NUXI machines.
*
- * Note that if communicating with vax machines becomes useful in some kernel
- * FS driver, we'd have to move that mess into byteorder/swab.h, and
- * create cpu_to_ve32 and suches. Ouch.
*/
@@ -31,8 +32,8 @@
(((__u32)(x) & (__u32)0xffff0000UL) >> 16) ))
#define ___swahb32(x) \
((__u32)( \
- (((__u32)(x) & (__u32)0x00ff00ffUL) << 16) | \
- (((__u32)(x) & (__u32)0xff00ff00UL) >> 16) ))
+ (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \
+ (((__u32)(x) & (__u32)0xff00ff00UL) >> 8) ))
/*
* provide defaults when no architecture-specific optimization is detected
diff --git a/include/linux/cd1400.h b/include/linux/cd1400.h
index e681f6a01..d07d1e61a 100644
--- a/include/linux/cd1400.h
+++ b/include/linux/cd1400.h
@@ -3,7 +3,7 @@
/*
* cd1400.h -- cd1400 UART hardware info.
*
- * Copyright (C) 1996-1997 Stallion Technologies (support@stallion.oz.au).
+ * Copyright (C) 1996-1998 Stallion Technologies (support@stallion.oz.au).
* Copyright (C) 1994-1996 Greg Ungerer (gerg@stallion.oz.au).
*
* This program is free software; you can redistribute it and/or modify
diff --git a/include/linux/cdk.h b/include/linux/cdk.h
index 6ed83eef9..2180e4330 100644
--- a/include/linux/cdk.h
+++ b/include/linux/cdk.h
@@ -3,7 +3,7 @@
/*
* cdk.h -- CDK interface definitions.
*
- * Copyright (C) 1996-1997 Stallion Technologies (support@stallion.oz.au).
+ * Copyright (C) 1996-1998 Stallion Technologies (support@stallion.oz.au).
* Copyright (C) 1994-1996 Greg Ungerer (gerg@stallion.oz.au).
*
* This program is free software; you can redistribute it and/or modify
@@ -304,6 +304,10 @@ typedef struct asyport {
#define P_DTRFOLLOW 0x20
#define P_FAKEDCD 0x40
+#define P_RXIMIN 0x10000
+#define P_RXITIME 0x20000
+#define P_RXTHOLD 0x40000
+
/*
* Define a structure to communicate serial port signal and data state
* information.
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
index f41342b53..8448fc6ca 100644
--- a/include/linux/cdrom.h
+++ b/include/linux/cdrom.h
@@ -4,7 +4,7 @@
* Copyright (C) 1992 David Giller, rafetmad@oxy.edu
* 1994, 1995 Eberhard Moenkeberg, emoenke@gwdg.de
* 1996 David van Leeuwen, david@tm.tno.nl
- * 1997 Erik Andersen, andersee@debian.org
+ * 1997, 1998 Erik Andersen, andersee@debian.org
*/
#ifndef _LINUX_CDROM_H
@@ -352,6 +352,7 @@ struct cdrom_blk
#define CDS_DATA_2 102
#define CDS_XA_2_1 103
#define CDS_XA_2_2 104
+#define CDS_MIXED 105
/* User-configurable behavior options for the uniform CD-ROM driver */
#define CDO_AUTO_CLOSE 0x1 /* close tray on first open() */
@@ -416,4 +417,4 @@ extern int register_cdrom(struct cdrom_device_info *cdi);
extern int unregister_cdrom(struct cdrom_device_info *cdi);
#endif /* End of kernel only stuff */
-#endif _LINUX_CDROM_H
+#endif /* _LINUX_CDROM_H */
diff --git a/include/linux/coda.h b/include/linux/coda.h
index 08e263925..3faa2e9ca 100644
--- a/include/linux/coda.h
+++ b/include/linux/coda.h
@@ -1,11 +1,3 @@
-/*
- * Venus interface for Coda.
- * Original version: (C) 1996 Peter Braam
- * Rewritten for Linux 2.1: (C) 1997 Carnegie Mellon University
- *
- * Carnegie Mellon encourages users of this code to contribute improvements
- * to the Coda project. Contact Peter Braam <coda@cs.cmu.edu>.
- */
/*
*
@@ -21,47 +13,86 @@
/* Catch new _KERNEL defn for NetBSD */
#ifdef __NetBSD__
#include <sys/types.h>
-#ifdef _KERNEL
-#define KERNEL
-#endif
#endif
-#if 0
-#ifndef _SCALAR_T_
-#define _SCALAR_T_ 1
-typedef unsigned long u_int32_t;
-typedef unsigned short u_int16_t;
-typedef unsigned char u_int8_t;
-#endif
-#endif
+#ifdef DJGPP
+#ifdef KERNEL
+typedef unsigned long u_long;
+typedef unsigned int u_int;
+typedef unsigned short u_short;
+typedef u_long ino_t;
+typedef u_long dev_t;
+typedef void * caddr_t;
+typedef u_long u_quad_t;
+
+#define inline
+
+struct timespec {
+ long ts_sec;
+ long ts_nsec;
+};
+#else /* DJGPP but not KERNEL */
+#include <sys/types.h>
+#include <sys/time.h>
+typedef u_long u_quad_t;
+#endif /* !KERNEL */
+#endif /* !DJGPP */
-#ifdef __linux__
-#ifndef _UQUAD_T_
+
+#if defined(__linux__) || defined(__CYGWIN32__)
+#define cdev_t u_quad_t
+#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
#define _UQUAD_T_ 1
-typedef unsigned long u_quad_t;
-#endif
+typedef unsigned long long u_quad_t;
+#endif
+#else
+#define cdev_t dev_t
+#endif
-#ifdef __KERNEL__
-#define KERNEL
-#endif __KERNEL__
+#ifdef __CYGWIN32__
+typedef unsigned char u_int8_t;
+struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* nanoseconds */
+};
#endif
+
/*
* Cfs constants
*/
-#define CFS_MAXNAMLEN 256
-#define CFS_MAXPATHLEN 256
-#define CODA_MAXSYMLINK 10
+#define CFS_MAXNAMLEN 255
+#define CFS_MAXPATHLEN 1024
+#define CFS_MAXSYMLINK 10
+
+/* these are Coda's version of O_RDONLY etc combinations
+ * to deal with VFS open modes
+ */
+#define C_O_READ 0x001
+#define C_O_WRITE 0x002
+#define C_O_TRUNC 0x010
+#define C_O_EXCL 0x100
+
+/* these are to find mode bits in Venus */
+#define C_M_READ 00400
+#define C_M_WRITE 00200
+
+/* for access Venus will use */
+#define C_A_R_OK 4 /* Test for read permission. */
+#define C_A_W_OK 2 /* Test for write permission. */
+#define C_A_X_OK 1 /* Test for execute permission. */
+#define C_A_F_OK 0 /* Test for existence. */
+
+
-/* types used in kernel and user mode */
#ifndef _VENUS_DIRENT_T_
#define _VENUS_DIRENT_T_ 1
struct venus_dirent {
- unsigned long d_fileno; /* file number of entry */
- unsigned short d_reclen; /* length of this record */
- char d_type; /* file type, see below */
- char d_namlen; /* length of string in d_name */
- char d_name[CFS_MAXNAMLEN + 1];/* name must be no longer than this */
+ unsigned long d_fileno; /* file number of entry */
+ unsigned short d_reclen; /* length of this record */
+ char d_type; /* file type, see below */
+ char d_namlen; /* length of string in d_name */
+ char d_name[CFS_MAXNAMLEN + 1];/* name must be no longer than this */
};
#undef DIRSIZ
#define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CFS_MAXNAMLEN+1)) + \
@@ -70,21 +101,21 @@ struct venus_dirent {
/*
* File types
*/
-#define DT_UNKNOWN 0
-#define DT_FIFO 1
-#define DT_CHR 2
-#define DT_DIR 4
-#define DT_BLK 6
-#define DT_REG 8
-#define DT_LNK 10
-#define DT_SOCK 12
-#define DT_WHT 14
+#define CDT_UNKNOWN 0
+#define CDT_FIFO 1
+#define CDT_CHR 2
+#define CDT_DIR 4
+#define CDT_BLK 6
+#define CDT_REG 8
+#define CDT_LNK 10
+#define CDT_SOCK 12
+#define CDT_WHT 14
/*
* Convert between stat structure types and directory types.
*/
-#define IFTODT(mode) (((mode) & 0170000) >> 12)
-#define DTTOIF(dirtype) ((dirtype) << 12)
+#define IFTOCDT(mode) (((mode) & 0170000) >> 12)
+#define CDTTOIF(dirtype) ((dirtype) << 12)
#endif
@@ -105,6 +136,16 @@ typedef struct ViceFid {
} ViceFid;
#endif /* VICEFID */
+static inline ino_t coda_f2i(struct ViceFid *fid)
+{
+ if ( fid ) {
+ return (fid->Unique + (fid->Vnode << 10) + (fid->Volume << 20));
+ } else {
+ return 0;
+ }
+}
+
+
#ifndef _VUID_T_
#define _VUID_T_
typedef u_long vuid_t;
@@ -113,11 +154,13 @@ typedef u_long vgid_t;
#ifndef _CODACRED_T_
#define _CODACRED_T_
-#define NGROUPS 32
-struct CodaCred {
+struct coda_cred {
vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/
- vgid_t cr_gid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
- vgid_t cr_groups[NGROUPS]; /* Group membership for caller */
+#if defined(__NetBSD__) || defined(__FreeBSD__)
+ vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
+#else
+ vgid_t cr_gid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
+#endif
};
#endif
@@ -126,7 +169,7 @@ struct CodaCred {
/*
* Vnode types. VNON means no type.
*/
-enum coda_vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD };
+enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
struct coda_vattr {
enum coda_vtype va_type; /* vnode type (for create) */
@@ -134,7 +177,6 @@ struct coda_vattr {
short va_nlink; /* number of references to file */
vuid_t va_uid; /* owner user id */
vgid_t va_gid; /* owner group id */
- long va_fsid; /* file system id (dev for now) */
long va_fileid; /* file id */
u_quad_t va_size; /* file size in bytes */
long va_blocksize; /* blocksize preferred for i/o */
@@ -143,20 +185,17 @@ struct coda_vattr {
struct timespec va_ctime; /* time file changed */
u_long va_gen; /* generation number of file */
u_long va_flags; /* flags defined for file */
- dev_t va_rdev; /* device the special file represents */
+ cdev_t va_rdev; /* device special file represents */
u_quad_t va_bytes; /* bytes of disk space held by file */
u_quad_t va_filerev; /* file modification number */
- u_int va_vaflags; /* operations flags, see below */
- long va_spare; /* remain quad aligned */
};
-#define VREAD 00400
-#define VWRITE 00200
#endif
/*
- * opcode constants
+ * Kernel <--> Venus communications.
*/
+
#define CFS_ROOT ((u_long) 2)
#define CFS_SYNC ((u_long) 3)
#define CFS_OPEN ((u_long) 4)
@@ -177,8 +216,8 @@ struct coda_vattr {
#define CFS_READLINK ((u_long) 19)
#define CFS_FSYNC ((u_long) 20)
#define CFS_INACTIVE ((u_long) 21)
-#define CFS_VGET ((u_long) 22)
-#define CFS_SIGNAL ((u_long) 23)
+#define CFS_VGET ((u_long) 22)
+#define CFS_SIGNAL ((u_long) 23)
#define CFS_REPLACE ((u_long) 24)
#define CFS_FLUSH ((u_long) 25)
#define CFS_PURGEUSER ((u_long) 26)
@@ -186,273 +225,438 @@ struct coda_vattr {
#define CFS_ZAPDIR ((u_long) 28)
#define CFS_ZAPVNODE ((u_long) 29)
#define CFS_PURGEFID ((u_long) 30)
-#define CFS_RDWR ((u_long) 31)
-#define ODY_MOUNT ((u_long) 32)
-#define ODY_LOOKUP ((u_long) 33)
-#define ODY_EXPAND ((u_long) 34)
+#define CFS_OPEN_BY_PATH ((u_long) 31)
+#define CFS_NCALLS 32
-#define CFS_NCALLS 35
#define DOWNCALL(opcode) (opcode >= CFS_REPLACE && opcode <= CFS_PURGEFID)
+#define VC_MAXDATASIZE 8192
+#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\
+ VC_MAXDATASIZE
+
+
+
/*
* Venus <-> Coda RPC arguments
*/
+struct cfs_in_hdr {
+ unsigned long opcode;
+ unsigned long unique; /* Keep multiple outstanding msgs distinct */
+ u_short pid; /* Common to all */
+ u_short pgid; /* Common to all */
+ u_short sid; /* Common to all */
+ struct coda_cred cred; /* Common to all */
+};
-struct inputArgs {
- u_long opcode;
- u_long unique; /* Keep multiple outstanding msgs distinct */
- u_short pid; /* Common to all */
- u_short pgid; /* Common to all */
- struct CodaCred cred; /* Common to all */
-
- union {
- /* Nothing needed for cfs_root */
- /* Nothing needed for cfs_sync */
- struct cfs_open_in {
- ViceFid VFid;
- int flags;
- } cfs_open;
- struct cfs_close_in {
- ViceFid VFid;
- int flags;
- } cfs_close;
- struct cfs_ioctl_in {
- ViceFid VFid;
- int cmd;
- int len;
- int rwflag;
- char *data; /* Place holder for data. */
- } cfs_ioctl;
- struct cfs_getattr_in {
- ViceFid VFid;
- struct coda_vattr attr;
- } cfs_getattr;
- struct cfs_setattr_in {
- ViceFid VFid;
- struct coda_vattr attr;
- } cfs_setattr;
- struct cfs_access_in {
- ViceFid VFid;
- int flags;
- } cfs_access;
- struct cfs_lookup_in {
- ViceFid VFid;
- char *name; /* Place holder for data. */
- } cfs_lookup;
- struct cfs_create_in {
- ViceFid VFid;
- struct coda_vattr attr;
- int excl;
- int mode;
- char *name; /* Place holder for data. */
- } cfs_create;
- struct cfs_remove_in {
- ViceFid VFid;
- char *name; /* Place holder for data. */
- } cfs_remove;
- struct cfs_link_in {
- ViceFid sourceFid; /* cnode to link *to* */
- ViceFid destFid; /* Directory in which to place link */
- char *tname; /* Place holder for data. */
- } cfs_link;
- struct cfs_rename_in {
- ViceFid sourceFid;
- char *srcname;
- ViceFid destFid;
- char *destname;
- } cfs_rename;
- struct cfs_mkdir_in {
- ViceFid VFid;
- struct coda_vattr attr;
- char *name; /* Place holder for data. */
- } cfs_mkdir;
- struct cfs_rmdir_in {
- ViceFid VFid;
- char *name; /* Place holder for data. */
- } cfs_rmdir;
- struct cfs_readdir_in {
- ViceFid VFid;
- int count;
- int offset;
- } cfs_readdir;
- struct cfs_symlink_in {
- ViceFid VFid; /* Directory to put symlink in */
- char *srcname;
- struct coda_vattr attr;
- char *tname;
- } cfs_symlink;
- struct cfs_readlink_in {
- ViceFid VFid;
- } cfs_readlink;
- struct cfs_fsync_in {
- ViceFid VFid;
- } cfs_fsync;
- struct cfs_inactive_in {
- ViceFid VFid;
- } cfs_inactive;
- struct cfs_vget_in {
- ViceFid VFid;
- } cfs_vget;
- /* CFS_SIGNAL is out-of-band, doesn't need data. */
- /* CFS_INVALIDATE is a venus->kernel call */
- /* CFS_FLUSH is a venus->kernel call */
- /* CFS_PURGEUSER is a venus->kernel call */
- /* CFS_ZAPFILE is a venus->kernel call */
- /* CFS_ZAPDIR is a venus->kernel call */
- /* CFS_ZAPVNODE is a venus->kernel call */
- /* CFS_PURGEFID is a venus->kernel call */
- struct cfs_rdwr_in {
- ViceFid VFid;
- int rwflag;
- int count;
- int offset;
- int ioflag;
- caddr_t data; /* Place holder for data. */
- } cfs_rdwr;
- struct ody_mount_in {
- char *name; /* Place holder for data. */
- } ody_mount;
- struct ody_lookup_in {
- ViceFid VFid;
- char *name; /* Place holder for data. */
- } ody_lookup;
- struct ody_expand_in {
- ViceFid VFid;
- int size; /* Size of buffer to return. */
- } ody_expand;
- /* CFS_REPLACE is a venus->kernel call */
- } d;
-};
-
-/* Occasionally, don't cache the fid returned by CFS_LOOKUP. For
- * instance, if the fid is inconsistent. This case is handled by
- * setting the top bit of the return result parameter. */
-#define CFS_NOCACHE 0x80000000
+/* Really important that opcode and unique are 1st two fields! */
+struct cfs_out_hdr {
+ unsigned long opcode;
+ unsigned long unique;
+ unsigned long result;
+};
-#define INIT_OUT(out, opcode, result) \
- out->opcode = (opcode); out->result = (result);
-
-/* IMPORTANT: opcode and unique must be first two fields! */
-struct outputArgs {
- u_long opcode;
- u_long unique; /* Keep multiple outstanding msgs distinct */
- u_long result;
- union {
- struct cfs_root_out {
- ViceFid VFid;
- } cfs_root;
- /* Nothing needed for cfs_sync */
- struct cfs_open_out {
- dev_t dev;
- ino_t inode;
- } cfs_open;
- /* Nothing needed for cfs_close */
- struct cfs_ioctl_out {
- int len;
- caddr_t data; /* Place holder for data. */
- } cfs_ioctl;
- struct cfs_getattr_out {
- struct coda_vattr attr;
- } cfs_getattr;
- /* Nothing needed for cfs_setattr */
- /* Nothing needed for cfs_access */
- struct cfs_lookup_out {
- ViceFid VFid;
- int vtype;
- } cfs_lookup;
- struct cfs_create_out {
- ViceFid VFid;
- struct coda_vattr attr;
- } cfs_create;
- /* Nothing needed for cfs_remove */
- /* Nothing needed for cfs_link */
- /* Nothing needed for cfs_rename */
- struct cfs_mkdir_out {
- ViceFid VFid;
- struct coda_vattr attr;
- } cfs_mkdir;
- /* Nothing needed for cfs_rmdir */
- struct cfs_readdir_out {
- int size;
- caddr_t data; /* Place holder for data. */
- } cfs_readdir;
- /* Nothing needed for cfs_symlink */
- struct cfs_readlink_out {
- int count;
- caddr_t data; /* Place holder for data. */
- } cfs_readlink;
- /* Nothing needed for cfs_fsync */
- /* Nothing needed for cfs_inactive */
- struct cfs_vget_out {
- ViceFid VFid;
- int vtype;
- } cfs_vget;
- /* CFS_SIGNAL is out-of-band, doesn't need data. */
- /* CFS_INVALIDATE is a venus->kernel call */
- /* CFS_FLUSH is a venus->kernel call */
- struct cfs_purgeuser_out {/* CFS_PURGEUSER is a venus->kernel call */
- struct CodaCred cred;
- } cfs_purgeuser;
- struct cfs_zapfile_out { /* CFS_ZAPFILE is a venus->kernel call */
- ViceFid CodaFid;
- } cfs_zapfile;
- struct cfs_zapdir_out { /* CFS_ZAPDIR is a venus->kernel call */
- ViceFid CodaFid;
- } cfs_zapdir;
- struct cfs_zapvnode_out { /* CFS_ZAPVNODE is a venus->kernel call */
- struct CodaCred cred;
- ViceFid VFid;
- } cfs_zapvnode;
- struct cfs_purgefid_out { /* CFS_PURGEFID is a venus->kernel call */
- ViceFid CodaFid;
- } cfs_purgefid;
- struct cfs_rdwr_out {
- int rwflag;
- int count;
- caddr_t data; /* Place holder for data. */
- } cfs_rdwr;
- struct ody_mount_out {
- ViceFid VFid;
- } ody_mount;
- struct ody_lookup_out {
- ViceFid VFid;
- } ody_lookup;
- struct ody_expand_out { /* Eventually it would be nice to get some */
- char links[sizeof(int)]; /* Place holder for data. */
- } ody_expand;
- struct cfs_replace_out { /* cfs_replace is a venus->kernel call */
- ViceFid NewFid;
- ViceFid OldFid;
- } cfs_replace;
- } d;
-};
-
+/* cfs_root: NO_IN */
+struct cfs_root_out {
+ struct cfs_out_hdr oh;
+ ViceFid VFid;
+};
+
+struct cfs_root_in {
+ struct cfs_in_hdr in;
+};
+
+/* cfs_sync: */
+/* Nothing needed for cfs_sync */
+
+/* cfs_open: */
+struct cfs_open_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ int flags;
+};
+
+struct cfs_open_out {
+ struct cfs_out_hdr oh;
+ cdev_t dev;
+ ino_t inode;
+};
+
+
+/* cfs_close: */
+struct cfs_close_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ int flags;
+};
+
+struct cfs_close_out {
+ struct cfs_out_hdr out;
+};
+
+/* cfs_ioctl: */
+struct cfs_ioctl_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ int cmd;
+ int len;
+ int rwflag;
+ char *data; /* Place holder for data. */
+};
+
+struct cfs_ioctl_out {
+ struct cfs_out_hdr oh;
+ int len;
+ caddr_t data; /* Place holder for data. */
+};
+
+
+/* cfs_getattr: */
+struct cfs_getattr_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+};
+
+struct cfs_getattr_out {
+ struct cfs_out_hdr oh;
+ struct coda_vattr attr;
+};
+
+
+/* cfs_setattr: NO_OUT */
+struct cfs_setattr_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ struct coda_vattr attr;
+};
+
+struct cfs_setattr_out {
+ struct cfs_out_hdr out;
+};
+
+/* cfs_access: NO_OUT */
+struct cfs_access_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ int flags;
+};
+
+struct cfs_access_out {
+ struct cfs_out_hdr out;
+};
+
+/* cfs_lookup: */
+struct cfs_lookup_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ int name; /* Place holder for data. */
+};
+
+struct cfs_lookup_out {
+ struct cfs_out_hdr oh;
+ ViceFid VFid;
+ int vtype;
+};
+
+
+/* cfs_create: */
+struct cfs_create_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ struct coda_vattr attr;
+ int excl;
+ int mode;
+ int name; /* Place holder for data. */
+};
+
+struct cfs_create_out {
+ struct cfs_out_hdr oh;
+ ViceFid VFid;
+ struct coda_vattr attr;
+};
+
+
+/* cfs_remove: NO_OUT */
+struct cfs_remove_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ int name; /* Place holder for data. */
+};
+
+struct cfs_remove_out {
+ struct cfs_out_hdr out;
+};
+
+/* cfs_link: NO_OUT */
+struct cfs_link_in {
+ struct cfs_in_hdr ih;
+ ViceFid sourceFid; /* cnode to link *to* */
+ ViceFid destFid; /* Directory in which to place link */
+ int tname; /* Place holder for data. */
+};
+
+struct cfs_link_out {
+ struct cfs_out_hdr out;
+};
+
+
+/* cfs_rename: NO_OUT */
+struct cfs_rename_in {
+ struct cfs_in_hdr ih;
+ ViceFid sourceFid;
+ int srcname;
+ ViceFid destFid;
+ int destname;
+};
+
+struct cfs_rename_out {
+ struct cfs_out_hdr out;
+};
+
+/* cfs_mkdir: */
+struct cfs_mkdir_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ struct coda_vattr attr;
+ int name; /* Place holder for data. */
+};
+
+struct cfs_mkdir_out {
+ struct cfs_out_hdr oh;
+ ViceFid VFid;
+ struct coda_vattr attr;
+};
+
+
+/* cfs_rmdir: NO_OUT */
+struct cfs_rmdir_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ int name; /* Place holder for data. */
+};
+
+struct cfs_rmdir_out {
+ struct cfs_out_hdr out;
+};
+
+/* cfs_readdir: */
+struct cfs_readdir_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ int count;
+ int offset;
+};
+
+struct cfs_readdir_out {
+ struct cfs_out_hdr oh;
+ int size;
+ caddr_t data; /* Place holder for data. */
+};
+
+/* cfs_symlink: NO_OUT */
+struct cfs_symlink_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid; /* Directory to put symlink in */
+ int srcname;
+ struct coda_vattr attr;
+ int tname;
+};
+
+struct cfs_symlink_out {
+ struct cfs_out_hdr out;
+};
+
+/* cfs_readlink: */
+struct cfs_readlink_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+};
+
+struct cfs_readlink_out {
+ struct cfs_out_hdr oh;
+ int count;
+ caddr_t data; /* Place holder for data. */
+};
+
+
+/* cfs_fsync: NO_OUT */
+struct cfs_fsync_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+};
+
+struct cfs_fsync_out {
+ struct cfs_out_hdr out;
+};
+
+/* cfs_inactive: NO_OUT */
+struct cfs_inactive_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+};
+
+/* cfs_vget: */
+struct cfs_vget_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+};
+
+struct cfs_vget_out {
+ struct cfs_out_hdr oh;
+ ViceFid VFid;
+ int vtype;
+};
+
+
+/* CFS_SIGNAL is out-of-band, doesn't need data. */
+/* CFS_INVALIDATE is a venus->kernel call */
+/* CFS_FLUSH is a venus->kernel call */
+
+/* cfs_purgeuser: */
+/* CFS_PURGEUSER is a venus->kernel call */
+struct cfs_purgeuser_out {
+ struct cfs_out_hdr oh;
+ struct coda_cred cred;
+};
+
+/* cfs_zapfile: */
+/* CFS_ZAPFILE is a venus->kernel call */
+struct cfs_zapfile_out {
+ struct cfs_out_hdr oh;
+ ViceFid CodaFid;
+};
+
+/* cfs_zapdir: */
+/* CFS_ZAPDIR is a venus->kernel call */
+struct cfs_zapdir_out {
+ struct cfs_out_hdr oh;
+ ViceFid CodaFid;
+};
+
+/* cfs_zapnode: */
+/* CFS_ZAPVNODE is a venus->kernel call */
+struct cfs_zapvnode_out {
+ struct cfs_out_hdr oh;
+ struct coda_cred cred;
+ ViceFid VFid;
+};
+
+/* cfs_purgefid: */
+/* CFS_PURGEFID is a venus->kernel call */
+struct cfs_purgefid_out {
+ struct cfs_out_hdr oh;
+ ViceFid CodaFid;
+};
+
+/* cfs_rdwr: */
+struct cfs_rdwr_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ int rwflag;
+ int count;
+ int offset;
+ int ioflag;
+ caddr_t data; /* Place holder for data. */
+};
+
+struct cfs_rdwr_out {
+ struct cfs_out_hdr oh;
+ int rwflag;
+ int count;
+ caddr_t data; /* Place holder for data. */
+};
+
+
+/* cfs_replace: */
+/* CFS_REPLACE is a venus->kernel call */
+struct cfs_replace_out { /* cfs_replace is a venus->kernel call */
+ struct cfs_out_hdr oh;
+ ViceFid NewFid;
+ ViceFid OldFid;
+};
+
+/* cfs_open_by_path: */
+struct cfs_open_by_path_in {
+ struct cfs_in_hdr ih;
+ ViceFid VFid;
+ int flags;
+};
+
+struct cfs_open_by_path_out {
+ struct cfs_out_hdr oh;
+ int path;
+};
/*
- * how big are the inputArgs and outputArgs structures
- * for the varying types of calls?
+ * Occasionally, don't cache the fid returned by CFS_LOOKUP. For instance, if
+ * the fid is inconsistent. This case is handled by setting the top bit of the
+ * return result parameter.
*/
-#define VC_IN_NO_DATA (2 * (int)sizeof(u_long) \
- + 2 * (int)sizeof(u_short) \
- + (int)sizeof(struct CodaCred))
-#define VC_OUT_NO_DATA (3 * (int)sizeof(u_long))
-#define VC_INSIZE(member) (VC_IN_NO_DATA + (int)sizeof(struct member))
-#define VC_OUTSIZE(member) (VC_OUT_NO_DATA + (int)sizeof(struct member))
-
-/* Now for venus. C++ doesn't know what struct foo means. */
-#define VC_SIZE(Thing, Member) (VC_OUT_NO_DATA \
- + (int)sizeof((Thing)->d.Member))
-
-#define VC_BIGGER_OF_IN_OR_OUT (sizeof(struct outputArgs) \
- > sizeof(struct inputArgs) \
- ? sizeof(struct outputArgs) \
- : sizeof(struct inputArgs))
-#define VC_DATASIZE 8192
-#define VC_MAXMSGSIZE (VC_DATASIZE + VC_BIGGER_OF_IN_OR_OUT)
+#define CFS_NOCACHE 0x80000000
+
+union inputArgs {
+ struct cfs_in_hdr ih; /* NB: every struct below begins with an ih */
+ struct cfs_open_in cfs_open;
+ struct cfs_close_in cfs_close;
+ struct cfs_ioctl_in cfs_ioctl;
+ struct cfs_getattr_in cfs_getattr;
+ struct cfs_setattr_in cfs_setattr;
+ struct cfs_access_in cfs_access;
+ struct cfs_lookup_in cfs_lookup;
+ struct cfs_create_in cfs_create;
+ struct cfs_remove_in cfs_remove;
+ struct cfs_link_in cfs_link;
+ struct cfs_rename_in cfs_rename;
+ struct cfs_mkdir_in cfs_mkdir;
+ struct cfs_rmdir_in cfs_rmdir;
+ struct cfs_readdir_in cfs_readdir;
+ struct cfs_symlink_in cfs_symlink;
+ struct cfs_readlink_in cfs_readlink;
+ struct cfs_fsync_in cfs_fsync;
+ struct cfs_inactive_in cfs_inactive;
+ struct cfs_vget_in cfs_vget;
+ struct cfs_rdwr_in cfs_rdwr;
+ struct cfs_open_by_path_in cfs_open_by_path;
+};
+
+union outputArgs {
+ struct cfs_out_hdr oh; /* NB: every struct below begins with an oh */
+ struct cfs_root_out cfs_root;
+ struct cfs_open_out cfs_open;
+ struct cfs_ioctl_out cfs_ioctl;
+ struct cfs_getattr_out cfs_getattr;
+ struct cfs_lookup_out cfs_lookup;
+ struct cfs_create_out cfs_create;
+ struct cfs_mkdir_out cfs_mkdir;
+ struct cfs_readdir_out cfs_readdir;
+ struct cfs_readlink_out cfs_readlink;
+ struct cfs_vget_out cfs_vget;
+ struct cfs_purgeuser_out cfs_purgeuser;
+ struct cfs_zapfile_out cfs_zapfile;
+ struct cfs_zapdir_out cfs_zapdir;
+ struct cfs_zapvnode_out cfs_zapvnode;
+ struct cfs_purgefid_out cfs_purgefid;
+ struct cfs_rdwr_out cfs_rdwr;
+ struct cfs_replace_out cfs_replace;
+ struct cfs_open_by_path_out cfs_open_by_path;
+};
+
+union cfs_downcalls {
+ /* CFS_INVALIDATE is a venus->kernel call */
+ /* CFS_FLUSH is a venus->kernel call */
+ struct cfs_purgeuser_out purgeuser;
+ struct cfs_zapfile_out zapfile;
+ struct cfs_zapdir_out zapdir;
+ struct cfs_zapvnode_out zapvnode;
+ struct cfs_purgefid_out purgefid;
+ struct cfs_replace_out replace;
+};
+
/*
* Used for identifying usage of "Control" and pioctls
*/
+
+#define PIOCPARM_MASK 0x0000ffff
struct ViceIoctl {
caddr_t in, out; /* Data to be transferred in, or out */
short in_size; /* Size of input buffer <= 2K */
@@ -465,25 +669,17 @@ struct PioctlData {
struct ViceIoctl vi;
};
-
-
-
-
-
#define CFS_CONTROL ".CONTROL"
#define CFS_CONTROLLEN 8
#define CTL_VOL -1
#define CTL_VNO -1
#define CTL_UNI -1
#define CTL_INO -1
-#define CTL_FILE "/coda/.CONTROL"
-#define IOCPARM_MASK 0x0000ffff
+#define CTL_FILE "/coda/.CONTROL"
#define IS_CTL_FID(fidp) ((fidp)->Volume == CTL_VOL &&\
(fidp)->Vnode == CTL_VNO &&\
(fidp)->Unique == CTL_UNI)
- /*#define ISDIR(fid) ((fid).Vnode & 0x1) */
-
#endif
diff --git a/include/linux/coda_cache.h b/include/linux/coda_cache.h
new file mode 100644
index 000000000..44251867f
--- /dev/null
+++ b/include/linux/coda_cache.h
@@ -0,0 +1,80 @@
+/* Coda filesystem -- Linux Minicache
+ *
+ * Copyright (C) 1989 - 1997 Carnegie Mellon University
+ *
+ * Carnegie Mellon University encourages users of this software to
+ * contribute improvements to the Coda project. Contact Peter Braam
+ * <coda@cs.cmu.edu>
+ */
+
+#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;
+};
+
+void coda_ccinsert(struct coda_cache *el, struct super_block *sb);
+void coda_cninsert(struct coda_cache *el, struct coda_inode_info *cnp);
+void coda_ccremove(struct coda_cache *el);
+void coda_cnremove(struct coda_cache *el);
+void coda_cache_create(struct inode *inode, int mask);
+struct coda_cache *coda_cache_find(struct inode *inode);
+void coda_cache_enter(struct inode *inode, int mask);
+void coda_cache_clear_cnp(struct coda_inode_info *cnp);
+void coda_cache_clear_all(struct super_block *sb);
+void coda_cache_clear_cred(struct super_block *sb, struct coda_cred *cred);
+int coda_cache_check(struct inode *inode, int mask);
+void coda_dentry_delete(struct dentry *dentry);
+void coda_zapfid(struct ViceFid *fid, struct super_block *sb, int flag);
+
+
+/*
+ * Structure to contain statistics on the cache usage
+ */
+
+struct cfsnc_statistics {
+ unsigned hits;
+ unsigned misses;
+ unsigned enters;
+ unsigned dbl_enters;
+ unsigned long_name_enters;
+ unsigned long_name_lookups;
+ unsigned long_remove;
+ unsigned lru_rm;
+ unsigned zapPfids;
+ unsigned zapFids;
+ unsigned zapFile;
+ unsigned zapUsers;
+ unsigned Flushes;
+ unsigned Sum_bucket_len;
+ unsigned Sum2_bucket_len;
+ unsigned Max_bucket_len;
+ unsigned Num_zero_len;
+ unsigned Search_len;
+};
+
+
+#define CFSNC_FIND ((u_long) 1)
+#define CFSNC_REMOVE ((u_long) 2)
+#define CFSNC_INIT ((u_long) 3)
+#define CFSNC_ENTER ((u_long) 4)
+#define CFSNC_LOOKUP ((u_long) 5)
+#define CFSNC_ZAPPFID ((u_long) 6)
+#define CFSNC_ZAPFID ((u_long) 7)
+#define CFSNC_ZAPVNODE ((u_long) 8)
+#define CFSNC_ZAPFILE ((u_long) 9)
+#define CFSNC_PURGEUSER ((u_long) 10)
+#define CFSNC_FLUSH ((u_long) 11)
+#define CFSNC_PRINTCFSNC ((u_long) 12)
+#define CFSNC_PRINTSTATS ((u_long) 13)
+#define CFSNC_REPLACE ((u_long) 14)
+
+#endif _CFSNC_HEADER_
diff --git a/include/linux/coda_cnode.h b/include/linux/coda_cnode.h
deleted file mode 100644
index 43bf1b2cc..000000000
--- a/include/linux/coda_cnode.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Cnode definitions for Coda.
- * Original version: (C) 1996 Peter Braam
- * Rewritten for Linux 2.1: (C) 1997 Carnegie Mellon University
- *
- * Carnegie Mellon encourages users of this code to contribute improvements
- * to the Coda project. Contact Peter Braam <coda@cs.cmu.edu>.
- */
-
-/* revamped cnode.h file: platform dependent, kernel only! */
-
-
-#ifndef _CNODE_H_
-#define _CNODE_H_
-#include <linux/coda.h>
-
-
-#define CODA_CNODE_MAGIC 0x47114711
-
-/* defintion of cnode, which combines ViceFid with inode information */
-struct cnode {
- struct inode *c_vnode; /* linux inode associated with cnode */
- ViceFid c_fid; /* Coda identifier */
- u_short c_flags; /* flags (see below) */
- int c_magic; /* to verify the data structure */
- u_short c_ocount; /* count of openers */
- u_short c_owrite; /* count of open for write */
- u_short c_mmcount; /* count of mmappers */
- struct inode *c_ovp; /* open vnode pointer */
- struct dentry c_odentry;
-};
-
-/* flags */
-#define C_VATTR 0x1 /* Validity of vattr in the cnode */
-#define C_SYMLINK 0x2 /* Validity of symlink pointer in the cnode */
-#define C_DYING 0x4 /* Set for outstanding cnodes from venus (which died) */
-
-struct cnode *coda_cnode_alloc(void);
-void coda_cnode_free(struct cnode *cinode);
-int coda_cnode_make(struct inode **inode, ViceFid *fid, struct super_block *sb);
-struct inode *coda_fid2inode(ViceFid *fid, struct super_block *sb);
-int coda_cnode_makectl(struct inode **inode, struct super_block *sb);
-
-
-
-#endif
-
diff --git a/include/linux/coda_fs_i.h b/include/linux/coda_fs_i.h
new file mode 100644
index 000000000..1277445b9
--- /dev/null
+++ b/include/linux/coda_fs_i.h
@@ -0,0 +1,52 @@
+/*
+ * coda_fs_i.h
+ *
+ * Copyright (C) 1998 Carnegie Mellon University
+ *
+ */
+
+#ifndef _LINUX_CODA_FS_I
+#define _LINUX_CODA_FS_I
+
+#ifdef __KERNEL__
+#include <linux/types.h>
+#include <linux/list.h>
+#include <linux/coda.h>
+
+
+
+#define CODA_CNODE_MAGIC 0x47114711
+/*
+ * smb fs inode data (in memory only)
+ */
+struct coda_inode_info {
+ struct ViceFid c_fid; /* Coda identifier */
+ u_short c_flags; /* flags (see below) */
+ u_short c_ocount; /* count of openers */
+ u_short c_owrite; /* count of open for write */
+ u_short c_mmcount; /* count of mmappers */
+ struct inode *c_ovp; /* open inode pointer */
+ 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 */
+ int c_magic; /* to verify the data structure */
+};
+
+/* flags */
+#define C_VATTR 0x1 /* Validity of vattr in the cnode */
+#define C_SYMLINK 0x2 /* Validity of symlink pointer in the cnode */
+#define C_DYING 0x4 /* Set for outstanding cnodes from venus (which died) */
+#define C_ZAPFID 0x8
+#define C_ZAPDIR 0x10
+#define C_INITED 0x20
+
+int coda_cnode_make(struct inode **, struct ViceFid *, struct super_block *);
+int coda_cnode_makectl(struct inode **inode, struct super_block *sb);
+struct inode *coda_fid_to_inode(ViceFid *fid, struct super_block *sb);
+
+/* inode to cnode */
+#define ITOC(inode) ((struct coda_inode_info *)&((inode)->u.coda_i))
+
+
+#endif
+#endif
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index 35901883b..fa477cb52 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -41,15 +41,20 @@ int coda_permission(struct inode *inode, int mask);
extern int coda_debug;
extern int coda_print_entry;
extern int coda_access_cache;
-extern int cfsnc_use;
-
-/* */
-char *coda_f2s(ViceFid *f, char *s);
+/* this file: heloers */
+char *coda_f2s(ViceFid *f);
int coda_isroot(struct inode *i);
-void coda_load_creds(struct CodaCred *cred);
-
-
+int coda_fid_is_volroot(struct ViceFid *);
+int coda_iscontrol(const char *name, size_t length);
+void coda_load_creds(struct coda_cred *cred);
+int coda_mycred(struct coda_cred *);
+void coda_vattr_to_iattr(struct inode *, struct coda_vattr *);
+void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *);
+unsigned short coda_flags_to_cflags(unsigned short);
+void print_vattr( struct coda_vattr *attr );
+int coda_cred_ok(struct coda_cred *cred);
+int coda_cred_eq(struct coda_cred *cred1, struct coda_cred *cred2);
/* defined in file.c */
void coda_prepare_openfile(struct inode *coda_inode, struct file *coda_file,
@@ -58,17 +63,8 @@ void coda_prepare_openfile(struct inode *coda_inode, struct file *coda_file,
void coda_restore_codafile(struct inode *coda_inode, struct file *coda_file,
struct inode *open_inode, struct file *open_file);
int coda_inode_grab(dev_t dev, ino_t ino, struct inode **ind);
-struct super_block *coda_find_super(kdev_t device);
-
-#define INIT_IN(in, op) \
- (in)->opcode = (op); \
- (in)->pid = current->pid; \
- (in)->pgid = current->gid;
-
-/* debugging aids */
-
-#define coda_panic printk
+#define NB_SFS_SIZ 0x895440
/* debugging masks */
#define D_SUPER 1 /* print results returned by Venus */
@@ -81,8 +77,8 @@ struct super_block *coda_find_super(kdev_t device);
#define D_PSDEV 128
#define D_PIOCTL 256
#define D_SPECIAL 512
-/* until we are really good, ... */
-#define coda_panic printk
+#define D_TIMING 1024
+#define D_DOWNCALL 2048
#define CDEBUG(mask, format, a...) \
do { \
@@ -97,31 +93,7 @@ struct super_block *coda_find_super(kdev_t device);
#define EXIT \
if(coda_print_entry) printk("Process %d leaving %s\n",current->pid,__FUNCTION__)
-
-/* inode to cnode */
-#define ITOC(the_inode) ((struct cnode *)(the_inode)->u.generic_ip)
-/* cnode to inode */
-#define CTOI(the_cnode) ((the_cnode)->c_vnode)
-
-#define CHECK_CNODE(c) \
-do { \
- struct cnode *cnode = (c); \
- if (!cnode) \
- coda_panic ("%s(%d): cnode is null\n", __FUNCTION__, __LINE__); \
- if (cnode->c_magic != CODA_CNODE_MAGIC) \
- coda_panic ("%s(%d): cnode magic wrong\n", __FUNCTION__, __LINE__); \
- if (!cnode->c_vnode) \
- coda_panic ("%s(%d): cnode has null inode\n", __FUNCTION__, __LINE__); \
- if ( (struct cnode *)cnode->c_vnode->u.generic_ip != cnode ) \
- coda_panic("AAooh, %s(%d) cnode doesn't link right!\n", __FUNCTION__,__LINE__);\
-} while (0);
-
-
-/* ioctl stuff */
-/* this needs to be sorted out XXXX */
-#ifdef __linux__
-#define IOCPARM_MASK 0x0000ffff
-#endif
+#define CHECK_CNODE(c) do { } while (0);
#define CODA_ALLOC(ptr, cast, size) \
do { \
@@ -132,7 +104,7 @@ do { \
ptr = (cast)vmalloc((unsigned long) size); \
CDEBUG(D_MALLOC, "vmalloced: %x at %x.\n", (int) size, (int) ptr);}\
if (ptr == 0) { \
- coda_panic("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 ); \
} while (0)
@@ -140,48 +112,4 @@ do { \
#define CODA_FREE(ptr,size) do {if (size < 3000) { kfree_s((ptr), (size)); CDEBUG(D_MALLOC, "kfreed: %x at %x.\n", (int) size, (int) ptr); } else { vfree((ptr)); CDEBUG(D_MALLOC, "vfreed: %x at %x.\n", (int) size, (int) ptr);} } while (0)
-
-
-
-/*
- * Macros to manipulate the queue
- */
-#define crfree(cred) CODA_FREE( (cred), sizeof(struct ucred))
-
-#ifndef INIT_QUEUE
-
-struct queue {
- struct queue *forw, *back;
-};
-
-#define INIT_QUEUE(head) \
-do { \
- (head).forw = (struct queue *)&(head); \
- (head).back = (struct queue *)&(head); \
-} while (0)
-
-#define GETNEXT(head) (head).forw
-
-#define EMPTY(head) ((head).forw == &(head))
-
-#define EOQ(el, head) ((struct queue *)(el) == (struct queue *)&(head))
-
-#define INSQUE(el, head) \
-do { \
- (el).forw = ((head).back)->forw; \
- (el).back = (head).back; \
- ((head).back)->forw = (struct queue *)&(el); \
- (head).back = (struct queue *)&(el); \
-} while (0)
-
-#define REMQUE(el) \
-do { \
- ((el).forw)->back = (el).back; \
- (el).back->forw = (el).forw; \
-} while (0)
-
-#endif INIT_QUEUE
-
-
-#endif _LINUX_CODA_FS
-
+#endif
diff --git a/include/linux/coda_namecache.h b/include/linux/coda_namecache.h
deleted file mode 100644
index 261adff6b..000000000
--- a/include/linux/coda_namecache.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Mach Operating System
- * Copyright (c) 1990 Carnegie-Mellon University
- * Copyright (c) 1989 Carnegie-Mellon University
- * All rights reserved. The CMU software License Agreement specifies
- * the terms and conditions for use and redistribution.
- */
-
-/*
- * This code was written for the Coda file system at Carnegie Mellon University.
- * Contributers include David Steere, James Kistler, and M. Satyanarayanan.
- */
-
-/*
- * HISTORY
- * cfsnc.h,v
- * Revision 1.2 1996/01/02 16:57:19 bnoble
- * Added support for Coda MiniCache and raw inode calls (final commit)
- *
- * Revision 1.1.2.1 1995/12/20 01:57:45 bnoble
- * Added CFS-specific files
- *
- * Revision 3.1.1.1 1995/03/04 19:08:22 bnoble
- * Branch for NetBSD port revisions
- *
- * Revision 3.1 1995/03/04 19:08:21 bnoble
- * Bump to major revision 3 to prepare for NetBSD port
- *
- * Revision 2.2 1994/08/28 19:37:39 luqi
- * Add a new CFS_REPLACE call to allow venus to replace a ViceFid in the
- * mini-cache.
- *
- * In "cfs.h":
- * Add CFS_REPLACE decl.
- *
- * In "cfs_namecache.c":
- * Add routine cfsnc_replace.
- *
- * In "cfs_subr.c":
- * Add case-statement to process CFS_REPLACE.
- *
- * In "cfsnc.h":
- * Add decl for CFSNC_REPLACE.
- *
- * Revision 2.1 94/07/21 16:25:27 satya
- * Conversion to C++ 3.0; start of Coda Release 2.0
- *
- * Revision 1.2 92/10/27 17:58:34 lily
- * merge kernel/latest and alpha/src/cfs
- *
- * Revision 2.2 90/07/05 11:27:04 mrt
- * Created for the Coda File System.
- * [90/05/23 dcs]
- *
- * Revision 1.4 90/05/31 17:02:12 dcs
- * Prepare for merge with facilities kernel.
- *
- *
- */
-#ifndef _CFSNC_HEADER_
-#define _CFSNC_HEADER_
-
-#include "coda.h"
-#include "coda_cnode.h"
-
-
-/*
- * Cfs constants
- */
-#define CFSNC_NAMELEN 15 /* longest name stored in cache */
-#define CFSNC_CACHESIZE 256 /* Default cache size */
-#define CFSNC_HASHSIZE 64 /* Must be multiple of 2 */
-/*
- * Structure for an element in the CFS Name Cache.
- */
-
-/* roughly 50 bytes per entry */
-struct cfscache {
- struct cfscache *hash_next,*hash_prev; /* Hash list */
- struct cfscache *lru_next, *lru_prev; /* LRU list */
- struct cnode *cp; /* vnode of the file */
- struct cnode *dcp; /* parent's cnode */
- struct CodaCred *cred; /* user credentials */
- char name[CFSNC_NAMELEN]; /* segment name */
- int namelen; /* length of name */
-};
-
-
-
-/* exported */
-void cfsnc_init(void);
-void cfsnc_enter(struct cnode *dcp, register const char *name, int namelen, struct cnode *cp);
-struct cnode *cfsnc_lookup(struct cnode *dcp, register const char *name, int namelen);
-void cfsnc_zapParentfid(ViceFid *fid);
-void cfsnc_zapfid(ViceFid *fid);
-void cfsnc_zapfile(struct cnode *dcp, register const char *name, int length);
-void cfsnc_purge_user(struct CodaCred *cred);
-void cfsnc_flush(void);
-void cfsnc_replace(ViceFid *f1, ViceFid *f2);
-void print_cfsnc(void);
-void coda_print_ce(struct cfscache *);
-int cfsnc_resize(int hashsize, int heapsize);
-
-
-
-/* #define CFSNC_VALID(cncp) ( (cncp->dcp != (struct cnode *)0) && (cncp->cp->c_flags & C_VATTR) ) */
-#define CFSNC_VALID(cncp) (cncp->dcp != (struct cnode *)0)
-
-#define DATA_PART(cncp) (struct cfscache *) \
- ((char *)cncp + (4*sizeof(struct cfscache *)))
-#define DATA_SIZE (sizeof(struct cfscache)-(4*sizeof(struct cfscache *)))
-
-/*
- * Structure to contain statistics on the cache usage
- */
-
-struct cfsnc_statistics {
- unsigned hits;
- unsigned misses;
- unsigned enters;
- unsigned dbl_enters;
- unsigned long_name_enters;
- unsigned long_name_lookups;
- unsigned long_remove;
- unsigned lru_rm;
- unsigned zapPfids;
- unsigned zapFids;
- unsigned zapFile;
- unsigned zapUsers;
- unsigned Flushes;
- unsigned Sum_bucket_len;
- unsigned Sum2_bucket_len;
- unsigned Max_bucket_len;
- unsigned Num_zero_len;
- unsigned Search_len;
-};
-
-/*
- * Symbols to aid in debugging the namecache code. Assumes the existence
- * of the variable cfsnc_debug, which is defined in cfs_namecache.c
- */
-extern int cfsnc_debug;
-#define CFSNC_DEBUG(N, STMT) { if (cfsnc_debug & (1 <<N)) { STMT } }
-
-#define CFSNC_FIND ((u_long) 1)
-#define CFSNC_REMOVE ((u_long) 2)
-#define CFSNC_INIT ((u_long) 3)
-#define CFSNC_ENTER ((u_long) 4)
-#define CFSNC_LOOKUP ((u_long) 5)
-#define CFSNC_ZAPPFID ((u_long) 6)
-#define CFSNC_ZAPFID ((u_long) 7)
-#define CFSNC_ZAPVNODE ((u_long) 8)
-#define CFSNC_ZAPFILE ((u_long) 9)
-#define CFSNC_PURGEUSER ((u_long) 10)
-#define CFSNC_FLUSH ((u_long) 11)
-#define CFSNC_PRINTCFSNC ((u_long) 12)
-#define CFSNC_PRINTSTATS ((u_long) 13)
-#define CFSNC_REPLACE ((u_long) 14)
-
-#endif _CFSNC_HEADER_
diff --git a/include/linux/coda_opstats.h b/include/linux/coda_opstats.h
index 2c127e6e5..fdf3fac42 100644
--- a/include/linux/coda_opstats.h
+++ b/include/linux/coda_opstats.h
@@ -1,27 +1,14 @@
-/*
- * Operations statistics for Coda.
- * Original version: (C) 1996 Peter Braam
- * Rewritten for Linux 2.1: (C) 1997 Carnegie Mellon University
- *
- * Carnegie Mellon encourages users of this code to contribute improvements
- * to the Coda project. Contact Peter Braam <coda@cs.cmu.edu>.
- */
-
/*
- * operation stats: what the minicache can intercept that
- * *isn't* seen by venus. These stats are kept to augment
- * the stats maintained by the Volume-Session mechanism.
+ * Operation statistics for Coda.
+ * Copyright (C) 1997 Carnegie Mellon University
+ *
+ * Carnegie Mellon University encourages users of this software
+ * to contribute improvements to the Coda project. Contact Peter Braam
+ * <coda@coda.cs.cmu.edu>.
*/
-/* vfsops:
- * mount: not currently bounced to Venus
- * umount: nope
- * root: only first call, rest is cached.
- * statfs: none (bogus)
- * sync: none (bogus)
- * vget: all
- */
+
#define CFS_MOUNT_STATS 0
#define CFS_UMOUNT_STATS 1
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index ecd213f8b..370408e07 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -6,17 +6,46 @@
extern struct vcomm psdev_vcomm[];
+/* queue stuff; the rest is static to psdev.c */
+struct queue {
+ struct queue *forw, *back;
+};
+void coda_q_insert(struct queue *el, struct queue *q);
+void coda_q_remove(struct queue *q);
+
+
#define CODA_SUPER_MAGIC 0x73757245
struct coda_sb_info
{
- struct inode * sbi_psdev; /* /dev/cfs? Venus/kernel device */
- struct inode * sbi_ctlcp; /* control magic file */
- int sbi_refct;
- struct vcomm * sbi_vcomm;
- struct inode * sbi_root;
+ struct inode * sbi_psdev; /* /dev/cfs? Venus/kernel device */
+ struct inode * sbi_ctlcp; /* control magic file */
+ int sbi_refct;
+ struct vcomm * sbi_vcomm;
+ struct inode * sbi_root;
+ struct list_head sbi_cchead;
+ struct list_head sbi_volroothead;
};
+/* communication pending/processing queues queues */
+struct vcomm {
+ u_long vc_seq;
+ struct wait_queue *vc_waitq; /* Venus wait queue */
+ struct queue vc_pending;
+ struct queue vc_processing;
+ struct super_block *vc_sb;
+ int vc_inuse;
+};
+
+static inline int vcomm_open(struct vcomm *vcp)
+{
+ return ((vcp)->vc_pending.forw != NULL);
+}
+
+static inline void mark_vcomm_closed(struct vcomm *vcp)
+{
+ (vcp)->vc_pending.forw = NULL;
+}
static inline struct coda_sb_info *coda_sbp(struct super_block *sb)
{
@@ -28,22 +57,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);
-/* to aid procedures make upcalls. They must have a
- declaration at the top containing:
- struct inputArgs *inp;
- struct outputArgs *outp;
- int error=0;
- int size;
-*/
-
-#define UPARG(bsize, op)\
-do {\
- CODA_ALLOC(inp, struct inputArgs *, (bsize));\
- outp = (struct outputArgs *) (inp);\
- INIT_IN(inp, (op))\
- coda_load_creds(&(inp->cred));\
- size = (bsize);\
-} while (0)
/* upcalls */
int venus_rootfid(struct super_block *sb, ViceFid *fidp);
@@ -80,40 +93,27 @@ int venus_symlink(struct super_block *sb, struct ViceFid *fid,
int venus_access(struct super_block *sb, struct ViceFid *fid, int mask);
int venus_pioctl(struct super_block *sb, struct ViceFid *fid,
unsigned int cmd, struct PioctlData *data);
-int coda_downcall(int opcode, struct outputArgs *out);
+int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
int coda_upcall(struct coda_sb_info *mntinfo, int inSize,
- int *outSize, struct inputArgs *buffer);
+ int *outSize, union inputArgs *buffer);
+int venus_fsync(struct super_block *sb, struct ViceFid *fid);
/* messages between coda filesystem in kernel and Venus */
+extern int coda_hard;
+extern unsigned long coda_timeout;
struct vmsg {
- struct queue vm_chain;
- caddr_t vm_data;
- u_short vm_flags;
- u_short vm_inSize; /* Size is at most 5000 bytes */
- u_short vm_outSize;
- u_short vm_opcode; /* copied from data to save lookup */
- int vm_unique;
- struct wait_queue *vm_sleep; /* process' wait queue */
-};
-
-/* communication pending/processing queues queues */
-struct vcomm {
- u_long vc_seq;
- struct wait_queue *vc_waitq; /* Venus wait queue */
- struct queue vc_pending;
- struct queue vc_processing;
+ struct queue vm_chain;
+ caddr_t vm_data;
+ u_short vm_flags;
+ u_short vm_inSize; /* Size is at most 5000 bytes */
+ u_short vm_outSize;
+ u_short vm_opcode; /* copied from data to save lookup */
+ int vm_unique;
+ struct wait_queue *vm_sleep; /* process' wait queue */
+ unsigned long vm_posttime;
};
-static inline int vcomm_open(struct vcomm *vcp)
-{
- return ((vcp)->vc_pending.forw != NULL);
-}
-
-static inline void mark_vcomm_closed(struct vcomm *vcp)
-{
- (vcp)->vc_pending.forw = NULL;
-}
/*
* Statistics
diff --git a/include/linux/comstats.h b/include/linux/comstats.h
index d56918486..066888599 100644
--- a/include/linux/comstats.h
+++ b/include/linux/comstats.h
@@ -3,7 +3,7 @@
/*
* comstats.h -- Serial Port Stats.
*
- * Copyright (C) 1996-1997 Stallion Technologies (support@stallion.oz.au).
+ * Copyright (C) 1996-1998 Stallion Technologies (support@stallion.oz.au).
* Copyright (C) 1994-1996 Greg Ungerer (gerg@stallion.oz.au).
*
* This program is free software; you can redistribute it and/or modify
diff --git a/include/linux/config.h b/include/linux/config.h
index f817d0710..9d1c14f7a 100644
--- a/include/linux/config.h
+++ b/include/linux/config.h
@@ -3,28 +3,4 @@
#include <linux/autoconf.h>
-/*
- * Defines for what uname() should return
- */
-#ifndef UTS_SYSNAME
-#define UTS_SYSNAME "Linux"
-#endif
-
-#ifndef UTS_MACHINE
-#define UTS_MACHINE "unknown"
-#endif
-
-#ifndef UTS_NODENAME
-#define UTS_NODENAME "(none)" /* set by sethostname() */
-#endif
-
-#ifndef UTS_DOMAINNAME
-#define UTS_DOMAINNAME "(none)" /* set by setdomainname() */
-#endif
-
-/*
- * The definitions for UTS_RELEASE and UTS_VERSION are now defined
- * in linux/version.h, and should only be used by linux/version.c
- */
-
#endif
diff --git a/include/linux/console.h b/include/linux/console.h
index fc5cd4b2d..8c0854b0b 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -99,6 +99,7 @@ struct console
};
extern void register_console(struct console *);
+extern int unregister_console(struct console *);
extern struct console *console_drivers;
#endif /* linux/console.h */
diff --git a/include/linux/ctype.h b/include/linux/ctype.h
index bac58b52f..afa363922 100644
--- a/include/linux/ctype.h
+++ b/include/linux/ctype.h
@@ -2,7 +2,7 @@
#define _LINUX_CTYPE_H
/*
- * NOTE! This ctype does not handle EOF like the standarc C
+ * NOTE! This ctype does not handle EOF like the standard C
* library is required to.
*/
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 53a2ce3e3..c095f1007 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -61,18 +61,22 @@ struct dentry {
struct list_head d_lru; /* d_count = 0 LRU list */
struct list_head d_child; /* child of parent list */
struct list_head d_subdirs; /* our children */
+ struct list_head d_alias; /* inode alias list */
struct qstr d_name;
unsigned long d_time; /* used by d_revalidate */
struct dentry_operations *d_op;
struct super_block * d_sb; /* The root of the dentry tree */
unsigned long d_reftime; /* last time referenced */
+ void * d_fsdata; /* fs-specific data */
};
struct dentry_operations {
int (*d_revalidate)(struct dentry *);
- int (*d_hash) (struct dentry *,struct qstr *);
- int (*d_compare) (struct dentry *,struct qstr *, struct qstr *);
+ int (*d_hash) (struct dentry *, struct qstr *);
+ int (*d_compare) (struct dentry *, struct qstr *, struct qstr *);
void (*d_delete)(struct dentry *);
+ void (*d_release)(struct dentry *);
+ void (*d_iput)(struct dentry *, struct inode *);
};
/* the dentry parameter passed to d_hash and d_compare is the parent
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 3d2864f55..2147b403d 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -151,7 +151,8 @@ typedef __u64 Elf64_Word;
#define AT_EUID 12 /* effective uid */
#define AT_GID 13 /* real gid */
#define AT_EGID 14 /* effective gid */
-
+#define AT_PLATFORM 15 /* string identifying cpu for optimizations */
+#define AT_HWCAP 16 /* arch dependent hints at cpu capabilities */
typedef struct dynamic{
Elf32_Sword d_tag;
@@ -276,6 +277,14 @@ typedef struct {
#define R_SPARC_5 44
#define R_SPARC_6 45
+/* Bits present in AT_HWCAP, primarily for Sparc32. */
+
+#define HWCAP_SPARC_FLUSH 1 /* The cpu supports flush insn. */
+#define HWCAP_SPARC_STBAR 2
+#define HWCAP_SPARC_SWAP 4
+#define HWCAP_SPARC_MULDIV 8
+
+
/*
* 68k ELF relocation types
*/
@@ -303,6 +312,43 @@ typedef struct {
#define R_68K_JMP_SLOT 21
#define R_68K_RELATIVE 22
+/*
+ * Alpha ELF relocation types
+ */
+#define R_ALPHA_NONE 0 /* No reloc */
+#define R_ALPHA_REFLONG 1 /* Direct 32 bit */
+#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */
+#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */
+#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */
+#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */
+#define R_ALPHA_GPDISP 6 /* Add displacement to GP */
+#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */
+#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */
+#define R_ALPHA_SREL16 9 /* PC relative 16 bit */
+#define R_ALPHA_SREL32 10 /* PC relative 32 bit */
+#define R_ALPHA_SREL64 11 /* PC relative 64 bit */
+#define R_ALPHA_OP_PUSH 12 /* OP stack push */
+#define R_ALPHA_OP_STORE 13 /* OP stack pop and store */
+#define R_ALPHA_OP_PSUB 14 /* OP stack subtract */
+#define R_ALPHA_OP_PRSHIFT 15 /* OP stack right shift */
+#define R_ALPHA_GPVALUE 16
+#define R_ALPHA_GPRELHIGH 17
+#define R_ALPHA_GPRELLOW 18
+#define R_ALPHA_IMMED_GP_16 19
+#define R_ALPHA_IMMED_GP_HI32 20
+#define R_ALPHA_IMMED_SCN_HI32 21
+#define R_ALPHA_IMMED_BR_HI32 22
+#define R_ALPHA_IMMED_LO32 23
+#define R_ALPHA_COPY 24 /* Copy symbol at runtime */
+#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */
+#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */
+#define R_ALPHA_RELATIVE 27 /* Adjust by program base */
+
+/* Legal values for e_flags field of Elf64_Ehdr. */
+
+#define EF_ALPHA_32BIT 1 /* All addresses are below 2GB */
+
+
typedef struct elf32_rel {
Elf32_Addr r_offset;
Elf32_Word r_info;
@@ -528,8 +574,6 @@ typedef struct elf64_note {
Elf32_Word n_type; /* Content type */
} Elf64_Nhdr;
-#define ELF_START_MMAP 0x80000000
-
#if ELF_CLASS == ELFCLASS32
extern Elf32_Dyn _DYNAMIC [];
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index 2fe53ca3d..5c1cb05bd 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -41,8 +41,8 @@ struct elf_prstatus
#endif
struct elf_siginfo pr_info; /* Info associated with signal */
short pr_cursig; /* Current signal */
- sigset_t pr_sigpend; /* Set of pending signals */
- sigset_t pr_sighold; /* Set of held signals */
+ unsigned long pr_sigpend; /* Set of pending signals */
+ unsigned long pr_sighold; /* Set of held signals */
#if 0
struct sigaltstack pr_altstack; /* Alternate stack info */
struct sigaction pr_action; /* Signal action for current sig */
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index c0384391d..9101855c5 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -35,15 +35,14 @@ extern int eth_rebuild_header(struct sk_buff *skb);
extern unsigned short eth_type_trans(struct sk_buff *skb, struct device *dev);
extern void eth_header_cache_update(struct hh_cache *hh, struct device *dev,
unsigned char * haddr);
-extern int eth_header_cache(struct dst_entry *dst,
- struct neighbour *neigh,
+extern int eth_header_cache(struct neighbour *neigh,
struct hh_cache *hh);
extern int eth_header_parse(struct sk_buff *skb,
unsigned char *haddr);
extern struct device * init_etherdev(struct device *, int);
#ifdef CONFIG_IP_ROUTER
-static void inline eth_copy_and_sum (struct sk_buff *dest, unsigned char *src, int len, int base)
+static __inline__ void eth_copy_and_sum (struct sk_buff *dest, unsigned char *src, int len, int base)
{
memcpy (dest->data, src, len);
}
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 604548798..49cdbe2f5 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -499,9 +499,10 @@ extern int ext2_mkdir (struct inode *,struct dentry *,int);
extern int ext2_rmdir (struct inode *,struct dentry *);
extern int ext2_unlink (struct inode *,struct dentry *);
extern int ext2_symlink (struct inode *,struct dentry *,const char *);
-extern int ext2_link (struct inode *, struct inode *, struct dentry *);
+extern int ext2_link (struct dentry *, struct inode *, struct dentry *);
extern int ext2_mknod (struct inode *, struct dentry *, int, int);
-extern int ext2_rename (struct inode *, struct dentry *,struct inode *, struct dentry *);
+extern int ext2_rename (struct inode *, struct dentry *,
+ struct inode *, struct dentry *);
/* super.c */
extern void ext2_error (struct super_block *, const char *, const char *, ...)
diff --git a/include/linux/fat_cvf.h b/include/linux/fat_cvf.h
new file mode 100644
index 000000000..1c4df58f6
--- /dev/null
+++ b/include/linux/fat_cvf.h
@@ -0,0 +1,49 @@
+#ifndef _FAT_CVF
+#define _FAT_CVF
+
+#define CVF_USE_READPAGE 0x0001
+
+struct cvf_format
+{ int cvf_version;
+ char* cvf_version_text;
+ unsigned long flags;
+ int (*detect_cvf) (struct super_block*sb);
+ int (*mount_cvf) (struct super_block*sb,char*options);
+ int (*unmount_cvf) (struct super_block*sb);
+ struct buffer_head* (*cvf_bread) (struct super_block*sb,int block);
+ 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);
+ void (*cvf_set_uptodate) (struct super_block *sb,
+ struct buffer_head *bh,
+ int val);
+ int (*cvf_is_uptodate) (struct super_block *sb,struct buffer_head *bh);
+ void (*cvf_ll_rw_block) (struct super_block *sb,
+ int opr,
+ int nbreq,
+ struct buffer_head *bh[32]);
+ int (*fat_access) (struct super_block *sb,int nr,int new_value);
+ int (*cvf_statfs) (struct super_block *sb,struct statfs *buf, int bufsiz);
+ int (*cvf_bmap) (struct inode *inode,int block);
+ int (*cvf_smap) (struct inode *inode,int sector);
+ ssize_t (*cvf_file_read) ( struct file *, char *, size_t, loff_t *);
+ ssize_t (*cvf_file_write) ( struct file *, const char *, size_t, loff_t *);
+ int (*cvf_mmap) (struct file *, struct vm_area_struct *);
+ int (*cvf_readpage) (struct inode *, struct page *);
+ int (*cvf_writepage) (struct inode *, struct page *);
+ int (*cvf_dir_ioctl) (struct inode * inode, struct file * filp,
+ unsigned int cmd, unsigned long arg);
+ void (*zero_out_cluster) (struct inode*, int clusternr);
+};
+
+int register_cvf_format(struct cvf_format*cvf_format);
+int unregister_cvf_format(struct cvf_format*cvf_format);
+void dec_cvf_format_use_count_by_version(int version);
+int detect_cvf(struct super_block*sb,char*force);
+
+extern struct cvf_format *cvf_formats[];
+extern int cvf_format_use_count[];
+
+#endif
diff --git a/include/linux/fd.h b/include/linux/fd.h
index a32532668..627a9d2bd 100644
--- a/include/linux/fd.h
+++ b/include/linux/fd.h
@@ -116,7 +116,7 @@ typedef char floppy_drive_name[16];
* Drive parameters (user modifiable)
*/
struct floppy_drive_params {
- char cmos; /* cmos type */
+ signed char cmos; /* cmos type */
/* Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms
* etc) and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA).
diff --git a/include/linux/file.h b/include/linux/file.h
index b8cc01f0a..3f3870b9e 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -29,6 +29,7 @@ extern inline int fput(struct file *file)
int error = 0;
if (!count) {
+ locks_remove_flock(file);
error = __fput(file);
file->f_count = 0;
remove_filp(file);
@@ -46,4 +47,12 @@ extern inline void put_filp(struct file *file)
}
}
+/*
+ * Install a file pointer in the files structure.
+ */
+extern inline void fd_install(unsigned long fd, struct file *file)
+{
+ current->files->fd[fd] = file;
+}
+
#endif
diff --git a/include/linux/filter.h b/include/linux/filter.h
new file mode 100644
index 000000000..dcf33554e
--- /dev/null
+++ b/include/linux/filter.h
@@ -0,0 +1,107 @@
+/*
+ * Linux Socket Filter Data Structures
+ */
+
+#ifndef __LINUX_FILTER_H__
+#define __LINUX_FILTER_H__
+
+/*
+ * Current version of the filter code architecture.
+ */
+#define BPF_MAJOR_VERSION 1
+#define BPF_MINOR_VERSION 1
+
+/*
+ * Try and keep these values and structures similar to BSD, especially
+ * the BPF code definitions which need to match so you can share filters
+ */
+
+struct sock_filter /* Filter block */
+{
+ u16 code; /* Actual filter code */
+ u8 jt; /* Jump true */
+ u8 jf; /* Jump false */
+ u32 k; /* Generic multiuse field */
+};
+
+struct sock_fprog /* Required for SO_ATTACH_FILTER. */
+{
+ unsigned short len; /* Number of filter blocks */
+ struct sock_filter *filter;
+};
+
+/*
+ * Instruction classes
+ */
+
+#define BPF_CLASS(code) ((code) & 0x07)
+#define BPF_LD 0x00
+#define BPF_LDX 0x01
+#define BPF_ST 0x02
+#define BPF_STX 0x03
+#define BPF_ALU 0x04
+#define BPF_JMP 0x05
+#define BPF_RET 0x06
+#define BPF_MISC 0x07
+
+/* ld/ldx fields */
+#define BPF_SIZE(code) ((code) & 0x18)
+#define BPF_W 0x00
+#define BPF_H 0x08
+#define BPF_B 0x10
+#define BPF_MODE(code) ((code) & 0xe0)
+#define BPF_IMM 0x00
+#define BPF_ABS 0x20
+#define BPF_IND 0x40
+#define BPF_MEM 0x60
+#define BPF_LEN 0x80
+#define BPF_MSH 0xa0
+
+/* alu/jmp fields */
+#define BPF_OP(code) ((code) & 0xf0)
+#define BPF_ADD 0x00
+#define BPF_SUB 0x10
+#define BPF_MUL 0x20
+#define BPF_DIV 0x30
+#define BPF_OR 0x40
+#define BPF_AND 0x50
+#define BPF_LSH 0x60
+#define BPF_RSH 0x70
+#define BPF_NEG 0x80
+#define BPF_JA 0x00
+#define BPF_JEQ 0x10
+#define BPF_JGT 0x20
+#define BPF_JGE 0x30
+#define BPF_JSET 0x40
+#define BPF_SRC(code) ((code) & 0x08)
+#define BPF_K 0x00
+#define BPF_X 0x08
+
+/* ret - BPF_K and BPF_X also apply */
+#define BPF_RVAL(code) ((code) & 0x18)
+#define BPF_A 0x10
+
+/* misc */
+#define BPF_MISCOP(code) ((code) & 0xf8)
+#define BPF_TAX 0x00
+#define BPF_TXA 0x80
+
+#define BPF_MAXINSNS 512
+
+/*
+ * Macros for filter block array initializers.
+ */
+#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
+#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
+
+/*
+ * Number of scratch memory words for: BPF_ST and BPF_STX
+ */
+#define BPF_MEMWORDS 16
+
+#ifdef __KERNEL__
+extern int sk_run_filter(unsigned char *data, int len, struct sock_filter *filter, int flen);
+extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
+#endif /* __KERNEL__ */
+
+#endif /* __LINUX_FILTER_H__ */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 4c2bcd91c..026d3209e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -17,6 +17,7 @@
#include <linux/ioctl.h>
#include <linux/list.h>
#include <linux/dcache.h>
+#include <linux/stat.h>
#include <asm/atomic.h>
#include <asm/bitops.h>
@@ -43,8 +44,8 @@
/* And dynamically-tunable limits and defaults: */
extern int max_inodes;
extern int max_files, nr_files, nr_free_files;
-#define NR_INODE 4096 /* this should be bigger than NR_FILE */
-#define NR_FILE 1024 /* this can well be larger on a larger system */
+#define NR_INODE 4096 /* This should no longer be bigger than NR_FILE */
+#define NR_FILE 4096 /* this can well be larger on a larger system */
#define NR_RESERVED_FILES 10 /* reserved for root */
#define MAY_EXEC 1
@@ -90,11 +91,12 @@ extern int max_files, nr_files, nr_free_files;
#define S_APPEND 256 /* Append-only file */
#define S_IMMUTABLE 512 /* Immutable file */
#define MS_NOATIME 1024 /* Do not update access times. */
+#define MS_NODIRATIME 2048 /* Do not update directory access times */
/*
* Flags that can be altered by MS_REMOUNT
*/
-#define MS_RMT_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME)
+#define MS_RMT_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|MS_NODIRATIME)
/*
* Magic mount flag number. Has to be or-ed to the flag values.
@@ -121,12 +123,7 @@ extern int max_files, nr_files, nr_free_files;
#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
#define IS_NOATIME(inode) ((inode)->i_flags & MS_NOATIME)
-
-#define UPDATE_ATIME(inode) \
- if (!IS_NOATIME(inode) && !IS_RDONLY(inode)) { \
- inode->i_atime = CURRENT_TIME; \
- mark_inode_dirty(inode); \
- }
+#define IS_NODIRATIME(inode) ((inode)->i_flags & MS_NODIRATIME)
/* the read-only stuff doesn't really belong here, but any other place is
probably as bad and I don't want to create yet another include file. */
@@ -153,6 +150,9 @@ extern int max_files, nr_files, nr_free_files;
#include <asm/byteorder.h>
#include <asm/bitops.h>
+extern void update_atime (struct inode *inode);
+#define UPDATE_ATIME(inode) update_atime (inode)
+
extern void buffer_init(void);
extern void inode_init(void);
extern void file_table_init(void);
@@ -256,6 +256,7 @@ static inline int buffer_protected(struct buffer_head * bh)
#include <linux/minix_fs_i.h>
#include <linux/ext2_fs_i.h>
#include <linux/hpfs_fs_i.h>
+#include <linux/ntfs_fs_i.h>
#include <linux/msdos_fs_i.h>
#include <linux/umsdos_fs_i.h>
#include <linux/iso_fs_i.h>
@@ -263,8 +264,11 @@ static inline int buffer_protected(struct buffer_head * bh)
#include <linux/sysv_fs_i.h>
#include <linux/affs_fs_i.h>
#include <linux/ufs_fs_i.h>
+#include <linux/coda_fs_i.h>
#include <linux/romfs_fs_i.h>
#include <linux/smb_fs_i.h>
+#include <linux/hfs_fs_i.h>
+#include <linux/adfs_fs_i.h>
#include <linux/efs_fs_i.h>
/*
@@ -311,16 +315,18 @@ struct iattr {
#define ATTR_FLAG_NOATIME 2 /* Don't update atime */
#define ATTR_FLAG_APPEND 4 /* Append-only file */
#define ATTR_FLAG_IMMUTABLE 8 /* Immutable file */
+#define ATTR_FLAG_NODIRATIME 16 /* Don't update atime for directory */
#include <linux/quota.h>
struct inode {
struct list_head i_hash;
struct list_head i_list;
+ struct list_head i_dentry;
unsigned long i_ino;
+ unsigned int i_count;
kdev_t i_dev;
- unsigned short i_count;
umode_t i_mode;
nlink_t i_nlink;
uid_t i_uid;
@@ -356,6 +362,7 @@ struct inode {
struct minix_inode_info minix_i;
struct ext2_inode_info ext2_i;
struct hpfs_inode_info hpfs_i;
+ struct ntfs_inode_info ntfs_i;
struct msdos_inode_info msdos_i;
struct umsdos_inode_info umsdos_i;
struct iso_inode_info isofs_i;
@@ -364,7 +371,10 @@ struct inode {
struct affs_inode_info affs_i;
struct ufs_inode_info ufs_i;
struct romfs_inode_info romfs_i;
+ struct coda_inode_info coda_i;
struct smb_inode_info smbfs_i;
+ struct hfs_inode_info hfs_i;
+ struct adfs_inode_info adfs_i;
struct efs_inode_info efs_i;
struct socket socket_i;
void *generic_ip;
@@ -412,13 +422,22 @@ extern int init_private_file(struct file *, struct dentry *, int);
#define FL_ACCESS 8 /* for processes suspended by mandatory locking */
#define FL_LOCKD 16 /* lock held by rpc.lockd */
+/*
+ * The POSIX file lock owner is determined by
+ * the "struct files_struct" in the thread group
+ * (or NULL for no owner - BSD locks).
+ *
+ * Lockd stuffs a "host" pointer into this.
+ */
+typedef struct files_struct *fl_owner_t;
+
struct file_lock {
struct file_lock *fl_next; /* singly linked list for this inode */
struct file_lock *fl_nextlink; /* doubly linked list of all locks */
struct file_lock *fl_prevlink; /* used to simplify lock removal */
struct file_lock *fl_nextblock; /* circular list of blocked processes */
struct file_lock *fl_prevblock;
- void *fl_owner; /* usu. the process' task_struct */
+ fl_owner_t fl_owner;
unsigned int fl_pid;
struct wait_queue *fl_wait;
struct file *fl_file;
@@ -440,7 +459,10 @@ extern struct file_lock *file_lock_table;
extern int fcntl_getlk(unsigned int fd, struct flock *l);
extern int fcntl_setlk(unsigned int fd, unsigned int cmd, struct flock *l);
-extern void locks_remove_locks(struct task_struct *task, struct file *filp);
+
+/* fs/locks.c */
+extern void locks_remove_posix(struct file *, fl_owner_t id);
+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 *);
@@ -494,6 +516,7 @@ extern int fasync_helper(struct file *, int, struct fasync_struct **);
#include <linux/minix_fs_sb.h>
#include <linux/ext2_fs_sb.h>
#include <linux/hpfs_fs_sb.h>
+#include <linux/ntfs_fs_sb.h>
#include <linux/msdos_fs_sb.h>
#include <linux/iso_fs_sb.h>
#include <linux/nfs_fs_sb.h>
@@ -503,6 +526,8 @@ extern int fasync_helper(struct file *, int, struct fasync_struct **);
#include <linux/romfs_fs_sb.h>
#include <linux/efs_fs_sb.h>
#include <linux/smb_fs_sb.h>
+#include <linux/hfs_fs_sb.h>
+#include <linux/adfs_fs_sb.h>
struct super_block {
kdev_t s_dev;
@@ -529,6 +554,7 @@ struct super_block {
struct minix_sb_info minix_sb;
struct ext2_sb_info ext2_sb;
struct hpfs_sb_info hpfs_sb;
+ struct ntfs_sb_info ntfs_sb;
struct msdos_sb_info msdos_sb;
struct isofs_sb_info isofs_sb;
struct nfs_sb_info nfs_sb;
@@ -538,6 +564,8 @@ struct super_block {
struct romfs_sb_info romfs_sb;
struct efs_sb_info efs_sb;
struct smb_sb_info smbfs_sb;
+ struct hfs_sb_info hfs_sb;
+ struct adfs_sb_info adfs_sb;
void *generic_sbp;
} u;
};
@@ -571,24 +599,25 @@ struct inode_operations {
struct file_operations * default_file_ops;
int (*create) (struct inode *,struct dentry *,int);
int (*lookup) (struct inode *,struct dentry *);
- int (*link) (struct inode *,struct inode *,struct dentry *);
+ int (*link) (struct dentry *,struct inode *,struct dentry *);
int (*unlink) (struct inode *,struct dentry *);
int (*symlink) (struct inode *,struct dentry *,const char *);
int (*mkdir) (struct inode *,struct dentry *,int);
int (*rmdir) (struct inode *,struct dentry *);
int (*mknod) (struct inode *,struct dentry *,int,int);
- int (*rename) (struct inode *,struct dentry *,struct inode *,struct dentry *);
- int (*readlink) (struct inode *,char *,int);
- struct dentry * (*follow_link) (struct inode *, struct dentry *);
- int (*readpage) (struct inode *, struct page *);
- int (*writepage) (struct inode *, struct page *);
+ int (*rename) (struct inode *, struct dentry *,
+ struct inode *, struct dentry *);
+ int (*readlink) (struct dentry *, char *,int);
+ struct dentry * (*follow_link) (struct dentry *, struct dentry *);
+ int (*readpage) (struct file *, struct page *);
+ int (*writepage) (struct file *, struct page *);
int (*bmap) (struct inode *,int);
void (*truncate) (struct inode *);
int (*permission) (struct inode *, int);
int (*smap) (struct inode *,int);
- int (*updatepage) (struct inode *, struct page *, const char *,
+ int (*updatepage) (struct file *, struct page *, const char *,
unsigned long, unsigned int, int);
- int (*revalidate) (struct inode *);
+ int (*revalidate) (struct dentry *);
};
struct super_operations {
@@ -596,11 +625,12 @@ struct super_operations {
void (*write_inode) (struct inode *);
void (*put_inode) (struct inode *);
void (*delete_inode) (struct inode *);
- int (*notify_change) (struct inode *, struct iattr *);
+ int (*notify_change) (struct dentry *, struct iattr *);
void (*put_super) (struct super_block *);
void (*write_super) (struct super_block *);
int (*statfs) (struct super_block *, struct statfs *, int);
int (*remount_fs) (struct super_block *, int *, char *);
+ void (*clear_inode) (struct inode *);
};
struct dquot_operations {
@@ -623,14 +653,20 @@ struct file_system_type {
extern int register_filesystem(struct file_system_type *);
extern int unregister_filesystem(struct file_system_type *);
+/* fs/open.c */
+
asmlinkage int sys_open(const char *, int, int);
asmlinkage int sys_close(unsigned int); /* yes, it's really unsigned */
-
-extern void kill_fasync(struct fasync_struct *fa, int sig);
+extern int do_truncate(struct dentry *, unsigned long);
+extern int get_unused_fd(void);
+extern void put_unused_fd(unsigned int);
+extern int __fput(struct file *);
+extern int close_fp(struct file *, fl_owner_t id);
extern char * getname(const char * filename);
extern void putname(char * name);
-extern int do_truncate(struct inode *, unsigned long);
+
+extern void kill_fasync(struct fasync_struct *fa, int sig);
extern int register_blkdev(unsigned int, const char *, struct file_operations *);
extern int unregister_blkdev(unsigned int major, const char * name);
extern int blkdev_open(struct inode * inode, struct file * filp);
@@ -710,13 +746,16 @@ extern void sync_dev(kdev_t dev);
extern int fsync_dev(kdev_t dev);
extern void sync_supers(kdev_t dev);
extern int bmap(struct inode * inode,int block);
-extern int notify_change(struct inode *, struct iattr *);
+extern int notify_change(struct dentry *, struct iattr *);
extern int permission(struct inode * inode,int mask);
extern int get_write_access(struct inode *inode);
extern void put_write_access(struct inode *inode);
extern struct dentry * open_namei(const char * pathname, int flag, int mode);
extern struct dentry * do_mknod(const char * filename, int mode, dev_t dev);
extern int do_pipe(int *);
+
+/* fs/dcache.c -- generic fs support functions */
+extern int is_subdir(struct dentry *, struct dentry *);
extern ino_t find_inode_number(struct dentry *, struct qstr *);
/*
@@ -737,45 +776,17 @@ extern struct dentry * __namei(const char *, int);
#define namei(pathname) __namei(pathname, 1)
#define lnamei(pathname) __namei(pathname, 0)
-#include <asm/semaphore.h>
-
-/* Intended for short locks of the global data structures in inode.c.
- * Could be replaced with spinlocks completely, since there is
- * no blocking during manipulation of the static data; however the
- * lock in invalidate_inodes() may last relatively long.
- */
-extern struct semaphore vfs_sem;
-extern inline void vfs_lock(void)
-{
-#if 0
-#ifdef __SMP__
- down(&vfs_sem);
-#endif
-#endif
-}
-
-extern inline void vfs_unlock(void)
-{
-#if 0
-#ifdef __SMP__
- up(&vfs_sem);
-#endif
-#endif
-}
-
extern void iput(struct inode *);
extern struct inode * iget(struct super_block *, unsigned long);
extern void clear_inode(struct inode *);
extern struct inode * get_empty_inode(void);
extern void insert_inode_hash(struct inode *);
-extern int get_unused_fd(void);
-extern void put_unused_fd(int);
+extern void remove_inode_hash(struct inode *);
extern struct file * get_empty_filp(void);
-extern int close_fp(struct file *);
extern struct buffer_head * get_hash_table(kdev_t, int, int);
extern struct buffer_head * getblk(kdev_t, int, int);
-extern struct buffer_head *efind_buffer(kdev_t dev, int block, int size);
+extern struct buffer_head * find_buffer(kdev_t dev, int block, int size);
extern void ll_rw_block(int, int, struct buffer_head * bh[]);
extern void ll_rw_page(int, kdev_t, unsigned long, char *);
extern void ll_rw_swap_file(int, kdev_t, unsigned int *, int, char *);
@@ -800,7 +811,7 @@ extern struct buffer_head * breada(kdev_t dev,int block, int size,
extern int brw_page(int, struct page *, kdev_t, int [], int, int);
-extern int generic_readpage(struct inode *, struct page *);
+extern int generic_readpage(struct file *, struct page *);
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *);
extern ssize_t generic_file_write(struct file *, const char*, size_t, loff_t*);
@@ -831,7 +842,6 @@ extern int file_fsync(struct file *, struct dentry *dir);
extern int inode_change_ok(struct inode *, struct iattr *);
extern void inode_setattr(struct inode *, struct iattr *);
-extern int notify_change(struct inode * inode, struct iattr * attr);
/* kludge to get SCSI modules working */
#include <linux/minix_fs.h>
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 44e600fc3..c8f38cfde 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -25,10 +25,16 @@
#define CONFIG_SGI_PARTITION 1
#endif
-/* These two have identical behaviour; use the second one if DOS fdisk gets
+/* These three have identical behaviour; use the second one if DOS fdisk gets
confused about extended/logical partitions starting past cylinder 1023. */
#define DOS_EXTENDED_PARTITION 5
#define LINUX_EXTENDED_PARTITION 0x85
+#define WIN98_EXTENDED_PARTITION 0x0f
+#define LINUX_SWAP_PARTITION 0x82
+
+#ifdef CONFIG_SOLARIS_X86_PARTITION
+#define SOLARIS_X86_PARTITION LINUX_SWAP_PARTITION
+#endif
#define DM6_PARTITION 0x54 /* has DDO: use xlated geom & offset */
#define EZD_PARTITION 0x55 /* EZ-DRIVE: same as DM6 (we think) */
@@ -70,6 +76,34 @@ struct gendisk {
struct gendisk *next;
};
+#ifdef CONFIG_SOLARIS_X86_PARTITION
+
+#define SOLARIS_X86_NUMSLICE 8
+#define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL)
+
+struct solaris_x86_slice {
+ ushort s_tag; /* ID tag of partition */
+ ushort s_flag; /* permision flags */
+ daddr_t s_start; /* start sector no of partition */
+ long s_size; /* # of blocks in partition */
+};
+
+struct solaris_x86_vtoc {
+ unsigned long v_bootinfo[3]; /* info needed by mboot (unsupported) */
+ unsigned long v_sanity; /* to verify vtoc sanity */
+ unsigned long v_version; /* layout version */
+ char v_volume[8]; /* volume name */
+ ushort v_sectorsz; /* sector size in bytes */
+ ushort v_nparts; /* number of partitions */
+ unsigned long v_reserved[10]; /* free space */
+ struct solaris_x86_slice
+ v_slice[SOLARIS_X86_NUMSLICE]; /* slice headers */
+ time_t timestamp[SOLARIS_X86_NUMSLICE]; /* timestamp (unsupported) */
+ char v_asciilabel[128]; /* for compatibility */
+};
+
+#endif /* CONFIG_SOLARIS_X86_PARTITION */
+
#ifdef CONFIG_BSD_DISKLABEL
/*
* BSD disklabel support by Yossi Gottlieb <yogo@math.tau.ac.il>
diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h
index b321d292c..d7d4609cb 100644
--- a/include/linux/hdlcdrv.h
+++ b/include/linux/hdlcdrv.h
@@ -1,20 +1,12 @@
/*
* hdlcdrv.h -- HDLC packet radio network driver.
* The Linux soundcard driver for 1200 baud and 9600 baud packet radio
- * (C) 1996 by Thomas Sailer, HB9JNX/AE4WA
+ * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA
*/
#ifndef _HDLCDRV_H
#define _HDLCDRV_H
-#include <linux/version.h>
-#include <linux/sockios.h>
-#include <linux/version.h>
-#if LINUX_VERSION_CODE < 0x20119
-#include <linux/if_ether.h>
-#endif
-#include <linux/netdevice.h>
-
/* -------------------------------------------------------------------- */
/*
* structs for the IOCTL commands
@@ -43,9 +35,6 @@ struct hdlcdrv_old_channel_state {
int ptt;
int dcd;
int ptt_keyed;
-#if LINUX_VERSION_CODE < 0x20100
- struct enet_statistics stats;
-#endif
};
struct hdlcdrv_channel_state {
@@ -115,6 +104,9 @@ struct hdlcdrv_ioctl {
#ifdef __KERNEL__
+#include <linux/netdevice.h>
+#include <linux/if.h>
+
#define HDLCDRV_MAGIC 0x5ac6e778
#define HDLCDRV_IFNAMELEN 6
#define HDLCDRV_HDLCBUFFER 32 /* should be a power of 2 for speed reasons */
diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h
index 35db77dc9..9be5bd1b1 100644
--- a/include/linux/hdreg.h
+++ b/include/linux/hdreg.h
@@ -62,11 +62,25 @@
#define WIN_READDMA 0xc8 /* read sectors using DMA transfers */
#define WIN_WRITEDMA 0xca /* write sectors using DMA transfers */
+#define WIN_SMART 0xb0 /* self-monitoring and reporting */
+
/* Additional drive command codes used by ATAPI devices. */
#define WIN_PIDENTIFY 0xA1 /* identify ATAPI device */
#define WIN_SRST 0x08 /* ATAPI soft reset command */
#define WIN_PACKETCMD 0xa0 /* Send a packet command. */
+/* WIN_SMART sub-commands */
+
+#define SMART_READ_VALUES 0xd0
+#define SMART_READ_THRESHOLDS 0xd1
+#define SMART_AUTOSAVE 0xd2
+#define SMART_SAVE 0xd3
+#define SMART_IMMEDIATE_OFFLINE 0xd4
+#define SMART_ENABLE 0xd8
+#define SMART_DISABLE 0xd9
+#define SMART_STATUS 0xda
+#define SMART_AUTO_OFFLINE 0xdb
+
/* Bits for HD_ERROR */
#define MARK_ERR 0x01 /* Bad address mark */
#define TRK0_ERR 0x02 /* couldn't find track 0 */
diff --git a/include/linux/hfs_fs.h b/include/linux/hfs_fs.h
new file mode 100644
index 000000000..de51db0b1
--- /dev/null
+++ b/include/linux/hfs_fs.h
@@ -0,0 +1,324 @@
+/*
+ * linux/include/linux/hfs_fs.h
+ *
+ * Copyright (C) 1995-1997 Paul H. Hargrove
+ * This file may be distributed under the terms of the GNU Public License.
+ *
+ * The source code distribution of the Columbia AppleTalk Package for
+ * UNIX, version 6.0, (CAP) was used as a specification of the
+ * location and format of files used by CAP's Aufs. No code from CAP
+ * appears in hfs_fs. hfs_fs is not a work ``derived'' from CAP in
+ * the sense of intellectual property law.
+ *
+ * The source code distributions of Netatalk, versions 1.3.3b2 and
+ * 1.4b2, were used as a specification of the location and format of
+ * files used by Netatalk's afpd. No code from Netatalk appears in
+ * hfs_fs. hfs_fs is not a work ``derived'' from Netatalk in the
+ * sense of intellectual property law.
+ */
+
+#ifndef _LINUX_HFS_FS_H
+#define _LINUX_HFS_FS_H
+
+#include <linux/hfs_sysdep.h>
+
+/* magic numbers for Apple Double header files */
+#define HFS_DBL_MAGIC 0x00051607
+#define HFS_SNGL_MAGIC 0x00051600
+#define HFS_HDR_VERSION_1 0x00010000
+#define HFS_HDR_VERSION_2 0x00020000
+
+/* magic numbers for various internal structures */
+#define HFS_INO_MAGIC 0x4821
+#define HFS_SB_MAGIC 0x4822
+
+/* The space used for the AppleDouble or AppleSingle headers */
+#define HFS_DBL_HDR_LEN 1024
+
+/* The space used for the Netatalk header */
+#define HFS_NAT_HDR_LEN 1024 /* 589 for an exact match */
+
+/* Macros to extract CNID and file "type" from the Linux inode number */
+#define HFS_CNID(X) ((X) & 0x3FFFFFFF)
+#define HFS_ITYPE(X) ((X) & 0xC0000000)
+
+/* Macros to enumerate types */
+#define HFS_ITYPE_TO_INT(X) ((X) >> 30)
+#define HFS_INT_TO_ITYPE(X) ((X) << 30)
+
+/* generic ITYPEs */
+#define HFS_ITYPE_0 0x00000000
+#define HFS_ITYPE_1 0x40000000
+#define HFS_ITYPE_2 0x80000000
+#define HFS_ITYPE_3 0xC0000000
+#define HFS_ITYPE_NORM HFS_ITYPE_0 /* "normal" directory or file */
+
+/* ITYPEs for CAP */
+#define HFS_CAP_NORM HFS_ITYPE_0 /* data fork or normal directory */
+#define HFS_CAP_DATA HFS_ITYPE_0 /* data fork of file */
+#define HFS_CAP_NDIR HFS_ITYPE_0 /* normal directory */
+#define HFS_CAP_FNDR HFS_ITYPE_1 /* finder info for file or dir */
+#define HFS_CAP_RSRC HFS_ITYPE_2 /* resource fork of file */
+#define HFS_CAP_RDIR HFS_ITYPE_2 /* .resource directory */
+#define HFS_CAP_FDIR HFS_ITYPE_3 /* .finderinfo directory */
+
+/* ITYPEs for Apple Double */
+#define HFS_DBL_NORM HFS_ITYPE_0 /* data fork or directory */
+#define HFS_DBL_DATA HFS_ITYPE_0 /* data fork of file */
+#define HFS_DBL_DIR HFS_ITYPE_0 /* directory */
+#define HFS_DBL_HDR HFS_ITYPE_1 /* AD header of file or dir */
+
+/* ITYPEs for netatalk */
+#define HFS_NAT_NORM HFS_ITYPE_0 /* data fork or directory */
+#define HFS_NAT_DATA HFS_ITYPE_0 /* data fork of file */
+#define HFS_NAT_NDIR HFS_ITYPE_0 /* normal directory */
+#define HFS_NAT_HDR HFS_ITYPE_1 /* AD header of file or dir */
+#define HFS_NAT_HDIR HFS_ITYPE_2 /* directory holding AD headers */
+
+/* ITYPEs for Apple Single */
+#define HFS_SGL_NORM HFS_ITYPE_0 /* AppleSingle file or directory */
+#define HFS_SGL_SNGL HFS_ITYPE_0 /* AppleSingle file */
+#define HFS_SGL_DIR HFS_ITYPE_0 /* directory */
+#define HFS_SGL_DINF HFS_ITYPE_1 /* %DirInfo for directory */
+
+/* IDs for elements of an AppleDouble or AppleSingle header */
+#define HFS_HDR_DATA 1
+#define HFS_HDR_RSRC 2
+#define HFS_HDR_FNAME 3
+#define HFS_HDR_COMNT 4
+#define HFS_HDR_BWICN 5
+#define HFS_HDR_CICON 6
+#define HFS_HDR_OLDI 7
+#define HFS_HDR_DATES 8
+#define HFS_HDR_FINFO 9
+#define HFS_HDR_MACI 10
+#define HFS_HDR_MAX 10
+
+/*
+ * There are three time systems. All three are based on seconds since
+ * a particular time/date.
+ * Unix: unsigned lil-endian since 00:00 GMT, Jan. 1, 1970
+ * mac: unsigned big-endian since 00:00 GMT, Jan. 1, 1904
+ * header: SIGNED big-endian since 00:00 GMT, Jan. 1, 2000
+ *
+ */
+#define hfs_h_to_mtime(ARG) htonl((hfs_s32)ntohl(ARG)+3029529600U)
+#define hfs_m_to_htime(ARG) ((hfs_s32)htonl(ntohl(ARG)-3029529600U))
+#define hfs_h_to_utime(ARG) ((hfs_s32)ntohl(ARG)+946684800U)
+#define hfs_u_to_htime(ARG) ((hfs_s32)htonl((ARG)-946684800U))
+#define hfs_u_to_mtime(ARG) htonl((ARG)+2082844800U)
+#define hfs_m_to_utime(ARG) (ntohl(ARG)-2082844800U)
+
+/*======== Data structures kept in memory ========*/
+
+/*
+ * A descriptor for a single entry within the header of an
+ * AppleDouble or AppleSingle header file.
+ * An array of these make up a table of contents for the file.
+ */
+struct hfs_hdr_descr {
+ hfs_u32 id; /* The Apple assigned ID for the entry type */
+ hfs_u32 offset; /* The offset to reach the entry */
+ hfs_u32 length; /* The length of the entry */
+};
+
+/*
+ * The info needed to reconstruct a given header layout
+ */
+struct hfs_hdr_layout {
+ hfs_u32 magic; /* AppleSingle or AppleDouble */
+ hfs_u32 version; /* 0x00010000 or 0x00020000 */
+ hfs_u16 entries; /* How many entries used */
+ struct hfs_hdr_descr
+ descr[HFS_HDR_MAX]; /* Descriptors */
+ struct hfs_hdr_descr
+ *order[HFS_HDR_MAX]; /* 'descr' ordered by offset */
+};
+
+/*
+ * Default header layout for Netatalk
+ */
+struct hfs_nat_hdr {
+ hfs_lword_t magic;
+ hfs_lword_t version;
+ hfs_byte_t homefs[16];
+ hfs_word_t entries;
+ hfs_byte_t descrs[60];
+ hfs_byte_t real_name[255]; /* id=3 */
+ hfs_byte_t comment[200]; /* id=4 XXX: not yet implemented */
+ hfs_lword_t create_time; /* \ */
+ hfs_lword_t modify_time; /* | */
+ hfs_lword_t backup_time; /* | id=7 */
+ hfs_word_t filler; /* | */
+ hfs_word_t attr; /* / */
+ hfs_byte_t finderinfo[32]; /* id=9 */
+};
+
+/*
+ * Default header layout for AppleDouble
+ */
+struct hfs_dbl_hdr {
+ hfs_lword_t magic;
+ hfs_lword_t version;
+ hfs_byte_t filler[16];
+ hfs_word_t entries;
+ hfs_byte_t descrs[12*HFS_HDR_MAX];
+ hfs_u32 create_time; /* \ */
+ hfs_u32 modify_time; /* | id=8 */
+ hfs_u32 backup_time; /* | */
+ hfs_u32 access_time; /* / */
+ hfs_u8 finderinfo[32]; /* id=9 */
+ hfs_u32 fileinfo; /* id=10 */
+ hfs_u8 real_name[32]; /* id=3 */
+ hfs_u8 comment[200]; /* id=4 XXX: not yet implemented */
+};
+
+/* finder metadata for CAP */
+struct hfs_cap_info {
+ hfs_byte_t fi_fndr[32]; /* Finder's info */
+ hfs_word_t fi_attr; /* AFP attributes */
+#define HFS_AFP_WRI 0x020 /* Write inhibit bit */
+#define HFS_AFP_RNI 0x080 /* Rename inhibit bit (AFP >= 2.0) */
+#define HFS_AFP_DEI 0x100 /* Delete inhibit bit (AFP >= 2.0) */
+#define HFS_AFP_RDONLY ( HFS_AFP_WRI|HFS_AFP_RNI|HFS_AFP_DEI)
+ hfs_byte_t fi_magic1; /* Magic number: */
+#define HFS_CAP_MAGIC1 0xFF
+ hfs_byte_t fi_version; /* Version of this structure: */
+#define HFS_CAP_VERSION 0x10
+ hfs_byte_t fi_magic; /* Another magic number: */
+#define HFS_CAP_MAGIC 0xDA
+ hfs_byte_t fi_bitmap; /* Bitmap of which names are valid: */
+#define HFS_CAP_SHORTNAME 0x01
+#define HFS_CAP_LONGNAME 0x02
+ hfs_byte_t fi_shortfilename[12+1]; /* "short name" (unused) */
+ hfs_byte_t fi_macfilename[32+1]; /* Original (Macintosh) name */
+ hfs_byte_t fi_comln; /* Length of comment (always 0) */
+ hfs_byte_t fi_comnt[200]; /* Finder comment (unused) */
+ /* optional: used by aufs only if compiled with USE_MAC_DATES */
+ hfs_byte_t fi_datemagic; /* Magic number for dates extension: */
+#define HFS_CAP_DMAGIC 0xDA
+ hfs_byte_t fi_datevalid; /* Bitmap of which dates are valid: */
+#define HFS_CAP_MDATE 0x01
+#define HFS_CAP_CDATE 0x02
+ hfs_lword_t fi_ctime; /* Creation date (in AFP format) */
+ hfs_lword_t fi_mtime; /* Modify date (in AFP format) */
+ hfs_lword_t fi_utime; /* Un*x time of last mtime change */
+ hfs_byte_t pad;
+};
+
+#ifdef __KERNEL__
+
+typedef ssize_t hfs_rwret_t;
+typedef size_t hfs_rwarg_t;
+
+#include <asm/uaccess.h>
+
+/* Some forward declarations */
+struct hfs_fork;
+struct hfs_cat_key;
+struct hfs_cat_entry;
+extern struct hfs_cat_entry *hfs_cat_get(struct hfs_mdb *,
+ const struct hfs_cat_key *);
+
+/* dir.c */
+extern hfs_rwret_t hfs_dir_read(struct file *, char *, hfs_rwarg_t,
+ loff_t *);
+extern int hfs_create(struct inode *, struct dentry *, int);
+extern int hfs_mkdir(struct inode *, struct dentry *, int);
+extern int hfs_mknod(struct inode *, struct dentry *, int, int);
+extern int hfs_unlink(struct inode *, struct dentry *);
+extern int hfs_rmdir(struct inode *, struct dentry *);
+extern int hfs_rename(struct inode *, struct dentry *,
+ struct inode *, struct dentry *);
+
+/* dir_cap.c */
+extern const struct hfs_name hfs_cap_reserved1[];
+extern const struct hfs_name hfs_cap_reserved2[];
+extern struct inode_operations hfs_cap_ndir_inode_operations;
+extern struct inode_operations hfs_cap_fdir_inode_operations;
+extern struct inode_operations hfs_cap_rdir_inode_operations;
+extern void hfs_cap_drop_dentry(const ino_t, struct dentry *);
+
+/* dir_dbl.c */
+extern const struct hfs_name hfs_dbl_reserved1[];
+extern const struct hfs_name hfs_dbl_reserved2[];
+extern struct inode_operations hfs_dbl_dir_inode_operations;
+extern void hfs_dbl_drop_dentry(const ino_t, struct dentry *);
+
+/* dir_nat.c */
+extern const struct hfs_name hfs_nat_reserved1[];
+extern const struct hfs_name hfs_nat_reserved2[];
+extern struct inode_operations hfs_nat_ndir_inode_operations;
+extern struct inode_operations hfs_nat_hdir_inode_operations;
+extern void hfs_nat_drop_dentry(const ino_t, struct dentry *);
+
+/* dir_sngl.c */
+extern const struct hfs_name hfs_sngl_reserved1[];
+extern const struct hfs_name hfs_sngl_reserved2[];
+extern struct inode_operations hfs_sngl_dir_inode_operations;
+
+/* file.c */
+extern hfs_s32 hfs_do_read(struct inode *, struct hfs_fork *, hfs_u32,
+ char *, hfs_u32, int);
+extern hfs_s32 hfs_do_write(struct inode *, struct hfs_fork *, hfs_u32,
+ const char *, hfs_u32);
+extern void hfs_file_fix_mode(struct hfs_cat_entry *entry);
+extern struct inode_operations hfs_file_inode_operations;
+
+/* file_cap.c */
+extern struct inode_operations hfs_cap_info_inode_operations;
+
+/* file_hdr.c */
+extern struct inode_operations hfs_hdr_inode_operations;
+extern const struct hfs_hdr_layout hfs_dbl_fil_hdr_layout;
+extern const struct hfs_hdr_layout hfs_dbl_dir_hdr_layout;
+extern const struct hfs_hdr_layout hfs_nat_hdr_layout;
+extern const struct hfs_hdr_layout hfs_sngl_hdr_layout;
+
+/* inode.c */
+extern void hfs_put_inode(struct inode *);
+extern int hfs_notify_change(struct dentry *, struct iattr *);
+extern struct inode *hfs_iget(struct hfs_cat_entry *, ino_t, struct dentry *);
+
+extern void hfs_cap_ifill(struct inode *, ino_t);
+extern void hfs_dbl_ifill(struct inode *, ino_t);
+extern void hfs_nat_ifill(struct inode *, ino_t);
+extern void hfs_sngl_ifill(struct inode *, ino_t);
+
+/* super.c */
+extern struct super_block *hfs_read_super(struct super_block *,void *,int);
+extern int init_hfs_fs(void);
+
+/* trans.c */
+extern void hfs_colon2mac(struct hfs_name *, const char *, int);
+extern void hfs_prcnt2mac(struct hfs_name *, const char *, int);
+extern void hfs_triv2mac(struct hfs_name *, const char *, int);
+extern void hfs_latin2mac(struct hfs_name *, const char *, int);
+extern int hfs_mac2cap(char *, const struct hfs_name *);
+extern int hfs_mac2nat(char *, const struct hfs_name *);
+extern int hfs_mac2latin(char *, const struct hfs_name *);
+extern int hfs_mac2seven(char *, const struct hfs_name *);
+extern int hfs_mac2eight(char *, const struct hfs_name *);
+extern int hfs_mac2alpha(char *, const struct hfs_name *);
+extern int hfs_mac2triv(char *, const struct hfs_name *);
+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,
+ 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,
+ const struct hfs_name *in) {
+ int len = HFS_SB(dir->i_sb)->s_namein(out, in);
+ if (HFS_SB(dir->i_sb)->s_lowercase) {
+ hfs_tolower(out, len);
+ }
+ return len;
+}
+
+#endif /* __KERNEL__ */
+#endif
diff --git a/include/linux/hfs_fs_i.h b/include/linux/hfs_fs_i.h
new file mode 100644
index 000000000..cf9ed53e0
--- /dev/null
+++ b/include/linux/hfs_fs_i.h
@@ -0,0 +1,40 @@
+/*
+ * linux/include/linux/hfs_fs_i.h
+ *
+ * Copyright (C) 1995, 1996 Paul H. Hargrove
+ * This file may be distributed under the terms of the GNU Public License.
+ *
+ * This file defines the type (struct hfs_inode_info) and the two
+ * subordinate types hfs_extent and hfs_file.
+ */
+
+#ifndef _LINUX_HFS_FS_I_H
+#define _LINUX_HFS_FS_I_H
+
+/*
+ * struct hfs_inode_info
+ *
+ * The HFS-specific part of a Linux (struct inode)
+ */
+struct hfs_inode_info {
+ int magic; /* A magic number */
+
+ struct hfs_cat_entry *entry;
+
+ /* For a regular or header file */
+ struct hfs_fork *fork;
+ int convert;
+
+ /* For a directory */
+ ino_t file_type;
+ char dir_size;
+
+ /* For header files */
+ const struct hfs_hdr_layout *default_layout;
+ struct hfs_hdr_layout *layout;
+
+ /* for dentry cleanup */
+ void (*d_drop_op)(const ino_t, struct dentry *);
+};
+
+#endif
diff --git a/include/linux/hfs_fs_sb.h b/include/linux/hfs_fs_sb.h
new file mode 100644
index 000000000..c5279b201
--- /dev/null
+++ b/include/linux/hfs_fs_sb.h
@@ -0,0 +1,52 @@
+/*
+ * linux/include/linux/hfs_fs_sb.h
+ *
+ * Copyright (C) 1995-1997 Paul H. Hargrove
+ * This file may be distributed under the terms of the GNU Public License.
+ *
+ * This file defines the type (struct hfs_sb_info) which contains the
+ * HFS-specific information in the in-core superblock.
+ */
+
+#ifndef _LINUX_HFS_FS_SB_H
+#define _LINUX_HFS_FS_SB_H
+
+/* forward declaration: */
+struct hfs_name;
+
+typedef int (*hfs_namein_fn) (char *, const struct hfs_name *);
+typedef void (*hfs_nameout_fn) (struct hfs_name *, const char *, int);
+typedef void (*hfs_ifill_fn) (struct inode *, ino_t);
+
+/*
+ * struct hfs_sb_info
+ *
+ * The HFS-specific part of a Linux (struct super_block)
+ */
+struct hfs_sb_info {
+ int magic; /* A magic number */
+ struct hfs_mdb *s_mdb; /* The HFS MDB */
+ int s_quiet; /* Silent failure when
+ changing owner or mode? */
+ int s_lowercase; /* Map names to lowercase? */
+ int s_afpd; /* AFPD compatible mode? */
+ hfs_namein_fn s_namein; /* The function used to
+ map Mac filenames to
+ Linux filenames */
+ hfs_nameout_fn s_nameout; /* The function used to
+ map Linux filenames
+ to Mac filenames */
+ hfs_ifill_fn s_ifill; /* The function used
+ to fill in inode fields */
+ const struct hfs_name *s_reserved1; /* Reserved names */
+ const struct hfs_name *s_reserved2; /* Reserved names */
+ __u32 s_type; /* Type for new files */
+ __u32 s_creator; /* Creator for new files */
+ umode_t s_umask; /* The umask applied to the
+ permissions on all files */
+ uid_t s_uid; /* The uid of all files */
+ gid_t s_gid; /* The gid of all files */
+ char s_conv; /* Type of text conversion */
+};
+
+#endif
diff --git a/include/linux/hfs_sysdep.h b/include/linux/hfs_sysdep.h
new file mode 100644
index 000000000..93de05aad
--- /dev/null
+++ b/include/linux/hfs_sysdep.h
@@ -0,0 +1,224 @@
+/*
+ * linux/include/linux/hfs_sysdep.h
+ *
+ * Copyright (C) 1996-1997 Paul H. Hargrove
+ * This file may be distributed under the terms of the GNU Public License.
+ *
+ * This file contains constants, types and inline
+ * functions for various system dependent things.
+ *
+ * "XXX" in a comment is a note to myself to consider changing something.
+ *
+ * In function preconditions the term "valid" applied to a pointer to
+ * a structure means that the pointer is non-NULL and the structure it
+ * points to has all fields initialized to consistent values.
+ */
+
+#ifndef _HFS_SYSDEP_H
+#define _HFS_SYSDEP_H
+
+#include <linux/malloc.h>
+#include <linux/types.h>
+#include <linux/locks.h>
+#include <linux/fs.h>
+
+#include <asm/byteorder.h>
+#include <asm/unaligned.h>
+
+
+#undef offsetof
+#define offsetof(TYPE, MEMB) ((size_t) &((TYPE *)0)->MEMB)
+
+/* Typedefs for integer types by size and signedness */
+typedef __u8 hfs_u8;
+typedef __u16 hfs_u16;
+typedef __u32 hfs_u32;
+typedef __s8 hfs_s8;
+typedef __s16 hfs_s16;
+typedef __s32 hfs_s32;
+
+/* Typedefs for unaligned integer types */
+typedef unsigned char hfs_byte_t;
+typedef unsigned char hfs_word_t[2];
+typedef unsigned char hfs_lword_t[4];
+
+/* these funny looking things are GCC variable argument macros */
+#define hfs_warn(format, args...) printk(KERN_WARNING format , ## args)
+#define hfs_error(format, args...) printk(KERN_ERR format , ## args)
+
+
+#if defined(DEBUG_ALL) || defined(DEBUG_MEM)
+extern long int hfs_alloc;
+#endif
+
+extern 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__);
+#endif
+ return kmalloc(size, GFP_KERNEL);
+}
+
+extern inline void hfs_free(void *ptr, unsigned int size) {
+ kfree_s(ptr, size);
+#if defined(DEBUG_ALL) || defined(DEBUG_MEM)
+ hfs_warn("%ld bytes allocation at %s:%u\n",
+ (hfs_alloc -= ptr ? size : 0), __FILE__, __LINE__);
+#endif
+}
+
+
+extern inline hfs_u32 hfs_time(void) {
+ return htonl(CURRENT_TIME+2082844800U);
+}
+
+
+/*
+ * hfs_wait_queue
+ */
+typedef struct wait_queue *hfs_wait_queue;
+
+extern inline void hfs_sleep_on(hfs_wait_queue *queue) {
+ sleep_on(queue);
+}
+
+extern inline void hfs_wake_up(hfs_wait_queue *queue) {
+ wake_up(queue);
+}
+
+extern inline void hfs_relinquish(void) {
+ schedule();
+}
+
+
+/*
+ * hfs_sysmdb
+ */
+typedef struct super_block *hfs_sysmdb;
+
+extern inline void hfs_mdb_dirty(hfs_sysmdb sys_mdb) {
+ sys_mdb->s_dirt = 1;
+}
+
+extern inline char *hfs_mdb_name(hfs_sysmdb sys_mdb) {
+ return kdevname(sys_mdb->s_dev);
+}
+
+
+/*
+ * hfs_sysentry
+ */
+typedef struct dentry *hfs_sysentry[4];
+
+/*
+ * hfs_buffer
+ */
+typedef struct buffer_head *hfs_buffer;
+
+#define HFS_BAD_BUFFER NULL
+
+/* 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) {
+ return (buffer != NULL);
+}
+
+extern inline void hfs_buffer_put(hfs_buffer buffer) {
+ brelse(buffer);
+}
+
+extern inline void hfs_buffer_dirty(hfs_buffer buffer) {
+ mark_buffer_dirty(buffer, 1);
+}
+
+extern inline void hfs_buffer_sync(hfs_buffer buffer) {
+ while (buffer_locked(buffer)) {
+ wait_on_buffer(buffer);
+ }
+ if (buffer_dirty(buffer)) {
+ ll_rw_block(WRITE, 1, &buffer);
+ wait_on_buffer(buffer);
+ }
+}
+
+extern inline void *hfs_buffer_data(const hfs_buffer buffer) {
+ return buffer->b_data;
+}
+
+
+/*
+ * bit operations
+ */
+
+#undef BITNR
+#if defined(__BIG_ENDIAN)
+# define BITNR(X) ((X)^31)
+# if !defined(__constant_htonl)
+# define __constant_htonl(x) (x)
+# endif
+# if !defined(__constant_htons)
+# define __constant_htons(x) (x)
+# endif
+#elif defined(__LITTLE_ENDIAN)
+# define BITNR(X) ((X)^7)
+# if !defined(__constant_htonl)
+# define __constant_htonl(x) \
+ ((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \
+ (((unsigned long int)(x) & 0x0000ff00U) << 8) | \
+ (((unsigned long int)(x) & 0x00ff0000U) >> 8) | \
+ (((unsigned long int)(x) & 0xff000000U) >> 24)))
+# endif
+# if !defined(__constant_htons)
+# define __constant_htons(x) \
+ ((unsigned short int)((((unsigned short int)(x) & 0x00ff) << 8) | \
+ (((unsigned short int)(x) & 0xff00) >> 8)))
+# endif
+#else
+# error "Don't know if bytes are big- or little-endian!"
+#endif
+
+extern 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) {
+ return test_and_set_bit(BITNR(bitnr), lword);
+}
+
+extern 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);
+}
+
+#undef BITNR
+
+/*
+ * HFS structures have fields aligned to 16-bit boundaries.
+ * So, 16-bit get/put are easy while 32-bit get/put need
+ * some care on architectures like the DEC Alpha.
+ *
+ * In what follows:
+ * ns = 16-bit integer in network byte-order w/ 16-bit alignment
+ * hs = 16-bit integer in host byte-order w/ 16-bit alignment
+ * nl = 32-bit integer in network byte-order w/ unknown alignment
+ * hl = 32-bit integer in host byte-order w/ unknown alignment
+ * anl = 32-bit integer in network byte-order w/ 32-bit alignment
+ * ahl = 32-bit integer in host byte-order w/ 32-bit alignment
+ * Example: hfs_get_hl() gets an unaligned 32-bit integer converting
+ * it to host byte-order.
+ */
+#define hfs_get_hs(addr) ntohs(*((hfs_u16 *)(addr)))
+#define hfs_get_ns(addr) (*((hfs_u16 *)(addr)))
+#define hfs_get_hl(addr) ntohl(get_unaligned((hfs_u32 *)(addr)))
+#define hfs_get_nl(addr) get_unaligned((hfs_u32 *)(addr))
+#define hfs_get_ahl(addr) ntohl(*((hfs_u32 *)(addr)))
+#define hfs_get_anl(addr) (*((hfs_u32 *)(addr)))
+#define hfs_put_hs(val, addr) ((void)(*((hfs_u16 *)(addr)) = ntohs(val)))
+#define hfs_put_ns(val, addr) ((void)(*((hfs_u16 *)(addr)) = (val)))
+#define hfs_put_hl(val, addr) put_unaligned(htonl(val), (hfs_u32 *)(addr))
+#define hfs_put_nl(val, addr) put_unaligned((val), (hfs_u32 *)(addr))
+#define hfs_put_ahl(val, addr) ((void)(*((hfs_u32 *)(addr)) = ntohl(val)))
+#define hfs_put_anl(val, addr) ((void)(*((hfs_u32 *)(addr)) = (val)))
+
+#endif
diff --git a/include/linux/if.h b/include/linux/if.h
index bd98fb029..87b6692c8 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -43,7 +43,7 @@
#define IFF_PORTSEL 0x2000 /* can set media type */
#define IFF_AUTOMEDIA 0x4000 /* auto media select active */
-
+#define IFF_NODYNARP 0x8000 /* use static ARP only (HIPPI) */
/*
* The ifaddr structure contains information about one address
* of an interface. They are maintained by the different address
@@ -132,6 +132,7 @@ struct ifreq
#define ifr_data ifr_ifru.ifru_data /* for use by interface */
#define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
#define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
+#define ifr_qlen ifr_ifru.ifru_ivalue /* Queue length */
/*
* Structure used in SIOCGIFCONF request.
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index e63cb85a6..8183b8e94 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -96,7 +96,6 @@ struct arpreq_old {
#define ATF_NETMASK 0x20 /* want to use a netmask (only
for proxy entries) */
#define ATF_DONTPUB 0x40 /* don't answer this addresses */
-#define ATF_MAGIC 0x80 /* automatically added entry */
/*
* This structure defines an ethernet arp header.
@@ -122,20 +121,4 @@ struct arphdr
};
-/* Support for the user space arp daemon, arpd */
-
-#define ARPD_UPDATE 0x01
-#define ARPD_LOOKUP 0x02
-#define ARPD_FLUSH 0x03
-
-struct arpd_request
-{
- unsigned short req; /* request type */
- __u32 ip; /* ip address of entry */
- unsigned long dev; /* Device entry is tied to */
- unsigned long stamp;
- unsigned long updated;
- unsigned char ha[MAX_ADDR_LEN]; /* Hardware address */
-};
-
#endif /* _LINUX_IF_ARP_H */
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index 0ac234125..3bdeca342 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -25,8 +25,9 @@ struct sockaddr_ll
#define PACKET_BROADCAST 1 /* To all */
#define PACKET_MULTICAST 2 /* To group */
#define PACKET_OTHERHOST 3 /* To someone else */
-#define PACKET_OUTGOING 4 /* Originated by us */
-#define PACKET_NDISC 17 /* Outgoing NDISC packet*/
+#define PACKET_OUTGOING 4 /* Originated by us */
+#define PACKET_LOOPBACK 5
+#define PACKET_FASTROUTE 6
/* Packet socket options */
diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
index 1d3a750d8..5811992db 100644
--- a/include/linux/if_ppp.h
+++ b/include/linux/if_ppp.h
@@ -1,4 +1,4 @@
-/* $Id: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp $ */
+/* $Id: if_ppp.h,v 1.2 1998/01/01 15:05:12 phil Exp $ */
/*
* if_ppp.h - Point-to-Point Protocol definitions.
@@ -21,7 +21,7 @@
*/
/*
- * ==FILEVERSION 960109==
+ * ==FILEVERSION 971223==
*
* NOTE TO MAINTAINERS:
* If you modify this file at all, please set the above date.
@@ -47,7 +47,7 @@
#define PPP_MTU 1500 /* Default MTU (size of Info field) */
#define PPP_MAXMRU 65000 /* Largest MRU we allow */
-#define PPP_VERSION "2.2.0"
+#define PPP_VERSION "2.3.3"
#define PPP_MAGIC 0x5002 /* Magic value for the ppp structure */
#define PROTO_IPX 0x002b /* protocol numbers */
#define PROTO_DNA_RT 0x0027 /* DNA Routing */
diff --git a/include/linux/if_pppvar.h b/include/linux/if_pppvar.h
index 720e5cdad..c1fe88ab4 100644
--- a/include/linux/if_pppvar.h
+++ b/include/linux/if_pppvar.h
@@ -1,4 +1,4 @@
-/* $Id: if_pppvar.h,v 1.4 1997/09/03 11:55:06 ecd Exp $ */
+/* From: if_pppvar.h,v 1.2 1995/06/12 11:36:51 paulus Exp */
/*
* if_pppvar.h - private structures and declarations for PPP.
*
@@ -42,7 +42,7 @@
*/
/*
- * ==FILEVERSION 960302==
+ * ==FILEVERSION 971001==
*
* NOTE TO MAINTAINERS:
* If you modify this file at all, please set the above date.
@@ -79,7 +79,7 @@ struct ppp_buffer {
/* =2, daemon write buffer */
/* =3, daemon read buffer */
__u16 fcs; /* Frame Check Sequence (CRC) */
- __u8 filler[4]; /* Extra space if needed */
+ __u16 magic; /* Extra space if needed */
};
/* Given a pointer to the ppp_buffer then return base address of buffer */
@@ -91,6 +91,7 @@ struct ppp_buffer {
struct ppp {
__s32 magic; /* magic value for structure */
+ struct ppp *next; /* unit with next index */
/* Bitmapped flag fields. */
unsigned long inuse; /* are we allocated? */
@@ -104,27 +105,26 @@ struct ppp {
__u32 recv_async_map; /* 1 bit means that given control
character is ignored on input*/
- __s32 mtu; /* maximum xmit frame size */
- __s32 mru; /* maximum receive frame size */
+ __s32 mtu; /* maximum xmit frame size */
+ __s32 mru; /* maximum receive frame size */
/* Information about the current tty data */
- __s32 line; /* PPP channel number */
- struct tty_struct *tty; /* ptr to TTY structure */
- __s32 bytes_sent; /* Bytes sent on frame */
- __s32 bytes_rcvd; /* Bytes recvd on frame */
-
- /* Interface to the network layer */
- struct device *dev; /* easy for intr handling */
+ __s32 line; /* PPP channel number */
+ struct tty_struct *tty; /* ptr to TTY structure */
+ struct tty_struct *backup_tty; /* TTY to use if tty gets closed */
+ __s32 bytes_sent; /* Bytes sent on frame */
+ __s32 bytes_rcvd; /* Bytes recvd on frame */
/* VJ Header compression data */
- struct slcompress *slcomp; /* for header compression */
+ struct slcompress *slcomp; /* for header compression */
/* Transmission information */
struct ppp_buffer *xbuf; /* Buffer currently being sent */
struct ppp_buffer *s1buf; /* Pointer to daemon buffer */
struct ppp_buffer *s2buf; /* Pointer to device buffer */
- __u32 last_xmit; /* time of last transmission */
+ unsigned long last_xmit; /* time of last transmission */
+ unsigned long last_recv; /* time last packet received */
/* These are pointers to the malloc()ed frame buffers.
These buffers are used while processing a packet. If a packet
@@ -142,8 +142,7 @@ struct ppp {
struct wait_queue *read_wait; /* queue for writing processes */
/* Statistic information */
- struct pppstat stats; /* statistic information */
- struct ppp_idle ddinfo; /* demand dial information */
+ struct pppstat stats; /* statistic information */
/* PPP compression protocol information */
__u32 sc_bytessent; /* count of octets sent */
@@ -154,4 +153,7 @@ struct ppp {
struct compressor *sc_rcomp; /* receive decompressor */
void *sc_rc_state; /* receive decompressor state */
__s32 sc_xfer; /* PID of reserved PPP table */
+ char name[8];
+ struct device dev; /* net device structure */
+ struct enet_statistics estats; /* more detailed stats */
};
diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h
index abb6198af..7377867e7 100644
--- a/include/linux/if_shaper.h
+++ b/include/linux/if_shaper.h
@@ -5,7 +5,7 @@
#define SHAPER_QLEN 10
/*
- * This is a bit speed dependant (read it shouldnt be a constant!)
+ * This is a bit speed dependent (read it shouldn't be a constant!)
*
* 5 is about right for 28.8 upwards. Below that double for every
* halving of speed or so. - ie about 20 for 9600 baud.
@@ -33,8 +33,7 @@ struct shaper
void *saddr,
unsigned len);
int (*rebuild_header)(struct sk_buff *skb);
- int (*hard_header_cache)(struct dst_entry *dst, struct neighbour *neigh,
- struct hh_cache *hh);
+ int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh);
void (*header_cache_update)(struct hh_cache *hh, struct device *dev, unsigned char * haddr);
struct net_device_stats* (*get_stats)(struct device *dev);
struct wait_queue *wait_queue;
diff --git a/include/linux/if_slip.h b/include/linux/if_slip.h
index 5bd77e520..1eb4e3a83 100644
--- a/include/linux/if_slip.h
+++ b/include/linux/if_slip.h
@@ -23,6 +23,8 @@
#define SIOCGKEEPALIVE (SIOCDEVPRIVATE+1) /* Get keepalive timeout */
#define SIOCSOUTFILL (SIOCDEVPRIVATE+2) /* Set outfill timeout */
#define SIOCGOUTFILL (SIOCDEVPRIVATE+3) /* Get outfill timeout */
+#define SIOCSLEASE (SIOCDEVPRIVATE+4) /* Set "leased" line type */
+#define SIOCGLEASE (SIOCDEVPRIVATE+5) /* Get line type */
#endif
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 8be2d1b87..c13afde28 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -98,6 +98,7 @@ struct ip_mc_list
char tm_running;
char reporter;
char unsolicit_count;
+ char loaded;
};
extern __inline__ int ip_check_mc(struct device *dev, u32 mc_addr)
diff --git a/include/linux/in_route.h b/include/linux/in_route.h
index 6eaa7992a..a64453839 100644
--- a/include/linux/in_route.h
+++ b/include/linux/in_route.h
@@ -6,13 +6,15 @@
#define RTCF_DEAD RTNH_F_DEAD
#define RTCF_ONLINK RTNH_F_ONLINK
+/* Obsolete flag. About to be deleted */
#define RTCF_NOPMTUDISC RTM_F_NOPMTUDISC
#define RTCF_NOTIFY 0x00010000
#define RTCF_DIRECTDST 0x00020000
#define RTCF_REDIRECTED 0x00040000
+#define RTCF_TPROXY 0x00080000
-#define RTCF_VALVE 0x00200000
+#define RTCF_FAST 0x00200000
#define RTCF_MASQ 0x00400000
#define RTCF_SNAT 0x00800000
#define RTCF_DOREDIRECT 0x01000000
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 5f84c38de..f4662fc3d 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -1,19 +1,25 @@
#ifndef _LINUX_INETDEVICE_H
#define _LINUX_INETDEVICE_H
-/* IPv4 specific flags. They are initialized from global sysctl variables,
- when IPv4 is initialized.
- */
+#ifdef __KERNEL__
-#define IFF_IP_FORWARD 1
-#define IFF_IP_PROXYARP 2
-#define IFF_IP_RXREDIRECTS 4
-#define IFF_IP_TXREDIRECTS 8
-#define IFF_IP_SHAREDMEDIA 0x10
-#define IFF_IP_MFORWARD 0x20
-#define IFF_IP_RPFILTER 0x40
+struct ipv4_devconf
+{
+ int accept_redirects;
+ int send_redirects;
+ int secure_redirects;
+ int shared_media;
+ int accept_source_route;
+ int rp_filter;
+ int proxy_arp;
+ int bootp_relay;
+ int log_martians;
+ int forwarding;
+ int mc_forwarding;
+ void *sysctl;
+};
-#ifdef __KERNEL__
+extern struct ipv4_devconf ipv4_devconf;
struct in_device
{
@@ -22,24 +28,27 @@ struct in_device
struct ip_mc_list *mc_list; /* IP multicast filter chain */
unsigned long mr_v1_seen;
unsigned flags;
+ struct neigh_parms *arp_parms;
+ struct ipv4_devconf cnf;
};
+#define IN_DEV_FORWARD(in_dev) ((in_dev)->cnf.forwarding)
+#define IN_DEV_MFORWARD(in_dev) (ipv4_devconf.mc_forwarding && (in_dev)->cnf.mc_forwarding)
+#define IN_DEV_RPFILTER(in_dev) (ipv4_devconf.rp_filter && (in_dev)->cnf.rp_filter)
+#define IN_DEV_SOURCE_ROUTE(in_dev) (ipv4_devconf.accept_source_route && (in_dev)->cnf.accept_source_route)
+#define IN_DEV_BOOTP_RELAY(in_dev) (ipv4_devconf.bootp_relay && (in_dev)->cnf.bootp_relay)
-#define IN_DEV_RPFILTER(in_dev) (ipv4_config.rfc1812_filter && ((in_dev)->flags&IFF_IP_RPFILTER))
-#define IN_DEV_MFORWARD(in_dev) (ipv4_config.multicast_route && ((in_dev)->flags&IFF_IP_MFORWARD))
-#define IN_DEV_PROXY_ARP(in_dev) ((in_dev)->flags&IFF_IP_PROXYARP)
+#define IN_DEV_LOG_MARTIANS(in_dev) (ipv4_devconf.log_martians || (in_dev)->cnf.log_martians)
+#define IN_DEV_PROXY_ARP(in_dev) (ipv4_devconf.proxy_arp || (in_dev)->cnf.proxy_arp)
+#define IN_DEV_SHARED_MEDIA(in_dev) (ipv4_devconf.shared_media || (in_dev)->cnf.shared_media)
+#define IN_DEV_TX_REDIRECTS(in_dev) (ipv4_devconf.send_redirects || (in_dev)->cnf.send_redirects)
+#define IN_DEV_SEC_REDIRECTS(in_dev) (ipv4_devconf.secure_redirects || (in_dev)->cnf.secure_redirects)
-#if 1
-#define IN_DEV_FORWARD(in_dev) (IS_ROUTER)
-#define IN_DEV_RX_REDIRECTS(in_dev) (ipv4_config.accept_redirects)
-#define IN_DEV_TX_REDIRECTS(in_dev) (1)
-#define IN_DEV_SHARED_MEDIA(in_dev) (ipv4_config.rfc1620_redirects)
-#else
-#define IN_DEV_FORWARD(in_dev) (ipv4_config.ip_forwarding==1 && ((in_dev)->flags&IFF_IP_FORWARD))
-#define IN_DEV_RX_REDIRECTS(in_dev) ((in_dev)->flags&IFF_IP_RXREDIRECTS)
-#define IN_DEV_TX_REDIRECTS(in_dev) ((in_dev)->flags&IFF_IP_TXREDIRECTS)
-#define IN_DEV_SHARED_MEDIA(in_dev) ((in_dev)->flags&IFF_IP_SHAREDMEDIA)
-#endif
+#define IN_DEV_RX_REDIRECTS(in_dev) \
+ ((IN_DEV_FORWARD(in_dev) && \
+ (ipv4_devconf.accept_redirects && (in_dev)->cnf.accept_redirects)) \
+ || (!IN_DEV_FORWARD(in_dev) && \
+ (ipv4_devconf.accept_redirects || (in_dev)->cnf.accept_redirects)))
struct in_ifaddr
{
@@ -69,6 +78,7 @@ extern u32 inet_select_addr(struct device *dev, u32 dst, int scope);
extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, u32 mask);
extern int inet_add_bootp_addr(struct device *dev);
extern void inet_del_bootp_addr(struct device *dev);
+extern void inet_forward_change(void);
extern __inline__ int inet_ifa_match(u32 addr, struct in_ifaddr *ifa)
{
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index a3cabfbc1..a6c8e89c2 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -37,6 +37,7 @@ enum {
SPECIALIX_BH,
ESP_BH,
NET_BH,
+ SCSI_BH,
IMMEDIATE_BH,
KEYBOARD_BH,
CYCLADES_BH,
@@ -48,6 +49,12 @@ enum {
#include <asm/softirq.h>
/*
+ * Are we in an interrupt context? Either doing bottom half
+ * or hardware interrupt processing?
+ */
+#define in_interrupt() (local_irq_count[smp_processor_id()] + local_bh_count[smp_processor_id()] != 0)
+
+/*
* Autoprobing for irqs:
*
* probe_irq_on() and probe_irq_off() provide robust primitives
diff --git a/include/linux/ip.h b/include/linux/ip.h
index 538cede73..f09175b4e 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -124,6 +124,10 @@ struct ip_options {
unsigned char __data[0];
};
+#ifdef __KERNEL__
+#define optlength(opt) (sizeof(struct ip_options) + opt->optlen)
+#endif
+
struct iphdr {
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 ihl:4,
diff --git a/include/linux/ip_fw.h b/include/linux/ip_fw.h
index a9933659c..6f9bc510a 100644
--- a/include/linux/ip_fw.h
+++ b/include/linux/ip_fw.h
@@ -126,8 +126,8 @@ struct ip_fw
#define IP_FW_IN 1
#define IP_FW_OUT 2
#define IP_FW_ACCT 3
-#define IP_FW_MASQ 4
-#define IP_FW_CHAINS 5 /* total number of ip_fw chains */
+#define IP_FW_CHAINS 4 /* total number of ip_fw chains */
+#define IP_FW_MASQ 5
#define IP_FW_INSERT (IP_FW_BASE_CTL)
#define IP_FW_APPEND (IP_FW_BASE_CTL+1)
@@ -173,6 +173,11 @@ struct ip_fw
#define IP_FW_MASQ_DEL (IP_FW_DELETE | (IP_FW_MASQ << IP_FW_SHIFT))
#define IP_FW_MASQ_FLUSH (IP_FW_FLUSH | (IP_FW_MASQ << IP_FW_SHIFT))
+#define IP_FW_MASQ_INSERT (IP_FW_INSERT | (IP_FW_MASQ << IP_FW_SHIFT))
+#define IP_FW_MASQ_ADD (IP_FW_APPEND | (IP_FW_MASQ << IP_FW_SHIFT))
+#define IP_FW_MASQ_DEL (IP_FW_DELETE | (IP_FW_MASQ << IP_FW_SHIFT))
+#define IP_FW_MASQ_FLUSH (IP_FW_FLUSH | (IP_FW_MASQ << IP_FW_SHIFT))
+
struct ip_fwpkt
{
struct iphdr fwp_iph; /* IP header */
@@ -234,10 +239,14 @@ extern int ip_acct_ctl(int, void *, int);
#ifdef CONFIG_IP_MASQUERADE
extern int ip_masq_ctl(int, void *, int);
#endif
+#ifdef CONFIG_IP_MASQUERADE
+extern int ip_masq_ctl(int, void *, int);
+#endif
extern int ip_fw_chk(struct iphdr *, struct device *, __u16 *, struct ip_fw *, int, int);
extern void ip_fw_init(void);
#endif /* KERNEL */
+
#endif /* _IP_FW_H */
diff --git a/include/linux/ipv6_route.h b/include/linux/ipv6_route.h
index d53b16080..41591e876 100644
--- a/include/linux/ipv6_route.h
+++ b/include/linux/ipv6_route.h
@@ -13,6 +13,14 @@
#ifndef _LINUX_IPV6_ROUTE_H
#define _LINUX_IPV6_ROUTE_H
+enum
+{
+ RTA_IPV6_UNSPEC,
+ RTA_IPV6_HOPLIMIT,
+};
+
+#define RTA_IPV6_MAX RTA_IPV6_HOPLIMIT
+
#define RTF_DEFAULT 0x00010000 /* default - learned via ND */
#define RTF_ALLONLINK 0x00020000 /* fallback, no routers on link */
@@ -44,6 +52,5 @@ struct in6_rtmsg {
#define RTMSG_DELDEVICE 0x12
#define RTMSG_NEWROUTE 0x21
#define RTMSG_DELROUTE 0x22
-#define RTMSG_AR_FAILED 0x51 /* Address Resolution failed */
#endif
diff --git a/include/linux/ipx.h b/include/linux/ipx.h
index 9cf48e4d0..d3aa23844 100644
--- a/include/linux/ipx.h
+++ b/include/linux/ipx.h
@@ -76,5 +76,12 @@ struct ipx_route_def
#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE+1)
#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE+2)
-#endif
+#ifdef __KERNEL__
+#include <linux/skbuff.h>
+
+extern int ipxrtr_route_skb(struct sk_buff *);
+extern int ipx_if_offset(unsigned long ipx_net_number);
+#endif /* def __KERNEL__ */
+
+#endif /* def _IPX_H_ */
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index ea45d35cb..f7b4747d3 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -425,25 +425,11 @@ typedef struct isdn_net_local_s {
struct isdn_net_dev_s *netdev; /* Ptr to netdev */
struct sk_buff *first_skb; /* Ptr to skb that triggers dialing */
struct sk_buff *sav_skb; /* Ptr to skb, rejected by LL-driver*/
-#if (LINUX_VERSION_CODE < 0x02010F)
- /* Ptr to orig. header_cache_bind */
- void (*org_hcb)(struct hh_cache **,
- struct device *,
- unsigned short,
- __u32);
-#else
-#if (LINUX_VERSION_CODE < 0x2011E)
- /* Ptr to orig. hard_header_cache */
- int (*org_hhc)(struct dst_entry *dst,
- struct dst_entry *neigh,
- struct hh_cache *hh);
-#else
+
/* Ptr to orig. hard_header_cache */
- int (*org_hhc)(struct dst_entry *dst,
- struct neighbour *neigh,
+ int (*org_hhc)(struct neighbour *neigh,
struct hh_cache *hh);
-#endif
-#endif
+
/* Ptr to orig. header_cache_update */
void (*org_hcu)(struct hh_cache *,
struct device *,
diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h
index a8a3cbece..a81dc1296 100644
--- a/include/linux/iso_fs.h
+++ b/include/linux/iso_fs.h
@@ -163,10 +163,6 @@ struct iso_directory_record {
#define ISOFS_ZONE_BITS(INODE) ((INODE)->i_sb->u.isofs_sb.s_log_zone_size)
#define ISOFS_SUPER_MAGIC 0x9660
-#define ISOFS_FILE_UNKNOWN 0
-#define ISOFS_FILE_TEXT 1
-#define ISOFS_FILE_BINARY 2
-#define ISOFS_FILE_TEXT_M 3
#ifdef __KERNEL__
extern int isonum_711(char *);
diff --git a/include/linux/iso_fs_i.h b/include/linux/iso_fs_i.h
index a1343a636..02f17e071 100644
--- a/include/linux/iso_fs_i.h
+++ b/include/linux/iso_fs_i.h
@@ -7,6 +7,8 @@
struct iso_inode_info {
unsigned int i_first_extent;
unsigned char i_file_format;
+ unsigned long i_next_section_ino;
+ off_t i_section_size;
};
#endif
diff --git a/include/linux/iso_fs_sb.h b/include/linux/iso_fs_sb.h
index 35bd29203..834ae348b 100644
--- a/include/linux/iso_fs_sb.h
+++ b/include/linux/iso_fs_sb.h
@@ -13,7 +13,6 @@ struct isofs_sb_info {
unsigned char s_high_sierra; /* A simple flag */
unsigned char s_mapping;
- unsigned char s_conversion;
unsigned char s_rock;
unsigned char s_joliet_level;
unsigned char s_utf8;
diff --git a/include/linux/istallion.h b/include/linux/istallion.h
index e1bf37264..269ef88ba 100644
--- a/include/linux/istallion.h
+++ b/include/linux/istallion.h
@@ -3,7 +3,7 @@
/*
* istallion.h -- stallion intelligent multiport serial driver.
*
- * Copyright (C) 1996-1997 Stallion Technologies (support@stallion.oz.au).
+ * Copyright (C) 1996-1998 Stallion Technologies (support@stallion.oz.au).
* Copyright (C) 1994-1996 Greg Ungerer (gerg@stallion.oz.au).
*
* This program is free software; you can redistribute it and/or modify
@@ -102,6 +102,7 @@ typedef struct stlibrd {
int nrports;
int nrdevs;
unsigned int iobase;
+ int iosize;
unsigned long memaddr;
void *membase;
int memsize;
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index cf21ecf73..a5e6544f6 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -65,12 +65,6 @@ asmlinkage int printk(const char * fmt, ...)
printk(KERN_INFO fmt,##arg)
/*
- * "suser()" checks against the effective user id, while "fsuser()"
- * is used for file permission checking and checks against the fsuid..
- */
-#define fsuser() (current->fsuid == 0)
-
-/*
* Display an IP address in readable format.
*/
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 1966490a7..6bf0d79cb 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -2,6 +2,9 @@
#define _LINUX_KERNEL_STAT_H
#include <asm/irq.h>
+#include <asm/smp.h>
+#include <linux/smp.h>
+#include <linux/tasks.h>
/*
* 'kernel_stat.h' contains the definitions needed for doing
@@ -12,7 +15,10 @@
#define DK_NDRIVE 4
struct kernel_stat {
- unsigned int cpu_user, cpu_nice, cpu_system;
+ unsigned int cpu_user, cpu_nice, cpu_system;
+ unsigned int per_cpu_user[NR_CPUS],
+ per_cpu_nice[NR_CPUS],
+ per_cpu_system[NR_CPUS];
unsigned int dk_drive[DK_NDRIVE];
unsigned int dk_drive_rio[DK_NDRIVE];
unsigned int dk_drive_wio[DK_NDRIVE];
@@ -20,7 +26,7 @@ struct kernel_stat {
unsigned int dk_drive_wblk[DK_NDRIVE];
unsigned int pgpgin, pgpgout;
unsigned int pswpin, pswpout;
- unsigned int interrupts[NR_IRQS];
+ unsigned int irqs[NR_CPUS][NR_IRQS];
unsigned int ipackets, opackets;
unsigned int ierrors, oerrors;
unsigned int collisions;
@@ -29,4 +35,17 @@ struct kernel_stat {
extern struct kernel_stat kstat;
+/*
+ * Number of interrupts per specific IRQ source, since bootup
+ */
+extern inline int kstat_irqs (int irq)
+{
+ int i, sum=0;
+
+ for (i = 0 ; i < smp_num_cpus ; i++)
+ sum += kstat.irqs[cpu_logical_map(i)][irq];
+
+ return sum;
+}
+
#endif /* _LINUX_KERNEL_STAT_H */
diff --git a/include/linux/kerneld.h b/include/linux/kerneld.h
index 641f231ee..b2db5f8c7 100644
--- a/include/linux/kerneld.h
+++ b/include/linux/kerneld.h
@@ -48,8 +48,10 @@ struct kerneld_msg {
};
#ifdef __KERNEL__
+#include <linux/string.h>
+
extern int kerneld_send(int msgtype, int ret_size, int msgsz,
- const char *text, const char *ret_val);
+ const char *text, const char *ret_val);
/*
* Request that a module should be loaded.
@@ -59,8 +61,8 @@ extern int kerneld_send(int msgtype, int ret_size, int msgsz,
static inline int request_module(const char *name)
{
return kerneld_send(KERNELD_REQUEST_MODULE,
- 0 | KERNELD_WAIT,
- strlen(name), name, NULL);
+ 0 | KERNELD_WAIT,
+ strlen(name), name, NULL);
}
/*
@@ -70,8 +72,8 @@ static inline int request_module(const char *name)
static inline int release_module(const char *name, int waitflag)
{
return kerneld_send(KERNELD_RELEASE_MODULE,
- 0 | (waitflag?KERNELD_WAIT:KERNELD_NOWAIT),
- strlen(name), name, NULL);
+ 0 | (waitflag?KERNELD_WAIT:KERNELD_NOWAIT),
+ strlen(name), name, NULL);
}
/*
@@ -81,8 +83,8 @@ static inline int release_module(const char *name, int waitflag)
static inline int delayed_release_module(const char *name)
{
return kerneld_send(KERNELD_DELAYED_RELEASE_MODULE,
- 0 | KERNELD_NOWAIT,
- strlen(name), name, NULL);
+ 0 | KERNELD_NOWAIT,
+ strlen(name), name, NULL);
}
/*
@@ -94,8 +96,8 @@ static inline int delayed_release_module(const char *name)
static inline int cancel_release_module(const char *name)
{
return kerneld_send(KERNELD_CANCEL_RELEASE_MODULE,
- 0 | KERNELD_NOWAIT,
- strlen(name), name, NULL);
+ 0 | KERNELD_NOWAIT,
+ strlen(name), name, NULL);
}
/*
@@ -104,8 +106,8 @@ static inline int cancel_release_module(const char *name)
static inline int ksystem(const char *cmd, int waitflag)
{
return kerneld_send(KERNELD_SYSTEM,
- 0 | (waitflag?KERNELD_WAIT:KERNELD_NOWAIT),
- strlen(cmd), cmd, NULL);
+ 0 | (waitflag?KERNELD_WAIT:KERNELD_NOWAIT),
+ strlen(cmd), cmd, NULL);
}
/*
@@ -114,18 +116,19 @@ static inline int ksystem(const char *cmd, int waitflag)
static inline int kerneld_route(const char *ip_route)
{
return kerneld_send(KERNELD_REQUEST_ROUTE,
- 0 | KERNELD_WAIT,
- strlen(ip_route), ip_route, NULL);
+ 0 | KERNELD_WAIT,
+ strlen(ip_route), ip_route, NULL);
}
/*
* Handle an external screen blanker
*/
-static inline int kerneld_blanker(int on_off) /* 0 => "off", else "on" */
+static inline int kerneld_blanker(int on_off)
{
+ char *s = on_off ? "on" : "off";
return kerneld_send(KERNELD_BLANKER,
- 0 | (on_off?KERNELD_NOWAIT:KERNELD_WAIT),
- strlen(on_off?"on":"off"), on_off?"on":"off", NULL);
+ 0 | (on_off ? KERNELD_NOWAIT : KERNELD_WAIT),
+ strlen(s), s, NULL);
}
#endif /* __KERNEL__ */
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index 148eaad22..cd5cdb349 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -15,6 +15,10 @@
#define SYMBOL_NAME_LABEL(X) X/**/:
#endif
+#ifdef __arm__
+#define __ALIGN .align 0
+#define __ALIGN_STR ".align 0"
+#else
#ifdef __mc68000__
#define __ALIGN .align 4
#define __ALIGN_STR ".align 4"
@@ -27,6 +31,7 @@
#define __ALIGN_STR ".align 16,0x90"
#endif /* __i486__/__i586__ */
#endif /* __mc68000__ */
+#endif /* __arm__ */
#ifdef __ASSEMBLY__
diff --git a/include/linux/lp.h b/include/linux/lp.h
index 368cd9bef..ba2e34f07 100644
--- a/include/linux/lp.h
+++ b/include/linux/lp.h
@@ -7,6 +7,12 @@
* Interrupt support added 1993 Nigel Gamble
*/
+/* Magic numbers for defining port-device mappings */
+#define LP_PARPORT_UNSPEC -4
+#define LP_PARPORT_AUTO -3
+#define LP_PARPORT_OFF -2
+#define LP_PARPORT_NONE -1
+
/*
* Per POSIX guidelines, this module reserves the LP and lp prefixes
* These are the lp_table[minor].flags flags...
@@ -89,20 +95,6 @@
#define LP_BASE(x) lp_table[(x)].dev->port->base
-#define r_dtr(x) inb(LP_BASE(x))
-#define r_str(x) inb(LP_BASE(x)+1)
-#define r_ctr(x) inb(LP_BASE(x)+2)
-#define r_epp(x) inb(LP_BASE(x)+4)
-#define r_fifo(x) inb(LP_BASE(x)+0x400)
-#define r_ecr(x) inb(LP_BASE(x)+0x402)
-
-#define w_dtr(x,y) outb((y), LP_BASE(x))
-#define w_str(x,y) outb((y), LP_BASE(x)+1)
-#define w_ctr(x,y) outb((y), LP_BASE(x)+2)
-#define w_epp(x,y) outb((y), LP_BASE(x)+4)
-#define w_fifo(x,y) outb((y), LP_BASE(x)+0x400)
-#define w_ecr(x,y) outb((y), LP_BASE(x)+0x402)
-
struct lp_stats {
unsigned long chars;
unsigned long sleeps;
@@ -118,12 +110,10 @@ struct lp_struct {
unsigned int chars;
unsigned int time;
unsigned int wait;
- struct wait_queue *lp_wait_q;
char *lp_buffer;
unsigned int lastcall;
unsigned int runchars;
unsigned int waittime;
- unsigned int should_relinquish;
struct lp_stats stats;
};
@@ -170,6 +160,9 @@ struct lp_struct {
*/
#define LP_DELAY 50
+#define LP_POLLING(minor) (lp_table[(minor)].dev->port->irq == PARPORT_IRQ_NONE)
+#define LP_PREEMPTED(minor) (lp_table[(minor)].dev->port->waithead != NULL)
+
/*
* function prototypes
*/
diff --git a/include/linux/mc146818rtc.h b/include/linux/mc146818rtc.h
index d942ccdc3..696b1a764 100644
--- a/include/linux/mc146818rtc.h
+++ b/include/linux/mc146818rtc.h
@@ -128,6 +128,8 @@ struct rtc_time {
#define RTC_SET_TIME _IOW('p', 0x0a, struct rtc_time) /* Set RTC time */
#define RTC_IRQP_READ _IOR('p', 0x0b, unsigned long) /* Read IRQ rate */
#define RTC_IRQP_SET _IOW('p', 0x0c, unsigned long) /* Set IRQ rate */
+#define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long) /* Read epoch */
+#define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long) /* Set epoch */
#endif /* _MC146818RTC_H */
diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h
index a725bbe36..20a8cd66d 100644
--- a/include/linux/minix_fs.h
+++ b/include/linux/minix_fs.h
@@ -95,7 +95,7 @@ extern int minix_rmdir(struct inode * dir, struct dentry *dentry);
extern int minix_unlink(struct inode * dir, struct dentry *dentry);
extern int minix_symlink(struct inode * inode, struct dentry *dentry,
const char * symname);
-extern int minix_link(struct inode * oldinode, struct inode * dir, struct dentry *dentry);
+extern int minix_link(struct dentry * old_dentry, struct inode * dir, struct dentry *dentry);
extern int minix_mknod(struct inode * dir, struct dentry *dentry, int mode, int rdev);
extern int minix_rename(struct inode * old_dir, struct dentry *old_dentry,
struct inode * new_dir, struct dentry *new_dentry);
diff --git a/include/linux/minix_fs_sb.h b/include/linux/minix_fs_sb.h
index e77b4efc6..c533e63ac 100644
--- a/include/linux/minix_fs_sb.h
+++ b/include/linux/minix_fs_sb.h
@@ -12,10 +12,10 @@ struct minix_sb_info {
unsigned long s_firstdatazone;
unsigned long s_log_zone_size;
unsigned long s_max_size;
- struct buffer_head * s_imap[8];
- struct buffer_head * s_zmap[64];
unsigned long s_dirsize;
unsigned long s_namelen;
+ struct buffer_head ** s_imap;
+ struct buffer_head ** s_zmap;
struct buffer_head * s_sbh;
struct minix_super_block * s_ms;
unsigned short s_mount_state;
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 3bdb48348..c6646ddd1 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -9,6 +9,8 @@
#define ATARIMOUSE_MINOR 5
#define SUN_MOUSE_MINOR 6
#define PC110PAD_MINOR 9
+#define WATCHDOG_MINOR 130 /* Watchdog timer */
+#define TEMP_MINOR 131 /* Temperature Sensor */
#define RTC_MINOR 135
#define SUN_OPENPROM_MINOR 139
#define NVRAM_MINOR 144
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 4a44f193d..11d04d453 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -48,7 +48,7 @@ struct vm_area_struct {
struct vm_operations_struct * vm_ops;
unsigned long vm_offset;
- struct dentry * vm_dentry;
+ struct file * vm_file;
unsigned long vm_pte; /* shared mem */
};
@@ -123,7 +123,6 @@ typedef struct page {
struct wait_queue *wait;
struct page **pprev_hash;
struct buffer_head * buffers;
- unsigned long pg_swap_entry;
unsigned long map_nr; /* page->map_nr == page - mem_map */
} mem_map_t;
@@ -134,7 +133,7 @@ typedef struct page {
#define PG_uptodate 3
#define PG_free_after 4
#define PG_decr_after 5
-#define PG_swap_unlock_after 6
+/* Unused 6 */
#define PG_DMA 7
#define PG_Slab 8
#define PG_swap_cache 9
@@ -147,7 +146,6 @@ typedef struct page {
#define PageUptodate(page) (test_bit(PG_uptodate, &(page)->flags))
#define PageFreeAfter(page) (test_bit(PG_free_after, &(page)->flags))
#define PageDecrAfter(page) (test_bit(PG_decr_after, &(page)->flags))
-#define PageSwapUnlockAfter(page) (test_bit(PG_swap_unlock_after, &(page)->flags))
#define PageDMA(page) (test_bit(PG_DMA, &(page)->flags))
#define PageSlab(page) (test_bit(PG_Slab, &(page)->flags))
#define PageSwapCache(page) (test_bit(PG_swap_cache, &(page)->flags))
@@ -238,21 +236,22 @@ extern mem_map_t * mem_map;
* goes to clearing the page. If you want a page without the clearing
* overhead, just use __get_free_page() directly..
*/
-#define __get_free_page(priority) __get_free_pages((priority),0,0)
-#define __get_dma_pages(priority, order) __get_free_pages((priority),(order),1)
-extern unsigned long FASTCALL(__get_free_pages(int priority, unsigned long gfporder, int dma));
+#define __get_free_page(gfp_mask) __get_free_pages((gfp_mask),0)
+#define __get_dma_pages(gfp_mask, order) __get_free_pages((gfp_mask) | GFP_DMA,(order))
+extern unsigned long FASTCALL(__get_free_pages(int gfp_mask, unsigned long gfp_order));
-extern inline unsigned long get_free_page(int priority)
+extern inline unsigned long get_free_page(int gfp_mask)
{
unsigned long page;
- page = __get_free_page(priority);
+ page = __get_free_page(gfp_mask);
if (page)
clear_page(page);
return page;
}
/* memory.c & swap.c*/
+extern int free_memory_available(void);
#define free_page(addr) free_pages((addr),0)
extern void FASTCALL(free_pages(unsigned long addr, unsigned long order));
@@ -298,23 +297,36 @@ extern void truncate_inode_pages(struct inode *, unsigned long);
extern unsigned long get_cached_page(struct inode *, unsigned long, int);
extern void put_cached_page(unsigned long);
-#define GFP_BUFFER 0x00
-#define GFP_ATOMIC 0x01
-#define GFP_USER 0x02
-#define GFP_KERNEL 0x03
-#define GFP_NOBUFFER 0x04
-#define GFP_NFS 0x05
+/*
+ * GFP bitmasks..
+ */
+#define __GFP_WAIT 0x01
+#define __GFP_IO 0x02
+#define __GFP_LOW 0x00
+#define __GFP_MED 0x04
+#define __GFP_HIGH 0x08
+
+#define __GFP_UNCACHED 0x40
+#define __GFP_DMA 0x80
+
+#define GFP_BUFFER (__GFP_LOW | __GFP_WAIT)
+#define GFP_ATOMIC (__GFP_HIGH)
+#define GFP_USER (__GFP_LOW | __GFP_WAIT | __GFP_IO)
+#define GFP_KERNEL (__GFP_LOW | __GFP_WAIT | __GFP_IO)
+#define GFP_NFS (__GFP_MED | __GFP_WAIT | __GFP_IO)
/* Flag - indicates that the buffer should be allocated uncached as for an
architecture where the caches don't snoop DMA access. This is a even
stricter requirement than GFP_DMA as GFP_DMA allocated buffers might be
writeback cacheable and not be suitable for use with devices like
networks cards which manipulate objects smaller than a cacheline. */
-#define GFP_UNCACHED 0x40
+
+#define GFP_UNCACHED __GFP_UNCACHED
/* Flag - indicates that the buffer will be suitable for DMA. Ignored on some
platforms, used as appropriate on others */
-#define GFP_DMA 0x80
+
+#define GFP_DMA __GFP_DMA
#define GFP_LEVEL_MASK 0xf
diff --git a/include/linux/module.h b/include/linux/module.h
index 483aea5dc..475c68854 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -94,6 +94,7 @@ struct module_info
#define MOD_AUTOCLEAN 4
#define MOD_VISITED 8
#define MOD_USED_ONCE 16
+#define MOD_JUST_FREED 32
/* Values for query_module's which. */
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index de0e47ab2..bcf4d0134 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -161,7 +161,7 @@ struct msdos_dir_slot {
__u8 name11_12[4]; /* last 2 characters in name */
};
-struct slot_info {
+struct vfat_slot_info {
int is_long; /* was the found entry long */
int long_slots; /* number of long slots in filename */
int total_slots; /* total slots (long and short) */
@@ -218,14 +218,14 @@ extern int fat_smap(struct inode *inode,int sector);
extern int fat_free(struct inode *inode,int skip);
void fat_cache_inval_inode(struct inode *inode);
void fat_cache_inval_dev(kdev_t device);
-extern void cache_init(void);
-void cache_lookup(struct inode *inode,int cluster,int *f_clu,int *d_clu);
-void cache_add(struct inode *inode,int f_clu,int d_clu);
-int get_cluster(struct inode *inode,int cluster);
+extern void fat_cache_init(void);
+void fat_cache_lookup(struct inode *inode,int cluster,int *f_clu,int *d_clu);
+void fat_cache_add(struct inode *inode,int f_clu,int d_clu);
+int fat_get_cluster(struct inode *inode,int cluster);
/* inode.c */
extern int fat_bmap(struct inode *inode,int block);
-extern int fat_notify_change(struct inode *,struct iattr *);
+extern int fat_notify_change(struct dentry *, struct iattr *);
extern void fat_put_inode(struct inode *inode);
extern void fat_delete_inode(struct inode *inode);
extern void fat_put_super(struct super_block *sb);
@@ -248,12 +248,14 @@ extern int fat_dir_ioctl(struct inode * inode, struct file * filp,
/* file.c */
extern struct inode_operations fat_file_inode_operations;
extern struct inode_operations fat_file_inode_operations_1024;
+extern struct inode_operations fat_file_inode_operations_readpage;
extern ssize_t fat_file_read(struct file *, char *, size_t, loff_t *);
extern ssize_t fat_file_write(struct file *, const char *, size_t, loff_t *);
extern void fat_truncate(struct inode *inode);
/* mmap.c */
extern int fat_mmap(struct file *, struct vm_area_struct *);
+extern int fat_readpage(struct file *, struct page *);
/* vfat.c */
diff --git a/include/linux/msdos_fs_i.h b/include/linux/msdos_fs_i.h
index 530930e53..674999c58 100644
--- a/include/linux/msdos_fs_i.h
+++ b/include/linux/msdos_fs_i.h
@@ -28,16 +28,9 @@ struct msdos_inode_info {
int i_start; /* first cluster or 0 */
int i_logstart; /* logical first cluster */
int i_attrs; /* unused attribute bits */
+ int i_ctime_ms; /* unused change time in milliseconds */
int i_busy; /* file is either deleted but still open, or
inconsistent (mkdir) */
- struct inode *i_depend; /* pointer to inode that depends on the
- current inode */
- struct inode *i_old; /* pointer to the old inode this inode
- depends on */
- struct inode *i_linked; /* pointer to inode linked to the current one,
- happens when an open file is moved */
- struct inode *i_oldlink;/* pointer to open inode that references
- the same file */
int i_binary; /* file contains non-text data */
};
diff --git a/include/linux/msdos_fs_sb.h b/include/linux/msdos_fs_sb.h
index fe584a85b..4985eef15 100644
--- a/include/linux/msdos_fs_sb.h
+++ b/include/linux/msdos_fs_sb.h
@@ -1,5 +1,6 @@
#ifndef _MSDOS_FS_SB
#define _MSDOS_FS_SB
+#include<linux/fat_cvf.h>
/*
* MS-DOS file system in-core superblock data
@@ -47,6 +48,8 @@ struct msdos_sb_info {
struct fat_mount_options options;
struct nls_table *nls_disk; /* Codepage used on disk */
struct nls_table *nls_io; /* Charset used for input and display */
+ struct cvf_format* cvf_format;
+ void* private_data;
};
#endif
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 7b09f94a9..03904df71 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -29,7 +29,7 @@ struct ncp_ioctl_request {
struct ncp_fs_info {
int version;
struct sockaddr_ipx addr;
- uid_t mounted_uid;
+ __kernel_uid_t mounted_uid;
int connection; /* Connection number the server assigned us */
int buffer_size; /* The negotiated buffer size, to be
used for read/write requests! */
@@ -38,13 +38,72 @@ struct ncp_fs_info {
__u32 directory_id;
};
+struct ncp_sign_init
+{
+ char sign_root[8];
+ char sign_last[16];
+};
+
+struct ncp_lock_ioctl
+{
+#define NCP_LOCK_LOG 0
+#define NCP_LOCK_SH 1
+#define NCP_LOCK_EX 2
+#define NCP_LOCK_CLEAR 256
+ int cmd;
+ int origin;
+ unsigned int offset;
+ unsigned int length;
+#define NCP_LOCK_DEFAULT_TIMEOUT 18
+#define NCP_LOCK_MAX_TIMEOUT 180
+ int timeout;
+};
+
+struct ncp_setroot_ioctl
+{
+ int volNumber;
+ int namespace;
+ __u32 dirEntNum;
+};
+
+struct ncp_objectname_ioctl
+{
+#define NCP_AUTH_NONE 0x00
+#define NCP_AUTH_BIND 0x31
+#define NCP_AUTH_NDS 0x32
+ int auth_type;
+ size_t object_name_len;
+ void* object_name; /* an userspace data, in most cases user name */
+};
+
+struct ncp_privatedata_ioctl
+{
+ size_t len;
+ void* data; /* ~1000 for NDS */
+};
+
#define NCP_IOC_NCPREQUEST _IOR('n', 1, struct ncp_ioctl_request)
#define NCP_IOC_GETMOUNTUID _IOW('n', 2, uid_t)
+#define NCP_IOC_GETMOUNTUID_INT _IOW('n', 2, unsigned int)
#define NCP_IOC_CONN_LOGGED_IN _IO('n', 3)
#define NCP_GET_FS_INFO_VERSION (1)
#define NCP_IOC_GET_FS_INFO _IOWR('n', 4, struct ncp_fs_info)
+#define NCP_IOC_SIGN_INIT _IOR('n', 5, struct ncp_sign_init)
+#define NCP_IOC_SIGN_WANTED _IOR('n', 6, int)
+#define NCP_IOC_SET_SIGN_WANTED _IOW('n', 6, int)
+
+#define NCP_IOC_LOCKUNLOCK _IOR('n', 7, struct ncp_lock_ioctl)
+
+#define NCP_IOC_GETROOT _IOW('n', 8, struct ncp_setroot_ioctl)
+#define NCP_IOC_SETROOT _IOR('n', 8, struct ncp_setroot_ioctl)
+
+#define NCP_IOC_GETOBJECTNAME _IOWR('n', 9, struct ncp_objectname_ioctl)
+#define NCP_IOC_SETOBJECTNAME _IOR('n', 9, struct ncp_objectname_ioctl)
+#define NCP_IOC_GETPRIVATEDATA _IOWR('n', 10, struct ncp_privatedata_ioctl)
+#define NCP_IOC_SETPRIVATEDATA _IOR('n', 10, struct ncp_privatedata_ioctl)
+
/*
* The packet size to allocate. One page should be enough.
*/
@@ -55,8 +114,12 @@ struct ncp_fs_info {
#ifdef __KERNEL__
+#include <linux/config.h>
+
#undef NCPFS_PARANOIA
+#ifndef DEBUG_NCP
#define DEBUG_NCP 0
+#endif
#if DEBUG_NCP > 0
#define DPRINTK(format, args...) printk(format , ## args)
#else
@@ -140,9 +203,11 @@ static inline void ncp_kfree_s(void *obj, int size)
#endif /* DEBUG_NCP_MALLOC */
/* linux/fs/ncpfs/inode.c */
+int ncp_notify_change(struct dentry *, struct iattr *attr);
struct super_block *ncp_read_super(struct super_block *, void *, int);
struct inode *ncp_iget(struct super_block *, struct ncpfs_inode_info *);
void ncp_update_inode(struct inode *, struct nw_file_info *);
+void ncp_update_inode2(struct inode *, struct nw_file_info *);
extern int init_ncp_fs(void);
/* linux/fs/ncpfs/dir.c */
@@ -202,12 +267,26 @@ static inline int ncp_namespace(struct inode *inode)
static inline int ncp_preserve_case(struct inode *i)
{
- return (ncp_namespace(i) == NW_NS_OS2);
+#if defined(CONFIG_NCPFS_NFS_NS) || defined(CONFIG_NCPFS_OS2_NS)
+ int ns = ncp_namespace(i);
+#endif
+ return
+#ifdef CONFIG_NCPFS_OS2_NS
+ (ns == NW_NS_OS2) ||
+#endif /* CONFIG_NCPFS_OS2_NS */
+#ifdef CONFIG_NCPFS_NFS_NS
+ (ns == NW_NS_NFS) ||
+#endif /* CONFIG_NCPFS_NFS_NS */
+ 0;
}
static inline int ncp_case_sensitive(struct inode *i)
{
+#ifdef CONFIG_NCPFS_NFS_NS
+ return ncp_namespace(i) == NW_NS_NFS;
+#else
return 0;
+#endif /* CONFIG_NCPFS_NFS_NS */
}
#endif /* __KERNEL__ */
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h
index cfe205547..efcc20556 100644
--- a/include/linux/ncp_fs_sb.h
+++ b/include/linux/ncp_fs_sb.h
@@ -14,6 +14,7 @@
#ifdef __KERNEL__
#define NCP_DEFAULT_BUFSIZE 1024
+#define NCP_DEFAULT_OPTIONS 0 /* 2 for packet signatures */
struct ncp_server {
@@ -21,7 +22,7 @@ struct ncp_server {
interest for us later, so we store
it completely. */
- __u8 name_space[NCP_NUMBER_OF_VOLUMES];
+ __u8 name_space[NCP_NUMBER_OF_VOLUMES + 2];
struct file *ncp_filp; /* File pointer to ncp socket */
@@ -50,7 +51,30 @@ struct ncp_server {
int ncp_reply_size;
struct ncp_inode_info root;
+#if 0
char root_path; /* '\0' */
+#else
+ struct dentry* root_dentry;
+#endif
+
+/* info for packet signing */
+ int sign_wanted; /* 1=Server needs signed packets */
+ int sign_active; /* 0=don't do signing, 1=do */
+ char sign_root[8]; /* generated from password and encr. key */
+ char sign_last[16];
+
+ /* Authentication info: NDS or BINDERY, username */
+ struct {
+ int auth_type;
+ size_t object_name_len;
+ void* object_name;
+ int object_type;
+ } auth;
+ /* Password info */
+ struct {
+ size_t len;
+ void* data;
+ } priv;
};
static inline int ncp_conn_valid(struct ncp_server *server)
@@ -66,3 +90,4 @@ static inline void ncp_invalidate_conn(struct ncp_server *server)
#endif /* __KERNEL__ */
#endif
+
diff --git a/include/linux/ncp_mount.h b/include/linux/ncp_mount.h
index ed169e70a..54bc5b943 100644
--- a/include/linux/ncp_mount.h
+++ b/include/linux/ncp_mount.h
@@ -18,12 +18,15 @@
/* Values for flags */
#define NCP_MOUNT_SOFT 0x0001
#define NCP_MOUNT_INTR 0x0002
+#define NCP_MOUNT_STRONG 0x0004 /* enable delete/rename of r/o files */
+#define NCP_MOUNT_NO_OS2 0x0008
+#define NCP_MOUNT_NO_NFS 0x0010
struct ncp_mount_data {
int version;
unsigned int ncp_fd; /* The socket to the ncp port */
- uid_t mounted_uid; /* Who may umount() this filesystem? */
- pid_t wdog_pid; /* Who cares for our watchdog packets? */
+ __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */
+ __kernel_pid_t wdog_pid; /* Who cares for our watchdog packets? */
unsigned char mounted_vol[NCP_VOLNAME_LEN + 1];
unsigned int time_out; /* How long should I wait after
@@ -31,10 +34,10 @@ struct ncp_mount_data {
unsigned int retry_count; /* And how often should I retry? */
unsigned int flags;
- uid_t uid;
- gid_t gid;
- mode_t file_mode;
- mode_t dir_mode;
+ __kernel_uid_t uid;
+ __kernel_gid_t gid;
+ __kernel_mode_t file_mode;
+ __kernel_mode_t dir_mode;
};
#endif
diff --git a/include/linux/net.h b/include/linux/net.h
index 015f2d8b2..63e996f9d 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -93,7 +93,7 @@ struct proto_ops {
int flags);
int (*getname) (struct socket *sock, struct sockaddr *uaddr,
int *usockaddr_len, int peer);
- unsigned int (*poll) (struct socket *sock, struct poll_table_struct *wait);
+ unsigned int (*poll) (struct file *file, struct socket *sock, struct poll_table_struct *wait);
int (*ioctl) (struct socket *sock, unsigned int cmd,
unsigned long arg);
int (*listen) (struct socket *sock, int len);
@@ -137,7 +137,9 @@ extern int sock_recvmsg(struct socket *, struct msghdr *m, int len, int flags);
extern int sock_readv_writev(int type, struct inode * inode, struct file * file,
const struct iovec * iov, long count, long size);
-int net_ratelimit(void);
+extern int net_ratelimit(void);
+extern unsigned long net_random(void);
+extern void net_srandom(unsigned long);
#endif /* __KERNEL__ */
#endif /* _LINUX_NET_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9d1f67cc0..72430508a 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -31,6 +31,12 @@
#include <asm/atomic.h>
+#ifdef __KERNEL__
+#ifdef CONFIG_NET_PROFILE
+#include <net/profile.h>
+#endif
+#endif
+
/*
* For future expansion when we will have different priorities.
*/
@@ -60,6 +66,8 @@
#endif
struct neighbour;
+struct neigh_parms;
+struct sk_buff;
/*
* We tag multicasts with these structures.
@@ -67,10 +75,11 @@ struct neighbour;
struct dev_mc_list
{
- struct dev_mc_list *next;
- char dmi_addr[MAX_ADDR_LEN];
- unsigned short dmi_addrlen;
- unsigned short dmi_users;
+ struct dev_mc_list *next;
+ __u8 dmi_addr[MAX_ADDR_LEN];
+ unsigned char dmi_addrlen;
+ int dmi_users;
+ int dmi_gusers;
};
struct hh_cache
@@ -78,7 +87,7 @@ struct hh_cache
struct hh_cache *hh_next; /* Next entry */
atomic_t hh_refcnt; /* number of users */
unsigned short hh_type; /* protocol identifier, f.e ETH_P_IP */
- char hh_uptodate; /* hh_data is valid */
+ int (*hh_output)(struct sk_buff *skb);
/* cached hardware header; allow for machine alignment needs. */
unsigned long hh_data[16/sizeof(unsigned long)];
};
@@ -118,6 +127,16 @@ struct net_device_stats
};
+#ifdef CONFIG_NET_FASTROUTE
+struct net_fastroute_stats
+{
+ int hits;
+ int succeed;
+ int deferred;
+ int latency_reduction;
+};
+#endif
+
/* Media selection options. */
enum {
IF_PORT_UNKNOWN = 0,
@@ -260,8 +279,7 @@ struct device
int (*set_config)(struct device *dev,
struct ifmap *map);
#define HAVE_HEADER_CACHE
- int (*hard_header_cache)(struct dst_entry *dst,
- struct neighbour *neigh,
+ int (*hard_header_cache)(struct neighbour *neigh,
struct hh_cache *hh);
void (*header_cache_update)(struct hh_cache *hh,
struct device *dev,
@@ -271,6 +289,18 @@ struct device
int (*hard_header_parse)(struct sk_buff *skb,
unsigned char *haddr);
+ int (*neigh_setup)(struct device *dev, struct neigh_parms *);
+ int (*accept_fastpath)(struct device *, struct dst_entry*);
+
+#ifdef CONFIG_NET_FASTROUTE
+ /* Really, this semaphore may be necessary and for not fastroute code;
+ f.e. SMP??
+ */
+ int tx_semaphore;
+#define NETDEV_FASTROUTE_HMASK 0xF
+ /* Semi-private data. Keep it at the end of device struct. */
+ struct dst_entry *fastpath[NETDEV_FASTROUTE_HMASK+1];
+#endif
};
@@ -310,13 +340,18 @@ extern int register_netdevice_notifier(struct notifier_block *nb);
extern int unregister_netdevice_notifier(struct notifier_block *nb);
extern int dev_new_index(void);
extern struct device *dev_get_by_index(int ifindex);
-extern int register_gifconf(int family, int (*func)(struct device *dev, char *bufptr, int len));
extern int dev_restart(struct device *dev);
+typedef int gifconf_func_t(struct device * dev, char * bufptr, int len);
+extern int register_gifconf(unsigned int family, gifconf_func_t * gifconf);
+extern __inline__ int unregister_gifconf(unsigned int family)
+{
+ return register_gifconf(family, 0);
+}
+
#define HAVE_NETIF_RX 1
extern void netif_rx(struct sk_buff *skb);
extern void net_bh(void);
-extern void dev_tint(struct device *dev);
extern int dev_get_info(char *buffer, char **start, off_t offset, int length, int dummy);
extern int dev_ioctl(unsigned int cmd, void *);
extern int dev_change_flags(struct device *, unsigned);
@@ -383,13 +418,26 @@ extern int register_trdev(struct device *dev);
extern void unregister_trdev(struct device *dev);
/* Functions used for multicast support */
extern void dev_mc_upload(struct device *dev);
-extern void dev_mc_delete(struct device *dev, void *addr, int alen, int all);
-extern void dev_mc_add(struct device *dev, void *addr, int alen, int newonly);
+extern int dev_mc_delete(struct device *dev, void *addr, int alen, int all);
+extern int dev_mc_add(struct device *dev, void *addr, int alen, int newonly);
extern void dev_mc_discard(struct device *dev);
extern void dev_set_promiscuity(struct device *dev, int inc);
extern void dev_set_allmulti(struct device *dev, int inc);
/* Load a device via the kerneld */
extern void dev_load(const char *name);
+extern void dev_mcast_init(void);
+extern int netdev_register_fc(struct device *dev, void (*stimul)(struct device *dev));
+extern void netdev_unregister_fc(int bit);
+extern int netdev_dropping;
+extern int netdev_max_backlog;
+extern atomic_t netdev_rx_dropped;
+extern unsigned long netdev_fc_xoff;
+#ifdef CONFIG_NET_FASTROUTE
+extern int netdev_fastroute;
+extern int netdev_fastroute_obstacles;
+extern void dev_clear_fastroute(struct device *dev);
+extern struct net_fastroute_stats dev_fastroute_stat;
+#endif
#endif /* __KERNEL__ */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 8766af2b4..83d9fae1b 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -46,6 +46,7 @@ struct nlmsghdr
#define NLM_F_REPLACE 0x100 /* Override existing */
#define NLM_F_EXCL 0x200 /* Do not touch, if it exists */
#define NLM_F_CREATE 0x400 /* Create, if it does not exist */
+#define NLM_F_APPEND 0x800 /* Add to end of list */
/*
4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL
@@ -65,6 +66,7 @@ struct nlmsghdr
(struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
#define NLMSG_OK(nlh,len) ((nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
(nlh)->nlmsg_len <= (len))
+#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
#define NLMSG_NOOP 0x1 /* Nothing. */
#define NLMSG_ERROR 0x2 /* Error */
@@ -119,6 +121,7 @@ struct netlink_callback
struct nlmsghdr *nlh;
int (*dump)(struct sk_buff * skb, struct netlink_callback *cb);
int (*done)(struct netlink_callback *cb);
+ int family;
long args[4];
};
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index c8ea8ffdf..c4aab89e1 100644
--- a/include/linux/nfs.h
+++ b/include/linux/nfs.h
@@ -33,6 +33,7 @@ enum nfs_stat {
NFSERR_EAGAIN = 11,
NFSERR_ACCES = 13,
NFSERR_EXIST = 17,
+ NFSERR_XDEV = 18,
NFSERR_NODEV = 19,
NFSERR_NOTDIR = 20,
NFSERR_ISDIR = 21,
@@ -137,6 +138,13 @@ struct nfs_fsinfo {
__u32 bavail;
};
+struct nfs_writeargs {
+ struct nfs_fh * fh;
+ __u32 offset;
+ __u32 count;
+ const void * buffer;
+};
+
#ifdef NFS_NEED_XDR_TYPES
struct nfs_sattrargs {
@@ -156,13 +164,6 @@ struct nfs_readargs {
void * buffer;
};
-struct nfs_writeargs {
- struct nfs_fh * fh;
- __u32 offset;
- __u32 count;
- const void * buffer;
-};
-
struct nfs_createargs {
struct nfs_fh * fh;
const char * name;
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 3c869e38d..a7b51b977 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -11,9 +11,10 @@
#include <linux/signal.h>
#include <linux/sched.h>
-#include <linux/nfs.h>
#include <linux/in.h>
-#include <linux/sunrpc/debug.h>
+
+#include <linux/sunrpc/sched.h>
+#include <linux/nfs.h>
#include <linux/nfs_mount.h>
/*
@@ -53,11 +54,12 @@
*/
#define NFS_SUPER_MAGIC 0x6969
+#define NFS_FH(dentry) ((struct nfs_fh *) ((dentry)->d_fsdata))
+#define NFS_DSERVER(dentry) (&(dentry)->d_sb->u.nfs_sb.s_server)
#define NFS_SERVER(inode) (&(inode)->i_sb->u.nfs_sb.s_server)
#define NFS_CLIENT(inode) (NFS_SERVER(inode)->client)
#define NFS_ADDR(inode) (RPC_PEERADDR(NFS_CLIENT(inode)))
#define NFS_CONGESTED(inode) (RPC_CONGESTED(NFS_CLIENT(inode)))
-#define NFS_FH(inode) (&(inode)->u.nfs_i.fhandle)
#define NFS_READTIME(inode) ((inode)->u.nfs_i.read_cache_jiffies)
#define NFS_OLDMTIME(inode) ((inode)->u.nfs_i.read_cache_mtime)
@@ -76,8 +78,6 @@ do { \
#define NFS_FLAGS(inode) ((inode)->u.nfs_i.flags)
#define NFS_REVALIDATING(inode) (NFS_FLAGS(inode) & NFS_INO_REVALIDATE)
-
-#define NFS_RENAMED_DIR(inode) ((inode)->u.nfs_i.silly_inode)
#define NFS_WRITEBACK(inode) ((inode)->u.nfs_i.writeback)
/*
@@ -88,6 +88,48 @@ do { \
#ifdef __KERNEL__
/*
+ * This struct describes a file region to be written.
+ * It's kind of a pity we have to keep all these lists ourselves, rather
+ * than sticking an extra pointer into struct page.
+ */
+struct nfs_wreq {
+ struct rpc_listitem wb_list; /* linked list of req's */
+ struct rpc_task wb_task; /* RPC task */
+ struct dentry * wb_dentry; /* dentry referenced */
+ struct inode * wb_inode; /* inode referenced */
+ struct page * wb_page; /* page to be written */
+ unsigned int wb_offset; /* offset within page */
+ unsigned int wb_bytes; /* dirty range */
+ pid_t wb_pid; /* owner process */
+ unsigned short wb_flags; /* status flags */
+
+ struct nfs_writeargs wb_args; /* NFS RPC stuff */
+ struct nfs_fattr wb_fattr; /* file attributes */
+};
+#define wb_status wb_task.tk_status
+
+#define WB_NEXT(req) ((struct nfs_wreq *) ((req)->wb_list.next))
+
+/*
+ * Various flags for wb_flags
+ */
+#define NFS_WRITE_WANTLOCK 0x0001 /* needs to lock page */
+#define NFS_WRITE_LOCKED 0x0002 /* holds lock on page */
+#define NFS_WRITE_CANCELLED 0x0004 /* has been cancelled */
+#define NFS_WRITE_UNCOMMITTED 0x0008 /* written but uncommitted (NFSv3) */
+#define NFS_WRITE_INVALIDATE 0x0010 /* invalidate after write */
+#define NFS_WRITE_INPROGRESS 0x0100 /* RPC call in progress */
+#define NFS_WRITE_COMPLETE 0x0200 /* RPC call completed */
+
+#define WB_WANTLOCK(req) ((req)->wb_flags & NFS_WRITE_WANTLOCK)
+#define WB_HAVELOCK(req) ((req)->wb_flags & NFS_WRITE_LOCKED)
+#define WB_CANCELLED(req) ((req)->wb_flags & NFS_WRITE_CANCELLED)
+#define WB_UNCOMMITTED(req) ((req)->wb_flags & NFS_WRITE_UNCOMMITTED)
+#define WB_INVALIDATE(req) ((req)->wb_flags & NFS_WRITE_INVALIDATE)
+#define WB_INPROGRESS(req) ((req)->wb_flags & NFS_WRITE_INPROGRESS)
+#define WB_COMPLETE(req) ((req)->wb_flags & NFS_WRITE_COMPLETE)
+
+/*
* linux/fs/nfs/proc.c
*/
extern int nfs_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
@@ -135,11 +177,11 @@ extern int nfs_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle,
*/
extern struct super_block *nfs_read_super(struct super_block *, void *, int);
extern int init_nfs_fs(void);
-extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
- struct nfs_fattr *);
+extern struct inode *nfs_fhget(struct dentry *, struct nfs_fh *,
+ struct nfs_fattr *);
extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
-extern int nfs_revalidate(struct inode *);
-extern int _nfs_revalidate_inode(struct nfs_server *, struct inode *);
+extern int nfs_revalidate(struct dentry *);
+extern int _nfs_revalidate_inode(struct nfs_server *, struct dentry *);
/*
* linux/fs/nfs/file.c
@@ -150,6 +192,7 @@ extern struct inode_operations nfs_file_inode_operations;
* linux/fs/nfs/dir.c
*/
extern struct inode_operations nfs_dir_inode_operations;
+extern struct dentry_operations nfs_dentry_operations;
extern void nfs_free_dircache(void);
extern void nfs_invalidate_dircache(struct inode *);
extern void nfs_invalidate_dircache_sb(struct super_block *);
@@ -162,25 +205,25 @@ extern struct inode_operations nfs_symlink_inode_operations;
/*
* linux/fs/nfs/locks.c
*/
-extern int nfs_lock(struct file *file, int cmd, struct file_lock *fl);
+extern int nfs_lock(struct file *, int, struct file_lock *);
/*
* linux/fs/nfs/write.c
*/
-extern int nfs_writepage(struct inode *, struct page *);
+extern int nfs_writepage(struct file *, struct page *);
+extern int nfs_find_dentry_request(struct inode *, struct dentry *);
extern int nfs_check_failed_request(struct inode *);
extern int nfs_check_error(struct inode *);
extern int nfs_flush_dirty_pages(struct inode *, pid_t, off_t, off_t);
extern int nfs_truncate_dirty_pages(struct inode *, unsigned long);
extern void nfs_invalidate_pages(struct inode *);
-extern int nfs_updatepage(struct inode *, struct page *, const char *,
+extern int nfs_updatepage(struct file *, struct page *, const char *,
unsigned long, unsigned int, int);
/*
* linux/fs/nfs/read.c
*/
-extern int nfs_readpage(struct inode *, struct page *);
-extern int nfs_readpage_sync(struct inode *, struct page *);
+extern int nfs_readpage(struct file *, struct page *);
/*
* linux/fs/mount_clnt.c
@@ -192,11 +235,12 @@ extern int nfs_mount(struct sockaddr_in *, char *, struct nfs_fh *);
* inline functions
*/
static inline int
-nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
+nfs_revalidate_inode(struct nfs_server *server, struct dentry *dentry)
{
+ struct inode *inode = dentry->d_inode;
if (jiffies - NFS_READTIME(inode) < NFS_ATTRTIMEO(inode))
return 0;
- return _nfs_revalidate_inode(server, inode);
+ return _nfs_revalidate_inode(server, dentry);
}
extern struct nfs_wreq * nfs_failed_requests;
@@ -210,14 +254,7 @@ nfs_write_error(struct inode *inode)
/* NFS root */
-#define NFS_ROOT "/tftpboot/%s"
-#define NFS_ROOT_NAME_LEN 256
-#define NFS_ROOT_ADDRS_LEN 128
-
extern int nfs_root_mount(struct super_block *sb);
-extern int nfs_root_init(char *nfsname, char *nfsaddrs);
-extern char nfs_root_name[];
-extern char nfs_root_addrs[];
#endif /* __KERNEL__ */
diff --git a/include/linux/nfs_fs_i.h b/include/linux/nfs_fs_i.h
index b0163ec22..885f21f01 100644
--- a/include/linux/nfs_fs_i.h
+++ b/include/linux/nfs_fs_i.h
@@ -16,11 +16,6 @@ struct nfs_inode_info {
struct pipe_inode_info pipeinfo;
/*
- * The file handle
- */
- struct nfs_fh fhandle;
-
- /*
* Various flags
*/
unsigned short flags;
@@ -58,6 +53,7 @@ struct nfs_inode_info {
* Legal inode flag values
*/
#define NFS_INO_REVALIDATE 0x0001 /* revalidating attrs */
+#define NFS_IS_SNAPSHOT 0x0010 /* a snapshot file */
/*
* NFS lock info
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index c1bedfbdf..343455ec9 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -5,8 +5,7 @@
#include <linux/in.h>
/*
- * NFS client parameters
- * Part of this is duplicated in rpc_clnt and is therefore obsolete.
+ * NFS client parameters stored in the superblock.
*/
struct nfs_server {
struct rpc_clnt * client; /* RPC client handle */
@@ -18,7 +17,7 @@ struct nfs_server {
unsigned int acregmax;
unsigned int acdirmin;
unsigned int acdirmax;
- char hostname[256]; /* remote hostname */
+ char * hostname; /* remote hostname */
};
/*
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 4869c7ef8..d7f0851fe 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -111,6 +111,9 @@ int nfsd_statfs(struct svc_rqst *, struct svc_fh *,
int nfsd_notify_change(struct inode *, struct iattr *);
int nfsd_permission(struct svc_export *, struct dentry *, int);
+/* nfsd/nfsctl.c */
+void nfsd_modcount(struct inode *, int);
+
/*
* lockd binding
*/
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index f0577b05d..3e3410776 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -70,6 +70,8 @@ typedef struct svc_fh {
* Shorthand for dprintk()'s
*/
#define SVCFH_DENTRY(f) ((f)->fh_dentry)
+#define SVCFH_INO(f) ((f)->fh_handle.fh_ino)
+#define SVCFH_DEV(f) ((f)->fh_handle.fh_dev)
/*
* Function prototypes
@@ -114,12 +116,16 @@ fh_lock(struct svc_fh *fhp)
dfprintk(FILEOP, "nfsd: fh_lock(%x/%ld) locked = %d\n",
SVCFH_DEV(fhp), SVCFH_INO(fhp), fhp->fh_locked);
*/
- if (!fhp->fh_locked) {
- down(&inode->i_sem);
- if (!fhp->fh_pre_mtime)
- fhp->fh_pre_mtime = inode->i_mtime;
- fhp->fh_locked = 1;
+ if (fhp->fh_locked) {
+ printk(KERN_WARNING "fh_lock: %s/%s already locked!\n",
+ fhp->fh_dentry->d_parent->d_name.name,
+ fhp->fh_dentry->d_name.name);
+ return;
}
+ down(&inode->i_sem);
+ if (!fhp->fh_pre_mtime)
+ fhp->fh_pre_mtime = inode->i_mtime;
+ fhp->fh_locked = 1;
}
/*
@@ -128,9 +134,8 @@ fh_lock(struct svc_fh *fhp)
static inline void
fh_unlock(struct svc_fh *fhp)
{
- struct inode *inode = fhp->fh_dentry->d_inode;
-
if (fhp->fh_locked) {
+ struct inode *inode = fhp->fh_dentry->d_inode;
if (!fhp->fh_post_version)
fhp->fh_post_version = inode->i_version;
fhp->fh_locked = 0;
diff --git a/include/linux/nls.h b/include/linux/nls.h
index 73f83633d..3321e2958 100644
--- a/include/linux/nls.h
+++ b/include/linux/nls.h
@@ -52,3 +52,4 @@ extern int init_nls_cp865(void);
extern int init_nls_cp866(void);
extern int init_nls_cp869(void);
extern int init_nls_cp874(void);
+extern int init_nls_koi8_r(void);
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 86db4508f..a9842306e 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -97,6 +97,7 @@ extern __inline__ int notifier_call_chain(struct notifier_block **n, unsigned lo
#define NETDEV_UNREGISTER 0x0006
#define NETDEV_CHANGEMTU 0x0007
#define NETDEV_CHANGEADDR 0x0008
+#define NETDEV_GOING_DOWN 0x0009
#define SYS_DOWN 0x0001 /* Notify of system down */
#define SYS_RESTART SYS_DOWN
diff --git a/include/linux/ntfs_fs.h b/include/linux/ntfs_fs.h
new file mode 100644
index 000000000..acbfc2939
--- /dev/null
+++ b/include/linux/ntfs_fs.h
@@ -0,0 +1,7 @@
+#ifndef _LINUX_NTFS_FS_H
+#define _LINUX_NTFS_FS_H
+
+int init_ntfs_fs(void);
+
+#endif
+
diff --git a/include/linux/ntfs_fs_i.h b/include/linux/ntfs_fs_i.h
new file mode 100644
index 000000000..dbb0289fd
--- /dev/null
+++ b/include/linux/ntfs_fs_i.h
@@ -0,0 +1,79 @@
+#ifndef _LINUX_NTFS_FS_I_H
+#define _LINUX_NTFS_FS_I_H
+
+/* Forward declarations, to keep number of mutual includes low */
+struct ntfs_attribute;
+struct ntfs_sb_info;
+
+/* Duplicate definitions from ntfs/types.h */
+#ifndef NTFS_INTEGRAL_TYPES
+#define NTFS_INTEGRAL_TYPES
+typedef unsigned char ntfs_u8;
+typedef unsigned short ntfs_u16;
+typedef unsigned int ntfs_u32;
+typedef unsigned long long ntfs_u64;
+#endif
+
+#ifndef NTMODE_T
+#define NTMODE_T
+typedef __kernel_mode_t ntmode_t;
+#endif
+#ifndef NTFS_UID_T
+#define NTFS_UID_T
+typedef __kernel_uid_t ntfs_uid_t;
+#endif
+#ifndef NTFS_GID_T
+#define NTFS_GID_T
+typedef __kernel_gid_t ntfs_gid_t;
+#endif
+#ifndef NTFS_SIZE_T
+#define NTFS_SIZE_T
+typedef __kernel_size_t ntfs_size_t;
+#endif
+#ifndef NTFS_TIME_T
+#define NTFS_TIME_T
+typedef __kernel_time_t ntfs_time_t;
+#endif
+
+/* unicode character type */
+#ifndef NTFS_WCHAR_T
+#define NTFS_WCHAR_T
+typedef unsigned short ntfs_wchar_t;
+#endif
+/* file offset */
+#ifndef NTFS_OFFSET_T
+#define NTFS_OFFSET_T
+typedef unsigned long long ntfs_offset_t;
+#endif
+/* UTC */
+#ifndef NTFS_TIME64_T
+#define NTFS_TIME64_T
+typedef unsigned long long ntfs_time64_t;
+#endif
+/* This is really unsigned long long. So we support only volumes up to 2 TB */
+#ifndef NTFS_CLUSTER_T
+#define NTFS_CLUSTER_T
+typedef unsigned int ntfs_cluster_t;
+#endif
+
+/* Definition of NTFS in-memory inode structure */
+struct ntfs_inode_info{
+ struct ntfs_sb_info *vol;
+ int i_number; /* should be really 48 bits */
+ unsigned sequence_number;
+ unsigned char* attr; /* array of the attributes */
+ int attr_count; /* size of attrs[] */
+ struct ntfs_attribute *attrs;
+ int record_count; /* size of records[] */
+ /* array of the record numbers of the MFT
+ whose attributes have been inserted in the inode */
+ int *records;
+ union{
+ struct{
+ int recordsize;
+ int clusters_per_record;
+ }index;
+ } u;
+};
+
+#endif
diff --git a/include/linux/ntfs_fs_sb.h b/include/linux/ntfs_fs_sb.h
new file mode 100644
index 000000000..898ef7105
--- /dev/null
+++ b/include/linux/ntfs_fs_sb.h
@@ -0,0 +1,44 @@
+#ifndef _LINUX_NTFS_FS_SB_H
+#define _LINUX_NTFS_FS_SB_H
+
+struct ntfs_sb_info{
+ /* Configuration provided by user at mount time */
+ ntfs_uid_t uid;
+ ntfs_gid_t gid;
+ ntmode_t umask;
+ unsigned int nct;
+ void *nls_map;
+ unsigned int ngt;
+ /* Configuration provided by user with ntfstools */
+ ntfs_size_t partition_bias; /* for access to underlying device */
+ /* Attribute definitions */
+ ntfs_u32 at_standard_information;
+ ntfs_u32 at_attribute_list;
+ ntfs_u32 at_file_name;
+ ntfs_u32 at_security_descriptor;
+ ntfs_u32 at_data;
+ ntfs_u32 at_index_root;
+ ntfs_u32 at_index_allocation;
+ ntfs_u32 at_bitmap;
+ ntfs_u32 at_symlink; /* aka SYMBOLIC_LINK or REPARSE_POINT */
+ /* Data read from the boot file */
+ int blocksize;
+ int clusterfactor;
+ int clustersize;
+ int mft_recordsize;
+ int mft_clusters_per_record;
+ int index_recordsize;
+ int index_clusters_per_record;
+ int mft_cluster;
+ /* data read from special files */
+ unsigned char *mft;
+ unsigned short *upcase;
+ unsigned int upcase_length;
+ /* inodes we always hold onto */
+ struct ntfs_inode_info *mft_ino;
+ struct ntfs_inode_info *mftmirr;
+ struct ntfs_inode_info *bitmap;
+ struct super_block *sb;
+};
+
+#endif
diff --git a/include/linux/parport.h b/include/linux/parport.h
index 6a2bbd183..35b7fbb5a 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -1,22 +1,74 @@
-/* $Id: parport.h,v 1.3 1997/10/19 18:02:00 phil Exp $ */
+/* $Id: parport.h,v 1.6 1997/12/29 12:31:05 phil Exp $ */
#ifndef _PARPORT_H_
#define _PARPORT_H_
-#include <asm/system.h>
-#include <asm/ptrace.h>
-#include <linux/proc_fs.h>
+/* Start off with user-visible constants */
/* Maximum of 8 ports per machine */
#define PARPORT_MAX 8
/* Magic numbers */
-#define PARPORT_IRQ_NONE -2
-#define PARPORT_DMA_NONE -2
-#define PARPORT_IRQ_AUTO -1
-#define PARPORT_DMA_AUTO -1
+#define PARPORT_IRQ_NONE -1
+#define PARPORT_DMA_NONE -1
+#define PARPORT_IRQ_AUTO -2
+#define PARPORT_DMA_AUTO -2
#define PARPORT_DISABLE -2
+#define PARPORT_CONTROL_STROBE 0x1
+#define PARPORT_CONTROL_AUTOFD 0x2
+#define PARPORT_CONTROL_INIT 0x4
+#define PARPORT_CONTROL_SELECT 0x8
+#define PARPORT_CONTROL_INTEN 0x10
+#define PARPORT_CONTROL_DIRECTION 0x20
+
+#define PARPORT_STATUS_ERROR 0x8
+#define PARPORT_STATUS_SELECT 0x10
+#define PARPORT_STATUS_PAPEROUT 0x20
+#define PARPORT_STATUS_ACK 0x40
+#define PARPORT_STATUS_BUSY 0x80
+
+/* Type classes for Plug-and-Play probe. */
+typedef enum {
+ PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */
+ PARPORT_CLASS_PRINTER,
+ PARPORT_CLASS_MODEM,
+ PARPORT_CLASS_NET,
+ PARPORT_CLASS_HDC, /* Hard disk controller */
+ PARPORT_CLASS_PCMCIA,
+ PARPORT_CLASS_MEDIA, /* Multimedia device */
+ PARPORT_CLASS_FDC, /* Floppy disk controller */
+ PARPORT_CLASS_PORTS,
+ PARPORT_CLASS_SCANNER,
+ PARPORT_CLASS_DIGCAM,
+ PARPORT_CLASS_OTHER, /* Anything else */
+ PARPORT_CLASS_UNSPEC /* No CLS field in ID */
+} parport_device_class;
+
+/* The "modes" entry in parport is a bit field representing the following
+ * modes.
+ * Note that PARPORT_MODE_PCECPEPP is for the SMC EPP+ECP mode which is NOT
+ * 100% compatible with EPP.
+ */
+#define PARPORT_MODE_PCSPP 0x0001
+#define PARPORT_MODE_PCPS2 0x0002
+#define PARPORT_MODE_PCEPP 0x0004
+#define PARPORT_MODE_PCECP 0x0008
+#define PARPORT_MODE_PCECPEPP 0x0010
+#define PARPORT_MODE_PCECR 0x0020 /* ECR Register Exists */
+#define PARPORT_MODE_PCECPPS2 0x0040
+
+/* The rest is for the kernel only */
+#ifdef __KERNEL__
+
+#include <asm/system.h>
+#include <asm/ptrace.h>
+#include <asm/spinlock.h>
+#include <linux/proc_fs.h>
+#include <linux/config.h>
+
+#define PARPORT_NEED_GENERIC_OPS
+
/* Define this later. */
struct parport;
@@ -29,51 +81,35 @@ struct parport_state {
union {
struct pc_parport_state pc;
/* ARC has no state. */
+ /* AX uses same state information as PC */
void *misc;
} u;
};
-/* Generic operations vector through the dispatch table. */
-#define parport_write_data(p,x) (p)->ops->write_data(p,x)
-#define parport_read_data(p) (p)->ops->read_data(p)
-#define parport_write_control(p,x) (p)->ops->write_control(p,x)
-#define parport_read_control(p) (p)->ops->read_control(p)
-#define parport_frob_control(p,m,v) (p)->ops->frob_control(p,m,v)
-#define parport_write_econtrol(p,x) (p)->ops->write_econtrol(p,x)
-#define parport_read_econtrol(p) (p)->ops->read_econtrol(p)
-#define parport_frob_econtrol(p,m,v) (p)->ops->frob_econtrol(p,m,v)
-#define parport_write_status(p,v) (p)->ops->write_status(p,v)
-#define parport_read_status(p) (p)->ops->read_status(p)
-#define parport_write_fifo(p,v) (p)->ops->write_fifo(p,v)
-#define parport_read_fifo(p) (p)->ops->read_fifo(p)
-#define parport_change_mode(p,m) (p)->ops->change_mode(p,m)
-#define parport_release_resources(p) (p)->ops->release_resources(p)
-#define parport_claim_resources(p) (p)->ops->claim_resources(p)
-
struct parport_operations {
- void (*write_data)(struct parport *, unsigned int);
- unsigned int (*read_data)(struct parport *);
- void (*write_control)(struct parport *, unsigned int);
- unsigned int (*read_control)(struct parport *);
- unsigned int (*frob_control)(struct parport *, unsigned int mask, unsigned int val);
- void (*write_econtrol)(struct parport *, unsigned int);
- unsigned int (*read_econtrol)(struct parport *);
- unsigned int (*frob_econtrol)(struct parport *, unsigned int mask, unsigned int val);
- void (*write_status)(struct parport *, unsigned int);
- unsigned int (*read_status)(struct parport *);
- void (*write_fifo)(struct parport *, unsigned int);
- unsigned int (*read_fifo)(struct parport *);
+ void (*write_data)(struct parport *, unsigned char);
+ unsigned char (*read_data)(struct parport *);
+ void (*write_control)(struct parport *, unsigned char);
+ unsigned char (*read_control)(struct parport *);
+ unsigned char (*frob_control)(struct parport *, unsigned char mask, unsigned char val);
+ void (*write_econtrol)(struct parport *, unsigned char);
+ unsigned char (*read_econtrol)(struct parport *);
+ unsigned char (*frob_econtrol)(struct parport *, unsigned char mask, unsigned char val);
+ void (*write_status)(struct parport *, unsigned char);
+ unsigned char (*read_status)(struct parport *);
+ void (*write_fifo)(struct parport *, unsigned char);
+ unsigned char (*read_fifo)(struct parport *);
void (*change_mode)(struct parport *, int);
void (*release_resources)(struct parport *);
int (*claim_resources)(struct parport *);
- unsigned int (*epp_write_block)(struct parport *, void *, unsigned int);
- unsigned int (*epp_read_block)(struct parport *, void *, unsigned int);
+ size_t (*epp_write_block)(struct parport *, void *, size_t);
+ size_t (*epp_read_block)(struct parport *, void *, size_t);
- unsigned int (*ecp_write_block)(struct parport *, void *, unsigned int, void (*fn)(struct parport *, void *, unsigned int), void *);
- unsigned int (*ecp_read_block)(struct parport *, void *, unsigned int, void (*fn)(struct parport *, void *, unsigned int), void *);
+ int (*ecp_write_block)(struct parport *, void *, size_t, void (*fn)(struct parport *, void *, size_t), void *);
+ int (*ecp_read_block)(struct parport *, void *, size_t, void (*fn)(struct parport *, void *, size_t), void *);
void (*save_state)(struct parport *, struct parport_state *);
void (*restore_state)(struct parport *, struct parport_state *);
@@ -86,36 +122,6 @@ struct parport_operations {
void (*dec_use_count)(void);
};
-#define PARPORT_CONTROL_STROBE 0x1
-#define PARPORT_CONTROL_AUTOFD 0x2
-#define PARPORT_CONTROL_INIT 0x4
-#define PARPORT_CONTROL_SELECT 0x8
-#define PARPORT_CONTROL_INTEN 0x10
-#define PARPORT_CONTROL_DIRECTION 0x20
-
-#define PARPORT_STATUS_ERROR 0x8
-#define PARPORT_STATUS_SELECT 0x10
-#define PARPORT_STATUS_PAPEROUT 0x20
-#define PARPORT_STATUS_ACK 0x40
-#define PARPORT_STATUS_BUSY 0x80
-
-/* Type classes for Plug-and-Play probe. */
-typedef enum {
- PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */
- PARPORT_CLASS_PRINTER,
- PARPORT_CLASS_MODEM,
- PARPORT_CLASS_NET,
- PARPORT_CLASS_HDC, /* Hard disk controller */
- PARPORT_CLASS_PCMCIA,
- PARPORT_CLASS_MEDIA, /* Multimedia device */
- PARPORT_CLASS_FDC, /* Floppy disk controller */
- PARPORT_CLASS_PORTS,
- PARPORT_CLASS_SCANNER,
- PARPORT_CLASS_DIGCAM,
- PARPORT_CLASS_OTHER, /* Anything else */
- PARPORT_CLASS_UNSPEC /* No CLS field in ID */
-} parport_device_class;
-
struct parport_device_info {
parport_device_class class;
char *mfr;
@@ -144,18 +150,26 @@ struct pardevice {
void (*wakeup)(void *);
void *private;
void (*irq_func)(int, void *, struct pt_regs *);
- int flags;
+ unsigned int flags;
struct pardevice *next;
struct pardevice *prev;
struct parport_state *state; /* saved status over preemption */
+ struct wait_queue *wait_q;
+ unsigned long int time;
+ unsigned long int timeslice;
+ unsigned int waiting;
+ struct pardevice *waitprev;
+ struct pardevice *waitnext;
};
+/* Directory information for the /proc interface */
struct parport_dir {
struct proc_dir_entry *entry; /* Directory /proc/parport/X */
- struct proc_dir_entry *irq; /* IRQ entry /proc/parport/X/irq */
- struct proc_dir_entry *devices; /* /proc/parport/X/devices */
- struct proc_dir_entry *hardware; /* /proc/parport/X/hardware */
- char name[4]; /* /proc/parport/"XXXX" */
+ struct proc_dir_entry *irq; /* .../irq */
+ struct proc_dir_entry *devices; /* .../devices */
+ struct proc_dir_entry *hardware; /* .../hardware */
+ struct proc_dir_entry *probe; /* .../autoprobe */
+ char name[4];
};
/* A parallel port */
@@ -169,16 +183,21 @@ struct parport {
struct pardevice *devices;
struct pardevice *cad; /* port owner */
- struct pardevice *lurker;
+
+ struct pardevice *waithead;
+ struct pardevice *waittail;
struct parport *next;
- unsigned int flags;
+ unsigned int flags;
struct parport_dir pdir;
struct parport_device_info probe_info;
struct parport_operations *ops;
void *private_data; /* for lowlevel driver */
+
+ int number; /* port index - the `n' in `parportn' */
+ spinlock_t lock;
};
/* parport_register_port registers a new parallel port at the given address (if
@@ -190,14 +209,14 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma,
struct parport_operations *ops);
/* Unregister a port. */
-void parport_unregister_port(struct parport *port);
+extern void parport_unregister_port(struct parport *port);
/* parport_in_use returns nonzero if there are devices attached to a port. */
#define parport_in_use(x) ((x)->devices != NULL)
/* Put a parallel port to sleep; release its hardware resources. Only possible
* if no devices are registered. */
-void parport_quiesce(struct parport *);
+extern void parport_quiesce(struct parport *);
/* parport_enumerate returns a pointer to the linked list of all the ports
* in this machine.
@@ -219,13 +238,17 @@ struct pardevice *parport_register_device(struct parport *port,
int flags, void *handle);
/* parport_unregister unlinks a device from the chain. */
-void parport_unregister_device(struct pardevice *dev);
+extern void parport_unregister_device(struct pardevice *dev);
/* parport_claim tries to gain ownership of the port for a particular driver.
* This may fail (return non-zero) if another driver is busy. If this
* driver has registered an interrupt handler, it will be enabled.
*/
-int parport_claim(struct pardevice *dev);
+extern int parport_claim(struct pardevice *dev);
+
+/* parport_claim_or_block is the same, but sleeps if the port cannot be
+ claimed. Return value is 1 if it slept, 0 normally and -errno on error. */
+extern int parport_claim_or_block(struct pardevice *dev);
/* parport_release reverses a previous parport_claim. This can never fail,
* though the effects are undefined (except that they are bad) if you didn't
@@ -235,20 +258,32 @@ int parport_claim(struct pardevice *dev);
* If you mess with the port state (enabling ECP for example) you should
* clean up before releasing the port.
*/
-void parport_release(struct pardevice *dev);
-/* The "modes" entry in parport is a bit field representing the following
- * modes.
- * Note that LP_ECPEPP is for the SMC EPP+ECP mode which is NOT
- * 100% compatible with EPP.
+extern void parport_release(struct pardevice *dev);
+
+/* parport_yield relinquishes the port if it would be helpful to other
+ * drivers. The return value is the same as for parport_claim.
*/
-#define PARPORT_MODE_PCSPP 0x0001
-#define PARPORT_MODE_PCPS2 0x0002
-#define PARPORT_MODE_PCEPP 0x0004
-#define PARPORT_MODE_PCECP 0x0008
-#define PARPORT_MODE_PCECPEPP 0x0010
-#define PARPORT_MODE_PCECR 0x0020 /* ECR Register Exists */
-#define PARPORT_MODE_PCECPPS2 0x0040
+extern __inline__ unsigned int parport_yield(struct pardevice *dev)
+{
+ unsigned long int timeslip = (jiffies - dev->time);
+ if ((dev->port->waithead == NULL) || (timeslip < dev->timeslice))
+ return 0;
+ parport_release(dev);
+ return parport_claim(dev);
+}
+
+/* parport_yield_blocking is the same but uses parport_claim_or_block
+ * instead of parport_claim.
+ */
+extern __inline__ unsigned int parport_yield_blocking(struct pardevice *dev)
+{
+ unsigned long int timeslip = (jiffies - dev->time);
+ if ((dev->port->waithead == NULL) || (timeslip < dev->timeslice))
+ return 0;
+ parport_release(dev);
+ return parport_claim_or_block(dev);
+}
/* Flags used to identify what a device does. */
#define PARPORT_DEV_TRAN 0x0000 /* We're transient. */
@@ -262,7 +297,7 @@ extern int parport_wait_peripheral(struct parport *, unsigned char, unsigned
/* Prototypes from parport_procfs */
extern int parport_proc_init(void);
-extern int parport_proc_cleanup(void);
+extern void parport_proc_cleanup(void);
extern int parport_proc_register(struct parport *pp);
extern int parport_proc_unregister(struct parport *pp);
@@ -273,4 +308,45 @@ extern int parport_probe(struct parport *port, char *buffer, int len);
extern void parport_probe_one(struct parport *port);
extern void (*parport_probe_hook)(struct parport *port);
+/* If PC hardware is the only type supported, we can optimise a bit. */
+#if (defined(CONFIG_PARPORT_PC) || defined(CONFIG_PARPORT_PC_MODULE)) && !(defined(CONFIG_PARPORT_AX) || defined(CONFIG_PARPORT_AX_MODULE)) && !(defined(CONFIG_PARPORT_ARC) || defined(CONFIG_PARPORT_ARC_MODULE)) && !defined(CONFIG_PARPORT_OTHER)
+#undef PARPORT_NEED_GENERIC_OPS
+#include <linux/parport_pc.h>
+#define parport_write_data(p,x) parport_pc_write_data(p,x)
+#define parport_read_data(p) parport_pc_read_data(p)
+#define parport_write_control(p,x) parport_pc_write_control(p,x)
+#define parport_read_control(p) parport_pc_read_control(p)
+#define parport_frob_control(p,m,v) parport_pc_frob_control(p,m,v)
+#define parport_write_econtrol(p,x) parport_pc_write_econtrol(p,x)
+#define parport_read_econtrol(p) parport_pc_read_econtrol(p)
+#define parport_frob_econtrol(p,m,v) parport_pc_frob_econtrol(p,m,v)
+#define parport_write_status(p,v) parport_pc_write_status(p,v)
+#define parport_read_status(p) parport_pc_read_status(p)
+#define parport_write_fifo(p,v) parport_pc_write_fifo(p,v)
+#define parport_read_fifo(p) parport_pc_read_fifo(p)
+#define parport_change_mode(p,m) parport_pc_change_mode(p,m)
+#define parport_release_resources(p) parport_pc_release_resources(p)
+#define parport_claim_resources(p) parport_pc_claim_resources(p)
+#endif
+
+#ifdef PARPORT_NEED_GENERIC_OPS
+/* Generic operations vector through the dispatch table. */
+#define parport_write_data(p,x) (p)->ops->write_data(p,x)
+#define parport_read_data(p) (p)->ops->read_data(p)
+#define parport_write_control(p,x) (p)->ops->write_control(p,x)
+#define parport_read_control(p) (p)->ops->read_control(p)
+#define parport_frob_control(p,m,v) (p)->ops->frob_control(p,m,v)
+#define parport_write_econtrol(p,x) (p)->ops->write_econtrol(p,x)
+#define parport_read_econtrol(p) (p)->ops->read_econtrol(p)
+#define parport_frob_econtrol(p,m,v) (p)->ops->frob_econtrol(p,m,v)
+#define parport_write_status(p,v) (p)->ops->write_status(p,v)
+#define parport_read_status(p) (p)->ops->read_status(p)
+#define parport_write_fifo(p,v) (p)->ops->write_fifo(p,v)
+#define parport_read_fifo(p) (p)->ops->read_fifo(p)
+#define parport_change_mode(p,m) (p)->ops->change_mode(p,m)
+#define parport_release_resources(p) (p)->ops->release_resources(p)
+#define parport_claim_resources(p) (p)->ops->claim_resources(p)
+#endif
+
+#endif /* __KERNEL__ */
#endif /* _PARPORT_H_ */
diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h
new file mode 100644
index 000000000..45f4c0fb8
--- /dev/null
+++ b/include/linux/parport_pc.h
@@ -0,0 +1,117 @@
+#ifndef __LINUX_PARPORT_PC_H
+#define __LINUX_PARPORT_PC_H
+
+#include <asm/io.h>
+
+/* --- register definitions ------------------------------- */
+
+#define ECONTROL 0x402
+#define CONFIGB 0x401
+#define CONFIGA 0x400
+#define EPPREG 0x4
+#define CONTROL 0x2
+#define STATUS 0x1
+#define DATA 0
+
+extern __inline__ void parport_pc_write_epp(struct parport *p, unsigned char d)
+{
+ outb(d, p->base+EPPREG);
+}
+
+extern __inline__ unsigned char parport_pc_read_epp(struct parport *p)
+{
+ return inb(p->base+EPPREG);
+}
+
+extern __inline__ unsigned char parport_pc_read_configb(struct parport *p)
+{
+ return inb(p->base+CONFIGB);
+}
+
+extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
+{
+ outb(d, p->base+DATA);
+}
+
+extern __inline__ unsigned char parport_pc_read_data(struct parport *p)
+{
+ return inb(p->base+DATA);
+}
+
+extern __inline__ void parport_pc_write_control(struct parport *p, unsigned char d)
+{
+ outb(d, p->base+CONTROL);
+}
+
+extern __inline__ unsigned char parport_pc_read_control(struct parport *p)
+{
+ return inb(p->base+CONTROL);
+}
+
+extern __inline__ unsigned char parport_pc_frob_control(struct parport *p, unsigned char mask, unsigned char val)
+{
+ unsigned char old = inb(p->base+CONTROL);
+ outb(((old & ~mask) ^ val), p->base+CONTROL);
+ return old;
+}
+
+extern __inline__ void parport_pc_write_status(struct parport *p, unsigned char d)
+{
+ outb(d, p->base+STATUS);
+}
+
+extern __inline__ unsigned char parport_pc_read_status(struct parport *p)
+{
+ return inb(p->base+STATUS);
+}
+
+extern __inline__ void parport_pc_write_econtrol(struct parport *p, unsigned char d)
+{
+ outb(d, p->base+ECONTROL);
+}
+
+extern __inline__ unsigned char parport_pc_read_econtrol(struct parport *p)
+{
+ return inb(p->base+ECONTROL);
+}
+
+extern __inline__ unsigned char parport_pc_frob_econtrol(struct parport *p, unsigned char mask, unsigned char val)
+{
+ unsigned char old = inb(p->base+ECONTROL);
+ outb(((old & ~mask) ^ val), p->base+ECONTROL);
+ return old;
+}
+
+extern void parport_pc_change_mode(struct parport *p, int m);
+
+extern void parport_pc_write_fifo(struct parport *p, unsigned char v);
+
+extern unsigned char parport_pc_read_fifo(struct parport *p);
+
+extern void parport_pc_disable_irq(struct parport *p);
+
+extern void parport_pc_enable_irq(struct parport *p);
+
+extern void parport_pc_release_resources(struct parport *p);
+
+extern int parport_pc_claim_resources(struct parport *p);
+
+extern void parport_pc_save_state(struct parport *p, struct parport_state *s);
+
+extern void parport_pc_restore_state(struct parport *p, struct parport_state *s);
+
+extern size_t parport_pc_epp_read_block(struct parport *p, void *buf, size_t length);
+
+extern size_t parport_pc_epp_write_block(struct parport *p, void *buf, size_t length);
+
+extern int parport_pc_ecp_read_block(struct parport *p, void *buf, size_t length, void (*fn)(struct parport *, void *, size_t), void *handle);
+
+extern int parport_pc_ecp_write_block(struct parport *p, void *buf, size_t length, void (*fn)(struct parport *, void *, size_t), void *handle);
+
+extern int parport_pc_examine_irq(struct parport *p);
+
+extern void parport_pc_inc_use_count(void);
+
+extern void parport_pc_dec_use_count(void);
+
+#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index d242a9912..138710213 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1,48 +1,27 @@
/*
- * PCI defines and function prototypes
- * Copyright 1994, Drew Eckhardt
+ * $Id: pci.h,v 1.51 1997/12/27 13:55:23 mj Exp $
*
- * For more information, please consult
- *
- * PCI BIOS Specification Revision
- * PCI Local Bus Specification
- * PCI System Design Guide
+ * PCI defines and function prototypes
+ * Copyright 1994, Drew Eckhardt
+ * Copyright 1997, Martin Mares <mj@atrey.karlin.mff.cuni.cz>
*
- * PCI Special Interest Group
- * M/S HF3-15A
- * 5200 N.E. Elam Young Parkway
- * Hillsboro, Oregon 97124-6497
- * +1 (503) 696-2000
- * +1 (800) 433-5177
+ * For more information, please consult
*
- * Manuals are $25 each or $50 for all three, plus $7 shipping
- * within the United States, $35 abroad.
- */
-
-
-
-/* PROCEDURE TO REPORT NEW PCI DEVICES
- * We are trying to collect information on new PCI devices, using
- * the standard PCI identification procedure. If some warning is
- * displayed at boot time, please report
- * - /proc/pci
- * - your exact hardware description. Try to find out
- * which device is unknown. It may be your mainboard chipset.
- * PCI-CPU bridge or PCI-ISA bridge.
- * - If you can't find the actual information in your hardware
- * booklet, try to read the references of the chip on the board.
- * - Send all that to linux-pcisupport@cck.uni-kl.de
- * and I'll add your device to the list as soon as possible
+ * PCI BIOS Specification Revision
+ * PCI Local Bus Specification
+ * PCI System Design Guide
*
- * BEFORE you send a mail, please check the latest linux releases
- * to be sure it has not been recently added.
- *
- * Thanks
- * Jens Maurer
+ * PCI Special Interest Group
+ * M/S HF3-15A
+ * 5200 N.E. Elam Young Parkway
+ * Hillsboro, Oregon 97124-6497
+ * +1 (503) 696-2000
+ * +1 (800) 433-5177
+ *
+ * Manuals are $25 each or $50 for all three, plus $7 shipping
+ * within the United States, $35 abroad.
*/
-
-
#ifndef LINUX_PCI_H
#define LINUX_PCI_H
@@ -102,7 +81,7 @@
*/
#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */
#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits */
-#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits */
+#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */
#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */
#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */
#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */
@@ -118,6 +97,7 @@
#define PCI_BASE_ADDRESS_IO_MASK (~0x03)
/* bit 1 is reserved if address_space = 1 */
+/* Header type 0 (normal devices) */
#define PCI_CARDBUS_CIS 0x28
#define PCI_SUBSYSTEM_ID 0x2c
#define PCI_SUBSYSTEM_VENDOR_ID 0x2e
@@ -131,6 +111,46 @@
#define PCI_MIN_GNT 0x3e /* 8 bits */
#define PCI_MAX_LAT 0x3f /* 8 bits */
+/* Header type 1 (PCI-to-PCI bridges) */
+#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */
+#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */
+#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */
+#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */
+#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */
+#define PCI_IO_LIMIT 0x1d
+#define PCI_IO_RANGE_TYPE_MASK 0x0f /* I/O bridging type */
+#define PCI_IO_RANGE_TYPE_16 0x00
+#define PCI_IO_RANGE_TYPE_32 0x01
+#define PCI_IO_RANGE_MASK ~0x0f
+#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */
+#define PCI_MEMORY_BASE 0x20 /* Memory range behind */
+#define PCI_MEMORY_LIMIT 0x22
+#define PCI_MEMORY_RANGE_TYPE_MASK 0x0f
+#define PCI_MEMORY_RANGE_MASK ~0x0f
+#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */
+#define PCI_PREF_MEMORY_LIMIT 0x26
+#define PCI_PREF_RANGE_TYPE_MASK 0x0f
+#define PCI_PREF_RANGE_TYPE_32 0x00
+#define PCI_PREF_RANGE_TYPE_64 0x01
+#define PCI_PREF_RANGE_MASK ~0x0f
+#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */
+#define PCI_PREF_LIMIT_UPPER32 0x2c
+#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */
+#define PCI_IO_LIMIT_UPPER16 0x32
+/* 0x34-0x3b is reserved */
+#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */
+/* 0x3c-0x3d are same as for htype 0 */
+#define PCI_BRIDGE_CONTROL 0x3e
+#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */
+#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */
+#define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */
+#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */
+#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */
+#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */
+#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */
+
+/* Device classes and subclasses */
+
#define PCI_CLASS_NOT_DEFINED 0x0000
#define PCI_CLASS_NOT_DEFINED_VGA 0x0001
@@ -175,7 +195,6 @@
#define PCI_CLASS_BRIDGE_CARDBUS 0x0607
#define PCI_CLASS_BRIDGE_OTHER 0x0680
-
#define PCI_BASE_CLASS_COMMUNICATION 0x07
#define PCI_CLASS_COMMUNICATION_SERIAL 0x0700
#define PCI_CLASS_COMMUNICATION_PARALLEL 0x0701
@@ -241,13 +260,14 @@
#define PCI_DEVICE_ID_NCR_53C895 0x000c
#define PCI_DEVICE_ID_NCR_53C885 0x000d
#define PCI_DEVICE_ID_NCR_53C875 0x000f
-#define PCI_DEVICE_ID_NCR_53C876 0x008f
+#define PCI_DEVICE_ID_NCR_53C875J 0x008f
#define PCI_VENDOR_ID_ATI 0x1002
#define PCI_DEVICE_ID_ATI_68800 0x4158
#define PCI_DEVICE_ID_ATI_215CT222 0x4354
#define PCI_DEVICE_ID_ATI_210888CX 0x4358
#define PCI_DEVICE_ID_ATI_215GB 0x4742
+#define PCI_DEVICE_ID_ATI_215GD 0x4744
#define PCI_DEVICE_ID_ATI_215GP 0x4750
#define PCI_DEVICE_ID_ATI_215GT 0x4754
#define PCI_DEVICE_ID_ATI_215GTB 0x4755
@@ -261,6 +281,10 @@
#define PCI_DEVICE_ID_VLSI_82C597 0x0009
#define PCI_DEVICE_ID_VLSI_82C541 0x000c
#define PCI_DEVICE_ID_VLSI_82C543 0x000d
+#define PCI_DEVICE_ID_VLSI_82C532 0x0101
+#define PCI_DEVICE_ID_VLSI_82C534 0x0102
+#define PCI_DEVICE_ID_VLSI_82C535 0x0104
+#define PCI_DEVICE_ID_VLSI_82C147 0x0105
#define PCI_DEVICE_ID_VLSI_VAS96011 0x0702
#define PCI_VENDOR_ID_ADL 0x1005
@@ -291,6 +315,7 @@
#define PCI_DEVICE_ID_DEC_TULIP_PLUS 0x0014
#define PCI_DEVICE_ID_DEC_21142 0x0019
#define PCI_DEVICE_ID_DEC_21052 0x0021
+#define PCI_DEVICE_ID_DEC_21150 0x0022
#define PCI_DEVICE_ID_DEC_21152 0x0024
#define PCI_VENDOR_ID_CIRRUS 0x1013
@@ -313,7 +338,10 @@
#define PCI_DEVICE_ID_IBM_FIRE_CORAL 0x000a
#define PCI_DEVICE_ID_IBM_TR 0x0018
#define PCI_DEVICE_ID_IBM_82G2675 0x001d
+#define PCI_DEVICE_ID_IBM_MCA 0x0020
#define PCI_DEVICE_ID_IBM_82351 0x0022
+#define PCI_DEVICE_ID_IBM_SERVERAID 0x002e
+#define PCI_DEVICE_ID_IBM_MPEG2 0x007d
#define PCI_VENDOR_ID_WD 0x101c
#define PCI_DEVICE_ID_WD_7197 0x3296
@@ -323,6 +351,7 @@
#define PCI_DEVICE_ID_AMD_SCSI 0x2020
#define PCI_VENDOR_ID_TRIDENT 0x1023
+#define PCI_DEVICE_ID_TRIDENT_9397 0x9397
#define PCI_DEVICE_ID_TRIDENT_9420 0x9420
#define PCI_DEVICE_ID_TRIDENT_9440 0x9440
#define PCI_DEVICE_ID_TRIDENT_9660 0x9660
@@ -336,6 +365,7 @@
#define PCI_DEVICE_ID_MATROX_MIL 0x0519
#define PCI_DEVICE_ID_MATROX_MYS 0x051A
#define PCI_DEVICE_ID_MATROX_MIL_2 0x051b
+#define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f
#define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10
#define PCI_VENDOR_ID_CT 0x102c
@@ -356,8 +386,8 @@
#define PCI_VENDOR_ID_SI 0x1039
#define PCI_DEVICE_ID_SI_6201 0x0001
#define PCI_DEVICE_ID_SI_6202 0x0002
-#define PCI_DEVICE_ID_SI_6205 0x0205
#define PCI_DEVICE_ID_SI_503 0x0008
+#define PCI_DEVICE_ID_SI_6205 0x0205
#define PCI_DEVICE_ID_SI_501 0x0406
#define PCI_DEVICE_ID_SI_496 0x0496
#define PCI_DEVICE_ID_SI_601 0x0601
@@ -372,12 +402,12 @@
#define PCI_DEVICE_ID_HP_J2585A 0x1030
#define PCI_DEVICE_ID_HP_J2585B 0x1031
-#define PCI_VENDOR_ID_HOLTEK 0x9412
-#define PCI_DEVICE_ID_HOLTEK_6565 0x6565
-
#define PCI_VENDOR_ID_PCTECH 0x1042
#define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000
#define PCI_DEVICE_ID_PCTECH_RZ1001 0x1001
+#define PCI_DEVICE_ID_PCTECH_SAMURAI_0 0x3000
+#define PCI_DEVICE_ID_PCTECH_SAMURAI_1 0x3010
+#define PCI_DEVICE_ID_PCTECH_SAMURAI_IDE 0x3020
#define PCI_VENDOR_ID_DPT 0x1044
#define PCI_DEVICE_ID_DPT 0xa400
@@ -391,6 +421,7 @@
#define PCI_DEVICE_ID_OPTI_82C701 0xc701
#define PCI_DEVICE_ID_OPTI_82C814 0xc814
#define PCI_DEVICE_ID_OPTI_82C822 0xc822
+#define PCI_DEVICE_ID_OPTI_82C825 0xd568
#define PCI_VENDOR_ID_SGS 0x104a
#define PCI_DEVICE_ID_SGS_2000 0x0008
@@ -406,6 +437,7 @@
#define PCI_DEVICE_ID_TI_TVP4020 0x3d07
#define PCI_DEVICE_ID_TI_PCI1130 0xac12
#define PCI_DEVICE_ID_TI_PCI1131 0xac15
+#define PCI_DEVICE_ID_TI_PCI1250 0xac16
#define PCI_VENDOR_ID_OAK 0x104e
#define PCI_DEVICE_ID_OAK_OTI107 0x0107
@@ -456,11 +488,22 @@
#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020
#define PCI_DEVICE_ID_QLOGIC_ISP1022 0x1022
+#define PCI_VENDOR_ID_CYRIX 0x1078
+#define PCI_DEVICE_ID_CYRIX_5510 0x0000
+#define PCI_DEVICE_ID_CYRIX_PCI_MASTER 0x0001
+#define PCI_DEVICE_ID_CYRIX_5520 0x0002
+#define PCI_DEVICE_ID_CYRIX_5530_LEGACY 0x0100
+#define PCI_DEVICE_ID_CYRIX_5530_SMI 0x0101
+#define PCI_DEVICE_ID_CYRIX_5530_IDE 0x0102
+#define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103
+#define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104
+
#define PCI_VENDOR_ID_LEADTEK 0x107d
#define PCI_DEVICE_ID_LEADTEK_805 0x0000
#define PCI_VENDOR_ID_CONTAQ 0x1080
#define PCI_DEVICE_ID_CONTAQ_82C599 0x0600
+/* ??? Alpha SX164 has reference to device nr 0xc693 as a CYPRESS bridge. */
#define PCI_VENDOR_ID_FOREX 0x1083
@@ -489,6 +532,8 @@
#define PCI_VENDOR_ID_BROOKTREE 0x109e
#define PCI_DEVICE_ID_BROOKTREE_848 0x0350
+#define PCI_DEVICE_ID_BROOKTREE_849A 0x0351
+#define PCI_DEVICE_ID_BROOKTREE_8474 0x8474
#define PCI_VENDOR_ID_SIERRA 0x10a8
#define PCI_DEVICE_ID_SIERRA_STB 0x0000
@@ -504,6 +549,9 @@
#define PCI_VENDOR_ID_DATABOOK 0x10b3
#define PCI_DEVICE_ID_DATABOOK_87144 0xb106
+#define PCI_VENDOR_ID_PLX 0x10b5
+#define PCI_DEVICE_ID_PLX_9080 0x9080
+
#define PCI_VENDOR_ID_3COM 0x10b7
#define PCI_DEVICE_ID_3COM_3C590 0x5900
#define PCI_DEVICE_ID_3COM_3C595TX 0x5950
@@ -528,9 +576,11 @@
#define PCI_DEVICE_ID_AL_M1523 0x1523
#define PCI_DEVICE_ID_AL_M1531 0x1531
#define PCI_DEVICE_ID_AL_M1533 0x1533
+#define PCI_DEVICE_ID_AL_M3307 0x3307
#define PCI_DEVICE_ID_AL_M4803 0x5215
#define PCI_DEVICE_ID_AL_M5219 0x5219
#define PCI_DEVICE_ID_AL_M5229 0x5229
+#define PCI_DEVICE_ID_AL_M5237 0x5237
#define PCI_VENDOR_ID_MITSUBISHI 0x10ba
@@ -546,6 +596,7 @@
#define PCI_VENDOR_ID_ASP 0x10cd
#define PCI_DEVICE_ID_ASP_ABP940 0x1200
#define PCI_DEVICE_ID_ASP_ABP940U 0x1300
+#define PCI_DEVICE_ID_ASP_ABP940UW 0x2300
#define PCI_VENDOR_ID_CERN 0x10dc
#define PCI_DEVICE_ID_CERN_SPSB_PMC 0x0001
@@ -565,6 +616,7 @@
#define PCI_VENDOR_ID_AMCC 0x10e8
#define PCI_DEVICE_ID_AMCC_MYRINET 0x8043
#define PCI_DEVICE_ID_AMCC_S5933 0x807d
+#define PCI_DEVICE_ID_AMCC_S5933_HEPC3 0x809c
#define PCI_VENDOR_ID_INTERG 0x10ea
#define PCI_DEVICE_ID_INTERG_1680 0x1680
@@ -579,6 +631,7 @@
#define PCI_VENDOR_ID_INIT 0x1101
#define PCI_DEVICE_ID_INIT_320P 0x9100
+#define PCI_DEVICE_ID_INIT_360P 0x9500
#define PCI_VENDOR_ID_VIA 0x1106
#define PCI_DEVICE_ID_VIA_82C505 0x0505
@@ -588,11 +641,13 @@
#define PCI_DEVICE_ID_VIA_82C585 0x0585
#define PCI_DEVICE_ID_VIA_82C586_0 0x0586
#define PCI_DEVICE_ID_VIA_82C595 0x0595
+#define PCI_DEVICE_ID_VIA_82C597_0 0x0597
#define PCI_DEVICE_ID_VIA_82C926 0x0926
#define PCI_DEVICE_ID_VIA_82C416 0x1571
#define PCI_DEVICE_ID_VIA_82C595_97 0x1595
#define PCI_DEVICE_ID_VIA_82C586_2 0x3038
#define PCI_DEVICE_ID_VIA_82C586_3 0x3040
+#define PCI_DEVICE_ID_VIA_82C597_1 0x8597
#define PCI_VENDOR_ID_VORTEX 0x1119
#define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000
@@ -642,8 +697,8 @@
#define PCI_VENDOR_ID_PHILIPS 0x1131
#define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146
-#define PCI_VENDOR_ID_PLX 0x113c
-#define PCI_DEVICE_ID_PLX_9060 0x0001
+#define PCI_VENDOR_ID_CYCLONE 0x113c
+#define PCI_DEVICE_ID_CYCLONE_SDK 0x0001
#define PCI_VENDOR_ID_ALLIANCE 0x1142
#define PCI_DEVICE_ID_ALLIANCE_PROMOTIO 0x3210
@@ -655,20 +710,32 @@
#define PCI_DEVICE_ID_VMIC_VME 0x7587
#define PCI_VENDOR_ID_DIGI 0x114f
+#define PCI_DEVICE_ID_DIGI_EPC 0x0002
#define PCI_DEVICE_ID_DIGI_RIGHTSWITCH 0x0003
+#define PCI_DEVICE_ID_DIGI_XEM 0x0004
+#define PCI_DEVICE_ID_DIGI_XR 0x0005
+#define PCI_DEVICE_ID_DIGI_CX 0x0006
+#define PCI_DEVICE_ID_DIGI_XRJ 0x0009
+#define PCI_DEVICE_ID_DIGI_EPCJ 0x000a
#define PCI_VENDOR_ID_MUTECH 0x1159
#define PCI_DEVICE_ID_MUTECH_MV1000 0x0001
#define PCI_VENDOR_ID_RENDITION 0x1163
#define PCI_DEVICE_ID_RENDITION_VERITE 0x0001
+#define PCI_DEVICE_ID_RENDITION_VERITE2100 0x2000
#define PCI_VENDOR_ID_TOSHIBA 0x1179
#define PCI_DEVICE_ID_TOSHIBA_601 0x0601
+#define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a
+#define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f
#define PCI_VENDOR_ID_RICOH 0x1180
#define PCI_DEVICE_ID_RICOH_RL5C466 0x0466
+#define PCI_VENDOR_ID_ARTOP 0x1191
+#define PCI_DEVICE_ID_ARTOP_ATP850UF 0x0005
+
#define PCI_VENDOR_ID_ZEITNET 0x1193
#define PCI_DEVICE_ID_ZEITNET_1221 0x0001
#define PCI_DEVICE_ID_ZEITNET_1225 0x0002
@@ -685,6 +752,9 @@
#define PCI_VENDOR_ID_NP 0x11bc
#define PCI_DEVICE_ID_NP_PCI_FDDI 0x0001
+#define PCI_VENDOR_ID_ATT 0x11c1
+#define PCI_DEVICE_ID_ATT_L56XMF 0x0440
+
#define PCI_VENDOR_ID_SPECIALIX 0x11cb
#define PCI_DEVICE_ID_SPECIALIX_XIO 0x4000
#define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000
@@ -716,12 +786,21 @@
#define PCI_DEVICE_ID_CYCLOM_Z_Lo 0x0200
#define PCI_DEVICE_ID_CYCLOM_Z_Hi 0x0201
+#define PCI_VENDOR_ID_O2 0x1217
+#define PCI_DEVICE_ID_O2_6832 0x6832
+
#define PCI_VENDOR_ID_3DFX 0x121a
#define PCI_DEVICE_ID_3DFX_VOODOO 0x0001
+#define PCI_DEVICE_ID_3DFX_VOODOO2 0x0002
#define PCI_VENDOR_ID_SIGMADES 0x1236
#define PCI_DEVICE_ID_SIGMADES_6425 0x6401
+#define PCI_VENDOR_ID_STALLION 0x124d
+#define PCI_DEVICE_ID_STALLION_ECHPCI832 0x0000
+#define PCI_DEVICE_ID_STALLION_ECHPCI864 0x0002
+#define PCI_DEVICE_ID_STALLION_EIOPCI 0x0003
+
#define PCI_VENDOR_ID_OPTIBASE 0x1255
#define PCI_DEVICE_ID_OPTIBASE_FORGE 0x1110
#define PCI_DEVICE_ID_OPTIBASE_FUSION 0x1210
@@ -775,6 +854,10 @@
#define PCI_DEVICE_ID_S3_PLATO_PXG 0x8902
#define PCI_DEVICE_ID_S3_ViRGE_DXGX 0x8a01
#define PCI_DEVICE_ID_S3_ViRGE_GX2 0x8a10
+#define PCI_DEVICE_ID_S3_ViRGE_MX 0x8c01
+#define PCI_DEVICE_ID_S3_ViRGE_MXP 0x8c02
+#define PCI_DEVICE_ID_S3_ViRGE_MXPMV 0x8c03
+#define PCI_DEVICE_ID_S3_SONICVIBES 0xca00
#define PCI_VENDOR_ID_INTEL 0x8086
#define PCI_DEVICE_ID_INTEL_82375 0x0482
@@ -833,12 +916,14 @@
#define PCI_VENDOR_ID_ATRONICS 0x907f
#define PCI_DEVICE_ID_ATRONICS_2015 0x2015
+#define PCI_VENDOR_ID_HOLTEK 0x9412
+#define PCI_DEVICE_ID_HOLTEK_6565 0x6565
+
#define PCI_VENDOR_ID_ARK 0xedd8
#define PCI_DEVICE_ID_ARK_STING 0xa091
#define PCI_DEVICE_ID_ARK_STINGARK 0xa099
#define PCI_DEVICE_ID_ARK_2000MT 0xa0a1
-#ifdef __KERNEL__
/*
* The PCI interface treats multi-function devices as independent
* devices. The slot/function address of each device is encoded
@@ -851,6 +936,7 @@
#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
#define PCI_FUNC(devfn) ((devfn) & 0x07)
+#ifdef __KERNEL__
/*
* There is one pci_dev structure for each slot-number/function-number
* combination:
@@ -902,32 +988,16 @@ struct pci_bus {
unsigned char subordinate; /* max number of subordinate buses */
};
-/*
- * This is used to map a vendor-id/device-id pair into device-specific
- * information.
- */
-struct pci_dev_info {
- unsigned short vendor; /* vendor id */
- unsigned short device; /* device id */
-
- const char *name; /* device name */
- unsigned char bridge_type; /* bridge type or 0xff */
-};
-
extern struct pci_bus pci_root; /* root bus */
extern struct pci_dev *pci_devices; /* list of all devices */
-
extern unsigned long pci_init (unsigned long mem_start, unsigned long mem_end);
-extern unsigned int pci_scan_bus(struct pci_bus *bus, unsigned long *mem_startp);
-
-extern struct pci_dev_info *pci_lookup_dev (unsigned int vendor,
- unsigned int dev);
-extern const char *pci_strclass (unsigned int class);
-extern const char *pci_strvendor (unsigned int vendor);
-extern const char *pci_strdev (unsigned int vendor, unsigned int device);
+extern unsigned int pci_scan_bus (struct pci_bus *bus, unsigned long *mem_startp);
extern int get_pci_list (char *buf);
+
+extern void pci_quirks_init (void);
+
#endif /* __KERNEL__ */
#endif /* LINUX_PCI_H */
diff --git a/include/linux/personality.h b/include/linux/personality.h
index 71599e3ee..67233278a 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -8,12 +8,14 @@
/* Flags for bug emulation. These occupy the top three bytes. */
#define STICKY_TIMEOUTS 0x4000000
#define WHOLE_SECONDS 0x2000000
+#define ADDR_LIMIT_32BIT 0x0800000
/* Personality types. These go in the low byte. Avoid using the top bit,
* it will conflict with error returns.
*/
#define PER_MASK (0x00ff)
#define PER_LINUX (0x0000)
+#define PER_LINUX_32BIT (0x0000 | ADDR_LIMIT_32BIT)
#define PER_SVR4 (0x0001 | STICKY_TIMEOUTS)
#define PER_SVR3 (0x0002 | STICKY_TIMEOUTS)
#define PER_SCOSVR3 (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS)
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 01c4d1519..b849b5751 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -1,4 +1,5 @@
#ifndef _LINUX_POLL_H
+#define _LINUX_POLL_H
#include <asm/poll.h>
@@ -10,6 +11,7 @@
struct poll_table_entry {
+ struct file * filp;
struct wait_queue wait;
struct wait_queue ** wait_address;
};
@@ -21,7 +23,7 @@ typedef struct poll_table_struct {
#define __MAX_POLL_TABLE_ENTRIES (PAGE_SIZE / sizeof (struct poll_table_entry))
-extern inline void poll_wait(struct wait_queue ** wait_address, poll_table *p)
+extern inline void poll_wait(struct file * filp, struct wait_queue ** wait_address, poll_table *p)
{
struct poll_table_entry * entry;
@@ -30,6 +32,8 @@ extern inline void poll_wait(struct wait_queue ** wait_address, poll_table *p)
if (p->nr >= __MAX_POLL_TABLE_ENTRIES)
return;
entry = p->entry + p->nr;
+ entry->filp = filp;
+ filp->f_count++;
entry->wait_address = wait_address;
entry->wait.task = current;
entry->wait.next = NULL;
diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h
index 3bb4337d1..2cdc35715 100644
--- a/include/linux/ppp-comp.h
+++ b/include/linux/ppp-comp.h
@@ -28,7 +28,7 @@
*/
/*
- * ==FILEVERSION 970501==
+ * ==FILEVERSION 971024==
*
* NOTE TO MAINTAINERS:
* If you modify this file at all, please set the above date.
@@ -120,9 +120,8 @@ struct compressor {
* Don't you just lurve software patents.
*/
-#define DECOMP_OK 0 /* no error occured */
-#define DECOMP_ERROR 1 /* error detected before decomp. */
-#define DECOMP_FATALERROR 2 /* error detected after decomp. */
+#define DECOMP_ERROR -1 /* error detected before decomp. */
+#define DECOMP_FATALERROR -2 /* error detected after decomp. */
/*
* CCP codes.
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 2d2a7453e..5fd4821e2 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -36,9 +36,6 @@ enum root_directory_inos {
PROC_KSYMS,
PROC_DMA,
PROC_IOPORTS,
-#ifdef __SMP_PROF__
- PROC_SMP_PROF,
-#endif
PROC_PROFILE, /* whether enabled or not */
PROC_CMDLINE,
PROC_SYS,
@@ -51,8 +48,8 @@ enum root_directory_inos {
PROC_HARDWARE,
PROC_SLABINFO,
PROC_PARPORT,
- PROC_OMIRR, /* whether enabled or not */
- PROC_PPC_HTAB
+ PROC_PPC_HTAB,
+ PROC_SOUND
};
enum pid_directory_inos {
@@ -71,6 +68,7 @@ enum pid_directory_inos {
#if CONFIG_AP1000
PROC_PID_RINGBUF,
#endif
+ PROC_PID_CPU,
};
enum pid_subdirectory_inos {
@@ -199,6 +197,12 @@ enum mca_directory_inos {
PROC_MCA_LAST = (PROC_MCA_SLOT + 8)
};
+enum bus_directory_inos {
+ PROC_BUS_PCI = PROC_MCA_LAST,
+ PROC_BUS_PCI_DEVICES,
+ PROC_BUS_LAST
+};
+
/* Finally, the dynamically allocatable proc entries are reserved: */
#define PROC_DYNAMIC_FIRST 4096
@@ -244,6 +248,7 @@ struct proc_dir_entry {
int count, int *eof, void *data);
int (*write_proc)(struct file *file, const char *buffer,
unsigned long count, void *data);
+ int (*readlink_proc)(struct proc_dir_entry *de, char *page);
unsigned int count; /* use count */
int deleted; /* delete flag */
};
@@ -264,12 +269,13 @@ extern struct proc_dir_entry proc_openprom;
extern struct proc_dir_entry proc_pid;
extern struct proc_dir_entry proc_pid_fd;
extern struct proc_dir_entry proc_mca;
+extern struct proc_dir_entry *proc_bus;
extern struct inode_operations proc_scsi_inode_operations;
extern void proc_root_init(void);
extern void proc_base_init(void);
-extern void proc_net_init(void);
+extern void proc_bus_pci_init(void);
extern int proc_register(struct proc_dir_entry *, struct proc_dir_entry *);
extern int proc_unregister(struct proc_dir_entry *, int);
diff --git a/include/linux/route.h b/include/linux/route.h
index 2582f9a89..e670dbac5 100644
--- a/include/linux/route.h
+++ b/include/linux/route.h
@@ -12,6 +12,9 @@
*
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
*
+ * Changes:
+ * Mike McLagan : Routing by source
+ *
* 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
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 01f60fb24..4a309eb91 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -5,6 +5,7 @@
#include <linux/netlink.h>
#define RTNL_DEBUG 1
+#define CONFIG_RTNL_OLD_IFINFO 1
/****
@@ -35,48 +36,32 @@
#define RTM_DELRULE (RTM_BASE+17)
#define RTM_GETRULE (RTM_BASE+18)
-#define RTM_MAX (RTM_BASE+19)
+#define RTM_NEWQDISC (RTM_BASE+20)
+#define RTM_DELQDSIC (RTM_BASE+21)
+#define RTM_GETQDISC (RTM_BASE+22)
+#define RTM_NEWTFLOW (RTM_BASE+24)
+#define RTM_DELTFLOW (RTM_BASE+25)
+#define RTM_GETTFLOW (RTM_BASE+26)
-/* Generic structure for encapsulation optional route
- information. It is reminiscent of sockaddr, but with sa_family
- replaced with attribute type.
- It would be good, if constructions of sort:
- struct something {
- struct rtattr rta;
- struct a_content a;
- }
- had correct alignment. It is true for x86, but I have no idea
- how to make it on 64bit architectures. Please, teach me. --ANK
+#define RTM_NEWTFILTER (RTM_BASE+28)
+#define RTM_DELTFILTER (RTM_BASE+29)
+#define RTM_GETTFILTER (RTM_BASE+30)
+
+#define RTM_MAX (RTM_BASE+31)
+
+/*
+ Generic structure for encapsulation optional route information.
+ It is reminiscent of sockaddr, but with sa_family replaced
+ with attribute type.
*/
struct rtattr
{
unsigned short rta_len;
unsigned short rta_type;
-/*
- unsigned char rta_data[0];
- */
-};
-
-enum rtattr_type_t
-{
- RTA_UNSPEC,
- RTA_DST,
- RTA_SRC,
- RTA_IIF,
- RTA_OIF,
- RTA_GATEWAY,
- RTA_PRIORITY,
- RTA_PREFSRC,
- RTA_WINDOW,
- RTA_RTT,
- RTA_MTU,
- RTA_IFNAME
};
-#define RTA_MAX RTA_IFNAME
-
/* Macros to handle rtattributes */
#define RTA_ALIGNTO 4
@@ -88,44 +73,14 @@ enum rtattr_type_t
#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
#define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
+#define RTA_PAYLOAD(rta) ((rta)->rta_len - RTA_LENGTH(0))
-/*
- * "struct rtnexthop" describres all necessary nexthop information,
- * i.e. parameters of path to a destination via this nextop.
- *
- * At the moment it is impossible to set different prefsrc, mtu, window
- * and rtt for different paths from multipath.
- */
-
-struct rtnexthop
-{
- unsigned short rtnh_len;
- unsigned char rtnh_flags;
- unsigned char rtnh_hops;
- int rtnh_ifindex;
-/*
- struct rtattr rtnh_data[0];
- */
-};
-
-/* rtnh_flags */
-
-#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */
-#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */
-#define RTNH_F_ONLINK 4 /* Gateway is forced on link */
-/* Macros to handle hexthops */
-
-#define RTNH_ALIGNTO 4
-#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
-#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \
- (rtnh)->rtnh_len <= (len))
-#define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
-#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
-#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
-#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
+/******************************************************************************
+ * Definitions used in routing table administation.
+ ****/
struct rtmsg
{
@@ -133,25 +88,24 @@ struct rtmsg
unsigned char rtm_dst_len;
unsigned char rtm_src_len;
unsigned char rtm_tos;
+
unsigned char rtm_table; /* Routing table id */
unsigned char rtm_protocol; /* Routing protocol; see below */
+#ifdef CONFIG_RTNL_OLD_IFINFO
unsigned char rtm_nhs; /* Number of nexthops */
+#else
+ unsigned char rtm_scope; /* See below */
+#endif
unsigned char rtm_type; /* See below */
+
+#ifdef CONFIG_RTNL_OLD_IFINFO
unsigned short rtm_optlen; /* Byte length of rtm_opt */
unsigned char rtm_scope; /* See below */
unsigned char rtm_whatsit; /* Unused byte */
+#endif
unsigned rtm_flags;
-/*
- struct rtattr rtm_opt[0];
- struct rtnexthop rtm_nh[0];
- */
};
-#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
-#define RTM_RTNH(r) ((struct rtnexthop*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg)) \
- + NLMSG_ALIGN((r)->rtm_optlen)))
-#define RTM_NHLEN(nlh,r) ((nlh)->nlmsg_len - NLMSG_SPACE(sizeof(struct rtmsg)) - NLMSG_ALIGN((r)->rtm_optlen))
-
/* rtm_type */
enum
@@ -174,6 +128,7 @@ enum
#define RTN_MAX RTN_XRESOLVE
+
/* rtm_protocol */
#define RTPROT_UNSPEC 0
@@ -191,15 +146,16 @@ enum
*/
#define RTPROT_GATED 8 /* Apparently, GateD */
-#define RTPROT_RA 9 /* RDISC router advertisment */
-
+#define RTPROT_RA 9 /* RDISC/ND router advertisments */
+#define RTPROT_MRT 10 /* Merit MRT */
+#define RTPROT_ZEBRA 11 /* Zebra */
/* rtm_scope
Really it is not scope, but sort of distance to the destination.
NOWHERE are reserved for not existing destinations, HOST is our
- local addresses, LINK are destinations, locate on directly attached
- link and UNIVERSE is everywhere in the Universe :-)
+ local addresses, LINK are destinations, located on directly attached
+ link and UNIVERSE is everywhere in the Universe.
Intermediate values are also possible f.e. interior routes
could be assigned a value between UNIVERSE and LINK.
@@ -208,7 +164,8 @@ enum
enum rt_scope_t
{
RT_SCOPE_UNIVERSE=0,
-/* User defined values f.e. "site" */
+/* User defined values */
+ RT_SCOPE_SITE=200,
RT_SCOPE_LINK=253,
RT_SCOPE_HOST=254,
RT_SCOPE_NOWHERE=255
@@ -218,8 +175,10 @@ enum rt_scope_t
#define RTM_F_NOTIFY 0x100 /* Notify user of route change */
#define RTM_F_CLONED 0x200 /* This route is cloned */
-#define RTM_F_NOPMTUDISC 0x400 /* Do not make PMTU discovery */
-#define RTM_F_EQUALIZE 0x800 /* Multipath equalizer: NI */
+#define RTM_F_EQUALIZE 0x400 /* Multipath equalizer: NI */
+#ifdef CONFIG_RTNL_OLD_IFINFO
+#define RTM_F_NOPMTUDISC 0x800 /* Do not make PMTU discovery */
+#endif
/* Reserved table identifiers */
@@ -234,6 +193,107 @@ enum rt_class_t
#define RT_TABLE_MAX RT_TABLE_LOCAL
+
+/* Routing message attributes */
+
+enum rtattr_type_t
+{
+ RTA_UNSPEC,
+ RTA_DST,
+ RTA_SRC,
+ RTA_IIF,
+ RTA_OIF,
+ RTA_GATEWAY,
+ RTA_PRIORITY,
+ RTA_PREFSRC,
+#ifndef CONFIG_RTNL_OLD_IFINFO
+ RTA_METRICS,
+ RTA_MULTIPATH,
+ RTA_PROTOINFO,
+ RTA_FLOW,
+#else
+ RTA_WINDOW,
+ RTA_RTT,
+ RTA_MTU,
+ RTA_IFNAME,
+#endif
+ RTA_CACHEINFO
+};
+
+#define RTA_MAX RTA_CACHEINFO
+
+#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
+#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
+
+/* RTM_MULTIPATH --- array of struct rtnexthop.
+ *
+ * "struct rtnexthop" describres all necessary nexthop information,
+ * i.e. parameters of path to a destination via this nextop.
+ *
+ * At the moment it is impossible to set different prefsrc, mtu, window
+ * and rtt for different paths from multipath.
+ */
+
+struct rtnexthop
+{
+ unsigned short rtnh_len;
+ unsigned char rtnh_flags;
+ unsigned char rtnh_hops;
+ int rtnh_ifindex;
+};
+
+/* rtnh_flags */
+
+#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */
+#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */
+#define RTNH_F_ONLINK 4 /* Gateway is forced on link */
+
+/* Macros to handle hexthops */
+
+#define RTNH_ALIGNTO 4
+#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
+#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \
+ (rtnh)->rtnh_len <= (len))
+#define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
+#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
+#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
+#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
+
+#ifdef CONFIG_RTNL_OLD_IFINFO
+#define RTM_RTNH(r) ((struct rtnexthop*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg)) \
+ + NLMSG_ALIGN((r)->rtm_optlen)))
+#define RTM_NHLEN(nlh,r) ((nlh)->nlmsg_len - NLMSG_SPACE(sizeof(struct rtmsg)) - NLMSG_ALIGN((r)->rtm_optlen))
+#endif
+
+/* RTM_CACHEINFO */
+
+struct rta_cacheinfo
+{
+ __u32 rta_clntref;
+ __u32 rta_lastuse;
+ __s32 rta_expires;
+ __u32 rta_error;
+ __u32 rta_used;
+};
+
+/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
+
+enum
+{
+ RTAX_UNSPEC,
+ RTAX_LOCK,
+ RTAX_MTU,
+ RTAX_WINDOW,
+ RTAX_RTT,
+ RTAX_HOPS,
+ RTAX_SSTHRESH,
+ RTAX_CWND,
+};
+
+#define RTAX_MAX RTAX_CWND
+
+
+
/*********************************************************
* Interface address.
****/
@@ -245,9 +305,6 @@ struct ifaddrmsg
unsigned char ifa_flags; /* Flags */
unsigned char ifa_scope; /* See above */
int ifa_index; /* Link index */
-/*
- struct rtattr ifa_data[0];
- */
};
enum
@@ -257,17 +314,29 @@ enum
IFA_LOCAL,
IFA_LABEL,
IFA_BROADCAST,
- IFA_ANYCAST
+ IFA_ANYCAST,
+ IFA_CACHEINFO
};
-#define IFA_MAX IFA_ANYCAST
+#define IFA_MAX IFA_CACHEINFO
/* ifa_flags */
-#define IFA_F_SECONDARY 1
+#define IFA_F_SECONDARY 0x01
+
+#define IFA_F_DEPRECATED 0x20
+#define IFA_F_TENTATIVE 0x40
+#define IFA_F_PERMANENT 0x80
+
+struct ifa_cacheinfo
+{
+ __s32 ifa_prefered;
+ __s32 ifa_valid;
+};
#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
+#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
/*
Important comment:
@@ -283,12 +352,13 @@ enum
struct ndmsg
{
- unsigned char nd_family;
- int nd_ifindex; /* Link index */
- unsigned nd_flags;
-/*
- struct rtattr nd_data[0];
- */
+ unsigned char ndm_family;
+ unsigned char ndm_pad1;
+ unsigned short ndm_pad2;
+ int ndm_ifindex; /* Link index */
+ __u16 ndm_state;
+ __u8 ndm_flags;
+ __u8 ndm_type;
};
enum
@@ -296,11 +366,45 @@ enum
NDA_UNSPEC,
NDA_DST,
NDA_LLADDR,
+ NDA_CACHEINFO
};
-#define NDA_MAX NDA_LLADDR
+#define NDA_MAX NDA_CACHEINFO
#define NDA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
+#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
+
+/*
+ * Neighbor Cache Entry Flags
+ */
+
+#define NTF_PROXY 0x08 /* == ATF_PUBL */
+#define NTF_ROUTER 0x80
+
+/*
+ * Neighbor Cache Entry States.
+ */
+
+#define NUD_INCOMPLETE 0x01
+#define NUD_REACHABLE 0x02
+#define NUD_STALE 0x04
+#define NUD_DELAY 0x08
+#define NUD_PROBE 0x10
+#define NUD_FAILED 0x20
+
+/* Dummy states */
+#define NUD_NOARP 0x40
+#define NUD_PERMANENT 0x80
+#define NUD_NONE 0x00
+
+
+struct nda_cacheinfo
+{
+ __u32 ndm_confirmed;
+ __u32 ndm_used;
+ __u32 ndm_updated;
+ __u32 ndm_refcnt;
+};
/****
* General form of address family dependent message.
@@ -320,6 +424,7 @@ struct rtgenmsg
* on network protocol.
*/
+#ifdef CONFIG_RTNL_OLD_IFINFO
struct ifinfomsg
{
unsigned char ifi_family; /* Dummy */
@@ -336,6 +441,48 @@ struct ifinfomsg
int ifi_qdisc; /* Packet scheduler handle */
};
+enum
+{
+ IFLA_UNSPEC,
+ IFLA_ADDRESS,
+ IFLA_BROADCAST,
+ IFLA_IFNAME,
+ IFLA_QDISC,
+ IFLA_STATS
+};
+
+#else
+
+struct ifinfomsg
+{
+ unsigned char ifi_family;
+ unsigned char __ifi_pad;
+ unsigned short ifi_type; /* ARPHRD_* */
+ int ifi_index; /* Link index */
+ unsigned ifi_flags; /* IFF_* flags */
+ unsigned ifi_change; /* IFF_* change mask */
+};
+
+enum
+{
+ IFLA_UNSPEC,
+ IFLA_ADDRESS,
+ IFLA_BROADCAST,
+ IFLA_IFNAME,
+ IFLA_MTU,
+ IFLA_LINK,
+ IFLA_QDISC,
+ IFLA_STATS
+};
+
+#endif
+
+
+#define IFLA_MAX IFLA_STATS
+
+#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
+#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
+
/* ifi_flags.
IFF_* flags.
@@ -365,47 +512,58 @@ struct ifinfomsg
for IPIP tunnels, when route to endpoint is allowed to change)
*/
+/*****************************************************************
+ * Traffic control messages.
+ ****/
+
+struct tcmsg
+{
+ unsigned char tcm_family;
+ unsigned char tcm__pad1;
+ unsigned short tcm__pad2;
+ int tcm_ifindex;
+ __u32 tcm_handle;
+ __u32 tcm_parent;
+ __u32 tcm_info;
+};
+
+enum
+{
+ TCA_UNSPEC,
+ TCA_KIND,
+ TCA_OPTIONS,
+ TCA_STATS,
+ TCA_XSTATS
+};
+
+#define TCA_MAX TCA_XSTATS
+
+#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
+#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
+
+
+/* SUMMARY: maximal rtattr understood by kernel */
+
+#define RTATTR_MAX RTA_MAX
+
+/* RTnetlink multicast groups */
+
#define RTMGRP_LINK 1
#define RTMGRP_NOTIFY 2
+#define RTMGRP_NEIGH 4
#define RTMGRP_IPV4_IFADDR 0x10
-#define RTMGRP_IPV4_NDISC 0x20
+#define RTMGRP_IPV4_MROUTE 0x20
#define RTMGRP_IPV4_ROUTE 0x40
-#define RTMGRP_IPV4_MROUTE 0x80
#define RTMGRP_IPV6_IFADDR 0x100
-#define RTMGRP_IPV6_NDISC 0x200
+#define RTMGRP_IPV6_MROUTE 0x200
#define RTMGRP_IPV6_ROUTE 0x400
-#define RTMGRP_IPV6_MROUTE 0x800
+/* End of information exported to user level */
#ifdef __KERNEL__
-struct kern_rta
-{
- void *rta_dst;
- void *rta_src;
- int *rta_iif;
- int *rta_oif;
- void *rta_gw;
- u32 *rta_priority;
- void *rta_prefsrc;
- unsigned *rta_window;
- unsigned *rta_rtt;
- unsigned *rta_mtu;
- unsigned char *rta_ifname;
-};
-
-struct kern_ifa
-{
- void *ifa_address;
- void *ifa_local;
- unsigned char *ifa_label;
- void *ifa_broadcast;
- void *ifa_anycast;
-};
-
-
extern atomic_t rtnl_rlockct;
extern struct wait_queue *rtnl_wait;
diff --git a/include/linux/sc26198.h b/include/linux/sc26198.h
index 255241c61..38685e077 100644
--- a/include/linux/sc26198.h
+++ b/include/linux/sc26198.h
@@ -3,7 +3,7 @@
/*
* sc26198.h -- SC26198 UART hardware info.
*
- * Copyright (C) 1995-1997 Stallion Technologies (support@stallion.oz.au).
+ * Copyright (C) 1995-1998 Stallion Technologies (support@stallion.oz.au).
*
* 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
@@ -28,15 +28,15 @@
/*
* Define the number of async ports per sc26198 uart device.
*/
-#define SC26198_PORTS 8
+#define SC26198_PORTS 8
/*
* Baud rate timing clocks. All derived from a master 14.7456 MHz clock.
*/
-#define SC26198_MASTERCLOCK 14745600L
-#define SC26198_DCLK (SC26198_MASTERCLOCK)
-#define SC26198_CCLK (SC26198_MASTERCLOCK / 2)
-#define SC26198_BCLK (SC26198_MASTERCLOCK / 4)
+#define SC26198_MASTERCLOCK 14745600L
+#define SC26198_DCLK (SC26198_MASTERCLOCK)
+#define SC26198_CCLK (SC26198_MASTERCLOCK / 2)
+#define SC26198_BCLK (SC26198_MASTERCLOCK / 4)
/*
* Define internal FIFO sizes for the 26198 ports.
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 3afeaa33c..096d0656c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -75,9 +75,9 @@ extern int last_pid;
#define TASK_RUNNING 0
#define TASK_INTERRUPTIBLE 1
#define TASK_UNINTERRUPTIBLE 2
-#define TASK_ZOMBIE 3
-#define TASK_STOPPED 4
-#define TASK_SWAPPING 5
+#define TASK_ZOMBIE 4
+#define TASK_STOPPED 8
+#define TASK_SWAPPING 16
/*
* Scheduling policies
@@ -140,14 +140,17 @@ struct fs_struct {
NULL, NULL \
}
+/* Maximum number of active map areas.. This is a random (large) number */
+#define MAX_MAP_COUNT (65536)
+
struct mm_struct {
struct vm_area_struct *mmap, *mmap_cache;
pgd_t * pgd;
- int count;
+ int count, map_count;
struct semaphore mmap_sem;
unsigned long context;
unsigned long start_code, end_code, start_data, end_data;
- unsigned long start_brk, brk, start_stack, start_mmap;
+ unsigned long start_brk, brk, start_stack;
unsigned long arg_start, arg_end, env_start, env_end;
unsigned long rss, total_vm, locked_vm;
unsigned long def_flags;
@@ -155,11 +158,11 @@ struct mm_struct {
};
#define INIT_MM { \
- &init_mmap, NULL, swapper_pg_dir, 1, \
+ &init_mmap, NULL, swapper_pg_dir, 1, 1, \
MUTEX, \
0, \
0, 0, 0, 0, \
- 0, 0, 0, 0, \
+ 0, 0, 0, \
0, 0, 0, 0, \
0, 0, 0, \
0, 0 }
@@ -179,13 +182,18 @@ struct signal_struct {
struct task_struct {
/* these are hardcoded - don't touch */
volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
- long counter;
- long priority;
unsigned long flags; /* per process flags, defined below */
int sigpending;
- long debugreg[8]; /* Hardware debugging registers */
+ mm_segment_t addr_limit; /* thread address space:
+ 0-0xBFFFFFFF for user-thead
+ 0-0xFFFFFFFF for kernel-thread
+ */
struct exec_domain *exec_domain;
+
/* various fields */
+ long debugreg[8]; /* Hardware debugging registers */
+ long counter;
+ long priority;
struct linux_binfmt *binfmt;
struct task_struct *next_task, *prev_task;
struct task_struct *next_run, *prev_run;
@@ -226,6 +234,7 @@ struct task_struct {
struct timer_list real_timer;
struct tms times;
unsigned long start_time;
+ long per_cpu_utime[NR_CPUS], per_cpu_stime[NR_CPUS];
/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap;
int swappable:1;
@@ -307,9 +316,9 @@ struct task_struct {
* your own risk!. Base=0, limit=0x1fffff (=2MB)
*/
#define INIT_TASK \
-/* state etc */ { 0,DEF_PRIORITY,DEF_PRIORITY,0,0, \
+/* state etc */ { 0,0,0,KERNEL_DS,&default_exec_domain, \
/* debugregs */ { 0, }, \
-/* exec domain */&default_exec_domain, \
+/* counter */ DEF_PRIORITY,DEF_PRIORITY, \
/* binfmt */ NULL, \
/* schedlink */ &init_task,&init_task, &init_task, &init_task, \
/* ec,brk... */ 0,0,0,0,0,0, \
@@ -323,6 +332,7 @@ struct task_struct {
/* timeout */ 0,SCHED_OTHER,0,0,0,0,0,0,0, \
/* timer */ { NULL, NULL, 0, 0, it_real_fn }, \
/* utime */ {0,0,0,0},0, \
+/* per cpu times */ {0, }, {0, }, \
/* flt */ 0,0,0,0,0,0, \
/* swp */ 0,0,0,0,0, \
/* rlimits */ INIT_RLIMITS, \
@@ -438,12 +448,14 @@ extern int securelevel; /* system security level */
#define CURRENT_TIME (xtime.tv_sec)
+extern void FASTCALL(__wake_up(struct wait_queue ** p, unsigned int mode));
extern void FASTCALL(sleep_on(struct wait_queue ** p));
extern void FASTCALL(interruptible_sleep_on(struct wait_queue ** p));
-extern void FASTCALL(wake_up(struct wait_queue ** p));
-extern void FASTCALL(wake_up_interruptible(struct wait_queue ** p));
extern void FASTCALL(wake_up_process(struct task_struct * tsk));
+#define wake_up(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE)
+#define wake_up_interruptible(x) __wake_up((x),TASK_INTERRUPTIBLE)
+
extern void release(struct task_struct * p);
extern int in_group_p(gid_t grp);
@@ -513,6 +525,11 @@ extern void free_irq(unsigned int irq, void *dev_id);
* it returns true (to do BSD-style accounting where the process is flagged
* if it uses root privs). The implication of this is that you should do
* normal permissions checks first, and check suser() last.
+ *
+ * [Dec 1997 -- Chris Evans]
+ * For correctness, the above considerations need to be extended to
+ * fsuser(). This is done, along with moving fsuser() checks to be
+ * last.
*/
extern inline int suser(void)
{
@@ -523,6 +540,15 @@ extern inline int suser(void)
return 0;
}
+extern inline int fsuser(void)
+{
+ if (current->fsuid == 0) {
+ current->flags |= PF_SUPERPRIV;
+ return 1;
+ }
+ return 0;
+}
+
/*
* Routines for handling mm_structs
*/
diff --git a/include/linux/sdla_fr.h b/include/linux/sdla_fr.h
index c66ee0ec3..533f2acb0 100644
--- a/include/linux/sdla_fr.h
+++ b/include/linux/sdla_fr.h
@@ -1,7 +1,8 @@
/*****************************************************************************
* sdla_fr.h Sangoma frame relay firmware API definitions.
*
-* Author: Gene Kozin <74604.152@compuserve.com>
+* Author: Jaspreet Singh <jaspreet@sangoma.com>
+* Gene Kozin <74604.152@compuserve.com>
*
* Copyright: (c) 1995-1996 Sangoma Technologies Inc.
*
@@ -10,6 +11,9 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
+* Oct 12, 1997 Jaspreet Singh Added FR_READ_DLCI_IB_MAPPING
+* Jul 21, 1997 Jaspreet Singh Changed FRRES_TOO_LONG and FRRES_TOO_MANY to
+* 0x05 and 0x06 respectively.
* Dec 23, 1996 Gene Kozin v2.0
* Apr 29, 1996 Gene Kozin v1.0 (merged version S502 & S508 definitions).
* Sep 26, 1995 Gene Kozin Initial version.
@@ -94,6 +98,7 @@ typedef struct fr_cmd
#define FR_SET_MODEM_STATUS 0x31
#define FR_READ_ERROR_STATS 0x32
#define FR_FLUSH_ERROR_STATS 0x33
+#define FR_READ_DLCI_IB_MAPPING 0x34
#define FR_READ_CODE_VERSION 0x40
#define FR_SET_INTR_MODE 0x50
#define FR_READ_INTR_MODE 0x51
@@ -104,8 +109,8 @@ typedef struct fr_cmd
#define FRRES_INOPERATIVE 0x02 /* channel inoperative */
#define FRRES_DLCI_INACTIVE 0x03 /* DLCI is inactive */
#define FRRES_DLCI_INVALID 0x04 /* DLCI is not configured */
-#define FRRES_TOO_LONG 0x04
-#define FRRES_TOO_MANY 0x05
+#define FRRES_TOO_LONG 0x05
+#define FRRES_TOO_MANY 0x06
#define FRRES_CIR_OVERFLOW 0x07 /* Tx throughput has exceeded CIR */
#define FRRES_BUFFER_OVERFLOW 0x08
#define FRRES_MODEM_FAILURE 0x10 /* DCD and/or CTS dropped */
@@ -160,6 +165,7 @@ typedef struct fr508_flags
unsigned char iflag PACKED; /* 10h: interrupt flag */
unsigned char imask PACKED; /* 11h: interrupt mask */
unsigned long tse_offs PACKED; /* 12h: Tx status element */
+ unsigned short dlci PACKED; /* 16h: DLCI NUMBER */
} fr508_flags_t;
/* 'event' field defines */
diff --git a/include/linux/sdla_x25.h b/include/linux/sdla_x25.h
index 0cff58224..4c0f43725 100644
--- a/include/linux/sdla_x25.h
+++ b/include/linux/sdla_x25.h
@@ -159,7 +159,7 @@ typedef struct X25Cmd
#define X25RES_PROTO_VIOLATION 0x41 /* protocol violation occured */
#define X25RES_PKT_TIMEOUT 0x42 /* X.25 packet time out */
#define X25RES_PKT_RETRY_LIMIT 0x43 /* X.25 packet retry limit exceeded */
-/*----- Command-dependant results -----*/
+/*----- Command-dependent results -----*/
#define X25RES_LINK_DISC 0x00 /* HDLC_LINK_STATUS */
#define X25RES_LINK_IN_ABM 0x01 /* HDLC_LINK_STATUS */
#define X25RES_NO_DATA 0x01 /* HDLC_READ/READ_TRACE_DATA*/
@@ -244,7 +244,8 @@ typedef struct X25Status
unsigned short ogc_map PACKED; /* 06h: Outgoing Chan. map */
TX25TimeStamp tstamp PACKED; /* 08h: timestamp (BCD) */
unsigned char iflags PACKED; /* 0Dh: interrupt flags */
- unsigned char resrv[2] PACKED; /* 0Eh: */
+ unsigned char imask PACKED; /* 0Eh: interrupt mask */
+ unsigned char resrv PACKED; /* 0Eh: */
unsigned char gflags PACKED; /* 10h: misc. HDLC/X25 flags */
unsigned char cflags[X25_MAX_CHAN] PACKED; /* channel status bytes */
} TX25Status;
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 0dd75b886..ff193cd24 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -174,6 +174,11 @@ extern inline void sigdelsetmask(sigset_t *set, unsigned long mask)
set->sig[0] &= ~mask;
}
+extern 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)
{
set->sig[0] = mask;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 3668712d8..e19a95fec 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -23,9 +23,6 @@
#define HAVE_ALLOC_SKB /* For the drivers to know */
#define HAVE_ALIGNABLE_SKB /* Ditto 8) */
-#define FREE_READ 1
-#define FREE_WRITE 0
-
#define CHECKSUM_NONE 0
#define CHECKSUM_HW 1
#define CHECKSUM_UNNECESSARY 2
@@ -78,7 +75,12 @@ struct sk_buff
} mac;
struct dst_entry *dst;
+
+#if (defined(__alpha__) || defined(__sparc64__)) && (defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE))
+ char cb[48]; /* sorry. 64bit pointers have a price */
+#else
char cb[32];
+#endif
__u32 seq; /* TCP sequence number */
__u32 end_seq; /* seq [+ fin] [+ syn] + datalen */
@@ -86,8 +88,7 @@ struct sk_buff
unsigned int len; /* Length of actual data */
unsigned int csum; /* Checksum */
- volatile char used, /* Are we in use ? */
- arp; /* Has IP/ARP resolution finished */
+ volatile char used;
unsigned char tries, /* Times tried */
inclone, /* Inline clone */
pkt_type, /* Packet class */
@@ -137,9 +138,6 @@ struct sk_buff
#include <asm/system.h>
-#if 0
-extern void print_skb(struct sk_buff *);
-#endif
extern void __kfree_skb(struct sk_buff *skb);
extern void skb_queue_head_init(struct sk_buff_head *list);
extern void skb_queue_head(struct sk_buff_head *list,struct sk_buff *buf);
@@ -156,7 +154,7 @@ extern void kfree_skbmem(struct sk_buff *skb);
extern struct sk_buff * skb_clone(struct sk_buff *skb, int priority);
extern struct sk_buff * skb_copy(struct sk_buff *skb, int priority);
extern struct sk_buff * skb_realloc_headroom(struct sk_buff *skb, int newheadroom);
-#define dev_kfree_skb(a, b) kfree_skb((a), (b))
+#define dev_kfree_skb(a) kfree_skb(a)
extern unsigned char * skb_put(struct sk_buff *skb, unsigned int len);
extern unsigned char * skb_push(struct sk_buff *skb, unsigned int len);
extern unsigned char * skb_pull(struct sk_buff *skb, unsigned int len);
@@ -170,7 +168,7 @@ extern __inline__ int skb_queue_empty(struct sk_buff_head *list)
return (list->next == (struct sk_buff *) list);
}
-extern __inline__ void kfree_skb(struct sk_buff *skb, int rw)
+extern __inline__ void kfree_skb(struct sk_buff *skb)
{
if (atomic_dec_and_test(&skb->users))
__kfree_skb(skb);
@@ -193,13 +191,13 @@ extern __inline__ int skb_shared(struct sk_buff *skb)
* a packet thats being forwarded.
*/
-extern __inline__ struct sk_buff *skb_unshare(struct sk_buff *skb, int pri, int dir)
+extern __inline__ struct sk_buff *skb_unshare(struct sk_buff *skb, int pri)
{
struct sk_buff *nskb;
if(!skb_cloned(skb))
return skb;
nskb=skb_copy(skb, pri);
- kfree_skb(skb, dir); /* Free our shared copy */
+ kfree_skb(skb); /* Free our shared copy */
return nskb;
}
@@ -218,6 +216,14 @@ extern __inline__ struct sk_buff *skb_peek(struct sk_buff_head *list_)
return list;
}
+extern __inline__ struct sk_buff *skb_peek_tail(struct sk_buff_head *list_)
+{
+ struct sk_buff *list = ((struct sk_buff *)list_)->prev;
+ if (list == (struct sk_buff *)list_)
+ list = NULL;
+ return list;
+}
+
/*
* Return the length of an sk_buff queue
*/
@@ -408,6 +414,28 @@ extern __inline__ void skb_unlink(struct sk_buff *skb)
restore_flags(flags);
}
+/* XXX: more streamlined implementation */
+extern __inline__ struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list)
+{
+ struct sk_buff *skb = skb_peek_tail(list);
+ if (skb)
+ __skb_unlink(skb, list);
+ return skb;
+}
+
+extern __inline__ struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list)
+{
+ long flags;
+ struct sk_buff *result;
+
+ save_flags(flags);
+ cli();
+ result = __skb_dequeue_tail(list);
+ restore_flags(flags);
+ return result;
+}
+
+
extern const char skb_put_errstr[];
extern const char skb_push_errstr[];
@@ -484,33 +512,6 @@ extern __inline__ void skb_trim(struct sk_buff *skb, unsigned int len)
}
}
-/* dev_tint can lock buffer at any moment,
- * so that cli(), unlink it and sti(),
- * now it is safe.
- */
-
-extern __inline__ int skb_steal(struct sk_buff *skb)
-{
- unsigned long flags;
-
- save_flags(flags);
- cli();
- if (skb->next) {
- skb_unlink(skb);
- atomic_dec(&skb->users);
- }
- restore_flags(flags);
- return 1;
-}
-
-extern __inline__ void __skb_steal(struct sk_buff *skb)
-{
- if (skb->next) {
- skb_unlink(skb);
- atomic_dec(&skb->users);
- }
-}
-
extern __inline__ void skb_orphan(struct sk_buff *skb)
{
if (skb->destructor)
@@ -523,11 +524,21 @@ extern __inline__ void skb_queue_purge(struct sk_buff_head *list)
{
struct sk_buff *skb;
while ((skb=skb_dequeue(list))!=NULL)
- kfree_skb(skb,0);
+ kfree_skb(skb);
+}
+
+extern __inline__ struct sk_buff *dev_alloc_skb(unsigned int length)
+{
+ struct sk_buff *skb;
+
+ skb = alloc_skb(length+16, GFP_ATOMIC);
+ if (skb)
+ skb_reserve(skb,16);
+ return skb;
}
extern struct sk_buff * skb_recv_datagram(struct sock *sk,unsigned flags,int noblock, int *err);
-extern unsigned int datagram_poll(struct socket *sock, struct poll_table_struct *wait);
+extern unsigned int datagram_poll(struct file *file, struct socket *sock, struct poll_table_struct *wait);
extern int skb_copy_datagram(struct sk_buff *from, int offset, char *to,int size);
extern int skb_copy_datagram_iovec(struct sk_buff *from, int offset, struct iovec *to,int size);
extern void skb_free_datagram(struct sock * sk, struct sk_buff *skb);
diff --git a/include/linux/slab.h b/include/linux/slab.h
index decb1e747..0b46d3b73 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -15,14 +15,14 @@ typedef struct kmem_cache_s kmem_cache_t;
#include <asm/cache.h>
/* flags for kmem_cache_alloc() */
-#define SLAB_BUFFER GFP_BUFFER /* 0x00 */
-#define SLAB_ATOMIC GFP_ATOMIC /* 0x01 */
-#define SLAB_USER GFP_USER /* 0x02 */
-#define SLAB_KERNEL GFP_KERNEL /* 0x03 */
-#define SLAB_NOBUFFER GFP_NOBUFFER /* 0x04 */
-#define SLAB_NFS GFP_NFS /* 0x05 */
-#define SLAB_DMA GFP_DMA /* 0x08 */
-#define SLAB_LEVEL_MASK GFP_LEVEL_MASK /* 0x0f */
+#define SLAB_BUFFER GFP_BUFFER
+#define SLAB_ATOMIC GFP_ATOMIC
+#define SLAB_USER GFP_USER
+#define SLAB_KERNEL GFP_KERNEL
+#define SLAB_NFS GFP_NFS
+#define SLAB_DMA GFP_DMA
+
+#define SLAB_LEVEL_MASK 0x0000007fUL
#define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */
/* flags to pass to kmem_cache_create().
@@ -59,7 +59,7 @@ extern void *kmalloc(size_t, int);
extern void kfree(const void *);
extern void kfree_s(const void *, size_t);
-extern int kmem_cache_reap(int, int, int);
+extern void kmem_cache_reap(int);
extern int get_slabinfo(char *);
/* System wide caches */
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h
index f21d66080..2e83cf446 100644
--- a/include/linux/smb_fs.h
+++ b/include/linux/smb_fs.h
@@ -76,6 +76,7 @@ smb_vfree(void *obj)
*/
#define SMB_FIX_WIN95 0x0001 /* Win 95 server */
#define SMB_FIX_OLDATTR 0x0002 /* Use core getattr (Win 95 speedup) */
+#define SMB_FIX_DIRATTR 0x0004 /* Use find_first for getattr */
/* linux/fs/smbfs/mmap.c */
int smb_mmap(struct file *, struct vm_area_struct *);
@@ -94,11 +95,11 @@ int smb_ioctl (struct inode *, struct file *, unsigned int, unsigned long);
struct super_block *smb_read_super(struct super_block *, void *, int);
void smb_get_inode_attr(struct inode *, struct smb_fattr *);
void smb_invalidate_inodes(struct smb_sb_info *);
-int smb_revalidate_inode(struct inode *);
-int smb_refresh_inode(struct inode *);
-int smb_notify_change(struct inode *, struct iattr *);
+int smb_revalidate_inode(struct dentry *);
+int smb_notify_change(struct dentry *, struct iattr *);
unsigned long smb_invent_inos(unsigned long);
struct inode *smb_iget(struct super_block *, struct smb_fattr *);
+extern int init_smb_fs(void);
/* linux/fs/smbfs/proc.c */
__u32 smb_len(unsigned char *);
@@ -112,8 +113,8 @@ int smb_close(struct inode *);
void smb_close_dentry(struct dentry *);
int smb_close_fileid(struct dentry *, __u16);
int smb_open(struct dentry *, int);
-int smb_proc_read(struct inode *, off_t, int, char *);
-int smb_proc_write(struct inode *, off_t, int, const char *);
+int smb_proc_read(struct dentry *, off_t, int, char *);
+int smb_proc_write(struct dentry *, off_t, int, const char *);
int smb_proc_create(struct dentry *, __u16, time_t, __u16 *);
int smb_proc_mv(struct dentry *, struct dentry *);
int smb_proc_mkdir(struct dentry *);
diff --git a/include/linux/smb_fs_i.h b/include/linux/smb_fs_i.h
index 71e57ea6a..4aea02c3c 100644
--- a/include/linux/smb_fs_i.h
+++ b/include/linux/smb_fs_i.h
@@ -21,15 +21,14 @@ struct smb_inode_info {
* file handles are local to a connection. A file is open if
* (open == generation).
*/
- unsigned int open;
+ unsigned int open; /* open generation */
__u16 fileid; /* What id to handle a file with? */
__u16 attr; /* Attribute fields, DOS value */
- __u16 access; /* Access bits. */
+ __u16 access; /* Access mode */
__u16 cache_valid; /* dircache valid? */
unsigned long oldmtime; /* last time refreshed */
unsigned long closed; /* timestamp when closed */
- void * dentry; /* The dentry we were opened with */
};
#endif
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h
index 4e277ad3c..cedbb5ab8 100644
--- a/include/linux/smb_fs_sb.h
+++ b/include/linux/smb_fs_sb.h
@@ -24,6 +24,7 @@ struct smb_sb_info {
struct file * sock_file;
struct smb_mount_data *mnt;
+ unsigned char *temp_buf;
/* Connections are counted. Each time a new socket arrives,
* generation is incremented.
diff --git a/include/linux/smp.h b/include/linux/smp.h
index ff4427960..1a8d71f58 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -8,36 +8,46 @@
#ifdef __SMP__
#include <asm/smp.h>
-
+
+/*
+ * main IPI interface, handles INIT, TLB flush, STOP, etc.:
+ */
extern void smp_message_pass(int target, int msg, unsigned long data, int wait);
-extern void smp_boot_cpus(void); /* Boot processor call to load the other CPU's */
-extern void smp_callin(void); /* Processor call in. Must hold processors until .. */
-extern void smp_commence(void); /* Multiprocessors may now schedule */
-extern int smp_num_cpus;
-extern int smp_threads_ready; /* True once the per process idle is forked */
-#ifdef __SMP_PROF__
-extern volatile unsigned long smp_spins[NR_CPUS]; /* count of interrupt spins */
-extern volatile unsigned long smp_spins_sys_idle[]; /* count of idle spins */
-extern volatile unsigned long smp_spins_syscall[]; /* count of syscall spins */
-extern volatile unsigned long smp_spins_syscall_cur[]; /* count of syscall spins for the current
- call */
-extern volatile unsigned long smp_idle_count[1+NR_CPUS];/* count idle ticks */
-extern volatile unsigned long smp_idle_map; /* map with idle cpus */
-#else
-extern volatile unsigned long smp_spins;
-#endif
+/*
+ * Boot processor call to load the other CPU's
+ */
+extern void smp_boot_cpus(void);
+
+/*
+ * Processor call in. Must hold processors until ..
+ */
+extern void smp_callin(void);
+
+/*
+ * Multiprocessors may now schedule
+ */
+extern void smp_commence(void);
+
+/*
+ * True once the per process idle is forked
+ */
+extern int smp_threads_ready;
+
+extern int smp_num_cpus;
extern volatile unsigned long smp_msg_data;
extern volatile int smp_src_cpu;
extern volatile int smp_msg_id;
-#define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */
+#define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */
#define MSG_ALL 0x8001
-#define MSG_INVALIDATE_TLB 0x0001 /* Remote processor TLB invalidate */
-#define MSG_STOP_CPU 0x0002 /* Sent to shut down slave CPU's when rebooting */
-#define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU */
+#define MSG_INVALIDATE_TLB 0x0001 /* Remote processor TLB invalidate */
+#define MSG_STOP_CPU 0x0002 /* Sent to shut down slave CPU's
+ * when rebooting
+ */
+#define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU */
#else
@@ -51,5 +61,6 @@ extern volatile int smp_msg_id;
#define smp_message_pass(t,m,d,w)
#define smp_threads_ready 1
#define kernel_lock()
+
#endif
#endif
diff --git a/include/linux/sockios.h b/include/linux/sockios.h
index 5465bc6b8..4f41001aa 100644
--- a/include/linux/sockios.h
+++ b/include/linux/sockios.h
@@ -45,8 +45,8 @@
#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
#define SIOCGIFMTU 0x8921 /* get MTU size */
#define SIOCSIFMTU 0x8922 /* set MTU size */
-#define SIOCSIFHWADDR 0x8924 /* set hardware address (NI) */
-#define SIOCGIFENCAP 0x8925 /* get/set slip encapsulation */
+#define SIOCSIFHWADDR 0x8924 /* set hardware address */
+#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
#define SIOCSIFENCAP 0x8926
#define SIOCGIFHWADDR 0x8927 /* Get hardware address */
#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
@@ -64,6 +64,10 @@
#define SIOCGIFBR 0x8940 /* Bridging support */
#define SIOCSIFBR 0x8941 /* Set bridging options */
+#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
+#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
+
+
/* ARP cache control calls. */
/* 0x8950 - 0x8952 * obsolete calls, don't re-use */
#define SIOCDARP 0x8953 /* delete ARP table entry */
diff --git a/include/linux/soundmodem.h b/include/linux/soundmodem.h
index 43ad5e3a2..10d0799d6 100644
--- a/include/linux/soundmodem.h
+++ b/include/linux/soundmodem.h
@@ -1,14 +1,11 @@
/*
* The Linux soundcard driver for 1200 baud and 9600 baud packet radio
- * (C) 1996 by Thomas Sailer, HB9JNX/AE4WA
+ * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA
*/
#ifndef _SOUNDMODEM_H
#define _SOUNDMODEM_H
-#include <linux/sockios.h>
-#include <linux/if_ether.h>
-
/* -------------------------------------------------------------------- */
/*
* structs for the IOCTL commands
diff --git a/include/linux/stallion.h b/include/linux/stallion.h
index f277551fe..35274488d 100644
--- a/include/linux/stallion.h
+++ b/include/linux/stallion.h
@@ -3,7 +3,7 @@
/*
* stallion.h -- stallion multiport serial driver.
*
- * Copyright (C) 1996-1997 Stallion Technologies (support@stallion.oz.au).
+ * Copyright (C) 1996-1998 Stallion Technologies (support@stallion.oz.au).
* Copyright (C) 1994-1996 Greg Ungerer (gerg@stallion.oz.au).
*
* This program is free software; you can redistribute it and/or modify
@@ -131,6 +131,8 @@ typedef struct stlbrd {
void (*isr)(struct stlbrd *brdp);
unsigned int ioaddr1;
unsigned int ioaddr2;
+ unsigned int iosize1;
+ unsigned int iosize2;
unsigned int iostatus;
unsigned int ioctrl;
unsigned int ioctrlval;
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 715abce2d..7012fb4a3 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -89,6 +89,7 @@ typedef void (*rpc_action)(struct rpc_task *);
#define RPC_TASK_ROOTCREDS 0x0100 /* force root creds */
#define RPC_TASK_DYNAMIC 0x0200 /* task was kmalloc'ed */
#define RPC_TASK_KILLED 0x0400 /* task was killed */
+#define RPC_TASK_NFSWRITE 0x1000 /* an NFS writeback */
#define RPC_IS_RUNNING(t) ((t)->tk_flags & RPC_TASK_RUNNING)
#define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC)
@@ -145,6 +146,9 @@ void * rpc_allocate(unsigned int flags, unsigned int);
void rpc_free(void *);
int rpciod_up(void);
void rpciod_down(void);
+#ifdef RPC_DEBUG
+void rpc_show_tasks(void);
+#endif
extern __inline__ void *
rpc_malloc(struct rpc_task *task, unsigned int size)
diff --git a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h
index d0ced9fe4..c01ebfa4b 100644
--- a/include/linux/sunrpc/stats.h
+++ b/include/linux/sunrpc/stats.h
@@ -40,6 +40,9 @@ struct svc_stat {
void rpc_proc_init(void);
void rpc_proc_exit(void);
+#ifdef MODULE
+void rpc_modcount(struct inode *, int);
+#endif
struct proc_dir_entry * rpc_proc_register(struct rpc_stat *);
void rpc_proc_unregister(const char *);
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 8445f2b10..e076098c4 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -49,7 +49,7 @@ struct svc_sock {
/*
* Function prototypes.
*/
-int svc_create_socket(struct svc_serv *, int, struct sockaddr_in *);
+int svc_makesock(struct svc_serv *, int, unsigned short);
void svc_delete_socket(struct svc_sock *);
int svc_recv(struct svc_serv *, struct svc_rqst *);
int svc_send(struct svc_rqst *);
diff --git a/include/linux/swap.h b/include/linux/swap.h
index d0873952a..4d291146e 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -9,6 +9,8 @@
#ifdef __KERNEL__
+#undef DEBUG_SWAP
+
#include <asm/atomic.h>
#define SWP_USED 1
@@ -21,7 +23,6 @@ struct swap_info_struct {
kdev_t swap_device;
struct dentry * swap_file;
unsigned char * swap_map;
- unsigned char * swap_lockmap;
unsigned int lowest_bit;
unsigned int highest_bit;
unsigned int cluster_next;
@@ -38,6 +39,7 @@ extern atomic_t nr_async_pages;
extern int min_free_pages;
extern int free_pages_low;
extern int free_pages_high;
+extern struct inode swapper_inode;
/* Incomplete types for prototype declarations: */
struct task_struct;
@@ -48,15 +50,11 @@ struct sysinfo;
extern int shm_swap (int, int);
/* linux/mm/vmscan.c */
-extern int try_to_free_page(int, int, int);
+extern int try_to_free_page(int);
/* linux/mm/page_io.c */
extern void rw_swap_page(int, unsigned long, char *, int);
-#define read_swap_page(nr,buf) \
- rw_swap_page(READ,(nr),(buf),1)
-#define write_swap_page(nr,buf) \
- rw_swap_page(WRITE,(nr),(buf),1)
-extern void swap_after_unlock_page (unsigned long entry);
+extern void rw_swap_page_nocache(int, unsigned long, char *);
/* linux/mm/page_alloc.c */
extern void swap_in(struct task_struct *, struct vm_area_struct *,
@@ -67,6 +65,8 @@ extern void swap_in(struct task_struct *, struct vm_area_struct *,
extern void show_swap_cache_info(void);
extern int add_to_swap_cache(struct page *, unsigned long);
extern void swap_duplicate(unsigned long);
+extern struct page * read_swap_cache_async(unsigned long, int);
+#define read_swap_cache(entry) read_swap_cache_async(entry, 1);
/* linux/mm/swapfile.c */
extern unsigned int nr_swapfiles;
@@ -80,7 +80,7 @@ extern void FASTCALL(swap_free(unsigned long));
*
* Will go away eventually..
*/
-#define SHM_SWP_TYPE 0x40
+#define SHM_SWP_TYPE 0x20
/*
* swap cache stuff (in linux/mm/swap_state.c)
@@ -100,39 +100,35 @@ extern unsigned long swap_cache_find_success;
extern inline unsigned long in_swap_cache(struct page *page)
{
if (PageSwapCache(page))
- return page->pg_swap_entry;
- return 0;
-}
-
-extern inline long find_in_swap_cache(struct page *page)
-{
-#ifdef SWAP_CACHE_INFO
- swap_cache_find_total++;
-#endif
- if (PageTestandClearSwapCache(page)) {
-#ifdef SWAP_CACHE_INFO
- swap_cache_find_success++;
-#endif
- return page->pg_swap_entry;
- }
+ return page->offset;
return 0;
}
-extern inline int delete_from_swap_cache(struct page *page)
+/*
+ * Work out if there are any other processes sharing this page, ignoring
+ * any page reference coming from the swap cache, or from outstanding
+ * swap IO on this page. (The page cache _does_ count as another valid
+ * reference to the page, however.)
+ */
+static inline int is_page_shared(struct page *page)
{
-#ifdef SWAP_CACHE_INFO
- swap_cache_del_total++;
-#endif
- if (PageTestandClearSwapCache(page)) {
-#ifdef SWAP_CACHE_INFO
- swap_cache_del_success++;
-#endif
- swap_free(page->pg_swap_entry);
+ int count = atomic_read(&page->count);
+ if (PageReserved(page))
return 1;
- }
- return 0;
+ if (page->inode == &swapper_inode)
+ count--;
+ if (PageFreeAfter(page))
+ count--;
+ return (count > 1);
}
+/*
+ * Make these inline later once they are working properly.
+ */
+extern long find_in_swap_cache(struct page *page);
+extern int delete_from_swap_cache(struct page *page);
+extern void remove_from_swap_cache(struct page *page);
+extern void free_page_and_swap_cache(unsigned long addr);
#endif /* __KERNEL__*/
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 68b6fee1b..865bdd1dd 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -114,6 +114,10 @@ enum
NET_CORE_WMEM_DEFAULT,
NET_CORE_RMEM_DEFAULT,
NET_CORE_DESTROY_DELAY,
+ NET_CORE_MAX_BACKLOG,
+ NET_CORE_FASTROUTE,
+ NET_CORE_MSG_COST,
+ NET_CORE_MSG_BURST,
};
/* /proc/sys/net/ethernet */
@@ -131,34 +135,24 @@ enum
/* /proc/sys/net/ipv4 */
enum
{
- NET_IPV4_ARP_RES_TIME=1,
- NET_IPV4_ARP_DEAD_RES_TIME,
- NET_IPV4_ARP_MAX_TRIES,
- NET_IPV4_ARP_MAX_PINGS,
- NET_IPV4_ARP_TIMEOUT,
- NET_IPV4_ARP_CHECK_INTERVAL,
- NET_IPV4_ARP_CONFIRM_INTERVAL,
- NET_IPV4_ARP_CONFIRM_TIMEOUT,
- NET_IPV4_TCP_HOE_RETRANSMITS,
+ /* v2.0 compatibile variables */
+ NET_IPV4_FORWARD = 8,
+ NET_IPV4_DYNADDR = 9,
+
+ NET_IPV4_CONF = 16,
+ NET_IPV4_NEIGH = 17,
+ NET_IPV4_ROUTE = 18,
+ NET_IPV4_FIB_HASH = 19,
+
+ NET_IPV4_TCP_HOE_RETRANSMITS=32,
NET_IPV4_TCP_SACK,
NET_IPV4_TCP_TSACK,
NET_IPV4_TCP_TIMESTAMPS,
NET_IPV4_TCP_WINDOW_SCALING,
NET_IPV4_TCP_VEGAS_CONG_AVOID,
- NET_IPV4_FORWARDING,
NET_IPV4_DEFAULT_TTL,
- NET_IPV4_RFC1812_FILTER,
- NET_IPV4_LOG_MARTIANS,
- NET_IPV4_SOURCE_ROUTE,
- NET_IPV4_SEND_REDIRECTS,
NET_IPV4_AUTOCONFIG,
- NET_IPV4_BOOTP_RELAY,
- NET_IPV4_PROXY_ARP,
NET_IPV4_NO_PMTU_DISC,
- NET_IPV4_ACCEPT_REDIRECTS,
- NET_IPV4_SECURE_REDIRECTS,
- NET_IPV4_RFC1620_REDIRECTS,
- NET_IPV4_RTCACHE_FLUSH,
NET_IPV4_TCP_SYN_RETRIES,
NET_IPV4_IPFRAG_HIGH_THRESH,
NET_IPV4_IPFRAG_LOW_THRESH,
@@ -170,10 +164,6 @@ enum
NET_IPV4_TCP_RETRIES2,
NET_IPV4_TCP_MAX_DELAY_ACKS,
NET_IPV4_TCP_FIN_TIMEOUT,
- NET_IPV4_IGMP_MAX_HOST_REPORT_DELAY,
- NET_IPV4_IGMP_TIMER_SCALE,
- NET_IPV4_IGMP_AGE_THRESHOLD,
- NET_IPV4_IP_DYNADDR,
NET_IPV4_IP_MASQ_DEBUG,
NET_TCP_SYNCOOKIES,
NET_TCP_STDURG,
@@ -186,31 +176,95 @@ enum
NET_IPV4_ICMP_DESTUNREACH_RATE,
NET_IPV4_ICMP_TIMEEXCEED_RATE,
NET_IPV4_ICMP_PARAMPROB_RATE,
- NET_IPV4_ICMP_ECHOREPLY_RATE
+ NET_IPV4_ICMP_ECHOREPLY_RATE,
+};
+
+enum {
+ NET_IPV4_ROUTE_FLUSH = 1,
+ NET_IPV4_ROUTE_MIN_DELAY,
+ NET_IPV4_ROUTE_MAX_DELAY,
+ NET_IPV4_ROUTE_GC_THRESH,
+ NET_IPV4_ROUTE_MAX_SIZE,
+ NET_IPV4_ROUTE_GC_MIN_INTERVAL,
+ NET_IPV4_ROUTE_GC_TIMEOUT,
+ NET_IPV4_ROUTE_GC_INTERVAL,
+ NET_IPV4_ROUTE_REDIRECT_LOAD,
+ NET_IPV4_ROUTE_REDIRECT_NUMBER,
+ NET_IPV4_ROUTE_REDIRECT_SILENCE,
+ NET_IPV4_ROUTE_ERROR_COST,
+ NET_IPV4_ROUTE_ERROR_BURST,
+};
+
+enum
+{
+ NET_PROTO_CONF_ALL = -2,
+ NET_PROTO_CONF_DEFAULT = -3,
+
+ /* And device ifindices ... */
};
+enum
+{
+ NET_IPV4_CONF_FORWARDING = 1,
+ NET_IPV4_CONF_MC_FORWARDING,
+ NET_IPV4_CONF_PROXY_ARP,
+ NET_IPV4_CONF_ACCEPT_REDIRECTS,
+ NET_IPV4_CONF_SECURE_REDIRECTS,
+ NET_IPV4_CONF_SEND_REDIRECTS,
+ NET_IPV4_CONF_SHARED_MEDIA,
+ NET_IPV4_CONF_RP_FILTER,
+ NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE,
+ NET_IPV4_CONF_BOOTP_RELAY,
+ NET_IPV4_CONF_LOG_MARTIANS,
+};
/* /proc/sys/net/ipv6 */
enum {
- NET_IPV6_FORWARDING = 1,
- NET_IPV6_HOPLIMIT,
+ NET_IPV6_CONF = 16,
+ NET_IPV6_NEIGH = 17,
+ NET_IPV6_ROUTE = 18,
+};
+
+enum {
+ NET_IPV6_ROUTE_FLUSH = 1,
+ NET_IPV6_ROUTE_GC_THRESH,
+ NET_IPV6_ROUTE_MAX_SIZE,
+ NET_IPV6_ROUTE_GC_MIN_INTERVAL,
+ NET_IPV6_ROUTE_GC_TIMEOUT,
+ NET_IPV6_ROUTE_GC_INTERVAL,
+};
+enum {
+ NET_IPV6_FORWARDING = 1,
+ NET_IPV6_HOP_LIMIT,
+ NET_IPV6_MTU,
NET_IPV6_ACCEPT_RA,
NET_IPV6_ACCEPT_REDIRECTS,
-
- NET_IPV6_ND_MAX_MCAST_SOLICIT,
- NET_IPV6_ND_MAX_UCAST_SOLICIT,
- NET_IPV6_ND_RETRANS_TIME,
- NET_IPV6_ND_REACHABLE_TIME,
- NET_IPV6_ND_DELAY_PROBE_TIME,
-
NET_IPV6_AUTOCONF,
NET_IPV6_DAD_TRANSMITS,
NET_IPV6_RTR_SOLICITS,
NET_IPV6_RTR_SOLICIT_INTERVAL,
NET_IPV6_RTR_SOLICIT_DELAY,
+};
- NET_IPV6_ICMPV6_TIME,
+/* /proc/sys/net/<protocol>/neigh/<dev> */
+enum {
+ NET_NEIGH_MCAST_SOLICIT=1,
+ NET_NEIGH_UCAST_SOLICIT,
+ NET_NEIGH_APP_SOLICIT,
+ NET_NEIGH_RETRANS_TIME,
+ NET_NEIGH_REACHABLE_TIME,
+ NET_NEIGH_DELAY_PROBE_TIME,
+ NET_NEIGH_GC_STALE_TIME,
+ NET_NEIGH_UNRES_QLEN,
+ NET_NEIGH_PROXY_QLEN,
+ NET_NEIGH_ANYCAST_DELAY,
+ NET_NEIGH_PROXY_DELAY,
+ NET_NEIGH_LOCKTIME,
+ NET_NEIGH_GC_INTERVAL,
+ NET_NEIGH_GC_THRESH1,
+ NET_NEIGH_GC_THRESH2,
+ NET_NEIGH_GC_THRESH3
};
/* /proc/sys/net/ipx */
diff --git a/include/linux/sysv_fs.h b/include/linux/sysv_fs.h
index 7c5167fa8..00d40adca 100644
--- a/include/linux/sysv_fs.h
+++ b/include/linux/sysv_fs.h
@@ -367,7 +367,7 @@ extern int sysv_mkdir(struct inode * dir, struct dentry * dentry, int mode);
extern int sysv_rmdir(struct inode * dir, struct dentry * dentry);
extern int sysv_unlink(struct inode * dir, struct dentry * dentry);
extern int sysv_symlink(struct inode * inode, struct dentry * dentry, const char * symname);
-extern int sysv_link(struct inode * oldinode, struct inode * dir, struct dentry * dentry);
+extern int sysv_link(struct dentry * old_dentry, struct inode * dir, struct dentry * dentry);
extern int sysv_mknod(struct inode * dir, struct dentry * dentry, int mode, int rdev);
extern int sysv_rename(struct inode * old_dir, struct dentry * old_dentry,
struct inode * new_dir, struct dentry * new_dentry);
@@ -390,7 +390,7 @@ extern struct super_block *sysv_read_super(struct super_block *,void *,int);
extern int init_sysv_fs(void);
extern void sysv_write_super(struct super_block *);
extern void sysv_read_inode(struct inode *);
-extern int sysv_notify_change(struct inode *, struct iattr *);
+extern int sysv_notify_change(struct dentry *, struct iattr *);
extern void sysv_write_inode(struct inode *);
extern void sysv_put_inode(struct inode *);
extern int sysv_statfs(struct super_block *, struct statfs *, int);
diff --git a/include/linux/sysv_fs_sb.h b/include/linux/sysv_fs_sb.h
index 115b95bc6..99a7c125d 100644
--- a/include/linux/sysv_fs_sb.h
+++ b/include/linux/sysv_fs_sb.h
@@ -15,8 +15,8 @@ struct sysv_sb_info {
unsigned int s_block_size; /* zone size, = 512 or = 1024 */
unsigned int s_block_size_1; /* block_size - 1 */
unsigned int s_block_size_bits; /* log2(block_size) */
- unsigned int s_block_size_ratio; /* BLOCK_SIZE / block_size */
- unsigned int s_block_size_ratio_bits; /* log2(block_size_ratio) */
+ unsigned int s_block_size_inc_bits; /* log2(block_size/BLOCK_SIZE) if >0 */
+ unsigned int s_block_size_dec_bits; /* log2(BLOCK_SIZE/block_size) if >0 */
char s_convert; /* flag whether byte ordering requires conversion */
char s_kludge_symlinks; /* flag whether symlinks have a kludgey mode */
char s_truncate; /* if 1: names > SYSV_NAMELEN chars are truncated */
@@ -66,15 +66,15 @@ struct sysv_sb_info {
unsigned long s_ndatazones; /* total number of data zones */
unsigned long s_nzones; /* same as s_sbd->s_fsize */
};
-/* The fields s_block_size_ratio, s_ind_per_block_2_1, s_toobig_block are currently unused. */
+/* The fields s_ind_per_block_2_1, s_toobig_block are currently unused. */
/* sv_ == u.sysv_sb.s_ */
#define sv_type u.sysv_sb.s_type
#define sv_block_size u.sysv_sb.s_block_size
#define sv_block_size_1 u.sysv_sb.s_block_size_1
#define sv_block_size_bits u.sysv_sb.s_block_size_bits
-#define sv_block_size_ratio u.sysv_sb.s_block_size_ratio
-#define sv_block_size_ratio_bits u.sysv_sb.s_block_size_ratio_bits
+#define sv_block_size_inc_bits u.sysv_sb.s_block_size_inc_bits
+#define sv_block_size_dec_bits u.sysv_sb.s_block_size_dec_bits
#define sv_convert u.sysv_sb.s_convert
#define sv_kludge_symlinks u.sysv_sb.s_kludge_symlinks
#define sv_truncate u.sysv_sb.s_truncate
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 00ae5082f..7d11fd246 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -2,61 +2,27 @@
#define _LINUX_TIMER_H
/*
- * DON'T CHANGE THESE!! Most of them are hardcoded into some assembly language
- * as well as being defined here.
- */
-
-/*
- * The timers are:
- *
- * BLANK_TIMER console screen-saver timer
- *
- * BEEP_TIMER console beep timer
- *
- * RS_TIMER timer for the RS-232 ports
- *
- * SWAP_TIMER timer for the background pageout daemon
- *
- * HD_TIMER harddisk timer
- *
- * HD_TIMER2 (atdisk2 patches)
- *
- * FLOPPY_TIMER floppy disk timer (not used right now)
- *
- * SCSI_TIMER scsi.c timeout timer
- *
- * NET_TIMER tcp/ip timeout timer
- *
- * COPRO_TIMER 387 timeout for buggy hardware..
- *
- * QIC02_TAPE_TIMER timer for QIC-02 tape driver (it's not hardcoded)
- *
- * MCD_TIMER Mitsumi CD-ROM Timer
- *
- * GSCD_TIMER Goldstar CD-ROM Timer
+ * Old-style timers. Please don't use for any new code.
*
+ * Numbering of these timers should be consecutive to minimize
+ * processing delays. [MJ]
*/
-#define BLANK_TIMER 0
-#define BEEP_TIMER 1
-#define RS_TIMER 2
-#define SWAP_TIMER 3
-
-#define HD_TIMER 16
-#define FLOPPY_TIMER 17
-#define SCSI_TIMER 18
-#define NET_TIMER 19
-#define SOUND_TIMER 20
-#define COPRO_TIMER 21
-
-#define QIC02_TAPE_TIMER 22 /* hhb */
-#define MCD_TIMER 23
-
-#define HD_TIMER2 24
-#define GSCD_TIMER 25
-#define COMTROL_TIMER 26
+#define BLANK_TIMER 0 /* Console screen-saver */
+#define BEEP_TIMER 1 /* Console beep */
+#define RS_TIMER 2 /* RS-232 ports */
+#define SWAP_TIMER 3 /* Background pageout */
+#define BACKGR_TIMER 4 /* io_request background I/O */
+#define HD_TIMER 5 /* Old IDE driver */
+#define FLOPPY_TIMER 6 /* Floppy */
+#define QIC02_TAPE_TIMER 7 /* QIC 02 tape */
+#define MCD_TIMER 8 /* Mitsumi CDROM */
+#define GSCD_TIMER 9 /* Goldstar CDROM */
+#define COMTROL_TIMER 10 /* Comtrol serial */
+#define DIGI_TIMER 11 /* Digi serial */
+#define GDTH_TIMER 12 /* Ugh - gdth scsi driver */
-#define DIGI_TIMER 29
+#define COPRO_TIMER 31 /* 387 timeout for buggy hardware (boot only) */
struct timer_struct {
unsigned long expires;
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 9c5d58ca8..6b00c4329 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -288,6 +288,7 @@ struct tty_struct {
#define TTY_CLOSING 7
#define TTY_HW_COOK_OUT 14
#define TTY_HW_COOK_IN 15
+#define TTY_PTY_LOCK 16
#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
@@ -309,6 +310,7 @@ extern int tty_init(void);
extern int pcxe_init(void);
extern int pc_init(void);
extern int vcs_init(void);
+extern int rp_init(void);
extern int cy_init(void);
extern int stl_init(void);
extern int stli_init(void);
@@ -358,10 +360,6 @@ extern long serial_console_init(long kmem_start, long kmem_end);
extern int pcxe_open(struct tty_struct *tty, struct file *filp);
-/* epca.c */
-
-extern int pc_open(struct tty_struct *tty, struct file *filp);
-
/* console.c */
extern void update_screen(int new_console);
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 1e8bf261c..ee6a7eb22 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -213,6 +213,7 @@ struct tty_driver {
#define SYSTEM_TYPE_TTY 0x0001
#define SYSTEM_TYPE_CONSOLE 0x0002
#define SYSTEM_TYPE_SYSCONS 0x0003
+#define SYSTEM_TYPE_SYSPTMX 0x0004
/* pty subtypes (magic, used by tty_io.c) */
#define PTY_TYPE_MASTER 0x0001
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 25420e1b1..78b336416 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -8,6 +8,14 @@
*
* Clean swab support by Fare <rideau@ens.fr>
* just hope no one is using NNUUXXI on __?64 structure elements
+ * 64-bit clean thanks to Maciej W. Rozycki <macro@ds2.pg.gda.pl>
+ *
+ * 4.4BSD (FreeBSD) support added on February 1st 1998 by
+ * Niels Kristian Bech Jensen <nkbj@image.dk> partially based
+ * on code by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>.
+ *
+ * NeXTstep support added on February 5th 1998 by
+ * Niels Kristian Bech Jensen <nkbj@image.dk>.
*/
#ifndef __LINUX_UFS_FS_H
@@ -48,13 +56,45 @@
#define UFS_FSACTIVE ((char)0x00)
#define UFS_FSCLEAN ((char)0x01)
#define UFS_FSSTABLE ((char)0x02)
+#define UFS_FSOSF1 ((char)0x03) /* is this correct for DEC OSF/1? */
#define UFS_FSBAD ((char)0xff)
-/* Flags for ufs_sb_info */
-#define UFS_DEBUG 0x00000001
-#define UFS_DEBUG_INODE 0x00000002
-#define UFS_DEBUG_NAMEI 0x00000004
-#define UFS_DEBUG_LINKS 0x00000008
+/* From here to next blank line, s_flags for ufs_sb_info */
+/* endianness */
+#define UFS_BYTESEX 0x00000001 /* mask; leave room to 0xF */
+#define UFS_LITTLE_ENDIAN 0x00000000
+#define UFS_BIG_ENDIAN 0x00000001
+/* directory entry encoding */
+#define UFS_DE_MASK 0x00000010 /* mask for the following */
+#define UFS_DE_OLD 0x00000000
+#define UFS_DE_44BSD 0x00000010
+/* uid encoding */
+#define UFS_UID_MASK 0x00000060 /* mask for the following */
+#define UFS_UID_OLD 0x00000000
+#define UFS_UID_44BSD 0x00000020
+#define UFS_UID_EFT 0x00000040
+/* superblock state encoding */
+#define UFS_ST_MASK 0x00000700 /* mask for the following */
+#define UFS_ST_OLD 0x00000000
+#define UFS_ST_44BSD 0x00000100
+#define UFS_ST_SUN 0x00000200
+#define UFS_ST_NEXT 0x00000400
+/* filesystem flavors (combo of features) */
+#define UFS_FEATURES 0x00FFFFF0 /* room for extension */
+#define UFS_VANILLA 0x00000000
+#define UFS_OLD 0x00000000 /* 4.2BSD */
+#define UFS_44BSD 0x00000130
+#define UFS_HURD 0x00000130
+#define UFS_SUN 0x00000200
+#define UFS_NEXT 0x00000400
+/* we preserve distinction in flavor identification even without difference,
+ * because yet-to-be-supported features may introduce difference in the future
+ */
+/* last but not least, debug flags */
+#define UFS_DEBUG 0x01000000
+#define UFS_DEBUG_INODE 0x02000000
+#define UFS_DEBUG_NAMEI 0x04000000
+#define UFS_DEBUG_LINKS 0x08000000
#ifdef UFS_HEAVY_DEBUG
# define UFS_DEBUG_INITIAL UFS_DEBUG
@@ -62,10 +102,9 @@
# define UFS_DEBUG_INITIAL 0
#endif
-/* (!) HERE WE ASSUME EITHER BIG OR LITTLE ENDIAN UFSes */
-#define UFS_LITTLE_ENDIAN 0x00000000 /* 0x00010000 */
-#define UFS_BIG_ENDIAN 0x00010000 /* 0x00020000 */
-#define UFS_BYTESEX 0x00010000 /* 0x00030000 */
+/* fs_inodefmt options */
+#define UFS_42INODEFMT -1
+#define UFS_44INODEFMT 2
#define UFS_ADDR_PER_BLOCK(sb) ((sb)->u.ufs_sb.s_bsize >> 2)
#define UFS_ADDR_PER_BLOCK_BITS(sb) ((sb)->u.ufs_sb.s_bshift - 2)
@@ -86,17 +125,34 @@
/* XXX - this can be optimized if s_ipg is a power of 2. */
#define ufs_ino2cg(inode) ((inode)->i_ino/(inode)->i_sb->u.ufs_sb.s_ipg)
+/* current filesystem state; method depends on flags */
+#define UFS_STATE(usb) \
+ ( ((flags&UFS_ST_MASK) == UFS_ST_OLD) \
+ ? (usb)->fs_u.fs_sun.fs_state /* old normal way */ \
+ : (usb)->fs_u.fs_44.fs_state /* 4.4BSD way */ )
+
#define UFS_MAXNAMLEN 255
#define ufs_lbn(sb, block) ((block) >> (sb)->u.ufs_sb.s_lshift)
#define ufs_boff(sb, block) ((block) & ~((sb)->u.ufs_sb.s_lmask))
#define ufs_dbn(sb, block, boff) ((block) + ufs_boff((sb), (boff)))
+struct ufs_timeval {
+ __s32 tv_sec;
+ __s32 tv_usec;
+};
+
struct ufs_direct {
__u32 d_ino; /* inode number of this entry */
__u16 d_reclen; /* length of this entry */
- __u16 d_namlen; /* actual length of d_name */
- char d_name[UFS_MAXNAMLEN + 1]; /* file name */
+ union {
+ __u16 d_namlen; /* actual length of d_name */
+ struct {
+ __u8 d_type; /* file type */
+ __u8 d_namlen; /* length of string in d_name */
+ } d_44;
+ } d_u;
+ __u8 d_name[UFS_MAXNAMLEN + 1]; /* file name */
};
#define MAXMNTLEN 512
@@ -184,13 +240,27 @@ struct ufs_superblock {
__u8 fs_fsmnt[MAXMNTLEN]; /* name mounted on */
/* these fields retain the current block allocation info */
__u32 fs_cgrotor; /* last cg searched */
- struct ufs_csum * fs_csp[MAXCSBUFS]; /* list of fs_cs info buffers */
+ __u32 fs_csp[MAXCSBUFS]; /* list of fs_cs info buffers */
__u32 fs_cpc; /* cyl per cycle in postbl */
__u16 fs_opostbl[16][8]; /* old rotation block list head */
- __s32 fs_sparecon[55]; /* reserved for future constants */
- __s32 fs_state; /* file system state time stamp */
- __s64 fs_qbmask; /* ~usb_bmask */
- __s64 fs_qfmask; /* ~usb_fmask */
+ union {
+ struct {
+ __s32 fs_sparecon[55];/* reserved for future constants */
+ __s32 fs_state; /* file system state time stamp */
+ __u32 fs_qbmask[2]; /* ~usb_bmask */
+ __u32 fs_qfmask[2]; /* ~usb_fmask */
+ } fs_sun;
+ struct {
+ __s32 fs_sparecon[50];/* reserved for future constants */
+ __s32 fs_contigsumsize;/* size of cluster summary array */
+ __s32 fs_maxsymlinklen;/* max length of an internal symlink */
+ __s32 fs_inodefmt; /* format of on-disk inodes */
+ __u64 fs_maxfilesize; /* max representable file size */
+ __u32 fs_qbmask[2]; /* ~usb_bmask */
+ __u32 fs_qfmask[2]; /* ~usb_fmask */
+ __s32 fs_state; /* file system state time stamp */
+ } fs_44;
+ } fs_u;
__s32 fs_postblformat; /* format of positional layout tables */
__s32 fs_nrpos; /* number of rotational positions */
__s32 fs_postbloff; /* (__s16) rotation block list head */
@@ -205,24 +275,66 @@ struct ufs_superblock {
struct ufs_inode {
__u16 ui_mode; /* 0x0 */
__u16 ui_nlink; /* 0x2 */
- __u16 ui_suid; /* 0x4 */
- __u16 ui_sgid; /* 0x6 */
+ union {
+ struct {
+ __u16 suid; /* 0x4 */
+ __u16 sgid; /* 0x6 */
+ } oldids;
+ __u32 inumber; /* 0x4 lsf: inode number */
+ __u32 author; /* 0x4 GNU HURD: author */
+ } ui_u1;
__u64 ui_size; /* 0x8 */
- struct timeval ui_atime; /* 0x10 access */
- struct timeval ui_mtime; /* 0x18 modification */
- struct timeval ui_ctime; /* 0x20 creation */
- __u32 ui_db[UFS_NDADDR]; /* 0x28 data blocks */
- __u32 ui_ib[UFS_NINDIR]; /* 0x58 indirect blocks */
- __u32 ui_flags; /* 0x64 unused -- "status flags (chflags)" ??? */
+ struct ufs_timeval ui_atime; /* 0x10 access */
+ struct ufs_timeval ui_mtime; /* 0x18 modification */
+ struct ufs_timeval ui_ctime; /* 0x20 creation */
+ union {
+ struct {
+ __u32 ui_db[UFS_NDADDR];/* 0x28 data blocks */
+ __u32 ui_ib[UFS_NINDIR];/* 0x58 indirect blocks */
+ } ui_addr;
+ __u8 ui_symlink[4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */
+ } ui_u2;
+ __u32 ui_flags; /* 0x64 immutable, append-only... */
__u32 ui_blocks; /* 0x68 blocks in use */
- __u32 ui_gen; /* 0x6c generation number XXX - what is this? */
- __u32 ui_shadow; /* 0x70 shadow inode XXX - what is this?*/
- __u32 ui_uid; /* 0x74 long EFT version of uid */
- __u32 ui_gid; /* 0x78 long EFT version of gid */
- __u32 ui_oeftflag; /* 0x7c reserved */
+ __u32 ui_gen; /* 0x6c like ext2 i_version, for NFS support */
+ union {
+ struct {
+ __u32 ui_shadow;/* 0x70 shadow inode with security data */
+ __u32 ui_uid; /* 0x74 long EFT version of uid */
+ __u32 ui_gid; /* 0x78 long EFT version of gid */
+ __u32 ui_oeftflag;/* 0x7c reserved */
+ } ui_sun;
+ struct {
+ __u32 ui_uid; /* 0x70 File owner */
+ __u32 ui_gid; /* 0x74 File group */
+ __s32 ui_spare[2];/* 0x78 reserved */
+ } ui_44;
+ struct {
+ __u32 ui_uid; /* 0x70 */
+ __u32 ui_gid; /* 0x74 */
+ __u16 ui_modeh;/* 0x78 mode high bits */
+ __u16 ui_spare;/* 0x7A unused */
+ __u32 ui_trans;/* 0x7c filesystem translator */
+ } ui_hurd;
+ } ui_u3;
};
-
+/* FreeBSD has these in sys/stat.h */
+/* ui_flags that can be set by a file owner */
+#define UFS_UF_SETTABLE 0x0000ffff
+#define UFS_UF_NODUMP 0x00000001 /* do not dump */
+#define UFS_UF_IMMUTABLE 0x00000002 /* immutable (can't "change") */
+#define UFS_UF_APPEND 0x00000004 /* append-only */
+#define UFS_UF_OPAQUE 0x00000008 /* directory is opaque (unionfs) */
+#define UFS_UF_NOUNLINK 0x00000010 /* can't be removed or renamed */
+/* ui_flags that only root can set */
+#define UFS_SF_SETTABLE 0xffff0000
+#define UFS_SF_ARCHIVED 0x00010000 /* archived */
+#define UFS_SF_IMMUTABLE 0x00020000 /* immutable (can't "change") */
+#define UFS_SF_APPEND 0x00040000 /* append-only */
+#define UFS_SF_NOUNLINK 0x00100000 /* can't be removed or renamed */
+
+
#ifdef __KERNEL__
/*
* Function prototypes
diff --git a/include/linux/ufs_fs_i.h b/include/linux/ufs_fs_i.h
index f10b36d91..31611830b 100644
--- a/include/linux/ufs_fs_i.h
+++ b/include/linux/ufs_fs_i.h
@@ -6,15 +6,18 @@
* Laboratory for Computer Science Research Computing Facility
* Rutgers, The State University of New Jersey
*
- * $Id: ufs_fs_i.h,v 1.2 1996/05/03 04:02:25 davem Exp $
- *
+ * NeXTstep support added on February 5th 1998 by
+ * Niels Kristian Bech Jensen <nkbj@image.dk>.
*/
#ifndef _LINUX_UFS_FS_I_H
#define _LINUX_UFS_FS_I_H
struct ufs_inode_info {
- __u32 i_data[15];
+ union {
+ __u32 i_data[15];
+ __u8 i_symlink[4*15]; /* fast symlink */
+ } i_u1;
__u64 i_size;
__u32 i_flags;
__u32 i_gen;
diff --git a/include/linux/ufs_fs_sb.h b/include/linux/ufs_fs_sb.h
index da56276a2..1469f659f 100644
--- a/include/linux/ufs_fs_sb.h
+++ b/include/linux/ufs_fs_sb.h
@@ -6,8 +6,8 @@
* Laboratory for Computer Science Research Computing Facility
* Rutgers, The State University of New Jersey
*
- * $Id: ufs_fs_sb.h,v 1.6 1996/06/01 15:31:08 ecd Exp $
- *
+ * NeXTstep support added on February 5th 1998 by
+ * Niels Kristian Bech Jensen <nkbj@image.dk>.
*/
#ifndef __LINUX_UFS_FS_SB_H
@@ -35,6 +35,7 @@ struct ufs_sb_info {
__u32 s_lshift;
__u32 s_lmask;
__u32 s_fsfrag;
+ __u32 s_blockbase; /* offset of NeXTstep superblock */
};
#endif /* __LINUX_UFS_FS_SB_H */
diff --git a/include/linux/umsdos_fs.h b/include/linux/umsdos_fs.h
index b25f0c31e..730517cef 100644
--- a/include/linux/umsdos_fs.h
+++ b/include/linux/umsdos_fs.h
@@ -4,6 +4,8 @@
#define UMSDOS_VERSION 0
#define UMSDOS_RELEASE 4
+#define UMSDOS_ROOT_INO 1
+
/* This is the file acting as a directory extension */
#define UMSDOS_EMD_FILE "--linux-.---"
#define UMSDOS_EMD_NAMELEN 12
@@ -20,32 +22,34 @@
#include <linux/ioctl.h>
#endif
+
struct umsdos_fake_info {
- char fname[13];
- int len;
+ char fname[13];
+ int len;
};
#define UMSDOS_MAXNAME 220
/* This structure is 256 bytes large, depending on the name, only part */
/* of it is written to disk */
+/* nice though it would be, I can't change this and preserve backward compatibility */
struct umsdos_dirent {
- unsigned char name_len; /* if == 0, then this entry is not used */
- unsigned char flags; /* UMSDOS_xxxx */
- unsigned short nlink; /* How many hard links point to this entry */
- uid_t uid; /* Owner user id */
- gid_t gid; /* Group id */
- time_t atime; /* Access time */
- time_t mtime; /* Last modification time */
- time_t ctime; /* Creation time */
- dev_t rdev; /* major and minor number of a device */
- /* special file */
- umode_t mode; /* Standard UNIX permissions bits + type of */
- char spare[12]; /* unused bytes for future extensions */
- /* file, see linux/stat.h */
- char name[UMSDOS_MAXNAME]; /* Not '\0' terminated */
- /* but '\0' padded, so it will allow */
- /* for adding news fields in this record */
- /* by reducing the size of name[] */
+ unsigned char name_len; /* if == 0, then this entry is not used */
+ unsigned char flags; /* UMSDOS_xxxx */
+ unsigned short nlink; /* How many hard links point to this entry */
+ uid_t uid; /* Owner user id */
+ gid_t gid; /* Group id */
+ time_t atime; /* Access time */
+ time_t mtime; /* Last modification time */
+ time_t ctime; /* Creation time */
+ dev_t rdev; /* major and minor number of a device */
+ /* special file */
+ umode_t mode; /* Standard UNIX permissions bits + type of */
+ char spare[12]; /* unused bytes for future extensions */
+ /* file, see linux/stat.h */
+ char name[UMSDOS_MAXNAME]; /* Not '\0' terminated */
+ /* but '\0' padded, so it will allow */
+ /* for adding news fields in this record */
+ /* by reducing the size of name[] */
};
#define UMSDOS_HIDDEN 1 /* Never show this entry in directory search */
#define UMSDOS_HLINK 2 /* It is a (pseudo) hard link */
@@ -58,15 +62,16 @@ struct umsdos_dirent {
#define UMSDOS_REC_SIZE 64
/* Translation between MSDOS name and UMSDOS name */
+
struct umsdos_info{
- int msdos_reject; /* Tell if the file name is invalid for MSDOS */
- /* See umsdos_parse */
- struct umsdos_fake_info fake;
- struct umsdos_dirent entry;
- off_t f_pos; /* offset of the entry in the EMD file */
- /* or offset where the entry may be store */
- /* if it is a new entry */
- int recsize; /* Record size needed to store entry */
+ int msdos_reject; /* Tell if the file name is invalid for MSDOS */
+ /* See umsdos_parse */
+ struct umsdos_fake_info fake;
+ struct umsdos_dirent entry;
+ off_t f_pos; /* offset of the entry in the EMD file */
+ /* or offset where the entry may be store */
+ /* if it is a new entry */
+ int recsize; /* Record size needed to store entry */
};
/* Definitions for ioctl (number randomly chosen) */
@@ -88,38 +93,39 @@ struct umsdos_info{
#define UMSDOS_RENAME_DOS _IO(0x04,220) /* rename a file/directory in the DOS */
/* directory only */
struct umsdos_ioctl{
- struct dirent dos_dirent;
- struct umsdos_dirent umsdos_dirent;
- /* The following structure is used to exchange some data */
- /* with utilities (umsdos_progs/util/umsdosio.c). The first */
- /* releases were using struct stat from "sys/stat.h". This was */
- /* causing some problem for cross compilation of the kernel */
- /* Since I am not really using the structure stat, but only some field */
- /* of it, I have decided to replicate the structure here */
- /* for compatibility with the binaries out there */
- struct {
- dev_t st_dev;
- unsigned short __pad1;
- ino_t st_ino;
- umode_t st_mode;
- nlink_t st_nlink;
- uid_t st_uid;
- gid_t st_gid;
- dev_t st_rdev;
- unsigned short __pad2;
- off_t st_size;
- unsigned long st_blksize;
- unsigned long st_blocks;
- time_t st_atime;
- unsigned long __unused1;
- time_t st_mtime;
- unsigned long __unused2;
- time_t st_ctime;
- unsigned long __unused3;
- unsigned long __unused4;
- unsigned long __unused5;
- }stat;
- char version,release;
+ struct dirent dos_dirent;
+ struct umsdos_dirent umsdos_dirent;
+ /* The following structure is used to exchange some data */
+ /* with utilities (umsdos_progs/util/umsdosio.c). The first */
+ /* releases were using struct stat from "sys/stat.h". This was */
+ /* causing some problem for cross compilation of the kernel */
+ /* Since I am not really using the structure stat, but only some field */
+ /* of it, I have decided to replicate the structure here */
+ /* for compatibility with the binaries out there */
+ /* FIXME PTW 1998, this has probably changed */
+ struct {
+ dev_t st_dev;
+ unsigned short __pad1;
+ ino_t st_ino;
+ umode_t st_mode;
+ nlink_t st_nlink;
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+ unsigned short __pad2;
+ off_t st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ time_t st_atime;
+ unsigned long __unused1;
+ time_t st_mtime;
+ unsigned long __unused2;
+ time_t st_ctime;
+ unsigned long __unused3;
+ unsigned long __unused4;
+ unsigned long __unused5;
+ }stat;
+ char version,release;
};
/* Different macros to access struct umsdos_dirent */
diff --git a/include/linux/umsdos_fs.p b/include/linux/umsdos_fs.p
index f271694c5..62ce67d0c 100644
--- a/include/linux/umsdos_fs.p
+++ b/include/linux/umsdos_fs.p
@@ -1,10 +1,18 @@
/* check.c 23/01/95 03.38.30 */
void check_page_tables (void);
/* dir.c 22/06/95 00.22.12 */
-long UMSDOS_dir_read (struct inode *inode,
- struct file *filp,
+struct dentry *creat_dentry (const char *name,
+ const int len,
+ struct inode *inode);
+int compat_msdos_create(struct inode *dir,
+ const char *name,
+ int len,
+ int mode,
+ struct inode **inode);
+int UMSDOS_dir_read ( struct file *filp,
char *buf,
- unsigned long count);
+ size_t size,
+ loff_t *count);
void umsdos_lookup_patch (struct inode *dir,
struct inode *inode,
struct umsdos_dirent *entry,
@@ -13,29 +21,35 @@ int umsdos_inode2entry (struct inode *dir,
struct inode *inode,
struct umsdos_dirent *entry);
int umsdos_locate_path (struct inode *inode, char *path);
-int umsdos_is_pseudodos (struct inode *dir, const char *name, int len);
-int UMSDOS_lookup (struct inode *dir,
- const char *name,
- int len,
- struct inode **result);
+int umsdos_is_pseudodos (struct inode *dir, struct dentry *dentry);
+int umsdos_lookup_x (
+ struct inode *dir,
+ struct dentry *dentry,
+ int nopseudo);
+int UMSDOS_lookup(struct inode *dir,struct dentry *dentry);
+
int umsdos_hlink2inode (struct inode *hlink, struct inode **result);
/* emd.c 22/06/95 00.22.04 */
-long umsdos_file_read_kmem (struct inode *inode,
+ssize_t umsdos_file_read_kmem (struct inode *emd_dir,
struct file *filp,
char *buf,
- unsigned long count);
-long umsdos_file_write_kmem (struct inode *inode,
+ size_t count,
+ loff_t *offs);
+ssize_t umsdos_file_write_kmem (struct inode *emd_dir,
struct file *filp,
const char *buf,
- unsigned long count);
-long umsdos_emd_dir_write (struct inode *emd_dir,
+ size_t count,
+ loff_t *offs);
+ssize_t umsdos_emd_dir_write (struct inode *emd_dir,
struct file *filp,
char *buf,
- unsigned long count);
-long umsdos_emd_dir_read (struct inode *emd_dir,
+ size_t count,
+ loff_t *offs);
+ssize_t umsdos_emd_dir_read (struct inode *emd_dir,
struct file *filp,
char *buf,
- unsigned long count);
+ size_t count,
+ loff_t *loffs);
struct inode *umsdos_emd_dir_lookup (struct inode *dir, int creat);
int umsdos_emd_dir_readentry (struct inode *emd_dir,
struct file *filp,
@@ -57,13 +71,14 @@ int umsdos_findentry (struct inode *dir,
/* inode.c 12/06/95 09.49.40 */
void UMSDOS_put_inode (struct inode *inode);
void UMSDOS_put_super (struct super_block *sb);
-void UMSDOS_statfs (struct super_block *sb,
+int UMSDOS_statfs (struct super_block *sb,
struct statfs *buf,
int bufsiz);
-int umsdos_real_lookup (struct inode *dir,
+int compat_umsdos_real_lookup (struct inode *dir,
const char *name,
int len,
struct inode **result);
+int umsdos_real_lookup(struct inode *inode,struct dentry *dentry);
void umsdos_setup_dir_inode (struct inode *inode);
void umsdos_set_dirinfo (struct inode *inode,
struct inode *dir,
@@ -75,7 +90,7 @@ void umsdos_patch_inode (struct inode *inode,
int umsdos_get_dirowner (struct inode *inode, struct inode **result);
void UMSDOS_read_inode (struct inode *inode);
void UMSDOS_write_inode (struct inode *inode);
-int UMSDOS_notify_change (struct inode *inode, struct iattr *attr);
+int UMSDOS_notify_change (struct dentry *dentry, struct iattr *attr);
struct super_block *UMSDOS_read_super (struct super_block *s,
void *data,
int silent);
@@ -87,50 +102,40 @@ int UMSDOS_ioctl_dir (struct inode *dir,
/* mangle.c 25/01/95 02.25.38 */
void umsdos_manglename (struct umsdos_info *info);
int umsdos_evalrecsize (int len);
-int umsdos_parse (const char *fname, int len, struct umsdos_info *info);
+int umsdos_parse (const char *name,int len, struct umsdos_info *info);
/* namei.c 25/01/95 02.25.38 */
void umsdos_lockcreate (struct inode *dir);
void umsdos_startlookup (struct inode *dir);
void umsdos_unlockcreate (struct inode *dir);
void umsdos_endlookup (struct inode *dir);
+
int UMSDOS_symlink (struct inode *dir,
- const char *name,
- int len,
- const char *symname);
-int UMSDOS_link (struct inode *oldinode,
- struct inode *dir,
- const char *name,
- int len);
+ struct dentry *dentry,
+ const char *symname);
+int UMSDOS_link (struct dentry *olddentry,
+ struct inode *dir,
+ struct dentry *dentry);
int UMSDOS_create (struct inode *dir,
- const char *name,
- int len,
- int mode,
- struct inode **result);
+ struct dentry *dentry,
+ int mode);
+
int UMSDOS_mkdir (struct inode *dir,
- const char *name,
- int len,
- int mode);
+ struct dentry *dentry,
+ int mode);
int UMSDOS_mknod (struct inode *dir,
- const char *name,
- int len,
- int mode,
- int rdev);
-int UMSDOS_rmdir (struct inode *dir, const char *name, int len);
-int UMSDOS_unlink (struct inode *dir, const char *name, int len);
+ struct dentry *dentry,
+ int mode,
+ int rdev);
+int UMSDOS_rmdir (struct inode *dir,struct dentry *dentry);
+int UMSDOS_unlink (struct inode *dir, struct dentry *dentry);
int UMSDOS_rename (struct inode *old_dir,
- const char *old_name,
- int old_len,
- struct inode *new_dir,
- const char *new_name,
- int new_len);
+ struct dentry *old_dentry,
+ struct inode *new_dir,
+ struct dentry *new_dentry);
/* rdir.c 22/03/95 03.31.42 */
int umsdos_rlookup_x (struct inode *dir,
- const char *name,
- int len,
- struct inode **result,
+ struct dentry *dentry,
int nopseudo);
int UMSDOS_rlookup (struct inode *dir,
- const char *name,
- int len,
- struct inode **result);
+ struct dentry *dentry);
/* symlink.c 23/01/95 03.38.30 */
diff --git a/include/linux/uts.h b/include/linux/uts.h
new file mode 100644
index 000000000..39e09ae10
--- /dev/null
+++ b/include/linux/uts.h
@@ -0,0 +1,23 @@
+#ifndef _LINUX_UTS_H
+#define _LINUX_UTS_H
+
+/*
+ * Defines for what uname() should return
+ */
+#ifndef UTS_SYSNAME
+#define UTS_SYSNAME "Linux"
+#endif
+
+#ifndef UTS_MACHINE
+#define UTS_MACHINE "unknown"
+#endif
+
+#ifndef UTS_NODENAME
+#define UTS_NODENAME "(none)" /* set by sethostname() */
+#endif
+
+#ifndef UTS_DOMAINNAME
+#define UTS_DOMAINNAME "(none)" /* set by setdomainname() */
+#endif
+
+#endif
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 4cf4d241f..064ee9d06 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -110,6 +110,7 @@ struct video_audio
#define VIDEO_AUDIO_VOLUME 4
#define VIDEO_AUDIO_BASS 8
#define VIDEO_AUDIO_TREBLE 16
+ char name[16];
};
struct video_clip
@@ -158,14 +159,28 @@ struct video_key
#define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */
#define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */
#define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */
-#define VIDIOCGFREQ _IOR('v',15, unsigned long) /* Set tuner */
+#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */
#define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */
#define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */
#define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */
+#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */
+
+
#define VID_HARDWARE_BT848 1
#define VID_HARDWARE_QCAM_BW 2
#define VID_HARDWARE_PMS 3
+#define VID_HARDWARE_QCAM_C 4
+
+/*
+ * Initialiser list
+ */
+
+struct video_init
+{
+ char *name;
+ int (*init)(struct video_init *);
+};
#endif
diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h
index 922a76961..aa3cb84a3 100644
--- a/include/linux/wanpipe.h
+++ b/include/linux/wanpipe.h
@@ -3,6 +3,7 @@
* User-level API definitions.
*
* Author: Gene Kozin <genek@compuserve.com>
+* Jaspreet Singh <jaspreet@sangoma.com>
*
* Copyright: (c) 1995-1997 Sangoma Technologies Inc.
*
@@ -11,6 +12,15 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
+* Nov 26, 1997 Jaspreet Singh Added 'load_sharing' structure. Also added
+* 'devs_struct','dev_to_devtint_next' to 'sdla_t'
+* Nov 24, 1997 Jaspreet Singh Added 'irq_dis_if_send_count',
+* 'irq_dis_poll_count' to 'sdla_t'.
+* Nov 06, 1997 Jaspreet Singh Added a define called 'INTR_TEST_MODE'
+* Oct 20, 1997 Jaspreet Singh Added 'buff_intr_mode_unbusy' and
+* 'dlci_intr_mode_unbusy' to 'sdla_t'
+* Oct 18, 1997 Jaspreet Singh Added structure to maintain global driver
+* statistics.
* Jan 15, 1997 Gene Kozin Version 3.1.0
* o added UDP management stuff
* Jan 02, 1997 Gene Kozin Version 3.0.0
@@ -61,6 +71,46 @@ typedef struct wum_header
unsigned char reserved[6]; /* 0Ah: reserved */
} wum_header_t;
+/*************************************************************************
+ Data Structure for global statistics
+*************************************************************************/
+
+typedef struct global_stats
+{
+ unsigned long isr_entry;
+ unsigned long isr_already_critical;
+ unsigned long isr_rx;
+ unsigned long isr_tx;
+ unsigned long isr_intr_test;
+ unsigned long isr_spurious;
+ unsigned long isr_enable_tx_int;
+ unsigned long rx_intr_corrupt_rx_bfr;
+ unsigned long rx_intr_on_orphaned_DLCI;
+ unsigned long rx_intr_dev_not_started;
+ unsigned long tx_intr_dev_not_started;
+ unsigned long poll_entry;
+ unsigned long poll_already_critical;
+ unsigned long poll_processed;
+ unsigned long poll_tbusy_bad_status;
+ unsigned long poll_host_disable_irq;
+ unsigned long poll_host_enable_irq;
+
+} global_stats_t;
+
+/* This structure is used for maitaining a circular linked list of all
+ * interfaces(devices) per card. It is used in the Interrupt Service routine
+ * for a transmit interrupt where the start of the loop to dev_tint all
+ * interfaces changes.
+ */
+typedef struct load_sharing
+{
+ struct device* dev_ptr;
+ struct load_sharing* next;
+} load_sharing_t;
+
+/* This is used for interrupt testing */
+#define INTR_TEST_MODE 0x02
+
#define WUM_SIGNATURE_L 0x50495046
#define WUM_SIGNATURE_H 0x444E3845
@@ -100,8 +150,21 @@ typedef struct sdla
wan_device_t wandev; /* WAN device data space */
unsigned open_cnt; /* number of open interfaces */
unsigned long state_tick; /* link state timestamp */
-/* unsigned tx_int_enabled; */ /* tranmit interrupt enabled or not */
+ unsigned intr_mode; /* Type of Interrupt Mode */
char in_isr; /* interrupt-in-service flag */
+ char buff_int_mode_unbusy; /* flag for carrying out dev_tint */
+ char dlci_int_mode_unbusy; /* flag for carrying out dev_tint */
+ unsigned short irq_dis_if_send_count; /* Disabling irqs in if_send*/
+ unsigned short irq_dis_poll_count; /* Disabling irqs in poll routine*/
+ global_stats_t statistics; /* global statistics */
+
+ /* The following is used as a pointer to the structure in our
+ circular linked list which changes the start of the loop for
+ dev_tint of all interfaces */
+
+ load_sharing_t* dev_to_devtint_next;
+ load_sharing_t* devs_struct;
+
void* mbox; /* -> mailbox */
void* rxmb; /* -> receive mailbox */
void* flags; /* -> adapter status flags */
@@ -123,7 +186,7 @@ typedef struct sdla
void* rxmb_last; /* -> last Rx buffer */
unsigned rx_base; /* S508 receive buffer base */
unsigned rx_top; /* S508 receive buffer end */
- unsigned short node_dlci;
+ unsigned short node_dlci[100];
unsigned short dlci_num;
} f;
struct /****** PPP-specific data ***********/
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index accb9c9ee..8bdba9cad 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -4,6 +4,7 @@
* Drivers and is completely hardware-independent.
*
* Author: Gene Kozin <genek@compuserve.com>
+* Jaspreet Singh <jaspreet@sangoma.com>
*
* Copyright: (c) 1995-1997 Sangoma Technologies Inc.
*
@@ -12,7 +13,16 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
-* May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' tp 'wan_device_t'
+* Nov 06, 1997 Jaspreet Singh Changed Router Driver version to 1.1 from 1.0
+* Oct 20, 1997 Jaspreet Singh Added 'cir','bc','be' and 'mc' to 'wanif_conf_t'
+* Added 'enable_IPX' and 'network_number' to
+* 'wan_device_t'. Also added defines for
+* UDP PACKET TYPE, Interrupt test, critical values* for RACE conditions.
+* Oct 05, 1997 Jaspreet Singh Added 'dlci_num' and 'dlci[100]' to
+* 'wan_fr_conf_t' to configure a list of dlci(s)
+* for a NODE
+* Jul 07, 1997 Jaspreet Singh Added 'ttl' to 'wandev_conf_t' & 'wan_device_t'
+* May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' to 'wan_device_t'
* May 21, 1997 Jaspreet Singh Added 'udp_port' to 'wan_device_t'
* Apr 25, 1997 Farhan Thawar Added 'udp_port' to 'wandev_conf_t'
* Jan 16, 1997 Gene Kozin router_devlist made public
@@ -23,7 +33,7 @@
#define ROUTER_NAME "wanrouter" /* in case we ever change it */
#define ROUTER_VERSION 1 /* version number */
-#define ROUTER_RELEASE 0 /* release (minor version) number */
+#define ROUTER_RELEASE 1 /* release (minor version) number */
#define ROUTER_IOCTL 'W' /* for IOCTL calls */
#define ROUTER_MAGIC 0x524D4157L /* signature: 'WANR' reversed */
@@ -53,6 +63,27 @@ enum router_ioctls
#define WAN_DRVNAME_SZ 15 /* max length of the link driver name */
#define WAN_ADDRESS_SZ 31 /* max length of the WAN media address */
+/* Defines for UDP PACKET TYPE */
+#define UDP_PTPIPE_TYPE 0x01
+#define UDP_FPIPE_TYPE 0x02
+#define UDP_DRVSTATS_TYPE 0x03
+#define UDP_INVALID_TYPE 0x04
+
+/* Command return code */
+#define CMD_OK 0 /* normal firmware return code */
+#define CMD_TIMEOUT 0xFF /* firmware command timed out */
+
+/* UDP Packet Management */
+#define UDP_PKT_FRM_STACK 0x00
+#define UDP_PKT_FRM_NETWORK 0x01
+
+/* Maximum interrupt test counter */
+#define MAX_INTR_TEST_COUNTER 100
+
+/* Critical Values for RACE conditions*/
+#define CRITICAL_IN_ISR 0xA1
+#define CRITICAL_INTR_HANDLED 0xB1
+
/****** Data Types **********************************************************/
/*----------------------------------------------------------------------------
@@ -87,15 +118,14 @@ typedef struct wan_x25_conf
*/
typedef struct wan_fr_conf
{
- unsigned cir; /* committed information rate */
unsigned signalling; /* local in-channel signalling type */
unsigned t391; /* link integrity verification timer */
unsigned t392; /* polling verification timer */
unsigned n391; /* full status polling cycle counter */
unsigned n392; /* error threshold counter */
unsigned n393; /* monitored events counter */
- unsigned dlci; /* first DLC number (access node) */
unsigned dlci_num; /* number of DLCs (access node) */
+ unsigned dlci[100]; /* List of all DLCIs */
} wan_fr_conf_t;
/*----------------------------------------------------------------------------
@@ -133,12 +163,15 @@ typedef struct wandev_conf
unsigned bps; /* data transfer rate */
unsigned mtu; /* maximum transmit unit size */
unsigned udp_port; /* UDP port for management */
+ unsigned char ttl; /* Time To Live for UDP security */
char interface; /* RS-232/V.35, etc. */
char clocking; /* external/internal */
char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */
char station; /* DTE/DCE, primary/secondary, etc. */
char connection; /* permanent/switched/on-demand */
unsigned hw_opt[4]; /* other hardware options */
+ unsigned char enable_IPX; /* Enable or Disable IPX */
+ unsigned long network_number; /* Network Number for IPX */
unsigned reserved[4];
/****** arbitrary data ***************/
unsigned data_size; /* data buffer size */
@@ -261,6 +294,10 @@ typedef struct wanif_conf
char addr[WAN_ADDRESS_SZ+1]; /* media address, ASCIIZ */
unsigned idle_timeout; /* sec, before disconnecting */
unsigned hold_timeout; /* sec, before re-connecting */
+ unsigned cir; /* Committed Information Rate fwd,bwd*/
+ unsigned bc; /* Committed Burst Size fwd, bwd */
+ unsigned be; /* Excess Burst Size fwd, bwd */
+ char mc; /* Multicast on or off */
int reserved[8]; /* reserved for future extensions */
} wanif_conf_t;
@@ -289,13 +326,16 @@ typedef struct wan_device
unsigned bps; /* data transfer rate */
unsigned mtu; /* max physical transmit unit size */
unsigned udp_port; /* UDP port for management */
- unsigned tx_int_enabled; /* Transmit Interrupt enabled or not */
+ unsigned char ttl; /* Time To Live for UDP security */
+ unsigned enable_tx_int; /* Transmit Interrupt enabled or not */
char interface; /* RS-232/V.35, etc. */
char clocking; /* external/internal */
char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */
char station; /* DTE/DCE, primary/secondary, etc. */
char connection; /* permanent/switched/on-demand */
unsigned hw_opt[4]; /* other hardware options */
+ unsigned char enable_IPX; /* Enable or Disable IPX */
+ unsigned long network_number; /* Network Number for IPX */
/****** status and statistics *******/
char state; /* device state */
unsigned modem_status; /* modem status */
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index b15f2a0db..0c2e9fb2a 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -213,7 +213,7 @@ struct iw_encoding
struct iw_statistics
{
__u8 status; /* Status
- * - device dependant for now */
+ * - device dependent for now */
struct iw_quality qual; /* Quality of the link
* (instant/mean/max) */
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 5cee95332..44fb44d2c 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -40,10 +40,6 @@ struct prefix_info {
#define IN6_ADDR_HSIZE 16
-extern struct inet6_ifaddr *inet6_addr_lst[IN6_ADDR_HSIZE];
-extern struct ifmcaddr6 *inet6_mcast_lst[IN6_ADDR_HSIZE];
-extern struct inet6_dev *inet6_dev_lst[IN6_ADDR_HSIZE];
-
extern void addrconf_init(void);
extern void addrconf_cleanup(void);
@@ -55,7 +51,8 @@ extern int addrconf_add_ifaddr(void *arg);
extern int addrconf_del_ifaddr(void *arg);
extern int addrconf_set_dstaddr(void *arg);
-extern struct inet6_ifaddr * ipv6_chk_addr(struct in6_addr *addr);
+extern struct inet6_ifaddr * ipv6_chk_addr(struct in6_addr *addr,
+ struct device *dev, int nd);
extern struct inet6_ifaddr * ipv6_get_saddr(struct dst_entry *dst,
struct in6_addr *daddr);
extern struct inet6_ifaddr * ipv6_get_lladdr(struct device *dev);
@@ -64,10 +61,10 @@ extern struct inet6_ifaddr * ipv6_get_lladdr(struct device *dev);
* multicast prototypes (mcast.c)
*/
extern int ipv6_sock_mc_join(struct sock *sk,
- struct device *dev,
+ int ifindex,
struct in6_addr *addr);
extern int ipv6_sock_mc_drop(struct sock *sk,
- struct device *dev,
+ int ifindex,
struct in6_addr *addr);
extern void ipv6_sock_mc_close(struct sock *sk);
@@ -75,6 +72,10 @@ extern int ipv6_dev_mc_inc(struct device *dev,
struct in6_addr *addr);
extern int ipv6_dev_mc_dec(struct device *dev,
struct in6_addr *addr);
+extern void ipv6_mc_up(struct inet6_dev *idev);
+extern void ipv6_mc_down(struct inet6_dev *idev);
+extern void ipv6_mc_destroy_dev(struct inet6_dev *idev);
+extern void addrconf_dad_failure(struct inet6_ifaddr *ifp);
extern int ipv6_chk_mcast_addr(struct device *dev,
struct in6_addr *addr);
@@ -115,28 +116,42 @@ static __inline__ int ipv6_devindex_hash(int ifindex)
* compute link-local solicited-node multicast address
*/
-static __inline__ void addrconf_addr_solict_mult(struct in6_addr *addr,
- struct in6_addr *solicited)
+extern __inline__ void addrconf_addr_solict_mult_old(struct in6_addr *addr,
+ struct in6_addr *solicited)
{
ipv6_addr_set(solicited,
__constant_htonl(0xFF020000), 0,
__constant_htonl(0x1), addr->s6_addr32[3]);
}
-static __inline__ void ipv6_addr_all_nodes(struct in6_addr *addr)
+extern __inline__ void addrconf_addr_solict_mult_new(struct in6_addr *addr,
+ struct in6_addr *solicited)
+{
+ ipv6_addr_set(solicited,
+ __constant_htonl(0xFF020000), 0,
+ __constant_htonl(0x1),
+ __constant_htonl(0xFF000000) | addr->s6_addr32[3]);
+}
+
+
+extern __inline__ void ipv6_addr_all_nodes(struct in6_addr *addr)
{
ipv6_addr_set(addr,
__constant_htonl(0xFF020000), 0, 0,
__constant_htonl(0x1));
}
-static __inline__ void ipv6_addr_all_routers(struct in6_addr *addr)
+extern __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)
+{
+ return (addr->s6_addr32[0] & __constant_htonl(0xFF000000)) == __constant_htonl(0xFF000000);
+}
#endif
#endif
diff --git a/include/net/arp.h b/include/net/arp.h
index dbd0c1281..b672bacb6 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -4,45 +4,21 @@
#include <linux/if_arp.h>
#include <net/neighbour.h>
-/*
- * This structure defines the ARP mapping cache.
- */
-struct arp_table
-{
- union {
- struct neighbour neigh;
- struct arp_table *next;
- } u;
-
- u32 ip;
-
- unsigned long last_updated; /* For expiry */
- unsigned int flags; /* Control status */
-
- u32 mask; /* netmask - used for generalised proxy arps (tridge) */
- int hatype;
-
- /*
- * The following entries are only used for unresolved hw addresses.
- */
- struct timer_list timer; /* expire timer */
- int retries; /* remaining retries */
-};
+extern struct neigh_table arp_tbl;
extern void arp_init(void);
extern int arp_rcv(struct sk_buff *skb, struct device *dev,
struct packet_type *pt);
extern int arp_find(unsigned char *haddr, struct sk_buff *skb);
-extern int arp_find_1(unsigned char *haddr, struct dst_entry* dst,
- struct neighbour *neigh);
extern int arp_ioctl(unsigned int cmd, void *arg);
extern void arp_send(int type, int ptype, u32 dest_ip,
struct device *dev, u32 src_ip,
unsigned char *dest_hw, unsigned char *src_hw, unsigned char *th);
-extern int arp_req_set(struct arpreq *r, struct device *dev);
-extern int arp_req_delete(struct arpreq *r, struct device *dev);
-extern int arp_bind_cache(struct hh_cache ** hhp, struct device *dev, unsigned short type, __u32 daddr);
-extern int arp_update_cache(struct hh_cache * hh);
-extern struct neighbour *arp_find_neighbour(struct dst_entry *dst, int);
+extern int arp_bind_neighbour(struct dst_entry *dst);
+extern int arp_mc_map(u32 addr, u8 *haddr, struct device *dev, int dir);
+extern void arp_ifdown(struct device *dev);
+
+extern struct neigh_ops arp_broken_ops;
+
#endif /* _ARP_H */
diff --git a/include/net/checksum.h b/include/net/checksum.h
index 19dea08ea..d09f29c9f 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -29,6 +29,7 @@
#include <asm/types.h>
#include <asm/byteorder.h>
#include <net/ip.h>
+#include <asm/uaccess.h>
#include <asm/checksum.h>
#ifndef _HAVE_ARCH_IPV6_CSUM
@@ -90,4 +91,19 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
#endif
+#ifndef _HAVE_ARCH_COPY_AND_CSUM_FROM_USER
+extern __inline__
+unsigned int csum_and_copy_from_user (const char *src, char *dst,
+ int len, int sum, int *err_ptr)
+{
+ if (verify_area(VERIFY_READ, src, len) == 0)
+ return csum_partial_copy_from_user(src, dst, len, sum, err_ptr);
+
+ if (len)
+ *err_ptr = -EFAULT;
+
+ return sum;
+}
+#endif
+
#endif
diff --git a/include/net/dst.h b/include/net/dst.h
index 155662f9d..b879bb059 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -33,10 +33,10 @@ struct dst_entry
atomic_t refcnt; /* tree/hash references */
atomic_t use; /* client references */
struct device *dev;
- char obsolete;
- char priority;
- char __pad1, __pad2;
+ int obsolete;
+ __u32 priority;
unsigned long lastuse;
+ unsigned mxlock;
unsigned window;
unsigned pmtu;
unsigned rtt;
@@ -60,10 +60,18 @@ struct dst_entry
struct dst_ops
{
unsigned short family;
+ unsigned short protocol;
+ unsigned gc_thresh;
+
+ int (*gc)(void);
struct dst_entry * (*check)(struct dst_entry *, __u32 cookie);
struct dst_entry * (*reroute)(struct dst_entry *,
struct sk_buff *);
void (*destroy)(struct dst_entry *);
+ struct dst_entry * (*negative_advice)(struct dst_entry *);
+ void (*link_failure)(struct sk_buff *);
+
+ atomic_t entries;
};
#ifdef __KERNEL__
@@ -71,7 +79,7 @@ struct dst_ops
extern struct dst_entry * dst_garbage_list;
extern atomic_t dst_total;
-static __inline__
+extern __inline__
struct dst_entry * dst_clone(struct dst_entry * dst)
{
if (dst)
@@ -79,14 +87,14 @@ struct dst_entry * dst_clone(struct dst_entry * dst)
return dst;
}
-static __inline__
+extern __inline__
void dst_release(struct dst_entry * dst)
{
if (dst)
atomic_dec(&dst->use);
}
-static __inline__
+extern __inline__
struct dst_entry * dst_check(struct dst_entry ** dst_p, u32 cookie)
{
struct dst_entry * dst = *dst_p;
@@ -95,7 +103,7 @@ struct dst_entry * dst_check(struct dst_entry ** dst_p, u32 cookie)
return (*dst_p = dst);
}
-static __inline__
+extern __inline__
struct dst_entry * dst_reroute(struct dst_entry ** dst_p, struct sk_buff *skb)
{
struct dst_entry * dst = *dst_p;
@@ -104,21 +112,12 @@ struct dst_entry * dst_reroute(struct dst_entry ** dst_p, struct sk_buff *skb)
return (*dst_p = dst);
}
-static __inline__
-void dst_destroy(struct dst_entry * dst)
-{
- if (dst->neighbour)
- neigh_release(dst->neighbour);
- if (dst->ops->destroy)
- dst->ops->destroy(dst);
- kfree(dst);
- atomic_dec(&dst_total);
-}
extern void * dst_alloc(int size, struct dst_ops * ops);
extern void __dst_free(struct dst_entry * dst);
+extern void dst_destroy(struct dst_entry * dst);
-static __inline__
+extern __inline__
void dst_free(struct dst_entry * dst)
{
if (!atomic_read(&dst->use)) {
@@ -127,6 +126,26 @@ void dst_free(struct dst_entry * dst)
}
__dst_free(dst);
}
+
+extern __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)
+{
+ 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)
+{
+ struct dst_entry * dst = skb->dst;
+ if (dst && dst->ops && dst->ops->link_failure)
+ dst->ops->link_failure(skb);
+}
#endif
#endif /* _NET_DST_H */
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 281c2f099..4e9ed9780 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -15,15 +15,21 @@
#ifndef _NET_IF_INET6_H
#define _NET_IF_INET6_H
+/* These flags match corresponding IFA_F_* flags but ADDR_INVALID,
+ which is invisible externally.
+ */
+
+#define ADDR_PERMANENT 0x80
+
#define DAD_COMPLETE 0x00
-#define DAD_INCOMPLETE 0x01
-#define DAD_STATUS 0x01
+#define DAD_INCOMPLETE 0x40
+#define DAD_STATUS 0x40
+
+#define ADDR_STATUS 0x21
+#define ADDR_DEPRECATED 0x20
+#define ADDR_INVALID 0x01
-#define ADDR_STATUS 0x06
-#define ADDR_DEPRECATED 0x02
-#define ADDR_INVALID 0x04
-#define ADDR_PERMANENT 0x80
#define IF_RA_RCVD 0x20
#define IF_RS_SENT 0x10
@@ -53,22 +59,25 @@ struct inet6_ifaddr
};
-struct ipv6_mc_socklist {
+struct ipv6_mc_socklist
+{
struct in6_addr addr;
- struct device *dev;
+ int ifindex;
struct ipv6_mc_socklist *next;
};
#define MAF_TIMER_RUNNING 0x01
#define MAF_LAST_REPORTER 0x02
+#define MAF_LOADED 0x04
-struct ifmcaddr6 {
+struct ifmcaddr6
+{
struct in6_addr mca_addr;
struct device *dev;
struct ifmcaddr6 *next;
struct ifmcaddr6 *if_next;
struct timer_list mca_timer;
- unsigned long mca_flags;
+ unsigned mca_flags;
atomic_t mca_users;
};
@@ -77,7 +86,21 @@ struct ifmcaddr6 {
#define IFA_SITE IPV6_ADDR_SITELOCAL
#define IFA_GLOBAL 0x0000U
-extern int in6_ifnum;
+struct ipv6_devconf
+{
+ int forwarding;
+ int hop_limit;
+ int mtu6;
+ int accept_ra;
+ int accept_redirects;
+ int autoconf;
+ int dad_transmits;
+ int rtr_solicits;
+ int rtr_solicit_interval;
+ int rtr_solicit_delay;
+
+ void *sysctl;
+};
struct inet6_dev
{
@@ -85,16 +108,16 @@ struct inet6_dev
struct inet6_ifaddr *addr_list;
struct ifmcaddr6 *mc_list;
-
__u32 if_flags;
- __u32 router:1,
- unused:31;
+ struct neigh_parms *nd_parms;
struct inet6_dev *next;
+ struct ipv6_devconf cnf;
};
+extern struct ipv6_devconf ipv6_devconf;
-extern __inline__ void ipv6_mc_map(struct in6_addr *addr, char *buf)
+extern __inline__ void ipv6_eth_mc_map(struct in6_addr *addr, char *buf)
{
/*
* +-------+-------+-------+-------+-------+-------+
diff --git a/include/net/inet_common.h b/include/net/inet_common.h
index af1128baf..9c7c8b947 100644
--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -28,7 +28,7 @@ extern int inet_sendmsg(struct socket *sock,
struct msghdr *msg,
int size, struct scm_cookie *scm);
extern int inet_shutdown(struct socket *sock, int how);
-extern unsigned int inet_poll(struct socket *sock, struct poll_table_struct *wait);
+extern unsigned int inet_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait);
extern int inet_setsockopt(struct socket *sock, int level,
int optname, char *optval,
int optlen);
diff --git a/include/net/ip.h b/include/net/ip.h
index 29c40ca87..70d22dcc5 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -11,6 +11,9 @@
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
* Alan Cox, <gw4pts@gw4pts.ampr.org>
*
+ * Changes:
+ * Mike McLagan : Routing by source
+ *
* 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
@@ -28,6 +31,7 @@
#include <linux/inetdevice.h>
#include <linux/in_route.h>
#include <net/route.h>
+#include <net/arp.h>
#ifndef _SNMP_H
#include <net/snmp.h>
@@ -96,7 +100,7 @@ extern int ip_acct_output(struct sk_buff *skb);
#else
#define ip_acct_output dev_queue_xmit
#endif
-extern void ip_fragment(struct sk_buff *skb, int, int (*out)(struct sk_buff*));
+extern void ip_fragment(struct sk_buff *skb, int (*out)(struct sk_buff*));
extern struct sk_buff * ip_reply(struct sk_buff *skb, int payload);
extern int ip_do_nat(struct sk_buff *skb);
extern void ip_send_check(struct iphdr *ip);
@@ -109,21 +113,60 @@ extern int ip_build_xmit(struct sock *sk,
unsigned int,
unsigned int),
const void *frag,
- unsigned short int length,
+ unsigned length,
struct ipcm_cookie *ipc,
struct rtable *rt,
int flags);
+extern int __ip_finish_output(struct sk_buff *skb);
-static __inline__
-void ip_send(struct sk_buff *skb)
+struct ipv4_config
{
- ip_ll_header(skb);
+ int log_martians;
+ int autoconfig;
+ int no_pmtu_disc;
+};
+
+extern struct ipv4_config ipv4_config;
+extern struct ip_mib ip_statistics;
+
+extern int sysctl_local_port_range[2];
+
+extern __inline__ int ip_finish_output(struct sk_buff *skb)
+{
+ struct dst_entry *dst = skb->dst;
+ struct device *dev = dst->dev;
+ struct hh_cache *hh = dst->hh;
+
+ skb->dev = dev;
+ skb->protocol = __constant_htons(ETH_P_IP);
+
+ if (hh) {
+#ifdef __alpha__
+ /* Alpha has disguisting memcpy. Help it. */
+ u64 *aligned_hdr = (u64*)(skb->data - 16);
+ u64 *aligned_hdr0 = hh->hh_data;
+ aligned_hdr[0] = aligned_hdr0[0];
+ aligned_hdr[1] = aligned_hdr0[1];
+#else
+ memcpy(skb->data - 16, hh->hh_data, 16);
+#endif
+ skb_push(skb, dev->hard_header_len);
+ return hh->hh_output(skb);
+ } else if (dst->neighbour)
+ return dst->neighbour->output(skb);
+
+ printk(KERN_DEBUG "khm\n");
+ kfree_skb(skb);
+ return -EINVAL;
+}
- if (skb->len > skb->dev->mtu + skb->dev->hard_header_len)
- ip_fragment(skb, 0, ip_acct_output);
+extern __inline__ void ip_send(struct sk_buff *skb)
+{
+ if (skb->len > skb->dst->pmtu)
+ ip_fragment(skb, __ip_finish_output);
else
- ip_acct_output(skb);
+ ip_finish_output(skb);
}
static __inline__
@@ -137,28 +180,23 @@ int ip_decrease_ttl(struct iphdr *iph)
return --iph->ttl;
}
-extern struct ip_mib ip_statistics;
+/*
+ * Map a multicast IP onto multicast MAC for type ethernet.
+ */
-struct ipv4_config
+extern __inline__ void ip_eth_mc_map(u32 addr, char *buf)
{
- int accept_redirects;
- int secure_redirects;
- int rfc1620_redirects;
- int rfc1812_filter;
- int send_redirects;
- int log_martians;
- int source_route;
- int multicast_route;
- int proxy_arp;
- int bootp_relay;
- int autoconfig;
- int no_pmtu_disc;
-};
-
-extern struct ipv4_config ipv4_config;
-extern int sysctl_local_port_range[2];
+ addr=ntohl(addr);
+ buf[0]=0x01;
+ buf[1]=0x00;
+ buf[2]=0x5e;
+ buf[5]=addr&0xFF;
+ addr>>=8;
+ buf[4]=addr&0xFF;
+ addr>>=8;
+ buf[3]=addr&0x7F;
+}
-#define IS_ROUTER (ip_statistics.IpForwarding == 1)
extern int ip_call_ra_chain(struct sk_buff *skb);
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 482c7c74a..6b355cc12 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -19,6 +19,7 @@
#include <net/dst.h>
#include <net/flow.h>
+#include <linux/rtnetlink.h>
struct rt6_info;
@@ -66,8 +67,9 @@ struct rt6_info {
int rt6i_keylen;
- unsigned long rt6i_flags;
- unsigned long rt6i_metric;
+ u32 rt6i_flags;
+ u32 rt6i_metric;
+ u8 rt6i_hoplimit;
unsigned long rt6i_expires;
union {
@@ -137,17 +139,9 @@ extern int fib6_add(struct fib6_node *root,
extern int fib6_del(struct rt6_info *rt);
-/*
- * auxiliary functions
- */
-extern __inline__ void rt6_release(struct rt6_info *rt)
-{
- struct dst_entry *dst = (struct dst_entry *) rt;
- if (atomic_dec_and_test(&dst->refcnt))
- dst_destroy(dst);
-}
-
-extern void rt6_ins(struct rt6_info *rt);
+extern void inet6_rt_notify(int event, struct rt6_info *rt);
+
+extern void fib6_run_gc(unsigned long dummy);
#endif
#endif
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index bdbe5c575..42233aadf 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -38,6 +38,11 @@ struct pol_chain {
extern struct rt6_info ip6_null_entry;
+extern int ip6_rt_max_size;
+extern int ip6_rt_gc_min;
+extern int ip6_rt_gc_timeout;
+extern int ip6_rt_gc_interval;
+
extern void ip6_route_input(struct sk_buff *skb);
extern struct dst_entry * ip6_route_output(struct sock *sk,
@@ -55,6 +60,9 @@ extern int ip6_del_rt(struct rt6_info *);
extern int ip6_rt_addr_add(struct in6_addr *addr,
struct device *dev);
+extern int ip6_rt_addr_del(struct in6_addr *addr,
+ struct device *dev);
+
extern void rt6_sndmsg(int type, struct in6_addr *dst,
struct in6_addr *src,
struct in6_addr *gw,
@@ -87,7 +95,13 @@ extern void rt6_pmtu_discovery(struct in6_addr *addr,
struct device *dev,
int pmtu);
-extern struct rt6_info * ip6_rt_copy(struct rt6_info *rt);
+struct nlmsghdr;
+struct netlink_callback;
+extern int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb);
+extern int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg);
+extern int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg);
+
+extern void rt6_ifdown(struct device *dev);
/*
* Store a destination cache entry in a socket
@@ -100,7 +114,7 @@ extern __inline__ void ip6_dst_store(struct sock *sk, struct dst_entry *dst)
struct rt6_info *rt;
np = &sk->net_pinfo.af_inet6;
- np->dst = dst;
+ sk->dst_cache = dst;
rt = (struct rt6_info *) dst;
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index cd46bc7dc..d725e78d4 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -18,6 +18,29 @@
#include <linux/config.h>
+struct kern_rta
+{
+ void *rta_dst;
+ void *rta_src;
+ int *rta_iif;
+ int *rta_oif;
+ void *rta_gw;
+ u32 *rta_priority;
+ void *rta_prefsrc;
+#ifdef CONFIG_RTNL_OLD_IFINFO
+ unsigned *rta_window;
+ unsigned *rta_rtt;
+ unsigned *rta_mtu;
+ unsigned char *rta_ifname;
+#else
+ struct rtattr *rta_mx;
+ struct rtattr *rta_mp;
+ unsigned char *rta_protoinfo;
+ unsigned char *rta_flow;
+#endif
+ struct rta_cacheinfo *rta_ci;
+};
+
struct fib_nh
{
struct device *nh_dev;
@@ -43,9 +66,17 @@ struct fib_info
unsigned fib_flags;
int fib_protocol;
u32 fib_prefsrc;
+#ifdef CONFIG_RTNL_OLD_IFINFO
unsigned fib_mtu;
unsigned fib_rtt;
unsigned fib_window;
+#else
+#define FIB_MAX_METRICS RTAX_RTT
+ unsigned fib_metrics[FIB_MAX_METRICS];
+#define fib_mtu fib_metrics[RTAX_MTU-1]
+#define fib_window fib_metrics[RTAX_WINDOW-1]
+#define fib_rtt fib_metrics[RTAX_RTT-1]
+#endif
int fib_nhs;
#ifdef CONFIG_IP_ROUTE_MULTIPATH
int fib_power;
@@ -128,8 +159,9 @@ extern __inline__ struct fib_table *fib_new_table(int id)
extern __inline__ int fib_lookup(const struct rt_key *key, struct fib_result *res)
{
- if (local_table->tb_lookup(local_table, key, res))
- return main_table->tb_lookup(main_table, key, res);
+ if (local_table->tb_lookup(local_table, key, res) &&
+ main_table->tb_lookup(main_table, key, res))
+ return -ENETUNREACH;
return 0;
}
@@ -180,7 +212,7 @@ extern int fib_nh_match(struct rtmsg *r, struct nlmsghdr *, struct kern_rta *rta
extern int fib_dump_info(struct sk_buff *skb, pid_t pid, u32 seq, int event,
u8 tb_id, u8 type, u8 scope, void *dst, int dst_len, u8 tos,
struct fib_info *fi);
-extern int fib_sync_down(u32 local, struct device *dev);
+extern int fib_sync_down(u32 local, struct device *dev, int force);
extern int fib_sync_up(struct device *dev);
extern int fib_convert_rtentry(int cmd, struct nlmsghdr *nl, struct rtmsg *rtm,
struct kern_rta *rta, struct rtentry *r);
diff --git a/include/net/ip_masq.h b/include/net/ip_masq.h
index 810abd5f6..0faa88336 100644
--- a/include/net/ip_masq.h
+++ b/include/net/ip_masq.h
@@ -2,6 +2,7 @@
* IP masquerading functionality definitions
*/
+#include <linux/config.h> /* for CONFIG_IP_MASQ_NDEBUG */
#ifndef _IP_MASQ_H
#define _IP_MASQ_H
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 835d54fc6..b6055ae44 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.6 1997/04/01 02:22:58 davem Exp $
+ * $Id: ipv6.h,v 1.8 1997/12/29 19:52:09 kuznet Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -88,30 +88,6 @@ struct frag_hdr {
extern struct ipv6_mib ipv6_statistics;
-struct ipv6_config {
- int forwarding;
- int hop_limit;
- int accept_ra;
- int accept_redirects;
-
- int nd_max_mcast_solicit;
- int nd_max_ucast_solicit;
- int nd_retrans_time;
- int nd_base_reachable_time;
- int nd_delay_probe_time;
-
- int autoconf;
- int dad_transmits;
- int rtr_solicits;
- int rtr_solicit_interval;
- int rtr_solicit_delay;
-
- int rt_cache_timeout;
- int rt_gc_period;
-};
-
-extern struct ipv6_config ipv6_config;
-
struct ipv6_frag {
__u16 offset;
__u16 len;
@@ -236,7 +212,7 @@ extern int ip6_build_xmit(struct sock *sk,
inet_getfrag_t getfrag,
const void *data,
struct flowi *fl,
- unsigned short length,
+ unsigned length,
struct ipv6_options *opt,
int hlimit, int flags);
@@ -244,6 +220,7 @@ extern int ip6_build_xmit(struct sock *sk,
* skb processing functions
*/
+extern int ip6_output(struct sk_buff *skb);
extern int ip6_forward(struct sk_buff *skb);
extern int ip6_input(struct sk_buff *skb);
extern int ip6_mc_input(struct sk_buff *skb);
diff --git a/include/net/ipx.h b/include/net/ipx.h
index ed7b7adbb..52f09384e 100644
--- a/include/net/ipx.h
+++ b/include/net/ipx.h
@@ -1,4 +1,3 @@
-
/*
* The following information is in its entirety obtained from:
*
@@ -12,7 +11,6 @@
#define _NET_INET_IPX_H_
#include <linux/netdevice.h>
-#include <linux/skbuff.h>
#include <net/datalink.h>
#include <linux/ipx.h>
@@ -44,8 +42,6 @@ struct ipxhdr
};
#include <net/ipxcall.h>
-extern int ipx_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt);
-extern void ipxrtr_device_down(struct device *dev);
typedef struct ipx_interface {
/* IPX address */
@@ -80,4 +76,4 @@ typedef struct ipx_route {
#define IPX_MIN_EPHEMERAL_SOCKET 0x4000
#define IPX_MAX_EPHEMERAL_SOCKET 0x7fff
-#endif
+#endif /* def _NET_INET_IPX_H_ */
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 9173a0eae..754253811 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -1,34 +1,6 @@
#ifndef _NDISC_H
#define _NDISC_H
-
-/*
- * Neighbor Cache Entry States (7.3.2.)
- */
-
-/*
- * The lsb is set for states that have a timer associated
- */
-
-#define NUD_NONE 0x00
-#define NUD_INCOMPLETE 0x11
-#define NUD_REACHABLE 0x20
-#define NUD_STALE 0x30
-#define NUD_DELAY 0x41
-#define NUD_PROBE 0x51
-#define NUD_FAILED 0x60 /* neighbour discovery failed */
-
-#define NUD_IN_TIMER 0x01
-
-#define NDISC_QUEUE_LEN 3
-
-#define NCF_NOARP 0x0100 /* no ARP needed on this device */
-#define NCF_SUBNET 0x0200 /* NC entry for subnet */
-#define NCF_INVALID 0x0400
-#define NCF_DELAY_EXPIRED 0x0800 /* time to move to PROBE */
-#define NCF_ROUTER 0x1000 /* neighbour is a router */
-#define NCF_HHVALID 0x2000 /* Hardware header is valid */
-
/*
* ICMP codes for neighbour discovery messages
*/
@@ -51,13 +23,11 @@
#define MAX_RTR_SOLICITATION_DELAY HZ
-#define RECHABLE_TIME (30*HZ)
-#define RETRANS_TIMER HZ
-
-#define MIN_RANDOM_FACTOR (1/2)
-#define MAX_RANDOM_FACTOR (3/2)
+#define ND_REACHABLE_TIME (30*HZ)
+#define ND_RETRANS_TIMER HZ
-#define REACH_RANDOM_INTERVAL (60*60*HZ) /* 1 hour */
+#define ND_MIN_RANDOM_FACTOR (1/2)
+#define ND_MAX_RANDOM_FACTOR (3/2)
#ifdef __KERNEL__
@@ -67,28 +37,7 @@
#include <net/neighbour.h>
#include <asm/atomic.h>
-/*
- * neighbour cache entry
- * used by neighbour discovery module
- */
-
-struct nd_neigh {
- struct neighbour neigh;
- struct in6_addr ndn_addr; /* next hop addr */
-
- __u8 ndn_plen, /* prefix len */
- ndn_type, /* {unicast, multicast} */
- ndn_nud_state,
- ndn_probes;
-
- unsigned long ndn_expires; /* timer expires at */
-
-#define ndn_refcnt neigh.refcnt
-#define ndn_tstamp neigh.lastused
-#define ndn_dev neigh.dev
-#define ndn_flags neigh.flags
-#define ndn_ha neigh.ha
-};
+extern struct neigh_table nd_tbl;
struct nd_msg {
struct icmp6hdr icmph;
@@ -106,25 +55,8 @@ struct ra_msg {
__u32 retrans_timer;
};
-struct ndisc_statistics {
- __u32 allocs; /* allocated entries */
- __u32 free_delayed; /* zombie entries */
- __u32 snt_probes_ucast; /* ns probes sent (ucast) */
- __u32 snt_probes_mcast; /* ns probes sent (mcast) */
- __u32 rcv_probes_ucast; /* ns probes rcv (ucast) */
- __u32 rcv_probes_mcast; /* ns probes rcv (mcast) */
- __u32 rcv_upper_conf; /* confirmations from upper layers */
- __u32 res_failed; /* address resolution failures */
-};
-
-extern struct neighbour * ndisc_find_neigh(struct device *dev,
- struct in6_addr *addr);
-
-extern void ndisc_validate(struct neighbour *neigh);
extern void ndisc_init(struct net_proto_family *ops);
-extern struct neighbour* ndisc_get_neigh(struct device *dev,
- struct in6_addr *addr);
extern void ndisc_cleanup(void);
extern int ndisc_rcv(struct sk_buff *skb,
@@ -134,9 +66,6 @@ extern int ndisc_rcv(struct sk_buff *skb,
struct ipv6_options *opt,
unsigned short len);
-extern void ndisc_event_send(struct neighbour *neigh,
- struct sk_buff *skb);
-
extern void ndisc_send_ns(struct device *dev,
struct neighbour *neigh,
struct in6_addr *solicit,
@@ -147,9 +76,6 @@ extern void ndisc_send_rs(struct device *dev,
struct in6_addr *saddr,
struct in6_addr *daddr);
-extern int ndisc_eth_resolv(unsigned char *,
- struct sk_buff *);
-
extern void ndisc_forwarding_on(void);
extern void ndisc_forwarding_off(void);
@@ -157,10 +83,10 @@ extern void ndisc_send_redirect(struct sk_buff *skb,
struct neighbour *neigh,
struct in6_addr *target);
-struct rt6_info * dflt_rt_lookup(void);
+extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct device *dev, int dir);
-extern unsigned long nd_rand_seed;
-extern unsigned long ipv6_random(void);
+
+struct rt6_info * dflt_rt_lookup(void);
/*
* IGMP
@@ -175,6 +101,22 @@ extern int igmp6_event_report(struct sk_buff *skb,
struct icmp6hdr *hdr,
int len);
+extern __inline__ struct neighbour * ndisc_get_neigh(struct device *dev, struct in6_addr *addr)
+{
+
+ if (dev) {
+ struct neighbour *neigh;
+
+ start_bh_atomic();
+ neigh = __neigh_lookup(&nd_tbl, addr, dev, 1);
+ end_bh_atomic();
+
+ return neigh;
+ }
+ return NULL;
+}
+
+
#endif /* __KERNEL__ */
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index ec2331522..76dd6f4fd 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -4,8 +4,41 @@
/*
* Generic neighbour manipulation
*
- * authors:
+ * Authors:
* Pedro Roque <roque@di.fc.ul.pt>
+ * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
+ */
+
+/* The following flags & states are exported to user space,
+ so that they should be moved to include/linux/ directory.
+ */
+
+/*
+ * Neighbor Cache Entry Flags
+ */
+
+#define NTF_PROXY 0x08 /* == ATF_PUBL */
+#define NTF_ROUTER 0x80
+
+/*
+ * Neighbor Cache Entry States.
+ */
+
+#define NUD_INCOMPLETE 0x01
+#define NUD_REACHABLE 0x02
+#define NUD_STALE 0x04
+#define NUD_DELAY 0x08
+#define NUD_PROBE 0x10
+#define NUD_FAILED 0x20
+
+/* Dummy states */
+#define NUD_NOARP 0x40
+#define NUD_PERMANENT 0x80
+#define NUD_NONE 0x00
+
+/* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change
+ and make no address resolution or NUD.
+ NUD_PERMANENT is also cannot be deleted by garbage collectors.
*/
#ifdef __KERNEL__
@@ -13,37 +46,158 @@
#include <asm/atomic.h>
#include <linux/skbuff.h>
-/*
- * flags
- *
- */
-#define NTF_COMPLETE 0x02
-#define NTF_PERMANENT 0x04
+#define NUD_IN_TIMER (NUD_INCOMPLETE|NUD_DELAY|NUD_PROBE)
+#define NUD_VALID (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE|NUD_PROBE|NUD_STALE|NUD_DELAY)
+#define NUD_CONNECTED (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE)
+
+struct neigh_parms
+{
+ struct neigh_parms *next;
+ int (*neigh_setup)(struct neighbour *);
+ struct neigh_table *tbl;
+ int entries;
+ void *priv;
+
+ void *sysctl_table;
+
+ int base_reachable_time;
+ int retrans_time;
+ int gc_staletime;
+ int reachable_time;
+ int delay_probe_time;
+
+ int queue_len;
+ int ucast_probes;
+ int app_probes;
+ int mcast_probes;
+ int anycast_delay;
+ int proxy_delay;
+ int proxy_qlen;
+ int locktime;
+};
+
+struct neigh_statistics
+{
+ unsigned long allocs;
+ unsigned long res_failed;
+ unsigned long rcv_probes_mcast;
+ unsigned long rcv_probes_ucast;
+};
-struct neighbour {
+struct neighbour
+{
struct neighbour *next;
- struct neighbour *prev;
struct neigh_table *tbl;
+ struct neigh_parms *parms;
struct device *dev;
- unsigned long lastused;
- unsigned long flags;
+ unsigned long used;
+ unsigned long confirmed;
+ unsigned long updated;
+ __u8 flags;
+ __u8 nud_state;
+ __u8 type;
+ __u8 probes;
unsigned char ha[MAX_ADDR_LEN];
struct hh_cache *hh;
atomic_t refcnt;
- struct neigh_ops *ops;
+ int (*output)(struct sk_buff *skb);
struct sk_buff_head arp_queue;
- char primary_key[0];
+ struct timer_list timer;
+ struct neigh_ops *ops;
+ u8 primary_key[0];
};
-struct neigh_ops {
+struct neigh_ops
+{
int family;
- unsigned int (*hash)(void *primary_key);
- int (*resolve)(unsigned char *h_dest,
- struct sk_buff *skb);
void (*destructor)(struct neighbour *);
+ void (*solicit)(struct neighbour *, struct sk_buff*);
+ void (*error_report)(struct neighbour *, struct sk_buff*);
+ int (*output)(struct sk_buff*);
+ int (*connected_output)(struct sk_buff*);
+ int (*hh_output)(struct sk_buff*);
+ int (*queue_xmit)(struct sk_buff*);
+};
+
+struct pneigh_entry
+{
+ struct pneigh_entry *next;
+ struct device *dev;
+ u8 key[0];
+};
+
+#define NEIGH_HASHMASK 0x1F
+#define PNEIGH_HASHMASK 0xF
+
+/*
+ * neighbour table manipulation
+ */
+
+
+struct neigh_table
+{
+ struct neigh_table *next;
+ int family;
+ int entry_size;
+ int key_len;
+ int (*constructor)(struct neighbour *);
+ int (*pconstructor)(struct pneigh_entry *);
+ void (*pdestructor)(struct pneigh_entry *);
+ void (*proxy_redo)(struct sk_buff *skb);
+ struct neigh_parms parms;
+ /* HACK. gc_* shoul follow parms without a gap! */
+ int gc_interval;
+ int gc_thresh1;
+ int gc_thresh2;
+ int gc_thresh3;
+ unsigned long last_flush;
+ struct timer_list gc_timer;
+ struct timer_list proxy_timer;
+ struct sk_buff_head proxy_queue;
+ int entries;
+ atomic_t lock;
+ unsigned long last_rand;
+ struct neigh_parms *parms_list;
+ struct neigh_statistics stats;
+ struct neighbour *hash_buckets[NEIGH_HASHMASK+1];
+ struct pneigh_entry *phash_buckets[PNEIGH_HASHMASK+1];
};
-extern struct neighbour *neigh_alloc(int size, struct neigh_ops *);
+extern void neigh_table_init(struct neigh_table *tbl);
+extern int neigh_table_clear(struct neigh_table *tbl);
+extern struct neighbour *__neigh_lookup(struct neigh_table *tbl,
+ const void *pkey, struct device *dev,
+ int creat);
+extern void neigh_destroy(struct neighbour *neigh);
+extern int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb);
+extern int neigh_update(struct neighbour *neigh, u8 *lladdr, u8 new, int override, int arp);
+extern int neigh_ifdown(struct neigh_table *tbl, struct device *dev);
+extern int neigh_resolve_output(struct sk_buff *skb);
+extern int neigh_connected_output(struct sk_buff *skb);
+extern int neigh_compat_output(struct sk_buff *skb);
+extern struct neighbour *neigh_event_ns(struct neigh_table *tbl,
+ u8 *lladdr, void *saddr,
+ struct device *dev);
+
+extern struct neigh_parms *neigh_parms_alloc(struct device *dev, struct neigh_table *tbl);
+extern void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms);
+extern unsigned long neigh_rand_reach_time(unsigned long base);
+
+extern void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p,
+ struct sk_buff *skb);
+extern struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, const void *key, struct device *dev, int creat);
+extern int pneigh_delete(struct neigh_table *tbl, const void *key, struct device *dev);
+
+struct netlink_callback;
+struct nlmsghdr;
+extern int neigh_dump_info(struct sk_buff *skb, struct netlink_callback *cb);
+extern int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
+extern int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
+extern void neigh_app_ns(struct neighbour *n);
+
+extern int neigh_sysctl_register(struct device *dev, struct neigh_parms *p,
+ int p_id, int pdev_id, char *p_name);
+extern void neigh_sysctl_unregister(struct neigh_parms *p);
/*
* Neighbour references
@@ -51,123 +205,67 @@ extern struct neighbour *neigh_alloc(int size, struct neigh_ops *);
* When neighbour pointers are passed to "client" code the
* reference count is increased. The count is 0 if the node
* is only referenced by the corresponding table.
- *
- * Nodes cannot be unlinked from the table if their
- * reference count != 0.
- *
- * i.e. you can't reclaim a neighbour if it is being used by a
- * dst_cache or routing entry - hopefully those will react
- * to memory shortage and GC their unused entries
*/
-
-static __inline__ void neigh_release(struct neighbour *neigh)
+extern __inline__ void neigh_release(struct neighbour *neigh)
{
- if (atomic_dec_and_test(&neigh->refcnt))
- neigh->lastused = jiffies;
+ if (atomic_dec_and_test(&neigh->refcnt) && neigh->tbl == NULL)
+ neigh_destroy(neigh);
}
-static __inline__ struct neighbour * neighbour_clone(struct neighbour *neigh)
+extern __inline__ struct neighbour * neigh_clone(struct neighbour *neigh)
{
if (neigh)
atomic_inc(&neigh->refcnt);
return neigh;
}
-#define NT_MASK_QUEUE 0x01
-#define NT_MASK_GC 0x02
-
-/*
- * neighbour table manipulation
- */
-
-struct neigh_table {
- int tbl_size; /* num. of hash buckets */
- int tbl_entries; /* entry count */
- struct neighbour **hash_buckets;
- atomic_t tbl_lock;
- unsigned int tbl_bh_mask; /* bh mask */
- struct neigh_ops *neigh_ops;
- struct neighbour *request_queue; /* pending inserts */
-};
-
-extern void neigh_table_init(struct neigh_table *tbl,
- struct neigh_ops *ops,
- int size);
-extern void neigh_table_destroy(struct neigh_table *tbl);
-
-extern void neigh_table_run_bh(struct neigh_table *tbl);
-
-extern void neigh_table_ins(struct neigh_table *tbl,
- struct neighbour *neigh);
-
-extern void neigh_queue_ins(struct neigh_table *tbl,
- struct neighbour *neigh);
-
-extern void neigh_unlink(struct neighbour *neigh);
-
-extern struct neighbour * neigh_lookup(struct neigh_table *tbl,
- void *pkey, int key_len,
- struct device *dev);
+extern __inline__ void neigh_confirm(struct neighbour *neigh)
+{
+ if (neigh)
+ neigh->confirmed = jiffies;
+}
-extern void neigh_destroy(struct neighbour *neigh);
-static __inline__ void neigh_insert(struct neigh_table *tbl,
- struct neighbour *neigh)
+extern __inline__ struct neighbour *
+neigh_lookup(struct neigh_table *tbl, const void *pkey, struct device *dev)
{
+ struct neighbour *neigh;
start_bh_atomic();
- if (atomic_read(&tbl->tbl_lock) == 1)
- {
- neigh_table_ins(tbl, neigh);
- }
- else
- {
- tbl->tbl_bh_mask |= NT_MASK_QUEUE;
- neigh_queue_ins(tbl, neigh);
- }
- end_bh_atomic();
+ neigh = __neigh_lookup(tbl, pkey, dev, 0);
+ end_bh_atomic();
+ return neigh;
}
+extern __inline__ int neigh_is_connected(struct neighbour *neigh)
+{
+ return neigh->nud_state&NUD_CONNECTED;
+}
+extern __inline__ int neigh_is_valid(struct neighbour *neigh)
+{
+ return neigh->nud_state&NUD_VALID;
+}
-typedef int (*ntbl_examine_t) (struct neighbour *neigh, void *arg);
-
-/*
- * examine every element of a neighbour table.
- * For every neighbour the callback function will be called.
- *
- * parameters:
- * max : max bucket index (<= tbl_size, 0 all)
- * filter : (neigh->flags & (~filter)) -> call func
- * args : opaque pointer
- *
- * return values
- * 0 nop
- * !0 unlink node from table and destroy it
- */
-
-extern void ntbl_walk_table(struct neigh_table *tbl,
- ntbl_examine_t func,
- unsigned long filter,
- int max, void *args);
-
-static __inline__ void neigh_table_lock(struct neigh_table *tbl)
+extern __inline__ int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
{
- atomic_inc(&tbl->tbl_lock);
+ neigh->used = jiffies;
+ if (!(neigh->nud_state&(NUD_CONNECTED|NUD_DELAY|NUD_PROBE)))
+ return __neigh_event_send(neigh, skb);
+ return 0;
}
-extern void neigh_tbl_run_bh(struct neigh_table *tbl);
+extern __inline__ void neigh_table_lock(struct neigh_table *tbl)
+{
+ atomic_inc(&tbl->lock);
+}
-static __inline__ void neigh_table_unlock(struct neigh_table *tbl)
+extern __inline__ void neigh_table_unlock(struct neigh_table *tbl)
{
- start_bh_atomic();
- if (atomic_dec_and_test(&tbl->tbl_lock) && tbl->tbl_bh_mask)
- {
- neigh_tbl_run_bh(tbl);
- }
- end_bh_atomic();
+ atomic_dec(&tbl->lock);
}
+
#endif
#endif
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index b83c1048b..5faad9ad4 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -15,6 +15,7 @@ struct Qdisc_ops
void (*destroy)(struct Qdisc *);
int (*init)(struct Qdisc *, void *arg);
int (*control)(struct Qdisc *, void *);
+ int (*requeue)(struct sk_buff *skb, struct Qdisc *);
};
struct Qdisc_head
@@ -34,7 +35,6 @@ struct Qdisc
struct Qdisc *parent;
struct sk_buff_head q;
struct device *dev;
- struct sk_buff_head failure_q;
unsigned long dropped;
unsigned long tx_last;
unsigned long tx_timeo;
@@ -109,7 +109,7 @@ typedef u64 psched_time_t;
#define PSCHED_US2JIFFIE(usecs) (((usecs)+(1000000/HZ-1))/(1000000/HZ))
#define PSCHED_TLESS(tv1, tv2) (((tv1).tv_usec < (tv2).tv_usec && \
- (tv1).tv_sec < (tv2).tv_sec) || \
+ (tv1).tv_sec <= (tv2).tv_sec) || \
(tv1).tv_sec < (tv2).tv_sec)
#define PSCHED_TADD2(tv, delta, tv_res) \
@@ -117,7 +117,7 @@ typedef u64 psched_time_t;
int __delta = (tv).tv_usec + (delta); \
(tv_res).tv_sec = (tv).tv_sec; \
if (__delta > 1000000) { (tv_res).tv_sec++; __delta -= 1000000; } \
- (tv_res).tv_sec = __delta; \
+ (tv_res).tv_usec = __delta; \
})
#define PSCHED_TADD(tv, delta) \
diff --git a/include/net/profile.h b/include/net/profile.h
new file mode 100644
index 000000000..82fad0a37
--- /dev/null
+++ b/include/net/profile.h
@@ -0,0 +1,311 @@
+#include <linux/config.h> /* for CONFIG_NET_PROFILE */
+#ifndef _NET_PROFILE_H_
+#define _NET_PROFILE_H_ 1
+
+#ifdef CONFIG_NET_PROFILE
+
+#include <linux/types.h>
+#include <linux/time.h>
+#include <linux/kernel.h>
+#include <asm/system.h>
+
+struct net_profile_slot
+{
+ char id[16];
+ struct net_profile_slot *next;
+ struct timeval entered;
+ struct timeval accumulator;
+ struct timeval irq;
+ int hits;
+ int active;
+ int underflow;
+};
+
+extern atomic_t net_profile_active;
+extern struct timeval net_profile_adjust;
+extern void net_profile_irq_adjust(struct timeval *entered, struct timeval* leaved);
+
+#if CPU == 586 || CPU == 686
+
+
+extern __inline__ void net_profile_stamp(struct timeval *pstamp)
+{
+ __asm__ __volatile__ (".byte 0x0f,0x31"
+ :"=a" (pstamp->tv_usec),
+ "=d" (pstamp->tv_sec));
+}
+
+extern __inline__ void net_profile_accumulate(struct timeval *entered,
+ struct timeval *leaved,
+ struct timeval *acc)
+{
+ __asm__ __volatile__ ("subl %2,%0\n\t"
+ "sbbl %3,%1\n\t"
+ "addl %4,%0\n\t"
+ "adcl %5,%1\n\t"
+ "subl " SYMBOL_NAME_STR(net_profile_adjust) "+4,%0\n\t"
+ "sbbl $0,%1\n\t"
+ : "=r" (acc->tv_usec), "=r" (acc->tv_sec)
+ : "g" (entered->tv_usec), "g" (entered->tv_sec),
+ "g" (leaved->tv_usec), "g" (leaved->tv_sec),
+ "0" (acc->tv_usec), "1" (acc->tv_sec));
+}
+
+extern __inline__ void net_profile_sub(struct timeval *sub,
+ struct timeval *acc)
+{
+ __asm__ __volatile__ ("subl %2,%0\n\t"
+ "sbbl %3,%1\n\t"
+ : "=r" (acc->tv_usec), "=r" (acc->tv_sec)
+ : "g" (sub->tv_usec), "g" (sub->tv_sec),
+ "0" (acc->tv_usec), "1" (acc->tv_sec));
+}
+
+extern __inline__ void net_profile_add(struct timeval *add,
+ struct timeval *acc)
+{
+ __asm__ __volatile__ ("addl %2,%0\n\t"
+ "adcl %3,%1\n\t"
+ : "=r" (acc->tv_usec), "=r" (acc->tv_sec)
+ : "g" (add->tv_usec), "g" (add->tv_sec),
+ "0" (acc->tv_usec), "1" (acc->tv_sec));
+}
+
+
+#elif defined (__alpha__)
+
+extern __u32 alpha_lo;
+extern long alpha_hi;
+
+/* On alpha cycle counter has only 32 bits :-( :-( */
+
+extern __inline__ void net_profile_stamp(struct timeval *pstamp)
+{
+ __u32 result;
+ __asm__ __volatile__ ("rpcc %0" : "r="(result));
+ if (result <= alpha_lo)
+ alpha_hi++;
+ alpha_lo = result;
+ pstamp->tv_sec = alpha_hi;
+ pstamp->tv_usec = alpha_lo;
+}
+
+extern __inline__ void net_profile_accumulate(struct timeval *entered,
+ struct timeval *leaved,
+ struct timeval *acc)
+{
+ time_t usecs = acc->tv_usec + leaved->tv_usec - entered->tv_usec
+ - net_profile_adjust.tv_usec;
+ time_t secs = acc->tv_sec + leaved->tv_sec - entered->tv_sec;
+
+ if (usecs >= 0x100000000L) {
+ usecs -= 0x100000000L;
+ secs++;
+ } else if (usecs < -0x100000000L) {
+ usecs += 0x200000000L;
+ secs -= 2;
+ } else if (usecs < 0) {
+ usecs += 0x100000000L;
+ secs--;
+ }
+ acc->tv_sec = secs;
+ acc->tv_usec = usecs;
+}
+
+extern __inline__ void net_profile_sub(struct timeval *entered,
+ struct timeval *leaved)
+{
+ time_t usecs = leaved->tv_usec - entered->tv_usec;
+ time_t secs = leaved->tv_sec - entered->tv_sec;
+
+ if (usecs < 0) {
+ usecs += 0x100000000L;
+ secs--;
+ }
+ leaved->tv_sec = secs;
+ leaved->tv_usec = usecs;
+}
+
+extern __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;
+
+ if (usecs >= 0x100000000L) {
+ usecs -= 0x100000000L;
+ secs++;
+ }
+ leaved->tv_sec = secs;
+ leaved->tv_usec = usecs;
+}
+
+
+#else
+
+extern __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
+ investigation :-) :-)
+ */
+ do_gettimeofday(pstamp);
+}
+
+extern __inline__ void net_profile_accumulate(struct timeval *entered,
+ struct timeval *leaved,
+ struct timeval *acc)
+{
+ time_t usecs = acc->tv_usec + leaved->tv_usec - entered->tv_usec
+ - net_profile_adjust.tv_usec;
+ time_t secs = acc->tv_sec + leaved->tv_sec - entered->tv_sec;
+
+ if (usecs >= 1000000) {
+ usecs -= 1000000;
+ secs++;
+ } else if (usecs < -1000000) {
+ usecs += 2000000;
+ secs -= 2;
+ } else if (usecs < 0) {
+ usecs += 1000000;
+ secs--;
+ }
+ acc->tv_sec = secs;
+ acc->tv_usec = usecs;
+}
+
+extern __inline__ void net_profile_sub(struct timeval *entered,
+ struct timeval *leaved)
+{
+ time_t usecs = leaved->tv_usec - entered->tv_usec;
+ time_t secs = leaved->tv_sec - entered->tv_sec;
+
+ if (usecs < 0) {
+ usecs += 1000000;
+ secs--;
+ }
+ leaved->tv_sec = secs;
+ leaved->tv_usec = usecs;
+}
+
+extern __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;
+
+ if (usecs >= 1000000) {
+ usecs -= 1000000;
+ secs++;
+ }
+ leaved->tv_sec = secs;
+ leaved->tv_usec = usecs;
+}
+
+
+
+#endif
+
+extern __inline__ void net_profile_enter(struct net_profile_slot *s)
+{
+ unsigned long flags;
+
+ save_flags(flags);
+ cli();
+ if (s->active++ == 0) {
+ net_profile_stamp(&s->entered);
+ atomic_inc(&net_profile_active);
+ }
+ restore_flags(flags);
+}
+
+extern __inline__ void net_profile_leave_irq(struct net_profile_slot *s)
+{
+ unsigned long flags;
+
+ save_flags(flags);
+ cli();
+ if (--s->active <= 0) {
+ if (s->active == 0) {
+ struct timeval curr_pstamp;
+ net_profile_stamp(&curr_pstamp);
+ net_profile_accumulate(&s->entered, &curr_pstamp, &s->accumulator);
+ if (!atomic_dec_and_test(&net_profile_active))
+ net_profile_irq_adjust(&s->entered, &curr_pstamp);
+ } else {
+ s->underflow++;
+ }
+ }
+ s->hits++;
+ restore_flags(flags);
+}
+
+extern __inline__ void net_profile_leave(struct net_profile_slot *s)
+{
+ unsigned long flags;
+ save_flags(flags);
+ cli();
+ if (--s->active <= 0) {
+ if (s->active == 0) {
+ struct timeval curr_pstamp;
+ net_profile_stamp(&curr_pstamp);
+ net_profile_accumulate(&s->entered, &curr_pstamp, &s->accumulator);
+ atomic_dec(&net_profile_active);
+ } else {
+ s->underflow++;
+ }
+ }
+ s->hits++;
+ restore_flags(flags);
+}
+
+
+#define NET_PROFILE_ENTER(slot) net_profile_enter(&net_prof_##slot)
+#define NET_PROFILE_LEAVE(slot) net_profile_leave(&net_prof_##slot)
+#define NET_PROFILE_LEAVE_IRQ(slot) net_profile_leave_irq(&net_prof_##slot)
+
+#define NET_PROFILE_SKB_CLEAR(skb) ({ \
+ skb->pstamp.tv_usec = 0; \
+})
+
+#define NET_PROFILE_SKB_INIT(skb) ({ \
+ net_profile_stamp(&skb->pstamp); \
+})
+
+#define NET_PROFILE_SKB_PASSED(skb, slot) ({ \
+ if (skb->pstamp.tv_usec) { \
+ struct timeval cur_pstamp = skb->pstamp; \
+ net_profile_stamp(&skb->pstamp); \
+ net_profile_accumulate(&cur_pstamp, &skb->pstamp, &net_prof_##slot.accumulator); \
+ net_prof_##slot.hits++; \
+ }})
+
+#define NET_PROFILE_DECL(slot) \
+ extern struct net_profile_slot net_prof_##slot;
+
+#define NET_PROFILE_DEFINE(slot) \
+ struct net_profile_slot net_prof_##slot = { #slot, };
+
+#define NET_PROFILE_REGISTER(slot) net_profile_register(&net_prof_##slot)
+#define NET_PROFILE_UNREGISTER(slot) net_profile_unregister(&net_prof_##slot)
+
+extern int net_profile_init(void);
+extern int net_profile_register(struct net_profile_slot *);
+extern int net_profile_unregister(struct net_profile_slot *);
+
+#else
+
+#define NET_PROFILE_ENTER(slot) do { /* nothing */ } while(0)
+#define NET_PROFILE_LEAVE(slot) do { /* nothing */ } while(0)
+#define NET_PROFILE_LEAVE_IRQ(slot) do { /* nothing */ } while(0)
+#define NET_PROFILE_SKB_CLEAR(skb) do { /* nothing */ } while(0)
+#define NET_PROFILE_SKB_INIT(skb) do { /* nothing */ } while(0)
+#define NET_PROFILE_SKB_PASSED(skb, slot) do { /* nothing */ } while(0)
+#define NET_PROFILE_DECL(slot)
+#define NET_PROFILE_DEFINE(slot)
+#define NET_PROFILE_REGISTER(slot) do { /* nothing */ } while(0)
+#define NET_PROFILE_UNREGISTER(slot) do { /* nothing */ } while(0)
+
+#endif
+
+#endif
diff --git a/include/net/route.h b/include/net/route.h
index 486508ce0..338e158fd 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -13,6 +13,7 @@
* Alan Cox : Reformatted. Added ip_rt_local()
* Alan Cox : Support for TCP parameters.
* Alexey Kuznetsov: Major changes for new routing code.
+ * Mike McLagan : Routing by source
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -28,25 +29,6 @@
#include <linux/rtnetlink.h>
#define RT_HASH_DIVISOR 256
-#define RT_CACHE_MAX_SIZE 256
-
-/*
- * Maximal time to live for unused entry.
- */
-#define RT_CACHE_TIMEOUT (HZ*300)
-
-/*
- * Cache invalidations can be delayed by:
- */
-#define RT_FLUSH_DELAY (5*HZ)
-
-#define RT_REDIRECT_NUMBER 9
-#define RT_REDIRECT_LOAD (HZ/50) /* 20 msec */
-#define RT_REDIRECT_SILENCE (RT_REDIRECT_LOAD<<(RT_REDIRECT_NUMBER+1))
-/* 20sec */
-
-#define RT_ERROR_LOAD (1*HZ)
-
/*
* Prevents LRU trashing, entries considered equivalent,
@@ -56,6 +38,15 @@
#include <linux/route.h>
+#define RTO_ONLINK 0x01
+#define RTO_TPROXY 0x80000000
+
+#ifdef CONFIG_IP_TRANSPARENT_PROXY
+#define RTO_CONN RTO_TPROXY
+#else
+#define RTO_CONN 0
+#endif
+
struct rt_key
{
__u32 dst;
@@ -94,20 +85,15 @@ struct rtable
__u32 rt_src_map;
__u32 rt_dst_map;
#endif
-
- /* ICMP statistics */
- unsigned long last_error;
- unsigned long errors;
};
#ifdef __KERNEL__
extern void ip_rt_init(void);
extern void ip_rt_redirect(u32 old_gw, u32 dst, u32 new_gw,
u32 src, u8 tos, struct device *dev);
-extern void ip_rt_check_expire(void);
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, u8 tos, int oif);
+extern int ip_route_output(struct rtable **, u32 dst, u32 src, u32 tos, int oif);
extern int ip_route_input(struct sk_buff*, u32 dst, u32 src, u8 tos, struct device *devin);
extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu);
extern void ip_rt_send_redirect(struct sk_buff *skb);
@@ -144,26 +130,6 @@ extern __inline__ int ip_route_connect(struct rtable **rp, u32 dst, u32 src, u32
return ip_route_output(rp, dst, src, tos, oif);
}
-extern __inline__ void ip_ll_header(struct sk_buff *skb)
-{
- struct rtable *rt = (struct rtable*)skb->dst;
- struct device *dev = rt->u.dst.dev;
- struct hh_cache *hh = rt->u.dst.hh;
- int hh_len = dev->hard_header_len;
-
- skb->dev = dev;
- skb->arp = 1;
- skb->protocol = htons(ETH_P_IP);
-
- if (hh) {
- memcpy(skb_push(skb, hh_len), hh->hh_data, hh_len);
- skb->arp = hh->hh_uptodate;
- } else if (dev->hard_header &&
- dev->hard_header(skb, dev, ETH_P_IP, NULL, NULL, 0)<0)
- skb->arp = 0;
-
- skb->mac.raw = skb->data;
-}
#endif
diff --git a/include/net/scm.h b/include/net/scm.h
index d8bb8d1eb..0c6a01542 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -17,6 +17,7 @@ struct scm_cookie
struct ucred creds; /* Skb credentials */
struct scm_fp_list *fp; /* Passed files */
unsigned long seq; /* Connection seqno */
+ struct file *file; /* file for socket */
struct socket *sock; /* Passed socket */
};
diff --git a/include/net/sock.h b/include/net/sock.h
index 8dd105485..c225a0015 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -77,6 +77,10 @@
#include <net/dn.h>
#endif
+#ifdef CONFIG_FILTER
+#include <linux/filter.h>
+#endif
+
#include <asm/atomic.h>
/*
@@ -144,10 +148,10 @@ struct ipv6_pinfo
struct in6_addr daddr;
__u32 flow_lbl;
+ int hop_limit;
+ int mcast_hops;
__u8 priority;
- __u8 hop_limit;
- __u8 mcast_hops;
/* sockopt flags */
@@ -164,14 +168,6 @@ struct ipv6_pinfo
struct device *oif;
struct ipv6_mc_socklist *ipv6_mc_list;
- /*
- * destination cache entry pointer
- * contains a pointer to neighbour cache
- * and other info related to network level
- * (ex. PMTU)
- */
-
- struct dst_entry *dst;
__u32 dst_cookie;
struct ipv6_options *opt;
@@ -452,10 +448,12 @@ struct sock
unsigned char localroute; /* Route locally only */
struct ucred peercred;
- /* What the user has tried to set with the security API */
- short authentication;
- short encryption;
- short encrypt_net;
+#ifdef CONFIG_FILTER
+ /* Socket Filtering Instructions */
+ int filter;
+ struct sock_filter *filter_data;
+#endif /* CONFIG_FILTER */
+
/*
* This is where all the private (optional) areas that don't
* overlap will eventually live.
@@ -574,7 +572,7 @@ struct proto
void (*write_wakeup)(struct sock *sk);
void (*read_wakeup)(struct sock *sk);
- unsigned int (*poll)(struct socket *sock,
+ unsigned int (*poll)(struct file * file, struct socket *sock,
struct poll_table_struct *wait);
int (*ioctl)(struct sock *sk, int cmd,
@@ -779,6 +777,9 @@ extern struct sk_buff *sock_alloc_send_skb(struct sock *sk,
unsigned long fallback,
int noblock,
int *errcode);
+extern void *sock_kmalloc(struct sock *sk, int size, int priority);
+extern void sock_kfree_s(struct sock *sk, void *mem, int size);
+
/*
* Functions to fill in entries in struct proto_ops when a protocol
@@ -797,7 +798,7 @@ extern int sock_no_accept(struct socket *,
struct socket *, int);
extern int sock_no_getname(struct socket *,
struct sockaddr *, int *, int);
-extern unsigned int sock_no_poll(struct socket *,
+extern unsigned int sock_no_poll(struct file *, struct socket *,
struct poll_table_struct *);
extern int sock_no_ioctl(struct socket *, unsigned int,
unsigned long);
@@ -832,6 +833,26 @@ extern void sklist_remove_socket(struct sock **list, struct sock *sk);
extern void sklist_insert_socket(struct sock **list, struct sock *sk);
extern void sklist_destroy_socket(struct sock **list, struct sock *sk);
+#ifdef CONFIG_FILTER
+/*
+ * Run the filter code and then cut skb->data to correct size returned by
+ * sk_run_filter. If pkt_len is 0 we toss packet. If skb->len is smaller
+ * than pkt_len we keep whole skb->data.
+ */
+extern __inline__ int sk_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
+{
+ int pkt_len;
+
+ pkt_len = sk_run_filter(skb->data, skb->len, filter, flen);
+ if(!pkt_len)
+ return 1; /* Toss Packet */
+ else
+ skb_trim(skb, pkt_len);
+
+ return 0;
+}
+#endif /* CONFIG_FILTER */
+
/*
* Queue a received datagram if it will fit. Stream and sequenced
* protocols can't normally use this as they need to fit buffers in
@@ -858,9 +879,21 @@ extern __inline__ void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
extern __inline__ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
{
- if (atomic_read(&sk->rmem_alloc) + skb->truesize >= sk->rcvbuf)
- return -ENOMEM;
- skb_set_owner_r(skb, sk);
+ /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
+ number of warnings when compiling with -W --ANK
+ */
+ if (atomic_read(&sk->rmem_alloc) + skb->truesize >= (unsigned)sk->rcvbuf)
+ return -ENOMEM;
+ skb_set_owner_r(skb, sk);
+
+#ifdef CONFIG_FILTER
+ if (sk->filter)
+ {
+ if (sk_filter(skb, sk->filter_data, sk->filter))
+ return -EPERM; /* Toss packet */
+ }
+#endif /* CONFIG_FILTER */
+
skb_queue_tail(&sk->receive_queue,skb);
if (!sk->dead)
sk->data_ready(sk,skb->len);
@@ -869,7 +902,10 @@ extern __inline__ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
extern __inline__ int __sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
{
- if (atomic_read(&sk->rmem_alloc) + skb->truesize >= sk->rcvbuf)
+ /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
+ number of warnings when compiling with -W --ANK
+ */
+ if (atomic_read(&sk->rmem_alloc) + skb->truesize >= (unsigned)sk->rcvbuf)
return -ENOMEM;
skb_set_owner_r(skb, sk);
__skb_queue_tail(&sk->receive_queue,skb);
@@ -880,7 +916,10 @@ extern __inline__ int __sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
extern __inline__ int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
{
- if (atomic_read(&sk->rmem_alloc) + skb->truesize >= sk->rcvbuf)
+ /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
+ number of warnings when compiling with -W --ANK
+ */
+ if (atomic_read(&sk->rmem_alloc) + skb->truesize >= (unsigned)sk->rcvbuf)
return -ENOMEM;
skb_set_owner_r(skb, sk);
__skb_queue_tail(&sk->error_queue,skb);
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 39c1b1f70..4c445ca1a 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -54,7 +54,7 @@ extern int sysctl_tcp_sack;
extern int sysctl_tcp_timestamps;
extern int sysctl_tcp_window_scaling;
-/* These are AF independant. */
+/* These are AF independent. */
static __inline__ int tcp_bhashfn(__u16 lport)
{
return (lport ^ (lport >> 7)) & (TCP_BHTABLE_SIZE - 1);
@@ -65,7 +65,7 @@ static __inline__ int tcp_bhashfn(__u16 lport)
* break TCP port selection. This function must also NOT wrap around
* when the next number exceeds the largest possible port (2^16-1).
*/
-static __inline__ int tcp_bhashnext(__u16 short lport, __u16 h)
+static __inline__ int tcp_bhashnext(__u16 lport, __u16 h)
{
__u32 s; /* don't change this to a smaller type! */
@@ -132,6 +132,7 @@ static __inline__ void tcp_sk_unbindify(struct sock *sk)
#define BASE_ACK_SIZE (NETHDR_SIZE + MAX_HEADER + 15)
#define MAX_ACK_SIZE (NETHDR_SIZE + sizeof(struct tcphdr) + MAX_HEADER + 15)
#define MAX_RESET_SIZE (NETHDR_SIZE + sizeof(struct tcphdr) + MAX_HEADER + 15)
+#define MAX_TCPHEADER_SIZE (NETHDR_SIZE + sizeof(struct tcphdr) + 20 + MAX_HEADER + 15)
#define MAX_WINDOW 32767 /* Never offer a window over 32767 without using
window scaling (not yet supported). Some poor
@@ -274,6 +275,9 @@ struct open_request {
struct tcp_v6_open_req v6_req;
#endif
} af;
+#ifdef CONFIG_IP_TRANSPARENT_PROXY
+ __u16 lcl_port; /* LVE */
+#endif
};
/* SLAB cache for open requests. */
@@ -389,7 +393,7 @@ extern int tcp_rcv_established(struct sock *sk,
extern void tcp_close(struct sock *sk,
unsigned long timeout);
extern struct sock * tcp_accept(struct sock *sk, int flags);
-extern unsigned int tcp_poll(struct socket *sock, struct poll_table_struct *wait);
+extern unsigned int tcp_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait);
extern int tcp_getsockopt(struct sock *sk, int level,
int optname, char *optval,
int *optlen);
@@ -435,7 +439,6 @@ extern int tcp_v4_connect(struct sock *sk,
struct sockaddr *uaddr,
int addr_len);
-
/* From syncookies.c */
extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
struct ip_options *opt);
@@ -455,7 +458,7 @@ extern void tcp_send_partial(struct sock *);
extern void tcp_write_wakeup(struct sock *);
extern void tcp_send_fin(struct sock *sk);
extern int tcp_send_synack(struct sock *);
-extern int tcp_send_skb(struct sock *, struct sk_buff *);
+extern void tcp_send_skb(struct sock *, struct sk_buff *);
extern void tcp_send_ack(struct sock *sk);
extern void tcp_send_delayed_ack(struct sock *sk, int max_timeout);
@@ -587,6 +590,57 @@ static __inline__ void tcp_set_state(struct sock *sk, int state)
}
}
+static __inline__ void tcp_build_options(__u32 *ptr, struct tcp_opt *tp)
+{
+ /* FIXME: We will still need to do SACK here. */
+ if (tp->tstamp_ok) {
+ *ptr = ntohl((TCPOPT_NOP << 24)
+ | (TCPOPT_NOP << 16)
+ | (TCPOPT_TIMESTAMP << 8)
+ | TCPOLEN_TIMESTAMP);
+ /* rest filled in by tcp_update_options */
+ }
+}
+
+static __inline__ void tcp_update_options(__u32 *ptr, struct tcp_opt *tp)
+{
+ /* FIXME: We will still need to do SACK here. */
+ if (tp->tstamp_ok) {
+ *++ptr = htonl(jiffies);
+ *++ptr = htonl(tp->ts_recent);
+ }
+}
+
+/*
+ * This routines builds a generic TCP header.
+ * They also build the RFC1323 Timestamp, but don't fill the
+ * actual timestamp in (you need to call tcp_update_options for this).
+ * It can't (unfortunately) do SACK as well.
+ * XXX: pass tp instead of sk here.
+ */
+
+static inline void tcp_build_header_data(struct tcphdr *th, struct sock *sk, int push)
+{
+ struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp);
+
+ memcpy(th,(void *) &(sk->dummy_th), sizeof(*th));
+ th->seq = htonl(sk->write_seq);
+ if (!push)
+ th->psh = 1;
+ tcp_build_options((__u32*)(th+1), tp);
+}
+
+static inline void tcp_build_header(struct tcphdr *th, struct sock *sk)
+{
+ struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp);
+
+ memcpy(th,(void *) &(sk->dummy_th), sizeof(*th));
+ th->seq = htonl(sk->write_seq);
+ th->ack_seq = htonl(tp->last_ack_sent = tp->rcv_nxt);
+ th->window = htons(tcp_select_window(sk));
+ tcp_build_options((__u32 *)(th+1), tp);
+}
+
/*
* Construct a tcp options header for a SYN or SYN_ACK packet.
* If this is every changed make sure to change the definition of