From b23aa05e7b7811c1ae5e28736fb0821854b9454d Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:34:48 -0500 Subject: [PATCH] Import 2.3.99pre9-1 --- Documentation/DocBook/Makefile | 1 + Documentation/DocBook/kernel-api.tmpl | 5 + Documentation/pci.txt | 7 + Makefile | 2 +- arch/i386/kernel/acpi.c | 4 +- arch/i386/kernel/apic.c | 5 - arch/i386/kernel/i8259.c | 2 +- arch/i386/kernel/io_apic.c | 32 +- arch/i386/kernel/irq.c | 8 +- arch/i386/kernel/mpparse.c | 15 +- arch/i386/kernel/pci-irq.c | 3 +- arch/i386/kernel/setup.c | 58 +- arch/i386/kernel/traps.c | 2 +- arch/i386/mm/init.c | 54 +- arch/mips/Makefile | 2 + arch/mips/arc/Makefile | 2 +- arch/mips/arc/cmdline.c | 2 +- arch/mips/arc/env.c | 6 +- arch/mips/arc/file.c | 2 +- arch/mips/arc/identify.c | 2 +- arch/mips/arc/init.c | 4 +- arch/mips/arc/memory.c | 7 +- arch/mips/arc/misc.c | 2 +- arch/mips/arc/salone.c | 2 +- arch/mips/arc/time.c | 2 +- arch/mips/arc/tree.c | 2 +- arch/mips/baget/Makefile | 24 +- arch/mips/baget/baget.c | 8 +- arch/mips/baget/bagetIRQ.S | 2 +- arch/mips/baget/balo.c | 2 +- arch/mips/baget/irq.c | 3 +- arch/mips/baget/print.c | 2 +- arch/mips/baget/prom/Makefile | 2 +- arch/mips/baget/time.c | 2 +- arch/mips/baget/vacserial.c | 2 +- arch/mips/boot/Makefile | 2 +- arch/mips/config.in | 350 ++++--- arch/mips/ddb5074/Makefile | 4 +- arch/mips/ddb5074/int-handler.S | 4 +- arch/mips/ddb5074/irq.c | 4 +- arch/mips/ddb5074/nile4.c | 4 +- arch/mips/ddb5074/pci-dma.c | 38 + arch/mips/ddb5074/pci.c | 285 +++--- arch/mips/ddb5074/prom.c | 4 +- arch/mips/ddb5074/setup.c | 17 +- arch/mips/ddb5074/time.c | 4 +- arch/mips/dec/irq.c | 2 + arch/mips/dec/prom/Makefile | 2 +- arch/mips/dec/prom/init.c | 2 +- arch/mips/dec/prom/memory.c | 2 +- arch/mips/dec/reset.c | 2 +- arch/mips/dec/rtc-dec.c | 2 +- arch/mips/dec/serial.c | 18 +- arch/mips/defconfig | 204 ++-- arch/mips/defconfig-decstation | 141 ++- arch/mips/defconfig-ip22 | 169 ++-- arch/mips/jazz/Makefile | 2 +- arch/mips/jazz/floppy-jazz.c | 2 +- arch/mips/jazz/int-handler.S | 2 +- arch/mips/jazz/kbd-jazz.c | 2 +- arch/mips/jazz/reset.c | 2 +- arch/mips/jazz/rtc-jazz.c | 2 +- arch/mips/jazz/setup.c | 2 +- arch/mips/kernel/Makefile | 2 +- arch/mips/kernel/entry.S | 2 +- arch/mips/kernel/fpe.c | 2 +- arch/mips/kernel/gdb-low.S | 2 +- arch/mips/kernel/gdb-stub.c | 2 +- arch/mips/kernel/head.S | 175 +--- arch/mips/kernel/irix5sys.h | 2 +- arch/mips/kernel/irixelf.c | 38 +- arch/mips/kernel/irixinv.c | 2 +- arch/mips/kernel/irixioctl.c | 2 +- arch/mips/kernel/irixsig.c | 2 +- arch/mips/kernel/irq.c | 18 + arch/mips/kernel/mips_ksyms.c | 10 +- arch/mips/kernel/proc.c | 11 +- arch/mips/kernel/process.c | 6 +- arch/mips/kernel/ptrace.c | 108 +- arch/mips/kernel/r2300_fpu.S | 2 +- arch/mips/kernel/r2300_switch.S | 2 +- arch/mips/kernel/r4k_fpu.S | 3 +- arch/mips/kernel/r4k_misc.S | 2 +- arch/mips/kernel/r4k_switch.S | 2 +- arch/mips/kernel/r6000_fpu.S | 2 +- arch/mips/kernel/scall_o32.S | 2 +- arch/mips/kernel/setup.c | 149 ++- arch/mips/kernel/signal.c | 2 +- arch/mips/kernel/softfp.S | 2 +- arch/mips/kernel/syscall.c | 2 - arch/mips/kernel/syscalls.h | 4 +- arch/mips/kernel/sysirix.c | 8 +- arch/mips/kernel/sysmips.c | 9 +- arch/mips/kernel/traps.c | 59 +- arch/mips/kernel/unaligned.c | 3 +- arch/mips/lib/Makefile | 2 +- arch/mips/lib/csum_partial.S | 2 +- arch/mips/lib/csum_partial_copy.c | 2 +- arch/mips/lib/floppy-no.c | 2 +- arch/mips/lib/floppy-std.c | 2 +- arch/mips/lib/ide-no.c | 2 +- arch/mips/lib/ide-std.c | 2 +- arch/mips/lib/kbd-no.c | 2 +- arch/mips/lib/kbd-std.c | 2 +- arch/mips/lib/memcpy.S | 2 +- arch/mips/lib/memset.S | 2 +- arch/mips/lib/r3k_dump_tlb.c | 2 +- arch/mips/lib/rtc-no.c | 2 +- arch/mips/lib/rtc-std.c | 2 +- arch/mips/lib/strlen_user.S | 2 +- arch/mips/lib/strncpy_user.S | 2 +- arch/mips/lib/strnlen_user.S | 2 +- arch/mips/lib/watch.S | 2 +- arch/mips/mm/andes.c | 2 +- arch/mips/mm/fault.c | 19 +- arch/mips/mm/init.c | 2 +- arch/mips/mm/loadmmu.c | 4 +- arch/mips/mm/r2300.c | 9 +- arch/mips/mm/r4xx0.c | 2 +- arch/mips/sgi/kernel/Makefile | 2 +- arch/mips/sgi/kernel/indyIRQ.S | 2 +- arch/mips/sgi/kernel/indy_hpc.c | 1 + arch/mips/sgi/kernel/indy_int.c | 20 +- arch/mips/sgi/kernel/indy_mc.c | 2 +- arch/mips/sgi/kernel/indy_rtc.c | 2 +- arch/mips/sgi/kernel/indy_sc.c | 44 +- arch/mips/sgi/kernel/indy_timer.c | 2 +- arch/mips/sgi/kernel/promcon.c | 3 +- arch/mips/sgi/kernel/reset.c | 2 +- arch/mips/sgi/kernel/setup.c | 14 +- arch/mips/sgi/kernel/system.c | 2 +- arch/mips/sgi/kernel/time.c | 2 +- arch/mips/sni/Makefile | 2 +- arch/mips/sni/dma.c | 2 +- arch/mips/sni/int-handler.S | 2 +- arch/mips/sni/io.c | 2 +- arch/mips/sni/pci.c | 2 +- arch/mips/sni/pcimt_scache.c | 2 +- arch/mips/sni/setup.c | 2 +- arch/mips/tools/Makefile | 2 +- arch/mips/tools/offset.c | 2 +- arch/mips64/Makefile | 2 +- arch/mips64/arc/Makefile | 2 +- arch/mips64/arc/cmdline.c | 2 +- arch/mips64/arc/console.c | 2 +- arch/mips64/arc/env.c | 2 +- arch/mips64/arc/file.c | 2 +- arch/mips64/arc/identify.c | 2 +- arch/mips64/arc/misc.c | 2 +- arch/mips64/arc/printf.c | 2 +- arch/mips64/arc/salone.c | 2 +- arch/mips64/arc/time.c | 2 +- arch/mips64/arc/tree.c | 2 +- arch/mips64/boot/Makefile | 2 +- arch/mips64/config.in | 29 +- arch/mips64/defconfig | 53 +- arch/mips64/defconfig-ip22 | 71 +- arch/mips64/defconfig-ip27 | 93 +- arch/mips64/kernel/Makefile | 6 +- arch/mips64/kernel/binfmt_elf32.c | 2 +- arch/mips64/kernel/branch.c | 2 +- arch/mips64/kernel/entry.S | 8 +- arch/mips64/kernel/head.S | 51 +- arch/mips64/kernel/ioctl32.c | 529 ++++++++++ arch/mips64/kernel/linux32.c | 1317 ++++++++++++++++++++++++- arch/mips64/kernel/mips64_ksyms.c | 12 +- arch/mips64/kernel/proc.c | 7 + arch/mips64/kernel/process.c | 15 +- arch/mips64/kernel/ptrace.c | 548 ++++++++++ arch/mips64/kernel/r4k_cache.S | 2 +- arch/mips64/kernel/r4k_fpu.S | 2 +- arch/mips64/kernel/r4k_genex.S | 10 +- arch/mips64/kernel/r4k_switch.S | 12 +- arch/mips64/kernel/r4k_tlb_debug.c | 2 +- arch/mips64/kernel/r4k_tlb_glue.S | 32 +- arch/mips64/kernel/scall_64.S | 14 +- arch/mips64/kernel/scall_o32.S | 85 +- arch/mips64/kernel/setup.c | 12 +- arch/mips64/kernel/signal.c | 59 +- arch/mips64/kernel/signal32.c | 100 +- arch/mips64/kernel/smp.c | 258 +++++ arch/mips64/kernel/softfp.S | 77 +- arch/mips64/kernel/syscall.c | 9 +- arch/mips64/kernel/traps.c | 22 +- arch/mips64/kernel/unaligned.c | 2 +- arch/mips64/lib/Makefile | 2 +- arch/mips64/lib/csum_partial.S | 2 +- arch/mips64/lib/csum_partial_copy.c | 2 +- arch/mips64/lib/floppy-no.c | 2 +- arch/mips64/lib/floppy-std.c | 2 +- arch/mips64/lib/ide-no.c | 2 +- arch/mips64/lib/ide-std.c | 2 +- arch/mips64/lib/kbd-no.c | 2 +- arch/mips64/lib/kbd-std.c | 2 +- arch/mips64/lib/memcpy.S | 2 +- arch/mips64/lib/memset.S | 2 +- arch/mips64/lib/rtc-no.c | 2 +- arch/mips64/lib/rtc-std.c | 2 +- arch/mips64/lib/strlen_user.S | 2 +- arch/mips64/lib/strncpy_user.S | 2 +- arch/mips64/lib/strnlen_user.S | 2 +- arch/mips64/lib/watch.S | 2 +- arch/mips64/mm/Makefile | 2 +- arch/mips64/mm/andes.c | 53 +- arch/mips64/mm/extable.c | 2 +- arch/mips64/mm/fault.c | 52 +- arch/mips64/mm/init.c | 8 +- arch/mips64/mm/loadmmu.c | 2 +- arch/mips64/mm/r4xx0.c | 143 +-- arch/mips64/mm/umap.c | 2 +- arch/mips64/sgi-ip22/Makefile | 2 +- arch/mips64/sgi-ip22/ip22-berr.c | 2 +- arch/mips64/sgi-ip22/ip22-hpc.c | 2 +- arch/mips64/sgi-ip22/ip22-int.c | 36 +- arch/mips64/sgi-ip22/ip22-irq.S | 2 +- arch/mips64/sgi-ip22/ip22-mc.c | 2 +- arch/mips64/sgi-ip22/ip22-reset.c | 2 +- arch/mips64/sgi-ip22/ip22-rtc.c | 2 +- arch/mips64/sgi-ip22/ip22-sc.c | 15 +- arch/mips64/sgi-ip22/ip22-setup.c | 2 +- arch/mips64/sgi-ip22/ip22-timer.c | 4 +- arch/mips64/sgi-ip22/system.c | 2 +- arch/mips64/sgi-ip22/time.c | 2 +- arch/mips64/sgi-ip27/Makefile | 4 +- arch/mips64/sgi-ip27/TODO | 14 +- arch/mips64/sgi-ip27/ip27-berr.c | 2 +- arch/mips64/sgi-ip27/ip27-init.c | 363 ++++++- arch/mips64/sgi-ip27/ip27-irq-glue.S | 2 +- arch/mips64/sgi-ip27/ip27-irq.c | 599 +++++++++-- arch/mips64/sgi-ip27/ip27-klconfig.c | 112 ++- arch/mips64/sgi-ip27/ip27-memory.c | 40 +- arch/mips64/sgi-ip27/ip27-nmi.c | 165 ++++ arch/mips64/sgi-ip27/ip27-pci-dma.c | 2 +- arch/mips64/sgi-ip27/ip27-pci.c | 170 +++- arch/mips64/sgi-ip27/ip27-reset.c | 23 +- arch/mips64/sgi-ip27/ip27-setup.c | 141 ++- arch/mips64/sgi-ip27/ip27-timer.c | 84 +- arch/mips64/tools/Makefile | 2 +- arch/mips64/tools/offset.c | 1 + drivers/atm/eni.c | 2 +- drivers/block/DAC960.c | 262 +++-- drivers/block/DAC960.h | 183 +++- drivers/char/epca.c | 5 +- drivers/net/3c59x.c | 2 +- drivers/net/8139too.c | 2 +- drivers/net/Config.in | 2 +- drivers/net/arcnet/arc-rimi.c | 5 +- drivers/net/arcnet/com20020-isa.c | 5 +- drivers/net/arcnet/com20020-pci.c | 4 +- drivers/net/arcnet/com90io.c | 5 +- drivers/net/arcnet/com90xx.c | 5 +- drivers/net/bagetlance.c | 2 +- drivers/net/declance.c | 207 ++-- drivers/net/eepro100.c | 2 +- drivers/net/epic100.c | 2 +- drivers/net/ioc3-eth.c | 35 +- drivers/net/ne2k-pci.c | 2 +- drivers/net/pcnet32.c | 4 +- drivers/net/sgiseeq.c | 11 +- drivers/net/sgiseeq.h | 2 +- drivers/net/sis900.c | 5 +- drivers/net/starfire.c | 2 +- drivers/net/tulip/tulip_core.c | 2 +- drivers/net/via-rhine.c | 2 +- drivers/net/wan/lmc/lmc_main.c | 2 +- drivers/net/yellowfin.c | 2 +- drivers/parport/parport_pc.c | 2 +- drivers/sound/emu10k1/main.c | 2 +- drivers/sound/es1370.c | 2 +- drivers/sound/es1371.c | 2 +- drivers/sound/esssolo1.c | 2 +- drivers/sound/i810_audio.c | 2 +- drivers/sound/sb_card.c | 15 +- drivers/sound/sonicvibes.c | 2 +- drivers/sound/trident.c | 2 +- drivers/sound/via82cxxx_audio.c | 4 +- drivers/tc/tc.c | 5 +- drivers/tc/tcsyms.c | 9 +- drivers/tc/zs.c | 24 +- drivers/tc/zs.h | 4 +- drivers/video/newport_con.c | 45 +- drivers/video/riva/fbdev.c | 2 +- fs/devfs/base.c | 798 ++++++++------- fs/devfs/util.c | 73 +- include/asm-i386/apicdef.h | 3 +- include/asm-i386/hw_irq.h | 36 +- include/asm-mips/arc/types.h | 72 ++ include/asm-mips/asmmacro.h | 2 +- include/asm-mips/atomic.h | 6 +- include/asm-mips/baget/baget.h | 2 +- include/asm-mips/baget/vac.h | 2 +- include/asm-mips/baget/vic.h | 2 +- include/asm-mips/bcache.h | 2 +- include/asm-mips/bitops.h | 4 +- include/asm-mips/bootinfo.h | 13 +- include/asm-mips/branch.h | 2 +- include/asm-mips/bugs.h | 7 +- include/asm-mips/byteorder.h | 2 +- include/asm-mips/cache.h | 6 +- include/asm-mips/checksum.h | 2 +- include/asm-mips/cpu.h | 2 +- include/asm-mips/current.h | 2 +- include/asm-mips/ddb5074.h | 2 +- include/asm-mips/delay.h | 4 +- include/asm-mips/div64.h | 2 +- include/asm-mips/dma.h | 2 +- include/asm-mips/ds1286.h | 2 +- include/asm-mips/elf.h | 2 +- include/asm-mips/fcntl.h | 2 +- include/asm-mips/floppy.h | 2 +- include/asm-mips/fp.h | 2 +- include/asm-mips/gdb-stub.h | 2 +- include/asm-mips/gfx.h | 2 +- include/asm-mips/hardirq.h | 33 +- include/asm-mips/hdreg.h | 2 +- include/asm-mips/highmem.h | 2 +- include/asm-mips/hw_irq.h | 5 + include/asm-mips/ide.h | 4 + include/asm-mips/inventory.h | 2 +- include/asm-mips/ioctls.h | 2 +- include/asm-mips/irq.h | 2 +- include/asm-mips/isadep.h | 2 +- include/asm-mips/jazz.h | 2 +- include/asm-mips/jazzdma.h | 2 +- include/asm-mips/linux_logo.h | 2 +- include/asm-mips/mc146818rtc.h | 2 +- include/asm-mips/mipsregs.h | 3 + include/asm-mips/mman.h | 6 + include/asm-mips/mmu_context.h | 2 +- include/asm-mips/namei.h | 2 +- include/asm-mips/ng1.h | 2 +- include/asm-mips/ng1hw.h | 2 +- include/asm-mips/nile4.h | 4 +- include/asm-mips/offset.h | 4 +- include/asm-mips/paccess.h | 98 ++ include/asm-mips/parport.h | 8 +- include/asm-mips/pci.h | 9 +- include/asm-mips/pgalloc.h | 4 +- include/asm-mips/pgtable.h | 3 +- include/asm-mips/posix_types.h | 2 +- include/asm-mips/prctl.h | 2 +- include/asm-mips/processor.h | 6 +- include/asm-mips/ptrace.h | 2 +- include/asm-mips/r4kcache.h | 2 +- include/asm-mips/resource.h | 2 +- include/asm-mips/semaphore-helper.h | 3 +- include/asm-mips/semaphore.h | 4 +- include/asm-mips/serial.h | 4 + include/asm-mips/sgi/sgi.h | 2 +- include/asm-mips/sgi/sgihpc.h | 8 +- include/asm-mips/sgi/sgimc.h | 184 ++-- include/asm-mips/sgi/sgint23.h | 24 +- include/asm-mips/sgialib.h | 17 +- include/asm-mips/sgiarcs.h | 11 +- include/asm-mips/shmparam.h | 2 +- include/asm-mips/sigcontext.h | 13 +- include/asm-mips/siginfo.h | 2 +- include/asm-mips/signal.h | 2 +- include/asm-mips/sni.h | 2 +- include/asm-mips/socket.h | 12 +- include/asm-mips/softirq.h | 8 +- include/asm-mips/spinlock.h | 2 +- include/asm-mips/stackframe.h | 2 +- include/asm-mips/string.h | 12 +- include/asm-mips/system.h | 2 +- include/asm-mips/termios.h | 2 +- include/asm-mips/timex.h | 4 +- include/asm-mips/types.h | 2 +- include/asm-mips/uaccess.h | 2 +- include/asm-mips/ucontext.h | 2 +- include/asm-mips/unaligned.h | 2 +- include/asm-mips/unistd.h | 6 +- include/asm-mips/watch.h | 2 +- include/asm-mips/wbflush.h | 2 +- include/asm-mips64/a.out.h | 2 +- include/asm-mips64/addrspace.h | 7 +- include/asm-mips64/arc/hinv.h | 2 +- include/asm-mips64/asm.h | 2 +- include/asm-mips64/asmmacro.h | 2 +- include/asm-mips64/atomic.h | 3 +- include/asm-mips64/bcache.h | 2 +- include/asm-mips64/bitops.h | 10 +- include/asm-mips64/bootinfo.h | 2 +- include/asm-mips64/branch.h | 2 +- include/asm-mips64/bugs.h | 2 +- include/asm-mips64/byteorder.h | 2 +- include/asm-mips64/cache.h | 3 +- include/asm-mips64/checksum.h | 2 - include/asm-mips64/cpu.h | 2 +- include/asm-mips64/current.h | 19 +- include/asm-mips64/delay.h | 4 +- include/asm-mips64/div64.h | 2 +- include/asm-mips64/dma.h | 10 +- include/asm-mips64/ds1286.h | 2 +- include/asm-mips64/elf.h | 2 +- include/asm-mips64/errno.h | 2 +- include/asm-mips64/fcntl.h | 2 +- include/asm-mips64/floppy.h | 2 +- include/asm-mips64/gfx.h | 2 +- include/asm-mips64/hardirq.h | 80 +- include/asm-mips64/hdreg.h | 2 +- include/asm-mips64/highmem.h | 2 +- include/asm-mips64/hw_irq.h | 5 + include/asm-mips64/ide.h | 4 + include/asm-mips64/init.h | 2 +- include/asm-mips64/inst.h | 2 +- include/asm-mips64/io.h | 52 +- include/asm-mips64/ioc3.h | 2 +- include/asm-mips64/ioctl.h | 2 +- include/asm-mips64/ioctls.h | 2 +- include/asm-mips64/irq.h | 2 +- include/asm-mips64/linux_logo.h | 2 +- include/asm-mips64/mc146818rtc.h | 2 +- include/asm-mips64/mipsregs.h | 3 +- include/asm-mips64/mman.h | 6 + include/asm-mips64/mmu_context.h | 56 +- include/asm-mips64/mmzone.h | 30 +- include/asm-mips64/namei.h | 2 +- include/asm-mips64/ng1.h | 2 +- include/asm-mips64/offset.h | 3 +- include/asm-mips64/paccess.h | 2 +- include/asm-mips64/param.h | 2 +- include/asm-mips64/parport.h | 8 +- include/asm-mips64/pci/bridge.h | 9 +- include/asm-mips64/pgalloc.h | 22 +- include/asm-mips64/pgtable.h | 20 +- include/asm-mips64/poll.h | 2 +- include/asm-mips64/posix_types.h | 22 +- include/asm-mips64/processor.h | 52 +- include/asm-mips64/ptrace.h | 2 +- include/asm-mips64/r10kcache.h | 2 +- include/asm-mips64/r10kcacheops.h | 2 +- include/asm-mips64/r4kcache.h | 2 +- include/asm-mips64/r4kcacheops.h | 2 +- include/asm-mips64/regdef.h | 2 +- include/asm-mips64/resource.h | 2 +- include/asm-mips64/semaphore-helper.h | 2 +- include/asm-mips64/semaphore.h | 2 +- include/asm-mips64/serial.h | 2 +- include/asm-mips64/sgi/io.h | 2 +- include/asm-mips64/sgi/sgi.h | 2 +- include/asm-mips64/sgi/sgihpc.h | 2 +- include/asm-mips64/sgi/sgimc.h | 2 +- include/asm-mips64/sgi/sgint23.h | 2 +- include/asm-mips64/sgialib.h | 2 +- include/asm-mips64/sgiarcs.h | 2 +- include/asm-mips64/sgidefs.h | 2 +- include/asm-mips64/shmiq.h | 2 +- include/asm-mips64/shmparam.h | 2 +- include/asm-mips64/sigcontext.h | 2 +- include/asm-mips64/siginfo.h | 2 +- include/asm-mips64/signal.h | 3 +- include/asm-mips64/smp.h | 49 + include/asm-mips64/smplock.h | 56 ++ include/asm-mips64/sn/addrs.h | 52 +- include/asm-mips64/sn/agent.h | 10 +- include/asm-mips64/sn/arch.h | 35 +- include/asm-mips64/sn/gda.h | 30 +- include/asm-mips64/sn/intr.h | 127 +++ include/asm-mips64/sn/intr_public.h | 59 ++ include/asm-mips64/sn/io.h | 54 +- include/asm-mips64/sn/klconfig.h | 103 +- include/asm-mips64/sn/kldir.h | 34 +- include/asm-mips64/sn/launch.h | 123 +++ include/asm-mips64/sn/nmi.h | 131 +++ include/asm-mips64/sn/sn0/addrs.h | 2 +- include/asm-mips64/sn/sn0/arch.h | 2 +- include/asm-mips64/sn/sn0/hub.h | 2 +- include/asm-mips64/sn/sn0/hubio.h | 2 +- include/asm-mips64/sn/sn0/hubni.h | 2 +- include/asm-mips64/sn/sn0/hubpi.h | 2 +- include/asm-mips64/sn/sn0/ip27.h | 18 +- include/asm-mips64/sn/sn0/sn0_fru.h | 2 +- include/asm-mips64/sn/sn_private.h | 6 + include/asm-mips64/sn/types.h | 5 +- include/asm-mips64/socket.h | 5 +- include/asm-mips64/sockios.h | 2 +- include/asm-mips64/softirq.h | 8 +- include/asm-mips64/spinlock.h | 23 +- include/asm-mips64/stackframe.h | 18 +- include/asm-mips64/stat.h | 26 + include/asm-mips64/statfs.h | 2 +- include/asm-mips64/string.h | 2 +- include/asm-mips64/sysmips.h | 2 +- include/asm-mips64/system.h | 42 +- include/asm-mips64/termbits.h | 2 +- include/asm-mips64/termios.h | 2 +- include/asm-mips64/timex.h | 10 +- include/asm-mips64/types.h | 2 +- include/asm-mips64/uaccess.h | 2 +- include/asm-mips64/ucontext.h | 2 +- include/asm-mips64/unaligned.h | 2 +- include/asm-mips64/unistd.h | 12 +- include/asm-mips64/user.h | 2 +- include/asm-mips64/usioctl.h | 2 +- include/asm-mips64/watch.h | 2 +- include/asm-mips64/xtalk/xtalk.h | 2 +- include/asm-mips64/xtalk/xwidget.h | 2 +- kernel/fork.c | 2 +- mm/vmscan.c | 7 +- 500 files changed, 9088 insertions(+), 3002 deletions(-) create mode 100644 arch/mips/ddb5074/pci-dma.c create mode 100644 arch/mips64/kernel/ioctl32.c create mode 100644 arch/mips64/kernel/smp.c create mode 100644 arch/mips64/sgi-ip27/ip27-nmi.c create mode 100644 include/asm-mips/arc/types.h create mode 100644 include/asm-mips/hw_irq.h create mode 100644 include/asm-mips/paccess.h create mode 100644 include/asm-mips64/hw_irq.h create mode 100644 include/asm-mips64/smp.h create mode 100644 include/asm-mips64/smplock.h create mode 100644 include/asm-mips64/sn/intr.h create mode 100644 include/asm-mips64/sn/intr_public.h create mode 100644 include/asm-mips64/sn/launch.h create mode 100644 include/asm-mips64/sn/nmi.h create mode 100644 include/asm-mips64/sn/sn_private.h diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 2079bae183d8..d785534f6178 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile @@ -51,6 +51,7 @@ kernel-api.sgml: kernel-api.tmpl $(TOPDIR)/drivers/sound/sound_firmware.c \ $(TOPDIR)/drivers/net/wan/syncppp.c \ $(TOPDIR)/drivers/net/wan/z85230.c \ + $(TOPDIR)/fs/devfs/base.c \ $(TOPDIR)/kernel/pm.c \ $(TOPDIR)/kernel/ksyms.c \ $(TOPDIR)/net/netsyms.c \ diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index 3f886e702ec3..688cdf351cd0 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl @@ -101,6 +101,11 @@ + + The Device File System +!Efs/devfs/base.c + + Power Management !Ekernel/pm.c diff --git a/Documentation/pci.txt b/Documentation/pci.txt index 63e035a9390c..b676d2b32c96 100644 --- a/Documentation/pci.txt +++ b/Documentation/pci.txt @@ -89,6 +89,13 @@ Please mark the initialization and cleanup functions where appropriate function otherwise. __devexit The same for __exit. +Tips: + The module_init()/module_exit() functions (and all initialization + functions called only from these) should be marked __init/exit. + The struct pci_driver shouldn't be marked with any of these tags. + The ID table array should be marked __devinitdata. + The probe() and remove() functions (and all initialization + functions called only from these) should be marked __devinit/exit. 2. How to find PCI devices manually (the old style) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/Makefile b/Makefile index 36601cd87604..7398c6898495 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 3 SUBLEVEL = 99 -EXTRAVERSION = -pre8 +EXTRAVERSION = -pre9 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff --git a/arch/i386/kernel/acpi.c b/arch/i386/kernel/acpi.c index d9dabac2f417..9d21c617e17e 100644 --- a/arch/i386/kernel/acpi.c +++ b/arch/i386/kernel/acpi.c @@ -824,12 +824,12 @@ const static struct {acpi_init_via}, }; -const static struct pci_device_id acpi_pci_tbl[] = +const static struct pci_device_id acpi_pci_tbl[] __devinitdata = { {0x8086, 0x7113, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_INTEL_PIIX4}, {0x1106, 0x3040, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_VIA_586}, {0x1106, 0x3057, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_VIA_686A}, - {0,}, /* terminate list */ + {0,} /* terminate list */ }; static int __init acpi_probe(struct pci_dev *dev, diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index bf3d3c0af6ce..eab365e260e1 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c @@ -30,11 +30,6 @@ int prof_multiplier[NR_CPUS] = { 1, }; int prof_old_multiplier[NR_CPUS] = { 1, }; int prof_counter[NR_CPUS] = { 1, }; -/* - * IA s/w dev Vol 3, Section 7.4 - */ -#define APIC_DEFAULT_PHYS_BASE 0xfee00000 - int get_maxlvt(void) { unsigned int v, ver, maxlvt; diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c index 334a75f88aca..e88fa90229b4 100644 --- a/arch/i386/kernel/i8259.c +++ b/arch/i386/kernel/i8259.c @@ -456,7 +456,7 @@ void __init init_IRQ(void) * IRQ0 must be given a fixed assignment and initialized, * because it's used before the IO-APIC is set up. */ - set_intr_gate(IRQ0_TRAP_VECTOR, interrupt[0]); + set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]); /* * The reschedule interrupt is a CPU-to-CPU reschedule-helper diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index dfee6e4d55f9..7bf275c14b80 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c @@ -48,6 +48,11 @@ struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES]; /* MP IRQ source entries */ int mp_irq_entries = 0; +#if CONFIG_SMP +# define TARGET_CPUS cpu_online_map +#else +# define TARGET_CPUS 0x01 +#endif /* * Rough estimation of how many shared IRQs there are, can * be changed anytime. @@ -89,7 +94,7 @@ static void add_pin_to_irq(unsigned int irq, int apic, int pin) entry->pin = pin; } -#define __DO_ACTION(name,R,ACTION, FINAL) \ +#define __DO_ACTION(R, ACTION, FINAL) \ \ { \ int pin; \ @@ -112,8 +117,8 @@ static void add_pin_to_irq(unsigned int irq, int apic, int pin) #define DO_ACTION(name,R,ACTION, FINAL) \ \ -static void name##_IO_APIC_irq(unsigned int irq) \ -__DO_ACTION(name,R,ACTION, FINAL) + static void name##_IO_APIC_irq (unsigned int irq) \ + __DO_ACTION(R, ACTION, FINAL) DO_ACTION( __mask, 0, |= 0x00010000, io_apic_sync(entry->apic))/* mask = 1 */ DO_ACTION( __unmask, 0, &= 0xfffeffff, ) /* mask = 0 */ @@ -542,25 +547,26 @@ static inline int IO_APIC_irq_trigger(int irq) return 0; } -int irq_vector[NR_IRQS] = { IRQ0_TRAP_VECTOR , 0 }; +int irq_vector[NR_IRQS] = { FIRST_DEVICE_VECTOR , 0 }; static int __init assign_irq_vector(int irq) { - static int current_vector = IRQ0_TRAP_VECTOR, offset = 0; + static int current_vector = FIRST_DEVICE_VECTOR, offset = 0; if (IO_APIC_VECTOR(irq) > 0) return IO_APIC_VECTOR(irq); - if (current_vector == 0xFF) - panic("ran out of interrupt sources!"); next: current_vector += 8; if (current_vector == SYSCALL_VECTOR) goto next; - if (current_vector > 0xFF) { + if (current_vector > FIRST_SYSTEM_VECTOR) { offset++; - current_vector = IRQ0_TRAP_VECTOR + offset; + current_vector = FIRST_DEVICE_VECTOR + offset; } + if (current_vector == FIRST_SYSTEM_VECTOR) + panic("ran out of interrupt sources!"); + IO_APIC_VECTOR(irq) = current_vector; return current_vector; } @@ -587,7 +593,7 @@ void __init setup_IO_APIC_irqs(void) entry.delivery_mode = dest_LowestPrio; entry.dest_mode = 1; /* logical delivery */ entry.mask = 0; /* enable IRQ */ - entry.dest.logical.logical_dest = APIC_ALL_CPUS; + entry.dest.logical.logical_dest = TARGET_CPUS; idx = find_irq_entry(apic,pin,mp_INT); if (idx == -1) { @@ -605,7 +611,7 @@ void __init setup_IO_APIC_irqs(void) if (irq_trigger(idx)) { entry.trigger = 1; entry.mask = 1; - entry.dest.logical.logical_dest = APIC_ALL_CPUS; + entry.dest.logical.logical_dest = TARGET_CPUS; } irq = pin_2_irq(idx, apic, pin); @@ -660,7 +666,7 @@ void __init setup_ExtINT_IRQ0_pin(unsigned int pin, int vector) */ entry.dest_mode = 1; /* logical delivery */ entry.mask = 0; /* unmask IRQ now */ - entry.dest.logical.logical_dest = APIC_ALL_CPUS; + entry.dest.logical.logical_dest = TARGET_CPUS; entry.delivery_mode = dest_LowestPrio; entry.polarity = 0; entry.trigger = 0; @@ -1167,7 +1173,7 @@ static void set_ioapic_affinity (unsigned int irq, unsigned long mask) mask = mask << 24; spin_lock_irqsave(&ioapic_lock, flags); - __DO_ACTION( target, 1, = mask, ) + __DO_ACTION(1, = mask, ) spin_unlock_irqrestore(&ioapic_lock, flags); } diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c index 79155a3262b4..fb0fe277c513 100644 --- a/arch/i386/kernel/irq.c +++ b/arch/i386/kernel/irq.c @@ -1117,7 +1117,8 @@ static void register_irq_proc (unsigned int irq) struct proc_dir_entry *entry; char name [MAX_NAMELEN]; - if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type)) + if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) || + irq_dir[irq]) return; memset(name, 0, MAX_NAMELEN); @@ -1158,10 +1159,7 @@ void init_irq_proc (void) /* * Create entries for all existing IRQs. */ - for (i = 0; i < NR_IRQS; i++) { - if (irq_desc[i].handler == &no_irq_type) - continue; + for (i = 0; i < NR_IRQS; i++) register_irq_proc(i); - } } diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c index 5df83a10a2fa..9455d2e3a79d 100644 --- a/arch/i386/kernel/mpparse.c +++ b/arch/i386/kernel/mpparse.c @@ -49,11 +49,6 @@ static unsigned int num_processors = 0; /* Bitmask of physically existing CPUs */ unsigned long phys_cpu_present_map = 0; -/* - * IA s/w dev Vol 3, Section 7.4 - */ -#define APIC_DEFAULT_PHYS_BASE 0xfee00000 - /* * Intel MP BIOS table parsing routines: */ @@ -65,10 +60,12 @@ unsigned long phys_cpu_present_map = 0; static int __init mpf_checksum(unsigned char *mp, int len) { - int sum=0; - while(len--) - sum+=*mp++; - return sum&0xFF; + int sum = 0; + + while (len--) + sum += *mp++; + + return sum & 0xFF; } /* diff --git a/arch/i386/kernel/pci-irq.c b/arch/i386/kernel/pci-irq.c index d678801b69e9..cd16c78a5ffa 100644 --- a/arch/i386/kernel/pci-irq.c +++ b/arch/i386/kernel/pci-irq.c @@ -222,6 +222,7 @@ static struct irq_router pirq_routers[] = { { "PIIX", PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_0, pirq_piix_get, pirq_piix_set }, { "PIIX", PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_0, pirq_piix_get, pirq_piix_set }, { "PIIX", PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0, pirq_piix_get, pirq_piix_set }, + { "PIIX", PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82440MX_1, pirq_piix_get, pirq_piix_set }, { "ALI", PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, pirq_ali_get, pirq_ali_set }, { "VIA", PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, pirq_via_get, pirq_via_set }, { "VIA", PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596, pirq_via_get, pirq_via_set }, @@ -345,7 +346,7 @@ int pcibios_lookup_irq(struct pci_dev *dev, int assign) if (!irq) { DBG(" ... failed\n"); - if (newirq && mask == (1 << newirq)) { + if (assign && newirq && mask == (1 << newirq)) { msg = "Guessed"; irq = newirq; } else diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index e3e043b2372c..7a9561719520 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -406,6 +406,32 @@ void __init add_memory_region(unsigned long start, e820.nr_map++; } /* add_memory_region */ +#define E820_DEBUG 1 + +static __init void print_e820_map (void) +{ + int i; + + for (i = 0; i < e820.nr_map; i++) { + printk(" e820: %016Lx @ %016Lx ", + e820.map[i].size, e820.map[i].addr); + switch (e820.map[i].type) { + case E820_RAM: printk("(usable)\n"); + break; + case E820_RESERVED: + printk("(reserved)\n"); + break; + case E820_ACPI: + printk("(ACPI data)\n"); + break; + case E820_NVS: + printk("(ACPI NVS)\n"); + break; + default: printk("type %lu\n", e820.map[i].type); + break; + } + } +} /* * Do NOT EVER look at the BIOS memory size location. @@ -415,11 +441,6 @@ void __init add_memory_region(unsigned long start, void __init setup_memory_region(void) { -#define E820_DEBUG 1 -#ifdef E820_DEBUG - int i; -#endif - /* * If we're lucky and live on a modern system, the setup code * will have given us a memory map that we can use to properly @@ -439,27 +460,6 @@ void __init setup_memory_region(void) if (e820.nr_map > E820MAX) e820.nr_map = E820MAX; memcpy(e820.map, E820_MAP, e820.nr_map * sizeof e820.map[0]); -#ifdef E820_DEBUG - for (i=0; i < e820.nr_map; i++) { - printk("e820: %08x @ %08x ", (int)e820.map[i].size, - (int)e820.map[i].addr); - switch (e820.map[i].type) { - case E820_RAM: printk("(usable)\n"); - break; - case E820_RESERVED: - printk("(reserved)\n"); - break; - case E820_ACPI: - printk("(ACPI data)\n"); - break; - case E820_NVS: - printk("(ACPI NVS)\n"); - break; - default: printk("type %lu\n", e820.map[i].type); - break; - } - } -#endif } else { /* otherwise fake a memory map; one section from 0k->640k, @@ -472,6 +472,8 @@ void __init setup_memory_region(void) add_memory_region(0, LOWMEMSIZE(), E820_RAM); add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM); } + printk("BIOS-provided physical RAM map:\n"); + print_e820_map(); } /* setup_memory_region */ @@ -538,6 +540,10 @@ static inline void parse_mem_cmdline (char ** cmdline_p) } *to = '\0'; *cmdline_p = command_line; + if (usermem) { + printk("user-defined physical RAM map:\n"); + print_e820_map(); + } } void __init setup_arch(char **cmdline_p) diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index e25f50cfd20c..7fb5ebc61140 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c @@ -790,7 +790,7 @@ cobalt_init(void) * On normal SMP PC this is used only with SMP, but we have to * use it and set it up here to start the Cobalt clock */ - set_fixmap(FIX_APIC_BASE, APIC_PHYS_BASE); + set_fixmap(FIX_APIC_BASE, APIC_DEFAULT_PHYS_BASE); printk("Local APIC ID %lx\n", apic_read(APIC_ID)); printk("Local APIC Version %lx\n", apic_read(APIC_LVR)); diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index c801285eb180..af72d158103a 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c @@ -242,8 +242,18 @@ static inline void set_pte_phys (unsigned long vaddr, pte_t *pte; pgd = swapper_pg_dir + __pgd_offset(vaddr); + if (pgd_none(*pgd)) { + printk("PAE BUG #00!\n"); + return; + } pmd = pmd_offset(pgd, vaddr); + if (pmd_none(*pmd)) { + printk("PAE BUG #01!\n"); + return; + } pte = pte_offset(pmd, vaddr); + if (pte_val(*pte)) + pte_ERROR(*pte); pgprot_val(prot) = pgprot_val(PAGE_KERNEL) | pgprot_val(flags); set_pte(pte, mk_pte_phys(phys, prot)); @@ -271,53 +281,65 @@ static void __init fixrange_init (unsigned long start, unsigned long end, pgd_t pmd_t *pmd; pte_t *pte; int i, j; + unsigned long vaddr; - i = __pgd_offset(start); - j = __pmd_offset(start); + vaddr = start; + i = __pgd_offset(vaddr); + j = __pmd_offset(vaddr); pgd = pgd_base + i; - for ( ; (i < PTRS_PER_PGD) && (start != end); pgd++, i++) { + for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) { #if CONFIG_X86_PAE if (pgd_none(*pgd)) { pmd = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE); set_pgd(pgd, __pgd(__pa(pmd) + 0x1)); - if (pmd != pmd_offset(pgd, start)) - BUG(); + if (pmd != pmd_offset(pgd, 0)) + printk("PAE BUG #02!\n"); } - pmd = pmd_offset(pgd, start); + pmd = pmd_offset(pgd, vaddr); #else pmd = (pmd_t *)pgd; #endif - for (; (j < PTRS_PER_PMD) && start; pmd++, j++) { + for (; (j < PTRS_PER_PMD) && (vaddr != end); pmd++, j++) { if (pmd_none(*pmd)) { pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); set_pmd(pmd, __pmd(_KERNPG_TABLE + __pa(pte))); if (pte != pte_offset(pmd, 0)) BUG(); } - start += PMD_SIZE; + vaddr += PMD_SIZE; } j = 0; } } -static void __init pagetable_init(void) +static void __init pagetable_init (void) { + unsigned long vaddr, end; pgd_t *pgd, *pgd_base; + int i, j, k; pmd_t *pmd; pte_t *pte; - int i, j, k; - unsigned long vaddr, end; - end = (unsigned long)__va(max_low_pfn*PAGE_SIZE) - 1; + /* + * This can be zero as well - no problem, in that case we exit + * the loops anyway due to the PTRS_PER_* conditions. + */ + end = (unsigned long)__va(max_low_pfn*PAGE_SIZE); - i = __pgd_offset(PAGE_OFFSET); pgd_base = swapper_pg_dir; +#if CONFIG_X86_PAE + for (i = 0; i < PTRS_PER_PGD; i++) { + pgd = pgd_base + i; + __pgd_clear(pgd); + } +#endif + i = __pgd_offset(PAGE_OFFSET); pgd = pgd_base + i; for (; i < PTRS_PER_PGD; pgd++, i++) { vaddr = i*PGDIR_SIZE; - if (vaddr >= end) + if (end && (vaddr >= end)) break; #if CONFIG_X86_PAE pmd = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE); @@ -329,7 +351,7 @@ static void __init pagetable_init(void) BUG(); for (j = 0; j < PTRS_PER_PMD; pmd++, j++) { vaddr = i*PGDIR_SIZE + j*PMD_SIZE; - if (vaddr >= end) + if (end && (vaddr >= end)) break; if (cpu_has_pse) { unsigned long __pe; @@ -354,7 +376,7 @@ static void __init pagetable_init(void) for (k = 0; k < PTRS_PER_PTE; pte++, k++) { vaddr = i*PGDIR_SIZE + j*PMD_SIZE + k*PAGE_SIZE; - if (vaddr >= end) + if (end && (vaddr >= end)) break; *pte = mk_pte_phys(__pa(vaddr), PAGE_KERNEL); } diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 53d7d0358633..baccc3980f75 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -125,6 +125,7 @@ endif ifdef CONFIG_BAGET_MIPS SUBDIRS += arch/mips/baget arch/mips/baget/prom LIBS += arch/mips/baget/baget.a arch/mips/baget/prom/bagetlib.a +LOADADDR += 0x80001000 endif # @@ -189,6 +190,7 @@ archclean: @$(MAKEBOOT) clean $(MAKE) -C arch/$(ARCH)/kernel clean $(MAKE) -C arch/$(ARCH)/tools clean + $(MAKE) -C arch/mips/baget clean archmrproper: diff --git a/arch/mips/arc/Makefile b/arch/mips/arc/Makefile index 12f71ab8d180..7bfefcfbae1a 100644 --- a/arch/mips/arc/Makefile +++ b/arch/mips/arc/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 2000/01/13 00:11:11 ralf Exp $ +# $Id: Makefile,v 1.1 1998/10/18 13:32:08 tsbogend Exp $ # # Makefile for the SGI arcs prom monitor library routines # under Linux. diff --git a/arch/mips/arc/cmdline.c b/arch/mips/arc/cmdline.c index d089b5409a32..d60ff2bab877 100644 --- a/arch/mips/arc/cmdline.c +++ b/arch/mips/arc/cmdline.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: cmdline.c,v 1.2 1999/10/09 00:00:57 ralf Exp $ + * $Id: cmdline.c,v 1.1 1998/10/18 13:32:08 tsbogend Exp $ */ #include #include diff --git a/arch/mips/arc/env.c b/arch/mips/arc/env.c index 051db843f2af..193e9dd085c2 100644 --- a/arch/mips/arc/env.c +++ b/arch/mips/arc/env.c @@ -11,12 +11,14 @@ #include -char * __init prom_getenv(char *name) +PCHAR __init +ArcGetEnvironmentVariable(CHAR *name) { return romvec->get_evar(name); } -long __init prom_setenv(char *name, char *value) +LONG __init +ArcSetEnvironmentVariable(PCHAR name, PCHAR value) { return romvec->set_evar(name, value); } diff --git a/arch/mips/arc/file.c b/arch/mips/arc/file.c index ee1a7cfcce75..30be5f5d01de 100644 --- a/arch/mips/arc/file.c +++ b/arch/mips/arc/file.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: file.c,v 1.2 1999/10/09 00:00:57 ralf Exp $ + * $Id: file.c,v 1.1 1998/10/18 13:32:08 tsbogend Exp $ */ #include #include diff --git a/arch/mips/arc/identify.c b/arch/mips/arc/identify.c index eba565db2fbd..8cc0a22edf90 100644 --- a/arch/mips/arc/identify.c +++ b/arch/mips/arc/identify.c @@ -7,7 +7,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: identify.c,v 1.3 1999/10/21 00:23:04 ralf Exp $ + * $Id: identify.c,v 1.2 1999/02/25 21:04:13 tsbogend Exp $ */ #include #include diff --git a/arch/mips/arc/init.c b/arch/mips/arc/init.c index 81cf6cf74b75..05200cb42385 100644 --- a/arch/mips/arc/init.c +++ b/arch/mips/arc/init.c @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.4 1999/10/09 00:00:57 ralf Exp $ +/* $Id: init.c,v 1.5 2000/03/07 15:45:27 ralf Exp $ * This file is subject to the terms and conditions of the GNU General Public+ * License. See the file "COPYING" in the main directory of this archive * for more details. @@ -23,7 +23,7 @@ unsigned short prom_vers, prom_rev; extern void prom_testtree(void); -int __init prom_init(int argc, char **argv, char **envp) +int __init prom_init(int argc, char **argv, char **envp, int *prom_vec) { struct linux_promblock *pb; diff --git a/arch/mips/arc/memory.c b/arch/mips/arc/memory.c index d1c530fda4bf..22c868ca1c1a 100644 --- a/arch/mips/arc/memory.c +++ b/arch/mips/arc/memory.c @@ -21,8 +21,6 @@ #undef DEBUG -extern char _end; - struct linux_mdesc * __init ArcGetMemoryDescriptor(struct linux_mdesc *Current) { @@ -146,7 +144,7 @@ static inline struct prom_pmemblock *find_largest_memblock(void) void __init prom_meminit(void) { struct prom_pmemblock *largest; - unsigned long bootmap_size; + unsigned long bootmap_size, kbegin, kend; struct linux_mdesc *p; int totram; int i = 0; @@ -195,6 +193,7 @@ void __init prom_meminit(void) pblocks[i].size = 0; max_low_pfn = find_max_low_pfn(); + largest = find_largest_memblock(); bootmap_size = init_bootmem(largest->base >> PAGE_SHIFT, max_low_pfn); @@ -208,6 +207,8 @@ void __init prom_meminit(void) prom_printf("CRITIAL: overwriting PROM data.\n"); BUG(); } + + /* Reserve the memory bootmap itself */ reserve_bootmem(largest->base, bootmap_size); printk("PROMLIB: Total free ram %dK / %dMB.\n", diff --git a/arch/mips/arc/misc.c b/arch/mips/arc/misc.c index 1fe6bfa0cc7d..4c056be43c51 100644 --- a/arch/mips/arc/misc.c +++ b/arch/mips/arc/misc.c @@ -1,4 +1,4 @@ -/* $Id: misc.c,v 1.2 1999/10/09 00:00:57 ralf Exp $ +/* $Id: misc.c,v 1.1 1998/10/18 13:32:09 tsbogend Exp $ * * misc.c: Miscellaneous ARCS PROM routines. * diff --git a/arch/mips/arc/salone.c b/arch/mips/arc/salone.c index 4cef8c838df7..3ed8daa403d7 100644 --- a/arch/mips/arc/salone.c +++ b/arch/mips/arc/salone.c @@ -4,7 +4,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: salone.c,v 1.2 1999/10/09 00:00:57 ralf Exp $ + * $Id: salone.c,v 1.1 1998/10/18 13:32:09 tsbogend Exp $ */ #include #include diff --git a/arch/mips/arc/time.c b/arch/mips/arc/time.c index 07cdeda2c447..34925bacf843 100644 --- a/arch/mips/arc/time.c +++ b/arch/mips/arc/time.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: time.c,v 1.2 1999/10/09 00:00:57 ralf Exp $ + * $Id: time.c,v 1.1 1998/10/18 13:32:10 tsbogend Exp $ */ #include #include diff --git a/arch/mips/arc/tree.c b/arch/mips/arc/tree.c index 8ed2684b9308..2c3ec6744d1d 100644 --- a/arch/mips/arc/tree.c +++ b/arch/mips/arc/tree.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: tree.c,v 1.2 1999/10/09 00:00:57 ralf Exp $ + * $Id: tree.c,v 1.1 1998/10/18 13:32:10 tsbogend Exp $ */ #include #include diff --git a/arch/mips/baget/Makefile b/arch/mips/baget/Makefile index a471f18c2f11..f27a9e6f33b6 100644 --- a/arch/mips/baget/Makefile +++ b/arch/mips/baget/Makefile @@ -11,11 +11,8 @@ all: baget.a -image: ../../../vmlinux - cp -f $< $@ - O_TARGET := baget.a -O_OBJS := baget.o print.o setup.o time.o irq.o bagetIRQ.o reset.o +O_OBJS := baget.o print.o setup.o time.o irq.o bagetIRQ.o reset.o wbflush.o ifeq ($(CONFIG_SERIAL),y) OX_OBJS += vacserial.o @@ -38,8 +35,8 @@ bagetIRQ.o : bagetIRQ.S ##################### Baget Loader stuff ######################## -dummy.c: - touch $@ +image: ../../../vmlinux + cp -f $< $@ image.bin: image $(OBJCOPY) -O binary $< $@ @@ -47,6 +44,9 @@ image.bin: image ramdisk.bin: echo "Dummy ramdisk used. Provide your own if needed !" > $@ +dummy.c: + touch $@ + dummy.o: dummy.c image.bin ramdisk.bin $(CC) $(CFLAGS) -c -o $@ $< $(OBJCOPY) --add-section=.vmlinux=image.bin \ @@ -54,10 +54,11 @@ dummy.o: dummy.c image.bin ramdisk.bin balo.h: image $(NM) $< | awk ' \ - BEGIN { printf "/* DO NOT EDIT THIS FILE */\n" } \ - /kernel_entry/ { printf "#define START 0x%s\n", $$1 } \ - /balo_ramdisk_base/ { printf "#define RAMDISK_BASE 0x%s\n", $$1 } \ - /balo_ramdisk_size/ { printf "#define RAMDISK_SIZE 0x%s\n", $$1 } \ + BEGIN { printf "/* DO NOT EDIT THIS FILE */\n" } \ + /_ftext/ { printf "#define LOADADDR 0x%s\n", $$1 } \ + /kernel_entry/ { printf "#define START 0x%s\n", $$1 } \ + /balo_ramdisk_base/ { printf "#define RAMDISK_BASE 0x%s\n", $$1 } \ + /balo_ramdisk_size/ { printf "#define RAMDISK_SIZE 0x%s\n", $$1 } \ ' > $@ balo.o: balo.c balo.h $(CC) $(CFLAGS) -c $< @@ -69,7 +70,6 @@ balo: balo.o dummy.o balo_supp.o print.o $(LD) $(LDFLAGS) -T ld.script.balo -o $@ $^ clean: - rm -f balo.o balo.h dummy.o dummy.c hello.o image.bin image balo_supp.o - rm -f $(O_OBJS) $(O_TARGET) + rm -f balo balo.h dummy.c image image.bin include $(TOPDIR)/Rules.make diff --git a/arch/mips/baget/baget.c b/arch/mips/baget/baget.c index c3545b21243e..ef03dca06954 100644 --- a/arch/mips/baget/baget.c +++ b/arch/mips/baget/baget.c @@ -13,16 +13,10 @@ #include #include #include +#include #include -/* - * Following values are set by BALO into RAM disk buffer parameters - */ -unsigned long balo_ramdisk_base = 0xBA; /* Signature for BALO ! */ -unsigned long balo_ramdisk_size = 0; - - /* * Following code is based on routines from 'mm/vmalloc.c' * Additional parameters ioaddr is needed to iterate across real I/O address. diff --git a/arch/mips/baget/bagetIRQ.S b/arch/mips/baget/bagetIRQ.S index ec0a5c19d0fc..4990a9cf655f 100644 --- a/arch/mips/baget/bagetIRQ.S +++ b/arch/mips/baget/bagetIRQ.S @@ -1,4 +1,4 @@ -/* $Id: bagetIRQ.S,v 1.2 1999/08/18 23:37:42 ralf Exp $ +/* $Id: bagetIRQ.S,v 1.1 1999/01/17 03:49:37 ralf Exp $ * bagetIRQ.S: Interrupt exception dispatch code for Baget/MIPS * * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov diff --git a/arch/mips/baget/balo.c b/arch/mips/baget/balo.c index f549b932edec..819a2f9f1030 100644 --- a/arch/mips/baget/balo.c +++ b/arch/mips/baget/balo.c @@ -1,4 +1,4 @@ -/* $Id: balo.c,v 1.1 1999/01/17 03:49:37 ralf Exp $ +/* $Id$ * * balo.c: BAget LOader * diff --git a/arch/mips/baget/irq.c b/arch/mips/baget/irq.c index bd280841b8f4..08b15a7a8e12 100644 --- a/arch/mips/baget/irq.c +++ b/arch/mips/baget/irq.c @@ -29,8 +29,7 @@ #include -unsigned int local_bh_count[NR_CPUS]; -unsigned int local_irq_count[NR_CPUS]; +irq_cpustat_t irq_stat [NR_CPUS]; unsigned long spurious_count = 0; /* diff --git a/arch/mips/baget/print.c b/arch/mips/baget/print.c index 6db85deb162c..0efbef1e39cb 100644 --- a/arch/mips/baget/print.c +++ b/arch/mips/baget/print.c @@ -1,4 +1,4 @@ -/* $Id: print.c,v 1.2 1999/10/09 00:00:57 ralf Exp $ +/* $Id: print.c,v 1.1 1999/01/17 03:49:38 ralf Exp $ * * print.c: Simple print fascility * diff --git a/arch/mips/baget/prom/Makefile b/arch/mips/baget/prom/Makefile index 302af7ec2b75..a98779f0ee48 100644 --- a/arch/mips/baget/prom/Makefile +++ b/arch/mips/baget/prom/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1 1999/01/17 03:49:40 ralf Exp $ +# $Id$ # Makefile for the Baget/MIPS prom emulator library routines. # # Note! Dependencies are done automagically by 'make dep', which also diff --git a/arch/mips/baget/time.c b/arch/mips/baget/time.c index 1f345d261d2f..d56fa6a23a9b 100644 --- a/arch/mips/baget/time.c +++ b/arch/mips/baget/time.c @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.4 1999/10/09 00:00:57 ralf Exp $ +/* $Id: time.c,v 1.3 1999/08/17 22:18:37 ralf Exp $ * time.c: Baget/MIPS specific time handling details * * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov diff --git a/arch/mips/baget/vacserial.c b/arch/mips/baget/vacserial.c index 5370013d78a3..048e32ed5c67 100644 --- a/arch/mips/baget/vacserial.c +++ b/arch/mips/baget/vacserial.c @@ -1,4 +1,4 @@ -/* $Id: vacserial.c,v 1.4 1999/10/09 00:00:57 ralf Exp $ +/* $Id: vacserial.c,v 1.3 1999/08/17 22:18:37 ralf Exp $ * vacserial.c: VAC UART serial driver * This code stealed and adopted from linux/drivers/char/serial.c * See that for author info diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile index 3d677cb8c90e..1ae3a3fd66aa 100644 --- a/arch/mips/boot/Makefile +++ b/arch/mips/boot/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.10 1999/10/17 19:55:22 harald Exp $ +# $Id: Makefile,v 1.9 1999/04/07 18:45:23 harald Exp $ # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/config.in b/arch/mips/config.in index f570766613fe..9e6e664d2ea6 100644 --- a/arch/mips/config.in +++ b/arch/mips/config.in @@ -1,4 +1,4 @@ -# $Id: config.in,v 1.42 2000/02/24 00:12:40 ralf Exp $ +# $Id: config.in,v 1.46 2000/03/26 22:59:01 ralf Exp $ # For a description of the syntax of this configuration file, # see the Configure script. # @@ -26,149 +26,141 @@ bool 'Support for SNI RM200 PCI' CONFIG_SNI_RM200_PCI # # Select some configuration options automatically for certain systems. # +unset CONFIG_ARC32 +unset CONFIG_PCI +unset CONFIG_ISA unset CONFIG_MIPS_JAZZ unset CONFIG_VIDEO_G364 define_bool CONFIG_SBUS n -if [ "$CONFIG_ALGOR_P4032" = "y" -o "$CONFIG_SNI_RM200_PCI" = "y" -o \ - "$CONFIG_DDB5074" = "y" ]; then +if [ "$CONFIG_ALGOR_P4032" = "y" ]; then define_bool CONFIG_PCI y -else - define_bool CONFIG_PCI n fi -if [ "$CONFIG_MIPS_MAGNUM_4000" = "y" -o "$CONFIG_OLIVETTI_M700" = "y" -o \ - "$CONFIG_SNI_RM200_PCI" = "y" -o "$CONFIG_ACER_PICA_61" = "y" ]; then - define_bool CONFIG_ISA y -else - define_bool CONFIG_ISA n -fi - if [ "$CONFIG_MIPS_MAGNUM_4000" = "y" -o \ "$CONFIG_OLIVETTI_M700" = "y" ]; then + define_bool CONFIG_ARC32 y define_bool CONFIG_HAVE_IO_PORTS y - define_bool CONFIG_MIPS_JAZZ y define_bool CONFIG_FB y define_bool CONFIG_FB_G364 y + define_bool CONFIG_MIPS_JAZZ y fi if [ "$CONFIG_ACER_PICA_61" = "y" ]; then + define_bool CONFIG_ARC32 y define_bool CONFIG_HAVE_IO_PORTS y define_bool CONFIG_MIPS_JAZZ y fi +if [ "$CONFIG_SGI_IP22" = "y" ]; then + define_bool CONFIG_ARC32 y +fi if [ "$CONFIG_SNI_RM200_PCI" = "y" ]; then + define_bool CONFIG_ARC32 y define_bool CONFIG_HAVE_IO_PORTS y fi if [ "$CONFIG_DDB5074" = "y" ]; then define_bool CONFIG_HAVE_IO_PORTS y + define_bool CONFIG_ISA y + define_bool CONFIG_PCI y +fi + +if [ "$CONFIG_ISA" != "y" ]; then + define_bool CONFIG_ISA n +fi + +if [ "$CONFIG_PCI" != "y" ]; then + define_bool CONFIG_PCI n fi endmenu mainmenu_option next_comment -comment 'CPU selection' - -if [ "$CONFIG_CPU_ADVANCED" = "y" ]; then - choice 'CPU core' \ - "R3000 CONFIG_CPU_R3000 \ - R4300 CONFIG_CPU_R4300 \ - R4x00 CONFIG_CPU_R4X00 \ - R5000 CONFIG_CPU_R5000 \ - R56x0 CONFIG_CPU_NEVADA \ - R10000 CONFIG_CPU_R10000" R4x00 - - bool ' ll/sc Instructions available' CONFIG_CPU_HAS_LLSC - bool ' Writeback Buffer available' CONFIG_CPU_HAS_WB -else - choice 'CPU type' \ - "R3000 CONFIG_CPU_R3000 \ - R6000 CONFIG_CPU_R6000 \ - R4300 CONFIG_CPU_R4300 \ - R4x00 CONFIG_CPU_R4X00 \ - R5000 CONFIG_CPU_R5000 \ - R56x0 CONFIG_CPU_NEVADA \ - R8000 CONFIG_CPU_R8000 \ - R10000 CONFIG_CPU_R10000 \ - Advanced CONFIG_CPU_ADVANCED" R4x00 - - if [ "$CONFIG_CPU_R3000" = "y" ]; then - if [ "$CONFIG_DECSTATION" = "y" ]; then - define_bool CONFIG_CPU_HAS_LLSC n - define_bool CONFIG_CPU_HAS_WB y - else - define_bool CONFIG_CPU_HAS_LLSC n - define_bool CONFIG_CPU_HAS_WB n - fi - else - define_bool CONFIG_CPU_HAS_LLSC y - define_bool CONFIG_CPU_HAS_WB n - fi -fi + comment 'CPU selection' + + choice 'CPU type' \ + "R3000 CONFIG_CPU_R3000 \ + R6000 CONFIG_CPU_R6000 \ + R4300 CONFIG_CPU_R4300 \ + R4x00 CONFIG_CPU_R4X00 \ + R5000 CONFIG_CPU_R5000 \ + R56x0 CONFIG_CPU_NEVADA \ + R8000 CONFIG_CPU_R8000 \ + R10000 CONFIG_CPU_R10000" R4x00 + + bool 'Advanced CPU Config' CONFIG_CPU_ADVANCED + + if [ "$CONFIG_CPU_ADVANCED" = "y" ]; then + bool ' ll/sc Instructions available' CONFIG_CPU_HAS_LLSC + bool ' Writeback Buffer available' CONFIG_CPU_HAS_WB + else + if [ "$CONFIG_CPU_R3000" = "y" ]; then + if [ "$CONFIG_DECSTATION" = "y" ]; then + define_bool CONFIG_CPU_HAS_LLSC n + define_bool CONFIG_CPU_HAS_WB y + else + define_bool CONFIG_CPU_HAS_LLSC n + define_bool CONFIG_CPU_HAS_WB n + fi + else + define_bool CONFIG_CPU_HAS_LLSC y + define_bool CONFIG_CPU_HAS_WB n + fi + fi endmenu mainmenu_option next_comment comment 'General setup' -if [ "$CONFIG_DECSTATION" = "y" -o "$CONFIG_DDB5074" = "y" ]; then - define_bool CONFIG_CPU_LITTLE_ENDIAN y -else - bool 'Generate little endian code' CONFIG_CPU_LITTLE_ENDIAN -fi - -if [ "$CONFIG_PROC_FS" = "y" ]; then - define_bool CONFIG_KCORE_ELF y -fi -define_bool CONFIG_ELF_KERNEL y + if [ "$CONFIG_DECSTATION" = "y" -o "$CONFIG_DDB5074" = "y" ]; then + define_bool CONFIG_CPU_LITTLE_ENDIAN y + else + bool 'Generate little endian code' CONFIG_CPU_LITTLE_ENDIAN + fi -if [ "$CONFIG_CPU_LITTLE_ENDIAN" = "n" ]; then - define_bool CONFIG_BINFMT_IRIX y - define_bool CONFIG_FORWARD_KEYBOARD y -fi -define_bool CONFIG_BINFMT_AOUT n -define_bool CONFIG_BINFMT_ELF y -tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC + if [ "$CONFIG_PROC_FS" = "y" ]; then + define_bool CONFIG_KCORE_ELF y + fi + define_bool CONFIG_ELF_KERNEL y -bool 'Networking support' CONFIG_NET + if [ "$CONFIG_CPU_LITTLE_ENDIAN" = "n" ]; then + bool 'Include IRIX binary compatibility' CONFIG_BINFMT_IRIX + bool 'Include forward keyboard' CONFIG_FORWARD_KEYBOARD + fi -source drivers/pci/Config.in + define_bool CONFIG_BINFMT_AOUT n + define_bool CONFIG_BINFMT_ELF y + tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC -bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG -if [ "$CONFIG_HOTPLUG" = "y" ]; then - source drivers/pcmcia/Config.in -else - define_bool CONFIG_PCMCIA n -fi + bool 'Networking support' CONFIG_NET -bool 'System V IPC' CONFIG_SYSVIPC -bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT -bool 'Sysctl support' CONFIG_SYSCTL + if [ "$CONFIG_PCI" = "y" ]; then + source drivers/pci/Config.in + fi -if [ "$CONFIG_SGI_IP22" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" != "y" ]; then - source drivers/parport/Config.in -fi -endmenu + bool 'System V IPC' CONFIG_SYSVIPC + bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT + bool 'Sysctl support' CONFIG_SYSCTL -mainmenu_option next_comment -comment 'Loadable module support' -bool 'Enable loadable module support' CONFIG_MODULES -if [ "$CONFIG_MODULES" = "y" ]; then - bool ' Set version information on all symbols for modules' CONFIG_MODVERSIONS - bool ' Kernel module loader' CONFIG_KMOD -fi + source drivers/parport/Config.in -source drivers/pci/Config.in + bool 'Enable loadable module support' CONFIG_MODULES + if [ "$CONFIG_MODULES" = "y" ]; then + bool ' Set version information on all symbols for modules' CONFIG_MODVERSIONS + bool ' Kernel module loader' CONFIG_KMOD + fi + if [ "$CONFIG_DECSTATION" = "y" ]; then + bool 'TURBOchannel support' CONFIG_TC + fi endmenu -if [ "$CONFIG_DECSTATION" = "y" ]; then - mainmenu_option next_comment - comment 'TURBOchannel support' - bool 'TURBOchannel support' CONFIG_TC -# if [ "$CONFIG_TC" = "y" ]; then -# tristate ' MAGMA Parallel port support' CONFIG_PARPORT -# fi - endmenu +if [ "$CONFIG_ISA" = "y" ]; then + source drivers/pnp/Config.in fi -source drivers/pnp/Config.in +if [ "$CONFIG_HOTPLUG" = "y" ] ; then + source drivers/pcmcia/Config.in +else + define_bool CONFIG_PCMCIA n +fi source drivers/block/Config.in @@ -176,18 +168,27 @@ if [ "$CONFIG_NET" = "y" ]; then source net/Config.in fi -mainmenu_option next_comment -comment 'ATA/IDE/MFM/RLL support' +if [ "$CONFIG_DECSTATION" != "n" -a \ + "$CONFIG_SGI_IP22" != "n" ]; then + source drivers/telephony/Config.in +fi -tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE +if [ "$CONFIG_SGI_IP22" != "n" -a \ + "$CONFIG_DECSTATION" != "n" ]; then -if [ "$CONFIG_IDE" != "n" ]; then - source drivers/ide/Config.in -else - define_bool CONFIG_BLK_DEV_IDE_MODES n - define_bool CONFIG_BLK_DEV_HD n + mainmenu_option next_comment + comment 'ATA/IDE/MFM/RLL support' + + tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE + + if [ "$CONFIG_IDE" != "n" ]; then + source drivers/ide/Config.in + else + define_bool CONFIG_BLK_DEV_IDE_MODES n + define_bool CONFIG_BLK_DEV_HD n + fi + endmenu fi -endmenu mainmenu_option next_comment comment 'SCSI support' @@ -195,77 +196,57 @@ comment 'SCSI support' tristate 'SCSI support' CONFIG_SCSI if [ "$CONFIG_SCSI" != "n" ]; then - if [ "$CONFIG_SGI" = "y" -o "$CONFIG_DECSTATION" = "y" ]; then - comment ' SCSI support type (disk, tape, CDrom)' - - dep_tristate ' SCSI disk support' CONFIG_BLK_DEV_SD $CONFIG_SCSI - dep_tristate ' SCSI tape support' CONFIG_CHR_DEV_ST $CONFIG_SCSI - dep_tristate ' SCSI CDROM support' CONFIG_BLK_DEV_SR $CONFIG_SCSI - dep_tristate ' SCSI generic support' CONFIG_CHR_DEV_SG $CONFIG_SCSI - - comment 'Some SCSI devices (e.g. CD jukebox) support multiple LUNs' - - bool ' Probe all LUNs on each SCSI device' CONFIG_SCSI_MULTI_LUN - - bool ' Verbose SCSI error reporting' CONFIG_SCSI_CONSTANTS - - #mainmenu_option next_comment - comment 'SCSI low-level drivers' - if [ "$CONFIG_SGI" = "y" ]; then - dep_tristate 'SGI wd93 Scsi Driver' CONFIG_SCSI_SGIWD93 $CONFIG_SCSI - else - if [ "$CONFIG_TC" = "y" ]; then - dep_tristate 'DEC NCR53C94 Scsi Driver' CONFIG_SCSI_DECNCR $CONFIG_SCSI - fi - dep_tristate 'DEC SII Scsi Driver' CONFIG_SCSI_DECSII $CONFIG_SCSI - fi - else - source drivers/scsi/Config.in - fi + source drivers/scsi/Config.in fi endmenu +if [ "$CONFIG_DECSTATION" != "n" -a \ + "$CONFIG_SGI_IP22" != "n" ]; then + source drivers/i2o/Config.in +fi + if [ "$CONFIG_NET" = "y" ]; then mainmenu_option next_comment comment 'Network device support' bool 'Network device support' CONFIG_NETDEVICES if [ "$CONFIG_NETDEVICES" = "y" ]; then - if [ "$CONFIG_SGI" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" != "y" ]; then + + if [ "$CONFIG_SGI_IP22" != "y" -a \ + "$CONFIG_DECSTATION" != "y" -a \ + "$CONFIG_BAGET_MIPS" != "y" ]; then + source drivers/net/Config.in + + if [ "$CONFIG_ATM" = "y" ]; then + source drivers/atm/Config.in + fi else - tristate ' Dummy net driver support' CONFIG_DUMMY - tristate ' SLIP (serial line) support' CONFIG_SLIP + tristate 'Dummy net driver support' CONFIG_DUMMY + tristate 'SLIP (serial line) support' CONFIG_SLIP if [ "$CONFIG_SLIP" != "n" ]; then - bool ' CSLIP compressed headers' CONFIG_SLIP_COMPRESSED - bool ' Keepalive and linefill' CONFIG_SLIP_SMART + bool ' CSLIP compressed headers' CONFIG_SLIP_COMPRESSED + bool ' Keepalive and linefill' CONFIG_SLIP_SMART fi - tristate ' PPP (point-to-point) support' CONFIG_PPP + tristate 'PPP (point-to-point) support' CONFIG_PPP if [ ! "$CONFIG_PPP" = "n" ]; then - comment ' CCP compressors for PPP are only built as modules.' + comment 'CCP compressors for PPP are only built as modules.' + fi + if [ "$CONFIG_SGI_IP22" = "y" ]; then + bool 'SGI Seeq ethernet controller support' CONFIG_SGISEEQ + fi + if [ "$CONFIG_DECSTATION" = "y" ]; then + bool 'DEC LANCE ethernet controller support' CONFIG_DECLANCE + fi + if [ "$CONFIG_BAGET_MIPS" = "y" ]; then + tristate 'Baget AMD LANCE support' CONFIG_BAGETLANCE fi - if [ "$CONFIG_SGI" = "y" ]; then - bool ' SGI Seeq ethernet controller support' CONFIG_SGISEEQ - fi - fi - if [ "$CONFIG_DECSTATION" = "y" ]; then - bool ' DEC LANCE ethernet controller support' CONFIG_DECLANCE - fi - if [ "$CONFIG_BAGET_MIPS" = "y" ]; then - tristate ' Baget AMD LANCE support' CONFIG_BAGETLANCE - tristate ' Baget Backplane Shared Memory support' CONFIG_BAGETBSM fi fi endmenu fi -if [ "$CONFIG_SGI" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" != "y" ]; then - mainmenu_option next_comment - # comment 'AX.25 network device drivers' - - source drivers/net/hamradio/Config.in - endmenu - +if [ "$CONFIG_ISA" = "y" -o "$CONFIG_PCI" = "y" ]; then mainmenu_option next_comment comment 'ISDN subsystem' @@ -287,20 +268,20 @@ if [ "$CONFIG_SGI" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" endmenu fi -if [ "$CONFIG_DECSTATION" != "y" ]; then +if [ "$CONFIG_DECSTATION" != "n" -a \ + "$CONFIG_SGI_IP22" != "n" ]; then source drivers/char/Config.in -else +fi + +if [ "$CONFIG_DECSTATION" = "y" ]; then mainmenu_option next_comment - comment 'DECstation Character devices' + comment 'DECStation Character devices' bool 'Virtual terminal' CONFIG_VT if [ "$CONFIG_VT" = "y" ]; then bool 'Support for console on virtual terminal' CONFIG_VT_CONSOLE fi tristate 'Standard/generic (dumb) serial support' CONFIG_SERIAL - if [ "$CONFIG_SGI_IP22" = "y" ]; then - bool 'SGI PROM Console Support' CONFIG_SGI_PROM_CONSOLE - fi if [ "$CONFIG_SERIAL" = "y" ]; then bool 'DZ11 Serial Support' CONFIG_DZ if [ "$CONFIG_TC" = "y" ]; then @@ -314,32 +295,42 @@ else fi bool 'Keyboard Support' CONFIG_KEYBOARD bool 'Mouse Support' CONFIG_MOUSE -# bool 'Enhanced Real Time Clock Support' CONFIG_RTC + bool 'Enhanced Real Time Clock Support' CONFIG_RTC endmenu fi - -#source drivers/misc/Config.in - -source fs/Config.in - -if [ "$CONFIG_VT" = "y" ]; then +if [ "$CONFIG_SGI_IP22" = "y" ]; then mainmenu_option next_comment - comment 'Console drivers' - if [ "$CONFIG_SGI_IP22" = "y" ]; then + comment 'SGI Character devices' + bool 'Virtual terminal' CONFIG_VT + if [ "$CONFIG_VT" = "y" ]; then + bool 'Support for console on virtual terminal' CONFIG_VT_CONSOLE tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then define_bool CONFIG_DUMMY_CONSOLE y else define_bool CONFIG_FONT_8x16 y fi - else + bool 'SGI PROM Console Support' CONFIG_SGI_PROM_CONSOLE + fi + bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS + if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then + int 'Maximum number of Unix98 PTYs in use (0-2048)' CONFIG_UNIX98_PTY_COUNT 256 + fi + endmenu +fi + +source fs/Config.in + +if [ "$CONFIG_VT" = "y" ]; then + mainmenu_option next_comment + + comment 'Console drivers' if [ "$CONFIG_DECSTATION" != "y" ]; then bool 'VGA text console' CONFIG_VGA_CONSOLE fi - bool 'Support for frame buffer devices' CONFIG_FB - source drivers/video/Config.in - fi + bool 'Support for frame buffer devices' CONFIG_FB + source drivers/video/Config.in endmenu fi @@ -363,7 +354,6 @@ source drivers/usb/Config.in mainmenu_option next_comment comment 'Kernel hacking' -#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC bool 'Are you using a crosscompiler' CONFIG_CROSSCOMPILE if [ "$CONFIG_MODULES" = "y" ]; then bool ' Build fp execption handler module' CONFIG_MIPS_FPE_MODULE diff --git a/arch/mips/ddb5074/Makefile b/arch/mips/ddb5074/Makefile index a01684fa85d4..559e0bc8ed3b 100644 --- a/arch/mips/ddb5074/Makefile +++ b/arch/mips/ddb5074/Makefile @@ -8,7 +8,7 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... # -# $Id: Makefile,v 1.1 2000/01/26 00:07:44 ralf Exp $ +# $Id$ # .S.s: @@ -17,6 +17,6 @@ $(CC) $(CFLAGS) -c $< -o $*.o O_TARGET = ddb5074.a -O_OBJS = setup.o irq.o time.o prom.o pci.o int-handler.o nile4.o +O_OBJS = setup.o irq.o time.o prom.o pci.o pci-dma.o int-handler.o nile4.o include $(TOPDIR)/Rules.make diff --git a/arch/mips/ddb5074/int-handler.S b/arch/mips/ddb5074/int-handler.S index 43ef0ce64425..eab4d2dd928c 100644 --- a/arch/mips/ddb5074/int-handler.S +++ b/arch/mips/ddb5074/int-handler.S @@ -6,9 +6,9 @@ * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * * Copyright (C) 2000 Geert Uytterhoeven - * Sony Suprastructure Center Europe (SUPC-E), Brussels + * Sony Software Development Center Europe (SDCE), Brussels * - * $Id: int-handler.S,v 1.2 2000/01/27 02:06:56 ralf Exp $ + * $Id: int-handler.S,v 1.1 2000/01/26 00:07:44 ralf Exp $ */ #include diff --git a/arch/mips/ddb5074/irq.c b/arch/mips/ddb5074/irq.c index 4fee350e23e2..31813fe41d8a 100644 --- a/arch/mips/ddb5074/irq.c +++ b/arch/mips/ddb5074/irq.c @@ -2,7 +2,7 @@ * arch/mips/ddb5074/irq.c -- NEC DDB Vrc-5074 interrupt routines * * Copyright (C) 2000 Geert Uytterhoeven - * Sony Suprastructure Center Europe (SUPC-E), Brussels + * Sony Software Development Center Europe (SDCE), Brussels * * $Id: irq.c,v 1.1 2000/01/26 00:07:44 ralf Exp $ */ @@ -30,7 +30,7 @@ extern asmlinkage void i8259_do_irq(int irq, struct pt_regs *regs); extern asmlinkage void do_IRQ(int irq, struct pt_regs * regs); -static void no_action(int cpl, void *dev_id, struct pt_regs *regs) +void no_action(int cpl, void *dev_id, struct pt_regs *regs) { } diff --git a/arch/mips/ddb5074/nile4.c b/arch/mips/ddb5074/nile4.c index 3cd4ac50f827..35793b605397 100644 --- a/arch/mips/ddb5074/nile4.c +++ b/arch/mips/ddb5074/nile4.c @@ -2,9 +2,9 @@ * arch/mips/ddb5074/nile4.c -- NEC Vrc-5074 Nile 4 support routines * * Copyright (C) 2000 Geert Uytterhoeven - * Sony Suprastructure Center Europe (SUPC-E), Brussels + * Sony Software Development Center Europe (SDCE), Brussels * - * $Id: nile4.c,v 1.1 2000/01/26 00:07:44 ralf Exp $ + * $Id$ */ #include diff --git a/arch/mips/ddb5074/pci-dma.c b/arch/mips/ddb5074/pci-dma.c new file mode 100644 index 000000000000..1309e5eee504 --- /dev/null +++ b/arch/mips/ddb5074/pci-dma.c @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2000 Ani Joshi + * + * + * Dynamic DMA mapping support. + * + * swiped from i386, and cloned for MIPS by Geert. + * + */ + +#include +#include +#include +#include +#include + +void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, + dma_addr_t *dma_handle) +{ + void *ret; + int gfp = GFP_ATOMIC; + + if (hwdev == NULL || hwdev->dma_mask != 0xffffffff) + gfp |= GFP_DMA; + ret = (void *)__get_free_pages(gfp, get_order(size)); + + if (ret != NULL) { + memset(ret, 0, size); + *dma_handle = virt_to_bus(ret); + } + return ret; +} + +void pci_free_consistent(struct pci_dev *hwdev, size_t size, + void *vaddr, dma_addr_t dma_handle) +{ + free_pages((unsigned long)vaddr, get_order(size)); +} diff --git a/arch/mips/ddb5074/pci.c b/arch/mips/ddb5074/pci.c index e0f39c666d46..0a76788500b2 100644 --- a/arch/mips/ddb5074/pci.c +++ b/arch/mips/ddb5074/pci.c @@ -3,7 +3,7 @@ * * Copyright (C) 2000 Geert Uytterhoeven * Albert Dorofeev - * Sony Suprastructure Center Europe (SUPC-E), Brussels + * Sony Software Development Center Europe (SDCE), Brussels * * $Id: pci.c,v 1.4 2000/02/18 00:02:17 ralf Exp $ */ @@ -168,163 +168,136 @@ struct pci_ops nile4_pci_ops = { nile4_pci_write_config_dword }; +struct { + struct resource ram; + struct resource flash; + struct resource isa_io; + struct resource pci_io; + struct resource isa_mem; + struct resource pci_mem; + struct resource nile4; + struct resource boot; +} ddb5074_resources = { + { "RAM", 0x00000000, 0x03ffffff, + IORESOURCE_MEM | PCI_BASE_ADDRESS_MEM_TYPE_64 }, + { "Flash ROM", 0x04000000, 0x043fffff }, + { "Nile4 ISA I/O", 0x06000000, 0x060fffff }, + { "Nile4 PCI I/O", 0x06100000, 0x07ffffff }, + { "Nile4 ISA mem", 0x08000000, 0x08ffffff, IORESOURCE_MEM }, + { "Nile4 PCI mem", 0x09000000, 0x0fffffff, IORESOURCE_MEM }, + { "Nile4 ctrl", 0x1fa00000, 0x1fbfffff, + IORESOURCE_MEM | PCI_BASE_ADDRESS_MEM_TYPE_64 }, + { "Boot ROM", 0x1fc00000, 0x1fffffff } +}; -static void __init pcibios_claim_resources(struct list_head *bus_list) +static void __init ddb5074_pci_fixup(void) { - struct list_head *ln, *dn; - struct pci_bus *bus; struct pci_dev *dev; - int idx; - - for (ln = bus_list->next; ln != bus_list; ln = ln->next) { - bus = pci_bus_b(ln); - for (dn = bus->devices.next; dn != &bus->devices; dn = dn->next) { - dev = pci_dev_b(dn); - for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) { - struct resource *r = &dev->resource[idx]; - struct resource *pr; - if (!r->start) - continue; - pr = pci_find_parent_resource(dev, r); - if (!pr || request_resource(pr, r) < 0) { - printk(KERN_ERR "PCI: Address space collision on region %d of device %s\n", idx, dev->name); - /* We probably should disable the region, shouldn't we? */ - } - } + + pci_for_each_dev(dev) { + if (dev->vendor == PCI_VENDOR_ID_NEC && + dev->device == PCI_DEVICE_ID_NEC_NILE4) { + /* + * The first 64-bit PCI base register should point to the Nile4 + * control registers. Unfortunately this isn't the case, so we fix + * it ourselves. This allows the serial driver to find the UART. + */ + dev->resource[0] = ddb5074_resources.nile4; + request_resource(&iomem_resource, &dev->resource[0]); + /* + * The second 64-bit PCI base register points to the first memory + * bank. Unfortunately the address is wrong, so we fix it (again). + */ + dev->resource[2] = ddb5074_resources.ram; + request_resource(&iomem_resource, &dev->resource[2]); + } else if (dev->vendor == PCI_VENDOR_ID_AL && + dev->device == PCI_DEVICE_ID_AL_M7101) { + /* + * It's nice to have the LEDs on the GPIO pins available for + * debugging + */ + extern struct pci_dev *pci_pmu; + u8 t8; + + pci_pmu = dev; /* for LEDs D2 and D3 */ + /* Program the lines for LEDs D2 and D3 to output */ + nile4_pci_read_config_byte(dev, 0x7d, &t8); + t8 |= 0xc0; + nile4_pci_write_config_byte(dev, 0x7d, t8); + /* Turn LEDs D2 and D3 off */ + nile4_pci_read_config_byte(dev, 0x7e, &t8); + t8 |= 0xc0; + nile4_pci_write_config_byte(dev, 0x7e, t8); } - pcibios_claim_resources(&bus->children); } } - -void pcibios_init(void) +static void __init pcibios_fixup_irqs(void) { - printk("PCI: Probing PCI hardware\n"); - ioport_resource.end = 0x1ffffff; - pci_scan_bus(0, &nile4_pci_ops, NULL); - pcibios_claim_resources(&pci_root_buses); -} - -void pcibios_fixup_bus(struct pci_bus *bus) -{ - struct list_head *dn; struct pci_dev *dev; - extern struct pci_dev *pci_pmu; /* for LEDs D2 and D3 */ - int slot_num, func_num; - u8 t8; - - /* - * FIXME: PMON doesn't autoconfigure the PCI devices - * For now we just hardcode them for our configuration - */ - printk("PCI: Configuring PCI devices (hardcoded)\n"); - for (dn = bus->devices.next; dn != &bus->devices; dn = dn->next) { - dev = pci_dev_b(dn); + int slot_num; + pci_for_each_dev(dev) { slot_num = PCI_SLOT(dev->devfn); - func_num = PCI_FUNC(dev->devfn); - printk(" Device %2d: ", slot_num); switch (slot_num) { case 0: - printk("[onboard] Acer Labs M1533 Aladdin IV\n"); dev->irq = nile4_to_irq(NILE4_INT_INTE); break; case 1: - printk("[onboard] DEC DC21140\n"); dev->irq = nile4_to_irq(NILE4_INT_INTA); - dev->resource[0].start = 0x100000; - dev->resource[0].end = dev->resource[0].start+0x7f; - nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, - dev->resource[0].start); - dev->resource[1].start = 0x1000000; - dev->resource[1].end = dev->resource[1].start+0x7f; - nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, - dev->resource[1].start); break; - case 2: - printk("[slot 1] Realtek 8029\n"); + case 2: /* slot 1 */ dev->irq = nile4_to_irq(NILE4_INT_INTA); - dev->resource[0].start = 0x800000; - dev->resource[0].end = dev->resource[0].start+0x1f; - nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, - dev->resource[0].start); break; - case 3: - printk("[slot 2] DEC DC21140 (#2)\n"); + case 3: /* slot 2 */ dev->irq = nile4_to_irq(NILE4_INT_INTB); - dev->resource[0].start = 0x1000000; - dev->resource[0].end = dev->resource[0].start+0x7f; - nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, - dev->resource[0].start); - dev->resource[1].start = 0x4000000; - dev->resource[1].end = dev->resource[1].start+0x7f; - nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, - dev->resource[1].start); break; - case 4: - printk("[slot 3] Promise Technology IDE UltraDMA/33"); - printk(" or 3Com 3c905 :-)\n"); + case 4: /* slot 3 */ dev->irq = nile4_to_irq(NILE4_INT_INTC); - dev->resource[0].start = 0x1800000; - dev->resource[0].end = dev->resource[0].start+0x7fffff; - nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, - dev->resource[0].start); break; case 5: - printk("[onboard] NEC Vrc-5074 Nile 4 Host Bridge\n"); /* * Fixup so the serial driver can use the UART */ dev->irq = nile4_to_irq(NILE4_INT_UART); - dev->resource[0].start = PHYSADDR(NILE4_BASE); - dev->resource[0].end = dev->resource[0].start+NILE4_SIZE-1; - dev->resource[0].flags = IORESOURCE_MEM | - PCI_BASE_ADDRESS_MEM_TYPE_64; - - break; - case 10: - printk("[onboard] Acer Labs M7101 PMU\n"); - pci_pmu = dev; - /* Program the lines for LEDs D2 and D3 to output */ - nile4_pci_read_config_byte(dev, 0x7d, &t8); - t8 |= 0xc0; - nile4_pci_write_config_byte(dev, 0x7d, t8); - /* Turn LEDs D2 and D3 off */ - nile4_pci_read_config_byte(dev, 0x7e, &t8); - t8 |= 0xc0; - nile4_pci_write_config_byte(dev, 0x7e, t8); break; case 13: - printk("[onboard] Acer Labs M5237 USB\n"); dev->irq = nile4_to_irq(NILE4_INT_INTE); - dev->resource[0].start = 0x1001000; - dev->resource[0].end = dev->resource[0].start+0xfff; - nile4_pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, - dev->resource[0].start); break; default: - printk("\n"); break; } } } -char *pcibios_setup (char *str) +void __init pcibios_init(void) { - return str; + printk("PCI: Probing PCI hardware\n"); + ioport_resource.end = 0x1ffffff; /* 32 MB */ + iomem_resource.end = 0x1fffffff; /* 512 MB */ + /* `ram' and `nile4' are requested through the Nile4 pci_dev */ + request_resource(&iomem_resource, &ddb5074_resources.flash); + request_resource(&iomem_resource, &ddb5074_resources.isa_io); + request_resource(&iomem_resource, &ddb5074_resources.pci_io); + request_resource(&iomem_resource, &ddb5074_resources.isa_mem); + request_resource(&iomem_resource, &ddb5074_resources.pci_mem); + request_resource(&iomem_resource, &ddb5074_resources.boot); + + pci_scan_bus(0, &nile4_pci_ops, NULL); + ddb5074_pci_fixup(); + pci_assign_unassigned_resources(); + pci_set_bus_ranges(); + pcibios_fixup_irqs(); } -void __init pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +void __init pcibios_fixup_bus(struct pci_bus *bus) { - unsigned long where, size; - u32 reg; - - where = PCI_BASE_ADDRESS_0 + (resource * 4); - size = res->end - res->start; - pci_read_config_dword(dev, where, ®); - reg = (reg & size) | (((u32)(res->start - root->start)) & ~size); - pci_write_config_dword(dev, where, reg); + bus->resource[1] = &ddb5074_resources.pci_mem; +} + +char *pcibios_setup (char *str) +{ + return str; } void __init pcibios_update_irq(struct pci_dev *dev, int irq) @@ -341,15 +314,85 @@ void __init pcibios_fixup_pbus_ranges(struct pci_bus *bus, ranges->mem_end -= bus->resource[1]->start; } -int __init pcibios_enable_device(struct pci_dev *dev) +int pcibios_enable_resources(struct pci_dev *dev) +{ + u16 cmd, old_cmd; + int idx; + struct resource *r; + + pci_read_config_word(dev, PCI_COMMAND, &cmd); + old_cmd = cmd; + for(idx=0; idx<6; idx++) { + r = &dev->resource[idx]; + if (!r->start && r->end) { + printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name); + return -EINVAL; + } + if (r->flags & IORESOURCE_IO) + cmd |= PCI_COMMAND_IO; + if (r->flags & IORESOURCE_MEM) + cmd |= PCI_COMMAND_MEMORY; + } + if (cmd != old_cmd) { + printk("PCI: Enabling device %s (%04x -> %04x)\n", dev->slot_name, old_cmd, cmd); + pci_write_config_word(dev, PCI_COMMAND, cmd); + } + return 0; +} + +int pcibios_enable_device(struct pci_dev *dev) +{ + return pcibios_enable_resources(dev); +} + +void pcibios_update_resource(struct pci_dev *dev, struct resource *root, + struct resource *res, int resource) +{ + u32 new, check; + int reg; + + new = res->start | (res->flags & PCI_REGION_FLAG_MASK); + if (resource < 6) { + reg = PCI_BASE_ADDRESS_0 + 4*resource; + } else if (resource == PCI_ROM_RESOURCE) { + res->flags |= PCI_ROM_ADDRESS_ENABLE; + reg = dev->rom_base_reg; + } else { + /* Somebody might have asked allocation of a non-standard resource */ + return; + } + + pci_write_config_dword(dev, reg, new); + pci_read_config_dword(dev, reg, &check); + if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) { + printk(KERN_ERR "PCI: Error while updating region " + "%s/%d (%08x != %08x)\n", dev->slot_name, resource, + new, check); + } +} + +void pcibios_align_resource(void *data, struct resource *res, + unsigned long size) { - printk("pcibios_enable_device for %04x:%04x\n", dev->vendor, dev->device); - panic("pcibios_enable_device: not yet implemented\n"); + struct pci_dev *dev = data; + + if (res->flags & IORESOURCE_IO) { + unsigned long start = res->start; + + /* We need to avoid collisions with `mirrored' VGA ports + and other strange ISA hardware, so we always want the + addresses kilobyte aligned. */ + if (size > 0x100) { + printk(KERN_ERR "PCI: I/O Region %s/%d too large" + " (%ld bytes)\n", dev->slot_name, + dev->resource - res, size); + } + + start = (start + 1024 - 1) & ~(1024 - 1); + res->start = start; + } } -void __init pcibios_align_resource(void *data, struct resource *res, - unsigned long size) -{} struct pci_fixup pcibios_fixups[] = {}; diff --git a/arch/mips/ddb5074/prom.c b/arch/mips/ddb5074/prom.c index 247297bcf4e8..b85a3342b94a 100644 --- a/arch/mips/ddb5074/prom.c +++ b/arch/mips/ddb5074/prom.c @@ -2,9 +2,9 @@ * arch/mips/ddb5074/prom.c -- NEC DDB Vrc-5074 PROM routines * * Copyright (C) 2000 Geert Uytterhoeven - * Sony Suprastructure Center Europe (SUPC-E), Brussels + * Sony Software Development Center Europe (SDCE), Brussels * - * $Id: prom.c,v 1.2 2000/02/14 17:07:36 ralf Exp $ + * $Id: prom.c,v 1.1 2000/01/26 00:07:44 ralf Exp $ */ #include diff --git a/arch/mips/ddb5074/setup.c b/arch/mips/ddb5074/setup.c index 03450a4417a5..d2f48c27fe89 100644 --- a/arch/mips/ddb5074/setup.c +++ b/arch/mips/ddb5074/setup.c @@ -2,9 +2,9 @@ * arch/mips/ddb5074/setup.c -- NEC DDB Vrc-5074 setup routines * * Copyright (C) 2000 Geert Uytterhoeven - * Sony Suprastructure Center Europe (SUPC-E), Brussels + * Sony Software Development Center Europe (SDCE), Brussels * - * $Id: setup.c,v 1.2 2000/02/14 17:07:36 ralf Exp $ + * $Id: setup.c,v 1.1 2000/01/26 00:07:44 ralf Exp $ */ #include @@ -40,12 +40,12 @@ extern void console_setup(char *); extern struct rtc_ops ddb_rtc_ops; +static void (*back_to_prom)(void) = (void (*)(void))0xbfc00000; + static void ddb_machine_restart(char *command) { u32 t; - // FIXME: This doesn't seem to work... - printk("Restarting DDB Vrc-5074..."); /* PCI cold reset */ t = nile4_in32(NILE4_PCICTRL+4); t |= 0x40000000; @@ -54,8 +54,8 @@ static void ddb_machine_restart(char *command) t = nile4_in32(NILE4_CPUSTAT); t |= 1; nile4_out32(NILE4_CPUSTAT, t); - printk("Restart failed!\n"); - do {} while (1); + /* Call the PROM */ + back_to_prom(); } static void ddb_machine_halt(void) @@ -91,6 +91,8 @@ static void __init ddb_time_init(struct irqaction *irq) void __init ddb_setup(void) { + extern int panic_timeout; + irq_setup = ddb_irq_setup; mips_io_port_base = NILE4_PCI_IO_BASE; isa_slot_offset = NILE4_PCI_MEM_BASE; @@ -106,6 +108,9 @@ void __init ddb_setup(void) _machine_power_off = ddb_machine_power_off; rtc_ops = &ddb_rtc_ops; + + /* Reboot on panic */ + panic_timeout = 180; } int __init page_is_ram(unsigned long pagenr) diff --git a/arch/mips/ddb5074/time.c b/arch/mips/ddb5074/time.c index 7cc61eea54fa..14503c66a4f9 100644 --- a/arch/mips/ddb5074/time.c +++ b/arch/mips/ddb5074/time.c @@ -1,8 +1,8 @@ /* - * arch.mips/ddb5074/time.c -- Timer routines + * arch/mips/ddb5074/time.c -- Timer routines * * Copyright (C) 2000 Geert Uytterhoeven - * Sony Suprastructure Center Europe (SUPC-E), Brussels + * Sony Software Development Center Europe (SDCE), Brussels * * $Id* */ diff --git a/arch/mips/dec/irq.c b/arch/mips/dec/irq.c index 5d12eca3db2b..7551ae6814d4 100644 --- a/arch/mips/dec/irq.c +++ b/arch/mips/dec/irq.c @@ -31,6 +31,8 @@ extern volatile unsigned int *isr; /* address of the interrupt status register extern volatile unsigned int *imr; /* address of the interrupt mask register */ extern decint_t dec_interrupt[NR_INTS]; +irq_cpustat_t irq_stat [NR_CPUS]; + unsigned int local_bh_count[NR_CPUS]; unsigned int local_irq_count[NR_CPUS]; unsigned long spurious_count = 0; diff --git a/arch/mips/dec/prom/Makefile b/arch/mips/dec/prom/Makefile index c4bc1564add4..c139bbda302d 100644 --- a/arch/mips/dec/prom/Makefile +++ b/arch/mips/dec/prom/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 2000/02/05 06:47:08 ralf Exp $ +# $Id: Makefile,v 1.1 1999/01/17 03:49:44 ralf Exp $ # Makefile for the DECstation prom monitor library routines # under Linux. # diff --git a/arch/mips/dec/prom/init.c b/arch/mips/dec/prom/init.c index e275b8be82bb..f81ee77ca5e3 100644 --- a/arch/mips/dec/prom/init.c +++ b/arch/mips/dec/prom/init.c @@ -3,7 +3,7 @@ * * Copyright (C) 1998 Harald Koerfgen * - * $Id: init.c,v 1.4 1999/10/09 00:00:58 ralf Exp $ + * $Id: init.c,v 1.3 1999/08/09 19:43:13 harald Exp $ */ #include #include diff --git a/arch/mips/dec/prom/memory.c b/arch/mips/dec/prom/memory.c index 88d8a0bc1ed3..a093c45bb829 100644 --- a/arch/mips/dec/prom/memory.c +++ b/arch/mips/dec/prom/memory.c @@ -3,7 +3,7 @@ * * Copyright (C) 1998 Harald Koerfgen, Frieder Streffer and Paul M. Antoine * - * $Id: memory.c,v 1.4 2000/02/13 20:52:05 harald Exp $ + * $Id: memory.c,v 1.3 1999/10/09 00:00:58 ralf Exp $ */ #include #include diff --git a/arch/mips/dec/reset.c b/arch/mips/dec/reset.c index 75e18c215dbf..e4d07608f407 100644 --- a/arch/mips/dec/reset.c +++ b/arch/mips/dec/reset.c @@ -1,5 +1,5 @@ /* - * $Id: reset.c,v 1.4 1999/04/11 17:06:16 harald Exp $ + * $Id: $ * * Reset a DECstation machine. * diff --git a/arch/mips/dec/rtc-dec.c b/arch/mips/dec/rtc-dec.c index 5ee0fec3527e..f54bc89e2ab0 100644 --- a/arch/mips/dec/rtc-dec.c +++ b/arch/mips/dec/rtc-dec.c @@ -1,5 +1,5 @@ -/* $Id: rtc-dec.c,v 1.1 1999/01/17 03:49:42 ralf Exp $ +/* $Id: rtc-jazz.c,v 1.2 1998/06/25 20:19:14 ralf Exp $ * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/dec/serial.c b/arch/mips/dec/serial.c index 6cb764d02e9d..6c82b6cf816c 100644 --- a/arch/mips/dec/serial.c +++ b/arch/mips/dec/serial.c @@ -31,11 +31,11 @@ extern int dz_init(void); #ifdef CONFIG_SERIAL_CONSOLE #ifdef CONFIG_ZS -extern long zs_serial_console_init(long, long); +extern void zs_serial_console_init(void); #endif #ifdef CONFIG_DZ -extern long dz_serial_console_init(long, long); +extern void dz_serial_console_init(void); #endif #endif @@ -66,6 +66,8 @@ int __init rs_init(void) #endif } +__initcall(rs_init); + #endif #ifdef CONFIG_SERIAL_CONSOLE @@ -73,26 +75,24 @@ int __init rs_init(void) /* serial_console_init handles the special case of starting * up the console on the serial port */ -long __init serial_console_init(long kmem_start, long kmem_end) +void __init serial_console_init(void) { #if defined(CONFIG_ZS) && defined(CONFIG_DZ) if (IOASIC) - kmem_start = zs_serial_console_init(kmem_start, kmem_end); + zs_serial_console_init(); else - kmem_start = dz_serial_console_init(kmem_start, kmem_end); + dz_serial_console_init(); #else #ifdef CONFIG_ZS - kmem_start = zs_serial_console_init(kmem_start, kmem_end); + zs_serial_console_init(); #endif #ifdef CONFIG_DZ - kmem_start = dz_serial_console_init(kmem_start, kmem_end); + dz_serial_console_init(); #endif #endif - - return kmem_start; } #endif diff --git a/arch/mips/defconfig b/arch/mips/defconfig index 16a01ec9bba8..d4451245a13b 100644 --- a/arch/mips/defconfig +++ b/arch/mips/defconfig @@ -20,8 +20,9 @@ CONFIG_EXPERIMENTAL=y CONFIG_SGI_IP22=y # CONFIG_SNI_RM200_PCI is not set # CONFIG_SBUS is not set -# CONFIG_PCI is not set +CONFIG_ARC32=y # CONFIG_ISA is not set +# CONFIG_PCI is not set # # CPU selection @@ -50,24 +51,18 @@ CONFIG_FORWARD_KEYBOARD=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_NET=y -# CONFIG_HOTPLUG is not set -# CONFIG_PCMCIA is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # -# Loadable module support +# Parallel port support # +# CONFIG_PARPORT is not set CONFIG_MODULES=y # CONFIG_MODVERSIONS is not set CONFIG_KMOD=y - -# -# Plug and Play configuration -# -# CONFIG_PNP is not set -# CONFIG_ISAPNP is not set +# CONFIG_PCMCIA is not set # # Block devices @@ -75,14 +70,21 @@ CONFIG_KMOD=y # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_DEV_XD is not set # CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set # # Additional Block Devices # # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_LVM is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_RAID15_DANGEROUS is not set # CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -133,13 +135,6 @@ CONFIG_IP_PNP_BOOTP=y # # CONFIG_NET_SCHED is not set -# -# ATA/IDE/MFM/RLL support -# -# CONFIG_IDE is not set -# CONFIG_BLK_DEV_IDE_MODES is not set -# CONFIG_BLK_DEV_HD is not set - # # SCSI support # @@ -174,12 +169,12 @@ CONFIG_SCSI_SGIWD93=y # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set # CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_IPS is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_DMA is not set @@ -187,155 +182,39 @@ CONFIG_SCSI_SGIWD93=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GENERIC_NCR5380 is not set -# CONFIG_SCSI_PPA is not set -# CONFIG_SCSI_IMM is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_NCR53C7xx is not set # CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PCI2000 is not set # CONFIG_SCSI_PCI2220I is not set # CONFIG_SCSI_PSI240I is not set # CONFIG_SCSI_QLOGIC_FAS is not set -# CONFIG_SCSI_SEAGATE is not set # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set -# CONFIG_SCSI_ULTRASTOR is not set # CONFIG_SCSI_DEBUG is not set # # Network device support # CONFIG_NETDEVICES=y - -# -# ARCnet devices -# -# CONFIG_ARCNET is not set # CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_EQUALIZER is not set -# CONFIG_NET_SB1000 is not set - -# -# Ethernet (10 or 100Mbit) -# -# CONFIG_NET_ETHERNET is not set - -# -# Ethernet (1000 Mbit) -# -# CONFIG_YELLOWFIN is not set -# CONFIG_ACENIC is not set -# CONFIG_SK98LIN is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PLIP is not set -# CONFIG_PPP is not set # CONFIG_SLIP is not set +# CONFIG_PPP is not set +CONFIG_SGISEEQ=y # -# Wireless LAN (non-hamradio) -# -# CONFIG_NET_RADIO is not set - -# -# Token Ring devices -# -# CONFIG_TR is not set -# CONFIG_NET_FC is not set -# CONFIG_RCPCI is not set -# CONFIG_SHAPER is not set - -# -# Wan interfaces -# -# CONFIG_WAN is not set - -# -# AX.25 network device drivers -# -# CONFIG_MKISS is not set -# CONFIG_6PACK is not set -# CONFIG_BPQETHER is not set -# CONFIG_DMASCC is not set -# CONFIG_SCC is not set -# CONFIG_BAYCOM_SER_FDX is not set -# CONFIG_BAYCOM_SER_HDX is not set -# CONFIG_BAYCOM_PAR is not set -# CONFIG_BAYCOM_EPP is not set -# CONFIG_SOUNDMODEM is not set -# CONFIG_YAM is not set - -# -# ISDN subsystem -# -# CONFIG_ISDN is not set - -# -# Old CD-ROM drivers (not SCSI, not IDE) -# -# CONFIG_CD_NO_IDESCSI is not set - -# -# Character devices +# SGI Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y -# CONFIG_SERIAL is not set -# CONFIG_SERIAL_EXTENDED is not set -# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_SGI_NEWPORT_CONSOLE=y +CONFIG_FONT_8x16=y +# CONFIG_SGI_PROM_CONSOLE is not set # CONFIG_UNIX98_PTYS is not set -# CONFIG_PRINTER is not set -# CONFIG_PPDEV is not set - -# -# I2C support -# -# CONFIG_I2C is not set - -# -# Mice -# -# CONFIG_BUSMOUSE is not set -CONFIG_MOUSE=y -CONFIG_PSMOUSE=y -# CONFIG_82C710_MOUSE is not set -# CONFIG_PC110_PAD is not set - -# -# Joysticks -# -# CONFIG_JOYSTICK is not set -# CONFIG_QIC02_TAPE is not set - -# -# Watchdog Cards -# -# CONFIG_WATCHDOG is not set -# CONFIG_NVRAM is not set -# CONFIG_RTC is not set - -# -# Video For Linux -# -# CONFIG_VIDEO_DEV is not set -# CONFIG_DTLK is not set -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set - -# -# Ftape, the floppy tape device driver -# -# CONFIG_FTAPE is not set -# CONFIG_DRM is not set -# CONFIG_DRM_TDFX is not set -# CONFIG_AGP is not set - -# -# USB support -# -# CONFIG_USB is not set # # File systems @@ -344,6 +223,7 @@ CONFIG_PSMOUSE=y CONFIG_AUTOFS_FS=y CONFIG_AUTOFS4_FS=y # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -353,10 +233,12 @@ CONFIG_AUTOFS4_FS=y # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS is not set CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set # CONFIG_MINIX_FS is not set # CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set @@ -364,17 +246,22 @@ CONFIG_PROC_FS=y # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set CONFIG_ROOT_NFS=y CONFIG_NFSD=y # CONFIG_NFSD_V3 is not set @@ -382,6 +269,16 @@ CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types @@ -392,16 +289,25 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_AMIGA_PARTITION is not set # CONFIG_ATARI_PARTITION is not set # CONFIG_MAC_PARTITION is not set -# CONFIG_MSDOS_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set CONFIG_SGI_PARTITION=y +# CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set # CONFIG_NLS is not set # # Console drivers # -CONFIG_SGI_NEWPORT_CONSOLE=y -CONFIG_FONT_8x16=y +# CONFIG_VGA_CONSOLE is not set +# CONFIG_FB is not set + +# +# Frame-buffer support +# +# CONFIG_FB is not set # # Sound @@ -412,9 +318,15 @@ CONFIG_FONT_8x16=y # SGI devices # CONFIG_SGI_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set CONFIG_SGI_DS1286=y # CONFIG_SGI_NEWPORT_GFX is not set +# +# USB support +# +# CONFIG_USB is not set + # # Kernel hacking # diff --git a/arch/mips/defconfig-decstation b/arch/mips/defconfig-decstation index 53fa16f7ed4d..add67fef1da2 100644 --- a/arch/mips/defconfig-decstation +++ b/arch/mips/defconfig-decstation @@ -1,5 +1,5 @@ # -# Automatically generated by make menuconfig: don't edit +# Automatically generated make config: don't edit # # @@ -19,6 +19,9 @@ CONFIG_DECSTATION=y # CONFIG_OLIVETTI_M700 is not set # CONFIG_SGI_IP22 is not set # CONFIG_SNI_RM200_PCI is not set +# CONFIG_SBUS is not set +# CONFIG_ISA is not set +# CONFIG_PCI is not set # # CPU selection @@ -45,47 +48,41 @@ CONFIG_ELF_KERNEL=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_NET=y - -# -# PCMCIA/CardBus support -# -# CONFIG_PCMCIA is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # -# Loadable module support +# Parallel port support # +# CONFIG_PARPORT is not set CONFIG_MODULES=y # CONFIG_MODVERSIONS is not set CONFIG_KMOD=y - -# -# TURBOchannel support -# CONFIG_TC=y +# CONFIG_PCMCIA is not set # -# Plug and Play configuration +# Block devices # -# CONFIG_PNP is not set -# CONFIG_ISAPNP is not set +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set # -# Block devices +# Additional Block Devices # -# CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_DEV_IDE is not set -# CONFIG_BLK_DEV_HD_ONLY is not set # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_LVM is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_RAID15_DANGEROUS is not set # CONFIG_BLK_DEV_RAM is not set -# CONFIG_BLK_DEV_XD is not set -# CONFIG_PARIDE is not set -# CONFIG_BLK_DEV_IDE_MODES is not set -# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -107,10 +104,18 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_NET_IPGRE is not set # CONFIG_IP_ALIAS is not set # CONFIG_SYN_COOKIES is not set + +# +# (it is safe to leave these untouched) +# # CONFIG_SKB_LARGE is not set # CONFIG_IPV6 is not set # CONFIG_KHTTPD is not set # CONFIG_ATM is not set + +# +# +# # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_DECNET is not set @@ -129,33 +134,65 @@ CONFIG_IP_PNP_BOOTP=y # CONFIG_NET_SCHED is not set # -# Telephony Support +# SCSI support # -# CONFIG_PHONE is not set -# CONFIG_PHONE_IXJ is not set +CONFIG_SCSI=y # -# SCSI support +# SCSI support type (disk, tape, CD-ROM) # -CONFIG_SCSI=y CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 # CONFIG_CHR_DEV_ST is not set # CONFIG_BLK_DEV_SR is not set # CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set # CONFIG_SCSI_MULTI_LUN is not set CONFIG_SCSI_CONSTANTS=y -CONFIG_SCSI_DECNCR=y -# CONFIG_SCSI_DECSII is not set +# CONFIG_SCSI_LOGGING is not set # -# I2O device support +# SCSI low-level drivers # -# CONFIG_I2O is not set -# CONFIG_I2O_PCI is not set -# CONFIG_I2O_BLOCK is not set -# CONFIG_I2O_LAN is not set -# CONFIG_I2O_SCSI is not set -# CONFIG_I2O_PROC is not set +CONFIG_SCSI_DECNCR=y +# CONFIG_SCSI_DECSII is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_DEBUG is not set # # Network device support @@ -167,7 +204,7 @@ CONFIG_NETDEVICES=y CONFIG_DECLANCE=y # -# DECstation Character devices +# DECStation Character devices # # CONFIG_VT is not set CONFIG_SERIAL=y @@ -177,29 +214,26 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_UNIX98_PTYS is not set # CONFIG_KEYBOARD is not set # CONFIG_MOUSE is not set +# CONFIG_RTC is not set # -# USB support -# -# CONFIG_USB is not set - -# -# Filesystems +# File systems # # CONFIG_QUOTA is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set -# CONFIG_BFS_FS_WRITE is not set # CONFIG_FAT_FS is not set # CONFIG_MSDOS_FS is not set # CONFIG_UMSDOS_FS is not set # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS is not set # CONFIG_ISO9660_FS is not set # CONFIG_JOLIET is not set # CONFIG_MINIX_FS is not set @@ -207,6 +241,9 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_QNX4FS_RW is not set @@ -224,6 +261,7 @@ CONFIG_EXT2_FS=y # # CONFIG_CODA_FS is not set # CONFIG_NFS_FS is not set +# CONFIG_NFS_V3 is not set # CONFIG_ROOT_NFS is not set # CONFIG_NFSD is not set # CONFIG_NFSD_V3 is not set @@ -231,6 +269,16 @@ CONFIG_EXT2_FS=y # CONFIG_LOCKD is not set # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types @@ -250,6 +298,11 @@ CONFIG_ULTRIX_PARTITION=y # CONFIG_SUN_PARTITION is not set # CONFIG_NLS is not set +# +# USB support +# +# CONFIG_USB is not set + # # Kernel hacking # diff --git a/arch/mips/defconfig-ip22 b/arch/mips/defconfig-ip22 index 6272b0d18018..d4451245a13b 100644 --- a/arch/mips/defconfig-ip22 +++ b/arch/mips/defconfig-ip22 @@ -19,6 +19,10 @@ CONFIG_EXPERIMENTAL=y # CONFIG_OLIVETTI_M700 is not set CONFIG_SGI_IP22=y # CONFIG_SNI_RM200_PCI is not set +# CONFIG_SBUS is not set +CONFIG_ARC32=y +# CONFIG_ISA is not set +# CONFIG_PCI is not set # # CPU selection @@ -47,50 +51,40 @@ CONFIG_FORWARD_KEYBOARD=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_NET=y - -# -# PCMCIA/CardBus support -# -# CONFIG_PCMCIA is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # -# Loadable module support +# Parallel port support # +# CONFIG_PARPORT is not set CONFIG_MODULES=y # CONFIG_MODVERSIONS is not set CONFIG_KMOD=y - -# -# Plug and Play configuration -# -# CONFIG_PNP is not set -# CONFIG_ISAPNP is not set +# CONFIG_PCMCIA is not set # # Block devices # # CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_DEV_IDE is not set - -# -# Please see Documentation/ide.txt for help/info on IDE drives -# -# CONFIG_BLK_DEV_HD_ONLY is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set # # Additional Block Devices # # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_LVM is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_RAID15_DANGEROUS is not set # CONFIG_BLK_DEV_RAM is not set -# CONFIG_BLK_DEV_XD is not set -# CONFIG_PARIDE is not set -# CONFIG_BLK_DEV_IDE_MODES is not set -# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -141,12 +135,6 @@ CONFIG_IP_PNP_BOOTP=y # # CONFIG_NET_SCHED is not set -# -# Telephony Support -# -# CONFIG_PHONE is not set -# CONFIG_PHONE_IXJ is not set - # # SCSI support # @@ -158,7 +146,6 @@ CONFIG_SCSI=y CONFIG_BLK_DEV_SD=y CONFIG_SD_EXTRA_DEVS=40 CONFIG_CHR_DEV_ST=y -CONFIG_ST_EXTRA_DEVS=2 CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set CONFIG_SR_EXTRA_DEVS=2 @@ -182,12 +169,12 @@ CONFIG_SCSI_SGIWD93=y # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set # CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_IPS is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_DMA is not set @@ -195,32 +182,20 @@ CONFIG_SCSI_SGIWD93=y # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GENERIC_NCR5380 is not set -# CONFIG_SCSI_PPA is not set -# CONFIG_SCSI_IMM is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_NCR53C7xx is not set # CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PCI2000 is not set # CONFIG_SCSI_PCI2220I is not set # CONFIG_SCSI_PSI240I is not set # CONFIG_SCSI_QLOGIC_FAS is not set -# CONFIG_SCSI_SEAGATE is not set # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set -# CONFIG_SCSI_ULTRASTOR is not set # CONFIG_SCSI_DEBUG is not set -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set - -# -# I2O device support -# -# CONFIG_I2O is not set -# CONFIG_I2O_PCI is not set -# CONFIG_I2O_BLOCK is not set -# CONFIG_I2O_LAN is not set -# CONFIG_I2O_SCSI is not set -# CONFIG_I2O_PROC is not set # # Network device support @@ -232,64 +207,14 @@ CONFIG_NETDEVICES=y CONFIG_SGISEEQ=y # -# Character devices +# SGI Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y -# CONFIG_SERIAL is not set -# CONFIG_SERIAL_EXTENDED is not set -# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_SGI_NEWPORT_CONSOLE=y +CONFIG_FONT_8x16=y +# CONFIG_SGI_PROM_CONSOLE is not set # CONFIG_UNIX98_PTYS is not set -# CONFIG_PRINTER is not set -# CONFIG_PPDEV is not set - -# -# I2C support -# -# CONFIG_I2C is not set - -# -# Mice -# -# CONFIG_BUSMOUSE is not set -CONFIG_MOUSE=y -CONFIG_PSMOUSE=y -# CONFIG_82C710_MOUSE is not set -# CONFIG_PC110_PAD is not set - -# -# Joysticks -# -# CONFIG_JOYSTICK is not set -# CONFIG_QIC02_TAPE is not set - -# -# Watchdog Cards -# -# CONFIG_WATCHDOG is not set -# CONFIG_NVRAM is not set -# CONFIG_RTC is not set - -# -# Video For Linux -# -# CONFIG_VIDEO_DEV is not set -# CONFIG_DTLK is not set -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set - -# -# Ftape, the floppy tape device driver -# -# CONFIG_FTAPE is not set -# CONFIG_DRM is not set -# CONFIG_DRM_TDFX is not set -# CONFIG_AGP is not set - -# -# USB support -# -# CONFIG_USB is not set # # File systems @@ -298,6 +223,7 @@ CONFIG_PSMOUSE=y CONFIG_AUTOFS_FS=y CONFIG_AUTOFS4_FS=y # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -307,10 +233,12 @@ CONFIG_AUTOFS4_FS=y # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS is not set CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set # CONFIG_MINIX_FS is not set # CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set @@ -318,17 +246,22 @@ CONFIG_PROC_FS=y # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set CONFIG_ROOT_NFS=y CONFIG_NFSD=y # CONFIG_NFSD_V3 is not set @@ -336,19 +269,45 @@ CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types # -# CONFIG_PARTITION_ADVANCED is not set +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set CONFIG_SGI_PARTITION=y +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set # CONFIG_NLS is not set # # Console drivers # -CONFIG_SGI_NEWPORT_CONSOLE=y -CONFIG_FONT_8x16=y +# CONFIG_VGA_CONSOLE is not set +# CONFIG_FB is not set + +# +# Frame-buffer support +# +# CONFIG_FB is not set # # Sound @@ -359,9 +318,15 @@ CONFIG_FONT_8x16=y # SGI devices # CONFIG_SGI_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set CONFIG_SGI_DS1286=y # CONFIG_SGI_NEWPORT_GFX is not set +# +# USB support +# +# CONFIG_USB is not set + # # Kernel hacking # diff --git a/arch/mips/jazz/Makefile b/arch/mips/jazz/Makefile index 63c6adffb341..3b3e83e96ac6 100644 --- a/arch/mips/jazz/Makefile +++ b/arch/mips/jazz/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.6 1999/02/25 21:57:01 tsbogend Exp $ +# $Id: Makefile,v 1.5 1999/01/03 17:50:47 ralf Exp $ # # Makefile for the Jazz family specific parts of the kernel # diff --git a/arch/mips/jazz/floppy-jazz.c b/arch/mips/jazz/floppy-jazz.c index e69e67a9f49a..76f39e52a31b 100644 --- a/arch/mips/jazz/floppy-jazz.c +++ b/arch/mips/jazz/floppy-jazz.c @@ -1,4 +1,4 @@ -/* $Id: floppy-jazz.c,v 1.3 2000/02/24 00:12:40 ralf Exp $ +/* $Id: floppy-jazz.c,v 1.2 1998/10/18 13:18:25 tsbogend Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/jazz/int-handler.S b/arch/mips/jazz/int-handler.S index 9efd8bb28c10..a05cf7cfa282 100644 --- a/arch/mips/jazz/int-handler.S +++ b/arch/mips/jazz/int-handler.S @@ -1,4 +1,4 @@ -/* $Id: int-handler.S,v 1.15 1999/08/18 23:37:43 ralf Exp $ +/* $Id: int-handler.S,v 1.14 1999/05/01 22:40:34 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/jazz/kbd-jazz.c b/arch/mips/jazz/kbd-jazz.c index 17f977f2a250..1dfed0384354 100644 --- a/arch/mips/jazz/kbd-jazz.c +++ b/arch/mips/jazz/kbd-jazz.c @@ -1,4 +1,4 @@ -/* $Id: kbd-jazz.c,v 1.1 1999/01/03 17:50:48 ralf Exp $ +/* $Id: kbd-jazz.c,v 1.1 1998/10/28 12:38:10 ralf Exp $ * * Low-level hardware access stuff for Jazz family machines. * diff --git a/arch/mips/jazz/reset.c b/arch/mips/jazz/reset.c index d689d696c306..f1aac5388ad3 100644 --- a/arch/mips/jazz/reset.c +++ b/arch/mips/jazz/reset.c @@ -3,7 +3,7 @@ * * Reset a Jazz machine. * - * $Id: reset.c,v 1.3 1998/03/04 08:29:10 ralf Exp $ + * $Id:$ */ #include diff --git a/arch/mips/jazz/rtc-jazz.c b/arch/mips/jazz/rtc-jazz.c index 46414f7830c8..2f5393ed15bf 100644 --- a/arch/mips/jazz/rtc-jazz.c +++ b/arch/mips/jazz/rtc-jazz.c @@ -1,4 +1,4 @@ -/* $Id: rtc-jazz.c,v 1.2 1998/08/26 21:46:38 tsbogend Exp $ +/* $Id: rtc-jazz.c,v 1.2 1998/06/25 20:19:14 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c index 7d762f742277..a16ce7b69411 100644 --- a/arch/mips/jazz/setup.c +++ b/arch/mips/jazz/setup.c @@ -1,4 +1,4 @@ -/* $Id: setup.c,v 1.25 2000/01/27 01:05:23 ralf Exp $ +/* $Id: setup.c,v 1.24 1999/10/09 00:00:58 ralf Exp $ * * Setup pointers to hardware-dependent routines. * diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile index 7e02712339cb..9ef5ecbb298c 100644 --- a/arch/mips/kernel/Makefile +++ b/arch/mips/kernel/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.15 2000/01/26 00:07:44 ralf Exp $ +# $Id: Makefile,v 1.14 1999/10/09 00:00:58 ralf Exp $ # # Makefile for the Linux/MIPS kernel. # diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S index de00ba1218a7..bde21011fcff 100644 --- a/arch/mips/kernel/entry.S +++ b/arch/mips/kernel/entry.S @@ -1,4 +1,4 @@ -/* $Id: entry.S,v 1.20 2000/02/23 00:41:00 ralf Exp $ +/* $Id: entry.S,v 1.19 1999/12/08 22:05:10 harald Exp $ * * Low level exception handling * diff --git a/arch/mips/kernel/fpe.c b/arch/mips/kernel/fpe.c index 2845930d025c..66703471ccc4 100644 --- a/arch/mips/kernel/fpe.c +++ b/arch/mips/kernel/fpe.c @@ -6,7 +6,7 @@ * * Copyright (C) 1997 Ralf Baechle * - * $Id: fpe.c,v 1.4 1999/05/01 22:40:35 ralf Exp $ + * $Id: fpe.c,v 1.3 1998/04/05 11:23:50 ralf Exp $ */ #include #include diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S index 0ee67dcf8cb5..dff18ca1220f 100644 --- a/arch/mips/kernel/gdb-low.S +++ b/arch/mips/kernel/gdb-low.S @@ -5,7 +5,7 @@ * * Copyright (C) 1995 Andreas Busse * - * $Id: gdb-low.S,v 1.5 1999/08/18 23:37:43 ralf Exp $ + * $Id: gdb-low.S,v 1.4 1997/12/01 17:57:26 ralf Exp $ */ #include diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c index 84bebf269e71..2aff468fa6cf 100644 --- a/arch/mips/kernel/gdb-stub.c +++ b/arch/mips/kernel/gdb-stub.c @@ -12,7 +12,7 @@ * * Copyright (C) 1995 Andreas Busse * - * $Id: gdb-stub.c,v 1.7 1999/06/12 18:39:28 ulfc Exp $ + * $Id: gdb-stub.c,v 1.6 1999/05/01 22:40:35 ralf Exp $ */ /* diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index be4751390aaa..df612cbf8a76 100644 --- a/arch/mips/kernel/head.S +++ b/arch/mips/kernel/head.S @@ -1,4 +1,4 @@ -/* $Id: head.S,v 1.17 1999/12/04 03:58:59 ralf Exp $ +/* $Id: head.S,v 1.18 2000/03/03 22:17:07 kevink Exp $ * * arch/mips/kernel/head.S * @@ -29,7 +29,6 @@ #include #include #include -#include .text /* @@ -101,7 +100,7 @@ eret END(except_vec0_r4600) - /* TLB refill, EXL == 0, R4xx0, non-R4600 version */ + /* TLB refill, EXL == 0, R52x0 "Nevada" version */ .set noreorder .set noat LEAF(except_vec0_nevada) @@ -122,9 +121,10 @@ mtc0 k0, CP0_ENTRYLO0 # load it srl k1, k1, 6 # convert to entrylo1 mtc0 k1, CP0_ENTRYLO1 # load it - tlbwr # write random tlb entry - nop + nop # QED specified nops nop + tlbwr # write random tlb entry + nop # traditional nop eret # return from trap END(except_vec0_nevada) @@ -393,12 +393,6 @@ NESTED(kernel_entry, 16, sp) EXPORT(stext) EXPORT(_stext) - /* Determine which MIPS variant we are running on. */ - b cpu_probe - nop - -probe_done: - /* * Stack for kernel and init, current variable */ @@ -420,167 +414,10 @@ probe_done: bne t0, t1, 1b sw zero, (t0) - jal prom_init /* prom_init(argc, argv, envp); */ - nop -#ifdef CONFIG_SGI_IP22 - jal sgi_sysinit - nop -#endif - -#ifdef CONFIG_COBALT_MICRO_SERVER - jal SetUpBootInfo - nop -#endif - - /* - * Determine the mmu/cache attached to this machine, - * then flush the tlb and caches. On the r4xx0 - * variants this also sets CP0_WIRED to zero. - */ - jal loadmmu - nop - - /* Disable coprocessors */ - mfc0 t0, CP0_STATUS - li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX) - and t0, t1 - or t0, ST0_CU0 - mtc0 t0, CP0_STATUS - -1: jal start_kernel + jal init_arch nop - /* - * Main should never return here, but - * just in case, we know what happens. - */ - b 1b - nop # delay slot END(kernel_entry) - /* CPU type probing code, called at Kernel entry. */ - LEAF(cpu_probe) - mfc0 t0, CP0_PRID - la t3, mips_cputype - andi t1, t0, 0xff00 - li t2, PRID_IMP_R2000 - bne t1, t2, 1f - andi t0, 0x00ff - - li t2, CPU_R2000 - b probe_done - sw t2, (t3) -1: - li t2, PRID_IMP_R3000 - bne t1, t2, 1f - nop - - li t2, PRID_REV_R3000A - bne t0, t2, 9f - nop - - li t2, CPU_R3000A - b probe_done - sw t2, (t3) -9: - li t2, CPU_R3000 - b probe_done - sw t2, (t3) -1: - li t2, PRID_IMP_R6000 - bne t1, t2, 1f - nop - - li t2, CPU_R6000 - b probe_done - sw t2, (t3) -1: - li t2, PRID_IMP_R4000 - bne t1, t2, 1f - nop - - li t2, PRID_REV_R4400 - bne t0, t2, 9f - nop - - li t2, CPU_R4400SC - b probe_done - sw t2, (t3) -9: - li t2, CPU_R4000SC - b probe_done - sw t2, (t3) -1: - li t2, PRID_IMP_R6000A - bne t1, t2, 1f - nop - - li t2, CPU_R6000A - b probe_done - sw t2, (t3) -1: - li t2, PRID_IMP_R10000 - bne t1, t2, 1f - nop - - li t2, CPU_R10000 - b probe_done - sw t2, (t3) -1: - li t2, PRID_IMP_R8000 - bne t1, t2, 1f - nop - - li t2, CPU_R8000 - b probe_done - sw t2, (t3) -1: - li t2, PRID_IMP_R4600 - bne t1, t2, 1f - nop - - li t2, CPU_R4600 - b probe_done - sw t2, (t3) -1: - li t2, PRID_IMP_R4700 - bne t1, t2, 1f - nop - - li t2, CPU_R4700 - b probe_done - sw t2, (t3) -1: - li t2, PRID_IMP_R4650 - bne t1, t2, 1f - nop - - li t2, CPU_R4650 - b probe_done - sw t2, (t3) -1: - li t2, PRID_IMP_R5000 - bne t1, t2, 1f - nop - - li t2, CPU_R5000 - b probe_done - sw t2, (t3) -1: - li t2, PRID_IMP_NEVADA - bne t1, t2, 1f - nop - - li t2, CPU_NEVADA - b probe_done - sw t2, (t3) -1: - li t2, CPU_UNKNOWN - sw t2, (t3) - - b probe_done - nop - END(cpu_probe) - /* * This buffer is reserved for the use of the cache error handler. */ diff --git a/arch/mips/kernel/irix5sys.h b/arch/mips/kernel/irix5sys.h index 154cbc78d73a..2d344c3010e0 100644 --- a/arch/mips/kernel/irix5sys.h +++ b/arch/mips/kernel/irix5sys.h @@ -1,4 +1,4 @@ -/* $Id: irix5sys.h,v 1.2 1998/08/25 09:14:39 ralf Exp $ +/* $Id: irix5sys.h,v 1.2 1998/08/17 10:16:25 ralf Exp $ * * irix5sys.h: 32-bit IRIX5 ABI system call table. * diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c index a4f767a68f33..ddf2340450f4 100644 --- a/arch/mips/kernel/irixelf.c +++ b/arch/mips/kernel/irixelf.c @@ -1,4 +1,4 @@ -/* $Id: irixelf.c,v 1.24 2000/02/04 07:40:23 ralf Exp $ +/* $Id: irixelf.c,v 1.28 2000/03/23 02:25:42 ralf Exp $ * * irixelf.c: Code to load IRIX ELF executables which conform to * the MIPS ABI. @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -253,10 +254,10 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex, #endif /* First of all, some simple consistency checks */ - if((interp_elf_ex->e_type != ET_EXEC && - interp_elf_ex->e_type != ET_DYN) || - !elf_check_arch(interp_elf_ex->e_machine) || - !interpreter->f_op->mmap) { + if ((interp_elf_ex->e_type != ET_EXEC && + interp_elf_ex->e_type != ET_DYN) || + !elf_check_arch(interp_elf_ex->e_machine) || + !interpreter->f_op->mmap) { printk("IRIX interp has bad e_type %d\n", interp_elf_ex->e_type); return 0xffffffff; } @@ -424,42 +425,41 @@ static inline int look_for_irix_interpreter(char **name, struct elf_phdr *epp, struct linux_binprm *bprm, int pnum) { - mm_segment_t old_fs; int i; int retval = -EINVAL; struct file *file = NULL; *name = NULL; for(i = 0; i < pnum; i++, epp++) { - if(epp->p_type != PT_INTERP) + if (epp->p_type != PT_INTERP) continue; /* It is illegal to have two interpreters for one executable. */ - if(*name != NULL) + if (*name != NULL) goto out; *name = (char *) kmalloc((epp->p_filesz + strlen(IRIX_INTERP_PREFIX)), GFP_KERNEL); - if(!*name) + if (!*name) return -ENOMEM; strcpy(*name, IRIX_INTERP_PREFIX); retval = kernel_read(bprm->file, epp->p_offset, (*name + 16), - epp->p_filesz); - if(retval < 0) + epp->p_filesz); + if (retval < 0) goto out; file = open_exec(*name); - if(IS_ERR(file)) { + if (IS_ERR(file)) { retval = PTR_ERR(file); goto out; } retval = kernel_read(file, 0, bprm->buf, 128); - if(retval < 0) + if (retval < 0) goto dput_and_out; - *interp_elf_ex = *((struct elfhdr *) bprm->buf); + *interp_elf_ex = *(struct elfhdr *) bprm->buf; } *interpreter = file; return 0; @@ -548,7 +548,7 @@ static inline int map_interpreter(struct elf_phdr *epp, struct elfhdr *ihp, fput(interp); - if(*eentry == 0xffffffff) + if (*eentry == 0xffffffff) return -1; } return 0; @@ -655,10 +655,10 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs) &interpreter, &interp_elf_ex, elf_phdata, bprm, elf_ex.e_phnum); - if(retval) + if (retval) goto out_free_file; - if(elf_interpreter) { + if (elf_interpreter) { retval = verify_irix_interpreter(&interp_elf_ex); if(retval) goto out_free_interp; @@ -841,8 +841,8 @@ static int load_irix_library(struct file *file) up(¤t->mm->mmap_sem); k = elf_phdata->p_vaddr + elf_phdata->p_filesz; - if(k > elf_bss) elf_bss = k; - + if (k > elf_bss) elf_bss = k; + if (error != (elf_phdata->p_vaddr & 0xfffff000)) { kfree(elf_phdata); return error; diff --git a/arch/mips/kernel/irixinv.c b/arch/mips/kernel/irixinv.c index af3db7f46981..9028a27be9c2 100644 --- a/arch/mips/kernel/irixinv.c +++ b/arch/mips/kernel/irixinv.c @@ -5,7 +5,7 @@ * * Miguel de Icaza, 1997. * - * $Id: irixinv.c,v 1.4 1999/10/09 00:00:58 ralf Exp $ + * $Id: irixinv.c,v 1.3 1998/04/05 11:23:51 ralf Exp $ */ #include #include diff --git a/arch/mips/kernel/irixioctl.c b/arch/mips/kernel/irixioctl.c index b59f630b9e48..10ca5b15e8c4 100644 --- a/arch/mips/kernel/irixioctl.c +++ b/arch/mips/kernel/irixioctl.c @@ -1,4 +1,4 @@ -/* $Id: irixioctl.c,v 1.7 1999/09/28 22:25:46 ralf Exp $ +/* $Id: irixioctl.c,v 1.6 1999/02/06 05:12:56 adevries Exp $ * irixioctl.c: A fucking mess... * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c index 46b7bb55d89a..1bcafdf75d73 100644 --- a/arch/mips/kernel/irixsig.c +++ b/arch/mips/kernel/irixsig.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: irixsig.c,v 1.14 2000/01/17 03:58:59 ralf Exp $ + * $Id: irixsig.c,v 1.13 1999/10/09 00:00:58 ralf Exp $ */ #include diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index cdb22693d7b6..239576e4e34a 100644 --- a/arch/mips/kernel/irq.c +++ b/arch/mips/kernel/irq.c @@ -31,6 +31,24 @@ #include #include +/* + * Linux has a controller-independent x86 interrupt architecture. + * every controller has a 'controller-template', that is used + * by the main code to do the right thing. Each driver-visible + * interrupt source is transparently wired to the apropriate + * controller. Thus drivers need not be aware of the + * interrupt-controller. + * + * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC, + * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC. + * (IO-APICs assumed to be messaging to Pentium local-APICs) + * + * the code is designed to be easily extended with new/different + * interrupt controllers, without having to do assembly magic. + */ + +irq_cpustat_t irq_stat [NR_CPUS]; + /* * This contains the irq mask for both 8259A irq controllers, it's an * int so we can deal with the third PIC in some systems like the RM300. diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c index 1f40f5756486..bfd75f6c8202 100644 --- a/arch/mips/kernel/mips_ksyms.c +++ b/arch/mips/kernel/mips_ksyms.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -56,8 +57,6 @@ EXPORT_SYMBOL_NOVERS(strtok); EXPORT_SYMBOL_NOVERS(strpbrk); EXPORT_SYMBOL(_clear_page); -EXPORT_SYMBOL(local_bh_count); -EXPORT_SYMBOL(local_irq_count); EXPORT_SYMBOL(enable_irq); EXPORT_SYMBOL(disable_irq); EXPORT_SYMBOL(kernel_thread); @@ -88,6 +87,13 @@ EXPORT_SYMBOL(_dma_cache_inv); EXPORT_SYMBOL(invalid_pte_table); +/* + * Semaphore stuff + */ +EXPORT_SYMBOL(__down_read); +EXPORT_SYMBOL(__down_write); +EXPORT_SYMBOL(__rwsem_wake); + /* * Base address of ports for Intel style I/O. */ diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index c2ee57b8606c..701321a6bee2 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c @@ -34,6 +34,7 @@ int get_cpuinfo(char *buffer) const char *mach_sgi_names[] = GROUP_SGI_NAMES; const char *mach_cobalt_names[] = GROUP_COBALT_NAMES; const char *mach_nec_ddb_names[] = GROUP_NEC_DDB_NAMES; + const char *mach_baget_names[] = GROUP_BAGET_NAMES; const char **mach_group_to_name[] = { mach_unknown_names, mach_jazz_names, mach_dec_names, @@ -42,7 +43,8 @@ int get_cpuinfo(char *buffer) mach_acn_names, mach_sgi_names, mach_cobalt_names, - mach_nec_ddb_names }; + mach_nec_ddb_names, + mach_baget_names }; unsigned int version = read_32bit_cp0_register(CP0_PRID); int len; @@ -68,7 +70,7 @@ int get_cpuinfo(char *buffer) len += sprintf(buffer + len, "unaligned accesses\t: %lu\n", unaligned_instructions); len += sprintf(buffer + len, "wait instruction\t: %s\n", - wait_available ? "yes" : "no"); + cpu_wait ? "yes" : "no"); len += sprintf(buffer + len, "microsecond timers\t: %s\n", cyclecounter_available ? "yes" : "no"); len += sprintf(buffer + len, "extra interrupt vector\t: %s\n", @@ -83,3 +85,8 @@ int get_cpuinfo(char *buffer) return len; } + +void init_irq_proc(void) +{ + /* Nothing, for now. */ +} diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index c9bb395e7e73..2353515b98a3 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -40,10 +40,8 @@ void cpu_idle(void) while (1) { while (!current->need_resched) - if (wait_available) - __asm__(".set\tmips3\n\t" - "wait\n\t" - ".set\tmips0"); + if (cpu_wait) + (*cpu_wait)(); schedule(); check_pgt_cache(); } diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index b88cd808d128..dd96d035734e 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -1,4 +1,4 @@ -/* $Id: ptrace.c,v 1.18 1999/10/09 00:00:58 ralf Exp $ +/* $Id: ptrace.c,v 1.17 1999/09/28 22:25:47 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -28,7 +28,6 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; - unsigned int flags; int res; extern void save_fp(void*); @@ -49,19 +48,22 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) res = 0; goto out; } - if (pid == 1) { /* you may not mess with init */ - res = -EPERM; + res = -ESRCH; + read_lock(&tasklist_lock); + child = find_task_by_pid(pid); + if (child) + get_task_struct(child); + read_unlock(&tasklist_lock); + if (!child) goto out; - } - if (!(child = find_task_by_pid(pid))) { - res = -ESRCH; + + res = -EPERM; + if (pid == 1) /* you may not mess with init */ goto out; - } + if (request == PTRACE_ATTACH) { - if (child == current) { - res = -EPERM; - goto out; - } + if (child == current) + goto out_tsk; if ((!child->dumpable || (current->uid != child->euid) || (current->uid != child->suid) || @@ -71,42 +73,34 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) (current->gid != child->gid) || (!cap_issubset(child->cap_permitted, current->cap_permitted)) || - (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)){ - res = -EPERM; - goto out; - } + (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) + goto out_tsk; /* the same process cannot be attached many times */ if (child->flags & PF_PTRACED) - goto out; + goto out_tsk; child->flags |= PF_PTRACED; - write_lock_irqsave(&tasklist_lock, flags); + write_lock_irq(&tasklist_lock); if (child->p_pptr != current) { REMOVE_LINKS(child); child->p_pptr = current; SET_LINKS(child); } - write_unlock_irqrestore(&tasklist_lock, flags); + write_unlock_irq(&tasklist_lock); send_sig(SIGSTOP, child, 1); res = 0; - goto out; - } - if (!(child->flags & PF_PTRACED)) { - res = -ESRCH; - goto out; + goto out_tsk; } + res = -ESRCH; + if (!(child->flags & PF_PTRACED)) + goto out_tsk; if (child->state != TASK_STOPPED) { - if (request != PTRACE_KILL) { - res = -ESRCH; - goto out; - } - } - if (child->p_pptr != current) { - res = -ESRCH; - goto out; + if (request != PTRACE_KILL) + goto out_tsk; } - + if (child->p_pptr != current) + goto out_tsk; switch (request) { case PTRACE_PEEKTEXT: /* read word at location addr. */ case PTRACE_PEEKDATA: { @@ -116,11 +110,11 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); res = -EIO; if (copied != sizeof(tmp)) - goto out; + break; res = put_user(tmp,(unsigned long *) data); goto out; - } + } /* Read the word at location addr in the USER area. */ case PTRACE_PEEKUSR: { @@ -189,7 +183,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) res = 0; if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data)) - goto out; + break; res = -EIO; goto out; @@ -240,23 +234,22 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) res = -EIO; break; } - goto out; + break; } case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ case PTRACE_CONT: { /* restart after signal. */ - if ((unsigned long) data > _NSIG) { - res = -EIO; - goto out; - } + res = -EIO; + if ((unsigned long) data > _NSIG) + break; if (request == PTRACE_SYSCALL) child->flags |= PF_TRACESYS; else child->flags &= ~PF_TRACESYS; child->exit_code = data; wake_up_process(child); - res = data; - goto out; + res = 0; + break; } /* @@ -264,34 +257,35 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) * perhaps it should be put in the status that it wants to * exit. */ - case PTRACE_KILL: { - if (child->state != TASK_ZOMBIE) { - child->exit_code = SIGKILL; - wake_up_process(child); - } + case PTRACE_KILL: res = 0; - goto out; - } + if (child->state != TASK_ZOMBIE) /* already dead */ + break; + child->exit_code = SIGKILL; + wake_up_process(child); + break; - case PTRACE_DETACH: { /* detach a process that was attached. */ - if ((unsigned long) data > _NSIG) { - res = -EIO; - goto out; - } + case PTRACE_DETACH: /* detach a process that was attached. */ + res = -EIO; + if ((unsigned long) data > _NSIG) + break; child->flags &= ~(PF_PTRACED|PF_TRACESYS); child->exit_code = data; + write_lock_irq(&tasklist_lock); REMOVE_LINKS(child); child->p_pptr = child->p_opptr; SET_LINKS(child); + write_unlock_irq(&tasklist_lock); wake_up_process(child); res = 0; - goto out; - } + break; default: res = -EIO; goto out; } +out_tsk: + free_task_struct(child); out: unlock_kernel(); return res; diff --git a/arch/mips/kernel/r2300_fpu.S b/arch/mips/kernel/r2300_fpu.S index b0868a3beb82..efb00dce139e 100644 --- a/arch/mips/kernel/r2300_fpu.S +++ b/arch/mips/kernel/r2300_fpu.S @@ -1,4 +1,4 @@ -/* $Id: r2300_fpu.S,v 1.7 1999/09/28 22:25:47 ralf Exp $ +/* $Id: r2300_fpu.S,v 1.6 1999/08/09 19:43:14 harald Exp $ * * r2300_fpu.S: Save/restore floating point context for signal handlers. * diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S index 93d31a952bf3..c94037a2445a 100644 --- a/arch/mips/kernel/r2300_switch.S +++ b/arch/mips/kernel/r2300_switch.S @@ -1,4 +1,4 @@ -/* $Id: r2300_switch.S,v 1.9 1999/10/12 17:33:49 harald Exp $ +/* $Id: r2300_switch.S,v 1.8 1999/08/18 23:37:44 ralf Exp $ * * r2300_switch.S: R2300 specific task switching code. * diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S index cd0df15b8b06..c5649bd039a4 100644 --- a/arch/mips/kernel/r4k_fpu.S +++ b/arch/mips/kernel/r4k_fpu.S @@ -32,7 +32,6 @@ LEAF(save_fp_context) cfc1 t1,fcr31 /* Store the 16 even double precision registers */ -1: EX(sdc1 $f0,(SC_FPREGS+0)(a0)) EX(sdc1 $f2,(SC_FPREGS+16)(a0)) EX(sdc1 $f4,(SC_FPREGS+32)(a0)) @@ -75,7 +74,7 @@ LEAF(restore_fp_context) * Restore the 16 even double precision registers * when cp1 was enabled in the cp0 status register. */ -1: EX(ldc1 $f0,(SC_FPREGS+0)(a0)) + EX(ldc1 $f0,(SC_FPREGS+0)(a0)) EX(ldc1 $f2,(SC_FPREGS+16)(a0)) EX(ldc1 $f4,(SC_FPREGS+32)(a0)) EX(ldc1 $f6,(SC_FPREGS+48)(a0)) diff --git a/arch/mips/kernel/r4k_misc.S b/arch/mips/kernel/r4k_misc.S index 887fe84655a2..35493e1826b3 100644 --- a/arch/mips/kernel/r4k_misc.S +++ b/arch/mips/kernel/r4k_misc.S @@ -1,4 +1,4 @@ -/* $Id: r4k_misc.S,v 1.9 1999/12/04 03:59:00 ralf Exp $ +/* $Id: r4k_misc.S,v 1.8 1999/10/09 00:00:58 ralf Exp $ * * r4k_misc.S: Misc. exception handling code for r4k. * diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S index 9d84fe6048a7..0ac3c532f4cc 100644 --- a/arch/mips/kernel/r4k_switch.S +++ b/arch/mips/kernel/r4k_switch.S @@ -1,4 +1,4 @@ -/* $Id: r4k_switch.S,v 1.10 1999/10/09 00:00:58 ralf Exp $ +/* $Id: r4k_switch.S,v 1.9 1999/08/18 23:37:44 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/kernel/r6000_fpu.S b/arch/mips/kernel/r6000_fpu.S index 560871d9763e..851b4dc4887a 100644 --- a/arch/mips/kernel/r6000_fpu.S +++ b/arch/mips/kernel/r6000_fpu.S @@ -10,7 +10,7 @@ * Multi-arch abstraction and asm macros for easier reading: * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: r6000_fpu.S,v 1.6 1999/08/09 19:43:15 harald Exp $ + * $Id: r6000_fpu.S,v 1.5 1999/05/01 22:40:37 ralf Exp $ */ #include #include diff --git a/arch/mips/kernel/scall_o32.S b/arch/mips/kernel/scall_o32.S index 402dbb604826..cb81afa07735 100644 --- a/arch/mips/kernel/scall_o32.S +++ b/arch/mips/kernel/scall_o32.S @@ -1,4 +1,4 @@ -/* $Id: scall_o32.S,v 1.11 2000/02/23 01:33:55 ralf Exp $ +/* $Id: scall_o32.S,v 1.10 2000/02/23 00:41:00 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 3f0bb6888df5..fa44ffabf136 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -1,4 +1,4 @@ -/* $Id: setup.c,v 1.22 2000/01/27 01:05:23 ralf Exp $ +/* $Id: setup.c,v 1.28 2000/03/13 22:21:44 harald Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef CONFIG_SGI_IP22 #include #endif @@ -46,11 +47,13 @@ struct mips_cpuinfo boot_cpu_data = { NULL, NULL, 0 }; /* - * Not all of the MIPS CPUs have the "wait" instruction available. This - * is set to true if it is available. The wait instruction stops the - * pipeline and reduces the power consumption of the CPU very much. + * Not all of the MIPS CPUs have the "wait" instruction available. Moreover, + * the implementation of the "wait" feature differs between CPU families. This + * points to the function that implements CPU specific wait. + * The wait instruction stops the pipeline and reduces the power consumption of + * the CPU very much. */ -char wait_available; +void (*cpu_wait)(void) = NULL; /* * Do we have a cyclecounter available? @@ -119,6 +122,125 @@ unsigned long mips_io_port_base; */ unsigned long isa_slot_offset; +extern void sgi_sysinit(void); +extern void SetUpBootInfo(void); +extern void loadmmu(void); +extern asmlinkage void start_kernel(void); +extern int prom_init(int, char **, char **, int *); + +/* + * Probe whether cpu has config register by trying to play with + * alternate cache bit and see whether it matters. + * It's used by cpu_probe to distinguish between R3000A and R3081. + */ +static inline int cpu_has_confreg(void) +{ +#ifdef CONFIG_CPU_R3000 + extern unsigned long r3k_cache_size(unsigned long); + unsigned long size1, size2; + unsigned long cfg = read_32bit_cp0_register(CP0_CONF); + + size1 = r3k_cache_size(ST0_DE); + write_32bit_cp0_register(CP0_CONF, cfg^CONF_AC); + size2 = r3k_cache_size(ST0_DE); + write_32bit_cp0_register(CP0_CONF, cfg); + return size1 != size2; +#else + return 0; +#endif +} + +static inline void cpu_probe(void) +{ + unsigned int prid = read_32bit_cp0_register(CP0_PRID); + switch(prid & 0xff00) { + case PRID_IMP_R2000: + mips_cputype = CPU_R2000; + break; + case PRID_IMP_R3000: + if((prid & 0xff) == PRID_REV_R3000A) + if(cpu_has_confreg()) + mips_cputype = CPU_R3081E; + else + mips_cputype = CPU_R3000A; + else + mips_cputype = CPU_R3000; + break; + case PRID_IMP_R4000: + if((prid & 0xff) == PRID_REV_R4400) + mips_cputype = CPU_R4400SC; + else + mips_cputype = CPU_R4000SC; + break; + case PRID_IMP_R4600: + mips_cputype = CPU_R4600; + break; + case PRID_IMP_R4650: + mips_cputype = CPU_R4650; + break; + case PRID_IMP_R4700: + mips_cputype = CPU_R4700; + break; + case PRID_IMP_R5000: + mips_cputype = CPU_R5000; + break; + case PRID_IMP_NEVADA: + mips_cputype = CPU_NEVADA; + break; + case PRID_IMP_R6000: + mips_cputype = CPU_R6000; + break; + case PRID_IMP_R6000A: + mips_cputype = CPU_R6000A; + break; + case PRID_IMP_R8000: + mips_cputype = CPU_R8000; + break; + case PRID_IMP_R10000: + mips_cputype = CPU_R10000; + break; + default: + mips_cputype = CPU_UNKNOWN; + } +} + +asmlinkage void __init init_arch(int argc, char **argv, char **envp, int *prom_vec) +{ + unsigned int s; + + /* Determine which MIPS variant we are running on. */ + cpu_probe(); + + prom_init(argc, argv, envp, prom_vec); + +#ifdef CONFIG_SGI_IP22 + sgi_sysinit(); +#endif +#ifdef CONFIG_COBALT_MICRO_SERVER + SetUpBootInfo(); +#endif + + /* + * Determine the mmu/cache attached to this machine, + * then flush the tlb and caches. On the r4xx0 + * variants this also sets CP0_WIRED to zero. + */ + loadmmu(); + + /* Disable coprocessors */ + s = read_32bit_cp0_register(CP0_STATUS); + s &= ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX); + s |= ST0_CU0; + write_32bit_cp0_register(CP0_STATUS, s); + + /* + * Main should never return here, but + * just in case, we know what happens. + */ + for(;;) + start_kernel(); +} + static void __init default_irq_setup(void) { panic("Unknown machtype in init_IRQ"); @@ -156,7 +278,7 @@ void __init setup_arch(char **cmdline_p) switch(mips_machgroup) { #ifdef CONFIG_BAGET_MIPS - case MACH_GROUP_UNKNOWN: + case MACH_GROUP_BAGET: baget_setup(); break; #endif @@ -220,4 +342,19 @@ void __init setup_arch(char **cmdline_p) *memory_start_p = initrd_end; } #endif + + paging_init(); +} + +void r3081_wait(void) +{ + unsigned long cfg = read_32bit_cp0_register(CP0_CONF); + write_32bit_cp0_register(CP0_CONF, cfg|CONF_HALT); +} + +void r4k_wait(void) +{ + __asm__(".set\tmips3\n\t" + "wait\n\t" + ".set\tmips0"); } diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index cfd6b00a4808..a912be2e1fb9 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c @@ -1,4 +1,4 @@ -/* $Id: signal.c,v 1.25 2000/02/05 06:47:08 ralf Exp $ +/* $Id: signal.c,v 1.24 2000/02/04 07:40:23 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/kernel/softfp.S b/arch/mips/kernel/softfp.S index 61e4a166ffb3..6b1bd77eb2b2 100644 --- a/arch/mips/kernel/softfp.S +++ b/arch/mips/kernel/softfp.S @@ -147,7 +147,7 @@ insn: LOCK_KERNEL; \ la a1, 8f; \ TEXT(#insn); \ - la a1, nosim; \ + la a0, nosim; \ UNLOCK_KERNEL; \ j done diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 2ba03bda73fa..d2df0dc2049b 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -129,7 +129,6 @@ asmlinkage int sys_execve(struct pt_regs regs) int error; char * filename; - lock_kernel(); filename = getname((char *) (long)regs.regs[4]); error = PTR_ERR(filename); if (IS_ERR(filename)) @@ -139,7 +138,6 @@ asmlinkage int sys_execve(struct pt_regs regs) putname(filename); out: - unlock_kernel(); return error; } diff --git a/arch/mips/kernel/syscalls.h b/arch/mips/kernel/syscalls.h index de802c8f4b1b..e1720d46e3bf 100644 --- a/arch/mips/kernel/syscalls.h +++ b/arch/mips/kernel/syscalls.h @@ -44,7 +44,7 @@ SYS(sys_stime, 1) /* 4025 */ SYS(sys_ptrace, 4) SYS(sys_alarm, 1) SYS(sys_fstat, 2) -SYS(sys_ni_syscall, 0) +SYS(sys_pause, 0) SYS(sys_utime, 2) /* 4030 */ SYS(sys_ni_syscall, 0) SYS(sys_ni_syscall, 0) @@ -232,3 +232,5 @@ SYS(sys_stat64, 3) SYS(sys_lstat64, 3) SYS(sys_fstat64, 3) /* 4215 */ SYS(sys_pivot_root, 2) +SYS(sys_mincore, 3) +SYS(sys_madvise, 3) diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c index 8dbf00c60f29..847acadd99ae 100644 --- a/arch/mips/kernel/sysirix.c +++ b/arch/mips/kernel/sysirix.c @@ -1,4 +1,4 @@ -/* $Id: sysirix.c,v 1.24 2000/02/05 06:47:08 ralf Exp $ +/* $Id: sysirix.c,v 1.26 2000/03/12 23:15:33 ralf Exp $ * * sysirix.c: IRIX system call emulation. * @@ -853,7 +853,6 @@ asmlinkage int irix_exec(struct pt_regs *regs) int error, base = 0; char *filename; - lock_kernel(); if(regs->regs[2] == 1000) base = 1; filename = getname((char *) (long)regs->regs[base + 4]); @@ -865,7 +864,6 @@ asmlinkage int irix_exec(struct pt_regs *regs) putname(filename); out: - unlock_kernel(); return error; } @@ -1491,10 +1489,10 @@ asmlinkage int irix_statvfs(char *fname, struct irix_statvfs *buf) printk("[%s:%ld] Wheee.. irix_statvfs(%s,%p)\n", current->comm, current->pid, fname, buf); error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs)); - if(error) + if (error) goto out; error = user_path_walk(fname, &nd); - if (err) + if (error) goto out; error = vfs_statfs(nd.dentry->d_inode->i_sb, &kbuf); if (error) diff --git a/arch/mips/kernel/sysmips.c b/arch/mips/kernel/sysmips.c index 4b90f23d02ee..1602013ec0a0 100644 --- a/arch/mips/kernel/sysmips.c +++ b/arch/mips/kernel/sysmips.c @@ -7,7 +7,7 @@ * * Copyright (C) 1995, 1996, 1997 by Ralf Baechle * - * $Id: sysmips.c,v 1.9 2000/02/18 00:24:30 ralf Exp $ + * $Id: sysmips.c,v 1.8 2000/02/05 06:47:08 ralf Exp $ */ #include #include @@ -124,3 +124,10 @@ sys_cachectl(char *addr, int nbytes, int op) { return -ENOSYS; } + +asmlinkage int sys_pause(void) +{ + current->state = TASK_INTERRUPTIBLE; + schedule(); + return -ERESTARTNOHAND; +} diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index c9aaad50ce1e..4972885c2820 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -1,12 +1,13 @@ -/* $Id: traps.c,v 1.27 2000/01/16 01:29:05 ralf Exp $ +/* $Id: traps.c,v 1.28 2000/03/13 10:33:02 raiko Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright 1994, 1995, 1996, 1997, 1998 by Ralf Baechle + * Copyright (C) 1994 - 1999 by Ralf Baechle * Modified for R3000 by Paul M. Antoine, 1995, 1996 * Complete output from die() by Ulf Carlsson, 1998 + * Copyright (C) 1999 Silicon Graphics, Inc. */ #include #include @@ -226,8 +227,50 @@ void __die_if_kernel(const char * str, struct pt_regs * regs, const char *where, __die(str, regs, where, line); } +extern const struct exception_table_entry __start___dbe_table[]; +extern const struct exception_table_entry __stop___dbe_table[]; + +static void __declare_dbe_table(void) +{ + __asm__ __volatile__( + ".section\t__dbe_table,\"a\"\n\t" + ".previous" + ); +} + +static inline unsigned long +search_one_table(const struct exception_table_entry *first, + const struct exception_table_entry *last, + unsigned long value) +{ + const struct exception_table_entry *mid; + long diff; + + while (first < last) { + mid = (last - first) / 2 + first; + diff = mid->insn - value; + if (diff < 0) + first = mid + 1; + else + last = mid; + } + return (first == last && first->insn == value) ? first->nextinsn : 0; +} + +#define search_dbe_table(addr) \ + search_one_table(__start___dbe_table, __stop___dbe_table - 1, (addr)) + static void default_be_board_handler(struct pt_regs *regs) { + unsigned long new_epc; + unsigned long fixup = search_dbe_table(regs->cp0_epc); + + if (fixup) { + new_epc = fixup_exception(dpf_reg, fixup, regs->cp0_epc); + regs->cp0_epc = new_epc; + return; + } + /* * Assume it would be too dangerous to continue ... */ @@ -281,7 +324,7 @@ void do_fpe(struct pt_regs *regs, unsigned long fcr31) { unsigned long pc; unsigned int insn; - extern void simfp(void*); + extern void simfp(unsigned int); #ifdef CONFIG_MIPS_FPE_MODULE if (fpe_handler != NULL) { @@ -688,8 +731,7 @@ void __init trap_init(void) else memcpy((void *)KSEG0, &except_vec0_r4000, 0x80); - /* Cache error vector */ - memcpy((void *)(KSEG0 + 0x100), (void *) KSEG0, 0x80); + /* Cache error vector already set above. */ if (vce_available) { memcpy((void *)(KSEG0 + 0x180), &except_vec3_r4000, @@ -698,7 +740,6 @@ void __init trap_init(void) memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x80); } - break; case CPU_R6000: @@ -718,14 +759,14 @@ void __init trap_init(void) case CPU_R2000: case CPU_R3000: case CPU_R3000A: - memcpy((void *)KSEG0, &except_vec0_r2300, 0x80); - memcpy((void *)(KSEG0 + 0x80), &except_vec3_generic, 0x80); - break; case CPU_R3041: case CPU_R3051: case CPU_R3052: case CPU_R3081: case CPU_R3081E: + memcpy((void *)KSEG0, &except_vec0_r2300, 0x80); + memcpy((void *)(KSEG0 + 0x80), &except_vec3_generic, 0x80); + break; case CPU_R8000: printk("Detected unsupported CPU type %s.\n", cpu_names[mips_cputype]); diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c index cfbd7390b2f3..9953922b7395 100644 --- a/arch/mips/kernel/unaligned.c +++ b/arch/mips/kernel/unaligned.c @@ -7,8 +7,7 @@ * for more details. * * Copyright (C) 1996, 1998 by Ralf Baechle - * - * $Id: unaligned.c,v 1.7 1999/12/04 03:59:00 ralf Exp $ + * Copyright (C) 1999 Silicon Graphics, Inc. * * This file contains exception handler for address error exception with the * special capability to execute faulting instructions in software. The diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile index a8d0cc9c98fa..604847280df3 100644 --- a/arch/mips/lib/Makefile +++ b/arch/mips/lib/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.12 1999/12/04 03:59:00 ralf Exp $ +# $Id: Makefile,v 1.11 1999/10/17 19:55:22 harald Exp $ # # Makefile for MIPS-specific library files.. # diff --git a/arch/mips/lib/csum_partial.S b/arch/mips/lib/csum_partial.S index b814b56bff86..66fd03031c4f 100644 --- a/arch/mips/lib/csum_partial.S +++ b/arch/mips/lib/csum_partial.S @@ -1,4 +1,4 @@ -/* $Id: csum_partial.S,v 1.2 1998/05/07 23:44:01 ralf Exp $ +/* $Id: csum_partial.S,v 1.1 1998/05/04 09:12:52 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/lib/csum_partial_copy.c b/arch/mips/lib/csum_partial_copy.c index 5abb89398cdf..c73ae974c1af 100644 --- a/arch/mips/lib/csum_partial_copy.c +++ b/arch/mips/lib/csum_partial_copy.c @@ -14,7 +14,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * - * $Id: csum_partial_copy.c,v 1.3 2000/02/05 06:47:08 ralf Exp $ + * $Id: csum_partial_copy.c,v 1.2 1998/09/19 19:16:17 ralf Exp $ */ #include #include diff --git a/arch/mips/lib/floppy-no.c b/arch/mips/lib/floppy-no.c index ad4eb65ce553..fd1b47db14e6 100644 --- a/arch/mips/lib/floppy-no.c +++ b/arch/mips/lib/floppy-no.c @@ -1,4 +1,4 @@ -/* $Id: floppy-no.c,v 1.1 1998/06/30 00:21:54 ralf Exp $ +/* $Id: floppy-no.c,v 1.1 1998/05/07 18:38:32 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/lib/floppy-std.c b/arch/mips/lib/floppy-std.c index f08a89350732..ada280d55ed0 100644 --- a/arch/mips/lib/floppy-std.c +++ b/arch/mips/lib/floppy-std.c @@ -1,4 +1,4 @@ -/* $Id: floppy-std.c,v 1.3 2000/02/24 00:12:40 ralf Exp $ +/* $Id: floppy-std.c,v 1.2 1999/01/04 16:03:51 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/lib/ide-no.c b/arch/mips/lib/ide-no.c index b248028224aa..77a388c8b12c 100644 --- a/arch/mips/lib/ide-no.c +++ b/arch/mips/lib/ide-no.c @@ -1,4 +1,4 @@ -/* $Id: ide-no.c,v 1.3 1999/06/17 13:25:49 ralf Exp $ +/* $Id: ide-no.c,v 1.2 1998/06/30 00:21:54 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/lib/ide-std.c b/arch/mips/lib/ide-std.c index d7b30ee895f1..8bedbbbc8dfd 100644 --- a/arch/mips/lib/ide-std.c +++ b/arch/mips/lib/ide-std.c @@ -1,4 +1,4 @@ -/* $Id: ide-std.c,v 1.4 1999/06/17 13:25:49 ralf Exp $ +/* $Id: ide-std.c,v 1.4 1999/06/11 14:29:45 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/lib/kbd-no.c b/arch/mips/lib/kbd-no.c index 31210be29304..c94e8c000648 100644 --- a/arch/mips/lib/kbd-no.c +++ b/arch/mips/lib/kbd-no.c @@ -1,4 +1,4 @@ -/* $Id: kbd-no.c,v 1.1 1999/01/04 16:03:51 ralf Exp $ +/* $Id: kbd-no.c,v 1.1 1998/10/28 12:38:14 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/lib/kbd-std.c b/arch/mips/lib/kbd-std.c index e3cf75734347..8e7e69ecc1e7 100644 --- a/arch/mips/lib/kbd-std.c +++ b/arch/mips/lib/kbd-std.c @@ -1,4 +1,4 @@ -/* $Id: kbd-std.c,v 1.2 1999/06/17 13:25:50 ralf Exp $ +/* $Id: kbd-std.c,v 1.2 1999/06/11 14:29:45 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S index 31447c20fbbf..4850b09cea0e 100644 --- a/arch/mips/lib/memcpy.S +++ b/arch/mips/lib/memcpy.S @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * $Id: memcpy.S,v 1.4 2000/01/27 01:05:23 ralf Exp $ + * $Id: memcpy.S,v 1.3 1998/07/10 01:14:49 ralf Exp $ * * Unified implementation of memcpy, memmove and the __copy_user backend. * For __rmemcpy and memmove an exception is always a kernel bug, therefore diff --git a/arch/mips/lib/memset.S b/arch/mips/lib/memset.S index 3951087ee56a..32f175756c9f 100644 --- a/arch/mips/lib/memset.S +++ b/arch/mips/lib/memset.S @@ -7,7 +7,7 @@ * * Copyright (C) 1998 by Ralf Baechle * - * $Id: memset.S,v 1.1 1998/05/04 09:12:54 ralf Exp $ + * $Id: memset.S,v 1.2 1998/04/25 17:01:45 ralf Exp $ */ #include #include diff --git a/arch/mips/lib/r3k_dump_tlb.c b/arch/mips/lib/r3k_dump_tlb.c index adc4279e614c..34ee45953766 100644 --- a/arch/mips/lib/r3k_dump_tlb.c +++ b/arch/mips/lib/r3k_dump_tlb.c @@ -29,7 +29,7 @@ dump_tlb(int first, int last) for(i=first;i<=last;i++) { - write_32bit_cp0_register(CP0_INDEX, i); + write_32bit_cp0_register(CP0_INDEX, i<<8); __asm__ __volatile__( ".set\tnoreorder\n\t" "tlbr\n\t" diff --git a/arch/mips/lib/rtc-no.c b/arch/mips/lib/rtc-no.c index 709366c67203..7f0c02e18459 100644 --- a/arch/mips/lib/rtc-no.c +++ b/arch/mips/lib/rtc-no.c @@ -1,4 +1,4 @@ -/* $Id: rtc-no.c,v 1.1 1998/06/30 00:21:55 ralf Exp $ +/* $Id: rtc-no.c,v 1.2 1998/06/25 20:19:15 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/lib/rtc-std.c b/arch/mips/lib/rtc-std.c index afacfa44d13c..a601d1879178 100644 --- a/arch/mips/lib/rtc-std.c +++ b/arch/mips/lib/rtc-std.c @@ -1,4 +1,4 @@ -/* $Id: rtc-std.c,v 1.1 1998/06/30 00:21:55 ralf Exp $ +/* $Id: rtc-std.c,v 1.2 1998/06/25 20:19:16 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/lib/strlen_user.S b/arch/mips/lib/strlen_user.S index 4718eeb85f83..0902817c08c5 100644 --- a/arch/mips/lib/strlen_user.S +++ b/arch/mips/lib/strlen_user.S @@ -1,4 +1,4 @@ -/* $Id: strlen_user.S,v 1.4 1999/12/04 03:59:00 ralf Exp $ +/* $Id: strlen_user.S,v 1.3 1999/08/21 22:19:11 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/lib/strncpy_user.S b/arch/mips/lib/strncpy_user.S index 4e932c8e41b9..9c8e0ab85405 100644 --- a/arch/mips/lib/strncpy_user.S +++ b/arch/mips/lib/strncpy_user.S @@ -1,4 +1,4 @@ -/* $Id: strncpy_user.S,v 1.4 1999/12/04 03:59:00 ralf Exp $ +/* $Id: strncpy_user.S,v 1.3 1999/08/21 22:19:11 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/lib/strnlen_user.S b/arch/mips/lib/strnlen_user.S index 34c1de76f44b..0ae411834e51 100644 --- a/arch/mips/lib/strnlen_user.S +++ b/arch/mips/lib/strnlen_user.S @@ -1,4 +1,4 @@ -/* $Id: strnlen_user.S,v 1.2 1999/12/04 03:59:00 ralf Exp $ +/* $Id: strnlen_user.S,v 1.2 1999/11/19 20:35:21 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/lib/watch.S b/arch/mips/lib/watch.S index e0b2cde4fa69..ee9559522d1f 100644 --- a/arch/mips/lib/watch.S +++ b/arch/mips/lib/watch.S @@ -1,4 +1,4 @@ -/* $Id: watch.S,v 1.3 1999/08/21 22:19:11 ralf Exp $ +/* $Id$ * * 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 diff --git a/arch/mips/mm/andes.c b/arch/mips/mm/andes.c index e4700430b546..d76b5f14196c 100644 --- a/arch/mips/mm/andes.c +++ b/arch/mips/mm/andes.c @@ -1,4 +1,4 @@ -/* $Id: andes.c,v 1.11 2000/02/24 00:12:40 ralf Exp $ +/* $Id: andes.c,v 1.10 2000/02/13 20:52:05 harald Exp $ * * andes.c: MMU and cache operations for the R10000 (ANDES). * diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index ff03ce01ec34..e2d74fd11ef8 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c @@ -1,4 +1,4 @@ -/* $Id: fault.c,v 1.16 2000/02/18 00:24:30 ralf Exp $ +/* $Id: fault.c,v 1.15 2000/02/04 07:40:23 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -90,12 +90,17 @@ good_area: * make sure we exit gracefully rather than endlessly redo * the fault. */ - { - int fault = handle_mm_fault(mm, vma, address, write); - if (fault < 0) - goto out_of_memory; - if (!fault) - goto do_sigbus; + switch (handle_mm_fault(mm, vma, address, write)) { + case 1: + tsk->min_flt++; + break; + case 2: + tsk->maj_flt++; + break; + case 0: + goto do_sigbus; + default: + goto out_of_memory; } up(&mm->mmap_sem); diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index a6f8f5a12e54..bc7a36da1faa 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.27 2000/02/23 01:33:56 ralf Exp $ +/* $Id: init.c,v 1.26 2000/02/23 00:41:00 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/mm/loadmmu.c b/arch/mips/mm/loadmmu.c index cb5e1e66dbaa..6a1ad94aed25 100644 --- a/arch/mips/mm/loadmmu.c +++ b/arch/mips/mm/loadmmu.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: loadmmu.c,v 1.15 2000/02/24 00:12:40 ralf Exp $ + * $Id: loadmmu.c,v 1.17 2000/03/13 10:33:05 raiko Exp $ */ #include #include @@ -15,7 +15,6 @@ #include #include #include -#include /* memory functions */ void (*_clear_page)(void * page); @@ -59,6 +58,7 @@ void __init loadmmu(void) case CPU_R2000: case CPU_R3000: case CPU_R3000A: + case CPU_R3081E: printk("Loading R[23]00 MMU routines.\n"); ld_mmu_r2300(); break; diff --git a/arch/mips/mm/r2300.c b/arch/mips/mm/r2300.c index b60294bd913d..2e699b416470 100644 --- a/arch/mips/mm/r2300.c +++ b/arch/mips/mm/r2300.c @@ -7,7 +7,7 @@ * Copyright (C) 1998, 2000 Harald Koerfgen * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov * - * $Id: r2300.c,v 1.15 2000/02/24 00:12:40 ralf Exp $ + * $Id: r2300.c,v 1.16 2000/03/13 10:33:05 raiko Exp $ */ #include #include @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -116,7 +115,7 @@ static void r3k_copy_page(void * to, void * from) "I" (PAGE_SIZE)); } -static unsigned long __init size_cache(unsigned long ca_flags) +unsigned long __init r3k_cache_size(unsigned long ca_flags) { unsigned long flags, status, dummy, size; volatile unsigned long *p; @@ -152,14 +151,14 @@ static unsigned long __init size_cache(unsigned long ca_flags) static void __init probe_dcache(void) { - dcache_size = size_cache(ST0_DE); + dcache_size = r3k_cache_size(ST0_DE); printk("Primary data cache %dkb, linesize 4 bytes\n", dcache_size >> 10); } static void __init probe_icache(void) { - icache_size = size_cache(ST0_DE|ST0_CE); + icache_size = r3k_cache_size(ST0_DE|ST0_CE); printk("Primary instruction cache %dkb, linesize 8 bytes\n", icache_size >> 10); } diff --git a/arch/mips/mm/r4xx0.c b/arch/mips/mm/r4xx0.c index 6085220c6518..8fc356d9ee52 100644 --- a/arch/mips/mm/r4xx0.c +++ b/arch/mips/mm/r4xx0.c @@ -1,4 +1,4 @@ -/* $Id: r4xx0.c,v 1.30 2000/02/24 01:12:37 ralf Exp $ +/* $Id: r4xx0.c,v 1.29 2000/02/24 00:12:40 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/sgi/kernel/Makefile b/arch/mips/sgi/kernel/Makefile index c797ac1c9667..760e9fe51b05 100644 --- a/arch/mips/sgi/kernel/Makefile +++ b/arch/mips/sgi/kernel/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.8 2000/02/05 06:47:08 ralf Exp $ +# $Id: Makefile,v 1.7 1999/05/07 18:00:16 ulfc Exp $ # Makefile for the SGI specific kernel interface routines # under Linux. # diff --git a/arch/mips/sgi/kernel/indyIRQ.S b/arch/mips/sgi/kernel/indyIRQ.S index 1132c84c09ee..fd8e2a1dda1b 100644 --- a/arch/mips/sgi/kernel/indyIRQ.S +++ b/arch/mips/sgi/kernel/indyIRQ.S @@ -1,4 +1,4 @@ -/* $Id: indyIRQ.S,v 1.4 1999/08/18 23:37:45 ralf Exp $ +/* $Id: indyIRQ.S,v 1.3 1998/03/22 23:27:17 ralf Exp $ * indyIRQ.S: Interrupt exception dispatch code for FullHouse and * Guiness. * diff --git a/arch/mips/sgi/kernel/indy_hpc.c b/arch/mips/sgi/kernel/indy_hpc.c index 3fa10fb0b32d..5f4ae7644fed 100644 --- a/arch/mips/sgi/kernel/indy_hpc.c +++ b/arch/mips/sgi/kernel/indy_hpc.c @@ -6,6 +6,7 @@ * Copyright (C) 1998 Ralf Baechle */ #include +#include #include #include diff --git a/arch/mips/sgi/kernel/indy_int.c b/arch/mips/sgi/kernel/indy_int.c index 0a4647262f87..06d8573cbb27 100644 --- a/arch/mips/sgi/kernel/indy_int.c +++ b/arch/mips/sgi/kernel/indy_int.c @@ -1,4 +1,4 @@ -/* $Id: indy_int.c,v 1.17 2000/02/04 07:40:23 ralf Exp $ +/* $Id: indy_int.c,v 1.18 2000/03/02 02:36:50 ralf Exp $ * * indy_int.c: Routines for generic manipulation of the INT[23] ASIC * found on INDY workstations.. @@ -39,6 +39,24 @@ #include #include +/* + * Linux has a controller-independent x86 interrupt architecture. + * every controller has a 'controller-template', that is used + * by the main code to do the right thing. Each driver-visible + * interrupt source is transparently wired to the apropriate + * controller. Thus drivers need not be aware of the + * interrupt-controller. + * + * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC, + * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC. + * (IO-APICs assumed to be messaging to Pentium local-APICs) + * + * the code is designed to be easily extended with new/different + * interrupt controllers, without having to do assembly magic. + */ + +irq_cpustat_t irq_stat [NR_CPUS]; + /* #define DEBUG_SGINT */ struct sgi_int2_regs *sgi_i2regs; diff --git a/arch/mips/sgi/kernel/indy_mc.c b/arch/mips/sgi/kernel/indy_mc.c index 6d0c3c23dd99..11a7c510f58a 100644 --- a/arch/mips/sgi/kernel/indy_mc.c +++ b/arch/mips/sgi/kernel/indy_mc.c @@ -4,7 +4,7 @@ * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) - Indigo2 changes * - * $Id: indy_mc.c,v 1.8 1999/12/06 23:13:20 ralf Exp $ + * $Id: indy_mc.c,v 1.7 1999/12/04 03:59:00 ralf Exp $ */ #include #include diff --git a/arch/mips/sgi/kernel/indy_rtc.c b/arch/mips/sgi/kernel/indy_rtc.c index cec8aa01e6f6..bad4f6667420 100644 --- a/arch/mips/sgi/kernel/indy_rtc.c +++ b/arch/mips/sgi/kernel/indy_rtc.c @@ -1,4 +1,4 @@ -/* $Id: indy_rtc.c,v 1.2 1999/10/21 00:23:05 ralf Exp $ +/* $Id: indy_rtc.c,v 1.1 1998/06/30 00:21:58 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/sgi/kernel/indy_sc.c b/arch/mips/sgi/kernel/indy_sc.c index 6db7f1fe2be6..b41620c93c46 100644 --- a/arch/mips/sgi/kernel/indy_sc.c +++ b/arch/mips/sgi/kernel/indy_sc.c @@ -1,4 +1,4 @@ -/* $Id: indy_sc.c,v 1.13 1999/12/04 03:59:00 ralf Exp $ +/* $Id: indy_sc.c,v 1.14 2000/03/25 22:35:07 ralf Exp $ * * indy_sc.c: Indy cache managment functions. * @@ -28,16 +28,17 @@ static unsigned long scache_size; #define SC_SIZE 0x00080000 #define SC_LINE 32 #define CI_MASK (SC_SIZE - SC_LINE) -#define SC_ROUND(n) ((n) + SC_LINE - 1) #define SC_INDEX(n) ((n) & CI_MASK) static inline void indy_sc_wipe(unsigned long first, unsigned long last) { + unsigned long tmp; + __asm__ __volatile__(" .set noreorder .set mips3 .set noat - mfc0 $2, $12 + mfc0 %2, $12 li $1, 0x80 # Go 64 bit mtc0 $1, $12 @@ -50,12 +51,12 @@ static inline void indy_sc_wipe(unsigned long first, unsigned long last) bne %0, %1, 1b daddu %0, 32 - mtc0 $2, $12 # Back to 32 bit + mtc0 %2, $12 # Back to 32 bit nop; nop; nop; nop; .set mips0 .set reorder" - : /* no output */ - : "r" (first), "r" (last) + : "=r" (first), "=r" (last), "=&r" (tmp) + : "0" (first), "1" (last) : "$1"); } @@ -67,12 +68,13 @@ static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size) #ifdef DEBUG_CACHE printk("indy_sc_wback_invalidate[%08lx,%08lx]", addr, size); #endif + + if (!size) + return; + /* Which lines to flush? */ first_line = SC_INDEX(addr); - if (size <= SC_LINE) - last_line = SC_INDEX(addr); - else - last_line = SC_INDEX(addr + size - 1); + last_line = SC_INDEX(addr + size - 1); __save_and_cli(flags); if (first_line <= last_line) { @@ -80,9 +82,6 @@ static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size) goto out; } - /* Cache index wrap around. Due to the way the buddy system works - this case should not happen. We're prepared to handle it, - though. */ indy_sc_wipe(first_line, SC_SIZE - SC_LINE); indy_sc_wipe(0, last_line); out: @@ -98,8 +97,9 @@ static void indy_sc_enable(void) printk("Enabling R4600 SCACHE\n"); #endif __asm__ __volatile__(" - .set noreorder - .set mips3 + .set push + .set noreorder + .set mips3 mfc0 %2, $12 nop; nop; nop; nop; li %1, 0x80 @@ -115,8 +115,7 @@ static void indy_sc_enable(void) nop; nop; nop; nop; mtc0 %2, $12 nop; nop; nop; nop; - .set mips0 - .set reorder" + .set pop" : "=r" (tmp1), "=r" (tmp2), "=r" (addr)); } @@ -128,8 +127,9 @@ static void indy_sc_disable(void) printk("Disabling R4600 SCACHE\n"); #endif __asm__ __volatile__(" - .set noreorder - .set mips3 + .set push + .set noreorder + .set mips3 li %0, 0x1 dsll %0, 31 lui %1, 0x9000 @@ -145,9 +145,8 @@ static void indy_sc_disable(void) nop; nop; nop; nop; mtc0 %2, $12 nop; nop; nop; nop; - .set mips2 - .set reorder - " : "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)); + .set pop" + : "=r" (tmp1), "=r" (tmp2), "=r" (tmp3)); } static inline int __init indy_sc_probe(void) @@ -221,7 +220,6 @@ struct bcache_ops indy_sc_ops = { void __init indy_sc_init(void) { -return; if (indy_sc_probe()) { indy_sc_enable(); bcops = &indy_sc_ops; diff --git a/arch/mips/sgi/kernel/indy_timer.c b/arch/mips/sgi/kernel/indy_timer.c index 412089d25576..3306cdc25b32 100644 --- a/arch/mips/sgi/kernel/indy_timer.c +++ b/arch/mips/sgi/kernel/indy_timer.c @@ -1,4 +1,4 @@ -/* $Id: indy_timer.c,v 1.18 2000/02/04 07:40:23 ralf Exp $ +/* $Id: indy_timer.c,v 1.17 2000/01/21 22:34:03 ralf Exp $ * * indy_timer.c: Setting up the clock on the INDY 8254 controller. * diff --git a/arch/mips/sgi/kernel/promcon.c b/arch/mips/sgi/kernel/promcon.c index 570d27303b5f..391f9613cd5a 100644 --- a/arch/mips/sgi/kernel/promcon.c +++ b/arch/mips/sgi/kernel/promcon.c @@ -66,8 +66,7 @@ static struct console sercons = * Register console. */ -long __init sgi_prom_console_init(long kmem_start, long kmem_end) +void __init sgi_prom_console_init(void ) { register_console(&sercons); - return kmem_start; } diff --git a/arch/mips/sgi/kernel/reset.c b/arch/mips/sgi/kernel/reset.c index 02789145b8f0..53cd9b1e47e9 100644 --- a/arch/mips/sgi/kernel/reset.c +++ b/arch/mips/sgi/kernel/reset.c @@ -1,4 +1,4 @@ -/* $Id: reset.c,v 1.8 1999/10/21 00:23:05 ralf Exp $ +/* $Id: reset.c,v 1.7 1999/08/11 20:26:51 andrewb Exp $ * * Reset a SGI. * diff --git a/arch/mips/sgi/kernel/setup.c b/arch/mips/sgi/kernel/setup.c index cd0a5ed675ff..f70d31ddd77a 100644 --- a/arch/mips/sgi/kernel/setup.c +++ b/arch/mips/sgi/kernel/setup.c @@ -30,9 +30,10 @@ #ifdef CONFIG_REMOTE_DEBUG extern void rs_kgdb_hook(int); extern void breakpoint(void); +static int remote_debug = 0; #endif -#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_PROM_CONSOLE) +#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_SGI_PROM_CONSOLE) extern void console_setup(char *); #endif @@ -40,8 +41,6 @@ extern struct rtc_ops indy_rtc_ops; void indy_reboot_setup(void); void sgi_volume_set(unsigned char); -static int remote_debug = 0; - #define sgi_kh ((struct hpc_keyb *) (KSEG1 + 0x1fbd9800 + 64)) #define KBD_STAT_IBF 0x02 /* Keyboard input buffer full */ @@ -166,7 +165,7 @@ void __init sgi_setup(void) * graphics console, it is set to "d" for the first serial * line and "d2" for the second serial line. */ - ctype = prom_getenv("console"); + ctype = ArcGetEnvironmentVariable("console"); if(*ctype == 'd') { if(*(ctype+1)=='2') console_setup ("ttyS1"); @@ -197,10 +196,10 @@ void __init sgi_setup(void) #endif #ifdef CONFIG_SGI_PROM_CONSOLE - console_setup("ttyS0", NULL); + console_setup("ttyS0"); #endif - - sgi_volume_set(simple_strtoul(prom_getenv("volume"), NULL, 10)); + + sgi_volume_set(simple_strtoul(ArcGetEnvironmentVariable("volume"), NULL, 10)); #ifdef CONFIG_VT #ifdef CONFIG_SGI_NEWPORT_CONSOLE @@ -231,3 +230,4 @@ void __init sgi_setup(void) init_vino(); #endif } +__initcall(rs_init); diff --git a/arch/mips/sgi/kernel/system.c b/arch/mips/sgi/kernel/system.c index 69245c9cac5e..29bf6ced2815 100644 --- a/arch/mips/sgi/kernel/system.c +++ b/arch/mips/sgi/kernel/system.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: system.c,v 1.9 1999/10/21 00:23:05 ralf Exp $ + * $Id: system.c,v 1.8 1999/10/09 00:00:59 ralf Exp $ */ #include #include diff --git a/arch/mips/sgi/kernel/time.c b/arch/mips/sgi/kernel/time.c index 5f72701c500e..355f1c471319 100644 --- a/arch/mips/sgi/kernel/time.c +++ b/arch/mips/sgi/kernel/time.c @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.3 1999/10/09 00:00:59 ralf Exp $ +/* $Id: time.c,v 1.2 1998/04/05 11:24:00 ralf Exp $ * time.c: Generic SGI time_init() code, this will dispatch to the * appropriate per-architecture time/counter init code. * diff --git a/arch/mips/sni/Makefile b/arch/mips/sni/Makefile index bec45bb05278..b5091e159040 100644 --- a/arch/mips/sni/Makefile +++ b/arch/mips/sni/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 2000/02/18 00:24:30 ralf Exp $ +# $Id: Makefile,v 1.3 1999/01/04 16:03:57 ralf Exp $ # # Makefile for the SNI specific part of the kernel # diff --git a/arch/mips/sni/dma.c b/arch/mips/sni/dma.c index 855262547684..2f092abf4b55 100644 --- a/arch/mips/sni/dma.c +++ b/arch/mips/sni/dma.c @@ -1,4 +1,4 @@ -/* $Id: dma.c,v 1.2 2000/02/24 00:12:41 ralf Exp $ +/* $Id: dma.c,v 1.1 2000/02/18 00:24:30 ralf Exp $ * * Dynamic DMA mapping support. * diff --git a/arch/mips/sni/int-handler.S b/arch/mips/sni/int-handler.S index 247c5922de7b..57dfd661f9cb 100644 --- a/arch/mips/sni/int-handler.S +++ b/arch/mips/sni/int-handler.S @@ -1,4 +1,4 @@ -/* $Id: int-handler.S,v 1.5 1999/08/18 23:37:46 ralf Exp $ +/* $Id: int-handler.S,v 1.4 1999/01/04 16:03:58 ralf Exp $ * * SNI RM200 PCI specific interrupt handler code. * diff --git a/arch/mips/sni/io.c b/arch/mips/sni/io.c index 40e51a095ef8..80a9037c9aa6 100644 --- a/arch/mips/sni/io.c +++ b/arch/mips/sni/io.c @@ -1,4 +1,4 @@ -/* $Id: io.c,v 1.5 1999/10/09 00:00:59 ralf Exp $ +/* $Id: io.c,v 1.4 1999/08/18 23:37:46 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/sni/pci.c b/arch/mips/sni/pci.c index 942bbaf56306..cfbc4b3e73c3 100644 --- a/arch/mips/sni/pci.c +++ b/arch/mips/sni/pci.c @@ -1,4 +1,4 @@ -/* $Id: pci.c,v 1.10 2000/02/05 06:47:09 ralf Exp $ +/* $Id: pci.c,v 1.9 1999/12/04 03:59:00 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips/sni/pcimt_scache.c b/arch/mips/sni/pcimt_scache.c index 1994b0cd2c80..ce9366a200fe 100644 --- a/arch/mips/sni/pcimt_scache.c +++ b/arch/mips/sni/pcimt_scache.c @@ -1,4 +1,4 @@ -/* $Id: pcimt_scache.c,v 1.5 1999/10/09 00:00:59 ralf Exp $ +/* $Id: pcimt_scache.c,v 1.4 1999/01/04 16:03:59 ralf Exp $ * * arch/mips/sni/pcimt_scache.c * diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c index b184a7cd0614..767e2fc111d8 100644 --- a/arch/mips/sni/setup.c +++ b/arch/mips/sni/setup.c @@ -1,4 +1,4 @@ -/* $Id: setup.c,v 1.14 2000/01/27 01:05:23 ralf Exp $ +/* $Id: setup.c,v 1.13 1999/12/04 03:59:00 ralf Exp $ * * Setup pointers to hardware-dependent routines. * diff --git a/arch/mips/tools/Makefile b/arch/mips/tools/Makefile index df81fac5c212..94cfc08a04d2 100644 --- a/arch/mips/tools/Makefile +++ b/arch/mips/tools/Makefile @@ -3,7 +3,7 @@ # Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) # Copyright (C) 1997 Ralf Baechle (ralf@gnu.ai.mit.edu) # -# $Id: Makefile,v 1.2 1997/12/01 17:57:41 ralf Exp $ +# $Id: Makefile,v 1.2 1997/09/23 06:23:49 ralf Exp $ # TARGET := $(TOPDIR)/include/asm-$(ARCH)/offset.h diff --git a/arch/mips/tools/offset.c b/arch/mips/tools/offset.c index 5a33d3db6131..b76281d64800 100644 --- a/arch/mips/tools/offset.c +++ b/arch/mips/tools/offset.c @@ -1,4 +1,4 @@ -/* $Id: offset.c,v 1.12 1999/10/09 00:00:59 ralf Exp $ +/* $Id: offset.c,v 1.11 1999/09/28 22:25:50 ralf Exp $ * * offset.c: Calculate pt_regs and task_struct offsets. * diff --git a/arch/mips64/Makefile b/arch/mips64/Makefile index d884cb875405..218c22ec4e1f 100644 --- a/arch/mips64/Makefile +++ b/arch/mips64/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.6 2000/01/29 01:41:59 ralf Exp $ +# $Id: Makefile,v 1.5 2000/01/21 22:34:03 ralf Exp $ # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/arc/Makefile b/arch/mips64/arc/Makefile index 8ca0a53936ef..039caf88de56 100644 --- a/arch/mips64/arc/Makefile +++ b/arch/mips64/arc/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.3 2000/01/17 23:32:46 ralf Exp $ +# $Id: Makefile,v 1.1 1999/08/20 21:13:32 ralf Exp $ # # Makefile for the ARC prom monitor library routines under Linux. # diff --git a/arch/mips64/arc/cmdline.c b/arch/mips64/arc/cmdline.c index f6fb752f190b..8ab66fa5926a 100644 --- a/arch/mips64/arc/cmdline.c +++ b/arch/mips64/arc/cmdline.c @@ -1,4 +1,4 @@ -/* $Id: cmdline.c,v 1.2 1999/11/19 23:29:05 ralf Exp $ +/* $Id: cmdline.c,v 1.2 1999/10/19 20:51:44 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/arc/console.c b/arch/mips64/arc/console.c index cb22af6ecef5..0f087e912ee0 100644 --- a/arch/mips64/arc/console.c +++ b/arch/mips64/arc/console.c @@ -1,4 +1,4 @@ -/* $Id: console.c,v 1.3 1999/11/19 23:29:05 ralf Exp $ +/* $Id: console.c,v 1.3 1999/10/19 20:51:44 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/arc/env.c b/arch/mips64/arc/env.c index c787965aa3a1..f379c63a4166 100644 --- a/arch/mips64/arc/env.c +++ b/arch/mips64/arc/env.c @@ -1,4 +1,4 @@ -/* $Id: env.c,v 1.4 1999/11/19 23:29:05 ralf Exp $ +/* $Id: env.c,v 1.4 1999/10/19 20:51:44 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/arc/file.c b/arch/mips64/arc/file.c index 2f5047c666d8..a11583b0109e 100644 --- a/arch/mips64/arc/file.c +++ b/arch/mips64/arc/file.c @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.3 1999/11/19 23:29:05 ralf Exp $ +/* $Id: file.c,v 1.3 1999/10/19 20:51:44 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/arc/identify.c b/arch/mips64/arc/identify.c index 61725d5f2192..ab2d553ad356 100644 --- a/arch/mips64/arc/identify.c +++ b/arch/mips64/arc/identify.c @@ -1,4 +1,4 @@ -/* $Id: identify.c,v 1.5 2000/01/17 23:32:46 ralf Exp $ +/* $Id: identify.c,v 1.5 1999/11/19 20:35:21 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/arc/misc.c b/arch/mips64/arc/misc.c index 79476ab81293..703305c2023f 100644 --- a/arch/mips64/arc/misc.c +++ b/arch/mips64/arc/misc.c @@ -1,4 +1,4 @@ -/* $Id: misc.c,v 1.4 2000/01/17 23:32:46 ralf Exp $ +/* $Id: misc.c,v 1.2 1999/08/21 21:42:59 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/arc/printf.c b/arch/mips64/arc/printf.c index 84a5c76d05c7..2d175ebf8ee9 100644 --- a/arch/mips64/arc/printf.c +++ b/arch/mips64/arc/printf.c @@ -1,4 +1,4 @@ -/* $Id: printf.c,v 1.2 1999/11/19 23:29:05 ralf Exp $ +/* $Id: printf.c,v 1.1 1999/08/20 21:13:33 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/arc/salone.c b/arch/mips64/arc/salone.c index ea91b4a6ce60..f3abd90a205b 100644 --- a/arch/mips64/arc/salone.c +++ b/arch/mips64/arc/salone.c @@ -1,4 +1,4 @@ -/* $Id: salone.c,v 1.3 1999/11/19 23:29:05 ralf Exp $ +/* $Id: salone.c,v 1.2 1999/08/21 21:42:59 ralf Exp $ * * Routines to load into memory and execute stand-along program images using * ARCS PROM firmware. diff --git a/arch/mips64/arc/time.c b/arch/mips64/arc/time.c index 8333a2f001fe..82742c4fd71f 100644 --- a/arch/mips64/arc/time.c +++ b/arch/mips64/arc/time.c @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.3 1999/11/19 23:29:05 ralf Exp $ +/* $Id: time.c,v 1.2 1999/08/21 21:42:59 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/arc/tree.c b/arch/mips64/arc/tree.c index 16478ed34452..68c6787df906 100644 --- a/arch/mips64/arc/tree.c +++ b/arch/mips64/arc/tree.c @@ -1,4 +1,4 @@ -/* $Id: tree.c,v 1.4 1999/11/19 23:29:05 ralf Exp $ +/* $Id: tree.c,v 1.3 1999/09/27 16:01:37 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/boot/Makefile b/arch/mips64/boot/Makefile index 80c0e0b7d2eb..07891869526e 100644 --- a/arch/mips64/boot/Makefile +++ b/arch/mips64/boot/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 1999/12/04 03:59:00 ralf Exp $ +# $Id: Makefile,v 1.1 1999/08/18 21:46:52 ralf Exp $ # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/config.in b/arch/mips64/config.in index 0a1b4ec1837f..b2454b8cc301 100644 --- a/arch/mips64/config.in +++ b/arch/mips64/config.in @@ -1,4 +1,4 @@ -# $Id: config.in,v 1.14 2000/02/18 11:06:20 ulfc Exp $ +# $Id: config.in,v 1.19 2000/03/27 01:44:45 ralf Exp $ # # For a description of the syntax of this configuration file, # see the Configure script. @@ -17,26 +17,23 @@ bool 'Support for SGI IP27' CONFIG_SGI_IP27 if [ "$CONFIG_SGI_IP27" = "y" ]; then bool ' IP27 N-Mode' CONFIG_SGI_SN0_N_MODE bool ' Discontiguous Memory Support' CONFIG_DISCONTIGMEM + bool ' Multi-Processing support (Experimental)' CONFIG_SMP #bool ' IP27 XXL' CONFIG_SGI_SN0_XXL fi -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - bool 'Symmetric Multi-Processing support' CONFIG_SMP -fi endmenu # # Select some configuration options automatically based on user selections # -unset CONFIG_BOOT_ELF32 -unset CONFIG_BOOT_ELF64 unset CONFIG_ARC32 unset CONFIG_ARC64 +unset CONFIG_BINFMT_ELF32 unset CONFIG_BOARD_SCACHE +unset CONFIG_BOOT_ELF32 +unset CONFIG_BOOT_ELF64 unset CONFIG_COHERENT_IO -unset CONFIG_BINFMT_ELF32 - -define_bool CONFIG_ISA n -define_bool CONFIG_SBUS n +unset CONFIG_ISA +unset CONFIG_PCI if [ "$CONFIG_SGI_IP22" = "y" ]; then define_bool CONFIG_BOOT_ELF32 y @@ -51,10 +48,18 @@ if [ "$CONFIG_SGI_IP27" = "y" ]; then define_bool CONFIG_COHERENT_IO y define_bool CONFIG_PCI y define_bool CONFIG_QL_ISP_A64 y -else +fi + +if [ "$CONFIG_ISA" != "y" ]; then + define_bool CONFIG_ISA n +fi + +if [ "$CONFIG_PCI" != "y" ]; then define_bool CONFIG_PCI n fi +define_bool CONFIG_SBUS n + mainmenu_option next_comment comment 'CPU selection' @@ -210,6 +215,8 @@ if [ "$CONFIG_VT" = "y" ]; then tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then define_bool CONFIG_DUMMY_CONSOLE y + else + define_bool CONFIG_FONT_8x16 y fi fi endmenu diff --git a/arch/mips64/defconfig b/arch/mips64/defconfig index b6114af66441..fc6376f142be 100644 --- a/arch/mips64/defconfig +++ b/arch/mips64/defconfig @@ -14,13 +14,14 @@ CONFIG_SGI_IP27=y # CONFIG_SGI_SN0_N_MODE is not set # CONFIG_DISCONTIGMEM is not set -# CONFIG_ISA is not set -# CONFIG_SBUS is not set +# CONFIG_SMP is not set CONFIG_BOOT_ELF64=y CONFIG_ARC64=y CONFIG_COHERENT_IO=y CONFIG_PCI=y CONFIG_QL_ISP_A64=y +# CONFIG_ISA is not set +# CONFIG_SBUS is not set # # CPU selection @@ -43,7 +44,7 @@ CONFIG_PCI_NAMES=y # CONFIG_PCMCIA is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_SYSCTL is not set +CONFIG_SYSCTL=y CONFIG_BINFMT_ELF=y CONFIG_MIPS32_COMPAT=y CONFIG_BINFMT_ELF32=y @@ -52,7 +53,9 @@ CONFIG_BINFMT_ELF32=y # # Loadable module support # -# CONFIG_MODULES is not set +CONFIG_MODULES=y +# CONFIG_MODVERSIONS is not set +CONFIG_KMOD=y CONFIG_PCI_NAMES=y # @@ -69,8 +72,13 @@ CONFIG_PCI_NAMES=y # # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_LVM is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_RAID15_DANGEROUS is not set # CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -149,12 +157,12 @@ CONFIG_SD_EXTRA_DEVS=40 # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set # CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_IPS is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_DMA is not set @@ -180,11 +188,9 @@ CONFIG_SD_EXTRA_DEVS=40 CONFIG_SCSI_QLOGIC_ISP=y # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_SEAGATE is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set -# CONFIG_SCSI_ULTRASTOR is not set # # I2O device support @@ -321,11 +327,6 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_DRM is not set # CONFIG_DRM_TDFX is not set -# -# USB support -# -# CONFIG_USB is not set - # # File systems # @@ -333,6 +334,7 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -342,10 +344,12 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS is not set # CONFIG_ISO9660_FS is not set # CONFIG_JOLIET is not set # CONFIG_MINIX_FS is not set # CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set @@ -353,23 +357,39 @@ CONFIG_PROC_FS=y # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set CONFIG_ROOT_NFS=y # CONFIG_NFSD is not set +# CONFIG_NFSD_V3 is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types @@ -382,6 +402,7 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_MAC_PARTITION is not set # CONFIG_MSDOS_PARTITION is not set CONFIG_SGI_PARTITION=y +# CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set # CONFIG_NLS is not set CONFIG_KCORE_ELF=y @@ -391,9 +412,15 @@ CONFIG_KCORE_ELF=y # # CONFIG_SOUND is not set +# +# USB support +# +# CONFIG_USB is not set + # # Kernel hacking # CONFIG_CROSSCOMPILE=y +# CONFIG_MIPS_FPE_MODULE is not set # CONFIG_REMOTE_DEBUG is not set -CONFIG_MAGIC_SYSRQ=y +# CONFIG_MAGIC_SYSRQ is not set diff --git a/arch/mips64/defconfig-ip22 b/arch/mips64/defconfig-ip22 index d425580c5087..e9a442e43a1c 100644 --- a/arch/mips64/defconfig-ip22 +++ b/arch/mips64/defconfig-ip22 @@ -16,6 +16,9 @@ CONFIG_BOOT_ELF32=y CONFIG_ARC32=y CONFIG_BOARD_SCACHE=y CONFIG_ARC_MEMORY=y +# CONFIG_ISA is not set +# CONFIG_PCI is not set +# CONFIG_SBUS is not set # # CPU selection @@ -32,14 +35,11 @@ CONFIG_CPU_R5000=y # # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_NET=y - -# -# PCMCIA/CardBus support -# +# CONFIG_HOTPLUG is not set # CONFIG_PCMCIA is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_SYSCTL is not set +CONFIG_SYSCTL=y CONFIG_BINFMT_ELF=y # CONFIG_MIPS32_COMPAT is not set # CONFIG_BINFMT_MISC is not set @@ -53,24 +53,23 @@ CONFIG_BINFMT_ELF=y # Block devices # # CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_DEV_IDE is not set - -# -# Please see Documentation/ide.txt for help/info on IDE drives -# -# CONFIG_BLK_DEV_HD_ONLY is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set # # Additional Block Devices # # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_LVM is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_RAID15_DANGEROUS is not set # CONFIG_BLK_DEV_RAM is not set -# CONFIG_BLK_DEV_XD is not set -# CONFIG_PARIDE is not set -# CONFIG_BLK_DEV_IDE_MODES is not set -# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -102,6 +101,7 @@ CONFIG_SKB_LARGE=y # # CONFIG_IPX is not set # CONFIG_ATALK is not set +# CONFIG_DECNET is not set # # Telephony Support @@ -109,6 +109,13 @@ CONFIG_SKB_LARGE=y # CONFIG_PHONE is not set # CONFIG_PHONE_IXJ is not set +# +# ATA/IDE/MFM/RLL support +# +# CONFIG_IDE is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_HD is not set + # # SCSI support # @@ -118,7 +125,6 @@ CONFIG_SKB_LARGE=y # I2O device support # # CONFIG_I2O is not set -# CONFIG_I2O_PCI is not set # CONFIG_I2O_BLOCK is not set # CONFIG_I2O_LAN is not set # CONFIG_I2O_SCSI is not set @@ -134,6 +140,7 @@ CONFIG_NETDEVICES=y # # CONFIG_ARCNET is not set # CONFIG_DUMMY is not set +# CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_NET_SB1000 is not set @@ -158,7 +165,7 @@ CONFIG_NETDEVICES=y # CONFIG_NET_RADIO is not set # -# Token Ring driver support +# Token Ring devices # # CONFIG_TR is not set # CONFIG_NET_FC is not set @@ -240,11 +247,6 @@ CONFIG_VT_CONSOLE=y # CONFIG_DRM is not set # CONFIG_DRM_TDFX is not set -# -# USB support -# -# CONFIG_USB is not set - # # File systems # @@ -252,6 +254,7 @@ CONFIG_VT_CONSOLE=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -261,10 +264,12 @@ CONFIG_VT_CONSOLE=y # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS is not set # CONFIG_ISO9660_FS is not set # CONFIG_JOLIET is not set # CONFIG_MINIX_FS is not set # CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set @@ -272,23 +277,39 @@ CONFIG_PROC_FS=y # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set CONFIG_ROOT_NFS=y # CONFIG_NFSD is not set +# CONFIG_NFSD_V3 is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types @@ -301,6 +322,7 @@ CONFIG_SGI_PARTITION=y # Console drivers # CONFIG_SGI_NEWPORT_CONSOLE=y +CONFIG_FONT_8x16=y CONFIG_KCORE_ELF=y # @@ -314,6 +336,11 @@ CONFIG_KCORE_ELF=y # CONFIG_SGI_SERIAL is not set CONFIG_SGI_DS1286=y +# +# USB support +# +# CONFIG_USB is not set + # # Kernel hacking # diff --git a/arch/mips64/defconfig-ip27 b/arch/mips64/defconfig-ip27 index 039ffd84ff35..fc6376f142be 100644 --- a/arch/mips64/defconfig-ip27 +++ b/arch/mips64/defconfig-ip27 @@ -14,11 +14,14 @@ CONFIG_SGI_IP27=y # CONFIG_SGI_SN0_N_MODE is not set # CONFIG_DISCONTIGMEM is not set +# CONFIG_SMP is not set CONFIG_BOOT_ELF64=y CONFIG_ARC64=y CONFIG_COHERENT_IO=y CONFIG_PCI=y CONFIG_QL_ISP_A64=y +# CONFIG_ISA is not set +# CONFIG_SBUS is not set # # CPU selection @@ -37,14 +40,11 @@ CONFIG_CPU_R10000=y # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_NET=y CONFIG_PCI_NAMES=y - -# -# PCMCIA/CardBus support -# +# CONFIG_HOTPLUG is not set # CONFIG_PCMCIA is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_SYSCTL is not set +CONFIG_SYSCTL=y CONFIG_BINFMT_ELF=y CONFIG_MIPS32_COMPAT=y CONFIG_BINFMT_ELF32=y @@ -53,33 +53,32 @@ CONFIG_BINFMT_ELF32=y # # Loadable module support # -# CONFIG_MODULES is not set +CONFIG_MODULES=y +# CONFIG_MODVERSIONS is not set +CONFIG_KMOD=y CONFIG_PCI_NAMES=y # # Block devices # # CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_DEV_IDE is not set - -# -# Please see Documentation/ide.txt for help/info on IDE drives -# -# CONFIG_BLK_DEV_HD_ONLY is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set # CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set # # Additional Block Devices # # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_LVM is not set # CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_RAID15_DANGEROUS is not set # CONFIG_BLK_DEV_RAM is not set -# CONFIG_BLK_DEV_XD is not set -# CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_PARIDE is not set -# CONFIG_BLK_DEV_IDE_MODES is not set -# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_INITRD is not set # # Networking options @@ -111,6 +110,7 @@ CONFIG_SKB_LARGE=y # # CONFIG_IPX is not set # CONFIG_ATALK is not set +# CONFIG_DECNET is not set # # Telephony Support @@ -118,6 +118,13 @@ CONFIG_SKB_LARGE=y # CONFIG_PHONE is not set # CONFIG_PHONE_IXJ is not set +# +# ATA/IDE/MFM/RLL support +# +# CONFIG_IDE is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_HD is not set + # # SCSI support # @@ -129,7 +136,6 @@ CONFIG_SCSI=y CONFIG_BLK_DEV_SD=y CONFIG_SD_EXTRA_DEVS=40 # CONFIG_CHR_DEV_ST is not set -CONFIG_ST_EXTRA_DEVS=2 # CONFIG_BLK_DEV_SR is not set # CONFIG_CHR_DEV_SG is not set @@ -144,18 +150,19 @@ CONFIG_ST_EXTRA_DEVS=2 # # SCSI low-level drivers # +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_7000FASST is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AHA152X is not set # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set # CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_IPS is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_DMA is not set @@ -181,11 +188,9 @@ CONFIG_ST_EXTRA_DEVS=2 CONFIG_SCSI_QLOGIC_ISP=y # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_SEAGATE is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set -# CONFIG_SCSI_ULTRASTOR is not set # # I2O device support @@ -207,6 +212,7 @@ CONFIG_NETDEVICES=y # # CONFIG_ARCNET is not set # CONFIG_DUMMY is not set +# CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_NET_SB1000 is not set @@ -221,7 +227,7 @@ CONFIG_SGI_IOC3_ETH=y # CONFIG_NET_VENDOR_RACAL is not set # CONFIG_DEPCA is not set # CONFIG_NET_ISA is not set -# CONFIG_NET_EISA is not set +# CONFIG_NET_PCI is not set # CONFIG_NET_POCKET is not set # @@ -240,7 +246,7 @@ CONFIG_SGI_IOC3_ETH=y # CONFIG_NET_RADIO is not set # -# Token Ring driver support +# Token Ring devices # # CONFIG_TR is not set # CONFIG_NET_FC is not set @@ -322,17 +328,13 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_DRM_TDFX is not set # -# USB support -# -# CONFIG_USB is not set - -# -# Filesystems +# File systems # # CONFIG_QUOTA is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_BFS_FS is not set @@ -342,6 +344,7 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set +# CONFIG_RAMFS is not set # CONFIG_ISO9660_FS is not set # CONFIG_JOLIET is not set # CONFIG_MINIX_FS is not set @@ -349,6 +352,9 @@ CONFIG_SERIAL_CONSOLE=y # CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_QNX4FS_RW is not set @@ -366,6 +372,7 @@ CONFIG_EXT2_FS=y # # CONFIG_CODA_FS is not set CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set CONFIG_ROOT_NFS=y # CONFIG_NFSD is not set # CONFIG_NFSD_V3 is not set @@ -373,12 +380,30 @@ CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_MOUNT_SUBDIR is not set +# CONFIG_NCPFS_NDS_DOMAINS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set # # Partition Types # -# CONFIG_PARTITION_ADVANCED is not set +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +# CONFIG_MSDOS_PARTITION is not set CONFIG_SGI_PARTITION=y +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set # CONFIG_NLS is not set CONFIG_KCORE_ELF=y @@ -387,9 +412,15 @@ CONFIG_KCORE_ELF=y # # CONFIG_SOUND is not set +# +# USB support +# +# CONFIG_USB is not set + # # Kernel hacking # CONFIG_CROSSCOMPILE=y +# CONFIG_MIPS_FPE_MODULE is not set # CONFIG_REMOTE_DEBUG is not set -CONFIG_MAGIC_SYSRQ=y +# CONFIG_MAGIC_SYSRQ is not set diff --git a/arch/mips64/kernel/Makefile b/arch/mips64/kernel/Makefile index 0f70cba13480..e1edfc6a7a5b 100644 --- a/arch/mips64/kernel/Makefile +++ b/arch/mips64/kernel/Makefile @@ -18,13 +18,17 @@ O_OBJS := branch.o entry.o proc.o process.o ptrace.o r4k_cache.o r4k_fpu.o \ OX_OBJS := mips64_ksyms.o ifdef CONFIG_MIPS32_COMPAT -O_OBJS += linux32.o scall_o32.o signal32.o +O_OBJS += linux32.o scall_o32.o signal32.o ioctl32.o endif ifdef CONFIG_BINFMT_ELF32 O_OBJS += binfmt_elf32.o endif +ifdef CONFIG_SMP +O_OBJS += smp.o +endif + clean: include $(TOPDIR)/Rules.make diff --git a/arch/mips64/kernel/binfmt_elf32.c b/arch/mips64/kernel/binfmt_elf32.c index 5575b0f28a45..a199839a6404 100644 --- a/arch/mips64/kernel/binfmt_elf32.c +++ b/arch/mips64/kernel/binfmt_elf32.c @@ -1,4 +1,4 @@ -/* $Id: binfmt_elf32.c,v 1.2 2000/01/17 23:32:46 ralf Exp $ +/* $Id: binfmt_elf32.c,v 1.1 1999/11/24 06:56:13 ralf Exp $ * * Support for 32-bit Linux/MIPS ELF binaries. * diff --git a/arch/mips64/kernel/branch.c b/arch/mips64/kernel/branch.c index 97371fddf754..0b2f51c7fc5b 100644 --- a/arch/mips64/kernel/branch.c +++ b/arch/mips64/kernel/branch.c @@ -1,4 +1,4 @@ -/* $Id: branch.c,v 1.1 1999/12/04 03:59:00 ralf Exp $ +/* $Id: branch.c,v 1.1 1999/10/09 20:55:05 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/kernel/entry.S b/arch/mips64/kernel/entry.S index 9e05e7a68c17..8f61ca7eec9e 100644 --- a/arch/mips64/kernel/entry.S +++ b/arch/mips64/kernel/entry.S @@ -10,6 +10,7 @@ * Copyright (C) 1999, 2000 Silicon Graphics */ #include + #include #include #include @@ -34,10 +35,11 @@ reschedule: jal schedule FEXPORT(ret_from_sys_call) FEXPORT(ret_from_irq) -#ifdef CONFIG_SMP -#error Barffff... -#else la t1, softirq_state +#ifdef CONFIG_SMP + lwu t0, TASK_PROCESSOR($28) + dsll t0, t0, 5 + daddu t1, t0 #endif lw t0, 0 (t1) lw t1, 4 (t1) # unused delay slot diff --git a/arch/mips64/kernel/head.S b/arch/mips64/kernel/head.S index 2621873e80dc..cc19d318c2bc 100644 --- a/arch/mips64/kernel/head.S +++ b/arch/mips64/kernel/head.S @@ -1,4 +1,4 @@ -/* $Id: head.S,v 1.4 2000/01/25 01:35:05 ralf Exp $ +/* $Id: head.S,v 1.6 2000/03/27 21:05:04 ulfc Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -20,6 +20,15 @@ #include #include +#define ARC64_TWIDDLE_PC \ +#ifdef CONFIG_ARC64 \ + /* We get launched at a XKPHYS address but the kernel is linked to \ + run at a KSEG0 address, so jump there. */ \ + la t0, 1f \ + jr t0 \ +1: \ +#endif + .text EXPORT(stext) # used for profiling @@ -29,13 +38,7 @@ EXPORT(_stext) NESTED(kernel_entry, 16, sp) # kernel entry point -#ifdef CONFIG_ARC64 - /* We get launched at a XKPHYS address but the kernel is linked to - run at a KSEG0 address, so jump there. */ - la t0, 1f - jr t0 -1: -#endif + ARC64_TWIDDLE_PC ori sp, 0xf # align stack on 16 byte. xori sp, 0xf @@ -47,24 +50,44 @@ NESTED(kernel_entry, 16, sp) # kernel entry point CLI # disable interrupts mfc0 t0, CP0_STATUS - li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3) + /* + * On IP27, I am seeing the TS bit set when the + * kernel is loaded. Maybe because the kernel is + * in ckseg0 and not xkphys? Clear it anyway ... + */ + li t1, ~(ST0_TS|ST0_CU1|ST0_CU2|ST0_CU3) and t0, t1 - or t0, (ST0_CU0|ST0_KX|ST0_SX) - mtc0 t0, CP0_STATUS + or t0, (ST0_CU0|ST0_KX|ST0_SX|ST0_FR) # Bogosity: cu0 indicates kernel + mtc0 t0, CP0_STATUS # thread in copy_thread. la $28, init_task_union # init current pointer daddiu t0, $28, KERNEL_STACK_SIZE-32 sd t0, kernelsp dsubu sp, t0, 4*SZREG # init stack pointer - + move t0, $28 +#ifdef CONFIG_SMP + mtc0 t0, CP0_WATCHLO + dsrl32 t0, t0, 0 + mtc0 t0, CP0_WATCHHI +#endif jal start_kernel 1: b 1b # just in case ... END(kernel_entry) +NESTED(bootstrap, 16, sp) + ARC64_TWIDDLE_PC + CLI + mfc0 t0, CP0_STATUS + li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3) + and t0, t1 + or t0, (ST0_CU0|ST0_KX|ST0_SX|ST0_FR) # Bogosity: cu0 indicates kernel + mtc0 t0, CP0_STATUS # thread in copy_thread. + jal cboot + END(bootstrap) + __FINIT .comm kernelsp, 8, 8 # current stackpointer - .comm current_pgd, 8, 8 # current page tables #define PAGE_SIZE 0x1000 @@ -81,5 +104,5 @@ NESTED(kernel_entry, 16, sp) # kernel entry point page swapper_pg_dir, 1 page invalid_pte_table, 1 page invalid_pmd_table, 1 + page empty_bad_page_table, 1 page empty_bad_page - page empty_bad_page_table diff --git a/arch/mips64/kernel/ioctl32.c b/arch/mips64/kernel/ioctl32.c new file mode 100644 index 000000000000..45c9cf57ce52 --- /dev/null +++ b/arch/mips64/kernel/ioctl32.c @@ -0,0 +1,529 @@ +/* $Id: ioctl32.c,v 1.1 2000/04/05 00:43:25 ulfc Exp $ + * ioctl32.c: Conversion between 32bit and 64bit native ioctls. + * + * Copyright (C) 2000 Silicon Graphics, Inc. + * Written by Ulf Carlsson (ulfc@engr.sgi.com) + * + * Mostly from the sparc64 ioctl32 implementation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define A(__x) ((unsigned long)(__x)) + +long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); + +struct timeval32 { + int tv_sec; + int tv_usec; +}; + +#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int) +#define EXT2_IOC32_SETFLAGS _IOW('f', 2, int) +#define EXT2_IOC32_GETVERSION _IOR('v', 1, int) +#define EXT2_IOC32_SETVERSION _IOW('v', 2, int) + +static int do_siocgstamp(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + struct timeval32 *up = (struct timeval32 *)arg; + struct timeval ktv; + mm_segment_t old_fs = get_fs(); + int err; + + set_fs(KERNEL_DS); + err = sys_ioctl(fd, cmd, (unsigned long)&ktv); + set_fs(old_fs); + if(!err) { + err = put_user(ktv.tv_sec, &up->tv_sec); + err |= __put_user(ktv.tv_usec, &up->tv_usec); + } + return err; +} + +struct ifmap32 { + unsigned int mem_start; + unsigned int mem_end; + unsigned short base_addr; + unsigned char irq; + unsigned char dma; + unsigned char port; +}; + +struct ifreq32 { +#define IFHWADDRLEN 6 +#define IFNAMSIZ 16 + union { + char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + } ifr_ifrn; + union { + struct sockaddr ifru_addr; + struct sockaddr ifru_dstaddr; + struct sockaddr ifru_broadaddr; + struct sockaddr ifru_netmask; + struct sockaddr ifru_hwaddr; + short ifru_flags; + int ifru_ivalue; + int ifru_mtu; + struct ifmap32 ifru_map; + char ifru_slave[IFNAMSIZ]; /* Just fits the size */ + char ifru_newname[IFNAMSIZ]; + __kernel_caddr_t32 ifru_data; + } ifr_ifru; +}; + +struct ifconf32 { + int ifc_len; /* size of buffer */ + __kernel_caddr_t32 ifcbuf; +}; + +static int dev_ifname32(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + struct ireq32 *uir32 = (struct ireq32 *)arg; + struct net_device *dev; + struct ifreq32 ifr32; + + if (copy_from_user(&ifr32, uir32, sizeof(struct ifreq32))) + return -EFAULT; + + read_lock(&dev_base_lock); + dev = __dev_get_by_index(ifr32.ifr_ifindex); + if (!dev) { + read_unlock(&dev_base_lock); + return -ENODEV; + } + + strcpy(ifr32.ifr_name, dev->name); + read_unlock(&dev_base_lock); + + if (copy_to_user(uir32, &ifr32, sizeof(struct ifreq32))) + return -EFAULT; + + return 0; +} + +static inline int dev_ifconf(unsigned int fd, unsigned int cmd, + unsigned long arg) +{ + struct ioconf32 *uifc32 = (struct ioconf32 *)arg; + struct ifconf32 ifc32; + struct ifconf ifc; + struct ifreq32 *ifr32; + struct ifreq *ifr; + mm_segment_t old_fs; + int len; + int err; + + if (copy_from_user(&ifc32, uifc32, sizeof(struct ifconf32))) + return -EFAULT; + + if(ifc32.ifcbuf == 0) { + ifc32.ifc_len = 0; + ifc.ifc_len = 0; + ifc.ifc_buf = NULL; + } else { + ifc.ifc_len = ((ifc32.ifc_len / sizeof (struct ifreq32))) * + sizeof (struct ifreq); + ifc.ifc_buf = kmalloc (ifc.ifc_len, GFP_KERNEL); + if (!ifc.ifc_buf) + return -ENOMEM; + } + ifr = ifc.ifc_req; + ifr32 = (struct ifreq32 *)A(ifc32.ifcbuf); + len = ifc32.ifc_len / sizeof (struct ifreq32); + while (len--) { + if (copy_from_user(ifr++, ifr32++, sizeof (struct ifreq32))) { + err = -EFAULT; + goto out; + } + } + + old_fs = get_fs(); + set_fs (KERNEL_DS); + err = sys_ioctl (fd, SIOCGIFCONF, (unsigned long)&ifc); + set_fs (old_fs); + if (err) + goto out; + + ifr = ifc.ifc_req; + ifr32 = (struct ifreq32 *)A(ifc32.ifcbuf); + len = ifc.ifc_len / sizeof (struct ifreq); + ifc32.ifc_len = len * sizeof (struct ifreq32); + + while (len--) { + if (copy_to_user(ifr32++, ifr++, sizeof (struct ifreq32))) { + err = -EFAULT; + goto out; + } + } + + if (copy_to_user(uifc32, &ifc32, sizeof(struct ifconf32))) { + err = -EFAULT; + goto out; + } +out: + if(ifc.ifc_buf != NULL) + kfree (ifc.ifc_buf); + return err; +} + +static inline int dev_ifsioc(unsigned int fd, unsigned int cmd, + unsigned long arg) +{ + struct ifreq32 *uifr = (struct ifreq32 *)arg; + struct ifreq ifr; + mm_segment_t old_fs; + int err; + + switch (cmd) { + case SIOCSIFMAP: + err = copy_from_user(&ifr, uifr, sizeof(ifr.ifr_name)); + err |= __get_user(ifr.ifr_map.mem_start, &(uifr->ifr_ifru.ifru_map.mem_start)); + err |= __get_user(ifr.ifr_map.mem_end, &(uifr->ifr_ifru.ifru_map.mem_end)); + err |= __get_user(ifr.ifr_map.base_addr, &(uifr->ifr_ifru.ifru_map.base_addr)); + err |= __get_user(ifr.ifr_map.irq, &(uifr->ifr_ifru.ifru_map.irq)); + err |= __get_user(ifr.ifr_map.dma, &(uifr->ifr_ifru.ifru_map.dma)); + err |= __get_user(ifr.ifr_map.port, &(uifr->ifr_ifru.ifru_map.port)); + if (err) + return -EFAULT; + break; + default: + if (copy_from_user(&ifr, uifr, sizeof(struct ifreq32))) + return -EFAULT; + break; + } + old_fs = get_fs(); + set_fs (KERNEL_DS); + err = sys_ioctl (fd, cmd, (unsigned long)&ifr); + set_fs (old_fs); + if (!err) { + switch (cmd) { + case SIOCGIFFLAGS: + case SIOCGIFMETRIC: + case SIOCGIFMTU: + case SIOCGIFMEM: + case SIOCGIFHWADDR: + case SIOCGIFINDEX: + case SIOCGIFADDR: + case SIOCGIFBRDADDR: + case SIOCGIFDSTADDR: + case SIOCGIFNETMASK: + case SIOCGIFTXQLEN: + if (copy_to_user(uifr, &ifr, sizeof(struct ifreq32))) + return -EFAULT; + break; + case SIOCGIFMAP: + err = copy_to_user(uifr, &ifr, sizeof(ifr.ifr_name)); + err |= __put_user(ifr.ifr_map.mem_start, &(uifr->ifr_ifru.ifru_map.mem_start)); + err |= __put_user(ifr.ifr_map.mem_end, &(uifr->ifr_ifru.ifru_map.mem_end)); + err |= __put_user(ifr.ifr_map.base_addr, &(uifr->ifr_ifru.ifru_map.base_addr)); + err |= __put_user(ifr.ifr_map.irq, &(uifr->ifr_ifru.ifru_map.irq)); + err |= __put_user(ifr.ifr_map.dma, &(uifr->ifr_ifru.ifru_map.dma)); + err |= __put_user(ifr.ifr_map.port, &(uifr->ifr_ifru.ifru_map.port)); + if (err) + err = -EFAULT; + break; + } + } + return err; +} + +struct rtentry32 +{ + unsigned int rt_pad1; + struct sockaddr rt_dst; /* target address */ + struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */ + struct sockaddr rt_genmask; /* target network mask (IP) */ + unsigned short rt_flags; + short rt_pad2; + unsigned int rt_pad3; + unsigned int rt_pad4; + short rt_metric; /* +1 for binary compatibility! */ + unsigned int rt_dev; /* forcing the device at add */ + unsigned int rt_mtu; /* per route MTU/Window */ +#ifndef __KERNEL__ +#define rt_mss rt_mtu /* Compatibility :-( */ +#endif + unsigned int rt_window; /* Window clamping */ + unsigned short rt_irtt; /* Initial RTT */ +}; + +static inline int routing_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + struct rtentry32 *ur = (struct rtentry32 *)arg; + struct rtentry r; + char devname[16]; + u32 rtdev; + int ret; + mm_segment_t old_fs = get_fs(); + + ret = copy_from_user (&r.rt_dst, &(ur->rt_dst), 3 * sizeof(struct sockaddr)); + ret |= __get_user (r.rt_flags, &(ur->rt_flags)); + ret |= __get_user (r.rt_metric, &(ur->rt_metric)); + ret |= __get_user (r.rt_mtu, &(ur->rt_mtu)); + ret |= __get_user (r.rt_window, &(ur->rt_window)); + ret |= __get_user (r.rt_irtt, &(ur->rt_irtt)); + ret |= __get_user (rtdev, &(ur->rt_dev)); + if (rtdev) { + ret |= copy_from_user (devname, (char *)A(rtdev), 15); + r.rt_dev = devname; devname[15] = 0; + } else + r.rt_dev = 0; + if (ret) + return -EFAULT; + set_fs (KERNEL_DS); + ret = sys_ioctl (fd, cmd, (long)&r); + set_fs (old_fs); + return ret; +} + +static int do_ext2_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + /* These are just misnamed, they actually get/put from/to user an int */ + switch (cmd) { + case EXT2_IOC32_GETFLAGS: cmd = EXT2_IOC_GETFLAGS; break; + case EXT2_IOC32_SETFLAGS: cmd = EXT2_IOC_SETFLAGS; break; + case EXT2_IOC32_GETVERSION: cmd = EXT2_IOC_GETVERSION; break; + case EXT2_IOC32_SETVERSION: cmd = EXT2_IOC_SETVERSION; break; + } + return sys_ioctl(fd, cmd, arg); +} + +static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + mm_segment_t old_fs = get_fs(); + int err; + unsigned long val; + + set_fs (KERNEL_DS); + err = sys_ioctl(fd, cmd, (unsigned long)&val); + set_fs (old_fs); + if (!err && put_user((unsigned int) val, (u32 *)arg)) + return -EFAULT; + return err; +} + +struct ioctl32_handler { + unsigned int cmd; + int (*function)(unsigned int, unsigned int, unsigned long); +}; + +struct ioctl32_list { + struct ioctl32_handler handler; + struct ioctl32_list *next; +}; + +#define IOCTL32_DEFAULT(cmd) { { cmd, (void *) sys_ioctl }, 0 } +#define IOCTL32_HANDLER(cmd, handler) { { cmd, (void *) handler }, 0 } + +static struct ioctl32_list ioctl32_handler_table[] = { + IOCTL32_DEFAULT(TCGETA), + IOCTL32_DEFAULT(TCSETA), + IOCTL32_DEFAULT(TCSETAW), + IOCTL32_DEFAULT(TCSETAF), + IOCTL32_DEFAULT(TCSBRK), + IOCTL32_DEFAULT(TCXONC), + IOCTL32_DEFAULT(TCFLSH), + IOCTL32_DEFAULT(TCGETS), + IOCTL32_DEFAULT(TCSETS), + IOCTL32_DEFAULT(TCSETSW), + IOCTL32_DEFAULT(TCSETSF), + IOCTL32_DEFAULT(TIOCLINUX), + + IOCTL32_DEFAULT(TIOCGETD), + IOCTL32_DEFAULT(TIOCSETD), + IOCTL32_DEFAULT(TIOCEXCL), + IOCTL32_DEFAULT(TIOCNXCL), + IOCTL32_DEFAULT(TIOCCONS), + IOCTL32_DEFAULT(TIOCGSOFTCAR), + IOCTL32_DEFAULT(TIOCSSOFTCAR), + IOCTL32_DEFAULT(TIOCSWINSZ), + IOCTL32_DEFAULT(TIOCGWINSZ), + IOCTL32_DEFAULT(TIOCMGET), + IOCTL32_DEFAULT(TIOCMBIC), + IOCTL32_DEFAULT(TIOCMBIS), + IOCTL32_DEFAULT(TIOCMSET), + IOCTL32_DEFAULT(TIOCPKT), + IOCTL32_DEFAULT(TIOCNOTTY), + IOCTL32_DEFAULT(TIOCSTI), + IOCTL32_DEFAULT(TIOCOUTQ), + IOCTL32_DEFAULT(TIOCSPGRP), + IOCTL32_DEFAULT(TIOCGPGRP), + IOCTL32_DEFAULT(TIOCSCTTY), + IOCTL32_DEFAULT(TIOCGPTN), + IOCTL32_DEFAULT(TIOCSPTLCK), + IOCTL32_DEFAULT(TIOCGSERIAL), + IOCTL32_DEFAULT(TIOCSSERIAL), + IOCTL32_DEFAULT(TIOCSERGETLSR), + + IOCTL32_DEFAULT(FIOCLEX), + IOCTL32_DEFAULT(FIONCLEX), + IOCTL32_DEFAULT(FIOASYNC), + IOCTL32_DEFAULT(FIONBIO), + IOCTL32_DEFAULT(FIONREAD), + + IOCTL32_DEFAULT(PIO_FONT), + IOCTL32_DEFAULT(GIO_FONT), + IOCTL32_DEFAULT(KDSIGACCEPT), + IOCTL32_DEFAULT(KDGETKEYCODE), + IOCTL32_DEFAULT(KDSETKEYCODE), + IOCTL32_DEFAULT(KIOCSOUND), + IOCTL32_DEFAULT(KDMKTONE), + IOCTL32_DEFAULT(KDGKBTYPE), + IOCTL32_DEFAULT(KDSETMODE), + IOCTL32_DEFAULT(KDGETMODE), + IOCTL32_DEFAULT(KDSKBMODE), + IOCTL32_DEFAULT(KDGKBMODE), + IOCTL32_DEFAULT(KDSKBMETA), + IOCTL32_DEFAULT(KDGKBMETA), + IOCTL32_DEFAULT(KDGKBENT), + IOCTL32_DEFAULT(KDSKBENT), + IOCTL32_DEFAULT(KDGKBSENT), + IOCTL32_DEFAULT(KDSKBSENT), + IOCTL32_DEFAULT(KDGKBDIACR), + IOCTL32_DEFAULT(KDSKBDIACR), + IOCTL32_DEFAULT(KDGKBLED), + IOCTL32_DEFAULT(KDSKBLED), + IOCTL32_DEFAULT(KDGETLED), + IOCTL32_DEFAULT(KDSETLED), + IOCTL32_DEFAULT(GIO_SCRNMAP), + IOCTL32_DEFAULT(PIO_SCRNMAP), + IOCTL32_DEFAULT(GIO_UNISCRNMAP), + IOCTL32_DEFAULT(PIO_UNISCRNMAP), + IOCTL32_DEFAULT(PIO_FONTRESET), + IOCTL32_DEFAULT(PIO_UNIMAPCLR), + + IOCTL32_DEFAULT(VT_SETMODE), + IOCTL32_DEFAULT(VT_GETMODE), + IOCTL32_DEFAULT(VT_GETSTATE), + IOCTL32_DEFAULT(VT_OPENQRY), + IOCTL32_DEFAULT(VT_ACTIVATE), + IOCTL32_DEFAULT(VT_WAITACTIVE), + IOCTL32_DEFAULT(VT_RELDISP), + IOCTL32_DEFAULT(VT_DISALLOCATE), + IOCTL32_DEFAULT(VT_RESIZE), + IOCTL32_DEFAULT(VT_RESIZEX), + IOCTL32_DEFAULT(VT_LOCKSWITCH), + IOCTL32_DEFAULT(VT_UNLOCKSWITCH), + + IOCTL32_HANDLER(SIOCGIFNAME, dev_ifname32), + IOCTL32_HANDLER(SIOCGIFCONF, dev_ifconf), + IOCTL32_HANDLER(SIOCGIFFLAGS, dev_ifsioc), + IOCTL32_HANDLER(SIOCSIFFLAGS, dev_ifsioc), + IOCTL32_HANDLER(SIOCGIFMETRIC, dev_ifsioc), + IOCTL32_HANDLER(SIOCSIFMETRIC, dev_ifsioc), + IOCTL32_HANDLER(SIOCGIFMTU, dev_ifsioc), + IOCTL32_HANDLER(SIOCSIFMTU, dev_ifsioc), + IOCTL32_HANDLER(SIOCGIFMEM, dev_ifsioc), + IOCTL32_HANDLER(SIOCSIFMEM, dev_ifsioc), + IOCTL32_HANDLER(SIOCGIFHWADDR, dev_ifsioc), + IOCTL32_HANDLER(SIOCSIFHWADDR, dev_ifsioc), + IOCTL32_HANDLER(SIOCADDMULTI, dev_ifsioc), + IOCTL32_HANDLER(SIOCDELMULTI, dev_ifsioc), + IOCTL32_HANDLER(SIOCGIFINDEX, dev_ifsioc), + IOCTL32_HANDLER(SIOCGIFMAP, dev_ifsioc), + IOCTL32_HANDLER(SIOCSIFMAP, dev_ifsioc), + IOCTL32_HANDLER(SIOCGIFADDR, dev_ifsioc), + IOCTL32_HANDLER(SIOCSIFADDR, dev_ifsioc), + IOCTL32_HANDLER(SIOCGIFBRDADDR, dev_ifsioc), + IOCTL32_HANDLER(SIOCSIFBRDADDR, dev_ifsioc), + IOCTL32_HANDLER(SIOCGIFDSTADDR, dev_ifsioc), + IOCTL32_HANDLER(SIOCSIFDSTADDR, dev_ifsioc), + IOCTL32_HANDLER(SIOCGIFNETMASK, dev_ifsioc), + IOCTL32_HANDLER(SIOCSIFNETMASK, dev_ifsioc), + IOCTL32_HANDLER(SIOCSIFPFLAGS, dev_ifsioc), + IOCTL32_HANDLER(SIOCGIFPFLAGS, dev_ifsioc), + IOCTL32_HANDLER(SIOCGIFTXQLEN, dev_ifsioc), + IOCTL32_HANDLER(SIOCSIFTXQLEN, dev_ifsioc), + IOCTL32_HANDLER(SIOCADDRT, routing_ioctl), + IOCTL32_HANDLER(SIOCDELRT, routing_ioctl), + + IOCTL32_HANDLER(EXT2_IOC32_GETFLAGS, do_ext2_ioctl), + IOCTL32_HANDLER(EXT2_IOC32_SETFLAGS, do_ext2_ioctl), + IOCTL32_HANDLER(EXT2_IOC32_GETVERSION, do_ext2_ioctl), + IOCTL32_HANDLER(EXT2_IOC32_SETVERSION, do_ext2_ioctl), + + IOCTL32_HANDLER(BLKGETSIZE, w_long) + +}; + +#define NR_IOCTL32_HANDLERS (sizeof(ioctl32_handler_table) / \ + sizeof(ioctl32_handler_table[0])) + +static struct ioctl32_list *ioctl32_hash_table[1024]; + +static inline int ioctl32_hash(unsigned int cmd) +{ + return ((cmd >> 6) ^ (cmd >> 4) ^ cmd) & 0x3ff; +} + +int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned int arg) +{ + int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp); + struct file *filp; + struct ioctl32_list *l; + int error; + + l = ioctl32_hash_table[ioctl32_hash(cmd)]; + + error = -EBADF; + + filp = fget(fd); + if (!filp) + return error; + + if (!filp->f_op || !filp->f_op->ioctl) { + error = sys_ioctl (fd, cmd, arg); + goto out; + } + + while (l && l->handler.cmd != cmd) + l = l->next; + + if (l) { + handler = (void *)l->handler.function; + error = handler(fd, cmd, arg, filp); + } else { + error = -EINVAL; + printk("unknown ioctl: %08x\n", cmd); + } +out: + fput(filp); + return error; +} + +static void ioctl32_insert(struct ioctl32_list *entry) +{ + int hash = ioctl32_hash(entry->handler.cmd); + if (!ioctl32_hash_table[hash]) + ioctl32_hash_table[hash] = entry; + else { + struct ioctl32_list *l; + l = ioctl32_hash_table[hash]; + while (l->next) + l = l->next; + l->next = entry; + entry->next = 0; + } +} + +static int __init init_ioctl32(void) +{ + int i; + for (i = 0; i < NR_IOCTL32_HANDLERS; i++) + ioctl32_insert(&ioctl32_handler_table[i]); + return 0; +} + +__initcall(init_ioctl32); diff --git a/arch/mips64/kernel/linux32.c b/arch/mips64/kernel/linux32.c index 9ab468913d26..529c62031a1a 100644 --- a/arch/mips64/kernel/linux32.c +++ b/arch/mips64/kernel/linux32.c @@ -1,10 +1,1309 @@ -int sys32_newstat(void) {return 0;} -int sys32_newlstat(void) {return 0;} -int sys32_newfstat(void) {return 0;} -int sys_mmap2(void) {return 0;} -int sys_truncate64(void) {return 0;} -int sys_ftruncate64(void) {return 0;} -int sys_stat64(void) {return 0;} -int sys_lstat64(void) {return 0;} -int sys_fstat64(void) {return 0;} +/* $Id: linux32.c,v 1.14 2000/03/23 00:30:53 ulfc Exp $ + * + * Conversion between 32-bit and 64-bit native system calls. + * + * Copyright (C) 2000 Silicon Graphics, Inc. + * Written by Ulf Carlsson (ulfc@engr.sgi.com) + * sys32_execve from ia64/ia32 code, Feb 2000, Kanoj Sarcar (kanoj@sgi.com) + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +#define A(__x) ((unsigned long)(__x)) + +#if 1 +static inline int +putstat(struct stat32 *ubuf, struct stat *kbuf) +{ + int err; + + err = put_user (kbuf->st_dev, &ubuf->st_dev); + err |= __put_user (kbuf->st_ino, &ubuf->st_ino); + err |= __put_user (kbuf->st_mode, &ubuf->st_mode); + err |= __put_user (kbuf->st_nlink, &ubuf->st_nlink); + err |= __put_user (kbuf->st_uid, &ubuf->st_uid); + err |= __put_user (kbuf->st_gid, &ubuf->st_gid); + err |= __put_user (kbuf->st_rdev, &ubuf->st_rdev); + err |= __put_user (kbuf->st_size, &ubuf->st_size); + err |= __put_user (kbuf->st_atime, &ubuf->st_atime); + err |= __put_user (kbuf->st_mtime, &ubuf->st_mtime); + err |= __put_user (kbuf->st_ctime, &ubuf->st_ctime); + err |= __put_user (kbuf->st_blksize, &ubuf->st_blksize); + err |= __put_user (kbuf->st_blocks, &ubuf->st_blocks); + return err; +} + +extern asmlinkage long sys_newstat(char * filename, struct stat * statbuf); + +asmlinkage int +sys32_newstat(char * filename, struct stat32 *statbuf) +{ + int ret; + struct stat s; + mm_segment_t old_fs = get_fs(); + + set_fs (KERNEL_DS); + ret = sys_newstat(filename, &s); + set_fs (old_fs); + if (putstat (statbuf, &s)) + return -EFAULT; + return ret; +} + +extern asmlinkage long sys_newlstat(char * filename, struct stat * statbuf); + +asmlinkage int +sys32_newlstat(char * filename, struct stat32 *statbuf) +{ + int ret; + struct stat s; + mm_segment_t old_fs = get_fs(); + + set_fs (KERNEL_DS); + ret = sys_newlstat(filename, &s); + set_fs (old_fs); + if (putstat (statbuf, &s)) + return -EFAULT; + return ret; +} + +extern asmlinkage long sys_newfstat(unsigned int fd, struct stat * statbuf); + +asmlinkage int +sys32_newfstat(unsigned int fd, struct stat32 *statbuf) +{ + int ret; + struct stat s; + mm_segment_t old_fs = get_fs(); + + set_fs (KERNEL_DS); + ret = sys_newfstat(fd, &s); + set_fs (old_fs); + if (putstat (statbuf, &s)) + return -EFAULT; + return ret; +} +#else +/* + * Revalidate the inode. This is required for proper NFS attribute caching. + */ +static __inline__ int +do_revalidate(struct dentry *dentry) +{ + struct inode * inode = dentry->d_inode; + if (inode->i_op && inode->i_op->revalidate) + return inode->i_op->revalidate(dentry); + return 0; +} + +static int cp_new_stat32(struct inode * inode, struct stat32 * statbuf) +{ + struct stat32 tmp; + unsigned int blocks, indirect; + + memset(&tmp, 0, sizeof(tmp)); + tmp.st_dev = kdev_t_to_nr(inode->i_dev); + tmp.st_ino = inode->i_ino; + tmp.st_mode = inode->i_mode; + tmp.st_nlink = inode->i_nlink; + SET_STAT_UID(tmp, inode->i_uid); + SET_STAT_GID(tmp, inode->i_gid); + tmp.st_rdev = kdev_t_to_nr(inode->i_rdev); + tmp.st_size = inode->i_size; + tmp.st_atime = inode->i_atime; + tmp.st_mtime = inode->i_mtime; + tmp.st_ctime = inode->i_ctime; +/* + * st_blocks and st_blksize are approximated with a simple algorithm if + * they aren't supported directly by the filesystem. The minix and msdos + * filesystems don't keep track of blocks, so they would either have to + * be counted explicitly (by delving into the file itself), or by using + * this simple algorithm to get a reasonable (although not 100% accurate) + * value. + */ + +/* + * Use minix fs values for the number of direct and indirect blocks. The + * count is now exact for the minix fs except that it counts zero blocks. + * Everything is in units of BLOCK_SIZE until the assignment to + * tmp.st_blksize. + */ +#define D_B 7 +#define I_B (BLOCK_SIZE / sizeof(unsigned short)) + + if (!inode->i_blksize) { + blocks = (tmp.st_size + BLOCK_SIZE - 1) / BLOCK_SIZE; + if (blocks > D_B) { + indirect = (blocks - D_B + I_B - 1) / I_B; + blocks += indirect; + if (indirect > 1) { + indirect = (indirect - 1 + I_B - 1) / I_B; + blocks += indirect; + if (indirect > 1) + blocks++; + } + } + tmp.st_blocks = (BLOCK_SIZE / 512) * blocks; + tmp.st_blksize = BLOCK_SIZE; + } else { + tmp.st_blocks = inode->i_blocks; + tmp.st_blksize = inode->i_blksize; + } + return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; +} +asmlinkage int sys32_newstat(char * filename, struct stat32 *statbuf) +{ + struct dentry * dentry; + int error; + + lock_kernel(); + dentry = namei(filename); + + error = PTR_ERR(dentry); + if (!IS_ERR(dentry)) { + error = do_revalidate(dentry); + if (!error) + error = cp_new_stat32(dentry->d_inode, statbuf); + + dput(dentry); + } + unlock_kernel(); + return error; +} +asmlinkage int sys32_newlstat(char *filename, struct stat32 * statbuf) +{ + struct dentry * dentry; + int error; + + lock_kernel(); + dentry = lnamei(filename); + + error = PTR_ERR(dentry); + if (!IS_ERR(dentry)) { + error = do_revalidate(dentry); + if (!error) + error = cp_new_stat32(dentry->d_inode, statbuf); + + dput(dentry); + } + unlock_kernel(); + return error; +} + +asmlinkage int sys32_newfstat(unsigned int fd, struct stat32 * statbuf) +{ + struct file * f; + int err = -EBADF; + + lock_kernel(); + f = fget(fd); + if (f) { + struct dentry * dentry = f->f_dentry; + + err = do_revalidate(dentry); + if (!err) + err = cp_new_stat32(dentry->d_inode, statbuf); + fput(f); + } + unlock_kernel(); + return err; +} +#endif +asmlinkage int sys_mmap2(void) {return 0;} + +asmlinkage long sys_truncate(const char * path, unsigned long length); + +asmlinkage int sys_truncate64(const char *path, unsigned int high, + unsigned int low) +{ + if ((int)high < 0) + return -EINVAL; + return sys_truncate(path, (high << 32) | low); +} + +asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length); + +asmlinkage int sys_ftruncate64(unsigned int fd, unsigned int high, + unsigned int low) +{ + if ((int)high < 0) + return -EINVAL; + return sys_ftruncate(fd, (high << 32) | low); +} + +asmlinkage long sys_newstat(char * filename, struct stat * statbuf); + +asmlinkage int sys_stat64(char * filename, struct stat *statbuf) +{ + return sys_newstat(filename, statbuf); +} + +asmlinkage long sys_newlstat(char * filename, struct stat * statbuf); + +asmlinkage int sys_lstat64(char * filename, struct stat *statbuf) +{ + return sys_newlstat(filename, statbuf); +} + +asmlinkage long sys_newfstat(unsigned int fd, struct stat * statbuf); + +asmlinkage int sys_fstat64(unsigned int fd, struct stat *statbuf) +{ + return sys_newfstat(fd, statbuf); +} + +#if 0 +/* + * count32() counts the number of arguments/envelopes + */ +static int count32(u32 * argv, int max) +{ + int i = 0; + + if (argv != NULL) { + for (;;) { + u32 p; + /* egcs is stupid */ + if (!access_ok(VERIFY_READ, argv, sizeof (u32))) + return -EFAULT; + __get_user(p,argv); + if (!p) + break; + argv++; + if(++i > max) + return -E2BIG; + } + } + return i; +} + + +/* + * 'copy_strings32()' copies argument/envelope strings from user + * memory to free pages in kernel mem. These are in a format ready + * to be put directly into the top of new user memory. + */ +int copy_strings32(int argc, u32 * argv, struct linux_binprm *bprm) +{ + while (argc-- > 0) { + u32 str; + int len; + unsigned long pos; + + if (get_user(str, argv+argc) || !str || !(len = strnlen_user((char *)A(str), bprm->p))) + return -EFAULT; + if (bprm->p < len) + return -E2BIG; + + bprm->p -= len; + /* XXX: add architecture specific overflow check here. */ + + pos = bprm->p; + while (len > 0) { + char *kaddr; + int i, new, err; + struct page *page; + int offset, bytes_to_copy; + + offset = pos % PAGE_SIZE; + i = pos/PAGE_SIZE; + page = bprm->page[i]; + new = 0; + if (!page) { + page = alloc_page(GFP_HIGHUSER); + bprm->page[i] = page; + if (!page) + return -ENOMEM; + new = 1; + } + kaddr = (char *)kmap(page); + + if (new && offset) + memset(kaddr, 0, offset); + bytes_to_copy = PAGE_SIZE - offset; + if (bytes_to_copy > len) { + bytes_to_copy = len; + if (new) + memset(kaddr+offset+len, 0, PAGE_SIZE-offset-len); + } + err = copy_from_user(kaddr + offset, (char *)A(str), bytes_to_copy); + flush_page_to_ram(page); + kunmap(page); + + if (err) + return -EFAULT; + + pos += bytes_to_copy; + str += bytes_to_copy; + len -= bytes_to_copy; + } + } + return 0; +} + + +/* + * sys_execve32() executes a new program. + */ +int do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs) +{ + struct linux_binprm bprm; + struct dentry * dentry; + int retval; + int i; + + bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *); + memset(bprm.page, 0, MAX_ARG_PAGES*sizeof(bprm.page[0])); + + dentry = open_namei(filename, 0, 0); + retval = PTR_ERR(dentry); + if (IS_ERR(dentry)) + return retval; + + bprm.dentry = dentry; + bprm.filename = filename; + bprm.sh_bang = 0; + bprm.loader = 0; + bprm.exec = 0; + if ((bprm.argc = count32(argv, bprm.p / sizeof(u32))) < 0) { + dput(dentry); + return bprm.argc; + } + + if ((bprm.envc = count32(envp, bprm.p / sizeof(u32))) < 0) { + dput(dentry); + return bprm.envc; + } + + retval = prepare_binprm(&bprm); + if (retval < 0) + goto out; + + retval = copy_strings_kernel(1, &bprm.filename, &bprm); + if (retval < 0) + goto out; + + bprm.exec = bprm.p; + retval = copy_strings32(bprm.envc, envp, &bprm); + if (retval < 0) + goto out; + + retval = copy_strings32(bprm.argc, argv, &bprm); + if (retval < 0) + goto out; + + retval = search_binary_handler(&bprm,regs); + if (retval >= 0) + /* execve success */ + return retval; + +out: + /* Something went wrong, return the inode and free the argument pages*/ + if (bprm.dentry) + dput(bprm.dentry); + + /* Assumes that free_page() can take a NULL argument. */ + /* I hope this is ok for all architectures */ + for (i = 0 ; i < MAX_ARG_PAGES ; i++) + if (bprm.page[i]) + __free_page(bprm.page[i]); + + return retval; +} + +/* + * sys_execve() executes a new program. + */ +asmlinkage int sys32_execve(abi64_no_regargs, struct pt_regs regs) +{ + int error; + char * filename; + + filename = getname((char *) (long)regs.regs[4]); + printk("Executing: %s\n", filename); + error = PTR_ERR(filename); + if (IS_ERR(filename)) + goto out; + error = do_execve32(filename, (u32 *) (long)regs.regs[5], + (u32 *) (long)regs.regs[6], ®s); + putname(filename); + +out: + return error; +} +#else +static int +nargs(unsigned int arg, char **ap) +{ + char *ptr; + int n; + + n = 0; + do { + /* egcs is stupid */ + if (!access_ok(VERIFY_READ, arg, sizeof (unsigned int))) + return -EFAULT; + __get_user((long)ptr,(int *)A(arg)); + if (ap) + *ap++ = ptr; + arg += sizeof(unsigned int); + n++; + } while (ptr); + return(n - 1); +} + +asmlinkage int +sys32_execve(abi64_no_regargs, struct pt_regs regs) +{ + extern asmlinkage int sys_execve(abi64_no_regargs, struct pt_regs regs); + extern asmlinkage long sys_munmap(unsigned long addr, size_t len); + unsigned int argv = (unsigned int)regs.regs[5]; + unsigned int envp = (unsigned int)regs.regs[6]; + char **av, **ae; + int na, ne, r, len; + char * filename; + + na = nargs(argv, NULL); + ne = nargs(envp, NULL); + len = (na + ne + 2) * sizeof(*av); + /* + * kmalloc won't work because the `sys_exec' code will attempt + * to do a `get_user' on the arg list and `get_user' will fail + * on a kernel address (simplifies `get_user'). Instead we + * do an mmap to get a user address. Note that since a successful + * `execve' frees all current memory we only have to do an + * `munmap' if the `execve' failes. + */ + down(¤t->mm->mmap_sem); + lock_kernel(); + + av = (char **) do_mmap_pgoff(0, 0, len, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, 0); + + unlock_kernel(); + up(¤t->mm->mmap_sem); + + if (IS_ERR(av)) + return((long) av); + ae = av + na + 1; + av[na] = (char *)0; + ae[ne] = (char *)0; + (void)nargs(argv, av); + (void)nargs(envp, ae); + filename = getname((char *) (long)regs.regs[4]); + r = PTR_ERR(filename); + if (IS_ERR(filename)) + return(r); + + r = do_execve(filename, av, ae, ®s); + putname(filename); + if (IS_ERR(r)) + sys_munmap((unsigned long)av, len); + return(r); +} +#endif + +struct dirent32 { + unsigned int d_ino; + unsigned int d_off; + unsigned short d_reclen; + char d_name[NAME_MAX + 1]; +}; + +static void +xlate_dirent(void *dirent64, void *dirent32, long n) +{ + long off; + struct dirent *dirp; + struct dirent32 *dirp32; + + off = 0; + while (off < n) { + dirp = (struct dirent *)(dirent64 + off); + dirp32 = (struct dirent32 *)(dirent32 + off); + off += dirp->d_reclen; + dirp32->d_ino = dirp->d_ino; + dirp32->d_off = (unsigned int)dirp->d_off; + dirp32->d_reclen = dirp->d_reclen; + strncpy(dirp32->d_name, dirp->d_name, dirp->d_reclen - ((3 * 4) + 2)); + } + return; +} + +asmlinkage long sys_getdents(unsigned int fd, void * dirent, unsigned int count); + +asmlinkage long +sys32_getdents(unsigned int fd, void * dirent32, unsigned int count) +{ + long n; + void *dirent64; + + dirent64 = (void *)((unsigned long)(dirent32 + (sizeof(long) - 1)) & ~(sizeof(long) - 1)); + if ((n = sys_getdents(fd, dirent64, count - (dirent64 - dirent32))) < 0) + return(n); + xlate_dirent(dirent64, dirent32, n); + return(n); +} + +asmlinkage int old_readdir(unsigned int fd, void * dirent, unsigned int count); + +asmlinkage int +sys32_readdir(unsigned int fd, void * dirent32, unsigned int count) +{ + int n; + struct dirent dirent64; + + if ((n = old_readdir(fd, &dirent64, count)) < 0) + return(n); + xlate_dirent(&dirent64, dirent32, dirent64.d_reclen); + return(n); +} + +struct timeval32 +{ + int tv_sec, tv_usec; +}; + +struct itimerval32 +{ + struct timeval32 it_interval; + struct timeval32 it_value; +}; + +struct rusage32 { + struct timeval32 ru_utime; + struct timeval32 ru_stime; + int ru_maxrss; + int ru_ixrss; + int ru_idrss; + int ru_isrss; + int ru_minflt; + int ru_majflt; + int ru_nswap; + int ru_inblock; + int ru_oublock; + int ru_msgsnd; + int ru_msgrcv; + int ru_nsignals; + int ru_nvcsw; + int ru_nivcsw; +}; + +static int +put_rusage (struct rusage32 *ru, struct rusage *r) +{ + int err; + + err = put_user (r->ru_utime.tv_sec, &ru->ru_utime.tv_sec); + err |= __put_user (r->ru_utime.tv_usec, &ru->ru_utime.tv_usec); + err |= __put_user (r->ru_stime.tv_sec, &ru->ru_stime.tv_sec); + err |= __put_user (r->ru_stime.tv_usec, &ru->ru_stime.tv_usec); + err |= __put_user (r->ru_maxrss, &ru->ru_maxrss); + err |= __put_user (r->ru_ixrss, &ru->ru_ixrss); + err |= __put_user (r->ru_idrss, &ru->ru_idrss); + err |= __put_user (r->ru_isrss, &ru->ru_isrss); + err |= __put_user (r->ru_minflt, &ru->ru_minflt); + err |= __put_user (r->ru_majflt, &ru->ru_majflt); + err |= __put_user (r->ru_nswap, &ru->ru_nswap); + err |= __put_user (r->ru_inblock, &ru->ru_inblock); + err |= __put_user (r->ru_oublock, &ru->ru_oublock); + err |= __put_user (r->ru_msgsnd, &ru->ru_msgsnd); + err |= __put_user (r->ru_msgrcv, &ru->ru_msgrcv); + err |= __put_user (r->ru_nsignals, &ru->ru_nsignals); + err |= __put_user (r->ru_nvcsw, &ru->ru_nvcsw); + err |= __put_user (r->ru_nivcsw, &ru->ru_nivcsw); + return err; +} + +extern asmlinkage int sys_wait4(pid_t pid, unsigned int * stat_addr, + int options, struct rusage * ru); + +asmlinkage int +sys32_wait4(__kernel_pid_t32 pid, unsigned int * stat_addr, int options, + struct rusage32 * ru) +{ + if (!ru) + return sys_wait4(pid, stat_addr, options, NULL); + else { + struct rusage r; + int ret; + unsigned int status; + mm_segment_t old_fs = get_fs(); + + set_fs(KERNEL_DS); + ret = sys_wait4(pid, stat_addr ? &status : NULL, options, &r); + set_fs(old_fs); + if (put_rusage (ru, &r)) return -EFAULT; + if (stat_addr && put_user (status, stat_addr)) + return -EFAULT; + return ret; + } +} + +asmlinkage int +sys32_waitpid(__kernel_pid_t32 pid, unsigned int *stat_addr, int options) +{ + return sys32_wait4(pid, stat_addr, options, NULL); +} + +#define RLIM_INFINITY32 0x7fffffff +#define RESOURCE32(x) ((x > RLIM_INFINITY32) ? RLIM_INFINITY32 : x) + +struct rlimit32 { + int rlim_cur; + int rlim_max; +}; + +extern asmlinkage int sys_old_getrlimit(unsigned int resource, struct rlimit *rlim); + +asmlinkage int +sys32_getrlimit(unsigned int resource, struct rlimit32 *rlim) +{ + struct rlimit r; + int ret; + mm_segment_t old_fs = get_fs (); + + set_fs (KERNEL_DS); + ret = sys_old_getrlimit(resource, &r); + set_fs (old_fs); + if (!ret) { + ret = put_user (RESOURCE32(r.rlim_cur), &rlim->rlim_cur); + ret |= __put_user (RESOURCE32(r.rlim_max), &rlim->rlim_max); + } + return ret; +} + +extern asmlinkage int sys_setrlimit(unsigned int resource, struct rlimit *rlim); + +asmlinkage int +sys32_setrlimit(unsigned int resource, struct rlimit32 *rlim) +{ + struct rlimit r; + int ret; + mm_segment_t old_fs = get_fs (); + + if (resource >= RLIM_NLIMITS) return -EINVAL; + if (get_user (r.rlim_cur, &rlim->rlim_cur) || + __get_user (r.rlim_max, &rlim->rlim_max)) + return -EFAULT; + if (r.rlim_cur == RLIM_INFINITY32) + r.rlim_cur = RLIM_INFINITY; + if (r.rlim_max == RLIM_INFINITY32) + r.rlim_max = RLIM_INFINITY; + set_fs (KERNEL_DS); + ret = sys_setrlimit(resource, &r); + set_fs (old_fs); + return ret; +} + +struct statfs32 { + int f_type; + int f_bsize; + int f_frsize; + int f_blocks; + int f_bfree; + int f_files; + int f_ffree; + int f_bavail; + __kernel_fsid_t32 f_fsid; + int f_namelen; + int f_spare[6]; +}; + +static inline int +put_statfs (struct statfs32 *ubuf, struct statfs *kbuf) +{ + int err; + + err = put_user (kbuf->f_type, &ubuf->f_type); + err |= __put_user (kbuf->f_bsize, &ubuf->f_bsize); + err |= __put_user (kbuf->f_blocks, &ubuf->f_blocks); + err |= __put_user (kbuf->f_bfree, &ubuf->f_bfree); + err |= __put_user (kbuf->f_bavail, &ubuf->f_bavail); + err |= __put_user (kbuf->f_files, &ubuf->f_files); + err |= __put_user (kbuf->f_ffree, &ubuf->f_ffree); + err |= __put_user (kbuf->f_namelen, &ubuf->f_namelen); + err |= __put_user (kbuf->f_fsid.val[0], &ubuf->f_fsid.val[0]); + err |= __put_user (kbuf->f_fsid.val[1], &ubuf->f_fsid.val[1]); + return err; +} + +extern asmlinkage int sys_statfs(const char * path, struct statfs * buf); + +asmlinkage int +sys32_statfs(const char * path, struct statfs32 *buf) +{ + int ret; + struct statfs s; + mm_segment_t old_fs = get_fs(); + + set_fs (KERNEL_DS); + ret = sys_statfs((const char *)path, &s); + set_fs (old_fs); + if (put_statfs(buf, &s)) + return -EFAULT; + return ret; +} + +extern asmlinkage int sys_fstatfs(unsigned int fd, struct statfs * buf); + +asmlinkage int +sys32_fstatfs(unsigned int fd, struct statfs32 *buf) +{ + int ret; + struct statfs s; + mm_segment_t old_fs = get_fs(); + + set_fs (KERNEL_DS); + ret = sys_fstatfs(fd, &s); + set_fs (old_fs); + if (put_statfs(buf, &s)) + return -EFAULT; + return ret; +} + +extern asmlinkage int +sys_getrusage(int who, struct rusage *ru); + +asmlinkage int +sys32_getrusage(int who, struct rusage32 *ru) +{ + struct rusage r; + int ret; + mm_segment_t old_fs = get_fs(); + + set_fs (KERNEL_DS); + ret = sys_getrusage(who, &r); + set_fs (old_fs); + if (put_rusage (ru, &r)) return -EFAULT; + return ret; +} + +static inline long +get_tv32(struct timeval *o, struct timeval32 *i) +{ + return (!access_ok(VERIFY_READ, i, sizeof(*i)) || + (__get_user(o->tv_sec, &i->tv_sec) | + __get_user(o->tv_usec, &i->tv_usec))); + return ENOSYS; +} + +static inline long +get_it32(struct itimerval *o, struct itimerval32 *i) +{ + return (!access_ok(VERIFY_READ, i, sizeof(*i)) || + (__get_user(o->it_interval.tv_sec, &i->it_interval.tv_sec) | + __get_user(o->it_interval.tv_usec, &i->it_interval.tv_usec) | + __get_user(o->it_value.tv_sec, &i->it_value.tv_sec) | + __get_user(o->it_value.tv_usec, &i->it_value.tv_usec))); + return ENOSYS; +} + +static inline long +put_tv32(struct timeval32 *o, struct timeval *i) +{ + return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) || + (__put_user(i->tv_sec, &o->tv_sec) | + __put_user(i->tv_usec, &o->tv_usec))); +} + +static inline long +put_it32(struct itimerval32 *o, struct itimerval *i) +{ + return (!access_ok(VERIFY_WRITE, i, sizeof(*i)) || + (__put_user(i->it_interval.tv_sec, &o->it_interval.tv_sec) | + __put_user(i->it_interval.tv_usec, &o->it_interval.tv_usec) | + __put_user(i->it_value.tv_sec, &o->it_value.tv_sec) | + __put_user(i->it_value.tv_usec, &o->it_value.tv_usec))); + return ENOSYS; +} + +extern int do_getitimer(int which, struct itimerval *value); + +asmlinkage int +sys32_getitimer(int which, struct itimerval32 *it) +{ + struct itimerval kit; + int error; + + error = do_getitimer(which, &kit); + if (!error && put_it32(it, &kit)) + error = -EFAULT; + + return error; +} + +extern int do_setitimer(int which, struct itimerval *, struct itimerval *); + + +asmlinkage int +sys32_setitimer(int which, struct itimerval32 *in, struct itimerval32 *out) +{ + struct itimerval kin, kout; + int error; + + if (in) { + if (get_it32(&kin, in)) + return -EFAULT; + } else + memset(&kin, 0, sizeof(kin)); + + error = do_setitimer(which, &kin, out ? &kout : NULL); + if (error || !out) + return error; + if (put_it32(out, &kout)) + return -EFAULT; + + return 0; + +} +asmlinkage unsigned long +sys32_alarm(unsigned int seconds) +{ + struct itimerval it_new, it_old; + unsigned int oldalarm; + + it_new.it_interval.tv_sec = it_new.it_interval.tv_usec = 0; + it_new.it_value.tv_sec = seconds; + it_new.it_value.tv_usec = 0; + do_setitimer(ITIMER_REAL, &it_new, &it_old); + oldalarm = it_old.it_value.tv_sec; + /* ehhh.. We can't return 0 if we have an alarm pending.. */ + /* And we'd better return too much than too little anyway */ + if (it_old.it_value.tv_usec) + oldalarm++; + return oldalarm; +} + +/* Translations due to time_t size differences. Which affects all + sorts of things, like timeval and itimerval. */ + + +extern struct timezone sys_tz; +extern int do_sys_settimeofday(struct timeval *tv, struct timezone *tz); + +asmlinkage int +sys32_gettimeofday(struct timeval32 *tv, struct timezone *tz) +{ + if (tv) { + struct timeval ktv; + do_gettimeofday(&ktv); + if (put_tv32(tv, &ktv)) + return -EFAULT; + } + if (tz) { + if (copy_to_user(tz, &sys_tz, sizeof(sys_tz))) + return -EFAULT; + } + return 0; +} + +asmlinkage int +sys32_settimeofday(struct timeval32 *tv, struct timezone *tz) +{ + struct timeval ktv; + struct timezone ktz; + + if (tv) { + if (get_tv32(&ktv, tv)) + return -EFAULT; + } + if (tz) { + if (copy_from_user(&ktz, tz, sizeof(ktz))) + return -EFAULT; + } + + return do_sys_settimeofday(tv ? &ktv : NULL, tz ? &ktz : NULL); +} + +extern asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, + unsigned long offset_low, loff_t * result, + unsigned int origin); + +extern asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high, + unsigned int offset_low, loff_t * result, + unsigned int origin) +{ + return sys_llseek(fd, offset_high, offset_low, result, origin); +} + +struct iovec32 { unsigned int iov_base; int iov_len; }; + +typedef ssize_t (*IO_fn_t)(struct file *, char *, size_t, loff_t *); + +static long +do_readv_writev32(int type, struct file *file, const struct iovec32 *vector, + u32 count) +{ + unsigned long tot_len; + struct iovec iovstack[UIO_FASTIOV]; + struct iovec *iov=iovstack, *ivp; + struct inode *inode; + long retval, i; + IO_fn_t fn; + + /* First get the "struct iovec" from user memory and + * verify all the pointers + */ + if (!count) + return 0; + if(verify_area(VERIFY_READ, vector, sizeof(struct iovec32)*count)) + return -EFAULT; + if (count > UIO_MAXIOV) + return -EINVAL; + if (count > UIO_FASTIOV) { + iov = kmalloc(count*sizeof(struct iovec), GFP_KERNEL); + if (!iov) + return -ENOMEM; + } + + tot_len = 0; + i = count; + ivp = iov; + while(i > 0) { + u32 len; + u32 buf; + + __get_user(len, &vector->iov_len); + __get_user(buf, &vector->iov_base); + tot_len += len; + ivp->iov_base = (void *)A(buf); + ivp->iov_len = (__kernel_size_t) len; + vector++; + ivp++; + i--; + } + + inode = file->f_dentry->d_inode; + /* VERIFY_WRITE actually means a read, as we write to user space */ + retval = locks_verify_area((type == VERIFY_WRITE + ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE), + inode, file, file->f_pos, tot_len); + if (retval) { + if (iov != iovstack) + kfree(iov); + return retval; + } + + /* Then do the actual IO. Note that sockets need to be handled + * specially as they have atomicity guarantees and can handle + * iovec's natively + */ + if (inode->i_sock) { + int err; + err = sock_readv_writev(type, inode, file, iov, count, tot_len); + if (iov != iovstack) + kfree(iov); + return err; + } + + if (!file->f_op) { + if (iov != iovstack) + kfree(iov); + return -EINVAL; + } + /* VERIFY_WRITE actually means a read, as we write to user space */ + fn = file->f_op->read; + if (type == VERIFY_READ) + fn = (IO_fn_t) file->f_op->write; + ivp = iov; + while (count > 0) { + void * base; + int len, nr; + + base = ivp->iov_base; + len = ivp->iov_len; + ivp++; + count--; + nr = fn(file, base, len, &file->f_pos); + if (nr < 0) { + if (retval) + break; + retval = nr; + break; + } + retval += nr; + if (nr != len) + break; + } + if (iov != iovstack) + kfree(iov); + return retval; +} + +asmlinkage long +sys32_readv(int fd, struct iovec32 *vector, u32 count) +{ + struct file *file; + long ret = -EBADF; + + lock_kernel(); + file = fget(fd); + if(!file) + goto bad_file; + + if(!(file->f_mode & 1)) + goto out; + + ret = do_readv_writev32(VERIFY_WRITE, file, + vector, count); +out: + fput(file); +bad_file: + unlock_kernel(); + return ret; +} + +asmlinkage long +sys32_writev(int fd, struct iovec32 *vector, u32 count) +{ + struct file *file; + int ret = -EBADF; + + lock_kernel(); + file = fget(fd); + if(!file) + goto bad_file; + + if(!(file->f_mode & 2)) + goto out; + + ret = do_readv_writev32(VERIFY_READ, file, + vector, count); +out: + fput(file); +bad_file: + unlock_kernel(); + return ret; +} + +/* + * Ooo, nasty. We need here to frob 32-bit unsigned longs to + * 64-bit unsigned longs. + */ + +static inline int +get_fd_set32(unsigned long n, unsigned long *fdset, u32 *ufdset) +{ +#ifdef __MIPSEB__ + if (ufdset) { + unsigned long odd; + + if (verify_area(VERIFY_WRITE, ufdset, n*sizeof(u32))) + return -EFAULT; + + odd = n & 1UL; + n &= ~1UL; + while (n) { + unsigned long h, l; + __get_user(l, ufdset); + __get_user(h, ufdset+1); + ufdset += 2; + *fdset++ = h << 32 | l; + n -= 2; + } + if (odd) + __get_user(*fdset, ufdset); + } else { + /* Tricky, must clear full unsigned long in the + * kernel fdset at the end, this makes sure that + * actually happens. + */ + memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32)); + } + return 0; +#else + <> +#endif +} + +static inline void +set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset) +{ + unsigned long odd; + + if (!ufdset) + return; + + odd = n & 1UL; + n &= ~1UL; + while (n) { + unsigned long h, l; + l = *fdset++; + h = l >> 32; + __put_user(l, ufdset); + __put_user(h, ufdset+1); + ufdset += 2; + n -= 2; + } + if (odd) + __put_user(*fdset, ufdset); +} + +/* + * We can actually return ERESTARTSYS instead of EINTR, but I'd + * like to be certain this leads to no problems. So I return + * EINTR just for safety. + * + * Update: ERESTARTSYS breaks at least the xview clock binary, so + * I'm trying ERESTARTNOHAND which restart only when you want to. + */ +#define MAX_SELECT_SECONDS \ + ((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1) + +asmlinkage int sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, struct timeval32 *tvp) +{ + fd_set_bits fds; + char *bits; + unsigned long nn; + long timeout; + int ret, size; + + timeout = MAX_SCHEDULE_TIMEOUT; + if (tvp) { + time_t sec, usec; + + if ((ret = verify_area(VERIFY_READ, tvp, sizeof(*tvp))) + || (ret = __get_user(sec, &tvp->tv_sec)) + || (ret = __get_user(usec, &tvp->tv_usec))) + goto out_nofds; + + ret = -EINVAL; + if(sec < 0 || usec < 0) + goto out_nofds; + + if ((unsigned long) sec < MAX_SELECT_SECONDS) { + timeout = (usec + 1000000/HZ - 1) / (1000000/HZ); + timeout += sec * (unsigned long) HZ; + } + } + + ret = -EINVAL; + if (n < 0) + goto out_nofds; + if (n > current->files->max_fdset) + n = current->files->max_fdset; + + /* + * We need 6 bitmaps (in/out/ex for both incoming and outgoing), + * since we used fdset we need to allocate memory in units of + * long-words. + */ + ret = -ENOMEM; + size = FDS_BYTES(n); + bits = kmalloc(6 * size, GFP_KERNEL); + if (!bits) + goto out_nofds; + fds.in = (unsigned long *) bits; + fds.out = (unsigned long *) (bits + size); + fds.ex = (unsigned long *) (bits + 2*size); + fds.res_in = (unsigned long *) (bits + 3*size); + fds.res_out = (unsigned long *) (bits + 4*size); + fds.res_ex = (unsigned long *) (bits + 5*size); + + nn = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32)); + if ((ret = get_fd_set32(nn, fds.in, inp)) || + (ret = get_fd_set32(nn, fds.out, outp)) || + (ret = get_fd_set32(nn, fds.ex, exp))) + goto out; + zero_fd_set(n, fds.res_in); + zero_fd_set(n, fds.res_out); + zero_fd_set(n, fds.res_ex); + + ret = do_select(n, &fds, &timeout); + + if (tvp && !(current->personality & STICKY_TIMEOUTS)) { + time_t sec = 0, usec = 0; + if (timeout) { + sec = timeout / HZ; + usec = timeout % HZ; + usec *= (1000000/HZ); + } + put_user(sec, &tvp->tv_sec); + put_user(usec, &tvp->tv_usec); + } + + if (ret < 0) + goto out; + if (!ret) { + ret = -ERESTARTNOHAND; + if (signal_pending(current)) + goto out; + ret = 0; + } + + set_fd_set32(nn, inp, fds.res_in); + set_fd_set32(nn, outp, fds.res_out); + set_fd_set32(nn, exp, fds.res_ex); + +out: + kfree(bits); +out_nofds: + return ret; +} + + + +struct timespec32 { + int tv_sec; + int tv_nsec; +}; + +extern asmlinkage int sys_sched_rr_get_interval(pid_t pid, + struct timespec *interval); + +asmlinkage int +sys32_sched_rr_get_interval(__kernel_pid_t32 pid, struct timespec32 *interval) +{ + struct timespec t; + int ret; + mm_segment_t old_fs = get_fs (); + + set_fs (KERNEL_DS); + ret = sys_sched_rr_get_interval(pid, &t); + set_fs (old_fs); + if (put_user (t.tv_sec, &interval->tv_sec) || + __put_user (t.tv_nsec, &interval->tv_nsec)) + return -EFAULT; + return ret; +} + + +extern asmlinkage int sys_nanosleep(struct timespec *rqtp, + struct timespec *rmtp); + +asmlinkage int +sys32_nanosleep(struct timespec32 *rqtp, struct timespec32 *rmtp) +{ + struct timespec t; + int ret; + mm_segment_t old_fs = get_fs (); + + if (get_user (t.tv_sec, &rqtp->tv_sec) || + __get_user (t.tv_nsec, &rqtp->tv_nsec)) + return -EFAULT; + + set_fs (KERNEL_DS); + ret = sys_nanosleep(&t, rmtp ? &t : NULL); + set_fs (old_fs); + if (rmtp && ret == -EINTR) { + if (__put_user (t.tv_sec, &rmtp->tv_sec) || + __put_user (t.tv_nsec, &rmtp->tv_nsec)) + return -EFAULT; + } + return ret; +} diff --git a/arch/mips64/kernel/mips64_ksyms.c b/arch/mips64/kernel/mips64_ksyms.c index 2c31e87f7339..5b77f3050236 100644 --- a/arch/mips64/kernel/mips64_ksyms.c +++ b/arch/mips64/kernel/mips64_ksyms.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -56,8 +57,6 @@ EXPORT_SYMBOL_NOVERS(strtok); EXPORT_SYMBOL_NOVERS(strpbrk); EXPORT_SYMBOL(_clear_page); -EXPORT_SYMBOL(local_bh_count); -EXPORT_SYMBOL(local_irq_count); EXPORT_SYMBOL(enable_irq); EXPORT_SYMBOL(disable_irq); EXPORT_SYMBOL(kernel_thread); @@ -83,11 +82,20 @@ EXPORT_SYMBOL(csum_partial_copy); */ EXPORT_SYMBOL(_flush_page_to_ram); EXPORT_SYMBOL(_flush_cache_all); +#ifndef CONFIG_COHERENT_IO EXPORT_SYMBOL(_dma_cache_wback_inv); EXPORT_SYMBOL(_dma_cache_inv); +#endif EXPORT_SYMBOL(invalid_pte_table); +/* + * Semaphore stuff + */ +EXPORT_SYMBOL(__down_read); +EXPORT_SYMBOL(__down_write); +EXPORT_SYMBOL(__rwsem_wake); + /* * Base address of ports for Intel style I/O. */ diff --git a/arch/mips64/kernel/proc.c b/arch/mips64/kernel/proc.c index 74332257b0fc..78a9cbdcc617 100644 --- a/arch/mips64/kernel/proc.c +++ b/arch/mips64/kernel/proc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -45,6 +46,7 @@ int get_cpuinfo(char *buffer) len += sprintf(buffer + len, "BogoMIPS\t\t: %lu.%02lu\n", (loops_per_sec + 2500) / 500000, ((loops_per_sec + 2500) / 5000) % 100); + len += sprintf(buffer + len, "Number of cpus\t\t: %d\n", smp_num_cpus); #if defined (__MIPSEB__) len += sprintf(buffer + len, "byteorder\t\t: big endian\n"); #endif @@ -69,3 +71,8 @@ int get_cpuinfo(char *buffer) return len; } + +void init_irq_proc(void) +{ + /* Nothing, for now. */ +} diff --git a/arch/mips64/kernel/process.c b/arch/mips64/kernel/process.c index 78a933d3b03d..22ce0ed6d07d 100644 --- a/arch/mips64/kernel/process.c +++ b/arch/mips64/kernel/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.5 2000/01/29 01:41:59 ralf Exp $ +/* $Id: process.c,v 1.4 2000/01/16 01:34:01 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -7,6 +7,7 @@ * Copyright (C) 1994 - 1999 by Ralf Baechle and others. * Copyright (C) 1999 Silicon Graphics, Inc. */ +#include #include #include #include @@ -33,6 +34,7 @@ asmlinkage int cpu_idle(void) { /* endless idle loop with no priority at all */ + init_idle(); current->priority = 0; current->counter = -100; while (1) { @@ -51,20 +53,20 @@ asmlinkage void ret_from_fork(void); void exit_thread(void) { /* Forget lazy fpu state */ - if (last_task_used_math == current) { + if (IS_FPU_OWNER()) { set_cp0_status(ST0_CU1, ST0_CU1); __asm__ __volatile__("cfc1\t$0,$31"); - last_task_used_math = NULL; + CLEAR_FPU_OWNER(); } } void flush_thread(void) { /* Forget lazy fpu state */ - if (last_task_used_math == current) { + if (IS_FPU_OWNER()) { set_cp0_status(ST0_CU1, ST0_CU1); __asm__ __volatile__("cfc1\t$0,$31"); - last_task_used_math = NULL; + CLEAR_FPU_OWNER(); } } @@ -76,8 +78,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, childksp = (unsigned long)p + KERNEL_STACK_SIZE - 32; - if (last_task_used_math == current) { - set_cp0_status(ST0_CU1, ST0_CU1); + if (IS_FPU_OWNER()) { save_fp(p); } /* set up new TSS. */ diff --git a/arch/mips64/kernel/ptrace.c b/arch/mips64/kernel/ptrace.c index 1fd46b093850..a0488107f19e 100644 --- a/arch/mips64/kernel/ptrace.c +++ b/arch/mips64/kernel/ptrace.c @@ -8,13 +8,561 @@ * Copyright (C) Linus Torvalds * Copyright (C) 1994, 1995, 1996, 1997, 1998 Ralf Baechle * Copyright (C) 1996 David S. Miller + * Copyright (C) 2000 Ulf Carlsson * * At this time Linux/MIPS64 only supports syscall tracing, even for 32-bit * binaries. */ +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Tracing a 32-bit process with a 64-bit strace and vice verca will not + work. I don't know how to fix this. */ + +asmlinkage int sys32_ptrace(int request, int pid, int addr, int data) +{ + struct task_struct *child; + int ret; + + lock_kernel(); +#if 0 + printk("ptrace(r=%d,pid=%d,addr=%08lx,data=%08lx)\n", + (int) request, (int) pid, (unsigned long) addr, + (unsigned long) data); +#endif + ret = -EPERM; + if (request == PTRACE_TRACEME) { + /* are we already being traced? */ + if (current->flags & PF_PTRACED) + goto out; + /* set the ptrace bit in the process flags. */ + current->flags |= PF_PTRACED; + ret = 0; + goto out; + } + ret = -ESRCH; + read_lock(&tasklist_lock); + child = find_task_by_pid(pid); + if (child) + get_task_struct(child); + read_unlock(&tasklist_lock); + if (!child) + goto out; + + ret = -EPERM; + if (pid == 1) /* you may not mess with init */ + goto out_tsk; + + if (request == PTRACE_ATTACH) { + if (child == current) + goto out_tsk; + if ((!child->dumpable || + (current->uid != child->euid) || + (current->uid != child->suid) || + (current->uid != child->uid) || + (current->gid != child->egid) || + (current->gid != child->sgid) || + (!cap_issubset(child->cap_permitted, current->cap_permitted)) || + (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) + goto out_tsk; + /* the same process cannot be attached many times */ + if (child->flags & PF_PTRACED) + goto out_tsk; + child->flags |= PF_PTRACED; + + write_lock_irq(&tasklist_lock); + if (child->p_pptr != current) { + REMOVE_LINKS(child); + child->p_pptr = current; + SET_LINKS(child); + } + write_unlock_irq(&tasklist_lock); + + send_sig(SIGSTOP, child, 1); + ret = 0; + goto out_tsk; + } + ret = -ESRCH; + if (!(child->flags & PF_PTRACED)) + goto out_tsk; + if (child->state != TASK_STOPPED) { + if (request != PTRACE_KILL) + goto out_tsk; + } + if (child->p_pptr != current) + goto out_tsk; + + switch (request) { + /* when I and D space are separate, these will need to be fixed. */ + case PTRACE_PEEKTEXT: /* read word at location addr. */ + case PTRACE_PEEKDATA: { + unsigned int tmp; + int copied; + + copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); + ret = -EIO; + if (copied != sizeof(tmp)) + break; + ret = put_user(tmp, (unsigned int *) data); + break; + } + + /* read the word at location addr in the USER area. */ + case PTRACE_PEEKUSR: { + struct pt_regs *regs; + unsigned int tmp; + + regs = (struct pt_regs *) ((unsigned long) child + + KERNEL_STACK_SIZE - 32 - sizeof(struct pt_regs)); + ret = 0; + + switch (addr) { + case 0 ... 31: + tmp = regs->regs[addr]; + break; + case FPR_BASE ... FPR_BASE + 31: + if (child->used_math) { +#ifndef CONFIG_SMP + if (last_task_used_math == child) { + set_cp0_status(ST0_CU1, ST0_CU1); + save_fp(child); + set_cp0_status(ST0_CU1, 0); + last_task_used_math = NULL; + } +#endif + tmp = child->thread.fpu.hard.fp_regs[addr - 32]; + } else { + tmp = -EIO; + } + break; + case PC: + tmp = regs->cp0_epc; + break; + case CAUSE: + tmp = regs->cp0_cause; + break; + case BADVADDR: + tmp = regs->cp0_badvaddr; + break; + case MMHI: + tmp = regs->hi; + break; + case MMLO: + tmp = regs->lo; + break; + case FPC_CSR: + tmp = child->thread.fpu.hard.control; + break; + case FPC_EIR: { /* implementation / version register */ + unsigned int flags; + __save_flags(flags); + set_cp0_status(ST0_CU1, ST0_CU1); + __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp)); + __restore_flags(flags); + break; + } + default: + tmp = 0; + ret = -EIO; + goto out_tsk; + } + ret = put_user(tmp, (unsigned *) data); + break; + } + /* when I and D space are separate, this will have to be fixed. */ + case PTRACE_POKETEXT: /* write the word at location addr. */ + case PTRACE_POKEDATA: + ret = 0; + if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data)) + break; + ret = -EIO; + break; + + case PTRACE_POKEUSR: { + struct pt_regs *regs; + ret = 0; + regs = (struct pt_regs *) ((unsigned long) child + + KERNEL_STACK_SIZE - 32 - sizeof(struct pt_regs)); + + switch (addr) { + case 0 ... 31: + regs->regs[addr] = data; + break; + case FPR_BASE ... FPR_BASE + 31: { + unsigned long *fregs; + if (child->used_math) { +#ifndef CONFIG_SMP + if (last_task_used_math == child) { + set_cp0_status(ST0_CU1, ST0_CU1); + save_fp(child); + set_cp0_status(ST0_CU1, 0); + last_task_used_math = NULL; + regs->cp0_status &= ~ST0_CU1; + } +#endif + } else { + /* FP not yet used */ + memset(&child->thread.fpu.hard, ~0, + sizeof(child->thread.fpu.hard)); + child->thread.fpu.hard.control = 0; + } + fregs = child->thread.fpu.hard.fp_regs; + fregs[addr - FPR_BASE] = data; + break; + } + case PC: + regs->cp0_epc = data; + break; + case MMHI: + regs->hi = data; + break; + case MMLO: + regs->lo = data; + break; + case FPC_CSR: + child->thread.fpu.hard.control = data; + break; + default: + /* The rest are not allowed. */ + ret = -EIO; + break; + } + goto out; + } + case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ + case PTRACE_CONT: { /* restart after signal. */ + ret = -EIO; + if ((unsigned int) data > _NSIG) + break; + if (request == PTRACE_SYSCALL) + child->flags |= PF_TRACESYS; + else + child->flags &= ~PF_TRACESYS; + child->exit_code = data; + wake_up_process(child); + ret = 0; + break; + } + +/* + * make the child exit. Best I can do is send it a sigkill. + * perhaps it should be put in the status that it wants to + * exit. + */ + case PTRACE_KILL: { + if (child->state == TASK_ZOMBIE) /* already dead */ + break; + child->exit_code = SIGKILL; + wake_up_process(child); + break; + } + + case PTRACE_DETACH: { /* detach a process that was attached. */ + ret = -EIO; + if ((unsigned long) data > _NSIG) + break; + child->flags &= ~(PF_PTRACED|PF_TRACESYS); + child->exit_code = data; + write_lock_irq(&tasklist_lock); + REMOVE_LINKS(child); + child->p_pptr = child->p_opptr; + SET_LINKS(child); + write_unlock_irq(&tasklist_lock); + wake_up_process(child); + ret = 0; + break; + } + + default: + ret = -EIO; + break; + } + +out_tsk: + free_task_struct(child); +out: + unlock_kernel(); + return ret; +} + +asmlinkage int sys_ptrace(long request, long pid, long addr, long data) +{ + struct task_struct *child; + int ret; + + lock_kernel(); +#if 0 + printk("ptrace(r=%d,pid=%d,addr=%08lx,data=%08lx)\n", + (int) request, (int) pid, (unsigned long) addr, + (unsigned long) data); +#endif + ret = -EPERM; + if (request == PTRACE_TRACEME) { + /* are we already being traced? */ + if (current->flags & PF_PTRACED) + goto out; + /* set the ptrace bit in the process flags. */ + current->flags |= PF_PTRACED; + ret = 0; + goto out; + } + ret = -ESRCH; + read_lock(&tasklist_lock); + child = find_task_by_pid(pid); + if (child) + get_task_struct(child); + read_unlock(&tasklist_lock); + if (!child) + goto out; + + ret = -EPERM; + if (pid == 1) /* you may not mess with init */ + goto out; + + if (request == PTRACE_ATTACH) { + if (child == current) + goto out_tsk; + if ((!child->dumpable || + (current->uid != child->euid) || + (current->uid != child->suid) || + (current->uid != child->uid) || + (current->gid != child->egid) || + (current->gid != child->sgid) || + (!cap_issubset(child->cap_permitted, current->cap_permitted)) || + (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) + goto out_tsk; + /* the same process cannot be attached many times */ + if (child->flags & PF_PTRACED) + goto out_tsk; + child->flags |= PF_PTRACED; + + write_lock_irq(&tasklist_lock); + if (child->p_pptr != current) { + REMOVE_LINKS(child); + child->p_pptr = current; + SET_LINKS(child); + } + write_unlock_irq(&tasklist_lock); + + send_sig(SIGSTOP, child, 1); + ret = 0; + goto out_tsk; + } + ret = -ESRCH; + if (!(child->flags & PF_PTRACED)) + goto out_tsk; + if (child->state != TASK_STOPPED) { + if (request != PTRACE_KILL) + goto out_tsk; + } + if (child->p_pptr != current) + goto out_tsk; + + switch (request) { + /* when I and D space are separate, these will need to be fixed. */ + case PTRACE_PEEKTEXT: /* read word at location addr. */ + case PTRACE_PEEKDATA: { + unsigned long tmp; + int copied; + + copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); + ret = -EIO; + if (copied != sizeof(tmp)) + break; + ret = put_user(tmp,(unsigned long *) data); + break; + } + + /* read the word at location addr in the USER area. */ + case PTRACE_PEEKUSR: { + struct pt_regs *regs; + unsigned long tmp; + + regs = (struct pt_regs *) ((unsigned long) child + + KERNEL_STACK_SIZE - 32 - sizeof(struct pt_regs)); + ret = 0; + + switch (addr) { + case 0 ... 31: + tmp = regs->regs[addr]; + break; + case FPR_BASE ... FPR_BASE + 31: + if (child->used_math) { +#ifndef CONFIG_SMP + if (last_task_used_math == child) { + set_cp0_status(ST0_CU1, ST0_CU1); + save_fp(child); + set_cp0_status(ST0_CU1, 0); + last_task_used_math = NULL; + } +#endif + tmp = child->thread.fpu.hard.fp_regs[addr - 32]; + } else { + tmp = -EIO; + } + break; + case PC: + tmp = regs->cp0_epc; + break; + case CAUSE: + tmp = regs->cp0_cause; + break; + case BADVADDR: + tmp = regs->cp0_badvaddr; + break; + case MMHI: + tmp = regs->hi; + break; + case MMLO: + tmp = regs->lo; + break; + case FPC_CSR: + tmp = child->thread.fpu.hard.control; + break; + case FPC_EIR: { /* implementation / version register */ + unsigned int flags; + __save_flags(flags); + set_cp0_status(ST0_CU1, ST0_CU1); + __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp)); + __restore_flags(flags); + break; + } + default: + tmp = 0; + ret = -EIO; + goto out_tsk; + } + ret = put_user(tmp, (unsigned long *) data); + break; + } + /* when I and D space are separate, this will have to be fixed. */ + case PTRACE_POKETEXT: /* write the word at location addr. */ + case PTRACE_POKEDATA: + ret = 0; + if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data)) + break; + ret = -EIO; + break; + + case PTRACE_POKEUSR: { + struct pt_regs *regs; + ret = 0; + regs = (struct pt_regs *) ((unsigned long) child + + KERNEL_STACK_SIZE - 32 - sizeof(struct pt_regs)); + + switch (addr) { + case 0 ... 31: + regs->regs[addr] = data; + break; + case FPR_BASE ... FPR_BASE + 31: { + unsigned long *fregs; + if (child->used_math) { +#ifndef CONFIG_SMP + if (last_task_used_math == child) { + set_cp0_status(ST0_CU1, ST0_CU1); + save_fp(child); + set_cp0_status(ST0_CU1, 0); + last_task_used_math = NULL; + regs->cp0_status &= ~ST0_CU1; + } +#endif + } else { + /* FP not yet used */ + memset(&child->thread.fpu.hard, ~0, + sizeof(child->thread.fpu.hard)); + child->thread.fpu.hard.control = 0; + } + fregs = child->thread.fpu.hard.fp_regs; + fregs[addr - FPR_BASE] = data; + break; + } + case PC: + regs->cp0_epc = data; + break; + case MMHI: + regs->hi = data; + break; + case MMLO: + regs->lo = data; + break; + case FPC_CSR: + child->thread.fpu.hard.control = data; + break; + default: + /* The rest are not allowed. */ + ret = -EIO; + break; + } + goto out; + } + case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ + case PTRACE_CONT: { /* restart after signal. */ + ret = -EIO; + if ((unsigned long) data > _NSIG) + break; + if (request == PTRACE_SYSCALL) + child->flags |= PF_TRACESYS; + else + child->flags &= ~PF_TRACESYS; + child->exit_code = data; + wake_up_process(child); + ret = 0; + break; + } + +/* + * make the child exit. Best I can do is send it a sigkill. + * perhaps it should be put in the status that it wants to + * exit. + */ + case PTRACE_KILL: { + if (child->state == TASK_ZOMBIE) /* already dead */ + break; + child->exit_code = SIGKILL; + wake_up_process(child); + break; + } + + case PTRACE_DETACH: { /* detach a process that was attached. */ + ret = -EIO; + if ((unsigned long) data > _NSIG) + break; + child->flags &= ~(PF_PTRACED|PF_TRACESYS); + child->exit_code = data; + write_lock_irq(&tasklist_lock); + REMOVE_LINKS(child); + child->p_pptr = child->p_opptr; + SET_LINKS(child); + write_unlock_irq(&tasklist_lock); + wake_up_process(child); + ret = 0; + break; + } + + default: + ret = -EIO; + break; + } + +out_tsk: + free_task_struct(child); +out: + unlock_kernel(); + return ret; +} asmlinkage void syscall_trace(void) { diff --git a/arch/mips64/kernel/r4k_cache.S b/arch/mips64/kernel/r4k_cache.S index 6d5a8271251c..87c496af8ed6 100644 --- a/arch/mips64/kernel/r4k_cache.S +++ b/arch/mips64/kernel/r4k_cache.S @@ -1,4 +1,4 @@ -/* $Id: r4k_cache.S,v 1.1 1999/12/04 03:59:00 ralf Exp $ +/* $Id: r4k_cache.S,v 1.1 1999/10/10 18:49:17 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/kernel/r4k_fpu.S b/arch/mips64/kernel/r4k_fpu.S index 24fc735f11cb..609b9fd0abbb 100644 --- a/arch/mips64/kernel/r4k_fpu.S +++ b/arch/mips64/kernel/r4k_fpu.S @@ -1,4 +1,4 @@ -/* $Id: r4k_fpu.S,v 1.1 1999/09/28 22:25:52 ralf Exp $ +/* $Id: r4k_fpu.S,v 1.1 1999/09/27 16:01:38 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/kernel/r4k_genex.S b/arch/mips64/kernel/r4k_genex.S index 45e6c154f413..b4ada3668ca1 100644 --- a/arch/mips64/kernel/r4k_genex.S +++ b/arch/mips64/kernel/r4k_genex.S @@ -1,4 +1,4 @@ -/* $Id: r4k_genex.S,v 1.3 2000/01/20 23:32:21 ralf Exp $ +/* $Id: r4k_genex.S,v 1.3 1999/11/23 17:12:49 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -69,6 +69,14 @@ NESTED(handle_\exception, PT_SIZE, sp) .set noat SAVE_ALL +#if DEBUG_MIPS64 +jal dodebug2 +ld $4, PT_R4(sp) +ld $5, PT_R5(sp) +ld $6, PT_R6(sp) +ld $7, PT_R7(sp) +ld $2, PT_R2(sp) +#endif __BUILD_clear_\clear .set at __BUILD_\verbose \exception diff --git a/arch/mips64/kernel/r4k_switch.S b/arch/mips64/kernel/r4k_switch.S index 2d889a9ad44e..f82ea64a485b 100644 --- a/arch/mips64/kernel/r4k_switch.S +++ b/arch/mips64/kernel/r4k_switch.S @@ -9,6 +9,7 @@ * Copyright (C) 1994, 1995, 1996, by Andreas Busse * Copyright (C) 1999 Silicon Graphics, Inc. */ +#include #include #include #include @@ -43,8 +44,14 @@ */ move $28, a1 cpu_restore_nonscratch $28 +#ifndef CONFIG_SMP daddiu t0, $28, KERNEL_STACK_SIZE-32 sd t0, kernelsp +#else + mtc0 a1, CP0_WATCHLO + dsrl32 a1, a1, 0 + mtc0 a1, CP0_WATCHHI +#endif mfc0 t1, CP0_STATUS /* Do we really need this? */ li a3, 0xff00 and t1, a3 @@ -73,7 +80,7 @@ LEAF(lazy_fpu_switch) beqz a0, 2f # Save floating point state nor t3, zero, t3 - lw t1, ST_OFF(a0) # last thread looses fpu + ld t1, ST_OFF(a0) # last thread looses fpu and t1, t3 sd t1, ST_OFF(a0) sll t2, t1, 5 @@ -84,6 +91,8 @@ LEAF(lazy_fpu_switch) fpu_save_16even a0 t1 # clobbers t1 2: + beqz a1, 3f + sll t0, t0, 5 # load new fp state bgez t0, 1f ldc1 $f0, (THREAD_FPU + 0x00)($28) @@ -91,6 +100,7 @@ LEAF(lazy_fpu_switch) 1: .set reorder fpu_restore_16even $28, t0 # clobbers t0 +3: jr ra END(lazy_fpu_switch) diff --git a/arch/mips64/kernel/r4k_tlb_debug.c b/arch/mips64/kernel/r4k_tlb_debug.c index 48631d57eb0a..e9ae2d6045da 100644 --- a/arch/mips64/kernel/r4k_tlb_debug.c +++ b/arch/mips64/kernel/r4k_tlb_debug.c @@ -1,4 +1,4 @@ -/* $Id: r4k_tlb_debug.c,v 1.3 2000/01/29 01:41:59 ralf Exp $ +/* $Id: r4k_tlb_debug.c,v 1.2 2000/01/17 23:32:46 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/kernel/r4k_tlb_glue.S b/arch/mips64/kernel/r4k_tlb_glue.S index b0726421eb25..7cf15443ef88 100644 --- a/arch/mips64/kernel/r4k_tlb_glue.S +++ b/arch/mips64/kernel/r4k_tlb_glue.S @@ -1,4 +1,4 @@ -/* $Id: r4k_tlb_glue.S,v 1.2 2000/01/17 23:32:46 ralf Exp $ +/* $Id: r4k_tlb_glue.S,v 1.5 1999/11/23 17:12:49 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -23,10 +23,26 @@ NESTED(__tlb_refill_debug_tramp, PT_SIZE, sp) END(__tlb_refill_debug_tramp) __FINIT - .macro tlb_handler name + .macro __BUILD_cli + CLI + .endm + + .macro __BUILD_sti + STI + .endm + + .macro tlb_handler name interruptible NESTED(__\name, PT_SIZE, sp) SAVE_ALL - CLI +#if DEBUG_MIPS64 +jal dodebug2 +ld $4, PT_R4(sp) +ld $5, PT_R5(sp) +ld $6, PT_R6(sp) +ld $7, PT_R7(sp) +ld $2, PT_R2(sp) +#endif + __BUILD_\interruptible dmfc0 t0, CP0_BADVADDR sd t0, PT_BVADDR(sp) move a0, sp @@ -35,8 +51,8 @@ NESTED(__tlb_refill_debug_tramp, PT_SIZE, sp) END(__\name) .endm - tlb_handler tlb_refill_debug - tlb_handler xtlb_refill_debug - tlb_handler xtlb_mod_debug - tlb_handler xtlb_tlbl_debug - tlb_handler xtlb_tlbs_debug + tlb_handler tlb_refill_debug cli + tlb_handler xtlb_refill_debug cli + tlb_handler xtlb_mod_debug sti + tlb_handler xtlb_tlbl_debug sti + tlb_handler xtlb_tlbs_debug sti diff --git a/arch/mips64/kernel/scall_64.S b/arch/mips64/kernel/scall_64.S index db1f1812295e..6a7a595512e8 100644 --- a/arch/mips64/kernel/scall_64.S +++ b/arch/mips64/kernel/scall_64.S @@ -22,9 +22,6 @@ /* This duplicates the definition from */ #define SIGILL 4 /* Illegal instruction (ANSI). */ -/* Highest syscall handled here. */ -#define MAX_SYSCALL_NO __NR_Linux + __NR_Linux_syscalls - #ifndef CONFIG_MIPS32_COMPAT #define handle_sys64 handle_sys #endif @@ -35,18 +32,19 @@ NESTED(handle_sys64, PT_SIZE, sp) #ifndef CONFIG_MIPS32_COMPAT .set noat SAVE_SOME + STI .set at #endif ld t1, PT_EPC(sp) # skip syscall on return - sltiu t0, v0, MAX_SYSCALL_NO + 1 # check syscall number + subu t0, v0, __NR_Linux # check syscall number + sltiu t0, t0, __NR_Linux_syscalls + 1 daddiu t1, 4 # skip to next instruction beqz t0, illegal_syscall sd t1, PT_EPC(sp) - dsll t0, v0, 3 + dsll t0, v0, 3 # offset into table ld t2, (sys_call_table - (__NR_Linux * 8))(t0) # syscall routine - beqz t2, illegal_syscall; sd a3, PT_R26(sp) # save a3 for syscall restarting @@ -163,7 +161,7 @@ sys_call_table: PTR sys_ni_syscall /* ptrace */ PTR sys_alarm PTR sys_fstat - PTR sys_ni_syscall + PTR sys_pause PTR sys_utime /* 4030 */ PTR sys_ni_syscall PTR sys_ni_syscall @@ -345,3 +343,5 @@ sys_call_table: PTR sys_ni_syscall PTR sys_ni_syscall PTR sys_pivot_root /* 4210 */ + PTR sys_mincore + PTR sys_madvise diff --git a/arch/mips64/kernel/scall_o32.S b/arch/mips64/kernel/scall_o32.S index c7ffed12bce4..d37fa0c2c208 100644 --- a/arch/mips64/kernel/scall_o32.S +++ b/arch/mips64/kernel/scall_o32.S @@ -1,4 +1,4 @@ -/* $Id: scall_o32.S,v 1.8 2000/02/23 00:41:00 ralf Exp $ +/* $Id: scall_o32.S,v 1.18 2000/03/27 21:04:13 ulfc Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -35,23 +35,26 @@ NESTED(handle_sys, PT_SIZE, sp) SAVE_SOME STI .set at - SAVE_ALL - ld a1, PT_R2(sp) - PRINT("Got syscall %d\n") - RESTORE_ALL - +#if DEBUG_MIPS64 + jal dodebug + ld $4, PT_R4(sp) + ld $5, PT_R5(sp) + ld $6, PT_R6(sp) + ld $7, PT_R7(sp) + ld $2, PT_R2(sp) +#endif ld t1, PT_EPC(sp) # skip syscall on return - sltiu t0, v0, MAX_SYSCALL_NO + 1 # check syscall number + subu t0, v0, __NR_Linux32 # check syscall number + sltiu t0, t0, __NR_Linux32_syscalls + 1 daddiu t1, 4 # skip to next instruction beqz t0, not_o32_scall sd t1, PT_EPC(sp) /* XXX Put both in one cacheline, should save a bit. */ - dsll t0, v0, 3 + dsll t0, v0, 3 # offset into table ld t2, (sys_call_table - (__NR_Linux32 * 8))(t0) # syscall routine lbu t3, (sys_narg_table - __NR_Linux32)(v0) # number of arguments - beqz t2, illegal_syscall; subu t0, t3, 5 # 5 or more arguments? sd a3, PT_R26(sp) # save a3 for syscall restarting @@ -72,7 +75,7 @@ stack_done: negu v0 # error sd v0, PT_R0(sp) # set flag for syscall restarting 1: sd v0, PT_R2(sp) # result - + FEXPORT(o32_ret_from_sys_call) lw t0, softirq_state lw t1, softirq_state+4 # unused delay slot @@ -110,6 +113,11 @@ o32_reschedule: trace_a_syscall: SAVE_STATIC + sd a4, PT_R8(sp) + sd a5, PT_R9(sp) + sd a6, PT_R10(sp) + sd a7, PT_R11(sp) + sd t2,PT_R1(sp) jal syscall_trace ld t2,PT_R1(sp) @@ -118,6 +126,9 @@ trace_a_syscall: ld a1, PT_R5(sp) ld a2, PT_R6(sp) ld a3, PT_R7(sp) + ld a4, PT_R8(sp) + ld a5, PT_R9(sp) + jalr t2 li t0, -EMAXERRNO - 1 # error? @@ -130,7 +141,7 @@ trace_a_syscall: 1: sd v0, PT_R2(sp) # result jal syscall_trace - j ret_from_sys_call + j o32_ret_from_sys_call /* ------------------------------------------------------------------------ */ @@ -197,12 +208,12 @@ illegal_syscall: sys sys_read 3 sys sys_write 3 sys sys_open 3 /* 4005 */ - sys sys_close 3 + sys sys_close 1 sys sys_waitpid 3 sys sys_creat 2 sys sys_link 2 sys sys_unlink 1 /* 4010 */ - sys sys_execve 0 + sys sys32_execve 0 sys sys_chdir 1 sys sys_time 1 sys sys_mknod 3 @@ -217,10 +228,10 @@ illegal_syscall: sys sys_setuid 1 sys sys_getuid 0 sys sys_stime 1 /* 4025 */ - sys sys_ni_syscall 0 /* ptrace */ - sys sys_alarm 1 + sys sys32_ptrace 4 + sys sys32_alarm 1 sys sys_fstat 2 - sys sys_ni_syscall 0 + sys sys_pause 0 sys sys_utime 2 /* 4030 */ sys sys_ni_syscall 0 sys sys_ni_syscall 0 @@ -245,7 +256,7 @@ illegal_syscall: sys sys_acct 0 sys sys_umount 2 sys sys_ni_syscall 0 - sys sys_ioctl 3 + sys sys32_ioctl 3 sys sys_fcntl 3 /* 4055 */ sys sys_ni_syscall 2 sys sys_setpgid 2 @@ -266,11 +277,11 @@ illegal_syscall: sys sys32_sigsuspend 0 sys sys32_sigpending 1 sys sys_sethostname 2 - sys sys_setrlimit 2 /* 4075 */ - sys sys_old_getrlimit 2 - sys sys_getrusage 2 - sys sys_gettimeofday 2 - sys sys_settimeofday 2 + sys sys32_setrlimit 2 /* 4075 */ + sys sys32_getrlimit 2 + sys sys32_getrusage 2 + sys sys32_gettimeofday 2 + sys sys32_settimeofday 2 sys sys_getgroups 2 /* 4080 */ sys sys_setgroups 2 sys sys_ni_syscall 0 /* old_select */ @@ -280,7 +291,7 @@ illegal_syscall: sys sys_uselib 1 sys sys_swapon 2 sys sys_reboot 3 - sys old_readdir 3 + sys sys32_readdir 3 sys sys_mmap 6 /* 4090 */ sys sys_munmap 2 sys sys_truncate 2 @@ -290,13 +301,13 @@ illegal_syscall: sys sys_getpriority 2 sys sys_setpriority 3 sys sys_ni_syscall 0 - sys sys_statfs 2 - sys sys_fstatfs 2 /* 4100 */ + sys sys32_statfs 2 + sys sys32_fstatfs 2 /* 4100 */ sys sys_ni_syscall 0 /* sys_ioperm */ sys sys_socketcall 2 sys sys_syslog 3 - sys sys_setitimer 3 - sys sys_getitimer 2 /* 4105 */ + sys sys32_setitimer 3 + sys sys32_getitimer 2 /* 4105 */ sys sys32_newstat 2 sys sys32_newlstat 2 sys sys32_newfstat 2 @@ -305,7 +316,7 @@ illegal_syscall: sys sys_vhangup 0 sys sys_ni_syscall 0 /* was sys_idle */ sys sys_ni_syscall 0 /* sys_vm86 */ - sys sys_wait4 4 + sys sys32_wait4 4 sys sys_swapoff 1 /* 4115 */ sys sys_sysinfo 1 sys sys_ipc 6 @@ -317,7 +328,7 @@ illegal_syscall: sys sys_ni_syscall 0 /* sys_modify_ldt */ sys sys_adjtimex 1 sys sys_mprotect 3 /* 4125 */ - sys sys_sigprocmask 3 + sys sys32_sigprocmask 3 sys sys_create_module 2 sys sys_init_module 5 sys sys_delete_module 1 @@ -331,13 +342,13 @@ illegal_syscall: sys sys_ni_syscall 0 /* for afs_syscall */ sys sys_setfsuid 1 sys sys_setfsgid 1 - sys sys_llseek 5 /* 4140 */ - sys sys_getdents 3 - sys sys_select 5 + sys sys32_llseek 5 /* 4140 */ + sys sys32_getdents 3 + sys sys32_select 5 sys sys_flock 2 sys sys_msync 3 - sys sys_readv 3 /* 4145 */ - sys sys_writev 3 + sys sys32_readv 3 /* 4145 */ + sys sys32_writev 3 sys sys_cacheflush 3 sys sys_cachectl 3 sys sys_sysmips 4 @@ -356,8 +367,8 @@ illegal_syscall: sys sys_sched_yield 0 sys sys_sched_get_priority_max 1 sys sys_sched_get_priority_min 1 - sys sys_sched_rr_get_interval 2 /* 4165 */ - sys sys_nanosleep 2 + sys sys32_sched_rr_get_interval 2 /* 4165 */ + sys sys32_nanosleep 2 sys sys_mremap 4 sys sys_accept 3 sys sys_bind 3 @@ -408,6 +419,8 @@ illegal_syscall: sys sys_lstat64 3 sys sys_fstat64 3 /* 4210 */ sys sys_pivot_root 2 + sys sys_mincore 3 + sys sys_madvise 3 .endm .macro sys function, nargs diff --git a/arch/mips64/kernel/setup.c b/arch/mips64/kernel/setup.c index 2009860a9775..fe4c750d4021 100644 --- a/arch/mips64/kernel/setup.c +++ b/arch/mips64/kernel/setup.c @@ -1,4 +1,4 @@ -/* $Id: setup.c,v 1.7 2000/02/04 07:40:24 ralf Exp $ +/* $Id: setup.c,v 1.9 2000/03/14 01:39:27 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -37,10 +37,13 @@ #include #ifdef CONFIG_SGI_IP27 +/* XXX Origin garbage has no business in this file */ #include #endif -struct mips_cpuinfo boot_cpu_data; +#ifndef CONFIG_SMP +struct cpuinfo_mips cpu_data[1]; +#endif #ifdef CONFIG_VT struct screen_info screen_info; @@ -102,7 +105,10 @@ extern char arcs_cmdline[CL_SIZE]; * mips_io_port_base is the begin of the address space to which x86 style * I/O ports are mapped. */ +#ifdef CONFIG_SGI_IP27 +/* XXX Origin garbage has no business in this file */ unsigned long mips_io_port_base = IO_BASE; +#endif extern void ip22_setup(void); extern void ip27_setup(void); @@ -183,4 +189,6 @@ void __init setup_arch(char **cmdline_p) *memory_start_p = initrd_end; } #endif + + paging_init(); } diff --git a/arch/mips64/kernel/signal.c b/arch/mips64/kernel/signal.c index c80b58a1cf65..7f644a437883 100644 --- a/arch/mips64/kernel/signal.c +++ b/arch/mips64/kernel/signal.c @@ -1,4 +1,4 @@ -/* $Id: signal.c,v 1.5 2000/02/04 07:40:24 ralf Exp $ +/* $Id: signal.c,v 1.4 2000/01/17 23:32:46 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -26,6 +26,7 @@ #include #include #include +#include #define DEBUG_SIG 0 @@ -37,6 +38,35 @@ extern asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs); extern asmlinkage int save_fp_context(struct sigcontext *sc); extern asmlinkage int restore_fp_context(struct sigcontext *sc); +static inline int store_fp_context(struct sigcontext *sc) +{ + unsigned int fcr0; + int err = 0; + + err |= __copy_to_user(&sc->sc_fpregs[0], + ¤t->thread.fpu.hard.fp_regs[0], NUM_FPU_REGS * + sizeof(unsigned long)); + err |= __copy_to_user(&sc->sc_fpc_csr, ¤t->thread.fpu.hard.control, + sizeof(unsigned int)); + __asm__ __volatile__("cfc1 %0, $0\n\t" : "=r" (fcr0)); + err |= __copy_to_user(&sc->sc_fpc_eir, &fcr0, sizeof(unsigned int)); + + return err; +} + +static inline int refill_fp_context(struct sigcontext *sc) +{ + int err = 0; + + if (verify_area(VERIFY_READ, sc, sizeof(*sc))) + return -EFAULT; + err |= __copy_from_user(¤t->thread.fpu.hard.fp_regs[0], + &sc->sc_fpregs[0], NUM_FPU_REGS * sizeof(unsigned long)); + err |= __copy_from_user(¤t->thread.fpu.hard.control, &sc->sc_fpc_csr, + sizeof(unsigned int)); + return err; +} + /* * Atomically swap in the new signal mask, and wait for a signal. */ @@ -180,8 +210,12 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc) err |= __get_user(owned_fp, &sc->sc_ownedfp); if (owned_fp) { - err |= restore_fp_context(sc); - last_task_used_math = current; + if (IS_FPU_OWNER()) { + CLEAR_FPU_OWNER(); + regs->cp0_status &= ~ST0_CU1; + } + current->used_math = 1; + err |= refill_fp_context(sc); } return err; @@ -281,11 +315,9 @@ badframe: static int inline setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc) { - int owned_fp; int err = 0; err |= __put_user(regs->cp0_epc, &sc->sc_pc); - err |= __put_user(regs->cp0_status, &sc->sc_status); #define save_gp_reg(i) { \ err |= __put_user(regs->regs[i], &sc->sc_regs[i]); \ @@ -306,16 +338,19 @@ setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc) err |= __put_user(regs->cp0_cause, &sc->sc_cause); err |= __put_user(regs->cp0_badvaddr, &sc->sc_badvaddr); - owned_fp = (current == last_task_used_math); - err |= __put_user(owned_fp, &sc->sc_ownedfp); - if (current->used_math) { /* fp is active. */ - set_cp0_status(ST0_CU1, ST0_CU1); - err |= save_fp_context(sc); - last_task_used_math = NULL; - regs->cp0_status &= ~ST0_CU1; + if (IS_FPU_OWNER()) { + lazy_fpu_switch(current, 0); + CLEAR_FPU_OWNER(); + regs->cp0_status &= ~ST0_CU1; + } + err |= __put_user(1, &sc->sc_ownedfp); + err |= store_fp_context(sc); current->used_math = 0; + } else { + err |= __put_user(0, &sc->sc_ownedfp); } + err |= __put_user(regs->cp0_status, &sc->sc_status); return err; } diff --git a/arch/mips64/kernel/signal32.c b/arch/mips64/kernel/signal32.c index 109c4d37b8dc..e33a69d5ef6a 100644 --- a/arch/mips64/kernel/signal32.c +++ b/arch/mips64/kernel/signal32.c @@ -1,4 +1,4 @@ -/* $Id: signal32.c,v 1.2 2000/02/18 00:03:48 ralf Exp $ +/* $Id: signal32.c,v 1.4 2000/03/15 22:46:55 kanoj Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -8,6 +8,7 @@ * Copyright (C) 1994 - 1999 Ralf Baechle * Copyright (C) 1999 Silicon Graphics, Inc. */ +#include #include #include #include @@ -25,6 +26,7 @@ #include #include #include +#include #define DEBUG_SIG 0 @@ -38,12 +40,11 @@ extern asmlinkage int restore_fp_context(struct sigcontext *sc); /* 32-bit compatibility types */ -#define _NSIG32 128 #define _NSIG32_BPW 32 -#define _NSIG_WORDS (_NSIG / _NSIG_BPW) +#define _NSIG32_WORDS (_NSIG / _NSIG32_BPW) typedef struct { - unsigned int sig[_NSIG_WORDS]; + unsigned int sig[_NSIG32_WORDS]; } sigset32_t; typedef unsigned int __sighandler32_t; @@ -65,6 +66,35 @@ typedef struct sigaltstack32 { } stack32_t; +static inline int store_fp_context(struct sigcontext *sc) +{ + unsigned int fcr0; + int err = 0; + + err |= __copy_to_user(&sc->sc_fpregs[0], + ¤t->thread.fpu.hard.fp_regs[0], NUM_FPU_REGS * + sizeof(unsigned long)); + err |= __copy_to_user(&sc->sc_fpc_csr, ¤t->thread.fpu.hard.control, + sizeof(unsigned int)); + __asm__ __volatile__("cfc1 %0, $0\n\t" : "=r" (fcr0)); + err |= __copy_to_user(&sc->sc_fpc_eir, &fcr0, sizeof(unsigned int)); + + return err; +} + +static inline int refill_fp_context(struct sigcontext *sc) +{ + int err = 0; + + if (verify_area(VERIFY_READ, sc, sizeof(*sc))) + return -EFAULT; + err |= __copy_from_user(¤t->thread.fpu.hard.fp_regs[0], + &sc->sc_fpregs[0], NUM_FPU_REGS * sizeof(unsigned long)); + err |= __copy_from_user(¤t->thread.fpu.hard.control, &sc->sc_fpc_csr, + sizeof(unsigned int)); + return err; +} + /* * Atomically swap in the new signal mask, and wait for a signal. */ @@ -211,8 +241,12 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc) err |= __get_user(owned_fp, &sc->sc_ownedfp); if (owned_fp) { - err |= restore_fp_context(sc); - last_task_used_math = current; + if (IS_FPU_OWNER()) { + CLEAR_FPU_OWNER(); + regs->cp0_status &= ~ST0_CU1; + } + current->used_math = 1; + err |= refill_fp_context(sc); } return err; @@ -237,7 +271,10 @@ sys32_sigreturn(abi64_no_regargs, struct pt_regs regs) { struct sigframe *frame; sigset_t blocked; + +#if DEBUG_MIPS64 printk("%s called.\n", __FUNCTION__); +#endif frame = (struct sigframe *) regs.regs[29]; if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) @@ -314,11 +351,9 @@ badframe: static int inline setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc) { - int owned_fp; int err = 0; err |= __put_user(regs->cp0_epc, &sc->sc_pc); - err |= __put_user(regs->cp0_status, &sc->sc_status); #define save_gp_reg(i) { \ err |= __put_user(regs->regs[i], &sc->sc_regs[i]); \ @@ -339,16 +374,19 @@ setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc) err |= __put_user(regs->cp0_cause, &sc->sc_cause); err |= __put_user(regs->cp0_badvaddr, &sc->sc_badvaddr); - owned_fp = (current == last_task_used_math); - err |= __put_user(owned_fp, &sc->sc_ownedfp); - if (current->used_math) { /* fp is active. */ - set_cp0_status(ST0_CU1, ST0_CU1); - err |= save_fp_context(sc); - last_task_used_math = NULL; - regs->cp0_status &= ~ST0_CU1; + if (IS_FPU_OWNER()) { + lazy_fpu_switch(current, 0); + CLEAR_FPU_OWNER(); + regs->cp0_status &= ~ST0_CU1; + } + err |= __put_user(1, &sc->sc_ownedfp); + err |= store_fp_context(sc); current->used_math = 0; + } else { + err |= __put_user(0, &sc->sc_ownedfp); } + err |= __put_user(regs->cp0_status, &sc->sc_status); return err; } @@ -390,10 +428,10 @@ setup_frame(struct k_sigaction * ka, struct pt_regs *regs, /* * Set up the return code ... * - * li v0, __NR_sigreturn + * li v0, __NR_Linux32_sigreturn * syscall */ - err |= __put_user(0x24020000 + __NR_sigreturn, + err |= __put_user(0x24020000 + __NR_Linux32_sigreturn, frame->sf_code + 0); err |= __put_user(0x0000000c , frame->sf_code + 1); @@ -453,10 +491,10 @@ setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs, /* * Set up the return code ... * - * li v0, __NR_sigreturn + * li v0, __NR_Linux32_sigreturn * syscall */ - err |= __put_user(0x24020000 + __NR_sigreturn, + err |= __put_user(0x24020000 + __NR_Linux32_sigreturn, frame->rs_code + 0); err |= __put_user(0x0000000c , frame->rs_code + 1); @@ -555,7 +593,10 @@ asmlinkage int do_signal32(sigset_t *oldset, struct pt_regs *regs) { struct k_sigaction *ka; siginfo_t info; + +#if DEBUG_MIPS64 printk("%s: delivering signal.\n", current->comm); +#endif if (!oldset) oldset = ¤t->blocked; @@ -656,7 +697,9 @@ printk("%s: delivering signal.\n", current->comm); if (regs->regs[0]) syscall_restart(regs, ka); /* Whee! Actually deliver the signal. */ +#if DEBUG_MIPS64 printk("%s: delivering signal.\n", __FUNCTION__); +#endif handle_signal(signr, ka, &info, oldset, regs); return 1; } @@ -677,6 +720,25 @@ printk("%s: delivering signal.\n", __FUNCTION__); return 0; } +extern asmlinkage int sys_sigprocmask(int how, old_sigset_t *set, + old_sigset_t *oset); + +asmlinkage int sys32_sigprocmask(int how, old_sigset_t32 *set, + old_sigset_t32 *oset) +{ + old_sigset_t s; + int ret; + mm_segment_t old_fs = get_fs(); + + if (set && get_user (s, set)) return -EFAULT; + set_fs (KERNEL_DS); + ret = sys_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL); + set_fs (old_fs); + if (ret) return ret; + if (oset && put_user (s, oset)) return -EFAULT; + return 0; +} + /* Dummies ... */ asmlinkage void sys32_sigpending(void) { panic(__FUNCTION__ " called."); } diff --git a/arch/mips64/kernel/smp.c b/arch/mips64/kernel/smp.c new file mode 100644 index 000000000000..155b0656c73f --- /dev/null +++ b/arch/mips64/kernel/smp.c @@ -0,0 +1,258 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_SGI_IP27 + +#include +#include +#include +#include +#include + +#define DORESCHED 0xab +#define DOCALL 0xbc + +#define IRQ_TO_SWLEVEL(i) i + 7 /* Delete this from here */ + +static void sendintr(int destid, unsigned char status) +{ + int irq; + +#if (CPUS_PER_NODE == 2) + switch (status) { + case DORESCHED: irq = CPU_RESCHED_A_IRQ; break; + case DOCALL: irq = CPU_CALL_A_IRQ; break; + default: panic("sendintr"); + } + irq += cputoslice(destid); + + /* + * Convert the compact hub number to the NASID to get the correct + * part of the address space. Then set the interrupt bit associated + * with the CPU we want to send the interrupt to. + */ + REMOTE_HUB_SEND_INTR(COMPACT_TO_NASID_NODEID(cputocnode(destid)), + IRQ_TO_SWLEVEL(irq)); +#else + << Bomb! Must redefine this for more than 2 CPUS. >> +#endif +} + +#endif /* CONFIG_SGI_IP27 */ + +/* The 'big kernel lock' */ +spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED; +int smp_threads_ready = 0; /* Not used */ +atomic_t smp_commenced = ATOMIC_INIT(0); +struct cpuinfo_mips cpu_data[NR_CPUS]; +int smp_num_cpus; /* Number that came online. */ +int __cpu_number_map[NR_CPUS]; +int __cpu_logical_map[NR_CPUS]; +cycles_t cacheflush_time; + +static void smp_tune_scheduling (void) +{ +} + +void __init smp_boot_cpus(void) +{ + extern void allowboot(void); + extern int maxcpus; + + init_new_context(current, &init_mm); + global_irq_holder = 0; + current->processor = 0; + init_idle(); + smp_tune_scheduling(); + smp_num_cpus = maxcpus; + allowboot(); +} + +void __init smp_commence(void) +{ + wmb(); + atomic_set(&smp_commenced,1); +} + +static void stop_this_cpu(void *dummy) +{ + /* + * Remove this CPU + */ + for (;;); +} + +void smp_send_stop(void) +{ + smp_call_function(stop_this_cpu, NULL, 1, 0); + smp_num_cpus = 1; +} + +/* + * this function sends a 'reschedule' IPI to another CPU. + * it goes straight through and wastes no time serializing + * anything. Worst case is that we lose a reschedule ... + */ +void smp_send_reschedule(int cpu) +{ + sendintr(cpu, DORESCHED); +} + +/* Not really SMP stuff ... */ +int setup_profiling_timer(unsigned int multiplier) +{ + return 0; +} + +/* + * Run a function on all other CPUs. + * The function to run. This must be fast and non-blocking. + * An arbitrary pointer to pass to the function. + * If true, keep retrying until ready. + * If true, wait until function has completed on other CPUs. + * [RETURNS] 0 on success, else a negative status code. + * + * Does not return until remote CPUs are nearly ready to execute + * or are or have executed. + */ +static volatile struct call_data_struct { + void (*func) (void *info); + void *info; + atomic_t started; + atomic_t finished; + int wait; +} *call_data = NULL; + +int smp_call_function (void (*func) (void *info), void *info, int retry, + int wait) +{ + struct call_data_struct data; + int i, cpus = smp_num_cpus-1; + static spinlock_t lock = SPIN_LOCK_UNLOCKED; + + if (cpus == 0) + return 0; + + data.func = func; + data.info = info; + atomic_set(&data.started, 0); + data.wait = wait; + if (wait) + atomic_set(&data.finished, 0); + + spin_lock_bh(&lock); + call_data = &data; + /* Send a message to all other CPUs and wait for them to respond */ + for (i = 0; i < smp_num_cpus; i++) + if (smp_processor_id() != i) + sendintr(i, DOCALL); + + /* Wait for response */ + /* FIXME: lock-up detection, backtrace on lock-up */ + while (atomic_read(&data.started) != cpus) + barrier(); + + if (wait) + while (atomic_read(&data.finished) != cpus) + barrier(); + spin_unlock_bh(&lock); + return 0; +} + +void smp_call_function_interrupt(void) +{ + void (*func) (void *info) = call_data->func; + void *info = call_data->info; + int wait = call_data->wait; + + /* + * Notify initiating CPU that I've grabbed the data and am + * about to execute the function. + */ + atomic_inc(&call_data->started); + + /* + * At this point the info structure may be out of scope unless wait==1. + */ + (*func)(info); + if (wait) + atomic_inc(&call_data->finished); +} + + +static void flush_tlb_all_ipi(void *info) +{ + _flush_tlb_all(); +} + +void flush_tlb_all(void) +{ + smp_call_function(flush_tlb_all_ipi, 0, 1, 1); + _flush_tlb_all(); +} + +static void flush_tlb_mm_ipi(void *mm) +{ + _flush_tlb_mm((struct mm_struct *)mm); +} + +void flush_tlb_mm(struct mm_struct *mm) +{ + smp_call_function(flush_tlb_mm_ipi, (void *)mm, 1, 1); + _flush_tlb_mm(mm); +} + +struct flush_tlb_data { + struct mm_struct *mm; + struct vm_area_struct *vma; + unsigned long addr1; + unsigned long addr2; +}; + +static void flush_tlb_range_ipi(void *info) +{ + struct flush_tlb_data *fd = (struct flush_tlb_data *)info; + + _flush_tlb_range(fd->mm, fd->addr1, fd->addr2); +} + +void flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end) +{ + struct flush_tlb_data fd; + + fd.mm = mm; + fd.addr1 = start; + fd.addr2 = end; + smp_call_function(flush_tlb_range_ipi, (void *)&fd, 1, 1); + _flush_tlb_range(mm, start, end); +} + +static void flush_tlb_page_ipi(void *info) +{ + struct flush_tlb_data *fd = (struct flush_tlb_data *)info; + + _flush_tlb_page(fd->vma, fd->addr1); +} + +void flush_tlb_page(struct vm_area_struct *vma, unsigned long page) +{ + struct flush_tlb_data fd; + + fd.vma = vma; + fd.addr1 = page; + smp_call_function(flush_tlb_page_ipi, (void *)&fd, 1, 1); + _flush_tlb_page(vma, page); +} + diff --git a/arch/mips64/kernel/softfp.S b/arch/mips64/kernel/softfp.S index e83c63d6a1cc..be08ff010876 100644 --- a/arch/mips64/kernel/softfp.S +++ b/arch/mips64/kernel/softfp.S @@ -1,4 +1,4 @@ -/* $Id: softfp.S,v 1.1 1999/12/04 03:59:00 ralf Exp $ +/* $Id: softfp.S,v 1.2 2000/03/21 23:50:42 ulfc Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -148,7 +148,8 @@ insn: LOCK_KERNEL; \ la a1, 8f; \ TEXT(#insn); \ - la a1, nosim; \ + la a0, nosim; \ + jal printk; \ UNLOCK_KERNEL; \ j done @@ -165,9 +166,9 @@ LEAF(simfp) .cpload $25 .set reorder - subu sp, 16 + dsubu sp, 16 .cprestore 20 - sw ra, 16(sp) + sd ra, 0(sp) /* For now we assume that we get the opcode to simulate passed in as an argument. */ @@ -178,9 +179,9 @@ LEAF(simfp) */ la ta1, lowtab andi ta2, ta0, 0x3f - sll ta2, ta2, 2 - addu ta1, ta2 - lw ta1, (ta1) + sll ta2, ta2, 3 + daddu ta1, ta2 + ld ta1, (ta1) jr ta1 END(simfp) @@ -189,17 +190,17 @@ LEAF(simfp) * can keep the jump table significantly shorter. */ #define FMT_switch(insn,opc,temp0,temp1) \ -insn: srl temp0, opc, 19; \ +insn: srl temp0, opc, 18; \ andi temp0, 0x1c; \ la temp1, insn ## .tab; \ - addu temp0, temp1; \ - lw temp0, (temp0); \ + daddu temp0, temp1; \ + ld temp0, (temp0); \ jr temp0; \ \ .data; \ insn ## .tab: \ - .word insn ## .s, insn ## .d, unimp, unimp; \ - .word insn ## .w, insn ## .l, unimp, unimp; \ + .dword insn ## .s, insn ## .d, unimp, unimp; \ + .dword insn ## .w, insn ## .l, unimp, unimp; \ .previous BITCH(add) @@ -293,8 +294,8 @@ cvt.w.s: full fp simulation. */ /* Done, return. */ - lw ra, 16(sp) - addu sp, 16 + ld ra, 0(sp) + daddu sp, 16 jr ra /* Convert a double fp to a fixed point integer. */ @@ -378,8 +379,8 @@ cvt.w.d: jal s_put_fpreg /* Done, return. */ - lw ra, 16(sp) - addu sp, 16 + ld ra, 0(sp) + daddu sp, 16 jr ra cvt.w.w = unimp # undefined result @@ -410,11 +411,9 @@ cvt.l = unimp /* Get the single precission register which's number is in ta1. */ s_get_fpreg: .set noat - sll AT, ta1, 2 sll ta1, 3 - addu ta1, AT la AT, 1f - addu AT, ta1 + daddu AT, ta1 jr AT .set at @@ -489,11 +488,9 @@ s_get_fpreg: */ s_put_fpreg: .set noat - sll AT, ta1, 2 sll ta1, 3 - addu ta1, AT la AT, 1f - addu AT, ta1 + daddu AT, ta1 jr AT .set at @@ -565,9 +562,11 @@ s_put_fpreg: /* Get the double precission register which's number is in ta1 into ta1/ta2. */ d_get_fpreg: .set noat - sll ta1, 3 + sll AT, ta1, 1 + sll ta1, 2 + daddu ta1, AT la AT, 1f - addu AT, ta1 + daddu AT, ta1 jr AT .set at @@ -624,16 +623,16 @@ d_get_fpreg: * Send an invalid operation exception. */ invalid: - lw ra, 16(sp) - addu sp, 16 + ld ra, 0(sp) + daddu sp, 16 jr ra /* * Done, just skip over the current instruction */ done: - lw ra, 16(sp) - addu sp, 16 + ld ra, 0(sp) + daddu sp, 16 jr ra unimp: @@ -641,7 +640,7 @@ unimp: on new, yet unsupported CPU types or when the faulting instruction is being executed for cache but has been overwritten in memory. */ LOCK_KERNEL - move a0, ta0 + move a1, ta0 PRINT(KERN_DEBUG "FP support: unknown fp op %08lx, ") PRINT("please mail to ralf@gnu.org.\n") UNLOCK_KERNEL @@ -650,19 +649,19 @@ unimp: move a1, $28 jal force_sig - lw ra, 16(sp) - addu sp, 16 + ld ra, 0(sp) + daddu sp, 16 jr ra /* * Jump table for the lowest 6 bits of a cp1 instruction. */ .data -lowtab: .word add, sub, mul, div, sqrt, abs, mov, neg - .word round.l,trunc.l,ceil.l,floor.l,round.w,trunc.w,ceil.w,floor.w - .word unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp - .word unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp - .word cvt.s, cvt.d, unimp, unimp, cvt.w, cvt.l, unimp, unimp - .word unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp - .word c.f, c.un, c.eq, c.ueq, c.olt, c.ult, c.ole, c.ule - .word c.sf, c.ngle,c.seq, c.ngl, c.lt, c.nge, c.le, c.ngt +lowtab: .dword add, sub, mul, div, sqrt, abs, mov, neg + .dword round.l,trunc.l,ceil.l,floor.l,round.w,trunc.w,ceil.w,floor.w + .dword unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp + .dword unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp + .dword cvt.s, cvt.d, unimp, unimp, cvt.w, cvt.l, unimp, unimp + .dword unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp + .dword c.f, c.un, c.eq, c.ueq, c.olt, c.ult, c.ole, c.ule + .dword c.sf, c.ngle,c.seq, c.ngl, c.lt, c.nge, c.le, c.ngt diff --git a/arch/mips64/kernel/syscall.c b/arch/mips64/kernel/syscall.c index b7521f151127..f791806d606f 100644 --- a/arch/mips64/kernel/syscall.c +++ b/arch/mips64/kernel/syscall.c @@ -108,7 +108,6 @@ asmlinkage int sys_execve(abi64_no_regargs, struct pt_regs regs) int error; char * filename; - lock_kernel(); filename = getname((char *) (long)regs.regs[4]); error = PTR_ERR(filename); if (IS_ERR(filename)) @@ -118,7 +117,6 @@ asmlinkage int sys_execve(abi64_no_regargs, struct pt_regs regs) putname(filename); out: - unlock_kernel(); return error; } @@ -323,3 +321,10 @@ asmlinkage void bad_stack(void) { do_exit(SIGSEGV); } + +asmlinkage int sys_pause(void) +{ + current->state = TASK_INTERRUPTIBLE; + schedule(); + return -ERESTARTNOHAND; +} diff --git a/arch/mips64/kernel/traps.c b/arch/mips64/kernel/traps.c index 1af2be15aa3a..fa58017cfef3 100644 --- a/arch/mips64/kernel/traps.c +++ b/arch/mips64/kernel/traps.c @@ -1,4 +1,4 @@ -/* $Id: traps.c,v 1.5 2000/02/24 00:12:41 ralf Exp $ +/* $Id: traps.c,v 1.4 2000/01/20 23:50:27 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -328,8 +328,9 @@ void do_tr(struct pt_regs *regs) void do_ri(struct pt_regs *regs) { lock_kernel(); - printk("[%s:%ld] Illegal instruction at %08lx ra=%08lx\n", - current->comm, current->pid, regs->cp0_epc, regs->regs[31]); + printk("Cpu%d[%s:%ld] Illegal instruction at %08lx ra=%08lx\n", + smp_processor_id(), current->comm, current->pid, regs->cp0_epc, + regs->regs[31]); unlock_kernel(); if (compute_return_epc(regs)) return; @@ -345,16 +346,27 @@ void do_cpu(struct pt_regs *regs) goto bad_cid; regs->cp0_status |= ST0_CU1; +#ifndef CONFIG_SMP if (last_task_used_math == current) return; if (current->used_math) { /* Using the FPU again. */ - lazy_fpu_switch(last_task_used_math); + lazy_fpu_switch(last_task_used_math, current); } else { /* First time FPU user. */ + lazy_fpu_switch(last_task_used_math, 0); init_fpu(); current->used_math = 1; } last_task_used_math = current; +#else + if (current->used_math) { + lazy_fpu_switch(0, current); + } else { + init_fpu(); + current->used_math = 1; + } + current->flags |= PF_USEDFPU; +#endif return; bad_cid: @@ -446,7 +458,6 @@ static inline void mips4_setup(void) mips4_available = 1; set_cp0_status(ST0_XX, ST0_XX); } - mips4_available = 0; } static inline void go_64(void) @@ -561,5 +572,4 @@ r4k: atomic_inc(&init_mm.mm_count); /* XXX UP? */ current->active_mm = &init_mm; - current_pgd = init_mm.pgd; } diff --git a/arch/mips64/kernel/unaligned.c b/arch/mips64/kernel/unaligned.c index 34c5857c51f5..5381642f104f 100644 --- a/arch/mips64/kernel/unaligned.c +++ b/arch/mips64/kernel/unaligned.c @@ -1,4 +1,4 @@ -/* $Id: unaligned.c,v 1.2 2000/01/17 23:32:46 ralf Exp $ +/* $Id: unaligned.c,v 1.2 1999/11/23 17:12:50 ralf Exp $ * * Handle unaligned accesses by emulation. * diff --git a/arch/mips64/lib/Makefile b/arch/mips64/lib/Makefile index f021deb6449b..3e61ae79edeb 100644 --- a/arch/mips64/lib/Makefile +++ b/arch/mips64/lib/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 1999/12/04 03:59:00 ralf Exp $ +# $Id: Makefile,v 1.2 1999/11/19 20:35:22 ralf Exp $ # # Makefile for MIPS-specific library files.. # diff --git a/arch/mips64/lib/csum_partial.S b/arch/mips64/lib/csum_partial.S index 7851d98f40e1..27147065a164 100644 --- a/arch/mips64/lib/csum_partial.S +++ b/arch/mips64/lib/csum_partial.S @@ -1,4 +1,4 @@ -/* $Id: csum_partial.S,v 1.2 1999/12/04 03:59:00 ralf Exp $ +/* $Id: csum_partial.S,v 1.1 1999/08/21 21:43:00 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/csum_partial_copy.c b/arch/mips64/lib/csum_partial_copy.c index ee314cd9512a..49607c46644c 100644 --- a/arch/mips64/lib/csum_partial_copy.c +++ b/arch/mips64/lib/csum_partial_copy.c @@ -1,4 +1,4 @@ -/* $Id: csum_partial_copy.c,v 1.3 2000/02/05 06:47:09 ralf Exp $ +/* $Id: csum_partial_copy.c,v 1.2 1999/12/04 03:59:00 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/floppy-no.c b/arch/mips64/lib/floppy-no.c index d2cf2932c274..f0cd72d28cd5 100644 --- a/arch/mips64/lib/floppy-no.c +++ b/arch/mips64/lib/floppy-no.c @@ -1,4 +1,4 @@ -/* $Id: floppy-no.c,v 1.2 1999/12/04 03:59:00 ralf Exp $ +/* $Id: floppy-no.c,v 1.1 1999/08/21 21:43:00 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/floppy-std.c b/arch/mips64/lib/floppy-std.c index 079acae8cb8c..88dbfdbc140d 100644 --- a/arch/mips64/lib/floppy-std.c +++ b/arch/mips64/lib/floppy-std.c @@ -1,4 +1,4 @@ -/* $Id: floppy-std.c,v 1.2 1999/12/04 03:59:00 ralf Exp $ +/* $Id: floppy-std.c,v 1.1 1999/08/21 21:43:00 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/ide-no.c b/arch/mips64/lib/ide-no.c index 97bb48260aa0..7a7833db7389 100644 --- a/arch/mips64/lib/ide-no.c +++ b/arch/mips64/lib/ide-no.c @@ -1,4 +1,4 @@ -/* $Id: ide-no.c,v 1.2 1999/12/04 03:59:00 ralf Exp $ +/* $Id: ide-no.c,v 1.1 1999/08/21 21:43:00 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/ide-std.c b/arch/mips64/lib/ide-std.c index 2a4fa1bb12fb..f80f7d5ead48 100644 --- a/arch/mips64/lib/ide-std.c +++ b/arch/mips64/lib/ide-std.c @@ -1,4 +1,4 @@ -/* $Id: ide-std.c,v 1.2 1999/12/04 03:59:00 ralf Exp $ +/* $Id: ide-std.c,v 1.1 1999/08/21 21:43:00 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/kbd-no.c b/arch/mips64/lib/kbd-no.c index f0692772568f..0120e9ba4b82 100644 --- a/arch/mips64/lib/kbd-no.c +++ b/arch/mips64/lib/kbd-no.c @@ -1,4 +1,4 @@ -/* $Id: kbd-no.c,v 1.2 1999/12/04 03:59:00 ralf Exp $ +/* $Id: kbd-no.c,v 1.1 1999/08/21 21:43:00 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/kbd-std.c b/arch/mips64/lib/kbd-std.c index 0edd0eef2ec6..a35a0c5c848c 100644 --- a/arch/mips64/lib/kbd-std.c +++ b/arch/mips64/lib/kbd-std.c @@ -1,4 +1,4 @@ -/* $Id: kbd-std.c,v 1.2 1999/12/04 03:59:00 ralf Exp $ +/* $Id: kbd-std.c,v 1.1 1999/08/21 21:43:01 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/memcpy.S b/arch/mips64/lib/memcpy.S index 0a316f9d45ed..d62c300821ed 100644 --- a/arch/mips64/lib/memcpy.S +++ b/arch/mips64/lib/memcpy.S @@ -1,4 +1,4 @@ -/* $Id: memcpy.S,v 1.4 2000/01/27 01:05:24 ralf Exp $ +/* $Id: memcpy.S,v 1.2 1999/10/19 20:51:51 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/memset.S b/arch/mips64/lib/memset.S index 0e8986f1f239..4a051cebff43 100644 --- a/arch/mips64/lib/memset.S +++ b/arch/mips64/lib/memset.S @@ -1,4 +1,4 @@ -/* $Id: memset.S,v 1.3 2000/01/16 01:37:19 ralf Exp $ +/* $Id: memset.S,v 1.3 2000/01/15 23:48:55 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/rtc-no.c b/arch/mips64/lib/rtc-no.c index d0945417a50b..808033648f27 100644 --- a/arch/mips64/lib/rtc-no.c +++ b/arch/mips64/lib/rtc-no.c @@ -1,4 +1,4 @@ -/* $Id: rtc-no.c,v 1.2 1999/12/04 03:59:00 ralf Exp $ +/* $Id: rtc-no.c,v 1.1 1999/08/21 21:43:01 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/rtc-std.c b/arch/mips64/lib/rtc-std.c index 8224a567b2f5..a4a6ead814f8 100644 --- a/arch/mips64/lib/rtc-std.c +++ b/arch/mips64/lib/rtc-std.c @@ -1,4 +1,4 @@ -/* $Id: rtc-std.c,v 1.2 1999/12/04 03:59:00 ralf Exp $ +/* $Id: rtc-std.c,v 1.1 1999/08/21 21:43:01 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/strlen_user.S b/arch/mips64/lib/strlen_user.S index b9f97a86c8ce..38b7082d93a2 100644 --- a/arch/mips64/lib/strlen_user.S +++ b/arch/mips64/lib/strlen_user.S @@ -1,4 +1,4 @@ -/* $Id: strlen_user.S,v 1.3 2000/01/17 23:32:46 ralf Exp $ +/* $Id: strlen_user.S,v 1.2 1999/11/19 20:35:22 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/strncpy_user.S b/arch/mips64/lib/strncpy_user.S index 61f6ebf518cb..49ba07b0560d 100644 --- a/arch/mips64/lib/strncpy_user.S +++ b/arch/mips64/lib/strncpy_user.S @@ -1,4 +1,4 @@ -/* $Id: strncpy_user.S,v 1.3 2000/01/17 23:32:46 ralf Exp $ +/* $Id: strncpy_user.S,v 1.2 1999/11/19 20:35:23 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/strnlen_user.S b/arch/mips64/lib/strnlen_user.S index 1137b3bf16b5..9df7e5e87c15 100644 --- a/arch/mips64/lib/strnlen_user.S +++ b/arch/mips64/lib/strnlen_user.S @@ -1,4 +1,4 @@ -/* $Id: strnlen_user.S,v 1.1 1999/12/04 03:59:00 ralf Exp $ +/* $Id: strnlen_user.S,v 1.1 1999/11/19 20:35:23 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/lib/watch.S b/arch/mips64/lib/watch.S index 7e0d9f7582a8..3f3d18c6e129 100644 --- a/arch/mips64/lib/watch.S +++ b/arch/mips64/lib/watch.S @@ -1,4 +1,4 @@ -/* $Id: watch.S,v 1.2 1999/12/04 03:59:00 ralf Exp $ +/* $Id: watch.S,v 1.1 1999/08/21 21:43:01 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/mm/Makefile b/arch/mips64/mm/Makefile index 9a8acde88efb..fe95aff18456 100644 --- a/arch/mips64/mm/Makefile +++ b/arch/mips64/mm/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.5 2000/02/24 00:12:41 ralf Exp $ +# $Id: Makefile,v 1.4 2000/01/17 23:32:46 ralf Exp $ # # Makefile for the Linux/MIPS-specific parts of the memory manager. # diff --git a/arch/mips64/mm/andes.c b/arch/mips64/mm/andes.c index bf47923cb864..7e4d4122f359 100644 --- a/arch/mips64/mm/andes.c +++ b/arch/mips64/mm/andes.c @@ -1,4 +1,4 @@ -/* $Id: andes.c,v 1.6 2000/02/24 00:12:41 ralf Exp $ +/* $Id: andes.c,v 1.7 2000/03/13 22:43:25 kanoj Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -91,7 +91,7 @@ andes_flush_cache_all(void) static void andes_flush_cache_mm(struct mm_struct *mm) { - if (mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { #ifdef DEBUG_CACHE printk("cmm[%d]", (int)mm->context); #endif @@ -103,7 +103,7 @@ static void andes_flush_cache_range(struct mm_struct *mm, unsigned long start, unsigned long end) { - if (mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { unsigned long flags; #ifdef DEBUG_CACHE @@ -129,7 +129,7 @@ andes_flush_cache_page(struct vm_area_struct *vma, unsigned long page) * If ownes no valid ASID yet, cannot possibly have gotten * this page into the cache. */ - if (mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; #ifdef DEBUG_CACHE @@ -244,17 +244,17 @@ andes_flush_tlb_all(void) static void andes_flush_tlb_mm(struct mm_struct *mm) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { unsigned long flags; #ifdef DEBUG_TLB printk("[tlbmm<%d>]", mm->context); #endif - save_and_cli(flags); - get_new_mmu_context(mm, asid_cache); + __save_and_cli(flags); + get_new_cpu_mmu_context(mm, smp_processor_id()); if(mm == current->mm) - set_entryhi(mm->context & 0xff); - restore_flags(flags); + set_entryhi(CPU_CONTEXT(smp_processor_id(), mm) & 0xff); + __restore_flags(flags); } } @@ -262,7 +262,7 @@ static void andes_flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { unsigned long flags; int size; @@ -270,12 +270,12 @@ andes_flush_tlb_range(struct mm_struct *mm, unsigned long start, printk("[tlbrange<%02x,%08lx,%08lx>]", (mm->context & 0xff), start, end); #endif - save_and_cli(flags); + __save_and_cli(flags); size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT; size = (size + 1) >> 1; if(size <= NTLB_ENTRIES_HALF) { int oldpid = (get_entryhi() & 0xff); - int newpid = (mm->context & 0xff); + int newpid = (CPU_CONTEXT(smp_processor_id(), mm) & 0xff); start &= (PAGE_MASK << 1); end += ((PAGE_SIZE << 1) - 1); @@ -300,9 +300,10 @@ andes_flush_tlb_range(struct mm_struct *mm, unsigned long start, } set_entryhi(oldpid); } else { - get_new_mmu_context(mm, asid_cache); + get_new_cpu_mmu_context(mm, smp_processor_id()); if(mm == current->mm) - set_entryhi(mm->context & 0xff); + set_entryhi(CPU_CONTEXT(smp_processor_id(), mm) & + 0xff); } __restore_flags(flags); } @@ -311,16 +312,16 @@ andes_flush_tlb_range(struct mm_struct *mm, unsigned long start, static void andes_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) { - if(vma->vm_mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) != 0) { unsigned long flags; int oldpid, newpid, idx; #ifdef DEBUG_TLB printk("[tlbpage<%d,%08lx>]", vma->vm_mm->context, page); #endif - newpid = (vma->vm_mm->context & 0xff); + newpid = (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) & 0xff); page &= (PAGE_MASK << 1); - save_and_cli(flags); + __save_and_cli(flags); oldpid = (get_entryhi() & 0xff); set_entryhi(page | newpid); BARRIER; @@ -338,7 +339,7 @@ andes_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) finish: BARRIER; set_entryhi(oldpid); - restore_flags(flags); + __restore_flags(flags); } } @@ -354,17 +355,16 @@ static void andes_update_mmu_cache(struct vm_area_struct * vma, pte_t *ptep; int idx, pid; + __save_and_cli(flags); pid = get_entryhi() & 0xff; -#ifdef DEBUG_TLB - if((pid != (vma->vm_mm->context & 0xff)) || - (vma->vm_mm->context == 0)) { - printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d tlbpid=%d\n", - (int) (vma->vm_mm->context & 0xff), pid); + if((pid != (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) & 0xff)) || + (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) == 0)) { + printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d + tlbpid=%d\n", (int) (CPU_CONTEXT(smp_processor_id(), + vma->vm_mm) & 0xff), pid); } -#endif - __save_and_cli(flags); address &= (PAGE_MASK << 1); set_entryhi(address | (pid)); pgdp = pgd_offset(vma->vm_mm, address); @@ -398,6 +398,7 @@ andes_user_mode(struct pt_regs *regs) static void andes_show_regs(struct pt_regs *regs) { + printk("Cpu %d\n", smp_processor_id()); /* Saved main processor registers. */ printk("$0 : %016lx %016lx %016lx %016lx\n", 0UL, regs->regs[1], regs->regs[2], regs->regs[3]); @@ -469,7 +470,7 @@ void __init ld_mmu_andes(void) write_32bit_cp0_register(CP0_PAGEMASK, PM_4K); /* From this point on the ARC firmware is dead. */ - flush_tlb_all(); + _flush_tlb_all(); /* Did I tell you that ARC SUCKS? */ } diff --git a/arch/mips64/mm/extable.c b/arch/mips64/mm/extable.c index 8a1bbe06f987..f9ae91ae057e 100644 --- a/arch/mips64/mm/extable.c +++ b/arch/mips64/mm/extable.c @@ -1,4 +1,4 @@ -/* $Id: extable.c,v 1.2 1999/12/04 03:59:00 ralf Exp $ +/* $Id: extable.c,v 1.2 1999/11/23 17:12:50 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/mm/fault.c b/arch/mips64/mm/fault.c index a6468e800196..e31c82568075 100644 --- a/arch/mips64/mm/fault.c +++ b/arch/mips64/mm/fault.c @@ -1,4 +1,4 @@ -/* $Id: fault.c,v 1.6 2000/02/18 00:24:31 ralf Exp $ +/* $Id: fault.c,v 1.7 2000/03/13 22:43:25 kanoj Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -27,18 +27,36 @@ #include #include #include +#include #define development_version (LINUX_VERSION_CODE & 0x100) extern void die(char *, struct pt_regs *, unsigned long write); -unsigned long asid_cache; - /* * Macro for exception fixup code to access integer registers. */ #define dpf_reg(r) (regs->regs[r]) +asmlinkage void +dodebug(abi64_no_regargs, struct pt_regs regs) +{ + printk("Got syscall %d, cpu %d proc %s:%d epc 0x%lx\n", regs.regs[2], smp_processor_id(), current->comm, current->pid, regs.cp0_epc); +} + +asmlinkage void +dodebug2(abi64_no_regargs, struct pt_regs regs) +{ + unsigned long retaddr; + + __asm__ __volatile__( + ".set noreorder\n\t" + "add %0,$0,$31\n\t" + ".set reorder" + : "=r" (retaddr)); + printk("Got exception 0x%lx at 0x%lx\n", retaddr, regs.cp0_epc); +} + /* * This routine handles page faults. It determines the address, * and the problem, and then passes it off to one of the appropriate @@ -59,9 +77,9 @@ do_page_fault(struct pt_regs *regs, unsigned long write, unsigned long address) */ if (in_interrupt() || mm == &init_mm) goto no_context; -#if 0 - printk("[%s:%d:%08lx:%ld:%08lx]\n", current->comm, current->pid, - address, write, regs->cp0_epc); +#if DEBUG_MIPS64 + printk("Cpu%d[%s:%d:%08lx:%ld:%08lx]\n", smp_processor_id(), current->comm, + current->pid, address, write, regs->cp0_epc); #endif down(&mm->mmap_sem); vma = find_vma(mm, address); @@ -93,12 +111,17 @@ good_area: * make sure we exit gracefully rather than endlessly redo * the fault. */ - { - int fault = handle_mm_fault(mm, vma, address, write); - if (fault < 0) - goto out_of_memory; - if (!fault) - goto do_sigbus; + switch (handle_mm_fault(mm, vma, address, write)) { + case 1: + tsk->min_flt++; + break; + case 2: + tsk->maj_flt++; + break; + case 0: + goto do_sigbus; + default: + goto out_of_memory; } up(&mm->mmap_sem); @@ -150,10 +173,9 @@ no_context: * Oops. The kernel tried to access some bad page. We'll have to * terminate things with extreme prejudice. */ - printk(KERN_ALERT "Unable to handle kernel paging request at virtual " + printk(KERN_ALERT "Cpu %d Unable to handle kernel paging request at " "address %08lx, epc == %08lx, ra == %08lx\n", - address, regs->cp0_epc, regs->regs[31]); -while(1); + smp_processor_id(), address, regs->cp0_epc, regs->regs[31]); die("Oops", regs, write); do_exit(SIGKILL); diff --git a/arch/mips64/mm/init.c b/arch/mips64/mm/init.c index 285be08bfd23..42dece549342 100644 --- a/arch/mips64/mm/init.c +++ b/arch/mips64/mm/init.c @@ -87,6 +87,8 @@ pgd_t *get_pgd_slow(void) if (ret) { init = pgd_offset(&init_mm, 0); pgd_init((unsigned long)ret); + memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, + (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); } return ret; } @@ -250,7 +252,7 @@ extern inline void pte_init(unsigned long page) bp = pte_val(BAD_PAGE); p = (unsigned long *) page; - end = p + PTRS_PER_PTE; + end = p + (2 * PTRS_PER_PTE); while (p < end) { p[0] = p[1] = p[2] = p[3] = @@ -278,7 +280,7 @@ pmd_t * __bad_pmd_table(void) unsigned long page; page = (unsigned long) invalid_pmd_table; - pte_init(page); + pmd_init(page); return (pmd_t *) page; } @@ -345,8 +347,8 @@ void __init paging_init(void) /* Initialize the entire pgd. */ pgd_init((unsigned long)swapper_pg_dir); - pgd_init((unsigned long)swapper_pg_dir + PAGE_SIZE / 2); pmd_init((unsigned long)invalid_pmd_table); + memset((void *)invalid_pte_table, 0, sizeof(pte_t) * 2 * PTRS_PER_PTE); max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; low = max_low_pfn; diff --git a/arch/mips64/mm/loadmmu.c b/arch/mips64/mm/loadmmu.c index 7aecbe2f1201..69f661c0baed 100644 --- a/arch/mips64/mm/loadmmu.c +++ b/arch/mips64/mm/loadmmu.c @@ -1,4 +1,4 @@ -/* $Id: loadmmu.c,v 1.6 2000/02/24 00:12:41 ralf Exp $ +/* $Id: loadmmu.c,v 1.5 2000/01/27 01:05:24 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/mm/r4xx0.c b/arch/mips64/mm/r4xx0.c index cf176a92521e..c2b9c406634b 100644 --- a/arch/mips64/mm/r4xx0.c +++ b/arch/mips64/mm/r4xx0.c @@ -784,7 +784,7 @@ r4k_flush_cache_range_s16d16i16(struct mm_struct *mm, unsigned long start, struct vm_area_struct *vma; unsigned long flags; - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; start &= PAGE_MASK; @@ -793,7 +793,8 @@ r4k_flush_cache_range_s16d16i16(struct mm_struct *mm, unsigned long start, #endif vma = find_vma(mm, start); if(vma) { - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { r4k_flush_cache_all_s16d16i16(); } else { pgd_t *pgd; @@ -822,7 +823,7 @@ r4k_flush_cache_range_s32d16i16(struct mm_struct *mm, unsigned long start, struct vm_area_struct *vma; unsigned long flags; - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; start &= PAGE_MASK; @@ -831,7 +832,8 @@ r4k_flush_cache_range_s32d16i16(struct mm_struct *mm, unsigned long start, #endif vma = find_vma(mm, start); if(vma) { - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { r4k_flush_cache_all_s32d16i16(); } else { pgd_t *pgd; @@ -860,7 +862,7 @@ r4k_flush_cache_range_s64d16i16(struct mm_struct *mm, unsigned long start, struct vm_area_struct *vma; unsigned long flags; - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; start &= PAGE_MASK; @@ -869,7 +871,8 @@ r4k_flush_cache_range_s64d16i16(struct mm_struct *mm, unsigned long start, #endif vma = find_vma(mm, start); if(vma) { - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { r4k_flush_cache_all_s64d16i16(); } else { pgd_t *pgd; @@ -898,7 +901,7 @@ r4k_flush_cache_range_s128d16i16(struct mm_struct *mm, unsigned long start, struct vm_area_struct *vma; unsigned long flags; - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; start &= PAGE_MASK; @@ -907,7 +910,8 @@ r4k_flush_cache_range_s128d16i16(struct mm_struct *mm, unsigned long start, #endif vma = find_vma(mm, start); if(vma) { - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { r4k_flush_cache_all_s128d16i16(); } else { pgd_t *pgd; @@ -936,7 +940,7 @@ r4k_flush_cache_range_s32d32i32(struct mm_struct *mm, unsigned long start, struct vm_area_struct *vma; unsigned long flags; - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; start &= PAGE_MASK; @@ -945,7 +949,8 @@ r4k_flush_cache_range_s32d32i32(struct mm_struct *mm, unsigned long start, #endif vma = find_vma(mm, start); if(vma) { - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { r4k_flush_cache_all_s32d32i32(); } else { pgd_t *pgd; @@ -974,7 +979,7 @@ r4k_flush_cache_range_s64d32i32(struct mm_struct *mm, unsigned long start, struct vm_area_struct *vma; unsigned long flags; - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; start &= PAGE_MASK; @@ -983,7 +988,8 @@ r4k_flush_cache_range_s64d32i32(struct mm_struct *mm, unsigned long start, #endif vma = find_vma(mm, start); if(vma) { - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { r4k_flush_cache_all_s64d32i32(); } else { pgd_t *pgd; @@ -1012,7 +1018,7 @@ r4k_flush_cache_range_s128d32i32(struct mm_struct *mm, unsigned long start, struct vm_area_struct *vma; unsigned long flags; - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { return; start &= PAGE_MASK; @@ -1021,7 +1027,8 @@ r4k_flush_cache_range_s128d32i32(struct mm_struct *mm, unsigned long start, #endif vma = find_vma(mm, start); if(vma) { - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { r4k_flush_cache_all_s128d32i32(); } else { pgd_t *pgd; @@ -1047,7 +1054,7 @@ static void r4k_flush_cache_range_d16i16(struct mm_struct *mm, unsigned long start, unsigned long end) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { unsigned long flags; #ifdef DEBUG_CACHE @@ -1063,7 +1070,7 @@ static void r4k_flush_cache_range_d32i32(struct mm_struct *mm, unsigned long start, unsigned long end) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { unsigned long flags; #ifdef DEBUG_CACHE @@ -1082,7 +1089,7 @@ r4k_flush_cache_range_d32i32(struct mm_struct *mm, unsigned long start, */ static void r4k_flush_cache_mm_s16d16i16(struct mm_struct *mm) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { #ifdef DEBUG_CACHE printk("cmm[%d]", (int)mm->context); #endif @@ -1092,7 +1099,7 @@ static void r4k_flush_cache_mm_s16d16i16(struct mm_struct *mm) static void r4k_flush_cache_mm_s32d16i16(struct mm_struct *mm) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { #ifdef DEBUG_CACHE printk("cmm[%d]", (int)mm->context); #endif @@ -1102,7 +1109,7 @@ static void r4k_flush_cache_mm_s32d16i16(struct mm_struct *mm) static void r4k_flush_cache_mm_s64d16i16(struct mm_struct *mm) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { #ifdef DEBUG_CACHE printk("cmm[%d]", (int)mm->context); #endif @@ -1112,7 +1119,7 @@ static void r4k_flush_cache_mm_s64d16i16(struct mm_struct *mm) static void r4k_flush_cache_mm_s128d16i16(struct mm_struct *mm) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { #ifdef DEBUG_CACHE printk("cmm[%d]", (int)mm->context); #endif @@ -1122,7 +1129,7 @@ static void r4k_flush_cache_mm_s128d16i16(struct mm_struct *mm) static void r4k_flush_cache_mm_s32d32i32(struct mm_struct *mm) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { #ifdef DEBUG_CACHE printk("cmm[%d]", (int)mm->context); #endif @@ -1132,7 +1139,7 @@ static void r4k_flush_cache_mm_s32d32i32(struct mm_struct *mm) static void r4k_flush_cache_mm_s64d32i32(struct mm_struct *mm) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { #ifdef DEBUG_CACHE printk("cmm[%d]", (int)mm->context); #endif @@ -1142,7 +1149,7 @@ static void r4k_flush_cache_mm_s64d32i32(struct mm_struct *mm) static void r4k_flush_cache_mm_s128d32i32(struct mm_struct *mm) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { #ifdef DEBUG_CACHE printk("cmm[%d]", (int)mm->context); #endif @@ -1152,7 +1159,7 @@ static void r4k_flush_cache_mm_s128d32i32(struct mm_struct *mm) static void r4k_flush_cache_mm_d16i16(struct mm_struct *mm) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { #ifdef DEBUG_CACHE printk("cmm[%d]", (int)mm->context); #endif @@ -1162,7 +1169,7 @@ static void r4k_flush_cache_mm_d16i16(struct mm_struct *mm) static void r4k_flush_cache_mm_d32i32(struct mm_struct *mm) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { #ifdef DEBUG_CACHE printk("cmm[%d]", (int)mm->context); #endif @@ -1184,7 +1191,7 @@ r4k_flush_cache_page_s16d16i16(struct vm_area_struct *vma, unsigned long page) * If ownes no valid ASID yet, cannot possibly have gotten * this page into the cache. */ - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; #ifdef DEBUG_CACHE @@ -1209,7 +1216,8 @@ r4k_flush_cache_page_s16d16i16(struct vm_area_struct *vma, unsigned long page) * for every cache flush operation. So we do indexed flushes * in that case, which doesn't overly flush the cache too much. */ - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { /* Do indexed flush, too much work to get the (possible) * tlb refills to work correctly. */ @@ -1238,7 +1246,7 @@ r4k_flush_cache_page_s32d16i16(struct vm_area_struct *vma, unsigned long page) * If ownes no valid ASID yet, cannot possibly have gotten * this page into the cache. */ - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; #ifdef DEBUG_CACHE @@ -1262,7 +1270,8 @@ r4k_flush_cache_page_s32d16i16(struct vm_area_struct *vma, unsigned long page) * for every cache flush operation. So we do indexed flushes * in that case, which doesn't overly flush the cache too much. */ - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { /* Do indexed flush, too much work to get the (possible) * tlb refills to work correctly. */ @@ -1291,7 +1300,7 @@ r4k_flush_cache_page_s64d16i16(struct vm_area_struct *vma, unsigned long page) * If ownes no valid ASID yet, cannot possibly have gotten * this page into the cache. */ - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; #ifdef DEBUG_CACHE @@ -1316,7 +1325,8 @@ r4k_flush_cache_page_s64d16i16(struct vm_area_struct *vma, unsigned long page) * for every cache flush operation. So we do indexed flushes * in that case, which doesn't overly flush the cache too much. */ - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { /* Do indexed flush, too much work to get the (possible) * tlb refills to work correctly. */ @@ -1345,7 +1355,7 @@ r4k_flush_cache_page_s128d16i16(struct vm_area_struct *vma, unsigned long page) * If ownes no valid ASID yet, cannot possibly have gotten * this page into the cache. */ - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; #ifdef DEBUG_CACHE @@ -1370,7 +1380,8 @@ r4k_flush_cache_page_s128d16i16(struct vm_area_struct *vma, unsigned long page) * for every cache flush operation. So we do indexed flushes * in that case, which doesn't overly flush the cache too much. */ - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { /* * Do indexed flush, too much work to get the (possible) * tlb refills to work correctly. @@ -1400,7 +1411,7 @@ r4k_flush_cache_page_s32d32i32(struct vm_area_struct *vma, unsigned long page) * If ownes no valid ASID yet, cannot possibly have gotten * this page into the cache. */ - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; #ifdef DEBUG_CACHE @@ -1426,7 +1437,8 @@ r4k_flush_cache_page_s32d32i32(struct vm_area_struct *vma, unsigned long page) * for every cache flush operation. So we do indexed flushes * in that case, which doesn't overly flush the cache too much. */ - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { /* * Do indexed flush, too much work to get the (possible) * tlb refills to work correctly. @@ -1456,7 +1468,7 @@ r4k_flush_cache_page_s64d32i32(struct vm_area_struct *vma, unsigned long page) * If ownes no valid ASID yet, cannot possibly have gotten * this page into the cache. */ - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; #ifdef DEBUG_CACHE @@ -1482,7 +1494,8 @@ r4k_flush_cache_page_s64d32i32(struct vm_area_struct *vma, unsigned long page) * for every cache flush operation. So we do indexed flushes * in that case, which doesn't overly flush the cache too much. */ - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { /* * Do indexed flush, too much work to get the (possible) * tlb refills to work correctly. @@ -1512,7 +1525,7 @@ r4k_flush_cache_page_s128d32i32(struct vm_area_struct *vma, unsigned long page) * If ownes no valid ASID yet, cannot possibly have gotten * this page into the cache. */ - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; #ifdef DEBUG_CACHE @@ -1537,7 +1550,8 @@ r4k_flush_cache_page_s128d32i32(struct vm_area_struct *vma, unsigned long page) * for every cache flush operation. So we do indexed flushes * in that case, which doesn't overly flush the cache too much. */ - if(mm->context != current->mm->context) { + if (CPU_CONTEXT(smp_processor_id(), mm) != + CPU_CONTEXT(smp_processor_id(), current->mm)) { /* Do indexed flush, too much work to get the (possible) * tlb refills to work correctly. */ @@ -1566,7 +1580,7 @@ r4k_flush_cache_page_d16i16(struct vm_area_struct *vma, unsigned long page) * If ownes no valid ASID yet, cannot possibly have gotten * this page into the cache. */ - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; #ifdef DEBUG_CACHE @@ -1622,7 +1636,7 @@ r4k_flush_cache_page_d32i32(struct vm_area_struct *vma, unsigned long page) * If ownes no valid ASID yet, cannot possibly have gotten * this page into the cache. */ - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; #ifdef DEBUG_CACHE @@ -1681,7 +1695,7 @@ r4k_flush_cache_page_d32i32_r4600(struct vm_area_struct *vma, * If ownes no valid ASID yet, cannot possibly have gotten * this page into the cache. */ - if(mm->context == 0) + if (CPU_CONTEXT(smp_processor_id(), mm) == 0) return; #ifdef DEBUG_CACHE @@ -2010,7 +2024,7 @@ static inline void r4k_flush_tlb_all(void) printk("[tlball]"); #endif - save_and_cli(flags); + __save_and_cli(flags); /* Save old context and create impossible VPN2 value */ old_ctx = (get_entryhi() & 0xff); set_entryhi(KSEG0); @@ -2030,29 +2044,29 @@ static inline void r4k_flush_tlb_all(void) } BARRIER; set_entryhi(old_ctx); - restore_flags(flags); + __restore_flags(flags); } static void r4k_flush_tlb_mm(struct mm_struct *mm) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { unsigned long flags; #ifdef DEBUG_TLB printk("[tlbmm<%d>]", mm->context); #endif - save_and_cli(flags); - get_new_mmu_context(mm, asid_cache); + __save_and_cli(flags); + get_new_cpu_mmu_context(mm, smp_processor_id()); if(mm == current->mm) - set_entryhi(mm->context & 0xff); - restore_flags(flags); + set_entryhi(CPU_CONTEXT(smp_processor_id(), mm) & 0xff); + __restore_flags(flags); } } static void r4k_flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end) { - if(mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { unsigned long flags; int size; @@ -2060,12 +2074,12 @@ static void r4k_flush_tlb_range(struct mm_struct *mm, unsigned long start, printk("[tlbrange<%02x,%08lx,%08lx>]", (mm->context & 0xff), start, end); #endif - save_and_cli(flags); + __save_and_cli(flags); size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT; size = (size + 1) >> 1; if(size <= NTLB_ENTRIES_HALF) { int oldpid = (get_entryhi() & 0xff); - int newpid = (mm->context & 0xff); + int newpid = (CPU_CONTEXT(smp_processor_id(), mm) & 0xff); start &= (PAGE_MASK << 1); end += ((PAGE_SIZE << 1) - 1); @@ -2090,9 +2104,10 @@ static void r4k_flush_tlb_range(struct mm_struct *mm, unsigned long start, } set_entryhi(oldpid); } else { - get_new_mmu_context(mm, asid_cache); + get_new_cpu_mmu_context(mm, smp_processor_id()); if(mm == current->mm) - set_entryhi(mm->context & 0xff); + set_entryhi(CPU_CONTEXT(smp_processor_id(), + mm) & 0xff); } __restore_flags(flags); } @@ -2100,16 +2115,16 @@ static void r4k_flush_tlb_range(struct mm_struct *mm, unsigned long start, static void r4k_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) { - if(vma->vm_mm->context != 0) { + if (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) != 0) { unsigned long flags; int oldpid, newpid, idx; #ifdef DEBUG_TLB printk("[tlbpage<%d,%08lx>]", vma->vm_mm->context, page); #endif - newpid = (vma->vm_mm->context & 0xff); + newpid = (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) & 0xff); page &= (PAGE_MASK << 1); - save_and_cli(flags); + __save_and_cli(flags); oldpid = (get_entryhi() & 0xff); set_entryhi(page | newpid); BARRIER; @@ -2127,7 +2142,7 @@ static void r4k_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) finish: BARRIER; set_entryhi(oldpid); - restore_flags(flags); + __restore_flags(flags); } } @@ -2150,16 +2165,18 @@ static void r4k_update_mmu_cache(struct vm_area_struct * vma, pte_t *ptep; int idx, pid; + __save_and_cli(flags); pid = (get_entryhi() & 0xff); #ifdef DEBUG_TLB - if((pid != (vma->vm_mm->context & 0xff)) || (vma->vm_mm->context == 0)) { - printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d tlbpid=%d\n", - (int) (vma->vm_mm->context & 0xff), pid); + if((pid != (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) & 0xff)) || + (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) == 0)) { + printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d + tlbpid=%d\n", (int) (CPU_CONTEXT(smp_processor_id(), + vma->vm_mm) & 0xff), pid); } #endif - __save_and_cli(flags); address &= (PAGE_MASK << 1); set_entryhi(address | (pid)); pgdp = pgd_offset(vma->vm_mm, address); @@ -2538,5 +2555,5 @@ void __init ld_mmu_r4xx0(void) * be set for 4kb pages. */ write_32bit_cp0_register(CP0_PAGEMASK, PM_4K); - flush_tlb_all(); + _flush_tlb_all(); } diff --git a/arch/mips64/mm/umap.c b/arch/mips64/mm/umap.c index 7da20ad62a52..b8ae542ccad5 100644 --- a/arch/mips64/mm/umap.c +++ b/arch/mips64/mm/umap.c @@ -1,4 +1,4 @@ -/* $Id: umap.c,v 1.5 2000/02/04 07:40:24 ralf Exp $ +/* $Id: umap.c,v 1.4 2000/01/29 01:41:59 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/sgi-ip22/Makefile b/arch/mips64/sgi-ip22/Makefile index 3b9fbcf162c8..f303d90dacb4 100644 --- a/arch/mips64/sgi-ip22/Makefile +++ b/arch/mips64/sgi-ip22/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 2000/01/21 22:34:03 ralf Exp $ +# $Id: Makefile,v 1.1 1999/08/20 21:13:33 ralf Exp $ # # Makefile for the SGI specific kernel interface routines # under Linux. diff --git a/arch/mips64/sgi-ip22/ip22-berr.c b/arch/mips64/sgi-ip22/ip22-berr.c index 8142336202e6..ecc3af198456 100644 --- a/arch/mips64/sgi-ip22/ip22-berr.c +++ b/arch/mips64/sgi-ip22/ip22-berr.c @@ -1,4 +1,4 @@ -/* $Id: ip22-berr.c,v 1.2 2000/02/24 00:12:41 ralf Exp $ +/* $Id: ip22-berr.c,v 1.1 2000/01/21 22:34:03 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/sgi-ip22/ip22-hpc.c b/arch/mips64/sgi-ip22/ip22-hpc.c index 0f9ce72f122c..5e42803c1cd6 100644 --- a/arch/mips64/sgi-ip22/ip22-hpc.c +++ b/arch/mips64/sgi-ip22/ip22-hpc.c @@ -1,4 +1,4 @@ -/* $Id: ip22-hpc.c,v 1.2 1999/12/04 03:59:01 ralf Exp $ +/* $Id: ip22-hpc.c,v 1.2 1999/10/19 20:51:52 ralf Exp $ * * ip22-hpc.c: Routines for generic manipulation of the HPC controllers. * diff --git a/arch/mips64/sgi-ip22/ip22-int.c b/arch/mips64/sgi-ip22/ip22-int.c index b5ce61f3aced..891e121f637b 100644 --- a/arch/mips64/sgi-ip22/ip22-int.c +++ b/arch/mips64/sgi-ip22/ip22-int.c @@ -1,4 +1,4 @@ -/* $Id: ip22-int.c,v 1.4 2000/02/04 07:40:24 ralf Exp $ +/* $Id: ip22-int.c,v 1.5 2000/03/02 02:36:50 ralf Exp $ * * indy_int.c: Routines for generic manipulation of the INT[23] ASIC * found on INDY workstations.. @@ -37,6 +37,24 @@ #include #include +/* + * Linux has a controller-independent x86 interrupt architecture. + * every controller has a 'controller-template', that is used + * by the main code to do the right thing. Each driver-visible + * interrupt source is transparently wired to the apropriate + * controller. Thus drivers need not be aware of the + * interrupt-controller. + * + * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC, + * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC. + * (IO-APICs assumed to be messaging to Pentium local-APICs) + * + * the code is designed to be easily extended with new/different + * interrupt controllers, without having to do assembly magic. + */ + +irq_cpustat_t irq_stat [NR_CPUS]; + struct sgi_int2_regs *sgi_i2regs; struct sgi_int3_regs *sgi_i3regs; struct sgi_ioc_ints *ioc_icontrol; @@ -272,7 +290,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs) int do_random, cpu; cpu = smp_processor_id(); - irq_enter(cpu); + irq_enter(cpu, irq); kstat.irqs[0][irq]++; printk("Got irq %d, press a key.", irq); @@ -308,7 +326,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs) add_interrupt_randomness(irq); __cli(); } - irq_exit(cpu); + irq_exit(cpu, irq); /* unmasking and bottom half handling is done magically for us. */ } @@ -433,10 +451,10 @@ void indy_local0_irqdispatch(struct pt_regs *regs) action = local_irq_action[irq]; } - irq_enter(cpu); + irq_enter(cpu, irq); kstat.irqs[0][irq + 16]++; action->handler(irq, action->dev_id, regs); - irq_exit(cpu); + irq_exit(cpu, irq); } void indy_local1_irqdispatch(struct pt_regs *regs) @@ -457,10 +475,10 @@ void indy_local1_irqdispatch(struct pt_regs *regs) irq = lc1msk_to_irqnr[mask]; action = local_irq_action[irq]; } - irq_enter(cpu); + irq_enter(cpu, irq); kstat.irqs[0][irq + 24]++; action->handler(irq, action->dev_id, regs); - irq_exit(cpu); + irq_exit(cpu, irq); } void indy_buserror_irq(struct pt_regs *regs) @@ -468,13 +486,13 @@ void indy_buserror_irq(struct pt_regs *regs) int cpu = smp_processor_id(); int irq = 6; - irq_enter(cpu); + irq_enter(cpu, irq); kstat.irqs[0][irq]++; printk("Got a bus error IRQ, shouldn't happen yet\n"); show_regs(regs); printk("Spinning...\n"); while(1); - irq_exit(cpu); + irq_exit(cpu, irq); } /* Misc. crap just to keep the kernel linking... */ diff --git a/arch/mips64/sgi-ip22/ip22-irq.S b/arch/mips64/sgi-ip22/ip22-irq.S index a244c74dd796..e943d3e3034f 100644 --- a/arch/mips64/sgi-ip22/ip22-irq.S +++ b/arch/mips64/sgi-ip22/ip22-irq.S @@ -1,4 +1,4 @@ -/* $Id: ip22-irq.S,v 1.2 1999/12/04 03:59:01 ralf Exp $ +/* $Id: ip22-irq.S,v 1.1 1999/08/20 21:13:33 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/sgi-ip22/ip22-mc.c b/arch/mips64/sgi-ip22/ip22-mc.c index c51119db4f53..be8a91a0a06c 100644 --- a/arch/mips64/sgi-ip22/ip22-mc.c +++ b/arch/mips64/sgi-ip22/ip22-mc.c @@ -1,4 +1,4 @@ -/* $Id: ip22-mc.c,v 1.2 1999/12/04 03:59:01 ralf Exp $ +/* $Id: ip22-mc.c,v 1.2 1999/10/19 20:51:52 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/sgi-ip22/ip22-reset.c b/arch/mips64/sgi-ip22/ip22-reset.c index 281967f92ace..e8d4ff345c00 100644 --- a/arch/mips64/sgi-ip22/ip22-reset.c +++ b/arch/mips64/sgi-ip22/ip22-reset.c @@ -1,4 +1,4 @@ -/* $Id: ip22-reset.c,v 1.3 1999/12/04 03:59:01 ralf Exp $ +/* $Id: ip22-reset.c,v 1.3 1999/10/08 21:07:51 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/sgi-ip22/ip22-rtc.c b/arch/mips64/sgi-ip22/ip22-rtc.c index 55678acbb89a..eca3bcaabb07 100644 --- a/arch/mips64/sgi-ip22/ip22-rtc.c +++ b/arch/mips64/sgi-ip22/ip22-rtc.c @@ -1,4 +1,4 @@ -/* $Id: ip22-rtc.c,v 1.2 1999/12/04 03:59:01 ralf Exp $ +/* $Id: ip22-rtc.c,v 1.1 1999/08/20 21:13:34 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/sgi-ip22/ip22-sc.c b/arch/mips64/sgi-ip22/ip22-sc.c index cddc1b1955ae..21736bf0a4e6 100644 --- a/arch/mips64/sgi-ip22/ip22-sc.c +++ b/arch/mips64/sgi-ip22/ip22-sc.c @@ -27,7 +27,6 @@ static unsigned long scache_size; #define SC_SIZE 0x00080000 #define SC_LINE 32 #define CI_MASK (SC_SIZE - SC_LINE) -#define SC_ROUND(n) ((n) + SC_LINE - 1) #define SC_INDEX(n) ((n) & CI_MASK) static inline void indy_sc_wipe(unsigned long first, unsigned long last) @@ -53,9 +52,13 @@ static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size) #ifdef DEBUG_CACHE printk("indy_sc_wback_invalidate[%08lx,%08lx]", addr, size); #endif + + if (!size) + return; + /* Which lines to flush? */ first_line = SC_INDEX(addr); - last_line = SC_INDEX(SC_ROUND(addr + size)); + last_line = SC_INDEX(addr + size - 1); __save_and_cli(flags); if (first_line <= last_line) { @@ -63,11 +66,8 @@ static void indy_sc_wback_invalidate(unsigned long addr, unsigned long size) goto out; } - /* Cache index wrap around. Due to the way the buddy system works - this case should not happen. We're prepared to handle it, - though. */ - indy_sc_wipe(last_line, SC_SIZE); - indy_sc_wipe(0, first_line); + indy_sc_wipe(first_line, SC_SIZE - SC_LINE); + indy_sc_wipe(0, last_line); out: __restore_flags(flags); } @@ -159,7 +159,6 @@ static struct bcache_ops indy_sc_ops = { void __init indy_sc_init(void) { -return; /* Not for now, debugging ... */ if (indy_sc_probe()) { indy_sc_enable(); bcops = &indy_sc_ops; diff --git a/arch/mips64/sgi-ip22/ip22-setup.c b/arch/mips64/sgi-ip22/ip22-setup.c index 777743b0ace1..7505e0c03c41 100644 --- a/arch/mips64/sgi-ip22/ip22-setup.c +++ b/arch/mips64/sgi-ip22/ip22-setup.c @@ -1,4 +1,4 @@ -/* $Id: ip22-setup.c,v 1.5 2000/01/27 01:05:24 ralf Exp $ +/* $Id: ip22-setup.c,v 1.4 1999/10/08 21:07:51 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/sgi-ip22/ip22-timer.c b/arch/mips64/sgi-ip22/ip22-timer.c index d0f2aa75e37a..76b613e60cdd 100644 --- a/arch/mips64/sgi-ip22/ip22-timer.c +++ b/arch/mips64/sgi-ip22/ip22-timer.c @@ -267,12 +267,12 @@ void indy_8254timer_irq(void) int cpu = smp_processor_id(); int irq = 4; - irq_enter(cpu); + irq_enter(cpu, irq); kstat.irqs[0][irq]++; printk("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n"); prom_getchar(); ArcEnterInteractiveMode(); - irq_exit(cpu); + irq_exit(cpu, irq); } void do_gettimeofday(struct timeval *tv) diff --git a/arch/mips64/sgi-ip22/system.c b/arch/mips64/sgi-ip22/system.c index e31802680161..ce8b81085a04 100644 --- a/arch/mips64/sgi-ip22/system.c +++ b/arch/mips64/sgi-ip22/system.c @@ -1,4 +1,4 @@ -/* $Id: system.c,v 1.3 1999/12/04 03:59:01 ralf Exp $ +/* $Id: system.c,v 1.3 1999/10/19 20:51:52 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/sgi-ip22/time.c b/arch/mips64/sgi-ip22/time.c index 82012ce33ac7..27a104d00074 100644 --- a/arch/mips64/sgi-ip22/time.c +++ b/arch/mips64/sgi-ip22/time.c @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.2 1999/12/04 03:59:01 ralf Exp $ +/* $Id: time.c,v 1.1 1999/08/20 21:13:34 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/sgi-ip27/Makefile b/arch/mips64/sgi-ip27/Makefile index 857aef1d819b..c15231c93186 100644 --- a/arch/mips64/sgi-ip27/Makefile +++ b/arch/mips64/sgi-ip27/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 2000/02/18 00:24:31 ralf Exp $ +# $Id: Makefile,v 1.3 2000/02/04 08:41:40 kanoj Exp $ # # Makefile for the IP27 specific kernel interface routines under Linux. # @@ -11,6 +11,6 @@ L_TARGET = ip27.a L_OBJS = ip27-berr.o ip27-irq.o ip27-irq-glue.o ip27-klconfig.o \ ip27-memory.o ip27-pci.o ip27-pci-dma.o ip27-reset.o ip27-setup.o \ - ip27-timer.o ip27-init.o + ip27-timer.o ip27-init.o ip27-nmi.o include $(TOPDIR)/Rules.make diff --git a/arch/mips64/sgi-ip27/TODO b/arch/mips64/sgi-ip27/TODO index 5f2961f3a84a..78451283fe30 100644 --- a/arch/mips64/sgi-ip27/TODO +++ b/arch/mips64/sgi-ip27/TODO @@ -4,8 +4,20 @@ not to write to the IOC3 ever. 3. Need to figure out why address swaizzling is needed in inw/outw for Qlogic scsi controllers. 4. Need to integrate ip27-klconfig.c:find_lboard and -ip27-init.c:find_lbaord_real. +ip27-init.c:find_lbaord_real. DONE 5. Is it okay to set calias space on all nodes as 0, instead of 8k as in irix? 6. Investigate why things do not work without the setup_test() call being invoked on all nodes in ip27-memory.c. +7. Too many CLIs in the locore handlers : +For the low level handlers set up by set_except_vector(), +__tlb_refill_debug_tramp, __xtlb_refill_debug_tramp and cacheerror, +investigate whether the code should do CLI, STI or KMODE. +8. Too many do_page_faults invoked - investigate. +9. start_thread must turn off UX64 ... and define tlb_refill_debug. +10. Need a bad pmd table, bad pte table. __bad_pmd_table/__bad_pagetable +does not agree with pgd_bad/pmd_bad. +11. All intrs (ip27_do_irq handlers) are targetted at cpu A on the node. +This might need to change later. Only the timer intr is set up to be +received on both Cpu A and B. (ip27_do_irq()/bridge_startup()) +13. Cache flushing (specially the SMP version) has to be investigated. diff --git a/arch/mips64/sgi-ip27/ip27-berr.c b/arch/mips64/sgi-ip27/ip27-berr.c index 67ff8666125f..b4b594baa66b 100644 --- a/arch/mips64/sgi-ip27/ip27-berr.c +++ b/arch/mips64/sgi-ip27/ip27-berr.c @@ -1,4 +1,4 @@ -/* $Id: ip27-berr.c,v 1.1 2000/01/20 23:50:27 ralf Exp $ +/* $Id: ip27-berr.c,v 1.1 2000/01/20 22:50:29 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/arch/mips64/sgi-ip27/ip27-init.c b/arch/mips64/sgi-ip27/ip27-init.c index e09bc6036485..9e2df36625ce 100644 --- a/arch/mips64/sgi-ip27/ip27-init.c +++ b/arch/mips64/sgi-ip27/ip27-init.c @@ -1,5 +1,10 @@ #include +#include +#include #include /* for numnodes */ +#include +#include +#include #include #include #include @@ -8,16 +13,33 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include -typedef unsigned long cpumask_t; /* into asm/sn/types.h */ -typedef unsigned long cpuid_t; +#define CPU_NONE (cpuid_t)-1 #define CPUMASK_CLRALL(p) (p) = 0 #define CPUMASK_SETB(p, bit) (p) |= 1 << (bit) +#define CPUMASK_CLRB(p, bit) (p) &= ~(1ULL << (bit)) +#define CPUMASK_TSTB(p, bit) ((p) & (1ULL << (bit))) + +#define CNODEMASK_CLRALL(p) (p) = 0 +#define CNODEMASK_TSTB(p, bit) ((p) & (1ULL << (bit))) +#define CNODEMASK_SETB(p, bit) ((p) |= 1ULL << (bit)) cpumask_t boot_cpumask; +static volatile cpumask_t boot_barrier; hubreg_t region_mask = 0; static int fine_mode = 0; +int maxcpus; +static spinlock_t hub_mask_lock = SPIN_LOCK_UNLOCKED; +static cnodemask_t hub_init_mask; cnodeid_t nasid_to_compact_node[MAX_NASIDS]; nasid_t compact_to_nasid_node[MAX_COMPACT_NODES]; @@ -47,51 +69,6 @@ int is_fine_dirmode(void) >> NSRI_REGIONSIZE_SHFT) & REGIONSIZE_FINE); } -lboard_t * find_lboard_real(lboard_t *start, unsigned char brd_type) -{ - /* Search all boards stored on this node. */ - while (start) { - if (start->brd_type == brd_type) - return start; - start = KLCF_NEXT(start); - } - /* Didn't find it. */ - return (lboard_t *)NULL; -} - -klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char struct_type) -{ - int index, j; - - if (kli == (klinfo_t *)NULL) { - index = 0; - } else { - for (j = 0; j < KLCF_NUM_COMPS(brd); j++) - if (kli == KLCF_COMP(brd, j)) - break; - index = j; - if (index == KLCF_NUM_COMPS(brd)) { - printk("find_component: Bad pointer: 0x%p\n", kli); - return (klinfo_t *)NULL; - } - index++; /* next component */ - } - - for (; index < KLCF_NUM_COMPS(brd); index++) { - kli = KLCF_COMP(brd, index); - if (KLCF_COMP_TYPE(kli) == struct_type) - return kli; - } - - /* Didn't find it. */ - return (klinfo_t *)NULL; -} - -klinfo_t *find_first_component(lboard_t *brd, unsigned char struct_type) -{ - return find_component(brd, (klinfo_t *)NULL, struct_type); -} - nasid_t get_actual_nasid(lboard_t *brd) { klhub_t *hub; @@ -117,7 +94,7 @@ int do_cpumask(cnodeid_t cnode, nasid_t nasid, cpumask_t *boot_cpumask, int cpus_found = 0; cpuid_t cpuid; - brd = find_lboard_real((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IP27); + brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IP27); do { acpu = (klcpu_t *)find_first_component(brd, KLSTRUCT_CPU); @@ -138,7 +115,7 @@ int do_cpumask(cnodeid_t cnode, nasid_t nasid, cpumask_t *boot_cpumask, } brd = KLCF_NEXT(brd); if (brd) - brd = find_lboard_real(brd,KLTYPE_IP27); + brd = find_lboard(brd,KLTYPE_IP27); else break; } while (brd); @@ -182,9 +159,38 @@ cpuid_t cpu_node_probe(cpumask_t *boot_cpumask, int *numnodes) return(highest + 1); } +void alloc_cpupda(int i) +{ + cnodeid_t node; + nasid_t nasid; + + node = get_cpu_cnode(i); + nasid = COMPACT_TO_NASID_NODEID(node); + + cputonasid(i) = nasid; + cputocnode(i) = node; + cputoslice(i) = get_cpu_slice(i); +} + +int cpu_enabled(cpuid_t cpu) +{ + if (cpu == CPU_NONE) + return 0; + return (CPUMASK_TSTB(boot_cpumask, cpu) != 0); +} + +void initpdas(void) +{ + cpuid_t i; + + for (i = 0; i < maxcpus; i++) + if (cpu_enabled(i)) + alloc_cpupda(i); +} + void mlreset (void) { - int i, maxcpus; + int i; fine_mode = is_fine_dirmode(); @@ -194,8 +200,11 @@ void mlreset (void) */ CPUMASK_CLRALL(boot_cpumask); maxcpus = cpu_node_probe(&boot_cpumask, &numnodes); + printk("Discovered %d cpus on %d nodes\n", maxcpus, numnodes); + initpdas(); gen_region_mask(®ion_mask, numnodes); + CNODEMASK_CLRALL(hub_init_mask); /* * Set all nodes' calias sizes to 8k @@ -225,3 +234,257 @@ void mlreset (void) } } + +void intr_clear_bits(nasid_t nasid, volatile hubreg_t *pend, int base_level, + char *name) +{ + volatile hubreg_t bits; + int i; + + /* Check pending interrupts */ + if ((bits = HUB_L(pend)) != 0) + for (i = 0; i < N_INTPEND_BITS; i++) + if (bits & (1 << i)) + LOCAL_HUB_CLR_INTR(base_level + i); +} + +void intr_clear_all(nasid_t nasid) +{ + REMOTE_HUB_S(nasid, PI_INT_MASK0_A, 0); + REMOTE_HUB_S(nasid, PI_INT_MASK0_B, 0); + REMOTE_HUB_S(nasid, PI_INT_MASK1_A, 0); + REMOTE_HUB_S(nasid, PI_INT_MASK1_B, 0); + intr_clear_bits(nasid, REMOTE_HUB_ADDR(nasid, PI_INT_PEND0), + INT_PEND0_BASELVL, "INT_PEND0"); + intr_clear_bits(nasid, REMOTE_HUB_ADDR(nasid, PI_INT_PEND1), + INT_PEND1_BASELVL, "INT_PEND1"); +} + +void sn_mp_setup(void) +{ + cnodeid_t cnode; +#if 0 + cpuid_t cpu; +#endif + + for (cnode = 0; cnode < numnodes; cnode++) { +#if 0 + init_platform_nodepda(); +#endif + intr_clear_all(COMPACT_TO_NASID_NODEID(cnode)); + } +#if 0 + for (cpu = 0; cpu < maxcpus; cpu++) { + init_platform_pda(); + } +#endif +} + +void per_hub_init(cnodeid_t cnode) +{ + cnodemask_t done; + + spin_lock(&hub_mask_lock); + /* Test our bit. */ + if (!(done = CNODEMASK_TSTB(hub_init_mask, cnode))) { + /* Turn our bit on in the mask. */ + CNODEMASK_SETB(hub_init_mask, cnode); + } + spin_unlock(&hub_mask_lock); + + /* + * Do the actual initialization if it hasn't been done yet. + * We don't need to hold a lock for this work. + */ + if (!done) { + hub_rtc_init(cnode); + } +} + +/* + * This is similar to hard_smp_processor_id(). + */ +cpuid_t getcpuid(void) +{ + klcpu_t *klcpu; + + klcpu = nasid_slice_to_cpuinfo(get_nasid(),LOCAL_HUB_L(PI_CPU_NUM)); + return klcpu->cpu_info.virtid; +} + +void per_cpu_init(void) +{ + extern void install_cpu_nmi_handler(int slice); + extern void load_mmu(void); + static int is_slave = 0; + cpuid_t cpu = getcpuid(); + cnodeid_t cnode = get_compact_nodeid(); + + current_cpu_data.asid_cache = ASID_FIRST_VERSION; +#if 0 + intr_init(); +#endif + set_cp0_status(ST0_IM, 0); + per_hub_init(cnode); + cpu_time_init(); + if (smp_processor_id()) /* master can't do this early, no kmalloc */ + install_cpuintr(cpu); + /* Install our NMI handler if symmon hasn't installed one. */ + install_cpu_nmi_handler(cputoslice(smp_processor_id())); +#if 0 + install_tlbintr(cpu); +#endif + set_cp0_status(SRB_DEV0 | SRB_DEV1, SRB_DEV0 | SRB_DEV1); + if (is_slave) { + set_cp0_status(ST0_BEV, 0); + if (mips4_available) + set_cp0_status(ST0_XX, ST0_XX); + set_cp0_status(ST0_KX|ST0_SX|ST0_UX, ST0_KX|ST0_SX|ST0_UX); + sti(); + load_mmu(); + } + if (is_slave == 0) + is_slave = 1; +} + +cnodeid_t get_compact_nodeid(void) +{ + nasid_t nasid; + + nasid = get_nasid(); + /* + * Map the physical node id to a virtual node id (virtual node ids + * are contiguous). + */ + return NASID_TO_COMPACT_NODEID(nasid); +} + +#ifdef CONFIG_SMP + +void __init smp_callin(void) +{ +#if 0 + calibrate_delay(); + smp_store_cpu_info(cpuid); +#endif +} + +int __init start_secondary(void) +{ + extern int cpu_idle(void); + extern atomic_t smp_commenced; + + smp_callin(); + while (!atomic_read(&smp_commenced)); + return cpu_idle(); +} + +static atomic_t numstarted = ATOMIC_INIT(0); +void cboot(void) +{ + atomic_inc(&numstarted); + CPUMASK_CLRB(boot_barrier, getcpuid()); /* needs atomicity */ + per_cpu_init(); +#if 0 + ecc_init(); + bte_lateinit(); + init_mfhi_war(); +#endif + _flush_tlb_all(); + flush_cache_all(); + start_secondary(); +} + +void allowboot(void) +{ + int num_cpus = 0; + cpuid_t cpu; + cnodeid_t cnode; + extern void bootstrap(void); + + sn_mp_setup(); + /* Master has already done per_cpu_init() */ + install_cpuintr(getcpuid()); +#if 0 + bte_lateinit(); + ecc_init(); +#endif + + boot_barrier = boot_cpumask; + /* Launch slaves. */ + for (cpu = 0; cpu < maxcpus; cpu++) { + if (cpu == smp_processor_id()) { + num_cpus++; + /* We're already started, clear our bit */ + CPUMASK_CLRB(boot_barrier, cpu); + continue; + } + + /* Skip holes in CPU space */ + if (CPUMASK_TSTB(boot_cpumask, cpu)) { + struct task_struct *p; + + /* + * The following code is purely to make sure + * Linux can schedule processes on this slave. + */ + kernel_thread(0, NULL, CLONE_PID); + p = init_task.prev_task; + sprintf(p->comm, "%s%d", "Idle", num_cpus); + init_tasks[num_cpus] = p; + p->processor = num_cpus; + p->has_cpu = 1; /* we schedule the first task manually */ + del_from_runqueue(p); + unhash_process(p); + /* Attach to the address space of init_task. */ + atomic_inc(&init_mm.mm_count); + p->active_mm = &init_mm; + + /* + * Launch a slave into bootstrap(). + * It doesn't take an argument, and we + * set sp to the kernel stack of the newly + * created idle process, gp to the proc struct + * (so that current-> works). + */ + LAUNCH_SLAVE(cputonasid(cpu), cputoslice(cpu), + (launch_proc_t)bootstrap, 0, + (void *)((unsigned long)p+KERNEL_STACK_SIZE - 32), + (void *)p); + + /* + * Now optimistically set the mapping arrays. We + * need to wait here, verify the cpu booted up, then + * fire up the next cpu. + */ + __cpu_number_map[cpu] = num_cpus; + __cpu_logical_map[num_cpus] = cpu; + num_cpus++; + /* smp_num_cpus++; Do after smp_send_reschedule works */ + } + } + + /* while(atomic_read(&numstarted) != (maxcpus - num_cpus)) */ + if (maxcpus > 1) while(atomic_read(&numstarted) == 0); + printk("Holding %d cpus slave\n", atomic_read(&numstarted)); + +#ifdef LATER + Wait logic goes here. +#endif + for (cnode = 0; cnode < numnodes; cnode++) { +#if 0 + if (cnodetocpu(cnode) == -1) { + printk("Initializing headless hub,cnode %d", cnode); + per_hub_init(cnode); + } +#endif + } +#if 0 + cpu_io_setup(); + init_mfhi_war(); +#endif +} + +#else /* CONFIG_SMP */ +void cboot(void) {} +#endif /* CONFIG_SMP */ diff --git a/arch/mips64/sgi-ip27/ip27-irq-glue.S b/arch/mips64/sgi-ip27/ip27-irq-glue.S index 5912a8b433b8..40517c2d4dbd 100644 --- a/arch/mips64/sgi-ip27/ip27-irq-glue.S +++ b/arch/mips64/sgi-ip27/ip27-irq-glue.S @@ -1,4 +1,4 @@ -/* $Id: ip27-irq-glue.S,v 1.1 2000/01/17 23:32:47 ralf Exp $ +/* $Id$ * * 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 diff --git a/arch/mips64/sgi-ip27/ip27-irq.c b/arch/mips64/sgi-ip27/ip27-irq.c index 266a753e1953..2c0ddcc69924 100644 --- a/arch/mips64/sgi-ip27/ip27-irq.c +++ b/arch/mips64/sgi-ip27/ip27-irq.c @@ -1,4 +1,4 @@ -/* $Id: ip27-irq.c,v 1.6 2000/02/10 05:58:56 dagum Exp $ +/* $Id: ip27-irq.c,v 1.9 2000/03/14 01:39:27 ralf Exp $ * * ip27-irq.c: Highlevel interrupt handling for IP27 architecture. * @@ -8,7 +8,6 @@ #include #include -#include #include #include #include @@ -17,8 +16,9 @@ #include #include #include -#include #include +#include +#include #include #include @@ -33,14 +33,58 @@ #include #include #include +#include +#include + +#undef DEBUG_IRQ +#ifdef DEBUG_IRQ +#define DBG(x...) printk(x) +#else +#define DBG(x...) +#endif + + +/* + * Linux has a controller-independent x86 interrupt architecture. + * every controller has a 'controller-template', that is used + * by the main code to do the right thing. Each driver-visible + * interrupt source is transparently wired to the apropriate + * controller. Thus drivers need not be aware of the + * interrupt-controller. + * + * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC, + * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC. + * (IO-APICs assumed to be messaging to Pentium local-APICs) + * + * the code is designed to be easily extended with new/different + * interrupt controllers, without having to do assembly magic. + */ + +irq_cpustat_t irq_stat [NR_CPUS]; extern asmlinkage void ip27_irq(void); int (*irq_cannonicalize)(int irq); +int intr_connect_level(cpuid_t cpu, int bit); +int intr_disconnect_level(cpuid_t cpu, int bit); unsigned int local_bh_count[NR_CPUS]; unsigned int local_irq_count[NR_CPUS]; unsigned long spurious_count = 0; +/* + * we need to map irq's up to at least bit 7 of the INT_MASK0_A register + * since bits 0-6 are pre-allocated for other purposes. + */ +#define IRQ_TO_SWLEVEL(i) i + 7 +#define SWLEVEL_TO_IRQ(s) s - 7 +/* + * use these macros to get the encoded nasid, widget id, and real irq + * from the irq value + */ +#define NASID_FROM_IRQ(i) ((i >> 16)&(0xff)) +#define WID_FROM_IRQ(i) ((i >> 8)&(0xff)) +#define IRQ_FROM_IRQ(i) ((i)&(0xff)) + void disable_irq(unsigned int irq_nr) { panic("disable_irq() called ..."); @@ -87,7 +131,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs) int do_random, cpu; cpu = smp_processor_id(); - irq_enter(cpu); + irq_enter(cpu, irq); kstat.irqs[cpu][irq]++; action = *(irq + irq_action); @@ -105,7 +149,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs) add_interrupt_randomness(irq); __cli(); } - irq_exit(cpu); + irq_exit(cpu, irq); /* unmasking and bottom half handling is done magically for us. */ } @@ -130,20 +174,26 @@ static int ms1bit(unsigned long x) /* For now ... */ void ip27_do_irq(struct pt_regs *regs) { - int irq; + int irq, swlevel; hubreg_t pend0, mask0; + int pi_int_mask0 = ((cputoslice(smp_processor_id()) == 0) ? + PI_INT_MASK0_A : PI_INT_MASK0_B); /* copied from Irix intpend0() */ while (((pend0 = LOCAL_HUB_L(PI_INT_PEND0)) & - (mask0 = LOCAL_HUB_L(PI_INT_MASK0_A))) != 0) { + (mask0 = LOCAL_HUB_L(pi_int_mask0))) != 0) { + pend0 &= mask0; do { - irq = ms1bit(pend0); - LOCAL_HUB_S(PI_INT_MASK0_A, mask0 & ~(1 << irq)); - LOCAL_HUB_S(PI_INT_PEND_MOD, irq); - LOCAL_HUB_L(PI_INT_MASK0_A); /* Flush */ + swlevel = ms1bit(pend0); + LOCAL_HUB_S(pi_int_mask0, mask0 & ~(1 << swlevel)); + LOCAL_HUB_CLR_INTR(swlevel); + /* "map" swlevel to irq */ + irq = SWLEVEL_TO_IRQ(swlevel); do_IRQ(irq, regs); - LOCAL_HUB_S(PI_INT_MASK0_A, mask0); - pend0 ^= 1ULL << irq; + /* reset INT_MASK0 register */ + LOCAL_HUB_S(pi_int_mask0, mask0); + /* clear bit in pend0 */ + pend0 ^= 1ULL << swlevel; } while (pend0); } } @@ -152,96 +202,141 @@ void ip27_do_irq(struct pt_regs *regs) /* Startup one of the (PCI ...) IRQs routes over a bridge. */ static unsigned int bridge_startup(unsigned int irq) { - bridge_t *bridge = (bridge_t *) 0x9200000008000000; - bridgereg_t br; - int pin; - - /* FIIIIIXME ... Temporary kludge. This knows how interrupts are - setup in _my_ Origin. */ - switch (irq) { - case IOC3_SERIAL_INT: pin = 3; break; - case IOC3_ETH_INT: pin = 2; break; - case SCSI1_INT: pin = 1; break; - case SCSI0_INT: pin = 0; break; - default: panic("bridge_startup: whoops?"); - } - - br = LOCAL_HUB_L(PI_INT_MASK0_A); - LOCAL_HUB_S(PI_INT_MASK0_A, br | (1 << irq)); - LOCAL_HUB_L(PI_INT_MASK0_A); /* Flush */ - - bridge->b_int_addr[pin].addr = 0x20000 | irq; - bridge->b_int_enable |= (1 << pin); - if (irq < 2) { - bridgereg_t device; + bridge_t *bridge; + int pin, swlevel; + int real_irq = IRQ_FROM_IRQ(irq); + + DBG("bridge_startup(): irq= 0x%x real_irq= %d\n", irq, real_irq); + bridge = (bridge_t *) NODE_SWIN_BASE(NASID_FROM_IRQ(irq), WID_FROM_IRQ(irq)); + + /* FIIIIIXME ... Temporary kludge. This knows how interrupts are + setup in _my_ Origin. */ + + if (irq != real_irq) /* pci device interrupt */ + switch (real_irq) { + case IRQ_FROM_IRQ(IOC3_ETH_INT): pin = 2; break; + default: pin = real_irq; break; + } + else + switch (real_irq) { + case CPU_RESCHED_A_IRQ: + case CPU_RESCHED_B_IRQ: + case CPU_CALL_A_IRQ: + case CPU_CALL_B_IRQ: + return 0; + default: panic("bridge_startup: whoops? %d\n", irq); + } + + /* + * "map" irq to a swlevel greater than 6 since the first 6 bits + * of INT_PEND0 are taken + */ + swlevel = IRQ_TO_SWLEVEL(real_irq); + intr_connect_level(smp_processor_id(), swlevel); + + bridge->b_int_addr[pin].addr = 0x20000 | swlevel; + bridge->b_int_enable |= (1 << pin); + /* set more stuff in int_enable reg */ + bridge->b_int_enable |= 0x7ffffe00; + + if (real_irq < 2 || real_irq==4 || real_irq==5) { + bridgereg_t device; #if 0 - /* - * Allocate enough RRBs on the bridge for the DMAs. - * Right now allocating 2 RRBs on the normal channel - * and 2 on the virtual channel for slot 0 on the bus. - * And same for slot 1, to get ioc3 eth working. - */ - Not touching b_even_resp /* boot doesn't go far */ - bridge->b_even_resp = 0xdd99cc88; /* boot doesn't go far */ - bridge->b_even_resp = 0xcccc8888; /* breaks eth0 */ - bridge->b_even_resp = 0xcc88; /* breaks eth0 */ + /* + * Allocate enough RRBs on the bridge for the DMAs. + * Right now allocating 2 RRBs on the normal channel + * and 2 on the virtual channel for slot 0 on the bus. + * And same for slot 1, to get ioc3 eth working. + */ + Not touching b_even_resp /* boot doesn't go far */ + bridge->b_even_resp = 0xdd99cc88; /* boot doesn't go far */ + bridge->b_even_resp = 0xcccc8888; /* breaks eth0 */ + bridge->b_even_resp = 0xcc88; /* breaks eth0 */ #endif - /* Turn on bridge swapping */ - device = bridge->b_device[irq].reg; - device |= BRIDGE_DEV_SWAP_DIR; - bridge->b_device[irq].reg = device; - } - bridge->b_widget.w_tflush; /* Flush */ - - return 0; /* Never anything pending. */ + /* Turn on bridge swapping */ + device = bridge->b_device[real_irq].reg; + device |= BRIDGE_DEV_SWAP_DIR; + bridge->b_device[real_irq].reg = device; + /* + * Associate interrupt pin with device + * XXX This only works if b_int_device is initialized to 0! + */ + device = bridge->b_int_device; + device |= (pin << (real_irq*3)); + bridge->b_int_device = device; + } + bridge->b_widget.w_tflush; /* Flush */ + + return 0; /* Never anything pending. */ } -/* Startup one of the (PCI ...) IRQs routes over a bridge. */ +/* Shutdown one of the (PCI ...) IRQs routes over a bridge. */ static unsigned int bridge_shutdown(unsigned int irq) { - bridge_t *bridge = (bridge_t *) 0x9200000008000000; - bridgereg_t br; - int pin; - - /* FIIIIIXME ... Temporary kludge. This knows how interrupts are - setup in _my_ Origin. */ - switch (irq) { - case IOC3_SERIAL_INT: pin = 3; break; - case IOC3_ETH_INT: pin = 2; break; - case SCSI1_INT: pin = 1; break; - case SCSI0_INT: pin = 0; break; - default: panic("bridge_startup: whoops?"); - } - - br = LOCAL_HUB_L(PI_INT_MASK0_A); - LOCAL_HUB_S(PI_INT_MASK0_A, br & ~(1 << irq)); - LOCAL_HUB_L(PI_INT_MASK0_A); /* Flush */ - - bridge->b_int_enable &= ~(1 << pin); - bridge->b_widget.w_tflush; /* Flush */ - - return 0; /* Never anything pending. */ + bridge_t *bridge; + int pin, swlevel; + int real_irq = IRQ_FROM_IRQ(irq); + struct irqaction **p; + + bridge = (bridge_t *) NODE_SWIN_BASE(NASID_FROM_IRQ(irq), WID_FROM_IRQ(irq)); + DBG("bridge_shutdown: irq 0x%x\n", irq); + /* FIIIIIXME ... Temporary kludge. This knows how interrupts are + setup in _my_ Origin. */ + + if (irq != real_irq) /* pci device interrupt */ + switch (real_irq) { + case IRQ_FROM_IRQ(IOC3_ETH_INT): pin = 2; break; + default: pin = real_irq; break; + } + else + switch (real_irq) { + case CPU_RESCHED_A_IRQ: + case CPU_RESCHED_B_IRQ: + case CPU_CALL_A_IRQ: + case CPU_CALL_B_IRQ: + return 0; + default: panic("bridge_startup: whoops?"); + } + + /* + * map irq to a swlevel greater than 6 since the first 6 bits + * of INT_PEND0 are taken + */ + swlevel = IRQ_TO_SWLEVEL(real_irq); + intr_disconnect_level(smp_processor_id(), swlevel); + + bridge->b_int_enable &= ~(1 << pin); + bridge->b_widget.w_tflush; /* Flush */ + + return 0; /* Never anything pending. */ } static void bridge_init(void) { - bridge_t *bridge = (bridge_t *) 0x9200000008000000; - - /* Hmm... IRIX sets additional bits in the address which are - documented as reserved in the bridge docs ... */ - bridge->b_int_mode = 0x0; /* Don't clear ints */ + bridge_t *bridge; + nasid_t nasid; + char wid; + int bus; + + nasid = get_nasid(); + + for (bus=0; busb_int_mode = 0x0; /* Don't clear ints */ #if 0 - bridge->b_wid_int_upper = 0x000a8000; /* Ints to node 0 */ - bridge->b_wid_int_lower = 0x01000090; - bridge->b_dir_map = 0xa00000; /* DMA */ + bridge->b_wid_int_upper = 0x000a8000; /* Ints to node 0 */ + bridge->b_wid_int_lower = 0x01000090; + bridge->b_dir_map = 0xa00000; /* DMA */ #endif /* shouldn't lower= 0x01800090 ??? */ - bridge->b_wid_int_upper = 0x00098000; /* Ints to node 0 */ - bridge->b_wid_int_lower = 0x01800090; - bridge->b_dir_map = 0x900000; /* DMA */ + bridge->b_wid_int_upper = 0x000a8000; /* Ints to widget A */ + bridge->b_wid_int_lower = 0x01800090; + bridge->b_dir_map = 0xa00000; /* DMA */ - bridge->b_int_enable = 0; - bridge->b_widget.w_tflush; /* Flush */ - set_cp0_status(SRB_DEV0 | SRB_DEV1, SRB_DEV0 | SRB_DEV1); + bridge->b_int_enable = 0; + bridge->b_widget.w_tflush; /* Flush */ + } } void irq_debug(void) @@ -254,17 +349,18 @@ void irq_debug(void) printk("PI_INT_MASK0_A = 0x%x\n", LOCAL_HUB_L(PI_INT_MASK0_A)); } -int setup_irq(int irq, struct irqaction *new) +int setup_irq(unsigned int irq, struct irqaction *new) { int shared = 0; struct irqaction *old, **p; unsigned long flags; + DBG("setup_irq: 0x%x\n", irq); if (new->flags & SA_SAMPLE_RANDOM) rand_initialize_irq(irq); save_and_cli(flags); - p = irq_action + irq; + p = irq_action + IRQ_FROM_IRQ(irq); if ((old = *p) != NULL) { /* Can't share interrupts unless both agree to */ if (!(old->flags & new->flags & SA_SHIRQ)) { @@ -297,7 +393,8 @@ int request_irq(unsigned int irq, int retval; struct irqaction *action; - if (irq > 9) + DBG("request_irq(): irq= 0x%x\n", irq); + if (IRQ_FROM_IRQ(irq) > 9) return -EINVAL; if (!handler) return -EINVAL; @@ -313,7 +410,9 @@ int request_irq(unsigned int irq, action->next = NULL; action->dev_id = dev_id; + DBG("request_irq(): %s devid= 0x%x\n", devname, dev_id); retval = setup_irq(irq, action); + DBG("request_irq(): retval= %d\n", retval); if (retval) kfree(action); return retval; @@ -324,11 +423,11 @@ void free_irq(unsigned int irq, void *dev_id) struct irqaction * action, **p; unsigned long flags; - if (irq > 9) { + if (IRQ_FROM_IRQ(irq) > 9) { printk("Trying to free IRQ%d\n", irq); return; } - for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) { + for (p = IRQ_FROM_IRQ(irq) + irq_action; (action = *p) != NULL; p = &action->next) { if (action->dev_id != dev_id) continue; @@ -347,6 +446,7 @@ void free_irq(unsigned int irq, void *dev_id) /* Useless ISA nonsense. */ unsigned long probe_irq_on (void) { + panic("probe_irq_on called!\n"); return 0; } @@ -367,3 +467,312 @@ void __init init_IRQ(void) bridge_init(); set_except_vector(0, ip27_irq); } + + +#ifdef CONFIG_SMP + +/* + * This following are the global intr on off routines, copied almost + * entirely from i386 code. + */ + +int global_irq_holder = NO_PROC_ID; +spinlock_t global_irq_lock = SPIN_LOCK_UNLOCKED; + +extern void show_stack(unsigned long* esp); + +static void show(char * str) +{ + int i; + int cpu = smp_processor_id(); + + printk("\n%s, CPU %d:\n", str, cpu); + printk("irq: %d [",irqs_running()); + for(i=0;i < smp_num_cpus;i++) + printk(" %d",local_irq_count(i)); + printk(" ]\nbh: %d [",spin_is_locked(&global_bh_lock) ? 1 : 0); + for(i=0;i < smp_num_cpus;i++) + printk(" %d",local_bh_count(i)); + + printk(" ]\nStack dumps:"); + for(i = 0; i < smp_num_cpus; i++) { + unsigned long esp; + if (i == cpu) + continue; + printk("\nCPU %d:",i); + printk("Code not developed yet\n"); + /* show_stack(0); */ + } + printk("\nCPU %d:",cpu); + printk("Code not developed yet\n"); + /* show_stack(NULL); */ + printk("\n"); +} + +#define MAXCOUNT 100000000 +#define SYNC_OTHER_CORES(x) udelay(x+1) + +static inline void wait_on_irq(int cpu) +{ + int count = MAXCOUNT; + + for (;;) { + + /* + * Wait until all interrupts are gone. Wait + * for bottom half handlers unless we're + * already executing in one.. + */ + if (!irqs_running()) + if (local_bh_count(cpu) || !spin_is_locked(&global_bh_lock)) + break; + + /* Duh, we have to loop. Release the lock to avoid deadlocks */ + spin_unlock(&global_irq_lock); + + for (;;) { + if (!--count) { + show("wait_on_irq"); + count = ~0; + } + __sti(); + SYNC_OTHER_CORES(cpu); + __cli(); + if (irqs_running()) + continue; + if (spin_is_locked(&global_irq_lock)) + continue; + if (!local_bh_count(cpu) && spin_is_locked(&global_bh_lock)) + continue; + if (spin_trylock(&global_irq_lock)) + break; + } + } +} + +void synchronize_irq(void) +{ + if (irqs_running()) { + /* Stupid approach */ + cli(); + sti(); + } +} + +static inline void get_irqlock(int cpu) +{ + if (!spin_trylock(&global_irq_lock)) { + /* do we already hold the lock? */ + if ((unsigned char) cpu == global_irq_holder) + return; + /* Uhhuh.. Somebody else got it. Wait.. */ + spin_lock(&global_irq_lock); + } + /* + * We also to make sure that nobody else is running + * in an interrupt context. + */ + wait_on_irq(cpu); + + /* + * Ok, finally.. + */ + global_irq_holder = cpu; +} + +void __global_cli(void) +{ + unsigned int flags; + + __save_flags(flags); + if (flags & ST0_IE) { + int cpu = smp_processor_id(); + __cli(); + if (!local_irq_count(cpu)) + get_irqlock(cpu); + } +} + +void __global_sti(void) +{ + int cpu = smp_processor_id(); + + if (!local_irq_count(cpu)) + release_irqlock(cpu); + __sti(); +} + +/* + * SMP flags value to restore to: + * 0 - global cli + * 1 - global sti + * 2 - local cli + * 3 - local sti + */ +unsigned long __global_save_flags(void) +{ + int retval; + int local_enabled; + unsigned long flags; + int cpu = smp_processor_id(); + + __save_flags(flags); + local_enabled = (flags & ST0_IE); + /* default to local */ + retval = 2 + local_enabled; + + /* check for global flags if we're not in an interrupt */ + if (!local_irq_count(cpu)) { + if (local_enabled) + retval = 1; + if (global_irq_holder == cpu) + retval = 0; + } + return retval; +} + +void __global_restore_flags(unsigned long flags) +{ + switch (flags) { + case 0: + __global_cli(); + break; + case 1: + __global_sti(); + break; + case 2: + __cli(); + break; + case 3: + __sti(); + break; + default: + printk("global_restore_flags: %08lx\n", flags); + } +} + +#endif /* CONFIG_SMP */ + +/* + * Get values that vary depending on which CPU and bit we're operating on. + */ +static hub_intmasks_t *intr_get_ptrs(cpuid_t cpu, int bit, int *new_bit, + hubreg_t **intpend_masks, int *ip) +{ + hub_intmasks_t *hub_intmasks; + + hub_intmasks = &cpu_data[cpu].p_intmasks; + if (bit < N_INTPEND_BITS) { + *intpend_masks = hub_intmasks->intpend0_masks; + *ip = 0; + *new_bit = bit; + } else { + *intpend_masks = hub_intmasks->intpend1_masks; + *ip = 1; + *new_bit = bit - N_INTPEND_BITS; + } + return hub_intmasks; +} + +int intr_connect_level(cpuid_t cpu, int bit) +{ + int ip; + int slice = cputoslice(cpu); + volatile hubreg_t *mask_reg; + hubreg_t *intpend_masks; + nasid_t nasid = COMPACT_TO_NASID_NODEID(cputocnode(cpu)); + + (void)intr_get_ptrs(cpu, bit, &bit, &intpend_masks, &ip); + + /* Make sure it's not already pending when we connect it. */ + REMOTE_HUB_CLR_INTR(nasid, bit + ip * N_INTPEND_BITS); + + intpend_masks[0] |= (1ULL << (u64)bit); + + if (ip == 0) { + mask_reg = REMOTE_HUB_ADDR(nasid, PI_INT_MASK0_A + + PI_INT_MASK_OFFSET * slice); + } else { + mask_reg = REMOTE_HUB_ADDR(nasid, PI_INT_MASK1_A + + PI_INT_MASK_OFFSET * slice); + } + HUB_S(mask_reg, intpend_masks[0]); + return(0); +} + +int intr_disconnect_level(cpuid_t cpu, int bit) +{ + int ip; + int slice = cputoslice(cpu); + volatile hubreg_t *mask_reg; + hubreg_t *intpend_masks; + nasid_t nasid = COMPACT_TO_NASID_NODEID(cputocnode(cpu)); + + (void)intr_get_ptrs(cpu, bit, &bit, &intpend_masks, &ip); + intpend_masks[0] &= ~(1ULL << (u64)bit); + if (ip == 0) { + mask_reg = REMOTE_HUB_ADDR(nasid, PI_INT_MASK0_A + + PI_INT_MASK_OFFSET * slice); + } else { + mask_reg = REMOTE_HUB_ADDR(nasid, PI_INT_MASK1_A + + PI_INT_MASK_OFFSET * slice); + } + HUB_S(mask_reg, intpend_masks[0]); + return(0); +} + + +void handle_resched_intr(int irq, void *dev_id, struct pt_regs *regs) +{ + /* Nothing, the return from intr will work for us */ +} + +void install_cpuintr(cpuid_t cpu) +{ + int irq; + extern void smp_call_function_interrupt(void); + static int done = 0; + + /* + * This is a hack till we have a pernode irqlist. Currently, + * just have the master cpu set up the handlers for the per + * cpu irqs. + */ + +#ifdef CONFIG_SMP +#if (CPUS_PER_NODE == 2) + irq = CPU_RESCHED_A_IRQ + cputoslice(cpu); + intr_connect_level(cpu, IRQ_TO_SWLEVEL(irq)); + if (done == 0) + if (request_irq(irq, handle_resched_intr, 0, "resched", 0)) + panic("intercpu intr unconnectible\n"); + irq = CPU_CALL_A_IRQ + cputoslice(cpu); + intr_connect_level(cpu, IRQ_TO_SWLEVEL(irq)); + if (done == 0) + if (request_irq(irq, smp_call_function_interrupt, 0, + "callfunc", 0)) + panic("intercpu intr unconnectible\n"); + /* HACK STARTS */ + if (done) + return; + irq = CPU_RESCHED_A_IRQ + cputoslice(cpu) + 1; + if (request_irq(irq, handle_resched_intr, 0, "resched", 0)) + panic("intercpu intr unconnectible\n"); + irq = CPU_CALL_A_IRQ + cputoslice(cpu) + 1; + if (request_irq(irq, smp_call_function_interrupt, 0, + "callfunc", 0)) + panic("intercpu intr unconnectible\n"); + done = 1; + /* HACK ENDS */ +#else /* CPUS_PER_NODE */ + << Bomb! Must redefine this for more than 2 CPUS. >> +#endif /* CPUS_PER_NODE */ +#endif /* CONFIG_SMP */ +} + +void install_tlbintr(cpuid_t cpu) +{ + int intr_bit = N_INTPEND_BITS + TLB_INTR_A + cputoslice(cpu); + + intr_connect_level(cpu, intr_bit); +} diff --git a/arch/mips64/sgi-ip27/ip27-klconfig.c b/arch/mips64/sgi-ip27/ip27-klconfig.c index 3d9ea3566a23..fac7c9dfad42 100644 --- a/arch/mips64/sgi-ip27/ip27-klconfig.c +++ b/arch/mips64/sgi-ip27/ip27-klconfig.c @@ -1,4 +1,4 @@ -/* $Id: ip27-klconfig.c,v 1.1 2000/01/17 23:32:47 ralf Exp $ +/* $Id$ * * Copyright (C) 1999, 2000 Ralf Baechle (ralf@gnu.org) * Copyright (C) 1999, 2000 Silicon Graphics, Inc. @@ -13,21 +13,111 @@ #include #include +#include +#include -lboard_t *find_lboard(unsigned int type) +klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char struct_type) { - lboard_t *b; + int index, j; - for ( -b = KL_CONFIG_INFO(get_nasid()); -b; -b = KLCF_NEXT(b)) { - if (KLCF_REMOTE(b)) - continue; /* Skip remote boards. */ + if (kli == (klinfo_t *)NULL) { + index = 0; + } else { + for (j = 0; j < KLCF_NUM_COMPS(brd); j++) + if (kli == KLCF_COMP(brd, j)) + break; + index = j; + if (index == KLCF_NUM_COMPS(brd)) { + printk("find_component: Bad pointer: 0x%p\n", kli); + return (klinfo_t *)NULL; + } + index++; /* next component */ + } + + for (; index < KLCF_NUM_COMPS(brd); index++) { + kli = KLCF_COMP(brd, index); + if (KLCF_COMP_TYPE(kli) == struct_type) + return kli; + } + + /* Didn't find it. */ + return (klinfo_t *)NULL; +} + +klinfo_t *find_first_component(lboard_t *brd, unsigned char struct_type) +{ + return find_component(brd, (klinfo_t *)NULL, struct_type); +} + +lboard_t * find_lboard(lboard_t *start, unsigned char brd_type) +{ + /* Search all boards stored on this node. */ + while (start) { + if (start->brd_type == brd_type) + return start; + start = KLCF_NEXT(start); + } + /* Didn't find it. */ + return (lboard_t *)NULL; +} + +cnodeid_t get_cpu_cnode(int cpu) +{ + return CPUID_TO_COMPACT_NODEID(cpu); +} - if (b->brd_type == type) - return (lboard_t *) b; +klcpu_t * nasid_slice_to_cpuinfo(nasid_t nasid, int slice) +{ + lboard_t *brd; + klcpu_t *acpu; + + if (!(brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IP27))) + return (klcpu_t *)NULL; + + if (!(acpu = (klcpu_t *)find_first_component(brd, KLSTRUCT_CPU))) + return (klcpu_t *)NULL; + + do { + if ((acpu->cpu_info.physid) == slice) + return acpu; + } while ((acpu = (klcpu_t *)find_component(brd, (klinfo_t *)acpu, + KLSTRUCT_CPU))); + return (klcpu_t *)NULL; +} + +klcpu_t * sn_get_cpuinfo(cpuid_t cpu) +{ + nasid_t nasid; + int slice; + klcpu_t *acpu; + gda_t *gdap = GDA; + cnodeid_t cnode; + + if (!(cpu < MAXCPUS)) { + printk("sn_get_cpuinfo: illegal cpuid 0x%lx\n", cpu); + return NULL; } + cnode = get_cpu_cnode(cpu); + if (cnode == INVALID_CNODEID) + return NULL; + + if ((nasid = gdap->g_nasidtable[cnode]) == INVALID_NASID) + return NULL; + + for (slice = 0; slice < CPUS_PER_NODE; slice++) { + acpu = nasid_slice_to_cpuinfo(nasid, slice); + if (acpu && acpu->cpu_info.virtid == cpu) + return acpu; + } return NULL; } + +int get_cpu_slice(cpuid_t cpu) +{ + klcpu_t *acpu; + + if ((acpu = sn_get_cpuinfo(cpu)) == NULL) + return -1; + return acpu->cpu_info.physid; +} diff --git a/arch/mips64/sgi-ip27/ip27-memory.c b/arch/mips64/sgi-ip27/ip27-memory.c index a7bc49cf3087..063fb5a41ac9 100644 --- a/arch/mips64/sgi-ip27/ip27-memory.c +++ b/arch/mips64/sgi-ip27/ip27-memory.c @@ -1,4 +1,4 @@ -/* $Id: ip27-memory.c,v 1.9 2000/02/10 09:07:31 kanoj Exp $ +/* $Id: ip27-memory.c,v 1.2 2000/01/27 01:05:24 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -57,17 +57,12 @@ int numa_debug(void) */ pfn_t node_getfirstfree(cnodeid_t cnode) { -#ifdef LATER nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); - if (cnode == 0) - return KDM_TO_PHYS((unsigned long)(&_end)); - return KDM_TO_PHYS(SYMMON_STK_ADDR(nasid, 0)); -#endif if (cnode == 0) return (KDM_TO_PHYS(PAGE_ALIGN((unsigned long)(&_end)) - (CKSEG0 - K0BASE)) >> PAGE_SHIFT); - return slot_getbasepfn(cnode, 0); + return (KDM_TO_PHYS(PAGE_ALIGN(SYMMON_STK_ADDR(nasid, 0))) >> PAGE_SHIFT); } /* @@ -124,7 +119,7 @@ static pfn_t slot_psize_compute(cnodeid_t node, int slot) nasid = COMPACT_TO_NASID_NODEID(node); /* Find the node board */ - brd = find_lboard_real((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IP27); + brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_IP27); if (!brd) return 0; @@ -269,28 +264,24 @@ prom_free_prom_memory (void) void __init paging_init(void) { cnodeid_t node; - unsigned int zones_size[MAX_NR_ZONES] = {0, 0, 0}; + unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; /* Initialize the entire pgd. */ pgd_init((unsigned long)swapper_pg_dir); - pgd_init((unsigned long)swapper_pg_dir + PAGE_SIZE / 2); pmd_init((unsigned long)invalid_pmd_table); + memset((void *)invalid_pte_table, 0, sizeof(pte_t) * 2 * PTRS_PER_PTE); for (node = 0; node < numnodes; node++) { pfn_t start_pfn = slot_getbasepfn(node, 0); pfn_t end_pfn = node_getmaxclick(node); zones_size[ZONE_DMA] = end_pfn + 1 - start_pfn; - PLAT_NODE_DATA(node)->physstart = (start_pfn << PAGE_SHIFT); - PLAT_NODE_DATA(node)->size = (zones_size[ZONE_DMA] << PAGE_SHIFT); free_area_init_node(node, NODE_DATA(node), zones_size, start_pfn << PAGE_SHIFT, 0); - PLAT_NODE_DATA(node)->start_mapnr = - (NODE_DATA(node)->node_mem_map - mem_map); - if ((PLAT_NODE_DATA(node)->start_mapnr + - PLAT_NODE_DATA(node)->size) > pagenr) - pagenr = PLAT_NODE_DATA(node)->start_mapnr + - PLAT_NODE_DATA(node)->size; + if ((PLAT_NODE_DATA_STARTNR(node) + + PLAT_NODE_DATA_SIZE(node)) > pagenr) + pagenr = PLAT_NODE_DATA_STARTNR(node) + + PLAT_NODE_DATA_SIZE(node); } } @@ -313,6 +304,11 @@ void __init mem_init(void) for (nid = 0; nid < numnodes; nid++) { + /* + * Hack till free_area_init_core() zeroes free_pages + */ + for (tmp = 0; tmp < MAX_NR_ZONES; tmp++) + PLAT_NODE_DATA(nid)->gendata.node_zones[tmp].free_pages=0; /* * This will free up the bootmem, ie, slot 0 memory. */ @@ -322,7 +318,7 @@ void __init mem_init(void) * We need to manually do the other slots. */ pg = NODE_DATA(nid)->node_mem_map + slot_getsize(nid, 0); - pgnr = PLAT_NODE_DATA(nid)->start_mapnr + slot_getsize(nid, 0); + pgnr = PLAT_NODE_DATA_STARTNR(nid) + slot_getsize(nid, 0); numslots = node_getlastslot(nid); for (slot = 1; slot <= numslots; slot++) { pslot = NODE_DATA(nid)->node_mem_map + @@ -357,9 +353,9 @@ void __init mem_init(void) reservedpages = ram = 0; for (nid = 0; nid < numnodes; nid++) { - for (tmp = PLAT_NODE_DATA(nid)->start_mapnr; tmp < - ((PLAT_NODE_DATA(nid)->start_mapnr) + - (PLAT_NODE_DATA(nid)->size >> PAGE_SHIFT)); tmp++) { + for (tmp = PLAT_NODE_DATA_STARTNR(nid); tmp < + (PLAT_NODE_DATA_STARTNR(nid) + + PLAT_NODE_DATA_SIZE(nid)); tmp++) { /* Ignore holes */ if (PageSkip(mem_map+tmp)) continue; diff --git a/arch/mips64/sgi-ip27/ip27-nmi.c b/arch/mips64/sgi-ip27/ip27-nmi.c new file mode 100644 index 000000000000..3511c62e752a --- /dev/null +++ b/arch/mips64/sgi-ip27/ip27-nmi.c @@ -0,0 +1,165 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if 0 +#define NODE_NUM_CPUS(n) CNODE_NUM_CPUS(n) +#else +#define NODE_NUM_CPUS(n) CPUS_PER_NODE +#endif + +#define CNODEID_NONE (cnodeid_t)-1 +#define enter_panic_mode() spin_lock(&nmi_lock) + +typedef unsigned long machreg_t; + +spinlock_t nmi_lock = SPIN_LOCK_UNLOCKED; + +/* + * Lets see what else we need to do here. Set up sp, gp? + */ +void nmi_dump(void) +{ + void cont_nmi_dump(void); + + cont_nmi_dump(); +} + +void install_cpu_nmi_handler(int slice) +{ + nmi_t *nmi_addr; + + nmi_addr = (nmi_t *)NMI_ADDR(get_nasid(), slice); + if (nmi_addr->call_addr) + return; + nmi_addr->magic = NMI_MAGIC; + nmi_addr->call_addr = (void *)nmi_dump; + nmi_addr->call_addr_c = + (void *)(~((unsigned long)(nmi_addr->call_addr))); + nmi_addr->call_parm = 0; +} + +/* + * Copy the cpu registers which have been saved in the IP27prom format + * into the eframe format for the node under consideration. + */ + +void +nmi_cpu_eframe_save(nasid_t nasid, + int slice) +{ + int i, numberof_nmi_cpu_regs; + machreg_t *prom_format; + + /* Get the total number of registers being saved by the prom */ + numberof_nmi_cpu_regs = sizeof(struct reg_struct) / sizeof(machreg_t); + + /* Get the pointer to the current cpu's register set. */ + prom_format = + (machreg_t *)(TO_UNCAC(TO_NODE(nasid, IP27_NMI_KREGS_OFFSET)) + + slice * IP27_NMI_KREGS_CPU_SIZE); + + printk("NMI nasid %d: slice %d\n", nasid, slice); + for (i = 0; i < numberof_nmi_cpu_regs; i++) + printk("0x%lx ", prom_format[i]); + printk("\n\n"); +} + +/* + * Copy the cpu registers which have been saved in the IP27prom format + * into the eframe format for the node under consideration. + */ +void +nmi_node_eframe_save(cnodeid_t cnode) +{ + int cpu; + nasid_t nasid; + + /* Make sure that we have a valid node */ + if (cnode == CNODEID_NONE) + return; + + nasid = COMPACT_TO_NASID_NODEID(cnode); + if (nasid == INVALID_NASID) + return; + + /* Save the registers into eframe for each cpu */ + for(cpu = 0; cpu < NODE_NUM_CPUS(cnode); cpu++) + nmi_cpu_eframe_save(nasid, cpu); +} + +/* + * Save the nmi cpu registers for all cpus in the system. + */ +void +nmi_eframes_save(void) +{ + cnodeid_t cnode; + + for(cnode = 0 ; cnode < numnodes; cnode++) + nmi_node_eframe_save(cnode); +} + +void +cont_nmi_dump(void) +{ +#ifndef REAL_NMI_SIGNAL + static atomic_t nmied_cpus = ATOMIC_INIT(0); + + atomic_inc(&nmied_cpus); +#endif + /* + * Use enter_panic_mode to allow only 1 cpu to proceed + */ + enter_panic_mode(); + +#ifdef REAL_NMI_SIGNAL + /* + * Wait up to 15 seconds for the other cpus to respond to the NMI. + * If a cpu has not responded after 10 sec, send it 1 additional NMI. + * This is for 2 reasons: + * - sometimes a MMSC fail to NMI all cpus. + * - on 512p SN0 system, the MMSC will only send NMIs to + * half the cpus. Unfortunately, we dont know which cpus may be + * NMIed - it depends on how the site chooses to configure. + * + * Note: it has been measure that it takes the MMSC up to 2.3 secs to + * send NMIs to all cpus on a 256p system. + */ + for (i=0; i < 1500; i++) { + for (node=0; node < numnodes; node++) + if (NODEPDA(node)->dump_count == 0) + break; + if (node == numnodes) + break; + if (i == 1000) { + for (node=0; node < numnodes; node++) + if (NODEPDA(node)->dump_count == 0) { + cpu = CNODE_TO_CPU_BASE(node); + for (n=0; n < CNODE_NUM_CPUS(node); cpu++, n++) { + CPUMASK_SETB(nmied_cpus, cpu); + SEND_NMI((cputonasid(cpu)), (cputoslice(cpu))); + } + } + + } + udelay(10000); + } +#else + while (atomic_read(&nmied_cpus) != smp_num_cpus); +#endif + + /* + * Save the nmi cpu registers for all cpu in the eframe format. + */ + nmi_eframes_save(); + LOCAL_HUB_S(NI_PORT_RESET, NPR_PORTRESET | NPR_LOCALRESET); +} + diff --git a/arch/mips64/sgi-ip27/ip27-pci-dma.c b/arch/mips64/sgi-ip27/ip27-pci-dma.c index 895cf2827659..81e3e5c6fdfe 100644 --- a/arch/mips64/sgi-ip27/ip27-pci-dma.c +++ b/arch/mips64/sgi-ip27/ip27-pci-dma.c @@ -1,4 +1,4 @@ -/* $Id: ip27-pci-dma.c,v 1.1 2000/02/18 00:24:31 ralf Exp $ +/* $Id: ip27-pci-dma.c,v 1.1 2000/02/16 21:22:00 ralf Exp $ * * Dynamic DMA mapping support. * diff --git a/arch/mips64/sgi-ip27/ip27-pci.c b/arch/mips64/sgi-ip27/ip27-pci.c index 62cd3a0cb206..75d966d9d1a3 100644 --- a/arch/mips64/sgi-ip27/ip27-pci.c +++ b/arch/mips64/sgi-ip27/ip27-pci.c @@ -13,6 +13,8 @@ #include #include #include +#include +#include /* * The Bridge ASIC supports both type 0 and type 1 access. Type 1 is @@ -22,14 +24,18 @@ */ #define CF0_READ_PCI_CFG(dev,where,value,bm,mask) \ do { \ - bridge_t *bridge = (bridge_t *) 0x9200000008000000; \ + bridge_t *bridge; \ int slot = PCI_SLOT(dev->devfn); \ int fn = PCI_FUNC(dev->devfn); \ volatile u32 *addr; \ u32 cf, __bit; \ + unsigned int bus_id = (unsigned) dev->bus->number; \ \ - if (dev->bus->number) \ - return PCIBIOS_DEVICE_NOT_FOUND; \ + bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], \ + bus_to_wid[bus_id]); \ + \ + /*if (dev->bus->number) */ \ + /* return PCIBIOS_DEVICE_NOT_FOUND; */ \ \ __bit = (((where) & (bm)) << 3); \ addr = &bridge->b_type0_cfg_dev[slot].f[fn].l[where >> 2]; \ @@ -59,14 +65,18 @@ pci_conf0_read_config_dword(struct pci_dev *dev, int where, u32 *value) #define CF0_WRITE_PCI_CFG(dev,where,value,bm,mask) \ do { \ - bridge_t *bridge = (bridge_t *) 0x9200000008000000; \ + bridge_t *bridge; \ int slot = PCI_SLOT(dev->devfn); \ int fn = PCI_FUNC(dev->devfn); \ volatile u32 *addr; \ u32 cf, __bit; \ + unsigned int bus_id = (unsigned) dev->bus->number; \ \ - if (dev->bus->number) \ - return PCIBIOS_DEVICE_NOT_FOUND; \ + bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], \ + bus_to_wid[bus_id]); \ + \ + /* if (dev->bus->number) */ \ + /* return PCIBIOS_DEVICE_NOT_FOUND; */ \ \ if (dev->vendor == PCI_VENDOR_ID_SGI \ && dev->device == PCI_DEVICE_ID_SGI_IOC3) \ @@ -114,11 +124,14 @@ void __init pcibios_init(void) { struct pci_ops *ops = &bridge_pci_ops; nasid_t nid = get_nasid(); + int i; ioport_resource.end = ~0UL; - printk("PCI: Probing PCI hardware on host bus 0, node %d.\n", nid); - pci_scan_bus(0, ops, NULL); + for (i=0; ibus->number] << 8); + rv |= (bus_to_nid[dev->bus->number] << 16); + return rv; } void __init @@ -171,33 +188,7 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root, void __init pcibios_fixup_bus(struct pci_bus *b) { - unsigned short command; - struct list_head *ln; - struct pci_dev *dev; - pci_fixup_irqs(pci_swizzle, pci_map_irq); - - /* - * Older qlogicisp driver expects to have the IO space enable - * bit set. Make that happen for qlogic in slots 0 and 1. Things - * stop working if we program the controllers as not having - * PCI_COMMAND_MEMORY, so we have to fudge the mem_flags. - */ - for (ln=b->devices.next; ln != &b->devices; ln=ln->next) { - dev = pci_dev_b(ln); - if (PCI_FUNC(dev->devfn) == 0) { - if ((PCI_SLOT(dev->devfn) == 0) || - (PCI_SLOT(dev->devfn) == 1)) { - if (pci_read_config_word(dev, PCI_COMMAND, - &command) == 0) { - command |= PCI_COMMAND_IO; - pci_write_config_word(dev, PCI_COMMAND, - command); - dev->resource[1].flags |= 1; - } - } - } - } } void __init @@ -239,7 +230,7 @@ pci_fixup_ioc3(struct pci_dev *d) with tons of bogus information in the pci_dev. On Origins the INTA, INTB and INTC pins are all wired together as if it'd only use INTA. */ - printk("PCI: Fixing base addresses for device %s\n", d->slot_name); + printk("PCI: Fixing base addresses for IOC3 device %s\n", d->slot_name); for (i = 1; i <= PCI_ROM_RESOURCE; i++) { d->resource[i].start = 0UL; @@ -251,8 +242,115 @@ pci_fixup_ioc3(struct pci_dev *d) d->irq = 1; } +static void __init +pci_fixup_isp1020(struct pci_dev *d) +{ + unsigned short command; + + printk("PCI: Fixing isp1020 in [bus:slot.fn] %s\n", d->slot_name); + + /* Configure device to allow bus mastering, i/o and memory mapping. + * Older qlogicisp driver expects to have the IO space enable + * bit set. Things stop working if we program the controllers as not having + * PCI_COMMAND_MEMORY, so we have to fudge the mem_flags. + */ + + /* only turn on scsi's on main bus */ + if (d->bus->number == 0) { + pci_set_master(d); + pci_read_config_word(d, PCI_COMMAND, &command); + command |= PCI_COMMAND_MEMORY; + command |= PCI_COMMAND_IO; + pci_write_config_word(d, PCI_COMMAND, command); + d->resource[1].flags |= 1; + } +} +static void __init +pci_fixup_isp2x00(struct pci_dev *d) +{ + unsigned int bus_id = (unsigned) d->bus->number; + bridge_t *bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], + bus_to_wid[bus_id]); + bridgereg_t devreg; + int i; + int slot = PCI_SLOT(d->devfn); + unsigned int start; + unsigned short command; + + printk("PCI: Fixing isp2x00 in [bus:slot.fn] %s\n", d->slot_name); + + /* set the resource struct for this device */ + start = (u32) bridge; /* yes, we want to lose the upper 32 bits here */ + start |= BRIDGE_DEVIO(slot); + + d->resource[0].start = start; + d->resource[0].end = d->resource[0].start + 0xff; + d->resource[0].flags = IORESOURCE_IO; + + d->resource[1].start = start; + d->resource[1].end = d->resource[0].start + 0xfff; + d->resource[1].flags = IORESOURCE_MEM; + + /* + * set the bridge device(x) reg for this device + */ + devreg = bridge->b_device[slot].reg; + /* point device(x) to it appropriate small window */ + devreg &= ~BRIDGE_DEV_OFF_MASK; + devreg |= (start >> 20) & BRIDGE_DEV_OFF_MASK; + + /* turn on byte swapping in direct map mode (how we currently run dma's) */ + devreg |= BRIDGE_DEV_SWAP_DIR; /* turn on byte swapping */ + + bridge->b_device[slot].reg = devreg; + + /* set card's base addr reg */ + //pci_conf0_write_config_dword(d, PCI_BASE_ADDRESS_0, 0x500001); + //pci_conf0_write_config_dword(d, PCI_BASE_ADDRESS_1, 0x8b00000); + //pci_conf0_write_config_dword(d, PCI_ROM_ADDRESS, 0x8b20000); + + /* I got these from booting irix on system...*/ + pci_conf0_write_config_dword(d, PCI_BASE_ADDRESS_0, 0x200001); + //pci_conf0_write_config_dword(d, PCI_BASE_ADDRESS_1, 0xf800000); + pci_conf0_write_config_dword(d, PCI_ROM_ADDRESS, 0x10200000); + + pci_conf0_write_config_dword(d, PCI_BASE_ADDRESS_1, start); + //pci_conf0_write_config_dword(d, PCI_ROM_ADDRESS, (start | 0x20000)); + + + /* set cache line size */ + pci_conf0_write_config_dword(d, PCI_CACHE_LINE_SIZE, 0xf080); + + /* set pci bus timeout */ + bridge->b_bus_timeout |= BRIDGE_BUS_PCI_RETRY_HLD(0x3); + bridge->b_wid_tflush; + printk("PCI: bridge bus timeout= 0x%x \n", bridge->b_bus_timeout); + + /* set host error field */ + bridge->b_int_host_err = 0x44; + bridge->b_wid_tflush; + + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + for (i=0; i<8; i++) + printk("PCI: device(%d)= 0x%x\n",i,bridge->b_device[i].reg); + + /* configure device to allow bus mastering, i/o and memory mapping */ + pci_set_master(d); + pci_read_config_word(d, PCI_COMMAND, &command); + command |= PCI_COMMAND_MEMORY; + command |= PCI_COMMAND_IO; + pci_write_config_word(d, PCI_COMMAND, command); + /*d->resource[1].flags |= 1;*/ +} + struct pci_fixup pcibios_fixups[] = { { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3, pci_fixup_ioc3 }, + { PCI_FIXUP_HEADER, PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1020, + pci_fixup_isp1020 }, + { PCI_FIXUP_HEADER, PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2100, + pci_fixup_isp2x00 }, + { PCI_FIXUP_HEADER, PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2200, + pci_fixup_isp2x00 }, { 0 } }; diff --git a/arch/mips64/sgi-ip27/ip27-reset.c b/arch/mips64/sgi-ip27/ip27-reset.c index b30cb12a29ed..388fb602648f 100644 --- a/arch/mips64/sgi-ip27/ip27-reset.c +++ b/arch/mips64/sgi-ip27/ip27-reset.c @@ -1,4 +1,4 @@ -/* $Id: ip27-reset.c,v 1.1 2000/01/17 23:32:47 ralf Exp $ +/* $Id$ * * 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 @@ -9,15 +9,22 @@ * Copyright (C) 1997, 1998, 1999 by Ralf Baechle * Copyright (C) 1999 Silicon Graphics, Inc. */ +#include #include #include #include +#include +#include #include #include #include #include #include #include +#include +#include +#include +#include void machine_restart(char *command) __attribute__((noreturn)); void machine_halt(void) __attribute__((noreturn)); @@ -26,7 +33,19 @@ void machine_power_off(void) __attribute__((noreturn)); /* XXX How to pass the reboot command to the firmware??? */ void machine_restart(char *command) { - ArcReboot(); + int i; + + printk("Reboot started from CPU %d\n", smp_processor_id()); +#ifdef CONFIG_SMP + smp_send_stop(); +#endif +#if 0 + for (i = 0; i < numnodes; i++) + REMOTE_HUB_S(COMPACT_TO_NASID_NODEID(i), PROMOP_REG, + PROMOP_RESTART); +#else + LOCAL_HUB_S(NI_PORT_RESET, NPR_PORTRESET | NPR_LOCALRESET); +#endif } void machine_halt(void) diff --git a/arch/mips64/sgi-ip27/ip27-setup.c b/arch/mips64/sgi-ip27/ip27-setup.c index f0d7d66ab0dc..89f58c13de6e 100644 --- a/arch/mips64/sgi-ip27/ip27-setup.c +++ b/arch/mips64/sgi-ip27/ip27-setup.c @@ -1,4 +1,4 @@ -/* $Id: ip27-setup.c,v 1.6 2000/02/05 02:12:32 kanoj Exp $ +/* $Id: ip27-setup.c,v 1.7 2000/03/07 15:45:29 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -19,12 +19,26 @@ #include #include #include +#include +#include +#include +#include +#include +#include /* Check against user dumbness. */ #ifdef CONFIG_VT #error CONFIG_VT not allowed for IP27. #endif +#undef DEBUG_SETUP +#ifdef DEBUG_SETUP +#define DBG(x...) printk(x) +#else +#define DBG(x...) +#endif + + /* * get_nasid() returns the physical node id number of the caller. */ @@ -84,12 +98,130 @@ static void __init verify_mode(void) #endif } +#define XBOW_WIDGET_PART_NUM 0x0 +#define XXBOW_WIDGET_PART_NUM 0xd000 /* Xbridge */ +#define BASE_XBOW_PORT 8 /* Lowest external port */ + +static void __init pcibr_setup(void) +{ + int i; + bridge_t *bridge; + volatile u64 hubreg; + nasid_t nasid; + xwidget_part_num_t partnum; + widgetreg_t widget_id; + + num_bridges = 0; + /* + * find what's on our local node + */ + nasid = 0; + hubreg = LOCAL_HUB_L(IIO_LLP_CSR); + if (hubreg & IIO_LLP_CSR_IS_UP) { + /* link is up */ + widget_id = *(volatile widgetreg_t *) + (RAW_NODE_SWIN_BASE(nasid, 0x0) + WIDGET_ID); + partnum = XWIDGET_PART_NUM(widget_id); + printk("pcibr_setup(): found partnum= 0x%x ", partnum); + if (partnum == BRIDGE_WIDGET_PART_NUM) { + /* + * found direct connected bridge so must be Origin200 + */ + printk("...is bridge\n"); + num_bridges = 1; + bus_to_wid[0] = 0x8; + bus_to_nid[0] = 0; + } + if (partnum == XBOW_WIDGET_PART_NUM) { + lboard_t *brd; + klxbow_t *xbow_p; + /* + * found xbow, so may have multiple bridges + * need to probe xbow + */ + printk("...is xbow\n"); + + if ((brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), + KLTYPE_MIDPLANE8)) == NULL) + printk("argh\n"); + else + printk("brd= 0x%x\n", brd); + if ((xbow_p = (klxbow_t *) + find_component(brd, NULL, KLSTRUCT_XBOW)) == NULL) + printk("argh\n"); + else { + for (i=HUB_WIDGET_ID_MIN; i<=HUB_WIDGET_ID_MAX; i++) { + if (!XBOW_PORT_IS_ENABLED(xbow_p, i)) + continue; + if (XBOW_PORT_TYPE_IO(xbow_p, i)) { + widget_id = *(volatile widgetreg_t *) + (RAW_NODE_SWIN_BASE(nasid, i) + WIDGET_ID); + partnum = XWIDGET_PART_NUM(widget_id); + if (partnum == BRIDGE_WIDGET_PART_NUM) { + printk("widget 0x%x is a bridge\n", i); + bus_to_wid[num_bridges] = i; + bus_to_nid[num_bridges] = nasid; + num_bridges++; + } + } + } + } + } + if (partnum == XXBOW_WIDGET_PART_NUM) { + /* + * found xbridge, assume ibrick for now + */ + printk("...is xbridge\n"); + bus_to_wid[0] = 0xb; + bus_to_wid[1] = 0xe; + bus_to_wid[2] = 0xf; + + bus_to_nid[0] = 0; + bus_to_nid[1] = 0; + bus_to_nid[2] = 0; + + num_bridges = 3; + } + } + /* + * set bridge registers + */ + for (i=0; ib_int_rst_stat = (BRIDGE_IRR_ALL_CLR); + /* + * Until otherwise set up, assume all interrupts are from slot 0 + */ + bridge->b_int_device = (u32) 0x0; + /* + * swap pio's to pci mem and io space (big windows) + */ + bridge->b_wid_control |= BRIDGE_CTRL_IO_SWAP; + bridge->b_wid_control |= BRIDGE_CTRL_MEM_SWAP; + + bridge->b_wid_tflush; /* wait until Bridge PIO complete */ + } +} + void __init ip27_setup(void) { nasid_t nid; hubreg_t p, e; - set_cp0_status(ST0_IM, 0); + /* + * hub_rtc init and cpu clock intr enabled for later calibrate_delay. + */ + DBG("ip27_setup(): Entered.\n"); + per_cpu_init(); nid = get_nasid(); printk("IP27: Running on node %d.\n", nid); @@ -108,4 +240,9 @@ void __init ip27_setup(void) verify_mode(); ioc3_sio_init(); ioc3_eth_init(); + + DBG("ip27_setup(): calling pcibr_setup\n"); + /* set some bridge registers */ + pcibr_setup(); + DBG("ip27_setup(): Exit.\n"); } diff --git a/arch/mips64/sgi-ip27/ip27-timer.c b/arch/mips64/sgi-ip27/ip27-timer.c index ff6ea60e7cc4..d5a1ed0581a5 100644 --- a/arch/mips64/sgi-ip27/ip27-timer.c +++ b/arch/mips64/sgi-ip27/ip27-timer.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -44,7 +45,6 @@ static int set_rtc_mmss(unsigned long nowtime) { int retval = 0; int real_seconds, real_minutes, cmos_minutes; - unsigned char save_control, save_freq_select; struct m48t35_rtc *rtc; nasid_t nid; @@ -89,20 +89,50 @@ static int set_rtc_mmss(unsigned long nowtime) void rt_timer_interrupt(struct pt_regs *regs) { + int cpu = smp_processor_id(); + int cpuA = ((cputoslice(smp_processor_id())) == 0); + int user = user_mode(regs); int irq = 7; /* XXX Assign number */ write_lock(&xtime_lock); again: - LOCAL_HUB_S(PI_RT_PEND_A, 0); /* Ack */ + LOCAL_HUB_S(cpuA ? PI_RT_PEND_A : PI_RT_PEND_B, 0); /* Ack */ ct_cur += CYCLES_PER_JIFFY; - LOCAL_HUB_S(PI_RT_COMPARE_A, ct_cur); + LOCAL_HUB_S(cpuA ? PI_RT_COMPARE_A : PI_RT_COMPARE_B, ct_cur); if (LOCAL_HUB_L(PI_RT_COUNT) >= ct_cur) goto again; - kstat.irqs[0][irq]++; + kstat.irqs[cpu][irq]++; /* kstat+do_timer only for bootcpu? */ do_timer(regs); + +#ifdef CONFIG_SMP + if (current->pid) { + unsigned int *inc, *inc2; + + update_one_process(current, 1, user, !user, cpu); + if (--current->counter <= 0) { + current->counter = 0; + current->need_resched = 1; + } + + if (user) { + if (current->priority < DEF_PRIORITY) { + inc = &kstat.cpu_nice; + inc2 = &kstat.per_cpu_nice[cpu]; + } else { + inc = &kstat.cpu_user; + inc2 = &kstat.per_cpu_user[cpu]; + } + } else { + inc = &kstat.cpu_system; + inc2 = &kstat.per_cpu_system[cpu]; + } + atomic_inc((atomic_t *)inc); + atomic_inc((atomic_t *)inc2); + } +#endif /* CONFIG_SMP */ /* * If we have an externally synchronized Linux clock, then update @@ -194,7 +224,8 @@ static unsigned long __init get_m48t35_time(void) nasid_t nid; nid = get_nasid(); - rtc = KL_CONFIG_CH_CONS_INFO(nid)->memory_base + IOC3_BYTEBUS_DEV0; + rtc = (struct m48t35_rtc *)(KL_CONFIG_CH_CONS_INFO(nid)->memory_base + + IOC3_BYTEBUS_DEV0); rtc->control |= M48T35_RTC_READ; sec = rtc->sec; @@ -220,16 +251,19 @@ static unsigned long __init get_m48t35_time(void) extern void ioc3_eth_init(void); void __init time_init(void) +{ + xtime.tv_sec = get_m48t35_time(); + xtime.tv_usec = 0; +} + +void __init cpu_time_init(void) { lboard_t *board; klcpu_t *cpu; int cpuid; - xtime.tv_sec = get_m48t35_time(); - xtime.tv_usec = 0; - /* Don't use ARCS. ARCS is fragile. Klconfig is simple and sane. */ - board = find_lboard(KLTYPE_IP27); + board = find_lboard(KL_CONFIG_INFO(get_nasid()), KLTYPE_IP27); if (!board) panic("Can't find board info for myself."); @@ -238,15 +272,29 @@ void __init time_init(void) if (!cpu) panic("No information about myself?"); - printk("CPU clock is %dMHz.\n", cpu->cpu_speed); - - /* Don't worry about second CPU, it's disabled. */ - LOCAL_HUB_S(PI_RT_EN_A, 1); - LOCAL_HUB_S(PI_PROF_EN_A, 0); - ct_cur = CYCLES_PER_JIFFY; - LOCAL_HUB_S(PI_RT_COMPARE_A, ct_cur); - LOCAL_HUB_S(PI_RT_COUNT, 0); - LOCAL_HUB_S(PI_RT_PEND_A, 0); + printk("CPU %d clock is %dMHz.\n", smp_processor_id(), cpu->cpu_speed); set_cp0_status(SRB_TIMOCLK, SRB_TIMOCLK); } + +void __init hub_rtc_init(cnodeid_t cnode) +{ + /* + * We only need to initialize the current node. + * If this is not the current node then it is a cpuless + * node and timeouts will not happen there. + */ + if (get_compact_nodeid() == cnode) { + LOCAL_HUB_S(PI_RT_EN_A, 1); + LOCAL_HUB_S(PI_RT_EN_B, 1); + LOCAL_HUB_S(PI_PROF_EN_A, 0); + LOCAL_HUB_S(PI_PROF_EN_B, 0); + ct_cur = CYCLES_PER_JIFFY; + LOCAL_HUB_S(PI_RT_COMPARE_A, ct_cur); + LOCAL_HUB_S(PI_RT_COUNT, 0); + LOCAL_HUB_S(PI_RT_PEND_A, 0); + LOCAL_HUB_S(PI_RT_COMPARE_B, ct_cur); + LOCAL_HUB_S(PI_RT_COUNT, 0); + LOCAL_HUB_S(PI_RT_PEND_B, 0); + } +} diff --git a/arch/mips64/tools/Makefile b/arch/mips64/tools/Makefile index 0fdcd92f8b6c..6a7d7de6bbed 100644 --- a/arch/mips64/tools/Makefile +++ b/arch/mips64/tools/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 1999/12/04 03:59:01 ralf Exp $ +# $Id: Makefile,v 1.1 1999/08/18 21:46:53 ralf Exp $ # # Makefile for MIPS kernel build tools. # diff --git a/arch/mips64/tools/offset.c b/arch/mips64/tools/offset.c index 9673dea80ca8..a8833e216a11 100644 --- a/arch/mips64/tools/offset.c +++ b/arch/mips64/tools/offset.c @@ -82,6 +82,7 @@ void output_task_defines(void) offset("#define TASK_COUNTER ", struct task_struct, counter); offset("#define TASK_PRIORITY ", struct task_struct, priority); offset("#define TASK_MM ", struct task_struct, mm); + offset("#define TASK_PROCESSOR ", struct task_struct, processor); size("#define TASK_STRUCT_SIZE ", struct task_struct); linefeed; } diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index df6ae2eda185..c4d525470064 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c @@ -2283,7 +2283,7 @@ static struct pci_device_id eni_pci_tbl[] __devinitdata = { 0, 0, 0 /* FPGA */ }, { PCI_VENDOR_ID_EF, PCI_DEVICE_ID_EF_ATM_ASIC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 /* ASIC */ }, - { 0 } + { 0, } }; MODULE_DEVICE_TABLE(pci,eni_pci_tbl); diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 04004d7fb28b..c6f8531f476d 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -19,8 +19,9 @@ */ -#define DAC960_DriverVersion "2.3.4" -#define DAC960_DriverDate "23 September 1999" +#define DAC960_DriverVersion "2.3.5" +#define DAC960_DriverDate "23 January 2000" + #include @@ -110,7 +111,7 @@ static void DAC960_AnnounceDriver(DAC960_Controller_T *Controller) DAC960_Announce("***** DAC960 RAID Driver Version " DAC960_DriverVersion " of " DAC960_DriverDate " *****\n", Controller); - DAC960_Announce("Copyright 1998-1999 by Leonard N. Zubkoff " + DAC960_Announce("Copyright 1998-2000 by Leonard N. Zubkoff " "\n", Controller); } @@ -183,6 +184,23 @@ static inline void DAC960_DeallocateCommand(DAC960_Command_T *Command) } +/* + DAC960_WaitForCommand waits for a wake_up on Controller's Command Wait Queue. +*/ + +static void DAC960_WaitForCommand(DAC960_Controller_T *Controller) +{ + DECLARE_WAITQUEUE(WaitQueueEntry, current); + add_wait_queue(&Controller->CommandWaitQueue, &WaitQueueEntry); + current->state = TASK_UNINTERRUPTIBLE; + spin_unlock(&io_request_lock); + schedule(); + current->state = TASK_RUNNING; + remove_wait_queue(&Controller->CommandWaitQueue, &WaitQueueEntry); + spin_lock_irq(&io_request_lock); +} + + /* DAC960_QueueCommand queues Command. */ @@ -306,6 +324,62 @@ static boolean DAC960_ExecuteType3D(DAC960_Controller_T *Controller, } +/* + DAC960_ReportErrorStatus reports Controller BIOS Messages passed through + the Error Status Register when the driver performs the BIOS handshaking. + It returns true for fatal errors and false otherwise. +*/ + +static boolean DAC960_ReportErrorStatus(DAC960_Controller_T *Controller, + unsigned char ErrorStatus, + unsigned char Parameter0, + unsigned char Parameter1) +{ + switch (ErrorStatus) + { + case 0x00: + DAC960_Notice("Physical Drive %d:%d Not Responding\n", + Controller, Parameter1, Parameter0); + break; + case 0x08: + if (Controller->DriveSpinUpMessageDisplayed) break; + DAC960_Notice("Spinning Up Drives\n", Controller); + Controller->DriveSpinUpMessageDisplayed = true; + break; + case 0x30: + DAC960_Notice("Configuration Checksum Error\n", Controller); + break; + case 0x60: + DAC960_Notice("Mirror Race Recovery Failed\n", Controller); + break; + case 0x70: + DAC960_Notice("Mirror Race Recovery In Progress\n", Controller); + break; + case 0x90: + DAC960_Notice("Physical Drive %d:%d COD Mismatch\n", + Controller, Parameter1, Parameter0); + break; + case 0xA0: + DAC960_Notice("Logical Drive Installation Aborted\n", Controller); + break; + case 0xB0: + DAC960_Notice("Mirror Race On A Critical Logical Drive\n", Controller); + break; + case 0xD0: + DAC960_Notice("New Controller Configuration Found\n", Controller); + break; + case 0xF0: + DAC960_Error("Fatal Memory Parity Error for Controller at\n", Controller); + return true; + default: + DAC960_Error("Unknown Initialization Error %02X for Controller at\n", + Controller, ErrorStatus); + return true; + } + return false; +} + + /* DAC960_EnableMemoryMailboxInterface enables the Memory Mailbox Interface. */ @@ -372,7 +446,7 @@ static boolean DAC960_EnableMemoryMailboxInterface(DAC960_Controller_T case DAC960_V5_Controller: while (--TimeoutCounter >= 0) { - if (DAC960_V5_HardwareMailboxEmptyP(ControllerBaseAddress)) + if (!DAC960_V5_HardwareMailboxFullP(ControllerBaseAddress)) break; udelay(10); } @@ -469,6 +543,9 @@ static void DAC960_DetectControllers(DAC960_ControllerType_T ControllerType) unsigned long BaseAddress1 = pci_resource_start (PCI_Device, 1); unsigned short SubsystemVendorID, SubsystemDeviceID; int CommandIdentifier; + unsigned char ErrorStatus, Parameter0, Parameter1; + void *BaseAddress; + if (pci_enable_device(PCI_Device)) goto Ignore; @@ -516,24 +593,6 @@ static void DAC960_DetectControllers(DAC960_ControllerType_T ControllerType) Controller->Device = Device; Controller->Function = Function; sprintf(Controller->ControllerName, "c%d", Controller->ControllerNumber); - /* - Acquire shared access to the IRQ Channel. - */ - if (IRQ_Channel == 0) - { - DAC960_Error("IRQ Channel %d illegal for Controller at\n", - Controller, IRQ_Channel); - goto Failure; - } - strcpy(Controller->FullModelName, "DAC960"); - if (request_irq(IRQ_Channel, DAC960_InterruptHandler, - SA_SHIRQ, Controller->FullModelName, Controller) < 0) - { - DAC960_Error("Unable to acquire IRQ Channel %d for Controller at\n", - Controller, IRQ_Channel); - goto Failure; - } - Controller->IRQ_Channel = IRQ_Channel; /* Map the Controller Register Window. */ @@ -549,34 +608,87 @@ static void DAC960_DetectControllers(DAC960_ControllerType_T ControllerType) "Controller at\n", Controller); goto Failure; } + BaseAddress = Controller->BaseAddress; switch (ControllerType) { case DAC960_V5_Controller: - DAC960_V5_DisableInterrupts(Controller->BaseAddress); + DAC960_V5_DisableInterrupts(BaseAddress); + DAC960_V5_AcknowledgeHardwareMailboxStatus(BaseAddress); + udelay(1000); + while (DAC960_V5_InitializationInProgressP(BaseAddress)) + { + if (DAC960_V5_ReadErrorStatus(BaseAddress, &ErrorStatus, + &Parameter0, &Parameter1) && + DAC960_ReportErrorStatus(Controller, ErrorStatus, + Parameter0, Parameter1)) + goto Failure; + udelay(10); + } if (!DAC960_EnableMemoryMailboxInterface(Controller)) { DAC960_Error("Unable to Enable Memory Mailbox Interface " "for Controller at\n", Controller); goto Failure; } - DAC960_V5_EnableInterrupts(Controller->BaseAddress); + DAC960_V5_EnableInterrupts(BaseAddress); break; case DAC960_V4_Controller: - DAC960_V4_DisableInterrupts(Controller->BaseAddress); + DAC960_V4_DisableInterrupts(BaseAddress); + DAC960_V4_AcknowledgeHardwareMailboxStatus(BaseAddress); + udelay(1000); + while (DAC960_V4_InitializationInProgressP(BaseAddress)) + { + if (DAC960_V4_ReadErrorStatus(BaseAddress, &ErrorStatus, + &Parameter0, &Parameter1) && + DAC960_ReportErrorStatus(Controller, ErrorStatus, + Parameter0, Parameter1)) + goto Failure; + udelay(10); + } if (!DAC960_EnableMemoryMailboxInterface(Controller)) { DAC960_Error("Unable to Enable Memory Mailbox Interface " "for Controller at\n", Controller); goto Failure; } - DAC960_V4_EnableInterrupts(Controller->BaseAddress); + DAC960_V4_EnableInterrupts(BaseAddress); break; case DAC960_V3_Controller: request_region(Controller->IO_Address, 0x80, Controller->FullModelName); - DAC960_V3_EnableInterrupts(Controller->BaseAddress); + DAC960_V3_DisableInterrupts(BaseAddress); + DAC960_V3_AcknowledgeStatus(BaseAddress); + udelay(1000); + while (DAC960_V3_InitializationInProgressP(BaseAddress)) + { + if (DAC960_V3_ReadErrorStatus(BaseAddress, &ErrorStatus, + &Parameter0, &Parameter1) && + DAC960_ReportErrorStatus(Controller, ErrorStatus, + Parameter0, Parameter1)) + goto Failure; + udelay(10); + } + DAC960_V3_EnableInterrupts(BaseAddress); break; } + /* + Acquire shared access to the IRQ Channel. + */ + if (IRQ_Channel == 0) + { + DAC960_Error("IRQ Channel %d illegal for Controller at\n", + Controller, IRQ_Channel); + goto Failure; + } + strcpy(Controller->FullModelName, "DAC960"); + if (request_irq(IRQ_Channel, DAC960_InterruptHandler, + SA_SHIRQ, Controller->FullModelName, Controller) < 0) + { + DAC960_Error("Unable to acquire IRQ Channel %d for Controller at\n", + Controller, IRQ_Channel); + goto Failure; + } + Controller->IRQ_Channel = IRQ_Channel; DAC960_ActiveControllerCount++; for (CommandIdentifier = 0; CommandIdentifier < DAC960_MaxChannels; @@ -597,11 +709,11 @@ static void DAC960_DetectControllers(DAC960_ControllerType_T ControllerType) "0x%X PCI Address 0x%X\n", Controller, Bus, Device, Function, IO_Address, PCI_Address); if (Controller == NULL) break; - if (Controller->IRQ_Channel > 0) - free_irq(IRQ_Channel, Controller); if (Controller->MemoryMappedAddress != NULL) iounmap(Controller->MemoryMappedAddress); DAC960_Controllers[Controller->ControllerNumber] = NULL; + if (Controller->IRQ_Channel > 0) + free_irq(IRQ_Channel, Controller); Ignore: kfree(Controller); } @@ -1346,9 +1458,7 @@ static boolean DAC960_ProcessRequest(DAC960_Controller_T *Controller, Command = DAC960_AllocateCommand(Controller); if (Command != NULL) break; if (!WaitForCommand) return false; - spin_unlock(&io_request_lock); - sleep_on(&Controller->CommandWaitQueue); - spin_lock_irq(&io_request_lock); + DAC960_WaitForCommand(Controller); } DAC960_ClearCommand(Command); if (Request->cmd == READ) @@ -1900,6 +2010,20 @@ static void DAC960_ProcessCompletedCommand(DAC960_Command_T *Command) } else if (NewEnquiry->RebuildFlag == DAC960_BackgroundCheckInProgress) Controller->NeedConsistencyCheckProgress = true; + if (CommandType != DAC960_MonitoringCommand && + Controller->RebuildFlagPending) + { + DAC960_Enquiry_T *Enquiry = (DAC960_Enquiry_T *) + Bus_to_Virtual(Command->CommandMailbox.Type3.BusAddress); + Enquiry->RebuildFlag = Controller->PendingRebuildFlag; + Controller->RebuildFlagPending = false; + } + else if (CommandType == DAC960_MonitoringCommand && + NewEnquiry->RebuildFlag > DAC960_BackgroundCheckInProgress) + { + Controller->PendingRebuildFlag = NewEnquiry->RebuildFlag; + Controller->RebuildFlagPending = true; + } } else if (CommandOpcode == DAC960_PerformEventLogOperation) { @@ -2083,6 +2207,9 @@ static void DAC960_ProcessCompletedCommand(DAC960_Command_T *Command) Controller->RebuildProgress.LogicalDriveSize; unsigned int BlocksCompleted = LogicalDriveSize - Controller->RebuildProgress.RemainingBlocks; + if (CommandStatus == DAC960_NoRebuildOrCheckInProgress && + Controller->LastRebuildStatus == DAC960_NormalCompletion) + CommandStatus = DAC960_RebuildSuccessful; switch (CommandStatus) { case DAC960_NormalCompletion: @@ -2110,13 +2237,28 @@ static void DAC960_ProcessCompletedCommand(DAC960_Command_T *Command) "Failure of Drive Being Rebuilt\n", Controller); break; case DAC960_NoRebuildOrCheckInProgress: - if (Controller->LastRebuildStatus != DAC960_NormalCompletion) - break; + break; case DAC960_RebuildSuccessful: DAC960_Progress("Rebuild Completed Successfully\n", Controller); break; + case DAC960_RebuildSuccessfullyTerminated: + DAC960_Progress("Rebuild Successfully Terminated\n", Controller); + break; } Controller->LastRebuildStatus = CommandStatus; + if (CommandType != DAC960_MonitoringCommand && + Controller->RebuildStatusPending) + { + Command->CommandStatus = Controller->PendingRebuildStatus; + Controller->RebuildStatusPending = false; + } + else if (CommandType == DAC960_MonitoringCommand && + CommandStatus != DAC960_NormalCompletion && + CommandStatus != DAC960_NoRebuildOrCheckInProgress) + { + Controller->PendingRebuildStatus = CommandStatus; + Controller->RebuildStatusPending = true; + } } else if (CommandOpcode == DAC960_RebuildStat) { @@ -2331,7 +2473,7 @@ static void DAC960_ProcessCompletedCommand(DAC960_Command_T *Command) if (CommandType == DAC960_QueuedCommand) { DAC960_KernelCommand_T *KernelCommand = Command->KernelCommand; - KernelCommand->CommandStatus = CommandStatus; + KernelCommand->CommandStatus = Command->CommandStatus; Command->KernelCommand = NULL; if (CommandOpcode == DAC960_DCDB) Controller->DirectCommandActive[KernelCommand->DCDB->Channel] @@ -2352,9 +2494,12 @@ static void DAC960_ProcessCompletedCommand(DAC960_Command_T *Command) return; } /* - Deallocate the Command, and wake up any processes waiting on a free Command. + Deallocate the Command. */ DAC960_DeallocateCommand(Command); + /* + Wake up any processes waiting on a free Command. + */ wake_up(&Controller->CommandWaitQueue); } @@ -2761,19 +2906,14 @@ static int DAC960_UserIOCTL(Inode_T *Inode, File_T *File, } if (CommandOpcode == DAC960_DCDB) { - while (true) - { - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); - if (!Controller->DirectCommandActive[DCDB.Channel] - [DCDB.TargetID]) - Command = DAC960_AllocateCommand(Controller); - if (Command != NULL) - Controller->DirectCommandActive[DCDB.Channel] - [DCDB.TargetID] = true; - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); - if (Command != NULL) break; - sleep_on(&Controller->CommandWaitQueue); - } + DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + while (Controller->DirectCommandActive[DCDB.Channel] + [DCDB.TargetID] || + (Command = DAC960_AllocateCommand(Controller)) == NULL) + DAC960_WaitForCommand(Controller); + Controller->DirectCommandActive[DCDB.Channel] + [DCDB.TargetID] = true; + DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); DAC960_ClearCommand(Command); Command->CommandType = DAC960_ImmediateCommand; memcpy(&Command->CommandMailbox, &UserCommand.CommandMailbox, @@ -2783,14 +2923,10 @@ static int DAC960_UserIOCTL(Inode_T *Inode, File_T *File, } else { - while (true) - { - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); - Command = DAC960_AllocateCommand(Controller); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); - if (Command != NULL) break; - sleep_on(&Controller->CommandWaitQueue); - } + DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + while ((Command = DAC960_AllocateCommand(Controller)) == NULL) + DAC960_WaitForCommand(Controller); + DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); DAC960_ClearCommand(Command); Command->CommandType = DAC960_ImmediateCommand; memcpy(&Command->CommandMailbox, &UserCommand.CommandMailbox, @@ -3194,14 +3330,10 @@ static boolean DAC960_ExecuteUserCommand(DAC960_Controller_T *Controller, DAC960_CommandMailbox_T *CommandMailbox; ProcessorFlags_T ProcessorFlags; unsigned char Channel, TargetID, LogicalDriveNumber; - while (true) - { - DAC960_AcquireControllerLock(Controller, &ProcessorFlags); - Command = DAC960_AllocateCommand(Controller); - DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); - if (Command != NULL) break; - sleep_on(&Controller->CommandWaitQueue); - } + DAC960_AcquireControllerLock(Controller, &ProcessorFlags); + while ((Command = DAC960_AllocateCommand(Controller)) == NULL) + DAC960_WaitForCommand(Controller); + DAC960_ReleaseControllerLock(Controller, &ProcessorFlags); Controller->UserStatusLength = 0; DAC960_ClearCommand(Command); Command->CommandType = DAC960_ImmediateCommand; diff --git a/drivers/block/DAC960.h b/drivers/block/DAC960.h index e93448faba1e..d748f0982bc6 100644 --- a/drivers/block/DAC960.h +++ b/drivers/block/DAC960.h @@ -55,17 +55,17 @@ typedef enum { false, true } __attribute__ ((packed)) boolean; /* - Define a 32 bit I/O Address data type. + Define a 32/64 bit I/O Address data type. */ -typedef unsigned int DAC960_IO_Address_T; +typedef unsigned long DAC960_IO_Address_T; /* - Define a 32 bit PCI Bus Address data type. + Define a 32/64 bit PCI Bus Address data type. */ -typedef unsigned int DAC960_PCI_Address_T; +typedef unsigned long DAC960_PCI_Address_T; /* @@ -196,6 +196,7 @@ typedef unsigned char DAC960_CommandIdentifier_T; #define DAC960_RebuildFailed_BadBlocksOnOther 0x0003 /* Consistency */ #define DAC960_RebuildFailed_NewDriveFailed 0x0004 /* Consistency */ #define DAC960_RebuildSuccessful 0x0100 /* Consistency */ +#define DAC960_RebuildSuccessfullyTerminated 0x0107 /* Consistency */ #define DAC960_AddCapacityInProgress 0x0004 /* Consistency */ #define DAC960_AddCapacityFailedOrSuspended 0x00F4 /* Consistency */ #define DAC960_Config2ChecksumError 0x0002 /* Configuration */ @@ -513,7 +514,7 @@ typedef struct DAC960_DeviceState unsigned char SynchronousMultiplier; /* Byte 4 */ unsigned char SynchronousOffset:5; /* Byte 5 Bits 0-4 */ unsigned char :3; /* Byte 5 Bits 5-7 */ - unsigned long DiskSize __attribute__ ((packed)); /* Bytes 6-9 */ + unsigned int DiskSize __attribute__ ((packed)); /* Bytes 6-9 */ } DAC960_DeviceState_T; @@ -1212,6 +1213,7 @@ typedef struct DAC960_Controller unsigned char LogicalDriveCount; unsigned char GeometryTranslationHeads; unsigned char GeometryTranslationSectors; + unsigned char PendingRebuildFlag; unsigned short ControllerQueueDepth; unsigned short DriverQueueDepth; unsigned short MaxBlocksPerCommand; @@ -1247,6 +1249,9 @@ typedef struct DAC960_Controller boolean NeedRebuildProgress; boolean NeedConsistencyCheckProgress; boolean EphemeralProgressMessage; + boolean RebuildFlagPending; + boolean RebuildStatusPending; + boolean DriveSpinUpMessageDisplayed; Timer_T MonitoringTimer; GenericDiskInfo_T GenericDiskInfo; DAC960_Command_T *FreeCommands; @@ -1265,6 +1270,7 @@ typedef struct DAC960_Controller DAC960_EventLogEntry_T EventLogEntry; DAC960_RebuildProgress_T RebuildProgress; DAC960_CommandStatus_T LastRebuildStatus; + DAC960_CommandStatus_T PendingRebuildStatus; DAC960_LogicalDriveInformation_T LogicalDriveInformation[2][DAC960_MaxLogicalDrives]; DAC960_LogicalDriveState_T LogicalDriveInitialState[DAC960_MaxLogicalDrives]; @@ -1389,7 +1395,8 @@ typedef enum DAC960_V5_MailboxRegister11Offset = 0x5B, DAC960_V5_MailboxRegister12Offset = 0x5C, DAC960_V5_StatusCommandIdentifierRegOffset = 0x5D, - DAC960_V5_StatusRegisterOffset = 0x5E + DAC960_V5_StatusRegisterOffset = 0x5E, + DAC960_V5_ErrorStatusRegisterOffset = 0x63 } DAC960_V5_RegisterOffsets_T; @@ -1411,7 +1418,8 @@ typedef union DAC960_V5_InboundDoorBellRegister } Write; struct { boolean HardwareMailboxEmpty:1; /* Bit 0 */ - unsigned char :7; /* Bits 1-7 */ + boolean InitializationNotInProgress:1; /* Bit 1 */ + unsigned char :6; /* Bits 2-7 */ } Read; } DAC960_V5_InboundDoorBellRegister_T; @@ -1454,6 +1462,22 @@ typedef union DAC960_V5_InterruptMaskRegister DAC960_V5_InterruptMaskRegister_T; +/* + Define the structure of the DAC960 V5 Error Status Register. +*/ + +typedef union DAC960_V5_ErrorStatusRegister +{ + unsigned char All; + struct { + unsigned int :2; /* Bits 0-1 */ + boolean ErrorStatusPending:1; /* Bit 2 */ + unsigned int :5; /* Bits 3-7 */ + } Bits; +} +DAC960_V5_ErrorStatusRegister_T; + + /* Define inline functions to provide an abstraction for reading and writing the DAC960 V5 Controller Interface Registers. @@ -1510,12 +1534,21 @@ void DAC960_V5_MemoryMailboxNewCommand(void *ControllerBaseAddress) } static inline -boolean DAC960_V5_HardwareMailboxEmptyP(void *ControllerBaseAddress) +boolean DAC960_V5_HardwareMailboxFullP(void *ControllerBaseAddress) +{ + DAC960_V5_InboundDoorBellRegister_T InboundDoorBellRegister; + InboundDoorBellRegister.All = + readb(ControllerBaseAddress + DAC960_V5_InboundDoorBellRegisterOffset); + return !InboundDoorBellRegister.Read.HardwareMailboxEmpty; +} + +static inline +boolean DAC960_V5_InitializationInProgressP(void *ControllerBaseAddress) { DAC960_V5_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = readb(ControllerBaseAddress + DAC960_V5_InboundDoorBellRegisterOffset); - return InboundDoorBellRegister.Read.HardwareMailboxEmpty; + return !InboundDoorBellRegister.Read.InitializationNotInProgress; } static inline @@ -1571,7 +1604,7 @@ static inline void DAC960_V5_EnableInterrupts(void *ControllerBaseAddress) { DAC960_V5_InterruptMaskRegister_T InterruptMaskRegister; - InterruptMaskRegister.All = 0; + InterruptMaskRegister.All = 0xFF; InterruptMaskRegister.Bits.DisableInterrupts = false; writeb(InterruptMaskRegister.All, ControllerBaseAddress + DAC960_V5_InterruptMaskRegisterOffset); @@ -1581,7 +1614,7 @@ static inline void DAC960_V5_DisableInterrupts(void *ControllerBaseAddress) { DAC960_V5_InterruptMaskRegister_T InterruptMaskRegister; - InterruptMaskRegister.All = 0; + InterruptMaskRegister.All = 0xFF; InterruptMaskRegister.Bits.DisableInterrupts = true; writeb(InterruptMaskRegister.All, ControllerBaseAddress + DAC960_V5_InterruptMaskRegisterOffset); @@ -1603,7 +1636,9 @@ void DAC960_V5_WriteCommandMailbox(DAC960_CommandMailbox_T *NextCommandMailbox, NextCommandMailbox->Words[1] = CommandMailbox->Words[1]; NextCommandMailbox->Words[2] = CommandMailbox->Words[2]; NextCommandMailbox->Words[3] = CommandMailbox->Words[3]; + wmb(); NextCommandMailbox->Words[0] = CommandMailbox->Words[0]; + mb(); } static inline @@ -1633,6 +1668,26 @@ DAC960_V5_ReadStatusRegister(void *ControllerBaseAddress) return readw(ControllerBaseAddress + DAC960_V5_StatusRegisterOffset); } +static inline boolean +DAC960_V5_ReadErrorStatus(void *ControllerBaseAddress, + unsigned char *ErrorStatus, + unsigned char *Parameter0, + unsigned char *Parameter1) +{ + DAC960_V5_ErrorStatusRegister_T ErrorStatusRegister; + ErrorStatusRegister.All = + readb(ControllerBaseAddress + DAC960_V5_ErrorStatusRegisterOffset); + if (!ErrorStatusRegister.Bits.ErrorStatusPending) return false; + ErrorStatusRegister.Bits.ErrorStatusPending = false; + *ErrorStatus = ErrorStatusRegister.All; + *Parameter0 = + readb(ControllerBaseAddress + DAC960_V5_CommandOpcodeRegisterOffset); + *Parameter1 = + readb(ControllerBaseAddress + DAC960_V5_CommandIdentifierRegisterOffset); + writeb(0xFF, ControllerBaseAddress + DAC960_V5_ErrorStatusRegisterOffset); + return true; +} + static inline void DAC960_V5_SaveMemoryMailboxInfo(DAC960_Controller_T *Controller) { @@ -1691,7 +1746,8 @@ typedef enum DAC960_V4_MailboxRegister11Offset = 0x100B, DAC960_V4_MailboxRegister12Offset = 0x100C, DAC960_V4_StatusCommandIdentifierRegOffset = 0x1018, - DAC960_V4_StatusRegisterOffset = 0x101A + DAC960_V4_StatusRegisterOffset = 0x101A, + DAC960_V4_ErrorStatusRegisterOffset = 0x103F } DAC960_V4_RegisterOffsets_T; @@ -1713,7 +1769,8 @@ typedef union DAC960_V4_InboundDoorBellRegister } Write; struct { boolean HardwareMailboxFull:1; /* Bit 0 */ - unsigned int :31; /* Bits 1-31 */ + boolean InitializationInProgress:1; /* Bit 1 */ + unsigned int :30; /* Bits 2-31 */ } Read; } DAC960_V4_InboundDoorBellRegister_T; @@ -1757,6 +1814,22 @@ typedef union DAC960_V4_InterruptMaskRegister DAC960_V4_InterruptMaskRegister_T; +/* + Define the structure of the DAC960 V4 Error Status Register. +*/ + +typedef union DAC960_V4_ErrorStatusRegister +{ + unsigned char All; + struct { + unsigned int :2; /* Bits 0-1 */ + boolean ErrorStatusPending:1; /* Bit 2 */ + unsigned int :5; /* Bits 3-7 */ + } Bits; +} +DAC960_V4_ErrorStatusRegister_T; + + /* Define inline functions to provide an abstraction for reading and writing the DAC960 V4 Controller Interface Registers. @@ -1821,6 +1894,15 @@ boolean DAC960_V4_HardwareMailboxFullP(void *ControllerBaseAddress) return InboundDoorBellRegister.Read.HardwareMailboxFull; } +static inline +boolean DAC960_V4_InitializationInProgressP(void *ControllerBaseAddress) +{ + DAC960_V4_InboundDoorBellRegister_T InboundDoorBellRegister; + InboundDoorBellRegister.All = + readl(ControllerBaseAddress + DAC960_V4_InboundDoorBellRegisterOffset); + return InboundDoorBellRegister.Read.InitializationInProgress; +} + static inline void DAC960_V4_AcknowledgeHardwareMailboxInterrupt(void *ControllerBaseAddress) { @@ -1910,7 +1992,9 @@ void DAC960_V4_WriteCommandMailbox(DAC960_CommandMailbox_T *NextCommandMailbox, NextCommandMailbox->Words[1] = CommandMailbox->Words[1]; NextCommandMailbox->Words[2] = CommandMailbox->Words[2]; NextCommandMailbox->Words[3] = CommandMailbox->Words[3]; + wmb(); NextCommandMailbox->Words[0] = CommandMailbox->Words[0]; + mb(); } static inline @@ -1940,11 +2024,31 @@ DAC960_V4_ReadStatusRegister(void *ControllerBaseAddress) return readw(ControllerBaseAddress + DAC960_V4_StatusRegisterOffset); } +static inline boolean +DAC960_V4_ReadErrorStatus(void *ControllerBaseAddress, + unsigned char *ErrorStatus, + unsigned char *Parameter0, + unsigned char *Parameter1) +{ + DAC960_V4_ErrorStatusRegister_T ErrorStatusRegister; + ErrorStatusRegister.All = + readb(ControllerBaseAddress + DAC960_V4_ErrorStatusRegisterOffset); + if (!ErrorStatusRegister.Bits.ErrorStatusPending) return false; + ErrorStatusRegister.Bits.ErrorStatusPending = false; + *ErrorStatus = ErrorStatusRegister.All; + *Parameter0 = + readb(ControllerBaseAddress + DAC960_V4_CommandOpcodeRegisterOffset); + *Parameter1 = + readb(ControllerBaseAddress + DAC960_V4_CommandIdentifierRegisterOffset); + writeb(0, ControllerBaseAddress + DAC960_V4_ErrorStatusRegisterOffset); + return true; +} + static inline void DAC960_V4_SaveMemoryMailboxInfo(DAC960_Controller_T *Controller) { void *ControllerBaseAddress = Controller->BaseAddress; - writel(0xAABBFFFF, + writel(0x743C485E, ControllerBaseAddress + DAC960_V4_CommandOpcodeRegisterOffset); writel((unsigned long) Controller->FirstCommandMailbox, ControllerBaseAddress + DAC960_V4_MailboxRegister4Offset); @@ -1962,7 +2066,7 @@ void DAC960_V4_RestoreMemoryMailboxInfo(DAC960_Controller_T *Controller, { void *ControllerBaseAddress = Controller->BaseAddress; if (readl(ControllerBaseAddress - + DAC960_V4_CommandOpcodeRegisterOffset) != 0xAABBFFFF) + + DAC960_V4_CommandOpcodeRegisterOffset) != 0x743C485E) return; *MemoryMailboxAddress = (void *) readl(ControllerBaseAddress + DAC960_V4_MailboxRegister4Offset); @@ -1996,6 +2100,7 @@ typedef enum DAC960_V3_MailboxRegister12Offset = 0x0C, DAC960_V3_StatusCommandIdentifierRegOffset = 0x0D, DAC960_V3_StatusRegisterOffset = 0x0E, + DAC960_V3_ErrorStatusRegisterOffset = 0x3F, DAC960_V3_InboundDoorBellRegisterOffset = 0x40, DAC960_V3_OutboundDoorBellRegisterOffset = 0x41, DAC960_V3_InterruptEnableRegisterOffset = 0x43 @@ -2019,7 +2124,8 @@ typedef union DAC960_V3_InboundDoorBellRegister } Write; struct { boolean MailboxFull:1; /* Bit 0 */ - unsigned char :7; /* Bits 1-7 */ + boolean InitializationInProgress:1; /* Bit 1 */ + unsigned char :6; /* Bits 2-7 */ } Read; } DAC960_V3_InboundDoorBellRegister_T; @@ -2059,6 +2165,22 @@ typedef union DAC960_V3_InterruptEnableRegister DAC960_V3_InterruptEnableRegister_T; +/* + Define the structure of the DAC960 V3 Error Status Register. +*/ + +typedef union DAC960_V3_ErrorStatusRegister +{ + unsigned char All; + struct { + unsigned int :2; /* Bits 0-1 */ + boolean ErrorStatusPending:1; /* Bit 2 */ + unsigned int :5; /* Bits 3-7 */ + } Bits; +} +DAC960_V3_ErrorStatusRegister_T; + + /* Define inline functions to provide an abstraction for reading and writing the DAC960 V3 Controller Interface Registers. @@ -2113,6 +2235,15 @@ boolean DAC960_V3_MailboxFullP(void *ControllerBaseAddress) return InboundDoorBellRegister.Read.MailboxFull; } +static inline +boolean DAC960_V3_InitializationInProgressP(void *ControllerBaseAddress) +{ + DAC960_V3_InboundDoorBellRegister_T InboundDoorBellRegister; + InboundDoorBellRegister.All = + readb(ControllerBaseAddress + DAC960_V3_InboundDoorBellRegisterOffset); + return InboundDoorBellRegister.Read.InitializationInProgress; +} + static inline void DAC960_V3_AcknowledgeInterrupt(void *ControllerBaseAddress) { @@ -2188,6 +2319,26 @@ DAC960_V3_ReadStatusRegister(void *ControllerBaseAddress) return readw(ControllerBaseAddress + DAC960_V3_StatusRegisterOffset); } +static inline boolean +DAC960_V3_ReadErrorStatus(void *ControllerBaseAddress, + unsigned char *ErrorStatus, + unsigned char *Parameter0, + unsigned char *Parameter1) +{ + DAC960_V3_ErrorStatusRegister_T ErrorStatusRegister; + ErrorStatusRegister.All = + readb(ControllerBaseAddress + DAC960_V3_ErrorStatusRegisterOffset); + if (!ErrorStatusRegister.Bits.ErrorStatusPending) return false; + ErrorStatusRegister.Bits.ErrorStatusPending = false; + *ErrorStatus = ErrorStatusRegister.All; + *Parameter0 = + readb(ControllerBaseAddress + DAC960_V3_CommandOpcodeRegisterOffset); + *Parameter1 = + readb(ControllerBaseAddress + DAC960_V3_CommandIdentifierRegisterOffset); + writeb(0, ControllerBaseAddress + DAC960_V3_ErrorStatusRegisterOffset); + return true; +} + /* Define compatibility macros between Linux 2.0 and Linux 2.1. diff --git a/drivers/char/epca.c b/drivers/char/epca.c index dd94223bc070..6763b068a21c 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c @@ -4075,14 +4075,15 @@ err_out: } -static struct pci_device_id epca_pci_tbl[] __initdata = { +static struct pci_device_id epca_pci_tbl[] __devinitdata = { { PCI_VENDOR_DIGI, PCI_DEVICE_XR, PCI_ANY_ID, PCI_ANY_ID, 0, 0, brd_xr }, { PCI_VENDOR_DIGI, PCI_DEVICE_XEM, PCI_ANY_ID, PCI_ANY_ID, 0, 0, brd_xem }, { PCI_VENDOR_DIGI, PCI_DEVICE_CX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, brd_cx }, { PCI_VENDOR_DIGI, PCI_DEVICE_XRJ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, brd_xrj }, - { 0, }, /* terminate list */ + { 0, } }; +MODULE_DEVICE_TABLE(pci, epca_pci_tbl); int __init init_PCI (void) { /* Begin init_PCI */ diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index c5fcec9bc404..d90732d8a2bb 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c @@ -423,7 +423,7 @@ static struct pci_device_id vortex_pci_tbl[] __devinitdata = { { 0x10B7, 0x6560, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3CCFE656 }, { 0x10B7, 0x6562, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3CCFEM656 }, { 0x10B7, 0x4500, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C450 }, - {0,}, /* 0 terminated list. */ + {0,} /* 0 terminated list. */ }; MODULE_DEVICE_TABLE(pci, vortex_pci_tbl); diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 9a5b25038f50..5a148b633e00 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c @@ -201,7 +201,7 @@ static struct pci_device_id rtl8139_pci_tbl[] __devinitdata = { /* {0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MPX5030 },*/ {0x1500, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DELTA8139 }, {0x4033, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ADDTRON8139 }, - {0,}, + {0,} }; MODULE_DEVICE_TABLE (pci, rtl8139_pci_tbl); diff --git a/drivers/net/Config.in b/drivers/net/Config.in index 7aaeb9398d2f..a02829c249e0 100644 --- a/drivers/net/Config.in +++ b/drivers/net/Config.in @@ -218,7 +218,7 @@ if [ ! "$CONFIG_PPP" = "n" ]; then dep_tristate ' PPP support for async serial ports' CONFIG_PPP_ASYNC $CONFIG_PPP dep_tristate ' PPP support for sync tty ports' CONFIG_PPP_SYNC_TTY $CONFIG_PPP dep_tristate ' PPP Deflate compression' CONFIG_PPP_DEFLATE $CONFIG_PPP - dep_tristate ' PPP BSD-Compress compression' CONFIG_PPP_BSDCOMP + dep_tristate ' PPP BSD-Compress compression' CONFIG_PPP_BSDCOMP $CONFIG_PPP if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then dep_tristate ' PPP over Ethernet (EXPERIMENTAL)' CONFIG_PPPOE $CONFIG_PPP fi diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c index 02331da24971..d36f74aa8675 100644 --- a/drivers/net/arcnet/arc-rimi.c +++ b/drivers/net/arcnet/arc-rimi.c @@ -345,9 +345,8 @@ static int __init arcrimi_setup(char *s) s = get_options(s, 8, ints); if (!ints[0]) return 1; - dev = alloc_bootmem(sizeof(struct net_device) + 10); - memset(dev, 0, sizeof(struct net_device) + 10); - dev->name = (char *) (dev + 1); + dev = alloc_bootmem(sizeof(struct net_device)); + memset(dev, 0, sizeof(struct net_device)); dev->init = arcrimi_probe; switch (ints[0]) { diff --git a/drivers/net/arcnet/com20020-isa.c b/drivers/net/arcnet/com20020-isa.c index 7f8a022bf626..9363422188c8 100644 --- a/drivers/net/arcnet/com20020-isa.c +++ b/drivers/net/arcnet/com20020-isa.c @@ -194,10 +194,9 @@ static int __init com20020isa_setup(char *s) s = get_options(s, 8, ints); if (!ints[0]) return 1; - dev = alloc_bootmem(sizeof(struct net_device) + sizeof(struct arcnet_local) + 10); - memset(dev, 0, sizeof(struct net_device) + sizeof(struct arcnet_local) + 10); + dev = alloc_bootmem(sizeof(struct net_device) + sizeof(struct arcnet_local)); + memset(dev, 0, sizeof(struct net_device) + sizeof(struct arcnet_local)); lp = dev->priv = (struct arcnet_local *) (dev + 1); - dev->name = (char *) (lp + 1); dev->init = com20020isa_probe; switch (ints[0]) { diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c index f468f38292e3..0c92cc4d2471 100644 --- a/drivers/net/arcnet/com20020-pci.c +++ b/drivers/net/arcnet/com20020-pci.c @@ -139,7 +139,9 @@ static struct pci_device_id com20020pci_id_table[] __devinitdata = { {0,} }; -static struct pci_driver com20020pci_driver __devinitdata = { +MODULE_DEVICE_TABLE(pci, com20020pci_id_table); + +static struct pci_driver com20020pci_driver = { name: "com20020", id_table: com20020pci_id_table, probe: com20020pci_probe, diff --git a/drivers/net/arcnet/com90io.c b/drivers/net/arcnet/com90io.c index aca9635aef8a..24ba13ef2311 100644 --- a/drivers/net/arcnet/com90io.c +++ b/drivers/net/arcnet/com90io.c @@ -428,9 +428,8 @@ static int __init com90io_setup(char *s) s = get_options(s, 4, ints); if (!ints[0]) return 0; - dev = alloc_bootmem(sizeof(struct net_device) + 10); - memset(dev, 0, sizeof(struct net_device) + 10); - dev->name = (char *) (dev + 1); + dev = alloc_bootmem(sizeof(struct net_device)); + memset(dev, 0, sizeof(struct net_device)); dev->init = com90io_probe; switch (ints[0]) { diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c index 7293a16f89ba..97f8d0a41c5c 100644 --- a/drivers/net/arcnet/com90xx.c +++ b/drivers/net/arcnet/com90xx.c @@ -677,9 +677,8 @@ static int __init com90xx_setup(char *s) printk("com90xx: Disabled.\n"); return 1; } - dev = alloc_bootmem(sizeof(struct net_device) + 10); - memset(dev, 0, sizeof(struct net_device) + 10); - dev->name = (char *) (dev + 1); + dev = alloc_bootmem(sizeof(struct net_device)); + memset(dev, 0, sizeof(struct net_device)); dev->init = com90xx_probe; switch (ints[0]) { diff --git a/drivers/net/bagetlance.c b/drivers/net/bagetlance.c index 19c7dd255dba..eeb6b77c519c 100644 --- a/drivers/net/bagetlance.c +++ b/drivers/net/bagetlance.c @@ -1,4 +1,4 @@ -/* $Id: bagetlance.c,v 1.2 1999/10/09 00:01:21 ralf Exp $ +/* $Id$ * vmelance.c: Ethernet driver for VME Lance cards on Baget/MIPS * This code stealed and adopted from linux/drivers/net/atarilance.c * See that for author info diff --git a/drivers/net/declance.c b/drivers/net/declance.c index 4964a3fe0dcd..d7aa8927d0e7 100644 --- a/drivers/net/declance.c +++ b/drivers/net/declance.c @@ -256,6 +256,8 @@ struct lance_private { volatile struct lance_init_block *init_block; volatile unsigned long *dma_ptr_reg; + spinlock_t lock; + int rx_new, tx_new; int rx_old, tx_old; @@ -265,6 +267,7 @@ struct lance_private { struct net_device *dev; /* Backpointer */ struct lance_private *next_module; + struct timer_list multicast_timer; /* Pointers to the ring buffers as seen from the CPU */ char *rx_buf_ptr_cpu[RX_RING_SIZE]; @@ -443,7 +446,6 @@ void cp_from_buf(void *to, unsigned char *from, int len) } /* Setup the Lance Rx and Tx rings */ -/* Sets dev->tbusy */ static void lance_init_ring(struct net_device *dev) { struct lance_private *lp = (struct lance_private *) dev->priv; @@ -454,12 +456,10 @@ static void lance_init_ring(struct net_device *dev) ib = (struct lance_init_block *) (dev->mem_start); /* Lock out other processes while setting up hardware */ - dev->tbusy = 1; + netif_stop_queue(dev); lp->rx_new = lp->tx_new = 0; lp->rx_old = lp->tx_old = 0; - ib->mode = 0; - /* Copy the ethernet address to the lance init block. * XXX bit 0 of the physical address registers has to be zero */ @@ -485,11 +485,6 @@ static void lance_init_ring(struct net_device *dev) if (ZERO) printk("TX ptr: %8.8x(%8.8x)\n", leptr, libdesc_offset(btx_ring, 0)); - /* Clear the multicast filter */ - ib->filter[0] = 0; - ib->filter[2] = 0; - ib->filter[4] = 0; - ib->filter[6] = 0; if (ZERO) printk("TX rings:\n"); @@ -630,7 +625,7 @@ static int lance_rx(struct net_device *dev) return 0; } -static int lance_tx(struct net_device *dev) +static void lance_tx(struct net_device *dev) { struct lance_private *lp = (struct lance_private *) dev->priv; volatile struct lance_init_block *ib; @@ -641,6 +636,8 @@ static int lance_tx(struct net_device *dev) ib = (struct lance_init_block *) (dev->mem_start); j = lp->tx_old; + spin_lock(&lp->lock); + for (i = j; i != lp->tx_new; i = j) { td = &ib->btx_ring[i]; /* If we hit a packet not owned by us, stop */ @@ -665,7 +662,7 @@ static int lance_tx(struct net_device *dev) lance_init_ring(dev); load_csrs(lp); init_restart_lance(lp); - return 0; + goto out; } /* Buffer errors and underflows turn off the * transmitter, restart the adapter. @@ -681,7 +678,7 @@ static int lance_tx(struct net_device *dev) lance_init_ring(dev); load_csrs(lp); init_restart_lance(lp); - return 0; + goto out; } } else if ((td->tmd1_bits & LE_T1_POK) == LE_T1_POK) { /* @@ -702,7 +699,12 @@ static int lance_tx(struct net_device *dev) j = (j + 1) & TX_RING_MOD_MASK; } lp->tx_old = j; - return 0; +out: + if (netif_queue_stopped(dev) && + TX_BUFFS_AVAIL > 0) + netif_wake_queue(dev); + + spin_unlock(&lp->lock); } static void lance_interrupt(const int irq, void *dev_id, struct pt_regs *regs) @@ -712,11 +714,6 @@ static void lance_interrupt(const int irq, void *dev_id, struct pt_regs *regs) volatile struct lance_regs *ll = lp->ll; int csr0; - if (dev->interrupt) - printk("%s: again\n", dev->name); - - dev->interrupt = 1; - writereg(&ll->rap, LE_CSR0); csr0 = ll->rdp; @@ -734,10 +731,6 @@ static void lance_interrupt(const int irq, void *dev_id, struct pt_regs *regs) if (csr0 & LE_C0_TINT) lance_tx(dev); - if ((TX_BUFFS_AVAIL >= 0) && dev->tbusy) { - dev->tbusy = 0; - mark_bh(NET_BH); - } if (csr0 & LE_C0_BABL) lp->stats.tx_errors++; @@ -763,17 +756,17 @@ static void lance_interrupt(const int irq, void *dev_id, struct pt_regs *regs) lance_init_ring(dev); load_csrs(lp); init_restart_lance(lp); - dev->tbusy = 0; + netif_wake_queue(dev); } writereg(&ll->rdp, LE_C0_INEA); writereg(&ll->rdp, LE_C0_INEA); - dev->interrupt = 0; } struct net_device *last_dev = 0; static int lance_open(struct net_device *dev) { + volatile struct lance_init_block *ib = (struct lance_init_block *) (dev->mem_start); struct lance_private *lp = (struct lance_private *) dev->priv; volatile struct lance_regs *ll = lp->ll; int status = 0; @@ -789,12 +782,20 @@ static int lance_open(struct net_device *dev) writereg(&ll->rap, LE_CSR0); writereg(&ll->rdp, LE_C0_STOP); + /* Set mode and clear multicast filter only at device open, + * so that lance_init_ring() called at any error will not + * forget multicast filters. + * + * BTW it is common bug in all lance drivers! --ANK + */ + ib->mode = 0; + ib->filter [0] = 0; + ib->filter [2] = 0; + lance_init_ring(dev); load_csrs(lp); - dev->tbusy = 0; - dev->interrupt = 0; - dev->start = 1; + netif_start_queue(dev); status = init_restart_lance(lp); @@ -811,8 +812,8 @@ static int lance_close(struct net_device *dev) struct lance_private *lp = (struct lance_private *) dev->priv; volatile struct lance_regs *ll = lp->ll; - dev->start = 0; - dev->tbusy = 1; + netif_stop_queue(dev); + del_timer_sync(&lp->multicast_timer); /* Stop the card */ writereg(&ll->rap, LE_CSR0); @@ -838,51 +839,30 @@ static inline int lance_reset(struct net_device *dev) lance_init_ring(dev); load_csrs(lp); dev->trans_start = jiffies; - dev->interrupt = 0; - dev->start = 1; - dev->tbusy = 0; status = init_restart_lance(lp); -#ifdef DEBUG_DRIVER - printk("Lance restart=%d\n", status); -#endif return status; } -static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) +static void lance_tx_timeout(struct net_device *dev) { struct lance_private *lp = (struct lance_private *) dev->priv; volatile struct lance_regs *ll = lp->ll; - volatile struct lance_init_block *ib; - unsigned long flags; - int entry, skblen, len; - int status = 0; - static int outs; - ib = (struct lance_init_block *) (dev->mem_start); - - /* Transmitter timeout, serious problems */ - if (dev->tbusy) { - int tickssofar = jiffies - dev->trans_start; - if (tickssofar < 100) { - status = -1; - } else { - printk("%s: transmit timed out, status %04x, reset\n", + printk(KERN_ERR "%s: transmit timed out, status %04x, reset\n", dev->name, ll->rdp); lance_reset(dev); - } - return status; - } - /* Block a timer-based transmit from overlapping. */ - if (test_and_set_bit(0, (void *) &dev->tbusy) != 0) { - printk("Transmitter access conflict.\n"); - return -1; - } + netif_wake_queue(dev); +} + +static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) +{ + struct lance_private *lp = (struct lance_private *) dev->priv; + volatile struct lance_regs *ll = lp->ll; + volatile struct lance_init_block *ib = (struct lance_init_block *) (dev->mem_start); + int entry, skblen, len; + skblen = skb->len; - save_and_cli(flags); - if (!TX_BUFFS_AVAIL) { - restore_flags(flags); - return -1; - } + len = (skblen <= ETH_ZLEN) ? ETH_ZLEN : skblen; lp->stats.tx_bytes += len; @@ -904,17 +884,18 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) ib->btx_ring[entry].tmd1_bits = (LE_T1_POK | LE_T1_OWN); lp->tx_new = (lp->tx_new + 1) & TX_RING_MOD_MASK; - outs++; + if (TX_BUFFS_AVAIL <= 0) + netif_stop_queue(dev); + /* Kick the lance: transmit now */ writereg(&ll->rdp, LE_C0_INEA | LE_C0_TDMD); + + spin_unlock_irq(&lp->lock); + dev->trans_start = jiffies; dev_kfree_skb(skb); - if (TX_BUFFS_AVAIL) - dev->tbusy = 0; - - restore_flags(flags); - return status; + return 0; } static struct net_device_stats *lance_get_stats(struct net_device *dev) @@ -983,11 +964,16 @@ static void lance_set_multicast(struct net_device *dev) ib = (struct lance_init_block *) (dev->mem_start); - while (dev->tbusy) - schedule(); - set_bit(0, (void *) &dev->tbusy); - while (lp->tx_old != lp->tx_new) - schedule(); + if (!netif_running(dev)) + return; + + if (lp->tx_old != lp->tx_new) { + mod_timer(&lp->multicast_timer, jiffies + 4); + netif_wake_queue(dev); + return; + } + + netif_stop_queue(dev); writereg(&ll->rap, LE_CSR0); writereg(&ll->rdp, LE_C0_STOP); @@ -1002,7 +988,14 @@ static void lance_set_multicast(struct net_device *dev) } load_csrs(lp); init_restart_lance(lp); - dev->tbusy = 0; + netif_wake_queue(dev); +} + +static void lance_set_multicast_retry(unsigned long _opaque) +{ + struct net_device *dev = (struct net_device *) _opaque; + + lance_set_multicast(dev); } static int __init dec_lance_init(struct net_device *dev, const int type) @@ -1167,14 +1160,14 @@ static int __init dec_lance_init(struct net_device *dev, const int type) printk(" irq = %d\n", dev->irq); - /* Fill the dev fields */ - - dev->open = lance_open; - dev->stop = lance_close; - dev->hard_start_xmit = lance_start_xmit; - dev->get_stats = lance_get_stats; - dev->set_multicast_list = lance_set_multicast; - dev->dma = 0; + lp->dev = dev; + dev->open = &lance_open; + dev->stop = &lance_close; + dev->hard_start_xmit = &lance_start_xmit; + dev->tx_timeout = &lance_tx_timeout; + dev->watchdog_timeo = 5*HZ; + dev->get_stats = &lance_get_stats; + dev->set_multicast_list = &lance_set_multicast; /* lp->ll is the location of the registers for lance card */ lp->ll = ll; @@ -1185,25 +1178,39 @@ static int __init dec_lance_init(struct net_device *dev, const int type) * specification. */ lp->busmaster_regval = 0; - lp->dev = dev; + + dev->dma = 0; ether_setup(dev); -/* - #ifdef MODULE + + /* We cannot sleep if the chip is busy during a + * multicast list update event, because such events + * can occur from interrupts (ex. IPv6). So we + * use a timer to try again later when necessary. -DaveM + */ + init_timer(&lp->multicast_timer); + lp->multicast_timer.data = (unsigned long) dev; + lp->multicast_timer.function = &lance_set_multicast_retry; + +#ifdef MODULE dev->ifindex = dev_new_index(); lp->next_module = root_lance_dev; root_lance_dev = lp; - #endif - */ +#endif return 0; } /* Find all the lance cards on the system and initialize them */ -int __init dec_lance_probe(struct net_device *dev) +static int __init dec_lance_probe(void) { + struct net_device *dev = NULL; static int called = 0; +#ifdef MODULE + root_lance_dev = NULL; +#endif + #ifdef CONFIG_TC int slot = -1; @@ -1238,19 +1245,9 @@ int __init dec_lance_probe(struct net_device *dev) return dec_lance_init(dev, type); } -/* - #ifdef MODULE - - int - init_module(void) - { - root_lance_dev = NULL; - return dec_lance_probe(NULL); - } - - void - cleanup_module(void) - { +static void __exit dec_lance_cleanup(void) +{ +#ifdef MODULE struct lance_private *lp; while (root_lance_dev) { @@ -1260,6 +1257,8 @@ int __init dec_lance_probe(struct net_device *dev) kfree(root_lance_dev->dev); root_lance_dev = lp; } - } +#endif /* MODULE */ +} - #endif -* MODULE */ +module_init(dec_lance_probe); +module_exit(dec_lance_cleanup); diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index afb6cbfeb04b..048f7edd1657 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -2206,7 +2206,7 @@ static struct pci_device_id eepro100_pci_tbl[] __devinitdata = { PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82559ER, PCI_ANY_ID, PCI_ANY_ID, }, - { 0,}, + { 0,} }; MODULE_DEVICE_TABLE(pci, eepro100_pci_tbl); diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index 80a756ae8537..6e6af292f8d3 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c @@ -189,7 +189,7 @@ static struct pci_device_id epic_pci_tbl[] __devinitdata = { { 0x10B8, 0x0005, 0x1092, 0x0AB4, 0, 0, SMSC_83C170_0 }, { 0x10B8, 0x0005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SMSC_83C170 }, { 0x10B8, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SMSC_83C175 }, - { 0,}, + { 0,} }; MODULE_DEVICE_TABLE (pci, epic_pci_tbl); diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c index eb571db3ddc6..8a3952df44e1 100644 --- a/drivers/net/ioc3-eth.c +++ b/drivers/net/ioc3-eth.c @@ -97,6 +97,7 @@ struct ioc3_private { int rx_pi; /* RX producer index */ int tx_ci; /* TX consumer index */ int tx_pi; /* TX producer index */ + spinlock_t ioc3_lock; }; /* We use this to acquire receive skb's that we can DMA directly into. */ @@ -390,6 +391,7 @@ ioc3_tx(struct ioc3_private *ip, struct ioc3 *ioc3) struct sk_buff *skb; u32 etcir; + spin_lock(&ip->ioc3_lock); etcir = ioc3->etcir; tx_entry = (etcir >> 7) & 127; o_entry = ip->tx_ci; @@ -401,7 +403,7 @@ ioc3_tx(struct ioc3_private *ip, struct ioc3 *ioc3) skb = ip->tx_skbs[o_entry]; ip->stats.tx_packets++; ip->stats.tx_bytes += skb->len; - dev_kfree_skb(skb); + dev_kfree_skb_irq(skb); ip->tx_skbs[o_entry] = NULL; o_entry = (o_entry + 1) & 127; /* Next */ @@ -410,6 +412,7 @@ ioc3_tx(struct ioc3_private *ip, struct ioc3 *ioc3) tx_entry = (etcir >> 7) & 127; } ip->tx_ci = o_entry; + spin_unlock(&ip->ioc3_lock); } /* @@ -602,20 +605,30 @@ ioc3_ssram_disc(struct ioc3_private *ip) static void ioc3_probe1(struct net_device *dev, struct ioc3 *ioc3) { - struct ioc3_private *p; + struct ioc3_private *ip; dev = init_etherdev(dev, 0); - p = (struct ioc3_private *) kmalloc(sizeof(*p), GFP_KERNEL); - memset(p, 0, sizeof(*p)); - dev->priv = p; + + /* + * This probably needs to be register_netdevice, or call + * init_etherdev so that it calls register_netdevice. Quick + * hack for now. + */ + netif_device_attach(dev); + + ip = (struct ioc3_private *) kmalloc(sizeof(*ip), GFP_KERNEL); + memset(ip, 0, sizeof(*ip)); + dev->priv = ip; dev->irq = IOC3_ETH_INT; - p->regs = ioc3; + ip->regs = ioc3; - ioc3_eth_init(dev, p, ioc3); - ioc3_ssram_disc(p); + ioc3_eth_init(dev, ip, ioc3); + ioc3_ssram_disc(ip); ioc3_get_eaddr(dev, ioc3); - ioc3_init_rings(dev, p, ioc3); + ioc3_init_rings(dev, ip, ioc3); + + spin_lock_init(&ip->ioc3_lock); /* Misc registers */ ioc3->erbar = 0; @@ -702,6 +715,7 @@ ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev) return 1; } + spin_lock_irq(&ip->ioc3_lock); data = (unsigned long) skb->data; len = skb->len; @@ -718,7 +732,7 @@ ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev) } desc->cmd = len | ETXD_INTWHENDONE | ETXD_D0V; desc->bufcnt = len; - } if ((data ^ (data + len)) & 0x4000) { + } else if ((data ^ (data + len)) & 0x4000) { unsigned long b2, s1, s2; b2 = (data | 0x3fffUL) + 1UL; @@ -747,6 +761,7 @@ ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev) if (TX_BUFFS_AVAIL(ip)) netif_wake_queue(dev); + spin_unlock_irq(&ip->ioc3_lock); return 0; } diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c index c36c76dff99c..3f40f5aaed9e 100644 --- a/drivers/net/ne2k-pci.c +++ b/drivers/net/ne2k-pci.c @@ -115,7 +115,7 @@ static struct pci_device_id ne2k_pci_tbl[] __devinitdata = { { 0x1050, 0x5a5a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Winbond_W89C940F }, { 0x12c3, 0x0058, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Holtek_HT80232 }, { 0x12c3, 0x5598, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Holtek_HT80229 }, - { 0, }, + { 0, } }; MODULE_DEVICE_TABLE(pci, ne2k_pci_tbl); diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 7b1f7644808a..dc580b0fe5cc 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c @@ -334,9 +334,11 @@ static struct pci_device_id pcnet32_pci_tbl[] __devinitdata = { { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_PCNETHOME, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE, 0x1014, 0x2000, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0, 0 }, + { 0, } }; +MODULE_DEVICE_TABLE (pci, pcnet32_pci_tbl); + static u16 pcnet32_wio_read_csr (unsigned long addr, int index) { outw (index, addr+PCNET32_WIO_RAP); diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c index 2e0bf0046139..15a304c4f516 100644 --- a/drivers/net/sgiseeq.c +++ b/drivers/net/sgiseeq.c @@ -1,4 +1,4 @@ -/* $Id: sgiseeq.c,v 1.9 1998/10/14 23:40:46 ralf Exp $ +/* $Id: sgiseeq.c,v 1.17 2000/03/27 23:02:57 ralf Exp $ * * sgiseeq.c: Seeq8003 ethernet driver for SGI machines. * @@ -694,15 +694,14 @@ int sgiseeq_probe(struct net_device *dev) char *ep; if (initialized) /* Already initialized? */ - return 0; + return 1; initialized++; - /* First get the ethernet address of the onboard - * interface from ARCS. + /* First get the ethernet address of the onboard interface from ARCS. * This is fragile; PROM doesn't like running from cache. - * On MIPS64 it crashes for some other, yet unknown reason. + * On MIPS64 it crashes for some other, yet unknown reason ... */ - ep = romvec->get_evar("eaddr"); + ep = ArcGetEnvironmentVariable("eaddr"); str2eaddr(onboard_eth_addr, ep); return sgiseeq_init(dev, (struct sgiseeq_regs *) (KSEG1ADDR(0x1fbd4000)), diff --git a/drivers/net/sgiseeq.h b/drivers/net/sgiseeq.h index ed66e2bf9899..0b5d39c688a7 100644 --- a/drivers/net/sgiseeq.h +++ b/drivers/net/sgiseeq.h @@ -1,4 +1,4 @@ -/* $Id: sgiseeq.h,v 1.5 1999/12/04 03:59:03 ralf Exp $ +/* $Id: sgiseeq.h,v 1.4 1999/10/09 00:01:24 ralf Exp $ * sgiseeq.h: Defines for the Seeq8003 ethernet controller. * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index b48b726f646b..8efaf47f8bd2 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c @@ -75,11 +75,12 @@ static char * card_names[] = { "SiS 900 PCI Fast Ethernet", "SiS 7016 PCI Fast Ethernet" }; -static struct pci_device_id sis900_pci_tbl [] __initdata = { +static struct pci_device_id sis900_pci_tbl [] __devinitdata = { {PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_900}, {PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7016, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_7018} + PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_7018}, + {0,} }; MODULE_DEVICE_TABLE (pci, sis900_pci_tbl); diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index 3d59d63c1635..b5f70ff1616f 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c @@ -211,7 +211,7 @@ enum chipset { static struct pci_device_id starfire_pci_tbl[] __devinitdata = { { 0x9004, 0x6915, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_6915 }, - { 0, }, + { 0, } }; MODULE_DEVICE_TABLE(pci, starfire_pci_tbl); diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index bc4dec29cb3e..12cee4da5390 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c @@ -168,7 +168,7 @@ static struct pci_device_id tulip_pci_tbl[] __devinitdata = { { 0x1282, 0x9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DC21140 }, { 0x1282, 0x9102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DC21140 }, { 0x1113, 0x1217, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MX98715 }, - {0}, + {0, } }; MODULE_DEVICE_TABLE(pci, tulip_pci_tbl); diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index 77816670f30e..67db42e974e7 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c @@ -291,7 +291,7 @@ static struct pci_device_id via_rhine_pci_tbl[] __devinitdata = { {0x1106, 0x6100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT86C100A}, {0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT3043}, - {0,}, /* terminate list */ + {0,} /* terminate list */ }; MODULE_DEVICE_TABLE(pci, via_rhine_pci_tbl); diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index ebf339d2ee96..6346873e8873 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c @@ -112,7 +112,7 @@ int LMC_PKT_BUF_SZ = 1542; #ifdef MODULE static struct pci_device_id lmc_pci_tbl[] __devinitdata = { { 0x1011, 0x009, 0x1379, PCI_ANY_ID, 0, 0, 0}, - { 0 }, + { 0, } }; MODULE_DEVICE_TABLE(pci, lmc_pci_tbl); diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index 2be7d5823e1c..4e2d6435e87e 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c @@ -237,7 +237,7 @@ static struct chip_info chip_info[] = { static struct pci_device_id yellowfin_pci_tbl[] __devinitdata = { { 0x1000, 0x0702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, YELLOWFIN_GNIC }, { 0x1000, 0x0701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SYM83C885 }, - { 0, }, + { 0, } }; MODULE_DEVICE_TABLE (pci, yellowfin_pci_tbl); diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 09255a3c1067..5c78c1565684 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c @@ -2360,7 +2360,7 @@ static struct pci_device_id parport_pc_pci_tbl[] __devinitdata = { PCI_ANY_ID, PCI_ANY_ID, 0, 0, afavlab_tk9902 }, { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889, PCI_ANY_ID, PCI_ANY_ID, 0, 0, timedia_1889 }, - { 0, }, /* terminate list */ + { 0, } /* terminate list */ }; MODULE_DEVICE_TABLE(pci,parport_pc_pci_tbl); diff --git a/drivers/sound/emu10k1/main.c b/drivers/sound/emu10k1/main.c index 5f06dc3680f3..bce892fe33ce 100644 --- a/drivers/sound/emu10k1/main.c +++ b/drivers/sound/emu10k1/main.c @@ -80,7 +80,7 @@ static char *card_names[] __devinitdata = { "EMU10K1", }; -static struct pci_device_id emu10k1_pci_tbl[] = { +static struct pci_device_id emu10k1_pci_tbl[] __devinitdata = { {PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_EMU10K1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, EMU10K1}, {0,} diff --git a/drivers/sound/es1370.c b/drivers/sound/es1370.c index f45734771377..7f05925cd5e7 100644 --- a/drivers/sound/es1370.c +++ b/drivers/sound/es1370.c @@ -2599,7 +2599,7 @@ static void __devinit es1370_remove(struct pci_dev *dev) static struct pci_device_id id_table[] __devinitdata = { { PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_ES1370, PCI_ANY_ID, PCI_ANY_ID, 0, 0 }, - { 0, 0, 0, 0, 0, 0 } + { 0, } }; MODULE_DEVICE_TABLE(pci, id_table); diff --git a/drivers/sound/es1371.c b/drivers/sound/es1371.c index 8ae10a074f80..1623c98ba681 100644 --- a/drivers/sound/es1371.c +++ b/drivers/sound/es1371.c @@ -2804,7 +2804,7 @@ static struct pci_device_id id_table[] __devinitdata = { { PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_ES1371, PCI_ANY_ID, PCI_ANY_ID, 0, 0 }, { PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_CT5880, PCI_ANY_ID, PCI_ANY_ID, 0, 0 }, { PCI_VENDOR_ID_ECTIVA, PCI_DEVICE_ID_ECTIVA_EV1938, PCI_ANY_ID, PCI_ANY_ID, 0, 0 }, - { 0, 0, 0, 0, 0, 0 } + { 0, } }; MODULE_DEVICE_TABLE(pci, id_table); diff --git a/drivers/sound/esssolo1.c b/drivers/sound/esssolo1.c index aa1fc77d19ed..1c62eafed743 100644 --- a/drivers/sound/esssolo1.c +++ b/drivers/sound/esssolo1.c @@ -2335,7 +2335,7 @@ static void __devinit solo1_remove(struct pci_dev *dev) static struct pci_device_id id_table[] __devinitdata = { { PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_SOLO1, PCI_ANY_ID, PCI_ANY_ID, 0, 0 }, - { 0, 0, 0, 0, 0, 0 } + { 0, } }; MODULE_DEVICE_TABLE(pci, id_table); diff --git a/drivers/sound/i810_audio.c b/drivers/sound/i810_audio.c index 76bfcc3c0580..4e42146614bd 100644 --- a/drivers/sound/i810_audio.c +++ b/drivers/sound/i810_audio.c @@ -189,7 +189,7 @@ static char * card_names[] = { "Intel 440MX" }; -static struct pci_device_id i810_pci_tbl [] __initdata = { +static struct pci_device_id i810_pci_tbl [] __devinitdata = { {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ICH82801AA}, {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82901, diff --git a/drivers/sound/sb_card.c b/drivers/sound/sb_card.c index 427167b3d759..a6e5448567ad 100644 --- a/drivers/sound/sb_card.c +++ b/drivers/sound/sb_card.c @@ -249,6 +249,11 @@ static struct { ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031), 0,0,0,0, 0,1,1,-1}, + {"Sound Blaster 16", + ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x0025), + ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031), + 0,0,0,0, + 0,1,1,-1}, {"Sound Blaster 16", ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x0026), ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031), @@ -364,6 +369,11 @@ static struct { ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0045), 0,0,0,0, 0,1,1,-1}, + {"ESS 1688", + ISAPNP_VENDOR('E','S','S'), ISAPNP_DEVICE(0x0968), + ISAPNP_VENDOR('E','S','S'), ISAPNP_FUNCTION(0x0968), + 0,0,0,0, + 0,1,2,-1}, {"ESS 1868", ISAPNP_VENDOR('E','S','S'), ISAPNP_DEVICE(0x1868), ISAPNP_VENDOR('E','S','S'), ISAPNP_FUNCTION(0x1868), @@ -442,11 +452,6 @@ static struct { ISAPNP_VENDOR('@','X','@'), ISAPNP_FUNCTION(0x2001), ISAPNP_VENDOR('@','H','@'), ISAPNP_FUNCTION(0x0001), 1,0,0,0}, - {"Creative SB16 PnP", - ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x002a), - ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031), - 0,0,0,0, - 0,1,1,-1}, {0} }; diff --git a/drivers/sound/sonicvibes.c b/drivers/sound/sonicvibes.c index 6588f3b3f6e1..5aa31f506575 100644 --- a/drivers/sound/sonicvibes.c +++ b/drivers/sound/sonicvibes.c @@ -2634,7 +2634,7 @@ static void __devinit sv_remove(struct pci_dev *dev) static struct pci_device_id id_table[] __devinitdata = { { PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_SONICVIBES, PCI_ANY_ID, PCI_ANY_ID, 0, 0 }, - { 0, 0, 0, 0, 0, 0 } + { 0, } }; MODULE_DEVICE_TABLE(pci, id_table); diff --git a/drivers/sound/trident.c b/drivers/sound/trident.c index a1f462f3b34d..aa680aefc98e 100644 --- a/drivers/sound/trident.c +++ b/drivers/sound/trident.c @@ -147,7 +147,7 @@ static char * card_names[] = { "ALi Audio Accelerator" }; -static struct pci_device_id trident_pci_tbl [] __initdata = { +static struct pci_device_id trident_pci_tbl [] __devinitdata = { {PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TRIDENT_4D_DX}, {PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX, diff --git a/drivers/sound/via82cxxx_audio.c b/drivers/sound/via82cxxx_audio.c index 47bac97d85f8..03aa75bf0878 100644 --- a/drivers/sound/via82cxxx_audio.c +++ b/drivers/sound/via82cxxx_audio.c @@ -303,9 +303,9 @@ static void via_chan_pcm_fmt (struct via_info *card, */ -static struct pci_device_id via_pci_tbl[] __initdata = { +static struct pci_device_id via_pci_tbl[] __devinitdata = { { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { 0, }, + { 0, } }; MODULE_DEVICE_TABLE(pci,via_pci_tbl); diff --git a/drivers/tc/tc.c b/drivers/tc/tc.c index 30cabd0edfa0..04de10d9443e 100644 --- a/drivers/tc/tc.c +++ b/drivers/tc/tc.c @@ -1,4 +1,4 @@ -/* $Id: $ +/* $Id: tc.c,v 1.3 1999/10/09 00:01:32 ralf Exp $ * tc-init: We assume the TURBOchannel to be up and running so * just probe for Modules and fill in the global data structure * tc_bus. @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -231,6 +232,6 @@ void __init tc_init(void) tc_bus[i].name, tc_bus[i].firmware); } #endif + ioport_resource.end = KSEG2 - 1; } - } diff --git a/drivers/tc/tcsyms.c b/drivers/tc/tcsyms.c index 88af39ec5f7b..9e3a24dca70f 100644 --- a/drivers/tc/tcsyms.c +++ b/drivers/tc/tcsyms.c @@ -1,13 +1,14 @@ /* - * Turbo Channel Services -- Exported Symbols + * TURBOchannel Services -- Exported Symbols * */ #include #include -EXPORT_SYMBOL(get_tc_irq_nr); -EXPORT_SYMBOL(claim_tc_card); EXPORT_SYMBOL(search_tc_card); -EXPORT_SYMBOL(get_tc_speed); +EXPORT_SYMBOL(claim_tc_card); +EXPORT_SYMBOL(release_tc_card); EXPORT_SYMBOL(get_tc_base_addr); +EXPORT_SYMBOL(get_tc_irq_nr); +EXPORT_SYMBOL(get_tc_speed); diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c index 46f4c152ca9c..af219cd5652f 100644 --- a/drivers/tc/zs.c +++ b/drivers/tc/zs.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -155,7 +156,7 @@ static struct termios *serial_termios_locked[NUM_CHANNELS]; * memory if large numbers of serial ports are open. */ static unsigned char tmp_buf[4096]; /* This is cheating */ -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); static inline int serial_paranoia_check(struct dec_serial *info, dev_t device, const char *routine) @@ -195,7 +196,7 @@ static inline unsigned char read_zsreg(struct dec_zschannel *channel, if (reg != 0) { *channel->control = reg & 0xf; - RECOVERY_DELAY; + wbflush(); RECOVERY_DELAY; } retval = *channel->control; RECOVERY_DELAY; @@ -207,10 +208,10 @@ static inline void write_zsreg(struct dec_zschannel *channel, { if (reg != 0) { *channel->control = reg & 0xf; - RECOVERY_DELAY; + wbflush(); RECOVERY_DELAY; } *channel->control = value; - RECOVERY_DELAY; + wbflush(); RECOVERY_DELAY; return; } @@ -227,7 +228,7 @@ static inline void write_zsdata(struct dec_zschannel *channel, unsigned char value) { *channel->data = value; - RECOVERY_DELAY; + wbflush(); RECOVERY_DELAY; return; } @@ -1313,7 +1314,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) char_time = 1; if (timeout) char_time = MIN(char_time, timeout); - while ((read_zsreg(info->zs_channel, 1) & ALL_SNT) == 0) { + while ((read_zsreg(info->zs_channel, 1) & Tx_BUF_EMP) == 0) { current->state = TASK_INTERRUPTIBLE; schedule_timeout(char_time); if (signal_pending(current)) @@ -1351,7 +1352,7 @@ void rs_hangup(struct tty_struct *tty) static int block_til_ready(struct tty_struct *tty, struct file * filp, struct dec_serial *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int retval; int do_clocal = 0; @@ -1773,8 +1774,8 @@ int __init zs_init(void) info->tqueue.data = info; info->callout_termios =callout_driver.init_termios; info->normal_termios = serial_driver.init_termios; - info->open_wait = 0; - info->close_wait = 0; + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); printk("tty%02d at 0x%08x (irq = %d)", info->line, info->port, info->irq); printk(" is a Z85C30 SCC\n"); @@ -1828,7 +1829,7 @@ zs_console_putchar(struct dec_serial *info, char ch) while (!(*(info->zs_channel->control) & Tx_BUF_EMP) && --loops) RECOVERY_DELAY; *(info->zs_channel->data) = ch; - RECOVERY_DELAY; + wbflush(); RECOVERY_DELAY; restore_flags(flags); } @@ -2021,10 +2022,9 @@ static struct console sercons = { /* * Register console. */ -long __init zs_serial_console_init(long kmem_start, long kmem_end) +void __init zs_serial_console_init(void) { register_console(&sercons); - return kmem_start; } #endif /* ifdef CONFIG_SERIAL_CONSOLE */ diff --git a/drivers/tc/zs.h b/drivers/tc/zs.h index d45ce05ed1de..e10e1c3d2c34 100644 --- a/drivers/tc/zs.h +++ b/drivers/tc/zs.h @@ -142,8 +142,8 @@ struct dec_serial { struct tq_struct tqueue_hangup; struct termios normal_termios; struct termios callout_termios; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; }; diff --git a/drivers/video/newport_con.c b/drivers/video/newport_con.c index 3f775b726bca..3d461df5de98 100644 --- a/drivers/video/newport_con.c +++ b/drivers/video/newport_con.c @@ -1,9 +1,9 @@ -/* $Id: newport_con.c,v 1.13 1999/04/11 10:37:08 ulfc Exp $ +/* $Id: newport_con.c,v 1.14 1999/06/24 01:10:24 ulfc Exp $ * * newport_con.c: Abscon for newport hardware * * (C) 1998 Thomas Bogendoerfer (tsbogend@alpha.franken.de) - * (C) 1999 Ulf Carlsson (ulfc@bun.falkenberg.se) + * (C) 1999 Ulf Carlsson (ulfc@thepuffingruop.com) * * This driver is based on sgicons.c and cons_newport. * @@ -26,14 +26,19 @@ #include #include #include -#include +#include